Interesting... maybe this is because the fill is not actualy stored in the database... and being sorted/compared as a number MySQL removes the ZEROFILL !
You can go and do: select BINARY * from a union select BINARY * from a; -- Gabriel PREDA Senior Web Developer On 2/14/06, Juri Shimon <[EMAIL PROTECTED]> wrote: > > Hello mysql, > > Union on zerofilled fields eats 'zerofilling'. > > How to repeat: > > > create table a (id integer zerofill); > > insert into a values(1),(2),(3); > > select * from a; > +------------+ > | id | > +------------+ > | 0000000001 | > | 0000000002 | > | 0000000003 | > +------------+ > > > select * from a union select * from a; > +------+ > | id | > +------+ > | 1 | > | 2 | > | 3 | > +------+ > > Where are my leading zeroes? :( > > Is this a known bug? > > PS. On 4.1.* all works as expected. > -- > Best regards, > Juri mailto:[EMAIL PROTECTED] > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: > http://lists.mysql.com/[EMAIL PROTECTED]