<p>Rodrigo Ramirez Norambuena has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/6559">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_config_pgsql: Fix removed support to previous for versions PostgreSQL 9.1<br><br>In PostgreSQL 9.1 the backslash are string literals and not the escape<br>of characters.<br><br>In previous issue ASTERISK_26057 was fixed the use of escape LIKE but the<br>support for old version of Postgresql than 9.1 was dropped. The sentence<br>before make was "ESCAPE '\'" but in version before than 9.1 need it to be<br>as follow "ESCAPE '\\'".<br><br>ASTERISK-27283<br><br>Change-Id: I96d9ee1ed7693ab17503cb36a9cd72847165f949<br>---<br>M res/res_config_pgsql.c<br>1 file changed, 2 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/59/6559/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/res/res_config_pgsql.c b/res/res_config_pgsql.c<br>index 8d090cc..4cbfd61 100644<br>--- a/res/res_config_pgsql.c<br>+++ b/res/res_config_pgsql.c<br>@@ -54,6 +54,7 @@<br> static PGconn *pgsqlConn = NULL;<br> static int version;<br> #define has_schema_support (version > 70300 ? 1 : 0)<br>+#define USE_BACKSLASH_AS_STRING (version >= 90100 ? 1 : 0)<br> <br> #define MAX_DB_OPTION_SIZE 64<br> <br>@@ -386,7 +387,7 @@<br> }<br> <br> #define IS_SQL_LIKE_CLAUSE(x) ((x) && ast_ends_with(x, " LIKE"))<br>-static char *ESCAPE_CLAUSE = " ESCAPE '\\'";<br>+#define ESCAPE_CLAUSE (USE_BACKSLASH_AS_STRING ? " ESCAPE '\\'" : " ESCAPE '\\\\'")<br> <br> static struct ast_variable *realtime_pgsql(const char *database, const char *tablename, const struct ast_variable *fields)<br> {<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6559">change 6559</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/6559"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 14 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I96d9ee1ed7693ab17503cb36a9cd72847165f949 </div>
<div style="display:none"> Gerrit-Change-Number: 6559 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Rodrigo Ramirez Norambuena <a@rodrigoramirez.com> </div>