Commit ce93a3c2 authored by bell@sanja.is.com.ua's avatar bell@sanja.is.com.ua

postreview fixes

parent bc68cd7d
......@@ -551,6 +551,7 @@ int mysql_ha_flush(THD *thd, TABLE_LIST *tables, uint mode_flags);
#define MYSQL_HA_FLUSH_ALL 0x02
/* sql_base.cc */
#define TMP_TABLE_KEY_EXTRA 8
void set_item_name(Item *item,char *pos,uint length);
bool add_field_to_list(char *field_name, enum enum_field_types type,
char *length, char *decimal,
......
......@@ -816,8 +816,9 @@ TABLE *open_table(THD *thd,const char *db,const char *table_name,
for (table=thd->temporary_tables; table ; table=table->next)
{
if (table->key_length == key_length+8 &&
!memcmp(table->table_cache_key,key,key_length+8))
if (table->key_length == key_length + TMP_TABLE_KEY_EXTRA &&
!memcmp(table->table_cache_key, key,
key_length + TMP_TABLE_KEY_EXTRA))
{
if (table->query_id == thd->query_id)
{
......
......@@ -983,7 +983,7 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
*/
for (tmptable= thd->temporary_tables; tmptable ; tmptable= tmptable->next)
{
if (tmptable->key_length - 8 == table->key_len() &&
if (tmptable->key_length - TMP_TABLE_KEY_EXTRA == table->key_len() &&
!memcmp(tmptable->table_cache_key, table->data(),
table->key_len()))
{
......@@ -993,7 +993,7 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
STRUCT_UNLOCK(&structure_guard_mutex);
/*
We should not store result of this query because it contain
temporary tables => assign following wariable to make check
temporary tables => assign following variable to make check
faster.
*/
thd->safe_to_cache_query=0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment