← Back to team overview

maria-discuss team mailing list archive

Re: Problem in replication with NOW('2012-03-07 17:32:03')

 

Hi Jan,

The function NOW() was never supposed to take a timestamp as an argument, neither in MySQL nor in MariaDB. In earlier versions any argument was ignored. Starting from MariaDB 5.3 (and MySQL 5.6), when microseconds support was implemented, it takes an optional integer argument, which indicates a microsecond precision, so a value which cannot be interpreted as such causes a parsing error.

I'd say that the application that produces these statements should be fixed -- depending on where it takes the argument from, best case scenario is that it just does something meaningless, but it's also quite possible that it does not work as expected.

If you cannot change the behavior of the application, you might want to consider switching to row-based replication, this way you won't have a problem with the statement on newer servers.

Regards,
Elena


On 2/12/2013 1:56 AM, Jan Kirchhoff wrote:
Hi,

I set up 2 hosts as a galera cluster, one of them is a slave of my main
database.

The galera hosts are 5.5.28a-MariaDB-a1~precise-log, all other databases
are
  5.2.12-MariaDB-mariadb115~squeeze-log.

The 5.5 slave stops with 1064 errors. I figured this is because of
updates using NOW() on timestamp columns, I think they come from a
phpmyadmin frontend.
In the error log the queries look like this:

UPDATE ..., some_timestamp_field = NOW('2012-03-07 17:32:03') WHERE
...primary keys...

when I manually execute the query and just remove the NOW so it is a
simple update some_timestamp_field = '2012-03-07 17:32:03' and then
execute  set global sql_slave_skip_counter=1;slave start; everything is
fine again.

All 5.2 hosts replicate just fine.

is this a bug in 5.5?

Thanks
Jan


_______________________________________________
Mailing list: https://launchpad.net/~maria-discuss
Post to     : maria-discuss@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~maria-discuss
More help   : https://help.launchpad.net/ListHelp


Follow ups

References