default length for varchar fields

[expired user #1821]'s profile image [expired user #1821] posted 18 years ago in General Permalink
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
[expired user #1919]'s profile image [expired user #1919] posted 18 years ago Permalink
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.
ansgar's profile image ansgar posted 18 years ago Permalink
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.
[expired user #1919]'s profile image [expired user #1919] posted 18 years ago Permalink
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?
ansgar's profile image ansgar posted 18 years ago Permalink
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.
[expired user #1919]'s profile image [expired user #1919] posted 18 years ago Permalink

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
[expired user #1919]'s profile image [expired user #1919] posted 18 years ago Permalink
I downloaded it from here:

http://www.heidisql.com/forum/viewtopic.php?p=606#606
ansgar's profile image ansgar posted 18 years ago Permalink
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 ?
[expired user #1919]'s profile image [expired user #1919] posted 18 years ago Permalink
Just downlaod it, let's see if it does what your one does.

Cheers
[expired user #1919]'s profile image [expired user #1919] posted 18 years ago Permalink
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
[expired user #1821]'s profile image [expired user #1821] posted 18 years ago Permalink

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.
[expired user #1919]'s profile image [expired user #1919] posted 18 years ago Permalink
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
:)
ansgar's profile image ansgar posted 18 years ago Permalink
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.
[expired user #1919]'s profile image [expired user #1919] posted 18 years ago Permalink
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:
[expired user #1821]'s profile image [expired user #1821] posted 18 years ago Permalink


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
[expired user #1919]'s profile image [expired user #1919] posted 18 years ago Permalink
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.