Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-730

cross engine join query select on decimal bad precision/scale

    XMLWordPrintable

Details

    • 2017-11

    Description

      This is a minimal test case to reproduce the behavior:

      CREATE TABLE employees (
        `id` INT NOT NULL,
        `name` VARCHAR(255) NOT NULL
      ) ENGINE=Columnstore;
       
      CREATE TABLE roles (
        `employee_id` INT NOT NULL,
        `role` VARCHAR(255) NOT NULL,
        `salary` DECIMAL(12,8) NOT NULL DEFAULT '9.9'
      ) ENGINE=InnoDB;
       
      INSERT INTO employees (`id`, `name`) VALUES (1, 'John'), (2, 'Mary');
      INSERT INTO roles (`employee_id`, `role`, `salary`) VALUES (1, 'Programmer', 3.33), (2, 'DBA', 4.57);
       
      -- Correct result. Show 2 rows with values 3.33 and 4.57
      SELECT * FROM roles;
       
      -- Incorrect result. Both salaries are 9.90000000 (which is the default value for the column)
      SELECT name, salary FROM employees JOIN roles on employees.id = roles.employee_id;
      

      Attachments

        Issue Links

          Activity

            People

              dleeyh Daniel Lee (Inactive)
              dthompson David Thompson (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.