File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
main/jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/test/create Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -300,7 +300,7 @@ TOKEN : /* Operators */
300
300
301
301
TOKEN : /* Date/Time with time zones */
302
302
{
303
- <DT_ZONE: <K_DATETIMELITERAL> <WHITESPACE> (< K_WITH> | <K_WITHOUT>) <WHITESPACE> "TIME" <WHITESPACE> <K_ZONE>>
303
+ <DT_ZONE: <K_DATETIMELITERAL> ( <WHITESPACE>)* ("(" <S_LONG> ")")? (<WHITESPACE>)* (< K_WITH> | <K_WITHOUT>) ( <WHITESPACE>)+ "TIME" ( <WHITESPACE>)+ <K_ZONE>>
304
304
}
305
305
306
306
TOKEN : /* Numeric Constants */
Original file line number Diff line number Diff line change @@ -255,6 +255,15 @@ public void testCreateUnitonIssue402() throws JSQLParserException {
255
255
public void testCreateUnitonIssue402_2 () throws JSQLParserException {
256
256
assertSqlCanBeParsedAndDeparsed ("CREATE TABLE temp.abc AS (SELECT sku FROM temp.a UNION SELECT sku FROM temp.b)" );
257
257
}
258
+
259
+ public void testTimestampWithTimezone () throws JSQLParserException {
260
+ assertSqlCanBeParsedAndDeparsed ("CREATE TABLE country_region (" +
261
+ "regionid BIGINT NOT NULL CONSTRAINT pk_auth_region PRIMARY KEY, " +
262
+ "region_name VARCHAR (100) NOT NULL, " +
263
+ "creation_date TIMESTAMP (0) WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP (0) NOT NULL, " +
264
+ "last_change_date TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP (0), " +
265
+ "CONSTRAINT region_name_unique UNIQUE (region_name))" );
266
+ }
258
267
259
268
public void testRUBiSCreateList () throws Exception {
260
269
BufferedReader in = new BufferedReader (new InputStreamReader (CreateTableTest .class .
You can’t perform that action at this time.
0 commit comments