1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge gleb.loc:/home/uchum/work/bk/5.0-opt

into  gleb.loc:/home/uchum/work/bk/5.1-opt
This commit is contained in:
gshchepa/uchum@gleb.loc
2007-07-27 13:38:11 +05:00
4 changed files with 37 additions and 6 deletions

View File

@@ -549,6 +549,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
int error, res;
bool transactional_table, joins_freed= FALSE;
bool changed;
bool was_insert_delayed= (table_list->lock_type == TL_WRITE_DELAYED);
uint value_count;
ulong counter = 1;
ulonglong id;
@@ -832,14 +833,16 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
}
transactional_table= table->file->has_transactions();
if ((changed= (info.copied || info.deleted || info.updated)))
if ((changed= (info.copied || info.deleted || info.updated)) ||
was_insert_delayed)
{
/*
Invalidate the table in the query cache if something changed.
For the transactional algorithm to work the invalidation must be
before binlog writing and ha_autocommit_or_rollback
*/
query_cache_invalidate3(thd, table_list, 1);
if (changed)
query_cache_invalidate3(thd, table_list, 1);
if (error <= 0 || !transactional_table)
{
if (mysql_bin_log.is_open())
@@ -880,7 +883,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
error=1;
}
}
if (!transactional_table)
if (!transactional_table && changed)
thd->no_trans_update.all= TRUE;
}
}