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 "Yip Ng (JIRA)" <de...@db.apache.org> on 2006/09/14 01:56:22 UTC

[jira] Created: (DERBY-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
-----------------------------------------------------------------------------------------------------------

                 Key: DERBY-1847
                 URL: http://issues.apache.org/jira/browse/DERBY-1847
             Project: Derby
          Issue Type: Bug
          Components: SQL
    Affects Versions: 10.2.1.0
         Environment: Any
            Reporter: Yip Ng


Following script causes the select statement below to assert in sane build. 

ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
WARNING 01J14: SQL authorization is being used without first enabling authentication.
ij> create table t1 (c1 int, c2 int);
0 rows inserted/updated/deleted
ij> grant select(c1,c2) on t1 to user2;
0 rows inserted/updated/deleted
ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
WARNING 01J14: SQL authorization is being used without first enabling authentication.
ij(USER2)> set connection user1;
ij(USER1)> alter table t1 add c3 int;
0 rows inserted/updated/deleted
ij(USER1)> set connection user2;
ij(USER2)> select c3 from user1.t1;
ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.

sysinfo:

------------------ Java Information ------------------
Java Version:    1.4.2_12
Java Vendor:     Sun Microsystems Inc.
Java home:       C:\Program Files\Java\j2re1.4.2_12
Java classpath:  classes;.
OS name:         Windows XP
OS architecture: x86
OS version:      5.1
Java user name:  Yip
Java user home:  C:\Documents and Settings\Yip
Java user dir:   C:\work3\derby\trunk
java.specification.name: Java Platform API Specification
java.specification.version: 1.4
--------- Derby Information --------
JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
[C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
------------------------------------------------------
----------------- Locale Information -----------------
Current Locale :  [English/United States [en_US]]
Found support for locale: [de_DE]
         version: 10.3.0.0 alpha - (443080)
Found support for locale: [es]
         version: 10.3.0.0 alpha - (443080)
Found support for locale: [fr]
         version: 10.3.0.0 alpha - (443080)
Found support for locale: [it]
         version: 10.3.0.0 alpha - (443080)
Found support for locale: [ja_JP]
         version: 10.3.0.0 alpha - (443080)
Found support for locale: [ko_KR]
         version: 10.3.0.0 alpha - (443080)
Found support for locale: [pt_BR]
         version: 10.3.0.0 alpha - (443080)
Found support for locale: [zh_CN]
         version: 10.3.0.0 alpha - (443080)
Found support for locale: [zh_TW]
         version: 10.3.0.0 alpha - (443080)
------------------------------------------------------

-- 
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-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

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

Bryan Pendleton reassigned DERBY-1847:
--------------------------------------

    Assignee: Bryan Pendleton

> SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1847
>                 URL: http://issues.apache.org/jira/browse/DERBY-1847
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.6, 10.3.0.0, 10.2.2.0
>         Environment: Any
>            Reporter: Yip Ng
>         Assigned To: Bryan Pendleton
>             Fix For: 10.3.0.0, 10.2.1.8
>
>         Attachments: DERBY1846_V1_diff_AddColumnAndGrantRevoke.txt, DERBY1846_V1_stat_AddColumnAndGrantRevoke.txt
>
>
> Following script causes the select statement below to assert in sane build. 
> ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij> create table t1 (c1 int, c2 int);
> 0 rows inserted/updated/deleted
> ij> grant select(c1,c2) on t1 to user2;
> 0 rows inserted/updated/deleted
> ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij(USER2)> set connection user1;
> ij(USER1)> alter table t1 add c3 int;
> 0 rows inserted/updated/deleted
> ij(USER1)> set connection user2;
> ij(USER2)> select c3 from user1.t1;
> ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.
> stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
> 	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
> 	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)
> sysinfo:
> ------------------ Java Information ------------------
> Java Version:    1.4.2_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_12
> Java classpath:  classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  Yip
> Java user home:  C:\Documents and Settings\Yip
> Java user dir:   C:\work3\derby\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [es]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [fr]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [it]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ja_JP]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ko_KR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [pt_BR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_CN]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_TW]
>          version: 10.3.0.0 alpha - (443080)
> ------------------------------------------------------

-- 
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-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

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

Mike Matrigali updated DERBY-1847:
----------------------------------

    Fix Version/s: 10.3.0.0

committed patch to the trunk and marked fixed in 10.3.

m3_ibm142:148>svn commit

Sending        java\engine\org\apache\derby\iapi\sql\dictionary\DataDictionary.j
ava
Sending        java\engine\org\apache\derby\impl\sql\catalog\DataDictionaryImpl.
java
Sending        java\engine\org\apache\derby\impl\sql\catalog\SYSCOLPERMSRowFacto
ry.java
Sending        java\engine\org\apache\derby\impl\sql\execute\AlterTableConstantA
ction.java
Sending        java\testing\org\apache\derbyTesting\functionTests\master\grantRe
vokeDDL.out
Sending        java\testing\org\apache\derbyTesting\functionTests\tests\lang\gra
ntRevokeDDL.sql
Transmitting file data ......
Committed revision 453352.

> SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1847
>                 URL: http://issues.apache.org/jira/browse/DERBY-1847
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.6, 10.3.0.0, 10.2.2.0
>         Environment: Any
>            Reporter: Yip Ng
>         Assigned To: Mamta A. Satoor
>             Fix For: 10.3.0.0
>
>         Attachments: DERBY1846_V1_diff_AddColumnAndGrantRevoke.txt, DERBY1846_V1_stat_AddColumnAndGrantRevoke.txt
>
>
> Following script causes the select statement below to assert in sane build. 
> ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij> create table t1 (c1 int, c2 int);
> 0 rows inserted/updated/deleted
> ij> grant select(c1,c2) on t1 to user2;
> 0 rows inserted/updated/deleted
> ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij(USER2)> set connection user1;
> ij(USER1)> alter table t1 add c3 int;
> 0 rows inserted/updated/deleted
> ij(USER1)> set connection user2;
> ij(USER2)> select c3 from user1.t1;
> ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.
> stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
> 	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
> 	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)
> sysinfo:
> ------------------ Java Information ------------------
> Java Version:    1.4.2_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_12
> Java classpath:  classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  Yip
> Java user home:  C:\Documents and Settings\Yip
> Java user dir:   C:\work3\derby\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [es]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [fr]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [it]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ja_JP]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ko_KR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [pt_BR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_CN]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_TW]
>          version: 10.3.0.0 alpha - (443080)
> ------------------------------------------------------

-- 
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-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

Posted by "Andrew McIntyre (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1847?page=all ]

Andrew McIntyre updated DERBY-1847:
-----------------------------------

    Fix Version/s: 10.2.3.0
                       (was: 10.2.2.0)

> SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1847
>                 URL: http://issues.apache.org/jira/browse/DERBY-1847
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.6, 10.3.0.0, 10.2.2.0
>         Environment: Any
>            Reporter: Yip Ng
>         Assigned To: Bryan Pendleton
>             Fix For: 10.3.0.0, 10.2.3.0
>
>         Attachments: d1847_useCPID_index.diff, DERBY1846_V1_diff_AddColumnAndGrantRevoke.txt, DERBY1846_V1_stat_AddColumnAndGrantRevoke.txt
>
>
> Following script causes the select statement below to assert in sane build. 
> ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij> create table t1 (c1 int, c2 int);
> 0 rows inserted/updated/deleted
> ij> grant select(c1,c2) on t1 to user2;
> 0 rows inserted/updated/deleted
> ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij(USER2)> set connection user1;
> ij(USER1)> alter table t1 add c3 int;
> 0 rows inserted/updated/deleted
> ij(USER1)> set connection user2;
> ij(USER2)> select c3 from user1.t1;
> ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.
> stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
> 	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
> 	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)
> sysinfo:
> ------------------ Java Information ------------------
> Java Version:    1.4.2_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_12
> Java classpath:  classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  Yip
> Java user home:  C:\Documents and Settings\Yip
> Java user dir:   C:\work3\derby\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [es]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [fr]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [it]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ja_JP]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ko_KR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [pt_BR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_CN]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_TW]
>          version: 10.3.0.0 alpha - (443080)
> ------------------------------------------------------

-- 
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-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1847?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryan Pendleton resolved DERBY-1847.
------------------------------------

    Resolution: Fixed
    Derby Info:   (was: [Patch Available])

use_CPID follow-on patch applied to 10.2 as revision 493063.
Marking issue resolved.

> SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1847
>                 URL: https://issues.apache.org/jira/browse/DERBY-1847
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.6, 10.2.2.0, 10.3.0.0
>         Environment: Any
>            Reporter: Yip Ng
>         Assigned To: Bryan Pendleton
>             Fix For: 10.2.3.0, 10.3.0.0
>
>         Attachments: d1847_useCPID_index.diff, DERBY1846_V1_diff_AddColumnAndGrantRevoke.txt, DERBY1846_V1_stat_AddColumnAndGrantRevoke.txt
>
>
> Following script causes the select statement below to assert in sane build. 
> ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij> create table t1 (c1 int, c2 int);
> 0 rows inserted/updated/deleted
> ij> grant select(c1,c2) on t1 to user2;
> 0 rows inserted/updated/deleted
> ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij(USER2)> set connection user1;
> ij(USER1)> alter table t1 add c3 int;
> 0 rows inserted/updated/deleted
> ij(USER1)> set connection user2;
> ij(USER2)> select c3 from user1.t1;
> ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.
> stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
> 	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
> 	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)
> sysinfo:
> ------------------ Java Information ------------------
> Java Version:    1.4.2_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_12
> Java classpath:  classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  Yip
> Java user home:  C:\Documents and Settings\Yip
> Java user dir:   C:\work3\derby\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [es]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [fr]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [it]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ja_JP]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ko_KR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [pt_BR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_CN]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_TW]
>          version: 10.3.0.0 alpha - (443080)
> ------------------------------------------------------

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

        

[jira] Commented: (DERBY-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

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

At a very high level, it seems like we need to:
 - run through each row in SYSCOLPERMS and call FormatableBitSet.grow(1) on the COLUMNS column
 - clear the PermissionsCache so that in-memory descriptors will get re-read

The clearing of the PermissionsCache seems like it should happen in
DataDictionaryImpl.clearCaches.


> SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1847
>                 URL: http://issues.apache.org/jira/browse/DERBY-1847
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.4, 10.3.0.0, 10.2.2.0
>         Environment: Any
>            Reporter: Yip Ng
>
> Following script causes the select statement below to assert in sane build. 
> ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij> create table t1 (c1 int, c2 int);
> 0 rows inserted/updated/deleted
> ij> grant select(c1,c2) on t1 to user2;
> 0 rows inserted/updated/deleted
> ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij(USER2)> set connection user1;
> ij(USER1)> alter table t1 add c3 int;
> 0 rows inserted/updated/deleted
> ij(USER1)> set connection user2;
> ij(USER2)> select c3 from user1.t1;
> ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.
> stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
> 	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
> 	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)
> sysinfo:
> ------------------ Java Information ------------------
> Java Version:    1.4.2_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_12
> Java classpath:  classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  Yip
> Java user home:  C:\Documents and Settings\Yip
> Java user dir:   C:\work3\derby\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [es]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [fr]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [it]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ja_JP]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ko_KR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [pt_BR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_CN]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_TW]
>          version: 10.3.0.0 alpha - (443080)
> ------------------------------------------------------

-- 
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-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

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

Bryan, thanks for taking the time to review the code.

Let me answer attempt to answer your questions 
1)Main reason behind putting the update system table code in DataDictionary was that for some reason, I thought DataDictionary class was the place to put all the code related to updating the system tables. 

2)I think DERBY-1909 might need the some of the same code as updateSYSCOLPERMSforAddColumnToUserTable(), in particular, getting the affected rows from SYSCOLPERMS using the tableid. May be I should go ahead and put some comment in DERBY-1909 for this so whoever works on it will be aware of the code in updateSYSCOLPERMSforAddColumnToUserTable() 

3)I always tend to cleanup code around when I work on a Jira entry although it is not related to actual work that I am doing (wish, I did that at home, my house will look much cleaner). So, sorry about the confusion about the cleanup work that went into this patch. They were not related to the bug and I should have said something in my patch description about it.


> SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1847
>                 URL: http://issues.apache.org/jira/browse/DERBY-1847
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.6, 10.2.2.0, 10.3.0.0
>         Environment: Any
>            Reporter: Yip Ng
>         Assigned To: Mamta A. Satoor
>         Attachments: DERBY1846_V1_diff_AddColumnAndGrantRevoke.txt, DERBY1846_V1_stat_AddColumnAndGrantRevoke.txt
>
>
> Following script causes the select statement below to assert in sane build. 
> ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij> create table t1 (c1 int, c2 int);
> 0 rows inserted/updated/deleted
> ij> grant select(c1,c2) on t1 to user2;
> 0 rows inserted/updated/deleted
> ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij(USER2)> set connection user1;
> ij(USER1)> alter table t1 add c3 int;
> 0 rows inserted/updated/deleted
> ij(USER1)> set connection user2;
> ij(USER2)> select c3 from user1.t1;
> ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.
> stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
> 	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
> 	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)
> sysinfo:
> ------------------ Java Information ------------------
> Java Version:    1.4.2_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_12
> Java classpath:  classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  Yip
> Java user home:  C:\Documents and Settings\Yip
> Java user dir:   C:\work3\derby\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [es]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [fr]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [it]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ja_JP]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ko_KR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [pt_BR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_CN]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_TW]
>          version: 10.3.0.0 alpha - (443080)
> ------------------------------------------------------

-- 
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-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

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

Yip Ng updated DERBY-1847:
--------------------------

    Affects Version/s: 10.2.2.0
                       10.3.0.0
          Description: 
Following script causes the select statement below to assert in sane build. 

ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
WARNING 01J14: SQL authorization is being used without first enabling authentication.
ij> create table t1 (c1 int, c2 int);
0 rows inserted/updated/deleted
ij> grant select(c1,c2) on t1 to user2;
0 rows inserted/updated/deleted
ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
WARNING 01J14: SQL authorization is being used without first enabling authentication.
ij(USER2)> set connection user1;
ij(USER1)> alter table t1 add c3 int;
0 rows inserted/updated/deleted
ij(USER1)> set connection user2;
ij(USER2)> select c3 from user1.t1;
ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.

stack trace:

org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
	at org.apache.derby.tools.ij.main(ij.java:71)

sysinfo:

------------------ Java Information ------------------
Java Version:    1.4.2_12
Java Vendor:     Sun Microsystems Inc.
Java home:       C:\Program Files\Java\j2re1.4.2_12
Java classpath:  classes;.
OS name:         Windows XP
OS architecture: x86
OS version:      5.1
Java user name:  Yip
Java user home:  C:\Documents and Settings\Yip
Java user dir:   C:\work3\derby\trunk
java.specification.name: Java Platform API Specification
java.specification.version: 1.4
--------- Derby Information --------
JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
[C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
------------------------------------------------------
----------------- Locale Information -----------------
Current Locale :  [English/United States [en_US]]
Found support for locale: [de_DE]
         version: 10.3.0.0 alpha - (443080)
Found support for locale: [es]
         version: 10.3.0.0 alpha - (443080)
Found support for locale: [fr]
         version: 10.3.0.0 alpha - (443080)
Found support for locale: [it]
         version: 10.3.0.0 alpha - (443080)
Found support for locale: [ja_JP]
         version: 10.3.0.0 alpha - (443080)
Found support for locale: [ko_KR]
         version: 10.3.0.0 alpha - (443080)
Found support for locale: [pt_BR]
         version: 10.3.0.0 alpha - (443080)
Found support for locale: [zh_CN]
         version: 10.3.0.0 alpha - (443080)
Found support for locale: [zh_TW]
         version: 10.3.0.0 alpha - (443080)
------------------------------------------------------

  was:
Following script causes the select statement below to assert in sane build. 

ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
WARNING 01J14: SQL authorization is being used without first enabling authentication.
ij> create table t1 (c1 int, c2 int);
0 rows inserted/updated/deleted
ij> grant select(c1,c2) on t1 to user2;
0 rows inserted/updated/deleted
ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
WARNING 01J14: SQL authorization is being used without first enabling authentication.
ij(USER2)> set connection user1;
ij(USER1)> alter table t1 add c3 int;
0 rows inserted/updated/deleted
ij(USER1)> set connection user2;
ij(USER2)> select c3 from user1.t1;
ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.

sysinfo:

------------------ Java Information ------------------
Java Version:    1.4.2_12
Java Vendor:     Sun Microsystems Inc.
Java home:       C:\Program Files\Java\j2re1.4.2_12
Java classpath:  classes;.
OS name:         Windows XP
OS architecture: x86
OS version:      5.1
Java user name:  Yip
Java user home:  C:\Documents and Settings\Yip
Java user dir:   C:\work3\derby\trunk
java.specification.name: Java Platform API Specification
java.specification.version: 1.4
--------- Derby Information --------
JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
[C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
------------------------------------------------------
----------------- Locale Information -----------------
Current Locale :  [English/United States [en_US]]
Found support for locale: [de_DE]
         version: 10.3.0.0 alpha - (443080)
Found support for locale: [es]
         version: 10.3.0.0 alpha - (443080)
Found support for locale: [fr]
         version: 10.3.0.0 alpha - (443080)
Found support for locale: [it]
         version: 10.3.0.0 alpha - (443080)
Found support for locale: [ja_JP]
         version: 10.3.0.0 alpha - (443080)
Found support for locale: [ko_KR]
         version: 10.3.0.0 alpha - (443080)
Found support for locale: [pt_BR]
         version: 10.3.0.0 alpha - (443080)
Found support for locale: [zh_CN]
         version: 10.3.0.0 alpha - (443080)
Found support for locale: [zh_TW]
         version: 10.3.0.0 alpha - (443080)
------------------------------------------------------


> SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1847
>                 URL: http://issues.apache.org/jira/browse/DERBY-1847
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.0, 10.3.0.0, 10.2.2.0
>         Environment: Any
>            Reporter: Yip Ng
>
> Following script causes the select statement below to assert in sane build. 
> ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij> create table t1 (c1 int, c2 int);
> 0 rows inserted/updated/deleted
> ij> grant select(c1,c2) on t1 to user2;
> 0 rows inserted/updated/deleted
> ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij(USER2)> set connection user1;
> ij(USER1)> alter table t1 add c3 int;
> 0 rows inserted/updated/deleted
> ij(USER1)> set connection user2;
> ij(USER2)> select c3 from user1.t1;
> ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.
> stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
> 	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
> 	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)
> sysinfo:
> ------------------ Java Information ------------------
> Java Version:    1.4.2_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_12
> Java classpath:  classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  Yip
> Java user home:  C:\Documents and Settings\Yip
> Java user dir:   C:\work3\derby\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [es]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [fr]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [it]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ja_JP]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ko_KR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [pt_BR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_CN]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_TW]
>          version: 10.3.0.0 alpha - (443080)
> ------------------------------------------------------

-- 
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-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

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

It looks like at alter table add column/drop column time, we need to go update the column "COLUMNS" in SYSCOLPERMS to incorporate the change in the table's column structure.

> SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1847
>                 URL: http://issues.apache.org/jira/browse/DERBY-1847
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.0, 10.2.2.0, 10.3.0.0
>         Environment: Any
>            Reporter: Yip Ng
>
> Following script causes the select statement below to assert in sane build. 
> ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij> create table t1 (c1 int, c2 int);
> 0 rows inserted/updated/deleted
> ij> grant select(c1,c2) on t1 to user2;
> 0 rows inserted/updated/deleted
> ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij(USER2)> set connection user1;
> ij(USER1)> alter table t1 add c3 int;
> 0 rows inserted/updated/deleted
> ij(USER1)> set connection user2;
> ij(USER2)> select c3 from user1.t1;
> ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.
> stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
> 	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
> 	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)
> sysinfo:
> ------------------ Java Information ------------------
> Java Version:    1.4.2_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_12
> Java classpath:  classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  Yip
> Java user home:  C:\Documents and Settings\Yip
> Java user dir:   C:\work3\derby\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [es]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [fr]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [it]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ja_JP]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ko_KR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [pt_BR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_CN]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_TW]
>          version: 10.3.0.0 alpha - (443080)
> ------------------------------------------------------

-- 
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-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

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

Bryan Pendleton reopened DERBY-1847:
------------------------------------

      Assignee:     (was: Mamta A. Satoor)
             
I think there is a problem in this fix. I think that the problem is that
when DataDictionaryImpl.updateSYSCOLPERMSforAddColumnToUserTable
updates the SYSCOLPERMS table, it updates the table by partial
key value. That means that each time the updateRow() call is made,
the COLUMNS column in SYSCOLPERMS is updated for *all* the
SYSCOLPERMS in that particular table, not just for the particular
SYSCOLPERMS row that we are working with at that instant.

I think that the routine uses a partial key to find all the ColPermsDescriptor
entries for this table, but when it updates those rows, I think it needs
to use a full key, not a partial key.

Here's a short script which I believe demonstrates the problem. Note that
in the second fetch from SYSCOLPERMS, all the COLUMNS values have
been changed to {0}.

-bash-2.05b$ java -Dderby.database.sqlAuthorization=true org.apache.derby.tools.ij repro.sql
ij version 10.3
ij> connect 'jdbc:derby:d1847;create=true';
WARNING 01J14: SQL authorization is being used without first enabling authentication.
ij> create table t (a int, b int, c int);
0 rows inserted/updated/deleted
ij> grant select (a) on t to first_user;
0 rows inserted/updated/deleted
ij> grant update (b) on t to second_user;
0 rows inserted/updated/deleted
ij> grant select (c) on t to third_user;
0 rows inserted/updated/deleted
ij> select grantee, type, columns from sys.syscolperms;
GRANTEE                                                                                                                         |&|COLUMNS
--------------------------------------------------------------------------------------------------------------------------------------------------
FIRST_USER                                                                                                                      |s|{0}
SECOND_USER                                                                                                                     |u|{1}
THIRD_USER                                                                                                                      |s|{2}

3 rows selected
ij> alter table t add column d int;
0 rows inserted/updated/deleted
ij> select grantee, type, columns from sys.syscolperms;
GRANTEE                                                                                                                         |&|COLUMNS
--------------------------------------------------------------------------------------------------------------------------------------------------
FIRST_USER                                                                                                                      |s|{0}
SECOND_USER                                                                                                                     |u|{0}
THIRD_USER                                                                                                                      |s|{0}

3 rows selected
ij> quit;
-bash-2.05b$ cat repro.sql
connect 'jdbc:derby:d1847;create=true';
create table t (a int, b int, c int);
grant select (a) on t to first_user;
grant update (b) on t to second_user;
grant select (c) on t to third_user;
select grantee, type, columns from sys.syscolperms;
alter table t add column d int;
select grantee, type, columns from sys.syscolperms;
quit;


> SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1847
>                 URL: http://issues.apache.org/jira/browse/DERBY-1847
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.6, 10.3.0.0, 10.2.2.0
>         Environment: Any
>            Reporter: Yip Ng
>             Fix For: 10.3.0.0, 10.2.1.8
>
>         Attachments: DERBY1846_V1_diff_AddColumnAndGrantRevoke.txt, DERBY1846_V1_stat_AddColumnAndGrantRevoke.txt
>
>
> Following script causes the select statement below to assert in sane build. 
> ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij> create table t1 (c1 int, c2 int);
> 0 rows inserted/updated/deleted
> ij> grant select(c1,c2) on t1 to user2;
> 0 rows inserted/updated/deleted
> ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij(USER2)> set connection user1;
> ij(USER1)> alter table t1 add c3 int;
> 0 rows inserted/updated/deleted
> ij(USER1)> set connection user2;
> ij(USER2)> select c3 from user1.t1;
> ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.
> stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
> 	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
> 	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)
> sysinfo:
> ------------------ Java Information ------------------
> Java Version:    1.4.2_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_12
> Java classpath:  classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  Yip
> Java user home:  C:\Documents and Settings\Yip
> Java user dir:   C:\work3\derby\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [es]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [fr]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [it]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ja_JP]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ko_KR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [pt_BR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_CN]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_TW]
>          version: 10.3.0.0 alpha - (443080)
> ------------------------------------------------------

-- 
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-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

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

Thanks for sharing your findings from ALTER TABLE DROP COLUMN, Bryan. I will investigate further into this Jira entry to see how 
1)SYSCOLPERMS should be updated and 
2)clear the permission cache so that we don't use stale column permission descriptors.

> SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1847
>                 URL: http://issues.apache.org/jira/browse/DERBY-1847
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.5, 10.3.0.0, 10.2.2.0
>         Environment: Any
>            Reporter: Yip Ng
>
> Following script causes the select statement below to assert in sane build. 
> ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij> create table t1 (c1 int, c2 int);
> 0 rows inserted/updated/deleted
> ij> grant select(c1,c2) on t1 to user2;
> 0 rows inserted/updated/deleted
> ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij(USER2)> set connection user1;
> ij(USER1)> alter table t1 add c3 int;
> 0 rows inserted/updated/deleted
> ij(USER1)> set connection user2;
> ij(USER2)> select c3 from user1.t1;
> ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.
> stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
> 	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
> 	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)
> sysinfo:
> ------------------ Java Information ------------------
> Java Version:    1.4.2_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_12
> Java classpath:  classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  Yip
> Java user home:  C:\Documents and Settings\Yip
> Java user dir:   C:\work3\derby\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [es]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [fr]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [it]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ja_JP]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ko_KR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [pt_BR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_CN]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_TW]
>          version: 10.3.0.0 alpha - (443080)
> ------------------------------------------------------

-- 
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-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

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

Mamta A. Satoor updated DERBY-1847:
-----------------------------------

    Derby Info:   (was: [Patch Available])

> SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1847
>                 URL: http://issues.apache.org/jira/browse/DERBY-1847
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.6, 10.3.0.0, 10.2.2.0
>         Environment: Any
>            Reporter: Yip Ng
>         Assigned To: Mamta A. Satoor
>             Fix For: 10.3.0.0
>
>         Attachments: DERBY1846_V1_diff_AddColumnAndGrantRevoke.txt, DERBY1846_V1_stat_AddColumnAndGrantRevoke.txt
>
>
> Following script causes the select statement below to assert in sane build. 
> ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij> create table t1 (c1 int, c2 int);
> 0 rows inserted/updated/deleted
> ij> grant select(c1,c2) on t1 to user2;
> 0 rows inserted/updated/deleted
> ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij(USER2)> set connection user1;
> ij(USER1)> alter table t1 add c3 int;
> 0 rows inserted/updated/deleted
> ij(USER1)> set connection user2;
> ij(USER2)> select c3 from user1.t1;
> ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.
> stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
> 	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
> 	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)
> sysinfo:
> ------------------ Java Information ------------------
> Java Version:    1.4.2_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_12
> Java classpath:  classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  Yip
> Java user home:  C:\Documents and Settings\Yip
> Java user dir:   C:\work3\derby\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [es]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [fr]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [it]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ja_JP]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ko_KR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [pt_BR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_CN]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_TW]
>          version: 10.3.0.0 alpha - (443080)
> ------------------------------------------------------

-- 
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-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

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

Yip Ng reassigned DERBY-1847:
-----------------------------

    Assignee:     (was: Yip Ng)

Unassigning myself from this jira, just realized that I still have another jira issue open.

> SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1847
>                 URL: http://issues.apache.org/jira/browse/DERBY-1847
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.0, 10.3.0.0, 10.2.2.0
>         Environment: Any
>            Reporter: Yip Ng
>
> Following script causes the select statement below to assert in sane build. 
> ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij> create table t1 (c1 int, c2 int);
> 0 rows inserted/updated/deleted
> ij> grant select(c1,c2) on t1 to user2;
> 0 rows inserted/updated/deleted
> ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij(USER2)> set connection user1;
> ij(USER1)> alter table t1 add c3 int;
> 0 rows inserted/updated/deleted
> ij(USER1)> set connection user2;
> ij(USER2)> select c3 from user1.t1;
> ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.
> stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
> 	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
> 	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)
> sysinfo:
> ------------------ Java Information ------------------
> Java Version:    1.4.2_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_12
> Java classpath:  classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  Yip
> Java user home:  C:\Documents and Settings\Yip
> Java user dir:   C:\work3\derby\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [es]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [fr]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [it]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ja_JP]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ko_KR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [pt_BR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_CN]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_TW]
>          version: 10.3.0.0 alpha - (443080)
> ------------------------------------------------------

-- 
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-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

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

Just wanted to mention that I was distracted by other work during last few days but have started working on this jira entry again and making progress. Hope to have something to propose by early next week.

> SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1847
>                 URL: http://issues.apache.org/jira/browse/DERBY-1847
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.5, 10.2.2.0, 10.3.0.0
>         Environment: Any
>            Reporter: Yip Ng
>         Assigned To: Mamta A. Satoor
>
> Following script causes the select statement below to assert in sane build. 
> ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij> create table t1 (c1 int, c2 int);
> 0 rows inserted/updated/deleted
> ij> grant select(c1,c2) on t1 to user2;
> 0 rows inserted/updated/deleted
> ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij(USER2)> set connection user1;
> ij(USER1)> alter table t1 add c3 int;
> 0 rows inserted/updated/deleted
> ij(USER1)> set connection user2;
> ij(USER2)> select c3 from user1.t1;
> ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.
> stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
> 	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
> 	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)
> sysinfo:
> ------------------ Java Information ------------------
> Java Version:    1.4.2_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_12
> Java classpath:  classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  Yip
> Java user home:  C:\Documents and Settings\Yip
> Java user dir:   C:\work3\derby\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [es]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [fr]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [it]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ja_JP]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ko_KR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [pt_BR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_CN]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_TW]
>          version: 10.3.0.0 alpha - (443080)
> ------------------------------------------------------

-- 
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-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

Posted by "Dyre Tjeldvoll (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1847?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dyre Tjeldvoll closed DERBY-1847.
---------------------------------


> SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1847
>                 URL: https://issues.apache.org/jira/browse/DERBY-1847
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.6, 10.2.2.0, 10.3.1.4
>         Environment: Any
>            Reporter: Yip Ng
>            Assignee: Bryan Pendleton
>             Fix For: 10.2.3.0, 10.3.1.4
>
>         Attachments: d1847_useCPID_index.diff, DERBY1846_V1_diff_AddColumnAndGrantRevoke.txt, DERBY1846_V1_stat_AddColumnAndGrantRevoke.txt
>
>
> Following script causes the select statement below to assert in sane build. 
> ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij> create table t1 (c1 int, c2 int);
> 0 rows inserted/updated/deleted
> ij> grant select(c1,c2) on t1 to user2;
> 0 rows inserted/updated/deleted
> ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij(USER2)> set connection user1;
> ij(USER1)> alter table t1 add c3 int;
> 0 rows inserted/updated/deleted
> ij(USER1)> set connection user2;
> ij(USER2)> select c3 from user1.t1;
> ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.
> stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
> 	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
> 	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)
> sysinfo:
> ------------------ Java Information ------------------
> Java Version:    1.4.2_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_12
> Java classpath:  classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  Yip
> Java user home:  C:\Documents and Settings\Yip
> Java user dir:   C:\work3\derby\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [es]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [fr]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [it]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ja_JP]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ko_KR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [pt_BR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_CN]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_TW]
>          version: 10.3.0.0 alpha - (443080)
> ------------------------------------------------------

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

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

Hi Mamta, I took a look at your patch and it makes sense to me. A handful of questions:

1) I was interested in why you chose to put the new logic into DataDictionaryImpl as
opposed to, perhaps, TablePrivilegeInfo.

2) I was wondering whether you thought that updateSYSCOLPERMSforAddColumnToUserTable()
could also be used, in the future, as part of solving DERBY-1909, and, if so, whether the
possible future reuse of this routine might run into any complications trying to share the code.

3) I was confused by this part of your change to DataDictionaryImpl (see below). Is this a
necessary part of the change, or is it some cleanup that you were doing as part of working
in this class?

@@ -2528,7 +2606,6 @@

 	{
 		ExecRow curRow;
 		PermissionsDescriptor perm;
-		ExecIndexRow newKey;
 		TabInfoImpl	ti = getNonCoreTI(SYSTABLEPERMS_CATALOG_NUM);
 		SYSTABLEPERMSRowFactory rf = (SYSTABLEPERMSRowFactory) ti.getCatalogRowFactory();
 
@@ -2560,7 +2637,6 @@

 	{
 		ExecRow curRow;
 		PermissionsDescriptor perm;
-		ExecIndexRow newKey;
 		TabInfoImpl	ti = getNonCoreTI(SYSCOLPERMS_CATALOG_NUM);
 		SYSCOLPERMSRowFactory rf = (SYSCOLPERMSRowFactory) ti.getCatalogRowFactory();
 
@@ -10223,9 +10299,7 @@

         // Remove cached permissions data. The cache may hold permissions data for this key even if
         // the row in the permissions table is new. In that case the cache may have an entry indicating no
         // permissions
-        Cacheable cacheEntry = getPermissionsCache().findCached( perm);
-        if( cacheEntry != null)
-            getPermissionsCache().remove( cacheEntry);
+		removePermEntryInCache(perm);
 
         //If we are dealing with grant, then the caller does not need to send 
         //any invalidation actions to anyone and hence return false


> SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1847
>                 URL: http://issues.apache.org/jira/browse/DERBY-1847
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.6, 10.2.2.0, 10.3.0.0
>         Environment: Any
>            Reporter: Yip Ng
>         Assigned To: Mamta A. Satoor
>         Attachments: DERBY1846_V1_diff_AddColumnAndGrantRevoke.txt, DERBY1846_V1_stat_AddColumnAndGrantRevoke.txt
>
>
> Following script causes the select statement below to assert in sane build. 
> ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij> create table t1 (c1 int, c2 int);
> 0 rows inserted/updated/deleted
> ij> grant select(c1,c2) on t1 to user2;
> 0 rows inserted/updated/deleted
> ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij(USER2)> set connection user1;
> ij(USER1)> alter table t1 add c3 int;
> 0 rows inserted/updated/deleted
> ij(USER1)> set connection user2;
> ij(USER2)> select c3 from user1.t1;
> ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.
> stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
> 	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
> 	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)
> sysinfo:
> ------------------ Java Information ------------------
> Java Version:    1.4.2_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_12
> Java classpath:  classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  Yip
> Java user home:  C:\Documents and Settings\Yip
> Java user dir:   C:\work3\derby\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [es]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [fr]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [it]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ja_JP]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ko_KR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [pt_BR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_CN]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_TW]
>          version: 10.3.0.0 alpha - (443080)
> ------------------------------------------------------

-- 
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-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

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

It looks like the permission cache is handled differently than the other descriptor caches.  When DataDictionary's startWriting()  is called, the other caches will be *ALL* cleared out except for the permission cache, where the actual removal of its cached items are done in various DDL contant actions(DROP TABLE/VIEW, etc.) and it only removes those associated cached permission descriptor(s) and not *ALL* of them.  So it seems like the permission cache clearing was left out  intentionally in clearCaches().  It would be helpful to know if this is indeed the case.


> SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1847
>                 URL: http://issues.apache.org/jira/browse/DERBY-1847
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.5, 10.3.0.0, 10.2.2.0
>         Environment: Any
>            Reporter: Yip Ng
>         Assigned To: Mamta A. Satoor
>
> Following script causes the select statement below to assert in sane build. 
> ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij> create table t1 (c1 int, c2 int);
> 0 rows inserted/updated/deleted
> ij> grant select(c1,c2) on t1 to user2;
> 0 rows inserted/updated/deleted
> ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij(USER2)> set connection user1;
> ij(USER1)> alter table t1 add c3 int;
> 0 rows inserted/updated/deleted
> ij(USER1)> set connection user2;
> ij(USER2)> select c3 from user1.t1;
> ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.
> stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
> 	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
> 	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)
> sysinfo:
> ------------------ Java Information ------------------
> Java Version:    1.4.2_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_12
> Java classpath:  classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  Yip
> Java user home:  C:\Documents and Settings\Yip
> Java user dir:   C:\work3\derby\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [es]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [fr]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [it]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ja_JP]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ko_KR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [pt_BR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_CN]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_TW]
>          version: 10.3.0.0 alpha - (443080)
> ------------------------------------------------------

-- 
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-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

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

Mamta A. Satoor reassigned DERBY-1847:
--------------------------------------

    Assignee: Mamta A. Satoor

> SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1847
>                 URL: http://issues.apache.org/jira/browse/DERBY-1847
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.5, 10.3.0.0, 10.2.2.0
>         Environment: Any
>            Reporter: Yip Ng
>         Assigned To: Mamta A. Satoor
>
> Following script causes the select statement below to assert in sane build. 
> ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij> create table t1 (c1 int, c2 int);
> 0 rows inserted/updated/deleted
> ij> grant select(c1,c2) on t1 to user2;
> 0 rows inserted/updated/deleted
> ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij(USER2)> set connection user1;
> ij(USER1)> alter table t1 add c3 int;
> 0 rows inserted/updated/deleted
> ij(USER1)> set connection user2;
> ij(USER2)> select c3 from user1.t1;
> ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.
> stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
> 	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
> 	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)
> sysinfo:
> ------------------ Java Information ------------------
> Java Version:    1.4.2_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_12
> Java classpath:  classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  Yip
> Java user home:  C:\Documents and Settings\Yip
> Java user dir:   C:\work3\derby\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [es]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [fr]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [it]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ja_JP]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ko_KR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [pt_BR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_CN]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_TW]
>          version: 10.3.0.0 alpha - (443080)
> ------------------------------------------------------

-- 
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-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

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

Mike Matrigali resolved DERBY-1847.
-----------------------------------

    Fix Version/s: 10.2.1.7
       Resolution: Fixed

backported fix from trunk to 10.2 branch.

> SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1847
>                 URL: http://issues.apache.org/jira/browse/DERBY-1847
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.6, 10.3.0.0, 10.2.2.0
>         Environment: Any
>            Reporter: Yip Ng
>         Assigned To: Mamta A. Satoor
>             Fix For: 10.2.1.7, 10.3.0.0
>
>         Attachments: DERBY1846_V1_diff_AddColumnAndGrantRevoke.txt, DERBY1846_V1_stat_AddColumnAndGrantRevoke.txt
>
>
> Following script causes the select statement below to assert in sane build. 
> ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij> create table t1 (c1 int, c2 int);
> 0 rows inserted/updated/deleted
> ij> grant select(c1,c2) on t1 to user2;
> 0 rows inserted/updated/deleted
> ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij(USER2)> set connection user1;
> ij(USER1)> alter table t1 add c3 int;
> 0 rows inserted/updated/deleted
> ij(USER1)> set connection user2;
> ij(USER2)> select c3 from user1.t1;
> ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.
> stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
> 	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
> 	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)
> sysinfo:
> ------------------ Java Information ------------------
> Java Version:    1.4.2_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_12
> Java classpath:  classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  Yip
> Java user home:  C:\Documents and Settings\Yip
> Java user dir:   C:\work3\derby\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [es]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [fr]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [it]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ja_JP]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ko_KR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [pt_BR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_CN]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_TW]
>          version: 10.3.0.0 alpha - (443080)
> ------------------------------------------------------

-- 
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-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462414 ] 

Bryan Pendleton commented on DERBY-1847:
----------------------------------------

Hi Yip, thanks for the review! My derbyall and suites.All runs were clean,
so I've committed d1847_useCPID_index.diff to the trunk as revision 492919.

I intend to merge this change to 10.2 and commit it there as well.


> SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1847
>                 URL: https://issues.apache.org/jira/browse/DERBY-1847
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.6, 10.2.2.0, 10.3.0.0
>         Environment: Any
>            Reporter: Yip Ng
>         Assigned To: Bryan Pendleton
>             Fix For: 10.2.3.0, 10.3.0.0
>
>         Attachments: d1847_useCPID_index.diff, DERBY1846_V1_diff_AddColumnAndGrantRevoke.txt, DERBY1846_V1_stat_AddColumnAndGrantRevoke.txt
>
>
> Following script causes the select statement below to assert in sane build. 
> ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij> create table t1 (c1 int, c2 int);
> 0 rows inserted/updated/deleted
> ij> grant select(c1,c2) on t1 to user2;
> 0 rows inserted/updated/deleted
> ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij(USER2)> set connection user1;
> ij(USER1)> alter table t1 add c3 int;
> 0 rows inserted/updated/deleted
> ij(USER1)> set connection user2;
> ij(USER2)> select c3 from user1.t1;
> ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.
> stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
> 	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
> 	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)
> sysinfo:
> ------------------ Java Information ------------------
> Java Version:    1.4.2_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_12
> Java classpath:  classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  Yip
> Java user home:  C:\Documents and Settings\Yip
> Java user dir:   C:\work3\derby\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [es]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [fr]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [it]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ja_JP]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ko_KR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [pt_BR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_CN]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_TW]
>          version: 10.3.0.0 alpha - (443080)
> ------------------------------------------------------

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

        

[jira] Updated: (DERBY-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

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

Bryan Pendleton updated DERBY-1847:
-----------------------------------

    Derby Info: [Patch Available]

> SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1847
>                 URL: http://issues.apache.org/jira/browse/DERBY-1847
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.6, 10.2.2.0, 10.3.0.0
>         Environment: Any
>            Reporter: Yip Ng
>         Assigned To: Bryan Pendleton
>             Fix For: 10.3.0.0, 10.2.1.8
>
>         Attachments: d1847_useCPID_index.diff, DERBY1846_V1_diff_AddColumnAndGrantRevoke.txt, DERBY1846_V1_stat_AddColumnAndGrantRevoke.txt
>
>
> Following script causes the select statement below to assert in sane build. 
> ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij> create table t1 (c1 int, c2 int);
> 0 rows inserted/updated/deleted
> ij> grant select(c1,c2) on t1 to user2;
> 0 rows inserted/updated/deleted
> ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij(USER2)> set connection user1;
> ij(USER1)> alter table t1 add c3 int;
> 0 rows inserted/updated/deleted
> ij(USER1)> set connection user2;
> ij(USER2)> select c3 from user1.t1;
> ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.
> stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
> 	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
> 	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)
> sysinfo:
> ------------------ Java Information ------------------
> Java Version:    1.4.2_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_12
> Java classpath:  classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  Yip
> Java user home:  C:\Documents and Settings\Yip
> Java user dir:   C:\work3\derby\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [es]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [fr]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [it]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ja_JP]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ko_KR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [pt_BR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_CN]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_TW]
>          version: 10.3.0.0 alpha - (443080)
> ------------------------------------------------------

-- 
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-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

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

Mamta A. Satoor updated DERBY-1847:
-----------------------------------

    Attachment: DERBY1846_V1_diff_AddColumnAndGrantRevoke.txt
                DERBY1846_V1_stat_AddColumnAndGrantRevoke.txt

I have attached a patch as DERBY1846_V1_diff_AddColumnAndGrantRevoke.txt
The output of svn stat -q is attached as DERBY1846_V1_stat_AddColumnAndGrantRevoke.txt

To recap the problem, in SQL Authorization mode, when a new column is added to a table, the rows in SYSCOLPERMS for the table in question were not getting updated to incorporate the new column. This caused ASSERT failure when a non-table owner attempted to select the new column.

Some background information on system table involved: SYSCOLPERMS keeps track of column level privileges on a given table. One of the columns in SYSCOLPERMS is "COLUMNS" and it has a bit map to show which columns have the given permission granted on them. When a new column is added to the user table, the "COLUMNS" need to be expanded by one bit and that bit should be initialized to zero since no privileges have been granted on that column at the ALTER TABLE...ADD COLUMN time.

I have fixed this problem by having AlterTableConstantAction.addNewColumnToTable call the new method in DataDictionary called updateSYSCOLPERMSforAddColumnToUserTable. At this point, we know of only the TableDescriptor's uuid which can help us determine all the rows in SYSCOLPERMS for that given table uuid. I get ColPermsDescriptor for each one of those rows and then use the ColPermsDescriptor's uuid to update the "COLUMNS" column so SYSCOLPERMS is aware of the newly added column in user table. This fixes the problem because at the time of SELECT, when we do privilege lookup in SYSCOLPERMS, we have info on the newly added column.

I have added few tests for this Jira entry in lang/grantRevokeDDL.sql The derbyall suite ran fine on Windows XP with Sun's jdk 1.4

Any feedback will be greatly appreciated.

> SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1847
>                 URL: http://issues.apache.org/jira/browse/DERBY-1847
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.6, 10.3.0.0, 10.2.2.0
>         Environment: Any
>            Reporter: Yip Ng
>         Assigned To: Mamta A. Satoor
>         Attachments: DERBY1846_V1_diff_AddColumnAndGrantRevoke.txt, DERBY1846_V1_stat_AddColumnAndGrantRevoke.txt
>
>
> Following script causes the select statement below to assert in sane build. 
> ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij> create table t1 (c1 int, c2 int);
> 0 rows inserted/updated/deleted
> ij> grant select(c1,c2) on t1 to user2;
> 0 rows inserted/updated/deleted
> ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij(USER2)> set connection user1;
> ij(USER1)> alter table t1 add c3 int;
> 0 rows inserted/updated/deleted
> ij(USER1)> set connection user2;
> ij(USER2)> select c3 from user1.t1;
> ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.
> stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
> 	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
> 	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)
> sysinfo:
> ------------------ Java Information ------------------
> Java Version:    1.4.2_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_12
> Java classpath:  classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  Yip
> Java user home:  C:\Documents and Settings\Yip
> Java user dir:   C:\work3\derby\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [es]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [fr]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [it]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ja_JP]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ko_KR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [pt_BR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_CN]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_TW]
>          version: 10.3.0.0 alpha - (443080)
> ------------------------------------------------------

-- 
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-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

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

Yip Ng reassigned DERBY-1847:
-----------------------------

    Assignee: Yip Ng

> SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1847
>                 URL: http://issues.apache.org/jira/browse/DERBY-1847
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.0, 10.3.0.0, 10.2.2.0
>         Environment: Any
>            Reporter: Yip Ng
>         Assigned To: Yip Ng
>
> Following script causes the select statement below to assert in sane build. 
> ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij> create table t1 (c1 int, c2 int);
> 0 rows inserted/updated/deleted
> ij> grant select(c1,c2) on t1 to user2;
> 0 rows inserted/updated/deleted
> ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij(USER2)> set connection user1;
> ij(USER1)> alter table t1 add c3 int;
> 0 rows inserted/updated/deleted
> ij(USER1)> set connection user2;
> ij(USER2)> select c3 from user1.t1;
> ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.
> stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
> 	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
> 	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)
> sysinfo:
> ------------------ Java Information ------------------
> Java Version:    1.4.2_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_12
> Java classpath:  classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  Yip
> Java user home:  C:\Documents and Settings\Yip
> Java user dir:   C:\work3\derby\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [es]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [fr]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [it]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ja_JP]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ko_KR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [pt_BR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_CN]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_TW]
>          version: 10.3.0.0 alpha - (443080)
> ------------------------------------------------------

-- 
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-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

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

Mamta A. Satoor updated DERBY-1847:
-----------------------------------

    Derby Info: [Patch Available]

> SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1847
>                 URL: http://issues.apache.org/jira/browse/DERBY-1847
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.6, 10.3.0.0, 10.2.2.0
>         Environment: Any
>            Reporter: Yip Ng
>         Assigned To: Mamta A. Satoor
>         Attachments: DERBY1846_V1_diff_AddColumnAndGrantRevoke.txt, DERBY1846_V1_stat_AddColumnAndGrantRevoke.txt
>
>
> Following script causes the select statement below to assert in sane build. 
> ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij> create table t1 (c1 int, c2 int);
> 0 rows inserted/updated/deleted
> ij> grant select(c1,c2) on t1 to user2;
> 0 rows inserted/updated/deleted
> ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij(USER2)> set connection user1;
> ij(USER1)> alter table t1 add c3 int;
> 0 rows inserted/updated/deleted
> ij(USER1)> set connection user2;
> ij(USER2)> select c3 from user1.t1;
> ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.
> stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
> 	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
> 	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)
> sysinfo:
> ------------------ Java Information ------------------
> Java Version:    1.4.2_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_12
> Java classpath:  classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  Yip
> Java user home:  C:\Documents and Settings\Yip
> Java user dir:   C:\work3\derby\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [es]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [fr]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [it]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ja_JP]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ko_KR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [pt_BR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_CN]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_TW]
>          version: 10.3.0.0 alpha - (443080)
> ------------------------------------------------------

-- 
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-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

Posted by "Yip Ng (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-1847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12461634 ] 

Yip Ng commented on DERBY-1847:
-------------------------------

Thanks Bryan for the patch/  I am running some tests with it.  I'll be able to review the patch fully tomorrow and provide some 
feedback.

> SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1847
>                 URL: http://issues.apache.org/jira/browse/DERBY-1847
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.6, 10.2.2.0, 10.3.0.0
>         Environment: Any
>            Reporter: Yip Ng
>         Assigned To: Bryan Pendleton
>             Fix For: 10.2.3.0, 10.3.0.0
>
>         Attachments: d1847_useCPID_index.diff, DERBY1846_V1_diff_AddColumnAndGrantRevoke.txt, DERBY1846_V1_stat_AddColumnAndGrantRevoke.txt
>
>
> Following script causes the select statement below to assert in sane build. 
> ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij> create table t1 (c1 int, c2 int);
> 0 rows inserted/updated/deleted
> ij> grant select(c1,c2) on t1 to user2;
> 0 rows inserted/updated/deleted
> ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij(USER2)> set connection user1;
> ij(USER1)> alter table t1 add c3 int;
> 0 rows inserted/updated/deleted
> ij(USER1)> set connection user2;
> ij(USER2)> select c3 from user1.t1;
> ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.
> stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
> 	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
> 	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)
> sysinfo:
> ------------------ Java Information ------------------
> Java Version:    1.4.2_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_12
> Java classpath:  classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  Yip
> Java user home:  C:\Documents and Settings\Yip
> Java user dir:   C:\work3\derby\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [es]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [fr]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [it]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ja_JP]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ko_KR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [pt_BR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_CN]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_TW]
>          version: 10.3.0.0 alpha - (443080)
> ------------------------------------------------------

-- 
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-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

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

Bryan Pendleton updated DERBY-1847:
-----------------------------------

    Attachment: d1847_useCPID_index.diff

I believe that updateSYSCOLPERMSforAddColumnToUserTable
actually has the correct index row available, because it's just used
that row to fetch the base table row to update. So I think the fix is as
simple as passing that index row to the ti.updateRow() call and
specifying the COLPERMSID_INDEX_NUM rather than the
TABLEID_INDEX_NUM. Attached is d1847_useCPID_index.diff,
a proposed patch for this issue which includes the above code
change, and a simple new regression test based on the repro
script I posted before.

I'm running all the tests now, to see if this causes any other problems.

Please review the change and let me know what you think.


> SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1847
>                 URL: http://issues.apache.org/jira/browse/DERBY-1847
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.6, 10.3.0.0, 10.2.2.0
>         Environment: Any
>            Reporter: Yip Ng
>         Assigned To: Bryan Pendleton
>             Fix For: 10.3.0.0, 10.2.1.8
>
>         Attachments: d1847_useCPID_index.diff, DERBY1846_V1_diff_AddColumnAndGrantRevoke.txt, DERBY1846_V1_stat_AddColumnAndGrantRevoke.txt
>
>
> Following script causes the select statement below to assert in sane build. 
> ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij> create table t1 (c1 int, c2 int);
> 0 rows inserted/updated/deleted
> ij> grant select(c1,c2) on t1 to user2;
> 0 rows inserted/updated/deleted
> ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij(USER2)> set connection user1;
> ij(USER1)> alter table t1 add c3 int;
> 0 rows inserted/updated/deleted
> ij(USER1)> set connection user2;
> ij(USER2)> select c3 from user1.t1;
> ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.
> stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
> 	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
> 	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)
> sysinfo:
> ------------------ Java Information ------------------
> Java Version:    1.4.2_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_12
> Java classpath:  classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  Yip
> Java user home:  C:\Documents and Settings\Yip
> Java user dir:   C:\work3\derby\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [es]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [fr]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [it]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ja_JP]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ko_KR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [pt_BR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_CN]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_TW]
>          version: 10.3.0.0 alpha - (443080)
> ------------------------------------------------------

-- 
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-1847) SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode

Posted by "Yip Ng (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12461911 ] 

Yip Ng commented on DERBY-1847:
-------------------------------

Hi Bryan, the changes look reasonable to me.  +1 commit if regression passes successfully.

> SELECT statement asserts with XJ001 when attempted to select a newly added column in SQL authorization mode
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1847
>                 URL: https://issues.apache.org/jira/browse/DERBY-1847
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.1.6, 10.2.2.0, 10.3.0.0
>         Environment: Any
>            Reporter: Yip Ng
>         Assigned To: Bryan Pendleton
>             Fix For: 10.2.3.0, 10.3.0.0
>
>         Attachments: d1847_useCPID_index.diff, DERBY1846_V1_diff_AddColumnAndGrantRevoke.txt, DERBY1846_V1_stat_AddColumnAndGrantRevoke.txt
>
>
> Following script causes the select statement below to assert in sane build. 
> ij> connect 'jdbc:derby:wombat;create=true' user 'user1' as user1;
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij> create table t1 (c1 int, c2 int);
> 0 rows inserted/updated/deleted
> ij> grant select(c1,c2) on t1 to user2;
> 0 rows inserted/updated/deleted
> ij> connect 'jdbc:derby:wombat;create=true' user 'user2' as user2;
> WARNING 01J01: Database 'wombat' not created, connection made to existing database instead.
> WARNING 01J14: SQL authorization is being used without first enabling authentication.
> ij(USER2)> set connection user1;
> ij(USER1)> alter table t1 add c3 int;
> 0 rows inserted/updated/deleted
> ij(USER1)> set connection user2;
> ij(USER2)> select c3 from user1.t1;
> ERROR XJ001: Java exception: 'ASSERT FAILED Attempt to get a bit position (2)that exceeds the max length (2): org.apache.derby.shared.common.sanity.AssertFailure'.
> stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED Attempt to get a bit position (1)that exceeds the max length (1)
> 	at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.isSet(FormatableBitSet.java:614)
> 	at org.apache.derby.iapi.services.io.FormatableBitSet.get(FormatableBitSet.java:643)
> 	at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:119)
> 	at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.fillResultSet(Unknown Source)
> 	at org.apache.derby.exe.ac601a400fx010dxaa5bx09e8x00000013b9400.execute(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268)
> 	at org.apache.derby.impl.tools.ij.Main.go(Main.java:204)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170)
> 	at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56)
> 	at org.apache.derby.tools.ij.main(ij.java:71)
> sysinfo:
> ------------------ Java Information ------------------
> Java Version:    1.4.2_12
> Java Vendor:     Sun Microsystems Inc.
> Java home:       C:\Program Files\Java\j2re1.4.2_12
> Java classpath:  classes;.
> OS name:         Windows XP
> OS architecture: x86
> OS version:      5.1
> Java user name:  Yip
> Java user home:  C:\Documents and Settings\Yip
> Java user dir:   C:\work3\derby\trunk
> java.specification.name: Java Platform API Specification
> java.specification.version: 1.4
> --------- Derby Information --------
> JRE - JDBC: J2SE 1.4.2 - JDBC 3.0
> [C:\work3\derby\trunk\classes] 10.3.0.0 alpha - (443080)
> ------------------------------------------------------
> ----------------- Locale Information -----------------
> Current Locale :  [English/United States [en_US]]
> Found support for locale: [de_DE]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [es]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [fr]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [it]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ja_JP]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [ko_KR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [pt_BR]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_CN]
>          version: 10.3.0.0 alpha - (443080)
> Found support for locale: [zh_TW]
>          version: 10.3.0.0 alpha - (443080)
> ------------------------------------------------------

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