TidScan needs handling of a corner cases

Поиск
Список
Период
Сортировка
От Gurjeet Singh
Тема TidScan needs handling of a corner cases
Дата
Msg-id 65937bea0804301054p16727110ga99ab2ca001f1c52@mail.gmail.com
обсуждение исходный текст
Ответы Re: TidScan needs handling of a corner cases  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi All,<br /><br />    I noticed that the TidScan fails to identify when the requested block is not in the relation.
Considerthis (pg_class has 6 blocks):<br /><br />postgres=# explain analyze select ctid, * from pg_class where ctid in
('(6,1)' );<br /> ERROR:  could not read block 6 of relation 1663/11511/1259: read only 0 of 8192 bytes<br /><br />   
Also,it is known that 0 is not a valid row-offset in the block, but the tid input function accepts this value (it
rejects-ve values). For the same setup:<br /><br />postgres=#  explain analyze select ctid, * from pg_class where ctid
in( '(6,0)' );<br />                                             QUERY PLAN                                            
<br/>----------------------------------------------------------------------------------------------------<br />  Tid
Scanon pg_class  (cost=0.00..4.01 rows=1 width=211) (actual time=0.009..0.009 rows=0 loops=1)<br />   TID Cond: (ctid =
'(6,0)'::tid)<br/> Total runtime: 0.130 ms<br />(3 rows)<br /><br />    Can we safely fix these? First one by ignoring
therequest if  requested_block >= RelationGetNumberOfBlocks(), and second one by accepting only non-zero positive
valuesin the tid input function.<br /><br />Best regards<br /><br />-- <br />gurjeet[.singh]@EnterpriseDB.com<br
/>singh.gurjeet@{gmail | hotmail | indiatimes | yahoo }.com<br /><br />EnterpriseDB <a
href="http://www.enterprisedb.com">http://www.enterprisedb.com</a><br/><br /> Mail sent from my BlackLaptop device  

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

Предыдущее
От: Aidan Van Dyk
Дата:
Сообщение: Re: Protection from SQL injection
Следующее
От: Bryce Nesbitt
Дата:
Сообщение: Re: Proposed patch - psql wraps at window width