db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fuzzylo...@apache.org
Subject svn commit: r398036 - in /db/derby/code/branches/10.1/java: build/org/apache/derbyBuild/ engine/org/apache/derby/impl/sql/execute/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTests/tests/lang/
Date Fri, 28 Apr 2006 23:24:45 GMT
Author: fuzzylogic
Date: Fri Apr 28 16:24:45 2006
New Revision: 398036

URL: http://svn.apache.org/viewcvs?rev=398036&view=rev
Log:
DERBY-85: Merge revision 378109 to 10.1 branch

Modified:
    db/derby/code/branches/10.1/java/build/org/apache/derbyBuild/build.xml
    db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/CreateTriggerConstantAction.java
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/triggerGeneral.out
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/triggerGeneral.sql

Modified: db/derby/code/branches/10.1/java/build/org/apache/derbyBuild/build.xml
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/build/org/apache/derbyBuild/build.xml?rev=398036&r1=398035&r2=398036&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/build/org/apache/derbyBuild/build.xml (original)
+++ db/derby/code/branches/10.1/java/build/org/apache/derbyBuild/build.xml Fri Apr 28 16:24:45
2006
@@ -33,7 +33,7 @@
       srcdir="${derby.build.src.dir}"
       destdir="${out.dir}">
       <classpath>
-        <pathelement path="${compile.classpath};${java.home}/../lib/tools.jar"/>
+        <pathelement path="${java14compile.classpath};${java.home}/../lib/tools.jar"/>
       </classpath>
       <include name="org/apache/derbyBuild/**"/>
     </javac>

Modified: db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/CreateTriggerConstantAction.java
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/CreateTriggerConstantAction.java?rev=398036&r1=398035&r2=398036&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/CreateTriggerConstantAction.java
(original)
+++ db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/CreateTriggerConstantAction.java
Fri Apr 28 16:24:45 2006
@@ -191,6 +191,21 @@
 
 		SchemaDescriptor triggerSd = getSchemaDescriptorForCreate(dd, activation, triggerSchemaName);
 
+		if (spsCompSchemaId == null) {
+			SchemaDescriptor def = lcc.getDefaultSchema();
+			if (def.getUUID() == null) {
+				// Descriptor for default schema is stale,
+				// look it up in the dictionary
+				def = dd.getSchemaDescriptor(def.getDescriptorName(), tc, 
+											 false);
+			}
+			spsCompSchemaId = def.getUUID();
+		}
+		if (SanityManager.DEBUG) { 
+			SanityManager.ASSERT(spsCompSchemaId != null,
+								 "spsCompSchemaId is null"); 
+		}
+
 		String tabName;
 		if (triggerTable != null)
 		{

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/triggerGeneral.out
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/triggerGeneral.out?rev=398036&r1=398035&r2=398036&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/triggerGeneral.out
(original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/triggerGeneral.out
Fri Apr 28 16:24:45 2006
@@ -1239,4 +1239,16 @@
 Running DERBY-388 Test.
 DERBY-388 Test Passed.
 0 rows inserted/updated/deleted
-ij> 
+ij> -- Derby-85: It turns out that if a table t1 exists in a non-default schema 
+-- and the default schema (e.g., "SOMEUSER") doesn't exist yet (because no 
+-- objects have been created in that schema), then attempts to create a 
+-- trigger on t1 using its qualified name will lead to a null pointer 
+-- exception in the Derby engine. 
+connect 'wombat;user=someuser';
+ij(CONNECTION1)> autocommit off;
+ij(CONNECTION1)> create table myschema.mytable (i int);
+0 rows inserted/updated/deleted
+ij(CONNECTION1)> create trigger mytrigger after update on myschema.mytable for each row
mode db2sql select * from sys.systables;
+0 rows inserted/updated/deleted
+ij(CONNECTION1)> rollback;
+ij(CONNECTION1)> 

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/triggerGeneral.sql
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/triggerGeneral.sql?rev=398036&r1=398035&r2=398036&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/triggerGeneral.sql
(original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/triggerGeneral.sql
Fri Apr 28 16:24:45 2006
@@ -591,3 +591,14 @@
 -- Just call the procedure; it will do the rest.
 call d388();
 
+-- Derby-85: It turns out that if a table t1 exists in a non-default schema 
+-- and the default schema (e.g., "SOMEUSER") doesn't exist yet (because no 
+-- objects have been created in that schema), then attempts to create a 
+-- trigger on t1 using its qualified name will lead to a null pointer 
+-- exception in the Derby engine. 
+connect 'wombat;user=someuser';
+autocommit off;
+create table myschema.mytable (i int);
+create trigger mytrigger after update on myschema.mytable for each row mode db2sql select
* from sys.systables;
+rollback;
+



Mime
View raw message