diff options
author | Marc Alff <marc.alff@oracle.com> | 2011-03-10 09:43:55 +0100 |
---|---|---|
committer | Marc Alff <marc.alff@oracle.com> | 2011-03-10 09:43:55 +0100 |
commit | 3f2d2fe7b5a4d9af49ac503e7069c943675f563d (patch) | |
tree | ed3f3ff803b4c69669c7a1e83feafe9972196316 /mysql-test | |
parent | caee7f416f198a73c7aac978bfafb565f50fde03 (diff) | |
parent | 0b7e6f81afe24f4734b3d8ce5d85411609f8d3a0 (diff) | |
download | mariadb-git-3f2d2fe7b5a4d9af49ac503e7069c943675f563d.tar.gz |
Local merge
Diffstat (limited to 'mysql-test')
42 files changed, 990 insertions, 91 deletions
diff --git a/mysql-test/collections/default.daily b/mysql-test/collections/default.daily index 75c03d4d47b..665da0d152c 100644 --- a/mysql-test/collections/default.daily +++ b/mysql-test/collections/default.daily @@ -1,15 +1,15 @@ -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=normal --vardir=var-normal --report-features -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=row --vardir=var-row --mysqld=--binlog-format=row -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --mysqld=--binlog-format=row --ps-protocol -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-embedded --embedded -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps --vardir=var-ps --ps-protocol -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1 -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps_funcs1 --vardir=var-ps_funcs_1 --suite=funcs_1 --ps-protocol -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=funcs2 --vardir=var-funcs2 --suite=funcs_2 -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=partitions --vardir=var-parts --suite=parts -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=stress --vardir=var-stress --suite=stress -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=jp --vardir=var-jp --suite=jp -perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=nist --vardir=var-nist --suite=nist +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=normal --vardir=var-normal --report-features --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=row --vardir=var-row --mysqld=--binlog-format=row --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --mysqld=--binlog-format=row --ps-protocol --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-embedded --embedded --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps --vardir=var-ps --ps-protocol --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1 --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=ps_funcs1 --vardir=var-ps_funcs_1 --suite=funcs_1 --ps-protocol --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=funcs2 --vardir=var-funcs2 --suite=funcs_2 --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=partitions --vardir=var-parts --suite=parts --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=stress --vardir=var-stress --suite=stress --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=jp --vardir=var-jp --suite=jp --skip-test-list=collections/disabled-daily.list +perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=nist --vardir=var-nist --suite=nist --skip-test-list=collections/disabled-daily.list perl mysql-test-run.pl --force --timer --debug-server --parallel=auto --experimental=collections/default.experimental --comment=nist+ps --vardir=var-ps_nist --suite=nist --ps-protocol diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index 4871d2df796..a95419fbc19 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -14,8 +14,6 @@ main.sp @solaris # Bug#47791 2010-01-20 alik Several tes main.type_float @freebsd # Bug#38965 2010-05-04 alik test cases gis-rtree, type_float, type_newdecimal fail in embedded server main.wait_timeout @solaris # Bug#51244 2010-04-26 alik wait_timeout fails on OpenSolaris -rpl.rpl_heartbeat_basic # BUG#54820 2010-06-26 alik rpl.rpl_heartbeat_basic fails sporadically again -rpl.rpl_heartbeat_2slaves # BUG#43828 2009-10-22 luis fails sporadically rpl.rpl_innodb_bug28430 # Bug#46029 sys_vars.max_sp_recursion_depth_func @solaris # Bug#47791 2010-01-20 alik Several test cases fail on Solaris with error Thread stack overrun diff --git a/mysql-test/collections/default.weekly b/mysql-test/collections/default.weekly index a1339fcf0fc..40f0548f374 100755 --- a/mysql-test/collections/default.weekly +++ b/mysql-test/collections/default.weekly @@ -1,7 +1,7 @@ -perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=big-tests --experimental=collections/default.experimental --vardir=var-big-tests --big-test --testcase-timeout=60 --suite-timeout=600 main.alter_table-big main.archive-big main.count_distinct3 main.create-big main.events_stress main.events_time_zone main.information_schema-big main.log_tables-big main.merge-big main.mysqlbinlog_row_big main.read_many_rows_innodb main.ssl-big main.sum_distinct-big main.type_newdecimal-big main.variables-big parts.part_supported_sql_func_innodb parts.partition_alter1_1_2_innodb parts.partition_alter1_2_innodb parts.partition_alter2_1_1_innodb parts.partition_alter2_1_2_innodb parts.partition_alter2_2_2_innodb parts.partition_alter4_innodb funcs_1.myisam_views-big -perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam -perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-row-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=row -perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-mixed-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=mixed -perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb -perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-row-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=row -perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-mixed-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=mixed +perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=big-tests --experimental=collections/default.experimental --vardir=var-big-tests --big-test --testcase-timeout=60 --suite-timeout=600 main.alter_table-big main.archive-big main.count_distinct3 main.create-big main.events_stress main.events_time_zone main.information_schema-big main.log_tables-big main.merge-big main.mysqlbinlog_row_big main.read_many_rows_innodb main.ssl-big main.sum_distinct-big main.type_newdecimal-big main.variables-big parts.part_supported_sql_func_innodb parts.partition_alter1_1_2_innodb parts.partition_alter1_2_innodb parts.partition_alter2_1_1_innodb parts.partition_alter2_1_2_innodb parts.partition_alter2_2_2_innodb parts.partition_alter4_innodb funcs_1.myisam_views-big --skip-test-list=collections/disabled-weekly.list +perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --skip-test-list=collections/disabled-weekly.list +perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-row-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=row --skip-test-list=collections/disabled-weekly.list +perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-mixed-tests-myisam-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-myisam-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=myisam --do-test=rpl --mysqld=--binlog-format=mixed --skip-test-list=collections/disabled-weekly.list +perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-stmt-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --skip-test-list=collections/disabled-weekly.list +perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-row-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-row-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=row --skip-test-list=collections/disabled-weekly.list +perl mysql-test-run.pl --timer --force --debug-server --parallel=auto --comment=eits-rpl-binlog-mixed-tests-innodb-engine --experimental=collections/default.experimental --vardir=var-binlog-mixed-eits-tests-innodb-engine --suite=engines/iuds,engines/funcs --suite-timeout=500 --max-test-fail=0 --retry-failure=0 --mysqld=--default-storage-engine=innodb --mysqld=--innodb --do-test=rpl --mysqld=--binlog-format=mixed --skip-test-list=collections/disabled-weekly.list diff --git a/mysql-test/collections/disabled-daily.list b/mysql-test/collections/disabled-daily.list new file mode 100644 index 00000000000..6edb3d1d0b3 --- /dev/null +++ b/mysql-test/collections/disabled-daily.list @@ -0,0 +1,9 @@ +rpl.rpl_semi_sync_event : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +rpl.rpl_semi_sync : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.rpl_semi_sync_master_enabled_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.rpl_semi_sync_master_timeout_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.rpl_semi_sync_master_trace_level_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.rpl_semi_sync_master_wait_no_slave_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.rpl_semi_sync_slave_enabled_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.rpl_semi_sync_slave_trace_level_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.all_vars : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. diff --git a/mysql-test/collections/disabled-weekly.list b/mysql-test/collections/disabled-weekly.list new file mode 100644 index 00000000000..6edb3d1d0b3 --- /dev/null +++ b/mysql-test/collections/disabled-weekly.list @@ -0,0 +1,9 @@ +rpl.rpl_semi_sync_event : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +rpl.rpl_semi_sync : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.rpl_semi_sync_master_enabled_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.rpl_semi_sync_master_timeout_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.rpl_semi_sync_master_trace_level_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.rpl_semi_sync_master_wait_no_slave_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.rpl_semi_sync_slave_enabled_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.rpl_semi_sync_slave_trace_level_basic : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. +sys_vars.all_vars : lsoares 2011-02-11 BUG#11769332 Anitha asked me to disable this until plugin issues on windows are fixed. diff --git a/mysql-test/include/wait_for_status_var.inc b/mysql-test/include/wait_for_status_var.inc index 5c68254f00e..86831164c71 100644 --- a/mysql-test/include/wait_for_status_var.inc +++ b/mysql-test/include/wait_for_status_var.inc @@ -61,7 +61,7 @@ let $_show_status_value= query_get_value("SHOW $status_type STATUS LIKE '$status # Set way of comparing let $_query= SELECT NOT('$_show_status_value' $_status_var_comparsion '$status_var_value'); -if ($is_number) +if ($_is_number) { let $_query= SELECT NOT($_show_status_value $_status_var_comparsion $status_var_value); } @@ -70,7 +70,7 @@ while (`$_query`) { if (!$_status_timeout_counter) { - --echo **** ERROR: failed while waiting for $status_type $status_var $_status_var_comparison $status_var_value **** + --echo **** ERROR: failed while waiting for $status_type $status_var $_status_var_comparsion $status_var_value **** --echo Note: the following output may have changed since the failure was detected --echo **** Showing STATUS, PROCESSLIST **** eval SHOW $status_type STATUS LIKE '$status_var'; diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index 6f773270dff..7a8f07e912b 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -3246,5 +3246,20 @@ maketime(`a`,`a`,`a`) DROP TABLE t1; SET sql_mode=default; # +# Bug#11764503 (Bug#57341) Query in EXPLAIN EXTENDED shows wrong characters +# +SET NAMES utf8; +EXPLAIN EXTENDED SELECT 'abcdó', _latin1'abcdó', _utf8'abcdó'; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select 'abcdó' AS `abcdó`,_latin1'abcd\xC3\xB3' AS `abcdó`,_utf8'abcd\xC3\xB3' AS `abcdó` +SET NAMES latin1; +EXPLAIN EXTENDED SELECT 'abcdó', _latin1'abcdó', _utf8'abcdó'; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select 'abcdó' AS `abcdó`,_latin1'abcd\xC3\xB3' AS `abcdó`,_utf8'abcd\xC3\xB3' AS `abcd` +# # End of 5.5 tests # diff --git a/mysql-test/r/ctype_sjis.result b/mysql-test/r/ctype_sjis.result index 78827b5b907..abeb19c0c8f 100644 --- a/mysql-test/r/ctype_sjis.result +++ b/mysql-test/r/ctype_sjis.result @@ -218,6 +218,12 @@ hex(a) hex(lower(a)) hex(upper(a)) 8352835E 8352835E 8352835E 8372835E 8372835E 8372835E DROP TABLE t1; +# +# Bug#11766519 - Bug#59648: MY_STRTOLL10_MB2: ASSERTION `(*ENDPTR - S) % 2 == 0' FAILED. +# +SELECT QUOTE('\'); +QUOTE('\') +'\' # End of 5.1 tests # # Start of 5.5 tests diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 0ee80b921a1..e41544f2197 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -990,8 +990,8 @@ old_password(name) 14e500b131773991 select quote(name) from bug20536; quote(name) -???????? -???????????????? +'test1' +'\'test\\_2\'' drop table bug20536; set names ucs2; ERROR 42000: Variable 'character_set_client' can't be set to the value of 'ucs2' @@ -1238,6 +1238,17 @@ CREATE VIEW v1 AS SELECT 1 from t1 WHERE t1.b <=> (SELECT a FROM t1 WHERE a < SOME(SELECT '1')); DROP VIEW v1; DROP TABLE t1; +# +# Bug#59648 my_strtoll10_mb2: Assertion `(*endptr - s) % 2 == 0' failed. +# +SELECT HEX(CHAR(COALESCE(NULL, CHAR(COUNT('%s') USING ucs2), 1, @@global.license, NULL) USING cp850)); +HEX(CHAR(COALESCE(NULL, CHAR(COUNT('%s') USING ucs2), 1, @@global.license, NULL) USING cp850)) +00 +SELECT CONVERT(QUOTE(CHAR(0xf5 using ucs2)), SIGNED); +CONVERT(QUOTE(CHAR(0xf5 using ucs2)), SIGNED) +0 +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '' End of 5.0 tests # # Start of 5.5 tests diff --git a/mysql-test/r/ctype_utf16.result b/mysql-test/r/ctype_utf16.result index beafbf80e1e..ebb1bd443a2 100644 --- a/mysql-test/r/ctype_utf16.result +++ b/mysql-test/r/ctype_utf16.result @@ -30,13 +30,13 @@ binary 'a a' > 'a' binary 'a \0' > 'a' binary 'a\0' > 'a' 1 1 1 select hex(_utf16 0x44); hex(_utf16 0x44) -00000044 +0044 select hex(_utf16 0x3344); hex(_utf16 0x3344) 3344 select hex(_utf16 0x113344); hex(_utf16 0x113344) -000000113344 +00113344 CREATE TABLE t1 (word VARCHAR(64), word2 CHAR(64)) CHARACTER SET utf16; INSERT INTO t1 VALUES (_koi8r 0xF2, _koi8r 0xF2), (X'2004',X'2004'); SELECT hex(word) FROM t1 ORDER BY word; @@ -434,10 +434,10 @@ aardvarz DROP TABLE t1; SELECT hex(cast(0xAA as char character set utf16)); hex(cast(0xAA as char character set utf16)) -000000AA +00AA SELECT hex(convert(0xAA using utf16)); hex(convert(0xAA using utf16)) -000000AA +00AA CREATE TABLE t1 (a char(10) character set utf16); INSERT INTO t1 VALUES (0x1),(0x11),(0x111),(0x1111),(0x11111); SELECT HEX(a) FROM t1; @@ -1102,5 +1102,20 @@ t2 CREATE TABLE `t2` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1, t2; # +# Bug#11753363 (Bug#44793) Character sets: case clause, ucs2 or utf32, failure +# +SELECT CASE _latin1'a' WHEN _utf16'a' THEN 'A' END; +CASE _latin1'a' WHEN _utf16'a' THEN 'A' END +A +SELECT CASE _utf16'a' WHEN _latin1'a' THEN 'A' END; +CASE _utf16'a' WHEN _latin1'a' THEN 'A' END +A +CREATE TABLE t1 (s1 CHAR(5) CHARACTER SET utf16); +INSERT INTO t1 VALUES ('a'); +SELECT CASE s1 WHEN 'a' THEN 'b' ELSE 'c' END FROM t1; +CASE s1 WHEN 'a' THEN 'b' ELSE 'c' END +b +DROP TABLE t1; +# # End of 5.5 tests # diff --git a/mysql-test/r/ctype_utf32.result b/mysql-test/r/ctype_utf32.result index 37d5aa98be3..d749383d249 100644 --- a/mysql-test/r/ctype_utf32.result +++ b/mysql-test/r/ctype_utf32.result @@ -1152,5 +1152,20 @@ d f DROP TABLE t1; # +# Bug#11753363 (Bug#44793) Character sets: case clause, ucs2 or utf32, failure +# +SELECT CASE _latin1'a' WHEN _utf32'a' THEN 'A' END; +CASE _latin1'a' WHEN _utf32'a' THEN 'A' END +A +SELECT CASE _utf32'a' WHEN _latin1'a' THEN 'A' END; +CASE _utf32'a' WHEN _latin1'a' THEN 'A' END +A +CREATE TABLE t1 (s1 CHAR(5) CHARACTER SET utf32); +INSERT INTO t1 VALUES ('a'); +SELECT CASE s1 WHEN 'a' THEN 'b' ELSE 'c' END FROM t1; +CASE s1 WHEN 'a' THEN 'b' ELSE 'c' END +b +DROP TABLE t1; +# # End of 5.5 tests # diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index ababfe51621..ea6f00e2581 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -4969,5 +4969,20 @@ GROUP BY INSERT('', t2.a, t1.a, (@@global.max_binlog_size)); ERROR 23000: Duplicate entry '107374182410737418241' for key 'group_key' DROP TABLE t1; # +# Bug#11764503 (Bug#57341) Query in EXPLAIN EXTENDED shows wrong characters +# +SET NAMES latin1; +EXPLAIN EXTENDED SELECT 'abcdÁÂÃÄÅ', _latin1'abcdÁÂÃÄÅ', _utf8'abcdÁÂÃÄÅ' AS u; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select 'abcdÁÂÃÄÅ' AS `abcdÁÂÃÄÅ`,_latin1'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `abcdÁÂÃÄÅ`,_utf8'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `u` +SET NAMES utf8; +EXPLAIN EXTENDED SELECT 'abcdÁÂÃÄÅ', _latin1'abcdÁÂÃÄÅ', _utf8'abcdÁÂÃÄÅ'; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select 'abcdÁÂÃÄÅ' AS `abcdÁÂÃÄÅ`,_latin1'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `abcdÃÂÃÄÅ`,_utf8'abcd\xC3\x81\xC3\x82\xC3\x83\xC3\x84\xC3\x85' AS `abcdÁÂÃÄÅ` +# # End of 5.5 tests # diff --git a/mysql-test/r/flush.result b/mysql-test/r/flush.result index b1e2e48eca8..bbfea2dade8 100644 --- a/mysql-test/r/flush.result +++ b/mysql-test/r/flush.result @@ -451,3 +451,18 @@ unlock tables; handler t1 close; # Cleanup. drop tables t1, t2; +# +# Bug#57649 FLUSH TABLES under FLUSH TABLES <list> WITH READ LOCK leads +# to assert failure. +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a INT); +FLUSH TABLES t1 WITH READ LOCK; +FLUSH TABLES; +ERROR HY000: Table 't1' was locked with a READ lock and can't be updated +CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a= 1; +ERROR HY000: Table 't1' was locked with a READ lock and can't be updated +ALTER TABLE t1 COMMENT 'test'; +ERROR HY000: Table 't1' was locked with a READ lock and can't be updated +UNLOCK TABLES; +DROP TABLE t1; diff --git a/mysql-test/r/func_encrypt_ucs2.result b/mysql-test/r/func_encrypt_ucs2.result new file mode 100644 index 00000000000..2ca40434cae --- /dev/null +++ b/mysql-test/r/func_encrypt_ucs2.result @@ -0,0 +1,19 @@ +# +# Bug#59648 my_strtoll10_mb2: Assertion `(*endptr - s) % 2 == 0' failed. +# +SELECT CHAR_LENGTH(DES_ENCRYPT(0, CHAR('1' USING ucs2))); +CHAR_LENGTH(DES_ENCRYPT(0, CHAR('1' USING ucs2))) +9 +SELECT CONVERT(DES_ENCRYPT(0, CHAR('1' USING ucs2)),UNSIGNED); +CONVERT(DES_ENCRYPT(0, CHAR('1' USING ucs2)),UNSIGNED) +0 +Warnings: +Warning 1292 Truncated incorrect INTEGER value: '' +SELECT CHAR_LENGTH(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' USING ucs2))); +CHAR_LENGTH(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' USING ucs2))) +4 +SELECT CONVERT(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' using ucs2)), UNSIGNED); +CONVERT(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' using ucs2)), UNSIGNED) +0 +Warnings: +Warning 1292 Truncated incorrect INTEGER value: 'test' diff --git a/mysql-test/r/func_set.result b/mysql-test/r/func_set.result index 14ebc8203ec..ba9500bff46 100644 --- a/mysql-test/r/func_set.result +++ b/mysql-test/r/func_set.result @@ -159,3 +159,45 @@ SELECT CONVERT( a USING latin1 ) FROM t2; CONVERT( a USING latin1 ) DROP TABLE t1, t2; +# +# BUG#59405: FIND_IN_SET won't work normaly after upgrade from 5.1 to 5.5 +# +CREATE TABLE t1(days set('1','2','3','4','5','6','7')); +INSERT INTO t1 VALUES('1,2,3,4,5,6,7'), (NULL), ('1,2,3,4,5,6,7'); + +SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), days); +days +1,2,3,4,5,6,7 +1,2,3,4,5,6,7 +SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), days) IS UNKNOWN; +days +NULL +SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), NULL); +days +SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), NULL) IS UNKNOWN; +days +1,2,3,4,5,6,7 +NULL +1,2,3,4,5,6,7 +SELECT * FROM t1 WHERE FIND_IN_SET(7, days); +days +1,2,3,4,5,6,7 +1,2,3,4,5,6,7 +SELECT * FROM t1 WHERE FIND_IN_SET(8, days); +days +SELECT * FROM t1 WHERE FIND_IN_SET(NULL, days); +days +SELECT * FROM t1 WHERE FIND_IN_SET(NULL, days) IS UNKNOWN; +days +1,2,3,4,5,6,7 +NULL +1,2,3,4,5,6,7 +SELECT * FROM t1 WHERE FIND_IN_SET(NULL, NULL); +days +SELECT * FROM t1 WHERE FIND_IN_SET(NULL, NULL) IS UNKNOWN; +days +1,2,3,4,5,6,7 +NULL +1,2,3,4,5,6,7 + +DROP TABLE t1; diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 38f09d3b759..49db157f35f 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -1452,6 +1452,199 @@ DROP DATABASE mysqltest2; DROP USER testuser@localhost; use test; +# +# Test for bug #36544 "DROP USER does not remove stored function +# privileges". +# +create database mysqltest1; +create function mysqltest1.f1() returns int return 0; +create procedure mysqltest1.p1() begin end; +# +# 1) Check that DROP USER properly removes privileges on both +# stored procedures and functions. +# +create user mysqluser1@localhost; +grant execute on function mysqltest1.f1 to mysqluser1@localhost; +grant execute on procedure mysqltest1.p1 to mysqluser1@localhost; +# Quick test that granted privileges are properly reflected +# in privilege tables and in in-memory structures. +show grants for mysqluser1@localhost; +Grants for mysqluser1@localhost +GRANT USAGE ON *.* TO 'mysqluser1'@'localhost' +GRANT EXECUTE ON PROCEDURE `mysqltest1`.`p1` TO 'mysqluser1'@'localhost' +GRANT EXECUTE ON FUNCTION `mysqltest1`.`f1` TO 'mysqluser1'@'localhost' +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost'; +db routine_name routine_type proc_priv +mysqltest1 f1 FUNCTION Execute +mysqltest1 p1 PROCEDURE Execute +# +# Create connection 'bug_36544_con1' as 'mysqluser1@localhost'. +call mysqltest1.p1(); +select mysqltest1.f1(); +mysqltest1.f1() +0 +# +# Switch to connection 'default'. +drop user mysqluser1@localhost; +# +# Test that dropping of user is properly reflected in +# both privilege tables and in in-memory structures. +# +# Switch to connection 'bug36544_con1'. +# The connection cold be alive but should not be able to +# access to any of the stored routines. +call mysqltest1.p1(); +ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.p1' +select mysqltest1.f1(); +ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.f1' +# +# Switch to connection 'default'. +# +# Now create user with the same name and check that he +# has not inherited privileges. +create user mysqluser1@localhost; +show grants for mysqluser1@localhost; +Grants for mysqluser1@localhost +GRANT USAGE ON *.* TO 'mysqluser1'@'localhost' +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost'; +db routine_name routine_type proc_priv +# +# Create connection 'bug_36544_con2' as 'mysqluser1@localhost'. +# Newly created user should not be able to access any of the routines. +call mysqltest1.p1(); +ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.p1' +select mysqltest1.f1(); +ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.f1' +# +# Switch to connection 'default'. +# +# 2) Check that RENAME USER properly updates privileges on both +# stored procedures and functions. +# +grant execute on function mysqltest1.f1 to mysqluser1@localhost; +grant execute on procedure mysqltest1.p1 to mysqluser1@localhost; +# +# Create one more user to make in-memory hashes non-trivial. +# User names 'mysqluser11' and 'mysqluser10' were selected +# to trigger bug discovered during code inspection. +create user mysqluser11@localhost; +grant execute on function mysqltest1.f1 to mysqluser11@localhost; +grant execute on procedure mysqltest1.p1 to mysqluser11@localhost; +# Also create a couple of tables to test for another bug +# discovered during code inspection (again table names were +# chosen especially to trigger the bug). +create table mysqltest1.t11 (i int); +create table mysqltest1.t22 (i int); +grant select on mysqltest1.t22 to mysqluser1@localhost; +grant select on mysqltest1.t11 to mysqluser1@localhost; +# Quick test that granted privileges are properly reflected +# in privilege tables and in in-memory structures. +show grants for mysqluser1@localhost; +Grants for mysqluser1@localhost +GRANT USAGE ON *.* TO 'mysqluser1'@'localhost' +GRANT SELECT ON `mysqltest1`.`t11` TO 'mysqluser1'@'localhost' +GRANT SELECT ON `mysqltest1`.`t22` TO 'mysqluser1'@'localhost' +GRANT EXECUTE ON PROCEDURE `mysqltest1`.`p1` TO 'mysqluser1'@'localhost' +GRANT EXECUTE ON FUNCTION `mysqltest1`.`f1` TO 'mysqluser1'@'localhost' +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost'; +db routine_name routine_type proc_priv +mysqltest1 f1 FUNCTION Execute +mysqltest1 p1 PROCEDURE Execute +select db, table_name, table_priv from mysql.tables_priv where user='mysqluser1' and host='localhost'; +db table_name table_priv +mysqltest1 t11 Select +mysqltest1 t22 Select +# +# Switch to connection 'bug36544_con2'. +call mysqltest1.p1(); +select mysqltest1.f1(); +mysqltest1.f1() +0 +select * from mysqltest1.t11; +i +select * from mysqltest1.t22; +i +# +# Switch to connection 'default'. +rename user mysqluser1@localhost to mysqluser10@localhost; +# +# Test that there are no privileges left for mysqluser1. +# +# Switch to connection 'bug36544_con2'. +# The connection cold be alive but should not be able to +# access to any of the stored routines or tables. +call mysqltest1.p1(); +ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.p1' +select mysqltest1.f1(); +ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.f1' +select * from mysqltest1.t11; +ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 't11' +select * from mysqltest1.t22; +ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 't22' +# +# Switch to connection 'default'. +# +# Now create user with the old name and check that he +# has not inherited privileges. +create user mysqluser1@localhost; +show grants for mysqluser1@localhost; +Grants for mysqluser1@localhost +GRANT USAGE ON *.* TO 'mysqluser1'@'localhost' +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost'; +db routine_name routine_type proc_priv +select db, table_name, table_priv from mysql.tables_priv where user='mysqluser1' and host='localhost'; +db table_name table_priv +# +# Create connection 'bug_36544_con3' as 'mysqluser1@localhost'. +# Newly created user should not be able to access to any of the +# stored routines or tables. +call mysqltest1.p1(); +ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.p1' +select mysqltest1.f1(); +ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.f1' +select * from mysqltest1.t11; +ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 't11' +select * from mysqltest1.t22; +ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 't22' +# +# Switch to connection 'default'. +# +# Now check that privileges became associated with a new user +# name - mysqluser10. +# +show grants for mysqluser10@localhost; +Grants for mysqluser10@localhost +GRANT USAGE ON *.* TO 'mysqluser10'@'localhost' +GRANT SELECT ON `mysqltest1`.`t22` TO 'mysqluser10'@'localhost' +GRANT SELECT ON `mysqltest1`.`t11` TO 'mysqluser10'@'localhost' +GRANT EXECUTE ON PROCEDURE `mysqltest1`.`p1` TO 'mysqluser10'@'localhost' +GRANT EXECUTE ON FUNCTION `mysqltest1`.`f1` TO 'mysqluser10'@'localhost' +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser10' and host='localhost'; +db routine_name routine_type proc_priv +mysqltest1 f1 FUNCTION Execute +mysqltest1 p1 PROCEDURE Execute +select db, table_name, table_priv from mysql.tables_priv where user='mysqluser10' and host='localhost'; +db table_name table_priv +mysqltest1 t11 Select +mysqltest1 t22 Select +# +# Create connection 'bug_36544_con4' as 'mysqluser10@localhost'. +call mysqltest1.p1(); +select mysqltest1.f1(); +mysqltest1.f1() +0 +select * from mysqltest1.t11; +i +select * from mysqltest1.t22; +i +# +# Switch to connection 'default'. +# +# Clean-up. +drop user mysqluser1@localhost; +drop user mysqluser10@localhost; +drop user mysqluser11@localhost; +drop database mysqltest1; End of 5.0 tests set names utf8; grant select on test.* to юзер_юзер@localhost; @@ -1546,11 +1739,7 @@ fn2() 2 DROP USER 'userbug33464'@'localhost'; DROP FUNCTION fn1; -Warnings: -Warning 1403 There is no such grant defined for user 'userbug33464' on host 'localhost' on routine 'fn1' DROP FUNCTION fn2; -Warnings: -Warning 1403 There is no such grant defined for user 'userbug33464' on host 'localhost' on routine 'fn2' DROP PROCEDURE sp3; DROP USER 'userbug33464'@'localhost'; USE test; diff --git a/mysql-test/r/innodb_mysql_sync.result b/mysql-test/r/innodb_mysql_sync.result index 58948835f66..8e210a7e205 100644 --- a/mysql-test/r/innodb_mysql_sync.result +++ b/mysql-test/r/innodb_mysql_sync.result @@ -153,5 +153,15 @@ SET DEBUG_SYNC= "now SIGNAL query"; a b # Test 4: Secondary unique index, should not block reads. # Connection default +SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; +# Sending: +ALTER TABLE t1 ADD UNIQUE (b); +# Connection con1 +SET DEBUG_SYNC= "now WAIT_FOR manage"; +SELECT * FROM t1; +a b +SET DEBUG_SYNC= "now SIGNAL query"; +# Connection default +# Reaping: ALTER TABLE t1 ADD UNIQUE (b) SET DEBUG_SYNC= "RESET"; DROP TABLE t1; diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result index ef46eba5ccb..42fb1945d8b 100644 --- a/mysql-test/r/mysqlcheck.result +++ b/mysql-test/r/mysqlcheck.result @@ -109,7 +109,7 @@ mysql.time_zone_name Table is already up to date mysql.time_zone_transition Table is already up to date mysql.time_zone_transition_type Table is already up to date mysql.user Table is already up to date -create table t1 (a int); +create table t1 (a int) engine=myisam; create view v1 as select * from t1; test.t1 OK test.t1 Table is already up to date @@ -117,14 +117,14 @@ test.t1 OK test.t1 Table is already up to date drop view v1; drop table t1; -create table `t``1`(a int); -create table `t 1`(a int); +create table `t``1`(a int) engine=myisam; +create table `t 1`(a int) engine=myisam; test.t 1 OK test.t`1 OK drop table `t``1`, `t 1`; create database d_bug25347; use d_bug25347; -create table t_bug25347 (a int); +create table t_bug25347 (a int) engine=myisam; create view v_bug25347 as select * from t_bug25347; insert into t_bug25347 values (1),(2),(3); flush tables; @@ -164,15 +164,15 @@ Table Op Msg_type Msg_text test.v1 check status OK information_schema.routines check note The storage engine for the table doesn't support check drop view v1; -CREATE TABLE t1(a INT); -CREATE TABLE t2(a INT); +CREATE TABLE t1(a INT) engine=myisam; +CREATE TABLE t2(a INT) engine=myisam; test.t1 Error : Incorrect information in file: './test/t1.frm' error : Corrupt test.t2 OK DROP TABLE t1, t2; End of 5.0 tests -create table t1(a int); +create table t1(a int) engine=myisam; create view v1 as select * from t1; show tables; Tables_in_test @@ -192,7 +192,7 @@ v-1 drop view v1, `v-1`; drop table t1; SET NAMES utf8; -CREATE TABLE `#mysql50#@` (a INT); +CREATE TABLE `#mysql50#@` (a INT) engine=myisam; SHOW TABLES; Tables_in_test #mysql50#@ @@ -203,7 +203,7 @@ SHOW TABLES; Tables_in_test @ DROP TABLE `@`; -CREATE TABLE `я` (a INT); +CREATE TABLE `я` (a INT) engine=myisam; SET NAMES DEFAULT; mysqlcheck --default-character-set="latin1" --databases test test.? @@ -216,8 +216,8 @@ DROP TABLE `я`; SET NAMES DEFAULT; CREATE DATABASE `#mysql50#a@b`; USE `#mysql50#a@b`; -CREATE TABLE `#mysql50#c@d` (a INT); -CREATE TABLE t1 (a INT); +CREATE TABLE `#mysql50#c@d` (a INT) engine=myisam; +CREATE TABLE t1 (a INT) engine=myisam; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_SCHEMA="#mysql50#a@b" ORDER BY trigger_name; TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION @@ -246,12 +246,12 @@ USE test; # Bug #31821: --all-in-1 and --fix-table-names don't work together # drop table if exists `#mysql50#t1-1`; -create table `#mysql50#t1-1` (a int); +create table `#mysql50#t1-1` (a int) engine=myisam; show tables like 't1-1'; Tables_in_test (t1-1) t1-1 drop table `t1-1`; -create table `#mysql50#t1-1` (a int); +create table `#mysql50#t1-1` (a int) engine=myisam; show tables like 't1-1'; Tables_in_test (t1-1) t1-1 @@ -260,3 +260,67 @@ End of 5.1 tests # # Bug #35269: mysqlcheck behaves different depending on order of parameters # +# +# Bug#11755431 47205: MAP 'REPAIR TABLE' TO RECREATE +ANALYZE FOR +# ENGINES NOT SUPPORTING NATIVE +# +DROP TABLE IF EXISTS bug47205; +# +# Test 1: Check that ALTER TABLE ... rebuilds the table +CREATE TABLE bug47205(a VARCHAR(20) PRIMARY KEY) +DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci engine=innodb; +INSERT INTO bug47205 VALUES ("foobar"); +FLUSH TABLE bug47205; +# Replace the FRM with a 5.0 FRM that will require upgrade +# Should indicate that ALTER TABLE ... FORCE is needed +CHECK TABLE bug47205 FOR UPGRADE; +Table Op Msg_type Msg_text +test.bug47205 check error Table rebuild required. Please do "ALTER TABLE `bug47205` FORCE" or dump/reload to fix it! +# ALTER TABLE ... FORCE should rebuild the table +# and therefore output "affected rows: 1" +ALTER TABLE bug47205 FORCE; +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +# Table should now be ok +CHECK TABLE bug47205 FOR UPGRADE; +Table Op Msg_type Msg_text +test.bug47205 check status OK +DROP TABLE bug47205; +# +# Test 2: InnoDB - REPAIR not supported +CREATE TABLE bug47205(a VARCHAR(20) PRIMARY KEY) +DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci engine=innodb; +FLUSH TABLE bug47205; +# Replace the FRM with a 5.0 FRM that will require upgrade +# Should indicate that ALTER TABLE .. FORCE is needed +CHECK TABLE bug47205 FOR UPGRADE; +Table Op Msg_type Msg_text +test.bug47205 check error Table rebuild required. Please do "ALTER TABLE `bug47205` FORCE" or dump/reload to fix it! +# Running mysqlcheck to check and upgrade +test.bug47205 +error : Table rebuild required. Please do "ALTER TABLE `bug47205` FORCE" or dump/reload to fix it! + +Repairing tables +# Table should now be ok +CHECK TABLE bug47205 FOR UPGRADE; +Table Op Msg_type Msg_text +test.bug47205 check status OK +DROP TABLE bug47205; +# +# Test 3: MyISAM - REPAIR supported +# Use an old FRM that will require upgrade +# Should indicate that REPAIR TABLE is needed +CHECK TABLE bug47205 FOR UPGRADE; +Table Op Msg_type Msg_text +test.bug47205 check error Table upgrade required. Please do "REPAIR TABLE `bug47205`" or dump/reload to fix it! +# Running mysqlcheck to check and upgrade +test.bug47205 +error : Table upgrade required. Please do "REPAIR TABLE `bug47205`" or dump/reload to fix it! + +Repairing tables +test.bug47205 OK +# Table should now be ok +CHECK TABLE bug47205 FOR UPGRADE; +Table Op Msg_type Msg_text +test.bug47205 check status OK +DROP TABLE bug47205; diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 1d7a08e9a7c..49e7f4a6ec9 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -1,5 +1,43 @@ drop table if exists t1, t2; # +# Bug#59297: Can't find record in 'tablename' on update inner join +# +CREATE TABLE t1 ( +a char(2) NOT NULL, +b char(2) NOT NULL, +c int(10) unsigned NOT NULL, +d varchar(255) DEFAULT NULL, +e varchar(1000) DEFAULT NULL, +PRIMARY KEY (a, b, c), +KEY (a), +KEY (a, b) +) +/*!50100 PARTITION BY KEY (a) +PARTITIONS 20 */; +INSERT INTO t1 (a, b, c, d, e) VALUES +('07', '03', 343, '1', '07_03_343'), +('01', '04', 343, '2', '01_04_343'), +('01', '06', 343, '3', '01_06_343'), +('01', '07', 343, '4', '01_07_343'), +('01', '08', 343, '5', '01_08_343'), +('01', '09', 343, '6', '01_09_343'), +('03', '03', 343, '7', '03_03_343'), +('03', '06', 343, '8', '03_06_343'), +('03', '07', 343, '9', '03_07_343'), +('04', '03', 343, '10', '04_03_343'), +('04', '06', 343, '11', '04_06_343'), +('05', '03', 343, '12', '05_03_343'), +('11', '03', 343, '13', '11_03_343'), +('11', '04', 343, '14', '11_04_343') +; +UPDATE t1 AS A, +(SELECT '03' AS a, '06' AS b, 343 AS c, 'last' AS d) AS B +SET A.e = B.d +WHERE A.a = '03' +AND A.b = '06' +AND A.c = 343; +DROP TABLE t1; +# # Bug#57778: failed primary key add to partitioned innodb table # inconsistent and crashes # diff --git a/mysql-test/r/xml.result b/mysql-test/r/xml.result index 4568775d3fd..8ca9ab84bf7 100644 --- a/mysql-test/r/xml.result +++ b/mysql-test/r/xml.result @@ -1124,6 +1124,14 @@ Warning 1525 Incorrect XML value: 'parse error at line 1 pos 2: END-OF-INPUT une SELECT UPDATEXML(CONVERT(_latin1'<!--' USING utf8),'1','1'); UPDATEXML(CONVERT(_latin1'<!--' USING utf8),'1','1') NULL +# +# Bug#11766725 (bug#59901): EXTRACTVALUE STILL BROKEN AFTER FIX FOR BUG #44332 +# +SELECT ExtractValue(CONVERT('<\"', BINARY(10)), 1); +ExtractValue(CONVERT('<\"', BINARY(10)), 1) +NULL +Warnings: +Warning 1525 Incorrect XML value: 'parse error at line 1 pos 11: STRING unexpected (ident or '/' wanted)' End of 5.1 tests # # Start of 5.5 tests diff --git a/mysql-test/std_data/bug47205.frm b/mysql-test/std_data/bug47205.frm Binary files differnew file mode 100644 index 00000000000..6d53b221d28 --- /dev/null +++ b/mysql-test/std_data/bug47205.frm diff --git a/mysql-test/suite/engines/iuds/r/insert_year.result b/mysql-test/suite/engines/iuds/r/insert_year.result index 69d1139c037..386c8090434 100644 --- a/mysql-test/suite/engines/iuds/r/insert_year.result +++ b/mysql-test/suite/engines/iuds/r/insert_year.result @@ -2431,7 +2431,7 @@ c1 c2 c3 c4 2155 2155 1998-12-26 1998-12-26 11:30:45 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t3; total_rows min_value max(c2) -21 1901 2155 +21 0 2155 SELECT * FROM t3 WHERE c3 = '1998-12-11'; c1 c2 c3 c4 1990 1990 1998-12-11 1998-12-11 11:30:45 @@ -2838,7 +2838,7 @@ c1 c2 c3 c4 2155 2155 1998-12-26 1998-12-26 11:30:45 SELECT count(*) as total_rows, min(c2) as min_value, max(c2) FROM t3; total_rows min_value max(c2) -21 1901 2155 +21 0 2155 SELECT * FROM t3 WHERE c3 = '1998-12-11'; c1 c2 c3 c4 1990 1990 1998-12-11 1998-12-11 11:30:45 diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result index f19030834c8..fa8fb6c1eb2 100644 --- a/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result +++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result @@ -128,8 +128,6 @@ root@localhost db_storedproc_1 drop user 'user_1'@'localhost'; DROP PROCEDURE sp3; DROP FUNCTION fn1; -Warnings: -Warning 1403 There is no such grant defined for user 'user_1' on host 'localhost' on routine 'fn1' Testcase 3.1.6.4: ----------------- diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc_06.result b/mysql-test/suite/funcs_1/r/memory_storedproc_06.result index 0a117c830ee..f08165b21f8 100644 --- a/mysql-test/suite/funcs_1/r/memory_storedproc_06.result +++ b/mysql-test/suite/funcs_1/r/memory_storedproc_06.result @@ -129,8 +129,6 @@ root@localhost db_storedproc_1 drop user 'user_1'@'localhost'; DROP PROCEDURE sp3; DROP FUNCTION fn1; -Warnings: -Warning 1403 There is no such grant defined for user 'user_1' on host 'localhost' on routine 'fn1' Testcase 3.1.6.4: ----------------- diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result b/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result index 0a117c830ee..f08165b21f8 100644 --- a/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result +++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result @@ -129,8 +129,6 @@ root@localhost db_storedproc_1 drop user 'user_1'@'localhost'; DROP PROCEDURE sp3; DROP FUNCTION fn1; -Warnings: -Warning 1403 There is no such grant defined for user 'user_1' on host 'localhost' on routine 'fn1' Testcase 3.1.6.4: ----------------- diff --git a/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc b/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc index 0695a0724d8..3e5ca055ae1 100644 --- a/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc +++ b/mysql-test/suite/funcs_1/storedproc/storedproc_06.inc @@ -149,10 +149,6 @@ USE db_storedproc_1; drop user 'user_1'@'localhost'; DROP PROCEDURE sp3; -# This drop function shouldn't generated a warning as the -# privileges should have been removed when the user was -# dropped. Reported as Bug#36544 DROP USER does not remove -# stored function privileges DROP FUNCTION fn1; diff --git a/mysql-test/suite/large_tests/t/lock_tables_big.test b/mysql-test/suite/large_tests/t/lock_tables_big.test index 41dcff3577c..7fab19ac274 100644 --- a/mysql-test/suite/large_tests/t/lock_tables_big.test +++ b/mysql-test/suite/large_tests/t/lock_tables_big.test @@ -1,6 +1,16 @@ # # Bug#24509 cannot use more than 2048 file descriptors on windows # + +# +# This test requires approximately 6000 of files to be open simultaneously. +# Let us skip it on platforms where open files limit is too low. +let $max_open_files_limit= `SELECT @@open_files_limit < 6100`; +if ($max_open_files_limit) +{ + skip Need open_files_limit to be greater than 6100; +} + --disable_query_log create database many_tables; use many_tables; @@ -19,14 +29,14 @@ while ($i) } #lock all tables we just created (resembles mysqldump startup is doing with --all-databases operation) -#There will be 3 descriptors for each table (table.FRM, table.MYI and table.MYD files) means 9000 files +#There will be 2 descriptors for each table (table.MYI and table.MYD files) means 6000 files #descriptors altogether. For Microsoft C runtime, this is way too many. eval LOCK TABLES $table_list; unlock tables; drop database many_tables; ---disable_query_log +--enable_query_log --echo all done diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test index b8aae2eae40..5d1acf107d7 100644 --- a/mysql-test/t/ctype_latin1.test +++ b/mysql-test/t/ctype_latin1.test @@ -144,5 +144,20 @@ SELECT '' LIKE '' ESCAPE EXPORT_SET(1, 1, 1, 1, ''); --source include/ctype_numconv.inc --echo # +--echo # Bug#11764503 (Bug#57341) Query in EXPLAIN EXTENDED shows wrong characters +--echo # +# Test latin1 client erroneously started with --default-character-set=utf8 +# EXPLAIN output should still be pretty readable. +# We're using 'ó' (\xC3\xB3) as a magic sequence: +# - it's "LATIN CAPITAL LETTER A WITH TILDE ABOVE + SUPERSCRIPT 3" in latin1 +# - it's "LATIN SMALL LETTER O WITH ACUTE ABOVE" in utf8. +SET NAMES utf8; +EXPLAIN EXTENDED SELECT 'abcdó', _latin1'abcdó', _utf8'abcdó'; +# Test normal latin1 +SET NAMES latin1; +EXPLAIN EXTENDED SELECT 'abcdó', _latin1'abcdó', _utf8'abcdó'; + + +--echo # --echo # End of 5.5 tests --echo # diff --git a/mysql-test/t/ctype_sjis.test b/mysql-test/t/ctype_sjis.test index 103039d0323..f45e6ab9b54 100644 --- a/mysql-test/t/ctype_sjis.test +++ b/mysql-test/t/ctype_sjis.test @@ -92,6 +92,14 @@ INSERT INTO t1 VALUES (0x8372835E),(0x8352835E); SELECT hex(a), hex(lower(a)), hex(upper(a)) FROM t1 ORDER BY binary(a); DROP TABLE t1; +--echo # +--echo # Bug#11766519 - Bug#59648: MY_STRTOLL10_MB2: ASSERTION `(*ENDPTR - S) % 2 == 0' FAILED. +--echo # +# In the below string backslash (0x5C) is a part of a multi-byte +# character, so it should not be quoted. +SELECT QUOTE('\'); + + --echo # End of 5.1 tests diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test index a6f3a2c2cbf..24e68f2dab3 100644 --- a/mysql-test/t/ctype_ucs.test +++ b/mysql-test/t/ctype_ucs.test @@ -741,6 +741,12 @@ WHERE t1.b <=> (SELECT a FROM t1 WHERE a < SOME(SELECT '1')); DROP VIEW v1; DROP TABLE t1; +--echo # +--echo # Bug#59648 my_strtoll10_mb2: Assertion `(*endptr - s) % 2 == 0' failed. +--echo # +SELECT HEX(CHAR(COALESCE(NULL, CHAR(COUNT('%s') USING ucs2), 1, @@global.license, NULL) USING cp850)); +SELECT CONVERT(QUOTE(CHAR(0xf5 using ucs2)), SIGNED); + --echo End of 5.0 tests diff --git a/mysql-test/t/ctype_utf16.test b/mysql-test/t/ctype_utf16.test index ef705474eee..2f1651d0f40 100644 --- a/mysql-test/t/ctype_utf16.test +++ b/mysql-test/t/ctype_utf16.test @@ -745,6 +745,15 @@ CREATE TABLE t2 AS SELECT CONCAT(s1) FROM t1; SHOW CREATE TABLE t2; DROP TABLE t1, t2; +--echo # +--echo # Bug#11753363 (Bug#44793) Character sets: case clause, ucs2 or utf32, failure +--echo # +SELECT CASE _latin1'a' WHEN _utf16'a' THEN 'A' END; +SELECT CASE _utf16'a' WHEN _latin1'a' THEN 'A' END; +CREATE TABLE t1 (s1 CHAR(5) CHARACTER SET utf16); +INSERT INTO t1 VALUES ('a'); +SELECT CASE s1 WHEN 'a' THEN 'b' ELSE 'c' END FROM t1; +DROP TABLE t1; # ## TODO: add tests for all engines diff --git a/mysql-test/t/ctype_utf32.test b/mysql-test/t/ctype_utf32.test index b03284a1c7c..10d365572bf 100644 --- a/mysql-test/t/ctype_utf32.test +++ b/mysql-test/t/ctype_utf32.test @@ -831,5 +831,15 @@ SELECT * FROM t1 WHERE b BETWEEN 'a' AND 'z'; DROP TABLE t1; --echo # +--echo # Bug#11753363 (Bug#44793) Character sets: case clause, ucs2 or utf32, failure +--echo # +SELECT CASE _latin1'a' WHEN _utf32'a' THEN 'A' END; +SELECT CASE _utf32'a' WHEN _latin1'a' THEN 'A' END; +CREATE TABLE t1 (s1 CHAR(5) CHARACTER SET utf32); +INSERT INTO t1 VALUES ('a'); +SELECT CASE s1 WHEN 'a' THEN 'b' ELSE 'c' END FROM t1; +DROP TABLE t1; + +--echo # --echo # End of 5.5 tests --echo # diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 2aea21afe68..a519a417192 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -1550,6 +1550,16 @@ SELECT COUNT(*) FROM t1, t1 t2 GROUP BY INSERT('', t2.a, t1.a, (@@global.max_binlog_size)); DROP TABLE t1; +--echo # +--echo # Bug#11764503 (Bug#57341) Query in EXPLAIN EXTENDED shows wrong characters +--echo # +# Emulate utf8 client erroneously started with --default-character-set=latin1, +# as in the bug report. EXPLAIN output should still be pretty readable +SET NAMES latin1; +EXPLAIN EXTENDED SELECT 'abcdÁÂÃÄÅ', _latin1'abcdÁÂÃÄÅ', _utf8'abcdÁÂÃÄÅ' AS u; +# Test normal utf8 +SET NAMES utf8; +EXPLAIN EXTENDED SELECT 'abcdÁÂÃÄÅ', _latin1'abcdÁÂÃÄÅ', _utf8'abcdÁÂÃÄÅ'; --echo # --echo # End of 5.5 tests diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 985493481e9..063bbb9ce4b 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -16,3 +16,4 @@ read_many_rows_innodb : Bug#37635 2010-11-15 mattiasj report already exists sum_distinct-big : Bug#56927 2010-11-15 mattiasj was not tested alter_table-big : Bug#37248 2010-11-15 mattiasj was not tested create-big : Bug#37248 2010-11-15 mattiasj was not tested +archive-big : Bug#11817185 2011-03-10 Anitha Disabled since this leads to timeout on Solaris Sparc diff --git a/mysql-test/t/flush.test b/mysql-test/t/flush.test index 944c9c43019..52ee6d2cf87 100644 --- a/mysql-test/t/flush.test +++ b/mysql-test/t/flush.test @@ -644,3 +644,27 @@ disconnect con2; --source include/wait_until_disconnected.inc connection default; drop tables t1, t2; + + +--echo # +--echo # Bug#57649 FLUSH TABLES under FLUSH TABLES <list> WITH READ LOCK leads +--echo # to assert failure. +--echo # + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1 (a INT); +FLUSH TABLES t1 WITH READ LOCK; + +# All these triggered the assertion +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +FLUSH TABLES; +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET @a= 1; +--error ER_TABLE_NOT_LOCKED_FOR_WRITE +ALTER TABLE t1 COMMENT 'test'; + +UNLOCK TABLES; +DROP TABLE t1; diff --git a/mysql-test/t/func_encrypt_ucs2.test b/mysql-test/t/func_encrypt_ucs2.test new file mode 100644 index 00000000000..8b4cd44d354 --- /dev/null +++ b/mysql-test/t/func_encrypt_ucs2.test @@ -0,0 +1,12 @@ +-- source include/have_ssl_crypto_functs.inc +-- source include/have_ucs2.inc + +--echo # +--echo # Bug#59648 my_strtoll10_mb2: Assertion `(*endptr - s) % 2 == 0' failed. +--echo # + +SELECT CHAR_LENGTH(DES_ENCRYPT(0, CHAR('1' USING ucs2))); +SELECT CONVERT(DES_ENCRYPT(0, CHAR('1' USING ucs2)),UNSIGNED); + +SELECT CHAR_LENGTH(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' USING ucs2))); +SELECT CONVERT(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' using ucs2)), UNSIGNED); diff --git a/mysql-test/t/func_set.test b/mysql-test/t/func_set.test index 294efa8caf1..3531864c860 100644 --- a/mysql-test/t/func_set.test +++ b/mysql-test/t/func_set.test @@ -97,3 +97,25 @@ SELECT CONVERT( a USING latin1 ) FROM t1; SELECT CONVERT( a USING latin1 ) FROM t2; DROP TABLE t1, t2; + +--echo # +--echo # BUG#59405: FIND_IN_SET won't work normaly after upgrade from 5.1 to 5.5 +--echo # + +CREATE TABLE t1(days set('1','2','3','4','5','6','7')); +INSERT INTO t1 VALUES('1,2,3,4,5,6,7'), (NULL), ('1,2,3,4,5,6,7'); + +--echo +SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), days); +SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), days) IS UNKNOWN; +SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), NULL); +SELECT * FROM t1 WHERE FIND_IN_SET(DAYOFWEEK(CURRENT_DATE()), NULL) IS UNKNOWN; +SELECT * FROM t1 WHERE FIND_IN_SET(7, days); +SELECT * FROM t1 WHERE FIND_IN_SET(8, days); +SELECT * FROM t1 WHERE FIND_IN_SET(NULL, days); +SELECT * FROM t1 WHERE FIND_IN_SET(NULL, days) IS UNKNOWN; +SELECT * FROM t1 WHERE FIND_IN_SET(NULL, NULL); +SELECT * FROM t1 WHERE FIND_IN_SET(NULL, NULL) IS UNKNOWN; + +--echo +DROP TABLE t1; diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 845b976c031..1e1cb6c24dc 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -1396,6 +1396,183 @@ DROP USER testuser@localhost; use test; --echo + +--echo # +--echo # Test for bug #36544 "DROP USER does not remove stored function +--echo # privileges". +--echo # +create database mysqltest1; +create function mysqltest1.f1() returns int return 0; +create procedure mysqltest1.p1() begin end; +--echo # +--echo # 1) Check that DROP USER properly removes privileges on both +--echo # stored procedures and functions. +--echo # +create user mysqluser1@localhost; +grant execute on function mysqltest1.f1 to mysqluser1@localhost; +grant execute on procedure mysqltest1.p1 to mysqluser1@localhost; + +--echo # Quick test that granted privileges are properly reflected +--echo # in privilege tables and in in-memory structures. +show grants for mysqluser1@localhost; +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost'; +--echo # +--echo # Create connection 'bug_36544_con1' as 'mysqluser1@localhost'. +--connect (bug36544_con1,localhost,mysqluser1,,) +call mysqltest1.p1(); +select mysqltest1.f1(); + +--echo # +--echo # Switch to connection 'default'. +--connection default +drop user mysqluser1@localhost; + +--echo # +--echo # Test that dropping of user is properly reflected in +--echo # both privilege tables and in in-memory structures. +--echo # +--echo # Switch to connection 'bug36544_con1'. +--connection bug36544_con1 +--echo # The connection cold be alive but should not be able to +--echo # access to any of the stored routines. +--error ER_PROCACCESS_DENIED_ERROR +call mysqltest1.p1(); +--error ER_PROCACCESS_DENIED_ERROR +select mysqltest1.f1(); +--disconnect bug36544_con1 + +--echo # +--echo # Switch to connection 'default'. +--connection default +--echo # +--echo # Now create user with the same name and check that he +--echo # has not inherited privileges. +create user mysqluser1@localhost; +show grants for mysqluser1@localhost; +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost'; +--echo # +--echo # Create connection 'bug_36544_con2' as 'mysqluser1@localhost'. +--connect (bug36544_con2,localhost,mysqluser1,,) +--echo # Newly created user should not be able to access any of the routines. +--error ER_PROCACCESS_DENIED_ERROR +call mysqltest1.p1(); +--error ER_PROCACCESS_DENIED_ERROR +select mysqltest1.f1(); +--echo # +--echo # Switch to connection 'default'. +--connection default + +--echo # +--echo # 2) Check that RENAME USER properly updates privileges on both +--echo # stored procedures and functions. +--echo # +grant execute on function mysqltest1.f1 to mysqluser1@localhost; +grant execute on procedure mysqltest1.p1 to mysqluser1@localhost; +--echo # +--echo # Create one more user to make in-memory hashes non-trivial. +--echo # User names 'mysqluser11' and 'mysqluser10' were selected +--echo # to trigger bug discovered during code inspection. +create user mysqluser11@localhost; +grant execute on function mysqltest1.f1 to mysqluser11@localhost; +grant execute on procedure mysqltest1.p1 to mysqluser11@localhost; +--echo # Also create a couple of tables to test for another bug +--echo # discovered during code inspection (again table names were +--echo # chosen especially to trigger the bug). +create table mysqltest1.t11 (i int); +create table mysqltest1.t22 (i int); +grant select on mysqltest1.t22 to mysqluser1@localhost; +grant select on mysqltest1.t11 to mysqluser1@localhost; + +--echo # Quick test that granted privileges are properly reflected +--echo # in privilege tables and in in-memory structures. +show grants for mysqluser1@localhost; +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost'; +select db, table_name, table_priv from mysql.tables_priv where user='mysqluser1' and host='localhost'; +--echo # +--echo # Switch to connection 'bug36544_con2'. +--connection bug36544_con2 +call mysqltest1.p1(); +select mysqltest1.f1(); +select * from mysqltest1.t11; +select * from mysqltest1.t22; + +--echo # +--echo # Switch to connection 'default'. +--connection default +rename user mysqluser1@localhost to mysqluser10@localhost; + +--echo # +--echo # Test that there are no privileges left for mysqluser1. +--echo # +--echo # Switch to connection 'bug36544_con2'. +--connection bug36544_con2 +--echo # The connection cold be alive but should not be able to +--echo # access to any of the stored routines or tables. +--error ER_PROCACCESS_DENIED_ERROR +call mysqltest1.p1(); +--error ER_PROCACCESS_DENIED_ERROR +select mysqltest1.f1(); +--error ER_TABLEACCESS_DENIED_ERROR +select * from mysqltest1.t11; +--error ER_TABLEACCESS_DENIED_ERROR +select * from mysqltest1.t22; +--disconnect bug36544_con2 + +--echo # +--echo # Switch to connection 'default'. +--connection default +--echo # +--echo # Now create user with the old name and check that he +--echo # has not inherited privileges. +create user mysqluser1@localhost; +show grants for mysqluser1@localhost; +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost'; +select db, table_name, table_priv from mysql.tables_priv where user='mysqluser1' and host='localhost'; +--echo # +--echo # Create connection 'bug_36544_con3' as 'mysqluser1@localhost'. +--connect (bug36544_con3,localhost,mysqluser1,,) +--echo # Newly created user should not be able to access to any of the +--echo # stored routines or tables. +--error ER_PROCACCESS_DENIED_ERROR +call mysqltest1.p1(); +--error ER_PROCACCESS_DENIED_ERROR +select mysqltest1.f1(); +--error ER_TABLEACCESS_DENIED_ERROR +select * from mysqltest1.t11; +--error ER_TABLEACCESS_DENIED_ERROR +select * from mysqltest1.t22; +--disconnect bug36544_con3 + +--echo # +--echo # Switch to connection 'default'. +--connection default +--echo # +--echo # Now check that privileges became associated with a new user +--echo # name - mysqluser10. +--echo # +show grants for mysqluser10@localhost; +select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser10' and host='localhost'; +select db, table_name, table_priv from mysql.tables_priv where user='mysqluser10' and host='localhost'; +--echo # +--echo # Create connection 'bug_36544_con4' as 'mysqluser10@localhost'. +--connect (bug36544_con4,localhost,mysqluser10,,) +call mysqltest1.p1(); +select mysqltest1.f1(); +select * from mysqltest1.t11; +select * from mysqltest1.t22; +--disconnect bug36544_con4 + +--echo # +--echo # Switch to connection 'default'. +--connection default +--echo # +--echo # Clean-up. +drop user mysqluser1@localhost; +drop user mysqluser10@localhost; +drop user mysqluser11@localhost; +drop database mysqltest1; + + --echo End of 5.0 tests # diff --git a/mysql-test/t/innodb_mysql_sync.test b/mysql-test/t/innodb_mysql_sync.test index a8925306c70..bf1e5de1587 100644 --- a/mysql-test/t/innodb_mysql_sync.test +++ b/mysql-test/t/innodb_mysql_sync.test @@ -253,26 +253,23 @@ connection con1; --reap --echo # Test 4: Secondary unique index, should not block reads. -# This requires HA_INPLACE_ADD_UNIQUE_INDEX_NO_WRITE to be supported -# by InnoDB. Adding this flag currently introduces a regression so -# this test is disabled until the regression has been fixed. --echo # Connection default connection default; -#SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; -#--echo # Sending: -#--send ALTER TABLE t1 ADD UNIQUE (b) - -#--echo # Connection con1 -#connection con1; -#SET DEBUG_SYNC= "now WAIT_FOR manage"; -#SELECT * FROM t1; -#SET DEBUG_SYNC= "now SIGNAL query"; - -#--echo # Connection default -#connection default; -#--echo # Reaping: ALTER TABLE t1 ADD UNIQUE (b) -#--reap +SET DEBUG_SYNC= "alter_table_manage_keys SIGNAL manage WAIT_FOR query"; +--echo # Sending: +--send ALTER TABLE t1 ADD UNIQUE (b) + +--echo # Connection con1 +connection con1; +SET DEBUG_SYNC= "now WAIT_FOR manage"; +SELECT * FROM t1; +SET DEBUG_SYNC= "now SIGNAL query"; + +--echo # Connection default +connection default; +--echo # Reaping: ALTER TABLE t1 ADD UNIQUE (b) +--reap disconnect con1; disconnect con2; diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test index dd113cb4e74..8f93ac7b864 100644 --- a/mysql-test/t/mysqlcheck.test +++ b/mysql-test/t/mysqlcheck.test @@ -2,6 +2,8 @@ # Embedded server doesn't support external clients --source include/not_embedded.inc +--source include/have_innodb.inc + # check that CSV engine was compiled in, as the result of the test # depends on the presence of the log tables (which are CSV-based). --source include/have_csv.inc @@ -34,7 +36,7 @@ drop database if exists client_test_db; # # Bug #16502: mysqlcheck tries to check views # -create table t1 (a int); +create table t1 (a int) engine=myisam; create view v1 as select * from t1; --replace_result 'Table is already up to date' OK --exec $MYSQL_CHECK --analyze --databases test @@ -48,8 +50,8 @@ drop table t1; # # Bug #30654: mysqlcheck fails during upgrade of tables whose names include backticks # -create table `t``1`(a int); -create table `t 1`(a int); +create table `t``1`(a int) engine=myisam; +create table `t 1`(a int) engine=myisam; --replace_result 'Table is already up to date' OK --exec $MYSQL_CHECK --databases test drop table `t``1`, `t 1`; @@ -59,7 +61,7 @@ drop table `t``1`, `t 1`; # create database d_bug25347; use d_bug25347; -create table t_bug25347 (a int); +create table t_bug25347 (a int) engine=myisam; create view v_bug25347 as select * from t_bug25347; insert into t_bug25347 values (1),(2),(3); flush tables; @@ -91,8 +93,8 @@ drop view v1; # Bug#37527: mysqlcheck fails to report entire database # when frm file corruption # -CREATE TABLE t1(a INT); -CREATE TABLE t2(a INT); +CREATE TABLE t1(a INT) engine=myisam; +CREATE TABLE t2(a INT) engine=myisam; # backup then null t1.frm --copy_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_DATADIR/test/t1.frm.bak --remove_file $MYSQLD_DATADIR/test/t1.frm @@ -112,7 +114,7 @@ DROP TABLE t1, t2; # # Bug #30679: 5.1 name encoding not performed for views during upgrade # -create table t1(a int); +create table t1(a int) engine=myisam; create view v1 as select * from t1; show tables; let $MYSQLD_DATADIR= `select @@datadir`; @@ -131,7 +133,7 @@ drop table t1; # triggers # SET NAMES utf8; -CREATE TABLE `#mysql50#@` (a INT); +CREATE TABLE `#mysql50#@` (a INT) engine=myisam; SHOW TABLES; SET NAMES DEFAULT; --echo mysqlcheck --fix-table-names --databases test @@ -140,7 +142,7 @@ SET NAMES utf8; SHOW TABLES; DROP TABLE `@`; -CREATE TABLE `я` (a INT); +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" @@ -154,8 +156,8 @@ SET NAMES DEFAULT; CREATE DATABASE `#mysql50#a@b`; USE `#mysql50#a@b`; -CREATE TABLE `#mysql50#c@d` (a INT); -CREATE TABLE t1 (a INT); +CREATE TABLE `#mysql50#c@d` (a INT) engine=myisam; +CREATE TABLE t1 (a INT) engine=myisam; # Create 5.0 like triggers let $MYSQLTEST_VARDIR= `select @@datadir`; @@ -207,12 +209,12 @@ USE test; drop table if exists `#mysql50#t1-1`; --enable_warnings -create table `#mysql50#t1-1` (a int); +create table `#mysql50#t1-1` (a int) engine=myisam; --exec $MYSQL_CHECK --all-in-1 --fix-table-names --databases test show tables like 't1-1'; drop table `t1-1`; -create table `#mysql50#t1-1` (a int); +create table `#mysql50#t1-1` (a int) engine=myisam; --exec $MYSQL_CHECK --all-in-1 --fix-table-names test "#mysql50#t1-1" show tables like 't1-1'; drop table `t1-1`; @@ -229,3 +231,83 @@ drop table `t1-1`; --error 1 --exec $MYSQL_CHECK -aoc test "#mysql50#t1-1" + +--echo # +--echo # Bug#11755431 47205: MAP 'REPAIR TABLE' TO RECREATE +ANALYZE FOR +--echo # ENGINES NOT SUPPORTING NATIVE +--echo # + +--disable_warnings +DROP TABLE IF EXISTS bug47205; +--enable_warnings + +--echo # +--echo # Test 1: Check that ALTER TABLE ... rebuilds the table + +CREATE TABLE bug47205(a VARCHAR(20) PRIMARY KEY) + DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci engine=innodb; + +INSERT INTO bug47205 VALUES ("foobar"); +FLUSH TABLE bug47205; + +--echo # Replace the FRM with a 5.0 FRM that will require upgrade +let $MYSQLD_DATADIR= `select @@datadir`; +--remove_file $MYSQLD_DATADIR/test/bug47205.frm +--copy_file std_data/bug47205.frm $MYSQLD_DATADIR/test/bug47205.frm + +--echo # Should indicate that ALTER TABLE ... FORCE is needed +CHECK TABLE bug47205 FOR UPGRADE; + +--echo # ALTER TABLE ... FORCE should rebuild the table +--echo # and therefore output "affected rows: 1" +--enable_info +ALTER TABLE bug47205 FORCE; +--disable_info + +--echo # Table should now be ok +CHECK TABLE bug47205 FOR UPGRADE; + +DROP TABLE bug47205; + +--echo # +--echo # Test 2: InnoDB - REPAIR not supported + +CREATE TABLE bug47205(a VARCHAR(20) PRIMARY KEY) + DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci engine=innodb; + +FLUSH TABLE bug47205; + +--echo # Replace the FRM with a 5.0 FRM that will require upgrade +let $MYSQLD_DATADIR= `select @@datadir`; +--remove_file $MYSQLD_DATADIR/test/bug47205.frm +--copy_file std_data/bug47205.frm $MYSQLD_DATADIR/test/bug47205.frm + +--echo # Should indicate that ALTER TABLE .. FORCE is needed +CHECK TABLE bug47205 FOR UPGRADE; + +--echo # Running mysqlcheck to check and upgrade +--exec $MYSQL_CHECK --check-upgrade --auto-repair test + +--echo # Table should now be ok +CHECK TABLE bug47205 FOR UPGRADE; + +DROP TABLE bug47205; + +--echo # +--echo # Test 3: MyISAM - REPAIR supported + +--echo # Use an old FRM that will require upgrade +--copy_file std_data/bug36055.frm $MYSQLD_DATADIR/test/bug47205.frm +--copy_file std_data/bug36055.MYD $MYSQLD_DATADIR/test/bug47205.MYD +--copy_file std_data/bug36055.MYI $MYSQLD_DATADIR/test/bug47205.MYI + +--echo # Should indicate that REPAIR TABLE is needed +CHECK TABLE bug47205 FOR UPGRADE; + +--echo # Running mysqlcheck to check and upgrade +--exec $MYSQL_CHECK --check-upgrade --auto-repair test + +--echo # Table should now be ok +CHECK TABLE bug47205 FOR UPGRADE; + +DROP TABLE bug47205; diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index f2e8cbb2da2..7fb5f434b83 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -15,6 +15,49 @@ drop table if exists t1, t2; --enable_warnings --echo # +--echo # Bug#59297: Can't find record in 'tablename' on update inner join +--echo # + +CREATE TABLE t1 ( +a char(2) NOT NULL, +b char(2) NOT NULL, +c int(10) unsigned NOT NULL, +d varchar(255) DEFAULT NULL, +e varchar(1000) DEFAULT NULL, +PRIMARY KEY (a, b, c), +KEY (a), +KEY (a, b) +) +/*!50100 PARTITION BY KEY (a) +PARTITIONS 20 */; + +INSERT INTO t1 (a, b, c, d, e) VALUES +('07', '03', 343, '1', '07_03_343'), +('01', '04', 343, '2', '01_04_343'), +('01', '06', 343, '3', '01_06_343'), +('01', '07', 343, '4', '01_07_343'), +('01', '08', 343, '5', '01_08_343'), +('01', '09', 343, '6', '01_09_343'), +('03', '03', 343, '7', '03_03_343'), +('03', '06', 343, '8', '03_06_343'), +('03', '07', 343, '9', '03_07_343'), +('04', '03', 343, '10', '04_03_343'), +('04', '06', 343, '11', '04_06_343'), +('05', '03', 343, '12', '05_03_343'), +('11', '03', 343, '13', '11_03_343'), +('11', '04', 343, '14', '11_04_343') +; + +UPDATE t1 AS A, +(SELECT '03' AS a, '06' AS b, 343 AS c, 'last' AS d) AS B +SET A.e = B.d +WHERE A.a = '03' +AND A.b = '06' +AND A.c = 343; + +DROP TABLE t1; + +--echo # --echo # Bug#57778: failed primary key add to partitioned innodb table --echo # inconsistent and crashes --echo # diff --git a/mysql-test/t/xml.test b/mysql-test/t/xml.test index 3bc580fe4e5..89c0b8992b1 100644 --- a/mysql-test/t/xml.test +++ b/mysql-test/t/xml.test @@ -646,6 +646,11 @@ SELECT EXTRACTVALUE('', LPAD(0.1111E-15, '2011', 1)); SELECT UPDATEXML(CONVERT(_latin1'<' USING utf8),'1','1'); SELECT UPDATEXML(CONVERT(_latin1'<!--' USING utf8),'1','1'); +--echo # +--echo # Bug#11766725 (bug#59901): EXTRACTVALUE STILL BROKEN AFTER FIX FOR BUG #44332 +--echo # +SELECT ExtractValue(CONVERT('<\"', BINARY(10)), 1); + --echo End of 5.1 tests |