summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgi Kodinov <joro@sun.com>2010-05-01 19:12:12 +0300
committerGeorgi Kodinov <joro@sun.com>2010-05-01 19:12:12 +0300
commite038b56dab91308505336b97f4b21f77947934cc (patch)
tree534b475926773c40b29e69a72369e6f03920ef8b
parent26570994b272bba5cc4bd4d98ba30c9747ff5d50 (diff)
parent3bffc40a247252def07e1e2b1b0091d2dd04faae (diff)
downloadmariadb-git-e038b56dab91308505336b97f4b21f77947934cc.tar.gz
merged 5.1-innodb
-rw-r--r--mysql-test/include/have_innodb_plugin.inc4
-rw-r--r--mysql-test/lib/mtr_cases.pm125
-rw-r--r--mysql-test/suite/binlog/t/binlog_killed.test2
-rw-r--r--mysql-test/suite/innodb/include/have_innodb_plugin.inc4
-rw-r--r--mysql-test/suite/innodb/r/innodb-autoinc-44030.result (renamed from mysql-test/r/innodb-autoinc-44030.result)4
-rw-r--r--mysql-test/suite/innodb/r/innodb-autoinc.result (renamed from mysql-test/r/innodb-autoinc.result)0
-rw-r--r--mysql-test/suite/innodb/r/innodb-lock.result (renamed from mysql-test/r/innodb-lock.result)0
-rw-r--r--mysql-test/suite/innodb/r/innodb-replace.result (renamed from mysql-test/r/innodb-replace.result)0
-rw-r--r--mysql-test/suite/innodb/r/innodb-semi-consistent.result (renamed from mysql-test/r/innodb-semi-consistent.result)0
-rw-r--r--mysql-test/suite/innodb/r/innodb.result (renamed from mysql-test/r/innodb.result)878
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug21704.result (renamed from mysql-test/r/innodb_bug21704.result)0
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug34053.result (renamed from mysql-test/r/innodb_bug34053.result)0
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug34300.result (renamed from mysql-test/r/innodb_bug34300.result)0
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug35220.result (renamed from mysql-test/r/innodb_bug35220.result)0
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug38231.result (renamed from mysql-test/r/innodb_bug38231.result)0
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug39438.result (renamed from mysql-test/r/innodb_bug39438.result)0
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug40565.result (renamed from mysql-test/r/innodb_bug40565.result)0
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug42101-nonzero.result (renamed from mysql-test/r/innodb_bug42101-nonzero.result)0
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug42101.result (renamed from mysql-test/r/innodb_bug42101.result)0
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug44369.result (renamed from mysql-test/r/innodb_bug44369.result)0
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug45357.result (renamed from mysql-test/r/innodb_bug45357.result)0
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug46000.result (renamed from mysql-test/r/innodb_bug46000.result)0
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug47621.result (renamed from mysql-test/r/innodb_bug47621.result)0
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug47777.result (renamed from mysql-test/r/innodb_bug47777.result)0
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug51920.result13
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug52663.result26
-rw-r--r--mysql-test/suite/innodb/r/innodb_file_format.result43
-rw-r--r--mysql-test/suite/innodb/r/innodb_misc1.result880
-rw-r--r--mysql-test/suite/innodb/r/innodb_trx_weight.result (renamed from mysql-test/r/innodb_trx_weight.result)0
-rw-r--r--mysql-test/suite/innodb/t/disabled.def13
-rw-r--r--mysql-test/suite/innodb/t/innodb-analyze.test66
-rw-r--r--mysql-test/suite/innodb/t/innodb-autoinc-44030.test (renamed from mysql-test/t/innodb-autoinc-44030.test)2
-rw-r--r--mysql-test/suite/innodb/t/innodb-autoinc.test (renamed from mysql-test/t/innodb-autoinc.test)0
-rw-r--r--mysql-test/suite/innodb/t/innodb-consistent-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb-index_ucs2.test5
-rw-r--r--mysql-test/suite/innodb/t/innodb-lock.test (renamed from mysql-test/t/innodb-lock.test)0
-rw-r--r--mysql-test/suite/innodb/t/innodb-master.opt (renamed from mysql-test/t/innodb-master.opt)0
-rw-r--r--mysql-test/suite/innodb/t/innodb-replace.test (renamed from mysql-test/t/innodb-replace.test)0
-rw-r--r--mysql-test/suite/innodb/t/innodb-semi-consistent-master.opt (renamed from mysql-test/t/innodb-semi-consistent-master.opt)0
-rw-r--r--mysql-test/suite/innodb/t/innodb-semi-consistent.test (renamed from mysql-test/t/innodb-semi-consistent.test)0
-rw-r--r--mysql-test/suite/innodb/t/innodb-timeout.test65
-rw-r--r--mysql-test/suite/innodb/t/innodb-use-sys-malloc-master.opt2
-rw-r--r--mysql-test/suite/innodb/t/innodb-use-sys-malloc.test49
-rw-r--r--mysql-test/suite/innodb/t/innodb.test (renamed from mysql-test/t/innodb.test)1153
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug21704.test (renamed from mysql-test/t/innodb_bug21704.test)0
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug34053.test (renamed from mysql-test/t/innodb_bug34053.test)0
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug34300.test (renamed from mysql-test/t/innodb_bug34300.test)0
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug35220.test (renamed from mysql-test/t/innodb_bug35220.test)0
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug36169.test1159
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug36172.test31
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug38231.test (renamed from mysql-test/t/innodb_bug38231.test)0
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug39438-master.opt (renamed from mysql-test/t/innodb_bug39438-master.opt)0
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug39438.test (renamed from mysql-test/t/innodb_bug39438.test)0
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug40565.test (renamed from mysql-test/t/innodb_bug40565.test)0
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug42101-nonzero-master.opt (renamed from mysql-test/t/innodb_bug42101-nonzero-master.opt)0
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug42101-nonzero.test (renamed from mysql-test/t/innodb_bug42101-nonzero.test)0
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug42101.test (renamed from mysql-test/t/innodb_bug42101.test)0
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug44032.test13
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug44369.test (renamed from mysql-test/t/innodb_bug44369.test)0
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug45357.test (renamed from mysql-test/t/innodb_bug45357.test)0
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug46000.test (renamed from mysql-test/t/innodb_bug46000.test)0
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug47621.test (renamed from mysql-test/t/innodb_bug47621.test)0
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug47777.test (renamed from mysql-test/t/innodb_bug47777.test)0
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug51920.test43
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug52663-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug52663.test34
-rw-r--r--mysql-test/suite/innodb/t/innodb_file_format.test43
-rw-r--r--mysql-test/suite/innodb/t/innodb_misc1-master.opt (renamed from storage/innodb_plugin/mysql-test/innodb-master.opt)0
-rw-r--r--mysql-test/suite/innodb/t/innodb_misc1.test1206
-rw-r--r--mysql-test/suite/innodb/t/innodb_trx_weight.test (renamed from mysql-test/t/innodb_trx_weight.test)0
-rw-r--r--mysql-test/suite/innodb_plugin/include/ctype_innodb_like.inc (renamed from storage/innodb_plugin/mysql-test/ctype_innodb_like.inc)0
-rw-r--r--mysql-test/suite/innodb_plugin/include/innodb-index.inc (renamed from mysql-test/suite/innodb/include/innodb-index.inc)0
-rw-r--r--mysql-test/suite/innodb_plugin/include/innodb_trx_weight.inc (renamed from storage/innodb_plugin/mysql-test/innodb_trx_weight.inc)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb-analyze.result (renamed from mysql-test/suite/innodb/r/innodb-analyze.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb-autoinc-44030.result30
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb-autoinc.result (renamed from storage/innodb_plugin/mysql-test/innodb-autoinc.result)379
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb-consistent.result (renamed from mysql-test/suite/innodb/r/innodb-consistent.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb-index.result (renamed from mysql-test/suite/innodb/r/innodb-index.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb-index_ucs2.result (renamed from mysql-test/suite/innodb/r/innodb-index_ucs2.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb-lock.result (renamed from storage/innodb_plugin/mysql-test/innodb-lock.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb-replace.result (renamed from storage/innodb_plugin/mysql-test/innodb-replace.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb-semi-consistent.result (renamed from storage/innodb_plugin/mysql-test/innodb-semi-consistent.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb-timeout.result (renamed from mysql-test/suite/innodb/r/innodb-timeout.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb-use-sys-malloc.result (renamed from mysql-test/suite/innodb/r/innodb-use-sys-malloc.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb-zip.result (renamed from mysql-test/suite/innodb/r/innodb-zip.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb.result (renamed from storage/innodb_plugin/mysql-test/innodb.result)13
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug21704.result (renamed from storage/innodb_plugin/mysql-test/innodb_bug21704.result)12
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug34053.result (renamed from storage/innodb_plugin/mysql-test/innodb_bug34053.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug34300.result (renamed from storage/innodb_plugin/mysql-test/innodb_bug34300.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug35220.result (renamed from storage/innodb_plugin/mysql-test/innodb_bug35220.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug36169.result (renamed from mysql-test/suite/innodb/r/innodb_bug36169.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug36172.result (renamed from mysql-test/suite/innodb/r/innodb_bug36172.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug38231.result11
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug39438.result (renamed from storage/innodb_plugin/mysql-test/innodb_bug36172.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug40360.result (renamed from mysql-test/suite/innodb/r/innodb_bug40360.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug40565.result (renamed from storage/innodb_plugin/mysql-test/innodb_bug40565.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug41904.result (renamed from mysql-test/suite/innodb/r/innodb_bug41904.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug42101-nonzero.result (renamed from storage/innodb_plugin/mysql-test/innodb_bug42101-nonzero.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug42101.result (renamed from storage/innodb_plugin/mysql-test/innodb_bug42101.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug44032.result (renamed from mysql-test/suite/innodb/r/innodb_bug44032.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug44369.result6
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug44571.result (renamed from mysql-test/suite/innodb/r/innodb_bug44571.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug45357.result (renamed from storage/innodb_plugin/mysql-test/innodb_bug45357.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug46000.result19
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug46676.result (renamed from mysql-test/suite/innodb/r/innodb_bug46676.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug47167.result (renamed from mysql-test/suite/innodb/r/innodb_bug47167.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug47621.result21
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug47622.result (renamed from mysql-test/suite/innodb/r/innodb_bug47622.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug47777.result13
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug51378.result (renamed from mysql-test/suite/innodb/r/innodb_bug51378.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug51920.result13
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug52663.result26
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_bug52745.result130
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_file_format.result (renamed from storage/innodb_plugin/mysql-test/innodb_file_format.result)2
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_information_schema.result (renamed from mysql-test/suite/innodb/r/innodb_information_schema.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/r/innodb_trx_weight.result (renamed from storage/innodb_plugin/mysql-test/innodb_trx_weight.result)0
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb-analyze.test (renamed from storage/innodb_plugin/mysql-test/innodb-analyze.test)2
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb-autoinc-44030.test43
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb-autoinc.test (renamed from storage/innodb_plugin/mysql-test/innodb-autoinc.test)201
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb-consistent-master.opt (renamed from storage/innodb_plugin/mysql-test/innodb-semi-consistent-master.opt)0
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb-consistent.test (renamed from mysql-test/suite/innodb/t/innodb-consistent.test)3
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb-index.test (renamed from mysql-test/suite/innodb/t/innodb-index.test)4
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb-index_ucs2.test5
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb-lock.test (renamed from storage/innodb_plugin/mysql-test/innodb-lock.test)2
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb-master.opt1
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb-replace.test (renamed from storage/innodb_plugin/mysql-test/innodb-replace.test)2
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb-semi-consistent-master.opt (renamed from storage/innodb_plugin/mysql-test/innodb-consistent-master.opt)2
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb-semi-consistent.test (renamed from storage/innodb_plugin/mysql-test/innodb-semi-consistent.test)2
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb-timeout.test (renamed from storage/innodb_plugin/mysql-test/innodb-timeout.test)2
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb-use-sys-malloc-master.opt (renamed from storage/innodb_plugin/mysql-test/innodb-use-sys-malloc-master.opt)1
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb-use-sys-malloc.test (renamed from storage/innodb_plugin/mysql-test/innodb-use-sys-malloc.test)4
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb-zip.test (renamed from mysql-test/suite/innodb/t/innodb-zip.test)6
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb.test (renamed from storage/innodb_plugin/mysql-test/innodb.test)23
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug21704.test (renamed from storage/innodb_plugin/mysql-test/innodb_bug21704.test)2
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug34053.test (renamed from storage/innodb_plugin/mysql-test/innodb_bug34053.test)2
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug34300.test (renamed from storage/innodb_plugin/mysql-test/innodb_bug34300.test)2
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug35220.test (renamed from storage/innodb_plugin/mysql-test/innodb_bug35220.test)2
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug36169.test (renamed from storage/innodb_plugin/mysql-test/innodb_bug36169.test)3
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug36172.test (renamed from storage/innodb_plugin/mysql-test/innodb_bug36172.test)2
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug38231.test112
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug39438-master.opt1
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug39438.test51
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug40360.test (renamed from mysql-test/suite/innodb/t/innodb_bug40360.test)2
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug40565.test (renamed from storage/innodb_plugin/mysql-test/innodb_bug40565.test)2
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug41904.test (renamed from mysql-test/suite/innodb/t/innodb_bug41904.test)2
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug42101-nonzero-master.opt (renamed from storage/innodb_plugin/mysql-test/innodb_bug42101-nonzero-master.opt)0
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug42101-nonzero.test (renamed from storage/innodb_plugin/mysql-test/innodb_bug42101-nonzero.test)2
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug42101.test (renamed from storage/innodb_plugin/mysql-test/innodb_bug42101.test)2
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug44032.test (renamed from storage/innodb_plugin/mysql-test/innodb_bug44032.test)2
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug44369.test (renamed from storage/innodb_plugin/mysql-test/innodb_bug44369.test)12
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug44571.test (renamed from mysql-test/suite/innodb/t/innodb_bug44571.test)3
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug45357.test (renamed from storage/innodb_plugin/mysql-test/innodb_bug45357.test)2
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug46000.test (renamed from storage/innodb_plugin/mysql-test/innodb_bug46000.test)14
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug46676.test (renamed from mysql-test/suite/innodb/t/innodb_bug46676.test)2
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug47167.test (renamed from mysql-test/suite/innodb/t/innodb_bug47167.test)3
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug47621.test57
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug47622.test (renamed from mysql-test/suite/innodb/t/innodb_bug47622.test)2
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug47777.test24
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug51378.test (renamed from mysql-test/suite/innodb/t/innodb_bug51378.test)2
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug51920.test43
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug52663.test34
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_bug52745.test109
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_file_format.test (renamed from storage/innodb_plugin/mysql-test/innodb_file_format.test)2
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_information_schema.test (renamed from mysql-test/suite/innodb/t/innodb_information_schema.test)3
-rw-r--r--mysql-test/suite/innodb_plugin/t/innodb_trx_weight.test (renamed from storage/innodb_plugin/mysql-test/innodb_trx_weight.test)14
-rw-r--r--mysql-test/t/disabled.def3
-rw-r--r--mysql-test/t/partition_innodb_plugin.test3
-rw-r--r--[-rwxr-xr-x]storage/innobase/CMakeLists.txt0
-rw-r--r--storage/innobase/handler/ha_innodb.cc10
-rw-r--r--storage/innobase/include/mem0mem.h11
-rw-r--r--storage/innobase/include/mem0mem.ic17
-rw-r--r--storage/innobase/include/trx0sys.ic2
-rw-r--r--storage/innobase/include/univ.i3
-rw-r--r--storage/innobase/lock/lock0lock.c27
-rw-r--r--storage/innobase/log/log0recv.c4
-rw-r--r--storage/innobase/row/row0ins.c6
-rw-r--r--storage/innobase/row/row0mysql.c2
-rw-r--r--storage/innobase/row/row0sel.c27
-rw-r--r--storage/innobase/srv/srv0srv.c12
-rw-r--r--storage/innodb_plugin/ChangeLog68
-rw-r--r--storage/innodb_plugin/btr/btr0btr.c107
-rw-r--r--storage/innodb_plugin/btr/btr0cur.c19
-rw-r--r--storage/innodb_plugin/buf/buf0flu.c6
-rw-r--r--storage/innodb_plugin/data/data0data.c15
-rw-r--r--storage/innodb_plugin/dict/dict0boot.c4
-rw-r--r--storage/innodb_plugin/dict/dict0crea.c7
-rw-r--r--storage/innodb_plugin/dict/dict0dict.c74
-rw-r--r--storage/innodb_plugin/ha/ha0ha.c4
-rw-r--r--storage/innodb_plugin/handler/ha_innodb.cc41
-rw-r--r--storage/innodb_plugin/handler/handler0alter.cc13
-rw-r--r--storage/innodb_plugin/include/dict0boot.h2
-rw-r--r--storage/innodb_plugin/include/dict0dict.h21
-rw-r--r--storage/innodb_plugin/include/log0recv.h4
-rw-r--r--storage/innodb_plugin/include/trx0trx.h8
-rw-r--r--storage/innodb_plugin/include/univ.i11
-rw-r--r--storage/innodb_plugin/lock/lock0lock.c25
-rw-r--r--storage/innodb_plugin/log/log0recv.c6
-rw-r--r--storage/innodb_plugin/mysql-test/have_innodb.inc4
-rw-r--r--storage/innodb_plugin/mysql-test/innodb-analyze.result2
-rw-r--r--storage/innodb_plugin/mysql-test/innodb-consistent.result35
-rw-r--r--storage/innodb_plugin/mysql-test/innodb-consistent.test58
-rw-r--r--storage/innodb_plugin/mysql-test/innodb-index.inc26
-rw-r--r--storage/innodb_plugin/mysql-test/innodb-index.result1170
-rw-r--r--storage/innodb_plugin/mysql-test/innodb-index.test534
-rw-r--r--storage/innodb_plugin/mysql-test/innodb-index_ucs2.result116
-rw-r--r--storage/innodb_plugin/mysql-test/innodb-index_ucs2.test5
-rw-r--r--storage/innodb_plugin/mysql-test/innodb-timeout.result38
-rw-r--r--storage/innodb_plugin/mysql-test/innodb-use-sys-malloc.result48
-rw-r--r--storage/innodb_plugin/mysql-test/innodb-zip.result421
-rw-r--r--storage/innodb_plugin/mysql-test/innodb-zip.test343
-rw-r--r--storage/innodb_plugin/mysql-test/innodb_bug36169.result2
-rw-r--r--storage/innodb_plugin/mysql-test/innodb_bug40360.result4
-rw-r--r--storage/innodb_plugin/mysql-test/innodb_bug40360.test16
-rw-r--r--storage/innodb_plugin/mysql-test/innodb_bug41904.result4
-rw-r--r--storage/innodb_plugin/mysql-test/innodb_bug41904.test14
-rw-r--r--storage/innodb_plugin/mysql-test/innodb_bug44032.result7
-rw-r--r--storage/innodb_plugin/mysql-test/innodb_bug44369.result14
-rw-r--r--storage/innodb_plugin/mysql-test/innodb_bug44571.result9
-rw-r--r--storage/innodb_plugin/mysql-test/innodb_bug44571.test17
-rw-r--r--storage/innodb_plugin/mysql-test/innodb_bug46000.result17
-rw-r--r--storage/innodb_plugin/mysql-test/innodb_information_schema.result23
-rw-r--r--storage/innodb_plugin/mysql-test/innodb_information_schema.test145
-rw-r--r--storage/innodb_plugin/mysql-test/patches/innodb-index.diff62
-rw-r--r--storage/innodb_plugin/rem/rem0rec.c68
-rw-r--r--storage/innodb_plugin/row/row0merge.c2
-rw-r--r--storage/innodb_plugin/row/row0mysql.c2
-rw-r--r--storage/innodb_plugin/row/row0sel.c31
-rw-r--r--storage/innodb_plugin/srv/srv0srv.c12
-rw-r--r--storage/innodb_plugin/trx/trx0rec.c21
-rw-r--r--storage/innodb_plugin/trx/trx0trx.c2
230 files changed, 4199 insertions, 6993 deletions
diff --git a/mysql-test/include/have_innodb_plugin.inc b/mysql-test/include/have_innodb_plugin.inc
new file mode 100644
index 00000000000..99a79465f52
--- /dev/null
+++ b/mysql-test/include/have_innodb_plugin.inc
@@ -0,0 +1,4 @@
+disable_query_log;
+--require r/true.require
+SELECT (plugin_library LIKE 'ha_innodb_plugin%') AS `TRUE` FROM information_schema.plugins WHERE LOWER(plugin_name) = 'innodb' AND LOWER(plugin_status) = 'active';
+enable_query_log;
diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm
index 218701ff4a7..cf84c0ad31f 100644
--- a/mysql-test/lib/mtr_cases.pm
+++ b/mysql-test/lib/mtr_cases.pm
@@ -70,11 +70,20 @@ my $skip_test_reg;
# Related to adding InnoDB plugin combinations
my $lib_innodb_plugin;
-my $do_innodb_plugin;
# If "Quick collect", set to 1 once a test to run has been found.
my $some_test_found;
+sub find_innodb_plugin {
+ $lib_innodb_plugin=
+ my_find_file($::basedir,
+ ["storage/innodb_plugin", "storage/innodb_plugin/.libs",
+ "lib/mysql/plugin", "lib/plugin"],
+ ["ha_innodb_plugin.dll", "ha_innodb_plugin.so",
+ "ha_innodb_plugin.sl"],
+ NOT_REQUIRED);
+}
+
sub init_pattern {
my ($from, $what)= @_;
return undef unless defined $from;
@@ -107,16 +116,7 @@ sub collect_test_cases ($$$) {
$do_test_reg= init_pattern($do_test, "--do-test");
$skip_test_reg= init_pattern($skip_test, "--skip-test");
- $lib_innodb_plugin=
- my_find_file($::basedir,
- ["storage/innodb_plugin", "storage/innodb_plugin/.libs",
- "lib/mysql/plugin", "lib/plugin"],
- ["ha_innodb_plugin.dll", "ha_innodb_plugin.so",
- "ha_innodb_plugin.sl"],
- NOT_REQUIRED);
- $do_innodb_plugin= ($::mysql_version_id >= 50100 &&
- !(IS_WINDOWS && $::opt_embedded_server) &&
- $lib_innodb_plugin);
+ &find_innodb_plugin;
# If not reordering, we also shouldn't group by suites, unless
# no test cases were named.
@@ -504,73 +504,6 @@ sub collect_one_suite($)
}
}
- # ----------------------------------------------------------------------
- # Testing InnoDB plugin.
- # ----------------------------------------------------------------------
- if ($do_innodb_plugin)
- {
- my @new_cases;
- my $sep= (IS_WINDOWS) ? ';' : ':';
-
- foreach my $test (@cases)
- {
- next if (!$test->{'innodb_test'});
- # If skipped due to no builtin innodb, we can still run it with plugin
- next if ($test->{'skip'} && $test->{comment} ne "No innodb support");
- # Exceptions
- next if ($test->{'name'} eq 'main.innodb'); # Failed with wrong errno (fk)
- next if ($test->{'name'} eq 'main.index_merge_innodb'); # Explain diff
- # innodb_file_per_table is rw with innodb_plugin
- next if ($test->{'name'} eq 'sys_vars.innodb_file_per_table_basic');
- # innodb_lock_wait_timeout is rw with innodb_plugin
- next if ($test->{'name'} eq 'sys_vars.innodb_lock_wait_timeout_basic');
- # Diff around innodb_thread_concurrency variable
- next if ($test->{'name'} eq 'sys_vars.innodb_thread_concurrency_basic');
- # Can't work with InnoPlug. Test framework needs to be re-designed.
- next if ($test->{'name'} eq 'main.innodb_bug46000');
- # Fails with innodb plugin
- next if ($test->{'name'} eq 'main.innodb-autoinc');
- # Fails with innodb plugin: r6185 Testcases changes not included
- next if ($test->{'name'} eq 'main.innodb_bug44369');
- # Fix for BUG47621 is not in InnoDB plugin
- next if ($test->{'name'} eq 'main.innodb_bug21704');
- next if ($test->{'name'} eq 'main.innodb_bug47621');
- # Copy test options
- my $new_test= My::Test->new();
- while (my ($key, $value) = each(%$test))
- {
- if (ref $value eq "ARRAY")
- {
- push(@{$new_test->{$key}}, @$value);
- }
- else
- {
- $new_test->{$key}= $value unless ($key eq 'skip');
- }
- }
- my $plugin_filename= basename($lib_innodb_plugin);
- my $plugin_list= "innodb=$plugin_filename" . $sep . "innodb_locks=$plugin_filename";
- push(@{$new_test->{master_opt}}, '--ignore-builtin-innodb');
- push(@{$new_test->{master_opt}}, '--plugin-dir=' . dirname($lib_innodb_plugin));
- push(@{$new_test->{master_opt}}, "--plugin_load=$plugin_list");
- push(@{$new_test->{slave_opt}}, '--ignore-builtin-innodb');
- push(@{$new_test->{slave_opt}}, '--plugin-dir=' . dirname($lib_innodb_plugin));
- push(@{$new_test->{slave_opt}}, "--plugin_load=$plugin_list");
- if ($new_test->{combination})
- {
- $new_test->{combination}.= '+innodb_plugin';
- }
- else
- {
- $new_test->{combination}= 'innodb_plugin';
- }
- push(@new_cases, $new_test);
- }
- push(@cases, @new_cases);
- }
- # ----------------------------------------------------------------------
- # End of testing InnoDB plugin.
- # ----------------------------------------------------------------------
optimize_cases(\@cases);
#print_testcases(@cases);
@@ -1005,11 +938,38 @@ sub collect_one_test_case {
{
# innodb is not supported, skip it
$tinfo->{'skip'}= 1;
- # This comment is checked for running with innodb plugin (see above),
- # please keep that in mind if changing the text.
$tinfo->{'comment'}= "No innodb support";
- # But continue processing if we may run it with innodb plugin
- return $tinfo unless $do_innodb_plugin;
+ return $tinfo;
+ }
+ }
+ elsif ( $tinfo->{'innodb_plugin_test'} )
+ {
+ # This is a test that needs the innodb plugin
+ if (!&find_innodb_plugin)
+ {
+ # innodb plugin is not supported, skip it
+ $tinfo->{'skip'}= 1;
+ $tinfo->{'comment'}= "No innodb plugin support";
+ return $tinfo;
+ }
+
+ my $sep= (IS_WINDOWS) ? ';' : ':';
+ my $plugin_filename= basename($lib_innodb_plugin);
+ my $plugin_list=
+ "innodb=$plugin_filename$sep" .
+ "innodb_trx=$plugin_filename$sep" .
+ "innodb_locks=$plugin_filename$sep" .
+ "innodb_lock_waits=$plugin_filename$sep" .
+ "innodb_cmp=$plugin_filename$sep" .
+ "innodb_cmp_reset=$plugin_filename$sep" .
+ "innodb_cmpmem=$plugin_filename$sep" .
+ "innodb_cmpmem_reset=$plugin_filename";
+
+ foreach my $k ('master_opt', 'slave_opt')
+ {
+ push(@{$tinfo->{$k}}, '--ignore-builtin-innodb');
+ push(@{$tinfo->{$k}}, '--plugin-dir=' . dirname($lib_innodb_plugin));
+ push(@{$tinfo->{$k}}, "--plugin-load=$plugin_list");
}
}
else
@@ -1137,6 +1097,7 @@ my @tags=
["include/have_log_bin.inc", "need_binlog", 1],
["include/have_innodb.inc", "innodb_test", 1],
+ ["include/have_innodb_plugin.inc", "innodb_plugin_test", 1],
["include/big_test.inc", "big_test", 1],
["include/have_debug.inc", "need_debug", 1],
["include/have_ndb.inc", "ndb_test", 1],
diff --git a/mysql-test/suite/binlog/t/binlog_killed.test b/mysql-test/suite/binlog/t/binlog_killed.test
index e2db326129d..ce6d344af32 100644
--- a/mysql-test/suite/binlog/t/binlog_killed.test
+++ b/mysql-test/suite/binlog/t/binlog_killed.test
@@ -202,7 +202,7 @@ eval kill query $ID;
rollback;
connection con2;
---error 0,ER_QUERY_INTERRUPTED
+--error 0,ER_QUERY_INTERRUPTED,ER_LOCK_WAIT_TIMEOUT
reap;
# todo 1,2 above
rollback;
diff --git a/mysql-test/suite/innodb/include/have_innodb_plugin.inc b/mysql-test/suite/innodb/include/have_innodb_plugin.inc
deleted file mode 100644
index 24af3274ada..00000000000
--- a/mysql-test/suite/innodb/include/have_innodb_plugin.inc
+++ /dev/null
@@ -1,4 +0,0 @@
-disable_query_log;
---require r/true.require
-select (PLUGIN_LIBRARY LIKE 'ha_innodb_plugin%') as `TRUE` from information_schema.plugins where PLUGIN_NAME='InnoDB';
-enable_query_log;
diff --git a/mysql-test/r/innodb-autoinc-44030.result b/mysql-test/suite/innodb/r/innodb-autoinc-44030.result
index c0695bf0be0..54e972843f5 100644
--- a/mysql-test/r/innodb-autoinc-44030.result
+++ b/mysql-test/suite/innodb/r/innodb-autoinc-44030.result
@@ -13,18 +13,18 @@ d1
1
2
INSERT INTO t1 VALUES(null);
-Got one of the listed errors
ALTER TABLE t1 AUTO_INCREMENT = 3;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`d1` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`d1`)
-) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES(null);
SELECT * FROM t1;
d1
1
2
3
+4
DROP TABLE t1;
diff --git a/mysql-test/r/innodb-autoinc.result b/mysql-test/suite/innodb/r/innodb-autoinc.result
index a36b3a1a865..a36b3a1a865 100644
--- a/mysql-test/r/innodb-autoinc.result
+++ b/mysql-test/suite/innodb/r/innodb-autoinc.result
diff --git a/mysql-test/r/innodb-lock.result b/mysql-test/suite/innodb/r/innodb-lock.result
index 4ace4065c34..4ace4065c34 100644
--- a/mysql-test/r/innodb-lock.result
+++ b/mysql-test/suite/innodb/r/innodb-lock.result
diff --git a/mysql-test/r/innodb-replace.result b/mysql-test/suite/innodb/r/innodb-replace.result
index c926bb89a2e..c926bb89a2e 100644
--- a/mysql-test/r/innodb-replace.result
+++ b/mysql-test/suite/innodb/r/innodb-replace.result
diff --git a/mysql-test/r/innodb-semi-consistent.result b/mysql-test/suite/innodb/r/innodb-semi-consistent.result
index ca0e362ef80..ca0e362ef80 100644
--- a/mysql-test/r/innodb-semi-consistent.result
+++ b/mysql-test/suite/innodb/r/innodb-semi-consistent.result
diff --git a/mysql-test/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result
index b6602c9cfaf..5b84a64e8e8 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/suite/innodb/r/innodb.result
@@ -2427,881 +2427,3 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
set storage_engine=MyISAM;
-create table t1 (v varchar(16384)) engine=innodb;
-drop table t1;
-create table t1 (a char(1), b char(1), key(a, b)) engine=innodb;
-insert into t1 values ('8', '6'), ('4', '7');
-select min(a) from t1;
-min(a)
-4
-select min(b) from t1 where a='8';
-min(b)
-6
-drop table t1;
-CREATE TABLE t1 ( `a` int(11) NOT NULL auto_increment, `b` int(11) default NULL,PRIMARY KEY (`a`),UNIQUE KEY `b` (`b`)) ENGINE=innodb;
-insert into t1 (b) values (1);
-replace into t1 (b) values (2), (1), (3);
-select * from t1;
-a b
-3 1
-2 2
-4 3
-truncate table t1;
-insert into t1 (b) values (1);
-replace into t1 (b) values (2);
-replace into t1 (b) values (1);
-replace into t1 (b) values (3);
-select * from t1;
-a b
-3 1
-2 2
-4 3
-drop table t1;
-create table t1 (rowid int not null auto_increment, val int not null,primary
-key (rowid), unique(val)) engine=innodb;
-replace into t1 (val) values ('1'),('2');
-replace into t1 (val) values ('1'),('2');
-insert into t1 (val) values ('1'),('2');
-ERROR 23000: Duplicate entry '1' for key 'val'
-select * from t1;
-rowid val
-3 1
-4 2
-drop table t1;
-create table t1 (a int not null auto_increment primary key, val int) engine=InnoDB;
-insert into t1 (val) values (1);
-update t1 set a=2 where a=1;
-insert into t1 (val) values (1);
-ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
-select * from t1;
-a val
-2 1
-drop table t1;
-CREATE TABLE t1 (GRADE DECIMAL(4) NOT NULL, PRIMARY KEY (GRADE)) ENGINE=INNODB;
-INSERT INTO t1 (GRADE) VALUES (151),(252),(343);
-SELECT GRADE FROM t1 WHERE GRADE > 160 AND GRADE < 300;
-GRADE
-252
-SELECT GRADE FROM t1 WHERE GRADE= 151;
-GRADE
-151
-DROP TABLE t1;
-create table t1 (f1 varchar(10), f2 varchar(10), primary key (f1,f2)) engine=innodb;
-create table t2 (f3 varchar(10), f4 varchar(10), key (f4)) engine=innodb;
-insert into t2 values ('aa','cc');
-insert into t1 values ('aa','bb'),('aa','cc');
-delete t1 from t1,t2 where f1=f3 and f4='cc';
-select * from t1;
-f1 f2
-drop table t1,t2;
-CREATE TABLE t1 (
-id INTEGER NOT NULL AUTO_INCREMENT, PRIMARY KEY (id)
-) ENGINE=InnoDB;
-CREATE TABLE t2 (
-id INTEGER NOT NULL,
-FOREIGN KEY (id) REFERENCES t1 (id)
-) ENGINE=InnoDB;
-INSERT INTO t1 (id) VALUES (NULL);
-SELECT * FROM t1;
-id
-1
-TRUNCATE t1;
-INSERT INTO t1 (id) VALUES (NULL);
-SELECT * FROM t1;
-id
-1
-DELETE FROM t1;
-TRUNCATE t1;
-INSERT INTO t1 (id) VALUES (NULL);
-SELECT * FROM t1;
-id
-1
-DROP TABLE t2, t1;
-CREATE TABLE t1
-(
-id INT PRIMARY KEY
-) ENGINE=InnoDB;
-CREATE TEMPORARY TABLE t2
-(
-id INT NOT NULL PRIMARY KEY,
-b INT,
-FOREIGN KEY (b) REFERENCES test.t1(id)
-) ENGINE=InnoDB;
-Got one of the listed errors
-DROP TABLE t1;
-create table t1 (col1 varchar(2000), index (col1(767)))
-character set = latin1 engine = innodb;
-create table t2 (col1 char(255), index (col1))
-character set = latin1 engine = innodb;
-create table t3 (col1 binary(255), index (col1))
-character set = latin1 engine = innodb;
-create table t4 (col1 varchar(767), index (col1))
-character set = latin1 engine = innodb;
-create table t5 (col1 varchar(767) primary key)
-character set = latin1 engine = innodb;
-create table t6 (col1 varbinary(767) primary key)
-character set = latin1 engine = innodb;
-create table t7 (col1 text, index(col1(767)))
-character set = latin1 engine = innodb;
-create table t8 (col1 blob, index(col1(767)))
-character set = latin1 engine = innodb;
-create table t9 (col1 varchar(512), col2 varchar(512), index(col1, col2))
-character set = latin1 engine = innodb;
-show create table t9;
-Table Create Table
-t9 CREATE TABLE `t9` (
- `col1` varchar(512) DEFAULT NULL,
- `col2` varchar(512) DEFAULT NULL,
- KEY `col1` (`col1`,`col2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1, t2, t3, t4, t5, t6, t7, t8, t9;
-create table t1 (col1 varchar(768), index(col1))
-character set = latin1 engine = innodb;
-Warnings:
-Warning 1071 Specified key was too long; max key length is 767 bytes
-create table t2 (col1 varbinary(768), index(col1))
-character set = latin1 engine = innodb;
-Warnings:
-Warning 1071 Specified key was too long; max key length is 767 bytes
-create table t3 (col1 text, index(col1(768)))
-character set = latin1 engine = innodb;
-Warnings:
-Warning 1071 Specified key was too long; max key length is 767 bytes
-create table t4 (col1 blob, index(col1(768)))
-character set = latin1 engine = innodb;
-Warnings:
-Warning 1071 Specified key was too long; max key length is 767 bytes
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `col1` varchar(768) DEFAULT NULL,
- KEY `col1` (`col1`(767))
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1, t2, t3, t4;
-create table t1 (col1 varchar(768) primary key)
-character set = latin1 engine = innodb;
-ERROR 42000: Specified key was too long; max key length is 767 bytes
-create table t2 (col1 varbinary(768) primary key)
-character set = latin1 engine = innodb;
-ERROR 42000: Specified key was too long; max key length is 767 bytes
-create table t3 (col1 text, primary key(col1(768)))
-character set = latin1 engine = innodb;
-ERROR 42000: Specified key was too long; max key length is 767 bytes
-create table t4 (col1 blob, primary key(col1(768)))
-character set = latin1 engine = innodb;
-ERROR 42000: Specified key was too long; max key length is 767 bytes
-CREATE TABLE t1
-(
-id INT PRIMARY KEY
-) ENGINE=InnoDB;
-CREATE TABLE t2
-(
-v INT,
-CONSTRAINT c1 FOREIGN KEY (v) REFERENCES t1(id)
-) ENGINE=InnoDB;
-INSERT INTO t2 VALUES(2);
-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`))
-INSERT INTO t1 VALUES(1);
-INSERT INTO t2 VALUES(1);
-DELETE FROM t1 WHERE id = 1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`))
-DROP TABLE t1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
-SET FOREIGN_KEY_CHECKS=0;
-DROP TABLE t1;
-SET FOREIGN_KEY_CHECKS=1;
-INSERT INTO t2 VALUES(3);
-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`))
-DROP TABLE t2;
-create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
-insert into t1 values (1),(2);
-set autocommit=0;
-checksum table t1;
-Table Checksum
-test.t1 1531596814
-insert into t1 values(3);
-checksum table t1;
-Table Checksum
-test.t1 1531596814
-commit;
-checksum table t1;
-Table Checksum
-test.t1 2050879373
-commit;
-drop table t1;
-create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
-insert into t1 values (1),(2);
-set autocommit=1;
-checksum table t1;
-Table Checksum
-test.t1 1531596814
-set autocommit=1;
-insert into t1 values(3);
-checksum table t1;
-Table Checksum
-test.t1 2050879373
-drop table t1;
-set foreign_key_checks=0;
-create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb;
-create table t1(a char(10) primary key, b varchar(20)) engine = innodb;
-ERROR HY000: Can't create table 'test.t1' (errno: 150)
-set foreign_key_checks=1;
-drop table t2;
-set foreign_key_checks=0;
-create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1;
-create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=utf8;
-ERROR HY000: Can't create table 'test.t2' (errno: 150)
-set foreign_key_checks=1;
-drop table t1;
-set foreign_key_checks=0;
-create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb;
-create table t1(a varchar(10) primary key) engine = innodb;
-alter table t1 modify column a int;
-Got one of the listed errors
-set foreign_key_checks=1;
-drop table t2,t1;
-set foreign_key_checks=0;
-create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1;
-create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1;
-alter table t1 convert to character set utf8;
-set foreign_key_checks=1;
-drop table t2,t1;
-set foreign_key_checks=0;
-create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1;
-create table t3(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=utf8;
-rename table t3 to t1;
-ERROR HY000: Error on rename of './test/t3' to './test/t1' (errno: 150)
-set foreign_key_checks=1;
-drop table t2,t3;
-create table t1(a int primary key) row_format=redundant engine=innodb;
-create table t2(a int primary key,constraint foreign key(a)references t1(a)) row_format=compact engine=innodb;
-create table t3(a int primary key) row_format=compact engine=innodb;
-create table t4(a int primary key,constraint foreign key(a)references t3(a)) row_format=redundant engine=innodb;
-insert into t1 values(1);
-insert into t3 values(1);
-insert into t2 values(2);
-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`))
-insert into t4 values(2);
-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t4`, CONSTRAINT `t4_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t3` (`a`))
-insert into t2 values(1);
-insert into t4 values(1);
-update t1 set a=2;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`))
-update t2 set a=2;
-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`))
-update t3 set a=2;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t4`, CONSTRAINT `t4_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t3` (`a`))
-update t4 set a=2;
-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t4`, CONSTRAINT `t4_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t3` (`a`))
-truncate t1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`))
-truncate t3;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t4`, CONSTRAINT `t4_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t3` (`a`))
-truncate t2;
-truncate t4;
-truncate t1;
-truncate t3;
-drop table t4,t3,t2,t1;
-create table t1 (a varchar(255) character set utf8,
-b varchar(255) character set utf8,
-c varchar(255) character set utf8,
-d varchar(255) character set utf8,
-key (a,b,c,d)) engine=innodb;
-drop table t1;
-create table t1 (a varchar(255) character set utf8,
-b varchar(255) character set utf8,
-c varchar(255) character set utf8,
-d varchar(255) character set utf8,
-e varchar(255) character set utf8,
-key (a,b,c,d,e)) engine=innodb;
-ERROR 42000: Specified key was too long; max key length is 3072 bytes
-create table t1 (s1 varbinary(2),primary key (s1)) engine=innodb;
-create table t2 (s1 binary(2),primary key (s1)) engine=innodb;
-create table t3 (s1 varchar(2) binary,primary key (s1)) engine=innodb;
-create table t4 (s1 char(2) binary,primary key (s1)) engine=innodb;
-insert into t1 values (0x41),(0x4120),(0x4100);
-insert into t2 values (0x41),(0x4120),(0x4100);
-ERROR 23000: Duplicate entry 'A' for key 'PRIMARY'
-insert into t2 values (0x41),(0x4120);
-insert into t3 values (0x41),(0x4120),(0x4100);
-ERROR 23000: Duplicate entry 'A ' for key 'PRIMARY'
-insert into t3 values (0x41),(0x4100);
-insert into t4 values (0x41),(0x4120),(0x4100);
-ERROR 23000: Duplicate entry 'A' for key 'PRIMARY'
-insert into t4 values (0x41),(0x4100);
-select hex(s1) from t1;
-hex(s1)
-41
-4100
-4120
-select hex(s1) from t2;
-hex(s1)
-4100
-4120
-select hex(s1) from t3;
-hex(s1)
-4100
-41
-select hex(s1) from t4;
-hex(s1)
-4100
-41
-drop table t1,t2,t3,t4;
-create table t1 (a int primary key,s1 varbinary(3) not null unique) engine=innodb;
-create table t2 (s1 binary(2) not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=innodb;
-insert into t1 values(1,0x4100),(2,0x41),(3,0x4120),(4,0x42);
-insert into t2 values(0x42);
-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE)
-insert into t2 values(0x41);
-select hex(s1) from t2;
-hex(s1)
-4100
-update t1 set s1=0x123456 where a=2;
-select hex(s1) from t2;
-hex(s1)
-4100
-update t1 set s1=0x12 where a=1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE)
-update t1 set s1=0x12345678 where a=1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE)
-update t1 set s1=0x123457 where a=1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE)
-update t1 set s1=0x1220 where a=1;
-select hex(s1) from t2;
-hex(s1)
-1220
-update t1 set s1=0x1200 where a=1;
-select hex(s1) from t2;
-hex(s1)
-1200
-update t1 set s1=0x4200 where a=1;
-select hex(s1) from t2;
-hex(s1)
-4200
-delete from t1 where a=1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE)
-delete from t1 where a=2;
-update t2 set s1=0x4120;
-delete from t1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE)
-delete from t1 where a!=3;
-select a,hex(s1) from t1;
-a hex(s1)
-3 4120
-select hex(s1) from t2;
-hex(s1)
-4120
-drop table t2,t1;
-create table t1 (a int primary key,s1 varchar(2) binary not null unique) engine=innodb;
-create table t2 (s1 char(2) binary not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=innodb;
-insert into t1 values(1,0x4100),(2,0x41);
-insert into t2 values(0x41);
-select hex(s1) from t2;
-hex(s1)
-41
-update t1 set s1=0x1234 where a=1;
-select hex(s1) from t2;
-hex(s1)
-41
-update t1 set s1=0x12 where a=2;
-select hex(s1) from t2;
-hex(s1)
-12
-delete from t1 where a=1;
-delete from t1 where a=2;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE)
-select a,hex(s1) from t1;
-a hex(s1)
-2 12
-select hex(s1) from t2;
-hex(s1)
-12
-drop table t2,t1;
-CREATE TABLE t1(a INT, PRIMARY KEY(a)) ENGINE=InnoDB;
-CREATE TABLE t2(a INT) ENGINE=InnoDB;
-ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1(a);
-ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_1;
-ALTER TABLE t2 ADD CONSTRAINT t2_ibfk_0 FOREIGN KEY (a) REFERENCES t1(a);
-ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_0;
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) DEFAULT NULL,
- KEY `t2_ibfk_0` (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-DROP TABLE t2,t1;
-create table t1(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
-insert into t1(a) values (1),(2),(3);
-commit;
-set autocommit = 0;
-update t1 set b = 5 where a = 2;
-create trigger t1t before insert on t1 for each row begin set NEW.b = NEW.a * 10 + 5, NEW.c = NEW.a / 10; end |
-set autocommit = 0;
-insert into t1(a) values (10),(20),(30),(40),(50),(60),(70),(80),(90),(100),
-(11),(21),(31),(41),(51),(61),(71),(81),(91),(101),
-(12),(22),(32),(42),(52),(62),(72),(82),(92),(102),
-(13),(23),(33),(43),(53),(63),(73),(83),(93),(103),
-(14),(24),(34),(44),(54),(64),(74),(84),(94),(104);
-commit;
-commit;
-drop trigger t1t;
-drop table t1;
-create table t1(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
-create table t2(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
-create table t3(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
-create table t4(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
-create table t5(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
-insert into t1(a) values (1),(2),(3);
-insert into t2(a) values (1),(2),(3);
-insert into t3(a) values (1),(2),(3);
-insert into t4(a) values (1),(2),(3);
-insert into t3(a) values (5),(7),(8);
-insert into t4(a) values (5),(7),(8);
-insert into t5(a) values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12);
-create trigger t1t before insert on t1 for each row begin
-INSERT INTO t2 SET a = NEW.a;
-end |
-create trigger t2t before insert on t2 for each row begin
-DELETE FROM t3 WHERE a = NEW.a;
-end |
-create trigger t3t before delete on t3 for each row begin
-UPDATE t4 SET b = b + 1 WHERE a = OLD.a;
-end |
-create trigger t4t before update on t4 for each row begin
-UPDATE t5 SET b = b + 1 where a = NEW.a;
-end |
-commit;
-set autocommit = 0;
-update t1 set b = b + 5 where a = 1;
-update t2 set b = b + 5 where a = 1;
-update t3 set b = b + 5 where a = 1;
-update t4 set b = b + 5 where a = 1;
-insert into t5(a) values(20);
-set autocommit = 0;
-insert into t1(a) values(7);
-insert into t2(a) values(8);
-delete from t2 where a = 3;
-update t4 set b = b + 1 where a = 3;
-commit;
-drop trigger t1t;
-drop trigger t2t;
-drop trigger t3t;
-drop trigger t4t;
-drop table t1, t2, t3, t4, t5;
-CREATE TABLE t1 (
-field1 varchar(8) NOT NULL DEFAULT '',
-field2 varchar(8) NOT NULL DEFAULT '',
-PRIMARY KEY (field1, field2)
-) ENGINE=InnoDB;
-CREATE TABLE t2 (
-field1 varchar(8) NOT NULL DEFAULT '' PRIMARY KEY,
-FOREIGN KEY (field1) REFERENCES t1 (field1)
-ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDB;
-INSERT INTO t1 VALUES ('old', 'somevalu');
-INSERT INTO t1 VALUES ('other', 'anyvalue');
-INSERT INTO t2 VALUES ('old');
-INSERT INTO t2 VALUES ('other');
-UPDATE t1 SET field1 = 'other' WHERE field2 = 'somevalu';
-ERROR 23000: Upholding foreign key constraints for table 't1', entry 'other-somevalu', key 1 would lead to a duplicate entry
-DROP TABLE t2;
-DROP TABLE t1;
-create table t1 (
-c1 bigint not null,
-c2 bigint not null,
-primary key (c1),
-unique key (c2)
-) engine=innodb;
-create table t2 (
-c1 bigint not null,
-primary key (c1)
-) engine=innodb;
-alter table t1 add constraint c2_fk foreign key (c2)
-references t2(c1) on delete cascade;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` bigint(20) NOT NULL,
- `c2` bigint(20) NOT NULL,
- PRIMARY KEY (`c1`),
- UNIQUE KEY `c2` (`c2`),
- CONSTRAINT `c2_fk` FOREIGN KEY (`c2`) REFERENCES `t2` (`c1`) ON DELETE CASCADE
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t1 drop foreign key c2_fk;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` bigint(20) NOT NULL,
- `c2` bigint(20) NOT NULL,
- PRIMARY KEY (`c1`),
- UNIQUE KEY `c2` (`c2`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1, t2;
-create table t1(a date) engine=innodb;
-create table t2(a date, key(a)) engine=innodb;
-insert into t1 values('2005-10-01');
-insert into t2 values('2005-10-01');
-select * from t1, t2
-where t2.a between t1.a - interval 2 day and t1.a + interval 2 day;
-a a
-2005-10-01 2005-10-01
-drop table t1, t2;
-create table t1 (id int not null, f_id int not null, f int not null,
-primary key(f_id, id)) engine=innodb;
-create table t2 (id int not null,s_id int not null,s varchar(200),
-primary key(id)) engine=innodb;
-INSERT INTO t1 VALUES (8, 1, 3);
-INSERT INTO t1 VALUES (1, 2, 1);
-INSERT INTO t2 VALUES (1, 0, '');
-INSERT INTO t2 VALUES (8, 1, '');
-commit;
-DELETE ml.* FROM t1 AS ml LEFT JOIN t2 AS mm ON (mm.id=ml.id)
-WHERE mm.id IS NULL;
-select ml.* from t1 as ml left join t2 as mm on (mm.id=ml.id)
-where mm.id is null lock in share mode;
-id f_id f
-drop table t1,t2;
-create table t1(a int not null, b int, primary key(a)) engine=innodb;
-insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3);
-commit;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-update t1 set b = 5 where b = 1;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-select * from t1 where a = 7 and b = 3 for update;
-a b
-7 3
-commit;
-commit;
-drop table t1;
-create table t1(a int not null, b int, primary key(a)) engine=innodb;
-insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2);
-commit;
-set autocommit = 0;
-select * from t1 lock in share mode;
-a b
-1 1
-2 2
-3 1
-4 2
-5 1
-6 2
-update t1 set b = 5 where b = 1;
-set autocommit = 0;
-select * from t1 where a = 2 and b = 2 for update;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-commit;
-commit;
-drop table t1;
-create table t1(a int not null, b int, primary key(a)) engine=innodb;
-insert into t1 values (1,2),(5,3),(4,2);
-create table t2(d int not null, e int, primary key(d)) engine=innodb;
-insert into t2 values (8,6),(12,1),(3,1);
-commit;
-set autocommit = 0;
-select * from t2 for update;
-d e
-3 1
-8 6
-12 1
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-insert into t1 select * from t2;
-update t1 set b = (select e from t2 where a = d);
-create table t3(d int not null, e int, primary key(d)) engine=innodb
-select * from t2;
-commit;
-commit;
-drop table t1, t2, t3;
-create table t1(a int not null, b int, primary key(a)) engine=innodb;
-insert into t1 values (1,2),(5,3),(4,2);
-create table t2(a int not null, b int, primary key(a)) engine=innodb;
-insert into t2 values (8,6),(12,1),(3,1);
-create table t3(d int not null, b int, primary key(d)) engine=innodb;
-insert into t3 values (8,6),(12,1),(3,1);
-create table t5(a int not null, b int, primary key(a)) engine=innodb;
-insert into t5 values (1,2),(5,3),(4,2);
-create table t6(d int not null, e int, primary key(d)) engine=innodb;
-insert into t6 values (8,6),(12,1),(3,1);
-create table t8(a int not null, b int, primary key(a)) engine=innodb;
-insert into t8 values (1,2),(5,3),(4,2);
-create table t9(d int not null, e int, primary key(d)) engine=innodb;
-insert into t9 values (8,6),(12,1),(3,1);
-commit;
-set autocommit = 0;
-select * from t2 for update;
-a b
-3 1
-8 6
-12 1
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
-insert into t1 select * from t2;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
-update t3 set b = (select b from t2 where a = d);
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
-create table t4(a int not null, b int, primary key(a)) engine=innodb select * from t2;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-insert into t5 (select * from t2 lock in share mode);
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-update t6 set e = (select b from t2 where a = d lock in share mode);
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-create table t7(a int not null, b int, primary key(a)) engine=innodb select * from t2 lock in share mode;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-insert into t8 (select * from t2 for update);
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-update t9 set e = (select b from t2 where a = d for update);
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-create table t10(a int not null, b int, primary key(a)) engine=innodb select * from t2 for update;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-commit;
-drop table t1, t2, t3, t5, t6, t8, t9;
-CREATE TABLE t1 (DB_ROW_ID int) engine=innodb;
-ERROR HY000: Can't create table 'test.t1' (errno: -1)
-CREATE TABLE t1 (
-a BIGINT(20) NOT NULL,
-PRIMARY KEY (a)
-) ENGINE=INNODB DEFAULT CHARSET=UTF8;
-CREATE TABLE t2 (
-a BIGINT(20) NOT NULL,
-b VARCHAR(128) NOT NULL,
-c TEXT NOT NULL,
-PRIMARY KEY (a,b),
-KEY idx_t2_b_c (b,c(200)),
-CONSTRAINT t_fk FOREIGN KEY (a) REFERENCES t1 (a)
-ON DELETE CASCADE
-) ENGINE=INNODB DEFAULT CHARSET=UTF8;
-INSERT INTO t1 VALUES (1);
-INSERT INTO t2 VALUES (1, 'bar', 'vbar');
-INSERT INTO t2 VALUES (1, 'BAR2', 'VBAR');
-INSERT INTO t2 VALUES (1, 'bar_bar', 'bibi');
-INSERT INTO t2 VALUES (1, 'customer_over', '1');
-SELECT * FROM t2 WHERE b = 'customer_over';
-a b c
-1 customer_over 1
-SELECT * FROM t2 WHERE BINARY b = 'customer_over';
-a b c
-1 customer_over 1
-SELECT DISTINCT p0.a FROM t2 p0 WHERE p0.b = 'customer_over';
-a
-1
-/* Bang: Empty result set, above was expected: */
-SELECT DISTINCT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over';
-a
-1
-SELECT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over';
-a
-1
-drop table t2, t1;
-CREATE TABLE t1 ( a int ) ENGINE=innodb;
-BEGIN;
-INSERT INTO t1 VALUES (1);
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
-test.t1 optimize status OK
-DROP TABLE t1;
-CREATE TABLE t1 (id int PRIMARY KEY, f int NOT NULL, INDEX(f)) ENGINE=InnoDB;
-CREATE TABLE t2 (id int PRIMARY KEY, f INT NOT NULL,
-CONSTRAINT t2_t1 FOREIGN KEY (id) REFERENCES t1 (id)
-ON DELETE CASCADE ON UPDATE CASCADE) ENGINE=InnoDB;
-ALTER TABLE t2 ADD FOREIGN KEY (f) REFERENCES t1 (f) ON
-DELETE CASCADE ON UPDATE CASCADE;
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `id` int(11) NOT NULL,
- `f` int(11) NOT NULL,
- PRIMARY KEY (`id`),
- KEY `f` (`f`),
- CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f`) REFERENCES `t1` (`f`) ON DELETE CASCADE ON UPDATE CASCADE,
- CONSTRAINT `t2_t1` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-DROP TABLE t2, t1;
-CREATE TABLE t1 (a INT, INDEX(a)) ENGINE=InnoDB;
-CREATE TABLE t2 (a INT, INDEX(a)) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1);
-INSERT INTO t2 VALUES (1);
-ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1 (a) ON DELETE SET NULL;
-ALTER TABLE t2 MODIFY a INT NOT NULL;
-ERROR HY000: Error on rename of '#sql-temporary' to './test/t2' (errno: 150)
-DELETE FROM t1;
-DROP TABLE t2,t1;
-CREATE TABLE t1 (a VARCHAR(5) COLLATE utf8_unicode_ci PRIMARY KEY)
-ENGINE=InnoDB;
-INSERT INTO t1 VALUES (0xEFBCA4EFBCA4EFBCA4);
-DELETE FROM t1;
-INSERT INTO t1 VALUES ('DDD');
-SELECT * FROM t1;
-a
-DDD
-DROP TABLE t1;
-CREATE TABLE t1 (id int PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB
-AUTO_INCREMENT=42;
-INSERT INTO t1 VALUES (0),(347),(0);
-SELECT * FROM t1;
-id
-42
-347
-348
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=349 DEFAULT CHARSET=latin1
-CREATE TABLE t2 (id int PRIMARY KEY) ENGINE=InnoDB;
-INSERT INTO t2 VALUES(42),(347),(348);
-ALTER TABLE t1 ADD CONSTRAINT t1_t2 FOREIGN KEY (id) REFERENCES t2(id);
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`id`),
- CONSTRAINT `t1_t2` FOREIGN KEY (`id`) REFERENCES `t2` (`id`)
-) ENGINE=InnoDB AUTO_INCREMENT=349 DEFAULT CHARSET=latin1
-DROP TABLE t1,t2;
-CREATE TABLE t1 (
-c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255),
-c05 CHAR(255), c06 CHAR(255), c07 CHAR(255), c08 CHAR(255),
-c09 CHAR(255), c10 CHAR(255), c11 CHAR(255), c12 CHAR(255),
-c13 CHAR(255), c14 CHAR(255), c15 CHAR(255), c16 CHAR(255),
-c17 CHAR(255), c18 CHAR(255), c19 CHAR(255), c20 CHAR(255),
-c21 CHAR(255), c22 CHAR(255), c23 CHAR(255), c24 CHAR(255),
-c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255),
-c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255)
-) ENGINE = InnoDB;
-ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
-DROP TABLE IF EXISTS t1;
-Warnings:
-Note 1051 Unknown table 't1'
-CREATE TABLE t1(
-id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY
-) ENGINE=InnoDB;
-INSERT INTO t1 VALUES(-10);
-SELECT * FROM t1;
-id
--10
-INSERT INTO t1 VALUES(NULL);
-SELECT * FROM t1;
-id
--10
-1
-DROP TABLE t1;
-SET binlog_format='MIXED';
-SET TX_ISOLATION='read-committed';
-SET AUTOCOMMIT=0;
-DROP TABLE IF EXISTS t1, t2;
-Warnings:
-Note 1051 Unknown table 't1'
-Note 1051 Unknown table 't2'
-CREATE TABLE t1 ( a int ) ENGINE=InnoDB;
-CREATE TABLE t2 LIKE t1;
-SELECT * FROM t2;
-a
-SET binlog_format='MIXED';
-SET TX_ISOLATION='read-committed';
-SET AUTOCOMMIT=0;
-INSERT INTO t1 VALUES (1);
-COMMIT;
-SELECT * FROM t1 WHERE a=1;
-a
-1
-SET binlog_format='MIXED';
-SET TX_ISOLATION='read-committed';
-SET AUTOCOMMIT=0;
-SELECT * FROM t2;
-a
-SET binlog_format='MIXED';
-SET TX_ISOLATION='read-committed';
-SET AUTOCOMMIT=0;
-INSERT INTO t1 VALUES (2);
-COMMIT;
-SELECT * FROM t1 WHERE a=2;
-a
-2
-SELECT * FROM t1 WHERE a=2;
-a
-2
-DROP TABLE t1;
-DROP TABLE t2;
-create table t1 (i int, j int) engine=innodb;
-insert into t1 (i, j) values (1, 1), (2, 2);
-update t1 set j = 2;
-affected rows: 1
-info: Rows matched: 2 Changed: 1 Warnings: 0
-drop table t1;
-create table t1 (id int) comment='this is a comment' engine=innodb;
-select table_comment, data_free > 0 as data_free_is_set
-from information_schema.tables
-where table_schema='test' and table_name = 't1';
-table_comment data_free_is_set
-this is a comment 1
-drop table t1;
-CREATE TABLE t1 (
-c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
-c2 VARCHAR(128) NOT NULL,
-PRIMARY KEY(c1)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=100;
-CREATE TABLE t2 (
-c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
-c2 INT(10) UNSIGNED DEFAULT NULL,
-PRIMARY KEY(c1)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=200;
-SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2';
-AUTO_INCREMENT
-200
-ALTER TABLE t2 ADD CONSTRAINT t1_t2_1 FOREIGN KEY(c1) REFERENCES t1(c1);
-SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2';
-AUTO_INCREMENT
-200
-DROP TABLE t2;
-DROP TABLE t1;
-CREATE TABLE t1 (c1 int default NULL,
-c2 int default NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-TRUNCATE TABLE t1;
-affected rows: 0
-INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
-affected rows: 5
-info: Records: 5 Duplicates: 0 Warnings: 0
-TRUNCATE TABLE t1;
-affected rows: 0
-DROP TABLE t1;
-Variable_name Value
-Handler_update 0
-Variable_name Value
-Handler_delete 0
-Variable_name Value
-Handler_update 1
-Variable_name Value
-Handler_delete 1
diff --git a/mysql-test/r/innodb_bug21704.result b/mysql-test/suite/innodb/r/innodb_bug21704.result
index ffbfa8a337e..ffbfa8a337e 100644
--- a/mysql-test/r/innodb_bug21704.result
+++ b/mysql-test/suite/innodb/r/innodb_bug21704.result
diff --git a/mysql-test/r/innodb_bug34053.result b/mysql-test/suite/innodb/r/innodb_bug34053.result
index 195775f74c8..195775f74c8 100644
--- a/mysql-test/r/innodb_bug34053.result
+++ b/mysql-test/suite/innodb/r/innodb_bug34053.result
diff --git a/mysql-test/r/innodb_bug34300.result b/mysql-test/suite/innodb/r/innodb_bug34300.result
index 03ae355de7b..03ae355de7b 100644
--- a/mysql-test/r/innodb_bug34300.result
+++ b/mysql-test/suite/innodb/r/innodb_bug34300.result
diff --git a/mysql-test/r/innodb_bug35220.result b/mysql-test/suite/innodb/r/innodb_bug35220.result
index 195775f74c8..195775f74c8 100644
--- a/mysql-test/r/innodb_bug35220.result
+++ b/mysql-test/suite/innodb/r/innodb_bug35220.result
diff --git a/mysql-test/r/innodb_bug38231.result b/mysql-test/suite/innodb/r/innodb_bug38231.result
index 2f909779755..2f909779755 100644
--- a/mysql-test/r/innodb_bug38231.result
+++ b/mysql-test/suite/innodb/r/innodb_bug38231.result
diff --git a/mysql-test/r/innodb_bug39438.result b/mysql-test/suite/innodb/r/innodb_bug39438.result
index 195775f74c8..195775f74c8 100644
--- a/mysql-test/r/innodb_bug39438.result
+++ b/mysql-test/suite/innodb/r/innodb_bug39438.result
diff --git a/mysql-test/r/innodb_bug40565.result b/mysql-test/suite/innodb/r/innodb_bug40565.result
index 21e923d9336..21e923d9336 100644
--- a/mysql-test/r/innodb_bug40565.result
+++ b/mysql-test/suite/innodb/r/innodb_bug40565.result
diff --git a/mysql-test/r/innodb_bug42101-nonzero.result b/mysql-test/suite/innodb/r/innodb_bug42101-nonzero.result
index 277dfffdd35..277dfffdd35 100644
--- a/mysql-test/r/innodb_bug42101-nonzero.result
+++ b/mysql-test/suite/innodb/r/innodb_bug42101-nonzero.result
diff --git a/mysql-test/r/innodb_bug42101.result b/mysql-test/suite/innodb/r/innodb_bug42101.result
index 805097ffe9d..805097ffe9d 100644
--- a/mysql-test/r/innodb_bug42101.result
+++ b/mysql-test/suite/innodb/r/innodb_bug42101.result
diff --git a/mysql-test/r/innodb_bug44369.result b/mysql-test/suite/innodb/r/innodb_bug44369.result
index 9cf79aeffab..9cf79aeffab 100644
--- a/mysql-test/r/innodb_bug44369.result
+++ b/mysql-test/suite/innodb/r/innodb_bug44369.result
diff --git a/mysql-test/r/innodb_bug45357.result b/mysql-test/suite/innodb/r/innodb_bug45357.result
index 7adeff2062f..7adeff2062f 100644
--- a/mysql-test/r/innodb_bug45357.result
+++ b/mysql-test/suite/innodb/r/innodb_bug45357.result
diff --git a/mysql-test/r/innodb_bug46000.result b/mysql-test/suite/innodb/r/innodb_bug46000.result
index ccf7cc56859..ccf7cc56859 100644
--- a/mysql-test/r/innodb_bug46000.result
+++ b/mysql-test/suite/innodb/r/innodb_bug46000.result
diff --git a/mysql-test/r/innodb_bug47621.result b/mysql-test/suite/innodb/r/innodb_bug47621.result
index c5f56c09788..c5f56c09788 100644
--- a/mysql-test/r/innodb_bug47621.result
+++ b/mysql-test/suite/innodb/r/innodb_bug47621.result
diff --git a/mysql-test/r/innodb_bug47777.result b/mysql-test/suite/innodb/r/innodb_bug47777.result
index fbba47edcfc..fbba47edcfc 100644
--- a/mysql-test/r/innodb_bug47777.result
+++ b/mysql-test/suite/innodb/r/innodb_bug47777.result
diff --git a/mysql-test/suite/innodb/r/innodb_bug51920.result b/mysql-test/suite/innodb/r/innodb_bug51920.result
new file mode 100644
index 00000000000..7ded141c239
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug51920.result
@@ -0,0 +1,13 @@
+CREATE TABLE bug51920 (i INT) ENGINE=InnoDB;
+INSERT INTO bug51920 VALUES (1);
+BEGIN;
+SELECT * FROM bug51920 FOR UPDATE;
+i
+1
+UPDATE bug51920 SET i=2;
+SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST
+WHERE INFO="UPDATE bug51920 SET i=2"
+INTO @thread_id;
+KILL @thread_id;
+Got one of the listed errors
+DROP TABLE bug51920;
diff --git a/mysql-test/suite/innodb/r/innodb_bug52663.result b/mysql-test/suite/innodb/r/innodb_bug52663.result
new file mode 100644
index 00000000000..89add18617b
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_bug52663.result
@@ -0,0 +1,26 @@
+set session transaction isolation level read committed;
+create table innodb_bug52663 (what varchar(5), id integer, count integer, primary key
+(what, id)) engine=innodb;
+insert into innodb_bug52663 values ('total', 0, 0);
+begin;
+set session transaction isolation level read committed;
+begin;
+update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0;
+select * from innodb_bug52663;
+what id count
+total 0 1
+update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+select * from innodb_bug52663;
+what id count
+total 0 0
+commit;
+update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0;
+commit;
+select * from innodb_bug52663;
+what id count
+total 0 2
+select * from innodb_bug52663;
+what id count
+total 0 2
+drop table innodb_bug52663;
diff --git a/mysql-test/suite/innodb/r/innodb_file_format.result b/mysql-test/suite/innodb/r/innodb_file_format.result
deleted file mode 100644
index 36f176c616a..00000000000
--- a/mysql-test/suite/innodb/r/innodb_file_format.result
+++ /dev/null
@@ -1,43 +0,0 @@
-call mtr.add_suppression("InnoDB: invalid innodb_file_format_check value");
-select @@innodb_file_format;
-@@innodb_file_format
-Antelope
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Antelope
-set global innodb_file_format=antelope;
-set global innodb_file_format=barracuda;
-set global innodb_file_format=cheetah;
-ERROR HY000: Incorrect arguments to SET
-select @@innodb_file_format;
-@@innodb_file_format
-Barracuda
-set global innodb_file_format=default;
-select @@innodb_file_format;
-@@innodb_file_format
-Antelope
-set global innodb_file_format=on;
-ERROR HY000: Incorrect arguments to SET
-set global innodb_file_format=off;
-ERROR HY000: Incorrect arguments to SET
-select @@innodb_file_format;
-@@innodb_file_format
-Antelope
-set global innodb_file_format_check=antelope;
-set global innodb_file_format_check=barracuda;
-set global innodb_file_format_check=cheetah;
-ERROR HY000: Incorrect arguments to SET
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Barracuda
-set global innodb_file_format_check=default;
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Barracuda
-set global innodb_file_format=on;
-ERROR HY000: Incorrect arguments to SET
-set global innodb_file_format=off;
-ERROR HY000: Incorrect arguments to SET
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Barracuda
diff --git a/mysql-test/suite/innodb/r/innodb_misc1.result b/mysql-test/suite/innodb/r/innodb_misc1.result
new file mode 100644
index 00000000000..ce50e0ae6b2
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_misc1.result
@@ -0,0 +1,880 @@
+drop table if exists t1,t2,t3,t4;
+drop database if exists mysqltest;
+create table t1 (v varchar(16384)) engine=innodb;
+drop table t1;
+create table t1 (a char(1), b char(1), key(a, b)) engine=innodb;
+insert into t1 values ('8', '6'), ('4', '7');
+select min(a) from t1;
+min(a)
+4
+select min(b) from t1 where a='8';
+min(b)
+6
+drop table t1;
+CREATE TABLE t1 ( `a` int(11) NOT NULL auto_increment, `b` int(11) default NULL,PRIMARY KEY (`a`),UNIQUE KEY `b` (`b`)) ENGINE=innodb;
+insert into t1 (b) values (1);
+replace into t1 (b) values (2), (1), (3);
+select * from t1;
+a b
+3 1
+2 2
+4 3
+truncate table t1;
+insert into t1 (b) values (1);
+replace into t1 (b) values (2);
+replace into t1 (b) values (1);
+replace into t1 (b) values (3);
+select * from t1;
+a b
+3 1
+2 2
+4 3
+drop table t1;
+create table t1 (rowid int not null auto_increment, val int not null,primary
+key (rowid), unique(val)) engine=innodb;
+replace into t1 (val) values ('1'),('2');
+replace into t1 (val) values ('1'),('2');
+insert into t1 (val) values ('1'),('2');
+ERROR 23000: Duplicate entry '1' for key 'val'
+select * from t1;
+rowid val
+3 1
+4 2
+drop table t1;
+create table t1 (a int not null auto_increment primary key, val int) engine=InnoDB;
+insert into t1 (val) values (1);
+update t1 set a=2 where a=1;
+insert into t1 (val) values (1);
+ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
+select * from t1;
+a val
+2 1
+drop table t1;
+CREATE TABLE t1 (GRADE DECIMAL(4) NOT NULL, PRIMARY KEY (GRADE)) ENGINE=INNODB;
+INSERT INTO t1 (GRADE) VALUES (151),(252),(343);
+SELECT GRADE FROM t1 WHERE GRADE > 160 AND GRADE < 300;
+GRADE
+252
+SELECT GRADE FROM t1 WHERE GRADE= 151;
+GRADE
+151
+DROP TABLE t1;
+create table t1 (f1 varchar(10), f2 varchar(10), primary key (f1,f2)) engine=innodb;
+create table t2 (f3 varchar(10), f4 varchar(10), key (f4)) engine=innodb;
+insert into t2 values ('aa','cc');
+insert into t1 values ('aa','bb'),('aa','cc');
+delete t1 from t1,t2 where f1=f3 and f4='cc';
+select * from t1;
+f1 f2
+drop table t1,t2;
+CREATE TABLE t1 (
+id INTEGER NOT NULL AUTO_INCREMENT, PRIMARY KEY (id)
+) ENGINE=InnoDB;
+CREATE TABLE t2 (
+id INTEGER NOT NULL,
+FOREIGN KEY (id) REFERENCES t1 (id)
+) ENGINE=InnoDB;
+INSERT INTO t1 (id) VALUES (NULL);
+SELECT * FROM t1;
+id
+1
+TRUNCATE t1;
+INSERT INTO t1 (id) VALUES (NULL);
+SELECT * FROM t1;
+id
+1
+DELETE FROM t1;
+TRUNCATE t1;
+INSERT INTO t1 (id) VALUES (NULL);
+SELECT * FROM t1;
+id
+1
+DROP TABLE t2, t1;
+CREATE TABLE t1
+(
+id INT PRIMARY KEY
+) ENGINE=InnoDB;
+CREATE TEMPORARY TABLE t2
+(
+id INT NOT NULL PRIMARY KEY,
+b INT,
+FOREIGN KEY (b) REFERENCES test.t1(id)
+) ENGINE=InnoDB;
+Got one of the listed errors
+DROP TABLE t1;
+create table t1 (col1 varchar(2000), index (col1(767)))
+character set = latin1 engine = innodb;
+create table t2 (col1 char(255), index (col1))
+character set = latin1 engine = innodb;
+create table t3 (col1 binary(255), index (col1))
+character set = latin1 engine = innodb;
+create table t4 (col1 varchar(767), index (col1))
+character set = latin1 engine = innodb;
+create table t5 (col1 varchar(767) primary key)
+character set = latin1 engine = innodb;
+create table t6 (col1 varbinary(767) primary key)
+character set = latin1 engine = innodb;
+create table t7 (col1 text, index(col1(767)))
+character set = latin1 engine = innodb;
+create table t8 (col1 blob, index(col1(767)))
+character set = latin1 engine = innodb;
+create table t9 (col1 varchar(512), col2 varchar(512), index(col1, col2))
+character set = latin1 engine = innodb;
+show create table t9;
+Table Create Table
+t9 CREATE TABLE `t9` (
+ `col1` varchar(512) DEFAULT NULL,
+ `col2` varchar(512) DEFAULT NULL,
+ KEY `col1` (`col1`,`col2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t1, t2, t3, t4, t5, t6, t7, t8, t9;
+create table t1 (col1 varchar(768), index(col1))
+character set = latin1 engine = innodb;
+Warnings:
+Warning 1071 Specified key was too long; max key length is 767 bytes
+create table t2 (col1 varbinary(768), index(col1))
+character set = latin1 engine = innodb;
+Warnings:
+Warning 1071 Specified key was too long; max key length is 767 bytes
+create table t3 (col1 text, index(col1(768)))
+character set = latin1 engine = innodb;
+Warnings:
+Warning 1071 Specified key was too long; max key length is 767 bytes
+create table t4 (col1 blob, index(col1(768)))
+character set = latin1 engine = innodb;
+Warnings:
+Warning 1071 Specified key was too long; max key length is 767 bytes
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `col1` varchar(768) DEFAULT NULL,
+ KEY `col1` (`col1`(767))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t1, t2, t3, t4;
+create table t1 (col1 varchar(768) primary key)
+character set = latin1 engine = innodb;
+ERROR 42000: Specified key was too long; max key length is 767 bytes
+create table t2 (col1 varbinary(768) primary key)
+character set = latin1 engine = innodb;
+ERROR 42000: Specified key was too long; max key length is 767 bytes
+create table t3 (col1 text, primary key(col1(768)))
+character set = latin1 engine = innodb;
+ERROR 42000: Specified key was too long; max key length is 767 bytes
+create table t4 (col1 blob, primary key(col1(768)))
+character set = latin1 engine = innodb;
+ERROR 42000: Specified key was too long; max key length is 767 bytes
+CREATE TABLE t1
+(
+id INT PRIMARY KEY
+) ENGINE=InnoDB;
+CREATE TABLE t2
+(
+v INT,
+CONSTRAINT c1 FOREIGN KEY (v) REFERENCES t1(id)
+) ENGINE=InnoDB;
+INSERT INTO t2 VALUES(2);
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`))
+INSERT INTO t1 VALUES(1);
+INSERT INTO t2 VALUES(1);
+DELETE FROM t1 WHERE id = 1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`))
+DROP TABLE t1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
+SET FOREIGN_KEY_CHECKS=0;
+DROP TABLE t1;
+SET FOREIGN_KEY_CHECKS=1;
+INSERT INTO t2 VALUES(3);
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`))
+DROP TABLE t2;
+create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
+insert into t1 values (1),(2);
+set autocommit=0;
+checksum table t1;
+Table Checksum
+test.t1 1531596814
+insert into t1 values(3);
+checksum table t1;
+Table Checksum
+test.t1 1531596814
+commit;
+checksum table t1;
+Table Checksum
+test.t1 2050879373
+commit;
+drop table t1;
+create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
+insert into t1 values (1),(2);
+set autocommit=1;
+checksum table t1;
+Table Checksum
+test.t1 1531596814
+set autocommit=1;
+insert into t1 values(3);
+checksum table t1;
+Table Checksum
+test.t1 2050879373
+drop table t1;
+set foreign_key_checks=0;
+create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb;
+create table t1(a char(10) primary key, b varchar(20)) engine = innodb;
+ERROR HY000: Can't create table 'test.t1' (errno: 150)
+set foreign_key_checks=1;
+drop table t2;
+set foreign_key_checks=0;
+create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1;
+create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=utf8;
+ERROR HY000: Can't create table 'test.t2' (errno: 150)
+set foreign_key_checks=1;
+drop table t1;
+set foreign_key_checks=0;
+create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb;
+create table t1(a varchar(10) primary key) engine = innodb;
+alter table t1 modify column a int;
+Got one of the listed errors
+set foreign_key_checks=1;
+drop table t2,t1;
+set foreign_key_checks=0;
+create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1;
+create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1;
+alter table t1 convert to character set utf8;
+set foreign_key_checks=1;
+drop table t2,t1;
+set foreign_key_checks=0;
+create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1;
+create table t3(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=utf8;
+rename table t3 to t1;
+ERROR HY000: Error on rename of './test/t3' to './test/t1' (errno: 150)
+set foreign_key_checks=1;
+drop table t2,t3;
+create table t1(a int primary key) row_format=redundant engine=innodb;
+create table t2(a int primary key,constraint foreign key(a)references t1(a)) row_format=compact engine=innodb;
+create table t3(a int primary key) row_format=compact engine=innodb;
+create table t4(a int primary key,constraint foreign key(a)references t3(a)) row_format=redundant engine=innodb;
+insert into t1 values(1);
+insert into t3 values(1);
+insert into t2 values(2);
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`))
+insert into t4 values(2);
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t4`, CONSTRAINT `t4_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t3` (`a`))
+insert into t2 values(1);
+insert into t4 values(1);
+update t1 set a=2;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`))
+update t2 set a=2;
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`))
+update t3 set a=2;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t4`, CONSTRAINT `t4_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t3` (`a`))
+update t4 set a=2;
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t4`, CONSTRAINT `t4_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t3` (`a`))
+truncate t1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t1` (`a`))
+truncate t3;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t4`, CONSTRAINT `t4_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t3` (`a`))
+truncate t2;
+truncate t4;
+truncate t1;
+truncate t3;
+drop table t4,t3,t2,t1;
+create table t1 (a varchar(255) character set utf8,
+b varchar(255) character set utf8,
+c varchar(255) character set utf8,
+d varchar(255) character set utf8,
+key (a,b,c,d)) engine=innodb;
+drop table t1;
+create table t1 (a varchar(255) character set utf8,
+b varchar(255) character set utf8,
+c varchar(255) character set utf8,
+d varchar(255) character set utf8,
+e varchar(255) character set utf8,
+key (a,b,c,d,e)) engine=innodb;
+ERROR 42000: Specified key was too long; max key length is 3072 bytes
+create table t1 (s1 varbinary(2),primary key (s1)) engine=innodb;
+create table t2 (s1 binary(2),primary key (s1)) engine=innodb;
+create table t3 (s1 varchar(2) binary,primary key (s1)) engine=innodb;
+create table t4 (s1 char(2) binary,primary key (s1)) engine=innodb;
+insert into t1 values (0x41),(0x4120),(0x4100);
+insert into t2 values (0x41),(0x4120),(0x4100);
+ERROR 23000: Duplicate entry 'A' for key 'PRIMARY'
+insert into t2 values (0x41),(0x4120);
+insert into t3 values (0x41),(0x4120),(0x4100);
+ERROR 23000: Duplicate entry 'A ' for key 'PRIMARY'
+insert into t3 values (0x41),(0x4100);
+insert into t4 values (0x41),(0x4120),(0x4100);
+ERROR 23000: Duplicate entry 'A' for key 'PRIMARY'
+insert into t4 values (0x41),(0x4100);
+select hex(s1) from t1;
+hex(s1)
+41
+4100
+4120
+select hex(s1) from t2;
+hex(s1)
+4100
+4120
+select hex(s1) from t3;
+hex(s1)
+4100
+41
+select hex(s1) from t4;
+hex(s1)
+4100
+41
+drop table t1,t2,t3,t4;
+create table t1 (a int primary key,s1 varbinary(3) not null unique) engine=innodb;
+create table t2 (s1 binary(2) not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=innodb;
+insert into t1 values(1,0x4100),(2,0x41),(3,0x4120),(4,0x42);
+insert into t2 values(0x42);
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE)
+insert into t2 values(0x41);
+select hex(s1) from t2;
+hex(s1)
+4100
+update t1 set s1=0x123456 where a=2;
+select hex(s1) from t2;
+hex(s1)
+4100
+update t1 set s1=0x12 where a=1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE)
+update t1 set s1=0x12345678 where a=1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE)
+update t1 set s1=0x123457 where a=1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE)
+update t1 set s1=0x1220 where a=1;
+select hex(s1) from t2;
+hex(s1)
+1220
+update t1 set s1=0x1200 where a=1;
+select hex(s1) from t2;
+hex(s1)
+1200
+update t1 set s1=0x4200 where a=1;
+select hex(s1) from t2;
+hex(s1)
+4200
+delete from t1 where a=1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE)
+delete from t1 where a=2;
+update t2 set s1=0x4120;
+delete from t1;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE)
+delete from t1 where a!=3;
+select a,hex(s1) from t1;
+a hex(s1)
+3 4120
+select hex(s1) from t2;
+hex(s1)
+4120
+drop table t2,t1;
+create table t1 (a int primary key,s1 varchar(2) binary not null unique) engine=innodb;
+create table t2 (s1 char(2) binary not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=innodb;
+insert into t1 values(1,0x4100),(2,0x41);
+insert into t2 values(0x41);
+select hex(s1) from t2;
+hex(s1)
+41
+update t1 set s1=0x1234 where a=1;
+select hex(s1) from t2;
+hex(s1)
+41
+update t1 set s1=0x12 where a=2;
+select hex(s1) from t2;
+hex(s1)
+12
+delete from t1 where a=1;
+delete from t1 where a=2;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c` FOREIGN KEY (`s1`) REFERENCES `t1` (`s1`) ON UPDATE CASCADE)
+select a,hex(s1) from t1;
+a hex(s1)
+2 12
+select hex(s1) from t2;
+hex(s1)
+12
+drop table t2,t1;
+CREATE TABLE t1(a INT, PRIMARY KEY(a)) ENGINE=InnoDB;
+CREATE TABLE t2(a INT) ENGINE=InnoDB;
+ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1(a);
+ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_1;
+ALTER TABLE t2 ADD CONSTRAINT t2_ibfk_0 FOREIGN KEY (a) REFERENCES t1(a);
+ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_0;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ KEY `t2_ibfk_0` (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t2,t1;
+create table t1(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
+insert into t1(a) values (1),(2),(3);
+commit;
+set autocommit = 0;
+update t1 set b = 5 where a = 2;
+create trigger t1t before insert on t1 for each row begin set NEW.b = NEW.a * 10 + 5, NEW.c = NEW.a / 10; end |
+set autocommit = 0;
+insert into t1(a) values (10),(20),(30),(40),(50),(60),(70),(80),(90),(100),
+(11),(21),(31),(41),(51),(61),(71),(81),(91),(101),
+(12),(22),(32),(42),(52),(62),(72),(82),(92),(102),
+(13),(23),(33),(43),(53),(63),(73),(83),(93),(103),
+(14),(24),(34),(44),(54),(64),(74),(84),(94),(104);
+commit;
+commit;
+drop trigger t1t;
+drop table t1;
+create table t1(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
+create table t2(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
+create table t3(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
+create table t4(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
+create table t5(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
+insert into t1(a) values (1),(2),(3);
+insert into t2(a) values (1),(2),(3);
+insert into t3(a) values (1),(2),(3);
+insert into t4(a) values (1),(2),(3);
+insert into t3(a) values (5),(7),(8);
+insert into t4(a) values (5),(7),(8);
+insert into t5(a) values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12);
+create trigger t1t before insert on t1 for each row begin
+INSERT INTO t2 SET a = NEW.a;
+end |
+create trigger t2t before insert on t2 for each row begin
+DELETE FROM t3 WHERE a = NEW.a;
+end |
+create trigger t3t before delete on t3 for each row begin
+UPDATE t4 SET b = b + 1 WHERE a = OLD.a;
+end |
+create trigger t4t before update on t4 for each row begin
+UPDATE t5 SET b = b + 1 where a = NEW.a;
+end |
+commit;
+set autocommit = 0;
+update t1 set b = b + 5 where a = 1;
+update t2 set b = b + 5 where a = 1;
+update t3 set b = b + 5 where a = 1;
+update t4 set b = b + 5 where a = 1;
+insert into t5(a) values(20);
+set autocommit = 0;
+insert into t1(a) values(7);
+insert into t2(a) values(8);
+delete from t2 where a = 3;
+update t4 set b = b + 1 where a = 3;
+commit;
+drop trigger t1t;
+drop trigger t2t;
+drop trigger t3t;
+drop trigger t4t;
+drop table t1, t2, t3, t4, t5;
+CREATE TABLE t1 (
+field1 varchar(8) NOT NULL DEFAULT '',
+field2 varchar(8) NOT NULL DEFAULT '',
+PRIMARY KEY (field1, field2)
+) ENGINE=InnoDB;
+CREATE TABLE t2 (
+field1 varchar(8) NOT NULL DEFAULT '' PRIMARY KEY,
+FOREIGN KEY (field1) REFERENCES t1 (field1)
+ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES ('old', 'somevalu');
+INSERT INTO t1 VALUES ('other', 'anyvalue');
+INSERT INTO t2 VALUES ('old');
+INSERT INTO t2 VALUES ('other');
+UPDATE t1 SET field1 = 'other' WHERE field2 = 'somevalu';
+ERROR 23000: Upholding foreign key constraints for table 't1', entry 'other-somevalu', key 1 would lead to a duplicate entry
+DROP TABLE t2;
+DROP TABLE t1;
+create table t1 (
+c1 bigint not null,
+c2 bigint not null,
+primary key (c1),
+unique key (c2)
+) engine=innodb;
+create table t2 (
+c1 bigint not null,
+primary key (c1)
+) engine=innodb;
+alter table t1 add constraint c2_fk foreign key (c2)
+references t2(c1) on delete cascade;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` bigint(20) NOT NULL,
+ `c2` bigint(20) NOT NULL,
+ PRIMARY KEY (`c1`),
+ UNIQUE KEY `c2` (`c2`),
+ CONSTRAINT `c2_fk` FOREIGN KEY (`c2`) REFERENCES `t2` (`c1`) ON DELETE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+alter table t1 drop foreign key c2_fk;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` bigint(20) NOT NULL,
+ `c2` bigint(20) NOT NULL,
+ PRIMARY KEY (`c1`),
+ UNIQUE KEY `c2` (`c2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t1, t2;
+create table t1(a date) engine=innodb;
+create table t2(a date, key(a)) engine=innodb;
+insert into t1 values('2005-10-01');
+insert into t2 values('2005-10-01');
+select * from t1, t2
+where t2.a between t1.a - interval 2 day and t1.a + interval 2 day;
+a a
+2005-10-01 2005-10-01
+drop table t1, t2;
+create table t1 (id int not null, f_id int not null, f int not null,
+primary key(f_id, id)) engine=innodb;
+create table t2 (id int not null,s_id int not null,s varchar(200),
+primary key(id)) engine=innodb;
+INSERT INTO t1 VALUES (8, 1, 3);
+INSERT INTO t1 VALUES (1, 2, 1);
+INSERT INTO t2 VALUES (1, 0, '');
+INSERT INTO t2 VALUES (8, 1, '');
+commit;
+DELETE ml.* FROM t1 AS ml LEFT JOIN t2 AS mm ON (mm.id=ml.id)
+WHERE mm.id IS NULL;
+select ml.* from t1 as ml left join t2 as mm on (mm.id=ml.id)
+where mm.id is null lock in share mode;
+id f_id f
+drop table t1,t2;
+create table t1(a int not null, b int, primary key(a)) engine=innodb;
+insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3);
+commit;
+SET binlog_format='MIXED';
+set autocommit = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+update t1 set b = 5 where b = 1;
+SET binlog_format='MIXED';
+set autocommit = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+select * from t1 where a = 7 and b = 3 for update;
+a b
+7 3
+commit;
+commit;
+drop table t1;
+create table t1(a int not null, b int, primary key(a)) engine=innodb;
+insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2);
+commit;
+set autocommit = 0;
+select * from t1 lock in share mode;
+a b
+1 1
+2 2
+3 1
+4 2
+5 1
+6 2
+update t1 set b = 5 where b = 1;
+set autocommit = 0;
+select * from t1 where a = 2 and b = 2 for update;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+commit;
+commit;
+drop table t1;
+create table t1(a int not null, b int, primary key(a)) engine=innodb;
+insert into t1 values (1,2),(5,3),(4,2);
+create table t2(d int not null, e int, primary key(d)) engine=innodb;
+insert into t2 values (8,6),(12,1),(3,1);
+commit;
+set autocommit = 0;
+select * from t2 for update;
+d e
+3 1
+8 6
+12 1
+SET binlog_format='MIXED';
+set autocommit = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+insert into t1 select * from t2;
+update t1 set b = (select e from t2 where a = d);
+create table t3(d int not null, e int, primary key(d)) engine=innodb
+select * from t2;
+commit;
+commit;
+drop table t1, t2, t3;
+create table t1(a int not null, b int, primary key(a)) engine=innodb;
+insert into t1 values (1,2),(5,3),(4,2);
+create table t2(a int not null, b int, primary key(a)) engine=innodb;
+insert into t2 values (8,6),(12,1),(3,1);
+create table t3(d int not null, b int, primary key(d)) engine=innodb;
+insert into t3 values (8,6),(12,1),(3,1);
+create table t5(a int not null, b int, primary key(a)) engine=innodb;
+insert into t5 values (1,2),(5,3),(4,2);
+create table t6(d int not null, e int, primary key(d)) engine=innodb;
+insert into t6 values (8,6),(12,1),(3,1);
+create table t8(a int not null, b int, primary key(a)) engine=innodb;
+insert into t8 values (1,2),(5,3),(4,2);
+create table t9(d int not null, e int, primary key(d)) engine=innodb;
+insert into t9 values (8,6),(12,1),(3,1);
+commit;
+set autocommit = 0;
+select * from t2 for update;
+a b
+3 1
+8 6
+12 1
+SET binlog_format='MIXED';
+set autocommit = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+insert into t1 select * from t2;
+SET binlog_format='MIXED';
+set autocommit = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+update t3 set b = (select b from t2 where a = d);
+SET binlog_format='MIXED';
+set autocommit = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+create table t4(a int not null, b int, primary key(a)) engine=innodb select * from t2;
+SET binlog_format='MIXED';
+set autocommit = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+insert into t5 (select * from t2 lock in share mode);
+SET binlog_format='MIXED';
+set autocommit = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+update t6 set e = (select b from t2 where a = d lock in share mode);
+SET binlog_format='MIXED';
+set autocommit = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+create table t7(a int not null, b int, primary key(a)) engine=innodb select * from t2 lock in share mode;
+SET binlog_format='MIXED';
+set autocommit = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+insert into t8 (select * from t2 for update);
+SET binlog_format='MIXED';
+set autocommit = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+update t9 set e = (select b from t2 where a = d for update);
+SET binlog_format='MIXED';
+set autocommit = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+create table t10(a int not null, b int, primary key(a)) engine=innodb select * from t2 for update;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+commit;
+drop table t1, t2, t3, t5, t6, t8, t9;
+CREATE TABLE t1 (DB_ROW_ID int) engine=innodb;
+ERROR HY000: Can't create table 'test.t1' (errno: -1)
+CREATE TABLE t1 (
+a BIGINT(20) NOT NULL,
+PRIMARY KEY (a)
+) ENGINE=INNODB DEFAULT CHARSET=UTF8;
+CREATE TABLE t2 (
+a BIGINT(20) NOT NULL,
+b VARCHAR(128) NOT NULL,
+c TEXT NOT NULL,
+PRIMARY KEY (a,b),
+KEY idx_t2_b_c (b,c(200)),
+CONSTRAINT t_fk FOREIGN KEY (a) REFERENCES t1 (a)
+ON DELETE CASCADE
+) ENGINE=INNODB DEFAULT CHARSET=UTF8;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1, 'bar', 'vbar');
+INSERT INTO t2 VALUES (1, 'BAR2', 'VBAR');
+INSERT INTO t2 VALUES (1, 'bar_bar', 'bibi');
+INSERT INTO t2 VALUES (1, 'customer_over', '1');
+SELECT * FROM t2 WHERE b = 'customer_over';
+a b c
+1 customer_over 1
+SELECT * FROM t2 WHERE BINARY b = 'customer_over';
+a b c
+1 customer_over 1
+SELECT DISTINCT p0.a FROM t2 p0 WHERE p0.b = 'customer_over';
+a
+1
+/* Bang: Empty result set, above was expected: */
+SELECT DISTINCT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over';
+a
+1
+SELECT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over';
+a
+1
+drop table t2, t1;
+CREATE TABLE t1 ( a int ) ENGINE=innodb;
+BEGIN;
+INSERT INTO t1 VALUES (1);
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+test.t1 optimize status OK
+DROP TABLE t1;
+CREATE TABLE t1 (id int PRIMARY KEY, f int NOT NULL, INDEX(f)) ENGINE=InnoDB;
+CREATE TABLE t2 (id int PRIMARY KEY, f INT NOT NULL,
+CONSTRAINT t2_t1 FOREIGN KEY (id) REFERENCES t1 (id)
+ON DELETE CASCADE ON UPDATE CASCADE) ENGINE=InnoDB;
+ALTER TABLE t2 ADD FOREIGN KEY (f) REFERENCES t1 (f) ON
+DELETE CASCADE ON UPDATE CASCADE;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `id` int(11) NOT NULL,
+ `f` int(11) NOT NULL,
+ PRIMARY KEY (`id`),
+ KEY `f` (`f`),
+ CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f`) REFERENCES `t1` (`f`) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `t2_t1` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+DROP TABLE t2, t1;
+CREATE TABLE t1 (a INT, INDEX(a)) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT, INDEX(a)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1 (a) ON DELETE SET NULL;
+ALTER TABLE t2 MODIFY a INT NOT NULL;
+ERROR HY000: Error on rename of '#sql-temporary' to './test/t2' (errno: 150)
+DELETE FROM t1;
+DROP TABLE t2,t1;
+CREATE TABLE t1 (a VARCHAR(5) COLLATE utf8_unicode_ci PRIMARY KEY)
+ENGINE=InnoDB;
+INSERT INTO t1 VALUES (0xEFBCA4EFBCA4EFBCA4);
+DELETE FROM t1;
+INSERT INTO t1 VALUES ('DDD');
+SELECT * FROM t1;
+a
+DDD
+DROP TABLE t1;
+CREATE TABLE t1 (id int PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB
+AUTO_INCREMENT=42;
+INSERT INTO t1 VALUES (0),(347),(0);
+SELECT * FROM t1;
+id
+42
+347
+348
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=349 DEFAULT CHARSET=latin1
+CREATE TABLE t2 (id int PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t2 VALUES(42),(347),(348);
+ALTER TABLE t1 ADD CONSTRAINT t1_t2 FOREIGN KEY (id) REFERENCES t2(id);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`id`),
+ CONSTRAINT `t1_t2` FOREIGN KEY (`id`) REFERENCES `t2` (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=349 DEFAULT CHARSET=latin1
+DROP TABLE t1,t2;
+CREATE TABLE t1 (
+c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255),
+c05 CHAR(255), c06 CHAR(255), c07 CHAR(255), c08 CHAR(255),
+c09 CHAR(255), c10 CHAR(255), c11 CHAR(255), c12 CHAR(255),
+c13 CHAR(255), c14 CHAR(255), c15 CHAR(255), c16 CHAR(255),
+c17 CHAR(255), c18 CHAR(255), c19 CHAR(255), c20 CHAR(255),
+c21 CHAR(255), c22 CHAR(255), c23 CHAR(255), c24 CHAR(255),
+c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255),
+c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255)
+) ENGINE = InnoDB;
+ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1(
+id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY
+) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(-10);
+SELECT * FROM t1;
+id
+-10
+INSERT INTO t1 VALUES(NULL);
+SELECT * FROM t1;
+id
+-10
+1
+DROP TABLE t1;
+SET binlog_format='MIXED';
+SET TX_ISOLATION='read-committed';
+SET AUTOCOMMIT=0;
+DROP TABLE IF EXISTS t1, t2;
+Warnings:
+Note 1051 Unknown table 't1'
+Note 1051 Unknown table 't2'
+CREATE TABLE t1 ( a int ) ENGINE=InnoDB;
+CREATE TABLE t2 LIKE t1;
+SELECT * FROM t2;
+a
+SET binlog_format='MIXED';
+SET TX_ISOLATION='read-committed';
+SET AUTOCOMMIT=0;
+INSERT INTO t1 VALUES (1);
+COMMIT;
+SELECT * FROM t1 WHERE a=1;
+a
+1
+SET binlog_format='MIXED';
+SET TX_ISOLATION='read-committed';
+SET AUTOCOMMIT=0;
+SELECT * FROM t2;
+a
+SET binlog_format='MIXED';
+SET TX_ISOLATION='read-committed';
+SET AUTOCOMMIT=0;
+INSERT INTO t1 VALUES (2);
+COMMIT;
+SELECT * FROM t1 WHERE a=2;
+a
+2
+SELECT * FROM t1 WHERE a=2;
+a
+2
+DROP TABLE t1;
+DROP TABLE t2;
+create table t1 (i int, j int) engine=innodb;
+insert into t1 (i, j) values (1, 1), (2, 2);
+update t1 set j = 2;
+affected rows: 1
+info: Rows matched: 2 Changed: 1 Warnings: 0
+drop table t1;
+create table t1 (id int) comment='this is a comment' engine=innodb;
+select table_comment, data_free > 0 as data_free_is_set
+from information_schema.tables
+where table_schema='test' and table_name = 't1';
+table_comment data_free_is_set
+this is a comment 1
+drop table t1;
+CREATE TABLE t1 (
+c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+c2 VARCHAR(128) NOT NULL,
+PRIMARY KEY(c1)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=100;
+CREATE TABLE t2 (
+c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+c2 INT(10) UNSIGNED DEFAULT NULL,
+PRIMARY KEY(c1)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=200;
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2';
+AUTO_INCREMENT
+200
+ALTER TABLE t2 ADD CONSTRAINT t1_t2_1 FOREIGN KEY(c1) REFERENCES t1(c1);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2';
+AUTO_INCREMENT
+200
+DROP TABLE t2;
+DROP TABLE t1;
+CREATE TABLE t1 (c1 int default NULL,
+c2 int default NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+TRUNCATE TABLE t1;
+affected rows: 0
+INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
+affected rows: 5
+info: Records: 5 Duplicates: 0 Warnings: 0
+TRUNCATE TABLE t1;
+affected rows: 0
+DROP TABLE t1;
+Variable_name Value
+Handler_update 0
+Variable_name Value
+Handler_delete 0
+Variable_name Value
+Handler_update 1
+Variable_name Value
+Handler_delete 1
diff --git a/mysql-test/r/innodb_trx_weight.result b/mysql-test/suite/innodb/r/innodb_trx_weight.result
index 195775f74c8..195775f74c8 100644
--- a/mysql-test/r/innodb_trx_weight.result
+++ b/mysql-test/suite/innodb/r/innodb_trx_weight.result
diff --git a/mysql-test/suite/innodb/t/disabled.def b/mysql-test/suite/innodb/t/disabled.def
index baf8c89f539..dff86f24787 100644
--- a/mysql-test/suite/innodb/t/disabled.def
+++ b/mysql-test/suite/innodb/t/disabled.def
@@ -1 +1,12 @@
-innodb-index: InnoDB: Error: table `test`.`t1#1` already exists in InnoDB internal
+##############################################################################
+#
+# List the test cases that are to be disabled temporarily.
+#
+# Separate the test case name and the comment with ':'.
+#
+# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment>
+#
+# Do not use any TAB characters for whitespace.
+#
+##############################################################################
+innodb : Bug#53306 2010-04-30 VasilDimov valgrind warnings
diff --git a/mysql-test/suite/innodb/t/innodb-analyze.test b/mysql-test/suite/innodb/t/innodb-analyze.test
deleted file mode 100644
index 870e6434797..00000000000
--- a/mysql-test/suite/innodb/t/innodb-analyze.test
+++ /dev/null
@@ -1,66 +0,0 @@
-#
-# Test that mysqld does not crash when running ANALYZE TABLE with
-# different values of the parameter innodb_stats_sample_pages.
-#
-
--- source include/have_innodb.inc
--- source suite/innodb/include/have_innodb_plugin.inc
-
-# we care only that the following SQL commands do not produce errors
-# and do not crash the server
--- disable_query_log
--- disable_result_log
--- enable_warnings
-
-SET GLOBAL innodb_stats_sample_pages=0;
-
-# check that the value has been adjusted to 1
--- enable_result_log
-SHOW VARIABLES LIKE 'innodb_stats_sample_pages';
--- disable_result_log
-
-CREATE TABLE innodb_analyze (
- a INT,
- b INT,
- KEY(a),
- KEY(b,a)
-) ENGINE=InnoDB;
-
-# test with empty table
-
-ANALYZE TABLE innodb_analyze;
-
-SET GLOBAL innodb_stats_sample_pages=2;
-ANALYZE TABLE innodb_analyze;
-
-SET GLOBAL innodb_stats_sample_pages=4;
-ANALYZE TABLE innodb_analyze;
-
-SET GLOBAL innodb_stats_sample_pages=8;
-ANALYZE TABLE innodb_analyze;
-
-SET GLOBAL innodb_stats_sample_pages=16;
-ANALYZE TABLE innodb_analyze;
-
-INSERT INTO innodb_analyze VALUES
-(1,1), (1,1), (1,2), (1,3), (1,4), (1,5),
-(8,1), (8,8), (8,2), (7,1), (1,4), (3,5);
-
-SET GLOBAL innodb_stats_sample_pages=1;
-ANALYZE TABLE innodb_analyze;
-
-SET GLOBAL innodb_stats_sample_pages=2;
-ANALYZE TABLE innodb_analyze;
-
-SET GLOBAL innodb_stats_sample_pages=4;
-ANALYZE TABLE innodb_analyze;
-
-SET GLOBAL innodb_stats_sample_pages=8;
-ANALYZE TABLE innodb_analyze;
-
-SET GLOBAL innodb_stats_sample_pages=16;
-ANALYZE TABLE innodb_analyze;
-
-DROP TABLE innodb_analyze;
-
-SET GLOBAL innodb_stats_sample_pages=DEFAULT;
diff --git a/mysql-test/t/innodb-autoinc-44030.test b/mysql-test/suite/innodb/t/innodb-autoinc-44030.test
index af2e3015280..02c50ee6ef3 100644
--- a/mysql-test/t/innodb-autoinc-44030.test
+++ b/mysql-test/suite/innodb/t/innodb-autoinc-44030.test
@@ -25,7 +25,7 @@ SELECT * FROM t1;
# longer results in the two data dictionaries being out of sync. If they
# revert their changes then this check for ER_AUTOINC_READ_FAILED will need
# to be enabled. Also, see http://bugs.mysql.com/bug.php?id=47621.
--- error ER_AUTOINC_READ_FAILED,1467
+#-- error ER_AUTOINC_READ_FAILED,1467
INSERT INTO t1 VALUES(null);
ALTER TABLE t1 AUTO_INCREMENT = 3;
SHOW CREATE TABLE t1;
diff --git a/mysql-test/t/innodb-autoinc.test b/mysql-test/suite/innodb/t/innodb-autoinc.test
index ef0359b78b0..ef0359b78b0 100644
--- a/mysql-test/t/innodb-autoinc.test
+++ b/mysql-test/suite/innodb/t/innodb-autoinc.test
diff --git a/mysql-test/suite/innodb/t/innodb-consistent-master.opt b/mysql-test/suite/innodb/t/innodb-consistent-master.opt
deleted file mode 100644
index cb48f1aaf60..00000000000
--- a/mysql-test/suite/innodb/t/innodb-consistent-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb_lock_wait_timeout=2
diff --git a/mysql-test/suite/innodb/t/innodb-index_ucs2.test b/mysql-test/suite/innodb/t/innodb-index_ucs2.test
deleted file mode 100644
index db4626ac346..00000000000
--- a/mysql-test/suite/innodb/t/innodb-index_ucs2.test
+++ /dev/null
@@ -1,5 +0,0 @@
--- source include/have_innodb.inc
--- source include/have_ucs2.inc
-
--- let charset = ucs2
--- source suite/innodb/include/innodb-index.inc
diff --git a/mysql-test/t/innodb-lock.test b/mysql-test/suite/innodb/t/innodb-lock.test
index eacf7e562be..eacf7e562be 100644
--- a/mysql-test/t/innodb-lock.test
+++ b/mysql-test/suite/innodb/t/innodb-lock.test
diff --git a/mysql-test/t/innodb-master.opt b/mysql-test/suite/innodb/t/innodb-master.opt
index 4901efb416c..4901efb416c 100644
--- a/mysql-test/t/innodb-master.opt
+++ b/mysql-test/suite/innodb/t/innodb-master.opt
diff --git a/mysql-test/t/innodb-replace.test b/mysql-test/suite/innodb/t/innodb-replace.test
index 8c3aacde5e8..8c3aacde5e8 100644
--- a/mysql-test/t/innodb-replace.test
+++ b/mysql-test/suite/innodb/t/innodb-replace.test
diff --git a/mysql-test/t/innodb-semi-consistent-master.opt b/mysql-test/suite/innodb/t/innodb-semi-consistent-master.opt
index e76299453d3..e76299453d3 100644
--- a/mysql-test/t/innodb-semi-consistent-master.opt
+++ b/mysql-test/suite/innodb/t/innodb-semi-consistent-master.opt
diff --git a/mysql-test/t/innodb-semi-consistent.test b/mysql-test/suite/innodb/t/innodb-semi-consistent.test
index 61ad7815ca9..61ad7815ca9 100644
--- a/mysql-test/t/innodb-semi-consistent.test
+++ b/mysql-test/suite/innodb/t/innodb-semi-consistent.test
diff --git a/mysql-test/suite/innodb/t/innodb-timeout.test b/mysql-test/suite/innodb/t/innodb-timeout.test
deleted file mode 100644
index 1ee1ad63180..00000000000
--- a/mysql-test/suite/innodb/t/innodb-timeout.test
+++ /dev/null
@@ -1,65 +0,0 @@
--- source include/have_innodb.inc
--- source suite/innodb/include/have_innodb_plugin.inc
-
-let $timeout=`select @@innodb_lock_wait_timeout`;
-set global innodb_lock_wait_timeout=42;
-
-connect (a,localhost,root,,);
-connect (b,localhost,root,,);
-
-connection a;
-select @@innodb_lock_wait_timeout;
-set innodb_lock_wait_timeout=1;
-select @@innodb_lock_wait_timeout;
-
-connection b;
-select @@innodb_lock_wait_timeout;
-set global innodb_lock_wait_timeout=347;
-select @@innodb_lock_wait_timeout;
-set innodb_lock_wait_timeout=1;
-select @@innodb_lock_wait_timeout;
-
-connect (c,localhost,root,,);
-connection c;
-select @@innodb_lock_wait_timeout;
-connection default;
-disconnect c;
-
-connection a;
-create table t1(a int primary key)engine=innodb;
-begin;
-insert into t1 values(1),(2),(3);
-
-connection b;
---send
-select * from t1 for update;
-
-connection a;
-commit;
-
-connection b;
-reap;
-
-connection a;
-begin;
-insert into t1 values(4);
-
-connection b;
---send
-select * from t1 for update;
-
-connection a;
-sleep 2;
-commit;
-
-connection b;
---error ER_LOCK_WAIT_TIMEOUT
-reap;
-drop table t1;
-
-connection default;
-
-disconnect a;
-disconnect b;
-
-eval set global innodb_lock_wait_timeout=$timeout;
diff --git a/mysql-test/suite/innodb/t/innodb-use-sys-malloc-master.opt b/mysql-test/suite/innodb/t/innodb-use-sys-malloc-master.opt
deleted file mode 100644
index 8ec086387f8..00000000000
--- a/mysql-test/suite/innodb/t/innodb-use-sys-malloc-master.opt
+++ /dev/null
@@ -1,2 +0,0 @@
---loose-innodb-use-sys-malloc=true
---loose-innodb-use-sys-malloc=true
diff --git a/mysql-test/suite/innodb/t/innodb-use-sys-malloc.test b/mysql-test/suite/innodb/t/innodb-use-sys-malloc.test
deleted file mode 100644
index 4df3ca9d27c..00000000000
--- a/mysql-test/suite/innodb/t/innodb-use-sys-malloc.test
+++ /dev/null
@@ -1,49 +0,0 @@
---source include/have_innodb.inc
--- source suite/innodb/include/have_innodb_plugin.inc
-
-#display current value of innodb_use_sys_malloc
-SELECT @@GLOBAL.innodb_use_sys_malloc;
---echo 1 Expected
-
-#try changing it. Should fail.
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET @@GLOBAL.innodb_use_sys_malloc=0;
---echo Expected error 'Read only variable'
-
-SELECT @@GLOBAL.innodb_use_sys_malloc;
---echo 1 Expected
-
-
-#do some stuff to see if it works.
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
-insert into t1 values (1),(2),(3),(4),(5),(6),(7);
-select * from t1;
-drop table t1;
---source include/have_innodb.inc
-
-#display current value of innodb_use_sys_malloc
-SELECT @@GLOBAL.innodb_use_sys_malloc;
---echo 1 Expected
-
-#try changing it. Should fail.
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET @@GLOBAL.innodb_use_sys_malloc=0;
---echo Expected error 'Read only variable'
-
-SELECT @@GLOBAL.innodb_use_sys_malloc;
---echo 1 Expected
-
-
-#do some stuff to see if it works.
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
-insert into t1 values (1),(2),(3),(4),(5),(6),(7);
-select * from t1;
-drop table t1;
diff --git a/mysql-test/t/innodb.test b/mysql-test/suite/innodb/t/innodb.test
index 8dcf494406a..8641163e4f7 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/suite/innodb/t/innodb.test
@@ -1395,1160 +1395,7 @@ drop table t1;
eval set storage_engine=$default;
-# InnoDB specific varchar tests
-create table t1 (v varchar(16384)) engine=innodb;
-drop table t1;
-
-#
-# BUG#11039 Wrong key length in min()
-#
-
-create table t1 (a char(1), b char(1), key(a, b)) engine=innodb;
-insert into t1 values ('8', '6'), ('4', '7');
-select min(a) from t1;
-select min(b) from t1 where a='8';
-drop table t1;
-
-#
-# Bug #11080 & #11005 Multi-row REPLACE fails on a duplicate key error
-#
-
-CREATE TABLE t1 ( `a` int(11) NOT NULL auto_increment, `b` int(11) default NULL,PRIMARY KEY (`a`),UNIQUE KEY `b` (`b`)) ENGINE=innodb;
-insert into t1 (b) values (1);
-replace into t1 (b) values (2), (1), (3);
-select * from t1;
-truncate table t1;
-insert into t1 (b) values (1);
-replace into t1 (b) values (2);
-replace into t1 (b) values (1);
-replace into t1 (b) values (3);
-select * from t1;
-drop table t1;
-
-create table t1 (rowid int not null auto_increment, val int not null,primary
-key (rowid), unique(val)) engine=innodb;
-replace into t1 (val) values ('1'),('2');
-replace into t1 (val) values ('1'),('2');
---error ER_DUP_ENTRY
-insert into t1 (val) values ('1'),('2');
-select * from t1;
-drop table t1;
-
-#
-# Test that update does not change internal auto-increment value
-#
-
-create table t1 (a int not null auto_increment primary key, val int) engine=InnoDB;
-insert into t1 (val) values (1);
-update t1 set a=2 where a=1;
-# We should get the following error because InnoDB does not update the counter
---error ER_DUP_ENTRY
-insert into t1 (val) values (1);
-select * from t1;
-drop table t1;
-#
-# Bug #10465
-#
-
---disable_warnings
-CREATE TABLE t1 (GRADE DECIMAL(4) NOT NULL, PRIMARY KEY (GRADE)) ENGINE=INNODB;
---enable_warnings
-INSERT INTO t1 (GRADE) VALUES (151),(252),(343);
-SELECT GRADE FROM t1 WHERE GRADE > 160 AND GRADE < 300;
-SELECT GRADE FROM t1 WHERE GRADE= 151;
-DROP TABLE t1;
-
-#
-# Bug #12340 multitable delete deletes only one record
-#
-create table t1 (f1 varchar(10), f2 varchar(10), primary key (f1,f2)) engine=innodb;
-create table t2 (f3 varchar(10), f4 varchar(10), key (f4)) engine=innodb;
-insert into t2 values ('aa','cc');
-insert into t1 values ('aa','bb'),('aa','cc');
-delete t1 from t1,t2 where f1=f3 and f4='cc';
-select * from t1;
-drop table t1,t2;
-
-#
-# Test that the slow TRUNCATE implementation resets autoincrement columns
-# (bug #11946)
-#
-
-CREATE TABLE t1 (
-id INTEGER NOT NULL AUTO_INCREMENT, PRIMARY KEY (id)
-) ENGINE=InnoDB;
-
-CREATE TABLE t2 (
-id INTEGER NOT NULL,
-FOREIGN KEY (id) REFERENCES t1 (id)
-) ENGINE=InnoDB;
-
-INSERT INTO t1 (id) VALUES (NULL);
-SELECT * FROM t1;
-TRUNCATE t1;
-INSERT INTO t1 (id) VALUES (NULL);
-SELECT * FROM t1;
-
-# continued from above; test that doing a slow TRUNCATE on a table with 0
-# rows resets autoincrement columns
-DELETE FROM t1;
-TRUNCATE t1;
-INSERT INTO t1 (id) VALUES (NULL);
-SELECT * FROM t1;
-DROP TABLE t2, t1;
-
-# Test that foreign keys in temporary tables are not accepted (bug #12084)
-CREATE TABLE t1
-(
- id INT PRIMARY KEY
-) ENGINE=InnoDB;
-
---error 1005,1005
-CREATE TEMPORARY TABLE t2
-(
- id INT NOT NULL PRIMARY KEY,
- b INT,
- FOREIGN KEY (b) REFERENCES test.t1(id)
-) ENGINE=InnoDB;
-DROP TABLE t1;
-
-#
-# Test that index column max sizes are honored (bug #13315)
-#
-
-# prefix index
-create table t1 (col1 varchar(2000), index (col1(767)))
- character set = latin1 engine = innodb;
-
-# normal indexes
-create table t2 (col1 char(255), index (col1))
- character set = latin1 engine = innodb;
-create table t3 (col1 binary(255), index (col1))
- character set = latin1 engine = innodb;
-create table t4 (col1 varchar(767), index (col1))
- character set = latin1 engine = innodb;
-create table t5 (col1 varchar(767) primary key)
- character set = latin1 engine = innodb;
-create table t6 (col1 varbinary(767) primary key)
- character set = latin1 engine = innodb;
-create table t7 (col1 text, index(col1(767)))
- character set = latin1 engine = innodb;
-create table t8 (col1 blob, index(col1(767)))
- character set = latin1 engine = innodb;
-
-# multi-column indexes are allowed to be longer
-create table t9 (col1 varchar(512), col2 varchar(512), index(col1, col2))
- character set = latin1 engine = innodb;
-
-show create table t9;
-
-drop table t1, t2, t3, t4, t5, t6, t7, t8, t9;
-
-# these should have their index length trimmed
-create table t1 (col1 varchar(768), index(col1))
- character set = latin1 engine = innodb;
-create table t2 (col1 varbinary(768), index(col1))
- character set = latin1 engine = innodb;
-create table t3 (col1 text, index(col1(768)))
- character set = latin1 engine = innodb;
-create table t4 (col1 blob, index(col1(768)))
- character set = latin1 engine = innodb;
-
-show create table t1;
-
-drop table t1, t2, t3, t4;
-
-# these should be refused
---error 1071
-create table t1 (col1 varchar(768) primary key)
- character set = latin1 engine = innodb;
---error 1071
-create table t2 (col1 varbinary(768) primary key)
- character set = latin1 engine = innodb;
---error 1071
-create table t3 (col1 text, primary key(col1(768)))
- character set = latin1 engine = innodb;
---error 1071
-create table t4 (col1 blob, primary key(col1(768)))
- character set = latin1 engine = innodb;
-
-#
-# Test improved foreign key error messages (bug #3443)
-#
-
-CREATE TABLE t1
-(
- id INT PRIMARY KEY
-) ENGINE=InnoDB;
-
-CREATE TABLE t2
-(
- v INT,
- CONSTRAINT c1 FOREIGN KEY (v) REFERENCES t1(id)
-) ENGINE=InnoDB;
-
---error 1452
-INSERT INTO t2 VALUES(2);
-
-INSERT INTO t1 VALUES(1);
-INSERT INTO t2 VALUES(1);
-
---error 1451
-DELETE FROM t1 WHERE id = 1;
-
---error 1217
-DROP TABLE t1;
-
-SET FOREIGN_KEY_CHECKS=0;
-DROP TABLE t1;
-SET FOREIGN_KEY_CHECKS=1;
-
---error 1452
-INSERT INTO t2 VALUES(3);
-
-DROP TABLE t2;
-#
-# Test that checksum table uses a consistent read Bug #12669
-#
-connect (a,localhost,root,,);
-connect (b,localhost,root,,);
-connection a;
-create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
-insert into t1 values (1),(2);
-set autocommit=0;
-checksum table t1;
-connection b;
-insert into t1 values(3);
-connection a;
-#
-# Here checksum should not see insert
-#
-checksum table t1;
-connection a;
-commit;
-checksum table t1;
-commit;
-drop table t1;
-#
-# autocommit = 1
-#
-connection a;
-create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
-insert into t1 values (1),(2);
-set autocommit=1;
-checksum table t1;
-connection b;
-set autocommit=1;
-insert into t1 values(3);
-connection a;
-#
-# Here checksum sees insert
-#
-checksum table t1;
-drop table t1;
-
-connection default;
-disconnect a;
-disconnect b;
-
-# tests for bugs #9802 and #13778
-
-# test that FKs between invalid types are not accepted
-
-set foreign_key_checks=0;
-create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb;
-# Embedded server doesn't chdir to data directory
---replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
--- error 1005
-create table t1(a char(10) primary key, b varchar(20)) engine = innodb;
-set foreign_key_checks=1;
-drop table t2;
-
-# test that FKs between different charsets are not accepted in CREATE even
-# when f_k_c is 0
-
-set foreign_key_checks=0;
-create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1;
-# Embedded server doesn't chdir to data directory
---replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
--- error 1005
-create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=utf8;
-set foreign_key_checks=1;
-drop table t1;
-
-# test that invalid datatype conversions with ALTER are not allowed
-
-set foreign_key_checks=0;
-create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb;
-create table t1(a varchar(10) primary key) engine = innodb;
--- error 1025,1025
-alter table t1 modify column a int;
-set foreign_key_checks=1;
-drop table t2,t1;
-
-# test that charset conversions with ALTER are allowed when f_k_c is 0
-
-set foreign_key_checks=0;
-create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1;
-create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1;
-alter table t1 convert to character set utf8;
-set foreign_key_checks=1;
-drop table t2,t1;
-
-# test that RENAME does not allow invalid charsets when f_k_c is 0
-
-set foreign_key_checks=0;
-create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1;
-create table t3(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=utf8;
-# Embedded server doesn't chdir to data directory
---replace_result $MYSQLD_DATADIR ./ master-data/ ''
--- error 1025
-rename table t3 to t1;
-set foreign_key_checks=1;
-drop table t2,t3;
-
-# test that foreign key errors are reported correctly (Bug #15550)
-
-create table t1(a int primary key) row_format=redundant engine=innodb;
-create table t2(a int primary key,constraint foreign key(a)references t1(a)) row_format=compact engine=innodb;
-create table t3(a int primary key) row_format=compact engine=innodb;
-create table t4(a int primary key,constraint foreign key(a)references t3(a)) row_format=redundant engine=innodb;
-
-insert into t1 values(1);
-insert into t3 values(1);
--- error 1452
-insert into t2 values(2);
--- error 1452
-insert into t4 values(2);
-insert into t2 values(1);
-insert into t4 values(1);
--- error 1451
-update t1 set a=2;
--- error 1452
-update t2 set a=2;
--- error 1451
-update t3 set a=2;
--- error 1452
-update t4 set a=2;
--- error 1451
-truncate t1;
--- error 1451
-truncate t3;
-truncate t2;
-truncate t4;
-truncate t1;
-truncate t3;
-
-drop table t4,t3,t2,t1;
-
-
-#
-# Test that we can create a large (>1K) key
-#
-create table t1 (a varchar(255) character set utf8,
- b varchar(255) character set utf8,
- c varchar(255) character set utf8,
- d varchar(255) character set utf8,
- key (a,b,c,d)) engine=innodb;
-drop table t1;
---error ER_TOO_LONG_KEY
-create table t1 (a varchar(255) character set utf8,
- b varchar(255) character set utf8,
- c varchar(255) character set utf8,
- d varchar(255) character set utf8,
- e varchar(255) character set utf8,
- key (a,b,c,d,e)) engine=innodb;
-
-
-# test the padding of BINARY types and collations (Bug #14189)
-
-create table t1 (s1 varbinary(2),primary key (s1)) engine=innodb;
-create table t2 (s1 binary(2),primary key (s1)) engine=innodb;
-create table t3 (s1 varchar(2) binary,primary key (s1)) engine=innodb;
-create table t4 (s1 char(2) binary,primary key (s1)) engine=innodb;
-
-insert into t1 values (0x41),(0x4120),(0x4100);
--- error ER_DUP_ENTRY
-insert into t2 values (0x41),(0x4120),(0x4100);
-insert into t2 values (0x41),(0x4120);
--- error ER_DUP_ENTRY
-insert into t3 values (0x41),(0x4120),(0x4100);
-insert into t3 values (0x41),(0x4100);
--- error ER_DUP_ENTRY
-insert into t4 values (0x41),(0x4120),(0x4100);
-insert into t4 values (0x41),(0x4100);
-select hex(s1) from t1;
-select hex(s1) from t2;
-select hex(s1) from t3;
-select hex(s1) from t4;
-drop table t1,t2,t3,t4;
-
-create table t1 (a int primary key,s1 varbinary(3) not null unique) engine=innodb;
-create table t2 (s1 binary(2) not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=innodb;
-
-insert into t1 values(1,0x4100),(2,0x41),(3,0x4120),(4,0x42);
--- error 1452
-insert into t2 values(0x42);
-insert into t2 values(0x41);
-select hex(s1) from t2;
-update t1 set s1=0x123456 where a=2;
-select hex(s1) from t2;
--- error 1451
-update t1 set s1=0x12 where a=1;
--- error 1451
-update t1 set s1=0x12345678 where a=1;
--- error 1451
-update t1 set s1=0x123457 where a=1;
-update t1 set s1=0x1220 where a=1;
-select hex(s1) from t2;
-update t1 set s1=0x1200 where a=1;
-select hex(s1) from t2;
-update t1 set s1=0x4200 where a=1;
-select hex(s1) from t2;
--- error 1451
-delete from t1 where a=1;
-delete from t1 where a=2;
-update t2 set s1=0x4120;
--- error 1451
-delete from t1;
-delete from t1 where a!=3;
-select a,hex(s1) from t1;
-select hex(s1) from t2;
-
-drop table t2,t1;
-
-create table t1 (a int primary key,s1 varchar(2) binary not null unique) engine=innodb;
-create table t2 (s1 char(2) binary not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=innodb;
-
-insert into t1 values(1,0x4100),(2,0x41);
-insert into t2 values(0x41);
-select hex(s1) from t2;
-update t1 set s1=0x1234 where a=1;
-select hex(s1) from t2;
-update t1 set s1=0x12 where a=2;
-select hex(s1) from t2;
-delete from t1 where a=1;
--- error 1451
-delete from t1 where a=2;
-select a,hex(s1) from t1;
-select hex(s1) from t2;
-
-drop table t2,t1;
-# Ensure that <tablename>_ibfk_0 is not mistreated as a
-# generated foreign key identifier. (Bug #16387)
-
-CREATE TABLE t1(a INT, PRIMARY KEY(a)) ENGINE=InnoDB;
-CREATE TABLE t2(a INT) ENGINE=InnoDB;
-ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1(a);
-ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_1;
-ALTER TABLE t2 ADD CONSTRAINT t2_ibfk_0 FOREIGN KEY (a) REFERENCES t1(a);
-ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_0;
-SHOW CREATE TABLE t2;
-DROP TABLE t2,t1;
-
-#
-# Test case for bug #16229: MySQL/InnoDB uses full explicit table locks in trigger processing
-#
-
-connect (a,localhost,root,,);
-connect (b,localhost,root,,);
-connection a;
-create table t1(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
-insert into t1(a) values (1),(2),(3);
-commit;
-connection b;
-set autocommit = 0;
-update t1 set b = 5 where a = 2;
-connection a;
-delimiter |;
-create trigger t1t before insert on t1 for each row begin set NEW.b = NEW.a * 10 + 5, NEW.c = NEW.a / 10; end |
-delimiter ;|
-set autocommit = 0;
-connection a;
-insert into t1(a) values (10),(20),(30),(40),(50),(60),(70),(80),(90),(100),
-(11),(21),(31),(41),(51),(61),(71),(81),(91),(101),
-(12),(22),(32),(42),(52),(62),(72),(82),(92),(102),
-(13),(23),(33),(43),(53),(63),(73),(83),(93),(103),
-(14),(24),(34),(44),(54),(64),(74),(84),(94),(104);
-connection b;
-commit;
-connection a;
-commit;
-drop trigger t1t;
-drop table t1;
-disconnect a;
-disconnect b;
-#
-# Another trigger test
-#
-connect (a,localhost,root,,);
-connect (b,localhost,root,,);
-connection a;
-create table t1(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
-create table t2(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
-create table t3(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
-create table t4(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
-create table t5(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
-insert into t1(a) values (1),(2),(3);
-insert into t2(a) values (1),(2),(3);
-insert into t3(a) values (1),(2),(3);
-insert into t4(a) values (1),(2),(3);
-insert into t3(a) values (5),(7),(8);
-insert into t4(a) values (5),(7),(8);
-insert into t5(a) values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12);
-
-delimiter |;
-create trigger t1t before insert on t1 for each row begin
- INSERT INTO t2 SET a = NEW.a;
-end |
-
-create trigger t2t before insert on t2 for each row begin
- DELETE FROM t3 WHERE a = NEW.a;
-end |
-
-create trigger t3t before delete on t3 for each row begin
- UPDATE t4 SET b = b + 1 WHERE a = OLD.a;
-end |
-
-create trigger t4t before update on t4 for each row begin
- UPDATE t5 SET b = b + 1 where a = NEW.a;
-end |
-delimiter ;|
-commit;
-set autocommit = 0;
-update t1 set b = b + 5 where a = 1;
-update t2 set b = b + 5 where a = 1;
-update t3 set b = b + 5 where a = 1;
-update t4 set b = b + 5 where a = 1;
-insert into t5(a) values(20);
-connection b;
-set autocommit = 0;
-insert into t1(a) values(7);
-insert into t2(a) values(8);
-delete from t2 where a = 3;
-update t4 set b = b + 1 where a = 3;
-commit;
-drop trigger t1t;
-drop trigger t2t;
-drop trigger t3t;
-drop trigger t4t;
-drop table t1, t2, t3, t4, t5;
-connection default;
-disconnect a;
-disconnect b;
-
-#
-# Test that cascading updates leading to duplicate keys give the correct
-# error message (bug #9680)
-#
-
-CREATE TABLE t1 (
- field1 varchar(8) NOT NULL DEFAULT '',
- field2 varchar(8) NOT NULL DEFAULT '',
- PRIMARY KEY (field1, field2)
-) ENGINE=InnoDB;
-
-CREATE TABLE t2 (
- field1 varchar(8) NOT NULL DEFAULT '' PRIMARY KEY,
- FOREIGN KEY (field1) REFERENCES t1 (field1)
- ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDB;
-
-INSERT INTO t1 VALUES ('old', 'somevalu');
-INSERT INTO t1 VALUES ('other', 'anyvalue');
-
-INSERT INTO t2 VALUES ('old');
-INSERT INTO t2 VALUES ('other');
-
---error ER_FOREIGN_DUPLICATE_KEY
-UPDATE t1 SET field1 = 'other' WHERE field2 = 'somevalu';
-
-DROP TABLE t2;
-DROP TABLE t1;
-
-#
-# Bug#18477 - MySQL/InnoDB Ignoring Foreign Keys in ALTER TABLE
-#
-create table t1 (
- c1 bigint not null,
- c2 bigint not null,
- primary key (c1),
- unique key (c2)
-) engine=innodb;
-#
-create table t2 (
- c1 bigint not null,
- primary key (c1)
-) engine=innodb;
-#
-alter table t1 add constraint c2_fk foreign key (c2)
- references t2(c1) on delete cascade;
-show create table t1;
-#
-alter table t1 drop foreign key c2_fk;
-show create table t1;
-#
-drop table t1, t2;
-
-#
-# Bug #14360: problem with intervals
-#
-
-create table t1(a date) engine=innodb;
-create table t2(a date, key(a)) engine=innodb;
-insert into t1 values('2005-10-01');
-insert into t2 values('2005-10-01');
-select * from t1, t2
- where t2.a between t1.a - interval 2 day and t1.a + interval 2 day;
-drop table t1, t2;
-
-create table t1 (id int not null, f_id int not null, f int not null,
-primary key(f_id, id)) engine=innodb;
-create table t2 (id int not null,s_id int not null,s varchar(200),
-primary key(id)) engine=innodb;
-INSERT INTO t1 VALUES (8, 1, 3);
-INSERT INTO t1 VALUES (1, 2, 1);
-INSERT INTO t2 VALUES (1, 0, '');
-INSERT INTO t2 VALUES (8, 1, '');
-commit;
-DELETE ml.* FROM t1 AS ml LEFT JOIN t2 AS mm ON (mm.id=ml.id)
-WHERE mm.id IS NULL;
-select ml.* from t1 as ml left join t2 as mm on (mm.id=ml.id)
-where mm.id is null lock in share mode;
-drop table t1,t2;
-
-#
-# Test case where X-locks on unused rows should be released in a
-# update (because READ COMMITTED isolation level)
-#
-
-connect (a,localhost,root,,);
-connect (b,localhost,root,,);
-connection a;
-create table t1(a int not null, b int, primary key(a)) engine=innodb;
-insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3);
-commit;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-update t1 set b = 5 where b = 1;
-connection b;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-#
-# X-lock to record (7,3) should be released in a update
-#
-select * from t1 where a = 7 and b = 3 for update;
-connection a;
-commit;
-connection b;
-commit;
-drop table t1;
-connection default;
-disconnect a;
-disconnect b;
-
-#
-# Test case where no locks should be released (because we are not
-# using READ COMMITTED isolation level)
-#
-
-connect (a,localhost,root,,);
-connect (b,localhost,root,,);
-connection a;
-create table t1(a int not null, b int, primary key(a)) engine=innodb;
-insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2);
-commit;
-set autocommit = 0;
-select * from t1 lock in share mode;
-update t1 set b = 5 where b = 1;
-connection b;
-set autocommit = 0;
-#
-# S-lock to records (2,2),(4,2), and (6,2) should not be released in a update
-#
---error 1205
-select * from t1 where a = 2 and b = 2 for update;
-#
-# X-lock to record (1,1),(3,1),(5,1) should not be released in a update
-#
---error 1205
-connection a;
-commit;
-connection b;
-commit;
-connection default;
-disconnect a;
-disconnect b;
-drop table t1;
-
-#
-# Consistent read should be used in following selects
-#
-# 1) INSERT INTO ... SELECT
-# 2) UPDATE ... = ( SELECT ...)
-# 3) CREATE ... SELECT
-
-connect (a,localhost,root,,);
-connect (b,localhost,root,,);
-connection a;
-create table t1(a int not null, b int, primary key(a)) engine=innodb;
-insert into t1 values (1,2),(5,3),(4,2);
-create table t2(d int not null, e int, primary key(d)) engine=innodb;
-insert into t2 values (8,6),(12,1),(3,1);
-commit;
-set autocommit = 0;
-select * from t2 for update;
-connection b;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-insert into t1 select * from t2;
-update t1 set b = (select e from t2 where a = d);
-create table t3(d int not null, e int, primary key(d)) engine=innodb
-select * from t2;
-commit;
-connection a;
-commit;
-connection default;
-disconnect a;
-disconnect b;
-drop table t1, t2, t3;
-
-#
-# Consistent read should not be used if
-#
-# (a) isolation level is serializable OR
-# (b) select ... lock in share mode OR
-# (c) select ... for update
-#
-# in following queries:
-#
-# 1) INSERT INTO ... SELECT
-# 2) UPDATE ... = ( SELECT ...)
-# 3) CREATE ... SELECT
-
-connect (a,localhost,root,,);
-connect (b,localhost,root,,);
-connect (c,localhost,root,,);
-connect (d,localhost,root,,);
-connect (e,localhost,root,,);
-connect (f,localhost,root,,);
-connect (g,localhost,root,,);
-connect (h,localhost,root,,);
-connect (i,localhost,root,,);
-connect (j,localhost,root,,);
-connection a;
-create table t1(a int not null, b int, primary key(a)) engine=innodb;
-insert into t1 values (1,2),(5,3),(4,2);
-create table t2(a int not null, b int, primary key(a)) engine=innodb;
-insert into t2 values (8,6),(12,1),(3,1);
-create table t3(d int not null, b int, primary key(d)) engine=innodb;
-insert into t3 values (8,6),(12,1),(3,1);
-create table t5(a int not null, b int, primary key(a)) engine=innodb;
-insert into t5 values (1,2),(5,3),(4,2);
-create table t6(d int not null, e int, primary key(d)) engine=innodb;
-insert into t6 values (8,6),(12,1),(3,1);
-create table t8(a int not null, b int, primary key(a)) engine=innodb;
-insert into t8 values (1,2),(5,3),(4,2);
-create table t9(d int not null, e int, primary key(d)) engine=innodb;
-insert into t9 values (8,6),(12,1),(3,1);
-commit;
-set autocommit = 0;
-select * from t2 for update;
-connection b;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
---send
-insert into t1 select * from t2;
-connection c;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
---send
-update t3 set b = (select b from t2 where a = d);
-connection d;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
---send
-create table t4(a int not null, b int, primary key(a)) engine=innodb select * from t2;
-connection e;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
---send
-insert into t5 (select * from t2 lock in share mode);
-connection f;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
---send
-update t6 set e = (select b from t2 where a = d lock in share mode);
-connection g;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
---send
-create table t7(a int not null, b int, primary key(a)) engine=innodb select * from t2 lock in share mode;
-connection h;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
---send
-insert into t8 (select * from t2 for update);
-connection i;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
---send
-update t9 set e = (select b from t2 where a = d for update);
-connection j;
-SET binlog_format='MIXED';
-set autocommit = 0;
-SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
---send
-create table t10(a int not null, b int, primary key(a)) engine=innodb select * from t2 for update;
-
-connection b;
---error 1205
-reap;
-
-connection c;
---error 1205
-reap;
-
-connection d;
---error 1205
-reap;
-
-connection e;
---error 1205
-reap;
-
-connection f;
---error 1205
-reap;
-
-connection g;
---error 1205
-reap;
-
-connection h;
---error 1205
-reap;
-
-connection i;
---error 1205
-reap;
-
-connection j;
---error 1205
-reap;
-
-connection a;
-commit;
-
-connection default;
-disconnect a;
-disconnect b;
-disconnect c;
-disconnect d;
-disconnect e;
-disconnect f;
-disconnect g;
-disconnect h;
-disconnect i;
-disconnect j;
-drop table t1, t2, t3, t5, t6, t8, t9;
-
-# bug 18934, "InnoDB crashes when table uses column names like DB_ROW_ID"
---error 1005
-CREATE TABLE t1 (DB_ROW_ID int) engine=innodb;
-
-#
-# Bug #17152: Wrong result with BINARY comparison on aliased column
-#
-
-CREATE TABLE t1 (
- a BIGINT(20) NOT NULL,
- PRIMARY KEY (a)
- ) ENGINE=INNODB DEFAULT CHARSET=UTF8;
-
-CREATE TABLE t2 (
- a BIGINT(20) NOT NULL,
- b VARCHAR(128) NOT NULL,
- c TEXT NOT NULL,
- PRIMARY KEY (a,b),
- KEY idx_t2_b_c (b,c(200)),
- CONSTRAINT t_fk FOREIGN KEY (a) REFERENCES t1 (a)
- ON DELETE CASCADE
- ) ENGINE=INNODB DEFAULT CHARSET=UTF8;
-
-INSERT INTO t1 VALUES (1);
-INSERT INTO t2 VALUES (1, 'bar', 'vbar');
-INSERT INTO t2 VALUES (1, 'BAR2', 'VBAR');
-INSERT INTO t2 VALUES (1, 'bar_bar', 'bibi');
-INSERT INTO t2 VALUES (1, 'customer_over', '1');
-
-SELECT * FROM t2 WHERE b = 'customer_over';
-SELECT * FROM t2 WHERE BINARY b = 'customer_over';
-SELECT DISTINCT p0.a FROM t2 p0 WHERE p0.b = 'customer_over';
-/* Bang: Empty result set, above was expected: */
-SELECT DISTINCT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over';
-SELECT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over';
-
-drop table t2, t1;
-
-#
-# Test optimize on table with open transaction
-#
-
-CREATE TABLE t1 ( a int ) ENGINE=innodb;
-BEGIN;
-INSERT INTO t1 VALUES (1);
-OPTIMIZE TABLE t1;
-DROP TABLE t1;
-
-#
-# Bug #24741 (existing cascade clauses disappear when adding foreign keys)
-#
-
-CREATE TABLE t1 (id int PRIMARY KEY, f int NOT NULL, INDEX(f)) ENGINE=InnoDB;
-
-CREATE TABLE t2 (id int PRIMARY KEY, f INT NOT NULL,
- CONSTRAINT t2_t1 FOREIGN KEY (id) REFERENCES t1 (id)
- ON DELETE CASCADE ON UPDATE CASCADE) ENGINE=InnoDB;
-
-ALTER TABLE t2 ADD FOREIGN KEY (f) REFERENCES t1 (f) ON
-DELETE CASCADE ON UPDATE CASCADE;
-
-SHOW CREATE TABLE t2;
-DROP TABLE t2, t1;
-
-#
-# Bug #25927: Prevent ALTER TABLE ... MODIFY ... NOT NULL on columns
-# for which there is a foreign key constraint ON ... SET NULL.
-#
-
-CREATE TABLE t1 (a INT, INDEX(a)) ENGINE=InnoDB;
-CREATE TABLE t2 (a INT, INDEX(a)) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1);
-INSERT INTO t2 VALUES (1);
-ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1 (a) ON DELETE SET NULL;
-# mysqltest first does replace_regex, then replace_result
---replace_regex /'[^']*test\/#sql-[0-9a-f_]*'/'#sql-temporary'/
-# Embedded server doesn't chdir to data directory
---replace_result $MYSQLD_DATADIR ./ master-data/ ''
---error 1025
-ALTER TABLE t2 MODIFY a INT NOT NULL;
-DELETE FROM t1;
-DROP TABLE t2,t1;
-
-#
-# Bug #26835: table corruption after delete+insert
-#
-
-CREATE TABLE t1 (a VARCHAR(5) COLLATE utf8_unicode_ci PRIMARY KEY)
-ENGINE=InnoDB;
-INSERT INTO t1 VALUES (0xEFBCA4EFBCA4EFBCA4);
-DELETE FROM t1;
-INSERT INTO t1 VALUES ('DDD');
-SELECT * FROM t1;
-DROP TABLE t1;
-
-#
-# Bug #23313 (AUTO_INCREMENT=# not reported back for InnoDB tables)
-# Bug #21404 (AUTO_INCREMENT value reset when Adding FKEY (or ALTER?))
-#
-
-CREATE TABLE t1 (id int PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB
-AUTO_INCREMENT=42;
-
-INSERT INTO t1 VALUES (0),(347),(0);
-SELECT * FROM t1;
-
-SHOW CREATE TABLE t1;
-
-CREATE TABLE t2 (id int PRIMARY KEY) ENGINE=InnoDB;
-INSERT INTO t2 VALUES(42),(347),(348);
-ALTER TABLE t1 ADD CONSTRAINT t1_t2 FOREIGN KEY (id) REFERENCES t2(id);
-SHOW CREATE TABLE t1;
-
-DROP TABLE t1,t2;
-
-#
-# Bug #21101 (Prints wrong error message if max row size is too large)
-#
---error 1118
-CREATE TABLE t1 (
- c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255),
- c05 CHAR(255), c06 CHAR(255), c07 CHAR(255), c08 CHAR(255),
- c09 CHAR(255), c10 CHAR(255), c11 CHAR(255), c12 CHAR(255),
- c13 CHAR(255), c14 CHAR(255), c15 CHAR(255), c16 CHAR(255),
- c17 CHAR(255), c18 CHAR(255), c19 CHAR(255), c20 CHAR(255),
- c21 CHAR(255), c22 CHAR(255), c23 CHAR(255), c24 CHAR(255),
- c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255),
- c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255)
- ) ENGINE = InnoDB;
-
-#
-# Bug #31860 InnoDB assumes AUTOINC values can only be positive.
-#
-DROP TABLE IF EXISTS t1;
-CREATE TABLE t1(
- id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY
- ) ENGINE=InnoDB;
-INSERT INTO t1 VALUES(-10);
-SELECT * FROM t1;
-#
-# NOTE: The server really needs to be restarted at this point
-# for the test to be useful.
-#
-# Without the fix InnoDB would trip over an assertion here.
-INSERT INTO t1 VALUES(NULL);
-# The next value should be 1 and not -9 or a -ve number
-SELECT * FROM t1;
-DROP TABLE t1;
-
-#
-# Bug #21409 Incorrect result returned when in READ-COMMITTED with
-# query_cache ON
-#
-CONNECT (c1,localhost,root,,);
-CONNECT (c2,localhost,root,,);
-CONNECTION c1;
-SET binlog_format='MIXED';
-SET TX_ISOLATION='read-committed';
-SET AUTOCOMMIT=0;
-DROP TABLE IF EXISTS t1, t2;
-CREATE TABLE t1 ( a int ) ENGINE=InnoDB;
-CREATE TABLE t2 LIKE t1;
-SELECT * FROM t2;
-CONNECTION c2;
-SET binlog_format='MIXED';
-SET TX_ISOLATION='read-committed';
-SET AUTOCOMMIT=0;
-INSERT INTO t1 VALUES (1);
-COMMIT;
-CONNECTION c1;
-SELECT * FROM t1 WHERE a=1;
-DISCONNECT c1;
-DISCONNECT c2;
-CONNECT (c1,localhost,root,,);
-CONNECT (c2,localhost,root,,);
-CONNECTION c1;
-SET binlog_format='MIXED';
-SET TX_ISOLATION='read-committed';
-SET AUTOCOMMIT=0;
-SELECT * FROM t2;
-CONNECTION c2;
-SET binlog_format='MIXED';
-SET TX_ISOLATION='read-committed';
-SET AUTOCOMMIT=0;
-INSERT INTO t1 VALUES (2);
-COMMIT;
-CONNECTION c1;
-# The result set below should be the same for both selects
-SELECT * FROM t1 WHERE a=2;
-SELECT * FROM t1 WHERE a=2;
-DROP TABLE t1;
-DROP TABLE t2;
-DISCONNECT c1;
-DISCONNECT c2;
-CONNECTION default;
-
-#
-# Bug #29157 UPDATE, changed rows incorrect
-#
-create table t1 (i int, j int) engine=innodb;
-insert into t1 (i, j) values (1, 1), (2, 2);
---enable_info
-update t1 set j = 2;
---disable_info
-drop table t1;
-
-#
-# Bug #32440 InnoDB free space info does not appear in SHOW TABLE STATUS or
-# I_S
-#
-create table t1 (id int) comment='this is a comment' engine=innodb;
-select table_comment, data_free > 0 as data_free_is_set
- from information_schema.tables
- where table_schema='test' and table_name = 't1';
-drop table t1;
-
-#
-# Bug 34920 test
-#
-CONNECTION default;
-CREATE TABLE t1 (
- c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- c2 VARCHAR(128) NOT NULL,
- PRIMARY KEY(c1)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=100;
-
-CREATE TABLE t2 (
- c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
- c2 INT(10) UNSIGNED DEFAULT NULL,
- PRIMARY KEY(c1)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=200;
-
-SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2';
-ALTER TABLE t2 ADD CONSTRAINT t1_t2_1 FOREIGN KEY(c1) REFERENCES t1(c1);
-SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2';
-DROP TABLE t2;
-DROP TABLE t1;
-# End 34920 test
-#
-# Bug #29507 TRUNCATE shows to many rows effected
-#
-CONNECTION default;
-CREATE TABLE t1 (c1 int default NULL,
- c2 int default NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-
---enable_info
-TRUNCATE TABLE t1;
-
-INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
-TRUNCATE TABLE t1;
-
---disable_info
-DROP TABLE t1;
-#
-# Bug#35537 Innodb doesn't increment handler_update and handler_delete.
-#
-- disable_query_log
--- disable_result_log
-
-CONNECT (c1,localhost,root,,);
-
-DROP TABLE IF EXISTS bug35537;
-CREATE TABLE bug35537 (
- c1 int
-) ENGINE=InnoDB;
-
-INSERT INTO bug35537 VALUES (1);
-
--- enable_result_log
-
-SHOW SESSION STATUS LIKE 'Handler_update%';
-SHOW SESSION STATUS LIKE 'Handler_delete%';
-
-UPDATE bug35537 SET c1 = 2 WHERE c1 = 1;
-DELETE FROM bug35537 WHERE c1 = 2;
-
-SHOW SESSION STATUS LIKE 'Handler_update%';
-SHOW SESSION STATUS LIKE 'Handler_delete%';
-
-DROP TABLE bug35537;
-
-DISCONNECT c1;
-CONNECTION default;
-
SET GLOBAL innodb_thread_concurrency = @innodb_thread_concurrency_orig;
#######################################################################
diff --git a/mysql-test/t/innodb_bug21704.test b/mysql-test/suite/innodb/t/innodb_bug21704.test
index c649b61034c..c649b61034c 100644
--- a/mysql-test/t/innodb_bug21704.test
+++ b/mysql-test/suite/innodb/t/innodb_bug21704.test
diff --git a/mysql-test/t/innodb_bug34053.test b/mysql-test/suite/innodb/t/innodb_bug34053.test
index b935e45c06d..b935e45c06d 100644
--- a/mysql-test/t/innodb_bug34053.test
+++ b/mysql-test/suite/innodb/t/innodb_bug34053.test
diff --git a/mysql-test/t/innodb_bug34300.test b/mysql-test/suite/innodb/t/innodb_bug34300.test
index 432ddd03547..432ddd03547 100644
--- a/mysql-test/t/innodb_bug34300.test
+++ b/mysql-test/suite/innodb/t/innodb_bug34300.test
diff --git a/mysql-test/t/innodb_bug35220.test b/mysql-test/suite/innodb/t/innodb_bug35220.test
index 26f7d6b1ddd..26f7d6b1ddd 100644
--- a/mysql-test/t/innodb_bug35220.test
+++ b/mysql-test/suite/innodb/t/innodb_bug35220.test
diff --git a/mysql-test/suite/innodb/t/innodb_bug36169.test b/mysql-test/suite/innodb/t/innodb_bug36169.test
deleted file mode 100644
index da852b816f4..00000000000
--- a/mysql-test/suite/innodb/t/innodb_bug36169.test
+++ /dev/null
@@ -1,1159 +0,0 @@
-#
-# Bug#36169 create innodb compressed table with too large row size crashed
-# http://bugs.mysql.com/36169
-#
-
--- source include/have_innodb.inc
--- source suite/innodb/include/have_innodb_plugin.inc
-
-SET GLOBAL innodb_file_format='Barracuda';
-SET GLOBAL innodb_file_per_table=ON;
-
-#
-# The following is copied from http://bugs.mysql.com/36169
-# (http://bugs.mysql.com/file.php?id=9121)
-# Probably it can be simplified but that is not obvious.
-#
-
-# we care only that the following SQL commands do produce errors
-# as expected and do not crash the server
--- disable_query_log
--- disable_result_log
-
-# Generating 10 tables
-# Creating a table with 94 columns and 24 indexes
-DROP TABLE IF EXISTS `table0`;
---error ER_TOO_BIG_ROWSIZE
-CREATE TABLE IF NOT EXISTS `table0`
-(`col0` BOOL,
-`col1` BOOL,
-`col2` TINYINT,
-`col3` DATE,
-`col4` TIME,
-`col5` SET ('test1','test2','test3'),
-`col6` TIME,
-`col7` TEXT,
-`col8` DECIMAL,
-`col9` SET ('test1','test2','test3'),
-`col10` FLOAT,
-`col11` DOUBLE PRECISION,
-`col12` ENUM ('test1','test2','test3'),
-`col13` TINYBLOB,
-`col14` YEAR,
-`col15` SET ('test1','test2','test3'),
-`col16` NUMERIC,
-`col17` NUMERIC,
-`col18` BLOB,
-`col19` DATETIME,
-`col20` DOUBLE PRECISION,
-`col21` DECIMAL,
-`col22` DATETIME,
-`col23` NUMERIC,
-`col24` NUMERIC,
-`col25` LONGTEXT,
-`col26` TINYBLOB,
-`col27` TIME,
-`col28` TINYBLOB,
-`col29` ENUM ('test1','test2','test3'),
-`col30` SMALLINT,
-`col31` REAL,
-`col32` FLOAT,
-`col33` CHAR (175),
-`col34` TINYTEXT,
-`col35` TINYTEXT,
-`col36` TINYBLOB,
-`col37` TINYBLOB,
-`col38` TINYTEXT,
-`col39` MEDIUMBLOB,
-`col40` TIMESTAMP,
-`col41` DOUBLE,
-`col42` SMALLINT,
-`col43` LONGBLOB,
-`col44` VARCHAR (80),
-`col45` MEDIUMTEXT,
-`col46` NUMERIC,
-`col47` BIGINT,
-`col48` DATE,
-`col49` TINYBLOB,
-`col50` DATE,
-`col51` BOOL,
-`col52` MEDIUMINT,
-`col53` FLOAT,
-`col54` TINYBLOB,
-`col55` LONGTEXT,
-`col56` SMALLINT,
-`col57` ENUM ('test1','test2','test3'),
-`col58` DATETIME,
-`col59` MEDIUMTEXT,
-`col60` VARCHAR (232),
-`col61` NUMERIC,
-`col62` YEAR,
-`col63` SMALLINT,
-`col64` TIMESTAMP,
-`col65` BLOB,
-`col66` LONGBLOB,
-`col67` INT,
-`col68` LONGTEXT,
-`col69` ENUM ('test1','test2','test3'),
-`col70` INT,
-`col71` TIME,
-`col72` TIMESTAMP,
-`col73` TIMESTAMP,
-`col74` VARCHAR (170),
-`col75` SET ('test1','test2','test3'),
-`col76` TINYBLOB,
-`col77` BIGINT,
-`col78` NUMERIC,
-`col79` DATETIME,
-`col80` YEAR,
-`col81` NUMERIC,
-`col82` LONGBLOB,
-`col83` TEXT,
-`col84` CHAR (83),
-`col85` DECIMAL,
-`col86` FLOAT,
-`col87` INT,
-`col88` VARCHAR (145),
-`col89` DATE,
-`col90` DECIMAL,
-`col91` DECIMAL,
-`col92` MEDIUMBLOB,
-`col93` TIME,
-KEY `idx0` (`col69`,`col90`,`col8`),
-KEY `idx1` (`col60`),
-KEY `idx2` (`col60`,`col70`,`col74`),
-KEY `idx3` (`col22`,`col32`,`col72`,`col30`),
-KEY `idx4` (`col29`),
-KEY `idx5` (`col19`,`col45`(143)),
-KEY `idx6` (`col46`,`col48`,`col5`,`col39`(118)),
-KEY `idx7` (`col48`,`col61`),
-KEY `idx8` (`col93`),
-KEY `idx9` (`col31`),
-KEY `idx10` (`col30`,`col21`),
-KEY `idx11` (`col67`),
-KEY `idx12` (`col44`,`col6`,`col8`,`col38`(226)),
-KEY `idx13` (`col71`,`col41`,`col15`,`col49`(88)),
-KEY `idx14` (`col78`),
-KEY `idx15` (`col63`,`col67`,`col64`),
-KEY `idx16` (`col17`,`col86`),
-KEY `idx17` (`col77`,`col56`,`col10`,`col55`(24)),
-KEY `idx18` (`col62`),
-KEY `idx19` (`col31`,`col57`,`col56`,`col53`),
-KEY `idx20` (`col46`),
-KEY `idx21` (`col83`(54)),
-KEY `idx22` (`col51`,`col7`(120)),
-KEY `idx23` (`col7`(163),`col31`,`col71`,`col14`)
-)engine=innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
-
-# Creating a table with 10 columns and 32 indexes
-DROP TABLE IF EXISTS `table1`;
---error ER_TOO_BIG_ROWSIZE
-CREATE TABLE IF NOT EXISTS `table1`
-(`col0` CHAR (113),
-`col1` FLOAT,
-`col2` BIGINT,
-`col3` DECIMAL,
-`col4` BLOB,
-`col5` LONGTEXT,
-`col6` SET ('test1','test2','test3'),
-`col7` BIGINT,
-`col8` BIGINT,
-`col9` TINYBLOB,
-KEY `idx0` (`col5`(101),`col7`,`col8`),
-KEY `idx1` (`col8`),
-KEY `idx2` (`col4`(177),`col9`(126),`col6`,`col3`),
-KEY `idx3` (`col5`(160)),
-KEY `idx4` (`col9`(242)),
-KEY `idx5` (`col4`(139),`col2`,`col3`),
-KEY `idx6` (`col7`),
-KEY `idx7` (`col6`,`col2`,`col0`,`col3`),
-KEY `idx8` (`col9`(66)),
-KEY `idx9` (`col5`(253)),
-KEY `idx10` (`col1`,`col7`,`col2`),
-KEY `idx11` (`col9`(242),`col0`,`col8`,`col5`(163)),
-KEY `idx12` (`col8`),
-KEY `idx13` (`col0`,`col9`(37)),
-KEY `idx14` (`col0`),
-KEY `idx15` (`col5`(111)),
-KEY `idx16` (`col8`,`col0`,`col5`(13)),
-KEY `idx17` (`col4`(139)),
-KEY `idx18` (`col5`(189),`col2`,`col3`,`col9`(136)),
-KEY `idx19` (`col0`,`col3`,`col1`,`col8`),
-KEY `idx20` (`col8`),
-KEY `idx21` (`col0`,`col7`,`col9`(227),`col3`),
-KEY `idx22` (`col0`),
-KEY `idx23` (`col2`),
-KEY `idx24` (`col3`),
-KEY `idx25` (`col2`,`col3`),
-KEY `idx26` (`col0`),
-KEY `idx27` (`col5`(254)),
-KEY `idx28` (`col3`),
-KEY `idx29` (`col3`),
-KEY `idx30` (`col7`,`col3`,`col0`,`col4`(220)),
-KEY `idx31` (`col4`(1),`col0`)
-)engine=innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
-
-# Creating a table with 141 columns and 18 indexes
-DROP TABLE IF EXISTS `table2`;
---error ER_TOO_BIG_ROWSIZE
-CREATE TABLE IF NOT EXISTS `table2`
-(`col0` BOOL,
-`col1` MEDIUMINT,
-`col2` VARCHAR (209),
-`col3` MEDIUMBLOB,
-`col4` CHAR (13),
-`col5` DOUBLE,
-`col6` TINYTEXT,
-`col7` REAL,
-`col8` SMALLINT,
-`col9` BLOB,
-`col10` TINYINT,
-`col11` DECIMAL,
-`col12` BLOB,
-`col13` DECIMAL,
-`col14` LONGBLOB,
-`col15` SMALLINT,
-`col16` LONGBLOB,
-`col17` TINYTEXT,
-`col18` FLOAT,
-`col19` CHAR (78),
-`col20` MEDIUMTEXT,
-`col21` SET ('test1','test2','test3'),
-`col22` MEDIUMINT,
-`col23` INT,
-`col24` MEDIUMBLOB,
-`col25` ENUM ('test1','test2','test3'),
-`col26` TINYBLOB,
-`col27` VARCHAR (116),
-`col28` TIMESTAMP,
-`col29` BLOB,
-`col30` SMALLINT,
-`col31` DOUBLE PRECISION,
-`col32` DECIMAL,
-`col33` DECIMAL,
-`col34` TEXT,
-`col35` MEDIUMINT,
-`col36` MEDIUMINT,
-`col37` BIGINT,
-`col38` VARCHAR (253),
-`col39` TINYBLOB,
-`col40` MEDIUMBLOB,
-`col41` BIGINT,
-`col42` DOUBLE,
-`col43` TEXT,
-`col44` BLOB,
-`col45` TIME,
-`col46` MEDIUMINT,
-`col47` DOUBLE PRECISION,
-`col48` SET ('test1','test2','test3'),
-`col49` DOUBLE PRECISION,
-`col50` VARCHAR (97),
-`col51` TEXT,
-`col52` NUMERIC,
-`col53` ENUM ('test1','test2','test3'),
-`col54` MEDIUMTEXT,
-`col55` MEDIUMINT,
-`col56` DATETIME,
-`col57` DATETIME,
-`col58` MEDIUMTEXT,
-`col59` CHAR (244),
-`col60` LONGBLOB,
-`col61` MEDIUMBLOB,
-`col62` DOUBLE,
-`col63` SMALLINT,
-`col64` BOOL,
-`col65` SMALLINT,
-`col66` VARCHAR (212),
-`col67` TIME,
-`col68` REAL,
-`col69` BOOL,
-`col70` BIGINT,
-`col71` DATE,
-`col72` TINYINT,
-`col73` ENUM ('test1','test2','test3'),
-`col74` DATE,
-`col75` TIME,
-`col76` DATETIME,
-`col77` BOOL,
-`col78` TINYTEXT,
-`col79` MEDIUMINT,
-`col80` NUMERIC,
-`col81` LONGTEXT,
-`col82` SET ('test1','test2','test3'),
-`col83` DOUBLE PRECISION,
-`col84` NUMERIC,
-`col85` VARCHAR (184),
-`col86` DOUBLE PRECISION,
-`col87` MEDIUMTEXT,
-`col88` MEDIUMBLOB,
-`col89` BOOL,
-`col90` SMALLINT,
-`col91` TINYINT,
-`col92` ENUM ('test1','test2','test3'),
-`col93` BOOL,
-`col94` TIMESTAMP,
-`col95` BOOL,
-`col96` MEDIUMTEXT,
-`col97` DECIMAL,
-`col98` BOOL,
-`col99` DECIMAL,
-`col100` MEDIUMINT,
-`col101` DOUBLE PRECISION,
-`col102` TINYINT,
-`col103` BOOL,
-`col104` MEDIUMINT,
-`col105` DECIMAL,
-`col106` NUMERIC,
-`col107` TIMESTAMP,
-`col108` MEDIUMBLOB,
-`col109` TINYBLOB,
-`col110` SET ('test1','test2','test3'),
-`col111` YEAR,
-`col112` TIMESTAMP,
-`col113` CHAR (201),
-`col114` BOOL,
-`col115` TINYINT,
-`col116` DOUBLE,
-`col117` TINYINT,
-`col118` TIMESTAMP,
-`col119` SET ('test1','test2','test3'),
-`col120` SMALLINT,
-`col121` TINYBLOB,
-`col122` TIMESTAMP,
-`col123` BLOB,
-`col124` DATE,
-`col125` SMALLINT,
-`col126` ENUM ('test1','test2','test3'),
-`col127` MEDIUMBLOB,
-`col128` DOUBLE PRECISION,
-`col129` REAL,
-`col130` VARCHAR (159),
-`col131` MEDIUMBLOB,
-`col132` BIGINT,
-`col133` INT,
-`col134` SET ('test1','test2','test3'),
-`col135` CHAR (198),
-`col136` SET ('test1','test2','test3'),
-`col137` MEDIUMTEXT,
-`col138` SMALLINT,
-`col139` BLOB,
-`col140` LONGBLOB,
-KEY `idx0` (`col14`(139),`col24`(208),`col38`,`col35`),
-KEY `idx1` (`col48`,`col118`,`col29`(131),`col100`),
-KEY `idx2` (`col86`,`col67`,`col43`(175)),
-KEY `idx3` (`col19`),
-KEY `idx4` (`col40`(220),`col67`),
-KEY `idx5` (`col99`,`col56`),
-KEY `idx6` (`col68`,`col28`,`col137`(157)),
-KEY `idx7` (`col51`(160),`col99`,`col45`,`col39`(9)),
-KEY `idx8` (`col15`,`col52`,`col90`,`col94`),
-KEY `idx9` (`col24`(3),`col139`(248),`col108`(118),`col41`),
-KEY `idx10` (`col36`,`col92`,`col114`),
-KEY `idx11` (`col115`,`col9`(116)),
-KEY `idx12` (`col130`,`col93`,`col134`),
-KEY `idx13` (`col123`(65)),
-KEY `idx14` (`col44`(90),`col86`,`col119`),
-KEY `idx15` (`col69`),
-KEY `idx16` (`col132`,`col81`(118),`col18`),
-KEY `idx17` (`col24`(250),`col7`,`col92`,`col45`)
-)engine=innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
-
-# Creating a table with 199 columns and 1 indexes
-DROP TABLE IF EXISTS `table3`;
---error ER_TOO_BIG_ROWSIZE
-CREATE TABLE IF NOT EXISTS `table3`
-(`col0` SMALLINT,
-`col1` SET ('test1','test2','test3'),
-`col2` TINYTEXT,
-`col3` DOUBLE,
-`col4` NUMERIC,
-`col5` DATE,
-`col6` BIGINT,
-`col7` DOUBLE,
-`col8` TEXT,
-`col9` INT,
-`col10` REAL,
-`col11` TINYINT,
-`col12` NUMERIC,
-`col13` NUMERIC,
-`col14` TIME,
-`col15` DOUBLE,
-`col16` REAL,
-`col17` MEDIUMBLOB,
-`col18` YEAR,
-`col19` TINYTEXT,
-`col20` YEAR,
-`col21` CHAR (250),
-`col22` TINYINT,
-`col23` TINYINT,
-`col24` SMALLINT,
-`col25` DATETIME,
-`col26` MEDIUMINT,
-`col27` LONGBLOB,
-`col28` VARCHAR (106),
-`col29` FLOAT,
-`col30` MEDIUMTEXT,
-`col31` TINYBLOB,
-`col32` BIGINT,
-`col33` YEAR,
-`col34` REAL,
-`col35` MEDIUMBLOB,
-`col36` LONGTEXT,
-`col37` LONGBLOB,
-`col38` BIGINT,
-`col39` FLOAT,
-`col40` TIME,
-`col41` DATETIME,
-`col42` BOOL,
-`col43` BIGINT,
-`col44` SMALLINT,
-`col45` TIME,
-`col46` DOUBLE PRECISION,
-`col47` TIME,
-`col48` TINYTEXT,
-`col49` DOUBLE PRECISION,
-`col50` BIGINT,
-`col51` NUMERIC,
-`col52` TINYBLOB,
-`col53` DATE,
-`col54` DECIMAL,
-`col55` SMALLINT,
-`col56` TINYTEXT,
-`col57` ENUM ('test1','test2','test3'),
-`col58` YEAR,
-`col59` TIME,
-`col60` TINYINT,
-`col61` DECIMAL,
-`col62` DOUBLE,
-`col63` DATE,
-`col64` LONGTEXT,
-`col65` DOUBLE,
-`col66` VARCHAR (88),
-`col67` MEDIUMTEXT,
-`col68` DATE,
-`col69` MEDIUMINT,
-`col70` DECIMAL,
-`col71` MEDIUMTEXT,
-`col72` LONGTEXT,
-`col73` REAL,
-`col74` DOUBLE,
-`col75` TIME,
-`col76` DATE,
-`col77` DECIMAL,
-`col78` MEDIUMBLOB,
-`col79` NUMERIC,
-`col80` BIGINT,
-`col81` YEAR,
-`col82` SMALLINT,
-`col83` MEDIUMINT,
-`col84` TINYINT,
-`col85` MEDIUMBLOB,
-`col86` TIME,
-`col87` MEDIUMBLOB,
-`col88` LONGTEXT,
-`col89` BOOL,
-`col90` BLOB,
-`col91` LONGBLOB,
-`col92` YEAR,
-`col93` BLOB,
-`col94` INT,
-`col95` TINYTEXT,
-`col96` TINYINT,
-`col97` DECIMAL,
-`col98` ENUM ('test1','test2','test3'),
-`col99` MEDIUMINT,
-`col100` TINYINT,
-`col101` MEDIUMBLOB,
-`col102` TINYINT,
-`col103` SET ('test1','test2','test3'),
-`col104` TIMESTAMP,
-`col105` TEXT,
-`col106` DATETIME,
-`col107` MEDIUMTEXT,
-`col108` CHAR (220),
-`col109` TIME,
-`col110` VARCHAR (131),
-`col111` DECIMAL,
-`col112` FLOAT,
-`col113` SMALLINT,
-`col114` BIGINT,
-`col115` LONGBLOB,
-`col116` SET ('test1','test2','test3'),
-`col117` ENUM ('test1','test2','test3'),
-`col118` BLOB,
-`col119` MEDIUMTEXT,
-`col120` SET ('test1','test2','test3'),
-`col121` DATETIME,
-`col122` FLOAT,
-`col123` VARCHAR (242),
-`col124` YEAR,
-`col125` MEDIUMBLOB,
-`col126` TIME,
-`col127` BOOL,
-`col128` TINYBLOB,
-`col129` DOUBLE,
-`col130` TINYINT,
-`col131` BIGINT,
-`col132` SMALLINT,
-`col133` INT,
-`col134` DOUBLE PRECISION,
-`col135` MEDIUMBLOB,
-`col136` SET ('test1','test2','test3'),
-`col137` TINYTEXT,
-`col138` DOUBLE PRECISION,
-`col139` NUMERIC,
-`col140` BLOB,
-`col141` SET ('test1','test2','test3'),
-`col142` INT,
-`col143` VARCHAR (26),
-`col144` BLOB,
-`col145` REAL,
-`col146` SET ('test1','test2','test3'),
-`col147` LONGBLOB,
-`col148` TEXT,
-`col149` BLOB,
-`col150` CHAR (189),
-`col151` LONGTEXT,
-`col152` INT,
-`col153` FLOAT,
-`col154` LONGTEXT,
-`col155` DATE,
-`col156` LONGBLOB,
-`col157` TINYBLOB,
-`col158` REAL,
-`col159` DATE,
-`col160` TIME,
-`col161` YEAR,
-`col162` DOUBLE,
-`col163` VARCHAR (90),
-`col164` FLOAT,
-`col165` NUMERIC,
-`col166` ENUM ('test1','test2','test3'),
-`col167` DOUBLE PRECISION,
-`col168` DOUBLE PRECISION,
-`col169` TINYBLOB,
-`col170` TIME,
-`col171` SMALLINT,
-`col172` TINYTEXT,
-`col173` SMALLINT,
-`col174` DOUBLE,
-`col175` VARCHAR (14),
-`col176` VARCHAR (90),
-`col177` REAL,
-`col178` MEDIUMINT,
-`col179` TINYBLOB,
-`col180` FLOAT,
-`col181` TIMESTAMP,
-`col182` REAL,
-`col183` DOUBLE PRECISION,
-`col184` BIGINT,
-`col185` INT,
-`col186` MEDIUMTEXT,
-`col187` TIME,
-`col188` FLOAT,
-`col189` TIME,
-`col190` INT,
-`col191` FLOAT,
-`col192` MEDIUMINT,
-`col193` TINYINT,
-`col194` MEDIUMTEXT,
-`col195` DATE,
-`col196` TIME,
-`col197` YEAR,
-`col198` CHAR (206),
-KEY `idx0` (`col39`,`col23`)
-)engine=innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
-
-# Creating a table with 133 columns and 16 indexes
-DROP TABLE IF EXISTS `table4`;
---error ER_TOO_BIG_ROWSIZE
-CREATE TABLE IF NOT EXISTS `table4`
-(`col0` VARCHAR (60),
-`col1` NUMERIC,
-`col2` LONGTEXT,
-`col3` MEDIUMTEXT,
-`col4` LONGTEXT,
-`col5` LONGBLOB,
-`col6` LONGBLOB,
-`col7` DATETIME,
-`col8` TINYTEXT,
-`col9` BLOB,
-`col10` BOOL,
-`col11` BIGINT,
-`col12` TEXT,
-`col13` VARCHAR (213),
-`col14` TINYBLOB,
-`col15` BOOL,
-`col16` MEDIUMTEXT,
-`col17` DOUBLE,
-`col18` TEXT,
-`col19` BLOB,
-`col20` SET ('test1','test2','test3'),
-`col21` TINYINT,
-`col22` DATETIME,
-`col23` TINYINT,
-`col24` ENUM ('test1','test2','test3'),
-`col25` REAL,
-`col26` BOOL,
-`col27` FLOAT,
-`col28` LONGBLOB,
-`col29` DATETIME,
-`col30` FLOAT,
-`col31` SET ('test1','test2','test3'),
-`col32` LONGBLOB,
-`col33` NUMERIC,
-`col34` YEAR,
-`col35` VARCHAR (146),
-`col36` BIGINT,
-`col37` DATETIME,
-`col38` DATE,
-`col39` SET ('test1','test2','test3'),
-`col40` CHAR (112),
-`col41` FLOAT,
-`col42` YEAR,
-`col43` TIME,
-`col44` DOUBLE,
-`col45` NUMERIC,
-`col46` FLOAT,
-`col47` DECIMAL,
-`col48` BIGINT,
-`col49` DECIMAL,
-`col50` YEAR,
-`col51` MEDIUMTEXT,
-`col52` LONGBLOB,
-`col53` SET ('test1','test2','test3'),
-`col54` BLOB,
-`col55` FLOAT,
-`col56` REAL,
-`col57` REAL,
-`col58` TEXT,
-`col59` MEDIUMBLOB,
-`col60` INT,
-`col61` INT,
-`col62` DATE,
-`col63` TEXT,
-`col64` DATE,
-`col65` ENUM ('test1','test2','test3'),
-`col66` DOUBLE PRECISION,
-`col67` TINYTEXT,
-`col68` TINYBLOB,
-`col69` FLOAT,
-`col70` BLOB,
-`col71` DATETIME,
-`col72` DOUBLE,
-`col73` LONGTEXT,
-`col74` TIME,
-`col75` DATETIME,
-`col76` VARCHAR (122),
-`col77` MEDIUMTEXT,
-`col78` MEDIUMTEXT,
-`col79` BOOL,
-`col80` LONGTEXT,
-`col81` TINYTEXT,
-`col82` NUMERIC,
-`col83` DOUBLE PRECISION,
-`col84` DATE,
-`col85` YEAR,
-`col86` BLOB,
-`col87` TINYTEXT,
-`col88` DOUBLE PRECISION,
-`col89` MEDIUMINT,
-`col90` MEDIUMTEXT,
-`col91` NUMERIC,
-`col92` DATETIME,
-`col93` NUMERIC,
-`col94` SET ('test1','test2','test3'),
-`col95` TINYTEXT,
-`col96` SET ('test1','test2','test3'),
-`col97` YEAR,
-`col98` MEDIUMINT,
-`col99` TEXT,
-`col100` TEXT,
-`col101` TIME,
-`col102` VARCHAR (225),
-`col103` TINYTEXT,
-`col104` TEXT,
-`col105` MEDIUMTEXT,
-`col106` TINYINT,
-`col107` TEXT,
-`col108` LONGBLOB,
-`col109` LONGTEXT,
-`col110` TINYTEXT,
-`col111` CHAR (56),
-`col112` YEAR,
-`col113` ENUM ('test1','test2','test3'),
-`col114` TINYBLOB,
-`col115` DATETIME,
-`col116` DATE,
-`col117` TIME,
-`col118` MEDIUMTEXT,
-`col119` DOUBLE PRECISION,
-`col120` FLOAT,
-`col121` TIMESTAMP,
-`col122` MEDIUMINT,
-`col123` YEAR,
-`col124` DATE,
-`col125` TEXT,
-`col126` FLOAT,
-`col127` TINYTEXT,
-`col128` BOOL,
-`col129` NUMERIC,
-`col130` TIMESTAMP,
-`col131` INT,
-`col132` MEDIUMBLOB,
-KEY `idx0` (`col130`),
-KEY `idx1` (`col30`,`col55`,`col19`(31)),
-KEY `idx2` (`col104`(186)),
-KEY `idx3` (`col131`),
-KEY `idx4` (`col64`,`col93`,`col2`(11)),
-KEY `idx5` (`col34`,`col121`,`col22`),
-KEY `idx6` (`col33`,`col55`,`col83`),
-KEY `idx7` (`col17`,`col87`(245),`col99`(17)),
-KEY `idx8` (`col65`,`col120`),
-KEY `idx9` (`col82`),
-KEY `idx10` (`col9`(72)),
-KEY `idx11` (`col88`),
-KEY `idx12` (`col128`,`col9`(200),`col71`,`col66`),
-KEY `idx13` (`col77`(126)),
-KEY `idx14` (`col105`(26),`col13`,`col117`),
-KEY `idx15` (`col4`(246),`col130`,`col115`,`col3`(141))
-)engine=innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
-
-# Creating a table with 176 columns and 13 indexes
-DROP TABLE IF EXISTS `table5`;
---error ER_TOO_BIG_ROWSIZE
-CREATE TABLE IF NOT EXISTS `table5`
-(`col0` MEDIUMTEXT,
-`col1` VARCHAR (90),
-`col2` TINYTEXT,
-`col3` TIME,
-`col4` BOOL,
-`col5` TINYTEXT,
-`col6` BOOL,
-`col7` TIMESTAMP,
-`col8` TINYBLOB,
-`col9` TINYINT,
-`col10` YEAR,
-`col11` SET ('test1','test2','test3'),
-`col12` TEXT,
-`col13` CHAR (248),
-`col14` BIGINT,
-`col15` TEXT,
-`col16` TINYINT,
-`col17` NUMERIC,
-`col18` SET ('test1','test2','test3'),
-`col19` LONGBLOB,
-`col20` FLOAT,
-`col21` INT,
-`col22` TEXT,
-`col23` BOOL,
-`col24` DECIMAL,
-`col25` DOUBLE PRECISION,
-`col26` FLOAT,
-`col27` TINYBLOB,
-`col28` NUMERIC,
-`col29` MEDIUMBLOB,
-`col30` DATE,
-`col31` LONGTEXT,
-`col32` DATE,
-`col33` FLOAT,
-`col34` BIGINT,
-`col35` TINYTEXT,
-`col36` MEDIUMTEXT,
-`col37` TIME,
-`col38` INT,
-`col39` TINYINT,
-`col40` SET ('test1','test2','test3'),
-`col41` CHAR (130),
-`col42` SMALLINT,
-`col43` INT,
-`col44` MEDIUMTEXT,
-`col45` VARCHAR (126),
-`col46` INT,
-`col47` DOUBLE PRECISION,
-`col48` BIGINT,
-`col49` MEDIUMTEXT,
-`col50` TINYBLOB,
-`col51` MEDIUMINT,
-`col52` TEXT,
-`col53` VARCHAR (208),
-`col54` VARCHAR (207),
-`col55` NUMERIC,
-`col56` DATETIME,
-`col57` ENUM ('test1','test2','test3'),
-`col58` NUMERIC,
-`col59` TINYBLOB,
-`col60` VARCHAR (73),
-`col61` MEDIUMTEXT,
-`col62` TINYBLOB,
-`col63` DATETIME,
-`col64` NUMERIC,
-`col65` MEDIUMINT,
-`col66` DATETIME,
-`col67` NUMERIC,
-`col68` TINYINT,
-`col69` VARCHAR (58),
-`col70` DECIMAL,
-`col71` MEDIUMTEXT,
-`col72` DATE,
-`col73` TIME,
-`col74` DOUBLE PRECISION,
-`col75` DECIMAL,
-`col76` MEDIUMBLOB,
-`col77` REAL,
-`col78` YEAR,
-`col79` YEAR,
-`col80` LONGBLOB,
-`col81` BLOB,
-`col82` BIGINT,
-`col83` ENUM ('test1','test2','test3'),
-`col84` NUMERIC,
-`col85` SET ('test1','test2','test3'),
-`col86` MEDIUMTEXT,
-`col87` LONGBLOB,
-`col88` TIME,
-`col89` ENUM ('test1','test2','test3'),
-`col90` DECIMAL,
-`col91` FLOAT,
-`col92` DATETIME,
-`col93` TINYTEXT,
-`col94` TIMESTAMP,
-`col95` TIMESTAMP,
-`col96` TEXT,
-`col97` REAL,
-`col98` VARCHAR (198),
-`col99` TIME,
-`col100` TINYINT,
-`col101` BIGINT,
-`col102` LONGBLOB,
-`col103` LONGBLOB,
-`col104` MEDIUMINT,
-`col105` MEDIUMTEXT,
-`col106` TIMESTAMP,
-`col107` SMALLINT,
-`col108` NUMERIC,
-`col109` DECIMAL,
-`col110` FLOAT,
-`col111` DECIMAL,
-`col112` REAL,
-`col113` TINYTEXT,
-`col114` FLOAT,
-`col115` VARCHAR (7),
-`col116` LONGTEXT,
-`col117` DATE,
-`col118` BIGINT,
-`col119` TEXT,
-`col120` BIGINT,
-`col121` BLOB,
-`col122` CHAR (110),
-`col123` NUMERIC,
-`col124` MEDIUMBLOB,
-`col125` NUMERIC,
-`col126` NUMERIC,
-`col127` BOOL,
-`col128` TIME,
-`col129` TINYBLOB,
-`col130` TINYBLOB,
-`col131` DATE,
-`col132` INT,
-`col133` VARCHAR (123),
-`col134` CHAR (238),
-`col135` VARCHAR (225),
-`col136` LONGTEXT,
-`col137` LONGBLOB,
-`col138` REAL,
-`col139` TINYBLOB,
-`col140` DATETIME,
-`col141` TINYTEXT,
-`col142` LONGBLOB,
-`col143` BIGINT,
-`col144` VARCHAR (236),
-`col145` TEXT,
-`col146` YEAR,
-`col147` DECIMAL,
-`col148` TEXT,
-`col149` MEDIUMBLOB,
-`col150` TINYINT,
-`col151` BOOL,
-`col152` VARCHAR (72),
-`col153` INT,
-`col154` VARCHAR (165),
-`col155` TINYINT,
-`col156` MEDIUMTEXT,
-`col157` DOUBLE PRECISION,
-`col158` TIME,
-`col159` MEDIUMBLOB,
-`col160` LONGBLOB,
-`col161` DATETIME,
-`col162` DOUBLE PRECISION,
-`col163` BLOB,
-`col164` ENUM ('test1','test2','test3'),
-`col165` TIMESTAMP,
-`col166` DATE,
-`col167` TINYBLOB,
-`col168` TINYBLOB,
-`col169` LONGBLOB,
-`col170` DATETIME,
-`col171` BIGINT,
-`col172` VARCHAR (30),
-`col173` LONGTEXT,
-`col174` TIME,
-`col175` FLOAT,
-KEY `idx0` (`col16`,`col156`(139),`col97`,`col120`),
-KEY `idx1` (`col24`,`col0`(108)),
-KEY `idx2` (`col117`,`col173`(34),`col132`,`col82`),
-KEY `idx3` (`col2`(86)),
-KEY `idx4` (`col2`(43)),
-KEY `idx5` (`col83`,`col35`(87),`col111`),
-KEY `idx6` (`col6`,`col134`,`col92`),
-KEY `idx7` (`col56`),
-KEY `idx8` (`col30`,`col53`,`col129`(66)),
-KEY `idx9` (`col53`,`col113`(211),`col32`,`col15`(75)),
-KEY `idx10` (`col34`),
-KEY `idx11` (`col126`),
-KEY `idx12` (`col24`)
-)engine=innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
-
-# Creating a table with 179 columns and 46 indexes
-DROP TABLE IF EXISTS `table6`;
--- error ER_TOO_BIG_ROWSIZE
---error ER_TOO_BIG_ROWSIZE
-CREATE TABLE IF NOT EXISTS `table6`
-(`col0` ENUM ('test1','test2','test3'),
-`col1` MEDIUMBLOB,
-`col2` MEDIUMBLOB,
-`col3` DATETIME,
-`col4` DATE,
-`col5` YEAR,
-`col6` REAL,
-`col7` NUMERIC,
-`col8` MEDIUMBLOB,
-`col9` TEXT,
-`col10` TIMESTAMP,
-`col11` DOUBLE,
-`col12` DOUBLE,
-`col13` SMALLINT,
-`col14` TIMESTAMP,
-`col15` DECIMAL,
-`col16` DATE,
-`col17` TEXT,
-`col18` LONGBLOB,
-`col19` BIGINT,
-`col20` FLOAT,
-`col21` DATETIME,
-`col22` TINYINT,
-`col23` MEDIUMBLOB,
-`col24` SET ('test1','test2','test3'),
-`col25` TIME,
-`col26` TEXT,
-`col27` LONGTEXT,
-`col28` BIGINT,
-`col29` REAL,
-`col30` YEAR,
-`col31` MEDIUMBLOB,
-`col32` MEDIUMINT,
-`col33` FLOAT,
-`col34` TEXT,
-`col35` DATE,
-`col36` TIMESTAMP,
-`col37` REAL,
-`col38` BLOB,
-`col39` BLOB,
-`col40` BLOB,
-`col41` TINYBLOB,
-`col42` INT,
-`col43` TINYINT,
-`col44` REAL,
-`col45` BIGINT,
-`col46` TIMESTAMP,
-`col47` BLOB,
-`col48` ENUM ('test1','test2','test3'),
-`col49` BOOL,
-`col50` CHAR (109),
-`col51` DOUBLE,
-`col52` DOUBLE PRECISION,
-`col53` ENUM ('test1','test2','test3'),
-`col54` FLOAT,
-`col55` DOUBLE PRECISION,
-`col56` CHAR (166),
-`col57` TEXT,
-`col58` TIME,
-`col59` DECIMAL,
-`col60` TEXT,
-`col61` ENUM ('test1','test2','test3'),
-`col62` LONGTEXT,
-`col63` YEAR,
-`col64` DOUBLE,
-`col65` CHAR (87),
-`col66` DATE,
-`col67` BOOL,
-`col68` MEDIUMBLOB,
-`col69` DATETIME,
-`col70` DECIMAL,
-`col71` TIME,
-`col72` REAL,
-`col73` LONGTEXT,
-`col74` BLOB,
-`col75` REAL,
-`col76` INT,
-`col77` INT,
-`col78` FLOAT,
-`col79` DOUBLE,
-`col80` MEDIUMINT,
-`col81` ENUM ('test1','test2','test3'),
-`col82` VARCHAR (221),
-`col83` BIGINT,
-`col84` TINYINT,
-`col85` BIGINT,
-`col86` FLOAT,
-`col87` MEDIUMBLOB,
-`col88` CHAR (126),
-`col89` MEDIUMBLOB,
-`col90` DATETIME,
-`col91` TINYINT,
-`col92` DOUBLE,
-`col93` NUMERIC,
-`col94` DATE,
-`col95` BLOB,
-`col96` DATETIME,
-`col97` TIME,
-`col98` LONGBLOB,
-`col99` INT,
-`col100` SET ('test1','test2','test3'),
-`col101` TINYBLOB,
-`col102` INT,
-`col103` MEDIUMBLOB,
-`col104` MEDIUMTEXT,
-`col105` FLOAT,
-`col106` TINYBLOB,
-`col107` VARCHAR (26),
-`col108` TINYINT,
-`col109` TIME,
-`col110` TINYBLOB,
-`col111` LONGBLOB,
-`col112` TINYTEXT,
-`col113` FLOAT,
-`col114` TINYINT,
-`col115` NUMERIC,
-`col116` TIME,
-`col117` SET ('test1','test2','test3'),
-`col118` DATE,
-`col119` SMALLINT,
-`col120` BLOB,
-`col121` TINYTEXT,
-`col122` REAL,
-`col123` YEAR,
-`col124` REAL,
-`col125` BOOL,
-`col126` BLOB,
-`col127` REAL,
-`col128` MEDIUMBLOB,
-`col129` TIMESTAMP,
-`col130` LONGBLOB,
-`col131` MEDIUMBLOB,
-`col132` YEAR,
-`col133` YEAR,
-`col134` INT,
-`col135` MEDIUMINT,
-`col136` MEDIUMINT,
-`col137` TINYTEXT,
-`col138` TINYBLOB,
-`col139` BLOB,
-`col140` SET ('test1','test2','test3'),
-`col141` ENUM ('test1','test2','test3'),
-`col142` ENUM ('test1','test2','test3'),
-`col143` TINYTEXT,
-`col144` DATETIME,
-`col145` TEXT,
-`col146` DOUBLE PRECISION,
-`col147` DECIMAL,
-`col148` MEDIUMTEXT,
-`col149` TINYTEXT,
-`col150` SET ('test1','test2','test3'),
-`col151` MEDIUMTEXT,
-`col152` CHAR (126),
-`col153` DOUBLE,
-`col154` CHAR (243),
-`col155` SET ('test1','test2','test3'),
-`col156` SET ('test1','test2','test3'),
-`col157` DATETIME,
-`col158` DOUBLE,
-`col159` NUMERIC,
-`col160` DECIMAL,
-`col161` FLOAT,
-`col162` LONGBLOB,
-`col163` LONGTEXT,
-`col164` INT,
-`col165` TIME,
-`col166` CHAR (27),
-`col167` VARCHAR (63),
-`col168` TEXT,
-`col169` TINYBLOB,
-`col170` TINYBLOB,
-`col171` ENUM ('test1','test2','test3'),
-`col172` INT,
-`col173` TIME,
-`col174` DECIMAL,
-`col175` DOUBLE,
-`col176` MEDIUMBLOB,
-`col177` LONGBLOB,
-`col178` CHAR (43),
-KEY `idx0` (`col131`(219)),
-KEY `idx1` (`col67`,`col122`,`col59`,`col87`(33)),
-KEY `idx2` (`col83`,`col42`,`col57`(152)),
-KEY `idx3` (`col106`(124)),
-KEY `idx4` (`col173`,`col80`,`col165`,`col89`(78)),
-KEY `idx5` (`col174`,`col145`(108),`col23`(228),`col141`),
-KEY `idx6` (`col157`,`col140`),
-KEY `idx7` (`col130`(188),`col15`),
-KEY `idx8` (`col52`),
-KEY `idx9` (`col144`),
-KEY `idx10` (`col155`),
-KEY `idx11` (`col62`(230),`col1`(109)),
-KEY `idx12` (`col151`(24),`col95`(85)),
-KEY `idx13` (`col114`),
-KEY `idx14` (`col42`,`col98`(56),`col146`),
-KEY `idx15` (`col147`,`col39`(254),`col35`),
-KEY `idx16` (`col79`),
-KEY `idx17` (`col65`),
-KEY `idx18` (`col149`(165),`col168`(119),`col32`,`col117`),
-KEY `idx19` (`col64`),
-KEY `idx20` (`col93`),
-KEY `idx21` (`col64`,`col113`,`col104`(182)),
-KEY `idx22` (`col52`,`col111`(189)),
-KEY `idx23` (`col45`),
-KEY `idx24` (`col154`,`col107`,`col110`(159)),
-KEY `idx25` (`col149`(1),`col87`(131)),
-KEY `idx26` (`col58`,`col115`,`col63`),
-KEY `idx27` (`col95`(9),`col0`,`col87`(113)),
-KEY `idx28` (`col92`,`col130`(1)),
-KEY `idx29` (`col151`(129),`col137`(254),`col13`),
-KEY `idx30` (`col49`),
-KEY `idx31` (`col28`),
-KEY `idx32` (`col83`,`col146`),
-KEY `idx33` (`col155`,`col90`,`col17`(245)),
-KEY `idx34` (`col174`,`col169`(44),`col107`),
-KEY `idx35` (`col113`),
-KEY `idx36` (`col52`),
-KEY `idx37` (`col16`,`col120`(190)),
-KEY `idx38` (`col28`),
-KEY `idx39` (`col131`(165)),
-KEY `idx40` (`col135`,`col26`(86)),
-KEY `idx41` (`col69`,`col94`),
-KEY `idx42` (`col105`,`col151`(38),`col97`),
-KEY `idx43` (`col88`),
-KEY `idx44` (`col176`(100),`col42`,`col73`(189),`col94`),
-KEY `idx45` (`col2`(27),`col27`(116))
-)engine=innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
-
-DROP TABLE IF EXISTS table0;
-DROP TABLE IF EXISTS table1;
-DROP TABLE IF EXISTS table2;
-DROP TABLE IF EXISTS table3;
-DROP TABLE IF EXISTS table4;
-DROP TABLE IF EXISTS table5;
-DROP TABLE IF EXISTS table6;
-
-SET GLOBAL innodb_file_per_table=DEFAULT;
-SET GLOBAL innodb_file_format='Antelope';
-SET GLOBAL innodb_file_format_check='Antelope';
diff --git a/mysql-test/suite/innodb/t/innodb_bug36172.test b/mysql-test/suite/innodb/t/innodb_bug36172.test
deleted file mode 100644
index 9e1308d5fc3..00000000000
--- a/mysql-test/suite/innodb/t/innodb_bug36172.test
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# Test case for bug 36172
-#
-
--- source include/not_embedded.inc
--- source include/have_innodb.inc
--- source suite/innodb/include/have_innodb_plugin.inc
-
-SET storage_engine=InnoDB;
-
-# we do not really care about what gets printed, we are only
-# interested in getting success or failure according to our
-# expectations
-
--- disable_query_log
--- disable_result_log
-
-SET GLOBAL innodb_file_format='Barracuda';
-SET GLOBAL innodb_file_per_table=on;
-
-DROP TABLE IF EXISTS `table0`;
-CREATE TABLE `table0` ( `col0` tinyint(1) DEFAULT NULL, `col1` tinyint(1) DEFAULT NULL, `col2` tinyint(4) DEFAULT NULL, `col3` date DEFAULT NULL, `col4` time DEFAULT NULL, `col5` set('test1','test2','test3') DEFAULT NULL, `col6` time DEFAULT NULL, `col7` text, `col8` decimal(10,0) DEFAULT NULL, `col9` set('test1','test2','test3') DEFAULT NULL, `col10` float DEFAULT NULL, `col11` double DEFAULT NULL, `col12` enum('test1','test2','test3') DEFAULT NULL, `col13` tinyblob, `col14` year(4) DEFAULT NULL, `col15` set('test1','test2','test3') DEFAULT NULL, `col16` decimal(10,0) DEFAULT NULL, `col17` decimal(10,0) DEFAULT NULL, `col18` blob, `col19` datetime DEFAULT NULL, `col20` double DEFAULT NULL, `col21` decimal(10,0) DEFAULT NULL, `col22` datetime DEFAULT NULL, `col23` decimal(10,0) DEFAULT NULL, `col24` decimal(10,0) DEFAULT NULL, `col25` longtext, `col26` tinyblob, `col27` time DEFAULT NULL, `col28` tinyblob, `col29` enum('test1','test2','test3') DEFAULT NULL, `col30` smallint(6) DEFAULT NULL, `col31` double DEFAULT NULL, `col32` float DEFAULT NULL, `col33` char(175) DEFAULT NULL, `col34` tinytext, `col35` tinytext, `col36` tinyblob, `col37` tinyblob, `col38` tinytext, `col39` mediumblob, `col40` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `col41` double DEFAULT NULL, `col42` smallint(6) DEFAULT NULL, `col43` longblob, `col44` varchar(80) DEFAULT NULL, `col45` mediumtext, `col46` decimal(10,0) DEFAULT NULL, `col47` bigint(20) DEFAULT NULL, `col48` date DEFAULT NULL, `col49` tinyblob, `col50` date DEFAULT NULL, `col51` tinyint(1) DEFAULT NULL, `col52` mediumint(9) DEFAULT NULL, `col53` float DEFAULT NULL, `col54` tinyblob, `col55` longtext, `col56` smallint(6) DEFAULT NULL, `col57` enum('test1','test2','test3') DEFAULT NULL, `col58` datetime DEFAULT NULL, `col59` mediumtext, `col60` varchar(232) DEFAULT NULL, `col61` decimal(10,0) DEFAULT NULL, `col62` year(4) DEFAULT NULL, `col63` smallint(6) DEFAULT NULL, `col64` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `col65` blob, `col66` longblob, `col67` int(11) DEFAULT NULL, `col68` longtext, `col69` enum('test1','test2','test3') DEFAULT NULL, `col70` int(11) DEFAULT NULL, `col71` time DEFAULT NULL, `col72` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `col73` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `col74` varchar(170) DEFAULT NULL, `col75` set('test1','test2','test3') DEFAULT NULL, `col76` tinyblob, `col77` bigint(20) DEFAULT NULL, `col78` decimal(10,0) DEFAULT NULL, `col79` datetime DEFAULT NULL, `col80` year(4) DEFAULT NULL, `col81` decimal(10,0) DEFAULT NULL, `col82` longblob, `col83` text, `col84` char(83) DEFAULT NULL, `col85` decimal(10,0) DEFAULT NULL, `col86` float DEFAULT NULL, `col87` int(11) DEFAULT NULL, `col88` varchar(145) DEFAULT NULL, `col89` date DEFAULT NULL, `col90` decimal(10,0) DEFAULT NULL, `col91` decimal(10,0) DEFAULT NULL, `col92` mediumblob, `col93` time DEFAULT NULL, KEY `idx0` (`col69`,`col90`,`col8`), KEY `idx1` (`col60`), KEY `idx2` (`col60`,`col70`,`col74`), KEY `idx3` (`col22`,`col32`,`col72`,`col30`), KEY `idx4` (`col29`), KEY `idx5` (`col19`,`col45`(143)), KEY `idx6` (`col46`,`col48`,`col5`,`col39`(118)), KEY `idx7` (`col48`,`col61`), KEY `idx8` (`col93`), KEY `idx9` (`col31`), KEY `idx10` (`col30`,`col21`), KEY `idx11` (`col67`), KEY `idx12` (`col44`,`col6`,`col8`,`col38`(226)), KEY `idx13` (`col71`,`col41`,`col15`,`col49`(88)), KEY `idx14` (`col78`), KEY `idx15` (`col63`,`col67`,`col64`), KEY `idx16` (`col17`,`col86`), KEY `idx17` (`col77`,`col56`,`col10`,`col55`(24)), KEY `idx18` (`col62`), KEY `idx19` (`col31`,`col57`,`col56`,`col53`), KEY `idx20` (`col46`), KEY `idx21` (`col83`(54)), KEY `idx22` (`col51`,`col7`(120)), KEY `idx23` (`col7`(163),`col31`,`col71`,`col14`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
-insert ignore into `table0` set `col23` = 7887371.5084383683, `col24` = 4293854615.6906948000, `col25` = 'vitalist', `col26` = 'widespread', `col27` = '3570490', `col28` = 'habitual', `col30` = -5471, `col31` = 4286985783.6771750000, `col32` = 6354540.9826654866, `col33` = 'defoliation', `col34` = 'logarithms', `col35` = 'tegument\'s', `col36` = 'scouting\'s', `col37` = 'intermittency', `col38` = 'elongates', `col39` = 'prophecies', `col40` = '20560103035939', `col41` = 4292809130.0544143000, `col42` = 22057, `col43` = 'Hess\'s', `col44` = 'bandstand', `col45` = 'phenylketonuria', `col46` = 6338767.4018677324, `col47` = 5310247, `col48` = '12592418', `col49` = 'churchman\'s', `col50` = '32226125', `col51` = -58, `col52` = -6207968, `col53` = 1244839.3255104220, `col54` = 'robotized', `col55` = 'monotonous', `col56` = -26909, `col58` = '20720107023550', `col59` = 'suggestiveness\'s', `col60` = 'gemology', `col61` = 4287800670.2229986000, `col62` = '1944', `col63` = -16827, `col64` = '20700107212324', `col65` = 'Nicolais', `col66` = 'apteryx', `col67` = 6935317, `col68` = 'stroganoff', `col70` = 3316430, `col71` = '3277608', `col72` = '19300511045918', `col73` = '20421201003327', `col74` = 'attenuant', `col75` = '15173', `col76` = 'upstroke\'s', `col77` = 8118987, `col78` = 6791516.2735374002, `col79` = '20780701144624', `col80` = '2134', `col81` = 4290682351.3127537000, `col82` = 'unexplainably', `col83` = 'Storm', `col84` = 'Greyso\'s', `col85` = 4289119212.4306774000, `col86` = 7617575.8796655172, `col87` = -6325335, `col88` = 'fondue\'s', `col89` = '40608940', `col90` = 1659421.8093508712, `col91` = 8346904.6584368423, `col92` = 'reloads', `col93` = '5188366';
-CHECK TABLE table0 EXTENDED;
-INSERT IGNORE INTO `table0` SET `col19` = '19940127002709', `col20` = 2383927.9055146948, `col21` = 4293243420.5621204000, `col22` = '20511211123705', `col23` = 4289899778.6573381000, `col24` = 4293449279.0540481000, `col25` = 'emphysemic', `col26` = 'dentally', `col27` = '2347406', `col28` = 'eruct', `col30` = 1222, `col31` = 4294372994.9941406000, `col32` = 4291385574.1173744000, `col33` = 'borrowing\'s', `col34` = 'septics', `col35` = 'ratter\'s', `col36` = 'Kaye', `col37` = 'Florentia', `col38` = 'allium', `col39` = 'barkeep', `col40` = '19510407003441', `col41` = 4293559200.4215522000, `col42` = 22482, `col43` = 'decussate', `col44` = 'Brom\'s', `col45` = 'violated', `col46` = 4925506.4635456400, `col47` = 930549, `col48` = '51296066', `col49` = 'voluminously', `col50` = '29306676', `col51` = -88, `col52` = -2153690, `col53` = 4290250202.1464887000, `col54` = 'expropriation', `col55` = 'Aberdeen\'s', `col56` = 20343, `col58` = '19640415171532', `col59` = 'extern', `col60` = 'Ubana', `col61` = 4290487961.8539081000, `col62` = '2147', `col63` = -24271, `col64` = '20750801194548', `col65` = 'Cunaxa\'s', `col66` = 'pasticcio', `col67` = 2795817, `col68` = 'Indore\'s', `col70` = 6864127, `col71` = '1817832', `col72` = '20540506114211', `col73` = '20040101012300', `col74` = 'rationalized', `col75` = '45522', `col76` = 'indene', `col77` = -6964559, `col78` = 4247535.5266884370, `col79` = '20720416124357', `col80` = '2143', `col81` = 4292060102.4466386000, `col82` = 'striving', `col83` = 'boneblack\'s', `col84` = 'redolent', `col85` = 6489697.9009369183, `col86` = 4287473465.9731131000, `col87` = 7726015, `col88` = 'perplexed', `col89` = '17153791', `col90` = 5478587.1108127078, `col91` = 4287091404.7004304000, `col92` = 'Boulez\'s', `col93` = '2931278';
-CHECK TABLE table0 EXTENDED;
-DROP TABLE table0;
-
-SET GLOBAL innodb_file_per_table=DEFAULT;
-SET GLOBAL innodb_file_format='Antelope';
-SET GLOBAL innodb_file_format_check='Antelope';
diff --git a/mysql-test/t/innodb_bug38231.test b/mysql-test/suite/innodb/t/innodb_bug38231.test
index 1611cb56203..1611cb56203 100644
--- a/mysql-test/t/innodb_bug38231.test
+++ b/mysql-test/suite/innodb/t/innodb_bug38231.test
diff --git a/mysql-test/t/innodb_bug39438-master.opt b/mysql-test/suite/innodb/t/innodb_bug39438-master.opt
index 43fac202fd4..43fac202fd4 100644
--- a/mysql-test/t/innodb_bug39438-master.opt
+++ b/mysql-test/suite/innodb/t/innodb_bug39438-master.opt
diff --git a/mysql-test/t/innodb_bug39438.test b/mysql-test/suite/innodb/t/innodb_bug39438.test
index 2a51e5fcbb8..2a51e5fcbb8 100644
--- a/mysql-test/t/innodb_bug39438.test
+++ b/mysql-test/suite/innodb/t/innodb_bug39438.test
diff --git a/mysql-test/t/innodb_bug40565.test b/mysql-test/suite/innodb/t/innodb_bug40565.test
index d7aa0fd514a..d7aa0fd514a 100644
--- a/mysql-test/t/innodb_bug40565.test
+++ b/mysql-test/suite/innodb/t/innodb_bug40565.test
diff --git a/mysql-test/t/innodb_bug42101-nonzero-master.opt b/mysql-test/suite/innodb/t/innodb_bug42101-nonzero-master.opt
index d71dbe17d5b..d71dbe17d5b 100644
--- a/mysql-test/t/innodb_bug42101-nonzero-master.opt
+++ b/mysql-test/suite/innodb/t/innodb_bug42101-nonzero-master.opt
diff --git a/mysql-test/t/innodb_bug42101-nonzero.test b/mysql-test/suite/innodb/t/innodb_bug42101-nonzero.test
index 685fdf20489..685fdf20489 100644
--- a/mysql-test/t/innodb_bug42101-nonzero.test
+++ b/mysql-test/suite/innodb/t/innodb_bug42101-nonzero.test
diff --git a/mysql-test/t/innodb_bug42101.test b/mysql-test/suite/innodb/t/innodb_bug42101.test
index b6536490d48..b6536490d48 100644
--- a/mysql-test/t/innodb_bug42101.test
+++ b/mysql-test/suite/innodb/t/innodb_bug42101.test
diff --git a/mysql-test/suite/innodb/t/innodb_bug44032.test b/mysql-test/suite/innodb/t/innodb_bug44032.test
deleted file mode 100644
index a963cb8b68f..00000000000
--- a/mysql-test/suite/innodb/t/innodb_bug44032.test
+++ /dev/null
@@ -1,13 +0,0 @@
-# Bug44032 no update-in-place of UTF-8 columns in ROW_FORMAT=REDUNDANT
-# (btr_cur_update_in_place not invoked when updating from/to NULL;
-# the update is performed by delete and insert instead)
-
--- source include/have_innodb.inc
-
-CREATE TABLE bug44032(c CHAR(3) CHARACTER SET UTF8) ROW_FORMAT=REDUNDANT
-ENGINE=InnoDB;
-INSERT INTO bug44032 VALUES('abc'),(0xEFBCA4EFBCA4EFBCA4);
-UPDATE bug44032 SET c='DDD' WHERE c=0xEFBCA4EFBCA4EFBCA4;
-UPDATE bug44032 SET c=NULL WHERE c='DDD';
-UPDATE bug44032 SET c='DDD' WHERE c IS NULL;
-DROP TABLE bug44032;
diff --git a/mysql-test/t/innodb_bug44369.test b/mysql-test/suite/innodb/t/innodb_bug44369.test
index 238dc3d8fb1..238dc3d8fb1 100644
--- a/mysql-test/t/innodb_bug44369.test
+++ b/mysql-test/suite/innodb/t/innodb_bug44369.test
diff --git a/mysql-test/t/innodb_bug45357.test b/mysql-test/suite/innodb/t/innodb_bug45357.test
index 81727f352dd..81727f352dd 100644
--- a/mysql-test/t/innodb_bug45357.test
+++ b/mysql-test/suite/innodb/t/innodb_bug45357.test
diff --git a/mysql-test/t/innodb_bug46000.test b/mysql-test/suite/innodb/t/innodb_bug46000.test
index eb10d866e54..eb10d866e54 100644
--- a/mysql-test/t/innodb_bug46000.test
+++ b/mysql-test/suite/innodb/t/innodb_bug46000.test
diff --git a/mysql-test/t/innodb_bug47621.test b/mysql-test/suite/innodb/t/innodb_bug47621.test
index 4863cc6bba1..4863cc6bba1 100644
--- a/mysql-test/t/innodb_bug47621.test
+++ b/mysql-test/suite/innodb/t/innodb_bug47621.test
diff --git a/mysql-test/t/innodb_bug47777.test b/mysql-test/suite/innodb/t/innodb_bug47777.test
index 8f2985b2cf0..8f2985b2cf0 100644
--- a/mysql-test/t/innodb_bug47777.test
+++ b/mysql-test/suite/innodb/t/innodb_bug47777.test
diff --git a/mysql-test/suite/innodb/t/innodb_bug51920.test b/mysql-test/suite/innodb/t/innodb_bug51920.test
new file mode 100644
index 00000000000..bc3bb006c1c
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug51920.test
@@ -0,0 +1,43 @@
+#
+# Bug #51920: InnoDB connections in lock wait ignore KILL until timeout
+#
+-- source include/not_embedded.inc
+-- source include/have_innodb.inc
+
+CREATE TABLE bug51920 (i INT) ENGINE=InnoDB;
+INSERT INTO bug51920 VALUES (1);
+
+BEGIN;
+SELECT * FROM bug51920 FOR UPDATE;
+
+connect (con1,localhost,root,,);
+
+connection con1;
+--send
+UPDATE bug51920 SET i=2;
+
+connection default;
+let $wait_condition =
+ SELECT COUNT(*)=1 FROM information_schema.processlist
+ WHERE INFO="UPDATE bug51920 SET i=2";
+-- source include/wait_condition.inc
+
+SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST
+WHERE INFO="UPDATE bug51920 SET i=2"
+INTO @thread_id;
+
+KILL @thread_id;
+let $wait_condition =
+ SELECT COUNT(*)=0 FROM information_schema.processlist WHERE ID=@thread_id;
+-- source include/wait_condition.inc
+
+#
+# Bug#19723: kill of active connection yields different error code
+# depending on platform.
+#
+connection con1;
+-- error 1317, 2006, 2013
+reap;
+connection default;
+DROP TABLE bug51920;
+-- disconnect con1
diff --git a/mysql-test/suite/innodb/t/innodb_bug52663-master.opt b/mysql-test/suite/innodb/t/innodb_bug52663-master.opt
new file mode 100644
index 00000000000..462f8fbe828
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug52663-master.opt
@@ -0,0 +1 @@
+--innodb_lock_wait_timeout=1
diff --git a/mysql-test/suite/innodb/t/innodb_bug52663.test b/mysql-test/suite/innodb/t/innodb_bug52663.test
new file mode 100644
index 00000000000..fcf97531e00
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_bug52663.test
@@ -0,0 +1,34 @@
+--source include/have_innodb.inc
+
+set session transaction isolation level read committed;
+
+create table innodb_bug52663 (what varchar(5), id integer, count integer, primary key
+(what, id)) engine=innodb;
+insert into innodb_bug52663 values ('total', 0, 0);
+begin;
+
+connect (addconroot, localhost, root,,);
+connection addconroot;
+set session transaction isolation level read committed;
+begin;
+
+connection default;
+update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0;
+select * from innodb_bug52663;
+
+connection addconroot;
+--error ER_LOCK_WAIT_TIMEOUT
+update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0;
+select * from innodb_bug52663;
+
+connection default;
+commit;
+
+connection addconroot;
+update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0;
+commit;
+select * from innodb_bug52663;
+
+connection default;
+select * from innodb_bug52663;
+drop table innodb_bug52663;
diff --git a/mysql-test/suite/innodb/t/innodb_file_format.test b/mysql-test/suite/innodb/t/innodb_file_format.test
deleted file mode 100644
index 4823254b959..00000000000
--- a/mysql-test/suite/innodb/t/innodb_file_format.test
+++ /dev/null
@@ -1,43 +0,0 @@
--- source include/have_innodb.inc
--- source suite/innodb/include/have_innodb_plugin.inc
-
-call mtr.add_suppression("InnoDB: invalid innodb_file_format_check value");
-
-let $format=`select @@innodb_file_format`;
-let $innodb_file_format_check_orig=`select @@innodb_file_format_check`;
-
-select @@innodb_file_format;
-select @@innodb_file_format_check;
-set global innodb_file_format=antelope;
-set global innodb_file_format=barracuda;
---error ER_WRONG_ARGUMENTS
-set global innodb_file_format=cheetah;
-select @@innodb_file_format;
-set global innodb_file_format=default;
-select @@innodb_file_format;
---error ER_WRONG_ARGUMENTS
-set global innodb_file_format=on;
---error ER_WRONG_ARGUMENTS
-set global innodb_file_format=off;
-select @@innodb_file_format;
-set global innodb_file_format_check=antelope;
-set global innodb_file_format_check=barracuda;
---error ER_WRONG_ARGUMENTS
-set global innodb_file_format_check=cheetah;
-select @@innodb_file_format_check;
-set global innodb_file_format_check=default;
-select @@innodb_file_format_check;
---error ER_WRONG_ARGUMENTS
-set global innodb_file_format=on;
---error ER_WRONG_ARGUMENTS
-set global innodb_file_format=off;
-select @@innodb_file_format_check;
-
-#
-# restore environment to the state it was before this test execution
-#
-
--- disable_query_log
-eval set global innodb_file_format=$format;
-eval set global innodb_file_format_check=$innodb_file_format_check_orig;
--- enable_query_log
diff --git a/storage/innodb_plugin/mysql-test/innodb-master.opt b/mysql-test/suite/innodb/t/innodb_misc1-master.opt
index 4901efb416c..4901efb416c 100644
--- a/storage/innodb_plugin/mysql-test/innodb-master.opt
+++ b/mysql-test/suite/innodb/t/innodb_misc1-master.opt
diff --git a/mysql-test/suite/innodb/t/innodb_misc1.test b/mysql-test/suite/innodb/t/innodb_misc1.test
new file mode 100644
index 00000000000..9231c86b618
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_misc1.test
@@ -0,0 +1,1206 @@
+#######################################################################
+# #
+# Please, DO NOT TOUCH this file as well as the innodb.result file. #
+# These files are to be modified ONLY BY INNOBASE guys. #
+# #
+# Use innodb_mysql.[test|result] files instead. #
+# #
+# If nevertheless you need to make some changes here, please, forward #
+# your commit message #
+# To: innodb_dev_ww@oracle.com #
+# Cc: dev-innodb@mysql.com #
+# (otherwise your changes may be erased). #
+# #
+#######################################################################
+
+-- source include/have_innodb.inc
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+
+# Save the original values of some variables in order to be able to
+# estimate how much they have changed during the tests. Previously this
+# test assumed that e.g. rows_deleted is 0 here and after deleting 23
+# rows it expected that rows_deleted will be 23. Now we do not make
+# assumptions about the values of the variables at the beginning, e.g.
+# rows_deleted should be 23 + "rows_deleted before the test". This allows
+# the test to be run multiple times without restarting the mysqld server.
+# See Bug#43309 Test main.innodb can't be run twice
+-- disable_query_log
+SET @innodb_thread_concurrency_orig = @@innodb_thread_concurrency;
+-- enable_query_log
+
+--disable_warnings
+drop table if exists t1,t2,t3,t4;
+drop database if exists mysqltest;
+--enable_warnings
+
+# InnoDB specific varchar tests
+create table t1 (v varchar(16384)) engine=innodb;
+drop table t1;
+
+#
+# BUG#11039 Wrong key length in min()
+#
+
+create table t1 (a char(1), b char(1), key(a, b)) engine=innodb;
+insert into t1 values ('8', '6'), ('4', '7');
+select min(a) from t1;
+select min(b) from t1 where a='8';
+drop table t1;
+
+#
+# Bug #11080 & #11005 Multi-row REPLACE fails on a duplicate key error
+#
+
+CREATE TABLE t1 ( `a` int(11) NOT NULL auto_increment, `b` int(11) default NULL,PRIMARY KEY (`a`),UNIQUE KEY `b` (`b`)) ENGINE=innodb;
+insert into t1 (b) values (1);
+replace into t1 (b) values (2), (1), (3);
+select * from t1;
+truncate table t1;
+insert into t1 (b) values (1);
+replace into t1 (b) values (2);
+replace into t1 (b) values (1);
+replace into t1 (b) values (3);
+select * from t1;
+drop table t1;
+
+create table t1 (rowid int not null auto_increment, val int not null,primary
+key (rowid), unique(val)) engine=innodb;
+replace into t1 (val) values ('1'),('2');
+replace into t1 (val) values ('1'),('2');
+--error ER_DUP_ENTRY
+insert into t1 (val) values ('1'),('2');
+select * from t1;
+drop table t1;
+
+#
+# Test that update does not change internal auto-increment value
+#
+
+create table t1 (a int not null auto_increment primary key, val int) engine=InnoDB;
+insert into t1 (val) values (1);
+update t1 set a=2 where a=1;
+# We should get the following error because InnoDB does not update the counter
+--error ER_DUP_ENTRY
+insert into t1 (val) values (1);
+select * from t1;
+drop table t1;
+#
+# Bug #10465
+#
+
+--disable_warnings
+CREATE TABLE t1 (GRADE DECIMAL(4) NOT NULL, PRIMARY KEY (GRADE)) ENGINE=INNODB;
+--enable_warnings
+INSERT INTO t1 (GRADE) VALUES (151),(252),(343);
+SELECT GRADE FROM t1 WHERE GRADE > 160 AND GRADE < 300;
+SELECT GRADE FROM t1 WHERE GRADE= 151;
+DROP TABLE t1;
+
+#
+# Bug #12340 multitable delete deletes only one record
+#
+create table t1 (f1 varchar(10), f2 varchar(10), primary key (f1,f2)) engine=innodb;
+create table t2 (f3 varchar(10), f4 varchar(10), key (f4)) engine=innodb;
+insert into t2 values ('aa','cc');
+insert into t1 values ('aa','bb'),('aa','cc');
+delete t1 from t1,t2 where f1=f3 and f4='cc';
+select * from t1;
+drop table t1,t2;
+
+#
+# Test that the slow TRUNCATE implementation resets autoincrement columns
+# (bug #11946)
+#
+
+CREATE TABLE t1 (
+id INTEGER NOT NULL AUTO_INCREMENT, PRIMARY KEY (id)
+) ENGINE=InnoDB;
+
+CREATE TABLE t2 (
+id INTEGER NOT NULL,
+FOREIGN KEY (id) REFERENCES t1 (id)
+) ENGINE=InnoDB;
+
+INSERT INTO t1 (id) VALUES (NULL);
+SELECT * FROM t1;
+TRUNCATE t1;
+INSERT INTO t1 (id) VALUES (NULL);
+SELECT * FROM t1;
+
+# continued from above; test that doing a slow TRUNCATE on a table with 0
+# rows resets autoincrement columns
+DELETE FROM t1;
+TRUNCATE t1;
+INSERT INTO t1 (id) VALUES (NULL);
+SELECT * FROM t1;
+DROP TABLE t2, t1;
+
+# Test that foreign keys in temporary tables are not accepted (bug #12084)
+CREATE TABLE t1
+(
+ id INT PRIMARY KEY
+) ENGINE=InnoDB;
+
+--error 1005,1005
+CREATE TEMPORARY TABLE t2
+(
+ id INT NOT NULL PRIMARY KEY,
+ b INT,
+ FOREIGN KEY (b) REFERENCES test.t1(id)
+) ENGINE=InnoDB;
+DROP TABLE t1;
+
+#
+# Test that index column max sizes are honored (bug #13315)
+#
+
+# prefix index
+create table t1 (col1 varchar(2000), index (col1(767)))
+ character set = latin1 engine = innodb;
+
+# normal indexes
+create table t2 (col1 char(255), index (col1))
+ character set = latin1 engine = innodb;
+create table t3 (col1 binary(255), index (col1))
+ character set = latin1 engine = innodb;
+create table t4 (col1 varchar(767), index (col1))
+ character set = latin1 engine = innodb;
+create table t5 (col1 varchar(767) primary key)
+ character set = latin1 engine = innodb;
+create table t6 (col1 varbinary(767) primary key)
+ character set = latin1 engine = innodb;
+create table t7 (col1 text, index(col1(767)))
+ character set = latin1 engine = innodb;
+create table t8 (col1 blob, index(col1(767)))
+ character set = latin1 engine = innodb;
+
+# multi-column indexes are allowed to be longer
+create table t9 (col1 varchar(512), col2 varchar(512), index(col1, col2))
+ character set = latin1 engine = innodb;
+
+show create table t9;
+
+drop table t1, t2, t3, t4, t5, t6, t7, t8, t9;
+
+# these should have their index length trimmed
+create table t1 (col1 varchar(768), index(col1))
+ character set = latin1 engine = innodb;
+create table t2 (col1 varbinary(768), index(col1))
+ character set = latin1 engine = innodb;
+create table t3 (col1 text, index(col1(768)))
+ character set = latin1 engine = innodb;
+create table t4 (col1 blob, index(col1(768)))
+ character set = latin1 engine = innodb;
+
+show create table t1;
+
+drop table t1, t2, t3, t4;
+
+# these should be refused
+--error 1071
+create table t1 (col1 varchar(768) primary key)
+ character set = latin1 engine = innodb;
+--error 1071
+create table t2 (col1 varbinary(768) primary key)
+ character set = latin1 engine = innodb;
+--error 1071
+create table t3 (col1 text, primary key(col1(768)))
+ character set = latin1 engine = innodb;
+--error 1071
+create table t4 (col1 blob, primary key(col1(768)))
+ character set = latin1 engine = innodb;
+
+#
+# Test improved foreign key error messages (bug #3443)
+#
+
+CREATE TABLE t1
+(
+ id INT PRIMARY KEY
+) ENGINE=InnoDB;
+
+CREATE TABLE t2
+(
+ v INT,
+ CONSTRAINT c1 FOREIGN KEY (v) REFERENCES t1(id)
+) ENGINE=InnoDB;
+
+--error 1452
+INSERT INTO t2 VALUES(2);
+
+INSERT INTO t1 VALUES(1);
+INSERT INTO t2 VALUES(1);
+
+--error 1451
+DELETE FROM t1 WHERE id = 1;
+
+--error 1217
+DROP TABLE t1;
+
+SET FOREIGN_KEY_CHECKS=0;
+DROP TABLE t1;
+SET FOREIGN_KEY_CHECKS=1;
+
+--error 1452
+INSERT INTO t2 VALUES(3);
+
+DROP TABLE t2;
+#
+# Test that checksum table uses a consistent read Bug #12669
+#
+connect (a,localhost,root,,);
+connect (b,localhost,root,,);
+connection a;
+create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
+insert into t1 values (1),(2);
+set autocommit=0;
+checksum table t1;
+connection b;
+insert into t1 values(3);
+connection a;
+#
+# Here checksum should not see insert
+#
+checksum table t1;
+connection a;
+commit;
+checksum table t1;
+commit;
+drop table t1;
+#
+# autocommit = 1
+#
+connection a;
+create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
+insert into t1 values (1),(2);
+set autocommit=1;
+checksum table t1;
+connection b;
+set autocommit=1;
+insert into t1 values(3);
+connection a;
+#
+# Here checksum sees insert
+#
+checksum table t1;
+drop table t1;
+
+connection default;
+disconnect a;
+disconnect b;
+
+# tests for bugs #9802 and #13778
+
+# test that FKs between invalid types are not accepted
+
+set foreign_key_checks=0;
+create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb;
+# Embedded server doesn't chdir to data directory
+--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
+-- error 1005
+create table t1(a char(10) primary key, b varchar(20)) engine = innodb;
+set foreign_key_checks=1;
+drop table t2;
+
+# test that FKs between different charsets are not accepted in CREATE even
+# when f_k_c is 0
+
+set foreign_key_checks=0;
+create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1;
+# Embedded server doesn't chdir to data directory
+--replace_result $MYSQLTEST_VARDIR . mysqld.1/data/ ''
+-- error 1005
+create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=utf8;
+set foreign_key_checks=1;
+drop table t1;
+
+# test that invalid datatype conversions with ALTER are not allowed
+
+set foreign_key_checks=0;
+create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb;
+create table t1(a varchar(10) primary key) engine = innodb;
+-- error 1025,1025
+alter table t1 modify column a int;
+set foreign_key_checks=1;
+drop table t2,t1;
+
+# test that charset conversions with ALTER are allowed when f_k_c is 0
+
+set foreign_key_checks=0;
+create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1;
+create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1;
+alter table t1 convert to character set utf8;
+set foreign_key_checks=1;
+drop table t2,t1;
+
+# test that RENAME does not allow invalid charsets when f_k_c is 0
+
+set foreign_key_checks=0;
+create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1;
+create table t3(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=utf8;
+# Embedded server doesn't chdir to data directory
+--replace_result $MYSQLD_DATADIR ./ master-data/ ''
+-- error 1025
+rename table t3 to t1;
+set foreign_key_checks=1;
+drop table t2,t3;
+
+# test that foreign key errors are reported correctly (Bug #15550)
+
+create table t1(a int primary key) row_format=redundant engine=innodb;
+create table t2(a int primary key,constraint foreign key(a)references t1(a)) row_format=compact engine=innodb;
+create table t3(a int primary key) row_format=compact engine=innodb;
+create table t4(a int primary key,constraint foreign key(a)references t3(a)) row_format=redundant engine=innodb;
+
+insert into t1 values(1);
+insert into t3 values(1);
+-- error 1452
+insert into t2 values(2);
+-- error 1452
+insert into t4 values(2);
+insert into t2 values(1);
+insert into t4 values(1);
+-- error 1451
+update t1 set a=2;
+-- error 1452
+update t2 set a=2;
+-- error 1451
+update t3 set a=2;
+-- error 1452
+update t4 set a=2;
+-- error 1451
+truncate t1;
+-- error 1451
+truncate t3;
+truncate t2;
+truncate t4;
+truncate t1;
+truncate t3;
+
+drop table t4,t3,t2,t1;
+
+
+#
+# Test that we can create a large (>1K) key
+#
+create table t1 (a varchar(255) character set utf8,
+ b varchar(255) character set utf8,
+ c varchar(255) character set utf8,
+ d varchar(255) character set utf8,
+ key (a,b,c,d)) engine=innodb;
+drop table t1;
+--error ER_TOO_LONG_KEY
+create table t1 (a varchar(255) character set utf8,
+ b varchar(255) character set utf8,
+ c varchar(255) character set utf8,
+ d varchar(255) character set utf8,
+ e varchar(255) character set utf8,
+ key (a,b,c,d,e)) engine=innodb;
+
+
+# test the padding of BINARY types and collations (Bug #14189)
+
+create table t1 (s1 varbinary(2),primary key (s1)) engine=innodb;
+create table t2 (s1 binary(2),primary key (s1)) engine=innodb;
+create table t3 (s1 varchar(2) binary,primary key (s1)) engine=innodb;
+create table t4 (s1 char(2) binary,primary key (s1)) engine=innodb;
+
+insert into t1 values (0x41),(0x4120),(0x4100);
+-- error ER_DUP_ENTRY
+insert into t2 values (0x41),(0x4120),(0x4100);
+insert into t2 values (0x41),(0x4120);
+-- error ER_DUP_ENTRY
+insert into t3 values (0x41),(0x4120),(0x4100);
+insert into t3 values (0x41),(0x4100);
+-- error ER_DUP_ENTRY
+insert into t4 values (0x41),(0x4120),(0x4100);
+insert into t4 values (0x41),(0x4100);
+select hex(s1) from t1;
+select hex(s1) from t2;
+select hex(s1) from t3;
+select hex(s1) from t4;
+drop table t1,t2,t3,t4;
+
+create table t1 (a int primary key,s1 varbinary(3) not null unique) engine=innodb;
+create table t2 (s1 binary(2) not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=innodb;
+
+insert into t1 values(1,0x4100),(2,0x41),(3,0x4120),(4,0x42);
+-- error 1452
+insert into t2 values(0x42);
+insert into t2 values(0x41);
+select hex(s1) from t2;
+update t1 set s1=0x123456 where a=2;
+select hex(s1) from t2;
+-- error 1451
+update t1 set s1=0x12 where a=1;
+-- error 1451
+update t1 set s1=0x12345678 where a=1;
+-- error 1451
+update t1 set s1=0x123457 where a=1;
+update t1 set s1=0x1220 where a=1;
+select hex(s1) from t2;
+update t1 set s1=0x1200 where a=1;
+select hex(s1) from t2;
+update t1 set s1=0x4200 where a=1;
+select hex(s1) from t2;
+-- error 1451
+delete from t1 where a=1;
+delete from t1 where a=2;
+update t2 set s1=0x4120;
+-- error 1451
+delete from t1;
+delete from t1 where a!=3;
+select a,hex(s1) from t1;
+select hex(s1) from t2;
+
+drop table t2,t1;
+
+create table t1 (a int primary key,s1 varchar(2) binary not null unique) engine=innodb;
+create table t2 (s1 char(2) binary not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=innodb;
+
+insert into t1 values(1,0x4100),(2,0x41);
+insert into t2 values(0x41);
+select hex(s1) from t2;
+update t1 set s1=0x1234 where a=1;
+select hex(s1) from t2;
+update t1 set s1=0x12 where a=2;
+select hex(s1) from t2;
+delete from t1 where a=1;
+-- error 1451
+delete from t1 where a=2;
+select a,hex(s1) from t1;
+select hex(s1) from t2;
+
+drop table t2,t1;
+# Ensure that <tablename>_ibfk_0 is not mistreated as a
+# generated foreign key identifier. (Bug #16387)
+
+CREATE TABLE t1(a INT, PRIMARY KEY(a)) ENGINE=InnoDB;
+CREATE TABLE t2(a INT) ENGINE=InnoDB;
+ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1(a);
+ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_1;
+ALTER TABLE t2 ADD CONSTRAINT t2_ibfk_0 FOREIGN KEY (a) REFERENCES t1(a);
+ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_0;
+SHOW CREATE TABLE t2;
+DROP TABLE t2,t1;
+
+#
+# Test case for bug #16229: MySQL/InnoDB uses full explicit table locks in trigger processing
+#
+
+connect (a,localhost,root,,);
+connect (b,localhost,root,,);
+connection a;
+create table t1(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
+insert into t1(a) values (1),(2),(3);
+commit;
+connection b;
+set autocommit = 0;
+update t1 set b = 5 where a = 2;
+connection a;
+delimiter |;
+create trigger t1t before insert on t1 for each row begin set NEW.b = NEW.a * 10 + 5, NEW.c = NEW.a / 10; end |
+delimiter ;|
+set autocommit = 0;
+connection a;
+insert into t1(a) values (10),(20),(30),(40),(50),(60),(70),(80),(90),(100),
+(11),(21),(31),(41),(51),(61),(71),(81),(91),(101),
+(12),(22),(32),(42),(52),(62),(72),(82),(92),(102),
+(13),(23),(33),(43),(53),(63),(73),(83),(93),(103),
+(14),(24),(34),(44),(54),(64),(74),(84),(94),(104);
+connection b;
+commit;
+connection a;
+commit;
+drop trigger t1t;
+drop table t1;
+disconnect a;
+disconnect b;
+#
+# Another trigger test
+#
+connect (a,localhost,root,,);
+connect (b,localhost,root,,);
+connection a;
+create table t1(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
+create table t2(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
+create table t3(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
+create table t4(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
+create table t5(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
+insert into t1(a) values (1),(2),(3);
+insert into t2(a) values (1),(2),(3);
+insert into t3(a) values (1),(2),(3);
+insert into t4(a) values (1),(2),(3);
+insert into t3(a) values (5),(7),(8);
+insert into t4(a) values (5),(7),(8);
+insert into t5(a) values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12);
+
+delimiter |;
+create trigger t1t before insert on t1 for each row begin
+ INSERT INTO t2 SET a = NEW.a;
+end |
+
+create trigger t2t before insert on t2 for each row begin
+ DELETE FROM t3 WHERE a = NEW.a;
+end |
+
+create trigger t3t before delete on t3 for each row begin
+ UPDATE t4 SET b = b + 1 WHERE a = OLD.a;
+end |
+
+create trigger t4t before update on t4 for each row begin
+ UPDATE t5 SET b = b + 1 where a = NEW.a;
+end |
+delimiter ;|
+commit;
+set autocommit = 0;
+update t1 set b = b + 5 where a = 1;
+update t2 set b = b + 5 where a = 1;
+update t3 set b = b + 5 where a = 1;
+update t4 set b = b + 5 where a = 1;
+insert into t5(a) values(20);
+connection b;
+set autocommit = 0;
+insert into t1(a) values(7);
+insert into t2(a) values(8);
+delete from t2 where a = 3;
+update t4 set b = b + 1 where a = 3;
+commit;
+drop trigger t1t;
+drop trigger t2t;
+drop trigger t3t;
+drop trigger t4t;
+drop table t1, t2, t3, t4, t5;
+connection default;
+disconnect a;
+disconnect b;
+
+#
+# Test that cascading updates leading to duplicate keys give the correct
+# error message (bug #9680)
+#
+
+CREATE TABLE t1 (
+ field1 varchar(8) NOT NULL DEFAULT '',
+ field2 varchar(8) NOT NULL DEFAULT '',
+ PRIMARY KEY (field1, field2)
+) ENGINE=InnoDB;
+
+CREATE TABLE t2 (
+ field1 varchar(8) NOT NULL DEFAULT '' PRIMARY KEY,
+ FOREIGN KEY (field1) REFERENCES t1 (field1)
+ ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB;
+
+INSERT INTO t1 VALUES ('old', 'somevalu');
+INSERT INTO t1 VALUES ('other', 'anyvalue');
+
+INSERT INTO t2 VALUES ('old');
+INSERT INTO t2 VALUES ('other');
+
+--error ER_FOREIGN_DUPLICATE_KEY
+UPDATE t1 SET field1 = 'other' WHERE field2 = 'somevalu';
+
+DROP TABLE t2;
+DROP TABLE t1;
+
+#
+# Bug#18477 - MySQL/InnoDB Ignoring Foreign Keys in ALTER TABLE
+#
+create table t1 (
+ c1 bigint not null,
+ c2 bigint not null,
+ primary key (c1),
+ unique key (c2)
+) engine=innodb;
+#
+create table t2 (
+ c1 bigint not null,
+ primary key (c1)
+) engine=innodb;
+#
+alter table t1 add constraint c2_fk foreign key (c2)
+ references t2(c1) on delete cascade;
+show create table t1;
+#
+alter table t1 drop foreign key c2_fk;
+show create table t1;
+#
+drop table t1, t2;
+
+#
+# Bug #14360: problem with intervals
+#
+
+create table t1(a date) engine=innodb;
+create table t2(a date, key(a)) engine=innodb;
+insert into t1 values('2005-10-01');
+insert into t2 values('2005-10-01');
+select * from t1, t2
+ where t2.a between t1.a - interval 2 day and t1.a + interval 2 day;
+drop table t1, t2;
+
+create table t1 (id int not null, f_id int not null, f int not null,
+primary key(f_id, id)) engine=innodb;
+create table t2 (id int not null,s_id int not null,s varchar(200),
+primary key(id)) engine=innodb;
+INSERT INTO t1 VALUES (8, 1, 3);
+INSERT INTO t1 VALUES (1, 2, 1);
+INSERT INTO t2 VALUES (1, 0, '');
+INSERT INTO t2 VALUES (8, 1, '');
+commit;
+DELETE ml.* FROM t1 AS ml LEFT JOIN t2 AS mm ON (mm.id=ml.id)
+WHERE mm.id IS NULL;
+select ml.* from t1 as ml left join t2 as mm on (mm.id=ml.id)
+where mm.id is null lock in share mode;
+drop table t1,t2;
+
+#
+# Test case where X-locks on unused rows should be released in a
+# update (because READ COMMITTED isolation level)
+#
+
+connect (a,localhost,root,,);
+connect (b,localhost,root,,);
+connection a;
+create table t1(a int not null, b int, primary key(a)) engine=innodb;
+insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3);
+commit;
+SET binlog_format='MIXED';
+set autocommit = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+update t1 set b = 5 where b = 1;
+connection b;
+SET binlog_format='MIXED';
+set autocommit = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+#
+# X-lock to record (7,3) should be released in a update
+#
+select * from t1 where a = 7 and b = 3 for update;
+connection a;
+commit;
+connection b;
+commit;
+drop table t1;
+connection default;
+disconnect a;
+disconnect b;
+
+#
+# Test case where no locks should be released (because we are not
+# using READ COMMITTED isolation level)
+#
+
+connect (a,localhost,root,,);
+connect (b,localhost,root,,);
+connection a;
+create table t1(a int not null, b int, primary key(a)) engine=innodb;
+insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2);
+commit;
+set autocommit = 0;
+select * from t1 lock in share mode;
+update t1 set b = 5 where b = 1;
+connection b;
+set autocommit = 0;
+#
+# S-lock to records (2,2),(4,2), and (6,2) should not be released in a update
+#
+--error 1205
+select * from t1 where a = 2 and b = 2 for update;
+#
+# X-lock to record (1,1),(3,1),(5,1) should not be released in a update
+#
+--error 1205
+connection a;
+commit;
+connection b;
+commit;
+connection default;
+disconnect a;
+disconnect b;
+drop table t1;
+
+#
+# Consistent read should be used in following selects
+#
+# 1) INSERT INTO ... SELECT
+# 2) UPDATE ... = ( SELECT ...)
+# 3) CREATE ... SELECT
+
+connect (a,localhost,root,,);
+connect (b,localhost,root,,);
+connection a;
+create table t1(a int not null, b int, primary key(a)) engine=innodb;
+insert into t1 values (1,2),(5,3),(4,2);
+create table t2(d int not null, e int, primary key(d)) engine=innodb;
+insert into t2 values (8,6),(12,1),(3,1);
+commit;
+set autocommit = 0;
+select * from t2 for update;
+connection b;
+SET binlog_format='MIXED';
+set autocommit = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+insert into t1 select * from t2;
+update t1 set b = (select e from t2 where a = d);
+create table t3(d int not null, e int, primary key(d)) engine=innodb
+select * from t2;
+commit;
+connection a;
+commit;
+connection default;
+disconnect a;
+disconnect b;
+drop table t1, t2, t3;
+
+#
+# Consistent read should not be used if
+#
+# (a) isolation level is serializable OR
+# (b) select ... lock in share mode OR
+# (c) select ... for update
+#
+# in following queries:
+#
+# 1) INSERT INTO ... SELECT
+# 2) UPDATE ... = ( SELECT ...)
+# 3) CREATE ... SELECT
+
+connect (a,localhost,root,,);
+connect (b,localhost,root,,);
+connect (c,localhost,root,,);
+connect (d,localhost,root,,);
+connect (e,localhost,root,,);
+connect (f,localhost,root,,);
+connect (g,localhost,root,,);
+connect (h,localhost,root,,);
+connect (i,localhost,root,,);
+connect (j,localhost,root,,);
+connection a;
+create table t1(a int not null, b int, primary key(a)) engine=innodb;
+insert into t1 values (1,2),(5,3),(4,2);
+create table t2(a int not null, b int, primary key(a)) engine=innodb;
+insert into t2 values (8,6),(12,1),(3,1);
+create table t3(d int not null, b int, primary key(d)) engine=innodb;
+insert into t3 values (8,6),(12,1),(3,1);
+create table t5(a int not null, b int, primary key(a)) engine=innodb;
+insert into t5 values (1,2),(5,3),(4,2);
+create table t6(d int not null, e int, primary key(d)) engine=innodb;
+insert into t6 values (8,6),(12,1),(3,1);
+create table t8(a int not null, b int, primary key(a)) engine=innodb;
+insert into t8 values (1,2),(5,3),(4,2);
+create table t9(d int not null, e int, primary key(d)) engine=innodb;
+insert into t9 values (8,6),(12,1),(3,1);
+commit;
+set autocommit = 0;
+select * from t2 for update;
+connection b;
+SET binlog_format='MIXED';
+set autocommit = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+--send
+insert into t1 select * from t2;
+connection c;
+SET binlog_format='MIXED';
+set autocommit = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+--send
+update t3 set b = (select b from t2 where a = d);
+connection d;
+SET binlog_format='MIXED';
+set autocommit = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
+--send
+create table t4(a int not null, b int, primary key(a)) engine=innodb select * from t2;
+connection e;
+SET binlog_format='MIXED';
+set autocommit = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+--send
+insert into t5 (select * from t2 lock in share mode);
+connection f;
+SET binlog_format='MIXED';
+set autocommit = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+--send
+update t6 set e = (select b from t2 where a = d lock in share mode);
+connection g;
+SET binlog_format='MIXED';
+set autocommit = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+--send
+create table t7(a int not null, b int, primary key(a)) engine=innodb select * from t2 lock in share mode;
+connection h;
+SET binlog_format='MIXED';
+set autocommit = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+--send
+insert into t8 (select * from t2 for update);
+connection i;
+SET binlog_format='MIXED';
+set autocommit = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+--send
+update t9 set e = (select b from t2 where a = d for update);
+connection j;
+SET binlog_format='MIXED';
+set autocommit = 0;
+SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
+--send
+create table t10(a int not null, b int, primary key(a)) engine=innodb select * from t2 for update;
+
+connection b;
+--error 1205
+reap;
+
+connection c;
+--error 1205
+reap;
+
+connection d;
+--error 1205
+reap;
+
+connection e;
+--error 1205
+reap;
+
+connection f;
+--error 1205
+reap;
+
+connection g;
+--error 1205
+reap;
+
+connection h;
+--error 1205
+reap;
+
+connection i;
+--error 1205
+reap;
+
+connection j;
+--error 1205
+reap;
+
+connection a;
+commit;
+
+connection default;
+disconnect a;
+disconnect b;
+disconnect c;
+disconnect d;
+disconnect e;
+disconnect f;
+disconnect g;
+disconnect h;
+disconnect i;
+disconnect j;
+drop table t1, t2, t3, t5, t6, t8, t9;
+
+# bug 18934, "InnoDB crashes when table uses column names like DB_ROW_ID"
+--error 1005
+CREATE TABLE t1 (DB_ROW_ID int) engine=innodb;
+
+#
+# Bug #17152: Wrong result with BINARY comparison on aliased column
+#
+
+CREATE TABLE t1 (
+ a BIGINT(20) NOT NULL,
+ PRIMARY KEY (a)
+ ) ENGINE=INNODB DEFAULT CHARSET=UTF8;
+
+CREATE TABLE t2 (
+ a BIGINT(20) NOT NULL,
+ b VARCHAR(128) NOT NULL,
+ c TEXT NOT NULL,
+ PRIMARY KEY (a,b),
+ KEY idx_t2_b_c (b,c(200)),
+ CONSTRAINT t_fk FOREIGN KEY (a) REFERENCES t1 (a)
+ ON DELETE CASCADE
+ ) ENGINE=INNODB DEFAULT CHARSET=UTF8;
+
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1, 'bar', 'vbar');
+INSERT INTO t2 VALUES (1, 'BAR2', 'VBAR');
+INSERT INTO t2 VALUES (1, 'bar_bar', 'bibi');
+INSERT INTO t2 VALUES (1, 'customer_over', '1');
+
+SELECT * FROM t2 WHERE b = 'customer_over';
+SELECT * FROM t2 WHERE BINARY b = 'customer_over';
+SELECT DISTINCT p0.a FROM t2 p0 WHERE p0.b = 'customer_over';
+/* Bang: Empty result set, above was expected: */
+SELECT DISTINCT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over';
+SELECT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over';
+
+drop table t2, t1;
+
+#
+# Test optimize on table with open transaction
+#
+
+CREATE TABLE t1 ( a int ) ENGINE=innodb;
+BEGIN;
+INSERT INTO t1 VALUES (1);
+OPTIMIZE TABLE t1;
+DROP TABLE t1;
+
+#
+# Bug #24741 (existing cascade clauses disappear when adding foreign keys)
+#
+
+CREATE TABLE t1 (id int PRIMARY KEY, f int NOT NULL, INDEX(f)) ENGINE=InnoDB;
+
+CREATE TABLE t2 (id int PRIMARY KEY, f INT NOT NULL,
+ CONSTRAINT t2_t1 FOREIGN KEY (id) REFERENCES t1 (id)
+ ON DELETE CASCADE ON UPDATE CASCADE) ENGINE=InnoDB;
+
+ALTER TABLE t2 ADD FOREIGN KEY (f) REFERENCES t1 (f) ON
+DELETE CASCADE ON UPDATE CASCADE;
+
+SHOW CREATE TABLE t2;
+DROP TABLE t2, t1;
+
+#
+# Bug #25927: Prevent ALTER TABLE ... MODIFY ... NOT NULL on columns
+# for which there is a foreign key constraint ON ... SET NULL.
+#
+
+CREATE TABLE t1 (a INT, INDEX(a)) ENGINE=InnoDB;
+CREATE TABLE t2 (a INT, INDEX(a)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1 (a) ON DELETE SET NULL;
+# mysqltest first does replace_regex, then replace_result
+--replace_regex /'[^']*test\/#sql-[0-9a-f_]*'/'#sql-temporary'/
+# Embedded server doesn't chdir to data directory
+--replace_result $MYSQLD_DATADIR ./ master-data/ ''
+--error 1025
+ALTER TABLE t2 MODIFY a INT NOT NULL;
+DELETE FROM t1;
+DROP TABLE t2,t1;
+
+#
+# Bug #26835: table corruption after delete+insert
+#
+
+CREATE TABLE t1 (a VARCHAR(5) COLLATE utf8_unicode_ci PRIMARY KEY)
+ENGINE=InnoDB;
+INSERT INTO t1 VALUES (0xEFBCA4EFBCA4EFBCA4);
+DELETE FROM t1;
+INSERT INTO t1 VALUES ('DDD');
+SELECT * FROM t1;
+DROP TABLE t1;
+
+#
+# Bug #23313 (AUTO_INCREMENT=# not reported back for InnoDB tables)
+# Bug #21404 (AUTO_INCREMENT value reset when Adding FKEY (or ALTER?))
+#
+
+CREATE TABLE t1 (id int PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB
+AUTO_INCREMENT=42;
+
+INSERT INTO t1 VALUES (0),(347),(0);
+SELECT * FROM t1;
+
+SHOW CREATE TABLE t1;
+
+CREATE TABLE t2 (id int PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t2 VALUES(42),(347),(348);
+ALTER TABLE t1 ADD CONSTRAINT t1_t2 FOREIGN KEY (id) REFERENCES t2(id);
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1,t2;
+
+#
+# Bug #21101 (Prints wrong error message if max row size is too large)
+#
+--error 1118
+CREATE TABLE t1 (
+ c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255),
+ c05 CHAR(255), c06 CHAR(255), c07 CHAR(255), c08 CHAR(255),
+ c09 CHAR(255), c10 CHAR(255), c11 CHAR(255), c12 CHAR(255),
+ c13 CHAR(255), c14 CHAR(255), c15 CHAR(255), c16 CHAR(255),
+ c17 CHAR(255), c18 CHAR(255), c19 CHAR(255), c20 CHAR(255),
+ c21 CHAR(255), c22 CHAR(255), c23 CHAR(255), c24 CHAR(255),
+ c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255),
+ c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255)
+ ) ENGINE = InnoDB;
+
+#
+# Bug #31860 InnoDB assumes AUTOINC values can only be positive.
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(
+ id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY
+ ) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(-10);
+SELECT * FROM t1;
+#
+# NOTE: The server really needs to be restarted at this point
+# for the test to be useful.
+#
+# Without the fix InnoDB would trip over an assertion here.
+INSERT INTO t1 VALUES(NULL);
+# The next value should be 1 and not -9 or a -ve number
+SELECT * FROM t1;
+DROP TABLE t1;
+
+#
+# Bug #21409 Incorrect result returned when in READ-COMMITTED with
+# query_cache ON
+#
+CONNECT (c1,localhost,root,,);
+CONNECT (c2,localhost,root,,);
+CONNECTION c1;
+SET binlog_format='MIXED';
+SET TX_ISOLATION='read-committed';
+SET AUTOCOMMIT=0;
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 ( a int ) ENGINE=InnoDB;
+CREATE TABLE t2 LIKE t1;
+SELECT * FROM t2;
+CONNECTION c2;
+SET binlog_format='MIXED';
+SET TX_ISOLATION='read-committed';
+SET AUTOCOMMIT=0;
+INSERT INTO t1 VALUES (1);
+COMMIT;
+CONNECTION c1;
+SELECT * FROM t1 WHERE a=1;
+DISCONNECT c1;
+DISCONNECT c2;
+CONNECT (c1,localhost,root,,);
+CONNECT (c2,localhost,root,,);
+CONNECTION c1;
+SET binlog_format='MIXED';
+SET TX_ISOLATION='read-committed';
+SET AUTOCOMMIT=0;
+SELECT * FROM t2;
+CONNECTION c2;
+SET binlog_format='MIXED';
+SET TX_ISOLATION='read-committed';
+SET AUTOCOMMIT=0;
+INSERT INTO t1 VALUES (2);
+COMMIT;
+CONNECTION c1;
+# The result set below should be the same for both selects
+SELECT * FROM t1 WHERE a=2;
+SELECT * FROM t1 WHERE a=2;
+DROP TABLE t1;
+DROP TABLE t2;
+DISCONNECT c1;
+DISCONNECT c2;
+CONNECTION default;
+
+#
+# Bug #29157 UPDATE, changed rows incorrect
+#
+create table t1 (i int, j int) engine=innodb;
+insert into t1 (i, j) values (1, 1), (2, 2);
+--enable_info
+update t1 set j = 2;
+--disable_info
+drop table t1;
+
+#
+# Bug #32440 InnoDB free space info does not appear in SHOW TABLE STATUS or
+# I_S
+#
+create table t1 (id int) comment='this is a comment' engine=innodb;
+select table_comment, data_free > 0 as data_free_is_set
+ from information_schema.tables
+ where table_schema='test' and table_name = 't1';
+drop table t1;
+
+#
+# Bug 34920 test
+#
+CONNECTION default;
+CREATE TABLE t1 (
+ c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ c2 VARCHAR(128) NOT NULL,
+ PRIMARY KEY(c1)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=100;
+
+CREATE TABLE t2 (
+ c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ c2 INT(10) UNSIGNED DEFAULT NULL,
+ PRIMARY KEY(c1)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=200;
+
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2';
+ALTER TABLE t2 ADD CONSTRAINT t1_t2_1 FOREIGN KEY(c1) REFERENCES t1(c1);
+SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2';
+DROP TABLE t2;
+DROP TABLE t1;
+# End 34920 test
+#
+# Bug #29507 TRUNCATE shows to many rows effected
+#
+CONNECTION default;
+CREATE TABLE t1 (c1 int default NULL,
+ c2 int default NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--enable_info
+TRUNCATE TABLE t1;
+
+INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
+TRUNCATE TABLE t1;
+
+--disable_info
+DROP TABLE t1;
+#
+# Bug#35537 Innodb doesn't increment handler_update and handler_delete.
+#
+-- disable_query_log
+-- disable_result_log
+
+CONNECT (c1,localhost,root,,);
+
+DROP TABLE IF EXISTS bug35537;
+CREATE TABLE bug35537 (
+ c1 int
+) ENGINE=InnoDB;
+
+INSERT INTO bug35537 VALUES (1);
+
+-- enable_result_log
+
+SHOW SESSION STATUS LIKE 'Handler_update%';
+SHOW SESSION STATUS LIKE 'Handler_delete%';
+
+UPDATE bug35537 SET c1 = 2 WHERE c1 = 1;
+DELETE FROM bug35537 WHERE c1 = 2;
+
+SHOW SESSION STATUS LIKE 'Handler_update%';
+SHOW SESSION STATUS LIKE 'Handler_delete%';
+
+DROP TABLE bug35537;
+
+DISCONNECT c1;
+CONNECTION default;
+
+SET GLOBAL innodb_thread_concurrency = @innodb_thread_concurrency_orig;
+
+#######################################################################
+# #
+# Please, DO NOT TOUCH this file as well as the innodb.result file. #
+# These files are to be modified ONLY BY INNOBASE guys. #
+# #
+# Use innodb_mysql.[test|result] files instead. #
+# #
+# If nevertheless you need to make some changes here, please, forward #
+# your commit message #
+# To: innodb_dev_ww@oracle.com #
+# Cc: dev-innodb@mysql.com #
+# (otherwise your changes may be erased). #
+# #
+#######################################################################
diff --git a/mysql-test/t/innodb_trx_weight.test b/mysql-test/suite/innodb/t/innodb_trx_weight.test
index b72eaad345f..b72eaad345f 100644
--- a/mysql-test/t/innodb_trx_weight.test
+++ b/mysql-test/suite/innodb/t/innodb_trx_weight.test
diff --git a/storage/innodb_plugin/mysql-test/ctype_innodb_like.inc b/mysql-test/suite/innodb_plugin/include/ctype_innodb_like.inc
index ae43342885a..ae43342885a 100644
--- a/storage/innodb_plugin/mysql-test/ctype_innodb_like.inc
+++ b/mysql-test/suite/innodb_plugin/include/ctype_innodb_like.inc
diff --git a/mysql-test/suite/innodb/include/innodb-index.inc b/mysql-test/suite/innodb_plugin/include/innodb-index.inc
index 37de3162abe..37de3162abe 100644
--- a/mysql-test/suite/innodb/include/innodb-index.inc
+++ b/mysql-test/suite/innodb_plugin/include/innodb-index.inc
diff --git a/storage/innodb_plugin/mysql-test/innodb_trx_weight.inc b/mysql-test/suite/innodb_plugin/include/innodb_trx_weight.inc
index 56d3d47da36..56d3d47da36 100644
--- a/storage/innodb_plugin/mysql-test/innodb_trx_weight.inc
+++ b/mysql-test/suite/innodb_plugin/include/innodb_trx_weight.inc
diff --git a/mysql-test/suite/innodb/r/innodb-analyze.result b/mysql-test/suite/innodb_plugin/r/innodb-analyze.result
index 2aee004a2d6..2aee004a2d6 100644
--- a/mysql-test/suite/innodb/r/innodb-analyze.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb-analyze.result
diff --git a/mysql-test/suite/innodb_plugin/r/innodb-autoinc-44030.result b/mysql-test/suite/innodb_plugin/r/innodb-autoinc-44030.result
new file mode 100644
index 00000000000..54e972843f5
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/r/innodb-autoinc-44030.result
@@ -0,0 +1,30 @@
+drop table if exists t1;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (null);
+INSERT INTO t1 VALUES (null);
+ALTER TABLE t1 CHANGE c1 d1 INT NOT NULL AUTO_INCREMENT;
+SELECT * FROM t1;
+d1
+1
+2
+SELECT * FROM t1;
+d1
+1
+2
+INSERT INTO t1 VALUES(null);
+ALTER TABLE t1 AUTO_INCREMENT = 3;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `d1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`d1`)
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
+INSERT INTO t1 VALUES(null);
+SELECT * FROM t1;
+d1
+1
+2
+3
+4
+DROP TABLE t1;
diff --git a/storage/innodb_plugin/mysql-test/innodb-autoinc.result b/mysql-test/suite/innodb_plugin/r/innodb-autoinc.result
index d2e8eb19e0c..a36b3a1a865 100644
--- a/storage/innodb_plugin/mysql-test/innodb-autoinc.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb-autoinc.result
@@ -867,25 +867,380 @@ INSERT INTO t2 SELECT NULL FROM t1;
Got one of the listed errors
DROP TABLE t1;
DROP TABLE t2;
-CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (null);
-INSERT INTO t1 VALUES (null);
-ALTER TABLE t1 CHANGE c1 d1 INT NOT NULL AUTO_INCREMENT;
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+Variable_name Value
+auto_increment_increment 1
+auto_increment_offset 1
+CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-127, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` tinyint(4) NOT NULL AUTO_INCREMENT,
+ `c2` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
+SELECT * FROM t1;
+c1 c2
+-127 innodb
+-1 innodb
+1 NULL
+2 NULL
+DROP TABLE t1;
+CREATE TABLE t1 (c1 TINYINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+INSERT INTO t1 VALUES (-127, 'innodb');
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
+ `c2` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
+SELECT * FROM t1;
+c1 c2
+1 NULL
+2 innodb
+3 innodb
+4 NULL
+DROP TABLE t1;
+CREATE TABLE t1 (c1 SMALLINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-32767, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` smallint(6) NOT NULL AUTO_INCREMENT,
+ `c2` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
+SELECT * FROM t1;
+c1 c2
+-32767 innodb
+-1 innodb
+1 NULL
+2 NULL
+DROP TABLE t1;
+CREATE TABLE t1 (c1 SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+INSERT INTO t1 VALUES (-32757, 'innodb');
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
+ `c2` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
+SELECT * FROM t1;
+c1 c2
+1 NULL
+2 innodb
+3 innodb
+4 NULL
+DROP TABLE t1;
+CREATE TABLE t1 (c1 MEDIUMINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-8388607, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `c2` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
+SELECT * FROM t1;
+c1 c2
+-8388607 innodb
+-1 innodb
+1 NULL
+2 NULL
+DROP TABLE t1;
+CREATE TABLE t1 (c1 MEDIUMINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+INSERT INTO t1 VALUES (-8388607, 'innodb');
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
+ `c2` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
SELECT * FROM t1;
-d1
+c1 c2
+1 NULL
+2 innodb
+3 innodb
+4 NULL
+DROP TABLE t1;
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-2147483647, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ `c2` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
+SELECT * FROM t1;
+c1 c2
+-2147483647 innodb
+-1 innodb
+1 NULL
+2 NULL
+DROP TABLE t1;
+CREATE TABLE t1 (c1 INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+INSERT INTO t1 VALUES (-2147483647, 'innodb');
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `c2` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
+SELECT * FROM t1;
+c1 c2
+1 NULL
+2 innodb
+3 innodb
+4 NULL
+DROP TABLE t1;
+CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-9223372036854775807, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` bigint(20) NOT NULL AUTO_INCREMENT,
+ `c2` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
+SELECT * FROM t1;
+c1 c2
+-9223372036854775807 innodb
+-1 innodb
+1 NULL
+2 NULL
+DROP TABLE t1;
+CREATE TABLE t1 (c1 BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+INSERT INTO t1 VALUES (-9223372036854775807, 'innodb');
+Warnings:
+Warning 1264 Out of range value for column 'c1' at row 1
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+ `c2` varchar(10) DEFAULT NULL,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
+SELECT * FROM t1;
+c1 c2
+1 NULL
+2 innodb
+3 innodb
+4 NULL
+DROP TABLE t1;
+CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) AUTO_INCREMENT=10 ENGINE=InnoDB;
+CREATE INDEX i1 on t1(c2);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ `c2` int(11) DEFAULT NULL,
+ PRIMARY KEY (`c1`),
+ KEY `i1` (`c2`)
+) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1
+INSERT INTO t1 (c2) values (0);
+SELECT * FROM t1;
+c1 c2
+10 0
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1(C1 DOUBLE AUTO_INCREMENT KEY, C2 CHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1(C1, C2) VALUES (1, 'innodb'), (3, 'innodb');
+INSERT INTO t1(C2) VALUES ('innodb');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `C1` double NOT NULL AUTO_INCREMENT,
+ `C2` char(10) DEFAULT NULL,
+ PRIMARY KEY (`C1`)
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1(C1 FLOAT AUTO_INCREMENT KEY, C2 CHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1(C1, C2) VALUES (1, 'innodb'), (3, 'innodb');
+INSERT INTO t1(C2) VALUES ('innodb');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `C1` float NOT NULL AUTO_INCREMENT,
+ `C2` char(10) DEFAULT NULL,
+ PRIMARY KEY (`C1`)
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (c1 INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 SET c1 = 1;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
+INSERT INTO t1 SET c1 = 2;
+INSERT INTO t1 SET c1 = -1;
+SELECT * FROM t1;
+c1
+-1
1
-3
+2
+INSERT INTO t1 SET c1 = -1;
+Got one of the listed errors
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
+REPLACE INTO t1 VALUES (-1);
+SELECT * FROM t1;
+c1
+-1
+1
+2
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (-685113344), (1), (NULL), (NULL);
SELECT * FROM t1;
-d1
+c1
+-685113344
1
+2
3
-INSERT INTO t1 VALUES(null);
-Got one of the listed errors
-ALTER TABLE t1 AUTO_INCREMENT = 3;
-INSERT INTO t1 VALUES(null);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (-685113344), (2), (NULL), (NULL);
+SELECT * FROM t1;
+c1
+-685113344
+2
+3
+4
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL), (2), (-685113344), (NULL);
+INSERT INTO t1 VALUES (4), (5), (6), (NULL);
SELECT * FROM t1;
-d1
+c1
+-685113344
1
+2
3
4
+5
+6
+7
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL), (2), (-685113344), (5);
+SELECT * FROM t1;
+c1
+-685113344
+1
+2
+5
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1), (2), (-685113344), (NULL);
+SELECT * FROM t1;
+c1
+-685113344
+1
+2
+3
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`c1`)
+) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb-consistent.result b/mysql-test/suite/innodb_plugin/r/innodb-consistent.result
index 9115791b99c..9115791b99c 100644
--- a/mysql-test/suite/innodb/r/innodb-consistent.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb-consistent.result
diff --git a/mysql-test/suite/innodb/r/innodb-index.result b/mysql-test/suite/innodb_plugin/r/innodb-index.result
index f86fcd4a8ef..f86fcd4a8ef 100644
--- a/mysql-test/suite/innodb/r/innodb-index.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb-index.result
diff --git a/mysql-test/suite/innodb/r/innodb-index_ucs2.result b/mysql-test/suite/innodb_plugin/r/innodb-index_ucs2.result
index c8a1e8c7da1..c8a1e8c7da1 100644
--- a/mysql-test/suite/innodb/r/innodb-index_ucs2.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb-index_ucs2.result
diff --git a/storage/innodb_plugin/mysql-test/innodb-lock.result b/mysql-test/suite/innodb_plugin/r/innodb-lock.result
index 4ace4065c34..4ace4065c34 100644
--- a/storage/innodb_plugin/mysql-test/innodb-lock.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb-lock.result
diff --git a/storage/innodb_plugin/mysql-test/innodb-replace.result b/mysql-test/suite/innodb_plugin/r/innodb-replace.result
index c926bb89a2e..c926bb89a2e 100644
--- a/storage/innodb_plugin/mysql-test/innodb-replace.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb-replace.result
diff --git a/storage/innodb_plugin/mysql-test/innodb-semi-consistent.result b/mysql-test/suite/innodb_plugin/r/innodb-semi-consistent.result
index ca0e362ef80..ca0e362ef80 100644
--- a/storage/innodb_plugin/mysql-test/innodb-semi-consistent.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb-semi-consistent.result
diff --git a/mysql-test/suite/innodb/r/innodb-timeout.result b/mysql-test/suite/innodb_plugin/r/innodb-timeout.result
index be9a688cd72..be9a688cd72 100644
--- a/mysql-test/suite/innodb/r/innodb-timeout.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb-timeout.result
diff --git a/mysql-test/suite/innodb/r/innodb-use-sys-malloc.result b/mysql-test/suite/innodb_plugin/r/innodb-use-sys-malloc.result
index 2ec4c7c8130..2ec4c7c8130 100644
--- a/mysql-test/suite/innodb/r/innodb-use-sys-malloc.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb-use-sys-malloc.result
diff --git a/mysql-test/suite/innodb/r/innodb-zip.result b/mysql-test/suite/innodb_plugin/r/innodb-zip.result
index 21396d81ba8..21396d81ba8 100644
--- a/mysql-test/suite/innodb/r/innodb-zip.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb-zip.result
diff --git a/storage/innodb_plugin/mysql-test/innodb.result b/mysql-test/suite/innodb_plugin/r/innodb.result
index bdae7633fd1..e435c0f68ca 100644
--- a/storage/innodb_plugin/mysql-test/innodb.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb.result
@@ -692,6 +692,8 @@ select count(*) from t1 where sca_pic is null;
count(*)
2
alter table t1 drop index sca_pic, add index sca_pic (cat_code, sca_pic);
+alter table t1 drop index sca_pic;
+alter table t1 add index sca_pic (cat_code, sca_pic);
select count(*) from t1 where sca_code='PD' and sca_pic is null;
count(*)
1
@@ -699,6 +701,9 @@ select count(*) from t1 where cat_code='E';
count(*)
0
alter table t1 drop index sca_pic, add index (sca_pic, cat_code);
+ERROR 42000: Incorrect index name 'sca_pic'
+alter table t1 drop index sca_pic;
+alter table t1 add index (sca_pic, cat_code);
select count(*) from t1 where sca_code='PD' and sca_pic is null;
count(*)
1
@@ -1747,7 +1752,7 @@ variable_value - @innodb_rows_deleted_orig
71
SELECT variable_value - @innodb_rows_inserted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted';
variable_value - @innodb_rows_inserted_orig
-1084
+1087
SELECT variable_value - @innodb_rows_updated_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated';
variable_value - @innodb_rows_updated_orig
885
@@ -1833,6 +1838,7 @@ show variables like "innodb_thread_sleep_delay";
Variable_name Value
innodb_thread_sleep_delay 10000
set storage_engine=INNODB;
+set session old_alter_table=1;
drop table if exists t1,t2,t3;
--- Testing varchar ---
--- Testing varchar ---
@@ -1970,7 +1976,7 @@ explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a '
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref v v 13 const # Using where; Using index
alter table t1 add unique(v);
-ERROR 23000: Duplicate entry 'v' for key 'v_2'
+ERROR 23000: Duplicate entry '{ ' for key 'v_2'
alter table t1 add key(v);
select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a';
qq
@@ -2406,6 +2412,7 @@ select * from t1 where a=20 and b is null;
a b
20 NULL
drop table t1;
+set session old_alter_table=0;
create table t1 (v varchar(65530), key(v));
Warnings:
Warning 1071 Specified key was too long; max key length is 767 bytes
@@ -3088,7 +3095,7 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit;
drop table t1, t2, t3, t5, t6, t8, t9;
CREATE TABLE t1 (DB_ROW_ID int) engine=innodb;
-ERROR HY000: Can't create table 'test.t1' (errno: -1)
+ERROR 42000: Incorrect column name 'DB_ROW_ID'
CREATE TABLE t1 (
a BIGINT(20) NOT NULL,
PRIMARY KEY (a)
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug21704.result b/mysql-test/suite/innodb_plugin/r/innodb_bug21704.result
index b8e0b15d50d..ffbfa8a337e 100644
--- a/storage/innodb_plugin/mysql-test/innodb_bug21704.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug21704.result
@@ -25,8 +25,8 @@ ALTER TABLE t1 CHANGE a c INT;
ERROR HY000: Error on rename of '#sql-temporary' to './test/t1' (errno: 150)
# Ensure that online column rename works.
ALTER TABLE t1 CHANGE b c INT;
-affected rows: 0
-info: Records: 0 Duplicates: 0 Warnings: 0
+affected rows: 3
+info: Records: 3 Duplicates: 0 Warnings: 0
# Test renaming the column in the referencing table
@@ -34,8 +34,8 @@ ALTER TABLE t2 CHANGE a c INT;
ERROR HY000: Error on rename of '#sql-temporary' to './test/t2' (errno: 150)
# Ensure that online column rename works.
ALTER TABLE t2 CHANGE b c INT;
-affected rows: 0
-info: Records: 0 Duplicates: 0 Warnings: 0
+affected rows: 3
+info: Records: 3 Duplicates: 0 Warnings: 0
# Test with self-referential constraints
@@ -45,8 +45,8 @@ ALTER TABLE t3 CHANGE b d INT;
ERROR HY000: Error on rename of '#sql-temporary' to './test/t3' (errno: 150)
# Ensure that online column rename works.
ALTER TABLE t3 CHANGE c d INT;
-affected rows: 0
-info: Records: 0 Duplicates: 0 Warnings: 0
+affected rows: 3
+info: Records: 3 Duplicates: 0 Warnings: 0
# Cleanup.
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug34053.result b/mysql-test/suite/innodb_plugin/r/innodb_bug34053.result
index 195775f74c8..195775f74c8 100644
--- a/storage/innodb_plugin/mysql-test/innodb_bug34053.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug34053.result
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug34300.result b/mysql-test/suite/innodb_plugin/r/innodb_bug34300.result
index ae9fee81ad7..ae9fee81ad7 100644
--- a/storage/innodb_plugin/mysql-test/innodb_bug34300.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug34300.result
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug35220.result b/mysql-test/suite/innodb_plugin/r/innodb_bug35220.result
index 195775f74c8..195775f74c8 100644
--- a/storage/innodb_plugin/mysql-test/innodb_bug35220.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug35220.result
diff --git a/mysql-test/suite/innodb/r/innodb_bug36169.result b/mysql-test/suite/innodb_plugin/r/innodb_bug36169.result
index aa80e4d7aa4..aa80e4d7aa4 100644
--- a/mysql-test/suite/innodb/r/innodb_bug36169.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug36169.result
diff --git a/mysql-test/suite/innodb/r/innodb_bug36172.result b/mysql-test/suite/innodb_plugin/r/innodb_bug36172.result
index 195775f74c8..195775f74c8 100644
--- a/mysql-test/suite/innodb/r/innodb_bug36172.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug36172.result
diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug38231.result b/mysql-test/suite/innodb_plugin/r/innodb_bug38231.result
new file mode 100644
index 00000000000..2f909779755
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug38231.result
@@ -0,0 +1,11 @@
+SET storage_engine=InnoDB;
+INSERT INTO bug38231 VALUES (1), (10), (300);
+SET autocommit=0;
+SELECT * FROM bug38231 FOR UPDATE;
+a
+1
+10
+300
+TRUNCATE TABLE bug38231;
+COMMIT;
+DROP TABLE bug38231;
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug36172.result b/mysql-test/suite/innodb_plugin/r/innodb_bug39438.result
index 195775f74c8..195775f74c8 100644
--- a/storage/innodb_plugin/mysql-test/innodb_bug36172.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug39438.result
diff --git a/mysql-test/suite/innodb/r/innodb_bug40360.result b/mysql-test/suite/innodb_plugin/r/innodb_bug40360.result
index ef4cf463903..ef4cf463903 100644
--- a/mysql-test/suite/innodb/r/innodb_bug40360.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug40360.result
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug40565.result b/mysql-test/suite/innodb_plugin/r/innodb_bug40565.result
index 21e923d9336..21e923d9336 100644
--- a/storage/innodb_plugin/mysql-test/innodb_bug40565.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug40565.result
diff --git a/mysql-test/suite/innodb/r/innodb_bug41904.result b/mysql-test/suite/innodb_plugin/r/innodb_bug41904.result
index 6070d32d181..6070d32d181 100644
--- a/mysql-test/suite/innodb/r/innodb_bug41904.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug41904.result
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug42101-nonzero.result b/mysql-test/suite/innodb_plugin/r/innodb_bug42101-nonzero.result
index 277dfffdd35..277dfffdd35 100644
--- a/storage/innodb_plugin/mysql-test/innodb_bug42101-nonzero.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug42101-nonzero.result
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug42101.result b/mysql-test/suite/innodb_plugin/r/innodb_bug42101.result
index 805097ffe9d..805097ffe9d 100644
--- a/storage/innodb_plugin/mysql-test/innodb_bug42101.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug42101.result
diff --git a/mysql-test/suite/innodb/r/innodb_bug44032.result b/mysql-test/suite/innodb_plugin/r/innodb_bug44032.result
index da2a000b06e..da2a000b06e 100644
--- a/mysql-test/suite/innodb/r/innodb_bug44032.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug44032.result
diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug44369.result b/mysql-test/suite/innodb_plugin/r/innodb_bug44369.result
new file mode 100644
index 00000000000..ff25c774aa2
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug44369.result
@@ -0,0 +1,6 @@
+create table bug44369 (DB_ROW_ID int) engine=innodb;
+ERROR 42000: Incorrect column name 'DB_ROW_ID'
+create table bug44369 (db_row_id int) engine=innodb;
+ERROR 42000: Incorrect column name 'db_row_id'
+create table bug44369 (db_TRX_Id int) engine=innodb;
+ERROR 42000: Incorrect column name 'db_TRX_Id'
diff --git a/mysql-test/suite/innodb/r/innodb_bug44571.result b/mysql-test/suite/innodb_plugin/r/innodb_bug44571.result
index 7ee7820a02d..7ee7820a02d 100644
--- a/mysql-test/suite/innodb/r/innodb_bug44571.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug44571.result
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug45357.result b/mysql-test/suite/innodb_plugin/r/innodb_bug45357.result
index 7adeff2062f..7adeff2062f 100644
--- a/storage/innodb_plugin/mysql-test/innodb_bug45357.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug45357.result
diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug46000.result b/mysql-test/suite/innodb_plugin/r/innodb_bug46000.result
new file mode 100644
index 00000000000..c8e3db8d641
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug46000.result
@@ -0,0 +1,19 @@
+create table bug46000(`id` int,key `GEN_CLUST_INDEX`(`id`))engine=innodb;
+ERROR 42000: Incorrect index name 'GEN_CLUST_INDEX'
+create table bug46000(`id` int, key `GEN_clust_INDEX`(`id`))engine=innodb;
+ERROR 42000: Incorrect index name 'GEN_CLUST_INDEX'
+show warnings;
+Level Code Message
+Warning 1280 Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index.
+Error 1280 Incorrect index name 'GEN_CLUST_INDEX'
+Error 1005 Can't create table 'test.bug46000' (errno: -1)
+create table bug46000(id int) engine=innodb;
+create index GEN_CLUST_INDEX on bug46000(id);
+ERROR 42000: Incorrect index name 'GEN_CLUST_INDEX'
+show warnings;
+Level Code Message
+Warning 1280 Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index.
+Error 1280 Incorrect index name 'GEN_CLUST_INDEX'
+Error 1030 Got error -1 from storage engine
+create index idx on bug46000(id);
+drop table bug46000;
diff --git a/mysql-test/suite/innodb/r/innodb_bug46676.result b/mysql-test/suite/innodb_plugin/r/innodb_bug46676.result
index 996799ce931..996799ce931 100644
--- a/mysql-test/suite/innodb/r/innodb_bug46676.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug46676.result
diff --git a/mysql-test/suite/innodb/r/innodb_bug47167.result b/mysql-test/suite/innodb_plugin/r/innodb_bug47167.result
index cbec363d78f..cbec363d78f 100644
--- a/mysql-test/suite/innodb/r/innodb_bug47167.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug47167.result
diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug47621.result b/mysql-test/suite/innodb_plugin/r/innodb_bug47621.result
new file mode 100644
index 00000000000..c5f56c09788
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug47621.result
@@ -0,0 +1,21 @@
+CREATE TABLE bug47621 (salesperson INT) ENGINE=InnoDB;
+ALTER TABLE bug47621 CHANGE salesperson sales_acct_id INT;
+create index orgs on bug47621(sales_acct_id);
+ALTER TABLE bug47621 CHANGE sales_acct_id salesperson INT;
+drop table bug47621;
+CREATE TABLE bug47621_sale (
+salesperson INT,
+PRIMARY KEY(salesperson)) engine = innodb;
+CREATE TABLE bug47621_shirt(
+id SMALLINT,
+owner INT,
+FOREIGN KEY(owner)
+references bug47621_sale(salesperson) ON DELETE RESTRICT)
+engine = innodb;
+insert into bug47621_sale values(9);
+insert into bug47621_shirt values(1, 9);
+ALTER TABLE bug47621_shirt CHANGE id new_id INT;
+drop table bug47621_shirt;
+ALTER TABLE bug47621_sale CHANGE salesperson sales_acct_id INT;
+ALTER TABLE bug47621_sale ADD INDEX idx (sales_acct_id);
+drop table bug47621_sale;
diff --git a/mysql-test/suite/innodb/r/innodb_bug47622.result b/mysql-test/suite/innodb_plugin/r/innodb_bug47622.result
index f5d13711c52..f5d13711c52 100644
--- a/mysql-test/suite/innodb/r/innodb_bug47622.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug47622.result
diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug47777.result b/mysql-test/suite/innodb_plugin/r/innodb_bug47777.result
new file mode 100644
index 00000000000..fbba47edcfc
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug47777.result
@@ -0,0 +1,13 @@
+create table bug47777(c2 linestring not null, primary key (c2(1))) engine=innodb;
+insert into bug47777 values (geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)'));
+select count(*) from bug47777 where c2 =geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)');
+count(*)
+1
+update bug47777 set c2=GeomFromText('POINT(1 1)');
+select count(*) from bug47777 where c2 =geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)');
+count(*)
+0
+select count(*) from bug47777 where c2 = GeomFromText('POINT(1 1)');
+count(*)
+1
+drop table bug47777;
diff --git a/mysql-test/suite/innodb/r/innodb_bug51378.result b/mysql-test/suite/innodb_plugin/r/innodb_bug51378.result
index a3ca73c16a9..a3ca73c16a9 100644
--- a/mysql-test/suite/innodb/r/innodb_bug51378.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug51378.result
diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug51920.result b/mysql-test/suite/innodb_plugin/r/innodb_bug51920.result
new file mode 100644
index 00000000000..7ded141c239
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug51920.result
@@ -0,0 +1,13 @@
+CREATE TABLE bug51920 (i INT) ENGINE=InnoDB;
+INSERT INTO bug51920 VALUES (1);
+BEGIN;
+SELECT * FROM bug51920 FOR UPDATE;
+i
+1
+UPDATE bug51920 SET i=2;
+SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST
+WHERE INFO="UPDATE bug51920 SET i=2"
+INTO @thread_id;
+KILL @thread_id;
+Got one of the listed errors
+DROP TABLE bug51920;
diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug52663.result b/mysql-test/suite/innodb_plugin/r/innodb_bug52663.result
new file mode 100644
index 00000000000..89add18617b
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug52663.result
@@ -0,0 +1,26 @@
+set session transaction isolation level read committed;
+create table innodb_bug52663 (what varchar(5), id integer, count integer, primary key
+(what, id)) engine=innodb;
+insert into innodb_bug52663 values ('total', 0, 0);
+begin;
+set session transaction isolation level read committed;
+begin;
+update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0;
+select * from innodb_bug52663;
+what id count
+total 0 1
+update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+select * from innodb_bug52663;
+what id count
+total 0 0
+commit;
+update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0;
+commit;
+select * from innodb_bug52663;
+what id count
+total 0 2
+select * from innodb_bug52663;
+what id count
+total 0 2
+drop table innodb_bug52663;
diff --git a/mysql-test/suite/innodb_plugin/r/innodb_bug52745.result b/mysql-test/suite/innodb_plugin/r/innodb_bug52745.result
new file mode 100644
index 00000000000..254c6525257
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/r/innodb_bug52745.result
@@ -0,0 +1,130 @@
+SET GLOBAL innodb_file_format='Barracuda';
+SET GLOBAL innodb_file_per_table=on;
+CREATE TABLE bug52745 (
+a2 int(10) unsigned DEFAULT NULL,
+col37 time DEFAULT NULL,
+col38 char(229) CHARACTER SET utf8 DEFAULT NULL,
+col39 text,
+col40 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+col41 int(10) unsigned DEFAULT NULL,
+col42 varchar(248) CHARACTER SET utf8 DEFAULT NULL,
+col43 smallint(5) unsigned zerofill DEFAULT NULL,
+col44 varchar(150) CHARACTER SET utf8 DEFAULT NULL,
+col45 float unsigned zerofill DEFAULT NULL,
+col46 binary(1) DEFAULT NULL,
+col47 tinyint(4) DEFAULT NULL,
+col48 tinyint(1) DEFAULT NULL,
+col49 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+col50 binary(1) DEFAULT NULL,
+col51 double unsigned zerofill DEFAULT NULL,
+col52 int(10) unsigned DEFAULT NULL,
+col53 time DEFAULT NULL,
+col54 double unsigned DEFAULT NULL,
+col55 time DEFAULT NULL,
+col56 mediumtext CHARACTER SET latin2,
+col57 blob,
+col58 decimal(52,16) unsigned zerofill NOT NULL DEFAULT '000000000000000000000000000000000000.0000000000000000',
+col59 binary(1) DEFAULT NULL,
+col60 longblob,
+col61 time DEFAULT NULL,
+col62 longtext CHARACTER SET utf8 COLLATE utf8_persian_ci,
+col63 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+col64 int(10) unsigned DEFAULT NULL,
+col65 date DEFAULT NULL,
+col66 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+col67 binary(1) DEFAULT NULL,
+col68 tinyblob,
+col69 date DEFAULT NULL,
+col70 tinyint(3) unsigned zerofill DEFAULT NULL,
+col71 varchar(44) CHARACTER SET utf8 DEFAULT NULL,
+col72 datetime DEFAULT NULL,
+col73 smallint(5) unsigned zerofill DEFAULT NULL,
+col74 longblob,
+col75 bit(34) DEFAULT NULL,
+col76 float unsigned zerofill DEFAULT NULL,
+col77 year(2) DEFAULT NULL,
+col78 tinyint(3) unsigned DEFAULT NULL,
+col79 set('msfheowh','tbpxbgf','by','wahnrjw','myqfasxz','rsokyumrt') CHARACTER SET latin2 DEFAULT NULL,
+col80 datetime DEFAULT NULL,
+col81 smallint(6) DEFAULT NULL,
+col82 enum('xtaurnqfqz','rifrse','kuzwpbvb','niisabk','zxavro','rbvasv','','uulrfaove','','') DEFAULT NULL,
+col83 bigint(20) unsigned zerofill DEFAULT NULL,
+col84 float unsigned zerofill DEFAULT NULL,
+col85 double DEFAULT NULL,
+col86 enum('ylannv','','vlkhycqc','snke','cxifustp','xiaxaswzp','oxl') CHARACTER SET latin1 COLLATE latin1_german2_ci DEFAULT NULL,
+col87 varbinary(221) DEFAULT NULL,
+col88 double unsigned DEFAULT NULL,
+col89 float unsigned zerofill DEFAULT NULL,
+col90 tinyblob
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
+Warnings:
+Note 1291 Column 'col82' has duplicated value '' in ENUM
+Note 1291 Column 'col82' has duplicated value '' in ENUM
+INSERT INTO bug52745 SET
+col40='0000-00-00 00:00:00',
+col51=16547,
+col53='7711484',
+col54=-28604,
+col55='7112612',
+col56='wakefulness\'',
+col57=repeat('absorbefacient\'',106),
+col58=11027,
+col59='AM09gW7',
+col60=repeat('Noelani\'',16),
+col61='2520576',
+col62='substitutiv',
+col63='19950106155112',
+col64=-12038,
+col65='86238806',
+col66='19600719080256',
+col68=repeat('Sagittarius\'',54),
+col69='38943902',
+col70=1232,
+col71='Elora\'',
+col74=repeat('zipp',11),
+col75='0',
+col76=23254,
+col78=13247,
+col79='56219',
+col80='20500609035724',
+col81=11632,
+col82=7,
+col84=-23863,
+col85=6341,
+col87='HZdkf.4 s7t,5Rmq 8so fmr,ruGLUG25TrtI.yQ 2SuHq0ML7rw7.4 b2yf2E5TJxOtBBZImezDnzpj,uPYfznnEUDN1e9aQoO 2DsplB7TFWy oQJ br HLF :F,eQ p4i1oWsr lL3PG,hjCz6hYqN h1QTjLCjrv:QCdSzpYBibJAtZCxLOk3l6Blsh.W',
+col88=16894,
+col89=6161,
+col90=repeat('gale',48);
+Warnings:
+Warning 1265 Data truncated for column 'col53' at row 1
+Warning 1264 Out of range value for column 'col54' at row 1
+Warning 1265 Data truncated for column 'col59' at row 1
+Warning 1265 Data truncated for column 'col61' at row 1
+Warning 1264 Out of range value for column 'col64' at row 1
+Warning 1265 Data truncated for column 'col65' at row 1
+Warning 1264 Out of range value for column 'col66' at row 1
+Warning 1265 Data truncated for column 'col68' at row 1
+Warning 1265 Data truncated for column 'col69' at row 1
+Warning 1264 Out of range value for column 'col70' at row 1
+Warning 1264 Out of range value for column 'col78' at row 1
+Warning 1265 Data truncated for column 'col79' at row 1
+Warning 1264 Out of range value for column 'col84' at row 1
+SHOW WARNINGS;
+Level Code Message
+Warning 1265 Data truncated for column 'col53' at row 1
+Warning 1264 Out of range value for column 'col54' at row 1
+Warning 1265 Data truncated for column 'col59' at row 1
+Warning 1265 Data truncated for column 'col61' at row 1
+Warning 1264 Out of range value for column 'col64' at row 1
+Warning 1265 Data truncated for column 'col65' at row 1
+Warning 1264 Out of range value for column 'col66' at row 1
+Warning 1265 Data truncated for column 'col68' at row 1
+Warning 1265 Data truncated for column 'col69' at row 1
+Warning 1264 Out of range value for column 'col70' at row 1
+Warning 1264 Out of range value for column 'col78' at row 1
+Warning 1265 Data truncated for column 'col79' at row 1
+Warning 1264 Out of range value for column 'col84' at row 1
+DROP TABLE bug52745;
+SET GLOBAL innodb_file_format=Antelope;
+SET GLOBAL innodb_file_format_check=Antelope;
+SET GLOBAL innodb_file_per_table=0;
diff --git a/storage/innodb_plugin/mysql-test/innodb_file_format.result b/mysql-test/suite/innodb_plugin/r/innodb_file_format.result
index 8e9a317308b..86d60706084 100644
--- a/storage/innodb_plugin/mysql-test/innodb_file_format.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb_file_format.result
@@ -30,8 +30,6 @@ select @@innodb_file_format_check;
@@innodb_file_format_check
Barracuda
set global innodb_file_format_check=default;
-Warnings:
-Warning 1210 Ignoring SET innodb_file_format=on
select @@innodb_file_format_check;
@@innodb_file_format_check
Barracuda
diff --git a/mysql-test/suite/innodb/r/innodb_information_schema.result b/mysql-test/suite/innodb_plugin/r/innodb_information_schema.result
index 396cae579ce..396cae579ce 100644
--- a/mysql-test/suite/innodb/r/innodb_information_schema.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb_information_schema.result
diff --git a/storage/innodb_plugin/mysql-test/innodb_trx_weight.result b/mysql-test/suite/innodb_plugin/r/innodb_trx_weight.result
index 195775f74c8..195775f74c8 100644
--- a/storage/innodb_plugin/mysql-test/innodb_trx_weight.result
+++ b/mysql-test/suite/innodb_plugin/r/innodb_trx_weight.result
diff --git a/storage/innodb_plugin/mysql-test/innodb-analyze.test b/mysql-test/suite/innodb_plugin/t/innodb-analyze.test
index 9bdb9db697c..a79c36850dd 100644
--- a/storage/innodb_plugin/mysql-test/innodb-analyze.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb-analyze.test
@@ -3,7 +3,7 @@
# different values of the parameter innodb_stats_sample_pages.
#
--- source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
# we care only that the following SQL commands do not produce errors
# and do not crash the server
diff --git a/mysql-test/suite/innodb_plugin/t/innodb-autoinc-44030.test b/mysql-test/suite/innodb_plugin/t/innodb-autoinc-44030.test
new file mode 100644
index 00000000000..99cdac72e2e
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/t/innodb-autoinc-44030.test
@@ -0,0 +1,43 @@
+-- source include/have_innodb_plugin.inc
+# embedded server ignores 'delayed', so skip this
+-- source include/not_embedded.inc
+
+let $innodb_file_format_check_orig=`select @@innodb_file_format_check`;
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+#
+# 44030: Error: (1500) Couldn't read the MAX(ID) autoinc value from
+# the index (PRIMARY)
+# This test requires a restart of the server
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (null);
+INSERT INTO t1 VALUES (null);
+ALTER TABLE t1 CHANGE c1 d1 INT NOT NULL AUTO_INCREMENT;
+SELECT * FROM t1;
+# Restart the server
+-- source include/restart_mysqld.inc
+# The MySQL and InnoDB data dictionaries should now be out of sync.
+# The select should print message to the error log
+SELECT * FROM t1;
+# MySQL have made a change (http://lists.mysql.com/commits/75268) that no
+# longer results in the two data dictionaries being out of sync. If they
+# revert their changes then this check for ER_AUTOINC_READ_FAILED will need
+# to be enabled. Also, see http://bugs.mysql.com/bug.php?id=47621.
+# -- error ER_AUTOINC_READ_FAILED,1467
+INSERT INTO t1 VALUES(null);
+ALTER TABLE t1 AUTO_INCREMENT = 3;
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES(null);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+#
+# restore environment to the state it was before this test execution
+#
+
+-- disable_query_log
+eval set global innodb_file_format_check=$innodb_file_format_check_orig;
diff --git a/storage/innodb_plugin/mysql-test/innodb-autoinc.test b/mysql-test/suite/innodb_plugin/t/innodb-autoinc.test
index 61c42f45733..5a83ffe3617 100644
--- a/storage/innodb_plugin/mysql-test/innodb-autoinc.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb-autoinc.test
@@ -1,7 +1,9 @@
--- source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
# embedded server ignores 'delayed', so skip this
-- source include/not_embedded.inc
+let $innodb_file_format_check_orig=`select @@innodb_file_format_check`;
+
--disable_warnings
drop table if exists t1;
--enable_warnings
@@ -478,23 +480,194 @@ INSERT INTO t2 SELECT c1 FROM t1;
INSERT INTO t2 SELECT NULL FROM t1;
DROP TABLE t1;
DROP TABLE t2;
+
+# If the user has specified negative values for an AUTOINC column then
+# InnoDB should ignore those values when setting the table's max value.
+SET @@SESSION.AUTO_INCREMENT_INCREMENT=1, @@SESSION.AUTO_INCREMENT_OFFSET=1;
+SHOW VARIABLES LIKE "%auto_inc%";
+# TINYINT
+CREATE TABLE t1 (c1 TINYINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-127, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 TINYINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-127, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
#
-# 44030: Error: (1500) Couldn't read the MAX(ID) autoinc value from
-# the index (PRIMARY)
-# This test requires a restart of the server
-CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (null);
-INSERT INTO t1 VALUES (null);
-ALTER TABLE t1 CHANGE c1 d1 INT NOT NULL AUTO_INCREMENT;
+# SMALLINT
+#
+CREATE TABLE t1 (c1 SMALLINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-32767, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-32757, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
SELECT * FROM t1;
+DROP TABLE t1;
+#
+# MEDIUMINT
+#
+CREATE TABLE t1 (c1 MEDIUMINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-8388607, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 MEDIUMINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-8388607, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+#
+# INT
+#
+CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-2147483647, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 INT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-2147483647, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+#
+# BIGINT
+#
+CREATE TABLE t1 (c1 BIGINT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-9223372036854775807, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (c1 BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1, NULL);
+INSERT INTO t1 VALUES (-1, 'innodb');
+INSERT INTO t1 VALUES (-9223372036854775807, 'innodb');
+INSERT INTO t1 VALUES (NULL, NULL);
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+#
+# End negative number check
+
+##
+# 47125: auto_increment start value is ignored if an index is created
+# and engine=innodb
+#
+CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) AUTO_INCREMENT=10 ENGINE=InnoDB;
+CREATE INDEX i1 on t1(c2);
+SHOW CREATE TABLE t1;
+INSERT INTO t1 (c2) values (0);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+##
+# 49032: Use the correct function to read the AUTOINC column value
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(C1 DOUBLE AUTO_INCREMENT KEY, C2 CHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1(C1, C2) VALUES (1, 'innodb'), (3, 'innodb');
# Restart the server
-- source include/restart_mysqld.inc
-# The MySQL and InnoDB data dictionaries should now be out of sync.
-# The select should print message to the error log
+INSERT INTO t1(C2) VALUES ('innodb');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+CREATE TABLE t1(C1 FLOAT AUTO_INCREMENT KEY, C2 CHAR(10)) ENGINE=InnoDB;
+INSERT INTO t1(C1, C2) VALUES (1, 'innodb'), (3, 'innodb');
+# Restart the server
+-- source include/restart_mysqld.inc
+INSERT INTO t1(C2) VALUES ('innodb');
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+##
+# 47720: REPLACE INTO Autoincrement column with negative values
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 SET c1 = 1;
+SHOW CREATE TABLE t1;
+INSERT INTO t1 SET c1 = 2;
+INSERT INTO t1 SET c1 = -1;
SELECT * FROM t1;
--- error ER_AUTOINC_READ_FAILED,1467
-INSERT INTO t1 VALUES(null);
-ALTER TABLE t1 AUTO_INCREMENT = 3;
-INSERT INTO t1 VALUES(null);
+-- error ER_DUP_ENTRY,1062
+INSERT INTO t1 SET c1 = -1;
+SHOW CREATE TABLE t1;
+REPLACE INTO t1 VALUES (-1);
+SELECT * FROM t1;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+##
+# 49497: Error 1467 (ER_AUTOINC_READ_FAILED) on inserting a negative value
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (-685113344), (1), (NULL), (NULL);
SELECT * FROM t1;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (-685113344), (2), (NULL), (NULL);
+SELECT * FROM t1;
+SHOW CREATE TABLE t1;
DROP TABLE t1;
+CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL), (2), (-685113344), (NULL);
+INSERT INTO t1 VALUES (4), (5), (6), (NULL);
+SELECT * FROM t1;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL), (2), (-685113344), (5);
+SELECT * FROM t1;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+CREATE TABLE t1 (c1 INTEGER AUTO_INCREMENT, PRIMARY KEY (c1)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1), (2), (-685113344), (NULL);
+SELECT * FROM t1;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+#
+# restore environment to the state it was before this test execution
+#
+
+-- disable_query_log
+eval set global innodb_file_format_check=$innodb_file_format_check_orig;
diff --git a/storage/innodb_plugin/mysql-test/innodb-semi-consistent-master.opt b/mysql-test/suite/innodb_plugin/t/innodb-consistent-master.opt
index e76299453d3..e76299453d3 100644
--- a/storage/innodb_plugin/mysql-test/innodb-semi-consistent-master.opt
+++ b/mysql-test/suite/innodb_plugin/t/innodb-consistent-master.opt
diff --git a/mysql-test/suite/innodb/t/innodb-consistent.test b/mysql-test/suite/innodb_plugin/t/innodb-consistent.test
index 25bdf78e96b..475b506525e 100644
--- a/mysql-test/suite/innodb/t/innodb-consistent.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb-consistent.test
@@ -1,6 +1,5 @@
-- source include/not_embedded.inc
--- source include/have_innodb.inc
--- source suite/innodb/include/have_innodb_plugin.inc
+-- source include/have_innodb_plugin.inc
--disable_warnings
drop table if exists t1;
diff --git a/mysql-test/suite/innodb/t/innodb-index.test b/mysql-test/suite/innodb_plugin/t/innodb-index.test
index eeadc0f4783..717c7d4e032 100644
--- a/mysql-test/suite/innodb/t/innodb-index.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb-index.test
@@ -1,4 +1,4 @@
--- source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
let $MYSQLD_DATADIR= `select @@datadir`;
@@ -163,7 +163,7 @@ select * from t2;
drop table t2,t4,t3,t1;
-- let charset = utf8
--- source suite/innodb/include/innodb-index.inc
+-- source suite/innodb_plugin/include/innodb-index.inc
create table t1(a int not null, b int) engine = innodb;
insert into t1 values (1,1),(1,1),(1,1),(1,1);
diff --git a/mysql-test/suite/innodb_plugin/t/innodb-index_ucs2.test b/mysql-test/suite/innodb_plugin/t/innodb-index_ucs2.test
new file mode 100644
index 00000000000..355e12f2f72
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/t/innodb-index_ucs2.test
@@ -0,0 +1,5 @@
+-- source include/have_innodb_plugin.inc
+-- source include/have_ucs2.inc
+
+-- let charset = ucs2
+-- source suite/innodb_plugin/include/innodb-index.inc
diff --git a/storage/innodb_plugin/mysql-test/innodb-lock.test b/mysql-test/suite/innodb_plugin/t/innodb-lock.test
index eacf7e562be..20467236b1c 100644
--- a/storage/innodb_plugin/mysql-test/innodb-lock.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb-lock.test
@@ -1,4 +1,4 @@
--- source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
#
# Check and select innodb lock type
diff --git a/mysql-test/suite/innodb_plugin/t/innodb-master.opt b/mysql-test/suite/innodb_plugin/t/innodb-master.opt
new file mode 100644
index 00000000000..4901efb416c
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/t/innodb-master.opt
@@ -0,0 +1 @@
+--binlog_cache_size=32768 --innodb_lock_wait_timeout=1
diff --git a/storage/innodb_plugin/mysql-test/innodb-replace.test b/mysql-test/suite/innodb_plugin/t/innodb-replace.test
index 8c3aacde5e8..91019a4db16 100644
--- a/storage/innodb_plugin/mysql-test/innodb-replace.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb-replace.test
@@ -1,4 +1,4 @@
--- source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
# embedded server ignores 'delayed', so skip this
-- source include/not_embedded.inc
diff --git a/storage/innodb_plugin/mysql-test/innodb-consistent-master.opt b/mysql-test/suite/innodb_plugin/t/innodb-semi-consistent-master.opt
index 8cca44767da..e76299453d3 100644
--- a/storage/innodb_plugin/mysql-test/innodb-consistent-master.opt
+++ b/mysql-test/suite/innodb_plugin/t/innodb-semi-consistent-master.opt
@@ -1 +1 @@
---innodb_lock_wait_timeout=2
+--innodb_lock_wait_timeout=2
diff --git a/storage/innodb_plugin/mysql-test/innodb-semi-consistent.test b/mysql-test/suite/innodb_plugin/t/innodb-semi-consistent.test
index 61ad7815ca9..00131ffdf54 100644
--- a/storage/innodb_plugin/mysql-test/innodb-semi-consistent.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb-semi-consistent.test
@@ -1,5 +1,5 @@
-- source include/not_embedded.inc
--- source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
--disable_warnings
drop table if exists t1;
diff --git a/storage/innodb_plugin/mysql-test/innodb-timeout.test b/mysql-test/suite/innodb_plugin/t/innodb-timeout.test
index f23fe3cff2d..34eda7279b2 100644
--- a/storage/innodb_plugin/mysql-test/innodb-timeout.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb-timeout.test
@@ -1,4 +1,4 @@
--- source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
let $timeout=`select @@innodb_lock_wait_timeout`;
set global innodb_lock_wait_timeout=42;
diff --git a/storage/innodb_plugin/mysql-test/innodb-use-sys-malloc-master.opt b/mysql-test/suite/innodb_plugin/t/innodb-use-sys-malloc-master.opt
index 889834add01..acf3b8729ed 100644
--- a/storage/innodb_plugin/mysql-test/innodb-use-sys-malloc-master.opt
+++ b/mysql-test/suite/innodb_plugin/t/innodb-use-sys-malloc-master.opt
@@ -1,2 +1 @@
--innodb-use-sys-malloc=true
---innodb-use-sys-malloc=true
diff --git a/storage/innodb_plugin/mysql-test/innodb-use-sys-malloc.test b/mysql-test/suite/innodb_plugin/t/innodb-use-sys-malloc.test
index 325dd19d086..bc042587287 100644
--- a/storage/innodb_plugin/mysql-test/innodb-use-sys-malloc.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb-use-sys-malloc.test
@@ -1,4 +1,4 @@
---source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
#display current value of innodb_use_sys_malloc
SELECT @@GLOBAL.innodb_use_sys_malloc;
@@ -22,7 +22,7 @@ create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into t1 values (1),(2),(3),(4),(5),(6),(7);
select * from t1;
drop table t1;
---source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
#display current value of innodb_use_sys_malloc
SELECT @@GLOBAL.innodb_use_sys_malloc;
diff --git a/mysql-test/suite/innodb/t/innodb-zip.test b/mysql-test/suite/innodb_plugin/t/innodb-zip.test
index c27392ac4fa..4980af437e6 100644
--- a/mysql-test/suite/innodb/t/innodb-zip.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb-zip.test
@@ -1,5 +1,4 @@
--- source include/have_innodb.inc
--- source suite/innodb/include/have_innodb_plugin.inc
+-- source include/have_innodb_plugin.inc
let $per_table=`select @@innodb_file_per_table`;
let $format=`select @@innodb_file_format`;
@@ -86,7 +85,8 @@ SELECT table_schema, table_name, row_format
FROM information_schema.tables WHERE engine='innodb';
drop table t1,t2;
-# The following should fail even in non-strict mode.
+# The following should fail in non-strict mode too.
+# (The fix of Bug #50945 only affects REDUNDANT and COMPACT tables.)
SET SESSION innodb_strict_mode = off;
--error ER_TOO_BIG_ROWSIZE
CREATE TABLE t1(
diff --git a/storage/innodb_plugin/mysql-test/innodb.test b/mysql-test/suite/innodb_plugin/t/innodb.test
index f46a3a70b56..6cfc0f0cb9a 100644
--- a/storage/innodb_plugin/mysql-test/innodb.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb.test
@@ -13,7 +13,9 @@
# #
#######################################################################
--- source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
+
+let $MYSQLD_DATADIR= `select @@datadir`;
# Save the original values of some variables in order to be able to
# estimate how much they have changed during the tests. Previously this
@@ -425,11 +427,21 @@ INSERT INTO t1 ( sca_code, cat_code, sca_desc, lan_code, sca_pic, sca_sdesc, sca
select count(*) from t1 where sca_code = 'PD';
select count(*) from t1 where sca_code <= 'PD';
select count(*) from t1 where sca_pic is null;
+# this should be fixed by MySQL (see Bug #51451)
+# now that http://bugs.mysql.com/49838 is fixed the following ALTER does
+# copy the table instead of failing
+# --error ER_WRONG_NAME_FOR_INDEX
alter table t1 drop index sca_pic, add index sca_pic (cat_code, sca_pic);
+alter table t1 drop index sca_pic;
+alter table t1 add index sca_pic (cat_code, sca_pic);
select count(*) from t1 where sca_code='PD' and sca_pic is null;
select count(*) from t1 where cat_code='E';
+# this should be fixed by MySQL (see Bug #51451)
+--error ER_WRONG_NAME_FOR_INDEX
alter table t1 drop index sca_pic, add index (sca_pic, cat_code);
+alter table t1 drop index sca_pic;
+alter table t1 add index (sca_pic, cat_code);
select count(*) from t1 where sca_code='PD' and sca_pic is null;
select count(*) from t1 where sca_pic >= 'n';
select sca_pic from t1 where sca_pic is null;
@@ -1375,7 +1387,10 @@ show variables like "innodb_thread_sleep_delay";
let $default=`select @@storage_engine`;
set storage_engine=INNODB;
+# this should be fixed by MySQL (see Bug #51451)
+set session old_alter_table=1;
source include/varchar.inc;
+set session old_alter_table=0;
#
# Some errors/warnings on create
@@ -1700,7 +1715,7 @@ set foreign_key_checks=0;
create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1;
create table t3(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=utf8;
# Embedded server doesn't chdir to data directory
---replace_result $MYSQLTEST_VARDIR . master-data/ ''
+--replace_result $MYSQLD_DATADIR ./ master-data/ ''
-- error 1025
rename table t3 to t1;
set foreign_key_checks=1;
@@ -2264,7 +2279,7 @@ disconnect j;
drop table t1, t2, t3, t5, t6, t8, t9;
# bug 18934, "InnoDB crashes when table uses column names like DB_ROW_ID"
---error 1005
+--error ER_WRONG_COLUMN_NAME
CREATE TABLE t1 (DB_ROW_ID int) engine=innodb;
#
@@ -2340,7 +2355,7 @@ ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1 (a) ON DELETE SET NULL;
# mysqltest first does replace_regex, then replace_result
--replace_regex /'[^']*test\/#sql-[0-9a-f_]*'/'#sql-temporary'/
# Embedded server doesn't chdir to data directory
---replace_result $MYSQLTEST_VARDIR . master-data/ ''
+--replace_result $MYSQLD_DATADIR ./ master-data/ ''
--error 1025
ALTER TABLE t2 MODIFY a INT NOT NULL;
DELETE FROM t1;
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug21704.test b/mysql-test/suite/innodb_plugin/t/innodb_bug21704.test
index c649b61034c..9adf3239dcd 100644
--- a/storage/innodb_plugin/mysql-test/innodb_bug21704.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug21704.test
@@ -1,4 +1,4 @@
--- source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
--echo #
--echo # Bug#21704: Renaming column does not update FK definition.
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug34053.test b/mysql-test/suite/innodb_plugin/t/innodb_bug34053.test
index b935e45c06d..78ec9afa688 100644
--- a/storage/innodb_plugin/mysql-test/innodb_bug34053.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug34053.test
@@ -3,7 +3,7 @@
#
-- source include/not_embedded.inc
--- source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
SET storage_engine=InnoDB;
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug34300.test b/mysql-test/suite/innodb_plugin/t/innodb_bug34300.test
index 68c385fd72a..d91ce205042 100644
--- a/storage/innodb_plugin/mysql-test/innodb_bug34300.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug34300.test
@@ -3,7 +3,7 @@
# http://bugs.mysql.com/34300
#
--- source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
-- disable_query_log
-- disable_result_log
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug35220.test b/mysql-test/suite/innodb_plugin/t/innodb_bug35220.test
index 26f7d6b1ddd..30175097c68 100644
--- a/storage/innodb_plugin/mysql-test/innodb_bug35220.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug35220.test
@@ -3,7 +3,7 @@
# http://bugs.mysql.com/35220
#
--- source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
SET storage_engine=InnoDB;
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug36169.test b/mysql-test/suite/innodb_plugin/t/innodb_bug36169.test
index 5bf55193b5c..bcd44a7c543 100644
--- a/storage/innodb_plugin/mysql-test/innodb_bug36169.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug36169.test
@@ -3,7 +3,7 @@
# http://bugs.mysql.com/36169
#
--- source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
let $file_format=`select @@innodb_file_format`;
let $file_per_table=`select @@innodb_file_per_table`;
@@ -24,6 +24,7 @@ SET GLOBAL innodb_file_per_table=ON;
# Generating 10 tables
# Creating a table with 94 columns and 24 indexes
DROP TABLE IF EXISTS `table0`;
+set innodb_strict_mode=on;
--error ER_TOO_BIG_ROWSIZE
CREATE TABLE IF NOT EXISTS `table0`
(`col0` BOOL,
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug36172.test b/mysql-test/suite/innodb_plugin/t/innodb_bug36172.test
index c6c4e6fae47..fbd6d5605df 100644
--- a/storage/innodb_plugin/mysql-test/innodb_bug36172.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug36172.test
@@ -3,7 +3,7 @@
#
-- source include/not_embedded.inc
--- source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
SET storage_engine=InnoDB;
diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug38231.test b/mysql-test/suite/innodb_plugin/t/innodb_bug38231.test
new file mode 100644
index 00000000000..be588474bc1
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug38231.test
@@ -0,0 +1,112 @@
+#
+# Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK
+# http://bugs.mysql.com/38231
+#
+
+-- source include/have_innodb_plugin.inc
+
+SET storage_engine=InnoDB;
+
+# we care only that the following SQL commands do not crash the server
+-- disable_query_log
+-- disable_result_log
+
+DROP TABLE IF EXISTS bug38231;
+CREATE TABLE bug38231 (a INT);
+
+-- connect (con1,localhost,root,,)
+-- connect (con2,localhost,root,,)
+-- connect (con3,localhost,root,,)
+
+-- connection con1
+SET autocommit=0;
+LOCK TABLE bug38231 WRITE;
+
+-- connection con2
+SET autocommit=0;
+-- send
+LOCK TABLE bug38231 WRITE;
+
+# When con1 does UNLOCK below this will release either con2 or con3 which are
+# both waiting on LOCK. At the end we must first --reap and UNLOCK the
+# connection that has been released, otherwise it will wait forever. We assume
+# that the released connection will be the first one that has gained the LOCK,
+# thus we force the order here - con2 does LOCK first, then con3. In other
+# words we wait for LOCK from con2 above to be exected before doing LOCK in
+# con3.
+-- connection con1
+let $wait_condition =
+ SELECT COUNT(*) = 1 FROM information_schema.processlist
+ WHERE info = 'LOCK TABLE bug38231 WRITE';
+-- source include/wait_condition.inc
+# the above enables query log, re-disable it
+-- disable_query_log
+
+-- connection con3
+SET autocommit=0;
+-- send
+LOCK TABLE bug38231 WRITE;
+
+-- connection default
+-- send
+TRUNCATE TABLE bug38231;
+
+-- connection con1
+# Wait for TRUNCATE and the other two LOCKs to be executed; without this,
+# sometimes UNLOCK executes before them. We assume there are no other
+# sessions executing at the same time with the same SQL commands.
+let $wait_condition =
+ SELECT COUNT(*) = 1 FROM information_schema.processlist
+ WHERE info = 'TRUNCATE TABLE bug38231';
+-- source include/wait_condition.inc
+let $wait_condition =
+ SELECT COUNT(*) = 2 FROM information_schema.processlist
+ WHERE info = 'LOCK TABLE bug38231 WRITE';
+-- source include/wait_condition.inc
+# the above enables query log, re-disable it
+-- disable_query_log
+
+# this crashes the server if the bug is present
+UNLOCK TABLES;
+
+# clean up
+
+-- connection con2
+-- reap
+UNLOCK TABLES;
+
+-- connection con3
+-- reap
+UNLOCK TABLES;
+
+-- connection default
+-- reap
+
+-- disconnect con1
+-- disconnect con2
+-- disconnect con3
+
+# test that TRUNCATE works with with row-level locks
+
+-- enable_query_log
+-- enable_result_log
+
+INSERT INTO bug38231 VALUES (1), (10), (300);
+
+-- connect (con4,localhost,root,,)
+
+-- connection con4
+SET autocommit=0;
+SELECT * FROM bug38231 FOR UPDATE;
+
+-- connection default
+TRUNCATE TABLE bug38231;
+
+-- connection con4
+COMMIT;
+
+-- connection default
+
+-- disconnect con4
+
+DROP TABLE bug38231;
diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug39438-master.opt b/mysql-test/suite/innodb_plugin/t/innodb_bug39438-master.opt
new file mode 100644
index 00000000000..43fac202fd4
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug39438-master.opt
@@ -0,0 +1 @@
+--innodb-file-per-table=1
diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug39438.test b/mysql-test/suite/innodb_plugin/t/innodb_bug39438.test
new file mode 100644
index 00000000000..879059bac0d
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug39438.test
@@ -0,0 +1,51 @@
+#
+# Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch
+# http://bugs.mysql.com/39438
+#
+# This test must be run with innodb_file_per_table=1 because the crash
+# only occurs if that option is turned on and DISCARD TABLESPACE only
+# works with innodb_file_per_table.
+#
+
+-- source include/have_innodb_plugin.inc
+
+SET storage_engine=InnoDB;
+
+# we care only that the following SQL commands do not crash the server
+-- disable_query_log
+-- disable_result_log
+
+DROP TABLE IF EXISTS bug39438;
+
+CREATE TABLE bug39438 (id INT) ENGINE=INNODB;
+
+# remove: XXX Uncomment the following ALTER and remove those lines after
+# remove: applying the patch.
+# remove: Obviously this test is useless without this ALTER command,
+# remove: but it causes warnings to be printed by mysqld and the whole
+# remove: mysql-test suite fails at the end (returns non-zero). Please
+# remove: apply this patch to the mysql source tree, remove those lines
+# remove: and uncomment the following ALTER. We do not care about the
+# remove: warnings, this test is to ensure mysqld does not crash.
+# remove: === modified file 'mysql-test/lib/mtr_report.pl'
+# remove: --- mysql-test/lib/mtr_report.pl 2008-08-12 10:26:23 +0000
+# remove: +++ mysql-test/lib/mtr_report.pl 2008-10-01 11:57:41 +0000
+# remove: @@ -412,7 +412,10 @@
+# remove:
+# remove: # When trying to set lower_case_table_names = 2
+# remove: # on a case sensitive file system. Bug#37402.
+# remove: - /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./
+# remove: + /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive. Now setting lower_case_table_names to 0 to avoid future problems./ or
+# remove: +
+# remove: + # this test is expected to print warnings
+# remove: + ($testname eq 'main.innodb_bug39438')
+# remove: )
+# remove: {
+# remove: next; # Skip these lines
+# remove:
+#ALTER TABLE bug39438 DISCARD TABLESPACE;
+
+# this crashes the server if the bug is present
+SHOW TABLE STATUS;
+
+DROP TABLE bug39438;
diff --git a/mysql-test/suite/innodb/t/innodb_bug40360.test b/mysql-test/suite/innodb_plugin/t/innodb_bug40360.test
index e88837aab4f..dbe61489760 100644
--- a/mysql-test/suite/innodb/t/innodb_bug40360.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug40360.test
@@ -3,7 +3,7 @@
#
-- source include/not_embedded.inc
--- source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
SET TX_ISOLATION='READ-COMMITTED';
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug40565.test b/mysql-test/suite/innodb_plugin/t/innodb_bug40565.test
index d7aa0fd514a..bcc61a1f6d2 100644
--- a/storage/innodb_plugin/mysql-test/innodb_bug40565.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug40565.test
@@ -1,5 +1,5 @@
# Bug #40565 Update Query Results in "1 Row Affected" But Should Be "Zero Rows"
--- source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
create table bug40565(value decimal(4,2)) engine=innodb;
insert into bug40565 values (1), (null);
diff --git a/mysql-test/suite/innodb/t/innodb_bug41904.test b/mysql-test/suite/innodb_plugin/t/innodb_bug41904.test
index 365c5229adc..867af04c490 100644
--- a/mysql-test/suite/innodb/t/innodb_bug41904.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug41904.test
@@ -3,7 +3,7 @@
#
-- source include/not_embedded.inc
--- source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
CREATE TABLE bug41904 (id INT PRIMARY KEY, uniquecol CHAR(15)) ENGINE=InnoDB;
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug42101-nonzero-master.opt b/mysql-test/suite/innodb_plugin/t/innodb_bug42101-nonzero-master.opt
index d71dbe17d5b..d71dbe17d5b 100644
--- a/storage/innodb_plugin/mysql-test/innodb_bug42101-nonzero-master.opt
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug42101-nonzero-master.opt
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug42101-nonzero.test b/mysql-test/suite/innodb_plugin/t/innodb_bug42101-nonzero.test
index 685fdf20489..1216bf415b8 100644
--- a/storage/innodb_plugin/mysql-test/innodb_bug42101-nonzero.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug42101-nonzero.test
@@ -3,7 +3,7 @@
# http://bugs.mysql.com/42101
#
--- source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
--error ER_WRONG_ARGUMENTS
set global innodb_commit_concurrency=0;
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug42101.test b/mysql-test/suite/innodb_plugin/t/innodb_bug42101.test
index b6536490d48..3bbc1928299 100644
--- a/storage/innodb_plugin/mysql-test/innodb_bug42101.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug42101.test
@@ -3,7 +3,7 @@
# http://bugs.mysql.com/42101
#
--- source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
set global innodb_commit_concurrency=0;
select @@innodb_commit_concurrency;
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug44032.test b/mysql-test/suite/innodb_plugin/t/innodb_bug44032.test
index a963cb8b68f..1c0ec2f9d95 100644
--- a/storage/innodb_plugin/mysql-test/innodb_bug44032.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug44032.test
@@ -2,7 +2,7 @@
# (btr_cur_update_in_place not invoked when updating from/to NULL;
# the update is performed by delete and insert instead)
--- source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
CREATE TABLE bug44032(c CHAR(3) CHARACTER SET UTF8) ROW_FORMAT=REDUNDANT
ENGINE=InnoDB;
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug44369.test b/mysql-test/suite/innodb_plugin/t/innodb_bug44369.test
index 495059eb5e6..d01694c3797 100644
--- a/storage/innodb_plugin/mysql-test/innodb_bug44369.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug44369.test
@@ -3,19 +3,15 @@
# some innodb internal reserved key words,
# both case sensitively and insensitely.
---source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
# This create table operation should fail.
---error ER_CANT_CREATE_TABLE
+--error ER_WRONG_COLUMN_NAME
create table bug44369 (DB_ROW_ID int) engine=innodb;
# This create should fail as well
---error ER_CANT_CREATE_TABLE
+--error ER_WRONG_COLUMN_NAME
create table bug44369 (db_row_id int) engine=innodb;
-show errors;
-
---error ER_CANT_CREATE_TABLE
+--error ER_WRONG_COLUMN_NAME
create table bug44369 (db_TRX_Id int) engine=innodb;
-
-show errors;
diff --git a/mysql-test/suite/innodb/t/innodb_bug44571.test b/mysql-test/suite/innodb_plugin/t/innodb_bug44571.test
index 58f02dfb5d2..3f02a2206a9 100644
--- a/mysql-test/suite/innodb/t/innodb_bug44571.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug44571.test
@@ -4,8 +4,7 @@
# Please also refer to related fix in
# http://bugs.mysql.com/47621
#
--- source include/have_innodb.inc
--- source suite/innodb/include/have_innodb_plugin.inc
+-- source include/have_innodb_plugin.inc
CREATE TABLE bug44571 (foo INT) ENGINE=InnoDB;
ALTER TABLE bug44571 CHANGE foo bar INT;
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug45357.test b/mysql-test/suite/innodb_plugin/t/innodb_bug45357.test
index 81727f352dd..b5e177c2918 100644
--- a/storage/innodb_plugin/mysql-test/innodb_bug45357.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug45357.test
@@ -1,4 +1,4 @@
--- source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
set session transaction isolation level read committed;
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug46000.test b/mysql-test/suite/innodb_plugin/t/innodb_bug46000.test
index 80c18c58ef0..acc027c20e7 100644
--- a/storage/innodb_plugin/mysql-test/innodb_bug46000.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug46000.test
@@ -3,28 +3,26 @@
# "GEN_CLUST_INDEX", which is the reserved
# name for innodb default primary index.
---source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
# This 'create table' operation should fail because of
# using the reserve name as its index name.
---error ER_CANT_CREATE_TABLE
+--error ER_WRONG_NAME_FOR_INDEX
create table bug46000(`id` int,key `GEN_CLUST_INDEX`(`id`))engine=innodb;
# Mixed upper/lower case of the reserved key words
---error ER_CANT_CREATE_TABLE
+--error ER_WRONG_NAME_FOR_INDEX
create table bug46000(`id` int, key `GEN_clust_INDEX`(`id`))engine=innodb;
-show errors;
+show warnings;
create table bug46000(id int) engine=innodb;
# This 'create index' operation should fail.
---replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/
---error ER_CANT_CREATE_TABLE
+--error ER_WRONG_NAME_FOR_INDEX
create index GEN_CLUST_INDEX on bug46000(id);
---replace_regex /'[^']*test.#sql-[0-9a-f_]*'/'#sql-temporary'/
-show errors;
+show warnings;
# This 'create index' operation should succeed, no
# temp table left from last failed create index
diff --git a/mysql-test/suite/innodb/t/innodb_bug46676.test b/mysql-test/suite/innodb_plugin/t/innodb_bug46676.test
index 440666c4226..7e3ecfe715a 100644
--- a/mysql-test/suite/innodb/t/innodb_bug46676.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug46676.test
@@ -2,7 +2,7 @@
# It is reproducible with InnoDB plugin 1.0.4 + MySQL 5.1.37.
# But no longer reproducible after MySQL 5.1.38 (with plugin 1.0.5).
---source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
SET foreign_key_checks=0;
CREATE TABLE t1 (id int, foreign key (id) references t2(id)) ENGINE=INNODB;
diff --git a/mysql-test/suite/innodb/t/innodb_bug47167.test b/mysql-test/suite/innodb_plugin/t/innodb_bug47167.test
index df056b91ff9..e8499bb14dd 100644
--- a/mysql-test/suite/innodb/t/innodb_bug47167.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug47167.test
@@ -3,8 +3,7 @@
# "innodb_file_format_check" with a
# user-Defined Variable.
---source include/have_innodb.inc
--- source suite/innodb/include/have_innodb_plugin.inc
+-- source include/have_innodb_plugin.inc
# Save the value (Antelope) in 'innodb_file_format_check' to
# 'old_innodb_file_format_check'
diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug47621.test b/mysql-test/suite/innodb_plugin/t/innodb_bug47621.test
new file mode 100644
index 00000000000..0305484c351
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug47621.test
@@ -0,0 +1,57 @@
+# This is the test for bug #47621, column rename operation should
+# not result in column definition inconsistency between MySQL and
+# InnoDB
+
+-- source include/have_innodb_plugin.inc
+
+CREATE TABLE bug47621 (salesperson INT) ENGINE=InnoDB;
+
+# Change the column name
+ALTER TABLE bug47621 CHANGE salesperson sales_acct_id INT;
+
+# If there is inconsistency of column name definition
+# in MySQL or InnoDB, following create index would fail
+create index orgs on bug47621(sales_acct_id);
+
+# Change the column name back with the index defined on it.
+ALTER TABLE bug47621 CHANGE sales_acct_id salesperson INT;
+
+drop table bug47621;
+
+CREATE TABLE bug47621_sale (
+ salesperson INT,
+ PRIMARY KEY(salesperson)) engine = innodb;
+
+CREATE TABLE bug47621_shirt(
+ id SMALLINT,
+ owner INT,
+ FOREIGN KEY(owner)
+ references bug47621_sale(salesperson) ON DELETE RESTRICT)
+ engine = innodb;
+
+insert into bug47621_sale values(9);
+
+insert into bug47621_shirt values(1, 9);
+
+# Any rename operation on columns involved in a reference constraint will
+# fail, as it will be rejected by InnoDB row_rename_table_for_mysql().
+# In above example, any rename on column "salesperson" for table
+# "bug47621_sale", or on column "owner" for table "bug47621_shirt will
+# be blocked. We do not put such rename in the test since InnoDB error
+# message will be printed in the error log, and result in test failure.
+#
+# ALTER TABLE bug47621_sale CHANGE salesperson sales_acct_id INT;
+
+# Any rename on columns not involved in the foreign key constraint
+# could still proceed
+ALTER TABLE bug47621_shirt CHANGE id new_id INT;
+
+# Referencing table dropped, the rename operation on related columns
+# could proceed
+drop table bug47621_shirt;
+
+ALTER TABLE bug47621_sale CHANGE salesperson sales_acct_id INT;
+
+ALTER TABLE bug47621_sale ADD INDEX idx (sales_acct_id);
+
+drop table bug47621_sale;
diff --git a/mysql-test/suite/innodb/t/innodb_bug47622.test b/mysql-test/suite/innodb_plugin/t/innodb_bug47622.test
index 9cf9d0e531b..ec544bd7962 100644
--- a/mysql-test/suite/innodb/t/innodb_bug47622.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug47622.test
@@ -4,7 +4,7 @@
# We resolve the problem by sync the index sequence
# up when opening the table.
---source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
connect (a,localhost,root,,);
connect (b,localhost,root,,);
diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug47777.test b/mysql-test/suite/innodb_plugin/t/innodb_bug47777.test
new file mode 100644
index 00000000000..4ea9841bf28
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug47777.test
@@ -0,0 +1,24 @@
+# This is the test for bug 47777. GEOMETRY
+# data is treated as BLOB data in innodb.
+# Consequently, its key value generation/storing
+# should follow the process for the BLOB
+# datatype as well.
+
+-- source include/have_innodb_plugin.inc
+
+create table bug47777(c2 linestring not null, primary key (c2(1))) engine=innodb;
+
+insert into bug47777 values (geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)'));
+
+# Verify correct row get inserted.
+select count(*) from bug47777 where c2 =geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)');
+
+# Update table bug47777 should be successful.
+update bug47777 set c2=GeomFromText('POINT(1 1)');
+
+# Verify the row get updated successfully. The original
+# c2 value should be changed to GeomFromText('POINT(1 1)').
+select count(*) from bug47777 where c2 =geomfromtext('linestring(1 2,3 4,5 6,7 8,9 10)');
+select count(*) from bug47777 where c2 = GeomFromText('POINT(1 1)');
+
+drop table bug47777;
diff --git a/mysql-test/suite/innodb/t/innodb_bug51378.test b/mysql-test/suite/innodb_plugin/t/innodb_bug51378.test
index 8f7b0b9605a..2d0d84807bb 100644
--- a/mysql-test/suite/innodb/t/innodb_bug51378.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug51378.test
@@ -9,7 +9,7 @@
# will be created as primary index
# Following queries test various scenario, no mismatch
# error message should be printed.
---source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
# Create a table contains a BLOB column
create table bug51378 (
diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug51920.test b/mysql-test/suite/innodb_plugin/t/innodb_bug51920.test
new file mode 100644
index 00000000000..7f34bad1aed
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug51920.test
@@ -0,0 +1,43 @@
+#
+# Bug #51920: InnoDB connections in lock wait ignore KILL until timeout
+#
+-- source include/not_embedded.inc
+-- source include/have_innodb_plugin.inc
+
+CREATE TABLE bug51920 (i INT) ENGINE=InnoDB;
+INSERT INTO bug51920 VALUES (1);
+
+BEGIN;
+SELECT * FROM bug51920 FOR UPDATE;
+
+connect (con1,localhost,root,,);
+
+connection con1;
+--send
+UPDATE bug51920 SET i=2;
+
+connection default;
+let $wait_condition =
+ SELECT COUNT(*)=1 FROM information_schema.processlist
+ WHERE INFO="UPDATE bug51920 SET i=2";
+-- source include/wait_condition.inc
+
+SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST
+WHERE INFO="UPDATE bug51920 SET i=2"
+INTO @thread_id;
+
+KILL @thread_id;
+let $wait_condition =
+ SELECT COUNT(*)=0 FROM information_schema.processlist WHERE ID=@thread_id;
+-- source include/wait_condition.inc
+
+#
+# Bug#19723: kill of active connection yields different error code
+# depending on platform.
+#
+connection con1;
+-- error 1317, 2006, 2013
+reap;
+connection default;
+DROP TABLE bug51920;
+-- disconnect con1
diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug52663.test b/mysql-test/suite/innodb_plugin/t/innodb_bug52663.test
new file mode 100644
index 00000000000..927044fb2ca
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug52663.test
@@ -0,0 +1,34 @@
+--source include/have_innodb_plugin.inc
+
+set session transaction isolation level read committed;
+
+create table innodb_bug52663 (what varchar(5), id integer, count integer, primary key
+(what, id)) engine=innodb;
+insert into innodb_bug52663 values ('total', 0, 0);
+begin;
+
+connect (addconroot, localhost, root,,);
+connection addconroot;
+set session transaction isolation level read committed;
+begin;
+
+connection default;
+update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0;
+select * from innodb_bug52663;
+
+connection addconroot;
+--error ER_LOCK_WAIT_TIMEOUT
+update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0;
+select * from innodb_bug52663;
+
+connection default;
+commit;
+
+connection addconroot;
+update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0;
+commit;
+select * from innodb_bug52663;
+
+connection default;
+select * from innodb_bug52663;
+drop table innodb_bug52663;
diff --git a/mysql-test/suite/innodb_plugin/t/innodb_bug52745.test b/mysql-test/suite/innodb_plugin/t/innodb_bug52745.test
new file mode 100644
index 00000000000..b20a993a2d1
--- /dev/null
+++ b/mysql-test/suite/innodb_plugin/t/innodb_bug52745.test
@@ -0,0 +1,109 @@
+-- source include/have_innodb_plugin.inc
+
+let $file_format=`select @@innodb_file_format`;
+let $file_format_check=`select @@innodb_file_format_check`;
+let $file_per_table=`select @@innodb_file_per_table`;
+SET GLOBAL innodb_file_format='Barracuda';
+SET GLOBAL innodb_file_per_table=on;
+
+CREATE TABLE bug52745 (
+ a2 int(10) unsigned DEFAULT NULL,
+ col37 time DEFAULT NULL,
+ col38 char(229) CHARACTER SET utf8 DEFAULT NULL,
+ col39 text,
+ col40 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ col41 int(10) unsigned DEFAULT NULL,
+ col42 varchar(248) CHARACTER SET utf8 DEFAULT NULL,
+ col43 smallint(5) unsigned zerofill DEFAULT NULL,
+ col44 varchar(150) CHARACTER SET utf8 DEFAULT NULL,
+ col45 float unsigned zerofill DEFAULT NULL,
+ col46 binary(1) DEFAULT NULL,
+ col47 tinyint(4) DEFAULT NULL,
+ col48 tinyint(1) DEFAULT NULL,
+ col49 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+ col50 binary(1) DEFAULT NULL,
+ col51 double unsigned zerofill DEFAULT NULL,
+ col52 int(10) unsigned DEFAULT NULL,
+ col53 time DEFAULT NULL,
+ col54 double unsigned DEFAULT NULL,
+ col55 time DEFAULT NULL,
+ col56 mediumtext CHARACTER SET latin2,
+ col57 blob,
+ col58 decimal(52,16) unsigned zerofill NOT NULL DEFAULT '000000000000000000000000000000000000.0000000000000000',
+ col59 binary(1) DEFAULT NULL,
+ col60 longblob,
+ col61 time DEFAULT NULL,
+ col62 longtext CHARACTER SET utf8 COLLATE utf8_persian_ci,
+ col63 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+ col64 int(10) unsigned DEFAULT NULL,
+ col65 date DEFAULT NULL,
+ col66 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+ col67 binary(1) DEFAULT NULL,
+ col68 tinyblob,
+ col69 date DEFAULT NULL,
+ col70 tinyint(3) unsigned zerofill DEFAULT NULL,
+ col71 varchar(44) CHARACTER SET utf8 DEFAULT NULL,
+ col72 datetime DEFAULT NULL,
+ col73 smallint(5) unsigned zerofill DEFAULT NULL,
+ col74 longblob,
+ col75 bit(34) DEFAULT NULL,
+ col76 float unsigned zerofill DEFAULT NULL,
+ col77 year(2) DEFAULT NULL,
+ col78 tinyint(3) unsigned DEFAULT NULL,
+ col79 set('msfheowh','tbpxbgf','by','wahnrjw','myqfasxz','rsokyumrt') CHARACTER SET latin2 DEFAULT NULL,
+ col80 datetime DEFAULT NULL,
+ col81 smallint(6) DEFAULT NULL,
+ col82 enum('xtaurnqfqz','rifrse','kuzwpbvb','niisabk','zxavro','rbvasv','','uulrfaove','','') DEFAULT NULL,
+ col83 bigint(20) unsigned zerofill DEFAULT NULL,
+ col84 float unsigned zerofill DEFAULT NULL,
+ col85 double DEFAULT NULL,
+ col86 enum('ylannv','','vlkhycqc','snke','cxifustp','xiaxaswzp','oxl') CHARACTER SET latin1 COLLATE latin1_german2_ci DEFAULT NULL,
+ col87 varbinary(221) DEFAULT NULL,
+ col88 double unsigned DEFAULT NULL,
+ col89 float unsigned zerofill DEFAULT NULL,
+ col90 tinyblob
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
+
+INSERT INTO bug52745 SET
+col40='0000-00-00 00:00:00',
+col51=16547,
+col53='7711484',
+col54=-28604,
+col55='7112612',
+col56='wakefulness\'',
+col57=repeat('absorbefacient\'',106),
+col58=11027,
+col59='AM09gW7',
+col60=repeat('Noelani\'',16),
+col61='2520576',
+col62='substitutiv',
+col63='19950106155112',
+col64=-12038,
+col65='86238806',
+col66='19600719080256',
+col68=repeat('Sagittarius\'',54),
+col69='38943902',
+col70=1232,
+col71='Elora\'',
+col74=repeat('zipp',11),
+col75='0',
+col76=23254,
+col78=13247,
+col79='56219',
+col80='20500609035724',
+col81=11632,
+col82=7,
+col84=-23863,
+col85=6341,
+col87='HZdkf.4 s7t,5Rmq 8so fmr,ruGLUG25TrtI.yQ 2SuHq0ML7rw7.4 b2yf2E5TJxOtBBZImezDnzpj,uPYfznnEUDN1e9aQoO 2DsplB7TFWy oQJ br HLF :F,eQ p4i1oWsr lL3PG,hjCz6hYqN h1QTjLCjrv:QCdSzpYBibJAtZCxLOk3l6Blsh.W',
+col88=16894,
+col89=6161,
+col90=repeat('gale',48);
+
+SHOW WARNINGS;
+
+DROP TABLE bug52745;
+
+EVAL SET GLOBAL innodb_file_format=$file_format;
+EVAL SET GLOBAL innodb_file_format_check=$file_format_check;
+EVAL SET GLOBAL innodb_file_per_table=$file_per_table;
diff --git a/storage/innodb_plugin/mysql-test/innodb_file_format.test b/mysql-test/suite/innodb_plugin/t/innodb_file_format.test
index d63c9b0228f..484a176c58b 100644
--- a/storage/innodb_plugin/mysql-test/innodb_file_format.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb_file_format.test
@@ -1,4 +1,4 @@
--- source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
select @@innodb_file_format;
select @@innodb_file_format_check;
diff --git a/mysql-test/suite/innodb/t/innodb_information_schema.test b/mysql-test/suite/innodb_plugin/t/innodb_information_schema.test
index 599215e9ca4..25255e0b2a9 100644
--- a/mysql-test/suite/innodb/t/innodb_information_schema.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb_information_schema.test
@@ -3,8 +3,7 @@
# INFORMATION_SCHEMA.innodb_locks.lock_data
#
--- source include/have_innodb.inc
--- source suite/innodb/include/have_innodb_plugin.inc
+-- source include/have_innodb_plugin.inc
-- disable_query_log
-- disable_result_log
diff --git a/storage/innodb_plugin/mysql-test/innodb_trx_weight.test b/mysql-test/suite/innodb_plugin/t/innodb_trx_weight.test
index b72eaad345f..3d08959b2ea 100644
--- a/storage/innodb_plugin/mysql-test/innodb_trx_weight.test
+++ b/mysql-test/suite/innodb_plugin/t/innodb_trx_weight.test
@@ -6,7 +6,7 @@
# be heavier than ones that had not.
#
--- source include/have_innodb.inc
+-- source include/have_innodb_plugin.inc
SET storage_engine=InnoDB;
@@ -65,21 +65,21 @@ INSERT INTO t3 SELECT * FROM t3;
-- let $con2_extra_sql = SELECT * FROM t3 FOR UPDATE
-- let $con2_extra_sql_present = 1
-- let $con1_should_be_rolledback = 1
--- source include/innodb_trx_weight.inc
+-- source suite/innodb_plugin/include/innodb_trx_weight.inc
-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1)
-- let $con1_extra_sql_present = 1
-- let $con2_extra_sql = SELECT * FROM t3 FOR UPDATE
-- let $con2_extra_sql_present = 1
-- let $con1_should_be_rolledback = 1
--- source include/innodb_trx_weight.inc
+-- source suite/innodb_plugin/include/innodb_trx_weight.inc
-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1), (1), (1), (1), (1)
-- let $con1_extra_sql_present = 1
-- let $con2_extra_sql = SELECT * FROM t3 FOR UPDATE
-- let $con2_extra_sql_present = 1
-- let $con1_should_be_rolledback = 0
--- source include/innodb_trx_weight.inc
+-- source suite/innodb_plugin/include/innodb_trx_weight.inc
# test weight when non-transactional tables are edited
@@ -88,14 +88,14 @@ INSERT INTO t3 SELECT * FROM t3;
-- let $con2_extra_sql =
-- let $con2_extra_sql_present = 0
-- let $con1_should_be_rolledback = 0
--- source include/innodb_trx_weight.inc
+-- source suite/innodb_plugin/include/innodb_trx_weight.inc
-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1), (1)
-- let $con1_extra_sql_present = 1
-- let $con2_extra_sql = INSERT INTO t5_nontrans VALUES (1)
-- let $con2_extra_sql_present = 1
-- let $con1_should_be_rolledback = 1
--- source include/innodb_trx_weight.inc
+-- source suite/innodb_plugin/include/innodb_trx_weight.inc
-- let $con1_extra_sql = INSERT INTO t4 VALUES (1), (1), (1)
-- let $con1_extra_sql = $con1_extra_sql; INSERT INTO t5_nontrans VALUES (1)
@@ -103,6 +103,6 @@ INSERT INTO t3 SELECT * FROM t3;
-- let $con2_extra_sql = INSERT INTO t5_nontrans VALUES (1)
-- let $con2_extra_sql_present = 1
-- let $con1_should_be_rolledback = 0
--- source include/innodb_trx_weight.inc
+-- source suite/innodb_plugin/include/innodb_trx_weight.inc
DROP TABLE t1, t2, t3, t4, t5_nontrans;
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index 5f37dbe2cb6..68584c6f3e3 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -11,4 +11,5 @@
##############################################################################
kill : Bug#37780 2008-12-03 HHunger need some changes to be robust enough for pushbuild.
query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadically
-innodb-autoinc-44030 : BUG#47621 2009-01-22 svoj MySQL and InnoDB dicts getting out of sync
+partition_innodb_plugin : Bug#53307 2010-04-30 VasilDimov valgrind warnings
+ps_3innodb : Bug#53309 2010-04-30 VasilDimov valgrind warnings
diff --git a/mysql-test/t/partition_innodb_plugin.test b/mysql-test/t/partition_innodb_plugin.test
index fed8c96424a..eeb990c0d81 100644
--- a/mysql-test/t/partition_innodb_plugin.test
+++ b/mysql-test/t/partition_innodb_plugin.test
@@ -1,6 +1,5 @@
--source include/have_partition.inc
---source include/have_innodb.inc
---source suite/innodb/include/have_innodb_plugin.inc
+--source include/have_innodb_plugin.inc
#
# Bug#32430 - show engine innodb status causes errors
diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt
index 5918db7ab11..5918db7ab11 100755..100644
--- a/storage/innobase/CMakeLists.txt
+++ b/storage/innobase/CMakeLists.txt
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 56f6cccb4f7..ebf01fbc296 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -238,7 +238,7 @@ static MYSQL_THDVAR_BOOL(table_locks, PLUGIN_VAR_OPCMDARG,
/* default */ TRUE);
static handler *innobase_create_handler(handlerton *hton,
- TABLE_SHARE *table,
+ TABLE_SHARE *table,
MEM_ROOT *mem_root)
{
return new (mem_root) ha_innobase(hton, table);
@@ -350,7 +350,7 @@ int
innobase_start_trx_and_assign_read_view(
/*====================================*/
/* out: 0 */
- handlerton* hton, /* in: Innodb handlerton */
+ handlerton* hton, /* in: Innodb handlerton */
THD* thd); /* in: MySQL thread handle of the user for whom
the transaction should be committed */
/********************************************************************
@@ -4435,7 +4435,7 @@ ha_innobase::unlock_row(void)
case ROW_READ_WITH_LOCKS:
if (!srv_locks_unsafe_for_binlog
&& prebuilt->trx->isolation_level
- != TRX_ISO_READ_COMMITTED) {
+ > TRX_ISO_READ_COMMITTED) {
break;
}
/* fall through */
@@ -4472,7 +4472,7 @@ ha_innobase::try_semi_consistent_read(bool yes)
if (yes
&& (srv_locks_unsafe_for_binlog
- || prebuilt->trx->isolation_level == TRX_ISO_READ_COMMITTED)) {
+ || prebuilt->trx->isolation_level <= TRX_ISO_READ_COMMITTED)) {
prebuilt->row_read_type = ROW_READ_TRY_SEMI_CONSISTENT;
} else {
prebuilt->row_read_type = ROW_READ_WITH_LOCKS;
@@ -7768,7 +7768,7 @@ ha_innobase::store_lock(
isolation_level = trx->isolation_level;
if ((srv_locks_unsafe_for_binlog
- || isolation_level == TRX_ISO_READ_COMMITTED)
+ || isolation_level <= TRX_ISO_READ_COMMITTED)
&& isolation_level != TRX_ISO_SERIALIZABLE
&& (lock_type == TL_READ || lock_type == TL_READ_NO_INSERT)
&& (sql_command == SQLCOM_INSERT_SELECT
diff --git a/storage/innobase/include/mem0mem.h b/storage/innobase/include/mem0mem.h
index 2d5fd1db6c3..ce99a680418 100644
--- a/storage/innobase/include/mem0mem.h
+++ b/storage/innobase/include/mem0mem.h
@@ -138,6 +138,17 @@ mem_heap_free_func(
mem_heap_t* heap, /* in, own: heap to be freed */
const char* file_name, /* in: file name where freed */
ulint line); /* in: line where freed */
+/***************************************************************//**
+Allocates and zero-fills n bytes of memory from a memory heap.
+@return allocated, zero-filled storage */
+UNIV_INLINE
+void*
+mem_heap_zalloc(
+/*============*/
+ mem_heap_t* heap, /*!< in: memory heap */
+ ulint n); /*!< in: number of bytes; if the heap is allowed
+ to grow into the buffer pool, this must be
+ <= MEM_MAX_ALLOC_IN_BUF */
/*******************************************************************
Allocates n bytes of memory from a memory heap. */
UNIV_INLINE
diff --git a/storage/innobase/include/mem0mem.ic b/storage/innobase/include/mem0mem.ic
index 6227a27f277..782672dbc18 100644
--- a/storage/innobase/include/mem0mem.ic
+++ b/storage/innobase/include/mem0mem.ic
@@ -122,6 +122,23 @@ mem_block_get_start(mem_block_t* block)
return(block->start);
}
+/***************************************************************//**
+Allocates and zero-fills n bytes of memory from a memory heap.
+@return allocated, zero-filled storage */
+UNIV_INLINE
+void*
+mem_heap_zalloc(
+/*============*/
+ mem_heap_t* heap, /*!< in: memory heap */
+ ulint n) /*!< in: number of bytes; if the heap is allowed
+ to grow into the buffer pool, this must be
+ <= MEM_MAX_ALLOC_IN_BUF */
+{
+ ut_ad(heap);
+ ut_ad(!(heap->type & MEM_HEAP_BTR_SEARCH));
+ return(memset(mem_heap_alloc(heap, n), 0, n));
+}
+
/*******************************************************************
Allocates n bytes of memory from a memory heap. */
UNIV_INLINE
diff --git a/storage/innobase/include/trx0sys.ic b/storage/innobase/include/trx0sys.ic
index 55bcc12a414..1142fb60398 100644
--- a/storage/innobase/include/trx0sys.ic
+++ b/storage/innobase/include/trx0sys.ic
@@ -19,7 +19,7 @@ typedef byte trx_sysf_rseg_t;
#define TRX_SYS_RSEG_SPACE 0 /* space where the the segment
header is placed; starting with
MySQL/InnoDB 5.1.7, this is
- UNIV_UNDEFINED if the slot is unused */
+ ULINT_UNDEFINED for unused slots */
#define TRX_SYS_RSEG_PAGE_NO 4 /* page number where the the segment
header is placed; this is FIL_NULL
if the slot is unused */
diff --git a/storage/innobase/include/univ.i b/storage/innobase/include/univ.i
index 8ab62e655ff..ee3a0b27b20 100644
--- a/storage/innobase/include/univ.i
+++ b/storage/innobase/include/univ.i
@@ -82,6 +82,9 @@ memory is read outside the allocated blocks. */
/* Make a non-inline debug version */
+#ifdef HAVE_purify
+# define UNIV_DEBUG_VALGRIND
+#endif /* HAVE_purify */
#if 0
#define UNIV_DEBUG_VALGRIND /* Enable extra
Valgrind instrumentation */
diff --git a/storage/innobase/lock/lock0lock.c b/storage/innobase/lock/lock0lock.c
index 8f4b64cda96..7df8ea50887 100644
--- a/storage/innobase/lock/lock0lock.c
+++ b/storage/innobase/lock/lock0lock.c
@@ -2362,7 +2362,7 @@ lock_rec_inherit_to_gap(
if (!lock_rec_get_insert_intention(lock)
&& !((srv_locks_unsafe_for_binlog
|| lock->trx->isolation_level
- == TRX_ISO_READ_COMMITTED)
+ <= TRX_ISO_READ_COMMITTED)
&& lock_get_mode(lock) == LOCK_X)) {
lock_rec_add_to_queue(LOCK_REC | lock_get_mode(lock)
@@ -4538,13 +4538,34 @@ lock_rec_queue_validate(
rec, impl_trx));
}
}
-
+#if 0
if (index && !(index->type & DICT_CLUSTERED)) {
/* The kernel mutex may get released temporarily in the
next function call: we have to release lock table mutex
to obey the latching order */
+ /* NOTE: This is a bogus check that would fail in the
+ following case: Our transaction is updating a
+ row. After it has updated the clustered index record,
+ it goes to a secondary index record and finds someone
+ else holding an explicit S- or X-lock on that
+ secondary index record, presumably from a locking
+ read. Our transaction cannot update the secondary
+ index immediately, but places a waiting X-lock request
+ on the secondary index record. There is nothing
+ illegal in this. The assertion is simply too strong. */
+
+ /* From the locking point of view, each secondary
+ index is a separate table. A lock that is held on
+ secondary index rec does not give any rights to modify
+ or read the clustered index rec. Therefore, we can
+ think of the sec index as a separate 'table' from the
+ clust index 'table'. Conversely, a transaction that
+ has acquired a lock on and modified a clustered index
+ record may need to wait for a lock on the
+ corresponding record in a secondary index. */
+
impl_trx = lock_sec_rec_some_has_impl_off_kernel(
rec, index, offsets);
@@ -4555,7 +4576,7 @@ lock_rec_queue_validate(
rec, impl_trx));
}
}
-
+#endif
lock = lock_rec_get_first(rec);
while (lock) {
diff --git a/storage/innobase/log/log0recv.c b/storage/innobase/log/log0recv.c
index 5d309768064..e6524eeefbf 100644
--- a/storage/innobase/log/log0recv.c
+++ b/storage/innobase/log/log0recv.c
@@ -167,7 +167,7 @@ recv_sys_init(
recv_sys->len = 0;
recv_sys->recovered_offset = 0;
- recv_sys->addr_hash = hash_create(available_memory / 64);
+ recv_sys->addr_hash = hash_create(available_memory / 512);
recv_sys->n_addrs = 0;
recv_sys->apply_log_recs = FALSE;
@@ -207,7 +207,7 @@ recv_sys_empty_hash(void)
hash_table_free(recv_sys->addr_hash);
mem_heap_empty(recv_sys->heap);
- recv_sys->addr_hash = hash_create(buf_pool_get_curr_size() / 256);
+ recv_sys->addr_hash = hash_create(buf_pool_get_curr_size() / 512);
}
#ifndef UNIV_LOG_DEBUG
diff --git a/storage/innobase/row/row0ins.c b/storage/innobase/row/row0ins.c
index ad14b927170..51c295b5098 100644
--- a/storage/innobase/row/row0ins.c
+++ b/storage/innobase/row/row0ins.c
@@ -140,7 +140,7 @@ row_ins_alloc_sys_fields(
dfield = dtuple_get_nth_field(row, dict_col_get_no(col));
- ptr = mem_heap_alloc(heap, DATA_ROW_ID_LEN);
+ ptr = mem_heap_zalloc(heap, DATA_ROW_ID_LEN);
dfield_set_data(dfield, ptr, DATA_ROW_ID_LEN);
@@ -151,7 +151,7 @@ row_ins_alloc_sys_fields(
col = dict_table_get_sys_col(table, DATA_TRX_ID);
dfield = dtuple_get_nth_field(row, dict_col_get_no(col));
- ptr = mem_heap_alloc(heap, DATA_TRX_ID_LEN);
+ ptr = mem_heap_zalloc(heap, DATA_TRX_ID_LEN);
dfield_set_data(dfield, ptr, DATA_TRX_ID_LEN);
@@ -162,7 +162,7 @@ row_ins_alloc_sys_fields(
col = dict_table_get_sys_col(table, DATA_ROLL_PTR);
dfield = dtuple_get_nth_field(row, dict_col_get_no(col));
- ptr = mem_heap_alloc(heap, DATA_ROLL_PTR_LEN);
+ ptr = mem_heap_zalloc(heap, DATA_ROLL_PTR_LEN);
dfield_set_data(dfield, ptr, DATA_ROLL_PTR_LEN);
}
diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c
index f7156403247..a0e0ee99775 100644
--- a/storage/innobase/row/row0mysql.c
+++ b/storage/innobase/row/row0mysql.c
@@ -1485,7 +1485,7 @@ row_unlock_for_mysql(
if (UNIV_UNLIKELY
(!srv_locks_unsafe_for_binlog
- && trx->isolation_level != TRX_ISO_READ_COMMITTED)) {
+ && trx->isolation_level > TRX_ISO_READ_COMMITTED)) {
fprintf(stderr,
"InnoDB: Error: calling row_unlock_for_mysql though\n"
diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c
index eee74f280af..1d30249c53e 100644
--- a/storage/innobase/row/row0sel.c
+++ b/storage/innobase/row/row0sel.c
@@ -744,7 +744,7 @@ row_sel_get_clust_rec(
trx = thr_get_trx(thr);
if (srv_locks_unsafe_for_binlog
- || trx->isolation_level == TRX_ISO_READ_COMMITTED) {
+ || trx->isolation_level <= TRX_ISO_READ_COMMITTED) {
lock_type = LOCK_REC_NOT_GAP;
} else {
lock_type = LOCK_ORDINARY;
@@ -1358,7 +1358,7 @@ rec_loop:
if (srv_locks_unsafe_for_binlog
|| trx->isolation_level
- == TRX_ISO_READ_COMMITTED) {
+ <= TRX_ISO_READ_COMMITTED) {
if (page_rec_is_supremum(next_rec)) {
@@ -1414,7 +1414,7 @@ skip_lock:
trx = thr_get_trx(thr);
if (srv_locks_unsafe_for_binlog
- || trx->isolation_level == TRX_ISO_READ_COMMITTED) {
+ || trx->isolation_level <= TRX_ISO_READ_COMMITTED) {
if (page_rec_is_supremum(rec)) {
@@ -3596,7 +3596,7 @@ shortcut_fails_too_big_rec:
&& !page_rec_is_supremum(rec)
&& set_also_gap_locks
&& !(srv_locks_unsafe_for_binlog
- || trx->isolation_level == TRX_ISO_READ_COMMITTED)
+ || trx->isolation_level <= TRX_ISO_READ_COMMITTED)
&& prebuilt->select_lock_type != LOCK_NONE) {
/* Try to place a gap lock on the next index record
@@ -3692,7 +3692,7 @@ rec_loop:
if (set_also_gap_locks
&& !(srv_locks_unsafe_for_binlog
- || trx->isolation_level == TRX_ISO_READ_COMMITTED)
+ || trx->isolation_level <= TRX_ISO_READ_COMMITTED)
&& prebuilt->select_lock_type != LOCK_NONE) {
/* Try to place a lock on the index record */
@@ -3827,7 +3827,7 @@ wrong_offs:
if (set_also_gap_locks
&& !(srv_locks_unsafe_for_binlog
|| trx->isolation_level
- == TRX_ISO_READ_COMMITTED)
+ <= TRX_ISO_READ_COMMITTED)
&& prebuilt->select_lock_type != LOCK_NONE) {
/* Try to place a gap lock on the index
@@ -3862,7 +3862,7 @@ wrong_offs:
if (set_also_gap_locks
&& !(srv_locks_unsafe_for_binlog
|| trx->isolation_level
- == TRX_ISO_READ_COMMITTED)
+ <= TRX_ISO_READ_COMMITTED)
&& prebuilt->select_lock_type != LOCK_NONE) {
/* Try to place a gap lock on the index
@@ -3909,7 +3909,7 @@ wrong_offs:
if (!set_also_gap_locks
|| srv_locks_unsafe_for_binlog
- || trx->isolation_level == TRX_ISO_READ_COMMITTED
+ || trx->isolation_level <= TRX_ISO_READ_COMMITTED
|| (unique_search
&& !UNIV_UNLIKELY(rec_get_deleted_flag(rec, comp)))) {
@@ -3947,7 +3947,7 @@ no_gap_lock:
rec_t* old_vers;
case DB_SUCCESS:
if (srv_locks_unsafe_for_binlog
- || trx->isolation_level == TRX_ISO_READ_COMMITTED) {
+ || trx->isolation_level <= TRX_ISO_READ_COMMITTED) {
/* Note that a record of
prebuilt->index was locked. */
prebuilt->new_rec_locks = 1;
@@ -3956,6 +3956,7 @@ no_gap_lock:
case DB_LOCK_WAIT:
if (UNIV_LIKELY(prebuilt->row_read_type
!= ROW_READ_TRY_SEMI_CONSISTENT)
+ || unique_search
|| index != clust_index) {
goto lock_wait_or_error;
@@ -4080,7 +4081,7 @@ no_gap_lock:
/* The record is delete-marked: we can skip it */
if ((srv_locks_unsafe_for_binlog
- || trx->isolation_level == TRX_ISO_READ_COMMITTED)
+ || trx->isolation_level <= TRX_ISO_READ_COMMITTED)
&& prebuilt->select_lock_type != LOCK_NONE
&& !did_semi_consistent_read) {
@@ -4147,7 +4148,7 @@ requires_clust_rec:
}
if ((srv_locks_unsafe_for_binlog
- || trx->isolation_level == TRX_ISO_READ_COMMITTED)
+ || trx->isolation_level <= TRX_ISO_READ_COMMITTED)
&& prebuilt->select_lock_type != LOCK_NONE) {
/* Note that both the secondary index record
and the clustered index record were locked. */
@@ -4160,7 +4161,7 @@ requires_clust_rec:
/* The record is delete marked: we can skip it */
if ((srv_locks_unsafe_for_binlog
- || trx->isolation_level == TRX_ISO_READ_COMMITTED)
+ || trx->isolation_level <= TRX_ISO_READ_COMMITTED)
&& prebuilt->select_lock_type != LOCK_NONE) {
/* No need to keep a lock on a delete-marked
@@ -4367,7 +4368,7 @@ lock_wait_or_error:
moves_up, &mtr);
if ((srv_locks_unsafe_for_binlog
- || trx->isolation_level == TRX_ISO_READ_COMMITTED)
+ || trx->isolation_level <= TRX_ISO_READ_COMMITTED)
&& !same_user_rec) {
/* Since we were not able to restore the cursor
diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
index 26ea7958d0d..a2eed3f171c 100644
--- a/storage/innobase/srv/srv0srv.c
+++ b/storage/innobase/srv/srv0srv.c
@@ -1554,8 +1554,9 @@ srv_suspend_mysql_thread(
mutex_exit(&kernel_mutex);
- if (srv_lock_wait_timeout < 100000000
- && wait_time > (double)srv_lock_wait_timeout) {
+ if (trx_is_interrupted(trx)
+ || (srv_lock_wait_timeout < 100000000
+ && wait_time > (double)srv_lock_wait_timeout)) {
trx->error_state = DB_LOCK_WAIT_TIMEOUT;
}
@@ -2104,9 +2105,10 @@ loop:
wait_time = ut_difftime(ut_time(), slot->suspend_time);
- if (srv_lock_wait_timeout < 100000000
- && (wait_time > (double) srv_lock_wait_timeout
- || wait_time < 0)) {
+ if (trx_is_interrupted(thr_get_trx(slot->thr))
+ || (srv_lock_wait_timeout < 100000000
+ && (wait_time > (double) srv_lock_wait_timeout
+ || wait_time < 0))) {
/* Timeout exceeded or a wrap-around in system
time counter: cancel the lock request queued
diff --git a/storage/innodb_plugin/ChangeLog b/storage/innodb_plugin/ChangeLog
index 58e476716d8..fb34b7bf493 100644
--- a/storage/innodb_plugin/ChangeLog
+++ b/storage/innodb_plugin/ChangeLog
@@ -1,3 +1,71 @@
+2010-04-28 The InnoDB Team
+
+ * log/log0recv.h, log/log0recv.c:
+ Fix Bug#53122 InnoDB recovery uses too big a hash table for redo
+ log records
+
+2010-04-27 The InnoDB Team
+
+ * handler/ha_innodb.cc, lock/lock0lock.c, row/row0mysql.c,
+ row/row0sel.c:
+ Fix Bug#48607 READ UNCOMMITTED uses more locks than READ COMMITTED
+ in InnoDB 5.1+
+
+2010-04-26 The InnoDB Team
+
+ * row/row0sel.c:
+ Fix Bug#52663 Lost update incrementing column value under
+ READ COMMITTED isolation level
+
+2010-04-22 The InnoDB Team
+
+ * include/dict0boot.h, dict/dict0boot.c:
+ Fix a bug that prevented the crash recovery of fast CREATE INDEX
+ from dropping partially created indexes.
+
+2010-04-21 The InnoDB Team
+
+ * btr/btr0btr.c:
+ Fix Bug#52964 Infinite loop in btr_page_split_and_insert()
+ in ROW_FORMAT=COMPRESSED
+
+2010-04-21 The InnoDB Team
+
+ * data/data0data.c:
+ Fix Bug#52745 Failing assertion: blob_no < page_zip->n_blobs
+
+2010-04-20 The InnoDB Team
+
+ * dict/dict0crea.c, handler/ha_innodb.cc, include/trx0trx.h:
+ Fix Bug#50495 'Row size too large' for plugin, but works for
+ built-in InnoDB
+ Only check the record size at index creation time when
+ innodb_strict_mode is set or when ROW_FORMAT is DYNAMIC or COMPRESSED.
+
+2010-04-20 The InnoDB Team
+
+ * btr/btr0btr.c, include/univ.i:
+ Implement UNIV_BTR_AVOID_COPY, for avoiding writes when a B-tree
+ node is split at the first or last record.
+
+2010-04-15 The InnoDB Team
+
+ * trx/trx0rec.c:
+ Fix Bug#52746 InnoDB purge thread crashed with table containing
+ prefix indexed blobs
+
+2010-03-31 The InnoDB Team
+
+ * mysql-test/innodb_bug51920.test, mysql-test/innodb_bug51920.result,
+ srv/srv0srv.c:
+ Fix Bug#51920 InnoDB connections in row lock wait ignore KILL
+ until lock wait timeout
+
+2010-03-31 The InnoDB Team
+
+ * mysql-test/innodb_bug38231.test:
+ Remove non-determinism in the test case.
+
2010-03-18 The InnoDB Team
* CMakeLists.txt:
diff --git a/storage/innodb_plugin/btr/btr0btr.c b/storage/innodb_plugin/btr/btr0btr.c
index fa4fc05d96b..ab20a945d00 100644
--- a/storage/innodb_plugin/btr/btr0btr.c
+++ b/storage/innodb_plugin/btr/btr0btr.c
@@ -1451,11 +1451,11 @@ Calculates a split record such that the tuple will certainly fit on
its half-page when the split is performed. We assume in this function
only that the cursor page has at least one user record.
@return split record, or NULL if tuple will be the first record on
-upper half-page */
+the lower or upper half-page (determined by btr_page_tuple_smaller()) */
static
rec_t*
-btr_page_get_sure_split_rec(
-/*========================*/
+btr_page_get_split_rec(
+/*===================*/
btr_cur_t* cursor, /*!< in: cursor at which insert should be made */
const dtuple_t* tuple, /*!< in: tuple to insert */
ulint n_ext) /*!< in: number of externally stored columns */
@@ -1832,6 +1832,37 @@ btr_attach_half_pages(
}
/*************************************************************//**
+Determine if a tuple is smaller than any record on the page.
+@return TRUE if smaller */
+static
+ibool
+btr_page_tuple_smaller(
+/*===================*/
+ btr_cur_t* cursor, /*!< in: b-tree cursor */
+ const dtuple_t* tuple, /*!< in: tuple to consider */
+ ulint* offsets,/*!< in/out: temporary storage */
+ ulint n_uniq, /*!< in: number of unique fields
+ in the index page records */
+ mem_heap_t** heap) /*!< in/out: heap for offsets */
+{
+ buf_block_t* block;
+ const rec_t* first_rec;
+ page_cur_t pcur;
+
+ /* Read the first user record in the page. */
+ block = btr_cur_get_block(cursor);
+ page_cur_set_before_first(block, &pcur);
+ page_cur_move_to_next(&pcur);
+ first_rec = page_cur_get_rec(&pcur);
+
+ offsets = rec_get_offsets(
+ first_rec, cursor->index, offsets,
+ n_uniq, heap);
+
+ return(cmp_dtuple_rec(tuple, first_rec, offsets) < 0);
+}
+
+/*************************************************************//**
Splits an index page to halves and inserts the tuple. It is assumed
that mtr holds an x-latch to the index tree. NOTE: the tree x-latch is
released within this function! NOTE that the operation of this
@@ -1901,12 +1932,17 @@ func_start:
/* 1. Decide the split record; split_rec == NULL means that the
tuple to be inserted should be the first record on the upper
half-page */
+ insert_left = FALSE;
if (n_iterations > 0) {
direction = FSP_UP;
hint_page_no = page_no + 1;
- split_rec = btr_page_get_sure_split_rec(cursor, tuple, n_ext);
+ split_rec = btr_page_get_split_rec(cursor, tuple, n_ext);
+ if (UNIV_UNLIKELY(split_rec == NULL)) {
+ insert_left = btr_page_tuple_smaller(
+ cursor, tuple, offsets, n_uniq, &heap);
+ }
} else if (btr_page_get_split_rec_to_right(cursor, &split_rec)) {
direction = FSP_UP;
hint_page_no = page_no + 1;
@@ -1914,37 +1950,24 @@ func_start:
} else if (btr_page_get_split_rec_to_left(cursor, &split_rec)) {
direction = FSP_DOWN;
hint_page_no = page_no - 1;
+ ut_ad(split_rec);
} else {
direction = FSP_UP;
hint_page_no = page_no + 1;
- if (page_get_n_recs(page) == 1) {
- page_cur_t pcur;
-
- /* There is only one record in the index page
- therefore we can't split the node in the middle
- by default. We need to determine whether the
- new record will be inserted to the left or right. */
+ /* If there is only one record in the index page, we
+ can't split the node in the middle by default. We need
+ to determine whether the new record will be inserted
+ to the left or right. */
- /* Read the first (and only) record in the page. */
- page_cur_set_before_first(block, &pcur);
- page_cur_move_to_next(&pcur);
- first_rec = page_cur_get_rec(&pcur);
-
- offsets = rec_get_offsets(
- first_rec, cursor->index, offsets,
- n_uniq, &heap);
-
- /* If the new record is less than the existing record
- the split in the middle will copy the existing
- record to the new node. */
- if (cmp_dtuple_rec(tuple, first_rec, offsets) < 0) {
- split_rec = page_get_middle_rec(page);
- } else {
- split_rec = NULL;
- }
- } else {
+ if (page_get_n_recs(page) > 1) {
split_rec = page_get_middle_rec(page);
+ } else if (btr_page_tuple_smaller(cursor, tuple,
+ offsets, n_uniq, &heap)) {
+ split_rec = page_rec_get_next(
+ page_get_infimum_rec(page));
+ } else {
+ split_rec = NULL;
}
}
@@ -1974,11 +1997,11 @@ func_start:
avoid further splits by inserting the record
to an empty page. */
split_rec = NULL;
- goto insert_right;
+ goto insert_empty;
}
} else {
-insert_right:
- insert_left = FALSE;
+insert_empty:
+ ut_ad(!split_rec);
buf = mem_alloc(rec_get_converted_size(cursor->index,
tuple, n_ext));
@@ -2015,7 +2038,17 @@ insert_right:
}
/* 5. Move then the records to the new page */
- if (direction == FSP_DOWN) {
+ if (direction == FSP_DOWN
+#ifdef UNIV_BTR_AVOID_COPY
+ && page_rec_is_supremum(move_limit)) {
+ /* Instead of moving all records, make the new page
+ the empty page. */
+
+ left_block = block;
+ right_block = new_block;
+ } else if (direction == FSP_DOWN
+#endif /* UNIV_BTR_AVOID_COPY */
+ ) {
/* fputs("Split left\n", stderr); */
if (0
@@ -2058,6 +2091,14 @@ insert_right:
right_block = block;
lock_update_split_left(right_block, left_block);
+#ifdef UNIV_BTR_AVOID_COPY
+ } else if (!split_rec) {
+ /* Instead of moving all records, make the new page
+ the empty page. */
+
+ left_block = new_block;
+ right_block = block;
+#endif /* UNIV_BTR_AVOID_COPY */
} else {
/* fputs("Split right\n", stderr); */
diff --git a/storage/innodb_plugin/btr/btr0cur.c b/storage/innodb_plugin/btr/btr0cur.c
index 504bd162f32..0e603fdca8f 100644
--- a/storage/innodb_plugin/btr/btr0cur.c
+++ b/storage/innodb_plugin/btr/btr0cur.c
@@ -1064,7 +1064,6 @@ btr_cur_optimistic_insert(
ibool inherit;
ulint zip_size;
ulint rec_size;
- mem_heap_t* heap = NULL;
ulint err;
*big_rec = NULL;
@@ -1144,10 +1143,6 @@ btr_cur_optimistic_insert(
index, entry, big_rec_vec);
}
- if (heap) {
- mem_heap_free(heap);
- }
-
return(DB_TOO_BIG_RECORD);
}
}
@@ -1170,15 +1165,11 @@ fail_err:
dtuple_convert_back_big_rec(index, entry, big_rec_vec);
}
- if (UNIV_LIKELY_NULL(heap)) {
- mem_heap_free(heap);
- }
-
return(err);
}
if (UNIV_UNLIKELY(max_size < BTR_CUR_PAGE_REORGANIZE_LIMIT
- || max_size < rec_size)
+ || max_size < rec_size)
&& UNIV_LIKELY(page_get_n_recs(page) > 1)
&& page_get_max_insert_size(page, 1) < rec_size) {
@@ -1244,10 +1235,6 @@ fail_err:
}
}
- if (UNIV_LIKELY_NULL(heap)) {
- mem_heap_free(heap);
- }
-
#ifdef BTR_CUR_HASH_ADAPT
if (!reorg && leaf && (cursor->flag == BTR_CUR_HASH)) {
btr_search_update_hash_node_on_insert(cursor);
@@ -3369,6 +3356,8 @@ btr_estimate_number_of_different_key_vals(
also the pages used for external storage of fields (those pages are
included in index->stat_n_leaf_pages) */
+ dict_index_stat_mutex_enter(index);
+
for (j = 0; j <= n_cols; j++) {
index->stat_n_diff_key_vals[j]
= ((n_diff[j]
@@ -3398,6 +3387,8 @@ btr_estimate_number_of_different_key_vals(
index->stat_n_diff_key_vals[j] += add_on;
}
+ dict_index_stat_mutex_exit(index);
+
mem_free(n_diff);
if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
diff --git a/storage/innodb_plugin/buf/buf0flu.c b/storage/innodb_plugin/buf/buf0flu.c
index ac62a7e9537..f2b07492470 100644
--- a/storage/innodb_plugin/buf/buf0flu.c
+++ b/storage/innodb_plugin/buf/buf0flu.c
@@ -153,12 +153,14 @@ buf_flush_block_cmp(
const void* p2) /*!< in: block2 */
{
int ret;
+ const buf_page_t* b1;
+ const buf_page_t* b2;
ut_ad(p1 != NULL);
ut_ad(p2 != NULL);
- const buf_page_t* b1 = *(const buf_page_t**) p1;
- const buf_page_t* b2 = *(const buf_page_t**) p2;
+ b1 = *(const buf_page_t**) p1;
+ b2 = *(const buf_page_t**) p2;
ut_ad(b1 != NULL);
ut_ad(b2 != NULL);
diff --git a/storage/innodb_plugin/data/data0data.c b/storage/innodb_plugin/data/data0data.c
index e3c1f1b4f23..0715b49bf9c 100644
--- a/storage/innodb_plugin/data/data0data.c
+++ b/storage/innodb_plugin/data/data0data.c
@@ -666,6 +666,21 @@ dtuple_convert_big_rec(
goto skip_field;
}
+ /* In DYNAMIC and COMPRESSED format, store
+ locally any non-BLOB columns whose maximum
+ length does not exceed 256 bytes. This is
+ because there is no room for the "external
+ storage" flag when the maximum length is 255
+ bytes or less. This restriction trivially
+ holds in REDUNDANT and COMPACT format, because
+ there we always store locally columns whose
+ length is up to local_len == 788 bytes.
+ @see rec_init_offsets_comp_ordinary */
+ if (ifield->col->mtype != DATA_BLOB
+ && ifield->col->len < 256) {
+ goto skip_field;
+ }
+
longest_i = i;
longest = savings;
diff --git a/storage/innodb_plugin/dict/dict0boot.c b/storage/innodb_plugin/dict/dict0boot.c
index 70b5bfa99f7..45d57b8c619 100644
--- a/storage/innodb_plugin/dict/dict0boot.c
+++ b/storage/innodb_plugin/dict/dict0boot.c
@@ -368,8 +368,8 @@ dict_boot(void)
#if DICT_SYS_INDEXES_TYPE_FIELD != 4 + 2
#error "DICT_SYS_INDEXES_TYPE_FIELD != 4 + 2"
#endif
-#if DICT_SYS_INDEXES_NAME_FIELD != 1 + 2
-#error "DICT_SYS_INDEXES_NAME_FIELD != 1 + 2"
+#if DICT_SYS_INDEXES_NAME_FIELD != 2 + 2
+#error "DICT_SYS_INDEXES_NAME_FIELD != 2 + 2"
#endif
table->id = DICT_INDEXES_ID;
diff --git a/storage/innodb_plugin/dict/dict0crea.c b/storage/innodb_plugin/dict/dict0crea.c
index 4ba7cd8a48c..653bff4bef6 100644
--- a/storage/innodb_plugin/dict/dict0crea.c
+++ b/storage/innodb_plugin/dict/dict0crea.c
@@ -1105,8 +1105,11 @@ dict_create_index_step(
dulint index_id = node->index->id;
- err = dict_index_add_to_cache(node->table, node->index,
- FIL_NULL, TRUE);
+ err = dict_index_add_to_cache(
+ node->table, node->index, FIL_NULL,
+ trx_is_strict(trx)
+ || dict_table_get_format(node->table)
+ >= DICT_TF_FORMAT_ZIP);
node->index = dict_index_get_if_in_cache_low(index_id);
ut_a(!node->index == (err != DB_SUCCESS));
diff --git a/storage/innodb_plugin/dict/dict0dict.c b/storage/innodb_plugin/dict/dict0dict.c
index 8a03151d062..83438231689 100644
--- a/storage/innodb_plugin/dict/dict0dict.c
+++ b/storage/innodb_plugin/dict/dict0dict.c
@@ -80,6 +80,10 @@ UNIV_INTERN rw_lock_t dict_operation_lock;
/** Identifies generated InnoDB foreign key names */
static char dict_ibfk[] = "_ibfk_";
+/** array of mutexes protecting dict_index_t::stat_n_diff_key_vals[] */
+#define DICT_INDEX_STAT_MUTEX_SIZE 32
+mutex_t dict_index_stat_mutex[DICT_INDEX_STAT_MUTEX_SIZE];
+
/*******************************************************************//**
Tries to find column names for the index and sets the col field of the
index.
@@ -239,6 +243,45 @@ dict_mutex_exit_for_mysql(void)
mutex_exit(&(dict_sys->mutex));
}
+/** Get the mutex that protects index->stat_n_diff_key_vals[] */
+#define GET_INDEX_STAT_MUTEX(index) \
+ (&dict_index_stat_mutex[ut_fold_dulint(index->id) \
+ % DICT_INDEX_STAT_MUTEX_SIZE])
+
+/**********************************************************************//**
+Lock the appropriate mutex to protect index->stat_n_diff_key_vals[].
+index->id is used to pick the right mutex and it should not change
+before dict_index_stat_mutex_exit() is called on this index. */
+UNIV_INTERN
+void
+dict_index_stat_mutex_enter(
+/*========================*/
+ const dict_index_t* index) /*!< in: index */
+{
+ ut_ad(index != NULL);
+ ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
+ ut_ad(index->cached);
+ ut_ad(!index->to_be_dropped);
+
+ mutex_enter(GET_INDEX_STAT_MUTEX(index));
+}
+
+/**********************************************************************//**
+Unlock the appropriate mutex that protects index->stat_n_diff_key_vals[]. */
+UNIV_INTERN
+void
+dict_index_stat_mutex_exit(
+/*=======================*/
+ const dict_index_t* index) /*!< in: index */
+{
+ ut_ad(index != NULL);
+ ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
+ ut_ad(index->cached);
+ ut_ad(!index->to_be_dropped);
+
+ mutex_exit(GET_INDEX_STAT_MUTEX(index));
+}
+
/********************************************************************//**
Decrements the count of open MySQL handles to a table. */
UNIV_INTERN
@@ -605,6 +648,8 @@ void
dict_init(void)
/*===========*/
{
+ int i;
+
dict_sys = mem_alloc(sizeof(dict_sys_t));
mutex_create(&dict_sys->mutex, SYNC_DICT);
@@ -625,6 +670,10 @@ dict_init(void)
ut_a(dict_foreign_err_file);
mutex_create(&dict_foreign_err_mutex, SYNC_ANY_LATCH);
+
+ for (i = 0; i < DICT_INDEX_STAT_MUTEX_SIZE; i++) {
+ mutex_create(&dict_index_stat_mutex[i], SYNC_INDEX_TREE);
+ }
}
/**********************************************************************//**
@@ -4171,9 +4220,13 @@ dict_update_statistics_low(
index = dict_table_get_first_index(table);
+ dict_index_stat_mutex_enter(index);
+
table->stat_n_rows = index->stat_n_diff_key_vals[
dict_index_get_n_unique(index)];
+ dict_index_stat_mutex_exit(index);
+
table->stat_clustered_index_size = index->stat_index_size;
table->stat_sum_of_other_index_sizes = sum_of_index_sizes
@@ -4351,6 +4404,8 @@ dict_index_print_low(
ut_ad(mutex_own(&(dict_sys->mutex)));
+ dict_index_stat_mutex_enter(index);
+
if (index->n_user_defined_cols > 0) {
n_vals = index->stat_n_diff_key_vals[
index->n_user_defined_cols];
@@ -4358,6 +4413,8 @@ dict_index_print_low(
n_vals = index->stat_n_diff_key_vals[1];
}
+ dict_index_stat_mutex_exit(index);
+
if (dict_index_is_clust(index)) {
type_string = "clustered index";
} else if (dict_index_is_unique(index)) {
@@ -4767,8 +4824,10 @@ UNIV_INTERN
void
dict_table_check_for_dup_indexes(
/*=============================*/
- const dict_table_t* table) /*!< in: Check for dup indexes
+ const dict_table_t* table, /*!< in: Check for dup indexes
in this table */
+ ibool tmp_ok) /*!< in: TRUE=allow temporary
+ index names */
{
/* Check for duplicates, ignoring indexes that are marked
as to be dropped */
@@ -4782,9 +4841,11 @@ dict_table_check_for_dup_indexes(
ut_a(UT_LIST_GET_LEN(table->indexes) > 0);
index1 = UT_LIST_GET_FIRST(table->indexes);
- index2 = UT_LIST_GET_NEXT(indexes, index1);
- while (index1 && index2) {
+ do {
+ ut_ad(tmp_ok || *index1->name != TEMP_INDEX_PREFIX);
+
+ index2 = UT_LIST_GET_NEXT(indexes, index1);
while (index2) {
@@ -4796,8 +4857,7 @@ dict_table_check_for_dup_indexes(
}
index1 = UT_LIST_GET_NEXT(indexes, index1);
- index2 = UT_LIST_GET_NEXT(indexes, index1);
- }
+ } while (index1);
}
#endif /* UNIV_DEBUG */
@@ -4850,5 +4910,9 @@ dict_close(void)
mem_free(dict_sys);
dict_sys = NULL;
+
+ for (i = 0; i < DICT_INDEX_STAT_MUTEX_SIZE; i++) {
+ mutex_free(&dict_index_stat_mutex[i]);
+ }
}
#endif /* !UNIV_HOTBACKUP */
diff --git a/storage/innodb_plugin/ha/ha0ha.c b/storage/innodb_plugin/ha/ha0ha.c
index db85288298d..9d9d341ad39 100644
--- a/storage/innodb_plugin/ha/ha0ha.c
+++ b/storage/innodb_plugin/ha/ha0ha.c
@@ -403,8 +403,6 @@ ha_print_info(
FILE* file, /*!< in: file where to print */
hash_table_t* table) /*!< in: hash table */
{
- ut_ad(table);
- ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
#ifdef UNIV_DEBUG
/* Some of the code here is disabled for performance reasons in production
builds, see http://bugs.mysql.com/36941 */
@@ -418,6 +416,8 @@ builds, see http://bugs.mysql.com/36941 */
#endif /* PRINT_USED_CELLS */
ulint n_bufs;
+ ut_ad(table);
+ ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
#ifdef PRINT_USED_CELLS
for (i = 0; i < hash_get_n_cells(table); i++) {
diff --git a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
index fbbebbce8fd..0fc6e786f4c 100644
--- a/storage/innodb_plugin/handler/ha_innodb.cc
+++ b/storage/innodb_plugin/handler/ha_innodb.cc
@@ -108,7 +108,6 @@ static ulong commit_threads = 0;
static pthread_mutex_t commit_threads_m;
static pthread_cond_t commit_cond;
static pthread_mutex_t commit_cond_m;
-static pthread_mutex_t analyze_mutex;
static bool innodb_inited = 0;
#define INSIDE_HA_INNOBASE_CC
@@ -316,7 +315,7 @@ static MYSQL_THDVAR_ULONG(lock_wait_timeout, PLUGIN_VAR_RQCMDARG,
static handler *innobase_create_handler(handlerton *hton,
- TABLE_SHARE *table,
+ TABLE_SHARE *table,
MEM_ROOT *mem_root)
{
return new (mem_root) ha_innobase(hton, table);
@@ -429,8 +428,9 @@ static
int
innobase_start_trx_and_assign_read_view(
/*====================================*/
- handlerton* hton, /*!< in: Innodb handlerton */
- THD* thd); /*!< in: MySQL thread handle of the user for whom
+ /* out: 0 */
+ handlerton* hton, /* in: Innodb handlerton */
+ THD* thd); /* in: MySQL thread handle of the user for whom
the transaction should be committed */
/****************************************************************//**
Flushes InnoDB logs to disk and makes a checkpoint. Really, a commit flushes
@@ -1815,6 +1815,19 @@ trx_is_interrupted(
return(trx && trx->mysql_thd && thd_killed((THD*) trx->mysql_thd));
}
+/**********************************************************************//**
+Determines if the currently running transaction is in strict mode.
+@return TRUE if strict */
+extern "C" UNIV_INTERN
+ibool
+trx_is_strict(
+/*==========*/
+ trx_t* trx) /*!< in: transaction */
+{
+ return(trx && trx->mysql_thd
+ && THDVAR((THD*) trx->mysql_thd, strict_mode));
+}
+
/**************************************************************//**
Resets some fields of a prebuilt struct. The template is used in fast
retrieval of just those column values MySQL needs in its processing. */
@@ -2134,7 +2147,7 @@ mem_free_and_error:
}
sql_print_error("InnoDB: invalid value "
- "innodb_file_format_check=%s",
+ "innodb_change_buffering=%s",
innobase_change_buffering);
goto mem_free_and_error;
}
@@ -2223,7 +2236,6 @@ innobase_change_buffering_inited_ok:
pthread_mutex_init(&prepare_commit_mutex, MY_MUTEX_INIT_FAST);
pthread_mutex_init(&commit_threads_m, MY_MUTEX_INIT_FAST);
pthread_mutex_init(&commit_cond_m, MY_MUTEX_INIT_FAST);
- pthread_mutex_init(&analyze_mutex, MY_MUTEX_INIT_FAST);
pthread_cond_init(&commit_cond, NULL);
innodb_inited= 1;
#ifdef MYSQL_DYNAMIC_PLUGIN
@@ -2278,7 +2290,6 @@ innobase_end(
pthread_mutex_destroy(&prepare_commit_mutex);
pthread_mutex_destroy(&commit_threads_m);
pthread_mutex_destroy(&commit_cond_m);
- pthread_mutex_destroy(&analyze_mutex);
pthread_cond_destroy(&commit_cond);
}
@@ -5126,7 +5137,7 @@ ha_innobase::unlock_row(void)
case ROW_READ_WITH_LOCKS:
if (!srv_locks_unsafe_for_binlog
&& prebuilt->trx->isolation_level
- != TRX_ISO_READ_COMMITTED) {
+ > TRX_ISO_READ_COMMITTED) {
break;
}
/* fall through */
@@ -5165,7 +5176,7 @@ ha_innobase::try_semi_consistent_read(bool yes)
if (yes
&& (srv_locks_unsafe_for_binlog
- || prebuilt->trx->isolation_level == TRX_ISO_READ_COMMITTED)) {
+ || prebuilt->trx->isolation_level <= TRX_ISO_READ_COMMITTED)) {
prebuilt->row_read_type = ROW_READ_TRY_SEMI_CONSISTENT;
} else {
prebuilt->row_read_type = ROW_READ_WITH_LOCKS;
@@ -7583,6 +7594,8 @@ ha_innobase::info(
break;
}
+ dict_index_stat_mutex_enter(index);
+
if (index->stat_n_diff_key_vals[j + 1] == 0) {
rec_per_key = stats.records;
@@ -7591,6 +7604,8 @@ ha_innobase::info(
index->stat_n_diff_key_vals[j + 1]);
}
+ dict_index_stat_mutex_exit(index);
+
/* Since MySQL seems to favor table scans
too much over index searches, we pretend
index selectivity is 2 times better than
@@ -7645,15 +7660,9 @@ ha_innobase::analyze(
THD* thd, /*!< in: connection thread handle */
HA_CHECK_OPT* check_opt) /*!< in: currently ignored */
{
- /* Serialize ANALYZE TABLE inside InnoDB, see
- Bug#38996 Race condition in ANALYZE TABLE */
- pthread_mutex_lock(&analyze_mutex);
-
/* Simply call ::info() with all the flags */
info(HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE);
- pthread_mutex_unlock(&analyze_mutex);
-
return(0);
}
@@ -9086,7 +9095,7 @@ ha_innobase::store_lock(
isolation_level = trx->isolation_level;
if ((srv_locks_unsafe_for_binlog
- || isolation_level == TRX_ISO_READ_COMMITTED)
+ || isolation_level <= TRX_ISO_READ_COMMITTED)
&& isolation_level != TRX_ISO_SERIALIZABLE
&& (lock_type == TL_READ || lock_type == TL_READ_NO_INSERT)
&& (sql_command == SQLCOM_INSERT_SELECT
diff --git a/storage/innodb_plugin/handler/handler0alter.cc b/storage/innodb_plugin/handler/handler0alter.cc
index 071253d2dae..e474c318c58 100644
--- a/storage/innodb_plugin/handler/handler0alter.cc
+++ b/storage/innodb_plugin/handler/handler0alter.cc
@@ -722,6 +722,8 @@ err_exit:
row_mysql_lock_data_dictionary(trx);
dict_locked = TRUE;
+ ut_d(dict_table_check_for_dup_indexes(innodb_table, FALSE));
+
/* If a new primary key is defined for the table we need
to drop the original table and rebuild all indexes. */
@@ -754,6 +756,8 @@ err_exit:
user_thd);
}
+ ut_d(dict_table_check_for_dup_indexes(innodb_table,
+ FALSE));
row_mysql_unlock_data_dictionary(trx);
goto err_exit;
}
@@ -828,7 +832,7 @@ error_handling:
row_mysql_lock_data_dictionary(trx);
dict_locked = TRUE;
- ut_d(dict_table_check_for_dup_indexes(prebuilt->table));
+ ut_d(dict_table_check_for_dup_indexes(prebuilt->table, TRUE));
if (!new_primary) {
error = row_merge_rename_indexes(trx, indexed_table);
@@ -917,6 +921,7 @@ convert_error:
}
if (dict_locked) {
+ ut_d(dict_table_check_for_dup_indexes(innodb_table, FALSE));
row_mysql_unlock_data_dictionary(trx);
}
@@ -959,6 +964,7 @@ ha_innobase::prepare_drop_index(
/* Test and mark all the indexes to be dropped */
row_mysql_lock_data_dictionary(trx);
+ ut_d(dict_table_check_for_dup_indexes(prebuilt->table, FALSE));
/* Check that none of the indexes have previously been flagged
for deletion. */
@@ -1124,6 +1130,7 @@ func_exit:
} while (index);
}
+ ut_d(dict_table_check_for_dup_indexes(prebuilt->table, FALSE));
row_mysql_unlock_data_dictionary(trx);
DBUG_RETURN(err);
@@ -1170,6 +1177,7 @@ ha_innobase::final_drop_index(
prebuilt->table->flags, user_thd);
row_mysql_lock_data_dictionary(trx);
+ ut_d(dict_table_check_for_dup_indexes(prebuilt->table, FALSE));
if (UNIV_UNLIKELY(err)) {
@@ -1210,9 +1218,8 @@ ha_innobase::final_drop_index(
valid index entry count in the translation table to zero */
share->idx_trans_tbl.index_count = 0;
- ut_d(dict_table_check_for_dup_indexes(prebuilt->table));
-
func_exit:
+ ut_d(dict_table_check_for_dup_indexes(prebuilt->table, FALSE));
trx_commit_for_mysql(trx);
trx_commit_for_mysql(prebuilt->trx);
row_mysql_unlock_data_dictionary(trx);
diff --git a/storage/innodb_plugin/include/dict0boot.h b/storage/innodb_plugin/include/dict0boot.h
index e01fafe652d..1a13bd1503a 100644
--- a/storage/innodb_plugin/include/dict0boot.h
+++ b/storage/innodb_plugin/include/dict0boot.h
@@ -137,7 +137,7 @@ clustered index */
#define DICT_SYS_INDEXES_PAGE_NO_FIELD 8
#define DICT_SYS_INDEXES_SPACE_NO_FIELD 7
#define DICT_SYS_INDEXES_TYPE_FIELD 6
-#define DICT_SYS_INDEXES_NAME_FIELD 3
+#define DICT_SYS_INDEXES_NAME_FIELD 4
/* When a row id which is zero modulo this number (which must be a power of
two) is assigned, the field DICT_HDR_ROW_ID on the dictionary header page is
diff --git a/storage/innodb_plugin/include/dict0dict.h b/storage/innodb_plugin/include/dict0dict.h
index 12396556c2d..79dcbb30de2 100644
--- a/storage/innodb_plugin/include/dict0dict.h
+++ b/storage/innodb_plugin/include/dict0dict.h
@@ -928,9 +928,10 @@ UNIV_INTERN
void
dict_table_check_for_dup_indexes(
/*=============================*/
- const dict_table_t* table); /*!< in: Check for dup indexes
+ const dict_table_t* table, /*!< in: Check for dup indexes
in this table */
-
+ ibool tmp_ok);/*!< in: TRUE=allow temporary
+ index names */
#endif /* UNIV_DEBUG */
/**********************************************************************//**
Builds a node pointer out of a physical record and a page number.
@@ -1060,6 +1061,22 @@ UNIV_INTERN
void
dict_mutex_exit_for_mysql(void);
/*===========================*/
+/**********************************************************************//**
+Lock the appropriate mutex to protect index->stat_n_diff_key_vals[].
+index->id is used to pick the right mutex and it should not change
+before dict_index_stat_mutex_exit() is called on this index. */
+UNIV_INTERN
+void
+dict_index_stat_mutex_enter(
+/*========================*/
+ const dict_index_t* index); /*!< in: index */
+/**********************************************************************//**
+Unlock the appropriate mutex that protects index->stat_n_diff_key_vals[]. */
+UNIV_INTERN
+void
+dict_index_stat_mutex_exit(
+/*=======================*/
+ const dict_index_t* index); /*!< in: index */
/********************************************************************//**
Checks if the database name in two table names is the same.
@return TRUE if same db name */
diff --git a/storage/innodb_plugin/include/log0recv.h b/storage/innodb_plugin/include/log0recv.h
index 3209799e140..9f334a34b44 100644
--- a/storage/innodb_plugin/include/log0recv.h
+++ b/storage/innodb_plugin/include/log0recv.h
@@ -368,8 +368,8 @@ typedef struct recv_addr_struct recv_addr_t;
struct recv_addr_struct{
enum recv_addr_state state;
/*!< recovery state of the page */
- ulint space; /*!< space id */
- ulint page_no;/*!< page number */
+ unsigned space:32;/*!< space id */
+ unsigned page_no:32;/*!< page number */
UT_LIST_BASE_NODE_T(recv_t)
rec_list;/*!< list of log records for this page */
hash_node_t addr_hash;/*!< hash node in the hash bucket chain */
diff --git a/storage/innodb_plugin/include/trx0trx.h b/storage/innodb_plugin/include/trx0trx.h
index 480f265a138..6872fb463c0 100644
--- a/storage/innodb_plugin/include/trx0trx.h
+++ b/storage/innodb_plugin/include/trx0trx.h
@@ -391,6 +391,14 @@ ibool
trx_is_interrupted(
/*===============*/
trx_t* trx); /*!< in: transaction */
+/**********************************************************************//**
+Determines if the currently running transaction is in strict mode.
+@return TRUE if strict */
+UNIV_INTERN
+ibool
+trx_is_strict(
+/*==========*/
+ trx_t* trx); /*!< in: transaction */
#else /* !UNIV_HOTBACKUP */
#define trx_is_interrupted(trx) FALSE
#endif /* !UNIV_HOTBACKUP */
diff --git a/storage/innodb_plugin/include/univ.i b/storage/innodb_plugin/include/univ.i
index 0df05999845..49717760456 100644
--- a/storage/innodb_plugin/include/univ.i
+++ b/storage/innodb_plugin/include/univ.i
@@ -46,7 +46,7 @@ Created 1/20/1994 Heikki Tuuri
#define INNODB_VERSION_MAJOR 1
#define INNODB_VERSION_MINOR 0
-#define INNODB_VERSION_BUGFIX 7
+#define INNODB_VERSION_BUGFIX 8
/* The following is the InnoDB version as shown in
SELECT plugin_version FROM information_schema.plugins;
@@ -115,7 +115,7 @@ if we are compiling on Windows. */
/* Include <sys/stat.h> to get S_I... macros defined for os0file.c */
# include <sys/stat.h>
-# if !defined(__NETWARE__) && !defined(__WIN__)
+# if !defined(__NETWARE__) && !defined(__WIN__)
# include <sys/mman.h> /* mmap() for os0proc.c */
# endif
@@ -165,6 +165,9 @@ command. Not tested on Windows. */
#define UNIV_COMPILE_TEST_FUNCS
*/
+#ifdef HAVE_purify
+# define UNIV_DEBUG_VALGRIND
+#endif /* HAVE_purify */
#if 0
#define UNIV_DEBUG_VALGRIND /* Enable extra
Valgrind instrumentation */
@@ -202,6 +205,10 @@ operations (very slow); also UNIV_DEBUG must be defined */
adaptive hash index */
#define UNIV_SRV_PRINT_LATCH_WAITS /* enable diagnostic output
in sync0sync.c */
+#define UNIV_BTR_AVOID_COPY /* when splitting B-tree nodes,
+ do not move any records when
+ all the records would
+ be moved */
#define UNIV_BTR_PRINT /* enable functions for
printing B-trees */
#define UNIV_ZIP_DEBUG /* extensive consistency checks
diff --git a/storage/innodb_plugin/lock/lock0lock.c b/storage/innodb_plugin/lock/lock0lock.c
index d5fff572aee..04e5fe1a65a 100644
--- a/storage/innodb_plugin/lock/lock0lock.c
+++ b/storage/innodb_plugin/lock/lock0lock.c
@@ -2400,7 +2400,7 @@ lock_rec_inherit_to_gap(
if (!lock_rec_get_insert_intention(lock)
&& !((srv_locks_unsafe_for_binlog
|| lock->trx->isolation_level
- == TRX_ISO_READ_COMMITTED)
+ <= TRX_ISO_READ_COMMITTED)
&& lock_get_mode(lock) == LOCK_X)) {
lock_rec_add_to_queue(LOCK_REC | LOCK_GAP
@@ -4710,6 +4710,7 @@ lock_rec_queue_validate(
ut_a(lock_rec_has_expl(LOCK_X | LOCK_REC_NOT_GAP,
block, heap_no, impl_trx));
}
+#if 0
} else {
/* The kernel mutex may get released temporarily in the
@@ -4720,6 +4721,27 @@ lock_rec_queue_validate(
(fil_space_t::latch), the following check WILL break
latching order and may cause a deadlock of threads. */
+ /* NOTE: This is a bogus check that would fail in the
+ following case: Our transaction is updating a
+ row. After it has updated the clustered index record,
+ it goes to a secondary index record and finds someone
+ else holding an explicit S- or X-lock on that
+ secondary index record, presumably from a locking
+ read. Our transaction cannot update the secondary
+ index immediately, but places a waiting X-lock request
+ on the secondary index record. There is nothing
+ illegal in this. The assertion is simply too strong. */
+
+ /* From the locking point of view, each secondary
+ index is a separate table. A lock that is held on
+ secondary index rec does not give any rights to modify
+ or read the clustered index rec. Therefore, we can
+ think of the sec index as a separate 'table' from the
+ clust index 'table'. Conversely, a transaction that
+ has acquired a lock on and modified a clustered index
+ record may need to wait for a lock on the
+ corresponding record in a secondary index. */
+
impl_trx = lock_sec_rec_some_has_impl_off_kernel(
rec, index, offsets);
@@ -4730,6 +4752,7 @@ lock_rec_queue_validate(
ut_a(lock_rec_has_expl(LOCK_X | LOCK_REC_NOT_GAP,
block, heap_no, impl_trx));
}
+#endif
}
lock = lock_rec_get_first(block, heap_no);
diff --git a/storage/innodb_plugin/log/log0recv.c b/storage/innodb_plugin/log/log0recv.c
index 7f5b2df7882..a727d6be768 100644
--- a/storage/innodb_plugin/log/log0recv.c
+++ b/storage/innodb_plugin/log/log0recv.c
@@ -300,11 +300,11 @@ recv_sys_init(
flush_list during recovery process.
As this initialization is done while holding the buffer pool
mutex we perform it before acquiring recv_sys->mutex. */
+#ifndef UNIV_HOTBACKUP
buf_flush_init_flush_rbt();
mutex_enter(&(recv_sys->mutex));
-#ifndef UNIV_HOTBACKUP
recv_sys->heap = mem_heap_create_in_buffer(256);
#else /* !UNIV_HOTBACKUP */
recv_sys->heap = mem_heap_create(256);
@@ -321,7 +321,7 @@ recv_sys_init(
recv_sys->len = 0;
recv_sys->recovered_offset = 0;
- recv_sys->addr_hash = hash_create(available_memory / 64);
+ recv_sys->addr_hash = hash_create(available_memory / 512);
recv_sys->n_addrs = 0;
recv_sys->apply_log_recs = FALSE;
@@ -361,7 +361,7 @@ recv_sys_empty_hash(void)
hash_table_free(recv_sys->addr_hash);
mem_heap_empty(recv_sys->heap);
- recv_sys->addr_hash = hash_create(buf_pool_get_curr_size() / 256);
+ recv_sys->addr_hash = hash_create(buf_pool_get_curr_size() / 512);
}
#ifndef UNIV_HOTBACKUP
diff --git a/storage/innodb_plugin/mysql-test/have_innodb.inc b/storage/innodb_plugin/mysql-test/have_innodb.inc
deleted file mode 100644
index 8944cc46f3e..00000000000
--- a/storage/innodb_plugin/mysql-test/have_innodb.inc
+++ /dev/null
@@ -1,4 +0,0 @@
-disable_query_log;
---require r/true.require
-select (support = 'YES' or support = 'DEFAULT' or support = 'ENABLED') as `TRUE` from information_schema.engines where engine = 'innodb';
-enable_query_log;
diff --git a/storage/innodb_plugin/mysql-test/innodb-analyze.result b/storage/innodb_plugin/mysql-test/innodb-analyze.result
deleted file mode 100644
index 2aee004a2d6..00000000000
--- a/storage/innodb_plugin/mysql-test/innodb-analyze.result
+++ /dev/null
@@ -1,2 +0,0 @@
-Variable_name Value
-innodb_stats_sample_pages 1
diff --git a/storage/innodb_plugin/mysql-test/innodb-consistent.result b/storage/innodb_plugin/mysql-test/innodb-consistent.result
deleted file mode 100644
index 9115791b99c..00000000000
--- a/storage/innodb_plugin/mysql-test/innodb-consistent.result
+++ /dev/null
@@ -1,35 +0,0 @@
-drop table if exists t1;
-set session transaction isolation level read committed;
-create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
-create table t2 like t1;
-insert into t2 values (1),(2),(3),(4),(5),(6),(7);
-set autocommit=0;
-begin;
-replace into t1 select * from t2;
-set session transaction isolation level read committed;
-set autocommit=0;
-delete from t2 where a=5;
-commit;
-delete from t2;
-commit;
-commit;
-begin;
-insert into t1 select * from t2;
-set session transaction isolation level read committed;
-set autocommit=0;
-delete from t2 where a=5;
-commit;
-delete from t2;
-commit;
-commit;
-select * from t1;
-a
-1
-2
-3
-4
-5
-6
-7
-drop table t1;
-drop table t2;
diff --git a/storage/innodb_plugin/mysql-test/innodb-consistent.test b/storage/innodb_plugin/mysql-test/innodb-consistent.test
deleted file mode 100644
index 791600fc8a7..00000000000
--- a/storage/innodb_plugin/mysql-test/innodb-consistent.test
+++ /dev/null
@@ -1,58 +0,0 @@
--- source include/not_embedded.inc
--- source include/have_innodb.inc
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-# REPLACE INTO ... SELECT and INSERT INTO ... SELECT should do
-# a consistent read of the source table.
-
-connect (a,localhost,root,,);
-connect (b,localhost,root,,);
-connection a;
-set session transaction isolation level read committed;
-create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
-create table t2 like t1;
-insert into t2 values (1),(2),(3),(4),(5),(6),(7);
-set autocommit=0;
-
-# REPLACE INTO ... SELECT case
-begin;
-# this should not result in any locks on t2.
-replace into t1 select * from t2;
-
-connection b;
-set session transaction isolation level read committed;
-set autocommit=0;
-# should not cuase a lock wait.
-delete from t2 where a=5;
-commit;
-delete from t2;
-commit;
-connection a;
-commit;
-
-# INSERT INTO ... SELECT case
-begin;
-# this should not result in any locks on t2.
-insert into t1 select * from t2;
-
-connection b;
-set session transaction isolation level read committed;
-set autocommit=0;
-# should not cuase a lock wait.
-delete from t2 where a=5;
-commit;
-delete from t2;
-commit;
-connection a;
-commit;
-
-select * from t1;
-drop table t1;
-drop table t2;
-
-connection default;
-disconnect a;
-disconnect b;
diff --git a/storage/innodb_plugin/mysql-test/innodb-index.inc b/storage/innodb_plugin/mysql-test/innodb-index.inc
deleted file mode 100644
index 37de3162abe..00000000000
--- a/storage/innodb_plugin/mysql-test/innodb-index.inc
+++ /dev/null
@@ -1,26 +0,0 @@
---eval create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb default charset=$charset
-insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,2,'ad','ad'),(4,4,'afe','afe');
-commit;
---error ER_DUP_ENTRY
-alter table t1 add unique index (b);
-insert into t1 values(8,9,'fff','fff');
-select * from t1;
-show create table t1;
-alter table t1 add index (b);
-insert into t1 values(10,10,'kkk','iii');
-select * from t1;
-select * from t1 force index(b) order by b;
-explain select * from t1 force index(b) order by b;
-show create table t1;
-alter table t1 add unique index (c), add index (d);
-insert into t1 values(11,11,'aaa','mmm');
-select * from t1;
-select * from t1 force index(b) order by b;
-select * from t1 force index(c) order by c;
-select * from t1 force index(d) order by d;
-explain select * from t1 force index(b) order by b;
-explain select * from t1 force index(c) order by c;
-explain select * from t1 force index(d) order by d;
-show create table t1;
-check table t1;
-drop table t1;
diff --git a/storage/innodb_plugin/mysql-test/innodb-index.result b/storage/innodb_plugin/mysql-test/innodb-index.result
deleted file mode 100644
index a7d66b15300..00000000000
--- a/storage/innodb_plugin/mysql-test/innodb-index.result
+++ /dev/null
@@ -1,1170 +0,0 @@
-create table t1(a int not null, b int, c char(10) not null, d varchar(20)) engine = innodb;
-insert into t1 values (5,5,'oo','oo'),(4,4,'tr','tr'),(3,4,'ad','ad'),(2,3,'ak','ak');
-commit;
-alter table t1 add index b (b), add index b (b);
-ERROR 42000: Duplicate key name 'b'
-alter table t1 add index (b,b);
-ERROR 42S21: Duplicate column name 'b'
-alter table t1 add index d2 (d);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- `c` char(10) NOT NULL,
- `d` varchar(20) DEFAULT NULL,
- KEY `d2` (`d`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-explain select * from t1 force index(d2) order by d;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL d2 23 NULL 4
-select * from t1 force index (d2) order by d;
-a b c d
-3 4 ad ad
-2 3 ak ak
-5 5 oo oo
-4 4 tr tr
-alter table t1 add unique index (b);
-ERROR 23000: Duplicate entry '4' for key 'b'
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- `c` char(10) NOT NULL,
- `d` varchar(20) DEFAULT NULL,
- KEY `d2` (`d`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t1 add index (b);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- `c` char(10) NOT NULL,
- `d` varchar(20) DEFAULT NULL,
- KEY `d2` (`d`),
- KEY `b` (`b`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-CREATE TABLE `t1#1`(a INT PRIMARY KEY) ENGINE=InnoDB;
-alter table t1 add unique index (c), add index (d);
-ERROR HY000: Table 'test.t1#1' already exists
-rename table `t1#1` to `t1#2`;
-alter table t1 add unique index (c), add index (d);
-ERROR HY000: Table 'test.t1#2' already exists
-drop table `t1#2`;
-alter table t1 add unique index (c), add index (d);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- `c` char(10) NOT NULL,
- `d` varchar(20) DEFAULT NULL,
- UNIQUE KEY `c` (`c`),
- KEY `d2` (`d`),
- KEY `b` (`b`),
- KEY `d` (`d`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-explain select * from t1 force index(c) order by c;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL c 10 NULL 4
-alter table t1 add primary key (a), drop index c;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- `c` char(10) NOT NULL,
- `d` varchar(20) DEFAULT NULL,
- PRIMARY KEY (`a`),
- KEY `d2` (`d`),
- KEY `b` (`b`),
- KEY `d` (`d`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t1 add primary key (c);
-ERROR 42000: Multiple primary key defined
-alter table t1 drop primary key, add primary key (b);
-ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
-create unique index c on t1 (c);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- `c` char(10) NOT NULL,
- `d` varchar(20) DEFAULT NULL,
- PRIMARY KEY (`a`),
- UNIQUE KEY `c` (`c`),
- KEY `d2` (`d`),
- KEY `b` (`b`),
- KEY `d` (`d`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-explain select * from t1 force index(c) order by c;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL c 10 NULL 4
-select * from t1 force index(c) order by c;
-a b c d
-3 4 ad ad
-2 3 ak ak
-5 5 oo oo
-4 4 tr tr
-alter table t1 drop index b, add index (b);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- `c` char(10) NOT NULL,
- `d` varchar(20) DEFAULT NULL,
- PRIMARY KEY (`a`),
- UNIQUE KEY `c` (`c`),
- KEY `d2` (`d`),
- KEY `d` (`d`),
- KEY `b` (`b`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-insert into t1 values(6,1,'ggg','ggg');
-select * from t1;
-a b c d
-2 3 ak ak
-3 4 ad ad
-4 4 tr tr
-5 5 oo oo
-6 1 ggg ggg
-select * from t1 force index(b) order by b;
-a b c d
-6 1 ggg ggg
-2 3 ak ak
-3 4 ad ad
-4 4 tr tr
-5 5 oo oo
-select * from t1 force index(c) order by c;
-a b c d
-3 4 ad ad
-2 3 ak ak
-6 1 ggg ggg
-5 5 oo oo
-4 4 tr tr
-select * from t1 force index(d) order by d;
-a b c d
-3 4 ad ad
-2 3 ak ak
-6 1 ggg ggg
-5 5 oo oo
-4 4 tr tr
-explain select * from t1 force index(b) order by b;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL b 5 NULL 5
-explain select * from t1 force index(c) order by c;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL c 10 NULL 5
-explain select * from t1 force index(d) order by d;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL d 23 NULL 5
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- `c` char(10) NOT NULL,
- `d` varchar(20) DEFAULT NULL,
- PRIMARY KEY (`a`),
- UNIQUE KEY `c` (`c`),
- KEY `d2` (`d`),
- KEY `d` (`d`),
- KEY `b` (`b`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
-create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb;
-insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,3,'ad','ad'),(4,4,'afe','afe');
-commit;
-alter table t1 add index (c(2));
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- `c` char(10) DEFAULT NULL,
- `d` varchar(20) DEFAULT NULL,
- PRIMARY KEY (`a`),
- KEY `c` (`c`(2))
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t1 add unique index (d(10));
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- `c` char(10) DEFAULT NULL,
- `d` varchar(20) DEFAULT NULL,
- PRIMARY KEY (`a`),
- UNIQUE KEY `d` (`d`(10)),
- KEY `c` (`c`(2))
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-insert into t1 values(5,1,'ggg','ggg');
-select * from t1;
-a b c d
-1 1 ab ab
-2 2 ac ac
-3 3 ad ad
-4 4 afe afe
-5 1 ggg ggg
-select * from t1 force index(c) order by c;
-a b c d
-1 1 ab ab
-2 2 ac ac
-3 3 ad ad
-4 4 afe afe
-5 1 ggg ggg
-select * from t1 force index(d) order by d;
-a b c d
-1 1 ab ab
-2 2 ac ac
-3 3 ad ad
-4 4 afe afe
-5 1 ggg ggg
-explain select * from t1 order by b;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using filesort
-explain select * from t1 force index(c) order by c;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using filesort
-explain select * from t1 force index(d) order by d;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using filesort
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- `c` char(10) DEFAULT NULL,
- `d` varchar(20) DEFAULT NULL,
- PRIMARY KEY (`a`),
- UNIQUE KEY `d` (`d`(10)),
- KEY `c` (`c`(2))
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t1 drop index d;
-insert into t1 values(8,9,'fff','fff');
-select * from t1;
-a b c d
-1 1 ab ab
-2 2 ac ac
-3 3 ad ad
-4 4 afe afe
-5 1 ggg ggg
-8 9 fff fff
-select * from t1 force index(c) order by c;
-a b c d
-1 1 ab ab
-2 2 ac ac
-3 3 ad ad
-4 4 afe afe
-8 9 fff fff
-5 1 ggg ggg
-explain select * from t1 order by b;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort
-explain select * from t1 force index(c) order by c;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort
-explain select * from t1 order by d;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- `c` char(10) DEFAULT NULL,
- `d` varchar(20) DEFAULT NULL,
- PRIMARY KEY (`a`),
- KEY `c` (`c`(2))
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
-create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb;
-insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,2,'ad','ad'),(4,4,'afe','afe');
-commit;
-alter table t1 add unique index (b,c);
-insert into t1 values(8,9,'fff','fff');
-select * from t1;
-a b c d
-1 1 ab ab
-2 2 ac ac
-3 2 ad ad
-4 4 afe afe
-8 9 fff fff
-select * from t1 force index(b) order by b;
-a b c d
-1 1 ab ab
-2 2 ac ac
-3 2 ad ad
-4 4 afe afe
-8 9 fff fff
-explain select * from t1 force index(b) order by b;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL b 16 NULL 5
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- `c` char(10) DEFAULT NULL,
- `d` varchar(20) DEFAULT NULL,
- PRIMARY KEY (`a`),
- UNIQUE KEY `b` (`b`,`c`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t1 add index (b,c);
-insert into t1 values(11,11,'kkk','kkk');
-select * from t1;
-a b c d
-1 1 ab ab
-2 2 ac ac
-3 2 ad ad
-4 4 afe afe
-8 9 fff fff
-11 11 kkk kkk
-select * from t1 force index(b) order by b;
-a b c d
-1 1 ab ab
-2 2 ac ac
-3 2 ad ad
-4 4 afe afe
-8 9 fff fff
-11 11 kkk kkk
-explain select * from t1 force index(b) order by b;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL b 16 NULL 6
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- `c` char(10) DEFAULT NULL,
- `d` varchar(20) DEFAULT NULL,
- PRIMARY KEY (`a`),
- UNIQUE KEY `b` (`b`,`c`),
- KEY `b_2` (`b`,`c`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t1 add unique index (c,d);
-insert into t1 values(13,13,'yyy','aaa');
-select * from t1;
-a b c d
-1 1 ab ab
-2 2 ac ac
-3 2 ad ad
-4 4 afe afe
-8 9 fff fff
-11 11 kkk kkk
-13 13 yyy aaa
-select * from t1 force index(b) order by b;
-a b c d
-1 1 ab ab
-2 2 ac ac
-3 2 ad ad
-4 4 afe afe
-8 9 fff fff
-11 11 kkk kkk
-13 13 yyy aaa
-select * from t1 force index(c) order by c;
-a b c d
-1 1 ab ab
-2 2 ac ac
-3 2 ad ad
-4 4 afe afe
-8 9 fff fff
-11 11 kkk kkk
-13 13 yyy aaa
-explain select * from t1 force index(b) order by b;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL b 16 NULL 7
-explain select * from t1 force index(c) order by c;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL c 34 NULL 7
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- `c` char(10) DEFAULT NULL,
- `d` varchar(20) DEFAULT NULL,
- PRIMARY KEY (`a`),
- UNIQUE KEY `b` (`b`,`c`),
- UNIQUE KEY `c` (`c`,`d`),
- KEY `b_2` (`b`,`c`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
-create table t1(a int not null, b int not null, c int, primary key (a), key (b)) engine = innodb;
-create table t3(a int not null, c int not null, d int, primary key (a), key (c)) engine = innodb;
-create table t4(a int not null, d int not null, e int, primary key (a), key (d)) engine = innodb;
-create table t2(a int not null, b int not null, c int not null, d int not null, e int,
-foreign key (b) references t1(b) on delete cascade,
-foreign key (c) references t3(c), foreign key (d) references t4(d))
-engine = innodb;
-alter table t1 drop index b;
-ERROR HY000: Cannot drop index 'b': needed in a foreign key constraint
-alter table t3 drop index c;
-ERROR HY000: Cannot drop index 'c': needed in a foreign key constraint
-alter table t4 drop index d;
-ERROR HY000: Cannot drop index 'd': needed in a foreign key constraint
-alter table t2 drop index b;
-ERROR HY000: Cannot drop index 'b': needed in a foreign key constraint
-alter table t2 drop index b, drop index c, drop index d;
-ERROR HY000: Cannot drop index 'b': needed in a foreign key constraint
-create unique index dc on t2 (d,c);
-create index dc on t1 (b,c);
-alter table t2 add primary key (a);
-insert into t1 values (1,1,1);
-insert into t3 values (1,1,1);
-insert into t4 values (1,1,1);
-insert into t2 values (1,1,1,1,1);
-commit;
-alter table t4 add constraint dc foreign key (a) references t1(a);
-show create table t4;
-Table Create Table
-t4 CREATE TABLE `t4` (
- `a` int(11) NOT NULL,
- `d` int(11) NOT NULL,
- `e` int(11) DEFAULT NULL,
- PRIMARY KEY (`a`),
- KEY `d` (`d`),
- CONSTRAINT `dc` FOREIGN KEY (`a`) REFERENCES `t1` (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t3 add constraint dc foreign key (a) references t1(a);
-ERROR HY000: Can't create table '#sql-temporary' (errno: 121)
-show create table t3;
-Table Create Table
-t3 CREATE TABLE `t3` (
- `a` int(11) NOT NULL,
- `c` int(11) NOT NULL,
- `d` int(11) DEFAULT NULL,
- PRIMARY KEY (`a`),
- KEY `c` (`c`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-alter table t2 drop index b, add index (b);
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` int(11) NOT NULL,
- `b` int(11) NOT NULL,
- `c` int(11) NOT NULL,
- `d` int(11) NOT NULL,
- `e` int(11) DEFAULT NULL,
- PRIMARY KEY (`a`),
- UNIQUE KEY `dc` (`d`,`c`),
- KEY `c` (`c`),
- KEY `b` (`b`),
- CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`b`) ON DELETE CASCADE,
- CONSTRAINT `t2_ibfk_2` FOREIGN KEY (`c`) REFERENCES `t3` (`c`),
- CONSTRAINT `t2_ibfk_3` FOREIGN KEY (`d`) REFERENCES `t4` (`d`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-delete from t1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t4`, CONSTRAINT `dc` FOREIGN KEY (`a`) REFERENCES `t1` (`a`))
-drop index dc on t4;
-ERROR 42000: Can't DROP 'dc'; check that column/key exists
-alter table t3 drop foreign key dc;
-ERROR HY000: Error on rename of './test/t3' to '#sql2-temporary' (errno: 152)
-alter table t4 drop foreign key dc;
-select * from t2;
-a b c d e
-1 1 1 1 1
-delete from t1;
-select * from t2;
-a b c d e
-drop table t2,t4,t3,t1;
-create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb default charset=utf8;
-insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,2,'ad','ad'),(4,4,'afe','afe');
-commit;
-alter table t1 add unique index (b);
-ERROR 23000: Duplicate entry '2' for key 'b'
-insert into t1 values(8,9,'fff','fff');
-select * from t1;
-a b c d
-1 1 ab ab
-2 2 ac ac
-3 2 ad ad
-4 4 afe afe
-8 9 fff fff
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- `c` char(10) DEFAULT NULL,
- `d` varchar(20) DEFAULT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8
-alter table t1 add index (b);
-insert into t1 values(10,10,'kkk','iii');
-select * from t1;
-a b c d
-1 1 ab ab
-2 2 ac ac
-3 2 ad ad
-4 4 afe afe
-8 9 fff fff
-10 10 kkk iii
-select * from t1 force index(b) order by b;
-a b c d
-1 1 ab ab
-2 2 ac ac
-3 2 ad ad
-4 4 afe afe
-8 9 fff fff
-10 10 kkk iii
-explain select * from t1 force index(b) order by b;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL b 5 NULL 6
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- `c` char(10) DEFAULT NULL,
- `d` varchar(20) DEFAULT NULL,
- PRIMARY KEY (`a`),
- KEY `b` (`b`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8
-alter table t1 add unique index (c), add index (d);
-insert into t1 values(11,11,'aaa','mmm');
-select * from t1;
-a b c d
-1 1 ab ab
-2 2 ac ac
-3 2 ad ad
-4 4 afe afe
-8 9 fff fff
-10 10 kkk iii
-11 11 aaa mmm
-select * from t1 force index(b) order by b;
-a b c d
-1 1 ab ab
-2 2 ac ac
-3 2 ad ad
-4 4 afe afe
-8 9 fff fff
-10 10 kkk iii
-11 11 aaa mmm
-select * from t1 force index(c) order by c;
-a b c d
-11 11 aaa mmm
-1 1 ab ab
-2 2 ac ac
-3 2 ad ad
-4 4 afe afe
-8 9 fff fff
-10 10 kkk iii
-select * from t1 force index(d) order by d;
-a b c d
-1 1 ab ab
-2 2 ac ac
-3 2 ad ad
-4 4 afe afe
-8 9 fff fff
-10 10 kkk iii
-11 11 aaa mmm
-explain select * from t1 force index(b) order by b;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL b 5 NULL 7
-explain select * from t1 force index(c) order by c;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL c 31 NULL 7
-explain select * from t1 force index(d) order by d;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL d 63 NULL 7
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- `c` char(10) DEFAULT NULL,
- `d` varchar(20) DEFAULT NULL,
- PRIMARY KEY (`a`),
- UNIQUE KEY `c` (`c`),
- KEY `b` (`b`),
- KEY `d` (`d`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8
-check table t1;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-drop table t1;
-create table t1(a int not null, b int) engine = innodb;
-insert into t1 values (1,1),(1,1),(1,1),(1,1);
-alter table t1 add unique index (a);
-ERROR 23000: Duplicate entry '1' for key 'a'
-alter table t1 add unique index (b);
-ERROR 23000: Duplicate entry '1' for key 'b'
-alter table t1 add unique index (a), add unique index(b);
-ERROR 23000: Duplicate entry '1' for key 'a'
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
-create table t1(a int not null, c int not null,b int, primary key(a), unique key(c), key(b)) engine = innodb;
-alter table t1 drop index c, drop index b;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `c` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
-create table t1(a int not null, b int, primary key(a)) engine = innodb;
-alter table t1 add index (b);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- PRIMARY KEY (`a`),
- KEY `b` (`b`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
-create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb;
-insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,3,'ac','ac'),(4,4,'afe','afe'),(5,4,'affe','affe');
-alter table t1 add unique index (b), add unique index (c), add unique index (d);
-ERROR 23000: Duplicate entry '4' for key 'b'
-alter table t1 add unique index (c), add unique index (b), add index (d);
-ERROR 23000: Duplicate entry 'ac' for key 'c'
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- `c` char(10) DEFAULT NULL,
- `d` varchar(20) DEFAULT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-drop table t1;
-create table t1(a int not null, b int not null, c int, primary key (a), key(c)) engine=innodb;
-insert into t1 values (5,1,5),(4,2,4),(3,3,3),(2,4,2),(1,5,1);
-alter table t1 add unique index (b);
-insert into t1 values (10,20,20),(11,19,19),(12,18,18),(13,17,17);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) NOT NULL,
- `c` int(11) DEFAULT NULL,
- PRIMARY KEY (`a`),
- UNIQUE KEY `b` (`b`),
- KEY `c` (`c`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-check table t1;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-explain select * from t1 force index(c) order by c;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL c 5 NULL 9
-explain select * from t1 order by a;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL PRIMARY 4 NULL 9
-explain select * from t1 force index(b) order by b;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL b 4 NULL 9
-select * from t1 order by a;
-a b c
-1 5 1
-2 4 2
-3 3 3
-4 2 4
-5 1 5
-10 20 20
-11 19 19
-12 18 18
-13 17 17
-select * from t1 force index(b) order by b;
-a b c
-5 1 5
-4 2 4
-3 3 3
-2 4 2
-1 5 1
-13 17 17
-12 18 18
-11 19 19
-10 20 20
-select * from t1 force index(c) order by c;
-a b c
-1 5 1
-2 4 2
-3 3 3
-4 2 4
-5 1 5
-13 17 17
-12 18 18
-11 19 19
-10 20 20
-drop table t1;
-create table t1(a int not null, b int not null) engine=innodb;
-insert into t1 values (1,1);
-alter table t1 add primary key(b);
-insert into t1 values (2,2);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) NOT NULL,
- PRIMARY KEY (`b`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-check table t1;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-select * from t1;
-a b
-1 1
-2 2
-explain select * from t1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 2
-explain select * from t1 order by a;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using filesort
-explain select * from t1 order by b;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL PRIMARY 4 NULL 2
-checksum table t1;
-Table Checksum
-test.t1 582702641
-drop table t1;
-create table t1(a int not null) engine=innodb;
-insert into t1 values (1);
-alter table t1 add primary key(a);
-insert into t1 values (2);
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-check table t1;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-commit;
-select * from t1;
-a
-1
-2
-explain select * from t1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL PRIMARY 4 NULL 2 Using index
-explain select * from t1 order by a;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL PRIMARY 4 NULL 2 Using index
-drop table t1;
-create table t2(d varchar(17) primary key) engine=innodb default charset=utf8;
-create table t3(a int primary key) engine=innodb;
-insert into t3 values(22),(44),(33),(55),(66);
-insert into t2 values ('jejdkrun87'),('adfd72nh9k'),
-('adfdpplkeock'),('adfdijnmnb78k'),('adfdijn0loKNHJik');
-create table t1(a int, b blob, c text, d text not null)
-engine=innodb default charset = utf8;
-insert into t1
-select a,left(repeat(d,100*a),65535),repeat(d,20*a),d from t2,t3;
-drop table t2, t3;
-select count(*) from t1 where a=44;
-count(*)
-5
-select a,
-length(b),b=left(repeat(d,100*a),65535),length(c),c=repeat(d,20*a),d from t1;
-a length(b) b=left(repeat(d,100*a),65535) length(c) c=repeat(d,20*a) d
-22 22000 1 4400 1 adfd72nh9k
-22 35200 1 7040 1 adfdijn0loKNHJik
-22 28600 1 5720 1 adfdijnmnb78k
-22 26400 1 5280 1 adfdpplkeock
-22 22000 1 4400 1 jejdkrun87
-33 33000 1 6600 1 adfd72nh9k
-33 52800 1 10560 1 adfdijn0loKNHJik
-33 42900 1 8580 1 adfdijnmnb78k
-33 39600 1 7920 1 adfdpplkeock
-33 33000 1 6600 1 jejdkrun87
-44 44000 1 8800 1 adfd72nh9k
-44 65535 1 14080 1 adfdijn0loKNHJik
-44 57200 1 11440 1 adfdijnmnb78k
-44 52800 1 10560 1 adfdpplkeock
-44 44000 1 8800 1 jejdkrun87
-55 55000 1 11000 1 adfd72nh9k
-55 65535 1 17600 1 adfdijn0loKNHJik
-55 65535 1 14300 1 adfdijnmnb78k
-55 65535 1 13200 1 adfdpplkeock
-55 55000 1 11000 1 jejdkrun87
-66 65535 1 13200 1 adfd72nh9k
-66 65535 1 21120 1 adfdijn0loKNHJik
-66 65535 1 17160 1 adfdijnmnb78k
-66 65535 1 15840 1 adfdpplkeock
-66 65535 1 13200 1 jejdkrun87
-alter table t1 add primary key (a), add key (b(20));
-ERROR 23000: Duplicate entry '22' for key 'PRIMARY'
-delete from t1 where a%2;
-check table t1;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-alter table t1 add primary key (a,b(255),c(255)), add key (b(767));
-select count(*) from t1 where a=44;
-count(*)
-5
-select a,
-length(b),b=left(repeat(d,100*a),65535),length(c),c=repeat(d,20*a),d from t1;
-a length(b) b=left(repeat(d,100*a),65535) length(c) c=repeat(d,20*a) d
-22 22000 1 4400 1 adfd72nh9k
-22 35200 1 7040 1 adfdijn0loKNHJik
-22 28600 1 5720 1 adfdijnmnb78k
-22 26400 1 5280 1 adfdpplkeock
-22 22000 1 4400 1 jejdkrun87
-44 44000 1 8800 1 adfd72nh9k
-44 65535 1 14080 1 adfdijn0loKNHJik
-44 57200 1 11440 1 adfdijnmnb78k
-44 52800 1 10560 1 adfdpplkeock
-44 44000 1 8800 1 jejdkrun87
-66 65535 1 13200 1 adfd72nh9k
-66 65535 1 21120 1 adfdijn0loKNHJik
-66 65535 1 17160 1 adfdijnmnb78k
-66 65535 1 15840 1 adfdpplkeock
-66 65535 1 13200 1 jejdkrun87
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL DEFAULT '0',
- `b` blob NOT NULL,
- `c` text NOT NULL,
- `d` text NOT NULL,
- PRIMARY KEY (`a`,`b`(255),`c`(255)),
- KEY `b` (`b`(767))
-) ENGINE=InnoDB DEFAULT CHARSET=utf8
-check table t1;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-explain select * from t1 where b like 'adfd%';
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL b NULL NULL NULL 15 Using where
-create table t2(a int, b varchar(255), primary key(a,b)) engine=innodb;
-insert into t2 select a,left(b,255) from t1;
-drop table t1;
-rename table t2 to t1;
-set innodb_lock_wait_timeout=1;
-begin;
-select a from t1 limit 1 for update;
-a
-22
-set innodb_lock_wait_timeout=1;
-create index t1ba on t1 (b,a);
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-commit;
-begin;
-select a from t1 limit 1 lock in share mode;
-a
-22
-create index t1ba on t1 (b,a);
-drop index t1ba on t1;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-commit;
-explain select a from t1 order by b;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL t1ba 261 NULL 15 Using index
-select a,sleep(2+a/100) from t1 order by b limit 3;
-select sleep(1);
-sleep(1)
-0
-drop index t1ba on t1;
-a sleep(2+a/100)
-22 0
-44 0
-66 0
-explain select a from t1 order by b;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL PRIMARY 261 NULL 15 Using index; Using filesort
-select a from t1 order by b limit 3;
-a
-22
-66
-44
-commit;
-drop table t1;
-set global innodb_file_per_table=on;
-set global innodb_file_format='Barracuda';
-create table t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
-i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob,
-q blob,r blob,s blob,t blob,u blob)
-engine=innodb row_format=dynamic;
-create index t1a on t1 (a(1));
-create index t1b on t1 (b(1));
-create index t1c on t1 (c(1));
-create index t1d on t1 (d(1));
-create index t1e on t1 (e(1));
-create index t1f on t1 (f(1));
-create index t1g on t1 (g(1));
-create index t1h on t1 (h(1));
-create index t1i on t1 (i(1));
-create index t1j on t1 (j(1));
-create index t1k on t1 (k(1));
-create index t1l on t1 (l(1));
-create index t1m on t1 (m(1));
-create index t1n on t1 (n(1));
-create index t1o on t1 (o(1));
-create index t1p on t1 (p(1));
-create index t1q on t1 (q(1));
-create index t1r on t1 (r(1));
-create index t1s on t1 (s(1));
-create index t1t on t1 (t(1));
-create index t1u on t1 (u(1));
-ERROR HY000: Too big row
-create index t1ut on t1 (u(1), t(1));
-ERROR HY000: Too big row
-create index t1st on t1 (s(1), t(1));
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` blob,
- `b` blob,
- `c` blob,
- `d` blob,
- `e` blob,
- `f` blob,
- `g` blob,
- `h` blob,
- `i` blob,
- `j` blob,
- `k` blob,
- `l` blob,
- `m` blob,
- `n` blob,
- `o` blob,
- `p` blob,
- `q` blob,
- `r` blob,
- `s` blob,
- `t` blob,
- `u` blob,
- KEY `t1a` (`a`(1)),
- KEY `t1b` (`b`(1)),
- KEY `t1c` (`c`(1)),
- KEY `t1d` (`d`(1)),
- KEY `t1e` (`e`(1)),
- KEY `t1f` (`f`(1)),
- KEY `t1g` (`g`(1)),
- KEY `t1h` (`h`(1)),
- KEY `t1i` (`i`(1)),
- KEY `t1j` (`j`(1)),
- KEY `t1k` (`k`(1)),
- KEY `t1l` (`l`(1)),
- KEY `t1m` (`m`(1)),
- KEY `t1n` (`n`(1)),
- KEY `t1o` (`o`(1)),
- KEY `t1p` (`p`(1)),
- KEY `t1q` (`q`(1)),
- KEY `t1r` (`r`(1)),
- KEY `t1s` (`s`(1)),
- KEY `t1t` (`t`(1)),
- KEY `t1st` (`s`(1),`t`(1))
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
-create index t1u on t1 (u(1));
-ERROR HY000: Too big row
-alter table t1 row_format=compact;
-create index t1u on t1 (u(1));
-drop table t1;
-set global innodb_file_per_table=0;
-set global innodb_file_format=Antelope;
-SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
-SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
-CREATE TABLE t1(
-c1 BIGINT(12) NOT NULL,
-PRIMARY KEY (c1)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-CREATE TABLE t2(
-c1 BIGINT(16) NOT NULL,
-c2 BIGINT(12) NOT NULL,
-c3 BIGINT(12) NOT NULL,
-PRIMARY KEY (c1)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
-FOREIGN KEY (c3) REFERENCES t1(c1);
-SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
-SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `c1` bigint(16) NOT NULL,
- `c2` bigint(12) NOT NULL,
- `c3` bigint(12) NOT NULL,
- PRIMARY KEY (`c1`),
- KEY `fk_t2_ca` (`c3`),
- CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`) REFERENCES `t1` (`c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-CREATE INDEX i_t2_c3_c2 ON t2(c3, c2);
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `c1` bigint(16) NOT NULL,
- `c2` bigint(12) NOT NULL,
- `c3` bigint(12) NOT NULL,
- PRIMARY KEY (`c1`),
- KEY `i_t2_c3_c2` (`c3`,`c2`),
- CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`) REFERENCES `t1` (`c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
-SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
-INSERT INTO t2 VALUES(0,0,0);
-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`) REFERENCES `t1` (`c1`))
-INSERT INTO t1 VALUES(0);
-INSERT INTO t2 VALUES(0,0,0);
-DROP TABLE t2;
-CREATE TABLE t2(
-c1 BIGINT(16) NOT NULL,
-c2 BIGINT(12) NOT NULL,
-c3 BIGINT(12) NOT NULL,
-PRIMARY KEY (c1,c2,c3)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
-FOREIGN KEY (c3) REFERENCES t1(c1);
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `c1` bigint(16) NOT NULL,
- `c2` bigint(12) NOT NULL,
- `c3` bigint(12) NOT NULL,
- PRIMARY KEY (`c1`,`c2`,`c3`),
- KEY `fk_t2_ca` (`c3`),
- CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`) REFERENCES `t1` (`c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-CREATE INDEX i_t2_c3_c2 ON t2(c3, c2);
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `c1` bigint(16) NOT NULL,
- `c2` bigint(12) NOT NULL,
- `c3` bigint(12) NOT NULL,
- PRIMARY KEY (`c1`,`c2`,`c3`),
- KEY `i_t2_c3_c2` (`c3`,`c2`),
- CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`) REFERENCES `t1` (`c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-INSERT INTO t2 VALUES(0,0,1);
-ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`) REFERENCES `t1` (`c1`))
-INSERT INTO t2 VALUES(0,0,0);
-DELETE FROM t1;
-ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`) REFERENCES `t1` (`c1`))
-DELETE FROM t2;
-DROP TABLE t2;
-DROP TABLE t1;
-CREATE TABLE t1(
-c1 BIGINT(12) NOT NULL,
-c2 INT(4) NOT NULL,
-PRIMARY KEY (c2,c1)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-CREATE TABLE t2(
-c1 BIGINT(16) NOT NULL,
-c2 BIGINT(12) NOT NULL,
-c3 BIGINT(12) NOT NULL,
-PRIMARY KEY (c1)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
-FOREIGN KEY (c3,c2) REFERENCES t1(c1,c1);
-ERROR HY000: Can't create table '#sql-temporary' (errno: 150)
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
-FOREIGN KEY (c3,c2) REFERENCES t1(c1,c2);
-ERROR HY000: Can't create table '#sql-temporary' (errno: 150)
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
-FOREIGN KEY (c3,c2) REFERENCES t1(c2,c1);
-ERROR HY000: Can't create table '#sql-temporary' (errno: 150)
-ALTER TABLE t1 MODIFY COLUMN c2 BIGINT(12) NOT NULL;
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
-FOREIGN KEY (c3,c2) REFERENCES t1(c1,c2);
-ERROR HY000: Can't create table '#sql-temporary' (errno: 150)
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
-FOREIGN KEY (c3,c2) REFERENCES t1(c2,c1);
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` bigint(12) NOT NULL,
- `c2` bigint(12) NOT NULL,
- PRIMARY KEY (`c2`,`c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `c1` bigint(16) NOT NULL,
- `c2` bigint(12) NOT NULL,
- `c3` bigint(12) NOT NULL,
- PRIMARY KEY (`c1`),
- KEY `fk_t2_ca` (`c3`,`c2`),
- CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`, `c2`) REFERENCES `t1` (`c2`, `c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-CREATE INDEX i_t2_c2_c1 ON t2(c2, c1);
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `c1` bigint(16) NOT NULL,
- `c2` bigint(12) NOT NULL,
- `c3` bigint(12) NOT NULL,
- PRIMARY KEY (`c1`),
- KEY `fk_t2_ca` (`c3`,`c2`),
- KEY `i_t2_c2_c1` (`c2`,`c1`),
- CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`, `c2`) REFERENCES `t1` (`c2`, `c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-CREATE INDEX i_t2_c3_c1_c2 ON t2(c3, c1, c2);
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `c1` bigint(16) NOT NULL,
- `c2` bigint(12) NOT NULL,
- `c3` bigint(12) NOT NULL,
- PRIMARY KEY (`c1`),
- KEY `fk_t2_ca` (`c3`,`c2`),
- KEY `i_t2_c2_c1` (`c2`,`c1`),
- KEY `i_t2_c3_c1_c2` (`c3`,`c1`,`c2`),
- CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`, `c2`) REFERENCES `t1` (`c2`, `c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-CREATE INDEX i_t2_c3_c2 ON t2(c3, c2);
-SHOW CREATE TABLE t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `c1` bigint(16) NOT NULL,
- `c2` bigint(12) NOT NULL,
- `c3` bigint(12) NOT NULL,
- PRIMARY KEY (`c1`),
- KEY `i_t2_c2_c1` (`c2`,`c1`),
- KEY `i_t2_c3_c1_c2` (`c3`,`c1`,`c2`),
- KEY `i_t2_c3_c2` (`c3`,`c2`),
- CONSTRAINT `fk_t2_ca` FOREIGN KEY (`c3`, `c2`) REFERENCES `t1` (`c2`, `c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-DROP TABLE t2;
-DROP TABLE t1;
-CREATE TABLE t1 (a INT, b CHAR(1)) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (3,'a'),(3,'b'),(1,'c'),(0,'d'),(1,'e');
-BEGIN;
-SELECT * FROM t1;
-a b
-3 a
-3 b
-1 c
-0 d
-1 e
-CREATE INDEX t1a ON t1(a);
-SELECT * FROM t1;
-a b
-3 a
-3 b
-1 c
-0 d
-1 e
-SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a;
-ERROR HY000: Table definition has changed, please retry transaction
-SELECT * FROM t1;
-a b
-3 a
-3 b
-1 c
-0 d
-1 e
-COMMIT;
-SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a;
-a b
-0 d
-1 c
-1 e
-3 a
-3 b
-DROP TABLE t1;
diff --git a/storage/innodb_plugin/mysql-test/innodb-index.test b/storage/innodb_plugin/mysql-test/innodb-index.test
deleted file mode 100644
index 42888ff3686..00000000000
--- a/storage/innodb_plugin/mysql-test/innodb-index.test
+++ /dev/null
@@ -1,534 +0,0 @@
--- source include/have_innodb.inc
-
-create table t1(a int not null, b int, c char(10) not null, d varchar(20)) engine = innodb;
-insert into t1 values (5,5,'oo','oo'),(4,4,'tr','tr'),(3,4,'ad','ad'),(2,3,'ak','ak');
-commit;
---error ER_DUP_KEYNAME
-alter table t1 add index b (b), add index b (b);
---error ER_DUP_FIELDNAME
-alter table t1 add index (b,b);
-alter table t1 add index d2 (d);
-show create table t1;
-explain select * from t1 force index(d2) order by d;
-select * from t1 force index (d2) order by d;
---error ER_DUP_ENTRY
-alter table t1 add unique index (b);
-show create table t1;
-alter table t1 add index (b);
-show create table t1;
-
-# Check how existing tables interfere with temporary tables.
-CREATE TABLE `t1#1`(a INT PRIMARY KEY) ENGINE=InnoDB;
-
---error 156
-alter table t1 add unique index (c), add index (d);
-rename table `t1#1` to `t1#2`;
---error 156
-alter table t1 add unique index (c), add index (d);
-drop table `t1#2`;
-
-alter table t1 add unique index (c), add index (d);
-show create table t1;
-explain select * from t1 force index(c) order by c;
-alter table t1 add primary key (a), drop index c;
-show create table t1;
---error ER_MULTIPLE_PRI_KEY
-alter table t1 add primary key (c);
---error ER_DUP_ENTRY
-alter table t1 drop primary key, add primary key (b);
-create unique index c on t1 (c);
-show create table t1;
-explain select * from t1 force index(c) order by c;
-select * from t1 force index(c) order by c;
-alter table t1 drop index b, add index (b);
-show create table t1;
-insert into t1 values(6,1,'ggg','ggg');
-select * from t1;
-select * from t1 force index(b) order by b;
-select * from t1 force index(c) order by c;
-select * from t1 force index(d) order by d;
-explain select * from t1 force index(b) order by b;
-explain select * from t1 force index(c) order by c;
-explain select * from t1 force index(d) order by d;
-show create table t1;
-drop table t1;
-
-create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb;
-insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,3,'ad','ad'),(4,4,'afe','afe');
-commit;
-alter table t1 add index (c(2));
-show create table t1;
-alter table t1 add unique index (d(10));
-show create table t1;
-insert into t1 values(5,1,'ggg','ggg');
-select * from t1;
-select * from t1 force index(c) order by c;
-select * from t1 force index(d) order by d;
-explain select * from t1 order by b;
-explain select * from t1 force index(c) order by c;
-explain select * from t1 force index(d) order by d;
-show create table t1;
-alter table t1 drop index d;
-insert into t1 values(8,9,'fff','fff');
-select * from t1;
-select * from t1 force index(c) order by c;
-explain select * from t1 order by b;
-explain select * from t1 force index(c) order by c;
-explain select * from t1 order by d;
-show create table t1;
-drop table t1;
-
-create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb;
-insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,2,'ad','ad'),(4,4,'afe','afe');
-commit;
-alter table t1 add unique index (b,c);
-insert into t1 values(8,9,'fff','fff');
-select * from t1;
-select * from t1 force index(b) order by b;
-explain select * from t1 force index(b) order by b;
-show create table t1;
-alter table t1 add index (b,c);
-insert into t1 values(11,11,'kkk','kkk');
-select * from t1;
-select * from t1 force index(b) order by b;
-explain select * from t1 force index(b) order by b;
-show create table t1;
-alter table t1 add unique index (c,d);
-insert into t1 values(13,13,'yyy','aaa');
-select * from t1;
-select * from t1 force index(b) order by b;
-select * from t1 force index(c) order by c;
-explain select * from t1 force index(b) order by b;
-explain select * from t1 force index(c) order by c;
-show create table t1;
-drop table t1;
-
-create table t1(a int not null, b int not null, c int, primary key (a), key (b)) engine = innodb;
-create table t3(a int not null, c int not null, d int, primary key (a), key (c)) engine = innodb;
-create table t4(a int not null, d int not null, e int, primary key (a), key (d)) engine = innodb;
-create table t2(a int not null, b int not null, c int not null, d int not null, e int,
-foreign key (b) references t1(b) on delete cascade,
-foreign key (c) references t3(c), foreign key (d) references t4(d))
-engine = innodb;
---error ER_DROP_INDEX_FK
-alter table t1 drop index b;
---error ER_DROP_INDEX_FK
-alter table t3 drop index c;
---error ER_DROP_INDEX_FK
-alter table t4 drop index d;
---error ER_DROP_INDEX_FK
-alter table t2 drop index b;
---error ER_DROP_INDEX_FK
-alter table t2 drop index b, drop index c, drop index d;
-# Apparently, the following makes mysql_alter_table() drop index d.
-create unique index dc on t2 (d,c);
-create index dc on t1 (b,c);
-# This should preserve the foreign key constraints.
-alter table t2 add primary key (a);
-insert into t1 values (1,1,1);
-insert into t3 values (1,1,1);
-insert into t4 values (1,1,1);
-insert into t2 values (1,1,1,1,1);
-commit;
-alter table t4 add constraint dc foreign key (a) references t1(a);
-show create table t4;
---replace_regex /'test\.#sql-[0-9a-f_]*'/'#sql-temporary'/
-# a foreign key 'test/dc' already exists
---error ER_CANT_CREATE_TABLE
-alter table t3 add constraint dc foreign key (a) references t1(a);
-show create table t3;
-alter table t2 drop index b, add index (b);
-show create table t2;
---error ER_ROW_IS_REFERENCED_2
-delete from t1;
---error ER_CANT_DROP_FIELD_OR_KEY
-drop index dc on t4;
-# there is no foreign key dc on t3
---replace_regex /'\.\/test\/#sql2-[0-9a-f-]*'/'#sql2-temporary'/
---error ER_ERROR_ON_RENAME
-alter table t3 drop foreign key dc;
-alter table t4 drop foreign key dc;
-select * from t2;
-delete from t1;
-select * from t2;
-
-drop table t2,t4,t3,t1;
-
--- let charset = utf8
--- source include/innodb-index.inc
-
-create table t1(a int not null, b int) engine = innodb;
-insert into t1 values (1,1),(1,1),(1,1),(1,1);
---error ER_DUP_ENTRY
-alter table t1 add unique index (a);
---error ER_DUP_ENTRY
-alter table t1 add unique index (b);
---error ER_DUP_ENTRY
-alter table t1 add unique index (a), add unique index(b);
-show create table t1;
-drop table t1;
-
-create table t1(a int not null, c int not null,b int, primary key(a), unique key(c), key(b)) engine = innodb;
-alter table t1 drop index c, drop index b;
-show create table t1;
-drop table t1;
-
-create table t1(a int not null, b int, primary key(a)) engine = innodb;
-alter table t1 add index (b);
-show create table t1;
-drop table t1;
-
-create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb;
-insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,3,'ac','ac'),(4,4,'afe','afe'),(5,4,'affe','affe');
---error ER_DUP_ENTRY
-alter table t1 add unique index (b), add unique index (c), add unique index (d);
---error ER_DUP_ENTRY
-alter table t1 add unique index (c), add unique index (b), add index (d);
-show create table t1;
-drop table t1;
-
-create table t1(a int not null, b int not null, c int, primary key (a), key(c)) engine=innodb;
-insert into t1 values (5,1,5),(4,2,4),(3,3,3),(2,4,2),(1,5,1);
-alter table t1 add unique index (b);
-insert into t1 values (10,20,20),(11,19,19),(12,18,18),(13,17,17);
-show create table t1;
-check table t1;
-explain select * from t1 force index(c) order by c;
-explain select * from t1 order by a;
-explain select * from t1 force index(b) order by b;
-select * from t1 order by a;
-select * from t1 force index(b) order by b;
-select * from t1 force index(c) order by c;
-drop table t1;
-
-create table t1(a int not null, b int not null) engine=innodb;
-insert into t1 values (1,1);
-alter table t1 add primary key(b);
-insert into t1 values (2,2);
-show create table t1;
-check table t1;
-select * from t1;
-explain select * from t1;
-explain select * from t1 order by a;
-explain select * from t1 order by b;
-checksum table t1;
-drop table t1;
-
-create table t1(a int not null) engine=innodb;
-insert into t1 values (1);
-alter table t1 add primary key(a);
-insert into t1 values (2);
-show create table t1;
-check table t1;
-commit;
-select * from t1;
-explain select * from t1;
-explain select * from t1 order by a;
-drop table t1;
-
-create table t2(d varchar(17) primary key) engine=innodb default charset=utf8;
-create table t3(a int primary key) engine=innodb;
-
-insert into t3 values(22),(44),(33),(55),(66);
-
-insert into t2 values ('jejdkrun87'),('adfd72nh9k'),
-('adfdpplkeock'),('adfdijnmnb78k'),('adfdijn0loKNHJik');
-
-create table t1(a int, b blob, c text, d text not null)
-engine=innodb default charset = utf8;
-
-# r2667 The following test is disabled because MySQL behavior changed.
-# r2667 The test was added with this comment:
-# r2667
-# r2667 ------------------------------------------------------------------------
-# r2667 r1699 | marko | 2007-08-10 19:53:19 +0300 (Fri, 10 Aug 2007) | 5 lines
-# r2667
-# r2667 branches/zip: Add changes that accidentally omitted from r1698:
-# r2667
-# r2667 innodb-index.test, innodb-index.result: Add a test for creating
-# r2667 a PRIMARY KEY on a column that contains a NULL value.
-# r2667 ------------------------------------------------------------------------
-# r2667
-# r2667 but in BZR-r2667:
-# r2667 http://bazaar.launchpad.net/~mysql/mysql-server/mysql-5.1/revision/davi%40mysql.com-20080617141221-8yre8ys9j4uw3xx5?start_revid=joerg%40mysql.com-20080630105418-7qoe5ehomgrcdb89
-# r2667 MySQL changed the behavior to do full table copy when creating PRIMARY INDEX
-# r2667 on a non-NULL column instead of calling ::add_index() which would fail (and
-# r2667 this is what we were testing here). Before r2667 the code execution path was
-# r2667 like this (when adding PRIMARY INDEX on a non-NULL column with ALTER TABLE):
-# r2667
-# r2667 mysql_alter_table()
-# r2667 compare_tables() // would return ALTER_TABLE_INDEX_CHANGED
-# r2667 ::add_index() // would fail with "primary index cannot contain NULL"
-# r2667
-# r2667 after r2667 the code execution path is the following:
-# r2667
-# r2667 mysql_alter_table()
-# r2667 compare_tables() // returns ALTER_TABLE_DATA_CHANGED
-# r2667 full copy is done, without calling ::add_index()
-# r2667
-# r2667 To enable, remove "# r2667: " below.
-# r2667
-# r2667: insert into t1 values (null,null,null,'null');
-insert into t1
-select a,left(repeat(d,100*a),65535),repeat(d,20*a),d from t2,t3;
-drop table t2, t3;
-select count(*) from t1 where a=44;
-select a,
-length(b),b=left(repeat(d,100*a),65535),length(c),c=repeat(d,20*a),d from t1;
-# r2667: --error ER_PRIMARY_CANT_HAVE_NULL
-# r2667: alter table t1 add primary key (a), add key (b(20));
-# r2667: delete from t1 where d='null';
---error ER_DUP_ENTRY
-alter table t1 add primary key (a), add key (b(20));
-delete from t1 where a%2;
-check table t1;
-alter table t1 add primary key (a,b(255),c(255)), add key (b(767));
-select count(*) from t1 where a=44;
-select a,
-length(b),b=left(repeat(d,100*a),65535),length(c),c=repeat(d,20*a),d from t1;
-show create table t1;
-check table t1;
-explain select * from t1 where b like 'adfd%';
-
-#
-# Test locking
-#
-
-create table t2(a int, b varchar(255), primary key(a,b)) engine=innodb;
-insert into t2 select a,left(b,255) from t1;
-drop table t1;
-rename table t2 to t1;
-
-connect (a,localhost,root,,);
-connect (b,localhost,root,,);
-connection a;
-set innodb_lock_wait_timeout=1;
-begin;
-# Obtain an IX lock on the table
-select a from t1 limit 1 for update;
-connection b;
-set innodb_lock_wait_timeout=1;
-# This would require an S lock on the table, conflicting with the IX lock.
---error ER_LOCK_WAIT_TIMEOUT
-create index t1ba on t1 (b,a);
-connection a;
-commit;
-begin;
-# Obtain an IS lock on the table
-select a from t1 limit 1 lock in share mode;
-connection b;
-# This will require an S lock on the table. No conflict with the IS lock.
-create index t1ba on t1 (b,a);
-# This would require an X lock on the table, conflicting with the IS lock.
---error ER_LOCK_WAIT_TIMEOUT
-drop index t1ba on t1;
-connection a;
-commit;
-explain select a from t1 order by b;
---send
-select a,sleep(2+a/100) from t1 order by b limit 3;
-
-# The following DROP INDEX will succeed, altough the SELECT above has
-# opened a read view. However, during the execution of the SELECT,
-# MySQL should hold a table lock that should block the execution
-# of the DROP INDEX below.
-
-connection b;
-select sleep(1);
-drop index t1ba on t1;
-
-# After the index was dropped, subsequent SELECTs will use the same
-# read view, but they should not be accessing the dropped index any more.
-
-connection a;
-reap;
-explain select a from t1 order by b;
-select a from t1 order by b limit 3;
-commit;
-
-connection default;
-disconnect a;
-disconnect b;
-
-drop table t1;
-
-let $per_table=`select @@innodb_file_per_table`;
-let $format=`select @@innodb_file_format`;
-set global innodb_file_per_table=on;
-set global innodb_file_format='Barracuda';
-# Test creating a table that could lead to undo log overflow.
-# In the undo log, we write a 768-byte prefix (REC_MAX_INDEX_COL_LEN)
-# of each externally stored column that appears as a column prefix in an index.
-# For this test case, it would suffice to write 1 byte, though.
-create table t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
- i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob,
- q blob,r blob,s blob,t blob,u blob)
- engine=innodb row_format=dynamic;
-create index t1a on t1 (a(1));
-create index t1b on t1 (b(1));
-create index t1c on t1 (c(1));
-create index t1d on t1 (d(1));
-create index t1e on t1 (e(1));
-create index t1f on t1 (f(1));
-create index t1g on t1 (g(1));
-create index t1h on t1 (h(1));
-create index t1i on t1 (i(1));
-create index t1j on t1 (j(1));
-create index t1k on t1 (k(1));
-create index t1l on t1 (l(1));
-create index t1m on t1 (m(1));
-create index t1n on t1 (n(1));
-create index t1o on t1 (o(1));
-create index t1p on t1 (p(1));
-create index t1q on t1 (q(1));
-create index t1r on t1 (r(1));
-create index t1s on t1 (s(1));
-create index t1t on t1 (t(1));
---error 139
-create index t1u on t1 (u(1));
---error 139
-create index t1ut on t1 (u(1), t(1));
-create index t1st on t1 (s(1), t(1));
-show create table t1;
---error 139
-create index t1u on t1 (u(1));
-alter table t1 row_format=compact;
-create index t1u on t1 (u(1));
-
-drop table t1;
-eval set global innodb_file_per_table=$per_table;
-eval set global innodb_file_format=$format;
-
-#
-# Test to check whether CREATE INDEX handles implicit foreign key
-# constraint modifications (Issue #70, Bug #38786)
-#
-SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
-SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
-
-CREATE TABLE t1(
- c1 BIGINT(12) NOT NULL,
- PRIMARY KEY (c1)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-
-CREATE TABLE t2(
- c1 BIGINT(16) NOT NULL,
- c2 BIGINT(12) NOT NULL,
- c3 BIGINT(12) NOT NULL,
- PRIMARY KEY (c1)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
- FOREIGN KEY (c3) REFERENCES t1(c1);
-
-SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
-SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
-
-SHOW CREATE TABLE t2;
-
-CREATE INDEX i_t2_c3_c2 ON t2(c3, c2);
-
-SHOW CREATE TABLE t2;
-
-SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
-SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
-
---error ER_NO_REFERENCED_ROW_2
-INSERT INTO t2 VALUES(0,0,0);
-INSERT INTO t1 VALUES(0);
-INSERT INTO t2 VALUES(0,0,0);
-
-DROP TABLE t2;
-
-CREATE TABLE t2(
- c1 BIGINT(16) NOT NULL,
- c2 BIGINT(12) NOT NULL,
- c3 BIGINT(12) NOT NULL,
- PRIMARY KEY (c1,c2,c3)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
- FOREIGN KEY (c3) REFERENCES t1(c1);
-
-SHOW CREATE TABLE t2;
-
-CREATE INDEX i_t2_c3_c2 ON t2(c3, c2);
-
-SHOW CREATE TABLE t2;
---error ER_NO_REFERENCED_ROW_2
-INSERT INTO t2 VALUES(0,0,1);
-INSERT INTO t2 VALUES(0,0,0);
---error ER_ROW_IS_REFERENCED_2
-DELETE FROM t1;
-DELETE FROM t2;
-
-DROP TABLE t2;
-DROP TABLE t1;
-
-CREATE TABLE t1(
- c1 BIGINT(12) NOT NULL,
- c2 INT(4) NOT NULL,
- PRIMARY KEY (c2,c1)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-
-CREATE TABLE t2(
- c1 BIGINT(16) NOT NULL,
- c2 BIGINT(12) NOT NULL,
- c3 BIGINT(12) NOT NULL,
- PRIMARY KEY (c1)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-
---replace_regex /'test\.#sql-[0-9_a-f-]*'/'#sql-temporary'/
---error ER_CANT_CREATE_TABLE
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
- FOREIGN KEY (c3,c2) REFERENCES t1(c1,c1);
---replace_regex /'test\.#sql-[0-9_a-f-]*'/'#sql-temporary'/
---error ER_CANT_CREATE_TABLE
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
- FOREIGN KEY (c3,c2) REFERENCES t1(c1,c2);
---replace_regex /'test\.#sql-[0-9_a-f-]*'/'#sql-temporary'/
---error ER_CANT_CREATE_TABLE
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
- FOREIGN KEY (c3,c2) REFERENCES t1(c2,c1);
-ALTER TABLE t1 MODIFY COLUMN c2 BIGINT(12) NOT NULL;
---replace_regex /'test\.#sql-[0-9_a-f-]*'/'#sql-temporary'/
---error ER_CANT_CREATE_TABLE
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
- FOREIGN KEY (c3,c2) REFERENCES t1(c1,c2);
-
-ALTER TABLE t2 ADD CONSTRAINT fk_t2_ca
- FOREIGN KEY (c3,c2) REFERENCES t1(c2,c1);
-SHOW CREATE TABLE t1;
-SHOW CREATE TABLE t2;
-CREATE INDEX i_t2_c2_c1 ON t2(c2, c1);
-SHOW CREATE TABLE t2;
-CREATE INDEX i_t2_c3_c1_c2 ON t2(c3, c1, c2);
-SHOW CREATE TABLE t2;
-CREATE INDEX i_t2_c3_c2 ON t2(c3, c2);
-SHOW CREATE TABLE t2;
-
-DROP TABLE t2;
-DROP TABLE t1;
-
-connect (a,localhost,root,,);
-connect (b,localhost,root,,);
-connection a;
-CREATE TABLE t1 (a INT, b CHAR(1)) ENGINE=InnoDB;
-INSERT INTO t1 VALUES (3,'a'),(3,'b'),(1,'c'),(0,'d'),(1,'e');
-connection b;
-BEGIN;
-SELECT * FROM t1;
-connection a;
-CREATE INDEX t1a ON t1(a);
-connection b;
-SELECT * FROM t1;
---error ER_TABLE_DEF_CHANGED
-SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a;
-SELECT * FROM t1;
-COMMIT;
-SELECT * FROM t1 FORCE INDEX(t1a) ORDER BY a;
-connection default;
-disconnect a;
-disconnect b;
-
-DROP TABLE t1;
diff --git a/storage/innodb_plugin/mysql-test/innodb-index_ucs2.result b/storage/innodb_plugin/mysql-test/innodb-index_ucs2.result
deleted file mode 100644
index c8a1e8c7da1..00000000000
--- a/storage/innodb_plugin/mysql-test/innodb-index_ucs2.result
+++ /dev/null
@@ -1,116 +0,0 @@
-create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb default charset=ucs2;
-insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,2,'ad','ad'),(4,4,'afe','afe');
-commit;
-alter table t1 add unique index (b);
-ERROR 23000: Duplicate entry '2' for key 'b'
-insert into t1 values(8,9,'fff','fff');
-select * from t1;
-a b c d
-1 1 ab ab
-2 2 ac ac
-3 2 ad ad
-4 4 afe afe
-8 9 fff fff
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- `c` char(10) DEFAULT NULL,
- `d` varchar(20) DEFAULT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=InnoDB DEFAULT CHARSET=ucs2
-alter table t1 add index (b);
-insert into t1 values(10,10,'kkk','iii');
-select * from t1;
-a b c d
-1 1 ab ab
-2 2 ac ac
-3 2 ad ad
-4 4 afe afe
-8 9 fff fff
-10 10 kkk iii
-select * from t1 force index(b) order by b;
-a b c d
-1 1 ab ab
-2 2 ac ac
-3 2 ad ad
-4 4 afe afe
-8 9 fff fff
-10 10 kkk iii
-explain select * from t1 force index(b) order by b;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL b 5 NULL 6
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- `c` char(10) DEFAULT NULL,
- `d` varchar(20) DEFAULT NULL,
- PRIMARY KEY (`a`),
- KEY `b` (`b`)
-) ENGINE=InnoDB DEFAULT CHARSET=ucs2
-alter table t1 add unique index (c), add index (d);
-insert into t1 values(11,11,'aaa','mmm');
-select * from t1;
-a b c d
-1 1 ab ab
-2 2 ac ac
-3 2 ad ad
-4 4 afe afe
-8 9 fff fff
-10 10 kkk iii
-11 11 aaa mmm
-select * from t1 force index(b) order by b;
-a b c d
-1 1 ab ab
-2 2 ac ac
-3 2 ad ad
-4 4 afe afe
-8 9 fff fff
-10 10 kkk iii
-11 11 aaa mmm
-select * from t1 force index(c) order by c;
-a b c d
-11 11 aaa mmm
-1 1 ab ab
-2 2 ac ac
-3 2 ad ad
-4 4 afe afe
-8 9 fff fff
-10 10 kkk iii
-select * from t1 force index(d) order by d;
-a b c d
-1 1 ab ab
-2 2 ac ac
-3 2 ad ad
-4 4 afe afe
-8 9 fff fff
-10 10 kkk iii
-11 11 aaa mmm
-explain select * from t1 force index(b) order by b;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL b 5 NULL 7
-explain select * from t1 force index(c) order by c;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL c 21 NULL 7
-explain select * from t1 force index(d) order by d;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL d 43 NULL 7
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
- `c` char(10) DEFAULT NULL,
- `d` varchar(20) DEFAULT NULL,
- PRIMARY KEY (`a`),
- UNIQUE KEY `c` (`c`),
- KEY `b` (`b`),
- KEY `d` (`d`)
-) ENGINE=InnoDB DEFAULT CHARSET=ucs2
-check table t1;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-drop table t1;
diff --git a/storage/innodb_plugin/mysql-test/innodb-index_ucs2.test b/storage/innodb_plugin/mysql-test/innodb-index_ucs2.test
deleted file mode 100644
index fff9a4da1a8..00000000000
--- a/storage/innodb_plugin/mysql-test/innodb-index_ucs2.test
+++ /dev/null
@@ -1,5 +0,0 @@
--- source include/have_innodb.inc
--- source include/have_ucs2.inc
-
--- let charset = ucs2
--- source include/innodb-index.inc
diff --git a/storage/innodb_plugin/mysql-test/innodb-timeout.result b/storage/innodb_plugin/mysql-test/innodb-timeout.result
deleted file mode 100644
index be9a688cd72..00000000000
--- a/storage/innodb_plugin/mysql-test/innodb-timeout.result
+++ /dev/null
@@ -1,38 +0,0 @@
-set global innodb_lock_wait_timeout=42;
-select @@innodb_lock_wait_timeout;
-@@innodb_lock_wait_timeout
-42
-set innodb_lock_wait_timeout=1;
-select @@innodb_lock_wait_timeout;
-@@innodb_lock_wait_timeout
-1
-select @@innodb_lock_wait_timeout;
-@@innodb_lock_wait_timeout
-42
-set global innodb_lock_wait_timeout=347;
-select @@innodb_lock_wait_timeout;
-@@innodb_lock_wait_timeout
-42
-set innodb_lock_wait_timeout=1;
-select @@innodb_lock_wait_timeout;
-@@innodb_lock_wait_timeout
-1
-select @@innodb_lock_wait_timeout;
-@@innodb_lock_wait_timeout
-347
-create table t1(a int primary key)engine=innodb;
-begin;
-insert into t1 values(1),(2),(3);
-select * from t1 for update;
-commit;
-a
-1
-2
-3
-begin;
-insert into t1 values(4);
-select * from t1 for update;
-commit;
-ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-drop table t1;
-set global innodb_lock_wait_timeout=50;
diff --git a/storage/innodb_plugin/mysql-test/innodb-use-sys-malloc.result b/storage/innodb_plugin/mysql-test/innodb-use-sys-malloc.result
deleted file mode 100644
index 2ec4c7c8130..00000000000
--- a/storage/innodb_plugin/mysql-test/innodb-use-sys-malloc.result
+++ /dev/null
@@ -1,48 +0,0 @@
-SELECT @@GLOBAL.innodb_use_sys_malloc;
-@@GLOBAL.innodb_use_sys_malloc
-1
-1 Expected
-SET @@GLOBAL.innodb_use_sys_malloc=0;
-ERROR HY000: Variable 'innodb_use_sys_malloc' is a read only variable
-Expected error 'Read only variable'
-SELECT @@GLOBAL.innodb_use_sys_malloc;
-@@GLOBAL.innodb_use_sys_malloc
-1
-1 Expected
-drop table if exists t1;
-create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
-insert into t1 values (1),(2),(3),(4),(5),(6),(7);
-select * from t1;
-a
-1
-2
-3
-4
-5
-6
-7
-drop table t1;
-SELECT @@GLOBAL.innodb_use_sys_malloc;
-@@GLOBAL.innodb_use_sys_malloc
-1
-1 Expected
-SET @@GLOBAL.innodb_use_sys_malloc=0;
-ERROR HY000: Variable 'innodb_use_sys_malloc' is a read only variable
-Expected error 'Read only variable'
-SELECT @@GLOBAL.innodb_use_sys_malloc;
-@@GLOBAL.innodb_use_sys_malloc
-1
-1 Expected
-drop table if exists t1;
-create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
-insert into t1 values (1),(2),(3),(4),(5),(6),(7);
-select * from t1;
-a
-1
-2
-3
-4
-5
-6
-7
-drop table t1;
diff --git a/storage/innodb_plugin/mysql-test/innodb-zip.result b/storage/innodb_plugin/mysql-test/innodb-zip.result
deleted file mode 100644
index b26c4112826..00000000000
--- a/storage/innodb_plugin/mysql-test/innodb-zip.result
+++ /dev/null
@@ -1,421 +0,0 @@
-set global innodb_file_per_table=off;
-set global innodb_file_format=`0`;
-create table t0(a int primary key) engine=innodb row_format=compressed;
-Warnings:
-Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
-Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
-create table t00(a int primary key) engine=innodb
-key_block_size=4 row_format=compressed;
-Warnings:
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4.
-Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
-Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
-create table t1(a int primary key) engine=innodb row_format=dynamic;
-Warnings:
-Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
-Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
-create table t2(a int primary key) engine=innodb row_format=redundant;
-create table t3(a int primary key) engine=innodb row_format=compact;
-create table t4(a int primary key) engine=innodb key_block_size=9;
-Warnings:
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=9.
-create table t5(a int primary key) engine=innodb
-key_block_size=1 row_format=redundant;
-Warnings:
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1.
-set global innodb_file_per_table=on;
-create table t6(a int primary key) engine=innodb
-key_block_size=1 row_format=redundant;
-Warnings:
-Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1.
-set global innodb_file_format=`1`;
-create table t7(a int primary key) engine=innodb
-key_block_size=1 row_format=redundant;
-Warnings:
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
-create table t8(a int primary key) engine=innodb
-key_block_size=1 row_format=fixed;
-Warnings:
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
-Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
-create table t9(a int primary key) engine=innodb
-key_block_size=1 row_format=compact;
-Warnings:
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
-create table t10(a int primary key) engine=innodb
-key_block_size=1 row_format=dynamic;
-Warnings:
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED.
-create table t11(a int primary key) engine=innodb
-key_block_size=1 row_format=compressed;
-create table t12(a int primary key) engine=innodb
-key_block_size=1;
-create table t13(a int primary key) engine=innodb
-row_format=compressed;
-create table t14(a int primary key) engine=innodb key_block_size=9;
-Warnings:
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=9.
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t0 Compact
-test t00 Compact
-test t1 Compact
-test t10 Dynamic
-test t11 Compressed
-test t12 Compressed
-test t13 Compressed
-test t14 Compact
-test t2 Redundant
-test t3 Compact
-test t4 Compact
-test t5 Redundant
-test t6 Redundant
-test t7 Redundant
-test t8 Compact
-test t9 Compact
-drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14;
-alter table t1 key_block_size=0;
-Warnings:
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=0.
-alter table t1 row_format=dynamic;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t1 Dynamic
-alter table t1 row_format=compact;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t1 Compact
-alter table t1 row_format=redundant;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t1 Redundant
-drop table t1;
-create table t1(a int not null, b text, index(b(10))) engine=innodb
-key_block_size=1;
-create table t2(b text)engine=innodb;
-insert into t2 values(concat('1abcdefghijklmnopqrstuvwxyz', repeat('A',5000)));
-insert into t1 select 1, b from t2;
-commit;
-begin;
-update t1 set b=repeat('B',100);
-select a,left(b,40) from t1 natural join t2;
-a left(b,40)
-1 1abcdefghijklmnopqrstuvwxyzAAAAAAAAAAAAA
-rollback;
-select a,left(b,40) from t1 natural join t2;
-a left(b,40)
-1 1abcdefghijklmnopqrstuvwxyzAAAAAAAAAAAAA
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t1 Compressed
-test t2 Compact
-drop table t1,t2;
-SET SESSION innodb_strict_mode = off;
-CREATE TABLE t1(
-c TEXT NOT NULL, d TEXT NOT NULL,
-PRIMARY KEY (c(767),d(767)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
-ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
-CREATE TABLE t1(
-c TEXT NOT NULL, d TEXT NOT NULL,
-PRIMARY KEY (c(767),d(767)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=ASCII;
-ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
-CREATE TABLE t1(
-c TEXT NOT NULL, d TEXT NOT NULL,
-PRIMARY KEY (c(767),d(767)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 CHARSET=ASCII;
-drop table t1;
-CREATE TABLE t1(c TEXT, PRIMARY KEY (c(440)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
-ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs
-CREATE TABLE t1(c TEXT, PRIMARY KEY (c(438)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
-INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
-DROP TABLE t1;
-create table t1( c1 int not null, c2 blob, c3 blob, c4 blob,
-primary key(c1, c2(22), c3(22)))
-engine = innodb row_format = dynamic;
-begin;
-insert into t1 values(1, repeat('A', 20000), repeat('B', 20000),
-repeat('C', 20000));
-update t1 set c3 = repeat('D', 20000) where c1 = 1;
-commit;
-select count(*) from t1 where c2 = repeat('A', 20000);
-count(*)
-1
-select count(*) from t1 where c3 = repeat('D', 20000);
-count(*)
-1
-select count(*) from t1 where c4 = repeat('C', 20000);
-count(*)
-1
-update t1 set c3 = repeat('E', 20000) where c1 = 1;
-drop table t1;
-set global innodb_file_format=`0`;
-select @@innodb_file_format;
-@@innodb_file_format
-Antelope
-set global innodb_file_format=`1`;
-select @@innodb_file_format;
-@@innodb_file_format
-Barracuda
-set global innodb_file_format=`2`;
-ERROR HY000: Incorrect arguments to SET
-set global innodb_file_format=`-1`;
-ERROR HY000: Incorrect arguments to SET
-set global innodb_file_format=`Antelope`;
-set global innodb_file_format=`Barracuda`;
-set global innodb_file_format=`Cheetah`;
-ERROR HY000: Incorrect arguments to SET
-set global innodb_file_format=`abc`;
-ERROR HY000: Incorrect arguments to SET
-set global innodb_file_format=`1a`;
-ERROR HY000: Incorrect arguments to SET
-set global innodb_file_format=``;
-ERROR HY000: Incorrect arguments to SET
-set global innodb_file_per_table = on;
-set global innodb_file_format = `1`;
-set innodb_strict_mode = off;
-create table t1 (id int primary key) engine = innodb key_block_size = 0;
-Warnings:
-Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=0.
-drop table t1;
-set innodb_strict_mode = on;
-create table t1 (id int primary key) engine = innodb key_block_size = 0;
-ERROR HY000: Can't create table 'test.t1' (errno: 1478)
-show errors;
-Level Code Message
-Error 1478 InnoDB: invalid KEY_BLOCK_SIZE = 0. Valid values are [1, 2, 4, 8, 16]
-Error 1005 Can't create table 'test.t1' (errno: 1478)
-create table t2 (id int primary key) engine = innodb key_block_size = 9;
-ERROR HY000: Can't create table 'test.t2' (errno: 1478)
-show errors;
-Level Code Message
-Error 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
-Error 1005 Can't create table 'test.t2' (errno: 1478)
-create table t3 (id int primary key) engine = innodb key_block_size = 1;
-create table t4 (id int primary key) engine = innodb key_block_size = 2;
-create table t5 (id int primary key) engine = innodb key_block_size = 4;
-create table t6 (id int primary key) engine = innodb key_block_size = 8;
-create table t7 (id int primary key) engine = innodb key_block_size = 16;
-create table t8 (id int primary key) engine = innodb row_format = compressed;
-create table t9 (id int primary key) engine = innodb row_format = dynamic;
-create table t10(id int primary key) engine = innodb row_format = compact;
-create table t11(id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t10 Compact
-test t11 Redundant
-test t3 Compressed
-test t4 Compressed
-test t5 Compressed
-test t6 Compressed
-test t7 Compressed
-test t8 Compressed
-test t9 Dynamic
-drop table t3, t4, t5, t6, t7, t8, t9, t10, t11;
-create table t1 (id int primary key) engine = innodb
-key_block_size = 8 row_format = compressed;
-create table t2 (id int primary key) engine = innodb
-key_block_size = 8 row_format = redundant;
-ERROR HY000: Can't create table 'test.t2' (errno: 1478)
-show errors;
-Level Code Message
-Error 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
-Error 1005 Can't create table 'test.t2' (errno: 1478)
-create table t3 (id int primary key) engine = innodb
-key_block_size = 8 row_format = compact;
-ERROR HY000: Can't create table 'test.t3' (errno: 1478)
-show errors;
-Level Code Message
-Error 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
-Error 1005 Can't create table 'test.t3' (errno: 1478)
-create table t4 (id int primary key) engine = innodb
-key_block_size = 8 row_format = dynamic;
-ERROR HY000: Can't create table 'test.t4' (errno: 1478)
-show errors;
-Level Code Message
-Error 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
-Error 1005 Can't create table 'test.t4' (errno: 1478)
-create table t5 (id int primary key) engine = innodb
-key_block_size = 8 row_format = default;
-ERROR HY000: Can't create table 'test.t5' (errno: 1478)
-show errors;
-Level Code Message
-Error 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
-Error 1005 Can't create table 'test.t5' (errno: 1478)
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t1 Compressed
-drop table t1;
-create table t1 (id int primary key) engine = innodb
-key_block_size = 9 row_format = redundant;
-ERROR HY000: Can't create table 'test.t1' (errno: 1478)
-show errors;
-Level Code Message
-Error 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
-Error 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE.
-Error 1005 Can't create table 'test.t1' (errno: 1478)
-create table t2 (id int primary key) engine = innodb
-key_block_size = 9 row_format = compact;
-ERROR HY000: Can't create table 'test.t2' (errno: 1478)
-show errors;
-Level Code Message
-Error 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
-Error 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE.
-Error 1005 Can't create table 'test.t2' (errno: 1478)
-create table t2 (id int primary key) engine = innodb
-key_block_size = 9 row_format = dynamic;
-ERROR HY000: Can't create table 'test.t2' (errno: 1478)
-show errors;
-Level Code Message
-Error 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16]
-Error 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE.
-Error 1005 Can't create table 'test.t2' (errno: 1478)
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-set global innodb_file_per_table = off;
-create table t1 (id int primary key) engine = innodb key_block_size = 1;
-ERROR HY000: Can't create table 'test.t1' (errno: 1478)
-show errors;
-Level Code Message
-Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Error 1005 Can't create table 'test.t1' (errno: 1478)
-create table t2 (id int primary key) engine = innodb key_block_size = 2;
-ERROR HY000: Can't create table 'test.t2' (errno: 1478)
-show errors;
-Level Code Message
-Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Error 1005 Can't create table 'test.t2' (errno: 1478)
-create table t3 (id int primary key) engine = innodb key_block_size = 4;
-ERROR HY000: Can't create table 'test.t3' (errno: 1478)
-show errors;
-Level Code Message
-Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Error 1005 Can't create table 'test.t3' (errno: 1478)
-create table t4 (id int primary key) engine = innodb key_block_size = 8;
-ERROR HY000: Can't create table 'test.t4' (errno: 1478)
-show errors;
-Level Code Message
-Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Error 1005 Can't create table 'test.t4' (errno: 1478)
-create table t5 (id int primary key) engine = innodb key_block_size = 16;
-ERROR HY000: Can't create table 'test.t5' (errno: 1478)
-show errors;
-Level Code Message
-Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
-Error 1005 Can't create table 'test.t5' (errno: 1478)
-create table t6 (id int primary key) engine = innodb row_format = compressed;
-ERROR HY000: Can't create table 'test.t6' (errno: 1478)
-show errors;
-Level Code Message
-Error 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
-Error 1005 Can't create table 'test.t6' (errno: 1478)
-create table t7 (id int primary key) engine = innodb row_format = dynamic;
-ERROR HY000: Can't create table 'test.t7' (errno: 1478)
-show errors;
-Level Code Message
-Error 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_per_table.
-Error 1005 Can't create table 'test.t7' (errno: 1478)
-create table t8 (id int primary key) engine = innodb row_format = compact;
-create table t9 (id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t8 Compact
-test t9 Redundant
-drop table t8, t9;
-set global innodb_file_per_table = on;
-set global innodb_file_format = `0`;
-create table t1 (id int primary key) engine = innodb key_block_size = 1;
-ERROR HY000: Can't create table 'test.t1' (errno: 1478)
-show errors;
-Level Code Message
-Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Error 1005 Can't create table 'test.t1' (errno: 1478)
-create table t2 (id int primary key) engine = innodb key_block_size = 2;
-ERROR HY000: Can't create table 'test.t2' (errno: 1478)
-show errors;
-Level Code Message
-Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Error 1005 Can't create table 'test.t2' (errno: 1478)
-create table t3 (id int primary key) engine = innodb key_block_size = 4;
-ERROR HY000: Can't create table 'test.t3' (errno: 1478)
-show errors;
-Level Code Message
-Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Error 1005 Can't create table 'test.t3' (errno: 1478)
-create table t4 (id int primary key) engine = innodb key_block_size = 8;
-ERROR HY000: Can't create table 'test.t4' (errno: 1478)
-show errors;
-Level Code Message
-Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Error 1005 Can't create table 'test.t4' (errno: 1478)
-create table t5 (id int primary key) engine = innodb key_block_size = 16;
-ERROR HY000: Can't create table 'test.t5' (errno: 1478)
-show errors;
-Level Code Message
-Error 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
-Error 1005 Can't create table 'test.t5' (errno: 1478)
-create table t6 (id int primary key) engine = innodb row_format = compressed;
-ERROR HY000: Can't create table 'test.t6' (errno: 1478)
-show errors;
-Level Code Message
-Error 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
-Error 1005 Can't create table 'test.t6' (errno: 1478)
-create table t7 (id int primary key) engine = innodb row_format = dynamic;
-ERROR HY000: Can't create table 'test.t7' (errno: 1478)
-show errors;
-Level Code Message
-Error 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
-Error 1005 Can't create table 'test.t7' (errno: 1478)
-create table t8 (id int primary key) engine = innodb row_format = compact;
-create table t9 (id int primary key) engine = innodb row_format = redundant;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-table_schema table_name row_format
-test t8 Compact
-test t9 Redundant
-drop table t8, t9;
-set global innodb_file_per_table=0;
-set global innodb_file_format=Antelope;
-set global innodb_file_per_table=on;
-set global innodb_file_format=`Barracuda`;
-set global innodb_file_format_check=`Antelope`;
-create table normal_table (
-c1 int
-) engine = innodb;
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Antelope
-create table zip_table (
-c1 int
-) engine = innodb key_block_size = 8;
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Barracuda
-set global innodb_file_format_check=`Antelope`;
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Antelope
-show table status;
-select @@innodb_file_format_check;
-@@innodb_file_format_check
-Barracuda
-drop table normal_table, zip_table;
diff --git a/storage/innodb_plugin/mysql-test/innodb-zip.test b/storage/innodb_plugin/mysql-test/innodb-zip.test
deleted file mode 100644
index 5bcd0e3c824..00000000000
--- a/storage/innodb_plugin/mysql-test/innodb-zip.test
+++ /dev/null
@@ -1,343 +0,0 @@
--- source include/have_innodb.inc
-
-let $per_table=`select @@innodb_file_per_table`;
-let $format=`select @@innodb_file_format`;
-let $innodb_file_format_check_orig=`select @@innodb_file_format_check`;
-set global innodb_file_per_table=off;
-set global innodb_file_format=`0`;
-
-create table t0(a int primary key) engine=innodb row_format=compressed;
-create table t00(a int primary key) engine=innodb
-key_block_size=4 row_format=compressed;
-create table t1(a int primary key) engine=innodb row_format=dynamic;
-create table t2(a int primary key) engine=innodb row_format=redundant;
-create table t3(a int primary key) engine=innodb row_format=compact;
-create table t4(a int primary key) engine=innodb key_block_size=9;
-create table t5(a int primary key) engine=innodb
-key_block_size=1 row_format=redundant;
-
-set global innodb_file_per_table=on;
-create table t6(a int primary key) engine=innodb
-key_block_size=1 row_format=redundant;
-set global innodb_file_format=`1`;
-create table t7(a int primary key) engine=innodb
-key_block_size=1 row_format=redundant;
-create table t8(a int primary key) engine=innodb
-key_block_size=1 row_format=fixed;
-create table t9(a int primary key) engine=innodb
-key_block_size=1 row_format=compact;
-create table t10(a int primary key) engine=innodb
-key_block_size=1 row_format=dynamic;
-create table t11(a int primary key) engine=innodb
-key_block_size=1 row_format=compressed;
-create table t12(a int primary key) engine=innodb
-key_block_size=1;
-create table t13(a int primary key) engine=innodb
-row_format=compressed;
-create table t14(a int primary key) engine=innodb key_block_size=9;
-
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-
-drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14;
-alter table t1 key_block_size=0;
-alter table t1 row_format=dynamic;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-alter table t1 row_format=compact;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-alter table t1 row_format=redundant;
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-drop table t1;
-
-create table t1(a int not null, b text, index(b(10))) engine=innodb
-key_block_size=1;
-
-create table t2(b text)engine=innodb;
-insert into t2 values(concat('1abcdefghijklmnopqrstuvwxyz', repeat('A',5000)));
-
-insert into t1 select 1, b from t2;
-commit;
-
-connect (a,localhost,root,,);
-connect (b,localhost,root,,);
-
-connection a;
-begin;
-update t1 set b=repeat('B',100);
-
-connection b;
-select a,left(b,40) from t1 natural join t2;
-
-connection a;
-rollback;
-
-connection b;
-select a,left(b,40) from t1 natural join t2;
-
-connection default;
-disconnect a;
-disconnect b;
-
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-drop table t1,t2;
-
-# The following should fail even in non-strict mode.
-SET SESSION innodb_strict_mode = off;
---error ER_TOO_BIG_ROWSIZE
-CREATE TABLE t1(
- c TEXT NOT NULL, d TEXT NOT NULL,
- PRIMARY KEY (c(767),d(767)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
---error ER_TOO_BIG_ROWSIZE
-CREATE TABLE t1(
- c TEXT NOT NULL, d TEXT NOT NULL,
- PRIMARY KEY (c(767),d(767)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=ASCII;
-CREATE TABLE t1(
- c TEXT NOT NULL, d TEXT NOT NULL,
- PRIMARY KEY (c(767),d(767)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 CHARSET=ASCII;
-drop table t1;
---error ER_TOO_BIG_ROWSIZE
-CREATE TABLE t1(c TEXT, PRIMARY KEY (c(440)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
-CREATE TABLE t1(c TEXT, PRIMARY KEY (c(438)))
-ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
-INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512));
-DROP TABLE t1;
-
-#
-# Test blob column inheritance (mantis issue#36)
-#
-
-create table t1( c1 int not null, c2 blob, c3 blob, c4 blob,
- primary key(c1, c2(22), c3(22)))
- engine = innodb row_format = dynamic;
-begin;
-insert into t1 values(1, repeat('A', 20000), repeat('B', 20000),
- repeat('C', 20000));
-
-update t1 set c3 = repeat('D', 20000) where c1 = 1;
-commit;
-
-# one blob column which is unchanged in update and part of PK
-# one blob column which is changed and part of of PK
-# one blob column which is not part of PK and is unchanged
-select count(*) from t1 where c2 = repeat('A', 20000);
-select count(*) from t1 where c3 = repeat('D', 20000);
-select count(*) from t1 where c4 = repeat('C', 20000);
-
-update t1 set c3 = repeat('E', 20000) where c1 = 1;
-drop table t1;
-
-#
-#
-# Test innodb_file_format
-#
-set global innodb_file_format=`0`;
-select @@innodb_file_format;
-set global innodb_file_format=`1`;
-select @@innodb_file_format;
--- error ER_WRONG_ARGUMENTS
-set global innodb_file_format=`2`;
--- error ER_WRONG_ARGUMENTS
-set global innodb_file_format=`-1`;
-set global innodb_file_format=`Antelope`;
-set global innodb_file_format=`Barracuda`;
--- error ER_WRONG_ARGUMENTS
-set global innodb_file_format=`Cheetah`;
--- error ER_WRONG_ARGUMENTS
-set global innodb_file_format=`abc`;
--- error ER_WRONG_ARGUMENTS
-set global innodb_file_format=`1a`;
--- error ER_WRONG_ARGUMENTS
-set global innodb_file_format=``;
-
-#test strict mode.
-# this does not work anymore, has been removed from mysqltest
-# -- enable_errors
-set global innodb_file_per_table = on;
-set global innodb_file_format = `1`;
-
-set innodb_strict_mode = off;
-create table t1 (id int primary key) engine = innodb key_block_size = 0;
-drop table t1;
-
-#set strict_mode
-set innodb_strict_mode = on;
-
-#Test different values of KEY_BLOCK_SIZE
-
---error ER_CANT_CREATE_TABLE
-create table t1 (id int primary key) engine = innodb key_block_size = 0;
-show errors;
-
---error ER_CANT_CREATE_TABLE
-create table t2 (id int primary key) engine = innodb key_block_size = 9;
-show errors;
-
-
-create table t3 (id int primary key) engine = innodb key_block_size = 1;
-create table t4 (id int primary key) engine = innodb key_block_size = 2;
-create table t5 (id int primary key) engine = innodb key_block_size = 4;
-create table t6 (id int primary key) engine = innodb key_block_size = 8;
-create table t7 (id int primary key) engine = innodb key_block_size = 16;
-
-#check various ROW_FORMAT values.
-create table t8 (id int primary key) engine = innodb row_format = compressed;
-create table t9 (id int primary key) engine = innodb row_format = dynamic;
-create table t10(id int primary key) engine = innodb row_format = compact;
-create table t11(id int primary key) engine = innodb row_format = redundant;
-
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-drop table t3, t4, t5, t6, t7, t8, t9, t10, t11;
-
-#test different values of ROW_FORMAT with KEY_BLOCK_SIZE
-create table t1 (id int primary key) engine = innodb
-key_block_size = 8 row_format = compressed;
-
---error ER_CANT_CREATE_TABLE
-create table t2 (id int primary key) engine = innodb
-key_block_size = 8 row_format = redundant;
-show errors;
-
---error ER_CANT_CREATE_TABLE
-create table t3 (id int primary key) engine = innodb
-key_block_size = 8 row_format = compact;
-show errors;
-
---error ER_CANT_CREATE_TABLE
-create table t4 (id int primary key) engine = innodb
-key_block_size = 8 row_format = dynamic;
-show errors;
-
---error ER_CANT_CREATE_TABLE
-create table t5 (id int primary key) engine = innodb
-key_block_size = 8 row_format = default;
-show errors;
-
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-drop table t1;
-
-#test multiple errors
---error ER_CANT_CREATE_TABLE
-create table t1 (id int primary key) engine = innodb
-key_block_size = 9 row_format = redundant;
-show errors;
-
---error ER_CANT_CREATE_TABLE
-create table t2 (id int primary key) engine = innodb
-key_block_size = 9 row_format = compact;
-show errors;
-
---error ER_CANT_CREATE_TABLE
-create table t2 (id int primary key) engine = innodb
-key_block_size = 9 row_format = dynamic;
-show errors;
-
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-
-#test valid values with innodb_file_per_table unset
-set global innodb_file_per_table = off;
-
---error ER_CANT_CREATE_TABLE
-create table t1 (id int primary key) engine = innodb key_block_size = 1;
-show errors;
---error ER_CANT_CREATE_TABLE
-create table t2 (id int primary key) engine = innodb key_block_size = 2;
-show errors;
---error ER_CANT_CREATE_TABLE
-create table t3 (id int primary key) engine = innodb key_block_size = 4;
-show errors;
---error ER_CANT_CREATE_TABLE
-create table t4 (id int primary key) engine = innodb key_block_size = 8;
-show errors;
---error ER_CANT_CREATE_TABLE
-create table t5 (id int primary key) engine = innodb key_block_size = 16;
-show errors;
---error ER_CANT_CREATE_TABLE
-create table t6 (id int primary key) engine = innodb row_format = compressed;
-show errors;
---error ER_CANT_CREATE_TABLE
-create table t7 (id int primary key) engine = innodb row_format = dynamic;
-show errors;
-create table t8 (id int primary key) engine = innodb row_format = compact;
-create table t9 (id int primary key) engine = innodb row_format = redundant;
-
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-drop table t8, t9;
-
-#test valid values with innodb_file_format unset
-set global innodb_file_per_table = on;
-set global innodb_file_format = `0`;
-
---error ER_CANT_CREATE_TABLE
-create table t1 (id int primary key) engine = innodb key_block_size = 1;
-show errors;
---error ER_CANT_CREATE_TABLE
-create table t2 (id int primary key) engine = innodb key_block_size = 2;
-show errors;
---error ER_CANT_CREATE_TABLE
-create table t3 (id int primary key) engine = innodb key_block_size = 4;
-show errors;
---error ER_CANT_CREATE_TABLE
-create table t4 (id int primary key) engine = innodb key_block_size = 8;
-show errors;
---error ER_CANT_CREATE_TABLE
-create table t5 (id int primary key) engine = innodb key_block_size = 16;
-show errors;
---error ER_CANT_CREATE_TABLE
-create table t6 (id int primary key) engine = innodb row_format = compressed;
-show errors;
---error ER_CANT_CREATE_TABLE
-create table t7 (id int primary key) engine = innodb row_format = dynamic;
-show errors;
-create table t8 (id int primary key) engine = innodb row_format = compact;
-create table t9 (id int primary key) engine = innodb row_format = redundant;
-
-SELECT table_schema, table_name, row_format
-FROM information_schema.tables WHERE engine='innodb';
-drop table t8, t9;
-
-eval set global innodb_file_per_table=$per_table;
-eval set global innodb_file_format=$format;
-#
-# Testing of tablespace tagging
-#
--- disable_info
-set global innodb_file_per_table=on;
-set global innodb_file_format=`Barracuda`;
-set global innodb_file_format_check=`Antelope`;
-create table normal_table (
- c1 int
-) engine = innodb;
-select @@innodb_file_format_check;
-create table zip_table (
- c1 int
-) engine = innodb key_block_size = 8;
-select @@innodb_file_format_check;
-set global innodb_file_format_check=`Antelope`;
-select @@innodb_file_format_check;
--- disable_result_log
-show table status;
--- enable_result_log
-select @@innodb_file_format_check;
-drop table normal_table, zip_table;
--- disable_result_log
-
-#
-# restore environment to the state it was before this test execution
-#
-
--- disable_query_log
-eval set global innodb_file_format=$format;
-eval set global innodb_file_per_table=$per_table;
-eval set global innodb_file_format_check=$innodb_file_format_check_orig;
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug36169.result b/storage/innodb_plugin/mysql-test/innodb_bug36169.result
deleted file mode 100644
index aa80e4d7aa4..00000000000
--- a/storage/innodb_plugin/mysql-test/innodb_bug36169.result
+++ /dev/null
@@ -1,2 +0,0 @@
-SET GLOBAL innodb_file_format='Barracuda';
-SET GLOBAL innodb_file_per_table=ON;
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug40360.result b/storage/innodb_plugin/mysql-test/innodb_bug40360.result
deleted file mode 100644
index ef4cf463903..00000000000
--- a/storage/innodb_plugin/mysql-test/innodb_bug40360.result
+++ /dev/null
@@ -1,4 +0,0 @@
-SET TX_ISOLATION='READ-COMMITTED';
-CREATE TABLE bug40360 (a INT) engine=innodb;
-INSERT INTO bug40360 VALUES (1);
-DROP TABLE bug40360;
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug40360.test b/storage/innodb_plugin/mysql-test/innodb_bug40360.test
deleted file mode 100644
index e88837aab4f..00000000000
--- a/storage/innodb_plugin/mysql-test/innodb_bug40360.test
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# Make sure http://bugs.mysql.com/40360 remains fixed.
-#
-
--- source include/not_embedded.inc
--- source include/have_innodb.inc
-
-SET TX_ISOLATION='READ-COMMITTED';
-
-# This is the default since MySQL 5.1.29 SET BINLOG_FORMAT='STATEMENT';
-
-CREATE TABLE bug40360 (a INT) engine=innodb;
-
-INSERT INTO bug40360 VALUES (1);
-
-DROP TABLE bug40360;
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug41904.result b/storage/innodb_plugin/mysql-test/innodb_bug41904.result
deleted file mode 100644
index 6070d32d181..00000000000
--- a/storage/innodb_plugin/mysql-test/innodb_bug41904.result
+++ /dev/null
@@ -1,4 +0,0 @@
-CREATE TABLE bug41904 (id INT PRIMARY KEY, uniquecol CHAR(15)) ENGINE=InnoDB;
-INSERT INTO bug41904 VALUES (1,NULL), (2,NULL);
-CREATE UNIQUE INDEX ui ON bug41904 (uniquecol);
-DROP TABLE bug41904;
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug41904.test b/storage/innodb_plugin/mysql-test/innodb_bug41904.test
deleted file mode 100644
index 365c5229adc..00000000000
--- a/storage/innodb_plugin/mysql-test/innodb_bug41904.test
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# Make sure http://bugs.mysql.com/41904 remains fixed.
-#
-
--- source include/not_embedded.inc
--- source include/have_innodb.inc
-
-CREATE TABLE bug41904 (id INT PRIMARY KEY, uniquecol CHAR(15)) ENGINE=InnoDB;
-
-INSERT INTO bug41904 VALUES (1,NULL), (2,NULL);
-
-CREATE UNIQUE INDEX ui ON bug41904 (uniquecol);
-
-DROP TABLE bug41904;
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug44032.result b/storage/innodb_plugin/mysql-test/innodb_bug44032.result
deleted file mode 100644
index da2a000b06e..00000000000
--- a/storage/innodb_plugin/mysql-test/innodb_bug44032.result
+++ /dev/null
@@ -1,7 +0,0 @@
-CREATE TABLE bug44032(c CHAR(3) CHARACTER SET UTF8) ROW_FORMAT=REDUNDANT
-ENGINE=InnoDB;
-INSERT INTO bug44032 VALUES('abc'),(0xEFBCA4EFBCA4EFBCA4);
-UPDATE bug44032 SET c='DDD' WHERE c=0xEFBCA4EFBCA4EFBCA4;
-UPDATE bug44032 SET c=NULL WHERE c='DDD';
-UPDATE bug44032 SET c='DDD' WHERE c IS NULL;
-DROP TABLE bug44032;
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug44369.result b/storage/innodb_plugin/mysql-test/innodb_bug44369.result
deleted file mode 100644
index e4b84ecac19..00000000000
--- a/storage/innodb_plugin/mysql-test/innodb_bug44369.result
+++ /dev/null
@@ -1,14 +0,0 @@
-create table bug44369 (DB_ROW_ID int) engine=innodb;
-ERROR HY000: Can't create table 'test.bug44369' (errno: -1)
-create table bug44369 (db_row_id int) engine=innodb;
-ERROR HY000: Can't create table 'test.bug44369' (errno: -1)
-show errors;
-Level Code Message
-Error 1005 Error creating table 'test/bug44369' with column name 'db_row_id'. 'db_row_id' is a reserved name. Please try to re-create the table with a different column name.
-Error 1005 Can't create table 'test.bug44369' (errno: -1)
-create table bug44369 (db_TRX_Id int) engine=innodb;
-ERROR HY000: Can't create table 'test.bug44369' (errno: -1)
-show errors;
-Level Code Message
-Error 1005 Error creating table 'test/bug44369' with column name 'db_TRX_Id'. 'db_TRX_Id' is a reserved name. Please try to re-create the table with a different column name.
-Error 1005 Can't create table 'test.bug44369' (errno: -1)
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug44571.result b/storage/innodb_plugin/mysql-test/innodb_bug44571.result
deleted file mode 100644
index 36374edcb3e..00000000000
--- a/storage/innodb_plugin/mysql-test/innodb_bug44571.result
+++ /dev/null
@@ -1,9 +0,0 @@
-CREATE TABLE bug44571 (foo INT) ENGINE=InnoDB;
-ALTER TABLE bug44571 CHANGE foo bar INT;
-ALTER TABLE bug44571 ADD INDEX bug44571b (foo);
-ERROR 42000: Key column 'foo' doesn't exist in table
-ALTER TABLE bug44571 ADD INDEX bug44571b (bar);
-ERROR HY000: Incorrect key file for table 'bug44571'; try to repair it
-CREATE INDEX bug44571b ON bug44571 (bar);
-ERROR HY000: Incorrect key file for table 'bug44571'; try to repair it
-DROP TABLE bug44571;
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug44571.test b/storage/innodb_plugin/mysql-test/innodb_bug44571.test
deleted file mode 100644
index 685463ceff9..00000000000
--- a/storage/innodb_plugin/mysql-test/innodb_bug44571.test
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Bug#44571 InnoDB Plugin crashes on ADD INDEX
-# http://bugs.mysql.com/44571
-#
--- source include/have_innodb.inc
-
-CREATE TABLE bug44571 (foo INT) ENGINE=InnoDB;
-ALTER TABLE bug44571 CHANGE foo bar INT;
--- error ER_KEY_COLUMN_DOES_NOT_EXITS
-ALTER TABLE bug44571 ADD INDEX bug44571b (foo);
-# The following will fail, because the CHANGE foo bar was
-# not communicated to InnoDB.
---error ER_NOT_KEYFILE
-ALTER TABLE bug44571 ADD INDEX bug44571b (bar);
---error ER_NOT_KEYFILE
-CREATE INDEX bug44571b ON bug44571 (bar);
-DROP TABLE bug44571;
diff --git a/storage/innodb_plugin/mysql-test/innodb_bug46000.result b/storage/innodb_plugin/mysql-test/innodb_bug46000.result
deleted file mode 100644
index ccff888a48d..00000000000
--- a/storage/innodb_plugin/mysql-test/innodb_bug46000.result
+++ /dev/null
@@ -1,17 +0,0 @@
-create table bug46000(`id` int,key `GEN_CLUST_INDEX`(`id`))engine=innodb;
-ERROR HY000: Can't create table 'test.bug46000' (errno: -1)
-create table bug46000(`id` int, key `GEN_clust_INDEX`(`id`))engine=innodb;
-ERROR HY000: Can't create table 'test.bug46000' (errno: -1)
-show errors;
-Level Code Message
-Error 1005 Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index.
-Error 1005 Can't create table 'test.bug46000' (errno: -1)
-create table bug46000(id int) engine=innodb;
-create index GEN_CLUST_INDEX on bug46000(id);
-ERROR HY000: Can't create table '#sql-temporary' (errno: -1)
-show errors;
-Level Code Message
-Error 1005 Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index.
-Error 1005 Can't create table '#sql-temporary' (errno: -1)
-create index idx on bug46000(id);
-drop table bug46000;
diff --git a/storage/innodb_plugin/mysql-test/innodb_information_schema.result b/storage/innodb_plugin/mysql-test/innodb_information_schema.result
deleted file mode 100644
index 396cae579ce..00000000000
--- a/storage/innodb_plugin/mysql-test/innodb_information_schema.result
+++ /dev/null
@@ -1,23 +0,0 @@
-lock_mode lock_type lock_table lock_index lock_rec lock_data
-X RECORD `test`.```t'\"_str` `PRIMARY` 2 '1', 'abc', '''abc', 'abc''', 'a''bc', 'a''bc''', '''abc'''''
-X RECORD `test`.```t'\"_str` `PRIMARY` 2 '1', 'abc', '''abc', 'abc''', 'a''bc', 'a''bc''', '''abc'''''
-X RECORD `test`.```t'\"_str` `PRIMARY` 3 '2', 'abc', '"abc', 'abc"', 'a"bc', 'a"bc"', '"abc""'
-X RECORD `test`.```t'\"_str` `PRIMARY` 3 '2', 'abc', '"abc', 'abc"', 'a"bc', 'a"bc"', '"abc""'
-X RECORD `test`.```t'\"_str` `PRIMARY` 4 '3', 'abc', '\\abc', 'abc\\', 'a\\bc', 'a\\bc\\', '\\abc\\\\'
-X RECORD `test`.```t'\"_str` `PRIMARY` 4 '3', 'abc', '\\abc', 'abc\\', 'a\\bc', 'a\\bc\\', '\\abc\\\\'
-X RECORD `test`.```t'\"_str` `PRIMARY` 5 '4', 'abc', '\0abc', 'abc\0', 'a\0bc', 'a\0bc\0', 'a\0bc\0\0'
-X RECORD `test`.```t'\"_str` `PRIMARY` 5 '4', 'abc', '\0abc', 'abc\0', 'a\0bc', 'a\0bc\0', 'a\0bc\0\0'
-X RECORD `test`.`t_min` `PRIMARY` 2 -128, 0, -32768, 0, -8388608, 0, -2147483648, 0, -9223372036854775808, 0
-X RECORD `test`.`t_min` `PRIMARY` 2 -128, 0, -32768, 0, -8388608, 0, -2147483648, 0, -9223372036854775808, 0
-X RECORD `test`.`t_max` `PRIMARY` 2 127, 255, 32767, 65535, 8388607, 16777215, 2147483647, 4294967295, 9223372036854775807, 18446744073709551615
-X RECORD `test`.`t_max` `PRIMARY` 2 127, 255, 32767, 65535, 8388607, 16777215, 2147483647, 4294967295, 9223372036854775807, 18446744073709551615
-X RECORD `test`.```t'\"_str` `PRIMARY` 1 supremum pseudo-record
-X RECORD `test`.```t'\"_str` `PRIMARY` 1 supremum pseudo-record
-lock_table COUNT(*)
-`test`.`t_max` 2
-`test`.`t_min` 2
-`test`.```t'\"_str` 10
-lock_table COUNT(*)
-"test"."t_max" 2
-"test"."t_min" 2
-"test"."`t'\""_str" 10
diff --git a/storage/innodb_plugin/mysql-test/innodb_information_schema.test b/storage/innodb_plugin/mysql-test/innodb_information_schema.test
deleted file mode 100644
index eaed653854a..00000000000
--- a/storage/innodb_plugin/mysql-test/innodb_information_schema.test
+++ /dev/null
@@ -1,145 +0,0 @@
-#
-# Test that user data is correctly "visualized" in
-# INFORMATION_SCHEMA.innodb_locks.lock_data
-#
-
--- source include/have_innodb.inc
-
--- disable_query_log
--- disable_result_log
-
-SET storage_engine=InnoDB;
-
--- disable_warnings
-DROP TABLE IF EXISTS t_min, t_max;
--- enable_warnings
-
-let $table_def =
-(
- c01 TINYINT,
- c02 TINYINT UNSIGNED,
- c03 SMALLINT,
- c04 SMALLINT UNSIGNED,
- c05 MEDIUMINT,
- c06 MEDIUMINT UNSIGNED,
- c07 INT,
- c08 INT UNSIGNED,
- c09 BIGINT,
- c10 BIGINT UNSIGNED,
- PRIMARY KEY(c01, c02, c03, c04, c05, c06, c07, c08, c09, c10)
-);
-
--- eval CREATE TABLE t_min $table_def;
-INSERT INTO t_min VALUES
-(-128, 0,
- -32768, 0,
- -8388608, 0,
- -2147483648, 0,
- -9223372036854775808, 0);
-
--- eval CREATE TABLE t_max $table_def;
-INSERT INTO t_max VALUES
-(127, 255,
- 32767, 65535,
- 8388607, 16777215,
- 2147483647, 4294967295,
- 9223372036854775807, 18446744073709551615);
-
-CREATE TABLE ```t'\"_str` (
- c1 VARCHAR(32),
- c2 VARCHAR(32),
- c3 VARCHAR(32),
- c4 VARCHAR(32),
- c5 VARCHAR(32),
- c6 VARCHAR(32),
- c7 VARCHAR(32),
- PRIMARY KEY(c1, c2, c3, c4, c5, c6, c7)
-);
-INSERT INTO ```t'\"_str` VALUES
-('1', 'abc', '''abc', 'abc''', 'a''bc', 'a''bc''', '''abc''''');
-INSERT INTO ```t'\"_str` VALUES
-('2', 'abc', '"abc', 'abc"', 'a"bc', 'a"bc"', '"abc""');
-INSERT INTO ```t'\"_str` VALUES
-('3', 'abc', '\\abc', 'abc\\', 'a\\bc', 'a\\bc\\', '\\abc\\\\');
-INSERT INTO ```t'\"_str` VALUES
-('4', 'abc', 0x00616263, 0x61626300, 0x61006263, 0x6100626300, 0x610062630000);
-
--- connect (con_lock,localhost,root,,)
--- connect (con_min_trylock,localhost,root,,)
--- connect (con_max_trylock,localhost,root,,)
--- connect (con_str_insert_supremum,localhost,root,,)
--- connect (con_str_lock_row1,localhost,root,,)
--- connect (con_str_lock_row2,localhost,root,,)
--- connect (con_str_lock_row3,localhost,root,,)
--- connect (con_str_lock_row4,localhost,root,,)
--- connect (con_verify_innodb_locks,localhost,root,,)
-
--- connection con_lock
-SET autocommit=0;
-SELECT * FROM t_min FOR UPDATE;
-SELECT * FROM t_max FOR UPDATE;
-SELECT * FROM ```t'\"_str` FOR UPDATE;
-
--- connection con_min_trylock
--- send
-SELECT * FROM t_min FOR UPDATE;
-
--- connection con_max_trylock
--- send
-SELECT * FROM t_max FOR UPDATE;
-
--- connection con_str_insert_supremum
--- send
-INSERT INTO ```t'\"_str` VALUES
-('z', 'z', 'z', 'z', 'z', 'z', 'z');
-
--- connection con_str_lock_row1
--- send
-SELECT * FROM ```t'\"_str` WHERE c1 = '1' FOR UPDATE;
-
--- connection con_str_lock_row2
--- send
-SELECT * FROM ```t'\"_str` WHERE c1 = '2' FOR UPDATE;
-
--- connection con_str_lock_row3
--- send
-SELECT * FROM ```t'\"_str` WHERE c1 = '3' FOR UPDATE;
-
--- connection con_str_lock_row4
--- send
-SELECT * FROM ```t'\"_str` WHERE c1 = '4' FOR UPDATE;
-
-# Give time to the above 2 queries to execute before continuing.
-# Without this sleep it sometimes happens that the SELECT from innodb_locks
-# executes before some of them, resulting in less than expected number
-# of rows being selected from innodb_locks.
--- sleep 0.1
-
--- enable_result_log
--- connection con_verify_innodb_locks
-SELECT lock_mode, lock_type, lock_table, lock_index, lock_rec, lock_data
-FROM INFORMATION_SCHEMA.INNODB_LOCKS ORDER BY lock_data;
-
-SELECT lock_table,COUNT(*) FROM INFORMATION_SCHEMA.INNODB_LOCKS
-GROUP BY lock_table;
-
-set @save_sql_mode = @@sql_mode;
-SET SQL_MODE='ANSI_QUOTES';
-SELECT lock_table,COUNT(*) FROM INFORMATION_SCHEMA.INNODB_LOCKS
-GROUP BY lock_table;
-SET @@sql_mode=@save_sql_mode;
--- disable_result_log
-
--- connection default
-
--- disconnect con_lock
--- disconnect con_min_trylock
--- disconnect con_max_trylock
--- disconnect con_str_insert_supremum
--- disconnect con_str_lock_row1
--- disconnect con_str_lock_row2
--- disconnect con_str_lock_row3
--- disconnect con_str_lock_row4
--- disconnect con_verify_innodb_locks
-
-DROP TABLE t_min, t_max, ```t'\"_str`;
diff --git a/storage/innodb_plugin/mysql-test/patches/innodb-index.diff b/storage/innodb_plugin/mysql-test/patches/innodb-index.diff
deleted file mode 100644
index 0b008c96f25..00000000000
--- a/storage/innodb_plugin/mysql-test/patches/innodb-index.diff
+++ /dev/null
@@ -1,62 +0,0 @@
-This part of the innodb-index test causes mysqld to print some warnings
-and subsequently the whole mysql-test suite to fail.
-
-A permanent solution is probably to remove the printouts from the source
-code or to somehow tell the mysql-test suite that warnings are expected.
-Currently we simply do not execute the problematic tests. Please
-coordinate a permanent solution with Marko, who added those tests.
-
-This cannot be proposed to MySQL because it touches files that are not
-in the MySQL source repository.
-
-Index: storage/innobase/mysql-test/innodb-index.result
-===================================================================
---- storage/innobase/mysql-test/innodb-index.result (revision 2870)
-+++ storage/innobase/mysql-test/innodb-index.result (working copy)
-@@ -43,19 +43,12 @@ t1 CREATE TABLE `t1` (
- `b` int(11) DEFAULT NULL,
- `c` char(10) NOT NULL,
- `d` varchar(20) DEFAULT NULL,
- KEY `d2` (`d`),
- KEY `b` (`b`)
- ) ENGINE=InnoDB DEFAULT CHARSET=latin1
--CREATE TABLE `t1#1`(a INT PRIMARY KEY) ENGINE=InnoDB;
--alter table t1 add unique index (c), add index (d);
--ERROR HY000: Table 'test.t1#1' already exists
--rename table `t1#1` to `t1#2`;
--alter table t1 add unique index (c), add index (d);
--ERROR HY000: Table 'test.t1#2' already exists
--drop table `t1#2`;
- alter table t1 add unique index (c), add index (d);
- show create table t1;
- Table Create Table
- t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `b` int(11) DEFAULT NULL,
-Index: storage/innobase/mysql-test/innodb-index.test
-===================================================================
---- storage/innobase/mysql-test/innodb-index.test (revision 2870)
-+++ storage/innobase/mysql-test/innodb-index.test (working copy)
-@@ -14,22 +14,12 @@ select * from t1 force index (d2) order
- --error ER_DUP_ENTRY
- alter table t1 add unique index (b);
- show create table t1;
- alter table t1 add index (b);
- show create table t1;
-
--# Check how existing tables interfere with temporary tables.
--CREATE TABLE `t1#1`(a INT PRIMARY KEY) ENGINE=InnoDB;
--
----error 156
--alter table t1 add unique index (c), add index (d);
--rename table `t1#1` to `t1#2`;
----error 156
--alter table t1 add unique index (c), add index (d);
--drop table `t1#2`;
--
- alter table t1 add unique index (c), add index (d);
- show create table t1;
- explain select * from t1 force index(c) order by c;
- alter table t1 add primary key (a), drop index c;
- show create table t1;
- --error ER_MULTIPLE_PRI_KEY
diff --git a/storage/innodb_plugin/rem/rem0rec.c b/storage/innodb_plugin/rem/rem0rec.c
index 27c11dacc8c..37ba8ca2ffe 100644
--- a/storage/innodb_plugin/rem/rem0rec.c
+++ b/storage/innodb_plugin/rem/rem0rec.c
@@ -212,6 +212,13 @@ rec_get_n_extern_new(
const dict_col_t* col
= dict_field_get_col(field);
len = *lens--;
+ /* If the maximum length of the field is up
+ to 255 bytes, the actual length is always
+ stored in one byte. If the maximum length is
+ more than 255 bytes, the actual length is
+ stored in one byte for 0..127. The length
+ will be encoded in two bytes when it is 128 or
+ more, or when the field is stored externally. */
if (UNIV_UNLIKELY(col->len > 255)
|| UNIV_UNLIKELY(col->mtype == DATA_BLOB)) {
if (len & 0x80) {
@@ -294,6 +301,13 @@ rec_init_offsets_comp_ordinary(
const dict_col_t* col
= dict_field_get_col(field);
len = *lens--;
+ /* If the maximum length of the field is up
+ to 255 bytes, the actual length is always
+ stored in one byte. If the maximum length is
+ more than 255 bytes, the actual length is
+ stored in one byte for 0..127. The length
+ will be encoded in two bytes when it is 128 or
+ more, or when the field is stored externally. */
if (UNIV_UNLIKELY(col->len > 255)
|| UNIV_UNLIKELY(col->mtype
== DATA_BLOB)) {
@@ -425,6 +439,15 @@ rec_init_offsets(
const dict_col_t* col
= dict_field_get_col(field);
len = *lens--;
+ /* If the maximum length of the field
+ is up to 255 bytes, the actual length
+ is always stored in one byte. If the
+ maximum length is more than 255 bytes,
+ the actual length is stored in one
+ byte for 0..127. The length will be
+ encoded in two bytes when it is 128 or
+ more, or when the field is stored
+ externally. */
if (UNIV_UNLIKELY(col->len > 255)
|| UNIV_UNLIKELY(col->mtype
== DATA_BLOB)) {
@@ -647,6 +670,13 @@ rec_get_offsets_reverse(
const dict_col_t* col
= dict_field_get_col(field);
len = *lens++;
+ /* If the maximum length of the field is up
+ to 255 bytes, the actual length is always
+ stored in one byte. If the maximum length is
+ more than 255 bytes, the actual length is
+ stored in one byte for 0..127. The length
+ will be encoded in two bytes when it is 128 or
+ more, or when the field is stored externally. */
if (UNIV_UNLIKELY(col->len > 255)
|| UNIV_UNLIKELY(col->mtype == DATA_BLOB)) {
if (len & 0x80) {
@@ -781,12 +811,20 @@ rec_get_converted_size_comp_prefix(
ut_ad(len <= col->len || col->mtype == DATA_BLOB);
+ /* If the maximum length of a variable-length field
+ is up to 255 bytes, the actual length is always stored
+ in one byte. If the maximum length is more than 255
+ bytes, the actual length is stored in one byte for
+ 0..127. The length will be encoded in two bytes when
+ it is 128 or more, or when the field is stored externally. */
+
if (field->fixed_len) {
ut_ad(len == field->fixed_len);
/* dict_index_add_col() should guarantee this */
ut_ad(!field->prefix_len
|| field->fixed_len == field->prefix_len);
} else if (dfield_is_ext(&fields[i])) {
+ ut_ad(col->len >= 256 || col->mtype == DATA_BLOB);
extra_size += 2;
} else if (len < 128
|| (col->len < 256 && col->mtype != DATA_BLOB)) {
@@ -1086,6 +1124,8 @@ rec_convert_dtuple_to_rec_comp(
/* Store the data and the offsets */
for (i = 0, field = fields; i < n_fields; i++, field++) {
+ const dict_field_t* ifield;
+
type = dfield_get_type(field);
len = dfield_get_len(field);
@@ -1120,12 +1160,20 @@ rec_convert_dtuple_to_rec_comp(
/* only nullable fields can be null */
ut_ad(!dfield_is_null(field));
- fixed_len = dict_index_get_nth_field(index, i)->fixed_len;
-
+ ifield = dict_index_get_nth_field(index, i);
+ fixed_len = ifield->fixed_len;
+ /* If the maximum length of a variable-length field
+ is up to 255 bytes, the actual length is always stored
+ in one byte. If the maximum length is more than 255
+ bytes, the actual length is stored in one byte for
+ 0..127. The length will be encoded in two bytes when
+ it is 128 or more, or when the field is stored externally. */
if (fixed_len) {
ut_ad(len == fixed_len);
ut_ad(!dfield_is_ext(field));
} else if (dfield_is_ext(field)) {
+ ut_ad(ifield->col->len >= 256
+ || ifield->col->mtype == DATA_BLOB);
ut_ad(len <= REC_MAX_INDEX_COL_LEN
+ BTR_EXTERN_FIELD_REF_SIZE);
*lens-- = (byte) (len >> 8) | 0xc0;
@@ -1215,11 +1263,20 @@ rec_convert_dtuple_to_rec(
mem_heap_t* heap = NULL;
ulint offsets_[REC_OFFS_NORMAL_SIZE];
const ulint* offsets;
+ ulint i;
rec_offs_init(offsets_);
offsets = rec_get_offsets(rec, index,
offsets_, ULINT_UNDEFINED, &heap);
ut_ad(rec_validate(rec, offsets));
+ ut_ad(dtuple_get_n_fields(dtuple)
+ == rec_offs_n_fields(offsets));
+
+ for (i = 0; i < rec_offs_n_fields(offsets); i++) {
+ ut_ad(!dfield_is_ext(dtuple_get_nth_field(dtuple, i))
+ == !rec_offs_nth_extern(offsets, i));
+ }
+
if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
}
@@ -1402,6 +1459,13 @@ rec_copy_prefix_to_buf(
prefix_len += field->fixed_len;
} else {
ulint len = *lens--;
+ /* If the maximum length of the column is up
+ to 255 bytes, the actual length is always
+ stored in one byte. If the maximum length is
+ more than 255 bytes, the actual length is
+ stored in one byte for 0..127. The length
+ will be encoded in two bytes when it is 128 or
+ more, or when the column is stored externally. */
if (col->len > 255 || col->mtype == DATA_BLOB) {
if (len & 0x80) {
/* 1exxxxxx */
diff --git a/storage/innodb_plugin/row/row0merge.c b/storage/innodb_plugin/row/row0merge.c
index 88a2770032d..d61d626f92e 100644
--- a/storage/innodb_plugin/row/row0merge.c
+++ b/storage/innodb_plugin/row/row0merge.c
@@ -2070,7 +2070,7 @@ row_merge_drop_temp_indexes(void)
field = rec_get_nth_field_old(rec, DICT_SYS_INDEXES_NAME_FIELD,
&len);
if (len == UNIV_SQL_NULL || len == 0
- || mach_read_from_1(field) != (ulint) TEMP_INDEX_PREFIX) {
+ || (char) *field != TEMP_INDEX_PREFIX) {
continue;
}
diff --git a/storage/innodb_plugin/row/row0mysql.c b/storage/innodb_plugin/row/row0mysql.c
index 0d8d298453c..24abf8067f2 100644
--- a/storage/innodb_plugin/row/row0mysql.c
+++ b/storage/innodb_plugin/row/row0mysql.c
@@ -1458,7 +1458,7 @@ row_unlock_for_mysql(
if (UNIV_UNLIKELY
(!srv_locks_unsafe_for_binlog
- && trx->isolation_level != TRX_ISO_READ_COMMITTED)) {
+ && trx->isolation_level > TRX_ISO_READ_COMMITTED)) {
fprintf(stderr,
"InnoDB: Error: calling row_unlock_for_mysql though\n"
diff --git a/storage/innodb_plugin/row/row0sel.c b/storage/innodb_plugin/row/row0sel.c
index 78318bf6461..d0702a0cd2f 100644
--- a/storage/innodb_plugin/row/row0sel.c
+++ b/storage/innodb_plugin/row/row0sel.c
@@ -852,7 +852,7 @@ row_sel_get_clust_rec(
trx = thr_get_trx(thr);
if (srv_locks_unsafe_for_binlog
- || trx->isolation_level == TRX_ISO_READ_COMMITTED) {
+ || trx->isolation_level <= TRX_ISO_READ_COMMITTED) {
lock_type = LOCK_REC_NOT_GAP;
} else {
lock_type = LOCK_ORDINARY;
@@ -1465,7 +1465,7 @@ rec_loop:
if (srv_locks_unsafe_for_binlog
|| trx->isolation_level
- == TRX_ISO_READ_COMMITTED) {
+ <= TRX_ISO_READ_COMMITTED) {
if (page_rec_is_supremum(next_rec)) {
@@ -1522,7 +1522,7 @@ skip_lock:
trx = thr_get_trx(thr);
if (srv_locks_unsafe_for_binlog
- || trx->isolation_level == TRX_ISO_READ_COMMITTED) {
+ || trx->isolation_level <= TRX_ISO_READ_COMMITTED) {
if (page_rec_is_supremum(rec)) {
@@ -3665,7 +3665,7 @@ shortcut_fails_too_big_rec:
&& !page_rec_is_supremum(rec)
&& set_also_gap_locks
&& !(srv_locks_unsafe_for_binlog
- || trx->isolation_level == TRX_ISO_READ_COMMITTED)
+ || trx->isolation_level <= TRX_ISO_READ_COMMITTED)
&& prebuilt->select_lock_type != LOCK_NONE) {
/* Try to place a gap lock on the next index record
@@ -3761,7 +3761,7 @@ rec_loop:
if (set_also_gap_locks
&& !(srv_locks_unsafe_for_binlog
- || trx->isolation_level == TRX_ISO_READ_COMMITTED)
+ || trx->isolation_level <= TRX_ISO_READ_COMMITTED)
&& prebuilt->select_lock_type != LOCK_NONE) {
/* Try to place a lock on the index record */
@@ -3895,7 +3895,7 @@ wrong_offs:
if (set_also_gap_locks
&& !(srv_locks_unsafe_for_binlog
|| trx->isolation_level
- == TRX_ISO_READ_COMMITTED)
+ <= TRX_ISO_READ_COMMITTED)
&& prebuilt->select_lock_type != LOCK_NONE) {
/* Try to place a gap lock on the index
@@ -3931,7 +3931,7 @@ wrong_offs:
if (set_also_gap_locks
&& !(srv_locks_unsafe_for_binlog
|| trx->isolation_level
- == TRX_ISO_READ_COMMITTED)
+ <= TRX_ISO_READ_COMMITTED)
&& prebuilt->select_lock_type != LOCK_NONE) {
/* Try to place a gap lock on the index
@@ -3979,7 +3979,7 @@ wrong_offs:
if (!set_also_gap_locks
|| srv_locks_unsafe_for_binlog
- || trx->isolation_level == TRX_ISO_READ_COMMITTED
+ || trx->isolation_level <= TRX_ISO_READ_COMMITTED
|| (unique_search
&& !UNIV_UNLIKELY(rec_get_deleted_flag(rec, comp)))) {
@@ -4018,7 +4018,7 @@ no_gap_lock:
const rec_t* old_vers;
case DB_SUCCESS:
if (srv_locks_unsafe_for_binlog
- || trx->isolation_level == TRX_ISO_READ_COMMITTED) {
+ || trx->isolation_level <= TRX_ISO_READ_COMMITTED) {
/* Note that a record of
prebuilt->index was locked. */
prebuilt->new_rec_locks = 1;
@@ -4027,6 +4027,7 @@ no_gap_lock:
case DB_LOCK_WAIT:
if (UNIV_LIKELY(prebuilt->row_read_type
!= ROW_READ_TRY_SEMI_CONSISTENT)
+ || unique_search
|| index != clust_index) {
goto lock_wait_or_error;
@@ -4150,7 +4151,7 @@ no_gap_lock:
/* The record is delete-marked: we can skip it */
if ((srv_locks_unsafe_for_binlog
- || trx->isolation_level == TRX_ISO_READ_COMMITTED)
+ || trx->isolation_level <= TRX_ISO_READ_COMMITTED)
&& prebuilt->select_lock_type != LOCK_NONE
&& !did_semi_consistent_read) {
@@ -4217,7 +4218,7 @@ requires_clust_rec:
}
if ((srv_locks_unsafe_for_binlog
- || trx->isolation_level == TRX_ISO_READ_COMMITTED)
+ || trx->isolation_level <= TRX_ISO_READ_COMMITTED)
&& prebuilt->select_lock_type != LOCK_NONE) {
/* Note that both the secondary index record
and the clustered index record were locked. */
@@ -4230,7 +4231,7 @@ requires_clust_rec:
/* The record is delete marked: we can skip it */
if ((srv_locks_unsafe_for_binlog
- || trx->isolation_level == TRX_ISO_READ_COMMITTED)
+ || trx->isolation_level <= TRX_ISO_READ_COMMITTED)
&& prebuilt->select_lock_type != LOCK_NONE) {
/* No need to keep a lock on a delete-marked
@@ -4441,7 +4442,7 @@ lock_wait_or_error:
moves_up, &mtr);
if ((srv_locks_unsafe_for_binlog
- || trx->isolation_level == TRX_ISO_READ_COMMITTED)
+ || trx->isolation_level <= TRX_ISO_READ_COMMITTED)
&& !same_user_rec) {
/* Since we were not able to restore the cursor
@@ -4613,12 +4614,12 @@ row_search_autoinc_read_column(
case DATA_FLOAT:
ut_a(len == sizeof(float));
- value = mach_float_read(data);
+ value = (ib_uint64_t) mach_float_read(data);
break;
case DATA_DOUBLE:
ut_a(len == sizeof(double));
- value = mach_double_read(data);
+ value = (ib_uint64_t) mach_double_read(data);
break;
default:
diff --git a/storage/innodb_plugin/srv/srv0srv.c b/storage/innodb_plugin/srv/srv0srv.c
index 78f11cfd2f3..63c355cea32 100644
--- a/storage/innodb_plugin/srv/srv0srv.c
+++ b/storage/innodb_plugin/srv/srv0srv.c
@@ -1609,8 +1609,9 @@ srv_suspend_mysql_thread(
innodb_lock_wait_timeout, because trx->mysql_thd == NULL. */
lock_wait_timeout = thd_lock_wait_timeout(trx->mysql_thd);
- if (lock_wait_timeout < 100000000
- && wait_time > (double) lock_wait_timeout) {
+ if (trx_is_interrupted(trx)
+ || (lock_wait_timeout < 100000000
+ && wait_time > (double) lock_wait_timeout)) {
trx->error_state = DB_LOCK_WAIT_TIMEOUT;
}
@@ -2158,9 +2159,10 @@ loop:
lock_wait_timeout = thd_lock_wait_timeout(
trx->mysql_thd);
- if (lock_wait_timeout < 100000000
- && (wait_time > (double) lock_wait_timeout
- || wait_time < 0)) {
+ if (trx_is_interrupted(trx)
+ || (lock_wait_timeout < 100000000
+ && (wait_time > (double) lock_wait_timeout
+ || wait_time < 0))) {
/* Timeout exceeded or a wrap-around in system
time counter: cancel the lock request queued
diff --git a/storage/innodb_plugin/trx/trx0rec.c b/storage/innodb_plugin/trx/trx0rec.c
index bcc1f81381e..f50e10ed756 100644
--- a/storage/innodb_plugin/trx/trx0rec.c
+++ b/storage/innodb_plugin/trx/trx0rec.c
@@ -350,8 +350,13 @@ trx_undo_rec_get_col_val(
ut_ad(*orig_len >= BTR_EXTERN_FIELD_REF_SIZE);
ut_ad(*len > *orig_len);
- ut_ad(*len >= REC_MAX_INDEX_COL_LEN
+ /* @see dtuple_convert_big_rec() */
+ ut_ad(*len >= BTR_EXTERN_FIELD_REF_SIZE * 2);
+ /* we do not have access to index->table here
+ ut_ad(dict_table_get_format(index->table) >= DICT_TF_FORMAT_ZIP
+ || *len >= REC_MAX_INDEX_COL_LEN
+ BTR_EXTERN_FIELD_REF_SIZE);
+ */
*len += UNIV_EXTERN_STORAGE_FIELD;
break;
@@ -1075,11 +1080,15 @@ trx_undo_rec_get_partial_row(
/* If the prefix of this column is indexed,
ensure that enough prefix is stored in the
undo log record. */
- ut_a(ignore_prefix
- || !col->ord_part
- || dfield_get_len(dfield)
- >= REC_MAX_INDEX_COL_LEN
- + BTR_EXTERN_FIELD_REF_SIZE);
+ if (!ignore_prefix && col->ord_part) {
+ ut_a(dfield_get_len(dfield)
+ >= 2 * BTR_EXTERN_FIELD_REF_SIZE);
+ ut_a(dict_table_get_format(index->table)
+ >= DICT_TF_FORMAT_ZIP
+ || dfield_get_len(dfield)
+ >= REC_MAX_INDEX_COL_LEN
+ + BTR_EXTERN_FIELD_REF_SIZE);
+ }
}
}
diff --git a/storage/innodb_plugin/trx/trx0trx.c b/storage/innodb_plugin/trx/trx0trx.c
index e8c98e22918..6ef7e62e6ae 100644
--- a/storage/innodb_plugin/trx/trx0trx.c
+++ b/storage/innodb_plugin/trx/trx0trx.c
@@ -843,7 +843,7 @@ trx_commit_off_kernel(
recovery i.e.: back ground rollback thread is still active
then there is a chance that the rollback thread may see
this trx as COMMITTED_IN_MEMORY and goes adhead to clean it
- up calling trx_cleanup_at_db_startup(). This can happen
+ up calling trx_cleanup_at_db_startup(). This can happen
in the case we are committing a trx here that is left in
PREPARED state during the crash. Note that commit of the
rollback of a PREPARED trx happens in the recovery thread