MySQL Forums
Forum List  »  Quality Assurance

Possible Bug with getString(int) in connectorj 5.1.21
Posted by: Damien Allison
Date: November 14, 2012 11:43AM

Hi,

I am trying to find the root cause of an issue I have been seeing with connectorj 5.1.21.

I have a table like:

CREATE TABLE `Thing` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`compressedContent` longblob,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

When I insert data into it I use a prepared statement like

INSERT INTO Thing (compressedContent) VALUES ((?));

So far all is good.

I have a 'read' prepared statement:

SELECT id, UNCOMPRESS(compressedContent) as content
FROM Thing;

The issue I seem to be seeing is that when you call getString(2) on the result set it returns a ASCII version of the UTF-8 string with the usual ?? bad encoded characters for anything not mapped the same way.

If I do new String(getBytes(2), Charset.forName("UTF-8")) things work fine.

Is this a bug? The documentation for uncompress is pretty vague and my assumption is that there is some code buried inside the connector that falls back to ASCII if it finds 'weird' metadata on columns like this one which is a function result?

Thanks,

Damien

Options: ReplyQuote


Subject
Views
Written By
Posted
Possible Bug with getString(int) in connectorj 5.1.21
2409
November 14, 2012 11:43AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.