Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit eb34155

Browse files
committed
OK I found it,
I search in the planner for the '\xFF' appending. Finally I found in MakeIndexable() in gram.y Attach a patch which removes the "<=" test in USE_LOCALE, might make some queries a bit slower for us "locale-heads", BUT correct result is more important. regards, -- ----------------- Göran Thyni
1 parent 2163d9e commit eb34155

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/backend/parser/gram.y

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.50 1999/02/02 03:44:42 momjian Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.51 1999/02/02 19:20:54 momjian Exp $
1414
*
1515
* HISTORY
1616
* AUTHOR DATE MAJOR EVENT
@@ -5257,11 +5257,17 @@ static Node *makeIndexable(char *opname, Node *lexpr, Node *rexpr)
52575257
least->val.val.str = match_least;
52585258
most->val.type = T_String;
52595259
most->val.val.str = match_most;
5260+
#ifdef USE_LOCALE
5261+
result = makeA_Expr(AND, NULL,
5262+
makeA_Expr(OP, "~", lexpr, rexpr),
5263+
makeA_Expr(OP, ">=", lexpr, (Node *)least));
5264+
#else
52605265
result = makeA_Expr(AND, NULL,
52615266
makeA_Expr(OP, "~", lexpr, rexpr),
52625267
makeA_Expr(AND, NULL,
52635268
makeA_Expr(OP, ">=", lexpr, (Node *)least),
52645269
makeA_Expr(OP, "<=", lexpr, (Node *)most)));
5270+
#endif
52655271
}
52665272
}
52675273
}
@@ -5304,11 +5310,17 @@ static Node *makeIndexable(char *opname, Node *lexpr, Node *rexpr)
53045310
least->val.val.str = match_least;
53055311
most->val.type = T_String;
53065312
most->val.val.str = match_most;
5313+
#ifdef USE_LOCALE
5314+
result = makeA_Expr(AND, NULL,
5315+
makeA_Expr(OP, "~~", lexpr, rexpr),
5316+
makeA_Expr(OP, ">=", lexpr, (Node *)least));
5317+
#else
53075318
result = makeA_Expr(AND, NULL,
53085319
makeA_Expr(OP, "~~", lexpr, rexpr),
53095320
makeA_Expr(AND, NULL,
53105321
makeA_Expr(OP, ">=", lexpr, (Node *)least),
53115322
makeA_Expr(OP, "<=", lexpr, (Node *)most)));
5323+
#endif
53125324
}
53135325
}
53145326
}

0 commit comments

Comments
 (0)