Issue Details (XML | Word | Printable)

Key: DERBY-468
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: Satheesh Bandaram
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

Unreserve COUNT keyword, if possible.

Created: 23/Jul/05 06:06 AM   Updated: 30/Sep/05 02:45 AM
Return to search
Component/s: SQL
Affects Version/s: 10.0.2.0, 10.1.1.0, 10.2.1.6
Fix Version/s: 10.1.2.1, 10.2.1.6

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works count.patch 2005-09-02 08:28 AM Satheesh Bandaram 5 kB
Environment: All Platforms

Resolution Date: 30/Sep/05 02:45 AM


 Description  « Hide
Derby currently treats COUNT as a reserved word. This prevents having COUNT as a table name or a column name as shown below. It would be good to move COUNT from reserved word to a non-reserved word list. Having COUNT as a reserved word also causes problems while porting applications to Derby.

ij> create table count(i int);
ERROR 42X01: Syntax error: Encountered "count" at line 1, column 14.
ij> create table ts(count int);
ERROR 42X01: Syntax error: Encountered "count" at line 1, column 17.

Note that SQL standard says COUNT is a reserved word, but Derby treats several of these reserved words as non-reserved words already. (CLOB for example)

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Philip Wilder added a comment - 23/Jul/05 10:20 AM
Would removing count from the reserved words list potentially create problems with the count aggregate function?

Repository Revision Date User Message
ASF #266286 Fri Sep 02 05:10:17 UTC 2005 bandaram DERBY-468: Unreserve COUNT keyword, so it can be used as an identifier.

Submitted by Satheesh Bandaram (satheesh@sourcery.org)
Files Changed
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/nonreserved.sql
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/nonreserved.out

Satheesh Bandaram added a comment - 02/Sep/05 08:28 AM
I am attaching a patch for this. Though I ran derbyAll yesterday, I made a slight change to the patch, so I will run the tests again and submit the fix tomorrow.

Satheesh Bandaram made changes - 02/Sep/05 08:28 AM
Field Original Value New Value
Attachment count.patch [ 12312144 ]
Repository Revision Date User Message
ASF #267247 Fri Sep 02 18:23:07 UTC 2005 bandaram DERBY-468: Unreserve COUNT keyword, so it can be used as an identifier.

Merged from trunk to 10.1 branch.

Submitted by Satheesh Bandaram (satheesh@sourcery.org)
Files Changed
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/nonreserved.out
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/nonreserved.sql
MODIFY /db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj

Satheesh Bandaram added a comment - 03/Sep/05 03:24 AM
Fix submitted to trunk. Also merged the fix to 10.1 branch.

Sending java\engine\org\apache\derby\impl\sql\compile\sqlgrammar.jj
Sending java\testing\org\apache\derbyTesting\functionTests\master\nonreserved.out
Sending java\testing\org\apache\derbyTesting\functionTests\tests\lang\nonreserved.sql
Transmitting file data ...
Committed revision 267247.

Satheesh Bandaram added a comment - 03/Sep/05 03:25 AM
Fix has been merged into trunk and 10.1 branches.

Satheesh Bandaram made changes - 03/Sep/05 03:25 AM
Fix Version/s 10.1.2.0 [ 12310270 ]
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 10.2.0.0 [ 11187 ]
Satheesh Bandaram added a comment - 03/Sep/05 06:29 AM
Fix submitted.

Satheesh Bandaram made changes - 03/Sep/05 06:29 AM
Status Resolved [ 5 ] Closed [ 6 ]
Deepa Remesh added a comment - 30/Sep/05 02:45 AM
reopening to fix fix version

Deepa Remesh made changes - 30/Sep/05 02:45 AM
Status Closed [ 6 ] Reopened [ 4 ]
Resolution Fixed [ 1 ]
Deepa Remesh made changes - 30/Sep/05 02:45 AM
Fix Version/s 10.1.1.1 [ 12310332 ]
Deepa Remesh made changes - 30/Sep/05 02:45 AM
Status Reopened [ 4 ] Closed [ 6 ]
Resolution Fixed [ 1 ]