msi/tests: Add test for merging tables that are not in target database.
This commit is contained in:
parent
987d17dc6f
commit
97200b0b31
|
@ -6952,6 +6952,46 @@ static void test_dbmerge(void)
|
||||||
r = run_query(href, 0, query);
|
r = run_query(href, 0, query);
|
||||||
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||||
|
|
||||||
|
query = "CREATE TABLE `One` ( `A` INT, `B` CHAR(72) PRIMARY KEY `A` )";
|
||||||
|
r = run_query(href, 0, query);
|
||||||
|
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||||
|
|
||||||
|
query = "INSERT INTO `One` ( `A`, `B` ) VALUES ( 1, 'hi' )";
|
||||||
|
r = run_query(href, 0, query);
|
||||||
|
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||||
|
|
||||||
|
/* table from merged database is not in target database */
|
||||||
|
r = MsiDatabaseMergeA(hdb, href, "MergeErrors");
|
||||||
|
todo_wine ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||||
|
|
||||||
|
query = "SELECT * FROM `One`";
|
||||||
|
r = do_query(hdb, query, &hrec);
|
||||||
|
todo_wine ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||||
|
|
||||||
|
r = MsiRecordGetInteger(hrec, 1);
|
||||||
|
todo_wine ok(r == 1, "Expected 1, got %d\n", r);
|
||||||
|
|
||||||
|
size = MAX_PATH;
|
||||||
|
r = MsiRecordGetStringA(hrec, 2, buf, &size);
|
||||||
|
todo_wine ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||||
|
todo_wine ok(!lstrcmpA(buf, "hi"), "Expected \"hi\", got \"%s\"\n", buf);
|
||||||
|
|
||||||
|
MsiCloseHandle(hrec);
|
||||||
|
|
||||||
|
/* nothing in MergeErrors */
|
||||||
|
query = "SELECT * FROM `MergeErrors`";
|
||||||
|
r = do_query(hdb, query, &hrec);
|
||||||
|
ok(r == ERROR_BAD_QUERY_SYNTAX,
|
||||||
|
"Expected ERROR_BAD_QUERY_SYNTAX, got %d\n", r);
|
||||||
|
|
||||||
|
query = "DROP TABLE `One`";
|
||||||
|
r = run_query(hdb, 0, query);
|
||||||
|
todo_wine ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||||
|
|
||||||
|
query = "DROP TABLE `One`";
|
||||||
|
r = run_query(href, 0, query);
|
||||||
|
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
|
||||||
|
|
||||||
query = "CREATE TABLE `One` ( "
|
query = "CREATE TABLE `One` ( "
|
||||||
"`A` CHAR(72), `B` INT PRIMARY KEY `A` )";
|
"`A` CHAR(72), `B` INT PRIMARY KEY `A` )";
|
||||||
r = run_query(hdb, 0, query);
|
r = run_query(hdb, 0, query);
|
||||||
|
|
Loading…
Reference in New Issue