summaryrefslogtreecommitdiff
path: root/sql/mysql_priv.h
diff options
context:
space:
mode:
authorunknown <kostja@bodhi.(none)>2007-11-01 00:10:58 +0300
committerunknown <kostja@bodhi.(none)>2007-11-01 00:10:58 +0300
commitbfae4730530ed6ae42739d560d655eb570641625 (patch)
tree69747828df5a86c88950f6d9b608d5d385d69c0e /sql/mysql_priv.h
parent8365a74e47afd6a9598f21b75f3360448b69fcf6 (diff)
downloadmariadb-git-bfae4730530ed6ae42739d560d655eb570641625.tar.gz
Remove net_printf_error(). Do not talk to network directly in
check_user()/check_connection()/check_for_max_user_connections(). This is a pre-requisite patch for the fix for Bug#12713 "Error in a stored function called from a SELECT doesn't cause ROLLBACK of statem" Implement review comments. sql/mysql_priv.h: check_for_max_user_connections() is used in one place only, make it static. sql/mysqld.cc: Remove net_printf_error(): a consolidation of error reporting facilities is necessary to simplify maintenance of the query cache, the client-server protocol, stored procedure continue handlers. Rewrite the only place where its use is somewhat justified (my_error() can not be used since we need to report an error for the thread that does not exist) with my_snprintf()/net_send_error(). sql/protocol.cc: Remove net_printf_error(). sql/protocol.h: Remove net_printf_error(). sql/sql_connect.cc: Remove net_printf_error(). In check_connection()/check_user()/ check_for_max_user_connections() do not write directly to the network, but use the standard my_error() mechanism to record an error in THD. It will be sent to the client by the caller. This was the last place in the server that would attempt to send an error directly, mainly left untouched by 5.0 refactoring because it is executed only during thread startup. sql/sql_parse.cc: In the old code, when res was greater than 0, it contained an exact error code, e.g. ER_OUT_OF_RESOURCES or NO SUCH DATABASE, or ER_HANDSHAKE_ERROR. I don't know the reason why this error code was ignored, and instead a generic ER_UNKNOWN_COM_ERROR was pushed into the error stack, but knowing the relaxed attitude towards preserving the error codes in the old code, I'm inclinded to think that it was a bug. After this patch, the most specific error message is already pushed, so calling my_message() again is useless. If res is < 0, the error used to be already sent. This is not done by the new code, but will be done later, in the end of dispatch_command(). When this is done, clear_error() will be called for us - it is in the first lines of do_command. To sum up, this change is to remove COM_CHANGE_USER specific error handling in favor of the standard one employed for all other COM_* commands.
Diffstat (limited to 'sql/mysql_priv.h')
-rw-r--r--sql/mysql_priv.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index 3b88fe0fca8..3484b8096e3 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -920,7 +920,6 @@ bool init_new_connection_handler_thread();
void reset_mqh(LEX_USER *lu, bool get_them);
bool check_mqh(THD *thd, uint check_command);
void time_out_user_resource_limits(THD *thd, USER_CONN *uc);
-int check_for_max_user_connections(THD *thd, USER_CONN *uc);
void decrease_user_connections(USER_CONN *uc);
void thd_init_client_charset(THD *thd, uint cs_number);
bool setup_connection_thread_globals(THD *thd);