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

"ANALYZE SELECT ... INTO @var" doesn't set @var

    XMLWordPrintable

    Details

      Description

      create table t1 (i int);
      insert into t1 values (1);

      ANALYZE SELECT ... INTO @var will not set @var:

      analyze select * from t1 into @var;
      +------+-------------+-------+------+---------------+------+---------+------+------+--------+----------+------------+-------+
      | id   | select_type | table | type | possible_keys | key  | key_len | ref  | rows | r_rows | filtered | r_filtered | Extra |
      +------+-------------+-------+------+---------------+------+---------+------+------+--------+----------+------------+-------+
      |    1 | SIMPLE      | t1    | ALL  | NULL          | NULL | NULL    | NULL |    1 |      1 |   100.00 |     100.00 |       |
      +------+-------------+-------+------+---------------+------+---------+------+------+--------+----------+------------+-------+
      1 row in set (0.00 sec)
       
      MariaDB [j14]> select @var;
      +------+
      | @var |
      +------+
      | NULL |
      +------+
      1 row in set (0.00 sec)

      If we assume that ANALYZE $stmt should make the action specified by $stmt, then @var should be set.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              psergey Sergei Petrunia
              Reporter:
              psergey Sergei Petrunia
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: