List:Commits« Previous MessageNext Message »
From:mmatthews Date:August 30 2007 10:52pm
Subject:Connector/J commit: r6535 - in trunk: . connector-j connector-j/src/com/mysql/jdbc
View as plain text  
Modified:
   trunk/
   trunk/connector-j/CHANGES
   trunk/connector-j/src/com/mysql/jdbc/DatabaseMetaData.java
Log:
Merged revisions 6529-6530,6532-6534 via svnmerge from 
svn+ssh://mmatthews@stripped/connectors-svnroot/connector-j/branches/branch_5_0

.......
  r6534 | mmatthews | 2007-08-30 15:46:47 -0500 (Thu, 30 Aug 2007) | 3 lines
  
  Fixed BUG#28972, DatabaseMetaData.getTypeInfo() for the types DECIMAL
  
        and NUMERIC will return a precision of 254 for server versions older than
  
        5.0.3, 64 for versions 5.0.3-5.0.5 and 65 for versions newer than 5.0.5.
.......



Property changes on: trunk
___________________________________________________________________
Name: svnmerge-integrated
   - /branches/branch_5_0:1-6528,6531 /branches/branch_5_1:1-6517
   + /branches/branch_5_0:1-6534 /branches/branch_5_1:1-6517

Modified: trunk/connector-j/CHANGES
===================================================================
--- trunk/connector-j/CHANGES	2007-08-30 20:46:47 UTC (rev 6534)
+++ trunk/connector-j/CHANGES	2007-08-30 20:52:15 UTC (rev 6535)
@@ -205,6 +205,10 @@
       subqueries and functions were indistinguishable from each other, 
       leading to type-related bugs.
 
+    - Fixed BUG#28972, DatabaseMetaData.getTypeInfo() for the types DECIMAL
+      and NUMERIC will return a precision of 254 for server versions older than
+      5.0.3, 64 for versions 5.0.3-5.0.5 and 65 for versions newer than 5.0.5.
+       
 07-19-07 - Version 5.0.7
 
     - Setting the configuration parameter "useCursorFetch" to "true" for

Modified: trunk/connector-j/src/com/mysql/jdbc/DatabaseMetaData.java
===================================================================
--- trunk/connector-j/src/com/mysql/jdbc/DatabaseMetaData.java	2007-08-30 20:46:47 UTC
(rev 6534)
+++ trunk/connector-j/src/com/mysql/jdbc/DatabaseMetaData.java	2007-08-30 20:52:15 UTC
(rev 6535)
@@ -5705,6 +5705,18 @@
 		rowVal[17] = s2b("10"); // NUM_PREC_RADIX (2 or 10)
 		tuples.add(new ByteArrayRow(rowVal));
 
+		// The maximum number of digits for DECIMAL or NUMERIC is 65 (64 from MySQL 5.0.3 to
5.0.5). 
+		
+		int decimalPrecision = 254;
+		
+		if (this.conn.versionMeetsMinimum(5,0,3)) {
+			if (this.conn.versionMeetsMinimum(5, 0, 6)) {
+				decimalPrecision = 65;
+			} else {
+				decimalPrecision = 64;
+			}
+		}
+		
 		/*
 		 * MySQL Type: NUMERIC (silently converted to DECIMAL) JDBC Type:
 		 * NUMERIC
@@ -5714,7 +5726,7 @@
 		rowVal[1] = Integer.toString(java.sql.Types.NUMERIC).getBytes();
 
 		// JDBC Data type
-		rowVal[2] = s2b("17"); // Precision
+		rowVal[2] = s2b(String.valueOf(decimalPrecision)); // Precision
 		rowVal[3] = s2b(""); // Literal Prefix
 		rowVal[4] = s2b(""); // Literal Suffix
 		rowVal[5] = s2b("[(M[,D])] [ZEROFILL]"); // Create Params
@@ -5746,7 +5758,7 @@
 		rowVal[1] = Integer.toString(java.sql.Types.DECIMAL).getBytes();
 
 		// JDBC Data type
-		rowVal[2] = s2b("17"); // Precision
+		rowVal[2] = s2b(String.valueOf(decimalPrecision)); // Precision
 		rowVal[3] = s2b(""); // Literal Prefix
 		rowVal[4] = s2b(""); // Literal Suffix
 		rowVal[5] = s2b("[(M[,D])] [ZEROFILL]"); // Create Params

Thread
Connector/J commit: r6535 - in trunk: . connector-j connector-j/src/com/mysql/jdbcmmatthews30 Aug