Bug #3802 mysqld crashed by complete DELETE ... (SELECT (SELECT ))
Submitted: 17 May 2004 17:38 Modified: 25 May 2004 18:56
Reporter: Mark Sadler Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.1.1-1 (alpha) OS:Linux (Linux (Redhat) 2.4.18 kernel)
Assigned to: Oleksandr Byelkin CPU Architecture:Any

[17 May 2004 17:38] Mark Sadler
Description:
mysqld crashes when I try to execute the following SQL statement.

DELETE FROM worktable WHERE subscribernumber IN (  SELECT DISTINCT subscribernumber FROM (    SELECT sel1.clientid,sel1.campaignname,i.listname,i.ownerid FROM (      SELECT DISTINCT rc.starttime,rc.clientid,rc.campaignname       FROM campaign c INNER JOIN responsecategory rc USING (clientid,campaignname)       WHERE c.state IN (12,13,2,3,4,5,8,6)       AND ((rc.pushtext IS NOT NULL OR rc.pushcontentid IS NOT NULL) AND (c.campaigntype != 4 OR rc.quizround < 2))       AND (rc.starttime BETWEEN ('2004-05-17 12:38:00' - 1) AND ('2004-05-17 12:38:00' + 1)           )     ) AS sel1 INNER JOIN approvallist USING (clientid,campaignname)     INNER JOIN inventorylist i USING (ownerid,listname)     INNER JOIN templatesource t USING (ownerid,listname)     WHERE t.clientid='Bayham'     AND t.templatename='Test Template Editor'     AND (starttime BETWEEN ('2004-05-17 12:38:00' - i.recencylimit + interval '1' minute)                    AND ('2004-05-17 12:38:00' + i.recencylimit - interval '1' minute)         )   ) AS sel2 INNER JOIN entry USING (clientid,campaignname,ownerid,listname) )

As you can see this is quite complex !

Things to note:  'worktable' specified in the outer DELETE is a TEMPORARY TABLE.

Here is the resolved stack trace:-
0x8089167 handle_segfault + 423
0x82da818 pthread_sighandler + 184
0x80b85d5 make_join_statistics__FP4JOINP13st_table_listP4ItemP16st_dynamic_array + 3189
0x80b5271 optimize__4JOIN + 369
0x80b780f mysql_select__FP3THDPPP4ItemP13st_table_listUiRt4List1Z4ItemP4ItemUiP8st_orderT7T5T7UlP13select_resultP18st_select_lex_unitP13s + 767
0x811f18c mysql_derived__FP3THDP6st_lexP18st_select_lex_unitP13st_table_list + 700
0x80966fe mysql_execute_command__FP3THD + 302
0x809b3f1 mysql_parse__FP3THDPcUi + 177
0x80957ff dispatch_command__F19enum_server_commandP3THDPcUi + 1631
0x8095192 do_command__FP3THD + 162
0x8094907 handle_one_connection + 551
0x82d7fcc pthread_start_thread + 220
0x830b8fa thread_start + 4

And the complete error log:-
040517 16:12:11  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
040517 16:12:11  InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 25172588.
InnoDB: Doing recovery: scanned up to log sequence number 0 25173041
InnoDB: 1 transaction(s) which must be rolled back or cleaned up
InnoDB: in total 1 row operations to undo
InnoDB: Trx id counter is 0 512000
040517 16:12:11  InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 
InnoDB: Apply batch completed
InnoDB: Starting rollback of uncommitted transactions
InnoDB: Rolling back trx with id 0 511513, 1 rows to undo
InnoDB: Rolling back of trx id 0 511513 completed
InnoDB: Rollback of uncommitted transactions completed
InnoDB: Last MySQL binlog file position 0 2972, file name ./smsc3m2-bin.000035
040517 16:12:12  InnoDB: Flushing modified pages from the buffer pool...
040517 16:12:12  InnoDB: Started; log sequence number 0 25173041
/usr/sbin/mysqld: ready for connections.
Version: '4.1.1-alpha-standard-log'  socket: '/var/lib/mysql/mysql.sock'  port: 3306
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=11
max_connections=100
threads_connected=12
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 80383 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd=0x86dda38
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=0xbfd3ecc8, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
0x8089167
0x82da818
0x80b85d5
0x80b5271
0x80b780f
0x811f18c
0x80966fe
0x809b3f1
0x80957ff
0x8095192
0x8094907
0x82d7fcc
0x830b8fa
New value of fp=(nil) failed sanity check, terminating stack trace!
Please read http://www.mysql.com/doc/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 0x86eacd0 = DELETE FROM worktable WHERE subscribernumber IN (  SELECT DISTINCT subscribernumber FROM (    SELECT sel1.clientid,sel1.campaignname,i.listname,i.ownerid FROM (      SELECT DISTINCT rc.starttime,rc.clientid,rc.campaignname       FROM campaign c INNER JOIN responsecategory rc USING (clientid,campaignname)       WHERE c.state IN (12,13,2,3,4,5,8,6)       AND ((rc.pushtext IS NOT NULL OR rc.pushcontentid IS NOT NULL) AND (c.campaigntype != 4 OR rc.quizround < 2))       AND (rc.starttime BETWEEN ('2004-05-17 12:38:00' - 1) AND ('2004-05-17 12:38:00' + 1)           )     ) AS sel1 INNER JOIN approvallist USING (clientid,campaignname)     INNER JOIN inventorylist i USING (ownerid,listname)     INNER JOIN templatesource t USING (ownerid,listname)     WHERE t.clientid='Bayham'     AND t.templatename='Test Template Editor'     AND (starttime BETWEEN ('2004-05-17 12:38:00' - i.recencylimit + interval '1' minute)                    AND ('2004-05-17 12:38:00' + i.recencylimit - interval '1' minute)         )   ) AS sel2 
thd->thread_id=13
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.

How to repeat:
mysqld behaves fine executing lots of statements, as long as I dont hit that particular one.

I can repeat it, but it will be difficult for someone else, since the database is quite extensive.

I will try to alter/divide up the statement, to see if I can create the same fault with a simpler statement.
[17 May 2004 19:13] Alexander Keremidarski
Mark,

Can you please post also the result of:

SHOW CREATE TABLE ...;

for all tables involved so we can try repeating teh crash?

Thanks in advance
[18 May 2004 21:30] Mark Sadler
CREATE TEMPORARY TABLE worktable (field1 VARCHAR(20),
ownerid VARCHAR(32),listname VARCHAR(48),sourceid INTEGER(10),
subscribernumber INTEGER(10),contactscore INTEGER(4),
optinallowed CHAR(1),visiblefield1 VARCHAR(20),
price INTEGER(10),estimatedcampaignvalue INTEGER(4),
deleteme CHAR(1)) TYPE=MEMORY;

Table	Create Table
campaign	CREATE TABLE `campaign` (\n  `campaignid` int(10) NOT NULL auto_increment,\n  `clientid` varchar(32) NOT NULL default '',\n  `campaignname` varchar(48) NOT NULL default '',\n  `starttime` datetime default NULL,\n  `stoptime` datetime default NULL,\n  `templatename` varchar(32) default NULL,\n  `tagline` varchar(160) default NULL,\n  `quizparseforwrong` char(1) default NULL,\n  `quizinvalidresponsetext` varchar(165) default NULL,\n  `quizinvalidresponsecid` int(10) default NULL,\n  `priority` int(3) default NULL,\n  `campaigntype` int(1) default NULL,\n  `state` int(2) default NULL,\n  `brokerapproved` char(1) NOT NULL default 'N',\n  `startimmediately` char(1) NOT NULL default 'N',\n  `erroritem` varchar(100) default NULL,\n  `allocatedhost` varchar(32) default NULL,\n  `quizhiscore` int(5) default '0',\n  `rstarttime` datetime default NULL,\n  `rstoptime` datetime default NULL,\n  `owneruserid` varchar(16) NOT NULL default '',\n  `queuedtime` datetime default NULL,\n  `responserate` char(3) default '75',\n  `setupcost` varchar(16) default '0.00',\n  `revenue` varchar(16) default '0.00',\n  `costperitem` varchar(16) default '0.00',\n  `externalcampaigntype` int(1) NOT NULL default '0',\n  PRIMARY KEY  (`clientid`,`campaignname`),\n  UNIQUE KEY `campaignid` (`campaignid`),\n  KEY `clientid` (`clientid`,`templatename`),\n  KEY `quizinvalidresponsecid` (`quizinvalidresponsecid`),\n  CONSTRAINT `0_271` FOREIGN KEY (`clientid`) REFERENCES `client` (`clientid`),\n  CONSTRAINT `0_272` FOREIGN KEY (`clientid`, `templatename`) REFERENCES `campaigntemplate` (`clientid`, `templatename`),\n  CONSTRAINT `0_273` FOREIGN KEY (`quizinvalidresponsecid`) REFERENCES `bct` (`cid`)\n) TYPE=InnoDB DEFAULT CHARSET=latin1
Table	Create Table
responsecategory	CREATE TABLE `responsecategory` (\n  `clientid` varchar(48) NOT NULL default '',\n  `campaignname` varchar(48) NOT NULL default '',\n  `categoryname` varchar(48) NOT NULL default '',\n  `starttime` datetime NOT NULL default '0000-00-00 00:00:00',\n  `stoptime` datetime NOT NULL default '0000-00-00 00:00:00',\n  `opencategory` char(1) NOT NULL default 'N',\n  `pitem` varchar(165) default NULL,\n  `pcid` int(10) default NULL,\n  `pacc` varchar(32) default NULL,\n  `pitemscore` int(2) default NULL,\n  `multipleresponses` char(1) NOT NULL default 'N',\n  `overwrite` char(1) NOT NULL default 'N',\n  `quizround` int(2) default NULL,\n  `itemvalidity` int(7) default '7200',\n  `startwithcampaign` char(1) NOT NULL default 'N',\n  `rstarttime` datetime default NULL,\n  `rstoptime` datetime default NULL,\n  `ropencategory` char(1) NOT NULL default '',\n  `istiebreaker` char(1) NOT NULL default 'N',\n  PRIMARY KEY  (`clientid`,`campaignname`,`categoryname`),\n  KEY `pacc` (`pacc`),\n  KEY `pcid` (`pcid`),\n  CONSTRAINT `0_287` FOREIGN KEY (`clientid`, `campaignname`) REFERENCES `campaign` (`clientid`, `campaignname`),\n  CONSTRAINT `0_288` FOREIGN KEY (`pacc`) REFERENCES `acc` (`accname`),\n  CONSTRAINT `0_289` FOREIGN KEY (`pcid`) REFERENCES `bct` (`cid`)\n) TYPE=InnoDB DEFAULT CHARSET=latin1
Table	Create Table
approvallist	CREATE TABLE `approvallist` (\n  `clientid` varchar(48) NOT NULL default '',\n  `campaignname` varchar(48) NOT NULL default '',\n  `ownerid` varchar(32) NOT NULL default '',\n  `listname` varchar(48) NOT NULL default '',\n  `campaignweighting` int(2) default NULL,\n  `approved` char(1) NOT NULL default 'N',\n  `jointbrandedoptinfilter` char(1) NOT NULL default 'N',\n  `thirdpartyoptinfilter` char(1) NOT NULL default 'N',\n  PRIMARY KEY  (`clientid`,`campaignname`,`ownerid`,`listname`),\n  KEY `ownerid` (`ownerid`,`listname`),\n  CONSTRAINT `0_279` FOREIGN KEY (`clientid`, `campaignname`) REFERENCES `campaign` (`clientid`, `campaignname`),\n  CONSTRAINT `0_280` FOREIGN KEY (`ownerid`, `listname`) REFERENCES `inventorylist` (`ownerid`, `listname`)\n) TYPE=InnoDB DEFAULT CHARSET=latin1
Table	Create Table
inventorylist	CREATE TABLE `inventorylist` (\n  `inventorylistid` int(10) NOT NULL auto_increment,\n  `ownerid` varchar(32) NOT NULL default '',\n  `listname` varchar(48) NOT NULL default '',\n  `price` int(3) NOT NULL default '0',\n  `tagline` varchar(160) default NULL,\n  `recencylimit` int(3) NOT NULL default '0',\n  `frequencycontacts` int(4) NOT NULL default '0',\n  `frequencyperiod` int(3) NOT NULL default '0',\n  `description` text,\n  `conditionsofuse` text,\n  `field1captureallowed` char(1) NOT NULL default 'N',\n  PRIMARY KEY  (`ownerid`,`listname`),\n  UNIQUE KEY `inventorylistid` (`inventorylistid`),\n  CONSTRAINT `0_235` FOREIGN KEY (`ownerid`) REFERENCES `dataowner` (`ownerid`)\n) TYPE=InnoDB DEFAULT CHARSET=latin1
Table	Create Table
templatesource	CREATE TABLE `templatesource` (\n  `templatename` varchar(32) NOT NULL default '',\n  `clientid` varchar(32) NOT NULL default '',\n  `listname` varchar(48) NOT NULL default '',\n  `ownerid` varchar(32) NOT NULL default '',\n  `sourceid` int(10) NOT NULL auto_increment,\n  `description` text,\n  PRIMARY KEY  (`clientid`,`templatename`,`listname`,`ownerid`,`sourceid`),\n  UNIQUE KEY `sourceid` (`sourceid`),\n  KEY `ownerid` (`ownerid`,`listname`),\n  CONSTRAINT `0_261` FOREIGN KEY (`clientid`, `templatename`) REFERENCES `campaigntemplate` (`clientid`, `templatename`),\n  CONSTRAINT `0_262` FOREIGN KEY (`ownerid`, `listname`) REFERENCES `inventorylist` (`ownerid`, `listname`)\n) TYPE=InnoDB DEFAULT CHARSET=latin1
[20 May 2004 12:21] Alexander Keremidarski
Hello. I couldn't use your tables because some of tables and columns are missing.

Unknown Table entry ,  Unknown column 'rc.pushtext' and probably others.

A side comment,
This expression:

... BETWEEN ('2004-05-17 12:38:00' - 1) AND ('2004-05-17 12:38:00' + 1)

will evaluate as:

... BETWEEN 2003 AND 2005;

because

mysql> SELECT '2004-05-17 12:38:00' - 1 AS d1,  '2004-05-17 12:38:00' + 1 AS d2;+------+------+
| d1   | d2   |
+------+------+
| 2003 | 2005 |
+------+------+

Consider +/- INTERVAL 1 <interval specifyer> as you do at the end of the query:
[20 May 2004 17:53] Mark Sadler
Sorry about that, here is the create tables info, again.  This time with the right field names and the missing tables!

CREATE TEMPORARY TABLE worktable (field1 VARCHAR(20),
ownerid VARCHAR(32),listname VARCHAR(48),sourceid INTEGER(10),
subscribernumber INTEGER(10),contactscore INTEGER(4),
optinallowed CHAR(1),visiblefield1 VARCHAR(20),
price INTEGER(10),estimatedcampaignvalue INTEGER(4),
deleteme CHAR(1)) TYPE=MEMORY;

Table	Create Table
campaign	CREATE TABLE `campaign` (\n  `campaignid` int(10) NOT NULL auto_increment,\n  `clientid` varchar(32) NOT NULL default '',\n  `campaignname` varchar(48) NOT NULL default '',\n  `starttime` datetime default NULL,\n  `stoptime` datetime default NULL,\n  `templatename` varchar(32) default NULL,\n  `tagline` varchar(160) default NULL,\n  `quizparseforwrong` char(1) default NULL,\n  `quizinvalidresponsetext` varchar(165) default NULL,\n  `quizinvalidresponsecontentid` int(10) default NULL,\n  `priority` int(3) default NULL,\n  `campaigntype` int(1) default NULL,\n  `state` int(2) default NULL,\n  `brokerapproved` char(1) NOT NULL default 'N',\n  `startimmediately` char(1) NOT NULL default 'N',\n  `errormessage` varchar(100) default NULL,\n  `allocatedhost` varchar(32) default NULL,\n  `quizhiscore` int(5) default '0',\n  `rstarttime` datetime default NULL,\n  `rstoptime` datetime default NULL,\n  `owneruserid` varchar(16) NOT NULL default '',\n  `queuedtime` datetime default NULL,\n  `responserate` char(3) default '75',\n  `setupcost` varchar(16) default '0.00',\n  `revenue` varchar(16) default '0.00',\n  `costpermessage` varchar(16) default '0.00',\n  `externalcampaigntype` int(1) NOT NULL default '0',\n  PRIMARY KEY  (`clientid`,`campaignname`),\n  UNIQUE KEY `campaignid` (`campaignid`),\n  KEY `clientid` (`clientid`,`templatename`),\n  KEY `quizinvalidresponsecontentid` (`quizinvalidresponsecontentid`),\n  CONSTRAINT `0_271` FOREIGN KEY (`clientid`) REFERENCES `client` (`clientid`),\n  CONSTRAINT `0_272` FOREIGN KEY (`clientid`, `templatename`) REFERENCES `campaigntemplate` (`clientid`, `templatename`),\n  CONSTRAINT `0_273` FOREIGN KEY (`quizinvalidresponsecontentid`) REFERENCES `binarycontent` (`contentid`)\n) TYPE=InnoDB DEFAULT CHARSET=latin1
Table	Create Table
responsecategory	CREATE TABLE `responsecategory` (\n  `clientid` varchar(48) NOT NULL default '',\n  `campaignname` varchar(48) NOT NULL default '',\n  `categoryname` varchar(48) NOT NULL default '',\n  `starttime` datetime NOT NULL default '0000-00-00 00:00:00',\n  `stoptime` datetime NOT NULL default '0000-00-00 00:00:00',\n  `opencategory` char(1) NOT NULL default 'N',\n  `pushtext` varchar(165) default NULL,\n  `pushcontentid` int(10) default NULL,\n  `pushaccountname` varchar(32) default NULL,\n  `pushtextscore` int(2) default NULL,\n  `multipleresponses` char(1) NOT NULL default 'N',\n  `overwrite` char(1) NOT NULL default 'N',\n  `quizround` int(2) default NULL,\n  `messagevalidity` int(7) default '7200',\n  `startwithcampaign` char(1) NOT NULL default 'N',\n  `rstarttime` datetime default NULL,\n  `rstoptime` datetime default NULL,\n  `ropencategory` char(1) NOT NULL default '',\n  `istiebreaker` char(1) NOT NULL default 'N',\n  PRIMARY KEY  (`clientid`,`campaignname`,`categoryname`),\n  KEY `pushaccountname` (`pushaccountname`),\n  KEY `pushcontentid` (`pushcontentid`),\n  CONSTRAINT `0_287` FOREIGN KEY (`clientid`, `campaignname`) REFERENCES `campaign` (`clientid`, `campaignname`),\n  CONSTRAINT `0_288` FOREIGN KEY (`pushaccountname`) REFERENCES `account` (`accountname`),\n  CONSTRAINT `0_289` FOREIGN KEY (`pushcontentid`) REFERENCES `binarycontent` (`contentid`)\n) TYPE=InnoDB DEFAULT CHARSET=latin1
Table	Create Table
approvallist	CREATE TABLE `approvallist` (\n  `clientid` varchar(48) NOT NULL default '',\n  `campaignname` varchar(48) NOT NULL default '',\n  `ownerid` varchar(32) NOT NULL default '',\n  `listname` varchar(48) NOT NULL default '',\n  `campaignweighting` int(2) default NULL,\n  `approved` char(1) NOT NULL default 'N',\n  `jointbrandedoptinfilter` char(1) NOT NULL default 'N',\n  `thirdpartyoptinfilter` char(1) NOT NULL default 'N',\n  PRIMARY KEY  (`clientid`,`campaignname`,`ownerid`,`listname`),\n  KEY `ownerid` (`ownerid`,`listname`),\n  CONSTRAINT `0_279` FOREIGN KEY (`clientid`, `campaignname`) REFERENCES `campaign` (`clientid`, `campaignname`),\n  CONSTRAINT `0_280` FOREIGN KEY (`ownerid`, `listname`) REFERENCES `inventorylist` (`ownerid`, `listname`)\n) TYPE=InnoDB DEFAULT CHARSET=latin1
Table	Create Table
inventorylist	CREATE TABLE `inventorylist` (\n  `inventorylistid` int(10) NOT NULL auto_increment,\n  `ownerid` varchar(32) NOT NULL default '',\n  `listname` varchar(48) NOT NULL default '',\n  `price` int(3) NOT NULL default '0',\n  `tagline` varchar(160) default NULL,\n  `recencylimit` int(3) NOT NULL default '0',\n  `frequencycontacts` int(4) NOT NULL default '0',\n  `frequencyperiod` int(3) NOT NULL default '0',\n  `description` text,\n  `conditionsofuse` text,\n  `msisdncaptureallowed` char(1) NOT NULL default 'N',\n  PRIMARY KEY  (`ownerid`,`listname`),\n  UNIQUE KEY `inventorylistid` (`inventorylistid`),\n  CONSTRAINT `0_235` FOREIGN KEY (`ownerid`) REFERENCES `dataowner` (`ownerid`)\n) TYPE=InnoDB DEFAULT CHARSET=latin1
Table	Create Table
templatesource	CREATE TABLE `templatesource` (\n  `templatename` varchar(32) NOT NULL default '',\n  `clientid` varchar(32) NOT NULL default '',\n  `listname` varchar(48) NOT NULL default '',\n  `ownerid` varchar(32) NOT NULL default '',\n  `sourceid` int(10) NOT NULL auto_increment,\n  `description` text,\n  PRIMARY KEY  (`clientid`,`templatename`,`listname`,`ownerid`,`sourceid`),\n  UNIQUE KEY `sourceid` (`sourceid`),\n  KEY `ownerid` (`ownerid`,`listname`),\n  CONSTRAINT `0_261` FOREIGN KEY (`clientid`, `templatename`) REFERENCES `campaigntemplate` (`clientid`, `templatename`),\n  CONSTRAINT `0_262` FOREIGN KEY (`ownerid`, `listname`) REFERENCES `inventorylist` (`ownerid`, `listname`)\n) TYPE=InnoDB DEFAULT CHARSET=latin1
Table	Create Table
entry	CREATE TABLE `entry` (\n  `clientid` varchar(32) NOT NULL default '',\n  `campaignname` varchar(48) NOT NULL default '',\n  `msisdn` varchar(20) NOT NULL default '',\n  `visiblemsisdn` varchar(20) default NULL,\n  `optinallowed` char(1) NOT NULL default 'N',\n  `subscribernumber` int(10) default NULL,\n  `ownerid` varchar(32) default NULL,\n  `listname` varchar(48) default NULL,\n  `campaignvalue` int(4) default NULL,\n  `cost` int(5) default NULL,\n  `deleted` char(1) NOT NULL default 'N',\n  `quizattempt` int(4) default '0',\n  `currentround` int(2) default '1',\n  `quizterminated` char(1) NOT NULL default 'N',\n  `quizscore` int(5) default '0',\n  PRIMARY KEY  (`clientid`,`campaignname`,`msisdn`),\n  KEY `ownerid` (`ownerid`,`listname`),\n  KEY `subscribernumber` (`subscribernumber`),\n  CONSTRAINT `0_306` FOREIGN KEY (`clientid`, `campaignname`) REFERENCES `campaignlist` (`clientid`, `campaignname`),\n  CONSTRAINT `0_307` FOREIGN KEY (`ownerid`, `listname`) REFERENCES `inventorylist` (`ownerid`, `listname`),\n  CONSTRAINT `0_308` FOREIGN KEY (`subscribernumber`) REFERENCES `subscriber` (`subscribernumber`)\n) TYPE=InnoDB DEFAULT CHARSET=latin1
[21 May 2004 17:09] Oleksandr Byelkin
I tested your example and it go well, but I add following tables: 
CREATE TABLE `client` (`clientid` varchar(32) NOT NULL, primary key 
(`clientid`)) TYPE=InnoDB DEFAULT CHARSET=latin1; 
 
CREATE TABLE `campaigntemplate` (`clientid` varchar(32) NOT NULL, 
`templatename`varchar(32) NOT NULL, primary key(`clientid`, `templatename`)) 
TYPE=InnoDB DEFAULT CHARSET=latin1; 
 
CREATE TABLE `binarycontent` (`contentid` int(10) NOT NULL,  primary 
key(`contentid`)) TYPE=InnoDB DEFAULT CHARSET=latin1; 
 
CREATE TABLE `account` (`accountname` varchar(32) NOT NULL, primary 
key(`accountname`)) TYPE=InnoDB DEFAULT CHARSET=latin1; 
 
CREATE TABLE `dataowner` (`ownerid` varchar(32) NOT NULL, primary 
key(`ownerid`)) TYPE=InnoDB DEFAULT CHARSET=latin1; 
 
CREATE TABLE `subscriber` (`subscribernumber` int(10) NOT NULL, primary 
key(`subscribernumber`)) TYPE=InnoDB DEFAULT CHARSET=latin1; 
 
CREATE TABLE `campaignlist` (`clientid` varchar(32) NOT NULL, `campaignname` 
varchar(48) NOT NULL, primary key(`clientid`,`campaignname`)) TYPE=InnoDB 
DEFAULT CHARSET=latin1; 
 
and all tables was empty. 
 
can you provide full schema and some data on which bug is repeatable?
[21 May 2004 17:13] Oleksandr Byelkin
sorry, I accidentally change status to wrong type
[25 May 2004 18:56] Oleksandr Byelkin
Thank you for bugreport and especially for time you spent for creating test 
suite and sending it to me. 
 
This bug is not present in current 4.1 bk repository, it looks like fixed 
since last release.