Skip to content

Commit 1f3ad6a

Browse files
committed
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.
1 parent 45e4089 commit 1f3ad6a

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

mysql-test/r/subselect_sj2.result

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,5 +1318,18 @@ id
13181318
1
13191319
2
13201320
drop table t1,t2,t3;
1321+
#
1322+
# MDEV-11108: Assertion `uniq_tuple_length_arg <= table->file->max_key_length()' failed in SJ_TMP_TABLE::create_sj_weedout_tmp_table
1323+
#
1324+
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
1325+
CREATE TABLE t2 (pk BLOB, b INT, PRIMARY KEY(pk(1000))) ENGINE=InnoDB;
1326+
CREATE TABLE t3 (c INT) ENGINE=InnoDB;
1327+
CREATE OR REPLACE ALGORITHM=MERGE VIEW v3 AS SELECT * FROM t3;
1328+
INSERT INTO t3 VALUES (1),(2),(3),(4),(5),(6),(7),(8);
1329+
SELECT * FROM t1, t2
1330+
WHERE a IN ( SELECT b FROM t2 LEFT JOIN v3 ON ( c = b ) ) ;
1331+
a pk b
1332+
DROP TABLE t1,t2,t3;
1333+
DROP VIEW v3;
13211334
# This must be the last in the file:
13221335
set optimizer_switch=@subselect_sj2_tmp;

mysql-test/t/subselect_sj2.test

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,5 +1449,20 @@ SELECT * FROM t1 WHERE t1.id IN (
14491449

14501450
drop table t1,t2,t3;
14511451

1452+
--echo #
1453+
--echo # MDEV-11108: Assertion `uniq_tuple_length_arg <= table->file->max_key_length()' failed in SJ_TMP_TABLE::create_sj_weedout_tmp_table
1454+
--echo #
1455+
1456+
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
1457+
CREATE TABLE t2 (pk BLOB, b INT, PRIMARY KEY(pk(1000))) ENGINE=InnoDB;
1458+
CREATE TABLE t3 (c INT) ENGINE=InnoDB;
1459+
CREATE OR REPLACE ALGORITHM=MERGE VIEW v3 AS SELECT * FROM t3;
1460+
1461+
INSERT INTO t3 VALUES (1),(2),(3),(4),(5),(6),(7),(8);
1462+
SELECT * FROM t1, t2
1463+
WHERE a IN ( SELECT b FROM t2 LEFT JOIN v3 ON ( c = b ) ) ;
1464+
DROP TABLE t1,t2,t3;
1465+
DROP VIEW v3;
1466+
14521467
--echo # This must be the last in the file:
14531468
set optimizer_switch=@subselect_sj2_tmp;

sql/opt_subselect.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4053,13 +4053,13 @@ SJ_TMP_TABLE::create_sj_weedout_tmp_table(THD *thd)
40534053
share->db_plugin= ha_lock_engine(0, TMP_ENGINE_HTON);
40544054
table->file= get_new_handler(share, &table->mem_root,
40554055
share->db_type());
4056-
DBUG_ASSERT(uniq_tuple_length_arg <= table->file->max_key_length());
40574056
}
40584057
else
40594058
{
40604059
share->db_plugin= ha_lock_engine(0, heap_hton);
40614060
table->file= get_new_handler(share, &table->mem_root,
40624061
share->db_type());
4062+
DBUG_ASSERT(uniq_tuple_length_arg <= table->file->max_key_length());
40634063
}
40644064
if (!table->file)
40654065
goto err;

0 commit comments

Comments
 (0)