[Home]

Summary:ASTERISK-08949: [patch] MYSQL Stored Procedures
Reporter:tgledhill (tgledhill)Labels:
Date Opened:2007-03-06 11:03:03.000-0600Date Closed:2007-03-06 16:36:56.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Applications/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) app_addon_sql_mysql.c.1.patch
( 1) app_addon_sql_mysql.c.2.patch
Description:MYSQL 5.0 allows for stored procedures in MYSQL.  However the MYSQL function does not recognize CALL.

CALL sp_name([parameter[,...]])
CALL sp_name[()]
http://dev.mysql.com/doc/refman/5.0/en/call.html

MYSQL(Query resultid ${connid} CALL procedure_name(${var})) should work the same as SELECT, INSERT, or any other mysql commands.
Comments:By: Russell Bryant (russell) 2007-03-06 11:30:55.000-0600

Please get a license agreement (disclaimer) on file with Digium.  Then, I can look at and apply your patch.  Thanks!

By: tgledhill (tgledhill) 2007-03-06 11:32:16.000-0600

This patch seems to close the mysql connection for the next sql statement.  I am working on it.

By: tgledhill (tgledhill) 2007-03-06 12:19:07.000-0600

Disclaimer sent

By: tgledhill (tgledhill) 2007-03-06 15:19:41.000-0600

Apparently, fetching queries works differently when expecting multiple result sets. I made changes from the MySQL API docs to reflect this.

app_addon_sql_mysql.c.2.patch works well for me, and I've tested it with INSERT, UPDATE, SELECT, CALL, and DELETE.

By: Russell Bryant (russell) 2007-03-06 16:36:55.000-0600

We have a policy to not add any new features to release branches.  This was a tough call, but since this application was never specifically documented to be able to support stored procedures, I decided it was a new feature and only made your changes in the trunk.

I merged your patch in revision 347 of asterisk-addons.

Thanks!