Open MasterKuat opened 1 month ago
hi - thanks for reporting this issue and all the details (and the suggested solution too!) managed to reproduce it as you described; we'll take a look and fix it.
i also observed that using reader.Read()
, something like:
...
cmd.CommandText = "SELECT variantcol from test_db.dotnet.gh1006;";
IDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
Console.WriteLine(reader.GetString(0));
}
...
did not crash the application and could return the resultset; so perhaps could be used as a workaround until the issue is fixed, of course only if that makes sense in your case.
Anyways; thank you again and I'll keep this issue posted with the progress as there's any.
What version of .NET driver are you using? 4.1.0
What operating system and processor architecture are you using? Windows 10, x64
What version of .NET framework are you using? .net framework 4.8
What did you do? Mainly :
cmd is a SnowflakeDbCommand with a simple query : SELECT MyVariantcolumn FROM T
dt.Load(reader) raise an exception : Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints
No exception
This came from ColumnSize
For variant rowType.length is 0, should be -1 for unknown. Replace L124 by :
row[SchemaTableColumn.ColumnSize] = rowType.length == 0 ? -1: (int)rowType.length;