On 18 January 2014 14:15, Luigino Bracci <[email protected]> wrote:

> Hi guys,
>
> Testing the new Rivendell 2.7.0 I've tried to generate a log from
> RdLogManager. I'm using the template name "Production-%m%d" (it's the name
> assigned by rdsvc.cpp, line 1097), but the generated log is empty.
> RDLogMnager generated many errors in console:
> ____________________
> Invalid SQL or  failed DB connection[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 '-0120_LOG set ID=0,COUNT=0,TYPE=0,
> SOURCE=2,START_TIME=75600000,GRACE_TIM' at line 1 QMYSQL3: Unable to
> execute query]: insert into Production-0120_LOG set ID=0,COUNT=0,TYPE=0,
>   SOURCE=2,START_TIME=75600000,GRACE_TIME=0,
> CART_NUMBER=10005,TIME_TYPE=0,POST_POINT="N",
> TRANS_TYPE=0,EXT_START_TIME="21:00:00",
> EVENT_LENGTH=900000
> Database connection failed: insert into Production-0120_LOG set
> ID=0,COUNT=0,TYPE=0,     SOURCE=2,START_TIME=75600000,GRACE_TIME=0,
> CART_NUMBER=10005,TIME_TYPE=0,POST_POINT="N",
> TRANS_TYPE=0,EXT_START_TIME="21:00:00",
> EVENT_LENGTH=900000
> Database connection restored.
> _____________________
>
> Apparently the problem is in rdevent_line.cpp,
> in RDEventLine::generateLog(), lines 793 and 817: It is needed to use
> backquotes surrounding the name of the table, so using a dash in the name
> of the template (and the SQL table) doesn't break the log generation.
>
>       sql=QString().sprintf("insert into `%s_LOG` set
> ID=%d,COUNT=%d,TYPE=%d,\
>
>       sql=QString().sprintf("insert into `%s_STACK` set (...)
>
> Once I placed this, I have no more errors and the log was generated as
> expected.
>
> The other problem is with the clocks. I've created a new clock called
> "Torta", code "CO", then I pressed "Edit grid" in RDLogManager and then
> pressed "Change All" to assign the clock "Torta" to all the buttons in the
> grid.
>
> When I close the edit grid window and I open it again, buttons from monday
> to thursday (11-12) are updated with the clock "Torta", but the others
> aren't.
>
> In the console, RDLogManager showed these errors after using the "Change
> All" button:
> _________________________
>
> Invalid SQL or  failed DB connection[Row size too large (> 8126). Changing
> some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or
> ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768
> bytes is stored inline. QMYSQL3: Unable to execute query]: update SERVICES
> set CLOCK84="Torta" where NAME="Production"
>
> Database connection failed: update SERVICES set CLOCK84="Torta" where
> NAME="Production"
> Database connection restored.
> ________________________
>
> (This error repeats with each CLOCKnnn field from CLOCK84 to CLOCK167)
>
> I'm using the DB structure from a recently installed Rivendell with no
> modifications, using Mysql 5.5.34 in Ubuntu Studio 12.04. The table engine
> is InnoDB.
>
> Apparently the problem is that a row in a InnoDB table can't exceed 8126
> characters, but there are 168 CLOCK fields in every row in the SERVICES
> table, each one is CHAR(64) (168 * 64 = 10752 characters). I don't
> understand why this problem hasn't occurred before, maybe it's something
> new in Mysql or maybe I'm doing something wrong. But this is my first time
> using the "Changel all" button.
>
> Googling this problem, some people suggests to create the table with the
> parameters ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED, or use the new
> format "Barracude" available from Mysql-server 5.5.29 (see
> http://stackoverflow.com/questions/15585602/change-limit-for-mysql-row-size-too-large
> ).
>
> Another idea could be to shorten the clock's NAME field from CHAR(64) to
> CHAR(32), or maybe using the clock's SHORT_NAME (it's a CHAR(8)) as primary
> index, and not the clock's NAME.
>
> Bye, and sorry for my bad english.
>

I think it was a long-known, but unresolved issue that log names containing
dashes (-) would fail generating. I worked around this issue by using
underscores (_) instead. It is great that you tracked at least part of the
problem to these lines of code. Unfortunately, many such cases exist in the
Rivendell codebase, and in my opinion most of the SQL part would benefit
greatly from a overhaul (which is very hard work in itself).

I think that the only supported database engine for Rivendell is MyISAM,
which is the engine that Rivendell should have used when creating your
databases.

-- 
Sébastien Leblanc
_______________________________________________
Rivendell-dev mailing list
[email protected]
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev

Reply via email to