summaryrefslogtreecommitdiffstats
path: root/storage/myisam
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:39:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:39:13 +0000
commit86fbb58c3ac0865482819c10a3e81f2eea001c36 (patch)
tree28c9e526ea739c6f9b89e36115e1e2698bddf981 /storage/myisam
parentReleasing progress-linux version 1:10.11.6-2~progress7.99u1. (diff)
downloadmariadb-86fbb58c3ac0865482819c10a3e81f2eea001c36.tar.xz
mariadb-86fbb58c3ac0865482819c10a3e81f2eea001c36.zip
Merging upstream version 1:10.11.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'storage/myisam')
-rw-r--r--storage/myisam/ha_myisam.cc11
-rw-r--r--storage/myisam/sort.c5
2 files changed, 16 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();
}
diff --git a/storage/myisam/sort.c b/storage/myisam/sort.c
index 375c1840..0fb475c4 100644
--- a/storage/myisam/sort.c
+++ b/storage/myisam/sort.c
@@ -529,6 +529,11 @@ pthread_handler_t thr_find_all_keys(void *arg)
{
MI_SORT_PARAM *sort_param= (MI_SORT_PARAM*) arg;
my_bool error= FALSE;
+
+ MI_SORT_INFO *si= sort_param->sort_info;
+ if (si->param->init_fix_record)
+ si->param->init_fix_record(si->info->external_ref);
+
/* If my_thread_init fails */
if (my_thread_init() || thr_find_all_keys_exec(sort_param))
error= TRUE;