Skip to content

Commit c412d6a

Browse files
feat: add DB2 special register CURRENT TIMEZONE
fixes #1949 Signed-off-by: Andreas Reichel <[email protected]>
1 parent b9453f2 commit c412d6a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt

+1
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ TOKEN: /* SQL Keywords. prefixed with K_ to avoid name clashes */
427427
("CURRENT" ( "_" | (" ")+ ) "TIMESTAMP")
428428
| ("CURRENT" ( "_" | (" ")+ ) "TIME")
429429
| ("CURRENT" ( "_" | (" ")+ ) "DATE")
430+
| ("CURRENT" ( "_" | (" ")+ ) "TIMEZONE")
430431
) ( "()" )?>
431432
| <K_TIMEOUT:"TIMEOUT">
432433
| <K_TRIM:"TRIM">
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package net.sf.jsqlparser.statement.select;
2+
3+
import net.sf.jsqlparser.JSQLParserException;
4+
import net.sf.jsqlparser.test.TestUtils;
5+
import org.junit.jupiter.api.Test;
6+
7+
public class DB2Test {
8+
@Test
9+
void testDB2SpecialRegister() throws JSQLParserException {
10+
String sqlStr = "SELECT * FROM TABLE1 where COL_WITH_TIMESTAMP <= CURRENT TIMESTAMP - CURRENT TIMEZONE";
11+
TestUtils.assertSqlCanBeParsedAndDeparsed(sqlStr, true);
12+
}
13+
}

0 commit comments

Comments
 (0)