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
bed661ae
Commit
bed661ae
authored
Apr 02, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Apr 02, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Handle sorting an empty table.
parent
9cd9023d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
table.c
dlls/msi/table.c
+3
-0
db.c
dlls/msi/tests/db.c
+16
-0
No files found.
dlls/msi/table.c
View file @
bed661ae
...
@@ -2054,6 +2054,9 @@ static UINT TABLE_sort(struct tagMSIVIEW *view, column_info *columns)
...
@@ -2054,6 +2054,9 @@ static UINT TABLE_sort(struct tagMSIVIEW *view, column_info *columns)
if
(
r
!=
ERROR_SUCCESS
)
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
return
r
;
if
(
rows
==
0
)
return
ERROR_SUCCESS
;
order
=
msi_alloc_zero
(
sizeof
(
MSIORDERINFO
)
+
sizeof
(
UINT
)
*
cols
);
order
=
msi_alloc_zero
(
sizeof
(
MSIORDERINFO
)
+
sizeof
(
UINT
)
*
cols
);
if
(
!
order
)
if
(
!
order
)
return
ERROR_OUTOFMEMORY
;
return
ERROR_OUTOFMEMORY
;
...
...
dlls/msi/tests/db.c
View file @
bed661ae
...
@@ -4777,6 +4777,10 @@ static void test_order(void)
...
@@ -4777,6 +4777,10 @@ static void test_order(void)
hdb
=
create_db
();
hdb
=
create_db
();
ok
(
hdb
,
"failed to create db
\n
"
);
ok
(
hdb
,
"failed to create db
\n
"
);
query
=
"CREATE TABLE `Empty` ( `A` SHORT NOT NULL PRIMARY KEY `A`)"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
query
=
"CREATE TABLE `Mesa` ( `A` SHORT NOT NULL, `B` SHORT, `C` SHORT PRIMARY KEY `A`)"
;
query
=
"CREATE TABLE `Mesa` ( `A` SHORT NOT NULL, `B` SHORT, `C` SHORT PRIMARY KEY `A`)"
;
r
=
run_query
(
hdb
,
0
,
query
);
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
...
@@ -4964,6 +4968,18 @@ static void test_order(void)
...
@@ -4964,6 +4968,18 @@ static void test_order(void)
MsiViewClose
(
hview
);
MsiViewClose
(
hview
);
MsiCloseHandle
(
hview
);
MsiCloseHandle
(
hview
);
query
=
"SELECT * FROM `Empty` ORDER BY `A`"
;
r
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
r
=
MsiViewExecute
(
hview
,
0
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
r
=
MsiViewFetch
(
hview
,
&
hrec
);
ok
(
r
==
ERROR_NO_MORE_ITEMS
,
"Expected ERROR_NO_MORE_ITEMS, got %d
\n
"
,
r
);
MsiViewClose
(
hview
);
MsiCloseHandle
(
hview
);
MsiCloseHandle
(
hdb
);
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