What does MySQL converting varchar to char? -
when add new table, made mistake : field varchar(255), have write join queries. alter table make char(6).
my question : mysql in case ? trims right ?
rather worry mysql or doesn't why not convert data before change.
e.g.
update yourtable set yourfield = left(yourfield,6); alter table yourtable modify column yourfield char(6)
you should note if column data long won't let alter assuming enable strict sql mode see shef's complete answer
Comments
Post a Comment