← Back to team overview

maria-developers team mailing list archive

Re: 93493a0e9b5: MDEV-24176 Server crashes after insert in the table with virtual column generated using date_format() and if()

 

Hi, Aleksey,

On Apr 13, Aleksey Midenkov wrote:
> >
> > No, quite the opposite.
> > I think (see above) that CONTEXT_ANALYSIS_ONLY_VCOL_EXPR
> > (it's set inside init_lex_with_single_table()) is wrong, what you're
> > doing is not "context analysys only", you're preparing items for
> > evaluation.
> 
> That works identically in branch and vanilla 10.3:
> 
> --source include/have_ucs2.inc
> create table t1 (c1 char(1) character set ucs2 collate ucs2_test_ci,
>                  v1 char(1) character set ucs2 collate ucs2_test_ci as (c1),
>                  v2 int as (c1 = 'b'),
>                  v3 int as (v1 = 'b'));
> insert into t1 (c1) values ('a');
> select * from t1 where v1 = 'b';
> drop table t1;
> 
> Result:
> select * from t1 where v1 = 'b';
> c1      v1      v2      v3
> a       a       0       0
> 
> .opt file:
> --character-sets-dir=$MYSQL_TEST_DIR/std_data/ldml/

Wow, this is a very good test. I wonder how you found it.

Yes, it shows, exactly, that it's incorrect to set
CONTEXT_ANALYSIS_ONLY_VCOL_EXPR and then evaluate those items.
Items fixed under CONTEXT_ANALYSIS_ONLY_VCOL_EXPR are *not fit* to be
evaluated.

Take a look at the bb-10.3-serg-MDEV-24176 branch.
Three commits there: two cherry-picks from 10.2
(they shouldn't be pushed into 10.3, instead your commit will eventually
be rebased on top of them after they're merged into 10.3)
and the "work-in-progress" commit that removes
init_lex_with_single_table and CONTEXT_ANALYSIS_ONLY_VCOL_EXPR.

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


Follow ups

References