Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Fri Apr 19, 2024 12:54 pm
Voice Broadcast System


All times are UTC




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Error on a2billing 1.4 database
PostPosted: Tue Mar 31, 2009 4:49 pm 
Offline

Joined: Thu Mar 06, 2008 2:59 pm
Posts: 8
I got following error when i tried to insert into my mysql database

--
-- Triggers `cc_card`
--
DROP TRIGGER `a2b_14_import`.`cc_card_serial_set` ;


MySQL said:
#1360 - Trigger does not exist


Top
 Profile  
 
 Post subject: Re: Error on a2billing 1.4 database
PostPosted: Tue Mar 31, 2009 6:33 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
arafat wrote:
I got following error when i tried to insert into my mysql database

--
-- Triggers `cc_card`
--
DROP TRIGGER `a2b_14_import`.`cc_card_serial_set` ;


MySQL said:
#1360 - Trigger does not exist
This is fixed in the latest trunk. To fix your own schema simply add 'IF EXISTS' to all the 'DROP TRIGGER' statements.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 31, 2009 8:16 pm 
Offline

Joined: Thu Mar 06, 2008 2:59 pm
Posts: 8
Thanx for ur previous reply. Now I got following Error


Error
There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem

ERROR: Unknown Punctuation String @ 12
STR: //
SQL:
DELIMITER //
CREATE TRIGGER `a2b_14_import`.`cc_card_serial_set` BEFORE INSERT ON `a2b_14_import`.`cc_card`
FOR EACH ROW BEGIN
UPDATE cc_card_seria set value=value+1 where id=NEW.id_seria ;


SQL query:

DELIMITER // CREATE TRIGGER `a2b_14_import`.`cc_card_serial_set` BEFORE INSERT ON `a2b_14_import`.`cc_card` FOR EACH ROW BEGIN UPDATE cc_card_seria set value=value+1 where id=NEW.id_seria ;

MySQL said:

#1064 - 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 'DELIMITER //
CREATE TRIGGER `a2b_14_import`.`cc_card_serial_set` BEFORE INSERT ' at line 1


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 31, 2009 8:25 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
I have very little experience of MySQL, so I'm out of my depth here, but I would venture a guess that you're running MySQL 3 or 4, whereas you need at least version 5 to use A2B v1.3.4 and later.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 31, 2009 9:13 pm 
Offline

Joined: Thu Mar 06, 2008 2:59 pm
Posts: 8
Thanx for ur reply. i am using mysql 5.0.32. after some googling i found that mysql have sum bug on DELIMITER syntex. Maybe i have to update my mysql version.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 04, 2009 10:07 pm 
Offline
User avatar

Joined: Tue Dec 04, 2007 12:05 am
Posts: 295
arafat wrote:
Thanx for ur reply. i am using mysql 5.0.32. after some googling i found that mysql have sum bug on DELIMITER syntex. Maybe i have to update my mysql version.


I not think-- I have also mysql errors
and is not a question of Versions is a question of mysql struture
I am waiting any help


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 04, 2009 10:46 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
gineta wrote:
is a question of mysql struture
Not since r1820 it's not. As others have already confirmed in other threads, upgrading to the latest stable MySQL 5.0.x release fixes any remaining problems.


Top
 Profile  
 
 Post subject: mysql
PostPosted: Sun Apr 05, 2009 2:17 pm 
Offline

Joined: Tue Mar 13, 2007 7:16 am
Posts: 79
I have the same problem

ERROR: Unknown Punctuation String @ 12
STR: //
SQL:
DELIMITER //
CREATE TRIGGER `a2b_14_import`.`cc_card_serial_set` BEFORE INSERT ON `a2b_14_import`.`cc_card`
FOR EACH ROW BEGIN
UPDATE cc_card_seria set value=value+1 where id=NEW.id_seria ;
SELECT value INTO @serial from cc_card_seria where id=NEW.id_seria ;
SET NEW.serial=@serial;
END

I am using the latest mysql version


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 05, 2009 5:12 pm 
Offline
User avatar

Joined: Mon Apr 30, 2007 6:43 am
Posts: 1060
Location: Canada
The install-db.sh script worked flawlessly for me on Gentoo using Mysql 5.0.70-r1

This is a MySQL bug and can been fixed by simply upgrading.

If you don't want to do so, then remove the sections that are using the delimiter and run them manual. The MySQL bug only appear when you source a file and not when you run write queries in the mysql client.

Another possibility is to avoid using the delimiter by using the \g delimiter which can normally be used in mysql as an alternative to the usual semicolon `;ยด.

So find the following ...

Code:
DELIMITER //
CREATE TRIGGER `cc_ratecard_validate_regex_ins` BEFORE INSERT ON `cc_ratecard`
FOR EACH ROW BEGIN
  DECLARE valid INTEGER;
  SELECT '0' REGEXP REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(CONCAT('^', NEW.dialprefix, '$'), 'X', '[0-9]'), 'Z', '[1-9]'), 'N', '[2-9]'), '.', '+'), '_', '') INTO valid;
END
//
DELIMITER ;
DROP TRIGGER IF EXISTS `cc_ratecard_validate_regex_upd`;
DELIMITER //
CREATE TRIGGER `cc_ratecard_validate_regex_upd` BEFORE UPDATE ON `cc_ratecard`
FOR EACH ROW BEGIN
  DECLARE valid INTEGER;
  SELECT '0' REGEXP REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(CONCAT('^', NEW.dialprefix, '$'), 'X', '[0-9]'), 'Z', '[1-9]'), 'N', '[2-9]'), '.', '+'), '_', '') INTO valid;
END
//
DELIMITER ;


... and replace it with ...

Code:
CREATE TRIGGER `cc_ratecard_validate_regex_ins` BEFORE INSERT ON `cc_ratecard`
FOR EACH ROW BEGIN
  DECLARE valid INTEGER\g
  SELECT '0' REGEXP REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(CONCAT('^', NEW.dialprefix, '$'), 'X', '[0-9]'), 'Z', '[1-9]'), 'N', '[2-9]'), '.', '+'), '_', '') INTO valid\g
END;

DROP TRIGGER IF EXISTS `cc_ratecard_validate_regex_upd`;

CREATE TRIGGER `cc_ratecard_validate_regex_upd` BEFORE UPDATE ON `cc_ratecard`
FOR EACH ROW BEGIN
  DECLARE valid INTEGER\g
  SELECT '0' REGEXP REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(CONCAT('^', NEW.dialprefix, '$'), 'X', '[0-9]'), 'Z', '[1-9]'), 'N', '[2-9]'), '.', '+'), '_', '') INTO valid\g
END;



Than, find this ...

Code:
DELIMITER //
CREATE TRIGGER `cc_card_serial_set` BEFORE INSERT ON `cc_card`
FOR EACH ROW BEGIN
        UPDATE cc_card_seria set value=value+1  where id=NEW.id_seria ;
        SELECT value INTO @serial from cc_card_seria where id=NEW.id_seria ;
        SET NEW.serial=@serial;
END
//
DELIMITER ;
DROP TRIGGER IF EXISTS `cc_card_serial_update`;
DELIMITER //
CREATE TRIGGER `cc_card_serial_update` BEFORE UPDATE ON `cc_card`
FOR EACH ROW BEGIN
        IF NEW.id_seria<>OLD.id_seria OR OLD.id_seria IS NULL THEN
                UPDATE cc_card_seria set value=value+1  where id=NEW.id_seria ;
                SELECT value INTO @serial from cc_card_seria where id=NEW.id_seria ;
                SET NEW.serial=@serial;
        END IF;
END
//
DELIMITER ;


And replace it with that ...

Code:
CREATE TRIGGER `cc_card_serial_set` BEFORE INSERT ON `cc_card`
FOR EACH ROW BEGIN
        UPDATE cc_card_seria set value=value+1  where id=NEW.id_seria \g
        SELECT value INTO @serial from cc_card_seria where id=NEW.id_seria \g
        SET NEW.serial=@serial\g
END;

DROP TRIGGER IF EXISTS `cc_card_serial_update`;

CREATE TRIGGER `cc_card_serial_update` BEFORE UPDATE ON `cc_card`
FOR EACH ROW BEGIN
        IF NEW.id_seria<>OLD.id_seria OR OLD.id_seria IS NULL THEN
                UPDATE cc_card_seria set value=value+1  where id=NEW.id_seria \g
                SELECT value INTO @serial from cc_card_seria where id=NEW.id_seria \g
                SET NEW.serial=@serial\g
        END IF\g
END;


This works. I have tried it. The best thing you can do at this point is to upgrade your MySQL. You may be thinking that you have the lastest version, but that will only be the latest that your Linux distro will let you install.

Cheers


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 06, 2009 6:38 am 
Offline

Joined: Tue Mar 13, 2007 7:16 am
Posts: 79
HI
I download now a2bililng from svn and I run the sql file a2billing-schema-v1.4.0.sql, with no problme at all,

so the problem was not in mysql, but in the a2biling script.

I will do further testing and let you know


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 06, 2009 6:55 am 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
asiby wrote:
This is a MySQL bug and can been fixed by simply upgrading.
All excellent advice from asiby once more, but it should be mentioned upgrading MySQL beyond v5.0.76 might possibly break things. Read the release notes before upgrading MySQL to see if they've changed the way DELIMITER works again.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 11, 2009 2:12 pm 
Offline

Joined: Tue Jul 04, 2006 3:21 pm
Posts: 13
Hi All,

Have anyone tried downloading the latest trunk version recently? I tried doing that today with "svn co --username guest --password guest http://svn.a2billing.net/svn/asterisk2billing/trunk/ /usr/local/src/a2billing" as pointed out from the install guide, but got the following error "svn: PROPFIND request failed on '/svn/asterisk2billing/trunk'" "svn: PROPFIND of '/svn/asterisk2billing/trunk': 407 Authentication required (http://svn.a2billing.net).

What could be wrong. Authentication changed? Please advice.

Cheers to All.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 12, 2009 11:26 am 
Offline

Joined: Tue Jul 04, 2006 3:21 pm
Posts: 13
Hi Guys,

Its resolved. Just tried it now and I could download the latest trunk. I guess some sort of firewall.

Cheers to All.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 
VoIP Billing solution


All times are UTC


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group