Below is the list of changes that have just been committed into a local
5.1 repository of kostja. When kostja does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-12-13 23:58:55+03:00, kostja@bodhi.(none) +6 -0
Fix broken embedded build (broken by the patch for Bug#12713, first part).
client/mysqltest.c@stripped, 2007-12-13 23:58:52+03:00, kostja@bodhi.(none) +0 -1
Remove a call to my_message() (server call) in case of a client error.
It asserts in the embedded build now, since is called after send_ok().
libmysqld/emb_qcache.cc@stripped, 2007-12-13 23:58:53+03:00, kostja@bodhi.(none) +1 -1
Use net_send_eof (embedded implementation) in embedded query cache/
send result to client, since send_eof currently does not
send anything.
libmysqld/emb_qcache.h@stripped, 2007-12-13 23:58:53+03:00, kostja@bodhi.(none) +1 -0
Declare net_send_eof.
libmysqld/lib_sql.cc@stripped, 2007-12-13 23:58:53+03:00, kostja@bodhi.(none) +2 -0
Fix the main loop of the embedded server to use the new Diagnostics_area
API.
sql/log.cc@stripped, 2007-12-13 23:58:53+03:00, kostja@bodhi.(none) +39 -28
Silence errors of open_performance_schema_table. This function
is called for general logging, and it happens after the error
has been sent to the client, and thus triggers an assert.
storage/myisam/ha_myisam.cc@stripped, 2007-12-13 23:58:53+03:00, kostja@bodhi.(none) +0 -2
Remove an old hack that broke repair.test in embedded build:
unless we clear an error here, the server attempts to send OK after
ERROR. This currently asserts.
diff -Nrup a/client/mysqltest.c b/client/mysqltest.c
--- a/client/mysqltest.c 2007-11-06 13:07:12 +03:00
+++ b/client/mysqltest.c 2007-12-13 23:58:52 +03:00
@@ -8018,7 +8018,6 @@ REPLACE *init_replace(char * *from, char
if (!len)
{
errno=EINVAL;
- my_message(0,"No to-string for last from-string",MYF(ME_BELL));
DBUG_RETURN(0);
}
states+=len+1;
diff -Nrup a/libmysqld/emb_qcache.cc b/libmysqld/emb_qcache.cc
--- a/libmysqld/emb_qcache.cc 2007-05-10 13:59:24 +04:00
+++ b/libmysqld/emb_qcache.cc 2007-12-13 23:58:53 +03:00
@@ -447,7 +447,7 @@ int emb_load_querycache_result(THD *thd,
*prev_row= NULL;
data->embedded_info->prev_ptr= prev_row;
return_ok:
- send_eof(thd);
+ net_send_eof(thd, thd->server_status, thd->total_warn_count);
DBUG_RETURN(0);
err:
DBUG_RETURN(1);
diff -Nrup a/libmysqld/emb_qcache.h b/libmysqld/emb_qcache.h
--- a/libmysqld/emb_qcache.h 2007-05-10 13:59:24 +04:00
+++ b/libmysqld/emb_qcache.h 2007-12-13 23:58:53 +03:00
@@ -79,3 +79,4 @@ public:
uint emb_count_querycache_size(THD *thd);
int emb_load_querycache_result(THD *thd, Querycache_stream *src);
void emb_store_querycache_result(Querycache_stream *dst, THD* thd);
+void net_send_eof(THD *thd, uint server_status, uint total_warn_count);
diff -Nrup a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
--- a/libmysqld/lib_sql.cc 2007-12-12 18:20:53 +03:00
+++ b/libmysqld/lib_sql.cc 2007-12-13 23:58:53 +03:00
@@ -87,6 +87,7 @@ emb_advanced_command(MYSQL *mysql, enum
/* Clear result variables */
thd->clear_error();
+ thd->main_da.reset_diagnostics_area();
mysql->affected_rows= ~(my_ulonglong) 0;
mysql->field_count= 0;
net_clear_error(net);
@@ -625,6 +626,7 @@ int check_embedded_connection(MYSQL *mys
strmake(sctx->priv_host, (char*) my_localhost, MAX_HOSTNAME-1);
sctx->priv_user= sctx->user= my_strdup(mysql->user, MYF(0));
result= check_user(thd, COM_CONNECT, NULL, 0, db, true);
+ net_end_statement(thd);
emb_read_query_result(mysql);
return result;
}
diff -Nrup a/sql/log.cc b/sql/log.cc
--- a/sql/log.cc 2007-11-14 13:01:42 +03:00
+++ b/sql/log.cc 2007-12-13 23:58:53 +03:00
@@ -280,29 +280,34 @@ void Log_to_csv_event_handler::cleanup()
/* log event handlers */
-/*
+/**
Log command to the general log table
- SYNOPSIS
- log_general()
+ Log given command to the general log table.
- event_time command start timestamp
- user_host the pointer to the string with user@host info
- user_host_len length of the user_host string. this is computed once
- and passed to all general log event handlers
- thread_id Id of the thread, issued a query
- command_type the type of the command being logged
- command_type_len the length of the string above
- sql_text the very text of the query being executed
- sql_text_len the length of sql_text string
-
- DESCRIPTION
-
- Log given command to the general log table
-
- RETURN
- FALSE - OK
- TRUE - error occured
+ @param event_time command start timestamp
+ @param user_host the pointer to the string with user@host info
+ @param user_host_len length of the user_host string. this is computed
+ once and passed to all general log event handlers
+ @param thread_id Id of the thread, issued a query
+ @param command_type the type of the command being logged
+ @param command_type_len the length of the string above
+ @param sql_text the very text of the query being executed
+ @param sql_text_len the length of sql_text string
+
+
+ @return This function attempts to never call my_error(). This is
+ necessary, because general logging happens already after a statement
+ 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
+ being executed and is internal, and thus should be handled
+ internally (@todo: how?).
+ 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::
@@ -342,6 +347,20 @@ bool Log_to_csv_event_handler::
table_list.db= MYSQL_SCHEMA_NAME.str;
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,
& open_tables_backup)))
goto err;
@@ -356,14 +375,6 @@ bool Log_to_csv_event_handler::
/* Honor next number columns if present */
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
diff -Nrup a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
--- a/storage/myisam/ha_myisam.cc 2007-12-06 01:31:16 +03:00
+++ b/storage/myisam/ha_myisam.cc 2007-12-13 23:58:53 +03:00
@@ -1407,10 +1407,8 @@ int ha_myisam::enable_indexes(uint mode)
might have been set by the first repair. They can still be seen
with SHOW WARNINGS then.
*/
-#ifndef EMBEDDED_LIBRARY
if (! error)
thd->clear_error();
-#endif /* EMBEDDED_LIBRARY */
}
info(HA_STATUS_CONST);
thd->proc_info=save_proc_info;
| Thread |
|---|
| • bk commit into 5.1 tree (kostja:1.2643) BUG#12713 | konstantin | 13 Dec |