diff options
author | konstantin@mysql.com <> | 2004-08-03 03:32:21 -0700 |
---|---|---|
committer | konstantin@mysql.com <> | 2004-08-03 03:32:21 -0700 |
commit | d3e520ce7e840df5f119e8fc2f5b5bb9640e53df (patch) | |
tree | 90caa835d0b6af4148caf934c5d80616cb5c25ae /sql/sql_union.cc | |
parent | 7e6bade23bf5fbaf6cdb76e2fce2f76cfc533a7a (diff) | |
download | mariadb-git-d3e520ce7e840df5f119e8fc2f5b5bb9640e53df.tar.gz |
Port of cursors to be pushed into 5.0 tree:
- client side part is simple and may be considered stable
- server side part now just joggles with THD state to save execution
state and has no additional locking wisdom.
Lot's of it are to be rewritten.
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r-- | sql/sql_union.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 35f8a390308..d6b776571f2 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -31,7 +31,13 @@ int mysql_union(THD *thd, LEX *lex, select_result *result, int res, res_cln; if (!(res= unit->prepare(thd, result, SELECT_NO_UNLOCK))) res= unit->exec(); - res_cln= unit->cleanup(); + if (res == 0 && thd->cursor && thd->cursor->is_open()) + { + thd->cursor->set_unit(unit); + res_cln= 0; + } + else + res_cln= unit->cleanup(); DBUG_RETURN(res?res:res_cln); } |