diff options
author | unknown <bell@sanja.is.com.ua> | 2004-10-22 22:51:04 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2004-10-22 22:51:04 +0300 |
commit | 84f921b7187308eaff28d84073305646166544ab (patch) | |
tree | 27ec96cbef4d5b34e9103f7cafd330eda5119b2d /sql | |
parent | 3b8bb30022a212d3fbd751b398aaa5ab6ac7f0fb (diff) | |
download | mariadb-git-84f921b7187308eaff28d84073305646166544ab.tar.gz |
postreview fixes
sql/mysql_priv.h:
constant definition
sql/sql_base.cc:
difine used instead of constant
sql/sql_cache.cc:
difine used instead of constant
typo fixed
Diffstat (limited to 'sql')
-rw-r--r-- | sql/mysql_priv.h | 1 | ||||
-rw-r--r-- | sql/sql_base.cc | 5 | ||||
-rw-r--r-- | sql/sql_cache.cc | 4 |
3 files changed, 6 insertions, 4 deletions
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index b5e571e74d0..b123927d09e 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -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, diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 72400bf0abb..ddc81053357 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -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) { diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 8e953e223a9..f503a63e752 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -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; |