summaryrefslogtreecommitdiff
path: root/storage/innobase/handler/ha_innodb.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/handler/ha_innodb.cc')
-rw-r--r--storage/innobase/handler/ha_innodb.cc20
1 files changed, 13 insertions, 7 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index c2b085b2c04..79d0c7543b0 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -2167,15 +2167,21 @@ convert_error_code_to_mysql(
locally for BLOB fields. Refer to dict_table_get_format().
We limit max record size to 16k for 64k page size. */
bool prefix = (dict_tf_get_format(flags) == UNIV_FORMAT_A);
+ bool comp = !!(flags & DICT_TF_COMPACT);
+ ulint free_space = page_get_free_space_of_empty(comp) / 2;
+
+ if (free_space >= (comp ? COMPRESSED_REC_MAX_DATA_SIZE :
+ REDUNDANT_REC_MAX_DATA_SIZE)) {
+ free_space = (comp ? COMPRESSED_REC_MAX_DATA_SIZE :
+ REDUNDANT_REC_MAX_DATA_SIZE) - 1;
+ }
+
my_printf_error(ER_TOO_BIG_ROWSIZE,
- "Row size too large (> %lu). Changing some columns"
- " to TEXT or BLOB %smay help. In current row"
- " format, BLOB prefix of %d bytes is stored inline.",
+ "Row size too large (> " ULINTPF "). Changing some columns "
+ "to TEXT or BLOB %smay help. In current row "
+ "format, BLOB prefix of %d bytes is stored inline.",
MYF(0),
- srv_page_size == UNIV_PAGE_SIZE_MAX
- ? REC_MAX_DATA_SIZE - 1
- : page_get_free_space_of_empty(flags &
- DICT_TF_COMPACT) / 2,
+ free_space,
prefix
? "or using ROW_FORMAT=DYNAMIC or"
" ROW_FORMAT=COMPRESSED "