Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
104160: sql: add batch DELETE syntax r=rafiss a=ecwall

Fixes #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 #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]>
  • Loading branch information
4 people committed Jun 22, 2023
4 parents bbccc74 + 9e7aee6 + a8bdebf + 6b09438 commit 2c8e559
Show file tree
Hide file tree
Showing 20 changed files with 345 additions and 66 deletions.
2 changes: 1 addition & 1 deletion docs/generated/sql/bnf/delete_stmt.bnf
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
delete_stmt ::=
( ( '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' | )
( ( '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' | )
17 changes: 16 additions & 1 deletion docs/generated/sql/bnf/stmt_block.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ create_stmt ::=
| create_schedule_stmt

delete_stmt ::=
opt_with_clause 'DELETE' 'FROM' table_expr_opt_alias_idx opt_using_clause opt_where_clause opt_sort_clause opt_limit_clause returning_clause
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

drop_stmt ::=
drop_ddl_stmt
Expand Down Expand Up @@ -603,6 +603,11 @@ opt_with_clause ::=
with_clause
|

opt_batch_clause ::=
'BATCH'
| 'BATCH' '(' batch_param_list ')'
|

table_expr_opt_alias_idx ::=
table_name_opt_idx
| table_name_opt_idx table_alias_name
Expand Down Expand Up @@ -1037,6 +1042,7 @@ unreserved_keyword ::=
| 'BACKUP'
| 'BACKUPS'
| 'BACKWARD'
| 'BATCH'
| 'BEFORE'
| 'BEGIN'
| 'BINARY'
Expand Down Expand Up @@ -1378,6 +1384,7 @@ unreserved_keyword ::=
| 'SHARED'
| 'SHOW'
| 'SIMPLE'
| 'SIZE'
| 'SKIP'
| 'SKIP_LOCALITIES_CHECK'
| 'SKIP_MISSING_FOREIGN_KEYS'
Expand Down Expand Up @@ -1794,6 +1801,9 @@ with_clause ::=
'WITH' cte_list
| 'WITH' 'RECURSIVE' cte_list

batch_param_list ::=
( batch_param ) ( ( ',' batch_param ) )*

table_name_opt_idx ::=
opt_only table_name opt_index_flags opt_descendant

Expand Down Expand Up @@ -2563,6 +2573,9 @@ opt_full_backup_clause ::=
cte_list ::=
( common_table_expr ) ( ( ',' common_table_expr ) )*

batch_param ::=
'SIZE' a_expr

opt_only ::=
'ONLY'
|
Expand Down Expand Up @@ -3510,6 +3523,7 @@ bare_label_keywords ::=
| 'BACKUP'
| 'BACKUPS'
| 'BACKWARD'
| 'BATCH'
| 'BEFORE'
| 'BEGIN'
| 'BETWEEN'
Expand Down Expand Up @@ -3936,6 +3950,7 @@ bare_label_keywords ::=
| 'SHOW'
| 'SIMILAR'
| 'SIMPLE'
| 'SIZE'
| 'SKIP'
| 'SKIP_LOCALITIES_CHECK'
| 'SKIP_MISSING_FOREIGN_KEYS'
Expand Down
7 changes: 7 additions & 0 deletions pkg/ccl/logictestccl/tests/3node-tenant/generated_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2c8e559

Please sign in to comment.