List:Commits« Previous MessageNext Message »
From:mmatthews Date:August 30 2007 10:56pm
Subject:Connector/J commit: r6536 - in branches/branch_5_1: . connector-j connector-j/src/com/mysql/jdbc
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/DatabaseMetaData.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-6531,6533-6535
via svnmerge from 
svn+ssh://mmatthews@stripped/connectors-svnroot/connector-j/trunk

...............
  r6535 | mmatthews | 2007-08-30 15:52:15 -0500 (Thu, 30 Aug 2007) | 13 lines
  
  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: 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-6532
   +
/trunk:1-6396,6398-6402,6405-6407,6414-6473,6475,6477,6480,6483-6486,6489-6492,6496-6500,6509-6511,6513,6517-6518,6521-6535

Modified: branches/branch_5_1/connector-j/CHANGES
===================================================================
--- branches/branch_5_1/connector-j/CHANGES	2007-08-30 20:52:15 UTC (rev 6535)
+++ branches/branch_5_1/connector-j/CHANGES	2007-08-30 20:56:36 UTC (rev 6536)
@@ -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: branches/branch_5_1/connector-j/src/com/mysql/jdbc/DatabaseMetaData.java
===================================================================
--- branches/branch_5_1/connector-j/src/com/mysql/jdbc/DatabaseMetaData.java	2007-08-30
20:52:15 UTC (rev 6535)
+++ branches/branch_5_1/connector-j/src/com/mysql/jdbc/DatabaseMetaData.java	2007-08-30
20:56:36 UTC (rev 6536)
@@ -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: r6536 - in branches/branch_5_1: . connector-j connector-j/src/com/mysql/jdbcmmatthews30 Aug