Commit 697d820e authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

msi: All columns being temporary means the table is non-persistent.

The HOLD keyword just means that the non-persistent data in the table should be kept around, not that the table is temporary.
parent 44f7cb88
......@@ -146,10 +146,12 @@ static UINT check_columns( column_info *col_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, MSIVIEW **view, LPWSTR table,
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 );
......
......@@ -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, MSIVIEW **view, MSIVIEW *table,
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 );
......
......@@ -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;
}
;
......
......@@ -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);
......
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