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

CEILING function returns inconsistent results based on sql_buffer_result setting

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 11.6.2, 10.5, 10.6, 10.11, 11.4
    • 10.5, 10.6, 10.11, 11.4, 11.7
    • None
    • None

    Description

      Description

      Executing SELECT CEILING(t.c) on a table with a large DOUBLE value returns different results depending on the sql_buffer_result session variable. When sql_buffer_result is set to OFF, the correct value is returned. When set to ON, an incorrect value is returned.

      Steps to Reproduce

      1. Create Table and Insert Value:

      CREATE TABLE t(c DOUBLE);
      INSERT INTO t VALUES (863006000000000000);
      

      2. Set sql_buffer_result to OFF and Query:

      SET SESSION sql_buffer_result = OFF;
      SELECT CEILING(t.c) FROM t;
      

      Result: 863006000000000000

      3. Set sql_buffer_result to ON and Query:

      SET SESSION sql_buffer_result = ON;
      SELECT CEILING(t.c) FROM t;
      

      Result: 100000000000000000

      Attachments

        Activity

          People

            bar Alexander Barkov
            draco Long Gu
            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.