mysql error on 2 queries need some input.

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

mysql error on 2 queries need some input.

Postby callcrazy » Thu Oct 11, 2012 4:36 pm

In vdc_db_query.php on our production version and I've also checked the latest downloadable version I see 2 instances of the same query.

Code: Select all
$stmt="UPDATE vicidial_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\"
order by uniqueid desc limit 1;";


This is found around line #'s 4934 & 5040.

I'm not sure how often this query executes or why exactly it's being executed but I notice in the vicidial_mysql_errors.txt file errors as follows:

Code: Select all
vicidial_mysql_errors.txt:54245:2012-10-10 18:42:35|vdc_db_query|00145|1242|Subquery returns more than 1 row|UPDATE vicidial_log set status='XX' where lead_id='1219179' and user='xxxxxx' and call_date > "2012-10-10 14:42:35" order by uniqueid desc limit 1;|xxxxxx|10.0.0.100|1349905235_226default15195830|


Most likely not an issue for vicidial, however, we've recently implemented replication and this error is giving us a mismatch between master and slave.

Is this query needed as is?
How would I prevent it from returning Subquery returns more than 1 row errors?
Why does it have "call_date > 4 hours ago?" when also using a limit 1.

Thanks,

CallCrazy
Vicibox 6.0.4 from .iso | VERSION: 2.12-538a BUILD: 160122-1401 | Asterisk 1.8.32.3-vici | 1xDB, 2xWeb, 7xPBX | Amfeltec Timers | Sangoma/Lyra AMD | Dell Hardware
callcrazy
 
Posts: 122
Joined: Fri Sep 10, 2010 11:30 am
Location: MI

Re: mysql error on 2 queries need some input.

Postby callcrazy » Mon Oct 15, 2012 9:28 am

Subquery returns more than 1 row. But there isn't a subquery being referenced. This was caused by a trigger that added data to another table that also had a trigger and the second trigger did contain a subquery. Subquery modified and issue resolved.
Vicibox 6.0.4 from .iso | VERSION: 2.12-538a BUILD: 160122-1401 | Asterisk 1.8.32.3-vici | 1xDB, 2xWeb, 7xPBX | Amfeltec Timers | Sangoma/Lyra AMD | Dell Hardware
callcrazy
 
Posts: 122
Joined: Fri Sep 10, 2010 11:30 am
Location: MI

Re: mysql error on 2 queries need some input.

Postby williamconley » Mon Oct 15, 2012 7:57 pm

callcrazy wrote:Subquery returns more than 1 row. But there isn't a subquery being referenced. This was caused by a trigger that added data to another table that also had a trigger and the second trigger did contain a subquery. Subquery modified and issue resolved.

Wow. You have a deep system. I do not envy you when you try to upgrade to a later version. LOL

Excellent postback, though. 8-)
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)


Return to Support

Who is online

Users browsing this forum: No registered users and 151 guests