summaryrefslogtreecommitdiff
path: root/sql/sp_rcontext.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2011-03-09 19:45:48 +0200
committerMichael Widenius <monty@askmonty.org>2011-03-09 19:45:48 +0200
commite6b0be38f9ea03b4f657b210755f6891ce2a30f0 (patch)
treeb939c86916f6ab3745286dd9e19928e0c4041f13 /sql/sp_rcontext.cc
parent251a5fa97598c8f0e7e0759880503d0932ca2918 (diff)
downloadmariadb-git-e6b0be38f9ea03b4f657b210755f6891ce2a30f0.tar.gz
Bug fix for lp:732124 union + limit returns wrong result
mysql-test/r/union.result: Added test for lp:732124 mysql-test/t/union.test: Added test for lp:732124 sql/sp_rcontext.cc: Updated function definition for ::send_data() sql/sp_rcontext.h: Updated function definition for ::send_data() sql/sql_analyse.cc: Test if send_data() returned an error sql/sql_class.cc: Updated function definition for ::send_data() sql/sql_class.h: Changed select_result::send_data(List<Item> &items) to return -1 in case of duplicate row that should not be counted as part of LIMIT sql/sql_cursor.cc: Check if send_data returned error sql/sql_delete.cc: Updated function definition for ::send_data() sql/sql_insert.cc: Updated function definition for ::send_data() sql/sql_select.cc: Don't count rows which send_data() tells you to ignore sql/sql_union.cc: Inform caller that the row should be ignored. This is the real bug fix for lp:732124 sql/sql_update.cc: Updated function definition for ::send_data()
Diffstat (limited to 'sql/sp_rcontext.cc')
-rw-r--r--sql/sp_rcontext.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc
index be8f705a53e..68b392a1212 100644
--- a/sql/sp_rcontext.cc
+++ b/sql/sp_rcontext.cc
@@ -651,7 +651,7 @@ int Select_fetch_into_spvars::prepare(List<Item> &fields, SELECT_LEX_UNIT *u)
}
-bool Select_fetch_into_spvars::send_data(List<Item> &items)
+int Select_fetch_into_spvars::send_data(List<Item> &items)
{
List_iterator_fast<struct sp_variable> spvar_iter(*spvar_list);
List_iterator_fast<Item> item_iter(items);
@@ -668,7 +668,7 @@ bool Select_fetch_into_spvars::send_data(List<Item> &items)
for (; spvar= spvar_iter++, item= item_iter++; )
{
if (thd->spcont->set_variable(thd, spvar->offset, &item))
- return TRUE;
+ return 1;
}
- return FALSE;
+ return 0;
}