mirror of
https://github.com/MariaDB/server.git
synced 2026-05-10 17:14:30 +02:00
a fix (bug #2885: like datetime)
This commit is contained in:
parent
188535bba0
commit
1999806733
3 changed files with 21 additions and 0 deletions
|
|
@ -46,6 +46,12 @@ select * from t1 where a like 'a\\%' escape '#' and a like 'a\\\\b';
|
||||||
a
|
a
|
||||||
a\b
|
a\b
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
create table t1 (a datetime);
|
||||||
|
insert into t1 values ('2004-03-11 12:00:21');
|
||||||
|
select * from t1 where a like '2004-03-11 12:00:21';
|
||||||
|
a
|
||||||
|
2004-03-11 12:00:21
|
||||||
|
drop table t1;
|
||||||
SET NAMES koi8r;
|
SET NAMES koi8r;
|
||||||
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET koi8r);
|
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET koi8r);
|
||||||
INSERT INTO t1 VALUES ('ÆÙ×Á'),('æÙ×Á'),('Æù×Á'),('ÆÙ÷Á'),('ÆÙ×á'),('æù÷á');
|
INSERT INTO t1 VALUES ('ÆÙ×Á'),('æÙ×Á'),('Æù×Á'),('ÆÙ÷Á'),('ÆÙ×á'),('æù÷á');
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,14 @@ select * from t1 where a like 'a\\%' escape '#';
|
||||||
select * from t1 where a like 'a\\%' escape '#' and a like 'a\\\\b';
|
select * from t1 where a like 'a\\%' escape '#' and a like 'a\\\\b';
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #2885: like and datetime
|
||||||
|
#
|
||||||
|
|
||||||
|
create table t1 (a datetime);
|
||||||
|
insert into t1 values ('2004-03-11 12:00:21');
|
||||||
|
select * from t1 where a like '2004-03-11 12:00:21';
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test like with non-default character set
|
# Test like with non-default character set
|
||||||
|
|
|
||||||
|
|
@ -225,6 +225,13 @@ void Item_bool_func2::fix_length_and_dec()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make a special case of compare with fields to get nicer DATE comparisons
|
// Make a special case of compare with fields to get nicer DATE comparisons
|
||||||
|
|
||||||
|
if (functype() == LIKE_FUNC) // Disable conversion in case of LIKE function.
|
||||||
|
{
|
||||||
|
set_cmp_func();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (args[0]->type() == FIELD_ITEM)
|
if (args[0]->type() == FIELD_ITEM)
|
||||||
{
|
{
|
||||||
Field *field=((Item_field*) args[0])->field;
|
Field *field=((Item_field*) args[0])->field;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue