mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Follow-up to B-g#15776, test failures on 64-bit linux.
Make maximum blob size to be 2**32-1, regardless of word size. Fix failure of timestamp with size of 2**31-1. The method of rounding up to the nearest even number would overflow. mysql-test/r/type_blob.result: 2**32-1 is not a special case for timestamp. Test 2**32-1 and 2**64 as the reliable test points for both 32- and 64-bit machines. I'd like to test 2**32, but that would make tests that vary between architectures. I'd like to generalize the tests by pulling the max blob size from the server, and then "eval"ing N-1, N, and N+1 instead of all these literal numbers, but I have not found a way to get UINT_MAX. mysql-test/t/type_blob.test: 2**32-1 is not a special case for timestamp. Test 2**32-1 and 2**64 as the reliable test points for both 32- and 64-bit machines. I'd like to test 2**32, but that would make tests that vary between architectures. I'd like to generalize the tests by pulling the max blob size from the server, and then "eval"ing N-1, N, and N+1 instead of all these literal numbers, but I have not found a way to get UINT_MAX. sql/field.cc: Fix a bug where the round-to-even code for TIMESTAMP fields failed where the size would overflow the size to zero and then fail. Also, since we silently truncate the size of TIMESTAMP fields, set the maximum size we report is allowable to be the largest parsable number. sql/unireg.h: Make BLOB size the maximum that the packed value in field_blob::get_length() allows.
This commit is contained in:
@ -528,11 +528,13 @@ CREATE TABLE b15776 (a year(-2));
|
||||
## For timestamp, we silently rewrite widths to 14 or 19.
|
||||
CREATE TABLE b15776 (a timestamp(4294967294));
|
||||
DROP TABLE b15776;
|
||||
--error ER_TOO_BIG_DISPLAYWIDTH
|
||||
CREATE TABLE b15776 (a timestamp(4294967295));
|
||||
DROP TABLE b15776;
|
||||
--error ER_TOO_BIG_DISPLAYWIDTH
|
||||
CREATE TABLE b15776 (a timestamp(4294967296));
|
||||
--error ER_PARSE_ERROR
|
||||
CREATE TABLE b15776 (a timestamp(-1));
|
||||
--error ER_PARSE_ERROR
|
||||
CREATE TABLE b15776 (a timestamp(-2));
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user