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

System variable change not recorded in context

    XMLWordPrintable

Details

    • Q3/2026 Server Maintenance

    Description

      Issue:

      -------------
      Setting sql_notes to 0 , disables the warning for explain extended

      So while capturing context ,there is no warnings.
      Since variable change is not recorded in context , Replay shows warnings for explain extended.

      How to repro

      -------------------------

      CREATE TABLE t1 (a int);
      set sql_notes=0;
       
      set optimizer_record_context=ON;
      EXPLAIN SELECT * FROM t1;
      SELECT context INTO DUMPFILE 'context1.txt' FROM INFORMATION_SCHEMA.OPTIMIZER_CONTEXT;
      source context1.txt;
      

      First explain:

      MariaDB [m8]> explain extended select * from t1;
      +------+-------------+-------+------+---------------+------+---------+------+------+----------+-------+
      | id   | select_type | table | type | possible_keys | key  | key_len | ref  | rows | filtered | Extra |
      +------+-------------+-------+------+---------------+------+---------+------+------+----------+-------+
      |    1 | SIMPLE      | t1    | ALL  | NULL          | NULL | NULL    | NULL | 1    |   100.00 |       |
      +------+-------------+-------+------+---------------+------+---------+------+------+----------+-------+
      1 row in set (0.001 sec)
      

      Replay:

      MariaDB [m8]> explain extended select * from t1;
      +------+-------------+-------+------+---------------+------+---------+------+------+----------+-------+
      | id   | select_type | table | type | possible_keys | key  | key_len | ref  | rows | filtered | Extra |
      +------+-------------+-------+------+---------------+------+---------+------+------+----------+-------+
      |    1 | SIMPLE      | t1    | ALL  | NULL          | NULL | NULL    | NULL | 1    |   100.00 |       |
      +------+-------------+-------+------+---------------+------+---------+------+------+----------+-------+
      1 row in set, 1 warning (0.001 sec)
       
      MariaDB [m8]> show warnings;
      +-------+------+--------------------------------------------+
      | Level | Code | Message                                    |
      +-------+------+--------------------------------------------+
      | Note  | 1003 | select `m8`.`t1`.`a` AS `a` from `m8`.`t1` |
      +-------+------+--------------------------------------------+
      1 row in set (0.001 sec)
      

      Attachments

        Issue Links

          Activity

            People

              bsrikanth Srikanth Bondalapati
              mariadb-pavithrapandith Pavithra Pandith
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.