mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
A fix and a test case for Bug#11172 "mysql_stmt_attr_set
CURSOR_TYPE_READ_ONLY date/datetime filter server crash".
The fix adds support for Item_change_list in cursors (proper rollback
of the modified item tree).
sql/sql_class.cc:
No need to call fatal_error() twice.
sql/sql_prepare.cc:
- implement proper cleanup of the prepared statement in mysql_stmt_reset
if there is a cursor.
- take into account thd->change_list when fetching data through a
cursor.
sql/sql_select.cc:
- take into account thd->change_list when fetching data from a cursor:
grab it when we open a cursor, and rollback the changes to the parsed
tree when we close it.
sql/sql_select.h:
- Cursor::change_list added
tests/mysql_client_test.c:
- a test case for Bug#11172 "mysql_stmt_attr_set CURSOR_TYPE_READ_ONLY date/datetime
filter server crash"
This commit is contained in:
@@ -784,7 +784,10 @@ void THD::nocheck_register_item_tree_change(Item **place, Item *old_value,
|
||||
void *change_mem= alloc_root(runtime_memroot, sizeof(*change));
|
||||
if (change_mem == 0)
|
||||
{
|
||||
fatal_error();
|
||||
/*
|
||||
OOM, thd->fatal_error() is called by the error handler of the
|
||||
memroot. Just return.
|
||||
*/
|
||||
return;
|
||||
}
|
||||
change= new (change_mem) Item_change_record;
|
||||
|
||||
Reference in New Issue
Block a user