db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1445591 - in /db/derby/code/trunk/java: client/org/apache/derby/client/am/ engine/org/apache/derby/iapi/reference/ engine/org/apache/derby/impl/jdbc/ testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/
Date Wed, 13 Feb 2013 13:40:29 GMT
Author: rhillegas
Date: Wed Feb 13 13:40:29 2013
New Revision: 1445591

URL: http://svn.apache.org/r1445591
Log:
DERBY-6000: Make DatabaseMetaData.getMaxLogicalLobSize() return the value which means unknown.

Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/am/DatabaseMetaData.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/Limits.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/DatabaseMetaData.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/DatabaseMetaData.java?rev=1445591&r1=1445590&r2=1445591&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/DatabaseMetaData.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/DatabaseMetaData.java Wed Feb
13 13:40:29 2013
@@ -2888,8 +2888,8 @@ public abstract class DatabaseMetaData i
 
     // ------------------- JDBC 4.2 -------------------------
 
-    /** See DatabaseMetaData javadoc and Limits.DB2_LOB_MAXWIDTH */
-    public  long getMaxLogicalLobSize() { return ((long) Integer.MAX_VALUE) * 2; }
+    /** See DatabaseMetaData javadoc */
+    public  long getMaxLogicalLobSize() { return 0L; }
 
     /** Derby does not support the Types.REF_CURSOR type. */
     public boolean supportsRefCursors() { return false; }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/Limits.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/Limits.java?rev=1445591&r1=1445590&r2=1445591&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/Limits.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/Limits.java Wed Feb 13
13:40:29 2013
@@ -57,7 +57,7 @@ public interface Limits
 
 	public static final int	DB2_CHAR_MAXWIDTH = 254;
 	public static final int	DB2_VARCHAR_MAXWIDTH = 32672;
-	public static final int DB2_LOB_MAXWIDTH = 2147483647; // If you change this value, consider
whether you need to change DatabaseMetaData.getMaxLogicalLobSize().
+	public static final int DB2_LOB_MAXWIDTH = 2147483647;
 	public static final int	DB2_LONGVARCHAR_MAXWIDTH = 32700;
     public static final int DB2_CONCAT_VARCHAR_LENGTH = 4000;
 	public static final int DB2_MAX_FLOATINGPOINT_LITERAL_LENGTH = 30; // note, this value 30
is also contained in err msg 42820

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java?rev=1445591&r1=1445590&r2=1445591&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
Wed Feb 13 13:40:29 2013
@@ -1225,15 +1225,14 @@ public class EmbedDatabaseMetaData exten
      * Added in JDBC 4.2.
      *
      * What's the maximum length of Derby LOB? This
-     * is the maximum number of bytes in a LOB. Since a
-     * CLOB can have DB2_LOB_MAXWIDTH characters, the
-     * maximum number of bytes is 2 * DB2_LOB_MAXWIDTH.
-     * If you change this value, consider whether you need to change
-     * DatabaseMetaData.getMaxLogicalLobSize().
+     * is the maximum number of bytes in a LOB. We return the
+     * default value of 0, which means "unknown". The maximum size
+     * of a CLOB is a complicated because it depends on how many
+     * bytes are needed to encode its string value on disk.
      *
      * @return max index length in bytes
      */
-	public long getMaxLogicalLobSize() { return ((long) Limits.DB2_LOB_MAXWIDTH) * 2; }
+	public long getMaxLogicalLobSize() { return 0L; }
 
     /**
      * What's the maximum length allowed for a schema name?

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java?rev=1445591&r1=1445590&r2=1445591&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java
Wed Feb 13 13:40:29 2013
@@ -5029,7 +5029,7 @@ public class DatabaseMetaDataTest extend
         //
         // getMaxLogicalLobSize()
         //
-        assertEquals( ((long) Integer.MAX_VALUE) * 2, wrapper.getMaxLogicalLobSize() );
+        assertEquals( 0L, wrapper.getMaxLogicalLobSize() );
 
         //
         // supportsRefCursors()



Mime
View raw message