Details
-
Type:
Bug
-
Status: Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 5.5.25, 5.5
-
Fix Version/s: 5.5
-
Component/s: Storage Engine - MyISAM
Description
Also filed as http://bugs.mysql.com/bug.php?id=65786.
If mysql.proc table was open before server crash, then after recovery the next attempts to execute procedure-related DDL cause error 145 (Table './mysql/proc' is marked as crashed and should be repaired). It happens with myisam-recover-options = DEFAULT as well as with FORCE.
On 5.1-based versions, even the first DDL statement would succeed (with warnings). On 5.5, neither the first nor subsequent statements work, until the table is accessed explicitly, via CHECK, SHOW CREATE, SELECT etc.
Output of the provided test case:
CREATE PROCEDURE p1() BEGIN END; # Crash and restart server # Succeeds with warnings on 5.1, but fails on 5.5: CREATE PROCEDURE p2() BEGIN END; ERROR HY000: Table './mysql/proc' is marked as crashed and should be repaired # Fails on 5.5: CREATE PROCEDURE p2() BEGIN END; ERROR HY000: Table './mysql/proc' is marked as crashed and should be repaired # Throws warnings: SELECT 1 FROM mysql.proc WHERE 0; 1 Warnings: Error 145 Table './mysql/proc' is marked as crashed and should be repaired Error 1194 Table 'proc' is marked as crashed and should be repaired Error 1034 1 client is using or hasn't closed the table properly # Succeeds: CREATE PROCEDURE p2() BEGIN END; DROP PROCEDURE p1; DROP PROCEDURE p2;
bzr version-info
revision-id: monty@askmonty.org-20120627141312-z65pj80390f0f5pp date: 2012-06-27 17:13:12 +0300 build-date: 2012-07-02 19:42:37 +0400 revno: 3460
Also reproducible on MySQL 5.5/5.6.
Not reproducible on MySQL 5.1 and 5.1-based versions of MariaDB.
Test case:
# to reproduce on MySQL, run with --mysqld=--myisam-recover-options=FORCE # (it's not default there) CREATE PROCEDURE p1() BEGIN END; --echo # Crash and restart server --enable_reconnect --append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect restart EOF --shutdown_server 0 --source include/wait_until_disconnected.inc --source include/wait_until_connected_again.inc --echo # Succeeds with warnings on 5.1, but fails on 5.5: --error 145 CREATE PROCEDURE p2() BEGIN END; --echo # Fails on 5.5: --error 145 CREATE PROCEDURE p2() BEGIN END; --echo # Throws warnings: SELECT 1 FROM mysql.proc WHERE 0; --echo # Succeeds: CREATE PROCEDURE p2() BEGIN END; DROP PROCEDURE p1; DROP PROCEDURE p2;
Gliffy Diagrams
Attachments
Issue Links
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
We experience this bug randomly almost on a daily basis (we manage a very large amount of MariaDB servers). We have build a separate system to automatically fix the table (e.g. mysqlcheck --auto-repair --all-databases -F does manage to fix it), so it's not always easy to collect useful data. We did get a copy of mysql.proc in a crashed state but it does auto-repair in our testing environment. Although less frequently, procs_priv also appears affected sometimes.
Any information that can help to solve this, please let me know and I try to get it.