Re: [PATCHES] v7.4.1 text_position() patch

2004-01-30 Thread Tom Lane
Korea PostgreSQL Users' Group [EMAIL PROTECTED] writes:
 In src/backend/utils/adt/varlena.c,
 766 line must be exits in block of 'else if (elm 1)' too.
 Because, strpos() function make a wrong result in multibyte string. 

Hm.  I don't think it can actually fail, because the wchar strings are
zero-terminated.  But it does look like there's a missed speedup here.
(Tatsuo, do you agree?)

Thanks for the report!

regards, tom lane

---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


Re: [PATCHES] v7.4.1 text_position() patch

2004-01-30 Thread Korea PostgreSQL Users' Group
strpos() function ( internal text_postion()) had a bug in unicode database.

dsn= select id,subject, strpos(subject, ' ') from bd_22 where id = 3927;
  id  |   subject   | strpos
--+-+
 3927 | ~ |  0
(1 row)

Time: 1.619 ms
dsn= select id,subject, strpos(subject, ' ') from bd_22 where id between 3925 and 
3927;
  id  | subject | strpos
--+-+
 3925 |  DB  .? |  4
 3927 | ~ | 11
(2 rows)

Time: 2.490 ms

Sorry, above text is korean language. 
strpos returns wrong result.





- Original Message - 
From: Tom Lane [EMAIL PROTECTED]
To: Korea PostgreSQL Users' Group [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; Tatsuo Ishii [EMAIL PROTECTED]
Sent: Saturday, January 31, 2004 12:31 AM
Subject: Re: [PATCHES] v7.4.1 text_position() patch 


 Hm.  I don't think it can actually fail, because the wchar strings are
 zero-terminated.  But it does look like there's a missed speedup here.
 (Tatsuo, do you agree?)
 
 Thanks for the report!
 
 regards, tom lane
 
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])


Re: [PATCHES] v7.4.1 text_position() patch

2004-01-30 Thread Tom Lane
Korea PostgreSQL Users' Group [EMAIL PROTECTED] writes:
 Hm.  I don't think it can actually fail, because the wchar strings are
 zero-terminated.

 [ yes it can ]

You're right.  I was confused at first because I couldn't reproduce the
problem, but then I realized it's because I'm running with
CLOBBER_FREED_MEMORY enabled, so the junk beyond the end of the string
won't match the other string.

Will commit the patch.  Thanks.

regards, tom lane

---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match