33static const char *
msifile =
"winetest-db.msi";
34static const char *
msifile2 =
"winetst2-db.msi";
35static const char *
mstfile =
"winetst-db.mst";
57 "field %u: expected \"%s\", got \"%s\"\n",
i,
expect,
buffer);
62#define check_record(rec, ...) check_record_(__LINE__, rec, __VA_ARGS__)
168 ok (
res,
"Got zero res.\n" );
184 ok(
res ==
TRUE,
"Failed to delete database\n" );
187 ok(
res ==
TRUE,
"Failed to delete database\n" );
250 "CREATE TABLE `Component` ( "
251 "`Component` CHAR(72) NOT NULL, "
252 "`ComponentId` CHAR(38), "
253 "`Directory_` CHAR(72) NOT NULL, "
254 "`Attributes` SHORT NOT NULL, "
255 "`Condition` CHAR(255), "
256 "`KeyPath` CHAR(72) "
257 "PRIMARY KEY `Component`)" );
265 "CREATE TABLE `CustomAction` ( "
266 "`Action` CHAR(72) NOT NULL, "
267 "`Type` SHORT NOT NULL, "
268 "`Source` CHAR(72), "
269 "`Target` CHAR(255) "
270 "PRIMARY KEY `Action`)" );
278 "CREATE TABLE `Directory` ( "
279 "`Directory` CHAR(255) NOT NULL, "
280 "`Directory_Parent` CHAR(255), "
281 "`DefaultDir` CHAR(255) NOT NULL "
282 "PRIMARY KEY `Directory`)" );
290 "CREATE TABLE `FeatureComponents` ( "
291 "`Feature_` CHAR(38) NOT NULL, "
292 "`Component_` CHAR(72) NOT NULL "
293 "PRIMARY KEY `Feature_`, `Component_` )" );
301 "CREATE TABLE `StdDlls` ( "
302 "`File` CHAR(255) NOT NULL, "
303 "`Binary_` CHAR(72) NOT NULL "
304 "PRIMARY KEY `File` )" );
312 "CREATE TABLE `Binary` ( "
313 "`Name` CHAR(72) NOT NULL, "
314 "`Data` CHAR(72) NOT NULL "
315 "PRIMARY KEY `Name` )" );
334#define add_component_entry(hdb, values) add_entry(__FILE__, __LINE__, "Component", hdb, values, \
335 "INSERT INTO `Component` " \
336 "(`Component`, `ComponentId`, `Directory_`, " \
337 "`Attributes`, `Condition`, `KeyPath`) VALUES( %s )")
339#define add_custom_action_entry(hdb, values) add_entry(__FILE__, __LINE__, "CustomAction", hdb, values, \
340 "INSERT INTO `CustomAction` " \
341 "(`Action`, `Type`, `Source`, `Target`) VALUES( %s )")
343#define add_feature_components_entry(hdb, values) add_entry(__FILE__, __LINE__, "FeatureComponents", hdb, values, \
344 "INSERT INTO `FeatureComponents` " \
345 "(`Feature_`, `Component_`) VALUES( %s )")
347#define add_std_dlls_entry(hdb, values) add_entry(__FILE__, __LINE__, "StdDlls", hdb, values, \
348 "INSERT INTO `StdDlls` (`File`, `Binary_`) VALUES( %s )")
350#define add_binary_entry(hdb, values) add_entry(__FILE__, __LINE__, "Binary", hdb, values, \
351 "INSERT INTO `Binary` (`Name`, `Data`) VALUES( %s )")
355 MSIHANDLE hdb = 0, hview = 0, hview2 = 0, hrec = 0;
368 query =
"CREATE TABLE `phone` ( "
369 "`id` INT, `name` CHAR(32), `number` CHAR(32) "
380 query =
"SELECT * FROM phone WHERE number = '8675309'";
389 query =
"INSERT INTO `phone` ( `id`, `name`, `number` )"
390 "VALUES('1', 'Abe', '8675309')";
414 query =
"SELECT * FROM `phone` WHERE `id` = 1";
420 ok(
r == 3,
"record count wrong\n");
423 ok(
r ==
FALSE,
"field 0 not null\n");
426 ok(
r == 1,
"field 1 contents wrong\n");
430 ok(!
strcmp(
buf,
"Abe"),
"field 2 content incorrect\n");
434 ok(!
strcmp(
buf,
"8675309"),
"field 3 content incorrect\n");
441 query =
"SELECT * FROM `phone` WHERE `id` >= 10";
444 ok(hrec == 0,
"hrec should be null\n");
449 query =
"SELECT * FROM `phone` WHERE `id` < 0";
453 query =
"SELECT * FROM `phone` WHERE `id` <= 0";
457 query =
"SELECT * FROM `phone` WHERE `id` <> 1";
461 query =
"SELECT * FROM `phone` WHERE `id` > 10";
466 query =
"INSERT INTO `phone` ( `id`, `name`, `number` )"
481 query =
"INSERT INTO `phone` ( `id`, `name`, `number` )"
508 ok(
r ==
TRUE,
"file didn't exist after commit\n");
522 if (!pMsiDecomposeDescriptorA)
526 desc =
"']gAVn-}f(ZXfeAR6.jiFollowTheWhiteRabbit>3w2x^IGfe?CxI5heAvk.";
528 prod[0] =
feature[0] = comp[0] = 0;
532 ok(
strcmp(prod,
"{90110409-6000-11D3-8CFE-0150048383C9}")==0,
"product wrong\n");
534 ok(
strcmp(comp,
"{A7CD68DB-EF74-49C8-FBB2-A7C463B2AC24}")==0,
"component wrong\n");
537 desc =
"']gAVn-}f(ZXfeAR6.ji"
538 "ThisWillFailIfTheresMoreThanAGuidsChars>"
539 "3w2x^IGfe?CxI5heAvk.";
545 desc =
"']gAVn-}f(ZXfeAR6.jiFollowTheWhiteRabbit<3w2x^IGfe?CxI5heAvk.";
552 ok(!
strcmp(prod,
"{90110409-6000-11D3-8CFE-0150048383C9}"),
"got '%s'\n", prod);
554 ok(!comp[0],
"got '%s'\n", comp);
559 r = pMsiDecomposeDescriptorA(
"yh1BVN)8A$!!!!!MKKSkAlwaysInstalledIntl_1033<", prod,
feature, comp, &
len);
562 ok(!
strcmp(prod,
"{90150000-006E-0409-0000-0000000FF1CE}"),
"got '%s'\n", prod);
564 ok(!comp[0],
"got '%s'\n", comp);
570 desc =
"']gAVn-}f(ZXfeAR6.ji"
571 "ThisWillWorkIfTheresLTEThanAGuidsChars>"
572 "3w2x^IGfe?CxI5heAvk."
597 ok(
len == 0,
"length wrong\n");
690 r =
try_query( hdb,
"CREATE TABLE `a` (`b`)");
693 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHAR(72) )");
696 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHAR(72) NOT NULL)");
699 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY)");
702 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY KEY)");
705 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY KEY)");
708 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY KEY 'b')");
711 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY KEY `b')");
714 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY KEY `b')");
717 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHA(72) NOT NULL PRIMARY KEY `b`)");
720 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHAR(-1) NOT NULL PRIMARY KEY `b`)");
723 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHAR(720) NOT NULL PRIMARY KEY `b`)");
726 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHAR(72) NOT NULL KEY `b`)");
729 r =
try_query( hdb,
"CREATE TABLE `a` (`` CHAR(72) NOT NULL PRIMARY KEY `b`)");
732 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY KEY `b`)");
735 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY KEY `b`)");
738 r =
try_query( hdb,
"CREATE TABLE `aa` (`b` CHAR(72) NOT NULL, `c` "
739 "CHAR(72), `d` CHAR(255) NOT NULL LOCALIZABLE PRIMARY KEY `b`)");
745 r =
try_query( hdb,
"CREATE TABLE `blah` (`foo` CHAR(72) NOT NULL "
746 "PRIMARY KEY `foo`)");
755 r =
try_query( hdb,
"CREATE TABLE `boo` (`foo` CHAR(72) NOT NULL "
756 "PRIMARY KEY `ba`)");
759 r =
try_query( hdb,
"CREATE TABLE `bee` (`foo` CHAR(72) NOT NULL )");
762 r =
try_query( hdb,
"CREATE TABLE `temp` (`t` CHAR(72) NOT NULL "
766 r =
try_query( hdb,
"CREATE TABLE `c` (`b` CHAR NOT NULL PRIMARY KEY `b`)");
772 r =
try_query( hdb,
"select * from c where b = 'x");
775 r =
try_query( hdb,
"select * from c where b = 'x'");
784 r =
try_query( hdb,
"select * from c where b = x");
787 r =
try_query( hdb,
"select * from c where b = \"x\"");
790 r =
try_query( hdb,
"select * from c where b = 'x'");
793 r =
try_query( hdb,
"select * from c where b = '\"x'");
798 r =
try_query( hdb,
"select * from c where b = '\\\'x'");
805 r =
try_query( hdb,
"select `c`.`b` from `c` order by `c`.`order`");
808 r =
try_query( hdb,
"select `c`.b` from `c`");
811 r =
try_query( hdb,
"select `c`.`b from `c`");
817 r =
try_query( hdb,
"select `c.`b` from `c`");
820 r =
try_query( hdb,
"select c`.`b` from `c`");
826 r =
try_query( hdb,
"select `c`.`b` from c`");
829 r =
try_query( hdb,
"select `c`.`b` from `c");
835 r =
try_query( hdb,
"CREATE TABLE `\5a` (`b` CHAR NOT NULL PRIMARY KEY `b`)" );
841 r =
try_query( hdb,
"CREATE TABLE `a\5` (`b` CHAR NOT NULL PRIMARY KEY `b`)" );
847 r =
try_query( hdb,
"CREATE TABLE `-a` (`b` CHAR NOT NULL PRIMARY KEY `b`)" );
853 r =
try_query( hdb,
"CREATE TABLE `a-` (`b` CHAR NOT NULL PRIMARY KEY `b`)" );
863 ok(
r ==
TRUE,
"file didn't exist after commit\n");
881 query =
"CREATE TABLE `phone` ( "
882 "`id` INT, `name` CHAR(32), `number` CHAR(32) "
887 query =
"CREATE TABLE `_Validation` ( "
888 "`Table` CHAR(32) NOT NULL, `Column` CHAR(32) NOT NULL, "
889 "`Nullable` CHAR(4) NOT NULL, `MinValue` INT, `MaxValue` INT, "
890 "`KeyTable` CHAR(255), `KeyColumn` SHORT, `Category` CHAR(32), "
891 "`Set` CHAR(255), `Description` CHAR(255) PRIMARY KEY `Table`, `Column`)";
895 query =
"INSERT INTO `_Validation` ( `Table`, `Column`, `Nullable` ) "
896 "VALUES('phone', 'id', 'N')";
900 query =
"SELECT * FROM `phone`";
910 ok(sz == 0,
"got size %lu\n", sz);
931 ok(sz == 0,
"got size %lu\n", sz);
963 ok(sz == 2,
"got size %lu\n", sz);
1005 query =
"SELECT * FROM `phone`";
1042 query =
"SELECT * FROM `phone`";
1057 ok(hrec != 0,
"MsiCreateRecord failed\n");
1074 ok(hrec != 0,
"MsiCreateRecord failed\n");
1110 query =
"SELECT * FROM `phone` WHERE `id` = 1";
1135 query =
"SELECT * FROM `phone` ORDER BY `id`";
1189 ok( hdb,
"failed to create db\n");
1218 ok( rec == 0,
"returned a record\n");
1290 ok( hdb,
"failed to create db\n");
1293 "CREATE TABLE `Properties` "
1294 "( `Property` CHAR(255), "
1295 " `Value` CHAR(1), "
1297 " `Integervalue` INTEGER, "
1298 " `Shortvalue` SHORT, "
1299 " `Longvalue` LONG, "
1300 " `Longcharvalue` LONGCHAR, "
1301 " `Charvalue` CHAR, "
1302 " `Localizablevalue` CHAR LOCALIZABLE "
1303 " PRIMARY KEY `Property`)" );
1308 ok( rec,
"failed to get column info record\n" );
1309 check_record(rec, 9,
"S255",
"S1",
"I2",
"I2",
"I2",
"I4",
"S0",
"S0",
"L0");
1325 ok( rec,
"failed to get column info record\n" );
1326 check_record(rec, 9,
"Property",
"Value",
"Intvalue",
"Integervalue",
"Shortvalue",
1327 "Longvalue",
"Longcharvalue",
"Charvalue",
"Localizablevalue");
1331 "CREATE TABLE `Binary` "
1332 "( `Name` CHAR(255), `Data` OBJECT PRIMARY KEY `Name`)" );
1337 ok( rec,
"failed to get column info record\n" );
1347 ok( rec,
"failed to get column info record\n" );
1352 "CREATE TABLE `UIText` "
1353 "( `Key` CHAR(72) NOT NULL, `Text` CHAR(255) LOCALIZABLE PRIMARY KEY `Key`)" );
1360 ok( rec,
"failed to get column info record\n" );
1365 ok( rec,
"failed to get column info record\n" );
1378 const char file[] =
"phone.txt";
1383 "id\tname\tnumber\r\n"
1386 "1\tAbe\t8675309\r\n";
1395 query =
"CREATE TABLE `phone` ( "
1396 "`id` INT, `name` CHAR(32), `number` CHAR(32) "
1397 "PRIMARY KEY `id`)";
1408 query =
"INSERT INTO `phone` ( `id`, `name`, `number` )"
1409 "VALUES('1', 'Abe', '8675309')";
1440 ok(0,
"failed to open file %s\n",
path);
1449 const char insert_query[] =
1450 "INSERT INTO `strings` ( `id`, `val` ) VALUES('1', 'Z')";
1464 "CREATE TABLE `strings` ( `id` INT, `val` CHAR(0) PRIMARY KEY `id`)");
1469 len =
strchr(insert_query,
'Z') - insert_query;
1526#define create_file(name) create_file_data(name, name, 0)
1537 ok( hdb,
"failed to create db\n");
1540 "CREATE TABLE `Properties` "
1541 "( `Property` CHAR(255), `Value` CHAR(1) PRIMARY KEY `Property`)" );
1545 "INSERT INTO `Properties` "
1546 "( `Value`, `Property` ) VALUES ( 'Prop', 'value' )" );
1559 ok( rec,
"failed to get column info record\n" );
1565 ok( rec,
"failed to get column info record\n" );
1570 "SELECT * FROM `_Streams` WHERE `Name` = '\5SummaryInformation'", &
view );
1596 "SELECT * FROM `_Streams` WHERE `Name` = '\5SummaryInformation'", &
view );
1621 "INSERT INTO `_Streams` ( `Name`, `Data` ) VALUES ( ?, ? )", &
view );
1643 "INSERT INTO `_Streams` ( `Name`, `Data` ) VALUES ( ?, ? )", &
view );
1665 "INSERT INTO `_Streams` ( `Name`, `Data` ) VALUES ( ?, ? )", &
view );
1676 "SELECT `Name`, `Data` FROM `_Streams` WHERE `Name` = 'data'", &
view );
1694 ok( !
lstrcmpA(
buf,
"test.txt\n"),
"Expected 'test.txt\\n', got %s\n",
buf);
1701 "SELECT `Name`, `Data` FROM `_Streams` WHERE `Name` = 'data1'", &
view );
1719 ok( !
lstrcmpA(
buf,
"test1.txt\n"),
"Expected 'test1.txt\\n', got %s\n",
buf);
1735 "UPDATE `_Streams` SET `Data` = ? WHERE `Name` = 'data1'", &
view );
1746 "SELECT `Name`, `Data` FROM `_Streams` WHERE `Name` = 'data1'", &
view );
1764 ok( !
lstrcmpA(
buf,
"test2.txt\n"),
"Expected 'test2.txt\\n', got %s\n",
buf);
1775 ok( hdb,
"failed to create db\n");
1783 "INSERT INTO `_Streams` ( `Name`, `Data` ) VALUES ( ?, ? )", &
view );
1795 "SELECT `Name`, `Data` FROM `_Streams` WHERE `Name` = 'data'", &
view );
1817 "SELECT `Name`, `Data` FROM `_Streams` WHERE `Name` = 'data'", &
view );
1828 "DELETE FROM `_Streams` WHERE `Name` = 'data'", &
view );
1864 query =
"CREATE TABLE `Binary` ( `Name` CHAR(72) NOT NULL, `ID` INT NOT NULL, `Data` OBJECT PRIMARY KEY `Name`, `ID`)";
1875 query =
"INSERT INTO `Binary` ( `Name`, `ID`, `Data` ) VALUES ( 'encryption.dll.CB4E6205_F99A_4C51_ADD4_184506EFAB87', 10000, ? )";
1891 query =
"CREATE TABLE `Binary` ( `Name` CHAR(72) NOT NULL, `ID` INT NOT NULL, `Data` OBJECT PRIMARY KEY `Name`, `ID`)";
1901 query =
"INSERT INTO `Binary` ( `Name`, `ID`, `Data` ) VALUES ( 'filename1', 1, ? )";
1905 query =
"INSERT INTO `Binary` ( `Name`, `ID`, `Data` ) VALUES ( 'filename1', 1, ? )";
1922 query =
"SELECT * FROM `_Streams`";
1929 ok( !
lstrcmpA(
file,
"Binary.filename1.1"),
"Expected 'Binary.filename1.1', got %s\n",
file );
1935 ok( !
lstrcmpA(
buf,
"test.txt\n"),
"Expected 'test.txt\\n', got %s\n",
buf );
1941 query =
"SELECT * FROM `Binary`";
1954 ok( !
lstrcmpA(
buf,
"test.txt\n"),
"Expected 'test.txt\\n', got %s\n",
buf );
1972 ok( hdb,
"failed to create db\n");
1975 "CREATE TABLE `IESTable` ("
1976 "`Action` CHAR(64), "
1977 "`Condition` CHAR(64), "
1978 "`Sequence` LONG PRIMARY KEY `Sequence`)");
1979 ok(
r ==
S_OK,
"Cannot create IESTable table: %d\n",
r);
1982 "CREATE TABLE `CATable` ("
1983 "`Action` CHAR(64), "
1984 "`Type` LONG PRIMARY KEY `Type`)");
1985 ok(
r ==
S_OK,
"Cannot create CATable table: %d\n",
r);
1987 r =
run_query(hdb, 0,
"INSERT INTO `IESTable` "
1988 "( `Action`, `Condition`, `Sequence`) "
1989 "VALUES ( 'clean', 'cond4', 4)");
1990 ok(
r ==
S_OK,
"cannot add entry to IESTable table:%d\n",
r );
1992 r =
run_query(hdb, 0,
"INSERT INTO `IESTable` "
1993 "( `Action`, `Condition`, `Sequence`) "
1994 "VALUES ( 'depends', 'cond1', 1)");
1995 ok(
r ==
S_OK,
"cannot add entry to IESTable table:%d\n",
r );
1997 r =
run_query(hdb, 0,
"INSERT INTO `IESTable` "
1998 "( `Action`, `Condition`, `Sequence`) "
1999 "VALUES ( 'build', 'cond2', 2)");
2000 ok(
r ==
S_OK,
"cannot add entry to IESTable table:%d\n",
r );
2002 r =
run_query(hdb, 0,
"INSERT INTO `IESTable` "
2003 "( `Action`, `Condition`, `Sequence`) "
2004 "VALUES ( 'build2', 'cond6', 6)");
2005 ok(
r ==
S_OK,
"cannot add entry to IESTable table:%d\n",
r );
2007 r =
run_query(hdb, 0,
"INSERT INTO `IESTable` "
2008 "( `Action`, `Condition`, `Sequence`) "
2009 "VALUES ( 'build', 'cond3', 3)");
2010 ok(
r ==
S_OK,
"cannot add entry to IESTable table:%d\n",
r );
2012 r =
run_query(hdb, 0,
"INSERT INTO `CATable` "
2013 "( `Action`, `Type` ) "
2014 "VALUES ( 'build', 32)");
2015 ok(
r ==
S_OK,
"cannot add entry to CATable table:%d\n",
r );
2017 r =
run_query(hdb, 0,
"INSERT INTO `CATable` "
2018 "( `Action`, `Type` ) "
2019 "VALUES ( 'depends', 64)");
2020 ok(
r ==
S_OK,
"cannot add entry to CATable table:%d\n",
r );
2022 r =
run_query(hdb, 0,
"INSERT INTO `CATable` "
2023 "( `Action`, `Type` ) "
2024 "VALUES ( 'clean', 63)");
2025 ok(
r ==
S_OK,
"cannot add entry to CATable table:%d\n",
r );
2027 r =
run_query(hdb, 0,
"INSERT INTO `CATable` "
2028 "( `Action`, `Type` ) "
2029 "VALUES ( 'build2', 34)");
2030 ok(
r ==
S_OK,
"cannot add entry to CATable table:%d\n",
r );
2031 query =
"Select IESTable.Condition from CATable, IESTable where "
2032 "CATable.Action = IESTable.Action and CATable.Type = 32";
2064 ok( hdb,
"failed to create db\n");
2067 "CREATE TABLE `Media` ("
2068 "`DiskId` SHORT NOT NULL, "
2069 "`LastSequence` LONG, "
2070 "`DiskPrompt` CHAR(64) LOCALIZABLE, "
2071 "`Cabinet` CHAR(255), "
2072 "`VolumeLabel` CHAR(32), "
2073 "`Source` CHAR(72) "
2074 "PRIMARY KEY `DiskId`)" );
2075 ok(
r ==
S_OK,
"cannot create Media table: %d\n",
r );
2077 r =
run_query( hdb, 0,
"INSERT INTO `Media` "
2078 "( `DiskId`, `LastSequence`, `DiskPrompt`, `Cabinet`, `VolumeLabel`, `Source` ) "
2079 "VALUES ( 1, 0, '', 'zero.cab', '', '' )" );
2080 ok(
r ==
S_OK,
"cannot add file to the Media table: %d\n",
r );
2082 r =
run_query( hdb, 0,
"INSERT INTO `Media` "
2083 "( `DiskId`, `LastSequence`, `DiskPrompt`, `Cabinet`, `VolumeLabel`, `Source` ) "
2084 "VALUES ( 2, 1, '', 'one.cab', '', '' )" );
2085 ok(
r ==
S_OK,
"cannot add file to the Media table: %d\n",
r );
2087 r =
run_query( hdb, 0,
"INSERT INTO `Media` "
2088 "( `DiskId`, `LastSequence`, `DiskPrompt`, `Cabinet`, `VolumeLabel`, `Source` ) "
2089 "VALUES ( 3, 2, '', 'two.cab', '', '' )" );
2090 ok(
r ==
S_OK,
"cannot add file to the Media table: %d\n",
r );
2092 query =
"SELECT * FROM `Media`";
2095 check_record(rec, 6,
"1",
"0",
"",
"zero.cab",
"",
"");
2098 query =
"SELECT * FROM `Media` WHERE `LastSequence` >= 1";
2104 query =
"SELECT `DiskId` FROM `Media` WHERE `LastSequence` >= 1 AND DiskId >= 0";
2130 query =
"SELECT * FROM `Media` WHERE `DiskPrompt` IS NULL";
2136 query =
"SELECT * FROM `Media` WHERE `DiskPrompt` < 'Cabinet'";
2142 query =
"SELECT * FROM `Media` WHERE `DiskPrompt` > 'Cabinet'";
2148 query =
"SELECT * FROM `Media` WHERE `DiskPrompt` <> 'Cabinet'";
2154 query =
"SELECT * FROM `Media` WHERE `DiskPrompt` = 'Cabinet'";
2162 query =
"SELECT * FROM `Media` WHERE `DiskPrompt` = ?";
2183static const CHAR test_data[] =
"FirstPrimaryColumn\tSecondPrimaryColumn\tShortInt\tShortIntNullable\tLongInt\tLongIntNullable\tString\tLocalizableString\tLocalizableStringNullable\n"
2184 "s255\ti2\ti2\tI2\ti4\tI4\tS255\tS0\ts0\n"
2185 "TestTable\tFirstPrimaryColumn\n"
2186 "stringage\t5\t2\t\t2147483640\t-2147483640\tanother string\tlocalizable\tduh\n";
2190 "TwoPrimary\tPrimaryOne\tPrimaryTwo\n"
2195 "s72\ts72\ts72\ts72\ts72\ts72\n"
2197 "a\tb\tc\td\te\tf\n"
2198 "g\th\ti\t\rj\tk\tl\r\n";
2201 "s72\ts72\ts72\ts72\ts72\ts72\n"
2203 "a\tb\tc\td\te\tf\n"
2204 "g\th\ti\tj\tk\tl\r\n";
2208 "_SummaryInformation\tPropertyId\n"
2210 "2\tInstaller Database\n"
2211 "3\tInstaller description\n"
2214 "6\tInstaller comments\n"
2215 "7\tIntel;1033,2057\n"
2216 "9\t{12345678-1234-1234-1234-123456789012}\n"
2217 "12\t2009/04/12 15:46:11\n"
2218 "13\t2009/04/12 15:46:11\n"
2265 query =
"SELECT * FROM `_SummaryInformation`";
2282 ok(int_value == 1252,
"Expected 1252, got %d\n", int_value);
2284 size =
sizeof(str_value);
2288 ok(
size == 18,
"Expected 18, got %lu\n",
size);
2289 ok(!
strcmp(str_value,
"Installer Database"),
2290 "Expected \"Installer Database\", got %s\n", str_value);
2292 size =
sizeof(str_value);
2296 ok(!
strcmp(str_value,
"Installer description"),
2297 "Expected \"Installer description\", got %s\n", str_value);
2299 size =
sizeof(str_value);
2304 "Expected \"WineHQ\", got %s\n", str_value);
2306 size =
sizeof(str_value);
2310 ok(!
strcmp(str_value,
"Installer"),
2311 "Expected \"Installer\", got %s\n", str_value);
2313 size =
sizeof(str_value);
2317 ok(!
strcmp(str_value,
"Installer comments"),
2318 "Expected \"Installer comments\", got %s\n", str_value);
2320 size =
sizeof(str_value);
2324 ok(!
strcmp(str_value,
"Intel;1033,2057"),
2325 "Expected \"Intel;1033,2057\", got %s\n", str_value);
2327 size =
sizeof(str_value);
2331 ok(!
strcmp(str_value,
"{12345678-1234-1234-1234-123456789012}"),
2332 "Expected \"{12345678-1234-1234-1234-123456789012}\", got %s\n", str_value);
2345 ok(int_value == 200,
"Expected 200, got %d\n", int_value);
2350 ok(int_value == 2,
"Expected 2, got %d\n", int_value);
2355 ok(int_value == 2,
"Expected 2, got %d\n", int_value);
2357 size =
sizeof(str_value);
2361 ok(!
strcmp(str_value,
"Vim"),
"Expected \"Vim\", got %s\n", str_value);
2397 query =
"SELECT * FROM `TestTable`";
2403 check_record(rec, 9,
"FirstPrimaryColumn",
"SecondPrimaryColumn",
"ShortInt",
2404 "ShortIntNullable",
"LongInt",
"LongIntNullable",
"String",
2405 "LocalizableString",
"LocalizableStringNullable");
2410 check_record(rec, 9,
"s255",
"i2",
"i2",
"I2",
"i4",
"I4",
"S255",
"S0",
"s0");
2413 query =
"SELECT * FROM `TestTable`";
2416 check_record(rec, 9,
"stringage",
"5",
"2",
"",
"2147483640",
"-2147483640",
2417 "another string",
"localizable",
"duh");
2423 query =
"SELECT * FROM `TwoPrimary`";
2452 "Expected ERROR_NO_MORE_ITEMS, got %d\n",
r);
2459 query =
"SELECT * FROM `Table`";
2470 check_record(rec, 6,
"s72",
"s72",
"s72",
"s72",
"s72",
"s72");
2476 query =
"SELECT * FROM `Table`";
2495 "Expected ERROR_NO_MORE_ITEMS, got %d\n",
r);
2506 "filename1\tfilename1.ibd\r\n";
2533 query =
"SELECT * FROM `Binary`";
2546 ok(!
lstrcmpA(
buf,
"just some words"),
"Expected 'just some words', got %s\n",
buf);
2566 ok( hdb,
"failed to create db\n");
2574 query =
"CREATE TABLE `Table` ( `One` SHORT NOT NULL, `Two` CHAR(255) PRIMARY KEY `One`)";
2582 query =
"CREATE TABLE `?` ( `One` SHORT NOT NULL, `Two` CHAR(255) PRIMARY KEY `One`)";
2595 query =
"CREATE TABLE ? ( `One` SHORT NOT NULL, `Two` CHAR(255) PRIMARY KEY `One`)";
2601 query =
"CREATE TABLE `Mable` ( `?` SHORT NOT NULL, `Two` CHAR(255) PRIMARY KEY `One`)";
2610 query =
"CREATE TABLE `Mable` ( `?` SHORT NOT NULL, `?` CHAR(255) PRIMARY KEY `One`)";
2620 query =
"CREATE TABLE `Mable` ( `?` SHORT NOT NULL, `?` CHAR(255) PRIMARY KEY `?`)";
2625 query =
"CREATE TABLE `Mable` ( `?`, `?` PRIMARY KEY `?`)";
2630 query =
"CREATE TABLE `Mable` ( ? SHORT NOT NULL, ? CHAR(255) PRIMARY KEY ?)";
2638 query =
"CREATE TABLE `Mable` ( ? )";
2649 query =
"CREATE TABLE `?` ( `?` SHORT NOT NULL, `?` CHAR(255) PRIMARY KEY `?`)";
2655 query =
"INSERT INTO `Table` ( `One`, `Two` ) VALUES ( 5, 'hello' )";
2666 query =
"INSERT INTO `Table` ( `One`, `Two` ) VALUES ( ?, '?' )";
2677 query =
"INSERT INTO `Table` ( `?`, `?` ) VALUES ( ?, '?' )";
2686 query =
"INSERT INTO `Table` ( `?`, `?` ) VALUES ( 3, 'yellow' )";
2694 query =
"INSERT INTO `?` ( `One`, `Two` ) VALUES ( 2, 'green' )";
2704 query =
"INSERT INTO `?` ( `One`, `Two` ) VALUES ( ?, '?' )";
2716 query =
"INSERT INTO `?` ( `?`, `?` ) VALUES ( ?, '?' )";
2725 query =
"INSERT INTO `Table` ( `One`, `Two` ) VALUES ( ?, '?' )";
2734 query =
"INSERT INTO `Table` ( `One`, `Two` ) VALUES ( ?, ? )";
2743#define MY_NVIEWS 4000
2753 ok( hdb,
"failed to create db\n");
2755 memset(hviews, 0,
sizeof(hviews));
2758 static char szQueryBuf[256] =
"SELECT * from `_Tables`";
2759 hviews[
i] = 0xdeadbeeb;
2762 hviews[
i] == 0 || (
i && (hviews[
i] == hviews[
i-1])))
2769 if (hviews[
i] != 0 && hviews[
i] != 0xdeadbeeb) {
2807 query =
"CREATE TABLE `AAR` ( `BAR` SHORT NOT NULL, `CAR` CHAR(255) PRIMARY KEY `CAR`)";
2811 query =
"INSERT INTO `AAR` ( `BAR`, `CAR` ) VALUES ( 1, 'vw' )";
2815 query =
"INSERT INTO `AAR` ( `BAR`, `CAR` ) VALUES ( 2, 'bmw' )";
2819 query =
"UPDATE `MOO` SET `OOO` = 'c' WHERE `NOO` = 1";
2823 query =
"DELETE FROM `MOO` WHERE `NOO` = 3";
2835 query =
"INSERT INTO `BINARY` ( `ID`, `BLOB` ) VALUES ( ?, ? )";
2841 query =
"ALTER TABLE `MOO` ADD `COW` INTEGER";
2845 query =
"ALTER TABLE `MOO` ADD `PIG` INTEGER";
2849 query =
"UPDATE `MOO` SET `PIG` = 5 WHERE `NOO` = 1";
2853 query =
"CREATE TABLE `Property` ( `Property` CHAR(72) NOT NULL, "
2854 "`Value` CHAR(0) PRIMARY KEY `Property`)";
2858 query =
"INSERT INTO `Property` ( `Property`, `Value` ) VALUES ( 'prop', 'val' )";
2878static const WCHAR name2[] = { 0x4840, 0x3b3f, 0x43f2, 0x4438, 0x45b1, 0 };
2879static const WCHAR name3[] = { 0x4840, 0x3f7f, 0x4164, 0x422f, 0x4836, 0 };
2880static const WCHAR name4[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824, 0 };
2881static const WCHAR name5[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2, 0x482f, 0 };
2883static const WCHAR name7[] = { 0x4840, 0x3c8b, 0x3a97, 0x409b, 0 };
2884static const WCHAR name8[] = { 0x3c8b, 0x3a97, 0x409b, 0x387e, 0 };
2885static const WCHAR name9[] = { 0x4840, 0x4559, 0x44f2, 0x4568, 0x4737, 0 };
2889 0x0201, 0x0008, 0x8001,
2890 0x0201, 0x0009, 0x8002,
2893 0x0401, 0x0001, 0x8003, 0x0002, 0x9502,
2894 0x0401, 0x0001, 0x8004, 0x0003, 0x9502,
2895 0x0401, 0x0005, 0x0000, 0x0006, 0xbdff,
2896 0x0401, 0x0005, 0x0000, 0x0007, 0x8502,
2897 0x0401, 0x000a, 0x0000, 0x000a, 0xad48,
2898 0x0401, 0x000a, 0x0000, 0x000b, 0x9d00,
2905 "MOOCOWPIGcAARCARBARvwbmwPropertyValuepropval";
2925 0x000a, 0x8001, 0x0004, 0x8005,
2930 0x0201, 0x8001, 0x0001,
2937 0x0201, 0x000c, 0x000d,
2940static const struct {
2966 const CLSID CLSID_MsiTransform = { 0xc1082,0,0,{0xc0,0,0,0,0,0,0,0x46}};
2971 ok(
r ==
S_OK,
"failed to create storage\n");
2975 r = IStorage_SetClass( stg, &CLSID_MsiTransform );
2976 ok(
r ==
S_OK,
"failed to set storage type\n");
2984 ok(0,
"failed to create stream %#lx\n",
r);
2991 ok(0,
"failed to write stream\n");
2992 IStream_Release(stm);
2995 IStorage_Release(stg);
3008 "Installation Database");
3012 "Installation Database");
3024 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
3072 sprintf(szPackage,
"#%lu", hdb);
3090 static const struct {
3097 {
"MOO",
"OOO",
"1",
"c",
"a" },
3098 {
"MOO",
"COW",
"",
"5378",
"3" },
3099 {
"MOO",
"PIG",
"",
"5378",
"4" },
3100 {
"MOO",
"PIG",
"1",
"5",
"" },
3101 {
"MOO",
"DELETE",
"3",
"",
"" },
3102 {
"BINARY",
"BLOB",
"1",
"BINARY.1",
"" },
3103 {
"BINARY",
"INSERT",
"1",
"",
"" },
3104 {
"AAR",
"CREATE",
"",
"",
"" },
3105 {
"AAR",
"CAR",
"",
"15871",
"1" },
3106 {
"AAR",
"BAR",
"",
"1282",
"2" },
3107 {
"AAR",
"BAR",
"vw",
"1",
"" },
3108 {
"AAR",
"BAR",
"bmw",
"2",
"" },
3109 {
"AAR",
"INSERT",
"vw",
"",
"" },
3110 {
"AAR",
"INSERT",
"bmw",
"",
"" },
3111 {
"Property",
"CREATE",
"",
"",
"" },
3112 {
"Property",
"Property",
"",
"11592",
"1" },
3113 {
"Property",
"Value",
"",
"7424",
"2" },
3114 {
"Property",
"Value",
"prop",
"val",
"" },
3115 {
"Property",
"INSERT",
"prop",
"",
"" }
3130 ok(hdb,
"Failed to create package db\n");
3132 query =
"CREATE TABLE `MOO` ( `NOO` SHORT NOT NULL, `OOO` CHAR(255) PRIMARY KEY `NOO`)";
3136 query =
"INSERT INTO `MOO` ( `NOO`, `OOO` ) VALUES ( 1, 'a' )";
3140 query =
"INSERT INTO `MOO` ( `NOO`, `OOO` ) VALUES ( 2, 'b' )";
3144 query =
"INSERT INTO `MOO` ( `NOO`, `OOO` ) VALUES ( 3, 'c' )";
3148 query =
"CREATE TABLE `BINARY` ( `ID` SHORT NOT NULL, `BLOB` OBJECT PRIMARY KEY `ID`)";
3160 query =
"INSERT INTO `BINARY` ( `ID`, `BLOB` ) VALUES ( ?, ? )";
3188 query =
"select * from `_TransformView`";
3196 check_record(hrec, 5,
"Table",
"Column",
"Row",
"Data",
"Current");
3209 for (
i = 1;
i <= 5;
i++) {
3238 query =
"ALTER TABLE `_TransformView` FREE";
3252 query =
"select `BAR`,`CAR` from `AAR` where `BAR` = 1 AND `CAR` = 'vw'";
3257 query =
"select `BAR`,`CAR` from `AAR` where `BAR` = 2 AND `CAR` = 'bmw'";
3265 query =
"select `NOO`,`OOO` from `MOO` where `NOO` = 1 AND `OOO` = 'c'";
3272 query =
"select `NOO`,`OOO` from `MOO` where `NOO` = 2 AND `OOO` = 'b'";
3279 query =
"select * from `MOO` where `NOO` = 3";
3286 query =
"select `BLOB` from `BINARY` where `ID` = 1";
3295 ok(sz == 9,
"stream data was wrong size\n");
3300 query =
"select * from `MOO`";
3328 skip(
"Not enough rights to perform tests\n");
3348 {
"alveolar",
"procerus" },
3349 {
"septum",
"procerus" },
3350 {
"septum",
"nasalis" },
3351 {
"ramus",
"nasalis" },
3352 {
"malar",
"mentalis" },
3357 {
"nasal",
"septum" },
3358 {
"mandible",
"ramus" },
3363 {
"msvcp.dll",
"abcdefgh" },
3364 {
"msvcr.dll",
"ijklmnop" },
3369 {
"msvcp.dll.01234",
"single.dll.31415" },
3374 {
"malar",
"procerus" },
3379 {
"malar",
"procerus" },
3380 {
"malar",
"procerus" },
3381 {
"malar",
"nasalis" },
3382 {
"malar",
"nasalis" },
3383 {
"malar",
"nasalis" },
3384 {
"malar",
"mentalis" },
3389 {
"malar",
"nasalis" },
3390 {
"malar",
"nasalis" },
3391 {
"malar",
"nasalis" },
3396 {
"msvcp.dll",
"msvcp.dll.01234",
"msvcp.dll.01234",
"abcdefgh" },
3397 {
"msvcr.dll",
"msvcr.dll.56789",
"msvcp.dll.01234",
"abcdefgh" },
3398 {
"msvcp.dll",
"msvcp.dll.01234",
"msvcr.dll.56789",
"ijklmnop" },
3399 {
"msvcr.dll",
"msvcr.dll.56789",
"msvcr.dll.56789",
"ijklmnop" },
3400 {
"msvcp.dll",
"msvcp.dll.01234",
"single.dll.31415",
"msvcp.dll" },
3401 {
"msvcr.dll",
"msvcr.dll.56789",
"single.dll.31415",
"msvcp.dll" },