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
4a32845a
Commit
4a32845a
authored
Oct 26, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Oct 26, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Fixed the UPDATE query to work with explicit values.
parent
575cc67d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
28 deletions
+23
-28
insert.c
dlls/msi/insert.c
+3
-3
query.h
dlls/msi/query.h
+2
-0
db.c
dlls/msi/tests/db.c
+0
-18
update.c
dlls/msi/update.c
+18
-7
No files found.
dlls/msi/insert.c
View file @
4a32845a
...
@@ -57,12 +57,12 @@ static UINT INSERT_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT
...
@@ -57,12 +57,12 @@ static UINT INSERT_fetch_int( struct tagMSIVIEW *view, UINT row, UINT col, UINT
}
}
/*
/*
*
INSERT
_merge_record
*
msi_query
_merge_record
*
*
* Merge a value_list and a record to create a second record.
* Merge a value_list and a record to create a second record.
* Replace wildcard entries in the valuelist with values from the record
* Replace wildcard entries in the valuelist with values from the record
*/
*/
static
MSIRECORD
*
INSERT
_merge_record
(
UINT
fields
,
column_info
*
vl
,
MSIRECORD
*
rec
)
MSIRECORD
*
msi_query
_merge_record
(
UINT
fields
,
column_info
*
vl
,
MSIRECORD
*
rec
)
{
{
MSIRECORD
*
merged
;
MSIRECORD
*
merged
;
DWORD
wildcard_count
=
1
,
i
;
DWORD
wildcard_count
=
1
,
i
;
...
@@ -128,7 +128,7 @@ static UINT INSERT_execute( struct tagMSIVIEW *view, MSIRECORD *record )
...
@@ -128,7 +128,7 @@ static UINT INSERT_execute( struct tagMSIVIEW *view, MSIRECORD *record )
* Merge the wildcard values into the list of values provided
* Merge the wildcard values into the list of values provided
* in the query, and create a record containing both.
* in the query, and create a record containing both.
*/
*/
values
=
INSERT
_merge_record
(
col_count
,
iv
->
vals
,
record
);
values
=
msi_query
_merge_record
(
col_count
,
iv
->
vals
,
record
);
if
(
!
values
)
if
(
!
values
)
goto
err
;
goto
err
;
...
...
dlls/msi/query.h
View file @
4a32845a
...
@@ -125,4 +125,6 @@ UINT ALTER_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR name, int hold )
...
@@ -125,4 +125,6 @@ UINT ALTER_CreateView( MSIDATABASE *db, MSIVIEW **view, LPCWSTR name, int hold )
int
sqliteGetToken
(
const
WCHAR
*
z
,
int
*
tokenType
);
int
sqliteGetToken
(
const
WCHAR
*
z
,
int
*
tokenType
);
MSIRECORD
*
msi_query_merge_record
(
UINT
fields
,
column_info
*
vl
,
MSIRECORD
*
rec
);
#endif
/* __WINE_MSI_QUERY_H */
#endif
/* __WINE_MSI_QUERY_H */
dlls/msi/tests/db.c
View file @
4a32845a
...
@@ -3003,13 +3003,10 @@ static void test_update(void)
...
@@ -3003,13 +3003,10 @@ static void test_update(void)
query
=
"UPDATE `Control` SET `Text` = 'this is text' WHERE `Dialog_` = 'ErrorDialog'"
;
query
=
"UPDATE `Control` SET `Text` = 'this is text' WHERE `Dialog_` = 'ErrorDialog'"
;
r
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
view
);
r
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
view
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
r
=
MsiViewExecute
(
view
,
0
);
r
=
MsiViewExecute
(
view
,
0
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
r
=
MsiViewClose
(
view
);
r
=
MsiViewClose
(
view
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewClose failed
\n
"
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewClose failed
\n
"
);
}
r
=
MsiCloseHandle
(
view
);
r
=
MsiCloseHandle
(
view
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiCloseHandle failed
\n
"
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiCloseHandle failed
\n
"
);
...
@@ -3026,10 +3023,7 @@ static void test_update(void)
...
@@ -3026,10 +3023,7 @@ static void test_update(void)
size
=
MAX_PATH
;
size
=
MAX_PATH
;
r
=
MsiRecordGetString
(
rec
,
1
,
result
,
&
size
);
r
=
MsiRecordGetString
(
rec
,
1
,
result
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
!
lstrcmp
(
result
,
"this is text"
),
"Expected `this is text`, got %s
\n
"
,
result
);
ok
(
!
lstrcmp
(
result
,
"this is text"
),
"Expected `this is text`, got %s
\n
"
,
result
);
}
MsiCloseHandle
(
rec
);
MsiCloseHandle
(
rec
);
...
@@ -3055,13 +3049,10 @@ static void test_update(void)
...
@@ -3055,13 +3049,10 @@ static void test_update(void)
query
=
"UPDATE `Control` SET `Text` = 'this is text' WHERE `Dialog_` = 'ErrorDialog' AND `Control` = 'ErrorText'"
;
query
=
"UPDATE `Control` SET `Text` = 'this is text' WHERE `Dialog_` = 'ErrorDialog' AND `Control` = 'ErrorText'"
;
r
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
view
);
r
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
view
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCESS, got %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCESS, got %d
\n
"
,
r
);
todo_wine
{
r
=
MsiViewExecute
(
view
,
0
);
r
=
MsiViewExecute
(
view
,
0
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
r
=
MsiViewClose
(
view
);
r
=
MsiViewClose
(
view
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewClose failed
\n
"
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewClose failed
\n
"
);
}
r
=
MsiCloseHandle
(
view
);
r
=
MsiCloseHandle
(
view
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiCloseHandle failed
\n
"
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiCloseHandle failed
\n
"
);
...
@@ -3078,10 +3069,7 @@ static void test_update(void)
...
@@ -3078,10 +3069,7 @@ static void test_update(void)
size
=
MAX_PATH
;
size
=
MAX_PATH
;
r
=
MsiRecordGetString
(
rec
,
1
,
result
,
&
size
);
r
=
MsiRecordGetString
(
rec
,
1
,
result
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
!
lstrcmp
(
result
,
"this is text"
),
"Expected `this is text`, got %s
\n
"
,
result
);
ok
(
!
lstrcmp
(
result
,
"this is text"
),
"Expected `this is text`, got %s
\n
"
,
result
);
}
MsiCloseHandle
(
rec
);
MsiCloseHandle
(
rec
);
...
@@ -3130,10 +3118,7 @@ static void test_update(void)
...
@@ -3130,10 +3118,7 @@ static void test_update(void)
size
=
MAX_PATH
;
size
=
MAX_PATH
;
r
=
MsiRecordGetString
(
rec
,
1
,
result
,
&
size
);
r
=
MsiRecordGetString
(
rec
,
1
,
result
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
!
lstrcmp
(
result
,
"this is text"
),
"Expected `this is text`, got %s
\n
"
,
result
);
ok
(
!
lstrcmp
(
result
,
"this is text"
),
"Expected `this is text`, got %s
\n
"
,
result
);
}
MsiCloseHandle
(
rec
);
MsiCloseHandle
(
rec
);
...
@@ -3143,10 +3128,7 @@ static void test_update(void)
...
@@ -3143,10 +3128,7 @@ static void test_update(void)
size
=
MAX_PATH
;
size
=
MAX_PATH
;
r
=
MsiRecordGetString
(
rec
,
1
,
result
,
&
size
);
r
=
MsiRecordGetString
(
rec
,
1
,
result
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
!
lstrcmp
(
result
,
"this is text"
),
"Expected `this is text`, got %s
\n
"
,
result
);
ok
(
!
lstrcmp
(
result
,
"this is text"
),
"Expected `this is text`, got %s
\n
"
,
result
);
}
MsiCloseHandle
(
rec
);
MsiCloseHandle
(
rec
);
...
...
dlls/msi/update.c
View file @
4a32845a
...
@@ -59,13 +59,11 @@ static UINT UPDATE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
...
@@ -59,13 +59,11 @@ static UINT UPDATE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
{
{
MSIUPDATEVIEW
*
uv
=
(
MSIUPDATEVIEW
*
)
view
;
MSIUPDATEVIEW
*
uv
=
(
MSIUPDATEVIEW
*
)
view
;
UINT
n
,
type
,
val
,
r
,
row
,
col_count
=
0
,
row_count
=
0
;
UINT
n
,
type
,
val
,
r
,
row
,
col_count
=
0
,
row_count
=
0
;
MSIRECORD
*
values
=
NULL
;
MSIVIEW
*
wv
;
MSIVIEW
*
wv
;
TRACE
(
"%p %p
\n
"
,
uv
,
record
);
TRACE
(
"%p %p
\n
"
,
uv
,
record
);
if
(
!
record
)
return
ERROR_FUNCTION_FAILED
;
wv
=
uv
->
wv
;
wv
=
uv
->
wv
;
if
(
!
wv
)
if
(
!
wv
)
return
ERROR_FUNCTION_FAILED
;
return
ERROR_FUNCTION_FAILED
;
...
@@ -79,6 +77,10 @@ static UINT UPDATE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
...
@@ -79,6 +77,10 @@ static UINT UPDATE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
if
(
r
)
if
(
r
)
goto
err
;
goto
err
;
values
=
msi_query_merge_record
(
col_count
,
uv
->
vals
,
record
);
if
(
!
values
)
return
ERROR_FUNCTION_FAILED
;
for
(
row
=
0
;
row
<
row_count
;
row
++
)
for
(
row
=
0
;
row
<
row_count
;
row
++
)
{
{
for
(
n
=
1
;
n
<=
col_count
;
n
++
)
for
(
n
=
1
;
n
<=
col_count
;
n
++
)
...
@@ -87,15 +89,22 @@ static UINT UPDATE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
...
@@ -87,15 +89,22 @@ static UINT UPDATE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
if
(
r
)
if
(
r
)
break
;
break
;
if
(
type
&
MSITYPE_STRING
)
if
(
MSI_RecordIsNull
(
values
,
n
))
val
=
0
;
else
if
(
type
&
MSITYPE_STRING
)
{
{
const
WCHAR
*
str
=
MSI_RecordGetString
(
record
,
n
);
const
WCHAR
*
str
=
MSI_RecordGetString
(
values
,
n
);
val
=
msi_addstringW
(
uv
->
db
->
strings
,
0
,
str
,
-
1
,
1
);
val
=
msi_addstringW
(
uv
->
db
->
strings
,
0
,
str
,
-
1
,
1
);
}
}
else
if
((
type
&
0xff
)
==
2
)
{
val
=
MSI_RecordGetInteger
(
values
,
n
);
val
^=
0x8000
;
}
else
else
{
{
val
=
MSI_RecordGetInteger
(
record
,
n
);
val
=
MSI_RecordGetInteger
(
values
,
n
);
val
|=
0x8
000
;
val
^=
0x80000
000
;
}
}
r
=
wv
->
ops
->
set_int
(
wv
,
row
,
n
,
val
);
r
=
wv
->
ops
->
set_int
(
wv
,
row
,
n
,
val
);
if
(
r
)
if
(
r
)
...
@@ -103,6 +112,8 @@ static UINT UPDATE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
...
@@ -103,6 +112,8 @@ static UINT UPDATE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
}
}
}
}
msiobj_release
(
&
values
->
hdr
);
err:
err:
return
ERROR_SUCCESS
;
return
ERROR_SUCCESS
;
}
}
...
...
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