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 **
static const WCHAR select[]=
{'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','=','`','%','s','`',0};
,'_','P','r','o','p','e','r','t','y','=','\'','%','s','\'',0};
LPWSTR query;
if (!szName)
......
......@@ -127,7 +127,7 @@ static struct expr * EXPR_wildcard();
%nonassoc END_OF_FILE ILLEGAL SPACE UNCLOSED_STRING COMMENT FUNCTION
COLUMN AGG_FUNCTION.
%type <string> column table string_or_id
%type <string> column table id
%type <column_list> selcollist
%type <query> from unorderedsel oneselect onequery onecreate oneinsert
%type <query> oneupdate onedelete
......@@ -583,32 +583,28 @@ column_val:
;
column:
table TK_DOT string_or_id
table TK_DOT id
{
$$ = $3; /* FIXME */
}
| string_or_id
| id
{
$$ = $1;
}
;
table:
string_or_id
id
{
$$ = $1;
}
;
string_or_id:
id:
TK_ID
{
$$ = SQL_getstring( &$1 );
}
| TK_STRING
{
$$ = SQL_getstring( &$1 );
}
;
%%
......
......@@ -359,10 +359,8 @@ void test_msibadqueries()
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");
todo_wine {
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");
}
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");
......@@ -385,10 +383,8 @@ void test_msibadqueries()
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");
todo_wine {
r = try_query( hdb, "CREATE TABLE `a` (`b` CHAR(72) NOT NULL PRIMARY KEY `b`)");
ok(r == ERROR_SUCCESS , "valid query 2z failed\n");
}
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");
......
......@@ -346,7 +346,10 @@ int sqliteGetToken(const WCHAR *z, int *tokenType){
}
}
if( z[i] ) i++;
*tokenType = TK_STRING;
if( delim == '`' )
*tokenType = TK_ID;
else
*tokenType = TK_STRING;
return i;
}
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