summaryrefslogtreecommitdiff
path: root/sql/time.cc
diff options
context:
space:
mode:
authorgluh@eagle.intranet.mysql.r18.ru <>2005-12-02 15:01:44 +0400
committergluh@eagle.intranet.mysql.r18.ru <>2005-12-02 15:01:44 +0400
commite9d70e4b97cd0232c1575516f395f6c7b7f100da (patch)
tree65e24243474e43801b96670b9012967868c3a50a /sql/time.cc
parent36c45752e30fdb91659d6efd563e8f449a176ad1 (diff)
downloadmariadb-git-e9d70e4b97cd0232c1575516f395f6c7b7f100da.tar.gz
Fix for bug#8294 Traditional: Misleading error message for invalid CAST to DATE
-issue more correct message for incorrect date|datetime|time values -ER_WARN_DATA_OUT_OF_RANGE message is changed -added new error message
Diffstat (limited to 'sql/time.cc')
-rw-r--r--sql/time.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/sql/time.cc b/sql/time.cc
index 5069031081d..480cafaab34 100644
--- a/sql/time.cc
+++ b/sql/time.cc
@@ -711,9 +711,15 @@ void make_truncated_value_warning(THD *thd, const char *str_val,
type_str, str.c_ptr(), field_name,
(ulong) thd->row_count);
else
- cs->cset->snprintf(cs, warn_buff, sizeof(warn_buff),
- ER(ER_TRUNCATED_WRONG_VALUE),
- type_str, str.c_ptr());
+ {
+ if (time_type > MYSQL_TIMESTAMP_ERROR)
+ cs->cset->snprintf(cs, warn_buff, sizeof(warn_buff),
+ ER(ER_TRUNCATED_WRONG_VALUE),
+ type_str, str.c_ptr());
+ else
+ cs->cset->snprintf(cs, warn_buff, sizeof(warn_buff),
+ ER(ER_WRONG_VALUE), type_str, str.c_ptr());
+ }
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE, warn_buff);
}