summaryrefslogtreecommitdiff
path: root/sql/mysqld.cc
diff options
context:
space:
mode:
authorbell@sanja.is.com.ua <>2004-10-20 04:04:37 +0300
committerbell@sanja.is.com.ua <>2004-10-20 04:04:37 +0300
commit4714a6e7448672b93313deddfa67ad83f2084d01 (patch)
tree55e6ec4a0a572c0be2ba69da166ea204bf96502e /sql/mysqld.cc
parent09e9651accec3339555634cf4699cb08f1945510 (diff)
downloadmariadb-git-4714a6e7448672b93313deddfa67ad83f2084d01.tar.gz
errors without code removed
net_printf/send_error calls replaced by my_error family functions -1/1 (sent/unsent) error reporting removed (WL#2133)
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r--sql/mysqld.cc20
1 files changed, 16 insertions, 4 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index db81b14c9c9..c408478cb15 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -1145,7 +1145,7 @@ static void server_init(void)
WSADATA WsaData;
if (SOCKET_ERROR == WSAStartup (0x0101, &WsaData))
{
- my_message(0,"WSAStartup Failed\n",MYF(0));
+ my_error(ER_WSAS_FAILED, MYF(0));
unireg_abort(1);
}
}
@@ -1298,8 +1298,9 @@ void yyerror(const char *s)
/* "parse error" changed into "syntax error" between bison 1.75 and 1.875 */
if (strcmp(s,"parse error") == 0 || strcmp(s,"syntax error") == 0)
s=ER(ER_SYNTAX_ERROR);
- net_printf(thd,ER_PARSE_ERROR, s, yytext ? (char*) yytext : "",
- thd->lex->yylineno);
+ my_printf_error(ER_PARSE_ERROR, ER(ER_PARSE_ERROR), MYF(0), s,
+ (yytext ? (char*) yytext : ""),
+ thd->lex->yylineno);
}
@@ -2091,6 +2092,11 @@ extern "C" int my_message_sql(uint error, const char *str,
THD *thd;
DBUG_ENTER("my_message_sql");
DBUG_PRINT("error", ("error: %u message: '%s'", error, str));
+ /*
+ Put here following assertion when situation with EE_* error codes
+ will be fixed
+ DBUG_ASSERT(error != 0);
+ */
if ((thd= current_thd))
{
if (thd->spcont &&
@@ -2098,6 +2104,9 @@ extern "C" int my_message_sql(uint error, const char *str,
{
DBUG_RETURN(0);
}
+
+ thd->query_error= 1; // needed to catch query errors during replication
+
/*
thd->lex->current_select == 0 if lex structure is not inited
(not query command (COM_QUERY))
@@ -2112,6 +2121,9 @@ extern "C" int my_message_sql(uint error, const char *str,
{
NET *net= &thd->net;
net->report_error= 1;
+#ifndef EMBEDDED_LIBRARY /* TODO query cache in embedded library*/
+ query_cache_abort(net);
+#endif
if (!net->last_error[0]) // Return only first message
{
strmake(net->last_error, str, sizeof(net->last_error)-1);
@@ -3381,7 +3393,7 @@ static void create_new_thread(THD *thd)
("Can't create thread to handle request (error %d)",
error));
thread_count--;
- thd->killed= THD::KILL_CONNECTION; // Safety
+ thd->killed= THD::KILL_CONNECTION; // Safety
(void) pthread_mutex_unlock(&LOCK_thread_count);
statistic_increment(aborted_connects,&LOCK_status);
net_printf(thd,ER_CANT_CREATE_THREAD,error);