msi: Add support for table names in select statements.

Propagate tablename from 'SELECT tablename.column from tablename' queries
into VIEW_find_column(). Previously, the tablename had been dropped.
This commit is contained in:
Nathan Gallaher 2009-11-09 20:41:43 -05:00 committed by Alexandre Julliard
parent 51000c171b
commit 5c56e1f440
1 changed files with 6 additions and 4 deletions

View File

@ -368,12 +368,14 @@ static const MSIVIEWOPS select_ops =
NULL, NULL,
}; };
static UINT SELECT_AddColumn( MSISELECTVIEW *sv, LPCWSTR name ) static UINT SELECT_AddColumn( MSISELECTVIEW *sv, LPCWSTR name,
LPCWSTR table_name )
{ {
UINT r, n=0; UINT r, n=0;
MSIVIEW *table; MSIVIEW *table;
TRACE("%p adding %s\n", sv, debugstr_w( name ) ); TRACE("%p adding %s.%s\n", sv, debugstr_w( table_name ),
debugstr_w( name ));
if( sv->view.ops != &select_ops ) if( sv->view.ops != &select_ops )
return ERROR_FUNCTION_FAILED; return ERROR_FUNCTION_FAILED;
@ -389,7 +391,7 @@ static UINT SELECT_AddColumn( MSISELECTVIEW *sv, LPCWSTR name )
if( sv->num_cols >= sv->max_cols ) if( sv->num_cols >= sv->max_cols )
return ERROR_FUNCTION_FAILED; return ERROR_FUNCTION_FAILED;
r = VIEW_find_column( table, name, NULL, &n ); r = VIEW_find_column( table, name, table_name, &n );
if( r != ERROR_SUCCESS ) if( r != ERROR_SUCCESS )
return r; return r;
@ -433,7 +435,7 @@ UINT SELECT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table,
while( columns ) while( columns )
{ {
r = SELECT_AddColumn( sv, columns->column ); r = SELECT_AddColumn( sv, columns->column, columns->table );
if( r ) if( r )
break; break;
columns = columns->next; columns = columns->next;