diff --git a/docs/generated/sql/bnf/BUILD.bazel b/docs/generated/sql/bnf/BUILD.bazel index d7929f5b2c17..daefe23eca80 100644 --- a/docs/generated/sql/bnf/BUILD.bazel +++ b/docs/generated/sql/bnf/BUILD.bazel @@ -68,7 +68,6 @@ FILES = [ "alter_zone_table_stmt", "analyze_stmt", "backup", - "begin_stmt", "begin_transaction", "cancel_all_jobs_stmt", "cancel_job", @@ -153,6 +152,7 @@ FILES = [ "like_table_option_list", "limit_clause", "move_cursor_stmt", + "nonpreparable_set_stmt", "not_null_column_level", "offset_clause", "on_conflict", @@ -206,7 +206,6 @@ FILES = [ "set_rest_more", "set_session_stmt", "set_transaction", - "set_transaction_stmt", "show_backup", "show_cluster_setting", "show_columns_stmt", diff --git a/docs/generated/sql/bnf/begin_stmt.bnf b/docs/generated/sql/bnf/begin_stmt.bnf deleted file mode 100644 index 1059df25a0ad..000000000000 --- a/docs/generated/sql/bnf/begin_stmt.bnf +++ /dev/null @@ -1 +0,0 @@ -begin_stmt ::= diff --git a/docs/generated/sql/bnf/legacy_begin_stmt.bnf b/docs/generated/sql/bnf/legacy_begin_stmt.bnf index 3974be960389..da259cc1e014 100644 --- a/docs/generated/sql/bnf/legacy_begin_stmt.bnf +++ b/docs/generated/sql/bnf/legacy_begin_stmt.bnf @@ -1,2 +1,19 @@ legacy_begin_stmt ::= - 'BEGIN' opt_transaction begin_transaction + 'BEGIN' 'TRANSACTION' 'PRIORITY' 'LOW' ( ( ( ',' | ) ( ( 'PRIORITY' ( 'LOW' | 'NORMAL' | 'HIGH' ) ) | ( 'READ' 'ONLY' | 'READ' 'WRITE' ) | ( 'AS' 'OF' 'SYSTEM' 'TIME' a_expr ) | ( 'DEFERRABLE' | 'NOT' 'DEFERRABLE' ) ) ) )* + | 'BEGIN' 'TRANSACTION' 'PRIORITY' 'NORMAL' ( ( ( ',' | ) ( ( 'PRIORITY' ( 'LOW' | 'NORMAL' | 'HIGH' ) ) | ( 'READ' 'ONLY' | 'READ' 'WRITE' ) | ( 'AS' 'OF' 'SYSTEM' 'TIME' a_expr ) | ( 'DEFERRABLE' | 'NOT' 'DEFERRABLE' ) ) ) )* + | 'BEGIN' 'TRANSACTION' 'PRIORITY' 'HIGH' ( ( ( ',' | ) ( ( 'PRIORITY' ( 'LOW' | 'NORMAL' | 'HIGH' ) ) | ( 'READ' 'ONLY' | 'READ' 'WRITE' ) | ( 'AS' 'OF' 'SYSTEM' 'TIME' a_expr ) | ( 'DEFERRABLE' | 'NOT' 'DEFERRABLE' ) ) ) )* + | 'BEGIN' 'TRANSACTION' 'READ' 'ONLY' ( ( ( ',' | ) ( ( 'PRIORITY' ( 'LOW' | 'NORMAL' | 'HIGH' ) ) | ( 'READ' 'ONLY' | 'READ' 'WRITE' ) | ( 'AS' 'OF' 'SYSTEM' 'TIME' a_expr ) | ( 'DEFERRABLE' | 'NOT' 'DEFERRABLE' ) ) ) )* + | 'BEGIN' 'TRANSACTION' 'READ' 'WRITE' ( ( ( ',' | ) ( ( 'PRIORITY' ( 'LOW' | 'NORMAL' | 'HIGH' ) ) | ( 'READ' 'ONLY' | 'READ' 'WRITE' ) | ( 'AS' 'OF' 'SYSTEM' 'TIME' a_expr ) | ( 'DEFERRABLE' | 'NOT' 'DEFERRABLE' ) ) ) )* + | 'BEGIN' 'TRANSACTION' 'AS' 'OF' 'SYSTEM' 'TIME' a_expr ( ( ( ',' | ) ( ( 'PRIORITY' ( 'LOW' | 'NORMAL' | 'HIGH' ) ) | ( 'READ' 'ONLY' | 'READ' 'WRITE' ) | ( 'AS' 'OF' 'SYSTEM' 'TIME' a_expr ) | ( 'DEFERRABLE' | 'NOT' 'DEFERRABLE' ) ) ) )* + | 'BEGIN' 'TRANSACTION' 'DEFERRABLE' ( ( ( ',' | ) ( ( 'PRIORITY' ( 'LOW' | 'NORMAL' | 'HIGH' ) ) | ( 'READ' 'ONLY' | 'READ' 'WRITE' ) | ( 'AS' 'OF' 'SYSTEM' 'TIME' a_expr ) | ( 'DEFERRABLE' | 'NOT' 'DEFERRABLE' ) ) ) )* + | 'BEGIN' 'TRANSACTION' 'NOT' 'DEFERRABLE' ( ( ( ',' | ) ( ( 'PRIORITY' ( 'LOW' | 'NORMAL' | 'HIGH' ) ) | ( 'READ' 'ONLY' | 'READ' 'WRITE' ) | ( 'AS' 'OF' 'SYSTEM' 'TIME' a_expr ) | ( 'DEFERRABLE' | 'NOT' 'DEFERRABLE' ) ) ) )* + | 'BEGIN' 'TRANSACTION' + | 'BEGIN' 'PRIORITY' 'LOW' ( ( ( ',' | ) ( ( 'PRIORITY' ( 'LOW' | 'NORMAL' | 'HIGH' ) ) | ( 'READ' 'ONLY' | 'READ' 'WRITE' ) | ( 'AS' 'OF' 'SYSTEM' 'TIME' a_expr ) | ( 'DEFERRABLE' | 'NOT' 'DEFERRABLE' ) ) ) )* + | 'BEGIN' 'PRIORITY' 'NORMAL' ( ( ( ',' | ) ( ( 'PRIORITY' ( 'LOW' | 'NORMAL' | 'HIGH' ) ) | ( 'READ' 'ONLY' | 'READ' 'WRITE' ) | ( 'AS' 'OF' 'SYSTEM' 'TIME' a_expr ) | ( 'DEFERRABLE' | 'NOT' 'DEFERRABLE' ) ) ) )* + | 'BEGIN' 'PRIORITY' 'HIGH' ( ( ( ',' | ) ( ( 'PRIORITY' ( 'LOW' | 'NORMAL' | 'HIGH' ) ) | ( 'READ' 'ONLY' | 'READ' 'WRITE' ) | ( 'AS' 'OF' 'SYSTEM' 'TIME' a_expr ) | ( 'DEFERRABLE' | 'NOT' 'DEFERRABLE' ) ) ) )* + | 'BEGIN' 'READ' 'ONLY' ( ( ( ',' | ) ( ( 'PRIORITY' ( 'LOW' | 'NORMAL' | 'HIGH' ) ) | ( 'READ' 'ONLY' | 'READ' 'WRITE' ) | ( 'AS' 'OF' 'SYSTEM' 'TIME' a_expr ) | ( 'DEFERRABLE' | 'NOT' 'DEFERRABLE' ) ) ) )* + | 'BEGIN' 'READ' 'WRITE' ( ( ( ',' | ) ( ( 'PRIORITY' ( 'LOW' | 'NORMAL' | 'HIGH' ) ) | ( 'READ' 'ONLY' | 'READ' 'WRITE' ) | ( 'AS' 'OF' 'SYSTEM' 'TIME' a_expr ) | ( 'DEFERRABLE' | 'NOT' 'DEFERRABLE' ) ) ) )* + | 'BEGIN' 'AS' 'OF' 'SYSTEM' 'TIME' a_expr ( ( ( ',' | ) ( ( 'PRIORITY' ( 'LOW' | 'NORMAL' | 'HIGH' ) ) | ( 'READ' 'ONLY' | 'READ' 'WRITE' ) | ( 'AS' 'OF' 'SYSTEM' 'TIME' a_expr ) | ( 'DEFERRABLE' | 'NOT' 'DEFERRABLE' ) ) ) )* + | 'BEGIN' 'DEFERRABLE' ( ( ( ',' | ) ( ( 'PRIORITY' ( 'LOW' | 'NORMAL' | 'HIGH' ) ) | ( 'READ' 'ONLY' | 'READ' 'WRITE' ) | ( 'AS' 'OF' 'SYSTEM' 'TIME' a_expr ) | ( 'DEFERRABLE' | 'NOT' 'DEFERRABLE' ) ) ) )* + | 'BEGIN' 'NOT' 'DEFERRABLE' ( ( ( ',' | ) ( ( 'PRIORITY' ( 'LOW' | 'NORMAL' | 'HIGH' ) ) | ( 'READ' 'ONLY' | 'READ' 'WRITE' ) | ( 'AS' 'OF' 'SYSTEM' 'TIME' a_expr ) | ( 'DEFERRABLE' | 'NOT' 'DEFERRABLE' ) ) ) )* + | 'BEGIN' diff --git a/docs/generated/sql/bnf/nonpreparable_set_stmt.bnf b/docs/generated/sql/bnf/nonpreparable_set_stmt.bnf new file mode 100644 index 000000000000..c0cd7be13d8b --- /dev/null +++ b/docs/generated/sql/bnf/nonpreparable_set_stmt.bnf @@ -0,0 +1,2 @@ +nonpreparable_set_stmt ::= + set_transaction_stmt diff --git a/docs/generated/sql/bnf/set_transaction.bnf b/docs/generated/sql/bnf/set_transaction.bnf index 24f8f21d7433..973dde2b78ba 100644 --- a/docs/generated/sql/bnf/set_transaction.bnf +++ b/docs/generated/sql/bnf/set_transaction.bnf @@ -1,4 +1,4 @@ -nonpreparable_set_stmt ::= +set_transaction_stmt ::= 'SET' 'TRANSACTION' 'PRIORITY' 'LOW' ( ( ( ',' | ) ( ( 'PRIORITY' ( 'LOW' | 'NORMAL' | 'HIGH' ) ) | ( 'READ' 'ONLY' | 'READ' 'WRITE' ) | ( 'AS' 'OF' 'SYSTEM' 'TIME' a_expr ) | ( 'DEFERRABLE' | 'NOT' 'DEFERRABLE' ) ) ) )* | 'SET' 'TRANSACTION' 'PRIORITY' 'NORMAL' ( ( ( ',' | ) ( ( 'PRIORITY' ( 'LOW' | 'NORMAL' | 'HIGH' ) ) | ( 'READ' 'ONLY' | 'READ' 'WRITE' ) | ( 'AS' 'OF' 'SYSTEM' 'TIME' a_expr ) | ( 'DEFERRABLE' | 'NOT' 'DEFERRABLE' ) ) ) )* | 'SET' 'TRANSACTION' 'PRIORITY' 'HIGH' ( ( ( ',' | ) ( ( 'PRIORITY' ( 'LOW' | 'NORMAL' | 'HIGH' ) ) | ( 'READ' 'ONLY' | 'READ' 'WRITE' ) | ( 'AS' 'OF' 'SYSTEM' 'TIME' a_expr ) | ( 'DEFERRABLE' | 'NOT' 'DEFERRABLE' ) ) ) )* diff --git a/docs/generated/sql/bnf/set_transaction_stmt.bnf b/docs/generated/sql/bnf/set_transaction_stmt.bnf deleted file mode 100644 index 3ce95cb05c13..000000000000 --- a/docs/generated/sql/bnf/set_transaction_stmt.bnf +++ /dev/null @@ -1,3 +0,0 @@ -set_transaction_stmt ::= - 'SET' 'TRANSACTION' transaction_mode_list - | 'SET' 'SESSION' 'TRANSACTION' transaction_mode_list diff --git a/pkg/cmd/docgen/diagrams.go b/pkg/cmd/docgen/diagrams.go index 32f507f01fa4..850cdf0a407a 100644 --- a/pkg/cmd/docgen/diagrams.go +++ b/pkg/cmd/docgen/diagrams.go @@ -615,7 +615,7 @@ var specs = []stmtSpec{ exclude: []*regexp.Regexp{regexp.MustCompile("'IN'")}, }, { - name: "begin_stmt", + name: "legacy_begin_stmt", inline: []string{ "opt_transaction", "begin_transaction", @@ -628,9 +628,7 @@ var specs = []stmtSpec{ "transaction_read_mode", "as_of_clause", "transaction_deferrable_mode", - }, - exclude: []*regexp.Regexp{ - regexp.MustCompile("'START'"), + "user_priority", }, }, { @@ -1320,7 +1318,7 @@ var specs = []stmtSpec{ }, { name: "set_transaction", - stmt: "nonpreparable_set_stmt", + stmt: "set_transaction_stmt", inline: []string{ "set_transaction_stmt", "transaction_mode", diff --git a/pkg/gen/bnf.bzl b/pkg/gen/bnf.bzl index ad605d3f3dd8..24fd65c3e6cc 100644 --- a/pkg/gen/bnf.bzl +++ b/pkg/gen/bnf.bzl @@ -68,7 +68,6 @@ BNF_SRCS = [ "//docs/generated/sql/bnf:alter_zone_table_stmt.bnf", "//docs/generated/sql/bnf:analyze_stmt.bnf", "//docs/generated/sql/bnf:backup.bnf", - "//docs/generated/sql/bnf:begin_stmt.bnf", "//docs/generated/sql/bnf:begin_transaction.bnf", "//docs/generated/sql/bnf:cancel_all_jobs_stmt.bnf", "//docs/generated/sql/bnf:cancel_job.bnf", @@ -153,6 +152,7 @@ BNF_SRCS = [ "//docs/generated/sql/bnf:like_table_option_list.bnf", "//docs/generated/sql/bnf:limit_clause.bnf", "//docs/generated/sql/bnf:move_cursor_stmt.bnf", + "//docs/generated/sql/bnf:nonpreparable_set_stmt.bnf", "//docs/generated/sql/bnf:not_null_column_level.bnf", "//docs/generated/sql/bnf:offset_clause.bnf", "//docs/generated/sql/bnf:on_conflict.bnf", @@ -206,7 +206,6 @@ BNF_SRCS = [ "//docs/generated/sql/bnf:set_rest_more.bnf", "//docs/generated/sql/bnf:set_session_stmt.bnf", "//docs/generated/sql/bnf:set_transaction.bnf", - "//docs/generated/sql/bnf:set_transaction_stmt.bnf", "//docs/generated/sql/bnf:show_backup.bnf", "//docs/generated/sql/bnf:show_cluster_setting.bnf", "//docs/generated/sql/bnf:show_columns_stmt.bnf", diff --git a/pkg/gen/diagrams.bzl b/pkg/gen/diagrams.bzl index 331a9a11ac03..9e7d8a5143bd 100644 --- a/pkg/gen/diagrams.bzl +++ b/pkg/gen/diagrams.bzl @@ -68,7 +68,6 @@ DIAGRAMS_SRCS = [ "//docs/generated/sql/bnf:alter_zone_table.html", "//docs/generated/sql/bnf:analyze.html", "//docs/generated/sql/bnf:backup.html", - "//docs/generated/sql/bnf:begin.html", "//docs/generated/sql/bnf:begin_transaction.html", "//docs/generated/sql/bnf:cancel.html", "//docs/generated/sql/bnf:cancel_all_jobs.html", @@ -153,6 +152,7 @@ DIAGRAMS_SRCS = [ "//docs/generated/sql/bnf:like_table_option_list.html", "//docs/generated/sql/bnf:limit_clause.html", "//docs/generated/sql/bnf:move_cursor.html", + "//docs/generated/sql/bnf:nonpreparable_set.html", "//docs/generated/sql/bnf:not_null_column_level.html", "//docs/generated/sql/bnf:offset_clause.html", "//docs/generated/sql/bnf:on_conflict.html", diff --git a/pkg/gen/docs.bzl b/pkg/gen/docs.bzl index 3b89e7dfe9a4..03688c9753cc 100644 --- a/pkg/gen/docs.bzl +++ b/pkg/gen/docs.bzl @@ -80,7 +80,6 @@ DOCS_SRCS = [ "//docs/generated/sql/bnf:alter_zone_table_stmt.bnf", "//docs/generated/sql/bnf:analyze_stmt.bnf", "//docs/generated/sql/bnf:backup.bnf", - "//docs/generated/sql/bnf:begin_stmt.bnf", "//docs/generated/sql/bnf:begin_transaction.bnf", "//docs/generated/sql/bnf:cancel_all_jobs_stmt.bnf", "//docs/generated/sql/bnf:cancel_job.bnf", @@ -165,6 +164,7 @@ DOCS_SRCS = [ "//docs/generated/sql/bnf:like_table_option_list.bnf", "//docs/generated/sql/bnf:limit_clause.bnf", "//docs/generated/sql/bnf:move_cursor_stmt.bnf", + "//docs/generated/sql/bnf:nonpreparable_set_stmt.bnf", "//docs/generated/sql/bnf:not_null_column_level.bnf", "//docs/generated/sql/bnf:offset_clause.bnf", "//docs/generated/sql/bnf:on_conflict.bnf", @@ -218,7 +218,6 @@ DOCS_SRCS = [ "//docs/generated/sql/bnf:set_rest_more.bnf", "//docs/generated/sql/bnf:set_session_stmt.bnf", "//docs/generated/sql/bnf:set_transaction.bnf", - "//docs/generated/sql/bnf:set_transaction_stmt.bnf", "//docs/generated/sql/bnf:show_backup.bnf", "//docs/generated/sql/bnf:show_cluster_setting.bnf", "//docs/generated/sql/bnf:show_columns_stmt.bnf",