question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[MySQL] Time type not stored correctly when using ProxySQL

See original GitHub issue

The 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:

  1. Use as jbang template jbang init -t issue881@DavideD/jbang-rep Issue881.java
  2. Start docker images with: docker-compose up
  3. Run the test with JBang: jbang Issue881.java

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
vietjcommented, Aug 26, 2021

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.

0reactions
vietjcommented, Aug 27, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found