summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorJan Lindström <jplindst@mariadb.org>2015-02-04 09:29:54 +0200
committerJan Lindström <jplindst@mariadb.org>2015-02-04 09:29:54 +0200
commit7afbf338aaf425d41c2e27044b32ea94aecceb42 (patch)
tree42ba47e48477b638b917d463604d0f083982f32b /storage
parent5f63c9c067c59102d5d707c6ff086ece60edae9e (diff)
downloadmariadb-git-7afbf338aaf425d41c2e27044b32ea94aecceb42.tar.gz
MDEV-7513: ib_warn_row_too_big dereferences null thd
Analysis: Purge thread does not have thd and no access to handlerton. Fix: If thd does not exists we use sql_print_warning instead of push_warning_printf.
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/handler/ha_innodb.cc28
1 files changed, 20 insertions, 8 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index d58eb0689a2..af455f488a3 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -12273,12 +12273,24 @@ ib_warn_row_too_big(const dict_table_t* table)
THD* thd = current_thd;
- push_warning_printf(
- thd, MYSQL_ERROR::WARN_LEVEL_WARN, HA_ERR_TO_BIG_ROW,
- "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.", free_space
- , prefix ? "or using ROW_FORMAT=DYNAMIC or"
- " ROW_FORMAT=COMPRESSED ": ""
- , prefix ? DICT_MAX_FIXED_COL_LEN : 0);
+ if (thd) {
+ push_warning_printf(
+ thd, MYSQL_ERROR::WARN_LEVEL_WARN, HA_ERR_TO_BIG_ROW,
+ "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.", free_space
+ , prefix ? "or using ROW_FORMAT=DYNAMIC or"
+ " ROW_FORMAT=COMPRESSED ": ""
+ , prefix ? DICT_MAX_FIXED_COL_LEN : 0);
+ } else {
+ /* Note that we can't use push_warning_printf here because
+ e.g. purge thread has no thd */
+ sql_print_warning(
+ "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.", free_space
+ , prefix ? "or using ROW_FORMAT=DYNAMIC or"
+ " ROW_FORMAT=COMPRESSED ": ""
+ , prefix ? DICT_MAX_FIXED_COL_LEN : 0);
+ }
}