[PATCH 12/13] msi: All columns being temporary means the table is non-persistent.

Robert Shearman rob at codeweavers.com
Mon Apr 23 02:26:44 CDT 2007


The HOLD keyword just means that the non-persistent data in the table 
should be kept around, not that the table is temporary.
---
  dlls/msi/create.c   |   11 ++++++++++-
  dlls/msi/query.h    |    3 ++-
  dlls/msi/sql.y      |    7 +++++--
  dlls/msi/tests/db.c |    2 --
  4 files changed, 17 insertions(+), 6 deletions(-)
-------------- next part --------------
diff --git a/dlls/msi/create.c b/dlls/msi/create.c
index ef71684..965a4a6 100644
--- a/dlls/msi/create.c
+++ b/dlls/msi/create.c
@@ -146,10 +146,12 @@ static UINT check_columns( column_info *
 }
 
 UINT CREATE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR table,
-                        column_info *col_info, BOOL temp )
+                        column_info *col_info, BOOL hold )
 {
     MSICREATEVIEW *cv = NULL;
     UINT r;
+    const column_info *col;
+    BOOL temp = TRUE;
 
     TRACE("%p\n", cv );
 
@@ -161,6 +163,13 @@ UINT CREATE_CreateView( MSIDATABASE *db,
     if( !cv )
         return ERROR_FUNCTION_FAILED;
 
+    for( col = col_info; col; col = col->next )
+        if( !col->temporary )
+        {
+            temp = FALSE;
+            break;
+        }
+
     /* fill the structure */
     cv->view.ops = &create_ops;
     msiobj_addref( &db->hdr );
diff --git a/dlls/msi/query.h b/dlls/msi/query.h
index a8a633f..69d511c 100644
--- a/dlls/msi/query.h
+++ b/dlls/msi/query.h
@@ -66,6 +66,7 @@ typedef struct _column_info
     LPCWSTR table;
     LPCWSTR column;
     UINT   type;
+    BOOL   temporary;
     struct expr *val;
     struct _column_info *next;
 } column_info;
@@ -108,7 +109,7 @@ UINT WHERE_CreateView( MSIDATABASE *db, 
                        struct expr *cond );
 
 UINT CREATE_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR table,
-                        column_info *col_info, BOOL temp );
+                        column_info *col_info, BOOL hold );
 
 UINT INSERT_CreateView( MSIDATABASE *db, MSIVIEW **view, LPWSTR table,
                         column_info *columns, column_info *values, BOOL temp );
diff --git a/dlls/msi/sql.y b/dlls/msi/sql.y
index 17cb957..9cbeb6f 100644
--- a/dlls/msi/sql.y
+++ b/dlls/msi/sql.y
@@ -40,6 +40,8 @@ static int sql_error(const char *str);
 
 WINE_DEFAULT_DEBUG_CHANNEL(msi);
 
+#define MSITYPE_TEMPORARY 0x8000
+
 typedef struct tag_SQL_input
 {
     MSIDATABASE *db;
@@ -278,7 +280,8 @@ column_and_type:
     column column_type
         {
             $$ = $1;
-            $$->type = $2 | MSITYPE_VALID;
+            $$->type = ($2 | MSITYPE_VALID) & ~MSITYPE_TEMPORARY;
+            $$->temporary = $2 & MSITYPE_TEMPORARY ? TRUE : FALSE;
         }
     ;
 
@@ -293,7 +296,7 @@ column_type:
         }
   | data_type_l TK_TEMPORARY
         {
-            FIXME("temporary column\n");
+            $$ = $1 | MSITYPE_TEMPORARY;
         }
     ;
 
diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c
index 9ebcd02..073cf01 100644
--- a/dlls/msi/tests/db.c
+++ b/dlls/msi/tests/db.c
@@ -2664,10 +2664,8 @@ static void test_temporary_table(void)
     r = run_query(hdb, 0, query);
     ok(r == ERROR_SUCCESS, "failed to add table\n");
 
-    todo_wine {
     cond = MsiDatabaseIsTablePersistent(hdb, "P2");
     ok( cond == MSICONDITION_TRUE, "wrong return condition\n");
-    }
 
     query = "CREATE TABLE `T` ( `B` SHORT NOT NULL TEMPORARY, `C` CHAR(255) TEMPORARY PRIMARY KEY `C`) HOLD";
     r = run_query(hdb, 0, query);


More information about the wine-patches mailing list