You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by km...@apache.org on 2009/06/17 18:29:36 UTC

svn commit: r785707 - in /db/derby/code/branches/10.5/java: engine/org/apache/derby/impl/sql/compile/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTests/tests/lang/

Author: kmarsden
Date: Wed Jun 17 16:29:36 2009
New Revision: 785707

URL: http://svn.apache.org/viewvc?rev=785707&view=rev
Log:
DERBY-4268 "SECURITY" is reserved as SQL keyword.

Contributed by Lily Wei (lilywei at yahoo dot com)

Modified:
    db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
    db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/master/nonreserved.out
    db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/lang/nonreserved.sql

Modified: db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj?rev=785707&r1=785706&r2=785707&view=diff
==============================================================================
--- db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj (original)
+++ db/derby/code/branches/10.5/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj Wed Jun 17 16:29:36 2009
@@ -13927,6 +13927,7 @@
 	|   tok = <RS>
 	|	tok = <SCALE>
 	|	tok = <SAVEPOINT>
+	|	tok = <SECURITY>
 	|	tok = <SEQUENCE>
 	|	tok = <SEQUENTIAL>
 	|	tok = <SERIALIZABLE>

Modified: db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/master/nonreserved.out
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/master/nonreserved.out?rev=785707&r1=785706&r2=785707&view=diff
==============================================================================
--- db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/master/nonreserved.out (original)
+++ db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/master/nonreserved.out Wed Jun 17 16:29:36 2009
@@ -472,4 +472,31 @@
 ERROR 42903: Invalid use of an aggregate function.
 ij> drop table t1;
 0 rows inserted/updated/deleted
+ij> -- making SECURITY keyword nonreserved as fix for Derby-4268
+create table SECURITY (security int);
+0 rows inserted/updated/deleted
+ij> insert into security values (1);
+1 row inserted/updated/deleted
+ij> select security from security where security > 0;
+SECURITY   
+-----------
+1          
+ij> select security from security security where security > 0;
+SECURITY   
+-----------
+1          
+ij> select security.security from security where security.security > 0;
+SECURITY   
+-----------
+1          
+ij> prepare security as 'select * from security';
+ij> execute security;
+SECURITY   
+-----------
+1          
+ij> create index security on security(security);
+0 rows inserted/updated/deleted
+ij> drop table SECURITY;
+0 rows inserted/updated/deleted
+ij> remove security;
 ij> 
\ No newline at end of file

Modified: db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/lang/nonreserved.sql
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/lang/nonreserved.sql?rev=785707&r1=785706&r2=785707&view=diff
==============================================================================
--- db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/lang/nonreserved.sql (original)
+++ db/derby/code/branches/10.5/java/testing/org/apache/derbyTesting/functionTests/tests/lang/nonreserved.sql Wed Jun 17 16:29:36 2009
@@ -223,3 +223,15 @@
 select count(i) from t1;
 select * from t1 where count(i)=i;
 drop table t1; 
+
+-- making SECURITY keyword nonreserved as fix for Derby-4268
+create table SECURITY (security int);
+insert into security values (1);
+select security from security where security > 0;
+select security from security security where security > 0;
+select security.security from security where security.security > 0;
+prepare security as 'select * from security';
+execute security;
+create index security on security(security);
+drop table SECURITY;
+remove security;