[Home]

Summary:ASTERISK-25746: func_odbc: Requires an additional ARG when executing via CLI and Dialplan
Reporter:Joseph Giarratano (blochead)Labels:
Date Opened:2016-02-04 16:16:47.000-0600Date Closed:2016-03-03 18:50:23.000-0600
Priority:MinorRegression?Yes
Status:Closed/CompleteComponents:Functions/func_odbc
Versions:13.7.0 13.7.1 Frequency of
Occurrence
Related
Issues:
Environment:linux Ubuntu 14.0LTS 4gb Ram Mysql 5.5 Attachments:( 0) func_odbc_additional_arg.PNG
Description:13.7 ODBC Write <Func_ODBC> <ARG> EXEC requires an additional ARG when used via CLI and through a dialplan.

13.5 does not require the additional Argument.

Example:
Working example:
ASTERISKSERVER*CLI> odbc write TG_RMBLACKLIST  4500,' ' exec                    Affected 1 rows.  Query executed on handle 0 [asterisk-mysql]

Failed example:
ASTERISKSERVER*CLI> odbc write TG_RMBLACKLIST  4500 exec
UPDATE blacklist SET blacklist_enabled=0 WHERE blacklist_callid_num=4500


Comments:By: Asterisk Team (asteriskteam) 2016-02-04 16:16:48.865-0600

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Joseph Giarratano (blochead) 2016-02-04 21:46:18.321-0600

single ${ARG1} requires a second argument

By: Kevin Harwell (kharwell) 2016-03-03 18:00:20.247-0600

This does not appear to be a bug. From the usage description:
{noformat}
Usage: odbc write <name> <args> <value> [exec]
      Evaluates the SQL provided in the ODBC function <name>, and
      optionally executes the function.  This function is intended for
      testing purposes.  Remember to quote arguments containing spaces.
{noformat}
The command requires both _args_ and _value_, separated by a space. The example failure only contains one of the two. In the attached screenshot the working example is shown to contain a space followed by a single quote mark (i.e. '), thus it used that as the _value_ and executed the statement.

I ran various scenarios in both the latest 13 code and also using 13.5.0 and the above behavior was the same for both.


By: Joseph Giarratano (blochead) 2016-03-03 18:50:23.761-0600

This condition is not present in 13.7.2