write past chunk end in ExprContext / to_char

Поиск
Список
Период
Сортировка
От Patrick Welche
Тема write past chunk end in ExprContext / to_char
Дата
Msg-id 20070628181651.GR19698@quartz.itdept.newn.cam.ac.uk
обсуждение исходный текст
Ответы Re: write past chunk end in ExprContext / to_char  (Alvaro Herrera <alvherre@commandprompt.com>)
Re: write past chunk end in ExprContext / to_char  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
With today's CVS code (originally noticed with 8.2beta3), on a PC where
INT_MAX=0x7FFFFFFF=2147483647

postgres=# select version();                                                            version
                                   
 

---------------------------------------------------------------------------------------------------------------------------------PostgreSQL
8.3develon i386-unknown-netbsdelf4.99.20, compiled by GCC gcc (GCC) 4.1.2 20070110 prerelease (NetBSD nb1 20070603)
 
(1 row)

postgres=# select to_char(2147483647,'999,999,999');  to_char    
-------------- ###,###,###
(1 row)

postgres=# select to_char(2147483648,'999,999,999');
WARNING:  detected write past chunk end in ExprContext 0x845509c
WARNING:  detected write past chunk end in ExprContext 0x845509c  to_char    
-------------- ###,###,###
(1 row)

postgres=# select to_char(2147483648,'99,999,999');  to_char   
------------- ##,###,###
(1 row)

postgres=# select to_char(2147483648,'9,999,999,999');   to_char     
---------------- 2,147,483,648
(1 row)

postgres=# select to_char(1234567890123,'999,999,999,999');
WARNING:  detected write past chunk end in ExprContext 0x845509c
WARNING:  detected write past chunk end in ExprContext 0x845509c    to_char      
------------------ ###,###,###,###
(1 row)

postgres=# select to_char(1234567890123,'99,999,999,999');    to_char     
----------------- ##,###,###,###
(1 row)

So strangely, to get the worrying WARNING, I seem to need >INT_MAX with
a format string with 1 less positions than necessary - no wonder I
seemed to only see it randomly...

Thoughts?

Cheers,

Patrick


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: SetBufferCommitInfoNeedsSave and race conditions
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: SetBufferCommitInfoNeedsSave and race conditions