sougatamondal / migratordotnet

Automatically exported from code.google.com/p/migratordotnet
0 stars 0 forks source link

GetColumnByName should not be case sensitive #110

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a table with column 'NAME'
2. Call GetColumnByName('Name');
3. It will return null

Since the column name is not case sensitive in all databases, 
GetColumnByName has to follow the same behavior.

To fix that, change TransformatinoProvider.cs from:

public virtual Column GetColumnByName(string table, string columnName)
{
    return Array.Find(GetColumns(table),
    delegate(Column column)
    {
        return column.Name == columnName;
    });
}

to:

public virtual Column GetColumnByName(string table, string columnName)
{
    return Array.Find(GetColumns(table),
    delegate(Column column)
    {
        return column.Name.ToLower() == columnName.ToLower();
    });
}

Original issue reported on code.google.com by andrecar...@gmail.com on 16 Apr 2009 at 5:20

GoogleCodeExporter commented 8 years ago
You proposed fix breaks case-sensitive databases, doesn't it.

Original comment by logi...@gmail.com on 3 Oct 2009 at 4:03