From 57be8794216368861b7983483fc297f97b045c56 Mon Sep 17 00:00:00 2001 From: "Horst.Hunger" Date: Thu, 11 Nov 2010 11:25:03 +0100 Subject: [PATCH 01/23] 2. review update for bug#52501 fixing a syntax error, a not actual result file and replaced directory info by place holder. --- mysql-test/suite/sys_vars/r/general_log_file_basic.result | 2 +- mysql-test/suite/sys_vars/r/log_output_func.result | 2 +- mysql-test/suite/sys_vars/r/slow_query_log_file_basic.result | 2 +- mysql-test/suite/sys_vars/t/div_precision_increment_func.test | 2 +- mysql-test/suite/sys_vars/t/general_log_file_basic.test | 1 + mysql-test/suite/sys_vars/t/log_output_func.test | 1 + mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test | 1 + 7 files changed, 7 insertions(+), 4 deletions(-) diff --git a/mysql-test/suite/sys_vars/r/general_log_file_basic.result b/mysql-test/suite/sys_vars/r/general_log_file_basic.result index 5c0b93cf4ab..31fdd07d06e 100644 --- a/mysql-test/suite/sys_vars/r/general_log_file_basic.result +++ b/mysql-test/suite/sys_vars/r/general_log_file_basic.result @@ -16,4 +16,4 @@ FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='general_log_file'; @@global.general_log_file = VARIABLE_VALUE 1 -SET @@global.general_log_file= 'test.log'; +SET @@global.general_log_file= 'start_value'; diff --git a/mysql-test/suite/sys_vars/r/log_output_func.result b/mysql-test/suite/sys_vars/r/log_output_func.result index 00a8e824f78..24703f4317b 100644 --- a/mysql-test/suite/sys_vars/r/log_output_func.result +++ b/mysql-test/suite/sys_vars/r/log_output_func.result @@ -52,7 +52,7 @@ count(*) DROP TABLE t1; connection default; SET @@global.general_log= 'OFF'; -SET @@global.general_log_file= '/home/horst/bzr/5.1-52501/mysql-test/var/mysqld.1/mysqld.log'; +SET @@global.general_log_file= 'start_general_log_file'; SET @@global.log_output= @start_value; SET @@global.general_log= @start_general_log; SET @@global.general_log= 'ON'; diff --git a/mysql-test/suite/sys_vars/r/slow_query_log_file_basic.result b/mysql-test/suite/sys_vars/r/slow_query_log_file_basic.result index 3cd62187d0b..ce4fd8094bf 100644 --- a/mysql-test/suite/sys_vars/r/slow_query_log_file_basic.result +++ b/mysql-test/suite/sys_vars/r/slow_query_log_file_basic.result @@ -14,4 +14,4 @@ FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='slow_query_log_file'; @@global.slow_query_log_file = VARIABLE_VALUE 1 -SET @@global.slow_query_log_file= 'slowtest.log'; +SET @@global.slow_query_log_file= 'start_value'; diff --git a/mysql-test/suite/sys_vars/t/div_precision_increment_func.test b/mysql-test/suite/sys_vars/t/div_precision_increment_func.test index aebca88abf9..ba7bc65eb48 100644 --- a/mysql-test/suite/sys_vars/t/div_precision_increment_func.test +++ b/mysql-test/suite/sys_vars/t/div_precision_increment_func.test @@ -19,7 +19,7 @@ # # ################################################################################ -let $save_div_precision_increment = `SELECT @@global.div_precision_increment` +let $save_div_precision_increment = `SELECT @@global.div_precision_increment`; #SET @save_div_precision_increment = @@global.div_precision_increment; diff --git a/mysql-test/suite/sys_vars/t/general_log_file_basic.test b/mysql-test/suite/sys_vars/t/general_log_file_basic.test index 35905bad987..f02c59736e3 100644 --- a/mysql-test/suite/sys_vars/t/general_log_file_basic.test +++ b/mysql-test/suite/sys_vars/t/general_log_file_basic.test @@ -70,6 +70,7 @@ FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='general_log_file'; #SET @@global.general_log_file= @start_value; +--replace_result $start_value start_value eval SET @@global.general_log_file= '$start_value'; ##################################################### diff --git a/mysql-test/suite/sys_vars/t/log_output_func.test b/mysql-test/suite/sys_vars/t/log_output_func.test index 8a2fbe0728b..6b7c01a7dab 100644 --- a/mysql-test/suite/sys_vars/t/log_output_func.test +++ b/mysql-test/suite/sys_vars/t/log_output_func.test @@ -115,6 +115,7 @@ file_exists $MYSQLTEST_VARDIR/run/mytest.log ; connection default; SET @@global.general_log= 'OFF'; #SET @@global.general_log_file= @start_general_log_file; +--replace_result $start_general_log_file start_general_log_file eval SET @@global.general_log_file= '$start_general_log_file'; SET @@global.log_output= @start_value; SET @@global.general_log= @start_general_log; diff --git a/mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test b/mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test index 810588b8f4e..4eb747d888b 100644 --- a/mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test +++ b/mysql-test/suite/sys_vars/t/slow_query_log_file_basic.test @@ -68,6 +68,7 @@ FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='slow_query_log_file'; #SET @@global.slow_query_log_file= @start_value; +--replace_result $start_value start_value eval SET @@global.slow_query_log_file= '$start_value'; #SELECT @start_value; ##################################################### From 9ecf3156794ea83ddf35dc19acce7f2288505567 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Mon, 10 Jan 2011 16:20:28 +0100 Subject: [PATCH 02/23] Bug#57924: crash when creating partitioned table with multiple columns in the partition key ndb crash if duplicate columns in the partitioning key. Backport from mysql-5.1-telco-7.0, see bug#53354. Changed from case sensitive field name comparision to non case sensitive too. --- mysql-test/r/partition_error.result | 13 +++++++++++++ mysql-test/suite/ndb/r/ndb_basic.result | 2 ++ mysql-test/suite/ndb/t/ndb_basic.test | 7 +++++++ mysql-test/t/partition_error.test | 14 ++++++++++++++ sql/sql_partition.cc | 22 ++++++++++++++++++++++ 5 files changed, 58 insertions(+) diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result index ea74f476ceb..91eb18b3dad 100644 --- a/mysql-test/r/partition_error.result +++ b/mysql-test/r/partition_error.result @@ -1,5 +1,18 @@ drop table if exists t1; # +# Bug#57924: crash when creating partitioned table with +# multiple columns in the partition key +# +CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b)) +PARTITION BY KEY(a, b, a); +ERROR HY000: Field in list of fields for partition function not found in table +CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b)) +PARTITION BY KEY(A, b); +DROP TABLE t1; +CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b)) +PARTITION BY KEY(a, b, A); +ERROR HY000: Field in list of fields for partition function not found in table +# # Bug#49161: Out of memory; restart server and try again (needed 2 bytes) # CREATE TABLE t1 (a INT) PARTITION BY HASH (a); diff --git a/mysql-test/suite/ndb/r/ndb_basic.result b/mysql-test/suite/ndb/r/ndb_basic.result index 9f4f8c0755c..ee50352220e 100644 --- a/mysql-test/suite/ndb/r/ndb_basic.result +++ b/mysql-test/suite/ndb/r/ndb_basic.result @@ -585,6 +585,8 @@ c127 int, c128 int, primary key using hash(c1)) engine=ndb partition by key(c1); drop table t1; +create table `t1` (`a` int, b int, primary key (a,b)) engine=ndb partition by key(`a`,`b`,`a`); +ERROR HY000: Field in list of fields for partition function not found in table create table t1 ( a1234567890123456789012345678901234567890 int primary key, a12345678901234567890123456789a1234567890 int, diff --git a/mysql-test/suite/ndb/t/ndb_basic.test b/mysql-test/suite/ndb/t/ndb_basic.test index 2fc140288ca..5d6221d1784 100644 --- a/mysql-test/suite/ndb/t/ndb_basic.test +++ b/mysql-test/suite/ndb/t/ndb_basic.test @@ -547,6 +547,13 @@ c128 int, primary key using hash(c1)) engine=ndb partition by key(c1); drop table t1; +# +# test bug#53354 - crash when creating partitioned table with multiple columns in the partition key +# + +--error ER_FIELD_NOT_FOUND_PART_ERROR +create table `t1` (`a` int, b int, primary key (a,b)) engine=ndb partition by key(`a`,`b`,`a`); + # # test max size of attribute name and truncation # diff --git a/mysql-test/t/partition_error.test b/mysql-test/t/partition_error.test index d3f10628254..aa26fa29db9 100644 --- a/mysql-test/t/partition_error.test +++ b/mysql-test/t/partition_error.test @@ -10,6 +10,20 @@ drop table if exists t1; let $MYSQLD_DATADIR= `SELECT @@datadir`; +--echo # +--echo # Bug#57924: crash when creating partitioned table with +--echo # multiple columns in the partition key +--echo # +--error ER_FIELD_NOT_FOUND_PART_ERROR +CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b)) +PARTITION BY KEY(a, b, a); +CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b)) +PARTITION BY KEY(A, b); +DROP TABLE t1; +--error ER_FIELD_NOT_FOUND_PART_ERROR +CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b)) +PARTITION BY KEY(a, b, A); + --echo # --echo # Bug#49161: Out of memory; restart server and try again (needed 2 bytes) --echo # diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 44ed9e759c6..8cd43a4f60e 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -761,6 +761,9 @@ static bool handle_list_of_fields(List_iterator it, bool result; char *field_name; bool is_list_empty= TRUE; + int fields_handled = 0; + char* field_name_array[MAX_KEY]; + DBUG_ENTER("handle_list_of_fields"); while ((field_name= it++)) @@ -776,6 +779,25 @@ static bool handle_list_of_fields(List_iterator it, result= TRUE; goto end; } + + /* + Check for duplicate fields in the list. + Assuming that there are not many fields in the partition key list. + If there were, it would be better to replace the for-loop + with a more efficient algorithm. + */ + + field_name_array[fields_handled] = field_name; + for (int i = 0; i < fields_handled; ++i) + { + if (my_strcasecmp(system_charset_info, + field_name_array[i], field_name) == 0) + { + my_error(ER_FIELD_NOT_FOUND_PART_ERROR, MYF(0)); + DBUG_RETURN(TRUE); + } + } + fields_handled++; } if (is_list_empty) { From 3a0b067654aed03d078460e9e0f1bbd20d5b4457 Mon Sep 17 00:00:00 2001 From: Mattias Jonsson Date: Mon, 10 Jan 2011 23:42:37 +0100 Subject: [PATCH 03/23] Bug#47902: partition_recover_myisam fails with --ps-protocol The problem was that the warnings was never written out when running with --ps-protocol. This was because the warnings only appeared during the prepare phase, not the execute phase. Solved by not clearing the warnings from the prepare phase if there was no other warnings. If there are warnings from the execute phase, it is very likely to be the same as from the prepare phase. My tests show that if not clearing the warnings from the prepare phase when there are warnings from the execute phase, there will be duplicated warnings in the result. --- client/mysqltest.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index a12c56c9657..cdfce036ec7 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -7241,8 +7241,12 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command, mysql_free_result(res); /* Free normal result set with meta data */ - /* Clear prepare warnings */ - dynstr_set(&ds_prepare_warnings, NULL); + /* + Clear prepare warnings if there are execute warnings, + since they are probably duplicated. + */ + if (ds_execute_warnings.length || mysql->warning_count) + dynstr_set(&ds_prepare_warnings, NULL); } else { From 95e07a6fb78d8d0f01a8bfb7064211a75ddc7edf Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Fri, 14 Jan 2011 19:50:34 +0530 Subject: [PATCH 04/23] Bug#13618 : mysqldump --xml omits comment on table field When mysqldump tries to dump information in xml format, the result does not contain field level comments. In order to retrieve various informations for a field/column, mysqldump currently uses 'show fields from ' statement. The attributes returned by the statement lacks the information regarding field comments. Fixed by changing the query to one that probes I_S to retrieve required field informations, including the field comment. --- client/mysqldump.c | 13 ++++++++++-- mysql-test/r/client_xml.result | 6 +++--- mysql-test/r/mysqldump.result | 37 ++++++++++++++++++++++++---------- mysql-test/t/mysqldump.test | 9 +++++++++ 4 files changed, 49 insertions(+), 16 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index e35672c2a2c..57e3f5b0349 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -2247,6 +2247,15 @@ static uint get_table_structure(char *table, char *db, char *table_type, const char *insert_option; char name_buff[NAME_LEN+3],table_buff[NAME_LEN*2+3]; char table_buff2[NAME_LEN*2+3], query_buff[QUERY_LENGTH]; + const char *show_fields_stmt= "SELECT `COLUMN_NAME` AS `Field`, " + "`COLUMN_TYPE` AS `Type`, " + "`IS_NULLABLE` AS `Null`, " + "`COLUMN_KEY` AS `Key`, " + "`COLUMN_DEFAULT` AS `Default`, " + "`EXTRA` AS `Extra`, " + "`COLUMN_COMMENT` AS `Comment` " + "FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE " + "TABLE_SCHEMA = '%s' AND TABLE_NAME = '%s'"; FILE *sql_file= md_result_file; int len; MYSQL_RES *result; @@ -2514,8 +2523,8 @@ static uint get_table_structure(char *table, char *db, char *table_type, verbose_msg("%s: Warning: Can't set SQL_QUOTE_SHOW_CREATE option (%s)\n", my_progname, mysql_error(mysql)); - my_snprintf(query_buff, sizeof(query_buff), "show fields from %s", - result_table); + my_snprintf(query_buff, sizeof(query_buff), show_fields_stmt, db, table); + if (mysql_query_with_error_report(mysql, &result, query_buff)) DBUG_RETURN(0); diff --git a/mysql-test/r/client_xml.result b/mysql-test/r/client_xml.result index aa4bdb2bd61..7f74a092af7 100644 --- a/mysql-test/r/client_xml.result +++ b/mysql-test/r/client_xml.result @@ -21,9 +21,9 @@ insert into t1 values (1, 2, 'a&b ab'); - - - + + + diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index d26eaac7a93..289e7f66406 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -14,7 +14,7 @@ INSERT INTO t1 VALUES (1), (2); - + @@ -150,9 +150,9 @@ INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES"); - - - + + + @@ -178,7 +178,7 @@ INSERT INTO t1 VALUES ("1\""), ("\"2"); - + @@ -1612,10 +1612,10 @@ CREATE TABLE `t2` ( - + - + @@ -1623,10 +1623,10 @@ CREATE TABLE `t2` ( - + - + @@ -3644,8 +3644,8 @@ INSERT INTO t1 VALUES(1,0xff00fef0); - - + + @@ -4576,5 +4576,20 @@ LENGTH(a) 800 DROP TABLE t1, t2; # +# Bug #13618 : mysqldump --xml ommit comment on table field +# +CREATE TABLE `comment_table` (i INT COMMENT 'FIELD COMMENT') COMMENT = 'TABLE COMMENT'; + + + + + + + + + + +DROP TABLE `comment_table`; +# # End of 5.1 tests # diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 9246d488dd8..fe0b05dbb42 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -2164,6 +2164,15 @@ SELECT LENGTH(a) FROM t2; DROP TABLE t1, t2; ########################################################################### + +--echo # +--echo # Bug #13618 : mysqldump --xml ommit comment on table field +--echo # + +CREATE TABLE `comment_table` (i INT COMMENT 'FIELD COMMENT') COMMENT = 'TABLE COMMENT'; +--exec $MYSQL_DUMP --compact --skip-create --xml test +DROP TABLE `comment_table`; + --echo # --echo # End of 5.1 tests --echo # From 0b6925002f2e64436e0f3228acd7c6aa2d568e91 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Sat, 15 Jan 2011 00:56:09 +0400 Subject: [PATCH 05/23] Bug#52208 gis fails on some platforms (Solaris, HP-UX, Linux) IA64 and some other arcitectures use different float rounding mode and i find no decent way to make it consistent. So the test changed to be insensitive to this. per-file messages: mysql-test/t/gis.test Bug#52208 gis fails on some platforms (Solaris, HP-UX, Linux) --replace_result added --- mysql-test/t/gis.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index 97fc6f94b6a..bdbbfc7c064 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -358,7 +358,7 @@ t1 where object_id=85998; # Expected result is 36.3310176346905, but IA64 returns 36.3310176346904 # due to fused multiply-add instructions. ---replace_result 36.3310176346904 36.3310176346905 +--replace_result 36.3310176346904 36.3310176346905 -114.87787186923326 -114.87787186923313 36.33101763469053 36.33101763469059 36.33101763469043 36.33101763469059 select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from t1 where object_id=85984; From ade1c74b3f9b662a572b843b7090fc68c5777ca9 Mon Sep 17 00:00:00 2001 From: Date: Sat, 15 Jan 2011 13:48:16 +0800 Subject: [PATCH 06/23] BUG#49124 Security issue with /*!-versioned */ SQL statements on Slave Backport to 5.0. /*![:version:] Query Code */, where [:version:] is a sequence of 5 digits representing the mysql server version(e.g /*!50200 ... */), is a special comment that the query in it can be executed on those servers whose versions are larger than the version appearing in the comment. It leads to a security issue when slave's version is larger than master's. A malicious user can improve his privileges on slaves. Because slave SQL thread is running with SUPER privileges, so it can execute queries that he/she does not have privileges on master. This bug is fixed with the logic below: - To replace '!' with ' ' in the magic comments which are not applied on master. So they become common comments and will not be applied on slave. - Example: 'INSERT INTO t1 VALUES (1) /*!10000, (2)*/ /*!99999 ,(3)*/ will be binlogged as 'INSERT INTO t1 VALUES (1) /*!10000, (2)*/ /* 99999 ,(3)*/ --- mysql-test/r/rpl_conditional_comments.result | 57 +++++++++++++++ mysql-test/t/rpl_conditional_comments.test | 73 ++++++++++++++++++++ sql/mysql_priv.h | 2 +- sql/sql_lex.cc | 25 ++++++- sql/sql_lex.h | 8 +-- sql/sql_parse.cc | 12 ++-- 6 files changed, 163 insertions(+), 14 deletions(-) create mode 100644 mysql-test/r/rpl_conditional_comments.result create mode 100644 mysql-test/t/rpl_conditional_comments.test diff --git a/mysql-test/r/rpl_conditional_comments.result b/mysql-test/r/rpl_conditional_comments.result new file mode 100644 index 00000000000..105d3bc59f3 --- /dev/null +++ b/mysql-test/r/rpl_conditional_comments.result @@ -0,0 +1,57 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +CREATE TABLE t1(c1 INT); +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE t1(c1 INT) + +# Case 1: +# ------------------------------------------------------------------ +# In a statement, some CCs are applied while others are not. The CCs +# which are not applied on master will be binlogged as common comments. +/*!99999 --- */INSERT /*!INTO*/ /*!10000 t1 */ VALUES(10) /*!99999 ,(11)*/; +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; /* 99999 --- */INSERT /*!INTO*/ /*!10000 t1 */ VALUES(10) /* 99999 ,(11)*/ +Comparing tables master:test.t1 and slave:test.t1 + +# Case 2: +# ----------------------------------------------------------------- +# Verify whether it can be binlogged correctly when executing prepared +# statement. +PREPARE stmt FROM 'INSERT INTO /*!99999 blabla*/ t1 VALUES(60) /*!99999 ,(61)*/'; +EXECUTE stmt; +DROP TABLE t1; +CREATE TABLE t1(c1 INT); +EXECUTE stmt; +Comparing tables master:test.t1 and slave:test.t1 + +SET @value=62; +PREPARE stmt FROM 'INSERT INTO /*!99999 blabla */ t1 VALUES(?) /*!99999 ,(63)*/'; +EXECUTE stmt USING @value; +DROP TABLE t1; +CREATE TABLE t1(c1 INT); +EXECUTE stmt USING @value; +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO /* 99999 blabla*/ t1 VALUES(60) /* 99999 ,(61)*/ +master-bin.000001 # Query # # use `test`; DROP TABLE t1 +master-bin.000001 # Query # # use `test`; CREATE TABLE t1(c1 INT) +master-bin.000001 # Query # # use `test`; INSERT INTO /* 99999 blabla*/ t1 VALUES(60) /* 99999 ,(61)*/ +master-bin.000001 # Query # # use `test`; INSERT INTO /* 99999 blabla */ t1 VALUES(62) /* 99999 ,(63)*/ +master-bin.000001 # Query # # use `test`; DROP TABLE t1 +master-bin.000001 # Query # # use `test`; CREATE TABLE t1(c1 INT) +master-bin.000001 # Query # # use `test`; INSERT INTO /* 99999 blabla */ t1 VALUES(62) /* 99999 ,(63)*/ +Comparing tables master:test.t1 and slave:test.t1 + +# Case 3: +# ----------------------------------------------------------------- +# Verify it can restore the '!', if the it is an uncomplete conditional +# comments +SELECT c1 FROM /*!99999 t1 WHEREN; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '/*!99999 t1 WHEREN' at line 1 +DROP TABLE t1; diff --git a/mysql-test/t/rpl_conditional_comments.test b/mysql-test/t/rpl_conditional_comments.test new file mode 100644 index 00000000000..f1f46b8fc41 --- /dev/null +++ b/mysql-test/t/rpl_conditional_comments.test @@ -0,0 +1,73 @@ +############################################################################### +# After the patch for BUG#49124: +# - Use ' ' instead of '!' in the conditional comments which are not applied on +# master. So they become common comments and will not be applied on slave. +# +# - Example: +# 'INSERT INTO t1 VALUES (1) /*!10000, (2)*/ /*!99999 ,(3)*/ +# will be binlogged as +# 'INSERT INTO t1 VALUES (1) /*!10000, (2)*/ /* 99999 ,(3)*/'. +############################################################################### +source include/master-slave.inc; + +CREATE TABLE t1(c1 INT); +source include/show_binlog_events.inc; +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); + +--echo +--echo # Case 1: +--echo # ------------------------------------------------------------------ +--echo # In a statement, some CCs are applied while others are not. The CCs +--echo # which are not applied on master will be binlogged as common comments. + +/*!99999 --- */INSERT /*!INTO*/ /*!10000 t1 */ VALUES(10) /*!99999 ,(11)*/; + +source include/show_binlog_events.inc; +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); +sync_slave_with_master; +let $diff_table_1=master:test.t1; +let $diff_table_2=slave:test.t1; +source include/diff_tables.inc; + +--echo +--echo # Case 2: +--echo # ----------------------------------------------------------------- +--echo # Verify whether it can be binlogged correctly when executing prepared +--echo # statement. +PREPARE stmt FROM 'INSERT INTO /*!99999 blabla*/ t1 VALUES(60) /*!99999 ,(61)*/'; +EXECUTE stmt; +DROP TABLE t1; +CREATE TABLE t1(c1 INT); +EXECUTE stmt; + +sync_slave_with_master; +let $diff_table_1=master:test.t1; +let $diff_table_2=slave:test.t1; +source include/diff_tables.inc; + +--echo +SET @value=62; +PREPARE stmt FROM 'INSERT INTO /*!99999 blabla */ t1 VALUES(?) /*!99999 ,(63)*/'; +EXECUTE stmt USING @value; +DROP TABLE t1; +CREATE TABLE t1(c1 INT); +EXECUTE stmt USING @value; + +source include/show_binlog_events.inc; +let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); + +sync_slave_with_master; +let $diff_table_1=master:test.t1; +let $diff_table_2=slave:test.t1; +source include/diff_tables.inc; + +--echo +--echo # Case 3: +--echo # ----------------------------------------------------------------- +--echo # Verify it can restore the '!', if the it is an uncomplete conditional +--echo # comments +--error 1064 +SELECT c1 FROM /*!99999 t1 WHEREN; + +DROP TABLE t1; +source include/master-slave-end.inc; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 55bcd30999d..5f8458f4f1e 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -751,7 +751,7 @@ bool do_rename(THD *thd, TABLE_LIST *ren_table, char *new_db, bool mysql_change_db(THD *thd, const LEX_STRING *new_db_name, bool force_switch); -void mysql_parse(THD *thd, const char *inBuf, uint length, +void mysql_parse(THD *thd, char *rawbuf, uint length, const char ** semicolon); bool mysql_test_parse_for_slave(THD *thd,char *inBuf,uint length); diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 17ee53d446b..a013d5466c1 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -109,7 +109,7 @@ st_parsing_options::reset() } Lex_input_stream::Lex_input_stream(THD *thd, - const char* buffer, + char* buffer, unsigned int length) : m_thd(thd), yylineno(1), @@ -580,7 +580,7 @@ int MYSQLlex(void *arg, void *yythd) state=MY_LEX_COMMENT; break; } - yylval->lex_str.str=(char*) (lip->ptr=lip->tok_start);// Set to first chr + yylval->lex_str.str=lip->ptr=(char*)lip->tok_start;// Set to first chr yylval->lex_str.length=1; c=yyGet(); if (c != ')') @@ -946,6 +946,9 @@ int MYSQLlex(void *arg, void *yythd) state = MY_LEX_START; // Try again break; case MY_LEX_LONG_COMMENT: /* Long C comment? */ + { + char *version_mark= NULL; + if (yyPeek() != '*') { state=MY_LEX_CHAR; // Probable division @@ -956,6 +959,8 @@ int MYSQLlex(void *arg, void *yythd) if (yyPeek() == '!') // MySQL command in comment { ulong version=MYSQL_VERSION_ID; + version_mark= lip->ptr; + yySkip(); state=MY_LEX_START; if (my_isdigit(cs,yyPeek())) @@ -964,9 +969,18 @@ int MYSQLlex(void *arg, void *yythd) } if (version <= MYSQL_VERSION_ID) { - lex->in_comment=1; + lex->in_comment=1; + version_mark= NULL; break; } + else + { + /* + Patch and skip the conditional comment to avoid it + being propagated infinitely (eg. to a slave). + */ + *version_mark= ' '; + } } /* Discard: @@ -995,8 +1009,13 @@ int MYSQLlex(void *arg, void *yythd) } /* Unbalanced comments with a missing '*' '/' are a syntax error */ if (! comment_closed) + { + if (version_mark != NULL) + *version_mark= '!'; return (ABORT_SYM); + } break; + } case MY_LEX_END_LONG_COMMENT: if (lex->in_comment && yyPeek() == '/') { diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 5c0367632e1..7a315d81aa5 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -935,7 +935,7 @@ struct st_parsing_options class Lex_input_stream { public: - Lex_input_stream(THD *thd, const char* buff, unsigned int length); + Lex_input_stream(THD *thd, char* buff, unsigned int length); ~Lex_input_stream(); /** Current thread. */ @@ -951,7 +951,7 @@ public: LEX_YYSTYPE yylval; /** Pointer to the current position in the input stream. */ - const char* ptr; + char* ptr; /** Starting position of the last token parsed. */ const char* tok_start; @@ -966,7 +966,7 @@ public: const char* tok_start_prev; /** Begining of the query text in the input stream. */ - const char* buf; + char* buf; /** Current state of the lexical analyser. */ enum my_lex_states next_state; @@ -1355,7 +1355,7 @@ public: class Parser_state { public: - Parser_state(THD *thd, const char* buff, unsigned int length) + Parser_state(THD *thd, char* buff, unsigned int length) : m_lip(thd, buff, length), m_yacc() {} diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 1bd68e5424f..0f75b835315 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -6414,13 +6414,13 @@ void mysql_init_multi_delete(LEX *lex) /** Parse a query. @param thd Current thread - @param inBuf Begining of the query text + @param rawbuf Begining of the query text @param length Length of the query text @param [out] semicolon For multi queries, position of the character of the next query in the query text. */ -void mysql_parse(THD *thd, const char *inBuf, uint length, +void mysql_parse(THD *thd, char *rawbuf, uint length, const char ** found_semicolon) { DBUG_ENTER("mysql_parse"); @@ -6446,14 +6446,14 @@ void mysql_parse(THD *thd, const char *inBuf, uint length, lex_start(thd); mysql_reset_thd_for_next_command(thd); - if (query_cache_send_result_to_client(thd, (char*) inBuf, length) <= 0) + if (query_cache_send_result_to_client(thd, rawbuf, length) <= 0) { LEX *lex= thd->lex; sp_cache_flush_obsolete(&thd->sp_proc_cache); sp_cache_flush_obsolete(&thd->sp_func_cache); - Parser_state parser_state(thd, inBuf, length); + Parser_state parser_state(thd, rawbuf, length); thd->m_parser_state= &parser_state; int err= MYSQLparse(thd); @@ -6538,13 +6538,13 @@ void mysql_parse(THD *thd, const char *inBuf, uint length, 1 can be ignored */ -bool mysql_test_parse_for_slave(THD *thd, char *inBuf, uint length) +bool mysql_test_parse_for_slave(THD *thd, char *rawbuf, uint length) { LEX *lex= thd->lex; bool error= 0; DBUG_ENTER("mysql_test_parse_for_slave"); - Parser_state parser_state(thd, inBuf, length); + Parser_state parser_state(thd, rawbuf, length); thd->m_parser_state= &parser_state; lex_start(thd); From 44d23cdbc0ecd9efa570cfa58abd0543782995ef Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Sun, 16 Jan 2011 02:04:08 +0530 Subject: [PATCH 07/23] Bug#58221 : mysqladmin --sleep=x --count=x keeps looping When mysqldadmin is run with sleep and count options, it goes into an infinite loop and keeps executing the specified command. This happened because the statement, responsible for decrementing the count value, was missing. Fixed by adding a statement which will decrement the count value for each iteration. --- client/mysqladmin.cc | 3 +++ mysql-test/r/mysqladmin.result | 8 ++++++++ mysql-test/t/mysqladmin.test | 12 ++++++++++++ 3 files changed, 23 insertions(+) diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index fe3e51a4d61..18ee8fae400 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -416,6 +416,9 @@ int main(int argc,char *argv[]) if (interval) /* --sleep=interval given */ { + if (opt_count_iterations && --nr_iterations == 0) + break; + /* If connection was dropped (unintentionally, or due to SHUTDOWN), re-establish it if --wait ("retry-connect") was given and user diff --git a/mysql-test/r/mysqladmin.result b/mysql-test/r/mysqladmin.result index 57927f8aa67..748152bffcc 100644 --- a/mysql-test/r/mysqladmin.result +++ b/mysql-test/r/mysqladmin.result @@ -2,3 +2,11 @@ mysqld is alive mysqladmin: unknown variable 'database=db1' Warning: mysqladmin: unknown variable 'loose-database=db2' mysqld is alive +# +# Bug#58221 : mysqladmin --sleep=x --count=x keeps looping +# +# Executing mysqladmin with --sleep=1 and --count=2. +# Done. +# Displaying the output : +mysqld is alive +mysqld is alive diff --git a/mysql-test/t/mysqladmin.test b/mysql-test/t/mysqladmin.test index 839ecf00b60..a2b12dbc9b6 100644 --- a/mysql-test/t/mysqladmin.test +++ b/mysql-test/t/mysqladmin.test @@ -33,3 +33,15 @@ EOF --exec $MYSQLADMIN --defaults-file=$MYSQLTEST_VARDIR/tmp/bug10608.cnf -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1 remove_file $MYSQLTEST_VARDIR/tmp/bug10608.cnf; + +--echo # +--echo # Bug#58221 : mysqladmin --sleep=x --count=x keeps looping +--echo # + +--echo # Executing mysqladmin with --sleep=1 and --count=2. +--exec $MYSQLADMIN -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT --sleep=1 --count=2 ping > $MYSQLTEST_VARDIR/tmp/mysqladmin.tmp +--echo # Done. +--echo # Displaying the output : +--cat_file $MYSQLTEST_VARDIR/tmp/mysqladmin.tmp + +--remove_file $MYSQLTEST_VARDIR/tmp/mysqladmin.tmp From 1c9515f61689e1e5c6d8622e8843552b3afa3ce1 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 17 Jan 2011 12:30:22 +0300 Subject: [PATCH 08/23] Bug#59149 valgrind warnings with "like .. escape .." function Problem: when processing a query like: SELECT '' LIKE '1' ESCAPE COUNT(1); escape_item->val_str() was never executed and the "escape" class member stayed initialized, which led to valgrind uninitialized memory error. Note, a query with some tables in "FROM" clause returns ER_WRONG_ARGUMENTS in the same situation: SELECT '' LIKE '1' ESCAPE COUNT(1) FROM t1; ERROR 1210 (HY000): Incorrect arguments to ESCAPE Fix: disallowing using aggregate functions in ESCAPE clause, even if there are no tables used. There is no much use of that anyway. --- mysql-test/r/func_like.result | 5 +++++ mysql-test/t/func_like.test | 5 +++++ sql/item_sum.h | 1 + 3 files changed, 11 insertions(+) diff --git a/mysql-test/r/func_like.result b/mysql-test/r/func_like.result index 21da211160b..76174982e8e 100644 --- a/mysql-test/r/func_like.result +++ b/mysql-test/r/func_like.result @@ -182,4 +182,9 @@ INSERT INTO t2 VALUES (1), (2), (3); SELECT 1 FROM t2 JOIN t1 ON 1 LIKE a GROUP BY a; 1 DROP TABLE t1, t2; +# +# Bug#59149 valgrind warnings with "like .. escape .." function +# +SELECT '' LIKE '1' ESCAPE COUNT(1); +ERROR HY000: Incorrect arguments to ESCAPE End of 5.1 tests diff --git a/mysql-test/t/func_like.test b/mysql-test/t/func_like.test index 1204d04d9a0..f1fe52274b2 100644 --- a/mysql-test/t/func_like.test +++ b/mysql-test/t/func_like.test @@ -126,5 +126,10 @@ INSERT INTO t2 VALUES (1), (2), (3); SELECT 1 FROM t2 JOIN t1 ON 1 LIKE a GROUP BY a; DROP TABLE t1, t2; +--echo # +--echo # Bug#59149 valgrind warnings with "like .. escape .." function +--echo # +--error ER_WRONG_ARGUMENTS +SELECT '' LIKE '1' ESCAPE COUNT(1); --echo End of 5.1 tests diff --git a/sql/item_sum.h b/sql/item_sum.h index de988c196ec..f8819d63bf4 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -339,6 +339,7 @@ public: forced_const= TRUE; } virtual bool const_item() const { return forced_const; } + virtual bool const_during_execution() const { return false; } virtual void print(String *str, enum_query_type query_type); void fix_num_length_and_dec(); From 18e4f23a8809a8dbeee7cf225b958991a476d1b5 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Mon, 17 Jan 2011 15:11:33 +0300 Subject: [PATCH 09/23] Bug#58371 Assertion failed: !s.uses_buffer_owned_by(this) with format string function Introduced by the fix for bug#44766. Problem: it's not correct to use args[0]->str_value as a buffer, because args[0] may need this buffer for its own purposes. Fix: adding a new class member tmp_value to use as return value. @ mysql-test/r/ctype_many.result @ mysql-test/t/ctype_many.test Adding tests @ sql/item_strfunc.cc Changing code into traditional style: use "str" as a buffer for the argument and tmp_value for the result value. @ sql/item_strfunc.h Adding tmp_value --- mysql-test/r/ctype_many.result | 15 +++++++++++++++ mysql-test/t/ctype_many.test | 16 ++++++++++++++++ sql/item_strfunc.cc | 12 +++--------- sql/item_strfunc.h | 1 + 4 files changed, 35 insertions(+), 9 deletions(-) diff --git a/mysql-test/r/ctype_many.result b/mysql-test/r/ctype_many.result index 89e05bf4484..dbec746cdae 100644 --- a/mysql-test/r/ctype_many.result +++ b/mysql-test/r/ctype_many.result @@ -1683,3 +1683,18 @@ ARMENIAN CAPIT DA 2 ARMENIAN CAPIT ECH 2 ARMENIAN CAPIT ZA 2 DROP TABLE t1; +# +# Start of 5.1 tests +# +# +# Bug#58371 Assertion failed: !s.uses_buffer_owned_by(this) with format string function +# +SET NAMES latin1; +DO CONVERT(CAST(SUBSTRING_INDEX(FORMAT(1,'1111'), FORMAT('','Zpq'),1) +AS BINARY(0)) USING utf8); +Warnings: +Warning 1292 Truncated incorrect INTEGER value: 'Zpq' +Warning 1292 Truncated incorrect BINARY(0) value: '1.' +# +# End of 5.1 tests +# diff --git a/mysql-test/t/ctype_many.test b/mysql-test/t/ctype_many.test index 0903c3dd7fa..84048761228 100644 --- a/mysql-test/t/ctype_many.test +++ b/mysql-test/t/ctype_many.test @@ -211,3 +211,19 @@ SELECT min(comment),count(*) FROM t1 GROUP BY ucs2_f; DROP TABLE t1; # End of 4.1 tests + + +--echo # +--echo # Start of 5.1 tests +--echo # + +--echo # +--echo # Bug#58371 Assertion failed: !s.uses_buffer_owned_by(this) with format string function +--echo # + +SET NAMES latin1; +DO CONVERT(CAST(SUBSTRING_INDEX(FORMAT(1,'1111'), FORMAT('','Zpq'),1) + AS BINARY(0)) USING utf8); +--echo # +--echo # End of 5.1 tests +--echo # diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 204a2dfc663..c637c9c29b8 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -2761,22 +2761,16 @@ String *Item_func_conv_charset::val_str(String *str) DBUG_ASSERT(fixed == 1); if (use_cached_value) return null_value ? 0 : &str_value; - /* - Here we don't pass 'str' as a parameter to args[0]->val_str() - as 'str' may point to 'str_value' (e.g. see Item::save_in_field()), - which we use below to convert string. - Use argument's 'str_value' instead. - */ - String *arg= args[0]->val_str(&args[0]->str_value); + String *arg= args[0]->val_str(str); uint dummy_errors; if (!arg) { null_value=1; return 0; } - null_value= str_value.copy(arg->ptr(),arg->length(),arg->charset(), + null_value= tmp_value.copy(arg->ptr(), arg->length(), arg->charset(), conv_charset, &dummy_errors); - return null_value ? 0 : check_well_formed_result(&str_value); + return null_value ? 0 : check_well_formed_result(&tmp_value); } void Item_func_conv_charset::fix_length_and_dec() diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index 6645a4c637a..408062ddc08 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -713,6 +713,7 @@ public: class Item_func_conv_charset :public Item_str_func { bool use_cached_value; + String tmp_value; public: bool safe; CHARSET_INFO *conv_charset; // keep it public From f25ab9fe22cd7823a65fd186aa0e6d4d2ea9be91 Mon Sep 17 00:00:00 2001 From: Vinay Fisrekar Date: Tue, 18 Jan 2011 09:24:52 +0530 Subject: [PATCH 10/23] BUG#58858 : sys_vars.innodb_max_dirty_pages_pct_func fails sporadically Committing After latest merge. Modified check_pct procedure to check return value of wait condition instead of calling "dirty_pct". Adding Review comments: 1) Added comment for success variable value 2) Procedure check_pct changed For Adding BOOLEAN input and SELECT QUERY Change --- .../sys_vars/r/innodb_max_dirty_pages_pct_func.result | 8 ++++---- .../sys_vars/t/innodb_max_dirty_pages_pct_func.test | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result b/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result index baf06092126..55de5adbc33 100644 --- a/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result +++ b/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result @@ -64,12 +64,12 @@ SET last = pct; END IF; END WHILE; END// -CREATE PROCEDURE check_pct(IN num DECIMAL) +CREATE PROCEDURE check_pct(IN success_on_wait BOOLEAN) BEGIN -IF (dirty_pct() < num) THEN +IF (success_on_wait > 0) THEN SELECT 'BELOW_MAX' AS PCT_VALUE; ELSE -SELECT 'ABOVE_MAX' AS PCT_VALUE; +SELECT 'ABOVE_MAX or TimeOut Of The Test' AS PCT_VALUE; END IF; END// CREATE TABLE t1( @@ -83,7 +83,7 @@ CALL add_until(10); FLUSH TABLES; CALL add_records(500); 'We expect dirty pages pct to be BELOW_MAX after some time depending on performance' -CALL check_pct(10); +CALL check_pct(1); PCT_VALUE BELOW_MAX DROP PROCEDURE add_records; diff --git a/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test b/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test index b577ae5fcc4..c7a9e567e69 100644 --- a/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test +++ b/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test @@ -117,12 +117,12 @@ BEGIN END WHILE; END// -CREATE PROCEDURE check_pct(IN num DECIMAL) +CREATE PROCEDURE check_pct(IN success_on_wait BOOLEAN) BEGIN - IF (dirty_pct() < num) THEN + IF (success_on_wait > 0) THEN SELECT 'BELOW_MAX' AS PCT_VALUE; ELSE - SELECT 'ABOVE_MAX' AS PCT_VALUE; + SELECT 'ABOVE_MAX or TimeOut Of The Test' AS PCT_VALUE; END IF; END// @@ -155,7 +155,8 @@ let $wait_condition= SELECT (dirty_pct() <= @@global.innodb_max_dirty_pages_pct) --source include/wait_condition.inc --echo 'We expect dirty pages pct to be BELOW_MAX after some time depending on performance' -CALL check_pct(10); +# Value For $sucess will be set from include/wait_condition.inc file. It can have values 1 or 0. It will be 1 if dirty_pct() <= @@global.innodb_max_dirty_pages_pct else it will be 0. +eval CALL check_pct($success); DROP PROCEDURE add_records; DROP PROCEDURE add_until; DROP PROCEDURE check_pct; From cf0e22fe757c817d58ff2f403dd9718a51561fd0 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Tue, 18 Jan 2011 09:38:41 +0300 Subject: [PATCH 11/23] Bug#44332 my_xml_scan reads behind the end of buffer Problem: the scanner function tested for strings "" without checking input string boundaries, which led to valgrind's "Conditional jump or move depends on uninitialised value(s)" error. Fix: Adding boundary checking. @ mysql-test/r/xml.result @ mysql-test/t/xml.test Adding test @ strings/xml.c Adding a helper function my_xml_parser_prefix_cmp(), with input string boundary check. --- mysql-test/r/xml.result | 11 +++++++++++ mysql-test/t/xml.test | 5 +++++ strings/xml.c | 23 +++++++++++++++++------ 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/xml.result b/mysql-test/r/xml.result index 92f84381415..0a71a596505 100644 --- a/mysql-test/r/xml.result +++ b/mysql-test/r/xml.result @@ -1113,4 +1113,15 @@ SELECT UPDATEXML(NULL, (LPAD(0.1111E-15, '2011', 1)), 1); ERROR 22007: Illegal double '111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111' value found during parsing SELECT EXTRACTVALUE('', LPAD(0.1111E-15, '2011', 1)); ERROR 22007: Illegal double '111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111' value found during parsing +# +# Bug #44332 my_xml_scan reads behind the end of buffer +# +SELECT UPDATEXML(CONVERT(_latin1'<' USING utf8),'1','1'); +UPDATEXML(CONVERT(_latin1'<' USING utf8),'1','1') +NULL +Warnings: +Warning 1525 Incorrect XML value: 'parse error at line 1 pos 2: END-OF-INPUT unexpected (ident or '/' wanted)' +SELECT UPDATEXML(CONVERT(_latin1'", 3); p->cur++) - {} - if (!memcmp(p->cur, "-->", 3)) - p->cur+=3; + for (; p->cur < p->end; p->cur++) + { + if (!my_xml_parser_prefix_cmp(p, C_STRING_WITH_LEN("-->"))) + { + p->cur+= 3; + break; + } + } a->end=p->cur; lex=MY_XML_COMMENT; } - else if (!memcmp(p->cur, "cur+= 9; for (; p->cur < p->end - 2 ; p->cur++) From 097445ebf51f3948bece93b28e0efbb9e92482cd Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Tue, 18 Jan 2011 11:03:44 +0100 Subject: [PATCH 12/23] Fixed copyright headers in mtr src files --- client/mysqltest.cc | 4 ++-- mysql-test/Makefile.am | 9 ++++----- mysql-test/lib/My/ConfigFactory.pm | 16 ++++++++++++++++ mysql-test/lib/My/CoreDump.pm | 2 +- mysql-test/lib/My/File/Path.pm | 15 +++++++++++++++ mysql-test/lib/My/Find.pm | 2 +- mysql-test/lib/My/Options.pm | 2 +- mysql-test/lib/My/Platform.pm | 2 +- mysql-test/lib/My/SafeProcess.pm | 13 +++++++------ mysql-test/lib/My/SafeProcess/Base.pm | 2 +- mysql-test/lib/My/SafeProcess/CMakeLists.txt | 2 +- mysql-test/lib/My/SafeProcess/Makefile.am | 2 +- .../lib/My/SafeProcess/safe_kill_win.cc | 2 +- mysql-test/lib/My/SafeProcess/safe_process.cc | 2 +- .../lib/My/SafeProcess/safe_process_win.cc | 2 +- mysql-test/lib/My/SysInfo.pm | 2 +- mysql-test/lib/My/Test.pm | 14 ++++++++++++++ mysql-test/lib/mtr_misc.pl | 19 ++++++++++--------- mysql-test/lib/mtr_report.pm | 2 +- mysql-test/mysql-stress-test.pl | 9 ++++----- mysql-test/mysql-test-run.pl | 7 +++---- mysql-test/valgrind.supp | 9 ++++----- 22 files changed, 91 insertions(+), 48 deletions(-) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index feed964c2fa..9421e80de2d 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -11,7 +11,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* mysqltest diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index ced8b894a6d..f3b4343f9a0 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2000-2006 MySQL AB +# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public @@ -10,10 +10,9 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # -# You should have received a copy of the GNU Library General Public -# License along with this library; if not, write to the Free -# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -# MA 02111-1307, USA +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ## Process this file with automake to create Makefile.in diff --git a/mysql-test/lib/My/ConfigFactory.pm b/mysql-test/lib/My/ConfigFactory.pm index 342390edef8..bb990a9f8d2 100644 --- a/mysql-test/lib/My/ConfigFactory.pm +++ b/mysql-test/lib/My/ConfigFactory.pm @@ -1,4 +1,20 @@ # -*- cperl -*- +# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; version 2 +# of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + package My::ConfigFactory; use strict; diff --git a/mysql-test/lib/My/CoreDump.pm b/mysql-test/lib/My/CoreDump.pm index 3ac9e385070..c0f6535b96e 100644 --- a/mysql-test/lib/My/CoreDump.pm +++ b/mysql-test/lib/My/CoreDump.pm @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright (C) 2004-2006 MySQL AB +# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-test/lib/My/File/Path.pm b/mysql-test/lib/My/File/Path.pm index 25a26568eee..d1ac2b432ac 100644 --- a/mysql-test/lib/My/File/Path.pm +++ b/mysql-test/lib/My/File/Path.pm @@ -1,4 +1,19 @@ # -*- cperl -*- +# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + package My::File::Path; use strict; diff --git a/mysql-test/lib/My/Find.pm b/mysql-test/lib/My/Find.pm index 8557584bbc8..9c89a7e4e2a 100644 --- a/mysql-test/lib/My/Find.pm +++ b/mysql-test/lib/My/Find.pm @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright (C) 2004-2006 MySQL AB +# Copyright (C) 2008 MySQL AB # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-test/lib/My/Options.pm b/mysql-test/lib/My/Options.pm index 40f05c41d1c..6e8cf7ec919 100644 --- a/mysql-test/lib/My/Options.pm +++ b/mysql-test/lib/My/Options.pm @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright (C) 2004-2006 MySQL AB +# Copyright (C) 2008 MySQL AB # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-test/lib/My/Platform.pm b/mysql-test/lib/My/Platform.pm index 371120ab644..cbe8f929d71 100644 --- a/mysql-test/lib/My/Platform.pm +++ b/mysql-test/lib/My/Platform.pm @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright (C) 2004-2006 MySQL AB +# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-test/lib/My/SafeProcess.pm b/mysql-test/lib/My/SafeProcess.pm index a4ae988ed9e..9334d97f665 100644 --- a/mysql-test/lib/My/SafeProcess.pm +++ b/mysql-test/lib/My/SafeProcess.pm @@ -1,14 +1,15 @@ # -*- cperl -*- -# Copyright (C) 2004-2006 MySQL AB +# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. # -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; version 2 +# of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software diff --git a/mysql-test/lib/My/SafeProcess/Base.pm b/mysql-test/lib/My/SafeProcess/Base.pm index 9a6871264b8..c0c70e48082 100644 --- a/mysql-test/lib/My/SafeProcess/Base.pm +++ b/mysql-test/lib/My/SafeProcess/Base.pm @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright (C) 2004-2006 MySQL AB +# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-test/lib/My/SafeProcess/CMakeLists.txt b/mysql-test/lib/My/SafeProcess/CMakeLists.txt index 97fab820f95..5150fcaafff 100644 --- a/mysql-test/lib/My/SafeProcess/CMakeLists.txt +++ b/mysql-test/lib/My/SafeProcess/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2006 MySQL AB +# Copyright (C) 2008 MySQL AB # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-test/lib/My/SafeProcess/Makefile.am b/mysql-test/lib/My/SafeProcess/Makefile.am index 722331453fe..eb665240190 100644 --- a/mysql-test/lib/My/SafeProcess/Makefile.am +++ b/mysql-test/lib/My/SafeProcess/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2000-2006 MySQL AB +# Copyright (C) 2008 MySQL AB # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-test/lib/My/SafeProcess/safe_kill_win.cc b/mysql-test/lib/My/SafeProcess/safe_kill_win.cc index 963a02c8099..9b013b960bf 100755 --- a/mysql-test/lib/My/SafeProcess/safe_kill_win.cc +++ b/mysql-test/lib/My/SafeProcess/safe_kill_win.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2004 MySQL AB +/* Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/mysql-test/lib/My/SafeProcess/safe_process.cc b/mysql-test/lib/My/SafeProcess/safe_process.cc index 1c778362975..477beca0ada 100644 --- a/mysql-test/lib/My/SafeProcess/safe_process.cc +++ b/mysql-test/lib/My/SafeProcess/safe_process.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2008 MySQL AB +/* Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/mysql-test/lib/My/SafeProcess/safe_process_win.cc b/mysql-test/lib/My/SafeProcess/safe_process_win.cc index 896bd599f4f..931705e1911 100755 --- a/mysql-test/lib/My/SafeProcess/safe_process_win.cc +++ b/mysql-test/lib/My/SafeProcess/safe_process_win.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2004 MySQL AB +/* Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/mysql-test/lib/My/SysInfo.pm b/mysql-test/lib/My/SysInfo.pm index f1ba5fb610f..b8569e415e8 100644 --- a/mysql-test/lib/My/SysInfo.pm +++ b/mysql-test/lib/My/SysInfo.pm @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright (C) 2004-2006 MySQL AB +# Copyright (C) 2008 MySQL AB # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-test/lib/My/Test.pm b/mysql-test/lib/My/Test.pm index 68b100f91af..c756a677052 100644 --- a/mysql-test/lib/My/Test.pm +++ b/mysql-test/lib/My/Test.pm @@ -1,4 +1,18 @@ # -*- cperl -*- +# Copyright (C) 2008 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl index 32960d866ce..1b988f42242 100644 --- a/mysql-test/lib/mtr_misc.pl +++ b/mysql-test/lib/mtr_misc.pl @@ -1,15 +1,16 @@ # -*- cperl -*- -# Copyright (C) 2004-2006 MySQL AB -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; version 2 +# of the License. +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm index 42d93022392..0090316cf7b 100644 --- a/mysql-test/lib/mtr_report.pm +++ b/mysql-test/lib/mtr_report.pm @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright 2004-2008 MySQL AB, 2008 Sun Microsystems, Inc. +# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-test/mysql-stress-test.pl b/mysql-test/mysql-stress-test.pl index 06954de38ca..2db8b748d5c 100755 --- a/mysql-test/mysql-stress-test.pl +++ b/mysql-test/mysql-stress-test.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl -# Copyright (C) 2005, 2006 MySQL AB +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public @@ -12,10 +12,9 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # -# You should have received a copy of the GNU Library General Public -# License along with this library; if not, write to the Free -# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -# MA 02111-1307, USA +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # ====================================================================== # MySQL server stress test system diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index e10c1116f2c..ebf3976033b 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -13,10 +13,9 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # -# You should have received a copy of the GNU Library General Public -# License along with this library; if not, write to the Free -# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -# MA 02111-1307, USA +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # ############################################################################## diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp index 24ce2e22e54..1016923a360 100644 --- a/mysql-test/valgrind.supp +++ b/mysql-test/valgrind.supp @@ -1,4 +1,4 @@ -# Copyright (C) 2005, 2008 MySQL AB +# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public @@ -10,10 +10,9 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # -# You should have received a copy of the GNU Library General Public -# License along with this library; if not, write to the Free -# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -# MA 02111-1307, USA +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # Suppress some common (not fatal) errors in system libraries found by valgrind From 89aa03aea6f98ede4c73ce4019c61cff939ea83c Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Tue, 18 Jan 2011 12:01:40 +0100 Subject: [PATCH 13/23] Some more copyright fixes in mtr --- mysql-test/lib/mtr_gcov.pl | 2 +- mysql-test/lib/mtr_io.pl | 2 +- mysql-test/lib/mtr_match.pm | 2 +- mysql-test/lib/mtr_stress.pl | 2 +- mysql-test/lib/mtr_unique.pm | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mysql-test/lib/mtr_gcov.pl b/mysql-test/lib/mtr_gcov.pl index f531889b08d..d8fb1c0a07d 100644 --- a/mysql-test/lib/mtr_gcov.pl +++ b/mysql-test/lib/mtr_gcov.pl @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright (C) 2004, 2006 MySQL AB +# Copyright (C) 2004, 2006 MySQL AB, 2009 Sun Microsystems, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-test/lib/mtr_io.pl b/mysql-test/lib/mtr_io.pl index 21581798ddc..6a6b3a3d028 100644 --- a/mysql-test/lib/mtr_io.pl +++ b/mysql-test/lib/mtr_io.pl @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright (C) 2004-2006 MySQL AB +# Copyright (C) 2004-2007 MySQL AB, 2008 Sun Microsystems, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-test/lib/mtr_match.pm b/mysql-test/lib/mtr_match.pm index 40afd4e0336..6fc9832ac43 100644 --- a/mysql-test/lib/mtr_match.pm +++ b/mysql-test/lib/mtr_match.pm @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright (C) 2004-2006 MySQL AB +# Copyright (C) 2004-2008 MySQL AB # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-test/lib/mtr_stress.pl b/mysql-test/lib/mtr_stress.pl index 702bc178ae5..ab4214791d0 100644 --- a/mysql-test/lib/mtr_stress.pl +++ b/mysql-test/lib/mtr_stress.pl @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright (C) 2006 MySQL AB +# Copyright (C) 2004-2007 MySQL AB, 2009 Sun Microsystems, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/mysql-test/lib/mtr_unique.pm b/mysql-test/lib/mtr_unique.pm index 6b60157422d..506af448266 100644 --- a/mysql-test/lib/mtr_unique.pm +++ b/mysql-test/lib/mtr_unique.pm @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright (C) 2006 MySQL AB +# Copyright (C) 2006-2008 MySQL AB, 2009 Sun Microsystems, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by From 813af29b73d9d9147e1f415778387d5be6bbe7b5 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Tue, 18 Jan 2011 12:11:52 +0100 Subject: [PATCH 14/23] oops forgot one file in last commit --- mysql-test/lib/mtr_gprof.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/lib/mtr_gprof.pl b/mysql-test/lib/mtr_gprof.pl index 5820a4007b8..a5e05b28723 100644 --- a/mysql-test/lib/mtr_gprof.pl +++ b/mysql-test/lib/mtr_gprof.pl @@ -1,5 +1,5 @@ # -*- cperl -*- -# Copyright (C) 2004 MySQL AB +# Copyright (C) 2004 MySQL AB, 2009 Sun Microsystems, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by From 9c7abc25495b4e454184be4f571cf464526c473e Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Tue, 18 Jan 2011 12:25:07 +0100 Subject: [PATCH 15/23] Bug #59063 rpl_migration_crash_safe fails on Windows Undoing the patch, it complicates the code but is not the solution I do not beleive newline mismatch could be the cause of this failure First, I cannot see how this could be a problem, mtr ignores the newline when reading the expect file, and the file is written and read on Windows. Second, if this really was the problem it should have been deterministic: either the newline is correctly interepreted or it is not. --- mysql-test/include/rpl_start_server.inc | 10 +--------- mysql-test/include/rpl_stop_server.inc | 4 +--- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/mysql-test/include/rpl_start_server.inc b/mysql-test/include/rpl_start_server.inc index ac8106f141c..c59c7759910 100644 --- a/mysql-test/include/rpl_start_server.inc +++ b/mysql-test/include/rpl_start_server.inc @@ -45,15 +45,7 @@ if ($rpl_server_parameters) --source include/rpl_connection.inc # Write file to make mysql-test-run.pl start up the server again ---let WRITE_TO_FILE= $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect ---let WRITE_TO_VAR= $_rpl_start_server_command -perl; -my $file= $ENV{'WRITE_TO_FILE'}; -my $var= $ENV{'WRITE_TO_VAR'}; -open WRITE_FILE, ">> $file" or die "Error opening $file: $!"; -print WRITE_FILE $var, "\n" or die "Error appending to $file: $!"; -close WRITE_FILE or die "Error closing $file: $!"; -EOF +--exec echo "$_rpl_start_server_command" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect --source include/rpl_reconnect.inc diff --git a/mysql-test/include/rpl_stop_server.inc b/mysql-test/include/rpl_stop_server.inc index a90981d6de8..e1f8839dd69 100644 --- a/mysql-test/include/rpl_stop_server.inc +++ b/mysql-test/include/rpl_stop_server.inc @@ -44,9 +44,7 @@ if ($rpl_debug) # Write file to make mysql-test-run.pl expect the "crash", but don't start # it until it's told to ---append_file $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect -wait -EOF +--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.$rpl_server_number.expect # Send shutdown to the connected server and give # it 10 seconds to die before zapping it From 5d75729c928338c2b49752b9b271ff7eb9a261ec Mon Sep 17 00:00:00 2001 From: Libing Song Date: Wed, 19 Jan 2011 01:23:49 +0800 Subject: [PATCH 16/23] Bug#58546 test rpl_packet timeout failure sporadically on PB rpl_packet got a timeout failure sporadically on PB when stopping slave. The real reason of this bug is that STOP SLAVE stopped IO thread first and then stopped SQL thread. It was possible that IO thread stopped after replicating part of a transaction which SQL thread was executing. SQL thread would be hung if the transaction could not be rolled back safely. After this patch, STOP SLAVE will stop SQL thread first and then stop IO thread, which guarantees that IO thread will fetch the reset of the events of the transaction that SQL thread is executing, so that SQL thread can finish the transaction if it cannot be rolled back safely. Added below auxiliary files to make the test code neater. restart_slave_sql.inc rpl_connection_master.inc rpl_connection_slave.inc rpl_connection_slave1.inc --- mysql-test/include/restart_slave_sql.inc | 43 +++++++++++++ mysql-test/include/rpl_connection_master.inc | 2 + mysql-test/include/rpl_connection_slave.inc | 2 + mysql-test/include/rpl_connection_slave1.inc | 2 + mysql-test/suite/rpl/r/rpl_stop_slave.result | 42 +++++++++++++ mysql-test/suite/rpl/t/rpl_packet.test | 2 +- mysql-test/suite/rpl/t/rpl_stop_slave.test | 64 +++++++++++++++++++- sql/slave.cc | 22 +++---- sql/sql_repl.cc | 23 +++++++ 9 files changed, 189 insertions(+), 13 deletions(-) create mode 100644 mysql-test/include/restart_slave_sql.inc create mode 100644 mysql-test/include/rpl_connection_master.inc create mode 100644 mysql-test/include/rpl_connection_slave.inc create mode 100644 mysql-test/include/rpl_connection_slave1.inc diff --git a/mysql-test/include/restart_slave_sql.inc b/mysql-test/include/restart_slave_sql.inc new file mode 100644 index 00000000000..ee6c6d7ced6 --- /dev/null +++ b/mysql-test/include/restart_slave_sql.inc @@ -0,0 +1,43 @@ +# ==== Purpose ==== +# +# Provide a earier way to restart SQL thread when you want to stop sql thread +# and then start it immediately. +# +# Sources stop_slave_sql.inc to stop SQL thread on the current connection. +# Then issues START SLAVE SQL_THREAD and then waits until +# the SQL threads have started, or until a timeout is reached. +# +# Please use this instead of 'STOP|START SLAVE SQL_THREAD', to reduce the risk of +# test case bugs. +# +# +# ==== Usage ==== +# +# [--let $slave_timeout= NUMBER] +# [--let $rpl_debug= 1] +# --source include/restart_slave_sql.inc +# +# Parameters: +# $slave_timeout +# See include/wait_for_slave_param.inc +# +# $rpl_debug +# See include/rpl_init.inc + + +--let $include_filename= restart_slave.inc +--source include/begin_include_file.inc + + +if (!$rpl_debug) +{ + --disable_query_log +} + +source include/stop_slave_sql.inc; +START SLAVE SQL_THREAD; +source include/wait_for_slave_sql_to_start.inc; + + +--let $include_filename= restart_slave.inc +--source include/end_include_file.inc \ No newline at end of file diff --git a/mysql-test/include/rpl_connection_master.inc b/mysql-test/include/rpl_connection_master.inc new file mode 100644 index 00000000000..e54e34071c8 --- /dev/null +++ b/mysql-test/include/rpl_connection_master.inc @@ -0,0 +1,2 @@ +let $rpl_connection_name= master; +source include/rpl_connection.inc; \ No newline at end of file diff --git a/mysql-test/include/rpl_connection_slave.inc b/mysql-test/include/rpl_connection_slave.inc new file mode 100644 index 00000000000..ef3876394d6 --- /dev/null +++ b/mysql-test/include/rpl_connection_slave.inc @@ -0,0 +1,2 @@ +let $rpl_connection_name= slave; +source include/rpl_connection.inc; \ No newline at end of file diff --git a/mysql-test/include/rpl_connection_slave1.inc b/mysql-test/include/rpl_connection_slave1.inc new file mode 100644 index 00000000000..8aee6defbdd --- /dev/null +++ b/mysql-test/include/rpl_connection_slave1.inc @@ -0,0 +1,2 @@ +let $rpl_connection_name= slave1; +source include/rpl_connection.inc; \ No newline at end of file diff --git a/mysql-test/suite/rpl/r/rpl_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stop_slave.result index 2e9522e8947..ff0061f264b 100644 --- a/mysql-test/suite/rpl/r/rpl_stop_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stop_slave.result @@ -128,5 +128,47 @@ START SLAVE SQL_THREAD; include/wait_for_slave_sql_to_start.inc # Test end SET GLOBAL debug= '$debug_save'; +include/restart_slave.inc +[connection master] DROP TABLE t1, t2; + +# Bug#58546 test rpl_packet timeout failure sporadically on PB +# ---------------------------------------------------------------------- +# STOP SLAVE stopped IO thread first and then stopped SQL thread. It was +# possible that IO thread stopped after replicating part of a transaction +# which SQL thread was executing. SQL thread would be hung if the +# transaction could not be rolled back safely. +# It caused some sporadic failures on PB2. +# +# This test verifies that when 'STOP SLAVE' is issued by a user, IO +# thread will continue to fetch the rest events of the transaction which +# is being executed by SQL thread and is not able to be rolled back safely. +CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB; +CREATE TABLE t2 (c1 INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES(1, 1); +SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid'; +[connection slave] +include/restart_slave.inc +BEGIN; +UPDATE t1 SET c2 = 2 WHERE c1 = 1; +[connection master] +BEGIN; +INSERT INTO t1 VALUES(2, 2); +INSERT INTO t2 VALUES(1); +UPDATE t1 SET c2 = 3 WHERE c1 = 1; +COMMIT; +[connection slave1] +STOP SLAVE; +[connection slave] +ROLLBACK; +[connection master] +SET DEBUG_SYNC= 'now SIGNAL signal.continue'; +SET DEBUG_SYNC= 'RESET'; +[connection slave] +include/wait_for_slave_to_stop.inc +[connection slave1] +include/start_slave.inc +[connection master] +DROP TABLE t1, t2; +SET GLOBAL debug= $debug_save; include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test index b11bd0a227e..3197b6160cd 100644 --- a/mysql-test/suite/rpl/t/rpl_packet.test +++ b/mysql-test/suite/rpl/t/rpl_packet.test @@ -26,8 +26,8 @@ let $old_net_buffer_length= `SELECT @@global.net_buffer_length`; SET @@global.max_allowed_packet=1024; SET @@global.net_buffer_length=1024; +sync_slave_with_master; # Restart slave for setting to take effect -connection slave; source include/stop_slave.inc; source include/start_slave.inc; diff --git a/mysql-test/suite/rpl/t/rpl_stop_slave.test b/mysql-test/suite/rpl/t/rpl_stop_slave.test index e7c67448dbe..e44b2f15f25 100644 --- a/mysql-test/suite/rpl/t/rpl_stop_slave.test +++ b/mysql-test/suite/rpl/t/rpl_stop_slave.test @@ -54,7 +54,69 @@ source extra/rpl_tests/rpl_stop_slave.test; --echo # Test end SET GLOBAL debug= '$debug_save'; +source include/restart_slave_sql.inc; -connection master; +--source include/rpl_connection_master.inc DROP TABLE t1, t2; + +--echo +--echo # Bug#58546 test rpl_packet timeout failure sporadically on PB +--echo # ---------------------------------------------------------------------- +--echo # STOP SLAVE stopped IO thread first and then stopped SQL thread. It was +--echo # possible that IO thread stopped after replicating part of a transaction +--echo # which SQL thread was executing. SQL thread would be hung if the +--echo # transaction could not be rolled back safely. +--echo # It caused some sporadic failures on PB2. +--echo # +--echo # This test verifies that when 'STOP SLAVE' is issued by a user, IO +--echo # thread will continue to fetch the rest events of the transaction which +--echo # is being executed by SQL thread and is not able to be rolled back safely. + +CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB; +CREATE TABLE t2 (c1 INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES(1, 1); + +let $debug_save= `SELECT @@GLOBAL.debug`; +SET GLOBAL debug= 'd,dump_thread_wait_before_send_xid'; + +sync_slave_with_master; + +--source include/rpl_connection_slave.inc +source include/restart_slave_sql.inc; + +BEGIN; +UPDATE t1 SET c2 = 2 WHERE c1 = 1; + +--source include/rpl_connection_master.inc +BEGIN; +INSERT INTO t1 VALUES(2, 2); +INSERT INTO t2 VALUES(1); +UPDATE t1 SET c2 = 3 WHERE c1 = 1; +COMMIT; + +--source include/rpl_connection_slave1.inc +let $show_statement= SHOW PROCESSLIST; +let $field= Info; +let $condition= = 'UPDATE t1 SET c2 = 3 WHERE c1 = 1'; +source include/wait_show_condition.inc; + +send STOP SLAVE; + +--source include/rpl_connection_slave.inc +ROLLBACK; + +--source include/rpl_connection_master.inc +SET DEBUG_SYNC= 'now SIGNAL signal.continue'; +SET DEBUG_SYNC= 'RESET'; + +--source include/rpl_connection_slave.inc +source include/wait_for_slave_to_stop.inc; + +--source include/rpl_connection_slave1.inc +reap; +source include/start_slave.inc; + +--source include/rpl_connection_master.inc +DROP TABLE t1, t2; +SET GLOBAL debug= $debug_save; --source include/rpl_end.inc diff --git a/sql/slave.cc b/sql/slave.cc index 96319de5427..0e74d0ce3c0 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -408,17 +408,6 @@ int terminate_slave_threads(Master_info* mi,int thread_mask,bool skip_lock) int error,force_all = (thread_mask & SLAVE_FORCE_ALL); pthread_mutex_t *sql_lock = &mi->rli.run_lock, *io_lock = &mi->run_lock; - if (thread_mask & (SLAVE_IO|SLAVE_FORCE_ALL)) - { - DBUG_PRINT("info",("Terminating IO thread")); - mi->abort_slave=1; - if ((error=terminate_slave_thread(mi->io_thd, io_lock, - &mi->stop_cond, - &mi->slave_running, - skip_lock)) && - !force_all) - DBUG_RETURN(error); - } if (thread_mask & (SLAVE_SQL|SLAVE_FORCE_ALL)) { DBUG_PRINT("info",("Terminating SQL thread")); @@ -430,6 +419,17 @@ int terminate_slave_threads(Master_info* mi,int thread_mask,bool skip_lock) !force_all) DBUG_RETURN(error); } + if (thread_mask & (SLAVE_IO|SLAVE_FORCE_ALL)) + { + DBUG_PRINT("info",("Terminating IO thread")); + mi->abort_slave=1; + if ((error=terminate_slave_thread(mi->io_thd, io_lock, + &mi->stop_cond, + &mi->slave_running, + skip_lock)) && + !force_all) + DBUG_RETURN(error); + } DBUG_RETURN(0); } diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index cb5aac863c0..0ade0b759d5 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -21,6 +21,7 @@ #include "log_event.h" #include "rpl_filter.h" #include +#include "debug_sync.h" int max_binlog_dump_events = 0; // unlimited my_bool opt_sporadic_binlog_dump_fail = 0; @@ -556,6 +557,20 @@ impossible position"; } #endif + DBUG_EXECUTE_IF("dump_thread_wait_before_send_xid", + { + if ((*packet)[EVENT_TYPE_OFFSET+1] == XID_EVENT) + { + net_flush(net); + const char act[]= + "now " + "wait_for signal.continue"; + DBUG_ASSERT(opt_debug_sync_timeout > 0); + DBUG_ASSERT(!debug_sync_set_action(current_thd, + STRING_WITH_LEN(act))); + } + }); + if ((*packet)[EVENT_TYPE_OFFSET+1] == FORMAT_DESCRIPTION_EVENT) { binlog_can_be_corrupted= test((*packet)[FLAGS_OFFSET+1] & @@ -572,6 +587,14 @@ impossible position"; goto err; } + DBUG_EXECUTE_IF("dump_thread_wait_before_send_xid", + { + if ((*packet)[EVENT_TYPE_OFFSET+1] == XID_EVENT) + { + net_flush(net); + } + }); + DBUG_PRINT("info", ("log event code %d", (*packet)[LOG_EVENT_OFFSET+1] )); if ((*packet)[LOG_EVENT_OFFSET+1] == LOAD_EVENT) From d967925cfc0841753ccbab99372821c903d75927 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Wed, 19 Jan 2011 16:17:52 +0300 Subject: [PATCH 17/23] Updating Copyright information --- strings/bchange.c | 2 +- strings/bcopy-duff.c | 2 +- strings/bfill.c | 2 +- strings/bmove.c | 2 +- strings/bmove512.c | 2 +- strings/bmove_upp.c | 2 +- strings/conf_to_src.c | 4 ++-- strings/ctype-big5.c | 2 +- strings/ctype-bin.c | 2 +- strings/ctype-cp932.c | 2 +- strings/ctype-czech.c | 2 +- strings/ctype-euc_kr.c | 2 +- strings/ctype-eucjpms.c | 2 +- strings/ctype-extra.c | 2 +- strings/ctype-gb2312.c | 2 +- strings/ctype-gbk.c | 2 +- strings/ctype-latin1.c | 2 +- strings/ctype-mb.c | 2 +- strings/ctype-simple.c | 2 +- strings/ctype-sjis.c | 2 +- strings/ctype-tis620.c | 2 +- strings/ctype-uca.c | 2 +- strings/ctype-ucs2.c | 2 +- strings/ctype-ujis.c | 2 +- strings/ctype-utf8.c | 2 +- strings/ctype-win1250ch.c | 2 +- strings/ctype.c | 2 +- strings/decimal.c | 2 +- strings/do_ctype.c | 2 +- strings/dump_map.c | 2 +- strings/int2str.c | 2 +- strings/is_prefix.c | 2 +- strings/llstr.c | 2 +- strings/longlong2str.c | 2 +- strings/longlong2str_asm.c | 2 +- strings/memcmp.c | 2 +- strings/memcpy.c | 2 +- strings/memset.c | 2 +- strings/my_strchr.c | 2 +- strings/my_strtoll10.c | 2 +- strings/my_vsnprintf.c | 2 +- strings/r_strinstr.c | 2 +- strings/str2int.c | 2 +- strings/str_alloc.c | 2 +- strings/str_test.c | 2 +- strings/strappend.c | 2 +- strings/strcat.c | 2 +- strings/strcend.c | 2 +- strings/strchr.c | 2 +- strings/strcmp.c | 2 +- strings/strcont.c | 2 +- strings/strend.c | 2 +- strings/strfill.c | 2 +- strings/strinstr.c | 2 +- strings/strlen.c | 2 +- strings/strmake.c | 2 +- strings/strmov.c | 2 +- strings/strnlen.c | 2 +- strings/strnmov.c | 2 +- strings/strrchr.c | 2 +- strings/strstr.c | 2 +- strings/strto.c | 2 +- strings/strtod.c | 2 +- strings/strtol.c | 2 +- strings/strtoll.c | 2 +- strings/strtoul.c | 2 +- strings/strtoull.c | 2 +- strings/strxmov.c | 2 +- strings/strxnmov.c | 2 +- strings/uca-dump.c | 2 +- strings/uctypedump.c | 2 +- strings/udiv.c | 2 +- strings/utr11-dump.c | 2 +- strings/xml.c | 2 +- 74 files changed, 75 insertions(+), 75 deletions(-) diff --git a/strings/bchange.c b/strings/bchange.c index 0b2c62019b5..45eabacb767 100644 --- a/strings/bchange.c +++ b/strings/bchange.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/bcopy-duff.c b/strings/bcopy-duff.c index 215857715fd..640d11bfae8 100644 --- a/strings/bcopy-duff.c +++ b/strings/bcopy-duff.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/bfill.c b/strings/bfill.c index 2750553f48a..7afece4f9bd 100644 --- a/strings/bfill.c +++ b/strings/bfill.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002 MySQL AB +/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public diff --git a/strings/bmove.c b/strings/bmove.c index ae9641a5d58..b935f618950 100644 --- a/strings/bmove.c +++ b/strings/bmove.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002 MySQL AB +/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public diff --git a/strings/bmove512.c b/strings/bmove512.c index c3f0446ead6..2b2838d99e8 100644 --- a/strings/bmove512.c +++ b/strings/bmove512.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/bmove_upp.c b/strings/bmove_upp.c index fb47bda2d1d..44c1c120689 100644 --- a/strings/bmove_upp.c +++ b/strings/bmove_upp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/conf_to_src.c b/strings/conf_to_src.c index 7e742050aa8..4ffbf115378 100644 --- a/strings/conf_to_src.c +++ b/strings/conf_to_src.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -249,7 +249,7 @@ static void fprint_copyright(FILE *file) { fprintf(file, -"/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.\n" +"/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.\n" "\n" " This program is free software; you can redistribute it and/or modify\n" " it under the terms of the GNU General Public License as published by\n" diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c index 2cb40c266d2..67134f6b1a7 100644 --- a/strings/ctype-big5.c +++ b/strings/ctype-big5.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c index 95d97af2bfb..8841bf45f35 100644 --- a/strings/ctype-bin.c +++ b/strings/ctype-bin.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002 MySQL AB & tommy@valley.ne.jp. +/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. & tommy@valley.ne.jp. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public diff --git a/strings/ctype-cp932.c b/strings/ctype-cp932.c index 238c6f61baa..e564e92ceec 100644 --- a/strings/ctype-cp932.c +++ b/strings/ctype-cp932.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c index a5df86cc6b3..39ff1f5f7e9 100644 --- a/strings/ctype-czech.c +++ b/strings/ctype-czech.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c index ee957304716..60180a2998f 100644 --- a/strings/ctype-euc_kr.c +++ b/strings/ctype-euc_kr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/ctype-eucjpms.c b/strings/ctype-eucjpms.c index 615981b4d27..e4177d7b1f3 100644 --- a/strings/ctype-eucjpms.c +++ b/strings/ctype-eucjpms.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002 MySQL AB & tommy@valley.ne.jp. +/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. & tommy@valley.ne.jp. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public diff --git a/strings/ctype-extra.c b/strings/ctype-extra.c index bc8c5342a52..0fef4bd3708 100644 --- a/strings/ctype-extra.c +++ b/strings/ctype-extra.c @@ -6,7 +6,7 @@ ./conf_to_src ../sql/share/charsets/ > FILE */ -/* Copyright (C) 2000-2007 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c index 84f67dbbc2e..78333535bba 100644 --- a/strings/ctype-gb2312.c +++ b/strings/ctype-gb2312.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c index 89607823d34..4cd2cd0cf35 100644 --- a/strings/ctype-gbk.c +++ b/strings/ctype-gbk.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c index e5333c4101b..1d835c5c34f 100644 --- a/strings/ctype-latin1.c +++ b/strings/ctype-latin1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c index e3788fc4dff..59ee3963ccd 100644 --- a/strings/ctype-mb.c +++ b/strings/ctype-mb.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index 4f3aaa6f668..cc2bb703391 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002 MySQL AB +/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c index 3f479ffc102..e4d99c00415 100644 --- a/strings/ctype-sjis.c +++ b/strings/ctype-sjis.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index a8c05dc4fd0..3db0d97c68f 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index 6ae0cc3a293..cbe558f740e 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004 MySQL AB +/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index 865a19b0828..73b8e9714a3 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c index 4474bd0cf96..7fbb16db915 100644 --- a/strings/ctype-ujis.c +++ b/strings/ctype-ujis.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002 MySQL AB & tommy@valley.ne.jp. +/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. & tommy@valley.ne.jp. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index ae942b59caa..849ba3fbeb6 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c index b22b4364e8a..a904f08b816 100644 --- a/strings/ctype-win1250ch.c +++ b/strings/ctype-win1250ch.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003 MySQL AB +/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/ctype.c b/strings/ctype.c index 17ad1256e74..41a9f8abfdb 100644 --- a/strings/ctype.c +++ b/strings/ctype.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/decimal.c b/strings/decimal.c index bda296ce832..e89669c3de5 100644 --- a/strings/decimal.c +++ b/strings/decimal.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/do_ctype.c b/strings/do_ctype.c index f33ddc5eb81..bd388457dd6 100644 --- a/strings/do_ctype.c +++ b/strings/do_ctype.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/dump_map.c b/strings/dump_map.c index e2b8b7db077..60bd91541c4 100644 --- a/strings/dump_map.c +++ b/strings/dump_map.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003-2004 MySQL AB +/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/int2str.c b/strings/int2str.c index fba98aac3f1..f2ac32ede6a 100644 --- a/strings/int2str.c +++ b/strings/int2str.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/is_prefix.c b/strings/is_prefix.c index 451cd468b7e..370927a24cd 100644 --- a/strings/is_prefix.c +++ b/strings/is_prefix.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/llstr.c b/strings/llstr.c index 643cf36a311..283af4795dc 100644 --- a/strings/llstr.c +++ b/strings/llstr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/longlong2str.c b/strings/longlong2str.c index d7de5bb0f7c..662de439924 100644 --- a/strings/longlong2str.c +++ b/strings/longlong2str.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/longlong2str_asm.c b/strings/longlong2str_asm.c index 637815e52c5..7c5edf18591 100644 --- a/strings/longlong2str_asm.c +++ b/strings/longlong2str_asm.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/memcmp.c b/strings/memcmp.c index 9471353f751..1dff18189e5 100644 --- a/strings/memcmp.c +++ b/strings/memcmp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/memcpy.c b/strings/memcpy.c index f32d346e3ec..dc72b329818 100644 --- a/strings/memcpy.c +++ b/strings/memcpy.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/memset.c b/strings/memset.c index e07dc4ead85..2976c5f0495 100644 --- a/strings/memset.c +++ b/strings/memset.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/my_strchr.c b/strings/my_strchr.c index 08fa51ba17a..35f39d563c5 100644 --- a/strings/my_strchr.c +++ b/strings/my_strchr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2005 MySQL AB +/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/my_strtoll10.c b/strings/my_strtoll10.c index 4f73b1f8e71..374a826ae92 100644 --- a/strings/my_strtoll10.c +++ b/strings/my_strtoll10.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003 MySQL AB +/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c index 920022aae91..019e1c7d9a1 100644 --- a/strings/my_vsnprintf.c +++ b/strings/my_vsnprintf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/r_strinstr.c b/strings/r_strinstr.c index fb1e0c5a090..4a8aa091a6b 100644 --- a/strings/r_strinstr.c +++ b/strings/r_strinstr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/str2int.c b/strings/str2int.c index c4a4c07eeff..7cf49982d76 100644 --- a/strings/str2int.c +++ b/strings/str2int.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/str_alloc.c b/strings/str_alloc.c index 615ad1ba1e2..fdf32b8ee15 100644 --- a/strings/str_alloc.c +++ b/strings/str_alloc.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/str_test.c b/strings/str_test.c index a476809e22d..8f0ed115761 100644 --- a/strings/str_test.c +++ b/strings/str_test.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/strappend.c b/strings/strappend.c index bb926f74665..e81a4d4301e 100644 --- a/strings/strappend.c +++ b/strings/strappend.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/strcat.c b/strings/strcat.c index e69369c357f..154ef850161 100644 --- a/strings/strcat.c +++ b/strings/strcat.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/strcend.c b/strings/strcend.c index 56e31d5f994..43c8e28e787 100644 --- a/strings/strcend.c +++ b/strings/strcend.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/strchr.c b/strings/strchr.c index 5ffe386c718..5818e5cd110 100644 --- a/strings/strchr.c +++ b/strings/strchr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/strcmp.c b/strings/strcmp.c index 54bbe92279b..19a8e62b63d 100644 --- a/strings/strcmp.c +++ b/strings/strcmp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/strcont.c b/strings/strcont.c index 5a518a3550f..ddf8f2c838f 100644 --- a/strings/strcont.c +++ b/strings/strcont.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/strend.c b/strings/strend.c index 4dadf0675dc..11ca454e1e4 100644 --- a/strings/strend.c +++ b/strings/strend.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002 MySQL AB +/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public diff --git a/strings/strfill.c b/strings/strfill.c index 4b1fe67b206..12d227f5805 100644 --- a/strings/strfill.c +++ b/strings/strfill.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/strinstr.c b/strings/strinstr.c index dce498d61e8..3f9f79b06a9 100644 --- a/strings/strinstr.c +++ b/strings/strinstr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/strlen.c b/strings/strlen.c index 1469dd096ee..a5ee5ddd922 100644 --- a/strings/strlen.c +++ b/strings/strlen.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/strmake.c b/strings/strmake.c index 2d5fa5e36aa..296199b90be 100644 --- a/strings/strmake.c +++ b/strings/strmake.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/strmov.c b/strings/strmov.c index eedf22a4ef1..98f0e1b9a26 100644 --- a/strings/strmov.c +++ b/strings/strmov.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/strnlen.c b/strings/strnlen.c index 826cd5ae5dd..7c8f3c4a54e 100644 --- a/strings/strnlen.c +++ b/strings/strnlen.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/strnmov.c b/strings/strnmov.c index 7e26877637b..a826233bb17 100644 --- a/strings/strnmov.c +++ b/strings/strnmov.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/strrchr.c b/strings/strrchr.c index cdb0479ef90..e22b04c159e 100644 --- a/strings/strrchr.c +++ b/strings/strrchr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/strstr.c b/strings/strstr.c index a5b50d12043..619fe8c8246 100644 --- a/strings/strstr.c +++ b/strings/strstr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002 MySQL AB +/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public diff --git a/strings/strto.c b/strings/strto.c index fcb0d800b81..f94005a6cb0 100644 --- a/strings/strto.c +++ b/strings/strto.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/strtod.c b/strings/strtod.c index 44b9eae98ee..95cd5041e3e 100644 --- a/strings/strtod.c +++ b/strings/strtod.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2007 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/strtol.c b/strings/strtol.c index 42476b0226a..f6dd0204f2d 100644 --- a/strings/strtol.c +++ b/strings/strtol.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/strtoll.c b/strings/strtoll.c index cfb6fbd75ee..0a7abb5307c 100644 --- a/strings/strtoll.c +++ b/strings/strtoll.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/strtoul.c b/strings/strtoul.c index 3e2b51bc982..f6c497fce2e 100644 --- a/strings/strtoul.c +++ b/strings/strtoul.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/strtoull.c b/strings/strtoull.c index 94bf6904f8d..11effebc487 100644 --- a/strings/strtoull.c +++ b/strings/strtoull.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/strxmov.c b/strings/strxmov.c index 9dd2c936620..c0b2449e66a 100644 --- a/strings/strxmov.c +++ b/strings/strxmov.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002 MySQL AB +/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public diff --git a/strings/strxnmov.c b/strings/strxnmov.c index 16469be6e45..dac6eab5d63 100644 --- a/strings/strxnmov.c +++ b/strings/strxnmov.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002 MySQL AB +/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public diff --git a/strings/uca-dump.c b/strings/uca-dump.c index 774e940c7da..3ba78163c2f 100644 --- a/strings/uca-dump.c +++ b/strings/uca-dump.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004 MySQL AB +/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/uctypedump.c b/strings/uctypedump.c index 2e484604fd3..5b902843ee1 100644 --- a/strings/uctypedump.c +++ b/strings/uctypedump.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 MySQL AB +/* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/udiv.c b/strings/udiv.c index 81ac01ee9c3..6f603b58823 100644 --- a/strings/udiv.c +++ b/strings/udiv.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/utr11-dump.c b/strings/utr11-dump.c index a15f63025f4..adbbdda1169 100644 --- a/strings/utr11-dump.c +++ b/strings/utr11-dump.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004 MySQL AB +/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/xml.c b/strings/xml.c index dee9da2864c..29ce74e36a0 100644 --- a/strings/xml.c +++ b/strings/xml.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by From 616e2227ccbda30d4fd7ad34beee0da00e4aa933 Mon Sep 17 00:00:00 2001 From: Martin Hansson Date: Wed, 19 Jan 2011 15:09:32 +0100 Subject: [PATCH 18/23] Bug#59173: Failure to handle DATE(TIME) values where Year, Month or Day is ZERO When dates are represented internally as strings, i.e. when a string constant is compared to a date value, both values are converted to long integers, ostensibly for fast comparisons. DATE typed integer values are converted to DATETIME by multiplying by 1,000,000 (each digit pair representing hour, minute and second, respectively). But the mechanism did not distuinguish cached INTEGER values, already in correct format, from newly converted strings. Fixed by marking the INTEGER cache as being of DATETIME format. --- mysql-test/r/type_datetime.result | 11 +++++++++++ mysql-test/t/type_datetime.test | 11 +++++++++++ sql/item_cmpfunc.cc | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 9b18f250d21..1f0965a105f 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -637,4 +637,15 @@ CAST(CAST('2008-07-29T10:42:51.1234567' AS DateTime) AS DECIMAL(30,7)) 20080729104251.1234560 Warnings: Warning 1292 Truncated incorrect datetime value: '2008-07-29T10:42:51.1234567' +# +# Bug#59173: Failure to handle DATE(TIME) values where Year, Month or +# Day is ZERO +# +CREATE TABLE t1 (dt1 DATETIME); +INSERT INTO t1 (dt1) VALUES ('0000-00-01 00:00:01'); +DELETE FROM t1 WHERE dt1 = '0000-00-01 00:00:01'; +# Should be empty +SELECT * FROM t1; +dt1 +DROP TABLE t1; End of 5.1 tests diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index d4fa6bed186..43dafc371dc 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -445,4 +445,15 @@ SELECT CAST(CAST('00000002006-000008-0000010 000010:0000011:00000012.012345' AS # show we truncate microseconds from the right SELECT CAST(CAST('2008-07-29T10:42:51.1234567' AS DateTime) AS DECIMAL(30,7)); +--echo # +--echo # Bug#59173: Failure to handle DATE(TIME) values where Year, Month or +--echo # Day is ZERO +--echo # +CREATE TABLE t1 (dt1 DATETIME); +INSERT INTO t1 (dt1) VALUES ('0000-00-01 00:00:01'); +DELETE FROM t1 WHERE dt1 = '0000-00-01 00:00:01'; +--echo # Should be empty +SELECT * FROM t1; +DROP TABLE t1; + --echo End of 5.1 tests diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index d2e1ebbb3a1..40056cfd1ef 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -913,7 +913,7 @@ int Arg_comparator::set_cmp_func(Item_result_field *owner_arg, cache_converted_constant can't be used here because it can't correctly convert a DATETIME value from string to int representation. */ - Item_cache_int *cache= new Item_cache_int(); + Item_cache_int *cache= new Item_cache_int(MYSQL_TYPE_DATETIME); /* Mark the cache as non-const to prevent re-caching. */ cache->set_used_tables(1); if (!(*a)->is_datetime()) From 0850b607599bbf4fa7068cd76cc78fcdd60cd88b Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Fri, 21 Jan 2011 13:57:21 +0100 Subject: [PATCH 19/23] Bug #59063 rpl_migration_crash_safe fails on Windows Race condition may occur: mtr sees the .expect file but it's empty Fix: wait and try again if file is empty Addendum: try again if line isn't 'wait' or 'restart' Also added verbose printout of extra restart options --- mysql-test/mysql-test-run.pl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index ebf3976033b..388d2cd2672 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -4093,8 +4093,10 @@ sub check_expected_crash_and_restart { { mtr_verbose("Crash was expected, file '$expect_file' exists"); - for (my $waits = 0; $waits < 50; $waits++) + for (my $waits = 0; $waits < 50; mtr_milli_sleep(100), $waits++) { + # Race condition seen on Windows: try again until file not empty + next if -z $expect_file; # If last line in expect file starts with "wait" # sleep a little and try again, thus allowing the # test script to control when the server should start @@ -4103,10 +4105,11 @@ sub check_expected_crash_and_restart { if ($last_line =~ /^wait/ ) { mtr_verbose("Test says wait before restart") if $waits == 0; - mtr_milli_sleep(100); next; } + # Ignore any partial or unknown command + next unless $last_line =~ /^restart/; # If last line begins "restart:", the rest of the line is read as # extra command line options to add to the restarted mysqld. # Anything other than 'wait' or 'restart:' (with a colon) will @@ -4471,6 +4474,8 @@ sub mysqld_start ($$) { my @all_opts= @$extra_opts; if (exists $mysqld->{'restart_opts'}) { push (@all_opts, @{$mysqld->{'restart_opts'}}); + mtr_verbose(My::Options::toStr("mysqld_start restart", + @{$mysqld->{'restart_opts'}})); } mysqld_arguments($args,$mysqld,\@all_opts); From 245c3f497a299af4d2356d817a3fd5afa58dd1ee Mon Sep 17 00:00:00 2001 From: Date: Mon, 24 Jan 2011 11:48:54 +0800 Subject: [PATCH 20/23] Postfix BUG#58546 Updated Copyright. --- sql/slave.cc | 2 +- sql/sql_repl.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/slave.cc b/sql/slave.cc index 0e74d0ce3c0..6d266245460 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (C) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 0ade0b759d5..8c769ce6acf 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2006 MySQL AB & Sasha +/* Copyright (C) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by From c895aba35cca2925090adc74ff8de7e71cb0cb3c Mon Sep 17 00:00:00 2001 From: Libing Song Date: Wed, 26 Jan 2011 15:30:06 +0800 Subject: [PATCH 21/23] Postfix bug#49124 Updated the copyright. --- sql/mysql_priv.h | 2 +- sql/sql_lex.cc | 2 +- sql/sql_lex.h | 2 +- sql/sql_parse.cc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 5f8458f4f1e..d88e629b91b 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index a013d5466c1..97d9fe99eb3 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2006 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 7a315d81aa5..b3822f91afe 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2006 MySQL AB +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 0f75b835315..de67b99b172 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by From 5a19661d4f858a0988f6eb088955df650c6957aa Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Wed, 26 Jan 2011 12:37:24 +0000 Subject: [PATCH 22/23] Disabled rpl_row_until and rpl_stm_until due to BUG#59543. --- mysql-test/suite/rpl/t/disabled.def | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index b5956a78371..3b3a55fe4cd 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -13,3 +13,5 @@ rpl_row_create_table : Bug#51574 Feb 27 2010 andrei failed different way than earlier with bug#45576 rpl_log_pos : BUG#55675 Sep 10 2010 27 2010 alfranio rpl.rpl_log_pos fails sporadically with error binlog truncated in the middle rpl_get_master_version_and_clock : Bug#59178 Jan 05 2011 joro Valgrind warnings rpl_get_master_version_and_clock +rpl_row_until : BUG#59543 Jan 26 2011 alfranio Replication test from eits suite rpl_row_until times out +rpl_stm_until : BUG#59543 Jan 26 2011 alfranio Replication test from eits suite rpl_row_until times out From 4eb7054598196f474bfef50318a483c20bc29b87 Mon Sep 17 00:00:00 2001 From: Ramil Kalimullin Date: Wed, 26 Jan 2011 15:49:09 +0300 Subject: [PATCH 23/23] Bug #47811 : remove the non-default alignment specification. Fix backported from to 5.0. "Remove the alignment option, let valgrind use its default" --- mysql-test/mysql-test-run-shell.sh | 2 +- mysql-test/mysql-test-run.pl | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/mysql-test/mysql-test-run-shell.sh b/mysql-test/mysql-test-run-shell.sh index d919246f2e1..d4d31506f23 100644 --- a/mysql-test/mysql-test-run-shell.sh +++ b/mysql-test/mysql-test-run-shell.sh @@ -150,7 +150,7 @@ find_valgrind() fi # >=2.1.2 requires the --tool option, some versions write to stdout, some to stderr valgrind --help 2>&1 | grep "\-\-tool" > /dev/null && FIND_VALGRIND="$FIND_VALGRIND --tool=memcheck" - FIND_VALGRIND="$FIND_VALGRIND --alignment=8 --leak-check=yes --num-callers=16 --suppressions=$MYSQL_TEST_DIR/valgrind.supp" + FIND_VALGRIND="$FIND_VALGRIND --leak-check=yes --num-callers=16 --suppressions=$MYSQL_TEST_DIR/valgrind.supp" } # No paths below as we can't be sure where the program is! diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 2cfd689b0e7..f0100593516 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -5135,7 +5135,6 @@ sub valgrind_arguments { else { mtr_add_arg($args, "--tool=memcheck"); # From >= 2.1.2 needs this option - mtr_add_arg($args, "--alignment=8"); mtr_add_arg($args, "--leak-check=yes"); mtr_add_arg($args, "--num-callers=16"); mtr_add_arg($args, "--suppressions=%s/valgrind.supp", $glob_mysql_test_dir)