Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
dc16dd13
Commit
dc16dd13
authored
Sep 09, 2011
by
Bernhard Loos
Committed by
Alexandre Julliard
Sep 12, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: The underlying tables might have changed, so it's not possible to cache the…
msi: The underlying tables might have changed, so it's not possible to cache the result of the execute.
parent
09f134cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
22 deletions
+37
-22
db.c
dlls/msi/tests/db.c
+23
-1
where.c
dlls/msi/where.c
+14
-21
No files found.
dlls/msi/tests/db.c
View file @
dc16dd13
...
...
@@ -297,7 +297,7 @@ make_add_entry(binary,
static
void
test_msiinsert
(
void
)
{
MSIHANDLE
hdb
=
0
,
hview
=
0
,
hrec
=
0
;
MSIHANDLE
hdb
=
0
,
hview
=
0
,
h
view2
=
0
,
h
rec
=
0
;
UINT
r
;
const
char
*
query
;
char
buf
[
80
];
...
...
@@ -322,6 +322,14 @@ static void test_msiinsert(void)
r
=
MsiCloseHandle
(
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiCloseHandle failed
\n
"
);
query
=
"SELECT * FROM phone WHERE number = '8675309'"
;
r
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
hview2
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiDatabaseOpenView failed
\n
"
);
r
=
MsiViewExecute
(
hview2
,
0
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewExecute failed
\n
"
);
r
=
MsiViewFetch
(
hview2
,
&
hrec
);
ok
(
r
==
ERROR_NO_MORE_ITEMS
,
"MsiViewFetch produced items
\n
"
);
/* insert a value into it */
query
=
"INSERT INTO `phone` ( `id`, `name`, `number` )"
"VALUES('1', 'Abe', '8675309')"
;
...
...
@@ -334,6 +342,20 @@ static void test_msiinsert(void)
r
=
MsiCloseHandle
(
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiCloseHandle failed
\n
"
);
r
=
MsiViewFetch
(
hview2
,
&
hrec
);
ok
(
r
==
ERROR_NO_MORE_ITEMS
,
"MsiViewFetch produced items
\n
"
);
r
=
MsiViewExecute
(
hview2
,
0
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewExecute failed
\n
"
);
r
=
MsiViewFetch
(
hview2
,
&
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewFetch failed: %u
\n
"
,
r
);
r
=
MsiCloseHandle
(
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiCloseHandle failed
\n
"
);
r
=
MsiViewClose
(
hview2
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewClose failed
\n
"
);
r
=
MsiCloseHandle
(
hview2
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiCloseHandle failed
\n
"
);
query
=
"SELECT * FROM `phone` WHERE `id` = 1"
;
r
=
do_query
(
hdb
,
query
,
&
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewFetch failed
\n
"
);
...
...
dlls/msi/where.c
View file @
dc16dd13
...
...
@@ -73,27 +73,10 @@ typedef struct tagMSIWHEREVIEW
struct
expr
*
cond
;
UINT
rec_index
;
MSIORDERINFO
*
order_info
;
UINT
error
;
}
MSIWHEREVIEW
;
#define INITIAL_REORDER_SIZE 16
static
UINT
init_reorder
(
MSIWHEREVIEW
*
wv
)
{
MSIROWENTRY
**
new
=
msi_alloc_zero
(
sizeof
(
MSIROWENTRY
*
)
*
INITIAL_REORDER_SIZE
);
if
(
!
new
)
return
ERROR_OUTOFMEMORY
;
if
(
wv
->
reorder
)
msi_free
(
wv
->
reorder
);
wv
->
reorder
=
new
;
wv
->
reorder_size
=
INITIAL_REORDER_SIZE
;
wv
->
row_count
=
0
;
return
ERROR_SUCCESS
;
}
static
void
free_reorder
(
MSIWHEREVIEW
*
wv
)
{
UINT
i
;
...
...
@@ -110,6 +93,20 @@ static void free_reorder(MSIWHEREVIEW *wv)
wv
->
row_count
=
0
;
}
static
UINT
init_reorder
(
MSIWHEREVIEW
*
wv
)
{
MSIROWENTRY
**
new
=
msi_alloc_zero
(
sizeof
(
MSIROWENTRY
*
)
*
INITIAL_REORDER_SIZE
);
if
(
!
new
)
return
ERROR_OUTOFMEMORY
;
free_reorder
(
wv
);
wv
->
reorder
=
new
;
wv
->
reorder_size
=
INITIAL_REORDER_SIZE
;
return
ERROR_SUCCESS
;
}
static
inline
UINT
find_row
(
MSIWHEREVIEW
*
wv
,
UINT
row
,
UINT
*
(
values
[]))
{
if
(
row
>=
wv
->
row_count
)
...
...
@@ -618,9 +615,6 @@ static UINT WHERE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
if
(
!
table
)
return
ERROR_FUNCTION_FAILED
;
if
(
wv
->
reorder
)
return
wv
->
error
;
r
=
init_reorder
(
wv
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
...
...
@@ -654,7 +648,6 @@ static UINT WHERE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
r
=
wv
->
order_info
->
error
;
msi_free
(
rows
);
wv
->
error
=
r
;
return
r
;
}
...
...
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