JDBC: statement.setBinaryStream fails iff mysql logging is disabled
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mysql-5.1 (Ubuntu) |
Expired
|
Medium
|
Unassigned |
Bug Description
MySQL 5.1 fails with "Incorrect a rguments to mysq ld_stmt_execute" on the following prepared statement:
update rpzone set d ata=?, protocol_ version=33 where zone_id='int_se mos_tavern_0'
if and only if mysql logging is disabled.
The problem does not occur on Debian 5.0, Ubuntu 09.04, 09.10, 10.04.
Setting the following lines in /etc/mysql/my.conf makes the problem go away:
general_log_file = /var/log/
general_log = 1
I tried it repeatedly and enabling logging really seems to make a difference. This was confirmed by rodneymillerpca in http://
I attached a network dump of both a good and a bad case. Note that the data sent from the client to the mysql server is bit by bit identical in both cases. The following java code is used to execute the statement:
public int execute(String sql, InputStream... inputStreams) throws SQLException, IOException {
String mySql = rewriteSql(sql);
int res = -2;
PreparedStatement statement = connection.
try {
int i = 1; // yes, jdbc starts counting at 1.
for (InputStream inputStream : inputStreams) {
statement.
i++;
}
res = statement.
} finally {
statement.
}
return res;
}
ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: mysql-server-5.1 5.1.49-1ubuntu8
ProcVersionSign
Uname: Linux 2.6.35-22-generic x86_64
NonfreeKernelMo
Architecture: amd64
Date: Tue Oct 19 21:21:02 2010
ProcEnviron:
LANG=de_DE.utf8
SHELL=/bin/bash
SourcePackage: mysql-5.1
Sorry, the additional spaces in the error message and statement are caused by me copying them from the network dump. They are not there in reality.