ROWNUM and ROWID not considered reserved words
Bug #393945 reported by
Jason Baker
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Storm |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
ROWNUM and ROWID are not currently considered reserved words. These are pseudo-columns, so adding them as reserved words would make a query like this fail since ROWNUM would be escaped:
SELECT * FROM(
SELECT a, b, c FROM t;
) WHERE ROWNUM < 3
This has the side effect of making it difficult to do things like this:
SQL> CREATE TABLE "ROWNUM" (a int, b int);
Table created.
SQL> SELECT * FROM "ROWNUM";
no rows selected
A better solution would probably be to have an "allowed in WHERE" word list.
Related branches
Changed in storm: | |
status: | New → Confirmed |
To post a comment you must log in.
If you want to use rownum as part of a generated expression inside the Oracle backend, you could do something like:
from storm.expr import Column
rownum = Column("ROWNUM")
Then you could use it in the expression you're generating.
As for supporting a real table or column called "ROWNUM", I wouldn't worry too much. Each of the backends have their quirks, and if Oracle doesn't like you creating tables called ROWNUM then so be it.