home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
HTPC Projects
Software
Tools and other software
[How To] [User Exp] Update MySQL
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Miwer" data-source="post: 1068290" data-attributes="member: 132832"><p>Hi, I just discovered a little quirk about my script... </p><p>Well, to be honest, I kinda had a feeling about this, but wanted to test it first, and now I have verified it.</p><p></p><p>These two lines:</p><p>[CODE]ALTER TABLE `mptvdb`.`recording` CHANGE COLUMN `fileName` `fileName` VARCHAR(255) NOT NULL;</p><p>ALTER TABLE `mptvdb`.`schedule` CHANGE COLUMN `programName` `programName` VARCHAR(255) NOT NULL;[/CODE]</p><p></p><p>... <strong>WILL fail</strong> 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). </p><p></p><p>I order to circumvent the error, and force the change through, there need to be an IGNORE statement in the command ("ALTER IGNORE TABLE...")</p><p>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.</p><p></p><p>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. <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite14" alt=":cautious:" title="Cautious :cautious:" loading="lazy" data-shortname=":cautious:" /></p><p></p><p>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). <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite23" alt=":sneaky:" title="Sneaky :sneaky:" loading="lazy" data-shortname=":sneaky:" /><img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite27" alt=":whistle:" title="Whistling :whistle:" loading="lazy" data-shortname=":whistle:" /></p><p></p><p>Have a nice day! <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /></p></blockquote><p></p>
[QUOTE="Miwer, post: 1068290, member: 132832"] 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] ... [B]WILL fail[/B] 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! :) [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
HTPC Projects
Software
Tools and other software
[How To] [User Exp] Update MySQL
Contact us
RSS
Top
Bottom