diff options
author | unknown <konstantin@mysql.com> | 2005-08-10 12:25:26 +0400 |
---|---|---|
committer | unknown <konstantin@mysql.com> | 2005-08-10 12:25:26 +0400 |
commit | 33e8f20c31440636687b8fddf387f4fc28ebdc16 (patch) | |
tree | 77e725a2c20217e76ac1195f1b18b198b4ac4815 /sql/sql_select.h | |
parent | b2218cbb04ea5f4fcf3f51a5f3e894343af82ed8 (diff) | |
download | mariadb-git-33e8f20c31440636687b8fddf387f4fc28ebdc16.tar.gz |
A fix for Bug#11901 "mysql_stmt_attr_set CURSOR_TYPE_READ_ONLY join in
subqry order by server crash": failing DBUG_ASSERT(curr_join == this)
when opening a cursor.
Ensure that for top-level join curr_join == join (always),
and thus fix the failing assert.
curr_join is a hack to ensure that uncacheable subqueries can be
re-evaluated safely, and should be never different from main join
in case of top-level join.
sql/sql_select.cc:
- utilize tmp_join only if we evaluate an uncacheable subquery.
sql/sql_select.h:
- implement JOIN::is_top_level_join()
tests/mysql_client_test.c:
A test case for Bug#11901 "mysql_stmt_attr_set CURSOR_TYPE_READ_ONLY
join in subqry order by server crash"
Diffstat (limited to 'sql/sql_select.h')
-rw-r--r-- | sql/sql_select.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/sql_select.h b/sql/sql_select.h index c950444e1c6..3b9a3093682 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -366,6 +366,11 @@ class JOIN :public Sql_alloc !group_list); } bool change_result(select_result *result); + bool is_top_level_join() const + { + return (unit == &thd->lex->unit && (unit->fake_select_lex == 0 || + select_lex == unit->fake_select_lex)); + } }; |