[CONJ-448] QueryException: Incorrect arguments to mysqld_stmt_execute on inserting an "emptyString"-Lob with JPA Created: 2017-03-23  Updated: 2017-05-10  Resolved: 2017-04-03

Status: Closed
Project: MariaDB Connector/J
Component/s: Other
Affects Version/s: 1.5.8, 1.5.9
Fix Version/s: 2.0.0-RC, 1.6.0

Type: Bug Priority: Major
Reporter: Stefan Assignee: Diego Dupin
Resolution: Fixed Votes: 1
Labels: None
Environment:

Hibernate 5.2.8



 Description   

JPA-Mapping:
@Entity
public class someEntity

{ ... @Lob private String property = ""; ... }

Since version 1.5.8 persisting a new instance of 'someEntity' fails with following exception:
javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute statement
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:147)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:155)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:162)
at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:780)
at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:758)
at picture.infrastructure.rest.Request.persistEntity(Request.java:63)
Caused by: org.mariadb.jdbc.internal.util.dao.QueryException: Incorrect arguments to mysqld_stmt_execute
Query is: insert into SomeEntity (..., property, ...) values (...), parameters [...,<Buffer:''>, ...]
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.readErrorPacket(AbstractQueryProtocol.java:1144)
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.readPacket(AbstractQueryProtocol.java:1076)
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.getResult(AbstractQueryProtocol.java:1031)
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executePreparedQuery(AbstractQueryProtocol.java:617)
at org.mariadb.jdbc.MariaDbServerPreparedStatement.executeInternal(MariaDbServerPreparedStatement.java:401)
... 73 more

If the property contains a filled string, the entity will be persisted successfully.
Using an earlier Connector-version (e.g. 1.5.7) does not cause the exception.



 Comments   
Comment by Michael Haddon [ 2017-04-02 ]

I can confirm the existence of this bug. I have had to go back down to 1.5.7.

Comment by Diego Dupin [ 2017-04-03 ]

reproduced.
Now correcting issue

Comment by Tomas Gustavsson [ 2017-04-07 ]

Thanks for the fix, just happened to us with 1.5.9. Worked fine in 1.5.8.

Generated at Thu Feb 08 03:15:44 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.