List:Commits« Previous MessageNext Message »
From:mmatthews Date:August 30 2007 5:52pm
Subject:Connector/J commit: r6533 - in branches/branch_5_1: . connector-j connector-j/src/com/mysql/jdbc connector-j/src/testsuite/regression
View as plain text  
Modified:
   branches/branch_5_1/
   branches/branch_5_1/connector-j/CHANGES
   branches/branch_5_1/connector-j/src/com/mysql/jdbc/Field.java
   branches/branch_5_1/connector-j/src/testsuite/regression/ResultSetRegressionTest.java
Log:
Merged revisions
6398-6402,6405-6407,6414-6473,6475,6477,6480,6483-6486,6489-6492,6496-6500,6509-6511,6513,6517-6518,6521-6522,6524,6526-6528,6530-6532
via svnmerge from 
svn+ssh://mmatthews@stripped/connectors-svnroot/connector-j/trunk

...............
  r6532 | mmatthews | 2007-08-30 10:32:10 -0500 (Thu, 30 Aug 2007) | 17 lines
  
  Merged revisions 6531 via svnmerge from 
 
svn+ssh://mmatthews@stripped/connectors-svnroot/connector-j/branches/branch_5_0
  
  ........
    r6531 | mmatthews | 2007-08-30 10:21:06 -0500 (Thu, 30 Aug 2007) | 5 lines
    
    Fixed BUG#30664. Note that this fix only works for MySQL server 
    
          versions 5.0.25 and newer, since earlier versions didn't consistently 
    
          return correct metadata for functions, and thus results from 
    
          subqueries and functions were indistinguishable from each other, 
    
          leading to type-related bugs.
  ........
...............



Property changes on: branches/branch_5_1
___________________________________________________________________
Name: svnmerge-integrated
   -
/trunk:1-6396,6398-6402,6405-6407,6414-6473,6475,6477,6480,6483-6486,6489-6492,6496-6500,6509-6511,6513,6517-6518,6521-6529
   +
/trunk:1-6396,6398-6402,6405-6407,6414-6473,6475,6477,6480,6483-6486,6489-6492,6496-6500,6509-6511,6513,6517-6518,6521-6532

Modified: branches/branch_5_1/connector-j/CHANGES
===================================================================
--- branches/branch_5_1/connector-j/CHANGES	2007-08-30 15:32:10 UTC (rev 6532)
+++ branches/branch_5_1/connector-j/CHANGES	2007-08-30 15:52:01 UTC (rev 6533)
@@ -199,6 +199,12 @@
     - Fixed BUG#29106 - Connection checker for JBoss didn't use same method parameters
       via reflection, causing connections to always seem "bad".
       
+    - Fixed BUG#30664. Note that this fix only works for MySQL server 
+      versions 5.0.25 and newer, since earlier versions didn't consistently 
+      return correct metadata for functions, and thus results from 
+      subqueries and functions were indistinguishable from each other, 
+      leading to type-related bugs.
+
 07-19-07 - Version 5.0.7
 
     - Setting the configuration parameter "useCursorFetch" to "true" for

Modified: branches/branch_5_1/connector-j/src/com/mysql/jdbc/Field.java
===================================================================
--- branches/branch_5_1/connector-j/src/com/mysql/jdbc/Field.java	2007-08-30 15:32:10 UTC
(rev 6532)
+++ branches/branch_5_1/connector-j/src/com/mysql/jdbc/Field.java	2007-08-30 15:52:01 UTC
(rev 6533)
@@ -827,7 +827,8 @@
 				&& (this.getMysqlType() == MysqlDefs.FIELD_TYPE_STRING ||
 				this.getMysqlType() == MysqlDefs.FIELD_TYPE_VAR_STRING)) {
 
-			if (this.originalTableNameLength == 0) {
+			if (this.originalTableNameLength == 0 && (
+					this.connection != null && !this.connection.versionMeetsMinimum(5, 0, 25)))
{
 				return false; // Probably from function
 			}
 

Modified:
branches/branch_5_1/connector-j/src/testsuite/regression/ResultSetRegressionTest.java
===================================================================
---
branches/branch_5_1/connector-j/src/testsuite/regression/ResultSetRegressionTest.java	2007-08-30
15:32:10 UTC (rev 6532)
+++
branches/branch_5_1/connector-j/src/testsuite/regression/ResultSetRegressionTest.java	2007-08-30
15:52:01 UTC (rev 6533)
@@ -4397,4 +4397,47 @@
         this.rs.next();
         assertEquals("java.lang.String", this.rs.getObject(1).getClass().getName());
 	}
-}
\ No newline at end of file
+	
+	/**
+	 * Tests fix for BUG#30664. Note that this fix only works
+	 * for MySQL server 5.0.25 and newer, since earlier versions
+	 * didn't consistently return correct metadata for functions,
+	 * and thus results from subqueries and functions were indistinguishable
+	 * from each other, leading to type-related bugs.
+	 * 
+	 * @throws Exception
+	 */
+	public void testBug30664() throws Exception {
+		if (!versionMeetsMinimum(5, 0, 25)) {
+			return;
+		}
+		
+		createTable("testBug30664_1", "(id int)");
+		createTable("testBug30664_2", "(id int, binaryvalue varbinary(10))");
+
+		try {
+			this.stmt
+					.executeUpdate("insert into testBug30664_1 values (1),(2),(3)");
+			this.stmt
+					.executeUpdate("insert into testBug30664_2 values (1,'+			this.rs = this.stmt
+					.executeQuery("select testBug30664_1.id, (select testBug30664_2.binaryvalue from
testBug30664_2 where testBug30664_2.id=testBug30664_1.id) as value from testBug30664_1");
+			ResultSetMetaData tblMD = this.rs.getMetaData();
+
+			for (int i = 1; i < tblMD.getColumnCount() + 1; i++) {
+				switch (i) {
+				case 1:
+					assertEquals("INTEGER", tblMD.getColumnTypeName(i)
+							.toUpperCase());
+					break;
+				case 2:
+					assertEquals("VARBINARY", tblMD.getColumnTypeName(i)
+							.toUpperCase());
+					break;
+				}
+			}
+		} finally {
+			closeMemberJDBCResources();
+		}
+	}	
+}

Thread
Connector/J commit: r6533 - in branches/branch_5_1: . connector-j connector-j/src/com/mysql/jdbc connector-j/src/testsuite/regressionmmatthews30 Aug