mnemosyne-bug?

Ulf Wiger <>
Wed Jun 18 10:14:50 CEST 2003


Looking at the code in mnemosynce_lc:make_rec_defs/1,

mk_rec_defs(TabAttrs) ->
  lists:map(fun({Tab,Attrs}) ->
                  {attribute,0,record,
                   {Tab, lists:map(fun(Attr) ->
                                         {record_field,0,{atom,0,Attr}}
                                   end, Attrs)}}
            end, TabAttrs).


shouldn't it call mnesia:table_info(Tab, record_name)
instead of naively assuming that the record_name is always
the same as the table name?

3> mnesia:create_table(foo,[{attributes,[a1,a2,a3]},{record_name,rec}]).
{atomic,ok}
4> mnesia:table_info(foo,record_name).
rec
5> mnesia:dirty_write(foo, {foo,1,2,3}).
** exited: {aborted,{bad_type,{foo,1,2,3}}} **
6> mnesia:dirty_write(foo, {rec,1,2,3}).
ok


/Uffe
-- 
Ulf Wiger, Senior Specialist,
   / / /   Architecture & Design of Carrier-Class Software
  / / /    Strategic Product & System Management
 / / /     Ericsson AB, Connectivity and Control Nodes




More information about the erlang-questions mailing list