diff options
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/csv.test | 15 | ||||
-rw-r--r-- | mysql-test/t/disabled.def | 4 | ||||
-rw-r--r-- | mysql-test/t/endspace.test | 6 | ||||
-rw-r--r-- | mysql-test/t/group_by.test | 14 | ||||
-rw-r--r-- | mysql-test/t/insert.test | 25 | ||||
-rw-r--r-- | mysql-test/t/mysql_client_test.test | 2 | ||||
-rw-r--r-- | mysql-test/t/mysqlbinlog.test | 2 | ||||
-rw-r--r-- | mysql-test/t/mysqltest.test | 57 | ||||
-rw-r--r-- | mysql-test/t/not_partition.test | 1 | ||||
-rw-r--r-- | mysql-test/t/partition_innodb.test | 44 | ||||
-rw-r--r-- | mysql-test/t/partition_range.test | 41 | ||||
-rw-r--r-- | mysql-test/t/partition_truncate.test | 7 | ||||
-rw-r--r-- | mysql-test/t/range.test | 41 | ||||
-rw-r--r-- | mysql-test/t/ssl_8k_key-master.opt | 1 | ||||
-rw-r--r-- | mysql-test/t/subselect4.test | 16 |
15 files changed, 219 insertions, 57 deletions
diff --git a/mysql-test/t/csv.test b/mysql-test/t/csv.test index 609a49c7634..028b6453a04 100644 --- a/mysql-test/t/csv.test +++ b/mysql-test/t/csv.test @@ -1553,26 +1553,25 @@ drop table t1; # whole alter table code is being tested all around the test suite already. # -create table t1 (v varchar(32) not null); +create table t1 (v varchar(32) not null) engine=csv; insert into t1 values ('def'),('abc'),('hij'),('3r4f'); select * from t1; # Fast alter, no copy performed -alter table t1 change v v2 varchar(32); +alter table t1 change v v2 varchar(32) not null; select * from t1; # Fast alter, no copy performed -alter table t1 change v2 v varchar(64); +alter table t1 change v2 v varchar(64) not null; select * from t1; update t1 set v = 'lmn' where v = 'hij'; select * from t1; # Regular alter table -alter table t1 add i int auto_increment not null primary key first; +alter table t1 add i int not null first; select * from t1; -update t1 set i=5 where i=3; +update t1 set i=3 where v = 'abc'; select * from t1; -alter table t1 change i i bigint; +alter table t1 change i i bigint not null; select * from t1; -alter table t1 add unique key (i, v); -select * from t1 where i between 2 and 4 and v in ('def','3r4f','lmn'); +select * from t1 where i between 2 and 4 and v in ('def','3r4f','abc'); drop table t1; # diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 46392f59633..c80532a4295 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -13,8 +13,10 @@ kill : Bug#37780 2008-12-03 HHunger need some changes to be lowercase_table3 : Bug#54845 2010-06-30 alik main.lowercase_table3 on Mac OSX mysqlhotcopy_myisam : bug#54129 2010-06-04 Horst mysqlhotcopy_archive : bug#54129 2010-06-04 Horst -plugin_load : Bug#42144 2009-12-21 alik plugin_load fails partition_innodb_plugin : Bug#53307 2010-04-30 VasilDimov valgrind warnings +plugin : Bug#55966 2010-08-13 alik "plugin" tests fail in 5.5 +plugin_load : Bug#55966 2010-08-13 alik "plugin" tests fail in 5.5 +plugin_not_embedded : Bug#55966 2010-08-13 alik "plugin" tests fail in 5.5 query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadically sp_sync : Bug#48157 2010-02-06 5.5-m3 demands a differnt solution ctype_utf8mb4_ndb : Bug#55799, Bug#51907, disabled by Konstantin 2010-08-06 diff --git a/mysql-test/t/endspace.test b/mysql-test/t/endspace.test index b223c683cde..7c71b05f687 100644 --- a/mysql-test/t/endspace.test +++ b/mysql-test/t/endspace.test @@ -27,7 +27,7 @@ alter table t1 modify text1 char(32) binary not null; check table t1; select * from t1 ignore key (key1) where text1='teststring' or text1 like 'teststring_%' ORDER BY text1; -select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%'; +select concat('|', text1, '|') as c from t1 where text1='teststring' or text1 like 'teststring_%' order by c; select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t'; select text1, length(text1) from t1 order by text1; select text1, length(text1) from t1 order by binary text1; @@ -44,14 +44,14 @@ select concat('|', text1, '|') from t1 where text1='teststring'; select concat('|', text1, '|') from t1 where text1='teststring '; explain select concat('|', text1, '|') from t1 where text1='teststring '; select concat('|', text1, '|') from t1 where text1 like 'teststring_%'; -select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%'; +select concat('|', text1, '|') as c from t1 where text1='teststring' or text1 like 'teststring_%' order by c; select concat('|', text1, '|') from t1 where text1='teststring' or text1 > 'teststring\t'; select concat('|', text1, '|') from t1 order by text1; drop table t1; create table t1 (text1 varchar(32) not NULL, KEY key1 (text1)) pack_keys=0; insert into t1 values ('teststring'), ('nothing'), ('teststring\t'); -select concat('|', text1, '|') from t1 where text1='teststring' or text1 like 'teststring_%'; +select concat('|', text1, '|') as c from t1 where text1='teststring' or text1 like 'teststring_%' order by c; select concat('|', text1, '|') from t1 where text1='teststring' or text1 >= 'teststring\t'; drop table t1; diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index f46a20b2db4..2fb73af0c99 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -1222,6 +1222,20 @@ DROP TABLE t1, t2; --echo # +--echo # Bug#55188: GROUP BY, GROUP_CONCAT and TEXT - inconsistent results +--echo # + +CREATE TABLE t1 (a text, b varchar(10)); +INSERT INTO t1 VALUES (repeat('1', 1300),'one'), (repeat('1', 1300),'two'); + +query_vertical EXPLAIN +SELECT SUBSTRING(a,1,10), LENGTH(a), GROUP_CONCAT(b) FROM t1 GROUP BY a; +SELECT SUBSTRING(a,1,10), LENGTH(a), GROUP_CONCAT(b) FROM t1 GROUP BY a; +query_vertical EXPLAIN +SELECT SUBSTRING(a,1,10), LENGTH(a) FROM t1 GROUP BY a; +SELECT SUBSTRING(a,1,10), LENGTH(a) FROM t1 GROUP BY a; +DROP TABLE t1; + --echo # End of 5.1 tests diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test index 4f918504597..2bf543511ac 100644 --- a/mysql-test/t/insert.test +++ b/mysql-test/t/insert.test @@ -525,3 +525,28 @@ drop table t1; --echo # --echo # End of 5.4 tests --echo # + +--echo # +--echo # Bug#54106 assert in Protocol::end_statement, +--echo # INSERT IGNORE ... SELECT ... UNION SELECT ... +--echo # + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1 (a INT); + +--error ER_FIELD_SPECIFIED_TWICE +INSERT INTO t1 (a, a) VALUES (1, 1); +# Verify that ER_FIELD_SPECIFIED_TWICE is not ignorable +--error ER_FIELD_SPECIFIED_TWICE +INSERT IGNORE t1 (a, a) VALUES (1, 1); + +--error ER_FIELD_SPECIFIED_TWICE +INSERT IGNORE t1 (a, a) SELECT 1,1; +# Used to cause an assert +--error ER_FIELD_SPECIFIED_TWICE +INSERT IGNORE t1 (a, a) SELECT 1,1 UNION SELECT 2,2; + +DROP TABLE t1; diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test index c8c1fba04e1..2c19671d11b 100644 --- a/mysql-test/t/mysql_client_test.test +++ b/mysql-test/t/mysql_client_test.test @@ -2,6 +2,7 @@ -- source include/not_embedded.inc SET @old_general_log= @@global.general_log; +SET @old_slow_query_log= @@global.slow_query_log; # We run with different binaries for normal and --embedded-server # @@ -24,3 +25,4 @@ echo ok; --echo SET @@global.general_log= @old_general_log; +SET @@global.slow_query_log= @old_slow_query_log; diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index e375cb7299f..3a9dae35476 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -1,6 +1,6 @@ # We are using .opt file since we need small binlog size # TODO: Need to look at making a row based version once the new row based client is completed. [jbm] --- source include/have_binlog_format_mixed_or_statement.inc +-- source include/have_binlog_format_statement.inc -- source include/have_log_bin.inc diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 25293ff29e7..031c51a0720 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -326,6 +326,15 @@ eval select $mysql_errno as "after_!errno_masked_error" ; --exec echo "disable_abort_on_error; error 1000; select 3 from t1; error 1000; select 3 from t1;" | $MYSQL_TEST 2>&1 # ---------------------------------------------------------------------------- +# Check some non-query statements that would fail +# ---------------------------------------------------------------------------- +--exec illegal_command +--cat_file does_not_exist +--perl + exit(1); +EOF + +# ---------------------------------------------------------------------------- # Switch the abort on error on and check the effect on $mysql_errno # ---------------------------------------------------------------------------- --error ER_PARSE_ERROR @@ -863,7 +872,7 @@ while ($outer) } # Test source in an if in a while which is false on 1st iteration -# Also test --error in same context +# Also test --error and --disable_abort_on_error in same context let $outer= 2; # Number of outer loops let $ifval= 0; # false 1st time while ($outer) @@ -874,6 +883,10 @@ while ($outer) --source $MYSQLTEST_VARDIR/tmp/sourced.inc --error ER_NO_SUCH_TABLE SELECT * from nowhere; + --disable_abort_on_error +# Statement giving a different error, to make sure we don't mask it + SELECT * FROM nowhere else; + --enable_abort_on_error } dec $outer; inc $ifval; @@ -1093,6 +1106,36 @@ if (!$counter) } # ---------------------------------------------------------------------------- +# Test if with some non-numerics +# ---------------------------------------------------------------------------- + +let $counter=alpha; +if ($counter) +{ + echo Counter is true, (counter=alpha); +} +let $counter= ; +if ($counter) +{ + echo oops, space is true; +} +let $counter=-0; +if ($counter) +{ + echo oops, -0 is true; +} +if (beta) +{ + echo Beta is true; +} +let $counter=gamma; +while ($counter) +{ + echo while with string, only once; + let $counter=000; +} + +# ---------------------------------------------------------------------------- # Test while, { and } # ---------------------------------------------------------------------------- @@ -1437,7 +1480,6 @@ EOF remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql; # connect when "disable_abort_on_error" caused "connection not found" ---replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT --disable_abort_on_error connect (con1,localhost,root,,); connection default; @@ -1724,7 +1766,16 @@ select 1; --reap EOF --error 1 ---exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.in 2>&1 +# Must filter unpredictable extra warning from output +--exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.in > $MYSQL_TMP_DIR/mysqltest.out 2>&1 +--perl + my $dir= $ENV{'MYSQL_TMP_DIR'}; + open (FILE, "$dir/mysqltest.out"); + while (<FILE>) { + print unless /Note: net_clear/; # This shows up on rare occations + } +EOF +remove_file $MYSQL_TMP_DIR/mysqltest.out; remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.in; drop table t1; diff --git a/mysql-test/t/not_partition.test b/mysql-test/t/not_partition.test index 78ca44acf18..38b88c00ba3 100644 --- a/mysql-test/t/not_partition.test +++ b/mysql-test/t/not_partition.test @@ -27,6 +27,7 @@ ALTER TABLE t1 CHECK PARTITION ALL; ALTER TABLE t1 OPTIMIZE PARTITION ALL; ALTER TABLE t1 ANALYZE PARTITION ALL; ALTER TABLE t1 REBUILD PARTITION ALL; +ALTER TABLE t1 TRUNCATE PARTITION ALL; ALTER TABLE t1 ENGINE Memory; ALTER TABLE t1 ADD (new INT); DROP TABLE t1; diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test index 30f5894716c..f6adf014468 100644 --- a/mysql-test/t/partition_innodb.test +++ b/mysql-test/t/partition_innodb.test @@ -9,6 +9,50 @@ drop table if exists t1, t2; let $MYSQLD_DATADIR= `SELECT @@datadir`; --echo # +--echo # Bug#50418: DROP PARTITION does not interact with transactions +--echo # +CREATE TABLE t1 ( + id INT AUTO_INCREMENT NOT NULL, + name CHAR(50) NOT NULL, + myDate DATE NOT NULL, + PRIMARY KEY (id, myDate), + INDEX idx_date (myDate) + ) ENGINE=InnoDB +PARTITION BY RANGE ( TO_DAYS(myDate) ) ( + PARTITION p0 VALUES LESS THAN (734028), + PARTITION p1 VALUES LESS THAN (734029), + PARTITION p2 VALUES LESS THAN (734030), + PARTITION p3 VALUES LESS THAN MAXVALUE + ) ; +INSERT INTO t1 VALUES +(NULL, 'Lachlan', '2009-09-13'), + (NULL, 'Clint', '2009-09-13'), + (NULL, 'John', '2009-09-14'), + (NULL, 'Dave', '2009-09-14'), + (NULL, 'Jeremy', '2009-09-15'), + (NULL, 'Scott', '2009-09-15'), + (NULL, 'Jeff', '2009-09-16'), + (NULL, 'Joe', '2009-09-16'); +SET AUTOCOMMIT=0; +SELECT * FROM t1 FOR UPDATE; +UPDATE t1 SET name = 'Mattias' WHERE id = 7; +SELECT * FROM t1 WHERE id = 7; +--connect (con1, localhost, root,,) +--echo # Connection con1 +SET lock_wait_timeout = 1; +--echo # After the patch it will wait and fail on timeout. +--error ER_LOCK_WAIT_TIMEOUT +ALTER TABLE t1 DROP PARTITION p3; +SHOW WARNINGS; +--disconnect con1 +--connection default +--echo # Connection default +SELECT * FROM t1; +--echo # No changes. +COMMIT; +DROP TABLE t1; + +--echo # --echo # Bug#51830: Incorrect partition pruning on range partition (regression) --echo # CREATE TABLE t1 (a INT NOT NULL) diff --git a/mysql-test/t/partition_range.test b/mysql-test/t/partition_range.test index 673d05532eb..4e2c1b98a70 100644 --- a/mysql-test/t/partition_range.test +++ b/mysql-test/t/partition_range.test @@ -931,3 +931,44 @@ insert into t2 values(52, 20070322, 456, 'filler') ; select sum(count) from t2 ch where ch.defid in (50,52) and ch.day between 20070320 and 20070401 group by defid; drop table t1, t2; + +--echo # +--echo # Bug#50939: Loose Index Scan unduly relies on engine to remember range +--echo # endpoints +--echo # +CREATE TABLE t1 ( + a INT, + b INT, + KEY ( a, b ) +) PARTITION BY HASH (a) PARTITIONS 1; + +CREATE TABLE t2 ( + a INT, + b INT, + KEY ( a, b ) +); + +INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5); + +INSERT INTO t1 SELECT a + 5, b + 5 FROM t1; +INSERT INTO t1 SELECT a + 10, b + 10 FROM t1; +INSERT INTO t1 SELECT a + 20, b + 20 FROM t1; +INSERT INTO t1 SELECT a + 40, b + 40 FROM t1; + +INSERT INTO t2 SELECT * FROM t1; + +--echo # plans should be identical +EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10,100) GROUP BY a; +EXPLAIN SELECT a, MAX(b) FROM t2 WHERE a IN (10,100) GROUP BY a; + +FLUSH status; +SELECT a, MAX(b) FROM t1 WHERE a IN (10, 100) GROUP BY a; +--echo # Should be no more than 4 reads. +SHOW status LIKE 'handler_read_key'; + +FLUSH status; +SELECT a, MAX(b) FROM t2 WHERE a IN (10, 100) GROUP BY a; +--echo # Should be no more than 4 reads. +SHOW status LIKE 'handler_read_key'; + +DROP TABLE t1, t2; diff --git a/mysql-test/t/partition_truncate.test b/mysql-test/t/partition_truncate.test index 93b9cf62d14..165213d204c 100644 --- a/mysql-test/t/partition_truncate.test +++ b/mysql-test/t/partition_truncate.test @@ -24,3 +24,10 @@ subpartitions 1 --error ER_WRONG_PARTITION_NAME alter table t1 truncate partition sp1; drop table t1; + +create table t1 (a int); +insert into t1 values (1), (3), (8); +--error ER_PARTITION_MGMT_ON_NONPARTITIONED +alter table t1 truncate partition p0; +select count(*) from t1; +drop table t1; diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 2d2a6f75d73..5d5ad180f1a 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -1313,45 +1313,4 @@ SELECT * FROM t1 FORCE INDEX (PRIMARY) DROP TABLE t1; ---echo # ---echo # Bug#50939: Loose Index Scan unduly relies on engine to remember range ---echo # endpoints ---echo # -CREATE TABLE t1 ( - a INT, - b INT, - KEY ( a, b ) -) PARTITION BY HASH (a) PARTITIONS 1; - -CREATE TABLE t2 ( - a INT, - b INT, - KEY ( a, b ) -); - -INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5); - -INSERT INTO t1 SELECT a + 5, b + 5 FROM t1; -INSERT INTO t1 SELECT a + 10, b + 10 FROM t1; -INSERT INTO t1 SELECT a + 20, b + 20 FROM t1; -INSERT INTO t1 SELECT a + 40, b + 40 FROM t1; - -INSERT INTO t2 SELECT * FROM t1; - ---echo # plans should be identical -EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10,100) GROUP BY a; -EXPLAIN SELECT a, MAX(b) FROM t2 WHERE a IN (10,100) GROUP BY a; - -FLUSH status; -SELECT a, MAX(b) FROM t1 WHERE a IN (10, 100) GROUP BY a; ---echo # Should be no more than 4 reads. -SHOW status LIKE 'handler_read_key'; - -FLUSH status; -SELECT a, MAX(b) FROM t2 WHERE a IN (10, 100) GROUP BY a; ---echo # Should be no more than 4 reads. -SHOW status LIKE 'handler_read_key'; - -DROP TABLE t1, t2; - --echo End of 5.1 tests diff --git a/mysql-test/t/ssl_8k_key-master.opt b/mysql-test/t/ssl_8k_key-master.opt new file mode 100644 index 00000000000..b58ca7f39f0 --- /dev/null +++ b/mysql-test/t/ssl_8k_key-master.opt @@ -0,0 +1 @@ +--loose-ssl-key=$MYSQL_TEST_DIR/std_data/server8k-key.pem --loose-ssl-cert=$MYSQL_TEST_DIR/std_data/server8k-cert.pem diff --git a/mysql-test/t/subselect4.test b/mysql-test/t/subselect4.test index fb0f58bf804..a2c71c664c4 100644 --- a/mysql-test/t/subselect4.test +++ b/mysql-test/t/subselect4.test @@ -64,6 +64,22 @@ DROP TABLE t1,t2,t3; --echo End of 5.0 tests. --echo # +--echo # Bug#54568: create view cause Assertion failed: 0, +--echo # file .\item_subselect.cc, line 836 +--echo # +EXPLAIN SELECT 1 LIKE ( 1 IN ( SELECT 1 ) ); +DESCRIBE SELECT 1 LIKE ( 1 IN ( SELECT 1 ) ); +--echo # None of the below should crash +CREATE VIEW v1 AS SELECT 1 LIKE ( 1 IN ( SELECT 1 ) ); +CREATE VIEW v2 AS SELECT 1 LIKE '%' ESCAPE ( 1 IN ( SELECT 1 ) ); +DROP VIEW v1, v2; + + +--echo # +--echo # End of 5.1 tests. +--echo # + +--echo # --echo # Bug#53236 Segfault in DTCollation::set(DTCollation&) --echo # |