Bug #46414 MySQL crash on UPDATE with ODBC
Submitted: 27 Jul 2009 19:24 Modified: 27 Jul 2009 21:02
Reporter: Lincoln Ferreira Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:5.1.36 OS:Microsoft Windows (XP SP3)
Assigned to:
Tags: crash, ODBC, UPDATE

[27 Jul 2009 19:24] Lincoln Ferreira
Description:
When I run my application (ODBC based) to UPDATE one record (maybe non-existent) on table, then MySQL crashes.

Since MySQL 4.1 to 5.0 my application work fine.

If I run my application on DEBUG mode (step by step) works fine. Perhaps because a long delay between querys.

How to repeat:
It's impossible to repeat using command line (or I don't know how), but the error sequence happens like this:

#First QUERY block
UPDATE PENDENTES SET ESTACAOLOCK=12 WHERE ESTACAOLOCK=0 AND DATAMOV=15099 ORDER BY AUTOSEQUENCIAL LIMIT 1;
COMMIT;
SELECT * FROM PENDENTES WHERE ESTACAOLOCK=12 LIMIT 1;
COMMIT;
SELECT * FROM INFORMADO WHERE BANCOCMC7=399 AND AGENCIACMC7=307 AND NUMEROCMC7=123465 AND CONTACMC7=41193;
INSERT INTO CHEQUES_0907 (SELECT * FROM PENDENTES WHERE AUTOSEQUENCIAL=32);
SELECT * FROM PENDENTES WHERE AUTOSEQUENCIAL=32;
DELETE FROM PENDENTES WHERE AUTOSEQUENCIAL=32;
COMMIT;

#Next QUERY block - until there are results
UPDATE PENDENTES SET ESTACAOLOCK=12 WHERE ESTACAOLOCK=0 AND DATAMOV=15099 AND AUTOSEQUENCIAL>32 ORDER BY AUTOSEQUENCIAL LIMIT 1;
COMMIT;
SELECT * FROM PENDENTES WHERE ESTACAOLOCK=12 LIMIT 1;
COMMIT;
SELECT * FROM INFORMADO WHERE BANCOCMC7=399 AND AGENCIACMC7=307 AND NUMEROCMC7=123465 AND CONTACMC7=41193;
INSERT INTO CHEQUES_0907 (SELECT * FROM PENDENTES WHERE AUTOSEQUENCIAL=33);
SELECT * FROM PENDENTES WHERE AUTOSEQUENCIAL=33;
DELETE FROM PENDENTES WHERE AUTOSEQUENCIAL=33;
COMMIT;

#Last QUERY block
UPDATE PENDENTES SET ESTACAOLOCK=12 WHERE ESTACAOLOCK=0 AND DATAMOV=15099 AND AUTOSEQUENCIAL>35 ORDER BY AUTOSEQUENCIAL LIMIT 1;
COMMIT;
SELECT * FROM PENDENTES WHERE ESTACAOLOCK=12 LIMIT 1;
ROLLBACK;  #because there is no more results

#Retry QUERY block with no AUTOSEQUENCIAL argument - Like First QUERY block
UPDATE PENDENTES SET ESTACAOLOCK=12 WHERE ESTACAOLOCK=0 AND DATAMOV=15099 ORDER BY AUTOSEQUENCIAL LIMIT 1;
#HERE MySQL crash.
[27 Jul 2009 19:25] Lincoln Ferreira
ERR file from MySQL server

Attachment: log.err (application/octet-stream, text), 5.80 KiB.

[27 Jul 2009 19:26] Lincoln Ferreira
Variables from MySQL server

Attachment: variables.txt (text/plain), 39.78 KiB.

[27 Jul 2009 21:02] Miguel Solorzano
Thank you for the bug report. According the call stack from your log.err file this is duplicate of bug: http://bugs.mysql.com/bug.php?id=45357.