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.
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.
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.
type_test.type_test_double w4 [ pass ] 119 <------ Test ran and passed!!
main.plugin_maturity w1 [ pass ] 17
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
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
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
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.
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.
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.
The PR https://github.com/MariaDB/server/pull/1506 will be pending until this is fixed.