[pgpool-hackers: 3715] Re: Query mis cached
Tatsuo Ishii
ishii at sraoss.co.jp
Tue Jul 14 22:18:59 JST 2020
I have pushed your patches to master and 4.1 stable branches with
subtle changes to the regression test (SQL keywords changed to upper
cases). Also I have pushed patches except for gram_minimal.y to all
rest of supported branches.
Thank you!
> Hi Ishii san
>
>> The patch looks good except following warnings:
>
> Thanks for pointing it out, I removed the trailing whitespace and made a new patch.
>
>> Also I think it'd be better to add a regression test for this. Probably add to 006.memqcache?
>
> Yes, you are right, I added the regression test to 006.memqcache, patch attatched.
> If the regression test is not enough, Please let me know, I am glad to add more testcase.
>
> Best regards,
> houzj
>
> -----Original Message-----
> From: Tatsuo Ishii [mailto:ishii at sraoss.co.jp]
> Sent: Monday, July 13, 2020 10:15 PM
> To: Hou, Zhijie <houzj.fnst at cn.fujitsu.com>
> Cc: pgpool-hackers at pgpool.net
> Subject: Re: [pgpool-hackers: 3706] Re: Query mis cached
>
>>> Hi pgpool hackers,
>>>
>>>
>>>
>>> I found the following SQL will be cached, when enabled memory query
>>> cache,
>>>
>>>
>>>
>>> "with cte as (insert into test2 values(1) returning *) select * from test2;"
>>>
>>>
>>>
>>> I think the SQL has Data-Modifying Statements in with clause should not be cached.
>>>
>>> Because Once cached, the Data-Modifying Statements will not be executed again which is not expected.
>>
>> You are right.
>>
>>> It seems to be better to analyze the with clause like the following:
>>>
>>>
>>>
>>> --------For UPDATE/INSERT/DELETE type SQL:
>>>
>>> extract oids from its with clause which will be invalidated.
>>>
>>>
>>>
>>> --------For SELECT type SQL:
>>>
>>> If Data-Modifying Statements in its with clause, the
>>> select will not be cached,
>>>
>>> and the oids from with clause will be invalidated too.
>>>
>>>
>>>
>>> What do you think?
>>>
>>>
>>>
>>> I try to solve the problem and made a patch for the code.
>>
>> Thank you for the patch! I will look into this.
>
> The patch looks good except following warnings:
>
> git apply ~/0002-Update-pool_memqcache.c.patch
> /home/t-ishii/0002-Update-pool_memqcache.c.patch:165: trailing whitespace.
> /*
> /home/t-ishii/0002-Update-pool_memqcache.c.patch:175: trailing whitespace.
> POOL_SETMASK(&oldmask);
> warning: 2 lines add whitespace errors.
>
> Also I think it'd be better to add a regression test for this. Probably add to 006.memqcache?
>
> Best regards,
> --
> Tatsuo Ishii
> SRA OSS, Inc. Japan
> English: http://www.sraoss.co.jp/index_en.php
> Japanese:http://www.sraoss.co.jp
>
>
>
>
More information about the pgpool-hackers
mailing list