ilike and --enable-multibyte=KOI8

Started by Juriy Goloveshkinover 25 years ago6 messagesgeneral
Jump to latest
#1Juriy Goloveshkin
juriy@avias.com

Hello, Can anybody check and confirm(or not) this:

if pgsql(DEVEL, from cvs-server) is built with locale and multibyte then

"select * from table where row ilike '%a%'" crashes pgsql.
"select * from table where row ilike 'a%'" doesn't craches.
"select * from table where row like '%a%'" doesn't craches.

If pgsql is built only with locale, pgsql isn't crashed...

please, give me an advice for solving this problemm. I need pgsql with both
this options...

--
Bye
Juriy Goloveshkin

#2Tatsuo Ishii
t-ishii@sra.co.jp
In reply to: Juriy Goloveshkin (#1)
Re: ilike and --enable-multibyte=KOI8

Hello, Can anybody check and confirm(or not) this:

if pgsql(DEVEL, from cvs-server) is built with locale and multibyte then

"select * from table where row ilike '%a%'" crashes pgsql.
"select * from table where row ilike 'a%'" doesn't craches.
"select * from table where row like '%a%'" doesn't craches.

If pgsql is built only with locale, pgsql isn't crashed...

please, give me an advice for solving this problemm. I need pgsql with both
this options...

Not reproduced here. It might be a bug depending on particular
data. Can you show me gdb backtrace?
--
Ttsuo Ishii

#3Juriy Goloveshkin
juriy@avias.com
In reply to: Tatsuo Ishii (#2)
Re: ilike and --enable-multibyte=KOI8

On Fri, Dec 08, 2000 at 08:23:26PM +0900, Tatsuo Ishii wrote:

Hello, Can anybody check and confirm(or not) this:

if pgsql(DEVEL, from cvs-server) is built with locale and multibyte then

"select * from table where row ilike '%a%'" crashes pgsql.
"select * from table where row ilike 'a%'" doesn't craches.
"select * from table where row like '%a%'" doesn't craches.

If pgsql is built only with locale, pgsql isn't crashed...

please, give me an advice for solving this problemm. I need pgsql with both
this options...

Not reproduced here. It might be a bug depending on particular
data. Can you show me gdb backtrace?

I will try to make the easiest situation with this bug,
for now, I know only this:

1. FreeBSD 4.2-STABLE, 5-CURRENT.
2. the freshest pgsql from cvs
3. I use locale, ru_RU.KOI8-R (Russian charset)
4. ./configure --enable-locale --enable-multibyte=KOI8
5. the query is(if in query remove following %, pg doesn't crash):
---
select distinct films.* from films
left join music_titles using(id_f)
left join mt_authors using (id_mt)
left join authors using(id_a)
where
music_titles.mus_name iLike '%asd%' and
(films.director iLike '%qwe%' or authors.family iLike 'zxc%');
---

6. gdb shows:

hjugo@root[~]# gdb /usr/local/pgsql/bin/postgres /usr/local/pgsql/data/base/18731/postgres.core
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-unknown-freebsd"...
Core was generated by `postgres'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/libz.so.2...done.
Reading symbols from /usr/lib/libcrypt.so.2...done.
Reading symbols from /usr/lib/libm.so.2...done.
Reading symbols from /usr/lib/libutil.so.3...done.
Reading symbols from /usr/lib/libreadline.so.4...done.
Reading symbols from /usr/lib/libncurses.so.5...done.
Reading symbols from /usr/lib/libc.so.5...done.
Reading symbols from /usr/libexec/ld-elf.so.1...done.
#0 0x8114771 in MatchTextIC (t=???, tlen=???, p=???, plen=???) at like.c:546
546 NextChar(t, tlen);
(gdb) bt
#0 0x8114771 in MatchTextIC (t=???, tlen=???, p=???, plen=???) at like.c:546
Cannot access memory at address 0x0.
(gdb) print t
$1 = (unsigned char *) 0x8338bde "О©╫О©╫О©╫О©╫О©╫О©╫ О©╫"
(gdb) print tlen
Address of symbol "tlen" is unknown.
(gdb) print p
$2 = (unsigned char *) 0x829b8dd "asd%О©╫О©╫О©╫О©╫О©╫О©╫О©╫pО©╫\036\b\020"
(gdb) print plen
$3 = 4
(gdb)

--
Bye
Juriy Goloveshkin

#4Tatsuo Ishii
t-ishii@sra.co.jp
In reply to: Juriy Goloveshkin (#3)
Re: ilike and --enable-multibyte=KOI8

Not reproduced here. It might be a bug depending on particular
data. Can you show me gdb backtrace?

I will try to make the easiest situation with this bug,
for now, I know only this:

1. FreeBSD 4.2-STABLE, 5-CURRENT.
2. the freshest pgsql from cvs
3. I use locale, ru_RU.KOI8-R (Russian charset)
4. ./configure --enable-locale --enable-multibyte=KOI8
5. the query is(if in query remove following %, pg doesn't crash):
---
select distinct films.* from films
left join music_titles using(id_f)
left join mt_authors using (id_mt)
left join authors using(id_a)
where
music_titles.mus_name iLike '%asd%' and
(films.director iLike '%qwe%' or authors.family iLike 'zxc%');
---

6. gdb shows:

[snip]

I found a silly bug with src/backend/utils/adt/like.c. Can you try out
attached pacthes?
--
Tatsuo Ishii

Attachments:

like.patchtext/plain; charset=us-asciiDownload+43-43
#5Juriy Goloveshkin
juriy@avias.com
In reply to: Tatsuo Ishii (#4)
Re: ilike and --enable-multibyte=KOI8

On Sun, Dec 10, 2000 at 12:37:52AM +0900, Tatsuo Ishii wrote:

I found a silly bug with src/backend/utils/adt/like.c. Can you try out
attached pacthes?

It looks good. pgsql doesn't crash now. thank you.

--
Bye
Juriy Goloveshkin

#6Tatsuo Ishii
t-ishii@sra.co.jp
In reply to: Juriy Goloveshkin (#5)
Re: ilike and --enable-multibyte=KOI8

On Sun, Dec 10, 2000 at 12:37:52AM +0900, Tatsuo Ishii wrote:

I found a silly bug with src/backend/utils/adt/like.c. Can you try out
attached pacthes?

It looks good. pgsql doesn't crash now. thank you.

Ok, I will commit the pacthes.
--
Tatsuo Ishii