Get desktop application:
View/edit binary Protocol Buffers messages
AggregateStats contains information about the health of a group of tablets for a Target. It is used to propagate stats from a vtgate to another, or from the Gateway layer of a vtgate to the routing layer.
healthy_tablet_count is the number of healthy tablets in the group.
unhealthy_tablet_count is the number of unhealthy tablets in the group.
replication_lag_seconds_min is the minimum of the replication_lag_seconds values of the healthy tablets. It is unset if the tablet type is primary.
replication_lag_seconds_max is the maximum of the replication_lag_seconds values of the healthy tablets. It is unset if the tablet type is primary.
BeginExecuteRequest is the payload to BeginExecute
Used as request type in: queryservice.Query.BeginExecute
BeginExecuteResponse is the returned value from BeginExecute
Used as response type in: queryservice.Query.BeginExecute
error contains an application level error if necessary. Note the transaction_id may be set, even when an error is returned, if the begin worked but the execute failed.
transaction_id might be non-zero even if an error is present.
The session_state_changes might be set if the transaction is a snapshot transaction and the MySQL implementation supports getting a start gtid on snapshot
BeginRequest is the payload to Begin
Used as request type in: queryservice.Query.Begin
BeginResponse is the returned value from Begin
Used as response type in: queryservice.Query.Begin
The session_state_changes might be set if the transaction is a snapshot transaction and the MySQL implementation supports getting a start gtid on snapshot
BeginStreamExecuteRequest is the payload to BeginStreamExecute
Used as request type in: queryservice.Query.BeginStreamExecute
BeginStreamExecuteResponse is the returned value from BeginStreamExecute
Used as response type in: queryservice.Query.BeginStreamExecute
error contains an application level error if necessary. Note the transaction_id may be set, even when an error is returned, if the begin worked but the stream execute failed.
transaction_id might be non-zero even if an error is present.
The session_state_changes might be set if the transaction is a snapshot transaction and the MySQL implementation supports getting a start gtid on snapshot
BindVariable represents a single bind variable in a Query.
Used in:
,values are set if type is TUPLE.
BoundQuery is a query with its bind variables
Used in:
, , , , , , , , , , ,sql is the SQL query to execute
bind_variables is a map of all bind variables to expand in the query. nil values are not allowed. Use NULL_TYPE to express a NULL value.
CommitPreparedRequest is the payload to CommitPrepared
Used as request type in: queryservice.Query.CommitPrepared
CommitPreparedResponse is the returned value from CommitPrepared
Used as response type in: queryservice.Query.CommitPrepared
(message has no fields)
CommitRequest is the payload to Commit
Used as request type in: queryservice.Query.Commit
CommitResponse is the returned value from Commit
Used as response type in: queryservice.Query.Commit
ConcludeTransactionRequest is the payload to ConcludeTransaction
Used as request type in: queryservice.Query.ConcludeTransaction
ConcludeTransactionResponse is the returned value from ConcludeTransaction
Used as response type in: queryservice.Query.ConcludeTransaction
(message has no fields)
CreateTransactionRequest is the payload to CreateTransaction
Used as request type in: queryservice.Query.CreateTransaction
CreateTransactionResponse is the returned value from CreateTransaction
Used as response type in: queryservice.Query.CreateTransaction
(message has no fields)
EventToken is a structure that describes a point in time in a replication stream on one shard. The most recent known replication position can be retrieved from vttablet when executing a query. It is also sent with the replication streams from the binlog service.
Used in:
,timestamp is the MySQL timestamp of the statements. Seconds since Epoch.
The shard name that applied the statements. Note this is not set when streaming from a vttablet. It is only used on the client -> vtgate link.
The position on the replication stream after this statement was applied. It is not the transaction ID / GTID, but the position / GTIDSet.
ExecuteOptions is passed around for all Execute calls.
Used in:
, , , , , , , , ,Controls what fields are returned in Field message responses from mysql, i.e. field name, table name, etc. This is an optimization for high-QPS queries where the client knows what it's getting
client_rows_found specifies if rows_affected should return rows found instead of rows affected. Behavior is defined by MySQL's CLIENT_FOUND_ROWS flag.
workload specifies the type of workload: OLTP: DMLs allowed, results have row count limit, and query timeouts are shorter. OLAP: DMLS not allowed, no limit on row count, timeouts can be as high as desired. DBA: no limit on rowcount or timeout, all queries allowed but intended for long DMLs and DDLs.
sql_select_limit sets an implicit limit on all select statements. Since vitess also sets a rowcount limit on queries, the smallest value wins.
skip_query_plan_cache specifies if the query plan should be cached by vitess. By default all query plans are cached.
PlannerVersion specifies which planner to use. If DEFAULT is chosen, whatever vtgate was started with will be used
has_created_temp_tables signals whether plans created in this session should be cached or not if the user has created temp tables, Vitess will not reuse plans created for this session in other sessions. The current session can still use other sessions cached plans.
TransactionAccessMode specifies the access modes to be used while starting the transaction i.e. READ WRITE/READ ONLY/WITH CONSISTENT SNAPSHOT If not specified, the transaction will be started with the default access mode on the connection.
WorkloadName specifies the name of the workload as indicated in query directives. This is used for instrumentation in metrics and tracing spans.
priority specifies the priority of the query, between 0 and 100. This is leveraged by the transaction throttler to determine whether, under resource contention, a query should or should not be throttled.
timeout specifies the query timeout in milliseconds. If not set, the default timeout is used.
fetch_last_insert_id indicates that after executing a DML involving last_insert_id(x), a subsequent "SELECT last_insert_id()" should be performed to retrieve the updated value. This is to circumvent a bug where setting last_insert_id(x) to zero is not signaled by mysql https://bugs.mysql.com/bug.php?id=116939
in_dml_execution indicates that the query is being executed as part of a DML execution.
Used in:
Used in:
Used in:
Used in:
Used in:
This is not an "official" transaction level but it will do a START TRANSACTION WITH CONSISTENT SNAPSHOT, READ ONLY
This not an "official" transaction level, it will send queries to mysql without wrapping them in a transaction
Used in:
ExecuteRequest is the payload to Execute
Used as request type in: queryservice.Query.Execute
ExecuteResponse is the returned value from Execute
Used as response type in: queryservice.Query.Execute
Field describes a single column returned by a query
Used in:
, , , , , , , ,name of the field as returned by mysql C API
vitess-defined type. Conversion function is in sqltypes package.
Remaining fields from mysql C API. These fields are only populated when ExecuteOptions.included_fields is set to IncludedFields.ALL.
column_length is really a uint32. All 32 bits can be used.
charset is actually a uint16. Only the lower 16 bits are used.
decimals is actually a uint8. Only the lower 8 bits are used.
flags is actually a uint16. Only the lower 16 bits are used.
column_type is optionally populated from information_schema.columns
Flag allows us to qualify types by their common properties.
GetSchemaRequest is the payload to GetSchema
Used as request type in: queryservice.Query.GetSchema
GetSchemaResponse is the returned value from GetSchema
Used as response type in: queryservice.Query.GetSchema
this is for the schema definition for the requested tables and views.
MessageAckRequest is the request payload for MessageAck.
Used as request type in: queryservice.Query.MessageAck
name is the message table name.
MessageAckResponse is the response for MessageAck.
Used as response type in: queryservice.Query.MessageAck
result contains the result of the ack operation. Since this acts like a DML, only RowsAffected is returned in the result.
MessageStreamRequest is the request payload for MessageStream.
Used as request type in: queryservice.Query.MessageStream
name is the message table name.
MessageStreamResponse is a response for MessageStream.
Used as response type in: queryservice.Query.MessageStream
Flags sent from the MySQL C API
PrepareRequest is the payload to Prepare
Used as request type in: queryservice.Query.Prepare
PrepareResponse is the returned value from Prepare
Used as response type in: queryservice.Query.Prepare
(message has no fields)
QueryResult is returned by Execute and ExecuteStream. As returned by Execute, len(fields) is always equal to len(row) (for each row in rows). As returned by StreamExecute, the first QueryResult has the fields set, and subsequent QueryResult have rows set. And as Execute, len(QueryResult[0].fields) is always equal to len(row) (for each row in rows for each QueryResult in QueryResult[1:]).
Used in:
, , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,QueryWarning is used to convey out of band query execution warnings by storing in the vtgate.Session
Used in:
ReadTransactionRequest is the payload to ReadTransaction
Used as request type in: queryservice.Query.ReadTransaction
ReadTransactionResponse is the returned value from ReadTransaction
Used as response type in: queryservice.Query.ReadTransaction
RealtimeStats contains information about the tablet status. It is only valid for a single tablet.
Used in:
health_error is the last error we got from health check, or empty is the server is healthy. This is used for subset selection, we do not send queries to servers that are not healthy.
replication_lag_seconds is populated for replicas only. It indicates how far behind on (MySQL) replication a replica currently is. It is used by clients for subset selection (so we don't try to send traffic to tablets that are too far behind). NOTE: This field must not be evaluated if "health_error" is not empty. TODO(mberlin): Let's switch it to int64 instead?
bin_log_players_count is the number of currently running binlog players. if the value is 0, it means that filtered replication is currently not running on the tablet. If >0, filtered replication is running. NOTE: This field must not be evaluated if "health_error" is not empty.
filtered_replication_lag_seconds is populated for the receiving primary of an ongoing filtered replication only. It specifies how far the receiving primary lags behind the sending primary. NOTE: This field must not be evaluated if "health_error" is not empty. NOTE: This field must not be evaluated if "bin_log_players_count" is 0.
cpu_usage is used for load-based balancing
qps is the average QPS (queries per second) rate in the last XX seconds where XX is usually 60 (See query_service_stats.go).
table_schema_changed is to provide list of tables that have schema changes detected by the tablet.
view_schema_changed is to provide list of views that have schema changes detected by the tablet.
udfs_changed is used to signal that the UDFs have changed on the tablet.
ReleaseRequest is the payload to Release
Used as request type in: queryservice.Query.Release
ReleaseResponse is the returned value from Release
Used as response type in: queryservice.Query.Release
(message has no fields)
ReserveBeginExecuteRequest is the payload to ReserveBeginExecute
Used as request type in: queryservice.Query.ReserveBeginExecute
ReserveBeginExecuteResponse is the returned value from ReserveBeginExecute
Used as response type in: queryservice.Query.ReserveBeginExecute
error contains an application level error if necessary. Note the transaction_id may be set, even when an error is returned, if the begin worked but the execute failed.
The following fields might be non-zero even if an error is present.
The session_state_changes might be set if the transaction is a snapshot transaction and the MySQL implementation supports getting a start gtid on snapshot
ReserveBeginStreamExecuteRequest is the payload to ReserveBeginStreamExecute
Used as request type in: queryservice.Query.ReserveBeginStreamExecute
ReserveBeginStreamExecuteResponse is the returned value from ReserveBeginStreamExecute
Used as response type in: queryservice.Query.ReserveBeginStreamExecute
error contains an application level error if necessary. Note the transaction_id may be set, even when an error is returned, if the begin worked but the stream execute failed.
The following fields might be non-zero even if an error is present.
The session_state_changes might be set if the transaction is a snapshot transaction and the MySQL implementation supports getting a start gtid on snapshot
ReserveExecuteRequest is the payload to ReserveExecute
Used as request type in: queryservice.Query.ReserveExecute
ReserveExecuteResponse is the returned value from ReserveExecute
Used as response type in: queryservice.Query.ReserveExecute
The following fields might be non-zero even if an error is present.
ReserveStreamExecuteRequest is the payload to ReserveStreamExecute
Used as request type in: queryservice.Query.ReserveStreamExecute
ReserveStreamExecuteResponse is the returned value from ReserveStreamExecute
Used as response type in: queryservice.Query.ReserveStreamExecute
The following fields might be non-zero even if an error is present.
ResultWithError represents a query response in the form of result or error but not both. TODO: To be used in ExecuteBatchResponse and BeginExecuteBatchResponse.
Used in:
,error contains an query level error, only set if result is unset.
result contains the query result, only set if error is unset.
RollbackPreparedRequest is the payload to RollbackPrepared
Used as request type in: queryservice.Query.RollbackPrepared
RollbackPreparedResponse is the returned value from RollbackPrepared
Used as response type in: queryservice.Query.RollbackPrepared
(message has no fields)
RollbackRequest is the payload to Rollback
Used as request type in: queryservice.Query.Rollback
RollbackResponse is the returned value from Rollback
Used as response type in: queryservice.Query.Rollback
Row is a database row.
Used in:
, , , , ,lengths contains the length of each value in values. A length of -1 means that the field is NULL. While reading values, you have to accummulate the length to know the offset where the next value begins in values.
values contains a concatenation of all values in the row.
SchemaTableType represents the type of table requested.
Used in:
SetRollbackRequest is the payload to SetRollback
Used as request type in: queryservice.Query.SetRollback
SetRollbackResponse is the returned value from SetRollback
Used as response type in: queryservice.Query.SetRollback
(message has no fields)
StartCommitRequest is the payload to StartCommit
Used as request type in: queryservice.Query.StartCommit
StartCommitResponse is the returned value from StartCommit
Used as response type in: queryservice.Query.StartCommit
Used in:
StreamEvent describes a set of transformations that happened as a single transactional unit on a server. It is streamed back by the Update Stream calls.
The statements in this transaction.
The Event Token for this event.
One individual Statement in a transaction.
Used in:
table_name, primary_key_fields and primary_key_values are set for DML.
sql is set for all queries. FIXME(alainjobart) we may not need it for DMLs.
The category of one statement.
Used in:
StreamExecuteRequest is the payload to StreamExecute
Used as request type in: queryservice.Query.StreamExecute
StreamExecuteResponse is the returned value from StreamExecute
Used as response type in: queryservice.Query.StreamExecute
StreamHealthRequest is the payload for StreamHealth
Used as request type in: queryservice.Query.StreamHealth
(message has no fields)
StreamHealthResponse is streamed by StreamHealth on a regular basis. It is expected to be used between a vtgate and vttablet: - target describes the tablet. - realtime_stats is set. - aggregate_stats is not set (deprecated)
Used as response type in: queryservice.Query.StreamHealth
target is the current server type. Only queries with that exact Target record will be accepted (the cell may not match, however).
serving is true iff the tablet is serving. A tablet may not be serving if filtered replication is enabled on a primary for instance, or if a replica should not be used because the keyspace is being resharded.
primary_term_start_timestamp can be interpreted as the last time we knew that this tablet was promoted to a PRIMARY of this shard (if StreamHealthResponse describes a group of tablets, between two vtgates, only one primary will be present in the group, and this is this primary's value). It is used by vtgate when determining the current PRIMARY of a shard. If vtgate sees more than one PRIMARY tablet, this timestamp is used as tiebreaker where the PRIMARY with the highest timestamp wins. Another usage of this timestamp is in go/vt/vtgate/buffer to detect the end of a reparent (failover) and stop buffering. In practice, this field is set to: a) the last time the RPC tabletmanager.TabletExternallyReparented was called on this tablet (usually done by an external failover tool e.g. Orchestrator). The failover tool can call this as long as we are the primary i.e. even ages after the last reparent occurred. OR b) the last time an active reparent was executed through a vtctl command (InitShardPrimary, PlannedReparentShard, EmergencyReparentShard) OR c) the last time vttablet was started and it initialized its tablet type as PRIMARY because it was recorded as the shard's current primary in the topology (see go/vt/vttablet/tabletmanager/init_tablet.go) OR d) 0 if the vttablet is not a PRIMARY.
realtime_stats contains information about the tablet status. It is only filled in if the information is about a tablet.
tablet_alias is the alias of the sending tablet. The discovery/healthcheck.go code uses it to verify that it's talking to the correct tablet and that it hasn't changed in the meantime e.g. due to tablet restarts where ports or ips have been reused but assigned differently.
Target describes what the client expects the tablet is. If the tablet does not match, an error is returned.
Used in:
, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,cell is used for routing queries between vtgate and vttablets. It is not used when Target is part of the Session sent by the client.
TransactionMetadata contains the metadata for a distributed transaction.
Used in:
, , , , ,TransactionState represents the state of a distributed transaction.
Used in:
Type defines the various supported data types in bind vars and query results.
Used in:
, , , , ,NULL_TYPE specifies a NULL type.
INT8 specifies a TINYINT type. Properties: 1, IsNumber.
UINT8 specifies a TINYINT UNSIGNED type. Properties: 2, IsNumber, IsUnsigned.
INT16 specifies a SMALLINT type. Properties: 3, IsNumber.
UINT16 specifies a SMALLINT UNSIGNED type. Properties: 4, IsNumber, IsUnsigned.
INT24 specifies a MEDIUMINT type. Properties: 5, IsNumber.
UINT24 specifies a MEDIUMINT UNSIGNED type. Properties: 6, IsNumber, IsUnsigned.
INT32 specifies a INTEGER type. Properties: 7, IsNumber.
UINT32 specifies a INTEGER UNSIGNED type. Properties: 8, IsNumber, IsUnsigned.
INT64 specifies a BIGINT type. Properties: 9, IsNumber.
UINT64 specifies a BIGINT UNSIGNED type. Properties: 10, IsNumber, IsUnsigned.
FLOAT32 specifies a FLOAT type. Properties: 11, IsFloat.
FLOAT64 specifies a DOUBLE or REAL type. Properties: 12, IsFloat.
TIMESTAMP specifies a TIMESTAMP type. Properties: 13, IsQuoted.
DATE specifies a DATE type. Properties: 14, IsQuoted.
TIME specifies a TIME type. Properties: 15, IsQuoted.
DATETIME specifies a DATETIME type. Properties: 16, IsQuoted.
YEAR specifies a YEAR type. Properties: 17, IsNumber, IsUnsigned.
DECIMAL specifies a DECIMAL or NUMERIC type. Properties: 18, None.
TEXT specifies a TEXT type. Properties: 19, IsQuoted, IsText.
BLOB specifies a BLOB type. Properties: 20, IsQuoted, IsBinary.
VARCHAR specifies a VARCHAR type. Properties: 21, IsQuoted, IsText.
VARBINARY specifies a VARBINARY type. Properties: 22, IsQuoted, IsBinary.
CHAR specifies a CHAR type. Properties: 23, IsQuoted, IsText.
BINARY specifies a BINARY type. Properties: 24, IsQuoted, IsBinary.
BIT specifies a BIT type. Properties: 25, IsQuoted.
ENUM specifies an ENUM type. Properties: 26, IsQuoted.
SET specifies a SET type. Properties: 27, IsQuoted.
TUPLE specifies a tuple. This cannot be returned in a QueryResult, but it can be sent as a bind var. Properties: 28, None.
GEOMETRY specifies a GEOMETRY type. Properties: 29, IsQuoted.
JSON specifies a JSON type. Properties: 30, IsQuoted.
EXPRESSION specifies a SQL expression. This type is for internal use only. Properties: 31, None.
HEXNUM specifies a HEXNUM type (unquoted varbinary). Properties: 32, IsText.
HEXVAL specifies a HEXVAL type (unquoted varbinary). Properties: 33, IsText.
BITNUM specifies a base 2 binary type (unquoted varbinary). Properties: 34, IsText.
VECTOR specifies a VECTOR type Properties: 35, IsQuoted.
RAW specifies a type which won't be quoted but the value used as-is while encoding. Properties: 36, None.
ROW_TUPLE represents multiple rows. Properties: 37, None.
UDFInfo represents the information about a UDF.
Used in:
UnresolvedTransactionsRequest is the payload to UnresolvedTransactions
Used as request type in: queryservice.Query.UnresolvedTransactions
Unresolved Transactions older than this (in seconds).
UnresolvedTransactionsResponse is the returned value from UnresolvedTransactions
Used as response type in: queryservice.Query.UnresolvedTransactions
VTGateCallerID is sent by VTGate to VTTablet to describe the caller. If possible, this information is secure. For instance, if using unique certificates that guarantee that VTGate->VTTablet traffic cannot be spoofed, then VTTablet can trust this information, and VTTablet will use it for tablet ACLs, for instance. Because of this security guarantee, this is different than the CallerID structure, which is not secure at all, because it is provided by the Vitess client.
Used in:
, , , , , , , , , , , , , , , , , , , , , , , , , ,Value represents a typed value.
Used in:
,