CREATE TABLE messier_tmp (
        M int NOT NULL,
        Type CHAR(2) DEFAULT '**',
        Const CHAR(3) DEFAULT '***',
        Mag FLOAT,
        Ra  FLOAT,
        Decl FLOAT,
        Dist CHAR(20)
) engine=MyISAM;

LOAD DATA LOCAL INFILE 'messier.tsv'
  INTO TABLE messier_tmp
  (m, type, const, mag, @var1, decl, dist)
  SET ra = @var1*15;

select * from messier_tmp limit 3;


create table messier_tmp2 like messier_tmp;
alter table messier_tmp2 add inserted_on TIMESTAMP after M, add mag_mm smallint default 0;
describe messier_tmp2;

LOAD DATA LOCAL INFILE 'messier.tsv'
  INTO TABLE messier_tmp2
  (m, inserted_on, type, const, mag, @var1, decl, dist)
  SET inserted_on = CURRENT_TIMESTAMP, ra = @var1*15, mag_mm = mag*1000;

select * from messier_tmp2 limit 3;

