[Home]

Summary:ASTERISK-23937: Syntax Error ODBC SQL
Reporter:Simon Balkau (Sundypha)Labels:
Date Opened:2014-06-25 16:24:36Date Closed:2014-07-14 08:45:37
Priority:TrivialRegression?
Status:Closed/CompleteComponents:Resources/res_config_odbc Resources/res_odbc
Versions:12.3.2 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Ubuntu 12.04.4 LTS Server Asterisk 12.3.2 ODBC on local MySQLAttachments:
Description:Hi there,

currently I tried to find the string where the SQL is built.
There is an missing apostroph or missing backslash depends on what should be achieved.
look on this debug:
{noformat}
[Jun 25 22:52:21] DEBUG[3692][C-00000002]: res_config_odbc.c:112 custom_prepare:                                                                                                                                                              Skip: 0; SQL: SELECT * FROM sippeers WHERE host = ? AND insecure LIKE ? ESCAPE                                                                                                                                                              '\' ORDER BY host
[Jun 25 22:52:21] DEBUG[3692][C-00000002]: res_config_odbc.c:128 custom_prepare:                                                                                                                                                              Parameter 1 ('host') = 'xxx.xxx.xxx.xxx'
[Jun 25 22:52:21] DEBUG[3692][C-00000002]: res_config_odbc.c:128 custom_prepare:                                                                                                                                                              Parameter 2 ('insecure LIKE') = '%port%'
[Jun 25 22:52:21] WARNING[3692][C-00000002]: res_odbc.c:655 ast_odbc_prepare_and                                                                                                                                                             _execute: SQL Execute returned an error -1: 42000: [MySQL][ODBC 5.1 Driver][mysq                                                                                                                                                             ld-5.5.37-0ubuntu0.12.04.1]You have an error in your SQL syntax; check the manua                                                                                                                                                             l that corresponds to your MySQL server version for the right syntax to use near                                                                                                                                                              ''\' ORDER BY host' at line 1 (219)
[Jun 25 22:52:21] WARNING[3692][C-00000002]: res_odbc.c:667 ast_odbc_prepare_and                                                                                                                                                             _execute: SQL Execute error -1! Verifying connection to asterisk [asterisk-conne                                                                                                                                                             ctor]...
{noformat}
and second:
{noformat}
[Jun 25 22:52:51] DEBUG[3692][C-00000002]: res_config_odbc.c:112 custom_prepare: Skip: 0; SQL: SELECT * FROM sippeers WHERE ipaddr = ? AND insecure LIKE ? ESCAPE '\' ORDER BY ipaddr
[Jun 25 22:52:51] DEBUG[3692][C-00000002]: res_config_odbc.c:128 custom_prepare: Parameter 1 ('ipaddr') = 'xxx.xxx.xxx.xxx'
[Jun 25 22:52:51] DEBUG[3692][C-00000002]: res_config_odbc.c:128 custom_prepare: Parameter 2 ('insecure LIKE') = '%port%'
[Jun 25 22:52:51] WARNING[3692][C-00000002]: res_odbc.c:655 ast_odbc_prepare_and_execute: SQL Execute returned an error -1: 42000: [MySQL][ODBC 5.1 Driver][mysqld-5.5.37-0ubuntu0.12.04.1]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 ''\' ORDER BY ipaddr' at line 1 (221)
{noformat}
Comments:By: Rusty Newton (rnewton) 2014-06-25 19:15:43.158-0500

Thank you for taking the time to report this bug and helping to make Asterisk better. Unfortunately, we cannot work on this bug because your description did not include enough information. You may find it helpful to read the Asterisk Issue Guidelines http://www.asterisk.org/developers/bug-guidelines. We would be grateful if you would then provide a more complete description of the problem. At a minimum, we need:

1. the specific steps or actions you took that caused you to encounter the problem,
2. the behavior you expected, and
3. the behavior you actually encountered (in as much detail as possible).

This likely includes output from the console with debug level logging, a SIP trace (if this is SIP related), and configuration information such as dialplan (e.g. extensions.conf) and channel configuration (e.g. sip.conf). Thanks!



By: Rusty Newton (rnewton) 2014-07-14 08:45:20.455-0500

Suspended due to lack of activity. Please request a bug marshal in #asterisk-bugs on the IRC network irc.freenode.net to reopen the issue should you have the additional information requested.  Further information can be found at http://www.asterisk.org/developers/bug-guidelines


If you request for this to be reopened please describe exactly how to reproduce this.