From e7a6e86f78998e35e1912f377006a35db3705246 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Fri, 17 Oct 2008 13:55:16 +0300 Subject: [PATCH 01/19] Bug #38637: COUNT DISTINCT prevents NULL testing in HAVING clause IS NULL was not checking the correct row in a HAVING context. At the first row of a new group (where the HAVING clause is evaluated) the column and SELECT list references in the HAVING clause should refer to the last row of the previous group and not to the current one. This was not done for IS NULL, because it was using Item::is_null() doesn't have a Item_is_null_result() counterpart to access the data from the last row of the previous group. Note that all the Item::val_xxx() functions (e.g. Item::val_int()) have their _result counterparts (e.g. Item::val_int_result()). Fixed by implementing a is_null_result() (similarly to int_result()) and calling this instead of is_null() column and SELECT list references inside the HAVING clause. mysql-test/r/having.result: Bug #38637: test case mysql-test/t/having.test: Bug #38637: test case sql/item.cc: Bug #38637: implement Item::is_null_result() and call it from Item_ref and Item_field as appropriate. sql/item.h: Bug #38637: implement Item::is_null_result() and call it from Item_ref and Item_field as appropriate. sql/item_func.cc: Bug #38637: implement Item::is_null_result() and call it from Item_ref and Item_field as appropriate. sql/item_func.h: Bug #38637: implement Item::is_null_result() and call it from Item_ref and Item_field as appropriate. --- mysql-test/r/having.result | 7 +++++++ mysql-test/t/having.test | 11 +++++++++++ sql/item.cc | 19 ++++++++++++++++++- sql/item.h | 3 +++ sql/item_func.cc | 9 +++++++++ sql/item_func.h | 1 + 6 files changed, 49 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result index f113304c767..bc8596100f8 100644 --- a/mysql-test/r/having.result +++ b/mysql-test/r/having.result @@ -424,3 +424,10 @@ select f1 from t1 group by f1 having max(f1)=f1; f1 set session sql_mode=''; drop table t1; +CREATE TABLE t1 ( a INT, b INT); +INSERT INTO t1 VALUES (1, 1), (2,2), (3, NULL); +SELECT b, COUNT(DISTINCT a) FROM t1 GROUP BY b HAVING b is NULL; +b COUNT(DISTINCT a) +NULL 1 +DROP TABLE t1; +End of 5.0 tests diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test index 827b83f11a0..adabbb711d4 100644 --- a/mysql-test/t/having.test +++ b/mysql-test/t/having.test @@ -432,3 +432,14 @@ select f1 from t1 having max(f1)=f1; select f1 from t1 group by f1 having max(f1)=f1; set session sql_mode=''; drop table t1; + + +# +# Bug #38637: COUNT DISTINCT prevents NULL testing in HAVING clause +# +CREATE TABLE t1 ( a INT, b INT); +INSERT INTO t1 VALUES (1, 1), (2,2), (3, NULL); +SELECT b, COUNT(DISTINCT a) FROM t1 GROUP BY b HAVING b is NULL; +DROP TABLE t1; + +--echo End of 5.0 tests diff --git a/sql/item.cc b/sql/item.cc index 182f4abdfe6..e71268724b4 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -2041,6 +2041,12 @@ bool Item_field::val_bool_result() } +bool Item_field::is_null_result() +{ + return (null_value=result_field->is_null()); +} + + bool Item_field::eq(const Item *item, bool binary_cmp) const { Item *real_item= ((Item *) item)->real_item(); @@ -5626,6 +5632,15 @@ double Item_ref::val_result() } +bool Item_ref::is_null_result() +{ + if (result_field) + return (null_value=result_field->is_null()); + + return is_null(); +} + + longlong Item_ref::val_int_result() { if (result_field) @@ -5731,7 +5746,9 @@ String *Item_ref::val_str(String* tmp) bool Item_ref::is_null() { DBUG_ASSERT(fixed); - return (*ref)->is_null(); + bool tmp=(*ref)->is_null_result(); + null_value=(*ref)->null_value; + return tmp; } diff --git a/sql/item.h b/sql/item.h index 250bb3f67ef..1058cc5dbb8 100644 --- a/sql/item.h +++ b/sql/item.h @@ -652,6 +652,7 @@ public: virtual my_decimal *val_decimal_result(my_decimal *val) { return val_decimal(val); } virtual bool val_bool_result() { return val_bool(); } + virtual bool is_null_result() { return is_null(); } /* bit map of tables used by item */ virtual table_map used_tables() const { return (table_map) 0L; } @@ -1301,6 +1302,7 @@ public: String *str_result(String* tmp); my_decimal *val_decimal_result(my_decimal *); bool val_bool_result(); + bool is_null_result(); bool send(Protocol *protocol, String *str_arg); void reset_field(Field *f); bool fix_fields(THD *, Item **); @@ -1942,6 +1944,7 @@ public: String *str_result(String* tmp); my_decimal *val_decimal_result(my_decimal *); bool val_bool_result(); + bool is_null_result(); bool send(Protocol *prot, String *tmp); void make_field(Send_field *field); bool fix_fields(THD *, Item **); diff --git a/sql/item_func.cc b/sql/item_func.cc index e663e1fcf83..382fea6dfe2 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -4283,6 +4283,15 @@ my_decimal *Item_func_set_user_var::val_decimal_result(my_decimal *val) } +bool Item_func_set_user_var::is_null_result() +{ + DBUG_ASSERT(fixed == 1); + check(TRUE); + update(); // Store expression + return is_null(); +} + + void Item_func_set_user_var::print(String *str) { str->append(STRING_WITH_LEN("(@")); diff --git a/sql/item_func.h b/sql/item_func.h index 6dcf32cba07..8c7becb681b 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -1299,6 +1299,7 @@ public: longlong val_int_result(); String *str_result(String *str); my_decimal *val_decimal_result(my_decimal *); + bool is_null_result(); bool update_hash(void *ptr, uint length, enum Item_result type, CHARSET_INFO *cs, Derivation dv, bool unsigned_arg); bool send(Protocol *protocol, String *str_arg); From 293e9c49c49cd0931125b637b95bb0fb99124e65 Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Mon, 12 Jan 2009 23:08:22 +0100 Subject: [PATCH 02/19] Applying InnoDB snapshot innodb-5.1-ss3603 Detailed description of changes: r2902 | vasil | 2008-10-28 12:10:25 +0200 (Tue, 28 Oct 2008) | 10 lines branches/5.1: Fix Bug#38189 innodb_stats_on_metadata missing Make the variable innodb_stats_on_metadata visible to the users and also settable at runtime. Previously it was only "visible" as a command line startup option to mysqld. Approved by: Marko (https://svn.innodb.com/rb/r/36) --- storage/innobase/handler/ha_innodb.cc | 8 +++----- storage/innobase/include/srv0srv.h | 2 -- storage/innobase/srv/srv0srv.c | 2 -- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 6358f7ce055..03098861ecd 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -128,7 +128,7 @@ static my_bool innobase_file_per_table = FALSE; static my_bool innobase_locks_unsafe_for_binlog = FALSE; static my_bool innobase_rollback_on_timeout = FALSE; static my_bool innobase_create_status_file = FALSE; -static my_bool innobase_stats_on_metadata = TRUE; +static my_bool innobase_stats_on_metadata = TRUE; static my_bool innobase_adaptive_hash_index = TRUE; static char* internal_innobase_data_file_path = NULL; @@ -1713,8 +1713,6 @@ innobase_init( srv_max_n_open_files = (ulint) innobase_open_files; srv_innodb_status = (ibool) innobase_create_status_file; - srv_stats_on_metadata = (ibool) innobase_stats_on_metadata; - srv_use_adaptive_hash_indexes = (ibool) innobase_adaptive_hash_index; @@ -5976,7 +5974,7 @@ ha_innobase::info( ib_table = prebuilt->table; if (flag & HA_STATUS_TIME) { - if (srv_stats_on_metadata) { + if (innobase_stats_on_metadata) { /* In sql_show we call with this flag: update then statistics so that they are up-to-date */ @@ -8236,7 +8234,7 @@ static MYSQL_SYSVAR_BOOL(status_file, innobase_create_status_file, NULL, NULL, FALSE); static MYSQL_SYSVAR_BOOL(stats_on_metadata, innobase_stats_on_metadata, - PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_NOSYSVAR, + PLUGIN_VAR_OPCMDARG, "Enable statistics gathering for metadata commands such as SHOW TABLE STATUS (on by default)", NULL, NULL, TRUE); diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index 91daa6816b2..2516937565d 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -124,8 +124,6 @@ extern ulint srv_fast_shutdown; /* If this is 1, do not do a transactions). */ extern ibool srv_innodb_status; -extern ibool srv_stats_on_metadata; - extern ibool srv_use_doublewrite_buf; extern ibool srv_use_checksums; diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c index e8b7bd4cee2..5c67ffb23c6 100644 --- a/storage/innobase/srv/srv0srv.c +++ b/storage/innobase/srv/srv0srv.c @@ -328,8 +328,6 @@ ulint srv_fast_shutdown = 0; /* Generate a innodb_status. file */ ibool srv_innodb_status = FALSE; -ibool srv_stats_on_metadata = TRUE; - ibool srv_use_doublewrite_buf = TRUE; ibool srv_use_checksums = TRUE; From 897d00ce89e6eb2ef9c0f1688ccc6e4498527fd0 Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Mon, 12 Jan 2009 23:27:11 +0100 Subject: [PATCH 03/19] Applying InnoDB snapshot innodb-5.1-ss3603 Detailed description of changes: r2929 | marko | 2008-10-29 21:26:14 +0200 (Wed, 29 Oct 2008) | 13 lines branches/5.1: dtype_get_sql_null_size(): return the correct storage size of a SQL NULL column. (Bug #40369) When MySQL Bug #20877 was fixed in r834, this function was accidentally modified to return 0 or 1. Apparently, the only impact of this bug is that fixed-length columns cannot be updated in-place from or to SQL NULL, even in ROW_FORMAT=REDUNDANT. After this fix, fixed-length columns in ROW_FORMAT=REDUNDANT will have a constant storage size as they should, no matter if NULL or non-NULL. The bug caused fixed-length NULL columns to occupy 1 byte. rb://37 approved by Heikki over IM. --- storage/innobase/include/data0type.ic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/include/data0type.ic b/storage/innobase/include/data0type.ic index b8c24bb074a..ad0f95755d2 100644 --- a/storage/innobase/include/data0type.ic +++ b/storage/innobase/include/data0type.ic @@ -558,5 +558,5 @@ dtype_get_sql_null_size( const dtype_t* type) /* in: type */ { return(dtype_get_fixed_size_low(type->mtype, type->prtype, type->len, - type->mbminlen, type->mbmaxlen) > 0); + type->mbminlen, type->mbmaxlen)); } From 9eddf5762ccdad9a11d2c8ebaeba2dca1d78a583 Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Mon, 12 Jan 2009 23:28:56 +0100 Subject: [PATCH 04/19] Applying InnoDB snapshot innodb-5.1-ss3603 Detailed description of changes: r2981 | marko | 2008-11-07 14:54:10 +0200 (Fri, 07 Nov 2008) | 6 lines branches/5.1: row_mysql_store_col_in_innobase_format(): Correct a misleading comment. In the UTF-8 encoding, ASCII takes 1 byte per character, while the "latin1" character set (normally ISO-8859-1, but in MySQL it actually refers to the Windows Code Page 1252 a.k.a. CP1252, WinLatin1) takes 1 to 3 bytes (1 to 2 bytes for the ISO-8859-1 subset). r3114 | calvin | 2008-11-14 20:31:48 +0200 (Fri, 14 Nov 2008) | 8 lines branches/5.1: fix bug#40386: Not flushing query cache after truncate ha_statistics.records can not be 0 unless the table is empty, set to 1 instead. The original problem of bug 29507 is fixed in the server. Additional test was done with the fix of bug 29507 in the server. Approved by: Heikki (on IM) --- storage/innobase/handler/ha_innodb.cc | 8 +++++--- storage/innobase/row/row0mysql.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 03098861ecd..1fda1fe49df 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -6022,11 +6022,13 @@ ha_innobase::info( n_rows++; } - /* Fix bug#29507: TRUNCATE shows too many rows affected. - Do not show the estimates for TRUNCATE command. */ + /* Fix bug#40386: Not flushing query cache after truncate. + n_rows can not be 0 unless the table is empty, set to 1 + instead. The original problem of bug#29507 is actually + fixed in the server code. */ if (thd_sql_command(user_thd) == SQLCOM_TRUNCATE) { - n_rows = 0; + n_rows = 1; /* We need to reset the prebuilt value too, otherwise checks for values greater than the last value written diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c index d76af54b420..1019f33efef 100644 --- a/storage/innobase/row/row0mysql.c +++ b/storage/innobase/row/row0mysql.c @@ -342,7 +342,7 @@ row_mysql_store_col_in_innobase_format( /* In some cases we strip trailing spaces from UTF-8 and other multibyte charsets, from FIXED-length CHAR columns, to save space. UTF-8 would otherwise normally use 3 * the string length - bytes to store a latin1 string! */ + bytes to store an ASCII string! */ /* We assume that this CHAR field is encoded in a variable-length character set where spaces have From fc3b2bfc9e6df53185501ccf4eca90d7e0ae225b Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Mon, 12 Jan 2009 23:31:05 +0100 Subject: [PATCH 05/19] Applying InnoDB snapshot innodb-5.1-ss3603 Detailed description of changes: r3257 | inaam | 2008-11-24 22:06:50 +0200 (Mon, 24 Nov 2008) | 13 lines branches/5.1 bug#40760 The config param innodb_thread_concurrency is dynamically set and is read when a thread enters/exits innodb. If the value is changed between the enter and exit time the behaviour becomes erratic. The fix is not to use srv_thread_concurrency when exiting, instead use the flag trx->declared_to_be_inside_innodb. rb://57 Approved by: Marko --- storage/innobase/handler/ha_innodb.cc | 2 +- storage/innobase/srv/srv0srv.c | 27 +++++++++++++++------------ storage/innobase/trx/trx0trx.c | 4 ++++ 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 1fda1fe49df..ba84ee3d5cf 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -461,7 +461,7 @@ innodb_srv_conc_exit_innodb( /*========================*/ trx_t* trx) /* in: transaction handle */ { - if (UNIV_LIKELY(!srv_thread_concurrency)) { + if (UNIV_LIKELY(!trx->declared_to_be_inside_innodb)) { return; } diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c index 5c67ffb23c6..e2d8bd4c600 100644 --- a/storage/innobase/srv/srv0srv.c +++ b/storage/innobase/srv/srv0srv.c @@ -283,13 +283,16 @@ ulong srv_commit_concurrency = 0; os_fast_mutex_t srv_conc_mutex; /* this mutex protects srv_conc data structures */ -lint srv_conc_n_threads = 0; /* number of OS threads currently - inside InnoDB; it is not an error - if this drops temporarily below zero - because we do not demand that every - thread increments this, but a thread - waiting for a lock decrements this - temporarily */ +lint srv_conc_n_threads = 0; /* number of transactions that + have declared_to_be_inside_innodb + set. It used to be a non-error + for this value to drop below + zero temporarily. This is no + longer true. We'll, however, + keep the lint datatype to add + assertions to catch any corner + cases that we may have + missed. */ ulint srv_conc_n_waiting_threads = 0; /* number of OS threads waiting in the FIFO for a permission to enter InnoDB */ @@ -1020,6 +1023,8 @@ retry: return; } + ut_ad(srv_conc_n_threads >= 0); + if (srv_conc_n_threads < (lint)srv_thread_concurrency) { srv_conc_n_threads++; @@ -1146,6 +1151,8 @@ srv_conc_force_enter_innodb( return; } + ut_ad(srv_conc_n_threads >= 0); + os_fast_mutex_lock(&srv_conc_mutex); srv_conc_n_threads++; @@ -1167,11 +1174,6 @@ srv_conc_force_exit_innodb( { srv_conc_slot_t* slot = NULL; - if (UNIV_LIKELY(!srv_thread_concurrency)) { - - return; - } - if (trx->mysql_thd != NULL && thd_is_replication_slave_thread(trx->mysql_thd)) { @@ -1185,6 +1187,7 @@ srv_conc_force_exit_innodb( os_fast_mutex_lock(&srv_conc_mutex); + ut_ad(srv_conc_n_threads > 0); srv_conc_n_threads--; trx->declared_to_be_inside_innodb = FALSE; trx->n_tickets_to_enter_innodb = 0; diff --git a/storage/innobase/trx/trx0trx.c b/storage/innobase/trx/trx0trx.c index 69b72451f2b..1fceaa3562c 100644 --- a/storage/innobase/trx/trx0trx.c +++ b/storage/innobase/trx/trx0trx.c @@ -287,6 +287,10 @@ trx_free( "InnoDB: inside InnoDB.\n", stderr); trx_print(stderr, trx, 600); putc('\n', stderr); + + /* This is an error but not a fatal error. We must keep + the counters like srv_conc_n_threads accurate. */ + srv_conc_force_exit_innodb(trx); } if (trx->n_mysql_tables_in_use != 0 From 14c7d56ba8e15b49adb223f95e2abb7bcfd7778d Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Mon, 12 Jan 2009 23:32:11 +0100 Subject: [PATCH 06/19] Applying InnoDB snapshot innodb-5.1-ss3603 Detailed description of changes: r3412 | vasil | 2008-12-05 10:46:18 +0200 (Fri, 05 Dec 2008) | 7 lines branches/5.1: Add the traditional 2 spaces after the timestamp so the message does not look like: 070223 13:26:01InnoDB: Warning: canno.... --- storage/innobase/trx/trx0undo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/trx/trx0undo.c b/storage/innobase/trx/trx0undo.c index 2aa7752d292..b31580d0ce0 100644 --- a/storage/innobase/trx/trx0undo.c +++ b/storage/innobase/trx/trx0undo.c @@ -410,7 +410,7 @@ trx_undo_seg_create( if (slot_no == ULINT_UNDEFINED) { ut_print_timestamp(stderr); fprintf(stderr, - "InnoDB: Warning: cannot find a free slot for" + " InnoDB: Warning: cannot find a free slot for" " an undo log. Do you have too\n" "InnoDB: many active transactions" " running concurrently?\n"); From 8759d9275de1078100fbb95e8a464f2fd5a2aa2f Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Mon, 12 Jan 2009 23:32:50 +0100 Subject: [PATCH 07/19] Applying InnoDB snapshot innodb-5.1-ss3603 Detailed description of changes: r3588 | inaam | 2008-12-18 14:26:54 +0200 (Thu, 18 Dec 2008) | 8 lines branches/5.1 It is a bug in unused code. If we don't calculate the hash value when calculating the mutex number then two pages which map to same hash value can get two different mutex numbers. Approved by: Marko --- storage/innobase/include/hash0hash.ic | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/storage/innobase/include/hash0hash.ic b/storage/innobase/include/hash0hash.ic index 49bcc7b31d0..d246d8ee831 100644 --- a/storage/innobase/include/hash0hash.ic +++ b/storage/innobase/include/hash0hash.ic @@ -58,7 +58,8 @@ hash_get_mutex_no( hash_table_t* table, /* in: hash table */ ulint fold) /* in: fold */ { - return(ut_2pow_remainder(fold, table->n_mutexes)); + return(ut_2pow_remainder(hash_calc_hash(fold, table), + table->n_mutexes)); } /**************************************************************** From 13927f53c5603f13b9f5a462140e3ae13877ff2a Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Mon, 12 Jan 2009 23:35:05 +0100 Subject: [PATCH 08/19] Applying InnoDB snapshot innodb-5.1-ss3603 Detailed description of changes: r3590 | marko | 2008-12-18 15:33:36 +0200 (Thu, 18 Dec 2008) | 11 lines branches/5.1: When converting a record to MySQL format, copy the default column values for columns that are SQL NULL. This addresses failures in row-based replication (Bug #39648). row_prebuilt_t: Add default_rec, for the default values of the columns in MySQL format. row_sel_store_mysql_rec(): Use prebuilt->default_rec instead of padding columns. rb://64 approved by Heikki Tuuri --- storage/innobase/handler/ha_innodb.cc | 2 + storage/innobase/include/row0mysql.h | 2 + storage/innobase/row/row0mysql.c | 1 + storage/innobase/row/row0sel.c | 55 +++------------------------ 4 files changed, 11 insertions(+), 49 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index ba84ee3d5cf..366bc3966c7 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -2508,6 +2508,8 @@ retry: prebuilt = row_create_prebuilt(ib_table); prebuilt->mysql_row_len = table->s->reclength; + prebuilt->default_rec = table->s->default_values; + ut_ad(prebuilt->default_rec); /* Looks like MySQL-3.23 sometimes has primary key number != 0 */ diff --git a/storage/innobase/include/row0mysql.h b/storage/innobase/include/row0mysql.h index 9c3ba558d3c..9b2f3250486 100644 --- a/storage/innobase/include/row0mysql.h +++ b/storage/innobase/include/row0mysql.h @@ -594,6 +594,8 @@ struct row_prebuilt_struct { byte* ins_upd_rec_buff;/* buffer for storing data converted to the Innobase format from the MySQL format */ + const byte* default_rec; /* the default values of all columns + (a "default row") in MySQL format */ ulint hint_need_to_fetch_extra_cols; /* normally this is set to 0; if this is set to ROW_RETRIEVE_PRIMARY_KEY, diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c index 1019f33efef..1713863f1fe 100644 --- a/storage/innobase/row/row0mysql.c +++ b/storage/innobase/row/row0mysql.c @@ -620,6 +620,7 @@ row_create_prebuilt( prebuilt->ins_node = NULL; prebuilt->ins_upd_rec_buff = NULL; + prebuilt->default_rec = NULL; prebuilt->upd_node = NULL; prebuilt->ins_graph = NULL; diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c index 79f107ce77d..f53dfe8a686 100644 --- a/storage/innobase/row/row0sel.c +++ b/storage/innobase/row/row0sel.c @@ -2597,6 +2597,7 @@ row_sel_store_mysql_rec( ulint i; ut_ad(prebuilt->mysql_template); + ut_ad(prebuilt->default_rec); ut_ad(rec_offs_validate(rec, NULL, offsets)); if (UNIV_LIKELY_NULL(prebuilt->blob_heap)) { @@ -2683,58 +2684,14 @@ row_sel_store_mysql_rec( &= ~(byte) templ->mysql_null_bit_mask; } } else { - /* MySQL seems to assume the field for an SQL NULL - value is set to zero or space. Not taking this into - account caused seg faults with NULL BLOB fields, and - bug number 154 in the MySQL bug database: GROUP BY - and DISTINCT could treat NULL values inequal. */ - int pad_char; + /* MySQL assumes that the field for an SQL + NULL value is set to the default value. */ mysql_rec[templ->mysql_null_byte_offset] |= (byte) templ->mysql_null_bit_mask; - switch (templ->type) { - case DATA_VARCHAR: - case DATA_BINARY: - case DATA_VARMYSQL: - if (templ->mysql_type - == DATA_MYSQL_TRUE_VARCHAR) { - /* This is a >= 5.0.3 type - true VARCHAR. Zero the field. */ - pad_char = 0x00; - break; - } - /* Fall through */ - case DATA_CHAR: - case DATA_FIXBINARY: - case DATA_MYSQL: - /* MySQL pads all string types (except - BLOB, TEXT and true VARCHAR) with space. */ - if (UNIV_UNLIKELY(templ->mbminlen == 2)) { - /* Treat UCS2 as a special case. */ - data = mysql_rec - + templ->mysql_col_offset; - len = templ->mysql_col_len; - /* There are two UCS2 bytes per char, - so the length has to be even. */ - ut_a(!(len & 1)); - /* Pad with 0x0020. */ - while (len) { - *data++ = 0x00; - *data++ = 0x20; - len -= 2; - } - continue; - } - pad_char = 0x20; - break; - default: - pad_char = 0x00; - break; - } - - ut_ad(!pad_char || templ->mbminlen == 1); - memset(mysql_rec + templ->mysql_col_offset, - pad_char, templ->mysql_col_len); + memcpy(mysql_rec + templ->mysql_col_offset, + prebuilt->default_rec + templ->mysql_col_offset, + templ->mysql_col_len); } } From 96415bb39da6cafaf2059de6d9b58dbc115c7f92 Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Tue, 13 Jan 2009 15:14:11 +0100 Subject: [PATCH 09/19] Applying InnoDB snapshot innodb-5.1-ss3603 Detailed description of changes: r3601 | marko | 2008-12-22 16:05:19 +0200 (Mon, 22 Dec 2008) | 9 lines branches/5.1: Make SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED a true replacement of SET GLOBAL INNODB_LOCKS_UNSAFE_FOR_BINLOG=1. This fixes an error that was introduced in r370, causing semi-consistent read not to not unlock rows in READ UNCOMMITTED mode. (Bug #41671, Issue #146) rb://67 approved by Heikki Tuuri --- mysql-test/r/innodb-semi-consistent.result | 5 +++-- mysql-test/t/innodb-semi-consistent-master.opt | 2 +- mysql-test/t/innodb-semi-consistent.test | 7 +++++-- storage/innobase/handler/ha_innodb.cc | 3 ++- storage/innobase/row/row0mysql.c | 7 ++++--- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/mysql-test/r/innodb-semi-consistent.result b/mysql-test/r/innodb-semi-consistent.result index 6173048c320..55e3cb5c7b4 100644 --- a/mysql-test/r/innodb-semi-consistent.result +++ b/mysql-test/r/innodb-semi-consistent.result @@ -1,6 +1,6 @@ drop table if exists t1; set binlog_format=mixed; -set session transaction isolation level read committed; +set session transaction isolation level repeatable read; create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; insert into t1 values (1),(2),(3),(4),(5),(6),(7); set autocommit=0; @@ -8,11 +8,12 @@ select * from t1 where a=3 lock in share mode; a 3 set binlog_format=mixed; -set session transaction isolation level read committed; +set session transaction isolation level repeatable read; set autocommit=0; update t1 set a=10 where a=5; ERROR HY000: Lock wait timeout exceeded; try restarting transaction commit; +set session transaction isolation level read committed; update t1 set a=10 where a=5; select * from t1 where a=2 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction diff --git a/mysql-test/t/innodb-semi-consistent-master.opt b/mysql-test/t/innodb-semi-consistent-master.opt index 2746e4e184e..e76299453d3 100644 --- a/mysql-test/t/innodb-semi-consistent-master.opt +++ b/mysql-test/t/innodb-semi-consistent-master.opt @@ -1 +1 @@ ---innodb_locks_unsafe_for_binlog=true --innodb_lock_wait_timeout=2 +--innodb_lock_wait_timeout=2 diff --git a/mysql-test/t/innodb-semi-consistent.test b/mysql-test/t/innodb-semi-consistent.test index a3496625e95..6d3020bb560 100644 --- a/mysql-test/t/innodb-semi-consistent.test +++ b/mysql-test/t/innodb-semi-consistent.test @@ -11,7 +11,7 @@ connect (a,localhost,root,,); connect (b,localhost,root,,); connection a; set binlog_format=mixed; -set session transaction isolation level read committed; +set session transaction isolation level repeatable read; create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; insert into t1 values (1),(2),(3),(4),(5),(6),(7); set autocommit=0; @@ -19,13 +19,15 @@ set autocommit=0; select * from t1 where a=3 lock in share mode; connection b; set binlog_format=mixed; -set session transaction isolation level read committed; +set session transaction isolation level repeatable read; set autocommit=0; -- error ER_LOCK_WAIT_TIMEOUT update t1 set a=10 where a=5; connection a; commit; connection b; +# perform a semi-consisent read (and unlock non-matching rows) +set session transaction isolation level read committed; update t1 set a=10 where a=5; connection a; -- error ER_LOCK_WAIT_TIMEOUT @@ -33,6 +35,7 @@ select * from t1 where a=2 for update; # this should lock the records (1),(2) select * from t1 where a=2 limit 1 for update; connection b; +# semi-consistent read will skip non-matching locked rows a=1, a=2 update t1 set a=11 where a=6; -- error ER_LOCK_WAIT_TIMEOUT update t1 set a=12 where a=2; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 366bc3966c7..513ce85ad0c 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -4129,7 +4129,8 @@ ha_innobase::unlock_row(void) switch (prebuilt->row_read_type) { case ROW_READ_WITH_LOCKS: if (!srv_locks_unsafe_for_binlog - || prebuilt->trx->isolation_level == TRX_ISO_READ_COMMITTED) { + && prebuilt->trx->isolation_level + != TRX_ISO_READ_COMMITTED) { break; } /* fall through */ diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c index 1713863f1fe..088d944cb91 100644 --- a/storage/innobase/row/row0mysql.c +++ b/storage/innobase/row/row0mysql.c @@ -1486,12 +1486,13 @@ row_unlock_for_mysql( ut_ad(prebuilt && trx); ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); - if (!(srv_locks_unsafe_for_binlog - || trx->isolation_level == TRX_ISO_READ_COMMITTED)) { + if (UNIV_UNLIKELY + (!srv_locks_unsafe_for_binlog + && trx->isolation_level != TRX_ISO_READ_COMMITTED)) { fprintf(stderr, "InnoDB: Error: calling row_unlock_for_mysql though\n" - "InnoDB: srv_locks_unsafe_for_binlog is FALSE and\n" + "InnoDB: innodb_locks_unsafe_for_binlog is FALSE and\n" "InnoDB: this session is not using" " READ COMMITTED isolation level.\n"); From 2cfe32ae428a2ea1c40aee7b4d90d5452be161bb Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Tue, 13 Jan 2009 16:16:03 +0100 Subject: [PATCH 10/19] Fix Bug#32831: libmysql should be built with all charsets Add #define HAVE_CHARSET_name in config-win.h for all character sets that MySQL supports. Add comments to config/ac-macros/character_sets.m4 and config-win.h so hopefully they will be updated in sync. --- config/ac-macros/character_sets.m4 | 3 ++ include/config-win.h | 64 ++++++++++++++++-------------- 2 files changed, 38 insertions(+), 29 deletions(-) diff --git a/config/ac-macros/character_sets.m4 b/config/ac-macros/character_sets.m4 index a9f7bd73858..24bdd92b083 100644 --- a/config/ac-macros/character_sets.m4 +++ b/config/ac-macros/character_sets.m4 @@ -5,6 +5,9 @@ dnl you must also create strings/ctype-$charset_name.c AC_DIVERT_PUSH(0) +# Any changes to the available character sets must also go into +# include/config-win.h + define(CHARSETS_AVAILABLE0,binary) define(CHARSETS_AVAILABLE1,armscii8 ascii big5 cp1250 cp1251 cp1256 cp1257) define(CHARSETS_AVAILABLE2,cp850 cp852 cp866 cp932 dec8 eucjpms euckr gb2312 gbk geostd8) diff --git a/include/config-win.h b/include/config-win.h index c8b9004eb8a..ab0926af864 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -197,11 +197,6 @@ typedef uint rf_SetTimer; #define SIGNAL_WITH_VIO_CLOSE #endif -/* Use all character sets in MySQL */ -#define USE_MB 1 -#define USE_MB_IDENT 1 -#define USE_STRCOLL 1 - /* All windows servers should support .sym files */ #undef USE_SYMDIR #define USE_SYMDIR @@ -371,9 +366,6 @@ inline ulonglong double2ulonglong(double d) #define shared_memory_buffer_length 16000 #define default_shared_memory_base_name "MYSQL" -#define MYSQL_DEFAULT_CHARSET_NAME "latin1" -#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci" - #define HAVE_SPATIAL 1 #define HAVE_RTREE_KEYS 1 @@ -383,40 +375,54 @@ inline ulonglong double2ulonglong(double d) #define COMMUNITY_SERVER 1 #define ENABLED_PROFILING 1 -/* Define charsets you want */ -/* #undef HAVE_CHARSET_armscii8 */ -/* #undef HAVE_CHARSET_ascii */ +/* + Our Windows binaries include all character sets which MySQL supports. + Any changes to the available character sets must also go into + config/ac-macros/character_sets.m4 +*/ + +#define MYSQL_DEFAULT_CHARSET_NAME "latin1" +#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci" + +#define USE_MB 1 +#define USE_MB_IDENT 1 +#define USE_STRCOLL 1 + +#define HAVE_CHARSET_armscii8 +#define HAVE_CHARSET_ascii #define HAVE_CHARSET_big5 1 #define HAVE_CHARSET_cp1250 1 -/* #undef HAVE_CHARSET_cp1251 */ -/* #undef HAVE_CHARSET_cp1256 */ -/* #undef HAVE_CHARSET_cp1257 */ -/* #undef HAVE_CHARSET_cp850 */ -/* #undef HAVE_CHARSET_cp852 */ -/* #undef HAVE_CHARSET_cp866 */ +#define HAVE_CHARSET_cp1251 +#define HAVE_CHARSET_cp1256 +#define HAVE_CHARSET_cp1257 +#define HAVE_CHARSET_cp850 +#define HAVE_CHARSET_cp852 +#define HAVE_CHARSET_cp866 #define HAVE_CHARSET_cp932 1 -/* #undef HAVE_CHARSET_dec8 */ +#define HAVE_CHARSET_dec8 #define HAVE_CHARSET_eucjpms 1 #define HAVE_CHARSET_euckr 1 #define HAVE_CHARSET_gb2312 1 #define HAVE_CHARSET_gbk 1 -/* #undef HAVE_CHARSET_greek */ -/* #undef HAVE_CHARSET_hebrew */ -/* #undef HAVE_CHARSET_hp8 */ -/* #undef HAVE_CHARSET_keybcs2 */ -/* #undef HAVE_CHARSET_koi8r */ -/* #undef HAVE_CHARSET_koi8u */ +#define HAVE_CHARSET_geostd8 +#define HAVE_CHARSET_greek +#define HAVE_CHARSET_hebrew +#define HAVE_CHARSET_hp8 +#define HAVE_CHARSET_keybcs2 +#define HAVE_CHARSET_koi8r +#define HAVE_CHARSET_koi8u #define HAVE_CHARSET_latin1 1 #define HAVE_CHARSET_latin2 1 -/* #undef HAVE_CHARSET_latin5 */ -/* #undef HAVE_CHARSET_latin7 */ -/* #undef HAVE_CHARSET_macce */ -/* #undef HAVE_CHARSET_macroman */ +#define HAVE_CHARSET_latin5 +#define HAVE_CHARSET_latin7 +#define HAVE_CHARSET_macce +#define HAVE_CHARSET_macroman #define HAVE_CHARSET_sjis 1 -/* #undef HAVE_CHARSET_swe7 */ +#define HAVE_CHARSET_swe7 #define HAVE_CHARSET_tis620 1 #define HAVE_CHARSET_ucs2 1 #define HAVE_CHARSET_ujis 1 #define HAVE_CHARSET_utf8 1 + #define HAVE_UCA_COLLATIONS 1 #define HAVE_BOOL 1 From 50958a346a1b79610defb74fcfffbcd73e8e6326 Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Tue, 13 Jan 2009 23:12:16 +0100 Subject: [PATCH 11/19] Apply test case changes for Bug #41671 (innodb-semi-consistent.test) also to partition_innodb_semi_consistent.test, which was overlooked in the innodb-5.1-ss3603 snapshot. --- mysql-test/r/partition_innodb_semi_consistent.result | 5 +++-- mysql-test/t/partition_innodb_semi_consistent.test | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/partition_innodb_semi_consistent.result b/mysql-test/r/partition_innodb_semi_consistent.result index 1bb39af043a..471da4c1c2e 100644 --- a/mysql-test/r/partition_innodb_semi_consistent.result +++ b/mysql-test/r/partition_innodb_semi_consistent.result @@ -1,6 +1,6 @@ drop table if exists t1; set binlog_format=mixed; -set session transaction isolation level read committed; +set session transaction isolation level repeatable read; create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1 @@ -13,11 +13,12 @@ select * from t1 where a=3 lock in share mode; a 3 set binlog_format=mixed; -set session transaction isolation level read committed; +set session transaction isolation level repeatable read; set autocommit=0; update t1 set a=10 where a=5; ERROR HY000: Lock wait timeout exceeded; try restarting transaction commit; +set session transaction isolation level read committed; update t1 set a=10 where a=5; select * from t1 where a=2 for update; ERROR HY000: Lock wait timeout exceeded; try restarting transaction diff --git a/mysql-test/t/partition_innodb_semi_consistent.test b/mysql-test/t/partition_innodb_semi_consistent.test index cfa170f575b..6a6a7cf958e 100644 --- a/mysql-test/t/partition_innodb_semi_consistent.test +++ b/mysql-test/t/partition_innodb_semi_consistent.test @@ -14,7 +14,7 @@ connect (a,localhost,root,,); connect (b,localhost,root,,); connection a; set binlog_format=mixed; -set session transaction isolation level read committed; +set session transaction isolation level repeatable read; create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1 @@ -27,7 +27,7 @@ set autocommit=0; select * from t1 where a=3 lock in share mode; connection b; set binlog_format=mixed; -set session transaction isolation level read committed; +set session transaction isolation level repeatable read; set autocommit=0; -- error ER_LOCK_WAIT_TIMEOUT update t1 set a=10 where a=5; @@ -35,6 +35,8 @@ connection a; #DELETE FROM t1 WHERE a=5; commit; connection b; +# perform a semi-consisent read (and unlock non-matching rows) +set session transaction isolation level read committed; update t1 set a=10 where a=5; connection a; -- error ER_LOCK_WAIT_TIMEOUT @@ -42,6 +44,7 @@ select * from t1 where a=2 for update; # this should lock the records (1),(2) select * from t1 where a=2 limit 1 for update; connection b; +# semi-consistent read will skip non-matching locked rows a=1, a=2 update t1 set a=11 where a=6; -- error ER_LOCK_WAIT_TIMEOUT update t1 set a=12 where a=2; From 80e659a2edd273c9fa5df42fef012cfd6571752f Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Tue, 13 Jan 2009 23:29:11 +0100 Subject: [PATCH 12/19] Fix Bug #35261: date_format test fails if new variables LIKE '%e_format' are added Use SELECT FROM INFORMATION_SCHEMA instead of SHOW VARIABLES LIKE to restrict values correctly. --- mysql-test/r/date_formats.result | 39 ++++++++++++++++++++------------ mysql-test/t/date_formats.test | 21 +++++++++++------ 2 files changed, 38 insertions(+), 22 deletions(-) diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result index 99ae6d85fee..7e185daa668 100644 --- a/mysql-test/r/date_formats.result +++ b/mysql-test/r/date_formats.result @@ -1,14 +1,20 @@ drop table if exists t1; -SHOW GLOBAL VARIABLES LIKE "%e_format"; -Variable_name Value -date_format %d.%m.%Y -datetime_format %Y-%m-%d %H:%i:%s -time_format %H.%i.%s -SHOW SESSION VARIABLES LIKE "%e_format"; -Variable_name Value -date_format %d.%m.%Y -datetime_format %Y-%m-%d %H:%i:%s -time_format %H.%i.%s +SELECT variable_name, variable_value +FROM information_schema.global_variables +WHERE variable_name IN ('date_format', 'datetime_format', 'time_format') +ORDER BY variable_name; +variable_name variable_value +DATETIME_FORMAT %Y-%m-%d %H:%i:%s +DATE_FORMAT %d.%m.%Y +TIME_FORMAT %H.%i.%s +SELECT variable_name, variable_value +FROM information_schema.session_variables +WHERE variable_name IN ('date_format', 'datetime_format', 'time_format') +ORDER BY variable_name; +variable_name variable_value +DATETIME_FORMAT %Y-%m-%d %H:%i:%s +DATE_FORMAT %d.%m.%Y +TIME_FORMAT %H.%i.%s SET time_format='%H%i%s'; SET time_format='%H:%i:%s.%f'; SET time_format='%h-%i-%s.%f%p'; @@ -26,11 +32,14 @@ set datetime_format= '%H:%i:%s %Y-%m-%d'; set datetime_format= '%H:%i:%s.%f %m-%d-%Y'; set datetime_format= '%h:%i:%s %p %Y-%m-%d'; set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d'; -SHOW SESSION VARIABLES LIKE "%e_format"; -Variable_name Value -date_format %m-%d-%Y -datetime_format %h:%i:%s.%f %p %Y-%m-%d -time_format %h:%i:%s%p +SELECT variable_name, variable_value +FROM information_schema.session_variables +WHERE variable_name IN ('date_format', 'datetime_format', 'time_format') +ORDER BY variable_name; +variable_name variable_value +DATETIME_FORMAT %h:%i:%s.%f %p %Y-%m-%d +DATE_FORMAT %m-%d-%Y +TIME_FORMAT %h:%i:%s%p SET time_format='%h:%i:%s'; ERROR 42000: Variable 'time_format' can't be set to the value of '%h:%i:%s' SET time_format='%H %i:%s'; diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test index e474fac8a2a..e5dc7ffa53e 100644 --- a/mysql-test/t/date_formats.test +++ b/mysql-test/t/date_formats.test @@ -6,10 +6,15 @@ drop table if exists t1; --enable_warnings ---replace_result ROW STATEMENT MIXED -SHOW GLOBAL VARIABLES LIKE "%e_format"; ---replace_result ROW STATEMENT MIXED -SHOW SESSION VARIABLES LIKE "%e_format"; +SELECT variable_name, variable_value +FROM information_schema.global_variables +WHERE variable_name IN ('date_format', 'datetime_format', 'time_format') +ORDER BY variable_name; + +SELECT variable_name, variable_value +FROM information_schema.session_variables +WHERE variable_name IN ('date_format', 'datetime_format', 'time_format') +ORDER BY variable_name; # # Test setting a lot of different formats to see which formats are accepted and @@ -36,8 +41,10 @@ set datetime_format= '%H:%i:%s.%f %m-%d-%Y'; set datetime_format= '%h:%i:%s %p %Y-%m-%d'; set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d'; ---replace_result ROW STATEMENT MIXED -SHOW SESSION VARIABLES LIKE "%e_format"; +SELECT variable_name, variable_value +FROM information_schema.session_variables +WHERE variable_name IN ('date_format', 'datetime_format', 'time_format') +ORDER BY variable_name; --error 1231 SET time_format='%h:%i:%s'; @@ -121,7 +128,7 @@ SET datetime_format=default; # Test of str_to_date # -# PS doesn't support fraction of a seconds +# PS doesn't support fractions of a second --disable_ps_protocol select str_to_date(concat('15-01-2001',' 2:59:58.999'), concat('%d-%m-%Y',' ','%H:%i:%s.%f')); From 75e1ed96180cc96721ebb32946001c4b84aabda9 Mon Sep 17 00:00:00 2001 From: Timothy Smith Date: Fri, 16 Jan 2009 17:49:07 +0100 Subject: [PATCH 13/19] Add another cast to ignore int/ulong difference in error types, silence warning on Win64 --- storage/innobase/handler/ha_innodb.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 513ce85ad0c..5d895833f42 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -3687,7 +3687,7 @@ no_commit: /* We don't want to mask autoinc overflow errors. */ if (prebuilt->autoinc_error != DB_SUCCESS) { - error = prebuilt->autoinc_error; + error = (int) prebuilt->autoinc_error; goto report_error; } From 237ef78e1cd978c545b27179fa51cd6ff022210c Mon Sep 17 00:00:00 2001 From: Staale Smedseng Date: Tue, 20 Jan 2009 16:59:20 +0100 Subject: [PATCH 14/19] Adding a test to verify that Bug#27208 "If no current database, character_set_database !=character_set_server" is fixed. --- .../r/character_set_database_func.result | 10 +++++++++ mysql-test/t/character_set_database_func.test | 21 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/mysql-test/r/character_set_database_func.result b/mysql-test/r/character_set_database_func.result index 95b65eacfd2..60628c30187 100644 --- a/mysql-test/r/character_set_database_func.result +++ b/mysql-test/r/character_set_database_func.result @@ -2,6 +2,7 @@ SET @global_character_set_database = @@global.character_set_database; SET @session_character_set_database = @@session.character_set_database; SET @session_character_set_server = @@session.character_set_server; +SET @global_character_set_server = @@global.character_set_server; SET @@global.character_set_database = utf8; 'connect (con1,localhost,root,,,,)' 'connection con1' @@ -71,6 +72,15 @@ SELECT count(*) FROM t1 WHERE CHAR_LENGTH(a)>1; count(*) 1 DROP TABLE IF EXISTS t1; +'Bug#27208: If no current database, character_set_database !=character_set_server' +SET GLOBAL character_set_server=latin5; +CREATE DATABASE csdb CHARACTER SET = utf8; +USE csdb; +DROP DATABASE csdb; +SELECT @@character_set_database; +@@character_set_database +latin5 SET @@global.character_set_database = @global_character_set_database; SET @@session.character_set_database = @session_character_set_database; SET @@session.character_set_server = @session_character_set_server; +SET @@global.character_set_server = @global_character_set_server; diff --git a/mysql-test/t/character_set_database_func.test b/mysql-test/t/character_set_database_func.test index b2d2d017d64..5ba8669c816 100644 --- a/mysql-test/t/character_set_database_func.test +++ b/mysql-test/t/character_set_database_func.test @@ -29,6 +29,7 @@ SET @global_character_set_database = @@global.character_set_database; SET @session_character_set_database = @@session.character_set_database; SET @session_character_set_server = @@session.character_set_server; +SET @global_character_set_server = @@global.character_set_server; SET @@global.character_set_database = utf8; --echo 'connect (con1,localhost,root,,,,)' @@ -106,10 +107,30 @@ SELECT count(*) FROM t1 WHERE CHAR_LENGTH(a)>1; DROP TABLE IF EXISTS t1; --enable_warnings + +#============================================================================== +--echo 'Bug#27208: If no current database, character_set_database !=character_set_server' +#============================================================================== + +SET GLOBAL character_set_server=latin5; + +connect (con2, localhost, root,,); +connection con2; + +CREATE DATABASE csdb CHARACTER SET = utf8; +USE csdb; +DROP DATABASE csdb; +SELECT @@character_set_database; + +connection default; +disconnect con2; + + #restore SET @@global.character_set_database = @global_character_set_database; SET @@session.character_set_database = @session_character_set_database; SET @@session.character_set_server = @session_character_set_server; +SET @@global.character_set_server = @global_character_set_server; ############################################################ # End of functionality Testing for character_set_database # ############################################################ From 4562b69fedb26a5095f45dbe0441c952aa09001c Mon Sep 17 00:00:00 2001 From: Serge Kozlov Date: Wed, 21 Jan 2009 18:48:12 +0300 Subject: [PATCH 15/19] Bug#30128: The reason that sometimes events were executed because without STARTS clause server fires immediately after creating event and time between create and delete event sometimes is enough for firing. So adding STARTS clause moves first execution in future after drop of event 1. Added STARTS clause for CREATE EVENT. 2. Updated result file. --- mysql-test/include/rpl_events.inc | 16 ++++++++++++---- mysql-test/suite/rpl/r/rpl_events.result | 20 +++++++++++--------- mysql-test/suite/rpl/t/rpl_events.test | 6 ++++-- 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/mysql-test/include/rpl_events.inc b/mysql-test/include/rpl_events.inc index 34ceba81a38..0effa8c4e5c 100644 --- a/mysql-test/include/rpl_events.inc +++ b/mysql-test/include/rpl_events.inc @@ -62,7 +62,9 @@ SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name DROP EVENT IF EXISTS test.slave_once; --enable_warnings -CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE DO +# Create an event on slave and check its state. An event shouldn't be executed +# so set start time in 1 hour. +CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO INSERT IGNORE INTO t1(id, c) VALUES (3, 'from slave_once'); --echo "Checking event status on the slave for originator value = slave's server_id" @@ -81,8 +83,11 @@ connection master; DROP EVENT IF EXISTS test.justonce; --enable_warnings +# Create an event on master and check its state on slave. An event shouldn't be executed +# so set start time in 1 hour. Check that changes of event statement replicated to slave + --echo "Creating event test.er on the master" -CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND DO +CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er'); --echo "Checking event status on the master" @@ -95,7 +100,7 @@ SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND connection master; --echo "Altering event test.er on the master" -ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND DO +ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO INSERT IGNORE INTO t1(id, c) VALUES (5, 'from alter er'); --echo "Checking event status on the master" @@ -123,8 +128,11 @@ SELECT db, name, status, originator FROM mysql.event WHERE db = 'test'; # test the DISABLE ON SLAVE for setting event SLAVESIDE_DISABLED as status # on CREATE EVENT +# Create an event on slave and check its status. An event shouldn't be executed +# so set start time in 1 hour. + --echo "Creating event test.slave_terminate on the slave" -CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND DO +CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO INSERT IGNORE INTO t1(id, c) VALUES (6, 'from slave_terminate'); --echo "Checking event status on the slave" diff --git a/mysql-test/suite/rpl/r/rpl_events.result b/mysql-test/suite/rpl/r/rpl_events.result index e4a412cb1d5..b797183f9d2 100644 --- a/mysql-test/suite/rpl/r/rpl_events.result +++ b/mysql-test/suite/rpl/r/rpl_events.result @@ -1,10 +1,11 @@ -set global event_scheduler=1; 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; +SET @old_event_scheduler = @@global.event_scheduler; +set global event_scheduler=1; set binlog_format=row; DROP EVENT IF EXISTS test.justonce; drop table if exists t1,t2; @@ -34,7 +35,7 @@ db name status originator test justonce SLAVESIDE_DISABLED 1 "Dropping event test.slave_once on the slave" DROP EVENT IF EXISTS test.slave_once; -CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE DO +CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO INSERT IGNORE INTO t1(id, c) VALUES (3, 'from slave_once'); "Checking event status on the slave for originator value = slave's server_id" SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_once'; @@ -45,7 +46,7 @@ DROP EVENT IF EXISTS test.slave_once; "Dropping event test.justonce on the master" DROP EVENT IF EXISTS test.justonce; "Creating event test.er on the master" -CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND DO +CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er'); "Checking event status on the master" SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er'; @@ -56,7 +57,7 @@ SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND db name status originator body test er SLAVESIDE_DISABLED 1 INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er') "Altering event test.er on the master" -ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND DO +ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO INSERT IGNORE INTO t1(id, c) VALUES (5, 'from alter er'); "Checking event status on the master" SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er'; @@ -75,7 +76,7 @@ db name status originator SELECT db, name, status, originator FROM mysql.event WHERE db = 'test'; db name status originator "Creating event test.slave_terminate on the slave" -CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND DO +CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO INSERT IGNORE INTO t1(id, c) VALUES (6, 'from slave_terminate'); "Checking event status on the slave" SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate'; @@ -123,7 +124,7 @@ db name status originator test justonce SLAVESIDE_DISABLED 1 "Dropping event test.slave_once on the slave" DROP EVENT IF EXISTS test.slave_once; -CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE DO +CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO INSERT IGNORE INTO t1(id, c) VALUES (3, 'from slave_once'); "Checking event status on the slave for originator value = slave's server_id" SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_once'; @@ -134,7 +135,7 @@ DROP EVENT IF EXISTS test.slave_once; "Dropping event test.justonce on the master" DROP EVENT IF EXISTS test.justonce; "Creating event test.er on the master" -CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND DO +CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er'); "Checking event status on the master" SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er'; @@ -145,7 +146,7 @@ SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND db name status originator body test er SLAVESIDE_DISABLED 1 INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er') "Altering event test.er on the master" -ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND DO +ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO INSERT IGNORE INTO t1(id, c) VALUES (5, 'from alter er'); "Checking event status on the master" SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er'; @@ -164,7 +165,7 @@ db name status originator SELECT db, name, status, originator FROM mysql.event WHERE db = 'test'; db name status originator "Creating event test.slave_terminate on the slave" -CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND DO +CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO INSERT IGNORE INTO t1(id, c) VALUES (6, 'from slave_terminate'); "Checking event status on the slave" SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate'; @@ -190,4 +191,5 @@ select * from t28953; END;| ALTER EVENT event1 RENAME TO event2; DROP EVENT event2; +SET @@global.event_scheduler= @old_event_scheduler; DROP TABLE t28953; diff --git a/mysql-test/suite/rpl/t/rpl_events.test b/mysql-test/suite/rpl/t/rpl_events.test index 2a9cf86fe55..d06a3118389 100644 --- a/mysql-test/suite/rpl/t/rpl_events.test +++ b/mysql-test/suite/rpl/t/rpl_events.test @@ -5,11 +5,12 @@ # in both row based and statement based format # ################################################################## -set global event_scheduler=1; - --source include/not_embedded.inc --source include/master-slave.inc +SET @old_event_scheduler = @@global.event_scheduler; +set global event_scheduler=1; + let $engine_type= MyISAM; set binlog_format=row; @@ -51,5 +52,6 @@ sync_slave_with_master; # that there is no bad timing cauing it to try to access the table. connection master; +SET @@global.event_scheduler= @old_event_scheduler; DROP TABLE t28953; sync_slave_with_master; From 4a3e9851cf4297e48674758fa911eeb0f68c00ed Mon Sep 17 00:00:00 2001 From: Satya B Date: Thu, 22 Jan 2009 11:25:26 +0530 Subject: [PATCH 16/19] TestCase for BUG#41574 - REPAIR TABLE: crashes for compressed tables Extending the existing testcase written for BUG#40949 to verify repair table operation for compressed tables mysql-test/r/myisampack.result: Modified result file for myisampack.test mysql-test/t/myisampack.test: Modified Testcase to test repair operation for compressed tables --- mysql-test/r/myisampack.result | 5 +++++ mysql-test/t/myisampack.test | 3 +++ 2 files changed, 8 insertions(+) diff --git a/mysql-test/r/myisampack.result b/mysql-test/r/myisampack.result index 7ed9b86d887..50d700ab7a2 100644 --- a/mysql-test/r/myisampack.result +++ b/mysql-test/r/myisampack.result @@ -48,4 +48,9 @@ Table Op Msg_type Msg_text test.t1 optimize error Table 'test.t1' is read only Warnings: Error 1036 Table 't1' is read only +repair table t1; +Table Op Msg_type Msg_text +test.t1 repair error Table 'test.t1' is read only +Warnings: +Error 1036 Table 't1' is read only drop table t1; diff --git a/mysql-test/t/myisampack.test b/mysql-test/t/myisampack.test index 3b55154d433..8d4bb83dc01 100644 --- a/mysql-test/t/myisampack.test +++ b/mysql-test/t/myisampack.test @@ -34,6 +34,8 @@ DROP TABLE t1; # # Bug#40949 Debug version of MySQL server crashes when run OPTIMIZE on compressed table. +# expanded with testcase for +# BUG#41574 - REPAIR TABLE: crashes for compressed tables # --disable_warnings drop table if exists t1; @@ -55,4 +57,5 @@ insert into t1 select * from t1; flush tables; --exec $MYISAMPACK $MYSQLTEST_VARDIR/master-data/test/t1 optimize table t1; +repair table t1; drop table t1; From ecfdc3560c1e20c673337420761fa11c084ed2d8 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Thu, 22 Jan 2009 08:28:01 -0200 Subject: [PATCH 17/19] Bug#40264: Aborted cached query causes query to hang indefinitely on next cache hit The problem is that the query cache was storing partial results if the statement failed when sending the results to the client. This could cause clients to hang when trying to read the results from the cache as they would, for example, wait indefinitely for a eof packet that wasn't saved. The solution is to always discard the caching of a query that failed to send its results to the associated client. mysql-test/r/query_cache_notembedded.result: Add test case result for Bug#40264 mysql-test/t/query_cache_notembedded.test: Add test case for Bug#40264 sql/sql_cache.cc: Abort if a unreported error was raised. --- mysql-test/r/query_cache_notembedded.result | 16 +++++++++++ mysql-test/t/query_cache_notembedded.test | 31 +++++++++++++++++++++ sql/sql_cache.cc | 7 ++++- 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/query_cache_notembedded.result b/mysql-test/r/query_cache_notembedded.result index 8e5df012cfb..bf582bfaec6 100644 --- a/mysql-test/r/query_cache_notembedded.result +++ b/mysql-test/r/query_cache_notembedded.result @@ -345,3 +345,19 @@ id drop table t1; drop function f1; set GLOBAL query_cache_size=0; +DROP TABLE IF EXISTS t1; +FLUSH STATUS; +SET GLOBAL query_cache_size=1048576; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2),(3),(4),(5); +SHOW STATUS LIKE 'Qcache_queries_in_cache'; +Variable_name Value +Qcache_queries_in_cache 0 +LOCK TABLES t1 WRITE; +SELECT * FROM t1; +UNLOCK TABLES; +SHOW STATUS LIKE 'Qcache_queries_in_cache'; +Variable_name Value +Qcache_queries_in_cache 0 +DROP TABLE t1; +SET GLOBAL query_cache_size= default; diff --git a/mysql-test/t/query_cache_notembedded.test b/mysql-test/t/query_cache_notembedded.test index a4f4144d9c6..c427e0d1afc 100644 --- a/mysql-test/t/query_cache_notembedded.test +++ b/mysql-test/t/query_cache_notembedded.test @@ -222,3 +222,34 @@ disconnect con2; connection default; set GLOBAL query_cache_size=0; + +# +# Bug#40264: Aborted cached query causes query to hang indefinitely on next cache hit +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +FLUSH STATUS; +SET GLOBAL query_cache_size=1048576; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1),(2),(3),(4),(5); +SHOW STATUS LIKE 'Qcache_queries_in_cache'; +LOCK TABLES t1 WRITE; +connect(con1,localhost,root,,); +--send SELECT * FROM t1 +connection default; +let $show_type= open tables where `table`='t1' and in_use=2; +let $show_pattern= '%t1%2%'; +--source include/wait_show_pattern.inc +dirty_close con1; +UNLOCK TABLES; +let $show_type= open tables where `table`='t1' and in_use=0; +let $show_pattern= '%t1%0%'; +--source include/wait_show_pattern.inc +SHOW STATUS LIKE 'Qcache_queries_in_cache'; +DROP TABLE t1; +SET GLOBAL query_cache_size= default; + +# End of 5.0 tests diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 4a521d83192..b55fa148e24 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -710,7 +710,12 @@ void query_cache_end_of_result(THD *thd) if (thd->net.query_cache_query == 0) DBUG_VOID_RETURN; - if (thd->killed) + /* + Check if the NET layer raised a unreported error -- my_error() and + as a consequence query_cache_abort() haven't been called. Abort the + cached result as it might be only partially complete. + */ + if (thd->killed || thd->net.report_error) { query_cache_abort(&thd->net); DBUG_VOID_RETURN; From 8c3389f3868ebaf95e43df023eb6ac3e7d376ee1 Mon Sep 17 00:00:00 2001 From: Andrei Elkin Date: Thu, 22 Jan 2009 16:55:14 +0200 Subject: [PATCH 18/19] Bug #31240 load data infile replication between (4.0 or 4.1) and 5.1 fails It's a regression issue. The reason of the bug appeared to be an error introduced into 5.1 source code. A piece of code in Create_file_log_event::do_apply_event() did not have test coverage which made make test and pb unaware. Fixed with inverting the old value of the return value from Create_file_log_event::do_apply_event(). The rpl test suite is extended with `rpl_cross_version' the file to hold regression cases similar to the current. mysql-test/suite/rpl/r/rpl_cross_version.result: new results file mysql-test/suite/rpl/t/rpl_cross_version-master.opt: options to the server to be able to start replication to itself mysql-test/suite/rpl/t/rpl_cross_version.test: regression test for bug#31240. sql/log_event.cc: Correcting the return value from Create_file_log_event::do_apply_event() --- .../suite/rpl/r/rpl_cross_version.result | 12 +++++++ .../suite/rpl/t/rpl_cross_version-master.opt | 1 + mysql-test/suite/rpl/t/rpl_cross_version.test | 36 +++++++++++++++++++ sql/log_event.cc | 11 ++++-- 4 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 mysql-test/suite/rpl/r/rpl_cross_version.result create mode 100644 mysql-test/suite/rpl/t/rpl_cross_version-master.opt create mode 100644 mysql-test/suite/rpl/t/rpl_cross_version.test diff --git a/mysql-test/suite/rpl/r/rpl_cross_version.result b/mysql-test/suite/rpl/r/rpl_cross_version.result new file mode 100644 index 00000000000..96bbbb03c49 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_cross_version.result @@ -0,0 +1,12 @@ +==== Initialize ==== +Setting up fake replication from MYSQL_TEST_DIR/suite/binlog/std_data/binlog_old_version_4_1.000001 +==== Test ==== +start slave sql_thread; +==== a prove that the /home/andrei/MySQL/BZR/FIXES/bug31240-ldi_41_2_51/mysql-test/suite/binlog/std_data/binlog_old_version_4_1.000001 has been processed successfully ==== +SELECT COUNT(*) - 17920 as zero FROM t3; +zero +0 +==== Clean up ==== +stop slave sql_thread; +Cleaning up after setup_fake_relay_log.inc +drop table t1, t3; diff --git a/mysql-test/suite/rpl/t/rpl_cross_version-master.opt b/mysql-test/suite/rpl/t/rpl_cross_version-master.opt new file mode 100644 index 00000000000..815a8f81d32 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_cross_version-master.opt @@ -0,0 +1 @@ +--replicate-same-server-id --relay-log=slave-relay-bin diff --git a/mysql-test/suite/rpl/t/rpl_cross_version.test b/mysql-test/suite/rpl/t/rpl_cross_version.test new file mode 100644 index 00000000000..9f81cf3a9e5 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_cross_version.test @@ -0,0 +1,36 @@ +# ==== Purpose ==== +# +# Verify cross-version replication from an old master to the up-to-date slave +# +# ==== Implementation ==== +# +# Feed to the slave server a binlog recorded on an old version master +# via setting up slave-to-slave replication. The latter is done by means of +# the opt file and include/setup_fake_relay_log.inc. +# The master's binlog is treated as a relay log that the SQL thread executes. +# + +--source include/have_log_bin.inc + +# +# Bug#31240 load data infile replication between (4.0 or 4.1) and 5.1 fails +# + +--echo ==== Initialize ==== +# the relay log contains create t1, t3 tables and load data infile +--let $fake_relay_log = $MYSQL_TEST_DIR/suite/binlog/std_data/binlog_old_version_4_1.000001 +--source include/setup_fake_relay_log.inc + +--echo ==== Test ==== +start slave sql_thread; +--let $slave_param = Exec_Master_Log_Pos +# end_log_pos of the last event of the relay log +--let $slave_param_value = 149436 +--source include/wait_for_slave_param.inc +--echo ==== a prove that the $fake_relay_log has been processed successfully ==== +SELECT COUNT(*) - 17920 as zero FROM t3; + +--echo ==== Clean up ==== +stop slave sql_thread; +--source include/cleanup_fake_relay_log.inc +drop table t1, t3; diff --git a/sql/log_event.cc b/sql/log_event.cc index 3a3350a4eb8..be209b6c6c7 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -5945,8 +5945,15 @@ void Create_file_log_event::pack_info(Protocol *protocol) #endif /* defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) */ -/* +/** Create_file_log_event::do_apply_event() + Constructor for Create_file_log_event to intantiate an event + from the relay log on the slave. + + @retval + 0 Success + @retval + 1 Failure */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) @@ -6015,7 +6022,7 @@ err: if (fd >= 0) my_close(fd, MYF(0)); thd_proc_info(thd, 0); - return error == 0; + return error != 0; } #endif /* defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) */ From db337eb8d8c2dc6c343b89ac78be8966d14a85fc Mon Sep 17 00:00:00 2001 From: Andrei Elkin Date: Fri, 23 Jan 2009 19:15:27 +0200 Subject: [PATCH 19/19] Bug #31240 load data infile replication between (4.0 or 4.1) and 5.1 fails an additional changeset to remove printing a path name. mysql-test/suite/rpl/r/rpl_cross_version.result: removing a local exec env dependency mysql-test/suite/rpl/t/rpl_cross_version.test: refining a test to not have local exec env dependency. --- mysql-test/suite/rpl/r/rpl_cross_version.result | 2 +- mysql-test/suite/rpl/t/rpl_cross_version.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_cross_version.result b/mysql-test/suite/rpl/r/rpl_cross_version.result index 96bbbb03c49..de5dd134516 100644 --- a/mysql-test/suite/rpl/r/rpl_cross_version.result +++ b/mysql-test/suite/rpl/r/rpl_cross_version.result @@ -2,7 +2,7 @@ Setting up fake replication from MYSQL_TEST_DIR/suite/binlog/std_data/binlog_old_version_4_1.000001 ==== Test ==== start slave sql_thread; -==== a prove that the /home/andrei/MySQL/BZR/FIXES/bug31240-ldi_41_2_51/mysql-test/suite/binlog/std_data/binlog_old_version_4_1.000001 has been processed successfully ==== +==== a prove that the fake has been processed successfully ==== SELECT COUNT(*) - 17920 as zero FROM t3; zero 0 diff --git a/mysql-test/suite/rpl/t/rpl_cross_version.test b/mysql-test/suite/rpl/t/rpl_cross_version.test index 9f81cf3a9e5..bb2ca350152 100644 --- a/mysql-test/suite/rpl/t/rpl_cross_version.test +++ b/mysql-test/suite/rpl/t/rpl_cross_version.test @@ -27,7 +27,7 @@ start slave sql_thread; # end_log_pos of the last event of the relay log --let $slave_param_value = 149436 --source include/wait_for_slave_param.inc ---echo ==== a prove that the $fake_relay_log has been processed successfully ==== +--echo ==== a prove that the fake has been processed successfully ==== SELECT COUNT(*) - 17920 as zero FROM t3; --echo ==== Clean up ====