id
stringlengths
22
25
commit_message
stringlengths
137
6.96k
diffs
listlengths
0
63
derby-DERBY-1517-6c1fe080
DERBY-1756 patch Derby1756.2.diff.txt contributed by Sunitha Kambhampati with derby-962 changes, if client jvm supports EUSRIDPWD then the client would use EUSRIDPWD as the security mechanism. But it is possible that the server jvm might not support EUSRIDPWD and the connection can fail. When DERBY-1517, DERBY-1755 is fixed, there might be a way to use EUSRIDPWD when both client and server vm's have support for it. This patch does the following: o Do not use EUSRIDPWD as the default security mechanism even if the client vm can support it. o Fix comments in testSecMec.java. o Existing tests in testSecMec.java cover this codepath and the master file output reflects the changes made. Note, only the ibm14 client master file has changed since only ibm141 and greater jvms come with jce that can support eusridpwd. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@439775 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/client/org/apache/derby/jdbc/ClientBaseDataSource.java", "hunks": [ { "added": [ " * 2. if password is available,then USRIDPWD is returned." ], "header": "@@ -277,10 +277,7 @@ public abstract class ClientBaseDataSource implements Serializable, Referenceabl", "removed": [ " * 2. if password is available, if client supports EUSRIDPWD, then EUSRIDPWD is ", " * returned", " * 3. if password is available, if client does not support EUSRIDPWD, then", " * USRIDPWD is returned." ] }, { "added": [ " /*", " // -----------------------", " // PLEASE NOTE: ", " // When DERBY-1517, DERBY-1755 is fixed, there might be a way to use EUSRIDPWD ", " // when both client and server vm's have support for it. Hence the below", " // if statement is commented out." ], "header": "@@ -291,14 +288,16 @@ public abstract class ClientBaseDataSource implements Serializable, Referenceabl", "removed": [ " // if password is available, then a security mechanism is picked in", " // following order if support is available.", " // 1. EUSRIDPWD", " // 2. USRIDPWD" ] } ] } ]
derby-DERBY-1519-faf6742e
DERBY-1519: 'setAsciiStream' uses different encodings for embedded and client. Client changed to use ISO-8859-1 to comply with JDBC and the embedded driver. This change can cause incompatibilities for certain applications (see release notes). Patch file: derby-1519-1a.diff git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@544424 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/client/org/apache/derby/client/am/Clob.java", "hunks": [ { "added": [ " //\"ISO-8859-1\", \"UTF-8\", or \"UnicodeBigUnmarked\"" ], "header": "@@ -100,7 +100,7 @@ public class Clob extends Lob implements java.sql.Clob {", "removed": [ " //\"US-ASCII\", \"UTF-8\", or \"UnicodeBigUnmarked\"" ] }, { "added": [ " if (encoding.equals(\"ISO-8859-1\")) {" ], "header": "@@ -111,7 +111,7 @@ public class Clob extends Lob implements java.sql.Clob {", "removed": [ " if (encoding.equals(\"US-ASCII\")) {" ] }, { "added": [ " * @param encoding encoding to use for characters. Only \"ISO-8859-1\" is" ], "header": "@@ -141,7 +141,7 @@ public class Clob extends Lob implements java.sql.Clob {", "removed": [ " * @param encoding encoding to use for characters. Only \"US-ASCII\" is" ] }, { "added": [ " if (encoding.equals(\"ISO-8859-1\")) {" ], "header": "@@ -150,7 +150,7 @@ public class Clob extends Lob implements java.sql.Clob {", "removed": [ " if (encoding.equals(\"US-ASCII\")) {" ] } ] }, { "file": "java/client/org/apache/derby/client/am/Cursor.java", "hunks": [ { "added": [ " return new java.io.ByteArrayInputStream(getCHAR(column).getBytes(\"ISO-8859-1\"));" ], "header": "@@ -1041,7 +1041,7 @@ public abstract class Cursor {", "removed": [ " return new java.io.ByteArrayInputStream(getCHAR(column).getBytes(\"US-ASCII\"));" ] } ] }, { "file": "java/client/org/apache/derby/client/am/PreparedStatement.java", "hunks": [ { "added": [ " setInput(parameterIndex, new Clob(agent_, x, \"ISO-8859-1\", (int)length));" ], "header": "@@ -1095,7 +1095,7 @@ public class PreparedStatement extends Statement", "removed": [ " setInput(parameterIndex, new Clob(agent_, x, \"US-ASCII\", (int)length));" ] } ] }, { "file": "java/client/org/apache/derby/client/am/ResultSet.java", "hunks": [ { "added": [ " updateColumn(column, agent_.crossConverters_.setObjectFromCharacterStream(resultSetMetaData_.types_[column - 1], x, \"ISO-8859-1\", length));" ], "header": "@@ -3040,7 +3040,7 @@ public abstract class ResultSet implements java.sql.ResultSet,", "removed": [ " updateColumn(column, agent_.crossConverters_.setObjectFromCharacterStream(resultSetMetaData_.types_[column - 1], x, \"US-ASCII\", length));" ] }, { "added": [ " \"ISO-8859-1\"," ], "header": "@@ -5563,7 +5563,7 @@ public abstract class ResultSet implements java.sql.ResultSet,", "removed": [ " \"US-ASCII\"," ] } ] } ]
derby-DERBY-1521-145baeed
DERBY-1521 Attaching a patch 'd1521-patch1-v1.diff' which modifies UpgradeTester to test the grant/revoke feature. This is a preliminary patch which tests the default upgrade behaviour: In upgrades from versions earlier than 10.2, * grant/revoke feature is not available in soft upgrade * grant/revoke feature is not available in full upgrade (by default). This feature will be available after full upgrade only if "derby.database.sqlAuthorization" is true. Patch contributed by Deepa Remesh git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@425846 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1521-fee30aa2
DERBY-1521 Patch which sets "derby.database.sqlAuthorization" for an upgraded database and tests that grant/revoke is available. Patch submitted by Deepa Remesh git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@428160 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1522-f05a2f83
DERBY-1522 contributed by Deepa Remesh, [email protected] Attaching a patch 'derby1522_v2.diff. It includes a JUnit test for testing the switch to SQL standard authorization. It tests following: 1. grant/revoke is not available if derby.database.sqlAuthorization property is not set. 2. grant/revoke is available when derby.database.sqlAuthorization is set to true. 3. Once derby.database.sqlAuthorization is set to true, it cannot be set to any other value. This patch also modifies DatabasePropertyTestSetup.tearDown method. The tearDown method resets the property values to old values. It will now ignore exceptions when property reset is not supported. I am including this small change in the above patch. (I had opened DERBY-1827 for the issue with tearDown method. ). I am using TestUtil.getConnection method to shutdown the database. I have opened DERBY-1826 to add methods to Derby's JUnit classes for shutdown. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@441584 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/junit/DatabasePropertyTestSetup.java", "hunks": [ { "added": [ "import org.apache.derbyTesting.functionTests.util.SQLStateConstants;", "" ], "header": "@@ -29,6 +29,8 @@ import java.util.Properties;", "removed": [] }, { "added": [ " \t// that will not be reset by the old set. Ignore any ", " // invalid property values.", " try {", " \tfor (Enumeration e = newValues.propertyNames(); e.hasMoreElements();)", " \t{", " \t\tString key = (String) e.nextElement();", " \t\tif (oldValues.getProperty(key) == null)", " \t\t{", " \t\t\tsetDBP.setString(1, key);", " \t\t\tsetDBP.executeUpdate();", " \t\t}", " \t}", " } catch (SQLException sqle) {", " \tif(!sqle.getSQLState().equals(SQLStateConstants.PROPERTY_UNSUPPORTED_CHANGE))", " \t\tthrow sqle;" ], "header": "@@ -75,15 +77,21 @@ public class DatabasePropertyTestSetup extends BaseJDBCTestSetup {", "removed": [ " \t// that will not be reset by the old set.", " \tfor (Enumeration e = newValues.propertyNames(); e.hasMoreElements();)", " \t{", " \t\tString key = (String) e.nextElement();", " \t\tif (oldValues.getProperty(key) == null)", " {", " setDBP.setString(1, key);", " setDBP.executeUpdate();", " }" ] } ] } ]
derby-DERBY-1527-d45f7d3f
DERBY-1527: Factor out type checks in EmbedResultSet and EmbedPreparedStatement git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@423912 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java", "hunks": [ { "added": [ " checkAsciiStreamConditions(parameterIndex);" ], "header": "@@ -567,8 +567,7 @@ public abstract class EmbedPreparedStatement", "removed": [ " checkCharacterStreamConditions(parameterIndex,", " \"java.io.InputStream(ASCII)\");" ] }, { "added": [ " checkCharacterStreamConditions(parameterIndex);" ], "header": "@@ -635,7 +634,7 @@ public abstract class EmbedPreparedStatement", "removed": [ " checkCharacterStreamConditions(parameterIndex, \"java.io.Reader\");" ] }, { "added": [ " * Check general preconditions for setCharacterStream methods.", " private final void checkCharacterStreamConditions(int parameterIndex)", " if (!DataTypeDescriptor.isCharacterStreamAssignable(jdbcTypeId)) {", " throw dataTypeConversion(parameterIndex, \"java.io.Reader\");", " }", " }", "", " /**", " * Check general preconditions for setAsciiStream methods.", " *", " * @param parameterIndex 1-based index of the parameter.", " */", " private final void checkAsciiStreamConditions(int parameterIndex)", " throws SQLException {", " checkStatus();", " int jdbcTypeId = getParameterJDBCType(parameterIndex);", " if (!DataTypeDescriptor.isAsciiStreamAssignable(jdbcTypeId)) {", " throw dataTypeConversion(parameterIndex,", " \"java.io.InputStream(ASCII)\");" ], "header": "@@ -662,26 +661,31 @@ public abstract class EmbedPreparedStatement", "removed": [ " * Check general (pre)conditions for setXXXStream methods operating on", " * character streams.", " * @param srcDataTypeDesc type description of the source data. Used in", " * error message for data type conversion failure.", " private final void checkCharacterStreamConditions(int parameterIndex,", " String srcDataTypeDesc)", " switch (jdbcTypeId) {", " case Types.CHAR:", " case Types.VARCHAR:", " case Types.LONGVARCHAR:", " case Types.CLOB:", " break;", " default:", " throw dataTypeConversion(parameterIndex, srcDataTypeDesc);" ] }, { "added": [ " * Check general preconditions for setBinaryStream methods." ], "header": "@@ -907,8 +911,7 @@ public abstract class EmbedPreparedStatement", "removed": [ " * Check general (pre)conditions for setXXXStream methods operating on", " * binary streams." ] }, { "added": [ " if (!DataTypeDescriptor.isBinaryStreamAssignable(jdbcTypeId)) {" ], "header": "@@ -916,13 +919,7 @@ public abstract class EmbedPreparedStatement", "removed": [ " switch (jdbcTypeId) {", " case Types.BINARY:", " case Types.VARBINARY:", " case Types.LONGVARBINARY:", " case Types.BLOB:", " break;", " default:" ] }, { "added": [ " checkAsciiStreamConditions(parameterIndex);" ], "header": "@@ -1723,8 +1720,7 @@ public abstract class EmbedPreparedStatement", "removed": [ " checkCharacterStreamConditions(parameterIndex,", " \"java.io.InputStream(ASCII)\");" ] } ] }, { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.types.DataTypeDescriptor;" ], "header": "@@ -39,6 +39,7 @@ import org.apache.derby.impl.sql.execute.ScrollInsensitiveResultSet;", "removed": [] }, { "added": [ " /**", " * Check whether it is OK to update a column using", " * <code>updateAsciiStream()</code>.", " *", " * @param columnIndex the column index (first column is 1)", " * @exception SQLException if the column could not be updated with", " * <code>updateAsciiStream()</code>", " */", " private void checksBeforeUpdateAsciiStream(int columnIndex)", " throws SQLException", " {", " checksBeforeUpdateXXX(\"updateAsciiStream\", columnIndex);", " int colType = getColumnType(columnIndex);", " if (!DataTypeDescriptor.isAsciiStreamAssignable(colType)) {", " throw dataTypeConversion(columnIndex, \"java.io.InputStream\");", " }", " }", "", " /**", " * Check whether it is OK to update a column using", " * <code>updateBinaryStream()</code>.", " *", " * @param columnIndex the column index (first column is 1)", " * @exception SQLException if the column could not be updated with", " * <code>updateBinaryStream()</code>", " */", " private void checksBeforeUpdateBinaryStream(int columnIndex)", " throws SQLException", " {", " checksBeforeUpdateXXX(\"updateBinaryStream\", columnIndex);", " int colType = getColumnType(columnIndex);", " if (!DataTypeDescriptor.isBinaryStreamAssignable(colType)) {", " throw dataTypeConversion(columnIndex, \"java.io.InputStream\");", " }", " }", "", " /**", " * Check whether it is OK to update a column using", " * <code>updateCharacterStream()</code>.", " *", " * @param columnIndex the column index (first column is 1)", " * @exception SQLException if the column could not be updated with", " * <code>updateCharacterStream()</code>", " */", " private void checksBeforeUpdateCharacterStream(int columnIndex)", " throws SQLException", " {", " checksBeforeUpdateXXX(\"updateCharacterStream\", columnIndex);", " int colType = getColumnType(columnIndex);", " if (!DataTypeDescriptor.isCharacterStreamAssignable(colType)) {", " throw dataTypeConversion(columnIndex, \"java.io.Reader\");", " }", " }" ], "header": "@@ -2316,6 +2317,59 @@ public abstract class EmbedResultSet extends ConnectionChild", "removed": [] }, { "added": [ "\t\tchecksBeforeUpdateAsciiStream(columnIndex);" ], "header": "@@ -2663,18 +2717,7 @@ public abstract class EmbedResultSet extends ConnectionChild", "removed": [ "\t\tchecksBeforeUpdateXXX(\"updateAsciiStream\", columnIndex);", "", "\t\tint colType = getColumnType(columnIndex);", "\t\tswitch (colType) {", "\t\t\tcase Types.CHAR:", "\t\t\tcase Types.VARCHAR:", "\t\t\tcase Types.LONGVARCHAR:", "\t\t\tcase Types.CLOB:", "\t\t\t\tbreak;", "\t\t\tdefault:", "\t\t\t\tthrow dataTypeConversion(columnIndex, \"java.io.InputStream\");", "\t\t}" ] }, { "added": [ " checksBeforeUpdateAsciiStream(columnIndex);" ], "header": "@@ -2708,18 +2751,7 @@ public abstract class EmbedResultSet extends ConnectionChild", "removed": [ " checksBeforeUpdateXXX(\"updateAsciiStream\", columnIndex);", "", " int colType = getColumnType(columnIndex);", " switch (colType) {", " case Types.CHAR:", " case Types.VARCHAR:", " case Types.LONGVARCHAR:", " case Types.CLOB:", " break;", " default:", " throw dataTypeConversion(columnIndex, \"java.io.InputStream\");", " }" ] }, { "added": [ "\t\tchecksBeforeUpdateBinaryStream(columnIndex);" ], "header": "@@ -2753,17 +2785,7 @@ public abstract class EmbedResultSet extends ConnectionChild", "removed": [ "\t\tchecksBeforeUpdateXXX(\"updateBinaryStream\", columnIndex);", "\t\tint colType = getColumnType(columnIndex);", "\t\tswitch (colType) {", "\t\t\tcase Types.BINARY:", "\t\t\tcase Types.VARBINARY:", "\t\t\tcase Types.LONGVARBINARY:", "\t\t\tcase Types.BLOB:", "\t\t\t\tbreak;", "\t\t\tdefault:", "\t\t\t\tthrow dataTypeConversion(columnIndex, \"java.io.InputStream\");", "\t\t}" ] }, { "added": [ " checksBeforeUpdateBinaryStream(columnIndex);" ], "header": "@@ -2794,17 +2816,7 @@ public abstract class EmbedResultSet extends ConnectionChild", "removed": [ " checksBeforeUpdateXXX(\"updateBinaryStream\", columnIndex);", " int colType = getColumnType(columnIndex);", " switch (colType) {", " case Types.BINARY:", " case Types.VARBINARY:", " case Types.LONGVARBINARY:", " case Types.BLOB:", " break;", " default:", " throw dataTypeConversion(columnIndex, \"java.io.InputStream\");", " }" ] }, { "added": [ "\t\tchecksBeforeUpdateCharacterStream(columnIndex);" ], "header": "@@ -2878,20 +2890,7 @@ public abstract class EmbedResultSet extends ConnectionChild", "removed": [ "\t\t//If the column type is the right datatype, this method will eventually call getDVDforColumnToBeUpdated which will check for", "\t\t//the read only resultset. But for other datatypes, we want to catch if this updateCharacterStream is being issued", "\t\t//against a read only resultset. And that is the reason for call to checksBeforeUpdateXXX here.", "\t\tchecksBeforeUpdateXXX(\"updateCharacterStream\", columnIndex);", "\t\tint colType = getColumnType(columnIndex);", "\t\tswitch (colType) {", "\t\t\tcase Types.CHAR:", "\t\t\tcase Types.VARCHAR:", "\t\t\tcase Types.LONGVARCHAR:", "\t\t\tcase Types.CLOB:", "\t\t\t\tbreak;", "\t\t\tdefault:", "\t\t\t\tthrow dataTypeConversion(columnIndex, \"java.io.Reader\");", "\t\t}" ] }, { "added": [ " checksBeforeUpdateCharacterStream(columnIndex);" ], "header": "@@ -2915,17 +2914,7 @@ public abstract class EmbedResultSet extends ConnectionChild", "removed": [ " checksBeforeUpdateXXX(\"updateCharacterStream\", columnIndex);", " int colType = getColumnType(columnIndex);", " switch (colType) {", " case Types.CHAR:", " case Types.VARCHAR:", " case Types.LONGVARCHAR:", " case Types.CLOB:", " break;", " default:", " throw dataTypeConversion(columnIndex, \"java.io.Reader\");", " }" ] } ] } ]
derby-DERBY-153-86be8370
DERBY-153: Fix Eclipse plugin version specification. Committed for Rajesh Kartha <[email protected]> git-svn-id: https://svn.apache.org/repos/asf/incubator/derby/code/trunk@161100 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/build/org/apache/derbyBuild/eclipse/DerbyEclipsePlugin.java", "hunks": [ { "added": [ "/*", "", " Derby - Class org.apache.derbyBuild.eclipse.DerbyEclipsePlugin", "", " Copyright 2002, 2004 The Apache Software Foundation or its licensors, as applicable.", "", " Licensed under the Apache License, Version 2.0 (the \"License\");", " you may not use this file except in compliance with the License.", " You may obtain a copy of the License at", "", " http://www.apache.org/licenses/LICENSE-2.0", "", " Unless required by applicable law or agreed to in writing, software", " distributed under the License is distributed on an \"AS IS\" BASIS,", " WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", " See the License for the specific language governing permissions and", " limitations under the License.", "", " */", "", "package org.apache.derbyBuild.eclipse;", "", "import java.util.*;", "import java.io.File;", "import java.io.FileOutputStream;", "import java.io.FileWriter;", "import java.io.InputStream;", "import org.apache.derby.iapi.services.info.ProductGenusNames;", "import org.apache.derby.iapi.services.info.PropertyNames;", "", "/**", " * This class provides the functionality to create the build related", " * related properties, which are used for creating the Derby plug-in", " * for Eclipse by the ANT script.", " *", " * - The Eclipse plugin will be called 'Apache Derby Core Plug-in for Eclipse'", " *", " * - The plugin can be build from the main build.xml using 'ant' with the 'plugin'", " * argument.", " *", " * - The package name for the Derby plug-in will", " * be: org.apache.derby.core_<major>.<minor>.<interim> (example: org.apache.derby.core_10.1.0).", " *", " * - The plugin.xml in the Derby plug-in will show the actual version of the", " * the Derby build (example: 10.1.0.0 (111545M) ). This can be viewed from", " * Help - About Eclipse Platform - Plug-in Details of Eclipse of the Eclipse IDE", " *", " * - The zip file created for the DerbyEclipse under the jars directory will have the name:", " * derby_core_plugin_<major>.<minor>.<interim>.zip (example:derby_core_plugin_10.1.0.zip)", " *", " * - The current packaging includes derby.jar, derbynet.jar and", " * derbytools.jar. The locale jars for Derby are not included yet.", " *", " * @author Rajesh Kartha", " */", "public class DerbyEclipsePlugin{", "\t/*", "\t * Derby plug-in package property and name", "\t */", "\tprivate static String PLUGIN_PKG=\"plugin.derby.core\";", "\tprivate static String PLUGIN_PKG_NAME=\"org.apache.derby.core\";", "\t/*", "\t * Derby plug-in zip file property and name", "\t */", "\tprivate static String PLUGIN_ZIP_FILE=\"plugin.derby.core.zipfile\";", "\tprivate static String PLUGIN_ZIP_FILE_NAME=\"derby_core_plugin\";", "\t/*", "\t * Derby plug-in build properties and name", "\t */", "\tprivate static String PLUGIN_VERSION=\"plugin.derby.version\";", "\tprivate static String PLUGIN_VERSION_BUILD_NUMBER=\"plugin.derby.version.build.number\";", "\tprivate static int MAINT_DIV=1000000;", "", "\t/*", "\t * plugin.xml file information, split into three parts", "\t */", "\tprivate static String part_1=\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\"+", "\t\t\t\t \"<?eclipse version=\\\"3.0\\\"?> \\n\"+", "\t\t\t\t \"<plugin \\n\" +", " \t\t\t\t \"\\t id=\\\"org.apache.derby.core\\\" \\n\" +", " \t\t\t\t \"\\t name=\\\"Apache Derby Core Plug-in for Eclipse\\\" \\n\" +", " \t\t\t\t \"\\t version=\\\"\";", "", "\tprivate static String part_2=\"\\n\\t provider-name=\\\"\";", "\tprivate static String part_3=\"\\n\\t <runtime> \\n\" +", " \t\t\t\t \"\\t\\t <library name=\\\"derby.jar\\\"> \\n\" +", " \t\t\t \"\\t\\t\\t <export name=\\\"*\\\"/> \\n\" +", " \t\t\t\t \"\\t\\t </library> \\n\" +", " \t\t\t\t \"\\t\\t <library name=\\\"derbytools.jar\\\"> \\n\"+", " \t\t\t \"\\t\\t\\t <export name=\\\"*\\\"/> \\n\"+", " \t\t\t\t \"\\t\\t </library> \\n\"+", " \t\t\t\t \"\\t\\t <library name=\\\"derbynet.jar\\\"> \\n\"+", " \t\t\t \"\\t\\t\\t <export name=\\\"*\\\"/> \\n\"+", " \t\t\t\t \"\\t\\t </library> \\n\"+", " \t\t\t\t \"\\t </runtime> \\n\"+", " \t\t\t\t \"\\t <requires> \\n\"+", " \t\t\t\t \"\\t </requires> \\n\"+", " \t\t\t\t \"</plugin>\";", "", "\tprivate String version=\"\";", "\tprivate String tmpPropFile=\"plugintmp.properties\";", "\tprivate static File tmpFileLocation=null;", "\tprivate static Properties tmpProp=new Properties();", "\tprivate String pluginXMLFile=\"plugin.xml\";", "", "\t/*", "\t * The public main() method to test the working of this class. A valid destination", "\t * String is all that is needed as an argument for running this class.", "\t * <p>", "\t * example: java DerbyEclipsePlugin <destination>", "\t * <p>", "\t */", "", "\tpublic static void main(String [] args){", "\t\tif(args.length<=0){", "\t\t\tSystem.out.println(\"Incorrect number of arguments.\");", "\t\t\treturn;", "\t\t}", "\t\ttry{", "\t\t\ttmpFileLocation=new File(args[0]);", "\t\t\tDerbyEclipsePlugin dep = new DerbyEclipsePlugin();", "\t\t\tdep.getProps();", "\t\t\tdep.createTmpFiles();", "\t\t}catch(Exception e)", "\t\t{", "\t\t\te.printStackTrace();", "\t\t}", "", "", "", "", "\t}", "\t/*", "\t * For internal use only.", "\t * getProps() generates the required Properties from the DBMS.properties file.", "\t *", "\t * @exception\tException if there is an error", "\t */", "\tprivate void getProps() throws Exception{", "\t\tInputStream versionStream = getClass().getResourceAsStream(ProductGenusNames.DBMS_INFO);", "\t\tProperties prop=new Properties();", "\t\tprop.load(versionStream);", "", "\t\t//create the tmp Prop file", "\t\ttmpProp.put(PLUGIN_PKG,PLUGIN_PKG_NAME);\t\t\t//package name", "\t\ttmpProp.put(PLUGIN_ZIP_FILE,PLUGIN_ZIP_FILE_NAME);\t//zip file name", "\t\ttmpProp.put(PropertyNames.PRODUCT_VENDOR_NAME,prop.getProperty(PropertyNames.PRODUCT_VENDOR_NAME));", "\t\tint maint=Integer.parseInt(prop.getProperty(PropertyNames.PRODUCT_MAINT_VERSION));", "\t\tversion=prop.getProperty(PropertyNames.PRODUCT_MAJOR_VERSION)+\".\"+prop.getProperty(PropertyNames.PRODUCT_MINOR_VERSION)+\".\"+maint/MAINT_DIV;", "\t\ttmpProp.put(PLUGIN_VERSION,version);", "", "\t\t//With Eclipse 3.1M5a release, adding '(PRODUCT_BUILD_NUMBER)' to the 'version' info in", "\t\t//the plugin.xml creates some issues while loading. It has been removed and only the", "\t\t//MAJOR.Minor.interim.point has been added to the plugin.xml.", "\t\t//The actual Derby build version can be obtained using the 'sysinfo' tool.", "\t\t", "\t\tversion+=\".\"+maint%MAINT_DIV;", "\t\ttmpProp.put(PLUGIN_VERSION_BUILD_NUMBER,version+\" (\"+prop.getProperty(PropertyNames.PRODUCT_BUILD_NUMBER)+\")\");", "", "\t\t//add info to plugin.xml strings", "\t\tpart_1+=version+\"\\\"\";", "\t\tpart_2+=tmpProp.getProperty(PropertyNames.PRODUCT_VENDOR_NAME)+\"\\\">\\n\";", "", "\t}", "\t/*", "\t * For internal use only.", "\t * createTmpFiles() create the temporary files with the build properties at the specified location.", "\t *", "\t * @exception\tException if there is an error", "\t */", "\tprivate void createTmpFiles() throws Exception{", "\t\tFile file=new File(tmpFileLocation.getAbsolutePath()+File.separator+tmpPropFile);", "\t\tFileOutputStream fo=new FileOutputStream(file);", "\t\ttmpProp.store(fo,null);", "\t\tfo.close();", "\t\tfile=new File(tmpFileLocation.getAbsolutePath()+File.separator+pluginXMLFile);", "\t\tFileWriter fw=new FileWriter(file);", "\t\tfw.write(part_1+part_2+part_3);", "\t\tfw.close();", "", "\t}", "}", "" ], "header": "@@ -1,180 +1,183 @@", "removed": [ "/*", "", " Derby - Class org.apache.derbyBuild.eclipse.DerbyEclipsePlugin", "", " Copyright 2002, 2004 The Apache Software Foundation or its licensors, as applicable.", "", " Licensed under the Apache License, Version 2.0 (the \"License\");", " you may not use this file except in compliance with the License.", " You may obtain a copy of the License at", "", " http://www.apache.org/licenses/LICENSE-2.0", "", " Unless required by applicable law or agreed to in writing, software", " distributed under the License is distributed on an \"AS IS\" BASIS,", " WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", " See the License for the specific language governing permissions and", " limitations under the License.", "", " */", "", "package org.apache.derbyBuild.eclipse;", "", "import java.util.*;", "import java.io.File;", "import java.io.FileOutputStream;", "import java.io.FileWriter;", "import java.io.InputStream;", "import org.apache.derby.iapi.services.info.ProductGenusNames;", "import org.apache.derby.iapi.services.info.PropertyNames;", "", "/**", " * This class provides the functionality to create the build related", " * related properties, which are used for creating the Derby plug-in", " * for Eclipse by the ANT script.", " *", " * - The Eclipse plugin will be called 'Apache Derby Core Plug-in for Eclipse'", " *", " * - The plugin can be build from the main build.xml using 'ant' with the 'plugin'", " * argument.", " *", " * - The package name for the Derby plug-in will", " * be: org.apache.derby.core_<major>.<minor>.<interim> (example: org.apache.derby.core_10.1.0).", " *", " * - The plugin.xml in the Derby plug-in will show the actual version of the", " * the Derby build (example: 10.1.0.0 (111545M) ). This can be viewed from", " * Help - About Eclipse Platform - Plug-in Details of Eclipse of the Eclipse IDE", " *", " * - The zip file created for the DerbyEclipse under the jars directory will have the name:", " * derby_core_plugin_<major>.<minor>.<interim>.zip (example:derby_core_plugin_10.1.0.zip)", " *", " * - The current packaging includes derby.jar, derbynet.jar and", " * derbytools.jar. The locale jars for Derby are not included yet.", " *", " * @author Rajesh Kartha", " */", "public class DerbyEclipsePlugin{", "\t/*", "\t * Derby plug-in package property and name", "\t */", "\tprivate static String PLUGIN_PKG=\"plugin.derby.core\";", "\tprivate static String PLUGIN_PKG_NAME=\"org.apache.derby.core\";", "\t/*", "\t * Derby plug-in zip file property and name", "\t */", "\tprivate static String PLUGIN_ZIP_FILE=\"plugin.derby.core.zipfile\";", "\tprivate static String PLUGIN_ZIP_FILE_NAME=\"derby_core_plugin\";", "\t/*", "\t * Derby plug-in build properties and name", "\t */", "\tprivate static String PLUGIN_VERSION=\"plugin.derby.version\";", "\tprivate static String PLUGIN_VERSION_BUILD_NUMBER=\"plugin.derby.version.build.number\";", "\tprivate static int MAINT_DIV=1000000;", "", "\t/*", "\t * plugin.xml file information, split into three parts", "\t */", "\tprivate static String part_1=\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\"+", "\t\t\t\t \"<?eclipse version=\\\"3.0\\\"?> \\n\"+", "\t\t\t\t \"<plugin \\n\" +", " \t\t\t\t \"\\t id=\\\"org.apache.derby.core\\\" \\n\" +", " \t\t\t\t \"\\t name=\\\"Apache Derby Core Plug-in for Eclipse\\\" \\n\" +", " \t\t\t\t \"\\t version=\\\"\";", "", "\tprivate static String part_2=\"\\n\\t provider-name=\\\"\";", "\tprivate static String part_3=\"\\n\\t <runtime> \\n\" +", " \t\t\t\t \"\\t\\t <library name=\\\"derby.jar\\\"> \\n\" +", " \t\t\t \"\\t\\t\\t <export name=\\\"*\\\"/> \\n\" +", " \t\t\t\t \"\\t\\t </library> \\n\" +", " \t\t\t\t \"\\t\\t <library name=\\\"derbytools.jar\\\"> \\n\"+", " \t\t\t \"\\t\\t\\t <export name=\\\"*\\\"/> \\n\"+", " \t\t\t\t \"\\t\\t </library> \\n\"+", " \t\t\t\t \"\\t\\t <library name=\\\"derbynet.jar\\\"> \\n\"+", " \t\t\t \"\\t\\t\\t <export name=\\\"*\\\"/> \\n\"+", " \t\t\t\t \"\\t\\t </library> \\n\"+", " \t\t\t\t \"\\t </runtime> \\n\"+", " \t\t\t\t \"\\t <requires> \\n\"+", " \t\t\t\t \"\\t </requires> \\n\"+", " \t\t\t\t \"</plugin>\";", "", "\tprivate String version=\"\";", "\tprivate String tmpPropFile=\"plugintmp.properties\";", "\tprivate static File tmpFileLocation=null;", "\tprivate static Properties tmpProp=new Properties();", "\tprivate String pluginXMLFile=\"plugin.xml\";", "", "\t/*", "\t * The public main() method to test the working of this class. A valid destination", "\t * String is all that is needed as an argument for running this class.", "\t * <p>", "\t * example: java DerbyEclipsePlugin <destination>", "\t * <p>", "\t */", "", "\tpublic static void main(String [] args){", "\t\tif(args.length<=0){", "\t\t\tSystem.out.println(\"Incorrect number of arguments.\");", "\t\t\treturn;", "\t\t}", "\t\ttry{", "\t\t\ttmpFileLocation=new File(args[0]);", "\t\t\tDerbyEclipsePlugin dep = new DerbyEclipsePlugin();", "\t\t\tdep.getProps();", "\t\t\tdep.createTmpFiles();", "\t\t}catch(Exception e)", "\t\t{", "\t\t\te.printStackTrace();", "\t\t}", "", "", "", "", "\t}", "\t/*", "\t * For internal use only.", "\t * getProps() generates the required Properties from the DBMS.properties file.", "\t *", "\t * @exception\tException if there is an error", "\t */", "\tprivate void getProps() throws Exception{", "\t\tInputStream versionStream = getClass().getResourceAsStream(ProductGenusNames.DBMS_INFO);", "\t\tProperties prop=new Properties();", "\t\tprop.load(versionStream);", "", "\t\t//create the tmp Prop file", "\t\ttmpProp.put(PLUGIN_PKG,PLUGIN_PKG_NAME);\t\t\t//package name", "\t\ttmpProp.put(PLUGIN_ZIP_FILE,PLUGIN_ZIP_FILE_NAME);\t//zip file name", "\t\ttmpProp.put(PropertyNames.PRODUCT_VENDOR_NAME,prop.getProperty(PropertyNames.PRODUCT_VENDOR_NAME));", "\t\tint maint=Integer.parseInt(prop.getProperty(PropertyNames.PRODUCT_MAINT_VERSION));", "\t\tversion=prop.getProperty(PropertyNames.PRODUCT_MAJOR_VERSION)+\".\"+prop.getProperty(PropertyNames.PRODUCT_MINOR_VERSION)+\".\"+maint/MAINT_DIV;", "\t\ttmpProp.put(PLUGIN_VERSION,version);", "", "\t\t//initially thought of using", "\t\t//version+=\".\"+maint%MAINT_DIV+\"_v\"+prop.getProperty(PropertyNames.PRODUCT_BUILD_NUMBER);", "\t\tversion+=\".\"+maint%MAINT_DIV+\" (\"+prop.getProperty(PropertyNames.PRODUCT_BUILD_NUMBER)+\")\";", "\t\ttmpProp.put(PLUGIN_VERSION_BUILD_NUMBER,version);", "", "\t\t//add info to plugin.xml strings", "\t\tpart_1+=version+\"\\\"\";", "\t\tpart_2+=tmpProp.getProperty(PropertyNames.PRODUCT_VENDOR_NAME)+\"\\\">\\n\";", "", "\t}", "\t/*", "\t * For internal use only.", "\t * createTmpFiles() create the temporary files with the build properties at the specified location.", "\t *", "\t * @exception\tException if there is an error", "\t */", "\tprivate void createTmpFiles() throws Exception{", "\t\tFile file=new File(tmpFileLocation.getAbsolutePath()+File.separator+tmpPropFile);", "\t\tFileOutputStream fo=new FileOutputStream(file);", "\t\ttmpProp.store(fo,null);", "\t\tfo.close();", "\t\tfile=new File(tmpFileLocation.getAbsolutePath()+File.separator+pluginXMLFile);", "\t\tFileWriter fw=new FileWriter(file);", "\t\tfw.write(part_1+part_2+part_3);", "\t\tfw.close();", "", "\t}", "}", "" ] } ] } ]
derby-DERBY-1530-ebdced0d
DERBY-1530: Commit derby-1530_v01.diff, aligning Derby with the last JDBC4 signature changes. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@430815 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/client/org/apache/derby/client/am/DatabaseMetaData.java", "hunks": [ { "added": [ " * <code>EmbedDatabaseMetaData.getFunctionColumns(String,String," ], "header": "@@ -1183,7 +1183,7 @@ public abstract class DatabaseMetaData implements java.sql.DatabaseMetaData {", "removed": [ " * <code>EmbedDatabaseMetaData.getFunctionParameters(String,String," ] }, { "added": [ " * @see #getFunctionColumnsX(String, String, String,String)", " getFunctionColumns(String catalog," ], "header": "@@ -1201,12 +1201,12 @@ public abstract class DatabaseMetaData implements java.sql.DatabaseMetaData {", "removed": [ " * @see #getFunctionParametersX(String, String, String,String)", " getFunctionParameters(String catalog," ] }, { "added": [ " \"getFunctionColumns\", ", " return getFunctionColumnsX(catalog, schemaPattern, " ], "header": "@@ -1217,11 +1217,11 @@ public abstract class DatabaseMetaData implements java.sql.DatabaseMetaData {", "removed": [ " \"getFunctionParameters\", ", " return getFunctionParametersX(catalog, schemaPattern, " ] }, { "added": [ " * Untraced version of <code>getFunctionColumns(String, String," ], "header": "@@ -1233,7 +1233,7 @@ public abstract class DatabaseMetaData implements java.sql.DatabaseMetaData {", "removed": [ " * Untraced version of <code>getFunctionParameters(String, String," ] } ] }, { "file": "java/engine/org/apache/derby/catalog/SystemProcedures.java", "hunks": [ { "added": [ "\t * EmbedDatabaseMetaData.getFunctionColumns()" ], "header": "@@ -394,7 +394,7 @@ public class SystemProcedures {", "removed": [ "\t * EmbedDatabaseMetaData.getFunctionParameters()" ] }, { "added": [ "\t * result of getFunctionColumns(). " ], "header": "@@ -407,7 +407,7 @@ public class SystemProcedures {", "removed": [ "\t * result of getFunctionParameters(). " ] } ] }, { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java", "hunks": [ { "added": [ " * Implements DatabaseMetaData.getFunctionColumns() for an embedded", " * 'getFunctionColumns' query from metadata.properties to obtain the" ], "header": "@@ -1595,10 +1595,10 @@ public class EmbedDatabaseMetaData extends ConnectionChild", "removed": [ " * Implements DatabaseMetaData.getFunctionParameters() for an embedded", " * 'getFunctionParameters' query from metadata.properties to obtain the" ] } ] } ]
derby-DERBY-1533-505bb8a1
DERBY-1533: ArrayIndexOutOfBoundsException in DDMReader DERBY-1533 follows in a series of bugs (DERBY-170, DERBY-428, DERBY-491, DERBY-492, DERBY-614 among others) which have to do with the particulars of the DRDA protocols used for handling long messages and large amounts of data. In this particular issue, the problems involve the situation in which the server is receiving a message which is segmented across multiple layer A blocks using DSS continuations. This is a relatively unusual case, as generally large amounts of data flow from the server to the client, not vice versa. This change contains two modifications to DDMReader, as well as some tests: 1) The Network Server method DDMReader.compressBLayerData was incorrect in several respects. Rather than going through that code in detail, I noticed that an almost identical version of this routine exists in the DerbyNetClient, in the class Reply, and I am pretty confident that the client side code is working, so I just wholesale modified the server's compressBLayerData method so that it matched the client's method. 2) When the client is sending parameter data to the server, and the data to be sent is a large array of bytes for a blob, the client, the client may send the data inline as DRDA_TYPE_NVARBYTE, or it may externalize the data and send it as DRDA_TYPE_NLOBBYTES. I believe that similar things happen with CLOB. The client makes this decision based on the length of the data to be sent; short values are sent inline, and long values are sent externalized. When the server receives the data, it must decide whether it is reading an inline string of bytes, or externalized data, and it, too, makes this decision based on the length of the data. However, the server's code for this was comparing the length of the byte string against the amount of data left in the current segment, as opposed to comparing it against the constant threshold value for switching from inline bytes to externalized bytes; hence if a long byte string happened to start late in a buffer, and was then segmented (continued) into a subsequent buffer, the server would mistakenly think the byte string was being sent as externalized bytes, when in fact it was sent as inline bytes. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@430077 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/drda/org/apache/derby/impl/drda/DDMReader.java", "hunks": [ { "added": [ "\t\tif (length < DssConstants.MAX_DSS_LENGTH)" ], "header": "@@ -1321,7 +1321,7 @@ class DDMReader", "removed": [ "\t\tif (length < dssLength)" ] } ] } ]
derby-DERBY-1536-f6313172
DERBY-1536: Extend tests for Wrapper interface git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@423800 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1537-17b031d5
DERBY-1537: Don't put metadata.properties into derbytools.jar. Avoids boot-time exception when running tests with derbytools.jar in front of derby.jar in the classpath. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@427816 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/build/org/apache/derbyBuild/classlister.java", "hunks": [ { "added": [ " // The following block of code checks the package of each class", " // scanned to see if there is a corresponding properties file", " // from propFiles and adds it to the list of found classes.", " // derbytools.jar should not contain any of these files, so skip", " // for that jar. See also DERBY-1537.", " if (!db2jtools)", " {", "\t\t String packageName = className.substring(0, className.lastIndexOf('.') + 1);", "\t\t for (int i = 0; i < propFiles.length; i++) {" ], "header": "@@ -623,9 +623,16 @@ public class classlister {", "removed": [ "\t\tString packageName = className.substring(0, className.lastIndexOf('.') + 1);", "\t\tfor (int i = 0; i < propFiles.length; i++) {" ] }, { "added": [ "\t\t }", " }", " } finally {" ], "header": "@@ -637,8 +644,9 @@ public class classlister {", "removed": [ "\t\t}", "} finally {" ] } ] } ]
derby-DERBY-1538-4f5dc7df
DERBY-1538: Disable GRANT or REVOKE operations for object owners and raise an error when attempted. Also Database owner will not be able to revoke or grant access to object owners as well. Submitted by Satheesh Bandaram ([email protected]) git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@432929 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/compile/PrivilegeNode.java", "hunks": [ { "added": [ "import java.util.List;" ], "header": "@@ -35,6 +35,7 @@ import org.apache.derby.impl.sql.execute.PrivilegeInfo;", "removed": [] }, { "added": [ " * @param grantees The list of grantees", "\tpublic QueryTreeNode bind( HashMap dependencies, List grantees ) throws StandardException", "\t\t" ], "header": "@@ -96,16 +97,17 @@ public class PrivilegeNode extends QueryTreeNode", "removed": [ "\tpublic QueryTreeNode bind( HashMap dependencies ) throws StandardException", " " ] }, { "added": [ "\t\t\t// Can not grant/revoke permissions from self", "\t\t\tif (grantees.contains(sd.getAuthorizationId()))", "\t\t\t\tthrow StandardException.newException(SQLState.AUTH_GRANT_REVOKE_NOT_ALLOWED,", "\t\t\t\t\t\t td.getQualifiedName());", "" ], "header": "@@ -123,11 +125,15 @@ public class PrivilegeNode extends QueryTreeNode", "removed": [ " // GrantRevoke TODO: Disable grant on VTIs and Synonyms" ] }, { "added": [ "\t\t\t// Can not grant/revoke permissions from self", "\t\t\tif (grantees.contains(sd.getAuthorizationId()))", "\t\t\t\tthrow StandardException.newException(SQLState.AUTH_GRANT_REVOKE_NOT_ALLOWED,", "\t\t\t\t\t\t rd.name.getFullTableName());", "" ], "header": "@@ -146,6 +152,11 @@ public class PrivilegeNode extends QueryTreeNode", "removed": [] } ] } ]
derby-DERBY-1539-08313de0
DERBY-1539 Supports basic revoke functionality for triggers. If revoke statement finds a trigger dependent on the table/column/routine on which privilege is being revoked, the trigger will be dropped automatically. Patch contributed by Mamta Satoor git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@425836 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/sql/depend/DependencyManager.java", "hunks": [ { "added": [ "\tis a general purpose interface which is associated with a" ], "header": "@@ -31,7 +31,7 @@ import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;", "removed": [ "\tis a general purpose interface interface which is associated with a" ] } ] }, { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptor.java", "hunks": [ { "added": [], "header": "@@ -29,15 +29,10 @@ import org.apache.derby.catalog.UUID;", "removed": [ "import org.apache.derby.iapi.sql.StatementType;", "import org.apache.derby.iapi.error.StandardException;", "import org.apache.derby.iapi.sql.depend.Dependent;", "import org.apache.derby.iapi.sql.depend.Dependency;", "import org.apache.derby.iapi.sql.depend.Provider;" ] }, { "added": [ "\t\t\t\t//for now, ignore revoke privilege action", "\t\t case DependencyManager.REVOKE_PRIVILEGE:" ], "header": "@@ -556,6 +551,8 @@ public abstract class ConstraintDescriptor", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptor.java", "hunks": [ { "added": [], "header": "@@ -24,7 +24,6 @@ import org.apache.derby.iapi.services.io.Formatable;", "removed": [ "import org.apache.derby.catalog.ReferencedColumns;" ] }, { "added": [ "", "import org.apache.derby.impl.sql.execute.DropTriggerConstantAction;", "" ], "header": "@@ -34,14 +33,12 @@ import org.apache.derby.iapi.sql.StatementType;", "removed": [ "import org.apache.derby.iapi.error.StandardException;", "import org.apache.derby.iapi.sql.depend.Dependent;", "import org.apache.derby.iapi.sql.depend.Dependency;", "import org.apache.derby.iapi.sql.depend.Provider;", "import org.apache.derby.iapi.services.context.ContextManager;" ] }, { "added": [], "header": "@@ -634,8 +631,6 @@ public class TriggerDescriptor extends TupleDescriptor", "removed": [ "\t\t", "" ] }, { "added": [ "\t\t\t\t/*" ], "header": "@@ -652,7 +647,7 @@ public class TriggerDescriptor extends TupleDescriptor", "removed": [ "\t\t\t/*" ] } ] }, { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/ViewDescriptor.java", "hunks": [ { "added": [ "\t\t\t\t//ignore revoke privilege action for now", "\t\t case DependencyManager.REVOKE_PRIVILEGE:", "\t\t \tbreak;" ], "header": "@@ -266,7 +266,9 @@ public final class ViewDescriptor extends TupleDescriptor", "removed": [ "\t\t\t\tbreak;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java", "hunks": [ { "added": [ " * @return True means revoke has removed a privilege from system", " * table and hence the caller of this method should send invalidation ", " * actions to PermssionDescriptor's dependents.", " public boolean addRemovePermissionsDescriptor( boolean add,", " int catalogNumber = perm.getCatalogNumber();", "", " // It is possible for grant statements to look like following" ], "header": "@@ -9920,14 +9920,19 @@ public final class\tDataDictionaryImpl", "removed": [ " public void addRemovePermissionsDescriptor( boolean add,", "\t\t// It is possible for grant statements to look like following" ] }, { "added": [ " \t// Now, when dd.addRemovePermissionsDescriptor gets called again for", " \t// mamta3, the permission descriptor's uuid will still be set to", " \t// the uuid that was used for mamta2. If we do not reset the", " \t// uuid to null, we will think that there is a duplicate row getting", " \t// inserted for the same uuid. In order to get around this, we should ", " \t// reset the UUID of passed PermissionDescriptor everytime this method ", " \t// is called. This way, there will be no leftover values from previous", " \t// call of this method.", " \tperm.setUUID(null); \t" ], "header": "@@ -9937,15 +9942,15 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\t// Now, before dd.addRemovePermissionsDescriptor leaves so it can", " \t// get called for MAMTA3, we should reset the Permission Descriptor's ", " \t// uuid to null or otherwise, for the next call to ", " \t// dd.addRemovePermissionDescriptor, we will think that there is a ", " \t// duplicate row getting inserted for the same uuid.", "\t\t// Same logic applies to ColPermsDescriptor", " \t", " int catalogNumber = perm.getCatalogNumber();", "" ] }, { "added": [ " return false;" ], "header": "@@ -9975,7 +9980,7 @@ public final class\tDataDictionaryImpl", "removed": [ " return;" ] }, { "added": [], "header": "@@ -9987,15 +9992,6 @@ public final class\tDataDictionaryImpl", "removed": [ " \tif (!add)", " \t{", " \t\t//set the uuid of the passed permission descriptor to ", " \t\t//corresponding rows's uuid in permissions system table. The", " \t\t//permission descriptor's uuid is required to have the ", " \t\t//dependency manager send the revoke privilege action to", " \t\t//all the dependent objects on that permission descriptor.", " \t\trf.setUUIDOfThePassedDescriptor(existingRow, perm);", " \t}" ] }, { "added": [ " \t//grant/revoke privilege didn't change anything and hence ", " \t//just return", " return false; \t", " \tif (!add)", " \t{", " \t\t//set the uuid of the passed permission descriptor to ", " \t\t//corresponding rows's uuid in permissions system table. The", " \t\t//permission descriptor's uuid is required to have the ", " \t\t//dependency manager send the revoke privilege action to", " \t\t//all the dependent objects on that permission descriptor.", " \t\trf.setUUIDOfThePassedDescriptor(existingRow, perm);", " \t}" ], "header": "@@ -10006,11 +10002,19 @@ public final class\tDataDictionaryImpl", "removed": [ " \t//grant/revoke privilege didn't change anything and hence just", " \t//return after resetting the uuid in the permission descriptor", " \tperm.setUUID(null);", " return; \t" ] }, { "added": [ "", " //If we are dealing with grant, then the caller does not need to send ", " //any invalidation actions to anyone and hence return false", " if (add)", " \treturn false;", " return true;" ], "header": "@@ -10039,8 +10043,12 @@ public final class\tDataDictionaryImpl", "removed": [ " \t//Before leaving, reset the uuid in the permission descriptor", " \tperm.setUUID(null);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/DropTriggerConstantAction.java", "hunks": [ { "added": [ "public class DropTriggerConstantAction extends DDLSingleTableConstantAction" ], "header": "@@ -51,7 +51,7 @@ import org.apache.derby.catalog.UUID;", "removed": [ "class DropTriggerConstantAction extends DDLSingleTableConstantAction" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/RoutinePrivilegeInfo.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.sql.depend.DependencyManager;" ], "header": "@@ -24,6 +24,7 @@ import org.apache.derby.iapi.sql.Activation;", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/TablePrivilegeInfo.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.sql.depend.DependencyManager;" ], "header": "@@ -26,6 +26,7 @@ import org.apache.derby.iapi.sql.Activation;", "removed": [] } ] } ]
derby-DERBY-1554-0bf06221
DERBY-1554: Revert IDENTITY_VAL_LOCAL() behavior on multi-row inserts to that seen in 10.1.3. Applying patch derby1554trunkdiff02.txt. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429425 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java", "hunks": [ { "added": [ " // checks if source result set is a RowResultSet type.", " private boolean isSingleRowResultSet()", " {", " boolean isRow = false;", " ", " if (sourceResultSet instanceof RowResultSet)", " \tisRow = true;", " else if (sourceResultSet instanceof NormalizeResultSet)", " isRow = (((NormalizeResultSet) sourceResultSet).source instanceof RowResultSet);", " ", " return isRow;", " }", "\t", "\t\tboolean setUserIdentity = constants.hasAutoincrement() && isSingleRowResultSet();", " " ], "header": "@@ -849,14 +849,28 @@ class InsertResultSet extends DMLWriteResultSet implements TargetResultSet", "removed": [ "" ] }, { "added": [ " if(setUserIdentity )" ], "header": "@@ -997,7 +1011,7 @@ class InsertResultSet extends DMLWriteResultSet implements TargetResultSet", "removed": [ " if(constants.hasAutoincrement())" ] } ] } ]
derby-DERBY-1555-03a99e2c
DERBY-1555 Change BaseJDBCTestCase.getXConnection() to getConnection and provide consistent initialization of all connections returned by instance methods of BaseJDBCTestCase. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@434192 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1555-09ffc9bc
DERBY-1555 DERBY-1701 (partial) Convert more tests to use the instance based get[X]Connection method or the static openDefault method. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@432028 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1555-576a49fd
DERBY-1555 (partial) Minor cleanup on some JUnit tests, make the base test classes abstract. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@424135 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1555-7ebfefeb
DERBY-1555 DERBY-1701 (partial) Add utiltiy methods to BaseJDBCTestCase to get Statements, PreparedStatements against the default connection for the test. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@432222 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1555-8f784a46
DERBY-1555 DERBY-1562 (partial) Add new classes BaseJDBCTestSetup and JDBC to support JDBC Unit test development. BaseJDBCTestSetup is a TestSetup decorator for setup that uses JDBC. JDBC class is a holder for JDBC test utility methods. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@424388 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/functionTests/util/JDBC.java", "hunks": [ { "added": [ "/*", " *", " * Derby - Class org.apache.derbyTesting.functionTests.util.JDBC", " *", " * Copyright 2006 The Apache Software Foundation or its ", " * licensors, as applicable.", " *", " * Licensed under the Apache License, Version 2.0 (the \"License\");", " * you may not use this file except in compliance with the License.", " * You may obtain a copy of the License at", " *", " * http://www.apache.org/licenses/LICENSE-2.0", " *", " * Unless required by applicable law or agreed to in writing, ", " * software distributed under the License is distributed on an ", " * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, ", " * either express or implied. See the License for the specific ", " * language governing permissions and limitations under the License.", " */", "package org.apache.derbyTesting.functionTests.util;", "", "import java.sql.*;", "", "/**", " * JDBC utility methods for the JUnit tests.", " *", " */", "public class JDBC {", "\t", "\t/**", "\t * Rollback and close a connection for cleanup.", "\t * Test code that is expecting Connection.close to succeed", "\t * normally should just call conn.close().", "\t * ", "\t * <P>", "\t * If conn is not-null and isClosed() returns false", "\t * then both rollback and close will be called.", "\t * If both methods throw exceptions", "\t * then they will be chained together and thrown.", "\t * @throws SQLException Error closing connection.", "\t */", "\tpublic static void cleanup(Connection conn) throws SQLException", "\t{", "\t\tif (conn == null)", "\t\t\treturn;", "\t\tif (conn.isClosed())", "\t\t\treturn;", "\t\t", "\t\tSQLException sqle = null;", "\t\ttry {", "\t\t\tconn.rollback();", "\t\t} catch (SQLException e) {", "\t\t\tsqle = e;", "\t\t}", "\t\t", "\t\ttry {", "\t\t\tconn.close();", "\t\t} catch (SQLException e) {", "\t\t\tif (sqle == null)", "\t\t\t sqle = e;", "\t\t\telse", "\t\t\t\tsqle.setNextException(e);", "\t\t\tthrow sqle;", "\t\t}", "\t}", "}" ], "header": "@@ -0,0 +1,66 @@", "removed": [] } ] } ]
derby-DERBY-1555-92f9877b
DERBY-1555 (partial) Add some top level JUnit suites that run all the tests in the packages (AllPackages), all the tests in Embedded and (Derby) Client configurations and run All the configurations. Also adds the logic in TestConfiguration to switch configurations to Client. Just a checkpoint (incremental development), more work needed, see some failures running All. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@436957 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/junit/TestConfiguration.java", "hunks": [ { "added": [ "import java.lang.reflect.Method;" ], "header": "@@ -20,6 +20,7 @@", "removed": [] }, { "added": [ " static void setCurrent(TestConfiguration config)" ], "header": "@@ -67,12 +68,11 @@ public class TestConfiguration {", "removed": [ " private static void setCurrent(TestConfiguration config)", " * WORK IN PROGRESS" ] }, { "added": [ " * @throws Exception ", " public static Test derbyClientServerDecorator(Class suite) throws Exception", " TestConfiguration derbyClientConfig =", " new TestConfiguration(config, JDBCClient.DERBYNETCLIENT,", " DEFAULT_HOSTNAME, DEFAULT_PORT);", " ", " TestConfiguration.setCurrent(derbyClientConfig);", " ", " Test test = addSuiteByReflection(suite);", " ", " TestConfiguration.setCurrent(config);", " ", " test = new NetworkServerTestSetup(test);", " ", " return new ChangeConfigurationSetup(derbyClientConfig, test);", "", " }", " private static Test addSuiteByReflection(Class clz) throws Exception", " {", " Method sm = clz.getMethod(\"suite\", null);", " ", " return (Test) sm.invoke(null, null);", " } ", " ", " ", " /**", " * Default embedded configuration", " *", " */", " private TestConfiguration() {", " this.dbName = DEFAULT_DBNAME;", " this.userName = DEFAULT_USER_NAME;", " this.userPassword = DEFAULT_USER_PASSWORD;", " this.hostName = null;", " this.port = -1;", " this.singleLegXA = false;", " ", " this.jdbcClient = JDBCClient.EMBEDDED;", " url = createJDBCUrlWithDatabaseName(dbName);", " ", " }", " ", " private TestConfiguration(TestConfiguration copy, JDBCClient client,", " String hostName, int port)", " {", " this.dbName = copy.dbName;", " this.userName = copy.userName;", " this.userPassword = copy.userPassword;", "", " this.isVerbose = copy.isVerbose;", " this.singleLegXA = copy.singleLegXA;", " this.port = port;", " this.jdbcClient = client;", " this.hostName = hostName;", " this.url = createJDBCUrlWithDatabaseName(dbName);" ], "header": "@@ -84,19 +84,67 @@ public class TestConfiguration {", "removed": [ " public static Test derbyClientServerDecorator(Test tests)", " // Already in the correct configuration, do nothing.", " if (config.getJDBCClient().isDerbyNetClient())", " return tests;", " TestConfiguration derbyClientConfig = null;", " // new TestConfiguration(config, JDBCClient.DERBYNETCLIENT);", " return null;" ] }, { "added": [ "" ], "header": "@@ -106,7 +154,7 @@ public class TestConfiguration {", "removed": [ "\t\tsystemStartupProperties = props;" ] }, { "added": [], "header": "@@ -140,14 +188,6 @@ public class TestConfiguration {", "removed": [ " /**", " * Get the given system property as specified at startup.", " */", "\tprivate\tString\tgetSystemStartupProperty( String key )", "\t{", "\t\treturn systemStartupProperties.getProperty( key );", "\t}", "" ] }, { "added": [], "header": "@@ -390,7 +430,6 @@ public class TestConfiguration {", "removed": [ "\tprivate\tfinal Properties systemStartupProperties;" ] } ] } ]
derby-DERBY-1555-d57bbd3f
DERBY-1555 Add configuration decorator to change the default user for a configuaration and use it in the NistScripts JUnit test. NistScripts is an initial pass at the setup of running nist under JUnit, it fails at the moment in about a third of the test cases probably due to output that is being sed'ed in the old harness and should not be. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@438299 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/junit/TestConfiguration.java", "hunks": [ { "added": [ " public static Test changeUserDecorator(Test test, String user, String password)", " {", " return new ChangeUserSetup(test, user, password);", " } " ], "header": "@@ -112,7 +112,10 @@ public class TestConfiguration {", "removed": [ " " ] }, { "added": [ "" ], "header": "@@ -129,7 +132,7 @@ public class TestConfiguration {", "removed": [ " " ] }, { "added": [ " ", " /**", " * Obtain a new configuration identical to the passed in", " * one except for the default user and password.", " * @param copy Configuration to copy.", " * @param user New default user", " * @param password New default password.", " */", " TestConfiguration(TestConfiguration copy, String user, String password)", " {", " this.dbName = copy.dbName;", " this.userName = user;", " this.userPassword = password;", "", " this.isVerbose = copy.isVerbose;", " this.singleLegXA = copy.singleLegXA;", " this.port = copy.port;", " ", " this.jdbcClient = copy.jdbcClient;", " this.hostName = copy.hostName;", " ", " this.url = copy.url;", " }", "" ], "header": "@@ -147,6 +150,30 @@ public class TestConfiguration {", "removed": [] } ] } ]
derby-DERBY-1555-df2b52c0
DERBY-1555 DERBY-1701 (partial) Change the name of the TestConfiguration methods to openConnection from getConnection. Step to having BaseJDBCTestCase.getConnection() be a method matching BaseJDBCTestSetup.getConnection, a handle to a default connection stored in the instance. This will remove a lot of code in the classes that extend BaseJDBCTestCase that store a connection locally and have N different ways of cleaning it up. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@431919 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/functionTests/util/BaseJDBCTestSetup.java", "hunks": [ { "added": [ " * @see TestConfiguration#openDefaultConnection()" ], "header": "@@ -60,7 +60,7 @@ public abstract class BaseJDBCTestSetup", "removed": [ " * @see TestConfiguration#getDefaultConnection()" ] }, { "added": [ " \treturn conn = getTestConfiguration().openDefaultConnection();" ], "header": "@@ -70,7 +70,7 @@ public abstract class BaseJDBCTestSetup", "removed": [ " \treturn conn = getTestConfiguration().getDefaultConnection();" ] } ] }, { "file": "java/testing/org/apache/derbyTesting/functionTests/util/TestConfiguration.java", "hunks": [ { "added": [ " * Open connection to the default database.", " public Connection openDefaultConnection()", " return openConnection(getDatabaseName());", " * Open a connection to a database.", " * @return connection to database.", " public Connection openConnection (String databaseName) throws SQLException {" ], "header": "@@ -189,27 +189,27 @@ public class TestConfiguration {", "removed": [ " * Get connection to the default database.", " public Connection getDefaultConnection()", " return getConnection(getDatabaseName());", " * Get connection to a database.", " * @return connection to default database.", " public Connection getConnection (String databaseName) throws SQLException {" ] } ] } ]
derby-DERBY-1555-e0104e8b
DERBY-1555 (partial) Remove access and use of static variables to store the current test configuration. Changed to use a ThreadLocal private to TestConfiguration and access to the current configuration is through utility methods in the base classes or TestConfiguration.getCurrent(). git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@434257 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/junit/NetworkServerTestSetup.java", "hunks": [ { "added": [], "header": "@@ -43,9 +43,6 @@ final public class NetworkServerTestSetup extends TestSetup {", "removed": [ " ", " this.config = TestConfiguration.DERBY_TEST_CONFIG;", " this.networkServerController = null;" ] }, { "added": [ " TestConfiguration config = TestConfiguration.getCurrent();", " " ], "header": "@@ -53,6 +50,8 @@ final public class NetworkServerTestSetup extends TestSetup {", "removed": [] } ] }, { "file": "java/testing/org/apache/derbyTesting/junit/TestConfiguration.java", "hunks": [ { "added": [ "d/*" ], "header": "@@ -1,4 +1,4 @@", "removed": [ "/*" ] }, { "added": [ "", " private static final TestConfiguration DERBY_TEST_CONFIG = ", " /**", " * Current configuration is stored in a ThreadLocal to", " * allow the potential for multiple tests to be running", " * concurrently with different configurations.", " */", " private static final ThreadLocal CURRENT_CONFIG = new ThreadLocal() {", " protected Object initialValue() {", " return DERBY_TEST_CONFIG;", " }", " };", " ", " /**", " * Get this Thread's current configuraiton for running", " * the tests.", " * @return TestConfiguration to use.", " */", " public static TestConfiguration getCurrent() {", " return (TestConfiguration) CURRENT_CONFIG.get();", " }", " ", " /**", " * Set this Thread's current configuration for running tests.", " * @param config Configuration to set it to.", " */", " private static void setCurrent(TestConfiguration config)", " {", " CURRENT_CONFIG.set(config);", " }", " " ], "header": "@@ -31,13 +31,42 @@ import org.apache.derbyTesting.functionTests.util.TestDataSourceFactory;", "removed": [ " ", " public static final TestConfiguration DERBY_TEST_CONFIG = " ] } ] } ]
derby-DERBY-1555-f308936b
DERBY-1555 (partial) Move the code to obtain a default connection into TestConfiuration for the JUnit test setup to allow it to be shared across multiple classes. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@424368 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/functionTests/util/TestConfiguration.java", "hunks": [ { "added": [ "import java.sql.Connection;", "import java.sql.DriverManager;", "import java.sql.SQLException;" ], "header": "@@ -20,6 +20,9 @@", "removed": [] }, { "added": [ " static final TestConfiguration DERBY_TEST_CONFIG = ", " /**", " * Tell if we are allowed to use DriverManager to create database", " * connections.", " */", " private static final boolean HAVE_DRIVER;", "", " static {", " // See if java.sql.Driver is available. If it is not, we must use", " // DataSource to create connections.", " boolean haveDriver = false;", " try {", " Class.forName(\"java.sql.Driver\");", " haveDriver = true;", " } catch (Exception e) {}", " HAVE_DRIVER = haveDriver;", " }", " " ], "header": "@@ -32,9 +35,26 @@ public class TestConfiguration {", "removed": [ " public static final TestConfiguration DERBY_TEST_CONFIG = " ] }, { "added": [ " /**", " * Get connection to the default database.", " * If the database does not exist, it will be created.", " * A default username and password will be used for the connection.", " *", " * @return connection to default database.", " */", " public Connection getDefaultConnection()", " throws SQLException {", " Connection con = null;", " JDBCClient client =getJDBCClient();", " if (HAVE_DRIVER) { ", " loadJDBCDriver(client.getJDBCDriverName());", " if (!isSingleLegXA()) {", " con = DriverManager.getConnection(", " getJDBCUrl() + \";create=true\",", " getUserName(),", " getUserPassword());", " }", " else {", " con = TestDataSourceFactory.getXADataSource().getXAConnection (getUserName(),", " getUserPassword()).getConnection(); ", " }", " } else {", " //Use DataSource for JSR169", " con = TestDataSourceFactory.getDataSource().getConnection();", " }", " return con;", " }", " " ], "header": "@@ -187,6 +207,36 @@ public class TestConfiguration {", "removed": [] }, { "added": [ " ", " /**", " * Load the specified JDBC driver", " *", " * @param driverClass name of the JDBC driver class.", " * @throws SQLException if loading the driver fails.", " */", " private static void loadJDBCDriver(String driverClass) ", " throws SQLException {", " try {", " Class.forName(driverClass).newInstance();", " } catch (ClassNotFoundException cnfe) {", " throw new SQLException(\"Failed to load JDBC driver '\" + ", " driverClass + \"': \" + cnfe.getMessage());", " } catch (IllegalAccessException iae) {", " throw new SQLException(\"Failed to load JDBC driver '\" +", " driverClass + \"': \" + iae.getMessage());", " } catch (InstantiationException ie) {", " throw new SQLException(\"Failed to load JDBC driver '\" +", " driverClass + \"': \" + ie.getMessage());", " }", " }" ], "header": "@@ -349,5 +399,27 @@ public class TestConfiguration {", "removed": [] } ] } ]
derby-DERBY-1555-f7672a4a
DERBY-1555 Add some code to allow different JUnit TestConfigurations at start up based upon if the TestConfiguration class determines it is running within the old harness or not. Add a utility method to allow JUnit suites or tests to determine if they are running in the harness or not, and thus have temporary code to ease transistion from the old harness. With this commit the code is setup to assume it's always running in the harness, need some more testing to fully support this flag when running outside the harness. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@438975 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/junit/TestConfiguration.java", "hunks": [ { "added": [ " /**", " * Default values for configurations", " */", " private final static String DEFAULT_DBNAME = \"wombat\";", " private final static String DEFAULT_USER_NAME = \"APP\";", " private final static String DEFAULT_USER_PASSWORD = \"APP\";", " private final static int DEFAULT_PORT = 1527;", " private final static String DEFAULT_FRAMEWORK = \"embedded\";", " private final static String DEFAULT_HOSTNAME = \"localhost\";", " ", " /**", " * Keys to use to look up values in properties files.", " */", " private final static String KEY_DBNAME = \"databaseName\";", " private final static String KEY_FRAMEWORK = \"framework\";", " private final static String KEY_USER_PASSWORD = \"password\";", " private final static String KEY_USER_NAME = \"user\";", " private final static String KEY_HOSTNAME = \"hostName\";", " private final static String KEY_PORT = \"port\";", " private final static String KEY_VERBOSE = \"derby.tests.debug\"; ", " private final static String KEY_SINGLE_LEG_XA = \"derbyTesting.xa.single\";", "", " /**", " * Possible values of system properties.", " */", " private final static String UNUSED = \"file://unused/\";", "", " * Default Derby test configuration object based", " * upon system properties set by the old harness.", " private static final TestConfiguration DERBY_HARNESS_CONFIG = ", " /**", " * Default configuration for standalone JUnit tests,", " * an embedded configuration.", " */", " private static final TestConfiguration JUNIT_CONFIG", " = new TestConfiguration();", " ", " /**", " * The default configuration.", " */", " private static final TestConfiguration DEFAULT_CONFIG;", " ", " /**", " * Are we running in the harness, assume so if framework", " * was set so the ", " */", " private static final boolean runningInDerbyHarness;", " ", " static {", " boolean assumeHarness = false;", " ", " // In the harness if the default configuration according", " // to system properties is not embedded.", " if (!DERBY_HARNESS_CONFIG.getJDBCClient().isEmbedded())", " assumeHarness = true;", " ", " // Assume harness if database name is not default", " if (!DERBY_HARNESS_CONFIG.getDatabaseName().equals(DEFAULT_DBNAME))", " assumeHarness = true;", " ", " // Assume harness if user name is not default", " if (!DERBY_HARNESS_CONFIG.getUserName().equals(DEFAULT_USER_NAME))", " assumeHarness = true;", " ", " // If derby.system.home set externally at startup assume", " // running in harness", " if (BaseTestCase.getSystemProperty(\"derby.system.home\") != null)", " assumeHarness = true;", " ", " // for now always assume harness - still testing this code", " assumeHarness = true;", "", " DEFAULT_CONFIG = assumeHarness ? DERBY_HARNESS_CONFIG : JUNIT_CONFIG;", " runningInDerbyHarness = assumeHarness;", " ", " if (!assumeHarness) {", " File dsh = new File(\"system\");", "", " BaseTestCase.setSystemProperty(\"derby.system.home\",", " dsh.getAbsolutePath());", " }", " }", " " ], "header": "@@ -36,13 +36,94 @@ import org.apache.derbyTesting.functionTests.util.TestDataSourceFactory;", "removed": [ " * Default Derby test configuration object.", " private static final TestConfiguration DERBY_TEST_CONFIG = " ] }, { "added": [ " return DEFAULT_CONFIG;" ], "header": "@@ -50,7 +131,7 @@ public class TestConfiguration {", "removed": [ " return DERBY_TEST_CONFIG;" ] }, { "added": [ " ", " /**", " * Is this JUnit test being run by the old harness.", " * Temp method to ease the switch over by allowing", " * suites to alter their behaviour based upon the", " * need to still run under the old harness.", " * @return", " */", " public static boolean runningInDerbyHarness()", " {", " return runningInDerbyHarness;", " }" ], "header": "@@ -390,6 +471,18 @@ public class TestConfiguration {", "removed": [] }, { "added": [], "header": "@@ -467,32 +560,6 @@ public class TestConfiguration {", "removed": [ " /**", " * Default values for configurations", " */", " private final static String DEFAULT_DBNAME = \"wombat\";", " private final static String DEFAULT_USER_NAME = \"APP\";", " private final static String DEFAULT_USER_PASSWORD = \"APP\";", " private final static int DEFAULT_PORT = 1527;", " private final static String DEFAULT_FRAMEWORK = \"embedded\";", " private final static String DEFAULT_HOSTNAME = \"localhost\";", " ", " /**", " * Keys to use to look up values in properties files.", " */", " private final static String KEY_DBNAME = \"databaseName\";", " private final static String KEY_FRAMEWORK = \"framework\";", " private final static String KEY_USER_PASSWORD = \"password\";", " private final static String KEY_USER_NAME = \"user\";", " private final static String KEY_HOSTNAME = \"hostName\";", " private final static String KEY_PORT = \"port\";", " private final static String KEY_VERBOSE = \"derby.tests.debug\"; ", " private final static String KEY_SINGLE_LEG_XA = \"derbyTesting.xa.single\";", "", " /**", " * Possible values of system properties.", " */", " private final static String UNUSED = \"file://unused/\";" ] }, { "added": [ " getCurrent().getDatabaseName());" ], "header": "@@ -505,7 +572,7 @@ public class TestConfiguration {", "removed": [ " DERBY_TEST_CONFIG.getDatabaseName());" ] }, { "added": [ " if (!(getCurrent().getJDBCClient() == JDBCClient.EMBEDDED)) {", " attrs.setProperty(\"serverName\", getCurrent().getHostName());", " attrs.setProperty(\"portNumber\", Integer.toString(getCurrent().getPort()));" ], "header": "@@ -523,9 +590,9 @@ public class TestConfiguration {", "removed": [ " if (!(DERBY_TEST_CONFIG.getJDBCClient() == JDBCClient.EMBEDDED)) {", " attrs.setProperty(\"serverName\", DERBY_TEST_CONFIG.getHostName());", " attrs.setProperty(\"portNumber\", Integer.toString(DERBY_TEST_CONFIG.getPort()));" ] } ] } ]
derby-DERBY-1555-fb2bfd52
DERBY-1555 DERBY-1701 (partial) Incremental step in changing the tests that extend SURBaseTest to use the single connection provided by BaseJDBCTestCase. Added initialize method to BaseJDBCTestCase to allow tests to have a consistent initial state for a connection. The SURBaseTest still has its con variable, will be cleaned up in subsequent commits. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@432438 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1555-ff658306
DERBY-1555 DERBY-1701 (partial) Change the tests that extend SURBaseTest to use the utilitiy methods rather than the con field from SURBaseTest to fit into the generic single connection model provided by BaseJDBCTestCase. Incremental development, next step will be to remove the con field from SURBaseTest. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@432450 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1555-ffe3f662
DERBY-1555 DERBY-1701 (partial) Improve the BaseJDBCTest by adding support for a default connection exactly like BaseJDBCTestSetup. Provides consistent handling for a connection in the common case of a test using just one. Removes duplicated/inconistent code across many tests. First step has the getConnection method called getXConnection until all the tests ahve stopped using the getConnection static method and instead use the openDefaultConnection method. Change the tests in jdbcapi to the new scheme. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@431999 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1556-7d16ff3d
DERBY-1556 (partial) Add the initial implementation of a utility method in the JUnit JDBC class to drop a schema and all of its objects. Will be called by a test decorator I will be committing soon. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@430853 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/functionTests/util/JDBC.java", "hunks": [ { "added": [ "\t/**", "\t * Drop a database schema by dropping all objects in it", "\t * and then executing DROP SCHEMA. If the schema is", "\t * APP it is cleaned but DROP SCHEMA is not executed.", "\t * ", "\t * TODO: Handle dependencies by looping in some intelligent", "\t * way until everything can be dropped.", "\t * ", "\t * @param dmd DatabaseMetaData object for database", "\t * @param schema Name of the schema", "\t * @throws SQLException database error", "\t */", "\tpublic static void dropSchema(DatabaseMetaData dmd, String schema) throws SQLException", "\t{\t\t", "\t\tConnection conn = dmd.getConnection();", "\t\tAssert.assertFalse(conn.getAutoCommit());", "\t\tStatement s = dmd.getConnection().createStatement();", "\t\t// Procedures first", "\t\tResultSet rs = dmd.getProcedures((String) null,", "\t\t\t\tschema, (String) null);", "\t\t", "\t\tdropUsingDMD(s, rs, schema, \"PROCEDURE_NAME\", \"PROCEDURE\");", "\t\t", "\t\t// Views", "\t\trs = dmd.getTables((String) null, schema, (String) null,", "\t\t\t\tnew String[] {\"VIEW\"});", "\t\t", "\t\tdropUsingDMD(s, rs, schema, \"TABLE_NAME\", \"VIEW\");", "\t\t", "\t\t// Tables", "\t\trs = dmd.getTables((String) null, schema, (String) null,", "\t\t\t\tnew String[] {\"TABLE\"});", "\t\t", "\t\tdropUsingDMD(s, rs, schema, \"TABLE_NAME\", \"TABLE\");", "\t\t", "\t\t// Finally drop the schema if it is not APP", "\t\tif (!schema.equals(\"APP\")) {", "\t\t\ts.execute(\"DROP SCHEMA \" + JDBC.escape(schema) + \" RESTRICT\");", "\t\t}", "\t\tconn.commit();", "\t\ts.close();", "\t}", "\t", "\t/**", "\t * DROP a set of objects based upon a ResultSet from a", "\t * DatabaseMetaData call.", "\t * ", "\t * TODO: Handle errors to ensure all objects are dropped,", "\t * probably requires interaction with its caller.", "\t * ", "\t * @param s Statement object used to execute the DROP commands.", "\t * @param rs DatabaseMetaData ResultSet", "\t * @param schema Schema the objects are contained in", "\t * @param mdColumn The column name used to extract the object's", "\t * name from rs", "\t * @param dropType The keyword to use after DROP in the SQL statement", "\t * @throws SQLException database errors.", "\t */", "\tprivate static void dropUsingDMD(", "\t\t\tStatement s, ResultSet rs, String schema,", "\t\t\tString mdColumn,", "\t\t\tString dropType) throws SQLException", "\t{", "\t\tString dropLeadIn = \"DROP \" + dropType + \" \";", "\t\t", "\t\ts.clearBatch();", "\t\tint batchCount = 0;", "\t\twhile (rs.next())", "\t\t{", "\t\t\tString view = rs.getString(mdColumn);", "\t\t\ts.addBatch(dropLeadIn + JDBC.escape(schema, view));", "\t\t\tbatchCount++;", "\t\t}", "\t\trs.close();", "\t\tint[] results;", "\t\ttry {", "\t\t results = s.executeBatch();", "\t\t Assert.assertNotNull(results);", "\t\t Assert.assertEquals(\"Incorrect result length from executeBatch\",", "\t\t \t\tbatchCount, results.length);", "\t\t} catch (BatchUpdateException batchException) {", "\t\t\tresults = batchException.getUpdateCounts();", "\t\t\tAssert.assertNotNull(results);", "\t\t\tAssert.assertTrue(\"Too many results in BatchUpdateException\",", "\t\t\t\t\tresults.length <= batchCount);", "\t\t}", "\t\t", "\t\tboolean hadError = false;", "\t\tboolean didDrop = false;", "\t\tfor (int i = 0; i < results.length; i++)", "\t\t{", "\t\t\tint result = results[i];", "\t\t\tif (result == -3 /* Statement.EXECUTE_FAILED*/)", "\t\t\t\thadError = true;", "\t\t\telse if (result == -2/*Statement.SUCCESS_NO_INFO*/)", "\t\t\t\tdidDrop = true;", "\t\t\telse if (result >= 0)", "\t\t\t\tdidDrop = true;", "\t\t\telse", "\t\t\t\tAssert.fail(\"Negative executeBatch status\");", "\t\t}", "\t\t", "\t\t// Commit any work we did do.", "\t\ts.getConnection().commit();", "\t\ts.clearBatch();", "\t}", "\t" ], "header": "@@ -145,6 +145,113 @@ public class JDBC {", "removed": [] }, { "added": [ "\t", "\t/**", "\t * Escape a non-qualified name so that it is suitable", "\t * for use in a SQL query executed by JDBC.", "\t */", "\tpublic static String escape(String name)", "\t{", "\t\treturn \"\\\"\" + name + \"\\\"\";", "\t}\t", "\t/**", "\t * Escape a schama-qualified name so that it is suitable", "\t * for use in a SQL query executed by JDBC.", "\t */", "\tpublic static String escape(String schema, String name)", "\t{", "\t\treturn \"\\\"\" + schema + \"\\\".\\\"\" + name + \"\\\"\";", "\t}" ], "header": "@@ -208,4 +315,21 @@ public class JDBC {", "removed": [] } ] } ]
derby-DERBY-1556-f061ecd1
DERBY-1556 (partial) Add an initial test decorator that cleans a database using the utility method JDBC.dropSchema. More work is needed to drop functions, synonyms and handle dependencies between objects. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@430867 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/functionTests/util/CleanDatabaseTestSetup.java", "hunks": [ { "added": [ "/*", " *", " * Derby - Class org.apache.derbyTesting.functionTests.util.CleanDatabase", " *", " * Licensed to the Apache Software Foundation (ASF) under one or more", " * contributor license agreements. See the NOTICE file distributed with", " * this work for additional information regarding copyright ownership.", " * The ASF licenses this file to You under the Apache License, Version 2.0", " * (the \"License\"); you may not use this file except in compliance with", " * the License. You may obtain a copy of the License at", " *", " * http://www.apache.org/licenses/LICENSE-2.0", " *", " * Unless required by applicable law or agreed to in writing, ", " * software distributed under the License is distributed on an ", " * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, ", " * either express or implied. See the License for the specific ", " * language governing permissions and limitations under the License.", " */", "package org.apache.derbyTesting.functionTests.util;", "", "import java.sql.*;", "import java.util.ArrayList;", "import java.util.Iterator;", "import java.util.List;", "", "import junit.framework.Test;", "", "/**", " * Test decorator that cleans a database on setUp and", " * tearDown to provide a test with a consistent empty", " * database as a starting point.", " * ", " */", "public class CleanDatabaseTestSetup extends BaseJDBCTestSetup {", "", " /**", " * Decorator this test with the cleaner", " */", " public CleanDatabaseTestSetup(Test test) {", " super(test);", " }", "", " /**", " * Clean the default database using the default connection.", " */", " protected void setUp() throws Exception {", " Connection conn = getConnection();", " conn.setAutoCommit(false);", " CleanDatabaseTestSetup.cleanDatabase(conn);", " conn.close();", " }", "", " /**", " * Clean the default database using the default connection.", " */", " protected void tearDown() throws Exception {", " setUp();", " super.tearDown();", " }", "", "", " /**", " * Clean a complete database", " * @param conn Connection to be used, must not be in auto-commit mode.", " * @throws SQLException database error", " */", " public static void cleanDatabase(Connection conn) throws SQLException {", " DatabaseMetaData dmd = conn.getMetaData();", "", " // Fetch all the user schemas into a list", " List schemas = new ArrayList();", " ResultSet rs = dmd.getSchemas();", " while (rs.next()) {", "", " String schema = rs.getString(\"TABLE_SCHEM\");", " if (schema.startsWith(\"SYS\"))", " continue;", " if (schema.equals(\"SQLJ\"))", " continue;", " if (schema.equals(\"NULLID\"))", " continue;", "", " schemas.add(schema);", " }", " rs.close();", "", " // DROP all the user schemas.", " for (Iterator i = schemas.iterator(); i.hasNext();) {", " String schema = (String) i.next();", " JDBC.dropSchema(dmd, schema);", " }", " }", "", "}" ], "header": "@@ -0,0 +1,95 @@", "removed": [] } ] } ]
derby-DERBY-1563-c9a2190f
DERBY-1563: derbynet/ShutDownDBWhenNSShutsDownTest.junit fails on Solaris sparc The attached patch (derby-1563.diff) fixes the problem by waiting before checking if the file exists. Patch contributed by Fernanda Pizzorno. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@425719 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1567-648e3486
DERBY-3902; correct messages.xml and translated files for SQLState 2003.S.4 (was accidentally listed as 2004.S.4 - see also comment in DERBY-1567). Also fix up MessageBundleTest to ignore two sqlstates that are not exposed to the user so don't need text. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@703259 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1571-196bf05a
DERBY-1571: NetworkServerControlImpl.consoleExceptionPrintTrace() prints stack trace even when logWriter is null Made NetworkServerControlImpl.shutdown() set logWriter to a silent stream instead of null to avoid printing stack traces of expected exceptions during shutdown. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@425703 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java", "hunks": [ { "added": [ "import java.io.FilterOutputStream;" ], "header": "@@ -23,6 +23,7 @@ package org.apache.derby.impl.drda;", "removed": [] }, { "added": [ "\t\t// DERBY-1571: If logWriter is null, stack traces are printed to", "\t\t// System.err. Set logWriter to a silent stream to suppress stack", "\t\t// traces too.", "\t\tFilterOutputStream silentStream = new FilterOutputStream(null) {", "\t\t\t\tpublic void write(int b) { }", "\t\t\t\tpublic void flush() { }", "\t\t\t\tpublic void close() { }", "\t\t\t};", "\t\tsetLogWriter(new PrintWriter(silentStream));" ], "header": "@@ -753,7 +754,15 @@ public final class NetworkServerControlImpl {", "removed": [ "\t\tsetLogWriter(null);" ] } ] } ]
derby-DERBY-1573-265ba2fa
DERBY-1573: Unsafe synchronization in NetworkServerControlImpl Contributed by Thomas Nielsen. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@549412 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java", "hunks": [ { "added": [ "\t\tPrintWriter lw = logWriter;", "\t\tif (lw != null)", "\t\t\tsynchronized (lw) {", "\t\t\t\te.printStackTrace(lw);" ], "header": "@@ -513,10 +513,11 @@ public final class NetworkServerControlImpl {", "removed": [ "\t\tif (logWriter != null)", "\t\t\tsynchronized (logWriter) {", "\t\t\t\te.printStackTrace(logWriter);" ] }, { "added": [ "\t\tlw = cloudscapeLogWriter;", "\t\tif (lw != null)", "\t\t\tsynchronized(lw) {", "\t\t\t\te.printStackTrace(lw);" ], "header": "@@ -524,10 +525,11 @@ public final class NetworkServerControlImpl {", "removed": [ "\t\tif (cloudscapeLogWriter != null)", "\t\t\tsynchronized(cloudscapeLogWriter) {", "\t\t\t\te.printStackTrace(cloudscapeLogWriter);" ] }, { "added": [ "\t\tPrintWriter lw = logWriter;", "\t\tif (lw != null)", "\t\t\tsynchronized(lw) {", "\t\t\t\tlw.println(msg);", "\t\tlw = cloudscapeLogWriter;", "\t\tif (lw != null)", "\t\t\tsynchronized(lw)" ], "header": "@@ -543,15 +545,17 @@ public final class NetworkServerControlImpl {", "removed": [ "\t\tif (logWriter != null)", "\t\t\tsynchronized(logWriter) {", "\t\t\t\tlogWriter.println(msg);", "\t\tif (cloudscapeLogWriter != null)", "\t\t\tsynchronized(cloudscapeLogWriter)" ] } ] } ]
derby-DERBY-1576-13d34b0c
DERBY-1576: Extend the CASE expression syntax for "simple case" Forbid untyped parameters in the case operand. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1596492 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1576-2455f1ac
DERBY-1576: Extend the CASE expression syntax for "simple case" Implement simple case as described by the SQL:1999 standard, including the SQL:2003 extension F262 "Extended CASE expression", and the SQL:2011 extension F263 "Comma-separated predicates in simple CASE expression". git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1595778 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/compile/ConditionalNode.java", "hunks": [ { "added": [ " /**", " * The case operand if this is a simple case expression. Otherwise, it", " * is {@code null}.", " */", " private ValueNode caseOperand;", "" ], "header": "@@ -46,6 +46,12 @@ import org.apache.derby.iapi.util.JBitSet;", "removed": [] }, { "added": [ " * @param caseOperand The case operand if this is a simple case", " * expression, or {@code null} otherwise", " ConditionalNode(ValueNode caseOperand,", " ValueNodeList testConditions,", " this.caseOperand = caseOperand;" ], "header": "@@ -58,15 +64,19 @@ class ConditionalNode extends ValueNode", "removed": [ " ConditionalNode(ValueNodeList testConditions," ] }, { "added": [ "", " bindCaseOperand(cc, fromList, subqueryList, aggregates);", "" ], "header": "@@ -184,7 +194,9 @@ class ConditionalNode extends ValueNode", "removed": [ " " ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/QueryTreeNode.java", "hunks": [ { "added": [ " final int reliability = getCompilerContext().getReliability();", " if (reliability == CompilerContext.DEFAULT_RESTRICTION)", " else if (reliability == CompilerContext.GENERATION_CLAUSE_RESTRICTION)" ], "header": "@@ -1471,15 +1471,16 @@ public abstract class QueryTreeNode implements Visitable", "removed": [ "\t\tif (getCompilerContext().getReliability() == CompilerContext.DEFAULT_RESTRICTION)", "\t\telse if (getCompilerContext().getReliability() == CompilerContext.GENERATION_CLAUSE_RESTRICTION)" ] } ] }, { "file": "java/shared/org/apache/derby/shared/common/reference/SQLState.java", "hunks": [ { "added": [ " String LANG_UNRELIABLE_CHECK_CONSTRAINT = \"42Y39\";" ], "header": "@@ -1003,7 +1003,7 @@ public interface SQLState {", "removed": [ "\tString LANG_UNRELIABLE_QUERY_FRAGMENT = \"42Y39\";" ] } ] } ]
derby-DERBY-1576-2bd5cbdb
DERBY-1576: Extend the CASE expression syntax for "simple case" Allow untyped parameters in the case operand. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1598472 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/compile/ConditionalNode.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.sql.compile.Visitable;" ], "header": "@@ -32,6 +32,7 @@ import org.apache.derby.iapi.services.context.ContextManager;", "removed": [] }, { "added": [ " ValueNodeList caseOperandParameters =", " bindCaseOperand(cc, fromList, subqueryList, aggregates);", " // If we have a simple case expression in which the case operand", " // requires type from context (typically because it's an untyped", " // parameter), find out which type best describes it.", " if (caseOperandParameters != null) {", "", " // Go through all the dummy parameter nodes that bindCaseOperand()", " // inserted into the synthetic test conditions. Each of them will", " // have been given the type of the corresponding when operand", " // when testConditions was bound.", " for (ValueNode vn : caseOperandParameters) {", " // Check that this parameter is comparable to all the other", " // parameters in the list. This indirectly checks whether", " // all when operands have compatible types.", " caseOperandParameters.comparable(vn);", "", " // Replace the dummy parameter node with the actual case", " // operand.", " testConditions.accept(new ReplaceNodeVisitor(vn, caseOperand));", " }", "", " // Finally, after we have determined that all the when operands", " // are compatible, and we have reinserted the case operand into", " // the tree, set the type of the case operand to the dominant", " // type of all the when operands.", " caseOperand.setType(", " caseOperandParameters.getDominantTypeServices());", " }", "" ], "header": "@@ -195,12 +196,41 @@ class ConditionalNode extends ValueNode", "removed": [ " bindCaseOperand(cc, fromList, subqueryList, aggregates);" ] } ] } ]
derby-DERBY-1576-d75118e9
DERBY-1576: Extend the CASE expression syntax for "simple case" Add test cases for subqueries. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1597082 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1576-f2dfe060
DERBY-1576: Extend the CASE expression syntax for "simple case" Cache the case operand so that it is only evaluated once per evaluation of the CASE expression. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1597979 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/compile/ConditionalNode.java", "hunks": [ { "added": [ " private CachedValueNode caseOperand;" ], "header": "@@ -50,7 +50,7 @@ class ConditionalNode extends ValueNode", "removed": [ " private ValueNode caseOperand;" ] }, { "added": [ " ConditionalNode(CachedValueNode caseOperand," ], "header": "@@ -70,7 +70,7 @@ class ConditionalNode extends ValueNode", "removed": [ " ConditionalNode(ValueNode caseOperand," ] }, { "added": [ " caseOperand = (CachedValueNode) caseOperand.bindExpression(" ], "header": "@@ -304,7 +304,7 @@ class ConditionalNode extends ValueNode", "removed": [ " caseOperand = caseOperand.bindExpression(" ] } ] } ]
derby-DERBY-158-02e0ae52
Fix for DERBY-158 PRIMARY KEY does not imply NOT NULL Columns specified in a PRIMARY KEY constraint in CREATE TABLE are implicitly set to NOT NULL per the SQL spec. If a PRIMARY KEY constraint is added using ALTER TABLE then all columns must also be NOT NULL. Similarly, columns specified in a UNIQUE constraint must still be explictly NOT NULL. git-svn-id: https://svn.apache.org/repos/asf/incubator/derby/code/trunk@156570 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/compile/TableElementList.java", "hunks": [ { "added": [], "header": "@@ -33,7 +33,6 @@ import org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor;", "removed": [ "import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;" ] }, { "added": [ "import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;" ], "header": "@@ -47,6 +46,7 @@ import org.apache.derby.impl.sql.execute.ConstraintConstantAction;", "removed": [] }, { "added": [ "\tprivate int\t\t\t\tnumColumns;", "\tprivate TableDescriptor td;" ], "header": "@@ -62,8 +62,8 @@ import java.util.Vector;", "removed": [ "\tint\t\t\t\tnumColumns;", "\tTableDescriptor td;" ] }, { "added": [ "" ], "header": "@@ -173,7 +173,7 @@ public class TableElementList extends QueryTreeNodeVector", "removed": [ "\t\t\t\t" ] }, { "added": [ "\t\t\t\t\tSchemaDescriptor sd = dropSchemaName == null ? td.getSchemaDescriptor() :" ], "header": "@@ -262,7 +262,7 @@ public class TableElementList extends QueryTreeNodeVector", "removed": [ "\t\t\t\t\tSchemaDescriptor sd = dropSchemaName == null ? td.getSchemaDescriptor() : " ] }, { "added": [ " if (cdn.hasPrimaryKeyConstraint())", " {", " // for PRIMARY KEY, check that columns are unique", " verifyUniqueColumnList(ddlStmt, cdn);", "", " if (td == null)", " {", " // in CREATE TABLE so set PRIMARY KEY columns to NOT NULL", " setColumnListToNotNull(cdn);", " }", " else", " {", " // in ALTER TABLE so raise error if any columns are nullable", " checkForNullColumns(cdn, td);", " }", " }", " else if (cdn.hasUniqueKeyConstraint())", " {", " // for UNIQUE, check that columns are unique and NOT NULL", " verifyUniqueColumnList(ddlStmt, cdn);", " checkForNullColumns(cdn, td);", " }", " else if (cdn.hasForeignKeyConstraint())", " {", " // for FOREIGN KEY, check that columns are unique", " verifyUniqueColumnList(ddlStmt, cdn);", " }" ], "header": "@@ -280,22 +280,33 @@ public class TableElementList extends QueryTreeNodeVector", "removed": [ "\t\t\t/* For primary/unique/unique keys, verify that the constraint's column", "\t\t\t * list contains valid columns and does not contain any duplicates", "\t\t\t * (Also, all columns in a primary key will be set to non-null,", "\t\t\t\tbut only in Cloudscape mode. SQL and DB2 require explict NOT NULL.", "\t\t\t */", "\t\t\tif (cdn.hasPrimaryKeyConstraint() ||", "\t\t\t\tcdn.hasForeignKeyConstraint() ||", "\t\t\t\tcdn.hasUniqueKeyConstraint())", "\t\t\t{", "\t\t\t\tverifyUniqueColumnList(ddlStmt, cdn);", "\t\t\t\t/* Raise error if primary or unique key columns can be nullable. */", "\t\t\t\tif (cdn.hasPrimaryKeyConstraint() || cdn.hasUniqueKeyConstraint())", "\t\t\t\t{", "\t\t\t\t\tsetColumnListToNotNull(cdn, td);", "\t\t\t\t}", "\t\t\t}" ] }, { "added": [ "", " /**" ], "header": "@@ -303,8 +314,8 @@ public class TableElementList extends QueryTreeNodeVector", "removed": [ "\t", "\t/**" ] } ] } ]
derby-DERBY-1581-4eece411
DERBY-1581 (partial) Clean-up some descriptor objects as a step to ensuring their identity is immutable once created and/or fully populated. Remove some unused methods. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@425116 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptor.java", "hunks": [ { "added": [ "\tfinal String\t\t\t\tconstraintName;", "\tprivate final boolean\t\t\t\tdeferrable;", "\tprivate final boolean\t\t\t\tinitiallyDeferred;", "\tprivate final int[]\t\t\t\treferencedColumns;", "\tfinal UUID\t\t\t\t\tconstraintId;", "\tprivate final SchemaDescriptor\tschemaDesc;", "\tprivate ColumnDescriptorList\tcolDL;" ], "header": "@@ -63,14 +63,14 @@ public abstract class ConstraintDescriptor", "removed": [ "\tString\t\t\t\tconstraintName;", "\tboolean\t\t\t\tdeferrable;", "\tboolean\t\t\t\tinitiallyDeferred;", "\tint[]\t\t\t\treferencedColumns;", "\tUUID\t\t\t\t\tconstraintId;", "\tSchemaDescriptor\tschemaDesc;", "\tColumnDescriptorList\tcolDL;" ] } ] }, { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/DefaultDescriptor.java", "hunks": [ { "added": [ "\tprivate final int\t\t\tcolumnNumber;", "\tprivate final UUID\t\tdefaultUUID;", "\tprivate final UUID\t\ttableUUID;" ], "header": "@@ -48,18 +48,9 @@ public class DefaultDescriptor", "removed": [ "\t/** public interface to this class ", "\t\t<ol>", "\t\t<li>public void setDefaultUUID(UUID defaultUUID);", "\t\t<li>public UUID\tgetTableUUID();", "\t\t</ol>", "\t*/", " ", "\t// implementation", "", "\tint\t\t\tcolumnNumber;", "\tUUID\t\tdefaultUUID;", "\tUUID\t\ttableUUID;" ] } ] }, { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/FileInfoDescriptor.java", "hunks": [ { "added": [ "public final class FileInfoDescriptor extends TupleDescriptor " ], "header": "@@ -34,7 +34,7 @@ import org.apache.derby.iapi.services.io.StoredFormatIds;", "removed": [ "public class FileInfoDescriptor extends TupleDescriptor " ] } ] }, { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java", "hunks": [ { "added": [], "header": "@@ -525,17 +525,6 @@ public class SPSDescriptor extends TupleDescriptor", "removed": [ "\t/**", "\t * Set the text of the USING clause. Used by", "\t * ALTER statement.", "\t *", "\t * @param usingText\tthe new value for the USING text", "\t */", "\tpublic final synchronized void setUsingText(String usingText)", "\t{", "\t\tthis.usingText = usingText;", "\t}", "" ] } ] } ]
derby-DERBY-1581-55de888a
DERBY-1581 Avoid reloading the Provider from the data dictionary when executing an invalidateFor on the Provider. Previosuly the code when loading the stored dependencies and converting them to an in-memory from reloaded the provider once per dependent. This patch re-uses the Provider passed into the invalidateFor method. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@425479 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/depend/BasicDependencyManager.java", "hunks": [ { "added": [ "\t * @param providerForList The provider if this list is being created", "\t * for a list of dependents. Null otherwise.", "\tprivate List getDependencyDescriptorList(List storedList,", "\t\t\tProvider providerForList)" ], "header": "@@ -1133,16 +1133,17 @@ public class BasicDependencyManager implements DependencyManager {", "removed": [ "\tprivate List getDependencyDescriptorList(List storedList)", "\t\tDataDictionary\t\t dd = getDataDictionary();", "" ] }, { "added": [ "\t\t\t\t\tif (providerForList != null)", "\t\t\t\t\t{", "\t\t\t\t\t\t// Use the provider being passed in.", "\t\t\t\t\t\ttempP = providerForList;", "\t\t\t\t\t\t", "\t\t\t\t\t\t// Sanity check the object identifiers match.", "\t\t\t\t\t\tif (SanityManager.DEBUG) {", "\t\t\t\t\t\t\tif (!tempP.getObjectID().equals(depDesc.getProviderID()))", "\t\t\t\t\t\t\t{", "\t\t\t\t\t\t\t\tSanityManager.THROWASSERT(\"mismatch providers\");", "\t\t\t\t\t\t\t}", "\t\t\t\t\t\t}", "\t\t\t\t\t}", "\t\t\t\t\telse", "\t\t\t\t\t{", "\t\t\t\t\t\tfinder = depDesc.getProviderFinder();", "\t\t\t\t\t\ttempP = (Provider) finder.getDependable( depDesc.getProviderID() );", "\t\t\t\t\t\t", "\t\t\t\t\t}", "" ], "header": "@@ -1165,13 +1166,26 @@ public class BasicDependencyManager implements DependencyManager {", "removed": [ "\t\t\t\t\tfinder = depDesc.getProviderFinder();", "\t\t\t\t\ttempP = (Provider) finder.getDependable( depDesc.getProviderID() );", "/*\t\t\t\t\tif (finder instanceof DDColumnDependableFinder)", "\t\t\t\t\t\t((TableDescriptor)tempP).setReferencedColumnMap(", "\t\t\t\t\t\t\tnew FormatableBitSet(((DDColumnDependableFinder) finder).", "\t\t\t\t\t\t\t\t\t\tgetColumnBitMap()));", "*/" ] }, { "added": [ "\tprivate List getProviders (Dependent d) throws StandardException {" ], "header": "@@ -1268,7 +1282,7 @@ public class BasicDependencyManager implements DependencyManager {", "removed": [ "\tprotected List getProviders (Dependent d) throws StandardException {" ] }, { "added": [ "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),", "\t\t\t\t\t\t\t\t(Provider) null" ], "header": "@@ -1298,7 +1312,8 @@ public class BasicDependencyManager implements DependencyManager {", "removed": [ "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)" ] }, { "added": [ "\tprivate List getDependents (Provider p) " ], "header": "@@ -1319,7 +1334,7 @@ public class BasicDependencyManager implements DependencyManager {", "removed": [ "\tprotected List getDependents (Provider p) " ] }, { "added": [ "\t\t\treturn deps;" ], "header": "@@ -1330,7 +1345,7 @@ public class BasicDependencyManager implements DependencyManager {", "removed": [ "\t\t\treturn (deps == null? null : deps);" ] }, { "added": [ "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t),", "\t\t\t\t\t\t\tp" ], "header": "@@ -1350,7 +1365,8 @@ public class BasicDependencyManager implements DependencyManager {", "removed": [ "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)" ] } ] } ]
derby-DERBY-1585-0f450705
DERBY-3304 DERBY-3037 DERBY-1585 I am adding a test case to check for the resultset from the java procedure call when the java procedure has done a rollback inside it. This test shows that in trunk, after checkin 602991 for DERBY-1585, a procedure does not return a resultset if there was a rollbck inside the procedure with resultset creation before rollback. This behavior is different than what happens in 10.2 codeline. In 10.2, a procedure will return a *closed* resultset if there was a rollback inside the procedure. But a procedure should not return closed result sets, so it appears that trunk is behaving correctly and 10.2's behavior was incorrect. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@628130 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/junit/JDBC.java", "hunks": [ { "added": [ " * Assert that the statement has no more results(getMoreResults) and it ", " * indeed does not return any resultsets(by checking getResultSet). ", " * Also, ensure that update count is -1.", " \tAssert.assertFalse(s.getMoreResults());", " Assert.assertTrue(s.getUpdateCount() == -1);", " Assert.assertNull(s.getResultSet());" ], "header": "@@ -523,15 +523,17 @@ public class JDBC {", "removed": [ " * Assert that the statement has no more results. Logic taken", " * from javadoc for java.sql.Statement.getMoreResults.", " Assert.assertTrue((s.getMoreResults() == false)", " && (s.getUpdateCount() == -1));" ] } ] } ]
derby-DERBY-1585-5b2b352a
DERBY-1585 For a CALL statement that generates dynamic result sets add code so that the result sets are closed if they are inaccessible following the SQL Standard. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@602991 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/jdbc/ConnectionContext.java", "hunks": [ { "added": [], "header": "@@ -21,7 +21,6 @@", "removed": [ "import org.apache.derby.iapi.error.StandardException;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java", "hunks": [ { "added": [ " " ], "header": "@@ -565,7 +565,7 @@ public abstract class EmbedResultSet extends ConnectionChild", "removed": [ "" ] } ] }, { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedStatement.java", "hunks": [ { "added": [], "header": "@@ -1272,8 +1272,6 @@ public class EmbedStatement extends ConnectionChild", "removed": [ "", "\t\t\t\t\tresultsToWrap.finish();\t// Don't need the result set any more" ] }, { "added": [ " ", " resultsToWrap.finish(); // Don't need the result set any more" ], "header": "@@ -1282,6 +1280,8 @@ public class EmbedStatement extends ConnectionChild", "removed": [] }, { "added": [ " // Clear the JDBC dynamic ResultSet from the language", " // ResultSet for the CALL statement. This stops the", " // CALL statement closing the ResultSet when its language", " // ResultSet is closed, which will happen just after the", " // call to the processDynamicResults() method.", "\t\t\tparam[0] = null;", " ", " // ignore non-Derby result sets or results sets from another connection", " // and closed result sets.", " EmbedResultSet lrs = EmbedStatement.processDynamicResult(", " getEmbedConnection(), rs, this);", " ", " if (lrs == null)", " {", " continue;", " }" ], "header": "@@ -1553,26 +1553,25 @@ public class EmbedStatement extends ConnectionChild", "removed": [ "\t\t\tif (param[0] == null)", "\t\t\t\tcontinue;", "", "\t\t\tparam[0] = null;", "", "\t\t\t// ignore non-Derby result sets or results sets from another connection", "\t\t\tif (!(rs instanceof EmbedResultSet))", "\t\t\t\tcontinue;", "", "\t\t\tEmbedResultSet lrs = (EmbedResultSet) rs;", "", "\t\t\tif (lrs.getEmbedConnection().rootConnection != getEmbedConnection().rootConnection)", "\t\t\t\tcontinue;", "\t\t\t// ignore closed result sets.", "\t\t\tif (lrs.isClosed)", "\t\t\t\tcontinue;", "\t\t\tlrs.setDynamicResultSet(this);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/CallStatementResultSet.java", "hunks": [ { "added": [ "import java.sql.ResultSet;", "import java.sql.SQLException;", "", "import org.apache.derby.iapi.jdbc.ConnectionContext;", " * Call a Java procedure. This calls a generated method in the", " * activation which sets up the parameters and then calls the", " * Java method that the procedure resolved to.", " * <P>", " * Valid dynamic results returned by the procedure will be closed", " * as inaccessible when this is closed (e.g. a CALL within a trigger).", " * ", " * <BR>", " * Any code that requires the dynamic results to be accessible", " * (such as the JDBC Statement object executing the CALL) must", " * obtain the dynamic results from Activation.getDynamicResults()", " * and remove each ResultSet it will be handling by clearing the", " * reference in the object returned.", " * ", " * @see Activation#getDynamicResults()" ], "header": "@@ -21,14 +21,30 @@", "removed": [ "import org.apache.derby.iapi.sql.ResultSet;", " * Call the specified expression, ignoring the return, if any.", " *" ] }, { "added": [ " * Just invoke the method.", " }", " ", " /**", " * Need to explicitly close any dynamic result sets.", " * <BR>", " * If the dynamic results are not accessible then they", " * need to be destroyed (ie. closed) according the the", " * SQL Standard.", " * <BR>", " * An execution of a CALL statement through JDBC makes the", " * dynamic results accessible, in this case the closing", " * of the dynamic result sets is handled by the JDBC", " * statement object (EmbedStatement) that executed the CALL.", " * We cannot unify the closing of dynamic result sets to", " * this close, as in accessible case it is called during", " * the Statement.execute call, thus it would close the", " * dynamic results before the application has a change", " * to use them.", " * ", " * <BR>", " * With an execution of a CALL", " * statement as a trigger's action statement the dynamic", " * result sets are not accessible. In this case this close", " * method is called after the execution of the trigger's", " * action statement.", " * <BR>", " * <BR>", " * Section 4.27.5 of the TECHNICAL CORRIGENDUM 1 to the SQL 2003", " * Standard details what happens to dynamic result sets in detail,", " * the SQL 2003 foundation document is missing these details.", " */", " public void close() throws StandardException", " {", " super.close();", " ", " ", " ", " ResultSet[][] dynamicResults = getActivation().getDynamicResults();", " if (dynamicResults != null)", " {", " // Need to ensure all the result sets opened by this", " // CALL statement for this connection are closed.", " // If any close() results in an exception we need to keep going,", " // save any exceptions and then throw them once we are complete.", " StandardException errorOnClose = null;", " ", " ConnectionContext jdbcContext = null;", " ", " for (int i = 0; i < dynamicResults.length; i++)", " {", " ResultSet[] param = dynamicResults[i];", " ResultSet drs = param[0];", " ", " // Can be null if the procedure never set this parameter", " // or if the dynamic results were processed by JDBC (EmbedStatement).", " if (drs == null)", " continue;", " ", " if (jdbcContext == null)", " jdbcContext = (ConnectionContext)", " lcc.getContextManager().getContext(ConnectionContext.CONTEXT_ID);", " ", " try {", " ", " // Is this a valid, open dynamic result set for this connection?", " if (!jdbcContext.processInaccessibleDynamicResult(drs))", " {", " // If not just ignore it, not Derby's problem.", " continue;", " }", " ", " drs.close();", " ", " } catch (SQLException e) {", " ", " // Just report the first error", " if (errorOnClose == null)", " {", " StandardException se = StandardException.plainWrapException(e);", " errorOnClose = se;", " }", " }", " finally {", " // Remove any reference to the ResultSet to allow", " // it and any associated resources to be garbage collected.", " param[0] = null;", " }", " }", " ", " if (errorOnClose != null)", " throw errorOnClose;", " } " ], "header": "@@ -49,13 +65,105 @@ class CallStatementResultSet extends NoRowsResultSetImpl", "removed": [ "\t\tclose();" ] } ] } ]
derby-DERBY-1586-5d18b03d
DERBY-1586 (partial) The attributesAsPassword property doesn't work correctly with EmbeddedConnectionPoolDataSource This patch adds a JUnit test which reproduces the bug. The test is not run in any suite since the bug is not fixed. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@425385 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1589-52a0f73d
DERBY-3376: Test case in GrantRevokeDDLTest commented out This change adds some additional tests to GrantRevokeDDLTest. The test cases were originally contributed by Yip Ng (yipng168 at gmail dot com) The tests were originally written during buddy testing of Derby 10.2, and were committed as part of DERBY-1736, but were commented out at the time due to DERBY-1589. The test cases now pass, and so this change enables the tests as part of GrantRevokeDDLTest. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@831762 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1595-3f3312eb
DERBY-1595: Network server fails with DRDAProtocolException if a BLOB with size 2147483647 is streamed from client Switched from int to long when dealing with scalar streams, which can be longer than Integer.MAX_VALUE and cause arithmetic overflow. Introduced 'nullIndicatorSize' to duplicate less code. Patch file: derby-1595-2a-client_int_overflow.diff git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@958939 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/client/org/apache/derby/client/net/Request.java", "hunks": [ { "added": [ "import org.apache.derby.client.am.DateTimeValue;", "import org.apache.derby.shared.common.sanity.SanityManager;", "import java.io.IOException;" ], "header": "@@ -21,18 +21,19 @@", "removed": [ "import java.io.IOException;", "import org.apache.derby.client.am.DateTimeValue;" ] }, { "added": [ " long length,", "" ], "header": "@@ -245,11 +246,11 @@ public class Request {", "removed": [ " int length,", "\t\t" ] }, { "added": [ " long length," ], "header": "@@ -297,7 +298,7 @@ public class Request {", "removed": [ " int length," ] }, { "added": [ " long leftToRead = length;", " long bytesToSend = writeEXTDTAStatusByte ? leftToRead + 1 : leftToRead;", " int nullIndicatorSize = writeNullByte ? 1 : 0;", " int dssMaxDataLength = DssConstants.MAX_DSS_LEN - 6 - 4 -", " nullIndicatorSize - extendedLengthByteCount;", " int bytesToRead = (int)Math.min(bytesToSend, dssMaxDataLength);" ], "header": "@@ -309,19 +310,16 @@ public class Request {", "removed": [ "\t\tint leftToRead = length;", " int bytesToSend = writeEXTDTAStatusByte ? leftToRead + 1 : leftToRead;", "\t\tint bytesToRead;", "\t\t\t\t", "\t\tif (writeNullByte) {", " bytesToRead = Math.min(bytesToSend, DssConstants.MAX_DSS_LEN - 6 - 4 - 1 - extendedLengthByteCount);", "\t\t} else {", " bytesToRead = Math.min(bytesToSend, DssConstants.MAX_DSS_LEN - 6 - 4 - extendedLengthByteCount);", "\t\t}" ] }, { "added": [ "", " length * 2L," ], "header": "@@ -519,11 +517,11 @@ public class Request {", "removed": [ " ", " length * 2," ] }, { "added": [ " long leftToRead)", " throws DisconnectException {", " int nullIndicatorSize = writeNullByte ? 1 : 0;", " int extendedLengthByteCount = calculateExtendedLengthByteCount(", " leftToRead + 4 + nullIndicatorSize);", " if ((10 + extendedLengthByteCount + nullIndicatorSize +", " leftToRead + offset_) > DssConstants.MAX_DSS_LEN) {" ], "header": "@@ -553,21 +551,15 @@ public class Request {", "removed": [ " int leftToRead) throws DisconnectException {", " int extendedLengthByteCount;", "", " int nullIndicatorSize = 0;", " if (writeNullByte) {", " // leftToRead is cast to (long) on the off chance that +4+1 pushes it outside the range of int", " extendedLengthByteCount = calculateExtendedLengthByteCount((long) leftToRead + 4 + 1);", " nullIndicatorSize = 1;", " } else {", " extendedLengthByteCount = calculateExtendedLengthByteCount(leftToRead + 4);", " }", " // leftToRead is cast to (long) on the off chance that +4+1 pushes it outside the range of int", " if (10 + extendedLengthByteCount + nullIndicatorSize + (long) leftToRead + offset_ > DssConstants.MAX_DSS_LEN) {" ] }, { "added": [ " protected final int flushScalarStreamSegment(long leftToRead," ], "header": "@@ -621,7 +613,7 @@ public class Request {", "removed": [ " protected final int flushScalarStreamSegment(int leftToRead," ] }, { "added": [ " newBytesToRead = (int)Math.min(leftToRead, 32765L);" ], "header": "@@ -638,7 +630,7 @@ public class Request {", "removed": [ " newBytesToRead = Math.min(leftToRead, 32765);" ] }, { "added": [ " protected final void padScalarStreamForError(long leftToRead," ], "header": "@@ -675,7 +667,7 @@ public class Request {", "removed": [ " protected final void padScalarStreamForError(int leftToRead," ] }, { "added": [ " long leftToRead,", " int nullIndicatorSize = writeNullByte ? 1 : 0;", " writeExtendedLengthBytes(", " extendedLengthByteCount, leftToRead + nullIndicatorSize);", " if (SanityManager.DEBUG) {", " SanityManager.ASSERT(leftToRead +4 + nullIndicatorSize <=", " DssConstants.MAX_DSS_LEN);", " writeLengthCodePoint((int)(leftToRead + 4 + nullIndicatorSize),", " codePoint);" ], "header": "@@ -1577,24 +1569,22 @@ public class Request {", "removed": [ " int leftToRead,", "", " if (writeNullByte) {", " writeExtendedLengthBytes(extendedLengthByteCount, leftToRead + 1);", " } else {", " writeExtendedLengthBytes(extendedLengthByteCount, leftToRead);", " }", " if (writeNullByte) {", " writeLengthCodePoint(leftToRead + 4 + 1, codePoint);", " } else {", " writeLengthCodePoint(leftToRead + 4, codePoint);" ] } ] } ]
derby-DERBY-1595-53795a1a
DERBY-1595 (partial): Network server fails with DRDAProtocolException if a BLOB with size 2147483647 is streamed from client Fixed protocol disagreement, where the client sent eight bytes for the extended length bytes and the server expected six bytes (changed the client behavior). Patch file: derby-1595-1a-client_write6bytes.diff git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@955540 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/client/org/apache/derby/client/am/SignedBinary.java", "hunks": [ { "added": [ " /** Maximum value that cen be encoded by 6 bytes (signed). */", " public static final long MAX_LONG_6_BYTES_SIGNED = 0x7FFFFFFFFFFFL;", "" ], "header": "@@ -25,6 +25,9 @@ public class SignedBinary {", "removed": [] } ] }, { "file": "java/client/org/apache/derby/client/net/Request.java", "hunks": [ { "added": [ " /**", " * Writes a long into the buffer, using six bytes.", " *", " * @param v the value to write", " * @throws IllegalArgumentException if the long value is too large to be", " * represented by six bytes.", " */", " final void writeLong6Bytes(long v) {", " ensureLength(offset_ + 6);", " org.apache.derby.client.am.SignedBinary.long6BytesToBigEndianBytes(", " bytes_, offset_, v);", " offset_ += 6;", " }", "" ], "header": "@@ -1551,6 +1551,20 @@ public class Request {", "removed": [] } ] } ]
derby-DERBY-1605-82cb66b5
DERBY-1605: To determine whether or not JVM has JDBC4, compare with java.specification.version, not java.vm.version. Committed for Myrna Van Lunteren <[email protected]> git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@427193 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1609-2b477108
DERBY-1609 (partial) Have ij.runScript use utilMain directly, rather than Main, to avoid one additional object. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@426893 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/tools/org/apache/derby/tools/ij.java", "hunks": [ { "added": [ "import org.apache.derby.impl.tools.ij.utilMain;" ], "header": "@@ -26,6 +26,7 @@ import org.apache.derby.iapi.tools.i18n.LocalizedOutput;", "removed": [] }, { "added": [ "\t\t ijE = new Main(false);", "\t\t ijE = new org.apache.derby.impl.tools.ij.Main14(false);", "\t utilMain um = ijE.getutilMain(1, lo);", "", "\t um.goScript(conn, li);" ], "header": "@@ -100,18 +101,19 @@ public class ij {", "removed": [ "\t\t ijE = new Main(lo);", "\t\t ijE = new org.apache.derby.impl.tools.ij.Main14(lo);", "\t ", "\t ijE.goScript(conn, li);" ] } ] } ]
derby-DERBY-1609-2d5faea2
DERBY-1609 (partial) Minor cleanup in ij.Main.java, remove unused field & method and make two public fields private. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@426671 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/tools/org/apache/derby/impl/tools/ij/Main.java", "hunks": [ { "added": [ "\tprivate LocalizedOutput out;", "\tprivate utilMain utilInstance;" ], "header": "@@ -57,11 +57,8 @@ import java.util.*;", "removed": [ "\tpublic LocalizedOutput out;", "\tpublic utilMain utilInstance;", "\tpublic Class langUtilClass;", "", "" ] }, { "added": [], "header": "@@ -207,15 +204,6 @@ public class Main {", "removed": [ "\tpublic void go(InputStream in, PrintStream out, ", "\t\t\t\t Properties connAttributeDefaults)", "\t{", " initAppUI();", " \tLocalizedResource langUtil = LocalizedResource.getInstance();", "\t\tgo(langUtil.getNewInput(in), langUtil.getNewOutput(out),", "\t\t\t connAttributeDefaults);", "\t}", "" ] } ] } ]
derby-DERBY-1609-351dad86
DERBY-1609 (partial) Fix a security exception reading the system property ij.showErrorCode. Add code to return an error count for runScript (still needs to be tested). git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@433273 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/tools/org/apache/derby/impl/tools/ij/utilMain.java", "hunks": [ { "added": [ "\t/**", "\t * True if to display the error code when", "\t * displaying a SQLException.", "\t */", "\tprivate final boolean showErrorCode;" ], "header": "@@ -78,6 +78,11 @@ public class utilMain implements java.security.PrivilegedAction {", "removed": [] }, { "added": [ "\t\t", "\t\tshowErrorCode = ", "\t\t\tBoolean.valueOf(", "\t\t\t\t\tutil.getSystemProperty(\"ij.showErrorCode\")", "\t\t\t\t\t).booleanValue();" ], "header": "@@ -136,6 +141,11 @@ public class utilMain implements java.security.PrivilegedAction {", "removed": [] }, { "added": [ "\tpublic void initFromEnvironment()", "\t\tijParser.initFromEnvironment();", "\t\t" ], "header": "@@ -159,8 +169,10 @@ public class utilMain implements java.security.PrivilegedAction {", "removed": [ "\tpublic void initConnections()" ] }, { "added": [ "\tpublic int goScript(Connection conn,", "\t\treturn runScriptGuts();", " * @return The number of errors seen in the script.", "\tprivate int runScriptGuts() {", " int scriptErrorCount = 0;" ], "header": "@@ -257,23 +269,25 @@ public class utilMain implements java.security.PrivilegedAction {", "removed": [ "\tpublic void goScript(Connection conn,", "\t\trunScriptGuts();", "\tprivate void runScriptGuts() {" ] }, { "added": [ " scriptErrorCount++;", " scriptErrorCount++;", " scriptErrorCount++;", " scriptErrorCount++;", " scriptErrorCount++;" ], "header": "@@ -345,18 +359,23 @@ public class utilMain implements java.security.PrivilegedAction {", "removed": [] }, { "added": [ " ", " return scriptErrorCount;" ], "header": "@@ -364,6 +383,8 @@ public class utilMain implements java.security.PrivilegedAction {", "removed": [] }, { "added": [ "\t\tif (showErrorCode) {" ], "header": "@@ -524,7 +545,7 @@ public class utilMain implements java.security.PrivilegedAction {", "removed": [ "\t\tif (Boolean.getBoolean(\"ij.showErrorCode\")) {" ] } ] } ]
derby-DERBY-1609-43e6994a
DERBY-1609 (partial) Move initializing connections from system properties in ij's utilMain into a separate method from the constructor. Allows ij's runScript method to create a constructor without creating unrequired connections based upon System properties. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@427293 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/tools/org/apache/derby/impl/tools/ij/Main.java", "hunks": [ { "added": [], "header": "@@ -57,7 +57,6 @@ import java.util.*;", "removed": [ "\tprivate LocalizedOutput out;" ] }, { "added": [ "\tprivate void go(LocalizedInput in, LocalizedOutput out , " ], "header": "@@ -197,7 +196,7 @@ public class Main {", "removed": [ "\tpublic void go(LocalizedInput in, LocalizedOutput out , " ] } ] }, { "file": "java/tools/org/apache/derby/impl/tools/ij/utilMain.java", "hunks": [ { "added": [ "\tprivate final int\t\tnumConnections;" ], "header": "@@ -69,7 +69,7 @@ public class utilMain implements java.security.PrivilegedAction {", "removed": [ "\tprivate int\t\tnumConnections;" ] }, { "added": [ "\tutilMain(int numConnections, LocalizedOutput out)" ], "header": "@@ -97,7 +97,7 @@ public class utilMain implements java.security.PrivilegedAction {", "removed": [ "\tpublic utilMain(int numConnections, LocalizedOutput out)" ] }, { "added": [ "\tutilMain(int numConnections, LocalizedOutput out, Hashtable ignoreErrors)" ], "header": "@@ -115,7 +115,7 @@ public class utilMain implements java.security.PrivilegedAction {", "removed": [ "\tpublic utilMain(int numConnections, LocalizedOutput out, Hashtable ignoreErrors)" ] }, { "added": [ "\t\t}", "", "\t\t/* Start with connection/user 0 */", "\t\tcurrCE = 0;", "\t\tfileInput = false;", "\t\tinitialFileInput = false;", "\t\tfirstRun = true;", "\t}", "\t", "\t/**", "\t * Initialize the connections from the environment.", "\t *", "\t */", "\tvoid initConnections()", "\t{", "\t\tfor (int ictr = 0; ictr < numConnections; ictr++)", "\t\t{" ], "header": "@@ -145,6 +145,23 @@ public class utilMain implements java.security.PrivilegedAction {", "removed": [] } ] }, { "file": "java/tools/org/apache/derby/impl/tools/ij/utilMain14.java", "hunks": [ { "added": [ "class utilMain14 extends utilMain" ], "header": "@@ -36,7 +36,7 @@ import org.apache.derby.iapi.tools.i18n.LocalizedOutput;", "removed": [ "public class utilMain14 extends utilMain" ] }, { "added": [ "\tutilMain14(int numConnections, LocalizedOutput out)" ], "header": "@@ -45,7 +45,7 @@ public class utilMain14 extends utilMain", "removed": [ "\tpublic utilMain14(int numConnections, LocalizedOutput out)" ] }, { "added": [ "\tutilMain14(int numConnections, LocalizedOutput out, Hashtable ignoreErrors)" ], "header": "@@ -64,7 +64,7 @@ public class utilMain14 extends utilMain", "removed": [ "\tpublic utilMain14(int numConnections, LocalizedOutput out, Hashtable ignoreErrors)" ] } ] } ]
derby-DERBY-1609-79b6c666
DERBY-1609 (partial) Remove some unused code in JDBCDisplayUtil. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@433274 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/tools/org/apache/derby/tools/JDBCDisplayUtil.java", "hunks": [ { "added": [], "header": "@@ -67,40 +67,6 @@ public class JDBCDisplayUtil {", "removed": [ "", "\t//-----------------------------------------------------------------", "\t// Methods for initialization resource bundle and codeset's output", "\t", "\t/**", "\t * init method - will init the class to support a locale and", "\t * codeset based on the derby.ui.locale and derby.ui.codeset", "\t * properties if exists or using the default values from the JVM.", "\t */", "\tstatic public boolean init() {", "\t\treturn (LocalizedResource.getInstance() != null);", "\t}", "", "\t/**", "\t * init method - will init the class to support a locale and", "\t * codeset based on the derby.ui.locale properties and on the ", " * given codeset if exists or using the default values from the JVM.", "\t */", "\tpublic static boolean init(String codeset) {", "\t\treturn init(codeset, null);", "\t}", "", "\t/**", "\t * init method - will init the class to support a locale and", "\t * codeset based on the given codeset and locale.", "\t * If the parameters are null it will try to init use derby.ui.locale", "\t * and derby.ui.codeset properties if exists or using the default", "\t * values from the JVM.", "\t */", "\tpublic static boolean init(String pCodeset, String pLocale) {", "\t\tLocalizedResource.getInstance().init(pCodeset, pLocale,null);", "\t\treturn true;", "\t}", "" ] } ] } ]
derby-DERBY-1609-95011a07
DERBY-1609 Add IJRunScriptTest and _Suite JUnit tests for the testing of ij.runScript. Modify runScript to take an OutputStream instead of a PrintStream, fix it to correctly return the number of errors seen while running the script. Add utility methods to BaseJDBCTestCase to run setup scripts from an InputStream or a String. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@433331 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/tools/org/apache/derby/impl/tools/ij/utilMain.java", "hunks": [ { "added": [ " ", " /**", " * Value of the system property ij.execptionTrace", " */", " private final String ijExceptionTrace;" ], "header": "@@ -83,6 +83,11 @@ public class utilMain implements java.security.PrivilegedAction {", "removed": [] }, { "added": [ " ", " ijExceptionTrace = util.getSystemProperty(\"ij.exceptionTrace\");" ], "header": "@@ -146,6 +151,8 @@ public class utilMain implements java.security.PrivilegedAction {", "removed": [] }, { "added": [ " \t\t\t\t\tif (command != null)", " scriptErrorCount += doCatch(command) ? 0 : 1;", " \t\t\t\t\tif (command != null)", " scriptErrorCount += doCatch(command) ? 0 : 1;" ], "header": "@@ -359,11 +366,11 @@ public class utilMain implements java.security.PrivilegedAction {", "removed": [ " scriptErrorCount++;", "\t\t\t\t\tif (command != null) doCatch(command);", " scriptErrorCount++;", "\t\t\t\t\tif (command != null) doCatch(command);" ] }, { "added": [ "\tprivate boolean doCatch(String command) {", " " ], "header": "@@ -491,12 +498,13 @@ public class utilMain implements java.security.PrivilegedAction {", "removed": [ "\tprivate void doCatch(String command) {" ] }, { "added": [ " return true;" ], "header": "@@ -515,6 +523,7 @@ public class utilMain implements java.security.PrivilegedAction {", "removed": [] }, { "added": [ " return false;" ], "header": "@@ -530,6 +539,7 @@ public class utilMain implements java.security.PrivilegedAction {", "removed": [] }, { "added": [ "\t\t\tdoTrace(e);" ], "header": "@@ -578,7 +588,7 @@ public class utilMain implements java.security.PrivilegedAction {", "removed": [ "\t\t\tJDBCDisplayUtil.doTrace(out, e);" ] } ] }, { "file": "java/tools/org/apache/derby/tools/ij.java", "hunks": [ { "added": [ "import java.io.OutputStream;" ], "header": "@@ -31,6 +31,7 @@ import org.apache.derby.impl.tools.ij.utilMain;", "removed": [] }, { "added": [ " * SQL commands are separated by a semi-colon ';' character.", " * @param sqlOut OutputStream for the script's output" ], "header": "@@ -74,11 +75,12 @@ public class ij {", "removed": [ " * @param sqlOut PrintStream for the script's output" ] }, { "added": [ "\t\t OutputStream sqlOut," ], "header": "@@ -87,7 +89,7 @@ public class ij {", "removed": [ "\t\t PrintStream sqlOut," ] }, { "added": [ "\t return um.goScript(conn, li);" ], "header": "@@ -119,9 +121,7 @@ public class ij {", "removed": [ "\t um.goScript(conn, li);", "\t ", "\t return -1;" ] } ] } ]
derby-DERBY-1609-a5a98ce8
DERBY-1609 (partial) Add a runScript method to ij. Initial version runs a script successfully using the passed in connection. More work is needed to avoid the standard ij startup which opens connections and to return the number of errors. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@426849 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/tools/org/apache/derby/iapi/tools/i18n/LocalizedResource.java", "hunks": [ { "added": [ "\tprivate static final boolean HAVE_BIG_DECIMAL;", "\tstatic {" ], "header": "@@ -44,9 +44,9 @@ import java.sql.Types;", "removed": [ "\tprivate static boolean HAVE_BIG_DECIMAL;", "\t{" ] } ] }, { "file": "java/tools/org/apache/derby/impl/tools/ij/utilMain.java", "hunks": [ { "added": [ " private static final Class[] CONN_PARAM = { Integer.TYPE };", " private static final Object[] CONN_ARG = { new Integer(JDBC30Translation.CLOSE_CURSORS_AT_COMMIT)};", "\tprivate StatementFinder[] commandGrabber;", "\tprivate int currCE;" ], "header": "@@ -60,15 +60,15 @@ import java.lang.reflect.*;", "removed": [ " private static Class[] CONN_PARAM = { Integer.TYPE };", " private static Object[] CONN_ARG = { new Integer(JDBC30Translation.CLOSE_CURSORS_AT_COMMIT)};", "\tStatementFinder[] commandGrabber;", "\tint currCE;" ] }, { "added": [], "header": "@@ -177,10 +177,6 @@ public class utilMain implements java.security.PrivilegedAction {", "removed": [ "\t\tboolean done = false;", "", "\t\tString command = null;", "" ] }, { "added": [ "\t\tthis.out = out;", "\t\trunScriptGuts();", "\t\tcleanupGo(in);", "\t}", "\t", "\t/**", "\t * Support to run a script. Performs minimal setup", "\t * to set the passed in connection into the existing", "\t * ij setup, ConnectionEnv.", "\t * @param conn", "\t * @param in", "\t */", "\tpublic void goScript(Connection conn,", "\t\t\tLocalizedInput in)", "\t{", "\t\tJDBCDisplayUtil.showSelectCount = false;", "\t\tconnEnv[0].addSession(conn, (String) null);", "\t\tfileInput = initialFileInput = !in.isStandardInput();", "\t\tcommandGrabber[0].ReInit(in);", "\t\trunScriptGuts();", "\t}", "\t", "\t/**", "\t * Run the guts of the script. Split out to allow", "\t * calling from the full ij and the minimal goScript.", "\t *", "\t */", "\tprivate void runScriptGuts() {", "\t\t", "\t\tboolean done = false;", "\t\tString command = null;" ], "header": "@@ -237,7 +233,38 @@ public class utilMain implements java.security.PrivilegedAction {", "removed": [] }, { "added": [ " \t\t\t\tcommand = null;" ], "header": "@@ -247,8 +274,7 @@ public class utilMain implements java.security.PrivilegedAction {", "removed": [ "\t\t\t\tcommand = null;", "" ] }, { "added": [ "\t}", "\t", "\t/**", "\t * Perform cleanup after a script has been run.", "\t * Close the input streams if required and shutdown", "\t * derby on an exit.", "\t * @param in", "\t */", "\tprivate void cleanupGo(LocalizedInput[] in) {" ], "header": "@@ -326,6 +352,15 @@ public class utilMain implements java.security.PrivilegedAction {", "removed": [] } ] }, { "file": "java/tools/org/apache/derby/tools/ij.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.tools.i18n.LocalizedInput;", "import org.apache.derby.iapi.tools.i18n.LocalizedOutput;", "import org.apache.derby.iapi.tools.i18n.LocalizedResource;", "import java.io.InputStream;", "import java.io.PrintStream;", "import java.io.UnsupportedEncodingException;", "import java.sql.Connection;", "import java.util.Properties;" ], "header": "@@ -21,10 +21,18 @@", "removed": [] }, { "added": [ " ", " /**", " * Run a SQL script from an InputStream and write", " * the resulting output to the provided PrintStream.", " * ", " * @param conn Connection to be used as the script's default connection. ", " * @param sqlIn InputStream for the script.", " * @param inputEncoding Encoding of the script.", " * @param sqlOut PrintStream for the script's output", " * @param outputEncoding Output encoding to use.", " * @return Number of SQLExceptions thrown during the execution, -1 if not known.", " * @throws UnsupportedEncodingException", " */", " public static int runScript(", "\t\t Connection conn,", "\t\t InputStream sqlIn,", "\t\t String inputEncoding,", "\t\t PrintStream sqlOut,", "\t\t String outputEncoding)", "\t\t throws UnsupportedEncodingException", " {", "\t LocalizedOutput lo = ", "\t\t outputEncoding == null ?", "\t\t\t\t LocalizedResource.getInstance().", "\t\t getNewOutput(sqlOut)", "\t : ", "\t\t LocalizedResource.getInstance().", " getNewEncodedOutput(sqlOut, outputEncoding);", "", "\t Main ijE;", "\t if (JVMInfo.JDK_ID == JVMInfo.J2SE_13)", "\t {", "\t\t ijE = new Main(lo);", "\t }", "\t else", "\t {", "\t\t ijE = new org.apache.derby.impl.tools.ij.Main14(lo);", "\t }\t ", "\t ", "\t LocalizedInput li = LocalizedResource.getInstance().", "\t getNewEncodedInput(sqlIn, inputEncoding);", "\t ", "\t ", "\t ijE.goScript(conn, li);", "\t ", "\t return -1;", " }" ], "header": "@@ -60,6 +68,53 @@ public class ij {", "removed": [] } ] } ]
derby-DERBY-1610-211c9859
- DERBY-1610 Resolve difference of type compatibility between Embedded and NetworkServer/NetworkDriver - Fix to resolve error in jdk13 test of compatibility suite - Patch by Tomohito Nakayama ([email protected]) git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@454098 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/client/org/apache/derby/client/am/PreparedStatement.java", "hunks": [ { "added": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex) ;" ], "header": "@@ -405,7 +405,7 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getParameterMetaData().getParameterType(parameterIndex) ;" ] }, { "added": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ], "header": "@@ -465,7 +465,7 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getParameterMetaData().getParameterType(parameterIndex);" ] }, { "added": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ], "header": "@@ -494,7 +494,7 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getParameterMetaData().getParameterType(parameterIndex);" ] }, { "added": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ], "header": "@@ -523,7 +523,7 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getParameterMetaData().getParameterType(parameterIndex);" ] }, { "added": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ], "header": "@@ -559,7 +559,7 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getParameterMetaData().getParameterType(parameterIndex);" ] }, { "added": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ], "header": "@@ -593,7 +593,7 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getParameterMetaData().getParameterType(parameterIndex);" ] }, { "added": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ], "header": "@@ -621,7 +621,7 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getParameterMetaData().getParameterType(parameterIndex);" ] }, { "added": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ], "header": "@@ -650,7 +650,7 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getParameterMetaData().getParameterType(parameterIndex);" ] }, { "added": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ], "header": "@@ -679,7 +679,7 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getParameterMetaData().getParameterType(parameterIndex);" ] }, { "added": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ], "header": "@@ -713,7 +713,7 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getParameterMetaData().getParameterType(parameterIndex);" ] }, { "added": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ], "header": "@@ -781,7 +781,7 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getParameterMetaData().getParameterType(parameterIndex);" ] }, { "added": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ], "header": "@@ -848,7 +848,7 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getParameterMetaData().getParameterType(parameterIndex);" ] }, { "added": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ], "header": "@@ -922,7 +922,7 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getParameterMetaData().getParameterType(parameterIndex);" ] }, { "added": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ], "header": "@@ -958,7 +958,7 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getParameterMetaData().getParameterType(parameterIndex);" ] }, { "added": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ], "header": "@@ -1007,7 +1007,7 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getParameterMetaData().getParameterType(parameterIndex);" ] }, { "added": [ " checkTypeForSetAsciiStream(getColumnMetaDataX().getColumnType(parameterIndex)," ], "header": "@@ -1085,7 +1085,7 @@ public class PreparedStatement extends Statement", "removed": [ " checkTypeForSetAsciiStream(getParameterMetaData().getParameterType(parameterIndex)," ] }, { "added": [ " checkTypeForSetCharacterStream(getColumnMetaDataX().getColumnType(parameterIndex)," ], "header": "@@ -1213,7 +1213,7 @@ public class PreparedStatement extends Statement", "removed": [ " checkTypeForSetCharacterStream(getParameterMetaData().getParameterType(parameterIndex)," ] }, { "added": [ " checkTypeForSetCharacterStream(getColumnMetaDataX().getColumnType(parameterIndex)," ], "header": "@@ -1252,7 +1252,7 @@ public class PreparedStatement extends Statement", "removed": [ " checkTypeForSetCharacterStream(getParameterMetaData().getParameterType(parameterIndex)," ] }, { "added": [ " checkTypeForSetBlob(getColumnMetaDataX().getColumnType(parameterIndex)," ], "header": "@@ -1316,7 +1316,7 @@ public class PreparedStatement extends Statement", "removed": [ " checkTypeForSetBlob(getParameterMetaData().getParameterType(parameterIndex)," ] }, { "added": [ " checkTypeForSetClob(getColumnMetaDataX().getColumnType(parameterIndex)," ], "header": "@@ -1347,7 +1347,7 @@ public class PreparedStatement extends Statement", "removed": [ " checkTypeForSetClob(getParameterMetaData().getParameterType(parameterIndex)," ] }, { "added": [ " ( getColumnMetaDataX() );", " private ColumnMetaData getColumnMetaDataX() {", " return ", " parameterMetaData_ != null ?", " parameterMetaData_ : ", " ClientDriver.getFactory().newColumnMetaData(agent_.logWriter_, 0);", " }", "" ], "header": "@@ -1772,15 +1772,20 @@ public class PreparedStatement extends Statement", "removed": [ " (parameterMetaData_ != null", " ? parameterMetaData_", " : ClientDriver.getFactory().newColumnMetaData(agent_.logWriter_, 0));" ] }, { "added": [ " checkTypeForSetAsciiStream(getColumnMetaDataX().getColumnType( parameterIndex)," ], "header": "@@ -2595,7 +2600,7 @@ public class PreparedStatement extends Statement", "removed": [ " checkTypeForSetAsciiStream(getParameterMetaData().getParameterType( parameterIndex)," ] }, { "added": [ " checkTypeForSetClob(getColumnMetaDataX().getColumnType(parameterIndex)," ], "header": "@@ -2661,7 +2666,7 @@ public class PreparedStatement extends Statement", "removed": [ " checkTypeForSetClob(getParameterMetaData().getParameterType(parameterIndex)," ] }, { "added": [ " checkTypeForSetBlob(getColumnMetaDataX().getColumnType(parameterIndex)," ], "header": "@@ -2731,7 +2736,7 @@ public class PreparedStatement extends Statement", "removed": [ " checkTypeForSetBlob(getParameterMetaData().getParameterType(parameterIndex)," ] } ] } ]
derby-DERBY-1610-486f51a8
- DERBY-1610 Resolve difference of type compatibility between Embedded and NetworkServer/NetworkDriver - Patch by Tomohito Nakayama ([email protected]) git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@453886 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/client/org/apache/derby/client/am/PreparedStatement.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.services.sanity.SanityManager;", "import java.util.Arrays;" ], "header": "@@ -23,11 +23,13 @@ package org.apache.derby.client.am;", "removed": [] }, { "added": [ " ", " final int paramType = getParameterMetaData().getParameterType(parameterIndex) ;", " ", " if( ! PossibleTypes.getPossibleTypesForNull( paramType ).checkType( jdbcType )){", " ", " //This exception mimic embedded behavior.", " //see http://issues.apache.org/jira/browse/DERBY-1610#action_12432568", " PossibleTypes.throw22005Exception(agent_.logWriter_,", " jdbcType,", " paramType );", " }", " " ], "header": "@@ -402,6 +404,18 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [ " ", " final int paramType = getParameterMetaData().getParameterType(parameterIndex);", "", " if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType(paramType) ) {", " ", " PossibleTypes.throw22005Exception(agent_.logWriter_,", " java.sql.Types.BOOLEAN,", " paramType);", " ", " }", " " ], "header": "@@ -450,6 +464,17 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [ " ", " final int paramType = getParameterMetaData().getParameterType(parameterIndex);", " ", " if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType( paramType ) ){", " ", " PossibleTypes.throw22005Exception(agent_.logWriter_,", " java.sql.Types.TINYINT,", " paramType);", " ", " }", " " ], "header": "@@ -468,6 +493,17 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [ " ", " final int paramType = getParameterMetaData().getParameterType(parameterIndex);", "", " if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType(paramType) ){", " ", " PossibleTypes.throw22005Exception(agent_.logWriter_,", " java.sql.Types.SMALLINT,", " paramType);", " ", "", " }", " " ], "header": "@@ -486,6 +522,18 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [ " ", " final int paramType = getParameterMetaData().getParameterType(parameterIndex);", "", " if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType(paramType) ){", " ", " PossibleTypes.throw22005Exception(agent_.logWriter_,", " java.sql.Types.INTEGER,", " paramType);", " }", " " ], "header": "@@ -510,6 +558,16 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [ " ", " final int paramType = getParameterMetaData().getParameterType(parameterIndex);", " ", " if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType(paramType) ){", " ", " PossibleTypes.throw22005Exception(agent_.logWriter_,", " java.sql.Types.INTEGER,", " paramType);", " }", " " ], "header": "@@ -534,6 +592,16 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [ " ", " final int paramType = getParameterMetaData().getParameterType(parameterIndex);", "", " if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType(paramType) ){", " ", " PossibleTypes.throw22005Exception(agent_.logWriter_,", " java.sql.Types.FLOAT,", " paramType);", "", " }", " " ], "header": "@@ -552,6 +620,17 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [ " ", " final int paramType = getParameterMetaData().getParameterType(parameterIndex);", " ", " if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType(paramType) ){", " ", " PossibleTypes.throw22005Exception(agent_.logWriter_,", " java.sql.Types.DOUBLE,", " paramType);", " ", " }", " " ], "header": "@@ -570,6 +649,17 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [ " ", " final int paramType = getParameterMetaData().getParameterType(parameterIndex);", "", " if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_GENERIC_SCALAR.checkType( paramType ) ){", " ", " PossibleTypes.throw22005Exception(agent_.logWriter_,", " java.sql.Types.BIGINT,", " paramType);", " ", " }", "" ], "header": "@@ -588,6 +678,17 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [ " ", " final int paramType = getParameterMetaData().getParameterType(parameterIndex);", " ", " if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_DATE.checkType(paramType) ){", " ", " PossibleTypes.throw22005Exception(agent_.logWriter_ ,", " java.sql.Types.DATE,", " paramType);", " ", " }", " " ], "header": "@@ -611,6 +712,17 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [ " ", " final int paramType = getParameterMetaData().getParameterType(parameterIndex);", "", " if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_TIME.checkType( paramType ) ){", " ", " PossibleTypes.throw22005Exception( agent_.logWriter_,", " java.sql.Types.TIME,", " paramType );", " }", " " ], "header": "@@ -668,6 +780,16 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [ " ", " final int paramType = getParameterMetaData().getParameterType(parameterIndex);", "", " if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_TIMESTAMP.checkType( paramType ) ) {", " ", " PossibleTypes.throw22005Exception(agent_.logWriter_,", " java.sql.Types.TIMESTAMP,", " paramType);", " ", " }", " " ], "header": "@@ -725,6 +847,17 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [ " ", " final int paramType = getParameterMetaData().getParameterType(parameterIndex);", "", " if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_STRING.checkType( paramType ) ){", " PossibleTypes.throw22005Exception(agent_.logWriter_ ,", " java.sql.Types.VARCHAR,", " paramType);", " }", " " ], "header": "@@ -788,6 +921,15 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [ " ", " final int paramType = getParameterMetaData().getParameterType(parameterIndex);", " ", " if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_BYTES.checkType( paramType ) ){", " ", " PossibleTypes.throw22005Exception(agent_.logWriter_,", " java.sql.Types.VARBINARY,", " paramType );", " }", " " ], "header": "@@ -815,6 +957,16 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [ " ", " final int paramType = getParameterMetaData().getParameterType(parameterIndex);", "", " if ( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_BINARYSTREAM.checkType( paramType ) ){", " PossibleTypes.throw22005Exception(agent_.logWriter_,", " java.sql.Types.VARBINARY,", " paramType );", " } ", " " ], "header": "@@ -854,6 +1006,15 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [ " ", " checkTypeForSetAsciiStream(getParameterMetaData().getParameterType(parameterIndex),", " agent_.logWriter_);", "", " setNull(parameterIndex, java.sql.Types.LONGVARCHAR);" ], "header": "@@ -923,10 +1084,14 @@ public class PreparedStatement extends Statement", "removed": [ " setNull(parameterIndex, java.sql.Types.CLOB);" ] }, { "added": [ " ", " private static void checkTypeForSetAsciiStream( final int paramType,", " LogWriter logWriter )", " throws SqlException {", " ", " if ( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_ASCIISTREAM.checkType( paramType ) ) {", " ", " PossibleTypes.throw22005Exception(logWriter,", " java.sql.Types.LONGVARCHAR,", " paramType);", " ", " ", " }", " }", " ", " ", " private static void checkTypeForSetBlob(final int paramType,", " LogWriter logWriter )", " throws SqlException {", " ", " if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_BLOB.checkType( paramType ) ){", " ", " PossibleTypes.throw22005Exception(logWriter,", " java.sql.Types.BLOB,", " paramType);", " }", " }", " ", " ", " private static void checkTypeForSetClob( int paramType,", " LogWriter logWriter )", " throws SqlException {", " ", " if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_CLOB.checkType( paramType ) ){", " ", " PossibleTypes.throw22005Exception(logWriter,", " java.sql.Types.CLOB,", " paramType);", " ", " }", " ", " }", " ", " " ], "header": "@@ -957,7 +1122,51 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [ " ", " checkTypeForSetCharacterStream(getParameterMetaData().getParameterType(parameterIndex),", " agent_.logWriter_);", " ", " setNull(parameterIndex, java.sql.Types.LONGVARCHAR);" ], "header": "@@ -1003,11 +1212,15 @@ public class PreparedStatement extends Statement", "removed": [ " setNull(parameterIndex, java.sql.Types.CLOB);" ] }, { "added": [ "", " checkTypeForSetCharacterStream(getParameterMetaData().getParameterType(parameterIndex),", " agent_.logWriter_);", " ", " setNull(parameterIndex, java.sql.Types.LONGVARCHAR);" ], "header": "@@ -1038,10 +1251,14 @@ public class PreparedStatement extends Statement", "removed": [ " setNull(parameterIndex, java.sql.Types.CLOB);" ] }, { "added": [ " ", "", " private static void checkTypeForSetCharacterStream(final int paramType,", " LogWriter logWriter)", " throws SqlException{", " ", " if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_CHARACTERSTREAM.checkType( paramType ) ){", " ", " PossibleTypes.throw22005Exception(logWriter,", " java.sql.Types.LONGVARCHAR,", " paramType);", " ", " }", " }", "" ], "header": "@@ -1075,6 +1292,21 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [ " ", " checkTypeForSetBlob(getParameterMetaData().getParameterType(parameterIndex),", " agent_.logWriter_);", " " ], "header": "@@ -1083,6 +1315,10 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [ " ", " checkTypeForSetClob(getParameterMetaData().getParameterType(parameterIndex),", " agent_.logWriter_);", " " ], "header": "@@ -1110,6 +1346,10 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [ "", " checkTypeForSetAsciiStream(getParameterMetaData().getParameterType( parameterIndex),", " agent_.logWriter_);", "", " setNull(parameterIndex, java.sql.Types.LONGVARCHAR);" ], "header": "@@ -2354,10 +2594,14 @@ public class PreparedStatement extends Statement", "removed": [ " setNull(parameterIndex, java.sql.Types.CLOB);" ] }, { "added": [ " ", " ", " checkTypeForSetClob(getParameterMetaData().getParameterType(parameterIndex),", " agent_.logWriter_);", " " ], "header": "@@ -2414,7 +2658,12 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [ "", " checkTypeForSetBlob(getParameterMetaData().getParameterType(parameterIndex),", " agent_.logWriter_);", " " ], "header": "@@ -2480,7 +2729,11 @@ public class PreparedStatement extends Statement", "removed": [] } ] } ]
derby-DERBY-1610-a2006aed
DERBY-1610: Resolve difference of type compatibility between Embedded and NetworkServer/NetworkDriver Fixed failures in the JDBC 4.0 tests. Description of the patch: * Check for unsupported types before checking incompatibilities since JDBC 4.0 specifies that SQLFeatureNotSupportedException should be raised for certain types if they are unsupported. * Change timing of calls to checkForClosedStatement() to make ClosedObjectTest get the expected SQLState when the statement is closed. * Add type checking to the JDBC 4.0 length-less blob/clob overloads. * Since the type checking already checks for closed statement and invalid parameter index, remove those tests from checkSetterPreconditions(). Since the only code that is left in checkSetterPreconditions() after the removal of those checks is a call to checkForEscapedCallWithResult(), replace all calls to checkSetterPreconditions() with calls to checkForEscapedCallWithResult(). git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@462784 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/client/org/apache/derby/client/am/PreparedStatement.java", "hunks": [ { "added": [ "", " checkForClosedStatement();", "", " // JDBC 4.0 requires us to throw", " // SQLFeatureNotSupportedException for certain target types if", " // they are not supported. Check for these types before", " // checking type compatibility.", " checkForSupportedDataType(jdbcType);" ], "header": "@@ -404,6 +404,14 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [ " parameterIndex = checkForEscapedCallWithResult(parameterIndex);" ], "header": "@@ -428,9 +436,7 @@ public class PreparedStatement extends Statement", "removed": [ " checkForSupportedDataType(jdbcType);", " super.checkForClosedStatement(); // investigate what can be pushed up to setNull", " parameterIndex = checkSetterPreconditions(parameterIndex);" ] }, { "added": [ " synchronized (connection_) {", " if (agent_.loggingEnabled()) {", " agent_.logWriter_.traceEntry(this, \"setNull\", parameterIndex,", " jdbcType, typeName);", " setNull(parameterIndex, jdbcType);" ], "header": "@@ -442,19 +448,12 @@ public class PreparedStatement extends Statement", "removed": [ " try", " {", " synchronized (connection_) {", " if (agent_.loggingEnabled()) {", " agent_.logWriter_.traceEntry(this, \"setNull\", parameterIndex, jdbcType, typeName);", " }", " super.checkForClosedStatement();", " setNull(parameterIndex, jdbcType);", " }", " catch ( SqlException se )", " {", " throw se.getSQLException();" ] }, { "added": [ " parameterIndex = checkForEscapedCallWithResult(parameterIndex);" ], "header": "@@ -477,7 +476,7 @@ public class PreparedStatement extends Statement", "removed": [ " parameterIndex = checkSetterPreconditions(parameterIndex);" ] }, { "added": [ " parameterIndex = checkForEscapedCallWithResult(parameterIndex);" ], "header": "@@ -507,7 +506,7 @@ public class PreparedStatement extends Statement", "removed": [ " parameterIndex = checkSetterPreconditions(parameterIndex);" ] }, { "added": [ " parameterIndex = checkForEscapedCallWithResult(parameterIndex);" ], "header": "@@ -549,7 +548,7 @@ public class PreparedStatement extends Statement", "removed": [ " parameterIndex = checkSetterPreconditions(parameterIndex);" ] }, { "added": [ " parameterIndex = checkForEscapedCallWithResult(parameterIndex);" ], "header": "@@ -584,7 +583,7 @@ public class PreparedStatement extends Statement", "removed": [ " parameterIndex = checkSetterPreconditions(parameterIndex);" ] }, { "added": [ " parameterIndex = checkForEscapedCallWithResult(parameterIndex);" ], "header": "@@ -608,7 +607,7 @@ public class PreparedStatement extends Statement", "removed": [ " parameterIndex = checkSetterPreconditions(parameterIndex);" ] }, { "added": [ " parameterIndex = checkForEscapedCallWithResult(parameterIndex);" ], "header": "@@ -638,7 +637,7 @@ public class PreparedStatement extends Statement", "removed": [ " parameterIndex = checkSetterPreconditions(parameterIndex);" ] }, { "added": [ " parameterIndex = checkForEscapedCallWithResult(parameterIndex);" ], "header": "@@ -668,7 +667,7 @@ public class PreparedStatement extends Statement", "removed": [ " parameterIndex = checkSetterPreconditions(parameterIndex);" ] }, { "added": [ " parameterIndex = checkForEscapedCallWithResult(parameterIndex);" ], "header": "@@ -698,7 +697,7 @@ public class PreparedStatement extends Statement", "removed": [ " parameterIndex = checkSetterPreconditions(parameterIndex);" ] }, { "added": [ " parameterIndex = checkForEscapedCallWithResult(parameterIndex);" ], "header": "@@ -734,7 +733,7 @@ public class PreparedStatement extends Statement", "removed": [ " parameterIndex = checkSetterPreconditions(parameterIndex);" ] }, { "added": [ " parameterIndex = checkForEscapedCallWithResult(parameterIndex);" ], "header": "@@ -801,7 +800,7 @@ public class PreparedStatement extends Statement", "removed": [ " parameterIndex = checkSetterPreconditions(parameterIndex);" ] }, { "added": [ " parameterIndex = checkForEscapedCallWithResult(parameterIndex);" ], "header": "@@ -870,7 +869,7 @@ public class PreparedStatement extends Statement", "removed": [ " parameterIndex = checkSetterPreconditions(parameterIndex);" ] }, { "added": [ " parameterIndex = checkForEscapedCallWithResult(parameterIndex);" ], "header": "@@ -954,7 +953,7 @@ public class PreparedStatement extends Statement", "removed": [ " parameterIndex = checkSetterPreconditions(parameterIndex);" ] }, { "added": [ " parameterIndex = checkForEscapedCallWithResult(parameterIndex);" ], "header": "@@ -992,7 +991,7 @@ public class PreparedStatement extends Statement", "removed": [ " parameterIndex = checkSetterPreconditions(parameterIndex);" ] }, { "added": [ " checkTypeForSetBinaryStream(parameterIndex);" ], "header": "@@ -1021,15 +1020,8 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = ", " getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );", " if ( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_BINARYSTREAM.checkType( paramType ) ){", " PossibleTypes.throw22005Exception(agent_.logWriter_,", " java.sql.Types.VARBINARY,", " paramType );", " } ", " " ] }, { "added": [ " parameterIndex = checkForEscapedCallWithResult(parameterIndex);" ], "header": "@@ -1062,7 +1054,7 @@ public class PreparedStatement extends Statement", "removed": [ " parameterIndex = checkSetterPreconditions(parameterIndex);" ] }, { "added": [ " checkTypeForSetAsciiStream(parameterIndex);", " parameterIndex = checkForEscapedCallWithResult(parameterIndex);" ], "header": "@@ -1100,10 +1092,9 @@ public class PreparedStatement extends Statement", "removed": [ " checkTypeForSetAsciiStream(getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) ),", " agent_.logWriter_);", " parameterIndex = checkSetterPreconditions(parameterIndex);" ] }, { "added": [ " private void checkTypeForSetAsciiStream(int parameterIndex)", " throws SqlException, SQLException {", " int paramType = getColumnMetaDataX().getColumnType(", " checkForEscapedCallWithResult(parameterIndex));", " PossibleTypes.throw22005Exception(agent_.logWriter_," ], "header": "@@ -1139,13 +1130,13 @@ public class PreparedStatement extends Statement", "removed": [ " private static void checkTypeForSetAsciiStream( final int paramType,", " LogWriter logWriter )", " throws SqlException {", " ", " PossibleTypes.throw22005Exception(logWriter," ] }, { "added": [ " private void checkTypeForSetBinaryStream(int parameterIndex)", " throws SqlException, SQLException {", " int paramType = getColumnMetaDataX().getColumnType(", " checkForEscapedCallWithResult(parameterIndex));", " if (!PossibleTypes.POSSIBLE_TYPES_IN_SET_BINARYSTREAM.", " checkType(paramType)) {", " PossibleTypes.throw22005Exception(agent_.logWriter_,", " java.sql.Types.VARBINARY,", " paramType);", " }", " }", " private void checkTypeForSetCharacterStream(int parameterIndex)", " throws SqlException, SQLException {", " int paramType = getColumnMetaDataX().getColumnType(", " checkForEscapedCallWithResult(parameterIndex));", " if (!PossibleTypes.POSSIBLE_TYPES_IN_SET_CHARACTERSTREAM.", " checkType(paramType)) {", " PossibleTypes.throw22005Exception(agent_.logWriter_,", " java.sql.Types.LONGVARCHAR,", " paramType);", " }", " }", "", " private void checkTypeForSetBlob(int parameterIndex)", " throws SqlException, SQLException {", " int paramType = getColumnMetaDataX().getColumnType(", " checkForEscapedCallWithResult(parameterIndex));", " PossibleTypes.throw22005Exception(agent_.logWriter_,", " private void checkTypeForSetClob(int parameterIndex)", " throws SqlException, SQLException {", " int paramType = getColumnMetaDataX().getColumnType(", " checkForEscapedCallWithResult(parameterIndex));", " PossibleTypes.throw22005Exception(agent_.logWriter_," ], "header": "@@ -1153,27 +1144,50 @@ public class PreparedStatement extends Statement", "removed": [ " private static void checkTypeForSetBlob(final int paramType,", " LogWriter logWriter )", " throws SqlException {", " ", " PossibleTypes.throw22005Exception(logWriter,", " private static void checkTypeForSetClob( int paramType,", " LogWriter logWriter )", " throws SqlException {", " ", " PossibleTypes.throw22005Exception(logWriter," ] }, { "added": [ " checkTypeForSetCharacterStream(parameterIndex);", " parameterIndex = checkForEscapedCallWithResult(parameterIndex);" ], "header": "@@ -1227,11 +1241,8 @@ public class PreparedStatement extends Statement", "removed": [ " ", " checkTypeForSetCharacterStream(getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) ),", " agent_.logWriter_);", " ", " parameterIndex = checkSetterPreconditions(parameterIndex);" ] }, { "added": [ " checkTypeForSetCharacterStream(parameterIndex);", " parameterIndex = checkForEscapedCallWithResult(parameterIndex);" ], "header": "@@ -1266,11 +1277,8 @@ public class PreparedStatement extends Statement", "removed": [ "", " checkTypeForSetCharacterStream(getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) ),", " agent_.logWriter_);", " ", " parameterIndex = checkSetterPreconditions(parameterIndex);" ] }, { "added": [], "header": "@@ -1307,21 +1315,6 @@ public class PreparedStatement extends Statement", "removed": [ " ", "", " private static void checkTypeForSetCharacterStream(final int paramType,", " LogWriter logWriter)", " throws SqlException{", " ", " if( ! PossibleTypes.POSSIBLE_TYPES_IN_SET_CHARACTERSTREAM.checkType( paramType ) ){", " ", " PossibleTypes.throw22005Exception(logWriter,", " java.sql.Types.LONGVARCHAR,", " paramType);", " ", " }", " }", "" ] }, { "added": [ " checkTypeForSetBlob(parameterIndex);" ], "header": "@@ -1331,9 +1324,7 @@ public class PreparedStatement extends Statement", "removed": [ " checkTypeForSetBlob(getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) ),", " agent_.logWriter_);", " " ] }, { "added": [ " parameterIndex = checkForEscapedCallWithResult(parameterIndex);" ], "header": "@@ -1345,7 +1336,7 @@ public class PreparedStatement extends Statement", "removed": [ " parameterIndex = checkSetterPreconditions(parameterIndex);" ] }, { "added": [ " checkTypeForSetClob(parameterIndex);" ], "header": "@@ -1361,10 +1352,7 @@ public class PreparedStatement extends Statement", "removed": [ " ", " checkTypeForSetClob(getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) ),", " agent_.logWriter_);", " " ] }, { "added": [ " parameterIndex = checkForEscapedCallWithResult(parameterIndex);" ], "header": "@@ -1376,7 +1364,7 @@ public class PreparedStatement extends Statement", "removed": [ " parameterIndex = checkSetterPreconditions(parameterIndex);" ] }, { "added": [ " parameterIndex = checkForEscapedCallWithResult(parameterIndex);" ], "header": "@@ -1393,7 +1381,7 @@ public class PreparedStatement extends Statement", "removed": [ " parameterIndex = checkSetterPreconditions(parameterIndex);" ] }, { "added": [ " parameterIndex = checkForEscapedCallWithResult(parameterIndex);" ], "header": "@@ -1411,7 +1399,7 @@ public class PreparedStatement extends Statement", "removed": [ " parameterIndex = checkSetterPreconditions(parameterIndex);" ] }, { "added": [], "header": "@@ -1432,7 +1420,6 @@ public class PreparedStatement extends Statement", "removed": [ " super.checkForClosedStatement();" ] }, { "added": [ " checkForClosedStatement();", " checkForValidParameterIndex(parameterIndex);" ], "header": "@@ -1468,7 +1455,8 @@ public class PreparedStatement extends Statement", "removed": [ " checkSetterPreconditions(parameterIndex);" ] }, { "added": [ " checkForClosedStatement();" ], "header": "@@ -1487,6 +1475,7 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [ " checkForClosedStatement();" ], "header": "@@ -1506,6 +1495,7 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [ " parameterIndex = checkForEscapedCallWithResult(parameterIndex);", " // JDBC 4.0 requires us to throw SQLFeatureNotSupportedException for", " // certain target types if they are not supported.", " checkForSupportedDataType(targetJdbcType);", "" ], "header": "@@ -1519,16 +1509,18 @@ public class PreparedStatement extends Statement", "removed": [ " parameterIndex = checkSetterPreconditions(parameterIndex);", " checkForSupportedDataType(targetJdbcType);", "" ] }, { "added": [], "header": "@@ -1785,7 +1777,6 @@ public class PreparedStatement extends Statement", "removed": [ " super.checkForClosedStatement();" ] }, { "added": [ " private ColumnMetaData getColumnMetaDataX() throws SqlException {", " checkForClosedStatement();" ], "header": "@@ -1794,7 +1785,8 @@ public class PreparedStatement extends Statement", "removed": [ " private ColumnMetaData getColumnMetaDataX() {" ] }, { "added": [], "header": "@@ -2438,13 +2430,6 @@ public class PreparedStatement extends Statement", "removed": [ " private int checkSetterPreconditions(int parameterIndex) throws SqlException {", " super.checkForClosedStatement();", " parameterIndex = checkForEscapedCallWithResult(parameterIndex);", " checkForValidParameterIndex(parameterIndex);", " return parameterIndex;", " }", "" ] }, { "added": [ " checkTypeForSetAsciiStream(parameterIndex);", " parameterIndex = checkForEscapedCallWithResult(parameterIndex);" ], "header": "@@ -2614,11 +2599,8 @@ public class PreparedStatement extends Statement", "removed": [ "", " checkTypeForSetAsciiStream(getColumnMetaDataX().getColumnType( parameterIndex),", " agent_.logWriter_);", "", " parameterIndex = checkSetterPreconditions(parameterIndex);" ] }, { "added": [ " checkTypeForSetBinaryStream(parameterIndex);" ], "header": "@@ -2651,6 +2633,7 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [ " checkTypeForSetClob(parameterIndex);" ], "header": "@@ -2680,10 +2663,7 @@ public class PreparedStatement extends Statement", "removed": [ " ", " checkTypeForSetClob(getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) ),", " agent_.logWriter_);", " " ] }, { "added": [ " checkTypeForSetBlob(parameterIndex);" ], "header": "@@ -2751,9 +2731,7 @@ public class PreparedStatement extends Statement", "removed": [ " checkTypeForSetBlob(getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) ),", " agent_.logWriter_);", " " ] }, { "added": [ " checkTypeForSetBlob(parameterIndex);" ], "header": "@@ -2789,6 +2767,7 @@ public class PreparedStatement extends Statement", "removed": [] } ] } ]
derby-DERBY-1610-bc52552f
- DERBY-1610 Resolve difference of type compatibility between Embedded and NetworkServer/NetworkDriver - adjust index for parameter using checkForEscapedCallWithResult method. - Patch by Tomohito Nakayama ([email protected]) git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@454312 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/client/org/apache/derby/client/am/PreparedStatement.java", "hunks": [ { "added": [ " final int paramType = ", " getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult(parameterIndex) ) ;" ], "header": "@@ -405,7 +405,8 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex) ;" ] }, { "added": [ " final int paramType = ", " getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );" ], "header": "@@ -465,7 +466,8 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ] }, { "added": [ " final int paramType = ", " getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );" ], "header": "@@ -494,7 +496,8 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ] }, { "added": [ " final int paramType = ", " getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );" ], "header": "@@ -523,7 +526,8 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ] }, { "added": [ " final int paramType = ", " getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );" ], "header": "@@ -559,7 +563,8 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ] }, { "added": [ " final int paramType = ", " getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );" ], "header": "@@ -593,7 +598,8 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ] }, { "added": [ " final int paramType = ", " getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );" ], "header": "@@ -621,7 +627,8 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ] }, { "added": [ " final int paramType = ", " getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );" ], "header": "@@ -650,7 +657,8 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ] }, { "added": [ " final int paramType = ", " getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );" ], "header": "@@ -679,7 +687,8 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ] }, { "added": [ " final int paramType = ", " getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );" ], "header": "@@ -713,7 +722,8 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ] }, { "added": [ " final int paramType = ", " getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );" ], "header": "@@ -781,7 +791,8 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ] }, { "added": [ " final int paramType = ", " getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );" ], "header": "@@ -848,7 +859,8 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ] }, { "added": [ " final int paramType = ", " getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );" ], "header": "@@ -922,7 +934,8 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ] }, { "added": [ " final int paramType = ", " getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );" ], "header": "@@ -958,7 +971,8 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ] }, { "added": [ " final int paramType = ", " getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) );" ], "header": "@@ -1007,7 +1021,8 @@ public class PreparedStatement extends Statement", "removed": [ " final int paramType = getColumnMetaDataX().getColumnType(parameterIndex);" ] }, { "added": [ " checkTypeForSetAsciiStream(getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) )," ], "header": "@@ -1085,7 +1100,7 @@ public class PreparedStatement extends Statement", "removed": [ " checkTypeForSetAsciiStream(getColumnMetaDataX().getColumnType(parameterIndex)," ] }, { "added": [ " checkTypeForSetCharacterStream(getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) )," ], "header": "@@ -1213,7 +1228,7 @@ public class PreparedStatement extends Statement", "removed": [ " checkTypeForSetCharacterStream(getColumnMetaDataX().getColumnType(parameterIndex)," ] }, { "added": [ " checkTypeForSetCharacterStream(getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) )," ], "header": "@@ -1252,7 +1267,7 @@ public class PreparedStatement extends Statement", "removed": [ " checkTypeForSetCharacterStream(getColumnMetaDataX().getColumnType(parameterIndex)," ] }, { "added": [ " checkTypeForSetBlob(getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) )," ], "header": "@@ -1316,7 +1331,7 @@ public class PreparedStatement extends Statement", "removed": [ " checkTypeForSetBlob(getColumnMetaDataX().getColumnType(parameterIndex)," ] }, { "added": [ " checkTypeForSetClob(getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) )," ], "header": "@@ -1347,7 +1362,7 @@ public class PreparedStatement extends Statement", "removed": [ " checkTypeForSetClob(getColumnMetaDataX().getColumnType(parameterIndex)," ] }, { "added": [ " checkTypeForSetClob(getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) )," ], "header": "@@ -2666,7 +2681,7 @@ public class PreparedStatement extends Statement", "removed": [ " checkTypeForSetClob(getColumnMetaDataX().getColumnType(parameterIndex)," ] }, { "added": [ " checkTypeForSetBlob(getColumnMetaDataX().getColumnType( checkForEscapedCallWithResult( parameterIndex ) )," ], "header": "@@ -2736,7 +2751,7 @@ public class PreparedStatement extends Statement", "removed": [ " checkTypeForSetBlob(getColumnMetaDataX().getColumnType(parameterIndex)," ] } ] } ]
derby-DERBY-1612-e87a9fde
DERBY-1612 (partial) If revoke statement finds a constraint dependent on the table/column on which privilege is being revoked, the constraint will be dropped automatically. This functionality is similar to what is supported for triggers and views. And just like triggers and views, more work is required so that constraint will get dropped only if it depends on the particular privilege TYPE or particular column that is being revoked. Patch contributed by Mamta Satoor. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@428801 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptor.java", "hunks": [ { "added": [ "import org.apache.derby.impl.sql.execute.DropConstraintConstantAction;", "" ], "header": "@@ -35,6 +35,8 @@ import org.apache.derby.iapi.services.io.StoredFormatIds;", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java", "hunks": [ { "added": [ "\t\t\t\t\t\t\t cd, tc, lcc, true);" ], "header": "@@ -821,7 +821,7 @@ class AlterTableConstantAction extends DDLSingleTableConstantAction", "removed": [ "\t\t\t\t\t\t\t cd, tc, activation, true);" ] }, { "added": [ "\t\t\t\t\t\ttc, lcc, false);" ], "header": "@@ -830,7 +830,7 @@ class AlterTableConstantAction extends DDLSingleTableConstantAction", "removed": [ "\t\t\t\t\t\ttc, activation, false);" ] }, { "added": [ "\t\t\t\t\t\tdm, fkcd.getTableDescriptor(), dd, fkcd, tc, lcc, true);" ], "header": "@@ -845,7 +845,7 @@ class AlterTableConstantAction extends DDLSingleTableConstantAction", "removed": [ "\t\t\t\t\t\tdm, fkcd.getTableDescriptor(), dd, fkcd, tc, activation, true);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/DropConstraintConstantAction.java", "hunks": [ { "added": [ "public class DropConstraintConstantAction extends ConstraintConstantAction" ], "header": "@@ -65,7 +65,7 @@ import org.apache.derby.catalog.UUID;", "removed": [ "class DropConstraintConstantAction extends ConstraintConstantAction" ] }, { "added": [ "\t\tdropConstraintAndIndex(dm, td, dd, conDesc, tc, lcc, !cascadeOnRefKey);" ], "header": "@@ -227,7 +227,7 @@ class DropConstraintConstantAction extends ConstraintConstantAction", "removed": [ "\t\tdropConstraintAndIndex(dm, td, dd, conDesc, tc, activation, !cascadeOnRefKey);" ] }, { "added": [ "\t\t\t\t\t\t\t\ttc, lcc, true);" ], "header": "@@ -244,7 +244,7 @@ class DropConstraintConstantAction extends ConstraintConstantAction", "removed": [ "\t\t\t\t\t\t\t\ttc, activation, true);" ] }, { "added": [ "\tpublic static void dropConstraintAndIndex(DependencyManager\tdm,", "\t\t\t\t\t\t\t\tLanguageConnectionContext lcc," ], "header": "@@ -263,12 +263,12 @@ class DropConstraintConstantAction extends ConstraintConstantAction", "removed": [ "\tprotected static void dropConstraintAndIndex(DependencyManager\tdm,", "\t\t\t\t\t\t\t\tActivation\t\t\t\tactivation," ] }, { "added": [ "\t\t\tdm.clearDependencies(lcc, conDesc);" ], "header": "@@ -280,7 +280,7 @@ class DropConstraintConstantAction extends ConstraintConstantAction", "removed": [ "\t\t\tdm.clearDependencies(activation.getLanguageConnectionContext(), conDesc);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/DropIndexConstantAction.java", "hunks": [ { "added": [ "\t\tdropIndex(dm, dd, tc, cd, td, activation.getLanguageConnectionContext());" ], "header": "@@ -178,7 +178,7 @@ class DropIndexConstantAction extends IndexConstantAction", "removed": [ "\t\tdropIndex(dm, dd, tc, cd, td, activation);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/DropTableConstantAction.java", "hunks": [ { "added": [ "\t\t\t\t\t\ttc, lcc, true);" ], "header": "@@ -313,7 +313,7 @@ class DropTableConstantAction extends DDLSingleTableConstantAction", "removed": [ "\t\t\t\t\t\ttc, activation, true);" ] }, { "added": [ "\t\t\t\t\t\ttc, lcc, false);" ], "header": "@@ -345,7 +345,7 @@ class DropTableConstantAction extends DDLSingleTableConstantAction", "removed": [ "\t\t\t\t\t\ttc, activation, false);" ] } ] } ]
derby-DERBY-1614-fe549441
DERBY-1614: Do not set any heap size flags or network server apart from those specified by the jvmflags property. Committed for John Embretsen <[email protected]> git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429550 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/functionTests/harness/NetServer.java", "hunks": [ { "added": [ " // Set no flags by default (DERBY-1614).", " // The jvmflags property can be used to set any kind of JVM option." ], "header": "@@ -164,22 +164,10 @@ public class NetServer", "removed": [ " boolean setJvmFlags = false;", " setJvmFlags = true;", " }", "", "", " if (!jvmName.equals(\"jview\"))", " {", " if (setJvmFlags && ((jvmflags.indexOf(\"-ms\") == -1) || (jvmflags.indexOf(\"-Xms\") == -1)))", " // only setMs if no starting memory was given", " jvm.setMs(16*1024*1024); // -ms16m", " if (setJvmFlags && ((jvmflags.indexOf(\"-mx\") == -1) || (jvmflags.indexOf(\"-Xmx\") == -1)))", " // only setMx if no max memory was given", " jvm.setMx(32*1024*1024); // -mx32m", " jvm.setNoasyncgc(true); // -noasyncgc" ] } ] } ]
derby-DERBY-1618-479e2bca
DERBY-1618: (store/BootAllTest.junit fails on with jdk13 based jvms) Patch Contributed by Myrna van Lunteren. On jdk131, in the situation invoked by the testSettingBootAllPropertyWithHomePropertySet() test in BootAllTest.java, when the DriverPropertyInfo.choices were accessed. the problem was because in BaseMonitor.java there were no elements found resulting from provider.getBootTimeServices(). underlying real issue was database directory was not getting set to the correct path in the storage factory (DirStorageFactory.java), when all the database are loaded (derby.system.bootAll=true) and system home is set. This patch correctly sets the database directory in the storage factory, in the above mentioed scenario. Modified the test lang/GetPropertyInfoTest.java to access the choices, description, and required fields, but it didn't actually duplicate the problem in BootAllTest.java. But as that's in that test I thought it was unnecessary to add more. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@443038 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1620-a1d6109b
DERBY-1620: Minor cleanup to follow svn # 520173, plus a new JUnit test to verify the behavior fixed with DERBY-1620. Contributed by: John Peterson ([email protected]) git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@544974 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/compile/ConditionalNode.java", "hunks": [ { "added": [ "\t/**", "\t * Checks if the provided node is a CastNode.", "\t *", "\t * @param node\tThe node to check.", "\t * @return \t\tTrue if this node is a CastNode, false otherwise.", "\t */" ], "header": "@@ -113,6 +113,12 @@ public class ConditionalNode extends ValueNode", "removed": [] }, { "added": [ "\t/**", "\t * Checks if the provided CastNode is cast to a SQL CHAR type.", "\t *", "\t * @param node\tThe CastNode to check.", "\t * @return\t\tTrue if this CastNode's target type is CHAR,", "\t * false otherwise.", "\t */" ], "header": "@@ -120,6 +126,13 @@ public class ConditionalNode extends ValueNode", "removed": [] }, { "added": [], "header": "@@ -156,24 +169,6 @@ public class ConditionalNode extends ValueNode", "removed": [ "\tprivate boolean shouldCast(ValueNode newNode, ValueNode oldNode)", "\tthrows StandardException", "\t{", "\t\treturn shouldCast(newNode.getTypeServices(), oldNode.getTypeServices());", "\t}", "", "\tprivate boolean shouldCast(DataTypeDescriptor newType, ValueNode oldNode)", "\tthrows StandardException", "\t{", "\t\treturn shouldCast(newType, oldNode.getTypeServices());", "\t}", "", "\tprivate boolean shouldCast(ValueNode newNode, DataTypeDescriptor oldType)", "\tthrows StandardException", "\t{", "\t\treturn shouldCast(newNode.getTypeServices(), oldType);", "\t}", "" ] } ] } ]
derby-DERBY-1620-fa3b4252
DERBY-1620: Changes to look more closely at the "then" and "else" nodes of an SQL CASE statement and, in situations where one or more SQL NULLs exist, to cast the NULLs to an appropriate type (instead of just casting them to CHAR, which is what Derby did previously). Contributed by: John Peterson ([email protected]) git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@520173 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/compile/ConditionalNode.java", "hunks": [ { "added": [ "\tprivate boolean isCastNode(ValueNode node) {", "\t\tif (node.getNodeType() == C_NodeTypes.CAST_NODE)", "\t\t\treturn true;", "\t\telse", "\t\t\treturn false;", "\t}", "", "\tprivate boolean isCastToChar(CastNode node) {", "\t\tif (node.castTarget.getTypeName().equals(TypeId.CHAR_NAME))", "\t\t\treturn true;", "\t\telse", "\t\t\treturn false;", "\t}", "", "\t/**", "\t * Checks to see if the provided node represents", "\t * a parsing of an SQL NULL.", "\t *", "\t * @param node The node to check.", "\t * @return True if this node represents a SQL NULL, false otherwise.", "\t */", "\tprivate boolean isNullNode(ValueNode node) {", "\t\tif (isCastNode(node) &&", "\t\t\t(((CastNode)node).castOperand instanceof UntypedNullConstantNode))", "\t\t\treturn true;", "\t\telse", "\t\t\treturn false;", "\t}", "", " \t/**", "\t * Checks to see if the provided node represents", "\t * a ConditionalNode.", "\t *", "\t * @param node The node to check.", "\t * @return True if this node is a CondtionalNode, false otherwise.", "\t */", "\tprivate boolean isConditionalNode(ValueNode node) {", "\t\tif (node.getNodeType() == C_NodeTypes.CONDITIONAL_NODE)", "\t\t\treturn true;", "\t\telse", "\t\t\treturn false;", "\t}", "", "\tprivate boolean shouldCast(ValueNode newNode, ValueNode oldNode)", "\tthrows StandardException", "\t{", "\t\treturn shouldCast(newNode.getTypeServices(), oldNode.getTypeServices());", "\t}", "", "\tprivate boolean shouldCast(DataTypeDescriptor newType, ValueNode oldNode)", "\tthrows StandardException", "\t{", "\t\treturn shouldCast(newType, oldNode.getTypeServices());", "\t}", "", "\tprivate boolean shouldCast(ValueNode newNode, DataTypeDescriptor oldType)", "\tthrows StandardException", "\t{", "\t\treturn shouldCast(newNode.getTypeServices(), oldType);", "\t}", "", "\t/**", "\t * Checks to see if oldType should be casted to the newType.", "\t * Returns TRUE if the two DataTypeDescriptors have different", "\t * TypeID's or if the oldType is NULL. Returns FALSE if the newType is", "\t * NULL or if the two Types are identical.", "\t *", "\t * @param newType The type to cast oldType to if they're different.", "\t * @param oldType The type that should be casted to the newType if", "\t * they're different.", "\t * @return False if the newType is null or they have the same", "\t * TypeId, true otherwise.", "\t */", "\tprivate boolean shouldCast(DataTypeDescriptor newType,", "\t\tDataTypeDescriptor oldType) throws StandardException", "\t{", "\t\tif ((newType != null) &&", "\t\t\t((oldType == null) ||", "\t\t\t (!oldType.getTypeId().equals(newType.getTypeId()))))", "\t\t\treturn true;", "\t\telse", "\t\t\treturn false;", "\t}", "", "\t/**", "\t * This method is a 'prebind.' We need to determine what the types of", "\t * the nodes are going to be before we can set all the SQLParsed NULL's", "\t * to the appropriate type. After we bind, however, we want to ignore", "\t * the SQLParsed NULL's which will be bound to CHAR. Also, we might", "\t * have to delve into the CASE Expression tree.", "\t *", "\t * @param thenElseList The thenElseList (recursive method)", "\t * @param fromList The fromList (required for Column References).", "\t *", "\t * @exception StandardException Thrown on error.", "\t */", "\tprivate DataTypeDescriptor findType(ValueNodeList thenElseList,", "\t\tFromList fromList) throws StandardException", "\t{", "\t\t/* We need to \"prebind\" because we want the Types. Provide", "\t\t * dummy SubqueryList and AggreateList (we don't care)", "\t\t */", "", "\t\tValueNode thenNode =", "\t\t\t((ValueNode)thenElseList.elementAt(0)).bindExpression(", "\t\t\t\tfromList, new SubqueryList(), new Vector());", "", "\t\tValueNode elseNode =", "\t\t\t((ValueNode)thenElseList.elementAt(1)).bindExpression(", "\t\t\t\tfromList, new SubqueryList(), new Vector());", "", "\t\tDataTypeDescriptor thenType = thenNode.getTypeServices();", "\t\tDataTypeDescriptor elseType = elseNode.getTypeServices();", "\t\tDataTypeDescriptor theType = null;", "", "\t\t/* If it's not a Cast Node or a Conditional Node, then we'll", "\t\t * use this type.", "\t\t */", "\t\tif ((thenType != null) && !isCastNode(thenNode)", "\t\t\t&& !isConditionalNode(thenNode))", "\t\t{", "\t\t\treturn thenType;", "\t\t}", "", "\t\t/* If it's not cast to CHAR it isn't a SQL parsed NULL, so", "\t\t * we can use it.", "\t\t */", "\t\tif (isCastNode(thenNode) && !isCastToChar((CastNode)thenNode))", "\t\t\treturn ((CastNode)thenNode).castTarget;", "", "\t\t/* If we get here, we can't use the THEN node type, so we'll", "\t\t * use the ELSE node type", "\t\t */", "\t\tif ((elseType != null) && !isCastNode(elseNode)", "\t\t\t&& !isConditionalNode(elseNode))", "\t\t{", "\t\t\treturn elseType;", "\t\t}", "", "\t\tif (isCastNode(elseNode) && !isCastToChar((CastNode)elseNode))", "\t\t\treturn ((CastNode)elseNode).castTarget;", "", "\t\t/* If we get here, it means that we've got a conditional and a", "\t\t * SQL parsed NULL or two conditionals.", "\t\t */", "\t\tif (isConditionalNode(thenNode))", "\t\t{", "\t\t\ttheType =", "\t\t\t\tfindType(((ConditionalNode)thenNode).thenElseList, fromList);", "\t\t}", "", "\t\tif (theType != null) return theType;", "", "\t\t// Two conditionals and the first one was all SQL parsed NULLS.", "\t\tif (isConditionalNode(elseNode))", "\t\t{", "\t\t\ttheType =", "\t\t\t\tfindType(((ConditionalNode)elseNode).thenElseList, fromList);", "\t\t}", "", "\t\tif (theType != null) return theType;", "\t\treturn null;", "\t}", "\t/**", "\t * This recursive method will hunt through the ValueNodeList thenElseList", "\t * looking for SQL NULL's. If it finds any, it casts them to the provided", "\t * castType.", "\t *", "\t * @param thenElseList The thenElseList to update.", "\t * @param castType The type to cast SQL parsed NULL's too.", "\t *", "\t * @exception StandardException Thrown on error.", "\t */", "\tprivate void recastNullNodes(ValueNodeList thenElseList,", "\t DataTypeDescriptor castType)", "\t throws StandardException {", "", "\t\t// Don't do anything if we couldn't find a castType.", "\t\tif (castType == null) return;", "", "\t\tValueNode thenNode = (ValueNode)thenElseList.elementAt(0);", "\t\tValueNode elseNode = (ValueNode)thenElseList.elementAt(1);", "", "\t\t// check if the \"then\" node is NULL", "\t\tif (isNullNode(thenNode) && shouldCast(castType, thenNode)) {", "\t\t\tthenElseList.setElementAt(recastNullNode(thenNode, castType), 0);", "\t\t// otherwise recurse if it's a conditional", "\t\t} else if (isConditionalNode(thenNode)) {", "\t\t\trecastNullNodes(((ConditionalNode)thenNode).thenElseList, castType);", "\t\t}", "\t\t// check if the \"else node is NULL", "\t\tif (isNullNode(elseNode) && shouldCast(castType, elseNode)) {", "\t\t\tthenElseList.setElementAt(recastNullNode(elseNode, castType), 1);", "\t\t// otherwise recurse if it's a conditional", "\t\t} else if (isConditionalNode(elseNode)) {", "\t\t\trecastNullNodes(((ConditionalNode)elseNode).thenElseList, castType);", "\t\t}", "\t}", "", "\t/**", "\t * recastNullNode casts the nodeToCast node to the typeToUse.", "\t *", "\t * recastNullNode is called by recastNullNodes. It is called when the", "\t * nodeToCast is an UntypedNullConstantNode that's been cast by the", "\t * SQLParser to a CHAR. The node needs to be recasted to the same type", "\t * of the other nodes in order to prevent the type compatibility error", "\t * 42X89 from occuring. SQL Standard requires that:", "\t *", "\t * VALUES CASE WHEN 1=2 THEN 3 ELSE NULL END", "\t *", "\t * returns NULL and not an error message.", "\t *", "\t * @param nodeToCast The node that represents a SQL NULL value.", "\t * @param typeToUse The type which the nodeToCast should be", "\t * recasted too.", "\t *", "\t * @exception StandardException Thrown on error.", "\t */", "\tprivate QueryTreeNode recastNullNode(ValueNode nodeToCast,", "\t\tDataTypeDescriptor typeToUse) throws StandardException", "\t{", "\t\tQueryTreeNode cast = getNodeFactory().getNode(", "\t\t\t\t\tC_NodeTypes.CAST_NODE,", "\t\t\t\t\t((CastNode)nodeToCast).castOperand,", "\t\t\t\t\ttypeToUse,", "\t\t\t\t\tgetContextManager());", "\t\treturn cast;", "\t}", "" ], "header": "@@ -125,6 +125,235 @@ public class ConditionalNode extends ValueNode", "removed": [] }, { "added": [ "\t\t} else {", "\t\t\trecastNullNodes(thenElseList, findType(thenElseList, fromList));", " \t\t}", "" ], "header": "@@ -168,7 +397,10 @@ public class ConditionalNode extends ValueNode", "removed": [ "\t\t}" ] } ] } ]
derby-DERBY-1621-3d7a3d4b
DERBY-1621: Commit derby1621trunkdiff04.txt, causing recompilation of trigger actions after ddl. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@434046 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/sql/depend/DependencyManager.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.store.access.TransactionController;" ], "header": "@@ -27,6 +27,7 @@ import org.apache.derby.iapi.error.StandardException;", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java", "hunks": [ { "added": [ "\t * @param tc the transaction controller", "\t\tTableDescriptor\t\t\t\ttriggerTable,", "\t\tTransactionController tc" ], "header": "@@ -260,13 +260,15 @@ public class SPSDescriptor extends TupleDescriptor", "removed": [ "\t\tTableDescriptor\t\t\t\ttriggerTable" ] }, { "added": [ "\t\tcompileStatement(lcc, triggerTable, tc);", "\t", "\t/**", "\t * FOR TRIGGERS ONLY", "\t * <p>", "\t * Generate the class for this SPS and immediately", "\t * release it. This is useful for cases where we", "\t * don't want to immediately execute the statement ", "\t * corresponding to this sps (e.g. CREATE STATEMENT).", " \t * <p>", "\t * <I>SIDE EFFECTS</I>: will update and SYSDEPENDS ", "\t * with the prepared statement dependency info.", " \t * ", "\t * @param lcc the language connection context", "\t * @param triggerTable the table descriptor to bind against. Had", "\t * \tbetter be null if this isn't a trigger sps.", "\t *", "\t * @exception StandardException on error", "\t */", "\tpublic final synchronized void prepareAndRelease", "\t(", "\t\tLanguageConnectionContext\tlcc, ", "\t\tTableDescriptor\t\t\t\ttriggerTable", "\t) throws StandardException", "\t{", "\t\tprepareAndRelease(lcc, triggerTable, (TransactionController)null);", "\t}" ], "header": "@@ -277,10 +279,36 @@ public class SPSDescriptor extends TupleDescriptor", "removed": [ "\t\tcompileStatement(lcc, triggerTable);" ] }, { "added": [ "\t\tprepareAndRelease(lcc, (TableDescriptor)null, (TransactionController)null);", "\t\tTableDescriptor\t\t\t\ttriggerTable,", "\t\tTransactionController tc" ], "header": "@@ -297,13 +325,14 @@ public class SPSDescriptor extends TupleDescriptor", "removed": [ "\t\tprepareAndRelease(lcc, (TableDescriptor)null);", "\t\tTableDescriptor\t\t\t\ttriggerTable" ] }, { "added": [ "\t\t\tdm.clearDependencies(lcc, this, tc);" ], "header": "@@ -388,7 +417,7 @@ public class SPSDescriptor extends TupleDescriptor", "removed": [ "\t\t\tdm.clearDependencies(lcc, this);" ] }, { "added": [ "\t\t\t\t\t\t\t\t\t\t\tcm,", "\t\t\t\t\t\t\t\t\t\t\ttc);" ], "header": "@@ -396,7 +425,8 @@ public class SPSDescriptor extends TupleDescriptor", "removed": [ "\t\t\t\t\t\t\t\t\t\t\tcm);" ] }, { "added": [ "\t\t\t" ], "header": "@@ -673,7 +703,7 @@ public class SPSDescriptor extends TupleDescriptor", "removed": [ "\t\t\tprepareAndRelease(lcc);" ] }, { "added": [ "\t\t\t\t\tprepareAndRelease(lcc, null, nestedTC);" ], "header": "@@ -697,6 +727,7 @@ public class SPSDescriptor extends TupleDescriptor", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java", "hunks": [ { "added": [ "\t\taddDescriptor(td, parent, catalogNumber, duplicatesAllowed, tc, true);", "\t/**", "\t * @inheritDoc", "\t */", "\tpublic void addDescriptor(TupleDescriptor td, TupleDescriptor parent," ], "header": "@@ -1636,10 +1636,13 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\taddDescriptorNow(td, parent, catalogNumber, duplicatesAllowed, tc, true);", "\tprivate void addDescriptorNow(TupleDescriptor td, TupleDescriptor parent," ] }, { "added": [ "\t\t\taddDescriptor(cd, null, SYSCOLUMNS_CATALOG_NUM, " ], "header": "@@ -3242,7 +3245,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\t\taddDescriptorNow(cd, null, SYSCOLUMNS_CATALOG_NUM, " ] }, { "added": [ "\t{", "\t\t dropDependentsStoredDependencies(dependentsUUID, tc, true);", "\t}", "\t\t\t\t", "\t/** ", "\t * @inheritDoc", "\t */", "\tpublic void dropDependentsStoredDependencies(UUID dependentsUUID,", "\t\t\t\t\t\t\t\t\t TransactionController tc,", "\t\t\t\t\t\t\t\t\t boolean wait) ", "\t\t\t\tthrows StandardException\t" ], "header": "@@ -5872,6 +5875,17 @@ public final class\tDataDictionaryImpl", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/catalog/TabInfoImpl.java", "hunks": [ { "added": [ "\t\t\t\t\t\t indexNumber,", "\t\t\t\t\t\t true);", "\tpublic int deleteRow( TransactionController tc, ExecIndexRow key,", "\t\t\t\t\t\t\tint indexNumber, boolean wait)", "\t\tthrows StandardException", "\t{", "\t\t// Always row locking", "\t\treturn deleteRows(tc,", "\t\t\t\t\t\t key,", "\t\t\t\t\t\t ScanController.GE,", "\t\t\t\t\t\t null,", "\t\t\t\t\t\t null,", "\t\t\t\t\t\t key,", "\t\t\t\t\t\t ScanController.GT,", "\t\t\t\t\t\t indexNumber,", "\t\t\t\t\t\t wait);", "\t}", "\t" ], "header": "@@ -616,9 +616,26 @@ class TabInfoImpl implements TabInfo", "removed": [ "\t\t\t\t\t\t indexNumber);" ] }, { "added": [ "\tpublic int deleteRows(TransactionController tc,", "\t\t\t\t\t\t\tExecIndexRow startKey,", "\t\t\t\t\t\t\tint startOp,", "\t\t\t\t\t\t\tQualifier[][] qualifier,", "\t\t\t\t\t\t\tTupleFilter filter,", "\t\t\t\t\t\t\tExecIndexRow stopKey,", "\t\t\t\t\t\t\tint stopOp,", "\t\t\t\t\t\t\tint indexNumber) throws StandardException", " {", "\t\treturn deleteRows(tc,", "\t\t\t\t startKey,", "\t\t\t\t startOp,", "\t\t\t\t qualifier,", "\t\t\t\t filter,", "\t\t\t\t stopKey,", "\t\t\t\t stopOp,", "\t\t\t\t indexNumber,", "\t\t\t\t true);", " }", "", "\t/**", "\t * @inheritDoc", "\t */" ], "header": "@@ -626,6 +643,29 @@ class TabInfoImpl implements TabInfo", "removed": [] }, { "added": [ "\t\t\t\t\t\t int indexNumber,", "\t\t\t\t\t\t boolean wait)" ], "header": "@@ -633,7 +673,8 @@ class TabInfoImpl implements TabInfo", "removed": [ "\t\t\t\t\t\t int indexNumber)" ] }, { "added": [ "\t\t" ], "header": "@@ -644,7 +685,7 @@ class TabInfoImpl implements TabInfo", "removed": [ "" ] }, { "added": [ "\t\trc.open(lockMode, wait);" ], "header": "@@ -666,7 +707,7 @@ class TabInfoImpl implements TabInfo", "removed": [ "\t\trc.open(lockMode);" ] }, { "added": [ " (TransactionController.OPENMODE_FORUPDATE |", " ((wait) ? 0 : TransactionController.OPENMODE_LOCK_NOWAIT)),", "\t\t\t(TransactionController.OPENMODE_FORUPDATE | ", "\t\t\t\t((wait) ? 0 : TransactionController.OPENMODE_LOCK_NOWAIT))," ], "header": "@@ -678,14 +719,16 @@ class TabInfoImpl implements TabInfo", "removed": [ " TransactionController.OPENMODE_FORUPDATE,", " TransactionController.OPENMODE_FORUPDATE, // for update" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/depend/BasicDependencyManager.java", "hunks": [ { "added": [ "\tpublic void addDependency(Dependent d, Provider p, ContextManager cm) ", "\t\tthrows StandardException {", "\t\taddDependency(d, p, cm, null);", "\t}", "\t", "\tprivate void addDependency(Dependent d, Provider p, ContextManager cm, ", "\t\t\tTransactionController tc) throws StandardException {" ], "header": "@@ -94,7 +94,13 @@ public class BasicDependencyManager implements DependencyManager {", "removed": [ "\tpublic void addDependency(Dependent d, Provider p, ContextManager cm) throws StandardException {" ] }, { "added": [ "\t\t\t\tboolean wait = (tc == null);", "\t\t\t\t\t\t\t\t ((wait)?lcc.getTransactionExecute():tc), wait);" ], "header": "@@ -145,13 +151,14 @@ public class BasicDependencyManager implements DependencyManager {", "removed": [ "\t\t\t\t\t\t\t\t lcc.getTransactionExecute());" ] }, { "added": [ "\t\tclearDependencies(lcc, d, null);", "\t}", "", "\t/**", "\t * @inheritDoc", "\t */", "\tpublic void clearDependencies(LanguageConnectionContext lcc, ", "\t\t\t\t\t\t\t\t\tDependent d, TransactionController tc) throws StandardException {" ], "header": "@@ -422,6 +429,14 @@ public class BasicDependencyManager implements DependencyManager {", "removed": [] }, { "added": [ "\t\t\t\tboolean wait = (tc == null);", "\t\t\t\t", "\t\t\t\t\t\t\t\t((wait)?lcc.getTransactionExecute():tc),", "\t\t\t\t\t\t\t\twait);" ], "header": "@@ -430,9 +445,11 @@ public class BasicDependencyManager implements DependencyManager {", "removed": [ "", "\t\t\t\t\t\t\t\t\t\t\t\t\tlcc.getTransactionExecute());" ] }, { "added": [ "\tpublic void copyDependencies(Dependent\tcopy_From, ", "\t\t\t\t\t\t\t\tDependent\tcopyTo,", "\t\t\t\t\t\t\t\tboolean\t\tpersistentOnly,", "\t\t\t\t\t\t\t\tContextManager cm) throws StandardException", "\t{", "\t\tcopyDependencies(copy_From, copyTo, persistentOnly, cm, null);", "\t}", "\t", "\t/**", "\t * @inheritDoc ", "\t */", "\t\t\t\t\t\t\t\t\tContextManager cm,", "\t\t\t\t\t\t\t\t\tTransactionController tc)" ], "header": "@@ -697,11 +714,23 @@ public class BasicDependencyManager implements DependencyManager {", "removed": [ "\t\t\t\t\t\t\t\t\tContextManager cm)" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/RowChangerImpl.java", "hunks": [ { "added": [ "\t{", "\t\topen(lockMode, true);", "\t}", "", "\t/**", "\t * @inheritDoc", "\t */", "\tpublic void open(int lockMode, boolean wait)", "\t\t throws StandardException" ], "header": "@@ -246,6 +246,15 @@ class RowChangerImpl\timplements\tRowChanger", "removed": [] } ] } ]
derby-DERBY-1623-a0f12c0e
DERBY-1623: Fix javadoc errors caused by svn 546183. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@546652 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/types/SQLChar.java", "hunks": [ { "added": [ "\t *", "\t * @param trimType Type of trim (LEADING, TRAILING, or BOTH)", "\t * @param trimChar Character to trim", "\t * @param source String from which to trim trimChar", "\t *", "\t * @return A String containing the result of the trim." ], "header": "@@ -2084,10 +2084,12 @@ readingLoop:", "removed": [ "\t * @param trimType", "\t * @param trimChar", "\t * @param source", "\t * @return" ] }, { "added": [ "", "\t * @param trimType Type of trim (LEADING, TRAILING, or BOTH)", "\t * @param trimChar Character to trim from this SQLChar (may be null)", "\t * @param result The result of a previous call to this method,", "\t * null if not called yet.", "\t *", "\t * @return A StringDataValue containing the result of the trim." ], "header": "@@ -2119,12 +2121,14 @@ readingLoop:", "removed": [ "\t * ", "\t * @param trimType", "\t * @param trimChar", "\t * @param result", "\t * @return" ] } ] } ]
derby-DERBY-1630-ff5c96fc
DERBY-1630: Remove reference to engine class in NetConnection40. Generate client exception using client.am.SqlException. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@428065 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/client/org/apache/derby/client/net/NetConnection40.java", "hunks": [ { "added": [ "import java.sql.SQLClientInfoException;" ], "header": "@@ -26,12 +26,12 @@ import java.sql.QueryObjectFactory;", "removed": [ "import java.sql.SQLClientInfoException;" ] }, { "added": [], "header": "@@ -39,7 +39,6 @@ import java.util.HashMap;", "removed": [ "import org.apache.derby.impl.jdbc.Util;" ] }, { "added": [ " throw new SqlException(agent_.logWriter_,", " new ClientMessageId(SQLState.INVALID_API_PARAMETER),", " new Integer(timeout), \"timeout\",", " \"java.sql.Connection.isValid\" ).getSQLException();" ], "header": "@@ -210,9 +209,10 @@ public class NetConnection40 extends org.apache.derby.client.net.NetConnection", "removed": [ " throw Util.generateCsSQLException(SQLState.INVALID_API_PARAMETER,", " new Integer(timeout), \"timeout\",", " \"java.sql.Connection.isValid\");" ] } ] } ]
derby-DERBY-1633-cafb31f9
DERBY-1681, submitted by Army Brown Fixes the following issue: If Derby chooses to do a join between two FromTables and the right table is a chain of UNIONs, then the optimizer may choose to push the join predicate (if provided) down into the UNION and to both children of every UNION in the chain. But if the predicate cannot be pushed to the children of any of the UNIONs (except the top-level one) the predicate can end up being ignored altogether with respect to that UNION's children. The result is that query execution can return rows that do not satisfy the predicate. This is a regression introduced in 10.1.2.4 and thus it affects 10.1.3 and 10.2. I came across this while tracing through code for DERBY-1633. For more detailed explanation of problem and solution see html doc attached to DERBY-1681. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@432367 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/compile/SetOperatorNode.java", "hunks": [ { "added": [ "\t\t/* Now see if there are any left over predicates; if so, then we", "\t\t * have to generate a ProjectRestrictNode. Note: we walk the", "\t\t * entire chain of UnionNodes (if there is a chain) and see if", "\t\t * any UnionNode at any level has un-pushed predicates; if so, then", "\t\t * we use a PRN to enforce the predicate at this, the top-most", "\t\t * UnionNode.", "\t\t */", "\t\tif (hasUnPushedPredicates())" ], "header": "@@ -171,10 +171,14 @@ abstract class SetOperatorNode extends TableOperatorNode", "removed": [ "\t\t// Now see if there are any left over predicates; if so, then we", "\t\t// have to generate a ProjectRestrictNode.", "\t\tif (((leftOptPredicates != null) && (leftOptPredicates.size() > 0)) ||", "\t\t\t((rightOptPredicates != null) && (rightOptPredicates.size() > 0)))" ] }, { "added": [ "\t/**", "\t * It's possible that we tried to push predicates to this node's", "\t * children but failed to do so. This can happen if this node's", "\t * children both satisfy the criteria for pushing a predicate", "\t * (namely, they reference base tables) but the children's", "\t * children do not (see modifyAccessPaths() above for an example", "\t * of how that can happen). So this method will walk the chain", "\t * of nodes beneath this one and determine if any SetOperatorNode", "\t * at any level has predicates that were not successfully pushed", "\t * to both of its children (note: this currently only applies", "\t * to UnionNodes).", "\t *", "\t * @return True if any UnionNode (or actually, any SetOperatorNode)", "\t * in the chain of SetOperatorNodes (starting with this one) has", "\t * unpushed predicates; false otherwise.", "\t */", "\tprotected boolean hasUnPushedPredicates()", "\t{", "\t\t// Check this node.", "\t\tif (((leftOptPredicates != null) && (leftOptPredicates.size() > 0)) ||", "\t\t\t((rightOptPredicates != null) && (rightOptPredicates.size() > 0)))", "\t\t{", "\t\t\treturn true;", "\t\t}", "", "\t\t// Now check the children.", "\t\tif ((leftResultSet instanceof SetOperatorNode) &&", "\t\t\t((SetOperatorNode)leftResultSet).hasUnPushedPredicates())", "\t\t{", "\t\t\treturn true;", "\t\t}", "", "\t\treturn ((rightResultSet instanceof SetOperatorNode) &&", "\t\t\t((SetOperatorNode)rightResultSet).hasUnPushedPredicates());", "\t}", "" ], "header": "@@ -462,6 +466,42 @@ abstract class SetOperatorNode extends TableOperatorNode", "removed": [] } ] } ]
derby-DERBY-1633-df88f639
DERBY-1633: Commit Army's d1633_v3 patches, fixing the regression introduced by DERBY-805 in the behavior of views that involve joins. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@434111 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/compile/BinaryRelationalOperatorNode.java", "hunks": [ { "added": [ "\t * exactly one operand in the predicate to which this operator belongs" ], "header": "@@ -1267,7 +1267,7 @@ public class BinaryRelationalOperatorNode", "removed": [ "\t * at least one operand in the predicate to which this operator belongs" ] }, { "added": [ " * @param whichRC If not -1 then this tells us which ResultColumn", " * in the received childRSN we need to use for the scoped predicate;", " * if -1 then the column position of the scoped column reference", " * will be stored in this array and passed back to the caller." ], "header": "@@ -1277,6 +1277,10 @@ public class BinaryRelationalOperatorNode", "removed": [] }, { "added": [ "\t\tJBitSet parentRSNsTables, ResultSetNode childRSN,", "\t\tint [] whichRC) throws StandardException" ], "header": "@@ -1286,8 +1290,8 @@ public class BinaryRelationalOperatorNode", "removed": [ "\t\tJBitSet parentRSNsTables, ResultSetNode childRSN)", "\t\tthrows StandardException" ] }, { "added": [ "\t\t/* When we scope a predicate we only scope one side of it--the", "\t\t * side that is to be evaluated against childRSN. We figure out", "\t\t * if \"cr\" is that side by using table numbers, as seen below.", "\t\t * This means that for every scoped predicate there will be one", "\t\t * operand that is scoped and one operand that is not scoped. ", "\t\t * When we get here for the operand that will not be scoped,", "\t\t * we'll just return a clone of that operand. So in the example", "\t\t * mentioned above, the scoped predicate for the left child of", "\t\t * X1 would be", "\t\t *", "\t\t * T1.j <scoped> = X2.b <clone> ", "\t\t *", "\t\t * That said, the first thing we need to do is see if this", "\t\t * ColumnReference is supposed to be scoped for childRSN. We", "\t\t * do that by figuring out what underlying base table the column", "\t\t * reference is pointing to and then seeing if that base table", "\t\t * is included in the list of table numbers from the parentRSN.", "\t\t */" ], "header": "@@ -1295,24 +1299,29 @@ public class BinaryRelationalOperatorNode", "removed": [ "\t\t// The first thing we need to do is see if this ColumnReference", "\t\t// is supposed to be scoped for childRSN. We do that by figuring", "\t\t// out what underlying base table the column reference is pointing", "\t\t// to and then seeing if that base table is included in the list of", "\t\t// table numbers from the parentRSN.", "\t\t// If the column reference doesn't reference any tables,", "\t\t// then there's no point in mapping it to the child result", "\t\t// set; just return a clone of the operand.", "\t\tif (crTables.getFirstSetBit() == -1)", "\t\t{", "\t\t\treturn (ValueNode)cr.getClone();", "\t\t}", "" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/ColumnReference.java", "hunks": [ { "added": [ "\t/* Whether or not this column reference been scoped for the", "\t sake of predicate pushdown.", "\t */", "\tprivate boolean\t\tscoped;", "", "\t/* List of saved remap data if this ColumnReference is scoped", "\t and has been remapped multiple times.", "\t */", "\tprivate java.util.ArrayList remaps;", "" ], "header": "@@ -81,6 +81,16 @@ public class ColumnReference extends ValueNode", "removed": [] }, { "added": [ "\t\tremaps = null;" ], "header": "@@ -105,6 +115,7 @@ public class ColumnReference extends ValueNode", "removed": [] }, { "added": [ "\t\tremaps = null;" ], "header": "@@ -119,6 +130,7 @@ public class ColumnReference extends ValueNode", "removed": [] }, { "added": [ "\t\tscoped = oldCR.isScoped();" ], "header": "@@ -299,6 +311,7 @@ public class ColumnReference extends ValueNode", "removed": [] }, { "added": [ "\t\t/* Scoped column references are a special case: they can be", "\t\t * remapped several times (once for every ProjectRestrictNode", "\t\t * through which the scoped ColumnReference is pushed before", "\t\t * reaching its target result set) and will be un-remapped", "\t\t * several times, as well (as the scoped predicate is \"pulled\"", "\t\t * back up the query tree to it's original location). So we", "\t\t * have to keep track of the \"orig\" info for every remap", "\t\t * operation, not just for the most recent one.", "\t\t */", "\t\tif (scoped && (origSource != null))", "\t\t{", "\t\t\tif (remaps == null)", "\t\t\t\tremaps = new java.util.ArrayList();", "\t\t\tremaps.add(new RemapInfo(", "\t\t\t\tcolumnNumber, tableNumber, columnName, source));", "\t\t}", "\t\telse", "\t\t{", "\t\t\torigSource = source;", "\t\t\torigName = columnName;", "\t\t\torigColumnNumber = columnNumber;", "\t\t\torigTableNumber = tableNumber;", "\t\t}", "" ], "header": "@@ -642,15 +655,35 @@ public class ColumnReference extends ValueNode", "removed": [ "\t\torigSource = source;", "\t\torigName = columnName;", "\t\torigColumnNumber = columnNumber;", "\t\torigTableNumber = tableNumber;" ] }, { "added": [ "\t\tif ((remaps == null) || (remaps.size() == 0))", "\t\t{", "\t\t\tsource = origSource;", "\t\t\torigSource = null;", "\t\t\tcolumnName = origName;", "\t\t\torigName = null;", "\t\t\ttableNumber = origTableNumber;", "\t\t\tcolumnNumber = origColumnNumber;", "\t\t}", "\t\telse", "\t\t{", "\t\t\t// This CR is multiply-remapped, so undo the most", "\t\t\t// recent (and only the most recent) remap operation.", "\t\t\tRemapInfo rI = (RemapInfo)remaps.remove(remaps.size() - 1);", "\t\t\tsource = rI.getSource();", "\t\t\tcolumnName = rI.getColumnName();", "\t\t\ttableNumber = rI.getTableNumber();", "\t\t\tcolumnNumber = rI.getColumnNumber();", "\t\t\trI = null;", "\t\t\tif (remaps.size() == 0)", "\t\t\t\tremaps = null;", "\t\t}" ], "header": "@@ -679,12 +712,28 @@ public class ColumnReference extends ValueNode", "removed": [ "\t\tsource = origSource;", "\t\torigSource = null;", "\t\tcolumnName = origName;", "\t\torigName = null;", "\t\ttableNumber = origTableNumber;", "\t\tcolumnNumber = origColumnNumber;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/OptimizerImpl.java", "hunks": [ { "added": [ "\t * Add scoped predicates to this optimizer's predicateList. This method" ], "header": "@@ -2449,7 +2449,7 @@ public class OptimizerImpl implements Optimizer", "removed": [ "\t * Add predicates to this optimizer's predicateList. This method" ] }, { "added": [ "\tprotected void addScopedPredicatesToList(PredicateList pList)" ], "header": "@@ -2465,7 +2465,7 @@ public class OptimizerImpl implements Optimizer", "removed": [ "\tprotected void addPredicatesToList(PredicateList pList)" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/Predicate.java", "hunks": [ { "added": [ "\t\t// If both sides are column references AND they point to different", "\t\t// tables, then this is a join pred.", "\t\t\t(opNode.getRightOperand() instanceof ColumnReference) &&", "\t\t\t(((ColumnReference)opNode.getLeftOperand()).getTableNumber() !=", "\t\t\t((ColumnReference)opNode.getRightOperand()).getTableNumber()));" ], "header": "@@ -914,9 +914,12 @@ public final class Predicate extends QueryTreeNode implements OptimizablePredica", "removed": [ "\t\t// If both sides are column references then this is a join pred.", "\t\t\t(opNode.getRightOperand() instanceof ColumnReference));" ] }, { "added": [ "\t * @param whichRC If not -1 then this tells us which ResultColumn", "\t * in the received childRSN we need to use for the scoped predicate;", "\t * if -1 then the column position of the scoped column reference", "\t * will be stored in this array and passed back to the caller.", "\t\tJBitSet parentRSNsTables, ResultSetNode childRSN,", "\t\tint [] whichRC) throws StandardException" ], "header": "@@ -965,12 +968,16 @@ public final class Predicate extends QueryTreeNode implements OptimizablePredica", "removed": [ "\t\tJBitSet parentRSNsTables, ResultSetNode childRSN)", "\t\tthrows StandardException" ] }, { "added": [ "\t\t\t\t\tchildRSN,", "\t\t\t\t\twhichRC),", "\t\t\t\t\tchildRSN,", "\t\t\t\t\twhichRC)," ], "header": "@@ -999,11 +1006,13 @@ public final class Predicate extends QueryTreeNode implements OptimizablePredica", "removed": [ "\t\t\t\t\tchildRSN),", "\t\t\t\t\tchildRSN)," ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/ProjectRestrictNode.java", "hunks": [ { "added": [ "\t\tPredicate pred = (Predicate)optimizablePredicate;", "", "\t\t/* If the predicate is scoped then the call to \"remapScopedPred()\"", "\t\t * will do the necessary remapping for us and will return true;", "\t\t * otherwise, we'll just do the normal remapping here.", "\t\t */", "\t\tif (!pred.remapScopedPred())", "\t\t{", "\t\t\tRemapCRsVisitor rcrv = new RemapCRsVisitor(true);", "\t\t\tpred.getAndNode().accept(rcrv);", "\t\t}" ], "header": "@@ -547,8 +547,17 @@ public class ProjectRestrictNode extends SingleChildResultSetNode", "removed": [ "\t\tRemapCRsVisitor rcrv = new RemapCRsVisitor(true);", "\t\t((Predicate) optimizablePredicate).getAndNode().accept(rcrv);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/SelectNode.java", "hunks": [ { "added": [ "\t\t\t\t// node because it will have been \"scoped\" for this node", "\t\t\t\t// or for some result set below this one.", "\t\t\t\tif (pred.isScopedToSourceResultSet())" ], "header": "@@ -1621,11 +1621,10 @@ public class SelectNode extends ResultSetNode", "removed": [ "\t\t\t\t// node because it will have been \"scoped\" for this node;", "\t\t\t\t// see Predicate.getScopedPredForResultSet() for more on", "\t\t\t\t// what scoping is and how it's done.", "\t\t\t\tif (pred.isScopedForPush())" ] }, { "added": [ "\t\t/* When we're done optimizing, any scoped predicates that", "\t\t * we pushed down the tree should now be sitting again", "\t\t * in our wherePredicates list. Put those back in the", "\t\t * the list from which we received them, to allow them", "\t\t * to be \"pulled\" back up to where they came from.", "\t\t */", "\t\tif (wherePredicates != null)", "\t\t{", "\t\t\tPredicate pred = null;", "\t\t\tfor (int i = wherePredicates.size() - 1; i >= 0; i--)", "\t\t\t{", "\t\t\t\tpred = (Predicate)wherePredicates.getOptPredicate(i);", "\t\t\t\tif (pred.isScopedForPush())", "\t\t\t\t{", "\t\t\t\t\tpredicateList.addOptPredicate(pred);", "\t\t\t\t\twherePredicates.removeOptPredicate(pred);", "\t\t\t\t}", "\t\t\t}", "\t\t}", "" ], "header": "@@ -1652,6 +1651,26 @@ public class SelectNode extends ResultSetNode", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/SetOperatorNode.java", "hunks": [ { "added": [], "header": "@@ -305,33 +305,6 @@ abstract class SetOperatorNode extends TableOperatorNode", "removed": [ "\t\tBinaryRelationalOperatorNode opNode =", "\t\t\t(BinaryRelationalOperatorNode)pred.getAndNode().getLeftOperand();", "", "\t\t// Note: we assume we only get here for predicates with col refs on", "\t\t// both sides; if that ever changes, the following cast will need", "\t\t// to be updated accordingly.", "\t\tboolean opWasRemapped = ", "\t\t\t((ColumnReference)opNode.getLeftOperand()).hasBeenRemapped();", "", "\t\t/* If there is a ProjectRestrictNode directly above this node,", "\t\t * then the predicate in question may have been remapped to this", "\t\t * SetOperatorNode before we got here (see pushOptPredicate() in", "\t\t * ProjectRestrictNode). If we leave it mapped when we try to", "\t\t * get scoped predicates for the left and right result sets, the", "\t\t * underlying column references of the scoped predicates will", "\t\t * effectively be doubly-mapped (i.e. mapped more than once), which", "\t\t * can cause problems at code generation time. So we 1) un-remap", "\t\t * the predicate here, 2) get the scoped predicates, and then", "\t\t * 3) remap the predicate again at the end of this method.", "\t\t */", "\t\tRemapCRsVisitor rcrv = null;", "\t\tif (opWasRemapped)", "\t\t{", "\t\t\trcrv = new RemapCRsVisitor(false);", "\t\t\tpred.getAndNode().accept(rcrv);", "\t\t}", "" ] }, { "added": [ "\t\t// For details on how this whichRC variable is used, see the", "\t\t// comments in BinaryRelationalOperatorNode.getScopedOperand().", "\t\tint [] whichRC = new int[] { -1 };", "" ], "header": "@@ -359,6 +332,10 @@ abstract class SetOperatorNode extends TableOperatorNode", "removed": [] }, { "added": [ "\t\t\t\ttableNums, leftResultSet, whichRC);" ], "header": "@@ -369,7 +346,7 @@ abstract class SetOperatorNode extends TableOperatorNode", "removed": [ "\t\t\t\ttableNums, leftResultSet);" ] }, { "added": [ "\t\t\t\ttableNums, rightResultSet, whichRC);" ], "header": "@@ -384,21 +361,13 @@ abstract class SetOperatorNode extends TableOperatorNode", "removed": [ "\t\t\t\ttableNums, rightResultSet);", "\t\t// Restore the original predicate to the way it was before we got", "\t\t// here--i.e. remap it again if needed.", "\t\tif (opWasRemapped)", "\t\t{", "\t\t\trcrv = new RemapCRsVisitor(true);", "\t\t\tpred.getAndNode().accept(rcrv);", "\t\t}", "" ] } ] } ]
derby-DERBY-1638-481d0c6d
DERBY-1638 Add methods to JDBC for JUnit that indicates if the virtual machine environment supports JDBC 2,3 or 4 and JSR169. Naming of methods indicates that the define the vm level of support rather than the clients level. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429154 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/functionTests/util/TestConfiguration.java", "hunks": [ { "added": [], "header": "@@ -25,8 +25,6 @@ import java.sql.DriverManager;", "removed": [ "import org.apache.derby.iapi.services.info.JVMInfo;", "" ] }, { "added": [], "header": "@@ -38,23 +36,6 @@ public class TestConfiguration {", "removed": [ " /**", " * Tell if we are allowed to use DriverManager to create database", " * connections.", " */", " private static final boolean HAVE_DRIVER;", "", " static {", " // See if java.sql.Driver is available. If it is not, we must use", " // DataSource to create connections.", " boolean haveDriver = false;", " try {", " Class.forName(\"java.sql.Driver\");", " haveDriver = true;", " } catch (Exception e) {}", " HAVE_DRIVER = haveDriver;", " }", " " ] }, { "added": [ " if (JDBC.vmSupportsJDBC2()) { " ], "header": "@@ -231,7 +212,7 @@ public class TestConfiguration {", "removed": [ " if (HAVE_DRIVER) { " ] }, { "added": [ "\t\tif ( !JDBC.vmSupportsJDBC4() )" ], "header": "@@ -279,7 +260,7 @@ public class TestConfiguration {", "removed": [ "\t\tif ( !supportsJDBC4() )" ] }, { "added": [], "header": "@@ -318,18 +299,6 @@ public class TestConfiguration {", "removed": [ " \t/**", " \t * <p>", "\t * Return true if the client supports JDBC4, i.e., if the VM level is at", "\t * least 1.6.", "\t * </p>", "\t */", "\tpublic\tboolean\tsupportsJDBC4()", "\t{", "\t\tif ( JVMInfo.JDK_ID >= JVMInfo.J2SE_16 ) { return true; }", "\t\telse { return false; }", "\t}", "" ] } ] } ]
derby-DERBY-1643-71408abc
DERBY-1643 Rename the Dependency manager invalidation constant to represent its use of revoke restrict. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@430170 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptor.java", "hunks": [ { "added": [ "\t\t\t//When REVOKE_PRIVILEGE gets sent (this happens for privilege ", "\t\t\t//types SELECT, UPDATE, DELETE, INSERT, REFERENCES, TRIGGER), we ", "\t\t\t//don't do anything here. Later in makeInvalid method, we make ", "\t\t\t//the ConstraintDescriptor drop itself. " ], "header": "@@ -554,17 +554,10 @@ public abstract class ConstraintDescriptor", "removed": [ "\t\t\t//Notice that REVOKE_EXECUTE_PRIVILEGE is not included here.", "\t\t\t//In Derby, at this point, a constraint can't depend on a ", "\t\t //routine and hence a REVOKE_EXECUTE_PRIVILEGE invalidation", "\t\t //action should never be received by a ConstraintDescriptor.", "\t\t //Don't know how, but if it ever happened for some mysterious", "\t\t //reason, it will be caught in the default: case.", "\t\t\t//", "\t\t\t//For all the other types of revoke privileges, for instance,", "\t\t\t//SELECT, UPDATE, DELETE, INSERT, REFERENCES, TRIGGER, we don't ", "\t\t\t//do anything here and later in makeInvalid, we make the ", "\t\t\t//ConstraintDescriptor drop itself. " ] }, { "added": [ "\t\t\t//Notice that REVOKE_PRIVILEGE_RESTRICT is not caught earlier.", "\t\t //It gets handled in this default: action where an exception", "\t\t //will be thrown. This is because, if such an invalidation ", "\t\t //action type is ever received by a dependent, the dependent ", "\t\t //should throw an exception.", "\t\t\t//In Derby, at this point, REVOKE_PRIVILEGE_RESTRICT gets sent", "\t\t //when execute privilege on a routine is getting revoked.", "\t\t //Currently, in Derby, a constraint can't depend on a routine ", "\t\t //and hence a REVOKE_PRIVILEGE_RESTRICT invalidation action", "\t\t //should never be received by a ConstraintDescriptor. But this", "\t\t //may change in future and when it does, the code to do the right", "\t\t //thing is already here." ], "header": "@@ -572,6 +565,18 @@ public abstract class ConstraintDescriptor", "removed": [] }, { "added": [ "\t\t/*", "\t\t** For ConstraintDescriptor, SET_CONSTRAINTS/TRIGGERS and ", "\t\t* REVOKE_PRIVILEGE are the only valid actions", "\t\t*/", "", "\t\t//Let's handle REVOKE_PRIVILEGE first", "\t\t\t//At this point (Derby 10.2), only a FOREIGN KEY key constraint can" ], "header": "@@ -591,16 +596,15 @@ public abstract class ConstraintDescriptor", "removed": [ " \t//Notice that REVOKE_EXECUTE_PRIVILEGE is not included here.", " \t//This is because, in Derby, at this point, a constraint can't ", "\t\t//depend on a routine and hence a REVOKE_EXECUTE_PRIVILEGE ", "\t\t//invalidation action should never be received by a ", "\t\t//ConstraintDescriptor. Don't know how, but if it ever happened ", "\t\t//for some mysterious reason, it will be caught in prepareToInvalidate ", "\t\t//method", "\t\t\t//At this point (Derby 10.2), only a foreign key constraint can" ] } ] }, { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptor.java", "hunks": [ { "added": [ "\t\t\t** We are only dependent on the underlying table, and our spses and ", "\t\t\t** privileges on various objects. (we should be dropped before our ", "\t\t\t** table is dropped. Also, we should be dropped before revoke ", "\t\t\t** RESTRICT privilege is issued otherwise revoke RESTRICT will ", "\t\t\t** throw an exception).", "\t\t\t** Currently, in Derby, an execute routine privilege can be revoked", "\t\t\t** only if there are no dependents on that privilege. When revoke ", "\t\t\t** execute RESTRICT is exectued, all the dependents will receive", "\t\t\t** REVOKE_PRIVILEGE_RESTRICT and they should throw exception. ", "\t\t\t** We handle this for TriggerDescriptor by throwning an exception ", "\t\t\t** below. For all the other types of revoke privileges, for ", "\t\t\t** instance, SELECT, UPDATE, DELETE, INSERT, REFERENCES, ", "\t\t\t** TRIGGER, we don't do anything here and later in makeInvalid, we ", "\t\t\t** make the TriggerDescriptor drop itself. ", "\t\t case DependencyManager.REVOKE_PRIVILEGE_RESTRICT:" ], "header": "@@ -635,23 +635,26 @@ public class TriggerDescriptor extends TupleDescriptor", "removed": [ "\t\t\t** We are only dependent on the underlying", "\t\t\t** table, and our spses. (we should be", "\t\t\t** dropped before our table is dropped).", "\t\t //Derby supports only RESTRICT form of revoke execute and that", "\t\t //means that if there are any dependent objects on execute", "\t\t //permission on routine, revoke execute on that routine should", "\t\t //fail", "\t\t\t//For all the other types of revoke privileges, for instance,", "\t\t\t//SELECT, UPDATE, DELETE, INSERT, REFERENCES, TRIGGER, we don't ", "\t\t\t//do anything here and later in makeInvalid, we make the ", "\t\t\t//TriggerDescriptor drop itself. ", "\t\t case DependencyManager.REVOKE_EXECUTE_PRIVILEGE:" ] } ] }, { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/ViewDescriptor.java", "hunks": [ { "added": [ "\t\t\t//When REVOKE_PRIVILEGE gets sent (this happens for privilege ", "\t\t\t//types SELECT, UPDATE, DELETE, INSERT, REFERENCES, TRIGGER), we ", "\t\t\t//don't do anything here. Later in makeInvalid method, we make ", "\t\t\t//the ViewDescriptor drop itself. ", "\t\t\t//Notice that REVOKE_PRIVILEGE_RESTRICT is not caught earlier.", "\t\t //It gets handled in this default: action where an exception", "\t\t //will be thrown. This is because, if such an invalidation ", "\t\t //action type is ever received by a dependent, the dependent ", "\t\t //show throw an exception.", "\t\t\t//In Derby, at this point, REVOKE_PRIVILEGE_RESTRICT gets sent", "\t\t //when execute privilege on a routine is getting revoked." ], "header": "@@ -268,19 +268,20 @@ public final class ViewDescriptor extends TupleDescriptor", "removed": [ "\t\t //Notice that REVOKE_EXECUTE_PRIVILEGE is not included here.", "\t\t //This is because Derby supports only RESTRICT form of revoke ", "\t\t //execute and that means that if there are any dependent objects ", "\t\t //on execute permission on routine, revoke execute on that ", "\t\t //routine should fail", "\t\t //", "\t\t //For all the other types of revoke privileges, for instance,", "\t\t //SELECT, UPDATE, DELETE, INSERT, REFERENCES, TRIGGER, we don't ", "\t\t //do anything here and later in makeInvalid, we make the ", "\t\t //ViewDescriptor drop itself. " ] }, { "added": [ "\t\t\t/* We don't care about creating or dropping indexes or" ], "header": "@@ -306,9 +307,7 @@ public final class ViewDescriptor extends TupleDescriptor", "removed": [ "\t\t\t/* creating or dropping another publication won't affect", "\t\t\t * this view. so we allow these actions.", "\t\t\t * We don't care about creating or dropping indexes or" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/RoutinePrivilegeInfo.java", "hunks": [ { "added": [ "\t\t\tif (dd.addRemovePermissionsDescriptor( grant, routinePermsDesc, grantee, tc))", "\t\t\t\t//Derby currently supports only restrict form of revoke execute", "\t\t\t\t//privilege and that is why, we are sending invalidation action ", "\t\t\t\t//as REVOKE_PRIVILEGE_RESTRICT rather than REVOKE_PRIVILEGE", " \t\tdd.getDependencyManager().invalidateFor(routinePermsDesc, DependencyManager.REVOKE_PRIVILEGE_RESTRICT, lcc);" ], "header": "@@ -79,8 +79,11 @@ public class RoutinePrivilegeInfo extends PrivilegeInfo", "removed": [ "\t\t\tif (dd.addRemovePermissionsDescriptor( grant, routinePermsDesc, grantee, tc))\t\t\t\t\t", " \t\tdd.getDependencyManager().invalidateFor(routinePermsDesc, DependencyManager.REVOKE_EXECUTE_PRIVILEGE, lcc);" ] } ] } ]
derby-DERBY-1643-f8fa8cfa
DERBY-1643 In Derby, the execute permission on a routine can't be revoked as long as there are dependent objects relying on that permissions. This patch implements that behavior by adding a new revoke invalidation action REVOKE_EXECUTE_PRIVILEGE, just for routine revoke. This invalidation gets sent when a revoke execute is issued. When dependents, a ViewDescriptor and/or a TriggerDescriptor, get this invalidation action, they will raise error that revoke execute can't be performed because there is a dependent object on that permission. Patch submitted by Mamta Satoor git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@428930 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/ConstraintDescriptor.java", "hunks": [ { "added": [ "\t\t\t//Notice that REVOKE_EXECUTE_PRIVILEGE is not included here.", "\t\t\t//In Derby, at this point, a constraint can't depend on a ", "\t\t //routine and hence a REVOKE_EXECUTE_PRIVILEGE invalidation", "\t\t //action should never be received by a ConstraintDescriptor.", "\t\t //Don't know how, but if it ever happened for some mysterious", "\t\t //reason, it will be caught in the default: case.", "\t\t\t//", "\t\t\t//For all the other types of revoke privileges, for instance,", "\t\t\t//SELECT, UPDATE, DELETE, INSERT, REFERENCES, TRIGGER, we don't ", "\t\t\t//do anything here and later in makeInvalid, we make the ", "\t\t\t//ConstraintDescriptor drop itself. " ], "header": "@@ -553,7 +553,17 @@ public abstract class ConstraintDescriptor", "removed": [ "\t\t\t\t//for now, ignore revoke privilege action" ] } ] }, { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/TriggerDescriptor.java", "hunks": [ { "added": [ "\t\t //Derby supports only RESTRICT form of revoke execute and that", "\t\t //means that if there are any dependent objects on execute", "\t\t //permission on routine, revoke execute on that routine should", "\t\t //fail", "\t\t\t//For all the other types of revoke privileges, for instance,", "\t\t\t//SELECT, UPDATE, DELETE, INSERT, REFERENCES, TRIGGER, we don't ", "\t\t\t//do anything here and later in makeInvalid, we make the ", "\t\t\t//TriggerDescriptor drop itself. ", "\t\t case DependencyManager.REVOKE_EXECUTE_PRIVILEGE:" ], "header": "@@ -642,6 +642,15 @@ public class TriggerDescriptor extends TupleDescriptor", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/ViewDescriptor.java", "hunks": [ { "added": [ "\t\t //Notice that REVOKE_EXECUTE_PRIVILEGE is not included here.", "\t\t //This is because Derby supports only RESTRICT form of revoke ", "\t\t //execute and that means that if there are any dependent objects ", "\t\t //on execute permission on routine, revoke execute on that ", "\t\t //routine should fail", "\t\t //", "\t\t //For all the other types of revoke privileges, for instance,", "\t\t //SELECT, UPDATE, DELETE, INSERT, REFERENCES, TRIGGER, we don't ", "\t\t //do anything here and later in makeInvalid, we make the ", "\t\t //ViewDescriptor drop itself. " ], "header": "@@ -267,7 +267,16 @@ public final class ViewDescriptor extends TupleDescriptor", "removed": [ "\t\t\t\t//ignore revoke privilege action for now" ] } ] } ]
derby-DERBY-1644-0958c84f
DERBY-1644: NPE when inserting values to tbl w/ identity col gen by default When the VALUES clause encounters multiple rows, it generates a UNION node tree to combine the rows to be inserted. InsertNode notices the top-level UNION node and calls the special checkAutoincrementUnion() method which knows how to recursively traverse the Union tree and call checkAutoIncrement() on the underlying RowResultSetNode instances at the leaf level of the tree. HOWEVER, when the number of columns in the rows in the VALUES clause is a subset of the number of columns in the table we're inserting into, the top node of the tree is not a UnionNode, but is rather a ProjectRestrictNode. This means that we skip past the UnionNode test and just call checkAutoincrement(), which processes the PRN but doesn't go down to the RowResultSetNode(s) at the leaf level. This leaves the ResultColumn instance at the leaf level with a NULL column descriptor, which causes the NPE during the code generation phase. And, there is a second, related problem. The enhanceRCLForInsert() call is also only made at the top level of the tree. However, this call is a necessary pre-condition for calling checkAutoincrement() because enhanceRCLForInsert() ensures that the proper ResultColumnList values are in place prior to the checkAutoincrement() reconciliation of the column lists. The patch solves these problems by merging the code from InsertNode.bind together with the current recursive processing in ResultColumnList.checkAutoincrementUnion() to produce a new recursive routine, which I have called enhanceAndCheckForAutoincrement(), which will recursively traverse the ResultSet tree, calling *both* enhanceRCLForInsert() and checkAutoincrement() on the various nodes in the tree. Thus the primary ideas involved in this patch are: - When an INSERT statement will insert multiple rows from the VALUES clause, the compiler will compile the various values into a tree of UnionNodes with RowResultSetNodes at the leaves of the three - The columns specified in the INSERT statement may be a subset of the rows in the table. The "extra" columns need to be constructed by the INSERT statement, either by generating NULL values for those columns which are nullable, or by compiling a default values for those columns which have DEFAULT values, or by generating a value for an IDENTITY column which is GENERATED. The work of constructing these extra column values is done by genNewRCForInsert. - For columns which are GENERATED ALWAYS, we must make sure that the INSERT statement doesn't allow the user to insert their own value for the generated column. - The columns which are specified in the INSERT column spec may not match the order in which the columns arise in the table. Therefore, the column values may need to be re-ordered by the INSERT statement so that they occur in the proper order. - In the case when the ResultSet which provides the values for the INSERT statement is not just a single node, but is rather a tree of UnionNodes, the above processing needs to happen throughout the tree, not just at the root node. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@487414 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/compile/InsertNode.java", "hunks": [ { "added": [ "\t\tenhanceAndCheckForAutoincrement(resultSet, inOrder,", "\t\t\t\tnumTableColumns, colMap, dataDictionary,", "\t\t\t\ttargetTableDescriptor, targetVTI);" ], "header": "@@ -411,45 +411,10 @@ public final class InsertNode extends DMLModStatementNode", "removed": [ "\t\t// colmap[x] == y means that column x in the target table", "\t\t// maps to column y in the source result set.", "\t\t// colmap[x] == -1 means that column x in the target table", "\t\t// maps to its default value.", "\t\t// both colmap indexes and values are 0-based.", "\t\t/* if the list is in order and complete, we don't have to change", "\t\t * the tree. If it is not, then we call RSN.enhanceRCLForInsert() ", "\t\t * which will either", "\t\t * (reorder and/or \"enhance\" the source RCL within the same RSN) or", "\t\t * (generate and return a PRN with a new reordered/enhanced RCL above", "\t\t * the existing RSN). This way, RSN's that understand how to do projections", "\t\t * can avoid the additional PRN while those that do not will get one.", "\t\t */", "\t\t/* NOTE - javascope gives confusing branch coverage info here. By", "\t\t * breaking apart the following if condition, I have verified that", "\t\t * we test all cases. (Jerry 7/17/97)", "\t\t */", "\t\tif (! inOrder || resultSet.resultColumns.size() < numTableColumns)", "\t\t{", "\t\t\t// one thing we do know is that all of the resultsets underneath", "\t\t\t// us have their resultColumn names filled in with the names of", "\t\t\t// the target table columns. That makes generating the mapping", "\t\t\t// \"easier\" -- we simply generate the names of the target table columns", "\t\t\t// that are included. For the missing columns, we generate default", "\t\t\t// value expressions.", "", "\t\t\tresultSet = resultSet.enhanceRCLForInsert(numTableColumns, colMap, ", "\t\t\t\t\t\t\t\t\t\t\t\t\t dataDictionary,", "\t\t\t\t\t\t\t\t\t\t\t\t\t targetTableDescriptor, targetVTI);", "\t\t}", "", "\t\tif (resultSet instanceof UnionNode)", "\t\t{", "\t\t\t// If we are inserting a number of rows in VALUES clause, we need to", "\t\t\t// examine each row for 'autoincrement'.", "\t\t\tresultColumnList.checkAutoincrementUnion(resultSet);", "\t\t}", "\t\telse resultColumnList.checkAutoincrement(resultSet.getResultColumns());" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java", "hunks": [ { "added": [ "\t * matches the target RCL." ], "header": "@@ -1044,9 +1044,7 @@ public abstract class ResultSetNode extends QueryTreeNode", "removed": [ "\t * matches the target RCL. Those RSNs whose generate() method does", "\t * not handle projects will insert a PRN, with a new RCL which matches", "\t * the target RCL, above the current RSN." ] }, { "added": [ "\tpublic void enhanceRCLForInsert(int numTargetColumns, int[] colMap, " ], "header": "@@ -1056,12 +1054,10 @@ public abstract class ResultSetNode extends QueryTreeNode", "removed": [ "\t *", "\t * @return ResultSetNode\tThe new top of the tree", "\tpublic ResultSetNode enhanceRCLForInsert(int numTargetColumns, int[] colMap, " ] }, { "added": [], "header": "@@ -1072,7 +1068,6 @@ public abstract class ResultSetNode extends QueryTreeNode", "removed": [ "\t\tint numResultSetColumns = resultColumns.size();" ] } ] } ]
derby-DERBY-1644-a8db6658
DERBY-4442: Default value and identity in an INSERT result set evaluated too early Always add a ProjectRestrictNode on top of the source result set for an insert if the source columns are not ordered the same way as the target columns, or if inserting into a subset of the columns, and the source is not a table constructor. Then the adding of default values to the source result column list happens on top of the original source result node, and not inside that node. This means that the source result is produced before the default values are added, and the generation of the defaults happens at the correct time. As a side-effect, these other issues are fixed: DERBY-3 Identity column not filled consecutively with "insert ... select distinct" DERBY-4433 Cannot insert from EXCEPT/INTERSECT when target table has more columns than the source Much of the added code is actually old code revived from the Subversion history. Before DERBY-1644, we used to put a ProjectRestrictNode on top of the source result if it was a SetOperatorNode. The code that inserted the ProjectRestrictNode was added back and changed to operate on ResultSetNode instead of SetOperatorNode. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@885421 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/compile/InsertNode.java", "hunks": [ { "added": [ "\t\tresultSet = enhanceAndCheckForAutoincrement(resultSet, inOrder, colMap);" ], "header": "@@ -411,9 +411,7 @@ public final class InsertNode extends DMLModStatementNode", "removed": [ "\t\tenhanceAndCheckForAutoincrement(resultSet, inOrder,", "\t\t\t\tnumTableColumns, colMap, dataDictionary,", " targetTableDescriptor, targetVTI );" ] }, { "added": [ "\t * @return a node representing the source for the insert", "\tResultSetNode enhanceAndCheckForAutoincrement(", "\t\t\tResultSetNode resultSet, boolean inOrder, int[] colMap)" ], "header": "@@ -529,19 +527,13 @@ public final class InsertNode extends DMLModStatementNode", "removed": [ "\t * @param numTableColumns # of columns in target RCL", "\t * @param dataDictionary DataDictionary to use", "\t * @param targetTableDescriptor Table Descriptor for target", "\t * @param targetVTI Target description if it is a VTI", "\tprivate void enhanceAndCheckForAutoincrement(ResultSetNode resultSet, ", "\t\t\tboolean inOrder, int numTableColumns, int []colMap, ", "\t\t\tDataDictionary dataDictionary,", "\t\t\tTableDescriptor targetTableDescriptor,", " FromVTI targetVTI)" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java", "hunks": [ { "added": [ "\t * we will add a ProjectRestrictNode on top of the source with an RCL that", "\t * @param target the target node for the insert", "\t * @param inOrder are source cols in same order as target cols?", "\t * @return a node that replaces this node and whose RCL matches the target", "\t * RCL. May return this node if no changes to the RCL are needed, or if the", "\t * RCL is modified in-place.", "\tResultSetNode enhanceRCLForInsert(", "\t\t\tInsertNode target, boolean inOrder, int[] colMap)", "\t\tthrows StandardException", "\t{", "\t\tif (!inOrder || resultColumns.size() < target.resultColumnList.size()) {", "\t\t\treturn generateProjectRestrictForInsert(target, colMap);", "\t\t}", "\t\treturn this;", "\t}", "", "\t/**", "\t * Generate an RCL that can replace the original RCL of this node to", "\t * match the RCL of the target for the insert.", "\t *", "\t * @param target the target node for the insert", "\t * @param colMap int array representation of correspondence between", "\t * RCLs - colmap[i] = -1 -&gt; missing in current RCL", "\t * colmap[i] = j -&gt; targetRCL(i) &lt;-&gt; thisRCL(j+1)", "\t * @return an RCL that matches the target RCL", "\t */", "\tResultColumnList getRCLForInsert(InsertNode target, int[] colMap)" ], "header": "@@ -916,24 +916,42 @@ public abstract class ResultSetNode extends QueryTreeNode", "removed": [ "\t * we will reorder and/or add defaults to the current RCL so that is", "\t * @param numTargetColumns\t# of columns in target RCL", "\t * @param dataDictionary\tDataDictionary to use", "\t * @param targetTD\t\t\tTableDescriptor for target if the target is not a VTI, null if a VTI", " * @param targetVTI Target description if it is a VTI, null if not a VTI", "\tpublic void enhanceRCLForInsert(int numTargetColumns, int[] colMap, ", "\t\t\t\t\t\t\t\t\t\t\t DataDictionary dataDictionary,", "\t\t\t\t\t\t\t\t\t\t\t TableDescriptor targetTD,", " FromVTI targetVTI)" ] }, { "added": [ "\t\tint numTargetColumns = target.resultColumnList.size();" ], "header": "@@ -946,10 +964,10 @@ public abstract class ResultSetNode extends QueryTreeNode", "removed": [ "\t\t\tColumnReference newColumnReference;" ] }, { "added": [ "\t\t\t\tnewResultColumn = genNewRCForInsert(", "\t\t\t\t\t\ttarget.targetTableDescriptor,", "\t\t\t\t\t\ttarget.targetVTI,", "\t\t\t\t\t\tindex + 1,", "\t\t\t\t\t\ttarget.getDataDictionary());", "\t\treturn newResultCols;" ], "header": "@@ -958,14 +976,17 @@ public abstract class ResultSetNode extends QueryTreeNode", "removed": [ "\t\t\t\tnewResultColumn = genNewRCForInsert(targetTD, targetVTI, index + 1, dataDictionary);", "\t\t/* Set the source RCL to the massaged version */", "\t\tresultColumns = newResultCols;" ] } ] } ]
derby-DERBY-1652-dd2accde
DERBY-1652, submitted by Yip Ng The cause of the problem is that the trigger descriptor is created after the stored prepared statement(SPS) has been compiled, so the compiled form of the SPS is not aware of that its trigger action can fire on the trigger table itself. Hence, the constant action was not generated correctly. During upgrade, the SPSs are invalidated at database boot time. The SPS will be recompile when it is being invoked and the recompilation at this point will of course detect the relevent trigger and generate the correct constant action for the SPS and produce the expected behavior when the SPS is executed - throwing an error when it exceeds the trigger's maximum depth in the above case. The simplest solution without introducing another revalidation of the SPS is to create the trigger descriptor first before compiling the SPS. I ran derbyall and had to go over the testcases which have the wrong master outputs and I have corrected them on this patch. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@431698 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/execute/CreateTriggerConstantAction.java", "hunks": [ { "added": [ "\t\tactionSPSId = (actionSPSId == null) ? ", "\t\t\tdd.getUUIDFactory().createUUID() : actionSPSId;", " ", "\t\t** Create the trigger descriptor first so the trigger action", "\t\t** compilation can pick up the relevant trigger especially in ", "\t\t** the case of self triggering.", "\t\tTriggerDescriptor triggerd =" ], "header": "@@ -257,23 +257,17 @@ class CreateTriggerConstantAction extends DDLSingleTableConstantAction", "removed": [ "\t\t/*\t", "\t\t** If we have a WHEN action we create it now.", "\t\t*/ ", "\t\tif (whenText != null)", "\t\t{", "\t\t\twhenspsd = createSPS(lcc, ddg, dd, tc, tmpTriggerId, triggerSd,", "\t\t\t\t\t\twhenSPSId, spsCompSchemaId, whenText, true, triggerTable);", "\t\t}", "\t\t** Create the trigger action", "\t\tactionspsd = createSPS(lcc, ddg, dd, tc, tmpTriggerId, triggerSd,", "\t\t\t\t\t\tactionSPSId, spsCompSchemaId, actionText, false, triggerTable);", "\t\t", "\t\tTriggerDescriptor triggerd = " ] }, { "added": [ "\t\t\t\t\t\t\t\t\tactionSPSId," ], "header": "@@ -284,7 +278,7 @@ class CreateTriggerConstantAction extends DDLSingleTableConstantAction", "removed": [ "\t\t\t\t\t\t\t\t\tactionspsd.getUUID()," ] } ] } ]
derby-DERBY-1664-621d67a1
DERBY-1664: (Partial) This is the first pass at a test that can be used to gauge how long it takes to do each part of the startup process. This could likely be extended to also test how long it takes to create tables of different size, how long it takes to insert rows, etc. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@431395 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/functionTests/util/JarUtil.java", "hunks": [ { "added": [ "/*", " ", " Derby - Class org.apache.derbyTesting.functionTests.util.JartUtil", " ", " Licensed to the Apache Software Foundation (ASF) under one", " or more contributor license agreements. See the NOTICE file", " distributed with this work for additional information", " regarding copyright ownership. The ASF licenses this file", " to you under the Apache License, Version 2.0 (the", " \"License\"); you may not use this file except in compliance", " with the License. You may obtain a copy of the License at", " ", " http://www.apache.org/licenses/LICENSE-2.0", " ", " Unless required by applicable law or agreed to in writing,", " software distributed under the License is distributed on an", " \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY", " KIND, either express or implied. See the License for the", " specific language governing permissions and limitations", " under the License.", " */", "", "package org.apache.derbyTesting.functionTests.util;", "import java.io.*;", "", "", "/**", " *", " * <Put Class Comments Here>", " */", "public class JarUtil {", "", " /** ", " * Unjar a file into the specified directory. This runs in a separate", " * process. Note, your test needs security permissions to read user.dir", " * and to start a process for this to work.", " * ", " * @param jarpath - Path to jar file", " *", " * @param outputdir - The directory to unjar to. If this is null,", " * we user user.dir (the current directory)", " *", " */", " public static void unjar(String jarpath, String outputdir)", " throws ClassNotFoundException, IOException, InterruptedException", " { ", " if ( outputdir == null ) {", " outputdir = System.getProperty(\"user.dir\");", " }", " File jarFile = new File((new File(outputdir, jarpath)).getCanonicalPath());", "", " // Now unjar the file", " String jarCmd = \"jar xf \" + jarFile.getPath();", " // Now execute the jar command", " Process pr = null;", " try", " {", " //System.out.println(\"Use process to execute: \" + jarCmd);", " pr = Runtime.getRuntime().exec(jarCmd);", "", " pr.waitFor();", " //System.out.println(\"Process done.\");", " pr.destroy();", " }", " finally {", " if (pr != null)", " {", " pr.destroy();", " pr = null;", " }", " }", " }", "}" ], "header": "@@ -0,0 +1,73 @@", "removed": [] } ] } ]
derby-DERBY-1665-e38e660c
DERBY-1665 (partial): fix formatting of javadoc for iapi.store.access.Qualifier. The content of the javadoc for this class needs a review to address the other comments in this JIRA issue. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@446536 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/store/access/Qualifier.java", "hunks": [ { "added": [ " <p>" ], "header": "@@ -26,7 +26,7 @@ import org.apache.derby.iapi.types.DataValueDescriptor;", "removed": [ "" ] }, { "added": [ " <p>", " TransactionController.openScan(). ", " <p>", " <p>", " <blockquote><pre>", " </blockquote></pre>", " <p>" ], "header": "@@ -45,36 +45,32 @@ import org.apache.derby.iapi.error.StandardException;", "removed": [ " <blockquote><pre>", " <blockquote><pre>", " </blockquote></pre>", " <blockquote><pre>", " </blockquote></pre>", " </blockquote></pre>", "", " @see TransactionController#openScan ", "", "", "" ] }, { "added": [ " <blockquote><pre>", " (qual[0][0] AND qual[0][0] ... AND qual[0][qual[0].length - 1])", " (qual[1][0] OR qual[1][1] ... OR qual[1][qual[1].length - 1])", " (qual[2][0] OR qual[2][1] ... OR qual[2][qual[2].length - 1])", " AND (qual[qual.length - 1][0] OR qual[1][1] ... OR qual[1][2])", " </blockquote></pre>", " <p>", " <p>", " <p>", " <p>", " <blockquote><pre>", " </blockquote></pre>", " <p>", " <blockquote><pre>", " qualifier[0] = new Qualifier[1];", " qualifier[1] = new Qualifier[1];", " qualifier[2] = new Qualifier[1];", " qualifier[0][0] = a", " qualifier[1][0] = b", " qualifier[2][0] = c", " </blockquote></pre>", " <p>", " <blockquote><pre>" ], "header": "@@ -83,48 +79,50 @@ import org.apache.derby.iapi.error.StandardException;", "removed": [ "", " (qual[0][0] AND qual[0][0] ... AND qual[0][qual[0].length - 1])", " (qual[1][0] OR qual[1][1] ... OR qual[1][qual[1].length - 1])", " (qual[2][0] OR qual[2][1] ... OR qual[2][qual[2].length - 1])", " AND", " (qual[qual.length - 1][0] OR qual[1][1] ... OR qual[1][2])", "", "", "", "", " </blockquote><pre>", "", "\tqualifier[0] = new Qualifier[1];", "\tqualifier[1] = new Qualifier[1];", "\tqualifier[2] = new Qualifier[1];", "\tqualifier[0][0] = a", "\tqualifier[1][0] = b", "\tqualifier[2][0] = c", "", "", "" ] }, { "added": [ " </blockquote></pre>", " <p>", " <blockquote><pre>", " qualifier = new Qualifier[3]; // 3 and clauses" ], "header": "@@ -136,8 +134,11 @@ import org.apache.derby.iapi.error.StandardException;", "removed": [ "" ] }, { "added": [ " </blockquote></pre>", " <p>", " <blockquote><pre>", " @see TransactionController#openScan " ], "header": "@@ -151,18 +152,20 @@ import org.apache.derby.iapi.error.StandardException;", "removed": [ "", "" ] } ] } ]
derby-DERBY-1674-55f1cc92
DERBY-1674 (partial) Move PermissionsCatalogRowFactory into its correct location under impl/sql/catalog. System tables are a detail of the catalog implementation, not the dictionary api. The class was only ever referenced in the impl/sql/catalog package. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@432972 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java", "hunks": [ { "added": [], "header": "@@ -29,7 +29,6 @@ import org.apache.derby.iapi.sql.conn.Authorizer;", "removed": [ "import org.apache.derby.iapi.sql.dictionary.PermissionsCatalogRowFactory;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/catalog/PermissionsCatalogRowFactory.java", "hunks": [ { "added": [ "package org.apache.derby.impl.sql.catalog;", "import org.apache.derby.iapi.sql.dictionary.CatalogRowFactory;" ], "header": "@@ -19,11 +19,12 @@", "removed": [ "package org.apache.derby.iapi.sql.dictionary;" ] }, { "added": [ "abstract class PermissionsCatalogRowFactory extends CatalogRowFactory", " static final String AUTHORIZATION_ID_TYPE = \"VARCHAR\";", " static final boolean AUTHORIZATION_ID_IS_BUILTIN_TYPE = true;", " static final int AUTHORIZATION_ID_LENGTH = Limits.MAX_IDENTIFIER_LENGTH;", " PermissionsCatalogRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf,", " DataValueDescriptor getAuthorizationID( String value)", " DataValueDescriptor getNullAuthorizationID()" ], "header": "@@ -33,24 +34,24 @@ import org.apache.derby.iapi.types.DataValueFactory;", "removed": [ "public abstract class PermissionsCatalogRowFactory extends CatalogRowFactory", " public static final String AUTHORIZATION_ID_TYPE = \"VARCHAR\";", " public static final boolean AUTHORIZATION_ID_IS_BUILTIN_TYPE = true;", " public static final int AUTHORIZATION_ID_LENGTH = Limits.MAX_IDENTIFIER_LENGTH;", " public PermissionsCatalogRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf,", " protected DataValueDescriptor getAuthorizationID( String value)", " protected DataValueDescriptor getNullAuthorizationID()" ] }, { "added": [ " String getAuthorizationID( ExecRow row, int columnPos)" ], "header": "@@ -63,16 +64,11 @@ public abstract class PermissionsCatalogRowFactory extends CatalogRowFactory", "removed": [ " protected String getAuthorizationID( ExecRow row, int columnPos)", " ", " /**", " * @return the index number of the primary key index.", " */", " public abstract int getPrimaryIndexNumber();" ] }, { "added": [ " abstract ExecIndexRow buildIndexKeyRow( int indexNumber," ], "header": "@@ -82,7 +78,7 @@ public abstract class PermissionsCatalogRowFactory extends CatalogRowFactory", "removed": [ " public abstract ExecIndexRow buildIndexKeyRow( int indexNumber," ] }, { "added": [ " abstract int orPermissions( ExecRow row, PermissionsDescriptor perm, boolean[] colsChanged)" ], "header": "@@ -98,7 +94,7 @@ public abstract class PermissionsCatalogRowFactory extends CatalogRowFactory", "removed": [ " abstract public int orPermissions( ExecRow row, PermissionsDescriptor perm, boolean[] colsChanged)" ] }, { "added": [ " abstract int removePermissions( ExecRow row, PermissionsDescriptor perm, boolean[] colsChanged)" ], "header": "@@ -113,7 +109,7 @@ public abstract class PermissionsCatalogRowFactory extends CatalogRowFactory", "removed": [ " abstract public int removePermissions( ExecRow row, PermissionsDescriptor perm, boolean[] colsChanged)" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/catalog/SYSCOLPERMSRowFactory.java", "hunks": [ { "added": [], "header": "@@ -21,7 +21,6 @@", "removed": [ "import org.apache.derby.iapi.sql.dictionary.PermissionsCatalogRowFactory;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/catalog/SYSROUTINEPERMSRowFactory.java", "hunks": [ { "added": [], "header": "@@ -25,7 +25,6 @@ import org.apache.derby.iapi.sql.dictionary.SystemColumn;", "removed": [ "import org.apache.derby.iapi.sql.dictionary.PermissionsCatalogRowFactory;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/catalog/SYSTABLEPERMSRowFactory.java", "hunks": [ { "added": [], "header": "@@ -25,7 +25,6 @@ import org.apache.derby.catalog.UUID;", "removed": [ "import org.apache.derby.iapi.sql.dictionary.PermissionsCatalogRowFactory;" ] }, { "added": [ " public int getPrimaryKeyIndexNumber()" ], "header": "@@ -368,7 +367,7 @@ public class SYSTABLEPERMSRowFactory extends PermissionsCatalogRowFactory", "removed": [ " public int getPrimaryIndexNumber()" ] } ] } ]
derby-DERBY-1674-5b76a527
DERBY-1674 (partial) Remove IndexScan class from impl.sql.catalog as it is never used. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@433685 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/catalog/IndexScan.java", "hunks": [ { "added": [], "header": "@@ -1,198 +0,0 @@", "removed": [ "/*", "", " Derby - Class org.apache.derby.impl.sql.catalog.IndexScan", "", " Licensed to the Apache Software Foundation (ASF) under one or more", " contributor license agreements. See the NOTICE file distributed with", " this work for additional information regarding copyright ownership.", " The ASF licenses this file to you under the Apache License, Version 2.0", " (the \"License\"); you may not use this file except in compliance with", " the License. You may obtain a copy of the License at", "", " http://www.apache.org/licenses/LICENSE-2.0", "", " Unless required by applicable law or agreed to in writing, software", " distributed under the License is distributed on an \"AS IS\" BASIS,", " WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", " See the License for the specific language governing permissions and", " limitations under the License.", "", " */", "", "package org.apache.derby.impl.sql.catalog;", "", "import org.apache.derby.iapi.services.context.ContextService;", "import org.apache.derby.iapi.services.sanity.SanityManager;", "import org.apache.derby.iapi.error.StandardException;", "import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;", "import org.apache.derby.iapi.sql.dictionary.CatalogRowFactory;", "import org.apache.derby.iapi.sql.dictionary.TabInfo;", "import org.apache.derby.iapi.types.DataValueFactory;", "import org.apache.derby.iapi.types.RowLocation;", "import org.apache.derby.iapi.sql.execute.ExecRow;", "import org.apache.derby.iapi.sql.execute.ExecIndexRow;", "import org.apache.derby.iapi.sql.execute.ExecutionContext;", "import org.apache.derby.iapi.sql.execute.ExecutionFactory;", "import org.apache.derby.iapi.sql.execute.ScanQualifier;", "", "import org.apache.derby.iapi.types.DataValueDescriptor;", "", "import org.apache.derby.iapi.store.access.ConglomerateController;", "import org.apache.derby.iapi.store.access.ScanController;", "import org.apache.derby.iapi.store.access.TransactionController;", "import org.apache.derby.iapi.sql.dictionary.DataDictionary;", "", "import org.apache.derby.iapi.services.io.FormatableBitSet;", "", "/**", " Convience class for scanning an index.", " */", "public class IndexScan", "{", "\t//", "\t//Glorp the caller supplies", "\tTabInfo ti;", "\tint indexId;", "\tScanQualifier[][] qualifiers;", "", "\t//", "\t//Glorp we set up for the caller.", "\tExecutionFactory ef;", "\tTransactionController tc;", "\tDataDictionary\tdataDictionary;", "\tConglomerateController heapCC;", "\tDataValueFactory dvf;", "\tprivate RowLocation\tbaseRowLocation;", "\tExecRow\tbaseRow;", "\tCatalogRowFactory rf;", "\tExecIndexRow indexRow;", "\tScanController sc;", "\t", "\t/**", "\t Create a scan on an index.", "", "\t @param dataDictionary\tthe namespace", "\t @param ti TabInfo for the system table associated with the index.", "\t @param indexId the id for the index (From the CatalogRowFactory).", "\t @param keyCols the key columns for the scan.", "\t @param qualifiers qualifiers", "\t @exception StandardException Ooops", "\t */", "\tpublic IndexScan", "\t(", "\t\tDataDictionary\tdataDictionary,", "\t\tTabInfo \t\tti,", "\t\tint \t\t\tindexId,", "\t\tDataValueDescriptor[] \tkeyCols,", "\t\tScanQualifier[][] qualifiers", " )", "\t\t throws StandardException ", "\t{", "\t\tthis.dataDictionary = dataDictionary;", "\t\tthis.ti = ti;", "\t\tthis.indexId = indexId;", "\t\tthis.qualifiers = qualifiers;", "", "\t\tLanguageConnectionContext \tlcc = (LanguageConnectionContext)", "\t\t\tContextService.getContext(LanguageConnectionContext.CONTEXT_ID);", "\t\ttc = lcc.getTransactionCompile();", "\t\tdvf = lcc.getDataValueFactory();", "\t\t", "\t\tExecutionContext ec= lcc.getExecutionContext();", "\t\tef = ec.getExecutionFactory();", "", "\t\tDataValueDescriptor[] rowArray = null;", "\t\tif (keyCols != null)", "\t\t{", "\t\t\tExecIndexRow keyRow = ef.getIndexableRow(keyCols.length);", "\t\t\tfor (int ix=0;ix<keyCols.length;ix++)", "\t\t\t\tkeyRow.setColumn(ix+1,(DataValueDescriptor)keyCols[ix]);", "\t\t\trowArray = keyRow.getRowArray();", "\t\t}", "", "\t\trf = ti.getCatalogRowFactory();", "", "\t\tbaseRow = rf.makeEmptyRow();", "\t\theapCC = tc.openConglomerate( ti.getHeapConglomerate(),", " false,", "\t\t\t\t\t\t\t\t\t 0,", "\t\t\t\t\t\t\t\t\t TransactionController.MODE_TABLE,", " TransactionController.ISOLATION_REPEATABLE_READ);", "\t\tindexRow = rf.buildEmptyIndexRow(indexId,", "\t\t\t\t\t\t\t\t\t\t heapCC.newRowLocationTemplate());", "\t\tsc = tc.openScan(ti.getIndexConglomerate(indexId),", " false, // don't hold open across commit", " 0, // for read", " TransactionController.MODE_TABLE,", " TransactionController.ISOLATION_REPEATABLE_READ,", " (FormatableBitSet) null, // all fields as objects", " rowArray, \t\t\t // start position - first row", " ScanController.GE, // startSearchOperation", " qualifiers, //scanQualifier,", " rowArray, // stop position - through last row", " ScanController.GT); // stopSearchOperation", "\t} ", "", "\t/**", "\t Fetch a row from the index scan.", "", "\t @return The row or null. Note that the next call to fetch will", "\t replace the columns in the returned row.", "\t @exception StandardException Ooops", "\t */", "\tpublic ExecIndexRow fetch()", "\t\t throws StandardException", "\t{ ", "\t\tif (sc == null) return null;", "\t\tif (!sc.fetchNext(indexRow.getRowArray()))", "\t\t{", "\t\t\tsc.close();", "\t\t\treturn null;", "\t\t}", "\t\treturn indexRow;", "\t}", "", "\t/**", "\t Fetch the base row corresponding to the current index row", "", "\t @return The base row row or null.", "\t @exception StandardException Ooops", "\t */", "\tpublic ExecRow fetchBaseRow()", "\t\t throws StandardException", "\t{ ", "\t\tif (sc == null) return null;", "", "\t\tbaseRowLocation = (RowLocation) indexRow.getColumn(indexRow.nColumns());", "", "\t\tboolean base_row_exists = ", " heapCC.fetch(", " baseRowLocation, baseRow.getRowArray(), (FormatableBitSet) null);", "", " if (SanityManager.DEBUG)", " {", " SanityManager.ASSERT(base_row_exists, \"base row disappeared.\");", " }", "", "\t\treturn baseRow;", "\t}", "", "\t/**", "\t Close the scan.", "\t */", "\tpublic void close()", " throws StandardException", "\t{", "\t\tif (sc != null) ", "\t\t{", "\t\t\tsc.close();", "\t\t\tsc = null;", "\t\t}", "", "\t\tif ( heapCC == null )", "\t\t{", "\t\t\theapCC.close();", "\t\t\theapCC = null;", "\t\t}", "\t}", "}" ] } ] } ]
derby-DERBY-1674-7aa6fa86
DERBY-1674 (partial) CatalogRowFactory.buildEmptyIndexRow() row was implemented in all the sub-classes but could never be called, except for SYSTABLESRowFactory. Seen by code inspection and double checked with the code coverage. Remove all the methods (except SYSTABLESRowFactory) and abstract definition in CatalogRowFactory. Changed DataDictionaryImpl to call buildEmptyIndexRow using a reference to SYSTABLESRowFactory since it was special case code for SYSTABLES. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@434100 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/catalog/SYSTABLESRowFactory.java", "hunks": [ { "added": [ "class SYSTABLESRowFactory extends CatalogRowFactory" ], "header": "@@ -55,7 +55,7 @@ import org.apache.derby.iapi.services.uuid.UUIDFactory;", "removed": [ "public class SYSTABLESRowFactory extends CatalogRowFactory" ] }, { "added": [ " SYSTABLESRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf," ], "header": "@@ -96,7 +96,7 @@ public class SYSTABLESRowFactory extends CatalogRowFactory", "removed": [ " public\tSYSTABLESRowFactory(UUIDFactory uuidf, ExecutionFactory ef, DataValueFactory dvf," ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/catalog/SYSTRIGGERSRowFactory.java", "hunks": [ { "added": [], "header": "@@ -248,50 +248,6 @@ public class SYSTRIGGERSRowFactory extends CatalogRowFactory", "removed": [ "\t/**", "\t * Builds an empty index row.", "\t *", "\t * @param\tindexNumber\tIndex to build empty row for.", "\t * @param rowLocation\tRow location for last column of index row", "\t *", "\t * @return corresponding empty index row", "\t * @exception StandardException thrown on failure", "\t */", "\tpublic ExecIndexRow\tbuildEmptyIndexRow( int indexNumber,", "\t\t\t\t\t\t\t\t\t\t\tRowLocation rowLocation) ", "\t\t\tthrows StandardException", "\t{", "\t\tint ncols = getIndexColumnCount(indexNumber);", "\t\tExecIndexRow row = getExecutionFactory().getIndexableRow(ncols + 1);", "", "\t\trow.setColumn(ncols + 1, rowLocation);", "", "\t\tswitch( indexNumber )", "\t\t{", "\t\t case SYSTRIGGERS_INDEX1_ID:", "\t\t\t\t/* 1st column is TRIGGERID (UUID - char(36)) */", "\t\t\t\trow.setColumn(1, getDataValueFactory().getCharDataValue((String) null));", "\t\t\t\tbreak;", "", "\t\t case SYSTRIGGERS_INDEX2_ID:", "\t\t\t\t/* 1st column is TRIGGERNAME (varchar(128)) */", "\t\t\t\trow.setColumn(1, getDataValueFactory().getVarcharDataValue((String) null));", "", "\t\t\t\t/* 2nd column is SCHEMAID (char(32)) */", "\t\t\t\trow.setColumn(2, getDataValueFactory().getCharDataValue((String) null));", "\t\t\t\tbreak;", "", "\t\t case SYSTRIGGERS_INDEX3_ID:", "\t\t\t\t/* 1nd column is TABLEID (char(32)) */", "\t\t\t\trow.setColumn(2, getDataValueFactory().getCharDataValue((String) null));", "", "\t\t\t\t/* 2nd column is COMPILATIONTIMESTAMP (timestamp) */", "\t\t\t\trow.setColumn(2, new SQLTimestamp());", "\t\t\t\tbreak;", "\t\t}\t// end switch", "", "\t\treturn\trow;", "\t}" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/catalog/SYSVIEWSRowFactory.java", "hunks": [ { "added": [ " " ], "header": "@@ -188,31 +188,7 @@ public class SYSVIEWSRowFactory extends CatalogRowFactory", "removed": [ "", "\t/**", "\t * Builds an empty index row.", "\t *", "\t *\t@param\tindexNumber\tIndex to build empty row for.", "\t * @param rowLocation\tRow location for last column of index row", "\t *", "\t * @return corresponding empty index row", "\t * @exception StandardException thrown on failure", "\t */", "\tpublic ExecIndexRow\tbuildEmptyIndexRow( int indexNumber,", "\t\t\t\t\t\t\t\t\t\t\tRowLocation rowLocation) ", "\t\t\tthrows StandardException", "\t{", "\t\t/* Build the row */", "\t\tExecIndexRow row = getExecutionFactory().getIndexableRow(2);", "", "\t\t/* 1st column is TABLEID (char(36)) */", "\t\trow.setColumn(1, getDataValueFactory().getCharDataValue((String) null));", "", "\t\trow.setColumn(2, rowLocation);", "", "\t\treturn\trow;", "\t}", "" ] }, { "added": [], "header": "@@ -350,9 +326,4 @@ public class SYSVIEWSRowFactory extends CatalogRowFactory", "removed": [ "", "\tpublic int heapColumnCount()", "\t{", "\t\treturn SYSVIEWS_COLUMN_COUNT;", "\t}" ] } ] } ]
derby-DERBY-1674-8d26d289
DERBY-1674 (partial) Remove TabInfo interface as the implementation of system tables is private to the impl/sql/catalog package. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@437823 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/catalog/TabInfoImpl.java", "hunks": [ { "added": [], "header": "@@ -30,7 +30,6 @@ import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;", "removed": [ "import org.apache.derby.iapi.sql.dictionary.TabInfo;" ] }, { "added": [ "class TabInfoImpl", " /**", " * ROWNOTDUPLICATE is out of range for a row", " * number. If a return code does not equal", " * this value, then it refers to the row", " * that is a duplicate.", " */", " static final int ROWNOTDUPLICATE = -1;", "" ], "header": "@@ -60,8 +59,16 @@ import java.util.Properties;", "removed": [ "class TabInfoImpl implements TabInfo" ] }, { "added": [ " /**", " * Get the conglomerate for the heap.", " *", " * @return long The conglomerate for the heap.", " */", "\tlong getHeapConglomerate()", " /**", " * Set the heap conglomerate for this.", " *", " * @param heapConglomerate The new heap conglomerate.", " */", "\tvoid setHeapConglomerate(long heapConglomerate)", " /**", " * Get the conglomerate for the specified index.", " *", " * @return long The conglomerate for the specified index.", " */", "\tlong getIndexConglomerate(int indexID)" ], "header": "@@ -94,27 +101,33 @@ class TabInfoImpl implements TabInfo", "removed": [ "\t/**", "\t * @see TabInfo#getHeapConglomerate", "\t */", "\tpublic long getHeapConglomerate()", "\t/**", "\t * @see TabInfo#setHeapConglomerate", "\t */", "\tpublic void setHeapConglomerate(long heapConglomerate)", "\t/**", "\t * @see TabInfo#getIndexConglomerate", "\t */", "\tpublic long getIndexConglomerate(int indexID)" ] }, { "added": [ " /**", " * Set the index conglomerate for the table.", " *", " * @param index Index number for index for table", " * @param indexConglomerate The conglomerate for that index", " */", "\tvoid setIndexConglomerate(int index, long indexConglomerate)" ], "header": "@@ -131,10 +144,13 @@ class TabInfoImpl implements TabInfo", "removed": [ "\t/**", "\t * @see TabInfo#setIndexConglomerate", "\t */", "\tpublic void setIndexConglomerate(int index, long indexConglomerate)" ] }, { "added": [ " /**", " * Set the index conglomerate for the table.", " *", " * @param cd The ConglomerateDescriptor for one of the index", " * for this table.", " */", " void setIndexConglomerate(ConglomerateDescriptor cd)" ], "header": "@@ -155,7 +171,13 @@ class TabInfoImpl implements TabInfo", "removed": [ "\tpublic void setIndexConglomerate(ConglomerateDescriptor cd)" ] }, { "added": [ " /**", " * Get the table name.", " *", " * @return String The table name.", " */", "\tString getTableName()", " /**", " * Get the index name.", " *", " * @param indexID Index number for index for table", " *", " * @return String The index name.", " */", "\tString getIndexName(int indexId)", " /** ", " * Get the CatalogRowFactory for this.", " *", " * @return CatalogRowFactory The CatalogRowFactory for this.", " */", "\tCatalogRowFactory getCatalogRowFactory()", " /**", " * Is this fully initialized. ", " * (i.e., is all conglomerate info initialized)", " *", " * @return boolean Whether or not this is fully initialized.", " */", "\tboolean isComplete()" ], "header": "@@ -199,34 +221,45 @@ class TabInfoImpl implements TabInfo", "removed": [ "\t/**", "\t * @see TabInfo#getTableName", "\t */", "\tpublic String getTableName()", "\t/**", "\t * @see TabInfo#getIndexName", "\t */", "\tpublic String getIndexName(int indexId)", "\t/**", "\t * @see TabInfo#getCatalogRowFactory", "\t */", "\tpublic CatalogRowFactory getCatalogRowFactory()", "\t/**", "\t * @see TabInfo#isComplete", "\t */", "\tpublic boolean isComplete()" ] }, { "added": [ " /**", " * Get the column count for the specified index number.", " *", " * @param indexNumber The index number.", " *", " * @return int The column count for the specified index.", " */", "\tint getIndexColumnCount(int indexNumber)" ], "header": "@@ -238,10 +271,14 @@ class TabInfoImpl implements TabInfo", "removed": [ "\t/**", "\t * @see TabInfo#getIndexColumnCount", "\t */", "\tpublic int getIndexColumnCount(int indexNumber)" ] }, { "added": [ " /**", " * Get the IndexRowGenerator for the specified index number.", " *", " * @param indexNumber The index number.", " *", " * @return IndexRowGenerator The IRG for the specified index number.", " */", "\tIndexRowGenerator getIndexRowGenerator(int indexNumber)" ], "header": "@@ -258,10 +295,14 @@ class TabInfoImpl implements TabInfo", "removed": [ "\t/**", "\t * @see TabInfo#getIndexRowGenerator", "\t */", "\tpublic IndexRowGenerator getIndexRowGenerator(int indexNumber)" ] }, { "added": [ " /**", " * Set the IndexRowGenerator for the specified index number.", " *", " * @param indexNumber The index number.", " * @param irg The IndexRowGenerator for the specified index number.", " */", "\tvoid setIndexRowGenerator(int indexNumber, IndexRowGenerator irg)" ], "header": "@@ -277,10 +318,13 @@ class TabInfoImpl implements TabInfo", "removed": [ "\t/**", "\t * @see TabInfo#setIndexRowGenerator", "\t */", "\tpublic void setIndexRowGenerator(int indexNumber, IndexRowGenerator irg)" ] }, { "added": [ " /** ", " * Get the number of indexes on this catalog.", " *", " * @return int The number of indexes on this catalog.", " */", "\tint getNumberOfIndexes()" ], "header": "@@ -297,10 +341,12 @@ class TabInfoImpl implements TabInfo", "removed": [ "\t/**", "\t * @see TabInfo#getNumberOfIndexes", "\t */", "\tpublic int getNumberOfIndexes()" ] }, { "added": [ " /**", " * Get the base column position for a column within a catalog", " * given the (0-based) index number for this catalog and the", " * (0-based) column number for the column within the index.", " *", " * @param indexNumber The index number", " * @param colNumber The column number within the index", " *", " * @return int The base column position for the column.", " */", "\tint getBaseColumnPosition(int indexNumber, int colNumber)" ], "header": "@@ -312,10 +358,17 @@ class TabInfoImpl implements TabInfo", "removed": [ "\t/**", "\t * @see TabInfo#getBaseColumnPosition", "\t */", "\tpublic int getBaseColumnPosition(int indexNumber, int colNumber)" ] }, { "added": [ " /**", " * Return whether or not this index is declared unique", " *", " * @param indexNumber The index number", " *", " * @return boolean Whether or not this index is declared unique", " */", "\tboolean isIndexUnique(int indexNumber)" ], "header": "@@ -331,10 +384,14 @@ class TabInfoImpl implements TabInfo", "removed": [ "\t/**", "\t * @see TabInfo#isIndexUnique", "\t */", "\tpublic boolean isIndexUnique(int indexNumber)" ] }, { "added": [ "\tint insertRow( ExecRow row, TransactionController tc, boolean wait)" ], "header": "@@ -363,7 +420,7 @@ class TabInfoImpl implements TabInfo", "removed": [ "\tpublic int insertRow( ExecRow row, TransactionController tc, boolean wait)" ] }, { "added": [], "header": "@@ -372,37 +429,6 @@ class TabInfoImpl implements TabInfo", "removed": [ "", "\t/**", "\t * Inserts a base row into a catalog and inserts all the corresponding", "\t * index rows.", "\t *", "\t *\t@param\trow\t\t\trow to insert", "\t *\t@param\tlcc\t\t\tlanguage state variable", "\t *\t@return\trow number (>= 0) if duplicate row inserted into an index", "\t *\t\t\tROWNOTDUPLICATE otherwise", "\t *", "\t *", "\t * @exception StandardException\t\tThrown on failure", "\t */", "\tpublic int insertRow( ExecRow row, LanguageConnectionContext lcc )", "\t\tthrows StandardException", "\t{", "\t\treturn\tinsertRowList(new ExecRow[] {row}, lcc.getTransactionExecute());", "\t}", "", "\t/**", "\t @see TabInfo#insertRowAndFetchRowLocation", "\t @exception StandardException Thrown on failure", "\t */", "\tpublic RowLocation insertRowAndFetchRowLocation(ExecRow row, TransactionController tc)", "\t\tthrows StandardException", "\t{", "\t\tRowLocation[] rowLocationOut = new RowLocation[1]; ", "\t\tinsertRowListImpl(new ExecRow[] {row},tc,rowLocationOut, true);", "\t\treturn rowLocationOut[0];", "\t}", "" ] }, { "added": [ "\tint insertRowList(ExecRow[] rowList, TransactionController tc )" ], "header": "@@ -416,7 +442,7 @@ class TabInfoImpl implements TabInfo", "removed": [ "\tpublic int insertRowList(ExecRow[] rowList, TransactionController tc )" ] }, { "added": [ "\t odd features." ], "header": "@@ -426,7 +452,7 @@ class TabInfoImpl implements TabInfo", "removed": [ "\t odd features to support the TabInfo interface." ] }, { "added": [ " /**", " * Given a key row, delete all matching heap rows and their index", " * rows.", " * <p>", " * LOCKING: row locking if there is a key; otherwise, ", " * table locking.", " *", " * @param tc transaction controller", " * @param key key to delete by.", " * @param indexNumber Key is appropriate for this index.", " * @return the number of rows deleted. If key is not unique,", " * this may be more than one.", " * @exception StandardException Thrown on failure", " */", "\tint deleteRow( TransactionController tc, ExecIndexRow key, int indexNumber )" ], "header": "@@ -534,78 +560,22 @@ class TabInfoImpl implements TabInfo", "removed": [ "\t/**", "\t * @exception StandardException\t\tThrown on failure", "\t * @see TabInfo#truncate", "\t */", "\tpublic int truncate( TransactionController tc )", "\t\t throws StandardException", "\t{", "\t\tConglomerateController\t\theapCC;", "\t\tScanController\t\t\t\tdrivingScan;", "\t\tRowLocation\t\t\t\t\tbaseRowLocation;", "\t\tRowChanger \t\t\t\t\trc;", "\t\tExecRow\t\t\t\t\t\tbaseRow = crf.makeEmptyRow();", "", "\t\trc = getRowChanger( tc, (int[])null,baseRow );", "\t\t// Table level locking", "\t\trc.open(TransactionController.MODE_TABLE);", "\t\tint rowsDeleted = 0;", "\t\t", "\t\tdrivingScan = tc.openScan(", "\t\t\tgetHeapConglomerate(), // conglomerate to open", "\t\t\tfalse, // don't hold open across commit", " TransactionController.OPENMODE_FORUPDATE, // for update", " TransactionController.MODE_TABLE,", " TransactionController.ISOLATION_REPEATABLE_READ,", "\t\t\t(FormatableBitSet) null, // all fields as objects", "\t\t\tnull, // start position - first row", " ScanController.NA,", "\t\t\tnull, //scanQualifier", "\t\t\tnull, // stop position - through last row", " ScanController.NA", " // startSearchOperation", "\t\t\t); ", "\t\t/* Open the heap conglomerate */", "\t\theapCC = tc.openConglomerate(", " getHeapConglomerate(),", " false,", " TransactionController.OPENMODE_FORUPDATE,", " TransactionController.MODE_TABLE,", " TransactionController.ISOLATION_REPEATABLE_READ);", "", "\t\tbaseRowLocation = heapCC.newRowLocationTemplate();", "\t\twhile (drivingScan.next())", "\t\t{", "\t\t\trowsDeleted++;", "\t\t\tdrivingScan.fetchLocation(baseRowLocation);", "\t\t\tboolean base_row_exists = ", " heapCC.fetch(", " baseRowLocation, baseRow.getRowArray(), (FormatableBitSet) null);", "", " if (SanityManager.DEBUG)", " {", " // it can not be possible for heap row to disappear while ", " // holding scan cursor on index at ISOLATION_REPEATABLE_READ.", " SanityManager.ASSERT(base_row_exists, \"base row not found\");", " }", "\t\t\trc.deleteRow( baseRow, baseRowLocation );", "\t\t}", "", "\t\theapCC.close();", "\t\tdrivingScan.close();", "\t\trc.close();", "\t\treturn rowsDeleted;", "\t}", "", "\t/**", "\t * LOCKING: row locking if there there is a key", "\t *", "\t * @exception StandardException\t\tThrown on failure", "\t * @see TabInfo#deleteRow", "\t */", "\tpublic int deleteRow( TransactionController tc, ExecIndexRow key, int indexNumber )" ] }, { "added": [ "\tint deleteRow( TransactionController tc, ExecIndexRow key," ], "header": "@@ -620,7 +590,7 @@ class TabInfoImpl implements TabInfo", "removed": [ "\tpublic int deleteRow( TransactionController tc, ExecIndexRow key," ] }, { "added": [ " /**", " * Delete the set of rows defined by a scan on an index", " * from the table. Most of the parameters are simply passed", " * to TransactionController.openScan. Please refer to the", " * TransactionController documentation for details.", " * <p>", " * LOCKING: row locking if there is a start and a stop", " * key; otherwise, table locking", " *", " * @param tc transaction controller", " * @param startKey key to start the scan.", " * @param startOp operation to start the scan.", " * @param stopKey key to start the scan.", " * @param qualifier a qualifier for the scan.", " * @param filter filter on base rows", " * @param stopOp operation to start the scan.", " * @param indexNumber Key is appropriate for this index.", " * @return the number of rows deleted.", " * @exception StandardException Thrown on failure", " * @see TransactionController#openScan", " */", "\tint deleteRows(TransactionController tc," ], "header": "@@ -636,14 +606,28 @@ class TabInfoImpl implements TabInfo", "removed": [ "\t/**", "\t * LOCKING: row locking if there is both a start and", "\t * stop key; otherwise table locking", "\t *", "\t * @exception StandardException\t\tThrown on failure", "\t * @see TabInfo#deleteRows", "\t */", "\tpublic int deleteRows(TransactionController tc," ] }, { "added": [ "\tprivate int deleteRows(TransactionController tc," ], "header": "@@ -666,7 +650,7 @@ class TabInfoImpl implements TabInfo", "removed": [ "\tpublic int deleteRows(TransactionController tc," ] }, { "added": [ " /**", " * Given a key row, return the first matching heap row.", " * <p>", " * LOCKING: shared row locking.", " *", " * @param tc transaction controller", " * @param key key to read by.", " * @param indexNumber Key is appropriate for this index.", " * @exception StandardException Thrown on failure", " */", "\tExecRow getRow( TransactionController tc," ], "header": "@@ -776,11 +760,17 @@ class TabInfoImpl implements TabInfo", "removed": [ "\t/**", "\t * @exception StandardException\t\tThrown on failure", "\t * @see TabInfo#getRow", "\t */", "\tpublic ExecRow getRow( TransactionController tc," ] }, { "added": [ "\tRowLocation getRowLocation(TransactionController tc," ], "header": "@@ -813,7 +803,7 @@ class TabInfoImpl implements TabInfo", "removed": [ "\tpublic RowLocation getRowLocation(TransactionController tc," ] }, { "added": [ " /**", " * Given a key row, return the first matching heap row.", " * <p>", " * LOCKING: shared row locking.", " *", " * @param tc transaction controller", " * @param heap heap to look in", " * @param key key to read by.", " * @param indexNumber Key is appropriate for this index.", " * @exception StandardException Thrown on failure", " */", "\tExecRow getRow( TransactionController tc," ], "header": "@@ -837,11 +827,18 @@ class TabInfoImpl implements TabInfo", "removed": [ "\t/**", "\t * @exception StandardException\t\tThrown on failure", "\t * @see TabInfo#getRow", "\t */", "\tpublic ExecRow getRow( TransactionController tc," ] }, { "added": [], "header": "@@ -854,7 +851,6 @@ class TabInfoImpl implements TabInfo", "removed": [ "\t * @see TabInfo#getRow" ] }, { "added": [ "\tvoid updateRow( ExecIndexRow\t\t\t\tkey, " ], "header": "@@ -935,7 +931,7 @@ class TabInfoImpl implements TabInfo", "removed": [ "\tpublic void updateRow( ExecIndexRow\t\t\t\tkey, " ] }, { "added": [ "\tvoid updateRow( ExecIndexRow\t\t\t\tkey, " ], "header": "@@ -966,7 +962,7 @@ class TabInfoImpl implements TabInfo", "removed": [ "\tpublic void updateRow( ExecIndexRow\t\t\t\tkey, " ] }, { "added": [ "\tvoid updateRow( ExecIndexRow\t\t\t\tkey," ], "header": "@@ -997,7 +993,7 @@ class TabInfoImpl implements TabInfo", "removed": [ "\tpublic void updateRow( ExecIndexRow\t\t\t\tkey," ] }, { "added": [ "\tprivate void updateRow( ExecIndexRow\t\t\t\tkey," ], "header": "@@ -1030,7 +1026,7 @@ class TabInfoImpl implements TabInfo", "removed": [ "\tpublic void updateRow( ExecIndexRow\t\t\t\tkey," ] }, { "added": [ "\tProperties getCreateHeapProperties()" ], "header": "@@ -1116,7 +1112,7 @@ class TabInfoImpl implements TabInfo", "removed": [ "\tpublic Properties getCreateHeapProperties()" ] }, { "added": [ "\tProperties getCreateIndexProperties(int indexNumber)" ], "header": "@@ -1128,7 +1124,7 @@ class TabInfoImpl implements TabInfo", "removed": [ "\tpublic Properties getCreateIndexProperties(int indexNumber)" ] } ] } ]
derby-DERBY-1674-a7d7f12f
DERBY-1674 Remove some unused methods related to TabInfo classes. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@433632 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java", "hunks": [ { "added": [], "header": "@@ -272,21 +272,6 @@ public interface DataDictionary", "removed": [ "\t/**", " \t *\tGet the tabinfo of a system catalog. Paw through the tabinfo arrays looking for the tabinfo", " \t *\tcorresponding to this table name.", " \t *", " \t * RESOLVE: This does not bother to fault in the TabInfo. It assumes it already", " \t * has been faulted in. This seems odd.", " \t *", " \t *\t@param\ttableName\tname of table to get the TabInfo for.", " \t *", " \t *\t@return\ttabinfo corresponding to tablename", " \t *", " \t * @exception StandardException\t\tThrown on error", " \t */", "\tpublic\tTabInfo\tgetTabInfo( String tableName ) throws StandardException;", "" ] } ] }, { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/TabInfo.java", "hunks": [ { "added": [], "header": "@@ -102,14 +102,6 @@ public interface TabInfo", "removed": [ "\t/**", "\t * Set the index name for the specified indexID", "\t *", "\t * @param indexID\tIndex number for index for table", "\t * @param indexName\tThe name for that index ID", "\t */", "\tpublic void setIndexName(int indexID, String indexName);", "" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java", "hunks": [ { "added": [], "header": "@@ -7333,42 +7333,6 @@ public final class\tDataDictionaryImpl", "removed": [ " \t/**", " \t *\tGet the tabinfo of a system catalog. Paw through the tabinfo arrays looking for the tabinfo", " \t *\tcorresponding to this table name.", " \t *", "\t * RESOLVE: This does not bother to fault in the TabInfo. It assumes it already", "\t * has been faulted in. This seems odd.", " \t *", "\t *\t@param\ttableName\tname of table to get the TabInfo for.", " \t *", "\t *\t@return\ttabinfo corresponding to tablename", " \t *", " \t * @exception StandardException\t\tThrown on error", "\t */", " \tpublic\tTabInfo\tgetTabInfo( String tableName ) throws StandardException", " \t{", " \t\tTabInfo\t\ttabinfo;", " ", " \t\tfor ( int ictr = 0; ictr < coreInfo.length; ictr++ )", " \t\t{", " \t\t\ttabinfo = coreInfo[ ictr ];", " \t\t\tif ( tabinfo.getTableName().equals( tableName ) ) { return tabinfo; }", " \t\t}", " ", " \t\t// Non-core tables are not pre-loaded. Translate the name", " \t\t// to a number and look it up that way.", " \t\tfor (int ictr = 0; ictr < nonCoreNames.length; ictr++)", "\t\t{", " \t\t\tif (nonCoreNames[ictr].equals(tableName))", "\t\t\t{", "\t\t\t\treturn getNonCoreTI(ictr);", "\t\t\t}", "\t\t}", "", " \t\treturn\tnull;", "\t}", "" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/catalog/IndexInfoImpl.java", "hunks": [ { "added": [], "header": "@@ -95,16 +95,6 @@ class IndexInfoImpl", "removed": [ "\t/**", "\t * Set the name for the index.", "\t *", "\t * @param indexName\t\tThe name for the index.", "\t */", "\tvoid setIndexName(String indexName)", "\t{", "\t\tname = indexName;", "\t}", "" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/catalog/TabInfoImpl.java", "hunks": [ { "added": [], "header": "@@ -225,24 +225,6 @@ class TabInfoImpl implements TabInfo", "removed": [ "\t/**", "\t * @see TabInfo#setIndexName", "\t */", "\tpublic void setIndexName(int indexID, String indexName)", "\t{", "\t\tif (SanityManager.DEBUG)", "\t\t{", "\t\t\tSanityManager.ASSERT(indexes != null,", "\t\t\t\t\"indexes is expected to be non-null\");", "", "\t\t\tif (indexID >= indexes.length)", "\t\t\t\tSanityManager.THROWASSERT(", "\t\t\t\t\"indexID (\" + indexID + \") is out of range(0-\" +", "\t\t\t\tindexes.length + \")\");", "\t\t}", "\t\tindexes[indexID].setIndexName(indexName);", "\t}", "" ] }, { "added": [], "header": "@@ -359,26 +341,6 @@ class TabInfoImpl implements TabInfo", "removed": [ "\t/**", "\t * @see TabInfo#setBaseColumnPosition", "\t */", "\tpublic void setBaseColumnPosition(int indexNumber, int colNumber,", "\t\t\t\t\t\t\t\t\t int baseColumnPosition)", "\t{", "\t\tif (SanityManager.DEBUG)", "\t\t{", "\t\t\tSanityManager.ASSERT(indexes != null,", "\t\t\t\t\"indexes is expected to be non-null\");", "\t\t\tif (indexNumber >= indexes.length)", "\t\t\t{", "\t\t\t\tSanityManager.THROWASSERT(\"indexNumber (\" + indexNumber + \") is out of range(0-\" +", "\t\t\t\t\tindexes.length + \")\");", "\t\t\t}", "\t\t}", "", "\t\tindexes[indexNumber].setBaseColumnPosition(colNumber, baseColumnPosition);", "\t}", "" ] } ] } ]
derby-DERBY-1674-c4c6000f
DERBY-1674 (partial) Clean up SystemColumn interface and implementation to hold the data type of the column using the standard DataTypeDescriptor class rather than individual fields. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@432895 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/SystemColumn.java", "hunks": [ { "added": [ "", "" ], "header": "@@ -20,10 +20,9 @@", "removed": [ "import org.apache.derby.iapi.error.StandardException;", "import org.apache.derby.iapi.types.DataValueDescriptor;", "import org.apache.derby.iapi.types.DataValueFactory;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/catalog/SystemColumnImpl.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.types.TypeId;" ], "header": "@@ -26,6 +26,7 @@ import org.apache.derby.iapi.error.StandardException;", "removed": [] }, { "added": [ "\tprivate\tfinal String\tname;", "\tprivate\tfinal int\t\tid;", " ", " /**", " * Fully described type of the column.", " */", " private final DataTypeDescriptor type;" ], "header": "@@ -37,14 +38,13 @@ import org.apache.derby.iapi.types.DataValueFactory;", "removed": [ "\tprivate\tString\tname;", "\tprivate\tint\t\tid;", "\tprivate\tint\t\tprecision;", "\tprivate int\t\tscale;", "\tprivate\tboolean\tnullability;", "\tprivate String\tdataType;", "\tprivate boolean\tbuiltInType;", "\tprivate\tint\t\tmaxLength;" ] }, { "added": [ " ", " TypeId typeId;", "", " if (builtInType)", " {", " typeId = TypeId.getBuiltInTypeId(dataType);", " }", " else", " {", "", " typeId = TypeId.getUserDefinedTypeId(dataType, false);", " }", "", " this.type = new DataTypeDescriptor(", " typeId,", " precision,", " scale,", " nullability,", " maxLength", " );" ], "header": "@@ -68,12 +68,26 @@ public class SystemColumnImpl implements SystemColumn", "removed": [ "\t\tthis.precision\t\t= precision;", "\t\tthis.scale\t\t\t= scale;", "\t\tthis.nullability\t= nullability;", "\t\tthis.dataType\t\t= dataType;", "\t\tthis.builtInType\t= builtInType;", "\t\tthis.maxLength\t\t= maxLength;" ] }, { "added": [ " this(name, id, 0, 0, nullability, \"VARCHAR\", true, 128);" ], "header": "@@ -88,12 +102,7 @@ public class SystemColumnImpl implements SystemColumn", "removed": [ "\t\tthis.name\t\t\t= name;", "\t\tthis.id\t\t\t\t= id;", "\t\tthis.nullability\t= nullability;", "\t\tthis.dataType\t\t= \"VARCHAR\";", "\t\tthis.builtInType\t= true;", "\t\tthis.maxLength\t\t= 128;" ] }, { "added": [ " /**", " * Return the type of this column.", " */", " public DataTypeDescriptor getType() {", " return type;", " }" ], "header": "@@ -116,65 +125,11 @@ public class SystemColumnImpl implements SystemColumn", "removed": [ "\t/**", "\t * Gets the precision of this column.", "\t *", "\t * @return\tThe precision of data stored in this column.", "\t */", "\tpublic int\tgetPrecision()", "\t{", "\t\treturn\tprecision;", "\t}", "", "\t/**", "\t * Gets the scale of this column.", "\t *", "\t * @return\tThe scale of data stored in this column.", "\t */", "\tpublic int\tgetScale()", "\t{", "\t\treturn\tscale;", "\t}", "", "\t/**", "\t * Gets the nullability of this column.", "\t *", "\t * @return\tTrue if this column is nullable. False otherwise.", "\t */", "\tpublic boolean\tgetNullability()", "\t{", "\t\treturn\tnullability;", "\t}", "", "\t/**", "\t * Gets the datatype of this column.", "\t *", "\t * @return\tThe datatype of this column.", "\t */", "\tpublic String\tgetDataType()", "\t{", "\t\treturn\tdataType;", "\t}", "", "\t/**", "\t * Is it a built-in type?", "\t *", "\t * @return\tTrue if it's a built-in type.", "\t */", "\tpublic boolean\tbuiltInType()", "\t{", "\t\treturn builtInType;", "\t}", "", "\t/**", "\t * Gets the maximum length of this column.", "\t *", "\t * @return\tThe maximum length of data stored in this column.", "\t */", "\tpublic int\tgetMaxLength()", "\t{", "\t\treturn\tmaxLength;", "\t}", "" ] } ] } ]
derby-DERBY-1674-f7e090fc
DERBY-1674 (partial) Step towards removing iapi.sql.dictionary.TabInfo as its implementation TabInfoImpl should be package private to impl.sql.catalog. All references now use TabInfoImpl directly instead of TabInfo. Next step is to move the javadoc comments from TabInfo into TabInfoImpl and remove the class. Simplify TabInfoImpl and IndexInfoImpl to not duplicate variables from CatalogRowFactory. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@433688 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/catalog/DD_Version.java", "hunks": [ { "added": [], "header": "@@ -30,7 +30,6 @@ import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;", "removed": [ "import org.apache.derby.iapi.sql.dictionary.TabInfo;" ] }, { "added": [ "\t\t\t\t\t\t\t\t\t TabInfoImpl ti)" ], "header": "@@ -483,7 +482,7 @@ public\tclass DD_Version implements\tFormatable", "removed": [ "\t\t\t\t\t\t\t\t\t TabInfo ti)" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java", "hunks": [ { "added": [], "header": "@@ -58,7 +58,6 @@ import org.apache.derby.iapi.sql.dictionary.CheckConstraintDescriptor;", "removed": [ "import org.apache.derby.iapi.sql.dictionary.TabInfo;" ] }, { "added": [ "\tprivate TabInfoImpl[] coreInfo;" ], "header": "@@ -256,7 +255,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\tprivate TabInfo[] coreInfo;" ] }, { "added": [ "\tprivate TabInfoImpl[] noncoreInfo;" ], "header": "@@ -338,7 +337,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\tprivate TabInfo[] noncoreInfo;" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = coreInfo[SYSSCHEMAS_CORE_NUM];" ], "header": "@@ -1495,7 +1494,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = coreInfo[SYSSCHEMAS_CORE_NUM];" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\t ti = coreInfo[SYSSCHEMAS_CORE_NUM];" ], "header": "@@ -1534,7 +1533,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\t ti = coreInfo[SYSSCHEMAS_CORE_NUM];" ] }, { "added": [ "\t\tTabInfoImpl ti = (catalogNumber < NUM_CORE) ? coreInfo[catalogNumber] :" ], "header": "@@ -1645,7 +1644,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo ti = (catalogNumber < NUM_CORE) ? coreInfo[catalogNumber] :" ] }, { "added": [ "\t\t\tif (insertRetCode != TabInfoImpl.ROWNOTDUPLICATE)" ], "header": "@@ -1654,7 +1653,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\t\tif (insertRetCode != TabInfo.ROWNOTDUPLICATE)" ] }, { "added": [ "\t\tTabInfoImpl ti = (catalogNumber < NUM_CORE) ? coreInfo[catalogNumber] :" ], "header": "@@ -1687,7 +1686,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo ti = (catalogNumber < NUM_CORE) ? coreInfo[catalogNumber] :" ] }, { "added": [ "\t\tif (!allowDuplicates && insertRetCode != TabInfoImpl.ROWNOTDUPLICATE)" ], "header": "@@ -1700,7 +1699,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tif (!allowDuplicates && insertRetCode != TabInfo.ROWNOTDUPLICATE)" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = coreInfo[SYSSCHEMAS_CORE_NUM];" ], "header": "@@ -1720,7 +1719,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = coreInfo[SYSSCHEMAS_CORE_NUM];" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\t ti = coreInfo[SYSTABLES_CORE_NUM];" ], "header": "@@ -1832,7 +1831,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\t ti = coreInfo[SYSTABLES_CORE_NUM];" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\t ti = coreInfo[SYSTABLES_CORE_NUM];" ], "header": "@@ -1945,7 +1944,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\t ti = coreInfo[SYSTABLES_CORE_NUM];" ] }, { "added": [ "\t\t\t\t\t\tTabInfoImpl\t\t\t\t\tti, " ], "header": "@@ -2067,7 +2066,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\t\t\t\t\tTabInfo\t\t\t\t\tti, " ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = coreInfo[SYSTABLES_CORE_NUM];" ], "header": "@@ -2159,7 +2158,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = coreInfo[SYSTABLES_CORE_NUM];" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = coreInfo[SYSTABLES_CORE_NUM];" ], "header": "@@ -2194,7 +2193,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = coreInfo[SYSTABLES_CORE_NUM];" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\tti = coreInfo[SYSCOLUMNS_CORE_NUM];" ], "header": "@@ -2254,7 +2253,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\tti = coreInfo[SYSCOLUMNS_CORE_NUM];" ] }, { "added": [ "\t\tTabInfoImpl ti = coreInfo[SYSCOLUMNS_CORE_NUM];" ], "header": "@@ -2315,7 +2314,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo ti = coreInfo[SYSCOLUMNS_CORE_NUM];" ] }, { "added": [ "\t\tTabInfoImpl\tti = getNonCoreTI(SYSROUTINEPERMS_CATALOG_NUM);" ], "header": "@@ -2461,7 +2460,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\tti = getNonCoreTI(SYSROUTINEPERMS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t ti = coreInfo[SYSCOLUMNS_CORE_NUM];" ], "header": "@@ -2505,7 +2504,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t ti = coreInfo[SYSCOLUMNS_CORE_NUM];" ] }, { "added": [ "\t\tTabInfoImpl\tti = getNonCoreTI(SYSTABLEPERMS_CATALOG_NUM);" ], "header": "@@ -2527,7 +2526,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\tti = getNonCoreTI(SYSTABLEPERMS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\tti = getNonCoreTI(SYSCOLPERMS_CATALOG_NUM);" ], "header": "@@ -2559,7 +2558,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\tti = getNonCoreTI(SYSCOLPERMS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\t\tti = coreInfo[SYSCOLUMNS_CORE_NUM];" ], "header": "@@ -2606,7 +2605,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\t\tti = coreInfo[SYSCOLUMNS_CORE_NUM];" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t ti = getNonCoreTI(SYSVIEWS_CATALOG_NUM);" ], "header": "@@ -2735,7 +2734,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t ti = getNonCoreTI(SYSVIEWS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = getNonCoreTI(SYSVIEWS_CATALOG_NUM);" ], "header": "@@ -2777,7 +2776,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = getNonCoreTI(SYSVIEWS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\t ti = getNonCoreTI(SYSFILES_CATALOG_NUM);" ], "header": "@@ -2802,7 +2801,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\t ti = getNonCoreTI(SYSFILES_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\t ti = getNonCoreTI(SYSFILES_CATALOG_NUM);" ], "header": "@@ -2843,7 +2842,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\t ti = getNonCoreTI(SYSFILES_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = getNonCoreTI(SYSFILES_CATALOG_NUM);" ], "header": "@@ -2884,7 +2883,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = getNonCoreTI(SYSFILES_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\t ti = getNonCoreTI(SYSSTATEMENTS_CATALOG_NUM);" ], "header": "@@ -3024,7 +3023,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\t ti = getNonCoreTI(SYSSTATEMENTS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\t ti = getNonCoreTI(SYSSTATEMENTS_CATALOG_NUM);" ], "header": "@@ -3116,7 +3115,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\t ti = getNonCoreTI(SYSSTATEMENTS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = getNonCoreTI(SYSSTATEMENTS_CATALOG_NUM);" ], "header": "@@ -3175,7 +3174,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = getNonCoreTI(SYSSTATEMENTS_CATALOG_NUM);" ] }, { "added": [ "\t\tif (insertRetCode != TabInfoImpl.ROWNOTDUPLICATE)" ], "header": "@@ -3197,7 +3196,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tif (insertRetCode != TabInfo.ROWNOTDUPLICATE)" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\t\tti = getNonCoreTI(SYSSTATEMENTS_CATALOG_NUM);" ], "header": "@@ -3312,7 +3311,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\t\tti = getNonCoreTI(SYSSTATEMENTS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl ti = getNonCoreTI(SYSSTATEMENTS_CATALOG_NUM);" ], "header": "@@ -3463,7 +3462,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo ti = getNonCoreTI(SYSSTATEMENTS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = getNonCoreTI(SYSSTATEMENTS_CATALOG_NUM);" ], "header": "@@ -3537,7 +3536,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = getNonCoreTI(SYSSTATEMENTS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = getNonCoreTI(SYSSTATEMENTS_CATALOG_NUM);" ], "header": "@@ -3562,7 +3561,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = getNonCoreTI(SYSSTATEMENTS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM);" ], "header": "@@ -3590,7 +3589,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = getNonCoreTI(SYSTRIGGERS_CATALOG_NUM);" ], "header": "@@ -3616,7 +3615,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = getNonCoreTI(SYSTRIGGERS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\t ti = getNonCoreTI(SYSTRIGGERS_CATALOG_NUM);" ], "header": "@@ -3640,7 +3639,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\t ti = getNonCoreTI(SYSTRIGGERS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\t ti = getNonCoreTI(SYSTRIGGERS_CATALOG_NUM);" ], "header": "@@ -3674,7 +3673,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\t ti = getNonCoreTI(SYSTRIGGERS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = getNonCoreTI(SYSTRIGGERS_CATALOG_NUM);" ], "header": "@@ -3755,7 +3754,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = getNonCoreTI(SYSTRIGGERS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = getNonCoreTI(SYSTRIGGERS_CATALOG_NUM);" ], "header": "@@ -3792,7 +3791,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = getNonCoreTI(SYSTRIGGERS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\t\tti = getNonCoreTI(SYSTRIGGERS_CATALOG_NUM);" ], "header": "@@ -3829,7 +3828,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\t\tti = getNonCoreTI(SYSTRIGGERS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM);" ], "header": "@@ -3915,7 +3914,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM);" ], "header": "@@ -3954,7 +3953,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl ti = getNonCoreTI(SYSSTATISTICS_CATALOG_NUM);" ], "header": "@@ -3980,7 +3979,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo ti = getNonCoreTI(SYSSTATISTICS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\t ti = getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM);" ], "header": "@@ -4174,7 +4173,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\t ti = getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM);" ] }, { "added": [ "\t * @param ti\t\tThe TabInfoImpl to use" ], "header": "@@ -4200,7 +4199,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t * @param ti\t\tThe TabInfo to use" ] }, { "added": [ "\t\t\t\t\t\tTabInfoImpl ti," ], "header": "@@ -4213,7 +4212,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\t\t\t\t\tTabInfo ti," ] }, { "added": [ "\t * @param ti\t\t\t\t\t\tThe TabInfoImpl to use" ], "header": "@@ -4345,7 +4344,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t * @param ti\t\t\t\t\t\tThe TabInfo to use" ] }, { "added": [ "\t\t\t\t\t\tTabInfoImpl ti," ], "header": "@@ -4356,7 +4355,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\t\t\t\t\tTabInfo ti," ] }, { "added": [ "\t\tTabInfoImpl ti = getNonCoreTI(SYSFOREIGNKEYS_CATALOG_NUM);" ], "header": "@@ -4490,7 +4489,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo ti = getNonCoreTI(SYSFOREIGNKEYS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl \t\t\t\tti = getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM);" ], "header": "@@ -4547,7 +4546,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo \t\t\t\tti = getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\t ti = getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM);" ], "header": "@@ -4663,7 +4662,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\t ti = getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\t\tti = getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM);" ], "header": "@@ -4741,7 +4740,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\t\tti = getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM);" ], "header": "@@ -4829,7 +4828,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = getNonCoreTI(SYSCONSTRAINTS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti;" ], "header": "@@ -4911,7 +4910,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti;" ] }, { "added": [ "\t\tTabInfoImpl\tti;" ], "header": "@@ -4958,7 +4957,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\tti;" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti;" ], "header": "@@ -5028,7 +5027,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti;" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\t\tti = getNonCoreTI(SYSCHECKS_CATALOG_NUM);" ], "header": "@@ -5101,7 +5100,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\t\tti = getNonCoreTI(SYSCHECKS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = getNonCoreTI(SYSCHECKS_CATALOG_NUM);" ], "header": "@@ -5135,7 +5134,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = getNonCoreTI(SYSCHECKS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\t ti = coreInfo[SYSCONGLOMERATES_CORE_NUM];" ], "header": "@@ -5170,7 +5169,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\t ti = coreInfo[SYSCONGLOMERATES_CORE_NUM];" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = coreInfo[SYSTABLES_CORE_NUM];" ], "header": "@@ -5225,7 +5224,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = coreInfo[SYSTABLES_CORE_NUM];" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = coreInfo[SYSCONGLOMERATES_CORE_NUM];" ], "header": "@@ -5298,7 +5297,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = coreInfo[SYSCONGLOMERATES_CORE_NUM];" ] }, { "added": [ " \t\tTabInfoImpl\t\t\t\t\t ti = coreInfo[SYSCONGLOMERATES_CORE_NUM];" ], "header": "@@ -5368,7 +5367,7 @@ public final class\tDataDictionaryImpl", "removed": [ " \t\tTabInfo\t\t\t\t\t ti = coreInfo[SYSCONGLOMERATES_CORE_NUM];" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = coreInfo[SYSCONGLOMERATES_CORE_NUM];" ], "header": "@@ -5416,7 +5415,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = coreInfo[SYSCONGLOMERATES_CORE_NUM];" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\t ti = coreInfo[SYSCONGLOMERATES_CORE_NUM];" ], "header": "@@ -5459,7 +5458,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\t ti = coreInfo[SYSCONGLOMERATES_CORE_NUM];" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = coreInfo[SYSCONGLOMERATES_CORE_NUM];" ], "header": "@@ -5496,7 +5495,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = coreInfo[SYSCONGLOMERATES_CORE_NUM];" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = coreInfo[SYSCONGLOMERATES_CORE_NUM];" ], "header": "@@ -5526,7 +5525,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = coreInfo[SYSCONGLOMERATES_CORE_NUM];" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\t\tti = coreInfo[SYSSCHEMAS_CORE_NUM];" ], "header": "@@ -5607,7 +5606,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\t\tti = coreInfo[SYSSCHEMAS_CORE_NUM];" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\t\tti = coreInfo[SYSCONGLOMERATES_CORE_NUM];" ], "header": "@@ -5657,7 +5656,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\t\tti = coreInfo[SYSCONGLOMERATES_CORE_NUM];" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = getNonCoreTI(SYSDEPENDS_CATALOG_NUM);" ], "header": "@@ -5706,7 +5705,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = getNonCoreTI(SYSDEPENDS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = getNonCoreTI(SYSDEPENDS_CATALOG_NUM);" ], "header": "@@ -5743,7 +5742,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = getNonCoreTI(SYSDEPENDS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\t\tti = getNonCoreTI(SYSDEPENDS_CATALOG_NUM);" ], "header": "@@ -5783,7 +5782,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\t\tti = getNonCoreTI(SYSDEPENDS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = getNonCoreTI(SYSDEPENDS_CATALOG_NUM);" ], "header": "@@ -5838,7 +5837,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = getNonCoreTI(SYSDEPENDS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = getNonCoreTI(SYSDEPENDS_CATALOG_NUM);" ], "header": "@@ -5876,7 +5875,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = getNonCoreTI(SYSDEPENDS_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = getNonCoreTI(SYSALIASES_CATALOG_NUM);" ], "header": "@@ -5916,7 +5915,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = getNonCoreTI(SYSALIASES_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\t ti = getNonCoreTI(SYSALIASES_CATALOG_NUM);" ], "header": "@@ -5955,7 +5954,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\t ti = getNonCoreTI(SYSALIASES_CATALOG_NUM);" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = getNonCoreTI(SYSALIASES_CATALOG_NUM);" ], "header": "@@ -6082,7 +6081,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = getNonCoreTI(SYSALIASES_CATALOG_NUM);" ] }, { "added": [ "\tpublic void loadCatalogs(DataDescriptorGenerator ddg, TabInfoImpl[] catalogArray)", "\t\tTabInfoImpl\t\tcatalog;" ], "header": "@@ -6142,13 +6141,13 @@ public final class\tDataDictionaryImpl", "removed": [ "\tpublic void loadCatalogs(DataDescriptorGenerator ddg, TabInfo[] catalogArray)", "\t\tTabInfo\t\tcatalog;" ] }, { "added": [ "\t\t\tTabInfoImpl\tti = coreInfo[coreCtr];" ], "header": "@@ -6215,7 +6214,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\t\tTabInfo\tti = coreInfo[coreCtr];" ] }, { "added": [ "\t\t\tTabInfoImpl\t\t\tti = coreInfo[ictr];" ], "header": "@@ -6239,7 +6238,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\t\tTabInfo\t\t\tti = coreInfo[ictr];" ] }, { "added": [ "\t\t\tTabInfoImpl ti = getNonCoreTIByNumber(catalogNumber);" ], "header": "@@ -6322,7 +6321,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\t\tTabInfo ti = getNonCoreTIByNumber(catalogNumber);" ] }, { "added": [ "\t\tTabInfoImpl ti;" ], "header": "@@ -6438,7 +6437,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo ti;" ] }, { "added": [ "\t *\t@param\tti\t\t\tTabInfoImpl describing catalog to create.", "\tpublic\tvoid\tmakeCatalog( TabInfoImpl\t\t\t\t\tti," ], "header": "@@ -6451,13 +6450,13 @@ public final class\tDataDictionaryImpl", "removed": [ "\t *\t@param\tti\t\t\tTabInfo describing catalog to create.", "\tpublic\tvoid\tmakeCatalog( TabInfo\t\t\t\t\tti," ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti," ], "header": "@@ -6663,7 +6662,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti," ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = coreInfo[SYSTABLES_CORE_NUM];" ], "header": "@@ -6710,7 +6709,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = coreInfo[SYSTABLES_CORE_NUM];" ] }, { "added": [ "\t\tTabInfoImpl ti = (isCoreTable) ? coreInfo[tableNum] :" ], "header": "@@ -6806,7 +6805,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo ti = (isCoreTable) ? coreInfo[tableNum] :" ] }, { "added": [ "\t\t\t\t\t\t\t\t TabInfoImpl ti)" ], "header": "@@ -6865,7 +6864,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\t\t\t\t\t\t\t TabInfo ti)" ] }, { "added": [ "\t\tTabInfoImpl ti = coreInfo[SYSCOLUMNS_CORE_NUM];" ], "header": "@@ -6927,7 +6926,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo ti = coreInfo[SYSCOLUMNS_CORE_NUM];" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti," ], "header": "@@ -7002,7 +7001,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti," ] }, { "added": [ "\t\t\t\t\t\t\t\t\t\t TabInfoImpl ti," ], "header": "@@ -7092,7 +7091,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\t\t\t\t\t\t\t\t\t TabInfo ti," ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\t\tti = getNonCoreTI(SYSDUMMY1_CATALOG_NUM);" ], "header": "@@ -7128,8 +7127,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\t\tti = getNonCoreTI(SYSDUMMY1_CATALOG_NUM);", "\t\tSYSDUMMY1RowFactory\t\t\trf = (SYSDUMMY1RowFactory) ti.getCatalogRowFactory();" ] }, { "added": [ "\tprivate void addSystemTableToDictionary(TabInfoImpl ti," ], "header": "@@ -7160,7 +7158,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\tprivate void addSystemTableToDictionary(TabInfo ti," ] }, { "added": [ "\t\tTabInfoImpl[] lcoreInfo = coreInfo = new TabInfoImpl[NUM_CORE];" ], "header": "@@ -7310,7 +7308,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo[] lcoreInfo = coreInfo = new TabInfo[NUM_CORE];" ] }, { "added": [ "\t\tnoncoreInfo = new TabInfoImpl[NUM_NONCORE];" ], "header": "@@ -7330,7 +7328,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tnoncoreInfo = new TabInfo[NUM_NONCORE];" ] }, { "added": [ "\t * @param ti\t\tThe TabInfoImpl to use" ], "header": "@@ -7410,7 +7408,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t * @param ti\t\tThe TabInfo to use" ] }, { "added": [ "\t\t\t\t\t\tTabInfoImpl ti," ], "header": "@@ -7424,7 +7422,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\t\t\t\t\tTabInfo ti," ] }, { "added": [ " TransactionController tc, ConglomerateController heapCC, TabInfoImpl ti," ], "header": "@@ -7559,7 +7557,7 @@ public final class\tDataDictionaryImpl", "removed": [ " TransactionController tc, ConglomerateController heapCC, TabInfo ti," ] }, { "added": [ "\t * @param ti\t\t\t\t\t\tThe TabInfoImpl to use" ], "header": "@@ -7621,7 +7619,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t * @param ti\t\t\t\t\t\tThe TabInfo to use" ] }, { "added": [ "\t\t\t\t\t\tTabInfoImpl ti," ], "header": "@@ -7632,7 +7630,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\t\t\t\t\tTabInfo ti," ] }, { "added": [ "\t * Get a TabInfoImpl for a non-core table.", "\tprivate TabInfoImpl getNonCoreTI(int catalogNumber)", "\t\tTabInfoImpl\tti = getNonCoreTIByNumber(catalogNumber);" ], "header": "@@ -7686,17 +7684,17 @@ public final class\tDataDictionaryImpl", "removed": [ "\t * Get a TabInfo for a non-core table.", "\tprivate TabInfo getNonCoreTI(int catalogNumber)", "\t\tTabInfo\tti = getNonCoreTIByNumber(catalogNumber);" ] }, { "added": [ "\tprotected TabInfoImpl getNonCoreTIByNumber(int catalogNumber)", "\t\t// Look up the TabInfoImpl in the array. This does not have to be", "\t\tTabInfoImpl retval = noncoreInfo[nonCoreNum];", "\t\t\t// If we did not find the TabInfoImpl, get the right one and" ], "header": "@@ -7706,19 +7704,19 @@ public final class\tDataDictionaryImpl", "removed": [ "\tprotected TabInfo getNonCoreTIByNumber(int catalogNumber)", "\t\t// Look up the TabInfo in the array. This does not have to be", "\t\tTabInfo retval = noncoreInfo[nonCoreNum];", "\t\t\t// If we did not find the TabInfo, get the right one and" ] }, { "added": [ "\tprotected void initSystemIndexVariables(TabInfoImpl ti)" ], "header": "@@ -7812,7 +7810,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\tprotected void initSystemIndexVariables(TabInfo ti)" ] }, { "added": [ "\t *\tFinishes building a TabInfoImpl if it hasn't already been faulted in.", "\t *\tNOP if TabInfoImpl has already been faulted in.", "\t *\t@param\tti\tTabInfoImpl to fault in.", "\tpublic\tvoid\tfaultInTabInfo( TabInfoImpl ti )" ], "header": "@@ -7835,14 +7833,14 @@ public final class\tDataDictionaryImpl", "removed": [ "\t *\tFinishes building a TabInfo if it hasn't already been faulted in.", "\t *\tNOP if TabInfo has already been faulted in.", "\t *\t@param\tti\tTabInfo to fault in.", "\tpublic\tvoid\tfaultInTabInfo( TabInfo ti )" ] }, { "added": [ "\t\tTabInfoImpl ti = coreInfo[SYSCOLUMNS_CORE_NUM];" ], "header": "@@ -8134,7 +8132,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo ti = coreInfo[SYSCOLUMNS_CORE_NUM];" ] }, { "added": [ "\t\tTabInfoImpl ti = coreInfo[SYSCOLUMNS_CORE_NUM];" ], "header": "@@ -8188,7 +8186,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo ti = coreInfo[SYSCOLUMNS_CORE_NUM];" ] }, { "added": [ "\t\tTabInfoImpl\t\t\t\t\tti = getNonCoreTI(SYSSTATISTICS_CATALOG_NUM);" ], "header": "@@ -8277,7 +8275,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tTabInfo\t\t\t\t\tti = getNonCoreTI(SYSSTATISTICS_CATALOG_NUM);" ] }, { "added": [ " TabInfoImpl ti = getNonCoreTI( catalogNumber);" ], "header": "@@ -10122,7 +10120,7 @@ public final class\tDataDictionaryImpl", "removed": [ " TabInfo ti = getNonCoreTI( catalogNumber);" ] }, { "added": [ " SanityManager.ASSERT( insertRetCode == TabInfoImpl.ROWNOTDUPLICATE," ], "header": "@@ -10157,7 +10155,7 @@ public final class\tDataDictionaryImpl", "removed": [ " SanityManager.ASSERT( insertRetCode == TabInfo.ROWNOTDUPLICATE," ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/catalog/IndexInfoImpl.java", "hunks": [ { "added": [ "", " ", " private final CatalogRowFactory crf;", " private final int indexNumber;", "\tIndexInfoImpl(int indexNumber, CatalogRowFactory crf)", " this.crf = crf;", " this.indexNumber = indexNumber;", "\t\tthis.conglomerateNumber = -1;", " /**" ], "header": "@@ -37,35 +37,27 @@ import org.apache.derby.catalog.UUID;", "removed": [ "\tprivate boolean\t\t\t\tisUnique;", "\tprivate int[]\t\t\t\tcolumnPositions;", "\tprivate int\t\t\t\t\tcolumnCount;", "\tprivate String\t\t\t\tname;", "\t * @param conglomerateNumber\tThe conglomerate number for the index", "\t * @param indexName\t\t\t\tThe name of the index", "\t * @param columnCount\t\t\tThe number of columns in the index", "\t * @param isUnique\t\t\t\tWhether or not the index was declared as unique", "\tIndexInfoImpl(long conglomerateNumber, String indexName, int columnCount,", "\t\t\t\t boolean isUnique,", "\t\t\t\t int indexNumber, CatalogRowFactory crf)", "\t\tthis.conglomerateNumber = conglomerateNumber;", "\t\tname = indexName;", "\t\tthis.columnCount = columnCount;", "\t\tthis.isUnique = isUnique;", "\t\tcolumnPositions = crf.getIndexColumnPositions(indexNumber);", "\t/**" ] }, { "added": [ "\t\treturn crf.getIndexName(indexNumber);" ], "header": "@@ -92,7 +84,7 @@ class IndexInfoImpl", "removed": [ "\t\treturn name;" ] }, { "added": [ "\t\treturn crf.getIndexColumnCount(indexNumber);" ], "header": "@@ -102,7 +94,7 @@ class IndexInfoImpl", "removed": [ "\t\treturn columnCount;" ] }, { "added": [ "\t\treturn crf.getIndexColumnPositions(indexNumber)[colNumber];" ], "header": "@@ -135,7 +127,7 @@ class IndexInfoImpl", "removed": [ "\t\treturn columnPositions[colNumber];" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/catalog/TabInfoImpl.java", "hunks": [ { "added": [ "\tprivate final CatalogRowFactory\t\t\tcrf;" ], "header": "@@ -63,14 +63,10 @@ import java.util.Properties;", "removed": [ "\tprivate String\t\t\t\t\t\tname;", "\tprivate UUID\t\t\t\t\t\tuuid;", "\tprivate CatalogRowFactory\t\t\tcrf;", "", "\tprivate\tExecutionFactory\t\t\texecutionFactory;" ] }, { "added": [], "header": "@@ -79,10 +75,8 @@ class TabInfoImpl implements TabInfo", "removed": [ "\t\tthis.name = crf.getCatalogName();", "\t\tthis.executionFactory = crf.getExecutionFactory();" ] }, { "added": [], "header": "@@ -94,10 +88,6 @@ class TabInfoImpl implements TabInfo", "removed": [ "\t\t\t\t\t\t\t\t\t\t\t-1, ", "\t\t\t\t\t\t\t\t\t\t\tcrf.getIndexName(indexCtr),", "\t\t\t\t\t\t\t\t\t\t\tcrf.getIndexColumnCount(indexCtr),", "\t\t\t\t\t\t\t\t\t\t\tcrf.isIndexUnique(indexCtr)," ] }, { "added": [ "\t\treturn crf.getCatalogName();" ], "header": "@@ -214,7 +204,7 @@ class TabInfoImpl implements TabInfo", "removed": [ "\t\treturn name;" ] }, { "added": [ "\t\trc = crf.getExecutionFactory().getRowChanger(getHeapConglomerate()," ], "header": "@@ -1139,7 +1129,7 @@ class TabInfoImpl implements TabInfo", "removed": [ "\t\trc = executionFactory.getRowChanger(getHeapConglomerate()," ] }, { "added": [ "\t\t\treturn \"name: \" + this.getTableName() + ", "\t\t\t\t\"\\n\"; " ], "header": "@@ -1215,12 +1205,12 @@ class TabInfoImpl implements TabInfo", "removed": [ "\t\t\treturn \"name: \" + name + ", "\t\t\t\t\"\\n\\tuuid: \" + uuid; " ] } ] } ]
derby-DERBY-1675-3c53f6c2
DERBY-1675: Network Server should not send to client that it supports EUSRIDPWD when running against Sun JVM Updating comments. Patch contributed by Sunitha Kambhampati. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@441779 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java", "hunks": [ { "added": [ " /**", " * Can EUSRIDPWD security mechanism be used with ", " * the current JVM", " */", " /*", " * DRDA Specification for the EUSRIDPWD security mechanism", " * requires DH algorithm support with a 32-byte prime to be", " * used. Not all JCE implementations have support for this.", " * Hence here we need to find out if EUSRIDPWD can be used", " * with the current JVM.", " */ " ], "header": "@@ -297,11 +297,19 @@ public final class NetworkServerControlImpl {", "removed": [ " // Sun JCE does not have support for EUSRIDPWD, whereas", " // most versions of IBM JCE have support for this. Hence", " // find out if the server can support EUSRIDPWD." ] }, { "added": [ " * This method returns whether EUSRIDPWD security mechanism", " * is supported or not. See class static block for more", " * info.", " * @return true if EUSRIDPWD is supported, false otherwise", " */ ", " " ], "header": "@@ -2603,16 +2611,16 @@ public final class NetworkServerControlImpl {", "removed": [ " * EUSRIDPWD support depends on the availability of the", " * algorithm in the JCE implementation in the classpath ", " * of the server. At runtime, information about this ", " * capability is figured out. ", " * @return whether EUSRIDPWD is supported or not", " */" ] } ] } ]
derby-DERBY-1675-b4e48e9c
DERBY-1675 contributed by Sunitha Kambhampati USRIDPWD support depends on the JCE available in the classpath of the server This patch(derby1675.diff.txt) does the following 1. Add code to check if server jvm can support EUSRIDPWD. 2. Throw an error if the derby.drda.securityMechanism is set to ENCRYPTED_USER_AND_PASSWORD_SECURITY and if the server jvm cannot support EUSRIDPWD. 3. Server sends the client the list of supported security mechanisms as part of ACCSECRD. Now, the server will correctly only send EUSRIDPWD as an option if the running server can support this security mechanism. Test related changes: Changes were made to testProtocol.java and a new method readSecMecAndSECCHKCD is added to TestProto to read the SECMEC and SECCHKCD values. Note, that with ibm142 and ibm15 jvms that support eusridpwd, the SECMEC value 9 (eusridpwd) will be sent as part of the ACCSECRD response. But for the jvms that dont support the eusridpwd, the SECMEC value of 9 wont be sent. The new method readSecMecAndSECCHKCD takes care of printing out the SECMEC values that are sent by the server - this results in the need for a new master file for the jvm that support eusridpwd and the jvm that cannot support it. A new master file has been added for ibm14. Tests for codepath that covers #2 is already present in testSecMec.java. This results in themaster updates for the jvms that do not support eusridpwd for the case where server is started with derby..drda.securityMechanism=ENCRYPTED_USER_AND_PASSWORD_SECURITY. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@441722 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/drda/org/apache/derby/impl/drda/DRDAConnThread.java", "hunks": [ { "added": [ " if (((securityMechanism != CodePoint.SECMEC_EUSRIDPWD) ||", " (securityMechanism == CodePoint.SECMEC_EUSRIDPWD && ", " !server.supportsEUSRIDPWD())", " ) &&" ], "header": "@@ -1688,8 +1688,10 @@ class DRDAConnThread extends Thread {", "removed": [ " if ((securityMechanism !=", " CodePoint.SECMEC_EUSRIDPWD) &&" ] } ] }, { "file": "java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java", "hunks": [ { "added": [ " // Sun JCE does not have support for EUSRIDPWD, whereas", " // most versions of IBM JCE have support for this. Hence", " // find out if the server can support EUSRIDPWD.", " private static boolean SUPPORTS_EUSRIDPWD = false;", " static", " {", " try", " {", " // The DecryptionManager class will instantiate objects of the required ", " // security algorithms that are needed for EUSRIDPWD", " // An exception will be thrown if support is not available", " // in the JCE implementation in the JVM in which the server", " // is started.", " new DecryptionManager();", " SUPPORTS_EUSRIDPWD = true;", " }catch(Exception e)", " {", " // if an exception is thrown, ignore exception.", " // set SUPPORTS_EUSRIDPWD to false indicating that the server ", " // does not have support for EUSRIDPWD security mechanism", " SUPPORTS_EUSRIDPWD = false;", " }", " }", "", " // constructor" ], "header": "@@ -297,8 +297,32 @@ public final class NetworkServerControlImpl {", "removed": [ "\t// constructor" ] }, { "added": [ " /**", " * EUSRIDPWD support depends on the availability of the", " * algorithm in the JCE implementation in the classpath ", " * of the server. At runtime, information about this ", " * capability is figured out. ", " * @return whether EUSRIDPWD is supported or not", " */", " boolean supportsEUSRIDPWD()", " {", " return SUPPORTS_EUSRIDPWD;", " }" ], "header": "@@ -2578,6 +2602,17 @@ public final class NetworkServerControlImpl {", "removed": [] } ] }, { "file": "java/drda/org/apache/derby/impl/drda/TestProto.java", "hunks": [ { "added": [ " private static final int READ_SECMEC_SECCHKCD = 57;" ], "header": "@@ -110,6 +110,7 @@ public class TestProto {", "removed": [] }, { "added": [ " commandTable.put(\"readsecmecandsecchkcd\", new Integer(READ_SECMEC_SECCHKCD));" ], "header": "@@ -324,6 +325,7 @@ public class TestProto {", "removed": [] }, { "added": [ " case READ_SECMEC_SECCHKCD:", " readSecMecAndSECCHKCD();", " break;" ], "header": "@@ -468,6 +470,9 @@ public class TestProto {", "removed": [] } ] } ]
derby-DERBY-1681-cafb31f9
DERBY-1681, submitted by Army Brown Fixes the following issue: If Derby chooses to do a join between two FromTables and the right table is a chain of UNIONs, then the optimizer may choose to push the join predicate (if provided) down into the UNION and to both children of every UNION in the chain. But if the predicate cannot be pushed to the children of any of the UNIONs (except the top-level one) the predicate can end up being ignored altogether with respect to that UNION's children. The result is that query execution can return rows that do not satisfy the predicate. This is a regression introduced in 10.1.2.4 and thus it affects 10.1.3 and 10.2. I came across this while tracing through code for DERBY-1633. For more detailed explanation of problem and solution see html doc attached to DERBY-1681. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@432367 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/compile/SetOperatorNode.java", "hunks": [ { "added": [ "\t\t/* Now see if there are any left over predicates; if so, then we", "\t\t * have to generate a ProjectRestrictNode. Note: we walk the", "\t\t * entire chain of UnionNodes (if there is a chain) and see if", "\t\t * any UnionNode at any level has un-pushed predicates; if so, then", "\t\t * we use a PRN to enforce the predicate at this, the top-most", "\t\t * UnionNode.", "\t\t */", "\t\tif (hasUnPushedPredicates())" ], "header": "@@ -171,10 +171,14 @@ abstract class SetOperatorNode extends TableOperatorNode", "removed": [ "\t\t// Now see if there are any left over predicates; if so, then we", "\t\t// have to generate a ProjectRestrictNode.", "\t\tif (((leftOptPredicates != null) && (leftOptPredicates.size() > 0)) ||", "\t\t\t((rightOptPredicates != null) && (rightOptPredicates.size() > 0)))" ] }, { "added": [ "\t/**", "\t * It's possible that we tried to push predicates to this node's", "\t * children but failed to do so. This can happen if this node's", "\t * children both satisfy the criteria for pushing a predicate", "\t * (namely, they reference base tables) but the children's", "\t * children do not (see modifyAccessPaths() above for an example", "\t * of how that can happen). So this method will walk the chain", "\t * of nodes beneath this one and determine if any SetOperatorNode", "\t * at any level has predicates that were not successfully pushed", "\t * to both of its children (note: this currently only applies", "\t * to UnionNodes).", "\t *", "\t * @return True if any UnionNode (or actually, any SetOperatorNode)", "\t * in the chain of SetOperatorNodes (starting with this one) has", "\t * unpushed predicates; false otherwise.", "\t */", "\tprotected boolean hasUnPushedPredicates()", "\t{", "\t\t// Check this node.", "\t\tif (((leftOptPredicates != null) && (leftOptPredicates.size() > 0)) ||", "\t\t\t((rightOptPredicates != null) && (rightOptPredicates.size() > 0)))", "\t\t{", "\t\t\treturn true;", "\t\t}", "", "\t\t// Now check the children.", "\t\tif ((leftResultSet instanceof SetOperatorNode) &&", "\t\t\t((SetOperatorNode)leftResultSet).hasUnPushedPredicates())", "\t\t{", "\t\t\treturn true;", "\t\t}", "", "\t\treturn ((rightResultSet instanceof SetOperatorNode) &&", "\t\t\t((SetOperatorNode)rightResultSet).hasUnPushedPredicates());", "\t}", "" ], "header": "@@ -462,6 +466,42 @@ abstract class SetOperatorNode extends TableOperatorNode", "removed": [] } ] } ]
derby-DERBY-1686-17f76265
DERBY-1686 The original fix retrieves all the relevent providers such as table, view, and routine descriptor(s) of the given view at bind time and pass this information to runtime later for it to determine if the privilege is grantable or not by the grantor. Patch contributed by Yip Ng - [email protected] git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@441131 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java", "hunks": [ { "added": [ " return getUncachedTablePermsDescriptor( key );" ], "header": "@@ -9968,7 +9968,7 @@ public final class\tDataDictionaryImpl", "removed": [ " return (TablePermsDescriptor) getPermissions( key);" ] }, { "added": [ " return getUncachedColPermsDescriptor( key );" ], "header": "@@ -9987,7 +9987,7 @@ public final class\tDataDictionaryImpl", "removed": [ " return (ColPermsDescriptor) getPermissions( key);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/PrivilegeNode.java", "hunks": [ { "added": [ " * @param isGrant grant if true; revoke if false", "\tpublic QueryTreeNode bind( HashMap dependencies, List grantees, boolean isGrant ) throws StandardException" ], "header": "@@ -98,12 +98,12 @@ public class PrivilegeNode extends QueryTreeNode", "removed": [ " *", "\tpublic QueryTreeNode bind( HashMap dependencies, List grantees ) throws StandardException" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/TablePrivilegesNode.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.sql.depend.DependencyManager;", "import org.apache.derby.iapi.sql.depend.Provider;", "import org.apache.derby.iapi.sql.depend.ProviderInfo;", "import org.apache.derby.iapi.sql.depend.ProviderList;", "import org.apache.derby.iapi.sql.conn.ConnectionUtil;", "import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;", "import org.apache.derby.iapi.sql.dictionary.AliasDescriptor;", "import org.apache.derby.iapi.sql.dictionary.DataDictionary;", "import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;", "import org.apache.derby.iapi.sql.dictionary.TupleDescriptor;", "import org.apache.derby.iapi.sql.dictionary.ViewDescriptor;", "", "import java.util.ArrayList;", "import java.util.List;", "" ], "header": "@@ -29,6 +29,21 @@ import org.apache.derby.impl.sql.execute.TablePrivilegeInfo;", "removed": [] }, { "added": [ "\tprivate TableDescriptor td; ", "\tprivate List descriptorList; ", "\t" ], "header": "@@ -37,8 +52,9 @@ public class TablePrivilegesNode extends QueryTreeNode", "removed": [ "\tprivate TableDescriptor td;", "" ] }, { "added": [ "\t * @param isGrant grant if true; revoke if false", "\tpublic void bind( TableDescriptor td, boolean isGrant) throws StandardException", "\t\t\t" ], "header": "@@ -74,11 +90,12 @@ public class TablePrivilegesNode extends QueryTreeNode", "removed": [ "\tpublic void bind( TableDescriptor td) throws StandardException", "\t\t" ] }, { "added": [ "\t\t", "\t\tif (isGrant && td.getTableType() == TableDescriptor.VIEW_TYPE)", "\t\t{", "\t\t\tbindPrivilegesForView(td);", "\t\t}" ], "header": "@@ -90,6 +107,11 @@ public class TablePrivilegesNode extends QueryTreeNode", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/TablePrivilegeInfo.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.sql.dictionary.AliasDescriptor;", "import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;", "import org.apache.derby.iapi.sql.dictionary.ViewDescriptor;", "import org.apache.derby.iapi.sql.dictionary.TupleDescriptor;", "import org.apache.derby.iapi.reference.SQLState;" ], "header": "@@ -28,12 +28,17 @@ import org.apache.derby.iapi.error.StandardException;", "removed": [] }, { "added": [ "\tprivate List descriptorList;", "\t\t\t\t\t\t\t FormatableBitSet[] columnBitSets,", "\t\t\t\t\t\t\t List descriptorList)", "\t\tthis.descriptorList = descriptorList;", "\t}", "\t", "\t/**", "\t * Determines whether a user is the owner of an object", "\t * (table, function, or procedure). Note that the database ", "\t * creator can access database objects without needing to be ", "\t * their owner.", "\t *", "\t * @param user\t\t\t\t\tauthorizationId of current user", "\t * @param td \t\t table descriptor being checked against", "\t * @param sd\t\t\t\t\tSchemaDescriptor", "\t * @param dd\t\t\t\t\tDataDictionary", "\t * @param lcc LanguageConnectionContext", "\t * @param grant grant if true; revoke if false", "\t *", "\t * @exception StandardException if user does not own the object", "\t */", "\tprotected void checkOwnership( String user,", "\t\t\t\t\t\t\t\t TableDescriptor td,", "\t\t\t\t\t\t\t\t SchemaDescriptor sd,", "\t\t\t\t\t\t\t\t DataDictionary dd,", "\t\t\t\t\t\t\t\t LanguageConnectionContext lcc,", "\t\t\t\t\t\t\t\t boolean grant)", "\t\tthrows StandardException", "\t{", "\t\tsuper.checkOwnership(user, td, sd, dd);", "\t\t", "\t\t// additional check specific to this subclass", "\t\tif (grant)", "\t\t{", "\t\t\tcheckPrivileges(user, td, sd, dd, lcc);", "\t\t}", "\t}", "\t", "\t/**", "\t * Determines if the privilege is grantable by this grantor", "\t * for the given view.", "\t * ", "\t * Note that the database owner can access database objects ", "\t * without needing to be their owner. This method should only ", "\t * be called if it is a GRANT.", "\t * ", "\t * @param user\t\t\t\t\tauthorizationId of current user", "\t * @param td\t\t TableDescriptor to be checked against", "\t * @param sd\t\t\t\t\tSchemaDescriptor", "\t * @param dd\t\t\t\t\tDataDictionary", "\t * @param lcc LanguageConnectionContext", "\t *", "\t * @exception StandardException if user does not have permission to grant", "\t */", "\tprivate void checkPrivileges( String user,", "\t\t\t\t\t\t\t\t TableDescriptor td,", "\t\t\t\t\t\t\t\t SchemaDescriptor sd,", "\t\t\t\t\t\t\t\t DataDictionary dd,", "\t\t\t\t\t\t\t\t LanguageConnectionContext lcc)", "\t\tthrows StandardException", "\t{", "\t\tif (user.equals(dd.getAuthorizationDBA())) return;", "\t\t", "\t\t// check view specific", "\t\tif (td.getTableType() == TableDescriptor.VIEW_TYPE) ", "\t\t{", "\t\t\tif (descriptorList != null )", "\t\t\t{\t\t\t \t\t ", "\t\t\t\tTransactionController tc = lcc.getTransactionExecute();", "\t\t\t\tint siz = descriptorList.size();", "\t\t\t\tfor (int i=0; i < siz; i++)", "\t\t\t\t{", "\t\t\t\t\tTupleDescriptor p;", "\t\t\t\t\tSchemaDescriptor s = null;", "", "\t\t\t\t\tp = (TupleDescriptor)descriptorList.get(i);", "\t\t\t\t\tif (p instanceof TableDescriptor)", "\t\t\t\t\t{", "\t\t\t\t\t\tTableDescriptor t = (TableDescriptor)p;", "\t\t\t\t\t\ts = t.getSchemaDescriptor();", "\t\t\t \t}", "\t\t\t\t\telse if (p instanceof ViewDescriptor)", "\t\t\t\t\t{", "\t\t\t\t\t\tViewDescriptor v = (ViewDescriptor)p;\t", "\t\t\t\t\t\ts = dd.getSchemaDescriptor(v.getCompSchemaId(), tc);", "\t\t\t\t\t}", "\t\t\t \telse if (p instanceof AliasDescriptor)", "\t\t\t \t{", "\t\t\t \t\tAliasDescriptor a = (AliasDescriptor)p;", "\t\t\t\t\t\ts = dd.getSchemaDescriptor( a.getSchemaUUID(), tc);", "\t\t\t \t}", "\t\t\t\t\t\t\t\t", "\t\t\t\t\tif (s != null && !user.equals(s.getAuthorizationId()) ) ", "\t\t\t\t\t{", "\t\t\t\t\t\tthrow StandardException.newException(", "\t\t\t\t \t\t\t SQLState.AUTH_NO_OBJECT_PERMISSION,", "\t\t\t\t \t\t\t user,", "\t\t\t\t \t\t\t \"grant\",", "\t\t\t\t \t\t\t sd.getSchemaName(),", "\t\t\t\t\t\t\t\t td.getName());\t\t ", "\t\t\t\t\t}", "\t\t\t \t\t\t ", "\t\t\t \t// FUTURE: if object is not own by grantor then check if ", "\t\t\t \t// the grantor have grant option.", "\t\t\t\t}", "\t\t\t}", "\t\t}" ], "header": "@@ -59,17 +64,123 @@ public class TablePrivilegeInfo extends PrivilegeInfo", "removed": [ "\t\t\t\t\t\t\t FormatableBitSet[] columnBitSets)" ] } ] } ]
derby-DERBY-1688-cc8ea120
DERBY-1688: ConsistencyToken.hashCode() is not thread safe Rewrite the method to use a thread-safe approach as suggested by The "Double-Checked Locking is Broken" Declaration. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@431603 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/drda/org/apache/derby/impl/drda/ConsistencyToken.java", "hunks": [ { "added": [ " // ConsistencyToken objects might be kept for a long time and are", " // frequently used as keys in hash tables. Therefore, it is a good idea", " // to cache their hash codes.", " int h = hash;", " if (h == 0) {", " // The hash code has not been calculated yet (or perhaps the hash", " // code actually is 0). Calculate a new one and cache it. No", " // synchronization is needed since reads and writes of 32-bit", " // primitive values are guaranteed to be atomic. See The", " // \"Double-Checked Locking is Broken\" Declaration for details.", " h ^= bytes[i];", " hash = h;", " return h;" ], "header": "@@ -70,13 +70,23 @@ final class ConsistencyToken {", "removed": [ " if (hash == 0) {", " hash ^= bytes[i];", " return hash;" ] } ] } ]
derby-DERBY-1691-c4ce097d
DERBY-1691 blobclob4BLOB.java fails under DerbyNet framework. Fixed by printing stack traces to stdout. Contributed by [email protected] git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@442199 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1694-02a8e2e3
DERBY-1694 contributed by Sunitha Kambhampati I was looking at the testProperties issue that caused problems because of test hang. The test doesnt hang in my environment but I thought I would look to see why the test didnt timeout. I found couple of issues here: 0. The testProperties.java and several networkserver tests exec new processes to start server, test properties,shutdown server etc. In some cases, we wait to capture the output from the subprocess that is started. ProcessStreamResult is used for this purpose. ProcessStreamResult is part of the harness (see org.apache.derbyTesting.functionTests.harness.ProcessStreamResult) and it starts a thread to read data from the process's stream and writes it out. Once EOS (-1) is reached, the thread exits after doing a notifyAll. 1. ProcessStreamResult.Wait() does not work with the timeout case. I think the original intention of the method that takes the timeout was to force the thread to stop, once the timeout period has elapsed. The method Wait() does not handle this case. 2. On timeout, the myThread needs to stop its work. The run() method does not handle this case. 3. testProperties test does not make use of the ProcessStreamResult timeout mechanism. 4. Process's are exec'd in the tests and they are not destroyed within a timeout period. The network server tests start server using Process, and then cleanup by shutting them down. It will all work ok, if no deadlock or blocking of process's occur. It seems to me though, that we should have a way to destroy the processes that are started as part of each test given a timeout period. Each test must learn to do the cleanup when it leaves and the test has knowledge of all the sub-processes that it has exec'd. The current test harness has a class TimedProcess which could work. In the spirit of incremental development, I am attaching a patch(derby1694.p2.diff.txt and corresponding stat file - derby1694.p2.stat.txt) that fixes problems 1,2 and 3. I think #4 can be handled as a separate issue/patch. This patch -- fixes the timeout handling in ProcessStreamResult. Instance variable 'interrupted' is a flag to indicate if a timeout has occurred or if the thread's work has been interrupted in between. The flag 'finished' indicates whether the work has been finished by the thread. Changes are in Wait() method to make use of wait(timeoutms) if a timeout is specified in ProcessStreamResult. If timeout time has elapsed, then the interrupted flag is set to true. -- Adds condition in the run() method to check if interrupted is true. If so, the thread will stop its work and leave. -- correctly return if the thread's work was interrupted either because of a timeout or if it was interrupted. -- Make use of the ProcessStreamResult with a timeout setting of 2 minutes in testProperties test. Note, the timeout handling only comes into effect when ProcessStreamResult.Wait() method is called. other notes: -- when you run a test, the suite property for timeout does not get picked up. I think this is intentional behavior. -- Issues mentioned above are not specific to just testProperties but exist for other networkserver tests. There are a total of 7 files in derbynet that make use of this. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@447736 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/functionTests/harness/ProcessStreamResult.java", "hunks": [ { "added": [ "", " /**", " * Flag to find out if the work was finished ", " * successfully without being interrupted ", " * in between because of a timeout setting", " */", " ", " /**", " * Flag to keep state of whether the myThread has timed out.", " * When interrupted is true, the myThread will exit ", " * from its work. ", " */", " ", " /**", " * time in minutes for myThread to timeout in case it ", " * has not finished its work before that.", " * timeout handling only comes into effect only when Wait()", " * is called.", " */" ], "header": "@@ -32,11 +32,30 @@ public class ProcessStreamResult implements Runnable", "removed": [] }, { "added": [ " // keep reading from the stream as long as we have not ", " // timed out", "\t\t\twhile (((valid = inStream.read(ca, 0, ca.length)) != -1) &&", " !interrupted)" ], "header": "@@ -92,7 +111,10 @@ public class ProcessStreamResult implements Runnable", "removed": [ "\t\t\twhile ((valid = inStream.read(ca, 0, ca.length)) != -1)" ] }, { "added": [ " // if we timed out, then just leave", " if ( interrupted )", " return;", " ", " // successfully finished the work, notifyAll and leave.", " /**", " * Wait till the myThread has finished its work or incase a timeout was set on this ", " * object, then to set a flag to indicate the myThread to leave at the end of the ", " * timeout period.", " * ", " * Behavior is as follows:", " * 1) If timeout is set to a valid value (>0) - in this case, if myThread has not", " * finished its work by the time this method was called, then it will wait", " * till the timeout has elapsed or if the myThread has finished its work.", " * ", " * 2)If timeout is not set ( <= 0) - in this case, if myThread has not", " * finished its work by the time this method was called, then it will wait", " * till myThread has finished its work.", " * ", " * If timeout is set to a valid value, and the timeout amount of time has elapsed, ", " * then the interrupted flag is set to true to indicate that it is time for the ", " * myThread to stop its work and leave.", " *", " * @return true if the timeout happened before myThread work was finished", " * else false", " * @throws IOException", " */", " // It is possible that we have finished the work ", " // by the time this method Wait() was called,", " // so need to check if that is the case, before we", " // go into a wait.", " if ( finished )", " return interrupted;", " " ], "header": "@@ -124,17 +146,51 @@ public class ProcessStreamResult implements Runnable", "removed": [] } ] } ]
derby-DERBY-1694-68a8fb10
DERBY-1694 Cleanup derbynet/testProperties so that it always handles the output from the processes it forks. Not handling the output can lead to hangs according to the javadoc for java.lang.Process. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@431697 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1698-b9df96ab
DERBY-1698, contributed by Deepa Remesh adds an additional test to jdbcapi/SetQueryTimeoutTest.java. This patch adds a test for executeUpdate method call. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@436904 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-170-505bb8a1
DERBY-1533: ArrayIndexOutOfBoundsException in DDMReader DERBY-1533 follows in a series of bugs (DERBY-170, DERBY-428, DERBY-491, DERBY-492, DERBY-614 among others) which have to do with the particulars of the DRDA protocols used for handling long messages and large amounts of data. In this particular issue, the problems involve the situation in which the server is receiving a message which is segmented across multiple layer A blocks using DSS continuations. This is a relatively unusual case, as generally large amounts of data flow from the server to the client, not vice versa. This change contains two modifications to DDMReader, as well as some tests: 1) The Network Server method DDMReader.compressBLayerData was incorrect in several respects. Rather than going through that code in detail, I noticed that an almost identical version of this routine exists in the DerbyNetClient, in the class Reply, and I am pretty confident that the client side code is working, so I just wholesale modified the server's compressBLayerData method so that it matched the client's method. 2) When the client is sending parameter data to the server, and the data to be sent is a large array of bytes for a blob, the client, the client may send the data inline as DRDA_TYPE_NVARBYTE, or it may externalize the data and send it as DRDA_TYPE_NLOBBYTES. I believe that similar things happen with CLOB. The client makes this decision based on the length of the data to be sent; short values are sent inline, and long values are sent externalized. When the server receives the data, it must decide whether it is reading an inline string of bytes, or externalized data, and it, too, makes this decision based on the length of the data. However, the server's code for this was comparing the length of the byte string against the amount of data left in the current segment, as opposed to comparing it against the constant threshold value for switching from inline bytes to externalized bytes; hence if a long byte string happened to start late in a buffer, and was then segmented (continued) into a subsequent buffer, the server would mistakenly think the byte string was being sent as externalized bytes, when in fact it was sent as inline bytes. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@430077 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/drda/org/apache/derby/impl/drda/DDMReader.java", "hunks": [ { "added": [ "\t\tif (length < DssConstants.MAX_DSS_LENGTH)" ], "header": "@@ -1321,7 +1321,7 @@ class DDMReader", "removed": [ "\t\tif (length < dssLength)" ] } ] } ]
derby-DERBY-170-fc30c5f2
DERBY-170 Inserting large string value into non-existent table causes communication link failure over Network Server. Attached is a proposed patch for DERBY-170, which teaches the skipDSS method how to handle segmented DDM objects. changes.html attached to DERBY-170 provides a bit of background and discussion for the reviewer. I have successfully run derbyall with this patch. The patch includes a new test, and new master output files. Contributed by Bran Pendleton git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@369549 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/drda/org/apache/derby/impl/drda/DDMReader.java", "hunks": [ { "added": [ "\t\twhile (dssIsContinued)", "\t\t{", "\t\t\tskipBytes((int)dssLength);", "\t\t\treadDSSContinuationHeader();", "\t\t}" ], "header": "@@ -1372,6 +1372,11 @@ class DDMReader", "removed": [] }, { "added": [ "\t\tensureALayerDataInBuffer (desiredDataSize);" ], "header": "@@ -1482,6 +1487,7 @@ class DDMReader", "removed": [] }, { "added": [], "header": "@@ -1491,10 +1497,6 @@ class DDMReader", "removed": [ "\t\telse ", "\t\t{", "\t\t\tensureALayerDataInBuffer (desiredDataSize);", "\t\t}" ] } ] } ]
derby-DERBY-1700-9e6e461e
DERBY-1700 Next step that changes the methods in ResultSetFactory not to have a closeCleanup method parameter which due to the previous patches was always being passed in as null. Changed all callers to not pass the null and thus remove the closeMethodArgument in ResultSetNode. Since most of the calls are to ResultSetFactory methods are by generated code cannot rely on compile time checks to ensure all callers are correct. Needed to reduced the argument count by one for the generated method call for any getXXXResultSet that no longer passes the closeCleanup (null) argument. Have confidence in the change as derbyall passes and the code coverage numbers at http://wiki.apache.org/db-derby/CodeCoverage show complete coverage of these factory methods except for ones related to VTIs. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@448286 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/sql/execute/ResultSetFactory.java", "hunks": [ { "added": [], "header": "@@ -293,7 +293,6 @@ public interface ResultSetFactory {", "removed": [ "\t\t@param closeCleanup\tany cleanup the activation needs to do on close." ] }, { "added": [ "\t\tdouble optimizerEstimatedCost) throws StandardException;" ], "header": "@@ -306,8 +305,7 @@ public interface ResultSetFactory {", "removed": [ "\t\tdouble optimizerEstimatedCost,", "\t\tGeneratedMethod closeCleanup) throws StandardException;" ] }, { "added": [], "header": "@@ -340,7 +338,6 @@ public interface ResultSetFactory {", "removed": [ "\t\t@param closeCleanup\tany cleanup the activation needs to do on close." ] }, { "added": [ "\t\tdouble optimizerEstimatedCost)" ], "header": "@@ -357,8 +354,7 @@ public interface ResultSetFactory {", "removed": [ "\t\tdouble optimizerEstimatedCost,", "\t\tGeneratedMethod closeCleanup)" ] }, { "added": [], "header": "@@ -385,7 +381,6 @@ public interface ResultSetFactory {", "removed": [ "\t\t@param closeCleanup\tany cleanup the activation needs to do on close." ] }, { "added": [ "\t\tdouble optimizerEstimatedCost) " ], "header": "@@ -398,8 +393,7 @@ public interface ResultSetFactory {", "removed": [ "\t\tdouble optimizerEstimatedCost,", "\t\tGeneratedMethod closeCleanup) " ] }, { "added": [], "header": "@@ -419,7 +413,6 @@ public interface ResultSetFactory {", "removed": [ "\t\t@param closeCleanup\tany cleanup the activation needs to do on close." ] }, { "added": [ "\t\tdouble optimizerEstimatedCost) " ], "header": "@@ -433,8 +426,7 @@ public interface ResultSetFactory {", "removed": [ "\t\tdouble optimizerEstimatedCost,", "\t\tGeneratedMethod closeCleanup) " ] }, { "added": [], "header": "@@ -457,7 +449,6 @@ public interface ResultSetFactory {", "removed": [ "\t\t@param closeCleanup\tany cleanup the activation needs to do on close." ] }, { "added": [ "\t\tdouble optimizerEstimatedCost) " ], "header": "@@ -471,8 +462,7 @@ public interface ResultSetFactory {", "removed": [ "\t\tdouble optimizerEstimatedCost,", "\t\tGeneratedMethod closeCleanup) " ] }, { "added": [], "header": "@@ -491,7 +481,6 @@ public interface ResultSetFactory {", "removed": [ "\t\t@param closeCleanup\tany cleanup the activation needs to do on close." ] }, { "added": [ "\t\tdouble optimizerEstimatedCost) " ], "header": "@@ -504,8 +493,7 @@ public interface ResultSetFactory {", "removed": [ "\t\tdouble optimizerEstimatedCost,", "\t\tGeneratedMethod closeCleanup) " ] }, { "added": [], "header": "@@ -527,7 +515,6 @@ public interface ResultSetFactory {", "removed": [ "\t\t@param closeCleanup\tany cleanup the activation needs to do on close." ] }, { "added": [ "\t\tdouble optimizerEstimatedCost) " ], "header": "@@ -540,8 +527,7 @@ public interface ResultSetFactory {", "removed": [ "\t\tdouble optimizerEstimatedCost,", "\t\tGeneratedMethod closeCleanup) " ] }, { "added": [], "header": "@@ -623,7 +609,6 @@ public interface ResultSetFactory {", "removed": [ "\t\t@param closeCleanup\tany cleanup the activation needs to do on close." ] }, { "added": [ "\t\t\t\t\t\t\t double optimizerEstimatedCost)" ], "header": "@@ -632,8 +617,7 @@ public interface ResultSetFactory {", "removed": [ "\t\t\t\t\t\t\t double optimizerEstimatedCost,", "\t\t\t\t\t\t\t GeneratedMethod closeCleanup)" ] }, { "added": [], "header": "@@ -657,7 +641,6 @@ public interface ResultSetFactory {", "removed": [ "\t\t@param closeCleanup\tany cleanup the activation needs to do on close." ] }, { "added": [ "\t\t\t\t\t\t\t\t\t double optimizerEstimatedCost)" ], "header": "@@ -673,8 +656,7 @@ public interface ResultSetFactory {", "removed": [ "\t\t\t\t\t\t\t\t\t double optimizerEstimatedCost,", "\t\t\t\t\t\t\t\t GeneratedMethod closeCleanup)" ] }, { "added": [], "header": "@@ -734,7 +716,6 @@ public interface ResultSetFactory {", "removed": [ "\t\t@param closeCleanup\tany cleanup the activation needs to do on close." ] }, { "added": [ "\t\t\t\t\t\t\t\tdouble optimizerEstimatedCost)" ], "header": "@@ -767,8 +748,7 @@ public interface ResultSetFactory {", "removed": [ "\t\t\t\t\t\t\t\tdouble optimizerEstimatedCost,", "\t\t\t\t\t\t\t\tGeneratedMethod closeCleanup)" ] }, { "added": [], "header": "@@ -802,7 +782,6 @@ public interface ResultSetFactory {", "removed": [ "\t\t@param closeCleanup\tany cleanup the activation needs to do on close." ] }, { "added": [ "\t\t\t\t\t\t\t\tdouble optimizerEstimatedCost)" ], "header": "@@ -823,8 +802,7 @@ public interface ResultSetFactory {", "removed": [ "\t\t\t\t\t\t\t\tdouble optimizerEstimatedCost,", "\t\t\t\t\t\t\t\tGeneratedMethod closeCleanup)" ] }, { "added": [], "header": "@@ -885,7 +863,6 @@ public interface ResultSetFactory {", "removed": [ "\t\t@param closeCleanup\tany cleanup the activation needs to do on close." ] }, { "added": [ "\t\t\t\t\t\t\t\tdouble optimizerEstimatedCost)" ], "header": "@@ -915,8 +892,7 @@ public interface ResultSetFactory {", "removed": [ "\t\t\t\t\t\t\t\tdouble optimizerEstimatedCost,", "\t\t\t\t\t\t\t\tGeneratedMethod closeCleanup)" ] }, { "added": [], "header": "@@ -978,7 +954,6 @@ public interface ResultSetFactory {", "removed": [ "\t\t@param closeCleanup\tany cleanup the activation needs to do on close." ] }, { "added": [ "\t\t\t\t\t\t\t\tdouble optimizerEstimatedCost)" ], "header": "@@ -1009,8 +984,7 @@ public interface ResultSetFactory {", "removed": [ "\t\t\t\t\t\t\t\tdouble optimizerEstimatedCost,", "\t\t\t\t\t\t\t\tGeneratedMethod closeCleanup)" ] }, { "added": [], "header": "@@ -1042,7 +1016,6 @@ public interface ResultSetFactory {", "removed": [ "\t\t@param closeCleanup\tany cleanup the activation needs to do on close." ] }, { "added": [ "\t\t\t\t\t\t\t\tdouble optimizerEstimatedCost)" ], "header": "@@ -1061,8 +1034,7 @@ public interface ResultSetFactory {", "removed": [ "\t\t\t\t\t\t\t\tdouble optimizerEstimatedCost,", "\t\t\t\t\t\t\t\tGeneratedMethod closeCleanup)" ] }, { "added": [], "header": "@@ -1095,7 +1067,6 @@ public interface ResultSetFactory {", "removed": [ "\t\t@param closeCleanup\tany cleanup the activation needs to do on close." ] }, { "added": [ "\t\t\t\t\t\t\t\t String userSuppliedOptimizerOverrides)" ], "header": "@@ -1110,8 +1081,7 @@ public interface ResultSetFactory {", "removed": [ "\t\t\t\t\t\t\t\t String userSuppliedOptimizerOverrides,", "\t\t\t\t\t\t\t\t GeneratedMethod closeCleanup)" ] }, { "added": [], "header": "@@ -1137,7 +1107,6 @@ public interface ResultSetFactory {", "removed": [ "\t\t@param closeCleanup\tany cleanup the activation needs to do on close." ] }, { "added": [ "\t\t\t\t\t\t\t\t String userSuppliedOptimizerOverrides)" ], "header": "@@ -1152,8 +1121,7 @@ public interface ResultSetFactory {", "removed": [ "\t\t\t\t\t\t\t\t String userSuppliedOptimizerOverrides,", "\t\t\t\t\t\t\t\t GeneratedMethod closeCleanup)" ] }, { "added": [], "header": "@@ -1189,7 +1157,6 @@ public interface ResultSetFactory {", "removed": [ "\t\t@param closeCleanup\tany cleanup the activation needs to do on close." ] }, { "added": [ "\t\t\t\t\t\t\t\t String userSuppliedOptimizerOverrides)" ], "header": "@@ -1207,8 +1174,7 @@ public interface ResultSetFactory {", "removed": [ "\t\t\t\t\t\t\t\t String userSuppliedOptimizerOverrides,", "\t\t\t\t\t\t\t\t GeneratedMethod closeCleanup)" ] }, { "added": [], "header": "@@ -1237,7 +1203,6 @@ public interface ResultSetFactory {", "removed": [ "\t\t@param closeCleanup\tany cleanup the activation needs to do on close." ] }, { "added": [ "\t\t\t\t\t\t\t\t String userSuppliedOptimizerOverrides)" ], "header": "@@ -1254,8 +1219,7 @@ public interface ResultSetFactory {", "removed": [ "\t\t\t\t\t\t\t\t String userSuppliedOptimizerOverrides,", "\t\t\t\t\t\t\t\t GeneratedMethod closeCleanup)" ] }, { "added": [], "header": "@@ -1268,7 +1232,6 @@ public interface ResultSetFactory {", "removed": [ "\t\t@param closeCleanup\tany cleanup the activation needs to do on close." ] }, { "added": [ "\t\t\t\t\t\t\t\t\t\t\tdouble optimizerEstimatedCost) " ], "header": "@@ -1276,8 +1239,7 @@ public interface ResultSetFactory {", "removed": [ "\t\t\t\t\t\t\t\t\t\t\tdouble optimizerEstimatedCost,", "\t\t\t\t\t\t\t\t\t\t GeneratedMethod closeCleanup) " ] }, { "added": [], "header": "@@ -1293,7 +1255,6 @@ public interface ResultSetFactory {", "removed": [ "\t\t@param closeCleanup\tany cleanup the activation needs to do on close." ] }, { "added": [ "\t\t\t\t\t\t\t\t\t\t\tdouble optimizerEstimatedCost) " ], "header": "@@ -1303,8 +1264,7 @@ public interface ResultSetFactory {", "removed": [ "\t\t\t\t\t\t\t\t\t\t\tdouble optimizerEstimatedCost,", "\t\t\t\t\t\t\t\t\t\t GeneratedMethod closeCleanup) " ] }, { "added": [], "header": "@@ -1317,7 +1277,6 @@ public interface ResultSetFactory {", "removed": [ "\t\t@param closeCleanup\tany cleanup the activation needs to do on close." ] }, { "added": [ "\t\t\t\t\t\t\t\t\t\t boolean forUpdate) " ], "header": "@@ -1326,8 +1285,7 @@ public interface ResultSetFactory {", "removed": [ "\t\t\t\t\t\t\t\t\t\t boolean forUpdate,", "\t\t\t\t\t\t\t\t\t\t GeneratedMethod closeCleanup) " ] }, { "added": [], "header": "@@ -1356,7 +1314,6 @@ public interface ResultSetFactory {", "removed": [ "\t *\t@param closeCleanup\tany cleanup the activation needs to do on close." ] }, { "added": [ "\t\t\t\t\tdouble optimizerEstimatedCost)" ], "header": "@@ -1370,8 +1327,7 @@ public interface ResultSetFactory {", "removed": [ "\t\t\t\t\tdouble optimizerEstimatedCost,", "\t\t\t\t\tGeneratedMethod closeCleanup)" ] }, { "added": [], "header": "@@ -1388,7 +1344,6 @@ public interface ResultSetFactory {", "removed": [ " * @param closeCleanup a method to be called by close" ] }, { "added": [], "header": "@@ -1408,7 +1363,6 @@ public interface ResultSetFactory {", "removed": [ " GeneratedMethod closeCleanup," ] }, { "added": [], "header": "@@ -1446,7 +1400,6 @@ public interface ResultSetFactory {", "removed": [ "\t * @param closeCleanup\t\tany cleanup the activation needs to do on close." ] }, { "added": [ "\t\tdouble \t\t\t\toptimizerEstimatedCost" ], "header": "@@ -1467,8 +1420,7 @@ public interface ResultSetFactory {", "removed": [ "\t\tdouble \t\t\t\toptimizerEstimatedCost,", "\t\tGeneratedMethod \tcloseCleanup" ] }, { "added": [], "header": "@@ -1526,7 +1478,6 @@ public interface ResultSetFactory {", "removed": [ "\t\t@param closeCleanup\tany cleanup the activation needs to do on close." ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java", "hunks": [ { "added": [ "\t\t\t\t\tClassName.NoPutResultSet, 13);" ], "header": "@@ -3168,10 +3168,9 @@ public class FromBaseTable extends FromTable", "removed": [ "\t\tcloseMethodArgument(acb, mb);", "\t\t\t\t\tClassName.NoPutResultSet, 14);" ] }, { "added": [ "\t\t\t\t\t\t\tClassName.NoPutResultSet, 16);" ], "header": "@@ -3264,11 +3263,9 @@ public class FromBaseTable extends FromTable", "removed": [ "\t\tcloseMethodArgument(acb, mb);", "", "\t\t\t\t\t\t\tClassName.NoPutResultSet, 17);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/FromVTI.java", "hunks": [ { "added": [ "\t\tmb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, \"getVTIResultSet\",ClassName.NoPutResultSet, nargs);" ], "header": "@@ -1172,7 +1172,7 @@ public class FromVTI extends FromTable implements VTIEnvironment", "removed": [ "\t\tmb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, \"getVTIResultSet\", ClassName.NoPutResultSet, nargs);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/GroupByNode.java", "hunks": [ { "added": [], "header": "@@ -905,7 +905,6 @@ public class GroupByNode extends SingleChildResultSetNode", "removed": [ "\t\t * arg12: closeCleanup" ] }, { "added": [ "\t\tmb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, resultSet,", " ClassName.NoPutResultSet, 10);" ], "header": "@@ -913,9 +912,8 @@ public class GroupByNode extends SingleChildResultSetNode", "removed": [ "\t\tcloseMethodArgument(acb, mb);", "", "\t\tmb.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, resultSet, ClassName.NoPutResultSet, 11);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/JoinNode.java", "hunks": [ { "added": [], "header": "@@ -1652,8 +1652,6 @@ public class JoinNode extends TableOperatorNode", "removed": [ "\t\t", "\t\tcloseMethodArgument(acb, mb);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java", "hunks": [ { "added": [], "header": "@@ -1040,20 +1040,6 @@ public abstract class ResultSetNode extends QueryTreeNode", "removed": [ "\t/**", "\t\tThis utility method is used by result set nodes that can be", "\t\tstatement nodes to determine what their final argument is;", "\t\tif they are the statement result set, and there is a current", "\t\tdate/time request, then a method will have been generated.", "\t\tOtherwise, a simple null is passed in to the result set method.", "\t */", "\tvoid closeMethodArgument(ExpressionClassBuilder acb,", "\t\t\t\t\t\t\t\t\tMethodBuilder mb)", "\t{", "", "\t\t\tmb.pushNull(ClassName.GeneratedMethod);", "\t}", "" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/GenericResultSetFactory.java", "hunks": [ { "added": [ "\t\tdouble optimizerEstimatedCost)" ], "header": "@@ -233,8 +233,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\tdouble optimizerEstimatedCost,", "\t\tGeneratedMethod closeCleanup)" ] }, { "added": [ "\t\tdouble optimizerEstimatedCost)" ], "header": "@@ -262,8 +261,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\tdouble optimizerEstimatedCost,", "\t\tGeneratedMethod closeCleanup)" ] }, { "added": [ "\t\tdouble optimizerEstimatedCost)" ], "header": "@@ -293,8 +291,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\tdouble optimizerEstimatedCost,", "\t\tGeneratedMethod closeCleanup)" ] }, { "added": [ "\t\tdouble optimizerEstimatedCost) " ], "header": "@@ -322,8 +319,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\tdouble optimizerEstimatedCost,", "\t\tGeneratedMethod closeCleanup) " ] }, { "added": [ "\t\tdouble optimizerEstimatedCost) " ], "header": "@@ -346,8 +342,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\tdouble optimizerEstimatedCost,", "\t\tGeneratedMethod closeCleanup) " ] }, { "added": [ "\t\tdouble optimizerEstimatedCost) " ], "header": "@@ -369,8 +364,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\tdouble optimizerEstimatedCost,", "\t\tGeneratedMethod closeCleanup) " ] }, { "added": [ "\t\tdouble optimizerEstimatedCost) " ], "header": "@@ -391,8 +385,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\tdouble optimizerEstimatedCost,", "\t\tGeneratedMethod closeCleanup) " ] }, { "added": [ "\t\t\t\t\t\t\t\t\t double optimizerEstimatedCost)" ], "header": "@@ -447,8 +440,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\t\t double optimizerEstimatedCost,", "\t\t\t\t\t\t\t\t GeneratedMethod closeCleanup)" ] }, { "added": [ "\t\t\t\t\t\t\t\t\t double optimizerEstimatedCost)" ], "header": "@@ -471,8 +463,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\t\t double optimizerEstimatedCost,", "\t\t\t\t\t\t\t\t GeneratedMethod closeCleanup)" ] }, { "added": [ "\t\t\t\t\t\t\t\t\tdouble optimizerEstimatedCost)" ], "header": "@@ -521,8 +512,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\t\tdouble optimizerEstimatedCost,", "\t\t\t\t\t\t\t\t\tGeneratedMethod closeCleanup)" ] }, { "added": [ "\t\t\t\t\t\t\t\t\tdouble optimizerEstimatedCost)" ], "header": "@@ -580,8 +570,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\t\tdouble optimizerEstimatedCost,", "\t\t\t\t\t\t\t\t\tGeneratedMethod closeCleanup)" ] }, { "added": [ "\t\t\t\t\t\t\t\t\tdouble optimizerEstimatedCost)" ], "header": "@@ -634,8 +623,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\t\tdouble optimizerEstimatedCost,", "\t\t\t\t\t\t\t\t\tGeneratedMethod closeCleanup)" ] }, { "added": [ "\t\t\t\t\t\t\t\t\tdouble optimizerEstimatedCost)" ], "header": "@@ -698,8 +686,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\t\tdouble optimizerEstimatedCost,", "\t\t\t\t\t\t\t\t\tGeneratedMethod closeCleanup)" ] }, { "added": [ "\t\t\t\t\t\t\t\tdouble optimizerEstimatedCost)" ], "header": "@@ -756,8 +743,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\tdouble optimizerEstimatedCost,", "\t\t\t\t\t\t\t\tGeneratedMethod closeCleanup)" ] }, { "added": [ "\t\t\t\t\t\t\t\t String userSuppliedOptimizerOverrides)" ], "header": "@@ -792,8 +778,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\t String userSuppliedOptimizerOverrides,", "\t\t\t\t\t\t\t\t GeneratedMethod closeCleanup)" ] }, { "added": [ "\t\t\t\t\t\t\t\t String userSuppliedOptimizerOverrides)" ], "header": "@@ -822,8 +807,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\t String userSuppliedOptimizerOverrides,", "\t\t\t\t\t\t\t\t GeneratedMethod closeCleanup)" ] }, { "added": [ "\t\t\t\t\t\t\t\t String userSuppliedOptimizerOverrides)" ], "header": "@@ -854,8 +838,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\t String userSuppliedOptimizerOverrides,", "\t\t\t\t\t\t\t\t GeneratedMethod closeCleanup)" ] }, { "added": [ "\t\t\t\t\t\t\t\t String userSuppliedOptimizerOverrides)" ], "header": "@@ -888,8 +871,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\t String userSuppliedOptimizerOverrides,", "\t\t\t\t\t\t\t\t GeneratedMethod closeCleanup)" ] }, { "added": [ "\t\t\t\t\t\t\tdouble optimizerEstimatedCost)" ], "header": "@@ -924,8 +906,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\tdouble optimizerEstimatedCost,", "\t\t\t\t\t\t\t\t GeneratedMethod closeCleanup)" ] }, { "added": [ "\t\t\t\t\t\t\tdouble optimizerEstimatedCost)" ], "header": "@@ -943,8 +924,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\tdouble optimizerEstimatedCost,", "\t\t\t\t\t\t\t\t GeneratedMethod closeCleanup)" ] }, { "added": [ "\t\t\t\t\t\t\tboolean forUpdate)" ], "header": "@@ -974,8 +954,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\tboolean forUpdate,\t\t\t\t\t", "\t\t\t\t\t\t\tGeneratedMethod closeCleanup)" ] }, { "added": [ "\t\t\t\t\t\t\t\t double optimizerEstimatedCost)" ], "header": "@@ -1024,8 +1003,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\t double optimizerEstimatedCost,", "\t\t\t\t\t\t\t\t GeneratedMethod closeCleanup)" ] }, { "added": [ " int intermediateOrderByColumnsSavedObject," ], "header": "@@ -1043,8 +1021,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ " GeneratedMethod closeCleanup,", " int intermediateOrderByColumnsSavedObject," ] }, { "added": [], "header": "@@ -1086,7 +1063,6 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t * @param closeCleanup\t\tany cleanup the activation needs to do on close." ] }, { "added": [ "\t\tdouble \t\t\t\toptimizerEstimatedCost" ], "header": "@@ -1107,8 +1083,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\tdouble \t\t\t\toptimizerEstimatedCost,", "\t\tGeneratedMethod \tcloseCleanup" ] }, { "added": [], "header": "@@ -1159,7 +1134,6 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\t\tGeneratedMethod closeCleanup," ] } ] } ]
derby-DERBY-1700-a30fb433
DERBY-1700 (partial) Initial version of a TimeHandlingTest that includes tests for CURRENT TIME. Will expand to also test CURRENT DATE and CURRENT TIMESTAMP. Not yet added to the suites. Improve CleanDatabaseTestSetup to allow it to be the super-class for a decorator that performs initial schema setup with automatic dropping of everything. Improved CleanDatabaseTestSetup to drop functions. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@439861 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/junit/CleanDatabaseTestSetup.java", "hunks": [ { "added": [ "import org.apache.derbyTesting.functionTests.tests.lang.TimeHandlingTest;", "" ], "header": "@@ -24,6 +24,8 @@ import java.util.ArrayList;", "removed": [] }, { "added": [ " * <P>", " * Tests can extend to provide a decorator that defines", " * some schema items and then have CleanDatabaseTestSetup", " * automatically clean them up by implementing the decorateSQL method.. ", " * As an example:", " * <code>", " return new CleanDatabaseTestSetup(suite) {", " protected void decorateSQL(Statement s) throws SQLException {", "", " s.execute(\"CREATE TABLE T (I INT)\");", " s.execute(\"CREATE INDEX TI ON T(I)\")", "", " }", " };", " * </code>" ], "header": "@@ -31,6 +33,21 @@ import junit.framework.Test;", "removed": [] } ] }, { "file": "java/testing/org/apache/derbyTesting/junit/JDBC.java", "hunks": [ { "added": [ "" ], "header": "@@ -153,7 +153,7 @@ public class JDBC {", "removed": [ "\t * TODO: Drop Functions" ] }, { "added": [ " ", " // Functions - not supported by JDBC meta data until JDBC 4", " PreparedStatement psf = conn.prepareStatement(", " \"SELECT ALIAS FROM SYS.SYSALIASES A, SYS.SYSSCHEMAS S\" +", " \" WHERE A.SCHEMAID = S.SCHEMAID \" +", " \" AND A.ALIASTYPE = 'F' \" +", " \" AND S.SCHEMANAME = ?\");", " psf.setString(1, schema);", " ResultSet rs = psf.executeQuery();", " dropUsingDMD(s, rs, schema, \"ALIAS\", \"FUNCTION\"); ", " psf.close();", " ", "\t\t// Procedures", "\t\trs = dmd.getProcedures((String) null," ], "header": "@@ -164,8 +164,20 @@ public class JDBC {", "removed": [ "\t\t// Procedures first", "\t\tResultSet rs = dmd.getProcedures((String) null," ] } ] } ]
derby-DERBY-1700-f77f36d1
DERBY-1700 Patch the removes closeCleanup from ResultSet implementations: - remove any field storing the reference to a close cleanup method - remove any calling of the method - remove passing the reference to the method in the constructor. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@441232 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/execute/BaseActivation.java", "hunks": [ { "added": [ "\t\t\t\t\t\t\t\t\t\t0);" ], "header": "@@ -1473,8 +1473,7 @@ public abstract class BaseActivation implements CursorActivation, GeneratedByteC", "removed": [ "\t\t\t\t\t\t\t\t\t\t0,", "\t\t\t\t\t\t\t\t\t\tnull);" ] }, { "added": [ "\t\t\t\t\t\t\t\t\t\t0);" ], "header": "@@ -1487,8 +1486,7 @@ public abstract class BaseActivation implements CursorActivation, GeneratedByteC", "removed": [ "\t\t\t\t\t\t\t\t\t\t0,", "\t\t\t\t\t\t\t\t\t\tnull);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/BulkTableScanResultSet.java", "hunks": [ { "added": [ "class BulkTableScanResultSet extends TableScanResultSet" ], "header": "@@ -67,7 +67,7 @@ import org.apache.derby.iapi.services.io.FormatableBitSet;", "removed": [ "public class BulkTableScanResultSet extends TableScanResultSet" ] }, { "added": [ " BulkTableScanResultSet(long conglomId," ], "header": "@@ -84,7 +84,7 @@ public class BulkTableScanResultSet extends TableScanResultSet", "removed": [ " public BulkTableScanResultSet(long conglomId," ] }, { "added": [ "\t\tdouble optimizerEstimatedCost)" ], "header": "@@ -105,8 +105,7 @@ public class BulkTableScanResultSet extends TableScanResultSet", "removed": [ "\t\tdouble optimizerEstimatedCost,", "\t\tGeneratedMethod closeCleanup)" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/DependentResultSet.java", "hunks": [ { "added": [ "class DependentResultSet extends NoPutResultSetImpl implements CursorResultSet" ], "header": "@@ -58,7 +58,7 @@ import org.apache.derby.iapi.services.i18n.MessageService;", "removed": [ "public class DependentResultSet extends NoPutResultSetImpl implements CursorResultSet" ] }, { "added": [], "header": "@@ -103,7 +103,6 @@ public class DependentResultSet extends NoPutResultSetImpl implements CursorResu", "removed": [ "\tprotected GeneratedMethod closeCleanup;" ] }, { "added": [], "header": "@@ -112,7 +111,6 @@ public class DependentResultSet extends NoPutResultSetImpl implements CursorResu", "removed": [ "\tprivate boolean nextDone;" ] }, { "added": [ "\tDependentResultSet(" ], "header": "@@ -125,12 +123,11 @@ public class DependentResultSet extends NoPutResultSetImpl implements CursorResu", "removed": [ "\tprivate long estimatedRowCount;", "\tpublic DependentResultSet(" ] }, { "added": [], "header": "@@ -153,7 +150,6 @@ public class DependentResultSet extends NoPutResultSetImpl implements CursorResu", "removed": [ "\t\tGeneratedMethod closeCleanup," ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/DistinctGroupedAggregateResultSet.java", "hunks": [ { "added": [ "class DistinctGroupedAggregateResultSet extends GroupedAggregateResultSet" ], "header": "@@ -66,7 +66,7 @@ import java.util.Enumeration;", "removed": [ "public class DistinctGroupedAggregateResultSet extends GroupedAggregateResultSet" ] }, { "added": [ " DistinctGroupedAggregateResultSet(NoPutResultSet s," ], "header": "@@ -88,7 +88,7 @@ public class DistinctGroupedAggregateResultSet extends GroupedAggregateResultSet", "removed": [ " public DistinctGroupedAggregateResultSet(NoPutResultSet s," ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/DistinctScalarAggregateResultSet.java", "hunks": [ { "added": [ "class DistinctScalarAggregateResultSet extends ScalarAggregateResultSet" ], "header": "@@ -54,7 +54,7 @@ import java.util.Properties;", "removed": [ "public class DistinctScalarAggregateResultSet extends ScalarAggregateResultSet" ] }, { "added": [ " DistinctScalarAggregateResultSet(NoPutResultSet s," ], "header": "@@ -84,7 +84,7 @@ public class DistinctScalarAggregateResultSet extends ScalarAggregateResultSet", "removed": [ " public DistinctScalarAggregateResultSet(NoPutResultSet s," ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/DistinctScanResultSet.java", "hunks": [ { "added": [ "class DistinctScanResultSet extends HashScanResultSet" ], "header": "@@ -68,7 +68,7 @@ import java.util.Vector;", "removed": [ "public class DistinctScanResultSet extends HashScanResultSet" ] }, { "added": [ " DistinctScanResultSet(long conglomId, " ], "header": "@@ -77,7 +77,7 @@ public class DistinctScanResultSet extends HashScanResultSet", "removed": [ " public DistinctScanResultSet(long conglomId, " ] }, { "added": [ "\t\tdouble optimizerEstimatedCost)" ], "header": "@@ -91,8 +91,7 @@ public class DistinctScanResultSet extends HashScanResultSet", "removed": [ "\t\tdouble optimizerEstimatedCost,", "\t\tGeneratedMethod closeCleanup)" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/GenericAggregateResultSet.java", "hunks": [ { "added": [], "header": "@@ -75,7 +75,6 @@ abstract class GenericAggregateResultSet extends NoPutResultSetImpl", "removed": [ " protected GeneratedMethod closeCleanup;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/GenericResultSetFactory.java", "hunks": [ { "added": [ "\t\t\toptimizerEstimatedCost);" ], "header": "@@ -243,8 +243,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\toptimizerEstimatedCost,", "\t\t\tcloseCleanup);" ] }, { "added": [ "\t\t\toptimizerEstimatedCost);" ], "header": "@@ -279,8 +278,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\toptimizerEstimatedCost,", "\t\t\tcloseCleanup);" ] }, { "added": [ "\t\t\toptimizerEstimatedCost);" ], "header": "@@ -308,8 +306,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\toptimizerEstimatedCost,", "\t\t\tcloseCleanup);" ] }, { "added": [ "\t\t\t\t\t\toptimizerEstimatedCost);" ], "header": "@@ -333,7 +330,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\toptimizerEstimatedCost, closeCleanup);" ] }, { "added": [ "\t\t\t\t\t\toptimizerEstimatedCost);" ], "header": "@@ -357,7 +354,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\toptimizerEstimatedCost, closeCleanup);" ] }, { "added": [ "\t\t\t\t\t\toptimizerEstimatedCost);" ], "header": "@@ -379,7 +376,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\toptimizerEstimatedCost, closeCleanup);" ] }, { "added": [ "\t\t\t\t\t\toptimizerEstimatedCost);" ], "header": "@@ -401,7 +398,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\toptimizerEstimatedCost, closeCleanup);" ] }, { "added": [ "\t\t\t\t\t\t\t\toptimizerEstimatedCost);" ], "header": "@@ -455,8 +452,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\toptimizerEstimatedCost,", "\t\t\t\t\t\t\t\tcloseCleanup);" ] }, { "added": [ "\t\t\t\t\t\t\t\toptimizerEstimatedCost);" ], "header": "@@ -489,8 +485,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\toptimizerEstimatedCost,", "\t\t\t\t\t\t\t\tcloseCleanup);" ] }, { "added": [ "\t\t\t\t\t\t\t\toptimizerEstimatedCost);" ], "header": "@@ -561,8 +556,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\toptimizerEstimatedCost,", "\t\t\t\t\t\t\t\tcloseCleanup);" ] }, { "added": [ "\t\t\t\t\t\t\t\toptimizerEstimatedCost);" ], "header": "@@ -608,8 +602,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\toptimizerEstimatedCost,", "\t\t\t\t\t\t\t\tcloseCleanup);" ] }, { "added": [ "\t\t\t\t\t\t\t\toptimizerEstimatedCost);" ], "header": "@@ -672,8 +665,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\toptimizerEstimatedCost,", "\t\t\t\t\t\t\t\tcloseCleanup);" ] }, { "added": [ "\t\t\t\t\t\t\t\toptimizerEstimatedCost);" ], "header": "@@ -744,8 +736,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\toptimizerEstimatedCost,", "\t\t\t\t\t\t\t\tcloseCleanup);" ] }, { "added": [ "\t\t\t\t\t\t\t\toptimizerEstimatedCost);" ], "header": "@@ -783,8 +774,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\toptimizerEstimatedCost,", "\t\t\t\t\t\t\t\tcloseCleanup);" ] }, { "added": [ "\t\t\t\t\t\t\t\t\t\t userSuppliedOptimizerOverrides);" ], "header": "@@ -814,8 +804,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\t\t\t userSuppliedOptimizerOverrides,", "\t\t\t\t\t\t\t\t\t\t closeCleanup);" ] }, { "added": [ "\t\t\t\t\t\t\t\t\t\t userSuppliedOptimizerOverrides);" ], "header": "@@ -845,8 +834,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\t\t\t userSuppliedOptimizerOverrides,", "\t\t\t\t\t\t\t\t\t\t closeCleanup);" ] }, { "added": [ "\t\t\t\t\t\t\t\t\t\t userSuppliedOptimizerOverrides);" ], "header": "@@ -880,8 +868,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\t\t\t userSuppliedOptimizerOverrides,", "\t\t\t\t\t\t\t\t\t\t closeCleanup);" ] }, { "added": [ "\t\t\t\t\t\t\t\t\t\t userSuppliedOptimizerOverrides);" ], "header": "@@ -915,8 +902,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\t\t\t userSuppliedOptimizerOverrides,", "\t\t\t\t\t\t\t\t\t\t closeCleanup);" ] }, { "added": [ "\t\t\t\t\t\t\t\t\t optimizerEstimatedCost);" ], "header": "@@ -945,8 +931,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\t\t optimizerEstimatedCost,", "\t\t\t\t\t\t\t\t\t closeCleanup);" ] }, { "added": [ "\t\t\t\t\t\t\t\t\t optimizerEstimatedCost);" ], "header": "@@ -972,8 +957,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\t\t optimizerEstimatedCost,", "\t\t\t\t\t\t\t\t\t closeCleanup);" ] }, { "added": [ "\t\t\t\t\t\t\t\t\t optimizerEstimatedCost, forUpdate);" ], "header": "@@ -997,8 +981,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\t\t optimizerEstimatedCost, forUpdate,", "\t\t\t\t\t\t\t\t\t closeCleanup);" ] }, { "added": [ "\t\t\t\t\t\t\t\t optimizerEstimatedCost);" ], "header": "@@ -1049,8 +1032,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\t\t\t\t optimizerEstimatedCost,", "\t\t\t\t\t\t\t\t closeCleanup);" ] }, { "added": [], "header": "@@ -1074,7 +1056,6 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ " closeCleanup," ] }, { "added": [ "\t\t\t\t\toptimizerEstimatedCost);" ], "header": "@@ -1143,8 +1124,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [ "\t\t\t\t\toptimizerEstimatedCost,", "\t\t\t\t\tcloseCleanup);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/GroupedAggregateResultSet.java", "hunks": [ { "added": [ "class GroupedAggregateResultSet extends GenericAggregateResultSet" ], "header": "@@ -68,7 +68,7 @@ import java.util.Enumeration;", "removed": [ "public class GroupedAggregateResultSet extends GenericAggregateResultSet" ] }, { "added": [ " GroupedAggregateResultSet(NoPutResultSet s," ], "header": "@@ -124,7 +124,7 @@ public class GroupedAggregateResultSet extends GenericAggregateResultSet", "removed": [ " public GroupedAggregateResultSet(NoPutResultSet s," ] }, { "added": [ "\t\t\t\t double optimizerEstimatedCost) throws StandardException ", "\t\tsuper(s, aggregateItem, a, ra, resultSetNumber, optimizerEstimatedRowCount, optimizerEstimatedCost);" ], "header": "@@ -133,10 +133,9 @@ public class GroupedAggregateResultSet extends GenericAggregateResultSet", "removed": [ "\t\t\t\t double optimizerEstimatedCost,", "\t\t\t\t\tGeneratedMethod c) throws StandardException ", "\t\tsuper(s, aggregateItem, a, ra, resultSetNumber, optimizerEstimatedRowCount, optimizerEstimatedCost, c);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/HashJoinResultSet.java", "hunks": [ { "added": [ "class HashJoinResultSet extends NestedLoopJoinResultSet", " HashJoinResultSet(NoPutResultSet leftResultSet," ], "header": "@@ -44,9 +44,9 @@ import org.apache.derby.iapi.services.loader.GeneratedMethod;", "removed": [ "public class HashJoinResultSet extends NestedLoopJoinResultSet", " public HashJoinResultSet(NoPutResultSet leftResultSet," ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/HashLeftOuterJoinResultSet.java", "hunks": [ { "added": [ "class HashLeftOuterJoinResultSet extends NestedLoopLeftOuterJoinResultSet", " HashLeftOuterJoinResultSet(" ], "header": "@@ -44,9 +44,9 @@ import org.apache.derby.iapi.services.loader.GeneratedMethod;", "removed": [ "public class HashLeftOuterJoinResultSet extends NestedLoopLeftOuterJoinResultSet", " public HashLeftOuterJoinResultSet(" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/HashScanResultSet.java", "hunks": [ { "added": [], "header": "@@ -109,7 +109,6 @@ public class HashScanResultSet extends NoPutResultSetImpl", "removed": [ "\tprivate GeneratedMethod closeCleanup;" ] }, { "added": [ " HashScanResultSet(long conglomId," ], "header": "@@ -140,7 +139,7 @@ public class HashScanResultSet extends NoPutResultSetImpl", "removed": [ " public HashScanResultSet(long conglomId," ] }, { "added": [ "\t\tdouble optimizerEstimatedCost)" ], "header": "@@ -164,8 +163,7 @@ public class HashScanResultSet extends NoPutResultSetImpl", "removed": [ "\t\tdouble optimizerEstimatedCost,", "\t\tGeneratedMethod closeCleanup)" ] }, { "added": [], "header": "@@ -287,8 +285,6 @@ public class HashScanResultSet extends NoPutResultSetImpl", "removed": [ " this.closeCleanup = closeCleanup;", "" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/HashTableResultSet.java", "hunks": [ { "added": [ "class HashTableResultSet extends NoPutResultSetImpl" ], "header": "@@ -67,7 +67,7 @@ import java.util.Vector;", "removed": [ "public class HashTableResultSet extends NoPutResultSetImpl" ] }, { "added": [], "header": "@@ -83,7 +83,6 @@ public class HashTableResultSet extends NoPutResultSetImpl", "removed": [ " private GeneratedMethod closeCleanup;" ] }, { "added": [ " HashTableResultSet(NoPutResultSet s," ], "header": "@@ -111,7 +110,7 @@ public class HashTableResultSet extends NoPutResultSetImpl", "removed": [ " public HashTableResultSet(NoPutResultSet s," ] }, { "added": [ "\t\t\t\t\tdouble optimizerEstimatedCost) " ], "header": "@@ -126,8 +125,7 @@ public class HashTableResultSet extends NoPutResultSetImpl", "removed": [ "\t\t\t\t\tdouble optimizerEstimatedCost,", "\t\t\t\t\tGeneratedMethod c) " ] }, { "added": [], "header": "@@ -157,7 +155,6 @@ public class HashTableResultSet extends NoPutResultSetImpl", "removed": [ " closeCleanup = c;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/IndexRowToBaseRowResultSet.java", "hunks": [ { "added": [ "class IndexRowToBaseRowResultSet extends NoPutResultSetImpl" ], "header": "@@ -64,7 +64,7 @@ import org.apache.derby.catalog.types.ReferencedColumnsDescriptorImpl;", "removed": [ "public class IndexRowToBaseRowResultSet extends NoPutResultSetImpl" ] }, { "added": [], "header": "@@ -74,7 +74,6 @@ public class IndexRowToBaseRowResultSet extends NoPutResultSetImpl", "removed": [ " private GeneratedMethod closeCleanup;" ] }, { "added": [ " IndexRowToBaseRowResultSet(" ], "header": "@@ -109,7 +108,7 @@ public class IndexRowToBaseRowResultSet extends NoPutResultSetImpl", "removed": [ " public IndexRowToBaseRowResultSet(" ] }, { "added": [ "\t\t\t\t\tdouble optimizerEstimatedCost) " ], "header": "@@ -123,8 +122,7 @@ public class IndexRowToBaseRowResultSet extends NoPutResultSetImpl", "removed": [ "\t\t\t\t\tdouble optimizerEstimatedCost,", "\t\t\t\t\tGeneratedMethod closeCleanup) " ] }, { "added": [], "header": "@@ -141,7 +139,6 @@ public class IndexRowToBaseRowResultSet extends NoPutResultSetImpl", "removed": [ " this.closeCleanup = closeCleanup;" ] }, { "added": [], "header": "@@ -480,7 +477,6 @@ public class IndexRowToBaseRowResultSet extends NoPutResultSetImpl", "removed": [ "\t\t\t\t\tcurrentRow = null;" ] }, { "added": [], "header": "@@ -492,7 +488,6 @@ public class IndexRowToBaseRowResultSet extends NoPutResultSetImpl", "removed": [ "\t\t\t\tcurrentRow = null;" ] }, { "added": [ "" ], "header": "@@ -521,10 +516,7 @@ public class IndexRowToBaseRowResultSet extends NoPutResultSetImpl", "removed": [ "\t\t\tif (closeCleanup != null) {", "\t\t\t\tcloseCleanup.invoke(activation); // let activation tidy up", "\t\t\t}", "\t\t\tcurrentRow = null;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/JoinResultSet.java", "hunks": [ { "added": [ "abstract class JoinResultSet extends NoPutResultSetImpl" ], "header": "@@ -42,7 +42,7 @@ import org.apache.derby.iapi.types.RowLocation;", "removed": [ "public abstract class JoinResultSet extends NoPutResultSetImpl" ] }, { "added": [], "header": "@@ -63,7 +63,6 @@ public abstract class JoinResultSet extends NoPutResultSetImpl", "removed": [ " protected GeneratedMethod closeCleanup;" ] }, { "added": [ " JoinResultSet(NoPutResultSet leftResultSet," ], "header": "@@ -73,7 +72,7 @@ public abstract class JoinResultSet extends NoPutResultSetImpl", "removed": [ " public JoinResultSet(NoPutResultSet leftResultSet," ] }, { "added": [ "\t\t\t\t\t\t\t\t String userSuppliedOptimizerOverrides)" ], "header": "@@ -84,8 +83,7 @@ public abstract class JoinResultSet extends NoPutResultSetImpl", "removed": [ "\t\t\t\t\t\t\t\t String userSuppliedOptimizerOverrides,", "\t\t\t\t\t\t\t\t GeneratedMethod closeCleanup)" ] }, { "added": [], "header": "@@ -96,7 +94,6 @@ public abstract class JoinResultSet extends NoPutResultSetImpl", "removed": [ " this.closeCleanup = closeCleanup;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/LastIndexKeyResultSet.java", "hunks": [ { "added": [ "class LastIndexKeyResultSet extends NoPutResultSetImpl" ], "header": "@@ -56,7 +56,7 @@ import java.util.Properties;", "removed": [ "public class LastIndexKeyResultSet extends NoPutResultSetImpl" ] }, { "added": [], "header": "@@ -69,7 +69,6 @@ public class LastIndexKeyResultSet extends NoPutResultSetImpl", "removed": [ "\tprotected GeneratedMethod closeCleanup;" ] }, { "added": [], "header": "@@ -110,7 +109,6 @@ public class LastIndexKeyResultSet extends NoPutResultSetImpl", "removed": [ "\t * @param closeCleanup\t\tany cleanup the activation needs to do on close." ] }, { "added": [ "\t\tdouble optimizerEstimatedCost" ], "header": "@@ -129,8 +127,7 @@ public class LastIndexKeyResultSet extends NoPutResultSetImpl", "removed": [ "\t\tdouble optimizerEstimatedCost,", "\t\tGeneratedMethod closeCleanup" ] }, { "added": [], "header": "@@ -218,8 +215,6 @@ public class LastIndexKeyResultSet extends NoPutResultSetImpl", "removed": [ "\t\tthis.closeCleanup = closeCleanup;", "" ] }, { "added": [], "header": "@@ -287,7 +282,6 @@ public class LastIndexKeyResultSet extends NoPutResultSetImpl", "removed": [ "\t\t\tcurrentRow = null;" ] }, { "added": [], "header": "@@ -304,7 +298,6 @@ public class LastIndexKeyResultSet extends NoPutResultSetImpl", "removed": [ "\t\t\tcurrentRow = null;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/MaterializedResultSet.java", "hunks": [ { "added": [ "class MaterializedResultSet extends NoPutResultSetImpl" ], "header": "@@ -56,7 +56,7 @@ import org.apache.derby.iapi.services.io.FormatableBitSet;", "removed": [ "public class MaterializedResultSet extends NoPutResultSetImpl" ] }, { "added": [], "header": "@@ -79,9 +79,6 @@ public class MaterializedResultSet extends NoPutResultSetImpl", "removed": [ "", " private GeneratedMethod closeCleanup;", "" ] }, { "added": [ "\t\t\t\t\t\t\t double optimizerEstimatedCost) throws StandardException" ], "header": "@@ -96,8 +93,7 @@ public class MaterializedResultSet extends NoPutResultSetImpl", "removed": [ "\t\t\t\t\t\t\t double optimizerEstimatedCost,", "\t\t\t\t\t\t\t GeneratedMethod c) throws StandardException" ] }, { "added": [], "header": "@@ -106,7 +102,6 @@ public class MaterializedResultSet extends NoPutResultSetImpl", "removed": [ " closeCleanup = c;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/MergeJoinResultSet.java", "hunks": [ { "added": [ "class MergeJoinResultSet extends JoinResultSet" ], "header": "@@ -49,7 +49,7 @@ import org.apache.derby.iapi.services.loader.GeneratedMethod;", "removed": [ "public class MergeJoinResultSet extends JoinResultSet" ] }, { "added": [ " MergeJoinResultSet(NoPutResultSet leftResultSet," ], "header": "@@ -77,7 +77,7 @@ public class MergeJoinResultSet extends JoinResultSet", "removed": [ " public MergeJoinResultSet(NoPutResultSet leftResultSet," ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/NestedLoopJoinResultSet.java", "hunks": [ { "added": [ "class NestedLoopJoinResultSet extends JoinResultSet" ], "header": "@@ -45,7 +45,7 @@ import org.apache.derby.iapi.services.loader.GeneratedMethod;", "removed": [ "public class NestedLoopJoinResultSet extends JoinResultSet" ] }, { "added": [ " NestedLoopJoinResultSet(NoPutResultSet leftResultSet," ], "header": "@@ -277,7 +277,7 @@ public class NestedLoopJoinResultSet extends JoinResultSet", "removed": [ " public NestedLoopJoinResultSet(NoPutResultSet leftResultSet," ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/NestedLoopLeftOuterJoinResultSet.java", "hunks": [ { "added": [ "class NestedLoopLeftOuterJoinResultSet extends NestedLoopJoinResultSet" ], "header": "@@ -48,7 +48,7 @@ import org.apache.derby.iapi.services.loader.GeneratedMethod;", "removed": [ "public class NestedLoopLeftOuterJoinResultSet extends NestedLoopJoinResultSet" ] }, { "added": [ " NestedLoopLeftOuterJoinResultSet(" ], "header": "@@ -270,7 +270,7 @@ public class NestedLoopLeftOuterJoinResultSet extends NestedLoopJoinResultSet", "removed": [ " public NestedLoopLeftOuterJoinResultSet(" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/NormalizeResultSet.java", "hunks": [ { "added": [ "class NormalizeResultSet extends NoPutResultSetImpl" ], "header": "@@ -54,7 +54,7 @@ import org.apache.derby.iapi.reference.SQLState;", "removed": [ "public class NormalizeResultSet extends NoPutResultSetImpl" ] }, { "added": [], "header": "@@ -72,8 +72,6 @@ public class NormalizeResultSet extends NoPutResultSetImpl", "removed": [ " private GeneratedMethod closeCleanup;", "" ] }, { "added": [ "\t\t\t\t\t\t\t boolean forUpdate) throws StandardException" ], "header": "@@ -94,8 +92,7 @@ public class NormalizeResultSet extends NoPutResultSetImpl", "removed": [ "\t\t\t\t\t\t\t boolean forUpdate,", "\t\t\t\t\t\t\t GeneratedMethod c) throws StandardException" ] }, { "added": [], "header": "@@ -133,7 +130,6 @@ public class NormalizeResultSet extends NoPutResultSetImpl", "removed": [ " closeCleanup = c;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/ProjectRestrictResultSet.java", "hunks": [ { "added": [ "class ProjectRestrictResultSet extends NoPutResultSetImpl" ], "header": "@@ -54,7 +54,7 @@ import org.apache.derby.catalog.types.ReferencedColumnsDescriptorImpl;", "removed": [ "public class ProjectRestrictResultSet extends NoPutResultSetImpl" ] }, { "added": [], "header": "@@ -69,7 +69,6 @@ public class ProjectRestrictResultSet extends NoPutResultSetImpl", "removed": [ " private GeneratedMethod closeCleanup;" ] }, { "added": [ " ProjectRestrictResultSet(NoPutResultSet s," ], "header": "@@ -81,7 +80,7 @@ public class ProjectRestrictResultSet extends NoPutResultSetImpl", "removed": [ " public ProjectRestrictResultSet(NoPutResultSet s," ] }, { "added": [ "\t\t\t\t\tdouble optimizerEstimatedCost) " ], "header": "@@ -91,8 +90,7 @@ public class ProjectRestrictResultSet extends NoPutResultSetImpl", "removed": [ "\t\t\t\t\tdouble optimizerEstimatedCost,", "\t\t\t\t\tGeneratedMethod c) " ] }, { "added": [], "header": "@@ -110,7 +108,6 @@ public class ProjectRestrictResultSet extends NoPutResultSetImpl", "removed": [ " closeCleanup = c;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/RowResultSet.java", "hunks": [ { "added": [], "header": "@@ -61,7 +61,6 @@ class RowResultSet extends NoPutResultSetImpl", "removed": [ "\tprotected GeneratedMethod closeCleanup;" ] }, { "added": [ "\t\tdouble \t\t\toptimizerEstimatedCost" ], "header": "@@ -74,15 +73,13 @@ class RowResultSet extends NoPutResultSetImpl", "removed": [ "\t\tdouble \t\t\toptimizerEstimatedCost,", "\t\tGeneratedMethod closeCleanup", "\t\tthis.closeCleanup = closeCleanup;" ] }, { "added": [ "\t\tdouble \t\t\toptimizerEstimatedCost" ], "header": "@@ -97,8 +94,7 @@ class RowResultSet extends NoPutResultSetImpl", "removed": [ "\t\tdouble \t\t\toptimizerEstimatedCost,", "\t\tGeneratedMethod closeCleanup" ] }, { "added": [], "header": "@@ -106,7 +102,6 @@ class RowResultSet extends NoPutResultSetImpl", "removed": [ "\t\tthis.closeCleanup = closeCleanup;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/ScalarAggregateResultSet.java", "hunks": [ { "added": [ "class ScalarAggregateResultSet extends GenericAggregateResultSet" ], "header": "@@ -63,7 +63,7 @@ import java.util.Enumeration;", "removed": [ "public class ScalarAggregateResultSet extends GenericAggregateResultSet" ] }, { "added": [ " ScalarAggregateResultSet(NoPutResultSet s," ], "header": "@@ -97,7 +97,7 @@ public class ScalarAggregateResultSet extends GenericAggregateResultSet", "removed": [ " public ScalarAggregateResultSet(NoPutResultSet s," ] }, { "added": [ "\t\t\t\t double optimizerEstimatedCost) throws StandardException ", "\t\tsuper(s, aggregateItem, a, ra, resultSetNumber, optimizerEstimatedRowCount, optimizerEstimatedCost);" ], "header": "@@ -105,10 +105,9 @@ public class ScalarAggregateResultSet extends GenericAggregateResultSet", "removed": [ "\t\t\t\t double optimizerEstimatedCost,", "\t\t\t\t\tGeneratedMethod c) throws StandardException ", "\t\tsuper(s, aggregateItem, a, ra, resultSetNumber, optimizerEstimatedRowCount, optimizerEstimatedCost, c);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/ScrollInsensitiveResultSet.java", "hunks": [ { "added": [], "header": "@@ -119,8 +119,6 @@ public class ScrollInsensitiveResultSet extends NoPutResultSetImpl", "removed": [ " private GeneratedMethod closeCleanup;", "" ] }, { "added": [ "\t\t\t\t\t\t\t double optimizerEstimatedCost) throws StandardException" ], "header": "@@ -172,8 +170,7 @@ public class ScrollInsensitiveResultSet extends NoPutResultSetImpl", "removed": [ "\t\t\t\t\t\t\t double optimizerEstimatedCost,", "\t\t\t\t\t\t\t GeneratedMethod c) throws StandardException" ] }, { "added": [], "header": "@@ -187,7 +184,6 @@ public class ScrollInsensitiveResultSet extends NoPutResultSetImpl", "removed": [ " closeCleanup = c;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/SetOpResultSet.java", "hunks": [ { "added": [ "class SetOpResultSet extends NoPutResultSetImpl" ], "header": "@@ -45,12 +45,11 @@ import org.apache.derby.impl.sql.compile.IntersectOrExceptNode;", "removed": [ "public class SetOpResultSet extends NoPutResultSetImpl", " private final GeneratedMethod closeCleanup;" ] }, { "added": [], "header": "@@ -78,7 +77,6 @@ public class SetOpResultSet extends NoPutResultSetImpl", "removed": [ " GeneratedMethod closeCleanup," ] }, { "added": [ "" ], "header": "@@ -90,7 +88,7 @@ public class SetOpResultSet extends NoPutResultSetImpl", "removed": [ " this.closeCleanup = closeCleanup;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/SortResultSet.java", "hunks": [ { "added": [ "class SortResultSet extends NoPutResultSetImpl" ], "header": "@@ -111,7 +111,7 @@ import java.util.Enumeration;", "removed": [ "public class SortResultSet extends NoPutResultSetImpl" ] }, { "added": [], "header": "@@ -123,7 +123,6 @@ public class SortResultSet extends NoPutResultSetImpl", "removed": [ " private GeneratedMethod closeCleanup;" ] }, { "added": [ "\t\t\t\t double optimizerEstimatedCost) throws StandardException " ], "header": "@@ -182,8 +181,7 @@ public class SortResultSet extends NoPutResultSetImpl", "removed": [ "\t\t\t\t double optimizerEstimatedCost,", "\t\t\t\t\tGeneratedMethod c) throws StandardException " ] }, { "added": [], "header": "@@ -192,7 +190,6 @@ public class SortResultSet extends NoPutResultSetImpl", "removed": [ " closeCleanup = c;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/TableScanResultSet.java", "hunks": [ { "added": [ "class TableScanResultSet extends NoPutResultSetImpl" ], "header": "@@ -72,7 +72,7 @@ import java.util.Hashtable;", "removed": [ "public class TableScanResultSet extends NoPutResultSetImpl" ] }, { "added": [], "header": "@@ -94,7 +94,6 @@ public class TableScanResultSet extends NoPutResultSetImpl", "removed": [ "\tprotected GeneratedMethod closeCleanup;" ] }, { "added": [ " TableScanResultSet(long conglomId," ], "header": "@@ -157,7 +156,7 @@ public class TableScanResultSet extends NoPutResultSetImpl", "removed": [ " public TableScanResultSet(long conglomId," ] }, { "added": [ "\t\tdouble optimizerEstimatedCost)" ], "header": "@@ -179,8 +178,7 @@ public class TableScanResultSet extends NoPutResultSetImpl", "removed": [ "\t\tdouble optimizerEstimatedCost,", "\t\tGeneratedMethod closeCleanup)" ] }, { "added": [], "header": "@@ -324,8 +322,6 @@ public class TableScanResultSet extends NoPutResultSetImpl", "removed": [ "\t\tthis.closeCleanup = closeCleanup;", "" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/UnionResultSet.java", "hunks": [ { "added": [ "class UnionResultSet extends NoPutResultSetImpl" ], "header": "@@ -49,7 +49,7 @@ import org.apache.derby.iapi.types.RowLocation;", "removed": [ "public class UnionResultSet extends NoPutResultSetImpl" ] }, { "added": [ "" ], "header": "@@ -63,7 +63,7 @@ public class UnionResultSet extends NoPutResultSetImpl", "removed": [ " protected GeneratedMethod closeCleanup;" ] }, { "added": [ "\t\t\t\t\t\t double optimizerEstimatedCost) " ], "header": "@@ -76,15 +76,13 @@ public class UnionResultSet extends NoPutResultSetImpl", "removed": [ "\t\t\t\t\t\t double optimizerEstimatedCost,", "\t\t\t\t\t\t GeneratedMethod closeCleanup) ", "\t\tthis.closeCleanup = closeCleanup;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/VTIResultSet.java", "hunks": [ { "added": [ "class VTIResultSet extends NoPutResultSetImpl" ], "header": "@@ -64,7 +64,7 @@ import java.sql.ResultSetMetaData;", "removed": [ "public class VTIResultSet extends NoPutResultSetImpl" ] }, { "added": [], "header": "@@ -75,7 +75,6 @@ public class VTIResultSet extends NoPutResultSetImpl", "removed": [ " protected GeneratedMethod closeCleanup;" ] }, { "added": [ "\t\t\t\t double optimizerEstimatedCost) " ], "header": "@@ -112,8 +111,7 @@ public class VTIResultSet extends NoPutResultSetImpl", "removed": [ "\t\t\t\t double optimizerEstimatedCost,", "\t\t\t\t GeneratedMethod closeCleanup) " ] }, { "added": [], "header": "@@ -137,7 +135,6 @@ public class VTIResultSet extends NoPutResultSetImpl", "removed": [ "\t\tthis.closeCleanup = closeCleanup;" ] }, { "added": [], "header": "@@ -353,9 +350,6 @@ public class VTIResultSet extends NoPutResultSetImpl", "removed": [ "\t\t\tif (closeCleanup != null) {", "\t\t\t\tcloseCleanup.invoke(activation); // let activation tidy up", "\t\t\t}" ] } ] } ]
derby-DERBY-1701-09ffc9bc
DERBY-1555 DERBY-1701 (partial) Convert more tests to use the instance based get[X]Connection method or the static openDefault method. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@432028 13f79535-47bb-0310-9956-ffa450edef68
[]