[asterisk-bugs] [JIRA] (ASTERISK-23937) Syntax Error ODBC SQL
Rusty Newton (JIRA)
noreply at issues.asterisk.org
Wed Jun 25 19:16:56 CDT 2014
[ https://issues.asterisk.org/jira/browse/ASTERISK-23937?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=219971#comment-219971 ]
Rusty Newton commented on ASTERISK-23937:
-----------------------------------------
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!
> Syntax Error ODBC SQL
> ---------------------
>
> Key: ASTERISK-23937
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-23937
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: Resources/res_config_odbc, Resources/res_odbc
> Affects Versions: 12.3.2
> Environment: Ubuntu 12.04.4 LTS Server
> Asterisk 12.3.2
> ODBC on local MySQL
> Reporter: Simon Balkau
> Severity: Trivial
>
> 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}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list