Handle sql queries where a double column is compared to an int

eg "my_double_column" = 123
This commit is contained in:
Nyall Dawson 2021-08-27 10:15:47 +10:00 committed by Evan Miller
parent f4ca6b9e57
commit 036f9b95c6

View File

@ -245,10 +245,10 @@ mdb_test_sarg(MdbHandle *mdb, MdbColumn *col, MdbSargNode *node, MdbField *field
ret = mdb_test_int(node, (gint32)mdb_get_int32(field->value, 0));
break;
case MDB_FLOAT:
ret = mdb_test_double(node->op, node->value.d, mdb_get_single(field->value, 0));
ret = mdb_test_double(node->op, node->val_type == MDB_INT ? node->value.i : node->value.d, mdb_get_single(field->value, 0));
break;
case MDB_DOUBLE:
ret = mdb_test_double(node->op, node->value.d, mdb_get_double(field->value, 0));
ret = mdb_test_double(node->op, node->val_type == MDB_INT ? node->value.i : node->value.d, mdb_get_double(field->value, 0));
break;
case MDB_TEXT:
mdb_unicode2ascii(mdb, field->value, field->siz, tmpbuf, sizeof(tmpbuf));