diff options
author | unknown <serg@serg.mylan> | 2004-11-24 17:22:29 +0100 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2004-11-24 17:22:29 +0100 |
commit | 0052dc8210b68a83736f547abf41f76a977e2826 (patch) | |
tree | a58c2b990a3c6e8f7ba2f923989fbb72534bfd38 /sql | |
parent | 85593e9079926a09ad42ec4572a691092db0033b (diff) | |
download | mariadb-git-0052dc8210b68a83736f547abf41f76a977e2826.tar.gz |
send_warning removed
Diffstat (limited to 'sql')
-rw-r--r-- | sql/protocol.cc | 30 | ||||
-rw-r--r-- | sql/sql_class.cc | 3 | ||||
-rw-r--r-- | sql/sql_parse.cc | 14 |
3 files changed, 10 insertions, 37 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc index 88be2710422..11a915ec151 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -131,36 +131,6 @@ void net_send_error(THD *thd, uint sql_errno, const char *err) DBUG_VOID_RETURN; } - -/* - Send a warning to the end user - - SYNOPSIS - send_warning() - thd Thread handler - sql_errno Warning number (error message) - err Error string. If not set, use ER(sql_errno) - - DESCRIPTION - Register the warning so that the user can get it with mysql_warnings() - Send an ok (+ warning count) to the end user. -*/ - -void send_warning(THD *thd, uint sql_errno, const char *err) -{ - DBUG_ENTER("send_warning"); - if (thd->spcont && - thd->spcont->find_handler(sql_errno, MYSQL_ERROR::WARN_LEVEL_WARN)) - { - DBUG_VOID_RETURN; - } - push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, sql_errno, - err ? err : ER(sql_errno)); - send_ok(thd); - DBUG_VOID_RETURN; -} - - /* Write error package and flush to client It's a little too low level, but I don't want to use another buffer for diff --git a/sql/sql_class.cc b/sql/sql_class.cc index ae2261e19f9..cc178a3121b 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1754,7 +1754,8 @@ bool select_dumpvar::send_data(List<Item> &items) bool select_dumpvar::send_eof() { if (! row_count) - send_warning(thd, ER_SP_FETCH_NO_DATA); + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_SP_FETCH_NO_DATA, ER(ER_SP_FETCH_NO_DATA)); ::send_ok(thd,row_count); return 0; } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 89807765421..a966d596c7c 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3579,9 +3579,10 @@ create_error: message in the error log, so we don't send it. */ if ((thd->options & OPTION_STATUS_NO_TRANS_UPDATE) && !thd->slave_thread) - send_warning(thd,ER_WARNING_NOT_COMPLETE_ROLLBACK,0); - else - send_ok(thd); + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARNING_NOT_COMPLETE_ROLLBACK, + ER(ER_WARNING_NOT_COMPLETE_ROLLBACK)); + send_ok(thd); } else res= TRUE; @@ -3591,9 +3592,10 @@ create_error: if (!ha_rollback_to_savepoint(thd, lex->savepoint_name)) { if ((thd->options & OPTION_STATUS_NO_TRANS_UPDATE) && !thd->slave_thread) - send_warning(thd, ER_WARNING_NOT_COMPLETE_ROLLBACK, 0); - else - send_ok(thd); + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_WARNING_NOT_COMPLETE_ROLLBACK, + ER(ER_WARNING_NOT_COMPLETE_ROLLBACK)); + send_ok(thd); } else goto error; |