diff options
author | Varun Gupta <varunraiko1803@gmail.com> | 2017-01-24 01:21:43 +0530 |
---|---|---|
committer | Varun Gupta <varunraiko1803@gmail.com> | 2017-01-24 01:21:43 +0530 |
commit | 1f3ad6a4ba63074c51c84dff449c35a8314a7f36 (patch) | |
tree | 8a4fc74e65c003105eeae626887b2bb9ce63caaf | |
parent | 45e40892c5bcd541cd93aebe8ba15b7a27289621 (diff) | |
download | mariadb-git-1f3ad6a4ba63074c51c84dff449c35a8314a7f36.tar.gz |
MDEV-11108: Assertion `uniq_tuple_length_arg <= table->file->max_key_length()' failed in SJ_TMP_TABLE::create_sj_weedout_tmp_table
Removed the assert from the if clause to the else clause.
-rw-r--r-- | mysql-test/r/subselect_sj2.result | 13 | ||||
-rw-r--r-- | mysql-test/t/subselect_sj2.test | 15 | ||||
-rw-r--r-- | sql/opt_subselect.cc | 2 |
3 files changed, 29 insertions, 1 deletions
diff --git a/mysql-test/r/subselect_sj2.result b/mysql-test/r/subselect_sj2.result index 8f37c09efcf..948be5766a2 100644 --- a/mysql-test/r/subselect_sj2.result +++ b/mysql-test/r/subselect_sj2.result @@ -1318,5 +1318,18 @@ id 1 2 drop table t1,t2,t3; +# +# MDEV-11108: Assertion `uniq_tuple_length_arg <= table->file->max_key_length()' failed in SJ_TMP_TABLE::create_sj_weedout_tmp_table +# +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +CREATE TABLE t2 (pk BLOB, b INT, PRIMARY KEY(pk(1000))) ENGINE=InnoDB; +CREATE TABLE t3 (c INT) ENGINE=InnoDB; +CREATE OR REPLACE ALGORITHM=MERGE VIEW v3 AS SELECT * FROM t3; +INSERT INTO t3 VALUES (1),(2),(3),(4),(5),(6),(7),(8); +SELECT * FROM t1, t2 +WHERE a IN ( SELECT b FROM t2 LEFT JOIN v3 ON ( c = b ) ) ; +a pk b +DROP TABLE t1,t2,t3; +DROP VIEW v3; # This must be the last in the file: set optimizer_switch=@subselect_sj2_tmp; diff --git a/mysql-test/t/subselect_sj2.test b/mysql-test/t/subselect_sj2.test index 5d6639a6d5a..a948b086a85 100644 --- a/mysql-test/t/subselect_sj2.test +++ b/mysql-test/t/subselect_sj2.test @@ -1449,5 +1449,20 @@ SELECT * FROM t1 WHERE t1.id IN ( drop table t1,t2,t3; +--echo # +--echo # MDEV-11108: Assertion `uniq_tuple_length_arg <= table->file->max_key_length()' failed in SJ_TMP_TABLE::create_sj_weedout_tmp_table +--echo # + +CREATE TABLE t1 (a INT) ENGINE=InnoDB; +CREATE TABLE t2 (pk BLOB, b INT, PRIMARY KEY(pk(1000))) ENGINE=InnoDB; +CREATE TABLE t3 (c INT) ENGINE=InnoDB; +CREATE OR REPLACE ALGORITHM=MERGE VIEW v3 AS SELECT * FROM t3; + +INSERT INTO t3 VALUES (1),(2),(3),(4),(5),(6),(7),(8); +SELECT * FROM t1, t2 +WHERE a IN ( SELECT b FROM t2 LEFT JOIN v3 ON ( c = b ) ) ; +DROP TABLE t1,t2,t3; +DROP VIEW v3; + --echo # This must be the last in the file: set optimizer_switch=@subselect_sj2_tmp; diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index a9222cbca42..43b9bdd6255 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -4053,13 +4053,13 @@ SJ_TMP_TABLE::create_sj_weedout_tmp_table(THD *thd) share->db_plugin= ha_lock_engine(0, TMP_ENGINE_HTON); table->file= get_new_handler(share, &table->mem_root, share->db_type()); - DBUG_ASSERT(uniq_tuple_length_arg <= table->file->max_key_length()); } else { share->db_plugin= ha_lock_engine(0, heap_hton); table->file= get_new_handler(share, &table->mem_root, share->db_type()); + DBUG_ASSERT(uniq_tuple_length_arg <= table->file->max_key_length()); } if (!table->file) goto err; |