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

Incorrect JSON_HB histogram is generated

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.8.3, 12.0(EOL)
    • N/A
    • Optimizer
    • None
    • Can result in unexpected behaviour

    Description

      Consider a small dataset. An apparently incorrect histogram is generated for it.

      create table t1 (
        col1 varchar(10) 
      );
       
      insert into t1 values 
      ('"а'),('"b'),('"c'),('"d'),('"e'),('"f'),('"g'),('"h'),('"i'),('"j');
      select sin(0);
      analyze table t1 persistent for all;
      select * from mysql.column_stats;
       
      drop table t1;
      

      gives:

        "histogram_hb": [
          {
            "start": "\"b",
            "size": 0.1,
            "ndv": 1
          },
          {
            "start": "\"c",
            "size": 0.1,
            "ndv": 1
          },
          {
            "start": "\"d",
            "size": 0.1,
            "ndv": 1
          },
          {
            "start": "\"а",
            "size": 0.1,
            "ndv": 1
          },
          {
            "start": "\"e",
            "size": 0.1,
            "ndv": 1
          },
      

      note the bucket between "d and "e. It looks like garbage data. Some character that's not present in the table.

      Attachments

        Activity

          People

            Unassigned Unassigned
            psergei Sergei Petrunia
            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.