summaryrefslogtreecommitdiff
path: root/storage/myisam
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2022-10-02 14:38:13 +0200
committerSergei Golubchik <serg@mariadb.org>2022-10-02 14:38:13 +0200
commit3a2116241b128b811ee2455845ff9710da3115ac (patch)
tree7de53fc50126f7a19251303bd1d2a0f6cdb42069 /storage/myisam
parente29fb956145cfa1f4f8c41cafcddea36a20b23aa (diff)
parentd4f6d2f08f228778fd7744554d8b12be05b6a114 (diff)
downloadmariadb-git-3a2116241b128b811ee2455845ff9710da3115ac.tar.gz
Merge branch '10.4' into 10.5
Diffstat (limited to 'storage/myisam')
-rw-r--r--storage/myisam/ha_myisam.cc32
1 files changed, 32 insertions, 0 deletions
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 23a0adcaf2a..4e4eaceeb56 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -33,6 +33,7 @@
#include "sql_table.h" // tablename_to_filename
#include "sql_class.h" // THD
#include "debug_sync.h"
+#include "sql_debug.h"
ulonglong myisam_recover_options;
static ulong opt_myisam_block_size;
@@ -121,6 +122,28 @@ static void debug_wait_for_kill(const char *info)
thd_proc_info(thd, prev_info);
DBUG_VOID_RETURN;
}
+
+
+class Debug_key_myisam: public Debug_key
+{
+public:
+ Debug_key_myisam() { }
+
+ static void print_keys_myisam(THD *thd, const char *where,
+ const TABLE *table,
+ const MI_KEYDEF *keydef, uint count)
+ {
+ for (uint i= 0; i < count; i++)
+ {
+ Debug_key_myisam tmp;
+ if (!tmp.append(where) &&
+ !tmp.append_key(table->s->key_info[i].name, keydef[i].flag))
+ tmp.print(thd);
+ print_keysegs(thd, keydef[i].seg, keydef[i].keysegs);
+ }
+ }
+};
+
#endif
/*****************************************************************************
@@ -2234,6 +2257,15 @@ int ha_myisam::create(const char *name, TABLE *table_arg,
if ((error= table2myisam(table_arg, &keydef, &recinfo, &record_count)))
DBUG_RETURN(error); /* purecov: inspected */
+
+#ifndef DBUG_OFF
+ DBUG_EXECUTE_IF("key",
+ Debug_key_myisam::print_keys_myisam(table_arg->in_use,
+ "ha_myisam::create: ",
+ table_arg, keydef, share->keys);
+ );
+#endif
+
bzero((char*) &create_info, sizeof(create_info));
create_info.max_rows= share->max_rows;
create_info.reloc_rows= share->min_rows;