Commit 51e1bb7
Bug#54488 crash when using explain and prepared statements with subqueries
The crash happens because original join table is replaced with temporary table
at execution stage and later we attempt to use this temporary table in
select_describe. It might happen that
Item_subselect::update_used_tables() method which sets const_item flag
is not called by some reasons (no where/having conditon in subquery for example).
It prevents JOIN::join_tmp creation and breaks original join.
The fix is to call ::update_used_tables() before ::const_item() check.
--BZR--
revision-id: [email protected]
property-branch-nick: mysql-5.1-security
property-file-info: ld7:file_id62:sp1f-ps.result-20040405154119-efxzt5onloys45nfjak4gt44kr4awkdi7:message9:test case4:path22:mysql-test/r/ps.resulted7:file_id60:sp1f-ps.test-20040405154119-4zqf6po44yypvz5foa2osprg5kb5ok637:message9:test case4:path20:mysql-test/t/ps.tested7:file_id70:sp1f-item_subselect.cc-20020512204640-qep43aqhsfrwkqmrobni6czc3fqj36oo7:message56:call ::update_used_tables() before ::const_item() check.4:path21:sql/item_subselect.ccee
testament3-sha1: 3451b951e40721d2396210b7ddb455f0b9671e911 parent 32b76df commit 51e1bb7
3 files changed
+44
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3021 | 3021 | | |
3022 | 3022 | | |
3023 | 3023 | | |
| 3024 | + | |
| 3025 | + | |
| 3026 | + | |
| 3027 | + | |
| 3028 | + | |
| 3029 | + | |
| 3030 | + | |
| 3031 | + | |
| 3032 | + | |
| 3033 | + | |
| 3034 | + | |
| 3035 | + | |
| 3036 | + | |
| 3037 | + | |
| 3038 | + | |
| 3039 | + | |
| 3040 | + | |
| 3041 | + | |
3024 | 3042 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3090 | 3090 | | |
3091 | 3091 | | |
3092 | 3092 | | |
| 3093 | + | |
| 3094 | + | |
| 3095 | + | |
| 3096 | + | |
| 3097 | + | |
| 3098 | + | |
| 3099 | + | |
| 3100 | + | |
| 3101 | + | |
| 3102 | + | |
| 3103 | + | |
3093 | 3104 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1914 | 1914 | | |
1915 | 1915 | | |
1916 | 1916 | | |
1917 | | - | |
| 1917 | + | |
1918 | 1918 | | |
1919 | | - | |
1920 | | - | |
1921 | | - | |
1922 | | - | |
1923 | | - | |
1924 | | - | |
1925 | | - | |
1926 | | - | |
1927 | | - | |
1928 | | - | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
| 1924 | + | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
| 1932 | + | |
1929 | 1933 | | |
1930 | 1934 | | |
1931 | 1935 | | |
| |||
0 commit comments