id
stringlengths 22
25
| commit_message
stringlengths 137
6.96k
| diffs
listlengths 0
63
|
|---|---|---|
derby-DERBY-6443-065a81f2
|
DERBY-6443: ArrayIndexOutOfBoundsException when calling function from trigger
StaticMethodCallNode.bindExpression() was a no-op if the node had
already been bound. This caused problems for queries that need to bind
expressions multiple times (for example INSERT INTO ... SELECT).
This fix makes StaticMethodCallNode.bindExpression() work if it's
called a second time, while still making it a no-op if it is called
recursively in order to prevent infinite recursion.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1556809 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/sql/compile/StaticMethodCallNode.java",
"hunks": [
{
"added": [
"",
" /**",
" * This flag is true while bindExpression() is executing. It is used to",
" * avoid infinite recursion when bindExpression() is reentered.",
" */",
" private boolean isInsideBind;"
],
"header": "@@ -107,7 +107,12 @@ class StaticMethodCallNode extends MethodCallNode",
"removed": [
"\tprivate boolean\t\talreadyBound;"
]
},
{
"added": [
" if (isInsideBind) {",
" return this;",
" }",
" isInsideBind = true;",
" try {",
" return bindExpressionMinion(fromList, subqueryList, aggregates);",
" } finally {",
" isInsideBind = false;",
" }",
" }",
" private JavaValueNode bindExpressionMinion(",
" FromList fromList,",
" SubqueryList subqueryList,",
" List<AggregateNode> aggregates)",
" throws StandardException",
" {"
],
"header": "@@ -189,10 +194,24 @@ class StaticMethodCallNode extends MethodCallNode",
"removed": [
"\t\tif (alreadyBound)",
"\t\t\treturn this;"
]
}
]
}
] |
derby-DERBY-6447-584c0fb1
|
DERBY-6447: Use StrictMath for more functions in SYSFUN
Make LOG10, COSH, SINH and TANH use the corresponding methods in
java.lang.StrictMath instead of custom implementations.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1556810 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/catalog/SystemProcedures.java",
"hunks": [
{
"added": [],
"header": "@@ -62,8 +62,6 @@ import org.apache.derby.impl.sql.catalog.XPLAINStatementTimingsDescriptor;",
"removed": [
"import org.apache.derby.iapi.sql.dictionary.CatalogRowFactory;",
"import org.apache.derby.iapi.sql.dictionary.SystemColumn;"
]
},
{
"added": [],
"header": "@@ -1802,24 +1800,6 @@ public class SystemProcedures {",
"removed": [
"\t/**",
"\t * Constant for natural log(10).",
"\t */",
"\tprivate static final double LOG10 = StrictMath.log(10.0d);",
"\t",
"\t/**",
"\t * Base 10 log function. SYSFUN.LOG10",
"\t * Calculated by",
"\t * <code>",
"\t * log(value) / log(10)",
"\t * </code>",
"\t * where log is the natural log.",
"\t */",
"\tpublic static double LOG10(double value)",
"\t{",
"\t\treturn StrictMath.log(value) / LOG10;",
"\t}",
""
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java",
"hunks": [
{
"added": [
" {\"LOG10\", \"DOUBLE\", \"java.lang.StrictMath\", \"log10(double)\", \"true\", \"false\", \"DOUBLE\" },"
],
"header": "@@ -232,7 +232,7 @@ public final class\tDataDictionaryImpl",
"removed": [
" {\"LOG10\", \"DOUBLE\", \"org.apache.derby.catalog.SystemProcedures\", \"LOG10(double)\", \"true\", \"false\", \"DOUBLE\" },"
]
}
]
}
] |
derby-DERBY-6453-f1677626
|
DERBY-6453 Remove dead code in InsertResultSet and flag skipCheckConstraints
Patch _*cleanup-misc-3*_ which removes dead code but inserts asserts
in sane mode if we should somehow end up with triggers in bulk insert
mode and also removes a boolean variable in some interfaces which was
always called with false: {{skipCheckConstraints}}.
It adds a new test case, {{CheckConstraintTest#testbulkInsert}}.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1556938 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/iapi/sql/dictionary/TableDescriptor.java",
"hunks": [
{
"added": [],
"header": "@@ -731,7 +731,6 @@ public class TableDescriptor extends UniqueSQLObjectDescriptor",
"removed": [
"\t * @param\tskipCheckConstraints\tSkip check constraints"
]
},
{
"added": [],
"header": "@@ -745,7 +744,6 @@ public class TableDescriptor extends UniqueSQLObjectDescriptor",
"removed": [
"\t\tboolean\t\t\t\t\t\tskipCheckConstraints,"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/DMLModStatementNode.java",
"hunks": [
{
"added": [],
"header": "@@ -627,7 +627,6 @@ abstract class DMLModStatementNode extends DMLStatementNode",
"removed": [
"\t\tboolean\t\t\t\tskipCheckConstraints,"
]
},
{
"added": [],
"header": "@@ -647,7 +646,6 @@ abstract class DMLModStatementNode extends DMLStatementNode",
"removed": [
"\t\t\t\t\t\t\t\t\t\t\tskipCheckConstraints,"
]
},
{
"added": [],
"header": "@@ -657,11 +655,6 @@ abstract class DMLModStatementNode extends DMLStatementNode",
"removed": [
"\t\t\tif (skipCheckConstraints)",
"\t\t\t{",
"\t\t\t\treturn null;",
"\t\t\t}",
""
]
},
{
"added": [
" * @param cdl The constraint descriptor list"
],
"header": "@@ -804,7 +797,7 @@ abstract class DMLModStatementNode extends DMLStatementNode",
"removed": [
"\t * @param cdl\t\t\t\tThe constriant descriptor list"
]
},
{
"added": [],
"header": "@@ -1286,7 +1279,6 @@ abstract class DMLModStatementNode extends DMLStatementNode",
"removed": [
"\t * @param skipCheckConstraints Skip check constraints"
]
},
{
"added": [],
"header": "@@ -1298,7 +1290,6 @@ abstract class DMLModStatementNode extends DMLStatementNode",
"removed": [
"\t\tboolean\t\t\t\tskipCheckConstraints,"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java",
"hunks": [
{
"added": [],
"header": "@@ -598,7 +598,6 @@ public final class UpdateNode extends DMLModStatementNode",
"removed": [
" false,"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java",
"hunks": [
{
"added": [],
"header": "@@ -144,7 +144,6 @@ class InsertResultSet extends DMLWriteResultSet implements TargetResultSet",
"removed": [
"\tprivate\tboolean\t\t\t\t\thasBeforeStatementTrigger;"
]
},
{
"added": [
" if (triggerInfo != null) {",
" // We do not use bulk insert if we have triggers",
" if (SanityManager.DEBUG) {",
" SanityManager.NOTREACHED();",
" }"
],
"header": "@@ -245,22 +244,11 @@ class InsertResultSet extends DMLWriteResultSet implements TargetResultSet",
"removed": [
"\t\t//System.out.println(\"preprocessrow is called \");",
"\t\t/*",
"\t\t** We can process before row triggers now. All other",
"\t\t** triggers can only be fired after we have inserted",
"\t\t** all our rows.",
"\t\t*/",
"\t\tif (hasBeforeRowTrigger)",
"\t\t{",
"\t\t\t// RESOLVE",
"\t\t\t// Possibly dead code-- if there are triggers we don't do bulk insert.",
"\t\t\trowHolder.truncate();",
"\t\t\trowHolder.insert(execRow);",
"\t\t\ttriggerActivator.notifyEvent(TriggerEvents.BEFORE_INSERT,",
"\t\t\t\t\t\t\t\t\t\t\t(CursorResultSet)null,",
"\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);"
]
},
{
"added": [
" if (checkGM != null) {"
],
"header": "@@ -268,8 +256,7 @@ class InsertResultSet extends DMLWriteResultSet implements TargetResultSet",
"removed": [
"\t\tif (checkGM != null && !hasBeforeStatementTrigger)",
"\t\t{"
]
},
{
"added": [],
"header": "@@ -330,14 +317,6 @@ class InsertResultSet extends DMLWriteResultSet implements TargetResultSet",
"removed": [
"\t\t/*",
"\t\t** If we have a before statement trigger, then",
"\t\t** we cannot check constraints inline.",
"\t\t*/",
"\t\thasBeforeStatementTrigger = (triggerInfo != null) ?",
"\t\t\t\ttriggerInfo.hasTrigger(true, false) :",
"\t\t\t\tfalse;",
""
]
},
{
"added": [
" bulkInsertCore(lcc, fullTemplate, heapConglom);",
" if (triggerInfo != null) {",
" if (SanityManager.DEBUG) {",
" // If we have triggers, we do not use bulkInsert",
" SanityManager.NOTREACHED();",
" }"
],
"header": "@@ -456,55 +435,17 @@ class InsertResultSet extends DMLWriteResultSet implements TargetResultSet",
"removed": [
" long baseTableConglom =",
" bulkInsertCore(lcc, fullTemplate, heapConglom);",
"",
"\t\t\tif (hasBeforeStatementTrigger)",
"\t\t\t{\t",
"\t\t\t\ttableScan = getTableScanResultSet(baseTableConglom); ",
"",
"\t\t\t\t// fire BEFORE trigger, do this before checking constraints",
"\t\t\t\ttriggerActivator.notifyEvent(TriggerEvents.BEFORE_INSERT, ",
"\t\t\t\t\t\t\t\t\t\t\t\t(CursorResultSet)null,",
"\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);",
"\t\t\t",
"\t\t\t\t// if we have a check constraint or generation clauses, we have",
"\t\t\t\t// to do it the hard way now before we get",
"\t\t\t\t// to our AFTER triggers.",
"\t\t\t\tif ((checkGM != null) || (generationClauses != null) )",
"\t\t\t\t{",
"\t\t\t\t\ttableScan = getTableScanResultSet(baseTableConglom); ",
"\t\t\t\t\ttry",
"\t\t\t\t\t{",
"\t\t\t\t\t\tExecRow currRow = null;",
"\t\t\t\t\t\twhile ((currRow = tableScan.getNextRowCore()) != null)",
"\t\t\t\t\t\t{",
"\t\t\t\t\t\t\t// we have to set the source row so the check constraint",
"\t\t\t\t\t\t\t// sees the correct row.",
"\t\t\t\t\t\t\tsourceResultSet.setCurrentRow(currRow);",
" \t\t\t\t\t\t\tevaluateCheckConstraints();",
"\t\t\t\t\t\t}",
"\t\t\t\t\t} finally",
"\t\t\t\t\t{",
"\t\t\t\t\t\tsourceResultSet.clearCurrentRow();",
"\t\t\t\t\t}",
"\t\t\t\t}",
"\t\t\t// if we have an AFTER trigger, let 'er rip",
"\t\t\tif ((triggerInfo != null) && ",
"\t\t\t\t(triggerInfo.hasTrigger(false, true) ||",
"\t\t\t\t triggerInfo.hasTrigger(false, false))) ",
"\t\t\t{",
"\t\t\t\ttriggerActivator.notifyEvent(TriggerEvents.AFTER_INSERT,",
"\t\t\t\t\t\t\t\t\t\t(CursorResultSet)null,",
"\t\t\t\t\t\t\t\t\t\tgetTableScanResultSet(baseTableConglom), ",
"\t\t\t\t\t\t\t\t\t\t(int[])null); ",
"\t\t\t}"
]
},
{
"added": [
" private void bulkInsertCore(LanguageConnectionContext lcc,"
],
"header": "@@ -1319,7 +1260,7 @@ class InsertResultSet extends DMLWriteResultSet implements TargetResultSet",
"removed": [
"\tprivate long bulkInsertCore(LanguageConnectionContext lcc,"
]
},
{
"added": [
" if (triggerInfo != null) {",
" // no triggers in bulk insert mode",
" if (SanityManager.DEBUG) {",
" SanityManager.NOTREACHED();",
" }"
],
"header": "@@ -1339,13 +1280,11 @@ class InsertResultSet extends DMLWriteResultSet implements TargetResultSet",
"removed": [
"\t\tif (triggerInfo != null)",
"\t\t{",
"\t\t\ttriggerActivator = new TriggerEventActivator(lcc, ",
"\t\t\t\t\t\t\t\t\t\tconstants.targetUUID,",
"\t\t\t\t\t\t\t\t\t\ttriggerInfo,",
"\t\t\t\t\t\t\t\t\t\tTriggerExecutionContext.INSERT_EVENT,",
"\t\t\t\t\t\t\t\t\t\tactivation, null);"
]
},
{
"added": [
" return;"
],
"header": "@@ -1417,7 +1356,7 @@ class InsertResultSet extends DMLWriteResultSet implements TargetResultSet",
"removed": [
"\t\t\treturn oldHeapConglom;"
]
}
]
}
] |
derby-DERBY-6455-1d5c5918
|
DERBY-6455: Infinite loop in NetworkServerControlImpl.ensureDataInBuffer
Make NetworkServerControlImpl.ensureDataInBuffer() stop immediately if
it reaches end-of-stream.
Based on patch contributed by Martin Janda.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1559946 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java",
"hunks": [
{
"added": [
" * Ensure the reply buffer is large enough to hold all the data;",
" * @param failOnEOS tells whether or not an error should be raised if",
" * end-of-stream is reached before the requested amount of bytes could",
" * be read",
" private void ensureDataInBuffer(int minimumBytesNeeded, boolean failOnEOS)",
" throws Exception",
" if (bytesRead == -1) {",
" if (failOnEOS) {",
" consolePropertyMessage(",
" \"DRDA_InvalidReplyTooShort.S\", true);",
" }",
" break;",
" } else {",
" replyBufferCount += bytesRead;",
" }"
],
"header": "@@ -2893,21 +2893,33 @@ public final class NetworkServerControlImpl {",
"removed": [
" * Ensure the reply buffer is at large enought to hold all the data;",
" private void ensureDataInBuffer(int minimumBytesNeeded) throws Exception",
" replyBufferCount += bytesRead;"
]
},
{
"added": [
" ensureDataInBuffer(REPLY_HEADER_LENGTH, false);"
],
"header": "@@ -2946,7 +2958,7 @@ public final class NetworkServerControlImpl {",
"removed": [
" ensureDataInBuffer(REPLY_HEADER_LENGTH);"
]
},
{
"added": [
" ensureDataInBuffer(2, true);"
],
"header": "@@ -2964,9 +2976,7 @@ public final class NetworkServerControlImpl {",
"removed": [
" ensureDataInBuffer(2);",
" if (replyBufferPos + 2 > replyBufferCount)",
" consolePropertyMessage(\"DRDA_InvalidReplyTooShort.S\", true);"
]
},
{
"added": [
" ensureDataInBuffer(4, true);"
],
"header": "@@ -2976,9 +2986,7 @@ public final class NetworkServerControlImpl {",
"removed": [
" ensureDataInBuffer(4);",
" if (replyBufferPos + 4 > replyBufferCount)",
" consolePropertyMessage(\"DRDA_InvalidReplyTooShort.S\", true);"
]
},
{
"added": [
" ensureDataInBuffer(strlen, true);"
],
"header": "@@ -3015,9 +3023,7 @@ public final class NetworkServerControlImpl {",
"removed": [
" ensureDataInBuffer(strlen);",
" if (replyBufferPos + strlen > replyBufferCount)",
" consolePropertyMessage(\"DRDA_InvalidReplyTooShort.S\", true);"
]
},
{
"added": [
" ensureDataInBuffer(len, true);"
],
"header": "@@ -3049,9 +3055,7 @@ public final class NetworkServerControlImpl {",
"removed": [
" ensureDataInBuffer(len);",
" if (replyBufferPos + len > replyBufferCount)",
" consolePropertyMessage(\"DRDA_InvalidReplyTooShort.S\", true);"
]
}
]
}
] |
derby-DERBY-6456-4a2a0386
|
DERBY-6456: Infinite loop in NetworkServerControlImpl when reply >= 32k
Make sure the reply buffer in NetworkServerControlImpl is able to hold
the longest possible reply that it could see.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1559943 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-6457-badaed78
|
DERBY-6457: NetworkServerControl API breaks when username or password
contains non-ascii characters
Make NetworkServerControlImpl.writeLDString() write the length in
bytes instead of characters to match how it is read by
NetworkServerControlImpl.readLDString().
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1560311 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/testing/org/apache/derbyTesting/junit/SystemPropertyTestSetup.java",
"hunks": [
{
"added": [
" // Shut down the engine to restore any static properties. Do that",
" // before the properties are reset to their old values, since the",
" // engine shutdown may rely on some of the system properties. For",
" // example, the system properties could contain the user database",
" // (in derby.user.* style properties), and clearing those first",
" // would lead to \"invalid authentication\" errors when attempting",
" // to shut down the engine.",
" try {",
" if (staticProperties) {",
" TestConfiguration.getCurrent().shutdownEngine();",
" }",
" } finally {",
" restoreOldPropertyValues();",
" oldValues = null;",
" }",
" }",
"",
" private void restoreOldPropertyValues() throws Exception {"
],
"header": "@@ -130,6 +130,24 @@ public class SystemPropertyTestSetup extends TestSetup {",
"removed": []
},
{
"added": [
""
],
"header": "@@ -140,12 +158,8 @@ public class SystemPropertyTestSetup extends TestSetup {",
"removed": [
" \t// shutdown engine to restore any static properties",
" \tif (staticProperties)",
" \t\tTestConfiguration.getCurrent().shutdownEngine();",
" oldValues = null;",
" "
]
}
]
}
] |
derby-DERBY-6464-3c6be538
|
DERBY-6464: Make more fields in ResultColumn private; tests passed cleanly on derby-6464-03-aa-morePrivateFields.diff.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1563987 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/sql/compile/ResultColumn.java",
"hunks": [
{
"added": [
"\tprivate boolean\t\t\t_autoincrementGenerated;",
"\tprivate boolean \t\t_autoincrement;",
"\tprivate ColumnReference _reference; // used to verify quals at bind time, if given."
],
"header": "@@ -109,15 +109,15 @@ class ResultColumn extends ValueNode",
"removed": [
"\tboolean\t\t\tautoincrementGenerated;",
"\tboolean \t\tautoincrement;",
"\tColumnReference reference; // used to verify quals at bind time, if given."
]
},
{
"added": [
" _reference = cr;"
],
"header": "@@ -158,7 +158,7 @@ class ResultColumn extends ValueNode",
"removed": [
" this.reference = cr;"
]
},
{
"added": [
" _autoincrement = cd.isAutoincrement();"
],
"header": "@@ -177,7 +177,7 @@ class ResultColumn extends ValueNode",
"removed": [
" this.autoincrement = cd.isAutoincrement();"
]
},
{
"added": [
" _reference = (ColumnReference)expression;"
],
"header": "@@ -195,7 +195,7 @@ class ResultColumn extends ValueNode",
"removed": [
" reference = (ColumnReference)expression;"
]
},
{
"added": [
"\t\t\tSanityManager.ASSERT(_reference == null || ",
"\t\t\t\tname.equals(_reference.getColumnName()), "
],
"header": "@@ -511,8 +511,8 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\t\tSanityManager.ASSERT(reference == null || ",
"\t\t\t\tname.equals(reference.getColumnName()), "
]
},
{
"added": [
"\t\t\tif (_reference != null)",
"\t\t\t\t_reference.treePrint(depth + 1);"
],
"header": "@@ -680,10 +680,10 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\t\tif (reference != null)",
"\t\t\t\treference.treePrint(depth + 1);"
]
},
{
"added": [
"\t\t\t_autoincrement = ((ColumnReference)_expression).getSource().isAutoincrement();"
],
"header": "@@ -742,7 +742,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\t\tautoincrement = ((ColumnReference)_expression).getSource().isAutoincrement();"
]
},
{
"added": [
"\t\tif (_reference != null && _reference.getTableName() != null) ",
"\t\t\t\t\t_reference.getTableName()) ) "
],
"header": "@@ -900,10 +900,10 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tif (reference != null && reference.getTableName() != null) ",
"\t\t\t\t\treference.getTableName()) ) "
]
},
{
"added": [
"\t\t\t\tString refName = _reference.getTableName();"
],
"header": "@@ -911,7 +911,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\t\t\tString refName = reference.getTableName();"
]
},
{
"added": [
"\t\treturn _autoincrementGenerated;",
"\t\t_autoincrementGenerated = true;",
"\t\t_autoincrementGenerated = false;",
"\t\treturn _autoincrement;",
" \t\t_autoincrement = true;"
],
"header": "@@ -1694,27 +1694,27 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\treturn autoincrementGenerated;",
"\t\tautoincrementGenerated = true;",
"\t\tautoincrementGenerated = false;",
"\t\treturn autoincrement;",
" \t\tautoincrement = true;"
]
},
{
"added": [
"\tpublic\tColumnReference\tgetReference() { return _reference; }"
],
"header": "@@ -1787,7 +1787,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\tpublic\tColumnReference\tgetReference() { return reference; }"
]
}
]
}
] |
derby-DERBY-6464-b0456a0d
|
DERBY-6464: Improve encapsulation of ResultColumn and ColumnReference; tests passed cleanly for me on derby-6464-01-aa-makeFieldsPrivate.diff.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1563368 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java",
"hunks": [
{
"added": [
"\t\t\t\tTableName tableName = ref.getQualifiedTableName();"
],
"header": "@@ -4942,7 +4942,7 @@ public final class\tDataDictionaryImpl",
"removed": [
"\t\t\t\tTableName tableName = ref.getTableNameNode();"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/ColumnReference.java",
"hunks": [
{
"added": [
"\tprivate String\t_columnName;",
"\tprivate TableName\t_qualifiedTableName;"
],
"header": "@@ -42,14 +42,14 @@ import org.apache.derby.iapi.util.JBitSet;",
"removed": [
"\tString\tcolumnName;",
"\tTableName\ttableName;"
]
},
{
"added": [
"\tprivate ResultColumn\t_origSource;",
"\tprivate int\t\t\t\t_origTableNumber = -1;",
"\tprivate int\t\t\t\t_origColumnNumber = -1;"
],
"header": "@@ -76,10 +76,10 @@ public class ColumnReference extends ValueNode",
"removed": [
"\tResultColumn\torigSource;",
"\tint\t\t\t\torigTableNumber = -1;",
"\tint\t\t\t\torigColumnNumber = -1;"
]
},
{
"added": [
" _columnName = columnName;",
" _qualifiedTableName = tableName;"
],
"header": "@@ -123,8 +123,8 @@ public class ColumnReference extends ValueNode",
"removed": [
" this.columnName = columnName;",
" this.tableName = tableName;"
]
},
{
"added": [
" _columnName = columnName;",
" _qualifiedTableName = tableName;"
],
"header": "@@ -142,8 +142,8 @@ public class ColumnReference extends ValueNode",
"removed": [
" this.columnName = columnName;",
" this.tableName = tableName;"
]
},
{
"added": [
"\t\t\treturn \"columnName: \" + _columnName + \"\\n\" +",
"\t\t\t\t\"tableName: \" + ( ( _qualifiedTableName != null) ?",
"\t\t\t\t\t\t\t\t _qualifiedTableName.toString() :"
],
"header": "@@ -159,14 +159,14 @@ public class ColumnReference extends ValueNode",
"removed": [
"\t\t\treturn \"columnName: \" + columnName + \"\\n\" +",
"\t\t\t\t\"tableName: \" + ( ( tableName != null) ?",
"\t\t\t\t\t\t\t\t tableName.toString() :"
]
},
{
"added": [
"\t\t\t\t\"nestingLevel on \"+_columnName+\" is not expected to be -1\");",
"\t\t\t\t\"sourceLevel on \"+_columnName+\" is not expected to be -1\");"
],
"header": "@@ -209,9 +209,9 @@ public class ColumnReference extends ValueNode",
"removed": [
"\t\t\t\t\"nestingLevel on \"+columnName+\" is not expected to be -1\");",
"\t\t\t\t\"sourceLevel on \"+columnName+\" is not expected to be -1\");"
]
},
{
"added": [
" new ColumnReference(_columnName, _qualifiedTableName, getContextManager());"
],
"header": "@@ -325,7 +325,7 @@ public class ColumnReference extends ValueNode",
"removed": [
" new ColumnReference(columnName, tableName, getContextManager());"
]
},
{
"added": [
"\t\t_qualifiedTableName = oldCR.getQualifiedTableName();"
],
"header": "@@ -343,7 +343,7 @@ public class ColumnReference extends ValueNode",
"removed": [
"\t\ttableName = oldCR.getTableNameNode();"
]
},
{
"added": [
"\t\t\tthrow StandardException.newException(SQLState.LANG_ILLEGAL_COLUMN_REFERENCE, _columnName);"
],
"header": "@@ -388,7 +388,7 @@ public class ColumnReference extends ValueNode",
"removed": [
"\t\t\tthrow StandardException.newException(SQLState.LANG_ILLEGAL_COLUMN_REFERENCE, columnName);"
]
},
{
"added": [
"\t\tif (_qualifiedTableName == null)",
" {",
"\t\t\treturn _columnName;",
" }",
"\t\treturn _qualifiedTableName.toString() + \".\" + _columnName;"
],
"header": "@@ -413,10 +413,12 @@ public class ColumnReference extends ValueNode",
"removed": [
"\t\tif (tableName == null)",
"\t\t\treturn columnName;",
"\t\treturn tableName.toString() + \".\" + columnName;"
]
},
{
"added": [
"\t\treturn _columnName;"
],
"header": "@@ -427,7 +429,7 @@ public class ColumnReference extends ValueNode",
"removed": [
"\t\treturn columnName;"
]
},
{
"added": [
"\t\treturn ( ( _qualifiedTableName != null) ? _qualifiedTableName.getTableName() : null );"
],
"header": "@@ -469,7 +471,7 @@ public class ColumnReference extends ValueNode",
"removed": [
"\t\treturn ( ( tableName != null) ? tableName.getTableName() : null );"
]
},
{
"added": [
"\tpublic TableName getQualifiedTableName()",
"\t\treturn _qualifiedTableName;",
" void setQualifiedTableName(TableName tableName)",
"\t\t_qualifiedTableName = tableName;"
],
"header": "@@ -519,14 +521,14 @@ public class ColumnReference extends ValueNode",
"removed": [
"\tpublic TableName getTableNameNode()",
"\t\treturn tableName;",
" void setTableNameNode(TableName tableName)",
"\t\tthis.tableName = tableName;"
]
},
{
"added": [
"\t\t\t// SanityManager.ASSERT(_origSource == null,"
],
"header": "@@ -670,7 +672,7 @@ public class ColumnReference extends ValueNode",
"removed": [
"\t\t\t// SanityManager.ASSERT(origSource == null,"
]
},
{
"added": [
"\t\tif (scoped && (_origSource != null))",
"\t\t\t\tcolumnNumber, tableNumber, _columnName, source));",
"\t\t\t_origSource = source;",
"\t\t\torigName = _columnName;",
"\t\t\t_origColumnNumber = columnNumber;",
"\t\t\t_origTableNumber = tableNumber;",
"\t\t_columnName = source.getName();"
],
"header": "@@ -690,24 +692,24 @@ public class ColumnReference extends ValueNode",
"removed": [
"\t\tif (scoped && (origSource != null))",
"\t\t\t\tcolumnNumber, tableNumber, columnName, source));",
"\t\t\torigSource = source;",
"\t\t\torigName = columnName;",
"\t\t\torigColumnNumber = columnNumber;",
"\t\t\torigTableNumber = tableNumber;",
"\t\tcolumnName = source.getName();"
]
},
{
"added": [
"\t\tif (_origSource == null)",
" {",
" }",
"\t\t\t// SanityManager.ASSERT(_origSource != null,",
"\t\t\tsource = _origSource;",
"\t\t\t_origSource = null;",
"\t\t\t_columnName = origName;",
"\t\t\ttableNumber = _origTableNumber;",
"\t\t\tcolumnNumber = _origColumnNumber;"
],
"header": "@@ -732,23 +734,25 @@ public class ColumnReference extends ValueNode",
"removed": [
"\t\tif (origSource == null)",
"\t\t\t// SanityManager.ASSERT(origSource != null,",
"\t\t\tsource = origSource;",
"\t\t\torigSource = null;",
"\t\t\tcolumnName = origName;",
"\t\t\ttableNumber = origTableNumber;",
"\t\t\tcolumnNumber = origColumnNumber;"
]
},
{
"added": [
"\t\t\t_columnName = rI.getColumnName();"
],
"header": "@@ -756,7 +760,7 @@ public class ColumnReference extends ValueNode",
"removed": [
"\t\t\tcolumnName = rI.getColumnName();"
]
},
{
"added": [
"\t\treturn (_origSource != null);"
],
"header": "@@ -772,7 +776,7 @@ public class ColumnReference extends ValueNode",
"removed": [
"\t\treturn (origSource != null);"
]
},
{
"added": [
"\t\t\t\t\t_columnName);",
"\t\t\t\t\t_columnName);"
],
"header": "@@ -837,14 +841,14 @@ public class ColumnReference extends ValueNode",
"removed": [
"\t\t\t\t\tcolumnName);",
"\t\t\t\t\tcolumnName);"
]
},
{
"added": [
" _columnName);",
" ftRC = rcl.getResultColumn(_columnName);",
" \"Failed to find column '\" + _columnName +"
],
"header": "@@ -892,19 +896,19 @@ public class ColumnReference extends ValueNode",
"removed": [
" columnName);",
" ftRC = rcl.getResultColumn(columnName);",
" \"Failed to find column '\" + columnName +"
]
},
{
"added": [
"\t\treturn ( ( _qualifiedTableName != null) ? _qualifiedTableName.getSchemaName() : null );"
],
"header": "@@ -1046,7 +1050,7 @@ public class ColumnReference extends ValueNode",
"removed": [
"\t\treturn ( ( tableName != null) ? tableName.getSchemaName() : null );"
]
},
{
"added": [
"\t\t\t\t&& _columnName.equals(other.getColumnName()));"
],
"header": "@@ -1199,7 +1203,7 @@ public class ColumnReference extends ValueNode",
"removed": [
"\t\t\t\t&& columnName.equals(other.getColumnName()));"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/MatchingClauseNode.java",
"hunks": [
{
"added": [
" ColumnReference leftCR = new ColumnReference( rc.getName(), targetTableName, getContextManager() );"
],
"header": "@@ -317,7 +317,7 @@ public class MatchingClauseNode extends QueryTreeNode",
"removed": [
" ColumnReference leftCR = new ColumnReference( rc.exposedName, targetTableName, getContextManager() );"
]
},
{
"added": [
" origRC.setColumnDescriptor( null, null );"
],
"header": "@@ -535,7 +535,7 @@ public class MatchingClauseNode extends QueryTreeNode",
"removed": [
" origRC.columnDescriptor = null;"
]
},
{
"added": [
" String columnName = _insertColumns.elementAt( i ).getName();"
],
"header": "@@ -834,7 +834,7 @@ public class MatchingClauseNode extends QueryTreeNode",
"removed": [
" String columnName = _insertColumns.elementAt( i ).exposedName;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/MergeNode.java",
"hunks": [
{
"added": [
" TableName origTableName = cr.getQualifiedTableName();"
],
"header": "@@ -352,7 +352,7 @@ public final class MergeNode extends DMLModStatementNode",
"removed": [
" TableName origTableName = cr.tableName;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/OrderByColumn.java",
"hunks": [
{
"added": [
"\t\t\t\tthrow StandardException.newException(SQLState.LANG_DISTINCT_ORDER_BY, cr.getColumnName());"
],
"header": "@@ -218,7 +218,7 @@ class OrderByColumn extends OrderedColumn {",
"removed": [
"\t\t\t\tthrow StandardException.newException(SQLState.LANG_DISTINCT_ORDER_BY, cr.columnName);"
]
},
{
"added": [
" cr.getColumnName(), cr.getQualifiedTableName());"
],
"header": "@@ -390,7 +390,7 @@ class OrderByColumn extends OrderedColumn {",
"removed": [
" cr.getColumnName(), cr.getTableNameNode());"
]
},
{
"added": [
"\t\tif(cr.getQualifiedTableName() != null){",
"\t\t\tTableName tableNameNode = cr.getQualifiedTableName();"
],
"header": "@@ -474,8 +474,8 @@ class OrderByColumn extends OrderedColumn {",
"removed": [
"\t\tif(cr.getTableNameNode() != null){",
"\t\t\tTableName tableNameNode = cr.getTableNameNode();"
]
},
{
"added": [
"\t\t\t\t\tString fullName = cr.getQualifiedTableName().toString();"
],
"header": "@@ -487,7 +487,7 @@ class OrderByColumn extends OrderedColumn {",
"removed": [
"\t\t\t\t\tString fullName = cr.getTableNameNode().toString();"
]
},
{
"added": [
"\t\t\t\t\t\t\tcr.getQualifiedTableName(),"
],
"header": "@@ -512,7 +512,7 @@ class OrderByColumn extends OrderedColumn {",
"removed": [
"\t\t\t\t\t\t\tcr.getTableNameNode(),"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/ResultColumn.java",
"hunks": [
{
"added": [
"\t/* _underlyingName and _derivedColumnName should point to the same string, unless there is a",
"\t * derived column list, in which case _underlyingName will point to the underlying name",
"\t * and _derivedColumnName will point to the name from the derived column list.",
"\t */",
"\tprivate String\t\t\t_underlyingName; // name from the actual data source",
"\tprivate String\t\t\t_derivedColumnName;",
"\tprivate String\t\t\t_unqualifiedTableName;",
"\tprivate String\t\t\t_unqualifiedSourceTableName;",
"\tprivate String\t\t\t_sourceSchemaName;",
"\tprivate ValueNode\t\t_expression;",
"\tprivate ColumnDescriptor\t_columnDescriptor;",
"\tprivate boolean\t\t\t_isGenerated;",
"\tprivate boolean\t\t\t_isGeneratedForUnmatchedColumnInInsert;",
"\tprivate boolean\t\t\t_isGroupingColumn;",
"\tprivate boolean\t\t\t_isReferenced;",
"\tprivate boolean\t\t\t_isRedundant;",
"\tprivate boolean\t\t\t_isNameGenerated;",
"\tprivate boolean\t\t\t_updated;",
"\tprivate boolean\t\t\t_updatableByCursor;"
],
"header": "@@ -64,26 +64,26 @@ import org.apache.derby.iapi.util.StringUtil;",
"removed": [
"\t/* name and exposedName should point to the same string, unless there is a",
"\t * derived column list, in which case name will point to the underlying name",
"\t * and exposedName will point to the name from the derived column list.",
"\t */",
"\tString\t\t\tname;",
"\tString\t\t\texposedName;",
"\tString\t\t\ttableName;",
"\tString\t\t\tsourceTableName;",
"\tString\t\t\tsourceSchemaName;",
"\tValueNode\t\texpression;",
"\tColumnDescriptor\tcolumnDescriptor;",
"\tboolean\t\t\tisGenerated;",
"\tboolean\t\t\tisGeneratedForUnmatchedColumnInInsert;",
"\tboolean\t\t\tisGroupingColumn;",
"\tboolean\t\t\tisReferenced;",
"\tboolean\t\t\tisRedundant;",
"\tboolean\t\t\tisNameGenerated;",
"\tboolean\t\t\tupdated;",
"\tboolean\t\t\tupdatableByCursor;"
]
},
{
"added": [
" String underlyingName,",
" _underlyingName = underlyingName;",
" _derivedColumnName = _underlyingName;"
],
"header": "@@ -132,13 +132,13 @@ class ResultColumn extends ValueNode",
"removed": [
" String name,",
" this.name = name;",
" this.exposedName = this.name;"
]
},
{
"added": [
" _underlyingName = cr.getColumnName();",
" _derivedColumnName = cr.getColumnName();"
],
"header": "@@ -153,8 +153,8 @@ class ResultColumn extends ValueNode",
"removed": [
" this.name = cr.getColumnName();",
" this.exposedName = cr.getColumnName();"
]
},
{
"added": [
" _underlyingName = cd.getColumnName();",
" _derivedColumnName = _underlyingName;",
" _columnDescriptor = cd;"
],
"header": "@@ -173,10 +173,10 @@ class ResultColumn extends ValueNode",
"removed": [
" this.name = cd.getColumnName();",
" this.exposedName = name;",
" this.columnDescriptor = cd;"
]
},
{
"added": [
" if (_expression instanceof ColumnReference) {"
],
"header": "@@ -194,7 +194,7 @@ class ResultColumn extends ValueNode",
"removed": [
" if (expression instanceof ColumnReference) {"
]
},
{
"added": [
"\t * alias (_derivedColumnName), but will also successfully match on the"
],
"header": "@@ -309,7 +309,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t * alias (exposedName), but will also successfully match on the"
]
},
{
"added": [
"\t\treturn columnName.equals(_derivedColumnName) ||",
"\t\t\tcolumnName.equals( _underlyingName ) ||"
],
"header": "@@ -319,8 +319,8 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\treturn columnName.equals(exposedName) ||",
"\t\t\tcolumnName.equals(name) ||"
]
},
{
"added": [
" {",
" }",
"\t\telse if ( _underlyingName != null )",
" {",
"\t\t\treturn _underlyingName;",
" }",
" {",
"\t\t\treturn _derivedColumnName;",
" }"
],
"header": "@@ -346,11 +346,17 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\telse if (name != null)",
"\t\t\treturn name;",
"\t\t\treturn exposedName;"
]
},
{
"added": [
"\t\tif (_expression instanceof ColumnReference)",
"\t\t\treturn ((ColumnReference)_expression).getColumnName();"
],
"header": "@@ -359,8 +365,8 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tif (expression instanceof ColumnReference)",
"\t\t\treturn ((ColumnReference)expression).getColumnName();"
]
},
{
"added": [
"\t\treturn _derivedColumnName;",
"\t\tif ((_columnDescriptor!=null) &&",
"\t\t\t(_columnDescriptor.getTableDescriptor() != null))",
"\t\t\treturn _columnDescriptor.getTableDescriptor().getSchemaName();",
"\t\t\tif (_expression != null)",
"\t\t\t\treturn _expression.getSchemaName();"
],
"header": "@@ -370,20 +376,20 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\treturn exposedName;",
"\t\tif ((columnDescriptor!=null) &&",
"\t\t\t(columnDescriptor.getTableDescriptor() != null))",
"\t\t\treturn columnDescriptor.getTableDescriptor().getSchemaName();",
"\t\t\tif (expression != null)",
"\t\t\t\treturn expression.getSchemaName();"
]
},
{
"added": [
"\t\tif (_unqualifiedTableName != null)",
"\t\t\treturn _unqualifiedTableName;",
"\t\tif ((_columnDescriptor!=null) &&",
"\t\t\t(_columnDescriptor.getTableDescriptor() != null))",
"\t\t\treturn _columnDescriptor.getTableDescriptor().getName();",
"\t\t\treturn _expression.getTableName();"
],
"header": "@@ -392,18 +398,18 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tif (tableName != null)",
"\t\t\treturn tableName;",
"\t\tif ((columnDescriptor!=null) &&",
"\t\t\t(columnDescriptor.getTableDescriptor() != null))",
"\t\t\treturn columnDescriptor.getTableDescriptor().getName();",
"\t\t\treturn expression.getTableName();"
]
},
{
"added": [
"\t\treturn _unqualifiedSourceTableName;"
],
"header": "@@ -412,7 +418,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\treturn sourceTableName;"
]
},
{
"added": [
"\t\treturn _sourceSchemaName;"
],
"header": "@@ -420,7 +426,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\treturn sourceSchemaName;"
]
},
{
"added": [
"\t\tif (_expression instanceof ColumnReference)",
"\t\t\t((ColumnReference) _expression).setQualifiedTableName( (TableName) null );"
],
"header": "@@ -429,9 +435,9 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tif (expression instanceof ColumnReference)",
"\t\t\t((ColumnReference) expression).setTableNameNode((TableName) null);"
]
},
{
"added": [
"\t\tif (_columnDescriptor!=null)",
"\t\t\treturn _columnDescriptor.getPosition();"
],
"header": "@@ -442,8 +448,8 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tif (columnDescriptor!=null)",
"\t\t\treturn columnDescriptor.getPosition();"
]
},
{
"added": [
"\t\t_expression = expression;"
],
"header": "@@ -461,7 +467,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tthis.expression = expression;"
]
},
{
"added": [
"\t\treturn _expression;"
],
"header": "@@ -472,7 +478,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\treturn expression;"
]
},
{
"added": [
"\t\tif ( _underlyingName == null )",
"\t\t\t_underlyingName = name;"
],
"header": "@@ -499,9 +505,9 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tif (this.name == null)",
"\t\t\tthis.name = name;"
]
},
{
"added": [
"\t\t_derivedColumnName = name;"
],
"header": "@@ -510,7 +516,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tthis.exposedName = name;"
]
},
{
"added": [
"\t\treturn _isNameGenerated;"
],
"header": "@@ -518,7 +524,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\treturn isNameGenerated;"
]
},
{
"added": [
"\t\t_isNameGenerated = value;"
],
"header": "@@ -526,7 +532,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tisNameGenerated = value;"
]
},
{
"added": [
"\t\tif (_columnDescriptor == null && virtualColumnId > removedColumnId)"
],
"header": "@@ -600,7 +606,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tif (columnDescriptor == null && virtualColumnId > removedColumnId)"
]
},
{
"added": [
"\t\tif (_derivedColumnName == null)",
"\t\t\t_derivedColumnName =\"SQLCol\" + getCompilerContext().getNextColumnNumber();",
"\t\t\t_isNameGenerated = true;"
],
"header": "@@ -612,11 +618,11 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tif (exposedName == null)",
"\t\t\texposedName =\"SQLCol\" + getCompilerContext().getNextColumnNumber();",
"\t\t\tisNameGenerated = true;"
]
},
{
"added": [
"\t\t\treturn \"derivedColumnName: \" + _derivedColumnName + \"\\n\" +",
"\t\t\t\t\"underlyingName: \" + _underlyingName + \"\\n\" +",
"\t\t\t\t\"tableName: \" + _unqualifiedTableName + \"\\n\" +",
"\t\t\t\t\"isNameGenerated: \" + _isNameGenerated + \"\\n\" +",
"\t\t\t\t\"sourceTableName: \" + _unqualifiedSourceTableName + \"\\n\" +",
"\t\t\t\t\"columnDescriptor: \" + _columnDescriptor + \"\\n\" +",
"\t\t\t\t\"isGenerated: \" + _isGenerated + \"\\n\" +",
"\t\t\t\t\"isGeneratedForUnmatchedColumnInInsert: \" + _isGeneratedForUnmatchedColumnInInsert + \"\\n\" +",
"\t\t\t\t\"isGroupingColumn: \" + _isGroupingColumn + \"\\n\" +",
"\t\t\t\t\"isReferenced: \" + _isReferenced + \"\\n\" +",
"\t\t\t\t\"isRedundant: \" + _isRedundant + \"\\n\" +"
],
"header": "@@ -631,20 +637,20 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\t\treturn \"exposedName: \" + exposedName + \"\\n\" +",
"\t\t\t\t\"name: \" + name + \"\\n\" +",
"\t\t\t\t\"tableName: \" + tableName + \"\\n\" +",
"\t\t\t\t\"isNameGenerated: \" + isNameGenerated + \"\\n\" +",
"\t\t\t\t\"sourceTableName: \" + sourceTableName + \"\\n\" +",
"\t\t\t\t\"columnDescriptor: \" + columnDescriptor + \"\\n\" +",
"\t\t\t\t\"isGenerated: \" + isGenerated + \"\\n\" +",
"\t\t\t\t\"isGeneratedForUnmatchedColumnInInsert: \" + isGeneratedForUnmatchedColumnInInsert + \"\\n\" +",
"\t\t\t\t\"isGroupingColumn: \" + isGroupingColumn + \"\\n\" +",
"\t\t\t\t\"isReferenced: \" + isReferenced + \"\\n\" +",
"\t\t\t\t\"isRedundant: \" + isRedundant + \"\\n\" +"
]
},
{
"added": [
"\t\t\tif (_expression != null)",
"\t\t\t\t_expression.treePrint(depth + 1);"
],
"header": "@@ -669,10 +675,10 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\t\tif (expression != null)",
"\t\t\t\texpression.treePrint(depth + 1);"
]
},
{
"added": [
"\t\tif (_expression.requiresTypeFromContext())",
"\t\t\t\t_expression.setType(getTypeServices());"
],
"header": "@@ -709,11 +715,11 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tif (expression.requiresTypeFromContext())",
"\t\t\t\texpression.setType(getTypeServices());"
]
},
{
"added": [
"\t\tif (_expression.getTableName() == null) {",
"\t\tsetExpression( _expression.bindExpression(fromList, subqueryList,",
"\t\tif (_expression instanceof ColumnReference)",
"\t\t\tautoincrement = ((ColumnReference)_expression).getSource().isAutoincrement();"
],
"header": "@@ -727,16 +733,16 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tif (expression.getTableName() == null) {",
"\t\tsetExpression( expression.bindExpression(fromList, subqueryList,",
"\t\tif (expression instanceof ColumnReference)",
"\t\t\tautoincrement = ((ColumnReference)expression).getSource().isAutoincrement();"
]
},
{
"added": [
" colDesc = tableDescriptor.getColumnDescriptor(_derivedColumnName);"
],
"header": "@@ -815,7 +821,7 @@ class ResultColumn extends ValueNode",
"removed": [
" colDesc = tableDescriptor.getColumnDescriptor(exposedName);"
]
},
{
"added": [
"\t\t\tthrow StandardException.newException(SQLState.LANG_COLUMN_NOT_FOUND_IN_TABLE, _derivedColumnName, errorString);"
],
"header": "@@ -828,7 +834,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\t\tthrow StandardException.newException(SQLState.LANG_COLUMN_NOT_FOUND_IN_TABLE, exposedName, errorString);"
]
},
{
"added": [
" if( _expression instanceof UntypedNullConstantNode)",
" else if( ( _expression instanceof ColumnReference) && _expression.getTypeServices() == null)",
" _expression.setType( bindingRC.getType());"
],
"header": "@@ -854,17 +860,17 @@ class ResultColumn extends ValueNode",
"removed": [
" if( expression instanceof UntypedNullConstantNode)",
" else if( ( expression instanceof ColumnReference) && expression.getTypeServices() == null)",
" expression.setType( bindingRC.getType());"
]
},
{
"added": [
"\t\tif ( columnDescriptor != null ) { setType(columnDescriptor.getType()); }",
"\t\t_columnDescriptor = columnDescriptor;"
],
"header": "@@ -887,13 +893,8 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\t/* Callers are responsible for verifying that the column exists */",
"\t\tif (SanityManager.DEBUG)",
"\t SanityManager.ASSERT(columnDescriptor != null,",
"\t\t\t\t\t\"Caller is responsible for verifying that column exists\");",
"",
"\t\tsetType(columnDescriptor.getType());",
"\t\tthis.columnDescriptor = columnDescriptor;"
]
},
{
"added": [
"\t\t\tif ( (tableDescriptor != null) && ! tableDescriptor.getName().equals(",
"\t\t\t\t**\treference.getQualifiedTableName().getSchemaName())) {"
],
"header": "@@ -901,13 +902,13 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\t\tif (! tableDescriptor.getName().equals(",
"\t\t\t\t**\treference.getTableNameNode().getSchemaName())) {"
]
},
{
"added": [
"\t\tsetType(_expression.getTypeServices());",
"\t\tif (_expression instanceof ColumnReference)",
"\t\t\tColumnReference cr = (ColumnReference) _expression;",
"\t\t\t_unqualifiedTableName = cr.getTableName();",
"\t\t\t_unqualifiedSourceTableName = cr.getSourceTableName();",
"\t\t\t_sourceSchemaName = cr.getSourceSchemaName();"
],
"header": "@@ -934,14 +935,14 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tsetType(expression.getTypeServices());",
"\t\tif (expression instanceof ColumnReference)",
"\t\t\tColumnReference cr = (ColumnReference) expression;",
"\t\t\ttableName = cr.getTableName();",
"\t\t\tsourceTableName = cr.getSourceTableName();",
"\t\t\tsourceSchemaName = cr.getSourceSchemaName();"
]
},
{
"added": [
"\t\t_unqualifiedSourceTableName = t;"
],
"header": "@@ -951,7 +952,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tsourceTableName = t;"
]
},
{
"added": [
"\t\t_sourceSchemaName = s;"
],
"header": "@@ -959,7 +960,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tsourceSchemaName = s;"
]
},
{
"added": [
"\t\tif (_expression == null)",
"\t\tsetExpression( _expression.preprocess(numTables, outerFromList,"
],
"header": "@@ -984,9 +985,9 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tif (expression == null)",
"\t\tsetExpression( expression.preprocess(numTables, outerFromList,"
]
},
{
"added": [
" _expression.generateExpression(ecb, mb);"
],
"header": "@@ -1053,7 +1054,7 @@ class ResultColumn extends ValueNode",
"removed": [
" expression.generateExpression(ecb, mb);"
]
},
{
"added": [
"\t\t\t(_expression.requiresTypeFromContext()))"
],
"header": "@@ -1162,7 +1163,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\t\t(expression.requiresTypeFromContext()))"
]
},
{
"added": [
"\t\treturn (_isGenerated == true);"
],
"header": "@@ -1285,7 +1286,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\treturn (isGenerated == true);"
]
},
{
"added": [
"\t\treturn (_isGeneratedForUnmatchedColumnInInsert == true);"
],
"header": "@@ -1295,7 +1296,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\treturn (isGeneratedForUnmatchedColumnInInsert == true);"
]
},
{
"added": [
"\t\t_isGenerated = true;",
"\t\t_isReferenced = true;"
],
"header": "@@ -1303,9 +1304,9 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tisGenerated = true;",
"\t\tisReferenced = true;"
]
},
{
"added": [
"\t\t_isGeneratedForUnmatchedColumnInInsert = true;",
"\t\t_isReferenced = true;"
],
"header": "@@ -1313,9 +1314,9 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tisGeneratedForUnmatchedColumnInInsert = true;",
"\t\tisReferenced = true;"
]
},
{
"added": [
"\t\treturn _isReferenced;"
],
"header": "@@ -1325,7 +1326,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\treturn isReferenced;"
]
},
{
"added": [
"\t\t_isReferenced = true;"
],
"header": "@@ -1333,7 +1334,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tisReferenced = true;"
]
},
{
"added": [
" for( ValueNode expr = _expression; expr != null && (expr instanceof VirtualColumnNode);)"
],
"header": "@@ -1345,7 +1346,7 @@ class ResultColumn extends ValueNode",
"removed": [
" for( ValueNode expr = expression; expr != null && (expr instanceof VirtualColumnNode);)"
]
},
{
"added": [
"\t\t_isReferenced = false;"
],
"header": "@@ -1363,7 +1364,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tisReferenced = false;"
]
},
{
"added": [
"\t\tValueNode vn = _expression;"
],
"header": "@@ -1374,7 +1375,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tValueNode vn = expression;"
]
},
{
"added": [
"\t\treturn _isRedundant;"
],
"header": "@@ -1392,7 +1393,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\treturn isRedundant;"
]
},
{
"added": [
"\t\t_isRedundant = true;"
],
"header": "@@ -1400,7 +1401,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tisRedundant = true;"
]
},
{
"added": [
"\t\t_isGroupingColumn = true;"
],
"header": "@@ -1408,7 +1409,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tisGroupingColumn = true;"
]
},
{
"added": [
"\t\tif ((_expression != null) && (_expression.isParameterNode()))"
],
"header": "@@ -1421,7 +1422,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tif ((expression != null) && (expression.isParameterNode()))"
]
},
{
"added": [
"\t\t_updated = true;"
],
"header": "@@ -1440,7 +1441,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tupdated = true;"
]
},
{
"added": [
"\t\t_updatableByCursor = true;"
],
"header": "@@ -1449,7 +1450,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tupdatableByCursor = true;"
]
},
{
"added": [
"\t\treturn _updated;"
],
"header": "@@ -1459,7 +1460,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\treturn updated;"
]
},
{
"added": [
"\t\treturn _updatableByCursor;"
],
"header": "@@ -1470,7 +1471,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\treturn updatableByCursor;"
]
},
{
"added": [
"\t\tif (_expression instanceof ColumnReference)",
"\t\t\tcloneExpr = ((ColumnReference) _expression).getClone();",
"\t\t\tcloneExpr = _expression;",
"\t\tif (_columnDescriptor != null)",
" _columnDescriptor, _expression, getContextManager());"
],
"header": "@@ -1492,20 +1493,20 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tif (expression instanceof ColumnReference)",
"\t\t\tcloneExpr = ((ColumnReference) expression).getClone();",
"\t\t\tcloneExpr = expression;",
"\t\tif (columnDescriptor != null)",
" columnDescriptor, expression, getContextManager());"
]
},
{
"added": [
" } else if (_expression != null) {",
" expType = _expression.getOrderableVariantType();"
],
"header": "@@ -1620,8 +1621,8 @@ class ResultColumn extends ValueNode",
"removed": [
" } else if (expression != null) {",
" expType = expression.getOrderableVariantType();"
]
},
{
"added": [
"\t\tif (_expression != null)",
"\t\t\tsetExpression( (ValueNode)_expression.accept(v) );"
],
"header": "@@ -1653,9 +1654,9 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tif (expression != null)",
"\t\t\tsetExpression( (ValueNode)expression.accept(v) );"
]
},
{
"added": [
"\tColumnDescriptor getTableColumnDescriptor() {return _columnDescriptor;}"
],
"header": "@@ -1685,7 +1686,7 @@ class ResultColumn extends ValueNode",
"removed": [
"\tColumnDescriptor getTableColumnDescriptor() {return columnDescriptor;}"
]
},
{
"added": [
" public boolean isGroupingColumn()",
" {",
" return _isGroupingColumn;",
" }"
],
"header": "@@ -1716,10 +1717,10 @@ class ResultColumn extends ValueNode",
"removed": [
" public boolean isGroupingColumn()",
" {",
" \treturn isGroupingColumn;",
" }"
]
},
{
"added": [
"",
" /** Get the column descriptor */",
" ColumnDescriptor getColumnDescriptor() { return _columnDescriptor; }"
],
"header": "@@ -1787,6 +1788,9 @@ class ResultColumn extends ValueNode",
"removed": []
},
{
"added": [
"\t\tValueNode vn = _expression;",
"\t\t\t\tvn = ((ResultColumn) vn)._expression;"
],
"header": "@@ -1797,10 +1801,10 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tValueNode vn = expression;",
"\t\t\t\tvn = ((ResultColumn) vn).expression;"
]
},
{
"added": [
"\t\tif (_expression instanceof ColumnReference)",
"\t\t\treturn ((ColumnReference)_expression).getTableNumber();",
"\t\telse if (_expression instanceof VirtualColumnNode)",
"\t\t\tVirtualColumnNode vcn = (VirtualColumnNode)_expression;"
],
"header": "@@ -1834,11 +1838,11 @@ class ResultColumn extends ValueNode",
"removed": [
"\t\tif (expression instanceof ColumnReference)",
"\t\t\treturn ((ColumnReference)expression).getTableNumber();",
"\t\telse if (expression instanceof VirtualColumnNode)",
"\t\t\tVirtualColumnNode vcn = (VirtualColumnNode)expression;"
]
},
{
"added": [
" \tif (_expression != null) {",
" \t\treturn _expression.isEquivalent(other._expression);"
],
"header": "@@ -1862,8 +1866,8 @@ class ResultColumn extends ValueNode",
"removed": [
" \tif (expression != null) {",
" \t\treturn expression.isEquivalent(other.expression);"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java",
"hunks": [
{
"added": [
" if( (! tableName.equals( cr.getQualifiedTableName())) && tableNumber != cr.getTableNumber())",
" {",
" }",
" {",
" }"
],
"header": "@@ -589,14 +589,18 @@ class ResultColumnList extends QueryTreeNodeVector<ResultColumn>",
"removed": [
" if( (! tableName.equals( cr.getTableNameNode())) && tableNumber != cr.getTableNumber())"
]
},
{
"added": [
" if( ! tableName.equals( cr.getQualifiedTableName()))",
" {",
" }"
],
"header": "@@ -715,8 +719,10 @@ class ResultColumnList extends QueryTreeNodeVector<ResultColumn>",
"removed": [
" if( ! tableName.equals( cr.getTableNameNode()))"
]
}
]
}
] |
derby-DERBY-6468-27905092
|
DERBY-6468; Add a version number to derbyTesting.jar
- a new properties file, org/apache/derby/info/tsting.properties, is generated with the required info
- this file is inserted in to derbyTesting.jar
- sysinfo reflects the location of the org.apache.derbyTesting package if an indicative class is found in the classpath
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1581885 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/tools/org/apache/derby/impl/tools/sysinfo/Main.java",
"hunks": [
{
"added": [
" ",
" // derbyTesting info",
" try {",
" reportTesting(aw);",
" }",
" catch (Exception e) {",
" // ignore locales for the testing jar",
" aw.println(\"Exception in reporting version of derbyTesting.jar\");",
" e.printStackTrace();",
" }"
],
"header": "@@ -152,6 +152,16 @@ public static void getMainInfo (java.io.PrintWriter aw, boolean pause) {",
"removed": []
},
{
"added": [
" /**",
" Writes out information about the derbyTesting classes with the product.",
"",
" @param localAW the AppStreamWriter to which the info is written. If this",
" value is null, the info is written to System.out",
"",
" */",
" private static void reportTesting (java.io.PrintWriter localAW) {",
"",
" String hdr=\"org.apache.derbyTesting.*:\";",
" Properties p = new Properties ();",
" String tstingResource =\"/org/apache/derby/info/tsting.properties\";",
"",
" final Properties finalp = p;",
" final String finalTstingResource = tstingResource;",
" try {",
" InputStream is = AccessController.doPrivileged",
" (new PrivilegedAction<InputStream>() {",
" public InputStream run() {",
" InputStream is =",
" finalp.getClass().getResourceAsStream (finalTstingResource);",
" return is;",
" }",
" });",
" if (is == null) {",
" //localAW.println(\"resource is null: \" + tstingResource);",
" }",
" else {",
" try {",
" p.clear();",
" p.load (is);",
" //Displaying Testing info",
" //String tstingName = p.getProperty(\"derby.tsting.external.name\");",
"",
" StringBuffer successes = new StringBuffer(Main.getTextMessage(crLf()));",
" StringBuffer failures = new StringBuffer(crLf() + Main.getTextMessage(\"SIF08.E\") + crLf());",
" tryTstingClasspath(successes, failures);",
" String successString = successes.toString();",
"",
" if (successString.isEmpty() || successString.length()<=2)",
" {",
" // if we don't have the BaseTestCase class, assume we don't have any of the",
" // testing classes, and just print nothing",
" // this would be the situation that end-users would likely see.",
" return;",
" }",
"",
" // show the path and add brackets like we do for the core classes",
" localAW.println(hdr);",
" localAW.print(\"\\t \");",
" localAW.print(\"[\");",
" localAW.print(formatURL(new URL(successString)));",
" localAW.println(\"]\");",
" // show the version info",
" int major = Integer.parseInt(p.getProperty (\"derby.tsting.version.major\"));",
" int minor = Integer.parseInt(p.getProperty (\"derby.tsting.version.minor\"));",
" int maint = Integer.parseInt(p.getProperty (\"derby.tsting.version.maint\"));",
" String build = p.getProperty (\"derby.tsting.build.number\");",
" String lv = ProductVersionHolder.fullVersionString(major, minor, maint, false, build);",
" localAW.println (Main.getTextMessage (\"SIF01.S\", lv));",
" } catch (IOException ioe) {",
" //This case is a bit ugly. If we get an IOException, we return",
" //null. Though this correctly reflects that the product is not",
" //available for use, it may be confusing to users that we swallow",
" //the IO error here.",
" localAW.println(\"Could not get testing properties from : \" + is);",
" }",
" }",
" localAW.println (sep);",
" }",
" catch (Throwable t) {",
" localAW.println (\"Could not load resource: \" + tstingResource);",
" localAW.println (\"Exception: \" + t);",
" }",
" } // end of reportTesting",
" "
],
"header": "@@ -519,6 +529,82 @@ public static void getMainInfo (java.io.PrintWriter aw, boolean pause) {",
"removed": []
},
{
"added": [
"\t",
"\tprivate static void tryTstingClasspath(StringBuffer successes, StringBuffer failures) {",
" tryMyClasspath(\"org.apache.derbyTesting.junit.BaseTestCase\", \"\", successes, failures);",
" }"
],
"header": "@@ -665,6 +751,10 @@ public static void getMainInfo (java.io.PrintWriter aw, boolean pause) {",
"removed": []
}
]
}
] |
derby-DERBY-647-ece3ee65
|
DERBY-647 Fix code in MultiTest to generate correct log file names
when the path contains a dot. Previous code was trying to be too
smart, simplified to pass in directory and file name required.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@328515 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-6477-8ab61cc5
|
DERBY-6477: OutOfMemoryError selecting from SYS.SYSALIASES
Disable LIKE optimization for very long columns.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1567604 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/sql/compile/LikeEscapeOperatorNode.java",
"hunks": [
{
"added": [
"import org.apache.derby.iapi.reference.Limits;"
],
"header": "@@ -25,6 +25,7 @@ import java.sql.Types;",
"removed": []
}
]
}
] |
derby-DERBY-6484-d6401b1d
|
DERBY-6484: Include SQLState in client exception messages
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1571615 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-6488-28dc366e
|
DERBY-6488: Remove the EmbedSQLException class and the associated DerbySQLException interface.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1573534 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/drda/org/apache/derby/impl/drda/DRDAConnThread.java",
"hunks": [
{
"added": [],
"header": "@@ -65,7 +65,6 @@ import org.apache.derby.shared.common.sanity.SanityManager;",
"removed": [
"import org.apache.derby.impl.jdbc.EmbedSQLException;"
]
},
{
"added": [
" * This method tries to get a StandardException from the SQLException",
" * If the SQLException isn't linked to a StandardException, the"
],
"header": "@@ -1357,14 +1356,14 @@ class DRDAConnThread extends Thread {",
"removed": [
" * This method tries to cast the exception to an EmbedSQLException",
" * If the cast to EmbedSQLException is not successful, the"
]
},
{
"added": [
" StandardException se = StandardException.getArgumentFerry(sqlException);",
" if (se != null) {",
" // DERBY-3060: if this is a Derby exception, we can",
" String msgId = se.getMessageId();"
],
"header": "@@ -1379,14 +1378,14 @@ class DRDAConnThread extends Thread {",
"removed": [
" SQLException se = StandardException.getArgumentFerry(sqlException);",
" if (se instanceof EmbedSQLException) {",
" // DERBY-3060: if this is an EmbedSQLException, we can",
" String msgId = ((EmbedSQLException)se).getMessageId();"
]
},
{
"added": [
" String sqlState = sqlException.getSQLState();",
" // Derby exception, so we cannot check the"
],
"header": "@@ -1395,10 +1394,10 @@ class DRDAConnThread extends Thread {",
"removed": [
" String sqlState = se.getSQLState();",
" // EmbedSQLException, so we cannot check the"
]
},
{
"added": [
" StandardException ferry = StandardException.getArgumentFerry(se);",
"",
" if (se instanceof DataTruncation) {",
" // Encode DataTruncation in a special way.",
" } else if (ferry != null && !severe) {",
" // All other non-severe Derby exceptions are encoded here.",
" sqlerrmc = buildTokenizedSqlerrmc(se);",
" // If this is not a Derby exception or is a severe excecption where"
],
"header": "@@ -6447,14 +6446,16 @@ class DRDAConnThread extends Thread {",
"removed": [
" se = StandardException.getArgumentFerry( se );",
" ",
" if (se instanceof EmbedSQLException && ! severe) {",
" sqlerrmc = buildTokenizedSqlerrmc(se);",
" } else if (se instanceof DataTruncation) {",
" // If this is not an EmbedSQLException or is a severe excecption where"
]
},
{
"added": [
" * for severe exceptions or SQLExceptions that are not Derby exceptions."
],
"header": "@@ -6473,7 +6474,7 @@ class DRDAConnThread extends Thread {",
"removed": [
" * for severe exceptions or SQLExceptions that are not EmbedSQLExceptions."
]
},
{
"added": [
" StandardException ferry = StandardException.getArgumentFerry(se);",
" if (ferry != null)",
" String messageId = ferry.getMessageId();",
" Object[] args = ferry.getArguments();"
],
"header": "@@ -6511,11 +6512,12 @@ class DRDAConnThread extends Thread {",
"removed": [
" if ( se instanceof EmbedSQLException)",
" String messageId = ((EmbedSQLException)se).getMessageId();",
" Object[] args = ((EmbedSQLException)se).getArguments();"
]
}
]
},
{
"file": "java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java",
"hunks": [
{
"added": [],
"header": "@@ -79,7 +79,6 @@ import org.apache.derby.shared.common.sanity.SanityManager;",
"removed": [
"import org.apache.derby.impl.jdbc.EmbedSQLException;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/error/PublicAPI.java",
"hunks": [
{
"added": [
"import org.apache.derby.iapi.jdbc.ExceptionFactory;"
],
"header": "@@ -22,18 +22,12 @@",
"removed": [
"",
"import org.apache.derby.impl.jdbc.EmbedSQLException;",
"",
"\tThis wrapping is also special cased by TypeStatementException",
"\tto avoid double wrapping of some errors.",
"\t<P>",
"\tThis will get cleaned up in main."
]
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/error/StandardException.java",
"hunks": [
{
"added": [
" private transient boolean isForPublicAPI;",
" private transient SQLException next;"
],
"header": "@@ -60,6 +60,8 @@ public class StandardException extends Exception",
"removed": []
},
{
"added": [
" /**",
" * Get the next {@code SQLException} that should be put into the parent",
" * exception when this instance is converted to an {@code SQLException}.",
" * @return the next exception",
" */",
" public final SQLException getNextException() {",
" return next;",
" }",
"",
" /**",
" * Mark this exception as one that is thrown by a public API method.",
" * The purpose is to signal that this should be a top-level exception,",
" * so that it doesn't get wrapped inside multiple layers of other",
" * SQLExceptions or StandardExceptions as it travels up through the",
" * code layers.",
" * @see PublicAPI",
" */",
" final void markAsPublicAPI() {",
" isForPublicAPI = true;",
" }",
""
],
"header": "@@ -150,6 +152,27 @@ public class StandardException extends Exception",
"removed": []
},
{
"added": [
" * Unpack the exception, looking for a StandardException, which carries",
" public static StandardException getArgumentFerry(SQLException se)",
" Throwable cause = se.getCause();",
" return (cause instanceof StandardException)",
" ? (StandardException) cause : null;",
" // argument ferry which is a StandardException. Use this to check",
" StandardException ferry = null;",
" SQLException sqle = (SQLException) t;",
" ferry = getArgumentFerry(sqle);",
"",
" // If the ferry is marked for public API, it means we shouldn't",
" // wrap it inside an \"unexpected user exception\", so just peel",
" // off the parent SQLException and return the ferry.",
" if (ferry != null && ferry.isForPublicAPI) {",
" // If the parent SQLException has any next exceptions, we",
" // need to store a reference to them before the parent is",
" // discarded.",
" ferry.next = sqle.getNextException();",
" return ferry;",
"",
" ** If we have a SQLException that didn't come from Derby, then we check"
],
"header": "@@ -337,47 +360,43 @@ public class StandardException extends Exception",
"removed": [
"\t * Unpack the exception, looking for an DerbySQLException, which carries",
"\tpublic static SQLException\tgetArgumentFerry(SQLException se)",
"\t\tif (se instanceof DerbySQLException) {",
"\t\t\t/*",
"\t\t\t * Cater for pre-JDBC4 scenario.",
"\t\t\t */",
"\t\t\treturn se;",
"\t\t}",
"\t\t/*",
"\t\t * See DERBY-1178 for background information.",
"\t\t * In JDBC4, the DerbySQLException may be wrapped by a SQLException.",
"\t\t */",
"\t\tThrowable\tcause = se.getCause();",
"",
"\t\tif ( (cause == null) || !(cause instanceof DerbySQLException ))\t{ return se; }",
"\t\telse\t{ return (SQLException) cause; }",
" // argument ferry which is an DerbySQLException. Use this to check",
" DerbySQLException ferry = null;",
" SQLException sqle =",
" getArgumentFerry((SQLException) t);",
" if (sqle instanceof DerbySQLException) {",
" ferry = (DerbySQLException) sqle;",
" ",
"\t\t** If we have a SQLException that isn't an EmbedSQLException",
"\t\t** (i.e. it didn't come from Derby), then we check"
]
},
{
"added": [],
"header": "@@ -400,16 +419,6 @@ public class StandardException extends Exception",
"removed": [
"\t\t// Look for simple wrappers for 3.0.1 - will be cleaned up in main",
"\t\tif (ferry != null) {",
"\t\t\tif (ferry.isSimpleWrapper()) {",
"\t\t\t\tThrowable wrapped = ((SQLException)ferry).getCause();",
"\t\t\t\tif (wrapped instanceof StandardException)",
"\t\t\t\t\treturn (StandardException) wrapped;",
"\t\t\t}",
"\t\t}",
"",
""
]
},
{
"added": [
" ** to build. This is no longer true for Derby.",
" ** If the exception has no detail message",
" ** problem down easier, though the lack of a message",
" String detailMessage = t.getMessage();"
],
"header": "@@ -441,23 +450,13 @@ public class StandardException extends Exception",
"removed": [
" ** to build. This is no longer true for Derby, but for",
"\t\t\t** exceptions that are Derby's, i.e. EmbedSQLException,",
"\t\t\t** we use toString(). If this returns an empty or null",
" ** problem down easier, though the lack of a message ",
"\t\t\tString\tdetailMessage;",
"\t\t\tboolean derbyException = false;",
"",
"\t\t\tif (ferry != null) {",
"\t\t\t\tdetailMessage = ferry.toString();",
"\t\t\t\tderbyException = true;",
"\t\t\t}",
"\t\t\telse {",
"\t\t\t\tdetailMessage = t.getMessage();",
"\t\t\t}"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/jdbc/SQLExceptionFactory.java",
"hunks": [
{
"added": [
" StandardException ferry =",
" wrapArgsForTransportAcrossDRDA(messageId, t, args);",
" ex = new SQLNonTransientConnectionException(",
" message, sqlState, severity, ferry);",
" ex = new SQLDataException(message, sqlState, severity, ferry);",
" severity, ferry);",
" severity, ferry);",
" severity, ferry);",
" ex = new SQLSyntaxErrorException(",
" message, sqlState, severity, ferry);",
" ex = new SQLFeatureNotSupportedException(",
" message, sqlState, severity, ferry);",
" ex = new SQLTimeoutException(message, sqlState, severity, ferry);",
" ex = new SQLException(message, sqlState, severity, ferry);",
" }",
"",
" // If the argument ferry has recorded any extra next exceptions,",
" // graft them into the parent exception.",
" SQLException ferriedExceptions = ferry.getNextException();",
" if (ferriedExceptions != null) {",
" ex.setNextException(ferriedExceptions);",
""
],
"header": "@@ -70,42 +70,54 @@ public class SQLExceptionFactory extends ExceptionFactory {",
"removed": [
" t = wrapArgsForTransportAcrossDRDA( message, messageId, next, severity, t, args );",
" ex = new SQLNonTransientConnectionException(message, sqlState, severity, t);",
" ex = new SQLDataException(message, sqlState, severity, t);",
" severity, t);",
" severity, t);",
" severity, t);",
" ex = new SQLSyntaxErrorException(message, sqlState, severity, t);",
" ex = new SQLFeatureNotSupportedException(message, sqlState, severity, t);",
" ex = new SQLTimeoutException(message, sqlState, severity, t);",
" ex = new SQLException(message, sqlState, severity, t);"
]
}
]
}
] |
derby-DERBY-6488-63574ff9
|
DERBY-6488: Get rid of the EmbedSQLException class
Remove the newEmbedSQLException methods, since they don't produce
EmbedSQLExceptions anymore, and use the SQLExceptionFactory methods
instead.
Add a Throwable parameter to seeNextException() so that the root cause
will be shown when printStackTrace() is called on the top-level
exception.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1573934 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java",
"hunks": [
{
"added": [
" handleException(mse), mse, dbname);"
],
"header": "@@ -2645,8 +2645,7 @@ public class EmbedConnection implements EngineConnection",
"removed": [
" new Object[] { dbname },",
" handleException(mse));"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/jdbc/Util.java",
"hunks": [
{
"added": [],
"header": "@@ -124,35 +124,6 @@ public abstract class Util {",
"removed": [
"\t",
"\t/**",
" * This looks up the message and sqlstate values and calls",
" * the SQLExceptionFactory method to generate",
" * the appropriate exception off of them.",
" */",
"",
"\tprivate static SQLException newEmbedSQLException(String messageId,",
"\t\t\tObject[] args, SQLException next, int severity, Throwable t) {",
" String message = MessageService.getTextMessage(messageId, args);",
" return ExceptionFactory.getInstance().getSQLException(",
"\t\t\t message, messageId, next, severity, t, args);",
"\t}",
"",
"\tpublic static SQLException newEmbedSQLException(String messageId,",
"\t\t\tObject[] args, int severity) {",
"\t\treturn newEmbedSQLException(messageId, args, (SQLException) null, severity, (Throwable) null);",
"\t}",
"",
"\tprivate static SQLException newEmbedSQLException(String messageId,",
"\t\t\tObject[] args, int severity, Throwable t) {",
"\t\treturn newEmbedSQLException(messageId,args, (SQLException) null, severity, t);",
"\t}",
"",
"\tprivate static SQLException newEmbedSQLException(",
"\t\t\tString messageId, int severity) {",
"\t\treturn newEmbedSQLException(messageId, (Object[]) null, (SQLException) null, severity, (Throwable) null);",
"\t}",
""
]
},
{
"added": [
" ** Note that these methods use the SQL exception factory,",
" return generateCsSQLException(error, null, args);",
" return ExceptionFactory.getInstance().getSQLException(",
" error, (SQLException) null, t, args);"
],
"header": "@@ -243,22 +214,19 @@ public abstract class Util {",
"removed": [
"\t** Note that these methods call the static method newEmbedSQLException,",
"\t\treturn newEmbedSQLException(error,",
" args,",
" \t\tStandardException.getSeverityFromIdentifier(error));",
"\t\treturn newEmbedSQLException(error,",
" args,",
" StandardException.getSeverityFromIdentifier(error), t);"
]
},
{
"added": [
" return generateCsSQLException(SQLState.NO_CURRENT_CONNECTION);"
],
"header": "@@ -268,8 +236,7 @@ public abstract class Util {",
"removed": [
"\t\treturn newEmbedSQLException(SQLState.NO_CURRENT_CONNECTION,",
" \t\tStandardException.getSeverityFromIdentifier(SQLState.NO_CURRENT_CONNECTION));"
]
},
{
"added": [
" * @param next the next SQLException, possibly null",
" * @param cause the underlying exception, possibly null",
" static SQLException seeNextException(String messageId, SQLException next,",
" Throwable cause, Object... args) {",
" return ExceptionFactory.getInstance().getSQLException(",
" messageId, next, cause, args);"
],
"header": "@@ -278,14 +245,15 @@ public abstract class Util {",
"removed": [
" * @param next the next SQLException",
" static SQLException seeNextException(String messageId, Object[] args,",
" SQLException next) {",
" return newEmbedSQLException(messageId, args, next,",
" StandardException.getSeverityFromIdentifier(messageId), null);"
]
},
{
"added": [
"",
" SQLException result = seeNextException(",
" SQLState.JAVA_EXCEPTION, next, t, name, msg);"
],
"header": "@@ -305,9 +273,9 @@ public abstract class Util {",
"removed": [
"\t\tSQLException result = newEmbedSQLException(SQLState.JAVA_EXCEPTION,",
" new Object[] {name, msg}, next,",
" ExceptionSeverity.NO_APPLICABLE_SEVERITY, t);"
]
},
{
"added": [
" return generateCsSQLException(",
" SQLState.POLICY_NOT_RELOADED, t, t.getMessage());"
],
"header": "@@ -316,8 +284,8 @@ public abstract class Util {",
"removed": [
"\t\treturn newEmbedSQLException(SQLState.POLICY_NOT_RELOADED, new Object[] { t.getMessage() },",
" \t\tStandardException.getSeverityFromIdentifier(SQLState.POLICY_NOT_RELOADED), t);"
]
},
{
"added": [
" return generateCsSQLException(SQLState.NOT_IMPLEMENTED, feature);"
],
"header": "@@ -326,10 +294,7 @@ public abstract class Util {",
"removed": [
"",
"\t\treturn newEmbedSQLException(SQLState.NOT_IMPLEMENTED,",
"\t\t\tnew Object[] {feature},",
" StandardException.getSeverityFromIdentifier(SQLState.NOT_IMPLEMENTED));"
]
},
{
"added": [
" return generateCsSQLException(",
" SQLState.TYPE_MISMATCH, typeName(targetSQLType));"
],
"header": "@@ -342,9 +307,8 @@ public abstract class Util {",
"removed": [
"\t\treturn newEmbedSQLException(SQLState.TYPE_MISMATCH,",
"\t\t\tnew Object[] {typeName(targetSQLType)},",
" StandardException.getSeverityFromIdentifier(SQLState.TYPE_MISMATCH));"
]
}
]
}
] |
derby-DERBY-649-c700973f
|
DERBY-649: Push single table predicates that can be pushed into underlying SELECTs of a union.
Merging from 10.1 branch. It is possible to further improve the patch to handle more cases for this optimization.
Submitted by Satheesh Bandaram (satheesh@sourcery.org)
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@370247 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/sql/compile/PredicateList.java",
"hunks": [
{
"added": [
"\t * views or derived tables or into unions.",
"\t * @param select\t\t\tThe underlying SelectNode.",
"\t * @param copyPredicate\t\tWhether to make a copy of the predicate",
"\t *\t\t\t\t\t\t\tbefore pushing",
"\tvoid pushExpressionsIntoSelect(SelectNode select, boolean copyPredicate)"
],
"header": "@@ -1349,15 +1349,17 @@ public class PredicateList extends QueryTreeNodeVector implements OptimizablePre",
"removed": [
"\t * views or derived tables.",
"\t * @param select\tThe underlying SelectNode.",
"\tvoid pushExpressionsIntoSelect(SelectNode select)"
]
},
{
"added": [
"\t\t\tif (state && !copyPredicate)"
],
"header": "@@ -1392,7 +1394,7 @@ public class PredicateList extends QueryTreeNodeVector implements OptimizablePre",
"removed": [
"\t\t\tif (state)"
]
}
]
}
] |
derby-DERBY-6491-b93f9db8
|
DERBY-6491: Don't require USAGE priv on the datatypes of SELECTed columns; commit derby-6491-ab-stopRequiringUsagePriv.diff.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1573030 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/sql/compile/CompilerContextImpl.java",
"hunks": [
{
"added": [
" skippingTypePrivileges = false;"
],
"header": "@@ -146,6 +146,7 @@ public class CompilerContextImpl extends ContextImpl",
"removed": []
},
{
"added": [
" /** Set whether we should skip adding USAGE privileges for user-defined types */",
" public boolean skipTypePrivileges( boolean skip )",
" {",
" boolean oldValue = skippingTypePrivileges;",
" ",
" skippingTypePrivileges = skip;",
"",
" return oldValue;",
" }",
"",
" /** Return whether we are skipping USAGE privileges for user-defined types */",
" public boolean skippingTypePrivileges()",
" {",
" return skippingTypePrivileges;",
" }"
],
"header": "@@ -1039,6 +1040,21 @@ public class CompilerContextImpl extends ContextImpl",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/CursorNode.java",
"hunks": [
{
"added": [
" //",
" // Don't add USAGE privilege on user-defined types.",
" //",
" boolean wasSkippingTypePrivileges = getCompilerContext().skipTypePrivileges( true );",
" "
],
"header": "@@ -240,6 +240,11 @@ public class CursorNode extends DMLStatementNode",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/FromList.java",
"hunks": [
{
"added": [
" //",
" // Don't add USAGE privilege on user-defined types just because we're",
" // binding tables.",
" //",
" boolean wasSkippingTypePrivileges = getCompilerContext().skipTypePrivileges( true );",
" "
],
"header": "@@ -326,6 +326,12 @@ class FromList extends QueryTreeNodeVector<ResultSetNode>",
"removed": []
}
]
}
] |
derby-DERBY-6493-cb184fe8
|
DERBY-6493: Improve reporting of exceptions wrapped in InvocationTargetException
Unwrap InvocationTargetException and PrivilegedActionException before
reporting them so that it is easier to see what the real error is.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1574425 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/iapi/error/StandardException.java",
"hunks": [
{
"added": [
"import java.lang.reflect.InvocationTargetException;",
"import java.security.PrivilegedActionException;"
],
"header": "@@ -21,6 +21,8 @@",
"removed": []
},
{
"added": [
" /**",
" * Check if the top-level throwable is just a vacuous wrapper that does",
" * not carry any useful information except what's returned by the",
" * {@link Throwable#getCause()} method.",
" *",
" * @param t the throwable to check",
" * @return {@code true} if the throwable is a vacuous wrapper and the",
" * only useful piece of information is the cause, or {@code false}",
" * otherwise",
" */",
" private static boolean isVacuousWrapper(Throwable t) {",
" // The only interesting information in an InvocationTargetException",
" // or a PrivilegedActionException is the cause, so consider them",
" // vacuous if they have a cause.",
" if (t instanceof InvocationTargetException",
" || t instanceof PrivilegedActionException) {",
" return (t.getCause() != null);",
" }",
"",
" // All other exceptions are non-vacuous.",
" return false;",
" }",
"",
" // If there is no useful information in the top-level throwable,",
" // peel it off and only report the cause.",
" if (isVacuousWrapper(t)) {",
" return unexpectedUserException(t.getCause());",
" }",
""
],
"header": "@@ -372,9 +374,38 @@ public class StandardException extends Exception",
"removed": []
}
]
}
] |
derby-DERBY-6495-b1c9bd27
|
DERBY-6495; Error in SelectivityTest.testBasic
add more columns to a number of order by statements to pin the results down.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1574634 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-6496-4e7a614b
|
DERBY-6496: Simplify the test case
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1574946 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-6496-63ecb285
|
DERBY-6496: Fix NPE in loading of the optimizer tracing tool; tests passed cleanly on derby-6496-02-aa-optimizerTracer.diff.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1574927 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/sql/compile/OptimizerTracer.java",
"hunks": [
{
"added": [
"import org.apache.derby.iapi.services.loader.ClassFactoryContext;"
],
"header": "@@ -31,7 +31,7 @@ import org.apache.derby.iapi.reference.SQLState;",
"removed": [
"import org.apache.derby.iapi.sql.compile.CompilerContext;"
]
}
]
}
] |
derby-DERBY-6500-0ee1994f
|
DERBY-6500: Add ORDER BY clauses to the queries in AutoIncrementTest in order to eliminate row ordering diffs in the test results; commit derby-6500-01-aa-addOrderByClauses.diff.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1577190 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-6502-dc1acc4b
|
DERBY-6502; Failure in OnlineCompressTest
adding calls to wait for post commit tasks in the hope of addressing instability in OnlineCompressTest.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1592630 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-6503-4f7eee8a
|
DERBY-6503: ClassCastException when network server cannot restrict file permissions
Make sure the underlying IOException is exposed if the network server
fails to restrict file permissions. The original exception used to be
shadowed by a ClassCastException.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1580789 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/drda/org/apache/derby/impl/drda/DssTrace.java",
"hunks": [
{
"added": [],
"header": "@@ -25,7 +25,6 @@ import java.io.FileNotFoundException;",
"removed": [
"import java.security.PrivilegedAction;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/services/io/FileUtil.java",
"hunks": [
{
"added": [],
"header": "@@ -27,21 +27,12 @@ import java.io.FileOutputStream;",
"removed": [
"import java.lang.reflect.Array;",
"import java.lang.reflect.InvocationTargetException;",
"import java.lang.reflect.Method;",
"import java.lang.reflect.Field;",
"import java.util.ArrayList;",
"import java.util.Arrays;",
"import java.util.HashSet;",
"import java.util.List;",
"import java.util.Set;"
]
},
{
"added": [
" try {",
" limitAccessToOwner(to);",
" } catch (IOException ioe) {",
" return false;",
" }"
],
"header": "@@ -176,7 +167,11 @@ public abstract class FileUtil {",
"removed": [
" limitAccessToOwner(to);"
]
},
{
"added": [
" try {",
" to.limitAccessToOwner();",
" } catch (IOException ioe) {",
" return false;",
" }"
],
"header": "@@ -308,7 +303,11 @@ public abstract class FileUtil {",
"removed": [
" to.limitAccessToOwner();"
]
},
{
"added": [
" private final static FilePermissionService filePermissionService =",
" loadFilePermissionService();",
"",
" private static FilePermissionService loadFilePermissionService() {",
" try {",
" Class cl = Class.forName(",
" FilePermissionService.class.getName() + \"Impl\");",
" return (FilePermissionService) cl.newInstance();",
" } catch (ClassNotFoundException ex) {",
" } catch (InstantiationException ex) {",
" } catch (IllegalAccessException ex) {",
" }",
"",
" // Could not create an instance. This most likely means we are",
" // not on Java 7 or higher. Just return null, and let",
" // limitAccessToOwner() choose another strategy on older platforms.",
" return null;",
" }"
],
"header": "@@ -463,39 +462,24 @@ public abstract class FileUtil {",
"removed": [
" private static final Object region = new Object();",
" private static boolean initialized = false;",
"",
" // Reflection helper objects for calling into Java >= 7",
" private static Class<?> filesClz;",
" private static Class<?> pathClz;",
" private static Class<?> pathsClz;",
" private static Class<?> aclEntryClz;",
" private static Class<?> aclFileAttributeViewClz;",
" private static Class<?> posixFileAttributeViewClz;",
" private static Class<?> userPrincipalClz;",
" private static Class<?> linkOptionArrayClz;",
" private static Class<?> linkOptionClz;",
" private static Class<?> stringArrayClz;",
" private static Class<?> aclEntryBuilderClz;",
" private static Class<?> aclEntryTypeClz;",
" private static Class<?> fileStoreClz;",
" private static Class<?> aclEntryPermissionClz;",
"",
" private static Method get;",
" private static Method getFileAttributeView;",
" private static Method supportsFileAttributeView;",
" private static Method getFileStore;",
" private static Method getOwner;",
" private static Method setAcl;",
" private static Method build;",
" private static Method newBuilder;",
" private static Method setPrincipal;",
" private static Method setType;",
" private static Method values;",
" private static Method setPermissions;",
" ",
" private static Field allow;"
]
},
{
"added": [
" * @throws IOException if an I/O error happens when trying to change the",
" * file permissions",
" public static void limitAccessToOwner(File file) throws IOException {"
],
"header": "@@ -515,8 +499,10 @@ public abstract class FileUtil {",
"removed": [
" public static void limitAccessToOwner(File file) {"
]
},
{
"added": [],
"header": "@@ -538,84 +524,6 @@ public abstract class FileUtil {",
"removed": [
" // lazy initialization, needs to be called in security context",
" synchronized (region) {",
" if (!initialized) {",
" initialized = true;",
"",
" // >= Java 7",
" try {",
" // If found, we have >= Java 7.",
" filesClz = Class.forName(",
" \"java.nio.file.Files\");",
" pathClz = Class.forName(",
" \"java.nio.file.Path\");",
" pathsClz = Class.forName(",
" \"java.nio.file.Paths\");",
" aclEntryClz = Class.forName(",
" \"java.nio.file.attribute.AclEntry\");",
" aclFileAttributeViewClz = Class.forName(",
" \"java.nio.file.attribute.AclFileAttributeView\");",
" posixFileAttributeViewClz = Class.forName(",
" \"java.nio.file.attribute.PosixFileAttributeView\");",
" userPrincipalClz = Class.forName(",
" \"java.nio.file.attribute.UserPrincipal\");",
" linkOptionArrayClz = Class.forName(",
" \"[Ljava.nio.file.LinkOption;\");",
" linkOptionClz = Class.forName(",
" \"java.nio.file.LinkOption\");",
" stringArrayClz = Class.forName(",
" \"[Ljava.lang.String;\");",
" aclEntryBuilderClz = Class.forName(",
" \"java.nio.file.attribute.AclEntry$Builder\");",
" aclEntryTypeClz = Class.forName(",
" \"java.nio.file.attribute.AclEntryType\");",
" fileStoreClz = Class.forName(",
" \"java.nio.file.FileStore\");",
" aclEntryPermissionClz = Class.forName(",
" \"java.nio.file.attribute.AclEntryPermission\");",
" get = pathsClz.getMethod(",
" \"get\",",
" new Class[]{String.class, stringArrayClz});",
" getFileAttributeView = filesClz.getMethod(",
" \"getFileAttributeView\",",
" new Class[]{pathClz, Class.class, linkOptionArrayClz});",
" supportsFileAttributeView = fileStoreClz.getMethod(",
" \"supportsFileAttributeView\",",
" new Class[]{Class.class});",
" getFileStore = filesClz.getMethod(\"getFileStore\",",
" new Class[]{pathClz});",
" getOwner = filesClz.",
" getMethod(\"getOwner\",",
" new Class[]{pathClz, linkOptionArrayClz});",
" setAcl = aclFileAttributeViewClz.",
" getMethod(\"setAcl\", new Class[]{List.class});",
" build = aclEntryBuilderClz.",
" getMethod(\"build\", new Class[]{});",
" newBuilder = aclEntryClz.",
" getMethod(\"newBuilder\", new Class[]{});",
" setPrincipal = aclEntryBuilderClz.",
" getMethod(\"setPrincipal\",",
" new Class[]{userPrincipalClz});",
" setType = aclEntryBuilderClz.",
" getMethod(\"setType\", new Class[]{aclEntryTypeClz});",
" values = aclEntryPermissionClz.",
" getMethod(\"values\", (Class[]) null);",
" setPermissions = aclEntryBuilderClz.",
" getMethod(\"setPermissions\", new Class[] { Set.class });",
"",
" allow = aclEntryTypeClz.getField(\"ALLOW\");",
"",
" } catch (NoSuchMethodException e) {",
" // not Java 7 or higher",
" } catch (ClassNotFoundException e) {",
" // not Java 7 or higher",
" } catch (NoSuchFieldException e) {",
" // not Java 7 or higher",
" }",
" }",
" }",
""
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/io/DirFile.java",
"hunks": [
{
"added": [
" return getOutputStream(false);"
],
"header": "@@ -111,14 +111,7 @@ class DirFile extends File implements StorageFile",
"removed": [
" boolean exists = exists();",
" OutputStream result = new FileOutputStream(this);",
"",
" if (!exists) {",
" FileUtil.limitAccessToOwner(this);",
" }",
"",
" return result;"
]
},
{
"added": [
" try {",
" limitAccessToOwner();",
" } catch (FileNotFoundException fnfe) {",
" // Throw FileNotFoundException unchanged.",
" throw fnfe;",
" } catch (IOException ioe) {",
" // Other IOExceptions should be wrapped, since",
" // FileNotFoundException is the only one we are allowed",
" // to throw here.",
" FileNotFoundException e = new FileNotFoundException();",
" e.initCause(ioe);",
" throw e;",
" }"
],
"header": "@@ -140,7 +133,19 @@ class DirFile extends File implements StorageFile",
"removed": [
" FileUtil.limitAccessToOwner(this);"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/store/raw/RawStore.java",
"hunks": [
{
"added": [
" createBackupDirectory(backupDir);"
],
"header": "@@ -675,13 +675,7 @@ public final class RawStore implements RawStoreFactory, ModuleControl, ModuleSup",
"removed": [
"",
" if (!privMkdirs(backupDir))",
" {",
" throw StandardException.newException(",
" SQLState.RAWSTORE_CANNOT_CREATE_BACKUP_DIRECTORY,",
" (File) backupDir);",
" }"
]
},
{
"added": [
" createBackupDirectory(backupcopy);"
],
"header": "@@ -777,12 +771,7 @@ public final class RawStore implements RawStoreFactory, ModuleControl, ModuleSup",
"removed": [
" if (!privMkdirs(backupcopy))",
" {",
" throw StandardException.newException(",
" SQLState.RAWSTORE_CANNOT_CREATE_BACKUP_DIRECTORY,",
" (File) backupcopy);",
" }"
]
},
{
"added": [
" createBackupDirectory(backupJarDir);"
],
"header": "@@ -813,12 +802,7 @@ public final class RawStore implements RawStoreFactory, ModuleControl, ModuleSup",
"removed": [
" if (!privMkdirs(backupJarDir))",
" {",
" throw StandardException.newException(",
" SQLState.RAWSTORE_CANNOT_CREATE_BACKUP_DIRECTORY,",
" (File) backupJarDir);",
" }"
]
},
{
"added": [
" createBackupDirectory(logBackup);"
],
"header": "@@ -953,12 +937,7 @@ public final class RawStore implements RawStoreFactory, ModuleControl, ModuleSup",
"removed": [
" if (!privMkdirs(logBackup))",
" {",
" throw StandardException.newException(",
" SQLState.RAWSTORE_CANNOT_CREATE_BACKUP_DIRECTORY,",
" (File) logBackup);",
" }"
]
},
{
"added": [
" createBackupDirectory(segBackup);"
],
"header": "@@ -969,12 +948,7 @@ public final class RawStore implements RawStoreFactory, ModuleControl, ModuleSup",
"removed": [
" if (!privMkdirs(segBackup))",
" {",
" throw StandardException.newException(",
" SQLState.RAWSTORE_CANNOT_CREATE_BACKUP_DIRECTORY,",
" (File) segBackup);",
" }"
]
},
{
"added": [
" /**",
" * Create a directory for backup.",
" *",
" * @param dir the directory to create",
" * @throws StandardException if the directory could not be created",
" */",
" private void createBackupDirectory(File dir) throws StandardException {",
" boolean created = false;",
" IOException ex = null;",
"",
" try {",
" created = privMkdirs(dir);",
" } catch (IOException ioe) {",
" ex = ioe;",
" }",
"",
" // If the directory wasn't created, report it. Also include the",
" // underlying IOException, if there was one.",
" if (!created) {",
" throw StandardException.newException(",
" SQLState.RAWSTORE_CANNOT_CREATE_BACKUP_DIRECTORY, ex, dir);",
" }",
" }",
""
],
"header": "@@ -1071,6 +1045,30 @@ public final class RawStore implements RawStoreFactory, ModuleControl, ModuleSup",
"removed": []
},
{
"added": [
" private synchronized boolean privMkdirs(File file) throws IOException"
],
"header": "@@ -2423,7 +2421,7 @@ public final class RawStore implements RawStoreFactory, ModuleControl, ModuleSup",
"removed": [
" private synchronized boolean privMkdirs( File file)"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java",
"hunks": [
{
"added": [
" try {",
" directory.limitAccessToOwner();",
" } catch (IOException ioe) {",
" if (errorOK) {",
" return null;",
" } else {",
" throw StandardException.newException(",
" SQLState.FILE_CANNOT_CREATE_SEGMENT,",
" ioe, directory);",
" }",
" }"
],
"header": "@@ -785,7 +785,17 @@ class RAFContainer extends FileContainer implements PrivilegedExceptionAction<Ob",
"removed": [
" directory.limitAccessToOwner();"
]
},
{
"added": [
" * @throws IOException if some other I/O error happens",
" throws IOException {",
" public RandomAccessFile run() throws IOException {"
],
"header": "@@ -1311,13 +1321,14 @@ class RAFContainer extends FileContainer implements PrivilegedExceptionAction<Ob",
"removed": [
" throws FileNotFoundException {",
" public RandomAccessFile run() throws FileNotFoundException {"
]
},
{
"added": [
" throw (IOException) pae.getCause();"
],
"header": "@@ -1327,7 +1338,7 @@ class RAFContainer extends FileContainer implements PrivilegedExceptionAction<Ob",
"removed": [
" throw (FileNotFoundException) pae.getCause();"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/store/raw/data/StreamFileContainer.java",
"hunks": [
{
"added": [
" boolean created = false;",
" IOException ex = null;",
" try {",
" created = privMkdirs(directory);",
" } catch (IOException ioe) {",
" ex = ioe;",
" }",
"",
" if (!created)",
" ex, directory);"
],
"header": "@@ -1042,14 +1042,22 @@ public class StreamFileContainer implements TypedFormat, PrivilegedExceptionActi",
"removed": [
"\t\t\t\t\t\t\tif (!privMkdirs(directory)) ",
" directory);"
]
},
{
"added": [
" throws IOException"
],
"header": "@@ -1084,6 +1092,7 @@ public class StreamFileContainer implements TypedFormat, PrivilegedExceptionActi",
"removed": []
},
{
"added": [
" // could throw IOException",
" throw (IOException) pae.getCause();"
],
"header": "@@ -1095,8 +1104,8 @@ public class StreamFileContainer implements TypedFormat, PrivilegedExceptionActi",
"removed": [
" // does not throw an exception",
" return false;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java",
"hunks": [
{
"added": [],
"header": "@@ -23,14 +23,6 @@ package org.apache.derby.impl.store.raw.log;",
"removed": [
"import org.apache.derby.impl.store.raw.log.CheckpointOperation;",
"import org.apache.derby.impl.store.raw.log.LogCounter;",
"import org.apache.derby.impl.store.raw.log.LogRecord;",
"import org.apache.derby.impl.store.raw.log.StreamLogScan;",
"",
"// need this to print nested exception that corrupts the database",
"",
"import org.apache.derby.iapi.services.info.ProductGenusNames;"
]
},
{
"added": [],
"header": "@@ -47,12 +39,7 @@ import org.apache.derby.iapi.services.monitor.ModuleSupportable;",
"removed": [
"import org.apache.derby.iapi.services.io.TypedFormat;",
"import org.apache.derby.iapi.services.io.FormatIdUtil;",
"import org.apache.derby.iapi.services.stream.HeaderPrintWriter;",
"import org.apache.derby.iapi.services.stream.PrintWriterGetHeader;",
"import org.apache.derby.iapi.services.stream.InfoStreams;"
]
},
{
"added": [],
"header": "@@ -67,7 +54,6 @@ import org.apache.derby.iapi.store.raw.log.LogFactory;",
"removed": [
"import org.apache.derby.iapi.store.raw.Transaction;"
]
},
{
"added": [],
"header": "@@ -79,20 +65,16 @@ import org.apache.derby.iapi.store.replication.slave.SlaveFactory;",
"removed": [
"import org.apache.derby.catalog.UUID;",
"import org.apache.derby.iapi.services.uuid.UUIDFactory;",
"import org.apache.derby.io.StorageFactory;",
"import org.apache.derby.iapi.util.InterruptDetectedException;"
]
},
{
"added": [
"import java.security.AccessController;",
"import java.security.PrivilegedActionException;"
],
"header": "@@ -103,13 +85,13 @@ import java.io.DataOutputStream;",
"removed": [
"import java.io.InterruptedIOException;",
"import java.util.Vector;"
]
},
{
"added": [
" IOException ex = null;",
" boolean created = false;",
" try {",
" created = privMkdirs(logDir);",
" } catch (IOException ioe) {",
" ex = ioe;",
" }",
" if (!created) {",
" SQLState.LOG_SEGMENT_NOT_EXIST, ex, logDir.getPath());"
],
"header": "@@ -2732,9 +2714,16 @@ public final class LogToFile implements LogFactory, ModuleControl, ModuleSupport",
"removed": [
" if (!privMkdirs(logDir)) {",
" SQLState.LOG_SEGMENT_NOT_EXIST, logDir.getPath());"
]
}
]
}
] |
derby-DERBY-6505-030bfacb
|
DERBY-6505: Clean up dead code in FileUtil
Add test that exercises FileUtil methods that are only used in soft
upgrade from 10.8 or earlier when backing up databases that contain
jar files.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1576691 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-6505-d56ee6a7
|
DERBY-6505: Clean up dead code in FileUtil
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1576673 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/iapi/services/io/FileUtil.java",
"hunks": [
{
"added": [],
"header": "@@ -102,94 +102,6 @@ public abstract class FileUtil {",
"removed": [
"\tpublic static boolean removeDirectory(String directory)",
"\t{",
"\t return removeDirectory(new File(directory));",
"\t}",
"",
"\t/**",
"\t Copy a directory and all of its contents.",
"\t */",
"\tpublic static boolean copyDirectory(File from, File to)",
"\t{",
"\t\treturn copyDirectory(from, to, (byte[])null, (String[])null);",
"\t}",
"",
"\tpublic static boolean copyDirectory(String from, String to)",
"\t{",
"\t\treturn copyDirectory(new File(from), new File(to));",
"\t}",
"",
"\t/**",
"\t\t@param filter - array of names to not copy.",
"\t*/",
"\tpublic static boolean copyDirectory(File from, File to, byte[] buffer, ",
"\t\t\t\t\t\t\t\t\t\tString[] filter)",
"\t{",
"\t\t//",
"\t\t// System.out.println(\"copyDirectory(\"+from+\",\"+to+\")\");\t\t",
"",
"\t\tif (from == null)",
"\t\t\treturn false;",
"\t\tif (!from.exists())",
"\t\t\treturn true;",
"\t\tif (!from.isDirectory())",
"\t\t\treturn false;",
"",
"\t\tif (to.exists())",
"\t\t{",
"\t\t\t//\t\t\tSystem.out.println(to + \" exists\");",
"\t\t\treturn false;",
"\t\t}",
"\t\tif (!to.mkdirs())",
"\t\t{",
"\t\t\t//\t\t\tSystem.out.println(\"can't make\" + to);",
"\t\t\treturn false;",
"\t\t}\t\t\t",
"",
" limitAccessToOwner(to);",
"",
"\t\tString[] list = from.list();",
"",
"\t\t// Some JVMs return null for File.list() when the",
"\t\t// directory is empty.",
"\t\tif (list != null) {",
"",
"\t\t\tif (buffer == null)",
"\t\t\t\tbuffer = new byte[BUFFER_SIZE]; // reuse this buffer to copy files",
"",
"nextFile:\tfor (int i = 0; i < list.length; i++) {",
"",
"\t\t\t\tString fileName = list[i];",
"",
"\t\t\t\tif (filter != null) {",
"\t\t\t\t\tfor (int j = 0; j < filter.length; j++) {",
"\t\t\t\t\t\tif (fileName.equals(filter[j]))",
"\t\t\t\t\t\t\tcontinue nextFile;",
"\t\t\t\t\t}",
"\t\t\t\t}",
"",
"",
"\t\t\t\tFile entry = new File(from, fileName);",
"",
"\t\t\t\t//\t\t\t\tSystem.out.println(\"\\tcopying entry \" + entry);",
"",
"\t\t\t\tif (entry.isDirectory())",
"\t\t\t\t{",
"\t\t\t\t\tif (!copyDirectory(entry,new File(to,fileName),buffer,filter))",
"\t\t\t\t\t\treturn false;",
"\t\t\t\t}",
"\t\t\t\telse",
"\t\t\t\t{",
"\t\t\t\t\tif (!copyFile(entry,new File(to,fileName),buffer))",
"\t\t\t\t\t\treturn false;",
"\t\t\t\t}",
"\t\t\t}",
"\t\t}",
"\t\treturn true;",
"\t}\t\t",
"",
""
]
},
{
"added": [],
"header": "@@ -490,13 +402,6 @@ nextFile:\tfor (int i = 0; i < list.length; i++) {",
"removed": [
" return copyFile( storageFactory, from, to, (byte[]) null);",
" }",
" ",
"\tpublic static boolean copyFile( WritableStorageFactory storageFactory, ",
" StorageFile from, StorageFile to, ",
" byte[] buf)",
"\t{"
]
},
{
"added": [
" byte[] buf = new byte[BUFFER_SIZE];"
],
"header": "@@ -504,8 +409,7 @@ nextFile:\tfor (int i = 0; i < list.length; i++) {",
"removed": [
"\t\t\tif (buf == null)",
"\t\t\t\tbuf = new byte[BUFFER_SIZE]; // reuse this buffer to copy files"
]
},
{
"added": [],
"header": "@@ -540,24 +444,6 @@ nextFile:\tfor (int i = 0; i < list.length; i++) {",
"removed": [
"\t/**",
"\t\tConvert a file path into a File object with an absolute path",
"\t\trelative to a passed in root. If path is absolute then",
"\t\ta file object constructed from new File(path) is returned,",
"\t\totherwise a file object is returned from new File(root, path)",
"\t\tif root is not null, otherwise null is returned.",
"\t*/",
"\tpublic static File getAbsoluteFile(File root, String path) {",
"\t\tFile file = new File(path);",
"\t\tif (file.isAbsolute())",
"\t\t\treturn file;",
"",
"\t\tif (root == null)",
"\t\t\treturn null;",
"",
"\t\treturn new File(root, path);",
"\t}",
""
]
}
]
}
] |
derby-DERBY-651-21d74bf3
|
DERBY-651: Add tests verifying that you can't drop a UDT or revoke USAGE on it if this would orphan a trigger.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@892354 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-651-2209325d
|
DERBY-651: Add dependencies of routines on UDTs.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@890115 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/iapi/sql/dictionary/AliasDescriptor.java",
"hunks": [
{
"added": [
"import org.apache.derby.iapi.sql.depend.Dependent;",
"import org.apache.derby.iapi.reference.SQLState;"
],
"header": "@@ -23,9 +23,11 @@ package org.apache.derby.iapi.sql.dictionary;",
"removed": []
},
{
"added": [
"\timplements UniqueTupleDescriptor, Provider, Dependent"
],
"header": "@@ -56,7 +58,7 @@ import org.apache.derby.iapi.services.io.StoredFormatIds;",
"removed": [
"\timplements UniqueTupleDescriptor, Provider"
]
},
{
"added": [
"\t/**",
"\t * Gets the name of the schema that the alias lives in.",
"\t *",
"\t * @return\tA String containing the name of the schema that the alias",
"\t *\t\tlives in.",
"\t */",
"\tpublic String\tgetSchemaName() throws StandardException",
"\t{",
"\t\treturn getDataDictionary().getSchemaDescriptor( schemaID, null ).getSchemaName();",
"\t}",
"",
"\t/**",
"\t * Gets the full, qualified name of the alias.",
"\t *",
"\t * @return\tA String containing the name of the table.",
"\t */",
"\tpublic String\tgetQualifiedName() throws StandardException",
"\t{",
"\t\treturn quoteProtectName(getSchemaName()) + \".\" +",
"\t\t\tquoteProtectName( aliasName );",
"\t}",
""
],
"header": "@@ -124,6 +126,28 @@ public final class AliasDescriptor",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/execute/DDLConstantAction.java",
"hunks": [
{
"added": [
"import org.apache.derby.catalog.TypeDescriptor;",
"import org.apache.derby.catalog.types.RoutineAliasInfo;"
],
"header": "@@ -29,6 +29,8 @@ import java.util.List;",
"removed": []
},
{
"added": [
" adjustUDTDependencies( lcc, dd, td, addUdtMap, dropUdtMap );",
" }",
" /**",
" * Add and drop dependencies of an object on UDTs.",
" *",
" * @param lcc Interpreter's state variable for this session.",
" * @param dd Metadata",
" * @param dependent Object which depends on UDT",
" * @param addUdtMap Map of UDTs for which dependencies should be added",
" * @param dropUdtMap Map of UDT for which dependencies should be dropped",
" */",
" private void adjustUDTDependencies",
" (",
" LanguageConnectionContext lcc,",
" DataDictionary dd,",
" Dependent dependent,",
" HashMap addUdtMap,",
" HashMap dropUdtMap",
" )",
" throws StandardException",
" {",
"\t\tTransactionController tc = lcc.getTransactionExecute();",
" DependencyManager dm = dd.getDependencyManager();",
" ContextManager cm = lcc.getContextManager();"
],
"header": "@@ -905,11 +907,33 @@ abstract class DDLConstantAction implements ConstantAction",
"removed": [
" DependencyManager dm = dd.getDependencyManager();",
" ContextManager cm = lcc.getContextManager();"
]
},
{
"added": [
" dm.addDependency( dependent, ad, cm );"
],
"header": "@@ -917,7 +941,7 @@ abstract class DDLConstantAction implements ConstantAction",
"removed": [
" dm.addDependency( td, ad, cm );"
]
}
]
}
] |
derby-DERBY-651-3210ebc9
|
DERBY-651: Adjust JDBC metadata to account for UDTs.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@893224 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java",
"hunks": [
{
"added": [
" private static final int ILLEGAL_UDT_TYPE = 0;",
" "
],
"header": "@@ -88,6 +88,8 @@ import java.io.InputStream;",
"removed": []
}
]
}
] |
derby-DERBY-651-7a2d290a
|
DERBY-651: Add tests for big UDTs.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@907509 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-651-90f42b43
|
DERBY-651: Prevent a schema from being dropped if it contains any UDTs.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@892485 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/testing/org/apache/derbyTesting/junit/JDBC.java",
"hunks": [
{
"added": [
" \" AND CHAR(A.ALIASTYPE) = ? \" +",
" psf.setString(1, \"F\" );",
" psf.setString(2, schema);",
""
],
"header": "@@ -238,13 +238,13 @@ public class JDBC {",
"removed": [
" \" AND CHAR(A.ALIASTYPE) = 'F' \" +",
" psf.setString(1, schema);",
" psf.close();",
" "
]
},
{
"added": [
" // drop UDTs",
" psf.setString(1, \"A\" );",
" psf.setString(2, schema);",
" rs = psf.executeQuery();",
" dropUsingDMD(s, rs, schema, \"ALIAS\", \"TYPE\"); ",
" psf.close();",
" "
],
"header": "@@ -300,6 +300,13 @@ public class JDBC {",
"removed": []
},
{
"added": [
" String raw = dropLeadIn + JDBC.escape(schema, objectName);",
" if ( \"TYPE\".equals( dropType ) ) { raw = raw + \" restrict \"; }",
" ddl.add( raw );"
],
"header": "@@ -342,7 +349,9 @@ public class JDBC {",
"removed": [
" ddl.add(dropLeadIn + JDBC.escape(schema, objectName));"
]
}
]
}
] |
derby-DERBY-651-989beca3
|
DERBY-651: Address instability in UDTPermsTest caused by different string representation of timestamp 0L on different platforms.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@892327 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-651-b4af7da0
|
DERBY-651: Make it possible to have UDT columns in table functions.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@907097 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/sql/compile/QueryTreeNode.java",
"hunks": [
{
"added": [
"import org.apache.derby.catalog.TypeDescriptor;",
"import org.apache.derby.catalog.types.RowMultiSetImpl;"
],
"header": "@@ -26,6 +26,8 @@ import java.util.Map;",
"removed": []
},
{
"added": [
" // if the type is a table type, then we need to bind its user-typed columns",
" if ( originalDTD.getCatalogType().isRowMultiSet() ) { return bindRowMultiSet( originalDTD ); }",
" "
],
"header": "@@ -1631,6 +1633,9 @@ public abstract class QueryTreeNode implements Visitable",
"removed": []
}
]
}
] |
derby-DERBY-651-b8c61104
|
DERBY-651: Wire UDT dependency dropping logic into DROP TABLE.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@889822 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/sql/execute/DDLConstantAction.java",
"hunks": [
{
"added": [
" DataDictionary dd,",
" TableDescriptor td,",
" ColumnInfo[] columnInfos,",
" boolean dropWholeTable",
" if ( (!dropWholeTable) && (columnInfos == null) ) { return; }",
" int changedColumnCount = columnInfos == null ? 0 : columnInfos.length;"
],
"header": "@@ -820,17 +820,18 @@ abstract class DDLConstantAction implements ConstantAction",
"removed": [
" DataDictionary dd,",
" TableDescriptor td,",
" ColumnInfo[] columnInfos",
" if ( columnInfos == null ) { return; }",
" int changedColumnCount = columnInfos.length;"
]
},
{
"added": [
" // nothing to do if there are no changed columns of udt type",
" // and this is not a DROP TABLE command",
" if ( (!dropWholeTable) && (addUdtMap.size() == 0) && (dropUdtMap.size() == 0) ) { return; }"
],
"header": "@@ -864,8 +865,9 @@ abstract class DDLConstantAction implements ConstantAction",
"removed": [
" // nothing to do if there are no columns of udt type",
" if ( (addUdtMap.size() == 0) && (dropUdtMap.size() == 0) ) { return; }"
]
}
]
}
] |
derby-DERBY-651-d039cedd
|
DERBY-651: Add ability to declare UDT columns, parameters, and return values.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@884970 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/catalog/types/BaseTypeIdImpl.java",
"hunks": [
{
"added": [
" // schema where the type lives. only for UDTs",
" private String schemaName;",
"",
" // unqualified type name",
" String unqualifiedName;",
""
],
"header": "@@ -72,7 +72,12 @@ public class BaseTypeIdImpl implements Formatable",
"removed": [
" String SQLTypeName;"
]
},
{
"added": [
" * @param SQLTypeName The unqualified SQL name of the type",
" this.schemaName = null;",
" this.unqualifiedName = SQLTypeName;",
" }",
"",
" /**",
" * Constructor for an BaseTypeIdImpl which describes a UDT",
" *",
" * @param schemaName The schema that the UDT lives in",
" * @param qualifiedName The qualified name of the UDT in that schema",
" */",
"",
" BaseTypeIdImpl(String schemaName, String unqualifiedName )",
" {",
" this.schemaName = schemaName;",
" this.unqualifiedName = unqualifiedName;",
" * Returns the SQL name of the datatype. If it is a Derby user-defined type,",
" * dot-separated path including the package names. If it is a UDT, returns",
" * \"schemaName\".\"unqualifiedName\".",
" if ( schemaName == null ) { return unqualifiedName; }",
" else { return doubleQuote( schemaName ) + '.' + doubleQuote( unqualifiedName ); }",
" /** Get the schema name of this type. Non-null only for UDTs */",
" public String getSchemaName() { return schemaName; }",
"",
" /** Get the unqualified name of this type. Except for UDTs, this is the same",
" * value as getSQLTypeName()",
" */",
" public String getUnqualifiedName() { return unqualifiedName; }",
""
],
"header": "@@ -99,26 +104,50 @@ public class BaseTypeIdImpl implements Formatable",
"removed": [
" * @param SQLTypeName The SQL name of the type",
" this.SQLTypeName = SQLTypeName;",
" * Returns the SQL name of the datatype. If it is a user-defined type,",
" * dot-separated path including the package names.",
" return SQLTypeName;"
]
},
{
"added": [
" unqualifiedName = in.readUTF();",
"",
" //",
" // If the name begins with a quote, then it is just the first part",
" // of the type name, viz., the schema that the type lives in.",
" // Strip the quotes from around the name and then read the",
" // following unqualified name.",
" //",
" if ( unqualifiedName.charAt( 0 ) == '\"' )",
" {",
" schemaName = stripQuotes( unqualifiedName );",
" unqualifiedName = in.readUTF();",
" }"
],
"header": "@@ -237,7 +266,19 @@ public class BaseTypeIdImpl implements Formatable",
"removed": [
" SQLTypeName = in.readUTF();"
]
},
{
"added": [
" if ( schemaName == null ) { out.writeUTF( unqualifiedName ); }",
" else",
" {",
" //",
" // Wrap the schema name in quotes. quotes are illegal characters in",
" // basic SQL type names and in Java class names, so this will flag",
" // readExternal() that this type has a 2-part name",
" // (schemaName.unqualifiedName).",
" //",
" out.writeUTF( doubleQuote( schemaName ) );",
" out.writeUTF( unqualifiedName );",
" }"
],
"header": "@@ -250,7 +291,18 @@ public class BaseTypeIdImpl implements Formatable",
"removed": [
" out.writeUTF( SQLTypeName );"
]
},
{
"added": [
" schemaName = null;",
" unqualifiedName = TypeId.BOOLEAN_NAME;",
" JDBCTypeId = JVMInfo.JAVA_SQL_TYPES_BOOLEAN;",
" break;",
" schemaName = null;",
" unqualifiedName = TypeId.INTEGER_NAME;",
" JDBCTypeId = Types.INTEGER;",
" break;",
" schemaName = null;",
" unqualifiedName = TypeId.SMALLINT_NAME;",
" JDBCTypeId = Types.SMALLINT;",
" break;",
" schemaName = null;",
" unqualifiedName = TypeId.TINYINT_NAME;",
" JDBCTypeId = Types.TINYINT;",
" break;",
" schemaName = null;",
" unqualifiedName = TypeId.LONGINT_NAME;",
" JDBCTypeId = Types.BIGINT;",
" break;",
" schemaName = null;",
" unqualifiedName = TypeId.DECIMAL_NAME;",
" JDBCTypeId = Types.DECIMAL;",
" break;",
" schemaName = null;",
" unqualifiedName = TypeId.DOUBLE_NAME;",
" JDBCTypeId = Types.DOUBLE;",
" break;",
" schemaName = null;",
" unqualifiedName = TypeId.REAL_NAME;",
" JDBCTypeId = Types.REAL;",
" break;",
" schemaName = null;",
" unqualifiedName = TypeId.REF_NAME;",
" JDBCTypeId = Types.OTHER;",
" break;",
" schemaName = null;",
" unqualifiedName = TypeId.CHAR_NAME;",
" JDBCTypeId = Types.CHAR;",
" break;",
" schemaName = null;",
" unqualifiedName = TypeId.VARCHAR_NAME;",
" JDBCTypeId = Types.VARCHAR;",
" break;",
" schemaName = null;",
" unqualifiedName = TypeId.LONGVARCHAR_NAME;",
" JDBCTypeId = Types.LONGVARCHAR;",
" break;",
" schemaName = null;",
" unqualifiedName = TypeId.CLOB_NAME;",
" JDBCTypeId = Types.CLOB;",
" break;",
" schemaName = null;",
" unqualifiedName = TypeId.BIT_NAME;",
" JDBCTypeId = Types.BINARY;",
" break;",
" schemaName = null;",
" unqualifiedName = TypeId.VARBIT_NAME;",
" JDBCTypeId = Types.VARBINARY;",
" break;",
" schemaName = null;",
" unqualifiedName = TypeId.LONGVARBIT_NAME;",
" JDBCTypeId = Types.LONGVARBINARY;",
" break;",
" schemaName = null;",
" unqualifiedName = TypeId.BLOB_NAME;",
" JDBCTypeId = Types.BLOB;",
" break;",
" schemaName = null;",
" unqualifiedName = TypeId.DATE_NAME;",
" JDBCTypeId = Types.DATE;",
" break;",
" schemaName = null;",
" unqualifiedName = TypeId.TIME_NAME;",
" JDBCTypeId = Types.TIME;",
" break;",
" schemaName = null;",
" unqualifiedName = TypeId.TIMESTAMP_NAME;",
" JDBCTypeId = Types.TIMESTAMP;",
" break;",
" schemaName = null;",
" unqualifiedName = TypeId.XML_NAME;",
" JDBCTypeId = JDBC40Translation.SQLXML;",
" break;"
],
"header": "@@ -258,109 +310,130 @@ public class BaseTypeIdImpl implements Formatable",
"removed": [
" SQLTypeName = TypeId.BOOLEAN_NAME;",
" JDBCTypeId = JVMInfo.JAVA_SQL_TYPES_BOOLEAN;",
" break;",
" SQLTypeName = TypeId.INTEGER_NAME;",
" JDBCTypeId = Types.INTEGER;",
" break;",
" SQLTypeName = TypeId.SMALLINT_NAME;",
" JDBCTypeId = Types.SMALLINT;",
" break;",
" SQLTypeName = TypeId.TINYINT_NAME;",
" JDBCTypeId = Types.TINYINT;",
" break;",
" SQLTypeName = TypeId.LONGINT_NAME;",
" JDBCTypeId = Types.BIGINT;",
" break;",
" SQLTypeName = TypeId.DECIMAL_NAME;",
" JDBCTypeId = Types.DECIMAL;",
" break;",
" SQLTypeName = TypeId.DOUBLE_NAME;",
" JDBCTypeId = Types.DOUBLE;",
" break;",
" SQLTypeName = TypeId.REAL_NAME;",
" JDBCTypeId = Types.REAL;",
" break;",
" SQLTypeName = TypeId.REF_NAME;",
" JDBCTypeId = Types.OTHER;",
" break;",
" SQLTypeName = TypeId.CHAR_NAME;",
" JDBCTypeId = Types.CHAR;",
" break;",
" SQLTypeName = TypeId.VARCHAR_NAME;",
" JDBCTypeId = Types.VARCHAR;",
" break;",
" SQLTypeName = TypeId.LONGVARCHAR_NAME;",
" JDBCTypeId = Types.LONGVARCHAR;",
" break;",
" SQLTypeName = TypeId.CLOB_NAME;",
" JDBCTypeId = Types.CLOB;",
" break;",
" SQLTypeName = TypeId.BIT_NAME;",
" JDBCTypeId = Types.BINARY;",
" break;",
" SQLTypeName = TypeId.VARBIT_NAME;",
" JDBCTypeId = Types.VARBINARY;",
" break;",
" SQLTypeName = TypeId.LONGVARBIT_NAME;",
" JDBCTypeId = Types.LONGVARBINARY;",
" break;",
" SQLTypeName = TypeId.BLOB_NAME;",
" JDBCTypeId = Types.BLOB;",
" break;",
" SQLTypeName = TypeId.DATE_NAME;",
" JDBCTypeId = Types.DATE;",
" break;",
" SQLTypeName = TypeId.TIME_NAME;",
" JDBCTypeId = Types.TIME;",
" break;",
" SQLTypeName = TypeId.TIMESTAMP_NAME;",
" JDBCTypeId = Types.TIMESTAMP;",
" break;",
" SQLTypeName = TypeId.XML_NAME;",
" JDBCTypeId = JDBC40Translation.SQLXML;",
" break;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/catalog/types/UserDefinedTypeIdImpl.java",
"hunks": [
{
"added": [
"\t * is assumed to be its className for Derby-only UserDefinedTypes. For",
"\t * actual user created UDTs, the SQLTypeName is a schema qualified name."
],
"header": "@@ -54,7 +54,8 @@ public class UserDefinedTypeIdImpl extends BaseTypeIdImpl",
"removed": [
"\t * is assumed to be its className."
]
},
{
"added": [
"\t/**",
"\t * Constructor for a UDT.",
"\t *",
"\t * @param schemaName\tSchema that the UDT lives in.",
"\t * @param unqualifiedName\tThe name of the type inside that schema.",
"\t * @param className\tThe Java class bound to the SQL type.",
"\t */",
"",
"\tpublic UserDefinedTypeIdImpl(String schemaName, String unqualifiedName, String className)",
"\t{",
"\t\tsuper( schemaName, unqualifiedName );",
"\t\tthis.className = className;",
"\t\tJDBCTypeId = java.sql.Types.JAVA_OBJECT;",
"\t}",
""
],
"header": "@@ -66,6 +67,21 @@ public class UserDefinedTypeIdImpl extends BaseTypeIdImpl",
"removed": []
},
{
"added": [
" ",
"\t/** Has this user type been bound? */",
"\tpublic boolean isBound() { return !(className == null); }",
""
],
"header": "@@ -78,6 +94,10 @@ public class UserDefinedTypeIdImpl extends BaseTypeIdImpl",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/types/TypeId.java",
"hunks": [
{
"added": [
"import org.apache.derby.catalog.types.TypeDescriptorImpl;"
],
"header": "@@ -26,6 +26,7 @@ import java.sql.Types;",
"removed": []
},
{
"added": [
" /**",
" * This factory method is used for UDTs. If the className argument is null,",
" * then this TypeId will have to be bound.",
" */",
" public static TypeId getUserDefinedTypeId(String schemaName, String unqualifiedName, String className )",
" {",
" return new TypeId",
" (",
" StoredFormatIds.USERDEFINED_TYPE_ID_V3,",
" new UserDefinedTypeIdImpl(schemaName, unqualifiedName, className )",
" );",
" }",
""
],
"header": "@@ -378,6 +379,19 @@ public final class TypeId",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java",
"hunks": [
{
"added": [
"\t\t\t\t\t\tif ( (!types[ i ].isUserDefinedType()) && TypeId.getBuiltInTypeId(types[i].getJDBCTypeId()).isLongConcatableTypeId())"
],
"header": "@@ -168,7 +168,7 @@ public class CreateAliasNode extends DDLStatementNode",
"removed": [
"\t\t\t\t\t\tif (TypeId.getBuiltInTypeId(types[i].getJDBCTypeId()).isLongConcatableTypeId())"
]
},
{
"added": [
" // bind the return type if it is a user defined type. this fills",
" // in the class name.",
" TypeDescriptor returnType = (TypeDescriptor) routineElements[RETURN_TYPE];",
" if ( returnType != null )",
" {",
" DataTypeDescriptor dtd = DataTypeDescriptor.getType( returnType );",
" if ( dtd.getTypeId().isUserDefinedTypeId() )",
" {",
" dtd = bindUserType( dtd );",
" returnType = dtd.getCatalogType();",
" }",
" }",
"",
" sqlAllowed, isDeterministic, calledOnNullInput, returnType );"
],
"header": "@@ -205,9 +205,22 @@ public class CreateAliasNode extends DDLStatementNode",
"removed": [
" sqlAllowed, isDeterministic, calledOnNullInput, (TypeDescriptor) routineElements[RETURN_TYPE]);"
]
},
{
"added": [
" bindParameterTypes( (RoutineAliasInfo)aliasInfo );"
],
"header": "@@ -314,6 +327,7 @@ public class CreateAliasNode extends DDLStatementNode",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/MethodCallNode.java",
"hunks": [
{
"added": [
"import org.apache.derby.catalog.types.TypeDescriptorImpl;",
"import org.apache.derby.catalog.types.UserDefinedTypeIdImpl;",
""
],
"header": "@@ -45,6 +45,9 @@ import org.apache.derby.iapi.types.DataTypeDescriptor;",
"removed": []
},
{
"added": [
"\t\t\tTypeDescriptorImpl returnType = (TypeDescriptorImpl) routineInfo.getReturnType();"
],
"header": "@@ -760,7 +763,7 @@ abstract class MethodCallNode extends JavaValueNode",
"removed": [
"\t\t\tTypeDescriptor returnType = routineInfo.getReturnType();"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/QueryTreeNode.java",
"hunks": [
{
"added": [
"import org.apache.derby.catalog.types.UserDefinedTypeIdImpl;"
],
"header": "@@ -26,6 +26,7 @@ import java.util.Map;",
"removed": []
},
{
"added": [
""
],
"header": "@@ -1310,6 +1311,7 @@ public abstract class QueryTreeNode implements Visitable",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/StaticMethodCallNode.java",
"hunks": [
{
"added": [
"\t\t\tif ( returnType != null && !returnType.isRowMultiSet() && !returnType.isUserDefinedType() )"
],
"header": "@@ -271,7 +271,7 @@ public class StaticMethodCallNode extends MethodCallNode",
"removed": [
"\t\t\tif (returnType != null && !returnType.isRowMultiSet())"
]
}
]
}
] |
derby-DERBY-651-d6c20471
|
DERBY-651: Add dependencies of views on UDTs.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@889876 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-651-e126f586
|
DERBY-651: Add dependency tracking between tables and UDTs.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@888811 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/iapi/sql/dictionary/TableDescriptor.java",
"hunks": [
{
"added": [
"import org.apache.derby.iapi.reference.SQLState;",
"import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;",
"import org.apache.derby.iapi.sql.depend.DependencyManager;",
"import org.apache.derby.iapi.sql.depend.Dependent;"
],
"header": "@@ -30,10 +30,14 @@ import org.apache.derby.catalog.Dependable;",
"removed": []
},
{
"added": [
"\timplements UniqueSQLObjectDescriptor, Provider, Dependent"
],
"header": "@@ -83,7 +87,7 @@ import org.apache.derby.iapi.types.DataValueDescriptor;",
"removed": [
"\timplements UniqueSQLObjectDescriptor, Provider"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java",
"hunks": [
{
"added": [
"import org.apache.derby.catalog.types.BaseTypeIdImpl;"
],
"header": "@@ -134,6 +134,7 @@ import org.apache.derby.catalog.AliasInfo;",
"removed": []
},
{
"added": [],
"header": "@@ -6675,8 +6676,6 @@ public final class\tDataDictionaryImpl",
"removed": [
"",
""
]
},
{
"added": [
" /**",
" * Get the alias descriptor for an ANSI UDT.",
" *",
" * @param tc The transaction to use: if null, use the compilation transaction",
" * @param dtd The UDT's type descriptor",
" *",
" * @return The UDT's alias descriptor if it is an ANSI UDT; null otherwise.",
" */",
" public AliasDescriptor getAliasDescriptorForUDT( TransactionController tc, DataTypeDescriptor dtd ) throws StandardException",
" {",
" if ( tc == null ) { tc = getTransactionCompile(); }",
"",
" if ( dtd == null ) { return null; }",
"",
" BaseTypeIdImpl btii = dtd.getTypeId().getBaseTypeId();",
" if ( !btii.isAnsiUDT() ) { return null; }",
"",
" SchemaDescriptor sd = getSchemaDescriptor( btii.getSchemaName(), tc, true );",
" AliasDescriptor ad = getAliasDescriptor",
" ( sd.getUUID().toString(), btii.getUnqualifiedName(), AliasInfo.ALIAS_NAME_SPACE_UDT_AS_CHAR );",
"",
" return ad;",
" }",
" "
],
"header": "@@ -6827,6 +6826,30 @@ public final class\tDataDictionaryImpl",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/AlterTableNode.java",
"hunks": [
{
"added": [
"import org.apache.derby.iapi.sql.compile.Visitable;",
"import org.apache.derby.iapi.sql.compile.Visitor;"
],
"header": "@@ -30,6 +30,8 @@ import org.apache.derby.iapi.services.sanity.SanityManager;",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/CreateTableNode.java",
"hunks": [
{
"added": [
"import org.apache.derby.iapi.sql.compile.Visitable;",
"import org.apache.derby.iapi.sql.compile.Visitor;"
],
"header": "@@ -38,6 +38,8 @@ import org.apache.derby.iapi.sql.dictionary.TableDescriptor;",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/TableElementList.java",
"hunks": [
{
"added": [
"",
" { numAutoCols ++; }"
],
"header": "@@ -224,8 +224,9 @@ public class TableElementList extends QueryTreeNodeVector",
"removed": [
"\t\t\t\t\tnumAutoCols ++;"
]
},
{
"added": [
" String columnName = ((TableElementNode) elementAt(index)).getName();",
"",
"\t\t\t\t\t\t\t\tcolumnName,",
"\t\t\t\t\t\t\t\ttd.getColumnDescriptor( columnName ).getType(),",
" null, null, null, null, null,"
],
"header": "@@ -483,9 +484,12 @@ public class TableElementList extends QueryTreeNodeVector",
"removed": [
"\t\t\t\t\t\t\t\t((TableElementNode) elementAt(index)).getName(),",
"\t\t\t\t\t\t\t\tnull, null, null, null, null, null,"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/TableElementNode.java",
"hunks": [
{
"added": [
"import org.apache.derby.iapi.sql.compile.C_NodeTypes;"
],
"header": "@@ -22,6 +22,7 @@",
"removed": []
},
{
"added": [
" \"elementType: \" + getElementType() + \"\\n\" +"
],
"header": "@@ -101,6 +102,7 @@ public class TableElementNode extends QueryTreeNode",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/depend/BasicDependencyManager.java",
"hunks": [
{
"added": [
""
],
"header": "@@ -264,6 +264,7 @@ public class BasicDependencyManager implements DependencyManager {",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/execute/DDLConstantAction.java",
"hunks": [
{
"added": [
"import java.util.HashMap;",
"import java.util.HashSet;",
"import org.apache.derby.catalog.AliasInfo;"
],
"header": "@@ -21,9 +21,12 @@",
"removed": []
},
{
"added": [
"import org.apache.derby.iapi.sql.dictionary.AliasDescriptor;",
"import org.apache.derby.iapi.sql.dictionary.ColumnDescriptorList;",
"import org.apache.derby.iapi.sql.dictionary.DependencyDescriptor;"
],
"header": "@@ -37,9 +40,12 @@ import org.apache.derby.iapi.sql.depend.DependencyManager;",
"removed": []
},
{
"added": [
"import org.apache.derby.iapi.types.DataTypeDescriptor;"
],
"header": "@@ -56,6 +62,7 @@ import org.apache.derby.iapi.sql.execute.ConstantAction;",
"removed": []
}
]
}
] |
derby-DERBY-651-e5114fdd
|
DERBY-651: Add test to verify that Derby still does not support SQLData types.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@907668 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-651-fa292b99
|
DERBY-651: Add CREATE/DROP TYPE. This initial increment does not allow you to create table columns or parameters whose types are used-defined.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@882569 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/catalog/AliasInfo.java",
"hunks": [
{
"added": [
"\tpublic static final char ALIAS_TYPE_UDT_AS_CHAR\t\t= 'A';",
"\tpublic static final String ALIAS_TYPE_UDT_AS_STRING\t\t= \"A\";"
],
"header": "@@ -39,10 +39,12 @@ public interface AliasInfo",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/services/io/StoredFormatIds.java",
"hunks": [
{
"added": [
" public static final int UDT_INFO_V01_ID = (MIN_ID_2 + 474);"
],
"header": "@@ -1457,6 +1457,7 @@ public interface StoredFormatIds {",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/catalog/SYSALIASESRowFactory.java",
"hunks": [
{
"added": [
"\t\t\t\t\tcase AliasInfo.ALIAS_TYPE_UDT_AS_CHAR:"
],
"header": "@@ -171,6 +171,7 @@ class SYSALIASESRowFactory extends CatalogRowFactory",
"removed": []
},
{
"added": [
"\t\t\t\tcase AliasInfo.ALIAS_TYPE_UDT_AS_CHAR: "
],
"header": "@@ -300,6 +301,7 @@ class SYSALIASESRowFactory extends CatalogRowFactory",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java",
"hunks": [
{
"added": [
"import org.apache.derby.catalog.types.UDTAliasInfo;"
],
"header": "@@ -42,6 +42,7 @@ import org.apache.derby.catalog.TypeDescriptor;",
"removed": []
},
{
"added": [
"\t\t\tcase AliasInfo.ALIAS_TYPE_UDT_AS_CHAR:",
"\t\t\t\tthis.javaClassName = (String) targetObject;",
"\t\t\t\taliasInfo = new UDTAliasInfo();",
"",
"\t\t\t\timplicitCreateSchema = true;",
" break;",
" "
],
"header": "@@ -102,6 +103,13 @@ public class CreateAliasNode extends DDLStatementNode",
"removed": []
},
{
"added": [
"\t\tcase AliasInfo.ALIAS_TYPE_UDT_AS_CHAR:",
"\t\t\treturn \"CREATE TYPE\";"
],
"header": "@@ -228,6 +236,8 @@ public class CreateAliasNode extends DDLStatementNode",
"removed": []
},
{
"added": [
" // validity checking for UDTs",
" if ( aliasType == AliasInfo.ALIAS_TYPE_UDT_AS_CHAR )",
" {",
" // nothing to do yet",
" return;",
" }",
""
],
"header": "@@ -310,6 +320,13 @@ public class CreateAliasNode extends DDLStatementNode",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/DropAliasNode.java",
"hunks": [
{
"added": [
"\t\t\tcase AliasInfo.ALIAS_TYPE_UDT_AS_CHAR:",
"\t\t\t\tnameSpace = AliasInfo.ALIAS_NAME_SPACE_UDT_AS_CHAR;",
"\t\t\t\tbreak;",
""
],
"header": "@@ -79,6 +79,10 @@ public class DropAliasNode extends DDLStatementNode",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/execute/CreateAliasConstantAction.java",
"hunks": [
{
"added": [
"\t\t\tcase AliasInfo.ALIAS_TYPE_UDT_AS_CHAR:",
"\t\t\t\tnameSpace = AliasInfo.ALIAS_NAME_SPACE_UDT_AS_CHAR;",
"\t\t\t\tbreak;",
""
],
"header": "@@ -92,6 +92,10 @@ class CreateAliasConstantAction extends DDLConstantAction",
"removed": []
},
{
"added": [
"\t\t\tcase AliasInfo.ALIAS_TYPE_UDT_AS_CHAR:",
"\t\t\t\ttype = \"CREATE TYPE \";",
"\t\t\t\tbreak;",
""
],
"header": "@@ -125,6 +129,10 @@ class CreateAliasConstantAction extends DDLConstantAction",
"removed": []
},
{
"added": [
" * CREATE FUNCTION, PROCEDURE, SYNONYM, and TYPE.",
" * A function, procedure, or udt is represented as:"
],
"header": "@@ -141,9 +149,9 @@ class CreateAliasConstantAction extends DDLConstantAction",
"removed": [
" * CREATE FUNCTION, PROCEDURE or SYNONYM.",
" * A routine (function or procedure) is represented as:"
]
},
{
"added": [
"\t\t// Create a new alias descriptor with aliasID filled in."
],
"header": "@@ -202,7 +210,7 @@ class CreateAliasConstantAction extends DDLConstantAction",
"removed": [
"\t\t// Create a new method alias descriptor with aliasID filled in."
]
}
]
}
] |
derby-DERBY-6511-8c39c1c3
|
DERBY-6511: Convert primitives to wrapper types as appropriate when chaining functions; tests passed cleanly on derby-6511-01-aa-fixPrimitiveToWrapper.diff.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1578479 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/iapi/types/JSQLType.java",
"hunks": [
{
"added": [
"\tpublic\tstatic String\tgetWrapperClassName"
],
"header": "@@ -327,7 +327,7 @@ public final class JSQLType implements Formatable",
"removed": [
"\tprivate\tstatic String\tgetWrapperClassName"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/MethodCallNode.java",
"hunks": [
{
"added": [
"import org.apache.derby.iapi.services.classfile.VMOpcode;"
],
"header": "@@ -33,6 +33,7 @@ import org.apache.derby.catalog.types.TypeDescriptorImpl;",
"removed": []
}
]
}
] |
derby-DERBY-6516-78227e48
|
DERBY-6516 Convert lang/nestedCommit.sql to JUnit NestedCommitTest
Patch derby-6516-gc to fix the intermittent error we saw on this
issue. The patch makes sure we close the result set for the statement
'values doConnCommitInt()' when executed inside a stored
procedure. Previously, it was executed by the stored procedure
"doConnStmtIntNoRS". We changed that to "doConnStmtInt" since this
statement does indeed have a result set.
The supporting procedure in Triggers#doConnStmt also had to be fixed a
bit, since this particular result set closes itself by performing a
commit inside the store procedure, which led the second ResultSet#next
to throw XLC16.
With the patch, I do not see the original error even when disabling the
explicit garbage collection (Java option -XX:+DisableExplicitGC).
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1584638 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/testing/org/apache/derbyTesting/functionTests/util/Triggers.java",
"hunks": [
{
"added": [
" private static final String RESULT_SET_NOT_OPEN = \"XCL16\";",
"",
" private Triggers()"
],
"header": "@@ -21,17 +21,16 @@",
"removed": [
"import org.apache.derby.iapi.db.*;",
"import java.math.BigDecimal;",
"import java.math.BigInteger;",
"\tprivate Triggers()"
]
},
{
"added": [
" try {",
" while (rs.next()) {}",
" } catch (SQLException e) {",
" if (RESULT_SET_NOT_OPEN.equals(e.getSQLState())) {",
" // Some side effect (stored proc?) made the rs close,",
" // bail out",
" } else {",
" throw e;",
" }",
" } finally {",
" rs.close();",
" }"
],
"header": "@@ -93,9 +92,18 @@ public class Triggers",
"removed": [
"\t\t\twhile (rs.next())",
"\t\t\t{}",
"\t\t\trs.close();"
]
}
]
}
] |
derby-DERBY-6518-c40b7edf
|
DERBY-6518: JVMInfo should not use parseFloat() to parse java.specification.version
Change the parse logic so that it recognizes that version 1.10 is greater than 1.9.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1581777 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/iapi/services/info/JVMInfo.java",
"hunks": [
{
"added": [
" // Extract major and minor version out of the spec version.",
" String[] ver = javaVersion.split(\"[.]\");",
" int major = ver.length >= 1 ? Integer.parseInt(ver[0]) : 0;",
" int minor = ver.length >= 2 ? Integer.parseInt(ver[1]) : 0;",
"",
" // The highest level currently supported is 1.8. Use that",
" // level if the spec version is greater than or equal to it.",
" final int highestMajor = 1;",
" final int highestMinor = 8;",
" if (major > highestMajor ||",
" (major == highestMajor && minor >= highestMinor)) {",
" }",
""
],
"header": "@@ -120,8 +120,20 @@ public abstract class JVMInfo",
"removed": [
" if (Float.parseFloat(javaVersion) > 1.8f)"
]
}
]
}
] |
derby-DERBY-6520-8a59583b
|
DERBY-6520 Convert lang/triggerGeneral.sql to JUnit TriggerGeneralTest
Patch derby-6520-3.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1579768 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/testing/org/apache/derbyTesting/functionTests/util/Triggers.java",
"hunks": [
{
"added": [],
"header": "@@ -35,19 +35,6 @@ public class Triggers",
"removed": [
"\tpublic static String triggerFiresMinimal(String string) throws Throwable",
"\t{",
"\t\tSystem.out.println(\"TRIGGER: \" + \"<\"+string+\">\");",
"\t\treturn \"\";",
"\t}",
"",
"\tpublic static String triggerFires(String string) throws Throwable",
"\t{",
"\t\tTriggerExecutionContext tec = Factory.getTriggerExecutionContext();",
"\t\tSystem.out.println(\"TRIGGER: \" + \"<\"+string+\"> on statement \"+tec.getEventStatementText());",
"\t\tprintTriggerChanges();",
"\t\treturn \"\";",
"\t}"
]
},
{
"added": [],
"header": "@@ -129,76 +116,6 @@ public class Triggers",
"removed": [
"\tprivate static void printTriggerChanges() throws Throwable",
"\t{",
"\t\tTriggerExecutionContext tec = Factory.getTriggerExecutionContext();",
"\t\tSystem.out.println(\"BEFORE RESULT SET\");",
"\t\tdumpRS(tec.getOldRowSet());",
"\t\tSystem.out.println(\"\\nAFTER RESULT SET\");",
"\t\tdumpRS(tec.getNewRowSet());",
"\t}",
"",
"\t// lifted from the metadata test\t",
"\tprivate static void dumpRS(ResultSet s) throws SQLException ",
"\t{",
"\t\tif (s == null)",
"\t\t{",
"\t\t\tSystem.out.println(\"<NULL>\");",
"\t\t\treturn;",
"\t\t}",
"",
"\t\tResultSetMetaData rsmd = s.getMetaData();",
"",
"\t\t// Get the number of columns in the result set",
"\t\tint numCols = rsmd.getColumnCount();",
"",
"\t\tif (numCols <= 0) ",
"\t\t{",
"\t\t\tSystem.out.println(\"(no columns!)\");",
"\t\t\treturn;",
"\t\t}",
"",
"\t\tStringBuffer heading = new StringBuffer(\"\\t \");",
"\t\tStringBuffer underline = new StringBuffer(\"\\t \");",
"",
"\t\tint len;",
"\t\t// Display column headings",
"\t\tfor (int i=1; i<=numCols; i++) ",
"\t\t{",
"\t\t\tif (i > 1) ",
"\t\t\t{",
"\t\t\t\theading.append(\",\");",
"\t\t\t\tunderline.append(\" \");",
"\t\t\t}",
"\t\t\tlen = heading.length();",
"\t\t\theading.append(rsmd.getColumnLabel(i));",
"\t\t\tlen = heading.length() - len;",
"\t\t\tfor (int j = len; j > 0; j--)",
"\t\t\t{",
"\t\t\t\tunderline.append(\"-\");",
"\t\t\t}",
"\t\t}",
"\t\tSystem.out.println(heading.toString());",
"\t\tSystem.out.println(underline.toString());",
"\t\t",
"\t",
"\t\tStringBuffer row = new StringBuffer();",
"\t\t// Display data, fetching until end of the result set",
"\t\twhile (s.next()) ",
"\t\t{",
"\t\t\trow.append(\"\\t{\");",
"\t\t\t// Loop through each column, getting the",
"\t\t\t// column data and displaying",
"\t\t\tfor (int i=1; i<=numCols; i++) ",
"\t\t\t{",
"\t\t\t\tif (i > 1) row.append(\",\");",
"\t\t\t\trow.append(s.getString(i));",
"\t\t\t}",
"\t\t\trow.append(\"}\\n\");",
"\t\t}",
"\t\tSystem.out.println(row.toString());",
"\t\ts.close();",
"\t}"
]
}
]
}
] |
derby-DERBY-6521-1fa09cea
|
DERBY-6521: Improve error handling when restricting file permissions
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1589396 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/iapi/services/io/FileUtil.java",
"hunks": [
{
"added": [],
"header": "@@ -36,7 +36,6 @@ import java.net.URL;",
"removed": [
"import org.apache.derby.shared.common.sanity.SanityManager;"
]
},
{
"added": [
" * <p>",
" * </p>",
" *",
" * <p>",
" * </p>",
" *",
" * <p>",
" * </p>",
" *",
" * <p>",
" * </p>",
" *",
" * <p>",
" * </p>",
" *",
" * <p>",
" * When restricted file access is enabled (either explicitly or by",
" * default) errors are handled like this: When running on JDK 7 or higher,",
" * and the file system can be accessed either via a PosixFileAttributeView",
" * or via an AclFileAttributeView, any IOException reported when trying",
" * to restrict the permissions will also be thrown by this method. In",
" * all other cases, it will do its best to limit the permissions using",
" * the {@code java.io.File} methods ({@code setReadable()},",
" * {@code setWritable()}, {@code setExecutable()}), but it won't throw",
" * any exceptions if the permissions cannot be set that way.",
" * </p>"
],
"header": "@@ -483,21 +482,43 @@ public abstract class FileUtil {",
"removed": [
" * <p/>",
" * <p/>",
" * <p/>",
" * <p/>"
]
},
{
"added": [
" // First attempt to limit access using the java.io.File class.",
" // If it is successful, that's it and we're done.",
" if (limitAccessToOwnerViaFile(file)) {",
" // We couldn't limit the access using the java.io.File class. Try",
" // again with a FileAttributeView if it is supported. We may have",
" // more luck with that approach. For example, with NTFS on Windows,",
" // the java.io.File class won't be able to limit access, but the",
" // FileAttributeView will.",
" limitAccessToOwnerViaFileAttributeView(file);",
" }",
"",
" /**",
" * Limit access to owner using methods in the {@code java.io.File} class.",
" * Those methods are available on all Java versions from 6 and up, but",
" * they are not fully functional on all file systems.",
" *",
" * @param file the file to limit access to",
" * @return {@code true} on success, or {@code false} if some of the",
" * permissions could not be changed",
" */",
" private static boolean limitAccessToOwnerViaFile(File file) {",
"",
" boolean success = file.setWritable(false, false);",
" success &= file.setWritable(true, true);",
" success &= file.setReadable(false, false);",
" success &= file.setReadable(true, true);",
" success &= file.setExecutable(false, false);",
" success &= file.setExecutable(true, true);",
" return success;",
" /**",
" * Limit access to owner using a",
" * {@code java.nio.file.attribute.FileAttributeView}.",
" * Such views are only available on Java 7 and higher, and only on",
" * file systems that support changing file permissions. Currently,",
" * this is supported on POSIX file systems and file systems that",
" * maintain access control lists (ACLs).",
" *",
" * @param file the file to limit access to",
" * @return {@code true} on success, or {@code false} if some of the",
" * permissions could not be changed",
" */",
" private static boolean limitAccessToOwnerViaFileAttributeView(File file)"
],
"header": "@@ -525,65 +546,67 @@ public abstract class FileUtil {",
"removed": [
" if (limitAccessToOwnerViaACLs(file)) {",
" //",
" //",
" assertTrue(file.setWritable(false, false));",
" //",
" //",
" assertTrue(file.setWritable(true, true));",
" //",
" //",
" assertTrue(file.setReadable(false, false));",
" //",
" //",
" assertTrue(file.setReadable(true, true));",
" //",
" //",
" assertTrue(file.setExecutable(false, false));",
" //",
" //",
" assertTrue(file.setExecutable(true, true));",
" }",
" private static void assertTrue(boolean b) {",
" // We should always have the permission to modify the access since have",
" // just created the file. On some file systems, some operations will",
" // not work, though, notably FAT/FAT32, as well as NTFS on java < 7, so",
" // we ignore it the failure.",
" if (SanityManager.DEBUG) {",
" if (!b) {",
" String os =",
" PropertyUtil.getSystemProperty(\"os.name\").toLowerCase();",
"",
" if (os.indexOf(\"windows\") >= 0) {",
" // expect this to fail, Java 6 on Windows doesn't cut it,",
" // known not to work.",
" } else {",
" SanityManager.THROWASSERT(",
" \"File.set{RWX} failed on this file system\");",
" }",
" }",
" }",
" private static boolean limitAccessToOwnerViaACLs(File file)"
]
}
]
}
] |
derby-DERBY-6529-a24468bd
|
DERBY-6529 nightly regression test failure in newly added junit test TriggerGeneralTest
Patch to make the test work also on Windows (CR LF issue).
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1583343 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-6533-0c997ed8
|
DERBY-6533: Plug another NPE in NsTest; commit derby-6533-aa-anotherNPE.diff.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1588289 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/testing/org/apache/derbyTesting/system/nstest/tester/TesterObject.java",
"hunks": [
{
"added": [
" /** Get a new connection and raise an error if this can't be done */",
" public Connection getNewConnection()",
" {",
" Connection conn = getConnection();",
"",
" if ( conn == null )",
" {",
" throw new RuntimeException( \"Could not get a connection!\" );",
" }",
"",
" return conn;",
" }",
""
],
"header": "@@ -96,6 +96,19 @@ public class TesterObject {",
"removed": []
},
{
"added": [
" if ( connex == null ) { connex = getNewConnection(); }",
""
],
"header": "@@ -142,6 +155,8 @@ public class TesterObject {",
"removed": []
}
]
}
] |
derby-DERBY-6533-2c381e05
|
DERBY-6533: Sort NsTest errors by the timestamp of their first occurrence; commit derby-6533-08-aa-sortErrors.diff.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1589747 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/testing/org/apache/derbyTesting/system/nstest/NsTestError.java",
"hunks": [
{
"added": [
"public class NsTestError implements Comparable<NsTestError>"
],
"header": "@@ -26,7 +26,7 @@ package org.apache.derbyTesting.system.nstest;",
"removed": [
"public class NsTestError"
]
},
{
"added": [
" ///////////////////////////////////////////////////////////////////////////////////",
" //",
" // Comparable BEHAVIOR",
" //",
" ///////////////////////////////////////////////////////////////////////////////////",
"",
" public int compareTo( NsTestError that )",
" {",
" if ( that == null ) { return -1; }",
" else",
" {",
" long thisVal = this._firstOccurrenceTime;",
" long thatVal = that._firstOccurrenceTime;",
"",
" if ( thisVal < thatVal ) { return -1; }",
" else if ( thisVal > thatVal ) { return 1; }",
" else { return 0; }",
" }",
" }",
""
],
"header": "@@ -78,6 +78,26 @@ public class NsTestError",
"removed": []
}
]
}
] |
derby-DERBY-6533-5a56bccd
|
DERBY-6533: Add more defensive code to NsTest; commit derby-6533-05-aa-dieQuickly.diff.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1587581 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/testing/org/apache/derbyTesting/system/nstest/tester/Tester1.java",
"hunks": [
{
"added": [
"",
" // if you can't change the autocommit state, the connection is unusable.",
" // get out of here.",
" return;"
],
"header": "@@ -71,6 +71,10 @@ public class Tester1 extends TesterObject {",
"removed": []
},
{
"added": [
"",
" // if the connection is dead, there's no point in hanging around",
" if ( NsTest.deadConnection( e ) ) { return; }"
],
"header": "@@ -104,6 +108,9 @@ public class Tester1 extends TesterObject {",
"removed": []
},
{
"added": [
" if ( deadConnection() ) { return; }"
],
"header": "@@ -112,6 +119,7 @@ public class Tester1 extends TesterObject {",
"removed": []
}
]
},
{
"file": "java/testing/org/apache/derbyTesting/system/nstest/tester/Tester2.java",
"hunks": [
{
"added": [
" ",
" // if you can't change the autocommit state, the connection is unusable.",
" // get out of here.",
" return;"
],
"header": "@@ -76,6 +76,10 @@ public class Tester2 extends TesterObject {",
"removed": []
}
]
},
{
"file": "java/testing/org/apache/derbyTesting/system/nstest/tester/TesterObject.java",
"hunks": [
{
"added": [
" private boolean _deadConnection = false;"
],
"header": "@@ -39,6 +39,7 @@ import org.apache.derbyTesting.system.nstest.utils.DbUtil;",
"removed": []
},
{
"added": [
" if ( NsTest.deadConnection( e ) ) { markDeadConnection(); }"
],
"header": "@@ -152,6 +153,7 @@ public class TesterObject {",
"removed": []
},
{
"added": [
" if ( rSet != null ) { rSet.close(); }",
"\t\t\tif ( s != null ) { s.close(); }",
"",
" return numRowsSelected;"
],
"header": "@@ -224,7 +226,10 @@ public class TesterObject {",
"removed": [
"\t\t\ts.close();"
]
},
{
"added": [
"\t\t if ( rSet != null ) { rSet.close(); }",
"\t\t if ( s != null ) { s.close(); }"
],
"header": "@@ -295,8 +300,8 @@ public class TesterObject {",
"removed": [
"\t\t rSet.close();",
"\t\t s.close();"
]
},
{
"added": [
" public void markDeadConnection() { _deadConnection = true; }",
"",
" public boolean deadConnection() { return _deadConnection; }",
""
],
"header": "@@ -379,4 +384,8 @@ public class TesterObject {",
"removed": []
}
]
}
] |
derby-DERBY-6533-5ccbc167
|
DERBY-6533: Add more defensive code to NsTest; commit derby-6533-07-aa-moreDefensiveCode.diff.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1589404 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/testing/org/apache/derbyTesting/system/nstest/NsTestError.java",
"hunks": [
{
"added": [
" private long _firstOccurrenceTime;",
" private long _lastOccurrenceTime;"
],
"header": "@@ -42,6 +42,8 @@ public class NsTestError",
"removed": []
},
{
"added": [
" _firstOccurrenceTime = System.currentTimeMillis();",
" _lastOccurrenceTime = _firstOccurrenceTime;"
],
"header": "@@ -54,6 +56,8 @@ public class NsTestError",
"removed": []
},
{
"added": [
"",
" /** Get the timestamp of the first occurrence */",
" public long getFirstOccurrenceTime() { return _firstOccurrenceTime; }",
"",
" /** Get the timestamp of the last occurrence */",
" public long getLastOccurrenceTime() { return _lastOccurrenceTime; }"
],
"header": "@@ -67,6 +71,12 @@ public class NsTestError",
"removed": []
}
]
},
{
"file": "java/testing/org/apache/derbyTesting/system/nstest/tester/TesterObject.java",
"hunks": [
{
"added": [
" if ( NsTest.deadConnection( e ) ) { markDeadConnection(); }"
],
"header": "@@ -183,6 +183,7 @@ public class TesterObject {",
"removed": []
},
{
"added": [
" if ( NsTest.deadConnection( e ) ) { markDeadConnection(); }"
],
"header": "@@ -196,6 +197,7 @@ public class TesterObject {",
"removed": []
}
]
}
] |
derby-DERBY-6533-777a463e
|
DERBY-6533: Add a knob to NsTest, allowing you to set a time limit for the test run; commit derby-6533-03-timerThread.diff.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1584636 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/testing/org/apache/derbyTesting/system/nstest/TimerThread.java",
"hunks": [
{
"added": [
"/*",
"",
" Derby - Class org.apache.derbyTesting.system.nstest.TimerThread",
"",
" Licensed to the Apache Software Foundation (ASF) under one or more",
" contributor license agreements. See the NOTICE file distributed with",
" this work for additional information regarding copyright ownership.",
" The ASF licenses this file to You under the Apache License, Version 2.0",
" (the \"License\"); you may not use this file except in compliance with",
" the License. You may obtain a copy of the License at",
"",
" http://www.apache.org/licenses/LICENSE-2.0",
"",
" Unless required by applicable law or agreed to in writing, software",
" distributed under the License is distributed on an \"AS IS\" BASIS,",
" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
" See the License for the specific language governing permissions and",
" limitations under the License.",
"",
" */",
"package org.apache.derbyTesting.system.nstest;",
"",
"/**",
" * <p>",
" * A thread which sleeps for a specified time period, then wakes up",
" * and terminates the VM.",
" * </p>",
" */",
"public class TimerThread extends Thread",
"{",
" ///////////////////////////////////////////////////////////////////////////////////",
" //",
" // CONSTANTS",
" //",
" ///////////////////////////////////////////////////////////////////////////////////",
"",
" ///////////////////////////////////////////////////////////////////////////////////",
" //",
" // STATE",
" //",
" ///////////////////////////////////////////////////////////////////////////////////",
"",
" private long _sleepTime;",
" private boolean _continueRunning = true;",
" ",
" ///////////////////////////////////////////////////////////////////////////////////",
" //",
" // CONSTRUCTOR",
" //",
" ///////////////////////////////////////////////////////////////////////////////////",
"",
"\tpublic TimerThread( long sleepTime )",
" {",
" _sleepTime = sleepTime;",
"\t}",
"",
" ///////////////////////////////////////////////////////////////////////////////////",
" //",
" // Thread BEHAVIOR",
" //",
" ///////////////////////////////////////////////////////////////////////////////////",
"",
"\t/*",
"\t * Implementation of run() method to sleep, wake up, and kill the program.",
"\t * ",
"\t */",
"\tpublic void run() {",
"",
" long remainingTime = _sleepTime;",
" ",
" while ( _continueRunning )",
" {",
" long cycleStartTime = System.currentTimeMillis();",
" ",
" try {",
" if ( remainingTime > 0L )",
" {",
" NsTest.logger.println( \"TimerThread sleeping for \" + remainingTime + \" milliseconds.\" );",
" sleep( remainingTime );",
" }",
"",
" //",
" // End the program. This will fire the shutdown hook which",
" // prints the final statistics.",
" //",
" NsTest.logger.println( \"TimerThread attempting to shut down the program.\" );",
" NsTest.printStatistics();",
" Runtime.getRuntime().halt( 0 );",
" ",
" } catch (java.lang.InterruptedException ie)",
" {",
" NsTest.printException( TimerThread.class.getName(), ie );",
" }",
" ",
" long elapsedTime = System.currentTimeMillis() - cycleStartTime;",
"",
" remainingTime = remainingTime - elapsedTime;",
" }",
"\t}",
"",
" ///////////////////////////////////////////////////////////////////////////////////",
" //",
" // OTHER BEHAVIOR",
" //",
" ///////////////////////////////////////////////////////////////////////////////////",
"",
" /** This method marks the thread for rundown */",
" public void stopNow() { _continueRunning = false; }",
"",
"}",
""
],
"header": "@@ -0,0 +1,111 @@",
"removed": []
}
]
}
] |
derby-DERBY-6533-b13fb1c7
|
DERBY-6533: Add a sequence generator to NsTest along with start and end timestamps; commit derby-6533-02-aa-sequencesAndMoreStats.diff.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1583749 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/testing/org/apache/derbyTesting/system/nstest/init/DbSetup.java",
"hunks": [
{
"added": [
"\t\t\t\t\t\t+ \"sequenceColumn bigint, \""
],
"header": "@@ -86,6 +86,7 @@ public class DbSetup {",
"removed": []
},
{
"added": [
" NsTest.logger.println( \"Creating nstesttab_seq sequence\" );",
" s.execute( \"create sequence nstesttab_seq as bigint start with 0\" );",
""
],
"header": "@@ -112,6 +113,9 @@ public class DbSetup {",
"removed": []
},
{
"added": [
"\t\t\t\t\t\t+ \"serialkey bigint, \"",
"\t\t\t\t\t\t+ \"sequenceColumn bigint )\");"
],
"header": "@@ -123,7 +127,8 @@ public class DbSetup {",
"removed": [
"\t\t\t\t\t\t+ \"serialkey bigint )\");"
]
}
]
},
{
"file": "java/testing/org/apache/derbyTesting/system/nstest/tester/TesterObject.java",
"hunks": [
{
"added": [
"\t\t\t\t\t+ \" t_varchar, serialkey, sequenceColumn from nstesttab where serialkey <= \""
],
"header": "@@ -216,7 +216,7 @@ public class TesterObject {",
"removed": [
"\t\t\t\t\t+ \" t_varchar, serialkey from nstesttab where serialkey <= \""
]
}
]
},
{
"file": "java/testing/org/apache/derbyTesting/system/nstest/utils/DbUtil.java",
"hunks": [
{
"added": [
"\t\t\t\t\t+ \" t_varchar,t_clob,t_blob,sequenceColumn) values (\"",
"\t\t\t\t\t+ \" ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,cast('00000000000000000000000000000000031' as clob(1K)),cast(X'000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000031' as blob(10K)), next value for nstesttab_seq)\");"
],
"header": "@@ -96,8 +96,8 @@ public class DbUtil {",
"removed": [
"\t\t\t\t\t+ \" t_varchar,t_clob,t_blob) values (\"",
"\t\t\t\t\t+ \" ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,cast('00000000000000000000000000000000031' as clob(1K)),cast(X'000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000031' as blob(10K)))\");"
]
}
]
},
{
"file": "java/testing/org/apache/derbyTesting/system/nstest/utils/SequenceReader.java",
"hunks": [
{
"added": [
"/*",
" ",
" Derby - Class org.apache.derbyTesting.system.nstest.utils.SequenceReader",
" ",
" Licensed to the Apache Software Foundation (ASF) under one or more",
" contributor license agreements. See the NOTICE file distributed with",
" this work for additional information regarding copyright ownership.",
" The ASF licenses this file to You under the Apache License, Version 2.0",
" (the \"License\"); you may not use this file except in compliance with",
" the License. You may obtain a copy of the License at",
" ",
" http://www.apache.org/licenses/LICENSE-2.0",
" ",
" Unless required by applicable law or agreed to in writing, software",
" distributed under the License is distributed on an \"AS IS\" BASIS,",
" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
" See the License for the specific language governing permissions and",
" limitations under the License.",
" ",
" */",
"",
"package org.apache.derbyTesting.system.nstest.utils;",
"",
"import java.sql.Connection;",
"import java.sql.PreparedStatement;",
"import java.sql.ResultSet;",
"import java.util.Date;",
"",
"import org.apache.derbyTesting.system.nstest.NsTest;",
"",
"/**",
" * SequenceReader - a background thread that checks the state of the sequence counter.",
" */",
"public class SequenceReader extends Thread",
"{",
" private Connection conn;",
"\tprivate int delay = 60000;",
" ",
"",
"\tpublic boolean stopNow = false;",
"",
"\tpublic SequenceReader( Connection connection, int num )",
" {",
" conn = connection;",
"\t\tdelay = num;",
"\t}",
"",
"\t/*",
"\t * Implementation of run() method to check the sequence counter.",
"\t * ",
"\t */",
"\tpublic void run() {",
" NsTest.logger.println( \"Starting the sequence reader thread with delay = \" + delay );",
"\t\twhile (stopNow == false)",
" {",
"\t\t\ttry {",
"\t\t\t\treadSequenceValue();",
"\t\t\t\tsleep( delay );",
" ",
"\t\t\t\t// first check if there are still active tester threads.",
"\t\t\t\tif (NsTest.numActiveTestThreads() != 0 && NsTest.numActiveTestThreads() > 1)",
"\t\t\t\t{",
"\t\t\t\t\tcontinue;",
"\t\t\t\t}",
"\t\t\t\telse",
"\t\t\t\t{",
"\t\t\t\t\tNsTest.logger.println(\"no more test threads, finishing SequenceReader thread also\");",
" readSequenceValue();",
"\t\t\t\t\tstopNow=true;",
"\t\t\t\t}",
"\t\t\t} catch (java.lang.InterruptedException ie) {",
"\t\t\t\tNsTest.logger.println(\"SequenceReader: unexpected error in sleep\");",
"\t\t\t}",
"\t\t}",
"\t}",
"",
"\t/*",
"\t * Print the current memory status",
"\t */",
"\tprivate void readSequenceValue()",
" {",
" try {",
" PreparedStatement ps = conn.prepareStatement",
" ( \"values syscs_util.syscs_peek_at_sequence( 'NSTEST', 'NSTESTTAB_SEQ' )\" );",
" ResultSet rs = ps.executeQuery();",
" rs.next();",
" long nextSequenceValue = rs.getLong( 1 );",
" NsTest.logger.println( \"Next sequence number = \" + nextSequenceValue );",
" NsTest.updateSequenceTracker( nextSequenceValue );",
" rs.close();",
" ps.close();",
" }",
" catch (Exception e)",
" {",
" NsTest.printException( SequenceReader.class.getName(), e );",
" }",
"\t}",
"",
"}",
""
],
"header": "@@ -0,0 +1,100 @@",
"removed": []
}
]
}
] |
derby-DERBY-6533-e225bfbf
|
DERBY-6533: Give NsTest more defenses against OutOfMemoryErrors; commit derby-6533-04-outOfMemory.diff.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1586366 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/testing/org/apache/derbyTesting/system/nstest/utils/MemCheck.java",
"hunks": [
{
"added": [
" long totalMemory = rt.totalMemory();",
" long freeMemory = rt.freeMemory();",
" NsTest.updateMemoryTracker( totalMemory, freeMemory, d );",
"\t\tNsTest.logger.println(\"total memory: \" + totalMemory + \" free: \"",
"\t\t\t\t+ freeMemory + \" \" + d.toString());"
],
"header": "@@ -77,9 +77,12 @@ public class MemCheck extends Thread {",
"removed": [
"\t\tNsTest.logger.println(\"total memory: \" + rt.totalMemory() + \" free: \"",
"\t\t\t\t+ rt.freeMemory() + \" \" + d.toString());"
]
}
]
}
] |
derby-DERBY-6534-8ae4e158
|
DERBY-6534: Remove StorageFile.getURL() and its implementations
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1583578 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/io/DirFile.java",
"hunks": [
{
"added": [],
"header": "@@ -34,8 +34,6 @@ import java.io.FileInputStream;",
"removed": [
"import java.net.MalformedURLException;",
"import java.net.URL;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/io/InputStreamFile.java",
"hunks": [
{
"added": [],
"header": "@@ -32,8 +32,6 @@ import java.io.InputStream;",
"removed": [
"import java.net.MalformedURLException;",
"import java.net.URL;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/io/JarDBFile.java",
"hunks": [
{
"added": [],
"header": "@@ -22,20 +22,10 @@",
"removed": [
"import org.apache.derby.io.StorageRandomAccessFile;",
"",
"import org.apache.derby.shared.common.sanity.SanityManager;",
"",
"import java.io.File;",
"import java.io.OutputStream;",
"import java.net.MalformedURLException;",
"import java.net.URL;",
"import java.util.zip.ZipFile;",
""
]
}
]
},
{
"file": "java/engine/org/apache/derby/io/StorageFile.java",
"hunks": [
{
"added": [],
"header": "@@ -25,8 +25,6 @@ import java.io.InputStream;",
"removed": [
"import java.net.URL;",
"import java.net.MalformedURLException;"
]
}
]
},
{
"file": "java/testing/org/apache/derbyTesting/functionTests/util/corruptio/CorruptFile.java",
"hunks": [
{
"added": [],
"header": "@@ -27,8 +27,6 @@ import java.io.InputStream;",
"removed": [
"import java.net.MalformedURLException;",
"import java.net.URL;"
]
},
{
"added": [],
"header": "@@ -362,12 +360,6 @@ class CorruptFile implements StorageFile {",
"removed": [
"\t/**",
"\t * @see org.apache.derby.io.StorageFile#getURL()",
"\t */",
"\tpublic URL getURL() throws MalformedURLException {",
"\t\tthrow new MalformedURLException(toString());",
"\t}"
]
}
]
}
] |
derby-DERBY-6535-ccbbcd4b
|
DERBY-6535: Remove storageFactory field from subclasses of InputStreamFile
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1583650 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/io/InputStreamFile.java",
"hunks": [
{
"added": [
" * @param <F> the storage factory class used by the subsubprotocol",
"abstract class InputStreamFile<F extends BaseStorageFactory>",
" implements StorageFile",
" final F storageFactory;",
" InputStreamFile(F storageFactory, String path)"
],
"header": "@@ -37,15 +37,17 @@ import org.apache.derby.iapi.error.StandardException;",
"removed": [
"abstract class InputStreamFile implements StorageFile",
" final BaseStorageFactory storageFactory;",
" InputStreamFile( BaseStorageFactory storageFactory, String path)"
]
},
{
"added": [
" StringBuilder sb =",
" new StringBuilder(storageFactory.separatedDataDirectory);"
],
"header": "@@ -55,7 +57,8 @@ abstract class InputStreamFile implements StorageFile",
"removed": [
" StringBuffer sb = new StringBuffer( storageFactory.separatedDataDirectory);"
]
},
{
"added": [
" InputStreamFile(F storageFactory, String parent, String name)",
" StringBuilder sb =",
" new StringBuilder(storageFactory.separatedDataDirectory);"
],
"header": "@@ -65,10 +68,11 @@ abstract class InputStreamFile implements StorageFile",
"removed": [
" InputStreamFile( BaseStorageFactory storageFactory, String parent, String name)",
" StringBuffer sb = new StringBuffer( storageFactory.separatedDataDirectory);"
]
},
{
"added": [
" InputStreamFile(InputStreamFile<F> dir, String name)",
" StringBuilder sb = new StringBuilder(dir.path);"
],
"header": "@@ -85,10 +89,10 @@ abstract class InputStreamFile implements StorageFile",
"removed": [
" InputStreamFile( InputStreamFile dir, String name)",
" StringBuffer sb = new StringBuffer( dir.path);"
]
},
{
"added": [
" InputStreamFile(F storageFactory, String child, int pathLen)",
" @Override"
],
"header": "@@ -98,13 +102,14 @@ abstract class InputStreamFile implements StorageFile",
"removed": [
" InputStreamFile( BaseStorageFactory storageFactory, String child, int pathLen)"
]
},
{
"added": [
" @Override"
],
"header": "@@ -113,6 +118,7 @@ abstract class InputStreamFile implements StorageFile",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/io/URLFile.java",
"hunks": [
{
"added": [
" * This class provides a http based implementation of the StorageFile interface. It is used by the",
" * database engine to access persistent data and transaction logs under the http and https subsubprotocols.",
"class URLFile extends InputStreamFile<URLStorageFactory>"
],
"header": "@@ -22,48 +22,38 @@",
"removed": [
"import org.apache.derby.io.StorageRandomAccessFile;",
"",
"import org.apache.derby.shared.common.sanity.SanityManager;",
"import java.io.OutputStream;",
" * This class provides a class path based implementation of the StorageFile interface. It is used by the",
" * database engine to access persistent data and transaction logs under the classpath subsubprotocol.",
"class URLFile extends InputStreamFile",
" private final URLStorageFactory storageFactory;",
"",
" this.storageFactory = storageFactory;",
" this.storageFactory = storageFactory;",
" this.storageFactory = dir.storageFactory;",
" this.storageFactory = storageFactory;"
]
}
]
}
] |
derby-DERBY-6540-d8804a85
|
DERBY-6540: Schema-qualified table names could be mistaken for transition tables
Don't treat schema-qualified table names as transition tables, as
transition table names are always unqualified.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1586226 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java",
"hunks": [
{
"added": [
" if (!isTransitionVariable(",
" tableName, oldReferencingName, newReferencingName))"
],
"header": "@@ -4879,9 +4879,8 @@ public final class\tDataDictionaryImpl",
"removed": [
"\t\t\t\tif ((tableName == null) ||",
"\t\t\t\t\t((oldReferencingName == null || !oldReferencingName.equals(tableName.getTableName())) &&",
"\t\t\t\t\t(newReferencingName == null || !newReferencingName.equals(tableName.getTableName()))))"
]
},
{
"added": [
" if (!isTransitionVariable(",
" tableName, oldReferencingName, newReferencingName))"
],
"header": "@@ -4970,9 +4969,8 @@ public final class\tDataDictionaryImpl",
"removed": [
"\t\t\tif ((tableName == null) ||",
"\t\t\t\t((oldReferencingName == null || !oldReferencingName.equals(tableName.getTableName())) &&",
"\t\t\t\t(newReferencingName == null || !newReferencingName.equals(tableName.getTableName()))))"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/CreateTriggerNode.java",
"hunks": [
{
"added": [],
"header": "@@ -21,7 +21,6 @@",
"removed": [
"import java.sql.Timestamp;"
]
},
{
"added": [
" if (!isTransitionTable(fromTable)) {"
],
"header": "@@ -724,9 +723,7 @@ class CreateTriggerNode extends DDLStatementNode",
"removed": [
" if (baseTableName == null",
" || (!baseTableName.equals(oldTableName)",
" && !baseTableName.equals(newTableName))) {"
]
}
]
}
] |
derby-DERBY-6542-7fd0c6ef
|
DERBY-6542: Add catalog support for using sequence generators to implement identity columns; commit derby-6542-01-ab-catalog.diff.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1589379 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java",
"hunks": [
{
"added": [
"",
" public static final int MIN_VALUE_IDX = 0;",
" public static final int MAX_VALUE_IDX = MIN_VALUE_IDX + 1;",
" public static final int MAX_MIN_ARRAY_SIZE = MAX_VALUE_IDX + 1;"
],
"header": "@@ -91,7 +91,10 @@ public final class DataTypeDescriptor implements Formatable",
"removed": [
" "
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java",
"hunks": [
{
"added": [
"\t\t\t\t\t\t\t\t\t\t\t\t\"SYSCS_PEEK_AT_IDENTITY\","
],
"header": "@@ -455,6 +455,7 @@ public final class\tDataDictionaryImpl",
"removed": []
},
{
"added": [
" public Long peekAtIdentity( String schemaName, String tableName )",
" throws StandardException",
" {",
" LanguageConnectionContext lcc = getLCC();",
" TransactionController tc = lcc.getTransactionExecute();",
" SchemaDescriptor sd = getSchemaDescriptor( schemaName, tc, true );",
" TableDescriptor td = getTableDescriptor( tableName, sd, tc );",
"",
" if ( td == null )",
" {",
" throw StandardException.newException",
" (",
" SQLState.LANG_OBJECT_NOT_FOUND_DURING_EXECUTION, \"TABLE\",",
" ( schemaName + \".\" + tableName)",
" );",
" }",
"",
" return peekAtSequence",
" (",
" SchemaDescriptor.STD_SYSTEM_SCHEMA_NAME,",
" TableDescriptor.makeSequenceName( td.getUUID() )",
" );",
" }",
" "
],
"header": "@@ -10286,6 +10287,30 @@ public final class\tDataDictionaryImpl",
"removed": []
},
{
"added": [
" // add 10.11 specific system procedures",
" create_10_11_system_procedures( tc, newlyCreatedRoutines );"
],
"header": "@@ -11342,6 +11367,8 @@ public final class\tDataDictionaryImpl",
"removed": []
},
{
"added": [
" /**",
" * <p>",
" * Create system procedures that are part of the SYSCS_UTIL schema, added in version 10.11.",
" * </p>",
" *",
" * @param tc an instance of the Transaction Controller.",
" * @param newlyCreatedRoutines set of routines we are creating (used to add permissions later on)",
" **/",
" void create_10_11_system_procedures( TransactionController tc, HashSet<String> newlyCreatedRoutines )",
" throws StandardException",
" {",
" UUID sysUtilUUID = getSystemUtilSchemaDescriptor().getUUID();",
"",
" // BIGINT",
" // SYSCS_UTIL.SYSCS_PEEK_AT_IDENTITY( VARCHAR(128), VARCHAR(128) )",
"",
" {",
" // procedure argument names",
" String[] arg_names = { \"schemaName\", \"tableName\" };",
"",
" // procedure argument types",
" TypeDescriptor[] arg_types =",
" {",
" CATALOG_TYPE_SYSTEM_IDENTIFIER,",
" CATALOG_TYPE_SYSTEM_IDENTIFIER",
" };",
"",
" createSystemProcedureOrFunction(",
" \"SYSCS_PEEK_AT_IDENTITY\",",
" sysUtilUUID,",
" arg_names,",
" arg_types,",
"\t\t\t\t0,",
"\t\t\t\t0,",
" RoutineAliasInfo.READS_SQL_DATA,",
" false,",
" false,",
" DataTypeDescriptor.getCatalogType( Types.BIGINT ),",
" newlyCreatedRoutines,",
" tc);",
" }",
" }",
""
],
"header": "@@ -13259,6 +13286,49 @@ public final class\tDataDictionaryImpl",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java",
"hunks": [
{
"added": [
" // If the column is an identity column (and the dictionary is at least version 10.11),",
" // then we need to drop the system-generated sequence backing it.",
" if (",
" columnDescriptor.isAutoincrement() &&",
" dd.checkVersion( DataDictionary.DD_VERSION_DERBY_10_11, null )",
" )",
" {",
" DropTableConstantAction.dropIdentitySequence( dd, td, activation );",
" }",
""
],
"header": "@@ -1448,6 +1448,16 @@ class AlterTableConstantAction extends DDLSingleTableConstantAction",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/execute/CreateTableConstantAction.java",
"hunks": [
{
"added": [
"import org.apache.derby.iapi.types.DataTypeDescriptor;",
"import org.apache.derby.iapi.types.TypeId;",
""
],
"header": "@@ -44,6 +44,9 @@ import org.apache.derby.iapi.sql.execute.ExecRow;",
"removed": []
},
{
"added": [
" {",
" columnDescriptor = new ColumnDescriptor",
" (",
" columnInfo[ix].name,",
" index++,",
" columnInfo[ix].dataType,",
" columnInfo[ix].defaultValue,",
" columnInfo[ix].defaultInfo,",
" td,",
" defaultUUID,",
" columnInfo[ix].autoincStart,",
" columnInfo[ix].autoincInc,",
" columnInfo[ix].autoinc_create_or_modify_Start_Increment",
" );",
"",
" //",
" // If we're at level 10.11 or higher, we create a sequence generator",
" // for the auto-increment column. See derby-6542.",
" //",
" if ( dd.checkVersion( DataDictionary.DD_VERSION_DERBY_10_11, null ) )",
" {",
" CreateSequenceConstantAction csca = makeCSCA",
" ( columnInfo[ ix ], TableDescriptor.makeSequenceName( toid ) );",
" csca.executeConstantAction( activation );",
" }",
" }",
" else",
" {",
"\t\t\t\tcolumnDescriptor = new ColumnDescriptor",
" (",
" columnInfo[ix].name,",
" index++,",
" columnInfo[ix].dataType,",
" columnInfo[ix].defaultValue,",
" columnInfo[ix].defaultInfo,",
" td,",
" defaultUUID,",
" columnInfo[ix].autoincStart,",
" columnInfo[ix].autoincInc",
" );",
" }"
],
"header": "@@ -272,30 +275,47 @@ class CreateTableConstantAction extends DDLConstantAction",
"removed": [
"\t\t\tcolumnDescriptor = new ColumnDescriptor(",
"\t\t\t\t columnInfo[ix].name,",
"\t\t\t\t\t\t\t\t index++,",
"\t\t\t\t\t\t\t\t columnInfo[ix].dataType,",
"\t\t\t\t\t\t\t\t columnInfo[ix].defaultValue,",
"\t\t\t\t\t\t\t\t columnInfo[ix].defaultInfo,",
"\t\t\t\t\t\t\t\t td,",
"\t\t\t\t\t\t\t\t defaultUUID,",
"\t\t\t\t\t\t\t\t columnInfo[ix].autoincStart,",
"\t\t\t\t\t\t\t\t columnInfo[ix].autoincInc,",
"\t\t\t\t\t\t\t\t columnInfo[ix].autoinc_create_or_modify_Start_Increment",
"\t\t\t\t\t\t\t );",
"\t\t\telse",
"\t\t\t\tcolumnDescriptor = new ColumnDescriptor(",
"\t\t columnInfo[ix].name,",
"\t\t\t\t\t\t index++,",
"\t\t\t\t\t\t columnInfo[ix].dataType,",
"\t\t\t\t\t\t columnInfo[ix].defaultValue,",
"\t\t\t\t\t\t columnInfo[ix].defaultInfo,",
"\t\t\t\t\t\t td,",
"\t\t\t\t\t\t defaultUUID,",
"\t\t\t\t\t\t columnInfo[ix].autoincStart,",
"\t\t\t\t\t\t columnInfo[ix].autoincInc",
"\t\t\t\t\t );"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/execute/DropTableConstantAction.java",
"hunks": [
{
"added": [
" }"
],
"header": "@@ -152,7 +152,7 @@ class DropTableConstantAction extends DDLSingleTableConstantAction",
"removed": [
" }"
]
},
{
"added": [
" //",
" // If we are at level 10.11 or higher, then we need to drop the",
" // sequence generator which backs the identity column.",
" // See DERBY-6542.",
" //",
" if (",
" cd.isAutoincrement() &&",
" dd.checkVersion( DataDictionary.DD_VERSION_DERBY_10_11, null )",
" )",
" {",
" dropIdentitySequence( dd, td, activation );",
" }",
" "
],
"header": "@@ -196,6 +196,19 @@ class DropTableConstantAction extends DDLSingleTableConstantAction",
"removed": []
}
]
},
{
"file": "java/tools/org/apache/derby/impl/tools/dblook/DB_Sequence.java",
"hunks": [
{
"added": [
" // exclude system-generated sequences. see DERBY-6542.",
" \"FROM SYS.SYSSEQUENCES\\n\" +",
" \"WHERE CAST( SCHEMAID AS CHAR( 36) ) != '8000000d-00d0-fd77-3ed8-000a0a0b1900'\""
],
"header": "@@ -61,10 +61,12 @@ public class DB_Sequence",
"removed": [
" \"FROM SYS.SYSSEQUENCES\""
]
}
]
}
] |
derby-DERBY-6542-8612b0bf
|
DERBY-6542: Raise LockTimeout when there is too much contention on an identity column; commit derby-6542-03-aa-lockTimeoutForIdentityContention.diff.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1596619 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/sql/catalog/SequenceUpdater.java",
"hunks": [
{
"added": [
"import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;"
],
"header": "@@ -37,6 +37,7 @@ import org.apache.derby.iapi.services.property.PropertyUtil;",
"removed": []
}
]
}
] |
derby-DERBY-6543-7b9e6859
|
DERBY-6543: Syntax error when reference to transition variable has whitespace around it
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1589036 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java",
"hunks": [
{
"added": [],
"header": "@@ -4976,14 +4976,12 @@ public final class\tDataDictionaryImpl",
"removed": [
"\t\t\tint tokEndOffset = tableName.getEndOffset();",
"\t\t\tint columnLength = ref.getEndOffset() - ref.getBeginOffset() + 1;"
]
}
]
}
] |
derby-DERBY-6544-435459ec
|
DERBY-6544: Run locale-sensitive Lucene tests in single-use databases; commit derby-6544-01-aa-singleUseDatabases.diff.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1588933 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/testing/org/apache/derbyTesting/junit/TestConfiguration.java",
"hunks": [
{
"added": [
" {",
" return sqlAuthorizationDecoratorSingleUse( test, DEFAULT_DBNAME_SQL, true );",
" }",
" ",
" /**",
" * Same as sqlAuthorizationDecoratorSingleUse, except that you can name the database yourself.",
" *",
" * @param test Test to be decorated",
" * @return decorated test.",
" *",
" * @see TestConfiguration#sqlAuthorizationDecorator(Test test)",
" */",
" public static Test sqlAuthorizationDecoratorSingleUse(Test test, String dbName, boolean removeDatabase)"
],
"header": "@@ -949,6 +949,19 @@ public final class TestConfiguration {",
"removed": []
},
{
"added": [
" if ( removeDatabase )",
" {",
" setSQLAuthMode =",
" new DropDatabaseSetup(setSQLAuthMode, dbName)",
" {",
" protected void tearDown() throws Exception {",
" // test responsible for shutdown",
" removeDatabase();",
" }",
" };",
" }",
" ",
" setSQLAuthMode = new DatabaseChangeSetup",
" ( setSQLAuthMode, dbName, dbName, true );"
],
"header": "@@ -958,14 +971,20 @@ public final class TestConfiguration {",
"removed": [
" setSQLAuthMode = new DatabaseChangeSetup(",
" new DropDatabaseSetup(setSQLAuthMode, DEFAULT_DBNAME_SQL) {",
" protected void tearDown() throws Exception {",
" // test responsible for shutdown",
" removeDatabase();",
" }",
" },",
" DEFAULT_DBNAME_SQL, DEFAULT_DBNAME_SQL, true);"
]
}
]
}
] |
derby-DERBY-6546-689206ce
|
DERBY-6546: Database can't be dropped on Windows using the decoration of LuceneSupportPermsTest
Move database shutdown from the tearDown() method of the test case to
DropDatabaseTestSuite so that no intermediate decorators reboot the
database before it is dropped.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1589624 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/testing/org/apache/derbyTesting/junit/DropDatabaseSetup.java",
"hunks": [
{
"added": [
" private final String logicalDBName;",
" private final boolean shutdownBeforeDrop;",
"",
" this(test, logicalDBName, true);",
" }",
"",
" DropDatabaseSetup(Test test, String logicalDBName, boolean shutdown) {",
" this.shutdownBeforeDrop = shutdown;",
" }",
" @Override",
" if (shutdownBeforeDrop) {",
" shutdownDatabase();",
" }",
"",
" removeDatabase();",
" }",
"",
" private void shutdownDatabase() throws SQLException {",
""
],
"header": "@@ -32,17 +32,33 @@ import org.apache.derbyTesting.functionTests.util.PrivilegedFileOpsForTests;",
"removed": [
" final String logicalDBName;",
" }",
" "
]
}
]
},
{
"file": "java/testing/org/apache/derbyTesting/junit/TestConfiguration.java",
"hunks": [
{
"added": [
" new DropDatabaseSetup(test, dbName, false),"
],
"header": "@@ -759,13 +759,7 @@ public final class TestConfiguration {",
"removed": [
" new DropDatabaseSetup(test, dbName)",
" {",
" protected void tearDown() throws Exception {",
" // test responsible for shutdown",
" removeDatabase();",
" }",
" },"
]
},
{
"added": [
" new DropDatabaseSetup(test, logicalDbName, false),"
],
"header": "@@ -833,13 +827,7 @@ public final class TestConfiguration {",
"removed": [
" new DropDatabaseSetup(test, logicalDbName)",
" {",
" protected void tearDown() throws Exception {",
" // the test is responsible for shutdown",
" removeDatabase();",
" }",
" },"
]
},
{
"added": [
" new DropDatabaseSetup(test, logicalDbName, false),"
],
"header": "@@ -863,13 +851,7 @@ public final class TestConfiguration {",
"removed": [
" new DropDatabaseSetup(test, logicalDbName)",
" {",
" protected void tearDown() throws Exception {",
" // the test is responsible for shutdown",
" removeDatabase();",
" }",
" },"
]
},
{
"added": [
" return sqlAuthorizationDecoratorSingleUse(",
" test, DEFAULT_DBNAME_SQL, false);",
" * Same as sqlAuthorizationDecoratorSingleUse, except that you can name",
" * the database yourself, and you can choose whether or not the decorator",
" * should shut down the database before it attempts to drop it.",
" * @param dbName The name of the database to use in the test",
" * @param shutdownDatabase Whether or not to shut down the database",
" * before it is dropped",
" public static Test sqlAuthorizationDecoratorSingleUse(",
" Test test, String dbName, boolean shutdownDatabase)"
],
"header": "@@ -950,18 +932,25 @@ public final class TestConfiguration {",
"removed": [
" return sqlAuthorizationDecoratorSingleUse( test, DEFAULT_DBNAME_SQL, true );",
" * Same as sqlAuthorizationDecoratorSingleUse, except that you can name the database yourself.",
" public static Test sqlAuthorizationDecoratorSingleUse(Test test, String dbName, boolean removeDatabase)"
]
},
{
"added": [
" setSQLAuthMode = new DropDatabaseSetup(",
" setSQLAuthMode, dbName, shutdownDatabase);"
],
"header": "@@ -971,17 +960,8 @@ public final class TestConfiguration {",
"removed": [
" if ( removeDatabase )",
" {",
" setSQLAuthMode =",
" new DropDatabaseSetup(setSQLAuthMode, dbName)",
" {",
" protected void tearDown() throws Exception {",
" // test responsible for shutdown",
" removeDatabase();",
" }",
" };",
" }"
]
}
]
}
] |
derby-DERBY-655-e1d51e30
|
DERBY-655: Generate unique logical conglomerateId for duplicate indexes, instead of just reusing existing conglomerateId.
Submitted by Mamta A. Satoor(msatoor@gmail.com)
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@411399 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-6550-0806f736
|
DERBY-6550: Bulk-insert causes identity columns to cycle when they shouldn't
This change was contributed by Danoja Dias (danojadias at gmail dot com)
Adds a new test case to verify that a bigint identity column correctly
refuses to cycle when the identity value reaches the maximum value.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1747486 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-6552-7863d831
|
DERBY-6552 The public api includes methods inherited from superclasses which aren't in the public api and so have no javadoc comments
Patch derby-6552-restructure-more:
- adds wrappers so that the exposed classes have the expected methods
and constants.
- changes the doc build for publishedapi so that we have a
"sourcepath" for Javadoc which contains all the sources. This is
necessary to make the wrappers inherit the (common for Basic* and
regular data sources) javadoc from a class that is otherwise not in
the API.
- added reference "link"s to official Java Javadocs for ease of
reading (SE: 8, J2EE: 7)
- removed ClientBaseDataSourceRoot putting its contents into
BasicClientDataSource40
- removed ClientBaseDataSource moving its contents into ClientDataSource
- added new serialized data source tests for 10.11
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1603019 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/client/org/apache/derby/client/ClientPooledConnection.java",
"hunks": [
{
"added": [
"import org.apache.derby.jdbc.BasicClientDataSource40;"
],
"header": "@@ -39,7 +39,7 @@ import org.apache.derby.client.am.SqlException;",
"removed": [
"import org.apache.derby.jdbc.ClientBaseDataSourceRoot;"
]
},
{
"added": [
" public ClientPooledConnection(BasicClientDataSource40 ds,"
],
"header": "@@ -107,7 +107,7 @@ public class ClientPooledConnection implements PooledConnection {",
"removed": [
" public ClientPooledConnection(ClientBaseDataSourceRoot ds,"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/ClientXAConnection.java",
"hunks": [
{
"added": [
"import org.apache.derby.jdbc.BasicClientDataSource40;"
],
"header": "@@ -30,7 +30,7 @@ import org.apache.derby.client.am.LogWriter;",
"removed": [
"import org.apache.derby.jdbc.ClientBaseDataSourceRoot;"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/ClientConnection.java",
"hunks": [
{
"added": [
"import org.apache.derby.jdbc.BasicClientDataSource40;",
"import org.apache.derby.jdbc.ClientDataSourceInterface;"
],
"header": "@@ -43,7 +43,8 @@ import java.util.Set;",
"removed": [
"import org.apache.derby.jdbc.ClientBaseDataSourceRoot;"
]
},
{
"added": [
" public BasicClientDataSource40 dataSource_;",
" private int clientSSLMode_ = BasicClientDataSource40.SSL_OFF;"
],
"header": "@@ -186,10 +187,10 @@ public abstract class ClientConnection",
"removed": [
" public ClientBaseDataSourceRoot dataSource_;",
" private int clientSSLMode_ = ClientBaseDataSourceRoot.SSL_OFF;"
]
},
{
"added": [
" BasicClientDataSource40 dataSource)"
],
"header": "@@ -206,7 +207,7 @@ public abstract class ClientConnection",
"removed": [
" ClientBaseDataSourceRoot dataSource)"
]
},
{
"added": [
" BasicClientDataSource40 dataSource)"
],
"header": "@@ -218,7 +219,7 @@ public abstract class ClientConnection",
"removed": [
" ClientBaseDataSourceRoot dataSource)"
]
},
{
"added": [
" BasicClientDataSource40 dataSource)"
],
"header": "@@ -229,7 +230,7 @@ public abstract class ClientConnection",
"removed": [
" ClientBaseDataSourceRoot dataSource)"
]
},
{
"added": [
" BasicClientDataSource40.getSSLModeFromString(dataSource.getSsl());"
],
"header": "@@ -269,7 +270,7 @@ public abstract class ClientConnection",
"removed": [
" ClientBaseDataSourceRoot.getSSLModeFromString(dataSource.getSsl());"
]
},
{
"added": [
" BasicClientDataSource40 dataSource)"
],
"header": "@@ -282,7 +283,7 @@ public abstract class ClientConnection",
"removed": [
" ClientBaseDataSourceRoot dataSource)"
]
},
{
"added": [
" user_ = ClientDataSourceInterface.propertyDefault_user;"
],
"header": "@@ -291,7 +292,7 @@ public abstract class ClientConnection",
"removed": [
" user_ = ClientBaseDataSourceRoot.propertyDefault_user;"
]
},
{
"added": [
" BasicClientDataSource40.getSSLModeFromString(dataSource.getSsl());"
],
"header": "@@ -304,7 +305,7 @@ public abstract class ClientConnection",
"removed": [
" ClientBaseDataSourceRoot.getSSLModeFromString(dataSource.getSsl());"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/ClientJDBCObjectFactory.java",
"hunks": [
{
"added": [
"import org.apache.derby.jdbc.BasicClientDataSource40;"
],
"header": "@@ -30,7 +30,7 @@ import org.apache.derby.client.ClientXAConnection;",
"removed": [
"import org.apache.derby.jdbc.ClientBaseDataSourceRoot;"
]
},
{
"added": [
" BasicClientDataSource40 ds,"
],
"header": "@@ -48,7 +48,7 @@ public interface ClientJDBCObjectFactory {",
"removed": [
" ClientBaseDataSourceRoot ds,"
]
},
{
"added": [
" ClientXAConnection newClientXAConnection(BasicClientDataSource40 ds,"
],
"header": "@@ -58,7 +58,7 @@ public interface ClientJDBCObjectFactory {",
"removed": [
" ClientXAConnection newClientXAConnection(ClientBaseDataSourceRoot ds,"
]
},
{
"added": [
" BasicClientDataSource40 dataSource,"
],
"header": "@@ -226,7 +226,7 @@ public interface ClientJDBCObjectFactory {",
"removed": [
" ClientBaseDataSourceRoot dataSource,"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/LogWriter.java",
"hunks": [
{
"added": [
"import org.apache.derby.jdbc.BasicClientDataSource40;"
],
"header": "@@ -34,8 +34,7 @@ import java.util.Iterator;",
"removed": [
"import org.apache.derby.jdbc.ClientBaseDataSourceRoot;",
"import org.apache.derby.jdbc.ClientDataSourceInterface;"
]
},
{
"added": [
" BasicClientDataSource40.TRACE_CONNECTION_CALLS)) {",
" BasicClientDataSource40.TRACE_RESULT_SET_CALLS)) {",
" BasicClientDataSource40.TRACE_STATEMENT_CALLS)) {",
" BasicClientDataSource40.TRACE_STATEMENT_CALLS)) {",
" BasicClientDataSource40.TRACE_STATEMENT_CALLS)) {",
" BasicClientDataSource40.TRACE_ALL)) // add a trace level for",
" BasicClientDataSource40.TRACE_ALL)) // add a trace level for",
" BasicClientDataSource40.TRACE_ALL)) // add a trace level for",
" else if (loggingEnabled(BasicClientDataSource40.TRACE_XA_CALLS) &&",
" } else if (loggingEnabled(BasicClientDataSource40.TRACE_ALL) &&",
" } else if (loggingEnabled(BasicClientDataSource40.TRACE_ALL) &&",
" } else if (loggingEnabled(BasicClientDataSource40.TRACE_ALL) &&",
" } else if (loggingEnabled(BasicClientDataSource40.TRACE_ALL) &&",
" } else if (loggingEnabled(BasicClientDataSource40.TRACE_ALL) &&"
],
"header": "@@ -152,61 +151,61 @@ public class LogWriter {",
"removed": [
" ClientDataSourceInterface.TRACE_CONNECTION_CALLS)) {",
" ClientDataSourceInterface.TRACE_RESULT_SET_CALLS)) {",
" ClientDataSourceInterface.TRACE_STATEMENT_CALLS)) {",
" ClientDataSourceInterface.TRACE_STATEMENT_CALLS)) {",
" ClientDataSourceInterface.TRACE_STATEMENT_CALLS)) {",
" ClientDataSourceInterface.TRACE_ALL)) // add a trace level for",
" ClientDataSourceInterface.TRACE_ALL)) // add a trace level for",
" ClientDataSourceInterface.TRACE_ALL)) // add a trace level for",
" else if (loggingEnabled(ClientDataSourceInterface.TRACE_XA_CALLS) &&",
" } else if (loggingEnabled(ClientDataSourceInterface.TRACE_ALL) &&",
" } else if (loggingEnabled(ClientDataSourceInterface.TRACE_ALL) &&",
" } else if (loggingEnabled(ClientDataSourceInterface.TRACE_ALL) &&",
" } else if (loggingEnabled(ClientDataSourceInterface.TRACE_ALL) &&",
" } else if (loggingEnabled(ClientDataSourceInterface.TRACE_ALL) &&"
]
},
{
"added": [
" if (!loggingEnabled(BasicClientDataSource40.TRACE_DIAGNOSTICS)) {"
],
"header": "@@ -349,7 +348,7 @@ public class LogWriter {",
"removed": [
" if (!loggingEnabled(ClientDataSourceInterface.TRACE_DIAGNOSTICS)) {"
]
},
{
"added": [
" if (!loggingEnabled(BasicClientDataSource40.TRACE_DIAGNOSTICS)) {"
],
"header": "@@ -359,7 +358,7 @@ public class LogWriter {",
"removed": [
" if (!loggingEnabled(ClientDataSourceInterface.TRACE_DIAGNOSTICS)) {"
]
},
{
"added": [
" if (!loggingEnabled(BasicClientDataSource40.TRACE_DIAGNOSTICS)) {"
],
"header": "@@ -370,7 +369,7 @@ public class LogWriter {",
"removed": [
" if (!loggingEnabled(ClientDataSourceInterface.TRACE_DIAGNOSTICS)) {"
]
},
{
"added": [
" BasicClientDataSource40.TRACE_PARAMETER_META_DATA) ||"
],
"header": "@@ -386,7 +385,7 @@ public class LogWriter {",
"removed": [
" ClientDataSourceInterface.TRACE_PARAMETER_META_DATA) ||"
]
},
{
"added": [
" BasicClientDataSource40.TRACE_RESULT_SET_META_DATA) ||"
],
"header": "@@ -410,7 +409,7 @@ public class LogWriter {",
"removed": [
" ClientDataSourceInterface.TRACE_RESULT_SET_META_DATA) ||"
]
},
{
"added": [
" void traceConnectEntry(BasicClientDataSource40 dataSource) {",
" BasicClientDataSource40.TRACE_DRIVER_CONFIGURATION)) {",
" if (loggingEnabled(BasicClientDataSource40.TRACE_CONNECTS)) {"
],
"header": "@@ -489,12 +488,12 @@ public class LogWriter {",
"removed": [
" void traceConnectEntry(ClientBaseDataSourceRoot dataSource) {",
" ClientDataSourceInterface.TRACE_DRIVER_CONFIGURATION)) {",
" if (loggingEnabled(ClientDataSourceInterface.TRACE_CONNECTS)) {"
]
},
{
"added": [
" BasicClientDataSource40.TRACE_DRIVER_CONFIGURATION)) {",
" if (loggingEnabled(BasicClientDataSource40.TRACE_CONNECTS)) {",
" String user, BasicClientDataSource40 ds) {",
" if (loggingEnabled(BasicClientDataSource40.TRACE_CONNECTS)) {",
" if (loggingEnabled(BasicClientDataSource40.TRACE_CONNECTS)) {",
" if (loggingEnabled(BasicClientDataSource40.TRACE_CONNECTS)) {"
],
"header": "@@ -505,32 +504,32 @@ public class LogWriter {",
"removed": [
" ClientDataSourceInterface.TRACE_DRIVER_CONFIGURATION)) {",
" if (loggingEnabled(ClientDataSourceInterface.TRACE_CONNECTS)) {",
" String user, ClientBaseDataSourceRoot ds) {",
" if (loggingEnabled(ClientDataSourceInterface.TRACE_CONNECTS)) {",
" if (loggingEnabled(ClientDataSourceInterface.TRACE_CONNECTS)) {",
" if (loggingEnabled(ClientDataSourceInterface.TRACE_CONNECTS)) {"
]
},
{
"added": [
" private void traceConnectsResetEntry(BasicClientDataSource40 dataSource) {"
],
"header": "@@ -538,7 +537,7 @@ public class LogWriter {",
"removed": [
" private void traceConnectsResetEntry(ClientBaseDataSourceRoot dataSource) {"
]
},
{
"added": [
" private void traceConnectsEntry(BasicClientDataSource40 dataSource) {"
],
"header": "@@ -549,7 +548,7 @@ public class LogWriter {",
"removed": [
" private void traceConnectsEntry(ClientBaseDataSourceRoot dataSource) {"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl.java",
"hunks": [
{
"added": [],
"header": "@@ -45,7 +45,6 @@ import org.apache.derby.client.am.SqlException;",
"removed": [
"import org.apache.derby.jdbc.ClientBaseDataSourceRoot;"
]
},
{
"added": [
"import org.apache.derby.jdbc.BasicClientDataSource40;"
],
"header": "@@ -53,6 +52,7 @@ import org.apache.derby.client.am.MaterialStatement;",
"removed": []
},
{
"added": [
" BasicClientDataSource40 ds,"
],
"header": "@@ -77,7 +77,7 @@ public class ClientJDBCObjectFactoryImpl implements ClientJDBCObjectFactory{",
"removed": [
" ClientBaseDataSourceRoot ds,"
]
},
{
"added": [
" public ClientXAConnection newClientXAConnection(BasicClientDataSource40 ds,"
],
"header": "@@ -87,7 +87,7 @@ public class ClientJDBCObjectFactoryImpl implements ClientJDBCObjectFactory{",
"removed": [
" public ClientXAConnection newClientXAConnection(ClientBaseDataSourceRoot ds,"
]
},
{
"added": [
" BasicClientDataSource40 dataSource,"
],
"header": "@@ -288,7 +288,7 @@ public class ClientJDBCObjectFactoryImpl implements ClientJDBCObjectFactory{",
"removed": [
" ClientBaseDataSourceRoot dataSource,"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/net/NetConnection.java",
"hunks": [
{
"added": [],
"header": "@@ -48,7 +48,6 @@ import org.apache.derby.shared.common.reference.MessageId;",
"removed": [
"import org.apache.derby.jdbc.ClientBaseDataSourceRoot;"
]
},
{
"added": [
"import org.apache.derby.jdbc.BasicClientDataSource40;"
],
"header": "@@ -58,6 +57,7 @@ import org.apache.derby.client.am.LogWriter;",
"removed": []
},
{
"added": [
" String password = BasicClientDataSource40.getPassword(properties);",
" BasicClientDataSource40.getSecurityMechanism(properties);"
],
"header": "@@ -204,9 +204,9 @@ public class NetConnection extends ClientConnection {",
"removed": [
" String password = ClientBaseDataSourceRoot.getPassword(properties);",
" ClientBaseDataSourceRoot.getSecurityMechanism(properties);"
]
},
{
"added": [
" BasicClientDataSource40 dataSource,"
],
"header": "@@ -218,7 +218,7 @@ public class NetConnection extends ClientConnection {",
"removed": [
" ClientBaseDataSourceRoot dataSource,"
]
},
{
"added": [
" BasicClientDataSource40 dataSource,"
],
"header": "@@ -251,7 +251,7 @@ public class NetConnection extends ClientConnection {",
"removed": [
" ClientBaseDataSourceRoot dataSource,"
]
},
{
"added": [
" BasicClientDataSource40 dataSource,"
],
"header": "@@ -263,7 +263,7 @@ public class NetConnection extends ClientConnection {",
"removed": [
" ClientBaseDataSourceRoot dataSource,"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/net/NetXAConnection.java",
"hunks": [
{
"added": [
"import org.apache.derby.jdbc.BasicClientDataSource40;"
],
"header": "@@ -29,7 +29,7 @@ import org.apache.derby.client.am.ClientStatement;",
"removed": [
"import org.apache.derby.jdbc.ClientBaseDataSourceRoot;"
]
},
{
"added": [
" BasicClientDataSource40 dataSource,"
],
"header": "@@ -65,7 +65,7 @@ public class NetXAConnection {",
"removed": [
" ClientBaseDataSourceRoot dataSource,"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/net/OpenSocketAction.java",
"hunks": [
{
"added": [
"import org.apache.derby.jdbc.BasicClientDataSource40;"
],
"header": "@@ -33,7 +33,7 @@ import java.security.UnrecoverableKeyException;",
"removed": [
"import org.apache.derby.jdbc.ClientBaseDataSourceRoot;"
]
}
]
},
{
"file": "java/client/org/apache/derby/jdbc/BasicClientDataSource40.java",
"hunks": [
{
"added": [
"import java.io.File;",
"import java.io.PrintWriter;",
"import java.io.Serializable;",
"import java.lang.reflect.InvocationTargetException;",
"import java.lang.reflect.Method;",
"import java.lang.reflect.Modifier;",
"import java.security.AccessController;",
"import java.security.PrivilegedAction;",
"import java.sql.Connection;",
"import java.sql.SQLException;",
"import java.sql.SQLFeatureNotSupportedException;",
"import java.util.Locale;",
"import java.util.NoSuchElementException;",
"import java.util.Properties;",
"import java.util.StringTokenizer;",
"import java.util.logging.Logger;",
"import javax.sql.PooledConnection;",
"import javax.sql.XAConnection;",
"import org.apache.derby.client.am.ClientMessageId;",
"import org.apache.derby.client.am.EncryptionManager;",
"import org.apache.derby.client.am.LogWriter;",
"import org.apache.derby.client.am.SQLExceptionFactory;",
"import org.apache.derby.client.am.SqlException;",
"import org.apache.derby.client.net.NetConfiguration;",
"import org.apache.derby.client.net.NetLogWriter;",
"import org.apache.derby.shared.common.error.ExceptionUtil;",
"import org.apache.derby.shared.common.reference.Attribute;",
"import org.apache.derby.shared.common.reference.SQLState;",
" * This data source is suitable for client/server use of Derby,",
"@SuppressWarnings(\"ResultOfObjectAllocationIgnored\")",
"public class BasicClientDataSource40 ",
" implements DataSource, ClientDataSourceInterface, Serializable {",
" // ---------------------------- traceLevel -------------------------------",
" //",
"",
" /**",
" * The client server protocol can be traced. The constants below define the",
" * tracing level, cf. the documentation section \"Network Client Tracing\" in",
" * the \"Derby Server and Administration Guide\". Cf. the connection",
" * attribute (or data source bean property) {@code traceLevel}.",
" *",
" * <pre>",
" * TRACE_NONE\t",
" * TRACE_CONNECTION_CALLS\t",
" * TRACE_STATEMENT_CALLS\t",
" * TRACE_RESULT_SET_CALLS\t",
" * TRACE _DRIVER_CONFIGURATION\t",
" * TRACE_CONNECTS\t",
" * TRACE_PROTOCOL_FLOWS\t",
" * TRACE _RESULT_SET_META_DATA\t",
" * TRACE _PARAMETER_META_DATA\t",
" * TRACE_DIAGNOSTICS\t",
" * TRACE_XA_CALLS\t",
" * TRACE_ALL\t",
" * </pre>",
" */",
" public final static int TRACE_NONE = 0x0;",
" /**",
" * See documentation at {@link #TRACE_NONE}.",
" */",
" public final static int TRACE_CONNECTION_CALLS = 0x1;",
" /**",
" * See documentation at {@link #TRACE_NONE}.",
" */",
" public final static int TRACE_STATEMENT_CALLS = 0x2;",
" /**",
" * See documentation at {@link #TRACE_NONE}.",
" */",
" public final static int TRACE_RESULT_SET_CALLS = 0x4;",
" /**",
" * See documentation at {@link #TRACE_NONE}.",
" */",
" /**",
" * See documentation at {@link #TRACE_NONE}.",
" */",
" public final static int TRACE_DRIVER_CONFIGURATION = 0x10;",
" /**",
" * See documentation at {@link #TRACE_NONE}.",
" */",
" public final static int TRACE_CONNECTS = 0x20;",
" /**",
" * See documentation at {@link #TRACE_NONE}.",
" */",
" public final static int TRACE_PROTOCOL_FLOWS = 0x40;",
" /**",
" * See documentation at {@link #TRACE_NONE}.",
" */",
" public final static int TRACE_RESULT_SET_META_DATA = 0x80;",
" /**",
" * See documentation at {@link #TRACE_NONE}.",
" */",
" public final static int TRACE_PARAMETER_META_DATA = 0x100;",
" /**",
" * See documentation at {@link #TRACE_NONE}.",
" */",
" public final static int TRACE_DIAGNOSTICS = 0x200;",
" /**",
" * See documentation at {@link #TRACE_NONE}.",
" */",
" public final static int TRACE_XA_CALLS = 0x800;",
" /**",
" * See documentation at {@link #TRACE_NONE}.",
" */",
" public final static int TRACE_ALL = 0xFFFFFFFF;",
" /**",
" * See documentation at {@link #TRACE_NONE}.",
" */",
" public final static int propertyDefault_traceLevel = TRACE_ALL;",
"",
" static",
" {",
" try {",
" // The EncryptionManager class will instantiate objects of the",
" // required security algorithms that are needed for EUSRIDPWD An",
" // exception will be thrown if support is not available in the JCE",
" // implementation in the JVM in which the client is loaded.",
" new EncryptionManager(null);",
" } catch(Exception e) {",
" // if an exception is thrown, ignore exception.",
" }",
"",
" }",
""
],
"header": "@@ -21,23 +21,143 @@",
"removed": [
" * This datasource is suitable for client/server use of Derby,",
"public class BasicClientDataSource40",
" extends ClientBaseDataSourceRoot implements DataSource {"
]
}
]
},
{
"file": "java/client/org/apache/derby/jdbc/ClientDataSource.java",
"hunks": [
{
"added": [
"import java.util.Enumeration;",
"import java.util.Properties;",
"import javax.naming.NamingException;",
"import javax.naming.Reference;",
"import javax.naming.Referenceable;",
"import javax.naming.StringRefAddr;",
"import org.apache.derby.client.ClientDataSourceFactory;",
"",
" * This data source is suitable for a client/server use of Derby,"
],
"header": "@@ -21,8 +21,16 @@",
"removed": [
" * This datasource is suitable for a client/server use of Derby,"
]
},
{
"added": [
" * This simple data source subclass of BasicClientDataSource40 maintains"
],
"header": "@@ -75,7 +83,7 @@ package org.apache.derby.jdbc;",
"removed": [
" * This simple data source subclass of ClientBaseDataSource maintains"
]
},
{
"added": [
"public class ClientDataSource extends BasicClientDataSource40 ",
" implements Referenceable {"
],
"header": "@@ -89,7 +97,8 @@ package org.apache.derby.jdbc;",
"removed": [
"public class ClientDataSource extends ClientBaseDataSource {"
]
}
]
},
{
"file": "java/client/org/apache/derby/jdbc/ClientDriver.java",
"hunks": [
{
"added": [
" port = BasicClientDataSource40.propertyDefault_portNumber;"
],
"header": "@@ -127,7 +127,7 @@ public class ClientDriver implements Driver {",
"removed": [
" port = ClientBaseDataSourceRoot.propertyDefault_portNumber;"
]
},
{
"added": [
" BasicClientDataSource40.getTraceLevel(augmentedProperties);"
],
"header": "@@ -140,7 +140,7 @@ public class ClientDriver implements Driver {",
"removed": [
" ClientBaseDataSourceRoot.getTraceLevel(augmentedProperties);"
]
},
{
"added": [
" BasicClientDataSource40.computeDncLogWriterForNewConnection(",
" BasicClientDataSource40.getTraceDirectory(",
" BasicClientDataSource40.getTraceFile(",
" BasicClientDataSource40.getTraceFileAppend("
],
"header": "@@ -152,13 +152,13 @@ public class ClientDriver implements Driver {",
"removed": [
" ClientBaseDataSourceRoot.computeDncLogWriterForNewConnection(",
" ClientBaseDataSourceRoot.getTraceDirectory(",
" ClientBaseDataSourceRoot.getTraceFile(",
" ClientBaseDataSourceRoot.getTraceFileAppend("
]
},
{
"added": [
" BasicClientDataSource40.propertyDefault_user));"
],
"header": "@@ -254,7 +254,7 @@ public class ClientDriver implements Driver {",
"removed": [
" ClientBaseDataSourceRoot.propertyDefault_user));"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/BasicEmbeddedDataSource40.java",
"hunks": [
{
"added": [
"import java.io.PrintWriter;",
"import java.sql.Connection;",
"import java.sql.SQLException;",
" * This data source is suitable for an application using embedded Derby,"
],
"header": "@@ -21,13 +21,16 @@",
"removed": [
" * This datasource is suitable for an application using embedded Derby,"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/EmbeddedBaseDataSource.java",
"hunks": [
{
"added": [
" public synchronized void setDatabaseName(String databaseName) {"
],
"header": "@@ -115,7 +115,7 @@ public abstract class EmbeddedBaseDataSource",
"removed": [
" public final synchronized void setDatabaseName(String databaseName) {"
]
},
{
"added": [
" private String getShortDatabaseName() {"
],
"header": "@@ -138,7 +138,7 @@ public abstract class EmbeddedBaseDataSource",
"removed": [
" protected String getShortDatabaseName() {"
]
},
{
"added": [
" public void setDataSourceName(String dsn) {",
" public String getDataSourceName() {"
],
"header": "@@ -148,14 +148,14 @@ public abstract class EmbeddedBaseDataSource",
"removed": [
" public final void setDataSourceName(String dsn) {",
" public final String getDataSourceName() {"
]
},
{
"added": [
" public void setDescription(String desc) {",
" public String getDescription() {"
],
"header": "@@ -165,14 +165,14 @@ public abstract class EmbeddedBaseDataSource",
"removed": [
" public final void setDescription(String desc) {",
" public final String getDescription() {"
]
},
{
"added": [
" public void setUser(String user) {",
" public String getUser() {"
],
"header": "@@ -182,14 +182,14 @@ public abstract class EmbeddedBaseDataSource",
"removed": [
" public final void setUser(String user) {",
" public final String getUser() {"
]
},
{
"added": [
" public void setPassword(String password) {",
" public String getPassword() {"
],
"header": "@@ -199,14 +199,14 @@ public abstract class EmbeddedBaseDataSource",
"removed": [
" public final void setPassword(String password) {",
" public final String getPassword() {"
]
},
{
"added": [
" public void setCreateDatabase(String create) {"
],
"header": "@@ -341,7 +341,7 @@ public abstract class EmbeddedBaseDataSource",
"removed": [
" public final void setCreateDatabase(String create) {"
]
},
{
"added": [
" public String getCreateDatabase() {"
],
"header": "@@ -354,7 +354,7 @@ public abstract class EmbeddedBaseDataSource",
"removed": [
" public final String getCreateDatabase() {"
]
},
{
"added": [
" public void setConnectionAttributes(String prop) {"
],
"header": "@@ -406,7 +406,7 @@ public abstract class EmbeddedBaseDataSource",
"removed": [
" public final void setConnectionAttributes(String prop) {"
]
},
{
"added": [
" public String getConnectionAttributes() {"
],
"header": "@@ -416,7 +416,7 @@ public abstract class EmbeddedBaseDataSource",
"removed": [
" public final String getConnectionAttributes() {"
]
},
{
"added": [
" public void setShutdownDatabase(String shutdown) {"
],
"header": "@@ -427,7 +427,7 @@ public abstract class EmbeddedBaseDataSource",
"removed": [
" public final void setShutdownDatabase(String shutdown) {"
]
},
{
"added": [
" public String getShutdownDatabase() {"
],
"header": "@@ -439,7 +439,7 @@ public abstract class EmbeddedBaseDataSource",
"removed": [
" public final String getShutdownDatabase() {"
]
},
{
"added": [
" public void setAttributesAsPassword(boolean attributesAsPassword) {"
],
"header": "@@ -456,7 +456,7 @@ public abstract class EmbeddedBaseDataSource",
"removed": [
" public final void setAttributesAsPassword(boolean attributesAsPassword) {"
]
},
{
"added": [
" public boolean getAttributesAsPassword() {"
],
"header": "@@ -465,7 +465,7 @@ public abstract class EmbeddedBaseDataSource",
"removed": [
" public final boolean getAttributesAsPassword() {"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/EmbeddedDataSource.java",
"hunks": [
{
"added": [
"import java.io.PrintWriter;",
"import java.sql.Connection;",
"import java.sql.SQLException;",
"import java.sql.SQLFeatureNotSupportedException;",
"import java.util.logging.Logger;"
],
"header": "@@ -21,9 +21,14 @@",
"removed": []
},
{
"added": [
" This data source is suitable for an application using embedded Derby,"
],
"header": "@@ -31,7 +36,7 @@ import javax.naming.StringRefAddr;",
"removed": [
" This datasource is suitable for an application using embedded Derby,"
]
}
]
}
] |
derby-DERBY-6552-a0866201
|
DERBY-6552 The public api includes methods inherited from superclasses which aren't in the public api and so have no javadoc comments
Follow-up patch derby-6552-restructure-even-more. This restructures
the embedded hierarchy to avoid duplication also. It eliminates
EmbeddedBaseDataSource. Removed a slew of warnings in the IDE also by
some code washing, and regenerated the 10.11 serialized data sources
for the SerializedDataSourceTest. I removed some Javadoc from
non-public members in the API classes, and replaced them with
end-of-line comments instead (to avoid user confusion).
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1603022 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/jdbc/BasicEmbeddedConnectionPoolDataSource40.java",
"hunks": [
{
"added": [
" * This data source is suitable for an application using embedded Derby,"
],
"header": "@@ -24,7 +24,7 @@ import java.sql.SQLException;",
"removed": [
" * This datasource is suitable for an application using embedded Derby,"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/BasicEmbeddedDataSource40.java",
"hunks": [
{
"added": [
"import java.sql.Driver;",
"import java.sql.DriverManager;",
"import java.util.Properties;",
"import org.apache.derby.iapi.db.Database;",
"import org.apache.derby.iapi.error.ExceptionSeverity;",
"import org.apache.derby.iapi.jdbc.ResourceAdapter;",
"import org.apache.derby.iapi.reference.Attribute;",
"import org.apache.derby.iapi.reference.MessageId;",
"import org.apache.derby.iapi.reference.Property;",
"import org.apache.derby.iapi.reference.SQLState;",
"import org.apache.derby.iapi.services.i18n.MessageService;",
"import org.apache.derby.iapi.services.monitor.Monitor;"
],
"header": "@@ -23,9 +23,21 @@ package org.apache.derby.jdbc;",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/BasicEmbeddedXADataSource40.java",
"hunks": [
{
"added": [
" @Override"
],
"header": "@@ -56,9 +56,7 @@ public class BasicEmbeddedXADataSource40",
"removed": [
" /**",
" * @see javax.sql.XADataSource#getXAConnection()",
" */"
]
},
{
"added": [
" @Override"
],
"header": "@@ -68,9 +66,7 @@ public class BasicEmbeddedXADataSource40",
"removed": [
" /**",
" * @see javax.sql.XADataSource#getXAConnection(String, String)",
" */"
]
},
{
"added": [
" @Override",
" // Instantiate and return an EmbedXAConnection from this instance",
" // of EmbeddedXADataSource."
],
"header": "@@ -82,21 +78,15 @@ public class BasicEmbeddedXADataSource40",
"removed": [
" /**",
" * Instantiate and return an EmbedXAConnection from this instance",
" * of EmbeddedXADataSource.",
" *",
" * @param user",
" * @param password",
" * @return XAConnection",
" * @throws SQLException if a connection can't be created",
" */"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/EmbedPooledConnection.java",
"hunks": [
{
"added": [
" final BasicEmbeddedDataSource40 dataSource;"
],
"header": "@@ -100,7 +100,7 @@ class EmbedPooledConnection implements javax.sql.PooledConnection, BrokeredConne",
"removed": [
" final EmbeddedBaseDataSource dataSource;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/EmbeddedConnectionPoolDataSource.java",
"hunks": [
{
"added": [],
"header": "@@ -22,11 +22,8 @@",
"removed": [
"import java.sql.SQLFeatureNotSupportedException;",
"import java.util.logging.Logger;",
"import org.apache.derby.impl.jdbc.Util;"
]
},
{
"added": [
" @Override"
],
"header": "@@ -84,6 +81,7 @@ public class EmbeddedConnectionPoolDataSource extends EmbeddedDataSource",
"removed": []
},
{
"added": [
" @Override"
],
"header": "@@ -98,6 +96,7 @@ public class EmbeddedConnectionPoolDataSource extends EmbeddedDataSource",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/EmbeddedDataSource.java",
"hunks": [
{
"added": [],
"header": "@@ -21,14 +21,9 @@",
"removed": [
"import java.io.PrintWriter;",
"import java.sql.Connection;",
"import java.sql.SQLException;",
"import java.sql.SQLFeatureNotSupportedException;",
"import java.util.logging.Logger;"
]
},
{
"added": [
" @Override"
],
"header": "@@ -239,6 +234,7 @@ public class EmbeddedDataSource extends ReferenceableDataSource",
"removed": []
},
{
"added": [
" //",
" // Add Java Bean properties to the reference using",
" // StringRefAddr for each property. List of bean properties",
" // is defined from the public getXXX() methods on this object",
" // that take no arguments and return short, int, boolean or String.",
" // The StringRefAddr has a key of the Java bean property name,",
" // converted from the method name. E.g. traceDirectory for",
" // traceDirectory.",
" for (Method m : methods) {"
],
"header": "@@ -253,25 +249,20 @@ public class EmbeddedDataSource extends ReferenceableDataSource",
"removed": [
" /**",
" * Add Java Bean properties to the reference using",
" * StringRefAddr for each property. List of bean properties",
" * is defined from the public getXXX() methods on this object",
" * that take no arguments and return short, int, boolean or String.",
" * The StringRefAddr has a key of the Java bean property name,",
" * converted from the method name. E.g. traceDirectory for",
" * traceDirectory.",
" *",
" */",
" for (int i = 0; i < methods.length; i++) {",
"",
" Method m = methods[i];",
""
]
},
{
"added": [
" Class<?> returnType = m.getReturnType();"
],
"header": "@@ -285,7 +276,7 @@ public class EmbeddedDataSource extends ReferenceableDataSource",
"removed": [
" Class returnType = m.getReturnType();"
]
},
{
"added": [
" methodName.substring(4));",
" Object ov = m.invoke(ths, (Object[])null);"
],
"header": "@@ -297,10 +288,10 @@ public class EmbeddedDataSource extends ReferenceableDataSource",
"removed": [
" methodName.substring(4));",
" Object ov = m.invoke(ths, null);"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/EmbeddedXADataSource.java",
"hunks": [
{
"added": [
" This data source is suitable for an application using embedded Derby,"
],
"header": "@@ -23,18 +23,12 @@ package org.apache.derby.jdbc;",
"removed": [
"import org.apache.derby.iapi.db.Database;",
"import org.apache.derby.iapi.error.ExceptionSeverity;",
"import org.apache.derby.iapi.reference.MessageId;",
"import org.apache.derby.iapi.reference.Property;",
"import org.apache.derby.iapi.services.i18n.MessageService;",
"import org.apache.derby.iapi.services.monitor.Monitor;",
" This datasource is suitable for an application using embedded Derby,"
]
},
{
"added": [
"public class EmbeddedXADataSource extends EmbeddedDataSource",
" implements EmbeddedXADataSourceInterface"
],
"header": "@@ -70,7 +64,8 @@ import org.apache.derby.iapi.services.monitor.Monitor;",
"removed": [
"public class EmbeddedXADataSource extends EmbeddedDataSource implements EmbeddedXADataSourceInterface"
]
},
{
"added": [
" @Override"
],
"header": "@@ -98,6 +93,7 @@ public class EmbeddedXADataSource extends EmbeddedDataSource implements Embedded",
"removed": []
},
{
"added": [
" @Override"
],
"header": "@@ -115,6 +111,7 @@ public class EmbeddedXADataSource extends EmbeddedDataSource implements Embedded",
"removed": []
},
{
"added": [
" @Override",
" protected void update() {",
" //",
" // Instantiate and return an EmbedXAConnection from this instance",
" // of EmbeddedXADataSource.",
" //"
],
"header": "@@ -128,20 +125,17 @@ public class EmbeddedXADataSource extends EmbeddedDataSource implements Embedded",
"removed": [
" protected void update() {",
" /**",
" * Instantiate and return an EmbedXAConnection from this instance",
" * of EmbeddedXADataSource.",
" *",
" * @param user ",
" * @param password ",
" * @return XAConnection",
" */"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/ReferenceableDataSource.java",
"hunks": [
{
"added": [
"import java.lang.reflect.Method;"
],
"header": "@@ -20,7 +20,7 @@",
"removed": [
"import java.lang.reflect.*;"
]
},
{
"added": [
"public class ReferenceableDataSource extends BasicEmbeddedDataSource40"
],
"header": "@@ -47,14 +47,11 @@ import javax.naming.spi.ObjectFactory;",
"removed": [
" * @see org.apache.derby.jdbc.EmbeddedDataSource40",
" * @see org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource40",
" * @see org.apache.derby.jdbc.EmbeddedXADataSource40",
"public class ReferenceableDataSource extends EmbeddedBaseDataSource"
]
},
{
"added": [
" @Override"
],
"header": "@@ -87,6 +84,7 @@ public class ReferenceableDataSource extends EmbeddedBaseDataSource",
"removed": []
}
]
},
{
"file": "java/testing/org/apache/derbyTesting/junit/JDBCClient.java",
"hunks": [
{
"added": [
" \"org.apache.derby.jdbc.EmbeddedDataSource\":",
" \"org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource\":",
" \"org.apache.derby.jdbc.EmbeddedXADataSource\":"
],
"header": "@@ -47,15 +47,15 @@ public final class JDBCClient {",
"removed": [
" \"org.apache.derby.jdbc.EmbeddedDataSource40\":",
" \"org.apache.derby.jdbc.EmbeddedConnectionPoolDataSource40\":",
" \"org.apache.derby.jdbc.EmbeddedXADataSource40\":"
]
}
]
}
] |
derby-DERBY-6552-b004dff2
|
DERBY-6552 The public api includes methods inherited from superclasses which aren't in the public api and so have no javadoc comments
Patch derby-6552-only-public-members.
Changes the way we generate public API javadocs by restricting it to
public class members.
Adds back Javadocs for private, class private and protected members
removed before.
Added some missing Javadocs.
Moved the top level class javadocs that were nto visible (root
classes) down to the first level visible data sources, so we can get
the data source properties documented for embedded. Added this for
client. Cf. BasicEmbeddedDataSource40 and BasicClientDataSource40
respectively.
Added missing @serial tags
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1603549 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/client/org/apache/derby/jdbc/BasicClientDataSource40.java",
"hunks": [
{
"added": [
" * <p/>",
" * * The standard attributes provided are, cf. e.g. table",
" * 9.1 in the JDBC 4.2 specification.",
" * <ul>",
" * <li>databaseName</li>",
" * <li>dataSourceName</li>",
" * <li>description</li>",
" * <li>password</li>",
" * <li>user</li>",
" * </ul>",
" * These standard attributes are not supported:",
" * <ul>",
" * <li>networkProtocol</li>",
" * <li>roleName</li>",
" * </ul>",
" * The Derby client driver also supports these attributes:",
" * <ul>",
" * <li>loginTimeout</li> @see javax.sql.CommonDataSource set/get",
" * <li>logWriter</li> @see javax.sql.CommonDataSource set/get",
" * <li>createDatabase</li>",
" * <li>connectionAttributes</li>",
" * <li>shutdownDatabase</li>",
" * <li>attributesAsPassword</li>",
" * <li>retrieveMessageText</li>",
" * <li>securityMechanism</li>",
" * <li>traceDirectory</li>",
" * <li>traceFile</li>",
" * <li>traceFileAppend</li>",
" * <li>traceLevel<li>",
" * </ul>"
],
"header": "@@ -58,6 +58,36 @@ import org.apache.derby.shared.common.reference.SQLState;",
"removed": []
},
{
"added": [
" // ---------------------------- loginTimeout ------------------------------"
],
"header": "@@ -230,7 +260,7 @@ public class BasicClientDataSource40",
"removed": [
" // ---------------------------- loginTimeout ------------------------------"
]
},
{
"added": [
" ",
" /**",
" * Stores the relational database name, RDBNAME.",
" * The length of the database name may be limited to 18 bytes",
" * and therefore may throw an SQLException.",
" * @serial",
" */",
" ",
" /**",
" * A description of this data source.",
" * @serial",
" */",
" ",
" /**",
" * A data source name;",
" * used to name an underlying XADataSource,",
" * or ConnectionPoolDataSource when pooling of connections is done.",
" * @serial",
" */",
"",
" /**",
" * @serial",
" */",
" ",
" /**",
" * @serial ",
" */",
" private String serverName = propertyDefault_serverName; // Derby-410 fix."
],
"header": "@@ -270,36 +300,50 @@ public class BasicClientDataSource40",
"removed": [
" // Stores the relational database name, RDBNAME.",
" // The length of the database name may be limited to 18 bytes",
" // and therefore may throw an SQLException.",
" //",
" //",
" // A description of this data source.",
" // A data source name;",
" // used to name an underlying XADataSource,",
" // or ConnectionPoolDataSource when pooling of connections is done.",
" //",
" //",
" //",
" // Derby-410 fix.",
" private String serverName = propertyDefault_serverName;"
]
},
{
"added": [
" ",
" /**",
" * This property can be overwritten by specifing the",
" * username parameter on the DataSource.getConnection() method",
" * call. If user is specified, then password must also be",
" * specified, either in the data source object or provided on",
" * the DataSource.getConnection() call.",
" *",
" * Each data source implementation subclass will maintain it's own",
" * <code>password</code> property. This password property may or may not",
" * be declared transient, and therefore may be serialized to a file in",
" * clear-text, care must taken by the user to prevent security breaches.",
" * Derby-406 fix",
" * ",
" * @serial",
" */"
],
"header": "@@ -372,17 +416,22 @@ public class BasicClientDataSource40",
"removed": [
" // This property can be overwritten by specifing the",
" // username parameter on the DataSource.getConnection() method",
" // call. If user is specified, then password must also be",
" // specified, either in the data source object or provided on",
" // the DataSource.getConnection() call.",
" //",
" // Each data source implementation subclass will maintain it's own",
" // <code>password</code> property. This password property may or may not",
" // be declared transient, and therefore may be serialized to a file in",
" // clear-text, care must taken by the user to prevent security breaches.",
" // Derby-406 fix"
]
},
{
"added": [
" /**",
" * Security Mechanism can be specified explicitly either when obtaining a",
" * connection via a DriverManager or via Datasource.",
" * Via DriverManager, securityMechanism can be set on the connection",
" * request using the 'securityMechanism' attribute.",
" * Via DataSource, securityMechanism can be set by calling",
" * setSecurityMechanism() on the ClientDataSource",
" * If the security mechanism is not explicitly set as mentioned above, in",
" * that case the Client will try to upgrade the security mechanism to a",
" * more secure one, if possible.",
" * See {@link #getUpgradedSecurityMechanism}.",
" * Therefore, need to keep track if the securityMechanism has been",
" * explicitly set.",
" *",
" * @serial",
" */",
" "
],
"header": "@@ -424,23 +473,28 @@ public class BasicClientDataSource40",
"removed": [
" // Security Mechanism can be specified explicitly either when obtaining a",
" // connection via a DriverManager or via Datasource.",
" // Via DriverManager, securityMechanism can be set on the connection",
" // request using the 'securityMechanism' attribute.",
" // Via DataSource, securityMechanism can be set by calling",
" // setSecurityMechanism() on the ClientDataSource",
" // If the security mechanism is not explicitly set as mentioned above, in",
" // that case the Client will try to upgrade the security mechanism to a",
" // more secure one, if possible.",
" // @see #getUpgradedSecurityMechanism",
" // Therefore, need to keep track if the securityMechanism has been",
" // explicitly set"
]
},
{
"added": [
"",
" /**",
" * @serial",
" */"
],
"header": "@@ -526,7 +580,10 @@ public class BasicClientDataSource40",
"removed": [
" //"
]
},
{
"added": [
"",
" /**",
" * @serial",
" */"
],
"header": "@@ -537,7 +594,10 @@ public class BasicClientDataSource40",
"removed": [
" //"
]
},
{
"added": [
"",
" /**",
" * @serial",
" */"
],
"header": "@@ -547,7 +607,10 @@ public class BasicClientDataSource40",
"removed": [
" //"
]
},
{
"added": [
"",
" /**",
" * @serial",
" */"
],
"header": "@@ -598,7 +661,10 @@ public class BasicClientDataSource40",
"removed": [
" //"
]
},
{
"added": [
" /**",
" * @serial",
" */"
],
"header": "@@ -619,6 +685,9 @@ public class BasicClientDataSource40",
"removed": []
},
{
"added": [
" // -- Standard JDBC DataSource Properties"
],
"header": "@@ -868,7 +937,7 @@ public class BasicClientDataSource40",
"removed": [
" // -- Stardard JDBC DataSource Properties"
]
},
{
"added": [
" /**",
" * @serial",
" */"
],
"header": "@@ -973,6 +1042,9 @@ public class BasicClientDataSource40",
"removed": []
},
{
"added": [
" * @serial",
" * @serial"
],
"header": "@@ -1011,11 +1083,13 @@ public class BasicClientDataSource40",
"removed": []
},
{
"added": [
" /**",
" * @serial",
" */"
],
"header": "@@ -1072,6 +1146,9 @@ public class BasicClientDataSource40",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/BasicEmbeddedDataSource40.java",
"hunks": [
{
"added": [
" * <p/>",
" * The standard attributes provided are, cf. e.g. table",
" * 9.1 in the JDBC 4.2 specification.",
" * <ul>",
" * <li>databaseName</li>",
" * <li>dataSourceName</li>",
" * <li>description</li>",
" * <li>password</li>",
" * <li>user</li>",
" * </ul>",
" * These standard attributes are not supported:",
" * <ul>",
" * <li>networkProtocol</li>",
" * <li>portNumber</li>",
" * <li>roleName</li>",
" * <li>serverName</li>",
" * </ul>",
" * The embedded Derby driver also supports these attributes:",
" * <ul>",
" * <li>loginTimeout</li> @see javax.sql.CommonDataSource set/get",
" * <li>logWriter</li> @see javax.sql.CommonDataSource set/get",
" * <li>createDatabase</li>",
" * <li>connectionAttributes</li>",
" * <li>shutdownDatabase</li>",
" * <li>attributesAsPassword</li>",
" * </ul>",
" * <br>",
" * See the specific Derby DataSource implementation for details on their",
" * meaning.",
" * <p/>",
" * See also the JDBC specifications for more details."
],
"header": "@@ -48,6 +48,37 @@ import org.apache.derby.impl.jdbc.Util;",
"removed": []
},
{
"added": [
" /**",
" * Set by {@link #setDescription(java.lang.String)}.",
" * @serial",
" */",
"",
" /**",
" * Set by {@link #setDataSourceName(java.lang.String)}.",
" * @serial",
" */",
"",
" /**",
" * Set by {@link #setDatabaseName(java.lang.String)}.",
" * @serial",
" */",
"",
" * Derby specific connection attributes. Set by",
" * {@link #setConnectionAttributes(java.lang.String)}.",
" * See {@link #setCreateDatabase(java.lang.String)}.",
" * Set to \"shutdown\" if the database should be shutdown. See {@link",
" * #setShutdownDatabase(java.lang.String)}.",
" * @serial",
" /**",
" * {@code shortDatabaseName} has attributes of {@code databaseName}",
" * stripped off. See {@link #databaseName}.",
" * @serial",
" */",
" /**",
" * Set by {@link #setPassword(java.lang.String)}.",
" * @serial",
" */",
"",
" /**",
" * Set by {@link #setUser(java.lang.String)}.",
" * @serial",
" */",
"",
" /**",
" * Set by {@link #setLoginTimeout(int)}.",
" * @serial",
" */",
" /**",
" * Instance variable that will not be serialized.",
" */",
"",
" /**",
" * Instance variable that will not be serialized.",
" */",
" /**",
" * Unlike a DataSource, the internal driver is shared by all",
" * Derby databases in the same JVM.",
" */",
" /**",
" * Constructs a basic embedded data source. See the class Javadoc.",
" */"
],
"header": "@@ -58,47 +89,95 @@ public class BasicEmbeddedDataSource40",
"removed": [
" * Derby specific connection attributes.",
" * Set to \"shutdown\" if the database should be shutdown.",
" // shortDatabaseName has attributes of databaseName stripped off",
" // instance variables that will not be serialized",
" // Unlike a DataSource, LocalDriver is shared by all",
" // Derby databases in the same jvm."
]
},
{
"added": [
" /**",
" * Return database name with ant attributes stripped off.",
" */"
],
"header": "@@ -137,9 +216,9 @@ public class BasicEmbeddedDataSource40",
"removed": [
" //",
" // Return database name with ant attributes stripped off.",
" //"
]
},
{
"added": [
"",
" /**",
" * Update {@link #jdbcurl} from attributes set.",
" */"
],
"header": "@@ -303,6 +382,10 @@ public class BasicEmbeddedDataSource40",
"removed": []
},
{
"added": [
" /**",
" * Return a handle to the internal driver, possibly instantiating it first",
" * if it hasn't been booted or if it has been shut down.",
" *",
" * @return The internal driver handle",
" * @throws SQLException",
" */"
],
"header": "@@ -375,6 +458,13 @@ public class BasicEmbeddedDataSource40",
"removed": []
},
{
"added": [
" // Most of our customers would be using JNDI to get the data",
" // sources. Since we don't have a JNDI in the test setup to test this, we",
" // are adding this method to fake it. This is getting used in XAJNDITest",
" // so we can compare the two data sources.",
" public boolean equals(Object other) {",
" if (other instanceof EmbeddedDataSource) {",
" EmbeddedDataSource ds = (EmbeddedDataSource)other;"
],
"header": "@@ -494,15 +584,15 @@ public class BasicEmbeddedDataSource40",
"removed": [
" // Most of our customers would be using JNDI to get the data",
" // sources. Since we don't have a jndi in the test setup to test this, we",
" // are adding this method to fake it. This is getting used in XAJNDITest",
" // so we can compare the two data sources.",
" public boolean equals(Object p0) {",
" if (p0 instanceof EmbeddedDataSource) {",
" EmbeddedDataSource ds = (EmbeddedDataSource)p0;"
]
},
{
"added": [
" // We don't really need this in the tests",
" // (see equals), but unsafe not to",
" // define hashCode if we define equals."
],
"header": "@@ -564,6 +654,9 @@ public class BasicEmbeddedDataSource40",
"removed": []
},
{
"added": [
" /**",
" * Get a user connection: minion method.",
" *",
" * @param username the user name",
" * @param password the password",
" * @param requestPassword {@code true} if the password came from the",
" * getConnection() call with user and password arguments..",
" * @return user connection",
" * @throws SQLException",
" */"
],
"header": "@@ -627,8 +720,16 @@ public class BasicEmbeddedDataSource40",
"removed": [
" // requestPassword Use {@code true} if the password came from the",
" // getConnection() call."
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/BasicEmbeddedXADataSource40.java",
"hunks": [
{
"added": [
" /**",
" * link to the database",
" */",
" /**",
" * Constructs a basic embedded XA data source. See the class Javadoc.",
" */"
],
"header": "@@ -45,9 +45,14 @@ public class BasicEmbeddedXADataSource40",
"removed": [
" // link to the database"
]
},
{
"added": [
" /**",
" * {@inheritDoc}",
" * <p/>",
" * Also clears {@link ra}.",
" */"
],
"header": "@@ -77,7 +82,11 @@ public class BasicEmbeddedXADataSource40",
"removed": [
" // implementation methods"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/EmbeddedXADataSource.java",
"hunks": [
{
"added": [
" /**",
" * A cached link to the database, set up with the first connection is",
" * made.",
" */"
],
"header": "@@ -70,7 +70,10 @@ public class EmbeddedXADataSource extends EmbeddedDataSource",
"removed": [
"\t// link to the database"
]
},
{
"added": [
" /**",
" * {@inheritDoc}",
" * <p/>",
" * Also clear the cached value of {@link #ra}.",
" */"
],
"header": "@@ -121,10 +124,11 @@ public class EmbeddedXADataSource extends EmbeddedDataSource",
"removed": [
"\t/*",
"\t * private method",
"\t */",
""
]
},
{
"added": [
" /**",
" * Instantiate and return an EmbedXAConnection from this instance",
" * of EmbeddedXADataSource.",
" * @param ra The resource adapter to the database",
" * @param user The user name",
" * @param password The password",
" * @param requestPassword @{@code false} if original call is from a",
" * no-argument constructor, otherwise {@code true}",
" * @return An XA connection to the database",
" * @throws java.sql.SQLException",
" */"
],
"header": "@@ -132,9 +136,17 @@ public class EmbeddedXADataSource extends EmbeddedDataSource",
"removed": [
" //",
" // Instantiate and return an EmbedXAConnection from this instance",
" // of EmbeddedXADataSource."
]
},
{
"added": [
" * @return The cached {@code ResourceAdapter} instance for the underlying",
" * database"
],
"header": "@@ -172,9 +184,8 @@ public class EmbeddedXADataSource extends EmbeddedDataSource",
"removed": [
" *",
" * @return The ResourceAdapter instance for",
" * the underlying database"
]
}
]
}
] |
derby-DERBY-6553-c077ea00
|
DERBY-6553: Adding test cases to verify that we can create trigger-invoking sequences: commit derby-6553-01-aa-verifyFix.diff.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1595977 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-6554-7953b49b
|
DERBY-6554: Fix some bugs in cache management for sequence generators; commit derby-6554-01-ad-bugfixes.diff.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1591703 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/sql/catalog/SequenceUpdater.java",
"hunks": [
{
"added": [
"import java.util.HashMap;",
""
],
"header": "@@ -20,6 +20,8 @@",
"removed": []
},
{
"added": [
" //",
" // The following state needs to be reset whenever this Cachable is re-used.",
" //",
" ",
" /** This is the key used to lookup this generator in the cache. */",
" /** This is the object which allocates ranges of sequence values */"
],
"header": "@@ -104,10 +106,14 @@ public abstract class SequenceUpdater implements Cacheable",
"removed": [
" // This is the key used to lookup this generator in the cache.",
" // This is the object which allocates ranges of sequence values"
]
},
{
"added": [
" // The call to updateCurrentValueOnDisk can fail if someone is holding a lock",
" // on the SYS.SYSSEQUENCES row. This can happen if the user disregards our",
" // advice and scans that catalog. This can also happen if the transaction which",
" // creates the sequences is open for a long time and some later sequence creation",
" // causes us to evict the old, uncommitted sequence generator from the cache.",
" boolean gapClosed = false;",
" try {",
" if ( _sequenceGenerator == null ) { gapClosed = true; }",
" else",
" {",
" gapClosed = updateCurrentValueOnDisk( null, peekAtCurrentValue() );",
" }",
" }",
" catch (StandardException se)",
" {",
" // The too much contention exception is redundant because the problem is logged",
" // by the message below",
" if ( !SQLState.LANG_TOO_MUCH_CONTENTION_ON_SEQUENCE.equals( se.getMessageId() ) )",
" {",
" throw se;",
" }",
" }",
" finally",
" {"
],
"header": "@@ -187,11 +193,32 @@ public abstract class SequenceUpdater implements Cacheable",
"removed": [
" if ( _sequenceGenerator != null )",
" {",
" boolean gapClosed = updateCurrentValueOnDisk( null, peekAtCurrentValue() );"
]
},
{
"added": [
" _uuidString = null;",
" _sequenceGenerator = null;",
" }"
],
"header": "@@ -204,10 +231,10 @@ public abstract class SequenceUpdater implements Cacheable",
"removed": [
" }",
" _uuidString = null;",
" _sequenceGenerator = null;"
]
},
{
"added": [
" boolean retval = false;",
" ",
" retval = updateCurrentValueOnDisk( nestedTransaction, oldValue, newValue, false );"
],
"header": "@@ -421,9 +448,11 @@ public abstract class SequenceUpdater implements Cacheable",
"removed": [
" return updateCurrentValueOnDisk( nestedTransaction, oldValue, newValue, false );"
]
}
]
}
] |
derby-DERBY-6554-9819cf8e
|
DERBY-6554: Raise SelfDeadlock when a nested subtransaction can't immediately get a lock because it is blocked by its parent transaction; commit derby-6554-02-ae-selfDeadlock_sps_compress.diff.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1593702 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/iapi/store/raw/RawStoreFactory.java",
"hunks": [
{
"added": [
" @param parentTransaction parent transaction"
],
"header": "@@ -660,6 +660,7 @@ public interface RawStoreFactory extends Corruptable {",
"removed": []
},
{
"added": [
" Transaction parentTransaction,"
],
"header": "@@ -674,6 +675,7 @@ public interface RawStoreFactory extends Corruptable {",
"removed": []
},
{
"added": [
" @param parentTransaction parent transaction"
],
"header": "@@ -720,6 +722,7 @@ public interface RawStoreFactory extends Corruptable {",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/store/raw/xact/TransactionFactory.java",
"hunks": [
{
"added": [
"\t\t@param rsf the RawStoreFactory",
"\t\t@param parentTransaction the parent transaction"
],
"header": "@@ -95,6 +95,8 @@ public interface TransactionFactory extends Corruptable {",
"removed": []
},
{
"added": [
" RawTransaction parentTransaction,"
],
"header": "@@ -107,6 +109,7 @@ public interface TransactionFactory extends Corruptable {",
"removed": []
},
{
"added": [
"\t\t@param rsf the RawStoreFactory",
"\t\t@param parentTransaction the parent transaction"
],
"header": "@@ -117,6 +120,8 @@ public interface TransactionFactory extends Corruptable {",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/services/locks/ConcurrentLockSet.java",
"hunks": [
{
"added": [
" boolean blockedByParent = false;"
],
"header": "@@ -319,6 +319,7 @@ final class ConcurrentLockSet implements LockTable {",
"removed": []
},
{
"added": [
" //",
" // This logic supports the use-case of DERBY-6554.",
" //",
" blockedByParent =",
" (timeout == 0) &&",
" compatibilitySpace.getOwner().isNestedOwner() &&",
" control.blockedByParent( lockItem );",
"",
"\t\t\tif (",
" AbstractPool.noLockWait(timeout, compatibilitySpace) ||",
" blockedByParent",
" )",
" {",
" if (SanityManager.DEBUG) "
],
"header": "@@ -355,12 +356,23 @@ final class ConcurrentLockSet implements LockTable {",
"removed": [
"\t\t\tif (AbstractPool.noLockWait(timeout, compatibilitySpace)) {",
"",
" if (SanityManager.DEBUG) "
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/services/locks/LockControl.java",
"hunks": [
{
"added": [
"import org.apache.derby.iapi.services.locks.LockOwner;"
],
"header": "@@ -24,6 +24,7 @@ package org.apache.derby.impl.services.locks;",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/catalog/SequenceUpdater.java",
"hunks": [
{
"added": [
" boolean escalateToParentTransaction = false;"
],
"header": "@@ -449,6 +449,7 @@ public abstract class SequenceUpdater implements Cacheable",
"removed": []
},
{
"added": [
" if ( !se.isLockTimeout() )",
" {",
" if ( se.isSelfDeadlock() )",
" {",
" // We're blocked by a lock held by our parent transaction.",
" // Escalate into the parent transaction now. See DERBY-6554.",
" escalateToParentTransaction = true;",
" }",
" else",
" {",
" Monitor.logThrowable( se );",
" throw se;",
" }",
" }"
],
"header": "@@ -456,7 +457,20 @@ public abstract class SequenceUpdater implements Cacheable",
"removed": [
" if ( !se.isLockTimeout() ) { throw se; }"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/store/access/RAMTransaction.java",
"hunks": [
{
"added": [
" findExistingConglomerate(conglomId).purgeConglomerate",
" ( this, rawtran );"
],
"header": "@@ -1431,9 +1431,8 @@ public class RAMTransaction",
"removed": [
" findExistingConglomerate(conglomId).purgeConglomerate(",
" this, ",
" rawtran);"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/store/raw/xact/Xact.java",
"hunks": [
{
"added": [
" // id of parent transaction if this is a nested user transaction",
" private volatile TransactionId parentTransactionId;",
""
],
"header": "@@ -179,6 +179,9 @@ public class Xact extends RawTransaction implements Limit, LockOwner {",
"removed": []
},
{
"added": [
" protected Xact(",
" Xact parentTransaction, "
],
"header": "@@ -272,8 +275,9 @@ public class Xact extends RawTransaction implements Limit, LockOwner {",
"removed": [
"\tprotected Xact("
]
},
{
"added": [
" if ( parentTransaction != null )",
" {",
" parentTransactionId = parentTransaction.getId();",
" }"
],
"header": "@@ -285,6 +289,10 @@ public class Xact extends RawTransaction implements Limit, LockOwner {",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/store/raw/xact/XactFactory.java",
"hunks": [
{
"added": [
" * @param parentTransaction parent transaction (if this is a nested user transaction)"
],
"header": "@@ -253,6 +253,7 @@ public class XactFactory implements TransactionFactory, ModuleControl, ModuleSup",
"removed": []
},
{
"added": [
" Xact parentTransaction, "
],
"header": "@@ -262,6 +263,7 @@ public class XactFactory implements TransactionFactory, ModuleControl, ModuleSup",
"removed": []
},
{
"added": [
" this, parentTransaction, logFactory, dataFactory, dataValueFactory, "
],
"header": "@@ -284,7 +286,7 @@ public class XactFactory implements TransactionFactory, ModuleControl, ModuleSup",
"removed": [
" this, logFactory, dataFactory, dataValueFactory, "
]
},
{
"added": [
" null, "
],
"header": "@@ -304,6 +306,7 @@ public class XactFactory implements TransactionFactory, ModuleControl, ModuleSup",
"removed": []
},
{
"added": [
" RawTransaction parentTransaction,"
],
"header": "@@ -315,6 +318,7 @@ public class XactFactory implements TransactionFactory, ModuleControl, ModuleSup",
"removed": []
},
{
"added": [
" (Xact) parentTransaction, "
],
"header": "@@ -323,6 +327,7 @@ public class XactFactory implements TransactionFactory, ModuleControl, ModuleSup",
"removed": []
},
{
"added": [
" RawTransaction parentTransaction,"
],
"header": "@@ -335,6 +340,7 @@ public class XactFactory implements TransactionFactory, ModuleControl, ModuleSup",
"removed": []
},
{
"added": [
" (Xact) parentTransaction, "
],
"header": "@@ -343,6 +349,7 @@ public class XactFactory implements TransactionFactory, ModuleControl, ModuleSup",
"removed": []
},
{
"added": [
" null, "
],
"header": "@@ -373,6 +380,7 @@ public class XactFactory implements TransactionFactory, ModuleControl, ModuleSup",
"removed": []
}
]
}
] |
derby-DERBY-6559-9179199d
|
DERBY-6559 A immediate Fk constraint blows up iff its referenced PK is deferred and we delete a duplicate
Patch derby-6559 changes ReferencedKeyRIChecker to omit checking
dependent tables iff the referenced key is deferred and has rows with
duplicate keys one of whom is attempted deleted. So, in effect, the
check in such a case happens only if the row is "the last of its
kind", i.e. the last row having a particular referenced key. Added
tests for this behavior. To determine whether we have duplicates, we
open an extra scan on the index.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1593557 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/sql/compile/DMLModStatementNode.java",
"hunks": [
{
"added": [],
"header": "@@ -33,7 +33,6 @@ import org.apache.derby.iapi.services.classfile.VMOpcode;",
"removed": [
"import org.apache.derby.shared.common.sanity.SanityManager;"
]
},
{
"added": [
"import org.apache.derby.iapi.sql.dictionary.TriggerDescriptorList;",
"import org.apache.derby.shared.common.sanity.SanityManager;"
],
"header": "@@ -50,16 +49,17 @@ import org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor;",
"removed": [
"import org.apache.derby.iapi.sql.dictionary.TriggerDescriptorList;"
]
},
{
"added": [
" final TableDescriptor pktd = refcd.getTableDescriptor();",
" final UUID pkIndexId = refcd.getIndexId();",
" final ConglomerateDescriptor pkIndexConglom =",
" pktd.getConglomerateDescriptor(pkIndexId);",
" final TableDescriptor refTd = cd.getTableDescriptor();"
],
"header": "@@ -1011,11 +1011,12 @@ abstract class DMLModStatementNode extends DMLStatementNode",
"removed": [
"\t\t\tTableDescriptor\tpktd = refcd.getTableDescriptor();",
"\t\t\tUUID pkuuid = refcd.getIndexId();",
"\t\t\tConglomerateDescriptor pkIndexConglom = pktd.getConglomerateDescriptor(pkuuid);",
"\t\t\tTableDescriptor refTd = cd.getTableDescriptor();"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/execute/FKInfo.java",
"hunks": [
{
"added": [
" boolean refConstraintIsDeferrable;"
],
"header": "@@ -72,6 +72,7 @@ public class FKInfo implements Formatable",
"removed": []
},
{
"added": [
" * @param refUUID UUID of the referenced constraint's supporting index",
" * @param refConstraintIsDeferrable {@code true} iff the referenced key",
" * constraint is deferrable"
],
"header": "@@ -99,8 +100,10 @@ public class FKInfo implements Formatable",
"removed": [
"\t * @param refUUID UUID of the referenced constraint"
]
},
{
"added": [
" * @param fkIds the foreign key constraints' uuids."
],
"header": "@@ -117,6 +120,7 @@ public class FKInfo implements Formatable",
"removed": []
},
{
"added": [
" boolean refConstraintIsDeferrable,"
],
"header": "@@ -126,6 +130,7 @@ public class FKInfo implements Formatable",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/execute/ReferencedKeyRIChecker.java",
"hunks": [
{
"added": [
"import org.apache.derby.iapi.services.io.FormatableBitSet;",
"import org.apache.derby.iapi.types.DataValueDescriptor;"
],
"header": "@@ -24,14 +24,15 @@ package org.apache.derby.impl.sql.execute;",
"removed": [
"import org.apache.derby.iapi.sql.execute.ExecIndexRow;"
]
},
{
"added": [
" private ScanController refKeyIndexScan = null;",
" private DataValueDescriptor[] refKey = new DataValueDescriptor[numColumns];",
""
],
"header": "@@ -44,6 +45,9 @@ import org.apache.derby.shared.common.sanity.SanityManager;",
"removed": []
},
{
"added": [
" @Override"
],
"header": "@@ -81,6 +85,7 @@ public class ReferencedKeyRIChecker extends GenericRIChecker",
"removed": []
},
{
"added": [
" if (fkInfo.refConstraintIsDeferrable) {",
" // We may have more than one row if the referenced constraint is",
" // deferred, if so, all is good: no foreign key constraints can be",
" // violated. DERBY-6559",
" if (lcc.isEffectivelyDeferred(",
" lcc.getCurrentSQLSessionContext(a),",
" fkInfo.refConglomNumber)) {",
" // It *is* deferred, go see if we have more than one row",
" if (isDuplicated(row)) {",
" return;",
" }",
" }",
" }",
""
],
"header": "@@ -94,6 +99,20 @@ public class ReferencedKeyRIChecker extends GenericRIChecker",
"removed": []
}
]
}
] |
derby-DERBY-656-381dfaf5
|
DERBY-656 Use the size estimates from the catalog to avoid security
issues in BackingStoreHashtable. This matches the other uses of the
class size utilities, eg. for the DataValueDescriptors.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@330133 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/iapi/store/access/BackingStoreHashtable.java",
"hunks": [
{
"added": [
" /**",
" * The estimated number of bytes used by Vector(0)",
" */ ",
" private final static int vectorSize = ClassSize.estimateBaseFromCatalog(java.util.Vector.class);"
],
"header": "@@ -121,17 +121,10 @@ public class BackingStoreHashtable",
"removed": [
" private static int vectorSize; // The estimated number of bytes used by Vector(0)",
" static {",
" try",
" {",
" vectorSize = ClassSize.estimateBase( java.util.Vector.class);",
" }",
" catch( SecurityException se)",
" {",
" vectorSize = 4*ClassSize.refSize;",
" }",
" };"
]
}
]
}
] |
derby-DERBY-6563-f2735816
|
DERBY-6563: NOT elimination for CASE expressions is broken
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1592945 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-6565-591ff9f9
|
DERBY-6565 ROW_NUMBER function throws NullPointerException in UPDATE statement
Patch *derby-6565-forbid.diff* which makes it illegal to use window
functions in the update source. Adds a new test for this error
condition. Also cleans up some Javadocs and modernizes some loops.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1615982 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java",
"hunks": [
{
"added": [],
"header": "@@ -35,13 +35,11 @@ import org.apache.derby.iapi.services.classfile.VMOpcode;",
"removed": [
"import org.apache.derby.shared.common.sanity.SanityManager;",
"import org.apache.derby.iapi.sql.dictionary.AliasDescriptor;"
]
},
{
"added": [
"import org.apache.derby.iapi.sql.dictionary.TriggerDescriptorList;",
"import org.apache.derby.shared.common.sanity.SanityManager;"
],
"header": "@@ -49,16 +47,16 @@ import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;",
"removed": [
"import org.apache.derby.iapi.sql.dictionary.TriggerDescriptorList;",
"import org.apache.derby.iapi.types.DataTypeDescriptor;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/WindowResultSetNode.java",
"hunks": [
{
"added": [
"import java.util.Iterator;"
],
"header": "@@ -21,6 +21,7 @@",
"removed": []
},
{
"added": [
" @SuppressWarnings(\"LeakingThisInConstructor\")"
],
"header": "@@ -58,6 +59,7 @@ class WindowResultSetNode extends SingleChildResultSetNode",
"removed": []
},
{
"added": [
" // Wrap ourselves in a project/restrict as per convention."
],
"header": "@@ -82,7 +84,7 @@ class WindowResultSetNode extends SingleChildResultSetNode",
"removed": [
" // Wrao purselved int a project/restrict as per convention."
]
},
{
"added": [
" * @throws StandardException standard error policy"
],
"header": "@@ -92,7 +94,7 @@ class WindowResultSetNode extends SingleChildResultSetNode",
"removed": [
" * @exception standard exception"
]
},
{
"added": [
" for (ValueNode crOrVcn : uniqueCols) {"
],
"header": "@@ -167,9 +169,7 @@ class WindowResultSetNode extends SingleChildResultSetNode",
"removed": [
" for (int i= 0; i< uniqueCols.size(); i++) {",
" ValueNode crOrVcn = uniqueCols.get(i);",
""
]
},
{
"added": [
" * @param uniqueColRefs list of unique column references",
" * @param cand the candidate to check is present in list",
" * @throws StandardException standard error policy",
" for (ValueNode uniqueColRef : uniqueColRefs) {",
" ColumnReference cr = (ColumnReference) uniqueColRef;"
],
"header": "@@ -209,15 +209,18 @@ class WindowResultSetNode extends SingleChildResultSetNode",
"removed": [
" for (int i= 0; i< uniqueColRefs.size(); i++) {",
" ColumnReference cr = (ColumnReference)uniqueColRefs.get(i);"
]
},
{
"added": [
" *",
" * @throws StandardException standard error policy"
],
"header": "@@ -229,6 +232,8 @@ class WindowResultSetNode extends SingleChildResultSetNode",
"removed": []
},
{
"added": [
" for (WindowFunctionNode winFunc : windowFuncCalls) {"
],
"header": "@@ -246,8 +251,7 @@ class WindowResultSetNode extends SingleChildResultSetNode",
"removed": [
" for (int i=0; i < windowFuncCalls.size(); i++) {",
" WindowFunctionNode winFunc = windowFuncCalls.get(i);"
]
}
]
}
] |
derby-DERBY-6567-d6b5ab35
|
DERBY-6567: Incorrect nullability for CASE expression with parameter
Make sure the result of a CASE expression is nullable if (and only if)
at least one of the result expressions is nullable.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1593495 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-6569-1f1b46b1
|
DERBY-6569: NULLIF may return incorrect results if first operand calls non-deterministic function
Make sure the left operand of the NULLIF expression is only evaluated
once, so that it does not matter if it is non-deterministic.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1625520 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-6576-72446ed8
|
DERBY-6576 A immediate Fk constraint blows up iff its referenced PK is deferred and we modify a duplicate key column
A follow-up patch, derby-6576-repeatable-read. In the case where we do
not throw an exception because the deferred unique/pk constraint
referenced by an fk is upheld by another row, we need to make sure
that condition holds until we commit. This patch changes the check (in
ReferencedKeyRIChecker#isDuplicated) to scan using repeatable read
isolation level instead of read committed. This will set a read lock
on any (well, the first we find) duplicate row till transaction end
and thus ensure things are good till we commit.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1600779 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/sql/execute/ReferencedKeyRIChecker.java",
"hunks": [
{
"added": [
"",
" // Use repeatable read here, since we rely on the row being",
" // present till we commit if we accept this row as being",
" // the one the upholds the constraint when we delete ours.",
" TransactionController.ISOLATION_REPEATABLE_READ,",
"",
" key, // startKeyValue",
" key, // stopKeyValue",
" key, // startKeyValue",
" ScanController.GE, // startSearchOp",
" null, // qualifier",
" key, // stopKeyValue",
" ScanController.GT); // stopSearchOp"
],
"header": "@@ -340,20 +340,25 @@ public class ReferencedKeyRIChecker extends GenericRIChecker",
"removed": [
" TransactionController.ISOLATION_READ_COMMITTED_NOHOLDLOCK,",
" key, // startKeyValue",
" key, // stopKeyValue",
" key, // startKeyValue",
" ScanController.GE, // startSearchOp",
" null, // qualifier",
" key, // stopKeyValue",
" ScanController.GT); // stopSearchOp"
]
}
]
}
] |
derby-DERBY-6577-39e20ff2
|
DERBY-6577: Quantified comparison returns wrong result in CASE, COALESCE, IN and BETWEEN
ValueNodeList.preprocess() should update the list with the rewritten expressions.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1594816 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-658-1edcdb31
|
DERBY-658: Improve the test harness' ability to run on platforms with non-ASCII
native encoding.
Committed for Myrna Van Lunteren <m.v.lunteren@gmail.com>
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@394770 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/tools/org/apache/derby/iapi/tools/i18n/LocalizedResource.java",
"hunks": [
{
"added": [
""
],
"header": "@@ -212,6 +212,7 @@ public final class LocalizedResource implements java.security.PrivilegedAction",
"removed": []
}
]
},
{
"file": "java/tools/org/apache/derby/impl/tools/ij/utilMain.java",
"hunks": [
{
"added": [
" new StatementFinder(langUtil.getNewEncodedInput(new BufferedInputStream(is, BUFFEREDFILESIZE), \"UTF8\"));"
],
"header": "@@ -541,7 +541,7 @@ public class utilMain implements java.security.PrivilegedAction {",
"removed": [
" new StatementFinder(langUtil.getNewInput(new BufferedInputStream(is, BUFFEREDFILESIZE)));"
]
}
]
}
] |
derby-DERBY-658-93e65c71
|
DERBY-658: Update README.htm for testing, fix TestProto and multi tests to run on non-ASCII systems.
Committed for Myrna Van Lunteren <m.v.lunteren@gmail.com>
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@395486 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/drda/org/apache/derby/impl/drda/TestProto.java",
"hunks": [
{
"added": [
"import java.io.BufferedReader;",
"import java.io.FileInputStream;",
"import java.io.FileNotFoundException;",
"import java.io.InputStreamReader;",
"import java.io.UnsupportedEncodingException;",
"import java.util.Hashtable;",
"import java.util.Vector;"
],
"header": "@@ -20,21 +20,21 @@",
"removed": [
"import java.io.DataOutputStream;",
"import java.io.ByteArrayOutputStream;",
"import java.io.FileReader;",
"import java.util.Hashtable;",
"import java.util.Vector;",
"import java.io.UnsupportedEncodingException;",
"import java.io.FileNotFoundException;"
]
}
]
},
{
"file": "java/testing/org/apache/derbyTesting/functionTests/harness/CopySuppFiles.java",
"hunks": [
{
"added": [
"\t\t if ((fileName.indexOf(\"sql\") > 0) || (fileName.indexOf(\"txt\") > 0) || (fileName.indexOf(\".view\") > 0) || (fileName.indexOf(\".policy\") > 0) || (fileName.indexOf(\".multi\") > 0) || (fileName.indexOf(\".properties\") > 0))"
],
"header": "@@ -68,7 +68,7 @@ public class CopySuppFiles",
"removed": [
"\t\t if ((fileName.indexOf(\"sql\") > 0) || (fileName.indexOf(\"txt\") > 0) || (fileName.indexOf(\".view\") > 0) || (fileName.indexOf(\".policy\") > 0))"
]
}
]
}
] |
derby-DERBY-6587-7d2377d6
|
DERBY-6587; Foreign Key constraint not matched when using UUID in a composite foreign key when using SYSCS_UTIL.SYSCS_IMPORT_TABLE
Adding a test for this issue
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1600788 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-6590-844595b2
|
DERBY-6590 Make JUnit tests run the fixtures in a deterministic order.
Javadoc fix.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1608810 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/testing/org/apache/derbyTesting/junit/BaseTestSuite.java",
"hunks": [
{
"added": [
" * Derby replacement for {@code junit.framework.TestSuite}. This version, when",
" * provided with a {@code Class} argument in a constructor or method,",
" * constructs a {@code TestSuite} with a lexicographically sorted set of",
" * fixtures (i.e. test cases) to avoid random fixture ordering (after Java",
" * 6). Its usage is similar to the original JUnit {@code TestSuite} class."
],
"header": "@@ -30,11 +30,11 @@ import junit.framework.TestCase;",
"removed": [
" * Derby replacement for TestSuite. This version, when provided with a",
" * {@code Class} argument in a constructor or method, constructs a",
" * {@code TestSuite} with a lexicographically sorted set of fixtures (i.e. test",
" * cases) to avoid random fixture ordering (after Java 6). Its usage is similar",
" * to the original JUnit TestSuite class."
]
}
]
}
] |
derby-DERBY-6596-4f7c1430
|
DERBY-6596: Forbid null args to lucene support routines; derby-6596-01-aa-checkNotNull.diff.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1601465 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/optional/org/apache/derby/optional/lucene/LuceneSupport.java",
"hunks": [
{
"added": [
" vetIdentifiers( schema, table, textcol );",
""
],
"header": "@@ -367,6 +367,8 @@ public class LuceneSupport implements OptionalTool",
"removed": []
},
{
"added": [
" vetIdentifiers( schema, table, textcol );",
""
],
"header": "@@ -410,6 +412,8 @@ public class LuceneSupport implements OptionalTool",
"removed": []
},
{
"added": [
" /** Verify that the schema, table, and column names aren't null */",
"\tprivate static void vetIdentifiers",
" (",
" String schema,",
" String table,",
" String textcol",
" )",
" throws SQLException",
" {",
" checkNotNull( \"SCHEMANAME\", schema );",
" checkNotNull( \"TABLENAME\", table );",
" checkNotNull( \"TEXTCOLUMN\", textcol );",
" }",
" "
],
"header": "@@ -570,6 +574,20 @@ public class LuceneSupport implements OptionalTool",
"removed": []
},
{
"added": [
" vetIdentifiers( schema, table, textcol );",
""
],
"header": "@@ -590,6 +608,8 @@ public class LuceneSupport implements OptionalTool",
"removed": []
},
{
"added": [
" /** Raise an error if an argument is being given a null value */",
" static void checkNotNull( String argumentName, String argumentValue )",
" throws SQLException",
" {",
" if ( argumentValue == null )",
" {",
" throw newSQLException( SQLState.ARGUMENT_MAY_NOT_BE_NULL, argumentName );",
" }",
" }",
""
],
"header": "@@ -1356,6 +1376,16 @@ public class LuceneSupport implements OptionalTool",
"removed": []
}
]
}
] |
derby-DERBY-6600-515a63e8
|
DERBY-6600: Make it possible to bind functions to methods in the org.apache.derby.optional.api package; tests passed cleanly on derby-6600-02-aa-addAPIpackage.diff.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1600928 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-6600-a4094369
|
DERBY-6600: Make Derby resolve custom Lucene Analyzers and QueryParsers by using the database classpath.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1600866 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/optional/org/apache/derby/optional/lucene/LuceneQueryVTI.java",
"hunks": [
{
"added": [
"import org.apache.derby.iapi.services.loader.ClassInspector;"
],
"header": "@@ -34,6 +34,7 @@ import java.sql.Time;",
"removed": []
},
{
"added": [
" throws PrivilegedActionException, SQLException",
" throws ClassNotFoundException, IllegalAccessException,",
" InvocationTargetException, NoSuchMethodException,",
" SQLException",
" String className = queryParserMaker.substring( 0, lastDotIdx );",
" ClassInspector ci = LuceneSupport.getClassFactory().getClassInspector();",
" Class<? extends Object> klass = ci.getClass( className );"
],
"header": "@@ -526,17 +527,21 @@ public class LuceneQueryVTI extends StringColumnVTI",
"removed": [
" throws PrivilegedActionException",
" throws ClassNotFoundException, IllegalAccessException, InvocationTargetException, NoSuchMethodException",
" Class<? extends Object> klass = Class.forName( queryParserMaker.substring( 0, lastDotIdx ) );"
]
}
]
},
{
"file": "java/optional/org/apache/derby/optional/lucene/LuceneSupport.java",
"hunks": [
{
"added": [
"import org.apache.derby.iapi.services.loader.ClassFactory;",
"import org.apache.derby.iapi.services.loader.ClassInspector;"
],
"header": "@@ -52,6 +52,8 @@ import org.apache.derby.iapi.sql.dictionary.OptionalTool;",
"removed": []
},
{
"added": [
" throws PrivilegedActionException, SQLException",
" throws ClassNotFoundException, IllegalAccessException,",
" InvocationTargetException, NoSuchMethodException,",
" SQLException"
],
"header": "@@ -1678,14 +1680,16 @@ public class LuceneSupport implements OptionalTool",
"removed": [
" throws PrivilegedActionException",
" throws ClassNotFoundException, IllegalAccessException, InvocationTargetException, NoSuchMethodException"
]
},
{
"added": [
" NoSuchMethodException, SQLException",
" String className = analyzerMaker.substring( 0, lastDotIdx );",
" ClassInspector ci = getClassFactory().getClassInspector();",
" Class<? extends Object> klass = ci.getClass( className );"
],
"header": "@@ -1699,10 +1703,12 @@ public class LuceneSupport implements OptionalTool",
"removed": [
" NoSuchMethodException",
" Class<? extends Object> klass = Class.forName( analyzerMaker.substring( 0, lastDotIdx ) );"
]
}
]
}
] |
derby-DERBY-6602-abb2084e
|
DERBY-6602: Make the lucene plugin handle null keys; commit derby-6602-01-aa-handleNullKeys.diff.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1601440 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/optional/org/apache/derby/optional/lucene/LuceneQueryVTI.java",
"hunks": [
{
"added": [
"",
" // true if last column read was null",
" private boolean _wasNull;"
],
"header": "@@ -102,6 +102,9 @@ public class LuceneQueryVTI extends StringColumnVTI",
"removed": []
},
{
"added": [
" _wasNull = false;",
" "
],
"header": "@@ -144,6 +147,8 @@ public class LuceneQueryVTI extends StringColumnVTI",
"removed": []
},
{
"added": [
" /** Handle boolean columns */",
" public boolean getBoolean( int columnid ) throws SQLException",
" {",
" String stringValue = getRawColumn( columnid );",
"",
" if ( stringValue == null )",
" {",
" _wasNull = true;",
" return false;",
" }",
" else",
" {",
" return Boolean.valueOf( stringValue );",
" }",
" }",
""
],
"header": "@@ -154,6 +159,22 @@ public class LuceneQueryVTI extends StringColumnVTI",
"removed": []
},
{
"added": [
" _wasNull = false;",
" "
],
"header": "@@ -274,6 +295,8 @@ public class LuceneQueryVTI extends StringColumnVTI",
"removed": []
},
{
"added": [
" if ( field == null )",
" {",
" _wasNull = true;",
" return null;",
" }",
" _wasNull = false;"
],
"header": "@@ -293,9 +316,14 @@ public class LuceneQueryVTI extends StringColumnVTI",
"removed": [
" if ( field == null ) { return null; }"
]
},
{
"added": [
" _wasNull = true;"
],
"header": "@@ -321,6 +349,7 @@ public class LuceneQueryVTI extends StringColumnVTI",
"removed": []
},
{
"added": [
" _wasNull = false;"
],
"header": "@@ -346,6 +375,7 @@ public class LuceneQueryVTI extends StringColumnVTI",
"removed": []
}
]
}
] |
derby-DERBY-6611-11da6184
|
DERBY-6611 Broken link in API docs to derby.drda.keepAlive documentation
Javadoc fixup for this issue: Use textual cross reference instead.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1607135 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/drda/org/apache/derby/mbeans/drda/NetworkServerMBean.java",
"hunks": [
{
"added": [
" * Reports whether or not the Derby Network Server will send keep-alive ",
" * value of the {@code derby.drda.keepAlive} property).</p>",
" * If {@code true}, a keep-alive probe is sent to the client if a \"long ",
" * If {@code false}, Derby will not attempt to clean up connections from",
" * disconnected clients, and will not send keep-alive probes.</p>",
" * <p>",
" * See also the documentation for the property {@code derby.drda.keepAlive}",
" * in the <em>Derby Server and Administration Guide</em>, section",
" * <em>Managing the Derby Network Server</em>, subsection <em>Setting",
" * Network Server Properties</em>, subsubsection <em>derby.drda.keepAlive",
" * property</em>.",
" * </p>",
" * @return {@code true} if Derby Network Server will send keep-alive ",
" * clients ({@code derby.drda.keepAlive})"
],
"header": "@@ -82,26 +82,31 @@ public interface NetworkServerMBean {",
"removed": [
" * Reports whether or not the Derby Network Server will send keepalive ",
" * value of the <code>derby.drda.keepAlive</code> property).</p>",
" * If <code>true</code>, a keepalive probe is sent to the client if a \"long ",
" * If false, Derby will not attempt to clean up connections from",
" * disconnected clients, and will not send keepalive probes.</p>",
" * ",
" * @see <a href=\"http://db.apache.org/derby/docs/dev/adminguide/radmindrdakeepalive.html\"><code>derby.drda.keepAlive</code> documentation</a>",
" * @return whether or not the Derby Network Server will send keepalive ",
" * clients (<code>derby.drda.keepAlive</code>)"
]
}
]
}
] |
derby-DERBY-6615-6a920060
|
DERBY-6615: Remove unused newInstance() method in BaseMonitor
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1603099 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java",
"hunks": [
{
"added": [],
"header": "@@ -772,31 +772,6 @@ abstract class BaseMonitor",
"removed": [
"\t/**",
"\t*/",
"\tprivate Object newInstance(String className) {",
"",
"\t\ttry {",
"",
"\t\t\tClass factoryClass = Class.forName(className);",
"\t\t\treturn factoryClass.newInstance();",
"\t\t}",
"\t\tcatch (ClassNotFoundException e) {",
"\t\t\treport(className + \" \" + e.toString());",
"\t\t}",
"\t\tcatch (InstantiationException e) {",
"\t\t\treport(className + \" \" + e.toString());",
"\t\t}",
" \t\tcatch (IllegalAccessException e) {",
"\t\t\treport(className + \" \" + e.toString());",
"\t\t}",
"\t\tcatch (LinkageError le) {",
"\t\t\treport(className + \" \" + le.toString());",
"\t\t\treportException(le);",
"\t\t}",
"",
"\t\treturn null;",
"\t}"
]
}
]
}
] |
derby-DERBY-6617-5e5e3c36
|
DERBY-6617: Make MissingPermissionsTest run cleanly on IBM
The error message of the AccessControlException on IBM is the string
"Access denied" (with capital A), whereas the expected message was
"access denied" (lowercase a). Adjust the regular expressions used to
check the messages so that they accept both.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1611546 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-6617-84e1fb36
|
DERBY-6617: Make MissingPermissionsTest look for different error text on Java 6; commit derby-6617-04-aa-platformSpecificErrorText.diff.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1610406 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-6617-ec4eb072
|
DERBY-6617: Fix setting of permissions in MissingPermissionTest
- When forking a new JVM, pass on the properties that tell where
various jar files are located.
- The specialized policy files for the test should include permissions
required when running the test from Ant.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1610374 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-6617-f6df1849
|
DERBY-6617: Stabilize MissingPermissionsTest
Make sure the ij process is shut down cleanly to make the exit code stable.
Use a regular expression to check for messages in the test output. The
regular expression accepts both double-quoted and unquoted names, and
any directory separator, to account for platform differences.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1610662 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-6619-493b80e2
|
DERBY-6619 After silently swallowing SecurityExceptions, Derby can leak class loaders
Patch derby-6619-2.
The fix introduced in DERBY-3745 correctly is there in order to
protect against the case where the thread that starts Derby, has a
context class loader that is different from the system class
loader. In such cases, if the timer thread inherits the context class
loader, the context class loader will stay in memory until the Derby
engine is shut down, even if all other references to the class loader
are gone.
If the context class loader is the same as the system class loader, on
the other hand, such a "leak" would not be a problem, since the system
class loader will stay in memory until the JVM is shut down anyway.
We take advantage of this and only attempt to change the context class
loader if it is different from the system class loader. With this
patch, no warning is printed to derby.log when starting the server
from the command line, and there's no warning when starting the server
using the API with a security manager installed when the context class
loader hasn't been changed from the default. However, if the server is
started using the API with a non-default context class loader, we do
see warnings in derby.log if a security manager is installed and the
permission to set the class loader is missing.
Added tests for this behavior. Moved utility methods from
UpgradeClassLoader to ClassLoaderTestSetup, a new decorator. It seemed
more logical to put them there to allow reuse.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1620379 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/testing/org/apache/derbyTesting/junit/ClassLoaderTestSetup.java",
"hunks": [
{
"added": [
"/*",
" * Derby - Class org.apache.derbyTesting.junit.ClassLoaderTestSetup",
" *",
" * Licensed to the Apache Software Foundation (ASF) under one or more",
" * contributor license agreements. See the NOTICE file distributed with",
" * this work for additional information regarding copyright ownership.",
" * The ASF licenses this file to You under the Apache License, Version 2.0",
" * (the \"License\"); you may not use this file except in compliance with",
" * the License. You may obtain a copy of the License at",
" *",
" * http://www.apache.org/licenses/LICENSE-2.0",
" *",
" * Unless required by applicable law or agreed to in writing,",
" * software distributed under the License is distributed on an",
" * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,",
" * either express or implied. See the License for the specific",
" * language governing permissions and limitations under the License.",
" */",
"",
"package org.apache.derbyTesting.junit;",
"",
"import java.net.URL;",
"import java.net.URLClassLoader;",
"import java.security.AccessController;",
"import java.security.PrivilegedAction;",
"import junit.framework.Test;",
"import org.apache.derbyTesting.functionTests.tests.upgradeTests.UpgradeClassLoader;",
"",
"/**",
" * A decorator that changes the context class loader for the current",
" * configuration and resets it afterwards.",
" */",
"public class ClassLoaderTestSetup extends BaseJDBCTestSetup {",
"",
" private ClassLoader oldLoader;",
"",
" /**",
" * Create a decorator that makes {@code test} run with non-default",
" * class loader. It also shuts down the engine so Derby classes will",
" * be loaded with the new class loader.",
" *",
" * @param test the test to decorate",
" */",
" public ClassLoaderTestSetup(Test test) {",
" super(test);",
" }",
"",
" private static ClassLoader makeClassLoader(final ClassLoader old) {",
" return AccessController.doPrivileged(",
" new PrivilegedAction<URLClassLoader>() {",
" @Override",
" public URLClassLoader run() {",
" URL[] jars = ((URLClassLoader)old).getURLs();",
" return new URLClassLoader(jars, null);",
" }",
" });",
" }",
"",
" @Override",
" protected void setUp() throws Exception {",
" super.setUp();",
" TestConfiguration.getCurrent().shutdownEngine();",
" oldLoader = getThreadLoader();",
" setThreadLoader(makeClassLoader(oldLoader));",
" }",
"",
" @Override",
" protected void tearDown() throws Exception {",
" setThreadLoader(oldLoader);",
" super.tearDown();",
" }",
"",
" /**",
" * Force this thread to use a specific class loader.",
" * @param which class loader to set",
" *",
" * @throws SecurityException",
" * if the current thread cannot set the context ClassLoader",
" */",
" public static void setThreadLoader(final ClassLoader which) {",
" AccessController.doPrivileged(new PrivilegedAction<Void>() {",
" @Override",
" public Void run() {",
" java.lang.Thread.currentThread().setContextClassLoader(which);",
" return null;",
" }",
" });",
" }",
"",
" /**",
" * <p>",
" * Retrieve the class loader currently being used by this thread.",
" * </p>",
" * @return the current context class loader",
" */",
" public static ClassLoader getThreadLoader() {",
" return AccessController.doPrivileged(",
" new PrivilegedAction<ClassLoader>() {",
" public ClassLoader run() {",
" return Thread.currentThread().getContextClassLoader();",
" }",
" });",
" }",
"",
"}"
],
"header": "@@ -0,0 +1,105 @@",
"removed": []
}
]
}
] |
derby-DERBY-6619-7f532129
|
DERBY-6619 After silently swallowing SecurityExceptions, Derby can leak class loaders
Patch derby-6619 which prints warnings on derby.log if permissions are
missing to get and set the context class loader in
SingletonTimerFactory (which can lead to classloader leak). Also adds
a test of this by checking derby.log in SecureServerTest.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1618955 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java",
"hunks": [
{
"added": [
"import java.io.IOException;",
"import java.io.InputStream;",
"import java.io.InputStreamReader;",
"import java.io.PrintWriter;",
"import java.lang.reflect.InvocationTargetException;",
"import java.lang.reflect.Method;",
"import java.net.URL;",
"import java.security.AccessControlException;",
"import java.util.Enumeration;",
"import java.util.Locale;",
"import java.util.NoSuchElementException;",
"import java.util.ResourceBundle;",
"import org.apache.derby.iapi.error.ErrorStringBuilder;",
"import org.apache.derby.iapi.error.ExceptionSeverity;",
"import org.apache.derby.iapi.error.ShutdownException;",
"import org.apache.derby.iapi.error.StandardException;",
"import org.apache.derby.iapi.reference.Attribute;",
"import org.apache.derby.iapi.reference.MessageId;",
"import org.apache.derby.iapi.reference.Module;",
"import org.apache.derby.iapi.reference.Property;",
"import org.apache.derby.iapi.reference.SQLState;",
"import org.apache.derby.iapi.services.context.Context;",
"import org.apache.derby.iapi.services.context.ContextManager;",
"import org.apache.derby.iapi.services.context.ContextService;",
"import org.apache.derby.iapi.services.i18n.BundleFinder;",
"import org.apache.derby.iapi.services.i18n.MessageService;",
"import org.apache.derby.iapi.services.info.JVMInfo;",
"import org.apache.derby.iapi.services.io.AccessibleByteArrayOutputStream;",
"import org.apache.derby.iapi.services.io.FormatIdUtil;",
"import org.apache.derby.iapi.services.io.FormatableInstanceGetter;",
"import org.apache.derby.iapi.services.io.RegisteredFormatIds;",
"import org.apache.derby.iapi.services.io.StoredFormatIds;",
"import org.apache.derby.iapi.services.loader.ClassInfo;",
"import org.apache.derby.iapi.services.loader.InstanceGetter;",
"import org.apache.derby.iapi.services.monitor.ModuleControl;",
"import org.apache.derby.iapi.services.monitor.ModuleFactory;",
"import org.apache.derby.iapi.services.monitor.ModuleSupportable;",
"import org.apache.derby.iapi.services.monitor.Monitor;",
"import org.apache.derby.iapi.services.monitor.PersistentService;",
"import org.apache.derby.iapi.services.property.PropertyUtil;",
"import org.apache.derby.iapi.services.stream.InfoStreams;",
"import org.apache.derby.iapi.services.stream.PrintWriterGetHeader;",
"import org.apache.derby.iapi.services.timer.TimerFactory;",
"import org.apache.derby.iapi.services.uuid.UUIDFactory;",
"import org.apache.derby.io.StorageFactory;",
"import org.apache.derby.shared.common.sanity.SanityManager;"
],
"header": "@@ -21,75 +21,64 @@",
"removed": [
"import org.apache.derby.iapi.services.monitor.Monitor;",
"import org.apache.derby.iapi.services.monitor.ModuleFactory;",
"import org.apache.derby.iapi.services.monitor.ModuleControl;",
"import org.apache.derby.iapi.services.monitor.ModuleSupportable;",
"",
"import org.apache.derby.iapi.services.monitor.PersistentService;",
"",
"import org.apache.derby.iapi.services.io.FormatIdUtil;",
"import org.apache.derby.iapi.services.io.RegisteredFormatIds;",
"import org.apache.derby.iapi.services.io.StoredFormatIds;",
"",
"import org.apache.derby.iapi.services.context.ContextManager;",
"import org.apache.derby.iapi.services.context.Context;",
"import org.apache.derby.iapi.services.context.ContextService;",
"",
"import org.apache.derby.iapi.services.stream.InfoStreams;",
"import org.apache.derby.iapi.services.stream.PrintWriterGetHeader;",
"",
"import org.apache.derby.shared.common.sanity.SanityManager;",
"import org.apache.derby.iapi.error.ErrorStringBuilder;",
"import org.apache.derby.iapi.error.ShutdownException;",
"import org.apache.derby.iapi.error.StandardException;",
"import org.apache.derby.iapi.services.uuid.UUIDFactory;",
"import org.apache.derby.iapi.services.timer.TimerFactory;",
"import org.apache.derby.iapi.reference.MessageId;",
"import org.apache.derby.iapi.reference.Module;",
"import org.apache.derby.iapi.reference.Property;",
"import org.apache.derby.iapi.reference.SQLState;",
"import org.apache.derby.iapi.reference.Attribute;",
"import org.apache.derby.iapi.services.property.PropertyUtil;",
"",
"import org.apache.derby.iapi.services.io.AccessibleByteArrayOutputStream;",
"import org.apache.derby.iapi.services.loader.ClassInfo;",
"import org.apache.derby.iapi.services.loader.InstanceGetter;",
"import org.apache.derby.iapi.services.io.FormatableInstanceGetter;",
"import org.apache.derby.iapi.error.ExceptionSeverity;",
"",
"import org.apache.derby.io.StorageFactory;",
"",
"import org.apache.derby.iapi.services.info.JVMInfo;",
"import org.apache.derby.iapi.services.i18n.BundleFinder;",
"import org.apache.derby.iapi.services.i18n.MessageService;",
"",
"import java.io.IOException;",
"import java.io.InputStream;",
"import java.io.PrintWriter;",
"import java.io.InputStreamReader;",
"",
"import java.util.Enumeration;",
"import java.util.Locale;",
"import java.util.ResourceBundle;",
"import java.util.NoSuchElementException;",
"",
"import java.lang.reflect.InvocationTargetException;",
"",
"import java.net.URL;",
"import java.security.AccessControlException;"
]
},
{
"added": [
" private final HashMap<String,PersistentService> serviceProviders =",
" new HashMap<String,PersistentService>();"
],
"header": "@@ -105,7 +94,8 @@ abstract class BaseMonitor",
"removed": [
"\tprivate HashMap<String,PersistentService> serviceProviders = new HashMap<String,PersistentService>();"
]
},
{
"added": [
" private final Vector<TopService> services; // Vector of TopServices"
],
"header": "@@ -114,7 +104,7 @@ abstract class BaseMonitor",
"removed": [
"\tprivate Vector<TopService>\t services;\t\t\t\t\t// Vector of TopServices"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/services/timer/SingletonTimerFactory.java",
"hunks": [
{
"added": [
"import java.util.Timer;",
"import org.apache.derby.iapi.error.StandardException;",
"import org.apache.derby.iapi.services.i18n.MessageService;",
"import org.apache.derby.iapi.services.monitor.ModuleControl;",
"import org.apache.derby.iapi.services.timer.TimerFactory;",
"import org.apache.derby.shared.common.reference.MessageId;",
"import org.apache.derby.shared.common.sanity.SanityManager;"
],
"header": "@@ -21,16 +21,18 @@",
"removed": [
"import org.apache.derby.iapi.services.timer.TimerFactory;",
"import org.apache.derby.iapi.services.monitor.ModuleControl;",
"import org.apache.derby.iapi.error.StandardException;",
"",
"import java.util.Timer;"
]
},
{
"added": [
" private final Timer singletonTimer;"
],
"header": "@@ -51,7 +53,7 @@ public class SingletonTimerFactory",
"removed": [
" private Timer singletonTimer;"
]
},
{
"added": [
" /**",
" * Initialization warnings. See {@link #getWarnings}.",
" */",
" private StringBuilder warnings = new StringBuilder();",
""
],
"header": "@@ -60,6 +62,11 @@ public class SingletonTimerFactory",
"removed": []
},
{
"added": [
" @Override",
" @Override"
],
"header": "@@ -89,12 +96,12 @@ public class SingletonTimerFactory",
"removed": [
" /** {@inheritDoc} */",
" /** {@inheritDoc} */"
]
},
{
"added": [
" * @param create not used",
" * @param properties not used",
" * @throws StandardException not used",
" @Override"
],
"header": "@@ -124,8 +131,12 @@ public class SingletonTimerFactory",
"removed": []
},
{
"added": [
" @Override"
],
"header": "@@ -140,6 +151,7 @@ public class SingletonTimerFactory",
"removed": []
},
{
"added": [
" private ClassLoader getContextClassLoader() {",
" @Override"
],
"header": "@@ -147,10 +159,11 @@ public class SingletonTimerFactory",
"removed": [
" private static ClassLoader getContextClassLoader() {"
]
},
{
"added": [
" report(se, MessageId.CANNOT_GET_CLASSLOADER);",
" private void setContextClassLoader(final ClassLoader cl) {",
" @Override"
],
"header": "@@ -160,13 +173,15 @@ public class SingletonTimerFactory",
"removed": [
" private static void setContextClassLoader(final ClassLoader cl) {"
]
}
]
}
] |
derby-DERBY-6619-921e39ea
|
DERBY-6619 After silently swallowing SecurityExceptions, Derby can leak class loaders
Patch derby-6619-2-refinement which implements the following
refinements to the test to avoid changing the context class loader in
SingletonTimerFactory (suggested by Knut):
The orginal test tested against the system class loader. This new patch will:
1) Check if the context class loader is the same as the loader of the
SingletonTimerFactory class (that is, the class loader from which
Derby classes are loaded). Even if this isn't the same as the system
class loader, it would be safe to skip the workaround for DERBY-3745,
since the class loader for the Derby classes would not be eligible for
garbage collection until the engine is shut down anyway. This would
prevent some more false positives from being reported in
derby.log. I'd assume this is a kind of false positive that could
easily occur in an application server environment where the Derby
classes are not found on the system class loader.
2) Check against Thread.class.getClassLoader() instead of
ClassLoader.getSystemClassLoader(). Normally, those two checks would
be identical. If however the setup is such that they aren't identical,
we'd still know that the class loader actually used for system classes
such as the Thread class would have to stay in memory for as long as
the timer thread is alive, regardless of the context class loader of
the thread, so the workaround for DERBY-3745 can be skipped if it's
the same as the context class loader. The check will be a bit more
specific this way.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1620385 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/services/timer/SingletonTimerFactory.java",
"hunks": [
{
"added": [
" if (cl == getClass().getClassLoader() ||",
" cl == Thread.class.getClassLoader()) {",
" // If the context class loader is the same as any of",
" // these class loaders, we are not worried that the",
" // timer thread will lead a class loader. These",
" // class loaders will stay in memory for the",
" // that the timer thread keeps a reference to it."
],
"header": "@@ -175,13 +175,14 @@ public class SingletonTimerFactory",
"removed": [
" if (cl == ClassLoader.getSystemClassLoader()) {",
" // If the context class loader is the same as the",
" // system class loader, we are not worried that the",
" // timer thread will lead a class loader. (The",
" // system class loader will stay in memory for the",
" // that the timer thread keeps a reference to it.)"
]
}
]
}
] |
derby-DERBY-6619-c0f956b4
|
DERBY-6619: Improve comments
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1620539 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/services/timer/SingletonTimerFactory.java",
"hunks": [
{
"added": [
" * Check if the current context class loader could cause a memory leak",
" * (DERBY-3745) if it is inherited by the timer thread, and return it if",
" * that is the case.",
" * not the same class loader as the one used by the system classes",
" * or the Derby classes and we have permission to read the class",
" * loaders, or {@code null} otherwise"
],
"header": "@@ -160,12 +160,14 @@ public class SingletonTimerFactory",
"removed": [
" * Get the context class loader if it's different from the system",
" * class loader.",
" * different from the system class loader and we have permission",
" * to read the class loader, or {@code null} otherwise"
]
},
{
"added": [
" // timer thread will leak a class loader. These",
" // class loaders will stay in memory at least for the",
" // lifetime of the Derby engine anyway, so it's not",
" // a problem that the timer thread keeps a reference",
" // to any of them until the engine is shut down.",
" //"
],
"header": "@@ -179,10 +181,12 @@ public class SingletonTimerFactory",
"removed": [
" // timer thread will lead a class loader. These",
" // class loaders will stay in memory for the",
" // lifetime of the JVM anyway, so it's not a problem",
" // that the timer thread keeps a reference to it."
]
},
{
"added": [
" // the DERBY-3745 fix did not require getClassLoader",
" //",
" // In most cases the above calls will succeed, even if",
" // RuntimePermission(\"getClassLoader\") has not been granted.",
" // See the javadoc for Thread.getContextClassLoader() and",
" // Class.getClassLoader() for details."
],
"header": "@@ -193,9 +197,14 @@ public class SingletonTimerFactory",
"removed": [
" // the DERBY-3745 fix did not require getContextClassLoader"
]
}
]
}
] |
derby-DERBY-662-8fa60644
|
Fix for DERBY-662.
The change is an obvious fix to BaseDataFileFactory.java code which creates
a conglomerates container file name given it's conglomerate number. This is
a simple hex conversion which was missing from one of the paths through the
code.
The path is almost never taken, but in the following circumstance during
redo crasch recovery this bug
could cause derby to delete the underlying file of a table. The circumstances
are as follows:
1) The OS/filesystem must be case insensitive such that a request to delete
a file named C2080.dat would also remove c2080.dat. This is true in
windows default file systems, not true in unix/linux filesystems that
I am aware of.
2) The system must be shutdown not in a clean manner, such that a subsequent
access of the database causes a REDO recovery action of a drop table
statement. This means that a drop table statement must have happened
since the last checkpoint in the log file. Examples of things that cause
checkpoints are:
o clean shutdown from ij using the "exit" command
o clean shutdown of database using the "shutdown=true" url
o calling the checkpoint system procedure
o generating enough log activity to cause a regularly scheduled checkpoint.
3) If the conglomerate number of the above described drop table is TABLE_1,
then for a problem to occur there must also exist in the database a table
such that it's HEX(TABLE_2) = TABLE_1
4) Either TABLE_2 must not be accessed during REDO prior to the REDO operation
of the drop of TABLE_1 or there must be enough other table references during
the REDO phase to push the caching of of the open of TABLE_2 out of cache.
The fix adds a test case which before the fix will force a container not
found error on an existing table.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@329494 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-6624-1ffa77b9
|
DERBY-6624: Use javax.xml.xpath interfaces for XPath support
Stop using the interfaces in the org.w3c.dom.xpath package, since they
are not part of the Java SE specification.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1604758 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/iapi/types/SqlXmlUtil.java",
"hunks": [
{
"added": [
"import java.util.Iterator;",
"import org.w3c.dom.NodeList;",
"import javax.xml.XMLConstants;",
"",
"import javax.xml.namespace.NamespaceContext;",
"import javax.xml.namespace.QName;",
""
],
"header": "@@ -28,29 +28,30 @@ import org.apache.derby.shared.common.sanity.SanityManager;",
"removed": [
"import java.math.BigDecimal;",
"",
"import org.w3c.dom.xpath.XPathEvaluator;",
"import org.w3c.dom.xpath.XPathExpression;",
"import org.w3c.dom.xpath.XPathResult;",
""
]
},
{
"added": [
"import javax.xml.xpath.XPath;",
"import javax.xml.xpath.XPathConstants;",
"import javax.xml.xpath.XPathExpression;",
"import javax.xml.xpath.XPathExpressionException;",
"import javax.xml.xpath.XPathFactory;",
""
],
"header": "@@ -62,6 +63,12 @@ import javax.xml.transform.TransformerFactory;",
"removed": []
},
{
"added": [
" /** The compiled XPath query. */",
" /** The return type of the XPath query. {@code null} if it is unknown. */",
" private QName returnType;",
""
],
"header": "@@ -115,10 +122,12 @@ public class SqlXmlUtil",
"removed": [
" // Classes used to compile and execute an XPath expression",
" // against Xalan."
]
},
{
"added": [
" * namespace context object so that prefixes will not be resolved",
" XPath xpath = XPathFactory.newInstance().newXPath();",
" xpath.setNamespaceContext(NullNamespaceContext.SINGLETON);",
"",
" query = xpath.compile(queryExpr);"
],
"header": "@@ -247,15 +256,15 @@ public class SqlXmlUtil",
"removed": [
" * namespace resolver object so that the implementation will",
" * provide one for us, which means prefixes will not be resolved",
" XPathEvaluator eval = (XPathEvaluator)",
" dBuilder.getDOMImplementation().getFeature(\"+XPath\", \"3.0\");",
" query = eval.createExpression(queryExpr, null);"
]
},
{
"added": [
" Document docNode = dBuilder.parse(",
" Object result = evaluate(docNode);",
" // This is for XMLEXISTS.",
" //",
" if (result instanceof NodeList",
" && ((NodeList) result).getLength() == 0) {",
" // We have an empty sequence, so return null to indicate",
" // there were no results from the query.",
" return null;",
" } else {",
" // We have either a non-empty sequence or a scalar, so",
" // return a non-null value to indicate that we found at",
" // least one item.",
" return Collections.emptyList();",
" if (result instanceof NodeList) {",
" NodeList list = (NodeList) result;",
" ArrayList<Node> nodes = new ArrayList<Node>();",
" for (int i = 0; i < list.getLength(); i++) {",
" nodes.add(list.item(i));",
" }",
" itemRefs = nodes;",
" } else {",
" itemRefs = Collections.singletonList(result);"
],
"header": "@@ -571,72 +580,43 @@ public class SqlXmlUtil",
"removed": [
" Document docNode = null;",
" docNode = dBuilder.parse(",
" // Evaluate the expresion using Xalan.",
" XPathResult result = (XPathResult)",
" query.evaluate(docNode, XPathResult.ANY_TYPE, null);",
" switch (result.getResultType()) {",
" case XPathResult.UNORDERED_NODE_ITERATOR_TYPE:",
" case XPathResult.ORDERED_NODE_ITERATOR_TYPE:",
" if (result.iterateNext() == null) {",
" // We have an empty sequence, so return null.",
" return null;",
" } else {",
" // We have a non-empty sequence, so return a non-null",
" // list to indicate that we found at least one item.",
" return Collections.EMPTY_LIST;",
" }",
" default:",
" // We have a single atomic value, which means the result is",
" // non-empty. So return a non-null list.",
" return Collections.EMPTY_LIST;",
" switch (result.getResultType()) {",
" case XPathResult.NUMBER_TYPE:",
" // Single atomic number. Get its string value.",
" String val = numberToString(result.getNumberValue());",
" itemRefs = Collections.singletonList(val);",
" break;",
" case XPathResult.STRING_TYPE:",
" // Single atomic string value.",
" itemRefs = Collections.singletonList(result.getStringValue());",
" break;",
" case XPathResult.BOOLEAN_TYPE:",
" // Single atomic boolean. Get its string value.",
" itemRefs = Collections.singletonList(",
" String.valueOf(result.getBooleanValue()));",
" break;",
" case XPathResult.UNORDERED_NODE_ITERATOR_TYPE:",
" case XPathResult.ORDERED_NODE_ITERATOR_TYPE:",
" // We have a sequence. Get all nodes.",
" ArrayList<Node> nodes = new ArrayList<Node>();",
" Node node;",
" while ((node = result.iterateNext()) != null) {",
" nodes.add(node);",
" }",
" itemRefs = nodes;",
" break;",
" default:",
" if (SanityManager.DEBUG) {",
" SanityManager.THROWASSERT(",
" \"Don't know how to handle XPath result type \" +",
" result.getResultType());",
" }",
" itemRefs = null;"
]
},
{
"added": [
" /**",
" * Evaluate the XPath query on the specified document.",
" */",
" private Object evaluate(Document doc) throws XPathExpressionException {",
"",
" // If we know the return type, just evaluate the expression with",
" // that type.",
" if (returnType != null) {",
" return query.evaluate(doc, returnType);",
" }",
"",
" // Otherwise, first try to evaluate the expression as if it returned",
" // a set of nodes. If that fails, evaluate it as if it returned a",
" // string. Remember which type was successful so that we can use that",
" // type directly the next time we evaluate the expression.",
" try {",
" Object result = query.evaluate(doc, XPathConstants.NODESET);",
" returnType = XPathConstants.NODESET;",
" return result;",
" } catch (XPathExpressionException xpee) {",
" Object result = query.evaluate(doc, XPathConstants.STRING);",
" returnType = XPathConstants.STRING;",
" return result;",
" }",
" }",
""
],
"header": "@@ -657,6 +637,32 @@ public class SqlXmlUtil",
"removed": []
},
{
"added": [],
"header": "@@ -704,35 +710,6 @@ public class SqlXmlUtil",
"removed": [
" return;",
" }",
"",
" /**",
" * Convert a number returned by an XPath query to a string, following the",
" * rules for the <a href=\"http://www.w3.org/TR/xpath/#function-string\">",
" * XPath string function</a>.",
" *",
" * @param d {@code double} representation of the number",
" * @return {@code String} representation of the number",
" */",
" private static String numberToString(double d) {",
" if (Double.isNaN(d) || Double.isInfinite(d)) {",
" // BigDecimal doesn't know how to handle NaN or +/- infinity, so",
" // use Double to handle those cases.",
" return Double.toString(d);",
" } else if (d == 0.0d) {",
" // If the result is zero, return plain \"0\". This special case is",
" // needed because BigDecimal.stripTrailingZeros() does not remove",
" // trailing zeros from zero, and will end up producing \"0.0\", see",
" // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6480539",
" return \"0\";",
" } else {",
" // Otherwise, use BigDecimal to format the number the way we want.",
" // We could have used Double to format it, but then the resulting",
" // string would have been in scientific format (like 1.0e-3), and",
" // we want it to be in plain format (like 0.001).",
" return BigDecimal.valueOf(d).stripTrailingZeros().toPlainString();",
" }"
]
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/types/XML.java",
"hunks": [
{
"added": [],
"header": "@@ -29,7 +29,6 @@ import org.apache.derby.iapi.services.io.StoredFormatIds;",
"removed": [
"import org.apache.derby.iapi.services.loader.ClassInspector;"
]
},
{
"added": [],
"header": "@@ -44,7 +43,6 @@ import java.io.InputStream;",
"removed": [
"import java.lang.reflect.Method;"
]
},
{
"added": [
" SQLState.LANG_XML_QUERY_ERROR, xe,"
],
"header": "@@ -830,7 +828,7 @@ public class XML",
"removed": [
" SQLState.LANG_XML_QUERY_ERROR,"
]
},
{
"added": [
" SQLState.LANG_XML_QUERY_ERROR, xe,"
],
"header": "@@ -903,7 +901,7 @@ public class XML",
"removed": [
" SQLState.LANG_XML_QUERY_ERROR,"
]
},
{
"added": [
" /* If the DocumentBuilderFactory class exists, then we"
],
"header": "@@ -983,7 +981,7 @@ public class XML",
"removed": [
" /* If the w3c Document class exists, then we"
]
},
{
"added": [
" if (!checkJAXPRequirement()) {",
" }",
" /* If the XPathFactory class exists, then we assume that",
" * our XML query processor is present in the classpath.",
" else if (!checkXPathRequirement()) {",
" xmlReqCheck = \"XPath\";",
" }"
],
"header": "@@ -997,21 +995,16 @@ public class XML",
"removed": [
" Object docImpl = checkJAXPRequirement();",
" if (docImpl == null)",
" /* If the XPath class exists, then we assume that our XML",
" * query processor (in this case, Xalan), is present in the",
" * classpath. Note: if JAXP API classes aren't present",
" * then the following check will return false even if the",
" * Xalan classes *are* present; this is because the Xalan",
" * XPath class relies on JAXP, as well. Thus there's no",
" * point in checking for Xalan unless we've already confirmed",
" * that we have the JAXP interfaces.",
" else if (!checkXPathRequirement(docImpl))",
" xmlReqCheck = \"XPath 3.0\";"
]
}
]
},
{
"file": "java/testing/org/apache/derbyTesting/junit/XML.java",
"hunks": [
{
"added": [],
"header": "@@ -35,37 +35,6 @@ import junit.framework.Assert;",
"removed": [
" *",
" * <p>",
" * Note that The XML tests require a more advanced version of Xalan",
" * than the default version bundled with JDK 1.4. The XML tests silently",
" * exit if the required environment is not found.",
" * </p>",
" *",
" * <p>",
" * To run the XML tests under JDK 1.4, you must do the following:",
" * </p>",
" *",
" * <ul>",
" * <li>Download the latest version of Xalan (2.7.0 as of this writing).</li>",
" * <li>Copy all of the downloaded jars into the jre/lib/endorsed directory",
" * of your JDK 1.4 installation. Those jar files are:",
" * serializer.jar, xalan.jar, xercesImpl.jar, and xsltc.jar.</li>",
" * </ul>",
" *",
" * <p>",
" *That's it! Now the XML tests should run for you under JDK 1.4.",
" * </p>",
" *",
" * <p>",
" * To run the XML tests under a higher version of the JDK, you must do the",
" * following:",
" * </p>",
" *",
" * <ul>",
" * <li>Download the latest version of Xalan as described above.</li>",
" * <li>Wire the downloaded jar files into your CLASSPATH.</li>",
" * </ul>"
]
},
{
"added": [
" * Determine if we have support evaluating XPath queries.",
" private static final boolean HAVE_XPATH"
],
"header": "@@ -85,10 +54,9 @@ public class XML {",
"removed": [
" * Determine if we have support for DOM level 3 XPath, which is required",
" * for successful use of the XML operators.",
" private static final boolean HAVE_XPATH_LEVEL_3"
]
},
{
"added": [
" * support for XPath queries)."
],
"header": "@@ -102,7 +70,7 @@ public class XML {",
"removed": [
" * support for DOM level 3 XPath)."
]
},
{
"added": [
" * for use of the SQL/XML operators.",
" return HAVE_XPATH;"
],
"header": "@@ -111,13 +79,11 @@ public class XML {",
"removed": [
" * for use of the SQL/XML operators. This means that all",
" * required classes exist in the classpath AND there is support",
" * for DOM level 3 XPath.",
" return HAVE_XPATH_LEVEL_3;"
]
},
{
"added": [
" * evaluating XPath queries."
],
"header": "@@ -247,7 +213,7 @@ public class XML {",
"removed": [
" * DOM level 3 XPath."
]
}
]
}
] |
derby-DERBY-6626-0196a8f1
|
DERBY-6626: Check type of user-supplied modules before creating instances
Check explicitly that a custom tool implements the OptionalTool interface.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1609099 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/catalog/Java5SystemProcedures.java",
"hunks": [
{
"added": [],
"header": "@@ -23,7 +23,6 @@ package org.apache.derby.catalog;",
"removed": [
"import org.apache.derby.iapi.sql.conn.ConnectionUtil;"
]
},
{
"added": [],
"header": "@@ -31,7 +30,6 @@ import org.apache.derby.iapi.reference.SQLState;",
"removed": [
"import org.apache.derby.shared.common.sanity.SanityManager;"
]
},
{
"added": [
" Class<?> toolClass;",
" toolClass = classFactory.loadApplicationClass( toolClassName );",
"",
" if (!OptionalTool.class.isAssignableFrom(toolClass)) {",
" throw badCustomTool(toolClassName);",
" }",
"",
" try {",
" tool = (OptionalTool) toolClass.newInstance();",
" }"
],
"header": "@@ -101,10 +99,19 @@ public class Java5SystemProcedures",
"removed": [
" tool = (OptionalTool) classFactory.loadApplicationClass( toolClassName ).newInstance();"
]
}
]
}
] |
derby-DERBY-6626-59f29e43
|
DERBY-6626: Check type of user-supplied modules before creating instances
Make SequenceUpdater verify that the class specified by the
derby.language.sequence.preallocator property is a
SequencePreallocator before attempting to create an instance of it.
Make dblook and ij verify that user-specified JDBC driver class names
and DataSource class names implement the correct interfaces before
attempting to create and use them.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1607795 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/tools/org/apache/derby/impl/tools/ij/util.java",
"hunks": [
{
"added": [
"import java.sql.Driver;"
],
"header": "@@ -33,6 +33,7 @@ import java.lang.reflect.InvocationTargetException;",
"removed": []
},
{
"added": [
"import javax.sql.DataSource;"
],
"header": "@@ -44,6 +45,7 @@ import java.sql.Types;",
"removed": []
},
{
"added": [],
"header": "@@ -53,7 +55,6 @@ import java.util.Locale;",
"removed": [
"\tprivate static final Class[] DS_GET_CONN_TYPES = {\"\".getClass(), \"\".getClass()};"
]
},
{
"added": [
" DataSource ds;",
" if (DataSource.class.isAssignableFrom(dc)) {",
" ds = (DataSource) dc.newInstance();",
" } else {",
" throw new ijException(LocalizedResource.getMessage(",
" \"TL_notInstanceOf\", dsName, DataSource.class.getName()));",
" }",
"",
" return user == null",
" ? ds.getConnection()",
" : ds.getConnection(user, password);"
],
"header": "@@ -345,24 +346,23 @@ public final class util implements java.security.PrivilegedAction<String> {",
"removed": [
"\t\tObject ds = null; // really javax.sql.DataSource",
"\t\t ds = dc.newInstance();",
"\t\t ",
"\t\t // Java method call \"by hand\" { con = ds.getConnection(); }",
"\t\t // or con = ds.getConnection(user, password)",
"\t\t \t",
"\t\t\tjava.lang.reflect.Method m = ",
"\t\t\t\tuser == null ? dc.getMethod(\"getConnection\", null) :",
"\t\t\t\t\t dc.getMethod(\"getConnection\", DS_GET_CONN_TYPES);",
"\t\t\t\t",
"\t\t\treturn (java.sql.Connection) m.invoke(ds,",
"\t\t\t\t\t user == null ? null : new String[] {user, password});"
]
}
]
},
{
"file": "java/tools/org/apache/derby/tools/dblook.java",
"hunks": [
{
"added": [
"import java.sql.Driver;"
],
"header": "@@ -27,6 +27,7 @@ import java.io.StringReader;",
"removed": []
},
{
"added": [
" Logs.cleanup(); // Make sure the error log is flushed to disk."
],
"header": "@@ -131,6 +132,7 @@ public final class dblook {",
"removed": []
},
{
"added": [
" Class<?> klass = Class.forName(derbyDriver);",
" if (Driver.class.isAssignableFrom(klass)) {",
" klass.newInstance();",
" } else {",
" Logs.debug(",
" \"TL_notInstanceOf\",",
" new String[] { derbyDriver, Driver.class.getName() });",
" return false;",
" }"
],
"header": "@@ -321,7 +323,15 @@ public final class dblook {",
"removed": [
"\t\t\tClass.forName(derbyDriver).newInstance();"
]
}
]
}
] |
derby-DERBY-6626-9b8c04f9
|
DERBY-6626: Check type of user-supplied modules before creating instances
Check that the encryptionProvider connection attribute specifies an
implementation of java.security.Provider before trying to create an
instance of it.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1607266 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/services/jce/JCECipherFactory.java",
"hunks": [
{
"added": [
"import java.security.AccessController;",
"import java.security.PrivilegedAction;",
"import java.security.PrivilegedExceptionAction;"
],
"header": "@@ -24,29 +24,23 @@ package org.apache.derby.impl.services.jce;",
"removed": [
"import org.apache.derby.iapi.services.monitor.Monitor;",
"import org.apache.derby.shared.common.sanity.SanityManager;",
"",
"import org.apache.derby.iapi.services.info.JVMInfo;",
"import org.apache.derby.iapi.util.StringUtil;",
"",
"import java.security.Key;",
"import java.security.spec.KeySpec;",
"import java.security.spec.InvalidKeySpecException;"
]
},
{
"added": [],
"header": "@@ -54,13 +48,11 @@ import java.io.DataInputStream;",
"removed": [
"import javax.crypto.SecretKeyFactory;",
"import org.apache.derby.io.WritableStorageFactory;"
]
},
{
"added": [
"public final class JCECipherFactory implements CipherFactory"
],
"header": "@@ -68,7 +60,7 @@ import org.apache.derby.io.StorageRandomAccessFile;",
"removed": [
"public final class JCECipherFactory implements CipherFactory, java.security.PrivilegedExceptionAction<Object>"
]
},
{
"added": [],
"header": "@@ -110,9 +102,6 @@ public final class JCECipherFactory implements CipherFactory, java.security.Priv",
"removed": [
"\tprivate StorageFile activeFile;",
"\tprivate int action;",
"\tprivate String activePerms;"
]
},
{
"added": [
" Class cryptoClass = Class.forName(cryptoProvider);",
" if (!Provider.class.isAssignableFrom(cryptoClass)) {",
" throw StandardException.newException(",
" SQLState.ENCRYPTION_NOT_A_PROVIDER,",
" cryptoProvider);",
" }",
"",
" final Provider provider =",
" (Provider) cryptoClass.newInstance();",
"",
" AccessController.doPrivileged(new PrivilegedAction<Void>() {",
" @Override",
" public Void run() {",
" Security.addProvider(provider);",
" return null;",
" }",
" });"
],
"header": "@@ -547,9 +536,24 @@ public final class JCECipherFactory implements CipherFactory, java.security.Priv",
"removed": [
"\t\t\t\t\taction = 1;",
"\t\t\t\t\tjava.security.AccessController.doPrivileged(this);"
]
},
{
"added": [
" catch (ClassNotFoundException cnfe)",
" {",
" t = StandardException.newException(",
" SQLState.ENCRYPTION_NO_PROVIDER_CLASS,",
" cnfe,",
" cryptoProvider);",
" }",
" catch (InstantiationException ie)",
" t = ie;",
" catch (IllegalAccessException iae)",
" {",
" t = iae;",
" }"
],
"header": "@@ -604,10 +608,21 @@ public final class JCECipherFactory implements CipherFactory, java.security.Priv",
"removed": [
"\t\tcatch (java.security.PrivilegedActionException pae)",
"\t\t\tt = pae.getException();"
]
},
{
"added": [],
"header": "@@ -847,39 +862,6 @@ public final class JCECipherFactory implements CipherFactory, java.security.Priv",
"removed": [
"\t/**",
"\t \tperform actions with privileges enabled.",
"\t */",
"\tpublic final Object run() throws StandardException, InstantiationException, IllegalAccessException {",
"",
"\t\ttry {",
"",
"\t\t\tswitch(action)",
"\t\t\t{",
"\t\t\t\tcase 1:",
"\t\t\t\t\tSecurity.addProvider(",
"\t\t\t\t\t(Provider)(Class.forName(cryptoProvider).newInstance()));",
"\t\t\t\t\tbreak;",
"\t\t\t\tcase 2:",
"\t\t\t\t\t// SECURITY PERMISSION - MP1 and/or OP4",
"\t\t\t\t\t// depends on the value of activePerms",
"\t\t\t\t\treturn activeFile.getRandomAccessFile(activePerms);",
" case 3:",
" return activeFile.getInputStream();",
"",
"\t\t\t}",
"",
"\t\t} catch (ClassNotFoundException cnfe) {",
"\t\t\tthrow StandardException.newException(SQLState.ENCRYPTION_NO_PROVIDER_CLASS,cryptoProvider);",
"\t\t}",
"\t\tcatch(FileNotFoundException fnfe) {",
"\t\t\tthrow StandardException.newException(SQLState.ENCRYPTION_UNABLE_KEY_VERIFICATION,cryptoProvider);",
"\t\t}",
"\t\treturn null;",
"\t}",
"",
"",
""
]
},
{
"added": [
" private StorageRandomAccessFile privAccessFile(",
" StorageFactory storageFactory,",
" String fileName,",
" final String filePerms)",
" final StorageFile verifyKeyFile =",
" storageFactory.newStorageFile(\"\", fileName);",
" return AccessController.doPrivileged(",
" new PrivilegedExceptionAction<StorageRandomAccessFile>() {",
" @Override",
" public StorageRandomAccessFile run() throws IOException {",
" return verifyKeyFile.getRandomAccessFile(filePerms);",
" }",
" });"
],
"header": "@@ -1028,16 +1010,23 @@ public final class JCECipherFactory implements CipherFactory, java.security.Priv",
"removed": [
"\tprivate StorageRandomAccessFile privAccessFile(StorageFactory storageFactory,String fileName,String filePerms)",
"\t\tStorageFile verifyKeyFile = storageFactory.newStorageFile(\"\",fileName);",
"\t\tactiveFile = verifyKeyFile;",
"\t\tthis.action = 2;",
"\t\tactivePerms = filePerms;",
"\t\t\treturn (StorageRandomAccessFile)java.security.AccessController.doPrivileged(this);"
]
}
]
}
] |
derby-DERBY-6628-0bfd4d7c
|
DERBY-6628 Intermittent error in TriggerGeneralTest
Patch derby-6628-more-diagnostics: a diagnostics patch that will dump
the entire lock table in if we see the unexpected set of locks seen in
this issue.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1606723 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-6628-5bfb3389
|
DERBY-6628 Intermittent error in TriggerGeneralTest
Patch derby-6628-2.
We decided, instead of filering the unexpected system table locks, to
retry the assert for the lock result set for a while to rule out slow,
lingering (re)compilation locks (by the index statistics daemon?).
If the locks of the system tables hang around for a minute (max
waiting time), something fishy is going on.
We'll run with this for a while, and if we don't see this issue again,
close the issue.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1621223 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.