summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2015-01-21 12:03:02 +0100
committerSergei Golubchik <sergii@pisem.net>2015-01-21 12:03:02 +0100
commitd9c01e4b4ac6a7e2bdbcaf71819fa3d4f5269840 (patch)
tree4f86f6ce4e298430e313ed70f2225b3f29485f51 /mysql-test/t
parentd854a254b84595b3a8f3a4d8083a2b997d59912e (diff)
parent8bc712e481a18976853fa57a7be77aab6159d431 (diff)
downloadmariadb-git-d9c01e4b4ac6a7e2bdbcaf71819fa3d4f5269840.tar.gz
5.5 merge
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/frm_bad_row_type-7333.test14
-rw-r--r--mysql-test/t/func_time.test18
-rw-r--r--mysql-test/t/group_by.test15
-rw-r--r--mysql-test/t/insert_update_autoinc-7150.test8
-rw-r--r--mysql-test/t/kill-2-master.opt1
-rw-r--r--mysql-test/t/kill-2.test29
-rw-r--r--mysql-test/t/lock_sync.test1
-rw-r--r--mysql-test/t/mdev6830-master.opt1
-rw-r--r--mysql-test/t/mdev6830.test63
-rw-r--r--mysql-test/t/processlist.test18
-rw-r--r--mysql-test/t/sp-innodb.test45
-rw-r--r--mysql-test/t/view.test10
-rw-r--r--mysql-test/t/windows.test16
13 files changed, 229 insertions, 10 deletions
diff --git a/mysql-test/t/frm_bad_row_type-7333.test b/mysql-test/t/frm_bad_row_type-7333.test
new file mode 100644
index 00000000000..5100a85cb22
--- /dev/null
+++ b/mysql-test/t/frm_bad_row_type-7333.test
@@ -0,0 +1,14 @@
+#
+# MDEV-7333 "'show table status like 'table_name'" on tokudb table lead to MariaDB crash
+#
+let $datadir= `select @@datadir`;
+call mtr.add_suppression("bad_row_type.frm: invalid value 11 for the field row_format");
+copy_file std_data/bad_row_type.MYD $datadir/test/bad_row_type.MYD;
+copy_file std_data/bad_row_type.MYI $datadir/test/bad_row_type.MYI;
+copy_file std_data/bad_row_type.frm $datadir/test/bad_row_type.frm;
+
+select * from bad_row_type;
+show create table bad_row_type;
+replace_column 12 x 13 x;
+show table status like 'bad_row_type';
+drop table bad_row_type;
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index a3f488a8d1e..2b189765bbc 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -1631,3 +1631,21 @@ CREATE TABLE t1 ( d DATE, t TIME );
INSERT INTO t1 VALUES ('2008-12-05','22:34:09'),('2005-03-27','14:26:02');
SELECT EXTRACT(DAY_MINUTE FROM GREATEST(t,d)), GREATEST(t,d) FROM t1;
DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-7221 from_days fails after null value
+--echo #
+CREATE TABLE t1 (
+ id INT(11) NOT NULL PRIMARY KEY,
+ date1 DATE NULL DEFAULT NULL
+);
+INSERT INTO t1 VALUES (12, '2011-05-12');
+INSERT INTO t1 VALUES (13, NULL);
+INSERT INTO t1 VALUES (14, '2009-10-23');
+INSERT INTO t1 VALUES (15, '2014-10-30');
+INSERT INTO t1 VALUES (16, NULL);
+INSERT INTO t1 VALUES (17, NULL);
+INSERT INTO t1 VALUES (18, '2010-10-13');
+SELECT a.id,a.date1,FROM_DAYS(TO_DAYS(a.date1)-10) as date2, DATE_ADD(a.date1,INTERVAL -10 DAY),TO_DAYS(a.date1)-10 FROM t1 a ORDER BY a.id;
+DROP TABLE t1;
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index 35bd447e9ea..4b1cb82d0f9 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -1664,6 +1664,21 @@ WHERE t1a.c1 = c2 GROUP BY i2;
DROP TABLE t1,t2;
+--echo #
+--echo # MDEV-6855
+--echo # MIN(*) with subqueries with IS NOT NULL in WHERE clause crashed.
+--echo #
+
+CREATE TABLE t1 (i INT, c VARCHAR(3), KEY(c,i)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (7,'foo'),(0,'bar');
+
+CREATE TABLE t2 (j INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (0),(8),(1),(8),(9);
+
+SELECT MAX(i), c FROM t1
+WHERE c != 'qux' AND ( SELECT SUM(j) FROM t1, t2 ) IS NOT NULL GROUP BY c;
+drop table t1,t2;
+
#
# End of MariaDB 5.5 tests
#
diff --git a/mysql-test/t/insert_update_autoinc-7150.test b/mysql-test/t/insert_update_autoinc-7150.test
new file mode 100644
index 00000000000..1229898b4aa
--- /dev/null
+++ b/mysql-test/t/insert_update_autoinc-7150.test
@@ -0,0 +1,8 @@
+#
+# MDEV-7150 Wrong auto increment values on INSERT .. ON DUPLICATE KEY UPDATE when the inserted columns include NULL in an auto-increment column
+#
+create table t1 (a int(10) auto_increment primary key, b int(11));
+insert t1 values (null,1);
+insert t1 values (null,2), (1,-1), (null,3) on duplicate key update b=values(b);
+select * from t1;
+drop table t1;
diff --git a/mysql-test/t/kill-2-master.opt b/mysql-test/t/kill-2-master.opt
new file mode 100644
index 00000000000..ab6ca1731f5
--- /dev/null
+++ b/mysql-test/t/kill-2-master.opt
@@ -0,0 +1 @@
+--skip-name-resolve
diff --git a/mysql-test/t/kill-2.test b/mysql-test/t/kill-2.test
new file mode 100644
index 00000000000..0c1177722b4
--- /dev/null
+++ b/mysql-test/t/kill-2.test
@@ -0,0 +1,29 @@
+#
+# Test KILL and KILL QUERY statements.
+#
+# Killing a connection in an embedded server does not work like in a normal
+# server, if it is waiting for a new statement. In an embedded server, the
+# connection does not read() from a socket, but returns control to the
+# application. 'mysqltest' does not handle the kill request.
+#
+
+-- source include/not_embedded.inc
+-- source include/not_threadpool.inc
+
+--echo #
+--echo # MDEV-6896 kill user command cause MariaDB crash!
+--echo #
+
+create user foo@'127.0.0.1';
+
+--connect (con1,127.0.0.1,foo,,)
+
+--connection default
+select user from information_schema.processlist;
+kill user foo@'127.0.0.1';
+
+let $wait_condition=
+ select count(*) = 0 from information_schema.processlist
+ where user = "foo";
+--source include/wait_condition.inc
+drop user foo@'127.0.0.1';
diff --git a/mysql-test/t/lock_sync.test b/mysql-test/t/lock_sync.test
index f00080d917b..ef79cc2c0f4 100644
--- a/mysql-test/t/lock_sync.test
+++ b/mysql-test/t/lock_sync.test
@@ -1186,7 +1186,6 @@ DROP TABLE t1;
disconnect con1;
disconnect con2;
-
# Check that all connections opened by test cases in this file are really
# gone so execution of other tests won't be affected by their presence.
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/mdev6830-master.opt b/mysql-test/t/mdev6830-master.opt
new file mode 100644
index 00000000000..2a8c27d4731
--- /dev/null
+++ b/mysql-test/t/mdev6830-master.opt
@@ -0,0 +1 @@
+--debug
diff --git a/mysql-test/t/mdev6830.test b/mysql-test/t/mdev6830.test
new file mode 100644
index 00000000000..24565d04fed
--- /dev/null
+++ b/mysql-test/t/mdev6830.test
@@ -0,0 +1,63 @@
+
+--source include/have_debug.inc
+
+--disable_warnings
+drop table if exists t1,t2,t3;
+drop view if exists v2,v3;
+--enable_warnings
+CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=MyISAM;
+
+CREATE TABLE t2 (
+ f1 DATE,
+ f2 VARCHAR(1024),
+ f3 VARCHAR(10),
+ f4 DATE,
+ f5 VARCHAR(10),
+ f6 VARCHAR(10),
+ f7 VARCHAR(10),
+ f8 DATETIME,
+ f9 INT,
+ f10 VARCHAR(1024),
+ f11 VARCHAR(1024),
+ f12 INT,
+ f13 VARCHAR(1024)
+) ENGINE=MyISAM;
+
+CREATE OR REPLACE VIEW v2 AS SELECT * FROM t2;
+
+CREATE TABLE t3 (
+ f1 VARCHAR(1024),
+ f2 VARCHAR(1024),
+ f3 DATETIME,
+ f4 VARCHAR(10),
+ f5 INT,
+ f6 VARCHAR(10),
+ f7 VARCHAR(1024),
+ f8 VARCHAR(10),
+ f9 INT,
+ f10 DATE,
+ f11 INT,
+ f12 VARCHAR(1024),
+ f13 VARCHAR(10),
+ f14 DATE,
+ f15 DATETIME
+) ENGINE=MyISAM;
+
+CREATE OR REPLACE ALGORITHM=TEMPTABLE VIEW v3 AS SELECT * FROM t3;
+
+INSERT INTO t3 VALUES
+ ('FOO','foo','2000-08-04 00:00:00','one',1,'1','FOO','foo',1,'2004-05-09',1,'one','one','2001-12-07','2001-10-17 08:25:04'),
+ ('BAR','bar','2001-01-01 04:52:37','two',2,'2','BAR','bar',2,'2008-01-01',2,'two','two','2006-06-19','2002-01-01 08:22:49');
+
+CREATE TABLE t4 (f1 VARCHAR(10), f2 INT) ENGINE=MyISAM;
+
+SELECT * FROM t1;
+
+--error ER_BAD_FIELD_ERROR
+SELECT non_existing FROM v2;
+
+SELECT * FROM t1, v3, t4 WHERE v3.f1 = t4.f1 AND t4.f2 = 6 AND t1.pk = v3.f5;
+
+drop table t1,t2,t3,t4;
+drop view v2,v3;
+
diff --git a/mysql-test/t/processlist.test b/mysql-test/t/processlist.test
index 9c555c0f9fb..a8f8a4ed64c 100644
--- a/mysql-test/t/processlist.test
+++ b/mysql-test/t/processlist.test
@@ -2,6 +2,7 @@
# MDEV-4578 information_schema.processlist reports incorrect value for Time (2147483647)
#
+source include/have_debug.inc;
source include/have_debug_sync.inc;
let $tid= `SELECT CONNECTION_ID()`;
@@ -21,6 +22,7 @@ SET DEBUG_SYNC = 'now SIGNAL fill_schema_proceed';
connection con1;
--replace_result $tid TID
reap;
+set debug_sync='reset';
connection default;
#
@@ -28,15 +30,13 @@ connection default;
#
connection con1;
-# Trigger a signal once the thread has gone from "Query" to "Sleep" command
-# state. Note we need to execute this twice: Once at the end of SET DEBUG_SYNC,
-# and once for the intended time, at the end of SELECT SLEEP().
-SET DEBUG_SYNC = 'dispatch_command_end SIGNAL query_done EXECUTE 2';
-connection default;
-# Wait for and clear the first signal set during SET DEBUG_SYNC.
-SET DEBUG_SYNC= 'now WAIT_FOR query_done';
-SET DEBUG_SYNC= 'now SIGNAL nosignal';
-connection con1;
+# This DBUG insertion triggers a DEBUG_SYNC signal "query_done" once
+# the below SELECT SLEEP(5) has gone from "Query" to "Sleep" command
+# state. (We cannot just set the DEBUG_SYNC directly here, because
+# then it can trigger at the end of the SET DEBUG_SYNC statement (or
+# at the end of the Prepare step of the SELECT, if --ps-protocol),
+# thus occuring too early).
+SET debug_dbug="+d,sleep_inject_query_done_debug_sync";
select sleep(5); #run a query that will take some time
connection default;
diff --git a/mysql-test/t/sp-innodb.test b/mysql-test/t/sp-innodb.test
new file mode 100644
index 00000000000..228ab42544d
--- /dev/null
+++ b/mysql-test/t/sp-innodb.test
@@ -0,0 +1,45 @@
+
+--source include/have_innodb.inc
+
+--disable_warnings
+drop table if exists t1,t2;
+drop procedure if exists p1;
+--enable_warnings
+
+--echo #
+--echo #MDEV-6985: MariaDB crashes on stored procedure call
+--echo #
+CREATE TABLE `t1` (
+ `ID` int(11) NOT NULL,
+ PRIMARY KEY (`ID`)
+) ENGINE=InnoDB;
+
+CREATE TABLE `t2` (
+ `ID` int(11) NOT NULL,
+ `DATE` datetime DEFAULT NULL,
+ PRIMARY KEY (`ID`)
+) ENGINE=InnoDB;
+
+--delimiter ;;
+
+CREATE PROCEDURE `p1`()
+BEGIN
+ DECLARE _mySelect CURSOR FOR
+ SELECT DISTINCT t1.ID
+ FROM t1
+ LEFT JOIN t2 AS t2 ON
+ t2.ID = t1.ID
+ AND t2.DATE = (
+ SELECT MAX(T3.DATE) FROM t2 AS T3 WHERE T3.ID = t2.ID AND T3.DATE<=NOW()
+ )
+ WHERE t1.ID = 1;
+ OPEN _mySelect;
+ CLOSE _mySelect;
+END ;;
+--delimiter ;
+
+CALL p1();
+CALL p1();
+
+drop procedure p1;
+drop table t1,t2;
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index eb905b5c4df..ae78d5504cf 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -5335,6 +5335,16 @@ DROP FUNCTION f1;
DROP VIEW v1;
DROP TABLE t1, t2;
+
+create view v1 as select 1;
+
+--let $MYSQLD_DATADIR= `select @@datadir`
+--let SEARCH_FILE= $MYSQLD_DATADIR/test/v1.frm
+--let SEARCH_PATTERN=mariadb-version
+--source include/search_pattern_in_file.inc
+
+drop view v1;
+
--echo # -----------------------------------------------------------------
--echo # -- End of 5.5 tests.
--echo # -----------------------------------------------------------------
diff --git a/mysql-test/t/windows.test b/mysql-test/t/windows.test
index b7d31948d23..617daba6b8e 100644
--- a/mysql-test/t/windows.test
+++ b/mysql-test/t/windows.test
@@ -98,3 +98,19 @@ deallocate prepare abc;
SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME = 'socket';
+
+--echo #
+--echo # Bug#16581605: REPLACE.EXE UTILITY IS BROKEN IN 5.5
+--echo #
+
+# Creating a temporary text file.
+--write_file $MYSQL_TMP_DIR/bug16581605.txt
+abc
+def
+EOF
+
+#REPLACE.EXE UTILITY will work fine after the fix.
+--exec $REPLACE abc xyz < $MYSQL_TMP_DIR/bug16581605.txt
+
+#Cleanup
+remove_file $MYSQL_TMP_DIR/bug16581605.txt;