diff options
author | monty@mishka.local <> | 2004-09-28 20:08:00 +0300 |
---|---|---|
committer | monty@mishka.local <> | 2004-09-28 20:08:00 +0300 |
commit | f2941380c4e69f55abc0f09c2e0091ea0cdf3c00 (patch) | |
tree | 7f0311baaca32e6242f23dcf0a89ed38e39c9ac0 /sql/sp_rcontext.cc | |
parent | 095f7e874087183fdc2fc914708b579175da95f3 (diff) | |
download | mariadb-git-f2941380c4e69f55abc0f09c2e0091ea0cdf3c00.tar.gz |
Strict mode & better warnings
Under strict mode MySQL will generate an error message if there was any conversion when assigning data to a field.
Added checking of date/datetime fields.
If strict mode, give error if we have not given value to field without a default value (for INSERT)
Diffstat (limited to 'sql/sp_rcontext.cc')
-rw-r--r-- | sql/sp_rcontext.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc index 2f7bdbffa2b..169c9809383 100644 --- a/sql/sp_rcontext.cc +++ b/sql/sp_rcontext.cc @@ -57,7 +57,8 @@ sp_rcontext::set_item_eval(uint idx, Item *i, enum_field_types type) } int -sp_rcontext::find_handler(uint sql_errno) +sp_rcontext::find_handler(uint sql_errno, + MYSQL_ERROR::enum_warning_level level) { if (in_handler) return 0; // Already executing a handler @@ -82,7 +83,8 @@ sp_rcontext::find_handler(uint sql_errno) found= 1; break; case sp_cond_type_t::warning: - if (sqlstate[0] == '0' && sqlstate[1] == '1') + if (sqlstate[0] == '0' && sqlstate[1] == '1' || + level == MYSQL_ERROR::WARN_LEVEL_WARN) found= 1; break; case sp_cond_type_t::notfound: @@ -90,7 +92,8 @@ sp_rcontext::find_handler(uint sql_errno) found= 1; break; case sp_cond_type_t::exception: - if (sqlstate[0] != '0' || sqlstate[1] > '2') + if (sqlstate[0] != '0' || sqlstate[1] > '2' || + level == MYSQL_ERROR::WARN_LEVEL_ERROR) found= 1; break; } |