Skip to content

Commit 2c8e559

Browse files
craig[bot]ecwallerikgrinakerkpatron-cockroachlabs
committed
104160: sql: add batch DELETE syntax r=rafiss a=ecwall Fixes cockroachdb#104157 This change adds the following DELETE syntax in preparation of bulk delete: `DELETE BATCH FROM` - To use the the default batch size `DELETE BATCH (SIZE expr) FROM` - To use the specified batch size These will return unimplemented errors for now. The syntax fulfills the following requirements: 1) DELETE keyword comes first because some tools look at the first keyword to determine what type of statement it is. 2) New BATCH params can be added in the future in a backward compatible way. 3) BATCH params (only SIZE for now) are order-independent for usability. 4) SIZE value is an expression to allow composing a DELETE statement from subqueries. Release note: None 105180: roachtest: pass monitor via `makeFailer` in `failover` tests r=erikgrinaker a=erikgrinaker Previously, we propagated the cluster monitor via `Failer.Ready()`, since the cluster hadn't been started yet when we constructed the failer (it might have to e.g. mess with the disk setup first). However, if `Failer.Cleanup()` relied on the monitor, and the test failed before `Ready()` was called, it could result in a nil pointer panic. It turns out the monitor doesn't actually monitor anything until we call `Wait()` on it, so we can safely construct it before starting the cluster. This patch therefore propagates the monitor via `makeFailer()` instead, such that it's never unset. Touches cockroachdb#104665. Epic: none Release note: None 105347: security: add back 22.1 TLS ciphers r=kpatron-cockroachlabs a=kpatron-cockroachlabs Previously, only some of the TLS ciphers that were valid in 22.1 were available even with `COCKROACH_TLS_ENABLE_OLD_CIPHER_SUITES` set. This produced a problem for some customers who upgrade to 22.2 as their applications suddenly might be unable to connect. This change adds back the full list of 22.1 cipher suites behind the environment variable. Note: this takes us away from the path of following the Mozilla standard for old cipher suites in favor of being consistent with old versions. fixes: CC-24958 Release note (security update): The full set of TLS ciphers that was present in 22.1 have ben included in the old cipher suites list, which can be enabled with the `COCKROACH_TLS_ENABLE_OLD_CIPHER_SUITES` environment variable Co-authored-by: Evan Wall <[email protected]> Co-authored-by: Erik Grinaker <[email protected]> Co-authored-by: Kyle Patron <[email protected]>
4 parents bbccc74 + 9e7aee6 + a8bdebf + 6b09438 commit 2c8e559

File tree

20 files changed

+345
-66
lines changed

20 files changed

+345
-66
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
delete_stmt ::=
2-
( ( 'WITH' ( ( common_table_expr ) ( ( ',' common_table_expr ) )* ) | 'WITH' 'RECURSIVE' ( ( common_table_expr ) ( ( ',' common_table_expr ) )* ) ) | ) 'DELETE' 'FROM' ( ( ( 'ONLY' | ) table_name opt_index_flags ( '*' | ) ) | ( ( 'ONLY' | ) table_name opt_index_flags ( '*' | ) ) table_alias_name | ( ( 'ONLY' | ) table_name opt_index_flags ( '*' | ) ) 'AS' table_alias_name ) ( 'USING' ( ( table_ref ) ( ( ',' table_ref ) )* ) | ) ( ( 'WHERE' a_expr ) | ) ( sort_clause | ) ( limit_clause | ) ( 'RETURNING' target_list | 'RETURNING' 'NOTHING' | )
2+
( ( 'WITH' ( ( common_table_expr ) ( ( ',' common_table_expr ) )* ) | 'WITH' 'RECURSIVE' ( ( common_table_expr ) ( ( ',' common_table_expr ) )* ) ) | ) 'DELETE' opt_batch_clause 'FROM' ( ( ( 'ONLY' | ) table_name opt_index_flags ( '*' | ) ) | ( ( 'ONLY' | ) table_name opt_index_flags ( '*' | ) ) table_alias_name | ( ( 'ONLY' | ) table_name opt_index_flags ( '*' | ) ) 'AS' table_alias_name ) ( 'USING' ( ( table_ref ) ( ( ',' table_ref ) )* ) | ) ( ( 'WHERE' a_expr ) | ) ( sort_clause | ) ( limit_clause | ) ( 'RETURNING' target_list | 'RETURNING' 'NOTHING' | )

docs/generated/sql/bnf/stmt_block.bnf

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ create_stmt ::=
198198
| create_schedule_stmt
199199

200200
delete_stmt ::=
201-
opt_with_clause 'DELETE' 'FROM' table_expr_opt_alias_idx opt_using_clause opt_where_clause opt_sort_clause opt_limit_clause returning_clause
201+
opt_with_clause 'DELETE' opt_batch_clause 'FROM' table_expr_opt_alias_idx opt_using_clause opt_where_clause opt_sort_clause opt_limit_clause returning_clause
202202

203203
drop_stmt ::=
204204
drop_ddl_stmt
@@ -603,6 +603,11 @@ opt_with_clause ::=
603603
with_clause
604604
|
605605

606+
opt_batch_clause ::=
607+
'BATCH'
608+
| 'BATCH' '(' batch_param_list ')'
609+
|
610+
606611
table_expr_opt_alias_idx ::=
607612
table_name_opt_idx
608613
| table_name_opt_idx table_alias_name
@@ -1037,6 +1042,7 @@ unreserved_keyword ::=
10371042
| 'BACKUP'
10381043
| 'BACKUPS'
10391044
| 'BACKWARD'
1045+
| 'BATCH'
10401046
| 'BEFORE'
10411047
| 'BEGIN'
10421048
| 'BINARY'
@@ -1378,6 +1384,7 @@ unreserved_keyword ::=
13781384
| 'SHARED'
13791385
| 'SHOW'
13801386
| 'SIMPLE'
1387+
| 'SIZE'
13811388
| 'SKIP'
13821389
| 'SKIP_LOCALITIES_CHECK'
13831390
| 'SKIP_MISSING_FOREIGN_KEYS'
@@ -1794,6 +1801,9 @@ with_clause ::=
17941801
'WITH' cte_list
17951802
| 'WITH' 'RECURSIVE' cte_list
17961803

1804+
batch_param_list ::=
1805+
( batch_param ) ( ( ',' batch_param ) )*
1806+
17971807
table_name_opt_idx ::=
17981808
opt_only table_name opt_index_flags opt_descendant
17991809

@@ -2563,6 +2573,9 @@ opt_full_backup_clause ::=
25632573
cte_list ::=
25642574
( common_table_expr ) ( ( ',' common_table_expr ) )*
25652575

2576+
batch_param ::=
2577+
'SIZE' a_expr
2578+
25662579
opt_only ::=
25672580
'ONLY'
25682581
|
@@ -3510,6 +3523,7 @@ bare_label_keywords ::=
35103523
| 'BACKUP'
35113524
| 'BACKUPS'
35123525
| 'BACKWARD'
3526+
| 'BATCH'
35133527
| 'BEFORE'
35143528
| 'BEGIN'
35153529
| 'BETWEEN'
@@ -3936,6 +3950,7 @@ bare_label_keywords ::=
39363950
| 'SHOW'
39373951
| 'SIMILAR'
39383952
| 'SIMPLE'
3953+
| 'SIZE'
39393954
| 'SKIP'
39403955
| 'SKIP_LOCALITIES_CHECK'
39413956
| 'SKIP_MISSING_FOREIGN_KEYS'

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.

0 commit comments

Comments
 (0)