mnesia:transform_table - index handling bug?

Peter L erlang@REDACTED
Fri Jan 14 12:06:25 CET 2005


Been trying to "soft upgrade" my mnesia tables with mnesia:transform_table/3.

I had an extra index 'myindexattribute' at position 6 and then I added a new
normal non-indexed attribute in position 3, meaning that 'myindexattribute'
at position 6 moved to position 7 in the new mnesia table.

But the transform_table/3 did NOT move the extra index to the new position of
'myindexattribute' (6->7). In order to get it to upgraded properly (including
correct movement of the extra index), I was forced to do 3 statements instead
of one:

  mnesia:del_table_index(mytable,myindexattribute),
  mnesia:transform_table(mytable,UpgradeTableFun,NewAttrList),
  mnesia:add_table_index(mytable,myindexattribute),

I would say that that is a bug! Wouldn't you? At least this behaviour is not
documented. Or is there a better (more beautiful) way to get the same thing
done?

-- 
Peter Lund
Web: http://lundata.se
Tel: +46 70 543 9416




More information about the erlang-questions mailing list