Re: [BUGS] General Bug Report: regexp beginning of line doesn't work properly

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: psh(at)seznam(dot)cz
Cc: pgsql-bugs(at)postgreSQL(dot)org
Subject: Re: [BUGS] General Bug Report: regexp beginning of line doesn't work properly
Date: 1999-02-03 16:36:13
Message-ID: 199902031636.LAA01581@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

>
> ============================================================================
> POSTGRESQL BUG REPORT TEMPLATE
> ============================================================================
>
>
> Your name : Petr Hubeny
> Your email address : psh(at)seznam(dot)cz
>
> Category : runtime: back-end
> Severity : serious
>
> Summary: regexp beginning of line doesn't work properly
>
> System Configuration
> --------------------
> Operating System : Linux 2.2.1 ELF
>
> PostgreSQL version : 6.4.2
>
> Compiler used : gcc 2.7.2.3
>
> Hardware:
> ---------
> PII-300MHz, 64M RAM
> Linux agatha 2.2.1pcsp #6 t nor 2 16:17:30 CET 1999 i686 unknown
>
> Versions of other tools:
> ------------------------
> GNU Make version 3.76.1
> flex version 2.5.4
> GNU Bison version 1.25
>
>
> --------------------------------------------------------------------------
>
> Problem Description:
> --------------------
> "select...where a ~ '^A'" doesn't return anything,
> while "select...where a ~ '^[A]'" does. Also LIKE is
> affected.
>
>
> --------------------------------------------------------------------------
>
> Test Case:
> ----------
> create table test (a text);
> insert into test values ('ABC');
> insert into test values ('DEF');
> select * from test where a ~ '^A'; -- NOTHING!!!, Query 1
> select * from test where a ~ '^[A]'; -- ABC, Query 2
> select * from test where a LIKE 'A%'; -- NOTHING
> select * from test where a LIKE '%A%'; -- ABC
> select * from test where a LIKE '%F'; -- DEF
>
>
> --------------------------------------------------------------------------
>
> Solution:
> ---------
> Well, I suspect the parser and I tried to dig through
> the code, and this is how far I was able to get:
>
> with query 1 is function transformStmt()
> erroneously called with
>
> ((A_Expr*)((SelectStmt*)parseTree)->whereClause)->oper == 263
>
> with query 2 is
>
> ((A_Expr*)((SelectStmt*)parseTree)->whereClause)->oper == 465
>
> Hope it helps,

Works here fine. I have no idea what the cause could be. Very strange.

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Unprivileged user 1999-02-03 20:08:31 General Bug Report: Libpq function PQfnumber does not handle case-insensitive comparisons correctly
Previous Message Unprivileged user 1999-02-03 15:58:39 General Bug Report: regexp beginning of line doesn't work properly