thegooglecodearchive / mycheckpoint

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

MariaDB 5.5.31 - "Unknown column 'mysql' in 'field list'" #44

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Just launch mycheckpoint

What is the expected output? What do you see instead?
Expected : "New entry added"
See instead : (1054, "Unknown column 'mysql' in 'field list'")

What is the output when running with the "--verbose --debug" options?
-- Using /etc/mycheckpoint.conf as defaults file
-- mycheckpoint rev 231, build 201305231510. Copyright (c) 2009-2013 by Shlomi 
Noach
-- database is mycheckpoint_test_sd_03
-- monitored host is: 127.0.0.1
-- 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
(1054, "Unknown column 'mysql' in 'field list'")
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/lib/pymodules/python2.6/MySQLdb/cursors.py", line 166, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib/pymodules/python2.6/MySQLdb/connections.py", line 35, in defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1054, "Unknown column 'mysql' in 'field list'")
--
-- Re-execute with --verbose --debug for detailed message and stack trace.
--

What version of the mycheckpoint are you using?
mycheckpoint rev 231, build 201305231510

What version of the MySQL are you using? (SELECT VERSION())
5.5.31-MariaDB-log

What version of Python are you using? (python --version)
Python 2.6.6

On what operating system?
DEBIAN 6.0.7

What is your sql_mode? (SELECT @@global.sql_mode)
Empty

Original issue reported on code.google.com by maxime.f...@gmail.com on 11 Sep 2013 at 12:21

GoogleCodeExporter commented 9 years ago
After some research i found the issue. 

line 4438 : 

variable_values = ", ".join(["%s" % status_dict[column_name] for column_name in 
sorted_list(status_dict.keys())])

You join all values without quotes and some values are strings (ex: 
mysql-bin.000005).

INSERT statement goes wrong in this field and return "Unknown column 'mysql' in 
'field list'".

I added quotes like this : 
variable_values = ", ".join(["'%s'" % status_dict[column_name] for column_name 
in sorted_list(status_dict.keys())])

And it works.

Thanks

Original comment by maxime.f...@gmail.com on 16 Sep 2013 at 8:48

GoogleCodeExporter commented 9 years ago
thank you for your research and fixing ,  maxime ! :D

Original comment by kiiwii.S...@gmail.com on 27 Jun 2014 at 3:21