summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/archive.test13
-rw-r--r--mysql-test/t/bug46080-master.opt2
-rw-r--r--mysql-test/t/drop.test5
-rw-r--r--mysql-test/t/func_gconcat.test16
-rw-r--r--mysql-test/t/func_misc.test12
-rw-r--r--mysql-test/t/grant.test2
-rw-r--r--mysql-test/t/group_by.test14
-rw-r--r--mysql-test/t/having.test21
-rw-r--r--mysql-test/t/information_schema.test16
-rw-r--r--mysql-test/t/loaddata.test34
-rw-r--r--mysql-test/t/log_tables_upgrade.test2
-rw-r--r--mysql-test/t/lowercase_view.test22
-rw-r--r--mysql-test/t/mysql_client_test.test2
-rw-r--r--mysql-test/t/mysql_upgrade.test30
-rw-r--r--mysql-test/t/mysqltest_ps.test2
-rw-r--r--mysql-test/t/ssl_8k_key-master.opt1
-rw-r--r--mysql-test/t/update.test20
-rw-r--r--mysql-test/t/upgrade.test11
18 files changed, 211 insertions, 14 deletions
diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test
index 6704257f9af..7478c7dcdce 100644
--- a/mysql-test/t/archive.test
+++ b/mysql-test/t/archive.test
@@ -1680,3 +1680,16 @@ SELECT * FROM t1;
REPAIR TABLE t1 EXTENDED;
SELECT * FROM t1;
DROP TABLE t1;
+
+#
+# Bug #47012 archive tables are not upgradeable, and server crashes on
+# any access
+#
+copy_file std_data/archive_5_0.frm $MYSQLD_DATADIR/test/t1.frm;
+copy_file std_data/archive_5_0.ARZ $MYSQLD_DATADIR/test/t1.ARZ;
+copy_file std_data/archive_5_0.ARM $MYSQLD_DATADIR/test/t1.ARM;
+--error ER_TABLE_NEEDS_UPGRADE
+select * from t1;
+repair table t1;
+select sum(length(a)),sum(b) from t1;
+drop table t1;
diff --git a/mysql-test/t/bug46080-master.opt b/mysql-test/t/bug46080-master.opt
index dacdab53a4b..ff809c0cc69 100644
--- a/mysql-test/t/bug46080-master.opt
+++ b/mysql-test/t/bug46080-master.opt
@@ -1 +1 @@
---skip-grant-tables --skip-name-resolve --safemalloc-mem-limit=20000000
+--skip-grant-tables --skip-name-resolve --safemalloc-mem-limit=20000000 --loose-maria-pagecache-buffer-size=1M
diff --git a/mysql-test/t/drop.test b/mysql-test/t/drop.test
index bb4dd3e11f9..66fe3bb03b2 100644
--- a/mysql-test/t/drop.test
+++ b/mysql-test/t/drop.test
@@ -195,9 +195,10 @@ create table `#mysql50#abc``def` ( id int );
--error ER_WRONG_TABLE_NAME
create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (a int);
create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (a int);
-create table `#mysql50#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (a int);
+create table `#mysql50#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1234` (a int);
--error ER_WRONG_TABLE_NAME
-create table `#mysql50#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (a int);
+create table `#mysql50#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa12345` (a int);
+show tables;
use test;
drop database mysqltestbug26703;
diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
index e832ea316eb..926c1f92855 100644
--- a/mysql-test/t/func_gconcat.test
+++ b/mysql-test/t/func_gconcat.test
@@ -708,6 +708,7 @@ SELECT 1 FROM
DROP TABLE t1;
+--echo End of 5.0 tests
--echo #
--echo # Bug #52397: another crash with explain extended and group_concat
@@ -719,5 +720,18 @@ EXPLAIN EXTENDED SELECT 1 FROM
t1 t2, t1 GROUP BY t1.a) AS d;
DROP TABLE t1;
+--echo #
+--echo # Bug #54476: crash when group_concat and 'with rollup' in prepared statements
+--echo #
---echo End of 5.0 tests
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+
+PREPARE stmt FROM "SELECT GROUP_CONCAT(t1.a ORDER BY t1.a) FROM t1 JOIN t1 t2 GROUP BY t1.a WITH ROLLUP";
+EXECUTE stmt;
+EXECUTE stmt;
+
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test
index afce01cac5c..363221f38d8 100644
--- a/mysql-test/t/func_misc.test
+++ b/mysql-test/t/func_misc.test
@@ -279,4 +279,16 @@ select NAME_CONST('_id',1234) as id;
select connection_id() > 0;
+--echo #
+--echo # Bug #54461: crash with longblob and union or update with subquery
+--echo #
+
+CREATE TABLE t1 (a INT, b LONGBLOB);
+INSERT INTO t1 VALUES (1, '2'), (2, '3'), (3, '2');
+
+SELECT DISTINCT LEAST(a, (SELECT b FROM t1 LIMIT 1)) FROM t1 UNION SELECT 1;
+SELECT DISTINCT GREATEST(a, (SELECT b FROM t1 LIMIT 1)) FROM t1 UNION SELECT 1;
+
+DROP TABLE t1;
+
--echo End of tests
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index 5bdb3ebe9bf..65e987dfa24 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -1541,7 +1541,7 @@ connect (con1,localhost,testbug,,db1);
SELECT * FROM `../db2/tb2`;
--error ER_TABLEACCESS_DENIED_ERROR
SELECT * FROM `../db2`.tb2;
---error ER_NO_SUCH_TABLE
+--error ER_WRONG_TABLE_NAME
SELECT * FROM `#mysql50#/../db2/tb2`;
connection default;
disconnect con1;
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index c640a58d597..bfef611d686 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -1238,5 +1238,19 @@ select min(t2.key_col)+1 from t1,t2 where t1.a> 1000;
drop table t1,t2;
--echo #
+--echo # Bug#55188: GROUP BY, GROUP_CONCAT and TEXT - inconsistent results
+--echo #
+
+CREATE TABLE t1 (a text, b varchar(10));
+INSERT INTO t1 VALUES (repeat('1', 1300),'one'), (repeat('1', 1300),'two');
+
+query_vertical EXPLAIN
+SELECT SUBSTRING(a,1,10), LENGTH(a), GROUP_CONCAT(b) FROM t1 GROUP BY a;
+SELECT SUBSTRING(a,1,10), LENGTH(a), GROUP_CONCAT(b) FROM t1 GROUP BY a;
+query_vertical EXPLAIN
+SELECT SUBSTRING(a,1,10), LENGTH(a) FROM t1 GROUP BY a;
+SELECT SUBSTRING(a,1,10), LENGTH(a) FROM t1 GROUP BY a;
+DROP TABLE t1;
+
--echo # End of 5.1 tests
diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test
index 65bf9518a5c..c808e747523 100644
--- a/mysql-test/t/having.test
+++ b/mysql-test/t/having.test
@@ -544,3 +544,24 @@ ORDER BY t1.f2;
DROP TABLE t1,t2;
--echo End of 5.0 tests
+
+--echo #
+--echo # Bug#54416 MAX from JOIN with HAVING returning NULL with 5.1 and Empty set
+--echo #
+
+CREATE TABLE t1 (f1 INT(11), f2 VARCHAR(1), PRIMARY KEY (f1));
+INSERT INTO t1 VALUES (1,'f');
+
+CREATE TABLE t2 (f1 INT(11), f2 VARCHAR(1));
+INSERT INTO t2 VALUES (2,'m');
+INSERT INTO t2 VALUES (3,'m');
+INSERT INTO t2 VALUES (11,NULL);
+INSERT INTO t2 VALUES (12,'k');
+
+SELECT MAX(t1.f1) field1
+FROM t1 JOIN t2 ON t2.f2 LIKE 'x'
+HAVING field1 < 7;
+
+DROP TABLE t1,t2;
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index 4cef8615cd2..e78b180caf7 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -1423,6 +1423,22 @@ FROM INFORMATION_SCHEMA.COLUMNS
WHERE INFORMATION_SCHEMA.COLUMNS.TABLE_NAME = 'variables';
DROP TABLE variables;
+--echo #
+--echo # Bug #53814: NUMERIC_PRECISION for unsigned bigint field is 19,
+--echo # should be 20
+--echo #
+
+CREATE TABLE ubig (a BIGINT, b BIGINT UNSIGNED);
+
+SELECT TABLE_NAME, COLUMN_NAME, NUMERIC_PRECISION
+ FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='ubig';
+
+INSERT INTO ubig VALUES (0xFFFFFFFFFFFFFFFF,0xFFFFFFFFFFFFFFFF);
+SELECT length(CAST(b AS CHAR)) FROM ubig;
+
+DROP TABLE ubig;
+
+
--echo End of 5.1 tests.
# Wait till all disconnects are completed
diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test
index e24f0b16705..53eae4fdfaa 100644
--- a/mysql-test/t/loaddata.test
+++ b/mysql-test/t/loaddata.test
@@ -2,6 +2,8 @@
# Some simple test of load data
#
+-- source include/have_ucs2.inc
+
--disable_warnings
drop table if exists t1, t2;
--enable_warnings
@@ -580,4 +582,36 @@ DROP TABLE t1;
connection default;
disconnect con1;
+
+--echo #
+--echo # Bug #51876 : crash/memory underrun when loading data with ucs2
+--echo # and reverse() function
+--echo #
+
+--echo # Problem # 1 (original report): wrong parsing of ucs2 data
+SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp.txt';
+CREATE TABLE t1(a INT);
+LOAD DATA INFILE 'tmpp.txt' INTO TABLE t1 CHARACTER SET ucs2
+(@b) SET a=REVERSE(@b);
+--echo # should return 2 zeroes (as the value is truncated)
+SELECT * FROM t1;
+
+DROP TABLE t1;
+let $MYSQLD_DATADIR= `select @@datadir`;
+remove_file $MYSQLD_DATADIR/test/tmpp.txt;
+
+
+--echo # Problem # 2 : if you write and read ucs2 data to a file they're lost
+SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp2.txt' CHARACTER SET ucs2;
+CREATE TABLE t1(a INT);
+LOAD DATA INFILE 'tmpp2.txt' INTO TABLE t1 CHARACTER SET ucs2
+(@b) SET a=REVERSE(@b);
+--echo # should return 0 and 1 (10 reversed)
+SELECT * FROM t1;
+
+DROP TABLE t1;
+let $MYSQLD_DATADIR= `select @@datadir`;
+remove_file $MYSQLD_DATADIR/test/tmpp2.txt;
+
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/log_tables_upgrade.test b/mysql-test/t/log_tables_upgrade.test
index 5d1b2b5aed6..a638a27c9d1 100644
--- a/mysql-test/t/log_tables_upgrade.test
+++ b/mysql-test/t/log_tables_upgrade.test
@@ -25,7 +25,7 @@ FLUSH TABLES;
REPAIR TABLE test.bug49823;
RENAME TABLE general_log TO renamed_general_log;
RENAME TABLE test.bug49823 TO general_log;
---exec $MYSQL_UPGRADE --skip-verbose --force 2>&1
+--exec $MYSQL_UPGRADE --force 2>&1
DROP TABLE general_log;
RENAME TABLE renamed_general_log TO general_log;
SET GLOBAL general_log = @saved_general_log;
diff --git a/mysql-test/t/lowercase_view.test b/mysql-test/t/lowercase_view.test
index d6612b3e6b9..52be911cde0 100644
--- a/mysql-test/t/lowercase_view.test
+++ b/mysql-test/t/lowercase_view.test
@@ -160,4 +160,26 @@ SELECT * FROM v1;
DROP VIEW v1;
DROP TABLE t1;
+
+--echo End of 5.0 tests.
+
+
+--echo #
+--echo # Bug #53095: SELECT column_name FROM INFORMATION_SCHEMA.STATISTICS
+--echo # returns nothing
+--echo #
+
+CREATE TABLE `ttt` (
+ `f1` char(3) NOT NULL,
+ PRIMARY KEY (`f1`)
+) ENGINE=myisam DEFAULT CHARSET=latin1;
+
+SELECT count(COLUMN_NAME) FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME =
+'TTT';
+SELECT count(*) FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_NAME = 'TTT';
+
+DROP TABLE `ttt`;
+
+
--echo End of 5.0 tests.
+
diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test
index 15c0cd4ac84..41670117c7c 100644
--- a/mysql-test/t/mysql_client_test.test
+++ b/mysql-test/t/mysql_client_test.test
@@ -2,6 +2,7 @@
-- source include/not_embedded.inc
SET @old_general_log= @@global.general_log;
+SET @old_slow_query_log= @@global.slow_query_log;
# We run with different binaries for normal and --embedded-server
#
@@ -17,3 +18,4 @@ SET @old_general_log= @@global.general_log;
echo ok;
SET @@global.general_log= @old_general_log;
+SET @@global.slow_query_log= @old_slow_query_log;
diff --git a/mysql-test/t/mysql_upgrade.test b/mysql-test/t/mysql_upgrade.test
index 485302600c1..ea127fbcc6d 100644
--- a/mysql-test/t/mysql_upgrade.test
+++ b/mysql-test/t/mysql_upgrade.test
@@ -33,7 +33,7 @@ if (`SELECT $VALGRIND_TEST`)
# expected binaries it uses.
#
--echo Run mysql_upgrade once
---exec $MYSQL_UPGRADE --skip-verbose --force 2>&1
+--exec $MYSQL_UPGRADE --force 2>&1
# It should have created a file in the MySQL Servers datadir
let $MYSQLD_DATADIR= `select @@datadir`;
@@ -42,13 +42,13 @@ file_exists $MYSQLD_DATADIR/mysql_upgrade_info;
--echo Run it again - should say already completed
--replace_result $MYSQL_SERVER_VERSION VERSION
--error 1
---exec $MYSQL_UPGRADE --skip-verbose 2>&1
+--exec $MYSQL_UPGRADE 2>&1
# It should have created a file in the MySQL Servers datadir
file_exists $MYSQLD_DATADIR/mysql_upgrade_info;
--echo Force should run it regardless of wether it's been run before
---exec $MYSQL_UPGRADE --skip-verbose --force 2>&1
+--exec $MYSQL_UPGRADE --force 2>&1
# It should have created a file in the MySQL Servers datadir
file_exists $MYSQLD_DATADIR/mysql_upgrade_info;
@@ -63,7 +63,7 @@ file_exists $MYSQLD_DATADIR/mysql_upgrade_info;
CREATE USER mysqltest1@'%' IDENTIFIED by 'sakila';
GRANT ALL ON *.* TO mysqltest1@'%';
--echo Run mysql_upgrade with password protected account
---exec $MYSQL_UPGRADE --skip-verbose --force --user=mysqltest1 --password=sakila 2>&1
+--exec $MYSQL_UPGRADE --force --user=mysqltest1 --password=sakila 2>&1
DROP USER mysqltest1@'%';
@@ -76,7 +76,7 @@ DROP USER mysqltest1@'%';
--replace_result $MYSQLTEST_VARDIR var
--replace_regex /.*mysqlcheck.*: Got/mysqlcheck: Got/ /\([0-9]*\)/(errno)/
--error 1
---exec $MYSQL_UPGRADE --skip-verbose --force --host=not_existing_host 2>&1
+--exec $MYSQL_UPGRADE --force --host=not_existing_host 2>&1
#
# Bug #28401 mysql_upgrade Failed with STRICT_ALL_TABLES, ANSI_QUOTES and NO_ZERO_DATE
@@ -88,7 +88,7 @@ DROP USER mysqltest1@'%';
# Test by setting sql_mode before running mysql_upgrade
set GLOBAL sql_mode='STRICT_ALL_TABLES,ANSI_QUOTES,NO_ZERO_DATE';
---exec $MYSQL_UPGRADE --skip-verbose --force 2>&1
+--exec $MYSQL_UPGRADE --force 2>&1
eval set GLOBAL sql_mode=default;
@@ -104,8 +104,24 @@ CREATE PROCEDURE testproc() BEGIN END;
UPDATE mysql.proc SET character_set_client = NULL WHERE name LIKE 'testproc';
UPDATE mysql.proc SET collation_connection = NULL WHERE name LIKE 'testproc';
UPDATE mysql.proc SET db_collation = NULL WHERE name LIKE 'testproc';
---exec $MYSQL_UPGRADE --skip-verbose --force 2> $MYSQLTEST_VARDIR/tmp/41569.txt
+--exec $MYSQL_UPGRADE --force 2> $MYSQLTEST_VARDIR/tmp/41569.txt
CALL testproc();
DROP PROCEDURE testproc;
--cat_file $MYSQLTEST_VARDIR/tmp/41569.txt
--remove_file $MYSQLTEST_VARDIR/tmp/41569.txt
+
+
+--echo #
+--echo # Bug #53613: mysql_upgrade incorrectly revokes
+--echo # TRIGGER privilege on given table
+--echo #
+
+GRANT USAGE ON *.* TO 'user3'@'%';
+GRANT ALL PRIVILEGES ON `roelt`.`test2` TO 'user3'@'%';
+--echo Run mysql_upgrade with all privileges on a user
+--exec $MYSQL_UPGRADE --force 2>&1
+SHOW GRANTS FOR 'user3'@'%';
+
+DROP USER 'user3'@'%';
+
+--echo End of 5.1 tests
diff --git a/mysql-test/t/mysqltest_ps.test b/mysql-test/t/mysqltest_ps.test
index c91f6dcb409..c5a332f691f 100644
--- a/mysql-test/t/mysqltest_ps.test
+++ b/mysql-test/t/mysqltest_ps.test
@@ -4,7 +4,7 @@
if (`SELECT $PS_PROTOCOL = 0`)
{
- --skip Need prepared statement protocol
+ --skip Need ps-protocol
}
#
diff --git a/mysql-test/t/ssl_8k_key-master.opt b/mysql-test/t/ssl_8k_key-master.opt
new file mode 100644
index 00000000000..b58ca7f39f0
--- /dev/null
+++ b/mysql-test/t/ssl_8k_key-master.opt
@@ -0,0 +1 @@
+--loose-ssl-key=$MYSQL_TEST_DIR/std_data/server8k-key.pem --loose-ssl-cert=$MYSQL_TEST_DIR/std_data/server8k-cert.pem
diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test
index f6708828a6b..c515f8873d8 100644
--- a/mysql-test/t/update.test
+++ b/mysql-test/t/update.test
@@ -483,3 +483,23 @@ UPDATE IGNORE v1 SET a = 1;
SET SESSION sql_safe_updates = DEFAULT;
DROP TABLE t1;
DROP VIEW v1;
+
+--echo #
+--echo # Bug#54734 assert in Diagnostics_area::set_ok_status
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1, not_exists;
+DROP FUNCTION IF EXISTS f1;
+DROP VIEW IF EXISTS v1;
+--enable_warnings
+
+CREATE TABLE t1 (PRIMARY KEY(pk)) AS SELECT 1 AS pk;
+CREATE FUNCTION f1() RETURNS INTEGER RETURN (SELECT 1 FROM not_exists);
+CREATE VIEW v1 AS SELECT pk FROM t1 WHERE f1() = 13;
+--error ER_VIEW_INVALID
+UPDATE v1 SET pk = 7 WHERE pk > 0;
+
+DROP VIEW v1;
+DROP FUNCTION f1;
+DROP TABLE t1;
diff --git a/mysql-test/t/upgrade.test b/mysql-test/t/upgrade.test
index a7b9a1531ff..8e6eed60242 100644
--- a/mysql-test/t/upgrade.test
+++ b/mysql-test/t/upgrade.test
@@ -169,5 +169,16 @@ USE `#mysql50#.`;
--error ER_WRONG_DB_NAME
USE `#mysql50#../blablabla`;
+#
+# Test of Bug #56441: mysql_upgrade 5.0->5.1 fails for tables with long names
+#
+copy_file $MYSQL_TEST_DIR/std_data/long_table_name.MYI $MYSQLD_DATADIR/test/ltoriaeinnovacionendesarrolloempres?9120761097220077376?cio_com.MYI;
+copy_file $MYSQL_TEST_DIR/std_data/long_table_name.MYD $MYSQLD_DATADIR/test/ltoriaeinnovacionendesarrolloempres?9120761097220077376?cio_com.MYD;
+copy_file $MYSQL_TEST_DIR/std_data/long_table_name.frm $MYSQLD_DATADIR/test/ltoriaeinnovacionendesarrolloempres?9120761097220077376?cio_com.frm;
+show full tables;
+rename table `#mysql50#ltoriaeinnovacionendesarrolloempres?9120761097220077376?cio_com` to `ltoriaeinnovacionendesarrolloempres?9120761097220077376?cio_com`;
+show full tables;
+drop table `ltoriaeinnovacionendesarrolloempres?9120761097220077376?cio_com`;
+
--echo # End of 5.1 tests