Commit f95ed609 authored by unknown's avatar unknown

Found bugs fixed


libmysqld/lib_sql.cc:
  This would be more correct
sql/item.cc:
  This error not to be exposed
sql/item_strfunc.cc:
  We don't want login/password stuff in Embedded Library
sql/sql_select.cc:
  This error not to be exposed
sql/sql_table.cc:
  Usual changes here
parent 2da868d4
......@@ -793,6 +793,7 @@ net_field_length(uchar **packet)
return (ulong) uint4korr(pos+1);
}
bool select_send::send_data(List<Item> &items)
{
List_iterator_fast<Item> li(items);
......@@ -956,7 +957,7 @@ int embedded_send_row(THD *thd, int n_fields, char *data, int data_len)
result->prev_ptr= &cur->next;
to= (char*) (cur->data+n_fields+1);
cp= (uchar *)data;
end_field= cur->data + n_fields + 1;
end_field= cur->data + n_fields;
for (cur_field=cur->data; cur_field<end_field; ++cur_field, ++mysql_fields)
{
......@@ -975,6 +976,9 @@ int embedded_send_row(THD *thd, int n_fields, char *data, int data_len)
mysql_fields->max_length=len;
}
}
*cur_field= to;
DBUG_RETURN(0);
}
......@@ -469,6 +469,9 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
cause error ER_NON_UNIQ_ERROR in find_field_in_tables.
*/
SELECT_LEX *last= 0;
#ifdef EMBEDDED_LIBRARY
thd->net.last_errno= 0;
#endif
for (SELECT_LEX *sl= thd->lex.select->outer_select();
sl && !tmp;
sl= sl->outer_select())
......
......@@ -1248,10 +1248,15 @@ String *Item_func_database::val_str(String *str)
String *Item_func_user::val_str(String *str)
{
THD *thd=current_thd;
#ifdef EMBEDDED_LIBRARY
if (str->copy("localuser@localhost", (uint)strlen("localuser@localhost")))
return &empty_string;
#else
if (str->copy((const char*) thd->user,(uint) strlen(thd->user)) ||
str->append('@') ||
str->append(thd->host ? thd->host : thd->ip ? thd->ip : ""))
return &empty_string;
#endif
return str;
}
......
......@@ -5249,6 +5249,9 @@ end_update(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
{
Item *item= *group->item;
item->save_org_in_field(group->field);
#ifdef EMBEDDED_LIBRARY
join->thd->net.last_errno= 0;
#endif
/* Store in the used key if the field was 0 */
if (item->maybe_null)
group->buff[-1]=item->null_value ? 1 : 0;
......
......@@ -939,8 +939,7 @@ static int send_check_errmsg(THD* thd, TABLE_LIST* table,
net_store_data(packet, "error");
net_store_data(packet, errmsg);
thd->net.last_error[0]=0;
if (my_net_write(&thd->net, (char*) thd->packet.ptr(),
packet->length()))
if (SEND_ROW(thd, &thd->net, 4, (char*) thd->packet.ptr(), packet->length()))
return -1;
return 1;
}
......@@ -1150,6 +1149,9 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables,
}
int result_code = (table->table->file->*operator_func)(thd, check_opt);
#ifdef EMBEDDED_LIBRARY
thd->net.last_errno= 0; // these errors shouldn't get client
#endif
packet->length(0);
net_store_data(packet, table_name);
net_store_data(packet, operator_name);
......
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