mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fixes and code cleanups after merge with 4.0.3
Warning handling and initial prepared statement handling (last not complete yet) Changed a lot of functions that returned 0/1 to my_bool type. GRANT handling now uses read/write locks instead of mutex Change basic net functions to use THD instead of NET (needed for 4.1 protocol) Use my_sprintf instead of sprintf() + strlen() Added alloc_query() to be able to chare query initialization code with prepared statements. Cleanup handling of SHOW COUNT(*) WARNINGS and SELECT LAST_INSERT_ID() Note that the following test fails (will be fixed ASAP): sub_select, union, rpl_rotate_logs and rpl_mystery22
This commit is contained in:
@ -333,7 +333,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields,
|
||||
|
||||
if (values_list.elements == 1 && (!(thd->options & OPTION_WARNINGS) ||
|
||||
!thd->cuted_fields))
|
||||
send_ok(&thd->net,info.copied+info.deleted,id);
|
||||
send_ok(thd,info.copied+info.deleted,id);
|
||||
else
|
||||
{
|
||||
char buff[160];
|
||||
@ -345,7 +345,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List<Item> &fields,
|
||||
else
|
||||
sprintf(buff,ER(ER_INSERT_INFO),info.records,info.deleted,
|
||||
thd->cuted_fields);
|
||||
::send_ok(&thd->net,info.copied+info.deleted,(ulonglong)id,buff);
|
||||
::send_ok(thd,info.copied+info.deleted,(ulonglong)id,buff);
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
|
||||
@ -667,7 +667,7 @@ static TABLE *delayed_get_table(THD *thd,TABLE_LIST *table_list)
|
||||
delete tmp;
|
||||
thd->fatal_error=1;
|
||||
pthread_mutex_unlock(&LOCK_delayed_create);
|
||||
net_printf(&thd->net,ER_CANT_CREATE_THREAD,error);
|
||||
net_printf(thd,ER_CANT_CREATE_THREAD,error);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
@ -1334,7 +1334,7 @@ bool select_insert::send_data(List<Item> &values)
|
||||
|
||||
void select_insert::send_error(uint errcode,const char *err)
|
||||
{
|
||||
::send_error(&thd->net,errcode,err);
|
||||
::send_error(thd,errcode,err);
|
||||
table->file->extra(HA_EXTRA_NO_CACHE);
|
||||
table->file->activate_all_index(thd);
|
||||
ha_rollback_stmt(thd);
|
||||
@ -1360,7 +1360,7 @@ bool select_insert::send_eof()
|
||||
if (error)
|
||||
{
|
||||
table->file->print_error(error,MYF(0));
|
||||
::send_error(&thd->net);
|
||||
::send_error(thd);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
@ -1374,7 +1374,7 @@ bool select_insert::send_eof()
|
||||
thd->cuted_fields);
|
||||
if (last_insert_id)
|
||||
thd->insert_id(last_insert_id); // For update log
|
||||
::send_ok(&thd->net,info.copied,last_insert_id,buff);
|
||||
::send_ok(thd,info.copied,last_insert_id,buff);
|
||||
mysql_update_log.write(thd,thd->query,thd->query_length);
|
||||
if (mysql_bin_log.is_open())
|
||||
{
|
||||
|
Reference in New Issue
Block a user