summaryrefslogtreecommitdiff
path: root/mysql-test/t/subselect.test
diff options
context:
space:
mode:
authorGeorgi Kodinov <joro@sun.com>2009-10-29 17:24:29 +0200
committerGeorgi Kodinov <joro@sun.com>2009-10-29 17:24:29 +0200
commiteb9a854d8be6f692f55250c89cb40f1cb1b66baa (patch)
treed221a0705d7d09709a1d08cb97b87e91416f5248 /mysql-test/t/subselect.test
parenta6ee178e72a23c2a3940760a79efad213cb57215 (diff)
downloadmariadb-git-eb9a854d8be6f692f55250c89cb40f1cb1b66baa.tar.gz
Bug #42116 : Mysql crash on specific query
Queries with nested outer joins may lead to crashes or bad results because an internal data structure is not handled correctly. The optimizer uses bitmaps of nested JOINs to determine if certain table can be placed at a certain place in the JOIN order. It does maintain a bitmap describing in which JOINs last placed table is nested. When it puts a table it makes sure the bit of every JOIN that contains the table in question is set (because JOINs can be nested). It does that by recursively setting the bit for the next enclosing JOIN when this is the first table in the JOIN and recursively resetting the bit if it's the last table in the JOIN. When it removes a table from the join order it should do the opposite : recursively unset the bit if it's the only remaining table in this join and and recursively set the bit if it's removing the last table of a JOIN. There was an error in how the bits was set for the upper levels : when removing a table it was setting the bit for all the enclosing nested JOINs even if there were more tables left in the current JOIN (which practically means that the upper nested JOINs were not affected). Fixed by stopping the recursion at the relevant level. mysql-test/r/join.result: Bug #42116: test case mysql-test/t/join.test: Bug #42116: test case sql/sql_select.cc: Bug #41116: don't go up and set the bits if more tables in at the current JOIN level
Diffstat (limited to 'mysql-test/t/subselect.test')
0 files changed, 0 insertions, 0 deletions