Error selecting fields with same name from different tables
-----------------------------------------------------------
Key: DNET-257
URL: http://tracker.firebirdsql.org/browse/DNET-257
Project: .NET Data provider
Issue Type: Bug
Components: ADO.NET Provider
Affects Versions: 2.5.0
Environment: Windows
Reporter: pablo santos
Assignee: Jiri Cincura
On FbDataReader.cs, line ~377:
for (int i = 0; i < this.fields.Count; i++)
{
columnsIndexes.Add(this.fields[i].Alias.ToUpper(), i);
}
The error shows up when trying to run a sql like:
select table1.field, table2.field
On such cases fields[i].Alias is "field" for both items. This causes
the dictionary columnsIndexes to throw the "duplicate key" error.
Maybe a solution is to concatenate Alias and Relation?
columnsIndexes.Add(this.fields[i].Relation.ToUpper()
+"."+this.fields[i].Alias.ToUpper(), i);
As a side note, ToUpper() can be removed if columnsIndexes is
instantiated using StringComparer.CurrentCultureIgnoreCase.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|