Page 1 of 1

MySQL error when Pre Event Img Cnt set close to Img Buff Sz

Posted: Tue Nov 09, 2010 6:50 pm
by BlankMan
In Source -> Buffers if I have
Image Buffer Size (frames) set to 200
Pre Event Image Count set to 180
Post Event Image Count set to 180

The following occurs:

Code: Select all

Nov  9 12:38:58 router zma_m12[1804]: INF [IP7330: 741 - Gone into prealarm state]
Nov  9 12:38:58 router zma_m12[1804]: INF [IP7330: 743 - Gone into alarm state]
Nov  9 12:38:58 router zma_m12[1804]: INF [IP7330: 743 - Opening new event 77628, alarm start]
Nov  9 12:39:00 router zma_m12[1804]: ERR [Can't insert frames: 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 '' at line 1]
Nov  9 12:39:00 router zmdc[21931]: ERR ['zma -m 12' exited abnormally, exit status 40]
Nov  9 12:39:00 router zmdc[21931]: INF [Starting pending process, zma -m 12]

Nov  9 12:39:00 router zma_m12[2002]: INF [IP7330: 026 - Gone into prealarm state]
Nov  9 12:39:00 router zma_m12[2002]: INF [IP7330: 028 - Gone into alarm state]
Nov  9 12:39:00 router zma_m12[2002]: INF [IP7330: 028 - Opening new event 77629, alarm start]
Nov  9 12:39:02 router zma_m12[2002]: ERR [Can't insert frames: 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 '' at line 1]
Nov  9 12:39:02 router zmdc[21931]: ERR ['zma -m 12' exited abnormally, exit status 40]
Nov  9 12:39:07 router zmdc[21931]: INF [Starting pending process, zma -m 12]
And the events are logged like this:

Code: Select all

Id      Name            Time                    Secs    Frames         Score
77629   New Event       2010-11-09 12:38:52     0.00    null/null       0/0     X
77628   New Event       2010-11-09 12:38:50     0.00    null/null       0/0     X
If I drop Pre Event Image Count to 120 it seems to work fine. So I'm wondering why?

Posted: Thu Nov 11, 2010 2:43 pm
by Paranoid
The zoneminder code builds the sql statement in a buffer of a fixed size. When you have more than about 120 pre event images the buffer fills up and the remaining part of the sql statement is not added. As a result when it tries to execute the sql you get the "You have an error in your SQL syntax" error message. A code change by the developers is needed to resolve this.

Posted: Thu Nov 11, 2010 4:31 pm
by BlankMan
Thanks, that explains it. 120 is the magic number for now.

Posted: Wed Nov 17, 2010 3:40 pm
by BlankMan
So are the developers actively addressing and correcting this issue?

I've had occasion where the longer pre-buffer was needed.