It's in the doco:
http://www.mysql.com/doc/C/H/CHAR.html

<snip>

Values in VARCHAR columns are variable-length strings. You can declare a
VARCHAR column to be any length between 1 and 255, just as for CHAR columns.
However, in contrast to CHAR, VARCHAR values are stored using only as many
characters as are needed, plus one byte to record the length. Values are not
padded; instead, trailing spaces are removed when values are stored. (This
space removal differs from the ANSI SQL specification.)

</snip>

Regards
Al

> -----Original Message-----
> From: Wout Neirynck [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 13, 2002 3:40 PM
> To: [EMAIL PROTECTED]
> Subject: Inserting strings containing spaces only fails?
>
>
> Hello,
>
> Appareantly it's impossible to insert a string, consisting
> entirely out of
> spaces, in a textual field (I've tried varchar(19) and char(2)
> types, they
> both don't work). MySQL doesn't complain about it, but it trims
> the strings
> down to the empty string. If I try a select searching for the spaces-only
> string afterwards, it gives me zero results. The same problem occurs when
> updating.
> The problem does not occur, however, when converting the columns
> to "text"
> types.
>
> MySQL version: 3.23.47-nt
> OS: Windows NT 4.0
> Problem can be reproduced with MySQLGui and Java using the JDBC-MySQL
> bridge driver.
>
> Is this a bug or do I have to do something special to disable the 'string
> trimming'? Any help would be greatly appreciated!
>
> Wout Neirynck
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to