summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2010-11-05 12:37:51 +0200
committerMichael Widenius <monty@askmonty.org>2010-11-05 12:37:51 +0200
commitc670b9021e782ead4cdd0d20ead2421367626ea5 (patch)
tree4178c9a4656d1df6bfbabc07b9962deb25d57ab5 /mysql-test
parentfdd6963890d5cd793155d135c3fa321ecb5b704d (diff)
parent7647c2744c95f23fa7a1f4aec98359f5a9a55e01 (diff)
downloadmariadb-git-c670b9021e782ead4cdd0d20ead2421367626ea5.tar.gz
Automerge with 5.2
Diffstat (limited to 'mysql-test')
-rwxr-xr-xmysql-test/mysql-test-run.pl1
-rw-r--r--mysql-test/r/merge.result90
-rw-r--r--mysql-test/r/merge_debug.result24
-rw-r--r--mysql-test/r/udf_query_cache.result1
-rw-r--r--mysql-test/r/warnings_debug.result10
-rw-r--r--mysql-test/suite/parts/r/partition_repair_myisam.result2
-rw-r--r--mysql-test/t/merge.test45
-rw-r--r--mysql-test/t/merge_debug.test42
-rw-r--r--mysql-test/t/udf_query_cache.test1
-rw-r--r--mysql-test/t/warnings_debug.test19
10 files changed, 200 insertions, 35 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 2eb32c33954..41501da6088 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -4281,6 +4281,7 @@ sub extract_warning_lines ($) {
qr/Slave SQL thread retried transaction/,
qr/Slave \(additional info\)/,
qr/Incorrect information in file/,
+ qr/Incorrect key file for table .*crashed.*/,
qr/Slave I\/O: Get master SERVER_ID failed with error:.*/,
qr/Slave I\/O: Get master clock failed with error:.*/,
qr/Slave I\/O: Get master COLLATION_SERVER failed with error:.*/,
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index 8cd5302345b..2a36c78fc28 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -1574,7 +1574,7 @@ UNLOCK TABLES;
#
# Trigger on parent
DELETE FROM t4 WHERE c1 = 4;
-CREATE TRIGGER t4_ai AFTER INSERT ON t4 FOR EACH ROW SET @a=1;
+CREATE TRIGGER t4_ai1 AFTER INSERT ON t4 FOR EACH ROW SET @a=1;
SET @a=0;
INSERT INTO t4 VALUES (4);
SELECT @a;
@@ -1586,10 +1586,13 @@ c1
2
3
4
-DROP TRIGGER t4_ai;
+DROP TRIGGER t4_ai1;
+CHECK TABLE t3;
+Table Op Msg_type Msg_text
+test.t3 check status OK
# Trigger on parent under LOCK TABLES
LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE;
-CREATE TRIGGER t4_ai AFTER INSERT ON t4 FOR EACH ROW SET @a=1;
+CREATE TRIGGER t4_ai2 AFTER INSERT ON t4 FOR EACH ROW SET @a=1;
SET @a=0;
INSERT INTO t4 VALUES (4);
SELECT @a;
@@ -1602,12 +1605,15 @@ c1
3
4
4
-DROP TRIGGER t4_ai;
+DROP TRIGGER t4_ai2;
UNLOCK TABLES;
+CHECK TABLE t3;
+Table Op Msg_type Msg_text
+test.t3 check status OK
#
# Trigger on child
DELETE FROM t4 WHERE c1 = 4;
-CREATE TRIGGER t3_ai AFTER INSERT ON t3 FOR EACH ROW SET @a=1;
+CREATE TRIGGER t3_ai3 AFTER INSERT ON t3 FOR EACH ROW SET @a=1;
SET @a=0;
INSERT INTO t4 VALUES (4);
SELECT @a;
@@ -1624,10 +1630,13 @@ c1
3
4
33
-DROP TRIGGER t3_ai;
+DROP TRIGGER t3_ai3;
+CHECK TABLE t3;
+Table Op Msg_type Msg_text
+test.t3 check status OK
# Trigger on child under LOCK TABLES
LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE;
-CREATE TRIGGER t3_ai AFTER INSERT ON t3 FOR EACH ROW SET @a=1;
+CREATE TRIGGER t3_ai4 AFTER INSERT ON t3 FOR EACH ROW SET @a=1;
SET @a=0;
INSERT INTO t4 VALUES (4);
SELECT @a;
@@ -1647,11 +1656,17 @@ c1
33
33
DELETE FROM t4 WHERE c1 = 33;
-DROP TRIGGER t3_ai;
+DROP TRIGGER t3_ai4;
+CHECK TABLE t3;
+Table Op Msg_type Msg_text
+test.t3 check status OK
#
# Trigger with table use on child
DELETE FROM t4 WHERE c1 = 4;
-CREATE TRIGGER t3_ai AFTER INSERT ON t3 FOR EACH ROW INSERT INTO t2 VALUES(22);
+CREATE TRIGGER t3_ai5 AFTER INSERT ON t3 FOR EACH ROW INSERT INTO t2 VALUES(22);
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+1
INSERT INTO t4 VALUES (4);
SELECT * FROM t4 ORDER BY c1;
c1
@@ -1670,10 +1685,15 @@ c1
33
DELETE FROM t4 WHERE c1 = 22;
DELETE FROM t4 WHERE c1 = 33;
-DROP TRIGGER t3_ai;
+DROP TRIGGER t3_ai5;
+UNLOCK TABLES;
+CHECK TABLE t2,t3;
+Table Op Msg_type Msg_text
+test.t2 check status OK
+test.t3 check status OK
# Trigger with table use on child under LOCK TABLES
LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE;
-CREATE TRIGGER t3_ai AFTER INSERT ON t3 FOR EACH ROW INSERT INTO t2 VALUES(22);
+CREATE TRIGGER t3_ai6 AFTER INSERT ON t3 FOR EACH ROW INSERT INTO t2 VALUES(22);
INSERT INTO t4 VALUES (4);
SELECT * FROM t4 ORDER BY c1;
c1
@@ -1692,10 +1712,44 @@ c1
4
22
33
-DROP TRIGGER t3_ai;
+DROP TRIGGER t3_ai6;
+UNLOCK TABLES;
+check table t2,t3,t4;
+Table Op Msg_type Msg_text
+test.t2 check status OK
+test.t3 check status OK
+test.t4 check status OK
DELETE FROM t4 WHERE c1 = 22;
DELETE FROM t4 WHERE c1 = 33;
+# Trigger with table use on child under different LOCK TABLES
+DELETE FROM t4 WHERE c1 = 4;
+LOCK TABLES t4 WRITE,t3 WRITE, t2 WRITE, t1 WRITE;
+CREATE TRIGGER t3_ai7 AFTER INSERT ON t3 FOR EACH ROW INSERT INTO t2 VALUES(22);
+INSERT INTO t4 VALUES (4);
+SELECT * FROM t4 ORDER BY c1;
+c1
+1
+2
+3
+4
+INSERT INTO t3 VALUES (33);
+SELECT * FROM t4 ORDER BY c1;
+c1
+1
+2
+3
+4
+22
+33
+DROP TRIGGER t3_ai7;
UNLOCK TABLES;
+check table t2,t3,t4;
+Table Op Msg_type Msg_text
+test.t2 check status OK
+test.t3 check status OK
+test.t4 check status OK
+DELETE FROM t4 WHERE c1 = 22;
+DELETE FROM t4 WHERE c1 = 33;
#
# Repair
#
@@ -1711,7 +1765,6 @@ c1
2
3
4
-4
LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE;
REPAIR TABLE t4;
Table Op Msg_type Msg_text
@@ -1725,7 +1778,6 @@ c1
2
3
4
-4
UNLOCK TABLES;
#
# Optimize
@@ -1742,7 +1794,6 @@ c1
2
3
4
-4
LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE;
OPTIMIZE TABLE t4;
Table Op Msg_type Msg_text
@@ -1756,14 +1807,13 @@ c1
2
3
4
-4
UNLOCK TABLES;
#
# Checksum
#
CHECKSUM TABLE t4;
Table Checksum
-test.t4 46622073
+test.t4 149057747
CHECKSUM TABLE t2;
Table Checksum
test.t2 3700403066
@@ -1773,11 +1823,10 @@ c1
2
3
4
-4
LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE;
CHECKSUM TABLE t4;
Table Checksum
-test.t4 46622073
+test.t4 149057747
CHECKSUM TABLE t2;
Table Checksum
test.t2 3700403066
@@ -1787,7 +1836,6 @@ c1
2
3
4
-4
UNLOCK TABLES;
#
# Insert delayed
@@ -1801,7 +1849,6 @@ c1
2
3
4
-4
33
LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE;
INSERT DELAYED INTO t4 VALUES(444);
@@ -1814,7 +1861,6 @@ c1
2
3
4
-4
33
UNLOCK TABLES;
DROP TABLE t1, t2, t3, t4;
diff --git a/mysql-test/r/merge_debug.result b/mysql-test/r/merge_debug.result
new file mode 100644
index 00000000000..b857ff597f2
--- /dev/null
+++ b/mysql-test/r/merge_debug.result
@@ -0,0 +1,24 @@
+set global storage_engine=myisam;
+set session storage_engine=myisam;
+drop table if exists crashed,t2,t3,t4;
+SET @orig_debug=@@debug;
+CREATE TABLE crashed (c1 INT);
+CREATE TABLE t2 (c1 INT);
+CREATE TABLE t3 (c1 INT);
+CREATE TABLE t4 (c1 INT) ENGINE=MRG_MYISAM UNION=(crashed,t2,t3) INSERT_METHOD=LAST;
+INSERT INTO crashed VALUES (10);
+INSERT INTO t2 VALUES (20);
+INSERT INTO t3 VALUES (30);
+LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, crashed WRITE;
+SET GLOBAL debug="+d,*,myisam_pretend_crashed_table_on_open";
+CREATE TRIGGER t1_ai AFTER INSERT ON crashed FOR EACH ROW INSERT INTO t2 VALUES(29);
+SET GLOBAL debug=@orig_debug;
+INSERT INTO t4 VALUES (39);
+ERROR HY000: Table 't4' was not locked with LOCK TABLES
+INSERT INTO crashed VALUES (11);
+ERROR HY000: Table 'crashed' was not locked with LOCK TABLES
+INSERT INTO t2 VALUES (21);
+INSERT INTO t3 VALUES (31);
+UNLOCK TABLES;
+DROP TRIGGER t1_ai;
+DROP TABLE t4,crashed,t2,t3;
diff --git a/mysql-test/r/udf_query_cache.result b/mysql-test/r/udf_query_cache.result
index 01dac554142..8c25c127012 100644
--- a/mysql-test/r/udf_query_cache.result
+++ b/mysql-test/r/udf_query_cache.result
@@ -3,6 +3,7 @@ CREATE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
create table t1 (a char);
set GLOBAL query_cache_size=1355776;
reset query cache;
+flush status;
select metaphon('MySQL') from t1;
metaphon('MySQL')
show status like "Qcache_hits";
diff --git a/mysql-test/r/warnings_debug.result b/mysql-test/r/warnings_debug.result
new file mode 100644
index 00000000000..08908bf0437
--- /dev/null
+++ b/mysql-test/r/warnings_debug.result
@@ -0,0 +1,10 @@
+drop table if exists t1;
+create table t1 (a int primary key) engine=innodb;
+SET SESSION debug="+d,warn_during_ha_commit_trans";
+INSERT INTO t1 VALUES (1);
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+SHOW WARNINGS;
+Level Code Message
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+drop table t1;
diff --git a/mysql-test/suite/parts/r/partition_repair_myisam.result b/mysql-test/suite/parts/r/partition_repair_myisam.result
index 2d0a26b397c..4af00ddcc6d 100644
--- a/mysql-test/suite/parts/r/partition_repair_myisam.result
+++ b/mysql-test/suite/parts/r/partition_repair_myisam.result
@@ -408,7 +408,7 @@ ALTER TABLE t1_will_crash CHECK PARTITION p6;
Table Op Msg_type Msg_text
test.t1_will_crash check warning Size of datafile is: 868 Should be: 604
test.t1_will_crash check error Record-count is not ok; is 8 Should be: 7
-test.t1_will_crash check warning Found 10 key parts. Should be: 7
+test.t1_will_crash check warning Found 10 parts. Should be: 7
test.t1_will_crash check error Partition p6 returned error
test.t1_will_crash check error Corrupt
ALTER TABLE t1_will_crash REPAIR PARTITION p6;
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index df99d6150ab..4e0ca615f99 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -1119,35 +1119,38 @@ UNLOCK TABLES;
--echo #
--echo # Trigger on parent
DELETE FROM t4 WHERE c1 = 4;
-CREATE TRIGGER t4_ai AFTER INSERT ON t4 FOR EACH ROW SET @a=1;
+CREATE TRIGGER t4_ai1 AFTER INSERT ON t4 FOR EACH ROW SET @a=1;
SET @a=0;
INSERT INTO t4 VALUES (4);
SELECT @a;
SELECT * FROM t4 ORDER BY c1;
-DROP TRIGGER t4_ai;
+DROP TRIGGER t4_ai1;
+CHECK TABLE t3;
--echo # Trigger on parent under LOCK TABLES
LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE;
-CREATE TRIGGER t4_ai AFTER INSERT ON t4 FOR EACH ROW SET @a=1;
+CREATE TRIGGER t4_ai2 AFTER INSERT ON t4 FOR EACH ROW SET @a=1;
SET @a=0;
INSERT INTO t4 VALUES (4);
SELECT @a;
SELECT * FROM t4 ORDER BY c1;
-DROP TRIGGER t4_ai;
+DROP TRIGGER t4_ai2;
UNLOCK TABLES;
+CHECK TABLE t3;
--echo #
--echo # Trigger on child
DELETE FROM t4 WHERE c1 = 4;
-CREATE TRIGGER t3_ai AFTER INSERT ON t3 FOR EACH ROW SET @a=1;
+CREATE TRIGGER t3_ai3 AFTER INSERT ON t3 FOR EACH ROW SET @a=1;
SET @a=0;
INSERT INTO t4 VALUES (4);
SELECT @a;
INSERT INTO t3 VALUES (33);
SELECT @a;
SELECT * FROM t4 ORDER BY c1;
-DROP TRIGGER t3_ai;
+DROP TRIGGER t3_ai3;
+CHECK TABLE t3;
--echo # Trigger on child under LOCK TABLES
LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE;
-CREATE TRIGGER t3_ai AFTER INSERT ON t3 FOR EACH ROW SET @a=1;
+CREATE TRIGGER t3_ai4 AFTER INSERT ON t3 FOR EACH ROW SET @a=1;
SET @a=0;
INSERT INTO t4 VALUES (4);
SELECT @a;
@@ -1155,29 +1158,47 @@ INSERT INTO t3 VALUES (33);
SELECT @a;
SELECT * FROM t4 ORDER BY c1;
DELETE FROM t4 WHERE c1 = 33;
-DROP TRIGGER t3_ai;
+DROP TRIGGER t3_ai4;
+CHECK TABLE t3;
--echo #
--echo # Trigger with table use on child
DELETE FROM t4 WHERE c1 = 4;
-CREATE TRIGGER t3_ai AFTER INSERT ON t3 FOR EACH ROW INSERT INTO t2 VALUES(22);
+CREATE TRIGGER t3_ai5 AFTER INSERT ON t3 FOR EACH ROW INSERT INTO t2 VALUES(22);
+SELECT COUNT(*) FROM t2;
INSERT INTO t4 VALUES (4);
SELECT * FROM t4 ORDER BY c1;
INSERT INTO t3 VALUES (33);
SELECT * FROM t4 ORDER BY c1;
DELETE FROM t4 WHERE c1 = 22;
DELETE FROM t4 WHERE c1 = 33;
-DROP TRIGGER t3_ai;
+DROP TRIGGER t3_ai5;
+UNLOCK TABLES;
+CHECK TABLE t2,t3;
--echo # Trigger with table use on child under LOCK TABLES
LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, t1 WRITE;
-CREATE TRIGGER t3_ai AFTER INSERT ON t3 FOR EACH ROW INSERT INTO t2 VALUES(22);
+CREATE TRIGGER t3_ai6 AFTER INSERT ON t3 FOR EACH ROW INSERT INTO t2 VALUES(22);
INSERT INTO t4 VALUES (4);
SELECT * FROM t4 ORDER BY c1;
INSERT INTO t3 VALUES (33);
SELECT * FROM t4 ORDER BY c1;
-DROP TRIGGER t3_ai;
+DROP TRIGGER t3_ai6;
+UNLOCK TABLES;
+check table t2,t3,t4;
DELETE FROM t4 WHERE c1 = 22;
DELETE FROM t4 WHERE c1 = 33;
+--echo # Trigger with table use on child under different LOCK TABLES
+DELETE FROM t4 WHERE c1 = 4;
+LOCK TABLES t4 WRITE,t3 WRITE, t2 WRITE, t1 WRITE;
+CREATE TRIGGER t3_ai7 AFTER INSERT ON t3 FOR EACH ROW INSERT INTO t2 VALUES(22);
+INSERT INTO t4 VALUES (4);
+SELECT * FROM t4 ORDER BY c1;
+INSERT INTO t3 VALUES (33);
+SELECT * FROM t4 ORDER BY c1;
+DROP TRIGGER t3_ai7;
UNLOCK TABLES;
+check table t2,t3,t4;
+DELETE FROM t4 WHERE c1 = 22;
+DELETE FROM t4 WHERE c1 = 33;
#
--echo #
--echo # Repair
diff --git a/mysql-test/t/merge_debug.test b/mysql-test/t/merge_debug.test
new file mode 100644
index 00000000000..2e30cf88b5d
--- /dev/null
+++ b/mysql-test/t/merge_debug.test
@@ -0,0 +1,42 @@
+#
+# Test failures with MERGE
+#
+
+--source include/have_debug.inc
+
+let $default=`select @@global.storage_engine`;
+set global storage_engine=myisam;
+set session storage_engine=myisam;
+
+--disable_warnings
+drop table if exists crashed,t2,t3,t4;
+--enable_warnings
+
+SET @orig_debug=@@debug;
+
+#
+# Check that MariaDB handles reopen that fails without crashing
+#
+CREATE TABLE crashed (c1 INT);
+CREATE TABLE t2 (c1 INT);
+CREATE TABLE t3 (c1 INT);
+CREATE TABLE t4 (c1 INT) ENGINE=MRG_MYISAM UNION=(crashed,t2,t3) INSERT_METHOD=LAST;
+INSERT INTO crashed VALUES (10);
+INSERT INTO t2 VALUES (20);
+INSERT INTO t3 VALUES (30);
+
+LOCK TABLES t3 WRITE, t2 WRITE, t4 WRITE, crashed WRITE;
+SET GLOBAL debug="+d,*,myisam_pretend_crashed_table_on_open";
+--disable_warnings
+CREATE TRIGGER t1_ai AFTER INSERT ON crashed FOR EACH ROW INSERT INTO t2 VALUES(29);
+--enable_warnings
+SET GLOBAL debug=@orig_debug;
+--error ER_TABLE_NOT_LOCKED
+INSERT INTO t4 VALUES (39);
+--error ER_TABLE_NOT_LOCKED
+INSERT INTO crashed VALUES (11);
+INSERT INTO t2 VALUES (21);
+INSERT INTO t3 VALUES (31);
+UNLOCK TABLES;
+DROP TRIGGER t1_ai;
+DROP TABLE t4,crashed,t2,t3;
diff --git a/mysql-test/t/udf_query_cache.test b/mysql-test/t/udf_query_cache.test
index ce7bd43ea1f..b0037973631 100644
--- a/mysql-test/t/udf_query_cache.test
+++ b/mysql-test/t/udf_query_cache.test
@@ -20,6 +20,7 @@ create table t1 (a char);
set GLOBAL query_cache_size=1355776;
reset query cache;
+flush status;
select metaphon('MySQL') from t1;
show status like "Qcache_hits";
diff --git a/mysql-test/t/warnings_debug.test b/mysql-test/t/warnings_debug.test
new file mode 100644
index 00000000000..99d02330960
--- /dev/null
+++ b/mysql-test/t/warnings_debug.test
@@ -0,0 +1,19 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+create table t1 (a int primary key) engine=innodb;
+
+# Test that warnings produced during autocommit (after calling
+# set_ok_status()) are still reported to the client.
+SET SESSION debug="+d,warn_during_ha_commit_trans";
+INSERT INTO t1 VALUES (1);
+# The warning will be shown automatically by mysqltest; there was a bug where
+# this didn't happen because the warning was not counted when sending result
+# packet. Show the warnings manually also.
+SHOW WARNINGS;
+
+drop table t1;