Commit 7c8fe302 authored by kostja@bodhi.(none)'s avatar kostja@bodhi.(none)

Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime

into  bodhi.(none):/opt/local/work/mysql-5.1-runtime
parents af6db482 5b80d6a1
...@@ -8018,7 +8018,6 @@ REPLACE *init_replace(char * *from, char * *to,uint count, ...@@ -8018,7 +8018,6 @@ REPLACE *init_replace(char * *from, char * *to,uint count,
if (!len) if (!len)
{ {
errno=EINVAL; errno=EINVAL;
my_message(0,"No to-string for last from-string",MYF(ME_BELL));
DBUG_RETURN(0); DBUG_RETURN(0);
} }
states+=len+1; states+=len+1;
......
...@@ -447,7 +447,7 @@ int emb_load_querycache_result(THD *thd, Querycache_stream *src) ...@@ -447,7 +447,7 @@ int emb_load_querycache_result(THD *thd, Querycache_stream *src)
*prev_row= NULL; *prev_row= NULL;
data->embedded_info->prev_ptr= prev_row; data->embedded_info->prev_ptr= prev_row;
return_ok: return_ok:
send_eof(thd); net_send_eof(thd, thd->server_status, thd->total_warn_count);
DBUG_RETURN(0); DBUG_RETURN(0);
err: err:
DBUG_RETURN(1); DBUG_RETURN(1);
......
...@@ -79,3 +79,4 @@ class Querycache_stream ...@@ -79,3 +79,4 @@ class Querycache_stream
uint emb_count_querycache_size(THD *thd); uint emb_count_querycache_size(THD *thd);
int emb_load_querycache_result(THD *thd, Querycache_stream *src); int emb_load_querycache_result(THD *thd, Querycache_stream *src);
void emb_store_querycache_result(Querycache_stream *dst, THD* thd); void emb_store_querycache_result(Querycache_stream *dst, THD* thd);
void net_send_eof(THD *thd, uint server_status, uint total_warn_count);
...@@ -87,6 +87,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command, ...@@ -87,6 +87,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
/* Clear result variables */ /* Clear result variables */
thd->clear_error(); thd->clear_error();
thd->main_da.reset_diagnostics_area();
mysql->affected_rows= ~(my_ulonglong) 0; mysql->affected_rows= ~(my_ulonglong) 0;
mysql->field_count= 0; mysql->field_count= 0;
net_clear_error(net); net_clear_error(net);
...@@ -625,6 +626,7 @@ int check_embedded_connection(MYSQL *mysql, const char *db) ...@@ -625,6 +626,7 @@ int check_embedded_connection(MYSQL *mysql, const char *db)
strmake(sctx->priv_host, (char*) my_localhost, MAX_HOSTNAME-1); strmake(sctx->priv_host, (char*) my_localhost, MAX_HOSTNAME-1);
sctx->priv_user= sctx->user= my_strdup(mysql->user, MYF(0)); sctx->priv_user= sctx->user= my_strdup(mysql->user, MYF(0));
result= check_user(thd, COM_CONNECT, NULL, 0, db, true); result= check_user(thd, COM_CONNECT, NULL, 0, db, true);
net_end_statement(thd);
emb_read_query_result(mysql); emb_read_query_result(mysql);
return result; return result;
} }
......
...@@ -280,29 +280,34 @@ void Log_to_csv_event_handler::cleanup() ...@@ -280,29 +280,34 @@ void Log_to_csv_event_handler::cleanup()
/* log event handlers */ /* log event handlers */
/* /**
Log command to the general log table Log command to the general log table
SYNOPSIS Log given command to the general log table.
log_general()
@param event_time command start timestamp
event_time command start timestamp @param user_host the pointer to the string with user@host info
user_host the pointer to the string with user@host info @param user_host_len length of the user_host string. this is computed
user_host_len length of the user_host string. this is computed once once and passed to all general log event handlers
and passed to all general log event handlers @param thread_id Id of the thread, issued a query
thread_id Id of the thread, issued a query @param command_type the type of the command being logged
command_type the type of the command being logged @param command_type_len the length of the string above
command_type_len the length of the string above @param sql_text the very text of the query being executed
sql_text the very text of the query being executed @param sql_text_len the length of sql_text string
sql_text_len the length of sql_text string
DESCRIPTION @return This function attempts to never call my_error(). This is
necessary, because general logging happens already after a statement
Log given command to the general log table status has been sent to the client, so the client can not see the
error anyway. Besides, the error is not related to the statement
RETURN being executed and is internal, and thus should be handled
FALSE - OK internally (@todo: how?).
TRUE - error occured If a write to the table has failed, the function attempts to
write to a short error message to the file. The failure is also
indicated in the return value.
@retval FALSE OK
@retval TRUE error occured
*/ */
bool Log_to_csv_event_handler:: bool Log_to_csv_event_handler::
...@@ -342,6 +347,20 @@ bool Log_to_csv_event_handler:: ...@@ -342,6 +347,20 @@ bool Log_to_csv_event_handler::
table_list.db= MYSQL_SCHEMA_NAME.str; table_list.db= MYSQL_SCHEMA_NAME.str;
table_list.db_length= MYSQL_SCHEMA_NAME.length; table_list.db_length= MYSQL_SCHEMA_NAME.length;
/*
1) open_performance_schema_table generates an error of the
table can not be opened or is corrupted.
2) "INSERT INTO general_log" can generate warning sometimes.
Suppress these warnings and errors, they can't be dealt with
properly anyway.
QQ: this problem needs to be studied in more detail.
Comment this 2 lines and run "cast.test" to see what's happening.
*/
thd->push_internal_handler(& error_handler);
need_pop= TRUE;
if (!(table= open_performance_schema_table(thd, & table_list, if (!(table= open_performance_schema_table(thd, & table_list,
& open_tables_backup))) & open_tables_backup)))
goto err; goto err;
...@@ -357,14 +376,6 @@ bool Log_to_csv_event_handler:: ...@@ -357,14 +376,6 @@ bool Log_to_csv_event_handler::
/* Honor next number columns if present */ /* Honor next number columns if present */
table->next_number_field= table->found_next_number_field; table->next_number_field= table->found_next_number_field;
/*
"INSERT INTO general_log" can generate warning sometimes.
QQ: this problem needs to be studied in more details.
Comment this 2 lines and run "cast.test" to see what's happening:
*/
thd->push_internal_handler(& error_handler);
need_pop= TRUE;
/* /*
NOTE: we do not call restore_record() here, as all fields are NOTE: we do not call restore_record() here, as all fields are
filled by the Logger (=> no need to load default ones). filled by the Logger (=> no need to load default ones).
......
...@@ -1407,10 +1407,8 @@ int ha_myisam::enable_indexes(uint mode) ...@@ -1407,10 +1407,8 @@ int ha_myisam::enable_indexes(uint mode)
might have been set by the first repair. They can still be seen might have been set by the first repair. They can still be seen
with SHOW WARNINGS then. with SHOW WARNINGS then.
*/ */
#ifndef EMBEDDED_LIBRARY
if (! error) if (! error)
thd->clear_error(); thd->clear_error();
#endif /* EMBEDDED_LIBRARY */
} }
info(HA_STATUS_CONST); info(HA_STATUS_CONST);
thd->proc_info=save_proc_info; thd->proc_info=save_proc_info;
......
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