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/16 18:01:58 UTC
svn commit: r785271 - in /db/derby/code/trunk/java:
engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
testing/org/apache/derbyTesting/functionTests/master/nonreserved.out
testing/org/apache/derbyTesting/functionTests/tests/lang/nonreserved.sql
Author: kmarsden
Date: Tue Jun 16 16:01:58 2009
New Revision: 785271
URL: http://svn.apache.org/viewvc?rev=785271&view=rev
Log:
DERBY-4268 "SECURITY" is reserved as SQL keyword.
Made security unreserved and added a regression test.
Contributed by Lily Wei (lilywei at yahoo dot com)
Modified:
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/nonreserved.out
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/nonreserved.sql
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj?rev=785271&r1=785270&r2=785271&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj Tue Jun 16 16:01:58 2009
@@ -13927,6 +13927,7 @@
| tok = <RS>
| tok = <SCALE>
| tok = <SAVEPOINT>
+ | tok = <SECURITY>
| tok = <SEQUENCE>
| tok = <SEQUENTIAL>
| tok = <SERIALIZABLE>
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/nonreserved.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/nonreserved.out?rev=785271&r1=785270&r2=785271&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/nonreserved.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/nonreserved.out Tue Jun 16 16:01:58 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/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/nonreserved.sql
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/nonreserved.sql?rev=785271&r1=785270&r2=785271&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/nonreserved.sql (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/nonreserved.sql Tue Jun 16 16:01:58 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;