1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-7001 Bad result for NOT NOT STRCMP('a','b') and NOT NOT NULLIF(2,3)

The bug is not very important per se, but it was helpful to move
Item_func_strcmp out of Item_bool_func2 (to Item_int_func),
for the purposes of "MDEV-4912 Add a plugin to field types (column types)".
This commit is contained in:
Alexander Barkov
2014-11-02 01:08:09 +04:00
parent 4dec4e1175
commit d1ca1c1fae
7 changed files with 72 additions and 12 deletions

View File

@@ -1970,14 +1970,14 @@ longlong Item_func_lt::val_int()
longlong Item_func_strcmp::val_int()
{
DBUG_ASSERT(fixed == 1);
String *a=args[0]->val_str(&cmp.value1);
String *b=args[1]->val_str(&cmp.value2);
String *a= args[0]->val_str(&value1);
String *b= args[1]->val_str(&value2);
if (!a || !b)
{
null_value=1;
return 0;
}
int value= sortcmp(a,b,cmp.cmp_collation.collation);
int value= cmp_collation.sortcmp(a, b);
null_value=0;
return !value ? 0 : (value < 0 ? (longlong) -1 : (longlong) 1);
}