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
9309f4df
Commit
9309f4df
authored
Jun 18, 2007
by
James Hawkins
Committed by
Alexandre Julliard
Jun 19, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Properly delete rows from the table, instead of zeroing out the row.
parent
82f4e398
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
98 additions
and
15 deletions
+98
-15
alter.c
dlls/msi/alter.c
+1
-0
create.c
dlls/msi/create.c
+1
-0
delete.c
dlls/msi/delete.c
+1
-0
distinct.c
dlls/msi/distinct.c
+1
-0
insert.c
dlls/msi/insert.c
+1
-0
join.c
dlls/msi/join.c
+1
-0
msipriv.h
dlls/msi/msipriv.h
+5
-0
order.c
dlls/msi/order.c
+1
-0
select.c
dlls/msi/select.c
+1
-0
streams.c
dlls/msi/streams.c
+7
-0
table.c
dlls/msi/table.c
+31
-10
db.c
dlls/msi/tests/db.c
+45
-5
update.c
dlls/msi/update.c
+1
-0
where.c
dlls/msi/where.c
+1
-0
No files found.
dlls/msi/alter.c
View file @
9309f4df
...
...
@@ -130,6 +130,7 @@ static const MSIVIEWOPS alter_ops =
ALTER_fetch_stream
,
NULL
,
NULL
,
NULL
,
ALTER_execute
,
ALTER_close
,
ALTER_get_dimensions
,
...
...
dlls/msi/create.c
View file @
9309f4df
...
...
@@ -124,6 +124,7 @@ static const MSIVIEWOPS create_ops =
NULL
,
NULL
,
NULL
,
NULL
,
CREATE_execute
,
CREATE_close
,
CREATE_get_dimensions
,
...
...
dlls/msi/delete.c
View file @
9309f4df
...
...
@@ -185,6 +185,7 @@ static const MSIVIEWOPS delete_ops =
DELETE_fetch_stream
,
NULL
,
NULL
,
NULL
,
DELETE_execute
,
DELETE_close
,
DELETE_get_dimensions
,
...
...
dlls/msi/distinct.c
View file @
9309f4df
...
...
@@ -274,6 +274,7 @@ static const MSIVIEWOPS distinct_ops =
NULL
,
NULL
,
NULL
,
NULL
,
DISTINCT_execute
,
DISTINCT_close
,
DISTINCT_get_dimensions
,
...
...
dlls/msi/insert.c
View file @
9309f4df
...
...
@@ -225,6 +225,7 @@ static const MSIVIEWOPS insert_ops =
NULL
,
NULL
,
NULL
,
NULL
,
INSERT_execute
,
INSERT_close
,
INSERT_get_dimensions
,
...
...
dlls/msi/join.c
View file @
9309f4df
...
...
@@ -245,6 +245,7 @@ static const MSIVIEWOPS join_ops =
JOIN_fetch_stream
,
NULL
,
NULL
,
NULL
,
JOIN_execute
,
JOIN_close
,
JOIN_get_dimensions
,
...
...
dlls/msi/msipriv.h
View file @
9309f4df
...
...
@@ -149,6 +149,11 @@ typedef struct tagMSIVIEWOPS
UINT
(
*
insert_row
)(
struct
tagMSIVIEW
*
view
,
MSIRECORD
*
record
,
BOOL
temporary
);
/*
* Deletes a row from the database
*/
UINT
(
*
delete_row
)(
struct
tagMSIVIEW
*
view
,
UINT
row
);
/*
* execute - loads the underlying data into memory so it can be read
*/
UINT
(
*
execute
)(
struct
tagMSIVIEW
*
view
,
MSIRECORD
*
record
);
...
...
dlls/msi/order.c
View file @
9309f4df
...
...
@@ -274,6 +274,7 @@ static const MSIVIEWOPS order_ops =
NULL
,
NULL
,
NULL
,
NULL
,
ORDER_execute
,
ORDER_close
,
ORDER_get_dimensions
,
...
...
dlls/msi/select.c
View file @
9309f4df
...
...
@@ -267,6 +267,7 @@ static const MSIVIEWOPS select_ops =
SELECT_fetch_stream
,
SELECT_set_row
,
SELECT_insert_row
,
NULL
,
SELECT_execute
,
SELECT_close
,
SELECT_get_dimensions
,
...
...
dlls/msi/streams.c
View file @
9309f4df
...
...
@@ -204,6 +204,12 @@ done:
return
r
;
}
static
UINT
STREAMS_delete_row
(
struct
tagMSIVIEW
*
view
,
UINT
row
)
{
FIXME
(
"(%p %d): stub!
\n
"
,
view
,
row
);
return
ERROR_SUCCESS
;
}
static
UINT
STREAMS_execute
(
struct
tagMSIVIEW
*
view
,
MSIRECORD
*
record
)
{
TRACE
(
"(%p, %p)
\n
"
,
view
,
record
);
...
...
@@ -323,6 +329,7 @@ static const MSIVIEWOPS streams_ops =
STREAMS_fetch_stream
,
STREAMS_set_row
,
STREAMS_insert_row
,
STREAMS_delete_row
,
STREAMS_execute
,
STREAMS_close
,
STREAMS_get_dimensions
,
...
...
dlls/msi/table.c
View file @
9309f4df
...
...
@@ -1476,6 +1476,35 @@ static UINT TABLE_insert_row( struct tagMSIVIEW *view, MSIRECORD *rec, BOOL temp
return
TABLE_set_row
(
view
,
row
,
rec
,
(
1
<<
tv
->
num_cols
)
-
1
);
}
static
UINT
TABLE_delete_row
(
struct
tagMSIVIEW
*
view
,
UINT
row
)
{
MSITABLEVIEW
*
tv
=
(
MSITABLEVIEW
*
)
view
;
UINT
r
,
num_rows
,
num_cols
;
BYTE
*
src
,
*
dest
;
TRACE
(
"%p %d
\n
"
,
tv
,
row
);
if
(
!
tv
->
table
)
return
ERROR_INVALID_PARAMETER
;
r
=
TABLE_get_dimensions
(
view
,
&
num_rows
,
&
num_cols
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
if
(
row
>=
num_rows
)
return
ERROR_FUNCTION_FAILED
;
tv
->
table
->
row_count
--
;
if
(
row
==
num_rows
-
1
)
return
ERROR_SUCCESS
;
dest
=
tv
->
table
->
data
[
row
];
src
=
tv
->
table
->
data
[
row
+
1
];
memmove
(
dest
,
src
,
(
num_rows
-
row
-
1
)
*
tv
->
row_size
);
return
ERROR_SUCCESS
;
}
static
UINT
TABLE_modify
(
struct
tagMSIVIEW
*
view
,
MSIMODIFY
eModifyMode
,
MSIRECORD
*
rec
)
{
...
...
@@ -1618,6 +1647,7 @@ static const MSIVIEWOPS table_ops =
TABLE_fetch_stream
,
TABLE_set_row
,
TABLE_insert_row
,
TABLE_delete_row
,
TABLE_execute
,
TABLE_close
,
TABLE_get_dimensions
,
...
...
@@ -1896,15 +1926,6 @@ static UINT msi_table_find_row( MSITABLEVIEW *tv, MSIRECORD *rec, UINT *row )
return
r
;
}
static
UINT
msi_delete_row
(
MSITABLEVIEW
*
tv
,
UINT
row
)
{
UINT
i
;
for
(
i
=
1
;
i
<=
tv
->
num_cols
;
i
++
)
TABLE_set_int
(
tv
,
row
,
i
,
0
);
return
ERROR_SUCCESS
;
}
static
UINT
msi_table_load_transform
(
MSIDATABASE
*
db
,
IStorage
*
stg
,
string_table
*
st
,
LPCWSTR
name
)
{
...
...
@@ -2028,7 +2049,7 @@ static UINT msi_table_load_transform( MSIDATABASE *db, IStorage *stg,
else
{
TRACE
(
"deleting row [%d]:
\n
"
,
row
);
msi_delete_row
(
tv
,
row
);
TABLE_delete_row
(
&
tv
->
view
,
row
);
}
}
if
(
TRACE_ON
(
msidb
)
)
dump_record
(
rec
);
...
...
dlls/msi/tests/db.c
View file @
9309f4df
...
...
@@ -1872,7 +1872,7 @@ static const WCHAR data5[] = { /* _StringPool */
/* update row, 0x0002 is a bitmask of present column data, keys are excluded */
static
const
WCHAR
data6
[]
=
{
/* MOO */
0x0002
,
0x8001
,
0x0001
,
/* update row */
0x0000
,
0x800
3
,
/* delete row */
0x0000
,
0x800
2
,
/* delete row */
};
static
const
WCHAR
data7
[]
=
{
/* BINARY */
...
...
@@ -1943,7 +1943,7 @@ static void generate_transform_manual(void)
static
void
test_try_transform
(
void
)
{
MSIHANDLE
hdb
,
hrec
;
MSIHANDLE
hdb
,
h
view
,
h
rec
;
LPCSTR
query
;
UINT
r
;
DWORD
sz
;
...
...
@@ -2037,14 +2037,14 @@ static void test_try_transform(void)
/* check unchanged value */
hrec
=
0
;
query
=
"select `NOO`,`OOO` from `MOO` where `NOO` =
2 AND `OOO` = 'b
'"
;
query
=
"select `NOO`,`OOO` from `MOO` where `NOO` =
3 AND `OOO` = 'c
'"
;
r
=
do_query
(
hdb
,
query
,
&
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"select query failed
\n
"
);
MsiCloseHandle
(
hrec
);
/* check deleted value */
hrec
=
0
;
query
=
"select * from `MOO` where `NOO` =
3
"
;
query
=
"select * from `MOO` where `NOO` =
2
"
;
r
=
do_query
(
hdb
,
query
,
&
hrec
);
ok
(
r
==
ERROR_NO_MORE_ITEMS
,
"select query failed
\n
"
);
if
(
hrec
)
MsiCloseHandle
(
hrec
);
...
...
@@ -2063,7 +2063,47 @@ static void test_try_transform(void)
ok
(
sz
==
9
,
"stream data was wrong size
\n
"
);
if
(
hrec
)
MsiCloseHandle
(
hrec
);
MsiCloseHandle
(
hdb
);
/* check the validity of the table with a deleted row */
hrec
=
0
;
query
=
"select * from `MOO`"
;
r
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"open view failed
\n
"
);
r
=
MsiViewExecute
(
hview
,
0
);
ok
(
r
==
ERROR_SUCCESS
,
"view execute failed
\n
"
);
r
=
MsiViewFetch
(
hview
,
&
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"view fetch failed
\n
"
);
r
=
MsiRecordGetInteger
(
hrec
,
1
);
ok
(
r
==
1
,
"Expected 1, got %d
\n
"
,
r
);
sz
=
sizeof
buffer
;
r
=
MsiRecordGetString
(
hrec
,
2
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"record get string failed
\n
"
);
ok
(
!
lstrcmpA
(
buffer
,
"c"
),
"Expected c, got %s
\n
"
,
buffer
);
MsiCloseHandle
(
hrec
);
r
=
MsiViewFetch
(
hview
,
&
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"view fetch failed
\n
"
);
r
=
MsiRecordGetInteger
(
hrec
,
1
);
ok
(
r
==
3
,
"Expected 3, got %d
\n
"
,
r
);
sz
=
sizeof
buffer
;
r
=
MsiRecordGetString
(
hrec
,
2
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"record get string failed
\n
"
);
ok
(
!
lstrcmpA
(
buffer
,
"c"
),
"Expected b, got %s
\n
"
,
buffer
);
MsiCloseHandle
(
hrec
);
r
=
MsiViewFetch
(
hview
,
&
hrec
);
ok
(
r
==
ERROR_NO_MORE_ITEMS
,
"view fetch succeeded
\n
"
);
MsiCloseHandle
(
hrec
);
MsiCloseHandle
(
hview
);
MsiCloseHandle
(
hdb
);
DeleteFile
(
msifile
);
DeleteFile
(
msifile2
);
...
...
dlls/msi/update.c
View file @
9309f4df
...
...
@@ -177,6 +177,7 @@ static const MSIVIEWOPS update_ops =
NULL
,
NULL
,
NULL
,
NULL
,
UPDATE_execute
,
UPDATE_close
,
UPDATE_get_dimensions
,
...
...
dlls/msi/where.c
View file @
9309f4df
...
...
@@ -439,6 +439,7 @@ static const MSIVIEWOPS where_ops =
WHERE_fetch_stream
,
WHERE_set_row
,
NULL
,
NULL
,
WHERE_execute
,
WHERE_close
,
WHERE_get_dimensions
,
...
...
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