diff options
author | unknown <konstantin@mysql.com> | 2005-04-30 09:54:35 +0400 |
---|---|---|
committer | unknown <konstantin@mysql.com> | 2005-04-30 09:54:35 +0400 |
commit | 963e94ce4978f546ae5059631bf279eb0fc6e1ab (patch) | |
tree | f06357f2351844fc1200d435fac767983c3c39cf /sql/sql_prepare.cc | |
parent | e9cc39c43f5e6bb38f11e0a50fb7f55acb85cc6b (diff) | |
download | mariadb-git-963e94ce4978f546ae5059631bf279eb0fc6e1ab.tar.gz |
A fix and a test case for Bug#9520 "SELECT DISTINCT crashes server
with cursor". The patch refactors do_select/sub_select
functions, which implement the nested loop algorithm, and reuses them to
fetch rows for cursors as well.
Pushing with view.test failing (--ps-protocol).
sql/sql_prepare.cc:
Cursor::fetch() now returns void
sql/sql_select.cc:
A fix for Bug#9520 "SELECT DISTINCT crashes server with cursor":
* rename sub_select returns codes to be able to track down what's going
on in which case.
* move record processing and outer join record processing to a separate
function, out of sub_select read-record loop.
* use generalized sub_select() nested loop function for
cursors instead of own loop implementation used in Cursor::fetch() before
sql/sql_select.h:
Replace all return values of sub_select family with enum.
Add JOIN::resume_nested_loop flag to indicate we are restarting the nested loop
for execution of next chunk of cursor's rows.
tests/mysql_client_test.c:
A test case for Bug#9520 "SELECT DISTINCT crashes server with cursor"
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r-- | sql/sql_prepare.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 56d09d7c563..17c5f51f1e1 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -2223,7 +2223,7 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length) my_pthread_setprio(pthread_self(), QUERY_PRIOR); thd->protocol= &thd->protocol_prep; // Switch to binary protocol - (void) stmt->cursor->fetch(num_rows); + stmt->cursor->fetch(num_rows); thd->protocol= &thd->protocol_simple; // Use normal protocol if (!(specialflag & SPECIAL_NO_PRIOR)) |