[Commits] 359d91aaeec: MDEV-19680:: Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index) || (!(ptr >= table->record[0] && ptr < table->record[0] + table->s->reclength)))' or alike failed upon SELECT with mix of functions from simple view
revision-id: 359d91aaeec25825b51b0a00f52f272edad7d6cc (mariadb-10.1.39-254-g359d91aaeec) parent(s): 9f7fcb9f25238945e4fb8cc1a1f98e56457b714f author: Varun Gupta committer: Varun Gupta timestamp: 2019-12-26 17:36:32 +0530 message: MDEV-19680:: Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index) || (!(ptr >= table->record[0] && ptr < table->record[0] + table->s->reclength)))' or alike failed upon SELECT with mix of functions from simple view Set read_set bitmap for view from the JOIN::all_fields list instead of JOIN::fields_list as split_sum_func would have added items to the all_fields list. --- mysql-test/r/func_misc.result | 13 +++++++++++++ mysql-test/t/func_misc.test | 15 +++++++++++++++ sql/sql_lex.cc | 2 +- 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result index 287a70f1f73..89f6102ef83 100644 --- a/mysql-test/r/func_misc.result +++ b/mysql-test/r/func_misc.result @@ -1479,3 +1479,16 @@ EXECUTE stmt; x x DEALLOCATE PREPARE stmt; +# +# MDEV-19680: Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index) || +# (!(ptr >= table->record[0] && ptr < table->record[0] + table->s->reclength)))' +# or alike failed upon SELECT with mix of functions from simple view +# +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +CREATE VIEW v1 AS SELECT * FROM t1; +SELECT ISNULL( BENCHMARK(1, MIN(a))) FROM v1; +ISNULL( BENCHMARK(1, MIN(a))) +0 +DROP VIEW v1; +DROP TABLE t1; diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test index a8da9068ab8..6412980a5fa 100644 --- a/mysql-test/t/func_misc.test +++ b/mysql-test/t/func_misc.test @@ -1154,3 +1154,18 @@ DROP PROCEDURE p1; PREPARE stmt FROM "SELECT 'x' ORDER BY NAME_CONST( 'f', 'foo' )"; EXECUTE stmt; DEALLOCATE PREPARE stmt; + +--echo # +--echo # MDEV-19680: Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index) || +--echo # (!(ptr >= table->record[0] && ptr < table->record[0] + table->s->reclength)))' +--echo # or alike failed upon SELECT with mix of functions from simple view +--echo # + +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +INSERT INTO t1 VALUES (1),(2); +CREATE VIEW v1 AS SELECT * FROM t1; + +SELECT ISNULL( BENCHMARK(1, MIN(a))) FROM v1; + +DROP VIEW v1; +DROP TABLE t1; diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index a36a19357eb..1cd2a369d7a 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -4177,7 +4177,7 @@ void SELECT_LEX::update_used_tables() } Item *item; - List_iterator_fast<Item> it(join->fields_list); + List_iterator_fast<Item> it(join->all_fields); while ((item= it++)) { item->update_used_tables();
participants (1)
-
Varun