4242 create_live_table_index_disc_only /1 , del_table_index_ram /1 ,
4343 del_table_index_disc /1 , del_table_index_disc_only /1 ,
4444 idx_schema_changes_ram /1 , idx_schema_changes_disc /1 ,
45- idx_schema_changes_disc_only /1 ]).
45+ idx_schema_changes_disc_only /1 , stacktrace_return / 1 ]).
4646
4747-export ([do_nested /1 ]).
4848
@@ -69,7 +69,7 @@ all() ->
6969 [write , read , wread , delete , delete_object_bag , delete_object_set ,
7070 match_object , select , select14 , all_keys , transaction , transaction_counters ,
7171 {group , nested_activities }, {group , index_tabs },
72- {group , index_lifecycle }].
72+ {group , index_lifecycle }, stacktrace_return ].
7373
7474groups () ->
7575 [{nested_activities , [],
@@ -1432,3 +1432,27 @@ idx_schema_changes(Config, Storage) ->
14321432 ? match ([{Tab , 16 , 66 }], rpc :call (N1 , mnesia , dirty_index_read , [Tab , 66 , Idx ])),
14331433
14341434 ? verify_mnesia (Nodes , []).
1435+
1436+ % % Check return value of aborted mnesia:transaction/1
1437+
1438+ stacktrace_return (suite ) -> [];
1439+ stacktrace_return (Config ) ->
1440+ [_N ] = ? acquire_nodes (1 , Config ),
1441+ Throw = fun () -> throw (test ) end ,
1442+ Exit = fun () -> exit (test ) end ,
1443+ Error = fun () -> error (test ) end ,
1444+
1445+ ? match ({aborted , {throw , test }}, mnesia :transaction (Throw )),
1446+ ? match ({aborted , test }, mnesia :transaction (Exit )),
1447+ ? match ({aborted , {test , [{? MODULE , _ , _ , _ } | _ ]}}, mnesia :transaction (Error )),
1448+
1449+ Nested = fun (F ) ->
1450+ fun () ->
1451+ {aborted , Reason } = mnesia :transaction (F ),
1452+ mnesia :abort (Reason )
1453+ end
1454+ end ,
1455+
1456+ ? match ({aborted , {throw , test }}, mnesia :transaction (Nested (Throw ))),
1457+ ? match ({aborted , test }, mnesia :transaction (Nested (Exit ))),
1458+ ? match ({aborted , {test , [{? MODULE , _ , _ , _ } | _ ]}}, mnesia :transaction (Nested (Error ))).
0 commit comments