Major diff between changing a VARCHAR to 70 or 100?

This is a discussion on Major diff between changing a VARCHAR to 70 or 100? within the MySQL Database forums, part of the Database Forums category; "Harald Fuchs" <hf0923x@protecting.net> wrote in message news:87r79w4stx.fsf@srv.protecting.net... > In ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #11 (permalink)  
Old 11-07-2005
Duane Phillips
 
Posts: n/a
Default Re: Major diff between changing a VARCHAR to 70 or 100?

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

<SNIP SOME>
> 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.

<SNIP TO END>

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 (permalink)  
Old 11-08-2005
Harald Fuchs
 
Posts: n/a
Default Re: Major diff between changing a VARCHAR to 70 or 100?

In article <JsWdne1ILOjJL_LeRVn-hw@giganews.com>,
"Duane Phillips" <askme@askme.askme> writes:

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

> <SNIP SOME>
>> 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.

> <SNIP TO END>


> 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 (permalink)  
Old 11-13-2005
Jerry Stuckle
 
Posts: n/a
Default Re: Major diff between changing a VARCHAR to 70 or 100?

Harald Fuchs wrote:
> In article <JsWdne1ILOjJL_LeRVn-hw@giganews.com>,
> "Duane Phillips" <askme@askme.askme> writes:
>
>
>>"Harald Fuchs" <hf0923x@protecting.net> wrote in message
>>news:87r79w4stx.fsf@srv.protecting.net...
>>
>>>In article <11ml7ctkk8g3399@corp.supernews.com>,
>>>"Laphan" <info@SpamMeNot.co.uk> writes:
>>>

>>
>><SNIP SOME>
>>
>>>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.

>>
>><SNIP TO END>

>
>
>>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 (permalink)  
Old 11-13-2005
Jerry Stuckle
 
Posts: n/a
Default Re: 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 Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:33 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0