Description:
I'm using bdb tables. I've tested a rollback operation generating a duplicate keys entry error in a bdb table ( ). Mysqld crashed! To restart Mysqld I deleted the file log.0000000001 in the data directory. I'm using php 4.x wiht Adodb lybrary to connetct to the DB.
This is the "incriminating" code:
$WEBDATA->StartTrans();
//testata
$WEBDATA->Execute("INSERT INTO WBSOM00F (NROROO, CDDTOO, TDOCOO, CDCFOO, DTOROO, NRCFOO, CDPAOO, ORIGOO, STELOO, DTHIOO, IPOROO, CSPEOO)
VALUES ('$nlastord','$CDDTOO', '$TDOCOO', '$CDCFOO', '$DTOROO', '$NRCFOO', '$CDPAOO', '$ORIGOO', '$STELOO', '$DTHIOO', '$IPOROO', '$CSPEOO')");
//righe
$WEBDATA->Execute("INSERT INTO WBSOM01F (CDDTOO, TDOCOO, NROROO, CDAROO, TIMOOO, CDUMOO, PZNEOO, DSAROO, QTOROO, QTIOOO, STELOO)
SELECT '01' AS CDDTOO, 'W' AS TDOCOO, '$nlastord' AS NROROO, CDAROO, '01' AS TIMOOO, CDUMOO, PZNEOO, DSAROO, QTOROO, QTIOOO, '0' AS STELOO
FROM CART LEFT JOIN UTENTI ON (CART.CDCFOO = UTENTI.CONTCA) WHERE UTENTE='$selutente'");
//delete carrello
$WEBDATA->Execute("DELETE FROM CART USING CART, UTENTI WHERE CART.CDCFOO=UTENTI.CONTCA AND UTENTE='$selutente'");
//se รจ tutto ok procedo col commit
$WEBDATA->CompleteTrans();
There are the structures of the tables:
CART: CREATE TABLE `CART` (
`CDCFOO` varchar(10) NOT NULL default '',
`NRRGOO` int(3) NOT NULL auto_increment,
`CDAROO` varchar(13) NOT NULL default '',
`CDUMOO` char(2) NOT NULL default '',
`PZNEOO` decimal(19,6) NOT NULL default '0.000000',
`DSAROO` varchar(80) NOT NULL default '',
`QTOROO` decimal(13,4) NOT NULL default '0.0000',
`QTIOOO` decimal(13,4) NOT NULL default '0.0000',
`FLAGOR` int(1) NOT NULL default '0',
`DSAG01` varchar(255) default NULL,
PRIMARY KEY (`CDCFOO`,`NRRGOO`)
) TYPE=BerkeleyDB ROW_FORMAT=DYNAMIC
WBSOM00F: CREATE TABLE `WBSOM00F` (
`CDDTOO` char(2) NOT NULL default '',
`TDOCOO` char(1) NOT NULL default '',
`NROROO` decimal(7,0) NOT NULL default '0',
`CDCFOO` char(10) NOT NULL default '',
`DTOROO` decimal(8,0) NOT NULL default '0',
`CSPEOO` char(10) NOT NULL default '',
`NRCFOO` char(20) NOT NULL default '',
`NSRIOO` char(20) NOT NULL default '',
`DTCFOO` decimal(8,0) NOT NULL default '0',
`CDPAOO` char(3) NOT NULL default '',
`PRSCOO` decimal(8,0) NOT NULL default '0',
`DSBAOO` char(40) NOT NULL default '',
`SCCLOO` decimal(4,2) NOT NULL default '0.00',
`SCPROO` decimal(4,2) NOT NULL default '0.00',
`SCPAOO` decimal(4,2) NOT NULL default '0.00',
`CLISOO` char(10) NOT NULL default '',
`CDAGOO` char(3) NOT NULL default '',
`CDSAOO` char(3) NOT NULL default '',
`CDIMOO` char(2) NOT NULL default '',
`CDCNOO` char(2) NOT NULL default '',
`CDSPOO` char(4) NOT NULL default '',
`CDVEOO` char(4) NOT NULL default '',
`CDCTOO` char(2) NOT NULL default '',
`CDVAOO` char(4) NOT NULL default '',
`CAMBOO` decimal(13,6) NOT NULL default '0.000000',
`CDLGOO` char(2) NOT NULL default '',
`CDABOO` decimal(5,0) NOT NULL default '0',
`CDCAOO` decimal(5,0) NOT NULL default '0',
`DSCFOF` char(40) NOT NULL default '',
`INDIOF` char(60) NOT NULL default '',
`CAPOF` char(9) NOT NULL default '',
`LOCAOF` char(25) NOT NULL default '',
`PROVOF` char(2) NOT NULL default '',
`CDNZOF` char(4) NOT NULL default '',
`ORIGOO` char(1) NOT NULL default '',
`STELOO` decimal(1,0) NOT NULL default '0',
`SINCOO` char(16) NOT NULL default '',
`DTHIOO` char(16) NOT NULL default '',
`IPOROO` char(15) NOT NULL default '',
`TDOGOO` char(1) NOT NULL default '',
`NROGOO` decimal(7,0) NOT NULL default '0',
`DTHMOO` char(16) NOT NULL default '',
PRIMARY KEY (`CDDTOO`,`TDOCOO`,`NROROO`)
) TYPE=BerkeleyDB
WBSOM01F: CREATE TABLE `WBSOM01F` (
`CDDTOO` char(2) NOT NULL default '',
`TDOCOO` char(1) NOT NULL default '',
`NROROO` decimal(7,0) NOT NULL default '0',
`NRRGOO` int(3) NOT NULL auto_increment,
`CDAROO` char(13) NOT NULL default '',
`DTRCOO` decimal(8,0) NOT NULL default '0',
`DTCCOO` decimal(8,0) NOT NULL default '0',
`DTUCOO` decimal(8,0) NOT NULL default '0',
`DTPMOO` decimal(8,0) NOT NULL default '0',
`TIMOOO` char(2) NOT NULL default '',
`CDUMOO` char(2) NOT NULL default '',
`COEFOO` decimal(9,4) NOT NULL default '0.0000',
`PRZUOO` decimal(19,6) NOT NULL default '0.000000',
`PRZUOO1` decimal(19,6) NOT NULL default '0.000000',
`PRZUOO2` decimal(19,6) NOT NULL default '0.000000',
`PZNEOO` decimal(19,6) NOT NULL default '0.000000',
`PZNEOO1` decimal(19,6) NOT NULL default '0.000000',
`PZNEOO2` decimal(19,6) NOT NULL default '0.000000',
`PZNLOO` decimal(19,6) NOT NULL default '0.000000',
`PZNLOO1` decimal(19,6) NOT NULL default '0.000000',
`PZNLOO2` decimal(19,6) NOT NULL default '0.000000',
`SCN1OO` decimal(4,2) NOT NULL default '0.00',
`SCN2OO` decimal(4,2) NOT NULL default '0.00',
`SCN3OO` decimal(4,2) NOT NULL default '0.00',
`SCN4OO` decimal(4,2) NOT NULL default '0.00',
`SCCAOO` decimal(19,6) NOT NULL default '0.000000',
`SCCAOO2` decimal(19,6) NOT NULL default '0.000000',
`FSCCOO` char(1) NOT NULL default '',
`AUSCOO` decimal(19,6) NOT NULL default '0.000000',
`AUSCOO2` decimal(19,6) NOT NULL default '0.000000',
`FAUSOO` char(1) NOT NULL default '',
`TANOOO` decimal(19,6) NOT NULL default '0.000000',
`TANOOO2` decimal(19,6) NOT NULL default '0.000000',
`FTAOOO` char(1) NOT NULL default '',
`AUPROO` decimal(19,6) NOT NULL default '0.000000',
`AUPROO2` decimal(19,6) NOT NULL default '0.000000',
`FAUPOO` char(1) NOT NULL default '',
`SCPMOO` decimal(19,6) NOT NULL default '0.000000',
`SCPMOO2` decimal(19,6) NOT NULL default '0.000000',
`FAPMOO` char(1) NOT NULL default '',
`SCNCOO` decimal(19,6) NOT NULL default '0.000000',
`SCNCOO2` decimal(19,6) NOT NULL default '0.000000',
`FSNCOO` char(1) NOT NULL default '',
`ALIVOO` char(2) NOT NULL default '',
`DSAROO` char(40) NOT NULL default '',
`QTOROO` decimal(13,4) NOT NULL default '0.0000',
`QTIOOO` decimal(13,4) NOT NULL default '0.0000',
`QTISOO` decimal(13,4) NOT NULL default '0.0000',
`QTGSOO` decimal(13,4) NOT NULL default '0.0000',
`QTPZOO` decimal(13,4) NOT NULL default '0.0000',
`SAACOO` char(1) NOT NULL default '',
`PESOOO` decimal(13,4) NOT NULL default '0.0000',
`PSLOOO` decimal(13,4) NOT NULL default '0.0000',
`STELOO` decimal(1,0) NOT NULL default '0',
`SINCOO` char(16) NOT NULL default '',
`DTHIOO` char(16) NOT NULL default '',
`DTHMOO` char(16) NOT NULL default '',
PRIMARY KEY (`CDDTOO`,`TDOCOO`,`NROROO`,`NRRGOO`)
) TYPE=BerkeleyDB
WBSOM01F CREATE TABLE `WBSOM01F` (
`CDDTOO` char(2) NOT NULL default '',
`TDOCOO` char(1) NOT NULL default '',
`NROROO` decimal(7,0) NOT NULL default '0',
`NRRGOO` int(3) NOT NULL auto_increment,
`CDAROO` char(13) NOT NULL default '',
`DTRCOO` decimal(8,0) NOT NULL default '0',
`DTCCOO` decimal(8,0) NOT NULL default '0',
`DTUCOO` decimal(8,0) NOT NULL default '0',
`DTPMOO` decimal(8,0) NOT NULL default '0',
`TIMOOO` char(2) NOT NULL default '',
`CDUMOO` char(2) NOT NULL default '',
`COEFOO` decimal(9,4) NOT NULL default '0.0000',
`PRZUOO` decimal(19,6) NOT NULL default '0.000000',
`PRZUOO1` decimal(19,6) NOT NULL default '0.000000',
`PRZUOO2` decimal(19,6) NOT NULL default '0.000000',
`PZNEOO` decimal(19,6) NOT NULL default '0.000000',
`PZNEOO1` decimal(19,6) NOT NULL default '0.000000',
`PZNEOO2` decimal(19,6) NOT NULL default '0.000000',
`PZNLOO` decimal(19,6) NOT NULL default '0.000000',
`PZNLOO1` decimal(19,6) NOT NULL default '0.000000',
`PZNLOO2` decimal(19,6) NOT NULL default '0.000000',
`SCN1OO` decimal(4,2) NOT NULL default '0.00',
`SCN2OO` decimal(4,2) NOT NULL default '0.00',
`SCN3OO` decimal(4,2) NOT NULL default '0.00',
`SCN4OO` decimal(4,2) NOT NULL default '0.00',
`SCCAOO` decimal(19,6) NOT NULL default '0.000000',
`SCCAOO2` decimal(19,6) NOT NULL default '0.000000',
`FSCCOO` char(1) NOT NULL default '',
`AUSCOO` decimal(19,6) NOT NULL default '0.000000',
`AUSCOO2` decimal(19,6) NOT NULL default '0.000000',
`FAUSOO` char(1) NOT NULL default '',
`TANOOO` decimal(19,6) NOT NULL default '0.000000',
`TANOOO2` decimal(19,6) NOT NULL default '0.000000',
`FTAOOO` char(1) NOT NULL default '',
`AUPROO` decimal(19,6) NOT NULL default '0.000000',
`AUPROO2` decimal(19,6) NOT NULL default '0.000000',
`FAUPOO` char(1) NOT NULL default '',
`SCPMOO` decimal(19,6) NOT NULL default '0.000000',
`SCPMOO2` decimal(19,6) NOT NULL default '0.000000',
`FAPMOO` char(1) NOT NULL default '',
`SCNCOO` decimal(19,6) NOT NULL default '0.000000',
`SCNCOO2` decimal(19,6) NOT NULL default '0.000000',
`FSNCOO` char(1) NOT NULL default '',
`ALIVOO` char(2) NOT NULL default '',
`DSAROO` char(40) NOT NULL default '',
`QTOROO` decimal(13,4) NOT NULL default '0.0000',
`QTIOOO` decimal(13,4) NOT NULL default '0.0000',
`QTISOO` decimal(13,4) NOT NULL default '0.0000',
`QTGSOO` decimal(13,4) NOT NULL default '0.0000',
`QTPZOO` decimal(13,4) NOT NULL default '0.0000',
`SAACOO` char(1) NOT NULL default '',
`PESOOO` decimal(13,4) NOT NULL default '0.0000',
`PSLOOO` decimal(13,4) NOT NULL default '0.0000',
`STELOO` decimal(1,0) NOT NULL default '0',
`SINCOO` char(16) NOT NULL default '',
`DTHIOO` char(16) NOT NULL default '',
`DTHMOO` char(16) NOT NULL default '',
PRIMARY KEY (`CDDTOO`,`TDOCOO`,`NROROO`,`NRRGOO`)
) TYPE=BerkeleyDB
The error was generated adding an unique index on WBSOM01F.CDAROO and insert a duplicated key. The db server failed during the rollback (i think...)
In attach there is the error log . If you want I can send you the log.0000000001 file.
Error log:
050126 16:36:22 bdb: transaction has active cursors
050126 16:36:22 bdb: PANIC: Invalid argument
mysqld got signal 11;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.
key_buffer_size=16777216
read_buffer_size=131072
max_used_connections=26
max_connections=100
threads_connected=20
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 233983 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
thd=0x4307e370
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
Cannot determine thread, fp=0xbcdfeac8, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
0x810dd6f
0x401483d1
0x8178cef
0x816cebe
0x813df1d
0x813d2d9
0x813cf3c
0x8135063
0x8133a85
0x811b5a3
0x81201d4
0x811a544
0x8119fa7
0x8119867
0x40142dfe
0x4038a9aa
New value of fp=(nil) failed sanity check, terminating stack trace!
Please read http://dev.mysql.com/doc/mysql/en/Using_stack_trace.html and follow instructions on how to resolve the stack trace. Resolved
stack trace is much more helpful in diagnosing the problem, so please do
resolve it
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0x890d0a0 = select * from CART left join UTENTI on (CDCFOO = CONTCA) where UTENTE='885611S' LIMIT -1
thd->thread_id=2728
The manual page at http://www.mysql.com/doc/en/Crashing.html contains
information that should help you find out what is causing the crash.
050126 16:36:26 bdb: Recovery function for LSN 1 771845 failed
050126 16:36:26 Can't init databases
050126 16:36:26 Aborting
050126 16:36:26 /usr/sbin/mysqld: Shutdown Complete
050126 16:40:22 bdb: Recovery function for LSN 1 658606 failed
050126 16:40:22 bdb: warning: ./webdata/#sql-191a_a8c.db: No such file or directory
050126 16:40:22 Can't init databases
050126 16:40:22 Aborting
050126 16:40:22 /usr/sbin/mysqld: Shutdown Complete
050126 16:45:15 bdb: Recovery function for LSN 1 658606 failed
050126 16:45:15 bdb: warning: ./webdata/#sql-191a_a8c.db: No such file or directory
050126 16:45:15 Can't init databases
050126 16:45:15 Aborting
050126 16:45:16 /usr/sbin/mysqld: Shutdown Complete
050126 16:58:43 bdb: Recovery function for LSN 1 658606 failed
050126 16:58:43 bdb: warning: ./webdata/#sql-191a_a8c.db: No such file or directory
050126 16:58:43 Can't init databases
050126 16:58:43 Aborting
050126 16:58:44 /usr/sbin/mysqld: Shutdown Complete
050126 17:15:43 bdb: Recovery function for LSN 1 658606 failed
050126 17:15:43 bdb: warning: ./webdata/#sql-191a_a8c.db: No such file or directory
050126 17:15:43 Can't init databases
050126 17:15:43 Aborting
050126 17:15:43 mysqld: Shutdown Complete
050126 17:15:57 bdb: Recovery function for LSN 1 658606 failed
050126 17:15:57 bdb: warning: ./webdata/#sql-191a_a8c.db: No such file or directory
050126 17:15:57 Can't init databases
050126 17:15:57 Aborting
050126 17:15:57 mysqld: Shutdown Complete
050126 17:16:27 bdb: Recovery function for LSN 1 658606 failed
050126 17:16:27 bdb: warning: ./webdata/#sql-191a_a8c.db: No such file or directory
050126 17:16:27 Can't init databases
050126 17:16:27 Aborting
050126 17:16:27 mysqld: Shutdown Complete
050126 17:16:34 bdb: Recovery function for LSN 1 658606 failed
050126 17:16:34 bdb: warning: ./webdata/#sql-191a_a8c.db: No such file or directory
050126 17:16:34 Can't init databases
050126 17:16:34 Aborting
050126 17:16:34 mysqld: Shutdown Complete
050126 17:16:37 bdb: Recovery function for LSN 1 658606 failed
050126 17:16:37 bdb: warning: ./webdata/#sql-191a_a8c.db: No such file or directory
050126 17:16:37 Can't init databases
050126 17:16:37 Aborting
050126 17:16:37 mysqld: Shutdown Complete
050126 17:45:17 bdb: Recovery function for LSN 1 658606 failed
050126 17:45:18 bdb: warning: ./webdata/#sql-191a_a8c.db: No such file or directory
050126 17:45:18 Can't init databases
050126 17:45:18 Aborting
050126 17:45:18 /usr/sbin/mysqld: Shutdown Complete
050126 17:46:51 bdb: Recovery function for LSN 1 658606 failed
050126 17:46:51 bdb: warning: ./webdata/#sql-191a_a8c.db: No such file or directory
050126 17:46:51 Can't init databases
050126 17:46:51 Aborting
050126 17:46:51 mysqld: Shutdown Complete
050126 17:47:03 bdb: Recovery function for LSN 1 658606 failed
050126 17:47:03 bdb: warning: ./webdata/#sql-191a_a8c.db: No such file or directory
050126 17:47:03 Can't init databases
050126 17:47:03 Aborting
050126 17:47:03 mysqld: Shutdown Complete
How to repeat:
Create the bdb table with the same structure above descripted.
Create an unique index on the field WBSOM01F.CDAROO.
Create a transaction as the above descripted inserting a duplicate key on the field cdaroo.
Suggested fix:
I don't know.