Bug #12491 Wrong value for tinyint
Submitted: 10 Aug 2005 13:14 Modified: 10 Aug 2005 13:35
Reporter: Martin Tilma Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:mysql-connector-java-3.1.10-bin OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[10 Aug 2005 13:14] Martin Tilma
Description:
Wrong value for tinyint

It should return the value 10 for m.target, but it returns the value 266. (see the used query by "How to repeat:")

How to repeat:
When I run my query:

SELECT
m.id,
m.name,
m.image,
m.target,
m.url,
m.action_id,
m.description,
( SUM(IF(action_message.action_id is null, 0, 1))>0 || SUM(IF(default_message.message_id is null, 0, 1))>0 ) as in_use,
target_action.name as action_name,
(target_action.booking_till < '2005-08-10') as action_expired,
action_message.rank as rank
FROM message as m
LEFT JOIN action_message ON m.id=action_message.message_id
LEFT JOIN action ON (action_message.action_id=action.id AND action.booking_from >= '2005-08-10')
LEFT JOIN default_message ON m.id=default_message.message_id
LEFT JOIN action as target_action ON m.action_id=target_action.id
WHERE m.id=2000001 GROUP BY m.id

When i replace the driver with version mysql-connector-java-3.1.7-bin it returns the correct value.

Field type:  "target" tinyint(3)
Java code to get the value: message.setTarget(rs.getInt("target"));
[10 Aug 2005 13:35] Mark Matthews
Known issue, already fixed in the sources for 3.1.11, see http://downloads.mysql.com/snapshots.php#connector-j if you want to test the fix.
[10 Aug 2005 13:42] Filip Rachunek
Hello Mark,
any idea when the 3.1.11 version can be released?
Due to this bug I cannot upgrade to MySQL 4.1 yet but I would prefer to use an official version of the Connector instead of a nightly snapshot.