Hello Wout, > 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!
Please note the last few lines of each msg on this list. It required five seconds and the first 'hit' on a single search of the manual to find a reference. Please read the (fine) manual: 6.2.3.1 The CHAR and VARCHAR Types The CHAR and VARCHAR types are similar, but differ in the way they are stored and retrieved. The length of a CHAR column is fixed to the length that you declare when you create the table. The length can be any value between 1 and 255. (As of MySQL Version 3.23, the length of CHAR may be 0 to 255.) When CHAR values are stored, they are right-padded with spaces to the specified length. When CHAR values are retrieved, trailing spaces are removed. Regards, =dn --------------------------------------------------------------------- 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