summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorunknown <holyfoot/hf@hfmain.(none)>2007-06-14 16:41:10 +0500
committerunknown <holyfoot/hf@hfmain.(none)>2007-06-14 16:41:10 +0500
commit6f168d12559d14b10fc3b9df7fec403af39bbc5a (patch)
tree6a54e529a87637aaecb9e9ea0eaa44a985ecf02c /sql/item_cmpfunc.cc
parentd37e1642f2e3c235f72a4deac8fdbf6ed31afbfb (diff)
parentc0ebdff9c76c2b3e09bf5e44c22e68a35ef1affc (diff)
downloadmariadb-git-6f168d12559d14b10fc3b9df7fec403af39bbc5a.tar.gz
Merge bk@192.168.21.1:mysql-5.0
into mysql.com:/d2/hf/mrg/mysql-5.0-opt client/mysqltest.c: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/mysqld.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_yacc.yy: Auto merged mysql-test/r/innodb_mysql.result: merging mysql-test/t/innodb_mysql.test: merging sql/sql_select.cc: merging
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 516d0fcf3e1..ed0c09f0b32 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -1755,6 +1755,23 @@ void Item_func_between::fix_length_and_dec()
ge_cmp.set_datetime_cmp_func(args, args + 1);
le_cmp.set_datetime_cmp_func(args, args + 2);
}
+ else if (args[0]->real_item()->type() == FIELD_ITEM &&
+ thd->lex->sql_command != SQLCOM_CREATE_VIEW &&
+ thd->lex->sql_command != SQLCOM_SHOW_CREATE)
+ {
+ Field *field=((Item_field*) (args[0]->real_item()))->field;
+ if (field->can_be_compared_as_longlong())
+ {
+ /*
+ The following can't be recoded with || as convert_constant_item
+ changes the argument
+ */
+ if (convert_constant_item(thd, field,&args[1]))
+ cmp_type=INT_RESULT; // Works for all types.
+ if (convert_constant_item(thd, field,&args[2]))
+ cmp_type=INT_RESULT; // Works for all types.
+ }
+ }
}