Bug #37350 Using unsigned integers with autoincrement
Submitted: 11 Jun 2008 16:15 Modified: 14 Jul 2008 16:38
Reporter: Poul Bak Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Documentation Severity:S3 (Non-critical)
Version:5.2.2 OS:Any
Assigned to: MC Brown CPU Architecture:Any
Tags: autoincrement

[11 Jun 2008 16:15] Poul Bak
Description:
In 'MySqlDataAdapter Class' doc, there is a note half way down:
'Note: Please be aware that the DataColumn class in .NET 1.0 and 1.1 does not allow columns with type of UInt16, UInt32, or UInt64 to be autoincrement columns. If you plan to use autoincremement columns with MySQL, you should consider using signed integer columns.'

This (at least to me) indicates that this might have been/is fixed in .net 2.0 and later.
However, this is NOT the case even in .net 3.5 !

I found his page from MS, help for .net 3.5:
http://msdn.microsoft.com/en-us/library/229sz0y5.aspx
Find the note half down:
"... whereas a DataColumn only allows Int16, Int32, and Int64 to have the AutoIncrement property set."

How to repeat:
Read the doc

Suggested fix:
Remove the versions from the text, like this:

'Note: Please be aware that the DataColumn class in .NET does not allow columns with type of UInt16, UInt32, or UInt64 to be autoincrement columns. If you plan to use autoincremement columns with MySQL, you should consider using signed integer columns.'

Now, not even I will get my hopes up.
[12 Jun 2008 4:20] Tonci Grgin
Hi Poul and thanks for your report. Verified as described. MC, please update docs to reflect this.
[12 Jun 2008 13:59] Poul Bak
Upon second thought, I actually think it's even better to say, like the MS doc:

"...only allows Int16, Int32, and Int64 ..."

This excludes other types like TinyInt, too.
[17 Jun 2008 15:54] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/48019
[17 Jun 2008 15:57] Reggie Burnett
Fixed in 5.1.7 and higher.  Online docs still need to be updated
[14 Jul 2008 16:38] Tony Bedford
Fixed main docs and added entry to 5.1.7 changelog:

Documentation incorrectly stated that “the DataColumn class in .NET 1.0 and 1.1 does not allow columns with type of UInt16, UInt32, or UInt64 to be autoincrement columns”.