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
599b3083
Commit
599b3083
authored
Mar 10, 2011
by
David Hedberg
Committed by
Alexandre Julliard
Mar 10, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Use ordering information to update the correct row.
parent
648b91a9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
88 additions
and
0 deletions
+88
-0
table.c
dlls/msi/table.c
+3
-0
db.c
dlls/msi/tests/db.c
+85
-0
No files found.
dlls/msi/table.c
View file @
599b3083
...
...
@@ -1776,6 +1776,9 @@ static UINT msi_table_update(struct tagMSIVIEW *view, MSIRECORD *rec, UINT row)
if
(
row
!=
new_row
+
1
)
return
ERROR_FUNCTION_FAILED
;
if
(
tv
->
order
)
new_row
=
tv
->
order
->
reorder
[
new_row
];
return
TABLE_set_row
(
view
,
new_row
,
rec
,
(
1
<<
tv
->
num_cols
)
-
1
);
}
...
...
dlls/msi/tests/db.c
View file @
599b3083
...
...
@@ -5266,6 +5266,7 @@ static void test_select_markers(void)
static
void
test_viewmodify_update
(
void
)
{
MSIHANDLE
hdb
=
0
,
hview
=
0
,
hrec
=
0
;
UINT
i
,
test_max
,
offset
,
count
;
const
char
*
query
;
UINT
r
;
...
...
@@ -5432,6 +5433,90 @@ static void test_viewmodify_update(void)
r
=
MsiCloseHandle
(
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiCloseHandle failed
\n
"
);
query
=
"CREATE TABLE `table2` (`A` INT, `B` INT PRIMARY KEY `A`)"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"query failed
\n
"
);
query
=
"INSERT INTO `table2` (`A`, `B`) VALUES (?, ?)"
;
r
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiDatabaseOpenView failed
\n
"
);
test_max
=
100
;
offset
=
1234
;
for
(
i
=
0
;
i
<
test_max
;
i
++
)
{
hrec
=
MsiCreateRecord
(
2
);
MsiRecordSetInteger
(
hrec
,
1
,
test_max
-
i
);
MsiRecordSetInteger
(
hrec
,
2
,
i
);
r
=
MsiViewExecute
(
hview
,
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"Got %d
\n
"
,
r
);
r
=
MsiCloseHandle
(
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"Got %d
\n
"
,
r
);
}
r
=
MsiViewClose
(
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"Got %d
\n
"
,
r
);
r
=
MsiCloseHandle
(
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"Got %d
\n
"
,
r
);
/* Update. */
query
=
"SELECT * FROM `table2` ORDER BY `B`"
;
r
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiDatabaseOpenView failed
\n
"
);
r
=
MsiViewExecute
(
hview
,
0
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewExecute failed
\n
"
);
count
=
0
;
while
(
MsiViewFetch
(
hview
,
&
hrec
)
==
ERROR_SUCCESS
)
{
UINT
b
=
MsiRecordGetInteger
(
hrec
,
2
);
r
=
MsiRecordSetInteger
(
hrec
,
2
,
b
+
offset
);
ok
(
r
==
ERROR_SUCCESS
,
"Got %d
\n
"
,
r
);
r
=
MsiViewModify
(
hview
,
MSIMODIFY_UPDATE
,
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"Got %d
\n
"
,
r
);
r
=
MsiCloseHandle
(
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to close record
\n
"
);
count
++
;
}
ok
(
count
==
test_max
,
"Got count %d
\n
"
,
count
);
r
=
MsiViewClose
(
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewClose failed
\n
"
);
r
=
MsiCloseHandle
(
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiCloseHandle failed
\n
"
);
/* Recheck. */
query
=
"SELECT * FROM `table2` ORDER BY `B`"
;
r
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiDatabaseOpenView failed
\n
"
);
r
=
MsiViewExecute
(
hview
,
0
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewExecute failed
\n
"
);
count
=
0
;
while
(
MsiViewFetch
(
hview
,
&
hrec
)
==
ERROR_SUCCESS
)
{
UINT
a
=
MsiRecordGetInteger
(
hrec
,
1
);
UINT
b
=
MsiRecordGetInteger
(
hrec
,
2
);
ok
(
(
test_max
-
a
+
offset
)
==
b
,
"Got (%d, %d), expected (%d, %d)
\n
"
,
a
,
b
,
test_max
-
a
+
offset
,
b
);
r
=
MsiCloseHandle
(
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to close record
\n
"
);
count
++
;
}
ok
(
count
==
test_max
,
"Got count %d
\n
"
,
count
);
r
=
MsiViewClose
(
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewClose failed
\n
"
);
r
=
MsiCloseHandle
(
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiCloseHandle failed
\n
"
);
r
=
MsiCloseHandle
(
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiOpenDatabase close failed
\n
"
);
}
...
...
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