patch to mnesia

Hakan Mattsson hakan@REDACTED
Mon Sep 4 15:40:52 CEST 2000


These two errors has been fixed in Mnesia 3.9.2
(now available in Erlang/OTP R7A). But thanks
anyway for your debugging effort!

/Håkan

PS.

   The external textfile format is not intended to be used
   in real products. Please, follow the advice in the Mnesia
   man-page:

	"Only use this function for educational purposes.
        Use other functions to deal with real backups."

---
Håkan Mattsson
Ericsson
Computer Science Laboratory
http://www.ericsson.se/cslab/~hakan

On Mon, 4 Sep 2000 luc.taesch@REDACTED wrote:

> im happy to ( humbly ?) contribute my first patch.(well, maybe).
> 
> on mnesia 3.8.2, linux, i cant have mnesia:load_textfile working.
> 
> i found that in mnesia_text.erl, L78, make_tabs/1 uses:
>  case catch mnesia:table_info(Tab, size) of
> 	{'EXIT', _} -> %% non-existing table
> to check the prior existence to the table Tab.
> 
> unfortunately, mnesia:table_info( non_existent_table, size) returns 0 on my 
> release., and not {EXIT..} (which is fair)
> 
> ill suggest using table_info(Tab, record_info) instead, which does reply exit 
> for a  non_existent_table.
> 
> another one
> :  line 80 Attrs is a list, so  
>  case mnesia:create_table(Tab, [{attributes, [Attrs]}])
> should be:
>   case mnesia:create_table(Tab, [{attributes, Attrs}])
> 
> 
> here is the final working code code :
> 
> diff /home/luc/test/otp_src_R6B-0/lib/mnesia/src/mnesia_text.erl 
> /usr/local/lib/erlang/lib/mnesia-3.8.2/src/mnesia_text.erl
> 78c78
> <     case catch mnesia:table_info(Tab, size) of
> ---
> >     case catch mnesia:table_info(Tab, record_info) of
> 80c80
> <           case mnesia:create_table(Tab, [{attributes, [Attrs]}]) of
> ---
> >           case mnesia:create_table(Tab, [{attributes, Attrs}]) of
> [luc@REDACTED src]$    
> 




More information about the erlang-questions mailing list