msi: Reject greater than and less than string comparisons in WHERE clauses.
This commit is contained in:
parent
d95e58ba4d
commit
6df6332198
|
@ -1761,6 +1761,30 @@ static void test_where(void)
|
||||||
ok( r == ERROR_SUCCESS, "query failed: %d\n", r );
|
ok( r == ERROR_SUCCESS, "query failed: %d\n", r );
|
||||||
MsiCloseHandle( rec );
|
MsiCloseHandle( rec );
|
||||||
|
|
||||||
|
rec = 0;
|
||||||
|
query = "SELECT * FROM `Media` WHERE `DiskPrompt` < 'Cabinet'";
|
||||||
|
r = do_query(hdb, query, &rec);
|
||||||
|
ok( r == ERROR_BAD_QUERY_SYNTAX, "query failed: %d\n", r );
|
||||||
|
MsiCloseHandle( rec );
|
||||||
|
|
||||||
|
rec = 0;
|
||||||
|
query = "SELECT * FROM `Media` WHERE `DiskPrompt` > 'Cabinet'";
|
||||||
|
r = do_query(hdb, query, &rec);
|
||||||
|
ok( r == ERROR_BAD_QUERY_SYNTAX, "query failed: %d\n", r );
|
||||||
|
MsiCloseHandle( rec );
|
||||||
|
|
||||||
|
rec = 0;
|
||||||
|
query = "SELECT * FROM `Media` WHERE `DiskPrompt` <> 'Cabinet'";
|
||||||
|
r = do_query(hdb, query, &rec);
|
||||||
|
todo_wine ok( r == ERROR_SUCCESS, "query failed: %d\n", r );
|
||||||
|
MsiCloseHandle( rec );
|
||||||
|
|
||||||
|
rec = 0;
|
||||||
|
query = "SELECT * FROM `Media` WHERE `DiskPrompt` = 'Cabinet'";
|
||||||
|
r = do_query(hdb, query, &rec);
|
||||||
|
ok( r == ERROR_NO_MORE_ITEMS, "query failed: %d\n", r );
|
||||||
|
MsiCloseHandle( rec );
|
||||||
|
|
||||||
rec = MsiCreateRecord(1);
|
rec = MsiCreateRecord(1);
|
||||||
MsiRecordSetString(rec, 1, "");
|
MsiRecordSetString(rec, 1, "");
|
||||||
|
|
||||||
|
|
|
@ -309,9 +309,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_NE && ( sr != 0 ) );
|
||||||
( cond->u.expr.op == OP_LT && ( sr < 0 ) ) ||
|
|
||||||
( cond->u.expr.op == OP_GT && ( sr > 0 ) );
|
|
||||||
|
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -644,8 +642,6 @@ static UINT WHERE_VerifyCondition( MSIDATABASE *db, MSIVIEW *table, struct expr
|
||||||
switch( cond->u.expr.op )
|
switch( cond->u.expr.op )
|
||||||
{
|
{
|
||||||
case OP_EQ:
|
case OP_EQ:
|
||||||
case OP_GT:
|
|
||||||
case OP_LT:
|
|
||||||
case OP_NE:
|
case OP_NE:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue