File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -243,18 +243,18 @@ pub async fn construct_drop_table_txn_operations(
243243 // 3. The transaction ensures atomicity - either all references are deleted or none
244244 //
245245 // This avoids the overhead of reading each reference's seq while maintaining correctness.
246-
247- // Delete masking policy references
248- for policy_map in tb_meta . column_mask_policy_columns_ids . values ( ) {
249- txn . if_then
250- . push ( txn_op_del ( & MaskPolicyTableIdIdent :: new_generic (
251- tenant . clone ( ) ,
252- MaskPolicyIdTableId {
253- policy_id : policy_map . policy_id ,
254- table_id ,
255- } ,
256- ) ) ) ;
257- }
246+ let policy_ids : HashSet < u64 > = tb_meta
247+ . column_mask_policy_columns_ids
248+ . values ( )
249+ . map ( |policy_map| policy_map . policy_id )
250+ . collect ( ) ;
251+
252+ txn . if_then . extend ( policy_ids . into_iter ( ) . map ( |policy_id| {
253+ txn_op_del ( & MaskPolicyTableIdIdent :: new_generic (
254+ tenant . clone ( ) ,
255+ MaskPolicyIdTableId { policy_id , table_id } ,
256+ ) )
257+ } ) ) ;
258258
259259 // Delete row access policy reference
260260 if let Some ( policy_map) = & tb_meta. row_access_policy_columns_ids {
You can’t perform that action at this time.
0 commit comments