summaryrefslogtreecommitdiff
path: root/sql/sql_const.h
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2019-06-27 18:51:34 +0300
committerMonty <monty@mariadb.org>2019-06-27 19:01:51 +0300
commit9053047f3db37a174f6c1333acf189b6558c50c4 (patch)
tree3d79c42badc0af123d7e288b26b020177580a6c4 /sql/sql_const.h
parentf5c080c7353cc9c30d0b269c07024cd38253c3bc (diff)
downloadmariadb-git-9053047f3db37a174f6c1333acf189b6558c50c4.tar.gz
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.
Diffstat (limited to 'sql/sql_const.h')
-rw-r--r--sql/sql_const.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_const.h b/sql/sql_const.h
index 06f9a6042ad..e33d8b73626 100644
--- a/sql/sql_const.h
+++ b/sql/sql_const.h
@@ -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() */