mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-17551 assert or crashed table when using blobs
The bug was that when long item-strings was converted to VARCHAR, type_handler::string_type_handler() didn't take into account max VARCHAR length. The resulting Aria temporary table was created with a VARCHAR field of length 1 when it should have been 65537. This caused MariaDB to send impossible records to ma_write() and Aria reported eventually the table as crashed. Fixed by updating Type_handler::string_type_handler() to not create too long VARCHAR fields. To make things extra safe, I also added checks in when writing dynamic Aria records to ensure we find the wrong record during write instead of during read.
This commit is contained in:
@ -64,7 +64,7 @@
|
||||
CREATE TABLE t1 (c VARBINARY(65534));
|
||||
CREATE TABLE t1 (c VARBINARY(65535));
|
||||
Like VARCHAR(65536), they will be converted to BLOB automatically
|
||||
in non-sctict mode.
|
||||
in non-strict mode.
|
||||
*/
|
||||
#define MAX_FIELD_VARCHARLENGTH (65535-2-1)
|
||||
#define MAX_FIELD_BLOBLENGTH UINT_MAX32 /* cf field_blob::get_length() */
|
||||
|
Reference in New Issue
Block a user