diff options
author | unknown <monty@mysql.com> | 2005-07-28 16:10:14 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2005-07-28 16:10:14 +0300 |
commit | 79f75d8fad96e7b1da588eb850a25f9e9697ac2e (patch) | |
tree | af22629d2c36ae4196e6f23584c4cecc393b874e /sql/sql_base.cc | |
parent | 520ebda4f22a4471ddedddf1a63561787f31c409 (diff) | |
download | mariadb-git-79f75d8fad96e7b1da588eb850a25f9e9697ac2e.tar.gz |
Cleanups during review of new code
Ensure mysql_close() is called if mysql_set_character_set() fails
libmysql/libmysql.c:
Indentation cleanup
mysql-test/r/select.result:
Fix bad merge & align code with 4.1
mysql-test/r/type_newdecimal.result:
Added test of extreme case
mysql-test/t/select.test:
Fix bad merge & align code with 4.1
mysql-test/t/type_newdecimal.test:
Added test of extreme case
mysys/charset.c:
Removed not used variable
mysys/default.c:
Simplify code
sql-common/client.c:
Ensure mysql_close() is called if mysql_set_character_set() fails
sql/log.cc:
strmov(strmov()) -> strxmov()
sql/sp.cc:
Indentation fixes
sql/sql_acl.cc:
Indentation fixes
sql/sql_base.cc:
Added commments
Moved variable to inner block
sql/sql_show.cc:
Simple optimization (removed loop variable)
sql/sql_trigger.cc:
strmov(strmov()) -> strxmov()
strings/decimal.c:
Indentation fixes
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 65bb0ec047b..930a176f6fa 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1043,26 +1043,26 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root, if (thd->locked_tables || thd->prelocked_mode) { // Using table locks TABLE *best_table= 0; - int best_distance= INT_MIN, distance; + int best_distance= INT_MIN; for (table=thd->open_tables; table ; table=table->next) { if (table->s->key_length == key_length && !memcmp(table->s->table_cache_key, key, key_length) && !my_strcasecmp(system_charset_info, table->alias, alias) && - table->query_id != thd->query_id && /* skip tables already used by this query */ + table->query_id != thd->query_id && /* skip tables already used */ !(thd->prelocked_mode && table->query_id)) { - distance= ((int) table->reginfo.lock_type - - (int) table_list->lock_type); + int distance= ((int) table->reginfo.lock_type - + (int) table_list->lock_type); /* Find a table that either has the exact lock type requested, or has the best suitable lock. In case there is no locked table that has an equal or higher lock than requested, - we still maitain the best_table to produce an error message - about wrong lock mode on the table. The best_table is changed + we us the closest matching lock to be able to produce an error + message about wrong lock mode on the table. The best_table is changed if bd < 0 <= d or bd < d < 0 or 0 <= d < bd. - distance < 0 - we have not enough high lock mode + distance < 0 - No suitable lock found distance > 0 - we have lock mode higher then we require distance == 0 - we have lock mode exactly which we need */ @@ -1071,7 +1071,7 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root, { best_distance= distance; best_table= table; - if (best_distance == 0) + if (best_distance == 0) // Found perfect lock break; } } |