beautifying the error messages

parent a83ed34f
...@@ -178,7 +178,7 @@ const char *Item_ident::full_name() const ...@@ -178,7 +178,7 @@ const char *Item_ident::full_name() const
char *tmp; char *tmp;
if (!table_name) if (!table_name)
return field_name ? field_name : name ? name : "tmp_field"; return field_name ? field_name : name ? name : "tmp_field";
if (db_name) if (db_name && db_name[0])
{ {
tmp=(char*) sql_alloc((uint) strlen(db_name)+(uint) strlen(table_name)+ tmp=(char*) sql_alloc((uint) strlen(db_name)+(uint) strlen(table_name)+
(uint) strlen(field_name)+3); (uint) strlen(field_name)+3);
......
...@@ -1707,7 +1707,7 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables, ...@@ -1707,7 +1707,7 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables,
if (!found_table && report_error) if (!found_table && report_error)
{ {
char buff[NAME_LEN*2+1]; char buff[NAME_LEN*2+1];
if (db) if (db && db[0])
{ {
strxnmov(buff,sizeof(buff)-1,db,".",table_name,NullS); strxnmov(buff,sizeof(buff)-1,db,".",table_name,NullS);
table_name=buff; table_name=buff;
......
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