Hi!
On Mon, Jan 12, 2026 at 1:49 PM Sergei Golubchik <[email protected]> wrote:
>
> Hi, Monty,
>
> On Jan 12, Michael Widenius wrote:
> > revision-id: 8ef0c105783 (mariadb-12.1.1-51-g8ef0c105783)
> > +void THD::killed_for_exceeding_limit_rows()
> > +{
> > + set_killed(ABORT_QUERY);
> > + if (!no_errors && !killed_for_exceeding_limit_rows_warning_given)
> > + {
> > + killed_for_exceeding_limit_rows_warning_given= 1;
>
> why do you need killed_for_exceeding_limit_rows_warning_given?
> Just check if !killed
We may have the killed flag already set from before when the
function is called. In old code we did generate the warning also
in this case, so better to continue doing it.
<cut>
> > + if (unlikely(thd->lex->sql_command != SQLCOM_SELECT))
> > + goto end; // For DELETE RETURNING
> > +
> > + for (ha_info= thd->transaction->stmt.ha_list ;
> > + ha_info; ha_info= ha_info->next())
> > + {
> > + if (unlikely(ha_info->is_trx_read_write()))
> > + goto end;
> > + }
> > +
> > + /* Send result to client as we are exceuting a read only statement */
> > + thd->push_final_warnings();
> > + thd->update_server_status(); // Needed for slow query
> > status
> > + thd->protocol->end_statement();
> > +
> > +end:
>
> this could be
>
> if (!thd->transaction->stmt.is_trx_read_write())
> {
> /* Send result to client as we are exceuting a read only statement */
> thd->push_final_warnings();
> thd->update_server_status(); // Needed for slow query
> status
> thd->protocol->end_statement();
> }
I don't think the stmt.is_trx_read_write() is correct in case of sub statements.
I cannot do that as this is called before commit and
stmt.is_trx_read_read_write is not yet set.
Regards,
Monty
_______________________________________________
developers mailing list -- [email protected]
To unsubscribe send an email to [email protected]