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
0d1c3a14
Commit
0d1c3a14
authored
May 23, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
May 23, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create the ORDER BY view in a single call.
parent
7b1df689
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
59 deletions
+43
-59
order.c
dlls/msi/order.c
+37
-33
query.h
dlls/msi/query.h
+2
-2
sql.y
dlls/msi/sql.y
+4
-24
No files found.
dlls/msi/order.c
View file @
0d1c3a14
...
@@ -264,40 +264,8 @@ MSIVIEWOPS order_ops =
...
@@ -264,40 +264,8 @@ MSIVIEWOPS order_ops =
ORDER_delete
ORDER_delete
};
};
UINT
ORDER_CreateView
(
MSIDATABASE
*
db
,
MSIVIEW
**
view
,
MSIVIEW
*
tabl
e
)
static
UINT
ORDER_AddColumn
(
MSIORDERVIEW
*
ov
,
LPCWSTR
nam
e
)
{
{
MSIORDERVIEW
*
ov
=
NULL
;
UINT
count
=
0
,
r
;
TRACE
(
"%p
\n
"
,
ov
);
r
=
table
->
ops
->
get_dimensions
(
table
,
NULL
,
&
count
);
if
(
r
!=
ERROR_SUCCESS
)
{
ERR
(
"can't get table dimensions
\n
"
);
return
r
;
}
ov
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
*
ov
+
sizeof
(
UINT
)
*
count
);
if
(
!
ov
)
return
ERROR_FUNCTION_FAILED
;
/* fill the structure */
ov
->
view
.
ops
=
&
order_ops
;
msiobj_addref
(
&
db
->
hdr
);
ov
->
db
=
db
;
ov
->
table
=
table
;
ov
->
reorder
=
NULL
;
ov
->
num_cols
=
0
;
*
view
=
(
MSIVIEW
*
)
ov
;
return
ERROR_SUCCESS
;
}
UINT
ORDER_AddColumn
(
MSIVIEW
*
view
,
LPWSTR
name
)
{
MSIORDERVIEW
*
ov
=
(
MSIORDERVIEW
*
)
view
;
UINT
n
,
count
,
r
;
UINT
n
,
count
,
r
;
MSIVIEW
*
table
;
MSIVIEW
*
table
;
...
@@ -332,3 +300,39 @@ UINT ORDER_AddColumn( MSIVIEW *view, LPWSTR name )
...
@@ -332,3 +300,39 @@ UINT ORDER_AddColumn( MSIVIEW *view, LPWSTR name )
return
ERROR_SUCCESS
;
return
ERROR_SUCCESS
;
}
}
UINT
ORDER_CreateView
(
MSIDATABASE
*
db
,
MSIVIEW
**
view
,
MSIVIEW
*
table
,
string_list
*
columns
)
{
MSIORDERVIEW
*
ov
=
NULL
;
UINT
count
=
0
,
r
;
string_list
*
x
;
TRACE
(
"%p
\n
"
,
ov
);
r
=
table
->
ops
->
get_dimensions
(
table
,
NULL
,
&
count
);
if
(
r
!=
ERROR_SUCCESS
)
{
ERR
(
"can't get table dimensions
\n
"
);
return
r
;
}
ov
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
*
ov
+
sizeof
(
UINT
)
*
count
);
if
(
!
ov
)
return
ERROR_FUNCTION_FAILED
;
/* fill the structure */
ov
->
view
.
ops
=
&
order_ops
;
msiobj_addref
(
&
db
->
hdr
);
ov
->
db
=
db
;
ov
->
table
=
table
;
ov
->
reorder
=
NULL
;
ov
->
num_cols
=
0
;
*
view
=
(
MSIVIEW
*
)
ov
;
for
(
x
=
columns
;
x
;
x
=
x
->
next
)
ORDER_AddColumn
(
ov
,
x
->
string
);
return
ERROR_SUCCESS
;
}
dlls/msi/query.h
View file @
0d1c3a14
...
@@ -114,8 +114,8 @@ UINT SELECT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table,
...
@@ -114,8 +114,8 @@ UINT SELECT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table,
UINT
DISTINCT_CreateView
(
MSIDATABASE
*
db
,
MSIVIEW
**
view
,
MSIVIEW
*
table
);
UINT
DISTINCT_CreateView
(
MSIDATABASE
*
db
,
MSIVIEW
**
view
,
MSIVIEW
*
table
);
UINT
ORDER_CreateView
(
MSIDATABASE
*
db
,
MSIVIEW
**
view
,
MSIVIEW
*
table
);
UINT
ORDER_CreateView
(
MSIDATABASE
*
db
,
MSIVIEW
**
view
,
MSIVIEW
*
table
,
UINT
ORDER_AddColumn
(
MSIVIEW
*
group
,
LPWSTR
name
);
string_list
*
columns
);
UINT
WHERE_CreateView
(
MSIDATABASE
*
db
,
MSIVIEW
**
view
,
MSIVIEW
*
table
,
UINT
WHERE_CreateView
(
MSIDATABASE
*
db
,
MSIVIEW
**
view
,
MSIVIEW
*
table
,
struct
expr
*
cond
);
struct
expr
*
cond
);
...
...
dlls/msi/sql.y
View file @
0d1c3a14
...
@@ -54,8 +54,6 @@ static int SQL_lex( void *SQL_lval, SQL_input *info);
...
@@ -54,8 +54,6 @@ static int SQL_lex( void *SQL_lval, SQL_input *info);
static MSIVIEW *do_one_select( MSIDATABASE *db, MSIVIEW *in,
static MSIVIEW *do_one_select( MSIDATABASE *db, MSIVIEW *in,
string_list *columns );
string_list *columns );
static MSIVIEW *do_order_by( MSIDATABASE *db, MSIVIEW *in,
string_list *columns );
static BOOL SQL_MarkPrimaryKeys( create_col_info *cols,
static BOOL SQL_MarkPrimaryKeys( create_col_info *cols,
string_list *keys);
string_list *keys);
...
@@ -330,12 +328,13 @@ oneselect:
...
@@ -330,12 +328,13 @@ oneselect:
{
{
SQL_input* sql = (SQL_input*) info;
SQL_input* sql = (SQL_input*) info;
if( !$1 )
$$ = NULL;
YYABORT;
if( $4 )
if( $4 )
$$ = do_order_by( sql->db
, $1, $4 );
ORDER_CreateView( sql->db, &$$
, $1, $4 );
else
else
$$ = $1;
$$ = $1;
if( !$$ )
YYABORT;
}
}
| unorderedsel
| unorderedsel
;
;
...
@@ -690,25 +689,6 @@ static MSIVIEW *do_one_select( MSIDATABASE *db, MSIVIEW *in,
...
@@ -690,25 +689,6 @@ static MSIVIEW *do_one_select( MSIDATABASE *db, MSIVIEW *in,
return view;
return view;
}
}
static MSIVIEW *do_order_by( MSIDATABASE *db, MSIVIEW *in,
string_list *columns )
{
MSIVIEW *view = NULL;
ORDER_CreateView( db, &view, in );
if( view )
{
string_list *x = columns;
for( x = columns; x ; x = x->next )
ORDER_AddColumn( view, x->string );
}
else
ERR("Error creating select query\n");
delete_string_list( columns );
return view;
}
static struct expr * EXPR_wildcard()
static struct expr * EXPR_wildcard()
{
{
struct expr *e = HeapAlloc( GetProcessHeap(), 0, sizeof *e );
struct expr *e = HeapAlloc( GetProcessHeap(), 0, sizeof *e );
...
...
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