mariadb/mysql-test/suite/innodb/t
Vasil Dimov 86505c3c54 Fix Bug#13510739 63775: SERVER CRASH ON HANDLER READ NEXT AFTER DELETE RECORD.
CREATE TABLE bug13510739 (c INTEGER NOT NULL, PRIMARY KEY (c)) ENGINE=INNODB;
INSERT INTO bug13510739 VALUES (1), (2), (3), (4);
DELETE FROM bug13510739 WHERE c=2;
HANDLER bug13510739 OPEN;
HANDLER bug13510739 READ `primary` = (2);
HANDLER bug13510739 READ `primary` NEXT;  <-- crash

The bug is that in the particular testcase row_search_for_mysql() picked up
a delete-marked record and quit, leaving the cursor non-positioned state and
on the subsequent 'get next' call the code crashed because of the
non-positioned cursor.

In row0sel.cc (line numbers from mysql-trunk):

4653         if (rec_get_deleted_flag(rec, comp)) {
...
4679                 if (index == clust_index && unique_search) {
4680 
4681                         err = DB_RECORD_NOT_FOUND;
4682                         
4683                         goto normal_return;
4684                 }       

it quit from here, not storing the cursor position.

In contrast, if the record=2 is not found at all (e.g. sleep(1) after DELETE
to let the purge wipe it away completely) then 'get = 2' does find record=3
and quits from here:

4366                 if (0 != cmp_dtuple_rec(search_tuple, rec, offsets)) {
...
4394                         btr_pcur_store_position(pcur, &mtr);
4395 
4396                         err = DB_RECORD_NOT_FOUND;
4397 #if 0
4398                         ut_print_name(stderr, trx, FALSE, index->name);
4399                         fputs(" record not found 3\n", stderr);
4400 #endif
4401 
4402                         goto normal_return;

Another fix could be to extend the condition on line 4366 to hold only if
seach_tuple matches rec AND if rec is not delete marked.

Notice that in the above test case if we wait about 1 second somewhere after
DELETE and before 'get = 2', then the testcase does not crash and returns 4
instead. Not sure if this is the correct behavior, but this bugfix removes
the crash and makes the code return what it also returns in the non-crashing
case (if rec=2 is not found during 'get = 2', e.g. we have sleep(1) there).

Approved by:	Marko (http://bur03.no.oracle.com/rb/r/863/)
2011-12-22 12:55:44 +02:00
..
disabled.def Bug #38999: Re-enable innodb_multi_update.test 2010-06-10 15:56:23 +03:00
innodb-autoinc-44030.test Remove outdated InnoDB Plugin tests from mysql-test/suite/innodb, 2010-04-12 14:56:24 +03:00
innodb-autoinc-optimize.test Move some InnoDB tests to mysql-test/suite/innodb. 2010-06-03 12:50:32 +03:00
innodb-autoinc.test Bug#39828 : Autoinc wraps around when offset and increment > 1 2010-12-13 14:48:12 +03:00
innodb-lock.test Bug #12842206 INNODB LOCKING REGRESSION FOR INSERT IGNORE: Add a test case. 2011-11-10 16:45:47 +02:00
innodb-master.opt Remove outdated InnoDB Plugin tests from mysql-test/suite/innodb, 2010-04-12 14:56:24 +03:00
innodb-replace.test Remove outdated InnoDB Plugin tests from mysql-test/suite/innodb, 2010-04-12 14:56:24 +03:00
innodb-semi-consistent-master.opt Remove outdated InnoDB Plugin tests from mysql-test/suite/innodb, 2010-04-12 14:56:24 +03:00
innodb-semi-consistent.test Remove outdated InnoDB Plugin tests from mysql-test/suite/innodb, 2010-04-12 14:56:24 +03:00
innodb-ucs2.test Move some InnoDB tests to mysql-test/suite/innodb. 2010-06-03 12:50:32 +03:00
innodb.test Bug #13117023: Innodb increments handler_read_key when it should not 2011-12-13 14:26:12 +05:30
innodb_autoinc_lock_mode_zero-master.opt Move some InnoDB tests to mysql-test/suite/innodb. 2010-06-03 12:50:32 +03:00
innodb_autoinc_lock_mode_zero.test Move some InnoDB tests to mysql-test/suite/innodb. 2010-06-03 12:50:32 +03:00
innodb_bug21704.test Remove outdated InnoDB Plugin tests from mysql-test/suite/innodb, 2010-04-12 14:56:24 +03:00
innodb_bug30423.test Fix Bug#30423 "InnoDBs treatment of NULL in index stats causes bad 2011-01-14 09:02:28 -08:00
innodb_bug30919-master.opt Move some InnoDB tests to mysql-test/suite/innodb. 2010-06-03 12:50:32 +03:00
innodb_bug30919.test Move some InnoDB tests to mysql-test/suite/innodb. 2010-06-03 12:50:32 +03:00
innodb_bug34053.test Remove outdated InnoDB Plugin tests from mysql-test/suite/innodb, 2010-04-12 14:56:24 +03:00
innodb_bug34300.test Remove outdated InnoDB Plugin tests from mysql-test/suite/innodb, 2010-04-12 14:56:24 +03:00
innodb_bug35220.test Remove outdated InnoDB Plugin tests from mysql-test/suite/innodb, 2010-04-12 14:56:24 +03:00
innodb_bug38231.test Remove outdated InnoDB Plugin tests from mysql-test/suite/innodb, 2010-04-12 14:56:24 +03:00
innodb_bug39438-master.opt Remove outdated InnoDB Plugin tests from mysql-test/suite/innodb, 2010-04-12 14:56:24 +03:00
innodb_bug39438.test Remove outdated InnoDB Plugin tests from mysql-test/suite/innodb, 2010-04-12 14:56:24 +03:00
innodb_bug40565.test Remove outdated InnoDB Plugin tests from mysql-test/suite/innodb, 2010-04-12 14:56:24 +03:00
innodb_bug42101-nonzero-master.opt Remove outdated InnoDB Plugin tests from mysql-test/suite/innodb, 2010-04-12 14:56:24 +03:00
innodb_bug42101-nonzero.test Remove outdated InnoDB Plugin tests from mysql-test/suite/innodb, 2010-04-12 14:56:24 +03:00
innodb_bug42101.test Remove outdated InnoDB Plugin tests from mysql-test/suite/innodb, 2010-04-12 14:56:24 +03:00
innodb_bug42419.test Move some InnoDB tests to mysql-test/suite/innodb. 2010-06-03 12:50:32 +03:00
innodb_bug44369.test Remove outdated InnoDB Plugin tests from mysql-test/suite/innodb, 2010-04-12 14:56:24 +03:00
innodb_bug45357.test Remove outdated InnoDB Plugin tests from mysql-test/suite/innodb, 2010-04-12 14:56:24 +03:00
innodb_bug46000.test Remove outdated InnoDB Plugin tests from mysql-test/suite/innodb, 2010-04-12 14:56:24 +03:00
innodb_bug47621.test Remove outdated InnoDB Plugin tests from mysql-test/suite/innodb, 2010-04-12 14:56:24 +03:00
innodb_bug47777.test Remove outdated InnoDB Plugin tests from mysql-test/suite/innodb, 2010-04-12 14:56:24 +03:00
innodb_bug48024.test Work around Bug #53750 in innodb.innodb_bug48024 2010-05-19 10:56:13 +03:00
innodb_bug49164.test Add an innodb test case for Bug #49164. 2010-05-10 13:37:52 +02:00
innodb_bug51920.test mysql-5.1-innodb: add error codes to innodb_bug51920.test 2010-04-22 14:16:14 -05:00
innodb_bug52663-master.opt row_search_for_mysql(): Never try semi-consistent read in unique searches. 2010-04-26 13:27:25 +03:00
innodb_bug52663.test row_search_for_mysql(): Never try semi-consistent read in unique searches. 2010-04-26 13:27:25 +03:00
innodb_bug53674-master.opt Bug#53674: InnoDB: Error: unlock row could not find a 4 mode lock on the record 2010-06-02 13:26:37 +03:00
innodb_bug53674.test Bug#53674: InnoDB: Error: unlock row could not find a 4 mode lock on the record 2010-06-02 13:26:37 +03:00
innodb_bug53756-master.opt Add innodb_bug53756-master.opt for innodb_bug53756 test. 2010-07-05 19:26:38 -07:00
innodb_bug53756.test Bug #11762804 55442: MYSQLD DEBUG CRASHES WHILE RUNNING MYISAM_CRASH_BEFORE_FLUSH_KEYS.TEST 2011-03-15 16:06:59 +01:00
innodb_bug54044.test Change the table name in innodb_bug54044 to lower case to avoid 2010-06-29 00:13:18 -07:00
innodb_bug56143.test Suppress InnoDB warning about long semaphore wait if running under Valgrind 2011-01-12 17:53:05 +02:00
innodb_bug56680.test Bug #56680 wrong InnoDB results from a case-insensitive covering index 2010-10-19 08:58:53 +03:00
innodb_bug56716.test Bug#56716 InnoDB locks a record gap without locking the table 2010-10-04 13:05:21 +03:00
innodb_bug57252.test Fix Bug#57252 disabling innobase_stats_on_metadata disables ANALYZE 2010-10-18 13:48:11 +03:00
innodb_bug57255.test Speed up innodb_bug57255.test 2010-12-14 11:38:19 +02:00
innodb_bug59410.test Add the testcase for Bug#59410 to 5.1/builtin 2011-04-05 11:08:36 +03:00
innodb_bug59641.test Bug #11766513 - 59641: Prepared XA transaction in system after hard crash 2011-04-07 21:12:54 +03:00
innodb_bug60049-master.opt Add a test for suspected Bug#60049. 2011-02-15 12:12:27 +02:00
innodb_bug60049.test Allow 30 seconds for slow shutdown in the Bug #60049 test. 2011-02-17 22:25:33 +02:00
innodb_bug12661768.test Fix Bug#12661768 UPDATE IGNORE CRASHES SERVER IF TABLE IS INNODB AND IT IS 2011-10-25 16:46:38 +03:00
innodb_bug13510739.test Fix Bug#13510739 63775: SERVER CRASH ON HANDLER READ NEXT AFTER DELETE RECORD. 2011-12-22 12:55:44 +02:00
innodb_gis.test Move some InnoDB tests to mysql-test/suite/innodb. 2010-06-03 12:50:32 +03:00
innodb_lock_wait_timeout_1-master.opt Move some InnoDB tests to mysql-test/suite/innodb. 2010-06-03 12:50:32 +03:00
innodb_lock_wait_timeout_1.test Move some InnoDB tests to mysql-test/suite/innodb. 2010-06-03 12:50:32 +03:00
innodb_misc1-master.opt Split the innodb.innodb mysql-test. 2010-04-27 09:09:08 +03:00
innodb_misc1.test Split the innodb.innodb mysql-test. 2010-04-27 09:09:08 +03:00
innodb_multi_update.test Fixed following problems: 2010-12-14 12:33:03 +03:00
innodb_mysql-master.opt Move some InnoDB tests to mysql-test/suite/innodb. 2010-06-03 12:50:32 +03:00
innodb_mysql.test Fix for bug #11762012 - "54553: INNODB ASSERTS IN 2011-05-26 17:14:47 +04:00
innodb_mysql_rbk-master.opt Move some InnoDB tests to mysql-test/suite/innodb. 2010-06-03 12:50:32 +03:00
innodb_mysql_rbk.test Move some InnoDB tests to mysql-test/suite/innodb. 2010-06-03 12:50:32 +03:00
innodb_notembedded.test Move some InnoDB tests to mysql-test/suite/innodb. 2010-06-03 12:50:32 +03:00
innodb_replace.test Bug#11759688 52020: InnoDB can still deadlock on just INSERT...ON DUPLICATE KEY 2011-11-10 12:49:31 +02:00
innodb_timeout_rollback-master.opt Move some InnoDB tests to mysql-test/suite/innodb. 2010-06-03 12:50:32 +03:00
innodb_timeout_rollback.test Move some InnoDB tests to mysql-test/suite/innodb. 2010-06-03 12:50:32 +03:00
innodb_trx_weight.test Remove outdated InnoDB Plugin tests from mysql-test/suite/innodb, 2010-04-12 14:56:24 +03:00