summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2010-08-20 16:10:49 +0300
committerGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2010-08-20 16:10:49 +0300
commitc95f7a9816deb1a563ac2d0a7027d359c9b2a27b (patch)
tree131ffa70b19236e991dc12e5bdbbe8e4fb548d7c /mysql-test/t
parentcd8060a7ae482a065d8ce893b6f13e9137b01af5 (diff)
parentc9d20d6c08fe85a852175887d5d361fe1d43b9c2 (diff)
downloadmariadb-git-c95f7a9816deb1a563ac2d0a7027d359c9b2a27b.tar.gz
merge
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/csv.test15
-rw-r--r--mysql-test/t/disabled.def3
-rw-r--r--mysql-test/t/func_gconcat.test5
-rw-r--r--mysql-test/t/func_group.test10
-rw-r--r--mysql-test/t/func_misc.test13
-rw-r--r--mysql-test/t/func_time.test11
-rw-r--r--mysql-test/t/insert.test25
-rw-r--r--mysql-test/t/mysql_upgrade.test29
-rw-r--r--mysql-test/t/mysql_upgrade_ssl.test10
-rw-r--r--mysql-test/t/mysqltest.test57
-rw-r--r--mysql-test/t/partition_not_blackhole-master.opt1
-rw-r--r--mysql-test/t/partition_not_blackhole.test25
-rw-r--r--mysql-test/t/partition_range.test41
-rw-r--r--mysql-test/t/range.test41
-rw-r--r--mysql-test/t/subselect4.test16
15 files changed, 222 insertions, 80 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 ce42668542f..e2e1d76ef65 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -14,5 +14,8 @@ lowercase_table3 : Bug#54845 2010-06-30 alik main.lowercase_table3 on Ma
mysqlhotcopy_myisam : bug#54129 2010-06-04 Horst
mysqlhotcopy_archive : bug#54129 2010-06-04 Horst
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
diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
index 54c7291bb5e..0624fce3a34 100644
--- a/mysql-test/t/func_gconcat.test
+++ b/mysql-test/t/func_gconcat.test
@@ -720,6 +720,10 @@ EXPLAIN EXTENDED SELECT 1 FROM
t1 t2, t1 GROUP BY t1.a) AS d;
DROP TABLE t1;
+
+--echo End of 5.0 tests
+
+
--echo #
--echo # Bug #54476: crash when group_concat and 'with rollup' in prepared statements
--echo #
@@ -734,6 +738,7 @@ EXECUTE stmt;
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test
index 6dbc8a05789..2914bb15d18 100644
--- a/mysql-test/t/func_group.test
+++ b/mysql-test/t/func_group.test
@@ -1085,3 +1085,13 @@ drop table t1;
--echo #
--echo End of 5.1 tests
+--echo #
+--echo # Bug#55648: Server crash on MIX/MAX on maximum time value
+--echo #
+CREATE TABLE t1(c1 TIME NOT NULL);
+INSERT INTO t1 VALUES('837:59:59');
+INSERT INTO t1 VALUES('838:59:59');
+SELECT MAX(c1) FROM t1;
+DROP TABLE t1;
+--echo # End of the bug#55648
+
diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test
index 5d93813a9ff..ec71e950ca7 100644
--- a/mysql-test/t/func_misc.test
+++ b/mysql-test/t/func_misc.test
@@ -468,6 +468,19 @@ select NAME_CONST('_id',1234) as id;
select connection_id() > 0;
--echo #
+--echo # Bug #54461: crash with longblob and union or update with subquery
+--echo #
+
+CREATE TABLE t1 (a INT, b LONGBLOB);
+INSERT INTO t1 VALUES (1, '2'), (2, '3'), (3, '2');
+
+SELECT DISTINCT LEAST(a, (SELECT b FROM t1 LIMIT 1)) FROM t1 UNION SELECT 1;
+SELECT DISTINCT GREATEST(a, (SELECT b FROM t1 LIMIT 1)) FROM t1 UNION SELECT 1;
+
+DROP TABLE t1;
+
+
+--echo #
--echo # Bug #52165: Assertion failed: file .\dtoa.c, line 465
--echo #
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index 219a857a597..1f6001219a3 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -821,4 +821,15 @@ select date_sub("0069-01-01 00:00:01",INTERVAL 2 SECOND);
select date_sub("0169-01-01 00:00:01",INTERVAL 2 SECOND);
+#
+# Bug #55565: debug assertion when ordering by expressions with user
+# variable assignments
+#
+
+CREATE TABLE t1(a DOUBLE NOT NULL);
+INSERT INTO t1 VALUES (0),(9.216e-096);
+--echo # should not crash
+SELECT 1 FROM t1 ORDER BY @x:=makedate(a,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_upgrade.test b/mysql-test/t/mysql_upgrade.test
index 3ea612d2ca7..3c6cc45da38 100644
--- a/mysql-test/t/mysql_upgrade.test
+++ b/mysql-test/t/mysql_upgrade.test
@@ -1,31 +1,4 @@
-# Can't run test of external client with embedded server
--- source include/not_embedded.inc
-
-# Only run test if "mysql_upgrade" is found
---require r/have_mysql_upgrade.result
---disable_query_log
-select LENGTH("$MYSQL_UPGRADE")>0 as have_mysql_upgrade;
---enable_query_log
-
-#
-# Hack:
-#
-# If running with Valgrind ($VALGRIND_TEST <> 0) then the resource
-# consumption (CPU) for upgrading a large log table will be intense.
-# Therefore, truncate the log table in advance and issue a statement
-# that should be logged.
-#
-if (`SELECT $VALGRIND_TEST`)
-{
- --disable_query_log
- --disable_result_log
- --disable_abort_on_error
- TRUNCATE TABLE mysql.general_log;
- SELECT 1;
- --enable_abort_on_error
- --enable_result_log
- --enable_query_log
-}
+-- source include/mysql_upgrade_preparation.inc
#
# Basic test that we can run mysql_upgrde and that it finds the
diff --git a/mysql-test/t/mysql_upgrade_ssl.test b/mysql-test/t/mysql_upgrade_ssl.test
new file mode 100644
index 00000000000..d1c029bf33a
--- /dev/null
+++ b/mysql-test/t/mysql_upgrade_ssl.test
@@ -0,0 +1,10 @@
+# mysql_upgrade tests requiring SSL support
+
+-- source include/have_ssl_communication.inc
+-- source include/mysql_upgrade_preparation.inc
+
+--echo #
+--echo # Bug#55672 mysql_upgrade dies with internal error
+--echo #
+--exec $MYSQL_UPGRADE --skip-verbose --ssl --force 2>&1
+--exit
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/partition_not_blackhole-master.opt b/mysql-test/t/partition_not_blackhole-master.opt
new file mode 100644
index 00000000000..1e47be930bc
--- /dev/null
+++ b/mysql-test/t/partition_not_blackhole-master.opt
@@ -0,0 +1 @@
+--loose-skip-blackhole
diff --git a/mysql-test/t/partition_not_blackhole.test b/mysql-test/t/partition_not_blackhole.test
new file mode 100644
index 00000000000..222c1bb091e
--- /dev/null
+++ b/mysql-test/t/partition_not_blackhole.test
@@ -0,0 +1,25 @@
+--source include/have_partition.inc
+--source include/not_blackhole.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+let $MYSQLD_DATADIR= `SELECT @@datadir`;
+
+--echo #
+--echo # Bug#46086: crash when dropping a partitioned table and
+--echo # the original engine is disabled
+--echo # Copy a .frm and .par file which was created with:
+--echo # create table `t1` (`id` int primary key) engine=blackhole
+--echo # partition by key () partitions 1;
+--copy_file std_data/parts/t1_blackhole.frm $MYSQLD_DATADIR/test/t1.frm
+--copy_file std_data/parts/t1_blackhole.par $MYSQLD_DATADIR/test/t1.par
+SHOW TABLES;
+--error ER_NOT_FORM_FILE
+SHOW CREATE TABLE t1;
+--error ER_BAD_TABLE_ERROR
+DROP TABLE t1;
+--list_files $MYSQLD_DATADIR/test t1*
+--remove_file $MYSQLD_DATADIR/test/t1.frm
+--remove_file $MYSQLD_DATADIR/test/t1.par
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/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/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 #