Skip to content

Commit

Permalink
[plsql] Fix for 4357 (#4359)
Browse files Browse the repository at this point in the history
* Fix for 4357.

* Fixed bad changes for PR.

* I didn't check in the right grammar change!
* I didn't check in the right example, either!
* Added the "no ambiguity" example.
  • Loading branch information
kaby76 authored Dec 19, 2024
1 parent 451d59c commit 3f0c7e6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sql/plsql/PlSqlParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -7400,7 +7400,7 @@ constant
| MINUTE
| SECOND
) ('(' (UNSIGNED_INTEGER | bind_variable) (',' (UNSIGNED_INTEGER | bind_variable))? ')')? (
TO (DAY | HOUR | MINUTE | SECOND ('(' (UNSIGNED_INTEGER | bind_variable) ')')?)
TO (MONTH | DAY | HOUR | MINUTE | SECOND ('(' (UNSIGNED_INTEGER | bind_variable) ')')?)
)?
| numeric
| DATE quoted_string
Expand Down
1 change: 1 addition & 0 deletions sql/plsql/examples/4357-not-ambig.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select interval '0 02:30:00' day to second;
6 changes: 6 additions & 0 deletions sql/plsql/examples/4357.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CREATE TABLE CUSTOMERS_TEST (
id NUMBER PRIMARY KEY,
CUSTOMER_MEMBERSHIP_DURATION INTERVAL YEAR TO MONTH,
CUSTOMER_CALL_DURATION INTERVAL DAY TO SECOND(2)
);
INSERT INTO CUSTOMERS_TEST (ID,CUSTOMER_MEMBERSHIP_DURATION,CUSTOMER_CALL_DURATION) VALUES (1, INTERVAL '1-6' YEAR TO MONTH, INTERVAL '0 02:30:00' DAY TO SECOND(2));

0 comments on commit 3f0c7e6

Please sign in to comment.