diff options
author | unknown <holyfoot/hf@hfmain.(none)> | 2007-03-22 23:59:20 +0400 |
---|---|---|
committer | unknown <holyfoot/hf@hfmain.(none)> | 2007-03-22 23:59:20 +0400 |
commit | 2c5395eedb85105f8ad7d58c0ce1902807dc0948 (patch) | |
tree | b10a0e80530fde746ab966228b412ab454f075eb /mysql-test/t | |
parent | 3a222d57ad93f76a1a75ab459d0fe2a12be98d6c (diff) | |
parent | b8c101df1a6d1c4f9f5a2ed1cbcf996610782844 (diff) | |
download | mariadb-git-2c5395eedb85105f8ad7d58c0ce1902807dc0948.tar.gz |
Merge mysql.com:/home/hf/work/mrg/mysql-5.0-opt
into mysql.com:/home/hf/work/mrg/mysql-5.1-opt
mysql-test/r/insert_select.result:
Auto merged
mysql-test/t/insert_select.test:
Auto merged
sql/field.h:
Auto merged
sql/item.cc:
Auto merged
sql/item_sum.cc:
Auto merged
sql/sql_select.h:
Auto merged
mysql-test/r/create.result:
merging
mysql-test/r/temp_table.result:
SCCS merged
mysql-test/r/type_float.result:
merging
mysql-test/r/union.result:
merging
mysql-test/t/temp_table.test:
merging
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/insert_select.test | 27 | ||||
-rw-r--r-- | mysql-test/t/temp_table.test | 15 |
2 files changed, 41 insertions, 1 deletions
diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test index 0f9a0ca4872..95a55b732c5 100644 --- a/mysql-test/t/insert_select.test +++ b/mysql-test/t/insert_select.test @@ -293,4 +293,29 @@ INSERT INTO t2 (f1, f2) SELECT * FROM t2; DROP TABLE t1, t2; - +# +# Bug #26207: inserts don't work with shortened index +# +SET SQL_MODE='STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'; + +CREATE TABLE t1 (c VARCHAR(30), INDEX ix_c (c(10))); +CREATE TABLE t2 (d VARCHAR(10)); +INSERT INTO t1 (c) VALUES ('7_chars'), ('13_characters'); + +EXPLAIN + SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c='13_characters') FROM t1; + +SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c='13_characters') FROM t1; + +INSERT INTO t2 (d) + SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c='13_characters') FROM t1; + +INSERT INTO t2 (d) + SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c='7_chars') FROM t1; + +INSERT INTO t2 (d) + SELECT (SELECT SUM(LENGTH(c)) FROM t1 WHERE c IN (SELECT t1.c FROM t1)) + FROM t1; + +SELECT * FROM t2; +DROP TABLE t1,t2; diff --git a/mysql-test/t/temp_table.test b/mysql-test/t/temp_table.test index d06fde87b34..e10fd386bd3 100644 --- a/mysql-test/t/temp_table.test +++ b/mysql-test/t/temp_table.test @@ -164,6 +164,21 @@ DROP TABLE t1; --echo End of 4.1 tests. +# +# Bug #24791: Union with AVG-groups generates wrong results +# +CREATE TABLE t1 ( c FLOAT( 20, 14 ) ); +INSERT INTO t1 VALUES( 12139 ); + +CREATE TABLE t2 ( c FLOAT(30,18) ); +INSERT INTO t2 VALUES( 123456 ); + +SELECT AVG( c ) FROM t1 UNION SELECT 1; +SELECT 1 UNION SELECT AVG( c ) FROM t1; +SELECT 1 UNION SELECT * FROM t2 UNION SELECT 1; +SELECT c/1 FROM t1 UNION SELECT 1; + +DROP TABLE t1, t2; # # Test truncate with temporary tables |