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

negativ zero value with double and float type

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.6.10, 10.3(EOL), 10.4(EOL), 10.5(EOL), 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.11
    • 10.6
    • None
    • None
    • ubuntu 22.04

    Description

      Negativ zero value in result set

      DROP TABLE if EXISTS test;
      CREATE TABLE test(test_data_1  DOUBLE, test_data_2  DOUBLE ) ;
      INSERT  test values( 0 , -5);
       
      SELECT test_data_1, test_data_1 * -5,
      test_data_2, test_data_2 * 0
      FROM test t
      ;
      
      

      +-------------+------------------+-------------+-----------------+
      | test_data_1 | test_data_1 * -5 | test_data_2 | test_data_2 * 0 |
      +-------------+------------------+-------------+-----------------+
      |           0 |               -0 |          -5 |              -0 |
      +-------------+------------------+-------------+-----------------+
      
      

      in simple format:

      SELECT CAST(0 as DOUBLE)*CAST(-5 as signed);
      

      +--------------------------------------+
      | CAST(0 as DOUBLE)*CAST(-5 as signed) |
      +--------------------------------------+
      |                                   -0 |
      +--------------------------------------+
      
      

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            bulepage bulepage
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.