Bug #91445 runtime error: 1.84467e+19 is outside the range of representable values of type
Submitted: 27 Jun 2018 15:53 Modified: 21 Jul 2018 14:06
Reporter: Tor Didriksen Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:8.0.13 OS:Any
Assigned to: CPU Architecture:Any

[27 Jun 2018 15:53] Tor Didriksen
Description:
libmysql/libmysql.cc:3101:59: runtime error: 1.84467e+19 is outside the range of representable values of type 'unsigned long long'
    #0 0x65dce0 in fetch_long_with_conversion(MYSQL_BIND*, MYSQL_FIELD*, long long, bool) libmysql/libmysql.cc:3101:59
    #1 0x652960 in fetch_result_with_conversion(MYSQL_BIND*, MYSQL_FIELD*, unsigned char**) libmysql/libmysql.cc:3359:7
    #2 0x651b3f in stmt_fetch_row(MYSQL_STMT*, unsigned char*) libmysql/libmysql.cc:3886:7
    #3 0x65146a in mysql_stmt_fetch libmysql/libmysql.cc:3930:14
    #4 0x4ca985 in test_bug3035() testclients/mysql_client_test.cc:9522:8
    #5 0x4a594d in main testclients/mysql_client_fw.cc:1253:52

libmysql/libmysql.cc:3200:37: runtime error: -1.23457e+10 is outside the range of representable values of type 'unsigned long long'
    #0 0x65ece7 in fetch_float_with_conversion(MYSQL_BIND*, MYSQL_FIELD*, double, my_gcvt_arg_type) libmysql/libmysql.cc:3200:37
    #1 0x6528e6 in fetch_result_with_conversion(MYSQL_BIND*, MYSQL_FIELD*, unsigned char**) libmysql/libmysql.cc:3375:7
    #2 0x651b3f in stmt_fetch_row(MYSQL_STMT*, unsigned char*) libmysql/libmysql.cc:3887:7
    #3 0x65146a in mysql_stmt_fetch libmysql/libmysql.cc:3931:14
    #4 0x4d5e54 in test_truncation() testclients/mysql_client_test.cc:11915:8
    #5 0x4a594d in main testclients/mysql_client_fw.cc:1253:52

How to repeat:
build with clang/ubsan
/mtr --mem --sanitize main.mysql_client_test

Suggested fix:
check for overflow
[21 Jul 2018 14:06] Paul Dubois
Posted by developer:
 
Fixed in 8.0.13.

Data truncation testing was rewritten to avoid undefined behavior.