I have a table with a column defined as the following.

 hash CHAR(16) BINARY NOT NULL

Most data inserts fine.  However, if data has trailing white space
(ASCII character 32), it seems to be getting truncated by MySQL during
the insert, such that subsequent queries to find the values fail.  Full
example below.

Any Ideas?


Thank you,

Gabriel

_________________
Gabriel Weinberg
[EMAIL PROTECTED]




INFO ABOUT SYSTEM:

bash-2.05b$ uname -a
FreeBSD prd01.navacity.com 5.0-RELEASE FreeBSD 5.0-RELEASE #0: Thu Jan
16 22:16:53 GMT 2003
[EMAIL PROTECTED]:/usr/obj/usr/src/sys/GENERIC  i386

bash-2.05b$ mysql --version
mysql  Ver 11.18 Distrib 3.23.55, for portbld-freebsd5.0 (i386)




EXAMPLE:


mysql> CREATE TABLE test (hash CHAR(16) BINARY NOT NULL, UNIQUE INDEX
(hash));
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql> INSERT INTO test (hash) VALUES ('abcdefghiklmnop ');
Query OK, 1 row affected (0.00 sec)

mysql>
mysql> SELECT * FROM test;
+-----------------+
| hash            |
+-----------------+
| abcdefghiklmnop |
+-----------------+
1 row in set (0.00 sec)

mysql>
mysql> SELECT hash FROM test WHERE hash = 'abcdefghiklmnop ';
Empty set (0.00 sec)

mysql>
mysql> SELECT hash FROM test WHERE hash = 'abcdefghiklmnop';
+-----------------+
| hash            |
+-----------------+
| abcdefghiklmnop |
+-----------------+
1 row in set (0.00 sec)



---------------------------------------------------------------------
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