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
4def5934
Commit
4def5934
authored
Jan 03, 2012
by
Hans Leidekker
Committed by
Alexandre Julliard
Jan 03, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Accept a missing left backquote in SQL identifiers.
parent
f7a21f8c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
4 deletions
+38
-4
query.h
dlls/msi/query.h
+1
-1
sql.y
dlls/msi/sql.y
+3
-2
db.c
dlls/msi/tests/db.c
+30
-0
tokenize.c
dlls/msi/tokenize.c
+4
-1
No files found.
dlls/msi/query.h
View file @
4def5934
...
...
@@ -131,7 +131,7 @@ UINT STORAGES_CreateView( MSIDATABASE *db, MSIVIEW **view ) DECLSPEC_HIDDEN;
UINT
DROP_CreateView
(
MSIDATABASE
*
db
,
MSIVIEW
**
view
,
LPCWSTR
name
)
DECLSPEC_HIDDEN
;
int
sqliteGetToken
(
const
WCHAR
*
z
,
int
*
tokenType
)
DECLSPEC_HIDDEN
;
int
sqliteGetToken
(
const
WCHAR
*
z
,
int
*
tokenType
,
int
*
skip
)
DECLSPEC_HIDDEN
;
MSIRECORD
*
msi_query_merge_record
(
UINT
fields
,
const
column_info
*
vl
,
MSIRECORD
*
rec
)
DECLSPEC_HIDDEN
;
...
...
dlls/msi/sql.y
View file @
4def5934
...
...
@@ -797,7 +797,7 @@ static column_info *parser_alloc_column( void *info, LPCWSTR table, LPCWSTR colu
static int sql_lex( void *SQL_lval, SQL_input *sql )
{
int token;
int token
, skip
;
struct sql_str * str = SQL_lval;
do
...
...
@@ -807,11 +807,12 @@ static int sql_lex( void *SQL_lval, SQL_input *sql )
return 0; /* end of input */
/* TRACE("string : %s\n", debugstr_w(&sql->command[sql->n])); */
sql->len = sqliteGetToken( &sql->command[sql->n], &token );
sql->len = sqliteGetToken( &sql->command[sql->n], &token
, &skip
);
if( sql->len==0 )
break;
str->data = &sql->command[sql->n];
str->len = sql->len;
sql->n += skip;
}
while( token == TK_SPACE );
...
...
dlls/msi/tests/db.c
View file @
4def5934
...
...
@@ -727,6 +727,36 @@ static void test_msibadqueries(void)
r
=
try_query
(
hdb
,
"select * from 'c'"
);
ok
(
r
==
ERROR_BAD_QUERY_SYNTAX
,
"query failed
\n
"
);
r
=
try_query
(
hdb
,
"select `c`.`b` from `c` order by `c`.`order`"
);
ok
(
r
==
ERROR_BAD_QUERY_SYNTAX
,
"query failed: %u
\n
"
,
r
);
r
=
try_query
(
hdb
,
"select `c`.b` from `c`"
);
ok
(
r
==
ERROR_SUCCESS
,
"query failed: %u
\n
"
,
r
);
r
=
try_query
(
hdb
,
"select `c`.`b from `c`"
);
ok
(
r
==
ERROR_BAD_QUERY_SYNTAX
,
"query failed: %u
\n
"
,
r
);
r
=
try_query
(
hdb
,
"select `c`.b from `c`"
);
ok
(
r
==
ERROR_SUCCESS
,
"query failed: %u
\n
"
,
r
);
r
=
try_query
(
hdb
,
"select `c.`b` from `c`"
);
ok
(
r
==
ERROR_BAD_QUERY_SYNTAX
,
"query failed: %u
\n
"
,
r
);
r
=
try_query
(
hdb
,
"select c`.`b` from `c`"
);
ok
(
r
==
ERROR_SUCCESS
,
"query failed: %u
\n
"
,
r
);
r
=
try_query
(
hdb
,
"select c.`b` from `c`"
);
ok
(
r
==
ERROR_SUCCESS
,
"query failed: %u
\n
"
,
r
);
r
=
try_query
(
hdb
,
"select `c`.`b` from c`"
);
ok
(
r
==
ERROR_SUCCESS
,
"query failed: %u
\n
"
,
r
);
r
=
try_query
(
hdb
,
"select `c`.`b` from `c"
);
ok
(
r
==
ERROR_BAD_QUERY_SYNTAX
,
"query failed: %u
\n
"
,
r
);
r
=
try_query
(
hdb
,
"select `c`.`b` from c"
);
ok
(
r
==
ERROR_SUCCESS
,
"query failed: %u
\n
"
,
r
);
r
=
try_query
(
hdb
,
"CREATE TABLE `
\5
a` (`b` CHAR NOT NULL PRIMARY KEY `b`)"
);
ok
(
r
==
ERROR_SUCCESS
,
"query failed: %u
\n
"
,
r
);
...
...
dlls/msi/tokenize.c
View file @
4def5934
...
...
@@ -190,8 +190,10 @@ static const char isIdChar[] = {
** -1 if the token is (or might be) incomplete. Store the token
** type in *tokenType before returning.
*/
int
sqliteGetToken
(
const
WCHAR
*
z
,
int
*
tokenType
){
int
sqliteGetToken
(
const
WCHAR
*
z
,
int
*
tokenType
,
int
*
skip
){
int
i
;
*
skip
=
0
;
switch
(
*
z
){
case
' '
:
case
'\t'
:
case
'\n'
:
case
'\f'
:
for
(
i
=
1
;
isspace
(
z
[
i
])
&&
z
[
i
]
!=
'\r'
;
i
++
){}
...
...
@@ -280,6 +282,7 @@ int sqliteGetToken(const WCHAR *z, int *tokenType){
}
for
(
i
=
1
;
isIdChar
[
z
[
i
]];
i
++
){}
*
tokenType
=
sqliteKeywordCode
(
z
,
i
);
if
(
*
tokenType
==
TK_ID
&&
z
[
i
]
==
'`'
)
*
skip
=
1
;
return
i
;
}
*
tokenType
=
TK_ILLEGAL
;
...
...
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