diff options
author | unknown <chuck.bell@oracle.com> | 2012-01-30 10:23:21 -0500 |
---|---|---|
committer | unknown <chuck.bell@oracle.com> | 2012-01-30 10:23:21 -0500 |
commit | 7009bf411a8cb9a6e035b761b5e6352b4f474303 (patch) | |
tree | 9a7f9e1c893fd7ee514374eec7e411810d5f2151 /mysql-test | |
parent | 461e039a07062f05082175edb1156725ac43b4c6 (diff) | |
parent | 40bab62acff37c947e5d57203235ac0a6afc5f31 (diff) | |
download | mariadb-git-7009bf411a8cb9a6e035b761b5e6352b4f474303.tar.gz |
Merge with main for BUG#12969301
Diffstat (limited to 'mysql-test')
73 files changed, 2253 insertions, 115 deletions
diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index f528f1c473e..b3623402065 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -24,6 +24,4 @@ sys_vars.wait_timeout_func # Bug#11750645 2010-04-26 alik wai sys_vars.ndb_log_update_as_write_basic sys_vars.have_ndbcluster_basic sys_vars.ndb_log_updated_only_basic -sys_vars.query_cache_size_basic_64 # Bug#11748572 - 36747: ALLOCATING A LARGE QUERY CACHE IS NOT DETERMINISTIC -sys_vars.query_cache_size_basic_32 # Bug#11748572 - 36747: ALLOCATING A LARGE QUERY CACHE IS NOT DETERMINISTIC sys_vars.rpl_init_slave_func # Bug#12535301 2011-05-09 andrei sys_vars.rpl_init_slave_func mismatches in daily-5.5 diff --git a/mysql-test/extra/rpl_tests/rpl_extra_col_master.test b/mysql-test/extra/rpl_tests/rpl_extra_col_master.test index 513bc949c5d..235eb858d34 100644 --- a/mysql-test/extra/rpl_tests/rpl_extra_col_master.test +++ b/mysql-test/extra/rpl_tests/rpl_extra_col_master.test @@ -59,6 +59,8 @@ #VARCHAR(M) # +--let $_saved_conn= $CURRENT_CONNECTION + let $binformat = `SHOW VARIABLES LIKE '%binlog_format%'`; --echo --echo *********************************************************** @@ -1017,3 +1019,5 @@ SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1; connection master; DROP TABLE t5; sync_slave_with_master; + +--connection $_saved_conn diff --git a/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test b/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test index 42250764b54..5aa1d75c516 100644 --- a/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test +++ b/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test @@ -177,3 +177,36 @@ UNLOCK TABLES; --connection master DROP TABLE t1; sync_slave_with_master; + +# +# bug#3593869-64035 uninitialized event_coordinates instance crashes server +# Testing how out of valid range position value is handled with an error. +# + +--connection master +RESET MASTER; +let $master_pos= query_get_value(SHOW MASTER STATUS, Position, 1); +let $master_pos= `SELECT $master_pos + 1`; + +--connection slave +--source include/stop_slave.inc +--replace_regex /[0-9]+/MASTER_POS/ +eval CHANGE MASTER TO master_log_pos=$master_pos; + +START SLAVE; +# ER_MASTER_FATAL_ERROR_READING_BINLOG 1236 +--let $slave_param=Last_IO_Errno +--let $slave_param_value=1236 +--source include/wait_for_slave_param.inc + +--let $slave_field_result_replace= / at [0-9]*/ at XXX/ +--let $status_items= Last_IO_Errno, Last_IO_Error +--source include/show_slave_status.inc + +--source include/stop_slave.inc +RESET SLAVE; + +--connection master +RESET MASTER; + +# Slave is stopped by bug#3593869-64035 tests. diff --git a/mysql-test/include/have_example_plugin.inc b/mysql-test/include/have_example_plugin.inc index 8920399555d..88f4e212102 100644 --- a/mysql-test/include/have_example_plugin.inc +++ b/mysql-test/include/have_example_plugin.inc @@ -15,7 +15,7 @@ if (!$EXAMPLE_PLUGIN) { # # Check if --plugin-dir was setup for exampledb # -if (`SELECT CONCAT('--plugin-dir=', @@plugin_dir) != '$EXAMPLE_PLUGIN_OPT'`) { +if (`SELECT CONCAT('--plugin-dir=', REPLACE(@@plugin_dir, '\\\\', '/')) != '$EXAMPLE_PLUGIN_OPT/'`) { --skip Example plugin requires that --plugin-dir is set to the example plugin dir (either the .opt file does not contain \$EXAMPLE_PLUGIN_OPT or another plugin is in use) } enable_query_log; diff --git a/mysql-test/include/have_semisync_plugin.inc b/mysql-test/include/have_semisync_plugin.inc index 95899f559aa..1cd3b30be1c 100644 --- a/mysql-test/include/have_semisync_plugin.inc +++ b/mysql-test/include/have_semisync_plugin.inc @@ -16,6 +16,6 @@ if (!$SEMISYNC_MASTER_PLUGIN) # # Check if --plugin-dir was setup for semisync # -if (`SELECT CONCAT('--plugin-dir=', @@plugin_dir) != '$SEMISYNC_PLUGIN_OPT'`) { +if (`SELECT CONCAT('--plugin-dir=', REPLACE(@@plugin_dir, '\\\\', '/')) != '$SEMISYNC_PLUGIN_OPT/'`) { --skip SEMISYNC plugin requires that --plugin-dir is set to the semisync plugin dir (either the .opt file does not contain \$SEMISYNC_PLUGIN_OPT or another plugin is in use) } diff --git a/mysql-test/include/have_simple_parser.inc b/mysql-test/include/have_simple_parser.inc index d077916c5e7..0cedad27a77 100644 --- a/mysql-test/include/have_simple_parser.inc +++ b/mysql-test/include/have_simple_parser.inc @@ -15,6 +15,6 @@ if (!$SIMPLE_PARSER) { # # Check if --plugin-dir was setup for simple parser # -if (`SELECT CONCAT('--plugin-dir=', @@plugin_dir) != '$SIMPLE_PARSER_OPT'`) { +if (`SELECT CONCAT('--plugin-dir=', REPLACE(@@plugin_dir, '\\\\', '/')) != '$SIMPLE_PARSER_OPT/'`) { --skip simple parser requires that --plugin-dir is set to the udf plugin dir (either the .opt file does not contain \$UDF_EXAMPLE_LIB_OPT or another plugin is in use) } diff --git a/mysql-test/include/have_udf.inc b/mysql-test/include/have_udf.inc index 5c404b03729..993b9e13fdb 100644 --- a/mysql-test/include/have_udf.inc +++ b/mysql-test/include/have_udf.inc @@ -15,6 +15,6 @@ if (!$UDF_EXAMPLE_LIB) { # # Check if --plugin-dir was setup for udf # -if (`SELECT CONCAT('--plugin-dir=', @@plugin_dir) != '$UDF_EXAMPLE_LIB_OPT'`) { +if (`SELECT CONCAT('--plugin-dir=', REPLACE(@@plugin_dir, '\\\\', '/')) != '$UDF_EXAMPLE_LIB_OPT/'`) { --skip UDF requires that --plugin-dir is set to the udf plugin dir (either the .opt file does not contain \$UDF_EXAMPLE_LIB_OPT or another plugin is in use) } diff --git a/mysql-test/include/show_slave_status.inc b/mysql-test/include/show_slave_status.inc index 67b1c987954..52ec550ce60 100644 --- a/mysql-test/include/show_slave_status.inc +++ b/mysql-test/include/show_slave_status.inc @@ -55,6 +55,18 @@ # comma-separated list. Example: # # --let $status_items= Master_Log_File, Relay_Master_Log_File +# +# $slave_field_result_replace +# If set, one or more regex patterns for replacing variable +# text in the error message. Syntax as --replace-regex +# +# $slave_sql_mode +# If set, change the slave sql mode during this macro, reverting +# to the previous on exit. Default sql_mode is NO_BACKSLASH_ESCAPES +# to allow replace '\' by '/' making paths OS independent. Example: +# +# --let $slave_sql_mode= NO_BACKSLASH_ESCAPES +# --let $_show_slave_status_items=$status_items @@ -64,12 +76,30 @@ if (!$status_items) } +--let $_slave_sql_mode= NO_BACKSLASH_ESCAPES +if ($slave_sql_mode) +{ + --let $_slave_sql_mode= $slave_sql_mode +} +--let $_previous_slave_sql_mode = `SELECT @@sql_mode` +--disable_query_log +eval SET sql_mode= '$_slave_sql_mode'; +--enable_query_log + + while ($_show_slave_status_items) { --let $_show_slave_status_name= `SELECT SUBSTRING_INDEX('$_show_slave_status_items', ',', 1)` --let $_show_slave_status_items= `SELECT LTRIM(SUBSTRING('$_show_slave_status_items', LENGTH('$_show_slave_status_name') + 2))` --let $_show_slave_status_value= query_get_value(SHOW SLAVE STATUS, $_show_slave_status_name, 1) + --let $_slave_field_result_replace= /[\\]/\// $slave_field_result_replace + --replace_regex $_slave_field_result_replace --let $_show_slave_status_value= `SELECT REPLACE("$_show_slave_status_value", '$MYSQL_TEST_DIR', 'MYSQL_TEST_DIR')` --echo $_show_slave_status_name = '$_show_slave_status_value' } + + +--disable_query_log +eval SET sql_mode= '$_previous_slave_sql_mode'; +--enable_query_log diff --git a/mysql-test/include/wait_for_ndb_to_binlog.inc b/mysql-test/include/wait_for_ndb_to_binlog.inc index 77da6d62154..c1f94802724 100644 --- a/mysql-test/include/wait_for_ndb_to_binlog.inc +++ b/mysql-test/include/wait_for_ndb_to_binlog.inc @@ -1,13 +1,11 @@ # ==== Purpose ==== # -# Several test primitives from mysql-test/extra/rpl_tests -# shared for test cases for MyISAM, InnoDB, NDB and other -# engines. But for NDB all events will be added by NDB -# injector and now there are no way to detect the state of -# NDB injector therefore this primitive waits 5 sec -# if engine type is NDB. -# In future that should be fixed by waiting of proper -# state of NDB injector. +# Several test primitives from mysql-test/extra/rpl_tests +# are shared for test cases for MyISAM, InnoDB, NDB and +# other engines. +# For NDB engine all events will be added by NDB injector +# so tests only can continue after injector is ready, +# this test waits for proper injector thread state. # # ==== Usage ==== # @@ -17,25 +15,12 @@ # ==== Parameters ===== # # $engine_type -# Type of engine. If type is NDB then it waits $wait_time sec -# -# $wait_time -# Test will wait $wait_time seconds - -let $_wait_time= 5; - -if (!$wait_time) { - let $_wait_time= $wait_time; -} +# Type of engine. If type is NDB then it waits for injector +# thread proper state. if (`SELECT UPPER(LEFT('$engine_type',3)) = 'NDB'`) { - while (!$_wait_time) { - let $_wait_time_internal= 10; - while (!$_wait_time_internal) { - sleep 0.1; - dec $_wait_time_internal; - } - dec $_wait_time; - } + let $show_statement= SHOW PROCESSLIST; + let $field= State; + let $condition= = 'Waiting for event from ndbcluster'; + source include/wait_show_condition.inc; } - diff --git a/mysql-test/include/wait_for_slave_io_error.inc b/mysql-test/include/wait_for_slave_io_error.inc index e1609113b8f..4177bf4b858 100644 --- a/mysql-test/include/wait_for_slave_io_error.inc +++ b/mysql-test/include/wait_for_slave_io_error.inc @@ -33,6 +33,10 @@ # (e.g., temporary connection error) and does not cause the slave # IO thread to stop. # +# $slave_io_error_replace +# If set, one or more regex patterns for replacing variable +# text in the error message. Syntax as --replace-regex +# # $slave_timeout # See include/wait_for_slave_param.inc # @@ -72,6 +76,7 @@ if ($show_slave_io_error) { --let $_wait_for_slave_io_error_old_status_items= $status_items --let $status_items= Last_IO_Error + --let $slave_field_result_replace= $slave_io_error_replace --source include/show_slave_status.inc --let $status_items= $_wait_for_slave_io_error_old_status_items } diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result index 47a45efa5fd..652c5b96147 100644 --- a/mysql-test/r/bigint.result +++ b/mysql-test/r/bigint.result @@ -438,3 +438,67 @@ Level Code Message Note 1003 select 1 AS `1` from `test`.`t1` where ((`test`.`t1`.`a` = 0) and ('0' = `test`.`t1`.`b`)) DROP TABLE t1; # End of 5.1 tests +# +# Bug#13463415 63502: INCORRECT RESULTS OF BIGINT AND DECIMAL COMPARISON +# +CREATE TABLE t_bigint(id BIGINT); +INSERT INTO t_bigint VALUES (1), (2); +SELECT id, id >= 1.1 FROM t_bigint; +id id >= 1.1 +1 0 +2 1 +SELECT id, 1.1 <= id FROM t_bigint; +id 1.1 <= id +1 0 +2 1 +SELECT id, id = 1.1 FROM t_bigint; +id id = 1.1 +1 0 +2 0 +SELECT id, 1.1 = id FROM t_bigint; +id 1.1 = id +1 0 +2 0 +SELECT * from t_bigint WHERE id = 1.1; +id +SELECT * from t_bigint WHERE id = 1.1e0; +id +SELECT * from t_bigint WHERE id = '1.1'; +id +SELECT * from t_bigint WHERE id = '1.1e0'; +id +SELECT * from t_bigint WHERE id IN (1.1, 2.2); +id +SELECT * from t_bigint WHERE id IN (1.1e0, 2.2e0); +id +SELECT * from t_bigint WHERE id IN ('1.1', '2.2'); +id +SELECT * from t_bigint WHERE id IN ('1.1e0', '2.2e0'); +id +SELECT * from t_bigint WHERE id BETWEEN 1.1 AND 1.9; +id +SELECT * from t_bigint WHERE id BETWEEN 1.1e0 AND 1.9e0; +id +SELECT * from t_bigint WHERE id BETWEEN '1.1' AND '1.9'; +id +SELECT * from t_bigint WHERE id BETWEEN '1.1e0' AND '1.9e0'; +id +DROP TABLE t_bigint; +# +# Bug#11758543 50756: BIGINT '100' MATCHES 1.001E2 +# +CREATE TABLE t1 (a BIGINT); +INSERT INTO t1 VALUES (1); +SELECT * FROM t1 WHERE coalesce(a) BETWEEN 0 and 0.9; +a +SELECT * FROM t1 WHERE coalesce(a)=0.9; +a +SELECT * FROM t1 WHERE coalesce(a) in (0.8,0.9); +a +SELECT * FROM t1 WHERE a BETWEEN 0 AND 0.9; +a +SELECT * FROM t1 WHERE a=0.9; +a +SELECT * FROM t1 WHERE a IN (0.8,0.9); +a +DROP TABLE t1; diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 8237f174514..fc306e499d3 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -1928,6 +1928,30 @@ D120 SELECT HEX(INSERT(_utf8 0xD18FD18E, 2, 1, 0x20)); HEX(INSERT(_utf8 0xD18FD18E, 2, 1, 0x20)) D120D18E +# +# Bug#11752408 - 43593: DUMP/BACKUP/RESTORE/UPGRADE TOOLS FAILS BECAUSE OF UTF8_GENERAL_CI +# +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci); +INSERT INTO t1 VALUES ('a'),('r'),('s'),(_latin1 0xDF),(_latin1 0xF7),('t'),('z'); +SELECT * FROM t1 ORDER BY a; +a +a +r +s +t +z +ß +÷ +SELECT a, COUNT(*) FROM t1 GROUP BY a; +a COUNT(*) +a 1 +r 1 +s 1 +t 1 +z 1 +ß 1 +÷ 1 +DROP TABLE t1; End of 5.1 tests Start of 5.4 tests SET NAMES utf8mb3; diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result index 0b6117581f3..279a18e344e 100644 --- a/mysql-test/r/func_in.result +++ b/mysql-test/r/func_in.result @@ -469,6 +469,8 @@ SELECT HEX(a) FROM t2 WHERE a IN HEX(a) 7FFFFFFFFFFFFFFE 7FFFFFFFFFFFFFFF +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'abc' CREATE TABLE t3 (a BIGINT UNSIGNED); INSERT INTO t3 VALUES (9223372036854775551); SELECT HEX(a) FROM t3 WHERE a IN (9223372036854775807, 42); diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index abf76a533b3..adaa2df3a61 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -2826,5 +2826,41 @@ SELECT ((0xf3) * (rpad(1.0,2048,1)) << (0xcc)); ((0xf3) * (rpad(1.0,2048,1)) << (0xcc)) 0 # +# Bug#13359121 LARGE NUMBERS, /STRINGS/DTOA.C:662: +# BALLOC: ASSERTION `K <= 15' FAILED. +# Bug#12985021 SIMPLE QUERY WITH DECIMAL NUMBERS TAKE AN +# EXTRAORDINARY LONG TIME TO EXECUTE +SELECT @tmp_max:= @@global.max_allowed_packet; +@tmp_max:= @@global.max_allowed_packet +1048576 +SET @@global.max_allowed_packet=1024*1024*1024; +SELECT @@global.max_allowed_packet; +@@global.max_allowed_packet +1073741824 +do +format(rpad('111111111.1', +1111111, +'999999999999999999999999999999999999999999'),0,'be_BY') +; +DO +round( +concat( ( +coalesce( ( +linefromwkb('2147483648', +-b'1111111111111111111111111111111111111111111')), +( convert('[.DC2.]',decimal(30,30)) ), +bit_count('') +) ), +( lpad( ( elt('01','}:K5')), +sha1('P'), +( ( select '-9223372036854775808.1' > all (select ''))) +) +) +) +); +Warnings: +Warning 1292 Truncated incorrect DECIMAL value: '[.DC2.]' +SET @@global.max_allowed_packet:= @tmp_max; +# # End of 5.5 tests # diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index bad467b3255..7f3ecc0d602 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -1402,8 +1402,220 @@ NULL # Bug#12584302 AFTER FIX FOR #12403504: ASSERTION FAILED: DELSUM+(INT) Y/4-TEMP > 0, # DO WEEK((DATE_ADD((CAST(0 AS DATE)), INTERVAL 1 YEAR_MONTH)), 5); +# +# BUG#13458237 INCONSISTENT HANDLING OF INVALIDE DATES WITH ZERO DAY +# SIMILAR TO '2009-10-00' +# +SELECT +DATE('20091000'), +STR_TO_DATE('200910','%Y%m'), +LAST_DAY('2009-10-00'), +LAST_DAY(DATE('2009-10-00')), +LAST_DAY(DATE'2009-10-00'), +LAST_DAY(STR_TO_DATE('200910','%Y%m')), +WEEK('2009-10-00'), +WEEK(DATE('2009-10-00')), +WEEK(DATE'2009-10-00'), +WEEK(STR_TO_DATE('200910','%Y%m')), +WEEKOFYEAR('2009-10-00'), +WEEKOFYEAR(DATE('2009-10-00')), +WEEKOFYEAR(DATE'2009-10-00'), +WEEKOFYEAR(STR_TO_DATE('200910','%Y%m')), +DAYOFYEAR('2009-10-00'), +DAYOFYEAR(DATE('2009-10-00')), +DAYOFYEAR(DATE'2009-10-00'), +DAYOFYEAR(STR_TO_DATE('200910','%Y%m')), +WEEKDAY('2009-10-00'), +WEEKDAY(DATE('2009-10-00')), +WEEKDAY(DATE'2009-10-00'), +WEEKDAY(STR_TO_DATE('200910','%Y%m')), +TO_DAYs('2009-10-00'), +TO_DAYs(DATE('2009-10-00')), +TO_DAYs(DATE'2009-10-00'), +TO_DAYs(STR_TO_DATE('200910','%Y%m')); +DATE('20091000') 2009-10-00 +STR_TO_DATE('200910','%Y%m') 2009-10-00 +LAST_DAY('2009-10-00') NULL +LAST_DAY(DATE('2009-10-00')) 2009-10-31 +LAST_DAY(DATE'2009-10-00') NULL +LAST_DAY(STR_TO_DATE('200910','%Y%m')) 2009-10-31 +WEEK('2009-10-00') NULL +WEEK(DATE('2009-10-00')) 39 +WEEK(DATE'2009-10-00') NULL +WEEK(STR_TO_DATE('200910','%Y%m')) NULL +WEEKOFYEAR('2009-10-00') NULL +WEEKOFYEAR(DATE('2009-10-00')) 40 +WEEKOFYEAR(DATE'2009-10-00') NULL +WEEKOFYEAR(STR_TO_DATE('200910','%Y%m')) NULL +DAYOFYEAR('2009-10-00') NULL +DAYOFYEAR(DATE('2009-10-00')) 273 +DAYOFYEAR(DATE'2009-10-00') NULL +DAYOFYEAR(STR_TO_DATE('200910','%Y%m')) NULL +WEEKDAY('2009-10-00') NULL +WEEKDAY(DATE('2009-10-00')) 2 +WEEKDAY(DATE'2009-10-00') NULL +WEEKDAY(STR_TO_DATE('200910','%Y%m')) NULL +TO_DAYs('2009-10-00') NULL +TO_DAYs(DATE('2009-10-00')) 734045 +TO_DAYs(DATE'2009-10-00') NULL +TO_DAYs(STR_TO_DATE('200910','%Y%m')) NULL +Warnings: +Level Warning +Code 1292 +Message Incorrect datetime value: '2009-10-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '2009-10-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '2009-10-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '2009-10-00' +Level Warning +Code 1411 +Message Incorrect datetime value: '200910' for function str_to_date +Level Warning +Code 1292 +Message Incorrect datetime value: '2009-10-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '2009-10-00' +Level Warning +Code 1411 +Message Incorrect datetime value: '200910' for function str_to_date +Level Warning +Code 1292 +Message Incorrect datetime value: '2009-10-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '2009-10-00' +Level Warning +Code 1411 +Message Incorrect datetime value: '200910' for function str_to_date +Level Warning +Code 1292 +Message Incorrect datetime value: '2009-10-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '2009-10-00' +Level Warning +Code 1411 +Message Incorrect datetime value: '200910' for function str_to_date +Level Warning +Code 1292 +Message Incorrect datetime value: '2009-10-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '2009-10-00' +Level Warning +Code 1411 +Message Incorrect datetime value: '200910' for function str_to_date +SELECT +DATE('00000100'), +STR_TO_DATE('000001','%Y%m'), +LAST_DAY('0000-01-00'), +LAST_DAY(DATE('0000-01-00')), +LAST_DAY(DATE'0000-01-00'), +LAST_DAY(STR_TO_DATE('000001','%Y%m')), +WEEK('0000-01-00'), +WEEK(DATE('0000-01-00')), +WEEK(DATE'0000-01-00'), +WEEK(STR_TO_DATE('000001','%Y%m')), +WEEKOFYEAR('0000-01-00'), +WEEKOFYEAR(DATE('0000-01-00')), +WEEKOFYEAR(DATE'0000-01-00'), +WEEKOFYEAR(STR_TO_DATE('000001','%Y%m')), +DAYOFYEAR('0000-01-00'), +DAYOFYEAR(DATE('0000-01-00')), +DAYOFYEAR(DATE'0000-01-00'), +DAYOFYEAR(STR_TO_DATE('000001','%Y%m')), +WEEKDAY('0000-01-00'), +WEEKDAY(DATE('0000-01-00')), +WEEKDAY(DATE'0000-01-00'), +WEEKDAY(STR_TO_DATE('000001','%Y%m')), +TO_DAYs('0000-01-00'), +TO_DAYs(DATE('0000-01-00')), +TO_DAYs(DATE'0000-01-00'), +TO_DAYs(STR_TO_DATE('000001','%Y%m')); +DATE('00000100') 0000-01-00 +STR_TO_DATE('000001','%Y%m') 0000-01-00 +LAST_DAY('0000-01-00') NULL +LAST_DAY(DATE('0000-01-00')) 0000-01-31 +LAST_DAY(DATE'0000-01-00') NULL +LAST_DAY(STR_TO_DATE('000001','%Y%m')) 0000-01-31 +WEEK('0000-01-00') NULL +WEEK(DATE('0000-01-00')) 52 +WEEK(DATE'0000-01-00') NULL +WEEK(STR_TO_DATE('000001','%Y%m')) NULL +WEEKOFYEAR('0000-01-00') NULL +WEEKOFYEAR(DATE('0000-01-00')) 52 +WEEKOFYEAR(DATE'0000-01-00') NULL +WEEKOFYEAR(STR_TO_DATE('000001','%Y%m')) NULL +DAYOFYEAR('0000-01-00') NULL +DAYOFYEAR(DATE('0000-01-00')) 0 +DAYOFYEAR(DATE'0000-01-00') NULL +DAYOFYEAR(STR_TO_DATE('000001','%Y%m')) NULL +WEEKDAY('0000-01-00') NULL +WEEKDAY(DATE('0000-01-00')) 5 +WEEKDAY(DATE'0000-01-00') NULL +WEEKDAY(STR_TO_DATE('000001','%Y%m')) NULL +TO_DAYs('0000-01-00') NULL +TO_DAYs(DATE('0000-01-00')) 0 +TO_DAYs(DATE'0000-01-00') NULL +TO_DAYs(STR_TO_DATE('000001','%Y%m')) NULL Warnings: -Warning 1292 Incorrect datetime value: '0' +Level Warning +Code 1292 +Message Incorrect datetime value: '0000-01-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '0000-01-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '0000-01-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '0000-01-00' +Level Warning +Code 1411 +Message Incorrect datetime value: '000001' for function str_to_date +Level Warning +Code 1292 +Message Incorrect datetime value: '0000-01-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '0000-01-00' +Level Warning +Code 1411 +Message Incorrect datetime value: '000001' for function str_to_date +Level Warning +Code 1292 +Message Incorrect datetime value: '0000-01-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '0000-01-00' +Level Warning +Code 1411 +Message Incorrect datetime value: '000001' for function str_to_date +Level Warning +Code 1292 +Message Incorrect datetime value: '0000-01-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '0000-01-00' +Level Warning +Code 1411 +Message Incorrect datetime value: '000001' for function str_to_date +Level Warning +Code 1292 +Message Incorrect datetime value: '0000-01-00' +Level Warning +Code 1292 +Message Incorrect datetime value: '0000-01-00' +Level Warning +Code 1411 +Message Incorrect datetime value: '000001' for function str_to_date End of 5.1 tests # # Bug#57039: constant subtime expression returns incorrect result. @@ -1433,6 +1645,21 @@ NULL 1 NULL SET storage_engine=NULL; ERROR 42000: Variable 'storage_engine' can't be set to the value of 'NULL' # +# BUG#13354387 - CRASH IN IN MY_DECIMAL::OPERATOR FOR VIEW AND FUNCTION UNIX_TIMESTAMP +# Part1 (5.5) +SET time_zone='+03:00'; +CREATE TABLE t1 (a DATETIME NOT NULL); +INSERT INTO t1 VALUES ('2009-09-20 07:32:39.06'); +INSERT INTO t1 VALUES ('0000-00-00 00:00:00.00'); +CREATE VIEW v1 AS SELECT * FROM t1; +SELECT CAST(UNIX_TIMESTAMP(a) AS DECIMAL(25,3)) AS c1 FROM v1 ORDER BY 1; +c1 +0.000 +1253421159.000 +DROP VIEW v1; +DROP TABLE t1; +SET time_zone=DEFAULT; +# # Bug #59686 crash in String::copy() with time data type # SELECT min(timestampadd(month, 1>'', from_days('%Z'))); diff --git a/mysql-test/r/init_connect.result b/mysql-test/r/init_connect.result index f5ec0bdc932..0ff6c206422 100644 --- a/mysql-test/r/init_connect.result +++ b/mysql-test/r/init_connect.result @@ -20,6 +20,8 @@ hex(a) 616263 set GLOBAL init_connect="adsfsdfsdfs"; select @a; +ERROR 08S01: Aborted connection to db: 'test' user: 'user_1' host: 'localhost' (init_connect command failed) +select @a; Got one of the listed errors drop table t1; End of 4.1 tests diff --git a/mysql-test/r/key_cache.result b/mysql-test/r/key_cache.result index 844109dba1f..d63698710bf 100644 --- a/mysql-test/r/key_cache.result +++ b/mysql-test/r/key_cache.result @@ -383,3 +383,19 @@ Variable_name Value key_cache_block_size 1536 SET GLOBAL key_cache_block_size= @bug28478_key_cache_block_size; DROP TABLE t1; +# +# Bug#12361113: crash when load index into cache +# +# Note that this creates an empty disabled key cache! +SET GLOBAL key_cache_none.key_cache_block_size = 1024; +CREATE TABLE t1 (a INT, b INTEGER NOT NULL, KEY (b) ) ENGINE = MYISAM; +INSERT INTO t1 VALUES (1, 1); +CACHE INDEX t1 in key_cache_none; +ERROR HY000: Unknown key cache 'key_cache_none' +# The bug crashed the server at LOAD INDEX below. Now it will succeed +# since the default cache is used due to CACHE INDEX failed for +# key_cache_none. +LOAD INDEX INTO CACHE t1; +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +DROP TABLE t1; diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result index 42fb1945d8b..2f71084564d 100644 --- a/mysql-test/r/mysqlcheck.result +++ b/mysql-test/r/mysqlcheck.result @@ -206,6 +206,7 @@ DROP TABLE `@`; CREATE TABLE `я` (a INT) engine=myisam; SET NAMES DEFAULT; mysqlcheck --default-character-set="latin1" --databases test +call mtr.add_suppression("Can't find file: '..test.@003f.frm'"); test.? Error : Table doesn't exist status : Operation failed diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result index cb727984ec0..8dacb035f36 100644 --- a/mysql-test/r/mysqld--help-notwin.result +++ b/mysql-test/r/mysqld--help-notwin.result @@ -671,6 +671,9 @@ The following options may be given as the first argument: replication. --sql-mode=name Syntax: sql-mode=mode[,mode[,mode...]]. See the manual for the complete list of valid sql modes + --stored-program-cache=# + The soft upper limit for number of cached stored routines + for one connection. -s, --symbolic-links Enable symbolic link support. --sync-binlog=# Synchronously flush binary log to disk after every #th @@ -935,6 +938,7 @@ slow-query-log FALSE sort-buffer-size 2097152 sporadic-binlog-dump-fail FALSE sql-mode +stored-program-cache 256 symbolic-links FALSE sync-binlog 0 sync-frm TRUE diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result index 2ef52355f90..d7a06c5b23e 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -679,6 +679,9 @@ The following options may be given as the first argument: --sql-mode=name Syntax: sql-mode=mode[,mode[,mode...]]. See the manual for the complete list of valid sql modes --standalone Dummy option to start as a standalone program (NT). + --stored-program-cache=# + The soft upper limit for number of cached stored routines + for one connection. -s, --symbolic-links Enable symbolic link support. --sync-binlog=# Synchronously flush binary log to disk after every #th @@ -946,6 +949,7 @@ slow-start-timeout 15000 sort-buffer-size 2097152 sporadic-binlog-dump-fail FALSE sql-mode +stored-program-cache 256 symbolic-links FALSE sync-binlog 0 sync-frm TRUE diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 8f6add75fd3..0148949ef8f 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -4628,6 +4628,445 @@ ALTER DATABASE `test-database` CHARACTER SET utf8 COLLATE utf8_unicode_ci ; DROP DATABASE `test-database`; USE test; # +# BUG#11760384 : 52792: mysqldump in XML mode does not dump routines. +# +CREATE DATABASE BUG52792; +USE BUG52792; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(20)); +CREATE TABLE t2 (c1 INT); +INSERT INTO t1 VALUES (1, 'aaa'), (2, 'bbb'), (3, 'ccc'); +INSERT INTO t2 VALUES (1),(2),(3); +# Stored Procedures. +CREATE PROCEDURE simpleproc1 (OUT param1 INT) +BEGIN +SELECT COUNT(*) INTO param1 FROM t1; +END// +CREATE PROCEDURE simpleproc2 (OUT param1 INT) +BEGIN +SELECT COUNT(*) INTO param1 FROM t2; +END// +# Events. +CREATE EVENT e1 ON SCHEDULE EVERY 1 SECOND DO DROP DATABASE BUG52792; +CREATE EVENT e2 ON SCHEDULE EVERY 1 SECOND DO DROP DATABASE BUG52792; +# Functions. +CREATE FUNCTION `hello1` (s CHAR(20)) +RETURNS CHAR(50) DETERMINISTIC +RETURN CONCAT('Hello, ' ,s ,'!'); +CREATE FUNCTION `hello2` (s CHAR(20)) +RETURNS CHAR(50) DETERMINISTIC +RETURN CONCAT(']]>, ' , s ,'!'); +# Triggers. +CREATE TRIGGER trig1 BEFORE INSERT ON t2 +FOR EACH ROW BEGIN +INSERT INTO t2 VALUES(1); +END; +| +CREATE TRIGGER trig2 AFTER INSERT ON t2 +FOR EACH ROW BEGIN +INSERT INTO t2 VALUES(1, ']]>'); +INSERT INTO t2 VALUES(2, '<![CDATA]]>'); +INSERT INTO t2 VALUES(3, '<![CDATA['); +INSERT INTO t2 VALUES(4, '< > & \ " _'); +END; +| +# Views +CREATE VIEW v1 AS SELECT * FROM t1; +CREATE VIEW v2 AS SELECT * FROM t2; + +# Dumping BUG52792 database in xml format. + +# Running 'replace_regex on timestamp' +<?xml version="1.0"?> +<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> +<database name="BUG52792"> + <table_structure name="t1"> + <field Field="c1" Type="int(11)" Null="YES" Key="" Extra="" Comment="" /> + <field Field="c2" Type="varchar(20)" Null="YES" Key="" Extra="" Comment="" /> + <options Name="t1" Engine="MyISAM" Version="10" Row_format="Dynamic" Rows="3" Avg_row_length="20" Data_length="60" Max_data_length="281474976710655" Index_length="1024" Data_free="0" Create_time="--TIME--" Update_time="--TIME--" Collation="latin1_swedish_ci" Create_options="" Comment="" /> + </table_structure> + <table_data name="t1"> + <row> + <field name="c1">1</field> + <field name="c2">aaa</field> + </row> + <row> + <field name="c1">2</field> + <field name="c2">bbb</field> + </row> + <row> + <field name="c1">3</field> + <field name="c2">ccc</field> + </row> + </table_data> + <table_structure name="t2"> + <field Field="c1" Type="int(11)" Null="YES" Key="" Extra="" Comment="" /> + <options Name="t2" Engine="MyISAM" Version="10" Row_format="Fixed" Rows="3" Avg_row_length="7" Data_length="21" Max_data_length="1970324836974591" Index_length="1024" Data_free="0" Create_time="--TIME--" Update_time="--TIME--" Collation="latin1_swedish_ci" Create_options="" Comment="" /> + </table_structure> + <table_data name="t2"> + <row> + <field name="c1">1</field> + </row> + <row> + <field name="c1">2</field> + </row> + <row> + <field name="c1">3</field> + </row> + </table_data> + <triggers name="t2"> + <trigger Trigger="trig1" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci"> +<![CDATA[ +CREATE DEFINER=`root`@`localhost` TRIGGER trig1 BEFORE INSERT ON t2 +FOR EACH ROW BEGIN +INSERT INTO t2 VALUES(1); +END +]]> + </trigger> + <trigger Trigger="trig2" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci"> +<![CDATA[ +CREATE DEFINER=`root`@`localhost` TRIGGER trig2 AFTER INSERT ON t2 +FOR EACH ROW BEGIN +INSERT INTO t2 VALUES(1, ']]]]><![CDATA[>'); +INSERT INTO t2 VALUES(2, '<![CDATA]]]]><![CDATA[>'); +INSERT INTO t2 VALUES(3, '<![CDATA['); +INSERT INTO t2 VALUES(4, '< > & \ " _'); +END +]]> + </trigger> + </triggers> + <table_structure name="v1"> + <field Field="c1" Type="int(11)" Null="YES" Key="" Extra="" Comment="" /> + <field Field="c2" Type="varchar(20)" Null="YES" Key="" Extra="" Comment="" /> + <options Name="v1" Comment="VIEW" /> + </table_structure> + <table_structure name="v2"> + <field Field="c1" Type="int(11)" Null="YES" Key="" Extra="" Comment="" /> + <options Name="v2" Comment="VIEW" /> + </table_structure> + <events> + <event Event="e1" sql_mode="" time_zone="SYSTEM" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci"> +<![CDATA[ +CREATE DEFINER=`root`@`localhost` EVENT `e1` ON SCHEDULE EVERY 1 SECOND STARTS '--TIME--' ON COMPLETION NOT PRESERVE ENABLE DO DROP DATABASE BUG52792 +]]> + </event> + <event Event="e2" sql_mode="" time_zone="SYSTEM" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci"> +<![CDATA[ +CREATE DEFINER=`root`@`localhost` EVENT `e2` ON SCHEDULE EVERY 1 SECOND STARTS '--TIME--' ON COMPLETION NOT PRESERVE ENABLE DO DROP DATABASE BUG52792 +]]> + </event> + </events> + <routines> + <routine Function="hello1" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci"> +<![CDATA[ +CREATE DEFINER=`root`@`localhost` FUNCTION `hello1`(s CHAR(20)) RETURNS char(50) CHARSET latin1 + DETERMINISTIC +RETURN CONCAT('Hello, ' ,s ,'!') +]]> + </routine> + <routine Function="hello2" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci"> +<![CDATA[ +CREATE DEFINER=`root`@`localhost` FUNCTION `hello2`(s CHAR(20)) RETURNS char(50) CHARSET latin1 + DETERMINISTIC +RETURN CONCAT(']]]]><![CDATA[>, ' , s ,'!') +]]> + </routine> + <routine Procedure="simpleproc1" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci"> +<![CDATA[ +CREATE DEFINER=`root`@`localhost` PROCEDURE `simpleproc1`(OUT param1 INT) +BEGIN +SELECT COUNT(*) INTO param1 FROM t1; +END +]]> + </routine> + <routine Procedure="simpleproc2" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci"> +<![CDATA[ +CREATE DEFINER=`root`@`localhost` PROCEDURE `simpleproc2`(OUT param1 INT) +BEGIN +SELECT COUNT(*) INTO param1 FROM t2; +END +]]> + </routine> + </routines> +</database> +</mysqldump> + +# Dumping BUG52792 database in xml format with comments. + +# Running 'replace_regex on timestamp' +<?xml version="1.0"?> +<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> +<database name="BUG52792"> +<!-- +- +- Table structure for table `t1` +- + + --> + <table_structure name="t1"> + <field Field="c1" Type="int(11)" Null="YES" Key="" Extra="" Comment="" /> + <field Field="c2" Type="varchar(20)" Null="YES" Key="" Extra="" Comment="" /> + <options Name="t1" Engine="MyISAM" Version="10" Row_format="Dynamic" Rows="3" Avg_row_length="20" Data_length="60" Max_data_length="281474976710655" Index_length="1024" Data_free="0" Create_time="--TIME--" Update_time="--TIME--" Collation="latin1_swedish_ci" Create_options="" Comment="" /> + </table_structure> +<!-- +- +- Dumping data for table `t1` +- + --> + <table_data name="t1"> + <row> + <field name="c1">1</field> + <field name="c2">aaa</field> + </row> + <row> + <field name="c1">2</field> + <field name="c2">bbb</field> + </row> + <row> + <field name="c1">3</field> + <field name="c2">ccc</field> + </row> + </table_data> +<!-- +- +- Table structure for table `t2` +- + + --> + <table_structure name="t2"> + <field Field="c1" Type="int(11)" Null="YES" Key="" Extra="" Comment="" /> + <options Name="t2" Engine="MyISAM" Version="10" Row_format="Fixed" Rows="3" Avg_row_length="7" Data_length="21" Max_data_length="1970324836974591" Index_length="1024" Data_free="0" Create_time="--TIME--" Update_time="--TIME--" Collation="latin1_swedish_ci" Create_options="" Comment="" /> + </table_structure> +<!-- +- +- Dumping data for table `t2` +- + --> + <table_data name="t2"> + <row> + <field name="c1">1</field> + </row> + <row> + <field name="c1">2</field> + </row> + <row> + <field name="c1">3</field> + </row> + </table_data> + <triggers name="t2"> + <trigger Trigger="trig1" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci"> +<![CDATA[ +CREATE DEFINER=`root`@`localhost` TRIGGER trig1 BEFORE INSERT ON t2 +FOR EACH ROW BEGIN +INSERT INTO t2 VALUES(1); +END +]]> + </trigger> + <trigger Trigger="trig2" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci"> +<![CDATA[ +CREATE DEFINER=`root`@`localhost` TRIGGER trig2 AFTER INSERT ON t2 +FOR EACH ROW BEGIN +INSERT INTO t2 VALUES(1, ']]]]><![CDATA[>'); +INSERT INTO t2 VALUES(2, '<![CDATA]]]]><![CDATA[>'); +INSERT INTO t2 VALUES(3, '<![CDATA['); +INSERT INTO t2 VALUES(4, '< > & \ " _'); +END +]]> + </trigger> + </triggers> +<!-- +- +- Table structure for table `v1` +- + + --> + <table_structure name="v1"> + <field Field="c1" Type="int(11)" Null="YES" Key="" Extra="" Comment="" /> + <field Field="c2" Type="varchar(20)" Null="YES" Key="" Extra="" Comment="" /> + <options Name="v1" Comment="VIEW" /> + </table_structure> +<!-- +- +- Table structure for table `v2` +- + + --> + <table_structure name="v2"> + <field Field="c1" Type="int(11)" Null="YES" Key="" Extra="" Comment="" /> + <options Name="v2" Comment="VIEW" /> + </table_structure> +<!-- +- +- Dumping events for database 'BUG52792' +- + --> + <events> + <event Event="e1" sql_mode="" time_zone="SYSTEM" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci"> +<![CDATA[ +CREATE DEFINER=`root`@`localhost` EVENT `e1` ON SCHEDULE EVERY 1 SECOND STARTS '--TIME--' ON COMPLETION NOT PRESERVE ENABLE DO DROP DATABASE BUG52792 +]]> + </event> + <event Event="e2" sql_mode="" time_zone="SYSTEM" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci"> +<![CDATA[ +CREATE DEFINER=`root`@`localhost` EVENT `e2` ON SCHEDULE EVERY 1 SECOND STARTS '--TIME--' ON COMPLETION NOT PRESERVE ENABLE DO DROP DATABASE BUG52792 +]]> + </event> + </events> +<!-- +- +- Dumping routines for database 'BUG52792' +- + --> + <routines> + <routine Function="hello1" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci"> +<![CDATA[ +CREATE DEFINER=`root`@`localhost` FUNCTION `hello1`(s CHAR(20)) RETURNS char(50) CHARSET latin1 + DETERMINISTIC +RETURN CONCAT('Hello, ' ,s ,'!') +]]> + </routine> + <routine Function="hello2" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci"> +<![CDATA[ +CREATE DEFINER=`root`@`localhost` FUNCTION `hello2`(s CHAR(20)) RETURNS char(50) CHARSET latin1 + DETERMINISTIC +RETURN CONCAT(']]]]><![CDATA[>, ' , s ,'!') +]]> + </routine> + <routine Procedure="simpleproc1" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci"> +<![CDATA[ +CREATE DEFINER=`root`@`localhost` PROCEDURE `simpleproc1`(OUT param1 INT) +BEGIN +SELECT COUNT(*) INTO param1 FROM t1; +END +]]> + </routine> + <routine Procedure="simpleproc2" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci"> +<![CDATA[ +CREATE DEFINER=`root`@`localhost` PROCEDURE `simpleproc2`(OUT param1 INT) +BEGIN +SELECT COUNT(*) INTO param1 FROM t2; +END +]]> + </routine> + </routines> +</database> +</mysqldump> + +# Test to check 'Insufficient privileges' error. + +GRANT ALL PRIVILEGES ON BUG52792.* TO user1; +# Running 'replace_regex on timestamp' +<?xml version="1.0"?> +<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> +<database name="BUG52792"> + <table_structure name="t1"> + <field Field="c1" Type="int(11)" Null="YES" Key="" Extra="" Comment="" /> + <field Field="c2" Type="varchar(20)" Null="YES" Key="" Extra="" Comment="" /> + <options Name="t1" Engine="MyISAM" Version="10" Row_format="Dynamic" Rows="3" Avg_row_length="20" Data_length="60" Max_data_length="281474976710655" Index_length="1024" Data_free="0" Create_time="--TIME--" Update_time="--TIME--" Collation="latin1_swedish_ci" Create_options="" Comment="" /> + </table_structure> + <table_data name="t1"> + <row> + <field name="c1">1</field> + <field name="c2">aaa</field> + </row> + <row> + <field name="c1">2</field> + <field name="c2">bbb</field> + </row> + <row> + <field name="c1">3</field> + <field name="c2">ccc</field> + </row> + </table_data> + <table_structure name="t2"> + <field Field="c1" Type="int(11)" Null="YES" Key="" Extra="" Comment="" /> + <options Name="t2" Engine="MyISAM" Version="10" Row_format="Fixed" Rows="3" Avg_row_length="7" Data_length="21" Max_data_length="1970324836974591" Index_length="1024" Data_free="0" Create_time="--TIME--" Update_time="--TIME--" Collation="latin1_swedish_ci" Create_options="" Comment="" /> + </table_structure> + <table_data name="t2"> + <row> + <field name="c1">1</field> + </row> + <row> + <field name="c1">2</field> + </row> + <row> + <field name="c1">3</field> + </row> + </table_data> + <triggers name="t2"> + <trigger Trigger="trig1" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci"> +<![CDATA[ +CREATE DEFINER=`root`@`localhost` TRIGGER trig1 BEFORE INSERT ON t2 +FOR EACH ROW BEGIN +INSERT INTO t2 VALUES(1); +END +]]> + </trigger> + <trigger Trigger="trig2" sql_mode="" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci"> +<![CDATA[ +CREATE DEFINER=`root`@`localhost` TRIGGER trig2 AFTER INSERT ON t2 +FOR EACH ROW BEGIN +INSERT INTO t2 VALUES(1, ']]]]><![CDATA[>'); +INSERT INTO t2 VALUES(2, '<![CDATA]]]]><![CDATA[>'); +INSERT INTO t2 VALUES(3, '<![CDATA['); +INSERT INTO t2 VALUES(4, '< > & \ " _'); +END +]]> + </trigger> + </triggers> + <table_structure name="v1"> + <field Field="c1" Type="int(11)" Null="YES" Key="" Extra="" Comment="" /> + <field Field="c2" Type="varchar(20)" Null="YES" Key="" Extra="" Comment="" /> + <options Name="v1" Comment="VIEW" /> + </table_structure> + <table_structure name="v2"> + <field Field="c1" Type="int(11)" Null="YES" Key="" Extra="" Comment="" /> + <options Name="v2" Comment="VIEW" /> + </table_structure> + <events> + <event Event="e1" sql_mode="" time_zone="SYSTEM" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci"> +<![CDATA[ +CREATE DEFINER=`root`@`localhost` EVENT `e1` ON SCHEDULE EVERY 1 SECOND STARTS '--TIME--' ON COMPLETION NOT PRESERVE ENABLE DO DROP DATABASE BUG52792 +]]> + </event> + <event Event="e2" sql_mode="" time_zone="SYSTEM" character_set_client="latin1" collation_connection="latin1_swedish_ci" Database_Collation="latin1_swedish_ci"> +<![CDATA[ +CREATE DEFINER=`root`@`localhost` EVENT `e2` ON SCHEDULE EVERY 1 SECOND STARTS '--TIME--' ON COMPLETION NOT PRESERVE ENABLE DO DROP DATABASE BUG52792 +]]> + </event> + </events> + <routines> +<!-- +- insufficient privileges to SHOW CREATE FUNCTION `hello1` + --> +<!-- - does user1 have permissions on mysql.proc? + + --> +DROP USER user1; +DROP DATABASE BUG52792; +# UTF-8 +CREATE DATABASE BUG52792; +USE BUG52792; +SET NAMES utf8; +CREATE FUNCTION `straße` ( c1 CHAR(20)) +RETURNS CHAR(50) DETERMINISTIC +RETURN CONCAT(']]>, ', s, '!'); +<?xml version="1.0"?> +<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> +<database name="BUG52792"> + <routines> + <routine Function="straße" sql_mode="" character_set_client="utf8" collation_connection="utf8_general_ci" Database_Collation="latin1_swedish_ci"> +<![CDATA[ +CREATE DEFINER=`root`@`localhost` FUNCTION `straße`( c1 CHAR(20)) RETURNS char(50) CHARSET latin1 + DETERMINISTIC +RETURN CONCAT(']]]]><![CDATA[>, ', s, '!') +]]> + </routine> + </routines> +</database> +</mysqldump> +DROP DATABASE BUG52792; +USE test; +# # End of 5.1 tests # # @@ -4662,3 +5101,107 @@ UNLOCK TABLES; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; DROP TABLE t1; +# +# Bug#12809202 61854: MYSQLDUMP --SINGLE-TRANSACTION --FLUSH-LOG BREAKS +# CONSISTENCY +# +DROP DATABASE IF EXISTS b12809202_db; +CREATE DATABASE b12809202_db; +CREATE TABLE b12809202_db.t1 (c1 INT); +CREATE TABLE b12809202_db.t2 (c1 INT); +INSERT INTO b12809202_db.t1 VALUES (1), (2), (3); +INSERT INTO b12809202_db.t2 VALUES (1), (2), (3); +# Starting mysqldump with --single-transaction & --flush-log options.. +# Note : In the following dump the transaction +# should start only after the logs are +# flushed, as 'flush logs' causes implicit +# commit starting 5.5. + +#### Dump starts here #### +-- Connecting to localhost... +-- main : logs flushed successfully! +-- Starting transaction... +-- Retrieving table structure for table t1... +-- Sending SELECT query... +-- Retrieving rows... +-- +-- Host: localhost Database: b12809202_db +-- ------------------------------------------------------ + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `t1` +-- + +DROP TABLE IF EXISTS `t1`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t1` ( + `c1` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `t1` +-- + +LOCK TABLES `t1` WRITE; +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +INSERT INTO `t1` VALUES (1),(2),(3); +-- Retrieving table structure for table t2... +-- Sending SELECT query... +-- Retrieving rows... +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `t2` +-- + +DROP TABLE IF EXISTS `t2`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `t2` ( + `c1` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `t2` +-- + +LOCK TABLES `t2` WRITE; +/*!40000 ALTER TABLE `t2` DISABLE KEYS */; +INSERT INTO `t2` VALUES (1),(2),(3); +/*!40000 ALTER TABLE `t2` ENABLE KEYS */; +UNLOCK TABLES; +-- Disconnecting from localhost... +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed +#### Dump ends here #### +DROP TABLE b12809202_db.t1; +DROP TABLE b12809202_db.t2; +DROP DATABASE b12809202_db; +# +# Delete all existing binary logs. +# +RESET MASTER; diff --git a/mysql-test/r/partition_binlog_stmt.result b/mysql-test/r/partition_binlog_stmt.result index 9be23636ca6..5b9df742f70 100644 --- a/mysql-test/r/partition_binlog_stmt.result +++ b/mysql-test/r/partition_binlog_stmt.result @@ -8,6 +8,6 @@ name TINYBLOB NOT NULL, modified TIMESTAMP DEFAULT '0000-00-00 00:00:00', INDEX namelocs (name(255))) ENGINE = MyISAM PARTITION BY HASH(id) PARTITIONS 2; -LOAD DATA LOCAL INFILE 'init_file.txt' +LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/init_file.txt' INTO TABLE t1 (name); DROP TABLE t1; diff --git a/mysql-test/r/partition_key_cache.result b/mysql-test/r/partition_key_cache.result index c5241c6ea90..154f2008a96 100644 --- a/mysql-test/r/partition_key_cache.result +++ b/mysql-test/r/partition_key_cache.result @@ -397,6 +397,33 @@ test.t1 assign_to_keycache error Subpartition sp0 returned error test.t1 assign_to_keycache Error Key 'inx_b' doesn't exist in table 't1' test.t1 assign_to_keycache status Operation failed DROP TABLE t1,t2; +# +# Bug#12361113: crash when load index into cache +# +# Note that this creates an empty disabled key cache! +SET GLOBAL key_cache_none.key_cache_block_size = 1024; +CREATE TABLE t1 (a INT, b INTEGER NOT NULL, KEY (b) ) +ENGINE = MYISAM +PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 VALUES (1, 1); +CACHE INDEX t1 IN key_cache_none; +ERROR HY000: Unknown key cache 'key_cache_none' +CACHE INDEX t1 PARTITION (p0) IN key_cache_none; +ERROR HY000: Unknown key cache 'key_cache_none' +CACHE INDEX t1 PARTITION (p1) IN key_cache_none; +ERROR HY000: Unknown key cache 'key_cache_none' +CACHE INDEX t1 PARTITION (p0) KEY (`b`) IN key_cache_none; +ERROR HY000: Unknown key cache 'key_cache_none' +CACHE INDEX t1 PARTITION (p1) KEY (`b`) IN key_cache_none; +ERROR HY000: Unknown key cache 'key_cache_none' +# The bug crashed the server at LOAD INDEX below. Now it will succeed +# since the default cache is used due to CACHE INDEX failed for +# key_cache_none. +LOAD INDEX INTO CACHE t1; +Table Op Msg_type Msg_text +test.t1 preload_keys status OK +DROP TABLE t1; +# Clean up SET GLOBAL hot_cache.key_buffer_size = 0; SET GLOBAL warm_cache.key_buffer_size = 0; SET @@global.cold_cache.key_buffer_size = 0; diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index d8f1f45de0c..256e18a9679 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -1767,4 +1767,121 @@ id select_type table type possible_keys key key_len ref rows Extra SELECT * FROM t1, t1 as t2 WHERE t1.i4 BETWEEN t2.pk AND t2.pk; pk i4 pk i4 DROP TABLE t1; +# +# BUG#13519696 - 62940: SELECT RESULTS VARY WITH VERSION AND +# WITH/WITHOUT INDEX RANGE SCAN +# +create table t1 (id int unsigned not null auto_increment primary key); +insert into t1 values (null); +insert into t1 select null from t1; +insert into t1 select null from t1; +insert into t1 select null from t1; +insert into t1 select null from t1; +insert into t1 select null from t1; +insert into t1 select null from t1; +insert into t1 select null from t1; +insert into t1 select null from t1; +create table t2 ( +id int unsigned not null auto_increment, +val decimal(5,3) not null, +primary key (id,val), +unique key (val,id), +unique key (id)); +insert into t2 select null,id*0.0009 from t1; +select count(val) from t2 ignore index (val) where val > 0.1155; +count(val) +128 +select count(val) from t2 force index (val) where val > 0.1155; +count(val) +128 +drop table t2, t1; +# +# BUG#13453382 - REGRESSION SINCE 5.1.39, RANGE OPTIMIZER WRONG +# RESULTS WITH DECIMAL CONVERSION +# +create table t1 (a int,b int,c int,primary key (a,c)); +insert into t1 values (1,1,2),(1,1,3),(1,1,4); +select convert(3, signed integer) > 2.9; +convert(3, signed integer) > 2.9 +1 +select * from t1 force index (primary) where a=1 and c>= 2.9; +a b c +1 1 3 +1 1 4 +select * from t1 ignore index (primary) where a=1 and c>= 2.9; +a b c +1 1 3 +1 1 4 +select * from t1 force index (primary) where a=1 and c> 2.9; +a b c +1 1 3 +1 1 4 +select * from t1 ignore index (primary) where a=1 and c> 2.9; +a b c +1 1 3 +1 1 4 +drop table t1; +# +# BUG#13463488 - 63437: CHAR & BETWEEN WITH INDEX RETURNS WRONG +# RESULT AFTER MYSQL 5.1. +# +CREATE TABLE t1( +F1 CHAR(5) NOT NULL, +F2 CHAR(5) NOT NULL, +F3 CHAR(5) NOT NULL, +PRIMARY KEY(F1), +INDEX IDX_F2(F2) +); +INSERT INTO t1 VALUES +('A','A','A'),('AA','AA','AA'),('AAA','AAA','AAA'), +('AAAA','AAAA','AAAA'),('AAAAA','AAAAA','AAAAA'); +SELECT * FROM t1 WHERE F1 = 'A '; +F1 F2 F3 +A A A +SELECT * FROM t1 IGNORE INDEX(PRIMARY) WHERE F1 = 'A '; +F1 F2 F3 +A A A +SELECT * FROM t1 WHERE F1 >= 'A '; +F1 F2 F3 +A A A +AA AA AA +AAA AAA AAA +AAAA AAAA AAAA +AAAAA AAAAA AAAAA +SELECT * FROM t1 WHERE F1 > 'A '; +F1 F2 F3 +AA AA AA +AAA AAA AAA +AAAA AAAA AAAA +AAAAA AAAAA AAAAA +SELECT * FROM t1 WHERE F1 BETWEEN 'A ' AND 'AAAAA'; +F1 F2 F3 +A A A +AA AA AA +AAA AAA AAA +AAAA AAAA AAAA +AAAAA AAAAA AAAAA +SELECT * FROM t1 WHERE F2 BETWEEN 'A ' AND 'AAAAA'; +F1 F2 F3 +A A A +AA AA AA +AAA AAA AAA +AAAA AAAA AAAA +AAAAA AAAAA AAAAA +SELECT * FROM t1 WHERE F3 BETWEEN 'A ' AND 'AAAAA'; +F1 F2 F3 +A A A +AA AA AA +AAA AAA AAA +AAAA AAAA AAAA +AAAAA AAAAA AAAAA +SELECT * FROM t1 IGNORE INDEX(PRIMARY) WHERE F1 BETWEEN 'A ' AND +'AAAAA'; +F1 F2 F3 +A A A +AA AA AA +AAA AAA AAA +AAAA AAAA AAAA +AAAAA AAAAA AAAAA +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 1644c764431..07c945db5e6 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -2772,20 +2772,23 @@ userid drop procedure bug8116| drop table t3| drop procedure if exists bug6857| -create procedure bug6857(counter int) +create procedure bug6857() begin declare t0, t1 int; declare plus bool default 0; -set t0 = current_time(); -while counter > 0 do -set counter = counter - 1; -end while; -set t1 = current_time(); +set t0 = unix_timestamp(); +select sleep(1.1); +set t1 = unix_timestamp(); if t1 > t0 then set plus = 1; end if; select plus; end| +call bug6857()| +sleep(1.1) +0 +plus +1 drop procedure bug6857| drop procedure if exists bug8757| create procedure bug8757() diff --git a/mysql-test/r/xa.result b/mysql-test/r/xa.result index 7b580abb19f..6db257eafd5 100644 --- a/mysql-test/r/xa.result +++ b/mysql-test/r/xa.result @@ -206,8 +206,8 @@ DROP TABLE t1; # FAILED # DROP TABLE IF EXISTS t1, t2; -CREATE TABLE t1 (a INT); -CREATE TABLE t2 (a INT); +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +CREATE TABLE t2 (a INT) ENGINE=InnoDB; START TRANSACTION; INSERT INTO t1 VALUES (1); # Connection con2 @@ -217,12 +217,14 @@ INSERT INTO t2 SELECT a FROM t1; # Connection default # Waiting until INSERT ... is blocked DELETE FROM t1; -COMMIT; # Connection con2 # Reaping: INSERT INTO t2 SELECT a FROM t1 ERROR 40001: Deadlock found when trying to get lock; try restarting transaction XA COMMIT 'xid1'; ERROR XA102: XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected +# Connection default +COMMIT; +# Connection con2 XA START 'xid1'; XA END 'xid1'; XA PREPARE 'xid1'; diff --git a/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result b/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result index 23943474541..b006304908a 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result +++ b/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result @@ -54,13 +54,13 @@ USE test; # SET @old_log_warnings = @@log_warnings; DROP TABLE IF EXISTS t1; -CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(10)); +CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(15)); SET GLOBAL LOG_WARNINGS = 0; -INSERT INTO t1 VALUES(UUID(), 'Bug#46265'); +INSERT INTO t1 VALUES(UUID(), 'timestamp'); Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. SET GLOBAL LOG_WARNINGS = 1; -INSERT INTO t1 VALUES(UUID(), 'Bug#46265'); +INSERT INTO t1 VALUES(UUID(), 'timestamp'); Warnings: Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. DROP TABLE t1; diff --git a/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test b/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test index 85571a6c582..4a4a75af60f 100644 --- a/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test +++ b/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test @@ -101,16 +101,24 @@ eval USE $old_db; --echo # Bug#46265: Can not disable warning about unsafe statements for binary logging --echo # +let BINLOG_COUNTER1= `select CONVERT(NOW(),UNSIGNED) as timestmap from dual`; + SET @old_log_warnings = @@log_warnings; --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings -CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(10)); +CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(15)); + SET GLOBAL LOG_WARNINGS = 0; -INSERT INTO t1 VALUES(UUID(), 'Bug#46265'); +# Replacing the result file content here. +# Instead of writing $BINLOG_COUNTER1 value to result file, +# writing a fixed string timestamp to it. +--replace_result $BINLOG_COUNTER1 timestamp +eval INSERT INTO t1 VALUES(UUID(), '$BINLOG_COUNTER1'); SET GLOBAL LOG_WARNINGS = 1; -INSERT INTO t1 VALUES(UUID(), 'Bug#46265'); +--replace_result $BINLOG_COUNTER1 timestamp +eval INSERT INTO t1 VALUES(UUID(), '$BINLOG_COUNTER1'); DROP TABLE t1; SET GLOBAL log_warnings = @old_log_warnings; @@ -132,13 +140,14 @@ perl; use strict; my $log_error= $ENV{'LOG_ERROR'} or die "LOG_ERROR not set"; open(FILE, "$log_error") or die("Unable to open $log_error: $!\n"); - my $count = () = grep(/Bug#46265/g,<FILE>); + my $binlog_counter= $ENV{'BINLOG_COUNTER1'} or die "BINLOG_COUNTER1 not set"; + my $count = () = grep(/$binlog_counter/g,<FILE>); + # Grep the timestamp value from the error file. print "Occurrences: $count\n"; close(FILE); EOF # bug#50192: diplaying the unsafe warning comes out to the user warning stack - -- disable_warnings DROP TABLE IF EXISTS t1, t2; -- enable_warnings diff --git a/mysql-test/suite/innodb/r/innodb_bug12400341.result b/mysql-test/suite/innodb/r/innodb_bug12400341.result new file mode 100644 index 00000000000..551e94f5e77 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb_bug12400341.result @@ -0,0 +1,25 @@ +call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too"); +show variables like "max_connections"; +Variable_name Value +max_connections 64 +show variables like "innodb_thread_concurrency"; +Variable_name Value +innodb_thread_concurrency 0 +show variables like "innodb_file_per_table"; +Variable_name Value +innodb_file_per_table ON +drop database if exists mysqltest; +create database mysqltest; +CREATE TABLE mysqltest.transtable (id int unsigned NOT NULL PRIMARY KEY, val int DEFAULT 0) ENGINE=InnoDB; +select count(*) from information_schema.processlist; +count(*) +33 +CREATE TABLE mysqltest.testtable (id int unsigned not null primary key) ENGINE=InnoDB; +ERROR HY000: Can't create table 'mysqltest.testtable' (errno: 177) +select count(*) from information_schema.processlist; +count(*) +33 +select count(*) from information_schema.processlist; +count(*) +33 +drop database mysqltest; diff --git a/mysql-test/suite/innodb/t/innodb_bug12400341-master.opt b/mysql-test/suite/innodb/t/innodb_bug12400341-master.opt new file mode 100644 index 00000000000..13f480704f5 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug12400341-master.opt @@ -0,0 +1 @@ +--max_connections=64 --innodb_thread_concurrency=0 --innodb_file_per_table --innodb_rollback_segments=2 diff --git a/mysql-test/suite/innodb/t/innodb_bug12400341.test b/mysql-test/suite/innodb/t/innodb_bug12400341.test new file mode 100644 index 00000000000..2ab1be81f6d --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_bug12400341.test @@ -0,0 +1,103 @@ +# Test for bug #12400341: INNODB CAN LEAVE ORPHAN IBD FILES AROUND + +-- source include/have_innodb.inc + +if (`select count(*)=0 from information_schema.global_variables where variable_name = 'INNODB_TRX_RSEG_N_SLOTS_DEBUG'`) +{ + --skip Test requires InnoDB built with UNIV_DEBUG definition. +} + +call mtr.add_suppression("InnoDB: Warning: cannot find a free slot for an undo log. Do you have too"); + +--disable_query_log +set @old_innodb_trx_rseg_n_slots_debug = @@innodb_trx_rseg_n_slots_debug; +set global innodb_trx_rseg_n_slots_debug = 32; +--enable_query_log + +show variables like "max_connections"; +show variables like "innodb_thread_concurrency"; +show variables like "innodb_file_per_table"; + +--disable_warnings +drop database if exists mysqltest; +--enable_warnings + +create database mysqltest; +CREATE TABLE mysqltest.transtable (id int unsigned NOT NULL PRIMARY KEY, val int DEFAULT 0) ENGINE=InnoDB; + +--disable_query_log +# +# Insert in 1 transaction which needs over 1 page undo record to avoid the insert_undo cached, +# because the cached insert_undo can be reused at "CREATE TABLE" statement later. +# +START TRANSACTION; +let $c = 1024; +while ($c) +{ + eval INSERT INTO mysqltest.transtable (id) VALUES ($c); + dec $c; +} +COMMIT; + +let $c = 32; +while ($c) +{ + # if failed at here, it might be shortage of file descriptors limit. + connect (con$c,localhost,root,,); + dec $c; +} +--enable_query_log + +select count(*) from information_schema.processlist; + +# +# fill the all undo slots +# +--disable_query_log +let $c = 32; +while ($c) +{ + connection con$c; + START TRANSACTION; + eval UPDATE mysqltest.transtable SET val = 1 WHERE id = 33 - $c; + dec $c; +} +--enable_query_log + +connection default; + +--error ER_CANT_CREATE_TABLE +CREATE TABLE mysqltest.testtable (id int unsigned not null primary key) ENGINE=InnoDB; + +select count(*) from information_schema.processlist; + +--disable_query_log +let $c = 32; +while ($c) +{ + connection con$c; + ROLLBACK; + dec $c; +} +--enable_query_log + +connection default; +select count(*) from information_schema.processlist; + +--disable_query_log +let $c = 32; +while ($c) +{ + disconnect con$c; + dec $c; +} +--enable_query_log + +# +# If the isolated .ibd file remained, the drop database should fail. +# +drop database mysqltest; + +--disable_query_log +set global innodb_trx_rseg_n_slots_debug = @old_innodb_trx_rseg_n_slots_debug; +--enable_query_log diff --git a/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result b/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result index c1b2c6e3195..a406a6afe92 100644 --- a/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result +++ b/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result @@ -11,7 +11,7 @@ reset slave; start slave; include/wait_for_slave_param.inc [Last_IO_Errno] Last_IO_Errno = '1236' -Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master; the last event was read from './master-bin.000001' at 316, the last byte read was read from './master-bin.000001' at 335.'' +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master; the start event position from '' at XXX, the last event was read from './master-bin.000001' at XXX, the last byte read was read from './master-bin.000001' at XXX.'' reset master; stop slave; reset slave; diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result index 93faf37053a..d1423dea378 100644 --- a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result +++ b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result @@ -270,6 +270,7 @@ Heartbeat event received include/rpl_reset.inc include/stop_slave.inc include/rpl_change_topology.inc [new topology=1->2->1] +CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=1; include/start_slave.inc CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10)); INSERT INTO t1 VALUES(1, 'on master'); diff --git a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result index 92ccc78aaca..8ed402b9f8d 100644 --- a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result +++ b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result @@ -1,5 +1,6 @@ include/master-slave.inc [connection master] +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT, UNIQUE(b)); INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10; diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result index 42b88711f03..49691bea9b6 100644 --- a/mysql-test/suite/rpl/r/rpl_log_pos.result +++ b/mysql-test/suite/rpl/r/rpl_log_pos.result @@ -9,6 +9,7 @@ change master to master_log_pos=MASTER_LOG_POS; Read_Master_Log_Pos = '75' start slave; include/wait_for_slave_io_error.inc [errno=1236] +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the start event position from 'master-bin.000001' at XXX, the last event was read from './master-bin.000001' at XXX, the last byte read was read from './master-bin.000001' at XXX.'' include/stop_slave_sql.inc show master status; File Position Binlog_Do_DB Binlog_Ignore_DB diff --git a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result index a2dc5d402a7..2143b3492d5 100644 --- a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result +++ b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result @@ -5,6 +5,7 @@ CREATE TABLE t1(c1 INT); FLUSH LOGS; call mtr.add_suppression('Got fatal error 1236 from master when reading data from binary log: .*could not find next log'); include/wait_for_slave_io_error.inc [errno=1236] +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'could not find next log; the start event position from 'master-bin.000001' at XXX, the last event was read from './master-bin.000002' at XXX, the last byte read was read from './master-bin.000002' at XXX.'' CREATE TABLE t2(c1 INT); FLUSH LOGS; CREATE TABLE t3(c1 INT); diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result index 27f85cac7de..7591006abcb 100644 --- a/mysql-test/suite/rpl/r/rpl_packet.result +++ b/mysql-test/suite/rpl/r/rpl_packet.result @@ -37,6 +37,7 @@ DROP TABLE t1; CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM; INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet)); include/wait_for_slave_io_error.inc [errno=1236] +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the start event position from '' at XXX, the last event was read from './master-bin.000001' at XXX, the last byte read was read from './master-bin.000001' at XXX.'' STOP SLAVE; RESET SLAVE; RESET MASTER; diff --git a/mysql-test/suite/rpl/r/rpl_start_stop_slave.result b/mysql-test/suite/rpl/r/rpl_start_stop_slave.result new file mode 100644 index 00000000000..43a7712bdf1 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_start_stop_slave.result @@ -0,0 +1,10 @@ +include/master-slave.inc +[connection master] +set @time_before_kill := (select CURRENT_TIMESTAMP); +[Time before the query] +[Connection ID of the slave I/O thread found] +kill <connection_id>; +set @time_after_kill := (select CURRENT_TIMESTAMP); +[Time after the query] +[Killing of the slave IO thread was successful] +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result index 57206873e2f..a7f3744b582 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result @@ -69,6 +69,16 @@ include/wait_for_slave_to_stop.inc include/start_slave.inc # Clean up DROP TABLE t1; +RESET MASTER; +include/stop_slave.inc +CHANGE MASTER TO master_log_pos=MASTER_POS; +START SLAVE; +include/wait_for_slave_param.inc [Last_IO_Errno] +Last_IO_Errno = '1236' +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position; the start event position from 'master-bin.000001' at XXX, the last event was read from './master-bin.000001' at XXX, the last byte read was read from './master-bin.000001' at XXX.'' +include/stop_slave.inc +RESET SLAVE; +RESET MASTER; SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit; call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit; diff --git a/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test b/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test index 5e88b163d99..27478a318b8 100644 --- a/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test +++ b/mysql-test/suite/rpl/t/rpl_cant_read_event_incident.test @@ -14,11 +14,6 @@ --source include/master-slave.inc --source include/have_binlog_format_mixed.inc -# -# Bug#13050593 swallows `\' from Last_IO_Error -# todo: uncomment the filter once the bug is fixed. -# ---source include/not_windows.inc call mtr.add_suppression("Error in Log_event::read_log_event()"); @@ -51,6 +46,7 @@ start slave; --let $slave_param_value=1236 --source include/wait_for_slave_param.inc +--let $slave_field_result_replace= / at [0-9]*/ at XXX/ --let $status_items= Last_IO_Errno, Last_IO_Error --source include/show_slave_status.inc diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test index b9a170c5bc1..78489449ab8 100644 --- a/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test +++ b/mysql-test/suite/rpl/t/rpl_heartbeat_basic.test @@ -480,6 +480,12 @@ let $status_var_comparsion= >; --connection master #--replace_result $SLAVE_MYPORT SLAVE_PORT $slave_binlog SLAVE_BINLOG #eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$SLAVE_MYPORT, MASTER_USER='root', MASTER_CONNECT_RETRY=$connect_retry, MASTER_HEARTBEAT_PERIOD=1, MASTER_LOG_FILE='$slave_binlog'; + +# BUG#12403008 RPL_HEARTBEAT_BASIC FAILS SPORADICALLY ON PUSHBUILD +# MASTER_HEARTBEAT_PERIOD had the default value (slave_net_timeout/2) +# so wait on "Heartbeat event received on master", that only waits for +# 1 minute, sometimes timeout before heartbeat arrives. +CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=1; --source include/start_slave.inc # Insert data on master and on slave and make sure that it replicated for both directions diff --git a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test index 99871b695a6..a713691ec2d 100644 --- a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test +++ b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test @@ -6,6 +6,8 @@ source include/have_debug.inc; source include/master-slave.inc; +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); + # Currently only statement-based-specific bugs are here -- source include/have_binlog_format_statement.inc diff --git a/mysql-test/suite/rpl/t/rpl_log_pos.test b/mysql-test/suite/rpl/t/rpl_log_pos.test index 882a05712f2..1043a80b5d5 100644 --- a/mysql-test/suite/rpl/t/rpl_log_pos.test +++ b/mysql-test/suite/rpl/t/rpl_log_pos.test @@ -22,12 +22,9 @@ let $status_items= Read_Master_Log_Pos; source include/show_slave_status.inc; start slave; let $slave_io_errno= 1236; -# -# Win and Unix path is printed differently: BUG#13055685. So -# show_slave_io_error is made 0 until the bug fixes provide necessary -# facilities -# -let $show_slave_io_error= 0; +--let $show_slave_io_error= 1 +# Mask line numbers +--let $slave_io_error_replace= / at [0-9]*/ at XXX/ source include/wait_for_slave_io_error.inc; source include/stop_slave_sql.inc; diff --git a/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test b/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test index 9b648de8486..981cecb66ad 100644 --- a/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test +++ b/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test @@ -60,12 +60,9 @@ call mtr.add_suppression('Got fatal error 1236 from master when reading data fro connection slave; # 1236 = ER_MASTER_FATAL_ERROR_READING_BINLOG --let $slave_io_errno= 1236 -# -# Win and Unix path is printed differently: BUG#13055685. So -# show_slave_io_error is made 0 until the bug fixes provide necessary -# facilities -# ---let $show_slave_io_error= 0 +--let $show_slave_io_error= 1 +# Mask line numbers +--let $slave_io_error_replace= / at [0-9]*/ at XXX/ --source include/wait_for_slave_io_error.inc connection master; diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test index 2b8a1fd8310..4f296fed68e 100644 --- a/mysql-test/suite/rpl/t/rpl_packet.test +++ b/mysql-test/suite/rpl/t/rpl_packet.test @@ -125,12 +125,9 @@ connection slave; # The slave I/O thread must stop after receiving # 1236=ER_MASTER_FATAL_ERROR_READING_BINLOG error message from master. --let $slave_io_errno= 1236 -# -# Win and Unix path is printed differently: BUG#13055685. So -# show_slave_io_error is made 0 until the bug fixes provide necessary -# facilities -# ---let $show_slave_io_error= 0 + +# Mask line numbers +--let $slave_io_error_replace= / at [0-9]*/ at XXX/ --source include/wait_for_slave_io_error.inc # Remove the bad binlog and clear error status on slave. diff --git a/mysql-test/suite/rpl/t/rpl_start_stop_slave.test b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test new file mode 100644 index 00000000000..69d39a066b1 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_start_stop_slave.test @@ -0,0 +1,44 @@ +# +#BUG#11752315 : STOP SLAVE UNABLE TO COMPLETE WHEN SLAVE THREAD IS TRYING +# TO RECONNECT TO +# +# ==== Purpose ==== +# +#Tests that the slave does not go to a sleep for a long duration after the +#master is killed and we do a START_SLAVE and STOP_SLAVE. +# +# ==== Method ==== +# +#This is a new functionality of having an interruptable sleep of the slave. +#We find the thread id for the slave thread. On finding the thread ID of the +#slave thread we kill the slave thread. A successful kill in less than 60 sec +#should serve the purpose of checking the functionality. +# + +--source include/have_log_bin.inc +--source include/master-slave.inc + +connection slave; +--let $connection_id=`SELECT id FROM information_schema.processlist where state LIKE 'Waiting for master to send event'` + +set @time_before_kill := (select CURRENT_TIMESTAMP); + +--echo [Time before the query] +--echo [Connection ID of the slave I/O thread found] + +--replace_regex /kill [0-9]*/kill <connection_id>/ +--eval kill $connection_id + +set @time_after_kill := (select CURRENT_TIMESTAMP); + +--echo [Time after the query] + +if(`select TIMESTAMPDIFF(SECOND,@time_after_kill, @time_before_kill) > 60`) +{ +--echo # assert : The difference between the timestamps 'time_after_kill' and 'time_before_kill' should be less than 60sec. +--die +} + +--echo [Killing of the slave IO thread was successful] +# End of test +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test b/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test index ada080e9071..dfe2e49bb90 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test +++ b/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test @@ -22,5 +22,5 @@ SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group"); --connection master SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit; - +--let $rpl_only_running_threads= 1 --source include/rpl_end.inc diff --git a/mysql-test/suite/sys_vars/r/all_vars.result b/mysql-test/suite/sys_vars/r/all_vars.result index af05e3bc393..0f741ff930a 100644 --- a/mysql-test/suite/sys_vars/r/all_vars.result +++ b/mysql-test/suite/sys_vars/r/all_vars.result @@ -3,7 +3,6 @@ create table t2 (variable_name text); load data infile "MYSQLTEST_VARDIR/tmp/sys_vars.all_vars.txt" into table t1; insert into t2 select variable_name from information_schema.global_variables; insert into t2 select variable_name from information_schema.session_variables; -delete from t2 where variable_name='innodb_change_buffering_debug'; update t2 set variable_name= replace(variable_name, "PERFORMANCE_SCHEMA_", "PFS_"); select variable_name as `There should be *no* long test name listed below:` from t2 where length(variable_name) > 50; diff --git a/mysql-test/suite/sys_vars/r/character_sets_dir_basic.result b/mysql-test/suite/sys_vars/r/character_sets_dir_basic.result index c04e5dac199..ef8ec0cd9b8 100644 --- a/mysql-test/suite/sys_vars/r/character_sets_dir_basic.result +++ b/mysql-test/suite/sys_vars/r/character_sets_dir_basic.result @@ -1,20 +1,20 @@ select @@global.character_sets_dir; @@global.character_sets_dir -MYSQL_CHARSETSDIR/ +MYSQL_CHARSETSDIR select @@session.character_sets_dir; ERROR HY000: Variable 'character_sets_dir' is a GLOBAL variable show global variables like 'character_sets_dir'; Variable_name Value -character_sets_dir MYSQL_CHARSETSDIR/ +character_sets_dir MYSQL_CHARSETSDIR show session variables like 'character_sets_dir'; Variable_name Value -character_sets_dir MYSQL_CHARSETSDIR/ +character_sets_dir MYSQL_CHARSETSDIR select * from information_schema.global_variables where variable_name='character_sets_dir'; VARIABLE_NAME VARIABLE_VALUE -CHARACTER_SETS_DIR MYSQL_CHARSETSDIR/ +CHARACTER_SETS_DIR MYSQL_CHARSETSDIR select * from information_schema.session_variables where variable_name='character_sets_dir'; VARIABLE_NAME VARIABLE_VALUE -CHARACTER_SETS_DIR MYSQL_CHARSETSDIR/ +CHARACTER_SETS_DIR MYSQL_CHARSETSDIR set global character_sets_dir="foo"; ERROR HY000: Variable 'character_sets_dir' is a read only variable set session character_sets_dir="foo"; diff --git a/mysql-test/suite/sys_vars/r/innodb_change_buffering_debug_basic.result b/mysql-test/suite/sys_vars/r/innodb_change_buffering_debug_basic.result new file mode 100644 index 00000000000..2b74f891050 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_change_buffering_debug_basic.result @@ -0,0 +1,64 @@ +SET @start_global_value = @@global.innodb_change_buffering_debug; +SELECT @start_global_value; +@start_global_value +0 +select @@global.innodb_change_buffering_debug in (0, 1); +@@global.innodb_change_buffering_debug in (0, 1) +1 +select @@global.innodb_change_buffering_debug; +@@global.innodb_change_buffering_debug +0 +select @@session.innodb_change_buffering_debug; +ERROR HY000: Variable 'innodb_change_buffering_debug' is a GLOBAL variable +show global variables like 'innodb_change_buffering_debug'; +Variable_name Value +innodb_change_buffering_debug 0 +show session variables like 'innodb_change_buffering_debug'; +Variable_name Value +innodb_change_buffering_debug 0 +select * from information_schema.global_variables where variable_name='innodb_change_buffering_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_CHANGE_BUFFERING_DEBUG 0 +select * from information_schema.session_variables where variable_name='innodb_change_buffering_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_CHANGE_BUFFERING_DEBUG 0 +set global innodb_change_buffering_debug=1; +select @@global.innodb_change_buffering_debug; +@@global.innodb_change_buffering_debug +1 +select * from information_schema.global_variables where variable_name='innodb_change_buffering_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_CHANGE_BUFFERING_DEBUG 1 +select * from information_schema.session_variables where variable_name='innodb_change_buffering_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_CHANGE_BUFFERING_DEBUG 1 +set @@global.innodb_change_buffering_debug=0; +select @@global.innodb_change_buffering_debug; +@@global.innodb_change_buffering_debug +0 +select * from information_schema.global_variables where variable_name='innodb_change_buffering_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_CHANGE_BUFFERING_DEBUG 0 +select * from information_schema.session_variables where variable_name='innodb_change_buffering_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_CHANGE_BUFFERING_DEBUG 0 +set session innodb_change_buffering_debug='some'; +ERROR HY000: Variable 'innodb_change_buffering_debug' is a GLOBAL variable and should be set with SET GLOBAL +set @@session.innodb_change_buffering_debug='some'; +ERROR HY000: Variable 'innodb_change_buffering_debug' is a GLOBAL variable and should be set with SET GLOBAL +set global innodb_change_buffering_debug=1.1; +ERROR 42000: Incorrect argument type to variable 'innodb_change_buffering_debug' +set global innodb_change_buffering_debug='foo'; +ERROR 42000: Incorrect argument type to variable 'innodb_change_buffering_debug' +set global innodb_change_buffering_debug=-2; +Warnings: +Warning 1292 Truncated incorrect innodb_change_buffering_debug value: '-2' +set global innodb_change_buffering_debug=1e1; +ERROR 42000: Incorrect argument type to variable 'innodb_change_buffering_debug' +set global innodb_change_buffering_debug=2; +Warnings: +Warning 1292 Truncated incorrect innodb_change_buffering_debug value: '2' +SET @@global.innodb_change_buffering_debug = @start_global_value; +SELECT @@global.innodb_change_buffering_debug; +@@global.innodb_change_buffering_debug +0 diff --git a/mysql-test/suite/sys_vars/r/innodb_trx_rseg_n_slots_debug_basic.result b/mysql-test/suite/sys_vars/r/innodb_trx_rseg_n_slots_debug_basic.result new file mode 100644 index 00000000000..7e253c869e3 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/innodb_trx_rseg_n_slots_debug_basic.result @@ -0,0 +1,65 @@ +SET @start_global_value = @@global.innodb_trx_rseg_n_slots_debug; +SELECT @start_global_value; +@start_global_value +0 +select @@global.innodb_trx_rseg_n_slots_debug between 0 and 1024; +@@global.innodb_trx_rseg_n_slots_debug between 0 and 1024 +1 +select @@global.innodb_trx_rseg_n_slots_debug; +@@global.innodb_trx_rseg_n_slots_debug +0 +select @@session.innodb_trx_rseg_n_slots_debug; +ERROR HY000: Variable 'innodb_trx_rseg_n_slots_debug' is a GLOBAL variable +show global variables like 'innodb_trx_rseg_n_slots_debug'; +Variable_name Value +innodb_trx_rseg_n_slots_debug 0 +show session variables like 'innodb_trx_rseg_n_slots_debug'; +Variable_name Value +innodb_trx_rseg_n_slots_debug 0 +select * from information_schema.global_variables where variable_name='innodb_trx_rseg_n_slots_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_TRX_RSEG_N_SLOTS_DEBUG 0 +select * from information_schema.session_variables where variable_name='innodb_trx_rseg_n_slots_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_TRX_RSEG_N_SLOTS_DEBUG 0 +set global innodb_trx_rseg_n_slots_debug=1; +select @@global.innodb_trx_rseg_n_slots_debug; +@@global.innodb_trx_rseg_n_slots_debug +1 +select * from information_schema.global_variables where variable_name='innodb_trx_rseg_n_slots_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_TRX_RSEG_N_SLOTS_DEBUG 1 +select * from information_schema.session_variables where variable_name='innodb_trx_rseg_n_slots_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_TRX_RSEG_N_SLOTS_DEBUG 1 +set @@global.innodb_trx_rseg_n_slots_debug=0; +select @@global.innodb_trx_rseg_n_slots_debug; +@@global.innodb_trx_rseg_n_slots_debug +0 +select * from information_schema.global_variables where variable_name='innodb_trx_rseg_n_slots_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_TRX_RSEG_N_SLOTS_DEBUG 0 +select * from information_schema.session_variables where variable_name='innodb_trx_rseg_n_slots_debug'; +VARIABLE_NAME VARIABLE_VALUE +INNODB_TRX_RSEG_N_SLOTS_DEBUG 0 +set session innodb_trx_rseg_n_slots_debug='some'; +ERROR HY000: Variable 'innodb_trx_rseg_n_slots_debug' is a GLOBAL variable and should be set with SET GLOBAL +set @@session.innodb_trx_rseg_n_slots_debug='some'; +ERROR HY000: Variable 'innodb_trx_rseg_n_slots_debug' is a GLOBAL variable and should be set with SET GLOBAL +set global innodb_trx_rseg_n_slots_debug=1.1; +ERROR 42000: Incorrect argument type to variable 'innodb_trx_rseg_n_slots_debug' +set global innodb_trx_rseg_n_slots_debug='foo'; +ERROR 42000: Incorrect argument type to variable 'innodb_trx_rseg_n_slots_debug' +set global innodb_trx_rseg_n_slots_debug=-2; +Warnings: +Warning 1292 Truncated incorrect innodb_trx_rseg_n_slots_debug value: '-2' +set global innodb_trx_rseg_n_slots_debug=1e1; +ERROR 42000: Incorrect argument type to variable 'innodb_trx_rseg_n_slots_debug' +set global innodb_trx_rseg_n_slots_debug=1024; +set global innodb_trx_rseg_n_slots_debug=1025; +Warnings: +Warning 1292 Truncated incorrect innodb_trx_rseg_n_slots_debug value: '1025' +SET @@global.innodb_trx_rseg_n_slots_debug = @start_global_value; +SELECT @@global.innodb_trx_rseg_n_slots_debug; +@@global.innodb_trx_rseg_n_slots_debug +0 diff --git a/mysql-test/suite/sys_vars/r/plugin_dir_basic.result b/mysql-test/suite/sys_vars/r/plugin_dir_basic.result index a5f36de73fa..e2c03bcad6a 100644 --- a/mysql-test/suite/sys_vars/r/plugin_dir_basic.result +++ b/mysql-test/suite/sys_vars/r/plugin_dir_basic.result @@ -1,20 +1,20 @@ select @@global.plugin_dir; @@global.plugin_dir -MYSQL_TMP_DIR +MYSQL_TMP_DIR/ select @@session.plugin_dir; ERROR HY000: Variable 'plugin_dir' is a GLOBAL variable show global variables like 'plugin_dir'; Variable_name Value -plugin_dir MYSQL_TMP_DIR +plugin_dir MYSQL_TMP_DIR/ show session variables like 'plugin_dir'; Variable_name Value -plugin_dir MYSQL_TMP_DIR +plugin_dir MYSQL_TMP_DIR/ select * from information_schema.global_variables where variable_name='plugin_dir'; VARIABLE_NAME VARIABLE_VALUE -PLUGIN_DIR MYSQL_TMP_DIR +PLUGIN_DIR MYSQL_TMP_DIR/ select * from information_schema.session_variables where variable_name='plugin_dir'; VARIABLE_NAME VARIABLE_VALUE -PLUGIN_DIR MYSQL_TMP_DIR +PLUGIN_DIR MYSQL_TMP_DIR/ set global plugin_dir=1; ERROR HY000: Variable 'plugin_dir' is a read only variable set session plugin_dir=1; diff --git a/mysql-test/suite/sys_vars/r/stored_program_cache_basic.result b/mysql-test/suite/sys_vars/r/stored_program_cache_basic.result new file mode 100644 index 00000000000..f1638520f72 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/stored_program_cache_basic.result @@ -0,0 +1,59 @@ +# Saving initial value of stored_program_cache in a temporary variable +SET @start_value = @@global.stored_program_cache; +SELECT @start_value; +@start_value +256 +# Display the DEFAULT value of stored_program_cache +SET @@global.stored_program_cache = DEFAULT; +SELECT @@global.stored_program_cache; +@@global.stored_program_cache +256 +# Verify default value of variable +SELECT @@global.stored_program_cache = 256; +@@global.stored_program_cache = 256 +1 +# Change the value of stored_program_cache to a valid value +SET @@global.stored_program_cache = 512; +SELECT @@global.stored_program_cache; +@@global.stored_program_cache +512 +# Change the value of stored_program_cache to invalid value +SET @@global.stored_program_cache = -1; +Warnings: +Warning 1292 Truncated incorrect stored_program_cache value: '-1' +SELECT @@global.stored_program_cache; +@@global.stored_program_cache +256 +SET @@global.stored_program_cache =100000000000; +Warnings: +Warning 1292 Truncated incorrect stored_program_cache value: '100000000000' +SELECT @@global.stored_program_cache; +@@global.stored_program_cache +524288 +SET @@global.stored_program_cache = 0; +Warnings: +Warning 1292 Truncated incorrect stored_program_cache value: '0' +SELECT @@global.stored_program_cache; +@@global.stored_program_cache +256 +SET @@global.stored_program_cache = 10000.01; +ERROR 42000: Incorrect argument type to variable 'stored_program_cache' +SET @@global.stored_program_cache = ON; +ERROR 42000: Incorrect argument type to variable 'stored_program_cache' +SET @@global.stored_program_cache= 'test'; +ERROR 42000: Incorrect argument type to variable 'stored_program_cache' +SET @@global.stored_program_cache = ''; +ERROR 42000: Incorrect argument type to variable 'stored_program_cache' +# Test if accessing session stored_program_cache gives error +SET @@session.stored_program_cache = 0; +ERROR HY000: Variable 'stored_program_cache' is a GLOBAL variable and should be set with SET GLOBAL +# Check if accessing variable without SCOPE points to same global variable +SET @@global.stored_program_cache = 512; +SELECT @@stored_program_cache = @@global.stored_program_cache; +@@stored_program_cache = @@global.stored_program_cache +1 +# Restore initial value +SET @@global.stored_program_cache = @start_value; +SELECT @@global.stored_program_cache; +@@global.stored_program_cache +256 diff --git a/mysql-test/suite/sys_vars/t/all_vars.test b/mysql-test/suite/sys_vars/t/all_vars.test index f4fbf9fc6f1..2f44ef43493 100644 --- a/mysql-test/suite/sys_vars/t/all_vars.test +++ b/mysql-test/suite/sys_vars/t/all_vars.test @@ -47,9 +47,6 @@ eval load data infile "$MYSQLTEST_VARDIR/tmp/sys_vars.all_vars.txt" into table t insert into t2 select variable_name from information_schema.global_variables; insert into t2 select variable_name from information_schema.session_variables; -# This is only present in debug builds. -delete from t2 where variable_name='innodb_change_buffering_debug'; - # Performance schema variables are too long for files named # 'mysql-test/suite/sys_vars/t/' ... # ... 'performance_schema_events_waits_history_long_size_basic-master.opt' diff --git a/mysql-test/suite/sys_vars/t/character_sets_dir_basic.test b/mysql-test/suite/sys_vars/t/character_sets_dir_basic.test index 3d9de961530..0660fbeba2b 100644 --- a/mysql-test/suite/sys_vars/t/character_sets_dir_basic.test +++ b/mysql-test/suite/sys_vars/t/character_sets_dir_basic.test @@ -1,17 +1,26 @@ # # show the global and session values; # ---replace_result $MYSQL_CHARSETSDIR MYSQL_CHARSETSDIR + +# workaround to adjust for the directory separators being different in +# different OSes : slash on unixes and backslash or slash on windows. +# TODO: fix with a proper comparison in mysqltest +let $rcd= `SELECT REPLACE('$MYSQL_CHARSETSDIR', '\\\\\', '.')`; +let $rcd= `SELECT REPLACE('$rcd', '/', '.')`; +let $regex_charsetdir= `SELECT '/$rcd[\\\\\/\\\\\]/MYSQL_CHARSETSDIR/'`; + +--replace_regex $regex_charsetdir select @@global.character_sets_dir; + --error ER_INCORRECT_GLOBAL_LOCAL_VAR select @@session.character_sets_dir; ---replace_result $MYSQL_CHARSETSDIR MYSQL_CHARSETSDIR +--replace_regex $regex_charsetdir show global variables like 'character_sets_dir'; ---replace_result $MYSQL_CHARSETSDIR MYSQL_CHARSETSDIR +--replace_regex $regex_charsetdir show session variables like 'character_sets_dir'; ---replace_result $MYSQL_CHARSETSDIR MYSQL_CHARSETSDIR +--replace_regex $regex_charsetdir select * from information_schema.global_variables where variable_name='character_sets_dir'; ---replace_result $MYSQL_CHARSETSDIR MYSQL_CHARSETSDIR +--replace_regex $regex_charsetdir select * from information_schema.session_variables where variable_name='character_sets_dir'; # diff --git a/mysql-test/suite/sys_vars/t/disabled.def b/mysql-test/suite/sys_vars/t/disabled.def index f950aaf9ca5..d0049805315 100644 --- a/mysql-test/suite/sys_vars/t/disabled.def +++ b/mysql-test/suite/sys_vars/t/disabled.def @@ -11,5 +11,7 @@ ############################################################################## transaction_prealloc_size_basic_32 : Bug#11748572 transaction_prealloc_size_basic_64 : Bug#11748572 +query_cache_size_basic_32 : Bug#13535584 +query_cache_size_basic_64 : Bug#11748572 #thread_cache_size_func : Bug#11750172: 2008-11-07 joro main.thread_cache_size_func fails in pushbuild when run with pool of threads diff --git a/mysql-test/suite/sys_vars/t/innodb_change_buffering_debug_basic.test b/mysql-test/suite/sys_vars/t/innodb_change_buffering_debug_basic.test new file mode 100644 index 00000000000..ec1065a538e --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_change_buffering_debug_basic.test @@ -0,0 +1,52 @@ +--source include/have_innodb.inc +--source include/have_debug.inc + +SET @start_global_value = @@global.innodb_change_buffering_debug; +SELECT @start_global_value; + +# +# exists as global only +# +select @@global.innodb_change_buffering_debug in (0, 1); +select @@global.innodb_change_buffering_debug; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.innodb_change_buffering_debug; +show global variables like 'innodb_change_buffering_debug'; +show session variables like 'innodb_change_buffering_debug'; +select * from information_schema.global_variables where variable_name='innodb_change_buffering_debug'; +select * from information_schema.session_variables where variable_name='innodb_change_buffering_debug'; + +# +# show that it's writable +# +set global innodb_change_buffering_debug=1; +select @@global.innodb_change_buffering_debug; +select * from information_schema.global_variables where variable_name='innodb_change_buffering_debug'; +select * from information_schema.session_variables where variable_name='innodb_change_buffering_debug'; +set @@global.innodb_change_buffering_debug=0; +select @@global.innodb_change_buffering_debug; +select * from information_schema.global_variables where variable_name='innodb_change_buffering_debug'; +select * from information_schema.session_variables where variable_name='innodb_change_buffering_debug'; +--error ER_GLOBAL_VARIABLE +set session innodb_change_buffering_debug='some'; +--error ER_GLOBAL_VARIABLE +set @@session.innodb_change_buffering_debug='some'; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_change_buffering_debug=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_change_buffering_debug='foo'; +set global innodb_change_buffering_debug=-2; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_change_buffering_debug=1e1; +set global innodb_change_buffering_debug=2; + +# +# Cleanup +# + +SET @@global.innodb_change_buffering_debug = @start_global_value; +SELECT @@global.innodb_change_buffering_debug; diff --git a/mysql-test/suite/sys_vars/t/innodb_trx_rseg_n_slots_debug_basic.test b/mysql-test/suite/sys_vars/t/innodb_trx_rseg_n_slots_debug_basic.test new file mode 100644 index 00000000000..d17917de8e9 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/innodb_trx_rseg_n_slots_debug_basic.test @@ -0,0 +1,53 @@ +--source include/have_innodb.inc +--source include/have_debug.inc + +SET @start_global_value = @@global.innodb_trx_rseg_n_slots_debug; +SELECT @start_global_value; + +# +# exists as global only +# +select @@global.innodb_trx_rseg_n_slots_debug between 0 and 1024; +select @@global.innodb_trx_rseg_n_slots_debug; +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.innodb_trx_rseg_n_slots_debug; +show global variables like 'innodb_trx_rseg_n_slots_debug'; +show session variables like 'innodb_trx_rseg_n_slots_debug'; +select * from information_schema.global_variables where variable_name='innodb_trx_rseg_n_slots_debug'; +select * from information_schema.session_variables where variable_name='innodb_trx_rseg_n_slots_debug'; + +# +# show that it's writable +# +set global innodb_trx_rseg_n_slots_debug=1; +select @@global.innodb_trx_rseg_n_slots_debug; +select * from information_schema.global_variables where variable_name='innodb_trx_rseg_n_slots_debug'; +select * from information_schema.session_variables where variable_name='innodb_trx_rseg_n_slots_debug'; +set @@global.innodb_trx_rseg_n_slots_debug=0; +select @@global.innodb_trx_rseg_n_slots_debug; +select * from information_schema.global_variables where variable_name='innodb_trx_rseg_n_slots_debug'; +select * from information_schema.session_variables where variable_name='innodb_trx_rseg_n_slots_debug'; +--error ER_GLOBAL_VARIABLE +set session innodb_trx_rseg_n_slots_debug='some'; +--error ER_GLOBAL_VARIABLE +set @@session.innodb_trx_rseg_n_slots_debug='some'; + +# +# incorrect types +# +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_trx_rseg_n_slots_debug=1.1; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_trx_rseg_n_slots_debug='foo'; +set global innodb_trx_rseg_n_slots_debug=-2; +--error ER_WRONG_TYPE_FOR_VAR +set global innodb_trx_rseg_n_slots_debug=1e1; +set global innodb_trx_rseg_n_slots_debug=1024; +set global innodb_trx_rseg_n_slots_debug=1025; + +# +# Cleanup +# + +SET @@global.innodb_trx_rseg_n_slots_debug = @start_global_value; +SELECT @@global.innodb_trx_rseg_n_slots_debug; diff --git a/mysql-test/suite/sys_vars/t/stored_program_cache_basic.test b/mysql-test/suite/sys_vars/t/stored_program_cache_basic.test new file mode 100644 index 00000000000..9a9ba2ebf81 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/stored_program_cache_basic.test @@ -0,0 +1,59 @@ +# Variable Name: stored_program_cache +# Scope: GLOBAL +# Access Type: Dynamic +# Data Type: numeric +# Default Value: 256 +# Range: 256-524288 + +--source include/load_sysvars.inc + +--echo # Saving initial value of stored_program_cache in a temporary variable +SET @start_value = @@global.stored_program_cache; +SELECT @start_value; + +--echo # Display the DEFAULT value of stored_program_cache +SET @@global.stored_program_cache = DEFAULT; +SELECT @@global.stored_program_cache; + +--echo # Verify default value of variable +SELECT @@global.stored_program_cache = 256; + +--echo # Change the value of stored_program_cache to a valid value +SET @@global.stored_program_cache = 512; +SELECT @@global.stored_program_cache; + +--echo # Change the value of stored_program_cache to invalid value +SET @@global.stored_program_cache = -1; +SELECT @@global.stored_program_cache; + +SET @@global.stored_program_cache =100000000000; +SELECT @@global.stored_program_cache; + +SET @@global.stored_program_cache = 0; +SELECT @@global.stored_program_cache; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.stored_program_cache = 10000.01; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.stored_program_cache = ON; +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.stored_program_cache= 'test'; + +--Error ER_WRONG_TYPE_FOR_VAR +SET @@global.stored_program_cache = ''; + +--echo # Test if accessing session stored_program_cache gives error + +--Error ER_GLOBAL_VARIABLE +SET @@session.stored_program_cache = 0; + +--echo # Check if accessing variable without SCOPE points to same global variable + +SET @@global.stored_program_cache = 512; +SELECT @@stored_program_cache = @@global.stored_program_cache; + +--echo # Restore initial value + +SET @@global.stored_program_cache = @start_value; +SELECT @@global.stored_program_cache; diff --git a/mysql-test/t/bigint.test b/mysql-test/t/bigint.test index e19bba971f9..41f33b8a7f2 100644 --- a/mysql-test/t/bigint.test +++ b/mysql-test/t/bigint.test @@ -361,4 +361,51 @@ DROP TABLE t1; --echo # End of 5.1 tests +--echo # +--echo # Bug#13463415 63502: INCORRECT RESULTS OF BIGINT AND DECIMAL COMPARISON +--echo # + +CREATE TABLE t_bigint(id BIGINT); +INSERT INTO t_bigint VALUES (1), (2); + +SELECT id, id >= 1.1 FROM t_bigint; +SELECT id, 1.1 <= id FROM t_bigint; + +SELECT id, id = 1.1 FROM t_bigint; +SELECT id, 1.1 = id FROM t_bigint; + +SELECT * from t_bigint WHERE id = 1.1; +SELECT * from t_bigint WHERE id = 1.1e0; +SELECT * from t_bigint WHERE id = '1.1'; +SELECT * from t_bigint WHERE id = '1.1e0'; + +SELECT * from t_bigint WHERE id IN (1.1, 2.2); +SELECT * from t_bigint WHERE id IN (1.1e0, 2.2e0); +SELECT * from t_bigint WHERE id IN ('1.1', '2.2'); +SELECT * from t_bigint WHERE id IN ('1.1e0', '2.2e0'); + +SELECT * from t_bigint WHERE id BETWEEN 1.1 AND 1.9; +SELECT * from t_bigint WHERE id BETWEEN 1.1e0 AND 1.9e0; +SELECT * from t_bigint WHERE id BETWEEN '1.1' AND '1.9'; +SELECT * from t_bigint WHERE id BETWEEN '1.1e0' AND '1.9e0'; +DROP TABLE t_bigint; + +--echo # +--echo # Bug#11758543 50756: BIGINT '100' MATCHES 1.001E2 +--echo # + +CREATE TABLE t1 (a BIGINT); +INSERT INTO t1 VALUES (1); + +# a. These queries correctly return 0 rows: +SELECT * FROM t1 WHERE coalesce(a) BETWEEN 0 and 0.9; +SELECT * FROM t1 WHERE coalesce(a)=0.9; +SELECT * FROM t1 WHERE coalesce(a) in (0.8,0.9); + +# b. These queries mistakenely returned 1 row: +SELECT * FROM t1 WHERE a BETWEEN 0 AND 0.9; +SELECT * FROM t1 WHERE a=0.9; +SELECT * FROM t1 WHERE a IN (0.8,0.9); + +DROP TABLE t1; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 8254f99249f..acf16568319 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -1455,6 +1455,14 @@ SELECT HEX(LPAD(_utf8 0xD18F, 3, 0x20)); SELECT HEX(INSERT(_utf8 0xD18F, 2, 1, 0x20)); SELECT HEX(INSERT(_utf8 0xD18FD18E, 2, 1, 0x20)); +--echo # +--echo # Bug#11752408 - 43593: DUMP/BACKUP/RESTORE/UPGRADE TOOLS FAILS BECAUSE OF UTF8_GENERAL_CI +--echo # +CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_general_mysql500_ci); +INSERT INTO t1 VALUES ('a'),('r'),('s'),(_latin1 0xDF),(_latin1 0xF7),('t'),('z'); +SELECT * FROM t1 ORDER BY a; +SELECT a, COUNT(*) FROM t1 GROUP BY a; +DROP TABLE t1; --echo End of 5.1 tests diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 083ed396527..27e196e5b0c 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -1459,6 +1459,45 @@ SELECT stddev_samp(rpad(1.0,2048,1)); SELECT ((127.1) not in ((rpad(1.0,2048,1)),(''),(-1.1))); SELECT ((0xf3) * (rpad(1.0,2048,1)) << (0xcc)); +--echo # +--echo # Bug#13359121 LARGE NUMBERS, /STRINGS/DTOA.C:662: +--echo # BALLOC: ASSERTION `K <= 15' FAILED. +--echo # Bug#12985021 SIMPLE QUERY WITH DECIMAL NUMBERS TAKE AN +--echo # EXTRAORDINARY LONG TIME TO EXECUTE + +SELECT @tmp_max:= @@global.max_allowed_packet; +SET @@global.max_allowed_packet=1024*1024*1024; +# switching connection to allow the new max_allowed_packet take effect +--connect (newconn, localhost, root,,) + +SELECT @@global.max_allowed_packet; + +do +format(rpad('111111111.1', + 1111111, + '999999999999999999999999999999999999999999'),0,'be_BY') +; + +DO +round( + concat( ( + coalesce( ( + linefromwkb('2147483648', + -b'1111111111111111111111111111111111111111111')), + ( convert('[.DC2.]',decimal(30,30)) ), + bit_count('') + ) ), + ( lpad( ( elt('01','}:K5')), + sha1('P'), + ( ( select '-9223372036854775808.1' > all (select ''))) + ) + ) + ) +); + +--connection default +SET @@global.max_allowed_packet:= @tmp_max; +--disconnect newconn --echo # --echo # End of 5.5 tests diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 57a5a656591..b6c70485dbc 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -915,6 +915,67 @@ SELECT WEEK(DATE_ADD(FROM_DAYS(1),INTERVAL 1 MONTH), 1); DO WEEK((DATE_ADD((CAST(0 AS DATE)), INTERVAL 1 YEAR_MONTH)), 5); +--echo # +--echo # BUG#13458237 INCONSISTENT HANDLING OF INVALIDE DATES WITH ZERO DAY +--echo # SIMILAR TO '2009-10-00' +--echo # + +query_vertical SELECT + DATE('20091000'), + STR_TO_DATE('200910','%Y%m'), + LAST_DAY('2009-10-00'), + LAST_DAY(DATE('2009-10-00')), + LAST_DAY(DATE'2009-10-00'), + LAST_DAY(STR_TO_DATE('200910','%Y%m')), + WEEK('2009-10-00'), + WEEK(DATE('2009-10-00')), + WEEK(DATE'2009-10-00'), + WEEK(STR_TO_DATE('200910','%Y%m')), + WEEKOFYEAR('2009-10-00'), + WEEKOFYEAR(DATE('2009-10-00')), + WEEKOFYEAR(DATE'2009-10-00'), + WEEKOFYEAR(STR_TO_DATE('200910','%Y%m')), + DAYOFYEAR('2009-10-00'), + DAYOFYEAR(DATE('2009-10-00')), + DAYOFYEAR(DATE'2009-10-00'), + DAYOFYEAR(STR_TO_DATE('200910','%Y%m')), + WEEKDAY('2009-10-00'), + WEEKDAY(DATE('2009-10-00')), + WEEKDAY(DATE'2009-10-00'), + WEEKDAY(STR_TO_DATE('200910','%Y%m')), + TO_DAYs('2009-10-00'), + TO_DAYs(DATE('2009-10-00')), + TO_DAYs(DATE'2009-10-00'), + TO_DAYs(STR_TO_DATE('200910','%Y%m')); + +query_vertical SELECT + DATE('00000100'), + STR_TO_DATE('000001','%Y%m'), + LAST_DAY('0000-01-00'), + LAST_DAY(DATE('0000-01-00')), + LAST_DAY(DATE'0000-01-00'), + LAST_DAY(STR_TO_DATE('000001','%Y%m')), + WEEK('0000-01-00'), + WEEK(DATE('0000-01-00')), + WEEK(DATE'0000-01-00'), + WEEK(STR_TO_DATE('000001','%Y%m')), + WEEKOFYEAR('0000-01-00'), + WEEKOFYEAR(DATE('0000-01-00')), + WEEKOFYEAR(DATE'0000-01-00'), + WEEKOFYEAR(STR_TO_DATE('000001','%Y%m')), + DAYOFYEAR('0000-01-00'), + DAYOFYEAR(DATE('0000-01-00')), + DAYOFYEAR(DATE'0000-01-00'), + DAYOFYEAR(STR_TO_DATE('000001','%Y%m')), + WEEKDAY('0000-01-00'), + WEEKDAY(DATE('0000-01-00')), + WEEKDAY(DATE'0000-01-00'), + WEEKDAY(STR_TO_DATE('000001','%Y%m')), + TO_DAYs('0000-01-00'), + TO_DAYs(DATE('0000-01-00')), + TO_DAYs(DATE'0000-01-00'), + TO_DAYs(STR_TO_DATE('000001','%Y%m')); + --echo End of 5.1 tests --echo # @@ -940,6 +1001,21 @@ SELECT MONTHNAME(0), MONTHNAME(0) IS NULL, MONTHNAME(0) + 1; --error ER_WRONG_VALUE_FOR_VAR SET storage_engine=NULL; + +--echo # +--echo # BUG#13354387 - CRASH IN IN MY_DECIMAL::OPERATOR FOR VIEW AND FUNCTION UNIX_TIMESTAMP +--echo # Part1 (5.5) +SET time_zone='+03:00'; +CREATE TABLE t1 (a DATETIME NOT NULL); +INSERT INTO t1 VALUES ('2009-09-20 07:32:39.06'); +INSERT INTO t1 VALUES ('0000-00-00 00:00:00.00'); +CREATE VIEW v1 AS SELECT * FROM t1; +SELECT CAST(UNIX_TIMESTAMP(a) AS DECIMAL(25,3)) AS c1 FROM v1 ORDER BY 1; +DROP VIEW v1; +DROP TABLE t1; +SET time_zone=DEFAULT; + + --echo # --echo # Bug #59686 crash in String::copy() with time data type --echo # diff --git a/mysql-test/t/init_connect.test b/mysql-test/t/init_connect.test index b6bac5f65fa..e96d02fe0d1 100644 --- a/mysql-test/t/init_connect.test +++ b/mysql-test/t/init_connect.test @@ -36,6 +36,14 @@ connection con0; set GLOBAL init_connect="adsfsdfsdfs"; connect (con5,localhost,user_1,,); connection con5; +# BUG#11755281/47032: ERROR 2006 / ERROR 2013 INSTEAD OF PROPER ERROR MESSAGE +# We now throw a proper error message here: +--replace_regex /connection .* to/connection to/ +--error ER_NEW_ABORTING_CONNECTION +select @a; +# We got disconnected after receiving the above error message; any further +# requests should fail with a notice that no one's listening to us. +# --error CR_SERVER_GONE_ERROR,CR_SERVER_LOST --error 2013,2006 select @a; connection con0; diff --git a/mysql-test/t/key_cache.test b/mysql-test/t/key_cache.test index a404e9bf15a..76b538c301d 100644 --- a/mysql-test/t/key_cache.test +++ b/mysql-test/t/key_cache.test @@ -251,3 +251,19 @@ SET GLOBAL key_cache_block_size= @bug28478_key_cache_block_size; DROP TABLE t1; # End of 4.1 tests + +--echo # +--echo # Bug#12361113: crash when load index into cache +--echo # + +--echo # Note that this creates an empty disabled key cache! +SET GLOBAL key_cache_none.key_cache_block_size = 1024; +CREATE TABLE t1 (a INT, b INTEGER NOT NULL, KEY (b) ) ENGINE = MYISAM; +INSERT INTO t1 VALUES (1, 1); +--error ER_UNKNOWN_KEY_CACHE +CACHE INDEX t1 in key_cache_none; +--echo # The bug crashed the server at LOAD INDEX below. Now it will succeed +--echo # since the default cache is used due to CACHE INDEX failed for +--echo # key_cache_none. +LOAD INDEX INTO CACHE t1; +DROP TABLE t1; diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test index 8f93ac7b864..d9aa13ac7b9 100644 --- a/mysql-test/t/mysqlcheck.test +++ b/mysql-test/t/mysqlcheck.test @@ -146,6 +146,7 @@ CREATE TABLE `я` (a INT) engine=myisam; SET NAMES DEFAULT; --echo mysqlcheck --default-character-set="latin1" --databases test # Error returned depends on platform, replace it with "Table doesn't exist" +call mtr.add_suppression("Can't find file: '..test.@003f.frm'"); --replace_result "Can't find file: './test/@003f.frm' (errno: 22)" "Table doesn't exist" "Table 'test.?' doesn't exist" "Table doesn't exist" --exec $MYSQL_CHECK --default-character-set="latin1" --databases test --echo mysqlcheck --default-character-set="utf8" --databases test diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index e224bf6afe3..62d48f6b8e9 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -2202,6 +2202,118 @@ DROP DATABASE `test-database`; USE test; --echo # +--echo # BUG#11760384 : 52792: mysqldump in XML mode does not dump routines. +--echo # +CREATE DATABASE BUG52792; +USE BUG52792; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(20)); +CREATE TABLE t2 (c1 INT); +INSERT INTO t1 VALUES (1, 'aaa'), (2, 'bbb'), (3, 'ccc'); +INSERT INTO t2 VALUES (1),(2),(3); + +--echo # Stored Procedures. + +DELIMITER //; +CREATE PROCEDURE simpleproc1 (OUT param1 INT) +BEGIN + SELECT COUNT(*) INTO param1 FROM t1; +END// +DELIMITER ;// + +DELIMITER //; +CREATE PROCEDURE simpleproc2 (OUT param1 INT) +BEGIN + SELECT COUNT(*) INTO param1 FROM t2; +END// +DELIMITER ;// + +--echo # Events. + +CREATE EVENT e1 ON SCHEDULE EVERY 1 SECOND DO DROP DATABASE BUG52792; +CREATE EVENT e2 ON SCHEDULE EVERY 1 SECOND DO DROP DATABASE BUG52792; + +--echo # Functions. + +CREATE FUNCTION `hello1` (s CHAR(20)) + RETURNS CHAR(50) DETERMINISTIC +RETURN CONCAT('Hello, ' ,s ,'!'); + +CREATE FUNCTION `hello2` (s CHAR(20)) + RETURNS CHAR(50) DETERMINISTIC +RETURN CONCAT(']]>, ' , s ,'!'); + +--echo # Triggers. + +DELIMITER |; +CREATE TRIGGER trig1 BEFORE INSERT ON t2 + FOR EACH ROW BEGIN + INSERT INTO t2 VALUES(1); +END; +| +DELIMITER ;| + +DELIMITER |; +CREATE TRIGGER trig2 AFTER INSERT ON t2 + FOR EACH ROW BEGIN + INSERT INTO t2 VALUES(1, ']]>'); + INSERT INTO t2 VALUES(2, '<![CDATA]]>'); + INSERT INTO t2 VALUES(3, '<![CDATA['); + INSERT INTO t2 VALUES(4, '< > & \ " _'); +END; +| +DELIMITER ;| + +--echo # Views + +CREATE VIEW v1 AS SELECT * FROM t1; +CREATE VIEW v2 AS SELECT * FROM t2; +--echo +--echo # Dumping BUG52792 database in xml format. +--echo +--echo # Running 'replace_regex on timestamp' +--replace_regex /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/--TIME--/ +--exec $MYSQL_DUMP --user=root --compact -R -E --triggers -X BUG52792 +--echo +--echo # Dumping BUG52792 database in xml format with comments. +--echo +--echo # Running 'replace_regex on timestamp' +--replace_regex /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/--TIME--/ +--exec $MYSQL_DUMP --comments --user=root -R -E --triggers -X BUG52792 + +--echo +--echo # Test to check 'Insufficient privileges' error. +--echo + +GRANT ALL PRIVILEGES ON BUG52792.* TO user1; + +connect (conn_1, localhost, user1, , BUG52792, $MASTER_MYPORT, $MASTER_MYSOCK); +connection conn_1; + +--echo # Running 'replace_regex on timestamp' +--replace_regex /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/--TIME--/ +--error 2 +--exec $MYSQL_DUMP --user=user1 -R -E --triggers -X BUG52792 + +connection default; +disconnect conn_1; + +DROP USER user1; +DROP DATABASE BUG52792; +--echo # UTF-8 +CREATE DATABASE BUG52792; +USE BUG52792; +SET NAMES utf8; +CREATE FUNCTION `straße` ( c1 CHAR(20)) + RETURNS CHAR(50) DETERMINISTIC +RETURN CONCAT(']]>, ', s, '!'); + +--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 -R -X BUG52792 + +DROP DATABASE BUG52792; + +USE test; + +--echo # --echo # End of 5.1 tests --echo # @@ -2215,5 +2327,43 @@ CREATE TABLE t1 (a INT); --exec $MYSQL_DUMP --compatible=no_t,no_f --skip-comments test DROP TABLE t1; +--echo # +--echo # Bug#12809202 61854: MYSQLDUMP --SINGLE-TRANSACTION --FLUSH-LOG BREAKS +--echo # CONSISTENCY +--echo # + +--disable_warnings +DROP DATABASE IF EXISTS b12809202_db; +--enable_warnings + +CREATE DATABASE b12809202_db; +CREATE TABLE b12809202_db.t1 (c1 INT); +CREATE TABLE b12809202_db.t2 (c1 INT); + +INSERT INTO b12809202_db.t1 VALUES (1), (2), (3); +INSERT INTO b12809202_db.t2 VALUES (1), (2), (3); + +--echo # Starting mysqldump with --single-transaction & --flush-log options.. +--echo # Note : In the following dump the transaction +--echo # should start only after the logs are +--echo # flushed, as 'flush logs' causes implicit +--echo # commit starting 5.5. +--echo +--echo #### Dump starts here #### +--replace_regex /-- Server version.*// /-- MySQL dump .*// /-- Dump completed on .*/-- Dump completed/ +--exec $MYSQL_DUMP --verbose --single-transaction --flush-log b12809202_db 2>&1 +--echo +--echo #### Dump ends here #### + +# Cleanup +DROP TABLE b12809202_db.t1; +DROP TABLE b12809202_db.t2; +DROP DATABASE b12809202_db; + +--echo # +--echo # Delete all existing binary logs. +--echo # +RESET MASTER; + # Wait till we reached the initial number of concurrent sessions --source include/wait_until_count_sessions.inc diff --git a/mysql-test/t/partition_binlog_stmt.test b/mysql-test/t/partition_binlog_stmt.test index c426de9f303..cc57222dc3c 100644 --- a/mysql-test/t/partition_binlog_stmt.test +++ b/mysql-test/t/partition_binlog_stmt.test @@ -8,7 +8,7 @@ DROP TABLE IF EXISTS t1; --echo # --echo # Bug#51851: Server with SBR locks mutex twice on LOAD DATA into --echo # partitioned MyISAM table ---write_file init_file.txt +--write_file $MYSQLTEST_VARDIR/tmp/init_file.txt abcd EOF @@ -19,8 +19,9 @@ CREATE TABLE t1 INDEX namelocs (name(255))) ENGINE = MyISAM PARTITION BY HASH(id) PARTITIONS 2; -LOAD DATA LOCAL INFILE 'init_file.txt' +--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR +eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/tmp/init_file.txt' INTO TABLE t1 (name); ---remove_file init_file.txt +--remove_file $MYSQLTEST_VARDIR/tmp/init_file.txt DROP TABLE t1; diff --git a/mysql-test/t/partition_key_cache.test b/mysql-test/t/partition_key_cache.test index 4beb9506b05..067eb7fae59 100644 --- a/mysql-test/t/partition_key_cache.test +++ b/mysql-test/t/partition_key_cache.test @@ -239,6 +239,34 @@ CACHE INDEX t2 INDEX (`inx_b`) IN hot_cache; CACHE INDEX t1 PARTITION (p0) KEY (`inx_b`) IN hot_cache; CACHE INDEX t1 INDEX (`inx_b`) IN hot_cache; DROP TABLE t1,t2; + +--echo # +--echo # Bug#12361113: crash when load index into cache +--echo # +--echo # Note that this creates an empty disabled key cache! +SET GLOBAL key_cache_none.key_cache_block_size = 1024; +CREATE TABLE t1 (a INT, b INTEGER NOT NULL, KEY (b) ) +ENGINE = MYISAM +PARTITION BY HASH(a) PARTITIONS 2; +INSERT INTO t1 VALUES (1, 1); +--error ER_UNKNOWN_KEY_CACHE +CACHE INDEX t1 IN key_cache_none; +--error ER_UNKNOWN_KEY_CACHE +CACHE INDEX t1 PARTITION (p0) IN key_cache_none; +--error ER_UNKNOWN_KEY_CACHE +CACHE INDEX t1 PARTITION (p1) IN key_cache_none; +--error ER_UNKNOWN_KEY_CACHE +CACHE INDEX t1 PARTITION (p0) KEY (`b`) IN key_cache_none; +--error ER_UNKNOWN_KEY_CACHE +CACHE INDEX t1 PARTITION (p1) KEY (`b`) IN key_cache_none; +--echo # The bug crashed the server at LOAD INDEX below. Now it will succeed +--echo # since the default cache is used due to CACHE INDEX failed for +--echo # key_cache_none. +LOAD INDEX INTO CACHE t1; +DROP TABLE t1; + + +--echo # Clean up SET GLOBAL hot_cache.key_buffer_size = 0; SET GLOBAL warm_cache.key_buffer_size = 0; SET @@global.cold_cache.key_buffer_size = 0; diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 6c9320b708a..30d15798336 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -1392,4 +1392,80 @@ SELECT * FROM t1, t1 as t2 WHERE t1.i4 BETWEEN t2.pk AND t2.pk; DROP TABLE t1; +--echo # +--echo # BUG#13519696 - 62940: SELECT RESULTS VARY WITH VERSION AND +--echo # WITH/WITHOUT INDEX RANGE SCAN +--echo # + +create table t1 (id int unsigned not null auto_increment primary key); +insert into t1 values (null); +insert into t1 select null from t1; +insert into t1 select null from t1; +insert into t1 select null from t1; +insert into t1 select null from t1; +insert into t1 select null from t1; +insert into t1 select null from t1; +insert into t1 select null from t1; +insert into t1 select null from t1; +create table t2 ( + id int unsigned not null auto_increment, + val decimal(5,3) not null, + primary key (id,val), + unique key (val,id), + unique key (id)); +--disable_warnings +insert into t2 select null,id*0.0009 from t1; +--enable_warnings + +select count(val) from t2 ignore index (val) where val > 0.1155; +select count(val) from t2 force index (val) where val > 0.1155; + +drop table t2, t1; + +--echo # +--echo # BUG#13453382 - REGRESSION SINCE 5.1.39, RANGE OPTIMIZER WRONG +--echo # RESULTS WITH DECIMAL CONVERSION +--echo # + +create table t1 (a int,b int,c int,primary key (a,c)); +insert into t1 values (1,1,2),(1,1,3),(1,1,4); +# show that the integer 3 is bigger than the decimal 2.9, +# which should also apply to comparing "c" with 2.9 +# when c is 3. +select convert(3, signed integer) > 2.9; +select * from t1 force index (primary) where a=1 and c>= 2.9; +select * from t1 ignore index (primary) where a=1 and c>= 2.9; +select * from t1 force index (primary) where a=1 and c> 2.9; +select * from t1 ignore index (primary) where a=1 and c> 2.9; +drop table t1; + +--echo # +--echo # BUG#13463488 - 63437: CHAR & BETWEEN WITH INDEX RETURNS WRONG +--echo # RESULT AFTER MYSQL 5.1. +--echo # + +CREATE TABLE t1( + F1 CHAR(5) NOT NULL, + F2 CHAR(5) NOT NULL, + F3 CHAR(5) NOT NULL, + PRIMARY KEY(F1), + INDEX IDX_F2(F2) +); + +INSERT INTO t1 VALUES +('A','A','A'),('AA','AA','AA'),('AAA','AAA','AAA'), +('AAAA','AAAA','AAAA'),('AAAAA','AAAAA','AAAAA'); + +SELECT * FROM t1 WHERE F1 = 'A '; +SELECT * FROM t1 IGNORE INDEX(PRIMARY) WHERE F1 = 'A '; +SELECT * FROM t1 WHERE F1 >= 'A '; +SELECT * FROM t1 WHERE F1 > 'A '; +SELECT * FROM t1 WHERE F1 BETWEEN 'A ' AND 'AAAAA'; +SELECT * FROM t1 WHERE F2 BETWEEN 'A ' AND 'AAAAA'; +SELECT * FROM t1 WHERE F3 BETWEEN 'A ' AND 'AAAAA'; +SELECT * FROM t1 IGNORE INDEX(PRIMARY) WHERE F1 BETWEEN 'A ' AND +'AAAAA'; + +DROP TABLE t1; + --echo End of 5.1 tests diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test index 3f6c50a9095..d0fe9779da9 100644 --- a/mysql-test/t/sp.test +++ b/mysql-test/t/sp.test @@ -3336,28 +3336,20 @@ drop table t3| --disable_warnings drop procedure if exists bug6857| --enable_warnings -create procedure bug6857(counter int) +create procedure bug6857() begin declare t0, t1 int; declare plus bool default 0; - - set t0 = current_time(); - while counter > 0 do - set counter = counter - 1; - end while; - set t1 = current_time(); + set t0 = unix_timestamp(); + select sleep(1.1); + set t1 = unix_timestamp(); if t1 > t0 then set plus = 1; end if; select plus; end| -# QQ: This is currently disabled. Not only does it slow down a normal test -# run, it makes running with valgrind (or similar tools) extremely -# painful. -# Make sure this takes at least one second on all machines in all builds. -# 30000 makes it about 3 seconds on an old 1.1GHz linux. -#call bug6857(300000)| +call bug6857()| drop procedure bug6857| diff --git a/mysql-test/t/udf_skip_grants-master.opt b/mysql-test/t/udf_skip_grants-master.opt index 5699a3387b8..015d0014da0 100644 --- a/mysql-test/t/udf_skip_grants-master.opt +++ b/mysql-test/t/udf_skip_grants-master.opt @@ -1 +1,2 @@ --skip-grant-tables +$UDF_EXAMPLE_LIB_OPT diff --git a/mysql-test/t/xa.test b/mysql-test/t/xa.test index 8ce9ce52960..cb4345e9479 100644 --- a/mysql-test/t/xa.test +++ b/mysql-test/t/xa.test @@ -338,8 +338,8 @@ DROP TABLE t1; DROP TABLE IF EXISTS t1, t2; --enable_warnings -CREATE TABLE t1 (a INT); -CREATE TABLE t2 (a INT); +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +CREATE TABLE t2 (a INT) ENGINE=InnoDB; START TRANSACTION; INSERT INTO t1 VALUES (1); @@ -359,7 +359,6 @@ let $wait_condition= --echo # Waiting until INSERT ... is blocked --source include/wait_condition.inc DELETE FROM t1; -COMMIT; --echo # Connection con2 --connection con2 @@ -368,6 +367,14 @@ COMMIT; --reap --error ER_XA_RBDEADLOCK XA COMMIT 'xid1'; + +--echo # Connection default +connection default; + +COMMIT; + +--echo # Connection con2 +connection con2; # This caused the assert to be triggered XA START 'xid1'; |