34static const char *
msifile =
"winetest-db.msi";
35static const char *
msifile2 =
"winetst2-db.msi";
36static const char *
mstfile =
"winetst-db.mst";
58 "field %u: expected \"%s\", got \"%s\"\n",
i,
expect,
buffer);
63#define check_record(rec, ...) check_record_(__LINE__, rec, __VA_ARGS__)
169 ok (
res,
"Got zero res.\n" );
185 ok(
res ==
TRUE,
"Failed to delete database\n" );
188 ok(
res ==
TRUE,
"Failed to delete database\n" );
235 "CREATE TABLE `Component` ( "
236 "`Component` CHAR(72) NOT NULL, "
237 "`ComponentId` CHAR(38), "
238 "`Directory_` CHAR(72) NOT NULL, "
239 "`Attributes` SHORT NOT NULL, "
240 "`Condition` CHAR(255), "
241 "`KeyPath` CHAR(72) "
242 "PRIMARY KEY `Component`)" );
250 "CREATE TABLE `CustomAction` ( "
251 "`Action` CHAR(72) NOT NULL, "
252 "`Type` SHORT NOT NULL, "
253 "`Source` CHAR(72), "
254 "`Target` CHAR(255) "
255 "PRIMARY KEY `Action`)" );
263 "CREATE TABLE `Directory` ( "
264 "`Directory` CHAR(255) NOT NULL, "
265 "`Directory_Parent` CHAR(255), "
266 "`DefaultDir` CHAR(255) NOT NULL "
267 "PRIMARY KEY `Directory`)" );
275 "CREATE TABLE `FeatureComponents` ( "
276 "`Feature_` CHAR(38) NOT NULL, "
277 "`Component_` CHAR(72) NOT NULL "
278 "PRIMARY KEY `Feature_`, `Component_` )" );
286 "CREATE TABLE `StdDlls` ( "
287 "`File` CHAR(255) NOT NULL, "
288 "`Binary_` CHAR(72) NOT NULL "
289 "PRIMARY KEY `File` )" );
297 "CREATE TABLE `Binary` ( "
298 "`Name` CHAR(72) NOT NULL, "
299 "`Data` CHAR(72) NOT NULL "
300 "PRIMARY KEY `Name` )" );
319#define add_component_entry(hdb, values) add_entry(__FILE__, __LINE__, "Component", hdb, values, \
320 "INSERT INTO `Component` " \
321 "(`Component`, `ComponentId`, `Directory_`, " \
322 "`Attributes`, `Condition`, `KeyPath`) VALUES( %s )")
324#define add_custom_action_entry(hdb, values) add_entry(__FILE__, __LINE__, "CustomAction", hdb, values, \
325 "INSERT INTO `CustomAction` " \
326 "(`Action`, `Type`, `Source`, `Target`) VALUES( %s )")
328#define add_feature_components_entry(hdb, values) add_entry(__FILE__, __LINE__, "FeatureComponents", hdb, values, \
329 "INSERT INTO `FeatureComponents` " \
330 "(`Feature_`, `Component_`) VALUES( %s )")
332#define add_std_dlls_entry(hdb, values) add_entry(__FILE__, __LINE__, "StdDlls", hdb, values, \
333 "INSERT INTO `StdDlls` (`File`, `Binary_`) VALUES( %s )")
335#define add_binary_entry(hdb, values) add_entry(__FILE__, __LINE__, "Binary", hdb, values, \
336 "INSERT INTO `Binary` (`Name`, `Data`) VALUES( %s )")
340 MSIHANDLE hdb = 0, hview = 0, hview2 = 0, hrec = 0;
353 query =
"CREATE TABLE `phone` ( "
354 "`id` INT, `name` CHAR(32), `number` CHAR(32) "
365 query =
"SELECT * FROM phone WHERE number = '8675309'";
374 query =
"INSERT INTO `phone` ( `id`, `name`, `number` )"
375 "VALUES('1', 'Abe', '8675309')";
399 query =
"SELECT * FROM `phone` WHERE `id` = 1";
405 ok(
r == 3,
"record count wrong\n");
408 ok(
r ==
FALSE,
"field 0 not null\n");
411 ok(
r == 1,
"field 1 contents wrong\n");
415 ok(!
strcmp(
buf,
"Abe"),
"field 2 content incorrect\n");
419 ok(!
strcmp(
buf,
"8675309"),
"field 3 content incorrect\n");
426 query =
"SELECT * FROM `phone` WHERE `id` >= 10";
429 ok(hrec == 0,
"hrec should be null\n");
434 query =
"SELECT * FROM `phone` WHERE `id` < 0";
438 query =
"SELECT * FROM `phone` WHERE `id` <= 0";
442 query =
"SELECT * FROM `phone` WHERE `id` <> 1";
446 query =
"SELECT * FROM `phone` WHERE `id` > 10";
451 query =
"INSERT INTO `phone` ( `id`, `name`, `number` )"
466 query =
"INSERT INTO `phone` ( `id`, `name`, `number` )"
493 ok(
r ==
TRUE,
"file didn't exist after commit\n");
507 if (!pMsiDecomposeDescriptorA)
511 desc =
"']gAVn-}f(ZXfeAR6.jiFollowTheWhiteRabbit>3w2x^IGfe?CxI5heAvk.";
513 prod[0] =
feature[0] = comp[0] = 0;
517 ok(
strcmp(prod,
"{90110409-6000-11D3-8CFE-0150048383C9}")==0,
"product wrong\n");
519 ok(
strcmp(comp,
"{A7CD68DB-EF74-49C8-FBB2-A7C463B2AC24}")==0,
"component wrong\n");
522 desc =
"']gAVn-}f(ZXfeAR6.ji"
523 "ThisWillFailIfTheresMoreThanAGuidsChars>"
524 "3w2x^IGfe?CxI5heAvk.";
530 desc =
"']gAVn-}f(ZXfeAR6.jiFollowTheWhiteRabbit<3w2x^IGfe?CxI5heAvk.";
537 ok(!
strcmp(prod,
"{90110409-6000-11D3-8CFE-0150048383C9}"),
"got '%s'\n", prod);
539 ok(!comp[0],
"got '%s'\n", comp);
544 r = pMsiDecomposeDescriptorA(
"yh1BVN)8A$!!!!!MKKSkAlwaysInstalledIntl_1033<", prod,
feature, comp, &
len);
547 ok(!
strcmp(prod,
"{90150000-006E-0409-0000-0000000FF1CE}"),
"got '%s'\n", prod);
549 ok(!comp[0],
"got '%s'\n", comp);
555 desc =
"']gAVn-}f(ZXfeAR6.ji"
556 "ThisWillWorkIfTheresLTEThanAGuidsChars>"
557 "3w2x^IGfe?CxI5heAvk."
582 ok(
len == 0,
"length wrong\n");
675 r =
try_query( hdb,
"CREATE TABLE `a` (`b`)");
678 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHAR(72) )");
681 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHAR(72) NOT NULL)");
684 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY)");
687 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY KEY)");
690 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY KEY)");
693 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY KEY 'b')");
696 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY KEY `b')");
699 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY KEY `b')");
702 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHA(72) NOT NULL PRIMARY KEY `b`)");
705 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHAR(-1) NOT NULL PRIMARY KEY `b`)");
708 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHAR(720) NOT NULL PRIMARY KEY `b`)");
711 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHAR(72) NOT NULL KEY `b`)");
714 r =
try_query( hdb,
"CREATE TABLE `a` (`` CHAR(72) NOT NULL PRIMARY KEY `b`)");
717 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY KEY `b`)");
720 r =
try_query( hdb,
"CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY KEY `b`)");
723 r =
try_query( hdb,
"CREATE TABLE `aa` (`b` CHAR(72) NOT NULL, `c` "
724 "CHAR(72), `d` CHAR(255) NOT NULL LOCALIZABLE PRIMARY KEY `b`)");
730 r =
try_query( hdb,
"CREATE TABLE `blah` (`foo` CHAR(72) NOT NULL "
731 "PRIMARY KEY `foo`)");
740 r =
try_query( hdb,
"CREATE TABLE `boo` (`foo` CHAR(72) NOT NULL "
741 "PRIMARY KEY `ba`)");
744 r =
try_query( hdb,
"CREATE TABLE `bee` (`foo` CHAR(72) NOT NULL )");
747 r =
try_query( hdb,
"CREATE TABLE `temp` (`t` CHAR(72) NOT NULL "
751 r =
try_query( hdb,
"CREATE TABLE `c` (`b` CHAR NOT NULL PRIMARY KEY `b`)");
757 r =
try_query( hdb,
"select * from c where b = 'x");
760 r =
try_query( hdb,
"select * from c where b = 'x'");
769 r =
try_query( hdb,
"select * from c where b = x");
772 r =
try_query( hdb,
"select * from c where b = \"x\"");
775 r =
try_query( hdb,
"select * from c where b = 'x'");
778 r =
try_query( hdb,
"select * from c where b = '\"x'");
783 r =
try_query( hdb,
"select * from c where b = '\\\'x'");
790 r =
try_query( hdb,
"select `c`.`b` from `c` order by `c`.`order`");
793 r =
try_query( hdb,
"select `c`.b` from `c`");
796 r =
try_query( hdb,
"select `c`.`b from `c`");
802 r =
try_query( hdb,
"select `c.`b` from `c`");
805 r =
try_query( hdb,
"select c`.`b` from `c`");
811 r =
try_query( hdb,
"select `c`.`b` from c`");
814 r =
try_query( hdb,
"select `c`.`b` from `c");
820 r =
try_query( hdb,
"CREATE TABLE `\5a` (`b` CHAR NOT NULL PRIMARY KEY `b`)" );
826 r =
try_query( hdb,
"CREATE TABLE `a\5` (`b` CHAR NOT NULL PRIMARY KEY `b`)" );
832 r =
try_query( hdb,
"CREATE TABLE `-a` (`b` CHAR NOT NULL PRIMARY KEY `b`)" );
838 r =
try_query( hdb,
"CREATE TABLE `a-` (`b` CHAR NOT NULL PRIMARY KEY `b`)" );
848 ok(
r ==
TRUE,
"file didn't exist after commit\n");
866 query =
"CREATE TABLE `phone` ( "
867 "`id` INT, `name` CHAR(32), `number` CHAR(32) "
872 query =
"CREATE TABLE `_Validation` ( "
873 "`Table` CHAR(32) NOT NULL, `Column` CHAR(32) NOT NULL, "
874 "`Nullable` CHAR(4) NOT NULL, `MinValue` INT, `MaxValue` INT, "
875 "`KeyTable` CHAR(255), `KeyColumn` SHORT, `Category` CHAR(32), "
876 "`Set` CHAR(255), `Description` CHAR(255) PRIMARY KEY `Table`, `Column`)";
880 query =
"INSERT INTO `_Validation` ( `Table`, `Column`, `Nullable` ) "
881 "VALUES('phone', 'id', 'N')";
885 query =
"SELECT * FROM `phone`";
895 ok(sz == 0,
"got size %lu\n", sz);
916 ok(sz == 0,
"got size %lu\n", sz);
948 ok(sz == 2,
"got size %lu\n", sz);
990 query =
"SELECT * FROM `phone`";
1027 query =
"SELECT * FROM `phone`";
1042 ok(hrec != 0,
"MsiCreateRecord failed\n");
1059 ok(hrec != 0,
"MsiCreateRecord failed\n");
1095 query =
"SELECT * FROM `phone` WHERE `id` = 1";
1120 query =
"SELECT * FROM `phone` ORDER BY `id`";
1174 ok( hdb,
"failed to create db\n");
1203 ok( rec == 0,
"returned a record\n");
1275 ok( hdb,
"failed to create db\n");
1278 "CREATE TABLE `Properties` "
1279 "( `Property` CHAR(255), "
1280 " `Value` CHAR(1), "
1282 " `Integervalue` INTEGER, "
1283 " `Shortvalue` SHORT, "
1284 " `Longvalue` LONG, "
1285 " `Longcharvalue` LONGCHAR, "
1286 " `Charvalue` CHAR, "
1287 " `Localizablevalue` CHAR LOCALIZABLE "
1288 " PRIMARY KEY `Property`)" );
1293 ok( rec,
"failed to get column info record\n" );
1294 check_record(rec, 9,
"S255",
"S1",
"I2",
"I2",
"I2",
"I4",
"S0",
"S0",
"L0");
1310 ok( rec,
"failed to get column info record\n" );
1311 check_record(rec, 9,
"Property",
"Value",
"Intvalue",
"Integervalue",
"Shortvalue",
1312 "Longvalue",
"Longcharvalue",
"Charvalue",
"Localizablevalue");
1316 "CREATE TABLE `Binary` "
1317 "( `Name` CHAR(255), `Data` OBJECT PRIMARY KEY `Name`)" );
1322 ok( rec,
"failed to get column info record\n" );
1332 ok( rec,
"failed to get column info record\n" );
1337 "CREATE TABLE `UIText` "
1338 "( `Key` CHAR(72) NOT NULL, `Text` CHAR(255) LOCALIZABLE PRIMARY KEY `Key`)" );
1345 ok( rec,
"failed to get column info record\n" );
1350 ok( rec,
"failed to get column info record\n" );
1363 const char file[] =
"phone.txt";
1368 "id\tname\tnumber\r\n"
1371 "1\tAbe\t8675309\r\n";
1380 query =
"CREATE TABLE `phone` ( "
1381 "`id` INT, `name` CHAR(32), `number` CHAR(32) "
1382 "PRIMARY KEY `id`)";
1393 query =
"INSERT INTO `phone` ( `id`, `name`, `number` )"
1394 "VALUES('1', 'Abe', '8675309')";
1425 ok(0,
"failed to open file %s\n",
path);
1434 const char insert_query[] =
1435 "INSERT INTO `strings` ( `id`, `val` ) VALUES('1', 'Z')";
1449 "CREATE TABLE `strings` ( `id` INT, `val` CHAR(0) PRIMARY KEY `id`)");
1454 len =
strchr(insert_query,
'Z') - insert_query;
1499 ok( hdb,
"failed to create db\n");
1502 "CREATE TABLE `Properties` "
1503 "( `Property` CHAR(255), `Value` CHAR(1) PRIMARY KEY `Property`)" );
1507 "INSERT INTO `Properties` "
1508 "( `Value`, `Property` ) VALUES ( 'Prop', 'value' )" );
1521 ok( rec,
"failed to get column info record\n" );
1527 ok( rec,
"failed to get column info record\n" );
1532 "SELECT * FROM `_Streams` WHERE `Name` = '\5SummaryInformation'", &
view );
1558 "SELECT * FROM `_Streams` WHERE `Name` = '\5SummaryInformation'", &
view );
1583 "INSERT INTO `_Streams` ( `Name`, `Data` ) VALUES ( ?, ? )", &
view );
1605 "INSERT INTO `_Streams` ( `Name`, `Data` ) VALUES ( ?, ? )", &
view );
1627 "INSERT INTO `_Streams` ( `Name`, `Data` ) VALUES ( ?, ? )", &
view );
1638 "SELECT `Name`, `Data` FROM `_Streams` WHERE `Name` = 'data'", &
view );
1663 "SELECT `Name`, `Data` FROM `_Streams` WHERE `Name` = 'data1'", &
view );
1697 "UPDATE `_Streams` SET `Data` = ? WHERE `Name` = 'data1'", &
view );
1708 "SELECT `Name`, `Data` FROM `_Streams` WHERE `Name` = 'data1'", &
view );
1737 ok( hdb,
"failed to create db\n");
1745 "INSERT INTO `_Streams` ( `Name`, `Data` ) VALUES ( ?, ? )", &
view );
1757 "SELECT `Name`, `Data` FROM `_Streams` WHERE `Name` = 'data'", &
view );
1779 "SELECT `Name`, `Data` FROM `_Streams` WHERE `Name` = 'data'", &
view );
1790 "DELETE FROM `_Streams` WHERE `Name` = 'data'", &
view );
1826 query =
"CREATE TABLE `Binary` ( `Name` CHAR(72) NOT NULL, `ID` INT NOT NULL, `Data` OBJECT PRIMARY KEY `Name`, `ID`)";
1837 query =
"INSERT INTO `Binary` ( `Name`, `ID`, `Data` ) VALUES ( 'encryption.dll.CB4E6205_F99A_4C51_ADD4_184506EFAB87', 10000, ? )";
1853 query =
"CREATE TABLE `Binary` ( `Name` CHAR(72) NOT NULL, `ID` INT NOT NULL, `Data` OBJECT PRIMARY KEY `Name`, `ID`)";
1863 query =
"INSERT INTO `Binary` ( `Name`, `ID`, `Data` ) VALUES ( 'filename1', 1, ? )";
1867 query =
"INSERT INTO `Binary` ( `Name`, `ID`, `Data` ) VALUES ( 'filename1', 1, ? )";
1884 query =
"SELECT * FROM `_Streams`";
1891 ok( !
lstrcmpA(
file,
"Binary.filename1.1"),
"Expected 'Binary.filename1.1', got %s\n",
file );
1903 query =
"SELECT * FROM `Binary`";
1934 ok( hdb,
"failed to create db\n");
1937 "CREATE TABLE `IESTable` ("
1938 "`Action` CHAR(64), "
1939 "`Condition` CHAR(64), "
1940 "`Sequence` LONG PRIMARY KEY `Sequence`)");
1941 ok(
r ==
S_OK,
"Cannot create IESTable table: %d\n",
r);
1944 "CREATE TABLE `CATable` ("
1945 "`Action` CHAR(64), "
1946 "`Type` LONG PRIMARY KEY `Type`)");
1947 ok(
r ==
S_OK,
"Cannot create CATable table: %d\n",
r);
1949 r =
run_query(hdb, 0,
"INSERT INTO `IESTable` "
1950 "( `Action`, `Condition`, `Sequence`) "
1951 "VALUES ( 'clean', 'cond4', 4)");
1952 ok(
r ==
S_OK,
"cannot add entry to IESTable table:%d\n",
r );
1954 r =
run_query(hdb, 0,
"INSERT INTO `IESTable` "
1955 "( `Action`, `Condition`, `Sequence`) "
1956 "VALUES ( 'depends', 'cond1', 1)");
1957 ok(
r ==
S_OK,
"cannot add entry to IESTable table:%d\n",
r );
1959 r =
run_query(hdb, 0,
"INSERT INTO `IESTable` "
1960 "( `Action`, `Condition`, `Sequence`) "
1961 "VALUES ( 'build', 'cond2', 2)");
1962 ok(
r ==
S_OK,
"cannot add entry to IESTable table:%d\n",
r );
1964 r =
run_query(hdb, 0,
"INSERT INTO `IESTable` "
1965 "( `Action`, `Condition`, `Sequence`) "
1966 "VALUES ( 'build2', 'cond6', 6)");
1967 ok(
r ==
S_OK,
"cannot add entry to IESTable table:%d\n",
r );
1969 r =
run_query(hdb, 0,
"INSERT INTO `IESTable` "
1970 "( `Action`, `Condition`, `Sequence`) "
1971 "VALUES ( 'build', 'cond3', 3)");
1972 ok(
r ==
S_OK,
"cannot add entry to IESTable table:%d\n",
r );
1974 r =
run_query(hdb, 0,
"INSERT INTO `CATable` "
1975 "( `Action`, `Type` ) "
1976 "VALUES ( 'build', 32)");
1977 ok(
r ==
S_OK,
"cannot add entry to CATable table:%d\n",
r );
1979 r =
run_query(hdb, 0,
"INSERT INTO `CATable` "
1980 "( `Action`, `Type` ) "
1981 "VALUES ( 'depends', 64)");
1982 ok(
r ==
S_OK,
"cannot add entry to CATable table:%d\n",
r );
1984 r =
run_query(hdb, 0,
"INSERT INTO `CATable` "
1985 "( `Action`, `Type` ) "
1986 "VALUES ( 'clean', 63)");
1987 ok(
r ==
S_OK,
"cannot add entry to CATable table:%d\n",
r );
1989 r =
run_query(hdb, 0,
"INSERT INTO `CATable` "
1990 "( `Action`, `Type` ) "
1991 "VALUES ( 'build2', 34)");
1992 ok(
r ==
S_OK,
"cannot add entry to CATable table:%d\n",
r );
1993 query =
"Select IESTable.Condition from CATable, IESTable where "
1994 "CATable.Action = IESTable.Action and CATable.Type = 32";
2026 ok( hdb,
"failed to create db\n");
2029 "CREATE TABLE `Media` ("
2030 "`DiskId` SHORT NOT NULL, "
2031 "`LastSequence` LONG, "
2032 "`DiskPrompt` CHAR(64) LOCALIZABLE, "
2033 "`Cabinet` CHAR(255), "
2034 "`VolumeLabel` CHAR(32), "
2035 "`Source` CHAR(72) "
2036 "PRIMARY KEY `DiskId`)" );
2037 ok(
r ==
S_OK,
"cannot create Media table: %d\n",
r );
2039 r =
run_query( hdb, 0,
"INSERT INTO `Media` "
2040 "( `DiskId`, `LastSequence`, `DiskPrompt`, `Cabinet`, `VolumeLabel`, `Source` ) "
2041 "VALUES ( 1, 0, '', 'zero.cab', '', '' )" );
2042 ok(
r ==
S_OK,
"cannot add file to the Media table: %d\n",
r );
2044 r =
run_query( hdb, 0,
"INSERT INTO `Media` "
2045 "( `DiskId`, `LastSequence`, `DiskPrompt`, `Cabinet`, `VolumeLabel`, `Source` ) "
2046 "VALUES ( 2, 1, '', 'one.cab', '', '' )" );
2047 ok(
r ==
S_OK,
"cannot add file to the Media table: %d\n",
r );
2049 r =
run_query( hdb, 0,
"INSERT INTO `Media` "
2050 "( `DiskId`, `LastSequence`, `DiskPrompt`, `Cabinet`, `VolumeLabel`, `Source` ) "
2051 "VALUES ( 3, 2, '', 'two.cab', '', '' )" );
2052 ok(
r ==
S_OK,
"cannot add file to the Media table: %d\n",
r );
2054 query =
"SELECT * FROM `Media`";
2057 check_record(rec, 6,
"1",
"0",
"",
"zero.cab",
"",
"");
2060 query =
"SELECT * FROM `Media` WHERE `LastSequence` >= 1";
2066 query =
"SELECT `DiskId` FROM `Media` WHERE `LastSequence` >= 1 AND DiskId >= 0";
2092 query =
"SELECT * FROM `Media` WHERE `DiskPrompt` IS NULL";
2098 query =
"SELECT * FROM `Media` WHERE `DiskPrompt` < 'Cabinet'";
2104 query =
"SELECT * FROM `Media` WHERE `DiskPrompt` > 'Cabinet'";
2110 query =
"SELECT * FROM `Media` WHERE `DiskPrompt` <> 'Cabinet'";
2116 query =
"SELECT * FROM `Media` WHERE `DiskPrompt` = 'Cabinet'";
2124 query =
"SELECT * FROM `Media` WHERE `DiskPrompt` = ?";
2143static const CHAR test_data[] =
"FirstPrimaryColumn\tSecondPrimaryColumn\tShortInt\tShortIntNullable\tLongInt\tLongIntNullable\tString\tLocalizableString\tLocalizableStringNullable\n"
2144 "s255\ti2\ti2\tI2\ti4\tI4\tS255\tS0\ts0\n"
2145 "TestTable\tFirstPrimaryColumn\n"
2146 "stringage\t5\t2\t\t2147483640\t-2147483640\tanother string\tlocalizable\tduh\n";
2150 "TwoPrimary\tPrimaryOne\tPrimaryTwo\n"
2155 "s72\ts72\ts72\ts72\ts72\ts72\n"
2157 "a\tb\tc\td\te\tf\n"
2158 "g\th\ti\t\rj\tk\tl\r\n";
2161 "s72\ts72\ts72\ts72\ts72\ts72\n"
2163 "a\tb\tc\td\te\tf\n"
2164 "g\th\ti\tj\tk\tl\r\n";
2168 "_SummaryInformation\tPropertyId\n"
2170 "2\tInstaller Database\n"
2171 "3\tInstaller description\n"
2174 "6\tInstaller comments\n"
2175 "7\tIntel;1033,2057\n"
2176 "9\t{12345678-1234-1234-1234-123456789012}\n"
2177 "12\t2009/04/12 15:46:11\n"
2178 "13\t2009/04/12 15:46:11\n"
2225 query =
"SELECT * FROM `_SummaryInformation`";
2242 ok(int_value == 1252,
"Expected 1252, got %d\n", int_value);
2244 size =
sizeof(str_value);
2248 ok(
size == 18,
"Expected 18, got %lu\n",
size);
2249 ok(!
strcmp(str_value,
"Installer Database"),
2250 "Expected \"Installer Database\", got %s\n", str_value);
2252 size =
sizeof(str_value);
2256 ok(!
strcmp(str_value,
"Installer description"),
2257 "Expected \"Installer description\", got %s\n", str_value);
2259 size =
sizeof(str_value);
2264 "Expected \"WineHQ\", got %s\n", str_value);
2266 size =
sizeof(str_value);
2270 ok(!
strcmp(str_value,
"Installer"),
2271 "Expected \"Installer\", got %s\n", str_value);
2273 size =
sizeof(str_value);
2277 ok(!
strcmp(str_value,
"Installer comments"),
2278 "Expected \"Installer comments\", got %s\n", str_value);
2280 size =
sizeof(str_value);
2284 ok(!
strcmp(str_value,
"Intel;1033,2057"),
2285 "Expected \"Intel;1033,2057\", got %s\n", str_value);
2287 size =
sizeof(str_value);
2291 ok(!
strcmp(str_value,
"{12345678-1234-1234-1234-123456789012}"),
2292 "Expected \"{12345678-1234-1234-1234-123456789012}\", got %s\n", str_value);
2305 ok(int_value == 200,
"Expected 200, got %d\n", int_value);
2310 ok(int_value == 2,
"Expected 2, got %d\n", int_value);
2315 ok(int_value == 2,
"Expected 2, got %d\n", int_value);
2317 size =
sizeof(str_value);
2321 ok(!
strcmp(str_value,
"Vim"),
"Expected \"Vim\", got %s\n", str_value);
2357 query =
"SELECT * FROM `TestTable`";
2363 check_record(rec, 9,
"FirstPrimaryColumn",
"SecondPrimaryColumn",
"ShortInt",
2364 "ShortIntNullable",
"LongInt",
"LongIntNullable",
"String",
2365 "LocalizableString",
"LocalizableStringNullable");
2370 check_record(rec, 9,
"s255",
"i2",
"i2",
"I2",
"i4",
"I4",
"S255",
"S0",
"s0");
2373 query =
"SELECT * FROM `TestTable`";
2376 check_record(rec, 9,
"stringage",
"5",
"2",
"",
"2147483640",
"-2147483640",
2377 "another string",
"localizable",
"duh");
2383 query =
"SELECT * FROM `TwoPrimary`";
2412 "Expected ERROR_NO_MORE_ITEMS, got %d\n",
r);
2419 query =
"SELECT * FROM `Table`";
2430 check_record(rec, 6,
"s72",
"s72",
"s72",
"s72",
"s72",
"s72");
2436 query =
"SELECT * FROM `Table`";
2455 "Expected ERROR_NO_MORE_ITEMS, got %d\n",
r);
2466 "filename1\tfilename1.ibd\r\n";
2493 query =
"SELECT * FROM `Binary`";
2506 ok(!
lstrcmpA(
buf,
"just some words"),
"Expected 'just some words', got %s\n",
buf);
2526 ok( hdb,
"failed to create db\n");
2534 query =
"CREATE TABLE `Table` ( `One` SHORT NOT NULL, `Two` CHAR(255) PRIMARY KEY `One`)";
2542 query =
"CREATE TABLE `?` ( `One` SHORT NOT NULL, `Two` CHAR(255) PRIMARY KEY `One`)";
2555 query =
"CREATE TABLE ? ( `One` SHORT NOT NULL, `Two` CHAR(255) PRIMARY KEY `One`)";
2561 query =
"CREATE TABLE `Mable` ( `?` SHORT NOT NULL, `Two` CHAR(255) PRIMARY KEY `One`)";
2570 query =
"CREATE TABLE `Mable` ( `?` SHORT NOT NULL, `?` CHAR(255) PRIMARY KEY `One`)";
2580 query =
"CREATE TABLE `Mable` ( `?` SHORT NOT NULL, `?` CHAR(255) PRIMARY KEY `?`)";
2585 query =
"CREATE TABLE `Mable` ( `?`, `?` PRIMARY KEY `?`)";
2590 query =
"CREATE TABLE `Mable` ( ? SHORT NOT NULL, ? CHAR(255) PRIMARY KEY ?)";
2598 query =
"CREATE TABLE `Mable` ( ? )";
2609 query =
"CREATE TABLE `?` ( `?` SHORT NOT NULL, `?` CHAR(255) PRIMARY KEY `?`)";
2615 query =
"INSERT INTO `Table` ( `One`, `Two` ) VALUES ( 5, 'hello' )";
2626 query =
"INSERT INTO `Table` ( `One`, `Two` ) VALUES ( ?, '?' )";
2637 query =
"INSERT INTO `Table` ( `?`, `?` ) VALUES ( ?, '?' )";
2646 query =
"INSERT INTO `Table` ( `?`, `?` ) VALUES ( 3, 'yellow' )";
2654 query =
"INSERT INTO `?` ( `One`, `Two` ) VALUES ( 2, 'green' )";
2664 query =
"INSERT INTO `?` ( `One`, `Two` ) VALUES ( ?, '?' )";
2676 query =
"INSERT INTO `?` ( `?`, `?` ) VALUES ( ?, '?' )";
2685 query =
"INSERT INTO `Table` ( `One`, `Two` ) VALUES ( ?, '?' )";
2694 query =
"INSERT INTO `Table` ( `One`, `Two` ) VALUES ( ?, ? )";
2703#define MY_NVIEWS 4000
2713 ok( hdb,
"failed to create db\n");
2715 memset(hviews, 0,
sizeof(hviews));
2718 static char szQueryBuf[256] =
"SELECT * from `_Tables`";
2719 hviews[
i] = 0xdeadbeeb;
2722 hviews[
i] == 0 || (
i && (hviews[
i] == hviews[
i-1])))
2729 if (hviews[
i] != 0 && hviews[
i] != 0xdeadbeeb) {
2767 query =
"CREATE TABLE `AAR` ( `BAR` SHORT NOT NULL, `CAR` CHAR(255) PRIMARY KEY `CAR`)";
2771 query =
"INSERT INTO `AAR` ( `BAR`, `CAR` ) VALUES ( 1, 'vw' )";
2775 query =
"INSERT INTO `AAR` ( `BAR`, `CAR` ) VALUES ( 2, 'bmw' )";
2779 query =
"UPDATE `MOO` SET `OOO` = 'c' WHERE `NOO` = 1";
2783 query =
"DELETE FROM `MOO` WHERE `NOO` = 3";
2795 query =
"INSERT INTO `BINARY` ( `ID`, `BLOB` ) VALUES ( ?, ? )";
2801 query =
"ALTER TABLE `MOO` ADD `COW` INTEGER";
2805 query =
"ALTER TABLE `MOO` ADD `PIG` INTEGER";
2809 query =
"UPDATE `MOO` SET `PIG` = 5 WHERE `NOO` = 1";
2813 query =
"CREATE TABLE `Property` ( `Property` CHAR(72) NOT NULL, "
2814 "`Value` CHAR(0) PRIMARY KEY `Property`)";
2818 query =
"INSERT INTO `Property` ( `Property`, `Value` ) VALUES ( 'prop', 'val' )";
2838static const WCHAR name2[] = { 0x4840, 0x3b3f, 0x43f2, 0x4438, 0x45b1, 0 };
2839static const WCHAR name3[] = { 0x4840, 0x3f7f, 0x4164, 0x422f, 0x4836, 0 };
2840static const WCHAR name4[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3b6a, 0x45e4, 0x4824, 0 };
2841static const WCHAR name5[] = { 0x4840, 0x3f3f, 0x4577, 0x446c, 0x3e6a, 0x44b2, 0x482f, 0 };
2843static const WCHAR name7[] = { 0x4840, 0x3c8b, 0x3a97, 0x409b, 0 };
2844static const WCHAR name8[] = { 0x3c8b, 0x3a97, 0x409b, 0x387e, 0 };
2845static const WCHAR name9[] = { 0x4840, 0x4559, 0x44f2, 0x4568, 0x4737, 0 };
2849 0x0201, 0x0008, 0x8001,
2850 0x0201, 0x0009, 0x8002,
2853 0x0401, 0x0001, 0x8003, 0x0002, 0x9502,
2854 0x0401, 0x0001, 0x8004, 0x0003, 0x9502,
2855 0x0401, 0x0005, 0x0000, 0x0006, 0xbdff,
2856 0x0401, 0x0005, 0x0000, 0x0007, 0x8502,
2857 0x0401, 0x000a, 0x0000, 0x000a, 0xad48,
2858 0x0401, 0x000a, 0x0000, 0x000b, 0x9d00,
2865 "MOOCOWPIGcAARCARBARvwbmwPropertyValuepropval";
2885 0x000a, 0x8001, 0x0004, 0x8005,
2890 0x0201, 0x8001, 0x0001,
2897 0x0201, 0x000c, 0x000d,
2900static const struct {
2926 const CLSID CLSID_MsiTransform = { 0xc1082,0,0,{0xc0,0,0,0,0,0,0,0x46}};
2931 ok(
r ==
S_OK,
"failed to create storage\n");
2935 r = IStorage_SetClass( stg, &CLSID_MsiTransform );
2936 ok(
r ==
S_OK,
"failed to set storage type\n");
2944 ok(0,
"failed to create stream %#lx\n",
r);
2951 ok(0,
"failed to write stream\n");
2952 IStream_Release(stm);
2955 IStorage_Release(stg);
2968 "Installation Database");
2972 "Installation Database");
2984 "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}");
3032 sprintf(szPackage,
"#%lu", hdb);
3050 static const struct {
3057 {
"MOO",
"OOO",
"1",
"c",
"a" },
3058 {
"MOO",
"COW",
"",
"5378",
"3" },
3059 {
"MOO",
"PIG",
"",
"5378",
"4" },
3060 {
"MOO",
"PIG",
"1",
"5",
"" },
3061 {
"MOO",
"DELETE",
"3",
"",
"" },
3062 {
"BINARY",
"BLOB",
"1",
"BINARY.1",
"" },
3063 {
"BINARY",
"INSERT",
"1",
"",
"" },
3064 {
"AAR",
"CREATE",
"",
"",
"" },
3065 {
"AAR",
"CAR",
"",
"15871",
"1" },
3066 {
"AAR",
"BAR",
"",
"1282",
"2" },
3067 {
"AAR",
"BAR",
"vw",
"1",
"" },
3068 {
"AAR",
"BAR",
"bmw",
"2",
"" },
3069 {
"AAR",
"INSERT",
"vw",
"",
"" },
3070 {
"AAR",
"INSERT",
"bmw",
"",
"" },
3071 {
"Property",
"CREATE",
"",
"",
"" },
3072 {
"Property",
"Property",
"",
"11592",
"1" },
3073 {
"Property",
"Value",
"",
"7424",
"2" },
3074 {
"Property",
"Value",
"prop",
"val",
"" },
3075 {
"Property",
"INSERT",
"prop",
"",
"" }
3090 ok(hdb,
"Failed to create package db\n");
3092 query =
"CREATE TABLE `MOO` ( `NOO` SHORT NOT NULL, `OOO` CHAR(255) PRIMARY KEY `NOO`)";
3096 query =
"INSERT INTO `MOO` ( `NOO`, `OOO` ) VALUES ( 1, 'a' )";
3100 query =
"INSERT INTO `MOO` ( `NOO`, `OOO` ) VALUES ( 2, 'b' )";
3104 query =
"INSERT INTO `MOO` ( `NOO`, `OOO` ) VALUES ( 3, 'c' )";
3108 query =
"CREATE TABLE `BINARY` ( `ID` SHORT NOT NULL, `BLOB` OBJECT PRIMARY KEY `ID`)";
3120 query =
"INSERT INTO `BINARY` ( `ID`, `BLOB` ) VALUES ( ?, ? )";
3148 query =
"select * from `_TransformView`";
3156 check_record(hrec, 5,
"Table",
"Column",
"Row",
"Data",
"Current");
3169 for (
i = 1;
i <= 5;
i++) {
3198 query =
"ALTER TABLE `_TransformView` FREE";
3212 query =
"select `BAR`,`CAR` from `AAR` where `BAR` = 1 AND `CAR` = 'vw'";
3217 query =
"select `BAR`,`CAR` from `AAR` where `BAR` = 2 AND `CAR` = 'bmw'";
3225 query =
"select `NOO`,`OOO` from `MOO` where `NOO` = 1 AND `OOO` = 'c'";
3232 query =
"select `NOO`,`OOO` from `MOO` where `NOO` = 2 AND `OOO` = 'b'";
3239 query =
"select * from `MOO` where `NOO` = 3";
3246 query =
"select `BLOB` from `BINARY` where `ID` = 1";
3255 ok(sz == 9,
"stream data was wrong size\n");
3260 query =
"select * from `MOO`";
3288 skip(
"Not enough rights to perform tests\n");
3308 {
"alveolar",
"procerus" },
3309 {
"septum",
"procerus" },
3310 {
"septum",
"nasalis" },
3311 {
"ramus",
"nasalis" },
3312 {
"malar",
"mentalis" },
3317 {
"nasal",
"septum" },
3318 {
"mandible",
"ramus" },
3323 {
"msvcp.dll",
"abcdefgh" },
3324 {
"msvcr.dll",
"ijklmnop" },
3329 {
"msvcp.dll.01234",
"single.dll.31415" },
3334 {
"malar",
"procerus" },
3339 {
"malar",
"procerus" },
3340 {
"malar",
"procerus" },
3341 {
"malar",
"nasalis" },
3342 {
"malar",
"nasalis" },
3343 {
"malar",
"nasalis" },
3344 {
"malar",
"mentalis" },
3349 {
"malar",
"nasalis" },
3350 {
"malar",
"nasalis" },
3351 {
"malar",
"nasalis" },
3356 {
"msvcp.dll",
"msvcp.dll.01234",
"msvcp.dll.01234",
"abcdefgh" },
3357 {
"msvcr.dll",
"msvcr.dll.56789",
"msvcp.dll.01234",
"abcdefgh" },
3358 {
"msvcp.dll",
"msvcp.dll.01234",
"msvcr.dll.56789",
"ijklmnop" },
3359 {
"msvcr.dll",
"msvcr.dll.56789",
"msvcr.dll.56789",
"ijklmnop" },
3360 {
"msvcp.dll",
"msvcp.dll.01234",
"single.dll.31415",
"msvcp.dll" },
3361 {
"msvcr.dll",
"msvcr.dll.56789",
"single.dll.31415",
"msvcp.dll" },
3366 {
"1",
"2",
"3",
"4",
"7",
"8" },
3367 {
"1",
"2",
"5",
"6",
"7",
"8" },
3368 {
"1",
"2",
"3",
"4",
"9",
"10" },
3369 {
"1",
"2",
"5",
"6",
"9",
"10" },
3370 {
"1",
"2",
"3",
"4",
"11",
"12" },
3371 {
"1",
"2",
"5",
"6",
"11",
"12" },
3382 ok( hdb,
"failed to create db\n");