Thread

  1. Re: [BUGS] like operator bug

    Tom Lane <tgl@sss.pgh.pa.us> — 1999-09-07T19:17:46Z

    jfaith <jfaith@cemsys.com> writes:
    > create table tst(addr char(4));
    > insert into tst values('1000');
    > insert into tst values('1010');
    > insert into tst values('1120');
    > select * from tst where addr like '1%0';
    > produces
    > addr
    > ----
    > 1120(1 row)
    > where it should return all of the example rows.
    
    I believe I have fixed this.  If you need the fix before 6.5.2 is out,
    line 188 in src/backend/utils/adt/like.c should return LIKE_FALSE not
    LIKE_ABORT:
    
      	if (*text !='\0')
    ! 		return LIKE_ABORT;
      	else
    
      	if (*text !='\0')
    ! 		return LIKE_FALSE;
      	else
    
    			regards, tom lane