mirror of
https://github.com/postgres/postgres.git
synced 2025-04-21 12:05:57 +03:00
varstr_cmp and any comparison function that piggybacks on it can return
any negative or positive number, not just -1 or 1. Fix comment on varstr_cmp and citext test case accordingly. As pointed out by Zdenek Kotala, and buildfarm member gothic moth.
This commit is contained in:
parent
8d4f2ecd41
commit
283939a321
@ -213,10 +213,10 @@ SELECT citext_cmp('AARDVARK'::citext, 'AARDVARK'::citext) AS zero;
|
|||||||
0
|
0
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT citext_cmp('B'::citext, 'a'::citext) AS one;
|
SELECT citext_cmp('B'::citext, 'a'::citext) > 0 AS true;
|
||||||
one
|
true
|
||||||
-----
|
------
|
||||||
1
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- Do some tests using a table and index.
|
-- Do some tests using a table and index.
|
||||||
|
@ -213,10 +213,10 @@ SELECT citext_cmp('AARDVARK'::citext, 'AARDVARK'::citext) AS zero;
|
|||||||
0
|
0
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT citext_cmp('B'::citext, 'a'::citext) AS one;
|
SELECT citext_cmp('B'::citext, 'a'::citext) > 0 AS true;
|
||||||
one
|
true
|
||||||
-----
|
------
|
||||||
1
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- Do some tests using a table and index.
|
-- Do some tests using a table and index.
|
||||||
|
@ -90,7 +90,7 @@ SELECT 'aardvark'::citext = 'aardVark'::citext AS t;
|
|||||||
SELECT citext_cmp('aardvark'::citext, 'aardvark'::citext) AS zero;
|
SELECT citext_cmp('aardvark'::citext, 'aardvark'::citext) AS zero;
|
||||||
SELECT citext_cmp('aardvark'::citext, 'aardVark'::citext) AS zero;
|
SELECT citext_cmp('aardvark'::citext, 'aardVark'::citext) AS zero;
|
||||||
SELECT citext_cmp('AARDVARK'::citext, 'AARDVARK'::citext) AS zero;
|
SELECT citext_cmp('AARDVARK'::citext, 'AARDVARK'::citext) AS zero;
|
||||||
SELECT citext_cmp('B'::citext, 'a'::citext) AS one;
|
SELECT citext_cmp('B'::citext, 'a'::citext) > 0 AS true;
|
||||||
|
|
||||||
-- Do some tests using a table and index.
|
-- Do some tests using a table and index.
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/adt/varlena.c,v 1.169 2009/01/01 17:23:50 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/adt/varlena.c,v 1.170 2009/04/23 07:19:09 heikki Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -1138,7 +1138,8 @@ text_position_cleanup(TextPositionState *state)
|
|||||||
* Comparison function for text strings with given lengths.
|
* Comparison function for text strings with given lengths.
|
||||||
* Includes locale support, but must copy strings to temporary memory
|
* Includes locale support, but must copy strings to temporary memory
|
||||||
* to allow null-termination for inputs to strcoll().
|
* to allow null-termination for inputs to strcoll().
|
||||||
* Returns -1, 0 or 1
|
* Returns an integer less than, equal to, or greater than zero, indicating
|
||||||
|
* whether arg1 is less than, equal to, or greater than arg2.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
varstr_cmp(char *arg1, int len1, char *arg2, int len2)
|
varstr_cmp(char *arg1, int len1, char *arg2, int len2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user