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

Unexpected behavior in REPEAT functions.

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 11.4.2
    • N/A
    • N/A
    • None
    • ubuntu 20.04

    Description

       
      drop table if exists t1;
      create table t1 (vkey int, pkey int);
       
      insert into t1 values (5, 15000);
      insert into t1 values (28, 38000);
       
       
      select (REPEAT(REPEAT(case when false then ('o#W4O') else ('o#W4O') end , ref_0.vkey), ref_0.pkey)) >= 'i'  as c_0 from t1 as ref_0;
      +------+
      | c_0  |
      +------+
      |    1 |
      |    1 |
      +------+
      2 rows in set (0.00 sec)
       
      select  *   from  t1 as ref_0
      where (REPEAT(REPEAT(case when false then ('o#W4O') else ('o#W4O') end , ref_0.vkey), ref_0.pkey)) >= 'i';
      +------+-------+
      | vkey | pkey  |
      +------+-------+
      |    5 | 15000 |
      +------+-------+
      1 row in set, 1 warning (0.00 sec)
       
      
      

      The result of the first SELECT SQL is the content of the WHERE clause in the second SELECT SQL, and the results returned are 1 and 1. Therefore, the query result of the second statement should have two rows. There seems to be some kind of bug.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Wangdada HeShan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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