diff options
author | Matthias Leich <Matthias.Leich@sun.com> | 2008-11-28 19:47:08 +0100 |
---|---|---|
committer | Matthias Leich <Matthias.Leich@sun.com> | 2008-11-28 19:47:08 +0100 |
commit | 58288b69394852e63fc8322d20acfa80c1a36941 (patch) | |
tree | 388b8c52c3422d424d06fc91aae0197ca006dfe6 /mysql-test | |
parent | ddf5c19272e8e3353e9fd95359d2d5d22e3a413b (diff) | |
parent | 41ccbefcc4cbf75c18e37746bd52617f6c9794b9 (diff) | |
download | mariadb-git-58288b69394852e63fc8322d20acfa80c1a36941.tar.gz |
Merge of last pushes into GCA tree, no conflicts
Diff to actual 5.0-bugteam is revno: 2725 only
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/ctype_filesystem.result | 11 | ||||
-rw-r--r-- | mysql-test/r/func_sapdb.result | 12 | ||||
-rw-r--r-- | mysql-test/r/innodb_mysql.result | 6 | ||||
-rw-r--r-- | mysql-test/r/perror-win.result | 6 | ||||
-rw-r--r-- | mysql-test/r/subselect.result | 30 | ||||
-rw-r--r-- | mysql-test/r/view.result | 33 | ||||
-rw-r--r-- | mysql-test/t/ctype_filesystem-master.opt | 2 | ||||
-rw-r--r-- | mysql-test/t/ctype_filesystem.test | 5 | ||||
-rw-r--r-- | mysql-test/t/func_sapdb.test | 17 | ||||
-rw-r--r-- | mysql-test/t/innodb_mysql.test | 11 | ||||
-rw-r--r-- | mysql-test/t/perror-win.test | 14 | ||||
-rw-r--r-- | mysql-test/t/subselect.test | 35 | ||||
-rw-r--r-- | mysql-test/t/view.test | 34 |
13 files changed, 208 insertions, 8 deletions
diff --git a/mysql-test/r/ctype_filesystem.result b/mysql-test/r/ctype_filesystem.result new file mode 100644 index 00000000000..8a8f0f7f8cc --- /dev/null +++ b/mysql-test/r/ctype_filesystem.result @@ -0,0 +1,11 @@ +SET CHARACTER SET utf8; +SHOW VARIABLES like 'character_sets_dir'; +Variable_name Value +character_sets_dir /ß/ +SHOW VARIABLES like 'character_set_filesystem'; +Variable_name Value +character_set_filesystem latin1 +SHOW VARIABLES like 'character_set_client'; +Variable_name Value +character_set_client utf8 +SET CHARACTER SET default; diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result index 4db0416bdce..a06d7004908 100644 --- a/mysql-test/r/func_sapdb.result +++ b/mysql-test/r/func_sapdb.result @@ -256,3 +256,15 @@ a select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f"); str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f") 2003-01-02 10:11:12.001200 +select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10'),time('00:00:00'); +timediff('2008-09-29 20:10:10','2008-09-30 20:10:10') time('00:00:00') +-24:00:00 00:00:00 +select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')>time('00:00:00'); +timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')>time('00:00:00') +0 +select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')<time('00:00:00'); +timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')<time('00:00:00') +1 +SELECT CAST(time('-73:42:12') AS DECIMAL); +CAST(time('-73:42:12') AS DECIMAL) +-734212 diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result index 47fa331c9ab..682cc2e82e2 100644 --- a/mysql-test/r/innodb_mysql.result +++ b/mysql-test/r/innodb_mysql.result @@ -1261,4 +1261,10 @@ a b c 5 1 1 4 1 1 DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a char(50)) ENGINE=InnoDB; +CREATE INDEX i1 on t1 (a(3)); +SELECT * FROM t1 WHERE a = 'abcde'; +a +DROP TABLE t1; End of 5.0 tests diff --git a/mysql-test/r/perror-win.result b/mysql-test/r/perror-win.result new file mode 100644 index 00000000000..1d42235cc14 --- /dev/null +++ b/mysql-test/r/perror-win.result @@ -0,0 +1,6 @@ +MySQL error code 150: Foreign key constraint is incorrectly formed +Win32 error code 150: System trace information was not specified in your CONFIG.SYS file, or tracing is disallowed.
+OS error code 23: Too many open files in system +Win32 error code 23: Data error (cyclic redundancy check).
+Win32 error code 1062: The service has not been started.
+Illegal error code: 30000 diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 6eeb652e3c1..8830ea11f97 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -4422,4 +4422,34 @@ id 2 3 DROP TABLE t1, t2; +CREATE TABLE t1 (id int); +CREATE TABLE t2 (id int, c int); +INSERT INTO t1 (id) VALUES (1); +INSERT INTO t2 (id) VALUES (1); +INSERT INTO t1 (id) VALUES (1); +INSERT INTO t2 (id) VALUES (1); +CREATE VIEW v1 AS +SELECT t2.c AS c FROM t1, t2 +WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION; +UPDATE v1 SET c=1; +CREATE VIEW v2 (a,b) AS +SELECT t2.id, t2.c AS c FROM t1, t2 +WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION; +INSERT INTO v2(a,b) VALUES (2,2); +ERROR HY000: CHECK OPTION failed 'test.v2' +INSERT INTO v2(a,b) VALUES (1,2); +SELECT * FROM v1; +c +1 +1 +1 +1 +2 +2 +CREATE VIEW v3 AS +SELECT t2.c AS c FROM t2 +WHERE 1 IN (SELECT id FROM t1) WITH CHECK OPTION; +DELETE FROM v3; +DROP VIEW v1,v2,v3; +DROP TABLE t1,t2; End of 5.0 tests. diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 8cbe3fc36cf..311b77e7a99 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -625,7 +625,7 @@ drop table t1; create table t1 (a int, b int); create view v1 as select a, sum(b) from t1 group by a; select b from v1 use index (some_index) where b=1; -ERROR HY000: Incorrect usage of USE INDEX and VIEW +ERROR HY000: Key 'some_index' doesn't exist in table 'v1' drop view v1; drop table t1; create table t1 (col1 char(5),col2 char(5)); @@ -3567,11 +3567,11 @@ CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1),(2); CREATE VIEW v1 AS SELECT * FROM t1; SELECT * FROM v1 USE KEY(non_existant); -ERROR HY000: Incorrect usage of USE INDEX and VIEW +ERROR HY000: Key 'non_existant' doesn't exist in table 'v1' SELECT * FROM v1 FORCE KEY(non_existant); -ERROR HY000: Incorrect usage of FORCE INDEX and VIEW +ERROR HY000: Key 'non_existant' doesn't exist in table 'v1' SELECT * FROM v1 IGNORE KEY(non_existant); -ERROR HY000: Incorrect usage of IGNORE INDEX and VIEW +ERROR HY000: Key 'non_existant' doesn't exist in table 'v1' DROP VIEW v1; DROP TABLE t1; CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b INT NOT NULL DEFAULT 0, @@ -3679,6 +3679,31 @@ DROP VIEW v1; CREATE VIEW v1 AS SELECT 1; DROP VIEW v1; +CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT, INDEX (c2)); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3); +SELECT * FROM t1 USE INDEX (PRIMARY) WHERE c1=2; +c1 c2 +2 2 +SELECT * FROM t1 USE INDEX (c2) WHERE c2=2; +c1 c2 +2 2 +CREATE VIEW v1 AS SELECT c1, c2 FROM t1; +SHOW INDEX FROM v1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +SELECT * FROM v1 USE INDEX (PRIMARY) WHERE c1=2; +ERROR HY000: Key 'PRIMARY' doesn't exist in table 'v1' +SELECT * FROM v1 FORCE INDEX (PRIMARY) WHERE c1=2; +ERROR HY000: Key 'PRIMARY' doesn't exist in table 'v1' +SELECT * FROM v1 IGNORE INDEX (PRIMARY) WHERE c1=2; +ERROR HY000: Key 'PRIMARY' doesn't exist in table 'v1' +SELECT * FROM v1 USE INDEX (c2) WHERE c2=2; +ERROR HY000: Key 'c2' doesn't exist in table 'v1' +SELECT * FROM v1 FORCE INDEX (c2) WHERE c2=2; +ERROR HY000: Key 'c2' doesn't exist in table 'v1' +SELECT * FROM v1 IGNORE INDEX (c2) WHERE c2=2; +ERROR HY000: Key 'c2' doesn't exist in table 'v1' +DROP VIEW v1; +DROP TABLE t1; # ----------------------------------------------------------------- # -- End of 5.0 tests. # ----------------------------------------------------------------- diff --git a/mysql-test/t/ctype_filesystem-master.opt b/mysql-test/t/ctype_filesystem-master.opt new file mode 100644 index 00000000000..cb3427571b5 --- /dev/null +++ b/mysql-test/t/ctype_filesystem-master.opt @@ -0,0 +1,2 @@ +--character-sets-dir=/ß +--character-set-filesystem=latin1 diff --git a/mysql-test/t/ctype_filesystem.test b/mysql-test/t/ctype_filesystem.test new file mode 100644 index 00000000000..30b1607008b --- /dev/null +++ b/mysql-test/t/ctype_filesystem.test @@ -0,0 +1,5 @@ +SET CHARACTER SET utf8; +SHOW VARIABLES like 'character_sets_dir'; +SHOW VARIABLES like 'character_set_filesystem'; +SHOW VARIABLES like 'character_set_client'; +SET CHARACTER SET default; diff --git a/mysql-test/t/func_sapdb.test b/mysql-test/t/func_sapdb.test index 5db6db70e8f..f37ee0c39f0 100644 --- a/mysql-test/t/func_sapdb.test +++ b/mysql-test/t/func_sapdb.test @@ -135,3 +135,20 @@ select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f"); --enable_ps_protocol # End of 4.1 tests + + + +# +# Bug#37553: MySql Error Compare TimeDiff & Time +# + +# calculations involving negative time values ignored sign +select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10'),time('00:00:00'); +select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')>time('00:00:00'); +select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')<time('00:00:00'); + +# show that conversion to DECIMAL no longer drops sign +SELECT CAST(time('-73:42:12') AS DECIMAL); + + +# End of 5.0 tests diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test index e15d1aee08a..b4fc425cb7c 100644 --- a/mysql-test/t/innodb_mysql.test +++ b/mysql-test/t/innodb_mysql.test @@ -1014,4 +1014,15 @@ SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5; DROP TABLE t1; +# +# Bug#37284 Crash in Field_string::type() +# +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings +CREATE TABLE t1 (a char(50)) ENGINE=InnoDB; +CREATE INDEX i1 on t1 (a(3)); +SELECT * FROM t1 WHERE a = 'abcde'; +DROP TABLE t1; + --echo End of 5.0 tests diff --git a/mysql-test/t/perror-win.test b/mysql-test/t/perror-win.test new file mode 100644 index 00000000000..cc09b8527be --- /dev/null +++ b/mysql-test/t/perror-win.test @@ -0,0 +1,14 @@ +# Windows-specific tests +--source include/windows.inc +--require r/have_perror.require +disable_query_log; +eval select LENGTH("$MY_PERROR") > 0 as "have_perror"; +enable_query_log; + + +--exec $MY_PERROR 150 2>&1 +--exec $MY_PERROR 23 2>&1 +--exec $MY_PERROR 1062 2>&1 +--error 1 +--exec $MY_PERROR 30000 2>&1 + diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index d28e31fb545..ea911e4912d 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -3325,4 +3325,39 @@ INSERT INTO t2 VALUES (2,1),(3,1); SELECT * FROM t1 i WHERE 1 IN (SELECT l.id2 FROM t2 l WHERE i.id=l.id1); DROP TABLE t1, t2; +# +# Bug#37460 Assertion failed: +# !table->file || table->file->inited == handler::NONE +# +CREATE TABLE t1 (id int); +CREATE TABLE t2 (id int, c int); + +INSERT INTO t1 (id) VALUES (1); +INSERT INTO t2 (id) VALUES (1); +INSERT INTO t1 (id) VALUES (1); +INSERT INTO t2 (id) VALUES (1); + +CREATE VIEW v1 AS + SELECT t2.c AS c FROM t1, t2 + WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION; +UPDATE v1 SET c=1; + +CREATE VIEW v2 (a,b) AS + SELECT t2.id, t2.c AS c FROM t1, t2 + WHERE t1.id=t2.id AND 1 IN (SELECT id FROM t1) WITH CHECK OPTION; + +--error 1369 +INSERT INTO v2(a,b) VALUES (2,2); +INSERT INTO v2(a,b) VALUES (1,2); +SELECT * FROM v1; + +CREATE VIEW v3 AS + SELECT t2.c AS c FROM t2 + WHERE 1 IN (SELECT id FROM t1) WITH CHECK OPTION; + +DELETE FROM v3; + +DROP VIEW v1,v2,v3; +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 bcf31a4501d..2892ee7dd69 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -510,7 +510,7 @@ drop table t1; # create table t1 (a int, b int); create view v1 as select a, sum(b) from t1 group by a; ---error ER_WRONG_USAGE +--error ER_KEY_DOES_NOT_EXITS select b from v1 use index (some_index) where b=1; drop view v1; drop table t1; @@ -3424,11 +3424,11 @@ drop table t1; CREATE TABLE t1 (a INT); INSERT INTO t1 VALUES (1),(2); CREATE VIEW v1 AS SELECT * FROM t1; ---error ER_WRONG_USAGE +--error ER_KEY_DOES_NOT_EXITS SELECT * FROM v1 USE KEY(non_existant); ---error ER_WRONG_USAGE +--error ER_KEY_DOES_NOT_EXITS SELECT * FROM v1 FORCE KEY(non_existant); ---error ER_WRONG_USAGE +--error ER_KEY_DOES_NOT_EXITS SELECT * FROM v1 IGNORE KEY(non_existant); DROP VIEW v1; @@ -3568,6 +3568,32 @@ DROP VIEW v1; CREATE VIEW v1 AS SELECT 1; DROP VIEW v1; +# +# Bug #33461: SELECT ... FROM <view> USE INDEX (...) throws an error +# + +CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT, INDEX (c2)); +INSERT INTO t1 VALUES (1,1), (2,2), (3,3); +SELECT * FROM t1 USE INDEX (PRIMARY) WHERE c1=2; +SELECT * FROM t1 USE INDEX (c2) WHERE c2=2; + +CREATE VIEW v1 AS SELECT c1, c2 FROM t1; +SHOW INDEX FROM v1; +--error ER_KEY_DOES_NOT_EXITS +SELECT * FROM v1 USE INDEX (PRIMARY) WHERE c1=2; +--error ER_KEY_DOES_NOT_EXITS +SELECT * FROM v1 FORCE INDEX (PRIMARY) WHERE c1=2; +--error ER_KEY_DOES_NOT_EXITS +SELECT * FROM v1 IGNORE INDEX (PRIMARY) WHERE c1=2; +--error ER_KEY_DOES_NOT_EXITS +SELECT * FROM v1 USE INDEX (c2) WHERE c2=2; +--error ER_KEY_DOES_NOT_EXITS +SELECT * FROM v1 FORCE INDEX (c2) WHERE c2=2; +--error ER_KEY_DOES_NOT_EXITS +SELECT * FROM v1 IGNORE INDEX (c2) WHERE c2=2; + +DROP VIEW v1; +DROP TABLE t1; --echo # ----------------------------------------------------------------- --echo # -- End of 5.0 tests. |