diff --git a/libmariadb/ma_stmt_codec.c b/libmariadb/ma_stmt_codec.c index a91358df..bbb5743b 100644 --- a/libmariadb/ma_stmt_codec.c +++ b/libmariadb/ma_stmt_codec.c @@ -260,7 +260,10 @@ my_bool str_to_TIME(const char *str, size_t length, MYSQL_TIME *tm) goto error; /* conc-371 */ if (frac_len < 6) - tm->second_part*= pow(10, 6 - frac_len); + { + static ulong mul[]={1000000,100000,10000,1000,100,10}; + tm->second_part*= mul[frac_len]; + } } else { if (sscanf(start, "%d:%d:%d", &tm->hour, &tm->minute, &tm->second) < 3) diff --git a/unittest/libmariadb/ps_bugs.c b/unittest/libmariadb/ps_bugs.c index eb5a61ea..1a1dcdb9 100644 --- a/unittest/libmariadb/ps_bugs.c +++ b/unittest/libmariadb/ps_bugs.c @@ -4821,7 +4821,7 @@ static int test_conc_fraction(MYSQL *mysql) diag("second_part: %ld", tm.second_part); - expected= 9 * powl(10, (5 - i)); + expected= 9 * (unsigned int)powl(10, (5 - i)); FAIL_IF(tm.second_part != expected, "expected fractional part to be 900000");