You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "mardacay (JIRA)" <de...@db.apache.org> on 2005/10/16 23:20:45 UTC

[jira] Created: (DERBY-630) create trigger fails with null pointer exception

create trigger fails with null pointer exception
------------------------------------------------

         Key: DERBY-630
         URL: http://issues.apache.org/jira/browse/DERBY-630
     Project: Derby
        Type: Bug
  Components: SQL  
    Versions: 10.1.1.0    
 Environment: windows 2000, sun jdk 1.5.0
    Reporter: mardacay


When i create a brand new database, and execute the following statements all in one transaction or each of them in their own transaction, then it fails at trigger creation with null pointer exception. if i exclude the schema names from statement, then it runs fine. (If S1 is ommited from every statement then it runs fine). Once the version without the schema names run fine, i can run the version that has schema names, fine also. 

create schema S1;

create table
  S1.PRODUCT(
    PRODUCT_ID VARCHAR(255) unique not null,
    VERSION BIGINT
  );
  
create table
  S1.CATEGORY(
    CAT_ID VARCHAR(255),
    NAME varchar(255) not null,
    VERSION BIGINT
  );

create table
  S1.PROD_IN_CAT(
    CAT_ID VARCHAR(255) not null,
    PRODUCT_ID VARCHAR(255) not null,
    VERSION BIGINT
  );
  
create trigger S1.product_v 
after update of version on S1.product
referencing new as n
for each row
mode db2sql
	update S1.prod_in_cat set version = n.version where S1.prod_in_cat.product_id=n.product_id;



java.lang.NullPointerException
	at org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(Unknown Source)
	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown Source)
	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(Unknown Source)
	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(Unknown Source)Stopping progress indicator for: Executing SQL

	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-630) create trigger fails with null pointer exception

Posted by "Mamta A. Satoor (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-630?page=comments#action_12332185 ] 

Mamta A. Satoor commented on DERBY-630:
---------------------------------------

This looks like duplicate of bug (DERBY-85) NPE when creating a trigger on a table and default schema doesn't exist. If that is correct, we should mark this bug as duplicate.

> create trigger fails with null pointer exception
> ------------------------------------------------
>
>          Key: DERBY-630
>          URL: http://issues.apache.org/jira/browse/DERBY-630
>      Project: Derby
>         Type: Bug
>   Components: SQL
>     Versions: 10.1.1.0
>  Environment: windows 2000, sun jdk 1.5.0
>     Reporter: mardacay

>
> When i create a brand new database, and execute the following statements all in one transaction or each of them in their own transaction, then it fails at trigger creation with null pointer exception. if i exclude the schema names from statement, then it runs fine. (If S1 is ommited from every statement then it runs fine). Once the version without the schema names run fine, i can run the version that has schema names, fine also. 
> create schema S1;
> create table
>   S1.PRODUCT(
>     PRODUCT_ID VARCHAR(255) unique not null,
>     VERSION BIGINT
>   );
>   
> create table
>   S1.CATEGORY(
>     CAT_ID VARCHAR(255),
>     NAME varchar(255) not null,
>     VERSION BIGINT
>   );
> create table
>   S1.PROD_IN_CAT(
>     CAT_ID VARCHAR(255) not null,
>     PRODUCT_ID VARCHAR(255) not null,
>     VERSION BIGINT
>   );
>   
> create trigger S1.product_v 
> after update of version on S1.product
> referencing new as n
> for each row
> mode db2sql
> 	update S1.prod_in_cat set version = n.version where S1.prod_in_cat.product_id=n.product_id;
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(Unknown Source)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(Unknown Source)Stopping progress indicator for: Executing SQL
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (DERBY-630) create trigger fails with null pointer exception

Posted by "Yip Ng (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-630?page=all ]

Yip Ng reassigned DERBY-630:
----------------------------

    Assignee: Yip Ng

> create trigger fails with null pointer exception
> ------------------------------------------------
>
>                 Key: DERBY-630
>                 URL: http://issues.apache.org/jira/browse/DERBY-630
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0
>         Environment: windows 2000, sun jdk 1.5.0
>            Reporter: mardacay
>         Assigned To: Yip Ng
>
> When i create a brand new database, and execute the following statements all in one transaction or each of them in their own transaction, then it fails at trigger creation with null pointer exception. if i exclude the schema names from statement, then it runs fine. (If S1 is ommited from every statement then it runs fine). Once the version without the schema names run fine, i can run the version that has schema names, fine also. 
> create schema S1;
> create table
>   S1.PRODUCT(
>     PRODUCT_ID VARCHAR(255) unique not null,
>     VERSION BIGINT
>   );
>   
> create table
>   S1.CATEGORY(
>     CAT_ID VARCHAR(255),
>     NAME varchar(255) not null,
>     VERSION BIGINT
>   );
> create table
>   S1.PROD_IN_CAT(
>     CAT_ID VARCHAR(255) not null,
>     PRODUCT_ID VARCHAR(255) not null,
>     VERSION BIGINT
>   );
>   
> create trigger S1.product_v 
> after update of version on S1.product
> referencing new as n
> for each row
> mode db2sql
> 	update S1.prod_in_cat set version = n.version where S1.prod_in_cat.product_id=n.product_id;
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(Unknown Source)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(Unknown Source)Stopping progress indicator for: Executing SQL
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DERBY-630) create trigger fails with null pointer exception

Posted by "Bryan Pendleton (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-630?page=comments#action_12441596 ] 
            
Bryan Pendleton commented on DERBY-630:
---------------------------------------

Hi Yip, sorry I kind of lost track of this issue. Your explanation of the schema
handling seems reasonable to me. I intend to commit this patch.

If anybody else is reviewing this change, please let us know.


> create trigger fails with null pointer exception
> ------------------------------------------------
>
>                 Key: DERBY-630
>                 URL: http://issues.apache.org/jira/browse/DERBY-630
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0
>         Environment: windows 2000, sun jdk 1.5.0
>            Reporter: mardacay
>         Assigned To: Yip Ng
>         Attachments: derby630-trunk-diff01.txt, derby630-trunk-stat01.txt
>
>
> When i create a brand new database, and execute the following statements all in one transaction or each of them in their own transaction, then it fails at trigger creation with null pointer exception. if i exclude the schema names from statement, then it runs fine. (If S1 is ommited from every statement then it runs fine). Once the version without the schema names run fine, i can run the version that has schema names, fine also. 
> create schema S1;
> create table
>   S1.PRODUCT(
>     PRODUCT_ID VARCHAR(255) unique not null,
>     VERSION BIGINT
>   );
>   
> create table
>   S1.CATEGORY(
>     CAT_ID VARCHAR(255),
>     NAME varchar(255) not null,
>     VERSION BIGINT
>   );
> create table
>   S1.PROD_IN_CAT(
>     CAT_ID VARCHAR(255) not null,
>     PRODUCT_ID VARCHAR(255) not null,
>     VERSION BIGINT
>   );
>   
> create trigger S1.product_v 
> after update of version on S1.product
> referencing new as n
> for each row
> mode db2sql
> 	update S1.prod_in_cat set version = n.version where S1.prod_in_cat.product_id=n.product_id;
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(Unknown Source)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(Unknown Source)Stopping progress indicator for: Executing SQL
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DERBY-630) create trigger fails with null pointer exception

Posted by "Yip Ng (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-630?page=comments#action_12438834 ] 
            
Yip Ng commented on DERBY-630:
------------------------------

At execution time, it looks like CREATE TRIGGER expects a compilation schema UUID to be available.  Since the above example did not use the schema APP (which already exists after db creation time), the schema "someUser" is not created physically yet, so there won't be any UUID available.  When trying to retrieve its
schema descriptor from the data dictionary, getSchemaDescriptor will return null, so trying to access the
UUID will ultimately result in NPE.

CREATE VIEW also suffers from this problem wth regards to compilation schema.  From looking at the code, it seems it is possible for the non-nullable column COMPILATIONSCHEMAID in SYS.SYSVIEWS to have SQL NULL value.  So to confirm this, I tried the following script on ij:

> connect 'jdbc:derby:wombat;create=true;user=user2;password=pwd' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> ij(USER2)> create table ippo.t1 (i int);
> 0 rows inserted/updated/deleted
> ij(USER2)> create table ippo.t2 (i int);
> 0 rows inserted/updated/deleted
> ij(USER2)> create view ippo.v1(i) as values 1;
> 0 rows inserted/updated/deleted
> ij(USER2)> -- should return 0 row, as SYS.SYSVIEWS.COMPILATIONSCHEMAID column is not nullable
> select t.tablename, v.compilationschemaid
>    from sys.systables t, sys.sysviews v
>    where t.tableid = v.tableid and t.tablename='V1' and v.compilationschemaid is null;
> TABLENAME    |COMPILATIONSCHEMAID
> ------------------------------------------------------------------------------
> V1                       |NULL

ij> describe sys.sysviews;
COLUMN_NAME                 |TYPE_NAME|DEC&|NUM&|COLUM&|COLUMN_DEF|CHAR_OCTE&|IS_NULL&
------------------------------------------------------------------------------
TABLEID                                |CHAR           |NULL|NULL  |36             |NULL                 |72                      |NO
VIEWDEFINITION                |LONG VAR&|NULL|NULL  |32700      |NULL                 |NULL                |NO
CHECKOPTION                   |CHAR           |NULL|NULL  |1               |NULL                 |2                         |NO
COMPILATIONSCHEMAID |CHAR           |NULL|NULL  |36             |NULL                 |72                      |NO
4 rows selected

So the above script shows that CREATE VIEW also have a problem.




> create trigger fails with null pointer exception
> ------------------------------------------------
>
>                 Key: DERBY-630
>                 URL: http://issues.apache.org/jira/browse/DERBY-630
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0
>         Environment: windows 2000, sun jdk 1.5.0
>            Reporter: mardacay
>
> When i create a brand new database, and execute the following statements all in one transaction or each of them in their own transaction, then it fails at trigger creation with null pointer exception. if i exclude the schema names from statement, then it runs fine. (If S1 is ommited from every statement then it runs fine). Once the version without the schema names run fine, i can run the version that has schema names, fine also. 
> create schema S1;
> create table
>   S1.PRODUCT(
>     PRODUCT_ID VARCHAR(255) unique not null,
>     VERSION BIGINT
>   );
>   
> create table
>   S1.CATEGORY(
>     CAT_ID VARCHAR(255),
>     NAME varchar(255) not null,
>     VERSION BIGINT
>   );
> create table
>   S1.PROD_IN_CAT(
>     CAT_ID VARCHAR(255) not null,
>     PRODUCT_ID VARCHAR(255) not null,
>     VERSION BIGINT
>   );
>   
> create trigger S1.product_v 
> after update of version on S1.product
> referencing new as n
> for each row
> mode db2sql
> 	update S1.prod_in_cat set version = n.version where S1.prod_in_cat.product_id=n.product_id;
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(Unknown Source)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(Unknown Source)Stopping progress indicator for: Executing SQL
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (DERBY-630) create trigger fails with null pointer exception

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-630?page=all ]
     
Kathey Marsden closed DERBY-630:
--------------------------------


dup of DERBY-85 which is In Progress

> create trigger fails with null pointer exception
> ------------------------------------------------
>
>          Key: DERBY-630
>          URL: http://issues.apache.org/jira/browse/DERBY-630
>      Project: Derby
>         Type: Bug
>   Components: SQL
>     Versions: 10.1.1.0
>  Environment: windows 2000, sun jdk 1.5.0
>     Reporter: mardacay

>
> When i create a brand new database, and execute the following statements all in one transaction or each of them in their own transaction, then it fails at trigger creation with null pointer exception. if i exclude the schema names from statement, then it runs fine. (If S1 is ommited from every statement then it runs fine). Once the version without the schema names run fine, i can run the version that has schema names, fine also. 
> create schema S1;
> create table
>   S1.PRODUCT(
>     PRODUCT_ID VARCHAR(255) unique not null,
>     VERSION BIGINT
>   );
>   
> create table
>   S1.CATEGORY(
>     CAT_ID VARCHAR(255),
>     NAME varchar(255) not null,
>     VERSION BIGINT
>   );
> create table
>   S1.PROD_IN_CAT(
>     CAT_ID VARCHAR(255) not null,
>     PRODUCT_ID VARCHAR(255) not null,
>     VERSION BIGINT
>   );
>   
> create trigger S1.product_v 
> after update of version on S1.product
> referencing new as n
> for each row
> mode db2sql
> 	update S1.prod_in_cat set version = n.version where S1.prod_in_cat.product_id=n.product_id;
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(Unknown Source)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(Unknown Source)Stopping progress indicator for: Executing SQL
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-630) create trigger fails with null pointer exception

Posted by "Yip Ng (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-630?page=comments#action_12441257 ] 
            
Yip Ng commented on DERBY-630:
------------------------------

Anyone else have a chance to try out and review the patch for this issue?

> create trigger fails with null pointer exception
> ------------------------------------------------
>
>                 Key: DERBY-630
>                 URL: http://issues.apache.org/jira/browse/DERBY-630
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0
>         Environment: windows 2000, sun jdk 1.5.0
>            Reporter: mardacay
>         Assigned To: Yip Ng
>         Attachments: derby630-trunk-diff01.txt, derby630-trunk-stat01.txt
>
>
> When i create a brand new database, and execute the following statements all in one transaction or each of them in their own transaction, then it fails at trigger creation with null pointer exception. if i exclude the schema names from statement, then it runs fine. (If S1 is ommited from every statement then it runs fine). Once the version without the schema names run fine, i can run the version that has schema names, fine also. 
> create schema S1;
> create table
>   S1.PRODUCT(
>     PRODUCT_ID VARCHAR(255) unique not null,
>     VERSION BIGINT
>   );
>   
> create table
>   S1.CATEGORY(
>     CAT_ID VARCHAR(255),
>     NAME varchar(255) not null,
>     VERSION BIGINT
>   );
> create table
>   S1.PROD_IN_CAT(
>     CAT_ID VARCHAR(255) not null,
>     PRODUCT_ID VARCHAR(255) not null,
>     VERSION BIGINT
>   );
>   
> create trigger S1.product_v 
> after update of version on S1.product
> referencing new as n
> for each row
> mode db2sql
> 	update S1.prod_in_cat set version = n.version where S1.prod_in_cat.product_id=n.product_id;
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(Unknown Source)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(Unknown Source)Stopping progress indicator for: Executing SQL
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (DERBY-630) create trigger fails with null pointer exception

Posted by "Yip Ng (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-630?page=all ]

Yip Ng updated DERBY-630:
-------------------------

    Derby Info: [Patch Available]

> create trigger fails with null pointer exception
> ------------------------------------------------
>
>                 Key: DERBY-630
>                 URL: http://issues.apache.org/jira/browse/DERBY-630
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0
>         Environment: windows 2000, sun jdk 1.5.0
>            Reporter: mardacay
>         Assigned To: Yip Ng
>         Attachments: derby630-trunk-diff01.txt, derby630-trunk-stat01.txt
>
>
> When i create a brand new database, and execute the following statements all in one transaction or each of them in their own transaction, then it fails at trigger creation with null pointer exception. if i exclude the schema names from statement, then it runs fine. (If S1 is ommited from every statement then it runs fine). Once the version without the schema names run fine, i can run the version that has schema names, fine also. 
> create schema S1;
> create table
>   S1.PRODUCT(
>     PRODUCT_ID VARCHAR(255) unique not null,
>     VERSION BIGINT
>   );
>   
> create table
>   S1.CATEGORY(
>     CAT_ID VARCHAR(255),
>     NAME varchar(255) not null,
>     VERSION BIGINT
>   );
> create table
>   S1.PROD_IN_CAT(
>     CAT_ID VARCHAR(255) not null,
>     PRODUCT_ID VARCHAR(255) not null,
>     VERSION BIGINT
>   );
>   
> create trigger S1.product_v 
> after update of version on S1.product
> referencing new as n
> for each row
> mode db2sql
> 	update S1.prod_in_cat set version = n.version where S1.prod_in_cat.product_id=n.product_id;
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(Unknown Source)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(Unknown Source)Stopping progress indicator for: Executing SQL
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (DERBY-630) create trigger fails with null pointer exception

Posted by "Yip Ng (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-630?page=all ]

Yip Ng updated DERBY-630:
-------------------------

    Attachment: derby630-trunk-stat02.txt
                derby630-trunk-diff02.txt

Attaching derby630-trunk-diff02.txt.  This patch contains the automated upgrade test from 10.1 to 10.3.  Running derbyall now, will post result when it completes.

> create trigger fails with null pointer exception
> ------------------------------------------------
>
>                 Key: DERBY-630
>                 URL: http://issues.apache.org/jira/browse/DERBY-630
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0
>         Environment: windows 2000, sun jdk 1.5.0
>            Reporter: mardacay
>         Assigned To: Yip Ng
>         Attachments: derby630-trunk-diff01.txt, derby630-trunk-diff02.txt, derby630-trunk-stat01.txt, derby630-trunk-stat02.txt
>
>
> When i create a brand new database, and execute the following statements all in one transaction or each of them in their own transaction, then it fails at trigger creation with null pointer exception. if i exclude the schema names from statement, then it runs fine. (If S1 is ommited from every statement then it runs fine). Once the version without the schema names run fine, i can run the version that has schema names, fine also. 
> create schema S1;
> create table
>   S1.PRODUCT(
>     PRODUCT_ID VARCHAR(255) unique not null,
>     VERSION BIGINT
>   );
>   
> create table
>   S1.CATEGORY(
>     CAT_ID VARCHAR(255),
>     NAME varchar(255) not null,
>     VERSION BIGINT
>   );
> create table
>   S1.PROD_IN_CAT(
>     CAT_ID VARCHAR(255) not null,
>     PRODUCT_ID VARCHAR(255) not null,
>     VERSION BIGINT
>   );
>   
> create trigger S1.product_v 
> after update of version on S1.product
> referencing new as n
> for each row
> mode db2sql
> 	update S1.prod_in_cat set version = n.version where S1.prod_in_cat.product_id=n.product_id;
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(Unknown Source)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(Unknown Source)Stopping progress indicator for: Executing SQL
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (DERBY-630) create trigger fails with null pointer exception

Posted by "Bryan Pendleton (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-630?page=all ]

Bryan Pendleton resolved DERBY-630.
-----------------------------------

    Fix Version/s: 10.3.0.0
       Resolution: Fixed
       Derby Info:   (was: [Patch Available])

Thanks Yip and Deepa for the info on the upgrade testing infrastructure. I think
everything is good to go here, so I committed patch diff02 to subversion as
revision 464215.

Thanks Yip for all the patches and explanations. Can you verify that the fix looks
good and close this issue? 

Also, you made a comment about needing to file a follow-on issue to track the
improvement of the statement cache mechanism to avoid unnecessary
statement compilation. Did that follow-on issue get filed? If so, it would be
nice to link that issue to this one.

> create trigger fails with null pointer exception
> ------------------------------------------------
>
>                 Key: DERBY-630
>                 URL: http://issues.apache.org/jira/browse/DERBY-630
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0
>         Environment: windows 2000, sun jdk 1.5.0
>            Reporter: mardacay
>         Assigned To: Yip Ng
>             Fix For: 10.3.0.0
>
>         Attachments: derby630-trunk-diff01.txt, derby630-trunk-diff02.txt, derby630-trunk-stat01.txt, derby630-trunk-stat02.txt
>
>
> When i create a brand new database, and execute the following statements all in one transaction or each of them in their own transaction, then it fails at trigger creation with null pointer exception. if i exclude the schema names from statement, then it runs fine. (If S1 is ommited from every statement then it runs fine). Once the version without the schema names run fine, i can run the version that has schema names, fine also. 
> create schema S1;
> create table
>   S1.PRODUCT(
>     PRODUCT_ID VARCHAR(255) unique not null,
>     VERSION BIGINT
>   );
>   
> create table
>   S1.CATEGORY(
>     CAT_ID VARCHAR(255),
>     NAME varchar(255) not null,
>     VERSION BIGINT
>   );
> create table
>   S1.PROD_IN_CAT(
>     CAT_ID VARCHAR(255) not null,
>     PRODUCT_ID VARCHAR(255) not null,
>     VERSION BIGINT
>   );
>   
> create trigger S1.product_v 
> after update of version on S1.product
> referencing new as n
> for each row
> mode db2sql
> 	update S1.prod_in_cat set version = n.version where S1.prod_in_cat.product_id=n.product_id;
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(Unknown Source)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(Unknown Source)Stopping progress indicator for: Executing SQL
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DERBY-630) create trigger fails with null pointer exception

Posted by "Yip Ng (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-630?page=comments#action_12442412 ] 
            
Yip Ng commented on DERBY-630:
------------------------------

Hi Bryan, I opened DERBY-1960 for the second part of the proposal.  Thanks for committing the patch.
One question though, will this patch be back ported to 10.2 line?  I think the current patch cannot be apply 
to the 10.2 line since it involves data dictionary upgrade.

> create trigger fails with null pointer exception
> ------------------------------------------------
>
>                 Key: DERBY-630
>                 URL: http://issues.apache.org/jira/browse/DERBY-630
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0
>         Environment: windows 2000, sun jdk 1.5.0
>            Reporter: mardacay
>         Assigned To: Yip Ng
>             Fix For: 10.3.0.0
>
>         Attachments: derby630-trunk-diff01.txt, derby630-trunk-diff02.txt, derby630-trunk-stat01.txt, derby630-trunk-stat02.txt
>
>
> When i create a brand new database, and execute the following statements all in one transaction or each of them in their own transaction, then it fails at trigger creation with null pointer exception. if i exclude the schema names from statement, then it runs fine. (If S1 is ommited from every statement then it runs fine). Once the version without the schema names run fine, i can run the version that has schema names, fine also. 
> create schema S1;
> create table
>   S1.PRODUCT(
>     PRODUCT_ID VARCHAR(255) unique not null,
>     VERSION BIGINT
>   );
>   
> create table
>   S1.CATEGORY(
>     CAT_ID VARCHAR(255),
>     NAME varchar(255) not null,
>     VERSION BIGINT
>   );
> create table
>   S1.PROD_IN_CAT(
>     CAT_ID VARCHAR(255) not null,
>     PRODUCT_ID VARCHAR(255) not null,
>     VERSION BIGINT
>   );
>   
> create trigger S1.product_v 
> after update of version on S1.product
> referencing new as n
> for each row
> mode db2sql
> 	update S1.prod_in_cat set version = n.version where S1.prod_in_cat.product_id=n.product_id;
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(Unknown Source)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(Unknown Source)Stopping progress indicator for: Executing SQL
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DERBY-630) create trigger fails with null pointer exception

Posted by "Yip Ng (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-630?page=comments#action_12441883 ] 
            
Yip Ng commented on DERBY-630:
------------------------------

Hmm...  I cannot seem to attach file to this jira as well:

Exception trying to establish attachment directory. Check that the application server and JIRA have permissions to write to it: com.atlassian.jira.web.util.AttachmentException: Cannot write to attachment directory. Check that the application server and JIRA have permissions to write to: /usr/local/tomcat/tomcat-jira/attachments/DERBY/DERBY-630

> create trigger fails with null pointer exception
> ------------------------------------------------
>
>                 Key: DERBY-630
>                 URL: http://issues.apache.org/jira/browse/DERBY-630
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0
>         Environment: windows 2000, sun jdk 1.5.0
>            Reporter: mardacay
>         Assigned To: Yip Ng
>         Attachments: derby630-trunk-diff01.txt, derby630-trunk-stat01.txt
>
>
> When i create a brand new database, and execute the following statements all in one transaction or each of them in their own transaction, then it fails at trigger creation with null pointer exception. if i exclude the schema names from statement, then it runs fine. (If S1 is ommited from every statement then it runs fine). Once the version without the schema names run fine, i can run the version that has schema names, fine also. 
> create schema S1;
> create table
>   S1.PRODUCT(
>     PRODUCT_ID VARCHAR(255) unique not null,
>     VERSION BIGINT
>   );
>   
> create table
>   S1.CATEGORY(
>     CAT_ID VARCHAR(255),
>     NAME varchar(255) not null,
>     VERSION BIGINT
>   );
> create table
>   S1.PROD_IN_CAT(
>     CAT_ID VARCHAR(255) not null,
>     PRODUCT_ID VARCHAR(255) not null,
>     VERSION BIGINT
>   );
>   
> create trigger S1.product_v 
> after update of version on S1.product
> referencing new as n
> for each row
> mode db2sql
> 	update S1.prod_in_cat set version = n.version where S1.prod_in_cat.product_id=n.product_id;
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(Unknown Source)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(Unknown Source)Stopping progress indicator for: Executing SQL
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DERBY-630) create trigger fails with null pointer exception

Posted by "Yip Ng (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-630?page=comments#action_12442368 ] 
            
Yip Ng commented on DERBY-630:
------------------------------

Hi Bryan.  Thanks for your continous review of the patches.  

If DERBY-1689 is still using the same upgrade test infrastructure, then this patch shouldn't make it harder to address the upgrade issue for 10.3.  

This patch has already activated the upgrade test for 10.1 to 10.3.  To enable 10.2 to 10.3 upgrade test as described in DERBY-1689, the 10.2 release jars needs to be check-in to the trunk code line first.


> create trigger fails with null pointer exception
> ------------------------------------------------
>
>                 Key: DERBY-630
>                 URL: http://issues.apache.org/jira/browse/DERBY-630
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0
>         Environment: windows 2000, sun jdk 1.5.0
>            Reporter: mardacay
>         Assigned To: Yip Ng
>         Attachments: derby630-trunk-diff01.txt, derby630-trunk-diff02.txt, derby630-trunk-stat01.txt, derby630-trunk-stat02.txt
>
>
> When i create a brand new database, and execute the following statements all in one transaction or each of them in their own transaction, then it fails at trigger creation with null pointer exception. if i exclude the schema names from statement, then it runs fine. (If S1 is ommited from every statement then it runs fine). Once the version without the schema names run fine, i can run the version that has schema names, fine also. 
> create schema S1;
> create table
>   S1.PRODUCT(
>     PRODUCT_ID VARCHAR(255) unique not null,
>     VERSION BIGINT
>   );
>   
> create table
>   S1.CATEGORY(
>     CAT_ID VARCHAR(255),
>     NAME varchar(255) not null,
>     VERSION BIGINT
>   );
> create table
>   S1.PROD_IN_CAT(
>     CAT_ID VARCHAR(255) not null,
>     PRODUCT_ID VARCHAR(255) not null,
>     VERSION BIGINT
>   );
>   
> create trigger S1.product_v 
> after update of version on S1.product
> referencing new as n
> for each row
> mode db2sql
> 	update S1.prod_in_cat set version = n.version where S1.prod_in_cat.product_id=n.product_id;
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(Unknown Source)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(Unknown Source)Stopping progress indicator for: Executing SQL
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (DERBY-630) create trigger fails with null pointer exception

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-630?page=all ]
     
Kathey Marsden resolved DERBY-630:
----------------------------------

    Resolution: Duplicate

Looks like a Duplicate of DERBY-85

> create trigger fails with null pointer exception
> ------------------------------------------------
>
>          Key: DERBY-630
>          URL: http://issues.apache.org/jira/browse/DERBY-630
>      Project: Derby
>         Type: Bug
>   Components: SQL
>     Versions: 10.1.1.0
>  Environment: windows 2000, sun jdk 1.5.0
>     Reporter: mardacay

>
> When i create a brand new database, and execute the following statements all in one transaction or each of them in their own transaction, then it fails at trigger creation with null pointer exception. if i exclude the schema names from statement, then it runs fine. (If S1 is ommited from every statement then it runs fine). Once the version without the schema names run fine, i can run the version that has schema names, fine also. 
> create schema S1;
> create table
>   S1.PRODUCT(
>     PRODUCT_ID VARCHAR(255) unique not null,
>     VERSION BIGINT
>   );
>   
> create table
>   S1.CATEGORY(
>     CAT_ID VARCHAR(255),
>     NAME varchar(255) not null,
>     VERSION BIGINT
>   );
> create table
>   S1.PROD_IN_CAT(
>     CAT_ID VARCHAR(255) not null,
>     PRODUCT_ID VARCHAR(255) not null,
>     VERSION BIGINT
>   );
>   
> create trigger S1.product_v 
> after update of version on S1.product
> referencing new as n
> for each row
> mode db2sql
> 	update S1.prod_in_cat set version = n.version where S1.prod_in_cat.product_id=n.product_id;
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(Unknown Source)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(Unknown Source)Stopping progress indicator for: Executing SQL
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-630) create trigger fails with null pointer exception

Posted by "Bryan Pendleton (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-630?page=comments#action_12439540 ] 
            
Bryan Pendleton commented on DERBY-630:
---------------------------------------

Is a null schema the same as an implicit schema? Or is there a different concept being discussed here?

> create trigger fails with null pointer exception
> ------------------------------------------------
>
>                 Key: DERBY-630
>                 URL: http://issues.apache.org/jira/browse/DERBY-630
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0
>         Environment: windows 2000, sun jdk 1.5.0
>            Reporter: mardacay
>         Assigned To: Yip Ng
>         Attachments: derby630-trunk-diff01.txt, derby630-trunk-stat01.txt
>
>
> When i create a brand new database, and execute the following statements all in one transaction or each of them in their own transaction, then it fails at trigger creation with null pointer exception. if i exclude the schema names from statement, then it runs fine. (If S1 is ommited from every statement then it runs fine). Once the version without the schema names run fine, i can run the version that has schema names, fine also. 
> create schema S1;
> create table
>   S1.PRODUCT(
>     PRODUCT_ID VARCHAR(255) unique not null,
>     VERSION BIGINT
>   );
>   
> create table
>   S1.CATEGORY(
>     CAT_ID VARCHAR(255),
>     NAME varchar(255) not null,
>     VERSION BIGINT
>   );
> create table
>   S1.PROD_IN_CAT(
>     CAT_ID VARCHAR(255) not null,
>     PRODUCT_ID VARCHAR(255) not null,
>     VERSION BIGINT
>   );
>   
> create trigger S1.product_v 
> after update of version on S1.product
> referencing new as n
> for each row
> mode db2sql
> 	update S1.prod_in_cat set version = n.version where S1.prod_in_cat.product_id=n.product_id;
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(Unknown Source)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(Unknown Source)Stopping progress indicator for: Executing SQL
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Reopened: (DERBY-630) create trigger fails with null pointer exception

Posted by "Susan Cline (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-630?page=all ]
     
Susan Cline reopened DERBY-630:
-------------------------------


DERBY-630 is listed as a duplicate of DERBY-85 and was marked fixed in release 10.1.3, however, I believe it is not a duplicate, and although DERBY-85 is fixed in 10.1.3, DERBY-630 is not.

the test case for DERBY-85 consists of this:

creates a table in the non-default schema 
creates a trigger in the default schema on a table in the non-default schema.

the test case for DERBY-630 consists of this:

creates a table in the non-default schema 
creates a trigger in the non-default schema on a table in the non-default schema

Below is the output from the two test cases run against the 10.1.3 release,
plus an additional one that shows creating a table in the default schema, then a trigger in the default schema on the table in the default schema does succeed.


DERBY- 85:

ij> connect 'jdbc:derby:firstDB;create=true;user=someUser;password=somePwd'; 
ij> create table itko.t1 (i int); 
0 rows inserted/updated/deleted 
ij> create trigger trig1 after update on itko.t1 for each row mode db2sql select 
* from sys.systables; 
0 rows inserted/updated/deleted 

DERBY-630 (simplified test case):

ij> connect 'jdbc:derby:myDB;create=true;user=someUser;password=somePwd'; 
ij> create table itko.t1 (i int); 
0 rows inserted/updated/deleted 
ij> create trigger itko.trig1 after update on itko.t1 for each row mode db2sql s 
elect * from sys.systables; 
ERROR XJ001: Java exception: ': java.lang.NullPointerException'. 

Test case showing creating everything in the default schema is OK:

ij> connect 'jdbc:derby:newDB;create=true;user=someUser;password=somePwd'; 
ij> create table t1 (i int); 
0 rows inserted/updated/deleted 
ij> create trigger trig1 after update on t1 for each row mode db2sql select * fr 
om sys.systables; 
0 rows inserted/updated/deleted 

Sysinfo:

java org.apache.derby.tools.sysinfo
------------------ Java Information ------------------
Java Version:    1.5.0_06
Java Vendor:     Sun Microsystems Inc.
Java home:       C:\JDK\jdk1.5.0_06\jre
Java classpath:  derby.jar;.;derbytools.jar;
OS name:         Windows XP
OS architecture: x86
OS version:      5.1
Java user name:  slc
Java user home:  C:\Documents and Settings\Administrator
Java user dir:   C:\projects\gilles_tool\releases\Nov_refresh\installs\db-derby-
10.1.3.1-lib\lib
java.specification.name: Java Platform API Specification
java.specification.version: 1.5
--------- Derby Information --------
JRE - JDBC: J2SE 5.0 - JDBC 3.0
[C:\projects\gilles_tool\releases\Nov_refresh\installs\db-derby-10.1.3.1-lib\lib
\derby.jar] 10.1.3.1 - (417277)
[C:\projects\gilles_tool\releases\Nov_refresh\installs\db-derby-10.1.3.1-lib\lib
\derbytools.jar] 10.1.3.1 - (417277)
------------------------------------------------------
----------------- Locale Information -----------------
------------------------------------------------------


> create trigger fails with null pointer exception
> ------------------------------------------------
>
>          Key: DERBY-630
>          URL: http://issues.apache.org/jira/browse/DERBY-630
>      Project: Derby
>         Type: Bug

>   Components: SQL
>     Versions: 10.1.1.0
>  Environment: windows 2000, sun jdk 1.5.0
>     Reporter: mardacay

>
> When i create a brand new database, and execute the following statements all in one transaction or each of them in their own transaction, then it fails at trigger creation with null pointer exception. if i exclude the schema names from statement, then it runs fine. (If S1 is ommited from every statement then it runs fine). Once the version without the schema names run fine, i can run the version that has schema names, fine also. 
> create schema S1;
> create table
>   S1.PRODUCT(
>     PRODUCT_ID VARCHAR(255) unique not null,
>     VERSION BIGINT
>   );
>   
> create table
>   S1.CATEGORY(
>     CAT_ID VARCHAR(255),
>     NAME varchar(255) not null,
>     VERSION BIGINT
>   );
> create table
>   S1.PROD_IN_CAT(
>     CAT_ID VARCHAR(255) not null,
>     PRODUCT_ID VARCHAR(255) not null,
>     VERSION BIGINT
>   );
>   
> create trigger S1.product_v 
> after update of version on S1.product
> referencing new as n
> for each row
> mode db2sql
> 	update S1.prod_in_cat set version = n.version where S1.prod_in_cat.product_id=n.product_id;
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(Unknown Source)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(Unknown Source)Stopping progress indicator for: Executing SQL
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-630) create trigger fails with null pointer exception

Posted by "Yip Ng (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-630?page=comments#action_12439569 ] 
            
Yip Ng commented on DERBY-630:
------------------------------

Hi Bryan.  An implicit schema is not the same as a null compilation schema that I described.  An implicit schema or current schema, as we see in DERBY-85:

<snip>
ij> connect 'jdbc:derby:firstDB;create=true;user=someUser;password=somePwd';
ij> create table itko.t1 (i int);
0 rows inserted/updated/deleted
ij> create trigger trig1 after update on itko.t1 for each row mode db2sql select * from sys.systables; 
</snip>

will have a compilation schema 'someUser' (the trigger name is not qualified with a schema name, so it will use the current schema, 'someUser' which will be implicitly created at execution time).

DERBY-630 poses a different problem where the current schema is not explicitly or implicitly created.  

<snip>
ij> connect 'jdbc:derby:myDB;create=true;user=someUser;password=somePwd';
ij> create table itko.t1 (i int);
0 rows inserted/updated/deleted
ij> create trigger itko.trig1 after update on itko.t1 for each row mode db2sql select * from sys.systables; 
</snip>

So this is one edge case where the compilation schema can be null since the current schema is not physically created yet, so the spsCompSchemaId is null.  At the CREATE TRIGGER execution time, it
attempts to locate the CURRENT SCHEMA via the data dictionary but this will ultimately return null.  
Hence, when attempting to retrieve its UUID, NPE occurs. 

A compilation schema can also be set to null if the statement text does not have dependencies on the CURRENT SCHEMA but this logic does not seem to be implemented yet in Derby.  There are some
comments in the code but the actual implementation logic is incomplete.  The latter case can benefit statement cache plan sharing across connections in different schema.  The compilation schema is
used as an identity part for the statement.



> create trigger fails with null pointer exception
> ------------------------------------------------
>
>                 Key: DERBY-630
>                 URL: http://issues.apache.org/jira/browse/DERBY-630
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0
>         Environment: windows 2000, sun jdk 1.5.0
>            Reporter: mardacay
>         Assigned To: Yip Ng
>         Attachments: derby630-trunk-diff01.txt, derby630-trunk-stat01.txt
>
>
> When i create a brand new database, and execute the following statements all in one transaction or each of them in their own transaction, then it fails at trigger creation with null pointer exception. if i exclude the schema names from statement, then it runs fine. (If S1 is ommited from every statement then it runs fine). Once the version without the schema names run fine, i can run the version that has schema names, fine also. 
> create schema S1;
> create table
>   S1.PRODUCT(
>     PRODUCT_ID VARCHAR(255) unique not null,
>     VERSION BIGINT
>   );
>   
> create table
>   S1.CATEGORY(
>     CAT_ID VARCHAR(255),
>     NAME varchar(255) not null,
>     VERSION BIGINT
>   );
> create table
>   S1.PROD_IN_CAT(
>     CAT_ID VARCHAR(255) not null,
>     PRODUCT_ID VARCHAR(255) not null,
>     VERSION BIGINT
>   );
>   
> create trigger S1.product_v 
> after update of version on S1.product
> referencing new as n
> for each row
> mode db2sql
> 	update S1.prod_in_cat set version = n.version where S1.prod_in_cat.product_id=n.product_id;
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(Unknown Source)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(Unknown Source)Stopping progress indicator for: Executing SQL
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DERBY-630) create trigger fails with null pointer exception

Posted by "Yip Ng (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-630?page=comments#action_12442102 ] 
            
Yip Ng commented on DERBY-630:
------------------------------

derbyall passes with patch derby630-trunk-diff02.txt.

> create trigger fails with null pointer exception
> ------------------------------------------------
>
>                 Key: DERBY-630
>                 URL: http://issues.apache.org/jira/browse/DERBY-630
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0
>         Environment: windows 2000, sun jdk 1.5.0
>            Reporter: mardacay
>         Assigned To: Yip Ng
>         Attachments: derby630-trunk-diff01.txt, derby630-trunk-diff02.txt, derby630-trunk-stat01.txt, derby630-trunk-stat02.txt
>
>
> When i create a brand new database, and execute the following statements all in one transaction or each of them in their own transaction, then it fails at trigger creation with null pointer exception. if i exclude the schema names from statement, then it runs fine. (If S1 is ommited from every statement then it runs fine). Once the version without the schema names run fine, i can run the version that has schema names, fine also. 
> create schema S1;
> create table
>   S1.PRODUCT(
>     PRODUCT_ID VARCHAR(255) unique not null,
>     VERSION BIGINT
>   );
>   
> create table
>   S1.CATEGORY(
>     CAT_ID VARCHAR(255),
>     NAME varchar(255) not null,
>     VERSION BIGINT
>   );
> create table
>   S1.PROD_IN_CAT(
>     CAT_ID VARCHAR(255) not null,
>     PRODUCT_ID VARCHAR(255) not null,
>     VERSION BIGINT
>   );
>   
> create trigger S1.product_v 
> after update of version on S1.product
> referencing new as n
> for each row
> mode db2sql
> 	update S1.prod_in_cat set version = n.version where S1.prod_in_cat.product_id=n.product_id;
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(Unknown Source)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(Unknown Source)Stopping progress indicator for: Executing SQL
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DERBY-630) create trigger fails with null pointer exception

Posted by "Yip Ng (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-630?page=comments#action_12439330 ] 
            
Yip Ng commented on DERBY-630:
------------------------------

I think to properly address this issue, the current implementation for CREATE TRIGGER needs 
to handle null compilation schema.  A compilation schema with null value indicates that the 
trigger action statement text does not depend on the current schema.  This means:

1.  It is safe to compile this statement in any schema since there is no dependency with 
    the CURRENT SCHEMA.  i.e.:  All relevent fields are qualified with a specific schema.

2.  The statement cache mechanism can utilize this piece of information to enable 
    better statement plan sharing across different schemas; thus, avoiding unnecessary 
    statement compilation.  

 
So the proposal is:

a) Allow null compilation schema.  The system catalog first needs to change the 
   compiliation schema id column of SYS.SYSSTATEMENTS and SYS.SYSVIEWS system 
   table's nullability to true.  This would also require a soft upgrade for the 
   previous versions of Derby.  This step will resolve the NPE problem of this jira.

b) Handle null compilation schema in statement preparation logic.  This can be filed
   as a separate jira as improvement.  It may require some work on the SQL parser to 
   determine whether the compiled statement depends on the CURRENT SCHEMA or not, so 
   that the compilation schema can be properly set.


> create trigger fails with null pointer exception
> ------------------------------------------------
>
>                 Key: DERBY-630
>                 URL: http://issues.apache.org/jira/browse/DERBY-630
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0
>         Environment: windows 2000, sun jdk 1.5.0
>            Reporter: mardacay
>         Assigned To: Yip Ng
>
> When i create a brand new database, and execute the following statements all in one transaction or each of them in their own transaction, then it fails at trigger creation with null pointer exception. if i exclude the schema names from statement, then it runs fine. (If S1 is ommited from every statement then it runs fine). Once the version without the schema names run fine, i can run the version that has schema names, fine also. 
> create schema S1;
> create table
>   S1.PRODUCT(
>     PRODUCT_ID VARCHAR(255) unique not null,
>     VERSION BIGINT
>   );
>   
> create table
>   S1.CATEGORY(
>     CAT_ID VARCHAR(255),
>     NAME varchar(255) not null,
>     VERSION BIGINT
>   );
> create table
>   S1.PROD_IN_CAT(
>     CAT_ID VARCHAR(255) not null,
>     PRODUCT_ID VARCHAR(255) not null,
>     VERSION BIGINT
>   );
>   
> create trigger S1.product_v 
> after update of version on S1.product
> referencing new as n
> for each row
> mode db2sql
> 	update S1.prod_in_cat set version = n.version where S1.prod_in_cat.product_id=n.product_id;
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(Unknown Source)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(Unknown Source)Stopping progress indicator for: Executing SQL
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DERBY-630) create trigger fails with null pointer exception

Posted by "Zachery Jensen (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-630?page=comments#action_12424128 ] 
            
Zachery Jensen commented on DERBY-630:
--------------------------------------

I can confirm this happening to me in version 10.1.3.1.

The test case above causes the issue.  It doesn't occur when creating the triggers on the APP schema.

> create trigger fails with null pointer exception
> ------------------------------------------------
>
>                 Key: DERBY-630
>                 URL: http://issues.apache.org/jira/browse/DERBY-630
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0
>         Environment: windows 2000, sun jdk 1.5.0
>            Reporter: mardacay
>
> When i create a brand new database, and execute the following statements all in one transaction or each of them in their own transaction, then it fails at trigger creation with null pointer exception. if i exclude the schema names from statement, then it runs fine. (If S1 is ommited from every statement then it runs fine). Once the version without the schema names run fine, i can run the version that has schema names, fine also. 
> create schema S1;
> create table
>   S1.PRODUCT(
>     PRODUCT_ID VARCHAR(255) unique not null,
>     VERSION BIGINT
>   );
>   
> create table
>   S1.CATEGORY(
>     CAT_ID VARCHAR(255),
>     NAME varchar(255) not null,
>     VERSION BIGINT
>   );
> create table
>   S1.PROD_IN_CAT(
>     CAT_ID VARCHAR(255) not null,
>     PRODUCT_ID VARCHAR(255) not null,
>     VERSION BIGINT
>   );
>   
> create trigger S1.product_v 
> after update of version on S1.product
> referencing new as n
> for each row
> mode db2sql
> 	update S1.prod_in_cat set version = n.version where S1.prod_in_cat.product_id=n.product_id;
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(Unknown Source)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(Unknown Source)Stopping progress indicator for: Executing SQL
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DERBY-630) create trigger fails with null pointer exception

Posted by "Bryan Pendleton (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-630?page=comments#action_12441797 ] 
            
Bryan Pendleton commented on DERBY-630:
---------------------------------------

The patch applies cleanly for me and builds without problem. The new tests fail as expected
without the code changes, and pass as expected with the code changes. derbyall passes
cleanly for me.

One question, though: I see that there is code in the patch which runs during the upgrade
path. Has this code been tested? Are there automated tests of the ugprade processing,
or is the testing manual?

I am not very familiar with upgrade and so am not certain what sort of review is useful for
the upgrade changes. I read through the code and it makes sense, and your comments
in the code are very useful. I'm just wondering about the testing, both manual and automated.


> create trigger fails with null pointer exception
> ------------------------------------------------
>
>                 Key: DERBY-630
>                 URL: http://issues.apache.org/jira/browse/DERBY-630
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0
>         Environment: windows 2000, sun jdk 1.5.0
>            Reporter: mardacay
>         Assigned To: Yip Ng
>         Attachments: derby630-trunk-diff01.txt, derby630-trunk-stat01.txt
>
>
> When i create a brand new database, and execute the following statements all in one transaction or each of them in their own transaction, then it fails at trigger creation with null pointer exception. if i exclude the schema names from statement, then it runs fine. (If S1 is ommited from every statement then it runs fine). Once the version without the schema names run fine, i can run the version that has schema names, fine also. 
> create schema S1;
> create table
>   S1.PRODUCT(
>     PRODUCT_ID VARCHAR(255) unique not null,
>     VERSION BIGINT
>   );
>   
> create table
>   S1.CATEGORY(
>     CAT_ID VARCHAR(255),
>     NAME varchar(255) not null,
>     VERSION BIGINT
>   );
> create table
>   S1.PROD_IN_CAT(
>     CAT_ID VARCHAR(255) not null,
>     PRODUCT_ID VARCHAR(255) not null,
>     VERSION BIGINT
>   );
>   
> create trigger S1.product_v 
> after update of version on S1.product
> referencing new as n
> for each row
> mode db2sql
> 	update S1.prod_in_cat set version = n.version where S1.prod_in_cat.product_id=n.product_id;
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(Unknown Source)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(Unknown Source)Stopping progress indicator for: Executing SQL
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Re: [jira] Commented: (DERBY-630) create trigger fails with null pointer exception

Posted by Yip Ng <yi...@gmail.com>.
Thanks for the tip, Suresh.

On 10/12/06, Suresh Thalamati <su...@gmail.com> wrote:
>
> Hi Yip,
>
> I think by setting derby.database.allowPreReleaseUpgrade=true , in the
> derby.properties , you can upgrade from 10.2 to 10.3 (trunk)
>
> /suresh
>
> Yip Ng (JIRA) wrote:
> >     [
> http://issues.apache.org/jira/browse/DERBY-630?page=comments#action_12441875]
> >
> > Yip Ng commented on DERBY-630:
> > ------------------------------
> >
> > Hi Bryan.  I am glad that you brought this up.  In the current state of
> the trunk, the soft upgrade code that I put into the current patch will not
> get triggered since the release.properties file's beta property is set to
> true and the maint property has a value of 0 which indicates alpha.  Thus,
> the system will not allow an upgrade to occur.  i.e.:
> >
> > <snip>
> > ij version 10.3
> > ij> connect 'jdbc:derby:db102' user 'user1';
> > ERROR XJ040: Failed to start database 'db102', see the next exception
> for details.
> > ERROR XCW00: Unsupported upgrade from '10.2' to '10.3 beta'.
> > </snip>
> >
> > I am not sure what the next release will be, so I didn't modify the
> release.properties file.  However, I did run the soft upgrade test
> manually to verify my code changes are executed correctly.  What I did was:
> >
> > 1) Set the beta property to false and maint property to non-zero value
> (1000001, for example)
> >
> > 2) In order for the soft upgrade to get triggered, the data
> dictionary(dd) version (currently 140 for 10.2.1.6)
> > needs to  be incremented to a higher version number than the on-disk
> version.
> >
> > 3) Create the database in 10.2.1.6, this will have dd version of 140.
> >
> >
>

Re: [jira] Commented: (DERBY-630) create trigger fails with null pointer exception

Posted by Suresh Thalamati <su...@gmail.com>.
Hi Yip,

I think by setting derby.database.allowPreReleaseUpgrade=true , in the 
derby.properties , you can upgrade from 10.2 to 10.3 (trunk)

/suresh

Yip Ng (JIRA) wrote:
>     [ http://issues.apache.org/jira/browse/DERBY-630?page=comments#action_12441875 ] 
>             
> Yip Ng commented on DERBY-630:
> ------------------------------
> 
> Hi Bryan.  I am glad that you brought this up.  In the current state of the trunk, the soft upgrade code that I put into the current patch will not get triggered since the release.properties file's beta property is set to true and the maint property has a value of 0 which indicates alpha.  Thus, the system will not allow an upgrade to occur.  i.e.:
> 
> <snip>
> ij version 10.3
> ij> connect 'jdbc:derby:db102' user 'user1';
> ERROR XJ040: Failed to start database 'db102', see the next exception for details.
> ERROR XCW00: Unsupported upgrade from '10.2' to '10.3 beta'.
> </snip>
> 
> I am not sure what the next release will be, so I didn't modify the release.properties file.  However, I did run the soft upgrade test manually to verify my code changes are executed correctly.  What I did was:
> 
> 1) Set the beta property to false and maint property to non-zero value (1000001, for example)
> 
> 2) In order for the soft upgrade to get triggered, the data dictionary(dd) version (currently 140 for 10.2.1.6) 
> needs to  be incremented to a higher version number than the on-disk version.  
> 
> 3) Create the database in 10.2.1.6, this will have dd version of 140.
> 
>

[jira] Commented: (DERBY-630) create trigger fails with null pointer exception

Posted by "Yip Ng (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-630?page=comments#action_12441875 ] 
            
Yip Ng commented on DERBY-630:
------------------------------

Hi Bryan.  I am glad that you brought this up.  In the current state of the trunk, the soft upgrade code that I put into the current patch will not get triggered since the release.properties file's beta property is set to true and the maint property has a value of 0 which indicates alpha.  Thus, the system will not allow an upgrade to occur.  i.e.:

<snip>
ij version 10.3
ij> connect 'jdbc:derby:db102' user 'user1';
ERROR XJ040: Failed to start database 'db102', see the next exception for details.
ERROR XCW00: Unsupported upgrade from '10.2' to '10.3 beta'.
</snip>

I am not sure what the next release will be, so I didn't modify the release.properties file.  However, I did run the soft upgrade test manually to verify my code changes are executed correctly.  What I did was:

1) Set the beta property to false and maint property to non-zero value (1000001, for example)

2) In order for the soft upgrade to get triggered, the data dictionary(dd) version (currently 140 for 10.2.1.6) 
needs to  be incremented to a higher version number than the on-disk version.  

3) Create the database in 10.2.1.6, this will have dd version of 140.

<snip>
ij version 10.2
ij> connect 'jdbc:derby:db102;create=true' user 'user1';
WARNING 01J14: SQL authorization is being used without first enabling authentication.
ij> describe 'sys.sysstatements';
COLUMN_NAME         |TYPE_NAME|DEC&|NUM&|COLUM&|COLUMN_DEF|CHAR_OCTE&|IS_NULL&
------------------------------------------------------------------------------
STMTID              |CHAR     |NULL|NULL|36    |NULL      |72        |NO
STMTNAME            |VARCHAR  |NULL|NULL|128   |NULL      |256       |NO
SCHEMAID            |CHAR     |NULL|NULL|36    |NULL      |72        |NO
TYPE                |CHAR     |NULL|NULL|1     |NULL      |2         |NO
VALID               |BOOLEAN  |NULL|NULL|1     |NULL      |NULL      |NO
TEXT                |LONG VAR&|NULL|NULL|32700 |NULL      |NULL      |NO
LASTCOMPILED        |TIMESTAMP|0   |10  |26    |NULL      |NULL      |YES
COMPILATIONSCHEMAID |CHAR     |NULL|NULL|36    |NULL      |72        |NO
USINGTEXT           |LONG VAR&|NULL|NULL|32700 |NULL      |NULL      |YES

9 rows selected

ij> describe 'sys.sysviews';
COLUMN_NAME         |TYPE_NAME|DEC&|NUM&|COLUM&|COLUMN_DEF|CHAR_OCTE&|IS_NULL&
------------------------------------------------------------------------------
TABLEID             |CHAR     |NULL|NULL|36    |NULL      |72        |NO
VIEWDEFINITION      |LONG VAR&|NULL|NULL|32700 |NULL      |NULL      |NO
CHECKOPTION         |CHAR     |NULL|NULL|1     |NULL      |2         |NO
COMPILATIONSCHEMAID |CHAR     |NULL|NULL|36    |NULL      |72        |NO

4 rows selected
</snip>


4) Boot this 10.2 database using the trunk code with my patch(dd version for runtime is 141).
<snip>
ij version 10.3
ij> connect 'jdbc:derby:db102' user 'user1';
WARNING 01J14: SQL authorization is being used without first enabling authentication.
ij> describe 'sys.sysstatements';
COLUMN_NAME         |TYPE_NAME|DEC&|NUM&|COLUM&|COLUMN_DEF|CHAR_OCTE&|IS_NULL&
------------------------------------------------------------------------------
STMTID              |CHAR     |NULL|NULL|36    |NULL      |72        |NO
STMTNAME            |VARCHAR  |NULL|NULL|128   |NULL      |256       |NO
SCHEMAID            |CHAR     |NULL|NULL|36    |NULL      |72        |NO
TYPE                |CHAR     |NULL|NULL|1     |NULL      |2         |NO
VALID               |BOOLEAN  |NULL|NULL|1     |NULL      |NULL      |NO
TEXT                |LONG VAR&|NULL|NULL|32700 |NULL      |NULL      |NO
LASTCOMPILED        |TIMESTAMP|0   |10  |26    |NULL      |NULL      |YES
COMPILATIONSCHEMAID |CHAR     |NULL|NULL|36    |NULL      |72        |YES
USINGTEXT           |LONG VAR&|NULL|NULL|32700 |NULL      |NULL      |YES

9 rows selected
ij> describe 'sys.sysviews';
COLUMN_NAME         |TYPE_NAME|DEC&|NUM&|COLUM&|COLUMN_DEF|CHAR_OCTE&|IS_NULL&
------------------------------------------------------------------------------
TABLEID             |CHAR     |NULL|NULL|36    |NULL      |72        |NO
VIEWDEFINITION      |LONG VAR&|NULL|NULL|32700 |NULL      |NULL      |NO
CHECKOPTION         |CHAR     |NULL|NULL|1     |NULL      |2         |NO
COMPILATIONSCHEMAID |CHAR     |NULL|NULL|36    |NULL      |72        |YES

4 rows selected
</snip>

Notice the COMPILATIONSCHEMAID's IS_NULLABLE column for both system tables are now set to true 
after the soft upgrade.  So it works as expected. 

For step 2 described above, the DD runtime version should have been incremented along with this fix 
and I noticed there is an 10.1 to 10.2 upgrade test available in the regression.  Perhaps I can 
investigate this abit more and make this verification step automated with this test.  
I'll resubmit a follow-up patch.  


> create trigger fails with null pointer exception
> ------------------------------------------------
>
>                 Key: DERBY-630
>                 URL: http://issues.apache.org/jira/browse/DERBY-630
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0
>         Environment: windows 2000, sun jdk 1.5.0
>            Reporter: mardacay
>         Assigned To: Yip Ng
>         Attachments: derby630-trunk-diff01.txt, derby630-trunk-stat01.txt
>
>
> When i create a brand new database, and execute the following statements all in one transaction or each of them in their own transaction, then it fails at trigger creation with null pointer exception. if i exclude the schema names from statement, then it runs fine. (If S1 is ommited from every statement then it runs fine). Once the version without the schema names run fine, i can run the version that has schema names, fine also. 
> create schema S1;
> create table
>   S1.PRODUCT(
>     PRODUCT_ID VARCHAR(255) unique not null,
>     VERSION BIGINT
>   );
>   
> create table
>   S1.CATEGORY(
>     CAT_ID VARCHAR(255),
>     NAME varchar(255) not null,
>     VERSION BIGINT
>   );
> create table
>   S1.PROD_IN_CAT(
>     CAT_ID VARCHAR(255) not null,
>     PRODUCT_ID VARCHAR(255) not null,
>     VERSION BIGINT
>   );
>   
> create trigger S1.product_v 
> after update of version on S1.product
> referencing new as n
> for each row
> mode db2sql
> 	update S1.prod_in_cat set version = n.version where S1.prod_in_cat.product_id=n.product_id;
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(Unknown Source)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(Unknown Source)Stopping progress indicator for: Executing SQL
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (DERBY-630) create trigger fails with null pointer exception

Posted by "Yip Ng (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-630?page=all ]

Yip Ng updated DERBY-630:
-------------------------

    Attachment: derby630-trunk-stat01.txt
                derby630-trunk-diff01.txt

Attaching proposal patch derby630-trunk-diff01.txt for DERBY-630.  This patch fixes the NPE problem + allowing compilation schema uuid column to be nullable in both SYS.SYSSTATEMENTS and SYS.SYSVIEWS.  If this patch is reasonable, then a subsequent jira should be file to handle null compilation schema in the statement preparation logic as described in my previous comment.  derbyall passes with this patch.  

> create trigger fails with null pointer exception
> ------------------------------------------------
>
>                 Key: DERBY-630
>                 URL: http://issues.apache.org/jira/browse/DERBY-630
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0
>         Environment: windows 2000, sun jdk 1.5.0
>            Reporter: mardacay
>         Assigned To: Yip Ng
>         Attachments: derby630-trunk-diff01.txt, derby630-trunk-stat01.txt
>
>
> When i create a brand new database, and execute the following statements all in one transaction or each of them in their own transaction, then it fails at trigger creation with null pointer exception. if i exclude the schema names from statement, then it runs fine. (If S1 is ommited from every statement then it runs fine). Once the version without the schema names run fine, i can run the version that has schema names, fine also. 
> create schema S1;
> create table
>   S1.PRODUCT(
>     PRODUCT_ID VARCHAR(255) unique not null,
>     VERSION BIGINT
>   );
>   
> create table
>   S1.CATEGORY(
>     CAT_ID VARCHAR(255),
>     NAME varchar(255) not null,
>     VERSION BIGINT
>   );
> create table
>   S1.PROD_IN_CAT(
>     CAT_ID VARCHAR(255) not null,
>     PRODUCT_ID VARCHAR(255) not null,
>     VERSION BIGINT
>   );
>   
> create trigger S1.product_v 
> after update of version on S1.product
> referencing new as n
> for each row
> mode db2sql
> 	update S1.prod_in_cat set version = n.version where S1.prod_in_cat.product_id=n.product_id;
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(Unknown Source)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(Unknown Source)Stopping progress indicator for: Executing SQL
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DERBY-630) create trigger fails with null pointer exception

Posted by "Bryan Pendleton (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-630?page=comments#action_12442103 ] 
            
Bryan Pendleton commented on DERBY-630:
---------------------------------------

Thanks for investigating the automated upgrade test! I will have a look at the new patch.

> create trigger fails with null pointer exception
> ------------------------------------------------
>
>                 Key: DERBY-630
>                 URL: http://issues.apache.org/jira/browse/DERBY-630
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0
>         Environment: windows 2000, sun jdk 1.5.0
>            Reporter: mardacay
>         Assigned To: Yip Ng
>         Attachments: derby630-trunk-diff01.txt, derby630-trunk-diff02.txt, derby630-trunk-stat01.txt, derby630-trunk-stat02.txt
>
>
> When i create a brand new database, and execute the following statements all in one transaction or each of them in their own transaction, then it fails at trigger creation with null pointer exception. if i exclude the schema names from statement, then it runs fine. (If S1 is ommited from every statement then it runs fine). Once the version without the schema names run fine, i can run the version that has schema names, fine also. 
> create schema S1;
> create table
>   S1.PRODUCT(
>     PRODUCT_ID VARCHAR(255) unique not null,
>     VERSION BIGINT
>   );
>   
> create table
>   S1.CATEGORY(
>     CAT_ID VARCHAR(255),
>     NAME varchar(255) not null,
>     VERSION BIGINT
>   );
> create table
>   S1.PROD_IN_CAT(
>     CAT_ID VARCHAR(255) not null,
>     PRODUCT_ID VARCHAR(255) not null,
>     VERSION BIGINT
>   );
>   
> create trigger S1.product_v 
> after update of version on S1.product
> referencing new as n
> for each row
> mode db2sql
> 	update S1.prod_in_cat set version = n.version where S1.prod_in_cat.product_id=n.product_id;
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(Unknown Source)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(Unknown Source)Stopping progress indicator for: Executing SQL
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DERBY-630) create trigger fails with null pointer exception

Posted by "Bryan Pendleton (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-630?page=comments#action_12442304 ] 
            
Bryan Pendleton commented on DERBY-630:
---------------------------------------

Hi Yip, thanks very much for adding the upgrade test. It looks great, and it passes fine in my environment.

However, I am wondering: should we fix DERBY-1689 first? More precisely, do you think that committing
this change will make it harder to address DERBY-1689? If not, I think I'm ready to commit this patch.

> create trigger fails with null pointer exception
> ------------------------------------------------
>
>                 Key: DERBY-630
>                 URL: http://issues.apache.org/jira/browse/DERBY-630
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0
>         Environment: windows 2000, sun jdk 1.5.0
>            Reporter: mardacay
>         Assigned To: Yip Ng
>         Attachments: derby630-trunk-diff01.txt, derby630-trunk-diff02.txt, derby630-trunk-stat01.txt, derby630-trunk-stat02.txt
>
>
> When i create a brand new database, and execute the following statements all in one transaction or each of them in their own transaction, then it fails at trigger creation with null pointer exception. if i exclude the schema names from statement, then it runs fine. (If S1 is ommited from every statement then it runs fine). Once the version without the schema names run fine, i can run the version that has schema names, fine also. 
> create schema S1;
> create table
>   S1.PRODUCT(
>     PRODUCT_ID VARCHAR(255) unique not null,
>     VERSION BIGINT
>   );
>   
> create table
>   S1.CATEGORY(
>     CAT_ID VARCHAR(255),
>     NAME varchar(255) not null,
>     VERSION BIGINT
>   );
> create table
>   S1.PROD_IN_CAT(
>     CAT_ID VARCHAR(255) not null,
>     PRODUCT_ID VARCHAR(255) not null,
>     VERSION BIGINT
>   );
>   
> create trigger S1.product_v 
> after update of version on S1.product
> referencing new as n
> for each row
> mode db2sql
> 	update S1.prod_in_cat set version = n.version where S1.prod_in_cat.product_id=n.product_id;
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(Unknown Source)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(Unknown Source)Stopping progress indicator for: Executing SQL
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DERBY-630) create trigger fails with null pointer exception

Posted by "Bryan Pendleton (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-630?page=comments#action_12442416 ] 
            
Bryan Pendleton commented on DERBY-630:
---------------------------------------

I am not intending to port this patch to 10.2. I agree with you that the upgrade requirements
would necessitate special handling. 

> create trigger fails with null pointer exception
> ------------------------------------------------
>
>                 Key: DERBY-630
>                 URL: http://issues.apache.org/jira/browse/DERBY-630
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.1.0
>         Environment: windows 2000, sun jdk 1.5.0
>            Reporter: mardacay
>         Assigned To: Yip Ng
>             Fix For: 10.3.0.0
>
>         Attachments: derby630-trunk-diff01.txt, derby630-trunk-diff02.txt, derby630-trunk-stat01.txt, derby630-trunk-stat02.txt
>
>
> When i create a brand new database, and execute the following statements all in one transaction or each of them in their own transaction, then it fails at trigger creation with null pointer exception. if i exclude the schema names from statement, then it runs fine. (If S1 is ommited from every statement then it runs fine). Once the version without the schema names run fine, i can run the version that has schema names, fine also. 
> create schema S1;
> create table
>   S1.PRODUCT(
>     PRODUCT_ID VARCHAR(255) unique not null,
>     VERSION BIGINT
>   );
>   
> create table
>   S1.CATEGORY(
>     CAT_ID VARCHAR(255),
>     NAME varchar(255) not null,
>     VERSION BIGINT
>   );
> create table
>   S1.PROD_IN_CAT(
>     CAT_ID VARCHAR(255) not null,
>     PRODUCT_ID VARCHAR(255) not null,
>     VERSION BIGINT
>   );
>   
> create trigger S1.product_v 
> after update of version on S1.product
> referencing new as n
> for each row
> mode db2sql
> 	update S1.prod_in_cat set version = n.version where S1.prod_in_cat.product_id=n.product_id;
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(Unknown Source)
> 	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(Unknown Source)Stopping progress indicator for: Executing SQL
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira