Re: convert varchar to char

2005-08-16 Thread Jon Drukman
Pooly wrote: Damnit ! Thanks for pointing it, I forgot these things. But it's a bit more subtle : If any column in a table has a variable length, the entire row becomes variable-length as a result. Therefore, if a table contains any variable-length columns (VARCHAR, TEXT, or BLOB), all CHAR colu

Re: convert varchar to char

2005-08-13 Thread Pooly
Yeah, for example the last statement ALTER, ..., ... is the only way sometimes to make things working. anyway, it's worth knowing it. 2005/8/13, Chris Elsworth <[EMAIL PROTECTED]>: > On Sat, Aug 13, 2005 at 05:37:56PM +0100, Pooly wrote: > > Damnit ! > > Thanks for pointing it, I forgot these

Re: convert varchar to char

2005-08-13 Thread Chris Elsworth
On Sat, Aug 13, 2005 at 05:37:56PM +0100, Pooly wrote: > Damnit ! > Thanks for pointing it, I forgot these things. > But it's a bit more subtle : [snip] Bah, should have waited another 5 minutes before I bothered posting my last long-winded ramble ;) > ALTER TABLE sessions MODIFY id char(32) NOT

Re: convert varchar to char

2005-08-13 Thread Chris Elsworth
On Sat, Aug 13, 2005 at 04:01:38PM +0100, Pooly wrote: > > ALTER TABLE sessions MODIFY ip char(8) NOT NULL DEFAULT '0'; > ALTER TABLE sessions MODIFY id char(32) NOT NULL DEFAULT ''; Hello, Since you have two varchar columns, I don't think there's any way to convert them both to char without dro

Re: convert varchar to char

2005-08-13 Thread Pooly
Damnit ! Thanks for pointing it, I forgot these things. But it's a bit more subtle : If any column in a table has a variable length, the entire row becomes variable-length as a result. Therefore, if a table contains any variable-length columns (VARCHAR, TEXT, or BLOB), all CHAR columns longer than

Re: convert varchar to char

2005-08-13 Thread Roger Baklund
Pooly wrote: Hi, I try to convert a varchar to a char, but it doesn't seems to work. From the manual: "...all CHAR columns longer than three characters are changed to VARCHAR columns." http://dev.mysql.com/doc/mysql/en/silent-column-changes.html > -- Roger -- MySQL General Mailing List F

convert varchar to char

2005-08-13 Thread Pooly
Hi, I try to convert a varchar to a char, but it doesn't seems to work. show create table sessions; CREATE TABLE `sessions` ( `id` varchar(32) NOT NULL default '', `user_id` int(6) NOT NULL default '0', `ip` varchar(8) NOT NULL default '0', `lastseen` timestamp NOT NULL default CURRENT_