>From the manual, 6.5.3.1 Silent Column Specification Changes, "In some cases, MySQL silently changes a column specification from that given in a CREATE TABLE statement. (This may also occur with ALTER TABLE.) .... If any column in a table has a variable length, the entire row is variable-length as a result. Therefore, if a table contains any variable-length columns (VARCHAR, TEXT, or BLOB), all CHAR columns longer than three characters are changed to VARCHAR columns."
PB ----- > l created a 'vacc_table.sql' script as follow : > > CREATE TABLE batches > ( batch_no int(4) , > batch_title char(20) > ); > > CREATE TABLE chart_of_acc_a > ( > desp varchar(80) NOT NULL, > acc_no_a char(8) NOT NULL, > id char > ); > > CREATE TABLE chart_of_acc_b > ( acc_no_b char(8) NOT NULL PRIMARY KEY, > desp varchar(80) NOT NULL, > id char > ); > > > after that , > > mysql>create database vaccount; > Query OK,1 rows affected (0.00 sec) > > mysql>use account; > Database changed > > mysql><\. vacc_table.sql > Query OK,0 rows affected (0.00 sec) > > Query OK,0 rows affected (0.00 sec) > > Query OK,0 rows affected (0.00 sec) > > mysql>describe chart_of_acc_b; > > -------------------------------------------------------------- > Field Type Null Key Default Extra > -------------------------------------------------------------- > acc_no_b varchar(8) PRI > desp varchar(80) > id char(1) YES NULL > -------------------------------------------------------------- > 3 rows in set (0.01sec) > > mysql> > > > l discovered that the field "acc_no_b" displayed with > a "varchar(8)"! > which is different from my 'vacc_table.sql' script , > because l defined > the field to be "char(8)" !!! > > is there any wrong with my script ?? > > > l am using mysql 4.0.4-0 and redhat 7.3 > > Thank U ... : ) > > Yours Faithfully, > > waimeng moan 31 oct 2002 9.15pm > > > > > > > > > __________________________________________________ > Do you Yahoo!? > HotJobs - Search new jobs daily now > http://hotjobs.yahoo.com/ > > --------------------------------------------------------------------- > 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 > > > --------------------------------------------------------------------- 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
