-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tree: make SET TRANSACTION a walkable statement
SET TRANSACTION is now a walkable statement. This fixes a bug where placeholders in a SET TRANSACTION statement were not resolved correctly. The statement must be walkable for the placeholderAnnotationVisitor to work correctly -- it is an AST visitor that relies on walkStmt to discover all placeholders in a statement. Release note (bug fix): Placeholder arguments can now be used in SET TRANSACTION statements.
- Loading branch information
Showing
3 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# This test relies on a CoockroachDB-specific feature, so everything | ||
# is marked as crdb_only. | ||
|
||
only crdb | ||
---- | ||
|
||
send | ||
Query {"String": "BEGIN"} | ||
---- | ||
|
||
until | ||
ReadyForQuery | ||
---- | ||
{"Type":"CommandComplete","CommandTag":"BEGIN"} | ||
{"Type":"ReadyForQuery","TxStatus":"T"} | ||
|
||
send | ||
Parse {"Query": "SET TRANSACTION AS OF SYSTEM TIME $1::timestamp"} | ||
Bind {"Parameters": [{"text":"2019-01-01 00:00:00"}]} | ||
Execute | ||
Sync | ||
Query {"String": "SELECT now()"} | ||
Query {"String": "COMMIT"} | ||
---- | ||
|
||
until ignore=RowDescription | ||
ReadyForQuery | ||
ReadyForQuery | ||
ReadyForQuery | ||
---- | ||
{"Type":"ParseComplete"} | ||
{"Type":"BindComplete"} | ||
{"Type":"CommandComplete","CommandTag":"SET TRANSACTION"} | ||
{"Type":"ReadyForQuery","TxStatus":"T"} | ||
{"Type":"DataRow","Values":[{"text":"2019-01-01 00:00:00+00"}]} | ||
{"Type":"CommandComplete","CommandTag":"SELECT 1"} | ||
{"Type":"ReadyForQuery","TxStatus":"T"} | ||
{"Type":"CommandComplete","CommandTag":"COMMIT"} | ||
{"Type":"ReadyForQuery","TxStatus":"I"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters