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

Failed to parse saved optimizer context: error reading ranges value

    XMLWordPrintable

Details

    • Can result in unexpected behaviour
    • Q3/2026 Server Maintenance

    Description

      This is from index_merge_myisam.test

      set default_storage_engine=myisam;
      CREATE TABLE t1(a VARCHAR(128),b VARCHAR(128),KEY(A),KEY(B));
      INSERT INTO t1 SELECT REPEAT('a',128),REPEAT('b',128) FROM seq_1_to_64;
      SET SESSION sort_buffer_size=1024*8;
      

      set optimizer_record_context=1;
      EXPLAIN 
      SELECT * FROM t1 FORCE INDEX(a,b) WHERE a LIKE 'a%' OR b LIKE 'b%' 
      ORDER BY a,b;
      select context into dumpfile '/tmp/1.sql' from information_schema.optimizer_context;
      source /tmp/1.sql
      

      +------+-------------+-------+-------------+---------------+------+---------+------+------+----------------------------------------------------+
      | id   | select_type | table | type        | possible_keys | key  | key_len | ref  | rows | Extra                                              |
      +------+-------------+-------+-------------+---------------+------+---------+------+------+----------------------------------------------------+
      |    1 | SIMPLE      | t1    | index_merge | a,b           | a,b  | 515,515 | NULL | 64   | Using sort_union(a,b); Using where; Using filesort |
      +------+-------------+-------+-------------+---------------+------+---------+------+------+----------------------------------------------------+
      

      +------+-------------+-------+------+---------------+------+---------+------+------+-----------------------------------------------------+
      | id   | select_type | table | type | possible_keys | key  | key_len | ref  | rows | Extra                                               |
      +------+-------------+-------+------+---------------+------+---------+------+------+-----------------------------------------------------+
      |    1 | SIMPLE      | NULL  | NULL | NULL          | NULL | NULL    | NULL | NULL | Impossible WHERE noticed after reading const tables |
      +------+-------------+-------+------+---------------+------+---------+------+------+-----------------------------------------------------+
      1 row in set, 1 warning (0.001 sec)
       
      Warning (Code 4253): Failed to parse saved optimizer context: error reading ranges value at offset 465.
      Query OK, 0 rows affected (0.000 sec)
      

      Attachments

        Issue Links

          Activity

            People

              bsrikanth Srikanth Bondalapati
              psergei Sergei Petrunia
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.