SQL Sintax error after upgrade

Hi,

I’ve upgraded to 2.3.0beta2 from beta1. After the upgrade, I’m getting the following error:

[code:1]FATAL ERROR
SELECT grpnum, description FROM ringgroups ORDER BY CAST(grpnum as UNSIGNED) [nativecode=1064 ** You have an error in your SQL syntax near ‘(grpnum as UNSIGNED)’ at line 1][/code:1]

The error appears on the following pages:

Inbound routes
Outbond routes
Anouncement
Trunks
Time Conditions
Queues
Ring Groups

On trunks the error message is as follows:

[code:1]
* Add Trunk
FATAL ERROR
SELECT t.variable, t.value, d.value state FROM globals t JOIN (SELECT x.variable, x.value FROM globals x WHERE x.variable LIKE ‘OUTDISABLE\%’) d ON substring(t.variable,5) = substring(d.variable,12) WHERE t.variable LIKE 'OUT\%’ UNION ALL SELECT v.variable, v.value, concat(substring(v.value,1,0),‘off’) state FROM globals v WHERE v.variable LIKE ‘OUT\%’ AND concat('OUTDISABLE’,substring(v.variable,5)) NOT IN ( SELECT variable from globals WHERE variable LIKE ‘OUTDISABLE\%’ ) ORDER BY RIGHT( variable, LENGTH( variable ) - 4 )+0 [nativecode=1064 ** You have an error in your SQL syntax near '(SELECT x.variable, x.value FROM globals x WHERE x.variable LIKE 'OUTDISABLE\%’ at line 1]
[/code:1]

I’ve executed the retrieve_conf script, and have one error:

[code:1]
[[email protected] asterisk]# /var/lib/asterisk/bin/retrieve_conf

Checking for PEAR DB…OK
Checking for PEAR Console::Getopt…OK
Checking for /etc/amportal.conf …OK
Bootstrapping /etc/amportal.conf …OK
Parsing /etc/amportal.conf …OK
Parsing /etc/asterisk/asterisk.conf …OK
Connecting to database…OK
Connecting to Asterisk manager interface…OK
[FATAL] SELECT grpnum, description FROM ringgroups ORDER BY CAST(grpnum as UNSIGNED) [nativecode=1064 ** You have an error in your SQL syntax near ‘(grpnum as UNSIGNED)’ at line 1]
[/code:1]

On the main page I’m getting the following error message:

[code:1]
FATAL ERROR
SELECT t.variable, t.value, d.value state FROM globals t JOIN (SELECT x.variable, x.value FROM globals x WHERE x.variable LIKE ‘OUTDISABLE\%’) d ON substring(t.variable,5) = substring(d.variable,12) WHERE t.variable LIKE 'OUT\%’ UNION ALL SELECT v.variable, v.value, concat(substring(v.value,1,0),‘off’) state FROM globals v WHERE v.variable LIKE ‘OUT\%’ AND concat('OUTDISABLE’,substring(v.variable,5)) NOT IN ( SELECT variable from globals WHERE variable LIKE ‘OUTDISABLE\%’ ) ORDER BY RIGHT( variable, LENGTH( variable ) - 4 )+0 [nativecode=1064 ** You have an error in your SQL syntax near '(SELECT x.variable, x.value FROM globals x WHERE x.variable LIKE 'OUTDISABLE\%’ at line 1]
[/code:1]

Please can you help me to fix it?

it sounds like you may be running a MySQL release older than 4.0 which is not supported, is that the case?

You are the man :slight_smile:

[code:1]
mysql --version
mysql Ver 11.18 Distrib 3.23.58, for redhat-linux-gnu (i386)
[/code:1]

My problem is solved. Upgraded both, mysql 3.x and php4 to mysql 4.x and php5.

It was not a easy work, upgrading mysql and php on fedora core 3 is a hell.

php4 is still supported, but if you are on 5 …