summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/archive.test14
-rw-r--r--mysql-test/t/grant.test3
-rw-r--r--mysql-test/t/grant3.test100
-rw-r--r--mysql-test/t/mysqltest.test3
-rw-r--r--mysql-test/t/named_pipe-master.opt1
-rw-r--r--mysql-test/t/named_pipe.test14
-rw-r--r--mysql-test/t/partition.test20
-rw-r--r--mysql-test/t/shm-master.opt (renamed from mysql-test/t/windows_shm-master.opt)2
-rw-r--r--mysql-test/t/shm.test19
-rw-r--r--mysql-test/t/type_datetime.test20
-rw-r--r--mysql-test/t/type_decimal.test13
-rw-r--r--mysql-test/t/variables.test1
-rw-r--r--mysql-test/t/windows_shm.test9
-rw-r--r--mysql-test/t/xml.test11
14 files changed, 216 insertions, 14 deletions
diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test
index 23c591856a7..e0a2e877af5 100644
--- a/mysql-test/t/archive.test
+++ b/mysql-test/t/archive.test
@@ -1351,8 +1351,16 @@ SELECT * FROM t2;
# Test INSERT DELAYED and wait until the table has one more record
SELECT COUNT(auto) FROM t2;
-INSERT DELAYED INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily','');
-while (`SELECT COUNT(auto)!=1214 FROM t2`)
+INSERT DELAYED INTO t2 VALUES (99999,011403,37,'the','delayed','insert','');
+
+# Insert another record since in Archive delayed values are only
+# guaranteed to materialize based on either:
+# 1) A new row showing up from a normal insert
+# 2) A flush table has occurred.
+INSERT INTO t2 VALUES (100000,000001,00,'after','delayed','insert','');
+
+# Wait for the delayed insert to appear
+while (`SELECT COUNT(auto)!=1215 FROM t2`)
{
sleep 0.1;
}
@@ -1361,7 +1369,7 @@ SELECT COUNT(auto) FROM t2;
# Adding test for ALTER TABLE
ALTER TABLE t2 DROP COLUMN fld6;
SHOW CREATE TABLE t2;
-SELECT * FROM t2;
+SELECT * FROM t2 WHERE auto != 100000;
# Adding tests for autoincrement
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index e33712e1ebf..8d909d63f51 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -1257,6 +1257,9 @@ UPDATE v1 SET f2 = 4;
SELECT * FROM test.t1;
disconnect user1;
connection default;
+REVOKE UPDATE (f1) ON `test`.`t1` FROM 'mysqltest_1'@'localhost';
+REVOKE SELECT ON `test`.* FROM 'mysqltest_1'@'localhost';
+REVOKE ALL ON db27878.* FROM 'mysqltest_1'@'localhost';
DROP DATABASE db27878;
use test;
DROP TABLE t1;
diff --git a/mysql-test/t/grant3.test b/mysql-test/t/grant3.test
index 115586e807d..fac577ef0ff 100644
--- a/mysql-test/t/grant3.test
+++ b/mysql-test/t/grant3.test
@@ -34,3 +34,103 @@ delete from mysql.db where user like 'mysqltest\_%';
delete from mysql.tables_priv where user like 'mysqltest\_%';
delete from mysql.columns_priv where user like 'mysqltest\_%';
flush privileges;
+
+#
+# Bug: #19828 Case sensitivity in Grant/Revoke
+#
+
+grant select on test.* to CUser@localhost;
+grant select on test.* to CUser@LOCALHOST;
+flush privileges;
+
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2;
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST';
+flush privileges;
+
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2;
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost';
+flush privileges;
+
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser' order by 1,2;
+
+DROP USER CUser@localhost;
+DROP USER CUser@LOCALHOST;
+
+#### table grants
+create table t1 (a int);
+grant select on test.t1 to CUser@localhost;
+grant select on test.t1 to CUser@LOCALHOST;
+flush privileges;
+
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST';
+flush privileges;
+
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost';
+flush privileges;
+
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
+
+DROP USER CUser@localhost;
+DROP USER CUser@LOCALHOST;
+
+### column grants
+
+grant select(a) on test.t1 to CUser@localhost;
+grant select(a) on test.t1 to CUser@LOCALHOST;
+flush privileges;
+
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'LOCALHOST';
+flush privileges;
+
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'CUser'@'localhost';
+flush privileges;
+
+SELECT user, host FROM mysql.user where user = 'CUser' order by 1,2;
+SELECT user, host, db, Table_name, Table_priv, Column_priv FROM mysql.tables_priv where user = 'CUser' order by 1,2;
+
+DROP USER CUser@localhost;
+DROP USER CUser@LOCALHOST;
+
+drop table t1;
+
+# revoke on a specific DB only
+
+grant select on test.* to CUser2@localhost;
+grant select on test.* to CUser2@LOCALHOST;
+flush privileges;
+
+SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2;
+SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2;
+
+REVOKE SELECT ON test.* FROM 'CUser2'@'LOCALHOST';
+flush privileges;
+
+SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2;
+SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2;
+
+REVOKE SELECT ON test.* FROM 'CUser2'@'localhost';
+flush privileges;
+
+SELECT user, host FROM mysql.user where user = 'CUser2' order by 1,2;
+SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by 1,2;
+
+DROP USER CUser2@localhost;
+DROP USER CUser2@LOCALHOST;
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index 8a38972c00f..ec188af0244 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -1435,7 +1435,10 @@ select "this will be executed";
--exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/query.sql -R $MYSQLTEST_VARDIR/tmp/zero_length_file.result > /dev/null 2>&1
remove_file $MYSQLTEST_VARDIR/tmp/zero_length_file.result;
+--error 0,1
remove_file $MYSQLTEST_VARDIR/log/zero_length_file.reject;
+--error 0,1
+remove_file $MYSQL_TEST_DIR/r/zero_length_file.reject;
#
# Test that a test file that does not generate any output fails.
diff --git a/mysql-test/t/named_pipe-master.opt b/mysql-test/t/named_pipe-master.opt
new file mode 100644
index 00000000000..e534ae1eae5
--- /dev/null
+++ b/mysql-test/t/named_pipe-master.opt
@@ -0,0 +1 @@
+--loose-enable-named-pipe
diff --git a/mysql-test/t/named_pipe.test b/mysql-test/t/named_pipe.test
new file mode 100644
index 00000000000..e3dfd24bb52
--- /dev/null
+++ b/mysql-test/t/named_pipe.test
@@ -0,0 +1,14 @@
+# We currently only have named pipe support on windows, so
+# in order to optimize things we skip this test on all
+# other platforms
+--source include/windows.inc
+
+# Only run this test if named pipe is avaliable
+let $nmp= query_get_value("SHOW VARIABLES LIKE 'named_pipe'", Value, 1);
+if (`SELECT '$nmp' != 'ON'`){
+ skip No named pipe support;
+}
+
+# Source select test case
+-- source include/common-tests.inc
+
diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test
index 42db23dadef..2be2ab83c88 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -1493,10 +1493,30 @@ ALTER TABLE general_log PARTITION BY RANGE (TO_DAYS(event_time))
(PARTITION p0 VALUES LESS THAN (733144), PARTITION p1 VALUES LESS THAN (3000000));
ALTER TABLE general_log ENGINE = CSV;
SET GLOBAL general_log = default;
+use test;
#
# Bug #27084 partitioning by list seems failing when using case
# BUG #18198: Case no longer supported, test case removed
#
+#
+# Bug #29444: crash with partition refering to table in create-select
+#
+
+create table t2 (b int);
+--error 1054
+create table t1 (b int)
+PARTITION BY RANGE (t2.b) (
+ PARTITION p1 VALUES LESS THAN (10),
+ PARTITION p2 VALUES LESS THAN (20)
+) select * from t2;
+create table t1 (a int)
+PARTITION BY RANGE (b) (
+ PARTITION p1 VALUES LESS THAN (10),
+ PARTITION p2 VALUES LESS THAN (20)
+) select * from t2;
+show create table t1;
+drop table t1, t2;
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/windows_shm-master.opt b/mysql-test/t/shm-master.opt
index 4476ea16360..d71395213b1 100644
--- a/mysql-test/t/windows_shm-master.opt
+++ b/mysql-test/t/shm-master.opt
@@ -1 +1 @@
---skip-grant-tables --loose-shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --loose-shared-memory=1
+--skip-grant-tables --loose-shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX$MTR_BUILD_THREAD --loose-shared-memory=1
diff --git a/mysql-test/t/shm.test b/mysql-test/t/shm.test
new file mode 100644
index 00000000000..380607d8ebf
--- /dev/null
+++ b/mysql-test/t/shm.test
@@ -0,0 +1,19 @@
+# We currently only have shm support on windows, so in order
+# to optimize things we skip this test on all other platforms
+--source include/windows.inc
+
+# Only run this test if shared memory is avaliable
+let $shm= query_get_value("SHOW VARIABLES LIKE 'shared_memory'", Value, 1);
+if (`SELECT '$shm' != 'ON'`){
+ skip No shm support;
+}
+
+# Source select test case
+-- source include/common-tests.inc
+
+#
+# Bug #24924: shared-memory-base-name that is too long causes buffer overflow
+#
+--exec $MYSQLADMIN --no-defaults --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ping
+
+--echo End of 5.0 tests.
diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test
index d8d137d81e6..6aa6edd128e 100644
--- a/mysql-test/t/type_datetime.test
+++ b/mysql-test/t/type_datetime.test
@@ -284,6 +284,26 @@ select * from t1 where f1 between 20020101 and 2007010100000;
drop table t1;
#
+# Bug #31253: crash comparing datetime to double
+# Should return 1st row only. Crashes if NULL propagation fails.
+#
+create table t1 (f1 time);
+insert into t1 set f1 = '45:44:44';
+insert into t1 set f1 = '15:44:44';
+select * from t1 where (convert(f1,datetime)) != 1;
+drop table t1;
+
+#
+# Bug #31249: problem with convert(..., datetime)
+#
+create table t1 (a tinyint);
+insert into t1 values (), (), ();
+select sum(a) from t1 group by convert(a, datetime);
+drop table t1;
+
+--echo End of 5.0 tests
+
+#
# Test of storing datetime into date fields
#
diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test
index 5538f19f5f9..458583fca81 100644
--- a/mysql-test/t/type_decimal.test
+++ b/mysql-test/t/type_decimal.test
@@ -278,7 +278,7 @@ update t1 set b=a;
select * from t1;
drop table t1;
-# End of 4.1 tests
+--echo End of 4.1 tests
#
# Test for BUG#8397: decimal type in subselects (Item_cache_decimal)
@@ -408,3 +408,14 @@ INSERT INTO t1 VALUES (1.1325,3);
SELECT ROUND(qty,3), dps, ROUND(qty,dps) FROM t1;
DROP TABLE t1;
+
+#
+# Bug #31227: memory overrun with decimal (6,6) and zerofill and group_concat
+# valgrind will complain about this (the group_concat(f2)) on unpatched mysqld.
+#
+create table t1 (f1 decimal(6,6),f2 decimal(6,6) zerofill);
+insert into t1 values (-0.123456,0.123456);
+select group_concat(f1),group_concat(f2) 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 81db143b518..f474d166fae 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -161,6 +161,7 @@ select * from information_schema.session_variables where variable_name like 'net
set net_buffer_length=1;
show variables like 'net_buffer_length';
select * from information_schema.session_variables where variable_name like 'net_buffer_length';
+--warning 1292
set net_buffer_length=2000000000;
show variables like 'net_buffer_length';
select * from information_schema.session_variables where variable_name like 'net_buffer_length';
diff --git a/mysql-test/t/windows_shm.test b/mysql-test/t/windows_shm.test
deleted file mode 100644
index 1c6f05f2da0..00000000000
--- a/mysql-test/t/windows_shm.test
+++ /dev/null
@@ -1,9 +0,0 @@
-# Windows-specific tests
---source include/windows.inc
-
-#
-# Bug #24924: shared-memory-base-name that is too long causes buffer overflow
-#
---exec $MYSQLADMIN --no-defaults --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ping
-
---echo End of 5.0 tests.
diff --git a/mysql-test/t/xml.test b/mysql-test/t/xml.test
index 1d16652ab1e..6c7d9af1b63 100644
--- a/mysql-test/t/xml.test
+++ b/mysql-test/t/xml.test
@@ -533,3 +533,14 @@ select UpdateXML('<a>a</a>',repeat('a b ',1000),'');
select ExtractValue('<a>a</a>', '/a[@x=@y0123456789_0123456789_0123456789_0123456789]');
--error 1105
select ExtractValue('<a>a</a>', '/a[@x=$y0123456789_0123456789_0123456789_0123456789]');
+
+#
+# Bug #31438: updatexml still crashes
+#
+
+select updatexml(NULL, 1, 1), updatexml(1, NULL, 1), updatexml(1, 1, NULL);
+select updatexml(NULL, NULL, 1), updatexml(1, NULL, NULL),
+ updatexml(NULL, 1, NULL);
+select updatexml(NULL, NULL, NULL);
+
+--echo End of 5.1 tests