Обсуждение: Re: A mb problem in PostgreSQL

Поиск
Список
Период
Сортировка

Re: A mb problem in PostgreSQL

От
Tatsuo Ishii
Дата:
Chih-Chang,

> Do you remember the mb problem about Big5?

Sure.

> Now I have tested all Big5 chars (with ETen extension -- some chars in
> CNS 11643-1992 Plane 3) by the program in the attachment on
> PostgreSQL 7.0.3 with patches from you show me.
> The execution result is also in the attachment.
> The first two insertion fails are normal, because these two chars are
> duplicated in Big5.
> But the 3rd Big5 char (0xF9DC <- > CNS Plane3 0x4B5C) insertion
> is failed. I have no idea about why it is a "Unterminated quoted
> string".
> Could you see where the problem is?

Thanks for the testing effort!

Please apply following one-line-patch and test it again. If it's ok, I
will commit it to both current and stable trees.
--
Tatsuo Ishii

*** postgresql-7.0.3/src/backend/utils/mb/big5.c~    Thu May 27 00:19:54 1999
--- postgresql-7.0.3/src/backend/utils/mb/big5.c    Thu Dec  7 13:39:01 2000
***************
*** 322,328 ****             if (b2c3[i][0] == big5)             {                 *lc = LC_CNS11643_3;
!                 return (b2c3[i][1]);             }         } 
--- 322,328 ----             if (b2c3[i][0] == big5)             {                 *lc = LC_CNS11643_3;
!                 return (b2c3[i][1] | 0x8080U);             }         } 


Re: A mb problem in PostgreSQL

От
Chih-Chang Hsieh
Дата:
Tatsuo,

Tatsuo Ishii 寫道:

> Please apply following one-line-patch and test it again. If it's ok, I
> will commit it to both current and stable trees.
>
> !                               return (b2c3[i][1] | 0x8080U);

Yes, it's OK. Thank you!
But I wonder why we need to "| 0x8080U"?
b2c3[][] and BIG5toCNS()'s return value are both unsigned short,  aren't they?

--
Chih-Chang Hsieh





Re: Re: A mb problem in PostgreSQL

От
Tatsuo Ishii
Дата:
> > Please apply following one-line-patch and test it again. If it's ok, I
> > will commit it to both current and stable trees.
> >
> > !                               return (b2c3[i][1] | 0x8080U);
> 
> Yes, it's OK. Thank you!
> But I wonder why we need to "| 0x8080U"?
> b2c3[][] and BIG5toCNS()'s return value are both unsigned short,  aren't they?

b2c3 has CNS 11643-1992 value. That is, we need to add 0x8080 to
convert to EUC_TW.
--
Tatsuo Ishii


Re: Re: A mb problem in PostgreSQL

От
Tatsuo Ishii
Дата:
> > Please apply following one-line-patch and test it again. If it's ok, I
> > will commit it to both current and stable trees.
> >
> > !                               return (b2c3[i][1] | 0x8080U);
> 
> Yes, it's OK. Thank you!

Thanks for the testings. I will commit soon.

> But I wonder why we need to "| 0x8080U"?
> b2c3[][] and BIG5toCNS()'s return value are both unsigned short,  aren't they?

Since the function returns EUC_TW. In b2c3[] we have CNS 11643-1992
value, and we need to add 0x8080 to convert from CNS 11643-1992 to
EUC.
--
Tatsuo Ishii