SunshineYang / mycheckpoint

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

incorrect handle of not numeric values #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run mysqlcheckpoint against MySQL 5.5.4
2.
3.

What is the expected output? What do you see instead?

Output received:
mycheckpoint --verbose --skip-check-replication
-- Using /etc/mycheckpoint.cnf as defaults file
-- mycheckpoint rev 170, build 201007152036. Copyright (c) 2009-2010 by Shlomi 
Noach
-- database is mycheckpoint
-- Global status & variables 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 'auto' in 'field list'")
--
-- Make sure you have executed mycheckpoint with 'deploy' after last 
install/update.upgrade
--  If not, run again with same configuration, and add 'deploy'. e.g.:
--  mycheckpoint --host=my_host deploy
--

What is the output when running with the "--verbose --debug" options?

What version of the mycheckpoint are you using?

rev 170, build 201007152036

What version of the MySQL are you using? (SELECT VERSION())

5.5.4-m3-log

On what operating system?

Linux - Debian

Please provide any additional information below.

mysql> SHOW GLOBAL VARIABLES LIKE 'concurrent_insert';
+-------------------+-------+
| Variable_name     | Value |
+-------------------+-------+
| concurrent_insert | AUTO  |
+-------------------+-------+
1 row in set (0.00 sec)

In MySQL 5.0 and 5.1 concurrent_insert accepts value 0, 1 or 2.
In MySQL 5.5 also the values NEVER and AUTO are valid.

The insert on mycheckpoint.status_variables looks like :
INSERT INTO status_variables (......) VALUES ( .... , auto , .....)
Resulting in an error.

Fix:

 diff mycheckpoint mycheckpoint.orig 
4078c4078
<     variable_values = ", ".join(["'%s'" % status_dict[column_name] for 
column_name in sorted_list(status_dict.keys())])

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

Original issue reported on code.google.com by rene.can...@gmail.com on 19 Jul 2010 at 6:00

GoogleCodeExporter commented 9 years ago
Thank you for the bug report as well as for the suggested fix.
Your fix will not work properly: while syntactically it will be correct, 
semantically it will insert 0 values for named values as AUTO, NEVER, ALWAYS.
Instead, I will add these values to the normalize_variable_value() function, 
which already handles similar cases.

You can read my opinion on the subject 
[http://code.openark.org/blog/mysql/variables-ambiguities-in-names-and-values 
here] and [http://code.openark.org/blog/mysql/more-on-variables-ambiguities 
here].

Original comment by shlomi.n...@gmail.com on 20 Jul 2010 at 12:48

GoogleCodeExporter commented 9 years ago
While at it, I've filed http://bugs.mysql.com/bug.php?id=55396

Original comment by shlomi.n...@gmail.com on 20 Jul 2010 at 12:52

GoogleCodeExporter commented 9 years ago
Fixed in r171 (not yet released).
Tested with 5.5.5-m3

mysql [localhost] {msandbox} ((none)) > select version();
+-----------+
| version() |
+-----------+
| 5.5.5-m3  |
+-----------+

Original comment by shlomi.n...@gmail.com on 20 Jul 2010 at 1:46