From e13b28afdfe8cef236adc1d4b7d2e6ed9ae0872f Mon Sep 17 00:00:00 2001 From: Neeraj Bisht Date: Wed, 12 Feb 2014 14:33:56 +0530 Subject: Bug#17075846 - UNQUOTED FILE NAMES FOR VARIABLE VALUES ARE ACCEPTED BUT PARSED INCORRECTLY When we are setting the value in a system variable, We can set it like set sys_var="Iden1.Iden2"; //1 set sys_var='Iden1.Iden2'; //2 set sys_var=Iden1.Iden2; //3 set sys_var=.ident1.ident2; //4 set sys_var=`Iden1.Iden2`; //5 While parsing, for case 1(when ANSI_QUOTES is enable) and 2, we will take as string literal(we will make item of type Item_string). for case 3 & 4, taken as Item_field, where Iden1 is a table name and iden2 is a field name. for case 5, again Item_field type, where iden1.iden2 is taken as field name. Now in case 1, when we are assigning some value to system variable (which can take string or enumerate type data), we are setting only field part. This means only iden2 value will be set for system variable. This result in wrong result. Solution: (for string type) We need to Document that we are not allowed to set system variable which takes string as identifier, otherwise result in unexpected behaviour. (for enumerate type) if we pass iden1.iden2, we will give an error ER_WRONG_TYPE_FOR_VAR (Incorrect argument type to variable). mysql-test/suite/sys_vars/t/general_log_file_basic.test: Earlier we used to give ER_WRONG_VALUE_FOR_VAR error, but in the patch of (Bug32748-Inconsistent handling of assignments to general_log_file/slow_query_log_file) they quoted this line.But i am not able to find any relation of this with the changes of patch. So i think We should give error in this case. mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test: Earlier we used to give ER_WRONG_VALUE_FOR_VAR error, but in the patch of (Bug32748-Inconsistent handling of assignments to general_log_file/slow_query_log_file) they quoted this line.But i am not able to find any relation of this with the changes of patch. So i think We should give error in this case. --- mysql-test/r/parser.result | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/parser.result b/mysql-test/r/parser.result index 1ea9e91df8a..a96773b8d81 100644 --- a/mysql-test/r/parser.result +++ b/mysql-test/r/parser.result @@ -622,3 +622,28 @@ DROP TABLE t1, t2, t3; # # End of 5.1 tests # +# +# Bug#17075846 : unquoted file names for variable values are +# accepted but parsed incorrectly +# +SET default_storage_engine=a.myisam; +ERROR 42000: Incorrect argument type to variable 'default_storage_engine' +SET default_storage_engine = .a.MyISAM; +ERROR 42000: Incorrect argument type to variable 'default_storage_engine' +SET default_storage_engine = a.b.MyISAM; +ERROR 42000: Incorrect argument type to variable 'default_storage_engine' +SET default_storage_engine = `a`.MyISAM; +ERROR 42000: Incorrect argument type to variable 'default_storage_engine' +SET default_storage_engine = `a`.`MyISAM`; +ERROR 42000: Incorrect argument type to variable 'default_storage_engine' +set default_storage_engine = "a.MYISAM"; +ERROR 42000: Unknown storage engine 'a.MYISAM' +set default_storage_engine = 'a.MYISAM'; +ERROR 42000: Unknown storage engine 'a.MYISAM' +set default_storage_engine = `a.MYISAM`; +ERROR 42000: Unknown storage engine 'a.MYISAM' +CREATE TABLE t1 (s VARCHAR(100)); +CREATE TRIGGER trigger1 BEFORE INSERT ON t1 FOR EACH ROW +SET default_storage_engine = NEW.INNODB; +ERROR 42S22: Unknown column 'INNODB' in 'NEW' +DROP TABLE t1; -- cgit v1.2.1 From 5f0c98c17bc80bd725754c1095734b97870df835 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 7 Apr 2014 21:53:19 +0200 Subject: MDEV-5743 Server crashes in mysql_alter_table on an attempt to add a primary key to InnoDB table --- mysql-test/r/alter_table_trans.result | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/alter_table_trans.result b/mysql-test/r/alter_table_trans.result index 67ae4075d57..435f5abd9d0 100644 --- a/mysql-test/r/alter_table_trans.result +++ b/mysql-test/r/alter_table_trans.result @@ -16,3 +16,11 @@ insert t1 values (repeat('3', 8193),3,1,1); ALTER TABLE t1 ADD PRIMARY KEY (col4(10)) , ADD UNIQUE KEY uidx (col3); ERROR 23000: Duplicate entry '1' for key 'uidx' DROP TABLE t1; +CREATE TABLE t1 (a INT) ENGINE = InnoDB; +INSERT INTO t1 VALUES (2); +ALTER TABLE t1 ADD PRIMARY KEY (a); +ALTER TABLE t1 DROP PRIMARY KEY; +INSERT INTO t1 VALUES (2); +ALTER TABLE t1 ADD PRIMARY KEY (a); +ERROR 23000: Duplicate entry '2' for key 'PRIMARY' +DROP TABLE t1; -- cgit v1.2.1 From 32b3c9f35de3e52695d7d8d6dc0b34ff9c097733 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 9 Apr 2014 14:28:07 +0200 Subject: Make THDVAR_INT variables to be signed in SELECT in SHOW --- mysql-test/r/plugin.result | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'mysql-test/r') diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result index 53b6a6f1651..4fb4986d0fd 100644 --- a/mysql-test/r/plugin.result +++ b/mysql-test/r/plugin.result @@ -40,15 +40,20 @@ SELECT * FROM t1; a set global example_ulong_var=500; set global example_enum_var= e1; +set session example_int_var= -1; show status like 'example%'; Variable_name Value -example_func_example enum_var is 0, ulong_var is 500, double_var is 8.500000, really +example_func_example enum_var is 0, ulong_var is 500, int_var is -1, double_var is 8.500000, really show variables like 'example%'; Variable_name Value example_double_thdvar 8.500000 example_double_var 8.500000 example_enum_var e1 +example_int_var -1 example_ulong_var 500 +select @@session.example_int_var; +@@session.example_int_var +-1 UNINSTALL SONAME 'ha_example'; Warnings: Warning 1620 Plugin is busy and will be uninstalled on shutdown -- cgit v1.2.1 From 27a26acb1cbff0e17ac8565b515ce92ab980afea Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 10 Apr 2014 15:07:34 +0200 Subject: MDEV-5700 Cannot SHOW CREATE VIEW if underlying tabels are ALTERed --- mysql-test/r/view.result | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 7a7dbf92ee3..64aee1fd078 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -846,6 +846,24 @@ Warnings: Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them drop view v1; drop table t1; +create table t1 (a varchar(20)); +create view v1 as select a from t1; +alter table t1 change a aa int; +select * from v1; +ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them +show table status; +Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment +t1 MyISAM 10 Fixed 0 0 0 # 1024 0 NULL # # NULL latin1_swedish_ci NULL +v1 NULL NULL NULL NULL NULL NULL # NULL NULL NULL # # NULL NULL NULL NULL View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them +Warnings: +Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them +show create view v1; +View Create View character_set_client collation_connection +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `test`.`t1`.`a` AS `a` from `t1` latin1 latin1_swedish_ci +Warnings: +Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them +drop view v1; +drop table t1; create view v1 as select 99999999999999999999999999999999999999999999999999999 as col1; show create view v1; View Create View character_set_client collation_connection -- cgit v1.2.1 From 05722f06b212f0229dbc541b3d370319712d156a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 15 Apr 2014 13:20:26 +0300 Subject: MDEV-5991: crash in Item_field::used_tables Units of subqueroes from excluded expressions should be excluded from select_lex/select_unit tree. --- mysql-test/r/subselect.result | 8 ++++++++ mysql-test/r/subselect_no_mat.result | 8 ++++++++ mysql-test/r/subselect_no_opts.result | 8 ++++++++ mysql-test/r/subselect_no_scache.result | 8 ++++++++ mysql-test/r/subselect_no_semijoin.result | 8 ++++++++ 5 files changed, 40 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index eacc254a083..4afde93925d 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -7007,3 +7007,11 @@ id select_type table type possible_keys key key_len ref rows Extra 2 SUBQUERY t1 index a a 5 NULL 2 Using where; Using index 2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index DROP TABLE t1,t2; +# +# MDEV-5991: crash in Item_field::used_tables +# +create table t1 (c int); +select exists(select 1 from t1 group by `c` in (select `c` from t1)); +exists(select 1 from t1 group by `c` in (select `c` from t1)) +0 +drop table t1; diff --git a/mysql-test/r/subselect_no_mat.result b/mysql-test/r/subselect_no_mat.result index 56474bc8e02..9df216da3cb 100644 --- a/mysql-test/r/subselect_no_mat.result +++ b/mysql-test/r/subselect_no_mat.result @@ -7004,6 +7004,14 @@ id select_type table type possible_keys key key_len ref rows Extra 2 SUBQUERY t1 index a a 5 NULL 2 Using where; Using index 2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index DROP TABLE t1,t2; +# +# MDEV-5991: crash in Item_field::used_tables +# +create table t1 (c int); +select exists(select 1 from t1 group by `c` in (select `c` from t1)); +exists(select 1 from t1 group by `c` in (select `c` from t1)) +0 +drop table t1; set optimizer_switch=default; select @@optimizer_switch like '%materialization=on%'; @@optimizer_switch like '%materialization=on%' diff --git a/mysql-test/r/subselect_no_opts.result b/mysql-test/r/subselect_no_opts.result index 3e1b002473a..7b93f277274 100644 --- a/mysql-test/r/subselect_no_opts.result +++ b/mysql-test/r/subselect_no_opts.result @@ -7002,4 +7002,12 @@ id select_type table type possible_keys key key_len ref rows Extra 2 SUBQUERY t1 index a a 5 NULL 2 Using where; Using index 2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index DROP TABLE t1,t2; +# +# MDEV-5991: crash in Item_field::used_tables +# +create table t1 (c int); +select exists(select 1 from t1 group by `c` in (select `c` from t1)); +exists(select 1 from t1 group by `c` in (select `c` from t1)) +0 +drop table t1; set @optimizer_switch_for_subselect_test=null; diff --git a/mysql-test/r/subselect_no_scache.result b/mysql-test/r/subselect_no_scache.result index 8d628ef2d9a..b6d3a89ea7a 100644 --- a/mysql-test/r/subselect_no_scache.result +++ b/mysql-test/r/subselect_no_scache.result @@ -7013,6 +7013,14 @@ id select_type table type possible_keys key key_len ref rows Extra 2 SUBQUERY t1 index a a 5 NULL 2 Using where; Using index 2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index DROP TABLE t1,t2; +# +# MDEV-5991: crash in Item_field::used_tables +# +create table t1 (c int); +select exists(select 1 from t1 group by `c` in (select `c` from t1)); +exists(select 1 from t1 group by `c` in (select `c` from t1)) +0 +drop table t1; set optimizer_switch=default; select @@optimizer_switch like '%subquery_cache=on%'; @@optimizer_switch like '%subquery_cache=on%' diff --git a/mysql-test/r/subselect_no_semijoin.result b/mysql-test/r/subselect_no_semijoin.result index d0e9ae225d9..d51d211e71d 100644 --- a/mysql-test/r/subselect_no_semijoin.result +++ b/mysql-test/r/subselect_no_semijoin.result @@ -7002,5 +7002,13 @@ id select_type table type possible_keys key key_len ref rows Extra 2 SUBQUERY t1 index a a 5 NULL 2 Using where; Using index 2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index DROP TABLE t1,t2; +# +# MDEV-5991: crash in Item_field::used_tables +# +create table t1 (c int); +select exists(select 1 from t1 group by `c` in (select `c` from t1)); +exists(select 1 from t1 group by `c` in (select `c` from t1)) +0 +drop table t1; set @optimizer_switch_for_subselect_test=null; set @join_cache_level_for_subselect_test=NULL; -- cgit v1.2.1 From 365960a068d4aaaa04340fe225d5b52b2feec70f Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Tue, 15 Apr 2014 18:09:58 +0500 Subject: MDEV-5138 Numerous test failures in "mtr --ps --embedded". As Davi added code like sav_protocol= thd->protocol thd->protocol= &thd->protocol_binary ... thd->protocol= sav_protocol the fucntions like emb_store_querycache_result() cannot determine the used protocol testing thd->protocol == &thd->protocol_binary. Fixed by additional check thd->command == COM_STMT_EXECUTE. --- mysql-test/r/ctype_ucs2_query_cache.result | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/ctype_ucs2_query_cache.result b/mysql-test/r/ctype_ucs2_query_cache.result index c5f1ef5918d..6f26bed02da 100644 --- a/mysql-test/r/ctype_ucs2_query_cache.result +++ b/mysql-test/r/ctype_ucs2_query_cache.result @@ -13,6 +13,12 @@ a 2 3 4 +SELECT * FROM t1; +a +1 +2 +3 +4 DROP TABLE t1; # # End of 5.5 tests -- cgit v1.2.1 From 2f93e7cf4766ee53d38343dbc46c12bdcc134601 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Wed, 23 Apr 2014 10:28:06 +0400 Subject: MDEV-6146 Can't mix (latin1_swedish_ci,NUMERIC) and (utf8_unicode_ci,IMPLICIT) for MATCH --- mysql-test/r/fulltext.result | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index c067ff02574..b93c70f27c8 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -699,3 +699,48 @@ EXECUTE stmt; DEALLOCATE PREPARE stmt; DROP TABLE t1; End of 5.1 tests +# +# Start of 5.5 tests +# +# +# MDEV-6146 Can't mix (latin1_swedish_ci,NUMERIC) and (utf8_unicode_ci,IMPLICIT) for MATCH +# +SET NAMES utf8; +CREATE TABLE t1 +( +txt text COLLATE utf8_unicode_ci NOT NULL, +uid int(11) NOT NULL, +id2 int(11) NOT NULL, +KEY uid (uid), +KEY id2 (id2) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +INSERT INTO t1 VALUES ('txt1',1234,5678); +SELECT * FROM t1 WHERE MATCH (id2, uid, txt) AGAINST ('txt1' IN BOOLEAN MODE); +txt uid id2 +txt1 1234 5678 +SELECT * FROM t1 WHERE MATCH (id2, uid, txt) AGAINST ('1234' IN BOOLEAN MODE); +txt uid id2 +txt1 1234 5678 +SELECT * FROM t1 WHERE MATCH (id2, uid, txt) AGAINST ('5678' IN BOOLEAN MODE); +txt uid id2 +txt1 1234 5678 +DROP TABLE t1; +CREATE TABLE t1 ( +txt1 text COLLATE utf8_unicode_ci NOT NULL, +txt2 text COLLATE latin1_swedish_ci NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +INSERT INTO t1 VALUES ('nnn1 x1 y1 ööö1','mmm1 ùùù1'); +INSERT INTO t1 VALUES ('nnn2 x2 y2 ööö2','mmm2 ùùù2'); +INSERT INTO t1 VALUES ('nnn3 x3 y3 ööö3','mmm3 ùùù3'); +INSERT INTO t1 VALUES ('nnn4 x4 y4 ööö4','mmm4 ùùù4'); +INSERT INTO t1 VALUES ('nnn5 x5 y5 ööö5','mmm5 '); +SELECT * FROM t1 WHERE MATCH (txt1,txt2) AGAINST ('ööö1' IN BOOLEAN MODE); +txt1 txt2 +nnn1 x1 y1 ööö1 mmm1 ùùù1 +SELECT * FROM t1 WHERE MATCH (txt1,txt2) AGAINST ('ùùù2' IN BOOLEAN MODE); +txt1 txt2 +nnn2 x2 y2 ööö2 mmm2 ùùù2 +DROP TABLE t1; +# +# End of 5.5 tests +# -- cgit v1.2.1 From b17a053cc997adbf3f410aec4a6fab6739a8e15c Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Thu, 24 Apr 2014 18:20:57 +0300 Subject: MDEV-6129: Server crashes during UNION with ORDER BY field IS NULL Fixed crashing bug for union queries where there was no real tables. mysql-test/r/group_by.result: Added test case mysql-test/t/group_by.test: Added test case sql/db.opt: Removed genrated file sql/item.cc: Handled case when table_list->pos_in_tables is not set. Can only happens when there is no real tables in query --- mysql-test/r/group_by.result | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index a9e91199949..3de20ac6df4 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -2473,3 +2473,12 @@ c 1c v 2v,2v NULL 1c,2v,2v DROP TABLE t1,t2; +# +# MDEV-6129: Server crashes during UNION with ORDER BY field IS NULL +# +SET sql_mode='ONLY_FULL_GROUP_BY'; +SELECT 1 AS test UNION SELECT 2 AS test ORDER BY test IS NULL ASC; +test +1 +2 +SET sql_mode=''; -- cgit v1.2.1 From 4ccea172ffb48776d82b6a6d4eb3de78671f4a23 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Sat, 26 Apr 2014 23:16:51 +0400 Subject: MDEV-6169 main.myisam-metadata fails mtr internal check The test didn't clean debug_sync --- mysql-test/r/myisam-metadata.result | 1 + 1 file changed, 1 insertion(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/myisam-metadata.result b/mysql-test/r/myisam-metadata.result index 4d49bac9436..15d51fbd208 100644 --- a/mysql-test/r/myisam-metadata.result +++ b/mysql-test/r/myisam-metadata.result @@ -13,3 +13,4 @@ SHOW TABLE STATUS LIKE 't1'; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment t1 MyISAM 10 Dynamic 100000 27 # # # 0 NULL # # # latin1_swedish_ci NULL DROP TABLE t1; +set debug_sync='reset'; -- cgit v1.2.1 From 64d7c97db93b095710ad29bd173be020dffa8d22 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Mon, 28 Apr 2014 02:56:53 +0400 Subject: MDEV-6178 mysql_upgrade breaks databases with long user names Added a 5.5-specific test which involves manual modification of system tables. The problem itself was fixed in MDEV-6068 --- mysql-test/r/mysql_upgrade.result | 83 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result index 285b00ae27f..fb831082dfe 100644 --- a/mysql-test/r/mysql_upgrade.result +++ b/mysql-test/r/mysql_upgrade.result @@ -287,4 +287,87 @@ performance_schema test Phase 3/3: Running 'mysql_fix_privilege_tables'... OK +# +# MDEV-4332 Increase username length from 16 characters +# MDEV-6068, MDEV-6178 mysql_upgrade breaks databases with long user names +# +alter table mysql.user modify User char(80) binary not null default ''; +alter table mysql.db modify User char(80) binary not null default ''; +alter table mysql.tables_priv modify User char(80) binary not null default ''; +alter table mysql.columns_priv modify User char(80) binary not null default ''; +alter table mysql.procs_priv modify User char(80) binary not null default ''; +alter table mysql.proc modify definer char(141) collate utf8_bin not null default ''; +alter table mysql.event modify definer char(141) collate utf8_bin not null default ''; +alter table mysql.proxies_priv modify User char(80) COLLATE utf8_bin not null default ''; +alter table mysql.proxies_priv modify Proxied_user char(80) COLLATE utf8_bin not null default ''; +alter table mysql.proxies_priv modify Grantor char(141) COLLATE utf8_bin not null default ''; +alter table mysql.servers modify Username char(80) not null default ''; +alter table mysql.procs_priv modify Grantor char(141) COLLATE utf8_bin not null default ''; +alter table mysql.tables_priv modify Grantor char(141) COLLATE utf8_bin not null default ''; +flush privileges; +GRANT SELECT ON mysql.* TO very_long_user_name_number_1; +GRANT SELECT ON mysql.* TO very_long_user_name_number_2; +GRANT ALL ON *.* TO even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@localhost WITH GRANT OPTION; +GRANT INSERT ON mysql.user TO very_long_user_name_number_1; +GRANT INSERT ON mysql.user TO very_long_user_name_number_2; +GRANT UPDATE (User) ON mysql.db TO very_long_user_name_number_1; +GRANT UPDATE (User) ON mysql.db TO very_long_user_name_number_2; +CREATE PROCEDURE test.pr() BEGIN END; +Phase 1/3: Fixing table and database names +Phase 2/3: Checking and upgrading tables +Processing databases +information_schema +mtr +mtr.global_suppressions OK +mtr.test_suppressions OK +mysql +mysql.columns_priv OK +mysql.db OK +mysql.event OK +mysql.func OK +mysql.help_category OK +mysql.help_keyword OK +mysql.help_relation OK +mysql.help_topic OK +mysql.host OK +mysql.ndb_binlog_index OK +mysql.plugin OK +mysql.proc OK +mysql.procs_priv OK +mysql.proxies_priv OK +mysql.servers OK +mysql.tables_priv OK +mysql.time_zone OK +mysql.time_zone_leap_second OK +mysql.time_zone_name OK +mysql.time_zone_transition OK +mysql.time_zone_transition_type OK +mysql.user OK +performance_schema +test +Phase 3/3: Running 'mysql_fix_privilege_tables'... +OK +SELECT definer FROM mysql.proc WHERE db = 'test' AND name = 'pr'; +definer +even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@localhost +SELECT grantor FROM mysql.tables_priv WHERE db = 'mysql' AND table_name = 'user'; +grantor +even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@localhost +even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@localhost +DROP USER very_long_user_name_number_1, very_long_user_name_number_2, even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@localhost; +DROP PROCEDURE test.pr; +alter table mysql.user modify User char(16) binary not null default ''; +alter table mysql.db modify User char(16) binary not null default ''; +alter table mysql.tables_priv modify User char(16) binary not null default ''; +alter table mysql.columns_priv modify User char(16) binary not null default ''; +alter table mysql.procs_priv modify User char(16) binary not null default ''; +alter table mysql.proc modify definer char(77) collate utf8_bin not null default ''; +alter table mysql.event modify definer char(77) collate utf8_bin not null default ''; +alter table mysql.proxies_priv modify User char(16) COLLATE utf8_bin not null default ''; +alter table mysql.proxies_priv modify Proxied_user char(16) COLLATE utf8_bin not null default ''; +alter table mysql.proxies_priv modify Grantor char(77) COLLATE utf8_bin not null default ''; +alter table mysql.servers modify Username char(64) not null default ''; +alter table mysql.procs_priv modify Grantor char(77) COLLATE utf8_bin not null default ''; +alter table mysql.tables_priv modify Grantor char(77) COLLATE utf8_bin not null default ''; +flush privileges; End of tests -- cgit v1.2.1 From 968f4d4e2573fc409d5a17103269cfdcef7c2878 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 28 Apr 2014 09:13:53 +0300 Subject: MDEV-6139: UPDATE w/ join against MRG_MyISAM table with read-only sub-table failsUPDATE w/ join against MRG_MyISAM table with read-only sub-table fails The problem was that on opening all tables TL_WRITE, than local tables which is not updated set to TL_READ, but underlying tables of MyISAMmrg left untouched. Prartition engine has not this problem. All cases where lock_type assigned is not changed because call of virtual function is not cheap. --- mysql-test/r/multi_update.result | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index 7386af13e2c..7172693d685 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -794,4 +794,23 @@ SELECT * FROM t2; col_int_key pk_1 pk_2 col_int 1 7 11 4 DROP TABLE t1,t2; +# +# MDEV-6139: UPDATE w/ join against MRG_MyISAM table with read-only +# sub-table fails +# +CREATE TABLE t1 ( +id int(10) unsigned, +a int(11) +) ENGINE=MyISAM; +CREATE TABLE t3 ( +id int(10) unsigned, +b int(11) +) ENGINE=MyISAM; +CREATE TABLE t2 ( +id int(10) unsigned, +b int(11) +) ENGINE=MRG_MyISAM UNION=(t3); +FLUSH TABLES; +update t1 join t2 using (id) set t1.a=t2.b; +drop table t2, t3, t1; end of 5.5 tests -- cgit v1.2.1 From 1081e403c6ebc551b5a0242e452ccb995b262432 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 28 Apr 2014 15:56:31 +0400 Subject: MDEV-5702 Incorrect results are returned with NULLIF() --- mysql-test/r/ctype_binary.result | 17 +++++++++++++++++ mysql-test/r/ctype_cp1251.result | 17 +++++++++++++++++ mysql-test/r/ctype_latin1.result | 17 +++++++++++++++++ mysql-test/r/ctype_ucs.result | 17 +++++++++++++++++ mysql-test/r/ctype_utf8.result | 17 +++++++++++++++++ 5 files changed, 85 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/ctype_binary.result b/mysql-test/r/ctype_binary.result index 3caf41af53b..73c81c4eb06 100644 --- a/mysql-test/r/ctype_binary.result +++ b/mysql-test/r/ctype_binary.result @@ -2848,6 +2848,23 @@ f1() 00:00:01 DROP FUNCTION f1; DROP TABLE t1; +# +# MDEV-5702 Incorrect results are returned with NULLIF() +# +CREATE TABLE t1 (d DATE); +INSERT INTO t1 VALUES ('1999-11-11'),('2014-02-04'); +SELECT DISTINCT d, CAST(d AS CHAR), NULLIF(d,"2000-01-01") AS bad, NULLIF(CAST(d AS CHAR),"2000-01-01") AS good FROM t1; +d CAST(d AS CHAR) bad good +1999-11-11 1999-11-11 1999-11-11 1999-11-11 +2014-02-04 2014-02-04 2014-02-04 2014-02-04 +CREATE TABLE t2 AS SELECT DISTINCT d, NULLIF(d,'2000-01-01') AS bad FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `d` date DEFAULT NULL, + `bad` varbinary(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1, t2; SET NAMES latin1; SET sql_mode=''; CREATE TABLE t1(a char(215) CHARACTER SET utf8 NOT NULL DEFAULT '', KEY(a)); diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index 4b8a26265e3..9c7164911af 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -3240,6 +3240,23 @@ f1() 00:00:01 DROP FUNCTION f1; DROP TABLE t1; +# +# MDEV-5702 Incorrect results are returned with NULLIF() +# +CREATE TABLE t1 (d DATE); +INSERT INTO t1 VALUES ('1999-11-11'),('2014-02-04'); +SELECT DISTINCT d, CAST(d AS CHAR), NULLIF(d,"2000-01-01") AS bad, NULLIF(CAST(d AS CHAR),"2000-01-01") AS good FROM t1; +d CAST(d AS CHAR) bad good +1999-11-11 1999-11-11 1999-11-11 1999-11-11 +2014-02-04 2014-02-04 2014-02-04 2014-02-04 +CREATE TABLE t2 AS SELECT DISTINCT d, NULLIF(d,'2000-01-01') AS bad FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `d` date DEFAULT NULL, + `bad` varchar(10) CHARACTER SET cp1251 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1, t2; SET NAMES latin1; SET sql_mode=''; CREATE TABLE t1(a char(215) CHARACTER SET utf8 NOT NULL DEFAULT '', KEY(a)); diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index ae6a4fd582d..11a9479afa3 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -3422,6 +3422,23 @@ f1() 00:00:01 DROP FUNCTION f1; DROP TABLE t1; +# +# MDEV-5702 Incorrect results are returned with NULLIF() +# +CREATE TABLE t1 (d DATE); +INSERT INTO t1 VALUES ('1999-11-11'),('2014-02-04'); +SELECT DISTINCT d, CAST(d AS CHAR), NULLIF(d,"2000-01-01") AS bad, NULLIF(CAST(d AS CHAR),"2000-01-01") AS good FROM t1; +d CAST(d AS CHAR) bad good +1999-11-11 1999-11-11 1999-11-11 1999-11-11 +2014-02-04 2014-02-04 2014-02-04 2014-02-04 +CREATE TABLE t2 AS SELECT DISTINCT d, NULLIF(d,'2000-01-01') AS bad FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `d` date DEFAULT NULL, + `bad` varchar(10) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1, t2; SET NAMES latin1; SET sql_mode=''; CREATE TABLE t1(a char(215) CHARACTER SET utf8 NOT NULL DEFAULT '', KEY(a)); diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index c7e1e4e57a5..2af0b2bb509 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -4238,6 +4238,23 @@ f1() 00:00:01 DROP FUNCTION f1; DROP TABLE t1; +# +# MDEV-5702 Incorrect results are returned with NULLIF() +# +CREATE TABLE t1 (d DATE); +INSERT INTO t1 VALUES ('1999-11-11'),('2014-02-04'); +SELECT DISTINCT d, CAST(d AS CHAR), NULLIF(d,"2000-01-01") AS bad, NULLIF(CAST(d AS CHAR),"2000-01-01") AS good FROM t1; +d CAST(d AS CHAR) bad good +1999-11-11 1999-11-11 1999-11-11 1999-11-11 +2014-02-04 2014-02-04 2014-02-04 2014-02-04 +CREATE TABLE t2 AS SELECT DISTINCT d, NULLIF(d,'2000-01-01') AS bad FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `d` date DEFAULT NULL, + `bad` varchar(10) CHARACTER SET ucs2 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1, t2; SET NAMES latin1; SET sql_mode=''; CREATE TABLE t1(a char(215) CHARACTER SET utf8 NOT NULL DEFAULT '', KEY(a)); diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index fa76cc54c39..9a6dadba1f5 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -5059,6 +5059,23 @@ f1() 00:00:01 DROP FUNCTION f1; DROP TABLE t1; +# +# MDEV-5702 Incorrect results are returned with NULLIF() +# +CREATE TABLE t1 (d DATE); +INSERT INTO t1 VALUES ('1999-11-11'),('2014-02-04'); +SELECT DISTINCT d, CAST(d AS CHAR), NULLIF(d,"2000-01-01") AS bad, NULLIF(CAST(d AS CHAR),"2000-01-01") AS good FROM t1; +d CAST(d AS CHAR) bad good +1999-11-11 1999-11-11 1999-11-11 1999-11-11 +2014-02-04 2014-02-04 2014-02-04 2014-02-04 +CREATE TABLE t2 AS SELECT DISTINCT d, NULLIF(d,'2000-01-01') AS bad FROM t1; +SHOW CREATE TABLE t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `d` date DEFAULT NULL, + `bad` varchar(10) CHARACTER SET utf8 DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1, t2; SET NAMES latin1; SET sql_mode=''; CREATE TABLE t1(a char(215) CHARACTER SET utf8 NOT NULL DEFAULT '', KEY(a)); -- cgit v1.2.1 From f467f4bb934a9a73e9a5643f5b674d02d4d0aa6b Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 28 Apr 2014 17:01:58 +0400 Subject: MDEV-5459 Illegal mix of collations for datetime --- mysql-test/r/ctype_cp1251.result | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index 9c7164911af..313f60ef276 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -3282,5 +3282,15 @@ SELECT COALESCE(IF(test1=1, NULL, 1), test2) FROM t1; COALESCE(IF(test1=1, NULL, 1), test2) DROP TABLE t1; # +# MDEV-5459 Illegal mix of collations for datetime +# +SET NAMES cp1251; +CREATE TABLE t1 (dt DATETIME); +INSERT INTO t1 VALUES ('2014-01-02 10:20:30'); +SELECT date(dt) FROM t1 WHERE (CASE WHEN 1 THEN date(dt) ELSE null END >= '2013-12-01 00:00:00'); +date(dt) +2014-01-02 +DROP TABLE t1; +# # End of 5.5 tests # -- cgit v1.2.1 From 13dc299a4fa50627aff42480c8e995347283e475 Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Wed, 16 Apr 2014 22:34:52 -0700 Subject: Fixed bugs mdev-5927 and mdev-6116. Both bugs are caused by the same problem: the function optimize_cond() should update the value of *cond_equal rather than the value of join->cond_equal, because it is called not only for the WHERE condition, but for the HAVING condition as well. --- mysql-test/r/having.result | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result index 4fe5fa3d50d..1d39198121d 100644 --- a/mysql-test/r/having.result +++ b/mysql-test/r/having.result @@ -635,3 +635,32 @@ Note 1003 select min(`test`.`t1`.`f10`) AS `field1` from `test`.`t1` join `test` set optimizer_switch=@save_optimizer_switch; drop table t1,t2,t3; End of 5.2 tests +# +# Bug mdev-6116: an equality in the conjunction of HAVING +# and IN subquery in WHERE +# (The bug is caused by the same problem as bug mdev-5927) +# +CREATE TABLE t1 (f_key varchar(1), f_nokey varchar(1), INDEX(f_key)); +INSERT INTO t1 VALUES ('v','v'),('s','s'); +CREATE TABLE t2 (f_int int, f_key varchar(1), INDEX(f_key)); +INSERT INTO t2 VALUES +(4,'j'),(6,'v'),(3,'c'),(5,'m'),(3,'d'),(2,'d'),(2,'y'), +(9,'t'),(3,'d'),(8,'s'),(1,'r'),(8,'m'),(8,'b'),(5,'x'); +SELECT t2.f_int FROM t1 INNER JOIN t2 ON (t2.f_key = t1.f_nokey) +WHERE t1.f_nokey IN ( +SELECT t1.f_key FROM t1, t2 WHERE t1.f_key = t2.f_key +) HAVING t2.f_int >= 0 AND t2.f_int != 0; +f_int +6 +8 +DROP TABLE t1,t2; +# +# Bug mdev-5927: an equality in the conjunction of HAVING +# and an equality in WHERE +# +CREATE TABLE t1 (pk int PRIMARY KEY, f int NOT NULL, INDEX(f)); +INSERT INTO t1 VALUES (1,0), (2,8); +SELECT * FROM t1 WHERE f = 2 HAVING ( pk IN ( SELECT 9 ) AND f != 0 ); +pk f +DROP TABLE t1; +End of 5.3 tests -- cgit v1.2.1 From 8db600f951005b0b23b23dcd0ddd848303aa13ac Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 18 Apr 2014 12:19:51 +0400 Subject: MDEV-5041 Inserting a TIME with hour>24 into a DATETIME column produces a wrong value --- mysql-test/r/type_date.result | 46 +++++++++++++++++++++++++++++++++++++++ mysql-test/r/type_datetime.result | 40 ++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result index b7776d67651..e16054ef591 100644 --- a/mysql-test/r/type_date.result +++ b/mysql-test/r/type_date.result @@ -345,5 +345,51 @@ Warning 1292 Incorrect datetime value: '0' Warning 1292 Incorrect datetime value: '0' SET @@timestamp=DEFAULT; # +# MDEV-5041 Inserting a TIME with hour>24 into a DATETIME column produces a wrong value +# +SELECT CAST(TIME('-800:20:30') AS DATE); +CAST(TIME('-800:20:30') AS DATE) +NULL +Warnings: +Warning 1292 Truncated incorrect date value: '-800:20:30' +SELECT CAST(TIME('800:20:30') AS DATE); +CAST(TIME('800:20:30') AS DATE) +0000-01-02 +SELECT CAST(TIME('33 08:20:30') AS DATE); +CAST(TIME('33 08:20:30') AS DATE) +0000-01-02 +CREATE TABLE t1 (a DATE); +INSERT INTO t1 VALUES (TIME('800:20:30')); +Warnings: +Note 1265 Data truncated for column 'a' at row 1 +INSERT INTO t1 VALUES (TIME('33 08:20:30')); +Warnings: +Note 1265 Data truncated for column 'a' at row 1 +SET SQL_MODE=NO_ZERO_IN_DATE; +INSERT INTO t1 VALUES (TIME('48:20:30')); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +SET SQL_MODE=DEFAULT; +SELECT * FROM t1; +a +0000-01-02 +0000-01-02 +0000-00-00 +DROP TABLE t1; +CREATE PROCEDURE test5041() +BEGIN +DECLARE t TIME; +DECLARE d DATE; +SET t= TIME('800:00:00'); +SET d= t; +SELECT d; +END;| +call test5041(); +d +0000-01-02 +Warnings: +Note 1265 Data truncated for column 'd' at row 1 +drop procedure test5041; +# # End of 5.3 tests # diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 317af8d6b38..d20506288ad 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -684,4 +684,44 @@ CONVERT_TZ(GREATEST(TIMESTAMP('2021-00-00'),TIMESTAMP('2022-00-00')),'+00:00','+ NULL Warnings: Warning 1292 Incorrect datetime value: '2022-00-00 00:00:00' +# +# MDEV-5041 Inserting a TIME with hour>24 into a DATETIME column produces a wrong value +# +SELECT CAST(TIME('-800:20:30') AS DATETIME); +CAST(TIME('-800:20:30') AS DATETIME) +NULL +Warnings: +Warning 1292 Truncated incorrect datetime value: '-800:20:30' +SELECT CAST(TIME('800:20:30') AS DATETIME); +CAST(TIME('800:20:30') AS DATETIME) +0000-01-02 08:20:30 +SELECT CAST(TIME('33 08:20:30') AS DATETIME); +CAST(TIME('33 08:20:30') AS DATETIME) +0000-01-02 08:20:30 +CREATE TABLE t1 (a DATETIME); +INSERT INTO t1 VALUES (TIME('800:20:30')); +INSERT INTO t1 VALUES (TIME('33 08:20:30')); +SET SQL_MODE=NO_ZERO_IN_DATE; +INSERT INTO t1 VALUES (TIME('48:20:30')); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +SET SQL_MODE=DEFAULT; +SELECT * FROM t1; +a +0000-01-02 08:20:30 +0000-01-02 08:20:30 +0000-00-00 00:00:00 +DROP TABLE t1; +CREATE PROCEDURE test5041() +BEGIN +DECLARE t TIME; +DECLARE dt DATETIME; +SET t= TIME('800:20:30'); +SET dt= t; +SELECT dt; +END;| +call test5041(); +dt +0000-01-02 08:20:30 +drop procedure test5041; End of 5.3 tests -- cgit v1.2.1 From cfa4548ba5277166fe768994b0c3fde0709088a7 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 21 Apr 2014 10:13:38 +0400 Subject: MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found --- mysql-test/r/ctype_big5.result | 9 ++++ mysql-test/r/ctype_cp1250_ch.result | 18 +++++++ mysql-test/r/ctype_euckr.result | 9 ++++ mysql-test/r/ctype_gb2312.result | 9 ++++ mysql-test/r/ctype_gbk.result | 9 ++++ mysql-test/r/ctype_latin1.result | 102 ++++++++++++++++++++++++++++++++++++ mysql-test/r/ctype_uca.result | 9 ++++ mysql-test/r/ctype_ucs.result | 9 ++++ 8 files changed, 174 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result index 2efcf549608..42c0351f9df 100644 --- a/mysql-test/r/ctype_big5.result +++ b/mysql-test/r/ctype_big5.result @@ -71,6 +71,15 @@ select 1 from t1 order by cast(a as char(1)); 1 1 drop table t1; +# +# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found +# +SET character_set_client=latin1; +SET character_set_connection= @test_character_set; +SET collation_connection= @test_collation; +SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1; +COLLATION('.') c1 +big5_chinese_ci .wwwmysqlcom set names utf8; create table t1 ( name varchar(10), diff --git a/mysql-test/r/ctype_cp1250_ch.result b/mysql-test/r/ctype_cp1250_ch.result index 46ca1f25ef4..8f3c317065c 100644 --- a/mysql-test/r/ctype_cp1250_ch.result +++ b/mysql-test/r/ctype_cp1250_ch.result @@ -75,6 +75,15 @@ select 1 from t1 order by cast(a as char(1)); 1 1 drop table t1; +# +# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found +# +SET character_set_client=latin1; +SET character_set_connection= @test_character_set; +SET collation_connection= @test_collation; +SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1; +COLLATION('.') c1 +cp1250_general_ci .wwwmysqlcom set names utf8; create table t1 ( name varchar(10), @@ -168,6 +177,15 @@ select 1 from t1 order by cast(a as char(1)); 1 1 drop table t1; +# +# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found +# +SET character_set_client=latin1; +SET character_set_connection= @test_character_set; +SET collation_connection= @test_collation; +SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1; +COLLATION('.') c1 +cp1250_czech_cs .wwwmysqlcom set names utf8; create table t1 ( name varchar(10), diff --git a/mysql-test/r/ctype_euckr.result b/mysql-test/r/ctype_euckr.result index 3cc74864400..ac4df55de0b 100644 --- a/mysql-test/r/ctype_euckr.result +++ b/mysql-test/r/ctype_euckr.result @@ -71,6 +71,15 @@ select 1 from t1 order by cast(a as char(1)); 1 1 drop table t1; +# +# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found +# +SET character_set_client=latin1; +SET character_set_connection= @test_character_set; +SET collation_connection= @test_collation; +SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1; +COLLATION('.') c1 +euckr_korean_ci .wwwmysqlcom set names utf8; create table t1 ( name varchar(10), diff --git a/mysql-test/r/ctype_gb2312.result b/mysql-test/r/ctype_gb2312.result index 2f789ab5b13..0602fb353fc 100644 --- a/mysql-test/r/ctype_gb2312.result +++ b/mysql-test/r/ctype_gb2312.result @@ -71,6 +71,15 @@ select 1 from t1 order by cast(a as char(1)); 1 1 drop table t1; +# +# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found +# +SET character_set_client=latin1; +SET character_set_connection= @test_character_set; +SET collation_connection= @test_collation; +SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1; +COLLATION('.') c1 +gb2312_chinese_ci .wwwmysqlcom set names utf8; create table t1 ( name varchar(10), diff --git a/mysql-test/r/ctype_gbk.result b/mysql-test/r/ctype_gbk.result index c144ed6881d..205383aa40d 100644 --- a/mysql-test/r/ctype_gbk.result +++ b/mysql-test/r/ctype_gbk.result @@ -71,6 +71,15 @@ select 1 from t1 order by cast(a as char(1)); 1 1 drop table t1; +# +# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found +# +SET character_set_client=latin1; +SET character_set_connection= @test_character_set; +SET collation_connection= @test_collation; +SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1; +COLLATION('.') c1 +gbk_chinese_ci .wwwmysqlcom set names utf8; create table t1 ( name varchar(10), diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index 82b24fcc9ef..aa0771af79f 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -308,6 +308,108 @@ select 'a' regexp 'A' collate latin1_general_cs; select 'a' regexp 'A' collate latin1_bin; 'a' regexp 'A' collate latin1_bin 0 +SET @test_character_set= 'latin1'; +SET @test_collation= 'latin1_swedish_ci'; +SET @safe_character_set_server= @@character_set_server; +SET @safe_collation_server= @@collation_server; +SET @safe_character_set_client= @@character_set_client; +SET @safe_character_set_results= @@character_set_results; +SET character_set_server= @test_character_set; +SET collation_server= @test_collation; +CREATE DATABASE d1; +USE d1; +CREATE TABLE t1 (c CHAR(10), KEY(c)); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c char(10) latin1_swedish_ci YES MUL NULL +INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); +SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; +want3results +aaa +aaaa +aaaaa +DROP TABLE t1; +CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c1 varchar(15) latin1_swedish_ci YES MUL NULL +INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); +SELECT c1 as want3results from t1 where c1 like 'l%'; +want3results +location +loberge +lotre +SELECT c1 as want3results from t1 where c1 like 'lo%'; +want3results +location +loberge +lotre +SELECT c1 as want1result from t1 where c1 like 'loc%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'loca%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locat%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locati%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locatio%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'location%'; +want1result +location +DROP TABLE t1; +create table t1 (a set('a') not null); +insert into t1 values (),(); +Warnings: +Warning 1364 Field 'a' doesn't have a default value +select cast(a as char(1)) from t1; +cast(a as char(1)) + + +select a sounds like a from t1; +a sounds like a +1 +1 +select 1 from t1 order by cast(a as char(1)); +1 +1 +1 +drop table t1; +# +# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found +# +SET character_set_client=latin1; +SET character_set_connection= @test_character_set; +SET collation_connection= @test_collation; +SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1; +COLLATION('.') c1 +latin1_swedish_ci .wwwmysqlcom +set names utf8; +create table t1 ( +name varchar(10), +level smallint unsigned); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `name` varchar(10) DEFAULT NULL, + `level` smallint(5) unsigned DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('string',1); +select concat(name,space(level)), concat(name, repeat(' ',level)) from t1; +concat(name,space(level)) concat(name, repeat(' ',level)) +string string +drop table t1; +DROP DATABASE d1; +USE test; +SET character_set_server= @safe_character_set_server; +SET collation_server= @safe_collation_server; +SET character_set_client= @safe_character_set_client; +SET character_set_results= @safe_character_set_results; SET collation_connection='latin1_swedish_ci'; create table t1 select repeat('a',4000) a; delete from t1; diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index d51cd2b1d06..fd5016e9958 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -2725,6 +2725,15 @@ select 1 from t1 order by cast(a as char(1)); 1 1 drop table t1; +# +# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found +# +SET character_set_client=latin1; +SET character_set_connection= @test_character_set; +SET collation_connection= @test_collation; +SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1; +COLLATION('.') c1 +utf8_swedish_ci .wwwmysqlcom set names utf8; create table t1 ( name varchar(10), diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index e6f40b622f0..5dcdd9114a3 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -71,6 +71,15 @@ select 1 from t1 order by cast(a as char(1)); 1 1 drop table t1; +# +# MDEV-6134 SUBSTRING_INDEX returns wrong result for 8bit character sets when delimiter is not found +# +SET character_set_client=latin1; +SET character_set_connection= @test_character_set; +SET collation_connection= @test_collation; +SELECT COLLATION('.'), SUBSTRING_INDEX('.wwwmysqlcom', '.', -2) AS c1; +COLLATION('.') c1 +ucs2_general_ci .wwwmysqlcom set names utf8; create table t1 ( name varchar(10), -- cgit v1.2.1 From 213f10363e1134fdb39842f55876db1136496ff3 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 21 Apr 2014 13:19:32 +0400 Subject: MDEV-6045 MySQL Bug#11829861 - SUBSTRING_INDEX() RESULTS "OMIT" CHARACTER WHEN USED INSIDE LOWER() --- mysql-test/r/func_str.result | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'mysql-test/r') diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index c1df30cc328..26f4ffdad53 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -119,7 +119,7 @@ substring_index('aaaaaaaaa1','aaa',-3) aaaaaa1 select substring_index('aaaaaaaaa1','aaa',-4); substring_index('aaaaaaaaa1','aaa',-4) - +aaaaaaaaa1 select substring_index('the king of thethe hill','the',-2); substring_index('the king of thethe hill','the',-2) the hill @@ -2657,3 +2657,32 @@ NULL NULL 8 drop table t1; End of 5.1 tests +# +# Start of 5.3 tests +# +# +# Bug#11829861: SUBSTRING_INDEX() RESULTS IN MISSING CHARACTERS WHEN USED +# INSIDE LOWER() +# +SET @user_at_host = 'root@mytinyhost-PC.local'; +SELECT LOWER(SUBSTRING_INDEX(@user_at_host, '@', -1)); +LOWER(SUBSTRING_INDEX(@user_at_host, '@', -1)) +mytinyhost-pc.local +# End of test BUG#11829861 +# +# Bug#42404: SUBSTRING_INDEX() RESULTS ARE INCONSISTENT +# +CREATE TABLE t (i INT NOT NULL, c CHAR(255) NOT NULL); +INSERT INTO t VALUES (0,'.www.mysql.com'),(1,'.wwwmysqlcom'); +SELECT i, SUBSTRING_INDEX(c, '.', -2) FROM t WHERE i = 1; +i SUBSTRING_INDEX(c, '.', -2) +1 .wwwmysqlcom +SELECT i, SUBSTRING_INDEX(c, '.', -2) FROM t; +i SUBSTRING_INDEX(c, '.', -2) +0 mysql.com +1 .wwwmysqlcom +DROP TABLE t; +# End of test BUG#42404 +# +# End of 5.3 tests +# -- cgit v1.2.1 From a24ea50d1a04d7bfe9608fe1ea8ac1ab8ed97294 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Wed, 23 Apr 2014 15:53:47 +0400 Subject: MDEV-5338 XML parser accepts malformed data --- mysql-test/r/xml.result | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'mysql-test/r') diff --git a/mysql-test/r/xml.result b/mysql-test/r/xml.result index dda77cba04c..d127246e9d7 100644 --- a/mysql-test/r/xml.result +++ b/mysql-test/r/xml.result @@ -132,7 +132,7 @@ xb1 xc1 SELECT extractValue(@xml,'/a//@x[2]'); extractValue(@xml,'/a//@x[2]') xb2 xc2 -SET @xml='b1b2c1b1c1b2c2b1'; +SET @xml='b1b2c1b1c1b2c2b1'; SELECT extractValue(@xml,'//b[1]'); extractValue(@xml,'//b[1]') b1 c1b1 c2b1 @@ -1133,3 +1133,22 @@ 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.3 tests +# +# +# MDEV-5338 XML parser accepts malformed data +# +SELECT ExtractValue('xxx','/a/b'); +ExtractValue('xxx','/a/b') +NULL +Warnings: +Warning 1525 Incorrect XML value: 'parse error at line 1 pos 10: '' unexpected ('' wanted)' +SELECT ExtractValue('xxx','/a/b'); +ExtractValue('xxx','/a/b') +NULL +Warnings: +Warning 1525 Incorrect XML value: 'parse error at line 1 pos 13: '' unexpected ('' wanted)' +# +# End of 5.3 tests +# -- cgit v1.2.1 From 285160dee270abbbfef9b7c1fb72ec4040c42262 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 1 May 2014 17:19:17 +0300 Subject: MDEV-5981: name resolution issues with views and multi-update in ps-protocol It is triple bug with one test suite: 1. Incorrect outer table detection 2. Incorrect leaf table processing for multi-update (should be full like for usual updates and inserts) 3. ON condition fix_fields() fould be called for all tables of the query. --- mysql-test/r/view.result | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 1435b0c7a97..5d90ce08e50 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -4806,6 +4806,24 @@ id test 1 0 drop view v1; drop table t1; +# +# MDEV-5981: name resolution issues with views and multi-update +# in ps-protocol +# +create table t1 (id1 int primary key, val1 varchar(20)); +insert into t1 values (1, 'test1'); +create table t2 (id2 int primary key, val2 varchar(20)); +insert into t2 values (1, 'test2'); +create algorithm=merge view v1 as select id1 as id1v1, val1 as val1v1 from t1; +create algorithm=merge view v2 as +select t2.id2 as id2v2, t2.val2 as val2v2 +from t2, v1 +where t2.id2 = v1.id1v1; +prepare stmt1 from "update v2 set val2v2 = 'test19' where 1 = id2v2"; +execute stmt1; +deallocate prepare stmt1; +drop view v1,v2; +drop table t1,t2; # ----------------------------------------------------------------- # -- End of 5.3 tests. # ----------------------------------------------------------------- -- cgit v1.2.1 From a313864814c58e0f35a0baa8c163e40d0d0c3b69 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 5 May 2014 14:24:25 +0200 Subject: MDEV-6056 [PATCH] mysqldump writes usage to stdout even when not explicitly requested --- mysql-test/r/mysqldump.result | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index af1fe4a0d2c..49fd19927fc 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -5281,3 +5281,7 @@ drop table t1, t2; # # End of 5.1 tests # +Usage: mysqldump [OPTIONS] database [tables] +OR mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...] +OR mysqldump [OPTIONS] --all-databases [OPTIONS] +For more options, use mysqldump --help -- cgit v1.2.1 From 914a2b38bf4685e15a8e2e92579d7c34b35fa6c7 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 7 May 2014 22:36:25 +0200 Subject: merge of "BUG# 13975227: ONLINE OPTIMIZE TABLE FOR INNODB TABLES" revno: 5820 committer: Nisha Gopalakrishnan branch nick: mysql-5.6-13975225 timestamp: Mon 2014-02-17 15:12:16 +0530 message: BUG# 13975227: ONLINE OPTIMIZE TABLE FOR INNODB TABLES --- mysql-test/r/alter_table.result | 22 +---- mysql-test/r/innodb_mysql_sync.result | 181 ++++++++++++++++++++++++++++++++++ mysql-test/r/mysqlcheck.result | 3 - 3 files changed, 183 insertions(+), 23 deletions(-) (limited to 'mysql-test/r') diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 207f6166fe0..622023d0e7d 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -1461,24 +1461,6 @@ t2 CREATE TABLE `t2` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1 DROP TABLE t2; DROP TABLE t1; -# -# Bug#11938817 ALTER BEHAVIOR DIFFERENT THEN DOCUMENTED -# -DROP TABLE IF EXISTS t1; -CREATE TABLE t1(a INT) engine=innodb; -INSERT INTO t1 VALUES (1), (2); -# This should not do anything -ALTER TABLE t1; -affected rows: 0 -# Check that we rebuild the table -ALTER TABLE t1 engine=innodb; -affected rows: 2 -info: Records: 2 Duplicates: 0 Warnings: 0 -# This should also rebuild the table -ALTER TABLE t1 FORCE; -affected rows: 2 -info: Records: 2 Duplicates: 0 Warnings: 0 -DROP TABLE t1; # Bug#11748057 (formerly known as 34972): ALTER TABLE statement doesn't # identify correct column name. # @@ -1888,8 +1870,8 @@ ALTER TABLE tm1 DEFAULT CHARACTER SET utf8; affected rows: 2 info: Records: 2 Duplicates: 0 Warnings: 0 ALTER TABLE ti1 FORCE; -affected rows: 2 -info: Records: 2 Duplicates: 0 Warnings: 0 +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 ALTER TABLE tm1 FORCE; affected rows: 2 info: Records: 2 Duplicates: 0 Warnings: 0 diff --git a/mysql-test/r/innodb_mysql_sync.result b/mysql-test/r/innodb_mysql_sync.result index 0fecadf6de5..130b2273120 100644 --- a/mysql-test/r/innodb_mysql_sync.result +++ b/mysql-test/r/innodb_mysql_sync.result @@ -359,3 +359,184 @@ Note 1831 Duplicate index 'i4' defined on the table 'test.t1'. This is deprecate SET DEBUG_SYNC= 'RESET'; DROP TABLE t1; SET DEBUG_SYNC= 'RESET'; +# +#BUG#13975225:ONLINE OPTIMIZE TABLE FOR INNODB TABLES +# +SET DEBUG_SYNC= 'alter_table_inplace_after_lock_downgrade SIGNAL downgraded WAIT_FOR continue'; +#Setting up INNODB table. +CREATE TABLE t1(fld1 INT, fld2 INT, fld3 INT) ENGINE= INNODB; +INSERT INTO t1 VALUES (155, 45, 55); +#Concurrent INSERT, UPDATE, SELECT and DELETE is supported +#during OPTIMIZE TABLE operation for INNODB tables. +connection default; +#OPTIMIZE TABLE operation. +OPTIMIZE TABLE t1; +connection con1; +SET DEBUG_SYNC= 'now WAIT_FOR downgraded'; +# With the patch, concurrent DML operation succeeds. +INSERT INTO t1 VALUES (10, 11, 12); +UPDATE t1 SET fld1= 20 WHERE fld1= 155; +DELETE FROM t1 WHERE fld1= 20; +SELECT * from t1; +fld1 fld2 fld3 +10 11 12 +SET DEBUG_SYNC= 'now SIGNAL continue'; +connection default; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +DROP TABLE t1; +SET DEBUG_SYNC= 'RESET'; +#Concurrent INSERT, UPDATE, SELECT and DELETE is supported +#during OPTIMIZE TABLE operation for Partitioned table. +SET DEBUG_SYNC= 'alter_table_inplace_after_lock_downgrade SIGNAL downgraded WAIT_FOR continue'; +#Setup PARTITIONED table. +CREATE TABLE t1(fld1 INT) ENGINE= INNODB PARTITION BY HASH(fld1) PARTITIONS 4; +INSERT INTO t1 VALUES(10); +#OPTIMIZE TABLE operation. +OPTIMIZE TABLE t1; +connection con1; +SET DEBUG_SYNC= 'now WAIT_FOR downgraded'; +# With the patch, concurrent DML operation succeeds. +INSERT INTO t1 VALUES (30); +UPDATE t1 SET fld1= 20 WHERE fld1= 10; +DELETE FROM t1 WHERE fld1= 20; +SELECT * from t1; +fld1 +30 +SET DEBUG_SYNC= 'now SIGNAL continue'; +connection default; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +DROP TABLE t1; +SET DEBUG_SYNC= 'RESET'; +#ALTER TABLE FORCE and ALTER TABLE ENGINE uses online rebuild +#of the table. +CREATE TABLE t1(fld1 INT, fld2 INT); +INSERT INTO t1 VALUES(10, 20); +ALTER TABLE t1 FORCE; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +ALTER TABLE t1 ENGINE=INNODB; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +#ALTER TABLE FORCE, ALTER TABLE ENGINE and OPTIMIZE TABLE uses +#table copy when the old_alter_table enabled. +SET SESSION old_alter_table= TRUE; +affected rows: 0 +ALTER TABLE t1 FORCE; +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +ALTER TABLE t1 ENGINE= INNODB; +affected rows: 1 +info: Records: 1 Duplicates: 0 Warnings: 0 +SET DEBUG_SYNC= 'alter_table_copy_after_lock_upgrade SIGNAL upgraded'; +affected rows: 0 +#OPTIMIZE TABLE operation using table copy. +OPTIMIZE TABLE t1; +connection con1; +SET DEBUG_SYNC= 'now WAIT_FOR upgraded'; +affected rows: 0 +INSERT INTO t1 VALUES(10, 20); +affected rows: 1 +connection default; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +affected rows: 2 +SET DEBUG_SYNC= 'RESET'; +affected rows: 0 +SET SESSION old_alter_table= FALSE; +affected rows: 0 +#ALTER TABLE FORCE and ALTER TABLE ENGINE uses table copy +#when ALGORITHM COPY is used. +ALTER TABLE t1 FORCE, ALGORITHM= COPY; +affected rows: 2 +info: Records: 2 Duplicates: 0 Warnings: 0 +ALTER TABLE t1 ENGINE= INNODB, ALGORITHM= COPY; +affected rows: 2 +info: Records: 2 Duplicates: 0 Warnings: 0 +DROP TABLE t1; +#OPTIMIZE TABLE on a table with FULLTEXT index uses +#ALTER TABLE FORCE using COPY algorithm here. This +#test case ensures the COPY table debug sync point is hit. +SET DEBUG_SYNC= 'alter_table_copy_after_lock_upgrade SIGNAL upgraded'; +#Setup a table with FULLTEXT index. +connection default; +CREATE TABLE t1(fld1 CHAR(10), FULLTEXT(fld1)) ENGINE= INNODB; +INSERT INTO t1 VALUES("String1"); +#OPTIMIZE TABLE operation. +OPTIMIZE TABLE t1; +connection con1; +SET DEBUG_SYNC= 'now WAIT_FOR upgraded'; +INSERT INTO t1 VALUES("String2"); +connection default; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize, doing recreate + analyze instead +test.t1 optimize status OK +SET DEBUG_SYNC= 'RESET'; +DROP TABLE t1; +#Test which demonstrates that ALTER TABLE, OPTIMIZE PARTITION +#takes OPTIMIZE TABLE code path, hence does an online rebuild +#of the table with the patch. +connection default; +SET DEBUG_SYNC= 'alter_table_inplace_after_lock_downgrade SIGNAL downgraded WAIT_FOR continue'; +#Setup PARTITIONED table. +CREATE TABLE t1(fld1 INT) ENGINE= INNODB PARTITION BY HASH(fld1) PARTITIONS 4; +INSERT INTO t1 VALUES(10); +#OPTIMIZE ALL PARTITIONS operation. +ALTER TABLE t1 OPTIMIZE PARTITION ALL; +connection con1; +SET DEBUG_SYNC= 'now WAIT_FOR downgraded'; +# With the patch, concurrent DML operation succeeds. +INSERT INTO t1 VALUES (30); +UPDATE t1 SET fld1= 20 WHERE fld1= 10; +DELETE FROM t1 WHERE fld1= 20; +SELECT * from t1; +fld1 +30 +SET DEBUG_SYNC= 'now SIGNAL continue'; +connection default; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. +test.t1 optimize status OK +SET DEBUG_SYNC= 'RESET'; +#OPTIMIZE PER PARTITION operation. +SET DEBUG_SYNC= 'alter_table_inplace_after_lock_downgrade SIGNAL downgraded WAIT_FOR continue'; +ALTER TABLE t1 OPTIMIZE PARTITION p0; +connection con1; +SET DEBUG_SYNC= 'now WAIT_FOR downgraded'; +# With the patch, concurrent DML operation succeeds. +INSERT INTO t1 VALUES (30); +UPDATE t1 SET fld1= 20 WHERE fld1= 10; +DELETE FROM t1 WHERE fld1= 20; +SELECT * from t1; +fld1 +30 +30 +SET DEBUG_SYNC= 'now SIGNAL continue'; +connection default; +Table Op Msg_type Msg_text +test.t1 optimize note Table does not support optimize on partitions. All partitions will be rebuilt and analyzed. +test.t1 optimize status OK +SET DEBUG_SYNC= 'RESET'; +# Test case for Bug#11938817 (ALTER BEHAVIOR DIFFERENT THEN DOCUMENTED). +# This should not do anything +ALTER TABLE t1; +affected rows: 0 +SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL rebuild'; +# Check that we rebuild the table +ALTER TABLE t1 engine=innodb; +connection con1; +SET DEBUG_SYNC= 'now WAIT_FOR rebuild'; +connection default; +SET DEBUG_SYNC= 'RESET'; +SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL rebuild'; +# Check that we rebuild the table +ALTER TABLE t1 FORCE; +connection con1; +SET DEBUG_SYNC= 'now WAIT_FOR rebuild'; +connection default; +SET DEBUG_SYNC= 'RESET'; +DROP TABLE t1; diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result index 5abce8af9c9..ba9ab47ea95 100644 --- a/mysql-test/r/mysqlcheck.result +++ b/mysql-test/r/mysqlcheck.result @@ -297,10 +297,7 @@ 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 -- cgit v1.2.1 From c8ee83ee8a47f2aef311b2e3d78f69448cd8a1f1 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 8 May 2014 10:25:16 +0200 Subject: after merge test case fixes --- mysql-test/r/innodb_mysql_sync.result | 2 +- mysql-test/r/mysqld--help.result | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'mysql-test/r') diff --git a/mysql-test/r/innodb_mysql_sync.result b/mysql-test/r/innodb_mysql_sync.result index 130b2273120..21e9cd04c22 100644 --- a/mysql-test/r/innodb_mysql_sync.result +++ b/mysql-test/r/innodb_mysql_sync.result @@ -413,7 +413,7 @@ DROP TABLE t1; SET DEBUG_SYNC= 'RESET'; #ALTER TABLE FORCE and ALTER TABLE ENGINE uses online rebuild #of the table. -CREATE TABLE t1(fld1 INT, fld2 INT); +CREATE TABLE t1(fld1 INT, fld2 INT) ENGINE=INNODB; INSERT INTO t1 VALUES(10, 20); ALTER TABLE t1 FORCE; affected rows: 0 diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result index f8ce0e35904..47e1851c4ef 100644 --- a/mysql-test/r/mysqld--help.result +++ b/mysql-test/r/mysqld--help.result @@ -1244,7 +1244,7 @@ performance-schema-max-rwlock-instances 1724 performance-schema-max-socket-classes 10 performance-schema-max-socket-instances 179 performance-schema-max-stage-classes 150 -performance-schema-max-statement-classes 179 +performance-schema-max-statement-classes 180 performance-schema-max-table-handles 445 performance-schema-max-table-instances 445 performance-schema-max-thread-classes 50 -- cgit v1.2.1 From 3e7519f17efde2d7fb416c673644e8dd7bd3eab1 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 8 May 2014 10:25:24 +0200 Subject: fix mdl_sync test to work now when ALTER TABLE .. ENGINE=xxx may be executed online --- mysql-test/r/mdl_sync.result | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'mysql-test/r') diff --git a/mysql-test/r/mdl_sync.result b/mysql-test/r/mdl_sync.result index 990f074175b..206ad509e37 100644 --- a/mysql-test/r/mdl_sync.result +++ b/mysql-test/r/mdl_sync.result @@ -3086,18 +3086,17 @@ DELETE FROM t2 WHERE a = 3; # Now that DELETE blocks on a metadata lock, we should be able to do # SELECT * FROM m1 here. SELECT used to be blocked by a DELETE table # lock request. -SELECT * FROM m1; -a -1 -2 -3 -4 +SELECT * FROM m1 WHERE a < 3; # Resuming ALTER TABLE SET DEBUG_SYNC= 'now SIGNAL continue'; # Connection con1 # Reaping: ALTER TABLE m1 engine=MERGE UNION=(t2, t1) # Connection con2 # Reaping: DELETE FROM t2 WHERE a = 3 +# Reaping: SELECT * FROM m1 WHERE a < 3 +a +1 +2 # Connection default DROP TABLE m1, t1, t2; SET DEBUG_SYNC= 'RESET'; -- cgit v1.2.1 From 45a91d8cbbfb38926f839b9c3cec73a39c5ebffd Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 May 2014 22:56:36 +0300 Subject: MDEV-6193: Problems with multi-table updates that JOIN against read-only table All underlying tables should share the same lock type. --- mysql-test/r/multi_update.result | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index 7172693d685..aef001c5f95 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -797,6 +797,8 @@ DROP TABLE t1,t2; # # MDEV-6139: UPDATE w/ join against MRG_MyISAM table with read-only # sub-table fails +# MDEV-6193: Problems with multi-table updates that JOIN against +# read-only table # CREATE TABLE t1 ( id int(10) unsigned, @@ -812,5 +814,13 @@ b int(11) ) ENGINE=MRG_MyISAM UNION=(t3); FLUSH TABLES; update t1 join t2 using (id) set t1.a=t2.b; +create view v2 as select * from t2; +update t1 join v2 using (id) set t1.a=0; +create view v1 as select * from t3; +update t1 join v1 using (id) set t1.a=0; +update t1 join INFORMATION_SCHEMA.CHARACTER_SETS on (id=MAXLEN) set t1.a=0; +create view v3 as select t2.id, t3.b from t2 join t3 using(id); +update t1 join v3 using (id) set t1.a=0; +drop view v1, v2, v3; drop table t2, t3, t1; end of 5.5 tests -- cgit v1.2.1 From edf1fbd25b81ecb0d5636566b35fa2f7fb09b0b8 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 13 May 2014 11:53:30 +0200 Subject: MDEV-6153 Trivial Lintian errors in MariaDB sources: spelling errors and wrong executable bits --- mysql-test/r/mysqld--help.result | 4 ++-- mysql-test/r/ps.result | 6 +++--- mysql-test/r/subselect_sj.result | 4 ++-- mysql-test/r/subselect_sj_jcl6.result | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'mysql-test/r') diff --git a/mysql-test/r/mysqld--help.result b/mysql-test/r/mysqld--help.result index 47e1851c4ef..822d4eb9ce1 100644 --- a/mysql-test/r/mysqld--help.result +++ b/mysql-test/r/mysqld--help.result @@ -683,7 +683,7 @@ The following options may be given as the first argument: plugins from a given library_file will be loaded. --plugin-load-add=name Optional semicolon-separated list of plugins to load. - This option adds to the list speficied by --plugin-load + This option adds to the list specified by --plugin-load in an incremental way. It can be specified many times, adding more plugins every time. --plugin-maturity=name @@ -756,7 +756,7 @@ The following options may be given as the first argument: --relay-log-space-limit=# Maximum space to use for all relay logs --replicate-annotate-row-events - Tells the slave to write annotate rows events recieved + Tells the slave to write annotate rows events received from the master to its own binary log. Ignored if log_slave_updates is not set --replicate-do-db=name diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index ec680b112a3..31fcea528aa 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -613,8 +613,8 @@ insert into t2 values ("1", "1", "sup", "0"), ("2", "1", "sup", "1"), ("4", "1", "sup", "0"); create table t3 ( id int(11) not null default '0', -preceeding_id int(11) not null default '0', -primary key (id,preceeding_id) +preceding_id int(11) not null default '0', +primary key (id,preceding_id) ); create table t4 ( user_id varchar(50) not null, @@ -625,7 +625,7 @@ insert into t4 values("nicke", "imp"); prepare stmt from 'select distinct t1.partner_id from t1 left join t3 on t1.id = t3.id - left join t1 pp on pp.id = t3.preceeding_id + left join t1 pp on pp.id = t3.preceding_id where exists ( select * diff --git a/mysql-test/r/subselect_sj.result b/mysql-test/r/subselect_sj.result index c76d40d1a5f..6c736aad8ee 100644 --- a/mysql-test/r/subselect_sj.result +++ b/mysql-test/r/subselect_sj.result @@ -1007,8 +1007,8 @@ insert into t2 values ("1", "1", "sup", "0"), ("2", "1", "sup", "1"), ("4", "1", "sup", "0"); create table t3 ( id int(11) not null default '0', -preceeding_id int(11) not null default '0', -primary key (id,preceeding_id) +preceding_id int(11) not null default '0', +primary key (id,preceding_id) ); create table t4 ( user_id varchar(50) not null, diff --git a/mysql-test/r/subselect_sj_jcl6.result b/mysql-test/r/subselect_sj_jcl6.result index 92ad951325b..dce77b68cdc 100644 --- a/mysql-test/r/subselect_sj_jcl6.result +++ b/mysql-test/r/subselect_sj_jcl6.result @@ -1020,8 +1020,8 @@ insert into t2 values ("1", "1", "sup", "0"), ("2", "1", "sup", "1"), ("4", "1", "sup", "0"); create table t3 ( id int(11) not null default '0', -preceeding_id int(11) not null default '0', -primary key (id,preceeding_id) +preceding_id int(11) not null default '0', +primary key (id,preceding_id) ); create table t4 ( user_id varchar(50) not null, -- cgit v1.2.1