mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 03:17:20 +02:00
Bug#48483 crash in get_best_combination()
The crash happens because greedy_serach can not determine best plan due to wrong inner table dependences. These dependences affects join table sorting which performs before greedy_search starting. In our case table which has real 'no dependences' should be put on top of the list but it does not happen as inner tables have no dependences as well. The fix is to exclude RAND_TABLE_BIT mask from condition which checks if table dependences should be updated. mysql-test/r/join.result: test result mysql-test/t/join.test: test case sql/sql_select.cc: RAND_TABLE_BIT mask should not be counted as it prevents update of inner table dependences. For example it might happen if RAND() function is used in JOIN ON clause.
This commit is contained in:
parent
2a667b7bcb
commit
bccf219bfc
3 changed files with 41 additions and 1 deletions
|
|
@ -713,4 +713,16 @@ FROM
|
|||
|
||||
DROP TABLE t1,t2,t3,t4,t5,t6;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#48483: crash in get_best_combination()
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1(f1 INT);
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
CREATE VIEW v1 AS SELECT 1 FROM t1 LEFT JOIN t1 AS t2 on 1=1;
|
||||
EXPLAIN EXTENDED
|
||||
SELECT 1 FROM v1 right join v1 AS v2 ON RAND();
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.0 tests.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue