distal-attribute
distal-attribute
distal-attribute
distal-attribute

default length for varchar fields

User, date Message
Written by siMKin
7 years ago
Category: General
104 posts since Sun, 01 Apr 07
This is only a very minor point, .. but i like nitpicking :-)

When creating a VARCHAR column, Heidi puts 50 as the default length. .. why 50? :)
I virtually always define it as 255. It requires the same space for any input and MySQL doesn't generate an error when you try to insert a length of 51 into a VARCHAR(50) field, but silently chops off the last character. So, 50 has only negative consequences and no advantage over 255
Written by westmatrix
7 years ago
82 posts since Wed, 11 Apr 07
What you said makes no sense that it is why you have not recieved a response.

When I create a new table then the first data type is TINYINT length = 3.
When I change it to VARCHAR = 3 I have to manually input the length to suite my needs.

Cheers
Hope this helps.
Written by ansgar
7 years ago
4936 posts since Fri, 07 Apr 06
Wow... be a bit more polite to other users, simkin's question is quite legitimate. I didn't reply yet as I oversaw this post. (And sorry, but there is no manual to read...)

The default length 50 is a quite random number I decided to use. Increasing the default to a maximum is not good in all cases I can think of. But here it makes some sense I think, as it is better than 50.
Written by westmatrix
7 years ago
82 posts since Wed, 11 Apr 07
Ok, you say that but how do I get that default of 50 when the first option is TINYINT which is = 3?

Where or what do you click to get 50 as the default?
Written by ansgar
7 years ago
4936 posts since Fri, 07 Apr 06
The "50" will show in the length-inputbox when you add a new varchar-column either in the column-editor or in the create-table-dialog.
Written by westmatrix
7 years ago
82 posts since Wed, 11 Apr 07

anse wrote: The "50" will show in the length-inputbox when you add a new varchar-column either in the column-editor or in the create-table-dialog.



I click on create table the first option is "TINYINT which is equal to 3"
If you have another version, where can I get it?

My version is = 3 RC4 blah blah blah
Written by westmatrix
7 years ago
82 posts since Wed, 11 Apr 07
I downloaded it from here:

http://www.heidisql.com/forum/viewtopic.php?p=606#606
Written by ansgar
7 years ago
4936 posts since Fri, 07 Apr 06
If your about-screen says "3.0 RC4" you have definitely not installed the 3.0 final. Maybe you downloaded it but didn't install? Or the .exe could not be replaced by the installer because it was started ?
Written by westmatrix
7 years ago
82 posts since Wed, 11 Apr 07
Just downlaod it, let's see if it does what your one does.

Cheers
Written by westmatrix
7 years ago
82 posts since Wed, 11 Apr 07
Ok cool the VARCHAR = 50
Ok so what is the problem again?
Why the application makes it 50 and you don't have an option to make it a default of 255?
Just change it - MySQL is rubbish anyway.
It wont ever be the BE ALL - END ALL!

PHP and MySQL sucks as far as I am concerned but that is my opinion as ASP is my first choice but my host only does PHP so my sites are all done in the very fun world of PHP.
Yes I am irritated by it, but hey who cares.

Cheers
West
Written by siMKin
7 years ago
104 posts since Sun, 01 Apr 07

westmatrix wrote: Ok cool the VARCHAR = 50
Ok so what is the problem again?
Why the application makes it 50 and you don't have an option to make it a default of 255?



There's not really a 'problem'
I only pointed out that VARCHAR(50) has disadvantages compared to VARCHAR(255) and no advantages. So, i find myself having to change the default everytime i create a VARCHAR field. And since VARCHAR(50) only has disadvantages i suggested the default should change to 255.
But as i said, it's just a minor thing.
Written by westmatrix
7 years ago
82 posts since Wed, 11 Apr 07
Fair enough, whover created this app did not think that far or it is a problem to code it in, plus it's free!
You wont et much for free stuff.

Cheers
:)
Written by ansgar
7 years ago
4936 posts since Fri, 07 Apr 06
Before someone asks about that: The fact that we use a default value for certain datatypes as varchar arose from the issue that you have to specify a default for them, otherwise the statement will fail. At this point I thougt a default of 50 would be quite good. Now we will change this default to 255 I think.
Written by westmatrix
7 years ago
82 posts since Wed, 11 Apr 07
I do like the way you code your app to suite all these needs, man If you can code me an automtic coffe maker, I'll take one of them.

Cheers
:lol:
Written by siMKin
7 years ago
104 posts since Sun, 01 Apr 07

westmatrix wrote:
You wont et much for free stuff.
:)



I've reviewed commercial software too, but Heidi is definitely superior to it ;)
So don't be misguided by the fact that it's free
Written by westmatrix
7 years ago
82 posts since Wed, 11 Apr 07
Cool.
I am not a PHP or MySQL guru but am forced to use it.

Sure thing dude.
Cheers...
 

Please login to leave a reply, or register at first.