issue LOG_DATABASE_LIMIT - database.php

Forum for questions and support relating to 1.33.x development only.
Locked
User1Peter
Posts: 3
Joined: Mon Jan 06, 2020 6:43 pm

issue LOG_DATABASE_LIMIT - database.php

Post by User1Peter »

Hello, there is a problem when I use LOG_DATABASE_LIMIT e.g. set to 1000 messages. The word "Rows" reserved for mariadb is used in the select statement. I can't find Select Count (*) AS Rows From Logs in the database.php.

Is there a solution or where can I change the word in the script myself?

I use Zoneminder 1.33.16

Best wishes

2020-01-06 18:06:02 web_php 4137 ERR SQL-ERR 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'Rows FROM Logs' at line 1', statement was 'SELECT Count(*) AS Rows FROM Logs' params: /usr/share/zoneminder/www/includes/database.php 152

2020-01-06 18:06:02 web_php 4137 ERR SQL-ERR dbFetchOne no result, statement was 'SELECT Count(*) AS Rows FROM Logs' /usr/share/zoneminder/www/includes/database.php 161
User avatar
iconnor
Posts: 2901
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: issue LOG_DATABASE_LIMIT - database.php

Post by iconnor »

I've just pushed a potential fix.
User1Peter
Posts: 3
Joined: Mon Jan 06, 2020 6:43 pm

Re: issue LOG_DATABASE_LIMIT - database.php

Post by User1Peter »

do you already have a solution or are you still working on it
I tried a little more because 1 hour shows too many logs. Deleting only starts at around 15,000 entries.
My guess is that the zmaudit.pl program is not working. There you will find the Select Statement. If I start this program manually at the line level, everything works fine if I replace Rows with another word.

The error message at Zoneminder is still there.

I hope this is still helpful when looking for a possible solution.
User avatar
iconnor
Posts: 2901
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: issue LOG_DATABASE_LIMIT - database.php

Post by iconnor »

zmaudit is not required or recommended.

Logs are cleared on each web ui page request.

I have already committed the fix (I think) you will need to update.

If you are still having the problem please post an updated error message.
User1Peter
Posts: 3
Joined: Mon Jan 06, 2020 6:43 pm

Re: issue LOG_DATABASE_LIMIT - database.php

Post by User1Peter »

Thank you for the quick answer and the possible solution.
However, it is not clear to me what exactly I need to update.
Is it the database.php file?
Thanks again for your help.
Locked