Commit ef1af6ad authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

msi: Add tests for quoting in queries.

parent a60d4b2d
...@@ -656,6 +656,39 @@ static void test_msibadqueries(void) ...@@ -656,6 +656,39 @@ static void test_msibadqueries(void)
r = try_query( hdb, "CREATE TABLE `c` (`b` CHAR NOT NULL PRIMARY KEY `b`)"); r = try_query( hdb, "CREATE TABLE `c` (`b` CHAR NOT NULL PRIMARY KEY `b`)");
ok(r == ERROR_SUCCESS , "query 8 failed\n"); ok(r == ERROR_SUCCESS , "query 8 failed\n");
r = try_query( hdb, "select * from c");
ok(r == ERROR_SUCCESS , "query failed\n");
r = try_query( hdb, "select * from c where b = 'x");
todo_wine ok(r == ERROR_BAD_QUERY_SYNTAX, "query failed\n");
r = try_query( hdb, "select * from 'c'");
ok(r == ERROR_BAD_QUERY_SYNTAX, "query failed\n");
r = try_query( hdb, "select * from ''");
ok(r == ERROR_BAD_QUERY_SYNTAX, "query failed\n");
r = try_query( hdb, "select * from c where b = x");
ok(r == ERROR_BAD_QUERY_SYNTAX, "query failed\n");
r = try_query( hdb, "select * from c where b = \"x\"");
todo_wine ok(r == ERROR_BAD_QUERY_SYNTAX, "query failed\n");
r = try_query( hdb, "select * from c where b = 'x'");
ok(r == ERROR_SUCCESS, "query failed\n");
r = try_query( hdb, "select * from c where b = '\"x'");
ok(r == ERROR_SUCCESS, "query failed\n");
if (0) /* FIXME: this query causes trouble with other tests */
{
r = try_query( hdb, "select * from c where b = '\\\'x'");
ok(r == ERROR_BAD_QUERY_SYNTAX, "query failed\n");
}
r = try_query( hdb, "select * from 'c'");
ok(r == ERROR_BAD_QUERY_SYNTAX, "query failed\n");
r = MsiCloseHandle( hdb ); r = MsiCloseHandle( hdb );
ok(r == ERROR_SUCCESS , "Failed to close database transact\n"); ok(r == ERROR_SUCCESS , "Failed to close database transact\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment