Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
3.1, 3.3, 3.4
-
None
Description
The problem is repeatable with all server versions between 10.5 and 11.7.
I create this MTR test file:
SELECT FROM_UNIXTIME('1922.1'); |
If I run "mtr testname", it returns:
SELECT FROM_UNIXTIME('1922.1'); |
FROM_UNIXTIME('1922.1') |
1970-01-01 04:32:02.100000
|
If I run "mtr --ps testname", it returns
SELECT FROM_UNIXTIME('1922.1'); |
FROM_UNIXTIME('1922.1') |
1970-01-01 04:32:02
|
Notice there are no fractional digits.
The problem probably resides in the function ps_fetch_datetime in the client library, file libmariadb/ma_stmt_codec.c
{
ms[field->decimals + 1]= 0;
length+= strlen(ms);
strcat(dtbuffer, ms);
}
break;
Notice, it does not handle AUTO_SEC_PART_DIGITS (39), so the fractional part is not appended to the string buffer.
In case field->decimals==AUTO_SEC_PART_DIGITS, the code should print six fractional digits but only if they are not equal to 000000.