[sr-dev] git:master: lib/srdb1: Changed OP_NEQ to use ANSI standard <>

Peter Dunkley peter.dunkley at crocodile-rcs.com
Fri May 4 19:32:33 CEST 2012


I should clarify...  != sometimes works on PostgreSQL and sometimes does
not.  I was seeing some very strange errors when doing certain queries.
It looked like != worked fine when I only had one comparison in my
SELECT/UPDATE, but as soon as I had multiple comparisons (one of which
used !=) I got errors.

Regards,

Peter

On Fri, 2012-05-04 at 19:22 +0200, Peter Dunkley wrote:

> Module: sip-router
> Branch: master
> Commit: 79e59ec116c14d3416803736a920d9ac478c6055
> URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=79e59ec116c14d3416803736a920d9ac478c6055
> 
> Author: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
> Committer: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
> Date:   Fri May  4 18:14:06 2012 +0100
> 
> lib/srdb1: Changed OP_NEQ to use ANSI standard <>
> 
> - OP_NEQ was "!=" which works with many, but not all, SQL databases.
> - One database this doesn't work with is PostgreSQL.
> - <> is the standard and all databases should support it.
> 
> ---
> 
>  lib/srdb1/db_op.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/lib/srdb1/db_op.h b/lib/srdb1/db_op.h
> index 4b4c3a4..2da6e1f 100644
> --- a/lib/srdb1/db_op.h
> +++ b/lib/srdb1/db_op.h
> @@ -41,7 +41,7 @@
>  /** operator greater than equal */
>  #define OP_GEQ ">="
>  /** operator negation */
> -#define OP_NEQ "!="
> +#define OP_NEQ "<>"
>  /** bitwise AND */
>  #define OP_BITWISE_AND "&"
>  
> 
> 
> _______________________________________________
> sr-dev mailing list
> sr-dev at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev


-- 
Peter Dunkley
Technical Director
Crocodile RCS Ltd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20120504/e0685fa3/attachment.htm>


More information about the sr-dev mailing list