ajrockefeller / openfpc

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

cx2db needs ENGINE= corrections #33

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Ubuntu, MySQL Server version: 5.5.24-0ubuntu0.12.04.1 (Ubuntu)
OpenFPC version 0.6-314 from release tarball

There are 2 issues.

First, when openfpc-cx2db creates the per-instance-day session tables, it does 
not specify that the engine for the table should be MyISAM.  At least on my 
system, this is not the default, but since cx2db relies on it for MERGE tables, 
it should be explicit even if it is the default.  Just add "ENGINE=MyISAM" to 
the create SQL in new_session_table.

The second issue seems to be a syntax error (or may be related to the wrong 
engine of the daily tables).  I get an error in /var/log/openfpc-cx2db.log:

[*] Connecting to database...
DBD::mysql::st execute failed: 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=MERGE UNION=( session_Sandbox1_20120926, 
session_Sandbox1_20120927)' at line 26 at /usr/bin/openfpc-cx2db line 573.

According to http://dev.mysql.com/doc/refman/5.5/en/merge-storage-engine.html, 
the syntax for creating a merge table is
create table foo ( ... ) ENGINE=MERGE UNION=( ... )

Making this trivial change to cx2db (line 570, s/TYPE=/ENGINE=/) results in a 
proper session table, and a working session tracker.

I can provide a patch for these 2 changed lines if desired.

Original issue reported on code.google.com by jpvlsmv@gmail.com on 27 Sep 2012 at 1:52

GoogleCodeExporter commented 8 years ago
A patch would be perfect!
Thanks.

Original comment by leon.j.w...@gmail.com on 2 Oct 2012 at 7:48

GoogleCodeExporter commented 8 years ago
Patch here

Original comment by jpvlsmv@gmail.com on 2 Oct 2012 at 6:06

Attachments:

GoogleCodeExporter commented 8 years ago
Patched in r337.

Original comment by leon.j.w...@gmail.com on 3 Oct 2012 at 9:05