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

Modified: branches/branch_3_1/connector-j/CHANGES
===================================================================
--- branches/branch_3_1/connector-j/CHANGES	2005-12-20 23:17:40 UTC (rev 4722)
+++ branches/branch_3_1/connector-j/CHANGES	2005-12-20 23:26:10 UTC (rev 4723)
@@ -20,6 +20,8 @@
       
     - 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_3_1/connector-j/src/com/mysql/jdbc/MysqlDefs.java
===================================================================
--- branches/branch_3_1/connector-j/src/com/mysql/jdbc/MysqlDefs.java	2005-12-20 23:17:40 UTC (rev 4722)
+++ branches/branch_3_1/connector-j/src/com/mysql/jdbc/MysqlDefs.java	2005-12-20 23:26:10 UTC (rev 4723)
@@ -381,6 +381,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_3_1/connector-j/src/testsuite/regression/MetaDataRegressionTest.java
===================================================================
--- branches/branch_3_1/connector-j/src/testsuite/regression/MetaDataRegressionTest.java	2005-12-20 23:17:40 UTC (rev 4722)
+++ branches/branch_3_1/connector-j/src/testsuite/regression/MetaDataRegressionTest.java	2005-12-20 23:26:10 UTC (rev 4723)
@@ -1414,6 +1414,30 @@
 		}
 	}
 	
+	/** 
+	 * 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();
+				}
+			}
+			
+		}
+	}
 	private void checkRsmdForBug13277(ResultSetMetaData rsmd) throws SQLException {
 		assertEquals(17, rsmd.getColumnDisplaySize(1));
 		

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