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
5699936c
Commit
5699936c
authored
Aug 31, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Sep 07, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Make sure there's a value for each column when inserting data.
parent
533833b4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
insert.c
dlls/msi/insert.c
+13
-1
db.c
dlls/msi/tests/db.c
+0
-5
No files found.
dlls/msi/insert.c
View file @
5699936c
...
...
@@ -234,6 +234,14 @@ static const MSIVIEWOPS insert_ops =
INSERT_find_matching_rows
};
static
UINT
count_column_info
(
column_info
*
ci
)
{
UINT
n
=
0
;
for
(
;
ci
;
ci
=
ci
->
next
)
n
++
;
return
n
;
}
UINT
INSERT_CreateView
(
MSIDATABASE
*
db
,
MSIVIEW
**
view
,
LPWSTR
table
,
column_info
*
columns
,
column_info
*
values
,
BOOL
temp
)
{
...
...
@@ -243,6 +251,10 @@ UINT INSERT_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR table,
TRACE
(
"%p
\n
"
,
iv
);
/* there should be one value for each column */
if
(
count_column_info
(
columns
)
!=
count_column_info
(
values
)
)
return
ERROR_BAD_QUERY_SYNTAX
;
r
=
TABLE_CreateView
(
db
,
table
,
&
tv
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
...
...
@@ -254,7 +266,7 @@ UINT INSERT_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR table,
tv
->
ops
->
delete
(
tv
);
return
r
;
}
iv
=
msi_alloc_zero
(
sizeof
*
iv
);
if
(
!
iv
)
return
ERROR_FUNCTION_FAILED
;
...
...
dlls/msi/tests/db.c
View file @
5699936c
...
...
@@ -162,17 +162,12 @@ static void test_msiinsert(void)
r
=
do_query
(
hdb
,
query
,
&
hrec
);
ok
(
r
==
ERROR_NO_MORE_ITEMS
,
"MsiViewFetch failed
\n
"
);
todo_wine
{
/* now try a few bad INSERT xqueries */
query
=
"INSERT INTO `phone` ( `id`, `name`, `number` )"
"VALUES(?, ?)"
;
r
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
hview
);
ok
(
r
==
ERROR_BAD_QUERY_SYNTAX
,
"MsiDatabaseOpenView failed
\n
"
);
if
(
r
==
ERROR_SUCCESS
)
r
=
MsiCloseHandle
(
hview
);
}
/* construct a record to insert */
hrec
=
MsiCreateRecord
(
4
);
r
=
MsiRecordSetInteger
(
hrec
,
1
,
2
);
...
...
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