http://bugs.winehq.org/show_bug.cgi?id=20227
Summary: msi: Table Join on two tables that have same (non-join) column name causes only first column data to be returned. Product: Wine Version: 1.1.30 Platform: All OS/Version: All Status: UNCONFIRMED Severity: major Priority: P2 Component: msi AssignedTo: wine-bugs@winehq.org ReportedBy: ngallaher+winehq@deepthought.org
Created an attachment (id=23863) --> (http://bugs.winehq.org/attachment.cgi?id=23863) Patch for TableJoin bug
Imagine the following tables
Table foo: string color string flavor
Table bar: string color string flavor
with query "Select foo.color, bar.flavor from foo, bar where foo.color=bar.color"
The current version returns the data from columns foo.color and foo.flavor. This is because when the tables are joined, the original tablename identifiers are dropped on the floor, resulting in a table with two 'color' and two 'flavor' columns. The VIEW_find_column() function then returns the first column found that matches the requested name.
This can be traced to a deficiency in VIEW_find_column() which only uses the column names in its comparison. Further, the sql parser does not preserve the table identifier, but this is easily fixed.
A patch, including test case is attached.
This behaviour was observed when trying to install Visual Studio 2008 Standard Edition.