Commit 61c1dd2b authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

msi: Add a test for ALTER TABLE.

parent b4005c15
...@@ -2281,6 +2281,50 @@ static void test_temporary_table(void) ...@@ -2281,6 +2281,50 @@ static void test_temporary_table(void)
DeleteFile(msifile); DeleteFile(msifile);
} }
static void test_alter(void)
{
MSICONDITION cond;
MSIHANDLE hdb = 0;
const char *query;
UINT r;
hdb = create_db();
ok( hdb, "failed to create db\n");
query = "CREATE TABLE `T` ( `B` SHORT NOT NULL TEMPORARY, `C` CHAR(255) TEMPORARY PRIMARY KEY `C`) HOLD";
r = run_query(hdb, 0, query);
ok(r == ERROR_SUCCESS, "failed to add table\n");
cond = MsiDatabaseIsTablePersistent(hdb, "T");
ok( cond == MSICONDITION_FALSE, "wrong return condition\n");
todo_wine {
query = "ALTER TABLE `T` HOLD";
r = run_query(hdb, 0, query);
ok(r == ERROR_SUCCESS, "failed to hold table %d\n", r);
query = "ALTER TABLE `T` FREE";
r = run_query(hdb, 0, query);
ok(r == ERROR_SUCCESS, "failed to free table\n");
query = "ALTER TABLE `T` FREE";
r = run_query(hdb, 0, query);
ok(r == ERROR_SUCCESS, "failed to free table\n");
}
query = "ALTER TABLE `T` FREE";
r = run_query(hdb, 0, query);
ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to free table\n");
query = "ALTER TABLE `T` HOLD";
r = run_query(hdb, 0, query);
ok(r == ERROR_BAD_QUERY_SYNTAX, "failed to hold table %d\n", r);
MsiCloseHandle( hdb );
DeleteFile(msifile);
}
START_TEST(db) START_TEST(db)
{ {
test_msidatabase(); test_msidatabase();
...@@ -2300,4 +2344,5 @@ START_TEST(db) ...@@ -2300,4 +2344,5 @@ START_TEST(db)
test_generate_transform(); test_generate_transform();
test_join(); test_join();
test_temporary_table(); test_temporary_table();
test_alter();
} }
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