SQL Error when defining zone in 1.26.4 (Bug report)

Forum for questions and support relating to the 1.26.x releases only.
Locked
Nukem36
Posts: 9
Joined: Fri Feb 12, 2010 5:49 pm

SQL Error when defining zone in 1.26.4 (Bug report)

Post by Nukem36 »

Hi !

recently I updateted an older Zoneminder installation to the newest version 1.26.4 (base: opensuse 13.1) and had immense problems to let it do the job as it was before. The problem was the zone definition.... The default definition does no motion detect at all. In the log I saw start/stop capturing messages, but no events have been recorded. So I tried to define a zone (door of a pub) but got all the time SQL-errors. I took a default (best,high sensivity), moved the corners to the right places and tried to store the setting, resulting in the following SQL-error:

Code: Select all

SQL-ERR 'Incorrect integer value: '' for column 'MaxPixelThreshold' at row 1', statement was 'insert into Zones set MonitorId = '3', NumCoords = '4', Coords = '0,0 767,0 767,575 0,575', Area = '442368', AlarmRGB = '16711680', Name = 'Neu', Type = 'Active', Units = 'Percent', CheckMethod = 'Blobs', MinPixelThreshold = '20', MaxPixelThreshold = '', FilterX = '3', FilterY = '3', MinAlarmPixels = '35389', MaxAlarmPixels = '0', MinFilterPixels = '26542', MaxFilterPixels = '0', MinBlobPixels = '22118', MaxBlobPixels = '0', MinBlobs = '1', MaxBlobs = '', OverloadFrames = '0''
I found out that the problem are the databasefields MaxBlobs and MaxPixelThreshold, that may not be empty, as it is to see in the given SQL statement. As I could read from documentation, it should be '0'. I changed it manually and entered the statement via mysql- interface like:

Code: Select all

insert into Zones set MonitorId = '3', NumCoords = '4', Coords = '0,0 767,0 767,575 0,575', Area = '442368', AlarmRGB = '16711680', Name = 'Neu', Type = 'Active', Units = 'Percent', CheckMethod = 'Blobs', MinPixelThreshold = '20', MaxPixelThreshold = '[b]0[/b]', FilterX = '3', FilterY = '3', MinAlarmPixels = '35389', MaxAlarmPixels = '0', MinFilterPixels = '26542', MaxFilterPixels = '0', MinBlobPixels = '22118', MaxBlobPixels = '0', MinBlobs = '1', MaxBlobs = '[b]0[/b]', OverloadFrames = '0'
Now events are recorded.

Please correct this bug in sourcecode for all defaults (I checked all, they result in the same SQL-error).

Thank's

Nukem36
px03afk
Posts: 77
Joined: Wed Nov 30, 2011 4:53 pm

Re: SQL Error when defining zone in 1.26.4 (Bug report)

Post by px03afk »

I just had the same problem and discovered that the cause was because MySql had strict mode turned on. If you get rid of strict mode then the problem goes away. Obviously, in the longer term it would be preferable that ZM code didn't need this but in the short term this is a way out.

Look in your my.cnf file, probably in /etc, and get rid of STRICT_TRANS_TABLES. If the only other entry on the line is NO_ENGINE_SUBSTITUTION you should be able to comment the whole line out (you maybe even need to get rid of the other one as well - I simply commented the line out so not sue if leaving the NO_... would also cause a problem with ZM). Don't forget to restart mysql.
Locked