Skip to content

Commit

Permalink
informix-sql: add support of set auto free.
Browse files Browse the repository at this point in the history
  • Loading branch information
hellozrh committed Jul 20, 2023
1 parent e29ee68 commit 5a55893
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sql/informix-sql/InformixSQLLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ AND: 'AND';
AS: 'AS';
ASC: 'ASC';
ATTACH: 'ATTACH';
AUTOFREE: 'AUTOFREE';
AUTOINCREMENT: 'AUTOINCREMENT';
BEFORE: 'BEFORE';
BEGIN: 'BEGIN';
Expand Down Expand Up @@ -95,10 +96,12 @@ DEFERRED: 'DEFERRED';
DELETE: 'DELETE';
DESC: 'DESC';
DETACH: 'DETACH';
DISABLED: 'DISABLED';
DISTINCT: 'DISTINCT';
DROP: 'DROP';
EACH: 'EACH';
ELSE: 'ELSE';
ENABLED: 'ENABLED';
END: 'END';
ESCAPE: 'ESCAPE';
EXCEPT: 'EXCEPT';
Expand Down
9 changes: 9 additions & 0 deletions sql/informix-sql/InformixSQLParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ unitStatement
| renameUser
| rollbackWork
| savepointStmt
| setAutofree
) SCOL
;

Expand Down Expand Up @@ -221,6 +222,11 @@ savepointStmt
: SAVEPOINT savepoint=identifier UNIQUE?
;

//https://www.ibm.com/docs/en/informix-servers/14.10?topic=statements-set-autofree-statement
setAutofree
: SET AUTOFREE (ENABLED | DISABLED)? (FOR (cursorId=identifier | cursorIdVar=anyName))?
;

anyName
: IDENTIFIER
| keyword
Expand All @@ -246,6 +252,7 @@ keyword
| AS
| ASC
| ATTACH
| AUTOFREE
| AUTOINCREMENT
| BEFORE
| BEGIN
Expand Down Expand Up @@ -275,10 +282,12 @@ keyword
| DELETE
| DESC
| DETACH
| DISABLED
| DISTINCT
| DROP
| EACH
| ELSE
| ENABLED
| END
| ESCAPE
| EXCEPT
Expand Down
6 changes: 6 additions & 0 deletions sql/informix-sql/examples/setautoFree.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SET AUTOFREE ;
SET AUTOFREE ENABLED;
SET AUTOFREE DISABLED;
SET AUTOFREE DISABLED FOR idd;


0 comments on commit 5a55893

Please sign in to comment.