You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2598 lines
78 KiB

branches/zip: Merge revisions 4481:4710 from branches/5.1: (resolving conflict in r4574, r4575 and skipping r4699 and r4705 because analogous changes to r4699 and r4705 were already made to branches/zip) ------------------------------------------------------------------------ r4573 | vasil | 2009-03-30 14:17:13 +0300 (Mon, 30 Mar 2009) | 4 lines Changed paths: M /branches/5.1/mysql-test/innodb.test branches/5.1: Fix email address from dev@innodb.com to innodb_dev_ww@oracle.com ------------------------------------------------------------------------ r4574 | vasil | 2009-03-30 14:27:08 +0300 (Mon, 30 Mar 2009) | 38 lines Changed paths: M /branches/5.1/Makefile.am M /branches/5.1/mysql-test/innodb.test branches/5.1: Restore the state of INNODB_THREAD_CONCURRENCY to silence this warning: TEST RESULT TIME (ms) ------------------------------------------------------------ worker[1] Using MTR_BUILD_THREAD 250, with reserved ports 12500..12509 main.innodb [ pass ] 8803 MTR's internal check of the test case 'main.innodb' failed. This means that the test case does not preserve the state that existed before the test case was executed. Most likely the test case did not do a proper clean-up. This is the diff of the states of the servers before and after the test case was executed: mysqltest: Logging to '/tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.log'. mysqltest: Results saved in '/tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.result'. mysqltest: Connecting to server localhost:12500 (socket /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/mysqld.1.sock) as 'root', connection 'default', attempt 0 ... mysqltest: ... Connected. mysqltest: Start processing test commands from './include/check-testcase.test' ... mysqltest: ... Done processing test commands. --- /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.result 2009-03-30 14:12:31.000000000 +0300 +++ /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.reject 2009-03-30 14:12:41.000000000 +0300 @@ -99,7 +99,7 @@ INNODB_SUPPORT_XA ON INNODB_SYNC_SPIN_LOOPS 20 INNODB_TABLE_LOCKS ON -INNODB_THREAD_CONCURRENCY 8 +INNODB_THREAD_CONCURRENCY 16 INNODB_THREAD_SLEEP_DELAY 10000 INSERT_ID 0 INTERACTIVE_TIMEOUT 28800 mysqltest: Result content mismatch not ok ------------------------------------------------------------------------ r4575 | vasil | 2009-03-30 15:55:31 +0300 (Mon, 30 Mar 2009) | 8 lines Changed paths: M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Fix Bug#43309 Test main.innodb can't be run twice Make the innodb mysql-test more flexible by inspecting how much a variable of interest has changed since the start of the test. Do not assume the variables have zero values at the start of the test. ------------------------------------------------------------------------ r4576 | vasil | 2009-03-30 16:25:10 +0300 (Mon, 30 Mar 2009) | 4 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Revert a change to Makefile.am that I committed accidentally in c4574. ------------------------------------------------------------------------ r4659 | vasil | 2009-04-06 15:34:51 +0300 (Mon, 06 Apr 2009) | 6 lines Changed paths: M /branches/5.1/mysql-test/innodb.test branches/5.1: Followup to r4575 and the fix of Bug#43309 Test main.innodb can't be run twice: Add an explanatory comment, as suggested by Patrick Crews in the bug report. ------------------------------------------------------------------------ r4699 | vasil | 2009-04-09 14:01:52 +0300 (Thu, 09 Apr 2009) | 15 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/srv0srv.h M /branches/5.1/page/page0cur.c M /branches/5.1/srv/srv0srv.c branches/5.1: Fix Bug#43660 SHOW INDEXES/ANALYZE does NOT update cardinality for indexes of InnoDB table by replacing the PRNG that is used to pick random pages with a better one. This is based on r4670 but also adds a new configuration option and enables the fix only if this option is changed. Please skip the present revision when merging. Approved by: Heikki (via email) ------------------------------------------------------------------------ r4705 | vasil | 2009-04-14 14:30:13 +0300 (Tue, 14 Apr 2009) | 5 lines Changed paths: M /branches/5.1/page/page0cur.c branches/5.1: When using the random function, first take the modulus by the number of pages and then typecast to ulint. ------------------------------------------------------------------------ r4710 | vasil | 2009-04-15 11:55:18 +0300 (Wed, 15 Apr 2009) | 25 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Merge a change from MySQL (looks like this is against 5.0 but they later merged it to 5.1): ------------------------------------------------------------ revno: 1810.3846.1 committer: Alexey Botchkov <holyfoot@mysql.com> branch nick: 31435 timestamp: Tue 2008-11-11 14:42:32 +0400 message: Bug#31435 ha_innodb.cc:3983: ulint convert_search_mode_to_innobase(ha_rkey_function): Asse I think we don't need to issue an error statement in the convert_search_mode_to_innobase(). Returning the PAGE_CUR_UNSUPP value is enough as allows to handle this case depending on the requirements. per-file comments: sql/ha_innodb.cc Bug#31435 ha_innodb.cc:3983: ulint convert_search_mode_to_innobase(ha_rkey_function): Asse no error issued in convert_search_mode_to_innobase. ha_innobase::records_in_range() returns HA_POS_ERROR if search mode isn't supported. modified: sql/ha_innodb.cc ------------------------------------------------------------------------
17 years ago
20 years ago
branches/zip: Merge revisions 4481:4710 from branches/5.1: (resolving conflict in r4574, r4575 and skipping r4699 and r4705 because analogous changes to r4699 and r4705 were already made to branches/zip) ------------------------------------------------------------------------ r4573 | vasil | 2009-03-30 14:17:13 +0300 (Mon, 30 Mar 2009) | 4 lines Changed paths: M /branches/5.1/mysql-test/innodb.test branches/5.1: Fix email address from dev@innodb.com to innodb_dev_ww@oracle.com ------------------------------------------------------------------------ r4574 | vasil | 2009-03-30 14:27:08 +0300 (Mon, 30 Mar 2009) | 38 lines Changed paths: M /branches/5.1/Makefile.am M /branches/5.1/mysql-test/innodb.test branches/5.1: Restore the state of INNODB_THREAD_CONCURRENCY to silence this warning: TEST RESULT TIME (ms) ------------------------------------------------------------ worker[1] Using MTR_BUILD_THREAD 250, with reserved ports 12500..12509 main.innodb [ pass ] 8803 MTR's internal check of the test case 'main.innodb' failed. This means that the test case does not preserve the state that existed before the test case was executed. Most likely the test case did not do a proper clean-up. This is the diff of the states of the servers before and after the test case was executed: mysqltest: Logging to '/tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.log'. mysqltest: Results saved in '/tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.result'. mysqltest: Connecting to server localhost:12500 (socket /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/mysqld.1.sock) as 'root', connection 'default', attempt 0 ... mysqltest: ... Connected. mysqltest: Start processing test commands from './include/check-testcase.test' ... mysqltest: ... Done processing test commands. --- /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.result 2009-03-30 14:12:31.000000000 +0300 +++ /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.reject 2009-03-30 14:12:41.000000000 +0300 @@ -99,7 +99,7 @@ INNODB_SUPPORT_XA ON INNODB_SYNC_SPIN_LOOPS 20 INNODB_TABLE_LOCKS ON -INNODB_THREAD_CONCURRENCY 8 +INNODB_THREAD_CONCURRENCY 16 INNODB_THREAD_SLEEP_DELAY 10000 INSERT_ID 0 INTERACTIVE_TIMEOUT 28800 mysqltest: Result content mismatch not ok ------------------------------------------------------------------------ r4575 | vasil | 2009-03-30 15:55:31 +0300 (Mon, 30 Mar 2009) | 8 lines Changed paths: M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Fix Bug#43309 Test main.innodb can't be run twice Make the innodb mysql-test more flexible by inspecting how much a variable of interest has changed since the start of the test. Do not assume the variables have zero values at the start of the test. ------------------------------------------------------------------------ r4576 | vasil | 2009-03-30 16:25:10 +0300 (Mon, 30 Mar 2009) | 4 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Revert a change to Makefile.am that I committed accidentally in c4574. ------------------------------------------------------------------------ r4659 | vasil | 2009-04-06 15:34:51 +0300 (Mon, 06 Apr 2009) | 6 lines Changed paths: M /branches/5.1/mysql-test/innodb.test branches/5.1: Followup to r4575 and the fix of Bug#43309 Test main.innodb can't be run twice: Add an explanatory comment, as suggested by Patrick Crews in the bug report. ------------------------------------------------------------------------ r4699 | vasil | 2009-04-09 14:01:52 +0300 (Thu, 09 Apr 2009) | 15 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/srv0srv.h M /branches/5.1/page/page0cur.c M /branches/5.1/srv/srv0srv.c branches/5.1: Fix Bug#43660 SHOW INDEXES/ANALYZE does NOT update cardinality for indexes of InnoDB table by replacing the PRNG that is used to pick random pages with a better one. This is based on r4670 but also adds a new configuration option and enables the fix only if this option is changed. Please skip the present revision when merging. Approved by: Heikki (via email) ------------------------------------------------------------------------ r4705 | vasil | 2009-04-14 14:30:13 +0300 (Tue, 14 Apr 2009) | 5 lines Changed paths: M /branches/5.1/page/page0cur.c branches/5.1: When using the random function, first take the modulus by the number of pages and then typecast to ulint. ------------------------------------------------------------------------ r4710 | vasil | 2009-04-15 11:55:18 +0300 (Wed, 15 Apr 2009) | 25 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Merge a change from MySQL (looks like this is against 5.0 but they later merged it to 5.1): ------------------------------------------------------------ revno: 1810.3846.1 committer: Alexey Botchkov <holyfoot@mysql.com> branch nick: 31435 timestamp: Tue 2008-11-11 14:42:32 +0400 message: Bug#31435 ha_innodb.cc:3983: ulint convert_search_mode_to_innobase(ha_rkey_function): Asse I think we don't need to issue an error statement in the convert_search_mode_to_innobase(). Returning the PAGE_CUR_UNSUPP value is enough as allows to handle this case depending on the requirements. per-file comments: sql/ha_innodb.cc Bug#31435 ha_innodb.cc:3983: ulint convert_search_mode_to_innobase(ha_rkey_function): Asse no error issued in convert_search_mode_to_innobase. ha_innobase::records_in_range() returns HA_POS_ERROR if search mode isn't supported. modified: sql/ha_innodb.cc ------------------------------------------------------------------------
17 years ago
20 years ago
branches/zip: Merge revisions 4481:4710 from branches/5.1: (resolving conflict in r4574, r4575 and skipping r4699 and r4705 because analogous changes to r4699 and r4705 were already made to branches/zip) ------------------------------------------------------------------------ r4573 | vasil | 2009-03-30 14:17:13 +0300 (Mon, 30 Mar 2009) | 4 lines Changed paths: M /branches/5.1/mysql-test/innodb.test branches/5.1: Fix email address from dev@innodb.com to innodb_dev_ww@oracle.com ------------------------------------------------------------------------ r4574 | vasil | 2009-03-30 14:27:08 +0300 (Mon, 30 Mar 2009) | 38 lines Changed paths: M /branches/5.1/Makefile.am M /branches/5.1/mysql-test/innodb.test branches/5.1: Restore the state of INNODB_THREAD_CONCURRENCY to silence this warning: TEST RESULT TIME (ms) ------------------------------------------------------------ worker[1] Using MTR_BUILD_THREAD 250, with reserved ports 12500..12509 main.innodb [ pass ] 8803 MTR's internal check of the test case 'main.innodb' failed. This means that the test case does not preserve the state that existed before the test case was executed. Most likely the test case did not do a proper clean-up. This is the diff of the states of the servers before and after the test case was executed: mysqltest: Logging to '/tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.log'. mysqltest: Results saved in '/tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.result'. mysqltest: Connecting to server localhost:12500 (socket /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/mysqld.1.sock) as 'root', connection 'default', attempt 0 ... mysqltest: ... Connected. mysqltest: Start processing test commands from './include/check-testcase.test' ... mysqltest: ... Done processing test commands. --- /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.result 2009-03-30 14:12:31.000000000 +0300 +++ /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.reject 2009-03-30 14:12:41.000000000 +0300 @@ -99,7 +99,7 @@ INNODB_SUPPORT_XA ON INNODB_SYNC_SPIN_LOOPS 20 INNODB_TABLE_LOCKS ON -INNODB_THREAD_CONCURRENCY 8 +INNODB_THREAD_CONCURRENCY 16 INNODB_THREAD_SLEEP_DELAY 10000 INSERT_ID 0 INTERACTIVE_TIMEOUT 28800 mysqltest: Result content mismatch not ok ------------------------------------------------------------------------ r4575 | vasil | 2009-03-30 15:55:31 +0300 (Mon, 30 Mar 2009) | 8 lines Changed paths: M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Fix Bug#43309 Test main.innodb can't be run twice Make the innodb mysql-test more flexible by inspecting how much a variable of interest has changed since the start of the test. Do not assume the variables have zero values at the start of the test. ------------------------------------------------------------------------ r4576 | vasil | 2009-03-30 16:25:10 +0300 (Mon, 30 Mar 2009) | 4 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Revert a change to Makefile.am that I committed accidentally in c4574. ------------------------------------------------------------------------ r4659 | vasil | 2009-04-06 15:34:51 +0300 (Mon, 06 Apr 2009) | 6 lines Changed paths: M /branches/5.1/mysql-test/innodb.test branches/5.1: Followup to r4575 and the fix of Bug#43309 Test main.innodb can't be run twice: Add an explanatory comment, as suggested by Patrick Crews in the bug report. ------------------------------------------------------------------------ r4699 | vasil | 2009-04-09 14:01:52 +0300 (Thu, 09 Apr 2009) | 15 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/srv0srv.h M /branches/5.1/page/page0cur.c M /branches/5.1/srv/srv0srv.c branches/5.1: Fix Bug#43660 SHOW INDEXES/ANALYZE does NOT update cardinality for indexes of InnoDB table by replacing the PRNG that is used to pick random pages with a better one. This is based on r4670 but also adds a new configuration option and enables the fix only if this option is changed. Please skip the present revision when merging. Approved by: Heikki (via email) ------------------------------------------------------------------------ r4705 | vasil | 2009-04-14 14:30:13 +0300 (Tue, 14 Apr 2009) | 5 lines Changed paths: M /branches/5.1/page/page0cur.c branches/5.1: When using the random function, first take the modulus by the number of pages and then typecast to ulint. ------------------------------------------------------------------------ r4710 | vasil | 2009-04-15 11:55:18 +0300 (Wed, 15 Apr 2009) | 25 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Merge a change from MySQL (looks like this is against 5.0 but they later merged it to 5.1): ------------------------------------------------------------ revno: 1810.3846.1 committer: Alexey Botchkov <holyfoot@mysql.com> branch nick: 31435 timestamp: Tue 2008-11-11 14:42:32 +0400 message: Bug#31435 ha_innodb.cc:3983: ulint convert_search_mode_to_innobase(ha_rkey_function): Asse I think we don't need to issue an error statement in the convert_search_mode_to_innobase(). Returning the PAGE_CUR_UNSUPP value is enough as allows to handle this case depending on the requirements. per-file comments: sql/ha_innodb.cc Bug#31435 ha_innodb.cc:3983: ulint convert_search_mode_to_innobase(ha_rkey_function): Asse no error issued in convert_search_mode_to_innobase. ha_innobase::records_in_range() returns HA_POS_ERROR if search mode isn't supported. modified: sql/ha_innodb.cc ------------------------------------------------------------------------
17 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge 2744:2837 from branches/5.1 (skipping r2782 and r2826): ------------------------------------------------------------------------ r2832 | vasil | 2008-10-21 10:08:30 +0300 (Tue, 21 Oct 2008) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: In ha_innobase::info(): Replace sql_print_warning() which prints to mysqld error log with push_warning_printf() which sends the error message to the client. Suggested by: Marko, Sunny, Michael Objected by: Inaam ------------------------------------------------------------------------ r2837 | vasil | 2008-10-21 12:07:44 +0300 (Tue, 21 Oct 2008) | 32 lines Changed paths: M /branches/5.1/mysql-test/innodb-semi-consistent.result M /branches/5.1/mysql-test/innodb-semi-consistent.test M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Merge a change from MySQL (this fixes the failing innodb and innodb-semi-consistent tests): revno: 2757 committer: Georgi Kodinov <kgeorge@mysql.com> branch nick: B39812-5.1-5.1.29-rc timestamp: Fri 2008-10-03 15:24:19 +0300 message: Bug #39812: Make statement replication default for 5.1 (to match 5.0) Make STMT replication default for 5.1. Add a default of MIXED into the config files Fix the tests that needed MIXED replication mode. modified: mysql-test/include/mix1.inc mysql-test/r/innodb-semi-consistent.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/tx_isolation_func.result mysql-test/t/innodb-semi-consistent.test mysql-test/t/innodb.test mysql-test/t/tx_isolation_func.test sql/mysqld.cc support-files/my-huge.cnf.sh support-files/my-innodb-heavy-4G.cnf.sh support-files/my-large.cnf.sh support-files/my-medium.cnf.sh support-files/my-small.cnf.sh ------------------------------------------------------------------------
17 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge revisions 4481:4710 from branches/5.1: (resolving conflict in r4574, r4575 and skipping r4699 and r4705 because analogous changes to r4699 and r4705 were already made to branches/zip) ------------------------------------------------------------------------ r4573 | vasil | 2009-03-30 14:17:13 +0300 (Mon, 30 Mar 2009) | 4 lines Changed paths: M /branches/5.1/mysql-test/innodb.test branches/5.1: Fix email address from dev@innodb.com to innodb_dev_ww@oracle.com ------------------------------------------------------------------------ r4574 | vasil | 2009-03-30 14:27:08 +0300 (Mon, 30 Mar 2009) | 38 lines Changed paths: M /branches/5.1/Makefile.am M /branches/5.1/mysql-test/innodb.test branches/5.1: Restore the state of INNODB_THREAD_CONCURRENCY to silence this warning: TEST RESULT TIME (ms) ------------------------------------------------------------ worker[1] Using MTR_BUILD_THREAD 250, with reserved ports 12500..12509 main.innodb [ pass ] 8803 MTR's internal check of the test case 'main.innodb' failed. This means that the test case does not preserve the state that existed before the test case was executed. Most likely the test case did not do a proper clean-up. This is the diff of the states of the servers before and after the test case was executed: mysqltest: Logging to '/tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.log'. mysqltest: Results saved in '/tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.result'. mysqltest: Connecting to server localhost:12500 (socket /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/mysqld.1.sock) as 'root', connection 'default', attempt 0 ... mysqltest: ... Connected. mysqltest: Start processing test commands from './include/check-testcase.test' ... mysqltest: ... Done processing test commands. --- /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.result 2009-03-30 14:12:31.000000000 +0300 +++ /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.reject 2009-03-30 14:12:41.000000000 +0300 @@ -99,7 +99,7 @@ INNODB_SUPPORT_XA ON INNODB_SYNC_SPIN_LOOPS 20 INNODB_TABLE_LOCKS ON -INNODB_THREAD_CONCURRENCY 8 +INNODB_THREAD_CONCURRENCY 16 INNODB_THREAD_SLEEP_DELAY 10000 INSERT_ID 0 INTERACTIVE_TIMEOUT 28800 mysqltest: Result content mismatch not ok ------------------------------------------------------------------------ r4575 | vasil | 2009-03-30 15:55:31 +0300 (Mon, 30 Mar 2009) | 8 lines Changed paths: M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Fix Bug#43309 Test main.innodb can't be run twice Make the innodb mysql-test more flexible by inspecting how much a variable of interest has changed since the start of the test. Do not assume the variables have zero values at the start of the test. ------------------------------------------------------------------------ r4576 | vasil | 2009-03-30 16:25:10 +0300 (Mon, 30 Mar 2009) | 4 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Revert a change to Makefile.am that I committed accidentally in c4574. ------------------------------------------------------------------------ r4659 | vasil | 2009-04-06 15:34:51 +0300 (Mon, 06 Apr 2009) | 6 lines Changed paths: M /branches/5.1/mysql-test/innodb.test branches/5.1: Followup to r4575 and the fix of Bug#43309 Test main.innodb can't be run twice: Add an explanatory comment, as suggested by Patrick Crews in the bug report. ------------------------------------------------------------------------ r4699 | vasil | 2009-04-09 14:01:52 +0300 (Thu, 09 Apr 2009) | 15 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/srv0srv.h M /branches/5.1/page/page0cur.c M /branches/5.1/srv/srv0srv.c branches/5.1: Fix Bug#43660 SHOW INDEXES/ANALYZE does NOT update cardinality for indexes of InnoDB table by replacing the PRNG that is used to pick random pages with a better one. This is based on r4670 but also adds a new configuration option and enables the fix only if this option is changed. Please skip the present revision when merging. Approved by: Heikki (via email) ------------------------------------------------------------------------ r4705 | vasil | 2009-04-14 14:30:13 +0300 (Tue, 14 Apr 2009) | 5 lines Changed paths: M /branches/5.1/page/page0cur.c branches/5.1: When using the random function, first take the modulus by the number of pages and then typecast to ulint. ------------------------------------------------------------------------ r4710 | vasil | 2009-04-15 11:55:18 +0300 (Wed, 15 Apr 2009) | 25 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Merge a change from MySQL (looks like this is against 5.0 but they later merged it to 5.1): ------------------------------------------------------------ revno: 1810.3846.1 committer: Alexey Botchkov <holyfoot@mysql.com> branch nick: 31435 timestamp: Tue 2008-11-11 14:42:32 +0400 message: Bug#31435 ha_innodb.cc:3983: ulint convert_search_mode_to_innobase(ha_rkey_function): Asse I think we don't need to issue an error statement in the convert_search_mode_to_innobase(). Returning the PAGE_CUR_UNSUPP value is enough as allows to handle this case depending on the requirements. per-file comments: sql/ha_innodb.cc Bug#31435 ha_innodb.cc:3983: ulint convert_search_mode_to_innobase(ha_rkey_function): Asse no error issued in convert_search_mode_to_innobase. ha_innobase::records_in_range() returns HA_POS_ERROR if search mode isn't supported. modified: sql/ha_innodb.cc ------------------------------------------------------------------------
17 years ago
20 years ago
branches/zip: Merge revisions 4481:4710 from branches/5.1: (resolving conflict in r4574, r4575 and skipping r4699 and r4705 because analogous changes to r4699 and r4705 were already made to branches/zip) ------------------------------------------------------------------------ r4573 | vasil | 2009-03-30 14:17:13 +0300 (Mon, 30 Mar 2009) | 4 lines Changed paths: M /branches/5.1/mysql-test/innodb.test branches/5.1: Fix email address from dev@innodb.com to innodb_dev_ww@oracle.com ------------------------------------------------------------------------ r4574 | vasil | 2009-03-30 14:27:08 +0300 (Mon, 30 Mar 2009) | 38 lines Changed paths: M /branches/5.1/Makefile.am M /branches/5.1/mysql-test/innodb.test branches/5.1: Restore the state of INNODB_THREAD_CONCURRENCY to silence this warning: TEST RESULT TIME (ms) ------------------------------------------------------------ worker[1] Using MTR_BUILD_THREAD 250, with reserved ports 12500..12509 main.innodb [ pass ] 8803 MTR's internal check of the test case 'main.innodb' failed. This means that the test case does not preserve the state that existed before the test case was executed. Most likely the test case did not do a proper clean-up. This is the diff of the states of the servers before and after the test case was executed: mysqltest: Logging to '/tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.log'. mysqltest: Results saved in '/tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.result'. mysqltest: Connecting to server localhost:12500 (socket /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/mysqld.1.sock) as 'root', connection 'default', attempt 0 ... mysqltest: ... Connected. mysqltest: Start processing test commands from './include/check-testcase.test' ... mysqltest: ... Done processing test commands. --- /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.result 2009-03-30 14:12:31.000000000 +0300 +++ /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.reject 2009-03-30 14:12:41.000000000 +0300 @@ -99,7 +99,7 @@ INNODB_SUPPORT_XA ON INNODB_SYNC_SPIN_LOOPS 20 INNODB_TABLE_LOCKS ON -INNODB_THREAD_CONCURRENCY 8 +INNODB_THREAD_CONCURRENCY 16 INNODB_THREAD_SLEEP_DELAY 10000 INSERT_ID 0 INTERACTIVE_TIMEOUT 28800 mysqltest: Result content mismatch not ok ------------------------------------------------------------------------ r4575 | vasil | 2009-03-30 15:55:31 +0300 (Mon, 30 Mar 2009) | 8 lines Changed paths: M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Fix Bug#43309 Test main.innodb can't be run twice Make the innodb mysql-test more flexible by inspecting how much a variable of interest has changed since the start of the test. Do not assume the variables have zero values at the start of the test. ------------------------------------------------------------------------ r4576 | vasil | 2009-03-30 16:25:10 +0300 (Mon, 30 Mar 2009) | 4 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Revert a change to Makefile.am that I committed accidentally in c4574. ------------------------------------------------------------------------ r4659 | vasil | 2009-04-06 15:34:51 +0300 (Mon, 06 Apr 2009) | 6 lines Changed paths: M /branches/5.1/mysql-test/innodb.test branches/5.1: Followup to r4575 and the fix of Bug#43309 Test main.innodb can't be run twice: Add an explanatory comment, as suggested by Patrick Crews in the bug report. ------------------------------------------------------------------------ r4699 | vasil | 2009-04-09 14:01:52 +0300 (Thu, 09 Apr 2009) | 15 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/srv0srv.h M /branches/5.1/page/page0cur.c M /branches/5.1/srv/srv0srv.c branches/5.1: Fix Bug#43660 SHOW INDEXES/ANALYZE does NOT update cardinality for indexes of InnoDB table by replacing the PRNG that is used to pick random pages with a better one. This is based on r4670 but also adds a new configuration option and enables the fix only if this option is changed. Please skip the present revision when merging. Approved by: Heikki (via email) ------------------------------------------------------------------------ r4705 | vasil | 2009-04-14 14:30:13 +0300 (Tue, 14 Apr 2009) | 5 lines Changed paths: M /branches/5.1/page/page0cur.c branches/5.1: When using the random function, first take the modulus by the number of pages and then typecast to ulint. ------------------------------------------------------------------------ r4710 | vasil | 2009-04-15 11:55:18 +0300 (Wed, 15 Apr 2009) | 25 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Merge a change from MySQL (looks like this is against 5.0 but they later merged it to 5.1): ------------------------------------------------------------ revno: 1810.3846.1 committer: Alexey Botchkov <holyfoot@mysql.com> branch nick: 31435 timestamp: Tue 2008-11-11 14:42:32 +0400 message: Bug#31435 ha_innodb.cc:3983: ulint convert_search_mode_to_innobase(ha_rkey_function): Asse I think we don't need to issue an error statement in the convert_search_mode_to_innobase(). Returning the PAGE_CUR_UNSUPP value is enough as allows to handle this case depending on the requirements. per-file comments: sql/ha_innodb.cc Bug#31435 ha_innodb.cc:3983: ulint convert_search_mode_to_innobase(ha_rkey_function): Asse no error issued in convert_search_mode_to_innobase. ha_innobase::records_in_range() returns HA_POS_ERROR if search mode isn't supported. modified: sql/ha_innodb.cc ------------------------------------------------------------------------
17 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
20 years ago
branches/zip: Merge 2744:2837 from branches/5.1 (skipping r2782 and r2826): ------------------------------------------------------------------------ r2832 | vasil | 2008-10-21 10:08:30 +0300 (Tue, 21 Oct 2008) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: In ha_innobase::info(): Replace sql_print_warning() which prints to mysqld error log with push_warning_printf() which sends the error message to the client. Suggested by: Marko, Sunny, Michael Objected by: Inaam ------------------------------------------------------------------------ r2837 | vasil | 2008-10-21 12:07:44 +0300 (Tue, 21 Oct 2008) | 32 lines Changed paths: M /branches/5.1/mysql-test/innodb-semi-consistent.result M /branches/5.1/mysql-test/innodb-semi-consistent.test M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Merge a change from MySQL (this fixes the failing innodb and innodb-semi-consistent tests): revno: 2757 committer: Georgi Kodinov <kgeorge@mysql.com> branch nick: B39812-5.1-5.1.29-rc timestamp: Fri 2008-10-03 15:24:19 +0300 message: Bug #39812: Make statement replication default for 5.1 (to match 5.0) Make STMT replication default for 5.1. Add a default of MIXED into the config files Fix the tests that needed MIXED replication mode. modified: mysql-test/include/mix1.inc mysql-test/r/innodb-semi-consistent.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/tx_isolation_func.result mysql-test/t/innodb-semi-consistent.test mysql-test/t/innodb.test mysql-test/t/tx_isolation_func.test sql/mysqld.cc support-files/my-huge.cnf.sh support-files/my-innodb-heavy-4G.cnf.sh support-files/my-large.cnf.sh support-files/my-medium.cnf.sh support-files/my-small.cnf.sh ------------------------------------------------------------------------
17 years ago
branches/zip: Merge 2744:2837 from branches/5.1 (skipping r2782 and r2826): ------------------------------------------------------------------------ r2832 | vasil | 2008-10-21 10:08:30 +0300 (Tue, 21 Oct 2008) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: In ha_innobase::info(): Replace sql_print_warning() which prints to mysqld error log with push_warning_printf() which sends the error message to the client. Suggested by: Marko, Sunny, Michael Objected by: Inaam ------------------------------------------------------------------------ r2837 | vasil | 2008-10-21 12:07:44 +0300 (Tue, 21 Oct 2008) | 32 lines Changed paths: M /branches/5.1/mysql-test/innodb-semi-consistent.result M /branches/5.1/mysql-test/innodb-semi-consistent.test M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Merge a change from MySQL (this fixes the failing innodb and innodb-semi-consistent tests): revno: 2757 committer: Georgi Kodinov <kgeorge@mysql.com> branch nick: B39812-5.1-5.1.29-rc timestamp: Fri 2008-10-03 15:24:19 +0300 message: Bug #39812: Make statement replication default for 5.1 (to match 5.0) Make STMT replication default for 5.1. Add a default of MIXED into the config files Fix the tests that needed MIXED replication mode. modified: mysql-test/include/mix1.inc mysql-test/r/innodb-semi-consistent.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/tx_isolation_func.result mysql-test/t/innodb-semi-consistent.test mysql-test/t/innodb.test mysql-test/t/tx_isolation_func.test sql/mysqld.cc support-files/my-huge.cnf.sh support-files/my-innodb-heavy-4G.cnf.sh support-files/my-large.cnf.sh support-files/my-medium.cnf.sh support-files/my-small.cnf.sh ------------------------------------------------------------------------
17 years ago
branches/zip: Merge 2744:2837 from branches/5.1 (skipping r2782 and r2826): ------------------------------------------------------------------------ r2832 | vasil | 2008-10-21 10:08:30 +0300 (Tue, 21 Oct 2008) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: In ha_innobase::info(): Replace sql_print_warning() which prints to mysqld error log with push_warning_printf() which sends the error message to the client. Suggested by: Marko, Sunny, Michael Objected by: Inaam ------------------------------------------------------------------------ r2837 | vasil | 2008-10-21 12:07:44 +0300 (Tue, 21 Oct 2008) | 32 lines Changed paths: M /branches/5.1/mysql-test/innodb-semi-consistent.result M /branches/5.1/mysql-test/innodb-semi-consistent.test M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Merge a change from MySQL (this fixes the failing innodb and innodb-semi-consistent tests): revno: 2757 committer: Georgi Kodinov <kgeorge@mysql.com> branch nick: B39812-5.1-5.1.29-rc timestamp: Fri 2008-10-03 15:24:19 +0300 message: Bug #39812: Make statement replication default for 5.1 (to match 5.0) Make STMT replication default for 5.1. Add a default of MIXED into the config files Fix the tests that needed MIXED replication mode. modified: mysql-test/include/mix1.inc mysql-test/r/innodb-semi-consistent.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/tx_isolation_func.result mysql-test/t/innodb-semi-consistent.test mysql-test/t/innodb.test mysql-test/t/tx_isolation_func.test sql/mysqld.cc support-files/my-huge.cnf.sh support-files/my-innodb-heavy-4G.cnf.sh support-files/my-large.cnf.sh support-files/my-medium.cnf.sh support-files/my-small.cnf.sh ------------------------------------------------------------------------
17 years ago
branches/zip: Merge 2744:2837 from branches/5.1 (skipping r2782 and r2826): ------------------------------------------------------------------------ r2832 | vasil | 2008-10-21 10:08:30 +0300 (Tue, 21 Oct 2008) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: In ha_innobase::info(): Replace sql_print_warning() which prints to mysqld error log with push_warning_printf() which sends the error message to the client. Suggested by: Marko, Sunny, Michael Objected by: Inaam ------------------------------------------------------------------------ r2837 | vasil | 2008-10-21 12:07:44 +0300 (Tue, 21 Oct 2008) | 32 lines Changed paths: M /branches/5.1/mysql-test/innodb-semi-consistent.result M /branches/5.1/mysql-test/innodb-semi-consistent.test M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Merge a change from MySQL (this fixes the failing innodb and innodb-semi-consistent tests): revno: 2757 committer: Georgi Kodinov <kgeorge@mysql.com> branch nick: B39812-5.1-5.1.29-rc timestamp: Fri 2008-10-03 15:24:19 +0300 message: Bug #39812: Make statement replication default for 5.1 (to match 5.0) Make STMT replication default for 5.1. Add a default of MIXED into the config files Fix the tests that needed MIXED replication mode. modified: mysql-test/include/mix1.inc mysql-test/r/innodb-semi-consistent.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/tx_isolation_func.result mysql-test/t/innodb-semi-consistent.test mysql-test/t/innodb.test mysql-test/t/tx_isolation_func.test sql/mysqld.cc support-files/my-huge.cnf.sh support-files/my-innodb-heavy-4G.cnf.sh support-files/my-large.cnf.sh support-files/my-medium.cnf.sh support-files/my-small.cnf.sh ------------------------------------------------------------------------
17 years ago
branches/zip: Merge 2744:2837 from branches/5.1 (skipping r2782 and r2826): ------------------------------------------------------------------------ r2832 | vasil | 2008-10-21 10:08:30 +0300 (Tue, 21 Oct 2008) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: In ha_innobase::info(): Replace sql_print_warning() which prints to mysqld error log with push_warning_printf() which sends the error message to the client. Suggested by: Marko, Sunny, Michael Objected by: Inaam ------------------------------------------------------------------------ r2837 | vasil | 2008-10-21 12:07:44 +0300 (Tue, 21 Oct 2008) | 32 lines Changed paths: M /branches/5.1/mysql-test/innodb-semi-consistent.result M /branches/5.1/mysql-test/innodb-semi-consistent.test M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Merge a change from MySQL (this fixes the failing innodb and innodb-semi-consistent tests): revno: 2757 committer: Georgi Kodinov <kgeorge@mysql.com> branch nick: B39812-5.1-5.1.29-rc timestamp: Fri 2008-10-03 15:24:19 +0300 message: Bug #39812: Make statement replication default for 5.1 (to match 5.0) Make STMT replication default for 5.1. Add a default of MIXED into the config files Fix the tests that needed MIXED replication mode. modified: mysql-test/include/mix1.inc mysql-test/r/innodb-semi-consistent.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/tx_isolation_func.result mysql-test/t/innodb-semi-consistent.test mysql-test/t/innodb.test mysql-test/t/tx_isolation_func.test sql/mysqld.cc support-files/my-huge.cnf.sh support-files/my-innodb-heavy-4G.cnf.sh support-files/my-large.cnf.sh support-files/my-medium.cnf.sh support-files/my-small.cnf.sh ------------------------------------------------------------------------
17 years ago
branches/zip: Merge 2744:2837 from branches/5.1 (skipping r2782 and r2826): ------------------------------------------------------------------------ r2832 | vasil | 2008-10-21 10:08:30 +0300 (Tue, 21 Oct 2008) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: In ha_innobase::info(): Replace sql_print_warning() which prints to mysqld error log with push_warning_printf() which sends the error message to the client. Suggested by: Marko, Sunny, Michael Objected by: Inaam ------------------------------------------------------------------------ r2837 | vasil | 2008-10-21 12:07:44 +0300 (Tue, 21 Oct 2008) | 32 lines Changed paths: M /branches/5.1/mysql-test/innodb-semi-consistent.result M /branches/5.1/mysql-test/innodb-semi-consistent.test M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Merge a change from MySQL (this fixes the failing innodb and innodb-semi-consistent tests): revno: 2757 committer: Georgi Kodinov <kgeorge@mysql.com> branch nick: B39812-5.1-5.1.29-rc timestamp: Fri 2008-10-03 15:24:19 +0300 message: Bug #39812: Make statement replication default for 5.1 (to match 5.0) Make STMT replication default for 5.1. Add a default of MIXED into the config files Fix the tests that needed MIXED replication mode. modified: mysql-test/include/mix1.inc mysql-test/r/innodb-semi-consistent.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/tx_isolation_func.result mysql-test/t/innodb-semi-consistent.test mysql-test/t/innodb.test mysql-test/t/tx_isolation_func.test sql/mysqld.cc support-files/my-huge.cnf.sh support-files/my-innodb-heavy-4G.cnf.sh support-files/my-large.cnf.sh support-files/my-medium.cnf.sh support-files/my-small.cnf.sh ------------------------------------------------------------------------
17 years ago
branches/zip: Merge 2744:2837 from branches/5.1 (skipping r2782 and r2826): ------------------------------------------------------------------------ r2832 | vasil | 2008-10-21 10:08:30 +0300 (Tue, 21 Oct 2008) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: In ha_innobase::info(): Replace sql_print_warning() which prints to mysqld error log with push_warning_printf() which sends the error message to the client. Suggested by: Marko, Sunny, Michael Objected by: Inaam ------------------------------------------------------------------------ r2837 | vasil | 2008-10-21 12:07:44 +0300 (Tue, 21 Oct 2008) | 32 lines Changed paths: M /branches/5.1/mysql-test/innodb-semi-consistent.result M /branches/5.1/mysql-test/innodb-semi-consistent.test M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Merge a change from MySQL (this fixes the failing innodb and innodb-semi-consistent tests): revno: 2757 committer: Georgi Kodinov <kgeorge@mysql.com> branch nick: B39812-5.1-5.1.29-rc timestamp: Fri 2008-10-03 15:24:19 +0300 message: Bug #39812: Make statement replication default for 5.1 (to match 5.0) Make STMT replication default for 5.1. Add a default of MIXED into the config files Fix the tests that needed MIXED replication mode. modified: mysql-test/include/mix1.inc mysql-test/r/innodb-semi-consistent.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/tx_isolation_func.result mysql-test/t/innodb-semi-consistent.test mysql-test/t/innodb.test mysql-test/t/tx_isolation_func.test sql/mysqld.cc support-files/my-huge.cnf.sh support-files/my-innodb-heavy-4G.cnf.sh support-files/my-large.cnf.sh support-files/my-medium.cnf.sh support-files/my-small.cnf.sh ------------------------------------------------------------------------
17 years ago
branches/zip: Merge 2744:2837 from branches/5.1 (skipping r2782 and r2826): ------------------------------------------------------------------------ r2832 | vasil | 2008-10-21 10:08:30 +0300 (Tue, 21 Oct 2008) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: In ha_innobase::info(): Replace sql_print_warning() which prints to mysqld error log with push_warning_printf() which sends the error message to the client. Suggested by: Marko, Sunny, Michael Objected by: Inaam ------------------------------------------------------------------------ r2837 | vasil | 2008-10-21 12:07:44 +0300 (Tue, 21 Oct 2008) | 32 lines Changed paths: M /branches/5.1/mysql-test/innodb-semi-consistent.result M /branches/5.1/mysql-test/innodb-semi-consistent.test M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Merge a change from MySQL (this fixes the failing innodb and innodb-semi-consistent tests): revno: 2757 committer: Georgi Kodinov <kgeorge@mysql.com> branch nick: B39812-5.1-5.1.29-rc timestamp: Fri 2008-10-03 15:24:19 +0300 message: Bug #39812: Make statement replication default for 5.1 (to match 5.0) Make STMT replication default for 5.1. Add a default of MIXED into the config files Fix the tests that needed MIXED replication mode. modified: mysql-test/include/mix1.inc mysql-test/r/innodb-semi-consistent.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/tx_isolation_func.result mysql-test/t/innodb-semi-consistent.test mysql-test/t/innodb.test mysql-test/t/tx_isolation_func.test sql/mysqld.cc support-files/my-huge.cnf.sh support-files/my-innodb-heavy-4G.cnf.sh support-files/my-large.cnf.sh support-files/my-medium.cnf.sh support-files/my-small.cnf.sh ------------------------------------------------------------------------
17 years ago
branches/zip: Merge 2744:2837 from branches/5.1 (skipping r2782 and r2826): ------------------------------------------------------------------------ r2832 | vasil | 2008-10-21 10:08:30 +0300 (Tue, 21 Oct 2008) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: In ha_innobase::info(): Replace sql_print_warning() which prints to mysqld error log with push_warning_printf() which sends the error message to the client. Suggested by: Marko, Sunny, Michael Objected by: Inaam ------------------------------------------------------------------------ r2837 | vasil | 2008-10-21 12:07:44 +0300 (Tue, 21 Oct 2008) | 32 lines Changed paths: M /branches/5.1/mysql-test/innodb-semi-consistent.result M /branches/5.1/mysql-test/innodb-semi-consistent.test M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Merge a change from MySQL (this fixes the failing innodb and innodb-semi-consistent tests): revno: 2757 committer: Georgi Kodinov <kgeorge@mysql.com> branch nick: B39812-5.1-5.1.29-rc timestamp: Fri 2008-10-03 15:24:19 +0300 message: Bug #39812: Make statement replication default for 5.1 (to match 5.0) Make STMT replication default for 5.1. Add a default of MIXED into the config files Fix the tests that needed MIXED replication mode. modified: mysql-test/include/mix1.inc mysql-test/r/innodb-semi-consistent.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/tx_isolation_func.result mysql-test/t/innodb-semi-consistent.test mysql-test/t/innodb.test mysql-test/t/tx_isolation_func.test sql/mysqld.cc support-files/my-huge.cnf.sh support-files/my-innodb-heavy-4G.cnf.sh support-files/my-large.cnf.sh support-files/my-medium.cnf.sh support-files/my-small.cnf.sh ------------------------------------------------------------------------
17 years ago
branches/zip: Merge 2744:2837 from branches/5.1 (skipping r2782 and r2826): ------------------------------------------------------------------------ r2832 | vasil | 2008-10-21 10:08:30 +0300 (Tue, 21 Oct 2008) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: In ha_innobase::info(): Replace sql_print_warning() which prints to mysqld error log with push_warning_printf() which sends the error message to the client. Suggested by: Marko, Sunny, Michael Objected by: Inaam ------------------------------------------------------------------------ r2837 | vasil | 2008-10-21 12:07:44 +0300 (Tue, 21 Oct 2008) | 32 lines Changed paths: M /branches/5.1/mysql-test/innodb-semi-consistent.result M /branches/5.1/mysql-test/innodb-semi-consistent.test M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Merge a change from MySQL (this fixes the failing innodb and innodb-semi-consistent tests): revno: 2757 committer: Georgi Kodinov <kgeorge@mysql.com> branch nick: B39812-5.1-5.1.29-rc timestamp: Fri 2008-10-03 15:24:19 +0300 message: Bug #39812: Make statement replication default for 5.1 (to match 5.0) Make STMT replication default for 5.1. Add a default of MIXED into the config files Fix the tests that needed MIXED replication mode. modified: mysql-test/include/mix1.inc mysql-test/r/innodb-semi-consistent.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/tx_isolation_func.result mysql-test/t/innodb-semi-consistent.test mysql-test/t/innodb.test mysql-test/t/tx_isolation_func.test sql/mysqld.cc support-files/my-huge.cnf.sh support-files/my-innodb-heavy-4G.cnf.sh support-files/my-large.cnf.sh support-files/my-medium.cnf.sh support-files/my-small.cnf.sh ------------------------------------------------------------------------
17 years ago
branches/zip: Merge 2744:2837 from branches/5.1 (skipping r2782 and r2826): ------------------------------------------------------------------------ r2832 | vasil | 2008-10-21 10:08:30 +0300 (Tue, 21 Oct 2008) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: In ha_innobase::info(): Replace sql_print_warning() which prints to mysqld error log with push_warning_printf() which sends the error message to the client. Suggested by: Marko, Sunny, Michael Objected by: Inaam ------------------------------------------------------------------------ r2837 | vasil | 2008-10-21 12:07:44 +0300 (Tue, 21 Oct 2008) | 32 lines Changed paths: M /branches/5.1/mysql-test/innodb-semi-consistent.result M /branches/5.1/mysql-test/innodb-semi-consistent.test M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Merge a change from MySQL (this fixes the failing innodb and innodb-semi-consistent tests): revno: 2757 committer: Georgi Kodinov <kgeorge@mysql.com> branch nick: B39812-5.1-5.1.29-rc timestamp: Fri 2008-10-03 15:24:19 +0300 message: Bug #39812: Make statement replication default for 5.1 (to match 5.0) Make STMT replication default for 5.1. Add a default of MIXED into the config files Fix the tests that needed MIXED replication mode. modified: mysql-test/include/mix1.inc mysql-test/r/innodb-semi-consistent.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/tx_isolation_func.result mysql-test/t/innodb-semi-consistent.test mysql-test/t/innodb.test mysql-test/t/tx_isolation_func.test sql/mysqld.cc support-files/my-huge.cnf.sh support-files/my-innodb-heavy-4G.cnf.sh support-files/my-large.cnf.sh support-files/my-medium.cnf.sh support-files/my-small.cnf.sh ------------------------------------------------------------------------
17 years ago
branches/zip: Merge 2744:2837 from branches/5.1 (skipping r2782 and r2826): ------------------------------------------------------------------------ r2832 | vasil | 2008-10-21 10:08:30 +0300 (Tue, 21 Oct 2008) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: In ha_innobase::info(): Replace sql_print_warning() which prints to mysqld error log with push_warning_printf() which sends the error message to the client. Suggested by: Marko, Sunny, Michael Objected by: Inaam ------------------------------------------------------------------------ r2837 | vasil | 2008-10-21 12:07:44 +0300 (Tue, 21 Oct 2008) | 32 lines Changed paths: M /branches/5.1/mysql-test/innodb-semi-consistent.result M /branches/5.1/mysql-test/innodb-semi-consistent.test M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Merge a change from MySQL (this fixes the failing innodb and innodb-semi-consistent tests): revno: 2757 committer: Georgi Kodinov <kgeorge@mysql.com> branch nick: B39812-5.1-5.1.29-rc timestamp: Fri 2008-10-03 15:24:19 +0300 message: Bug #39812: Make statement replication default for 5.1 (to match 5.0) Make STMT replication default for 5.1. Add a default of MIXED into the config files Fix the tests that needed MIXED replication mode. modified: mysql-test/include/mix1.inc mysql-test/r/innodb-semi-consistent.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/tx_isolation_func.result mysql-test/t/innodb-semi-consistent.test mysql-test/t/innodb.test mysql-test/t/tx_isolation_func.test sql/mysqld.cc support-files/my-huge.cnf.sh support-files/my-innodb-heavy-4G.cnf.sh support-files/my-large.cnf.sh support-files/my-medium.cnf.sh support-files/my-small.cnf.sh ------------------------------------------------------------------------
17 years ago
branches/zip: Merge 2744:2837 from branches/5.1 (skipping r2782 and r2826): ------------------------------------------------------------------------ r2832 | vasil | 2008-10-21 10:08:30 +0300 (Tue, 21 Oct 2008) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: In ha_innobase::info(): Replace sql_print_warning() which prints to mysqld error log with push_warning_printf() which sends the error message to the client. Suggested by: Marko, Sunny, Michael Objected by: Inaam ------------------------------------------------------------------------ r2837 | vasil | 2008-10-21 12:07:44 +0300 (Tue, 21 Oct 2008) | 32 lines Changed paths: M /branches/5.1/mysql-test/innodb-semi-consistent.result M /branches/5.1/mysql-test/innodb-semi-consistent.test M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Merge a change from MySQL (this fixes the failing innodb and innodb-semi-consistent tests): revno: 2757 committer: Georgi Kodinov <kgeorge@mysql.com> branch nick: B39812-5.1-5.1.29-rc timestamp: Fri 2008-10-03 15:24:19 +0300 message: Bug #39812: Make statement replication default for 5.1 (to match 5.0) Make STMT replication default for 5.1. Add a default of MIXED into the config files Fix the tests that needed MIXED replication mode. modified: mysql-test/include/mix1.inc mysql-test/r/innodb-semi-consistent.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/tx_isolation_func.result mysql-test/t/innodb-semi-consistent.test mysql-test/t/innodb.test mysql-test/t/tx_isolation_func.test sql/mysqld.cc support-files/my-huge.cnf.sh support-files/my-innodb-heavy-4G.cnf.sh support-files/my-large.cnf.sh support-files/my-medium.cnf.sh support-files/my-small.cnf.sh ------------------------------------------------------------------------
17 years ago
branches/zip: Merge 2744:2837 from branches/5.1 (skipping r2782 and r2826): ------------------------------------------------------------------------ r2832 | vasil | 2008-10-21 10:08:30 +0300 (Tue, 21 Oct 2008) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: In ha_innobase::info(): Replace sql_print_warning() which prints to mysqld error log with push_warning_printf() which sends the error message to the client. Suggested by: Marko, Sunny, Michael Objected by: Inaam ------------------------------------------------------------------------ r2837 | vasil | 2008-10-21 12:07:44 +0300 (Tue, 21 Oct 2008) | 32 lines Changed paths: M /branches/5.1/mysql-test/innodb-semi-consistent.result M /branches/5.1/mysql-test/innodb-semi-consistent.test M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Merge a change from MySQL (this fixes the failing innodb and innodb-semi-consistent tests): revno: 2757 committer: Georgi Kodinov <kgeorge@mysql.com> branch nick: B39812-5.1-5.1.29-rc timestamp: Fri 2008-10-03 15:24:19 +0300 message: Bug #39812: Make statement replication default for 5.1 (to match 5.0) Make STMT replication default for 5.1. Add a default of MIXED into the config files Fix the tests that needed MIXED replication mode. modified: mysql-test/include/mix1.inc mysql-test/r/innodb-semi-consistent.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/tx_isolation_func.result mysql-test/t/innodb-semi-consistent.test mysql-test/t/innodb.test mysql-test/t/tx_isolation_func.test sql/mysqld.cc support-files/my-huge.cnf.sh support-files/my-innodb-heavy-4G.cnf.sh support-files/my-large.cnf.sh support-files/my-medium.cnf.sh support-files/my-small.cnf.sh ------------------------------------------------------------------------
17 years ago
branches/zip: Merge 2744:2837 from branches/5.1 (skipping r2782 and r2826): ------------------------------------------------------------------------ r2832 | vasil | 2008-10-21 10:08:30 +0300 (Tue, 21 Oct 2008) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: In ha_innobase::info(): Replace sql_print_warning() which prints to mysqld error log with push_warning_printf() which sends the error message to the client. Suggested by: Marko, Sunny, Michael Objected by: Inaam ------------------------------------------------------------------------ r2837 | vasil | 2008-10-21 12:07:44 +0300 (Tue, 21 Oct 2008) | 32 lines Changed paths: M /branches/5.1/mysql-test/innodb-semi-consistent.result M /branches/5.1/mysql-test/innodb-semi-consistent.test M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Merge a change from MySQL (this fixes the failing innodb and innodb-semi-consistent tests): revno: 2757 committer: Georgi Kodinov <kgeorge@mysql.com> branch nick: B39812-5.1-5.1.29-rc timestamp: Fri 2008-10-03 15:24:19 +0300 message: Bug #39812: Make statement replication default for 5.1 (to match 5.0) Make STMT replication default for 5.1. Add a default of MIXED into the config files Fix the tests that needed MIXED replication mode. modified: mysql-test/include/mix1.inc mysql-test/r/innodb-semi-consistent.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/tx_isolation_func.result mysql-test/t/innodb-semi-consistent.test mysql-test/t/innodb.test mysql-test/t/tx_isolation_func.test sql/mysqld.cc support-files/my-huge.cnf.sh support-files/my-innodb-heavy-4G.cnf.sh support-files/my-large.cnf.sh support-files/my-medium.cnf.sh support-files/my-small.cnf.sh ------------------------------------------------------------------------
17 years ago
branches/zip: Merge 2744:2837 from branches/5.1 (skipping r2782 and r2826): ------------------------------------------------------------------------ r2832 | vasil | 2008-10-21 10:08:30 +0300 (Tue, 21 Oct 2008) | 10 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: In ha_innobase::info(): Replace sql_print_warning() which prints to mysqld error log with push_warning_printf() which sends the error message to the client. Suggested by: Marko, Sunny, Michael Objected by: Inaam ------------------------------------------------------------------------ r2837 | vasil | 2008-10-21 12:07:44 +0300 (Tue, 21 Oct 2008) | 32 lines Changed paths: M /branches/5.1/mysql-test/innodb-semi-consistent.result M /branches/5.1/mysql-test/innodb-semi-consistent.test M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Merge a change from MySQL (this fixes the failing innodb and innodb-semi-consistent tests): revno: 2757 committer: Georgi Kodinov <kgeorge@mysql.com> branch nick: B39812-5.1-5.1.29-rc timestamp: Fri 2008-10-03 15:24:19 +0300 message: Bug #39812: Make statement replication default for 5.1 (to match 5.0) Make STMT replication default for 5.1. Add a default of MIXED into the config files Fix the tests that needed MIXED replication mode. modified: mysql-test/include/mix1.inc mysql-test/r/innodb-semi-consistent.result mysql-test/r/innodb.result mysql-test/r/innodb_mysql.result mysql-test/r/tx_isolation_func.result mysql-test/t/innodb-semi-consistent.test mysql-test/t/innodb.test mysql-test/t/tx_isolation_func.test sql/mysqld.cc support-files/my-huge.cnf.sh support-files/my-innodb-heavy-4G.cnf.sh support-files/my-large.cnf.sh support-files/my-medium.cnf.sh support-files/my-small.cnf.sh ------------------------------------------------------------------------
17 years ago
branches/zip: Merge 2384:2423 from branches/5.1: ------------------------------------------------------------------------ r2386 | vasil | 2008-03-27 07:45:02 +0200 (Thu, 27 Mar 2008) | 22 lines branches/5.1: Merge change from MySQL (this fixes the failing innodb test): ChangeSet@1.1810.3601.4, 2008-02-07 02:33:21+04:00, gshchepa@host.loc +9 -0 Fixed bug#30059. Server handles truncation for assignment of too-long values into CHAR/VARCHAR/TEXT columns in a different ways when the truncated characters are spaces: 1. CHAR(N) columns silently ignore end-space truncation; 2. TEXT columns post a truncation warning/error in the non-strict/strict mode. 3. VARCHAR columns always post a truncation note in any mode. Space truncation processing has been synchronised over CHAR/VARCHAR/TEXT columns: current behavior of VARCHAR columns has been propagated as standard. Binary-encoded string/BLOB columns are not affected. ------------------------------------------------------------------------ r2387 | vasil | 2008-03-27 08:49:05 +0200 (Thu, 27 Mar 2008) | 8 lines branches/5.1: Check whether *trx->mysql_query_str is != NULL in addition to trx->mysql_query_str. This adds more safety. This may or may not fix Bug#35226 RBR event crashes slave. ------------------------------------------------------------------------ r2388 | vasil | 2008-03-27 14:02:34 +0200 (Thu, 27 Mar 2008) | 7 lines branches/5.1: Swap the order in which mysql_thd, mysql_query_str and *mysql_query_str are checked for non-NULL. Suggested by: Marko ------------------------------------------------------------------------ r2419 | vasil | 2008-04-23 19:08:06 +0300 (Wed, 23 Apr 2008) | 9 lines branches/5.1: Change the fix for Bug#32440 to show bytes instead of kilobytes in INFORMATION_SCHEMA.TABLES.DATA_FREE. Suggested by: Domas Mituzas <domas@mysql.com> Approved by: Heikki ------------------------------------------------------------------------ r2420 | calvin | 2008-04-24 15:25:30 +0300 (Thu, 24 Apr 2008) | 4 lines branches/5.1: Fix bug#29507 TRUNCATE shows to many rows effected In InnoDB, the row count is only a rough estimate used by SQL optimization. InnoDB is now return row count 0 for TRUNCATE operation. ------------------------------------------------------------------------ r2421 | calvin | 2008-04-24 15:32:30 +0300 (Thu, 24 Apr 2008) | 6 lines branches/5.1: Fix bug#35537 - Innodb doesn't increment handler_update and handler_delete Add the calls to ha_statistic_increment() in ha_innobase::delete_row() and ha_innobase::update_row(). ------------------------------------------------------------------------ r2422 | vasil | 2008-04-24 16:00:30 +0300 (Thu, 24 Apr 2008) | 11 lines branches/5.1: Fix Bug#36169 create innodb compressed table with too large row size crashed Sometimes it is possible that row_drop_table_for_mysql(index->table_name, trx, FALSE); is invoked in row_create_index_for_mysql() when the index object is freed so copy the table name to a safe place beforehand and use the copy. Approved by: Sunny ------------------------------------------------------------------------
18 years ago
branches/zip: Merge revisions 4481:4710 from branches/5.1: (resolving conflict in r4574, r4575 and skipping r4699 and r4705 because analogous changes to r4699 and r4705 were already made to branches/zip) ------------------------------------------------------------------------ r4573 | vasil | 2009-03-30 14:17:13 +0300 (Mon, 30 Mar 2009) | 4 lines Changed paths: M /branches/5.1/mysql-test/innodb.test branches/5.1: Fix email address from dev@innodb.com to innodb_dev_ww@oracle.com ------------------------------------------------------------------------ r4574 | vasil | 2009-03-30 14:27:08 +0300 (Mon, 30 Mar 2009) | 38 lines Changed paths: M /branches/5.1/Makefile.am M /branches/5.1/mysql-test/innodb.test branches/5.1: Restore the state of INNODB_THREAD_CONCURRENCY to silence this warning: TEST RESULT TIME (ms) ------------------------------------------------------------ worker[1] Using MTR_BUILD_THREAD 250, with reserved ports 12500..12509 main.innodb [ pass ] 8803 MTR's internal check of the test case 'main.innodb' failed. This means that the test case does not preserve the state that existed before the test case was executed. Most likely the test case did not do a proper clean-up. This is the diff of the states of the servers before and after the test case was executed: mysqltest: Logging to '/tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.log'. mysqltest: Results saved in '/tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.result'. mysqltest: Connecting to server localhost:12500 (socket /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/mysqld.1.sock) as 'root', connection 'default', attempt 0 ... mysqltest: ... Connected. mysqltest: Start processing test commands from './include/check-testcase.test' ... mysqltest: ... Done processing test commands. --- /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.result 2009-03-30 14:12:31.000000000 +0300 +++ /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.reject 2009-03-30 14:12:41.000000000 +0300 @@ -99,7 +99,7 @@ INNODB_SUPPORT_XA ON INNODB_SYNC_SPIN_LOOPS 20 INNODB_TABLE_LOCKS ON -INNODB_THREAD_CONCURRENCY 8 +INNODB_THREAD_CONCURRENCY 16 INNODB_THREAD_SLEEP_DELAY 10000 INSERT_ID 0 INTERACTIVE_TIMEOUT 28800 mysqltest: Result content mismatch not ok ------------------------------------------------------------------------ r4575 | vasil | 2009-03-30 15:55:31 +0300 (Mon, 30 Mar 2009) | 8 lines Changed paths: M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Fix Bug#43309 Test main.innodb can't be run twice Make the innodb mysql-test more flexible by inspecting how much a variable of interest has changed since the start of the test. Do not assume the variables have zero values at the start of the test. ------------------------------------------------------------------------ r4576 | vasil | 2009-03-30 16:25:10 +0300 (Mon, 30 Mar 2009) | 4 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Revert a change to Makefile.am that I committed accidentally in c4574. ------------------------------------------------------------------------ r4659 | vasil | 2009-04-06 15:34:51 +0300 (Mon, 06 Apr 2009) | 6 lines Changed paths: M /branches/5.1/mysql-test/innodb.test branches/5.1: Followup to r4575 and the fix of Bug#43309 Test main.innodb can't be run twice: Add an explanatory comment, as suggested by Patrick Crews in the bug report. ------------------------------------------------------------------------ r4699 | vasil | 2009-04-09 14:01:52 +0300 (Thu, 09 Apr 2009) | 15 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/srv0srv.h M /branches/5.1/page/page0cur.c M /branches/5.1/srv/srv0srv.c branches/5.1: Fix Bug#43660 SHOW INDEXES/ANALYZE does NOT update cardinality for indexes of InnoDB table by replacing the PRNG that is used to pick random pages with a better one. This is based on r4670 but also adds a new configuration option and enables the fix only if this option is changed. Please skip the present revision when merging. Approved by: Heikki (via email) ------------------------------------------------------------------------ r4705 | vasil | 2009-04-14 14:30:13 +0300 (Tue, 14 Apr 2009) | 5 lines Changed paths: M /branches/5.1/page/page0cur.c branches/5.1: When using the random function, first take the modulus by the number of pages and then typecast to ulint. ------------------------------------------------------------------------ r4710 | vasil | 2009-04-15 11:55:18 +0300 (Wed, 15 Apr 2009) | 25 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Merge a change from MySQL (looks like this is against 5.0 but they later merged it to 5.1): ------------------------------------------------------------ revno: 1810.3846.1 committer: Alexey Botchkov <holyfoot@mysql.com> branch nick: 31435 timestamp: Tue 2008-11-11 14:42:32 +0400 message: Bug#31435 ha_innodb.cc:3983: ulint convert_search_mode_to_innobase(ha_rkey_function): Asse I think we don't need to issue an error statement in the convert_search_mode_to_innobase(). Returning the PAGE_CUR_UNSUPP value is enough as allows to handle this case depending on the requirements. per-file comments: sql/ha_innodb.cc Bug#31435 ha_innodb.cc:3983: ulint convert_search_mode_to_innobase(ha_rkey_function): Asse no error issued in convert_search_mode_to_innobase. ha_innobase::records_in_range() returns HA_POS_ERROR if search mode isn't supported. modified: sql/ha_innodb.cc ------------------------------------------------------------------------
17 years ago
branches/zip: Merge revisions 4481:4710 from branches/5.1: (resolving conflict in r4574, r4575 and skipping r4699 and r4705 because analogous changes to r4699 and r4705 were already made to branches/zip) ------------------------------------------------------------------------ r4573 | vasil | 2009-03-30 14:17:13 +0300 (Mon, 30 Mar 2009) | 4 lines Changed paths: M /branches/5.1/mysql-test/innodb.test branches/5.1: Fix email address from dev@innodb.com to innodb_dev_ww@oracle.com ------------------------------------------------------------------------ r4574 | vasil | 2009-03-30 14:27:08 +0300 (Mon, 30 Mar 2009) | 38 lines Changed paths: M /branches/5.1/Makefile.am M /branches/5.1/mysql-test/innodb.test branches/5.1: Restore the state of INNODB_THREAD_CONCURRENCY to silence this warning: TEST RESULT TIME (ms) ------------------------------------------------------------ worker[1] Using MTR_BUILD_THREAD 250, with reserved ports 12500..12509 main.innodb [ pass ] 8803 MTR's internal check of the test case 'main.innodb' failed. This means that the test case does not preserve the state that existed before the test case was executed. Most likely the test case did not do a proper clean-up. This is the diff of the states of the servers before and after the test case was executed: mysqltest: Logging to '/tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.log'. mysqltest: Results saved in '/tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.result'. mysqltest: Connecting to server localhost:12500 (socket /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/mysqld.1.sock) as 'root', connection 'default', attempt 0 ... mysqltest: ... Connected. mysqltest: Start processing test commands from './include/check-testcase.test' ... mysqltest: ... Done processing test commands. --- /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.result 2009-03-30 14:12:31.000000000 +0300 +++ /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.reject 2009-03-30 14:12:41.000000000 +0300 @@ -99,7 +99,7 @@ INNODB_SUPPORT_XA ON INNODB_SYNC_SPIN_LOOPS 20 INNODB_TABLE_LOCKS ON -INNODB_THREAD_CONCURRENCY 8 +INNODB_THREAD_CONCURRENCY 16 INNODB_THREAD_SLEEP_DELAY 10000 INSERT_ID 0 INTERACTIVE_TIMEOUT 28800 mysqltest: Result content mismatch not ok ------------------------------------------------------------------------ r4575 | vasil | 2009-03-30 15:55:31 +0300 (Mon, 30 Mar 2009) | 8 lines Changed paths: M /branches/5.1/mysql-test/innodb.result M /branches/5.1/mysql-test/innodb.test branches/5.1: Fix Bug#43309 Test main.innodb can't be run twice Make the innodb mysql-test more flexible by inspecting how much a variable of interest has changed since the start of the test. Do not assume the variables have zero values at the start of the test. ------------------------------------------------------------------------ r4576 | vasil | 2009-03-30 16:25:10 +0300 (Mon, 30 Mar 2009) | 4 lines Changed paths: M /branches/5.1/Makefile.am branches/5.1: Revert a change to Makefile.am that I committed accidentally in c4574. ------------------------------------------------------------------------ r4659 | vasil | 2009-04-06 15:34:51 +0300 (Mon, 06 Apr 2009) | 6 lines Changed paths: M /branches/5.1/mysql-test/innodb.test branches/5.1: Followup to r4575 and the fix of Bug#43309 Test main.innodb can't be run twice: Add an explanatory comment, as suggested by Patrick Crews in the bug report. ------------------------------------------------------------------------ r4699 | vasil | 2009-04-09 14:01:52 +0300 (Thu, 09 Apr 2009) | 15 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc M /branches/5.1/include/srv0srv.h M /branches/5.1/page/page0cur.c M /branches/5.1/srv/srv0srv.c branches/5.1: Fix Bug#43660 SHOW INDEXES/ANALYZE does NOT update cardinality for indexes of InnoDB table by replacing the PRNG that is used to pick random pages with a better one. This is based on r4670 but also adds a new configuration option and enables the fix only if this option is changed. Please skip the present revision when merging. Approved by: Heikki (via email) ------------------------------------------------------------------------ r4705 | vasil | 2009-04-14 14:30:13 +0300 (Tue, 14 Apr 2009) | 5 lines Changed paths: M /branches/5.1/page/page0cur.c branches/5.1: When using the random function, first take the modulus by the number of pages and then typecast to ulint. ------------------------------------------------------------------------ r4710 | vasil | 2009-04-15 11:55:18 +0300 (Wed, 15 Apr 2009) | 25 lines Changed paths: M /branches/5.1/handler/ha_innodb.cc branches/5.1: Merge a change from MySQL (looks like this is against 5.0 but they later merged it to 5.1): ------------------------------------------------------------ revno: 1810.3846.1 committer: Alexey Botchkov <holyfoot@mysql.com> branch nick: 31435 timestamp: Tue 2008-11-11 14:42:32 +0400 message: Bug#31435 ha_innodb.cc:3983: ulint convert_search_mode_to_innobase(ha_rkey_function): Asse I think we don't need to issue an error statement in the convert_search_mode_to_innobase(). Returning the PAGE_CUR_UNSUPP value is enough as allows to handle this case depending on the requirements. per-file comments: sql/ha_innodb.cc Bug#31435 ha_innodb.cc:3983: ulint convert_search_mode_to_innobase(ha_rkey_function): Asse no error issued in convert_search_mode_to_innobase. ha_innobase::records_in_range() returns HA_POS_ERROR if search mode isn't supported. modified: sql/ha_innodb.cc ------------------------------------------------------------------------
17 years ago
  1. #######################################################################
  2. # #
  3. # Please, DO NOT TOUCH this file as well as the innodb.result file. #
  4. # These files are to be modified ONLY BY INNOBASE guys. #
  5. # #
  6. # Use innodb_mysql.[test|result] files instead. #
  7. # #
  8. # If nevertheless you need to make some changes here, please, forward #
  9. # your commit message #
  10. # To: innodb_dev_ww@oracle.com #
  11. # Cc: dev-innodb@mysql.com #
  12. # (otherwise your changes may be erased). #
  13. # #
  14. #######################################################################
  15. -- source include/have_innodb_plugin.inc
  16. let $MYSQLD_DATADIR= `select @@datadir`;
  17. # Save the original values of some variables in order to be able to
  18. # estimate how much they have changed during the tests. Previously this
  19. # test assumed that e.g. rows_deleted is 0 here and after deleting 23
  20. # rows it expected that rows_deleted will be 23. Now we do not make
  21. # assumptions about the values of the variables at the beginning, e.g.
  22. # rows_deleted should be 23 + "rows_deleted before the test". This allows
  23. # the test to be run multiple times without restarting the mysqld server.
  24. # See Bug#43309 Test main.innodb can't be run twice
  25. -- disable_query_log
  26. SET @innodb_thread_concurrency_orig = @@innodb_thread_concurrency;
  27. SET @innodb_rows_deleted_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted');
  28. SET @innodb_rows_inserted_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted');
  29. SET @innodb_rows_updated_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated');
  30. SET @innodb_row_lock_waits_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_waits');
  31. SET @innodb_row_lock_current_waits_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_current_waits');
  32. SET @innodb_row_lock_time_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time');
  33. SET @innodb_row_lock_time_max_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_max');
  34. SET @innodb_row_lock_time_avg_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg');
  35. -- enable_query_log
  36. --disable_warnings
  37. drop table if exists t1,t2,t3,t4;
  38. drop database if exists mysqltest;
  39. --enable_warnings
  40. # Bug#58912 InnoDB unnecessarily avoids update-in-place on column prefixes
  41. CREATE TABLE bug58912 (a BLOB, b TEXT, PRIMARY KEY(a(1))) ENGINE=InnoDB;
  42. INSERT INTO bug58912 VALUES(REPEAT('a',8000),REPEAT('b',8000));
  43. UPDATE bug58912 SET a=REPEAT('a',7999);
  44. # The above statements used to trigger a failure during purge when
  45. # Bug#55284 was fixed while Bug#58912 was not. Defer the DROP TABLE,
  46. # so that purge gets a chance to run (and a double free of the
  47. # off-page column can be detected, if one is to occur.)
  48. #
  49. # Small basic test with ignore
  50. #
  51. create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) engine=innodb;
  52. insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'), (2, 'Erik'), (3, 'Sasha'), (3, 'Jeremy'), (4, 'Matt');
  53. select id, code, name from t1 order by id;
  54. update ignore t1 set id = 8, name = 'Sinisa' where id < 3;
  55. select id, code, name from t1 order by id;
  56. update ignore t1 set id = id + 10, name = 'Ralph' where id < 4;
  57. select id, code, name from t1 order by id;
  58. drop table t1;
  59. #
  60. # A bit bigger test
  61. # The 'replace_column' statements are needed because the cardinality calculated
  62. # by innodb is not always the same between runs
  63. #
  64. CREATE TABLE t1 (
  65. id int(11) NOT NULL auto_increment,
  66. parent_id int(11) DEFAULT '0' NOT NULL,
  67. level tinyint(4) DEFAULT '0' NOT NULL,
  68. PRIMARY KEY (id),
  69. KEY parent_id (parent_id),
  70. KEY level (level)
  71. ) engine=innodb;
  72. INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),(24,4,2),(28,5,2),(29,5,2),(30,5,2),(31,6,2),(32,6,2),(33,6,2),(203,7,2),(202,7,2),(20,3,2),(157,0,0),(193,5,2),(40,7,2),(2,1,1),(15,2,2),(6,1,1),(34,6,2),(35,6,2),(16,3,2),(7,1,1),(36,7,2),(18,3,2),(26,5,2),(27,5,2),(183,4,2),(38,7,2),(25,5,2),(37,7,2),(21,4,2),(19,3,2),(5,1,1),(179,5,2);
  73. update t1 set parent_id=parent_id+100;
  74. select * from t1 where parent_id=102;
  75. update t1 set id=id+1000;
  76. -- error ER_DUP_ENTRY,1022
  77. update t1 set id=1024 where id=1009;
  78. select * from t1;
  79. update ignore t1 set id=id+1; # This will change all rows
  80. select * from t1;
  81. update ignore t1 set id=1023 where id=1010;
  82. select * from t1 where parent_id=102;
  83. --replace_column 9 #
  84. explain select level from t1 where level=1;
  85. --replace_column 9 #
  86. explain select level,id from t1 where level=1;
  87. --replace_column 9 #
  88. explain select level,id,parent_id from t1 where level=1;
  89. select level,id from t1 where level=1;
  90. select level,id,parent_id from t1 where level=1;
  91. optimize table t1;
  92. --replace_column 7 #
  93. show keys from t1;
  94. drop table t1;
  95. #
  96. # Test replace
  97. #
  98. CREATE TABLE t1 (
  99. gesuchnr int(11) DEFAULT '0' NOT NULL,
  100. benutzer_id int(11) DEFAULT '0' NOT NULL,
  101. PRIMARY KEY (gesuchnr,benutzer_id)
  102. ) engine=innodb;
  103. replace into t1 (gesuchnr,benutzer_id) values (2,1);
  104. replace into t1 (gesuchnr,benutzer_id) values (1,1);
  105. replace into t1 (gesuchnr,benutzer_id) values (1,1);
  106. select * from t1;
  107. drop table t1;
  108. #
  109. # test delete using hidden_primary_key
  110. #
  111. create table t1 (a int) engine=innodb;
  112. insert into t1 values (1), (2);
  113. optimize table t1;
  114. delete from t1 where a = 1;
  115. select * from t1;
  116. check table t1;
  117. drop table t1;
  118. create table t1 (a int,b varchar(20)) engine=innodb;
  119. insert into t1 values (1,""), (2,"testing");
  120. delete from t1 where a = 1;
  121. select * from t1;
  122. create index skr on t1 (a);
  123. insert into t1 values (3,""), (4,"testing");
  124. analyze table t1;
  125. --replace_column 7 #
  126. show keys from t1;
  127. drop table t1;
  128. # Test of reading on secondary key with may be null
  129. create table t1 (a int,b varchar(20),key(a)) engine=innodb;
  130. insert into t1 values (1,""), (2,"testing");
  131. select * from t1 where a = 1;
  132. drop table t1;
  133. #
  134. # Test rollback
  135. #
  136. create table t1 (n int not null primary key) engine=innodb;
  137. set autocommit=0;
  138. insert into t1 values (4);
  139. rollback;
  140. select n, "after rollback" from t1;
  141. insert into t1 values (4);
  142. commit;
  143. select n, "after commit" from t1;
  144. commit;
  145. insert into t1 values (5);
  146. -- error ER_DUP_ENTRY
  147. insert into t1 values (4);
  148. commit;
  149. select n, "after commit" from t1;
  150. set autocommit=1;
  151. insert into t1 values (6);
  152. -- error ER_DUP_ENTRY
  153. insert into t1 values (4);
  154. select n from t1;
  155. set autocommit=0;
  156. #
  157. # savepoints
  158. #
  159. begin;
  160. savepoint `my_savepoint`;
  161. insert into t1 values (7);
  162. savepoint `savept2`;
  163. insert into t1 values (3);
  164. select n from t1;
  165. savepoint savept3;
  166. rollback to savepoint savept2;
  167. --error 1305
  168. rollback to savepoint savept3;
  169. rollback to savepoint savept2;
  170. release savepoint `my_savepoint`;
  171. select n from t1;
  172. -- error 1305
  173. rollback to savepoint `my_savepoint`;
  174. --error 1305
  175. rollback to savepoint savept2;
  176. insert into t1 values (8);
  177. savepoint sv;
  178. commit;
  179. savepoint sv;
  180. set autocommit=1;
  181. # nop
  182. rollback;
  183. drop table t1;
  184. #
  185. # Test for commit and FLUSH TABLES WITH READ LOCK
  186. #
  187. create table t1 (n int not null primary key) engine=innodb;
  188. start transaction;
  189. insert into t1 values (4);
  190. flush tables with read lock;
  191. #
  192. # Current code can't handle a read lock in middle of transaction
  193. #--error 1223;
  194. commit;
  195. unlock tables;
  196. commit;
  197. select * from t1;
  198. drop table t1;
  199. #
  200. # Testing transactions
  201. #
  202. create table t1 ( id int NOT NULL PRIMARY KEY, nom varchar(64)) engine=innodb;
  203. begin;
  204. insert into t1 values(1,'hamdouni');
  205. select id as afterbegin_id,nom as afterbegin_nom from t1;
  206. rollback;
  207. select id as afterrollback_id,nom as afterrollback_nom from t1;
  208. set autocommit=0;
  209. insert into t1 values(2,'mysql');
  210. select id as afterautocommit0_id,nom as afterautocommit0_nom from t1;
  211. rollback;
  212. select id as afterrollback_id,nom as afterrollback_nom from t1;
  213. set autocommit=1;
  214. drop table t1;
  215. #
  216. # Simple not autocommit test
  217. #
  218. CREATE TABLE t1 (id char(8) not null primary key, val int not null) engine=innodb;
  219. insert into t1 values ('pippo', 12);
  220. -- error ER_DUP_ENTRY
  221. insert into t1 values ('pippo', 12); # Gives error
  222. delete from t1;
  223. delete from t1 where id = 'pippo';
  224. select * from t1;
  225. insert into t1 values ('pippo', 12);
  226. set autocommit=0;
  227. delete from t1;
  228. rollback;
  229. select * from t1;
  230. delete from t1;
  231. commit;
  232. select * from t1;
  233. drop table t1;
  234. #
  235. # Test of active transactions
  236. #
  237. create table t1 (a integer) engine=innodb;
  238. start transaction;
  239. rename table t1 to t2;
  240. create table t1 (b integer) engine=innodb;
  241. insert into t1 values (1);
  242. rollback;
  243. drop table t1;
  244. rename table t2 to t1;
  245. drop table t1;
  246. set autocommit=1;
  247. #
  248. # The following simple tests failed at some point
  249. #
  250. CREATE TABLE t1 (ID INTEGER NOT NULL PRIMARY KEY, NAME VARCHAR(64)) ENGINE=innodb;
  251. INSERT INTO t1 VALUES (1, 'Jochen');
  252. select * from t1;
  253. drop table t1;
  254. CREATE TABLE t1 ( _userid VARCHAR(60) NOT NULL PRIMARY KEY) ENGINE=innodb;
  255. set autocommit=0;
  256. INSERT INTO t1 SET _userid='marc@anyware.co.uk';
  257. COMMIT;
  258. SELECT * FROM t1;
  259. SELECT _userid FROM t1 WHERE _userid='marc@anyware.co.uk';
  260. drop table t1;
  261. set autocommit=1;
  262. #
  263. # Test when reading on part of unique key
  264. #
  265. CREATE TABLE t1 (
  266. user_id int(10) DEFAULT '0' NOT NULL,
  267. name varchar(100),
  268. phone varchar(100),
  269. ref_email varchar(100) DEFAULT '' NOT NULL,
  270. detail varchar(200),
  271. PRIMARY KEY (user_id,ref_email)
  272. )engine=innodb;
  273. INSERT INTO t1 VALUES (10292,'sanjeev','29153373','sansh777@hotmail.com','xxx'),(10292,'shirish','2333604','shirish@yahoo.com','ddsds'),(10292,'sonali','323232','sonali@bolly.com','filmstar');
  274. select * from t1 where user_id=10292;
  275. INSERT INTO t1 VALUES (10291,'sanjeev','29153373','sansh777@hotmail.com','xxx'),(10293,'shirish','2333604','shirish@yahoo.com','ddsds');
  276. select * from t1 where user_id=10292;
  277. select * from t1 where user_id>=10292;
  278. select * from t1 where user_id>10292;
  279. select * from t1 where user_id<10292;
  280. drop table t1;
  281. #
  282. # Test that keys are created in right order
  283. #
  284. CREATE TABLE t1 (a int not null, b int not null,c int not null,
  285. key(a),primary key(a,b), unique(c),key(a),unique(b));
  286. --replace_column 7 #
  287. show index from t1;
  288. drop table t1;
  289. #
  290. # Test of ALTER TABLE and innodb tables
  291. #
  292. create table t1 (col1 int not null, col2 char(4) not null, primary key(col1));
  293. alter table t1 engine=innodb;
  294. insert into t1 values ('1','1'),('5','2'),('2','3'),('3','4'),('4','4');
  295. select * from t1;
  296. update t1 set col2='7' where col1='4';
  297. select * from t1;
  298. alter table t1 add co3 int not null;
  299. select * from t1;
  300. update t1 set col2='9' where col1='2';
  301. select * from t1;
  302. drop table t1;
  303. #
  304. # INSERT INTO innodb tables
  305. #
  306. create table t1 (a int not null , b int, primary key (a)) engine = innodb;
  307. create table t2 (a int not null , b int, primary key (a)) engine = myisam;
  308. insert into t1 VALUES (1,3) , (2,3), (3,3);
  309. select * from t1;
  310. insert into t2 select * from t1;
  311. select * from t2;
  312. delete from t1 where b = 3;
  313. select * from t1;
  314. insert into t1 select * from t2;
  315. select * from t1;
  316. select * from t2;
  317. drop table t1,t2;
  318. #
  319. # ORDER BY on not primary key
  320. #
  321. CREATE TABLE t1 (
  322. user_name varchar(12),
  323. password text,
  324. subscribed char(1),
  325. user_id int(11) DEFAULT '0' NOT NULL,
  326. quota bigint(20),
  327. weight double,
  328. access_date date,
  329. access_time time,
  330. approved datetime,
  331. dummy_primary_key int(11) NOT NULL auto_increment,
  332. PRIMARY KEY (dummy_primary_key)
  333. ) ENGINE=innodb;
  334. INSERT INTO t1 VALUES ('user_0','somepassword','N',0,0,0,'2000-09-07','23:06:59','2000-09-07 23:06:59',1);
  335. INSERT INTO t1 VALUES ('user_1','somepassword','Y',1,1,1,'2000-09-07','23:06:59','2000-09-07 23:06:59',2);
  336. INSERT INTO t1 VALUES ('user_2','somepassword','N',2,2,1.4142135623731,'2000-09-07','23:06:59','2000-09-07 23:06:59',3);
  337. INSERT INTO t1 VALUES ('user_3','somepassword','Y',3,3,1.7320508075689,'2000-09-07','23:06:59','2000-09-07 23:06:59',4);
  338. INSERT INTO t1 VALUES ('user_4','somepassword','N',4,4,2,'2000-09-07','23:06:59','2000-09-07 23:06:59',5);
  339. select user_name, password , subscribed, user_id, quota, weight, access_date, access_time, approved, dummy_primary_key from t1 order by user_name;
  340. drop table t1;
  341. #
  342. # Testing of tables without primary keys
  343. #
  344. CREATE TABLE t1 (
  345. id int(11) NOT NULL auto_increment,
  346. parent_id int(11) DEFAULT '0' NOT NULL,
  347. level tinyint(4) DEFAULT '0' NOT NULL,
  348. KEY (id),
  349. KEY parent_id (parent_id),
  350. KEY level (level)
  351. ) engine=innodb;
  352. INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),(24,4,2),(28,5,2),(29,5,2),(30,5,2),(31,6,2),(32,6,2),(33,6,2),(203,7,2),(202,7,2),(20,3,2),(157,0,0),(193,5,2),(40,7,2),(2,1,1),(15,2,2),(6,1,1),(34,6,2),(35,6,2),(16,3,2),(7,1,1),(36,7,2),(18,3,2),(26,5,2),(27,5,2),(183,4,2),(38,7,2),(25,5,2),(37,7,2),(21,4,2),(19,3,2),(5,1,1);
  353. INSERT INTO t1 values (179,5,2);
  354. update t1 set parent_id=parent_id+100;
  355. select * from t1 where parent_id=102;
  356. update t1 set id=id+1000;
  357. update t1 set id=1024 where id=1009;
  358. select * from t1;
  359. update ignore t1 set id=id+1; # This will change all rows
  360. select * from t1;
  361. update ignore t1 set id=1023 where id=1010;
  362. select * from t1 where parent_id=102;
  363. --replace_column 9 #
  364. explain select level from t1 where level=1;
  365. select level,id from t1 where level=1;
  366. select level,id,parent_id from t1 where level=1;
  367. select level,id from t1 where level=1 order by id;
  368. delete from t1 where level=1;
  369. select * from t1;
  370. drop table t1;
  371. #
  372. # Test of index only reads
  373. #
  374. CREATE TABLE t1 (
  375. sca_code char(6) NOT NULL,
  376. cat_code char(6) NOT NULL,
  377. sca_desc varchar(50),
  378. lan_code char(2) NOT NULL,
  379. sca_pic varchar(100),
  380. sca_sdesc varchar(50),
  381. sca_sch_desc varchar(16),
  382. PRIMARY KEY (sca_code, cat_code, lan_code),
  383. INDEX sca_pic (sca_pic)
  384. ) engine = innodb ;
  385. INSERT INTO t1 ( sca_code, cat_code, sca_desc, lan_code, sca_pic, sca_sdesc, sca_sch_desc) VALUES ( 'PD', 'J', 'PENDANT', 'EN', NULL, NULL, 'PENDANT'),( 'RI', 'J', 'RING', 'EN', NULL, NULL, 'RING'),( 'QQ', 'N', 'RING', 'EN', 'not null', NULL, 'RING');
  386. select count(*) from t1 where sca_code = 'PD';
  387. select count(*) from t1 where sca_code <= 'PD';
  388. select count(*) from t1 where sca_pic is null;
  389. # this should be fixed by MySQL (see Bug #51451)
  390. # now that http://bugs.mysql.com/49838 is fixed the following ALTER does
  391. # copy the table instead of failing
  392. # --error ER_WRONG_NAME_FOR_INDEX
  393. alter table t1 drop index sca_pic, add index sca_pic (cat_code, sca_pic);
  394. alter table t1 drop index sca_pic;
  395. alter table t1 add index sca_pic (cat_code, sca_pic);
  396. select count(*) from t1 where sca_code='PD' and sca_pic is null;
  397. select count(*) from t1 where cat_code='E';
  398. # this should be fixed by MySQL (see Bug #51451)
  399. --error ER_WRONG_NAME_FOR_INDEX
  400. alter table t1 drop index sca_pic, add index (sca_pic, cat_code);
  401. alter table t1 drop index sca_pic;
  402. alter table t1 add index (sca_pic, cat_code);
  403. select count(*) from t1 where sca_code='PD' and sca_pic is null;
  404. select count(*) from t1 where sca_pic >= 'n';
  405. select sca_pic from t1 where sca_pic is null;
  406. update t1 set sca_pic="test" where sca_pic is null;
  407. delete from t1 where sca_code='pd';
  408. drop table t1;
  409. #
  410. # Test of opening table twice and timestamps
  411. #
  412. set @a:=now();
  413. CREATE TABLE t1 (a int not null, b timestamp not null, primary key (a)) engine=innodb;
  414. insert into t1 (a) values(1),(2),(3);
  415. select t1.a from t1 natural join t1 as t2 where t1.b >= @a order by t1.a;
  416. select a from t1 natural join t1 as t2 where b >= @a order by a;
  417. update t1 set a=5 where a=1;
  418. select a from t1;
  419. drop table t1;
  420. #
  421. # Test with variable length primary key
  422. #
  423. create table t1 (a varchar(100) not null, primary key(a), b int not null) engine=innodb;
  424. insert into t1 values("hello",1),("world",2);
  425. select * from t1 order by b desc;
  426. optimize table t1;
  427. --replace_column 7 #
  428. show keys from t1;
  429. drop table t1;
  430. #
  431. # Test of create index with NULL columns
  432. #
  433. create table t1 (i int, j int ) ENGINE=innodb;
  434. insert into t1 values (1,2);
  435. select * from t1 where i=1 and j=2;
  436. create index ax1 on t1 (i,j);
  437. select * from t1 where i=1 and j=2;
  438. drop table t1;
  439. #
  440. # Test min-max optimization
  441. #
  442. CREATE TABLE t1 (
  443. a int3 unsigned NOT NULL,
  444. b int1 unsigned NOT NULL,
  445. UNIQUE (a, b)
  446. ) ENGINE = innodb;
  447. INSERT INTO t1 VALUES (1, 1);
  448. SELECT MIN(B),MAX(b) FROM t1 WHERE t1.a = 1;
  449. drop table t1;
  450. #
  451. # Test INSERT DELAYED
  452. #
  453. CREATE TABLE t1 (a int unsigned NOT NULL) engine=innodb;
  454. # Can't test this in 3.23
  455. # INSERT DELAYED INTO t1 VALUES (1);
  456. INSERT INTO t1 VALUES (1);
  457. SELECT * FROM t1;
  458. DROP TABLE t1;
  459. #
  460. # Crash when using many tables (Test case by Jeremy D Zawodny)
  461. #
  462. create table t1 (a int primary key,b int, c int, d int, e int, f int, g int, h int, i int, j int, k int, l int, m int, n int, o int, p int, q int, r int, s int, t int, u int, v int, w int, x int, y int, z int, a1 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int, b1 int, b2 int, b3 int, b4 int, b5 int, b6 int) engine = innodb;
  463. insert into t1 values (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
  464. --replace_column 9 #
  465. explain select * from t1 where a > 0 and a < 50;
  466. drop table t1;
  467. #
  468. # Test lock tables
  469. #
  470. create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=innodb;
  471. insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL');
  472. LOCK TABLES t1 WRITE;
  473. --error ER_DUP_ENTRY
  474. insert into t1 values (99,1,2,'D'),(1,1,2,'D');
  475. select id from t1;
  476. select id from t1;
  477. UNLOCK TABLES;
  478. DROP TABLE t1;
  479. create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=innodb;
  480. insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL');
  481. LOCK TABLES t1 WRITE;
  482. begin;
  483. --error ER_DUP_ENTRY
  484. insert into t1 values (99,1,2,'D'),(1,1,2,'D');
  485. select id from t1;
  486. insert ignore into t1 values (100,1,2,'D'),(1,1,99,'D');
  487. commit;
  488. select id,id3 from t1;
  489. UNLOCK TABLES;
  490. DROP TABLE t1;
  491. #
  492. # Test prefix key
  493. #
  494. create table t1 (a char(20), unique (a(5))) engine=innodb;
  495. drop table t1;
  496. create table t1 (a char(20), index (a(5))) engine=innodb;
  497. show create table t1;
  498. drop table t1;
  499. #
  500. # Test using temporary table and auto_increment
  501. #
  502. create temporary table t1 (a int not null auto_increment, primary key(a)) engine=innodb;
  503. insert into t1 values (NULL),(NULL),(NULL);
  504. delete from t1 where a=3;
  505. insert into t1 values (NULL);
  506. select * from t1;
  507. alter table t1 add b int;
  508. select * from t1;
  509. drop table t1;
  510. #Slashdot bug
  511. create table t1
  512. (
  513. id int auto_increment primary key,
  514. name varchar(32) not null,
  515. value text not null,
  516. uid int not null,
  517. unique key(name,uid)
  518. ) engine=innodb;
  519. insert into t1 values (1,'one','one value',101),
  520. (2,'two','two value',102),(3,'three','three value',103);
  521. set insert_id=5;
  522. replace into t1 (value,name,uid) values ('other value','two',102);
  523. delete from t1 where uid=102;
  524. set insert_id=5;
  525. replace into t1 (value,name,uid) values ('other value','two',102);
  526. set insert_id=6;
  527. replace into t1 (value,name,uid) values ('other value','two',102);
  528. select * from t1;
  529. drop table t1;
  530. #
  531. # Test DROP DATABASE
  532. #
  533. create database mysqltest;
  534. create table mysqltest.t1 (a int not null) engine= innodb;
  535. insert into mysqltest.t1 values(1);
  536. create table mysqltest.t2 (a int not null) engine= myisam;
  537. insert into mysqltest.t2 values(1);
  538. create table mysqltest.t3 (a int not null) engine= heap;
  539. insert into mysqltest.t3 values(1);
  540. commit;
  541. drop database mysqltest;
  542. # Don't check error message
  543. --error 1049
  544. show tables from mysqltest;
  545. #
  546. # Test truncate table with and without auto_commit
  547. #
  548. set autocommit=0;
  549. create table t1 (a int not null) engine= innodb;
  550. insert into t1 values(1),(2);
  551. truncate table t1;
  552. commit;
  553. truncate table t1;
  554. truncate table t1;
  555. select * from t1;
  556. insert into t1 values(1),(2);
  557. delete from t1;
  558. select * from t1;
  559. commit;
  560. drop table t1;
  561. set autocommit=1;
  562. create table t1 (a int not null) engine= innodb;
  563. insert into t1 values(1),(2);
  564. truncate table t1;
  565. insert into t1 values(1),(2);
  566. select * from t1;
  567. truncate table t1;
  568. insert into t1 values(1),(2);
  569. delete from t1;
  570. select * from t1;
  571. drop table t1;
  572. #
  573. # Test of how ORDER BY works when doing it on the whole table
  574. #
  575. create table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) engine=innodb;
  576. insert into t1 values (3,3,3),(1,1,1),(2,2,2),(4,4,4);
  577. --replace_column 9 #
  578. explain select * from t1 order by a;
  579. --replace_column 9 #
  580. explain select * from t1 order by b;
  581. --replace_column 9 #
  582. explain select * from t1 order by c;
  583. --replace_column 9 #
  584. explain select a from t1 order by a;
  585. --replace_column 9 #
  586. explain select b from t1 order by b;
  587. --replace_column 9 #
  588. explain select a,b from t1 order by b;
  589. --replace_column 9 #
  590. explain select a,b from t1;
  591. --replace_column 9 #
  592. explain select a,b,c from t1;
  593. drop table t1;
  594. #
  595. # Check describe
  596. #
  597. create table t1 (t int not null default 1, key (t)) engine=innodb;
  598. desc t1;
  599. drop table t1;
  600. #
  601. # Test of multi-table-delete
  602. #
  603. CREATE TABLE t1 (
  604. number bigint(20) NOT NULL default '0',
  605. cname char(15) NOT NULL default '',
  606. carrier_id smallint(6) NOT NULL default '0',
  607. privacy tinyint(4) NOT NULL default '0',
  608. last_mod_date timestamp NOT NULL,
  609. last_mod_id smallint(6) NOT NULL default '0',
  610. last_app_date timestamp NOT NULL,
  611. last_app_id smallint(6) default '-1',
  612. version smallint(6) NOT NULL default '0',
  613. assigned_scps int(11) default '0',
  614. status tinyint(4) default '0'
  615. ) ENGINE=InnoDB;
  616. INSERT INTO t1 VALUES (4077711111,'SeanWheeler',90,2,20020111112846,500,00000000000000,-1,2,3,1);
  617. INSERT INTO t1 VALUES (9197722223,'berry',90,3,20020111112809,500,20020102114532,501,4,10,0);
  618. INSERT INTO t1 VALUES (650,'San Francisco',0,0,20011227111336,342,00000000000000,-1,1,24,1);
  619. INSERT INTO t1 VALUES (302467,'Sue\'s Subshop',90,3,20020109113241,500,20020102115111,501,7,24,0);
  620. INSERT INTO t1 VALUES (6014911113,'SudzCarwash',520,1,20020102115234,500,20020102115259,501,33,32768,0);
  621. INSERT INTO t1 VALUES (333,'tubs',99,2,20020109113440,501,20020109113440,500,3,10,0);
  622. CREATE TABLE t2 (
  623. number bigint(20) NOT NULL default '0',
  624. cname char(15) NOT NULL default '',
  625. carrier_id smallint(6) NOT NULL default '0',
  626. privacy tinyint(4) NOT NULL default '0',
  627. last_mod_date timestamp NOT NULL,
  628. last_mod_id smallint(6) NOT NULL default '0',
  629. last_app_date timestamp NOT NULL,
  630. last_app_id smallint(6) default '-1',
  631. version smallint(6) NOT NULL default '0',
  632. assigned_scps int(11) default '0',
  633. status tinyint(4) default '0'
  634. ) ENGINE=InnoDB;
  635. INSERT INTO t2 VALUES (4077711111,'SeanWheeler',0,2,20020111112853,500,00000000000000,-1,2,3,1);
  636. INSERT INTO t2 VALUES (9197722223,'berry',90,3,20020111112818,500,20020102114532,501,4,10,0);
  637. INSERT INTO t2 VALUES (650,'San Francisco',90,0,20020109113158,342,00000000000000,-1,1,24,1);
  638. INSERT INTO t2 VALUES (333,'tubs',99,2,20020109113453,501,20020109113453,500,3,10,0);
  639. select * from t1;
  640. select * from t2;
  641. delete t1, t2 from t1 left join t2 on t1.number=t2.number where (t1.carrier_id=90 and t1.number=t2.number) or (t2.carrier_id=90 and t1.number=t2.number) or (t1.carrier_id=90 and t2.number is null);
  642. select * from t1;
  643. select * from t2;
  644. select * from t2;
  645. drop table t1,t2;
  646. #
  647. # A simple test with some isolation levels
  648. # TODO: Make this into a test using replication to really test how
  649. # this works.
  650. #
  651. create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) engine=innodb;
  652. BEGIN;
  653. SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
  654. SELECT @@tx_isolation,@@global.tx_isolation;
  655. insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David');
  656. select id, code, name from t1 order by id;
  657. COMMIT;
  658. BEGIN;
  659. SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
  660. insert into t1 (code, name) values (2, 'Erik'), (3, 'Sasha');
  661. select id, code, name from t1 order by id;
  662. COMMIT;
  663. SET binlog_format='MIXED';
  664. BEGIN;
  665. SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
  666. insert into t1 (code, name) values (3, 'Jeremy'), (4, 'Matt');
  667. select id, code, name from t1 order by id;
  668. COMMIT;
  669. DROP TABLE t1;
  670. #
  671. # Test of multi-table-update
  672. #
  673. create table t1 (n int(10), d int(10)) engine=innodb;
  674. create table t2 (n int(10), d int(10)) engine=innodb;
  675. insert into t1 values(1,1),(1,2);
  676. insert into t2 values(1,10),(2,20);
  677. UPDATE t1,t2 SET t1.d=t2.d,t2.d=30 WHERE t1.n=t2.n;
  678. select * from t1;
  679. select * from t2;
  680. drop table t1,t2;
  681. #
  682. # Bug #29136 erred multi-delete on trans table does not rollback
  683. #
  684. # prepare
  685. --disable_warnings
  686. drop table if exists t1, t2;
  687. --enable_warnings
  688. CREATE TABLE t1 (a int, PRIMARY KEY (a));
  689. CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
  690. create trigger trg_del_t2 after delete on t2 for each row
  691. insert into t1 values (1);
  692. insert into t1 values (1);
  693. insert into t2 values (1),(2);
  694. # exec cases A, B - see multi_update.test
  695. # A. send_error() w/o send_eof() branch
  696. --error ER_DUP_ENTRY
  697. delete t2 from t2;
  698. # check
  699. select count(*) from t2 /* must be 2 as restored after rollback caused by the error */;
  700. # cleanup bug#29136
  701. drop table t1, t2;
  702. #
  703. # Bug #29136 erred multi-delete on trans table does not rollback
  704. #
  705. # prepare
  706. --disable_warnings
  707. drop table if exists t1, t2;
  708. --enable_warnings
  709. CREATE TABLE t1 (a int, PRIMARY KEY (a));
  710. CREATE TABLE t2 (a int, PRIMARY KEY (a)) ENGINE=InnoDB;
  711. create trigger trg_del_t2 after delete on t2 for each row
  712. insert into t1 values (1);
  713. insert into t1 values (1);
  714. insert into t2 values (1),(2);
  715. # exec cases A, B - see multi_update.test
  716. # A. send_error() w/o send_eof() branch
  717. --error ER_DUP_ENTRY
  718. delete t2 from t2;
  719. # check
  720. select count(*) from t2 /* must be 2 as restored after rollback caused by the error */;
  721. # cleanup bug#29136
  722. drop table t1, t2;
  723. #
  724. # Testing of IFNULL
  725. #
  726. create table t1 (a int, b int) engine=innodb;
  727. insert into t1 values(20,null);
  728. select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
  729. t2.b=t3.a;
  730. select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
  731. t2.b=t3.a order by 1;
  732. insert into t1 values(10,null);
  733. select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on
  734. t2.b=t3.a order by 1;
  735. drop table t1;
  736. #
  737. # Test of read_through not existing const_table
  738. #
  739. create table t1 (a varchar(10) not null) engine=myisam;
  740. create table t2 (b varchar(10) not null unique) engine=innodb;
  741. select t1.a from t1,t2 where t1.a=t2.b;
  742. drop table t1,t2;
  743. create table t1 (a int not null, b int, primary key (a)) engine = innodb;
  744. create table t2 (a int not null, b int, primary key (a)) engine = innodb;
  745. insert into t1 values (10, 20);
  746. insert into t2 values (10, 20);
  747. update t1, t2 set t1.b = 150, t2.b = t1.b where t2.a = t1.a and t1.a = 10;
  748. drop table t1,t2;
  749. #
  750. # Test of multi-table-delete with foreign key constraints
  751. #
  752. CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
  753. CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (t1_id) REFERENCES t1(id) ON DELETE CASCADE ) ENGINE=INNODB;
  754. insert into t1 set id=1;
  755. insert into t2 set id=1, t1_id=1;
  756. delete t1,t2 from t1,t2 where t1.id=t2.t1_id;
  757. select * from t1;
  758. select * from t2;
  759. drop table t2,t1;
  760. CREATE TABLE t1(id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
  761. CREATE TABLE t2(id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id) ) ENGINE=INNODB;
  762. INSERT INTO t1 VALUES(1);
  763. INSERT INTO t2 VALUES(1, 1);
  764. SELECT * from t1;
  765. UPDATE t1,t2 SET t1.id=t1.id+1, t2.t1_id=t1.id+1;
  766. SELECT * from t1;
  767. UPDATE t1,t2 SET t1.id=t1.id+1 where t1.id!=t2.id;
  768. SELECT * from t1;
  769. DROP TABLE t1,t2;
  770. #
  771. # Test of range_optimizer
  772. #
  773. set autocommit=0;
  774. CREATE TABLE t1 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB;
  775. CREATE TABLE t2 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB;
  776. CREATE TABLE t3 (id1 CHAR(15) NOT NULL, id2 CHAR(15) NOT NULL, PRIMARY KEY(id1, id2)) ENGINE=InnoDB;
  777. INSERT INTO t3 VALUES("my-test-1", "my-test-2");
  778. COMMIT;
  779. INSERT INTO t1 VALUES("this-key", "will disappear");
  780. INSERT INTO t2 VALUES("this-key", "will also disappear");
  781. DELETE FROM t3 WHERE id1="my-test-1";
  782. SELECT * FROM t1;
  783. SELECT * FROM t2;
  784. SELECT * FROM t3;
  785. ROLLBACK;
  786. SELECT * FROM t1;
  787. SELECT * FROM t2;
  788. SELECT * FROM t3;
  789. SELECT * FROM t3 WHERE id1="my-test-1" LOCK IN SHARE MODE;
  790. COMMIT;
  791. set autocommit=1;
  792. DROP TABLE t1,t2,t3;
  793. #
  794. # Check update with conflicting key
  795. #
  796. CREATE TABLE t1 (a int not null primary key, b int not null, unique (b)) engine=innodb;
  797. INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
  798. # We need the a < 1000 test here to quard against the halloween problems
  799. UPDATE t1 set a=a+100 where b between 2 and 3 and a < 1000;
  800. SELECT * from t1;
  801. drop table t1;
  802. CREATE TABLE t2 ( NEXT_T BIGINT NOT NULL PRIMARY KEY) ENGINE=MyISAM;
  803. CREATE TABLE t1 ( B_ID INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB;
  804. SET AUTOCOMMIT=0;
  805. INSERT INTO t1 ( B_ID ) VALUES ( 1 );
  806. INSERT INTO t2 ( NEXT_T ) VALUES ( 1 );
  807. ROLLBACK;
  808. SELECT * FROM t1;
  809. drop table t1,t2;
  810. create table t1 ( pk int primary key, parent int not null, child int not null, index (parent) ) engine = innodb;
  811. insert into t1 values (1,0,4), (2,1,3), (3,2,1), (4,1,2);
  812. select distinct parent,child from t1 order by parent;
  813. drop table t1;
  814. #
  815. # Test that MySQL priorities clustered indexes
  816. #
  817. create table t1 (a int not null auto_increment primary key, b int, c int, key(c)) engine=innodb;
  818. create table t2 (a int not null auto_increment primary key, b int);
  819. insert into t1 (b) values (null),(null),(null),(null),(null),(null),(null);
  820. insert into t2 (a) select b from t1;
  821. insert into t1 (b) select b from t2;
  822. insert into t2 (a) select b from t1;
  823. insert into t1 (a) select b from t2;
  824. insert into t2 (a) select b from t1;
  825. insert into t1 (a) select b from t2;
  826. insert into t2 (a) select b from t1;
  827. insert into t1 (a) select b from t2;
  828. insert into t2 (a) select b from t1;
  829. insert into t1 (a) select b from t2;
  830. select count(*) from t1;
  831. --replace_column 9 #
  832. explain select * from t1 where c between 1 and 2500;
  833. update t1 set c=a;
  834. --replace_column 9 #
  835. explain select * from t1 where c between 1 and 2500;
  836. drop table t1,t2;
  837. #
  838. # Test of UPDATE ... ORDER BY
  839. #
  840. create table t1 (id int primary key auto_increment, fk int, index index_fk (fk)) engine=innodb;
  841. insert into t1 (id) values (null),(null),(null),(null),(null);
  842. update t1 set fk=69 where fk is null order by id limit 1;
  843. SELECT * from t1;
  844. drop table t1;
  845. create table t1 (a int not null, b int not null, key (a));
  846. insert into t1 values (1,1),(1,2),(1,3),(3,1),(3,2),(3,3),(3,1),(3,2),(3,3),(2,1),(2,2),(2,3);
  847. SET @tmp=0;
  848. update t1 set b=(@tmp:=@tmp+1) order by a;
  849. update t1 set b=99 where a=1 order by b asc limit 1;
  850. update t1 set b=100 where a=1 order by b desc limit 2;
  851. update t1 set a=a+10+b where a=1 order by b;
  852. select * from t1 order by a,b;
  853. drop table t1;
  854. #
  855. # Test of multi-table-updates (bug #1980).
  856. #
  857. create table t1 ( c char(8) not null ) engine=innodb;
  858. insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9');
  859. insert into t1 values ('A'),('B'),('C'),('D'),('E'),('F');
  860. alter table t1 add b char(8) not null;
  861. alter table t1 add a char(8) not null;
  862. alter table t1 add primary key (a,b,c);
  863. update t1 set a=c, b=c;
  864. create table t2 (c char(8) not null, b char(8) not null, a char(8) not null, primary key(a,b,c)) engine=innodb;
  865. insert into t2 select * from t1;
  866. delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
  867. drop table t1,t2;
  868. #
  869. # test autoincrement with TRUNCATE
  870. #
  871. SET AUTOCOMMIT=1;
  872. create table t1 (a integer auto_increment primary key) engine=innodb;
  873. insert into t1 (a) values (NULL),(NULL);
  874. truncate table t1;
  875. insert into t1 (a) values (NULL),(NULL);
  876. SELECT * from t1;
  877. drop table t1;
  878. #
  879. # Test dictionary handling with spaceand quoting
  880. #
  881. CREATE TABLE t1 (`id 1` INT NOT NULL, PRIMARY KEY (`id 1`)) ENGINE=INNODB;
  882. CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (`t1_id`) REFERENCES `t1`(`id 1`) ON DELETE CASCADE ) ENGINE=INNODB;
  883. #show create table t2;
  884. drop table t2,t1;
  885. #
  886. # Test of multi updated and foreign keys
  887. #
  888. create table `t1` (`id` int( 11 ) not null ,primary key ( `id` )) engine = innodb;
  889. insert into `t1`values ( 1 ) ;
  890. create table `t2` (`id` int( 11 ) not null default '0',unique key `id` ( `id` ) ,constraint `t1_id_fk` foreign key ( `id` ) references `t1` (`id` )) engine = innodb;
  891. insert into `t2`values ( 1 ) ;
  892. create table `t3` (`id` int( 11 ) not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) engine = innodb;
  893. insert into `t3`values ( 1 ) ;
  894. --error 1451
  895. delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
  896. --error 1451
  897. update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
  898. --error 1054
  899. update t3 set t3.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
  900. drop table t3,t2,t1;
  901. # test ON UPDATE CASCADE
  902. CREATE TABLE t1 (
  903. c1 VARCHAR(8), c2 VARCHAR(8),
  904. PRIMARY KEY (c1, c2)
  905. ) ENGINE=InnoDB;
  906. CREATE TABLE t2 (
  907. c0 INT PRIMARY KEY,
  908. c1 VARCHAR(8) UNIQUE,
  909. FOREIGN KEY (c1) REFERENCES t1 (c1) ON UPDATE CASCADE
  910. ) ENGINE=InnoDB;
  911. INSERT INTO t1 VALUES ('old', 'somevalu'), ('other', 'anyvalue');
  912. INSERT INTO t2 VALUES (10, 'old'), (20, 'other');
  913. -- error ER_FOREIGN_DUPLICATE_KEY
  914. UPDATE t1 SET c1 = 'other' WHERE c1 = 'old';
  915. DROP TABLE t2,t1;
  916. #
  917. # test for recursion depth limit
  918. #
  919. create table t1(
  920. id int primary key,
  921. pid int,
  922. index(pid),
  923. foreign key(pid) references t1(id) on delete cascade) engine=innodb;
  924. insert into t1 values(0,0),(1,0),(2,1),(3,2),(4,3),(5,4),(6,5),(7,6),
  925. (8,7),(9,8),(10,9),(11,10),(12,11),(13,12),(14,13),(15,14);
  926. -- error 1451
  927. delete from t1 where id=0;
  928. delete from t1 where id=15;
  929. delete from t1 where id=0;
  930. drop table t1;
  931. #
  932. # Test timestamps
  933. #
  934. CREATE TABLE t1 (col1 int(1))ENGINE=InnoDB;
  935. CREATE TABLE t2 (col1 int(1),stamp TIMESTAMP,INDEX stamp_idx
  936. (stamp))ENGINE=InnoDB;
  937. insert into t1 values (1),(2),(3);
  938. # Note that timestamp 3 is wrong
  939. insert into t2 values (1, 20020204130000),(2, 20020204130000),(4,20020204310000 ),(5,20020204230000);
  940. SELECT col1 FROM t1 UNION SELECT col1 FROM t2 WHERE stamp <
  941. '20020204120000' GROUP BY col1;
  942. drop table t1,t2;
  943. #
  944. # Test by Francois MASUREL
  945. #
  946. CREATE TABLE t1 (
  947. `id` int(10) unsigned NOT NULL auto_increment,
  948. `id_object` int(10) unsigned default '0',
  949. `id_version` int(10) unsigned NOT NULL default '1',
  950. `label` varchar(100) NOT NULL default '',
  951. `description` text,
  952. PRIMARY KEY (`id`),
  953. KEY `id_object` (`id_object`),
  954. KEY `id_version` (`id_version`)
  955. ) ENGINE=InnoDB;
  956. INSERT INTO t1 VALUES("6", "3382", "9", "Test", NULL), ("7", "102", "5", "Le Pekin (Test)", NULL),("584", "1794", "4", "Test de resto", NULL),("837", "1822", "6", "Test 3", NULL),("1119", "3524", "1", "Societe Test", NULL),("1122", "3525", "1", "Fournisseur Test", NULL);
  957. CREATE TABLE t2 (
  958. `id` int(10) unsigned NOT NULL auto_increment,
  959. `id_version` int(10) unsigned NOT NULL default '1',
  960. PRIMARY KEY (`id`),
  961. KEY `id_version` (`id_version`)
  962. ) ENGINE=InnoDB;
  963. INSERT INTO t2 VALUES("3524", "1"),("3525", "1"),("1794", "4"),("102", "5"),("1822", "6"),("3382", "9");
  964. SELECT t2.id, t1.`label` FROM t2 INNER JOIN
  965. (SELECT t1.id_object as id_object FROM t1 WHERE t1.`label` LIKE '%test%') AS lbl
  966. ON (t2.id = lbl.id_object) INNER JOIN t1 ON (t2.id = t1.id_object);
  967. drop table t1,t2;
  968. create table t1 (a int, b varchar(200), c text not null) checksum=1 engine=myisam;
  969. create table t2 (a int, b varchar(200), c text not null) checksum=0 engine=innodb;
  970. create table t3 (a int, b varchar(200), c text not null) checksum=1 engine=innodb;
  971. insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
  972. insert t2 select * from t1;
  973. insert t3 select * from t1;
  974. checksum table t1, t2, t3, t4 quick;
  975. checksum table t1, t2, t3, t4;
  976. checksum table t1, t2, t3, t4 extended;
  977. #show table status;
  978. drop table t1,t2,t3;
  979. #
  980. # Test problem with refering to different fields in same table in UNION
  981. # (Bug #2552)
  982. #
  983. create table t1 (id int, name char(10) not null, name2 char(10) not null) engine=innodb;
  984. insert into t1 values(1,'first','fff'),(2,'second','sss'),(3,'third','ttt');
  985. select trim(name2) from t1 union all select trim(name) from t1 union all select trim(id) from t1;
  986. drop table t1;
  987. #
  988. # Bug2160
  989. #
  990. create table t1 (a int) engine=innodb;
  991. create table t2 like t1;
  992. drop table t1,t2;
  993. #
  994. # Test of automaticly created foreign keys
  995. #
  996. create table t1 (id int(11) not null, id2 int(11) not null, unique (id,id2)) engine=innodb;
  997. create table t2 (id int(11) not null, constraint t1_id_fk foreign key ( id ) references t1 (id)) engine = innodb;
  998. show create table t1;
  999. show create table t2;
  1000. create index id on t2 (id);
  1001. show create table t2;
  1002. create index id2 on t2 (id);
  1003. show create table t2;
  1004. drop index id2 on t2;
  1005. --error ER_DROP_INDEX_FK
  1006. drop index id on t2;
  1007. show create table t2;
  1008. drop table t2;
  1009. create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id,id2) references t1 (id,id2)) engine = innodb;
  1010. show create table t2;
  1011. create unique index id on t2 (id,id2);
  1012. show create table t2;
  1013. drop table t2;
  1014. # Check foreign key columns created in different order than key columns
  1015. create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb;
  1016. show create table t2;
  1017. drop table t2;
  1018. create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2), constraint t1_id_fk foreign key (id) references t1 (id)) engine = innodb;
  1019. show create table t2;
  1020. drop table t2;
  1021. create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb;
  1022. show create table t2;
  1023. drop table t2;
  1024. create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id), primary key (id), index (id,id2)) engine = innodb;
  1025. show create table t2;
  1026. drop table t2;
  1027. create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id)) engine= innodb;
  1028. show create table t2;
  1029. alter table t2 add index id_test (id), add index id_test2 (id,id2);
  1030. show create table t2;
  1031. drop table t2;
  1032. # Test error handling
  1033. # Embedded server doesn't chdir to data directory
  1034. --replace_result $MYSQLTEST_VARDIR . master-data/ ''
  1035. --error ER_WRONG_FK_DEF
  1036. create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb;
  1037. # bug#3749
  1038. create table t2 (a int auto_increment primary key, b int, index(b), foreign key (b) references t1(id), unique(b)) engine=innodb;
  1039. show create table t2;
  1040. drop table t2;
  1041. create table t2 (a int auto_increment primary key, b int, foreign key (b) references t1(id), foreign key (b) references t1(id), unique(b)) engine=innodb;
  1042. show create table t2;
  1043. drop table t2, t1;
  1044. #
  1045. # Bug #6126: Duplicate columns in keys gives misleading error message
  1046. #
  1047. --error 1060
  1048. create table t1 (c char(10), index (c,c)) engine=innodb;
  1049. --error 1060
  1050. create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=innodb;
  1051. --error 1060
  1052. create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)) engine=innodb;
  1053. --error 1060
  1054. create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)) engine=innodb;
  1055. create table t1 (c1 char(10), c2 char(10)) engine=innodb;
  1056. --error 1060
  1057. alter table t1 add key (c1,c1);
  1058. --error 1060
  1059. alter table t1 add key (c2,c1,c1);
  1060. --error 1060
  1061. alter table t1 add key (c1,c2,c1);
  1062. --error 1060
  1063. alter table t1 add key (c1,c1,c2);
  1064. drop table t1;
  1065. #
  1066. # Bug #4082: integer truncation
  1067. #
  1068. create table t1(a int(1) , b int(1)) engine=innodb;
  1069. insert into t1 values ('1111', '3333');
  1070. select distinct concat(a, b) from t1;
  1071. drop table t1;
  1072. #
  1073. # BUG#7709 test case - Boolean fulltext query against unsupported
  1074. # engines does not fail
  1075. #
  1076. CREATE TABLE t1 ( a char(10) ) ENGINE=InnoDB;
  1077. --error 1214
  1078. SELECT a FROM t1 WHERE MATCH (a) AGAINST ('test' IN BOOLEAN MODE);
  1079. DROP TABLE t1;
  1080. #
  1081. # check null values #1
  1082. #
  1083. --disable_warnings
  1084. CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  1085. INSERT INTO t1 VALUES (1),(2),(3);
  1086. CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY (b_id), KEY (b_a),
  1087. CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  1088. --enable_warnings
  1089. INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2);
  1090. SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz;
  1091. DROP TABLE t2;
  1092. DROP TABLE t1;
  1093. #
  1094. # Bug#11816 - Truncate table doesn't work with temporary innodb tables
  1095. # This is not an innodb bug, but we test it using innodb.
  1096. #
  1097. create temporary table t1 (a int) engine=innodb;
  1098. insert into t1 values (4711);
  1099. truncate t1;
  1100. insert into t1 values (42);
  1101. select * from t1;
  1102. drop table t1;
  1103. # Show that it works with permanent tables too.
  1104. create table t1 (a int) engine=innodb;
  1105. insert into t1 values (4711);
  1106. truncate t1;
  1107. insert into t1 values (42);
  1108. select * from t1;
  1109. drop table t1;
  1110. #
  1111. # Bug #13025 Server crash during filesort
  1112. #
  1113. create table t1 (a int not null, b int not null, c blob not null, d int not null, e int, primary key (a,b,c(255),d)) engine=innodb;
  1114. insert into t1 values (2,2,"b",2,2),(1,1,"a",1,1),(3,3,"ab",3,3);
  1115. select * from t1 order by a,b,c,d;
  1116. explain select * from t1 order by a,b,c,d;
  1117. drop table t1;
  1118. #
  1119. # BUG#11039,#13218 Wrong key length in min()
  1120. #
  1121. create table t1 (a char(1), b char(1), key(a, b)) engine=innodb;
  1122. insert into t1 values ('8', '6'), ('4', '7');
  1123. select min(a) from t1;
  1124. select min(b) from t1 where a='8';
  1125. drop table t1;
  1126. # End of 4.1 tests
  1127. #
  1128. # range optimizer problem
  1129. #
  1130. create table t1 (x bigint unsigned not null primary key) engine=innodb;
  1131. insert into t1(x) values (0xfffffffffffffff0),(0xfffffffffffffff1);
  1132. select * from t1;
  1133. select count(*) from t1 where x>0;
  1134. select count(*) from t1 where x=0;
  1135. select count(*) from t1 where x<0;
  1136. select count(*) from t1 where x < -16;
  1137. select count(*) from t1 where x = -16;
  1138. explain select count(*) from t1 where x > -16;
  1139. select count(*) from t1 where x > -16;
  1140. select * from t1 where x > -16;
  1141. select count(*) from t1 where x = 18446744073709551601;
  1142. drop table t1;
  1143. # Test for testable InnoDB status variables. This test
  1144. # uses previous ones(pages_created, rows_deleted, ...).
  1145. --replace_result 8192 8191
  1146. SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
  1147. SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size';
  1148. SELECT variable_value - @innodb_rows_deleted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted';
  1149. SELECT variable_value - @innodb_rows_inserted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted';
  1150. SELECT variable_value - @innodb_rows_updated_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated';
  1151. # Test for row locks InnoDB status variables.
  1152. SELECT variable_value - @innodb_row_lock_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_waits';
  1153. SELECT variable_value - @innodb_row_lock_current_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_current_waits';
  1154. SELECT variable_value - @innodb_row_lock_time_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time';
  1155. SELECT variable_value - @innodb_row_lock_time_max_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_max';
  1156. SELECT variable_value - @innodb_row_lock_time_avg_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg';
  1157. # Test for innodb_sync_spin_loops variable
  1158. SET @innodb_sync_spin_loops_orig = @@innodb_sync_spin_loops;
  1159. show variables like "innodb_sync_spin_loops";
  1160. set global innodb_sync_spin_loops=1000;
  1161. show variables like "innodb_sync_spin_loops";
  1162. set global innodb_sync_spin_loops=0;
  1163. show variables like "innodb_sync_spin_loops";
  1164. set global innodb_sync_spin_loops=20;
  1165. show variables like "innodb_sync_spin_loops";
  1166. set global innodb_sync_spin_loops=@innodb_sync_spin_loops_orig;
  1167. # Test for innodb_thread_concurrency variable
  1168. show variables like "innodb_thread_concurrency";
  1169. set global innodb_thread_concurrency=1001;
  1170. show variables like "innodb_thread_concurrency";
  1171. set global innodb_thread_concurrency=0;
  1172. show variables like "innodb_thread_concurrency";
  1173. set global innodb_thread_concurrency=16;
  1174. show variables like "innodb_thread_concurrency";
  1175. # Test for innodb_concurrency_tickets variable
  1176. show variables like "innodb_concurrency_tickets";
  1177. set global innodb_concurrency_tickets=1000;
  1178. show variables like "innodb_concurrency_tickets";
  1179. set global innodb_concurrency_tickets=0;
  1180. show variables like "innodb_concurrency_tickets";
  1181. set global innodb_concurrency_tickets=500;
  1182. show variables like "innodb_concurrency_tickets";
  1183. # Test for innodb_thread_sleep_delay variable
  1184. show variables like "innodb_thread_sleep_delay";
  1185. set global innodb_thread_sleep_delay=100000;
  1186. show variables like "innodb_thread_sleep_delay";
  1187. set global innodb_thread_sleep_delay=0;
  1188. show variables like "innodb_thread_sleep_delay";
  1189. set global innodb_thread_sleep_delay=10000;
  1190. show variables like "innodb_thread_sleep_delay";
  1191. #
  1192. # Test varchar
  1193. #
  1194. let $default=`select @@storage_engine`;
  1195. set storage_engine=INNODB;
  1196. # this should be fixed by MySQL (see Bug #51451)
  1197. set session old_alter_table=1;
  1198. source include/varchar.inc;
  1199. set session old_alter_table=0;
  1200. #
  1201. # Some errors/warnings on create
  1202. #
  1203. # Embedded server doesn't chdir to data directory
  1204. --replace_result $MYSQLTEST_VARDIR . master-data/ ''
  1205. create table t1 (v varchar(65530), key(v));
  1206. drop table t1;
  1207. create table t1 (v varchar(65536));
  1208. show create table t1;
  1209. drop table t1;
  1210. create table t1 (v varchar(65530) character set utf8);
  1211. show create table t1;
  1212. drop table t1;
  1213. eval set storage_engine=$default;
  1214. # InnoDB specific varchar tests
  1215. create table t1 (v varchar(16384)) engine=innodb;
  1216. drop table t1;
  1217. #
  1218. # BUG#11039 Wrong key length in min()
  1219. #
  1220. create table t1 (a char(1), b char(1), key(a, b)) engine=innodb;
  1221. insert into t1 values ('8', '6'), ('4', '7');
  1222. select min(a) from t1;
  1223. select min(b) from t1 where a='8';
  1224. drop table t1;
  1225. #
  1226. # Bug #11080 & #11005 Multi-row REPLACE fails on a duplicate key error
  1227. #
  1228. CREATE TABLE t1 ( `a` int(11) NOT NULL auto_increment, `b` int(11) default NULL,PRIMARY KEY (`a`),UNIQUE KEY `b` (`b`)) ENGINE=innodb;
  1229. insert into t1 (b) values (1);
  1230. replace into t1 (b) values (2), (1), (3);
  1231. select * from t1;
  1232. truncate table t1;
  1233. insert into t1 (b) values (1);
  1234. replace into t1 (b) values (2);
  1235. replace into t1 (b) values (1);
  1236. replace into t1 (b) values (3);
  1237. select * from t1;
  1238. drop table t1;
  1239. create table t1 (rowid int not null auto_increment, val int not null,primary
  1240. key (rowid), unique(val)) engine=innodb;
  1241. replace into t1 (val) values ('1'),('2');
  1242. replace into t1 (val) values ('1'),('2');
  1243. --error ER_DUP_ENTRY
  1244. insert into t1 (val) values ('1'),('2');
  1245. select * from t1;
  1246. drop table t1;
  1247. #
  1248. # Test that update does not change internal auto-increment value
  1249. #
  1250. create table t1 (a int not null auto_increment primary key, val int) engine=InnoDB;
  1251. insert into t1 (val) values (1);
  1252. update t1 set a=2 where a=1;
  1253. # We should get the following error because InnoDB does not update the counter
  1254. --error ER_DUP_ENTRY
  1255. insert into t1 (val) values (1);
  1256. select * from t1;
  1257. drop table t1;
  1258. #
  1259. # Bug #10465
  1260. #
  1261. --disable_warnings
  1262. CREATE TABLE t1 (GRADE DECIMAL(4) NOT NULL, PRIMARY KEY (GRADE)) ENGINE=INNODB;
  1263. --enable_warnings
  1264. INSERT INTO t1 (GRADE) VALUES (151),(252),(343);
  1265. SELECT GRADE FROM t1 WHERE GRADE > 160 AND GRADE < 300;
  1266. SELECT GRADE FROM t1 WHERE GRADE= 151;
  1267. DROP TABLE t1;
  1268. #
  1269. # Bug #12340 multitable delete deletes only one record
  1270. #
  1271. create table t1 (f1 varchar(10), f2 varchar(10), primary key (f1,f2)) engine=innodb;
  1272. create table t2 (f3 varchar(10), f4 varchar(10), key (f4)) engine=innodb;
  1273. insert into t2 values ('aa','cc');
  1274. insert into t1 values ('aa','bb'),('aa','cc');
  1275. delete t1 from t1,t2 where f1=f3 and f4='cc';
  1276. select * from t1;
  1277. drop table t1,t2;
  1278. #
  1279. # Test that the slow TRUNCATE implementation resets autoincrement columns
  1280. # (bug #11946)
  1281. #
  1282. CREATE TABLE t1 (
  1283. id INTEGER NOT NULL AUTO_INCREMENT, PRIMARY KEY (id)
  1284. ) ENGINE=InnoDB;
  1285. CREATE TABLE t2 (
  1286. id INTEGER NOT NULL,
  1287. FOREIGN KEY (id) REFERENCES t1 (id)
  1288. ) ENGINE=InnoDB;
  1289. INSERT INTO t1 (id) VALUES (NULL);
  1290. SELECT * FROM t1;
  1291. TRUNCATE t1;
  1292. INSERT INTO t1 (id) VALUES (NULL);
  1293. SELECT * FROM t1;
  1294. # continued from above; test that doing a slow TRUNCATE on a table with 0
  1295. # rows resets autoincrement columns
  1296. DELETE FROM t1;
  1297. TRUNCATE t1;
  1298. INSERT INTO t1 (id) VALUES (NULL);
  1299. SELECT * FROM t1;
  1300. DROP TABLE t2, t1;
  1301. # Test that foreign keys in temporary tables are not accepted (bug #12084)
  1302. CREATE TABLE t1
  1303. (
  1304. id INT PRIMARY KEY
  1305. ) ENGINE=InnoDB;
  1306. --error 1005,1005
  1307. CREATE TEMPORARY TABLE t2
  1308. (
  1309. id INT NOT NULL PRIMARY KEY,
  1310. b INT,
  1311. FOREIGN KEY (b) REFERENCES test.t1(id)
  1312. ) ENGINE=InnoDB;
  1313. DROP TABLE t1;
  1314. #
  1315. # Test that index column max sizes are honored (bug #13315)
  1316. #
  1317. # prefix index
  1318. create table t1 (col1 varchar(2000), index (col1(767)))
  1319. character set = latin1 engine = innodb;
  1320. # normal indexes
  1321. create table t2 (col1 char(255), index (col1))
  1322. character set = latin1 engine = innodb;
  1323. create table t3 (col1 binary(255), index (col1))
  1324. character set = latin1 engine = innodb;
  1325. create table t4 (col1 varchar(767), index (col1))
  1326. character set = latin1 engine = innodb;
  1327. create table t5 (col1 varchar(767) primary key)
  1328. character set = latin1 engine = innodb;
  1329. create table t6 (col1 varbinary(767) primary key)
  1330. character set = latin1 engine = innodb;
  1331. create table t7 (col1 text, index(col1(767)))
  1332. character set = latin1 engine = innodb;
  1333. create table t8 (col1 blob, index(col1(767)))
  1334. character set = latin1 engine = innodb;
  1335. # multi-column indexes are allowed to be longer
  1336. create table t9 (col1 varchar(512), col2 varchar(512), index(col1, col2))
  1337. character set = latin1 engine = innodb;
  1338. show create table t9;
  1339. drop table t1, t2, t3, t4, t5, t6, t7, t8, t9;
  1340. # these should have their index length trimmed
  1341. create table t1 (col1 varchar(768), index(col1))
  1342. character set = latin1 engine = innodb;
  1343. create table t2 (col1 varbinary(768), index(col1))
  1344. character set = latin1 engine = innodb;
  1345. create table t3 (col1 text, index(col1(768)))
  1346. character set = latin1 engine = innodb;
  1347. create table t4 (col1 blob, index(col1(768)))
  1348. character set = latin1 engine = innodb;
  1349. show create table t1;
  1350. drop table t1, t2, t3, t4;
  1351. # these should be refused
  1352. --error 1071
  1353. create table t1 (col1 varchar(768) primary key)
  1354. character set = latin1 engine = innodb;
  1355. --error 1071
  1356. create table t2 (col1 varbinary(768) primary key)
  1357. character set = latin1 engine = innodb;
  1358. --error 1071
  1359. create table t3 (col1 text, primary key(col1(768)))
  1360. character set = latin1 engine = innodb;
  1361. --error 1071
  1362. create table t4 (col1 blob, primary key(col1(768)))
  1363. character set = latin1 engine = innodb;
  1364. #
  1365. # Test improved foreign key error messages (bug #3443)
  1366. #
  1367. CREATE TABLE t1
  1368. (
  1369. id INT PRIMARY KEY
  1370. ) ENGINE=InnoDB;
  1371. CREATE TABLE t2
  1372. (
  1373. v INT,
  1374. CONSTRAINT c1 FOREIGN KEY (v) REFERENCES t1(id)
  1375. ) ENGINE=InnoDB;
  1376. --error 1452
  1377. INSERT INTO t2 VALUES(2);
  1378. INSERT INTO t1 VALUES(1);
  1379. INSERT INTO t2 VALUES(1);
  1380. --error 1451
  1381. DELETE FROM t1 WHERE id = 1;
  1382. --error 1217
  1383. DROP TABLE t1;
  1384. SET FOREIGN_KEY_CHECKS=0;
  1385. DROP TABLE t1;
  1386. SET FOREIGN_KEY_CHECKS=1;
  1387. --error 1452
  1388. INSERT INTO t2 VALUES(3);
  1389. DROP TABLE t2;
  1390. #
  1391. # Test that checksum table uses a consistent read Bug #12669
  1392. #
  1393. connect (a,localhost,root,,);
  1394. connect (b,localhost,root,,);
  1395. connection a;
  1396. create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
  1397. insert into t1 values (1),(2);
  1398. set autocommit=0;
  1399. checksum table t1;
  1400. connection b;
  1401. insert into t1 values(3);
  1402. connection a;
  1403. #
  1404. # Here checksum should not see insert
  1405. #
  1406. checksum table t1;
  1407. connection a;
  1408. commit;
  1409. checksum table t1;
  1410. commit;
  1411. drop table t1;
  1412. #
  1413. # autocommit = 1
  1414. #
  1415. connection a;
  1416. create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
  1417. insert into t1 values (1),(2);
  1418. set autocommit=1;
  1419. checksum table t1;
  1420. connection b;
  1421. set autocommit=1;
  1422. insert into t1 values(3);
  1423. connection a;
  1424. #
  1425. # Here checksum sees insert
  1426. #
  1427. checksum table t1;
  1428. drop table t1;
  1429. connection default;
  1430. disconnect a;
  1431. disconnect b;
  1432. # tests for bugs #9802 and #13778
  1433. # test that FKs between invalid types are not accepted
  1434. set foreign_key_checks=0;
  1435. create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb;
  1436. # Embedded server doesn't chdir to data directory
  1437. --replace_result $MYSQLTEST_VARDIR . master-data/ ''
  1438. -- error 1005
  1439. create table t1(a char(10) primary key, b varchar(20)) engine = innodb;
  1440. set foreign_key_checks=1;
  1441. drop table t2;
  1442. # test that FKs between different charsets are not accepted in CREATE even
  1443. # when f_k_c is 0
  1444. set foreign_key_checks=0;
  1445. create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1;
  1446. # Embedded server doesn't chdir to data directory
  1447. --replace_result $MYSQLTEST_VARDIR . master-data/ ''
  1448. -- error 1005
  1449. create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=utf8;
  1450. set foreign_key_checks=1;
  1451. drop table t1;
  1452. # test that invalid datatype conversions with ALTER are not allowed
  1453. set foreign_key_checks=0;
  1454. create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb;
  1455. create table t1(a varchar(10) primary key) engine = innodb;
  1456. -- error 1025,1025
  1457. alter table t1 modify column a int;
  1458. set foreign_key_checks=1;
  1459. drop table t2,t1;
  1460. # test that charset conversions with ALTER are allowed when f_k_c is 0
  1461. set foreign_key_checks=0;
  1462. create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1;
  1463. create table t1(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=latin1;
  1464. alter table t1 convert to character set utf8;
  1465. set foreign_key_checks=1;
  1466. drop table t2,t1;
  1467. # test that RENAME does not allow invalid charsets when f_k_c is 0
  1468. set foreign_key_checks=0;
  1469. create table t2 (a varchar(10), foreign key (a) references t1(a)) engine = innodb DEFAULT CHARSET=latin1;
  1470. create table t3(a varchar(10) primary key) engine = innodb DEFAULT CHARSET=utf8;
  1471. # Embedded server doesn't chdir to data directory
  1472. --replace_result $MYSQLD_DATADIR ./ master-data/ ''
  1473. -- error 1025
  1474. rename table t3 to t1;
  1475. set foreign_key_checks=1;
  1476. drop table t2,t3;
  1477. # test that foreign key errors are reported correctly (Bug #15550)
  1478. create table t1(a int primary key) row_format=redundant engine=innodb;
  1479. create table t2(a int primary key,constraint foreign key(a)references t1(a)) row_format=compact engine=innodb;
  1480. create table t3(a int primary key) row_format=compact engine=innodb;
  1481. create table t4(a int primary key,constraint foreign key(a)references t3(a)) row_format=redundant engine=innodb;
  1482. insert into t1 values(1);
  1483. insert into t3 values(1);
  1484. -- error 1452
  1485. insert into t2 values(2);
  1486. -- error 1452
  1487. insert into t4 values(2);
  1488. insert into t2 values(1);
  1489. insert into t4 values(1);
  1490. -- error 1451
  1491. update t1 set a=2;
  1492. -- error 1452
  1493. update t2 set a=2;
  1494. -- error 1451
  1495. update t3 set a=2;
  1496. -- error 1452
  1497. update t4 set a=2;
  1498. -- error 1451
  1499. truncate t1;
  1500. -- error 1451
  1501. truncate t3;
  1502. truncate t2;
  1503. truncate t4;
  1504. truncate t1;
  1505. truncate t3;
  1506. drop table t4,t3,t2,t1;
  1507. #
  1508. # Test that we can create a large (>1K) key
  1509. #
  1510. create table t1 (a varchar(255) character set utf8,
  1511. b varchar(255) character set utf8,
  1512. c varchar(255) character set utf8,
  1513. d varchar(255) character set utf8,
  1514. key (a,b,c,d)) engine=innodb;
  1515. drop table t1;
  1516. --error ER_TOO_LONG_KEY
  1517. create table t1 (a varchar(255) character set utf8,
  1518. b varchar(255) character set utf8,
  1519. c varchar(255) character set utf8,
  1520. d varchar(255) character set utf8,
  1521. e varchar(255) character set utf8,
  1522. key (a,b,c,d,e)) engine=innodb;
  1523. # test the padding of BINARY types and collations (Bug #14189)
  1524. create table t1 (s1 varbinary(2),primary key (s1)) engine=innodb;
  1525. create table t2 (s1 binary(2),primary key (s1)) engine=innodb;
  1526. create table t3 (s1 varchar(2) binary,primary key (s1)) engine=innodb;
  1527. create table t4 (s1 char(2) binary,primary key (s1)) engine=innodb;
  1528. insert into t1 values (0x41),(0x4120),(0x4100);
  1529. -- error ER_DUP_ENTRY
  1530. insert into t2 values (0x41),(0x4120),(0x4100);
  1531. insert into t2 values (0x41),(0x4120);
  1532. -- error ER_DUP_ENTRY
  1533. insert into t3 values (0x41),(0x4120),(0x4100);
  1534. insert into t3 values (0x41),(0x4100);
  1535. -- error ER_DUP_ENTRY
  1536. insert into t4 values (0x41),(0x4120),(0x4100);
  1537. insert into t4 values (0x41),(0x4100);
  1538. select hex(s1) from t1;
  1539. select hex(s1) from t2;
  1540. select hex(s1) from t3;
  1541. select hex(s1) from t4;
  1542. drop table t1,t2,t3,t4;
  1543. create table t1 (a int primary key,s1 varbinary(3) not null unique) engine=innodb;
  1544. create table t2 (s1 binary(2) not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=innodb;
  1545. insert into t1 values(1,0x4100),(2,0x41),(3,0x4120),(4,0x42);
  1546. -- error 1452
  1547. insert into t2 values(0x42);
  1548. insert into t2 values(0x41);
  1549. select hex(s1) from t2;
  1550. update t1 set s1=0x123456 where a=2;
  1551. select hex(s1) from t2;
  1552. -- error 1451
  1553. update t1 set s1=0x12 where a=1;
  1554. -- error 1451
  1555. update t1 set s1=0x12345678 where a=1;
  1556. -- error 1451
  1557. update t1 set s1=0x123457 where a=1;
  1558. update t1 set s1=0x1220 where a=1;
  1559. select hex(s1) from t2;
  1560. update t1 set s1=0x1200 where a=1;
  1561. select hex(s1) from t2;
  1562. update t1 set s1=0x4200 where a=1;
  1563. select hex(s1) from t2;
  1564. -- error 1451
  1565. delete from t1 where a=1;
  1566. delete from t1 where a=2;
  1567. update t2 set s1=0x4120;
  1568. -- error 1451
  1569. delete from t1;
  1570. delete from t1 where a!=3;
  1571. select a,hex(s1) from t1;
  1572. select hex(s1) from t2;
  1573. drop table t2,t1;
  1574. create table t1 (a int primary key,s1 varchar(2) binary not null unique) engine=innodb;
  1575. create table t2 (s1 char(2) binary not null, constraint c foreign key(s1) references t1(s1) on update cascade) engine=innodb;
  1576. insert into t1 values(1,0x4100),(2,0x41);
  1577. insert into t2 values(0x41);
  1578. select hex(s1) from t2;
  1579. update t1 set s1=0x1234 where a=1;
  1580. select hex(s1) from t2;
  1581. update t1 set s1=0x12 where a=2;
  1582. select hex(s1) from t2;
  1583. delete from t1 where a=1;
  1584. -- error 1451
  1585. delete from t1 where a=2;
  1586. select a,hex(s1) from t1;
  1587. select hex(s1) from t2;
  1588. drop table t2,t1;
  1589. # Ensure that <tablename>_ibfk_0 is not mistreated as a
  1590. # generated foreign key identifier. (Bug #16387)
  1591. CREATE TABLE t1(a INT, PRIMARY KEY(a)) ENGINE=InnoDB;
  1592. CREATE TABLE t2(a INT) ENGINE=InnoDB;
  1593. ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1(a);
  1594. ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_1;
  1595. ALTER TABLE t2 ADD CONSTRAINT t2_ibfk_0 FOREIGN KEY (a) REFERENCES t1(a);
  1596. ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_0;
  1597. SHOW CREATE TABLE t2;
  1598. DROP TABLE t2,t1;
  1599. #
  1600. # Test case for bug #16229: MySQL/InnoDB uses full explicit table locks in trigger processing
  1601. #
  1602. connect (a,localhost,root,,);
  1603. connect (b,localhost,root,,);
  1604. connection a;
  1605. create table t1(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
  1606. insert into t1(a) values (1),(2),(3);
  1607. commit;
  1608. connection b;
  1609. set autocommit = 0;
  1610. update t1 set b = 5 where a = 2;
  1611. connection a;
  1612. delimiter |;
  1613. create trigger t1t before insert on t1 for each row begin set NEW.b = NEW.a * 10 + 5, NEW.c = NEW.a / 10; end |
  1614. delimiter ;|
  1615. set autocommit = 0;
  1616. connection a;
  1617. insert into t1(a) values (10),(20),(30),(40),(50),(60),(70),(80),(90),(100),
  1618. (11),(21),(31),(41),(51),(61),(71),(81),(91),(101),
  1619. (12),(22),(32),(42),(52),(62),(72),(82),(92),(102),
  1620. (13),(23),(33),(43),(53),(63),(73),(83),(93),(103),
  1621. (14),(24),(34),(44),(54),(64),(74),(84),(94),(104);
  1622. connection b;
  1623. commit;
  1624. connection a;
  1625. commit;
  1626. drop trigger t1t;
  1627. drop table t1;
  1628. disconnect a;
  1629. disconnect b;
  1630. #
  1631. # Another trigger test
  1632. #
  1633. connect (a,localhost,root,,);
  1634. connect (b,localhost,root,,);
  1635. connection a;
  1636. create table t1(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
  1637. create table t2(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
  1638. create table t3(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
  1639. create table t4(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
  1640. create table t5(a int not null, b int, c int, d int, primary key(a)) engine=innodb;
  1641. insert into t1(a) values (1),(2),(3);
  1642. insert into t2(a) values (1),(2),(3);
  1643. insert into t3(a) values (1),(2),(3);
  1644. insert into t4(a) values (1),(2),(3);
  1645. insert into t3(a) values (5),(7),(8);
  1646. insert into t4(a) values (5),(7),(8);
  1647. insert into t5(a) values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12);
  1648. delimiter |;
  1649. create trigger t1t before insert on t1 for each row begin
  1650. INSERT INTO t2 SET a = NEW.a;
  1651. end |
  1652. create trigger t2t before insert on t2 for each row begin
  1653. DELETE FROM t3 WHERE a = NEW.a;
  1654. end |
  1655. create trigger t3t before delete on t3 for each row begin
  1656. UPDATE t4 SET b = b + 1 WHERE a = OLD.a;
  1657. end |
  1658. create trigger t4t before update on t4 for each row begin
  1659. UPDATE t5 SET b = b + 1 where a = NEW.a;
  1660. end |
  1661. delimiter ;|
  1662. commit;
  1663. set autocommit = 0;
  1664. update t1 set b = b + 5 where a = 1;
  1665. update t2 set b = b + 5 where a = 1;
  1666. update t3 set b = b + 5 where a = 1;
  1667. update t4 set b = b + 5 where a = 1;
  1668. insert into t5(a) values(20);
  1669. connection b;
  1670. set autocommit = 0;
  1671. insert into t1(a) values(7);
  1672. insert into t2(a) values(8);
  1673. delete from t2 where a = 3;
  1674. update t4 set b = b + 1 where a = 3;
  1675. commit;
  1676. drop trigger t1t;
  1677. drop trigger t2t;
  1678. drop trigger t3t;
  1679. drop trigger t4t;
  1680. drop table t1, t2, t3, t4, t5;
  1681. connection default;
  1682. disconnect a;
  1683. disconnect b;
  1684. #
  1685. # Test that cascading updates leading to duplicate keys give the correct
  1686. # error message (bug #9680)
  1687. #
  1688. CREATE TABLE t1 (
  1689. field1 varchar(8) NOT NULL DEFAULT '',
  1690. field2 varchar(8) NOT NULL DEFAULT '',
  1691. PRIMARY KEY (field1, field2)
  1692. ) ENGINE=InnoDB;
  1693. CREATE TABLE t2 (
  1694. field1 varchar(8) NOT NULL DEFAULT '' PRIMARY KEY,
  1695. FOREIGN KEY (field1) REFERENCES t1 (field1)
  1696. ON DELETE CASCADE ON UPDATE CASCADE
  1697. ) ENGINE=InnoDB;
  1698. INSERT INTO t1 VALUES ('old', 'somevalu');
  1699. INSERT INTO t1 VALUES ('other', 'anyvalue');
  1700. INSERT INTO t2 VALUES ('old');
  1701. INSERT INTO t2 VALUES ('other');
  1702. --error ER_FOREIGN_DUPLICATE_KEY
  1703. UPDATE t1 SET field1 = 'other' WHERE field2 = 'somevalu';
  1704. DROP TABLE t2;
  1705. DROP TABLE t1;
  1706. #
  1707. # Bug#18477 - MySQL/InnoDB Ignoring Foreign Keys in ALTER TABLE
  1708. #
  1709. create table t1 (
  1710. c1 bigint not null,
  1711. c2 bigint not null,
  1712. primary key (c1),
  1713. unique key (c2)
  1714. ) engine=innodb;
  1715. #
  1716. create table t2 (
  1717. c1 bigint not null,
  1718. primary key (c1)
  1719. ) engine=innodb;
  1720. #
  1721. alter table t1 add constraint c2_fk foreign key (c2)
  1722. references t2(c1) on delete cascade;
  1723. show create table t1;
  1724. #
  1725. alter table t1 drop foreign key c2_fk;
  1726. show create table t1;
  1727. #
  1728. drop table t1, t2;
  1729. #
  1730. # Bug #14360: problem with intervals
  1731. #
  1732. create table t1(a date) engine=innodb;
  1733. create table t2(a date, key(a)) engine=innodb;
  1734. insert into t1 values('2005-10-01');
  1735. insert into t2 values('2005-10-01');
  1736. select * from t1, t2
  1737. where t2.a between t1.a - interval 2 day and t1.a + interval 2 day;
  1738. drop table t1, t2;
  1739. create table t1 (id int not null, f_id int not null, f int not null,
  1740. primary key(f_id, id)) engine=innodb;
  1741. create table t2 (id int not null,s_id int not null,s varchar(200),
  1742. primary key(id)) engine=innodb;
  1743. INSERT INTO t1 VALUES (8, 1, 3);
  1744. INSERT INTO t1 VALUES (1, 2, 1);
  1745. INSERT INTO t2 VALUES (1, 0, '');
  1746. INSERT INTO t2 VALUES (8, 1, '');
  1747. commit;
  1748. DELETE ml.* FROM t1 AS ml LEFT JOIN t2 AS mm ON (mm.id=ml.id)
  1749. WHERE mm.id IS NULL;
  1750. select ml.* from t1 as ml left join t2 as mm on (mm.id=ml.id)
  1751. where mm.id is null lock in share mode;
  1752. drop table t1,t2;
  1753. #
  1754. # Test case where X-locks on unused rows should be released in a
  1755. # update (because READ COMMITTED isolation level)
  1756. #
  1757. connect (a,localhost,root,,);
  1758. connect (b,localhost,root,,);
  1759. connection a;
  1760. create table t1(a int not null, b int, primary key(a)) engine=innodb;
  1761. insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3);
  1762. commit;
  1763. SET binlog_format='MIXED';
  1764. set autocommit = 0;
  1765. SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
  1766. update t1 set b = 5 where b = 1;
  1767. connection b;
  1768. SET binlog_format='MIXED';
  1769. set autocommit = 0;
  1770. SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
  1771. #
  1772. # X-lock to record (7,3) should be released in a update
  1773. #
  1774. select * from t1 where a = 7 and b = 3 for update;
  1775. connection a;
  1776. commit;
  1777. connection b;
  1778. commit;
  1779. drop table t1;
  1780. connection default;
  1781. disconnect a;
  1782. disconnect b;
  1783. #
  1784. # Test case where no locks should be released (because we are not
  1785. # using READ COMMITTED isolation level)
  1786. #
  1787. connect (a,localhost,root,,);
  1788. connect (b,localhost,root,,);
  1789. connection a;
  1790. create table t1(a int not null, b int, primary key(a)) engine=innodb;
  1791. insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2);
  1792. commit;
  1793. set autocommit = 0;
  1794. select * from t1 lock in share mode;
  1795. update t1 set b = 5 where b = 1;
  1796. connection b;
  1797. set autocommit = 0;
  1798. #
  1799. # S-lock to records (2,2),(4,2), and (6,2) should not be released in a update
  1800. #
  1801. --error 1205
  1802. select * from t1 where a = 2 and b = 2 for update;
  1803. #
  1804. # X-lock to record (1,1),(3,1),(5,1) should not be released in a update
  1805. #
  1806. --error 1205
  1807. connection a;
  1808. commit;
  1809. connection b;
  1810. commit;
  1811. connection default;
  1812. disconnect a;
  1813. disconnect b;
  1814. drop table t1;
  1815. #
  1816. # Consistent read should be used in following selects
  1817. #
  1818. # 1) INSERT INTO ... SELECT
  1819. # 2) UPDATE ... = ( SELECT ...)
  1820. # 3) CREATE ... SELECT
  1821. connect (a,localhost,root,,);
  1822. connect (b,localhost,root,,);
  1823. connection a;
  1824. create table t1(a int not null, b int, primary key(a)) engine=innodb;
  1825. insert into t1 values (1,2),(5,3),(4,2);
  1826. create table t2(d int not null, e int, primary key(d)) engine=innodb;
  1827. insert into t2 values (8,6),(12,1),(3,1);
  1828. commit;
  1829. set autocommit = 0;
  1830. select * from t2 for update;
  1831. connection b;
  1832. SET binlog_format='MIXED';
  1833. set autocommit = 0;
  1834. SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
  1835. insert into t1 select * from t2;
  1836. update t1 set b = (select e from t2 where a = d);
  1837. create table t3(d int not null, e int, primary key(d)) engine=innodb
  1838. select * from t2;
  1839. commit;
  1840. connection a;
  1841. commit;
  1842. connection default;
  1843. disconnect a;
  1844. disconnect b;
  1845. drop table t1, t2, t3;
  1846. #
  1847. # Consistent read should not be used if
  1848. #
  1849. # (a) isolation level is serializable OR
  1850. # (b) select ... lock in share mode OR
  1851. # (c) select ... for update
  1852. #
  1853. # in following queries:
  1854. #
  1855. # 1) INSERT INTO ... SELECT
  1856. # 2) UPDATE ... = ( SELECT ...)
  1857. # 3) CREATE ... SELECT
  1858. connect (a,localhost,root,,);
  1859. connect (b,localhost,root,,);
  1860. connect (c,localhost,root,,);
  1861. connect (d,localhost,root,,);
  1862. connect (e,localhost,root,,);
  1863. connect (f,localhost,root,,);
  1864. connect (g,localhost,root,,);
  1865. connect (h,localhost,root,,);
  1866. connect (i,localhost,root,,);
  1867. connect (j,localhost,root,,);
  1868. connection a;
  1869. create table t1(a int not null, b int, primary key(a)) engine=innodb;
  1870. insert into t1 values (1,2),(5,3),(4,2);
  1871. create table t2(a int not null, b int, primary key(a)) engine=innodb;
  1872. insert into t2 values (8,6),(12,1),(3,1);
  1873. create table t3(d int not null, b int, primary key(d)) engine=innodb;
  1874. insert into t3 values (8,6),(12,1),(3,1);
  1875. create table t5(a int not null, b int, primary key(a)) engine=innodb;
  1876. insert into t5 values (1,2),(5,3),(4,2);
  1877. create table t6(d int not null, e int, primary key(d)) engine=innodb;
  1878. insert into t6 values (8,6),(12,1),(3,1);
  1879. create table t8(a int not null, b int, primary key(a)) engine=innodb;
  1880. insert into t8 values (1,2),(5,3),(4,2);
  1881. create table t9(d int not null, e int, primary key(d)) engine=innodb;
  1882. insert into t9 values (8,6),(12,1),(3,1);
  1883. commit;
  1884. set autocommit = 0;
  1885. select * from t2 for update;
  1886. connection b;
  1887. SET binlog_format='MIXED';
  1888. set autocommit = 0;
  1889. SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
  1890. --send
  1891. insert into t1 select * from t2;
  1892. connection c;
  1893. SET binlog_format='MIXED';
  1894. set autocommit = 0;
  1895. SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
  1896. --send
  1897. update t3 set b = (select b from t2 where a = d);
  1898. connection d;
  1899. SET binlog_format='MIXED';
  1900. set autocommit = 0;
  1901. SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
  1902. --send
  1903. create table t4(a int not null, b int, primary key(a)) engine=innodb select * from t2;
  1904. connection e;
  1905. SET binlog_format='MIXED';
  1906. set autocommit = 0;
  1907. SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
  1908. --send
  1909. insert into t5 (select * from t2 lock in share mode);
  1910. connection f;
  1911. SET binlog_format='MIXED';
  1912. set autocommit = 0;
  1913. SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
  1914. --send
  1915. update t6 set e = (select b from t2 where a = d lock in share mode);
  1916. connection g;
  1917. SET binlog_format='MIXED';
  1918. set autocommit = 0;
  1919. SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
  1920. --send
  1921. create table t7(a int not null, b int, primary key(a)) engine=innodb select * from t2 lock in share mode;
  1922. connection h;
  1923. SET binlog_format='MIXED';
  1924. set autocommit = 0;
  1925. SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
  1926. --send
  1927. insert into t8 (select * from t2 for update);
  1928. connection i;
  1929. SET binlog_format='MIXED';
  1930. set autocommit = 0;
  1931. SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
  1932. --send
  1933. update t9 set e = (select b from t2 where a = d for update);
  1934. connection j;
  1935. SET binlog_format='MIXED';
  1936. set autocommit = 0;
  1937. SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
  1938. --send
  1939. create table t10(a int not null, b int, primary key(a)) engine=innodb select * from t2 for update;
  1940. connection b;
  1941. --error 1205
  1942. reap;
  1943. connection c;
  1944. --error 1205
  1945. reap;
  1946. connection d;
  1947. --error 1205
  1948. reap;
  1949. connection e;
  1950. --error 1205
  1951. reap;
  1952. connection f;
  1953. --error 1205
  1954. reap;
  1955. connection g;
  1956. --error 1205
  1957. reap;
  1958. connection h;
  1959. --error 1205
  1960. reap;
  1961. connection i;
  1962. --error 1205
  1963. reap;
  1964. connection j;
  1965. --error 1205
  1966. reap;
  1967. connection a;
  1968. commit;
  1969. connection default;
  1970. disconnect a;
  1971. disconnect b;
  1972. disconnect c;
  1973. disconnect d;
  1974. disconnect e;
  1975. disconnect f;
  1976. disconnect g;
  1977. disconnect h;
  1978. disconnect i;
  1979. disconnect j;
  1980. drop table t1, t2, t3, t5, t6, t8, t9;
  1981. # bug 18934, "InnoDB crashes when table uses column names like DB_ROW_ID"
  1982. --error ER_WRONG_COLUMN_NAME
  1983. CREATE TABLE t1 (DB_ROW_ID int) engine=innodb;
  1984. #
  1985. # Bug #17152: Wrong result with BINARY comparison on aliased column
  1986. #
  1987. CREATE TABLE t1 (
  1988. a BIGINT(20) NOT NULL,
  1989. PRIMARY KEY (a)
  1990. ) ENGINE=INNODB DEFAULT CHARSET=UTF8;
  1991. CREATE TABLE t2 (
  1992. a BIGINT(20) NOT NULL,
  1993. b VARCHAR(128) NOT NULL,
  1994. c TEXT NOT NULL,
  1995. PRIMARY KEY (a,b),
  1996. KEY idx_t2_b_c (b,c(200)),
  1997. CONSTRAINT t_fk FOREIGN KEY (a) REFERENCES t1 (a)
  1998. ON DELETE CASCADE
  1999. ) ENGINE=INNODB DEFAULT CHARSET=UTF8;
  2000. INSERT INTO t1 VALUES (1);
  2001. INSERT INTO t2 VALUES (1, 'bar', 'vbar');
  2002. INSERT INTO t2 VALUES (1, 'BAR2', 'VBAR');
  2003. INSERT INTO t2 VALUES (1, 'bar_bar', 'bibi');
  2004. INSERT INTO t2 VALUES (1, 'customer_over', '1');
  2005. SELECT * FROM t2 WHERE b = 'customer_over';
  2006. SELECT * FROM t2 WHERE BINARY b = 'customer_over';
  2007. SELECT DISTINCT p0.a FROM t2 p0 WHERE p0.b = 'customer_over';
  2008. /* Bang: Empty result set, above was expected: */
  2009. SELECT DISTINCT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over';
  2010. SELECT p0.a FROM t2 p0 WHERE BINARY p0.b = 'customer_over';
  2011. drop table t2, t1;
  2012. #
  2013. # Test optimize on table with open transaction
  2014. #
  2015. CREATE TABLE t1 ( a int ) ENGINE=innodb;
  2016. BEGIN;
  2017. INSERT INTO t1 VALUES (1);
  2018. OPTIMIZE TABLE t1;
  2019. DROP TABLE t1;
  2020. #
  2021. # Bug #24741 (existing cascade clauses disappear when adding foreign keys)
  2022. #
  2023. CREATE TABLE t1 (id int PRIMARY KEY, f int NOT NULL, INDEX(f)) ENGINE=InnoDB;
  2024. CREATE TABLE t2 (id int PRIMARY KEY, f INT NOT NULL,
  2025. CONSTRAINT t2_t1 FOREIGN KEY (id) REFERENCES t1 (id)
  2026. ON DELETE CASCADE ON UPDATE CASCADE) ENGINE=InnoDB;
  2027. ALTER TABLE t2 ADD FOREIGN KEY (f) REFERENCES t1 (f) ON
  2028. DELETE CASCADE ON UPDATE CASCADE;
  2029. SHOW CREATE TABLE t2;
  2030. DROP TABLE t2, t1;
  2031. #
  2032. # Bug #25927: Prevent ALTER TABLE ... MODIFY ... NOT NULL on columns
  2033. # for which there is a foreign key constraint ON ... SET NULL.
  2034. #
  2035. CREATE TABLE t1 (a INT, INDEX(a)) ENGINE=InnoDB;
  2036. CREATE TABLE t2 (a INT, INDEX(a)) ENGINE=InnoDB;
  2037. INSERT INTO t1 VALUES (1);
  2038. INSERT INTO t2 VALUES (1);
  2039. ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1 (a) ON DELETE SET NULL;
  2040. # mysqltest first does replace_regex, then replace_result
  2041. --replace_regex /'[^']*test\/#sql-[0-9a-f_]*'/'#sql-temporary'/
  2042. # Embedded server doesn't chdir to data directory
  2043. --replace_result $MYSQLD_DATADIR ./ master-data/ ''
  2044. --error 1025
  2045. ALTER TABLE t2 MODIFY a INT NOT NULL;
  2046. DELETE FROM t1;
  2047. DROP TABLE t2,t1;
  2048. #
  2049. # Bug #26835: table corruption after delete+insert
  2050. #
  2051. CREATE TABLE t1 (a VARCHAR(5) COLLATE utf8_unicode_ci PRIMARY KEY)
  2052. ENGINE=InnoDB;
  2053. INSERT INTO t1 VALUES (0xEFBCA4EFBCA4EFBCA4);
  2054. DELETE FROM t1;
  2055. INSERT INTO t1 VALUES ('DDD');
  2056. SELECT * FROM t1;
  2057. DROP TABLE t1;
  2058. #
  2059. # Bug #23313 (AUTO_INCREMENT=# not reported back for InnoDB tables)
  2060. # Bug #21404 (AUTO_INCREMENT value reset when Adding FKEY (or ALTER?))
  2061. #
  2062. CREATE TABLE t1 (id int PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB
  2063. AUTO_INCREMENT=42;
  2064. INSERT INTO t1 VALUES (0),(347),(0);
  2065. SELECT * FROM t1;
  2066. SHOW CREATE TABLE t1;
  2067. CREATE TABLE t2 (id int PRIMARY KEY) ENGINE=InnoDB;
  2068. INSERT INTO t2 VALUES(42),(347),(348);
  2069. ALTER TABLE t1 ADD CONSTRAINT t1_t2 FOREIGN KEY (id) REFERENCES t2(id);
  2070. SHOW CREATE TABLE t1;
  2071. DROP TABLE t1,t2;
  2072. #
  2073. # Bug #21101 (Prints wrong error message if max row size is too large)
  2074. #
  2075. set innodb_strict_mode=on;
  2076. --error 1118
  2077. CREATE TABLE t1 (
  2078. c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255),
  2079. c05 CHAR(255), c06 CHAR(255), c07 CHAR(255), c08 CHAR(255),
  2080. c09 CHAR(255), c10 CHAR(255), c11 CHAR(255), c12 CHAR(255),
  2081. c13 CHAR(255), c14 CHAR(255), c15 CHAR(255), c16 CHAR(255),
  2082. c17 CHAR(255), c18 CHAR(255), c19 CHAR(255), c20 CHAR(255),
  2083. c21 CHAR(255), c22 CHAR(255), c23 CHAR(255), c24 CHAR(255),
  2084. c25 CHAR(255), c26 CHAR(255), c27 CHAR(255), c28 CHAR(255),
  2085. c29 CHAR(255), c30 CHAR(255), c31 CHAR(255), c32 CHAR(255)
  2086. ) ENGINE = InnoDB;
  2087. #
  2088. # Bug #31860 InnoDB assumes AUTOINC values can only be positive.
  2089. #
  2090. DROP TABLE IF EXISTS t1;
  2091. CREATE TABLE t1(
  2092. id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY
  2093. ) ENGINE=InnoDB;
  2094. INSERT INTO t1 VALUES(-10);
  2095. SELECT * FROM t1;
  2096. #
  2097. # NOTE: The server really needs to be restarted at this point
  2098. # for the test to be useful.
  2099. #
  2100. # Without the fix InnoDB would trip over an assertion here.
  2101. INSERT INTO t1 VALUES(NULL);
  2102. # The next value should be 1 and not -9 or a -ve number
  2103. SELECT * FROM t1;
  2104. DROP TABLE t1;
  2105. #
  2106. # Bug #21409 Incorrect result returned when in READ-COMMITTED with
  2107. # query_cache ON
  2108. #
  2109. CONNECT (c1,localhost,root,,);
  2110. CONNECT (c2,localhost,root,,);
  2111. CONNECTION c1;
  2112. SET binlog_format='MIXED';
  2113. SET TX_ISOLATION='read-committed';
  2114. SET AUTOCOMMIT=0;
  2115. DROP TABLE IF EXISTS t1, t2;
  2116. CREATE TABLE t1 ( a int ) ENGINE=InnoDB;
  2117. CREATE TABLE t2 LIKE t1;
  2118. SELECT * FROM t2;
  2119. CONNECTION c2;
  2120. SET binlog_format='MIXED';
  2121. SET TX_ISOLATION='read-committed';
  2122. SET AUTOCOMMIT=0;
  2123. INSERT INTO t1 VALUES (1);
  2124. COMMIT;
  2125. CONNECTION c1;
  2126. SELECT * FROM t1 WHERE a=1;
  2127. DISCONNECT c1;
  2128. DISCONNECT c2;
  2129. CONNECT (c1,localhost,root,,);
  2130. CONNECT (c2,localhost,root,,);
  2131. CONNECTION c1;
  2132. SET binlog_format='MIXED';
  2133. SET TX_ISOLATION='read-committed';
  2134. SET AUTOCOMMIT=0;
  2135. SELECT * FROM t2;
  2136. CONNECTION c2;
  2137. SET binlog_format='MIXED';
  2138. SET TX_ISOLATION='read-committed';
  2139. SET AUTOCOMMIT=0;
  2140. INSERT INTO t1 VALUES (2);
  2141. COMMIT;
  2142. CONNECTION c1;
  2143. # The result set below should be the same for both selects
  2144. SELECT * FROM t1 WHERE a=2;
  2145. SELECT * FROM t1 WHERE a=2;
  2146. DROP TABLE t1;
  2147. DROP TABLE t2;
  2148. DISCONNECT c1;
  2149. DISCONNECT c2;
  2150. CONNECTION default;
  2151. #
  2152. # Bug #29157 UPDATE, changed rows incorrect
  2153. #
  2154. create table t1 (i int, j int) engine=innodb;
  2155. insert into t1 (i, j) values (1, 1), (2, 2);
  2156. --enable_info
  2157. update t1 set j = 2;
  2158. --disable_info
  2159. drop table t1;
  2160. #
  2161. # Bug #32440 InnoDB free space info does not appear in SHOW TABLE STATUS or
  2162. # I_S
  2163. #
  2164. create table t1 (id int) comment='this is a comment' engine=innodb;
  2165. select table_comment, data_free > 0 as data_free_is_set
  2166. from information_schema.tables
  2167. where table_schema='test' and table_name = 't1';
  2168. drop table t1;
  2169. #
  2170. # Bug 34920 test
  2171. #
  2172. CONNECTION default;
  2173. CREATE TABLE t1 (
  2174. c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  2175. c2 VARCHAR(128) NOT NULL,
  2176. PRIMARY KEY(c1)
  2177. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=100;
  2178. CREATE TABLE t2 (
  2179. c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
  2180. c2 INT(10) UNSIGNED DEFAULT NULL,
  2181. PRIMARY KEY(c1)
  2182. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=200;
  2183. SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2';
  2184. ALTER TABLE t2 ADD CONSTRAINT t1_t2_1 FOREIGN KEY(c1) REFERENCES t1(c1);
  2185. SELECT AUTO_INCREMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name = 't2';
  2186. DROP TABLE t2;
  2187. DROP TABLE t1;
  2188. # End 34920 test
  2189. #
  2190. # Bug #29507 TRUNCATE shows to many rows effected
  2191. #
  2192. CONNECTION default;
  2193. CREATE TABLE t1 (c1 int default NULL,
  2194. c2 int default NULL
  2195. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  2196. --enable_info
  2197. TRUNCATE TABLE t1;
  2198. INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
  2199. TRUNCATE TABLE t1;
  2200. --disable_info
  2201. DROP TABLE t1;
  2202. #
  2203. # Bug#35537 Innodb doesn't increment handler_update and handler_delete.
  2204. #
  2205. -- disable_query_log
  2206. -- disable_result_log
  2207. CONNECT (c1,localhost,root,,);
  2208. DROP TABLE IF EXISTS bug35537;
  2209. CREATE TABLE bug35537 (
  2210. c1 int
  2211. ) ENGINE=InnoDB;
  2212. INSERT INTO bug35537 VALUES (1);
  2213. -- enable_result_log
  2214. SHOW SESSION STATUS LIKE 'Handler_update%';
  2215. SHOW SESSION STATUS LIKE 'Handler_delete%';
  2216. UPDATE bug35537 SET c1 = 2 WHERE c1 = 1;
  2217. DELETE FROM bug35537 WHERE c1 = 2;
  2218. SHOW SESSION STATUS LIKE 'Handler_update%';
  2219. SHOW SESSION STATUS LIKE 'Handler_delete%';
  2220. DROP TABLE bug35537;
  2221. DISCONNECT c1;
  2222. CONNECTION default;
  2223. SET GLOBAL innodb_thread_concurrency = @innodb_thread_concurrency_orig;
  2224. -- enable_query_log
  2225. # Clean up after the Bug#55284/Bug#58912 test case.
  2226. DROP TABLE bug58912;
  2227. #
  2228. # Test fix for bug 13117023. InnoDB increments HA_READ_KEY_COUNT (aka
  2229. # HANDLER_READ_KEY) when it should not.
  2230. #
  2231. create table t1 (f1 integer primary key) engine=innodb;
  2232. flush status;
  2233. show status like "handler_read_key";
  2234. select f1 from t1;
  2235. show status like "handler_read_key";
  2236. drop table t1;
  2237. #######################################################################
  2238. # #
  2239. # Please, DO NOT TOUCH this file as well as the innodb.result file. #
  2240. # These files are to be modified ONLY BY INNOBASE guys. #
  2241. # #
  2242. # Use innodb_mysql.[test|result] files instead. #
  2243. # #
  2244. # If nevertheless you need to make some changes here, please, forward #
  2245. # your commit message #
  2246. # To: innodb_dev_ww@oracle.com #
  2247. # Cc: dev-innodb@mysql.com #
  2248. # (otherwise your changes may be erased). #
  2249. # #
  2250. #######################################################################