summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/func_misc.test9
-rw-r--r--mysql-test/t/grant2.test123
-rw-r--r--mysql-test/t/grant3.test16
-rw-r--r--mysql-test/t/greedy_optimizer.test73
-rw-r--r--mysql-test/t/having.test11
-rw-r--r--mysql-test/t/lock_tables_lost_commit.test27
-rw-r--r--mysql-test/t/merge.test13
-rw-r--r--mysql-test/t/mysqldump.test223
-rw-r--r--mysql-test/t/not_embedded_server.test28
-rw-r--r--mysql-test/t/openssl_1.test30
-rw-r--r--mysql-test/t/outfile.test16
-rw-r--r--mysql-test/t/query_cache.test27
-rw-r--r--mysql-test/t/query_cache_notembedded.test2
-rw-r--r--mysql-test/t/subselect3.test29
-rw-r--r--mysql-test/t/type_timestamp.test20
-rw-r--r--mysql-test/t/variables.test92
16 files changed, 523 insertions, 216 deletions
diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test
index 93fe94ec94f..c8075c42fc7 100644
--- a/mysql-test/t/func_misc.test
+++ b/mysql-test/t/func_misc.test
@@ -436,5 +436,14 @@ select @my_uuid_date - @my_uuid_synthetic;
set @@session.time_zone=@save_tz;
+
+#
+# Bug#42014: Crash, name_const with collate
+#
+CREATE TABLE t1 (a DATE);
+SELECT * FROM t1 WHERE a = NAME_CONST('reportDate',
+ _binary'2009-01-09' COLLATE 'binary');
+DROP TABLE t1;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test
index e2d92ee58d4..8f83c365170 100644
--- a/mysql-test/t/grant2.test
+++ b/mysql-test/t/grant2.test
@@ -1,6 +1,10 @@
# Grant tests not performed with embedded server
-- source include/not_embedded.inc
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+
SET NAMES binary;
#
@@ -27,7 +31,7 @@ create user mysqltest_2@localhost;
connect (user_a,localhost,mysqltest_1,,);
connection user_a;
grant select on `my\_1`.* to mysqltest_2@localhost;
---error 1132
+--error ER_PASSWORD_NOT_ALLOWED
grant select on `my\_1`.* to mysqltest_2@localhost identified by 'pass';
disconnect user_a;
connection default;
@@ -61,7 +65,7 @@ connect (user1,localhost,mysqltest_1,,);
connection user1;
select current_user();
grant all privileges on `my\_1`.* to mysqltest_2@localhost with grant option;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
grant all privileges on `my_%`.* to mysqltest_3@localhost with grant option;
#
@@ -72,7 +76,7 @@ select @@sql_mode;
#
# GRANT without IDENTIFIED BY does not create new users
#
---error 1133
+--error ER_PASSWORD_NO_MATCH
grant select on `my\_1`.* to mysqltest_4@localhost with grant option;
grant select on `my\_1`.* to mysqltest_4@localhost identified by 'mypass'
with grant option;
@@ -80,7 +84,7 @@ disconnect user1;
connection default;
show grants for mysqltest_1@localhost;
show grants for mysqltest_2@localhost;
---error 1141
+--error ER_NONEXISTING_GRANT
show grants for mysqltest_3@localhost;
delete from mysql.user where user like 'mysqltest\_%';
delete from mysql.db where user like 'mysqltest\_%';
@@ -95,7 +99,7 @@ connect (user2,localhost,mysqltest_1,,);
connection user2;
select current_user();
show databases;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
grant all privileges on `mysqltest_1`.* to mysqltest_1@localhost with grant option;
disconnect user2;
connection default;
@@ -106,8 +110,8 @@ drop database mysqltest_1;
flush privileges;
#
-# Bug #6173: One can circumvent missing UPDATE privilege if he has SELECT
-# and INSERT privilege for table with primary key
+# Bug#6173 One can circumvent missing UPDATE privilege if he has SELECT and
+# INSERT privilege for table with primary key
#
create database mysqltest;
grant INSERT, SELECT on mysqltest.* to mysqltest_1@localhost;
@@ -119,10 +123,10 @@ connect (mrbad, localhost, mysqltest_1,,mysqltest);
connection mrbad;
show grants for current_user();
insert into t1 values (1, 'I can''t change it!');
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
update t1 set data='I can change it!' where id = 1;
# This should not be allowed since it too require UPDATE privilege.
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
insert into t1 values (1, 'XXX') on duplicate key update data= 'I can change it!';
select * from t1;
disconnect mrbad;
@@ -138,9 +142,9 @@ create table t1 (a int, b int);
grant select (a) on t1 to mysqltest_1@localhost with grant option;
connect (mrugly, localhost, mysqltest_1,,mysqltest);
connection mrugly;
---error 1143
+--error ER_COLUMNACCESS_DENIED_ERROR
grant select (a,b) on t1 to mysqltest_2@localhost;
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
grant select on t1 to mysqltest_3@localhost;
disconnect mrugly;
@@ -157,7 +161,7 @@ use test;
#
-# Bug #15775: "drop user" command does not refresh acl_check_hosts
+# Bug#15775 "drop user" command does not refresh acl_check_hosts
#
# Create some test users
@@ -188,15 +192,15 @@ disconnect con9;
connection default;
#
-# Bug# 16180 - Setting SQL_LOG_OFF without SUPER privilege is silently ignored
+# Bug#16180 Setting SQL_LOG_OFF without SUPER privilege is silently ignored
#
create database mysqltest_1;
grant select, insert, update on `mysqltest\_1`.* to mysqltest_1@localhost;
connect (con10,localhost,mysqltest_1,,);
connection con10;
---error 1227
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
set sql_log_off = 1;
---error 1227
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
set sql_log_bin = 0;
disconnect con10;
connection default;
@@ -217,7 +221,7 @@ create table t2(c1 int, c2 int);
#
# Three forms of CREATE USER
create user 'mysqltest_1';
---error 1396
+--error ER_CANNOT_USER
create user 'mysqltest_1';
create user 'mysqltest_2' identified by 'Mysqltest-2';
create user 'mysqltest_3' identified by password 'fffffffffffffffffffffffffffffffffffffffff';
@@ -238,7 +242,7 @@ select host,user,password from mysql.user where user like 'mysqltest_%' order by
select host,db,user from mysql.db where user like 'mysqltest_%' order by host,db,user;
select host,db,user,table_name from mysql.tables_priv where user like 'mysqltest_%' order by host,db,user,table_name;
select host,db,user,table_name,column_name from mysql.columns_priv where user like 'mysqltest_%' order by host,db,user,table_name,column_name;
---error 1141
+--error ER_NONEXISTING_GRANT
show grants for 'mysqltest_1';
#
# Rename
@@ -249,7 +253,7 @@ select host,db,user,table_name from mysql.tables_priv where user like 'mysqltest
select host,db,user,table_name,column_name from mysql.columns_priv where user like 'mysqltest_%' order by host,db,user,table_name,column_name;
show grants for 'mysqltest_1';
drop user 'mysqltest_1', 'mysqltest_3';
---error 1396
+--error ER_CANNOT_USER
drop user 'mysqltest_1';
#
# Cleanup
@@ -258,9 +262,9 @@ drop table t1, t2;
# Add a stray record
insert into mysql.db set user='mysqltest_1', db='%', host='%';
flush privileges;
---error 1141
+--error ER_NONEXISTING_GRANT
show grants for 'mysqltest_1';
---error 1269
+--error ER_REVOKE_GRANTS
revoke all privileges, grant option from 'mysqltest_1';
drop user 'mysqltest_1';
select host,db,user from mysql.db where user = 'mysqltest_1' order by host,db,user;
@@ -268,7 +272,7 @@ select host,db,user from mysql.db where user = 'mysqltest_1' order by host,db,us
# Add a stray record
insert into mysql.tables_priv set host='%', db='test', user='mysqltest_1', table_name='t1';
flush privileges;
---error 1141
+--error ER_NONEXISTING_GRANT
show grants for 'mysqltest_1';
drop user 'mysqltest_1';
select host,db,user,table_name from mysql.tables_priv where user = 'mysqltest_1' order by host,db,user,table_name;
@@ -276,7 +280,7 @@ select host,db,user,table_name from mysql.tables_priv where user = 'mysqltest_1'
# Add a stray record
insert into mysql.columns_priv set host='%', db='test', user='mysqltest_1', table_name='t1', column_name='c1';
flush privileges;
---error 1141
+--error ER_NONEXISTING_GRANT
show grants for 'mysqltest_1';
drop user 'mysqltest_1';
select host,db,user,table_name,column_name from mysql.columns_priv where user = 'mysqltest_1' order by host,db,user,table_name,column_name;
@@ -286,23 +290,23 @@ create user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3';
drop user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3';
create user 'mysqltest_1', 'mysqltest_2' identified by 'Mysqltest-2', 'mysqltest_3' identified by password 'fffffffffffffffffffffffffffffffffffffffff';
rename user 'mysqltest_1' to 'mysqltest_1a', 'mysqltest_2' TO 'mysqltest_2a', 'mysqltest_3' TO 'mysqltest_3a';
---error 1396
+--error ER_CANNOT_USER
drop user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3';
drop user 'mysqltest_1a', 'mysqltest_2a', 'mysqltest_3a';
#
# Let one of multiple users fail
create user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3';
---error 1396
+--error ER_CANNOT_USER
create user 'mysqltest_1a', 'mysqltest_2', 'mysqltest_3a';
---error 1396
+--error ER_CANNOT_USER
rename user 'mysqltest_1a' to 'mysqltest_1b', 'mysqltest_2a' TO 'mysqltest_2b', 'mysqltest_3a' TO 'mysqltest_3b';
drop user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3';
---error 1396
+--error ER_CANNOT_USER
drop user 'mysqltest_1b', 'mysqltest_2b', 'mysqltest_3b';
#
# Obsolete syntax has been dropped
create user 'mysqltest_2' identified by 'Mysqltest-2';
---error 1064
+--error ER_PARSE_ERROR
drop user 'mysqltest_2' identified by 'Mysqltest-2';
drop user 'mysqltest_2';
#
@@ -312,7 +316,7 @@ show grants for '%@b'@'b';
grant select on mysql.* to '%@b'@'b';
show grants for '%@b'@'b';
rename user '%@b'@'b' to '%@a'@'a';
---error 1141
+--error ER_NONEXISTING_GRANT
show grants for '%@b'@'b';
show grants for '%@a'@'a';
drop user '%@a'@'a';
@@ -323,7 +327,7 @@ create user mysqltest_2@localhost;
grant create user on *.* to mysqltest_2@localhost;
connect (user3,localhost,mysqltest_2,,);
connection user3;
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password;
create user mysqltest_A@'%';
rename user mysqltest_A@'%' to mysqltest_B@'%';
@@ -338,7 +342,7 @@ grant INSERT,DELETE,UPDATE on mysql.* to mysqltest_3@localhost;
connect (user4,localhost,mysqltest_3,,);
connection user4;
show grants;
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password;
insert into mysql.user set host='%', user='mysqltest_B';
create user mysqltest_A@'%';
@@ -349,7 +353,7 @@ disconnect user4;
connection default;
drop user mysqltest_3@localhost;
#
-# Bug #3309: Test IP addresses with netmask
+# Bug#3309 Test IP addresses with netmask
set @@sql_mode='';
create database mysqltest_1;
create table mysqltest_1.t1 (i int);
@@ -367,7 +371,8 @@ flush privileges;
drop table mysqltest_1.t1;
#
-# Bug #12302: 'SET PASSWORD = ...' didn't work if connecting hostname !=
+# Bug#12302 Hostname resolution preventing password changes
+# 'SET PASSWORD = ...' didn't work if connecting hostname !=
# hostname the current user is authenticated as. Note that a test for this
# was also added to the test above.
#
@@ -400,7 +405,7 @@ drop database mysqltest_1;
# But anonymous users can't change their password
connect (n5,localhost,test,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connection n5;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
set password = password("changed");
disconnect n5;
connection default;
@@ -408,7 +413,7 @@ connection default;
--source include/delete_anonymous_users.inc
-# Bug #12423 "Deadlock when doing FLUSH PRIVILEGES and GRANT in
+# Bug#12423 "Deadlock when doing FLUSH PRIVILEGES and GRANT in
# multi-threaded environment". We should be able to execute FLUSH
# PRIVILEGES and SET PASSWORD simultaneously with other account
# management commands (such as GRANT and REVOKE) without causing
@@ -474,12 +479,13 @@ connect (con1,localhost,mysqltest_1,password,TESTDB);
# The user mysqltest_1 should only be allowed access to
# database TESTDB, not TEStdb
-# On system with "lowercase names" we get error "1007: Can't create db..."
---error 1044, 1007
+# On system with "lowercase names" we get error "ER_DB_CREATE_EXISTS: Can't create db..."
+--error ER_DBACCESS_DENIED_ERROR, ER_DB_CREATE_EXISTS
create database TEStdb;
# Clean-up
connection default;
+disconnect con1;
delete from mysql.user;
delete from mysql.db where host='%' and user='mysqltest_1' and db='TESTDB';
insert into mysql.user select * from t1;
@@ -488,35 +494,34 @@ drop database TESTDB;
flush privileges;
#
-# BUG#13310 incorrect user parsing by SP
+# Bug#13310 incorrect user parsing by SP
#
-grant all privileges on test.* to `a@`@localhost;
-grant execute on * to `a@`@localhost;
+GRANT ALL PRIVILEGES ON test.* TO `a@`@localhost;
+GRANT EXECUTE ON * TO `a@`@localhost;
connect (bug13310,localhost,'a@',,test);
connection bug13310;
-create table t2 (s1 int);
-insert into t2 values (1);
+CREATE TABLE t2 (s1 INT);
+INSERT INTO t2 VALUES (1);
--disable_warnings
-drop function if exists f2;
+DROP FUNCTION IF EXISTS f2;
--enable_warnings
delimiter //;
-create function f2 () returns int begin declare v int; select s1 from t2
-into v; return v; end//
+CREATE FUNCTION f2 () RETURNS INT
+BEGIN DECLARE v INT; SELECT s1 FROM t2 INTO v; RETURN v; END//
delimiter ;//
-select f2();
+SELECT f2();
-drop function f2;
-drop table t2;
+DROP FUNCTION f2;
+DROP TABLE t2;
disconnect bug13310;
-
connection default;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM `a@`@localhost;
-drop user `a@`@localhost;
+DROP USER `a@`@localhost;
#
-# Bug#25578 "CREATE TABLE LIKE does not require any privileges on source table"
+# Bug#25578 CREATE TABLE LIKE does not require any privileges on source table
#
--disable_warnings
drop database if exists mysqltest_1;
@@ -535,7 +540,7 @@ create table t1 (i int);
connect (user1,localhost,mysqltest_u1,,mysqltest_1);
connection user1;
# As expected error is emitted
---error ER_TABLEACCESS_DENIED_ERROR
+--error ER_TABLEACCESS_DENIED_ERROR
show create table mysqltest_2.t1;
# This should emit error as well
--error ER_TABLEACCESS_DENIED_ERROR
@@ -550,14 +555,16 @@ create table t1 like mysqltest_2.t1;
# Clean-up
connection default;
+disconnect user1;
use test;
drop database mysqltest_1;
drop database mysqltest_2;
drop user mysqltest_u1@localhost;
+
#
# Bug#18660 Can't grant any privileges on single table in database
-# with underscore char
+# with underscore char
#
grant all on `mysqltest\_%`.* to mysqltest_1@localhost with grant option;
grant usage on *.* to mysqltest_2@localhost;
@@ -571,7 +578,7 @@ grant create on `mysqltest\_1`.* to mysqltest_2@localhost;
grant select on mysqltest_1.t1 to mysqltest_2@localhost;
connect (con3,localhost,mysqltest_2,,);
connection con3;
---error 1044
+--error ER_DBACCESS_DENIED_ERROR
create database mysqltest_3;
use mysqltest_1;
create table t2(f1 int);
@@ -579,6 +586,9 @@ select * from t1;
connection default;
drop database mysqltest_1;
+connection default;
+disconnect con3;
+disconnect con18600_1;
revoke all privileges, grant option from mysqltest_1@localhost;
revoke all privileges, grant option from mysqltest_2@localhost;
drop user mysqltest_1@localhost;
@@ -586,7 +596,7 @@ drop user mysqltest_2@localhost;
#
-# Bug #30468: column level privileges not respected when joining tables
+# Bug#30468 column level privileges not respected when joining tables
#
CREATE DATABASE db1;
@@ -597,7 +607,7 @@ INSERT INTO t1 VALUES (1,1),(2,2);
CREATE TABLE t2 (b INT, c INT);
INSERT INTO t2 VALUES (1,100),(2,200);
-GRANT SELECT ON t1 TO mysqltest1@localhost;
+GRANT SELECT ON t1 TO mysqltest1@localhost;
GRANT SELECT (b) ON t2 TO mysqltest1@localhost;
connect (conn1,localhost,mysqltest1,,);
@@ -612,6 +622,7 @@ SELECT * FROM t1 JOIN t2 USING (b);
connection default;
disconnect conn1;
+USE test;
DROP TABLE db1.t1, db1.t2;
DROP USER mysqltest1@localhost;
DROP DATABASE db1;
@@ -619,3 +630,5 @@ DROP DATABASE db1;
--echo End of 5.0 tests
+# Wait till we reached the initial number of concurrent sessions
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/grant3.test b/mysql-test/t/grant3.test
index 8eceb851c29..9a635048774 100644
--- a/mysql-test/t/grant3.test
+++ b/mysql-test/t/grant3.test
@@ -1,6 +1,10 @@
-# Can't run with embedded server
+# Can't run with embedded server because we use GRANT
-- source include/not_embedded.inc
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+
# Test of GRANT commands
SET NAMES binary;
@@ -23,10 +27,11 @@ grant create user on *.* to mysqltest_1@localhost;
grant select on `my\_1`.* to mysqltest_1@localhost with grant option;
connect (user_a,localhost,mysqltest_1,,);
connection user_a;
---error 1410
+--error ER_CANT_CREATE_USER_WITH_GRANT
grant select on `my\_1`.* to mysqltest_2@localhost;
create user mysqltest_2@localhost;
disconnect user_a;
+disconnect master;
connection default;
delete from mysql.user where user like 'mysqltest\_%';
@@ -36,7 +41,7 @@ delete from mysql.columns_priv where user like 'mysqltest\_%';
flush privileges;
#
-# Bug: #19828 Case sensitivity in Grant/Revoke
+# Bug#19828 Case sensitivity in Grant/Revoke
#
grant select on test.* to CUser@localhost;
@@ -137,7 +142,7 @@ DROP USER CUser2@LOCALHOST;
#
-# Bug#31194: Privilege ordering does not order properly for wildcard values
+# Bug#31194 Privilege ordering does not order properly for wildcard values
#
CREATE DATABASE mysqltest_1;
@@ -160,3 +165,6 @@ DROP DATABASE mysqltest_1;
--echo End of 5.0 tests
+
+# Wait till we reached the initial number of concurrent sessions
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/greedy_optimizer.test b/mysql-test/t/greedy_optimizer.test
index b73f70c6a3e..5131c97f122 100644
--- a/mysql-test/t/greedy_optimizer.test
+++ b/mysql-test/t/greedy_optimizer.test
@@ -311,3 +311,76 @@ explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and
show status like 'Last_query_cost';
drop table t1,t2,t3,t4,t5,t6,t7;
+
+
+#
+# Bug # 38795: Automatic search depth and nested join's results in server
+# crash
+#
+
+CREATE TABLE t1 (a int, b int, d int, i int); INSERT INTO t1 VALUES (1,1,1,1);
+CREATE TABLE t2 (b int, c int, j int); INSERT INTO t2 VALUES (1,1,1);
+CREATE TABLE t2_1 (j int); INSERT INTO t2_1 VALUES (1);
+CREATE TABLE t3 (c int, f int); INSERT INTO t3 VALUES (1,1);
+CREATE TABLE t3_1 (f int); INSERT INTO t3_1 VALUES (1);
+CREATE TABLE t4 (d int, e int, k int); INSERT INTO t4 VALUES (1,1,1);
+CREATE TABLE t4_1 (k int); INSERT INTO t4_1 VALUES (1);
+CREATE TABLE t5 (g int, d int, h int, l int); INSERT INTO t5 VALUES (1,1,1,1);
+CREATE TABLE t5_1 (l int); INSERT INTO t5_1 VALUES (1);
+
+SET optimizer_search_depth = 3;
+
+SELECT 1
+FROM t1
+LEFT JOIN (
+ t2 JOIN t3 ON t3.c = t2.c
+) ON t2.b = t1.b
+LEFT JOIN (
+ t4 JOIN t5 ON t5.d = t4.d
+) ON t4.d = t1.d
+;
+
+SELECT 1
+FROM t1
+LEFT JOIN (
+ t2 LEFT JOIN (t3 JOIN t3_1 ON t3.f = t3_1.f) ON t3.c = t2.c
+) ON t2.b = t1.b
+LEFT JOIN (
+ t4 JOIN t5 ON t5.d = t4.d
+) ON t4.d = t1.d
+;
+
+SELECT 1
+FROM t1
+LEFT JOIN (
+ (t2 JOIN t2_1 ON t2.j = t2_1.j) JOIN t3 ON t3.c = t2.c
+) ON t2.b = t1.b
+LEFT JOIN (
+ t4 JOIN t5 ON t5.d = t4.d
+) ON t4.d = t1.d
+;
+
+SELECT 1
+FROM t1
+LEFT JOIN (
+ t2 JOIN t3 ON t3.c = t2.c
+) ON t2.b = t1.b
+LEFT JOIN (
+ (t4 JOIN t4_1 ON t4.k = t4_1.k) LEFT JOIN t5 ON t5.d = t4.d
+) ON t4.d = t1.d
+;
+
+SELECT 1
+FROM t1
+LEFT JOIN (
+ t2 JOIN t3 ON t3.c = t2.c
+) ON t2.b = t1.b
+LEFT JOIN (
+ t4 LEFT JOIN (t5 JOIN t5_1 ON t5.l = t5_1.l) ON t5.d = t4.d
+) ON t4.d = t1.d
+;
+
+SET optimizer_search_depth = DEFAULT;
+DROP TABLE t1,t2,t2_1,t3,t3_1,t4,t4_1,t5,t5_1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test
index 827b83f11a0..adabbb711d4 100644
--- a/mysql-test/t/having.test
+++ b/mysql-test/t/having.test
@@ -432,3 +432,14 @@ select f1 from t1 having max(f1)=f1;
select f1 from t1 group by f1 having max(f1)=f1;
set session sql_mode='';
drop table t1;
+
+
+#
+# Bug #38637: COUNT DISTINCT prevents NULL testing in HAVING clause
+#
+CREATE TABLE t1 ( a INT, b INT);
+INSERT INTO t1 VALUES (1, 1), (2,2), (3, NULL);
+SELECT b, COUNT(DISTINCT a) FROM t1 GROUP BY b HAVING b is NULL;
+DROP TABLE t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/lock_tables_lost_commit.test b/mysql-test/t/lock_tables_lost_commit.test
index d31b4b7dfb5..754c8f3c378 100644
--- a/mysql-test/t/lock_tables_lost_commit.test
+++ b/mysql-test/t/lock_tables_lost_commit.test
@@ -1,24 +1,33 @@
-# This is a test for bug 578
+# Test for Bug#578 mysqlimport -l silently fails when binlog-ignore-db is set
--- source include/have_innodb.inc
+--source include/have_innodb.inc
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
connection con1;
--disable_warnings
-drop table if exists t1;
-create table t1(a int) engine=innodb;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1(a INT) ENGINE=innodb;
--enable_warnings
-lock tables t1 write;
-insert into t1 values(10);
+LOCK TABLES t1 WRITE;
+INSERT INTO t1 VALUES(10);
disconnect con1;
connection con2;
# The bug was that, because of the LOCK TABLES, the handler "forgot" to commit,
# and the other commit when we write to the binlog was not done because of
-# binlog-ignore-db
-select * from t1;
-drop table t1;
+# binlog-ignore-db
+SELECT * FROM t1;
+DROP TABLE t1;
+
+connection default;
+disconnect con2;
# End of 4.1 tests
+
+# Wait till we reached the initial number of concurrent sessions
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index e5cc4d703f2..341296dbe8e 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -556,4 +556,17 @@ ALTER TABLE m1 UNION=();
SHOW CREATE TABLE m1;
DROP TABLE t1, m1;
+#
+# BUG#32047 - 'Spurious' errors while opening MERGE tables
+#
+CREATE TABLE t1(a INT);
+CREATE TABLE t2(a VARCHAR(10));
+CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(t1, t2);
+CREATE TABLE m2(a INT) ENGINE=MERGE UNION=(t1);
+SELECT * FROM t1;
+--error ER_WRONG_MRG_TABLE
+SELECT * FROM m1;
+SELECT * FROM m2;
+DROP TABLE t1, t2, m1, m2;
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index 2f11685385f..5cd9c17e2ac 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -5,10 +5,13 @@
# Binlog is required
--source include/have_log_bin.inc
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
---echo Bug#37938 - Test "mysqldump" lacks various insert statements
---echo Turn off concurrent inserts to avoid random errors
---echo NOTE: We reset the variable back to saved value at the end of test
+
+--echo # Bug#37938 Test "mysqldump" lacks various insert statements
+--echo # Turn off concurrent inserts to avoid random errors
+--echo # NOTE: We reset the variable back to saved value at the end of test
SET @OLD_CONCURRENT_INSERT = @@GLOBAL.CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT = 0;
@@ -23,13 +26,13 @@ drop view if exists v1, v2, v3;
# XML output
-CREATE TABLE t1(a int);
+CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (1), (2);
--exec $MYSQL_DUMP --skip-create --skip-comments -X test t1
DROP TABLE t1;
--echo #
---echo # Bug #2005
+--echo # Bug#2005 Long decimal comparison bug.
--echo #
CREATE TABLE t1 (a decimal(64, 20));
@@ -39,7 +42,7 @@ INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"),
DROP TABLE t1;
--echo #
---echo # Bug #2055
+--echo # Bug#2055 mysqldump should replace "-inf" numeric field values with "NULL"
--echo #
CREATE TABLE t1 (a double);
@@ -51,7 +54,7 @@ INSERT INTO t1 VALUES ('-9e999999');
DROP TABLE t1;
--echo #
---echo # Bug #3361 mysqldump quotes DECIMAL values inconsistently
+--echo # Bug#3361 mysqldump quotes DECIMAL values inconsistently
--echo #
CREATE TABLE t1 (a DECIMAL(10,5), b FLOAT);
@@ -65,7 +68,7 @@ INSERT INTO t1 VALUES ("1.2345", 2.3456);
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ANSI_QUOTES';
INSERT INTO t1 VALUES (1.2345, 2.3456);
INSERT INTO t1 VALUES ('1.2345', 2.3456);
---error 1054
+--error ER_BAD_FIELD_ERROR
INSERT INTO t1 VALUES ("1.2345", 2.3456);
SET SQL_MODE=@OLD_SQL_MODE;
@@ -82,7 +85,7 @@ INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES");
DROP TABLE t1;
--echo #
---echo # Bug #1707
+--echo # Bug#1707 mysqldump -X does't quote field and table names
--echo #
CREATE TABLE t1 (`a"b"` char(2));
@@ -91,8 +94,8 @@ INSERT INTO t1 VALUES ("1\""), ("\"2");
DROP TABLE t1;
--echo #
---echo # Bug #1994
---echo # Bug #4261
+--echo # Bug#1994 mysqldump does not correctly dump UCS2 data
+--echo # Bug#4261 mysqldump 10.7 (mysql 4.1.2) --skip-extended-insert drops NULL from inserts
--echo #
CREATE TABLE t1 (a VARCHAR(255)) DEFAULT CHARSET koi8r;
@@ -101,7 +104,7 @@ INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL);
DROP TABLE t1;
--echo #
---echo # Bug #2634
+--echo # Bug#2634 mysqldump in --compatible=mysql4
--echo #
CREATE TABLE t1 (a int) ENGINE=MYISAM;
@@ -111,7 +114,7 @@ INSERT INTO t1 VALUES (1), (2);
DROP TABLE t1;
--echo #
---echo # Bug #2592 'mysqldump doesn't quote "tricky" names correctly'
+--echo # Bug#2592 mysqldump doesn't quote "tricky" names correctly
--echo #
create table ```a` (i int);
@@ -119,7 +122,7 @@ create table ```a` (i int);
drop table ```a`;
--echo #
---echo # Bug #2591 "mysqldump quotes names inconsistently"
+--echo # Bug#2591 mysqldump quotes names inconsistently
--echo #
create table t1(a int);
@@ -132,7 +135,7 @@ set global sql_mode='';
drop table t1;
--echo #
---echo # Bug #2705 'mysqldump --tab extra output'
+--echo # Bug#2705 mysqldump --tab extra output
--echo #
create table t1(a int);
@@ -148,7 +151,7 @@ insert into t1 values (1),(2),(3);
drop table t1;
--echo #
---echo # Bug #6101: create database problem
+--echo # Bug#6101 create database problem
--echo #
--exec $MYSQL_DUMP --skip-comments --databases test
@@ -158,7 +161,7 @@ create database mysqldump_test_db character set latin2 collate latin2_bin;
drop database mysqldump_test_db;
--echo #
---echo # Bug #7020
+--echo # Bug#7020 mysqldump --compatible=mysql40 should set --skip-set-charset --default-char...
--echo # Check that we don't dump in UTF8 in compatible mode by default,
--echo # but use the default compiled values, or the values given in
--echo # --default-character-set=xxx. However, we should dump in UTF8
@@ -169,8 +172,8 @@ INSERT INTO t1 VALUES (_latin1 'ÄÖÜß');
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments test t1
--echo #
---echo # Bug#8063: make test mysqldump [ fail ]
---echo # We cannot tes this command because its output depends
+--echo # Bug#8063 make test mysqldump [ fail ]
+--echo # We cannot test this command because its output depends
--echo # on --default-character-set incompiled into "mysqldump" program.
--echo # If the future we can move this command into a separate test with
--echo # checking that "mysqldump" is compiled with "latin1"
@@ -183,7 +186,7 @@ INSERT INTO t1 VALUES (_latin1 'ÄÖÜß');
DROP TABLE t1;
--echo #
---echo # WL #2319: Exclude Tables from dump
+--echo # WL#2319 Exclude Tables from dump
--echo #
CREATE TABLE t1 (a int);
@@ -195,7 +198,7 @@ DROP TABLE t1;
DROP TABLE t2;
--echo #
---echo # Bug #8830
+--echo # Bug#8830 mysqldump --skip-extended-insert causes --hex-blob to dump wrong values
--echo #
CREATE TABLE t1 (`b` blob);
@@ -207,7 +210,7 @@ DROP TABLE t1;
--echo # Test for --insert-ignore
--echo #
-CREATE TABLE t1 (a int);
+CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
INSERT INTO t1 VALUES (4),(5),(6);
--exec $MYSQL_DUMP --skip-comments --insert-ignore test t1
@@ -215,9 +218,9 @@ INSERT INTO t1 VALUES (4),(5),(6);
DROP TABLE t1;
--echo #
---echo # Bug #10286: mysqldump -c crashes on table that has many fields with long
---echo # names
---echo #
+--echo # Bug#10286 mysqldump -c crashes on table that has many fields with long
+--echo # names
+--echo #
create table t1 (
F_c4ca4238a0b923820dcc509a6f75849b int,
F_c81e728d9d4c2f636f067f89cc14862c int,
@@ -563,7 +566,7 @@ INSERT INTO t1 VALUES (1),(2),(3);
DROP TABLE t1;
--echo #
---echo # Bug #9558 mysqldump --no-data db t1 t2 format still dumps data
+--echo # Bug#9558 mysqldump --no-data db t1 t2 format still dumps data
--echo #
CREATE DATABASE mysqldump_test_db;
@@ -582,7 +585,7 @@ DROP DATABASE mysqldump_test_db;
--echo #
--echo # Testing with tables and databases that don't exists
--echo # or contains illegal characters
---echo # (Bug #9358 mysqldump crashes if tablename starts with \)
+--echo # (Bug#9358 mysqldump crashes if tablename starts with \)
--echo #
create database mysqldump_test_db;
use mysqldump_test_db;
@@ -601,7 +604,7 @@ select '------ Testing with illegal table names ------' as test_sequence ;
--error 6
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\\t1" 2>&1
-
+
--error 6
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\\\\t1" 2>&1
@@ -644,7 +647,7 @@ use test;
--echo #
---echo # Bug #9657 mysqldump xml ( -x ) does not format NULL fields correctly
+--echo # Bug#9657 mysqldump xml ( -x ) does not format NULL fields correctly
--echo #
create table t1 (a int(10));
@@ -655,8 +658,9 @@ insert into t2 (a, b) values (NULL, NULL),(10, NULL),(NULL, "twenty"),(30, "thir
--exec $MYSQL_DUMP --skip-comments --xml --no-create-info test
drop table t1, t2;
+
--echo #
---echo # BUG #12123
+--echo # Bug#12123 mysqldump --tab results in text file which can't be imported
--echo #
create table t1 (a text character set utf8, b text character set latin1);
@@ -669,14 +673,15 @@ select * from t1;
drop table t1;
+
--echo #
---echo # BUG#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
+--echo # Bug#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
--echo #
--exec $MYSQL_MY_PRINT_DEFAULTS --config-file=$MYSQL_TEST_DIR/std_data/bug15328.cnf mysqldump
--echo #
---echo # BUG #19025 mysqldump doesn't correctly dump "auto_increment = [int]"
+--echo # Bug#19025 mysqldump doesn't correctly dump "auto_increment = [int]"
--echo #
create table `t1` (
@@ -704,9 +709,11 @@ select * from t1;
show create table `t1`;
drop table `t1`;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug19025.sql
+
--echo #
---echo # Bug #18536: wrong table order
+--echo # Bug#18536 wrong table order
--echo #
create table t1(a int);
@@ -716,8 +723,9 @@ create table t3(a int);
--exec $MYSQL_DUMP --skip-comments --force --no-data test t3 t1 non_existing t2
drop table t1, t2, t3;
+
--echo #
---echo # Bug #21288: mysqldump segmentation fault when using --where
+--echo # Bug#21288 mysqldump segmentation fault when using --where
--echo #
create table t1 (a int);
@@ -725,8 +733,9 @@ create table t1 (a int);
--exec $MYSQL_DUMP --skip-comments --force test t1 --where="xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 2>&1
drop table t1;
+
--echo #
---echo # BUG#13926: --order-by-primary fails if PKEY contains quote character
+--echo # Bug#13926 --order-by-primary fails if PKEY contains quote character
--echo #
--disable_warnings
@@ -746,8 +755,9 @@ DROP TABLE `t1`;
--echo End of 4.1 tests
+
--echo #
---echo # Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X)
+--echo # Bug#10213 mysqldump crashes when dumping VIEWs(on MacOS X)
--echo #
create database db1;
@@ -770,8 +780,9 @@ drop view v2;
drop database db1;
use test;
+
--echo #
---echo # Bug 10713 mysqldump includes database in create view and referenced tables
+--echo # Bug#10713 mysqldump includes database in create view and referenced tables
--echo #
# create table and views in db2
@@ -805,18 +816,21 @@ select * from t2 order by a;
drop table t1, t2;
drop database db1;
use test;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug10713.sql
#
# dump of view
#
+
create table t1(a int);
create view v1 as select * from t1;
--exec $MYSQL_DUMP --skip-comments test
drop view v1;
drop table t1;
+
--echo #
---echo # Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X)
+--echo # Bug#10213 mysqldump crashes when dumping VIEWs(on MacOS X)
--echo #
create database mysqldump_test_db;
@@ -840,7 +854,7 @@ drop database mysqldump_test_db;
use test;
--echo #
---echo # Bug #9756
+--echo # Bug#9756 mysql client failing on dumps containing certain \ sequences
--echo #
CREATE TABLE t1 (a char(10));
@@ -849,7 +863,7 @@ INSERT INTO t1 VALUES ('\'');
DROP TABLE t1;
--echo #
---echo # Bug #10927 mysqldump: Can't reload dump with view that consist of other view
+--echo # Bug#10927 mysqldump: Can't reload dump with view that consist of other view
--echo #
create table t1(a int, b int, c varchar(30));
@@ -921,7 +935,9 @@ show triggers;
DROP TABLE t1, t2;
--echo #
---echo # Bugs #9136, #12917: problems with --defaults-extra-file option
+--echo # Bug#9136 my_print_defaults changed behaviour between 4.1.7 and 4.1.10a
+--echo # Bug#12917 The --defaults-extra-file option is ignored by the 5.0 client binaries
+--echo # (Problems with --defaults-extra-file option)
--echo #
--write_file $MYSQLTEST_VARDIR/tmp/tmp.cnf
@@ -933,7 +949,7 @@ EOF
--remove_file $MYSQLTEST_VARDIR/tmp/tmp.cnf
--echo #
---echo # Test of fix to BUG 12597
+--echo # Test of fix to Bug#12597 mysqldump dumps triggers wrongly
--echo #
DROP TABLE IF EXISTS `test1`;
@@ -969,9 +985,11 @@ SELECT * FROM `test2`;
DROP TRIGGER testref;
DROP TABLE test1;
DROP TABLE test2;
+--remove_file $MYSQLTEST_VARDIR/tmp/mysqldump.sql
+
--echo #
---echo # BUG#9056 - mysqldump does not dump routines
+--echo # Bug#9056 mysqldump does not dump routines
--echo #
--disable_warnings
@@ -997,9 +1015,9 @@ begin
return f1;
end //
-CREATE PROCEDURE bug9056_proc2(OUT a INT)
-BEGIN
- select sum(id) from t1 into a;
+CREATE PROCEDURE bug9056_proc2(OUT a INT)
+BEGIN
+ select sum(id) from t1 into a;
END //
DELIMITER ;//
@@ -1008,7 +1026,7 @@ set sql_mode='ansi';
create procedure `a'b` () select 1; # to fix syntax highlighting :')
set sql_mode='';
-# Dump the DB and ROUTINES
+# Dump the DB and ROUTINES
--exec $MYSQL_DUMP --skip-comments --routines --databases test
# ok, now blow it all away
@@ -1019,8 +1037,9 @@ DROP PROCEDURE bug9056_proc2;
DROP PROCEDURE `a'b`;
drop table t1;
+
--echo #
---echo # BUG# 13052 - mysqldump timestamp reloads broken
+--echo # Bug#13052 mysqldump timestamp reloads broken
--echo #
--disable_warnings
@@ -1043,7 +1062,7 @@ set global time_zone=default;
set time_zone=default;
--echo #
---echo # Test of fix to BUG 13146 - ansi quotes break loading of triggers
+--echo # Test of fix to Bug#13146 ansi quotes break loading of triggers
--echo #
--disable_warnings
@@ -1068,7 +1087,7 @@ INSERT INTO `t1 test` VALUES (1);
INSERT INTO `t1 test` VALUES (2);
INSERT INTO `t1 test` VALUES (3);
SELECT * FROM `t2 test`;
-# dump with compatible=ansi. Everything except triggers should be double
+# dump with compatible=ansi. Everything except triggers should be double
# quoted
--exec $MYSQL_DUMP --skip-comments --compatible=ansi --triggers test
@@ -1077,7 +1096,7 @@ DROP TABLE `t1 test`;
DROP TABLE `t2 test`;
--echo #
---echo # BUG# 12838 mysqldump -x with views exits with error
+--echo # Bug#12838 mysqldump -x with views exits with error
--echo #
--disable_warnings
@@ -1101,7 +1120,7 @@ drop view v1;
drop table t1;
--echo #
---echo # BUG#14554 - mysqldump does not separate words "ROW" and "BEGIN"
+--echo # Bug#14554 mysqldump does not separate words "ROW" and "BEGIN"
--echo # for tables with trigger created in the IGNORE_SPACE sql mode.
--echo #
@@ -1125,8 +1144,8 @@ DROP TRIGGER tr1;
DROP TABLE t1;
--echo #
---echo # Bug #13318: Bad result with empty field and --hex-blob
---echo #
+--echo # Bug#13318 Bad result with empty field and --hex-blob
+--echo #
create table t1 (a binary(1), b blob);
insert into t1 values ('','');
@@ -1135,7 +1154,7 @@ insert into t1 values ('','');
drop table t1;
--echo #
---echo # Bug 14871 Invalid view dump output
+--echo # Bug#14871 Invalid view dump output
--echo #
create table t1 (a int);
@@ -1162,9 +1181,11 @@ select * from v3 order by a;
drop table t1;
drop view v1, v2, v3, v4, v5;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug14871.sql
+
--echo #
---echo # Bug #16878 dump of trigger
+--echo # Bug#16878 dump of trigger
--echo #
create table t1 (a int, created datetime);
@@ -1192,6 +1213,8 @@ show triggers;
drop trigger tr1;
drop trigger tr2;
drop table t1, t2;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug16878.sql
+
--echo #
--echo # Bug#18462 mysqldump does not dump view structures correctly
@@ -1211,11 +1234,15 @@ create view v2 as select qty from v1;
drop view v1;
drop view v2;
drop table t;
+--remove_file $MYSQLTEST_VARDIR/tmp/v1.sql
+--remove_file $MYSQLTEST_VARDIR/tmp/v2.sql
+--remove_file $MYSQLTEST_VARDIR/tmp/t.sql
+--remove_file $MYSQLTEST_VARDIR/tmp/t.txt
--echo #
--echo # Bug#14857 Reading dump files with single statement stored routines fails.
---echo # fixed by patch for bug#16878
+--echo # fixed by patch for Bug#16878
--echo #
DELIMITER |;
@@ -1230,7 +1257,7 @@ drop function f;
drop procedure p;
--echo #
---echo # Bug #17371 Unable to dump a schema with invalid views
+--echo # Bug#17371 Unable to dump a schema with invalid views
--echo #
create table t1 ( id serial );
@@ -1243,7 +1270,8 @@ drop table t1;
--echo } mysqldump
drop view v1;
---echo # BUG#17201 Spurious 'DROP DATABASE' in output,
+
+--echo # Bug#17201 Spurious 'DROP DATABASE' in output,
--echo # also confusion between tables and views.
--echo # Example code from Markus Popp
@@ -1260,8 +1288,9 @@ drop view v1;
drop table t1;
drop database mysqldump_test_db;
+
--echo #
---echo # Bug21014 Segmentation fault of mysqldump on view
+--echo # Bug#21014 Segmentation fault of mysqldump on view
--echo #
create database mysqldump_tables;
@@ -1280,7 +1309,7 @@ drop table mysqldump_tables.basetable;
drop database mysqldump_tables;
--echo #
---echo # Bug20221 Dumping of multiple databases containing view(s) yields maleformed dumps
+--echo # Bug#20221 Dumping of multiple databases containing view(s) yields maleformed dumps
--echo #
create database mysqldump_dba;
@@ -1318,6 +1347,7 @@ use mysqldump_dbb;
drop view v1;
drop table t1;
drop database mysqldump_dbb;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug20221_backup
use test;
--echo #
@@ -1363,11 +1393,12 @@ grant REPLICATION CLIENT on *.* to mysqltest_1@localhost;
drop table t1;
drop user mysqltest_1@localhost;
+
--echo #
---echo # Bug #21527 mysqldump incorrectly tries to LOCK TABLES on the
---echo # information_schema database.
+--echo # Bug#21527 mysqldump incorrectly tries to LOCK TABLES on the
+--echo # information_schema database.
--echo #
---echo # Bug #21424 mysqldump failing to export/import views
+--echo # Bug#21424 mysqldump failing to export/import views
--echo #
# Do as root
@@ -1388,7 +1419,7 @@ create table u1 (f1 int);
insert into u1 values (4);
create view v1 (c1) as select * from t1;
-# Backup should not fail for Bug #21527. Flush priviliges test begins.
+# Backup should not fail for Bug#21527. Flush priviliges test begins.
--exec $MYSQL_DUMP --skip-comments --add-drop-table --flush-privileges --ignore-table=mysql.general_log --ignore-table=mysql.slow_log --databases mysqldump_myDB mysql > $MYSQLTEST_VARDIR/tmp/bug21527.sql
# Clean up
@@ -1402,8 +1433,9 @@ drop user myDB_User@localhost;
drop database mysqldump_myDB;
flush privileges;
---echo # Bug #21424 continues from here.
---echo # Restore. Flush Privileges test ends.
+
+--echo # Bug#21424 continues from here.
+--echo # Restore. Flush Privileges test ends.
--echo #
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug21527.sql
@@ -1416,8 +1448,9 @@ use mysqldump_myDB;
select * from mysqldump_myDB.v1;
select * from mysqldump_myDB.u1;
-#Final cleanup.
+# Final cleanup.
connection root;
+disconnect user1;
use mysqldump_myDB;
drop view v1;
drop table t1;
@@ -1425,10 +1458,14 @@ drop table u1;
revoke all privileges on mysqldump_myDB.* from myDB_User@localhost;
drop user myDB_User@localhost;
drop database mysqldump_myDB;
+connection default;
+disconnect root;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug21527.sql
use test;
+
--echo #
---echo # Bug #19745: mysqldump --xml produces invalid xml
+--echo # Bug#19745 mysqldump --xml produces invalid xml
--echo #
--disable_warnings
@@ -1443,9 +1480,8 @@ INSERT INTO t1 VALUES(1,0xff00fef0);
DROP TABLE t1;
-
--echo #
---echo # Bug#26346: stack + buffer overrun in mysqldump
+--echo # Bug#26346 stack + buffer overrun in mysqldump
--echo #
CREATE TABLE t1(a int);
@@ -1466,18 +1502,20 @@ INSERT INTO t1 VALUES (1), (2);
DROP TABLE t1;
+
#
-# Bug #25993: crashe with a merge table and -c
+# Bug#25993 crashes with a merge table and -c
#
-CREATE TABLE t2 (a int);
-CREATE TABLE t3 (a int);
-CREATE TABLE t1 (a int) ENGINE=merge UNION=(t2, t3);
+CREATE TABLE t2 (a INT);
+CREATE TABLE t3 (a INT);
+CREATE TABLE t1 (a INT) ENGINE=merge UNION=(t2, t3);
--exec $MYSQL_DUMP --skip-comments -c test
DROP TABLE t1, t2, t3;
+
--echo #
---echo # Bug #23491: MySQLDump prefix function call in a view by database name
+--echo # Bug#23491 MySQLDump prefix function call in a view by database name
--echo #
# Setup
@@ -1507,15 +1545,16 @@ show create view bug23491_restore.v3;
drop database bug23491_original;
drop database bug23491_restore;
use test;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug23491_backup.sql
---echo #
---echo # Bug 27293: mysqldump crashes when dumping routines
---echo # defined by a different user
--echo #
---echo # Bug #22761: mysqldump reports no errors when using
---echo # --routines without mysql.proc privileges
+--echo # Bug#27293 mysqldump crashes when dumping routines
+--echo # defined by a different user
+--echo #
+--echo # Bug#22761 mysqldump reports no errors when using
+--echo # --routines without mysql.proc privileges
--echo #
create database mysqldump_test_db;
@@ -1536,13 +1575,14 @@ create procedure mysqldump_test_db.sp1() select 'hello';
drop procedure sp1;
connection default;
+disconnect user27293;
drop user user1;
drop user user2;
drop database mysqldump_test_db;
--echo #
---echo # Bug #28522: buffer overrun by '\0' byte using --hex-blob.
+--echo # Bug#28522 buffer overrun by '\0' byte using --hex-blob.
--echo #
CREATE TABLE t1 (c1 INT, c2 LONGBLOB);
@@ -1551,8 +1591,8 @@ INSERT INTO t1 SET c1=11, c2=REPEAT('q',509);
DROP TABLE t1;
--echo #
---echo # Bug #28524: mysqldump --skip-add-drop-table is not
---echo # compatible with views
+--echo # Bug#28524 mysqldump --skip-add-drop-table is not
+--echo # compatible with views
--echo #
CREATE VIEW v1 AS SELECT 1;
@@ -1562,10 +1602,12 @@ DROP VIEW v1;
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug28524.sql
SELECT * FROM v1;
DROP VIEW v1;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug28524.sql
+
--echo #
---echo # Bug #29788: mysqldump discards the NO_AUTO_VALUE_ON_ZERO value of
---echo # the SQL_MODE variable after the dumping of triggers.
+--echo # Bug#29788 mysqldump discards the NO_AUTO_VALUE_ON_ZERO value of
+--echo # the SQL_MODE variable after the dumping of triggers.
--echo #
CREATE TABLE t1 (c1 INT);
@@ -1584,10 +1626,12 @@ SELECT * FROM t2;
SELECT * FROM t2;
DROP TABLE t1,t2;
+--remove_file $MYSQLTEST_VARDIR/tmp/bug29788.sql
+
--echo #
---echo # Bug#29815: new option for suppressing last line of mysqldump:
---echo # "Dump completed on"
+--echo # Bug#29815 new option for suppressing last line of mysqldump:
+--echo # "Dump completed on"
--echo #
--echo # --skip-dump-date:
@@ -1609,3 +1653,6 @@ SET @@GLOBAL.CONCURRENT_INSERT = @OLD_CONCURRENT_INSERT;
--echo #
--echo # End of 5.0 tests
--echo #
+
+# Wait till we reached the initial number of concurrent sessions
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/not_embedded_server.test b/mysql-test/t/not_embedded_server.test
index 83ec03d6706..044d8665a18 100644
--- a/mysql-test/t/not_embedded_server.test
+++ b/mysql-test/t/not_embedded_server.test
@@ -16,3 +16,31 @@ execute stmt1;
deallocate prepare stmt1;
# End of 4.1 tests
+
+#
+# Bug#31222: com_% global status counters behave randomly with
+# mysql_change_user.
+#
+
+FLUSH STATUS;
+
+--disable_result_log
+--disable_query_log
+
+let $i = 100;
+
+while ($i)
+{
+ dec $i;
+
+ SELECT 1;
+}
+
+--enable_query_log
+--enable_result_log
+
+SHOW GLOBAL STATUS LIKE 'com_select';
+
+--change_user
+
+SHOW GLOBAL STATUS LIKE 'com_select';
diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test
index a752e990846..ad051503fd6 100644
--- a/mysql-test/t/openssl_1.test
+++ b/mysql-test/t/openssl_1.test
@@ -3,6 +3,10 @@
-- source include/have_ssl.inc
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+
--disable_warnings
drop table if exists t1;
--enable_warnings
@@ -11,8 +15,8 @@ insert into t1 values (5);
grant select on test.* to ssl_user1@localhost require SSL;
grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA";
-grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB/emailAddress=abstract.mysql.developer@mysql.com";
-grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB/emailAddress=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB";
+grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/O=MySQL AB/emailAddress=abstract.mysql.developer@mysql.com";
+grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/ST=Uppsala/O=MySQL AB/emailAddress=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/ST=Uppsala/L=Uppsala/O=MySQL AB";
grant select on test.* to ssl_user5@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "xxx";
flush privileges;
@@ -21,38 +25,42 @@ connect (con2,localhost,ssl_user2,,,,,SSL);
connect (con3,localhost,ssl_user3,,,,,SSL);
connect (con4,localhost,ssl_user4,,,,,SSL);
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
---error 1045
+--error ER_ACCESS_DENIED_ERROR
connect (con5,localhost,ssl_user5,,,,,SSL);
connection con1;
# Check ssl turned on
SHOW STATUS LIKE 'Ssl_cipher';
select * from t1;
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
delete from t1;
connection con2;
# Check ssl turned on
SHOW STATUS LIKE 'Ssl_cipher';
select * from t1;
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
delete from t1;
connection con3;
# Check ssl turned on
SHOW STATUS LIKE 'Ssl_cipher';
select * from t1;
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
delete from t1;
connection con4;
# Check ssl turned on
SHOW STATUS LIKE 'Ssl_cipher';
select * from t1;
---error 1142
+--error ER_TABLEACCESS_DENIED_ERROR
delete from t1;
connection default;
+disconnect con1;
+disconnect con2;
+disconnect con3;
+disconnect con4;
drop user ssl_user1@localhost, ssl_user2@localhost,
ssl_user3@localhost, ssl_user4@localhost, ssl_user5@localhost;
@@ -97,7 +105,7 @@ drop table t1;
--exec $MYSQL_TEST --ssl-cert= --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
#
-# BUG#21611 Slave can't connect when master-ssl-cipher specified
+# Bug#21611 Slave can't connect when master-ssl-cipher specified
# - Apparently selecting a cipher doesn't work at all
# - Usa a cipher that both yaSSL and OpenSSL supports
#
@@ -133,7 +141,7 @@ drop table t1;
--exec $MYSQL_TEST --ssl-cipher=UNKNOWN-CIPHER < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
#
-# Bug #27669 mysqldump: SSL connection error when trying to connect
+# Bug#27669 mysqldump: SSL connection error when trying to connect
#
CREATE TABLE t1(a int);
@@ -152,3 +160,7 @@ INSERT INTO t1 VALUES (1), (2);
--exec $MYSQL_DUMP --skip-create --skip-comments --ssl --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test 2>&1
DROP TABLE t1;
+--remove_file $MYSQLTEST_VARDIR/tmp/test.sql
+
+# Wait till we reached the initial number of concurrent sessions
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/outfile.test b/mysql-test/t/outfile.test
index 527a4d398d8..4398f9fa741 100644
--- a/mysql-test/t/outfile.test
+++ b/mysql-test/t/outfile.test
@@ -5,6 +5,10 @@ eval set @tmpdir="../tmp";
enable_query_log;
-- source include/have_outfile.inc
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+
#
# test of into outfile|dumpfile
#
@@ -46,7 +50,7 @@ select load_file(concat(@tmpdir,"/outfile-test.not-exist"));
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.3
drop table t1;
-# Bug#8191
+# Bug#8191 SELECT INTO OUTFILE insists on FROM clause
disable_query_log;
eval select 1 into outfile "../tmp/outfile-test.4";
enable_query_log;
@@ -54,11 +58,11 @@ select load_file(concat(@tmpdir,"/outfile-test.4"));
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
#
-# Bug #5382: 'explain select into outfile' crashes the server
+# Bug#5382 'explain select into outfile' crashes the server
#
CREATE TABLE t1 (a INT);
-EXPLAIN
+EXPLAIN
SELECT *
INTO OUTFILE '/tmp/t1.txt'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\r\n'
@@ -68,7 +72,7 @@ DROP TABLE t1;
# End of 4.1 tests
#
-# Bug#13202 SELECT * INTO OUTFILE ... FROM information_schema.schemata now fails
+# Bug#13202 SELECT * INTO OUTFILE ... FROM information_schema.schemata now fails
#
disable_query_log;
eval SELECT * INTO OUTFILE "../tmp/outfile-test.4"
@@ -114,6 +118,7 @@ from information_schema.schemata
where schema_name like 'mysqltest';
connection default;
+disconnect con28181_1;
grant file on *.* to user_1@localhost;
connect (con28181_2,localhost,user_1,,mysqltest);
@@ -125,9 +130,12 @@ from information_schema.schemata
where schema_name like 'mysqltest';
connection default;
+disconnect con28181_2;
--remove_file $MYSQLTEST_VARDIR/tmp/outfile-test.4
use test;
revoke all privileges on *.* from user_1@localhost;
drop user user_1@localhost;
drop database mysqltest;
+# Wait till we reached the initial number of concurrent sessions
+--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index ebd24bf2b89..2dd70f415a1 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -1276,4 +1276,31 @@ DROP TABLE t1;
SET GLOBAL concurrent_insert= @save_concurrent_insert;
SET GLOBAL query_cache_size= default;
+#
+# Bug#36326: nested transaction and select
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+FLUSH STATUS;
+SET GLOBAL query_cache_size=1048576;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
+SHOW STATUS LIKE 'Qcache_queries_in_cache';
+SELECT * FROM t1;
+BEGIN;
+SELECT * FROM t1;
+COMMIT;
+SHOW STATUS LIKE 'Qcache_queries_in_cache';
+SHOW STATUS LIKE "Qcache_hits";
+SELECT * FROM t1;
+BEGIN;
+SELECT * FROM t1;
+COMMIT;
+SHOW STATUS LIKE "Qcache_hits";
+DROP TABLE t1;
+SET GLOBAL query_cache_size= default;
+
# End of 5.0 tests
diff --git a/mysql-test/t/query_cache_notembedded.test b/mysql-test/t/query_cache_notembedded.test
index a4f4144d9c6..421ec913e5d 100644
--- a/mysql-test/t/query_cache_notembedded.test
+++ b/mysql-test/t/query_cache_notembedded.test
@@ -222,3 +222,5 @@ disconnect con2;
connection default;
set GLOBAL query_cache_size=0;
+
+# End of 5.0 tests
diff --git a/mysql-test/t/subselect3.test b/mysql-test/t/subselect3.test
index 7e9aa1554c0..2d88d1660b0 100644
--- a/mysql-test/t/subselect3.test
+++ b/mysql-test/t/subselect3.test
@@ -640,4 +640,33 @@ WHERE NULL NOT IN (
DROP TABLE t1;
+#
+# Bug #39069: <row constructor> IN <table-subquery> seriously messed up
+#
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2), (11);
+
+--echo # 2nd and 3rd columns should be same
+SELECT a, ROW(11, 12) = (SELECT a, 22), ROW(11, 12) IN (SELECT a, 22) FROM t1 GROUP BY t1.a;
+SELECT a, ROW(11, 12) = (SELECT a, 12), ROW(11, 12) IN (SELECT a, 12) FROM t1 GROUP BY t1.a;
+SELECT a, ROW(11, 12) = (SELECT a, 22), ROW(11, 12) IN (SELECT a, 22) FROM t1;
+SELECT a, ROW(11, 12) = (SELECT a, 12), ROW(11, 12) IN (SELECT a, 12) FROM t1;
+
+# The x alias is used below to workaround bug #40674.
+# Regression tests for sum function on outer column in subselect from dual:
+SELECT a AS x, ROW(11, 12) = (SELECT MAX(x), 22), ROW(11, 12) IN (SELECT MAX(x), 22) FROM t1;
+--echo # 2nd and 3rd columns should be same for x == 11 only
+SELECT a AS x, ROW(11, 12) = (SELECT MAX(x), 12), ROW(11, 12) IN (SELECT MAX(x), 12) FROM t1;
+
+DROP TABLE t1;
+
+--echo # both columns should be same
+SELECT ROW(1,2) = (SELECT NULL, NULL), ROW(1,2) IN (SELECT NULL, NULL);
+SELECT ROW(1,2) = (SELECT 1, NULL), ROW(1,2) IN (SELECT 1, NULL);
+SELECT ROW(1,2) = (SELECT NULL, 2), ROW(1,2) IN (SELECT NULL, 2);
+SELECT ROW(1,2) = (SELECT NULL, 1), ROW(1,2) IN (SELECT NULL, 1);
+SELECT ROW(1,2) = (SELECT 1, 1), ROW(1,2) IN (SELECT 1, 1);
+SELECT ROW(1,2) = (SELECT 1, 2), ROW(1,2) IN (SELECT 1, 2);
+
--echo End of 5.0 tests
diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test
index 7b4af9e0c69..ce1d3f21ff5 100644
--- a/mysql-test/t/type_timestamp.test
+++ b/mysql-test/t/type_timestamp.test
@@ -324,7 +324,7 @@ insert into t1 (a, c) values (4, '2004-04-04 00:00:00'),
select * from t1;
drop table t1;
-# End of 4.1 tests
+--echo End of 4.1 tests
# Restore timezone to default
set time_zone= @@global.time_zone;
@@ -339,3 +339,21 @@ PRIMARY KEY (`id`)
show fields from t1;
select is_nullable from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='t1' and COLUMN_NAME='posted_on';
drop table t1;
+
+#
+# Bug#41370: TIMESTAMP field does not accepts NULL from FROM_UNIXTIME()
+#
+
+CREATE TABLE t1 ( f1 INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ f2 TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ f3 TIMESTAMP);
+INSERT INTO t1 (f2,f3) VALUES (NOW(), "0000-00-00 00:00:00");
+INSERT INTO t1 (f2,f3) VALUES (NOW(), NULL);
+INSERT INTO t1 (f2,f3) VALUES (NOW(), ASCII(NULL));
+INSERT INTO t1 (f2,f3) VALUES (NOW(), FROM_UNIXTIME('9999999999'));
+INSERT INTO t1 (f2,f3) VALUES (NOW(), TIME(NULL));
+UPDATE t1 SET f2=NOW(), f3=FROM_UNIXTIME('9999999999') WHERE f1=1;
+SELECT f1,f2-f3 FROM t1;
+DROP TABLE t1;
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index 1748b63ceb9..60254ad9a1d 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -6,7 +6,7 @@ drop table if exists t1,t2;
--enable_warnings
#
-# Bug #19263: variables.test doesn't clean up after itself (I/II -- save)
+# Bug#19263: variables.test doesn't clean up after itself (I/II -- save)
#
set @my_binlog_cache_size =@@global.binlog_cache_size;
set @my_connect_timeout =@@global.connect_timeout;
@@ -172,46 +172,46 @@ SELECT @@version_compile_os LIKE 'non-existent';
# The following should give errors
---error 1231
+--error ER_WRONG_VALUE_FOR_VAR
set big_tables=OFFF;
---error 1231
+--error ER_WRONG_VALUE_FOR_VAR
set big_tables="OFFF";
---error 1193
+--error ER_UNKNOWN_SYSTEM_VARIABLE
set unknown_variable=1;
---error 1232
+--error ER_WRONG_TYPE_FOR_VAR
set max_join_size="hello";
---error 1286
+--error ER_UNKNOWN_STORAGE_ENGINE
set storage_engine=UNKNOWN_TABLE_TYPE;
---error 1231
+--error ER_WRONG_VALUE_FOR_VAR
set storage_engine=MERGE, big_tables=2;
show local variables like 'storage_engine';
---error 1229
+--error ER_GLOBAL_VARIABLE
set SESSION query_cache_size=10000;
---error 1230
+--error ER_NO_DEFAULT
set GLOBAL storage_engine=DEFAULT;
---error 1115
+--error ER_UNKNOWN_CHARACTER_SET
set character_set_client=UNKNOWN_CHARACTER_SET;
---error 1273
+--error ER_UNKNOWN_COLLATION
set collation_connection=UNKNOWN_COLLATION;
---error 1231
+--error ER_WRONG_VALUE_FOR_VAR
set character_set_client=NULL;
---error 1231
+--error ER_WRONG_VALUE_FOR_VAR
set collation_connection=NULL;
---error 1228
+--error ER_LOCAL_VARIABLE
set global autocommit=1;
---error 1238
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@global.timestamp;
---error 1238
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set @@version='';
---error 1229
+--error ER_GLOBAL_VARIABLE
set @@concurrent_insert=1;
---error 1228
+--error ER_LOCAL_VARIABLE
set @@global.sql_auto_is_null=1;
---error 1238
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@global.sql_auto_is_null;
---error 1229
+--error ER_GLOBAL_VARIABLE
set myisam_max_sort_file_size=100;
---error 1231
+--error ER_WRONG_VALUE_FOR_VAR
set @@SQL_WARNINGS=NULL;
# Test setting all variables
@@ -338,23 +338,23 @@ drop table t1,t2;
# error conditions
#
---error 1193
+--error ER_UNKNOWN_SYSTEM_VARIABLE
select @@xxxxxxxxxx;
select 1;
---error 1238
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.key_buffer_size;
---error 1229
+--error ER_GLOBAL_VARIABLE
set ft_boolean_syntax = @@init_connect;
---error 1231
+--error ER_WRONG_VALUE_FOR_VAR
set global ft_boolean_syntax = @@init_connect;
---error 1229
+--error ER_GLOBAL_VARIABLE
set init_connect = NULL;
set global init_connect = NULL;
---error 1229
+--error ER_GLOBAL_VARIABLE
set ft_boolean_syntax = @@init_connect;
---error 1231
+--error ER_WRONG_VALUE_FOR_VAR
set global ft_boolean_syntax = @@init_connect;
# Bug#3754 SET GLOBAL myisam_max_sort_file_size doesn't work as
@@ -385,15 +385,15 @@ select @a, @b;
#
# Bug#2586:Disallow global/session/local as structured var. instance names
#
---error 1064
+--error ER_PARSE_ERROR
set @@global.global.key_buffer_size= 1;
---error 1064
+--error ER_PARSE_ERROR
set GLOBAL global.key_buffer_size= 1;
---error 1064
+--error ER_PARSE_ERROR
SELECT @@global.global.key_buffer_size;
---error 1064
+--error ER_PARSE_ERROR
SELECT @@global.session.key_buffer_size;
---error 1064
+--error ER_PARSE_ERROR
SELECT @@global.local.key_buffer_size;
# BUG#5135: cannot turn on log_warnings with SET in 4.1 (and 4.0)
@@ -478,27 +478,27 @@ select @@lc_time_names;
--echo *** LC_TIME_NAMES: testing with string expressions
set lc_time_names=concat('de','_','DE');
select @@lc_time_names;
---error 1105
+--error ER_UNKNOWN_ERROR
set lc_time_names=concat('de','+','DE');
select @@lc_time_names;
--echo LC_TIME_NAMES: testing with numeric expressions
set @@lc_time_names=1+2;
select @@lc_time_names;
---error 1232
+--error ER_WRONG_TYPE_FOR_VAR
set @@lc_time_names=1/0;
select @@lc_time_names;
set lc_time_names=en_US;
--echo LC_TIME_NAMES: testing NULL and a negative number:
---error 1231
+--error ER_WRONG_VALUE_FOR_VAR
set lc_time_names=NULL;
---error 1105
+--error ER_UNKNOWN_ERROR
set lc_time_names=-1;
select @@lc_time_names;
--echo LC_TIME_NAMES: testing locale with the last ID:
set lc_time_names=108;
select @@lc_time_names;
--echo LC_TIME_NAMES: testing a number beyond the valid ID range:
---error 1105
+--error ER_UNKNOWN_ERROR
set lc_time_names=109;
select @@lc_time_names;
--echo LC_TIME_NAMES: testing that 0 is en_US:
@@ -540,7 +540,7 @@ select @@query_prealloc_size = @test;
# Bug#31588 buffer overrun when setting variables
#
# Buffer-size Off By One. Should throw valgrind-warning without fix #31588.
---error 1231
+--error ER_WRONG_VALUE_FOR_VAR
set global sql_mode=repeat('a',80);
--echo End of 4.1 tests
@@ -558,9 +558,9 @@ drop table t1;
# Bug #10339: read only variables.
#
---error 1238
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set @@warning_count=1;
---error 1238
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set @@global.error_count=1;
#
@@ -578,9 +578,9 @@ select @@max_heap_table_size > 0;
# Bug #11775 Variable character_set_system does not exist (sometimes)
#
select @@character_set_system;
---error 1238
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global character_set_system = latin1;
---error 1238
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set @@global.version_compile_os='234';
#
@@ -677,7 +677,7 @@ select @@@;
# Don't actually output, since it depends on the system
--replace_column 1 #
select @@hostname;
---error 1238
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set @@hostname= "anothername";
--replace_column 2 #
show variables like 'hostname';
@@ -688,12 +688,12 @@ show variables like 'hostname';
SHOW VARIABLES LIKE 'log';
SELECT @@log;
---error 1238
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET GLOBAL log=0;
SHOW VARIABLES LIKE 'log_slow_queries';
SELECT @@log_slow_queries;
---error 1238
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET GLOBAL log_slow_queries=0;
--echo End of 5.0 tests