[asterisk-bugs] [Asterisk 0017077]: [patch] Fix query with double backslash in string literals and stop log warnings

Asterisk Bug Tracker noreply at bugs.digium.com
Mon Apr 18 11:57:33 CDT 2011


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=17077 
====================================================================== 
Reported By:                korihor
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   17077
Category:                   Resources/res_config_pgsql
Reproducibility:            always
Severity:                   trivial
Priority:                   normal
Status:                     ready for testing
Asterisk Version:           1.6.2.6 
JIRA:                       SWP-1132 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-03-22 21:49 CDT
Last Modified:              2011-04-18 11:57 CDT
====================================================================== 
Summary:                    [patch] Fix query with double backslash in string
literals and stop log warnings
Description: 
The function realtime_multi_pgsql use "LIKE '\\_%'" when look for a pattern
on realtime dialplan, that is a no standard use for "\\" in literal
strings.

This causes the postgresql logfile to be filled with a lot of warnings.

The correct is use "LIKE E'\\_%'".

This patch too set a more consistent level of verbosity for a log entry.
====================================================================== 

---------------------------------------------------------------------- 
 (0133881) korihor (reporter) - 2011-04-18 11:57
 https://issues.asterisk.org/view.php?id=17077#c133881 
---------------------------------------------------------------------- 
http://www.postgresql.org/docs/8.4/static/release-8-1.html

"Currently PostgreSQL processes a backslash in a string literal as
introducing a special escape sequence, e.g. \n or \010. While this allows
easy entry of special values, it is nonstandard and makes porting of
applications from other databases more difficult. For this reason, the
PostgreSQL project is planning to remove the special meaning of backslashes
in strings. For backward compatibility and for users who want special
backslash processing, a new string syntax has been created. This new string
syntax is formed by writing an E immediately preceding the single quote
that starts the string, e.g. E'hi\n'. While this release does not change
the handling of backslashes in strings, it does add new configuration
parameters to help users migrate applications for future releases" 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-04-18 11:57 korihor        Note Added: 0133881                          
======================================================================




More information about the asterisk-bugs mailing list