Commit d31f1296 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Only tables can be backquoted, strings must be single quoted.

parent 88adb53b
...@@ -749,7 +749,7 @@ static UINT MSI_GetPropertyRow(MSIPACKAGE *package, LPCWSTR szName, MSIRECORD ** ...@@ -749,7 +749,7 @@ static UINT MSI_GetPropertyRow(MSIPACKAGE *package, LPCWSTR szName, MSIRECORD **
static const WCHAR select[]= static const WCHAR select[]=
{'s','e','l','e','c','t',' ','V','a','l','u','e',' ','f','r','o','m',' ' {'s','e','l','e','c','t',' ','V','a','l','u','e',' ','f','r','o','m',' '
,'_','P','r','o','p','e','r','t','y',' ','w','h','e','r','e',' ' ,'_','P','r','o','p','e','r','t','y',' ','w','h','e','r','e',' '
,'_','P','r','o','p','e','r','t','y','=','`','%','s','`',0}; ,'_','P','r','o','p','e','r','t','y','=','\'','%','s','\'',0};
LPWSTR query; LPWSTR query;
if (!szName) if (!szName)
......
...@@ -127,7 +127,7 @@ static struct expr * EXPR_wildcard(); ...@@ -127,7 +127,7 @@ static struct expr * EXPR_wildcard();
%nonassoc END_OF_FILE ILLEGAL SPACE UNCLOSED_STRING COMMENT FUNCTION %nonassoc END_OF_FILE ILLEGAL SPACE UNCLOSED_STRING COMMENT FUNCTION
COLUMN AGG_FUNCTION. COLUMN AGG_FUNCTION.
%type <string> column table string_or_id %type <string> column table id
%type <column_list> selcollist %type <column_list> selcollist
%type <query> from unorderedsel oneselect onequery onecreate oneinsert %type <query> from unorderedsel oneselect onequery onecreate oneinsert
%type <query> oneupdate onedelete %type <query> oneupdate onedelete
...@@ -583,32 +583,28 @@ column_val: ...@@ -583,32 +583,28 @@ column_val:
; ;
column: column:
table TK_DOT string_or_id table TK_DOT id
{ {
$$ = $3; /* FIXME */ $$ = $3; /* FIXME */
} }
| string_or_id | id
{ {
$$ = $1; $$ = $1;
} }
; ;
table: table:
string_or_id id
{ {
$$ = $1; $$ = $1;
} }
; ;
string_or_id: id:
TK_ID TK_ID
{ {
$$ = SQL_getstring( &$1 ); $$ = SQL_getstring( &$1 );
} }
| TK_STRING
{
$$ = SQL_getstring( &$1 );
}
; ;
%% %%
......
...@@ -359,10 +359,8 @@ void test_msibadqueries() ...@@ -359,10 +359,8 @@ void test_msibadqueries()
r = try_query( hdb, "CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY KEY)"); r = try_query( hdb, "CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY KEY)");
ok(r == ERROR_BAD_QUERY_SYNTAX , "invalid query 2i return code\n"); ok(r == ERROR_BAD_QUERY_SYNTAX , "invalid query 2i return code\n");
todo_wine {
r = try_query( hdb, "CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY KEY 'b')"); r = try_query( hdb, "CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY KEY 'b')");
ok(r == ERROR_BAD_QUERY_SYNTAX , "invalid query 2j return code\n"); ok(r == ERROR_BAD_QUERY_SYNTAX , "invalid query 2j return code\n");
}
r = try_query( hdb, "CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY KEY `b')"); r = try_query( hdb, "CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY KEY `b')");
ok(r == ERROR_BAD_QUERY_SYNTAX , "invalid query 2k return code\n"); ok(r == ERROR_BAD_QUERY_SYNTAX , "invalid query 2k return code\n");
...@@ -385,10 +383,8 @@ void test_msibadqueries() ...@@ -385,10 +383,8 @@ void test_msibadqueries()
r = try_query( hdb, "CREATE TABLE `a` (`` CHAR(72) NOT NULL PRIMARY KEY `b`)"); r = try_query( hdb, "CREATE TABLE `a` (`` CHAR(72) NOT NULL PRIMARY KEY `b`)");
ok(r == ERROR_BAD_QUERY_SYNTAX , "invalid query 2p return code\n"); ok(r == ERROR_BAD_QUERY_SYNTAX , "invalid query 2p return code\n");
todo_wine {
r = try_query( hdb, "CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY KEY `b`)"); r = try_query( hdb, "CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY KEY `b`)");
ok(r == ERROR_SUCCESS , "valid query 2z failed\n"); ok(r == ERROR_SUCCESS , "valid query 2z failed\n");
}
r = try_query( hdb, "CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY KEY `b`)"); r = try_query( hdb, "CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY KEY `b`)");
ok(r == ERROR_BAD_QUERY_SYNTAX , "created same table again\n"); ok(r == ERROR_BAD_QUERY_SYNTAX , "created same table again\n");
......
...@@ -346,7 +346,10 @@ int sqliteGetToken(const WCHAR *z, int *tokenType){ ...@@ -346,7 +346,10 @@ int sqliteGetToken(const WCHAR *z, int *tokenType){
} }
} }
if( z[i] ) i++; if( z[i] ) i++;
*tokenType = TK_STRING; if( delim == '`' )
*tokenType = TK_ID;
else
*tokenType = TK_STRING;
return i; return i;
} }
case '.': { case '.': {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment