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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.0(EOL)
    • 10.0.36
    • Optimizer
    • 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

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

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.