summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <gshchepa/uchum@host.loc>2008-03-27 20:05:51 +0400
committerunknown <gshchepa/uchum@host.loc>2008-03-27 20:05:51 +0400
commit8e473edd486e35cd80617db5220c89e933995a56 (patch)
tree00822f3ce8fa3bc1d7558dba317e47e06b0a8636 /mysql-test
parent4eaa7303fc56a0a9c0d2b3e27b17436cea5f47a8 (diff)
parent1207c8664452405748a1e02cd80644540e225ee2 (diff)
downloadmariadb-git-8e473edd486e35cd80617db5220c89e933995a56.tar.gz
Merge host.loc:/home/uchum/work/mysql-5.0
into host.loc:/home/uchum/work/5.0-opt configure.in: Auto merged sql/item.cc: Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/flush.result1
-rw-r--r--mysql-test/r/func_group.result6
-rw-r--r--mysql-test/r/information_schema.result13
-rw-r--r--mysql-test/r/sp-code.result28
-rw-r--r--mysql-test/r/subselect3.result13
-rw-r--r--mysql-test/r/view.result18
-rw-r--r--mysql-test/t/flush.test9
-rw-r--r--mysql-test/t/func_group.test10
-rw-r--r--mysql-test/t/information_schema.test27
-rw-r--r--mysql-test/t/sp-code.test32
-rw-r--r--mysql-test/t/subselect3.test19
-rw-r--r--mysql-test/t/view.test23
12 files changed, 194 insertions, 5 deletions
diff --git a/mysql-test/r/flush.result b/mysql-test/r/flush.result
index ce64e09c1d3..778f138f29d 100644
--- a/mysql-test/r/flush.result
+++ b/mysql-test/r/flush.result
@@ -72,3 +72,4 @@ flush tables with read lock;
unlock tables;
drop table t1, t2;
set session low_priority_updates=default;
+select benchmark(200, (select sin(1))) > 1000;
diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result
index 4785ca9919d..772e432355b 100644
--- a/mysql-test/r/func_group.result
+++ b/mysql-test/r/func_group.result
@@ -1419,4 +1419,10 @@ Note 1003 select (`test`.`t1`.`a` + 1) AS `y` from `test`.`t1` group by (`test`.
DROP VIEW v1;
DROP TABLE t1;
SET SQL_MODE=DEFAULT;
+CREATE TABLE t1(a DOUBLE);
+INSERT INTO t1 VALUES (10), (20);
+SELECT AVG(a), CAST(AVG(a) AS DECIMAL) FROM t1;
+AVG(a) CAST(AVG(a) AS DECIMAL)
+15 15
+DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index 80f85aee429..d7ff87bd1eb 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -1417,8 +1417,19 @@ select * from `information_schema`.`VIEWS` where `TABLE_SCHEMA` = NULL;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
select * from `information_schema`.`VIEWS` where `TABLE_NAME` = NULL;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
-End of 5.0 tests.
show fields from information_schema.table_names;
ERROR 42S02: Unknown table 'table_names' in information_schema
show keys from information_schema.table_names;
ERROR 42S02: Unknown table 'table_names' in information_schema
+USE information_schema;
+SET max_heap_table_size = 16384;
+CREATE TABLE test.t1( a INT );
+SELECT *
+FROM tables ta
+JOIN collations co ON ( co.collation_name = ta.table_catalog )
+JOIN character_sets cs ON ( cs.character_set_name = ta.table_catalog );
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN CHARACTER_SET_NAME DEFAULT_COLLATE_NAME DESCRIPTION MAXLEN
+DROP TABLE test.t1;
+SET max_heap_table_size = DEFAULT;
+USE test;
+End of 5.0 tests.
diff --git a/mysql-test/r/sp-code.result b/mysql-test/r/sp-code.result
index 855cabc25d8..2848306b442 100644
--- a/mysql-test/r/sp-code.result
+++ b/mysql-test/r/sp-code.result
@@ -842,4 +842,32 @@ Pos Instruction
21 jump 3
drop procedure proc_33618_h;
drop procedure proc_33618_c;
+drop procedure if exists p_20906_a;
+drop procedure if exists p_20906_b;
+create procedure p_20906_a() SET @a=@a+1, @b=@b+1;
+show procedure code p_20906_a;
+Pos Instruction
+0 stmt 32 "SET @a=@a+1"
+1 stmt 32 "SET @b=@b+1"
+set @a=1;
+set @b=1;
+call p_20906_a();
+select @a, @b;
+@a @b
+2 2
+create procedure p_20906_b() SET @a=@a+1, @b=@b+1, @c=@c+1;
+show procedure code p_20906_b;
+Pos Instruction
+0 stmt 32 "SET @a=@a+1"
+1 stmt 32 "SET @b=@b+1"
+2 stmt 32 "SET @c=@c+1"
+set @a=1;
+set @b=1;
+set @c=1;
+call p_20906_b();
+select @a, @b, @c;
+@a @b @c
+2 2 2
+drop procedure p_20906_a;
+drop procedure p_20906_b;
End of 5.0 tests.
diff --git a/mysql-test/r/subselect3.result b/mysql-test/r/subselect3.result
index bdf00e4c307..c194ba33756 100644
--- a/mysql-test/r/subselect3.result
+++ b/mysql-test/r/subselect3.result
@@ -758,5 +758,16 @@ EXPLAIN SELECT a FROM t1 WHERE a NOT IN (SELECT a FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
2 DEPENDENT SUBQUERY t2 unique_subquery PRIMARY PRIMARY 4 func 1 Using index; Using where
-DROP TABLE t1;
+DROP TABLE t1, t2;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES(1);
+CREATE TABLE t2 (placeholder CHAR(11));
+INSERT INTO t2 VALUES("placeholder");
+SELECT ROW(1, 2) IN (SELECT t1.a, 2) FROM t1 GROUP BY t1.a;
+ROW(1, 2) IN (SELECT t1.a, 2)
+1
+SELECT ROW(1, 2) IN (SELECT t1.a, 2 FROM t2) FROM t1 GROUP BY t1.a;
+ROW(1, 2) IN (SELECT t1.a, 2 FROM t2)
+1
+DROP TABLE t1, t2;
End of 5.0 tests
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 520bf9426b8..eb7a89c3d12 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -3660,5 +3660,23 @@ DROP TABLE t1;
# -- End of test case for Bug#34337.
# -----------------------------------------------------------------
+# -- Bug#35193: VIEW query is rewritten without "FROM DUAL",
+# -- causing syntax error
+# -----------------------------------------------------------------
+
+CREATE VIEW v1 AS SELECT 1 FROM DUAL WHERE 1;
+
+SELECT * FROM v1;
+1
+1
+SHOW CREATE TABLE v1;
+View Create View
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 AS `1` from DUAL where 1
+
+DROP VIEW v1;
+
+# -- End of test case for Bug#35193.
+
+# -----------------------------------------------------------------
# -- End of 5.0 tests.
# -----------------------------------------------------------------
diff --git a/mysql-test/t/flush.test b/mysql-test/t/flush.test
index 72efa8a2ee6..4c6d4265600 100644
--- a/mysql-test/t/flush.test
+++ b/mysql-test/t/flush.test
@@ -164,4 +164,13 @@ drop table t1, t2;
set session low_priority_updates=default;
+#
+# Bug #33334 mysqltest_embedded crashes when disconnecting before reap
+#
+
+connect (con1,localhost,root,,);
+send select benchmark(200, (select sin(1))) > 1000;
+disconnect con1;
+connection default;
+
# End of 5.0 tests
diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test
index 75a380c733f..dbe6d3113d5 100644
--- a/mysql-test/t/func_group.test
+++ b/mysql-test/t/func_group.test
@@ -916,5 +916,15 @@ DROP VIEW v1;
DROP TABLE t1;
SET SQL_MODE=DEFAULT;
+#
+# Bug #34512: CAST( AVG( double ) AS DECIMAL ) returns wrong results
+#
+
+CREATE TABLE t1(a DOUBLE);
+INSERT INTO t1 VALUES (10), (20);
+SELECT AVG(a), CAST(AVG(a) AS DECIMAL) FROM t1;
+
+DROP TABLE t1;
+
###
--echo End of 5.0 tests
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index 3d3310e389e..caf38945cbc 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -1108,8 +1108,6 @@ select * from `information_schema`.`TRIGGERS` where `EVENT_OBJECT_TABLE` = NULL;
select * from `information_schema`.`VIEWS` where `TABLE_SCHEMA` = NULL;
select * from `information_schema`.`VIEWS` where `TABLE_NAME` = NULL;
---echo End of 5.0 tests.
-
#
# Bug#30079 A check for "hidden" I_S tables is flawed
#
@@ -1118,3 +1116,28 @@ show fields from information_schema.table_names;
--error 1109
show keys from information_schema.table_names;
+#
+# Bug#34529: Crash on complex Falcon I_S select after ALTER .. PARTITION BY
+#
+USE information_schema;
+SET max_heap_table_size = 16384;
+
+CREATE TABLE test.t1( a INT );
+
+# What we need to create here is a bit of a corner case:
+# We need a star query with information_schema tables, where the first
+# branch of the star join produces zero rows, so that reading of the
+# second branch never happens. At the same time we have to make sure
+# that data for at least the last table is swapped from MEMORY/HEAP to
+# MyISAM. This and only this triggers the bug.
+SELECT *
+FROM tables ta
+JOIN collations co ON ( co.collation_name = ta.table_catalog )
+JOIN character_sets cs ON ( cs.character_set_name = ta.table_catalog );
+
+DROP TABLE test.t1;
+SET max_heap_table_size = DEFAULT;
+USE test;
+
+--echo End of 5.0 tests.
+
diff --git a/mysql-test/t/sp-code.test b/mysql-test/t/sp-code.test
index 751282c895a..a76863dd5fa 100644
--- a/mysql-test/t/sp-code.test
+++ b/mysql-test/t/sp-code.test
@@ -598,4 +598,36 @@ show procedure code proc_33618_c;
drop procedure proc_33618_h;
drop procedure proc_33618_c;
+#
+# Bug#20906 (Multiple assignments in SET in stored routine produce incorrect
+# instructions)
+#
+
+--disable_warnings
+drop procedure if exists p_20906_a;
+drop procedure if exists p_20906_b;
+--enable_warnings
+
+create procedure p_20906_a() SET @a=@a+1, @b=@b+1;
+show procedure code p_20906_a;
+
+set @a=1;
+set @b=1;
+
+call p_20906_a();
+select @a, @b;
+
+create procedure p_20906_b() SET @a=@a+1, @b=@b+1, @c=@c+1;
+show procedure code p_20906_b;
+
+set @a=1;
+set @b=1;
+set @c=1;
+
+call p_20906_b();
+select @a, @b, @c;
+
+drop procedure p_20906_a;
+drop procedure p_20906_b;
+
--echo End of 5.0 tests.
diff --git a/mysql-test/t/subselect3.test b/mysql-test/t/subselect3.test
index 2f844c9cc21..cfbde8c29cd 100644
--- a/mysql-test/t/subselect3.test
+++ b/mysql-test/t/subselect3.test
@@ -586,6 +586,23 @@ SELECT a FROM t1 WHERE a NOT IN (65,66);
SELECT a FROM t1 WHERE a NOT IN (SELECT a FROM t2);
EXPLAIN SELECT a FROM t1 WHERE a NOT IN (SELECT a FROM t2);
-DROP TABLE t1;
+DROP TABLE t1, t2;
+
+#
+# Bug #34763: item_subselect.cc:1235:Item_in_subselect::row_value_transformer:
+# Assertion failed, unexpected error message:
+# ERROR 1247 (42S22): Reference '<list ref>' not supported (forward
+# reference in item list)
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES(1);
+
+CREATE TABLE t2 (placeholder CHAR(11));
+INSERT INTO t2 VALUES("placeholder");
+
+SELECT ROW(1, 2) IN (SELECT t1.a, 2) FROM t1 GROUP BY t1.a;
+SELECT ROW(1, 2) IN (SELECT t1.a, 2 FROM t2) FROM t1 GROUP BY t1.a;
+
+DROP TABLE t1, t2;
--echo End of 5.0 tests
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 23e64b0546f..9fa981ccb9a 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -3538,5 +3538,28 @@ DROP TABLE t1;
###########################################################################
--echo # -----------------------------------------------------------------
+--echo # -- Bug#35193: VIEW query is rewritten without "FROM DUAL",
+--echo # -- causing syntax error
+--echo # -----------------------------------------------------------------
+--echo
+
+CREATE VIEW v1 AS SELECT 1 FROM DUAL WHERE 1;
+
+--echo
+
+SELECT * FROM v1;
+SHOW CREATE TABLE v1;
+
+--echo
+
+DROP VIEW v1;
+
+--echo
+--echo # -- End of test case for Bug#35193.
+--echo
+
+###########################################################################
+
+--echo # -----------------------------------------------------------------
--echo # -- End of 5.0 tests.
--echo # -----------------------------------------------------------------