diff options
author | holyfoot/hf@hfmain.(none) <> | 2007-06-14 16:41:10 +0500 |
---|---|---|
committer | holyfoot/hf@hfmain.(none) <> | 2007-06-14 16:41:10 +0500 |
commit | 8ccc50b303389879acc3055912577958d94547dc (patch) | |
tree | 6a54e529a87637aaecb9e9ea0eaa44a985ecf02c /sql/item_cmpfunc.cc | |
parent | d870247de1f242c9f44c06e20a0fb2f5e308107d (diff) | |
parent | 20ad51500325027dcf629867c053ce0efeb5a81e (diff) | |
download | mariadb-git-8ccc50b303389879acc3055912577958d94547dc.tar.gz |
Merge bk@192.168.21.1:mysql-5.0
into mysql.com:/d2/hf/mrg/mysql-5.0-opt
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r-- | sql/item_cmpfunc.cc | 17 |
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. + } + } } |