78602: Subject: [PATCH 1/2] msi/where.c: the underlying tables might have changed; so it's not possible to cache the result of the execute
buildbot at kegel.com
buildbot at kegel.com
Fri Sep 9 04:37:03 CDT 2011
This is an experimental automated build and test service.
Please feel free to ignore this email while we work the kinks out.
The Buildbot has detected a failed build on builder runtests-gcc295 while building Wine.
Full details are available at: http://buildbot.kegel.com/builders/runtests-gcc295/builds/13 (though maybe not for long, as I'm still reinstalling the buildbot periodically while experimenting)
BUILD FAILED: failed shell_2
For more info about this message, see http://wiki.winehq.org/BuildBot
-------------- next part --------------
From: Bernhard Loos <bernhardloos at googlemail.com>
Subject: [PATCH 1/2] msi/where.c: the underlying tables might have changed, so it's not possible to cache the result of the execute
Message-Id: <CAOB12PVJSaikL6HWY1tJczNpbUx3BW+NDDX8bKHw5TKQVcEdWQ at mail.gmail.com>
Date: Fri, 9 Sep 2011 11:25:51 +0200
---
dlls/msi/tests/db.c | 24 +++++++++++++++++++++++-
dlls/msi/where.c | 35 ++++++++++++++---------------------
2 files changed, 37 insertions(+), 22 deletions(-)
diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c
index b581633..b915fa0 100644
--- a/dlls/msi/tests/db.c
+++ b/dlls/msi/tests/db.c
@@ -297,7 +297,7 @@ make_add_entry(binary,
static void test_msiinsert(void)
{
- MSIHANDLE hdb = 0, hview = 0, hrec = 0;
+ MSIHANDLE hdb = 0, hview = 0, hview2 = 0, hrec = 0;
UINT r;
const char *query;
char buf[80];
@@ -322,6 +322,14 @@ static void test_msiinsert(void)
r = MsiCloseHandle(hview);
ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n");
+ query = "SELECT * FROM phone WHERE number = '8675309'";
+ r = MsiDatabaseOpenView(hdb, query, &hview2);
+ ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
+ r = MsiViewExecute(hview2, 0);
+ ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n");
+ r = MsiViewFetch(hview2, &hrec);
+ ok(r == ERROR_NO_MORE_ITEMS, "MsiViewFetch produced items\n");
+
/* insert a value into it */
query = "INSERT INTO `phone` ( `id`, `name`, `number` )"
"VALUES('1', 'Abe', '8675309')";
@@ -334,6 +342,20 @@ static void test_msiinsert(void)
r = MsiCloseHandle(hview);
ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n");
+ r = MsiViewFetch(hview2, &hrec);
+ ok(r == ERROR_NO_MORE_ITEMS, "MsiViewFetch produced items\n");
+ r = MsiViewExecute(hview2, 0);
+ ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n");
+ r = MsiViewFetch(hview2, &hrec);
+ ok(r == ERROR_SUCCESS, "MsiViewFetch failed: %u\n", r);
+
+ r = MsiCloseHandle(hrec);
+ ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n");
+ r = MsiViewClose(hview2);
+ ok(r == ERROR_SUCCESS, "MsiViewClose failed\n");
+ r = MsiCloseHandle(hview2);
+ ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n");
+
query = "SELECT * FROM `phone` WHERE `id` = 1";
r = do_query(hdb, query, &hrec);
ok(r == ERROR_SUCCESS, "MsiViewFetch failed\n");
diff --git a/dlls/msi/where.c b/dlls/msi/where.c
index 0e346d6..17b655b 100644
--- a/dlls/msi/where.c
+++ b/dlls/msi/where.c
@@ -73,27 +73,10 @@ typedef struct tagMSIWHEREVIEW
struct expr *cond;
UINT rec_index;
MSIORDERINFO *order_info;
- UINT error;
} MSIWHEREVIEW;
#define INITIAL_REORDER_SIZE 16
-static UINT init_reorder(MSIWHEREVIEW *wv)
-{
- MSIROWENTRY **new = msi_alloc_zero(sizeof(MSIROWENTRY *) * INITIAL_REORDER_SIZE);
- if (!new)
- return ERROR_OUTOFMEMORY;
-
- if (wv->reorder)
- msi_free(wv->reorder);
-
- wv->reorder = new;
- wv->reorder_size = INITIAL_REORDER_SIZE;
- wv->row_count = 0;
-
- return ERROR_SUCCESS;
-}
-
static void free_reorder(MSIWHEREVIEW *wv)
{
UINT i;
@@ -110,6 +93,20 @@ static void free_reorder(MSIWHEREVIEW *wv)
wv->row_count = 0;
}
+static UINT init_reorder(MSIWHEREVIEW *wv)
+{
+ MSIROWENTRY **new = msi_alloc_zero(sizeof(MSIROWENTRY *) * INITIAL_REORDER_SIZE);
+ if (!new)
+ return ERROR_OUTOFMEMORY;
+
+ free_reorder(wv);
+
+ wv->reorder = new;
+ wv->reorder_size = INITIAL_REORDER_SIZE;
+
+ return ERROR_SUCCESS;
+}
+
static inline UINT find_row(MSIWHEREVIEW *wv, UINT row, UINT *(values[]))
{
if (row >= wv->row_count)
@@ -618,9 +615,6 @@ static UINT WHERE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
if( !table )
return ERROR_FUNCTION_FAILED;
- if (wv->reorder)
- return wv->error;
-
r = init_reorder(wv);
if (r != ERROR_SUCCESS)
return r;
@@ -654,7 +648,6 @@ static UINT WHERE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
r = wv->order_info->error;
msi_free( rows );
- wv->error = r;
return r;
}
More information about the wine-tests-results
mailing list