diff options
author | monty@mysql.com <> | 2005-10-13 19:40:46 +0300 |
---|---|---|
committer | monty@mysql.com <> | 2005-10-13 19:40:46 +0300 |
commit | 49a30ef51397c810055c0d6e7db191e67b42c86d (patch) | |
tree | 1c1d39c480d1b8421f41d2335a741a0045805630 | |
parent | 5513ab69b76add2457b5288849484460fae78504 (diff) | |
download | mariadb-git-49a30ef51397c810055c0d6e7db191e67b42c86d.tar.gz |
Fixes during review of new pushed code
-rw-r--r-- | sql/handler.cc | 13 | ||||
-rw-r--r-- | sql/item.cc | 4 | ||||
-rw-r--r-- | sql/table.cc | 8 | ||||
-rw-r--r-- | sql/unireg.cc | 6 |
4 files changed, 17 insertions, 14 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index 15394851e02..81e94af5dc7 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -185,16 +185,16 @@ enum db_type ha_resolve_by_name(const char *name, uint namelen) handlerton **types; if (thd && !my_strnncoll(&my_charset_latin1, - (const uchar *)name, namelen, - (const uchar *)"DEFAULT", 7)) + (const uchar *)name, namelen, + (const uchar *)"DEFAULT", 7)) return (enum db_type) thd->variables.table_type; retest: for (types= sys_table_types; *types; types++) { if (!my_strnncoll(&my_charset_latin1, - (const uchar *)name, namelen, - (const uchar *)(*types)->name, strlen((*types)->name))) + (const uchar *)name, namelen, + (const uchar *)(*types)->name, strlen((*types)->name))) return (enum db_type) (*types)->db_type; } @@ -204,8 +204,9 @@ retest: for (table_alias= sys_table_aliases; table_alias->type; table_alias++) { if (!my_strnncoll(&my_charset_latin1, - (const uchar *)name, namelen, - (const uchar *)table_alias->alias, strlen(table_alias->alias))) + (const uchar *)name, namelen, + (const uchar *)table_alias->alias, + strlen(table_alias->alias))) { name= table_alias->type; namelen= strlen(name); diff --git a/sql/item.cc b/sql/item.cc index 5961db0bc1f..dd6c7493ef9 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -4628,7 +4628,7 @@ void Item_ref::cleanup() void Item_ref::print(String *str) { - if (ref && *ref) + if (ref) (*ref)->print(str); else Item_ident::print(str); @@ -4814,7 +4814,7 @@ void Item_ref::make_field(Send_field *field) void Item_ref_null_helper::print(String *str) { str->append("<ref_null_helper>(", 18); - if (ref && *ref) + if (ref) (*ref)->print(str); else str->append('?'); diff --git a/sql/table.cc b/sql/table.cc index 66881c1a31c..722e4e4df25 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -310,6 +310,7 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, char *buff, *next_chunk, *buff_end; if (!(next_chunk= buff= my_malloc(n_length, MYF(MY_WME)))) goto err; + buff_end= buff + n_length; if (my_pread(file, (byte*)buff, n_length, record_offset + share->reclength, MYF(MY_NABP))) { @@ -324,13 +325,14 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, goto err; } next_chunk+= share->connect_string.length + 2; - buff_end= buff + n_length; if (next_chunk + 2 < buff_end) { uint str_db_type_length= uint2korr(next_chunk); share->db_type= ha_resolve_by_name(next_chunk + 2, str_db_type_length); - DBUG_PRINT("enter", ("Setting dbtype to: %d - %d - '%.*s'\n", share->db_type, - str_db_type_length, str_db_type_length, next_chunk + 2)); + DBUG_PRINT("enter", ("Setting dbtype to: %d - %d - '%.*s'\n", + share->db_type, + str_db_type_length, str_db_type_length, + next_chunk + 2)); next_chunk+= str_db_type_length + 2; } my_free(buff, MYF(0)); diff --git a/sql/unireg.cc b/sql/unireg.cc index 3420e359c27..065f8583f71 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -119,10 +119,10 @@ bool mysql_create_frm(THD *thd, my_string file_name, reclength=uint2korr(forminfo+266); /* Calculate extra data segment length */ - str_db_type.str= (char *)ha_get_storage_engine(create_info->db_type); + str_db_type.str= (char *) ha_get_storage_engine(create_info->db_type); str_db_type.length= strlen(str_db_type.str); - create_info->extra_size= 2 + str_db_type.length; - create_info->extra_size+= create_info->connect_string.length + 2; + create_info->extra_size= (2 + str_db_type.length + + 2 + create_info->connect_string.length); if ((file=create_frm(thd, file_name, db, table, reclength, fileinfo, create_info, keys)) < 0) |