@@ -3065,7 +3065,7 @@ mod tests {
3065
3065
let ( datastore, mut tx, table_id) = setup_table ( ) ?;
3066
3066
3067
3067
// Insert a row and commit.
3068
- let row = random_row ( ) ;
3068
+ let row: ProductValue = random_row ( ) ;
3069
3069
insert ( & datastore, & mut tx, table_id, & row) ?;
3070
3070
commit ( & datastore, tx) ?;
3071
3071
@@ -3088,22 +3088,30 @@ mod tests {
3088
3088
let _ = datastore. rollback_mut_tx ( tx) ;
3089
3089
3090
3090
// Ensure the table still exists in the next transaction.
3091
- let tx = begin_mut_tx ( & datastore) ;
3091
+ let mut tx = begin_mut_tx ( & datastore) ;
3092
3092
assert_eq ! ( tx. pending_schema_changes( ) , [ ] ) ;
3093
3093
assert ! (
3094
3094
datastore. table_id_exists_mut_tx( & tx, & table_id) ,
3095
3095
"Table should still exist" ,
3096
3096
) ;
3097
- assert_eq ! ( all_rows( & datastore, & tx, table_id) , [ row] ) ;
3098
- let _ = datastore. rollback_mut_tx ( tx) ;
3097
+ assert_eq ! ( all_rows( & datastore, & tx, table_id) , [ row. clone( ) ] ) ;
3099
3098
3100
- let mut tx = begin_mut_tx ( & datastore ) ;
3099
+ // Now drop the table again and commit.
3101
3100
assert ! ( datastore. drop_table_mut_tx( & mut tx, table_id) . is_ok( ) ) ;
3102
- commit ( & datastore, tx) ?;
3101
+ let tx_data = commit ( & datastore, tx) ?;
3102
+ let ( _, deleted) = tx_data
3103
+ . deletes ( )
3104
+ . find ( |( id, _) | * * id == table_id)
3105
+ . expect ( "should have deleted rows for `table_id`" ) ;
3106
+ assert_eq ! ( & * * deleted, [ row] ) ;
3103
3107
3104
- let tx = begin_mut_tx ( & datastore ) ;
3108
+ // In the next transaction, the table doesn't exist.
3105
3109
assert ! (
3106
- !datastore. table_id_exists_mut_tx( & tx, & table_id) ,
3110
+ !datastore. table_id_exists_mut_tx( & begin_mut_tx( & datastore) , & table_id) ,
3111
+ "Table should be removed" ,
3112
+ ) ;
3113
+ assert ! (
3114
+ !datastore. table_id_exists_tx( & begin_tx( & datastore) , & table_id) ,
3107
3115
"Table should be removed" ,
3108
3116
) ;
3109
3117
0 commit comments