mirror of
https://github.com/MariaDB/server.git
synced 2026-04-28 03:05:33 +02:00
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()
This commit is contained in:
parent
251a5fa975
commit
e6b0be38f9
14 changed files with 95 additions and 43 deletions
|
|
@ -753,7 +753,7 @@ int analyse::end_of_records()
|
|||
tmp_str.append(STRING_WITH_LEN(" NOT NULL"));
|
||||
output_str_length = tmp_str.length();
|
||||
func_items[9]->set(tmp_str.ptr(), tmp_str.length(), tmp_str.charset());
|
||||
if (result->send_data(result_fields))
|
||||
if (result->send_data(result_fields) > 0)
|
||||
return -1;
|
||||
continue;
|
||||
}
|
||||
|
|
@ -798,7 +798,7 @@ int analyse::end_of_records()
|
|||
if (!(*f)->nulls)
|
||||
ans.append(STRING_WITH_LEN(" NOT NULL"));
|
||||
func_items[9]->set(ans.ptr(), ans.length(), ans.charset());
|
||||
if (result->send_data(result_fields))
|
||||
if (result->send_data(result_fields) > 0)
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue