msi: Don't reorder the table when matching rows as the results are already ordered.
This commit is contained in:
parent
82517d6d67
commit
85866317c5
|
@ -1796,9 +1796,6 @@ static UINT TABLE_find_matching_rows( struct tagMSIVIEW *view, UINT col,
|
||||||
|
|
||||||
*row = entry->row;
|
*row = entry->row;
|
||||||
|
|
||||||
if (tv->order)
|
|
||||||
*row = tv->order->reorder[*row];
|
|
||||||
|
|
||||||
return ERROR_SUCCESS;
|
return ERROR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4775,8 +4775,9 @@ static void test_defaultdatabase(void)
|
||||||
static void test_order(void)
|
static void test_order(void)
|
||||||
{
|
{
|
||||||
MSIHANDLE hdb, hview, hrec;
|
MSIHANDLE hdb, hview, hrec;
|
||||||
|
CHAR buffer[MAX_PATH];
|
||||||
LPCSTR query;
|
LPCSTR query;
|
||||||
UINT r;
|
UINT r, sz;
|
||||||
int val;
|
int val;
|
||||||
|
|
||||||
hdb = create_db();
|
hdb = create_db();
|
||||||
|
@ -4983,6 +4984,47 @@ static void test_order(void)
|
||||||
r = MsiViewFetch(hview, &hrec);
|
r = MsiViewFetch(hview, &hrec);
|
||||||
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
|
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
|
||||||
|
|
||||||
|
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);
|
MsiViewClose(hview);
|
||||||
MsiCloseHandle(hview);
|
MsiCloseHandle(hview);
|
||||||
MsiCloseHandle(hdb);
|
MsiCloseHandle(hdb);
|
||||||
|
|
Loading…
Reference in New Issue