id
stringlengths
22
25
commit_message
stringlengths
137
6.96k
diffs
listlengths
0
63
derby-DERBY-1357-450df233
DERBY-1357: Fix optimizer short-circuit logic. Here is the note from the contributor. I also had to update the lang/predicatePushdown.out master file because with the d1357_v1.patch the order of a couple of qualifiers has changed. Note that the query plans themselves are exactly the same--the only thing that's changed is the the qualifier ordering for one query. This change of order occurs because as part of the costing code in FromBaseTable.estimateCost() the optimizer transfers predicates from one predicate list to another, gets an estimated cost, then puts the predicates back into the original list. The methods to do this transferring are in NestedLoopJoinStrategy.java and HashJoinStrategy.java. In the former, the predicates are transferred away in front-to-back order and then transferred back in back-to-front order, which leads to a reversal of the relevant predicate ordering. Ex. If we have a list L1 of preds A,B,C and we transfer them to L2 in front-to-back order, L2 will end up with A,B,C. Then, when we transfer the predicates back to L1, if we process L2 in back-to-front order, L1 will end up with C,B,A. That said, with d1357_v1 applied the short-circuit logic prevents the optimizer from trying to optimize a join order that is known to be bad. This means that we skip an unnecessary round of optimization and therefore skip one round of order reversal, which means the order of the predicate qualifiers in the final plan is now different. I ran derbyall on Red Hat with sane jars and ibm142, and saw no new failures. Submitted by Army Brown ([email protected]) git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@423754 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/compile/OptimizerImpl.java", "hunks": [ { "added": [ "", "\t\t/* Determine if the current plan is still less expensive than", "\t\t * the best plan so far. If bestCost is uninitialized then", "\t\t * we want to return false here; if we didn't, then in the (rare)", "\t\t * case where the current cost is greater than Double.MAX_VALUE", "\t\t * (esp. if it's Double.POSITIVE_INFINITY, which can occur", "\t\t * for very deeply nested queries with long FromLists) we would", "\t\t * give up on the current plan even though we didn't have a", "\t\t * best plan yet, which would be wrong. Also note: if we have", "\t\t * a required row ordering then we might end up using the", "\t\t * sort avoidance plan--but we don't know at this point", "\t\t * which plan (sort avoidance or \"normal\") we're going to", "\t\t * use, so we error on the side of caution and only short-", "\t\t * circuit if both currentCost and currentSortAvoidanceCost", "\t\t * (if the latter is applicable) are greater than bestCost.", "\t\t */", "\t\tboolean alreadyCostsMore =", "\t\t\t!bestCost.isUninitialized() &&", "\t\t\t(currentCost.compare(bestCost) > 0) &&", "\t\t\t((requiredRowOrdering == null) ||", "\t\t\t\t(currentSortAvoidanceCost.compare(bestCost) > 0));", "", "\t\t\t!alreadyCostsMore &&" ], "header": "@@ -452,9 +452,30 @@ public class OptimizerImpl implements Optimizer", "removed": [ "\t\t\t((currentCost.compare(bestCost) < 0) ||", "\t\t\t(currentSortAvoidanceCost.compare(bestCost) < 0)) &&" ] }, { "added": [ "\t\telse", "\t\t\tif (optimizerTrace)", " \t\t\t{", "\t\t\t\t/*", "\t\t\t\t** Not considered short-circuiting if all slots in join", "\t\t\t\t** order are taken.", "\t\t\t\t*/", "\t\t\t\tif (joinPosition < (numOptimizables - 1))", "\t\t\t\t{", "\t\t\t\t\ttrace(SHORT_CIRCUITING, 0, 0, 0.0, null);", "\t\t\t\t}", "", "\t\t\t// If we short-circuited the current join order then we need", "\t\t\t// to make sure that, when we start pulling optimizables to find", "\t\t\t// a new join order, we reload the best plans for those", "\t\t\t// optimizables as we pull them. Otherwise we could end up", "\t\t\t// generating a plan for an optimizable even though that plan", "\t\t\t// was part of a short-circuited (and thus rejected) join", "\t\t\t// order.", "\t\t\tif (joinPosition < (numOptimizables - 1))", "\t\t\t\treloadBestPlan = true;" ], "header": "@@ -480,16 +501,29 @@ public class OptimizerImpl implements Optimizer", "removed": [ "\t\telse if (optimizerTrace)", "\t\t\t/*", "\t\t\t** Not considered short-circuiting if all slots in join", "\t\t\t** order are taken.", "\t\t\t*/", "\t\t\tif (joinPosition < (numOptimizables - 1))", "\t\t\t{", "\t\t\t\ttrace(SHORT_CIRCUITING, 0, 0, 0.0, null);" ] } ] } ]
derby-DERBY-1361-9634cd20
DERBY-1361 positioned updates and deletes allowed after a commit without repositioning the cursor - if the table is indexed on the columns selected git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@417366 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1364-d8383bd9
DERBY-1364: Client driver does not roll back the effects of a stored procedure when incorrectly invoked by executeQuery()/executeUpdate() Description of the patch: 1. Checking of the number of result sets returned was moved from executeUpdate/executeQuery to a point in flowExecute where the transaction has not been auto-committed (otherwise, the transaction would already be committed when the exception was raised). 2. If the number of result sets does not match the execute type and auto-commit is enabled, the transaction is rolled back (otherwise, the transaction would be committed when the Statement was closed or re-executed). 3. All execute* methods in CallableStatement were removed since they have become identical to the methods in PreparedStatement. (Or almost identical. The methods in CallableStatement did not call checkStatementValidity() on errors, but that's probably a bug.) 4. SQL state for error message in executeQuery() was changed to match embedded (XJ201/XJ205 -> X0Y78). Updated English and Portuguese messages to use the new SQL state (no other translations existed for XJ201 and XJ205). 5. Added more rollback tests to jdbcapi/ProcedureTest.junit and enabled all test cases for DerbyNetClient. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@418692 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/client/org/apache/derby/client/am/CallableStatement.java", "hunks": [ { "added": [], "header": "@@ -127,89 +127,6 @@ public class CallableStatement extends PreparedStatement", "removed": [ " public boolean execute() throws SQLException {", " try", " {", " synchronized (connection_) {", " if (agent_.loggingEnabled()) {", " agent_.logWriter_.traceEntry(this, \"execute\");", " }", " boolean b = executeX();", " if (agent_.loggingEnabled()) {", " agent_.logWriter_.traceExit(this, \"execute\", b);", " }", " return b;", " }", " }", " catch ( SqlException se )", " {", " throw se.getSQLException();", " }", " }", "", " // also used by SQLCA", " boolean executeX() throws SqlException {", " super.flowExecute(executeMethod__);", " return resultSet_ != null;", " }", "", " public java.sql.ResultSet executeQuery() throws SQLException {", " try", " {", " synchronized (connection_) {", " if (agent_.loggingEnabled()) {", " agent_.logWriter_.traceEntry(this, \"executeQuery\");", " }", " ResultSet resultSet = executeQueryX();", " if (agent_.loggingEnabled()) {", " agent_.logWriter_.traceExit(this, \"executeQuery\", resultSet);", " }", " return resultSet;", " }", " }", " catch ( SqlException se )", " {", " throw se.getSQLException();", " }", " }", "", " // also used by DBMD methods", " ResultSet executeQueryX() throws SqlException {", " super.flowExecute(executeQueryMethod__);", " super.checkExecuteQueryPostConditions(\"java.sql.CallableStatement\");", " return resultSet_;", " }", "", " public int executeUpdate() throws SQLException {", " try", " {", " synchronized (connection_) {", " if (agent_.loggingEnabled()) {", " agent_.logWriter_.traceEntry(this, \"executeUpdate\");", " }", " int updateValue = executeUpdateX();", " if (agent_.loggingEnabled()) {", " agent_.logWriter_.traceExit(this, \"executeUpdate\", updateValue);", " }", " return updateValue;", " }", " }", " catch ( SqlException se )", " {", " throw se.getSQLException();", " }", " }", "", " int executeUpdateX() throws SqlException {", " super.flowExecute(executeUpdateMethod__);", "", " super.checkExecuteUpdatePostConditions(\"java.sql.CallableStatement\");", " // make sure update count >= 0 even if derby don't support update count for call", " //return (updateCount_ < 0) ? 0 : updateCount_;", " return updateCount_;", " }", "", "" ] } ] }, { "file": "java/client/org/apache/derby/client/am/PreparedStatement.java", "hunks": [ { "added": [], "header": "@@ -360,8 +360,6 @@ public class PreparedStatement extends Statement", "removed": [ "", " super.checkExecuteQueryPostConditions(\"java.sql.PreparedStatement\");" ] }, { "added": [], "header": "@@ -388,7 +386,6 @@ public class PreparedStatement extends Statement", "removed": [ " checkExecuteUpdatePostConditions(\"java.sql.PreparedStatement\");" ] }, { "added": [ " // also used by SQLCA", " boolean executeX() throws SqlException {" ], "header": "@@ -1297,7 +1294,8 @@ public class PreparedStatement extends Statement", "removed": [ " private boolean executeX() throws SqlException {" ] }, { "added": [ " checkForStoredProcResultSetCount(executeType);" ], "header": "@@ -1882,6 +1880,7 @@ public class PreparedStatement extends Statement", "removed": [] } ] }, { "file": "java/client/org/apache/derby/client/am/Statement.java", "hunks": [ { "added": [], "header": "@@ -419,26 +419,9 @@ public class Statement implements java.sql.Statement, StatementCallbackInterface", "removed": [ "", " checkExecuteQueryPostConditions(\"java.sql.Statement\");", " void checkExecuteQueryPostConditions(String jdbcStatementInterfaceName) throws SqlException {", " // We'll just rely on finalizers to close the dangling result sets.", " if (resultSetList_ != null && resultSetList_.length != 1) {", " throw new SqlException(agent_.logWriter_, ", " new ClientMessageId(SQLState.MULTIPLE_RESULTS_ON_EXECUTE_QUERY),", " jdbcStatementInterfaceName, jdbcStatementInterfaceName);", " }", "", " if (resultSet_ == null) {", " throw new SqlException(agent_.logWriter_, ", " new ClientMessageId(SQLState.USE_EXECUTE_UPDATE_WITH_NO_RESULTS),", " jdbcStatementInterfaceName, jdbcStatementInterfaceName);", " }", " }", "" ] }, { "added": [], "header": "@@ -461,26 +444,9 @@ public class Statement implements java.sql.Statement, StatementCallbackInterface", "removed": [ "", " checkExecuteUpdatePostConditions(\"java.sql.Statement\");", " void checkExecuteUpdatePostConditions(String jdbcStatementInterfaceName) throws SqlException {", " // We'll just rely on finalizers to close the dangling result sets.", " if (resultSetList_ != null) {", " throw new SqlException(agent_.logWriter_, ", " new ClientMessageId(SQLState.MULTIPLE_RESULTS_ON_EXECUTE_QUERY),", " jdbcStatementInterfaceName, jdbcStatementInterfaceName);", " }", "", " // We'll just rely on the finalizer to close the dangling result set.", " if (resultSet_ != null) {", " throw new SqlException(agent_.logWriter_, ", " new ClientMessageId(SQLState.LANG_INVALID_CALL_TO_EXECUTE_UPDATE));", " }", " }", "" ] }, { "added": [ " checkForStoredProcResultSetCount(executeType);" ], "header": "@@ -2079,6 +2045,7 @@ public class Statement implements java.sql.Statement, StatementCallbackInterface", "removed": [] }, { "added": [ " /**", " * Returns the name of the java.sql interface implemented by this class.", " * @return name of java.sql interface", " */", " protected String getJdbcStatementInterfaceName() {", " return \"java.sql.Statement\";", " }", "" ], "header": "@@ -2233,6 +2200,14 @@ public class Statement implements java.sql.Statement, StatementCallbackInterface", "removed": [] } ] }, { "file": "java/shared/org/apache/derby/shared/common/reference/SQLState.java", "hunks": [ { "added": [ " String MULTIPLE_RESULTS_ON_EXECUTE_QUERY = \"X0Y78.S.1\";", " String USE_EXECUTE_UPDATE_WITH_NO_RESULTS = \"X0Y78.S.2\";" ], "header": "@@ -1233,6 +1233,8 @@ public interface SQLState {", "removed": [] } ] } ]
derby-DERBY-1364-fade7e97
DERBY-501: Client and embedded drivers differ on invoking a procedure that returns a single Dynamic resultSet using CallableStatement.executeQuery() This patch modifies EmbedStatement.processDynamicResults() so that it returns the number of dynamic results instead of a boolean. EmbedStatement.executeStatement() uses this number to decide whether an exception is to be raised. With this change, the executeQuery and executeUpdate parameters are no longer needed in GenericPreparedStatement.execute(). ProcedureTest.junit is now enabled in derbyall (all frameworks). Seven of the test cases run in the embedded framework only, but I expect all of them to succeed with the client driver after DERBY-1314 and DERBY-1364 have been fixed. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@414795 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/sql/PreparedStatement.java", "hunks": [ { "added": [], "header": "@@ -101,8 +101,6 @@ public interface PreparedStatement", "removed": [ "\t * @param executeQuery\t\tWhether or not called from a Statement.executeQuery()", "\t * @param executeUpdate\tWhether or not called from a Statement.executeUpdate()" ] } ] }, { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java", "hunks": [ { "added": [ " ps.execute(act, true, 0L); " ], "header": "@@ -3485,7 +3485,7 @@ public abstract class EmbedResultSet extends ConnectionChild", "removed": [ " ps.execute(act, false, true, true, 0L); " ] }, { "added": [ " // Execute the update where current of sql.", " org.apache.derby.iapi.sql.ResultSet rs = ps.execute(act, true, 0L);" ], "header": "@@ -3556,7 +3556,8 @@ public abstract class EmbedResultSet extends ConnectionChild", "removed": [ " org.apache.derby.iapi.sql.ResultSet rs = ps.execute(act, false, true, true, 0L); //execute the update where current of sql" ] } ] }, { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedStatement.java", "hunks": [ { "added": [ "", " // The statement returns rows, so calling it with", " // executeUpdate() is not allowed.", " if (executeUpdate) {", " throw StandardException.newException(", " SQLState.LANG_INVALID_CALL_TO_EXECUTE_UPDATE);", " }", "" ], "header": "@@ -1179,14 +1179,20 @@ public class EmbedStatement extends ConnectionChild", "removed": [ " executeQuery,", " executeUpdate," ] }, { "added": [ " int dynamicResultCount = 0;", " dynamicResultCount =", " processDynamicResults(a.getDynamicResults(),", " a.getMaxDynamicResults());", "", " // executeQuery() is not allowed if the statement", " // doesn't return exactly one ResultSet.", " if (executeQuery && dynamicResultCount != 1) {", " throw StandardException.newException(", " SQLState.LANG_INVALID_CALL_TO_EXECUTE_QUERY);", " }", "", " // executeUpdate() is not allowed if the statement", " // returns ResultSets.", " if (executeUpdate && dynamicResultCount > 0) {", " throw StandardException.newException(", " SQLState.LANG_INVALID_CALL_TO_EXECUTE_UPDATE);", " }", " if (dynamicResultCount == 0) {" ], "header": "@@ -1217,12 +1223,28 @@ public class EmbedStatement extends ConnectionChild", "removed": [ "\t\t\t\t\tboolean haveDynamicResults = false;", "\t\t\t\t\t\thaveDynamicResults = processDynamicResults(a.getDynamicResults(), a.getMaxDynamicResults());", "\t\t\t\t\tif (!haveDynamicResults) {" ] }, { "added": [ " retval = (dynamicResultCount > 0);" ], "header": "@@ -1240,7 +1262,7 @@ public class EmbedStatement extends ConnectionChild", "removed": [ "\t\t\t\t\tretval = haveDynamicResults;" ] }, { "added": [ "", " /**", " * Go through a holder of dynamic result sets, remove those that", " * should not be returned, and sort the result sets according to", " * their creation.", " *", " * @param holder a holder of dynamic result sets", " * @param maxDynamicResultSets the maximum number of result sets", " * to be returned", " * @return the actual number of result sets", " * @exception SQLException if an error occurs", " */", " private int processDynamicResults(java.sql.ResultSet[][] holder,", " int maxDynamicResultSets)", " throws SQLException", " {" ], "header": "@@ -1446,7 +1468,22 @@ public class EmbedStatement extends ConnectionChild", "removed": [ "\tprivate boolean processDynamicResults(java.sql.ResultSet[][] holder, int maxDynamicResultSets) throws SQLException {" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java", "hunks": [ { "added": [ "\t\treturn execute(a, rollbackParentContext, timeoutMillis);" ], "header": "@@ -237,15 +237,13 @@ public class GenericPreparedStatement", "removed": [ "\t\treturn execute(a, false, false, rollbackParentContext, timeoutMillis);", "\t * @param\texecuteQuery\t\t\t\tCalled via executeQuery", "\t * @param\texecuteUpdate\t\t\t\tCalled via executeUpdate" ] }, { "added": [], "header": "@@ -256,8 +254,6 @@ public class GenericPreparedStatement", "removed": [ " boolean executeQuery,", " boolean executeUpdate," ] } ] } ]
derby-DERBY-1365-985a9b0b
DERBY-1365: Fixes two minor problems with logic in Optimizer. Here is the note from contributor: In addition to fixing the two issues described, the patch also resolves another potential problem: there are several places in OptimizerImpl.getNextPermutation() where calls to rewindJoinOrder() are made. These calls typically indicate that the optimizer has decided to abandon or "short circuit" a join order before calculating the full cost. For some of these calls--esp. the ones that can occur in the middle of the join order (as opposed to those which will only occur on a complete join order)--the "rewind" operation needs to make sure to reload the best plans for the optimizables that are pulled as part of the "rewind" process. Otherwise Derby could end up generating a plan for an optimizable even though that plan was part of a join order that was "abandoned" (i.e. rewound in the middle), which is logically incorrect and could lead to sub-optimal performance. I've included changes for this issue as part of d1365_v1.patch. I ran derbyall on Red Hat Linux with d1365_v1.patch applied and saw no new failures. I would appreciate reviews/comments/commit if anyone has the time... Submitted by Army Brown ([email protected]) git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@412222 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/store/access/BackingStoreHashtable.java", "hunks": [ { "added": [ " // Check to see how much memory we think the first row" ], "header": "@@ -273,7 +273,7 @@ public class BackingStoreHashtable", "removed": [ "\t\t\t\t\t// Check to see how much memory we think the first row" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/OptimizerImpl.java", "hunks": [ { "added": [ "\t\t\t\t// The call to rewindJoinOrder() here will put joinPosition", "\t\t\t\t// back to 0. But that said, we'll then end up incrementing ", "\t\t\t\t// joinPosition before we start looking for the next join", "\t\t\t\t// order (see below), which means we need to set it to -1", "\t\t\t\t// here so that it gets incremented to \"0\" and then", "\t\t\t\t// processing can continue as normal from there. Note:", "\t\t\t\t// we don't need to set reloadBestPlan to true here", "\t\t\t\t// because we only get here if we have *not* found a", "\t\t\t\t// best plan yet.", "\t\t\t\t{", "\t\t\t\t\tjoinPosition = -1;", "\t\t\t\t}" ], "header": "@@ -418,8 +418,20 @@ public class OptimizerImpl implements Optimizer", "removed": [] }, { "added": [ "", "\t\t\t// Note: we have to make sure we reload the best plans", "\t\t\t// as we rewind since they may have been clobbered", "\t\t\t// (as part of the current join order) before we gave", "\t\t\t// up on jumping.", "\t\t\treloadBestPlan = true;" ], "header": "@@ -479,9 +491,15 @@ public class OptimizerImpl implements Optimizer", "removed": [] }, { "added": [ "\t\t\t\t\t// Note: we have to make sure we reload the best plans", "\t\t\t\t\t// as we rewind since they may have been clobbered", "\t\t\t\t\t// (as part of the current join order) before we got", "\t\t\t\t\t// here.", "\t\t\t\t\t\t\treloadBestPlan = true;" ], "header": "@@ -597,8 +615,13 @@ public class OptimizerImpl implements Optimizer", "removed": [] }, { "added": [ "\t\t\t\t\t// Note: we have to make sure we reload the best plans", "\t\t\t\t\t// as we rewind since they may have been clobbered", "\t\t\t\t\t// (as part of the current join order) before we got", "\t\t\t\t\t// here.", "\t\t\t\t\t\treloadBestPlan = true;" ], "header": "@@ -1027,10 +1050,15 @@ public class OptimizerImpl implements Optimizer", "removed": [] } ] } ]
derby-DERBY-1367-0400f845
DERBY-1367: Enable grantRevoke.java test in DerbyNetClient framework. Submitted by Satheesh Bandaram ([email protected]) git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@427358 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1368-47cbf26e
DERBY-1368 EOFException when reading from blob's binary stream This patch just adds a test. Bug was fixed previously with 10.2. I am not sure exactly which checkin fixed it. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@610094 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-137-9f5e1d4a
DERBY-137: Derby metadata always returns JDBC 2 result sets, even when JDBC 3 result sets are required. Summary of the changes: DatabaseMetaData: - getProcedureColumns: modified VTI to return an int instead of a short for the DATA_TYPE column - getTables: new columns: TYPE_CAT, TYPE_SCHEM, TYPE_NAME, SELF_REFERENCING_COL_NAME, REF_GENERATION (all null since Derby doesn't support typed tables) - getColumns: DATA_TYPE changed from SMALLINT to INTEGER. New columns: SCOPE_CATLOG, SCOPE_SCHEMA, SCOPE_TABLE, SOURCE_DATATYPE (all null since Derby doesn't support the REF or DISTINCT data types) - getVersionColumns: SCOPE, DECIMAL_DIGITS and PSEUDO_COLUMN changed from INTEGER to SMALLINT - getPrimaryKeys: KEY_SEQ changed from INTEGER to SMALLINT (the new query is ODBC compliant so getPrimaryKeysForODBC was removed) - getTypeInfo: DATA_TYPE changed from SMALLINT to INTEGER, NULLABLE, SEARCHABLE, MINIMUM_SCALE and MAXIMUM_SCALE changed from INTEGER to SMALLINT - getIndexInfo: ORDINAL_POSITION changed from INTEGER to SMALLINT - getBestRowIdentifier: DATA_TYPE changed from SMALLINT to INTEGER - getUDTs: new columm: BASE_TYPE (null since Derby doesn't support the DISTINCT type or SELF_REFERENCING_COLUMN) ODBCMetadataGenerator: - cast DATA_TYPE columns to SMALLINT (as defined by ODBC) - don't cast columns that already are SMALLINT to SMALLINT Tests: - updated master files for metadata, odbc_metadata, bestrowidentifier, declareGlobalTempTableJava and Upgrade_10_1_10_2 (new columns and modified data types) - odbc_metadata.java: added information about nullability for some of the new columns to avoid ArrayIndexOutOfBoundsException git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@417497 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/build/org/apache/derbyBuild/ODBCMetadataGenerator.java", "hunks": [ { "added": [], "header": "@@ -202,9 +202,6 @@ public class ODBCMetadataGenerator {", "removed": [ "\t\tchangeMap.put(\"getPrimaryKeys\",", "\t\t\tnew Byte(TYPE_VALUE_CHANGE));", "" ] }, { "added": [ "\t\t\tif (colName.equals(\"DATA_TYPE\") ||", "\t\t\t\tcolName.equals(\"SQL_DATETIME_SUB\"))" ], "header": "@@ -911,16 +908,13 @@ public class ODBCMetadataGenerator {", "removed": [ "\t\t\tif (colName.equals(\"NULLABLE\") ||", "\t\t\t\tcolName.equals(\"SEARCHABLE\") ||", "\t\t\t\tcolName.equals(\"SQL_DATETIME_SUB\") ||", "\t\t\t\tcolName.equals(\"MINIMUM_SCALE\") ||", "\t\t\t\tcolName.equals(\"MAXIMUM_SCALE\"))" ] }, { "added": [ "\t\t\t\tcolName.equals(\"DATA_TYPE\") ||" ], "header": "@@ -928,6 +922,7 @@ public class ODBCMetadataGenerator {", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/catalog/GetProcedureColumns.java", "hunks": [ { "added": [ " <LI><B>DATA_TYPE</B> int => SQL type from java.sql.Types" ], "header": "@@ -61,7 +61,7 @@ import org.apache.derby.shared.common.reference.JDBC40Translation;", "removed": [ " <LI><B>DATA_TYPE</B> short => SQL type from java.sql.Types" ] }, { "added": [ " case 3: // DATA_TYPE:", " if (sqlType != null) {", " return sqlType.getJDBCTypeId();", " }", " return java.sql.Types.JAVA_OBJECT;", "" ], "header": "@@ -200,6 +200,12 @@ public class GetProcedureColumns extends org.apache.derby.vti.VTITemplate", "removed": [] }, { "added": [], "header": "@@ -241,12 +247,6 @@ public class GetProcedureColumns extends org.apache.derby.vti.VTITemplate", "removed": [ "\t\tcase 3: // DATA_TYPE:", " if (sqlType != null)", " return (short)sqlType.getJDBCTypeId();", " else", " return (short) java.sql.Types.JAVA_OBJECT;", "" ] } ] }, { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java", "hunks": [ { "added": [ " * <LI><B>DATA_TYPE</B> int => SQL type from java.sql.Types" ], "header": "@@ -1527,7 +1527,7 @@ public class EmbedDatabaseMetaData extends ConnectionChild", "removed": [ " * <LI><B>DATA_TYPE</B> short => SQL type from java.sql.Types" ] }, { "added": [ " * <LI><B>TYPE_CAT</B> String => the types catalog (may be", " * <code>null</code>)", " * <LI><B>TYPE_SCHEM</B> String => the types schema (may be", " * <code>null</code>)", " * <LI><B>TYPE_NAME</B> String => type name (may be", " * <code>null</code>)", " * <LI><B>SELF_REFERENCING_COL_NAME</B> String => name of the", " * designated \"identifier\" column of a typed table (may", " * be <code>null</code>)", " * <LI><B>REF_GENERATION</B> String => specifies how values in", " * SELF_REFERENCING_COL_NAME are created. Values are", " * \"SYSTEM\", \"USER\", \"DERIVED\". (may be", " * <code>null</code>)" ], "header": "@@ -1673,6 +1673,19 @@ public class EmbedDatabaseMetaData extends ConnectionChild", "removed": [] }, { "added": [ " *\t<LI><B>DATA_TYPE</B> int => SQL type from java.sql.Types" ], "header": "@@ -1808,7 +1821,7 @@ public class EmbedDatabaseMetaData extends ConnectionChild", "removed": [ " *\t<LI><B>DATA_TYPE</B> short => SQL type from java.sql.Types" ] }, { "added": [ " * <LI><B>SCOPE_CATLOG</B> String => catalog of table that is the", " * scope of a reference attribute (<code>null</code> if DATA_TYPE", " * isn't REF)", " * <LI><B>SCOPE_SCHEMA</B> String => schema of table that is the", " * scope of a reference attribute (<code>null</code> if the", " * DATA_TYPE isn't REF)", " * <LI><B>SCOPE_TABLE</B> String => table name that this the", " * scope of a reference attribure (<code>null</code> if the", " * DATA_TYPE isn't REF)", " * <LI><B>SOURCE_DATA_TYPE</B> short => source type of a distinct", " * type or user-generated Ref type, SQL type from java.sql.Types", " * (<code>null</code> if DATA_TYPE isn't DISTINCT or", " * user-generated REF)", " * <LI><B>IS_AUTOINCREMENT</B> String => Indicates whether this", " * column is auto incremented", " * <UL>", " * <LI> YES --- if the column is auto incremented", " * <LI> NO --- if the column is not auto incremented", " * <LI> empty string --- if it cannot be determined whether the", " * column is auto incremented parameter is unknown", " * </UL>" ], "header": "@@ -1833,6 +1846,27 @@ public class EmbedDatabaseMetaData extends ConnectionChild", "removed": [] }, { "added": [ " *\t<LI><B>DATA_TYPE</B> int => SQL data type from java.sql.Types" ], "header": "@@ -1979,7 +2013,7 @@ public class EmbedDatabaseMetaData extends ConnectionChild", "removed": [ " *\t<LI><B>DATA_TYPE</B> short => SQL data type from java.sql.Types" ] }, { "added": [ " *\t<LI><B>DATA_TYPE</B> int => SQL data type from java.sql.Types" ], "header": "@@ -2174,7 +2208,7 @@ public class EmbedDatabaseMetaData extends ConnectionChild", "removed": [ " *\t<LI><B>DATA_TYPE</B> short => SQL data type from java.sql.Types" ] }, { "added": [ "\t\tPreparedStatement s = getPreparedQuery(\"getPrimaryKeys\");" ], "header": "@@ -2283,31 +2317,7 @@ public class EmbedDatabaseMetaData extends ConnectionChild", "removed": [ "\t\treturn doGetPrimaryKeys(catalog, schema, table, \"getPrimaryKeys\");", "\t}", "", "\t/**", "\t * Get a description of a table's primary key columns. They", "\t * are ordered by COLUMN_NAME. Same as getPrimaryKeys above,", "\t * except that the result set will conform to ODBC specifications.", "\t */", "\tpublic ResultSet getPrimaryKeysForODBC(String catalog, String schema,", "\t\t\t\tString table) throws SQLException {", "\t\treturn doGetPrimaryKeys(catalog, schema, table, \"odbc_getPrimaryKeys\");", "\t}", "", "\t/**", "\t * Does the actual work for the getPrimaryKeys metadata", "\t * calls. See getPrimaryKeys() method above for parameter", "\t * descriptions.", "\t * @param queryName Name of the query to execute; is used", "\t *\tto determine whether the result set should conform to", "\t *\tJDBC or ODBC specifications.", "\t */", "\tprivate ResultSet doGetPrimaryKeys(String catalog, String schema,", "\t\tString table, String queryName) throws SQLException {", "", "\t\tPreparedStatement s = getPreparedQuery(queryName);" ] }, { "added": [ " *\t<LI><B>DATA_TYPE</B> int => SQL data type from java.sql.Types" ], "header": "@@ -2570,7 +2580,7 @@ public class EmbedDatabaseMetaData extends ConnectionChild", "removed": [ " *\t<LI><B>DATA_TYPE</B> short => SQL data type from java.sql.Types" ] } ] } ]
derby-DERBY-1373-97cac2ed
DERBY-1373: Encrypted databases cannot be booted using the jar subprotocol Patch Contributed by Sunitha Kambhampati. This patch makes the following changes: 1) Instead of using RandomAccessFile, the verifyKey.dat is read as a InputStream. 2) Add a new test (encryptionKey_jar.sql) for booting encrypted database using encryptionKey via classpath, and jar subprotocol. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@423682 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/services/jce/JCECipherFactory.java", "hunks": [ { "added": [ "import java.io.InputStream;", "import java.io.DataInputStream;" ], "header": "@@ -48,6 +48,8 @@ import java.security.spec.KeySpec;", "removed": [] }, { "added": [ " case 3:", " return activeFile.getInputStream();" ], "header": "@@ -836,6 +838,8 @@ public final class JCECipherFactory implements CipherFactory, java.security.Priv", "removed": [] }, { "added": [ " InputStream verifyKeyInputStream = null;" ], "header": "@@ -894,6 +898,7 @@ public final class JCECipherFactory implements CipherFactory, java.security.Priv", "removed": [] }, { "added": [ "\t\t\t\t// Read from verifyKey.dat as an InputStream. This allows for ", " // reading the information from verifyKey.dat successfully even when using the jar", " // subprotocol to boot derby. (DERBY-1373) ", "\t\t\t\tverifyKeyInputStream = privAccessGetInputStream(sf,Attribute.CRYPTO_EXTERNAL_KEY_VERIFY_FILE);", " DataInputStream dis = new DataInputStream(verifyKeyInputStream);", "\t\t\t\tint checksumLen = dis.readInt();", "\t\t\t\tdis.readFully(originalChecksum);", "\t\t\t\tdis.readFully(data);" ], "header": "@@ -916,15 +921,18 @@ public final class JCECipherFactory implements CipherFactory, java.security.Priv", "removed": [ "\t\t\t\t// open file for reading only", "\t\t\t\tverifyKeyFile = privAccessFile(sf,Attribute.CRYPTO_EXTERNAL_KEY_VERIFY_FILE,\"r\");", "\t\t\t\tint checksumLen = verifyKeyFile.readInt();", "\t\t\t\tverifyKeyFile.readFully(originalChecksum);", "\t\t\t\tverifyKeyFile.readFully(data);" ] }, { "added": [ " if (verifyKeyInputStream != null )", " verifyKeyInputStream.close();" ], "header": "@@ -949,6 +957,8 @@ public final class JCECipherFactory implements CipherFactory, java.security.Priv", "removed": [] } ] } ]
derby-DERBY-1374-4d34a234
DERBY-1374 compatibility test fails with PROTOCOL Data Stream Syntax Error.Patch contributed by Fernanda Pizzorno git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@415557 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/client/org/apache/derby/client/net/NetConnectionRequest.java", "hunks": [ { "added": [], "header": "@@ -395,9 +395,6 @@ public class NetConnectionRequest extends Request implements ConnectionRequestIn", "removed": [ " // This specifies the SQL Error Diagnostic Level", " buildDIAGLVL();", "" ] } ] }, { "file": "java/drda/org/apache/derby/impl/drda/DRDAConnThread.java", "hunks": [ { "added": [ "\t\t\t\t\t// The client can not request DIAGLVL because when run with", "\t\t\t\t\t// an older server it will cause an exception. Older version", "\t\t\t\t\t// of the server do not recognize requests for DIAGLVL.", "\t\t\t\t\tif ((appRequester.getClientType() == appRequester.DNC_CLIENT) &&", "\t\t\t\t\t\t\tappRequester.greaterThanOrEqualTo(10, 2, 0)) {", "\t\t\t\t\t\tdiagnosticLevel = CodePoint.DIAGLVL1;", "\t\t\t\t\t}", "" ], "header": "@@ -2901,6 +2901,14 @@ class DRDAConnThread extends Thread {", "removed": [] }, { "added": [], "header": "@@ -2937,10 +2945,6 @@ class DRDAConnThread extends Thread {", "removed": [ "\t\t\t\t// optional", "\t\t\t\tcase CodePoint.DIAGLVL:", "\t\t\t\t\tdiagnosticLevel = reader.readByte();", "\t\t\t\t\tbreak;" ] }, { "added": [ "\t\t\t\tSQLWarning w = new SQLWarning(\"\", SQLState.ROW_UPDATED," ], "header": "@@ -6243,7 +6247,7 @@ class DRDAConnThread extends Thread {", "removed": [ "\t\t\t\tSQLWarning w = new SQLWarning(null, SQLState.ROW_UPDATED," ] }, { "added": [ "\t\t\t\tSQLWarning w = new SQLWarning(\"\", SQLState.ROW_DELETED," ], "header": "@@ -6255,7 +6259,7 @@ class DRDAConnThread extends Thread {", "removed": [ "\t\t\t\tSQLWarning w = new SQLWarning(null, SQLState.ROW_DELETED," ] } ] } ]
derby-DERBY-1377-0cc1b092
DERBY-1377: (Partial) - Dag's changes to sql/execute/rts git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429839 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/execute/rts/RunTimeStatisticsImpl.java", "hunks": [ { "added": [ " 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" ], "header": "@@ -2,11 +2,12 @@", "removed": [ " Copyright 1998, 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" ] } ] } ]
derby-DERBY-1377-11bc2d08
DERBY-1377: (Partial). Inserted license headers to .jj files and updated java files for the tools/ij subdirectory. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429500 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/tools/org/apache/derby/impl/tools/ij/xaHelper.java", "hunks": [ { "added": [ " 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" ], "header": "@@ -2,11 +2,12 @@", "removed": [ " Copyright 1999, 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" ] } ] } ]
derby-DERBY-1377-15651f53
DERBY-1377 (partial): update license headers on functionTests files outside of the tests directory. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429889 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/functionTests/util/metadataHelperProcs.java", "hunks": [ { "added": [ " 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" ], "header": "@@ -2,11 +2,12 @@", "removed": [ " Copyright 2004, 2005 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" ] } ] } ]
derby-DERBY-1377-1d8e53f6
DERBY-1377: (Partial) - Dag's mods to iapi/error git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429922 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/error/StandardException.java", "hunks": [ { "added": [ " 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" ], "header": "@@ -2,11 +2,12 @@", "removed": [ " Copyright 1997, 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" ] } ] } ]
derby-DERBY-1377-20cdca37
DERBY-1377 (Partial) - Fix license headers for the dblook subdirectory. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429734 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/tools/org/apache/derby/impl/tools/dblook/Logs.java", "hunks": [ { "added": [ " 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" ], "header": "@@ -2,11 +2,12 @@", "removed": [ " Copyright 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" ] } ] } ]
derby-DERBY-1377-22c1b9ca
DERBY-1377: (partial) - Dag's changes for sql/depend git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429830 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/depend/DepClassInfo.java", "hunks": [ { "added": [ " 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" ], "header": "@@ -2,11 +2,12 @@", "removed": [ " Copyright 2000, 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" ] } ] } ]
derby-DERBY-1377-23683f1d
DERBY-1377 (partial): update license headers for plugins subdirectory. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429773 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "plugins/eclipse/org.apache.derby.ui/src/org/apache/derby/ui/popup/actions/AddDerbyNature.java", "hunks": [ { "added": [ "", "\tDerby - Class org.apache.derby.ui.popup.actions.AddDerbyNature", "", "\tLicensed to the Apache Software Foundation (ASF) under one or more", "\tcontributor license agreements. See the NOTICE file distributed with", "\tthis work for additional information regarding copyright ownership.", "\tThe ASF licenses this file to you under the Apache License, Version 2.0", "\t(the \"License\"); you may not use this file except in compliance with", "\tthe License. You may obtain a copy of the License at", "\t", "\t http://www.apache.org/licenses/LICENSE-2.0", "\t", "\tUnless required by applicable law or agreed to in writing, software", "\tdistributed under the License is distributed on an \"AS IS\" BASIS,", "\tWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", "\tSee the License for the specific language governing permissions and", "\tlimitations under the License.", "", "*/" ], "header": "@@ -1,23 +1,23 @@", "removed": [ " * ", " * Derby - Class org.apache.derby.ui.popup.actions.AddDerbyNature", " * ", " * 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.", " * ", " */" ] } ] }, { "file": "plugins/eclipse/org.apache.derby.ui/src/org/apache/derby/ui/util/SelectionUtil.java", "hunks": [ { "added": [ "\tLicensed to the Apache Software Foundation (ASF) under one or more", "\tcontributor license agreements. See the NOTICE file distributed with", "\tthis work for additional information regarding copyright ownership.", "\tThe ASF licenses this file to you under the Apache License, Version 2.0", "\t(the \"License\"); you may not use this file except in compliance with", "\tthe License. You may obtain a copy of the License at" ], "header": "@@ -2,11 +2,12 @@", "removed": [ "\tCopyright 2002, 2004 The Apache Software Foundation or its licensors, as applicable.", "\t", "\tLicensed under the Apache License, Version 2.0 (the \"License\");", "\tyou may not use this file except in compliance with the License.", "\tYou may obtain a copy of the License at" ] } ] } ]
derby-DERBY-1377-270a34de
DERBY-1377: Rototill tree under java/engine/org/apache/derby/impl/store/ git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429802 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/store/raw/xact/XactXAResourceManager.java", "hunks": [ { "added": [ " 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" ], "header": "@@ -2,11 +2,12 @@", "removed": [ " Copyright 1999, 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" ] } ] } ]
derby-DERBY-1377-2dd2d112
DERBY-1377: (Partial) Dag's changes to iapi/sql/execute git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429920 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/sql/execute/TupleFilter.java", "hunks": [ { "added": [ " 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" ], "header": "@@ -2,11 +2,12 @@", "removed": [ " Copyright 1998, 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" ] } ] } ]
derby-DERBY-1377-2e658c29
DERBY-1377: (Partial) - Dag's adjustments to iapi/sql/dictionary git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429918 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/ViewDescriptor.java", "hunks": [ { "added": [ " 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" ], "header": "@@ -2,11 +2,12 @@", "removed": [ " Copyright 1997, 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" ] } ] } ]
derby-DERBY-1377-3dc2ce45
DERBY-1377 (partial): Update the rest of the files in java/tools. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429860 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/tools/org/apache/derby/tools/sysinfo.java", "hunks": [ { "added": [ " 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" ], "header": "@@ -2,11 +2,12 @@", "removed": [ " Copyright 1998, 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" ] } ] } ]
derby-DERBY-1377-4ecc65a1
DERBY-1377 (partial): cleanup a couple of missed files, insert proper license header into the generated ClassSizeCrawler.java git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@430149 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1377-575d6a11
DERBY-1377: (Partial) Dag's changes to impl/sql/conn for the license header git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429828 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/conn/TempTableInfo.java", "hunks": [ { "added": [ " 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" ], "header": "@@ -2,11 +2,12 @@", "removed": [ " Copyright 2003, 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" ] } ] } ]
derby-DERBY-1377-59bf37d1
DERBY-1377 (partial): Update license headers for client git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429795 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/client/org/apache/derby/jdbc/ClientXADataSource40.java", "hunks": [ { "added": [ " 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" ], "header": "@@ -2,11 +2,12 @@", "removed": [ " Copyright (c) 2006 The Apache Software Foundation or its licensors, where 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" ] } ] } ]
derby-DERBY-1377-666eb9fe
DERBY-1377: (Partial) - Dag's changes to iapi/sql/depend git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429914 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/sql/depend/ProviderList.java", "hunks": [ { "added": [ " 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" ], "header": "@@ -2,11 +2,12 @@", "removed": [ " Copyright 1999, 2005 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" ] } ] } ]
derby-DERBY-1377-6baf18bb
DERBY-1377: Rototill tree under java/engine/org/apache/derby/iapi/services/ git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429811 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/services/uuid/UUIDFactory.java", "hunks": [ { "added": [ " 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" ], "header": "@@ -2,11 +2,12 @@", "removed": [ " Copyright 1998, 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" ] } ] } ]
derby-DERBY-1377-6d913c60
DERBY-1377 (partial): Update license headers in impl/load git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429897 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/execute/SqlXmlExecutor.java", "hunks": [ { "added": [ " 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" ], "header": "@@ -2,11 +2,12 @@", "removed": [ " 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" ] } ] } ]
derby-DERBY-1377-75588ca7
DERBY-1377: (Partial) - Dag's mods to iapi/sql/conn git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429867 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/sql/conn/StatementContext.java", "hunks": [ { "added": [ " 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" ], "header": "@@ -2,11 +2,12 @@", "removed": [ " Copyright 1997, 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" ] } ] } ]
derby-DERBY-1377-75c7276a
DERBY-1377: Rototill tree under java/engine/org/apache/derby/iapi/store/ git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429816 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/store/raw/xact/TransactionId.java", "hunks": [ { "added": [ " 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" ], "header": "@@ -2,11 +2,12 @@", "removed": [ " Copyright 1998, 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" ] } ] } ]
derby-DERBY-1377-93fea347
DERBY-1377: Rototilled tree under java/engine/org/apache/derby/impl/services/ git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429794 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/services/uuid/BasicUUIDGetter.java", "hunks": [ { "added": [ " 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" ], "header": "@@ -2,11 +2,12 @@", "removed": [ " Copyright 2000, 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" ] } ] } ]
derby-DERBY-1377-9a7cd7e8
DERBY-1377: (Partial) Updated the tools/sysinfo directory to use the new license header git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429515 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/tools/org/apache/derby/impl/tools/sysinfo/ZipInfoProperties.java", "hunks": [ { "added": [ " 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" ], "header": "@@ -2,11 +2,12 @@", "removed": [ " Copyright 1998, 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" ] } ] } ]
derby-DERBY-1377-b3ef6b5b
DERBY-1377: Rototill java/shared/org/apache/derby/shared/common/error/ git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429771 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/shared/org/apache/derby/shared/common/error/ExceptionUtil.java", "hunks": [ { "added": [ " 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" ], "header": "@@ -1,11 +1,12 @@", "removed": [ " Copyright 2005 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" ] } ] } ]
derby-DERBY-1377-c38b8415
DERBY-1377: Update license headers in org.apache.derbyTesting.unitTests git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429812 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/unitTests/util/MsgTrace.java", "hunks": [ { "added": [ " 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" ], "header": "@@ -2,11 +2,12 @@", "removed": [ " Copyright 1998, 2005 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" ] } ] } ]
derby-DERBY-1377-d4580ab6
DERBY-1377: (Partial) Dag's updates to iapi/sql/compile git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429863 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/sql/compile/Visitor.java", "hunks": [ { "added": [ " 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" ], "header": "@@ -2,11 +2,12 @@", "removed": [ " Copyright 1998, 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" ] } ] } ]
derby-DERBY-1377-de243e0f
DERBY-1377: (Partial) - Updated license headers for the build subtree. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429495 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/build/org/apache/derbyBuild/splitmessages.java", "hunks": [ { "added": [ " 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" ], "header": "@@ -2,11 +2,12 @@", "removed": [ " Copyright 2000, 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" ] } ] } ]
derby-DERBY-1377-dff95a18
DERBY-1377: Fix license headers on remaining java files. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@430143 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1377-f6123eea
DERBY-1377: (Partial) - Dag's changes to sql/execute git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@429838 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/execute/WriteCursorConstantAction.java", "hunks": [ { "added": [ " 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" ], "header": "@@ -2,11 +2,12 @@", "removed": [ " Copyright 1997, 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" ] } ] } ]
derby-DERBY-1379-e1e03892
DERBY-1379: Committed Olav's autoload.diff. This fixes the problem which caused all of the nist tests to fail when derbyall was run against jar files under jdk1.6 with the db2jcc jar in the classpath. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@412859 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/functionTests/harness/RunList.java", "hunks": [ { "added": [ "import java.sql.DriverManager;", "import java.sql.SQLException;", "" ], "header": "@@ -42,6 +42,9 @@ import java.util.Enumeration;", "removed": [] }, { "added": [ " // Due to autoloading of JDBC drivers introduced in JDBC4", " // (see DERBY-930) the embedded driver and Derby engine", " // might already have been loaded. To ensure that the", " // embedded driver and engine used by the tests run in", " // this suite are configured to use the correct", " // property values we try to unload the embedded driver", " if (useprocess == false) {", " unloadEmbeddedDriver();", " }", "" ], "header": "@@ -263,6 +266,16 @@ public class RunList", "removed": [] }, { "added": [ "", " /**", " * Unloads the embedded JDBC driver and Derby engine in case", " * is has already been loaded. ", " * The purpose for doing this is that using an embedded engine", " * that already is loaded makes it impossible to set new ", " * system properties for each individual suite or test.", " */", " private static void unloadEmbeddedDriver() {", " // Attempt to unload the embedded driver and engine", " try {", " DriverManager.getConnection(\"jdbc:derby:;shutdown=true\");", " } catch (SQLException se) {", " // Ignore any exception thrown", " }", "", " // Call the garbage collector as spesified in the Derby doc", " // for how to get rid of the classes that has been loaded", " System.gc();", " }" ], "header": "@@ -1609,5 +1622,25 @@ public class RunList", "removed": [] } ] } ]
derby-DERBY-1380-7c3b39d5
DERBY-1380: Commit Dyre's derby-1380,v1.diff patch, which makes it possible to connect to Derby databases when running under build 86 of jdk1.6. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@412204 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/client/org/apache/derby/client/am/FailedProperties40.java", "hunks": [ { "added": [ "import java.util.Map;", "import java.util.HashMap;", "import java.sql.SQLClientInfoException;", "import java.sql.ClientInfoStatus;", " * <code>java.sql.SQLClientInfoException</code>. It provides", " * @see java.sql.SQLClientInfoException", " private final HashMap<String,ClientInfoStatus> failedProps_ = ", "\tnew HashMap<String,ClientInfoStatus>();", "", "", " /**", " * Helper method that creates a Propery object with the name-value", " * pair given as arguments.", " * @param name property key", " * @param value property value", " * @return the created <code>Properties</code> object", " */", " public static Properties makeProperties(String name, String value) {", "\tProperties p = new Properties();", " if (name != null || value != null)", " p.setProperty(name, value);", "\treturn p;", " }" ], "header": "@@ -22,21 +22,40 @@ package org.apache.derby.client.am;", "removed": [ "import java.sql.ClientInfoException;", " * <code>java.sql.ClientInfoException</code>. It provides", " * @see java.sql.ClientInfoException", " private final Properties failedProps_ = new Properties();" ] }, { "added": [ " failedProps_.put(firstKey_, ClientInfoStatus.REASON_UNKNOWN_PROPERTY);", " failedProps_.put((String)e.nextElement(), ", " ClientInfoStatus.REASON_UNKNOWN_PROPERTY);", " * <code>getProperties</code> provides a", " * <code>Map<String,ClientInfoStatus></code> object describing the", " * failed properties (as specified in the javadoc for", " * java.sql.SQLClientInfoException).", " * @return a <code>Map<String,ClientInfoStatus></code> object with", " * the failed property keys and the reason why each failed", " public Map<String,ClientInfoStatus> getProperties() { return failedProps_; }", " * when SQLClientInfoException is thrown with a parameterized error" ], "header": "@@ -56,28 +75,27 @@ public class FailedProperties40 {", "removed": [ " failedProps_.setProperty(firstKey_, \"\"+ClientInfoException.", " REASON_UNKNOWN_PROPERTY);", " failedProps_.setProperty((String)e.nextElement(), ", " \"\"+ClientInfoException.", " REASON_UNKNOWN_PROPERTY);", " * <code>getProperties</code> provides a <code>Properties</code>", " * object describing the failed properties (as specified in the", " * javadoc for java.sql.ClientInfoException).", " * @return a <code>Properties</code> object with the failed", " * property keys and the reason why each failed", " public Properties getProperties() { return failedProps_; }", " * when ClientInfoException is thrown with a parameterized error" ] } ] }, { "file": "java/client/org/apache/derby/client/am/LogicalConnection40.java", "hunks": [ { "added": [ "import java.sql.SQLClientInfoException;" ], "header": "@@ -23,7 +23,7 @@ package org.apache.derby.client.am;", "removed": [ "import java.sql.ClientInfoException;" ] }, { "added": [ " public Array createArrayOf(String typeName, Object[] elements)", " return physicalConnection_.createArrayOf( typeName, elements );" ], "header": "@@ -52,10 +52,10 @@ public class LogicalConnection40", "removed": [ " public Array createArray(String typeName, Object[] elements)", " return physicalConnection_.createArray( typeName, elements );" ] }, { "added": [ " * @exception SQLClientInfoException if an error occurs", " throws SQLClientInfoException {", "\t throw new SQLClientInfoException" ], "header": "@@ -172,13 +172,13 @@ public class LogicalConnection40", "removed": [ " * @exception ClientInfoException if an error occurs", " throws ClientInfoException {", "\t throw new ClientInfoException" ] } ] }, { "file": "java/client/org/apache/derby/client/net/NetConnection40.java", "hunks": [ { "added": [ "import java.sql.SQLClientInfoException;" ], "header": "@@ -26,7 +26,7 @@ import java.sql.QueryObjectFactory;", "removed": [ "import java.sql.ClientInfoException;" ] }, { "added": [ " public Array createArrayOf(String typeName, Object[] elements)", " throw SQLExceptionFactory.notImplemented (\"createArrayOf(String,Object[])\");" ], "header": "@@ -128,9 +128,9 @@ public class NetConnection40 extends org.apache.derby.client.net.NetConnection", "removed": [ " public Array createArray(String typeName, Object[] elements)", " throw SQLExceptionFactory.notImplemented (\"createArray(String,Object[])\");" ] }, { "added": [ " * <code>SQLClientInfoException</code> since Derby does not support" ], "header": "@@ -268,7 +268,7 @@ public class NetConnection40 extends org.apache.derby.client.net.NetConnection", "removed": [ " * <code>ClientInfoException</code> since Derby does not support" ] }, { "added": [ " throws SQLClientInfoException{", " Properties p = FailedProperties40.makeProperties(name,value); ", "\tcatch (SqlException se) {", " throw new SQLClientInfoException", " (se.getMessage(), se.getSQLState(), ", " new FailedProperties40(p).getProperties());", " }", " * <code>SQLClientInfoException</code> uless the <code>properties</code>" ], "header": "@@ -276,21 +276,24 @@ public class NetConnection40 extends org.apache.derby.client.net.NetConnection", "removed": [ " throws SQLException{", "\tcatch (SqlException se) { throw se.getSQLException(); }", " Properties p = new Properties();", " p.setProperty(name, value);", " * <code>ClientInfoException</code> uless the <code>properties</code>" ] }, { "added": [ " * @exception SQLClientInfoException unless the properties", " * parameter is null or empty.", " throws SQLClientInfoException {", "\t throw new SQLClientInfoException(se.getMessage(), se.getSQLState()," ], "header": "@@ -299,14 +302,15 @@ public class NetConnection40 extends org.apache.derby.client.net.NetConnection", "removed": [ " * @exception ClientInfoException always.", " throws ClientInfoException {", "\t throw new ClientInfoException(se.getMessage(), se.getSQLState()," ] } ] }, { "file": "java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection40.java", "hunks": [ { "added": [ "import java.sql.SQLClientInfoException;" ], "header": "@@ -24,7 +24,7 @@ import java.sql.Array;", "removed": [ "import java.sql.ClientInfoException;" ] }, { "added": [ " public Array createArrayOf(String typeName, Object[] elements)", " return getRealConnection().createArrayOf (typeName, elements);" ], "header": "@@ -42,10 +42,10 @@ public class BrokeredConnection40 extends BrokeredConnection30 {", "removed": [ " public Array createArray(String typeName, Object[] elements)", " return getRealConnection().createArray (typeName, elements);" ] } ] }, { "file": "java/engine/org/apache/derby/iapi/jdbc/FailedProperties40.java", "hunks": [ { "added": [ "import java.util.Map;", "import java.util.HashMap;", "import java.sql.SQLClientInfoException;", "import java.sql.ClientInfoStatus;", " * SQLClientInfoException. It provides convenient access to data", " * that is needed when constructing SQLClientInfoExceptions. Should", " * @see java.sql.SQLClientInfoException", " private final HashMap<String,ClientInfoStatus> failedProps_ = ", "\tnew HashMap<String,ClientInfoStatus>();", "", " /**", " * Helper method that creates a Propery object from the name-value", " * pair given as arguments.", " * @param name property key", " * @param value property value", " * @return the created <code>Properties</code> object", " */", " public static Properties makeProperties(String name, String value) {", "\tProperties p = new Properties();", "\tif (name != null || value != null)", "\t p.setProperty(name, value);", "\treturn p;", " }" ], "header": "@@ -22,21 +22,39 @@ package org.apache.derby.iapi.jdbc;", "removed": [ "import java.sql.ClientInfoException;", " * ClientInfoException. It provides convenient access to data", " * that is needed when constructing ClientInfoExceptions. Should", " private final Properties failedProps_ = new Properties();", " " ] }, { "added": [ " failedProps_.put(firstKey_, ClientInfoStatus.REASON_UNKNOWN_PROPERTY);", " failedProps_.put((String)e.nextElement(), ", "\t\t\t ClientInfoStatus.REASON_UNKNOWN_PROPERTY);", " * <code>getProperties</code> provides a", " * <code>Map<String,ClientInfoStatus></code> object describing the", " * failed properties (as specified in the javadoc for", " * java.sql.SQLClientInfoException).", " * @return a <code>Map<String,ClientInfoStatus></code> object with", " * the failed property keys and the reason why each failed", " public Map<String,ClientInfoStatus> getProperties() { return failedProps_; }", " * when SQLClientInfoException is thrown with a parameterized error" ], "header": "@@ -55,28 +73,27 @@ public class FailedProperties40 {", "removed": [ " failedProps_.setProperty(firstKey_, \"\"+ClientInfoException.", " REASON_UNKNOWN_PROPERTY);", " failedProps_.setProperty((String)e.nextElement(), ", " \"\"+ClientInfoException.", " REASON_UNKNOWN_PROPERTY);", " * <code>getProperties</code> provides a <code>Properties</code>", " * object describing the failed properties (as specified in the", " * javadoc for java.sql.ClientInfoException).", " * @return a <code>Properties</code> object with the failed", " * property keys and the reason why each failed", " public Properties getProperties() { return failedProps_; }", " * when ClientInfoException is thrown with a parameterized error" ] } ] }, { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedConnection40.java", "hunks": [ { "added": [ "import java.sql.SQLClientInfoException;" ], "header": "@@ -23,7 +23,7 @@ package org.apache.derby.impl.jdbc;", "removed": [ "import java.sql.ClientInfoException;" ] }, { "added": [ " public Array createArrayOf(String typeName, Object[] elements)" ], "header": "@@ -60,7 +60,7 @@ public class EmbedConnection40 extends EmbedConnection30 {", "removed": [ " public Array createArray(String typeName, Object[] elements)" ] }, { "added": [ " * <code>SQLClientInfoException</code> since Derby does not support", " * @exception SQLClientInfoException unless both name and value are null", " throws SQLClientInfoException{", " Properties p = FailedProperties40.makeProperties(name,value);", " try { checkIfClosed(); }", " catch (SQLException se) {", " FailedProperties40 fp = new FailedProperties40(p);", " throw new SQLClientInfoException(se.getMessage(), ", " se.getSQLState(), ", " fp.getProperties());", " }", " * <code>SQLClientInfoException</code> uless the <code>properties</code>" ], "header": "@@ -141,30 +141,35 @@ public class EmbedConnection40 extends EmbedConnection30 {", "removed": [ " * <code>ClientInfoException</code> since Derby does not support", " * @exception SQLException always.", " throws SQLException{", " checkIfClosed();", " Properties p = new Properties();", " p.setProperty(name, value);", " * <code>ClientInfoException</code> uless the <code>properties</code>" ] }, { "added": [ " * @exception SQLClientInfoException unless properties parameter", " * is null or empty", " throws SQLClientInfoException {", " throw new SQLClientInfoException(se.getMessage(), se.getSQLState(),", " fp.getProperties());" ], "header": "@@ -173,16 +178,17 @@ public class EmbedConnection40 extends EmbedConnection30 {", "removed": [ " * @exception ClientInfoException always", " throws ClientInfoException {", " throw new ClientInfoException(se.getMessage(), se.getSQLState(),", " fp.getProperties());" ] } ] } ]
derby-DERBY-1380-8a44c0f3
DERBY-1380: derby-1380.v2.diff, adding new overloads for createQueryObject(). git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@412239 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/client/org/apache/derby/client/net/NetConnection40.java", "hunks": [ { "added": [ "import java.sql.Connection;" ], "header": "@@ -28,6 +28,7 @@ import org.apache.derby.client.am.SqlException;", "removed": [] } ] }, { "file": "java/client/org/apache/derby/jdbc/ClientConnectionPoolDataSource40.java", "hunks": [ { "added": [ "import javax.sql.DataSource;" ], "header": "@@ -24,6 +24,7 @@ import java.sql.BaseQuery;", "removed": [] } ] }, { "file": "java/client/org/apache/derby/jdbc/ClientDataSource40.java", "hunks": [ { "added": [ "import javax.sql.DataSource;" ], "header": "@@ -24,6 +24,7 @@ import java.sql.BaseQuery;", "removed": [] } ] }, { "file": "java/client/org/apache/derby/jdbc/ClientXADataSource40.java", "hunks": [ { "added": [ "import javax.sql.DataSource;" ], "header": "@@ -24,6 +24,7 @@ import java.sql.BaseQuery;", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection40.java", "hunks": [ { "added": [ "import java.sql.Connection;" ], "header": "@@ -24,6 +24,7 @@ import java.sql.Array;", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedConnection40.java", "hunks": [ { "added": [ "import java.sql.Connection;" ], "header": "@@ -25,6 +25,7 @@ import java.sql.BaseQuery;", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/jdbc/EmbeddedConnectionPoolDataSource40.java", "hunks": [ { "added": [ "import javax.sql.DataSource;" ], "header": "@@ -24,6 +24,7 @@ import java.sql.QueryObjectFactory;", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/jdbc/EmbeddedDataSource40.java", "hunks": [ { "added": [ "import javax.sql.DataSource;", "import org.apache.derby.impl.jdbc.Util;" ], "header": "@@ -23,9 +23,10 @@ package org.apache.derby.jdbc;", "removed": [ "import org.apache.derby.impl.jdbc.Util;" ] } ] }, { "file": "java/engine/org/apache/derby/jdbc/EmbeddedXADataSource40.java", "hunks": [ { "added": [ "import javax.sql.DataSource;" ], "header": "@@ -26,6 +26,7 @@ import java.sql.QueryObjectGenerator;", "removed": [] } ] } ]
derby-DERBY-1382-5fc38c4d
DERBY-1382 lobs fail silently with result sets of type TYPE_SCROLL_INSENSITIVE in client jdbc driver. Contributed by Fernanda Pizzorno. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@414165 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/client/org/apache/derby/client/net/NetCursor.java", "hunks": [ { "added": [], "header": "@@ -128,10 +128,6 @@ public class NetCursor extends org.apache.derby.client.am.Cursor {", "removed": [ " if (hasLobs_) {", " extdtaPositions_.clear(); // reset positions for this row", " }", "" ] } ] } ]
derby-DERBY-1386-c1bc7429
DERBY-1386: Wrong results with query using LIKE and ESCAPE clause that includes "%", "\", and "_" Queries using LIKE/ESCAPE could return wrong results if the first wildcard character was preceded by an even number of escape characters. This patch fixes the issue by changing the way Like.lessThanString() parses the pattern string. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@413123 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/types/Like.java", "hunks": [ { "added": [], "header": "@@ -852,58 +852,6 @@ public class Like {", "removed": [ "\t/**", "\t * Return the substring from the pattern for the < clause.", "\t * (NOTE: This may be null in the degenerate case where the", "\t * last char before the first wild card can't be incremented.)", "\t *", "\t *\t\tOptimized for ESCAPE", "\t *", "\t * This function uses the greaterThanString, and bumps its last", "\t * character by one. This string has no escape characters, they", "\t * were stripped out, and ends just before any real pattern chars or", "\t * at the end of the pattern literal. See LikeEscapeOp*Node.preprocess.", "\t *", "\t * @param pattern\tThe right side of the LIKE", "\t * @param maxWidth\tMaximum length of column, for null padding", "\t *", "\t * @return\tThe String for the < clause", "\t * @exception StandardException thrown if data invalid", "\t */", "\tpublic static String lessThanString(String pattern, int maxWidth)", "\t\tthrows StandardException", "\t{", "\t\t//int\t\tfirstAnyChar = pattern.indexOf(anyChar);", "\t\t//int\t\tfirstAnyString = pattern.indexOf(anyString);", "\t\tint\t\tlastUsableChar;", "\t\tint\t\tpatternLen;", "\t\tchar\toldLastChar;", "\t\tchar\tnewLastChar;", "\t\tchar[]\tcharArray;", "", "\t\tif ((patternLen = pattern.length()) == 0)", "\t\t{", "\t\t\t// pattern is \"\"", "\t\t\treturn null;", "\t\t}", "\t\t", "\t\tlastUsableChar = patternLen -1;", "\t\toldLastChar = pattern.charAt(lastUsableChar);", "\t\tnewLastChar = oldLastChar;", "\t\tnewLastChar++;", "", "\t\t// Check for degenerate roll over", "\t\tif (newLastChar < oldLastChar)", "\t\t{", "\t\t\treturn null;", "\t\t}", "", "\t\tcharArray = pattern.substring(0, lastUsableChar + 1).toCharArray();", "\t\tcharArray[lastUsableChar] = newLastChar;", "", "\t\treturn padWithNulls(new String(charArray), maxWidth);", "\t}", "" ] }, { "added": [ "\t * (NOTE: This may be null if the pattern is an empty string.)" ], "header": "@@ -922,11 +870,7 @@ public class Like {", "removed": [ "\t * (NOTE: This may be null in the degenerate case where the", "\t * last char before the first wild card can't be incremented.)", "\t *", "\t * \t\tThis is unoptimized for ESCAPE.", "\t *" ] }, { "added": [ "\t\tfinal int escChar;", "\t\tif (pattern.length() == 0)" ], "header": "@@ -939,13 +883,11 @@ public class Like {", "removed": [ "\t\tint\t\tpatternLen;", "\t\tchar[]\tcharArray;", "\t\tchar escChar = 'a';", "\t\tif ((patternLen = pattern.length()) == 0)" ] }, { "added": [ "\t\telse {", "\t\t\t// Set escape character to a value outside the char range,", "\t\t\t// so that comparison with a char always evaluates to false.", "\t\t\tescChar = -1;", "\t\t}" ], "header": "@@ -955,6 +897,11 @@ public class Like {", "removed": [] }, { "added": [ "\t\t *\t\"\"\t\t\t\tnull", "\t\tStringBuffer upperLimit = new StringBuffer(maxWidth);", "\t\t// Extract the string leading up to the first wildcard.", "\t\tfor (int i = 0; i < pattern.length(); i++) {", "\t\t\tchar c = pattern.charAt(i);", "\t\t\tif (c == escChar) {", "\t\t\t\tif (++i >= pattern.length()) {", "\t\t\t\t\tthrow StandardException.newException(", "\t\t\t\t\t\t\tSQLState.LANG_INVALID_ESCAPE_SEQUENCE);", "\t\t\t\t}", "\t\t\t\tc = pattern.charAt(i);", "\t\t\t} else if (c == anyChar || c == anyString) {", "\t\t\t\tbreak;", "\t\t\tupperLimit.append(c);", "\t\t// Pattern starts with wildcard.", "\t\tif (upperLimit.length() == 0) {", "\t\t\treturn SUPER_STRING;", "\t\t// Increment the last non-wildcard character.", "\t\tlastUsableChar = upperLimit.length() - 1;", "\t\toldLastChar = upperLimit.charAt(lastUsableChar);" ], "header": "@@ -963,64 +910,37 @@ public class Like {", "removed": [ "\t\t *\t\"\"\t\t\t\tSUPER_STRING (match against super string)", "\t\tint\t\tfirstAnyChar = pattern.indexOf(anyChar);", "\t\tint\t\tfirstAnyString = pattern.indexOf(anyString);", "", "\t\tif (escape != null)", "\t\t{", "\t\t\twhile (firstAnyChar > 0 && pattern.charAt(firstAnyChar-1) == escChar)", "\t\t\t\tfirstAnyChar = pattern.indexOf(anyChar, firstAnyChar+1);", "\t\t\twhile (firstAnyString > 0 && pattern.charAt(firstAnyString-1) == escChar)", "\t\t\t\tfirstAnyString = pattern.indexOf(anyString, firstAnyString+1);", "\t\t}", "", "\t\tif (firstAnyChar == -1)", "\t\t{", "\t\t\tif (firstAnyString == -1)", "\t\t\t{", "\t\t\t\tlastUsableChar = pattern.length() -1;", "\t\t\t}", "\t\t\telse if (firstAnyString == 0)", "\t\t\t{", "\t\t\t\t// pattern is \"%\"", "\t\t\t\treturn SUPER_STRING;", "\t\t\t}", "\t\t\telse", "\t\t\t{", "\t\t\t\tlastUsableChar = firstAnyString - 1;", "\t\t\t}", "\t\t}", "\t\telse if (firstAnyString == -1)", "\t\t{", "\t\t\tif (firstAnyChar == 0)", "\t\t\t{", "\t\t\t\t// pattern is \"_\"", "\t\t\t\treturn SUPER_STRING;", "\t\t\tlastUsableChar = firstAnyChar - 1;", "\t\telse", "\t\t{", "\t\t\t// both _ and % present", "\t\t\tlastUsableChar = ((firstAnyChar > firstAnyString) ? ", "\t\t\t\t\t\t\t\t\t\tfirstAnyString :", "\t\t\t\t\t\t\t\t\t\tfirstAnyChar) - 1;", "\t\t\tif (lastUsableChar == -1)", "\t\t\t{", "\t\t\t\t// pattern starts with a wildcard", "\t\t\t\treturn SUPER_STRING;", "\t\t\t}", "\t\toldLastChar = pattern.charAt(lastUsableChar);" ] } ] } ]
derby-DERBY-1387-5b508872
DERBY-1387 Make the registration of MBeans with JMX robust in the case of permission issues. Stops a hang in derbynet._Suite where a network server was booted with insufficient permissions for MBeans. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@636583 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java", "hunks": [ { "added": [ " // Ignoring inability to create or", " // find the mbean server. MBeans can continue", " // to be registered with this service and", " // startMangement() can be called to get", " // them registered with JMX if someone else", " // starts the MBean server." ], "header": "@@ -175,9 +175,12 @@ public final class JMXManagementService implements ManagementService, ModuleCont", "removed": [ " // TODO: just ignoring inability to create or", " // find the mbean server.", " // or should an error or warning be raised?" ] }, { "added": [ " // Already registered? Can happen if we don't have permission", " // to unregister the MBeans.", " if (mbeanServer.isRegistered(beanName))", " return;", " " ], "header": "@@ -240,6 +243,11 @@ public final class JMXManagementService implements ManagementService, ModuleCont", "removed": [] }, { "added": [ " } catch (SecurityException se) {", " // If we can't register the MBean then so be it.", " // The application can later enabled the MBeans", " // by using org.apache.derby.mbeans.Management" ], "header": "@@ -254,6 +262,10 @@ public final class JMXManagementService implements ManagementService, ModuleCont", "removed": [] }, { "added": [ " } catch (SecurityException se) {", " // Can't unregister the MBean we registered due to permission", " // problems, oh-well just leave it there. We are fail-safe", " // if we attempt to re-register it." ], "header": "@@ -312,6 +324,10 @@ public final class JMXManagementService implements ManagementService, ModuleCont", "removed": [] } ] } ]
derby-DERBY-1387-5c4e302b
DERBY-1387 Expose an api in ManagementService to register and unregister Mbeans. Use this for a simple JDBCMBean that reports some information about the JDBC driver. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@627877 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/services/jmx/ManagementService.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.error.StandardException;", "" ], "header": "@@ -17,6 +17,8 @@", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java", "hunks": [ { "added": [ "import javax.management.InstanceNotFoundException;" ], "header": "@@ -26,6 +26,7 @@ import java.util.HashSet;", "removed": [] }, { "added": [ " unregisterMBean(mbeanName);" ], "header": "@@ -83,11 +84,7 @@ public class JMXManagementService implements ManagementService, ModuleControl {", "removed": [ " try {", " unregisterMBean(mbeanName);", " } catch (StandardException e) {", " // TODO: what to do here?", " }" ] }, { "added": [ " \"type=Version,jar=derby.jar\");" ], "header": "@@ -111,7 +108,7 @@ public class JMXManagementService implements ManagementService, ModuleControl {", "removed": [ " \"org.apache.derby:type=Version,jar=derby.jar\");" ] }, { "added": [ " * @param nameAttributes The String representation of the MBean's attrributes,", " * they will be added into the ObjectName with Derby's domain", " public synchronized Object registerMBean(final Object bean,", " final String nameAttributes)", " return null;", " final ObjectName beanName = new ObjectName(", " DERBY_JMX_DOMAIN + \":\" + nameAttributes);" ], "header": "@@ -130,19 +127,21 @@ public class JMXManagementService implements ManagementService, ModuleControl {", "removed": [ " * @param name The String representation of the MBean's object name.", " private synchronized void registerMBean(final Object bean,", " final String name)", " return;", " final ObjectName beanName = new ObjectName(name);" ] }, { "added": [ " return beanName;" ], "header": "@@ -158,6 +157,7 @@ public class JMXManagementService implements ManagementService, ModuleControl {", "removed": [] }, { "added": [ " /**", " * Unregister an mbean using an object previous returned", " * from registerMBean.", " */", " public void unregisterMBean(Object mbeanIdentifier)", " {", " if (mbeanIdentifier == null)", " return;", " unregisterMBean((ObjectName) mbeanIdentifier);", " }", " " ], "header": "@@ -167,13 +167,22 @@ public class JMXManagementService implements ManagementService, ModuleControl {", "removed": [ " * @throws StandardException", " throws StandardException" ] } ] }, { "file": "java/engine/org/apache/derby/jdbc/InternalDriver.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.services.jmx.ManagementService;" ], "header": "@@ -36,6 +36,7 @@ import org.apache.derby.iapi.services.context.ContextManager;", "removed": [] }, { "added": [ "import org.apache.derby.mbeans.JDBCMBean;" ], "header": "@@ -43,6 +44,7 @@ import org.apache.derby.iapi.jdbc.AuthenticationService;", "removed": [] }, { "added": [ " ", " private Object mbean;" ], "header": "@@ -60,6 +62,8 @@ public abstract class InternalDriver implements ModuleControl {", "removed": [] }, { "added": [ " ", " mbean = ((ManagementService)", " Monitor.getSystemModule(ManagementService.MODULE)).registerMBean(", " new JDBC(this),", " JDBCMBean.class,", " \"type=JDBC\");" ], "header": "@@ -86,6 +90,12 @@ public abstract class InternalDriver implements ModuleControl {", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/mbeans/JDBCMBean.java", "hunks": [ { "added": [ "/*", "", " Derby - Class org.apache.derby.mbeans.JDBCMBean", "", " 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.mbeans;", "", "/** ", " * Management and information for the embedded JDBC driver.", "*/", "public interface JDBCMBean {", " ", " /**", " * Get the JDBC driver's implementation level", " */", " public String getDriverLevel();", "", " /**", " * Return the JDBC driver's major version.", " * @return major version", " * @see java.sql.Driver#getMajorVersion()", " */", " public int getMajorVersion();", " ", " /**", " * Return the JDBC driver's minor version.", " * @return minor version", " * @see java.sql.Driver#getMinorVersion()", " */", " public int getMinorVersion();", " ", " /**", " * Is the JDBC driver compliant.", " * @return compliance state", " * @see java.sql.Driver#jdbcCompliant()", " */", " public boolean isCompliantDriver();", " ", " /**", " * Does the driver accept the passed in JDBC URL", " * @param url JDBC URL to check.", " * @return True if it supports it, false otherwise.", " * @see java.sql.Driver#acceptsURL(String)", " */", " public boolean acceptsURL(String url);", "", "}" ], "header": "@@ -0,0 +1,63 @@", "removed": [] } ] } ]
derby-DERBY-1387-6597e569
DERBY-1387 (partial) Add a VersionMBean for the network server code. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@629278 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.reference.Module;", "import org.apache.derby.iapi.services.info.Version;", "import org.apache.derby.iapi.services.jmx.ManagementService;" ], "header": "@@ -62,12 +62,15 @@ import org.apache.derby.iapi.error.StandardException;", "removed": [] }, { "added": [ "import org.apache.derby.mbeans.JDBCMBean;", "import org.apache.derby.mbeans.VersionMBean;" ], "header": "@@ -76,6 +79,8 @@ import org.apache.derby.iapi.tools.i18n.LocalizedResource;", "removed": [] }, { "added": [ " ", " // Now we are up and running register any MBeans", " ManagementService mgmtService = ((ManagementService)", " Monitor.getSystemModule(Module.JMX));", " ", " Object versionMBean = mgmtService.registerMBean(", " new Version(getNetProductVersionHolder()),", " VersionMBean.class,", " \"type=Version,jar=derbynet.jar\");" ], "header": "@@ -745,6 +750,15 @@ public final class NetworkServerControlImpl {", "removed": [] }, { "added": [ "\t\t}\t", " ", " // And now unregister any MBeans.", " mgmtService.unregisterMBean(versionMBean);" ], "header": "@@ -815,7 +829,10 @@ public final class NetworkServerControlImpl {", "removed": [ "\t\t}\t\t\t\t\t\t" ] } ] } ]
derby-DERBY-1387-a3ffa1e0
DERBY-1387, DERBY-3385, DERBY-3435 Add a ManagementMBeanTest which requires some refactoring of the MBeanTest to have the JMX setup moved from VersionMBeanTest. Fix VersionMBean not to have the BuildNumberAsInt attribute and rename MaintananceVersion to match the spec and the tests. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@631372 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/services/info/Version.java", "hunks": [ { "added": [ " public int getMaintenanceVersion(){" ], "header": "@@ -63,7 +63,7 @@ public class Version implements VersionMBean {", "removed": [ " public int getMaintVersion(){" ] } ] }, { "file": "java/engine/org/apache/derby/mbeans/VersionMBean.java", "hunks": [ { "added": [ " public int getMaintenanceVersion();" ], "header": "@@ -45,7 +45,7 @@ public interface VersionMBean {", "removed": [ " public int getMaintVersion();" ] } ] } ]
derby-DERBY-1387-c970168c
DERBY-1387 (partial) Establish a pattern of registering a Derby mbean using StandardMBean. This allows the MBean interface and implementation class to be in separate packages (and if required have unrelated names). This means the public api org.apache.derby.mbeans is not forced to contain the implementation of the MBeans and thus have references to other classes that are not part of the public api. Fix the build order for o.a.d.mbeans to be early since it does not depend on internal classes and should not require JDK 1.5. Added a version string attribute to the VersionMBean that shows the full version. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@627131 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/services/info/Version.java", "hunks": [ { "added": [ " Derby - Class org.apache.derby.iapi.services.info.Version" ], "header": "@@ -1,6 +1,6 @@", "removed": [ " Derby - Class org.apache.derby.mbeans.Version" ] }, { "added": [ "package org.apache.derby.iapi.services.info;", "import org.apache.derby.mbeans.VersionMBean;" ], "header": "@@ -19,9 +19,9 @@", "removed": [ "package org.apache.derby.mbeans;", "import org.apache.derby.iapi.services.info.ProductVersionHolder;" ] } ] }, { "file": "java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java", "hunks": [ { "added": [ "import javax.management.StandardMBean;", "import org.apache.derby.iapi.services.info.Version;", "import org.apache.derby.mbeans.VersionMBean;" ], "header": "@@ -29,14 +29,16 @@ import java.util.Set;", "removed": [ "import org.apache.derby.mbeans.Version;" ] }, { "added": [ " VersionMBean.class," ], "header": "@@ -108,6 +110,7 @@ public class JMXManagementService implements ManagementService, ModuleControl {", "removed": [] }, { "added": [ " * Registers an MBean with the MBean server as a StandardMBean.", " * Use of the StandardMBean allows the implementation details", " * of Derby's mbeans to be hidden from JMX, thus only exposing", " * the MBean's interface in org.apache.derby.mbeans.", " * ", " * The object name instance ", " * @param bean The MBean to wrap with a StandardMBean and register", " * @param beanInterface The management interface for the MBean.", " private synchronized void registerMBean(final Object bean,", " final Class beanInterface,", " final String name)" ], "header": "@@ -117,14 +120,22 @@ public class JMXManagementService implements ManagementService, ModuleControl {", "removed": [ " * Registers an MBean with the MBean server. The object name instance ", " * @param bean The MBean to register", " private synchronized void registerMBean(final Object bean, final String name)" ] } ] }, { "file": "java/engine/org/apache/derby/mbeans/VersionMBean.java", "hunks": [ { "added": [ "* of a running Derby component." ], "header": "@@ -23,7 +23,7 @@ package org.apache.derby.mbeans;", "removed": [ "* of the running Derby engine." ] } ] } ]
derby-DERBY-1387-e4f7f9e7
DERBY-1387 Cleanup some details of the ManagementService api based upon feedback from John Embretsen. Mainly rename 'nameAttributes' to 'keyProperties' to match JMX terminology git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@628836 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/services/jmx/ManagementService.java", "hunks": [ { "added": [ " * The mbean will be unregistered automatically when Derby shuts down.", " * @param keyProperties The String representation of the MBean's key properties,", " * they will be added into the ObjectName with Derby's domain. Key" ], "header": "@@ -47,14 +47,12 @@ public interface ManagementService extends ManagementMBean {", "removed": [ " * The object name instance ", " * represented by the given String will be created by this method.", " * The mbean will be unregistered automatically when Derby shutsdown.", " * @param nameAttributes The String representation of the MBean's attrributes,", " * they will be added into the ObjectName with Derby's domain. Attribute" ] } ] }, { "file": "java/engine/org/apache/derby/impl/services/jmxnone/NoManagementService.java", "hunks": [ { "added": [ " final String keyProperties)" ], "header": "@@ -28,7 +28,7 @@ public final class NoManagementService implements ManagementService {", "removed": [ " final String nameAttributes)" ] } ] } ]
derby-DERBY-1387-f8bc0199
DERBY-3424 (partial) Add initial apis and bean implementations for a management mbean to control Derby's JMX behaviour. Start and stop the management are present as operations but currently do nothing. Also fix a bug in DERBY-1387 where shutting down Derby would fail with jmx when multiple mbeans were registered. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@628142 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/services/jmx/ManagementService.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.reference.Module;", "import org.apache.derby.mbeans.ManagementMBean;" ], "header": "@@ -18,6 +18,8 @@", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java", "hunks": [ { "added": [ "import java.util.Collections;" ], "header": "@@ -22,6 +22,7 @@ import java.security.AccessController;", "removed": [] }, { "added": [ "import org.apache.derby.mbeans.Management;", "import org.apache.derby.mbeans.ManagementMBean;" ], "header": "@@ -39,6 +40,8 @@ import org.apache.derby.iapi.services.jmx.ManagementService;", "removed": [] }, { "added": [ " " ], "header": "@@ -53,7 +56,7 @@ public class JMXManagementService implements ManagementService, ModuleControl {", "removed": [ " " ] }, { "added": [ "", " // Need a copy of registeredMbeans since unregisterMBean will remove", " // items from registeredMbeans and thus invalidate any iterator", " // on it directly.", " for (ObjectName mbeanName : new HashSet<ObjectName>(registeredMbeans))", " ", " mbeanServer = null;" ], "header": "@@ -82,9 +85,14 @@ public class JMXManagementService implements ManagementService, ModuleControl {", "removed": [ " ", " for (ObjectName mbeanName : registeredMbeans)" ] }, { "added": [ " registerMBean(this,", " ManagementMBean.class,", " \"type=Management\");", " " ], "header": "@@ -110,6 +118,10 @@ public class JMXManagementService implements ManagementService, ModuleControl {", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.reference.Module;" ], "header": "@@ -44,6 +44,7 @@ import org.apache.derby.iapi.services.sanity.SanityManager;", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/jdbc/InternalDriver.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.reference.Module;" ], "header": "@@ -23,6 +23,7 @@", "removed": [] }, { "added": [ " Monitor.getSystemModule(Module.JMX)).registerMBean(" ], "header": "@@ -92,7 +93,7 @@ public abstract class InternalDriver implements ModuleControl {", "removed": [ " Monitor.getSystemModule(ManagementService.MODULE)).registerMBean(" ] } ] }, { "file": "java/engine/org/apache/derby/mbeans/ManagementMBean.java", "hunks": [ { "added": [ "/*", "", " Derby - Class org.apache.derby.mbeans.ManagementMBean", "", " 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.mbeans;", "", "/**", " * JMX MBean inteface to control visibility of Derby's MBeans.", " */", "public interface ManagementMBean {", " ", " /**", " * Is Derby's JMX management active. If active then Derby", " * has registered MBeans relevant to its current state.", " * @return true Derby has registered beans, false Derby has not", " * registered any beans.", " */", " public boolean isManagementActive();", " ", " /**", " * Inform Derby to start its JMX management by registering", " * MBeans relevant to its current state. If Derby is not", " * booted then no action is taken.", " */", " public void startManagement();", " ", " /**", " * Inform Derby to stop its JMX management by unregistering", " * its MBeans. If Derby is not booted then no action is taken.", " */", " public void stopManagement();", "}" ], "header": "@@ -0,0 +1,49 @@", "removed": [] } ] } ]
derby-DERBY-1392-0a625f3a
DERBY-1392, committed patch submitted by Anders Morken RAFContainer.java#writePage(...) will attempt to retry a write if an IOException is thrown on the first attempt. However, the next attempt does not add container header data to the first page, nor does it encrypt the data if the database is encrypted as the wrong buffer is used in the catch block. I'd expect this bug to be case silent corruption of encrypted databases if the code path was actually exercised. The fact that this bug still lives and nobody has discovered it is possibly an indication of how uncommon this code path is. Since the comment in the code says nothing about exactly what platforms the workaround was intended for, I don't know if these platforms are still supported for Derby. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@414647 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java", "hunks": [ { "added": [ " {", " // committed and dropped, do nothing.", " // This file container may only be a stub", "", " }", " ///////////////////////////////////////////////////", " //", " // RESOLVE: right now, no logical -> physical mapping.", " // We can calculate the offset. In the future, we may need to", " // look at the allocation page or the in memory translation table", " // to figure out where the page should go", " //", " /////////////////////////////////////////////////", " byte [] encryptionBuf = null; ", " if (dataFactory.databaseEncrypted() ", " && pageNumber != FIRST_ALLOC_PAGE_NUMBER)", " {", " // We cannot encrypt the page in place because pageData is", " // still being accessed as clear text. The encryption", " // buffer is shared by all who access this container and can", " // only be used within the synchronized block.", "", " encryptionBuf = getEncryptionBuffer();", " }", "", " byte[] dataToWrite = ", " updatePageArray(pageNumber, pageData, encryptionBuf, false);", "" ], "header": "@@ -352,22 +352,40 @@ class RAFContainer extends FileContainer implements PrivilegedExceptionAction", "removed": [ "\t\t\t// committed and dropped, do nothing.", "\t\t\t// This file container may only be a stub", "\t\t///////////////////////////////////////////////////", "\t\t//", "\t\t// RESOLVE: right now, no logical -> physical mapping.", "\t\t// We can calculate the offset. In the future, we may need to", "\t\t// look at the allocation page or the in memory translation table", "\t\t// to figure out where the page should go", "\t\t//", "\t\t/////////////////////////////////////////////////" ] }, { "added": [], "header": "@@ -380,23 +398,6 @@ class RAFContainer extends FileContainer implements PrivilegedExceptionAction", "removed": [ " byte [] encryptionBuf = null; ", " if (dataFactory.databaseEncrypted() ", "\t\t\t\t\t&& pageNumber != FIRST_ALLOC_PAGE_NUMBER)", "\t\t\t\t{", "\t\t\t\t\t// We cannot encrypt the page in place because pageData is", "\t\t\t\t\t// still being accessed as clear text. The encryption", "\t\t\t\t\t// buffer is shared by all who access this container and can", "\t\t\t\t\t// only be used within the synchronized block.", "", " encryptionBuf = getEncryptionBuffer();", " }", "", "\t\t\t\tbyte[] dataToWrite = updatePageArray(pageNumber, ", " pageData, ", " encryptionBuf, ", " false);", "" ] }, { "added": [ " {", "\t\t\t\t\tSanityManager.ASSERT(", " fileData.length() >= pageOffset,", " \"failed to blank filled missing pages\");", " }", "", "\t\t\t\t\tfileData.write(dataToWrite, 0, pageSize);" ], "header": "@@ -421,13 +422,17 @@ class RAFContainer extends FileContainer implements PrivilegedExceptionAction", "removed": [ "\t\t\t\t\tSanityManager.ASSERT(fileData.length() >= pageOffset,", "\t\t\t\t\t\t\t\t\t\t \"failed to blank filled missing pages\");", "\t\t\t\t\tfileData.write(pageData, 0, pageSize);" ] }, { "added": [ " if (SanityManager.DEBUG) ", " {" ], "header": "@@ -478,7 +483,8 @@ class RAFContainer extends FileContainer implements PrivilegedExceptionAction", "removed": [ " if (SanityManager.DEBUG) {" ] }, { "added": [ " } ", " else ", " {", " } ", " else", " {", " }" ], "header": "@@ -489,16 +495,20 @@ class RAFContainer extends FileContainer implements PrivilegedExceptionAction", "removed": [ " } else ", " {", " } else" ] } ] } ]
derby-DERBY-1393-054fa3a5
DERBY-1393: PreparedStatement.setObject(int,Object,int) should throw SQLFeatureNotSupportedException for unsupported types Description of the patch: The new setObject() methods call checkForSupportedDataType() to check whether targetSqlType is supported. Added a new error message "The data type ''{0}'' is not supported." with SQL state 0A000 (which ensures that the exception is converted to SQLFeatureNotSupportedException). This error message is used when targetSqlType is not supported. Added more JDBC 4.0 constants (from java.sql.Types) to JDBC40Translation and created a test JDBC40TranslationTest which tests that the constants are correct (the values of the constants are hard coded, so we don't get the compile-time check as with JDBC{2,3}0Translation). New test case SetObjectUnsupportedTest which is run as part of PreparedStatementTest and CallableStatementTest in the jdbc40 suite. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@420436 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/client/org/apache/derby/client/am/PreparedStatement.java", "hunks": [ { "added": [ "import org.apache.derby.shared.common.reference.JDBC40Translation;" ], "header": "@@ -20,6 +20,7 @@", "removed": [] }, { "added": [ " checkForSupportedDataType(targetJdbcType);" ], "header": "@@ -1214,6 +1215,7 @@ public class PreparedStatement extends Statement", "removed": [] } ] }, { "file": "java/client/org/apache/derby/client/am/Types.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.reference.JDBC40Translation;" ], "header": "@@ -21,6 +21,7 @@ package org.apache.derby.client.am;", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.reference.JDBC40Translation;" ], "header": "@@ -42,6 +42,7 @@ import org.apache.derby.iapi.error.StandardException;", "removed": [] }, { "added": [ " checkForSupportedDataType(targetSqlType);", "" ], "header": "@@ -1010,6 +1011,8 @@ public abstract class EmbedPreparedStatement", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/jdbc/Util.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.reference.JDBC40Translation;" ], "header": "@@ -32,6 +32,7 @@ import org.apache.derby.iapi.error.ExceptionSeverity;", "removed": [] }, { "added": [ "\t\t\tcase Types.ARRAY: return TypeId.ARRAY_NAME;", "\t\t\tcase JDBC30Translation.DATALINK: return TypeId.DATALINK_NAME;" ], "header": "@@ -265,8 +266,10 @@ public abstract class Util {", "removed": [] }, { "added": [ "\t\t\tcase JDBC40Translation.NCHAR:", "\t\t\t\treturn TypeId.NATIONAL_CHAR_NAME;", "\t\t\tcase JDBC40Translation.NVARCHAR:", "\t\t\t\treturn TypeId.NATIONAL_VARCHAR_NAME;", "\t\t\tcase JDBC40Translation.LONGNVARCHAR:", "\t\t\t\treturn TypeId.NATIONAL_LONGVARCHAR_NAME;", "\t\t\tcase JDBC40Translation.NCLOB: return TypeId.NCLOB_NAME;" ], "header": "@@ -280,9 +283,16 @@ public abstract class Util {", "removed": [] } ] }, { "file": "java/shared/org/apache/derby/shared/common/reference/JDBC40Translation.java", "hunks": [ { "added": [ " these constants when compiling against older jdk versions.", "", " <P>The test <code>jdbc4/JDBC40TranslationTest.junit</code>,", " which is compiled against jdk16, contains tests that verifies", " that these hard coded constants are in fact equal to those", " found in jdk16." ], "header": "@@ -25,10 +25,12 @@ package org.apache.derby.shared.common.reference;", "removed": [ " these constants when compiling against older jdk versions. The", " jdbc40 test suite (compiled against jdk16) contains tests that", " verifies that these hard coded constants are in fact equal to", " those found in jdk16." ] } ] } ]
derby-DERBY-1396-00b4912a
- DERBY-1396 ReEncodedInputStream may fail to read all of source Reader - Patch by Tomohito Nakayama ([email protected]) git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@413901 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/drda/org/apache/derby/impl/drda/ReEncodedInputStream.java", "hunks": [ { "added": [ "\t\tint count;", "\t\tdo{", "\t\t\tcount = reader.read(decodedBuffer_, 0, BUFFERED_CHAR_LEN);", "\t\t\t", "\t\t}while(count == 0);", "\t\t\t", "\t\tif(count < 0)", "\t\t\treturn null;" ], "header": "@@ -72,10 +72,14 @@ public class ReEncodedInputStream extends InputStream {", "removed": [ "\tint count;", "\tif(( count = reader.read(decodedBuffer_, 0, BUFFERED_CHAR_LEN )) < 1 ){", "\t return null;", "\t}" ] } ] } ]
derby-DERBY-1417-16e10039
DERBY-1417 (partial) Add new, lengthless overloads to the streaming api Disable five test cases in the DerbyNetClient framework. Patch contributed by Kristian Waagan. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@423068 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1417-57154353
DERBY-1417: Add new, lengthless overloads to the streaming api 'derby-1417-1a-notImplemented.diff' adds a number of new lengthless streaming overloads that Derby will not support. All methods added by the patch throw not-implemented exceptions. We don't support them because we either don't support the data type or because we don't yet support named parameters in CallableStatement. Patch submitted by Kristian Waagan. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@417753 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/client/org/apache/derby/client/am/ResultSet.java", "hunks": [ { "added": [ " public void updateNCharacterStream(int columnIndex, Reader x)", " throws SQLException {", " throw jdbc3MethodNotSupported();", " }", "", " public void updateNClob(int columnIndex, Reader reader)", " throws SQLException {", " throw jdbc3MethodNotSupported();", " }", "" ], "header": "@@ -3124,6 +3124,16 @@ public abstract class ResultSet implements java.sql.ResultSet,", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedResultSet40.java", "hunks": [ { "added": [ " * JDBC 4 specific methods that cannot be implemented in superclasses and", " * unimplemented JDBC 4 methods.", " * In general, the implementations should be pushed to the superclasses. This", " * is not possible if the methods use objects or features not available in the", " * Java version associated with the earlier JDBC version, since Derby classes", " * are compiled with the lowest possible Java version." ], "header": "@@ -32,7 +32,12 @@ import java.sql.Statement;", "removed": [ " * Implementation of JDBC 4 specific ResultSet methods." ] }, { "added": [ "", " public void updateNCharacterStream(int columnIndex, Reader x)", " throws SQLException {", "", "", " public void updateNCharacterStream(String columnName, Reader x)", " throws SQLException {", " throw Util.notImplemented();", " }", "" ], "header": "@@ -55,20 +60,22 @@ public class EmbedResultSet40 extends org.apache.derby.impl.jdbc.EmbedResultSet2", "removed": [ " ", " public void updateRowId(int columnIndex, RowId x) throws SQLException {", " throw Util.notImplemented();", " }", " ", " public void updateRowId(String columnName, RowId x) throws SQLException {", " ", " " ] }, { "added": [ "", " public void updateNClob(int columnIndex, Reader reader)", " throws SQLException {", " throw Util.notImplemented();", " }", "", " public void updateNClob(String columnName, Reader reader)", " throws SQLException {", " throw Util.notImplemented();", " }", "" ], "header": "@@ -85,11 +92,21 @@ public class EmbedResultSet40 extends org.apache.derby.impl.jdbc.EmbedResultSet2", "removed": [ " " ] }, { "added": [ "", " public void updateRowId(int columnIndex, RowId x) throws SQLException {", " throw Util.notImplemented();", " }", "", " public void updateRowId(String columnName, RowId x) throws SQLException {", " throw Util.notImplemented();", " }", "" ], "header": "@@ -113,7 +130,15 @@ public class EmbedResultSet40 extends org.apache.derby.impl.jdbc.EmbedResultSet2", "removed": [ " " ] } ] } ]
derby-DERBY-1417-c586481b
DERBY-1417 (partial) Add new, lengthless overloads to the streaming api Add the new overloads to the Brokered* classes and update UnsupportedVetter with the methods we support. Patch contributed by Kristian Waagan. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@423807 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/jdbc/BrokeredCallableStatement40.java", "hunks": [ { "added": [ "", " public final void setNCharacterStream(String parameterName, Reader value)", " throws SQLException {", " getCallableStatement().setNCharacterStream(parameterName, value);", " }", "" ], "header": "@@ -93,7 +93,12 @@ public class BrokeredCallableStatement40 extends BrokeredCallableStatement30{", "removed": [ " " ] }, { "added": [ "", " public final void setClob(String parameterName, Reader reader)", " throws SQLException {", " getCallableStatement().setClob(parameterName, reader);", " }", "", "", " public final void setBlob(String parameterName, InputStream inputStream)", " throws SQLException {", " getCallableStatement().setBlob(parameterName, inputStream);", " }", "", "", " public final void setNClob(String parameterName, Reader reader)", " throws SQLException {", " getCallableStatement().setNClob(parameterName, reader);", " }", "" ], "header": "@@ -102,17 +107,32 @@ public class BrokeredCallableStatement40 extends BrokeredCallableStatement30{", "removed": [ " ", " ", " " ] }, { "added": [ "", " /**", " * Sets the designated parameter to the given input stream.", " *", " * @param parameterIndex the first parameter is 1, the second is 2, ...", " * @param x the Java input stream that contains the ASCII parameter value", " * @throws SQLException if a database access error occurs or this method is", " * called on a closed <code>PreparedStatement</code>", " */", " public final void setAsciiStream(int parameterIndex, InputStream x)", " throws SQLException {", " getCallableStatement().setAsciiStream(parameterIndex, x);", " }", "", " /**", " * Sets the designated parameter to the given input stream.", " *", " * @param parameterIndex the first parameter is 1, the second is 2, ...", " * @param x the java input stream which contains the binary parameter value", " * @throws SQLException if a database access error occurs or this method is", " * called on a closed <code>PreparedStatement</code>", " */", " public final void setBinaryStream(int parameterIndex, InputStream x)", " throws SQLException {", " getCallableStatement().setBinaryStream(parameterIndex, x);", " }", "", " /**", " * Sets the designated parameter to the given <code>Reader</code> object.", " *", " * @param parameterIndex the first parameter is 1, the second is 2, ...", " * @param reader the <code>java.io.Reader</code> object that contains the", " * Unicode data", " * @throws SQLException if a database access error occurs or this method is", " * called on a closed <code>PreparedStatement</code>", " */", " public final void setCharacterStream(int parameterIndex, Reader reader)", " throws SQLException {", " getCallableStatement().setCharacterStream(parameterIndex, reader);", " }", "" ], "header": "@@ -141,6 +161,47 @@ public class BrokeredCallableStatement40 extends BrokeredCallableStatement30{", "removed": [] }, { "added": [ "", " public void setNCharacterStream(int parameterIndex, Reader value)", " throws SQLException {", " getCallableStatement().setNCharacterStream(parameterIndex, value);", " }", "" ], "header": "@@ -148,7 +209,12 @@ public class BrokeredCallableStatement40 extends BrokeredCallableStatement30{", "removed": [ " " ] }, { "added": [ "", " /**", " * Sets the designated parameter to a <code>Reader</code> object.", " * This method differs from the <code>setCharacterStream(int,Reader)</code>", " * method because it informs the driver that the parameter value should be", " * sent to the server as a <code>CLOB</code>.", " *", " * @param parameterIndex the first parameter is 1, the second is 2, ...", " * @param reader an object that contains the data to set the parameter", " * value to.", " * @throws SQLException if a database access error occurs, this method is", " * called on a closed PreparedStatement", " */", " public final void setClob(int parameterIndex, Reader reader)", " throws SQLException {", " getCallableStatement().setClob(parameterIndex, reader);", " }", "", "", " /**", " * Sets the designated parameter to a <code>InputStream</code> object.", " * This method differs from the <code>setBinaryStream(int, InputStream)", " * </code> method because it informs the driver that the parameter value", " * should be sent to the server as a <code>BLOB</code>.", " *", " * @param inputStream an object that contains the data to set the parameter", " * value to.", " * @throws SQLException if a database access error occurs, this method is", " * called on a closed <code>PreparedStatement</code>", " */", " public final void setBlob(int parameterIndex, InputStream inputStream)", " throws SQLException {", " getCallableStatement().setBlob(parameterIndex, inputStream);", " }", "", "", " public final void setNClob(int parameterIndex, Reader reader)", " throws SQLException {", " getCallableStatement().setNClob(parameterIndex, reader);", " }", "" ], "header": "@@ -156,16 +222,55 @@ public class BrokeredCallableStatement40 extends BrokeredCallableStatement30{", "removed": [ " ", " " ] }, { "added": [ " public final void setAsciiStream(String parameterName, InputStream x)", " throws SQLException {", " getCallableStatement().setAsciiStream(parameterName, x);", " }", "" ], "header": "@@ -273,6 +378,11 @@ public class BrokeredCallableStatement40 extends BrokeredCallableStatement30{", "removed": [] }, { "added": [ " public final void setBinaryStream(String parameterName, InputStream x)", " throws SQLException {", " getCallableStatement().setBinaryStream(parameterName, x);", " }", "" ], "header": "@@ -289,6 +399,11 @@ public class BrokeredCallableStatement40 extends BrokeredCallableStatement30{", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/iapi/jdbc/BrokeredPreparedStatement40.java", "hunks": [ { "added": [ " public void setNCharacterStream(int parameterIndex, Reader value)", " throws SQLException {", " getPreparedStatement().setNCharacterStream(parameterIndex, value);", " }", "" ], "header": "@@ -43,6 +43,11 @@ public class BrokeredPreparedStatement40 extends BrokeredPreparedStatement30{", "removed": [] }, { "added": [ "", " public final void setNClob(int parameterIndex, Reader reader)", " throws SQLException {", " getPreparedStatement().setNClob(parameterIndex, reader);", " }", "" ], "header": "@@ -60,6 +65,12 @@ public class BrokeredPreparedStatement40 extends BrokeredPreparedStatement30{", "removed": [] }, { "added": [ " /**", " * Sets the designated parameter to the given input stream.", " *", " * @param parameterIndex the first parameter is 1, the second is 2, ...", " * @param x the Java input stream that contains the ASCII parameter value", " * @throws SQLException if a database access error occurs or this method is", " * called on a closed <code>PreparedStatement</code>", " */", " public final void setAsciiStream(int parameterIndex, InputStream x)", " throws SQLException {", " getPreparedStatement().setAsciiStream(parameterIndex, x);", " }" ], "header": "@@ -120,6 +131,18 @@ public class BrokeredPreparedStatement40 extends BrokeredPreparedStatement30{", "removed": [] }, { "added": [ " /**", " * Sets the designated parameter to the given input stream.", " *", " * @param parameterIndex the first parameter is 1, the second is 2, ...", " * @param x the java input stream which contains the binary parameter value", " * @throws SQLException if a database access error occurs or this method is", " * called on a closed <code>PreparedStatement</code>", " */", " public final void setBinaryStream(int parameterIndex, InputStream x)", " throws SQLException {", " getPreparedStatement().setBinaryStream(parameterIndex, x);", " }", "" ], "header": "@@ -137,6 +160,19 @@ public class BrokeredPreparedStatement40 extends BrokeredPreparedStatement30{", "removed": [] }, { "added": [ " /**", " * Sets the designated parameter to a <code>InputStream</code> object.", " * This method differs from the <code>setBinaryStream(int, InputStream)", " * </code> method because it informs the driver that the parameter value", " * should be sent to the server as a <code>BLOB</code>.", " *", " * @param inputStream an object that contains the data to set the parameter", " * value to.", " * @throws SQLException if a database access error occurs, this method is", " * called on a closed <code>PreparedStatement</code>", " */", " public final void setBlob(int parameterIndex, InputStream inputStream)", " throws SQLException {", " getPreparedStatement().setBlob(parameterIndex, inputStream);", " }", "", " /**", " * Sets the designated parameter to the given <code>Reader</code> object.", " *", " * @param parameterIndex the first parameter is 1, the second is 2, ...", " * @param reader the <code>java.io.Reader</code> object that contains the", " * Unicode data", " * @throws SQLException if a database access error occurs or this method is", " * called on a closed <code>PreparedStatement</code>", " */", " public final void setCharacterStream(int parameterIndex, Reader reader)", " throws SQLException {", " getPreparedStatement().setCharacterStream(parameterIndex, reader);", " }", "" ], "header": "@@ -153,6 +189,36 @@ public class BrokeredPreparedStatement40 extends BrokeredPreparedStatement30{", "removed": [] } ] } ]
derby-DERBY-1417-ef4a7ba6
DERBY-1417: Commit derby-1417-7a-clientborderfix.diff, fixing a hang on a border condition. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@427969 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/client/org/apache/derby/client/am/ByteArrayCombinerStream.java", "hunks": [ { "added": [ " *", " * If there is less data available than the specified length, an exception is", " * thrown. Available data is determined by the length of the byte arrays, not", " * the contents of them. A byte array with all 0's is considered valid data.", " *", " * Besides from truncation, this stream does not change the underlying data in", " * any way.", "" ], "header": "@@ -35,10 +35,17 @@ import java.util.ArrayList;", "removed": [ " " ] }, { "added": [ " private int off = 0;", "" ], "header": "@@ -50,8 +57,8 @@ public class ByteArrayCombinerStream", "removed": [ " private int off = 0; ", " " ] }, { "added": [ " * this object. Note that the length specified can be shorter", " * than the actual number of bytes in the byte arrays.", " * @throws IllegalArgumentException if there is less data available than", " * specified by <code>length</code>, or <code>length</code> is", " * negative.", " // Don't allow negative length.", " if (length < 0) {", " throw new IllegalArgumentException(\"Length cannot be negative: \" +", " length);", " }", " long tmpRemaining = length;", " for (int i=0; i < arrayCount && tmpRemaining > 0; i++) {", " byte[] shrunkArray =", " System.arraycopy(tmpArray, 0,", " tmpRemaining -= shrunkArray.length;" ], "header": "@@ -59,27 +66,37 @@ public class ByteArrayCombinerStream", "removed": [ " * this object", " long tmpRemaining = length;", " for (int i=0; i < arrayCount; i++) {", " byte[] shrunkArray = ", " System.arraycopy(tmpArray, 0, " ] }, { "added": [ " // If we don't have enough data, throw exception.", " if (tmpRemaining > 0) {", " throw new IllegalArgumentException(\"Not enough data, \" + ", " tmpRemaining + \" bytes short of specified length \" +", " length);", " }" ], "header": "@@ -94,6 +111,12 @@ public class ByteArrayCombinerStream", "removed": [] } ] }, { "file": "java/client/org/apache/derby/client/am/Lob.java", "hunks": [ { "added": [ " if (partLength > 0) {", " totalLength += partLength;", " }" ], "header": "@@ -137,7 +137,9 @@ public abstract class Lob implements UnitOfWorkListener {", "removed": [ " totalLength += partLength;" ] } ] } ]
derby-DERBY-1421-cfcbbae5
DERBY-1421 updates of LOBs fails with scrollable updatable result sets. Contributed by Fernanda Pizzorno git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@418221 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1434-34a7cbef
DERBY-1434: Client can send incorrect database name to server after having made multiple connections to different databases. Patch contributed by Julius Stroffek. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@478877 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/drda/org/apache/derby/impl/drda/DRDAConnThread.java", "hunks": [ { "added": [ " ", " // A check that the rdbnam field corresponds to a database", " // specified in a ACCRDB term.", " // The check is not performed if the client is DNC_CLIENT", " // with version before 10.3.0 because these clients", " // are broken and send incorrect database name", " // if multiple connections to different databases", " // are created", " ", " // This check was added because of DERBY-1434", " ", " // check the client version first", " if ( appRequester.getClientType() != AppRequester.DNC_CLIENT", " || appRequester.greaterThanOrEqualTo(10,3,0) ) {", " // check the database name", " if (!rdbnam.toString().equals(database.dbName))", " rdbnamMismatch(CodePoint.PKGNAMCSN);", " }" ], "header": "@@ -4941,6 +4941,24 @@ class DRDAConnThread extends Thread {", "removed": [] } ] } ]
derby-DERBY-1439-a11b0768
DERBY-1439: Remove the AntiGC thread git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1027552 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java", "hunks": [ { "added": [], "header": "@@ -88,9 +88,6 @@ import java.util.NoSuchElementException;", "removed": [ "import java.security.AccessController;", "import java.security.PrivilegedAction;", "" ] }, { "added": [], "header": "@@ -134,9 +131,6 @@ abstract class BaseMonitor", "removed": [ "\t// anti GC stuff", "\tAntiGC dontGC;", "" ] }, { "added": [], "header": "@@ -213,12 +207,6 @@ abstract class BaseMonitor", "removed": [ "\t\tsynchronized (dontGC) {", "", "\t\t\tdontGC.goAway = true;", "\t\t\tdontGC.notifyAll();", "\t\t}", "" ] }, { "added": [ "\t\tMessageService.setFinder(this);" ], "header": "@@ -265,39 +253,7 @@ abstract class BaseMonitor", "removed": [ "\t\tObject msgService = MessageService.setFinder(this);", "", "\t\t// start a backgorund thread which keeps a reference to this", "\t\t// this monitor, and an instance of the Monitor class to ensure", "\t\t// that the monitor instance and the class is not garbage collected", "\t\t// See Sun's bug 4057924 in Java Developer Section 97/08/06", "", "\t\tObject[] keepItems = new Object[3];", "\t\tkeepItems[0] = this;", "\t\tkeepItems[1] = new Monitor();", "\t\tkeepItems[2] = msgService;", "\t\tdontGC = new AntiGC(keepItems);", "", "\t\tfinal Thread dontGCthread = getDaemonThread(dontGC, \"antiGC\", true);", "\t\t// DERBY-3745. setContextClassLoader for thread to null to avoid", "\t\t// leaking class loaders.", "\t\ttry {", " AccessController.doPrivileged(", " new PrivilegedAction() {", " public Object run() {", " ", " dontGCthread.setContextClassLoader(null);", " return null;", " }", " });", " } catch (SecurityException se1) {", " // ignore security exception. Earlier versions of Derby, before the ", " // DERBY-3745 fix did not require setContextClassloader permissions.", " // We may leak class loaders if we are not able to set this, but ", " // cannot just fail.", " }", "", "\t\tdontGCthread.start();" ] } ] }, { "file": "java/engine/org/apache/derby/impl/services/monitor/FileMonitor.java", "hunks": [ { "added": [ " /**", " * Create a ThreadGroup and set the daemon property to make sure", " * the group is destroyed and garbage collected when all its", " * members have finished (i.e., either when the driver is", " * unloaded, or when the last database is shut down).", " */", " private static ThreadGroup createDaemonGroup() {", " try {", " ThreadGroup group = new ThreadGroup(\"derby.daemons\");", " group.setDaemon(true);", " return group;", " } catch (SecurityException se) {", " // In case of a lacking privilege, silently return null and let", " // the daemon threads be created in the default thread group.", " return null;", " }", " }" ], "header": "@@ -77,7 +77,23 @@ public final class FileMonitor extends BaseMonitor implements java.security.Priv", "removed": [ "" ] }, { "added": [ " daemonGroup = createDaemonGroup();" ], "header": "@@ -91,15 +107,7 @@ public final class FileMonitor extends BaseMonitor implements java.security.Priv", "removed": [ "\t\t\ttry {", "\t\t\t\t// Create a ThreadGroup and set the daemon property to", "\t\t\t\t// make sure the group is destroyed and garbage", "\t\t\t\t// collected when all its members have finished (i.e.,", "\t\t\t\t// when the driver is unloaded).", "\t\t\t\tdaemonGroup = new ThreadGroup(\"derby.daemons\");", "\t\t\t\tdaemonGroup.setDaemon(true);", "\t\t\t} catch (SecurityException se) {", "\t\t\t}" ] }, { "added": [ " {", " boolean setMinPriority = (intValue != 0);", " try {", " return super.getDaemonThread(task, key3, setMinPriority);", " } catch (IllegalThreadStateException e) {", " // We may get an IllegalThreadStateException if all the", " // previously running daemon threads have completed and the", " // daemon group has been automatically destroyed. If that's", " // what has happened, create a new daemon group and try again.", " if (daemonGroup != null && daemonGroup.isDestroyed()) {", " daemonGroup = createDaemonGroup();", " return super.getDaemonThread(task, key3, setMinPriority);", " } else {", " throw e;", " }", " }", " }" ], "header": "@@ -279,7 +287,23 @@ public final class FileMonitor extends BaseMonitor implements java.security.Priv", "removed": [ "\t\t\treturn super.getDaemonThread(task, key3, intValue != 0);" ] } ] } ]
derby-DERBY-1440-2b22c7f1
DERBY-1440: jdk 1.6 client driver omits SQLStates and chained exceptions in error messages Follow-up patch which simplifies wrapInSQLException() and improves the comments. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@542232 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/jdbc/TransactionResourceImpl.java", "hunks": [ { "added": [ " * </PRE>" ], "header": "@@ -101,6 +101,7 @@ import java.sql.SQLException;", "removed": [] }, { "added": [ "\t/**" ], "header": "@@ -127,7 +128,7 @@ public final class TransactionResourceImpl", "removed": [ "\t/*" ] }, { "added": [ "\t/**" ], "header": "@@ -159,7 +160,7 @@ public final class TransactionResourceImpl", "removed": [ "\t/*" ] }, { "added": [ "\t/**" ], "header": "@@ -187,7 +188,7 @@ public final class TransactionResourceImpl", "removed": [ "\t/*" ] }, { "added": [ "\t/**" ], "header": "@@ -199,7 +200,7 @@ public final class TransactionResourceImpl", "removed": [ "\t/*" ] }, { "added": [ "\t/**" ], "header": "@@ -225,7 +226,7 @@ public final class TransactionResourceImpl", "removed": [ "\t/*" ] }, { "added": [ "\t/**" ], "header": "@@ -284,7 +285,7 @@ public final class TransactionResourceImpl", "removed": [ "\t/*" ] }, { "added": [ "", " /**", " * Wrap a <code>Throwable</code> in an <code>SQLException</code>.", " *", " * @param thrownException a <code>Throwable</code>", " * @return <code>thrownException</code>, if it is an", " * <code>SQLException</code>; otherwise, an <code>SQLException</code> which", " * wraps <code>thrownException</code>", " */", " // Server side JDBC can end up with a SQLException in the nested", " // stack. Return the exception with no wrapper.", " return (SQLException) thrownException;", "", " if (thrownException instanceof StandardException) {", " // se is a single, unchained exception. Just convert it to an", " // SQLException.", " return Util.generateCsSQLException(se);", " // se contains a non-empty exception chain. We want to put all of", " // the exceptions (including Java exceptions) in the next-exception", " // chain. Therefore, call wrapInSQLException() recursively to", " // convert the cause chain into a chain of SQLExceptions.", " return Util.seeNextException(se.getMessageId(),", " se.getArguments(), wrapInSQLException(se.getCause()));", " }", " // thrownException is a Java exception", " return Util.javaException(thrownException);" ], "header": "@@ -360,37 +361,46 @@ public final class TransactionResourceImpl", "removed": [ "\t\t ", "\t\tSQLException nextSQLException;", "", "", "\t\t\t// server side JDBC can end up with a SQLException in the nested stack", "\t\t\tnextSQLException = (SQLException) thrownException;", "\t\telse if (thrownException instanceof StandardException) {", " nextSQLException = Util.generateCsSQLException(se);", " } else {", " nextSQLException = Util.seeNextException(se.getMessageId(),", " se.getArguments(), wrapInSQLException(se.getCause()));", "\t\t} else {", "", "\t\t\tnextSQLException = Util.javaException(thrownException);", "", "\t\t}", "\t\treturn nextSQLException;" ] } ] } ]
derby-DERBY-1440-de3b1087
DERBY-1440: jdk 1.6 client driver omits SQLStates and chained exceptions in error messages While working on DERBY-2472 I found out what caused this difference between the JDBC 3.0 driver and the JDBC 4.0 driver. There are three problems. Firstly, StandardException.unexpectedUserException() doesn't recognize that an SQLException is generated Derby since it is not an EmbedSQLException. Secondly, TransactionResourceImpl.wrapInSQLException() invokes SQLException.setNextException() explicitly so that the required chaining/ferrying logic in the exception factory and in EmbedSQLException's constructor is not used. Thirdly, SQLException40.wrapArgsForTransportAcrossDRDA() puts a standard SQLException, not an EmbedSQLException, in the argument ferry's next-exception chain, which prevents the network server from seeing it as a Derby exception. The attached patch fixes the problem by 1) using SQLExceptionFactory.getArgumentFerry() to find out whether the exception is a Derby exception in unexpectedUserException() 2) using factory methods instead of setNextException() to do the chaining in wrapInSQLException() 3) improving Util.javaException() so that it sets up a next-exception chain if the Java exception contains nested exceptions 4) changing wrapArgsForTransportAcrossDRDA() to create an argument ferry whose next exception is the argument ferry of the main exception's next exception This patch also fixes all the JUnit tests that contain code looking like this: assertStatementError(JDBC.vmSupportsJDBC4() ? "38000" : "42X62", cSt); Now, the check for JDBC level is not needed anymore for those tests. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@541435 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/error/StandardException.java", "hunks": [ { "added": [ "import org.apache.derby.impl.jdbc.Util;" ], "header": "@@ -24,6 +24,7 @@ package org.apache.derby.iapi.error;", "removed": [] }, { "added": [ " // If the exception is an SQLException generated by Derby, it has an", " // argument ferry which is an EmbedSQLException. Use this to check", " // whether the exception was generated by Derby.", " EmbedSQLException ferry = null;", " if (t instanceof SQLException) {", " SQLException sqle =", " Util.getExceptionFactory().getArgumentFerry((SQLException) t);", " if (sqle instanceof EmbedSQLException) {", " ferry = (EmbedSQLException) sqle;", " }", " }", "" ], "header": "@@ -436,6 +437,18 @@ public class StandardException extends Exception", "removed": [] }, { "added": [ "\t\tif ((t instanceof SQLException) && (ferry == null))" ], "header": "@@ -443,8 +456,7 @@ public class StandardException extends Exception", "removed": [ "\t\tif ((t instanceof SQLException) &&", "\t\t !(t instanceof EmbedSQLException)) " ] }, { "added": [ "\t\tif (ferry != null) {", "\t\t\tif (ferry.isSimpleWrapper()) {", "\t\t\t\tThrowable wrapped = ferry.getCause();" ], "header": "@@ -463,10 +475,9 @@ public class StandardException extends Exception", "removed": [ "\t\tif (t instanceof EmbedSQLException) {", "\t\t\tEmbedSQLException csqle = (EmbedSQLException) t;", "\t\t\tif (csqle.isSimpleWrapper()) {", "\t\t\t\tThrowable wrapped = csqle.getCause();" ] } ] }, { "file": "java/engine/org/apache/derby/impl/jdbc/TransactionResourceImpl.java", "hunks": [ { "added": [ "\t\t\treturn wrapInSQLException(thrownException);" ], "header": "@@ -342,7 +342,7 @@ public final class TransactionResourceImpl", "removed": [ "\t\t\treturn wrapInSQLException((SQLException) null, thrownException);" ] }, { "added": [ "\t\t\tthrow wrapInSQLException(t);", "\tpublic static SQLException wrapInSQLException(Throwable thrownException) {", "\t\t\treturn null;" ], "header": "@@ -355,16 +355,16 @@ public final class TransactionResourceImpl", "removed": [ "\t\t\tthrow wrapInSQLException((SQLException) null, t);", "\tpublic static final SQLException wrapInSQLException(SQLException sqlException, Throwable thrownException) {", "\t\t\treturn sqlException;" ] } ] } ]
derby-DERBY-1443-6796671f
DERBY-1443: DataTypeDescriptor.isBinaryType() return false for Types.BLOB Adding javadoc for isBinaryType() and isCharacterType() clarifying why they return false for BLOB and CLOB. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@423827 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java", "hunks": [ { "added": [ "\t/**", "\t * Check whether a JDBC type is one of the character types that are", "\t * compatible with the Java type <code>String</code>.", "\t *", "\t * <p><strong>Note:</strong> <code>CLOB</code> is not compatible with", "\t * <code>String</code>. See tables B-4, B-5 and B-6 in the JDBC 3.0", "\t * Specification.", "\t *", "\t * <p> There are some non-character types that are compatible with", "\t * <code>String</code> (examples: numeric types, binary types and", "\t * time-related types), but they are not covered by this method.", "\t *", "\t * @param jdbcType a JDBC type", "\t * @return <code>true</code> iff <code>jdbcType</code> is a character type", "\t * and compatible with <code>String</code>", "\t * @see java.sql.Types", "\t */" ], "header": "@@ -1017,6 +1017,23 @@ public final class DataTypeDescriptor implements TypeDescriptor, Formatable", "removed": [] }, { "added": [ "\t/**", "\t * Check whether a JDBC type is compatible with the Java type", "\t * <code>byte[]</code>.", "\t *", "\t * <p><strong>Note:</strong> <code>BLOB</code> is not compatible with", "\t * <code>byte[]</code>. See tables B-4, B-5 and B-6 in the JDBC 3.0", "\t * Specification.", "\t *", "\t * @param jdbcType a JDBC type", "\t * @return <code>true</code> iff <code>jdbcType</code> is compatible with", "\t * <code>byte[]</code>", "\t * @see java.sql.Types", "\t */" ], "header": "@@ -1029,6 +1046,19 @@ public final class DataTypeDescriptor implements TypeDescriptor, Formatable", "removed": [] } ] } ]
derby-DERBY-1445-c5114100
DERBY-1445: Add new streaming overloads and modify some existing ones. Adding new (JDBC 4.0) streaming overloads to ResultSet, PreparedStatement and CallableStatement. The new overloads take a long as the length parameter. Patch contributed by V. Narayanan. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@417548 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/client/org/apache/derby/client/am/PreparedStatement.java", "hunks": [ { "added": [ " /**", " * sets the parameter to the Binary Stream object", " *", " * @param parameterIndex the first parameter is 1, the second is 2, ...", " * @param x the java input stream which contains the binary parameter value", " * @param length the number of bytes in the stream", " * @exception SQLException thrown on failure.", " */", "", " long length) throws SQLException {", " agent_.logWriter_.traceEntry(this, \"setBinaryStream\", parameterIndex, \"<input stream>\", new Long(length));", " }", " if(length > Integer.MAX_VALUE) {", " throw new SqlException(agent_.logWriter_,", " new ClientMessageId(SQLState.CLIENT_LENGTH_OUTSIDE_RANGE_FOR_DATATYPE),", " new Long(length), new Integer(Integer.MAX_VALUE)).getSQLException();", " setBinaryStreamX(parameterIndex, x, (int)length);" ], "header": "@@ -832,16 +832,30 @@ public class PreparedStatement extends Statement", "removed": [ " int length) throws SQLException {", " agent_.logWriter_.traceEntry(this, \"setBinaryStream\", parameterIndex, \"<input stream>\", length);", " setBinaryStreamX(parameterIndex, x, length);" ] }, { "added": [ " /**", " * sets the parameter to the Binary Stream object", " *", " * @param parameterIndex the first parameter is 1, the second is 2, ...", " * @param x the java input stream which contains the binary parameter value", " * @param length the number of bytes in the stream", " * @exception SQLException thrown on failure.", " */", "", " public void setBinaryStream(int parameterIndex,", " java.io.InputStream x,", " int length) throws SQLException {", " setBinaryStream(parameterIndex,x,(long)length);", " }", "" ], "header": "@@ -850,6 +864,21 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [ " /**", " * We do this inefficiently and read it all in here. The target type", " * is assumed to be a String.", " *", " * @param parameterIndex the first parameter is 1, the second is 2, ...", " * @param x the java input stream which contains the ASCII parameter value", " * @param length the number of bytes in the stream", " * @exception SQLException thrown on failure.", " */", "", " long length) throws SQLException {", " agent_.logWriter_.traceEntry(this, \"setAsciiStream\", parameterIndex, \"<input stream>\", new Long(length));" ], "header": "@@ -862,14 +891,24 @@ public class PreparedStatement extends Statement", "removed": [ " int length) throws SQLException {", " agent_.logWriter_.traceEntry(this, \"setAsciiStream\", parameterIndex, \"<input stream>\", length);" ] }, { "added": [ " if(length > Integer.MAX_VALUE) {", " throw new SqlException(agent_.logWriter_,", " new ClientMessageId(SQLState.CLIENT_LENGTH_OUTSIDE_RANGE_FOR_DATATYPE),", " new Long(length), new Integer(Integer.MAX_VALUE)).getSQLException();", " }", " setInput(parameterIndex, new Clob(agent_, x, \"US-ASCII\", (int)length));" ], "header": "@@ -877,7 +916,12 @@ public class PreparedStatement extends Statement", "removed": [ " setInput(parameterIndex, new Clob(agent_, x, \"US-ASCII\", length));" ] }, { "added": [ " /**", " * We do this inefficiently and read it all in here. The target type", " * is assumed to be a String.", " *", " * @param parameterIndex the first parameter is 1, the second is 2, ...", " * @param x the java input stream which contains the ASCII parameter value", " * @param length the number of bytes in the stream", " * @exception SQLException thrown on failure.", " */", " public void setAsciiStream(int parameterIndex,", " java.io.InputStream x,", " int length) throws SQLException {", " setAsciiStream(parameterIndex,x,(long)length);", " }", "" ], "header": "@@ -886,6 +930,21 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [ " /**", " * Sets the designated parameter to the given Reader, which will have", " * the specified number of bytes.", " *", " * @param parameterIndex the index of the parameter to which this set", " * method is applied", " * @param x the java Reader which contains the UNICODE value", " * @param length the number of bytes in the stream", " * @exception SQLException thrown on failure.", " *", " */", "", " long length) throws SQLException {", " agent_.logWriter_.traceEntry(this, \"setCharacterStream\", parameterIndex, x, new Long(length));" ], "header": "@@ -910,14 +969,26 @@ public class PreparedStatement extends Statement", "removed": [ " int length) throws SQLException {", " agent_.logWriter_.traceEntry(this, \"setCharacterStream\", parameterIndex, x, length);" ] }, { "added": [ " if(length > Integer.MAX_VALUE) {", " throw new SqlException(agent_.logWriter_,", " new ClientMessageId(SQLState.CLIENT_LENGTH_OUTSIDE_RANGE_FOR_DATATYPE),", " new Long(length), new Integer(Integer.MAX_VALUE)).getSQLException();", " }", " setInput(parameterIndex, new Clob(agent_, x, (int)length));" ], "header": "@@ -925,7 +996,12 @@ public class PreparedStatement extends Statement", "removed": [ " setInput(parameterIndex, new Clob(agent_, x, length));" ] } ] }, { "file": "java/client/org/apache/derby/client/am/ResultSet.java", "hunks": [ { "added": [ "import java.io.InputStream;", "import java.io.Reader;", "import org.apache.derby.client.am.SQLExceptionFactory;" ], "header": "@@ -21,7 +21,10 @@", "removed": [] }, { "added": [ " agent_.logWriter_.traceEntry(this, \"\", column, x, length);" ], "header": "@@ -3037,7 +3040,7 @@ public abstract class ResultSet implements java.sql.ResultSet,", "removed": [ " agent_.logWriter_.traceEntry(this, \"updateBinaryStream\", column, x, length);" ] } ] }, { "file": "java/client/org/apache/derby/client/net/NetResultSet40.java", "hunks": [ { "added": [ " public void updateNCharacterStream(int columnIndex, Reader x, long length)", " \"updateNCharacterStream(int,Reader,long)\");", " public void updateNCharacterStream(String columnName, Reader x, long length)", " \"updateNCharacterStream(String,Reader,long)\");" ], "header": "@@ -102,16 +102,16 @@ public class NetResultSet40 extends NetResultSet{", "removed": [ " public void updateNCharacterStream(int columnIndex, Reader x, int length)", " \"updateNCharacterStream(int,Reader,int)\");", " public void updateNCharacterStream(String columnName, Reader x, int length)", " \"updateNCharacterStream(String,Reader,int)\");" ] } ] }, { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java", "hunks": [ { "added": [ " public final void setAsciiStream(int parameterIndex, InputStream x, long length)" ], "header": "@@ -561,7 +561,7 @@ public abstract class EmbedPreparedStatement", "removed": [ " public final void setAsciiStream(int parameterIndex, InputStream x, int length)" ] }, { "added": [ " /**", " * We do this inefficiently and read it all in here. The target type", " * is assumed to be a String.", " *", " * @param parameterIndex the first parameter is 1, the second is 2, ...", " * @param x the java input stream which contains the ASCII parameter value", " * @param length the number of bytes in the stream", " * @exception SQLException thrown on failure.", " */", "", " public final void setAsciiStream(int parameterIndex, InputStream x, int length)", " throws SQLException {", " setAsciiStream(parameterIndex,x,(long)length);", " }", "", "" ], "header": "@@ -593,6 +593,22 @@ public abstract class EmbedPreparedStatement", "removed": [] }, { "added": [ "\t\t\t long length) throws SQLException {" ], "header": "@@ -628,8 +644,7 @@ public abstract class EmbedPreparedStatement", "removed": [ "\t\t\t int length) throws SQLException", "\t{" ] }, { "added": [ " /**", " * When a very large UNICODE value is input to a LONGVARCHAR", " * parameter, it may be more practical to send it via a", " * java.io.Reader. JDBC will read the data from the stream", " * as needed, until it reaches end-of-file. The JDBC driver will", " * do any necessary conversion from UNICODE to the database char format.", " *", " * <P><B>Note:</B> This stream object can either be a standard", " * Java stream object or your own subclass that implements the", " * standard interface.", " *", " * @param parameterIndex the first parameter is 1, the second is 2, ...", " * @param reader the java reader which contains the UNICODE data", " * @param length the number of characters in the stream", " * @exception SQLException if a database-access error occurs.", " */", " public final void setCharacterStream(int parameterIndex,", " java.io.Reader reader,", " int length) throws SQLException {", " setCharacterStream(parameterIndex,reader,(long)length);", " }", "", "" ], "header": "@@ -646,6 +661,29 @@ public abstract class EmbedPreparedStatement", "removed": [] }, { "added": [ " * sets the parameter to the Binary stream", " public final void setBinaryStream(int parameterIndex, InputStream x, long length)", "\t throws SQLException {" ], "header": "@@ -727,15 +765,15 @@ public abstract class EmbedPreparedStatement", "removed": [ " public final void setBinaryStream(int parameterIndex, InputStream x, int length)", "\t throws SQLException", "\t\t{" ] } ] }, { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java", "hunks": [ { "added": [ "import java.io.Reader;" ], "header": "@@ -69,6 +69,7 @@ import java.sql.Time;", "removed": [] }, { "added": [], "header": "@@ -2626,7 +2627,6 @@ public abstract class EmbedResultSet extends ConnectionChild", "removed": [ "\t * JDBC 2.0" ] }, { "added": [ "\t\t\tlong length) throws SQLException {" ], "header": "@@ -2645,7 +2645,7 @@ public abstract class EmbedResultSet extends ConnectionChild", "removed": [ "\t\t\tint length) throws SQLException {" ] }, { "added": [], "header": "@@ -2672,7 +2672,6 @@ public abstract class EmbedResultSet extends ConnectionChild", "removed": [ "\t * JDBC 2.0" ] }, { "added": [ "\t\t\tlong length) throws SQLException {" ], "header": "@@ -2691,7 +2690,7 @@ public abstract class EmbedResultSet extends ConnectionChild", "removed": [ "\t\t\tint length) throws SQLException {" ] }, { "added": [ "\t * JDBC 4.0" ], "header": "@@ -2737,7 +2736,7 @@ public abstract class EmbedResultSet extends ConnectionChild", "removed": [ "\t * JDBC 2.0" ] }, { "added": [ "\t\t\tlong length) throws SQLException {" ], "header": "@@ -2756,7 +2755,7 @@ public abstract class EmbedResultSet extends ConnectionChild", "removed": [ "\t\t\tint length) throws SQLException {" ] } ] }, { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedResultSet40.java", "hunks": [ { "added": [ " public void updateNCharacterStream(int columnIndex, Reader x, long length)", " public void updateNCharacterStream(String columnName, Reader x, long length)" ], "header": "@@ -64,12 +64,12 @@ public class EmbedResultSet40 extends org.apache.derby.impl.jdbc.EmbedResultSet2", "removed": [ " public void updateNCharacterStream(int columnIndex, Reader x, int length) ", " public void updateNCharacterStream(String columnName, Reader x, int length)" ] } ] } ]
derby-DERBY-1445-ff7369c4
DERBY-1445: Add new streaming overloads and modify some existing ones. Fix test issues. Patch submitted by V. Narayanan. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@417705 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1458-121b2ed0
DERBY-1458; implement a message check from the build; third attempt - rewritten as an ant-taskdef (not junit). git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@705945 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1459-e3e3ca37
DERBY-1459: Commit bug1459_v04.diff. This introduces a dummy jdbc driver so that JDBC4 driver autoloading will play well with the engine booting which happens when the public embedded driver classloads. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@421717 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/jdbc/EmbeddedDriver.java", "hunks": [ { "added": [ "public class EmbeddedDriver implements Driver {", "\tprivate\tAutoloadedDriver\t_autoloadedDriver;", "\t" ], "header": "@@ -83,13 +83,15 @@ import org.apache.derby.iapi.jdbc.JDBCBoot;", "removed": [ "public class EmbeddedDriver implements Driver {" ] }, { "added": [ "\t\treturn getDriverModule().acceptsURL(url);" ], "header": "@@ -106,7 +108,7 @@ public class EmbeddedDriver implements Driver {", "removed": [ "\t\treturn getRegisteredDriver().acceptsURL(url);" ] }, { "added": [ "\t\treturn getDriverModule().connect(url, info);" ], "header": "@@ -117,7 +119,7 @@ public class EmbeddedDriver implements Driver {", "removed": [ "\t\treturn getRegisteredDriver().connect(url, info);" ] }, { "added": [ "\t\treturn getDriverModule().getPropertyInfo(url, info);" ], "header": "@@ -128,7 +130,7 @@ public class EmbeddedDriver implements Driver {", "removed": [ "\t\treturn getRegisteredDriver().getPropertyInfo(url, info);" ] }, { "added": [ "\t\t\treturn (getDriverModule().getMajorVersion());", "", "\t\t\treturn (getDriverModule().getMinorVersion());" ], "header": "@@ -137,19 +139,20 @@ public class EmbeddedDriver implements Driver {", "removed": [ "\t\t\treturn (getRegisteredDriver().getMajorVersion());", "\t\t\treturn (getRegisteredDriver().getMinorVersion());" ] }, { "added": [ "\t\t\treturn (getDriverModule().jdbcCompliant());", " /**", " * Lookup the booted driver module appropriate to our JDBC level.", " */", "\tprivate\tDriver\tgetDriverModule()", "\t\tthrows SQLException", "\t{", "\t\treturn AutoloadedDriver.getDriverModule();", "\t}", "", "", " /*", "\t** Find the appropriate driver for our JDBC level and boot it.", "\t* This is package protected so that AutoloadedDriver can call it.", "\t*/", "\tstatic void boot() {" ], "header": "@@ -162,14 +165,28 @@ public class EmbeddedDriver implements Driver {", "removed": [ "\t\t\treturn (getRegisteredDriver().jdbcCompliant());", "\tprivate static void boot() {" ] } ] }, { "file": "java/testing/org/apache/derbyTesting/functionTests/util/TestConfiguration.java", "hunks": [ { "added": [ "\t/**", "\t * <p>", "\t * Return true if we expect that the DriverManager will autoload the client driver.", "\t * </p>", "\t */", "\tpublic\tboolean\tautoloading()", "\t\tthrows Exception", "\t{", "\t\t//", "\t\t// DriverManager autoloads the client only as of JDBC4.", "\t\t//", "\t\tif ( !supportsJDBC4() )", "\t\t{", "\t\t\treturn false;", "\t\t}", "", "\t\t//", "\t\t// The DriverManager will autoload drivers specified by the jdbc.drivers", "\t\t// property. ", "\t\t//", "\t\tif ( getSystemStartupProperty( DRIVER_LIST ) != null )", "\t\t{", "\t\t\treturn true;", "\t\t}", "", "\t\t//", "\t\t// The DriverManager will also look inside our jar files for", "\t\t// the generated file META-INF/services/java.sql.Driver. This file", "\t\t// will contain the name of the driver to load. So if we are running", "\t\t// this test against Derby jar files, we expect that the driver will", "\t\t// be autoloaded.", "\t\t//", "\t\t// Note that if we run with a security manager, we get permissions", "\t\t// exception at startup when the driver is autoloaded. This exception", "\t\t// is silently swallowed and the result is that the driver is not", "\t\t// loaded even though we expect it to be.", "\t\t//", "\t\tif ( loadingFromJars() )", "\t\t{", "\t\t\treturn true;", "\t\t}", "", "\t\t//", "\t\t// OK, we've run out of options. We do not expect that the driver", "\t\t// will be autoloaded.", "\t\t//", "", "\t\treturn false;", "\t}", "" ], "header": "@@ -201,6 +201,56 @@ public class TestConfiguration {", "removed": [] }, { "added": [ "\tprivate final static String DRIVER_LIST = \"jdbc.drivers\";" ], "header": "@@ -273,6 +323,7 @@ public class TestConfiguration {", "removed": [] } ] } ]
derby-DERBY-1464-fee55d87
DERBY-578 - Grouped select from temporary table raises null pointer exception in byte code generator DERBY-1464 - runtimestatistics can show that an index is being used even when it isn't Contributed by Manish Khettry The problem is simple enough-- we didn't have a conglomerate name for temporary tables. I fixed the code to behave more like what fillInScanArgs does. Earlier, we would set the indexName field in DistinctScanResult to the conglomerate name (cd.getName()) used to scan the table. If the conglomerate was the base table itself then this was just plain wrong. The change, for this patch, passes null if no index is being used. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@418672 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java", "hunks": [ { "added": [ "\t", " /* helper method used by generateMaxSpecialResultSet and", " * generateDistinctScan to return the name of the index if the ", " * conglomerate is an index. ", " * @param cd Conglomerate for which we need to push the index name", " * @param mb Associated MethodBuilder", " * @throws StandardException", " */", " private void pushIndexName(ConglomerateDescriptor cd, MethodBuilder mb) ", " throws StandardException", " {", " if (cd.isConstraint()) {", " DataDictionary dd = getDataDictionary();", " ConstraintDescriptor constraintDesc = ", " dd.getConstraintDescriptor(tableDescriptor, cd.getUUID());", " mb.push(constraintDesc.getConstraintName());", " } else if (cd.isIndex()) {", " mb.push(cd.getConglomerateName());", " } else {", " // If the conglomerate is the base table itself, make sure we push null.", " // Before the fix for DERBY-578, we would push the base table name ", " // and this was just plain wrong and would cause statistics information to be incorrect.", " mb.pushNull(\"java.lang.String\");", " }", " }", "\t", " private void generateMaxSpecialResultSet" ], "header": "@@ -3085,8 +3085,33 @@ public class FromBaseTable extends FromTable", "removed": [ "", "\tprivate void generateMaxSpecialResultSet" ] }, { "added": [ "\t\t**\t\ttableName,", "\t\t**\t\toptimizeroverride\t\t\t" ], "header": "@@ -3106,7 +3131,8 @@ public class FromBaseTable extends FromTable", "removed": [ "\t\t**\t\ttableName,\t\t\t" ] }, { "added": [ " pushIndexName(cd, mb);" ], "header": "@@ -3132,7 +3158,7 @@ public class FromBaseTable extends FromTable", "removed": [ "\t\tmb.push(cd.getConglomerateName());" ] }, { "added": [ "\t\t**\t\ttableName,", "\t\t**\t\toptimizeroverride\t\t\t" ], "header": "@@ -3167,7 +3193,8 @@ public class FromBaseTable extends FromTable", "removed": [ "\t\t**\t\ttableName,\t\t\t" ] } ] }, { "file": "java/tools/org/apache/derby/impl/tools/ij/xaHelper.java", "hunks": [ { "added": [ " if (fm == null) {", " return;", " }" ], "header": "@@ -64,6 +64,9 @@ class xaHelper implements xaAbstractHelper", "removed": [] } ] } ]
derby-DERBY-1465-056e43e9
DERBY-1465 NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start Backout change until changes from review comments from Dan can be incorporated. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@540809 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java", "hunks": [ { "added": [], "header": "@@ -161,7 +161,6 @@ public final class NetworkServerControlImpl {", "removed": [ "\t" ] }, { "added": [], "header": "@@ -213,12 +212,6 @@ public final class NetworkServerControlImpl {", "removed": [ "\t", "\t/** Any exception that occurs during ", "\t * start up will be saved in this variable and", "\t * thrown by the start method.", "\t */", "\tprivate Exception runtimeException = null;" ] }, { "added": [], "header": "@@ -240,10 +233,6 @@ public final class NetworkServerControlImpl {", "removed": [ "\t/**", "\t * Object to sync the start of network server and wait until server startup is ", "\t * complete", "\t */" ] }, { "added": [], "header": "@@ -321,7 +310,6 @@ public final class NetworkServerControlImpl {", "removed": [ "\tprivate Object serverStartComplete = new Object();" ] }, { "added": [ "\t *", "\tpublic void start(PrintWriter consoleWriter)", "\t{", "\t\tDRDAServerStarter starter = new DRDAServerStarter();", "\t\tstarter.setStartInfo(hostAddress,portNumber,consoleWriter);", " this.setLogWriter(consoleWriter);", "\t\tstartNetworkServer();", "\t\tstarter.boot(false,null);" ], "header": "@@ -578,46 +566,19 @@ public final class NetworkServerControlImpl {", "removed": [ "\t * ", "\t * ", "\tpublic void start(final PrintWriter consoleWriter)", "\t{\t\t", "\t\t ", "\t\t Thread t = new Thread(\"NetworkServerControl\") {", "\t\t\t ", "\t\t public void run() {", "\t\t try {", "\t\t \t blockingStart(consoleWriter);", "\t\t } catch (Exception e) {", "\t\t \truntimeException = e;", "\t\t }", "\t\t }", "\t\t };", "\t\t // if there was an immediate error like", "\t\t // another server already running, throw it here.", "\t\t // ping is still required to verify the server is", "\t\t // up. ", "\t\t ", "\t\t t.start();", "\t\t // We wait on the serverStartComplete object until", "\t\t // blocking_start sends a notify to tell us the ", "\t\t // server is up. Then we throw any exception that ", "\t\t // occurred on startup. blocking_start will remain", "\t\t // blocked on shutdownSync until it gets a shutdown", "\t\t // command.", "\t\t synchronized(serverStartComplete){", "\t\t \tserverStartComplete.wait();", "\t\t }", "\t\t ", "\t\t if (runtimeException != null)", "\t\t \tthrow runtimeException;\t\t ", "\t", "\t" ] }, { "added": [ "\t\tsetLogWriter(consoleWriter);" ], "header": "@@ -673,8 +634,8 @@ public final class NetworkServerControlImpl {", "removed": [ "\t\tsetLogWriter(consoleWriter);" ] }, { "added": [ "\t\t// Open a server socket listener\t " ], "header": "@@ -682,7 +643,7 @@ public final class NetworkServerControlImpl {", "removed": [ "\t\t// Open a server socket listener" ] }, { "added": [], "header": "@@ -715,15 +676,10 @@ public final class NetworkServerControlImpl {", "removed": [ "\t\t", "\t\t} finally {", "\t\t\tsynchronized (serverStartComplete) {", "\t\t\t\tserverStartComplete.notifyAll();", "\t\t\t}" ] }, { "added": [ "\t\t" ], "header": "@@ -744,7 +700,7 @@ public final class NetworkServerControlImpl {", "removed": [ "" ] }, { "added": [ "\t\t\t" ], "header": "@@ -758,9 +714,7 @@ public final class NetworkServerControlImpl {", "removed": [ "\t\t", "", "\t\t" ] } ] } ]
derby-DERBY-1465-36cea34a
DERBY-1465; throw an exception in addition to printing one to the log if NetworkServerControl.start() does not succeed. Committing patch .diff8 git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@729933 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java", "hunks": [ { "added": [], "header": "@@ -62,7 +62,6 @@ import java.util.Vector;", "removed": [ "import org.apache.derby.iapi.jdbc.DRDAServerStarter;" ] }, { "added": [], "header": "@@ -84,7 +83,6 @@ import org.apache.derby.impl.jdbc.EmbedSQLException;", "removed": [ "import org.apache.derby.iapi.security.SecurityUtil;" ] }, { "added": [ " ", "\t/* object to wait on and notify; so we can monitor if a server", "\t * was successfully started */", "\tprivate Object serverStartComplete = new Object();", "", "\t/* for flagging complete boot */", "\tprivate boolean completedBoot = false;" ], "header": "@@ -332,6 +330,13 @@ public final class NetworkServerControlImpl {", "removed": [] }, { "added": [ "\tpublic void start(final PrintWriter consoleWriter)", "\t\tcompletedBoot = false; // reset before we boot ", "\t\tfinal Exception[] exceptionHolder = new Exception[1]; ", "", "\t\t// creating a new thread and calling blockingStart on it", "\t\t// This is similar to calling DRDAServerStarter.boot().", "\t\t// We save any exception from the blockingStart and ", "\t\t// return to the user later. See DERBY-1465.", "\t\tThread t = new Thread(\"NetworkServerControl\") { ", "\t\t\tpublic void run() { ", "\t\t\t\ttry { ", "\t\t\t\t\tblockingStart(consoleWriter); ", "\t\t\t\t} catch (Exception e) { ", "\t\t\t\t\tsynchronized (serverStartComplete) {", "\t\t\t\t\t\texceptionHolder[0] = e; ", "\t\t\t\t\t\tserverStartComplete.notifyAll(); ", "\t\t\t\t\t} ", "\t\t\t\t} ", "\t\t\t} ", "\t\t}; ", "", "\t\t// make it a daemon thread so it exits when the jvm exits", "\t\tt.setDaemon(true);", "", "\t\t// if there was an immediate error like", "\t\t// another server already running, throw it here.", "\t\t// ping is still required to verify the server is up. ", "\t\tt.start(); ", "\t\t// wait until the server has started successfully ", "\t\t// or an error has been detected ", "\t\tsynchronized (serverStartComplete) { ", "\t\t\twhile (!completedBoot && exceptionHolder[0] == null) { ", "\t\t\t\tserverStartComplete.wait(); ", "\t\t\t} ", "\t\t} ", "\t\tif (!completedBoot) { ", "\t\t\t// boot was not successful, throw the exception ", "\t\t\tthrow exceptionHolder[0]; ", "\t\t} " ], "header": "@@ -636,14 +641,47 @@ public final class NetworkServerControlImpl {", "removed": [ "\tpublic void start(PrintWriter consoleWriter)", "\t\tDRDAServerStarter starter = new DRDAServerStarter();", "\t\tstarter.setStartInfo(hostAddress,portNumber,consoleWriter);", " this.setLogWriter(consoleWriter);", "\t\tstartNetworkServer();", "\t\tstarter.boot(false,null);" ] }, { "added": [ "\t\tstartNetworkServer();" ], "header": "@@ -700,8 +738,8 @@ public final class NetworkServerControlImpl {", "removed": [ "\t\tstartNetworkServer();" ] } ] } ]
derby-DERBY-1465-928226b9
DERBY-1465; backing out changes after seeing a hang in replicationTests git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@730187 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.jdbc.DRDAServerStarter;" ], "header": "@@ -62,6 +62,7 @@ import java.util.Vector;", "removed": [] }, { "added": [ "import org.apache.derby.iapi.security.SecurityUtil;" ], "header": "@@ -83,6 +84,7 @@ import org.apache.derby.impl.jdbc.EmbedSQLException;", "removed": [] }, { "added": [], "header": "@@ -330,13 +332,6 @@ public final class NetworkServerControlImpl {", "removed": [ " ", "\t/* object to wait on and notify; so we can monitor if a server", "\t * was successfully started */", "\tprivate Object serverStartComplete = new Object();", "", "\t/* for flagging complete boot */", "\tprivate boolean completedBoot = false;" ] }, { "added": [ "\tpublic void start(PrintWriter consoleWriter)", "\t\tDRDAServerStarter starter = new DRDAServerStarter();", "\t\tstarter.setStartInfo(hostAddress,portNumber,consoleWriter);", " this.setLogWriter(consoleWriter);", "\t\tstartNetworkServer();", "\t\tstarter.boot(false,null);" ], "header": "@@ -641,47 +636,14 @@ public final class NetworkServerControlImpl {", "removed": [ "\tpublic void start(final PrintWriter consoleWriter)", "\t\tcompletedBoot = false; // reset before we boot ", "\t\tfinal Exception[] exceptionHolder = new Exception[1]; ", "", "\t\t// creating a new thread and calling blockingStart on it", "\t\t// This is similar to calling DRDAServerStarter.boot().", "\t\t// We save any exception from the blockingStart and ", "\t\t// return to the user later. See DERBY-1465.", "\t\tThread t = new Thread(\"NetworkServerControl\") { ", "\t\t\tpublic void run() { ", "\t\t\t\ttry { ", "\t\t\t\t\tblockingStart(consoleWriter); ", "\t\t\t\t} catch (Exception e) { ", "\t\t\t\t\tsynchronized (serverStartComplete) {", "\t\t\t\t\t\texceptionHolder[0] = e; ", "\t\t\t\t\t\tserverStartComplete.notifyAll(); ", "\t\t\t\t\t} ", "\t\t\t\t} ", "\t\t\t} ", "\t\t}; ", "", "\t\t// make it a daemon thread so it exits when the jvm exits", "\t\tt.setDaemon(true);", "", "\t\t// if there was an immediate error like", "\t\t// another server already running, throw it here.", "\t\t// ping is still required to verify the server is up. ", "\t\tt.start(); ", "\t\t// wait until the server has started successfully ", "\t\t// or an error has been detected ", "\t\tsynchronized (serverStartComplete) { ", "\t\t\twhile (!completedBoot && exceptionHolder[0] == null) { ", "\t\t\t\tserverStartComplete.wait(); ", "\t\t\t} ", "\t\t} ", "\t\tif (!completedBoot) { ", "\t\t\t// boot was not successful, throw the exception ", "\t\t\tthrow exceptionHolder[0]; ", "\t\t} " ] }, { "added": [ "\t\tsetLogWriter(consoleWriter);" ], "header": "@@ -738,8 +700,8 @@ public final class NetworkServerControlImpl {", "removed": [ "\t\tsetLogWriter(consoleWriter);" ] } ] } ]
derby-DERBY-1465-b700deb3
DERBY-1465 NetworkServerControl.start() should throw an exception and not just print exceptions if the server fails to start git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@540789 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java", "hunks": [ { "added": [ "\t", "\t/** Any exception that occurs during ", "\t * start up will be saved in this variable and", "\t * thrown by the start method.", "\t */" ], "header": "@@ -213,6 +213,11 @@ public final class NetworkServerControlImpl {", "removed": [] }, { "added": [ "\t/**", "\t * Object to sync the start of network server and wait until server startup is ", "\t * complete", "\t */" ], "header": "@@ -235,6 +240,10 @@ public final class NetworkServerControlImpl {", "removed": [] }, { "added": [ "\t\t // We wait on the serverStartComplete object until", "\t\t // blocking_start sends a notify to tell us the ", "\t\t // server is up. Then we throw any exception that ", "\t\t // occurred on startup. blocking_start will remain", "\t\t // blocked on shutdownSync until it gets a shutdown", "\t\t // command." ], "header": "@@ -594,6 +603,12 @@ public final class NetworkServerControlImpl {", "removed": [] } ] } ]
derby-DERBY-1465-c38c5e1d
DERBY-1465; backing out changes of revision 718616; they cause an intermittent hang. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@722639 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java", "hunks": [ { "added": [], "header": "@@ -232,7 +232,6 @@ public final class NetworkServerControlImpl {", "removed": [ "\tprivate Exception runtimeException=null;" ] }, { "added": [], "header": "@@ -333,13 +332,6 @@ public final class NetworkServerControlImpl {", "removed": [ " ", "\t/* object to wait on and notify; so we can monitor if a server", "\t * was successfully started */", "\tprivate Object serverStartComplete = new Object();", "", "\t/* for flagging complete boot */", "\tprivate boolean completedBoot = false;" ] }, { "added": [ "\tpublic void start(PrintWriter consoleWriter)", "\t\tDRDAServerStarter starter = new DRDAServerStarter();", "\t\tstarter.setStartInfo(hostAddress,portNumber,consoleWriter);", " this.setLogWriter(consoleWriter);", "\t\tstartNetworkServer();", "\t\tstarter.boot(false,null);" ], "header": "@@ -644,37 +636,14 @@ public final class NetworkServerControlImpl {", "removed": [ "\tpublic void start(final PrintWriter consoleWriter)", "\t\t// creating a new thread and calling blockingStart on it", "\t\t// This is similar to calling DRDAServerStarter.boot().", "\t\t// We save any exception from the blockingStart and ", "\t\t// return to the user later. See DERBY-1465.", "\t\tThread t = new Thread(\"NetworkServerControl\") {", "", "\t\tpublic void run() {", "\t\t\ttry {", "\t\t\t\tblockingStart(consoleWriter);", "\t\t\t} catch (Exception e) {", "\t\t\t\truntimeException = e;", "\t\t\t}", "\t\t}", "\t};", "\t\t// make it a daemon thread so it exits when the jvm exits", "\t\tt.setDaemon(true);", "\t\t// if there was an immediate error like", "\t\t// another server already running, throw it here.", "\t\t// ping is still required to verify the server is", "\t\t// up. ", "", "\t\tt.start();", "\t\tsynchronized(serverStartComplete){", "\t\twhile (!completedBoot )", "\t\t\tserverStartComplete.wait();", "\t\t}", "\t\tif (runtimeException != null)", "\t\t\tthrow runtimeException; " ] }, { "added": [ "\t\tsetLogWriter(consoleWriter);" ], "header": "@@ -731,8 +700,8 @@ public final class NetworkServerControlImpl {", "removed": [ "\t\tsetLogWriter(consoleWriter);" ] } ] } ]
derby-DERBY-1465-db233518
DERBY-1465; NetworkServerControl.start() should throw an exception - not just print an exception - if the server fails to start Patch initially contributed by Kathey Marsden. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@718616 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java", "hunks": [ { "added": [ "\tprivate Exception runtimeException=null;" ], "header": "@@ -232,6 +232,7 @@ public final class NetworkServerControlImpl {", "removed": [] }, { "added": [ " ", "\t/* object to wait on and notify; so we can monitor if a server", "\t * was successfully started */", "\tprivate Object serverStartComplete = new Object();", "", "\t/* for flagging complete boot */", "\tprivate boolean completedBoot = false;" ], "header": "@@ -332,6 +333,13 @@ public final class NetworkServerControlImpl {", "removed": [] }, { "added": [ "\tpublic void start(final PrintWriter consoleWriter)", "\t\t// creating a new thread and calling blockingStart on it", "\t\t// This is similar to calling DRDAServerStarter.boot().", "\t\t// We save any exception from the blockingStart and ", "\t\t// return to the user later. See DERBY-1465.", "\t\tThread t = new Thread(\"NetworkServerControl\") {", "", "\t\tpublic void run() {", "\t\t\ttry {", "\t\t\t\tblockingStart(consoleWriter);", "\t\t\t} catch (Exception e) {", "\t\t\t\truntimeException = e;", "\t\t\t}", "\t\t}", "\t};", "\t\t// make it a daemon thread so it exits when the jvm exits", "\t\tt.setDaemon(true);", "\t\t// if there was an immediate error like", "\t\t// another server already running, throw it here.", "\t\t// ping is still required to verify the server is", "\t\t// up. ", "", "\t\tt.start();", "\t\tsynchronized(serverStartComplete){", "\t\twhile (!completedBoot )", "\t\t\tserverStartComplete.wait();", "\t\t}", "\t\tif (runtimeException != null)", "\t\t\tthrow runtimeException; " ], "header": "@@ -636,14 +644,37 @@ public final class NetworkServerControlImpl {", "removed": [ "\tpublic void start(PrintWriter consoleWriter)", "\t\tDRDAServerStarter starter = new DRDAServerStarter();", "\t\tstarter.setStartInfo(hostAddress,portNumber,consoleWriter);", " this.setLogWriter(consoleWriter);", "\t\tstartNetworkServer();", "\t\tstarter.boot(false,null);" ] }, { "added": [ "\t\tstartNetworkServer();" ], "header": "@@ -700,8 +731,8 @@ public final class NetworkServerControlImpl {", "removed": [ "\t\tstartNetworkServer();" ] } ] } ]
derby-DERBY-147-be7f461b
DERBY-147: ERROR 42x79 if specify same column twice and use ORDER BY This patch contributed by Bernd Ruehlicke ([email protected]) This patch changes the getOrderByColumn method in ResultColumnList so that it uses ResultColumn.isEquivalent to determine whether the column specified in the ORDER BY clause is ambiguous or not. It is ok to select the ORDER BY column multiple times, so long as all the occurrences are equivalent. If there is an ambiguity, the statement is rejected and the user must reword it to clarify which column is to be used for ordering the results. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@447877 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java", "hunks": [ { "added": [ " /*", " * A comment on 'orderBySelect'. When we encounter a SELECT .. ORDER BY", " * statement, the columns (or expressions) in the ORDER BY clause may", " * or may not have been explicitly mentioned in the SELECT column list.", " * If the columns were NOT explicitly mentioned in the SELECT column", " * list, then the parsing of the ORDER BY clause implicitly generates", " * them into the result column list, because we'll need to have those", " * columns present at execution time in order to sort by them. Those", " * generated columns are added to the *end* of the ResultColumnList, and", " * we keep track of the *number* of those columns in 'orderBySelect',", " * so we can tell whether we are looking at a generated column by seeing", " * whether its position in the ResultColumnList is in the last", " * 'orderBySelect' number of columns. If the SELECT .. ORDER BY", " * statement uses the \"*\" token to select all the columns from a table,", " * then during ORDER BY parsing we redundantly generate the columns", " * mentioned in the ORDER BY clause into the ResultColumnlist, but then", " * later in getOrderByColumn we determine that these are duplicates and", " * we take them back out again.", " */" ], "header": "@@ -110,6 +110,25 @@ public class ResultColumnList extends QueryTreeNodeVector", "removed": [] }, { "added": [ "\t * columnName." ], "header": "@@ -397,7 +416,7 @@ public class ResultColumnList extends QueryTreeNodeVector", "removed": [ "\t * columnName and ensure that there is only one match." ] }, { "added": [ "\t * @exception StandardException thrown on ambiguity" ], "header": "@@ -405,7 +424,7 @@ public class ResultColumnList extends QueryTreeNodeVector", "removed": [ "\t * @exception StandardException thrown on duplicate" ] }, { "added": [ "\t\t\t * names are equal. If they are, then we appear to have found", "\t\t\t* our order by column. If we find our order by column multiple", "\t\t\t* times, make sure that they are truly duplicates, otherwise", "\t\t\t* we have an ambiguous situation. For example, the query", "\t\t\t* SELECT b+c AS a, d+e AS a FROM t ORDER BY a", "\t\t\t* is ambiguous because we don't know which \"a\" is meant. But", "\t\t\t* SELECT t.a, t.* FROM t ORDER BY a", "\t\t\t* is not ambiguous, even though column \"a\" is selected twice.", "\t\t\t* If we find our ORDER BY column at the end of the", "\t\t\t* SELECT column list, in the last 'orderBySelect' number", "\t\t\t* of columns, then this column was not explicitly mentioned", "\t\t\t* by the user in their SELECT column list, but was implicitly ", "\t\t\t* added by the parsing of the ORDER BY clause, and it", "\t\t\t* should be removed from the ResultColumnList and returned", "\t\t\t* to the caller." ], "header": "@@ -436,7 +455,21 @@ public class ResultColumnList extends QueryTreeNodeVector", "removed": [ "\t\t\t * names are equal." ] }, { "added": [ "\t\t\t\telse if (! retVal.isEquivalent(resultColumn))", "\t\t\t\telse if (index >= size - orderBySelect)" ], "header": "@@ -444,11 +477,11 @@ public class ResultColumnList extends QueryTreeNodeVector", "removed": [ "\t\t\t\telse if (index < size - orderBySelect)", "\t\t\t\telse" ] }, { "added": [ "\t * columnName.", "\t * @exception StandardException thrown on ambiguity" ], "header": "@@ -462,13 +495,13 @@ public class ResultColumnList extends QueryTreeNodeVector", "removed": [ "\t * columnName and ensure that there is only one match before the bind process.", "\t * @exception StandardException thrown on duplicate" ] } ] } ]
derby-DERBY-1476-dbbf9ff1
DERBY-1476: PreparedStatement.setNull(int,int) should throw SQLFeatureNotSupportedException for unsupported types derby-1476-v1.diff adds a call to checkForSupportedDataType() in setNull(). It also moves that call in setObject() after 'if (obj == null) { setNull(pos, type); return; }' in order to avoid double checking. New test cases have been added to SetObjectUnsupportedTest so that it tests setObject(int,Object,int), setObject(int,Object,int,int), setNull(int,int) and setNull(int,int,String). git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@421255 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/client/org/apache/derby/client/am/PreparedStatement.java", "hunks": [ { "added": [ " checkForSupportedDataType(jdbcType);" ], "header": "@@ -408,6 +408,7 @@ public class PreparedStatement extends Statement", "removed": [] }, { "added": [], "header": "@@ -1215,7 +1216,6 @@ public class PreparedStatement extends Statement", "removed": [ " checkForSupportedDataType(targetJdbcType);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java", "hunks": [ { "added": [ "\t\tcheckForSupportedDataType(sqlType);" ], "header": "@@ -311,6 +311,7 @@ public abstract class EmbedPreparedStatement", "removed": [] } ] } ]
derby-DERBY-1478-7752cf6d
This patch is for DERBY-2524 (DataTypeDescriptor(DTD) needs to have collation type and collation derivation. These new fields will apply only for character string types. Other types should ignore them.) and it does following 2 things 1)Add collation type and collation derivation attributes and apis to TypeDescriptor interface and it's implementations. 2)Save the collation type in the scale field of character types in writeExternal method of TypeDescriptorImpl. And read the scale field into the collation type for character types in readExternal method of TypeDescriptorImpl. svn stat -q M java\engine\org\apache\derby\iapi\types\DataTypeDescriptor.java M java\engine\org\apache\derby\catalog\TypeDescriptor.java M java\engine\org\apache\derby\catalog\types\TypeDescriptorImpl.java Details of the patch 1)Added getters and setters for collationType and collationDerivation in TypeDescriptor. In addition, TypeDescriptor has new constants defined in them which will be used by the rest of the collation related code in Derby. One of the constants is COLLATION_DERIVATION_INCORRECT I am initializing the collation derivation for all the data types to COLLATION_DERIVATION_INCORRECT in TypeDescriptorImpl. This should get changed to "implicit" or "none" for character string types before the runtime code kicks in. For all the other types, it will remain set to COLLATION_DERIVATION_INCORRECT because collation does not apply to those data types. 2)DTD implements the new apis in the TypeDescriptor interface. 3)2 set of changes went into a)TypeDescriptorImpl has 2 new fields, namely, collationType and collationDerivation. collationDerivation is initialized to TypeDescriptor.COLLATION_DERIVATION_INCORRECT. For character string types, these field should get set correctly. In addition, there are apis to set and get values out of these 2 fields. b)The next change for this class is in writeExternal and readExternal methods. I would like community's feedback on my assumption for this particular change. The collation type of a character string type will get saved in the existing scale field since scale does not apply to character string types. My question is about collation derivation. The collation derivation infromation does not get saved like collation type. But may be that is ok because I am assuming that writeExternal and readExternal get called only for the persistent columns (ie columns belonging to system and user tables). Collation derivation of such character string columns (coming from persistent tables) is always implicit. And, hence in readExternal, for character string types, I can initialize collation derivation to be implicit. My assumption is that readExternal and writeExternal methods will never get called for character string types with collation of none or explicit. Today we don't have explicit as one of the possible values for collation derivation, but a character string type will have the collation derivation of none if it was the result of an aggregate method involving operands with different collation derivations. This comes from item 11) from Section Collation Determination section at http://wiki.apache.org/db-derby/BuiltInLanguageBasedOrderingDERBY-1478 Questions 1)I have included all the constant definitions related to collation in TypeDescriptor. If anyone has suggestion on a better place to define them, let me know. Wonder if there is already a class to define miscellaneous constant definitions like the ones I have added. TypeDescriptor does look like a good place for these constants defined by me because these constants all belong to the data type world. 2)Is it right to assume that readExternal and writeExternal methods in TypeDescriptorImpl will get called only for persistent columns? git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@525568 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/catalog/TypeDescriptor.java", "hunks": [ { "added": [ "\t/**", "\t For a character string type, the collation derivation should always be ", "\t \"explicit\"(not possible in Derby 10.3), \"implicit\" or \"none\". We will ", "\t start by setting it to \"error\" here. But at runtime, no TypeDescriptor ", "\t which belongs to a character string type should ever have a collation ", "\t derivation of \"error\". The initialization to \"error\" is for catching an ", "\t edge(bug) case where the collation derivation may not have gotten set ", "\t correctly for a character string type.", "\t For all the other types (which are not character string types, the ", "\t collation derivation will be set to \"error\".", "\t */", "\tpublic\tstatic\tString COLLATION_DERIVATION_INCORRECT = \"error\";", "\tpublic\tstatic\tString COLLATION_DERIVATION_IMPLICIT = \"implicit\";", "\tpublic\tstatic\tString COLLATION_DERIVATION_NONE = \"none\";", "\t/**", "\t * In Derby 10.3, all the character columns could have a collation type of", "\t * UCS_BASIC. This is same as what we do in Derby 10.3 release. The other", "\t * option in Derby 10.3 is that all the character string types belonging to", "\t * system tables will collate using UCS_BASIC but all the character string", "\t * types belonging to user tables will collate using TERRITORY_BASED", "\t * collation.", "\t */", "\tpublic\tstatic\tint COLLATION_VALUE_UCS_BASIC = 0;", "\tpublic\tstatic\tint COLLATION_VALUE_TERRITORY_BASED = 1;", "" ], "header": "@@ -46,6 +46,31 @@ public interface TypeDescriptor", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/catalog/types/TypeDescriptorImpl.java", "hunks": [ { "added": [ "\t/** @see TypeDescriptor.getCollationType */", "\tprivate int\t\t\t\t\t\tcollationType;", "\t/** @see TypeDescriptor.getCollationDerivation() */", "\tprivate String\t\t\t\t\tcollationDerivation = TypeDescriptor.COLLATION_DERIVATION_INCORRECT;" ], "header": "@@ -52,6 +52,10 @@ public class TypeDescriptorImpl implements TypeDescriptor, Formatable", "removed": [] }, { "added": [ "\t/** @see TypeDescriptor.getCollationType */", "\tpublic int\tgetCollationType()", "\t{", "\t\treturn collationType;", "\t}", "", "\t/** @see TypeDescriptor.setCollationType */", "\tpublic void\tsetCollationType(int collationTypeValue)", "\t{", "\t\tcollationType = collationTypeValue;", "\t}", "", "\t/** @see TypeDescriptor.getCollationDerivation */", "\tpublic String\tgetCollationDerivation()", "\t{", "\t\treturn collationDerivation;", "\t}", "", "\t/** @see TypeDescriptor.setCollationDerivation */", "\tpublic void\tsetCollationDerivation(String collationDerivationValue)", "\t{", "\t\tcollationDerivation = collationDerivationValue;", "\t}", "" ], "header": "@@ -327,6 +331,30 @@ public class TypeDescriptorImpl implements TypeDescriptor, Formatable", "removed": [] }, { "added": [ "\t\t this.collationDerivation.equals(typeDescriptor.getCollationDerivation()) ||", "\t\t this.collationType == typeDescriptor.getCollationType() || " ], "header": "@@ -374,6 +402,8 @@ public class TypeDescriptorImpl implements TypeDescriptor, Formatable", "removed": [] }, { "added": [ "\t\t", "\t\tswitch (typeId.getJDBCTypeId()) {", "\t\tcase Types.CHAR:", "\t\tcase Types.VARCHAR:", "\t\tcase Types.LONGVARCHAR:", "\t\tcase Types.CLOB:", "\t\t\tscale = 0;", "\t\t\tcollationType = in.readInt();", "\t\t\t//I am assuming that the readExternal gets called only on ", "\t\t\t//persistent columns. Since all persistent character string type", "\t\t\t//columns always have the collation derivation of implicit, I will ", "\t\t\t//simply use that value for collation derivation here for character ", "\t\t\t//string type columns.", "\t\t\tcollationDerivation = TypeDescriptor.COLLATION_DERIVATION_IMPLICIT;", "\t\t\tbreak;", "\t\tdefault:", "\t\t\tscale = in.readInt();", "\t\t\tcollationType = 0;", "\t\t\tcollationDerivation = TypeDescriptor.COLLATION_DERIVATION_INCORRECT;", "\t\t\tbreak;", "\t\t}", "\t\t" ], "header": "@@ -396,7 +426,28 @@ public class TypeDescriptorImpl implements TypeDescriptor, Formatable", "removed": [ "\t\tscale = in.readInt();" ] } ] }, { "file": "java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java", "hunks": [ { "added": [ "\t/** @see TypeDescriptor.getCollationType */", "\tpublic int\tgetCollationType()", "\t{", "\t\treturn typeDescriptor.getCollationType();", "\t}", "", "\t/** @see TypeDescriptor.setCollationType */", "\tpublic void\tsetCollationType(int collationTypeValue)", "\t{", "\t\ttypeDescriptor.setCollationType(collationTypeValue);", "\t}", "", "\t/** @see TypeDescriptor.getCollationDerivation */", "\tpublic String\tgetCollationDerivation()", "\t{", "\t\treturn typeDescriptor.getCollationDerivation();", "\t}", "", "\t/** @see TypeDescriptor.setCollationDerivation */", "\tpublic void\tsetCollationDerivation(String collationDerivationValue)", "\t{", "\t\ttypeDescriptor.setCollationDerivation(collationDerivationValue);", "\t}", "" ], "header": "@@ -777,6 +777,30 @@ public final class DataTypeDescriptor implements TypeDescriptor, Formatable", "removed": [] } ] } ]
derby-DERBY-1478-869152fa
DERBY-2335 Made changes such that rather than having a new method in BaseTypeCompiler to push the DVD on the stack at code generation time, we use the existing method that accomplishes the same task in ExpressionClassBuilder. The junit tests have run fine with these changes and the stack trace experienced by Army in DERBY-2335 has been fixed by this fix. The reason for stack trace was that the lifetime of a BaseTypeCompiler is longer than a single class generation and I was trying to hold a reference to a declared method from MethodBuilder.describeMethod across the generated classes. This discussion can be found at http://www.nabble.com/DERBY-1478-subtask-DERBY-2583---need-help-in-debugging-stack-trace-thrown-during-code-generation-p10611184.html git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@538325 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/sql/compile/TypeCompiler.java", "hunks": [ { "added": [ "import org.apache.derby.impl.sql.compile.ExpressionClassBuilder;" ], "header": "@@ -25,6 +25,7 @@ import org.apache.derby.iapi.services.loader.ClassFactory;", "removed": [] }, { "added": [ "\t * @param eb The ExpressionClassBuilder for the class we're generating" ], "header": "@@ -178,6 +179,7 @@ public interface TypeCompiler", "removed": [] }, { "added": [ "\tvoid generateNull(ExpressionClassBuilder eb,", "\t\t\tMethodBuilder mb, int collationType, String className);" ], "header": "@@ -185,7 +187,8 @@ public interface TypeCompiler", "removed": [ "\tvoid generateNull(MethodBuilder mb, int collationType, String className);" ] }, { "added": [ "\t * @param eb The ExpressionClassBuilder for the class we're generating", "\t * @param mb\tThe method to put the expression in" ], "header": "@@ -200,7 +203,8 @@ public interface TypeCompiler", "removed": [ "\t * @param eb\tThe method to put the expression in" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/BaseTypeCompiler.java", "hunks": [ { "added": [ "\t/** @see TypeCompiler#generateNull(ExpressionClassBuilder, MethodBuilder, int, String)*/", "\tpublic void generateNull(ExpressionClassBuilder e,", "\t\t\tMethodBuilder mb, int collationType, " ], "header": "@@ -93,8 +93,9 @@ abstract class BaseTypeCompiler implements TypeCompiler", "removed": [ "\t/** @see TypeCompiler#generateNull(MethodBuilder, int, String) */", "\tpublic void generateNull(MethodBuilder mb, int collationType, " ] }, { "added": [ "\t/** @see TypeCompiler#generateDataValue(ExpressionClassBuilder, MethodBuilder, int, String, LocalField) */", "\tpublic void generateDataValue(ExpressionClassBuilder eb,", "\t\t\tMethodBuilder mb, int collationType," ], "header": "@@ -103,8 +104,9 @@ abstract class BaseTypeCompiler implements TypeCompiler", "removed": [ "\t/** @see TypeCompiler#generateDataValue(MethodBuilder, int, String, LocalField) */", "\tpublic void generateDataValue(MethodBuilder mb, int collationType," ] }, { "added": [ "\t *", "\t * @param eb The ExpressionClassBuilder for the class we're generating" ], "header": "@@ -153,7 +155,8 @@ abstract class BaseTypeCompiler implements TypeCompiler", "removed": [ "\t * " ] }, { "added": [ "\tprotected void generateCollationSensitiveDataValue(", "\t\t\tExpressionClassBuilder eb,", "\t\t\tMethodBuilder mb, " ], "header": "@@ -161,7 +164,9 @@ abstract class BaseTypeCompiler implements TypeCompiler", "removed": [ "\tprotected void generateCollationSensitiveDataValue(MethodBuilder mb, " ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/ExpressionClassBuilder.java", "hunks": [ { "added": [ "public abstract\tclass ExpressionClassBuilder implements ExpressionClassBuilderInterface" ], "header": "@@ -80,7 +80,7 @@ import java.io.Serializable;", "removed": [ "abstract\tclass ExpressionClassBuilder implements ExpressionClassBuilderInterface" ] }, { "added": [ "\t\ttc.generateNull(this, mb, collationType, getBaseClassName());" ], "header": "@@ -870,7 +870,7 @@ abstract\tclass ExpressionClassBuilder implements ExpressionClassBuilderInterface", "removed": [ "\t\ttc.generateNull(mb, collationType, getBaseClassName());" ] }, { "added": [ "\t\ttc.generateNull(this, mb, collationType, getBaseClassName());" ], "header": "@@ -883,7 +883,7 @@ abstract\tclass ExpressionClassBuilder implements ExpressionClassBuilderInterface", "removed": [ "\t\ttc.generateNull(mb, collationType, getBaseClassName());" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/NumericTypeCompiler.java", "hunks": [ { "added": [ "\t/** @see TypeCompiler#generateDataValue(ExpressionClassBuilder, MethodBuilder, int, String, LocalField) */", "\tpublic void generateDataValue(ExpressionClassBuilder eb,", "\t\t\tMethodBuilder mb, int collationType," ], "header": "@@ -530,7 +530,9 @@ public final class NumericTypeCompiler extends BaseTypeCompiler", "removed": [ "\tpublic void generateDataValue(MethodBuilder mb, int collationType," ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/UserDefinedTypeCompiler.java", "hunks": [ { "added": [ "\t/** @see TypeCompiler#generateDataValue(ExpressionClassBuilder, MethodBuilder, int, String, LocalField) */", "\tpublic void generateDataValue(ExpressionClassBuilder eb, MethodBuilder mb, int collationType,", "\t\tsuper.generateDataValue(eb, mb, collationType, className, field);" ], "header": "@@ -118,13 +118,14 @@ public class UserDefinedTypeCompiler extends BaseTypeCompiler", "removed": [ "\tpublic void generateDataValue(MethodBuilder mb, int collationType,", "\t\tsuper.generateDataValue(mb, collationType, className, field);" ] } ] } ]
derby-DERBY-1478-96a630c7
Submitting a patch (DERBY2524_Collation_Info_In_DTD_v2_diff.txt) attached to DERBY-2524. This is a followup to the earlier commited patch (DERBY2524_Collation_Info_In_DTD_v1_diff.txt svn revision 525568) svn stat -q M java\engine\org\apache\derby\iapi\types\DataTypeDescriptor.java M java\engine\org\apache\derby\iapi\types\StringDataValue.java M java\engine\org\apache\derby\catalog\TypeDescriptor.java M java\engine\org\apache\derby\catalog\types\TypeDescriptorImpl.java The patch does following to address feedback received on the earlier patch in thread http://www.nabble.com/-jira--Created%3A-%28DERBY-2524%29-DataTypeDescriptor%28DTD%29-needs-to-have-collation-type-and-collation-derivation.-These-new-fields-will-apply-only-for-character-string-types.-Other-types-should-ignore-them.-p9842379.html 1)Moved the constant definitions from TypeDescriptor to StringDataValue. 2)Added javadoc comments for all the constants. One big javadoc comment for one of the constants in the related constants and other constants in that group will just have a javadoc of @see. 3)I had used string costants for collation derivation since they are more verbose. But that is more expensive than simply using int. As a middle ground, I have defined collation derivation constants as int but the names of the constants are verbose :) I also changed the api for collation derivation to work with int rather than String. Finally, changed collationDerivation from String to int in TypeDescriptorImpl. 4)Rather than using "error" to indicate incorrect collation derivation, we will just initialize collation derivation to "none". For all character string types, the collation derivation should get changed to "implicit" unless we are working with aggregate result type of character string type and the operands to the aggregate have different collation types. 5)Currently, I only save collation type of a persistent character string type column into SYSCOLUMNS's COLUMNDATATYPE column. Collation derivation for such character string type is assumed as "implicit" because that is the only possible option in Derby 10.3 for persistent columns. But in some future release of Derby, when we will start supporting SQL COLLATE clause, we will want to differentiate between "explicit" and "implicit" collation derivation for such persistent columns. So, may be it will be good for us to start saving collation derivation too. For now, I have added this task as a line item under wiki page http://wiki.apache.org/db-derby/BuiltInLanguageBasedOrderingDERBY-1478 under "Performance/Desirable items" section. 6)I caused several javadoc errors for using @see Classname.methodname rather than @see Classname#methodname. Sorry about that. Fixed those errors in this patch. I think with this patch, I have taken care of all the feedback received on the earlier patch DERBY2524_Collation_Info_In_DTD_v1_diff.txt. Again, if anyone has any comment on this committed patch or earlier commit svn revision 525568, please send your feedback on Derby mailing list. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@525729 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/catalog/TypeDescriptor.java", "hunks": [ { "added": [], "header": "@@ -46,31 +46,6 @@ public interface TypeDescriptor", "removed": [ "\t/**", "\t For a character string type, the collation derivation should always be ", "\t \"explicit\"(not possible in Derby 10.3), \"implicit\" or \"none\". We will ", "\t start by setting it to \"error\" here. But at runtime, no TypeDescriptor ", "\t which belongs to a character string type should ever have a collation ", "\t derivation of \"error\". The initialization to \"error\" is for catching an ", "\t edge(bug) case where the collation derivation may not have gotten set ", "\t correctly for a character string type.", "\t For all the other types (which are not character string types, the ", "\t collation derivation will be set to \"error\".", "\t */", "\tpublic\tstatic\tString COLLATION_DERIVATION_INCORRECT = \"error\";", "\tpublic\tstatic\tString COLLATION_DERIVATION_IMPLICIT = \"implicit\";", "\tpublic\tstatic\tString COLLATION_DERIVATION_NONE = \"none\";", "\t/**", "\t * In Derby 10.3, all the character columns could have a collation type of", "\t * UCS_BASIC. This is same as what we do in Derby 10.3 release. The other", "\t * option in Derby 10.3 is that all the character string types belonging to", "\t * system tables will collate using UCS_BASIC but all the character string", "\t * types belonging to user tables will collate using TERRITORY_BASED", "\t * collation.", "\t */", "\tpublic\tstatic\tint COLLATION_VALUE_UCS_BASIC = 0;", "\tpublic\tstatic\tint COLLATION_VALUE_TERRITORY_BASED = 1;", "" ] }, { "added": [ "\t * Set the collation type of this TypeDescriptor", "\t * @param collationTypeValue This will be 0(UCS_BASIC)/1(TERRITORY_BASED)" ], "header": "@@ -180,8 +155,8 @@ public interface TypeDescriptor", "removed": [ "\t * Set the collation type of this DTD", "\t * @param collationDerivationValue This will be UCS_BASIC/TERRITORY_BASED" ] } ] }, { "file": "java/engine/org/apache/derby/catalog/types/TypeDescriptorImpl.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.types.StringDataValue;", "" ], "header": "@@ -26,6 +26,8 @@ import org.apache.derby.iapi.services.io.Formatable;", "removed": [] }, { "added": [ "\t/** @see TypeDescriptor#getCollationType() */", "\t/** @see TypeDescriptor#getCollationDerivation() */", "\tprivate int\t\t\t\t\tcollationDerivation = StringDataValue.COLLATION_DERIVATION_IMPLICIT;" ], "header": "@@ -52,10 +54,10 @@ public class TypeDescriptorImpl implements TypeDescriptor, Formatable", "removed": [ "\t/** @see TypeDescriptor.getCollationType */", "\t/** @see TypeDescriptor.getCollationDerivation() */", "\tprivate String\t\t\t\t\tcollationDerivation = TypeDescriptor.COLLATION_DERIVATION_INCORRECT;" ] }, { "added": [ "\t/** @see TypeDescriptor#getCollationType() */", "\t/** @see TypeDescriptor#setCollationType(int) */", "\t/** @see TypeDescriptor#getCollationDerivation() */", "\tpublic int\tgetCollationDerivation()", "\t/** @see TypeDescriptor#setCollationDerivation(int) */", "\tpublic void\tsetCollationDerivation(int collationDerivationValue)" ], "header": "@@ -331,26 +333,26 @@ public class TypeDescriptorImpl implements TypeDescriptor, Formatable", "removed": [ "\t/** @see TypeDescriptor.getCollationType */", "\t/** @see TypeDescriptor.setCollationType */", "\t/** @see TypeDescriptor.getCollationDerivation */", "\tpublic String\tgetCollationDerivation()", "\t/** @see TypeDescriptor.setCollationDerivation */", "\tpublic void\tsetCollationDerivation(String collationDerivationValue)" ] }, { "added": [ "\t\t this.collationDerivation == typeDescriptor.getCollationDerivation() ||" ], "header": "@@ -402,7 +404,7 @@ public class TypeDescriptorImpl implements TypeDescriptor, Formatable", "removed": [ "\t\t this.collationDerivation.equals(typeDescriptor.getCollationDerivation()) ||" ] }, { "added": [ "\t\t//Scale does not apply to character data types. Starting 10.3 release,", "\t\t//the scale field in TypeDescriptor in SYSCOLUMNS will be used to save", "\t\t//the collation type of the character data types. Because of this, in", "\t\t//this method, we check if we are dealing with character types. If yes,", "\t\t//then read the on-disk scale field of TypeDescriptor into collation", "\t\t//type. In other words, the on-disk scale field has 2 different ", "\t\t//meanings depending on what kind of data type we are dealing with.", "\t\t//For character data types, it really represents the collation type of", "\t\t//the character data type. For all the other data types, it represents", "\t\t//the scale of that data type." ], "header": "@@ -427,6 +429,16 @@ public class TypeDescriptorImpl implements TypeDescriptor, Formatable", "removed": [] }, { "added": [ "\t\t\tcollationDerivation = StringDataValue.COLLATION_DERIVATION_IMPLICIT;", "\t\t\tcollationDerivation = StringDataValue.COLLATION_DERIVATION_IMPLICIT;" ], "header": "@@ -439,12 +451,12 @@ public class TypeDescriptorImpl implements TypeDescriptor, Formatable", "removed": [ "\t\t\tcollationDerivation = TypeDescriptor.COLLATION_DERIVATION_IMPLICIT;", "\t\t\tcollationDerivation = TypeDescriptor.COLLATION_DERIVATION_INCORRECT;" ] } ] }, { "file": "java/engine/org/apache/derby/iapi/types/StringDataValue.java", "hunks": [ { "added": [ "\t/**", "\t For a character string type, the collation derivation should always be ", "\t \"explicit\"(not possible in Derby 10.3), \"implicit\" or \"none\". We will ", "\t start by setting it to \"none\" in TypeDescriptorImpl. At runtime, only ", "\t character string types which are results of aggregate methods dealing ", "\t with operands with different collation types should have a collation ", "\t derivation of \"none\". All the other character string types should have ", "\t their collation derivation set to \"implicit\". ", "\t */", "\tpublic\tstatic\tint COLLATION_DERIVATION_NONE = 0;", "\t/** @see StringDataValue#COLLATION_DERIVATION_NONE */", "\tpublic\tstatic\tint COLLATION_DERIVATION_IMPLICIT = 1;", "\t/** @see StringDataValue#COLLATION_DERIVATION_NONE */", "\tpublic\tstatic\tint COLLATION_DERIVATION_EXPLICIT = 2;", "\t/**", "\t * In Derby 10.3, it is possible to have database with one of the following", "\t * two configurations", "\t * 1)all the character columns will have a collation type of UCS_BASIC. ", "\t * This is same as what we do in Derby 10.2 release. ", "\t * 2)all the character string columns belonging to system tables will have ", "\t * collation type of UCS_BASIC but all the character string columns ", "\t * belonging to user tables will have collation type of TERRITORY_BASED.", "\t */", "\tpublic\tstatic\tint COLLATION_TYPE_UCS_BASIC = 0;", "\t/** @see StringDataValue#COLLATION_TYPE_UCS_BASIC */", "\tpublic\tstatic\tint COLLATION_TYPE_TERRITORY_BASED = 1;", "" ], "header": "@@ -30,6 +30,33 @@ public interface StringDataValue extends ConcatableDataValue", "removed": [] } ] } ]
derby-DERBY-1481-1b7b14f6
DERBY-1481: Client driver: ResultSet.beforeFirst() gives protocol error on scrollable, updatable result sets that are downgraded to read-only When the result set is downgraded from updatable to read-only because the query generating the result set cannot produce an updatable result set, the result set will be downgraded on the server side, and a warning (SQLCARD) indicating the downgrade will be sent to the client. Warnings on the server side are not cleared after they are sent to the client causing the server to send the same warning several times. Positioning commands like ResultSet.beforeFirst() that do not return any data also do not expect warnings to be returned. The protocol error was being caused by this downgrade warning that was being sent several times, one of them being in a response to a ResultSet.beforeFirst() command. The attached patch (derby-1481.diff) fixed the problem by clearing the warnings after they are sent so that the same warning will not be sent more than once. The patch was contributed by Fernanda Pizzorno. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@421887 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1482-0be8cb53
DERBY-1482 This commit adds a new test case which creates a table with LOB column and insets large data into that column. There is a trigger defined on this table but the trigger does not need access to the LOB column. In 10.8 and prior releases, even though we don't need the LOB column to execute the trigger, we still read all the columns from the trigger table when the trigger fired. With 10.9, only the columns required by the firing triggers are read from the trigger table and hence for our test here, LOB column will not be materialized. In 10.8 and prior releases, the trigger defined in this test can run into OOM errors depending on how much heap is available to the upgrade test and hence the test will make sure that we do not fire the trigger is 10.8 and lower. But in 10.9 and higher, OOM won't happen for this test because LOB is never read into memory because it is not needed for the firing trigger. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1134467 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1482-168be4e5
DERBY-1482 / DERBY-5121 Rick Hillegas contributed a very exhaustive trigger test which I am converting to junit and adding to the upgrade suite // The test exhaustively walks through all subsets and permutations // of columns for a trigger which inserts into a side table based on // updates to a master table. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1125453 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1482-3b2562cf
DERBY-1482: Fixed JavaDoc warnings (introduced in r915177). git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@915310 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1482-56bebbea
DERBY-5121 Data corruption when executing an UPDATE trigger With the earlier checkin for DERBY-5121, DERBY-1482 changes weren't completely backed out on trunk and 10.7. We have backed out the code for the triggers so that now triggers look for the columns in their actual column positions at execution time. But DERBY-1482 also made changes to UPDATE code to read only the colunms needed by it and the triggers that it is going to fire. We need to backout the changes to UPDATE code to make sure that it reads all the columns from the trigger table and not do selective column reading. Also adding an upgrade case testing the behavior of UPDATE reading correct columns from the trigger table so that trigger finds the columns it needs. derbyall and junit suite runs fine with these changes git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1087049 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1482-6f271b4b
DERBY-1482/DERBY-5121 Rick Hillegas contributed a trigger test for DERBY-1482/DERBY-5121. With revision 1125453, that test was added to Changes10_8 but this test really is applicable for upgrades from all releases and should not be added into a specific version upgrade test. As a result, I am moving the test from Changes10_8.java to BasicSetup.java. This will ensure that the trigger test will get run for upgrades from all previous releases. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1130895 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1482-c1193bf7
DERBY-5121 Data corruption when executing an UPDATE trigger Committing changes to back out DERBY-1482 out of trunk(10.8 codeline). The changes have already been backed out of 10.7). In addition to engine code backport, it will also disable the tests that were added for DERBY-1482. With DERBY-1482, these tests would not read in large object columns into memory because the triggers didn't need them. But now that DERBY-1482 changes are being backed out, the large object columns will be read in which can cause the test to run out of memory depending on how much heap is available to it. I will disable the tests from 10.7 too. This commit also has a comment in DataDictionaryImpl:getTriggerActionString explaining the code changes for backout. I will add that comment in 10.7 too. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1084718 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java", "hunks": [ { "added": [ "\t\t// DERBY-1482 has caused a regression which is being worked", "\t\t// under DERBY-5121. Until DERBY-5121 is fixed, we want", "\t\t// Derby to create triggers same as it is done in 10.6 and", "\t\t// earlier. This in other words means that do not try to", "\t\t// optimize how many columns are read from the trigger table,", "\t\t// simply read all the columns from the trigger table.", "\t\tboolean in10_7_orHigherVersion = false;" ], "header": "@@ -4716,8 +4716,13 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\tboolean in10_7_orHigherVersion =", "\t\t\tcheckVersion(DataDictionary.DD_VERSION_DERBY_10_7,null);" ] } ] } ]
derby-DERBY-1482-c4728eba
DERBY-1482 (Update triggers on tables with blob columns stream blobs into memory even when the blobs are not referenced/accessed.) Reduced the size of LOBs in the test to 50MB since junit-lowmem gets run with 16MB and hence no need to read unnecessarily larger LOB(the test was testing with 300MB lobs). Also, some subset of tests are relying on DriverManager which is not available with J2ME. I have disabled those subset of tests to not run under J2ME framework. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@957785 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1482-d9d1bc8e
DERBY-1482 Update triggers on tables with blob columns stream blobs into memory even when the blobs are not referenced/accessed. This commit ensures that we read only the necessary columns during triggering sql's execution rather than read all the columns from the trigger table just be cause there is a trigger defined on the table. The triggering sql might need more columns in it's resultset than what a firing trigger might need during it's execution. So, in addition to reading only the columns reuired by the triggering sql(which also includes all the columns required by it's triggers which will get fired), the other thing commit does is to carve out a temporary resulset for every firing trigger with just the columns that the trigger needs. This temporary resultset can be exactly same as the resulset created by the triggering sql or a subset of the resulset created by the triggering sql, it all depends on what columns the firing trigger needs during it's execution. Once the right resulset set is constructed for the firing trigger, the trigger will be able to find the columns referenced in it's trigger action through the REFERENCING clause in the correct positions in the resulset. With this commit, when the trigger action SPSes needs to be regenerated(or for a new trigger, when it is getting generated the first time). the generated trigger action SPSes will look for the columns getting used through the REFERENCING clause through their relative position in the temporary resultset which will be generated for each of the firing triggers. In the prior releases, since we were reading all the columns from the triggering table, the columns were looked in their actual physical position in the trigger table. The commit also ensures that all the above mentioned code changes to be selective about columns getting read from the trigger table should only happen with a database marked as 10.9 release. In prior release databases(in other words, we are in soft-upgrade mode), we do not want to be selective about what columns get read because when soft-upgrade database is taken back to it's original release, that release will not be able to work correctly since it doesn't recognize the column read optimization. The commit also enables the trigger test cases which test that unnecessary LOB columns are not getting read during trigger execution when they are not really needed by the triggering sql and the firing triggers. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1103992 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java", "hunks": [ { "added": [ "\t\t// If we are dealing with database created in 10.8 and prior,", "\t\t// then we must be in soft upgrade mode. For such databases,", "\t\t// we want to generate trigger action sql which assumes that", "\t\t// all columns are getting read from the trigger table. We", "\t\t// need to do this to maintain backward compatibility. ", "\t\tboolean in10_9_orHigherVersion = checkVersion(DataDictionary.DD_VERSION_DERBY_10_9,null);" ], "header": "@@ -4716,13 +4716,12 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\t// DERBY-1482 has caused a regression which is being worked", "\t\t// under DERBY-5121. Until DERBY-5121 is fixed, we want", "\t\t// Derby to create triggers same as it is done in 10.6 and", "\t\t// earlier. This in other words means that do not try to", "\t\t// optimize how many columns are read from the trigger table,", "\t\t// simply read all the columns from the trigger table.", "\t\tboolean in10_7_orHigherVersion = false;" ] }, { "added": [ "\t\t\t//If the database is at 10.8 or earlier version(meaning we are in", "\t\t\t//usage of trigger action columns was introduced in first 10.7 ", "\t\t\t//release (DERBY-1482) but a regression was found (DERBY-5121) and", "\t\t\t//hence we stopped doing the collection of trigger action columns", "\t\t\t//in next version of 10.7 and 10.8. In 10.9, DERBY-1482 was", "\t\t\t//reimplemented correctly and we started doing the collection and", "\t\t\t//usage of trigger action columns again in 10.9" ], "header": "@@ -4838,10 +4837,15 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\t\t//If the database is at 10.6 or earlier version(meaning we are in", "\t\t\t//usage of trigger action columns was introduced in 10.7 DERBY-1482" ] }, { "added": [ "\t\t\t\tif (in10_9_orHigherVersion) {" ], "header": "@@ -4902,7 +4906,7 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\t\t\tif (in10_7_orHigherVersion) {" ] }, { "added": [ " //DERBY-5121 We can come here if the column being used in trigger", " // action is getting dropped and we have come here through that", " // ALTER TABLE DROP COLUMN. In that case, we will not find the", " // column in the trigger table.", " if (triggerColDesc == null) {", " throw StandardException.newException(", " SQLState.LANG_COLUMN_NOT_FOUND, tableName+\".\"+colName);", " }\t\t\t", " int colPositionInTriggerTable = triggerColDesc.getPosition();" ], "header": "@@ -5006,15 +5010,15 @@ public final class\tDataDictionaryImpl", "removed": [ "\t\t\t//DERBY-5121 We can come here if the column being used in trigger", "\t\t\t// action is getting dropped and we have come here through that", "\t\t\t// ALTER TABLE DROP COLUMN. In that case, we will not find the", "\t\t\t// column in the trigger table.", "\t\t\tif (triggerColDesc == null) {", "\t\t\t\tthrow StandardException.newException(", "\t\t SQLState.LANG_COLUMN_NOT_FOUND, tableName+\".\"+colName);", "\t\t\t}", "\t\t\tint colPositionInTriggerTable = triggerColDesc.getPosition();" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java", "hunks": [ { "added": [ " dd, baseTable, updateColumnList, conglomVector, relevantCdl," ], "header": "@@ -905,7 +905,7 @@ public final class UpdateNode extends DMLModStatementNode", "removed": [ " baseTable, updateColumnList, conglomVector, relevantCdl," ] }, { "added": [ "\t * release 10.9 or higher(with the exception of 10.7.1.1 where we", "\t * did collect that information but because of corruption caused", "\t * by those changes, we do not use the information collected by", "\t * 10.7). Starting 10.9, we are collecting trigger action column ", "\t * informatoin so we can be smart about what columns get read ", "\t * during trigger execution. eg", "\t * table. This will cover soft-upgrade scenario for triggers created ", "\t * pre-10.9. ", "\t * eg trigger created prior to 10.9", "\t *\t@param\tdd\tData Dictionary", "\t *\t@param\tbaseTable\tTable on which update is issued" ], "header": "@@ -957,40 +957,30 @@ public final class UpdateNode extends DMLModStatementNode", "removed": [ "\t * release 10.7 or higher. Because prior to that we did not collect", "\t * trigger action column informatoin. eg", "\t * table. This will cover soft-upgrade and hard-upgrade scenario", "\t * for triggers created pre-10.7. This rule prevents us from having", "\t * special logic for soft-upgrade. Additionally, this logic makes", "\t * invalidation of existing triggers unnecessary during ", "\t * hard-upgrade. The pre-10.7 created triggers will work just fine", "\t * even though for some triggers, they would have trigger action", "\t * columns missing. A user can choose to drop and recreate such ", "\t * triggers to take advantage of Rule 3 which will avoid unnecssary", "\t * column reads during trigger execution.", "\t * eg trigger created prior to 10.7", "\t * To reiterate, Rule4) is there to cover triggers created with", "\t * pre-10,7 releases but now that database has been", "\t * hard/soft-upgraded to 10.7 or higher version. Prior to 10.7,", "\t * we did not collect any information about trigger action columns.", "\t * Rule5)The only place we will need special code for soft-upgrade", "\t * is during trigger creation. If we are in soft-upgrade mode, we", "\t * want to make sure that we do not save information about trigger", "\t * action columns in SYSTRIGGERS because the releases prior to 10.7", "\t * do not understand trigger action column information." ] }, { "added": [ "\t\tDataDictionary\t\tdd," ], "header": "@@ -1007,6 +997,7 @@ public final class UpdateNode extends DMLModStatementNode", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/DeleteResultSet.java", "hunks": [ { "added": [ "\t\t\t\t\t\t\t\t\t\t (CursorResultSet)null,", "\t\t\t\t\t\t\t\t\t\t constants.getBaseRowReadMap());" ], "header": "@@ -455,7 +455,8 @@ class DeleteResultSet extends DMLWriteResultSet", "removed": [ "\t\t\t\t\t\t\t\t\t\t (CursorResultSet)null);" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/GenericTriggerExecutor.java", "hunks": [ { "added": [ "\t * @param colsReadFromTable columns required from the trigger table", "\t * by the triggering sql" ], "header": "@@ -81,6 +81,8 @@ public abstract class GenericTriggerExecutor", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java", "hunks": [ { "added": [ "\t\t\t\t\t\t\t\t\t\t\trowHolder.getResultSet(), ", "\t\t\t\t\t\t\t\t\t\t\t(int[])null);" ], "header": "@@ -264,7 +264,8 @@ class InsertResultSet extends DMLWriteResultSet implements TargetResultSet", "removed": [ "\t\t\t\t\t\t\t\t\t\t\trowHolder.getResultSet());" ] }, { "added": [ "\t\t\t\t\t\t\t\t\t\t\t\ttableScan, ", "\t\t\t\t\t\t\t\t\t\t\t\t(int[])null);" ], "header": "@@ -460,7 +461,8 @@ class InsertResultSet extends DMLWriteResultSet implements TargetResultSet", "removed": [ "\t\t\t\t\t\t\t\t\t\t\t\ttableScan);" ] }, { "added": [ "\t\t\t\t\t\t\t\t\t\tgetTableScanResultSet(baseTableConglom), ", "\t\t\t\t\t\t\t\t\t\t(int[])null); " ], "header": "@@ -495,7 +497,8 @@ class InsertResultSet extends DMLWriteResultSet implements TargetResultSet", "removed": [ "\t\t\t\t\t\t\t\t\t\tgetTableScanResultSet(baseTableConglom)); " ] }, { "added": [ "\t\t\t\t\t\t\t\t\t\t\t\trowHolder.getResultSet(), ", "\t\t\t\t\t\t\t\t\t\t\t\t(int[])null);" ], "header": "@@ -1118,7 +1121,8 @@ class InsertResultSet extends DMLWriteResultSet implements TargetResultSet", "removed": [ "\t\t\t\t\t\t\t\t\t\t\t\trowHolder.getResultSet());" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/RowTriggerExecutor.java", "hunks": [ { "added": [ "\t * @param colsReadFromTable columns required from the trigger table", "\t * by the triggering sql" ], "header": "@@ -60,6 +60,8 @@ public class RowTriggerExecutor extends GenericTriggerExecutor", "removed": [] }, { "added": [ "\t\tCursorResultSet \tars,", "\t\tint[]\tcolsReadFromTable" ], "header": "@@ -68,7 +70,8 @@ public class RowTriggerExecutor extends GenericTriggerExecutor", "removed": [ "\t\tCursorResultSet \tars" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/StatementTriggerExecutor.java", "hunks": [ { "added": [ "\t * @param colsReadFromTable columns required from the trigger table", "\t * by the triggering sql" ], "header": "@@ -60,6 +60,8 @@ public class StatementTriggerExecutor extends GenericTriggerExecutor", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/TemporaryRowHolderResultSet.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.sql.dictionary.TriggerDescriptor;" ], "header": "@@ -30,6 +30,7 @@ import org.apache.derby.iapi.sql.Activation;", "removed": [] }, { "added": [ "import org.apache.derby.iapi.sql.dictionary.DataDictionary;" ], "header": "@@ -41,7 +42,7 @@ import org.apache.derby.iapi.store.access.TransactionController;", "removed": [ "" ] }, { "added": [ "\t//Make an array which is a superset of the 2 passed column arrays.", "\t//The superset will not have any duplicates", "\tprivate static int[] supersetofAllColumns(int[] columnsArray1, int[] columnsArray2)", "\t{", "\t\tint maxLength = columnsArray1.length + columnsArray2.length;", "\t\tint[] maxArray = new int[maxLength];", "\t\tfor (int i=0; i<maxLength; i++) maxArray[i]=-1;", "\t\t", "\t\t//First simply copy the first array into superset", "\t\tfor (int i=0; i<columnsArray1.length; i++) {", "\t\t\tmaxArray[i] = columnsArray1[i];", "\t\t}", "\t\t", "\t\t//Now copy only new values from second array into superset", "\t\tint validColsPosition=columnsArray1.length;", "\t\tfor (int i=0; i<columnsArray2.length; i++) {", "\t\t\tboolean found = false;", "\t\t\tfor (int j=0;j<validColsPosition;j++) {", "\t\t\t\tif (maxArray[j] == columnsArray2[i]) {", "\t\t\t\t\tfound = true;", "\t\t\t\t\tbreak;", "\t\t\t\t}", "\t\t\t}", "\t\t\tif (!found) {", "\t\t\t\tmaxArray[validColsPosition] = columnsArray2[i];", "\t\t\t\tvalidColsPosition++;", "\t\t\t}", "\t\t}", "\t\tmaxArray = shrinkArray(maxArray);", "\t\tjava.util.Arrays.sort(maxArray);", "\t\treturn maxArray;", "\t}", "", "\t//The passed array can have some -1 elements and some +ve elements", "\t// Return an array containing just the +ve elements", "\tprivate static int[] shrinkArray(int[] columnsArrary) {", "\t\tint countOfColsRefedInArray = 0;", "\t\tint numberOfColsInTriggerTable = columnsArrary.length;", "", "\t\t//Count number of non -1 entries", "\t\tfor (int i=0; i < numberOfColsInTriggerTable; i++) {", "\t\t\tif (columnsArrary[i] != -1)", "\t\t\t\tcountOfColsRefedInArray++;", "\t\t}", "", "\t\tif (countOfColsRefedInArray > 0){", "\t\t\tint[] tempArrayOfNeededColumns = new int[countOfColsRefedInArray];", "\t\t\tint j=0;", "\t\t\tfor (int i=0; i < numberOfColsInTriggerTable; i++) {", "\t\t\t\tif (columnsArrary[i] != -1)", "\t\t\t\t\ttempArrayOfNeededColumns[j++] = columnsArrary[i];", "\t\t\t}", "\t\t\treturn tempArrayOfNeededColumns;", "\t\t} else", "\t\t\treturn null;", "\t}", "", "\t//Return an array which contains the column positions of all the ", "\t// +ve columns in the passed array", "\tprivate static int[] justTheRequiredColumnsPositions(int[] columnsArrary) {", "\t\tint countOfColsRefedInArray = 0;", "\t\tint numberOfColsInTriggerTable = columnsArrary.length;", "", "\t\t//Count number of non -1 entries", "\t\tfor (int i=0; i < numberOfColsInTriggerTable; i++) {", "\t\t\tif (columnsArrary[i] != -1)", "\t\t\t\tcountOfColsRefedInArray++;", "\t\t}", "", "\t\tif (countOfColsRefedInArray > 0){", "\t\t\tint[] tempArrayOfNeededColumns = new int[countOfColsRefedInArray];", "\t\t\tint j=0;", "\t\t\tfor (int i=0; i < numberOfColsInTriggerTable; i++) {", "\t\t\t\tif (columnsArrary[i] != -1)", "\t\t\t\t\ttempArrayOfNeededColumns[j++] = i+1;", "\t\t\t}", "\t\t\treturn tempArrayOfNeededColumns;", "\t\t} else", "\t\t\treturn null;", "\t}", "\t * row. This row will either have all the columns from", "\t * the current row of the passed resultset or a subset ", "\t * of the columns from the passed resulset. It all depends", "\t * on what columns are needed by the passed trigger and what", "\t * columns exist in the resulset. The Temp resulset", "\t * should only have the columns required by the trigger.", "\t * @param triggerd We are building Temp resultset for this trigger", "\t * @param colsReadFromTable The passed resultset is composed of", "\t * these columns. We will create a temp resultset which", "\t * will have either all these columns or only a subset of", "\t * these columns. It all depends on what columns are needed", "\t * by the trigger. If this param is null, then that means that", "\t * all the columns from the trigger table have been read into", "\t * the passed resultset." ], "header": "@@ -172,13 +173,106 @@ class TemporaryRowHolderResultSet implements CursorResultSet, NoPutResultSet, Cl", "removed": [ "\t * row, the current row of this result set." ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/TriggerEventActivator.java", "hunks": [ { "added": [ "\t * @param colsReadFromTable columns required from the trigger table", "\t * by the triggering sql" ], "header": "@@ -224,6 +224,8 @@ public class TriggerEventActivator", "removed": [] }, { "added": [ "\t\tCursorResultSet\t\tars,", "\t\tint[]\tcolsReadFromTable" ], "header": "@@ -231,7 +233,8 @@ public class TriggerEventActivator", "removed": [ "\t\tCursorResultSet\t\tars" ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/UpdateResultSet.java", "hunks": [ { "added": [ "\t\t\t\t\t\t\t\t\t\t\t\tinsertedRowHolder.getResultSet(),", "\t\t\t\t\t\t\t\t\t\t\t\tconstants.getBaseRowReadMap());" ], "header": "@@ -802,7 +802,8 @@ class UpdateResultSet extends DMLWriteResultSet", "removed": [ "\t\t\t\t\t\t\t\t\t\t\t\tinsertedRowHolder.getResultSet());" ] } ] } ]
derby-DERBY-1482-df731e99
DERBY-5121 Data corruption when executing an UPDATE trigger Changes made for DERBY-1482 caused corruption which is being worked under DERBY-5121. The issue is that the generated trigger action sql could be looking for columns (by positions, not names) in incorrect positions. With DERBY-1482, trigger assumed that the runtime resultset that they will get will only have trigger columns and trigger action columns used through the REFERENCING column. That is an incorrect assumption because the resultset could have more columns if the triggering sql requires more columns. DERBY-1482 changes are in 10.7 and higher codelines. Because of this bug, the changes for DERBY-1482 have been backed out from 10.7 and 10.8 codelines so they now match 10.6 and earlier releases. This in other words means that the resultset presented to the trigger will have all the columns from the trigger table and the trigger action generated sql should look for the columns in the trigger table by their absolution column position in the trigger table. This disabling of code will make sure that all the future triggers get created correctly. The existing triggers at the time of upgrade (to the releases with DERBY-1482 backout changes in them) will get marked invalid and when they fire next time around with the release with DERBY-1482 changes backed out, the regenerated sql for them will be generated again and they will start behaving correctly. So, it is *highly* recommended that the users upgrade from 10.7.1.1 to next point release of 10.7 or to 10.8 git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1085613 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1484-14cec7cc
DERBY-1484: Client and embedded behave differently when the table name is null in DatabaseMetaData methods. Patch file: DERBY-1484-4_ExcFact.diff Patch contributed by Jørgen Løland. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@537882 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.reference.SQLState;" ], "header": "@@ -37,6 +37,7 @@ import org.apache.derby.iapi.error.StandardException;", "removed": [] }, { "added": [ "", " if (table == null) {", " throw Util.generateCsSQLException(", " SQLState.TABLE_NAME_CANNOT_BE_NULL);", " }", "", "\t\ts.setString(3, table); //DERBY-1484; must match table name as stored" ], "header": "@@ -1960,10 +1961,16 @@ public class EmbedDatabaseMetaData extends ConnectionChild", "removed": [ "\t\ts.setString(3, swapNull(table));" ] }, { "added": [ " * @param table a table name" ], "header": "@@ -2040,7 +2047,7 @@ public class EmbedDatabaseMetaData extends ConnectionChild", "removed": [ " * @param tablePattern a table name" ] }, { "added": [ "\t\tString table,", "\t\treturn doGetBestRowId(catalogPattern, schemaPattern, table," ], "header": "@@ -2050,12 +2057,12 @@ public class EmbedDatabaseMetaData extends ConnectionChild", "removed": [ "\t\tString tablePattern,", "\t\treturn doGetBestRowId(catalogPattern, schemaPattern, tablePattern," ] }, { "added": [ "\t\tString schemaPattern, String table, int scope,", "\t\treturn doGetBestRowId(catalogPattern, schemaPattern, table," ], "header": "@@ -2066,10 +2073,10 @@ public class EmbedDatabaseMetaData extends ConnectionChild", "removed": [ "\t\tString schemaPattern, String tablePattern, int scope,", "\t\treturn doGetBestRowId(catalogPattern, schemaPattern, tablePattern," ] }, { "added": [ "\t\tString schemaPattern, String table, int scope,", " if (table == null) {", " throw Util.generateCsSQLException(", " SQLState.TABLE_NAME_CANNOT_BE_NULL);", " }", " " ], "header": "@@ -2083,9 +2090,14 @@ public class EmbedDatabaseMetaData extends ConnectionChild", "removed": [ "\t\tString schemaPattern, String tablePattern, int scope," ] }, { "added": [], "header": "@@ -2098,10 +2110,6 @@ public class EmbedDatabaseMetaData extends ConnectionChild", "removed": [ "\t\tif (tablePattern == null)", "\t\t{", "\t\t\ttablePattern = \"%\";", "\t\t}" ] }, { "added": [ "\t\t\tps.setString(3,table);" ], "header": "@@ -2116,7 +2124,7 @@ public class EmbedDatabaseMetaData extends ConnectionChild", "removed": [ "\t\t\tps.setString(3,tablePattern);" ] }, { "added": [ "\t\t\tps.setString(3,table);" ], "header": "@@ -2145,7 +2153,7 @@ public class EmbedDatabaseMetaData extends ConnectionChild", "removed": [ "\t\t\tps.setString(3,tablePattern);" ] }, { "added": [ "\t\t\tps.setString(3,table);" ], "header": "@@ -2175,7 +2183,7 @@ public class EmbedDatabaseMetaData extends ConnectionChild", "removed": [ "\t\t\tps.setString(3,tablePattern);" ] }, { "added": [ "\t\t\tps.setString(3,table);" ], "header": "@@ -2203,7 +2211,7 @@ public class EmbedDatabaseMetaData extends ConnectionChild", "removed": [ "\t\t\tps.setString(3,tablePattern);" ] }, { "added": [ " if (table == null) {", " throw Util.generateCsSQLException(", " SQLState.TABLE_NAME_CANNOT_BE_NULL);", " }", " ", "\t\ts.setString(3, table); //DERBY-1484: Must match table name as stored" ], "header": "@@ -2266,10 +2274,15 @@ public class EmbedDatabaseMetaData extends ConnectionChild", "removed": [ "\t\ts.setString(3, swapNull(table));" ] }, { "added": [ "", " if (table == null) {", " throw Util.generateCsSQLException(", " SQLState.TABLE_NAME_CANNOT_BE_NULL);", " }", "", "\t\ts.setString(3, table); //DERBY-1484: Must match table name as stored" ], "header": "@@ -2328,9 +2341,15 @@ public class EmbedDatabaseMetaData extends ConnectionChild", "removed": [ "\t\ts.setString(3, swapNull(table));" ] }, { "added": [ " if (table == null) {", " throw Util.generateCsSQLException(", " SQLState.TABLE_NAME_CANNOT_BE_NULL);", " }", "", "\t\ts.setString(3, table); //DERBY-1484: Must match table name as stored" ], "header": "@@ -2404,10 +2423,15 @@ public class EmbedDatabaseMetaData extends ConnectionChild", "removed": [ "\t\ts.setString(3, swapNull(table));" ] }, { "added": [ "", " if (table == null) {", " throw Util.generateCsSQLException(", " SQLState.TABLE_NAME_CANNOT_BE_NULL);", " }", "", "\t\ts.setString(3, table); //DERBY-1484: Must match table name as stored" ], "header": "@@ -2482,10 +2506,16 @@ public class EmbedDatabaseMetaData extends ConnectionChild", "removed": [ "\t\ts.setString(3, swapNull(table));" ] } ] } ]
derby-DERBY-1489-ee5857f3
DERBY-1489: Provide ALTER TABLE DROP COLUMN functionality This patch provides support for ALTER TABLE t DROP COLUMN c. The patch modifies the SQL parser so that it supports statements of the form: ALTER TABLE t DROP [COLUMN] c [CASCADE|RESTRICT] If you don't specify CASCADE or RESTRICT, the default is CASCADE. If you specify RESTRICT, then the column drop will be rejected if it would cause a dependent view, trigger, check constraint, unique constraint, foreign key constraint, or primary key constraint to become invalid. Currently, column privileges are not properly adjusted when dropping a column. This is bug DERBY-1909, and for now we simply reject DROP COLUMN if it is specified when sqlAuthorization is true. When DERBY-1909 is fixed, the tests in altertableDropColumn.sql should be merged into altertable.sql, and altertableDropColumn.sql (and .out) should be removed. This new feature is currently undocumented. DERBY-1926 tracks the documentation changes necessary to document this feature. The execution logic for ALTER TABLE DROP COLUMN is in AlterTableConstantAction, and was not substantially modified by this change. The primary changes to that existing code were: - to hook RESTRICT processing up to the dependency manager so that dependent view processing was sensitive to whether the user had specified CASCADE or RESTRICT - to reread the table descriptor from the catalogs after dropping all the dependent schema objects and before compressing the table, so that the proper scheman information was used during the compress. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@453420 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java", "hunks": [ { "added": [ "\t\t\tcase DependencyManager.DROP_COLUMN_RESTRICT:" ], "header": "@@ -908,6 +908,7 @@ public class SPSDescriptor extends TupleDescriptor", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/iapi/sql/dictionary/ViewDescriptor.java", "hunks": [ { "added": [ "\t\t case DependencyManager.DROP_COLUMN:" ], "header": "@@ -248,6 +248,7 @@ public final class ViewDescriptor extends TupleDescriptor", "removed": [] }, { "added": [ "\t\t // DROP_COLUMN_RESTRICT is similar. Any case which arrives", "\t\t // at this default: statement causes the exception to be", "\t\t // thrown, indicating that the DDL modification should be", "\t\t // rejected because a view is dependent on the underlying", "\t\t // object (table, column, privilege, etc.)" ], "header": "@@ -282,6 +283,11 @@ public final class ViewDescriptor extends TupleDescriptor", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java", "hunks": [ { "added": [ "\t * This routine drops a column from a table, taking care", "\t * to properly handle the various related schema objects.", "\t * ", "\t * The syntax which gets you here is:", "\t * ", "\t * ALTER TABLE tbl DROP [COLUMN] col [CASCADE|RESTRICT]", "\t * ", "\t * The keyword COLUMN is optional, and if you don't", "\t * specify CASCADE or RESTRICT, the default is CASCADE", "\t * (the default is chosen in the parser, not here).", "\t * ", "\t * If you specify RESTRICT, then the column drop should be", "\t * rejected if it would cause a dependent schema object", "\t * to become invalid.", "\t * ", "\t * If you specify CASCADE, then the column drop should", "\t * additionally drop other schema objects which have", "\t * become invalid.", "\t * ", "\t * You may not drop the last (only) column in a table.", "\t * ", "\t * Schema objects of interest include:", "\t * - views", "\t * - triggers", "\t * - constraints", "\t * - check constraints", "\t * - primary key constraints", "\t * - foreign key constraints", "\t * - unique key constraints", "\t * - not null constraints", "\t * - privileges", "\t * - indexes", "\t * - default values", "\t * ", "\t * Dropping a column may also change the column position", "\t * numbers of other columns in the table, which may require", "\t * fixup of schema objects (such as triggers and column", "\t * privileges) which refer to columns by column position number.", "\t * ", "\t * Currently, column privileges are not repaired when", "\t * dropping a column. This is bug DERBY-1909, and for the", "\t * time being we simply reject DROP COLUMN if it is specified", "\t * when sqlAuthorization is true (that check occurs in the", "\t * parser, not here). When DERBY-1909 is fixed:", "\t * - Update this comment", "\t * - Remove the check in dropColumnDefinition() in the parser", "\t * - consolidate all the tests in altertableDropColumn.sql", "\t * back into altertable.sql and remove the separate", "\t * altertableDropColumn files", "\t * ", "\t * Indexes are a bit interesting. The official SQL spec", "\t * doesn't talk about indexes; they are considered to be", "\t * an imlementation-specific performance optimization.", "\t * The current Derby behavior is that:", "\t * - CASCADE/RESTRICT doesn't matter for indexes", "\t * - when a column is dropped, it is removed from any indexes", "\t * which contain it.", "\t * - if that column was the only column in the index, the", "\t * entire index is dropped. ", "\t *", " * @param activation the current activation" ], "header": "@@ -663,6 +663,67 @@ class AlterTableConstantAction extends DDLSingleTableConstantAction", "removed": [] }, { "added": [ "\t\tdm.invalidateFor(td, ", " (cascade ? DependencyManager.DROP_COLUMN", " : DependencyManager.DROP_COLUMN_RESTRICT),", " lcc);" ], "header": "@@ -711,7 +772,10 @@ class AlterTableConstantAction extends DDLSingleTableConstantAction", "removed": [ "\t\tdm.invalidateFor(td, DependencyManager.DROP_COLUMN, lcc);" ] }, { "added": [ "\t\t\t\t// Reject the DROP COLUMN, because there exists a constraint", "\t\t\t\t// which references this column.", "\t\t\t\t//", "\t\t\t\tthrow StandardException.newException(SQLState.LANG_PROVIDER_HAS_DEPENDENT_OBJECT," ], "header": "@@ -812,13 +876,13 @@ class AlterTableConstantAction extends DDLSingleTableConstantAction", "removed": [ "\t\t\t\tif (numRefCols > 1 || cd.getConstraintType() == DataDictionary.PRIMARYKEY_CONSTRAINT)", "\t\t\t\t{", "\t\t\t\t\tthrow StandardException.newException(SQLState.LANG_PROVIDER_HAS_DEPENDENT_OBJECT,", "\t\t\t\t}" ] } ] } ]
derby-DERBY-149-cd24ce30
DERBY-149 Fix Server hang when invalid string is bound to datetime columns. Changes network server to skip only the current DSS and not all chained DSS's when parsing parameter data in SQLDTA. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@291721 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java", "hunks": [ { "added": [ "\t public static String getNameFromJdbcType(int jdbcType) {" ], "header": "@@ -439,7 +439,7 @@ public class TestUtil {", "removed": [ "\t public static String jdbcNameFromJdbc(int jdbcType) {" ] } ] } ]
derby-DERBY-1496-1146ea1a
DERBY-1496 - speeding up NSSecurityMechanismTest by shutting down database before bouncing server, so sleeping is not necessary. Also made methods private where possible. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@533889 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1496-1b46090f
DERBY-1496: committing patch DERBY-1496_20070321.diff. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@521055 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/testing/org/apache/derbyTesting/junit/JDBCDataSource.java", "hunks": [ { "added": [ " // commenting out until such time as setShutdownDatabase is", " // supported by client", " //setBeanProperty(ds, \"shutdownDatabase\", \"shutdown\");", " setBeanProperty(ds, \"connectionAttributes\", \"shutdown=true\");", " // here too, commenting out until setShutdownDatabase is ", " // supported by client", " //clearStringBeanProperty(ds, \"shutdownDatabase\");", " clearStringBeanProperty(ds, \"connectionAttributes\");" ], "header": "@@ -221,14 +221,20 @@ public class JDBCDataSource {", "removed": [ " setBeanProperty(ds, \"shutdownDatabase\", \"shutdown\");", " clearStringBeanProperty(ds, \"shutdownDatabase\");" ] } ] } ]
derby-DERBY-1496-c774a1c4
DERBY-1496 - (initial checkin) Add tests that will replace the various *users* tests, as well as dataSourcePermissions* and testSecMec.java. Some test cases were moved from dataSourcePermissions(_net) to checkDataSource.java. The *AuthenticationTests can not yet be run successfully, because the junit framework's tearDown() attempts to call ds.shutdownDatabase which is not available with ClientDataSources. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@517483 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1500-27190db9
DERBY-1500: PreparedStatement#setObject(int parameterIndex, Object x) throws SQL Exception when binding Short value in embedded mode setObject(int, Byte) is translated to setByte(int, byte) setObject(int, Short) is translated to setShort(int, short) Added test cases in jdbcapi/parameterMapping.java. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@434309 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java", "hunks": [ { "added": [ "\t\t// Byte and Short were added to the table in JDBC 4.0." ], "header": "@@ -1201,6 +1201,7 @@ public abstract class EmbedPreparedStatement", "removed": [] } ] } ]
derby-DERBY-1503-4f9187ed
DERBY-1503: Make jdbc4/StatementEventsTest.junit test callable statements The patch changes StatementEventsTest the following way: 1) New methods setXA() and setCallable() which make it possible to use the same test method to test XAConnection/PooledConnection and PreparedStatement/CallableStatement. 2) Split the test methods into smaller ones. 3) Use asserts to report errors instead of System.out.println(). git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@421218 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-151-078bb792
DERBY-151 Thread termination -> XSDG after operation is 'complete' This patch catches the exception seen by RAFContainer4 readFull/Write/full when the embedding application thread sees an interrupt, and asks the user to inspect the app to find the cause. Before this patch, the symptoms were puzzling to the user, suggesting that the disk might be full. The database level error seen is XSDG9: "Derby thread received an interrupt during a disk I/O operation, please check your application for the source of the interrupt. " A new store test, Derby151Test, checks this behavior. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@886831 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/impl/store/raw/data/FileContainer.java", "hunks": [ { "added": [ "\t * @exception StandardException Derby Standard error policy", " throws IOException, StandardException" ], "header": "@@ -903,9 +903,10 @@ abstract class FileContainer", "removed": [ " throws IOException" ] }, { "added": [ "\t\t@exception StandardException Derby Standard error policy", "\tprotected byte[] getEmbryonicPage(DataInput fileData) throws", "\t\tIOException, StandardException" ], "header": "@@ -919,8 +920,10 @@ abstract class FileContainer", "removed": [ "\tprotected byte[] getEmbryonicPage(DataInput fileData) throws IOException" ] } ] }, { "file": "java/engine/org/apache/derby/impl/store/raw/data/RAFContainer4.java", "hunks": [ { "added": [ "import org.apache.derby.iapi.reference.SQLState;" ], "header": "@@ -23,6 +23,7 @@ package org.apache.derby.impl.store.raw.data;", "removed": [] }, { "added": [ "import java.nio.channels.ClosedByInterruptException;" ], "header": "@@ -33,6 +34,7 @@ import java.io.RandomAccessFile;", "removed": [] }, { "added": [ " throws IOException, StandardException" ], "header": "@@ -422,7 +424,7 @@ class RAFContainer4 extends RAFContainer {", "removed": [ " throws IOException" ] }, { "added": [ " * @throws StandardException if thread is interrupted.", " throws IOException, StandardException" ], "header": "@@ -442,9 +444,10 @@ class RAFContainer4 extends RAFContainer {", "removed": [ " throws IOException" ] }, { "added": [ " * <p/>", " * <p/>", " * @param dstBuffer buffer to read into", " * @param srcChannel channel to read from", " * @param position file position from where to read", " *", " * @throws IOException if an I/O error occurs while reading", " * @throws StandardException If thread is interrupted.", " throws IOException, StandardException", " try {", " if (srcChannel.read(dstBuffer,", " position + dstBuffer.position()) == -1) {", " throw new EOFException(", " \"Reached end of file while attempting to read a \"", " + \"whole page.\");", " }", " } catch (ClosedByInterruptException e) {", " throw StandardException.newException(", " SQLState.FILE_IO_INTERRUPTED, e);" ], "header": "@@ -459,21 +462,32 @@ class RAFContainer4 extends RAFContainer {", "removed": [ " * <p>", " throws IOException", " if( srcChannel.read(dstBuffer, position + dstBuffer.position())", " == -1)", " {", " throw new EOFException(", " \"Reached end of file while attempting to read a \"", " + \"whole page.\");" ] } ] } ]
derby-DERBY-151-59ff24ce
DERBY-151 Thread termination -> XSDG after operation is 'complete' Follow-up patch derby-151-followup; improves the test to also use client/server. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@886963 13f79535-47bb-0310-9956-ffa450edef68
[]
derby-DERBY-1511-ec6fcf1f
DERBY-1511: SELECT clause without a WHERE, causes an Exception when extracting a Blob from a database Disable bulk fetching for table scans that fetch BLOB or CLOB columns, if the cursor is holdable, as the large objects in the internal buffer will not survive across transaction boundaries. git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@997722 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/engine/org/apache/derby/iapi/sql/execute/ResultSetFactory.java", "hunks": [ { "added": [ " @param disableForHoldable Whether or not bulk fetch should be disabled", " at runtime if the cursor is holdable." ], "header": "@@ -969,6 +969,8 @@ public interface ResultSetFactory {", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/BulkTableScanResultSet.java", "hunks": [ { "added": [ " boolean disableForHoldable," ], "header": "@@ -102,6 +102,7 @@ class BulkTableScanResultSet extends TableScanResultSet", "removed": [] }, { "added": [ " adjustBulkFetchSize(activation, rowsPerRead, disableForHoldable)," ], "header": "@@ -128,7 +129,7 @@ class BulkTableScanResultSet extends TableScanResultSet", "removed": [ "\t\t\trowsPerRead," ] } ] }, { "file": "java/engine/org/apache/derby/impl/sql/execute/GenericResultSetFactory.java", "hunks": [ { "added": [ " boolean disableForHoldable," ], "header": "@@ -679,6 +679,7 @@ public class GenericResultSetFactory implements ResultSetFactory", "removed": [] } ] } ]
derby-DERBY-1516-f433a645
DERBY-1516: Inconsistent behavior for getBytes and getSubString for embedded versus network. Contributed by Craig Russell git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@430825 13f79535-47bb-0310-9956-ffa450edef68
[ { "file": "java/client/org/apache/derby/client/am/Blob.java", "hunks": [ { "added": [ " /**", " * Returns as an array of bytes part or all of the <code>BLOB</code>", " * value that this <code>Blob</code> object designates. The byte", " * array contains up to <code>length</code> consecutive bytes", " * starting at position <code>pos</code>.", " * The starting position must be between 1 and the length", " * of the BLOB plus 1. This allows for zero-length BLOB values, from", " * which only zero-length byte arrays can be returned. ", " * If a larger length is requested than there are bytes available,", " * characters from the start position to the end of the BLOB are returned.", " * @param pos the ordinal position of the first byte in the", " * <code>BLOB</code> value to be extracted; the first byte is at", " * position 1", " * @param length is the number of consecutive bytes to be copied", " * @return a byte array containing up to <code>length</code>", " * consecutive bytes from the <code>BLOB</code> value designated", " * by this <code>Blob</code> object, starting with the", " * byte at position <code>startPos</code>.", " * @exception SQLException if there is an error accessing the", " * <code>BLOB</code>", " * NOTE: If the starting position is the length of the BLOB plus 1,", " * zero bytess are returned regardless of the length requested.", " */" ], "header": "@@ -125,8 +125,29 @@ public class Blob extends Lob implements java.sql.Blob {", "removed": [ " // can return an array that may be have a length shorter than the supplied", " // length (no padding occurs)" ] }, { "added": [ " if (pos > this.length() + 1) {", " throw new SqlException(agent_.logWriter_, ", " new ClientMessageId(SQLState.BLOB_POSITION_TOO_LARGE), ", " new Long(pos));", " }" ], "header": "@@ -142,6 +163,11 @@ public class Blob extends Lob implements java.sql.Blob {", "removed": [] }, { "added": [ " // actual length is the lesser of the number of bytes requested", " // and the number of bytes available from pos to the end" ], "header": "@@ -163,14 +189,14 @@ public class Blob extends Lob implements java.sql.Blob {", "removed": [ " // we may need to check for overflow on this cast", "" ] }, { "added": [ " if (start < 1) {", " throw new SqlException(agent_.logWriter_, ", " new ClientMessageId(SQLState.BLOB_BAD_POSITION), ", " new Long(start));", " }" ], "header": "@@ -225,6 +251,11 @@ public class Blob extends Lob implements java.sql.Blob {", "removed": [] } ] }, { "file": "java/client/org/apache/derby/client/am/Clob.java", "hunks": [ { "added": [ " /**", " * Returns a copy of the specified substring", " * in the <code>CLOB</code> value", " * designated by this <code>Clob</code> object.", " * The substring begins at position", " * <code>pos</code> and has up to <code>length</code> consecutive", " * characters. The starting position must be between 1 and the length", " * of the CLOB plus 1. This allows for zero-length CLOB values, from", " * which only zero-length substrings can be returned. ", " * If a larger length is requested than there are characters available,", " * characters to the end of the CLOB are returned.", " * @param pos the first character of the substring to be extracted.", " * The first character is at position 1.", " * @param length the number of consecutive characters to be copied", " * @return a <code>String</code> that is the specified substring in", " * the <code>CLOB</code> value designated by this <code>Clob</code> object", " * @exception SQLException if there is an error accessing the", " * <code>CLOB</code>", "", " * NOTE: If the starting position is the length of the CLOB plus 1,", " * zero characters are returned regardless of the length requested.", " */" ], "header": "@@ -229,6 +229,28 @@ public class Clob extends Lob implements java.sql.Clob {", "removed": [] }, { "added": [], "header": "@@ -244,8 +266,6 @@ public class Clob extends Lob implements java.sql.Clob {", "removed": [ " // We can also do a check for pos > length()", " // Defer it till FP7 so that proper testing can be performed on this" ] }, { "added": [ " if (pos > this.length() + 1) {", " throw new SqlException(agent_.logWriter_, ", " new ClientMessageId(SQLState.BLOB_POSITION_TOO_LARGE), ", " new Long(pos)); ", " }" ], "header": "@@ -258,6 +278,11 @@ public class Clob extends Lob implements java.sql.Clob {", "removed": [] }, { "added": [ " // actual length is the lesser of the length requested", " // and the number of characters available from pos to the end" ], "header": "@@ -276,6 +301,8 @@ public class Clob extends Lob implements java.sql.Clob {", "removed": [] }, { "added": [ " if (start < 1) {", " throw new SqlException(agent_.logWriter_, ", " new ClientMessageId(SQLState.BLOB_BAD_POSITION), ", " new Long(start));", " }" ], "header": "@@ -378,6 +405,11 @@ public class Clob extends Lob implements java.sql.Clob {", "removed": [] } ] }, { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedBlob.java", "hunks": [ { "added": [ " * starting at position <code>startPos</code>.", " * The starting position must be between 1 and the length", " * of the BLOB plus 1. This allows for zero-length BLOB values, from", " * which only zero-length byte arrays can be returned. ", " * If a larger length is requested than there are bytes available,", " * characters from the start position to the end of the BLOB are returned." ], "header": "@@ -294,7 +294,12 @@ final class EmbedBlob extends ConnectionChild implements Blob", "removed": [ " * starting at position <code>pos</code>." ] }, { "added": [ " * byte at position <code>startPos</code>.", " * NOTE: If the starting position is the length of the BLOB plus 1,", " * zero bytess are returned regardless of the length requested." ], "header": "@@ -302,13 +307,12 @@ final class EmbedBlob extends ConnectionChild implements Blob", "removed": [ " * byte at position <code>pos</code>.", " NOTE: return new byte[0] if startPos is too large", " // PT stream part may get pushed to store", "" ] }, { "added": [ " if (length < 0)" ], "header": "@@ -322,7 +326,7 @@ final class EmbedBlob extends ConnectionChild implements Blob", "removed": [ " if (length <= 0)" ] } ] }, { "file": "java/engine/org/apache/derby/impl/jdbc/EmbedClob.java", "hunks": [ { "added": [ " * characters. The starting position must be between 1 and the length", " * of the CLOB plus 1. This allows for zero-length CLOB values, from", " * which only zero-length substrings can be returned. ", " * If a larger length is requested than there are characters available,", " * characters from the start position to the end of the CLOB are returned." ], "header": "@@ -210,7 +210,11 @@ final class EmbedClob extends ConnectionChild implements Clob", "removed": [ " * characters." ] }, { "added": [ " * NOTE: If the starting position is the length of the CLOB plus 1,", " * zero characters are returned regardless of the length requested." ], "header": "@@ -219,9 +223,9 @@ final class EmbedClob extends ConnectionChild implements Clob", "removed": [ " NOTE: return the empty string if pos is too large", "" ] }, { "added": [ " if (length < 0)" ], "header": "@@ -231,7 +235,7 @@ final class EmbedClob extends ConnectionChild implements Clob", "removed": [ " if (length <= 0)" ] } ] } ]