Reply to thread

Hi, I just discovered a little quirk about my script... 

Well, to be honest, I kinda had a feeling about this, but wanted to test it first, and now I have verified it.


These two lines:

[CODE]ALTER TABLE `mptvdb`.`recording` CHANGE COLUMN `fileName` `fileName` VARCHAR(255) NOT NULL;

ALTER TABLE `mptvdb`.`schedule` CHANGE COLUMN `programName` `programName` VARCHAR(255) NOT NULL;[/CODE]


... WILL fail with an "Error Code: 1265. Data truncated for column (xxx)" , if there's any data in the tables exceeding the newly set length of the fields (which are shorter than the original lengths of 260 and 256 respectively).


I order to circumvent the error, and force the change through, there need to be an IGNORE statement in the command ("ALTER IGNORE TABLE...")

However this will cause modification of user data in the database. Though It will only truncate the excessive characters in the column, not the entire record.


So, here's a choice for the developers: modify the users data, forcing the upgrade of the table, or skip it, if there's data that won't fit the new shorter limit. :cautious:


Correct me if I'm wrong: I'm guessing that truncating data in the schedule.programName column shouldn't have any functional impact, however truncating the recording.fileName column could cause some recordings not working anymore. But how likely is anyone to have filenames up to the Windows API limit of 260 chars anyway?? (I know this limit has exceptions). :sneaky::whistle:


Have a nice day! :)


Top Bottom