Inconsistent/invalid data type mapping

Inconsistent/invalid data type mapping

Postby tester1 » Tue 21 Aug 2012 20:26

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.
Posts: 1
Joined: Tue 21 Aug 2012 20:15

Re: Inconsistent/invalid data type mapping

Postby Pinturiccio » Wed 22 Aug 2012 14:34

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.
Devart Team
Posts: 1953
Joined: Wed 02 Nov 2011 09:44

Return to dotConnect for MySQL