← Back to team overview

maria-developers team mailing list archive

Re: 27060eb6ba5: MDEV-21916: COM_STMT_BULK_EXECUTE with RETURNING insert wrong values

 

Hi, Sanja!

One more question. Why did you introduce DA_EOF_BULK ?
It doesn't seem to be related to net buffers.

Is it to handle bulk UPDATE/DELETE, to calculate warnings over the whole
batch? And only for that?

On Jun 09, Oleksandr Byelkin wrote:
> > >
> > > MDEV-21916: COM_STMT_BULK_EXECUTE with RETURNING insert wrong values
> > >
> > > To allocate new net buffer to avoid changing bufer we are reading.
> >
> > You still didn't clarify the commit comment
> >
> > fixed.

Thanks, looks much clearer now.

> > > diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
> > > index 7280236e43f..5aaff3cf623 100644
> > > --- a/sql/sql_delete.cc
> > > +++ b/sql/sql_delete.cc
> > > @@ -685,8 +685,14 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
> > >        !table->prepare_triggers_for_delete_stmt_or_event())
> > >      will_batch= !table->file->start_bulk_delete();
> > >
> > > -  if (returning)
> > > +  /*
> > > +    thd->get_stmt_da()->is_set() means first iteration of prepared statement
> > > +    with array binding operation execution (non optimized so it is not
> > > +    INSERT)
> > > +  */
> > > +  if (returning && !thd->get_stmt_da()->is_set())
> > >    {
> > > +    DBUG_ASSERT(thd->lex->sql_command != SQLCOM_INSERT);
> >
> > a strange assert to see in sql_delete.cc :)
> 
> you asked to show that there is 2 different ways execute the statement and
> INSERT do it in other place it was how I showed, there is no problem to
> remove it

I have to admit, asserting not SQLCOM_INSERT inside sql_delete.cc
looks rather ridiculous. Sorry for this. As you like, basically,
but in my opinion the comment explains enough, the DBUG_ASSERT
only confuses a reader.

> > can one even reach mysql_delete() with SQLCOM_INSERT?
> > not just with returning and !thd->get_stmt_da()->is_set(), anywhere?

Regards,
Sergei
VP of MariaDB Server Engineering
and security@xxxxxxxxxxx


References