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

RELEASE_LOCK return NULL in the definition of the view if select statement has GROUP BY

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL)
    • 10.11
    • None

    Description

      If the definition of the view has select statement with RELEASE_LOCK and GROUP BY than RELEASE_LOCK return NULL.

      Test:

      CREATE TABLE t1 (i INT);
      INSERT INTO t1 VALUES (1),(2);
       
      SELECT GET_LOCK( 'foo', 0 );
      CREATE VIEW v1 as SELECT HEX( RELEASE_LOCK( 'foo' ) ) AS f FROM t1 GROUP BY f ;
      SELECT * FROM v1;
       
      DROP VIEW v1;
      DROP TABLE t1;
      

      Actual result:

      SELECT GET_LOCK( 'foo', 0 );
      GET_LOCK( 'foo', 0 )
      1
      CREATE VIEW v1 as SELECT HEX( RELEASE_LOCK( 'foo' ) ) AS f FROM t1 GROUP BY f ;
      SELECT * FROM v1;
      f
      NULL
      NULL
      

      Expected result:

      SELECT GET_LOCK( 'foo', 0 );
      GET_LOCK( 'foo', 0 )
      1
      CREATE VIEW v1 as SELECT HEX( RELEASE_LOCK( 'foo' ) ) AS f FROM t1 GROUP BY f ;
      SELECT * FROM v1;
      f
      NULL
      1
      

      Without GROUP BY result is correct:

      SELECT GET_LOCK( 'foo', 0 );
      GET_LOCK( 'foo', 0 )
      1
      CREATE VIEW v1 as SELECT HEX( RELEASE_LOCK( 'foo' ) ) AS f FROM t1 ;
      SELECT * FROM v1;
      f
      1
      NULL
      

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              lstartseva Lena Startseva
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.