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
a302f03c
Commit
a302f03c
authored
Sep 07, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Sep 08, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Allow non-key columns to be used with the join query.
parent
d8c13370
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
24 deletions
+45
-24
join.c
dlls/msi/join.c
+1
-16
db.c
dlls/msi/tests/db.c
+44
-8
No files found.
dlls/msi/join.c
View file @
a302f03c
...
...
@@ -364,7 +364,7 @@ static const MSIVIEWOPS join_ops =
*/
static
UINT
join_check_condition
(
MSIJOINVIEW
*
jv
,
struct
expr
*
cond
)
{
UINT
r
,
type
=
0
;
UINT
r
;
/* assume that we have `KeyColumn` = `SubkeyColumn` */
if
(
cond
->
type
!=
EXPR_COMPLEX
)
...
...
@@ -388,21 +388,6 @@ static UINT join_check_condition(MSIJOINVIEW *jv, struct expr *cond)
if
(
r
!=
ERROR_SUCCESS
)
return
ERROR_FUNCTION_FAILED
;
/* make sure both columns are keys */
r
=
jv
->
left
->
ops
->
get_column_info
(
jv
->
left
,
jv
->
left_key
,
NULL
,
&
type
);
if
(
r
!=
ERROR_SUCCESS
)
return
ERROR_FUNCTION_FAILED
;
if
(
!
(
type
&
MSITYPE_KEY
))
return
ERROR_FUNCTION_FAILED
;
r
=
jv
->
right
->
ops
->
get_column_info
(
jv
->
right
,
jv
->
right_key
,
NULL
,
&
type
);
if
(
r
!=
ERROR_SUCCESS
)
return
ERROR_FUNCTION_FAILED
;
if
(
!
(
type
&
MSITYPE_KEY
))
return
ERROR_FUNCTION_FAILED
;
TRACE
(
"left %s (%u) right %s (%u)
\n
"
,
debugstr_w
(
cond
->
u
.
expr
.
left
->
u
.
column
),
jv
->
left_key
,
debugstr_w
(
cond
->
u
.
expr
.
right
->
u
.
column
),
jv
->
right_key
);
...
...
dlls/msi/tests/db.c
View file @
a302f03c
...
...
@@ -1676,6 +1676,11 @@ static const struct join_res join_res_third[] =
{
"msvcr.dll"
,
"ijklmnop"
},
};
static
const
struct
join_res
join_res_fourth
[]
=
{
{
"msvcp.dll.01234"
,
"single.dll.31415"
},
};
static
void
test_join
(
void
)
{
MSIHANDLE
hdb
,
hview
,
hrec
;
...
...
@@ -1741,6 +1746,9 @@ static void test_join(void)
r
=
add_binary_entry
(
hdb
,
"'msvcr.dll.56789', 'ijklmnop'"
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot add binary: %d
\n
"
,
r
);
r
=
add_binary_entry
(
hdb
,
"'single.dll.31415', 'msvcp.dll'"
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot add binary: %d
\n
"
,
r
);
query
=
"SELECT `Component`.`ComponentId`, `FeatureComponents`.`Feature_` "
"FROM `Component`, `FeatureComponents` "
"WHERE `Component`.`Component` = `FeatureComponents`.`Component_` "
...
...
@@ -1834,16 +1842,10 @@ static void test_join(void)
"WHERE `StdDlls`.`Binary_` = `Binary`.`Name` "
"ORDER BY `File`"
;
r
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
hview
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"failed to open view: %d
\n
"
,
r
);
}
r
=
MsiViewExecute
(
hview
,
0
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"failed to execute view: %d
\n
"
,
r
);
}
i
=
0
;
while
((
r
=
MsiViewFetch
(
hview
,
&
hrec
))
==
ERROR_SUCCESS
)
...
...
@@ -1867,11 +1869,45 @@ static void test_join(void)
MsiCloseHandle
(
hrec
);
}
todo_wine
{
ok
(
r
==
ERROR_NO_MORE_ITEMS
,
"expected no more items: %d
\n
"
,
r
);
MsiViewClose
(
hview
);
MsiCloseHandle
(
hview
);
query
=
"SELECT `StdDlls`.`Binary_`, `Binary`.`Name` "
"FROM `StdDlls`, `Binary` "
"WHERE `StdDlls`.`File` = `Binary`.`Data` "
"ORDER BY `Name`"
;
r
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to open view: %d
\n
"
,
r
);
r
=
MsiViewExecute
(
hview
,
0
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to execute view: %d
\n
"
,
r
);
i
=
0
;
while
((
r
=
MsiViewFetch
(
hview
,
&
hrec
))
==
ERROR_SUCCESS
)
{
count
=
MsiRecordGetFieldCount
(
hrec
);
ok
(
count
==
2
,
"Expected 2 record fields, got %d
\n
"
,
count
);
size
=
MAX_PATH
;
r
=
MsiRecordGetString
(
hrec
,
1
,
buf
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to get record string: %d
\n
"
,
r
);
ok
(
!
lstrcmp
(
buf
,
join_res_fourth
[
i
].
one
),
"Expected '%s', got %s
\n
"
,
join_res_fourth
[
i
].
one
,
buf
);
size
=
MAX_PATH
;
r
=
MsiRecordGetString
(
hrec
,
2
,
buf
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to get record string: %d
\n
"
,
r
);
ok
(
!
lstrcmp
(
buf
,
join_res_fourth
[
i
].
two
),
"Expected '%s', got %s
\n
"
,
join_res_fourth
[
i
].
two
,
buf
);
i
++
;
MsiCloseHandle
(
hrec
);
}
ok
(
r
==
ERROR_NO_MORE_ITEMS
,
"expected no more items: %d
\n
"
,
r
);
MsiViewClose
(
hview
);
MsiCloseHandle
(
hview
);
MsiCloseHandle
(
hdb
);
...
...
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