Commit 85866317 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: Don't reorder the table when matching rows as the results are already ordered.

parent 82517d6d
......@@ -1796,9 +1796,6 @@ static UINT TABLE_find_matching_rows( struct tagMSIVIEW *view, UINT col,
*row = entry->row;
if (tv->order)
*row = tv->order->reorder[*row];
return ERROR_SUCCESS;
}
......
......@@ -4775,8 +4775,9 @@ static void test_defaultdatabase(void)
static void test_order(void)
{
MSIHANDLE hdb, hview, hrec;
CHAR buffer[MAX_PATH];
LPCSTR query;
UINT r;
UINT r, sz;
int val;
hdb = create_db();
......@@ -4985,6 +4986,47 @@ static void test_order(void)
MsiViewClose(hview);
MsiCloseHandle(hview);
query = "CREATE TABLE `Buffet` ( `One` CHAR(72), `Two` SHORT PRIMARY KEY `One`)";
r = run_query(hdb, 0, query);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
query = "INSERT INTO `Buffet` ( `One`, `Two` ) VALUES ( 'uno', 2)";
r = run_query(hdb, 0, query);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
query = "INSERT INTO `Buffet` ( `One`, `Two` ) VALUES ( 'dos', 3)";
r = run_query(hdb, 0, query);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
query = "INSERT INTO `Buffet` ( `One`, `Two` ) VALUES ( 'tres', 1)";
r = run_query(hdb, 0, query);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
query = "SELECT * FROM `Buffet` WHERE `One` = 'dos' ORDER BY `Two`";
r = MsiDatabaseOpenView(hdb, query, &hview);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
r = MsiViewExecute(hview, 0);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
r = MsiViewFetch(hview, &hrec);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
sz = sizeof(buffer);
r = MsiRecordGetString(hrec, 1, buffer, &sz);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmp(buffer, "dos"), "Expected \"dos\", got \"%s\"\n", buffer);
r = MsiRecordGetInteger(hrec, 2);
ok(r == 3, "Expected 3, got %d\n", r);
MsiCloseHandle(hrec);
r = MsiViewFetch(hview, &hrec);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
MsiViewClose(hview);
MsiCloseHandle(hview);
MsiCloseHandle(hdb);
}
......
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