summaryrefslogtreecommitdiff
path: root/sql/sql_select.h
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2005-08-10 12:25:26 +0400
committerunknown <konstantin@mysql.com>2005-08-10 12:25:26 +0400
commit8e9f6b1950410bf54d2f2d34bab8e3c349439aef (patch)
tree77e725a2c20217e76ac1195f1b18b198b4ac4815 /sql/sql_select.h
parent8559ef627d9f461693de97e8b86a1e74923e8a12 (diff)
downloadmariadb-git-8e9f6b1950410bf54d2f2d34bab8e3c349439aef.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.h5
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));
+ }
};