summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorunknown <kaa@kaamos.(none)>2008-02-17 14:57:01 +0300
committerunknown <kaa@kaamos.(none)>2008-02-17 14:57:01 +0300
commit695865fee9566bc026858214e8717a8155505a5a (patch)
tree32ec9a2109f5937fa7bbd8c249cb71d6546ed347 /mysql-test/t
parent410e2d64d14fc2ea5193fc0111142aca182ed348 (diff)
parentd740f5c67567479149d2aea524b2463748f3b7ac (diff)
downloadmariadb-git-695865fee9566bc026858214e8717a8155505a5a.tar.gz
Merge kaamos.(none):/data/src/mysql-5.1
into kaamos.(none):/data/src/opt/mysql-5.1-opt libmysqld/lib_sql.cc: Auto merged mysql-test/r/create.result: Auto merged mysql-test/r/innodb_mysql.result: Auto merged mysql-test/r/variables.result: Auto merged BitKeeper/deleted/.del-rpl_ndb_charset.result: Auto merged BitKeeper/deleted/.del-rpl_row_charset.result: Auto merged BitKeeper/deleted/.del-rpl_row_charset.test: Auto merged BitKeeper/deleted/.del-rpl_row_charset_innodb.result: Auto merged mysql-test/t/create.test: Auto merged mysql-test/t/sp.test: Auto merged mysql-test/t/variables.test: Auto merged sql/field.cc: Auto merged sql/filesort.cc: Auto merged sql/handler.cc: Auto merged sql/item.cc: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.cc: Auto merged sql/mysqld.cc: Auto merged sql/sql_acl.cc: Auto merged sql/share/errmsg.txt: Auto merged sql/sql_select.cc: Auto merged sql/sql_yacc.yy: Auto merged mysql-test/lib/mtr_report.pl: Manual merge. mysql-test/r/sp.result: Manual merge.
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/create.test24
-rw-r--r--mysql-test/t/grant3.test26
-rw-r--r--mysql-test/t/order_by.test11
-rw-r--r--mysql-test/t/range.test17
-rw-r--r--mysql-test/t/select.test11
-rw-r--r--mysql-test/t/sp.test19
-rw-r--r--mysql-test/t/type_set.test20
-rw-r--r--mysql-test/t/view.test22
-rw-r--r--mysql-test/t/warnings.test33
9 files changed, 183 insertions, 0 deletions
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index 09170cbc4f5..5775adce34b 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -1152,6 +1152,30 @@ create table t2 select sql_big_result f1,count(f2) from t1 group by f1;
show status like 'handler_read%';
drop table t1,t2;
+#
+# Bug #25162: Backing up DB from 5.1 adds 'USING BTREE' to KEYs on table creates
+#
+
+# Show that the old syntax for index type is supported
+CREATE TABLE t1(c1 VARCHAR(33), KEY USING BTREE (c1));
+DROP TABLE t1;
+
+# Show that the new syntax for index type is supported
+CREATE TABLE t1(c1 VARCHAR(33), KEY (c1) USING BTREE);
+DROP TABLE t1;
+
+# Show that in case of multiple index type definitions, the last one takes
+# precedence
+
+CREATE TABLE t1(c1 VARCHAR(33), KEY USING BTREE (c1) USING HASH) ENGINE=MEMORY;
+SHOW INDEX FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1(c1 VARCHAR(33), KEY USING HASH (c1) USING BTREE) ENGINE=MEMORY;
+SHOW INDEX FROM t1;
+DROP TABLE t1;
+
+
--echo End of 5.0 tests
#
diff --git a/mysql-test/t/grant3.test b/mysql-test/t/grant3.test
index fac577ef0ff..8eceb851c29 100644
--- a/mysql-test/t/grant3.test
+++ b/mysql-test/t/grant3.test
@@ -134,3 +134,29 @@ SELECT user, host, db, select_priv FROM mysql.db where user = 'CUser2' order by
DROP USER CUser2@localhost;
DROP USER CUser2@LOCALHOST;
+
+
+#
+# Bug#31194: Privilege ordering does not order properly for wildcard values
+#
+
+CREATE DATABASE mysqltest_1;
+CREATE TABLE mysqltest_1.t1 (a INT);
+CREATE USER 'mysqltest1'@'%';
+GRANT SELECT, UPDATE ON `mysqltest_1`.* TO 'mysqltest1'@'%';
+REVOKE SELECT ON `mysqltest_1`.* FROM 'mysqltest1'@'%';
+GRANT SELECT, UPDATE ON `mysqltest\_1`.* TO 'mysqltest1'@'%';
+FLUSH PRIVILEGES;
+
+connect (conn1,localhost,mysqltest1,,);
+connection conn1;
+SHOW GRANTS;
+SELECT * FROM mysqltest_1.t1;
+disconnect conn1;
+
+connection default;
+DROP USER 'mysqltest1'@'%';
+DROP DATABASE mysqltest_1;
+
+
+--echo End of 5.0 tests
diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test
index 71238504d36..898742c2682 100644
--- a/mysql-test/t/order_by.test
+++ b/mysql-test/t/order_by.test
@@ -836,3 +836,14 @@ eval set @tmp_tables_after =
SELECT @tmp_tables_after = @tmp_tables_before;
DROP TABLE t1;
+--echo #
+--echo # Bug#31590: Wrong error message on sort buffer being too small.
+--echo #
+create table t1(a int, b tinytext);
+insert into t1 values (1,2),(3,2);
+set session sort_buffer_size= 30000;
+set session max_sort_length= 2180;
+--error 1038
+select * from t1 order by b;
+drop table t1;
+
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test
index e20f0370e2c..514e3074292 100644
--- a/mysql-test/t/range.test
+++ b/mysql-test/t/range.test
@@ -955,6 +955,23 @@ explain select * from t1 where dateval >= '2007-01-01 00:00:00' and dateval <= '
drop table t1;
+#
+# Bug #33833: different or-ed predicates were erroneously merged into one that
+# resulted in ref access instead of range access and a wrong result set
+#
+
+CREATE TABLE t1 (
+ a varchar(32), index (a)
+) DEFAULT CHARSET=latin1 COLLATE=latin1_bin;
+
+INSERT INTO t1 VALUES
+ ('B'), ('A'), ('A'), ('C'), ('B'), ('A'), ('A');
+
+SELECT a FROM t1 WHERE a='b' OR a='B';
+EXPLAIN SELECT a FROM t1 WHERE a='b' OR a='B';
+
+DROP TABLE t1;
+
# End of 5.0 tests
# BUG#22393 fix: Adjust 'ref' estimate if we have 'range' estimate for
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index bc0e4ae307f..b680c3642a6 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -3661,6 +3661,17 @@ DROP TABLE t1;
--echo
+###########################################################################
+
+#
+# Bug #33764: Wrong result with IN(), CONCAT() and implicit type conversion
+#
+
+CREATE TABLE t1 (a VARCHAR(10) NOT NULL PRIMARY KEY);
+INSERT INTO t1 (a) VALUES ('foo0'), ('bar0'), ('baz0');
+SELECT * FROM t1 WHERE a IN (CONCAT('foo', 0), 'bar');
+DROP TABLE t1;
+
--echo End of 5.0 tests
#
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index bb9aae6dee6..b9f5572864e 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -7900,6 +7900,25 @@ DROP DATABASE db28318_a;
DROP DATABASE db28318_b;
use test;
+--echo #
+--echo # Bug#30787: Stored function ignores user defined alias.
+--echo #
+use test;
+--disable_warnings
+drop function if exists func30787;
+--enable_warnings
+create table t1(f1 int);
+insert into t1 values(1),(2);
+delimiter |;
+create function func30787(p1 int) returns int
+begin
+ return p1;
+end |
+delimiter ;|
+select (select func30787(f1)) as ttt from t1;
+drop function func30787;
+drop table t1;
+
###########################################################################
#
diff --git a/mysql-test/t/type_set.test b/mysql-test/t/type_set.test
index b1c816f3371..c7f8c59de28 100644
--- a/mysql-test/t/type_set.test
+++ b/mysql-test/t/type_set.test
@@ -56,3 +56,23 @@ set('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17',
'50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','1'));
show create table t1;
drop table t1;
+
+#
+# Bug#15409: Columns with SET datatype with 64-element sets
+# may not be updated with integers
+#
+
+let $i=64;
+let $s='$i';
+dec $i;
+while ($i) {
+ let $s='$i',$s;
+ dec $i;
+}
+--eval CREATE TABLE t1(c set($s))
+INSERT INTO t1 VALUES(7);
+INSERT INTO t1 VALUES(9223372036854775808);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--# echo End of 5.0 tests
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 58ef9c1eff1..dffb6f89e73 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -3468,6 +3468,27 @@ set @@sql_mode=@old_mode;
drop view v1;
drop table t1;
+#
+# Bug #33389: Selecting from a view into a table from within SP or trigger
+# crashes server
+#
+
+create table t1 (a int, key(a));
+create table t2 (c int);
+
+create view v1 as select a b from t1;
+create view v2 as select 1 a from t2, v1 where c in
+ (select 1 from t1 where b = a);
+
+insert into t1 values (1), (1);
+insert into t2 values (1), (1);
+
+prepare stmt from "select * from v2 where a = 1";
+execute stmt;
+
+drop view v1, v2;
+drop table t1, t2;
+
--echo End of 5.0 tests.
#
@@ -3541,3 +3562,4 @@ DROP TABLE t1;
--echo
--echo End of 5.1 tests.
+
diff --git a/mysql-test/t/warnings.test b/mysql-test/t/warnings.test
index d0eaaf1a764..9e7e3e4f945 100644
--- a/mysql-test/t/warnings.test
+++ b/mysql-test/t/warnings.test
@@ -193,4 +193,37 @@ DROP PROCEDURE sp1;
DROP PROCEDURE sp2;
DROP PROCEDURE sp3;
+
+#
+# Bug#30059: End-space truncation warnings are inconsistent or incorrect
+#
+
+create table t1 (c_char char(255), c_varchar varchar(255), c_tinytext tinytext);
+create table t2 (c_tinyblob tinyblob); # not affected by bug, for regression testing
+set @c = repeat(' ', 256);
+set @q = repeat('q', 256);
+
+set sql_mode = '';
+
+insert into t1 values(@c, @c, @c);
+insert into t2 values(@c);
+insert into t1 values(@q, @q, @q);
+insert into t2 values(@q);
+
+set sql_mode = 'traditional';
+
+insert into t1 values(@c, @c, @c);
+--error 1406
+insert into t2 values(@c);
+--error 1406
+insert into t1 values(@q, NULL, NULL);
+--error 1406
+insert into t1 values(NULL, @q, NULL);
+--error 1406
+insert into t1 values(NULL, NULL, @q);
+--error 1406
+insert into t2 values(@q);
+
+drop table t1, t2;
+
--echo End of 5.0 tests