Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-31359

No warning is produced on second SELECT for virtual column with arg_comparator

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4(EOL), 10.5, 10.6, 10.9(EOL), 10.10(EOL), 11.0(EOL), 11.1(EOL)
    • 10.5, 10.6
    • Virtual Columns
    • None

    Description

      Expected the same behavior for both SELECT in test below, but for virtual column with arg_comparator there is no warning for second SELECT, but for all other there are. (Or perhaps there should be no warnings in the second select at all for all columns)

      Testcase:

      create table t1 (a datetime,
        # get_datetime_value
        b int as (a > 1),                             # Arg_comparator
        c int as (a in (1,2,3)),                      # in_datetime
        d int as ((a,a) in ((1,1),(2,1),(NULL,1))),   # cmp_item_datetime
        # other issues
        e int as ((a,1) in ((1,1),(2,1),(NULL,1)))    # cmp_item_row::alloc_comparators()
      );
       
       
      insert t1 (a) values ('2010-10-10 10:10:10');
       
      select * from t1;
      select * from t1;
       
      drop table t1;
      

      Actual result:

      select * from t1;
      a	b	c	d	e
      2010-10-10 10:10:10	1	0	0	NULL
      Warnings:
      Warning	1292	Truncated incorrect datetime value: '1'
      Warning	1292	Truncated incorrect datetime value: '1'
      Warning	1292	Truncated incorrect datetime value: '2'
      Warning	1292	Truncated incorrect datetime value: '1'
      Warning	1292	Truncated incorrect datetime value: '1'
      Warning	1292	Truncated incorrect datetime value: '2'
      select * from t1;
      a	b	c	d	e
      2010-10-10 10:10:10	1	0	0	NULL
      Warnings:
      Warning	1292	Truncated incorrect datetime value: '1'
      Warning	1292	Truncated incorrect datetime value: '2'
      Warning	1292	Truncated incorrect datetime value: '1'
      Warning	1292	Truncated incorrect datetime value: '1'
      Warning	1292	Truncated incorrect datetime value: '2'
      

      Expected result:

      select * from t1;
      a	b	c	d	e
      2010-10-10 10:10:10	1	0	0	NULL
      Warnings:
      Warning	1292	Truncated incorrect datetime value: '1'
      Warning	1292	Truncated incorrect datetime value: '1'
      Warning	1292	Truncated incorrect datetime value: '2'
      Warning	1292	Truncated incorrect datetime value: '1'
      Warning	1292	Truncated incorrect datetime value: '1'
      Warning	1292	Truncated incorrect datetime value: '2'
      select * from t1;
      a	b	c	d	e
      2010-10-10 10:10:10	1	0	0	NULL
      Warnings:
      Warning	1292	Truncated incorrect datetime value: '1'
      Warning	1292	Truncated incorrect datetime value: '1'
      Warning	1292	Truncated incorrect datetime value: '2'
      Warning	1292	Truncated incorrect datetime value: '1'
      Warning	1292	Truncated incorrect datetime value: '1'
      Warning	1292	Truncated incorrect datetime value: '2'
      

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              lstartseva Lena Startseva
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.