List:Commits« Previous MessageNext Message »
From:mmatthews Date:December 20 2005 11:27pm
Subject:Connector/J commit: r4724 - in branches/branch_5_0/connector-j: . src/com/mysql/jdbc src/testsuite/regression
View as plain text  
Modified:
   branches/branch_5_0/connector-j/CHANGES
   branches/branch_5_0/connector-j/src/com/mysql/jdbc/MysqlDefs.java
   branches/branch_5_0/connector-j/src/testsuite/regression/MetaDataRegressionTest.java
Log:
Fixed BUG#15854 - DBMD.getColumns() returns wrong type for BIT.

(merged from 3.1)

Modified: branches/branch_5_0/connector-j/CHANGES
===================================================================
--- branches/branch_5_0/connector-j/CHANGES	2005-12-20 23:26:10 UTC (rev 4723)
+++ branches/branch_5_0/connector-j/CHANGES	2005-12-20 23:27:01 UTC (rev 4724)
@@ -106,7 +106,9 @@
       
     - Fixed BUG#15676 - lib-nodist directory missing from  
       package breaks out-of-box build   
-        
+      
+    - Fixed BUG#15854 - DBMD.getColumns() returns wrong type for BIT.  
+    
 11-30-05 - Version 3.1.12
 
 

Modified: branches/branch_5_0/connector-j/src/com/mysql/jdbc/MysqlDefs.java
===================================================================
--- branches/branch_5_0/connector-j/src/com/mysql/jdbc/MysqlDefs.java	2005-12-20 23:26:10 UTC (rev 4723)
+++ branches/branch_5_0/connector-j/src/com/mysql/jdbc/MysqlDefs.java	2005-12-20 23:27:01 UTC (rev 4724)
@@ -391,6 +391,8 @@
 			return Types.BINARY; // no concrete type on the wire
 		} else if (mysqlType.equalsIgnoreCase("VARBINARY")) {
 			return Types.VARBINARY; // no concrete type on the wire
+		} else if (mysqlType.equalsIgnoreCase("BIT")) {
+			return mysqlToJavaType(FIELD_TYPE_BIT);
 		}
 
 		// Punt

Modified: branches/branch_5_0/connector-j/src/testsuite/regression/MetaDataRegressionTest.java
===================================================================
--- branches/branch_5_0/connector-j/src/testsuite/regression/MetaDataRegressionTest.java	2005-12-20 23:26:10 UTC (rev 4723)
+++ branches/branch_5_0/connector-j/src/testsuite/regression/MetaDataRegressionTest.java	2005-12-20 23:27:01 UTC (rev 4724)
@@ -1446,4 +1446,29 @@
 			}
 		}
 	}
+
+	/** 
+	 * Tests fix for BUG#15854 - DBMD.getColumns() returns wrong type
+	 * for BIT.
+	 * 
+	 * @throws Exception if the test fails.
+	 */
+	public void testBug15854() throws Exception {
+		if (versionMeetsMinimum(5, 0)) {
+			createTable("testBug15854", "(field1 BIT)");
+			try {
+				this.rs = this.conn.getMetaData().getColumns(
+						this.conn.getCatalog(), null, "testBug15854", "field1");
+				assertTrue(this.rs.next());
+				assertEquals(Types.BIT, this.rs.getInt("DATA_TYPE"));
+			} finally {
+				if (this.rs != null) {
+					ResultSet toClose = this.rs;
+					this.rs = null;
+					toClose.close();
+				}
+			}
+			
+		}
+	}
 }

Thread
Connector/J commit: r4724 - in branches/branch_5_0/connector-j: . src/com/mysql/jdbc src/testsuite/regressionmmatthews21 Dec