summaryrefslogtreecommitdiffstats
path: root/storage/myisam/ha_myisam.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/myisam/ha_myisam.cc')
-rw-r--r--storage/myisam/ha_myisam.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 34809f41..14311c87 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -710,6 +710,16 @@ my_bool mi_killed_in_mariadb(MI_INFO *info)
return (((TABLE*) (info->external_ref))->in_use->killed != 0);
}
+static void init_compute_vcols(void *table)
+{
+ /*
+ To evaluate vcols we must have current_thd set.
+ This will set current_thd in all threads to the same THD, but it's
+ safe, because vcols are always evaluated under info->s->intern_lock.
+ */
+ set_current_thd(static_cast<TABLE *>(table)->in_use);
+}
+
static int compute_vcols(MI_INFO *info, uchar *record, int keynum)
{
/* This mutex is needed for parallel repair */
@@ -1011,6 +1021,7 @@ void ha_myisam::setup_vcols_for_repair(HA_CHECK *param)
}
DBUG_ASSERT(file->s->base.reclength < file->s->vreclength ||
!table->s->stored_fields);
+ param->init_fix_record= init_compute_vcols;
param->fix_record= compute_vcols;
table->use_all_columns();
}