summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/archive.test74
-rw-r--r--mysql-test/t/disabled.def2
-rw-r--r--mysql-test/t/log_state.test6
-rw-r--r--mysql-test/t/merge.test29
-rw-r--r--mysql-test/t/mysql.test12
-rw-r--r--mysql-test/t/mysqlbinlog.test19
-rw-r--r--mysql-test/t/mysqlcheck.test10
-rw-r--r--mysql-test/t/mysqltest.test20
-rw-r--r--mysql-test/t/ndb_read_multi_range.test45
-rw-r--r--mysql-test/t/rpl_ndb_dd_advance.test1
-rw-r--r--mysql-test/t/wait_timeout.test6
11 files changed, 182 insertions, 42 deletions
diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test
index 37542c272a9..b2e720cb900 100644
--- a/mysql-test/t/archive.test
+++ b/mysql-test/t/archive.test
@@ -6,9 +6,11 @@
-- source include/have_binlog_format_mixed_or_statement.inc
--disable_warnings
-drop table if exists t1,t2,t3,t4,t5;
+DROP TABLE if exists t1,t2,t3,t4,t5,t6;
--enable_warnings
+SET storage_engine=ARCHIVE;
+
CREATE TABLE t1 (
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
@@ -1294,7 +1296,7 @@ select fld1,fld3 FROM t2 where fld1 like "25050_";
#
# Test rename of table
#
-create table t3 engine=archive select * FROM t2;
+CREATE TABLE t3 engine=archive select * FROM t2;
select * FROM t3 where fld3='bonfire';
select count(*) FROM t3;
# Clean up path in error message
@@ -1356,7 +1358,7 @@ while (`SELECT COUNT(auto)!=1214 FROM t2`)
}
SELECT COUNT(auto) FROM t2;
-# Adding test for alter table
+# Adding test for ALTER TABLE
ALTER TABLE t2 DROP COLUMN fld6;
SHOW CREATE TABLE t2;
SELECT * FROM t2;
@@ -1369,7 +1371,7 @@ CREATE TABLE `t5` (
`a` int(11) NOT NULL auto_increment,
b char(12),
PRIMARY KEY (`a`)
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;
+) DEFAULT CHARSET=latin1;
INSERT INTO t5 VALUES (NULL, "foo");
INSERT INTO t5 VALUES (NULL, "foo");
@@ -1377,6 +1379,7 @@ INSERT INTO t5 VALUES (NULL, "foo");
INSERT INTO t5 VALUES (NULL, "foo");
INSERT INTO t5 VALUES (NULL, "foo");
INSERT INTO t5 VALUES (32, "foo");
+--error 1022
INSERT INTO t5 VALUES (23, "foo");
INSERT INTO t5 VALUES (NULL, "foo");
INSERT INTO t5 VALUES (NULL, "foo");
@@ -1393,7 +1396,7 @@ CREATE TABLE `t5` (
`a` int(11) NOT NULL auto_increment,
b char(12),
KEY (`a`)
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 AUTO_INCREMENT=5;
+) DEFAULT CHARSET=latin1 AUTO_INCREMENT=5;
INSERT INTO t5 VALUES (NULL, "foo");
INSERT INTO t5 VALUES (NULL, "foo");
@@ -1419,7 +1422,7 @@ CREATE TABLE `t5` (
`a` int(11) NOT NULL auto_increment,
b blob(12),
KEY (`a`)
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;
+) DEFAULT CHARSET=latin1;
INSERT INTO t5 VALUES (NULL, "foo");
INSERT INTO t5 VALUES (NULL, "We the people");
@@ -1447,7 +1450,7 @@ CREATE TABLE `t5` (
b blob(12),
c blob(12),
KEY (`a`)
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;
+) DEFAULT CHARSET=latin1;
INSERT INTO t5 VALUES (NULL, "foo", "grok this!");
INSERT INTO t5 VALUES (NULL, "We the people", NULL);
@@ -1464,35 +1467,24 @@ SELECT c FROM t5;
SELECT c FROM t5 WHERE a =3;
SELECT c FROM t5 WHERE a IN (32, 23, 5);
-# Adding this in case someone tries to add fast alter table and doesn't tes
+# Adding this in case someone tries to add fast ALTER TABLE and doesn't tes
# it.
-# Some additional tests for new, faster alter table. Note that most of the
-# whole alter table code is being tested all around the test suite already.
+# Some additional tests for new, faster ALTER TABLE. Note that most of the
+# whole ALTER TABLE code is being tested all around the test suite already.
#
-drop table t1;
-create table t1 (v varchar(32));
+DROP TABLE t1;
+CREATE TABLE t1 (v varchar(32)) ;
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);
select * from t1;
# Fast alter, no copy performed
-alter table t1 change v2 v varchar(64);
-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 change v2 v varchar(64);
select * from t1;
-update t1 set i=5 where i=3;
-select * from t1;
-alter table t1 change i i bigint;
-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');
-
-alter table t1 data directory="$MYSQLTEST_VARDIR/tmp";
+# Regular ALTER TABLE
+ALTER TABLE t1 add i int auto_increment not null primary key first;
select * from t1;
# Testing cleared row key
@@ -1503,7 +1495,7 @@ CREATE TABLE `t5` (
b varchar(250),
c varchar(800),
KEY (`a`)
-) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;
+) DEFAULT CHARSET=latin1;
INSERT INTO t5 VALUES (NULL, "foo", "grok this!");
INSERT INTO t5 VALUES (NULL, "We the people", NULL);
@@ -1516,11 +1508,35 @@ INSERT INTO t5 VALUES (NULL, "abcdeghijklmnopqrstuvwxyzabcdeghijklmnopqrstuvwxyz
SELECT * FROM t5;
+CREATE TABLE `t6` (
+`a` int(11) NOT NULL auto_increment,
+b blob(12),
+c int,
+KEY (`a`)
+) DEFAULT CHARSET=latin1;
+SELECT * FROM t6;
+INSERT INTO t6 VALUES (NULL, "foo", NULL);
+INSERT INTO t6 VALUES (NULL, "We the people", 5);
+INSERT INTO t6 VALUES (NULL, "in order to form a more pefect union", 9);
+INSERT INTO t6 VALUES (NULL, "establish justice", NULL);
+INSERT INTO t6 VALUES (NULL, NULL, NULL);
+INSERT INTO t6 VALUES (32, "ensure domestic tranquility", NULL);
+INSERT INTO t6 VALUES (23, "provide for the common defense", 30);
+INSERT INTO t6 VALUES (NULL, "fo fooo", 70);
+INSERT INTO t6 VALUES (NULL, NULL, 98);
+INSERT INTO t6 VALUES (NULL, "promote the general welfare", 50);
+SELECT * FROM t6;
+SELECT * FROM t6 ORDER BY a;
+SELECT * FROM t6 ORDER BY a DESC;
+
+SHOW CREATE TABLE t6;
+
+
#
# Cleanup, test is over
#
--disable_warnings
-drop table t1, t2, t4, t5;
+DROP TABLE t1, t2, t4, t5, t6;
--enable_warnings
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index 8c2c4740f5e..f1e7271ce2e 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -39,4 +39,4 @@ synchronization : Bug#24529 Test 'synchronization' fails on Mac pushb
flush2 : Bug#24805 Pushbuild can't handle test with --disable-log-bin
mysql_upgrade : Bug#25074 mysql_upgrade gives inconsisten results
plugin : Bug#25659 memory leak via "plugins" test
-
+rpl_ndb_dd_advance : Bug#25913 rpl_ndb_dd_advance fails randomly
diff --git a/mysql-test/t/log_state.test b/mysql-test/t/log_state.test
index 6fc0f3421a7..e16256d48df 100644
--- a/mysql-test/t/log_state.test
+++ b/mysql-test/t/log_state.test
@@ -37,7 +37,6 @@ set session long_query_time=1;
select sleep(2);
--replace_column 1 TIMESTAMP 2 USER_HOST 3 QUERY_TIME
select * from mysql.slow_log;
-disconnect con1;
connection default;
show global variables
where Variable_name = 'log' or Variable_name = 'log_slow_queries' or
@@ -121,3 +120,8 @@ drop table t1;
select * from mysql.general_log;
--enable_ps_protocol
+
+#
+# Cleanup (must be done last to avoid delayed 'Quit' message in general log)
+#
+disconnect con1;
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index ac2b9471fe9..d3639b07bdb 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -389,7 +389,7 @@ drop table t1, t2, t3;
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES(2),(1);
CREATE TABLE t2(a INT, KEY(a)) ENGINE=MERGE UNION=(t1);
---error 1030
+--error 1168
SELECT * FROM t2 WHERE a=2;
DROP TABLE t1, t2;
@@ -407,6 +407,33 @@ CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t3);
SELECT * FROM t2;
DROP TABLE t2;
+#
+# Underlying table definition conformance tests.
+#
+CREATE TABLE t1(a INT, b TEXT);
+CREATE TABLE tm1(a TEXT, b INT) ENGINE=MERGE UNION=(t1);
+--error 1168
+SELECT * FROM tm1;
+DROP TABLE t1, tm1;
+
+CREATE TABLE t1(a SMALLINT, b SMALLINT);
+CREATE TABLE tm1(a INT) ENGINE=MERGE UNION=(t1);
+--error 1168
+SELECT * FROM tm1;
+DROP TABLE t1, tm1;
+
+CREATE TABLE t1(a SMALLINT, b SMALLINT, KEY(a, b));
+CREATE TABLE tm1(a SMALLINT, b SMALLINT, KEY(a)) ENGINE=MERGE UNION=(t1);
+--error 1168
+SELECT * FROM tm1;
+DROP TABLE t1, tm1;
+
+CREATE TABLE t1(a SMALLINT, b SMALLINT, KEY(b));
+CREATE TABLE tm1(a SMALLINT, b SMALLINT, KEY(a)) ENGINE=MERGE UNION=(t1);
+--error 1168
+SELECT * FROM tm1;
+DROP TABLE t1, tm1;
+
# End of 4.1 tests
#
diff --git a/mysql-test/t/mysql.test b/mysql-test/t/mysql.test
index c0f33ef9204..23cdb094e83 100644
--- a/mysql-test/t/mysql.test
+++ b/mysql-test/t/mysql.test
@@ -44,7 +44,7 @@ unlock tables;
drop table t1;
#
-# BUG#16217 - MySQL client misinterpretes multi-byte char as escape `\'
+# BUG#16217 - MySQL client misinterprets multi-byte char as escape `\'
#
# new command \C or charset
@@ -263,4 +263,14 @@ drop table t17583;
--exec echo "DELIMITER \\\\" > $MYSQLTEST_VARDIR/tmp/bug21412.sql
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug21412.sql 2>&1
+#
+# Some coverage of not normally used parts
+#
+
+--disable_query_log
+--exec $MYSQL test -e "show status" 2>&1 > /dev/null
+--exec $MYSQL --help 2>&1 > /dev/null
+--exec $MYSQL --version 2>&1 > /dev/null
+--enable_quary_log
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test
index ad6a16810c5..8c5d5f772fc 100644
--- a/mysql-test/t/mysqlbinlog.test
+++ b/mysql-test/t/mysqlbinlog.test
@@ -9,7 +9,7 @@
set timestamp=1000000000;
--disable_warnings
-drop table if exists t1,t2;
+drop table if exists t1,t2,t3,t4,t5,t03,t04;
--enable_warnings
create table t1 (word varchar(20));
@@ -108,8 +108,11 @@ select "--- reading stdin --" as "";
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--exec $MYSQL_BINLOG --short-form --position=79 - < $MYSQL_TEST_DIR/std_data/trunc_binlog.000001
+drop table t1,t2;
+#
# Bug#16217 (mysql client did not know how not switch its internal charset)
+#
flush logs;
create table t3 (f text character set utf8);
create table t4 (f text character set cp932);
@@ -123,6 +126,7 @@ select HEX(f) from t03;
select HEX(f) from t3;
select HEX(f) from t04;
select HEX(f) from t4;
+drop table t3,t4,t03,t04;
#
#BUG#14157: utf8 encoding in binlog without set character_set_client
@@ -136,6 +140,7 @@ flush logs;
flush logs;
--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000006 | $MYSQL
select * from t5 /* must be (1),(1) */;
+drop table t5;
#
# Bug#22645 LC_TIME_NAMES: Statement not replicated
@@ -143,7 +148,6 @@ select * from t5 /* must be (1),(1) */;
# lc_time_names dependent values correctly
#
flush logs;
-drop table if exists t5;
create table t5 (c1 int, c2 varchar(128) character set latin1 not null);
insert into t5 values (1, date_format('2001-01-01','%W'));
set lc_time_names=de_DE;
@@ -155,6 +159,8 @@ flush logs;
drop table t5;
--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000008 | $MYSQL
select * from t5 order by c1;
+drop table t5;
+
#
# Bug#20396 Bin Log does not get DELIMETER cmd - Recover StoredProc fails
#
@@ -179,8 +185,13 @@ call p1();
call p1();
drop procedure p1;
-# clean up
-drop table t1, t2, t03, t04, t3, t4, t5;
+#
+# Some coverage of not normally used parts
+#
+--disable_query_log
+--exec $MYSQL_BINLOG --version 2>&1 > /dev/null
+--exec $MYSQL_BINLOG --help 2>&1 > /dev/null
+--enable_query_log
# End of 5.0 tests
diff --git a/mysql-test/t/mysqlcheck.test b/mysql-test/t/mysqlcheck.test
index 074faa48021..d233546f9e3 100644
--- a/mysql-test/t/mysqlcheck.test
+++ b/mysql-test/t/mysqlcheck.test
@@ -1,3 +1,4 @@
+
# Embedded server doesn't support external clients
--source include/not_embedded.inc
@@ -5,13 +6,16 @@
# depends on the presence of the log tables (which are CSV-based).
--source include/have_csv.inc
+#
+# Clean up after previous tests
+#
+
--disable_warnings
+DROP TABLE IF EXISTS t1;
+drop view if exists v1;
drop database if exists client_test_db;
--enable_warnings
-DROP SCHEMA test;
-CREATE SCHEMA test;
-use test;
#
# Bug #13783 mysqlcheck tries to optimize and analyze information_schema
#
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index 7da84543e6d..601bf7af7d5 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -1246,8 +1246,16 @@ EOF
connect (con1,localhost,root,,);
connection default;
connection con1;
+disconnect con1;
--enable_abort_on_error
+# Test connect without a database
+connect (con2,localhost,root,,*NO-ONE*);
+--error ER_NO_DB_ERROR
+show tables;
+disconnect con2;
+connection default;
+
# ----------------------------------------------------------------------------
# Test mysqltest arguments
# ----------------------------------------------------------------------------
@@ -1605,5 +1613,17 @@ EOF
--exec echo "echo Some output; exit; echo Not this;" | $MYSQL_TEST 2>&1
+# ----------------------------------------------------------------------------
+# Some coverage tests
+# ----------------------------------------------------------------------------
+
+--disable_query_log
+--exec $MYSQL_TEST --help 2>&1 > /dev/null
+--exec $MYSQL_TEST --version 2>&1 > /dev/null
+--enable_quary_log
+--disable_abort_on_error
+--error 1
+--exec $MYSQL_TEST a b c 2>&1 > /dev/null
+--enable_abort_on_error
--echo End of tests
diff --git a/mysql-test/t/ndb_read_multi_range.test b/mysql-test/t/ndb_read_multi_range.test
index 9d7415880ce..b490eeb68a3 100644
--- a/mysql-test/t/ndb_read_multi_range.test
+++ b/mysql-test/t/ndb_read_multi_range.test
@@ -272,3 +272,48 @@ SELECT id, tag, doc, type FROM t1 WHERE id IN ('flipper','orka');
SELECT id, tag, doc, type FROM t1 WHERE id IN ('flipper','sakila');
DROP TABLE t1;
+
+#bug#25522
+CREATE TABLE t1 (
+ var1 int(2) NOT NULL,
+ var2 int(2) NOT NULL,
+ PRIMARY KEY (var1)
+ ) ENGINE=ndbcluster DEFAULT CHARSET=ascii CHECKSUM=1;
+
+
+CREATE TABLE t2 (
+ var1 int(2) NOT NULL,
+ var2 int(2) NOT NULL,
+ PRIMARY KEY (var1)
+ ) ENGINE=MyISAM DEFAULT CHARSET=ascii CHECKSUM=1;
+
+
+DELIMITER |;
+CREATE TRIGGER testtrigger
+ AFTER UPDATE ON t1 FOR EACH ROW BEGIN
+ REPLACE INTO t2 SELECT * FROM t1 WHERE t1.var1 = NEW.var1;END|
+DELIMITER ;|
+
+INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
+
+UPDATE t1 SET var2 = 9 WHERE var1 IN(1,2,3);
+
+DROP TRIGGER testtrigger;
+
+DROP TABLE t1, t2;
+
+#bug#25821
+create table t1 (a int, b int, primary key (a), key ab (a,b)) engine=ndbcluster;
+
+insert into t1 values (1,1), (10,10);
+
+select * from t1 use index (ab) where a in(1,10) order by a;
+
+create table t2 (a int, b int, primary key (a,b)) engine=ndbcluster
+partition by key(a);
+
+insert into t2 values (1,1), (10,10);
+
+select * from t2 where a in (1,10) order by a;
+
+drop table t1, t2;
diff --git a/mysql-test/t/rpl_ndb_dd_advance.test b/mysql-test/t/rpl_ndb_dd_advance.test
index 4730951cb47..82ec85c09a5 100644
--- a/mysql-test/t/rpl_ndb_dd_advance.test
+++ b/mysql-test/t/rpl_ndb_dd_advance.test
@@ -9,6 +9,7 @@
--source include/have_binlog_format_row.inc
--source include/ndb_default_cluster.inc
--source include/not_embedded.inc
+--source include/big_test.inc
#--source include/have_ndb_extra.inc
--source include/master-slave.inc
diff --git a/mysql-test/t/wait_timeout.test b/mysql-test/t/wait_timeout.test
index bdff72cdc76..826a35cabdf 100644
--- a/mysql-test/t/wait_timeout.test
+++ b/mysql-test/t/wait_timeout.test
@@ -49,7 +49,8 @@ sleep 1;
connection default;
# When the connection is closed in this way, the error code should
# be consistent see bug#2845 for an explanation
---error 2006
+# depending on platform/client, either errno 2006 or 2013 can occur below
+--error 2006,2013
select 2;
--enable_reconnect
select 3;
@@ -96,7 +97,8 @@ sleep 1;
connection con1;
# When the connection is closed in this way, the error code should
# be consistent see bug#2845 for an explanation
---error 2006
+# depending on platform/client, either errno 2006 or 2013 can occur below
+--error 2006,2013
select 2;
--enable_reconnect
select 3;