New patch (was: tough bug) - Mailing list pgsql-hackers

From Goran Thyni
Subject New patch (was: tough bug)
Date
Msg-id 36B60EC3.CF13E5E1@kirra.net
Whole thread Raw
Responses Re: [HACKERS] New patch (was: tough bug)
Re: New patch (was: tough bug)
List pgsql-hackers
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
This is Penguin Country. On a quiet night you can hear Windows NT
reboot!diff -c pgsql/src/backend/parser/gram.y.orig pgsql/src/backend/parser/gram.y
*** pgsql/src/backend/parser/gram.y.orig    Tue Jan 26 07:02:32 1999
--- pgsql/src/backend/parser/gram.y    Mon Feb  1 21:16:56 1999
***************
*** 5249,5259 ****
--- 5249,5265 ----
                  least->val.val.str = match_least;
                  most->val.type = T_String;
                  most->val.val.str = match_most;
+ #ifdef USE_LOCALE
+                 result = makeA_Expr(AND, NULL,
+                         makeA_Expr(OP, "~", lexpr, rexpr),
+                         makeA_Expr(OP, ">=", lexpr, (Node *)least));
+ #else
                  result = makeA_Expr(AND, NULL,
                          makeA_Expr(OP, "~", lexpr, rexpr),
                          makeA_Expr(AND, NULL,
                              makeA_Expr(OP, ">=", lexpr, (Node *)least),
                              makeA_Expr(OP, "<=", lexpr, (Node *)most)));
+ #endif
              }
          }
      }
***************
*** 5296,5306 ****
--- 5302,5318 ----
                  least->val.val.str = match_least;
                  most->val.type = T_String;
                  most->val.val.str = match_most;
+ #ifdef USE_LOCALE
+                 result = makeA_Expr(AND, NULL,
+                         makeA_Expr(OP, "~~", lexpr, rexpr),
+                         makeA_Expr(OP, ">=", lexpr, (Node *)least));
+ #else
                  result = makeA_Expr(AND, NULL,
                          makeA_Expr(OP, "~~", lexpr, rexpr),
                          makeA_Expr(AND, NULL,
                              makeA_Expr(OP, ">=", lexpr, (Node *)least),
                              makeA_Expr(OP, "<=", lexpr, (Node *)most)));
+ #endif
              }
          }
      }







pgsql-hackers by date:

Previous
From: jwieck@debis.com (Jan Wieck)
Date:
Subject: Re: [HACKERS] Problems doing a copy to a table
Next
From: jwieck@debis.com (Jan Wieck)
Date:
Subject: Small patches in copy.c and trigger.c