[WINESYNC] msi: Fix table ref count on create.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 405486fbe6853c78744099fa1ebe07995e07a438 by Piotr Caban <piotr@codeweavers.com>
This commit is contained in:
winesync 2022-03-13 19:08:41 +01:00 committed by Mark Jansen
parent 5c718f5f5c
commit caa225a496
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B
3 changed files with 7 additions and 4 deletions

View file

@ -68,7 +68,7 @@ static UINT CREATE_execute( struct tagMSIVIEW *view, MSIRECORD *record )
if (cv->bIsTemp && !cv->hold)
return ERROR_SUCCESS;
return msi_create_table( cv->db, cv->name, cv->col_info, persist );
return msi_create_table( cv->db, cv->name, cv->col_info, persist, cv->hold );
}
static UINT CREATE_close( struct tagMSIVIEW *view )

View file

@ -149,7 +149,7 @@ int sqliteGetToken(const WCHAR *z, int *tokenType, int *skip) DECLSPEC_HIDDEN;
MSIRECORD *msi_query_merge_record( UINT fields, const column_info *vl, MSIRECORD *rec ) DECLSPEC_HIDDEN;
UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info,
MSICONDITION persistent ) DECLSPEC_HIDDEN;
MSICONDITION persistent, BOOL hold ) DECLSPEC_HIDDEN;
UINT msi_select_update( MSIVIEW *view, MSIRECORD *rec, UINT row ) DECLSPEC_HIDDEN;

View file

@ -713,7 +713,7 @@ static UINT get_tablecolumns( MSIDATABASE *db, LPCWSTR szTableName, MSICOLUMNINF
}
UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info,
MSICONDITION persistent )
MSICONDITION persistent, BOOL hold )
{
UINT r, nField;
MSIVIEW *tv = NULL;
@ -733,7 +733,7 @@ UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info,
if( !table )
return ERROR_FUNCTION_FAILED;
table->ref_count = 1;
table->ref_count = 0;
table->row_count = 0;
table->data = NULL;
table->data_persistent = NULL;
@ -742,6 +742,9 @@ UINT msi_create_table( MSIDATABASE *db, LPCWSTR name, column_info *col_info,
table->persistent = persistent;
lstrcpyW( table->name, name );
if( hold )
table->ref_count++;
for( col = col_info; col; col = col->next )
table->col_count++;