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

type_test.type_test_double fails with 'NUMERIC_SCALE NULL'

Details

    Description

      Noticed in http://buildbot.askmonty.org/buildbot/builders/kvm-deb-bionic-amd64/builds/4415/steps/mtr/logs/stdio:

      type_test.type_test_double               w4 [ fail ]
              Test ended at 2020-04-14 08:20:04
       
      CURRENT_TEST: type_test.type_test_double
      --- /usr/share/mysql/mysql-test/plugin/type_test/type_test/type_test_double.result	2020-04-14 05:32:13.000000000 -0400
      +++ /dev/shm/var/4/log/type_test_double.reject	2020-04-14 08:20:04.455194071 -0400
      @@ -290,7 +290,7 @@
       CHARACTER_MAXIMUM_LENGTH	NULL
       CHARACTER_OCTET_LENGTH	NULL
       NUMERIC_PRECISION	22
      -NUMERIC_SCALE	31
      +NUMERIC_SCALE	NULL
       DATETIME_PRECISION	NULL
       CHARACTER_SET_NAME	NULL
       COLLATION_NAME	NULL
       
      mysqltest: Result length mismatch
      

      On current 10.5 master this test is not at all visible (e.g. http://buildbot.askmonty.org/buildbot/builders/kvm-deb-bionic-amd64/builds/4413/steps/mtr/logs/stdio) because Debian packaging was omitting usr/lib/mysql/plugin/type_test.so and this test did simply not run before.

      Attachments

        Activity

          otto Otto Kekäläinen created issue -
          serg Sergei Golubchik made changes -
          Field Original Value New Value
          Assignee Alexander Barkov [ bar ]

          The PR https://github.com/MariaDB/server/pull/1506 will be pending until this is fixed.

          otto Otto Kekäläinen added a comment - The PR https://github.com/MariaDB/server/pull/1506 will be pending until this is fixed.
          cvicentiu Vicențiu Ciorbaru made changes -
          Assignee Alexander Barkov [ bar ] Robert Bindar [ robertbindar ]

          Investigation so far:

          This is reproducible in a docker container with ubuntu:bionic, compile with debian/autobake-dev.sh.

          The value of NULL/31 comes from sql/sql_show.cc:5722

            Information_schema_numeric_attributes num=
              field->information_schema_numeric_attributes();
          

          More specifically from Field_real::information_schema_numeric_attributes:

              information_schema_numeric_attributes() const override
            {
              return dec == NOT_FIXED_DEC ?
                            Information_schema_numeric_attributes(field_length) :
                            Information_schema_numeric_attributes(field_length, dec);
            }
          

          If one looks at NOT_FIXED_DEC, it is defined in my_global.h as:

          #define FLOATING_POINT_DECIMALS 31
           
          /* Keep client compatible with earlier versions */
          #ifdef MYSQL_SERVER
          #define NOT_FIXED_DEC           DECIMAL_NOT_SPECIFIED
          #else
          #define NOT_FIXED_DEC           FLOATING_POINT_DECIMALS
          #endif
          #endif /* my_global_h */
          

          Some background about this switch provided by serg:
          because NOT_FIXED_DEC used to be 31, and was stored in 5 bits. And it affects both the server and clients. When Monty made it 39 in the server, he kepts the backward compatible define for clients to not change the client-server api

          The difference in test results is because in one case NOT_FIXED_DEC is set to DECIMAL_NOT_SPECIFIED, while during debian compilation it's set to FLOATING_POINT_DECIMALS, which happens to equal the actual precision of 31 that the field's "dec" variable is set to.

          The test failure can be resolved by doing a #define MYSQL_SERVER in plugin/type_test/plugin.cc right before my_global.h include. This can't possible be correct as we're building a plugin, not the server. However it is unclear why during a build that does not involve debian packaging, the MYSQL_SERVER flag seems to be set to true when compiling this plugin.

          cvicentiu Vicențiu Ciorbaru added a comment - Investigation so far: This is reproducible in a docker container with ubuntu:bionic, compile with debian/autobake-dev.sh . The value of NULL/31 comes from sql/sql_show.cc:5722 Information_schema_numeric_attributes num= field->information_schema_numeric_attributes(); More specifically from Field_real::information_schema_numeric_attributes: information_schema_numeric_attributes() const override { return dec == NOT_FIXED_DEC ? Information_schema_numeric_attributes(field_length) : Information_schema_numeric_attributes(field_length, dec); } If one looks at NOT_FIXED_DEC, it is defined in my_global.h as: #define FLOATING_POINT_DECIMALS 31   /* Keep client compatible with earlier versions */ #ifdef MYSQL_SERVER #define NOT_FIXED_DEC DECIMAL_NOT_SPECIFIED #else #define NOT_FIXED_DEC FLOATING_POINT_DECIMALS #endif #endif /* my_global_h */ Some background about this switch provided by serg : because NOT_FIXED_DEC used to be 31, and was stored in 5 bits. And it affects both the server and clients. When Monty made it 39 in the server, he kepts the backward compatible define for clients to not change the client-server api The difference in test results is because in one case NOT_FIXED_DEC is set to DECIMAL_NOT_SPECIFIED, while during debian compilation it's set to FLOATING_POINT_DECIMALS, which happens to equal the actual precision of 31 that the field's "dec" variable is set to. The test failure can be resolved by doing a #define MYSQL_SERVER in plugin/type_test/plugin.cc right before my_global.h include. This can't possible be correct as we're building a plugin, not the server. However it is unclear why during a build that does not involve debian packaging, the MYSQL_SERVER flag seems to be set to true when compiling this plugin.
          serg Sergei Golubchik made changes -
          Fix Version/s 10.5 [ 23123 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 107131 ] MariaDB v4 [ 141883 ]
          danblack Daniel Black made changes -
          Assignee Robert Bindar [ robertbindar ]

          This test is still failing..

          type_test.type_test_double               w4 [ fail ]
                  Test ended at 2023-03-19 06:51:56
           
          CURRENT_TEST: type_test.type_test_double
          --- /<<PKGBUILDDIR>>/plugin/type_test/mysql-test/type_test/type_test_double.result	2021-06-18 13:08:00.000000000 +0000
          +++ /<<PKGBUILDDIR>>/plugin/type_test/mysql-test/type_test/type_test_double.reject	2023-03-19 06:51:56.632819620 +0000
          @@ -290,7 +290,7 @@
           CHARACTER_MAXIMUM_LENGTH	NULL
           CHARACTER_OCTET_LENGTH	NULL
           NUMERIC_PRECISION	22
          -NUMERIC_SCALE	31
          +NUMERIC_SCALE	NULL
           DATETIME_PRECISION	NULL
           CHARACTER_SET_NAME	NULL
           COLLATION_NAME	NULL
           
          mysqltest: Result length mismatch
          

          Full log at https://launchpadlibrarian.net/656603148/buildlog_ubuntu-lunar-amd64.mariadb_1%3A11.0.0~ubuntu23.04.1~1679205078.756e48c615d.ok.10.5.type.test_BUILDING.txt.gz

          otto Otto Kekäläinen added a comment - This test is still failing.. type_test.type_test_double w4 [ fail ] Test ended at 2023-03-19 06:51:56   CURRENT_TEST: type_test.type_test_double --- /<<PKGBUILDDIR>>/plugin/type_test/mysql-test/type_test/type_test_double.result 2021-06-18 13:08:00.000000000 +0000 +++ /<<PKGBUILDDIR>>/plugin/type_test/mysql-test/type_test/type_test_double.reject 2023-03-19 06:51:56.632819620 +0000 @@ -290,7 +290,7 @@ CHARACTER_MAXIMUM_LENGTH NULL CHARACTER_OCTET_LENGTH NULL NUMERIC_PRECISION 22 -NUMERIC_SCALE 31 +NUMERIC_SCALE NULL DATETIME_PRECISION NULL CHARACTER_SET_NAME NULL COLLATION_NAME NULL   mysqltest: Result length mismatch Full log at https://launchpadlibrarian.net/656603148/buildlog_ubuntu-lunar-amd64.mariadb_1%3A11.0.0~ubuntu23.04.1~1679205078.756e48c615d.ok.10.5.type.test_BUILDING.txt.gz
          otto Otto Kekäläinen made changes -
          Affects Version/s 11.0 [ 28320 ]

          Manually tested on Ubuntu 20.04, and the test passed:

              ~/github/MariaDB/build-mariadb/mysql-test$ ./mariadb-test-run.pl /.../github/MariaDB/server/plugin/type_test/mysql-test/type_test/type_test_double.test
              Logging: /.../github/MariaDB/server/mysql-test/mariadb-test-run.pl  /.../github/MariaDB/server/plugin/type_test/mysql-test/type_test/type_test_double.test
              VS config: 
              vardir: /.../github/MariaDB/build-mariadb/mysql-test/var
              Removing old var directory...
              Creating var directory '/.../github/MariaDB/build-mariadb/mysql-test/var'...
              Checking supported features...
              MariaDB Version 11.1.0-MariaDB-debug
               - SSL connections supported
               - binaries are debug compiled
               - binaries built with wsrep patch
              Collecting tests...
              Installing system database...
               
              ==============================================================================
               
              TEST                                      RESULT   TIME (ms) or COMMENT
              --------------------------------------------------------------------------
               
              worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
              type_test.type_test_double               [ pass ]    120
              --------------------------------------------------------------------------
              The servers were restarted 0 times
              Spent 0.120 of 6 seconds executing testcases
               
              Completed: All 1 tests were successful.
          

          nickothieno Nicholas Othieno added a comment - Manually tested on Ubuntu 20.04, and the test passed: ~ /github/MariaDB/build-mariadb/mysql-test $ . /mariadb-test-run .pl /... /github/MariaDB/server/plugin/type_test/mysql-test/type_test/type_test_double . test Logging: /... /github/MariaDB/server/mysql-test/mariadb-test-run .pl /... /github/MariaDB/server/plugin/type_test/mysql-test/type_test/type_test_double . test VS config: vardir: /... /github/MariaDB/build-mariadb/mysql-test/var Removing old var directory... Creating var directory '/.../github/MariaDB/build-mariadb/mysql-test/var' ... Checking supported features... MariaDB Version 11.1.0-MariaDB-debug - SSL connections supported - binaries are debug compiled - binaries built with wsrep patch Collecting tests... Installing system database... ============================================================================== TEST RESULT TIME (ms) or COMMENT -------------------------------------------------------------------------- worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019 type_test.type_test_double [ pass ] 120 -------------------------------------------------------------------------- The servers were restarted 0 times Spent 0.120 of 6 seconds executing testcases Completed: All 1 tests were successful.
          nickothieno Nicholas Othieno added a comment - - edited

          Debian CI build log shows that the test runs and that it is passing.

          Source: https://buildbot.mariadb.org/#/builders/35/builds/24954/steps/7/logs/stdio

          worker[10] > Restart [mysqld.1 - pid: 234377, winpid: 234377] - running with different options '--query-cache-size=1355776' != '--plugin-load-add= --plugin-user-variables=ON'                                     
          innodb.create_table_insert_skip_locked 'innodb' w6 [ pass ]      8                                                                                                                                                 
          type_test.type_test_double               w4 [ pass ]    119                <------ Test ran and passed!!                                                                                                                                        
          main.plugin_maturity                     w1 [ pass ]     17
          

          nickothieno Nicholas Othieno added a comment - - edited Debian CI build log shows that the test runs and that it is passing. Source: https://buildbot.mariadb.org/#/builders/35/builds/24954/steps/7/logs/stdio worker[10] > Restart [mysqld.1 - pid: 234377, winpid: 234377] - running with different options '--query-cache-size=1355776' != '--plugin-load-add= --plugin-user-variables=ON' innodb.create_table_insert_skip_locked 'innodb' w6 [ pass ] 8 type_test.type_test_double w4 [ pass ] 119 <------ Test ran and passed!! main.plugin_maturity w1 [ pass ] 17

          I confirm that the test is now passing on buildbot.mariadb.org, e.g. https://buildbot.mariadb.org/#/builders/534/builds/8085/steps/7/logs/stdio

          type_test.type_test_double               w7 [ pass ]    239
          

          otto Otto Kekäläinen added a comment - I confirm that the test is now passing on buildbot.mariadb.org, e.g. https://buildbot.mariadb.org/#/builders/534/builds/8085/steps/7/logs/stdio type_test.type_test_double w7 [ pass ] 239
          TheLinuxJedi Andrew Hutchings (Inactive) made changes -
          Fix Version/s 11.3 [ 28565 ]
          Fix Version/s 10.5 [ 23123 ]

          otto, so shall https://github.com/MariaDB/server/pull/1506 be merged and this MDEV closed?

          serg Sergei Golubchik added a comment - otto , so shall https://github.com/MariaDB/server/pull/1506 be merged and this MDEV closed?
          otto Otto Kekäläinen made changes -
          Assignee Otto Kekäläinen [ otto ]
          otto Otto Kekäläinen made changes -
          Fix Version/s 11.3.0 [ 29302 ]
          Fix Version/s 11.3 [ 28565 ]

          PR https://github.com/MariaDB/server/pull/1506 was merged yesterday, thus going into version 11.3.0.

          otto Otto Kekäläinen added a comment - PR https://github.com/MariaDB/server/pull/1506 was merged yesterday, thus going into version 11.3.0.
          otto Otto Kekäläinen made changes -
          Component/s Tests [ 10800 ]
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]

          After re-enabling the test if still fails with the exact same error on all tested architectures at https://launchpad.net/~otto/+archive/ubuntu/mariadb/+builds?build_text=&build_state=all

          otto Otto Kekäläinen added a comment - After re-enabling the test if still fails with the exact same error on all tested architectures at https://launchpad.net/~otto/+archive/ubuntu/mariadb/+builds?build_text=&build_state=all
          otto Otto Kekäläinen made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Stalled [ 10000 ]
          otto Otto Kekäläinen made changes -
          Fix Version/s 11.3.0 [ 29302 ]
          monty Michael Widenius made changes -
          Assignee Otto Kekäläinen [ otto ] Michael Widenius [ monty ]
          monty Michael Widenius made changes -
          Fix Version/s 10.6 [ 24028 ]
          monty Michael Widenius made changes -
          Status Stalled [ 10000 ] In Progress [ 3 ]

          There where several reasons why the test failed:

          • Constructors for Field_double and Field_float changed an argument
            to the constructor instead of a the correct class variable.
          • gcc 7.5.0 produced wrong code when inlining Field_double constructor
            into Field_test_double constructor.

          Fixed by changing the correct class variable and make the constructors
          not inline to go around the gcc bug.

          monty Michael Widenius added a comment - There where several reasons why the test failed: Constructors for Field_double and Field_float changed an argument to the constructor instead of a the correct class variable. gcc 7.5.0 produced wrong code when inlining Field_double constructor into Field_test_double constructor. Fixed by changing the correct class variable and make the constructors not inline to go around the gcc bug.
          monty Michael Widenius made changes -
          issue.field.resolutiondate 2023-10-09 00:14:07.0 2023-10-09 00:14:06.996
          monty Michael Widenius made changes -
          Fix Version/s 10.5.23 [ 29012 ]
          Fix Version/s 10.6 [ 24028 ]
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Closed [ 6 ]

          I confirm https://github.com/MariaDB/server/commit/9d19b6526917c94ca03ef1b4c57152882b192cfe fixed this test failure - it is no longer visible on any of my test builds on Launchpad.

          otto Otto Kekäläinen added a comment - I confirm https://github.com/MariaDB/server/commit/9d19b6526917c94ca03ef1b4c57152882b192cfe fixed this test failure - it is no longer visible on any of my test builds on Launchpad.
          julien.fritsch Julien Fritsch made changes -
          Fix Version/s 10.6.16 [ 29014 ]
          Fix Version/s 10.10.7 [ 29018 ]
          Fix Version/s 10.11.6 [ 29020 ]
          Fix Version/s 11.0.4 [ 29021 ]
          Fix Version/s 11.1.3 [ 29023 ]
          Fix Version/s 11.2.2 [ 29035 ]

          People

            monty Michael Widenius
            otto Otto Kekäläinen
            Votes:
            0 Vote for this issue
            Watchers:
            6 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.