summaryrefslogtreecommitdiff
path: root/sql/sql_time.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mnogosearch.org>2014-01-27 15:05:23 +0400
committerAlexander Barkov <bar@mnogosearch.org>2014-01-27 15:05:23 +0400
commit0ad8eaeb56a049df2947516d3d7ec49301d8d09d (patch)
tree151f9c4560a15f39d039061a4877e8775b6dc792 /sql/sql_time.cc
parentba3d0b173a5610905b31b78367c50700e8032b0b (diff)
parent7ea9d1e692c69c8715d98a9dbc44289d47a65447 (diff)
downloadmariadb-git-0ad8eaeb56a049df2947516d3d7ec49301d8d09d.tar.gz
Merge 5.3 -> 5.5
Diffstat (limited to 'sql/sql_time.cc')
-rw-r--r--sql/sql_time.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/sql/sql_time.cc b/sql/sql_time.cc
index 2c89237c2d2..efcde017671 100644
--- a/sql/sql_time.cc
+++ b/sql/sql_time.cc
@@ -230,6 +230,20 @@ check_date_with_warn(const MYSQL_TIME *ltime, ulonglong fuzzy_date,
}
+bool
+adjust_time_range_with_warn(MYSQL_TIME *ltime, uint dec)
+{
+ MYSQL_TIME copy= *ltime;
+ ErrConvTime str(&copy);
+ int warnings= 0;
+ if (check_time_range(ltime, dec, &warnings))
+ return true;
+ if (warnings)
+ make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ &str, MYSQL_TIMESTAMP_TIME, NullS);
+ return false;
+}
+
/*
Convert a string to 8-bit representation,
for use in str_to_time/str_to_date/str_to_date.