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

SHOW RELAYLOG EVENTS command is not supported in the prepared statement protocol yet

Details

    Description

      Test File: show_relay_log_ps.test
      SHOW RELAYLOG EVENTS;

      ./mtr --ps-protocol show_relay_log_ps.test

      MariaDB Version 10.2.35-MariaDB-debug
       - SSL connections supported
       - binaries are debug compiled
       - binaries built with wsrep patch
      Collecting tests...
      Installing system database...
       
      ==============================================================================
       
      TEST                                      RESULT   TIME (ms) or COMMENT
      --------------------------------------------------------------------------
       
      worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
      SHOW RELAYLOG EVENTS;
      main.show_relay_log_ps                   [ fail ]
              Test ended at 2020-11-13 19:32:28
       
      CURRENT_TEST: main.show_relay_log_ps
      mysqltest: At line 1: query 'SHOW RELAYLOG EVENTS' failed: 1295: This command is not supported in the prepared statement protocol yet
      

      Attachments

        Activity

          Perhaps it needs just

          diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
          --- a/sql/sql_prepare.cc
          +++ b/sql/sql_prepare.cc
          @@ -2369,6 +2369,14 @@ static bool check_prepared_statement(Prepared_statement >
                 DBUG_RETURN(FALSE);
               }
               break;
          +  case SQLCOM_SHOW_BINLOG_EVENTS:
          +  case SQLCOM_SHOW_RELAYLOG_EVENTS:
          +    {
          +      List<Item> field_list;
          +      Log_event::init_show_field_list(thd, &field_list);
          +      if ((res= send_stmt_metadata(thd, stmt, &field_list)) == 2)
          +        DBUG_RETURN(FALSE);
          +    }
           #endif /* EMBEDDED_LIBRARY */
             case SQLCOM_SHOW_CREATE_PROC:
               if ((res= mysql_test_show_create_routine(stmt, &sp_handler_procedure)) == >
          

          serg Sergei Golubchik added a comment - Perhaps it needs just diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -2369,6 +2369,14 @@ static bool check_prepared_statement(Prepared_statement > DBUG_RETURN(FALSE); } break; + case SQLCOM_SHOW_BINLOG_EVENTS: + case SQLCOM_SHOW_RELAYLOG_EVENTS: + { + List<Item> field_list; + Log_event::init_show_field_list(thd, &field_list); + if ((res= send_stmt_metadata(thd, stmt, &field_list)) == 2) + DBUG_RETURN(FALSE); + } #endif /* EMBEDDED_LIBRARY */ case SQLCOM_SHOW_CREATE_PROC: if ((res= mysql_test_show_create_routine(stmt, &sp_handler_procedure)) == >
          serg Sergei Golubchik added a comment - - edited

          after fixing this, please also remove --disable_ps_protocol and --enable_ps_protocol around SHOW RELAYLOG EVENTS in various test files.

          serg Sergei Golubchik added a comment - - edited after fixing this, please also remove --disable_ps_protocol and --enable_ps_protocol around SHOW RELAYLOG EVENTS in various test files.

          Generally OK (I'd make "test" function but also can live with the block in case).

          But I think test shoud be added:
          1) it shoud return something on execution and re-execution
          2) test that the command fail in PS if user has no REPL_SLAVE_ACL

          sanja Oleksandr Byelkin added a comment - Generally OK (I'd make "test" function but also can live with the block in case). But I think test shoud be added: 1) it shoud return something on execution and re-execution 2) test that the command fail in PS if user has no REPL_SLAVE_ACL

          OK to push!

          sanja Oleksandr Byelkin added a comment - OK to push!

          People

            shulga Dmitry Shulga
            sujatha.sivakumar Sujatha Sivakumar (Inactive)
            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.