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

Memory leak after adding manually min/max statistical data for blob column

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.0
    • Fix Version/s: 10.0.36
    • Component/s: Optimizer
    • Labels:
      None

      Description

      ANALYZE TABLE t1 does not collect statistical data on min/max values for BLOB columns of table t1. However these values can be added manually into mysql.column_stats.
      If we do this we observe a memory leak after running any query over table t1 when
      use_stat_tables is set to 'PREFERABLY'.
      The following test case demonstrates the problem:

      SET use_stat_tables= PREFERABLY;
       
      CREATE TABLE t1 (pk INT PRIMARY KEY, t TEXT);
      INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
      ANALYZE TABLE t1;
      SELECT * FROM mysql.column_stats;
      DELETE FROM mysql.column_stats
        WHERE db_name='test' AND table_name='t1' AND column_name='t';
      INSERT INTO mysql.column_stats VALUES
        ('test','t1','t','bar','foo', 0.0, 3.0, 1.0, 0, NULL, NULL);
      SELECT * FROM mysql.column_stats;
       
      SELECT pk FROM t1;
       
      DROP TABLE t1;
      

      After running this test in mtr we see

      Warning:    8 bytes lost at 0x7f343402b560, allocated by T@0 at 0x70fe0b, 0x5c83d1, 0x84b4a7, 0x70dc99, 0x709657, 0x70a212, 0x613302, 0x6074f1
      Warning:    8 bytes lost at 0x7f343407e7a0, allocated by T@0 at 0x70fe0b, 0x5c83d1, 0x84b4a7, 0x70dbef, 0x709657, 0x70a212, 0x613302, 0x6074f1
      

        Attachments

          Activity

            People

            • Assignee:
              igor Igor Babaev
              Reporter:
              igor Igor Babaev
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: