Paul DeBois book knows the answer if you have other VARCHAR fields in the
table:

...you need to change all the columns (of type VARCHAR) at once in the same
alter table statement.....The reason is that if you change a single column
at a time, MySQL notices that the table still contains variable-length
columns and reverts the changed column back to VARCHAR to save space. To
deal with this, change all the VARCHAR columns at the same time:...

ALTER TABLE branch MODIFY codebase CHAR(32) NOT NULL DEFAULT 'Ipriori',
MODIFY other_varcharfield CHAR(?)  ????????;

Hope that helps

Hannes


On 8/1/01 12:31 PM, "Lezz Giles" <[EMAIL PROTECTED]> wrote:

> I'm running 3.21.33b (yes, I know it's old), and I run the command:
> 
>   alter table branch change codebase codebase char(32) not null default
> "IPriori";
> 
> where column codebase has type varchar(32) -  but the type does not change to
> char(32).
> There's no error message or other indication of what went wrong, and if I
> create
> 
> a little play table I can succesfully change the column type to char(32) from
> varchar(32).
> The table "branch" has just 180 rows in it.
> 
> I'd like to change the column types from varchar to char to speed up queries &
> etc.
> Can anybody shed any light on what I'm doing wrong?
> 
> Thanks,
> Lezz Giles


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to