Skip to content

Commit db7a04e

Browse files
committed
Support for the FOR TIMESTAMP query hint
1 parent 20daad1 commit db7a04e

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

parser/sql/engine/dialect/sqlserver/src/main/antlr4/imports/sqlserver/DMLStatement.g4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ queryHint
351351
| USE HINT LP_ useHitName (COMMA_ useHitName)* RP_
352352
| USE PLAN NCHAR_TEXT
353353
| LABEL EQ_ stringLiterals
354+
| FOR TIMESTAMP AS OF stringLiterals
354355
;
355356

356357
optimizeForParameter

test/it/parser/src/main/resources/case/dml/select.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11760,4 +11760,13 @@
1176011760
<simple-table name="Person" start-index="14" stop-index="19" />
1176111761
</from>
1176211762
</select>
11763+
11764+
<select sql-case-id="select_for_timestamp_as_of_hint">
11765+
<projections start-index="7" stop-index="7">
11766+
<shorthand-projection start-index="7" stop-index="7" />
11767+
</projections>
11768+
<from>
11769+
<simple-table name="Person" start-index="14" stop-index="19" />
11770+
</from>
11771+
</select>
1176311772
</sql-parser-test-cases>

test/it/parser/src/main/resources/sql/supported/dml/select.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,4 +374,5 @@
374374
<sql-case id="select_fast_hint" value="SELECT * FROM Person OPTION (HASH GROUP, FAST 10);" db-types="SQLServer"/>
375375
<sql-case id="select_use_hint" value="SELECT * FROM Person OPTION (RECOMPILE, USE HINT ('ASSUME_MIN_SELECTIVITY_FOR_FILTER_ESTIMATES', 'DISABLE_PARAMETER_SNIFFING'));" db-types="SQLServer"/>
376376
<sql-case id="select_maxdop_hint" value="SELECT * FROM Person OPTION (MAXDOP 2);" db-types="SQLServer"/>
377+
<sql-case id="select_for_timestamp_as_of_hint" value="SELECT * FROM Person OPTION (FOR TIMESTAMP AS OF '2024-03-13T19:39:35.28');" db-types="SQLServer"/>
377378
</sql-cases>

0 commit comments

Comments
 (0)