MSI: only tables can be backquoted, strings must be single quoted

Mike McCormack mike at codeweavers.com
Thu May 19 04:47:58 CDT 2005


This makes a couple of existing tests pass.

Mike


ChangeLog:
* only tables can be backquoted, strings must be single quoted
-------------- next part --------------
? dlls/msi/version.res
? dlls/msi/x
Index: dlls/msi/package.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/package.c,v
retrieving revision 1.39
diff -u -p -r1.39 package.c
--- dlls/msi/package.c	4 May 2005 10:37:05 -0000	1.39
+++ dlls/msi/package.c	19 May 2005 09:47:55 -0000
@@ -749,7 +749,7 @@ static UINT MSI_GetPropertyRow(MSIPACKAG
     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)
Index: dlls/msi/sql.y
===================================================================
RCS file: /home/wine/wine/dlls/msi/sql.y,v
retrieving revision 1.21
diff -u -p -r1.21 sql.y
--- dlls/msi/sql.y	14 Feb 2005 11:07:13 -0000	1.21
+++ dlls/msi/sql.y	19 May 2005 09:47:55 -0000
@@ -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,29 +583,25 @@ 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 );
         }
Index: dlls/msi/tokenize.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/tokenize.c,v
retrieving revision 1.8
diff -u -p -r1.8 tokenize.c
--- dlls/msi/tokenize.c	6 Aug 2004 17:30:20 -0000	1.8
+++ dlls/msi/tokenize.c	19 May 2005 09:47:55 -0000
@@ -346,7 +346,10 @@ int sqliteGetToken(const WCHAR *z, int *
         }
       }
       if( z[i] ) i++;
-      *tokenType = TK_STRING;
+      if( delim == '`' )
+        *tokenType = TK_ID;
+      else
+        *tokenType = TK_STRING;
       return i;
     }
     case '.': {
Index: dlls/msi/tests/db.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/tests/db.c,v
retrieving revision 1.9
diff -u -p -r1.9 db.c
--- dlls/msi/tests/db.c	7 May 2005 12:12:56 -0000	1.9
+++ dlls/msi/tests/db.c	19 May 2005 09:47:55 -0000
@@ -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");


More information about the wine-patches mailing list