Bug #10323 The characer 0x1f is treated as a trailing space in insert
Submitted: 2 May 2005 20:46 Modified: 2 May 2005 21:40
Reporter: Allen Jensen Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S1 (Critical)
Version:4.1.7 OS:FreeBSD (FreeBSD)
Assigned to: CPU Architecture:Any

[2 May 2005 20:46] Allen Jensen
Description:
When inserting into a VARBINARY, the character represented by hex code 0x1f is treated like a trailing space and dropped.  This results in a duplicate key if the column is the primary key.  This happens when the character set for both the client and the server are set to utf-8 using:

[server]
character-set-server=utf8

[client]
default-character-set=utf8

All variables like 'character_set_%' are utf8.

How to repeat:
The following SQL reproduces the problem when all character sets are set to utf8.  Uses MyISAM default engine.  Same behaviour if you replace the 1f with a 20 (space):

CREATE TABLE test (
  c1 varbinary(255) NOT NULL default '',
  c2 int(11) default '0',
  c3 int(11) default '0',
  PRIMARY KEY  (c1)
);
insert into test values (0x74,2,12);
insert into test values (0x741f,0,1);
[2 May 2005 21:40] Hartmut Holzgraefe
this has been fixed in the current 4.1.11 release