HandlerSocket-Plugin-for-MySQL icon indicating copy to clipboard operation
HandlerSocket-Plugin-for-MySQL copied to clipboard

String truncation,get wrong query result

Open moonbingbing opened this issue 14 years ago • 1 comments

Environment: MySQL server : Percona 5.1.55, default with handlersocket client: python2.5 ,with pyhs

you can reproduce the problem :

  1. CREATE TABLE file.test ( id int(10) unsigned NOT NULL AUTO_INCREMENT, string char(2) NOT NULL, PRIMARY KEY (id), KEY Index_string (string) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

2.insert into test(string) values('12')

3.Query by handlersocket like this SQL : select id from test where string = '123';
The result should be null,however, handlersocket found ‘12’ corresponding to the id value. I guess handlersocket cut off in accordance with the definition of string field

moonbingbing avatar Apr 23 '11 02:04 moonbingbing

client pyhs is no problem.pyhs's bebug info is :

DEBUG: sent data: P 0 file test Index_string id

DEBUG: read data bucket: 0 1

DEBUG: sent data: 0 = 1 123 0 0

DEBUG: read data bucket: 0 1 1

moonbingbing avatar Apr 23 '11 02:04 moonbingbing