summaryrefslogtreecommitdiff
path: root/storage/innobase/include/rem0rec.h
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2017-07-12 19:34:55 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2017-07-12 19:34:55 +0300
commit9284e8b2c64aba1ac108512ecc415a2ea563c387 (patch)
treeaf6390fcb03434a98f7e6a5734fcc0d5909a3e0b /storage/innobase/include/rem0rec.h
parent9e11e055ce1461caecbb30e8300dfdcd48af22f1 (diff)
downloadmariadb-git-9284e8b2c64aba1ac108512ecc415a2ea563c387.tar.gz
MDEV-11828: innodb_page_size=64k must reject ROW_FORMAT=REDUNDANT records longer than 16383 bytes
In all InnoDB row formats, the pointers or lengths stored in the record header can be at most 14 bits, that is, count up to 16383. In ROW_FORMAT=REDUNDANT, this limits the maximum possible record length to 16383 bytes. In other ROW_FORMAT, it could merely limit the maximum length of variable-length fields. When MySQL 5.7 introduced innodb_page_size=32k and 64k, the maximum record length was limited to 16383 bytes (I hope 16383, not 16384, to be able to distinguish from a record whose length is 0 bytes). This change is present in MariaDB Server 10.2. btr_cur_optimistic_update(): Restrict maximum record size to 16K-1 for REDUNDANT and 64K page size. dict_index_too_big_for_tree(): The maximum allowed record size is half a B-tree page or 16K(-1 for REDUNDANT) for 64K page size. convert_error_code_to_mysql(): Fix error message to print correct limits. my_error_innodb(): Fix error message to print correct limits. page_zip_rec_needs_ext() : record size was already restricted to 16K. Restrict REDUNDANT to 16K-1. rem0rec.h: Introduce REDUNDANT_REC_MAX_DATA_SIZE (16K-1) and COMPRESSED_REC_MAX_DATA_SIZE (16K).
Diffstat (limited to 'storage/innobase/include/rem0rec.h')
-rw-r--r--storage/innobase/include/rem0rec.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/storage/innobase/include/rem0rec.h b/storage/innobase/include/rem0rec.h
index 83286a98f8e..4adfc128d08 100644
--- a/storage/innobase/include/rem0rec.h
+++ b/storage/innobase/include/rem0rec.h
@@ -980,9 +980,15 @@ are given in one byte (resp. two byte) format. */
#define REC_1BYTE_OFFS_LIMIT 0x7FUL
#define REC_2BYTE_OFFS_LIMIT 0x7FFFUL
-/* The data size of record must be smaller than this because we reserve
-two upmost bits in a two byte offset for special purposes */
-#define REC_MAX_DATA_SIZE (16384)
+/* The data size of record must not be larger than this on
+REDUNDANT row format because we reserve two upmost bits in a
+two byte offset for special purposes */
+#define REDUNDANT_REC_MAX_DATA_SIZE (16383)
+
+/* The data size of record must be smaller than this on
+COMPRESSED row format because we reserve two upmost bits in a
+two byte offset for special purposes */
+#define COMPRESSED_REC_MAX_DATA_SIZE (16384)
#ifdef WITH_WSREP
int wsrep_rec_get_foreign_key(