----- Forwarded by Jumroen Bhoosawang/Freewill Solutions/TH on 02/12/2002
12:34 -----
Jumroen
Bhoosawang To: [EMAIL PROTECTED]
cc:
02/12/2002 12:48 Subject: Binary column operation
problem
I found 2 problem in binary column operation.
Platform : Windows 2000 SP3
MySQL version : : 4.0.5-beta-max-nt
1. Cannot use
select id from testbinary where id = X'4142';
But I can do like & in
select id from testbinary where id like X'4142';
select id from testbinary where id in ( X'4142');
2. Cannot insert row that ends with 0x20
insert into testbinary values ( X'4120');
The result is 0x41 only without 0x20
My testcase is below.
Regards,
Jumroen Bhoosawang
mysql> use test
mysql> create table testbinary (id char(2) binary);
mysql> insert into testbinary values ( X'4142');
mysql> select hex(id) from testbinary;
+---------+
| hex(id) |
+---------+
| 4142 |
+---------+
1 row in set (0.00 sec)
mysql> select hex(id) from testbinary where id = X'4142';
Empty set (0.00 sec)
mysql> select hex(id) from testbinary where id in (X'4142');
+---------+
| hex(id) |
+---------+
| 4142 |
+---------+
1 row in set (0.00 sec)
mysql> select hex(id) from testbinary where id like X'4142';
+---------+
| hex(id) |
+---------+
| 4142 |
+---------+
1 row in set (0.00 sec)
mysql> insert into testbinary values ( X'4120');
mysql> select hex(id) from testbinary;
+---------+
| hex(id) |
+---------+
| 4142 |
| 41 |
+---------+
2 rows 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