diff options
author | unknown <evgen@moonbone.local> | 2006-07-13 18:16:16 +0400 |
---|---|---|
committer | unknown <evgen@moonbone.local> | 2006-07-13 18:16:16 +0400 |
commit | 805c33a5e161864c5eee91f02335eb59000c77b2 (patch) | |
tree | 7f6569df935d07558c6602029f0648e288a95f84 /mysql-test/t | |
parent | a7dddd3b67e70292c0813e80ad255f1dc2f3a867 (diff) | |
parent | f783a15aada23772e9aae11f9732dd6e9ed095de (diff) | |
download | mariadb-git-805c33a5e161864c5eee91f02335eb59000c77b2.tar.gz |
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0
into moonbone.local:/work/tmp_merge-5.0-opt-mysql
mysql-test/r/rpl_insert_id.result:
Auto merged
mysql-test/t/rpl_insert_id.test:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_strfunc.h:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_select.cc:
Auto merged
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/func_str.test | 17 | ||||
-rw-r--r-- | mysql-test/t/odbc.test | 10 | ||||
-rw-r--r-- | mysql-test/t/rpl_insert_id.test | 18 | ||||
-rw-r--r-- | mysql-test/t/select.test | 5 | ||||
-rw-r--r-- | mysql-test/t/view.test | 36 |
5 files changed, 85 insertions, 1 deletions
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index b13fe039261..054da668584 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -685,6 +685,23 @@ select * from t1 where f1='test' and (f2= sha("test") or f2= sha("TEST")); select * from t1 where f1='test' and (f2= sha("TEST") or f2= sha("test")); drop table t1; +# +# Bug#18243: REVERSE changes its argument +# + +CREATE TABLE t1 (a varchar(10)); +INSERT INTO t1 VALUES ('abc'), ('xyz'); + +SELECT a, CONCAT(a,' ',a) AS c FROM t1 + HAVING LEFT(c,LENGTH(c)-INSTR(REVERSE(c)," ")) = a; + +SELECT a, CONCAT(a,' ',a) AS c FROM t1 + HAVING LEFT(CONCAT(a,' ',a), + LENGTH(CONCAT(a,' ',a))- + INSTR(REVERSE(CONCAT(a,' ',a))," ")) = a; + +DROP TABLE t1; + --echo End of 4.1 tests # diff --git a/mysql-test/t/odbc.test b/mysql-test/t/odbc.test index d4b6fc35e74..6a754bb32a7 100644 --- a/mysql-test/t/odbc.test +++ b/mysql-test/t/odbc.test @@ -21,4 +21,14 @@ select * from t1 where a is null; explain select * from t1 where b is null; drop table t1; +# +# Bug #14553: NULL in WHERE resets LAST_INSERT_ID +# +CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY); +INSERT INTO t1 VALUES (NULL); +SELECT sql_no_cache a, last_insert_id() FROM t1 WHERE a IS NULL; +SELECT sql_no_cache a, last_insert_id() FROM t1 WHERE a IS NULL; +SELECT sql_no_cache a, last_insert_id() FROM t1; +DROP TABLE t1; + # End of 4.1 tests diff --git a/mysql-test/t/rpl_insert_id.test b/mysql-test/t/rpl_insert_id.test index 90a123cf5dc..fa66306aaa6 100644 --- a/mysql-test/t/rpl_insert_id.test +++ b/mysql-test/t/rpl_insert_id.test @@ -77,6 +77,24 @@ sync_slave_with_master; connection master; drop table t1; sync_slave_with_master; + +# +# Bug#14553: NULL in WHERE resets LAST_INSERT_ID +# +connection master; +create table t1(a int auto_increment, key(a)); +create table t2(a int); +insert into t1 (a) values (null); +insert into t2 (a) select a from t1 where a is null; +insert into t2 (a) select a from t1 where a is null; +select * from t2; +sync_slave_with_master; +connection slave; +select * from t2; +connection master; +drop table t1; +drop table t2; +sync_slave_with_master; # End of 4.1 tests diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index b75d0dd8bb6..b44f682c02e 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -2901,3 +2901,8 @@ from t1 left outer join t2 on t1.a = t2.c and t2.b <> 1 where t1.b <> 1 order by t1.a; drop table t1,t2; + +# +# Bug #20569: Garbage in DECIMAL results from some mathematical functions +# +SELECT 0.9888889889 * 1.011111411911; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index a1c1e9b2ad1..623195dd527 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -2595,4 +2595,38 @@ CREATE TABLE t2 SELECT * FROM v1; SELECT * FROM t2; DROP VIEW v1; -DROP TABLE IF EXISTS t1,t2; +DROP TABLE t1,t2; + +# +# Bug#16110: insert permitted into view col w/o default value +# +CREATE TABLE t1 (a INT NOT NULL, b INT NULL DEFAULT NULL); +CREATE VIEW v1 AS SELECT a, b FROM t1; + +INSERT INTO v1 (b) VALUES (2); + +SET SQL_MODE = STRICT_ALL_TABLES; +--error 1423 +INSERT INTO v1 (b) VALUES (4); +SET SQL_MODE = ''; + +SELECT * FROM t1; + +DROP VIEW v1; +DROP TABLE t1; + +# +# Bug #18243: expression over a view column that with the REVERSE function +# + +CREATE TABLE t1 (firstname text, surname text); +INSERT INTO t1 VALUES + ("Bart","Simpson"),("Milhouse","van Houten"),("Montgomery","Burns"); + +CREATE VIEW v1 AS SELECT CONCAT(firstname," ",surname) AS name FROM t1; +SELECT CONCAT(LEFT(name,LENGTH(name)-INSTR(REVERSE(name)," ")), + LEFT(name,LENGTH(name)-INSTR(REVERSE(name)," "))) AS f1 + FROM v1; + +DROP VIEW v1; +DROP TABLE t1; |