diff options
author | unknown <monty@hundin.mysql.fi> | 2002-03-22 14:03:42 +0200 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2002-03-22 14:03:42 +0200 |
commit | 8f2f1597500c4cf74d5d73a4ee04b54f440df695 (patch) | |
tree | 41557706d9a6634dd90773de01ff3d7a12fd8d5f /sql/item.cc | |
parent | 30016518c3444e92ac1e43cfd71fc335d760bc19 (diff) | |
download | mariadb-git-8f2f1597500c4cf74d5d73a4ee04b54f440df695.tar.gz |
Fix for bug in WHERE key='j' or key='J'
Docs/manual.texi:
Changelog
myisam/myisampack.c:
Delete tmp file on error.
mysql-test/r/range.result:
Updated test case
mysql-test/t/range.test:
Updated test case
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/sql/item.cc b/sql/item.cc index b268c5eb928..0ce37cdd593 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -59,12 +59,28 @@ void Item::set_name(char *str,uint length) } } -bool Item::eq(const Item *item) const // Only doing this on conds +/* + This function is only called when comparing items in the WHERE clause +*/ + +bool Item::eq(const Item *item, bool binary_cmp) const { return type() == item->type() && name && item->name && !my_strcasecmp(name,item->name); } +bool Item_string::eq(const Item *item, bool binary_cmp) const +{ + if (type() == item->type()) + { + if (binary_cmp) + return !stringcmp(&str_value, &item->str_value); + return !sortcmp(&str_value, &item->str_value); + } + return 0; +} + + /* Get the value of the function as a TIME structure. As a extra convenience the time structure is reset on error! @@ -202,7 +218,7 @@ longlong Item_field::val_int_result() return result_field->val_int(); } -bool Item_field::eq(const Item *item) const +bool Item_field::eq(const Item *item, bool binary_cmp) const { return item->type() == FIELD_ITEM && ((Item_field*) item)->field == field; } @@ -245,7 +261,8 @@ void Item_string::print(String *str) str->append('\''); } -bool Item_null::eq(const Item *item) const { return item->type() == type(); } +bool Item_null::eq(const Item *item, bool binary_cmp) const +{ return item->type() == type(); } double Item_null::val() { null_value=1; return 0.0; } longlong Item_null::val_int() { null_value=1; return 0; } /* ARGSUSED */ |