Page 1 of 1

Inconsistent/invalid data type mapping

Posted: Tue 21 Aug 2012 20:26
by tester1
There seems to be an inconsistent or incorrect behavior with the data reader when there is a unsigned int column.

db table:
id int(10) unsigned

Now when the IDataRader is used:
long foo = (long)reader["id"];
The object shows as long, but when it is casted to long an invalid cast exception is thrown. I tried to cast it to uint, int, ulong as well but with the same result.

In earlier versions of dotConnect the object contained an int which then could be casted to an uint. I believe the decision to use a long is correct since the IDataReader interface does not support unsigned integers. However casting it to long should not throw an exception.

If the column data type is signed then it is correctly handled.

Re: Inconsistent/invalid data type mapping

Posted: Wed 22 Aug 2012 14:34
by Pinturiccio
We could not reproduce the issue. Could you please provide the following information:
1. The exact version of dotConnect for MySQL;
2. DDL/DML scripts of the table with the unsigned int column;
3. The snippet of code with creation of IDataReader and MySqlCommand that is used for creating IDataReader and with the place where the exception occurs;
4. The full text of the exception and its call stack.