Re: Check for tuplestorestate nullness before dereferencing

2025-04-22 Thread Nikolay Shaplov
В письме от вторник, 22 апреля 2025 г. 18:50:49 MSK пользователь Tom Lane написал: > The reason that the subsequent bit of code is safe is that !forward > should not possibly be true unless EXEC_FLAG_BACKWARD was given, > which'd cause us to create a tuplestore. So if we were going > to change a

Re: Check for tuplestorestate nullness before dereferencing

2025-04-22 Thread Tom Lane
Nikolay Shaplov writes: > В письме от пятница, 18 октября 2024 г. 02:28:22 MSK пользователь David > Rowley > написал: >> It would be good to know if the optimisation added in d2c555ee5 ever >> applies with today's code. If it does apply, we should likely add a >> test case for it and if it neve

Re: Check for tuplestorestate nullness before dereferencing

2025-04-22 Thread Nikolay Shaplov
В письме от пятница, 18 октября 2024 г. 02:28:22 MSK пользователь David Rowley написал: > It would be good to know if the optimisation added in d2c555ee5 ever > applies with today's code. If it does apply, we should likely add a > test case for it and if it never does, then we should just remove

Re: Check for tuplestorestate nullness before dereferencing

2024-10-17 Thread David Rowley
On Tue, 15 Oct 2024 at 05:21, Alena Rybakina wrote: > As I see it, node->eflags can be zero if it passes the output of a > subquery, during the initialization of the Material node execution, and > when the subquery is rescanned. Do you have a test case that calls Material with zero eflags? I tri

Re: Check for tuplestorestate nullness before dereferencing

2024-10-15 Thread Alexander Kuznetsov
14.10.2024 19:21, Alena Rybakina wrote: To be honest, I'm not sure this change is necessary. Looking at the code, I see that in ExecMaterial it is possible to handle a tuplestorestate of NULL, and this error can be accessed if the flags are not zero, but I think these cases have been worked

Re: Check for tuplestorestate nullness before dereferencing

2024-10-14 Thread Alena Rybakina
Hi! On 14.10.2024 16:41, Ilia Evdokimov wrote: On 14.10.2024 12:25, Alexander Kuznetsov wrote: Hello everyone, I'd like to propose adding a check for the nullness of tuplestorestate before dereferencing it in src/backend/executor/nodeModifier.c. The patch is attached. I am proposing this f

Re: Check for tuplestorestate nullness before dereferencing

2024-10-14 Thread Ilia Evdokimov
On 14.10.2024 12:25, Alexander Kuznetsov wrote: Hello everyone, I'd like to propose adding a check for the nullness of tuplestorestate before dereferencing it in src/backend/executor/nodeModifier.c. The patch is attached. I am proposing this fix based on the assumption that tuplestorestate

Check for tuplestorestate nullness before dereferencing

2024-10-14 Thread Alexander Kuznetsov
Kuznetsov From b5217fd138f35fb5bf70ad8741ebed5330457891 Mon Sep 17 00:00:00 2001 From: Alexander Kuznetsov Date: Thu, 10 Oct 2024 17:38:10 +0300 Subject: [PATCH] Check for tuplestorestate nullness before dereferencing tuplestorestate can be NULL when calculating eof_tuplestore, where tuplestorestate is