diff options
author | unknown <monty@mysql.com> | 2005-02-24 23:33:42 +0200 |
---|---|---|
committer | unknown <monty@mysql.com> | 2005-02-24 23:33:42 +0200 |
commit | fc785bd445d8dcd859551c6e5e7855a3781254fc (patch) | |
tree | 7dbb7787461bf6040b70c1701768dfa24df638d8 /sql/sql_error.cc | |
parent | a00749a13ec09c4f4fe1fbaa5395f2996863de4b (diff) | |
download | mariadb-git-fc785bd445d8dcd859551c6e5e7855a3781254fc.tar.gz |
Show all generated warnings in SHOW ERROR
Previously we only stored the first given error (the error sent to the client)
include/mysys_err.h:
Moved ER_FILENOTFOUND last to avoid getting 'error 0'
mysql-test/r/backup.result:
More warnings from in case of errors
mysql-test/r/innodb.result:
More warnings from in case of errors
mysql-test/r/key_cache.result:
More warnings from in case of errors
mysql-test/r/myisam.result:
More warnings from in case of errors
mysql-test/r/preload.result:
More warnings from in case of errors
mysql-test/r/repair.result:
More warnings from in case of errors
mysql-test/r/rpl_failed_optimize.result:
More warnings from in case of errors
mysql-test/r/subselect.result:
More warnings from in case of errors
mysql-test/t/backup.test:
Portability fix
mysql-test/t/innodb.test:
Avoid some warnings
mysql-test/t/myisam.test:
Portability fix
mysql-test/t/rpl_rotate_logs.test:
Portablitiy fix
mysys/errors.c:
Move ER_FILENOTFOUND last to avoid error 0
sql/mysql_priv.h:
Indentation change
sql/mysqld.cc:
Save all given errors for SHOW ERRORS
sql/protocol.cc:
Store new errors for SHOW ERROR
(Ignore those that are already reported with my_error())
sql/sql_class.cc:
More errors with SHOW ERROR
sql/sql_class.h:
More errors with SHOW ERROR
sql/sql_error.cc:
More errors with SHOW ERROR
sql/sql_parse.cc:
Temporary fix: Don't give error for the to-be-removed 'pre-open tables code'
sql/sql_show.cc:
More debugging
Don't register errors while populating schema tables.
(If we do, we get a LOT of warnings from information_schema.test)
sql/sql_table.cc:
Don't register errors from handler in drop table (as we already do it the upper level DROP TABLE code)
Don't register errors for 'restore_table' as in most cases the table doesn't exists
sql/sql_union.cc:
Use file->write_row() instead of 'write_record'.
This gives us easer to handle error messages and is faster than the old version
Diffstat (limited to 'sql/sql_error.cc')
-rw-r--r-- | sql/sql_error.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sql/sql_error.cc b/sql/sql_error.cc index 79f7579d311..4d254b95514 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -106,8 +106,9 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, MYSQL_ERROR *err= 0; DBUG_ENTER("push_warning"); - if (level == MYSQL_ERROR::WARN_LEVEL_NOTE && !(thd->options & OPTION_SQL_NOTES)) - return(0); + if (level == MYSQL_ERROR::WARN_LEVEL_NOTE && + !(thd->options & OPTION_SQL_NOTES)) + DBUG_RETURN(0); if (thd->query_id != thd->warn_id) mysql_reset_errors(thd); @@ -126,9 +127,14 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, if ((int) level >= (int) MYSQL_ERROR::WARN_LEVEL_WARN && thd->really_abort_on_warning()) { + /* Avoid my_message() calling push_warning */ + bool no_warnings_for_error= thd->no_warnings_for_error; + thd->no_warnings_for_error= 1; thd->killed= THD::KILL_BAD_DATA; my_message(code, msg, MYF(0)); - DBUG_RETURN(NULL); + thd->no_warnings_for_error= no_warnings_for_error; + /* Store error in error list (as my_message() didn't do it in this case */ + level= MYSQL_ERROR::WARN_LEVEL_ERROR; } if (thd->warn_list.elements < thd->variables.max_error_count) |