Bug #22215 | Exception on TINYINT unsigned column type when the value is 255 | ||
---|---|---|---|
Submitted: | 9 Sep 2006 23:12 | Modified: | 21 Sep 2006 22:47 |
Reporter: | Susanta Datta | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | Connector / J | Severity: | S2 (Serious) |
Version: | 5.0.0 GA | OS: | Windows (Windows) |
Assigned to: | Todd Farmer | CPU Architecture: | Any |
[9 Sep 2006 23:12]
Susanta Datta
[21 Sep 2006 22:47]
Todd Farmer
Hi Susanta, Thank you for your detailed bug report! I was, however, unable to reproduce this bug using the current Connector/J version (5.0.3). Below is information on my test case: Configuration: Windows XP MySQL 5.0.18-nt JRE 1.5.0_06 mysql-connector-java-5.0.3 Java code: package mytest; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import testsuite.BaseTestCase; public class Bug22215 extends BaseTestCase { public Bug22215(String name) { super(name); } public static void main(String[] args) { junit.textui.TestRunner.run(Bug22215.class); } public void testBug22215() throws Exception { createTestTable(); Connection myConn = this.conn; PreparedStatement s = myConn.prepareStatement("SELECT i FROM BUG_22215"); ResultSet rs = s.executeQuery(); boolean returnedValue = false; while (rs.next()) { short sh = rs.getShort("i"); super.assertEquals(255, sh); returnedValue = true; } super.assertTrue(returnedValue); super.dropTable("BUG_22215"); } private void createTestTable() throws Exception { super.dropTable("BUG_22215"); this.stmt .executeUpdate("CREATE TABLE BUG_22215 ( i TINYINT UNSIGNED )"); this.stmt .executeUpdate("INSERT INTO BUG_22215 VALUES (255)"); } } Please try upgrading to the current version of Connector/J and see if that resolves your issue.
[21 Sep 2006 22:49]
Todd Farmer
Test case
Attachment: Bug22215.java (text/x-java), 1.02 KiB.