[Kamailio-Devel] [ openser-Bugs-2648714 ] dbtext.query returns the wrong rows, text columns & '<'

SourceForge.net noreply at sourceforge.net
Sun Mar 1 21:53:46 CET 2009


Bugs item #2648714, was opened at 2009-02-28 15:32
Message generated for change (Comment added) made by miconda
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=2648714&group_id=139143

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: ver devel
>Status: Closed
>Resolution: Accepted
Priority: 5
Private: No
Submitted By: Edgar Holleis (ccaracalla)
>Assigned to: Daniel-Constantin Mierla (miconda)
Summary: dbtext.query returns the wrong rows, text columns & '<'

Initial Comment:
db_text's query function returns bad results if called with the operators '<', '<=', '>' and '>=' on text columns. 

Description of the bug in dbt_res.c:

- dbt_row_match() calls dbt_cmp_val() and expects -1, 0, or 1 in return, -2 to indicate error

- dbt_cmp_val() calls strncasecmp() and fails to take into account that the latter returns "a positive integer" or "a negative integer" to indicate bigger or smaller.

The patch passes the result of strncasecmp() through sign().

The bug is present in at least 1.3.x to trunk.

----------------------------------------------------------------------

>Comment By: Daniel-Constantin Mierla (miconda)
Date: 2009-03-01 22:53

Message:
Thanks. Patch applied on trunk for upcoming 1.5. Later will be backported
to older versions.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=2648714&group_id=139143



More information about the Devel mailing list