Bug #26621 The MySQLDataAdapter change the type of a MySQL bit to a System.UInt64

Submitted: 25 Feb 2007 18:37 Modified: 12 Mar 2007 19:21
Reporter: Christian Alejandro Sandoval Diaz Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Visual Studio Plugin Severity:S3 (Non-critical)
Version:1.1 OS:Windows (Windows XP)
Assigned to: CPU Architecture:Any
Tags: bit, MySqlDataAdapter, Uint64

[25 Feb 2007 18:37] Christian Alejandro Sandoval Diaz
Description:
the return type of value from a field in a query passed to a MySQLDataAdapter  is wrong when the MySQL type of the field is "bit(1)"

How to repeat:
this is the SQL script:

CREATE TABLE test(field1 bit);
INSERT Test SELECT 1;

this is the c# .NET code:

string SQL;
MySqlCommand Com = new MySqlCommand();
MySqlDataAdapter Adap = new MySqlDataAdapter(Com);
DataTable table = new DataTable();
Com.Conection = this.Conection;

SQL = "SELECT field1 FROM test";
Com.Command = SQL;

Adap.Fill(table);
//there the value of tabla.Rows[0]["field1"].GetType().FullName 
//is "System.UInt64" instead of "System.Boolean"

Suggested fix:
I think that is a problem with the Conversión, I need a return type of "System.Boolean" or "bool", because i am doing a migration of a application from MS SQL Server to MySQL Server, the MS SQL Server returns the the type that i need.

I know that i can simply make a conversion from UInt64 to bool, but this is a bug.
[12 Mar 2007 19:21] Tonci Grgin
Hi Christian and thanks for your report. 
I don't quite get it... Can you please read http://dev.mysql.com/doc/refman/5.0/en/bit-field-values.html again.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.040 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.