summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/main/subselect4.result15
-rw-r--r--mysql-test/main/subselect4.test14
-rw-r--r--sql/sql_type.h1
3 files changed, 29 insertions, 1 deletions
diff --git a/mysql-test/main/subselect4.result b/mysql-test/main/subselect4.result
index 23b6e268d91..8b4f27952c6 100644
--- a/mysql-test/main/subselect4.result
+++ b/mysql-test/main/subselect4.result
@@ -2751,4 +2751,19 @@ id select_type table type possible_keys key key_len ref rows Extra
set names default;
set @@in_predicate_conversion_threshold= @save_in_predicate_conversion_threshold;
DROP TABLE t1,t2;
+#
+# MDEV-22716: Assertion `0' failed in Type_handler_row::subquery_type_allows_materialization
+#
+CREATE TABLE t1(a INT,b INT);
+INSERT INTO t1 VALUES (1,1), (2,2);
+set @save_in_predicate_conversion_threshold= @@in_predicate_conversion_threshold;
+SET SESSION in_predicate_conversion_threshold=2;
+EXPLAIN SELECT 1 FROM t1 WHERE ROW(a,(a,a)) IN ((1,(1,1)),(2,(2,1)));
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
+SELECT 1 FROM t1 WHERE ROW(a,(a,a)) IN ((1,(1,1)),(2,(2,1)));
+1
+1
+set @@in_predicate_conversion_threshold= @save_in_predicate_conversion_threshold;
+DROP TABLE t1;
# End of 10.3 tests
diff --git a/mysql-test/main/subselect4.test b/mysql-test/main/subselect4.test
index f264b3857ff..8e2d5309991 100644
--- a/mysql-test/main/subselect4.test
+++ b/mysql-test/main/subselect4.test
@@ -2274,4 +2274,18 @@ set names default;
set @@in_predicate_conversion_threshold= @save_in_predicate_conversion_threshold;
DROP TABLE t1,t2;
+--echo #
+--echo # MDEV-22716: Assertion `0' failed in Type_handler_row::subquery_type_allows_materialization
+--echo #
+
+CREATE TABLE t1(a INT,b INT);
+INSERT INTO t1 VALUES (1,1), (2,2);
+
+set @save_in_predicate_conversion_threshold= @@in_predicate_conversion_threshold;
+SET SESSION in_predicate_conversion_threshold=2;
+EXPLAIN SELECT 1 FROM t1 WHERE ROW(a,(a,a)) IN ((1,(1,1)),(2,(2,1)));
+SELECT 1 FROM t1 WHERE ROW(a,(a,a)) IN ((1,(1,1)),(2,(2,1)));
+set @@in_predicate_conversion_threshold= @save_in_predicate_conversion_threshold;
+
+DROP TABLE t1;
--echo # End of 10.3 tests
diff --git a/sql/sql_type.h b/sql/sql_type.h
index 4a7a7b5a9b8..325be2d53bc 100644
--- a/sql/sql_type.h
+++ b/sql/sql_type.h
@@ -1485,7 +1485,6 @@ public:
const Item *outer,
bool is_in_predicate) const
{
- DBUG_ASSERT(0);
return false;
}
Field *make_num_distinct_aggregator_field(MEM_ROOT *, const Item *) const