dbaspot
Tags Register FAQ Calendar Search Today's Posts Mark Forums Read

Major diff between changing a VARCHAR to 70 or 100? - Database Discussions

This is a discussion on Major diff between changing a VARCHAR to 70 or 100? - Database Discussions ; "Harald Fuchs" wrote in message news:87r79w4stx.fsf @ srv.protecting.net... > In article , > "Laphan" writes: > > If you try to keep your field sizes tight, then you shouldn't use MySQL: > if you make one of your fields by ...


Home > Database Forum > Database and Unix Discussions > Database Discussions > Major diff between changing a VARCHAR to 70 or 100?

Reply

 

LinkBack Thread Tools Display Modes
  #11  
Old 01-18-2007, 12:32 AM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: Major diff between changing a VARCHAR to 70 or 100?

"Harald Fuchs" wrote in message
news:87r79w4stx.fsf@srv.protecting.net...
> In article <11ml7ctkk8g3399@corp.supernews.com>,
> "Laphan" writes:
>


> If you try to keep your field sizes tight, then you shouldn't use MySQL:
> if you make one of your fields by accident somewhat too tight, MySQL
> (at least before version 5) will silently destroy some of your data.



Correct me if I am wrong, but I do not believe that is _not_ a "MySQL"
dependent feature; rather it is a user selected pluggable database version
issue.
As I understand it, some of the engines will recoil and cancel transaction
(like INNODB).

~ Duane Phillips.


Reply With Quote
  #12  
Old 01-18-2007, 12:32 AM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: Major diff between changing a VARCHAR to 70 or 100?

In article ,
"Duane Phillips" writes:

> "Harald Fuchs" wrote in message
> news:87r79w4stx.fsf@srv.protecting.net...
>> In article <11ml7ctkk8g3399@corp.supernews.com>,
>> "Laphan" writes:
>>

>
>> If you try to keep your field sizes tight, then you shouldn't use MySQL:
>> if you make one of your fields by accident somewhat too tight, MySQL
>> (at least before version 5) will silently destroy some of your data.

>


> Correct me if I am wrong, but I do not believe that is _not_ a "MySQL"
> dependent feature; rather it is a user selected pluggable database version
> issue.
> As I understand it, some of the engines will recoil and cancel transaction
> (like INNODB).


Unfortunately it's a frontend issue - I destroyed most of my data by
erroneously doing a

ALTER TABLE mytbl MODIFY mycol TEXT NOT NULL

where mytbl was an InnoDB table. mycol originally was MEDIUMTEXT and
I only wanted to set the NOT NULL attribute.

Even MySQL 5.0.15 with "sql_mode = 'traditional'" does not prevent that.
Reply With Quote
  #13  
Old 01-18-2007, 12:32 AM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: Major diff between changing a VARCHAR to 70 or 100?

Harald Fuchs wrote:
> In article ,
> "Duane Phillips" writes:
>
>
>>"Harald Fuchs" wrote in message
>>news:87r79w4stx.fsf@srv.protecting.net...
>>
>>>In article <11ml7ctkk8g3399@corp.supernews.com>,
>>>"Laphan" writes:
>>>

>>
>>
>>
>>>If you try to keep your field sizes tight, then you shouldn't use MySQL:
>>>if you make one of your fields by accident somewhat too tight, MySQL
>>>(at least before version 5) will silently destroy some of your data.

>>
>>

>
>
>>Correct me if I am wrong, but I do not believe that is _not_ a "MySQL"
>>dependent feature; rather it is a user selected pluggable database version
>>issue.
>>As I understand it, some of the engines will recoil and cancel transaction
>>(like INNODB).

>
>
> Unfortunately it's a frontend issue - I destroyed most of my data by
> erroneously doing a
>
> ALTER TABLE mytbl MODIFY mycol TEXT NOT NULL
>
> where mytbl was an InnoDB table. mycol originally was MEDIUMTEXT and
> I only wanted to set the NOT NULL attribute.
>
> Even MySQL 5.0.15 with "sql_mode = 'traditional'" does not prevent that.



So, what's the problem? It did exactly what you told it to - like it
should.

I you have valuable data, just ensure you backup the table before you
alter it!


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Reply With Quote
  #14  
Old 01-18-2007, 12:32 AM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Major diff between changing a VARCHAR to 70 or 100?

Laphan wrote:
> Hi Guys
>
> Many thanks for the feedback.
>
> I know this is a little off topic, but I use decimal types for my price
> figures is there any problem in expanding these to say (13,6) when they are
> currently (10,3).
>
> Problems in that I am talking file size, query performance, etc.
>
> Thanks
>
>


It will add 3 bytes to each row in the table.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Reply With Quote
Reply

Thread Tools
Display Modes



All times are GMT -4. The time now is 12:23 PM.