Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
0169533b
Commit
0169533b
authored
Jul 18, 2007
by
James Hawkins
Committed by
Alexandre Julliard
Jul 19, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add more tests for the ALTER command.
parent
4e205947
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
169 additions
and
1 deletion
+169
-1
db.c
dlls/msi/tests/db.c
+169
-1
No files found.
dlls/msi/tests/db.c
View file @
0169533b
...
@@ -2942,8 +2942,176 @@ static void test_alter(void)
...
@@ -2942,8 +2942,176 @@ static void test_alter(void)
ok
(
r
==
ERROR_BAD_QUERY_SYNTAX
,
"failed to hold table %d
\n
"
,
r
);
ok
(
r
==
ERROR_BAD_QUERY_SYNTAX
,
"failed to hold table %d
\n
"
,
r
);
}
}
MsiCloseHandle
(
hdb
);
/* table T is removed */
query
=
"SELECT * FROM `T`"
;
r
=
run_query
(
hdb
,
0
,
query
);
todo_wine
{
ok
(
r
==
ERROR_BAD_QUERY_SYNTAX
,
"Expected ERROR_BAD_QUERY_SYNTAX, got %d
\n
"
,
r
);
}
/* create the table again */
query
=
"CREATE TABLE `U` ( `A` INTEGER, `B` INTEGER PRIMARY KEY `B`)"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
/* up the ref count */
query
=
"ALTER TABLE `U` HOLD"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to free table
\n
"
);
/* add column, no data type */
query
=
"ALTER TABLE `U` ADD `C`"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_BAD_QUERY_SYNTAX
,
"Expected ERROR_BAD_QUERY_SYNTAX, got %d
\n
"
,
r
);
query
=
"ALTER TABLE `U` ADD `C` INTEGER"
;
r
=
run_query
(
hdb
,
0
,
query
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
}
/* add column C again */
query
=
"ALTER TABLE `U` ADD `C` INTEGER"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_BAD_QUERY_SYNTAX
,
"Expected ERROR_BAD_QUERY_SYNTAX, got %d
\n
"
,
r
);
query
=
"ALTER TABLE `U` ADD `D` INTEGER TEMPORARY"
;
r
=
run_query
(
hdb
,
0
,
query
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
}
query
=
"INSERT INTO `U` ( `A`, `B`, `C`, `D` ) VALUES ( 1, 2, 3, 4 )"
;
r
=
run_query
(
hdb
,
0
,
query
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
}
query
=
"ALTER TABLE `U` ADD `D` INTEGER TEMPORARY HOLD"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_BAD_QUERY_SYNTAX
,
"Expected ERROR_BAD_QUERY_SYNTAX, got %d
\n
"
,
r
);
query
=
"INSERT INTO `U` ( `A`, `B`, `C`, `D` ) VALUES ( 5, 6, 7, 8 )"
;
r
=
run_query
(
hdb
,
0
,
query
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
}
query
=
"SELECT * FROM `U` WHERE `D` = 8"
;
r
=
run_query
(
hdb
,
0
,
query
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
}
query
=
"ALTER TABLE `U` ADD `D` INTEGER TEMPORARY FREE"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_BAD_QUERY_SYNTAX
,
"Expected ERROR_BAD_QUERY_SYNTAX, got %d
\n
"
,
r
);
query
=
"ALTER COLUMN `D` FREE"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_BAD_QUERY_SYNTAX
,
"Expected ERROR_BAD_QUERY_SYNTAX, got %d
\n
"
,
r
);
/* drop the ref count */
query
=
"ALTER TABLE `U` FREE"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
/* table is not empty */
query
=
"SELECT * FROM `U`"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
/* column D is removed */
query
=
"SELECT * FROM `U` WHERE `D` = 8"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_BAD_QUERY_SYNTAX
,
"Expected ERROR_BAD_QUERY_SYNTAX, got %d
\n
"
,
r
);
query
=
"INSERT INTO `U` ( `A`, `B`, `C`, `D` ) VALUES ( 9, 10, 11, 12 )"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_BAD_QUERY_SYNTAX
,
"Expected ERROR_BAD_QUERY_SYNTAX, got %d
\n
"
,
r
);
/* add the column again */
query
=
"ALTER TABLE `U` ADD `E` INTEGER TEMPORARY HOLD"
;
r
=
run_query
(
hdb
,
0
,
query
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
}
/* up the ref count */
query
=
"ALTER TABLE `U` HOLD"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
query
=
"INSERT INTO `U` ( `A`, `B`, `C`, `E` ) VALUES ( 13, 14, 15, 16 )"
;
r
=
run_query
(
hdb
,
0
,
query
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
}
query
=
"SELECT * FROM `U` WHERE `E` = 16"
;
r
=
run_query
(
hdb
,
0
,
query
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
}
/* drop the ref count */
query
=
"ALTER TABLE `U` FREE"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
query
=
"INSERT INTO `U` ( `A`, `B`, `C`, `E` ) VALUES ( 17, 18, 19, 20 )"
;
r
=
run_query
(
hdb
,
0
,
query
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
}
query
=
"SELECT * FROM `U` WHERE `E` = 20"
;
r
=
run_query
(
hdb
,
0
,
query
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
}
/* drop the ref count */
query
=
"ALTER TABLE `U` FREE"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
/* table still exists */
query
=
"SELECT * FROM `U`"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
/* col E is removed */
query
=
"SELECT * FROM `U` WHERE `E` = 20"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_BAD_QUERY_SYNTAX
,
"Expected ERROR_BAD_QUERY_SYNTAX, got %d
\n
"
,
r
);
query
=
"INSERT INTO `U` ( `A`, `B`, `C`, `E` ) VALUES ( 20, 21, 22, 23 )"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_BAD_QUERY_SYNTAX
,
"Expected ERROR_BAD_QUERY_SYNTAX, got %d
\n
"
,
r
);
/* drop the ref count once more */
query
=
"ALTER TABLE `U` FREE"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
/* table still exists */
query
=
"SELECT * FROM `U`"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
MsiCloseHandle
(
hdb
);
DeleteFile
(
msifile
);
DeleteFile
(
msifile
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment