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

Alexandre Julliard julliard at winehq.org
Thu Sep 2 12:01:26 CDT 2010


Module: wine
Branch: master
Commit: 18ebf2c57610e3474876e908bccc5b61ee8d73e2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=18ebf2c57610e3474876e908bccc5b61ee8d73e2

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Thu Sep  2 13:20:36 2010 +0200

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

---

 dlls/msi/msiquery.c     |    3 +++
 dlls/msi/tests/record.c |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/dlls/msi/msiquery.c b/dlls/msi/msiquery.c
index df81a74..c603e6a 100644
--- a/dlls/msi/msiquery.c
+++ b/dlls/msi/msiquery.c
@@ -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;
diff --git a/dlls/msi/tests/record.c b/dlls/msi/tests/record.c
index 0b80779..2de43cb 100644
--- a/dlls/msi/tests/record.c
+++ b/dlls/msi/tests/record.c
@@ -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);




More information about the wine-cvs mailing list