diff options
author | monty@mysql.com <> | 2005-04-01 15:04:50 +0300 |
---|---|---|
committer | monty@mysql.com <> | 2005-04-01 15:04:50 +0300 |
commit | 201ee3eb78da55c72c627c6aa09a51899e31c4a7 (patch) | |
tree | 7920c948db7d0f2174fb24ba26cd648144fa4850 /sql/sql_error.h | |
parent | e9205dc0f0f6e5dcc184a9e71fb85e9eec51a8a8 (diff) | |
download | mariadb-git-201ee3eb78da55c72c627c6aa09a51899e31c4a7.tar.gz |
Invalid DEFAULT values for CREATE TABLE now generates errors. (Bug #5902)
CAST() now produces warnings when casting a wrong INTEGER or CHAR values. This also applies to implicite string to number casts. (Bug #5912)
ALTER TABLE now fails in STRICT mode if it generates warnings.
Inserting a zero date in a DATE, DATETIME or TIMESTAMP column during TRADITIONAL mode now produces an error. (Bug #5933)
Diffstat (limited to 'sql/sql_error.h')
-rw-r--r-- | sql/sql_error.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/sql/sql_error.h b/sql/sql_error.h new file mode 100644 index 00000000000..223b50be744 --- /dev/null +++ b/sql/sql_error.h @@ -0,0 +1,42 @@ +/* Copyright (C) 2000-2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +class MYSQL_ERROR: public Sql_alloc +{ +public: + enum enum_warning_level + { WARN_LEVEL_NOTE, WARN_LEVEL_WARN, WARN_LEVEL_ERROR, WARN_LEVEL_END}; + + uint code; + enum_warning_level level; + char *msg; + + MYSQL_ERROR(THD *thd, uint code_arg, enum_warning_level level_arg, + const char *msg_arg) + :code(code_arg), level(level_arg) + { + if (msg_arg) + set_msg(thd, msg_arg); + } + void set_msg(THD *thd, const char *msg_arg); +}; + +MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, + uint code, const char *msg); +void push_warning_printf(THD *thd, MYSQL_ERROR::enum_warning_level level, + uint code, const char *format, ...); +void mysql_reset_errors(THD *thd, bool force); +bool mysqld_show_warnings(THD *thd, ulong levels_to_show); |