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 dj...@apache.org on 2005/02/10 01:46:03 UTC

svn commit: r153138 - in incubator/derby/code/branches/10.0/java: engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj testing/org/apache/derbyTesting/functionTests/master/identifier.out testing/org/apache/derbyTesting/functionTests/tests/lang/identifier.sql

Author: djd
Date: Wed Feb  9 16:45:58 2005
New Revision: 153138

URL: http://svn.apache.org/viewcvs?view=rev&rev=153138
Log:
Fix Derby-139, unreserved LOCAL keyword to allow use as table name etc.
Merge of 153095 from Derby's trunk.

Modified:
    incubator/derby/code/branches/10.0/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
    incubator/derby/code/branches/10.0/java/testing/org/apache/derbyTesting/functionTests/master/identifier.out
    incubator/derby/code/branches/10.0/java/testing/org/apache/derbyTesting/functionTests/tests/lang/identifier.sql

Modified: incubator/derby/code/branches/10.0/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
URL: http://svn.apache.org/viewcvs/incubator/derby/code/branches/10.0/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj?view=diff&r1=153137&r2=153138
==============================================================================
--- incubator/derby/code/branches/10.0/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj (original)
+++ incubator/derby/code/branches/10.0/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj Wed Feb  9 16:45:58 2005
@@ -1694,7 +1694,6 @@
 |	<LAST: "last">
 |	<LEFT: "left">
 |	<LIKE: "like">
-|	<LOCAL: "local">
 |	<LOWER: "lower">
 |	<MATCH: "match">
 |	<MAX: "max">
@@ -11059,6 +11058,9 @@
 
 		NOTE: The same ones are commented out here as above in the token
 		rule, for the same reason.
+		
+		Derby-139 - LOCAL removed as reserved word as most other
+		databases do not enforce it. LOCAL not used at all in grammar so token removed.
 	 */
 	(
  	/* SQL92 reserved Keywords */
@@ -11173,7 +11175,6 @@
 |	tok = <LAST>
 |	tok = <LEFT>
 |	tok = <LIKE>
-|	tok = <LOCAL>
 |	tok = <LOWER>
 |	tok = <MATCH>
 |	tok = <MAX>

Modified: incubator/derby/code/branches/10.0/java/testing/org/apache/derbyTesting/functionTests/master/identifier.out
URL: http://svn.apache.org/viewcvs/incubator/derby/code/branches/10.0/java/testing/org/apache/derbyTesting/functionTests/master/identifier.out?view=diff&r1=153137&r2=153138
==============================================================================
--- incubator/derby/code/branches/10.0/java/testing/org/apache/derbyTesting/functionTests/master/identifier.out (original)
+++ incubator/derby/code/branches/10.0/java/testing/org/apache/derbyTesting/functionTests/master/identifier.out Wed Feb  9 16:45:58 2005
@@ -252,6 +252,29 @@
 2          |2          
 ij> DROP TABLE ZONE;
 0 rows inserted/updated/deleted
+ij> CREATE TABLE LOCAL (LOCAL INT, A INT);
+0 rows inserted/updated/deleted
+ij> INSERT INTO LOCAL (LOCAL) VALUES (1);
+1 row inserted/updated/deleted
+ij> INSERT INTO LOCAL VALUES (2, 2);
+1 row inserted/updated/deleted
+ij> SELECT * FROM LOCAL;
+LOCAL      |A          
+-----------------------
+1          |NULL       
+2          |2          
+ij> SELECT LOCAL.LOCAL, LOCAL FROM LOCAL;
+LOCAL      |LOCAL      
+-----------------------
+1          |1          
+2          |2          
+ij> SELECT LOCAL.LOCAL, LOCAL FROM LOCAL LOCAL;
+LOCAL      |LOCAL      
+-----------------------
+1          |1          
+2          |2          
+ij> DROP TABLE LOCAL;
+0 rows inserted/updated/deleted
 ij> -- Negative tests
 -- Novera wanted 0-length delimited identifiers but for db2-compatibility, we are going to stop supporting 0-length delimited identifiers
 -- test1

Modified: incubator/derby/code/branches/10.0/java/testing/org/apache/derbyTesting/functionTests/tests/lang/identifier.sql
URL: http://svn.apache.org/viewcvs/incubator/derby/code/branches/10.0/java/testing/org/apache/derbyTesting/functionTests/tests/lang/identifier.sql?view=diff&r1=153137&r2=153138
==============================================================================
--- incubator/derby/code/branches/10.0/java/testing/org/apache/derbyTesting/functionTests/tests/lang/identifier.sql (original)
+++ incubator/derby/code/branches/10.0/java/testing/org/apache/derbyTesting/functionTests/tests/lang/identifier.sql Wed Feb  9 16:45:58 2005
@@ -150,6 +150,13 @@
 SELECT ZONE.ZONE, ZONE FROM ZONE ZONE;
 DROP TABLE ZONE;
 
+CREATE TABLE LOCAL (LOCAL INT, A INT);
+INSERT INTO LOCAL (LOCAL) VALUES (1);
+INSERT INTO LOCAL VALUES (2, 2);
+SELECT * FROM LOCAL;
+SELECT LOCAL.LOCAL, LOCAL FROM LOCAL;
+SELECT LOCAL.LOCAL, LOCAL FROM LOCAL LOCAL;
+DROP TABLE LOCAL;
 
 -- Negative tests
 -- Novera wanted 0-length delimited identifiers but for db2-compatibility, we are going to stop supporting 0-length delimited identifiers