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

Spider tests with view protocol fail with "Failed to drop view: 0: "

Details

    Description

      At the current custom branch for MDEV-35452 bb-10.5-mdev-35452 263709cafe50ce6e10c90fc4ab8b21640dd94bc8, the following tests fail with "Failed to drop view: 0: ":

      • spider/bugfix.mdev_21884
      • spider/bugfix.mdev_20100
      • spider/regression/e1121.direct_join_by_pkey_key
      • spider/regression/e1121.direct_join_by_pkey_pkey

      For example

      spider/bugfix.mdev_21884                 w3 [ fail ]
              Test ended at 2025-04-04 10:32:45
       
      CURRENT_TEST: spider/bugfix.mdev_21884
      mysqltest: At line 90: Failed to drop view: 0: 
       
      The result from queries just before the failure was:
      < snip >
      test 1
      connection child2_1;
      TRUNCATE TABLE mysql.general_log;
      connection master_1;
      SELECT STRAIGHT_JOIN b.a, b.b FROM tb_l a, tbl_a b WHERE a.a = b.a;
      a	b
      11	a
      11	b
      12	d
      12	e
      13	c
      connection child2_1;
      SET NAMES utf8;
      SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %';
      argument
      select `a`,`b` from `auto_test_remote`.`ta_r2` order by `a`,`b`
      select `a`,`b` from `auto_test_remote`.`ta_r3` order by `a`,`b`
      SELECT argument FROM mysql.general_log WHERE argument LIKE '%select %'
      SELECT a, b, c FROM ta_r2 ORDER BY a ;
      SELECT a, b, c FROM ta_r3 ORDER BY a;
       
      More results from queries before failure can be found in /home/ycp/source/mariadb-server/10.5/build/mysql-test/var/3/log/mdev_21884.log
      

      See also https://jira.mariadb.org/browse/MDEV-36442?focusedCommentId=302572&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-302572.

      Attachments

        Issue Links

          Activity

            ycp Yuchen Pei added a comment -

            For spider/bugfix.mdeiv_21884 it is because the statement $CHILD2_1_SELECT_TABLES is actually two statements:

            // mdev_21884_init.inc
            let $CHILD2_1_SELECT_TABLES=
              SELECT a, b, c FROM ta_r2 ORDER BY a $STR_SEMICOLON
              SELECT a, b, c FROM ta_r3 ORDER BY a;

            Note $STR_SEMICOLON is a way to "escape" a semicolon here. mtr --view-protocol transforms exec $CHILD2_1_SELECT_TABLES into

            CREATE OR REPLACE VIEW mysqltest_tmp_v AS SELECT a, b, c FROM ta_r2 ORDER BY a ;
            SELECT a, b, c FROM ta_r3 ORDER BY a;
            SELECT * FROM mysqltest_tmp_v;
            DROP VIEW mysqltest_tmp_v;

            The DROP VIEW statement failed because mtr missed reading the result of one statement, expecting the CREATE OR REPLACE VIEW... to expand to one statement only. To see this, run mtr with --client-rr then place a breakpoint inside the following if branch, upon hitting the breakpoint print mysql->server_status & SERVER_MORE_RESULTS_EXIST:

            // mthd_my_send_cmd:
              if (mysql->status != MYSQL_STATUS_READY ||
                  mysql->server_status & SERVER_MORE_RESULTS_EXIST)
              {
                SET_CLIENT_ERROR(mysql, CR_COMMANDS_OUT_OF_SYNC, SQLSTATE_UNKNOWN, 0);
                goto end;
              }

            It is really an oddity in the spider testcase, and should be fixed with --disable-view-protocol.

            ycp Yuchen Pei added a comment - For spider/bugfix.mdeiv_21884 it is because the statement $CHILD2_1_SELECT_TABLES is actually two statements: // mdev_21884_init.inc let $CHILD2_1_SELECT_TABLES= SELECT a, b, c FROM ta_r2 ORDER BY a $STR_SEMICOLON SELECT a, b, c FROM ta_r3 ORDER BY a; Note $STR_SEMICOLON is a way to "escape" a semicolon here. mtr --view-protocol transforms exec $CHILD2_1_SELECT_TABLES into CREATE OR REPLACE VIEW mysqltest_tmp_v AS SELECT a, b, c FROM ta_r2 ORDER BY a ; SELECT a, b, c FROM ta_r3 ORDER BY a; SELECT * FROM mysqltest_tmp_v; DROP VIEW mysqltest_tmp_v; The DROP VIEW statement failed because mtr missed reading the result of one statement, expecting the CREATE OR REPLACE VIEW... to expand to one statement only. To see this, run mtr with --client-rr then place a breakpoint inside the following if branch, upon hitting the breakpoint print mysql->server_status & SERVER_MORE_RESULTS_EXIST : // mthd_my_send_cmd: if (mysql->status != MYSQL_STATUS_READY || mysql->server_status & SERVER_MORE_RESULTS_EXIST) { SET_CLIENT_ERROR(mysql, CR_COMMANDS_OUT_OF_SYNC, SQLSTATE_UNKNOWN, 0); goto end; } It is really an oddity in the spider testcase, and should be fixed with --disable-view-protocol .
            ycp Yuchen Pei added a comment -

            Hi holyfoot, ptal thanks:

            d27e014e3ce upstream/bb-10.5-mdev-36477 MDEV-36477 MDEV-35452 Fix Spider tests with view protocol fail with "Failed to drop view: 0: "
            

            ycp Yuchen Pei added a comment - Hi holyfoot , ptal thanks: d27e014e3ce upstream/bb-10.5-mdev-36477 MDEV-36477 MDEV-35452 Fix Spider tests with view protocol fail with "Failed to drop view: 0: "
            holyfoot Alexey Botchkov added a comment -

            ok to push.

            Thought if we should regroup selects to have just one -disable/-enable_view_protocol.
            But let's keep that as it was better

            holyfoot Alexey Botchkov added a comment - ok to push. Thought if we should regroup selects to have just one - disable/ -enable_view_protocol. But let's keep that as it was better

            People

              ycp Yuchen Pei
              ycp Yuchen Pei
              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.