summaryrefslogtreecommitdiff
path: root/mysql-test/include
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@mysql.com>2009-09-29 17:49:36 +0500
committerAlexey Botchkov <holyfoot@mysql.com>2009-09-29 17:49:36 +0500
commit45bdc1e063d663a621cc1f1cc05b4c62c03d1914 (patch)
tree4f8703aec195c605079ee82c9a810dcc9462d375 /mysql-test/include
parente43df58eade0b6806377966a0d3a2cdb88743a5d (diff)
parentfc3740368aed05f95da167deda7544a91a904d3f (diff)
downloadmariadb-git-45bdc1e063d663a621cc1f1cc05b4c62c03d1914.tar.gz
merging
Diffstat (limited to 'mysql-test/include')
-rw-r--r--mysql-test/include/commit.inc12
-rw-r--r--mysql-test/include/have_dynamic_loading.inc7
-rw-r--r--mysql-test/include/have_example_plugin.inc5
-rw-r--r--mysql-test/include/have_mysql_upgrade.inc4
-rw-r--r--mysql-test/include/have_not_innodb_plugin.inc4
-rw-r--r--mysql-test/include/have_simple_parser.inc5
-rw-r--r--mysql-test/include/have_udf.inc5
-rw-r--r--mysql-test/include/index_merge1.inc26
-rw-r--r--mysql-test/include/mix1.inc45
-rw-r--r--mysql-test/include/mtr_warnings.sql9
-rw-r--r--mysql-test/include/no_valgrind_without_big.inc12
-rw-r--r--mysql-test/include/partition_date_range.inc69
-rw-r--r--mysql-test/include/rpl_loaddata_charset.inc35
-rw-r--r--mysql-test/include/wait_for_slave_io_error.inc23
14 files changed, 205 insertions, 56 deletions
diff --git a/mysql-test/include/commit.inc b/mysql-test/include/commit.inc
index a4e7d9ae601..d91ba8291fd 100644
--- a/mysql-test/include/commit.inc
+++ b/mysql-test/include/commit.inc
@@ -669,13 +669,9 @@ call p_verify_status_increment(1, 0, 1, 0);
insert t1 set a=3;
call p_verify_status_increment(2, 2, 2, 2);
savepoint a;
-call p_verify_status_increment(0, 0, 0, 0);
+call p_verify_status_increment(1, 0, 1, 0);
insert t1 set a=4;
---echo # Binlog does not register itself this time for other than the 1st
---echo # statement of the transaction with MIXED/STATEMENT binlog_format.
---echo # It needs registering with the ROW format. Therefore 1,0,2,2 are
---echo # the correct arguments to this test after bug#40221 fixed.
-call p_verify_status_increment(1, 0, 2, 2);
+call p_verify_status_increment(2, 2, 2, 2);
release savepoint a;
rollback;
call p_verify_status_increment(0, 0, 0, 0);
@@ -729,9 +725,9 @@ call p_verify_status_increment(4, 4, 4, 4);
alter table t3 add column (b int);
call p_verify_status_increment(2, 0, 2, 0);
alter table t3 rename t4;
-call p_verify_status_increment(1, 0, 1, 0);
+call p_verify_status_increment(2, 2, 2, 2);
rename table t4 to t3;
-call p_verify_status_increment(1, 0, 1, 0);
+call p_verify_status_increment(2, 2, 2, 2);
truncate table t3;
call p_verify_status_increment(4, 4, 4, 4);
create view v1 as select * from t2;
diff --git a/mysql-test/include/have_dynamic_loading.inc b/mysql-test/include/have_dynamic_loading.inc
new file mode 100644
index 00000000000..1b2c85b3904
--- /dev/null
+++ b/mysql-test/include/have_dynamic_loading.inc
@@ -0,0 +1,7 @@
+#
+# Whether server supports dynamic loading.
+#
+--require r/have_dynamic_loading.require
+disable_query_log;
+show variables like 'have_dynamic_loading';
+enable_query_log;
diff --git a/mysql-test/include/have_example_plugin.inc b/mysql-test/include/have_example_plugin.inc
index 8e57c725eb5..a2fffc17b97 100644
--- a/mysql-test/include/have_example_plugin.inc
+++ b/mysql-test/include/have_example_plugin.inc
@@ -2,10 +2,7 @@
# Check if server has support for loading udf's
# i.e it will support dlopen
#
---require r/have_dynamic_loading.require
-disable_query_log;
-show variables like 'have_dynamic_loading';
-enable_query_log;
+--source include/have_dynamic_loading.inc
#
# Check if the variable EXAMPLE_PLUGIN is set
diff --git a/mysql-test/include/have_mysql_upgrade.inc b/mysql-test/include/have_mysql_upgrade.inc
new file mode 100644
index 00000000000..8f486176018
--- /dev/null
+++ b/mysql-test/include/have_mysql_upgrade.inc
@@ -0,0 +1,4 @@
+--require r/have_mysql_upgrade.result
+--disable_query_log
+select LENGTH("$MYSQL_UPGRADE")>0 as have_mysql_upgrade;
+--enable_query_log
diff --git a/mysql-test/include/have_not_innodb_plugin.inc b/mysql-test/include/have_not_innodb_plugin.inc
new file mode 100644
index 00000000000..aaefbaf661c
--- /dev/null
+++ b/mysql-test/include/have_not_innodb_plugin.inc
@@ -0,0 +1,4 @@
+disable_query_log;
+--require r/not_true.require
+select (PLUGIN_LIBRARY LIKE 'ha_innodb_plugin%') as `TRUE` from information_schema.plugins where PLUGIN_NAME='InnoDB';
+enable_query_log;
diff --git a/mysql-test/include/have_simple_parser.inc b/mysql-test/include/have_simple_parser.inc
index c85786bd524..5a4dc93ec81 100644
--- a/mysql-test/include/have_simple_parser.inc
+++ b/mysql-test/include/have_simple_parser.inc
@@ -2,10 +2,7 @@
# Check if server has support for loading udf's
# i.e it will support dlopen
#
---require r/have_dynamic_loading.require
-disable_query_log;
-show variables like 'have_dynamic_loading';
-enable_query_log;
+--source include/have_dynamic_loading.inc
#
# Check if the variable SIMPLE_PARSER is set
diff --git a/mysql-test/include/have_udf.inc b/mysql-test/include/have_udf.inc
index 3f7e260c5ba..7be57bbb7a9 100644
--- a/mysql-test/include/have_udf.inc
+++ b/mysql-test/include/have_udf.inc
@@ -2,10 +2,7 @@
# Check if server has support for loading udf's
# i.e it will support dlopen
#
---require r/have_dynamic_loading.require
-disable_query_log;
-show variables like 'have_dynamic_loading';
-enable_query_log;
+--source include/have_dynamic_loading.inc
#
# Check if the variable UDF_EXAMPLE_LIB is set
diff --git a/mysql-test/include/index_merge1.inc b/mysql-test/include/index_merge1.inc
index 5837df67a75..d137b0957c0 100644
--- a/mysql-test/include/index_merge1.inc
+++ b/mysql-test/include/index_merge1.inc
@@ -527,4 +527,30 @@ where exists (select 1 from t2, t3
drop table t0, t1, t2, t3;
+--echo #
+--echo # BUG#44810: index merge and order by with low sort_buffer_size
+--echo # crashes server!
+--echo #
+CREATE TABLE t1(a VARCHAR(128),b VARCHAR(128),KEY(A),KEY(B));
+INSERT INTO t1 VALUES (REPEAT('a',128),REPEAT('b',128));
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+INSERT INTO t1 SELECT * FROM t1;
+SET SESSION sort_buffer_size=1;
+EXPLAIN
+SELECT * FROM t1 FORCE INDEX(a,b) WHERE a LIKE 'a%' OR b LIKE 'b%'
+ ORDER BY a,b;
+# we don't actually care about the result : we're checking if it crashes
+--disable_result_log
+SELECT * FROM t1 FORCE INDEX(a,b) WHERE a LIKE 'a%' OR b LIKE 'b%'
+ ORDER BY a,b;
+--enable_result_log
+
+SET SESSION sort_buffer_size=DEFAULT;
+DROP TABLE t1;
+
+
--echo End of 5.0 tests
diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc
index 303f896cdfe..6dabe4864a9 100644
--- a/mysql-test/include/mix1.inc
+++ b/mysql-test/include/mix1.inc
@@ -1171,6 +1171,16 @@ CREATE TABLE t1 (f1 INTEGER PRIMARY KEY COMMENT 'My ID#', f2 INTEGER DEFAULT NUL
SHOW CREATE TABLE t1;
DROP TABLE t1;
+--echo #
+--echo # Bug #36995: valgrind error in remove_const during subquery executions
+--echo #
+
+create table t1 (a bit(1) not null,b int) engine=myisam;
+create table t2 (c int) engine=innodb;
+explain
+select b from t1 where a not in (select b from t1,t2 group by a) group by a;
+DROP TABLE t1,t2;
+
--echo End of 5.0 tests
# Fix for BUG#19243 "wrong LAST_INSERT_ID() after ON DUPLICATE KEY
@@ -1488,43 +1498,12 @@ INSERT INTO t1 VALUES
(4,1,3,'pk',NULL),(5,1,3,'c2',NULL),
(2,1,4,'c_extra',NULL),(3,1,4,'c_extra',NULL);
-EXPLAIN SELECT * FROM t1 WHERE tid = 1 AND vid = 3 ORDER BY idx DESC;
+EXPLAIN SELECT * FROM t1 FORCE INDEX (PRIMARY) WHERE tid = 1 AND vid = 3 ORDER BY idx DESC;
-SELECT * FROM t1 WHERE tid = 1 AND vid = 3 ORDER BY idx DESC;
+SELECT * FROM t1 FORCE INDEX (PRIMARY) WHERE tid = 1 AND vid = 3 ORDER BY idx DESC;
DROP TABLE t1;
-#
-# Bug#21704: Renaming column does not update FK definition.
-#
-
-#
-# --disable_warnings
-# DROP TABLE IF EXISTS t1;
-# DROP TABLE IF EXISTS t2;
-# --enable_warnings
-#
-# CREATE TABLE t1(id INT PRIMARY KEY)
-# ENGINE=innodb;
-#
-# CREATE TABLE t2(
-# t1_id INT PRIMARY KEY,
-# CONSTRAINT fk1 FOREIGN KEY (t1_id) REFERENCES t1(id))
-# ENGINE=innodb;
-#
-# --echo
-#
-# --disable_result_log
-# --error ER_ERROR_ON_RENAME
-# ALTER TABLE t1 CHANGE id id2 INT;
-# --enable_result_log
-#
-# --echo
-#
-# DROP TABLE t2;
-# DROP TABLE t1;
-#
-
--echo #
--echo # Bug #44290: explain crashes for subquery with distinct in
--echo # SQL_SELECT::test_quick_select
diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql
index 73287900f3c..134e448953a 100644
--- a/mysql-test/include/mtr_warnings.sql
+++ b/mysql-test/include/mtr_warnings.sql
@@ -132,16 +132,16 @@ INSERT INTO global_suppressions VALUES
("Error in Log_event::read_log_event\\\(\\\): 'Sanity check failed', data_len: 258, event_type: 49"),
- ("Statement is not safe to log in statement format"),
+ ("Statement may not be safe to log in statement format"),
/* test case for Bug#bug29807 copies a stray frm into database */
("InnoDB: Error: table `test`.`bug29807` does not exist in the InnoDB internal"),
("Cannot find or open table test\/bug29807 from"),
/* innodb foreign key tests that fail in ALTER or RENAME produce this */
- ("InnoDB: Error: in ALTER TABLE `test`.`t[12]`"),
+ ("InnoDB: Error: in ALTER TABLE `test`.`t[123]`"),
("InnoDB: Error: in RENAME TABLE table `test`.`t1`"),
- ("InnoDB: Error: table `test`.`t[12]` does not exist in the InnoDB internal"),
+ ("InnoDB: Error: table `test`.`t[123]` does not exist in the InnoDB internal"),
/* Test case for Bug#14233 produces the following warnings: */
("Stored routine 'test'.'bug14233_1': invalid value in column mysql.proc"),
@@ -162,6 +162,8 @@ INSERT INTO global_suppressions VALUES
("Slave: Unknown column 'c7' in 't15' Error_code: 1054"),
("Slave: Can't DROP 'c7'.* 1091"),
("Slave: Key column 'c6'.* 1072"),
+ ("Slave I/O: The slave I/O thread stops because a fatal error is encountered when it try to get the value of SERVER_ID variable from master."),
+ (".SELECT UNIX_TIMESTAMP... failed on master, do not trust column Seconds_Behind_Master of SHOW SLAVE STATUS"),
/* Test case for Bug#31590 in order_by.test produces the following error */
("Out of sort memory; increase server sort buffer size"),
@@ -171,6 +173,7 @@ INSERT INTO global_suppressions VALUES
this error message.
*/
("Can't find file: '.\\\\test\\\\\\?{8}.frm'"),
+ ("Slave: Unknown table 't1' Error_code: 1051"),
("THE_LAST_SUPPRESSION")||
diff --git a/mysql-test/include/no_valgrind_without_big.inc b/mysql-test/include/no_valgrind_without_big.inc
new file mode 100644
index 00000000000..743e974daec
--- /dev/null
+++ b/mysql-test/include/no_valgrind_without_big.inc
@@ -0,0 +1,12 @@
+# include/no_valgrind_without_big.inc
+#
+# If we are running with Valgrind ($VALGRIND_TEST <> 0) than the resource
+# consumption (storage space needed, runtime ...) will be extreme.
+# Therefore we require that the option "--big-test" is also set.
+#
+
+if (`SELECT $VALGRIND_TEST <> 0 AND '$BIG_TEST' = ''`)
+{
+ --skip Need "--big-test" when running with Valgrind
+}
+
diff --git a/mysql-test/include/partition_date_range.inc b/mysql-test/include/partition_date_range.inc
new file mode 100644
index 00000000000..5093cb3701d
--- /dev/null
+++ b/mysql-test/include/partition_date_range.inc
@@ -0,0 +1,69 @@
+# Created for verifying bug#20577.
+# expects TABLE t1 (... , a DATE, ...)
+
+--sorted_result
+SELECT * FROM t1 WHERE a < '1001-01-01';
+--sorted_result
+SELECT * FROM t1 WHERE a <= '1001-01-01';
+--sorted_result
+SELECT * FROM t1 WHERE a >= '1001-01-01';
+--sorted_result
+SELECT * FROM t1 WHERE a > '1001-01-01';
+--sorted_result
+SELECT * FROM t1 WHERE a = '1001-01-01';
+--sorted_result
+SELECT * FROM t1 WHERE a < '1001-00-00';
+--sorted_result
+SELECT * FROM t1 WHERE a <= '1001-00-00';
+--sorted_result
+SELECT * FROM t1 WHERE a >= '1001-00-00';
+--sorted_result
+SELECT * FROM t1 WHERE a > '1001-00-00';
+--sorted_result
+SELECT * FROM t1 WHERE a = '1001-00-00';
+--echo # Disabling warnings for the invalid date
+--disable_warnings
+--sorted_result
+SELECT * FROM t1 WHERE a < '1999-02-31';
+--sorted_result
+SELECT * FROM t1 WHERE a <= '1999-02-31';
+--sorted_result
+SELECT * FROM t1 WHERE a >= '1999-02-31';
+--sorted_result
+SELECT * FROM t1 WHERE a > '1999-02-31';
+--sorted_result
+SELECT * FROM t1 WHERE a = '1999-02-31';
+--enable_warnings
+--sorted_result
+SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00';
+--sorted_result
+SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1001-01-01';
+--sorted_result
+SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
+--sorted_result
+SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
+if ($explain_partitions)
+{
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-01-01';
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-01-01';
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-01-01';
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-01-01';
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-01-01';
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-00-00';
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-00-00';
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-00-00';
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-00-00';
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-00-00';
+--echo # Disabling warnings for the invalid date
+--disable_warnings
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1999-02-31';
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1999-02-31';
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1999-02-31';
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1999-02-31';
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1999-02-31';
+--enable_warnings
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00';
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1001-01-01';
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
+}
diff --git a/mysql-test/include/rpl_loaddata_charset.inc b/mysql-test/include/rpl_loaddata_charset.inc
new file mode 100644
index 00000000000..0e445446a38
--- /dev/null
+++ b/mysql-test/include/rpl_loaddata_charset.inc
@@ -0,0 +1,35 @@
+connection master;
+--disable_warnings
+DROP DATABASE IF EXISTS mysqltest;
+--enable_warnings
+
+CREATE DATABASE mysqltest CHARSET UTF8;
+USE mysqltest;
+CREATE TABLE t (cl varchar(100)) CHARSET UTF8;
+
+if (!$LOAD_LOCAL)
+{
+ LOAD DATA INFILE '../../std_data/loaddata_utf8.dat' INTO TABLE t
+ FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+}
+if ($LOAD_LOCAL)
+{
+ LOAD DATA LOCAL INFILE './std_data/loaddata_utf8.dat' INTO TABLE t
+ FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
+}
+
+save_master_pos;
+echo ----------content on master----------;
+SELECT hex(cl) FROM t;
+
+connection slave;
+sync_with_master;
+echo ----------content on slave----------;
+USE mysqltest;
+SELECT hex(cl) FROM t;
+
+connection master;
+DROP DATABASE mysqltest;
+save_master_pos;
+connection slave;
+sync_with_master;
diff --git a/mysql-test/include/wait_for_slave_io_error.inc b/mysql-test/include/wait_for_slave_io_error.inc
new file mode 100644
index 00000000000..094406e02b2
--- /dev/null
+++ b/mysql-test/include/wait_for_slave_io_error.inc
@@ -0,0 +1,23 @@
+# ==== Purpose ====
+#
+# Waits until the IO thread of the current connection has got an
+# error, or until a timeout is reached.
+#
+# ==== Usage ====
+#
+# source include/wait_for_slave_io_error.inc;
+#
+# Parameters to this macro are $slave_timeout and
+# $slave_keep_connection. See wait_for_slave_param.inc for
+# descriptions.
+
+let $old_slave_param_comparison= $slave_param_comparison;
+
+let $slave_param= Last_IO_Errno;
+let $slave_param_comparison= !=;
+let $slave_param_value= 0;
+let $slave_error_message= Failed while waiting for slave to produce an error in its sql thread;
+source include/wait_for_slave_param.inc;
+let $slave_error_message= ;
+
+let $slave_param_comparison= $old_slave_param_comparison;