See <https://builds.apache.org/job/Derby-trunk/2172/changes>
Changes:
[dag] DERBY-532 Support deferrable constraints
Deferred foreign key constraint. Patch derby-532-fk-7.
The approach taken for deferring foreign keys is similar to that taken
for the other constraints: when we detect a violation inserting or
updating the referring table, and when detecting a violation when
deleting or updating the referenced table (only when we have ON DELETE
(or UPDATE) NO ACTION), we save the key in a temporary table instead
of throwing an exception. At check time, typically on commit, we
revisit first the supporting index of referencing table to see if
there might still be a problem. If that key is (still) present, we
must also check the corresponding index in the referenced table. If
that is found, all is good. Otherwise we throw.
Patch details:
M
java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java
M
java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java
Move logic related to constraints checking to
DeferredConstraintsMemory.
M
java/engine/org/apache/derby/impl/sql/execute/DeferredConstraintsMemory.java
New logic from LanguageConnectionContext; added logic for the case of
foreign key constraints violation memory and checking. Make old "if"s
on object type object oriented: new interface methods in
ValidationInfo: possiblyValidateOnReturn and validateConstraint which
are implemented differently for each constraint type.
M java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java
M java/engine/org/apache/derby/impl/sql/execute/UpdateResultSet.java
M
java/engine/org/apache/derby/impl/sql/execute/ConstraintConstantAction.java
More fk info to bulk insert; smaller refactorings.
M
java/engine/org/apache/derby/iapi/sql/dictionary/ReferencedKeyConstraintDescriptor.java
Change the method hasNonSelfReferencingFK to getNonSelfReferencingFK;
we need to get at them, see AlterTableConstantAction for truncate.
M
java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
Refactored logic to DeferredConstraintsMemory#compressOrTruncate.
Allow truncate (if deferred and NO_ACTION constraints only) of
deferenced table.
M java/engine/org/apache/derby/iapi/types/SQLBoolean.java
M java/engine/org/apache/derby/impl/sql/execute/IndexChanger.java
M
java/engine/org/apache/derby/impl/sql/execute/ProjectRestrictResultSet.java
Minor refactorings.
M java/engine/org/apache/derby/impl/sql/execute/FKInfo.java
Extended with information about deferred constraints; conglomerate ids and
constrain ids.
M java/engine/org/apache/derby/impl/sql/compile/DMLModStatementNode.java
More information collection to support extended FKInfo, see above.
M java/engine/org/apache/derby/impl/sql/compile/TableElementList.java
Extra predicates to avoid logic for unique and primary key constraints to
inferere with
deferred foreign keys.
M
java/engine/org/apache/derby/impl/sql/execute/CreateConstraintConstantAction.java
Remove foreign keys as "not supported", minor refactorings.
M java/engine/org/apache/derby/impl/sql/execute/DeleteResultSet.java
Added arguments, refactorings.
M java/engine/org/apache/derby/impl/sql/execute/ForeignKeyRIChecker.java
This is where we actually defer when we see a fk violation at insert/update of
referencing table.
M java/engine/org/apache/derby/impl/sql/execute/GenericRIChecker.java
Minor interface changes: new member variable: lcc
M java/engine/org/apache/derby/impl/sql/execute/RIBulkChecker.java
This is where we actually defer when we see a fk violation at bulk insert
into referencing table.
M java/engine/org/apache/derby/impl/sql/execute/RISetChecker.java
Minor interface changes; added parameters.
M
java/engine/org/apache/derby/impl/sql/execute/ReferencedKeyRIChecker.java
This is where we actually defer when we see a fk violation at delete or update
of
a row in the referenced table.
M
java/engine/org/apache/derby/impl/sql/execute/SetConstraintsConstantAction.java
Make SET CONSTRAINTS work also for foreign keys.
M java/shared/org/apache/derby/shared/common/reference/SQLState.java
M java/engine/org/apache/derby/loc/messages.xml
New error messages.
M
java/testing/org/apache/derbyTesting/functionTests/tests/lang/ConstraintCharacteristicsTest.java
Extended existing deferrable constraints to also work for foreign constraints.
A
java/testing/org/apache/derbyTesting/functionTests/tests/lang/ForeignKeysDeferrableTest.java
New tests only for foreign key constraints.
M
java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_11.java
Remove asserts for not implemented on deferrable foreign key
constraints, check basic sanity iff hard upgraded.
M java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java
Added assertCommitError; minor changes to support fk testing.
------------------------------------------
[...truncated 654 lines...]
writeversioninfo:
[mkdir] Created dir:
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derby/info>
infowriter:
[propertyfile] Creating new property file:
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derby/info/DBMS.properties>
infowriter:
[propertyfile] Creating new property file:
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derby/info/tools.properties>
infowriter:
[propertyfile] Creating new property file:
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derby/info/net.properties>
infowriter:
[propertyfile] Creating new property file:
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derby/info/dnc.properties>
versioninfo:
checklocaleinfo:
checkmessages-done:
checkmessages:
[touch] Creating
<https://builds.apache.org/job/Derby-trunk/ws/trunk/generated/checkmessages.done>
localeinfo:
buildlocaleinfo:
localeinfowriter:
[propertyfile] Creating new property file:
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derby/info/locale_cs.properties>
buildlocaleinfo:
localeinfowriter:
[propertyfile] Creating new property file:
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derby/info/locale_de_DE.properties>
buildlocaleinfo:
localeinfowriter:
[propertyfile] Creating new property file:
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derby/info/locale_es.properties>
buildlocaleinfo:
localeinfowriter:
[propertyfile] Creating new property file:
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derby/info/locale_fr.properties>
buildlocaleinfo:
localeinfowriter:
[propertyfile] Creating new property file:
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derby/info/locale_hu.properties>
buildlocaleinfo:
localeinfowriter:
[propertyfile] Creating new property file:
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derby/info/locale_it.properties>
buildlocaleinfo:
localeinfowriter:
[propertyfile] Creating new property file:
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derby/info/locale_ja_JP.properties>
buildlocaleinfo:
localeinfowriter:
[propertyfile] Creating new property file:
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derby/info/locale_ko_KR.properties>
buildlocaleinfo:
localeinfowriter:
[propertyfile] Creating new property file:
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derby/info/locale_pl.properties>
buildlocaleinfo:
localeinfowriter:
[propertyfile] Creating new property file:
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derby/info/locale_pt_BR.properties>
buildlocaleinfo:
localeinfowriter:
[propertyfile] Creating new property file:
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derby/info/locale_ru.properties>
buildlocaleinfo:
localeinfowriter:
[propertyfile] Creating new property file:
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derby/info/locale_zh_CN.properties>
buildlocaleinfo:
localeinfowriter:
[propertyfile] Creating new property file:
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derby/info/locale_zh_TW.properties>
check-binscripts:
binscripts:
makebinscript:
makebinscript:
makebinscript:
makebinscript:
makebinscript:
makebinscript:
buildsource:
vti-demo:
compile-vtidemo:
[javac] Compiling 6 source files to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes>
demo:
compile:
[javac] Compiling 2 source files to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes>
[javac] Compiling 3 source files to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes>
[javac] Compiling 1 source file to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes>
[javac] Compiling 3 source files to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes>
compile:
[javac] Compiling 1 source file to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes>
checktoursdb:
toursdb:
compile:
builddb:
[echo] Begin building toursdb
runijscript:
[echo] Running script
<https://builds.apache.org/job/Derby-trunk/ws/trunk/generated/toursdb/build_toursdb.sql>
jarup:
[zip] Building zip:
<https://builds.apache.org/job/Derby-trunk/ws/trunk/generated/toursdb/toursdb.jar>
[echo] Finished building toursdb
copyfiles:
[copy] Copying 12 files to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derbyTesting/functionTests/tests/demo>
toursdb:
demo:
buildtestinginfo:
tstinginfowriter:
[propertyfile] Creating new property file:
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derby/info/tsting.properties>
testing:
testing:
junitcomponents:
[javac] Compiling 52 source files to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes>
init:
[mkdir] Created dir:
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derbyTesting/functionTests/harness>
compile:
[javac] Compiling 48 source files to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes>
copyfiles:
[copy] Copying 1 file to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derbyTesting/functionTests/harness>
FTharness:
copyfiles:
[copy] Copying 1 file to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derbyTesting/functionTests/testData/v1>
[copy] Copying 1 file to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derbyTesting/functionTests/testData/v2>
[copy] Copying 15 files to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derbyTesting/functionTests/testData/ImportExport>
[copy] Copying 3 files to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derbyTesting/functionTests/testData/ResultSetStream>
[copy] Copying 1 file to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derbyTesting/functionTests/testData/ConnectionMethods>
[copy] Copying 39 files to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derbyTesting/functionTests/testData/serializedDataSources>
compile:
[javac] Compiling 1 source file to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes>
testdata:
copyfiles:
[copy] Copying 4 files to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derbyTesting/functionTests/util>
compile:
[javac] Compiling 50 source files to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes>
FTpolicy:
util:
unitTests:
[javac] Compiling 82 source files to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes>
[copy] Copying 4 files to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derbyTesting/unitTests>
copyfiles:
[copy] Copying 23 files to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derbyTesting/functionTests/multi/stress>
FTstress:
copyfiles:
[copy] Copying 1 file to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derbyTesting/functionTests/tests/compatibility>
compile:
[javac] Compiling 10 source files to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes>
compilet1:
[javac] Compiling 93 source files to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes>
copyfiles:
[copy] Copying 20 files to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes/org/apache/derbyTesting/functionTests/tests/jdbcapi>
FTOtestsubdir:
compilet1:
[javac] Compiling 214 source files to
<https://builds.apache.org/job/Derby-trunk/ws/trunk/classes>
[javac]
<https://builds.apache.org/job/Derby-trunk/ws/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ForeignKeysDeferrableTest.java>:54:
error: unmappable character for encoding ASCII
[javac] * NOTE 52 ??? For example, if a referential update action such as
ON UPDATE
[javac] ^
[javac]
<https://builds.apache.org/job/Derby-trunk/ws/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ForeignKeysDeferrableTest.java>:54:
error: unmappable character for encoding ASCII
[javac] * NOTE 52 ??? For example, if a referential update action such as
ON UPDATE
[javac] ^
[javac]
<https://builds.apache.org/job/Derby-trunk/ws/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ForeignKeysDeferrableTest.java>:54:
error: unmappable character for encoding ASCII
[javac] * NOTE 52 ??? For example, if a referential update action such as
ON UPDATE
[javac] ^
[javac]
<https://builds.apache.org/job/Derby-trunk/ws/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ForeignKeysDeferrableTest.java>:66:
error: unmappable character for encoding ASCII
[javac] * NOTE 53 ??? Even if constraint checking is not deferred, ON
UPDATE
[javac] ^
[javac]
<https://builds.apache.org/job/Derby-trunk/ws/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ForeignKeysDeferrableTest.java>:66:
error: unmappable character for encoding ASCII
[javac] * NOTE 53 ??? Even if constraint checking is not deferred, ON
UPDATE
[javac] ^
[javac]
<https://builds.apache.org/job/Derby-trunk/ws/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/ForeignKeysDeferrableTest.java>:66:
error: unmappable character for encoding ASCII
[javac] * NOTE 53 ??? Even if constraint checking is not deferred, ON
UPDATE
[javac] ^
[javac] 6 errors
BUILD FAILED
<https://builds.apache.org/job/Derby-trunk/ws/trunk/build.xml>:663: The
following error occurred while executing this line:
<https://builds.apache.org/job/Derby-trunk/ws/trunk/java/testing/build.xml>:67:
The following error occurred while executing this line:
<https://builds.apache.org/job/Derby-trunk/ws/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/build.xml>:81:
Compile failed; see the compiler error output for details.
Total time: 1 minute 3 seconds
Build step 'Invoke Ant' marked build as failure
[WARNINGS] Skipping publisher since build result is FAILURE
Archiving artifacts