summaryrefslogtreecommitdiff
path: root/sql/field_conv.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-08-12 22:05:23 +0200
committerSergei Golubchik <sergii@pisem.net>2013-08-12 22:05:23 +0200
commita91a23858de4b346ef6f419b05cd8d87ede51f78 (patch)
treebdbd2b3f4464f967fca27cbd44ba8921cc26fcc6 /sql/field_conv.cc
parent847e0f152bc803bc850f11bc291f8f135bf06556 (diff)
downloadmariadb-git-a91a23858de4b346ef6f419b05cd8d87ede51f78.tar.gz
cleanup
* use sql_mode_for_dates() where appropriate. * always specify an argument for sql_mode_for_dates() (future-proof. easier to notice and fix if the caller will start using thd from a local variable or an argument)
Diffstat (limited to 'sql/field_conv.cc')
-rw-r--r--sql/field_conv.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/sql/field_conv.cc b/sql/field_conv.cc
index 5e16166531d..71ab4265ee3 100644
--- a/sql/field_conv.cc
+++ b/sql/field_conv.cc
@@ -840,8 +840,7 @@ int field_conv(Field *to,Field *from)
(to->real_type() != MYSQL_TYPE_NEWDECIMAL ||
to->field_length == from->field_length) &&
from->charset() == to->charset() &&
- (!(to->table->in_use->variables.sql_mode &
- (MODE_NO_ZERO_IN_DATE | MODE_NO_ZERO_DATE | MODE_INVALID_DATES)) ||
+ (!sql_mode_for_dates(to->table->in_use) ||
(to->type() != MYSQL_TYPE_DATE &&
to->type() != MYSQL_TYPE_DATETIME)) &&
(from->real_type() != MYSQL_TYPE_VARCHAR ||