[MySQL] Time type not stored correctly when using ProxySQL
See original GitHub issueThe original issue was open on Hibernate Reactive: https://github.com/hibernate/hibernate-reactive/issues/881
When using the Vert.x MySQL Client driver with ProxySQL, the time type is not stored correctly.
Here’s the descritption of the issue:
we are going to insert time 00:00 to database, but sometimes the data is incorrect after inserted to database.
we have LocalTime in the entity
@Column(name = "time")
private LocalTime time;
the insert statement from hibernate.show_sql log
insert into `TABLE` (`time`) values (?)
the bindings from the hibernate type trace log
[BasicBinder.java] - binding parameter [1] as [TIME] - [00:00]
but when the data inserted to the database, the data changed randomly, for example
id | time |
---|---|
1 | -838:59:59 |
2 | 00:00:20 |
3 | 00:00:00 |
4 | 00:02:57 |
May I know is there anything do after the binding and any ideas about it?
Environment
- Version: 1.0.0.CR6
- Database: ProxySQL 5.5.30 with MySQL 5.7.25-log
A JBang test case is available:
- Use as jbang template
jbang init -t issue881@DavideD/jbang-rep Issue881.java
- Start docker images with:
docker-compose up
- Run the test with JBang:
jbang Issue881.java
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
MySQL Variables - ProxySQL
When set, sessions will have a variable set with the user_name value, ie: SET @mysql-ldap_user_variable:='username' The use of this variable ...
Read more >Configuring ProxySQL
If the database file is not found (e.g. in case ProxySQL is being run for the first time or the database has been...
Read more >STATS (statistics) - ProxySQL
Table stats_mysql_commands_counters keeps records of all types of queries executed, and collects statistics based on their execution time, ...
Read more >MySQL Monitor Variables - ProxySQL
Connection timeout in milliseconds. The current implementation rounds this value to an integer number of seconds less or equal to the original ...
Read more >Global Variables - ProxySQL
Their names begin with the token “mysql-“. These global variables are stored in a per-thread fashion inside of the proxy in order to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
it looks like there is a bug in SQL proxy on how it interprets the packets under some conditions.
there is a workaround to fix this, to force the client to always send the type binding when executing a prepared statement but imho it seems it should be reported to SQL proxy.
I’ll open an issue there.
The issue has been reported as a bug in ProxySQL and shall be fixed, I’m closing this issue. NOTE: the same could happen with the JDBC driver.