Does MySql ALTER TABLE command affects rows?

108 views Asked by At

I'm using query

ALTER TABLE `DEPLOYMENT` CHANGE COLUMN `ID_` `ID_` VARCHAR(100) NOT NULL 
-> 72 row(s) affected Records: 72 Duplicates: 0 Warnings: 0  0.281 sec 

But 2nd time while executing same query

ALTER TABLE `DEPLOYMENT` CHANGE COLUMN `ID_` `ID_` VARCHAR(200) NOT NULL  
0 row(s) affected Records: 0 Duplicates: 0 Warnings: 0  0.265 sec

Does it really affects the data?

1

There are 1 answers

3
Barmar On

Increasing the length of a VARCHAR column doesn't need to modify any rows, unless the length changes from 1-255 to 256-65535. In that case it has to add a byte to the length field, which will affect every row.