Commit 5c56e1f4 authored by Nathan Gallaher's avatar Nathan Gallaher Committed by Alexandre Julliard

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.
parent 51000c17
......@@ -368,12 +368,14 @@ static const MSIVIEWOPS select_ops =
NULL,
};
static UINT SELECT_AddColumn( MSISELECTVIEW *sv, LPCWSTR name )
static UINT SELECT_AddColumn( MSISELECTVIEW *sv, LPCWSTR name,
LPCWSTR table_name )
{
UINT r, n=0;
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 )
return ERROR_FUNCTION_FAILED;
......@@ -389,7 +391,7 @@ static UINT SELECT_AddColumn( MSISELECTVIEW *sv, LPCWSTR name )
if( sv->num_cols >= sv->max_cols )
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 )
return r;
......@@ -433,7 +435,7 @@ UINT SELECT_CreateView( MSIDATABASE *db, MSIVIEW **view, MSIVIEW *table,
while( columns )
{
r = SELECT_AddColumn( sv, columns->column );
r = SELECT_AddColumn( sv, columns->column, columns->table );
if( r )
break;
columns = columns->next;
......
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