msi: Allow the not-equal operator in WHERE query string comparisons.
This commit is contained in:
parent
3c0f7ca4e6
commit
58c7fe1095
|
@ -3899,13 +3899,63 @@ static void test_select_markers(void)
|
||||||
r = MsiViewFetch(view, &res);
|
r = MsiViewFetch(view, &res);
|
||||||
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
|
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
|
||||||
|
|
||||||
r = MsiViewClose(view);
|
MsiCloseHandle(rec);
|
||||||
ok(r == ERROR_SUCCESS, "MsiViewClose failed\n");
|
MsiViewClose(view);
|
||||||
r = MsiCloseHandle(view);
|
MsiCloseHandle(view);
|
||||||
ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n");
|
|
||||||
r = MsiCloseHandle(hdb);
|
|
||||||
ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n");
|
|
||||||
|
|
||||||
|
rec = MsiCreateRecord(2);
|
||||||
|
MsiRecordSetString(rec, 1, "one");
|
||||||
|
MsiRecordSetInteger(rec, 2, 1);
|
||||||
|
|
||||||
|
query = "SELECT * FROM `Table` WHERE `Two`<>? AND `Three`>? ORDER BY `Three`";
|
||||||
|
r = MsiDatabaseOpenView(hdb, query, &view);
|
||||||
|
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||||
|
r = MsiViewExecute(view, rec);
|
||||||
|
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||||
|
|
||||||
|
r = MsiViewFetch(view, &res);
|
||||||
|
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||||
|
|
||||||
|
size = MAX_PATH;
|
||||||
|
r = MsiRecordGetString(res, 1, buf, &size);
|
||||||
|
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||||
|
ok(!lstrcmp(buf, "apple"), "Expected apple, got %s\n", buf);
|
||||||
|
|
||||||
|
size = MAX_PATH;
|
||||||
|
r = MsiRecordGetString(res, 2, buf, &size);
|
||||||
|
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||||
|
ok(!lstrcmp(buf, "two"), "Expected two, got %s\n", buf);
|
||||||
|
|
||||||
|
r = MsiRecordGetInteger(res, 3);
|
||||||
|
ok(r == 2, "Expected 2, got %d\n", r);
|
||||||
|
|
||||||
|
MsiCloseHandle(res);
|
||||||
|
|
||||||
|
r = MsiViewFetch(view, &res);
|
||||||
|
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||||
|
|
||||||
|
size = MAX_PATH;
|
||||||
|
r = MsiRecordGetString(res, 1, buf, &size);
|
||||||
|
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||||
|
ok(!lstrcmp(buf, "banana"), "Expected banana, got %s\n", buf);
|
||||||
|
|
||||||
|
size = MAX_PATH;
|
||||||
|
r = MsiRecordGetString(res, 2, buf, &size);
|
||||||
|
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||||
|
ok(!lstrcmp(buf, "three"), "Expected three, got %s\n", buf);
|
||||||
|
|
||||||
|
r = MsiRecordGetInteger(res, 3);
|
||||||
|
ok(r == 3, "Expected 3, got %d\n", r);
|
||||||
|
|
||||||
|
MsiCloseHandle(res);
|
||||||
|
|
||||||
|
r = MsiViewFetch(view, &res);
|
||||||
|
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
|
||||||
|
|
||||||
|
MsiCloseHandle(rec);
|
||||||
|
MsiViewClose(view);
|
||||||
|
MsiCloseHandle(view);
|
||||||
|
MsiCloseHandle(hdb);
|
||||||
DeleteFile(msifile);
|
DeleteFile(msifile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -286,6 +286,7 @@ static UINT STRCMP_Evaluate( MSIWHEREVIEW *wv, UINT row, const struct expr *cond
|
||||||
sr = lstrcmpW( l_str, r_str );
|
sr = lstrcmpW( l_str, r_str );
|
||||||
|
|
||||||
*val = ( cond->u.expr.op == OP_EQ && ( sr == 0 ) ) ||
|
*val = ( cond->u.expr.op == OP_EQ && ( sr == 0 ) ) ||
|
||||||
|
( cond->u.expr.op == OP_NE && ( sr != 0 ) ) ||
|
||||||
( cond->u.expr.op == OP_LT && ( sr < 0 ) ) ||
|
( cond->u.expr.op == OP_LT && ( sr < 0 ) ) ||
|
||||||
( cond->u.expr.op == OP_GT && ( sr > 0 ) );
|
( cond->u.expr.op == OP_GT && ( sr > 0 ) );
|
||||||
|
|
||||||
|
@ -617,6 +618,7 @@ static UINT WHERE_VerifyCondition( MSIDATABASE *db, MSIVIEW *table, struct expr
|
||||||
case OP_EQ:
|
case OP_EQ:
|
||||||
case OP_GT:
|
case OP_GT:
|
||||||
case OP_LT:
|
case OP_LT:
|
||||||
|
case OP_NE:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
*valid = FALSE;
|
*valid = FALSE;
|
||||||
|
|
Loading…
Reference in New Issue