Skip to content

Commit d697cd4

Browse files
committed
sql: add grammar for SHOW INSPECT ERRORS command
The command is added to view the results of data consistency validation jobs. This new statement requires new SQL grammar. The grammar is added in this change and the implementations will be added in future PRs. Epic: CRDB-30356 Part of: #148272 Release note (sql change): Introduces the `SHOW INSPECT ERRORS` statement that is unimplemented.
1 parent 3f6cb7a commit d697cd4

File tree

36 files changed

+420
-44
lines changed

36 files changed

+420
-44
lines changed

docs/generated/sql/bnf/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ FILES = [
264264
"show_keys",
265265
"show_locality",
266266
"show_locality_stmt",
267+
"show_inspect_errors_stmt",
267268
"show_partitions_stmt",
268269
"show_range_for_row_stmt",
269270
"show_ranges_stmt",

docs/generated/sql/bnf/create_changefeed_stmt.bnf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
create_changefeed_stmt ::=
2-
'CREATE' 'CHANGEFEED' 'FOR' changefeed_table_target ( ( ',' changefeed_table_target ) )* 'INTO' sink 'WITH' option '=' value ( ( ',' ( option '=' value | option | option '=' value | option ) ) )*
3-
| 'CREATE' 'CHANGEFEED' 'FOR' changefeed_table_target ( ( ',' changefeed_table_target ) )* 'INTO' sink 'WITH' option ( ( ',' ( option '=' value | option | option '=' value | option ) ) )*
4-
| 'CREATE' 'CHANGEFEED' 'FOR' changefeed_table_target ( ( ',' changefeed_table_target ) )* 'INTO' sink 'WITH' option '=' value ( ( ',' ( option '=' value | option | option '=' value | option ) ) )*
5-
| 'CREATE' 'CHANGEFEED' 'FOR' changefeed_table_target ( ( ',' changefeed_table_target ) )* 'INTO' sink 'WITH' option ( ( ',' ( option '=' value | option | option '=' value | option ) ) )*
6-
| 'CREATE' 'CHANGEFEED' 'FOR' changefeed_table_target ( ( ',' changefeed_table_target ) )* 'INTO' sink
2+
'CREATE' 'CHANGEFEED' for_with_lookahead_variants changefeed_table_target ( ( ',' changefeed_table_target ) )* 'INTO' sink 'WITH' option '=' value ( ( ',' ( option '=' value | option | option '=' value | option ) ) )*
3+
| 'CREATE' 'CHANGEFEED' for_with_lookahead_variants changefeed_table_target ( ( ',' changefeed_table_target ) )* 'INTO' sink 'WITH' option ( ( ',' ( option '=' value | option | option '=' value | option ) ) )*
4+
| 'CREATE' 'CHANGEFEED' for_with_lookahead_variants changefeed_table_target ( ( ',' changefeed_table_target ) )* 'INTO' sink 'WITH' option '=' value ( ( ',' ( option '=' value | option | option '=' value | option ) ) )*
5+
| 'CREATE' 'CHANGEFEED' for_with_lookahead_variants changefeed_table_target ( ( ',' changefeed_table_target ) )* 'INTO' sink 'WITH' option ( ( ',' ( option '=' value | option | option '=' value | option ) ) )*
6+
| 'CREATE' 'CHANGEFEED' for_with_lookahead_variants changefeed_table_target ( ( ',' changefeed_table_target ) )* 'INTO' sink
77
| 'CREATE_CHANGEFEED_FOR_DATABASE' 'CHANGEFEED' 'FOR' 'DATABASE' database_option db_level_changefeed_filter_option 'INTO' sink 'WITH' option '=' value ( ( ',' ( option '=' value | option | option '=' value | option ) ) )*
88
| 'CREATE_CHANGEFEED_FOR_DATABASE' 'CHANGEFEED' 'FOR' 'DATABASE' database_option db_level_changefeed_filter_option 'INTO' sink 'WITH' option ( ( ',' ( option '=' value | option | option '=' value | option ) ) )*
99
| 'CREATE_CHANGEFEED_FOR_DATABASE' 'CHANGEFEED' 'FOR' 'DATABASE' database_option db_level_changefeed_filter_option 'INTO' sink 'WITH' option '=' value ( ( ',' ( option '=' value | option | option '=' value | option ) ) )*
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
declare_cursor_stmt ::=
2-
'DECLARE' cursor_name opt_binary opt_sensitivity opt_scroll 'CURSOR' 'WITH' 'HOLD' 'FOR' select_stmt
3-
| 'DECLARE' cursor_name opt_binary opt_sensitivity opt_scroll 'CURSOR' 'WITHOUT' 'HOLD' 'FOR' select_stmt
4-
| 'DECLARE' cursor_name opt_binary opt_sensitivity opt_scroll 'CURSOR' 'FOR' select_stmt
2+
'DECLARE' cursor_name opt_binary opt_sensitivity opt_scroll 'CURSOR' 'WITH' 'HOLD' for_with_lookahead_variants select_stmt
3+
| 'DECLARE' cursor_name opt_binary opt_sensitivity opt_scroll 'CURSOR' 'WITHOUT' 'HOLD' for_with_lookahead_variants select_stmt
4+
| 'DECLARE' cursor_name opt_binary opt_sensitivity opt_scroll 'CURSOR' for_with_lookahead_variants select_stmt
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
show_inspect_errors_stmt ::=
2+
'SHOW' 'INSPECT' 'ERRORS' opt_for_table_clause opt_for_job_clause opt_with_details
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
show_stats_stmt ::=
2-
'SHOW' 'STATISTICS' 'FOR' 'TABLE' table_name opt_with_options
2+
'SHOW' 'STATISTICS' 'FOR_TABLE' 'TABLE' table_name opt_with_options

docs/generated/sql/bnf/show_var.bnf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ show_stmt ::=
3939
| show_zone_stmt
4040
| show_full_scans_stmt
4141
| show_default_privileges_stmt
42+
| show_inspect_errors_stmt

docs/generated/sql/bnf/stmt_block.bnf

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ close_cursor_stmt ::=
171171
| 'CLOSE' cursor_name
172172

173173
declare_cursor_stmt ::=
174-
'DECLARE' cursor_name opt_binary opt_sensitivity opt_scroll 'CURSOR' opt_hold 'FOR' select_stmt
174+
'DECLARE' cursor_name opt_binary opt_sensitivity opt_scroll 'CURSOR' opt_hold for_with_lookahead_variants select_stmt
175175

176176
fetch_cursor_stmt ::=
177177
'FETCH' cursor_movement_specifier
@@ -328,6 +328,7 @@ show_stmt ::=
328328
| show_zone_stmt
329329
| show_full_scans_stmt
330330
| show_default_privileges_stmt
331+
| show_inspect_errors_stmt
331332

332333
truncate_stmt ::=
333334
'TRUNCATE' opt_table relation_expr_list opt_drop_behavior
@@ -527,6 +528,10 @@ opt_hold ::=
527528
| 'WITHOUT' 'HOLD'
528529
|
529530

531+
for_with_lookahead_variants ::=
532+
'FOR'
533+
| 'FOR_TABLE'
534+
530535
cursor_movement_specifier ::=
531536
cursor_name
532537
| from_or_in cursor_name
@@ -642,7 +647,7 @@ create_stats_stmt ::=
642647
'CREATE' 'STATISTICS' statistics_name opt_stats_columns 'FROM' create_stats_target opt_create_stats_options
643648

644649
create_changefeed_stmt ::=
645-
'CREATE' 'CHANGEFEED' 'FOR' changefeed_table_targets opt_changefeed_sink opt_with_options
650+
'CREATE' 'CHANGEFEED' for_with_lookahead_variants changefeed_table_targets opt_changefeed_sink opt_with_options
646651
| 'CREATE_CHANGEFEED_FOR_DATABASE' 'CHANGEFEED' 'FOR' 'DATABASE' database_name db_level_changefeed_filter_option opt_changefeed_sink opt_with_options
647652
| 'CREATE' 'CHANGEFEED' opt_changefeed_sink opt_with_options 'AS' 'SELECT' target_list 'FROM' changefeed_target_expr opt_where_clause
648653

@@ -998,7 +1003,7 @@ show_sessions_stmt ::=
9981003
| 'SHOW' 'ALL' opt_cluster 'SESSIONS'
9991004

10001005
show_stats_stmt ::=
1001-
'SHOW' 'STATISTICS' 'FOR' 'TABLE' table_name opt_with_options
1006+
'SHOW' 'STATISTICS' 'FOR_TABLE' 'TABLE' table_name opt_with_options
10021007

10031008
show_tables_stmt ::=
10041009
'SHOW' 'TABLES' 'FROM' name '.' name with_comment
@@ -1043,6 +1048,9 @@ show_default_privileges_stmt ::=
10431048
| 'SHOW' 'DEFAULT' 'PRIVILEGES' 'FOR' 'GRANTEE' role_spec_list opt_in_schema
10441049
| 'SHOW' 'DEFAULT' 'PRIVILEGES' 'FOR' 'ALL' 'ROLES' opt_in_schema
10451050

1051+
show_inspect_errors_stmt ::=
1052+
'SHOW' 'INSPECT' 'ERRORS' opt_for_table_clause opt_for_job_clause opt_with_details
1053+
10461054
opt_table ::=
10471055
'TABLE'
10481056
|
@@ -1201,6 +1209,7 @@ unreserved_keyword ::=
12011209
| 'ENCRYPTION_INFO_DIR'
12021210
| 'ENUM'
12031211
| 'ENUMS'
1212+
| 'ERRORS'
12041213
| 'ESCAPE'
12051214
| 'EXCLUDE'
12061215
| 'EXCLUDING'
@@ -1459,6 +1468,7 @@ unreserved_keyword ::=
14591468
| 'ROUTINES'
14601469
| 'ROWS'
14611470
| 'RULE'
1471+
| 'RUN'
14621472
| 'RUNNING'
14631473
| 'SCHEDULE'
14641474
| 'SCHEDULES'
@@ -2214,6 +2224,18 @@ opt_in_schema ::=
22142224
'IN' 'SCHEMA' schema_name
22152225
|
22162226

2227+
opt_for_table_clause ::=
2228+
'FOR_TABLE' 'TABLE' table_name
2229+
|
2230+
2231+
opt_for_job_clause ::=
2232+
'FOR_JOB' 'JOB' iconst64
2233+
|
2234+
2235+
opt_with_details ::=
2236+
'WITH' 'DETAILS'
2237+
|
2238+
22172239
relation_expr ::=
22182240
table_name
22192241
| table_name '*'
@@ -4111,6 +4133,7 @@ bare_label_keywords ::=
41114133
| 'END'
41124134
| 'ENUM'
41134135
| 'ENUMS'
4136+
| 'ERRORS'
41144137
| 'ESCAPE'
41154138
| 'EXCLUDE'
41164139
| 'EXCLUDING'
@@ -4421,6 +4444,7 @@ bare_label_keywords ::=
44214444
| 'ROW'
44224445
| 'ROWS'
44234446
| 'RULE'
4447+
| 'RUN'
44244448
| 'RUNNING'
44254449
| 'SAVEPOINT'
44264450
| 'SCANS'

pkg/ccl/logictestccl/tests/3node-tenant/generated_test.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/ccl/logictestccl/tests/local-read-committed/generated_test.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/ccl/logictestccl/tests/local-repeatable-read/generated_test.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)