List:General Discussion« Previous MessageNext Message »
From:Mark Maunder Date:December 3 2004 6:47pm
Subject:if last binary byte is space (ascii 32) mysql drops it
View as plain text  
This all started when one of the 16 byte binary primary keys kicked out
a duplicate key error. It seems mysql does not store the last byte of
the binary value if it is a space. That is, ascii 32 or hex 20. 

How do I force it to store the space? Thanks!

create table testtable ( id binary(16) NOT NULL PRIMARY KEY )
ENGINE=MyISAM;

insert into testtable ( id ) values
(0x3b3331105ee3f0779ad5f041e75f9420);

select hex(id) from testtable;
#HEX value retreived is 3B3331105EE3F0779AD5F041E75F94 and has length 30

select hex(id) from testtable where
id=0x3b3331105ee3f0779ad5f041e75f9420;
#nothing found



Thread
if last binary byte is space (ascii 32) mysql drops itMark Maunder3 Dec
  • Re: if last binary byte is space (ascii 32) mysql drops itDan Nelson3 Dec
    • Re: if last binary byte is space (ascii 32) mysql drops itMark Maunder3 Dec
    • Re: if last binary byte is space (ascii 32) mysql drops itPaul DuBois3 Dec
      • Re: if last binary byte is space (ascii 32) mysql drops itMark Maunder3 Dec
Re: if last binary byte is space (ascii 32) mysql drops itHeikki Tuuri3 Dec