Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: add SHOW TRANSACTIONS #51902

Merged
merged 3 commits into from
Aug 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions docs/generated/http/full.md
Original file line number Diff line number Diff line change
Expand Up @@ -786,12 +786,11 @@ The underlying response type is something we're looking to get rid of.
| application_name | [string](#cockroach.server.serverpb.ListSessionsResponse-string) | | Application name specified by the client. |
| active_queries | [ActiveQuery](#cockroach.server.serverpb.ListSessionsResponse-cockroach.server.serverpb.ActiveQuery) | repeated | Queries in progress on this session. |
| start | [google.protobuf.Timestamp](#cockroach.server.serverpb.ListSessionsResponse-google.protobuf.Timestamp) | | Timestamp of session's start. |
| kv_txn_id | [bytes](#cockroach.server.serverpb.ListSessionsResponse-bytes) | | ID of the current KV transaction for this session. Nil if the session doesn't currently have a transaction. |
| active_txn | [TxnInfo](#cockroach.server.serverpb.ListSessionsResponse-cockroach.server.serverpb.TxnInfo) | | Information about the txn in progress on this session. Nil if the session doesn't currently have a transaction. |
| last_active_query | [string](#cockroach.server.serverpb.ListSessionsResponse-string) | | SQL string of the last query executed on this session. |
| id | [bytes](#cockroach.server.serverpb.ListSessionsResponse-bytes) | | ID of the session (uint128 represented as raw bytes). |
| alloc_bytes | [int64](#cockroach.server.serverpb.ListSessionsResponse-int64) | | Number of currently allocated bytes in the session memory monitor. |
| max_alloc_bytes | [int64](#cockroach.server.serverpb.ListSessionsResponse-int64) | | High water mark of allocated bytes in the session memory monitor. |
| active_txn | [TxnInfo](#cockroach.server.serverpb.ListSessionsResponse-cockroach.server.serverpb.TxnInfo) | | Information about the txn in progress on this session. Nil if the session doesn't currently have a transaction. |



Expand Down Expand Up @@ -822,6 +821,10 @@ The underlying response type is something we're looking to get rid of.
| id | [bytes](#cockroach.server.serverpb.ListSessionsResponse-bytes) | | |
| start | [google.protobuf.Timestamp](#cockroach.server.serverpb.ListSessionsResponse-google.protobuf.Timestamp) | | The start timestamp of the transaction. |
| txn_description | [string](#cockroach.server.serverpb.ListSessionsResponse-string) | | txn_description is a text description of the underlying kv.Txn, intended for troubleshooting purposes. |
| num_statements_executed | [int32](#cockroach.server.serverpb.ListSessionsResponse-int32) | | num_statements_executed is the number of statements that were executed so far on this transaction. |
| num_retries | [int32](#cockroach.server.serverpb.ListSessionsResponse-int32) | | num_retries is the number of times that this transaction was retried. |
| num_auto_retries | [int32](#cockroach.server.serverpb.ListSessionsResponse-int32) | | num_retries is the number of times that this transaction was automatically retried by the SQL executor. |
| deadline | [google.protobuf.Timestamp](#cockroach.server.serverpb.ListSessionsResponse-google.protobuf.Timestamp) | | The deadline by which the transaction must be committed. |



Expand Down Expand Up @@ -887,12 +890,11 @@ The underlying response type is something we're looking to get rid of.
| application_name | [string](#cockroach.server.serverpb.ListSessionsResponse-string) | | Application name specified by the client. |
| active_queries | [ActiveQuery](#cockroach.server.serverpb.ListSessionsResponse-cockroach.server.serverpb.ActiveQuery) | repeated | Queries in progress on this session. |
| start | [google.protobuf.Timestamp](#cockroach.server.serverpb.ListSessionsResponse-google.protobuf.Timestamp) | | Timestamp of session's start. |
| kv_txn_id | [bytes](#cockroach.server.serverpb.ListSessionsResponse-bytes) | | ID of the current KV transaction for this session. Nil if the session doesn't currently have a transaction. |
| active_txn | [TxnInfo](#cockroach.server.serverpb.ListSessionsResponse-cockroach.server.serverpb.TxnInfo) | | Information about the txn in progress on this session. Nil if the session doesn't currently have a transaction. |
| last_active_query | [string](#cockroach.server.serverpb.ListSessionsResponse-string) | | SQL string of the last query executed on this session. |
| id | [bytes](#cockroach.server.serverpb.ListSessionsResponse-bytes) | | ID of the session (uint128 represented as raw bytes). |
| alloc_bytes | [int64](#cockroach.server.serverpb.ListSessionsResponse-int64) | | Number of currently allocated bytes in the session memory monitor. |
| max_alloc_bytes | [int64](#cockroach.server.serverpb.ListSessionsResponse-int64) | | High water mark of allocated bytes in the session memory monitor. |
| active_txn | [TxnInfo](#cockroach.server.serverpb.ListSessionsResponse-cockroach.server.serverpb.TxnInfo) | | Information about the txn in progress on this session. Nil if the session doesn't currently have a transaction. |



Expand Down Expand Up @@ -923,6 +925,10 @@ The underlying response type is something we're looking to get rid of.
| id | [bytes](#cockroach.server.serverpb.ListSessionsResponse-bytes) | | |
| start | [google.protobuf.Timestamp](#cockroach.server.serverpb.ListSessionsResponse-google.protobuf.Timestamp) | | The start timestamp of the transaction. |
| txn_description | [string](#cockroach.server.serverpb.ListSessionsResponse-string) | | txn_description is a text description of the underlying kv.Txn, intended for troubleshooting purposes. |
| num_statements_executed | [int32](#cockroach.server.serverpb.ListSessionsResponse-int32) | | num_statements_executed is the number of statements that were executed so far on this transaction. |
| num_retries | [int32](#cockroach.server.serverpb.ListSessionsResponse-int32) | | num_retries is the number of times that this transaction was retried. |
| num_auto_retries | [int32](#cockroach.server.serverpb.ListSessionsResponse-int32) | | num_retries is the number of times that this transaction was automatically retried by the SQL executor. |
| deadline | [google.protobuf.Timestamp](#cockroach.server.serverpb.ListSessionsResponse-google.protobuf.Timestamp) | | The deadline by which the transaction must be committed. |



Expand Down
1 change: 1 addition & 0 deletions docs/generated/sql/bnf/show_var.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ show_stmt ::=
| show_stats_stmt
| show_tables_stmt
| show_trace_stmt
| show_transactions_stmt
| show_users_stmt
| show_zone_stmt
6 changes: 6 additions & 0 deletions docs/generated/sql/bnf/stmt_block.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ show_stmt ::=
| show_stats_stmt
| show_tables_stmt
| show_trace_stmt
| show_transactions_stmt
| show_users_stmt
| show_zone_stmt

Expand Down Expand Up @@ -665,6 +666,10 @@ show_trace_stmt ::=
'SHOW' opt_compact 'TRACE' 'FOR' 'SESSION'
| 'SHOW' opt_compact 'KV' 'TRACE' 'FOR' 'SESSION'

show_transactions_stmt ::=
'SHOW' opt_cluster 'TRANSACTIONS'
| 'SHOW' 'ALL' opt_cluster 'TRANSACTIONS'

show_users_stmt ::=
'SHOW' 'USERS'

Expand Down Expand Up @@ -993,6 +998,7 @@ unreserved_keyword ::=
| 'TIES'
| 'TRACE'
| 'TRANSACTION'
| 'TRANSACTIONS'
| 'TRIGGER'
| 'TRUNCATE'
| 'TRUSTED'
Expand Down
Loading