Discussion:
[JIRA] Created: (MYO-104) Tungsten Connector truncates blog data inserted into the database
Robert Hodges (JIRA)
2009-08-18 01:03:46 UTC
Permalink
Tungsten Connector truncates blog data inserted into the database
-----------------------------------------------------------------

Key: MYO-104
URL: https://forge.continuent.org/jira/browse/MYO-104
Project: Tungsten Connector
Type: Bug

Components: MySQL protocol
Reporter: Robert Hodges
Assigned to: Gilles Rayrat
Priority: Blocker
Fix For: 0.6.8


The attached test program shows that the Tungsten Connector w/ SQL Router loses bytes when inserting binary data into a table on the MySQL server. Here's how to reproduce.

1.) Set up Tungsten Connector with SQL Router.

2.) Connect to database via the Connector using the attached test program. The test fails when it compares inserted and select binary data lengths.

3.) If you then select the length of the data in the database, the bytes are already truncated, as in the following example. (The length should be 1024.

mysql> select id, length(data) from blobtest;
+------+--------------+
| id | length(data) |
+------+--------------+
| 1 | 965 |
+------+--------------+
1 row in set (0.00 sec)

The code example requires JDBC4/JDK 1.6. I was testing with MySQL 5.1.34 with Connector/J 5.1.5.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://forge.continuent.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
Gilles Rayrat (JIRA)
2009-08-18 09:39:47 UTC
Permalink
[ https://forge.continuent.org/jira/browse/MYO-104?page=all ]

Gilles Rayrat closed MYO-104:
-----------------------------

Resolution: Not an issue

?useServerPrepStmts=true is mandatory for use of prepared statements with myosotis
Post by Robert Hodges (JIRA)
Tungsten Connector truncates blog data inserted into the database
-----------------------------------------------------------------
Key: MYO-104
URL: https://forge.continuent.org/jira/browse/MYO-104
Project: Tungsten Connector
Type: Bug
Components: MySQL protocol
Reporter: Robert Hodges
Assignee: Gilles Rayrat
Priority: Blocker
Fix For: 0.6.8
Attachments: BlobTest.java, BlobTest.java, connector.properties
The attached test program shows that the Tungsten Connector w/ SQL Router loses bytes when inserting binary data into a table on the MySQL server. Here's how to reproduce.
1.) Set up Tungsten Connector with SQL Router.
2.) Connect to database via the Connector using the attached test program. The test fails when it compares inserted and select binary data lengths.
3.) If you then select the length of the data in the database, the bytes are already truncated, as in the following example. (The length should be 1024.
mysql> select id, length(data) from blobtest;
+------+--------------+
| id | length(data) |
+------+--------------+
| 1 | 965 |
+------+--------------+
1 row in set (0.00 sec)
The code example requires JDBC4/JDK 1.6. I was testing with MySQL 5.1.34 with Connector/J 5.1.5.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://forge.continuent.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
Gilles Rayrat (JIRA)
2009-08-18 09:39:46 UTC
Permalink
[ https://forge.continuent.org/jira/browse/MYO-104?page=comments#action_15709 ]

Gilles Rayrat commented on MYO-104:
-----------------------------------

Putting the connector in trace mode showed that the insert was not actually prepared.
This is due to the mysql jdbc driver that replaces prepared statement parameters by their value by default.
URL option useServerPrepStmts=true disables this behavior
Post by Robert Hodges (JIRA)
Tungsten Connector truncates blog data inserted into the database
-----------------------------------------------------------------
Key: MYO-104
URL: https://forge.continuent.org/jira/browse/MYO-104
Project: Tungsten Connector
Type: Bug
Components: MySQL protocol
Reporter: Robert Hodges
Assignee: Gilles Rayrat
Priority: Blocker
Fix For: 0.6.8
Attachments: BlobTest.java, BlobTest.java, connector.properties
The attached test program shows that the Tungsten Connector w/ SQL Router loses bytes when inserting binary data into a table on the MySQL server. Here's how to reproduce.
1.) Set up Tungsten Connector with SQL Router.
2.) Connect to database via the Connector using the attached test program. The test fails when it compares inserted and select binary data lengths.
3.) If you then select the length of the data in the database, the bytes are already truncated, as in the following example. (The length should be 1024.
mysql> select id, length(data) from blobtest;
+------+--------------+
| id | length(data) |
+------+--------------+
| 1 | 965 |
+------+--------------+
1 row in set (0.00 sec)
The code example requires JDBC4/JDK 1.6. I was testing with MySQL 5.1.34 with Connector/J 5.1.5.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://forge.continuent.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
Loading...