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

Impossible to execute prepared ANALYZE SELECT

    Details

    • Sprint:
      10.2.5-1

      Description

      It's very easy to repeat the problem

      check_stmt_rc(mysql_stmt_prepare(stmt, "ANALYZE SELECT 1", -1), stmt);
      check_stmt_rc(mysql_stmt_execute(stmt), stmt);

      mysql_stmt_execute fails. The error is
      [HY000] The number of parameters in bound buffers differs from number of columns in resultset(2057)

      Server version I tested against is 10.2.3

      In CLI PREPARE+EXECUTE works fine
      MariaDB [test]> PREPARE analyze_select FROM "ANALYZE SELECT 1";
      Query OK, 0 rows affected (0.00 sec)
      Statement prepared

      MariaDB [test]> EXECUTE analyze_select;
      +------+-------------+-------+------+---------------+------+---------+------+------+--------+----------+------------+----------------+
      | id   | select_type | table | type | possible_keys | key  | key_len | ref  | rows | r_rows | filtered | r_filtered | Extra          |
      +------+-------------+-------+------+---------------+------+---------+------+------+--------+----------+------------+----------------+
      |    1 | SIMPLE      | NULL  | NULL | NULL          | NULL | NULL    | NULL | NULL |   NULL |     NULL |       NULL | No tables used |
      +------+-------------+-------+------+---------------+------+---------+------+------+--------+----------+------------+----------------+
      1 row in set (0.00 sec)
      

      The query can be any, in fact. Unless it has 13 columns, like ANALAYZE output, but then we probably have issue with wrong metadata Yes, it seems that returned metadata is for analyzed query, and not for ANALYZE result itself.

      I am not sure if that is not error in the server. In fact I'd imagine that is more probable

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sanja Oleksandr Byelkin
                Reporter:
                Lawrin Lawrin Novitsky
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: