summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/include/check-testcase.test2
-rw-r--r--mysql-test/r/delimiter_command_case_sensitivity.result2
-rw-r--r--mysql-test/r/type_date.result11
-rw-r--r--mysql-test/suite/plugins/r/server_audit.result9
-rw-r--r--mysql-test/suite/plugins/r/thread_pool_server_audit.result9
-rw-r--r--mysql-test/suite/plugins/t/server_audit.test5
-rw-r--r--mysql-test/suite/plugins/t/thread_pool_server_audit.test5
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_now_basic.result7
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_pct_basic.result6
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_buffer_pool_load_now_basic.result6
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_now_basic.test31
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_pct_basic.test12
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test46
-rw-r--r--mysql-test/t/delimiter_case_mdev_10728.sql3
-rw-r--r--mysql-test/t/delimiter_command_case_sensitivity.test2
-rw-r--r--mysql-test/t/type_date.test9
-rw-r--r--mysql-test/t/view.test1
18 files changed, 110 insertions, 57 deletions
diff --git a/mysql-test/include/check-testcase.test b/mysql-test/include/check-testcase.test
index 3b2c2a46590..a282201857e 100644
--- a/mysql-test/include/check-testcase.test
+++ b/mysql-test/include/check-testcase.test
@@ -82,6 +82,8 @@ call mtr.check_testcase();
let $datadir=`select @@datadir`;
list_files $datadir mysql_upgrade_info;
+list_files $datadir/test #sql*;
+list_files $datadir/mysql #sql*;
--enable_query_log
diff --git a/mysql-test/r/delimiter_command_case_sensitivity.result b/mysql-test/r/delimiter_command_case_sensitivity.result
new file mode 100644
index 00000000000..6ed281c757a
--- /dev/null
+++ b/mysql-test/r/delimiter_command_case_sensitivity.result
@@ -0,0 +1,2 @@
+1
+1
diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result
index 4b0e4a61c64..a9e81b8071d 100644
--- a/mysql-test/r/type_date.result
+++ b/mysql-test/r/type_date.result
@@ -843,5 +843,16 @@ Warning 1292 Incorrect datetime value: '1'
Warning 1292 Incorrect datetime value: '1'
DROP TABLE t1;
#
+# MDEV-14221 Assertion `0' failed in Item::field_type_for_temporal_comparison
+#
+CREATE TABLE t1 (d DATE);
+INSERT INTO t1 VALUES ('1985-05-13'),('1989-12-24');
+SELECT d, COUNT(*) FROM t1 GROUP BY d WITH ROLLUP HAVING CASE d WHEN '2017-05-25' THEN 0 ELSE 1 END;
+d COUNT(*)
+1985-05-13 1
+1989-12-24 1
+NULL 2
+DROP TABLE t1;
+#
# End of 10.1 tests
#
diff --git a/mysql-test/suite/plugins/r/server_audit.result b/mysql-test/suite/plugins/r/server_audit.result
index 45206c8bcb4..0d02ae47586 100644
--- a/mysql-test/suite/plugins/r/server_audit.result
+++ b/mysql-test/suite/plugins/r/server_audit.result
@@ -52,6 +52,7 @@ alter table t1 rename renamed_t1;
set global server_audit_events='connect,query';
select 1,
2,
+# comment
3;
1 2 3
1 2 3
@@ -170,7 +171,9 @@ id
2
CREATE USER u1 IDENTIFIED BY 'pwd-123';
GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321";
-SET PASSWORD FOR u1 = PASSWORD('pwd 098');
+SET PASSWORD
+# comment
+FOR u1 = PASSWORD('pwd 098');
SET PASSWORD FOR u1=<secret>;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '<secret>' at line 1
CREATE USER u3 IDENTIFIED BY '';
@@ -262,7 +265,7 @@ TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,index_stats,
TIME,HOSTNAME,root,localhost,ID,ID,RENAME,test,t1|test.renamed_t1,
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'alter table t1 rename renamed_t1',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_events=\'connect,query\'',0
-TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select 1, 2, 3',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select 1,\n2,\n# comment\n3',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'insert into t2 values (1), (2)',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t2',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t_doesnt_exist',ID
@@ -345,7 +348,7 @@ TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'/*! select 2*/',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'/*comment*/ select 2',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u1 IDENTIFIED BY *****',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'GRANT ALL ON sa_db TO u2 IDENTIFIED BY *****',0
-TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1 = PASSWORD(*****)',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD \n# comment\nFOR u1 = PASSWORD(*****)',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1=<secret>',ID
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u3 IDENTIFIED BY *****',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop user u1, u2, u3',0
diff --git a/mysql-test/suite/plugins/r/thread_pool_server_audit.result b/mysql-test/suite/plugins/r/thread_pool_server_audit.result
index 45206c8bcb4..cf09ccb3a51 100644
--- a/mysql-test/suite/plugins/r/thread_pool_server_audit.result
+++ b/mysql-test/suite/plugins/r/thread_pool_server_audit.result
@@ -52,6 +52,7 @@ alter table t1 rename renamed_t1;
set global server_audit_events='connect,query';
select 1,
2,
+# comment
3;
1 2 3
1 2 3
@@ -170,7 +171,9 @@ id
2
CREATE USER u1 IDENTIFIED BY 'pwd-123';
GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321";
-SET PASSWORD FOR u1 = PASSWORD('pwd 098');
+SET PASSWORD
+# comment
+FOR u1 = PASSWORD('pwd 098');
SET PASSWORD FOR u1=<secret>;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '<secret>' at line 1
CREATE USER u3 IDENTIFIED BY '';
@@ -262,7 +265,7 @@ TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,index_stats,
TIME,HOSTNAME,root,localhost,ID,ID,RENAME,test,t1|test.renamed_t1,
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'alter table t1 rename renamed_t1',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_events=\'connect,query\'',0
-TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select 1, 2, 3',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select 1,\n2,\n# comment\n3',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'insert into t2 values (1), (2)',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t2',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select * from t_doesnt_exist',ID
@@ -345,7 +348,7 @@ TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'/*! select 2*/',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'/*comment*/ select 2',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u1 IDENTIFIED BY *****',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'GRANT ALL ON sa_db TO u2 IDENTIFIED BY *****',0
-TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1 = PASSWORD(*****)',0
+TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD\n# comment\nFOR u1 = PASSWORD(*****)',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1=<secret>',ID
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u3 IDENTIFIED BY *****',0
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop user u1, u2, u3',0
diff --git a/mysql-test/suite/plugins/t/server_audit.test b/mysql-test/suite/plugins/t/server_audit.test
index 52428909c3b..9be0d5556f0 100644
--- a/mysql-test/suite/plugins/t/server_audit.test
+++ b/mysql-test/suite/plugins/t/server_audit.test
@@ -38,6 +38,7 @@ alter table t1 rename renamed_t1;
set global server_audit_events='connect,query';
select 1,
2,
+# comment
3;
insert into t2 values (1), (2);
select * from t2;
@@ -106,7 +107,9 @@ insert into t1 values (1), (2);
select * from t1;
CREATE USER u1 IDENTIFIED BY 'pwd-123';
GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321";
-SET PASSWORD FOR u1 = PASSWORD('pwd 098');
+SET PASSWORD
+# comment
+FOR u1 = PASSWORD('pwd 098');
--error 1064
SET PASSWORD FOR u1=<secret>;
CREATE USER u3 IDENTIFIED BY '';
diff --git a/mysql-test/suite/plugins/t/thread_pool_server_audit.test b/mysql-test/suite/plugins/t/thread_pool_server_audit.test
index 626d4136c47..724000c9789 100644
--- a/mysql-test/suite/plugins/t/thread_pool_server_audit.test
+++ b/mysql-test/suite/plugins/t/thread_pool_server_audit.test
@@ -38,6 +38,7 @@ alter table t1 rename renamed_t1;
set global server_audit_events='connect,query';
select 1,
2,
+# comment
3;
insert into t2 values (1), (2);
select * from t2;
@@ -106,7 +107,9 @@ insert into t1 values (1), (2);
select * from t1;
CREATE USER u1 IDENTIFIED BY 'pwd-123';
GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321";
-SET PASSWORD FOR u1 = PASSWORD('pwd 098');
+SET PASSWORD
+# comment
+FOR u1 = PASSWORD('pwd 098');
--error 1064
SET PASSWORD FOR u1=<secret>;
CREATE USER u3 IDENTIFIED BY '';
diff --git a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_now_basic.result b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_now_basic.result
index 9c3a37f892b..522d5731a6d 100644
--- a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_now_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_now_basic.result
@@ -1,7 +1,8 @@
-SET @orig = @@global.innodb_buffer_pool_dump_now;
-SELECT @orig;
-@orig
+SELECT @@global.innodb_buffer_pool_dump_now;
+@@global.innodb_buffer_pool_dump_now
0
+SELECT variable_value INTO @old_dump_status FROM information_schema.global_status
+WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status';
SET GLOBAL innodb_buffer_pool_dump_now = ON;
SELECT @@global.innodb_buffer_pool_dump_now;
@@global.innodb_buffer_pool_dump_now
diff --git a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_pct_basic.result b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_pct_basic.result
index 485136ccc4c..93a85ffbf43 100644
--- a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_pct_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_dump_pct_basic.result
@@ -1,7 +1,9 @@
SET @orig = @@global.innodb_buffer_pool_dump_pct;
-SELECT @@global.innodb_buffer_pool_dump_pct;
-@@global.innodb_buffer_pool_dump_pct
+SELECT @orig;
+@orig
25
+SET GLOBAL innodb_buffer_pool_dump_pct=3;
+# Do the dump
SET GLOBAL innodb_buffer_pool_dump_pct=20;
SELECT @@global.innodb_buffer_pool_dump_pct;
@@global.innodb_buffer_pool_dump_pct
diff --git a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_load_now_basic.result b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_load_now_basic.result
index 3185d1ca170..eebed4d0f4a 100644
--- a/mysql-test/suite/sys_vars/r/innodb_buffer_pool_load_now_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_buffer_pool_load_now_basic.result
@@ -1,8 +1,6 @@
-SET @orig = @@global.innodb_buffer_pool_load_now;
-SELECT @orig;
-@orig
+SELECT @@global.innodb_buffer_pool_load_now;
+@@global.innodb_buffer_pool_load_now
0
-SET GLOBAL innodb_buffer_pool_dump_now = ON;
SET GLOBAL innodb_buffer_pool_load_now = ON;
SELECT variable_value
FROM information_schema.global_status
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_now_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_now_basic.test
index 0bae347428e..8c5f8fa7bf0 100644
--- a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_now_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_now_basic.test
@@ -5,8 +5,31 @@
-- source include/have_innodb.inc
# Check the default value
-SET @orig = @@global.innodb_buffer_pool_dump_now;
-SELECT @orig;
+SELECT @@global.innodb_buffer_pool_dump_now;
+
+-- let $file = `SELECT CONCAT(@@datadir, @@global.innodb_buffer_pool_filename)`
+-- error 0,1
+-- remove_file $file
+
+SELECT variable_value INTO @old_dump_status FROM information_schema.global_status
+ WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status';
+
+# A previous test could have run buffer pool dump already;
+# in this case we want to make sure that the current time is different
+# from the timestamp in the status variable.
+# We should have had a smart wait condition here, like the commented one below,
+# let $wait_condition =
+# SELECT TRIM(SUBSTR('$old_status', -8)) != DATE_FORMAT(CURTIME(), '%k:%i:%s');
+# -- source include/wait_condition.inc
+
+# ... but we can't because of MDEV-9867, so there will be just sleep instead.
+# And it might be not enough to sleep one second, so we'll have to sleep two.
+
+if (`SELECT variable_value LIKE '%completed at%' FROM information_schema.global_status
+ WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status'`)
+{
+ -- sleep 2
+}
# Do the dump
SET GLOBAL innodb_buffer_pool_dump_now = ON;
@@ -15,11 +38,11 @@ SELECT @@global.innodb_buffer_pool_dump_now;
# Wait for the dump to complete
let $wait_condition =
- SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at '
+ SELECT variable_value != @old_dump_status
+ AND SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at '
FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status';
-- source include/wait_condition.inc
# Confirm that the dump file has been created
--- let $file = `SELECT CONCAT(@@datadir, @@global.innodb_buffer_pool_filename)`
-- file_exists $file
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_pct_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_pct_basic.test
index 99d3f79fb27..9b4edafb17e 100644
--- a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_pct_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_dump_pct_basic.test
@@ -11,9 +11,17 @@
# Save the default value
SET @orig = @@global.innodb_buffer_pool_dump_pct;
+SELECT @orig;
-# Check the default value
-SELECT @@global.innodb_buffer_pool_dump_pct;
+SET GLOBAL innodb_buffer_pool_dump_pct=3;
+
+--echo # Do the dump
+
+--disable_query_log
+--disable_result_log
+--source innodb_buffer_pool_dump_now_basic.test
+--enable_result_log
+--enable_query_log
# Set the valid value
SET GLOBAL innodb_buffer_pool_dump_pct=20;
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.opt b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.opt
new file mode 100644
index 00000000000..e462be3c368
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.opt
@@ -0,0 +1 @@
+--innodb-buffer-pool-load-at-startup=off
diff --git a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test
index a260dc2516b..15536d338e1 100644
--- a/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_buffer_pool_load_now_basic.test
@@ -5,44 +5,22 @@
-- source include/have_innodb.inc
# Check the default value
-SET @orig = @@global.innodb_buffer_pool_load_now;
-SELECT @orig;
+SELECT @@global.innodb_buffer_pool_load_now;
-let $old_status= `SELECT variable_value FROM information_schema.global_status
- WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status'`;
+# Make sure there is a dump file to load
-# A previous test could have run buffer pool dump already;
-# in this case we want to make sure that the current time is different
-# from the timestamp in the status variable.
-# We should have had a smart wait condition here, like the commented one below,
-# but we can't because of MDEV-9867, so there will be just sleep instead.
-# And it might be not enough to sleep one second, so we'll have to sleep two.
-# let $wait_condition =
-# SELECT TRIM(SUBSTR('$old_status', -8)) != DATE_FORMAT(CURTIME(), '%k:%i:%s');
-# -- source include/wait_condition.inc
-if (`SELECT count(*) > 0 FROM information_schema.global_status
- WHERE (LOWER(variable_name) = 'innodb_buffer_pool_dump_status' or
- LOWER(variable_name) = 'innodb_buffer_pool_load_status')
- and variable_value LIKE '%completed at%'`)
-{
- -- sleep 2
-}
-# Do the dump
-SET GLOBAL innodb_buffer_pool_dump_now = ON;
-
-# Wait for the dump to complete
-let $wait_condition =
- SELECT variable_value != '$old_status'
- AND SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at '
- FROM information_schema.global_status
- WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status';
---disable_warnings
--- source include/wait_condition.inc
---enable_warnings
-
-# Confirm the file is really created
-- let $file = `SELECT CONCAT(@@datadir, @@global.innodb_buffer_pool_filename)`
+-- error 0,1
-- file_exists $file
+if ($errno)
+{
+ # Dump file does not exist, get it created
+ --disable_query_log
+ --disable_result_log
+ --source innodb_buffer_pool_dump_now_basic.test
+ --enable_result_log
+ --enable_query_log
+}
let $old_load_status=
`SELECT variable_value FROM information_schema.global_status
diff --git a/mysql-test/t/delimiter_case_mdev_10728.sql b/mysql-test/t/delimiter_case_mdev_10728.sql
new file mode 100644
index 00000000000..72a1dcd9a9e
--- /dev/null
+++ b/mysql-test/t/delimiter_case_mdev_10728.sql
@@ -0,0 +1,3 @@
+DeLiMiTeR A;
+SELECT 1 A;
+delimiter ;
diff --git a/mysql-test/t/delimiter_command_case_sensitivity.test b/mysql-test/t/delimiter_command_case_sensitivity.test
new file mode 100644
index 00000000000..2b06a35c723
--- /dev/null
+++ b/mysql-test/t/delimiter_command_case_sensitivity.test
@@ -0,0 +1,2 @@
+# MDEV-10728
+--exec $MYSQL --default-character-set=binary < "t/delimiter_case_mdev_10728.sql"
diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test
index 11924f696db..b7fdf7b93b7 100644
--- a/mysql-test/t/type_date.test
+++ b/mysql-test/t/type_date.test
@@ -576,6 +576,15 @@ SELECT DATE(a), DATE(b), DATE(c) FROM t1;
SELECT DATE(COALESCE(a)), DATE(COALESCE(b)), DATE(COALESCE(c)) FROM t1;
DROP TABLE t1;
+--echo #
+--echo # MDEV-14221 Assertion `0' failed in Item::field_type_for_temporal_comparison
+--echo #
+
+CREATE TABLE t1 (d DATE);
+INSERT INTO t1 VALUES ('1985-05-13'),('1989-12-24');
+SELECT d, COUNT(*) FROM t1 GROUP BY d WITH ROLLUP HAVING CASE d WHEN '2017-05-25' THEN 0 ELSE 1 END;
+DROP TABLE t1;
+
--echo #
--echo # End of 10.1 tests
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index a9764bf0668..9e8e483929f 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -1,3 +1,4 @@
+--source include/have_partition.inc
# Save the initial number of concurrent sessions.
--source include/count_sessions.inc