[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cacti, mysql-5.5 and squeeze-lts



Hi Paul,

El 30/11/15 a las 19:56, Paul Gevers escribió:
> Hi Santiago
> [Dropping Mahyuddin from CC as promised]
> 
> On 30-11-15 10:11, Santiago Ruano Rincón wrote:
> > Well, I have installed cacti from the attached debdiff and available at
> > my personal repo [1].
> 
> I think there are some spurious changes that you included this way. I.e.
> adding new fields to the database, that isn't needed (and shouldn't be
> added because it may impact future upgrades to newer cacti versions) for
> this lts fix.
> 

Oups. New version attached. Thanks for reviewing.

> > I have used both mysql-5.1 and mysql-5.5 and it
> > seems to work well.
> 
> So you confirm that the new ENGINE syntax is already supported in mysql-5.1?
> 

Yes. Confirmed by MySQL documentation:

https://dev.mysql.com/doc/refman/5.1/en/create-table.html

Even in 5.0: "The older term TYPE is supported as a synonym for ENGINE
for backward compatibility, but ENGINE is the preferred term and TYPE is
deprecated."
https://dev.mysql.com/doc/refman/5.0/en/storage-engines.html

> > I have also tested upgrading from 5.1 to 5.5, but
> > AFAIU, the error is related to table creation.
> 
> Is that with the old cacti, or with your patched cacti? Could you share
> the error here?

I was talking about the original error, with the old cacti:

"ERROR 1064 (42000) at line  5: 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 'TYPE=MyISAM' at line 6"

> 
> > Is there any reason why cacti needs the MyISAM engine? I suppose that if
> > you don't declare it, mysql will use the default engine.
> 
> The honest answer is, I don't know. I can't oversee the implications of
> not setting it and using the default, whatever that is. One thing I
> could come up with is that some engines support transactions and others
> don't. Not sure which one is which and if cacti needs them. The other
> packages that you need to update may use transactions, so they can't
> rely on the default being correct I guess, and for sure some used an
> other engine than MyISAM.

So, without further research, I wouldn't omit the engine declaration.
The current issue is trivial and I think we can upload.

Cheers,

Santiago


diff -u cacti-0.8.7g/debian/changelog cacti-0.8.7g/debian/changelog
--- cacti-0.8.7g/debian/changelog
+++ cacti-0.8.7g/debian/changelog
@@ -1,3 +1,13 @@
+cacti (0.8.7g-1+squeeze9~2) santiago-squeeze-lts; urgency=high
+
+  * Non-maintainer upload by the Squeeze LTS Team.
+  * Making cacti compatible against MySQL 5.5:
+    - cacti.sql: Declare db ENGINE=MyISAM instead of TYPE=MyISAM when creating
+      tables. Patch from git commit 50acad369b765e77ff4c5fd9f9deb14e909ce21f in
+      pkg-cacti/cacti.
+
+ -- Santiago Ruano Rincón <santiagorr@riseup.net>  Mon, 30 Nov 2015 21:19:03 +0100
+
 cacti (0.8.7g-1+squeeze8) squeeze-lts; urgency=high
 
   * Regression update
diff -u cacti-0.8.7g/debian/patches/series cacti-0.8.7g/debian/patches/series
--- cacti-0.8.7g/debian/patches/series
+++ cacti-0.8.7g/debian/patches/series
@@ -27,0 +28 @@
+cacti-compatibility-mysql-5.5.patch
only in patch2:
unchanged:
--- cacti-0.8.7g.orig/debian/patches/cacti-compatibility-mysql-5.5.patch
+++ cacti-0.8.7g/debian/patches/cacti-compatibility-mysql-5.5.patch
@@ -0,0 +1,439 @@
+Description: Use ENGINE instead of the obsolote TYPE to declare db engine.
+Origin: debian, http://anonscm.debian.org/cgit/pkg-cacti/cacti.git/patch/cacti.sql?id=50acad369b765e77ff4c5fd9f9deb14e909ce21f
+Author: Mahyuddin Susanto <udienz@ubuntu.com>
+Reviewed-by: Santiago R.R. <santiagorr@riseup.net>
+
+--- a/cacti.sql
++++ b/cacti.sql
+@@ -7,7 +7,7 @@
+   hash varchar(32) NOT NULL default '',
+   name varchar(255) NOT NULL default '',
+   PRIMARY KEY  (id)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `cdef`
+@@ -33,7 +33,7 @@
+   value varchar(150) NOT NULL default '',
+   PRIMARY KEY  (id),
+   KEY cdef_id (cdef_id)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `cdef_items`
+@@ -64,7 +64,7 @@
+   id mediumint(8) unsigned NOT NULL auto_increment,
+   hex varchar(6) NOT NULL default '',
+   PRIMARY KEY  (id)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `colors`
+@@ -184,7 +184,7 @@
+   type_id tinyint(2) NOT NULL default '0',
+   PRIMARY KEY (id),
+   KEY name (name)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `data_input`
+@@ -214,7 +214,7 @@
+   value text,
+   PRIMARY KEY (data_input_field_id,data_template_data_id),
+   KEY t_value (t_value)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `data_input_data`
+@@ -418,7 +418,7 @@
+   PRIMARY KEY  (id),
+   KEY data_input_id (data_input_id),
+   KEY type_code (type_code)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `data_input_fields`
+@@ -482,7 +482,7 @@
+   snmp_query_id mediumint(8) NOT NULL default '0',
+   snmp_index varchar(255) NOT NULL default '',
+   PRIMARY KEY  (id)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `data_local`
+@@ -503,7 +503,7 @@
+   hash varchar(32) NOT NULL default '',
+   name varchar(150) NOT NULL default '',
+   PRIMARY KEY  (id)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `data_template`
+@@ -573,7 +573,7 @@
+   PRIMARY KEY  (id),
+   KEY local_data_id (local_data_id),
+   KEY data_template_id (data_template_id)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `data_template_data`
+@@ -635,7 +635,7 @@
+   rra_id mediumint(8) unsigned NOT NULL default '0',
+   PRIMARY KEY  (data_template_data_id,rra_id),
+   KEY data_template_data_id (data_template_data_id)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `data_template_data_rra`
+@@ -852,7 +852,7 @@
+   KEY local_data_id (local_data_id),
+   KEY data_template_id (data_template_id),
+   KEY local_data_template_rrd_id (local_data_template_rrd_id)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `data_template_rrd`
+@@ -936,7 +936,7 @@
+   KEY graph_template_id (graph_template_id),
+   KEY snmp_query_id (snmp_query_id),
+   KEY snmp_index (snmp_index)
+-) TYPE=MyISAM COMMENT='Creates a relationship for each item in a custom graph.';
++) ENGINE=MyISAM COMMENT='Creates a relationship for each item in a custom graph.';
+ 
+ --
+ -- Dumping data for table `graph_local`
+@@ -959,7 +959,7 @@
+   description text,
+   column_name varchar(50) NOT NULL default '',
+   PRIMARY KEY  (id)
+-) TYPE=MyISAM COMMENT='Stores the names for graph item input groups.';
++) ENGINE=MyISAM COMMENT='Stores the names for graph item input groups.';
+ 
+ --
+ -- Dumping data for table `graph_template_input`
+@@ -1052,7 +1052,7 @@
+   graph_template_item_id int(12) unsigned NOT NULL default '0',
+   PRIMARY KEY  (graph_template_input_id,graph_template_item_id),
+   KEY graph_template_input_id (graph_template_input_id)
+-) TYPE=MyISAM COMMENT='Stores the relationship for what graph iitems are associated';
++) ENGINE=MyISAM COMMENT='Stores the relationship for what graph iitems are associated';
+ 
+ --
+ -- Dumping data for table `graph_template_input_defs`
+@@ -1326,7 +1326,7 @@
+   name char(255) NOT NULL default '',
+   PRIMARY KEY  (id),
+   KEY name (name)
+-) TYPE=MyISAM COMMENT='Contains each graph template name.';
++) ENGINE=MyISAM COMMENT='Contains each graph template name.';
+ 
+ --
+ -- Dumping data for table `graph_templates`
+@@ -1376,7 +1376,7 @@
+   name varchar(100) NOT NULL default '',
+   gprint_text varchar(255) default NULL,
+   PRIMARY KEY  (id)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `graph_templates_gprint`
+@@ -1438,7 +1438,7 @@
+   KEY local_graph_id (local_graph_id),
+   KEY graph_template_id (graph_template_id),
+   KEY title_cache (title_cache)
+-) TYPE=MyISAM COMMENT='Stores the actual graph data.';
++) ENGINE=MyISAM COMMENT='Stores the actual graph data.';
+ 
+ --
+ -- Dumping data for table `graph_templates_graph`
+@@ -1507,7 +1507,7 @@
+   KEY graph_template_id (graph_template_id),
+   KEY local_graph_id (local_graph_id),
+   KEY task_item_id (task_item_id)
+-) TYPE=MyISAM COMMENT='Stores the actual graph item data.';
++) ENGINE=MyISAM COMMENT='Stores the actual graph item data.';
+ 
+ --
+ -- Dumping data for table `graph_templates_item`
+@@ -1803,7 +1803,7 @@
+   sort_type tinyint(3) unsigned NOT NULL default '1',
+   name varchar(255) NOT NULL default '',
+   PRIMARY KEY  (id)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `graph_tree`
+@@ -1830,7 +1830,7 @@
+   KEY host_id (host_id),
+   KEY local_graph_id (local_graph_id),
+   KEY order_key (order_key)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `graph_tree_items`
+@@ -1879,7 +1879,7 @@
+   availability decimal(8,5) NOT NULL default '100.00000',
+   PRIMARY KEY  (id),
+   KEY disabled (disabled)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `host`
+@@ -1895,7 +1895,7 @@
+   host_id mediumint(8) unsigned NOT NULL default '0',
+   graph_template_id mediumint(8) unsigned NOT NULL default '0',
+   PRIMARY KEY  (host_id,graph_template_id)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `host_graph`
+@@ -1923,7 +1923,7 @@
+   KEY field_name (field_name),
+   KEY field_value (field_value),
+   KEY snmp_query_id (snmp_query_id)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `host_snmp_cache`
+@@ -1942,7 +1942,7 @@
+   reindex_method tinyint(3) unsigned NOT NULL default '0',
+   PRIMARY KEY  (host_id,snmp_query_id),
+   KEY host_id (host_id)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `host_snmp_query`
+@@ -1959,7 +1959,7 @@
+   hash varchar(32) NOT NULL default '',
+   name varchar(100) NOT NULL default '',
+   PRIMARY KEY  (id)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `host_template`
+@@ -1982,7 +1982,7 @@
+   graph_template_id mediumint(8) unsigned NOT NULL default '0',
+   PRIMARY KEY  (host_template_id,graph_template_id),
+   KEY host_template_id (host_template_id)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `host_template_graph`
+@@ -2012,7 +2012,7 @@
+   snmp_query_id mediumint(8) unsigned NOT NULL default '0',
+   PRIMARY KEY  (host_template_id,snmp_query_id),
+   KEY host_template_id (host_template_id)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `host_template_snmp_query`
+@@ -2042,7 +2042,7 @@
+   ip_address int(11) unsigned NOT NULL default '0',
+   last_update datetime NOT NULL default '0000-00-00 00:00:00',
+   PRIMARY KEY  (id)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `poller`
+@@ -2059,7 +2059,7 @@
+   action tinyint(3) unsigned NOT NULL default '0',
+   command varchar(200) NOT NULL default '',
+   PRIMARY KEY  (poller_id,action,command)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `poller_command`
+@@ -2099,7 +2099,7 @@
+   KEY host_id (host_id),
+   KEY rrd_next_step (rrd_next_step),
+   KEY action (action)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `poller_item`
+@@ -2116,7 +2116,7 @@
+   time datetime NOT NULL default '0000-00-00 00:00:00',
+   output text NOT NULL,
+   PRIMARY KEY  (local_data_id,rrd_name,time)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `poller_output`
+@@ -2135,7 +2135,7 @@
+   assert_value varchar(100) NOT NULL default '',
+   arg1 varchar(255) NOT NULL default '',
+   PRIMARY KEY  (host_id,data_query_id,arg1)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `poller_reindex`
+@@ -2153,7 +2153,7 @@
+   start_time datetime NOT NULL default '0000-00-00 00:00:00',
+   end_time datetime NOT NULL default '0000-00-00 00:00:00',
+   PRIMARY KEY  (id)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `poller_time`
+@@ -2173,7 +2173,7 @@
+   rows int(12) NOT NULL default '600',
+   timespan int(12) unsigned NOT NULL default '0',
+   PRIMARY KEY  (id)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `rra`
+@@ -2194,7 +2194,7 @@
+   consolidation_function_id smallint(5) unsigned NOT NULL default '0',
+   PRIMARY KEY  (rra_id,consolidation_function_id),
+   KEY rra_id (rra_id)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `rra_cf`
+@@ -2219,7 +2219,7 @@
+   name varchar(50) NOT NULL default '',
+   value varchar(255) NOT NULL default '',
+   PRIMARY KEY  (name)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `settings`
+@@ -2235,7 +2235,7 @@
+   name varchar(50) NOT NULL default '',
+   value varchar(255) NOT NULL default '',
+   PRIMARY KEY  (user_id,name)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `settings_graphs`
+@@ -2251,7 +2251,7 @@
+   graph_tree_item_id mediumint(8) unsigned NOT NULL default '0',
+   status tinyint(1) NOT NULL default '0',
+   PRIMARY KEY  (user_id,graph_tree_item_id)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `settings_tree`
+@@ -2272,7 +2272,7 @@
+   data_input_id mediumint(8) unsigned NOT NULL default '0',
+   PRIMARY KEY  (id),
+   KEY name (name)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `snmp_query`
+@@ -2298,7 +2298,7 @@
+   name varchar(100) NOT NULL default '',
+   graph_template_id mediumint(8) unsigned NOT NULL default '0',
+   PRIMARY KEY  (id)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `snmp_query_graph`
+@@ -2336,7 +2336,7 @@
+   PRIMARY KEY  (snmp_query_graph_id,data_template_id,data_template_rrd_id),
+   KEY data_template_rrd_id (data_template_rrd_id),
+   KEY snmp_query_graph_id (snmp_query_graph_id)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `snmp_query_graph_rrd`
+@@ -2397,7 +2397,7 @@
+   PRIMARY KEY  (id),
+   KEY snmp_query_graph_id (snmp_query_graph_id),
+   KEY data_template_id (data_template_id)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `snmp_query_graph_rrd_sv`
+@@ -2476,7 +2476,7 @@
+   text varchar(255) NOT NULL default '',
+   PRIMARY KEY  (id),
+   KEY snmp_query_graph_id (snmp_query_graph_id)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `snmp_query_graph_sv`
+@@ -2548,7 +2548,7 @@
+   KEY username (username),
+   KEY realm (realm),
+   KEY enabled (enabled)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `user_auth`
+@@ -2567,7 +2567,7 @@
+   type tinyint(2) unsigned NOT NULL default '0',
+   PRIMARY KEY  (user_id,item_id,type),
+   KEY user_id (user_id,type)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `user_auth_perms`
+@@ -2583,7 +2583,7 @@
+   user_id mediumint(8) unsigned NOT NULL default '0',
+   PRIMARY KEY  (realm_id,user_id),
+   KEY user_id (user_id)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `user_auth_realm`
+@@ -2619,7 +2619,7 @@
+   ip varchar(40) NOT NULL default '',
+   PRIMARY KEY  (username,user_id,time),
+   KEY username (username)
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `user_log`
+@@ -2632,7 +2632,7 @@
+ 
+ CREATE TABLE version (
+   cacti char(20) default NULL
+-) TYPE=MyISAM;
++) ENGINE=MyISAM;
+ 
+ --
+ -- Dumping data for table `version`

Attachment: signature.asc
Description: Digital signature


Reply to: