summaryrefslogtreecommitdiff
path: root/mysql-test/t/insert_select.test
diff options
context:
space:
mode:
authorunknown <gkodinov/kgeorge@magare.gmz>2007-03-22 18:44:16 +0200
committerunknown <gkodinov/kgeorge@magare.gmz>2007-03-22 18:44:16 +0200
commit0a48cd93b4d26056e669b1a9bd5be791b3b79b94 (patch)
tree2157977430d766b13bee9e02927b505008b413b0 /mysql-test/t/insert_select.test
parent3a520a785eeee973e79d1f6e482e270e24a20c56 (diff)
downloadmariadb-git-0a48cd93b4d26056e669b1a9bd5be791b3b79b94.tar.gz
Bug #26207: When making the key image to use
in index search MySQL was not explicitly suppressing warnings. And if the context happens to enable warnings (e.g. INSERT .. SELECT) the warnings resulting from converting the data the key is compared to are reported to the client. Fixed by suppressing warnings when converting the data to the same type as the key parts. mysql-test/r/insert_select.result: Bug #26207: test case mysql-test/t/insert_select.test: Bug #26207: test case sql/sql_select.h: Bug #26207: supress warnings when converting data of the same type to key buffer format.
Diffstat (limited to 'mysql-test/t/insert_select.test')
-rw-r--r--mysql-test/t/insert_select.test27
1 files changed, 26 insertions, 1 deletions
diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test
index 31508b3d6c4..bbc51be6dc9 100644
--- a/mysql-test/t/insert_select.test
+++ b/mysql-test/t/insert_select.test
@@ -306,4 +306,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;