From 85d4cbae24d0a6d86911a1845d0c3fe24f48c36e Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Fri, 28 Nov 2008 18:17:13 +0400 Subject: [PATCH 01/15] BUG#37245 - Full text search problem Certain boolean mode queries with truncation operator did not return matching records and calculate relevancy incorrectly. --- myisam/ft_boolean_search.c | 38 ++++++++++++++++++++++++++++++------ mysql-test/r/fulltext.result | 9 +++++++++ mysql-test/t/fulltext.test | 9 +++++++++ 3 files changed, 50 insertions(+), 6 deletions(-) diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c index 57de75ee4be..255c51fd33a 100644 --- a/myisam/ft_boolean_search.c +++ b/myisam/ft_boolean_search.c @@ -122,11 +122,11 @@ static int FTB_WORD_cmp(my_off_t *v, FTB_WORD *a, FTB_WORD *b) static int FTB_WORD_cmp_list(CHARSET_INFO *cs, FTB_WORD **a, FTB_WORD **b) { - /* ORDER BY word DESC, ndepth DESC */ - int i= mi_compare_text(cs, (uchar*) (*b)->word+1,(*b)->len-1, - (uchar*) (*a)->word+1,(*a)->len-1,0,0); + /* ORDER BY word, ndepth */ + int i= mi_compare_text(cs, (uchar*) (*a)->word + 1, (*a)->len - 1, + (uchar*) (*b)->word + 1, (*b)->len - 1, 0, 0); if (!i) - i=CMP_NUM((*b)->ndepth,(*a)->ndepth); + i= CMP_NUM((*a)->ndepth, (*b)->ndepth); return i; } @@ -674,23 +674,49 @@ float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length) (byte *) end, &word, TRUE)) { int a, b, c; + /* + Find right-most element in the array of query words matching this + word from a document. + */ for (a=0, b=ftb->queue.elements, c=(a+b)/2; b-a>1; c=(a+b)/2) { ftbw=ftb->list[c]; if (mi_compare_text(ftb->charset, (uchar*) word.pos, word.len, (uchar*) ftbw->word+1, ftbw->len-1, - (my_bool) (ftbw->flags&FTB_FLAG_TRUNC),0) >0) + (my_bool) (ftbw->flags & FTB_FLAG_TRUNC), 0) < 0) b=c; else a=c; } + /* + If there were no words with truncation operator, we iterate to the + beginning of an array until array element is equal to the word from + a document. This is done mainly because the same word may be + mentioned twice (or more) in the query. + + In case query has words with truncation operator we must iterate + to the beginning of the array. There may be non-matching query words + between matching word with truncation operator and the right-most + matching element. E.g., if we're looking for 'aaa15' in an array of + 'aaa1* aaa14 aaa15 aaa16'. + + Worse of that there still may be match even if the binary search + above didn't find matching element. E.g., if we're looking for + 'aaa15' in an array of 'aaa1* aaa14 aaa16'. The binary search will + stop at 'aaa16'. + */ for (; c>=0; c--) { ftbw=ftb->list[c]; if (mi_compare_text(ftb->charset, (uchar*) word.pos, word.len, (uchar*) ftbw->word+1,ftbw->len-1, (my_bool) (ftbw->flags&FTB_FLAG_TRUNC),0)) - break; + { + if (ftb->with_scan & FTB_FLAG_TRUNC) + continue; + else + break; + } if (ftbw->docid[1] == docid) continue; ftbw->docid[1]=docid; diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index e73f8af405c..6821691c9d0 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -497,3 +497,12 @@ WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref b b 5 const 4 Using where DROP TABLE t1; +CREATE TABLE t1(a CHAR(10)); +INSERT INTO t1 VALUES('aaa15'); +SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa16' IN BOOLEAN MODE) FROM t1; +MATCH(a) AGAINST('aaa1* aaa14 aaa16' IN BOOLEAN MODE) +1 +SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE) FROM t1; +MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE) +2 +DROP TABLE t1; diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index fa087d89efb..77d84c730d9 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -423,3 +423,12 @@ EXPLAIN SELECT * FROM t1 FORCE INDEX(b) WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1; DROP TABLE t1; + +# +# BUG#37245 - Full text search problem +# +CREATE TABLE t1(a CHAR(10)); +INSERT INTO t1 VALUES('aaa15'); +SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa16' IN BOOLEAN MODE) FROM t1; +SELECT MATCH(a) AGAINST('aaa1* aaa14 aaa15 aaa16' IN BOOLEAN MODE) FROM t1; +DROP TABLE t1; From 40889f9ea6643620509f6978316a40d209b92b18 Mon Sep 17 00:00:00 2001 From: Andrei Elkin Date: Tue, 2 Dec 2008 19:32:07 +0200 Subject: [PATCH 02/15] Bug #40221 Replication failure on RBR + UPDATE the primary key A transaction could result in having an extra event after a query that errored e.g because of a dup key. Such a query is rolled back in innodb, as specified, but has not been in binlog. It appeares that the binlog engine did not always register for a query (statement) because the previous query had not reset at its statement commit time. Because of that fact there was no roll-back to the trx_data->before_stmt_pos position and a the pending event of the errorred query could become flushed to the binlog file. Fixed with deploying the reset of trx_data->before_stmt_pos at the end of the query processing. --- .../suite/binlog/r/binlog_innodb_row.result | 22 ++++++++++++++++ .../suite/binlog/t/binlog_innodb_row.test | 26 +++++++++++++++++++ sql/log.cc | 18 +++++++++---- 3 files changed, 61 insertions(+), 5 deletions(-) create mode 100644 mysql-test/suite/binlog/r/binlog_innodb_row.result create mode 100644 mysql-test/suite/binlog/t/binlog_innodb_row.test diff --git a/mysql-test/suite/binlog/r/binlog_innodb_row.result b/mysql-test/suite/binlog/r/binlog_innodb_row.result new file mode 100644 index 00000000000..47ddcbd00f6 --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_innodb_row.result @@ -0,0 +1,22 @@ +CREATE TABLE t1 (pk int auto_increment primary key) ENGINE=innodb; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `pk` int(11) NOT NULL AUTO_INCREMENT, + PRIMARY KEY (`pk`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +reset master; +begin; +insert into t1 values (1),(2); +*** the following UPDATE query wont generate any updates for the binlog *** +update t1 set pk = 3 where pk < 3; +ERROR 23000: Duplicate entry '3' for key 'PRIMARY' +commit; +*** Results of the test: the binlog must have only Write_rows events not any Update_rows *** +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +drop table t1; diff --git a/mysql-test/suite/binlog/t/binlog_innodb_row.test b/mysql-test/suite/binlog/t/binlog_innodb_row.test new file mode 100644 index 00000000000..7f42f5b95cb --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_innodb_row.test @@ -0,0 +1,26 @@ +# +# Tests of innodb/binlog with the row binlog format +# +source include/have_innodb.inc; +source include/have_log_bin.inc; +source include/have_binlog_format_row.inc; + +# +# Bug #40221 Replication failure on RBR + UPDATE the primary key +# + +CREATE TABLE t1 (pk int auto_increment primary key) ENGINE=innodb; +show create table t1; +reset master; + +begin; +insert into t1 values (1),(2); +--echo *** the following UPDATE query wont generate any updates for the binlog *** +--error ER_DUP_ENTRY +update t1 set pk = 3 where pk < 3; +commit; + +--echo *** Results of the test: the binlog must have only Write_rows events not any Update_rows *** +source include/show_binlog_events.inc; + +drop table t1; diff --git a/sql/log.cc b/sql/log.cc index fb8669a5731..8169ff08590 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -207,6 +207,7 @@ public: truncate(0); before_stmt_pos= MY_OFF_T_UNDEF; trans_log.end_of_file= max_binlog_cache_size; + DBUG_ASSERT(empty()); } Rows_log_event *pending() const @@ -1377,8 +1378,6 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data, FLAGSTR(thd->options, OPTION_NOT_AUTOCOMMIT), FLAGSTR(thd->options, OPTION_BEGIN))); - thd->binlog_flush_pending_rows_event(TRUE); - /* NULL denotes ROLLBACK with nothing to replicate: i.e., rollback of only transactional tables. If the transaction contain changes to @@ -1387,6 +1386,7 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data, */ if (end_ev != NULL) { + thd->binlog_flush_pending_rows_event(TRUE); /* Doing a commit or a rollback including non-transactional tables, i.e., ending a transaction where we might write the transaction @@ -1435,6 +1435,7 @@ binlog_end_trans(THD *thd, binlog_trx_data *trx_data, mysql_bin_log.update_table_map_version(); } + DBUG_ASSERT(thd->binlog_get_pending_rows_event() == NULL); DBUG_RETURN(error); } @@ -1466,6 +1467,7 @@ static int binlog_prepare(handlerton *hton, THD *thd, bool all) */ static int binlog_commit(handlerton *hton, THD *thd, bool all) { + int error= 0; DBUG_ENTER("binlog_commit"); binlog_trx_data *const trx_data= (binlog_trx_data*) thd_get_ha_data(thd, binlog_hton); @@ -1552,10 +1554,14 @@ static int binlog_commit(handlerton *hton, THD *thd, bool all) { Query_log_event qev(thd, STRING_WITH_LEN("COMMIT"), TRUE, FALSE); qev.error_code= 0; // see comment in MYSQL_LOG::write(THD, IO_CACHE) - int error= binlog_end_trans(thd, trx_data, &qev, all); - DBUG_RETURN(error); + error= binlog_end_trans(thd, trx_data, &qev, all); + goto end; } - DBUG_RETURN(0); + +end: + if (!all) + trx_data->before_stmt_pos = MY_OFF_T_UNDEF; // part of the stmt commit + DBUG_RETURN(error); } /** @@ -1615,6 +1621,8 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all) */ error= binlog_end_trans(thd, trx_data, 0, all); } + if (!all) + trx_data->before_stmt_pos = MY_OFF_T_UNDEF; // part of the stmt rollback DBUG_RETURN(error); } From 33cf11b4285c83f0ba90178fb9fe8c039d0de129 Mon Sep 17 00:00:00 2001 From: Patrick Crews Date: Fri, 5 Dec 2008 08:21:03 -0500 Subject: [PATCH 03/15] Bug#41258: mysql-test-run does not copy subdirectories of std_data on Windows (5.0 only) Altered how we copy data from mysql-test/std_data on Windows to match what we are doing in 5.1 and 6.0 --- mysql-test/mysql-test-run.pl | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 268dd3fbd16..70637034b6e 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2380,13 +2380,7 @@ sub setup_vardir() { { # on windows, copy all files from std_data into var/std_data_ln mkpath("$opt_vardir/std_data_ln"); - opendir(DIR, "$glob_mysql_test_dir/std_data") - or mtr_error("Can't find the std_data directory: $!"); - for(readdir(DIR)) { - next if -d "$glob_mysql_test_dir/std_data/$_"; - copy("$glob_mysql_test_dir/std_data/$_", "$opt_vardir/std_data_ln/$_"); - } - closedir(DIR); + mtr_copy_dir("$glob_mysql_test_dir/std_data", "$opt_vardir/std_data_ln"); } # Remove old log files From b16ba9aa332735d87c5b3de2ae77b38b098cd55e Mon Sep 17 00:00:00 2001 From: Matthias Leich Date: Mon, 8 Dec 2008 15:36:42 +0100 Subject: [PATCH 04/15] Fix for Bug#40904 20 tests in 5.1 are disabled in a bad manner - remove totally wrong (syntax) entries from disabled.def - remove entries belonging to deleted tests from disabled.def - correct the comments (correct the bug mentioned) of entries in disabled.def - remove never completed tests which were accidently pushed --- mysql-test/suite/funcs_2/t/disabled.def | 8 +- mysql-test/suite/ndb/t/disabled.def | 3 +- .../suite/parts/r/partition_bit_ndb.result | 126 ------ mysql-test/suite/parts/t/disabled.def | 5 - .../suite/parts/t/partition_bit_ndb.test | 60 --- .../suite/parts/t/partition_sessions.test | 391 ------------------ .../suite/parts/t/partition_value_innodb.test | 12 +- .../suite/parts/t/partition_value_myisam.test | 12 +- .../suite/parts/t/partition_value_ndb.test | 12 +- mysql-test/suite/rpl_ndb/t/disabled.def | 4 +- mysql-test/t/disabled.def | 3 +- 11 files changed, 35 insertions(+), 601 deletions(-) delete mode 100644 mysql-test/suite/parts/r/partition_bit_ndb.result delete mode 100644 mysql-test/suite/parts/t/partition_bit_ndb.test delete mode 100644 mysql-test/suite/parts/t/partition_sessions.test diff --git a/mysql-test/suite/funcs_2/t/disabled.def b/mysql-test/suite/funcs_2/t/disabled.def index c903662e052..da6230bd7ed 100644 --- a/mysql-test/suite/funcs_2/t/disabled.def +++ b/mysql-test/suite/funcs_2/t/disabled.def @@ -1,6 +1,6 @@ # Disabled by hhunger (2008-03-03) due to WL4204 -innodb_charset : Due to bug#20447 -myisam_charset : Due to bug#20477 -memory_charset : Due to bug#20447 -ndb_charset : Due to bug#20447 +innodb_charset : Bug#20447 Problem with prefix keys with contractions and expansions +myisam_charset : Bug#20447 Problem with prefix keys with contractions and expansions +memory_charset : Bug#20447 Problem with prefix keys with contractions and expansions +ndb_charset : Bug#20447 Problem with prefix keys with contractions and expansions diff --git a/mysql-test/suite/ndb/t/disabled.def b/mysql-test/suite/ndb/t/disabled.def index c638c7b4774..0fc9a5d3ad6 100644 --- a/mysql-test/suite/ndb/t/disabled.def +++ b/mysql-test/suite/ndb/t/disabled.def @@ -9,8 +9,7 @@ # Do not use any TAB characters for whitespace. # ############################################################################## -partition_03ndb : BUG#16385 2006-03-24 mikael Partitions: crash when updating a range partitioned NDB table -ndb_partition_error2 : HF is not sure if the test can work as internded on all the platforms +ndb_partition_error2 : Bug#40989 ndb_partition_error2 needs maintenance # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open diff --git a/mysql-test/suite/parts/r/partition_bit_ndb.result b/mysql-test/suite/parts/r/partition_bit_ndb.result deleted file mode 100644 index add3ed394ad..00000000000 --- a/mysql-test/suite/parts/r/partition_bit_ndb.result +++ /dev/null @@ -1,126 +0,0 @@ -SET @max_row = 20; -create table t1 (a bit(65), primary key (a)) partition by key (a); -ERROR 42000: Display width out of range for column 'a' (max = 64) -create table t1 (a bit(0), primary key (a)) partition by key (a); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` bit(1) NOT NULL DEFAULT '\0', - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) */ -drop table t1; -create table t1 (a bit(0), primary key (a)) partition by key (a) ( -partition pa1 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp', -partition pa2 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp'); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` bit(1) NOT NULL DEFAULT '\0', - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' -/*!50100 PARTITION BY KEY (a) -(PARTITION pa1 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, - PARTITION pa2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ -drop table t1; -create table t1 (a bit(64), primary key (a)) partition by key (a); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0', - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) */ -insert into t1 values -(b'1111111111111111111111111111111111111111111111111111111111111111'), -(b'1000000000000000000000000000000000000000000000000000000000000000'), -(b'0000000000000000000000000000000000000000000000000000000000000001'), -(b'1010101010101010101010101010101010101010101010101010101010101010'), -(b'0101010101010101010101010101010101010101010101010101010101010101'); -select hex(a) from t1; -hex(a) -1 -5555555555555555 -8000000000000000 -AAAAAAAAAAAAAAAA -FFFFFFFFFFFFFFFF -drop table t1; -create table t1 (a bit(64), primary key (a)) partition by key (a)( -partition pa1 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=20 min_rows=2, -partition pa2 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=30 min_rows=3, -partition pa3 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=30 min_rows=4, -partition pa4 DATA DIRECTORY = -'/tmp' INDEX DIRECTORY = -'/tmp' max_rows=40 min_rows=2); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0', - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='/tmp/' INDEX DIRECTORY='/tmp/' -/*!50100 PARTITION BY KEY (a) -(PARTITION pa1 MAX_ROWS = 20 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, - PARTITION pa2 MAX_ROWS = 30 MIN_ROWS = 3 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, - PARTITION pa3 MAX_ROWS = 30 MIN_ROWS = 4 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM, - PARTITION pa4 MAX_ROWS = 40 MIN_ROWS = 2 DATA DIRECTORY = '/tmp' INDEX DIRECTORY = '/tmp' ENGINE = MyISAM) */ -insert into t1 values -(b'1111111111111111111111111111111111111111111111111111111111111111'), -(b'1000000000000000000000000000000000000000000000000000000000000000'), -(b'0000000000000000000000000000000000000000000000000000000000000001'), -(b'1010101010101010101010101010101010101010101010101010101010101010'), -(b'0101010101010101010101010101010101010101010101010101010101010101'); -select hex(a) from t1; -hex(a) -1 -5555555555555555 -8000000000000000 -AAAAAAAAAAAAAAAA -FFFFFFFFFFFFFFFF -drop table t1; -create table t1 (a bit, primary key (a)) partition by key (a); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` bit(1) NOT NULL DEFAULT '\0', - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) */ -insert into t1 values (b'0'), (b'1'); -select hex(a) from t1; -hex(a) -0 -1 -alter table t1 drop primary key; -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` bit(1) NOT NULL DEFAULT '\0' -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) */ -select hex(a) from t1; -hex(a) -0 -1 -alter table t1 add primary key (a); -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` bit(1) NOT NULL DEFAULT '\0', - PRIMARY KEY (`a`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -/*!50100 PARTITION BY KEY (a) */ -select hex(a) from t1; -hex(a) -0 -1 -drop table t1; diff --git a/mysql-test/suite/parts/t/disabled.def b/mysql-test/suite/parts/t/disabled.def index b9cd3462635..518a3c90422 100644 --- a/mysql-test/suite/parts/t/disabled.def +++ b/mysql-test/suite/parts/t/disabled.def @@ -1,8 +1,3 @@ partition_basic_ndb : Bug#19899 Crashing the server # http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-limitations-syntax.html -partition_bit_ndb : NDB does not support bit column in index -partition_sessions : needs system_3_init.inc partition_syntax_ndb : Bug#36735 Not supported -partition_value_innodb : Bug#30581 partition_value tests use disallowed CAST() function -partition_value_myisam : Bug#30581 partition_value tests use disallowed CAST() function -partition_value_ndb : Bug#30581 partition_value tests use disallowed CAST() function diff --git a/mysql-test/suite/parts/t/partition_bit_ndb.test b/mysql-test/suite/parts/t/partition_bit_ndb.test deleted file mode 100644 index 227d3d53401..00000000000 --- a/mysql-test/suite/parts/t/partition_bit_ndb.test +++ /dev/null @@ -1,60 +0,0 @@ -################################################################################ -# t/partition_bit_ndb.test # -# # -# Purpose: # -# Tests around bit type # -# NDB branch # -# # -#------------------------------------------------------------------------------# -# Original Author: HH # -# Original Date: 2006-08-01 # -# Change Author: # -# Change Date: # -# Change: # -################################################################################ - -# -# NOTE: PLEASE DO NOT ADD NOT MYISAM SPECIFIC TESTCASES HERE ! -# TESTCASES WHICH MUST BE APPLIED TO ALL STORAGE ENGINES MUST BE ADDED IN -# THE SOURCED FILES ONLY. -# -# Please read the README at the end of inc/partition.pre before changing -# any of the variables. -# - -#------------------------------------------------------------------------------# -# General not engine specific settings and requirements - -##### Options, for debugging support ##### -let $debug= 0; -let $with_partitioning= 1; - -##### Option, for displaying files ##### -let $ls= 1; - -##### Number of rows for the INSERT/UPDATE/DELETE/SELECT experiments ##### -# on partioned tables -SET @max_row = 20; - -# The server must support partitioning. ---source include/have_partition.inc - -#------------------------------------------------------------------------------# -# Engine specific settings and requirements - -##### Storage engine to be tested ---source include/have_ndb.inc -let $engine= 'NDB'; -connection default; - -# range, list and hash partitioning in ndb requires new_mode ---disable_query_log -set new=on; ---enable_query_log -##### Assign a big number smaller than the maximum value for partitions ##### -# and smaller than the maximum value of SIGNED INTEGER -let $MAX_VALUE= (2147483646); - -#------------------------------------------------------------------------------# -# Execute the tests to be applied to all storage engines ---source suite/parts/inc/partition_bit.inc diff --git a/mysql-test/suite/parts/t/partition_sessions.test b/mysql-test/suite/parts/t/partition_sessions.test deleted file mode 100644 index 3d59292bee5..00000000000 --- a/mysql-test/suite/parts/t/partition_sessions.test +++ /dev/null @@ -1,391 +0,0 @@ - -#-------------------------------------------------- -# Initialize system_3 test variables -#-------------------------------------------------- - ---source suite/system_3/include/system_3_init.inc - -let $NUM_VAL=`SELECT @NUM_VAL`; -let $LOAD_LINES=`SELECT @LOAD_LINES`; -let $LOG_UPPER=`SELECT @LOG_UPPER`; -let $LOG_LOWER=`SELECT @LOG_LOWER`; -#let $ENG1=`SELECT @ENG1`; -let $ENG2=`SELECT @ENG2`; -let $ENG_LOG=`SELECT @ENG_LOG`; -let $CLIENT_HOST=`SELECT @CLIENT_HOST`; -let $ENG=innodb; -let $ENG1=innodb; -#--------------------------------------------------------- -# Column list with definition for all tables to be checked -#--------------------------------------------------------- - -let $column_list= f1 int, -f2 char (15), -f3 decimal (5,3), -f4 datetime; - -let $col_access_list = f1,f2,f3,f4 ; -let $col_new_list = new.f1,new.f2,new.f3 new.f4 ; - -#--------------------------------------------------- -# Setting the parameters to use during testing -#--------------------------------------------------- -# Set number of variations of the f1 variable (used to segment the rows -# being updated/deleted by a user at a time. The higher the number, the -# more smaller segments used with each query. ---replace_result $NUM_VAL NUM_VAL -eval set @f1_nums=$NUM_VAL; - -# The following sets the number controls the size of the log table. -# Once a size of '@threshold' is reached, the first rows are removed -# sunch that the table is down to '@shrink_to' lines ---replace_result $LOG_LOWER LOG_LOWER -eval set @shrink_to=$LOG_LOWER; ---replace_result $LOG_UPPER LOG_UPPER -eval set @threshold=$LOG_UPPER; - -#--------------------------------------------------- -# Creating the database tables and loading the data -#--------------------------------------------------- - ---disable_warnings -drop database if exists systest1; ---enable_warnings - -create database systest1; - ---disable_abort_on_error ---replace_result $CLIENT_HOST CLIENT_HOST -eval create user systuser@'$CLIENT_HOST'; ---enable_abort_on_error ---replace_result $CLIENT_HOST CLIENT_HOST -eval set password for systuser@'$CLIENT_HOST' = password('systpass'); ---replace_result $CLIENT_HOST CLIENT_HOST -eval grant ALL on systest1.* to systuser@'$CLIENT_HOST'; -use systest1; ---replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK -connect (systuser,localhost,systuser,systpass,systest1,$MASTER_MYPORT,$MASTER_MYSOCK); - -create table tb1_master ( - f1 int, - f2 char(15), - f3 decimal (5,3), - f4 datetime -); - -#--replace_result $ENG_LOG ENG_LOG -eval create table tb1_logs ( - i1 int NOT NULL auto_increment, primary key (i1), - dt1 datetime NOT NULL, - entry_dsc char(100), - f4 int -) engine=$ENG_LOG -; -#PARTITION BY HASH (i1) PARTITIONS 8; - -if ($debug) -{ -SHOW CREATE TABLE tb1_logs; -} - -#--replace_result $ENG_LOG ENG_LOG -eval create table ddl_logs ( - i1 int NOT NULL auto_increment, primary key (i1), - dt1 datetime NOT NULL, - entry_dsc char(100), - errno int -) engine=$ENG_LOG; -#PARTITION BY HASH (i1) PARTITIONS 8; - -if ($debug) -{ -SHOW CREATE TABLE tb1_logs; -} -create table test_stat ( - dt1 datetime, - table_name char(20), - row_count int, - start_row int, - end_row int -); - -#---------------------------------------------------------------------- -# tb3_eng1: key partitioning -#---------------------------------------------------------------------- - -#--replace_result $ENG1 ENG1 -eval create table tb3_eng1 ( - i1 int NOT NULL auto_increment, primary key (i1), - $column_list -) engine=$ENG1 -PARTITION BY KEY (i1) PARTITIONS 4 -(PARTITION part1, -PARTITION part2, -PARTITION part3, -PARTITION part4); - -#--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR -eval load data local infile '$MYSQL_TEST_DIR/suite/system_3/data/tb1.txt' - into table tb3_eng1 ($col_access_list); - -if ($WITH_TRIGGERS) -{ -delimiter //; - -Create trigger tb3_eng1_ins after insert on tb3_eng1 for each row -BEGIN - insert into tb1_logs (dt1, entry_dsc, f4) - values (now(), concat('Insert row ', new.f1,' ', - new.f2, ' ', new.f3, ' (tb3_eng1)'), new.f1); -END// - -Create trigger tb3_eng1_upd after update on tb3_eng1 for each row -BEGIN - insert into tb1_logs (dt1, entry_dsc, f4) - values (now(), concat('Update row ', old.f1,' ', old.f2, '->', - new.f2, ' ', old.f3, '->', new.f3, ' (tb3_eng1)'), new.f1); -END// - -Create trigger tb3_eng1_del after delete on tb3_eng1 for each row -BEGIN - insert into tb1_logs (dt1, entry_dsc, f4) - values (now(), concat('Delete row ', old.f1,' ', old.f2, ' ', - old.f3, ' (tb3_eng1)'), old.f1); -END// - -delimiter ;// -} -delimiter //; - -# This functions returns a random integer number -# between zero and 'num' -#----------------------------------------------- -create function int_rand(num int) returns int -BEGIN - return round(num*rand()+0.5); -END// - -# This function returns a string in the length 'len' of -# random letters (ascii range of 65-122) -#------------------------------------------------------ -create function str_rand (len int) returns char(12) -BEGIN - declare tmp_letter char(1); - declare tmp_word char(12); - declare word_str char(12) default ''; - wl_loop: WHILE len DO - set tmp_letter=char(round(57*rand()+65)); - set tmp_word=concat(word_str,tmp_letter); - set word_str=tmp_word; - set len=len-1; - END WHILE wl_loop; - return word_str; -END// - - -# This procedure scans 'tb1_master' table for rows where f1='num_pr' -# and for each row inserts a row in 'tb3_eng1' -#------------------------------------------------------------------ -eval create procedure ins_tb3_eng1 (num_pr int, str_pr char(15)) -BEGIN - declare done int default 0; - declare v3 decimal(5,3); - declare cur1 cursor for - select f3 from tb1_master where f1=num_pr; - declare continue handler for sqlstate '01000' set done = 1; - declare continue handler for sqlstate '02000' set done = 1; - open cur1; - fetch cur1 into v3; - wl_loop: WHILE NOT done DO - insert into tb3_eng1 ($col_access_list) values - (int_rand(@f1_nums), concat('I:',str_pr,'-',num_pr), v3, now()); - fetch cur1 into v3; - END WHILE wl_loop; - close cur1; -END// - - -# This procedure does selects from the 'tb1_logs' and inserts the -# count into the table -#------------------------------------------------------------------ -create procedure slct_tb1_logs () -BEGIN - declare done int default 0; - declare v4 int; - declare v_count int default 0; - declare str_val char(15) default ELT(int_rand(3), - 'Insert', 'Update', 'Delete'); - declare cur1 cursor for - select f4 from tb1_logs where entry_dsc like concat('%',str_val,'%'); - declare continue handler for sqlstate '01000' set done = 1; - declare continue handler for sqlstate '02000' set done = 1; - open cur1; - fetch cur1 into v4; - wl_loop: WHILE NOT done DO - set v_count=v_count+1; - fetch cur1 into v4; - END WHILE wl_loop; - close cur1; - insert into tb1_logs (dt1, entry_dsc, f4) - values (now(), concat('Number of \'', str_val, '\' rows is: ', - v_count, ' (tb1_log)'),0); -END// - -delimiter ;// - ---disable_abort_on_error -insert into systest1.tb3_eng1 values (NULL,50,'init_val',12.345,'2005-01-01 00:00:00'); -insert into systest1.tb3_eng1 values (NULL,70,'init_val',12.345,'2005-01-01 00:00:00'); ---enable_abort_on_error - -connection default;0. ---disable_abort_on_error ---replace_result $CLIENT_HOST CLIENT_HOST -eval create user syst1user@'$CLIENT_HOST'; ---enable_abort_on_error ---replace_result $CLIENT_HOST CLIENT_HOST -eval set password for syst1user@'$CLIENT_HOST' = password('systpass'); ---replace_result $CLIENT_HOST CLIENT_HOST -eval grant ALL on systest1.* to syst1user@'$CLIENT_HOST'; -use systest1; ---replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK -connect (syst1user,localhost,syst1user,systpass,systest1,$MASTER_MYPORT,$MASTER_MYSOCK); - ---source suite/system_3/include/system_3_init.inc -use systest1; -let $NUM_VAL=`SELECT @NUM_VAL`; -eval SET @f1_nums=$NUM_VAL; -SET @tmp_num=int_rand(@f1_nums); -SET @tmp_word=str_rand(4); - -# DEBUG select @tmp_num, @tmp_word; - -# Insert rows replacing the deleted rows using a strored procedure -# that reads the rows from a master table -CALL ins_tb3_eng1 (@tmp_num, @tmp_word); - -connection syst1user; ---source suite/system_3/include/system_3_init.inc -use systest1; -let $NUM_VAL=`SELECT @NUM_VAL`; -eval SET @f1_nums=$NUM_VAL; -SET @tmp_num=int_rand(@f1_nums); -SET @tmp_word=str_rand(4); - -# DEBUG select @tmp_num, @tmp_word; - -# Insert rows replacing the deleted rows using a strored procedure -# that reads the rows from a master table -CALL ins_tb3_eng1 (@tmp_num, @tmp_word); - -connection systuser; ---source suite/system_3/include/system_3_init.inc -use systest1; -call slct_tb1_logs(); - -connection syst1user; ---source suite/system_3/include/system_3_init.inc -use systest1; -let $NUM_VAL=`SELECT @NUM_VAL`; -eval set @f1_nums=$NUM_VAL; -set @tmp_num=int_rand(@f1_nums); -set @tmp_word=str_rand(4); - -select @tmp_num, @tmp_word; - -# Update all rows in the table where f1 is one less the random number -update tb3_eng1 - set f2=concat('U:',@tmp_word,'-',@tmp_num), f3=f3+1 - where f1=@tmp_num-1; - -connection systuser; ---source suite/system_3/include/system_3_init.inc -use systest1; -let $NUM_VAL=`SELECT @NUM_VAL`; -eval set @f1_nums=$NUM_VAL; -set @tmp_num=int_rand(@f1_nums); -set @tmp_word=str_rand(4); - -select @tmp_num, @tmp_word; - -# Update all rows in the table where f1 is one less the random number -update tb3_eng1 - set f2=concat('U:',@tmp_word,'-',@tmp_num), f3=f3+1 - where f1=@tmp_num-1; - -connection syst1user; ---source suite/system_3/include/system_3_init.inc -use systest1; -call slct_tb1_logs(); - -connection systuser; ---source suite/system_3/include/system_3_init.inc -use systest1; -let $NUM_VAL=`SELECT @NUM_VAL`; -eval set @f1_nums=$NUM_VAL; -set @tmp_num=int_rand(@f1_nums); -set @tmp_word=str_rand(4); - -select @tmp_num, @tmp_word; - -# Update all rows in the table where f1 is one less the random number -update tb3_eng1 - set f2=concat('U:',@tmp_word,'-',@tmp_num), f3=f3+1 - where f1=@tmp_num-1; - - -connection syst1user; ---source suite/system_3/include/system_3_init.inc -use systest1; -#--replace_result $NUM_VAL -let $NUM_VAL=`SELECT @NUM_VAL`; -eval set @f1_nums=$NUM_VAL; -set @tmp_num=int_rand(@f1_nums); -select @tmp_num; - -# DEBUG select @tmp_num, @tmp_word; - -# Delete all rows from the table where f1 is equal to the above number -delete from tb3_eng1 where f1=@tmp_num; - -connection systuser; ---source suite/system_3/include/system_3_init.inc -use systest1; -select * from tb3_eng1 where f1>40; - - -connection syst1user; ---source suite/system_3/include/system_3_init.inc -use systest1; -let $NUM_VAL=`SELECT @NUM_VAL`; -eval set @f1_nums=$NUM_VAL; -set @tmp_num=int_rand(@f1_nums); -select @tmp_num; - -# DEBUG select @tmp_num, @tmp_word; - -# Delete all rows from the table where f1 is equal to the above number -delete from tb3_eng1 where f1=@tmp_num; - -connection systuser; ---source suite/system_3/include/system_3_init.inc -use systest1; -select * from tb3_eng1 where f1>40; - -connection syst1user; ---source suite/system_3/include/system_3_init.inc -use systest1; -let $NUM_VAL=`SELECT @NUM_VAL`; -eval set @f1_nums=$NUM_VAL; -set @tmp_num=int_rand(@f1_nums); -select @tmp_num; - -select @tmp_num, @tmp_word; - -# Delete all rows from the table where f1 is equal to the above number -delete from tb3_eng1 where f1=@tmp_num; - -connection systuser; ---source suite/system_3/include/system_3_init.inc -use systest1; -select * from tb3_eng1 where f1>40; diff --git a/mysql-test/suite/parts/t/partition_value_innodb.test b/mysql-test/suite/parts/t/partition_value_innodb.test index 9d59533a54e..fe47f533107 100644 --- a/mysql-test/suite/parts/t/partition_value_innodb.test +++ b/mysql-test/suite/parts/t/partition_value_innodb.test @@ -8,9 +8,9 @@ #------------------------------------------------------------------------------# # Original Author: mleich # # Original Date: 2006-04-11 # -# Change Author: # -# Change Date: # -# Change: # +# Change Author: mleich # +# Change Date: 2008-12-08 # +# Change: Remove test from disabled.def + change test that it gets skipped # ################################################################################ # @@ -22,6 +22,12 @@ # any of the variables. # +# +# CAST() within the partitioning function si no more supported, but we get +# this functionality probably soon again. Therefor we do not delete this test. +--skip # CAST() in partitioning function is currently not supported. + + #------------------------------------------------------------------------------# # General not engine specific settings and requirements diff --git a/mysql-test/suite/parts/t/partition_value_myisam.test b/mysql-test/suite/parts/t/partition_value_myisam.test index d6020669509..026ad57f0b2 100644 --- a/mysql-test/suite/parts/t/partition_value_myisam.test +++ b/mysql-test/suite/parts/t/partition_value_myisam.test @@ -8,9 +8,9 @@ #------------------------------------------------------------------------------# # Original Author: mleich # # Original Date: 2006-04-11 # -# Change Author: # -# Change Date: # -# Change: # +# Change Author: mleich # +# Change Date: 2008-12-08 # +# Change: Remove test from disabled.def + change test that it gets skipped # ################################################################################ # @@ -22,6 +22,12 @@ # any of the variables. # +# +# CAST() within the partitioning function si no more supported, but we get +# this functionality probably soon again. Therefor we do not delete this test. +--skip # CAST() in partitioning function is currently not supported. + + #------------------------------------------------------------------------------# # General not engine specific settings and requirements diff --git a/mysql-test/suite/parts/t/partition_value_ndb.test b/mysql-test/suite/parts/t/partition_value_ndb.test index 2f948b95727..80b4ba6fb64 100644 --- a/mysql-test/suite/parts/t/partition_value_ndb.test +++ b/mysql-test/suite/parts/t/partition_value_ndb.test @@ -8,9 +8,9 @@ #------------------------------------------------------------------------------# # Original Author: mleich # # Original Date: 2006-04-11 # -# Change Author: # -# Change Date: # -# Change: # +# Change Author: mleich # +# Change Date: 2008-12-08 # +# Change: Remove test from disabled.def + change test that it gets skipped # ################################################################################ # @@ -22,6 +22,12 @@ # any of the variables. # +# +# CAST() within the partitioning function si no more supported, but we get +# this functionality probably soon again. Therefor we do not delete this test. +--skip # CAST() in partitioning function is currently not supported. + + #------------------------------------------------------------------------------# # General not engine specific settings and requirements diff --git a/mysql-test/suite/rpl_ndb/t/disabled.def b/mysql-test/suite/rpl_ndb/t/disabled.def index ebc99feeac6..694f7098980 100644 --- a/mysql-test/suite/rpl_ndb/t/disabled.def +++ b/mysql-test/suite/rpl_ndb/t/disabled.def @@ -10,7 +10,7 @@ # ############################################################################## -rpl_ndb_circular : Bug#33849 COMMIT event missing in cluster circular replication. -rpl_ndb_circular_simplex : Bug#33849 COMMIT event missing in cluster circular replication. +rpl_ndb_circular : Bug#41183 rpl_ndb_circular, rpl_ndb_circular_simplex need maintenance, crash +rpl_ndb_circular_simplex : Bug#41183 rpl_ndb_circular, rpl_ndb_circular_simplex need maintenance, crash # the below testcase have been reworked to avoid the bug, test contains comment, keep bug open diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 5de0a435ba5..e2a4d0ba33d 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -10,6 +10,5 @@ # ############################################################################## federated_transactions : Bug#29523 Transactions do not work -log_tables.test : Bug #37798: main.log_tables fails randomly on powermacg5 and windows -slow_query_log_func.test : Bug #37962: *_func tests containing sleeps/race conditions +slow_query_log_func : Bug #37962: *_func tests containing sleeps/race conditions wait_timeout_func : Bug #41225 joro wait_timeout_func fails From ca25988f6e3342ddb368e004d19ad488d6c62643 Mon Sep 17 00:00:00 2001 From: Andrei Elkin Date: Mon, 8 Dec 2008 17:07:08 +0200 Subject: [PATCH 05/15] Bug #40221 Replication failure on RBR + UPDATE the primary key Extending bug#40221 regression test: 1. include INSERT 2. convert prim key + autoinc to unique. --- .../suite/binlog/r/binlog_innodb_row.result | 27 ++++++++++++------- .../suite/binlog/t/binlog_innodb_row.test | 24 ++++++++++++++--- 2 files changed, 38 insertions(+), 13 deletions(-) diff --git a/mysql-test/suite/binlog/r/binlog_innodb_row.result b/mysql-test/suite/binlog/r/binlog_innodb_row.result index 47ddcbd00f6..fab79c4bc2f 100644 --- a/mysql-test/suite/binlog/r/binlog_innodb_row.result +++ b/mysql-test/suite/binlog/r/binlog_innodb_row.result @@ -1,16 +1,10 @@ -CREATE TABLE t1 (pk int auto_increment primary key) ENGINE=innodb; -show create table t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `pk` int(11) NOT NULL AUTO_INCREMENT, - PRIMARY KEY (`pk`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1 +CREATE TABLE t1 (i int unique) ENGINE=innodb; reset master; begin; insert into t1 values (1),(2); *** the following UPDATE query wont generate any updates for the binlog *** -update t1 set pk = 3 where pk < 3; -ERROR 23000: Duplicate entry '3' for key 'PRIMARY' +update t1 set i = 3 where i < 3; +ERROR 23000: Duplicate entry '3' for key 'i' commit; *** Results of the test: the binlog must have only Write_rows events not any Update_rows *** show binlog events from ; @@ -19,4 +13,19 @@ master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ +delete from t1; +reset master; +begin; +insert into t1 values (1),(2); +*** the following UPDATE query wont generate any updates for the binlog *** +insert into t1 values (3),(4),(1),(2); +ERROR 23000: Duplicate entry '1' for key 'i' +commit; +*** Results of the test: the binlog must have only one Write_rows event not two *** +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ drop table t1; diff --git a/mysql-test/suite/binlog/t/binlog_innodb_row.test b/mysql-test/suite/binlog/t/binlog_innodb_row.test index 7f42f5b95cb..aaba98e3284 100644 --- a/mysql-test/suite/binlog/t/binlog_innodb_row.test +++ b/mysql-test/suite/binlog/t/binlog_innodb_row.test @@ -9,18 +9,34 @@ source include/have_binlog_format_row.inc; # Bug #40221 Replication failure on RBR + UPDATE the primary key # -CREATE TABLE t1 (pk int auto_increment primary key) ENGINE=innodb; -show create table t1; +CREATE TABLE t1 (i int unique) ENGINE=innodb; +reset master; + +# part 1: update can cause the dup key + +begin; +insert into t1 values (1),(2); +--echo *** the following UPDATE query wont generate any updates for the binlog *** +--error ER_DUP_ENTRY +update t1 set i = 3 where i < 3; +commit; + +--echo *** Results of the test: the binlog must have only Write_rows events not any Update_rows *** +source include/show_binlog_events.inc; + +# part 2: insert can cause the dup key + +delete from t1; reset master; begin; insert into t1 values (1),(2); --echo *** the following UPDATE query wont generate any updates for the binlog *** --error ER_DUP_ENTRY -update t1 set pk = 3 where pk < 3; +insert into t1 values (3),(4),(1),(2); commit; ---echo *** Results of the test: the binlog must have only Write_rows events not any Update_rows *** +--echo *** Results of the test: the binlog must have only one Write_rows event not two *** source include/show_binlog_events.inc; drop table t1; From e6edcee80d8360e7f2eab469f9ed92410d82dc1c Mon Sep 17 00:00:00 2001 From: Andrei Elkin Date: Mon, 8 Dec 2008 21:40:25 +0200 Subject: [PATCH 06/15] Bug #33420 Test 'rpl_packet' fails randomly with changed "Exec_Master_Log_Pos" binlog_row_mix_innodb_myisam resutls are corrected. The last operations prior the dup error is TRUNCATE table t2; Therefore after --error ER_DUP_ENTRY INSERT INTO t2 select * from t1; table t2 must be empty, and that is what the updated results confirm. --- mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result | 2 -- 1 file changed, 2 deletions(-) diff --git a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result index 0b33d71b6f1..dcad7e022b7 100644 --- a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result @@ -385,8 +385,6 @@ master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map # # table_id: # (test.t2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # use `test`; COMMIT master-bin.000001 # Query # # use `test`; DROP TABLE t2 master-bin.000001 # Query # # use `test`; BEGIN From b7139581325fe41ed584dfa653a2a66d211d4d67 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Tue, 9 Dec 2008 11:05:36 +0300 Subject: [PATCH 07/15] Fixed type_float failures in --ps-protocol mode introduced by the test case for bug #27483. The reason for the failures was bug #21205 (fixed in 6.0 by dtoa, but still present in 5.0/5.1). --- mysql-test/r/type_float.result | 12 ++++++------ mysql-test/t/type_float.test | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index e7f17bd75a7..d86c515062a 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -398,11 +398,11 @@ insert into t1(d) values (9.2233720368547777e+18), (9.22337203685479e18), (1.84e19); update t1 set u = d; -select * from t1; -d u -9.22337203685478e+18 9223372036854775808 -9.22337203685478e+18 9223372036854779904 -9.22337203685479e+18 9223372036854790144 -1.84e+19 18400000000000000000 +select u from t1; +u +9223372036854775808 +9223372036854779904 +9223372036854790144 +18400000000000000000 drop table t1; End of 5.0 tests diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index b23755b44fb..3ceef129912 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -265,7 +265,7 @@ insert into t1(d) values (9.2233720368547777e+18), (1.84e19); update t1 set u = d; -select * from t1; +select u from t1; drop table t1; From 315f6539876c50b16f3f122a66cf959050e7d2d5 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Tue, 9 Dec 2008 12:30:49 +0400 Subject: [PATCH 08/15] Bug#35934 mysql_upgrade calls mysqlcheck with insufficient parameters modifying the original fix. As it turned out --fix-db-names option of the mysqlcheck suppress the --check_upgrade option, so we have to call the mysqlcheck twice from the mysql_upgrade. per-file comments: client/mysql_upgrade.c Bug#35934 mysql_upgrade calls mysqlcheck with insufficient parameters --- client/mysql_upgrade.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index e1fc4caf720..190bb2383e9 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -616,6 +616,18 @@ static int run_mysqlcheck_upgrade(void) "--check-upgrade", "--all-databases", "--auto-repair", + NULL); +} + + +static int run_mysqlcheck_fixnames(void) +{ + verbose("Running 'mysqlcheck'..."); + return run_tool(mysqlcheck_path, + NULL, /* Send output from mysqlcheck directly to screen */ + "--no-defaults", + ds_args.str, + "--all-databases", "--fix-db-names", "--fix-table-names", NULL); @@ -784,7 +796,8 @@ int main(int argc, char **argv) /* Run "mysqlcheck" and "mysql_fix_privilege_tables.sql" */ - if (run_mysqlcheck_upgrade() || + if (run_mysqlcheck_fixnames() || + run_mysqlcheck_upgrade() || run_sql_fix_privilege_tables()) { /* From b3012d08673df1e7685c227067b619b4ccaa52ac Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Tue, 9 Dec 2008 13:04:28 +0400 Subject: [PATCH 09/15] Bug#40949 Debug version of MySQL server crashes when run OPTIMIZE on compressed table. reset diagnostics area state after error message is sent --- mysql-test/r/myisampack.result | 22 ++++++++++++++++++++++ mysql-test/t/myisampack.test | 25 +++++++++++++++++++++++++ sql/sql_table.cc | 1 + 3 files changed, 48 insertions(+) diff --git a/mysql-test/r/myisampack.result b/mysql-test/r/myisampack.result index 5f39d318234..14b6283bf8f 100644 --- a/mysql-test/r/myisampack.result +++ b/mysql-test/r/myisampack.result @@ -27,3 +27,25 @@ CHECK TABLE t1 EXTENDED; Table Op Msg_type Msg_text test.t1 check status OK DROP TABLE t1; +drop table if exists t1; +create table t1(f1 int, f2 varchar(255)); +insert into t1 values(1, 'foo'), (2, 'bar'); +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +flush tables; +optimize table t1; +Table Op Msg_type Msg_text +test.t1 optimize 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 6598af6318a..99767f81033 100644 --- a/mysql-test/t/myisampack.test +++ b/mysql-test/t/myisampack.test @@ -31,3 +31,28 @@ FLUSH TABLES; --exec $MYISAMCHK -s --unpack $MYSQLTEST_VARDIR/master-data/test/t1 CHECK TABLE t1 EXTENDED; DROP TABLE t1; + +# +# Bug#40949 Debug version of MySQL server crashes when run OPTIMIZE on compressed table. +# +--disable_warnings +drop table if exists t1; +--enable_warnings +create table t1(f1 int, f2 varchar(255)); +insert into t1 values(1, 'foo'), (2, 'bar'); +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +insert into t1 select * from t1; +flush tables; +--exec $MYISAMPACK $MYSQLTEST_VARDIR/master-data/test/t1 +optimize table t1; +drop table t1; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index ec35616bc89..16d420441d1 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -4319,6 +4319,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, table->table=0; // For query cache if (protocol->write()) goto err; + thd->main_da.reset_diagnostics_area(); continue; /* purecov: end */ } From eb46763654e3f432d2e654681e9c079cbc3d4af0 Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Tue, 9 Dec 2008 13:53:23 +0400 Subject: [PATCH 10/15] Bug#35796 SHOW CREATE TABLE and default value for BIT field show default value for BIT field in printable format --- mysql-test/r/type_bit.result | 15 +++++++++++++++ mysql-test/t/type_bit.test | 15 +++++++++++++++ sql/item.cc | 3 +++ sql/sql_show.cc | 18 +++++++++++++++--- 4 files changed, 48 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/type_bit.result b/mysql-test/r/type_bit.result index 68c0e1635a3..2a83d9b4c62 100644 --- a/mysql-test/r/type_bit.result +++ b/mysql-test/r/type_bit.result @@ -708,4 +708,19 @@ HEX(b1) HEX(b2) i2 1 0 100 1 0 200 DROP TABLE t1, t2; +CREATE TABLE IF NOT EXISTS t1 ( +f1 bit(2) NOT NULL default b'10', +f2 bit(14) NOT NULL default b'11110000111100' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` bit(2) NOT NULL default b'10', + `f2` bit(14) NOT NULL default b'11110000111100' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci +DROP TABLE t1; +CREATE TABLE IF NOT EXISTS t1 ( +f1 bit(2) NOT NULL default b'' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; +ERROR 42000: Invalid default value for 'f1' End of 5.0 tests diff --git a/mysql-test/t/type_bit.test b/mysql-test/t/type_bit.test index 6a6b29deda4..81dca17f112 100644 --- a/mysql-test/t/type_bit.test +++ b/mysql-test/t/type_bit.test @@ -352,4 +352,19 @@ SELECT HEX(b1), HEX(b2), i2 FROM t2 DROP TABLE t1, t2; +# +# Bug #35796 SHOW CREATE TABLE and default value for BIT field +# +CREATE TABLE IF NOT EXISTS t1 ( +f1 bit(2) NOT NULL default b'10', +f2 bit(14) NOT NULL default b'11110000111100' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; +SHOW CREATE TABLE t1; +DROP TABLE t1; + +--error ER_INVALID_DEFAULT +CREATE TABLE IF NOT EXISTS t1 ( +f1 bit(2) NOT NULL default b'' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; + --echo End of 5.0 tests diff --git a/sql/item.cc b/sql/item.cc index 182f4abdfe6..243c22bb7e6 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -4950,6 +4950,9 @@ int Item_hex_string::save_in_field(Field *field, bool no_conversions) ulonglong nr; uint32 length= str_value.length(); + if (!length) + return 1; + if (length > 8) { nr= field->flags & UNSIGNED_FLAG ? ULONGLONG_MAX : LONGLONG_MAX; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 4e3d209f674..59082e0a295 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -798,7 +798,7 @@ static bool get_field_default_value(THD *thd, TABLE *table, { bool has_default; bool has_now_default; - + enum enum_field_types field_type= field->type(); /* We are using CURRENT_TIMESTAMP instead of NOW because it is more standard @@ -806,7 +806,7 @@ static bool get_field_default_value(THD *thd, TABLE *table, has_now_default= table->timestamp_field == field && field->unireg_check != Field::TIMESTAMP_UN_FIELD; - has_default= (field->type() != FIELD_TYPE_BLOB && + has_default= (field_type != FIELD_TYPE_BLOB && !(field->flags & NO_DEFAULT_VALUE_FLAG) && field->unireg_check != Field::NEXT_NUMBER && !((thd->variables.sql_mode & (MODE_MYSQL323 | MODE_MYSQL40)) @@ -821,7 +821,19 @@ static bool get_field_default_value(THD *thd, TABLE *table, { // Not null by default char tmp[MAX_FIELD_WIDTH]; String type(tmp, sizeof(tmp), field->charset()); - field->val_str(&type); + if (field_type == MYSQL_TYPE_BIT) + { + longlong dec= field->val_int(); + char *ptr= longlong2str(dec, tmp + 2, 2); + uint32 length= (uint32) (ptr - tmp); + tmp[0]= 'b'; + tmp[1]= '\''; + tmp[length]= '\''; + type.length(length + 1); + quoted= 0; + } + else + field->val_str(&type); if (type.length()) { String def_val; From 0661c210d3813a73d678f7e9d8347762b8a984a5 Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Tue, 9 Dec 2008 14:00:43 +0400 Subject: [PATCH 11/15] bug#35558 Wrong server metadata blows up the client the problem: FORMAT func max_length value was calculated incorrectly the fix: correct calculation of max_length --- mysql-test/r/func_str.result | 12 +++++++++--- mysql-test/t/func_str.test | 10 ++++++++++ sql/item_strfunc.h | 5 +++-- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index d0809eca65b..c121c8937d7 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -717,8 +717,6 @@ insert(_latin2'abcd',2,3,_latin2'ef'), replace(_latin2'abcd',_latin2'b',_latin2'B'), encode('abcd','ab') ; -Warnings: -Warning 1265 Data truncated for column 'format(130,10)' at row 1 show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -727,7 +725,7 @@ t1 CREATE TABLE `t1` ( `conv(130,16,10)` varchar(64) default NULL, `hex(130)` varchar(6) NOT NULL default '', `char(130)` varbinary(4) NOT NULL default '', - `format(130,10)` varchar(4) NOT NULL default '', + `format(130,10)` varchar(16) NOT NULL default '', `left(_latin2'a',1)` varchar(1) character set latin2 NOT NULL default '', `right(_latin2'a',1)` varchar(1) character set latin2 NOT NULL default '', `lcase(_latin2'a')` varchar(1) character set latin2 NOT NULL default '', @@ -2175,4 +2173,12 @@ SELECT HEX(c1) from v1; HEX(c1) 414243 DROP VIEW v1; +create table t1(a float); +insert into t1 values (1.33); +select format(a, 2) from t1; +Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr +def format(a, 2) 253 20 4 Y 0 2 8 +format(a, 2) +1.33 +drop table t1; End of 5.0 tests diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 1ca2bbfaf4c..8298a50c277 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -1149,4 +1149,14 @@ CREATE VIEW v1 AS SELECT CHAR(0x414243) as c1; SELECT HEX(c1) from v1; DROP VIEW v1; +# +# Bug #35558 Wrong server metadata blows up the client +# +create table t1(a float); +insert into t1 values (1.33); +--enable_metadata +select format(a, 2) from t1; +--disable_metadata +drop table t1; + --echo End of 5.0 tests diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index 3648438a69b..23ac20a4017 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -516,8 +516,9 @@ public: { collation.set(default_charset()); uint char_length= args[0]->max_length/args[0]->collation.collation->mbmaxlen; - max_length= ((char_length + (char_length-args[0]->decimals)/3) * - collation.collation->mbmaxlen); + uint max_sep_count= char_length/3 + (decimals ? 1 : 0) + /*sign*/1; + max_length= (char_length + max_sep_count + decimals) * + collation.collation->mbmaxlen; } const char *func_name() const { return "format"; } void print(String *); From 66fa3c09a3827fcbf8c082de50fe7a606be03f69 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Tue, 9 Dec 2008 13:19:46 +0300 Subject: [PATCH 12/15] Added a missing bit from the original patch for bug #27483 which was lost when re-applying the patch manually to another tree. --- sql/field.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/field.cc b/sql/field.cc index 8188b51d4d1..f8ab4b852ec 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -3473,7 +3473,7 @@ int Field_longlong::store(double nr) error= 1; } else - res=(longlong) (ulonglong) nr; + res=(longlong) double2ulonglong(nr); } else { From d2b5e0bb940dbcf4dae0000a745cab58a351408e Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Tue, 9 Dec 2008 16:38:52 +0400 Subject: [PATCH 13/15] Bug#31291 ALTER TABLE CONVERT TO CHARACTER SET does not change some data types added ability for TINY[MEDIUM] text fields to be converted to greater subtype during alter if necessary(altered charset) --- mysql-test/r/alter_table.result | 16 ++++++++++++++++ mysql-test/t/alter_table.test | 13 +++++++++++++ sql/sql_table.cc | 4 +++- 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 95c652055ec..d81086682f1 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -915,3 +915,19 @@ check table t1; Table Op Msg_type Msg_text test.t1 check status OK drop table t1; +create table t1 (a tinytext character set latin1); +alter table t1 convert to character set utf8; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +drop table t1; +create table t1 (a mediumtext character set latin1); +alter table t1 convert to character set utf8; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` longtext +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +drop table t1; diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index bcca122f9f8..18481291bba 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -696,3 +696,16 @@ unlock tables; select * from t1; check table t1; drop table t1; + + +# +# Bug#31291 ALTER TABLE CONVERT TO CHARACTER SET does not change some data types +# +create table t1 (a tinytext character set latin1); +alter table t1 convert to character set utf8; +show create table t1; +drop table t1; +create table t1 (a mediumtext character set latin1); +alter table t1 convert to character set utf8; +show create table t1; +drop table t1; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 8baeca9ccf7..eefe2a5596e 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1535,7 +1535,9 @@ static bool prepare_blob_field(THD *thd, create_field *sql_field) if ((sql_field->flags & BLOB_FLAG) && sql_field->length) { - if (sql_field->sql_type == FIELD_TYPE_BLOB) + if (sql_field->sql_type == FIELD_TYPE_BLOB || + sql_field->sql_type == FIELD_TYPE_TINY_BLOB || + sql_field->sql_type == FIELD_TYPE_MEDIUM_BLOB) { /* The user has given a length to the blob column */ sql_field->sql_type= get_blob_type_from_length(sql_field->length); From c5c64a30d44f720ff3c9a6bfcdbf11a0bcc70797 Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Tue, 9 Dec 2008 16:59:47 +0400 Subject: [PATCH 14/15] Bug#31399 Wrong query result when doing join buffering over BIT fields if table has bit fields then uneven bits(if exist) are stored into null bits place. So we need to copy null bits in case of uneven bit field presence. --- mysql-test/r/type_bit.result | 26 ++++++++++++++++++++++++++ mysql-test/t/type_bit.test | 30 ++++++++++++++++++++++++++++++ sql/sql_select.cc | 8 ++++++-- 3 files changed, 62 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/type_bit.result b/mysql-test/r/type_bit.result index 2a83d9b4c62..63dec0297d0 100644 --- a/mysql-test/r/type_bit.result +++ b/mysql-test/r/type_bit.result @@ -723,4 +723,30 @@ CREATE TABLE IF NOT EXISTS t1 ( f1 bit(2) NOT NULL default b'' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; ERROR 42000: Invalid default value for 'f1' +create table t1bit7 (a1 bit(7) not null) engine=MyISAM; +create table t2bit7 (b1 bit(7)) engine=MyISAM; +insert into t1bit7 values (b'1100000'); +insert into t1bit7 values (b'1100001'); +insert into t1bit7 values (b'1100010'); +insert into t2bit7 values (b'1100001'); +insert into t2bit7 values (b'1100010'); +insert into t2bit7 values (b'1100110'); +select bin(a1) from t1bit7, t2bit7 where t1bit7.a1=t2bit7.b1; +bin(a1) +1100001 +1100010 +drop table t1bit7, t2bit7; +create table t1bit7 (a1 bit(15) not null) engine=MyISAM; +create table t2bit7 (b1 bit(15)) engine=MyISAM; +insert into t1bit7 values (b'110000011111111'); +insert into t1bit7 values (b'110000111111111'); +insert into t1bit7 values (b'110001011111111'); +insert into t2bit7 values (b'110000111111111'); +insert into t2bit7 values (b'110001011111111'); +insert into t2bit7 values (b'110011011111111'); +select bin(a1) from t1bit7, t2bit7 where t1bit7.a1=t2bit7.b1; +bin(a1) +110000111111111 +110001011111111 +drop table t1bit7, t2bit7; End of 5.0 tests diff --git a/mysql-test/t/type_bit.test b/mysql-test/t/type_bit.test index 81dca17f112..bdc678688f1 100644 --- a/mysql-test/t/type_bit.test +++ b/mysql-test/t/type_bit.test @@ -367,4 +367,34 @@ CREATE TABLE IF NOT EXISTS t1 ( f1 bit(2) NOT NULL default b'' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci; + +# +# Bug#31399 Wrong query result when doing join buffering over BIT fields +# +create table t1bit7 (a1 bit(7) not null) engine=MyISAM; +create table t2bit7 (b1 bit(7)) engine=MyISAM; + +insert into t1bit7 values (b'1100000'); +insert into t1bit7 values (b'1100001'); +insert into t1bit7 values (b'1100010'); +insert into t2bit7 values (b'1100001'); +insert into t2bit7 values (b'1100010'); +insert into t2bit7 values (b'1100110'); + +select bin(a1) from t1bit7, t2bit7 where t1bit7.a1=t2bit7.b1; +drop table t1bit7, t2bit7; + +create table t1bit7 (a1 bit(15) not null) engine=MyISAM; +create table t2bit7 (b1 bit(15)) engine=MyISAM; + +insert into t1bit7 values (b'110000011111111'); +insert into t1bit7 values (b'110000111111111'); +insert into t1bit7 values (b'110001011111111'); +insert into t2bit7 values (b'110000111111111'); +insert into t2bit7 values (b'110001011111111'); +insert into t2bit7 values (b'110011011111111'); + +select bin(a1) from t1bit7, t2bit7 where t1bit7.a1=t2bit7.b1; +drop table t1bit7, t2bit7; + --echo End of 5.0 tests diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2ac33c4e07f..b080fff8725 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -13233,6 +13233,7 @@ join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count) length=0; for (i=0 ; i < table_count ; i++) { + bool have_bit_fields= FALSE; uint null_fields=0,used_fields; Field **f_ptr,*field; @@ -13247,13 +13248,16 @@ join_init_cache(THD *thd,JOIN_TAB *tables,uint table_count) length+=field->fill_cache_field(copy); if (copy->blob_field) (*blob_ptr++)=copy; - if (field->maybe_null()) + if (field->real_maybe_null()) null_fields++; + if (field->type() == MYSQL_TYPE_BIT && + ((Field_bit*)field)->bit_len) + have_bit_fields= TRUE; copy++; } } /* Copy null bits from table */ - if (null_fields && tables[i].table->s->null_fields) + if (null_fields || have_bit_fields) { /* must copy null bits */ copy->str=(char*) tables[i].table->null_flags; copy->length= tables[i].table->s->null_bytes; From 9ff609116d5888863a269bdc09a2336c4aa3a816 Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Tue, 9 Dec 2008 19:31:22 +0400 Subject: [PATCH 15/15] updated test results --- .../suite/parts/r/partition_bit_innodb.result | 18 +++++++++--------- .../suite/parts/r/partition_bit_myisam.result | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/mysql-test/suite/parts/r/partition_bit_innodb.result b/mysql-test/suite/parts/r/partition_bit_innodb.result index 2ea66592679..a9ae917f13d 100644 --- a/mysql-test/suite/parts/r/partition_bit_innodb.result +++ b/mysql-test/suite/parts/r/partition_bit_innodb.result @@ -6,7 +6,7 @@ create table t1 (a bit(0), primary key (a)) engine='INNODB' partition by key (a) show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` bit(1) NOT NULL DEFAULT '\0', + `a` bit(1) NOT NULL DEFAULT b'0', PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) */ @@ -18,7 +18,7 @@ partition pa2); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` bit(1) NOT NULL DEFAULT '\0', + `a` bit(1) NOT NULL DEFAULT b'0', PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) @@ -30,7 +30,7 @@ partition by key (a) partitions 2; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0', + `a` bit(64) NOT NULL DEFAULT b'0', PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) @@ -58,7 +58,7 @@ partition pa4 max_rows=40 min_rows=2); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0', + `a` bit(64) NOT NULL DEFAULT b'0', PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) @@ -88,7 +88,7 @@ partition by key (a) partitions 4; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` bit(1) NOT NULL DEFAULT '\0', + `a` bit(1) NOT NULL DEFAULT b'0', PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) @@ -102,7 +102,7 @@ alter table t2 drop primary key; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` bit(1) NOT NULL DEFAULT '\0' + `a` bit(1) NOT NULL DEFAULT b'0' ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 4 */ @@ -114,7 +114,7 @@ alter table t2 add primary key (a); show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` bit(1) NOT NULL DEFAULT '\0', + `a` bit(1) NOT NULL DEFAULT b'0', PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) @@ -133,7 +133,7 @@ partition pa4 values less than (256)); show create table t3; Table Create Table t3 CREATE TABLE `t3` ( - `a` bit(8) NOT NULL DEFAULT '\0', + `a` bit(8) NOT NULL DEFAULT b'0', PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) @@ -416,7 +416,7 @@ partition pa3 values in (17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32)); show create table t4; Table Create Table t4 CREATE TABLE `t4` ( - `a` bit(8) NOT NULL DEFAULT '\0', + `a` bit(8) NOT NULL DEFAULT b'0', PRIMARY KEY (`a`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a) diff --git a/mysql-test/suite/parts/r/partition_bit_myisam.result b/mysql-test/suite/parts/r/partition_bit_myisam.result index c1f067d80d1..680845c9971 100644 --- a/mysql-test/suite/parts/r/partition_bit_myisam.result +++ b/mysql-test/suite/parts/r/partition_bit_myisam.result @@ -6,7 +6,7 @@ create table t1 (a bit(0), primary key (a)) engine='MyISAM' partition by key (a) show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` bit(1) NOT NULL DEFAULT '\0', + `a` bit(1) NOT NULL DEFAULT b'0', PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) */ @@ -18,7 +18,7 @@ partition pa2); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` bit(1) NOT NULL DEFAULT '\0', + `a` bit(1) NOT NULL DEFAULT b'0', PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) @@ -30,7 +30,7 @@ partition by key (a) partitions 2; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0', + `a` bit(64) NOT NULL DEFAULT b'0', PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) @@ -58,7 +58,7 @@ partition pa4 max_rows=40 min_rows=2); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` bit(64) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0', + `a` bit(64) NOT NULL DEFAULT b'0', PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) @@ -88,7 +88,7 @@ partition by key (a) partitions 4; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` bit(1) NOT NULL DEFAULT '\0', + `a` bit(1) NOT NULL DEFAULT b'0', PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) @@ -102,7 +102,7 @@ alter table t2 drop primary key; show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` bit(1) NOT NULL DEFAULT '\0' + `a` bit(1) NOT NULL DEFAULT b'0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) PARTITIONS 4 */ @@ -114,7 +114,7 @@ alter table t2 add primary key (a); show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `a` bit(1) NOT NULL DEFAULT '\0', + `a` bit(1) NOT NULL DEFAULT b'0', PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) @@ -133,7 +133,7 @@ partition pa4 values less than (256)); show create table t3; Table Create Table t3 CREATE TABLE `t3` ( - `a` bit(8) NOT NULL DEFAULT '\0', + `a` bit(8) NOT NULL DEFAULT b'0', PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (a) @@ -416,7 +416,7 @@ partition pa3 values in (17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32)); show create table t4; Table Create Table t4 CREATE TABLE `t4` ( - `a` bit(8) NOT NULL DEFAULT '\0', + `a` bit(8) NOT NULL DEFAULT b'0', PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (a)