msi: Return an error from MsiDatabaseGetPrimaryKeys if the table does not exist.

This commit is contained in:
Hans Leidekker 2010-09-02 13:20:36 +02:00 committed by Alexandre Julliard
parent 0032706564
commit 18ebf2c576
2 changed files with 6 additions and 0 deletions

View File

@ -901,6 +901,9 @@ UINT MSI_DatabaseGetPrimaryKeys( MSIDATABASE *db,
MSIQUERY *query = NULL;
UINT r;
if (!TABLE_Exists( db, table ))
return ERROR_INVALID_TABLE;
r = MSI_OpenQuery( db, &query, sql, table );
if( r != ERROR_SUCCESS )
return r;

View File

@ -589,6 +589,9 @@ static void test_fieldzero(void)
MsiCloseHandle(rec);
r = MsiDatabaseGetPrimaryKeysA(hdb, "nosuchtable", &rec);
ok(r == ERROR_INVALID_TABLE, "Expected ERROR_INVALID_TABLE, got %d\n", r);
query = "SELECT * FROM `drone` WHERE `id` = 1";
r = MsiDatabaseOpenView(hdb, query, &hview);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);