diff options
Diffstat (limited to 'mysql-test')
26 files changed, 434 insertions, 15 deletions
diff --git a/mysql-test/CMakeLists.txt b/mysql-test/CMakeLists.txt index b8b7d08135f..b309db292da 100644 --- a/mysql-test/CMakeLists.txt +++ b/mysql-test/CMakeLists.txt @@ -18,6 +18,7 @@ INSTALL( DESTINATION ${INSTALL_MYSQLTESTDIR} PATTERN "var/" EXCLUDE PATTERN "lib/My/SafeProcess" EXCLUDE + PATTERN "lib/t*" EXCLUDE PATTERN "CPack" EXCLUDE PATTERN "CMake*" EXCLUDE PATTERN "mtr.out*" EXCLUDE diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 59db0d9f537..030a4823b36 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -148,6 +148,3 @@ mtr: mysql-test-run: $(RM) -f mysql-test-run $(LN_S) mysql-test-run.pl mysql-test-run - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/mysql-test/collections/default.experimental b/mysql-test/collections/default.experimental index 4726c85b821..9fa352a6412 100644 --- a/mysql-test/collections/default.experimental +++ b/mysql-test/collections/default.experimental @@ -6,6 +6,8 @@ binlog.binlog_multi_engine # joro : NDB tests marked as experiment funcs_1.charset_collation_1 # depends on compile-time decisions funcs_1.myisam_views @solaris # Bug#50595 2010-03-05 alik funcs_1.myisam_views takes longer time on 6.0 branch than 5.1 branch +innodb.innodb_information_schema # Bug#48883 2010-05-11 alik Test "innodb_information_schema" takes fewer locks than expected + main.func_math @freebsd # Bug#43020 2010-05-04 alik main.func_math fails on FreeBSD in PB2 main.gis @solaris # Bug#52208 2010-04-26 alik gis fails on some platforms (Solaris, HP-UX, Linux) main.gis-rtree @freebsd # Bug#38965 2010-05-04 alik test cases gis-rtree, type_float, type_newdecimal fail in embedded server diff --git a/mysql-test/include/ctype_numconv.inc b/mysql-test/include/ctype_numconv.inc index 959ca7dfeea..be82f67b9f8 100644 --- a/mysql-test/include/ctype_numconv.inc +++ b/mysql-test/include/ctype_numconv.inc @@ -457,6 +457,8 @@ select * from t1; show create table t1; drop table t1; +# Ensure that row_count() value is reset after drop table. +select 1; select hex(concat(row_count())); create table t1 as select concat(row_count()) as c1; show create table t1; diff --git a/mysql-test/include/mysqld--help.inc b/mysql-test/include/mysqld--help.inc index e318823d8af..f21f8b20aa4 100644 --- a/mysql-test/include/mysqld--help.inc +++ b/mysql-test/include/mysqld--help.inc @@ -23,7 +23,7 @@ perl; while (<F>) { next if 1../The following groups are read/; # formatting, skip line consisting entirely of dashes and blanks - next if /^[\- ]+$/; + next if /^[\- ]+\s?$/; next if /Value \(after reading options\)/; # skip table header next if /^($re1) /; next if /^($re2)-/; diff --git a/mysql-test/lib/My/SafeProcess/Makefile.am b/mysql-test/lib/My/SafeProcess/Makefile.am index 722331453fe..33cab066611 100644 --- a/mysql-test/lib/My/SafeProcess/Makefile.am +++ b/mysql-test/lib/My/SafeProcess/Makefile.am @@ -23,7 +23,3 @@ my_safe_process_SOURCES = safe_process.cc EXTRA_DIST = safe_kill_win.cc \ safe_process_win.cc \ CMakeLists.txt - - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/mysql-test/r/ctype_binary.result b/mysql-test/r/ctype_binary.result index 55faa72c6ab..3ffb087c1d3 100644 --- a/mysql-test/r/ctype_binary.result +++ b/mysql-test/r/ctype_binary.result @@ -772,6 +772,9 @@ t1 CREATE TABLE `t1` ( `c1` varbinary(31) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +select 1; +1 +1 select hex(concat(row_count())); hex(concat(row_count())) 2D31 diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index cb932c38a27..e0339ee2109 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -854,6 +854,9 @@ t1 CREATE TABLE `t1` ( `c1` varchar(31) CHARACTER SET cp1251 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +select 1; +1 +1 select hex(concat(row_count())); hex(concat(row_count())) 2D31 diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index 4944db677a6..4f0e863bfca 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -1182,6 +1182,9 @@ t1 CREATE TABLE `t1` ( `c1` varchar(31) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +select 1; +1 +1 select hex(concat(row_count())); hex(concat(row_count())) 2D31 diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index c5b3e5802de..4f033d54043 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -2014,6 +2014,9 @@ t1 CREATE TABLE `t1` ( `c1` varchar(31) CHARACTER SET ucs2 DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +select 1; +1 +1 select hex(concat(row_count())); hex(concat(row_count())) 002D0031 diff --git a/mysql-test/r/mysql_client_test.result b/mysql-test/r/mysql_client_test.result index 08d982c85e3..f30c64f6bef 100644 --- a/mysql-test/r/mysql_client_test.result +++ b/mysql-test/r/mysql_client_test.result @@ -1,3 +1,122 @@ SET @old_general_log= @@global.general_log; ok + +# cat MYSQL_TMP_DIR/test_wl4435.out.log +# ------------------------------------ + +exec_counter: 0 +num_fields: 4 + - 0: name: 'a1'/'a1'; table: 't1'/'t1'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0 + - 1: name: 'a2'/'a2'; table: 't1'/'t1'; db: 'client_test_db'; catalog: 'def'; length: 32; max_length: 0; type: 254; decimals: 0 + - 2: name: 'a3'/'a3'; table: 't1'/'t1'; db: 'client_test_db'; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2 + - 3: name: 'a4'/'a4'; table: 't1'/'t1'; db: 'client_test_db'; catalog: 'def'; length: 5; max_length: 0; type: 246; decimals: 1 +Data: + int: 1; str: '11'; dbl: 12.340000; dec: '56.7'; + int: 2; str: '12'; dbl: 56.780000; dec: '90.1'; + int: 3; str: '13'; dbl: 23.450000; dec: '67.8'; +EOF +mysql_stmt_next_result(): 0; field_count: 5 +num_fields: 5 + - 0: name: 'b0'/'b0'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0 + - 1: name: 'b1'/'b1'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0 + - 2: name: 'b2'/'b2'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 32; max_length: 0; type: 254; decimals: 0 + - 3: name: 'b3'/'b3'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2 + - 4: name: 'b4'/'b4'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 5; max_length: 0; type: 246; decimals: 1 +Data: + int: 100; int: 10; str: '110'; dbl: 70.700000; dec: '10.1'; + int: 200; int: 20; str: '120'; dbl: 80.800000; dec: '20.2'; + int: 300; int: 30; str: '130'; dbl: 90.900000; dec: '30.3'; +EOF +mysql_stmt_next_result(): 0; field_count: 8 +num_fields: 8 + - 0: name: 'v_str_1'/'v_str_1'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 32; max_length: 0; type: 254; decimals: 0 + - 1: name: 'v_dbl_1'/'v_dbl_1'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2 + - 2: name: 'v_dec_1'/'v_dec_1'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 8; max_length: 0; type: 246; decimals: 3 + - 3: name: 'v_int_1'/'v_int_1'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0 + - 4: name: 'v_str_2'/'v_str_2'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 64; max_length: 0; type: 254; decimals: 0 + - 5: name: 'v_dbl_2'/'v_dbl_2'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 5; max_length: 0; type: 5; decimals: 3 + - 6: name: 'v_dec_2'/'v_dec_2'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 9; max_length: 0; type: 246; decimals: 4 + - 7: name: 'v_int_2'/'v_int_2'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0 +Data: + str: 'test_1'; dbl: 12.340000; dec: '567.891'; int: 2345; str: 'test_2'; dbl: 67.891000; dec: '234.6789'; int: 6789; +EOF +mysql_stmt_next_result(): 0; field_count: 0 + +exec_counter: 1 +num_fields: 4 + - 0: name: 'a1'/'a1'; table: 't1'/'t1'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0 + - 1: name: 'a2'/'a2'; table: 't1'/'t1'; db: 'client_test_db'; catalog: 'def'; length: 32; max_length: 0; type: 254; decimals: 0 + - 2: name: 'a3'/'a3'; table: 't1'/'t1'; db: 'client_test_db'; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2 + - 3: name: 'a4'/'a4'; table: 't1'/'t1'; db: 'client_test_db'; catalog: 'def'; length: 5; max_length: 0; type: 246; decimals: 1 +Data: + int: 1; str: '11'; dbl: 12.340000; dec: '56.7'; + int: 2; str: '12'; dbl: 56.780000; dec: '90.1'; + int: 3; str: '13'; dbl: 23.450000; dec: '67.8'; +EOF +mysql_stmt_next_result(): 0; field_count: 5 +num_fields: 5 + - 0: name: 'b0'/'b0'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0 + - 1: name: 'b1'/'b1'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0 + - 2: name: 'b2'/'b2'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 32; max_length: 0; type: 254; decimals: 0 + - 3: name: 'b3'/'b3'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2 + - 4: name: 'b4'/'b4'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 5; max_length: 0; type: 246; decimals: 1 +Data: + int: 100; int: 10; str: '110'; dbl: 70.700000; dec: '10.1'; + int: 200; int: 20; str: '120'; dbl: 80.800000; dec: '20.2'; + int: 300; int: 30; str: '130'; dbl: 90.900000; dec: '30.3'; +EOF +mysql_stmt_next_result(): 0; field_count: 8 +num_fields: 8 + - 0: name: 'v_str_1'/'v_str_1'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 32; max_length: 0; type: 254; decimals: 0 + - 1: name: 'v_dbl_1'/'v_dbl_1'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2 + - 2: name: 'v_dec_1'/'v_dec_1'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 8; max_length: 0; type: 246; decimals: 3 + - 3: name: 'v_int_1'/'v_int_1'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0 + - 4: name: 'v_str_2'/'v_str_2'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 64; max_length: 0; type: 254; decimals: 0 + - 5: name: 'v_dbl_2'/'v_dbl_2'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 5; max_length: 0; type: 5; decimals: 3 + - 6: name: 'v_dec_2'/'v_dec_2'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 9; max_length: 0; type: 246; decimals: 4 + - 7: name: 'v_int_2'/'v_int_2'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0 +Data: + str: 'test_1'; dbl: 12.340000; dec: '567.891'; int: 2345; str: 'test_2'; dbl: 67.891000; dec: '234.6789'; int: 6789; +EOF +mysql_stmt_next_result(): 0; field_count: 0 + +exec_counter: 2 +num_fields: 4 + - 0: name: 'a1'/'a1'; table: 't1'/'t1'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0 + - 1: name: 'a2'/'a2'; table: 't1'/'t1'; db: 'client_test_db'; catalog: 'def'; length: 32; max_length: 0; type: 254; decimals: 0 + - 2: name: 'a3'/'a3'; table: 't1'/'t1'; db: 'client_test_db'; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2 + - 3: name: 'a4'/'a4'; table: 't1'/'t1'; db: 'client_test_db'; catalog: 'def'; length: 5; max_length: 0; type: 246; decimals: 1 +Data: + int: 1; str: '11'; dbl: 12.340000; dec: '56.7'; + int: 2; str: '12'; dbl: 56.780000; dec: '90.1'; + int: 3; str: '13'; dbl: 23.450000; dec: '67.8'; +EOF +mysql_stmt_next_result(): 0; field_count: 5 +num_fields: 5 + - 0: name: 'b0'/'b0'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0 + - 1: name: 'b1'/'b1'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0 + - 2: name: 'b2'/'b2'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 32; max_length: 0; type: 254; decimals: 0 + - 3: name: 'b3'/'b3'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2 + - 4: name: 'b4'/'b4'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 5; max_length: 0; type: 246; decimals: 1 +Data: + int: 100; int: 10; str: '110'; dbl: 70.700000; dec: '10.1'; + int: 200; int: 20; str: '120'; dbl: 80.800000; dec: '20.2'; + int: 300; int: 30; str: '130'; dbl: 90.900000; dec: '30.3'; +EOF +mysql_stmt_next_result(): 0; field_count: 8 +num_fields: 8 + - 0: name: 'v_str_1'/'v_str_1'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 32; max_length: 0; type: 254; decimals: 0 + - 1: name: 'v_dbl_1'/'v_dbl_1'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2 + - 2: name: 'v_dec_1'/'v_dec_1'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 8; max_length: 0; type: 246; decimals: 3 + - 3: name: 'v_int_1'/'v_int_1'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0 + - 4: name: 'v_str_2'/'v_str_2'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 64; max_length: 0; type: 254; decimals: 0 + - 5: name: 'v_dbl_2'/'v_dbl_2'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 5; max_length: 0; type: 5; decimals: 3 + - 6: name: 'v_dec_2'/'v_dec_2'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 9; max_length: 0; type: 246; decimals: 4 + - 7: name: 'v_int_2'/'v_int_2'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0 +Data: + str: 'test_1'; dbl: 12.340000; dec: '567.891'; int: 2345; str: 'test_2'; dbl: 67.891000; dec: '234.6789'; int: 6789; +EOF +mysql_stmt_next_result(): 0; field_count: 0 +# ------------------------------------ + SET @@global.general_log= @old_general_log; diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index 05754f251a8..80d520007a4 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -2112,6 +2112,26 @@ COUNT(*) DROP TABLE t1; SET SESSION SQL_MODE=DEFAULT; # +# Bug#46198: Hang after failed ALTER TABLE on partitioned table. +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (s1 INT PRIMARY KEY) PARTITION BY HASH(s1); +LOCK TABLES t1 WRITE, t1 b READ; +UNLOCK TABLES; +ALTER TABLE t1 DROP PARTITION p1; +ERROR HY000: DROP PARTITION can only be used on RANGE/LIST partitions +SELECT * FROM t1; +s1 +DROP TABLE t1; +CREATE TABLE t1 (s1 VARCHAR(5) PRIMARY KEY) PARTITION BY KEY(s1); +LOCK TABLES t1 WRITE, t1 b READ; +UNLOCK TABLES; +ALTER TABLE t1 ADD COLUMN (s3 VARCHAR(5) UNIQUE); +ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function +SELECT * FROM t1; +s1 +DROP TABLE t1; +# # BUG#51868 - crash with myisam_use_mmap and partitioned myisam tables # SET GLOBAL myisam_use_mmap=1; diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 7d24e6db920..76d4bf2dea0 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -2590,11 +2590,11 @@ row_count() call bug4905()| select row_count()| row_count() --1 +0 call bug4905()| select row_count()| row_count() --1 +0 select * from t3| s1 1 diff --git a/mysql-test/r/variables_debug.result b/mysql-test/r/variables_debug.result index 85eaf34b033..11cbef7fa5b 100644 --- a/mysql-test/r/variables_debug.result +++ b/mysql-test/r/variables_debug.result @@ -10,6 +10,13 @@ set debug= '-P'; select @@debug; @@debug T +SELECT @@session.debug, @@global.debug; +@@session.debug @@global.debug +T +SET SESSION debug = ''; +SELECT @@session.debug, @@global.debug; +@@session.debug @@global.debug + # # Bug #52629: memory leak from sys_var_thd_dbug in # binlog.binlog_write_error diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result index 24ebd38e403..a084630a305 100644 --- a/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result +++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result @@ -375,7 +375,7 @@ row_count() after delete 2 SELECT row_count(); row_count() --1 +0 SELECT * FROM temp; f1 f2 f3 f4 f5 f6 qwe xyz 1998-03-26 100 uvw 1000 diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc_10.result b/mysql-test/suite/funcs_1/r/memory_storedproc_10.result index f5e34b0063c..b03f7445fb4 100644 --- a/mysql-test/suite/funcs_1/r/memory_storedproc_10.result +++ b/mysql-test/suite/funcs_1/r/memory_storedproc_10.result @@ -376,7 +376,7 @@ row_count() after delete 2 SELECT row_count(); row_count() --1 +0 SELECT * FROM temp; f1 f2 f3 f4 f5 f6 qwe xyz 1998-03-26 100 uvw 1000 diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result b/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result index f5e34b0063c..b03f7445fb4 100644 --- a/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result +++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result @@ -376,7 +376,7 @@ row_count() after delete 2 SELECT row_count(); row_count() --1 +0 SELECT * FROM temp; f1 f2 f3 f4 f5 f6 qwe xyz 1998-03-26 100 uvw 1000 diff --git a/mysql-test/suite/funcs_1/r/ndb_storedproc_10.result b/mysql-test/suite/funcs_1/r/ndb_storedproc_10.result index 24ebd38e403..a084630a305 100644 --- a/mysql-test/suite/funcs_1/r/ndb_storedproc_10.result +++ b/mysql-test/suite/funcs_1/r/ndb_storedproc_10.result @@ -375,7 +375,7 @@ row_count() after delete 2 SELECT row_count(); row_count() --1 +0 SELECT * FROM temp; f1 f2 f3 f4 f5 f6 qwe xyz 1998-03-26 100 uvw 1000 diff --git a/mysql-test/suite/funcs_1/r/row_count_func.result b/mysql-test/suite/funcs_1/r/row_count_func.result new file mode 100644 index 00000000000..ffc0e8e3b77 --- /dev/null +++ b/mysql-test/suite/funcs_1/r/row_count_func.result @@ -0,0 +1,79 @@ + +# -- +# -- Test case for Bug#21818. +# -- + +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (1), (2), (3); + +# -- Check 1. +SELECT * FROM t1 INTO OUTFILE "MYSQL_TMP_DIR/bug21818.txt"; +affected rows: 3 + +SELECT ROW_COUNT(); +ROW_COUNT() +3 + +# -- Check 2. +SELECT a FROM t1 LIMIT 1 INTO @a; +affected rows: 1 + +SELECT ROW_COUNT(); +ROW_COUNT() +1 + +# -- Check 3. +DROP DATABASE IF EXISTS mysqltest1; +CREATE DATABASE mysqltest1; +affected rows: 1 + +SELECT ROW_COUNT(); +ROW_COUNT() +1 +DROP DATABASE mysqltest1; + +# -- Check 4. +DELETE FROM t1; +LOAD DATA INFILE 'MYSQL_TMP_DIR/bug21818.txt' INTO TABLE t1(a); +affected rows: 3 +info: Records: 3 Deleted: 0 Skipped: 0 Warnings: 0 + +SELECT ROW_COUNT(); +ROW_COUNT() +3 + +# -- Check 5. +ALTER TABLE t1 ADD COLUMN b VARCHAR(255); +affected rows: 3 +info: Records: 3 Duplicates: 0 Warnings: 0 + +SELECT ROW_COUNT(); +ROW_COUNT() +3 + +DROP TABLE t1; + +# -- Check 6. +DROP TABLE IF EXISTS t2; +CREATE TABLE t1(a INT); +CREATE TABLE t2(a INT); +INSERT INTO t1 VALUES (1), (2), (3); +INSERT INTO t2 VALUES (ROW_COUNT()); +SELECT * FROM t2; +a +3 +DROP TABLE t1; +DROP TABLE t2; + +# -- Check 7 (check that SQL errors reset row_count to -1). +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (1), (2), (3); +SELECT f1(); +ERROR 42000: FUNCTION test.f1 does not exist +SELECT ROW_COUNT(); +ROW_COUNT() +-1 +DROP TABLE t1; + +# -- End of test case for Bug#21818. diff --git a/mysql-test/suite/funcs_1/t/row_count_func-master.opt b/mysql-test/suite/funcs_1/t/row_count_func-master.opt new file mode 100644 index 00000000000..c189eede9e4 --- /dev/null +++ b/mysql-test/suite/funcs_1/t/row_count_func-master.opt @@ -0,0 +1 @@ +--secure-file-priv=$MYSQL_TMP_DIR diff --git a/mysql-test/suite/funcs_1/t/row_count_func.test b/mysql-test/suite/funcs_1/t/row_count_func.test new file mode 100644 index 00000000000..1694928b26c --- /dev/null +++ b/mysql-test/suite/funcs_1/t/row_count_func.test @@ -0,0 +1,115 @@ +--echo +--echo # -- +--echo # -- Test case for Bug#21818. +--echo # -- +--echo + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (1), (2), (3); + +--echo +--echo # -- Check 1. + +--enable_info +--echo SELECT * FROM t1 INTO OUTFILE "MYSQL_TMP_DIR/bug21818.txt"; +--disable_query_log # to avoid $MYSQL_TMP_DIR in query log +--eval SELECT * FROM t1 INTO OUTFILE "$MYSQL_TMP_DIR/bug21818.txt" +--enable_query_log +--disable_info + +--echo +SELECT ROW_COUNT(); + +--echo +--echo # -- Check 2. + +--enable_info +SELECT a FROM t1 LIMIT 1 INTO @a; +--disable_info + +--echo +SELECT ROW_COUNT(); + +--echo +--echo # -- Check 3. + +--disable_warnings +DROP DATABASE IF EXISTS mysqltest1; +--enable_warnings + +--enable_info +CREATE DATABASE mysqltest1; +--disable_info + +--echo +SELECT ROW_COUNT(); + +DROP DATABASE mysqltest1; + +--echo +--echo # -- Check 4. + +DELETE FROM t1; + +--enable_info +--echo LOAD DATA INFILE 'MYSQL_TMP_DIR/bug21818.txt' INTO TABLE t1(a); +--disable_query_log # to avoid $MYSQL_TMP_DIR in query log +--eval LOAD DATA INFILE '$MYSQL_TMP_DIR/bug21818.txt' INTO TABLE t1(a) +--enable_query_log +--disable_info + +--echo +SELECT ROW_COUNT(); + +--remove_file $MYSQL_TMP_DIR/bug21818.txt + +--echo +--echo # -- Check 5. + +--enable_info +ALTER TABLE t1 ADD COLUMN b VARCHAR(255); +--disable_info + +--echo +SELECT ROW_COUNT(); + +--echo +DROP TABLE t1; + +--echo +--echo # -- Check 6. + +--disable_warnings +DROP TABLE IF EXISTS t2; +--enable_warnings + +CREATE TABLE t1(a INT); +CREATE TABLE t2(a INT); + +INSERT INTO t1 VALUES (1), (2), (3); +INSERT INTO t2 VALUES (ROW_COUNT()); + +SELECT * FROM t2; + +DROP TABLE t1; +DROP TABLE t2; + +--echo +--echo # -- Check 7 (check that SQL errors reset row_count to -1). + +CREATE TABLE t1(a INT); + +INSERT INTO t1 VALUES (1), (2), (3); +--error ER_SP_DOES_NOT_EXIST +SELECT f1(); + +SELECT ROW_COUNT(); + +DROP TABLE t1; + +--echo +--echo # -- End of test case for Bug#21818. diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index 8a9344824d9..00c1193ec49 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -10,7 +10,6 @@ # ############################################################################## -rpl_row_create_table : Bug#45576 2009-12-01 joro rpl_row_create_table fails on PB2 rpl_row_create_table : Bug#51574 Feb 27 2010 andrei failed different way than earlier with bug#45576 rpl_spec_variables : BUG#47661 2009-10-27 jasonh rpl_spec_variables fails on PB2 hpux rpl_failed_optimize : WL#4284: Can't optimize table used by a pending transaction (there is metadata lock on the table). diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test index 15c0cd4ac84..c8c1fba04e1 100644 --- a/mysql-test/t/mysql_client_test.test +++ b/mysql-test/t/mysql_client_test.test @@ -16,4 +16,11 @@ SET @old_general_log= @@global.general_log; # End of 4.1 tests echo ok; +--echo +--echo # cat MYSQL_TMP_DIR/test_wl4435.out.log +--echo # ------------------------------------ +--cat_file $MYSQL_TMP_DIR/test_wl4435.out.log +--echo # ------------------------------------ +--echo + SET @@global.general_log= @old_general_log; diff --git a/mysql-test/t/parser_stack.test b/mysql-test/t/parser_stack.test index 3330ef41833..bdcad5aa1b4 100644 --- a/mysql-test/t/parser_stack.test +++ b/mysql-test/t/parser_stack.test @@ -399,4 +399,12 @@ delimiter ;$$ drop procedure p_37228; +# +# Bug#27863 (excessive memory usage for many small queries in a multiquery +# packet). +# +let $i=`select repeat("set @a=1;", 65535)`; +--disable_query_log +eval $i; +--enable_query_log diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index f85f65e0072..a2e3e43cdb9 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -2120,6 +2120,50 @@ SET SESSION SQL_MODE=DEFAULT; #DROP TABLE t1; --echo # +--echo # Bug#46198: Hang after failed ALTER TABLE on partitioned table. +--echo # + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# +# Case 1. +# + +CREATE TABLE t1 (s1 INT PRIMARY KEY) PARTITION BY HASH(s1); + +LOCK TABLES t1 WRITE, t1 b READ; + +UNLOCK TABLES; + +--error ER_ONLY_ON_RANGE_LIST_PARTITION +ALTER TABLE t1 DROP PARTITION p1; + +# The SELECT below used to hang in tdc_wait_for_old_versions(). +SELECT * FROM t1; + +DROP TABLE t1; + +# +# Case 2. +# + +CREATE TABLE t1 (s1 VARCHAR(5) PRIMARY KEY) PARTITION BY KEY(s1); + +LOCK TABLES t1 WRITE, t1 b READ; + +UNLOCK TABLES; + +--error ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF +ALTER TABLE t1 ADD COLUMN (s3 VARCHAR(5) UNIQUE); + +# The SELECT below used to hang in tdc_wait_for_old_versions(). +SELECT * FROM t1; + +DROP TABLE t1; + +--echo # --echo # BUG#51868 - crash with myisam_use_mmap and partitioned myisam tables --echo # SET GLOBAL myisam_use_mmap=1; diff --git a/mysql-test/t/variables_debug.test b/mysql-test/t/variables_debug.test index 8f2bde7ae42..0d6ee43cd75 100644 --- a/mysql-test/t/variables_debug.test +++ b/mysql-test/t/variables_debug.test @@ -11,6 +11,16 @@ select @@debug; set debug= '-P'; select @@debug; +# +# Bug#38054: "SET SESSION debug" modifies @@global.debug variable +# + +SELECT @@session.debug, @@global.debug; + +SET SESSION debug = ''; + +SELECT @@session.debug, @@global.debug; + --echo # --echo # Bug #52629: memory leak from sys_var_thd_dbug in --echo # binlog.binlog_write_error |