mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge next-mr -> next-4284.
Fix Bug#50555 "handler commands crash server in my_hash_first()" as a post-merge fix (the new handler tests are not passing otherwise). - in hash.c, don't call calc_hash if ! my_hash_inited(). - add tests and results for the test case for Bug#50555 mysys/hash.c: Assert that the hash is initialized when it's used. sql/set_var.cc: Check that the hash is initalized before using it (Bug#50555)
This commit is contained in:
@ -1108,6 +1108,7 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
|
||||
*/
|
||||
MDL_ticket *mdl_ticket= NULL;
|
||||
bool has_mdl_lock= FALSE;
|
||||
bool is_temporary_table= false;
|
||||
DBUG_ENTER("mysql_truncate");
|
||||
|
||||
bzero((char*) &create_info,sizeof(create_info));
|
||||
@ -1118,6 +1119,7 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
|
||||
/* If it is a temporary table, close and regenerate it */
|
||||
if (!dont_send_ok && (table= find_temporary_table(thd, table_list)))
|
||||
{
|
||||
is_temporary_table= true;
|
||||
handlerton *table_type= table->s->db_type();
|
||||
TABLE_SHARE *share= table->s;
|
||||
/* Note that a temporary table cannot be partitioned */
|
||||
@ -1250,11 +1252,9 @@ end:
|
||||
*/
|
||||
if (!error)
|
||||
{
|
||||
/*
|
||||
TRUNCATE must always be statement-based binlogged (not row-based) so
|
||||
we don't test current_stmt_binlog_row_based.
|
||||
*/
|
||||
write_bin_log(thd, TRUE, thd->query(), thd->query_length());
|
||||
/* In RBR, the statement is not binlogged if the table is temporary. */
|
||||
if (!is_temporary_table || !thd->current_stmt_binlog_row_based)
|
||||
write_bin_log(thd, TRUE, thd->query(), thd->query_length());
|
||||
my_ok(thd); // This should return record count
|
||||
}
|
||||
if (has_mdl_lock)
|
||||
|
Reference in New Issue
Block a user