-
Nisha Gopalakrishnan authored
Backport from mysql-trunk to mysql-5.6 and mysql-5.7. Bug#19894382 SERVER SIDE PREPARED STATEMENTS LEADS TO POTENTIAL OFF-BY-SECOND TIMESTAMP ON SLAVE For temporal type input parameter (as time, timestamp and datetime) of server side prepared statement, the fractional second part is ignored while preparing the query string. Executing such query string at slave is resulting in a time value difference between master and server. For server prepared statement, the parameters passed for execution are parsed and Item_param objects are created for it. While preparing Item_param for temporal types time, timestamp and datetime, precision for fractional second part's (Item_param::decimals) is set to "0" always. Because of which while preparing query string with param values, fractional second value is ignored. So execution of such prepared statements uses correct values but query string formed is incorrect. Hence difference in temporal type value is observed on usage of query string. Fix: -------- If temporal types time, timestamp and datetime has fractional second part then setting microseconds (6 digit) precision for the Item_param.
Nisha Gopalakrishnan authoredBackport from mysql-trunk to mysql-5.6 and mysql-5.7. Bug#19894382 SERVER SIDE PREPARED STATEMENTS LEADS TO POTENTIAL OFF-BY-SECOND TIMESTAMP ON SLAVE For temporal type input parameter (as time, timestamp and datetime) of server side prepared statement, the fractional second part is ignored while preparing the query string. Executing such query string at slave is resulting in a time value difference between master and server. For server prepared statement, the parameters passed for execution are parsed and Item_param objects are created for it. While preparing Item_param for temporal types time, timestamp and datetime, precision for fractional second part's (Item_param::decimals) is set to "0" always. Because of which while preparing query string with param values, fractional second value is ignored. So execution of such prepared statements uses correct values but query string formed is incorrect. Hence difference in temporal type value is observed on usage of query string. Fix: -------- If temporal types time, timestamp and datetime has fractional second part then setting microseconds (6 digit) precision for the Item_param.
Loading