SunshineYang / mycheckpoint

Automatically exported from code.google.com/p/mycheckpoint
0 stars 1 forks source link

MySQL v5.6.12 has global variable slave_last_heartbeat - which causes mycheckpoint to fail #43

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
/usr/local/bin/mycheckpoint --verbose --debug 
--defaults-file=/etc/mycheckpoint.cnf
-- Using /etc/mycheckpoint.cnf as defaults file
-- mycheckpoint rev 231, build 201305231510. Copyright (c) 2009-2013 by Shlomi 
Noach
-- database is mycheckpoint
-- Global status & variables recorded
-- Master and slave status recorded
-- OS CPU info recorded
-- OS load average info recorded
-- OS mem info recorded
-- OS mountpoints info recorded
-- OS page io activity recorded
(1064, "You have an error in your SQL syntax; check the manual that corresponds 
to your MySQL server version for the right syntax to use near '06:15:47, 60, 0, 
1, 0, 1, 10, 0, 2, 3, 1, 3145716, 0, 607, 700896, 10566, 0, 1, ' at line 3")
Traceback (most recent call last):
  File "/usr/local/bin/mycheckpoint", line 5055, in <module>
    collect_status_variables()
  File "/usr/local/bin/mycheckpoint", line 4446, in collect_status_variables
    num_affected_rows = act_query(query)
  File "/usr/local/bin/mycheckpoint", line 254, in act_query
    num_affected_rows = cursor.execute(query)
  File "/usr/lib64/python2.6/site-packages/MySQLdb/cursors.py", line 173, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib64/python2.6/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
ProgrammingError: (1064, "You have an error in your SQL syntax; check the 
manual that corresponds to your MySQL server version for the right syntax to 
use near '06:15:47, 60, 0, 1, 0, 1, 10, 0, 2, 3, 1, 3145716, 0, 607, 700896, 
10566, 0, 1, ' at line 3")
--
-- Re-execute with --verbose --debug for detailed message and stack trace.
--

What is the expected output? What do you see instead?
See error above
What is the output when running with the "--verbose --debug" options?
See error above

What version of the mycheckpoint are you using? rev 231, build 201305231510
What version of the MySQL are you using? (SELECT VERSION()) 5.6.12-log
What version of Python are you using? (python --version) Python 2.6.6
On what operating system? Linux 
What is your sql_mode? (SELECT @@global.sql_mode) NO_ENGINE_SUBSTITUTION

Please provide any additional information below.
If I change the "is_neglectable_variable" routine as follows it works:

def is_neglectable_variable(variable_name):
    if variable_name.startswith("ssl_"):
        return True
    if variable_name.startswith("ndb_"):
        return True
    if variable_name == "last_query_cost":
        return True
    if variable_name == "rpl_status":
        return True
    if variable_name == "slave_last_heartbeat":
        return True
    return False

Original issue reported on code.google.com by clive.le...@gmail.com on 31 Jul 2013 at 11:43

GoogleCodeExporter commented 9 years ago
Thanks for posting a work-around.  It would appear that the date/time needs 
quotes surrounding it to be inserted properly.
Although, the definition for the column is a bigint, rather than date time.

| slave_last_heartbeat                          | bigint(20) unsigned | YES  |  
   | NULL              |                |

I'm OK with just making it "neglectable" for now.

Original comment by a...@amcq.com on 10 Jun 2014 at 10:00