Commit 974620fc authored by Sergei Golubchik's avatar Sergei Golubchik Committed by Vicențiu Ciorbaru

buildbot

failures in --view, --embedded, an old/non-gcc compilers
parent 62e035fb
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#cmakedefine HAVE_IA64INTRIN_H 1 #cmakedefine HAVE_IA64INTRIN_H 1
#cmakedefine HAVE_IEEEFP_H 1 #cmakedefine HAVE_IEEEFP_H 1
#cmakedefine HAVE_INTTYPES_H 1 #cmakedefine HAVE_INTTYPES_H 1
#cmakedefine HAVE_IMMINTRIN_H 1
#cmakedefine HAVE_KQUEUE 1 #cmakedefine HAVE_KQUEUE 1
#cmakedefine HAVE_LIMITS_H 1 #cmakedefine HAVE_LIMITS_H 1
#cmakedefine HAVE_LINK_H 1 #cmakedefine HAVE_LINK_H 1
......
...@@ -187,6 +187,7 @@ CHECK_INCLUDE_FILES (fpu_control.h HAVE_FPU_CONTROL_H) ...@@ -187,6 +187,7 @@ CHECK_INCLUDE_FILES (fpu_control.h HAVE_FPU_CONTROL_H)
CHECK_INCLUDE_FILES (grp.h HAVE_GRP_H) CHECK_INCLUDE_FILES (grp.h HAVE_GRP_H)
CHECK_INCLUDE_FILES (ieeefp.h HAVE_IEEEFP_H) CHECK_INCLUDE_FILES (ieeefp.h HAVE_IEEEFP_H)
CHECK_INCLUDE_FILES (inttypes.h HAVE_INTTYPES_H) CHECK_INCLUDE_FILES (inttypes.h HAVE_INTTYPES_H)
CHECK_INCLUDE_FILES (immintrin.h HAVE_IMMINTRIN_H)
CHECK_INCLUDE_FILES (langinfo.h HAVE_LANGINFO_H) CHECK_INCLUDE_FILES (langinfo.h HAVE_LANGINFO_H)
CHECK_INCLUDE_FILES (link.h HAVE_LINK_H) CHECK_INCLUDE_FILES (link.h HAVE_LINK_H)
CHECK_INCLUDE_FILES (linux/unistd.h HAVE_LINUX_UNISTD_H) CHECK_INCLUDE_FILES (linux/unistd.h HAVE_LINUX_UNISTD_H)
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
+ +
+MyISAM file: datadir/test/t1#i#01 +MyISAM file: datadir/test/t1#i#01
+Record format: Packed +Record format: Packed
+Character set: latin1_swedish_ci (8) +Character set: ? (0)
+Data records: 1 Deleted blocks: 0 +Data records: 1 Deleted blocks: 0
+Recordlength: 30 +Recordlength: 30
+ +
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
+ +
+MyISAM file: datadir/test/t1#i#01 +MyISAM file: datadir/test/t1#i#01
+Record format: Packed +Record format: Packed
+Character set: latin1_swedish_ci (8) +Character set: ? (0)
+Data records: 0 Deleted blocks: 0 +Data records: 0 Deleted blocks: 0
+Recordlength: 30 +Recordlength: 30
+ +
......
...@@ -12,7 +12,7 @@ t1 CREATE TABLE `t1` ( ...@@ -12,7 +12,7 @@ t1 CREATE TABLE `t1` (
`v` blob NOT NULL, `v` blob NOT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
VECTOR KEY `v` (`v`) VECTOR KEY `v` (`v`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
show keys from t1; show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored
t1 0 PRIMARY 1 id A 0 NULL NULL BTREE NO t1 0 PRIMARY 1 id A 0 NULL NULL BTREE NO
...@@ -260,7 +260,7 @@ t2 CREATE TABLE `t2` ( ...@@ -260,7 +260,7 @@ t2 CREATE TABLE `t2` (
`v` blob NOT NULL, `v` blob NOT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
VECTOR KEY `v` (`v`) VECTOR KEY `v` (`v`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
drop table t1, t2; drop table t1, t2;
db.opt db.opt
# Test insert ... select with vector index # Test insert ... select with vector index
...@@ -315,7 +315,7 @@ t1 CREATE TABLE `t1` ( ...@@ -315,7 +315,7 @@ t1 CREATE TABLE `t1` (
`v` blob NOT NULL, `v` blob NOT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
VECTOR KEY `v` (`v`) VECTOR KEY `v` (`v`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
drop table t1; drop table t1;
db.opt db.opt
# Test RENAME TABLE with vector index # Test RENAME TABLE with vector index
......
...@@ -6,7 +6,7 @@ t1 CREATE TABLE `t1` ( ...@@ -6,7 +6,7 @@ t1 CREATE TABLE `t1` (
`v` blob NOT NULL, `v` blob NOT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
VECTOR KEY `v` (`v`) VECTOR KEY `v` (`v`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
insert t1 (v) values insert t1 (v) values
(x'106d263fdf68ba3eb08d533f97d46e3fd1e1ec3edc4c123f984c563f621a233f'), (x'106d263fdf68ba3eb08d533f97d46e3fd1e1ec3edc4c123f984c563f621a233f'),
(x'd55bee3c56eb9e3e84e3093f838dce3eb7cd653fe32d7d3f12de133c5715d23e'), (x'd55bee3c56eb9e3e84e3093f838dce3eb7cd653fe32d7d3f12de133c5715d23e'),
......
...@@ -396,7 +396,7 @@ def information_schema SQL_FUNCTIONS FUNCTION 1 NULL YES varchar 64 192 NULL NUL ...@@ -396,7 +396,7 @@ def information_schema SQL_FUNCTIONS FUNCTION 1 NULL YES varchar 64 192 NULL NUL
def information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO def information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
def information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1) NEVER NULL NO NO def information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1) NEVER NULL NO NO
def information_schema STATISTICS COLUMN_NAME 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO def information_schema STATISTICS COLUMN_NAME 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
def information_schema STATISTICS COMMENT 15 NULL YES varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) NEVER NULL NO NO def information_schema STATISTICS COMMENT 15 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) NEVER NULL NO NO
def information_schema STATISTICS IGNORED 17 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO def information_schema STATISTICS IGNORED 17 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO
def information_schema STATISTICS INDEX_COMMENT 16 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) NEVER NULL NO NO def information_schema STATISTICS INDEX_COMMENT 16 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) NEVER NULL NO NO
def information_schema STATISTICS INDEX_NAME 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO def information_schema STATISTICS INDEX_NAME 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
......
...@@ -2162,6 +2162,36 @@ NUMERIC_BLOCK_SIZE 1 ...@@ -2162,6 +2162,36 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL ENUM_VALUE_LIST NULL
READ_ONLY YES READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MHNSW_CACHE_SIZE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Size of the cache for the MHNSW vector index
NUMERIC_MIN_VALUE 1048576
NUMERIC_MAX_VALUE 18446744073709551615
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MHNSW_LIMIT_MULTIPLIER
VARIABLE_SCOPE SESSION
VARIABLE_TYPE DOUBLE
VARIABLE_COMMENT Defines the number of result candidates to look for in the vector index for ORDER BY ... LIMIT N queries. Specified in term of LIMIT (1 means look for exactly N candidates, 2 means look for 2*N, etc). Larger values means the search will be slower, but the result will be closer to perfect
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 100
NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MHNSW_MAX_EDGES_PER_NODE
VARIABLE_SCOPE SESSION
VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Larger values means slower INSERT, larger index size and higher memory consumption, but better search results. Not used for SELECT
NUMERIC_MIN_VALUE 2
NUMERIC_MAX_VALUE 200
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MIN_EXAMINED_ROW_LIMIT VARIABLE_NAME MIN_EXAMINED_ROW_LIMIT
VARIABLE_SCOPE SESSION VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_TYPE BIGINT UNSIGNED
......
...@@ -28,7 +28,9 @@ SOFTWARE. ...@@ -28,7 +28,9 @@ SOFTWARE.
#include <cmath> #include <cmath>
#include <vector> #include <vector>
#include <algorithm> #include <algorithm>
#ifdef HAVE_IMMINTRIN_H
#include <immintrin.h> #include <immintrin.h>
#endif
template <typename T> template <typename T>
struct PatternedSimdBloomFilter struct PatternedSimdBloomFilter
...@@ -36,7 +38,7 @@ struct PatternedSimdBloomFilter ...@@ -36,7 +38,7 @@ struct PatternedSimdBloomFilter
PatternedSimdBloomFilter(int n, float eps) : n(n), epsilon(eps) PatternedSimdBloomFilter(int n, float eps) : n(n), epsilon(eps)
{ {
m = ComputeNumBits(); m = ComputeNumBits();
int log_num_blocks = 32 - __builtin_clz(m) - rotate_bits; int log_num_blocks = my_bit_log2_uint32(m) + 1 - rotate_bits;
num_blocks = (1ULL << log_num_blocks); num_blocks = (1ULL << log_num_blocks);
bv.resize(num_blocks); bv.resize(num_blocks);
} }
...@@ -47,6 +49,7 @@ struct PatternedSimdBloomFilter ...@@ -47,6 +49,7 @@ struct PatternedSimdBloomFilter
return std::max<uint64_t>(512, bits_per_val * n + 0.5); return std::max<uint64_t>(512, bits_per_val * n + 0.5);
} }
#if __GNUC__ > 7 && defined(HAVE_IMMINTRIN_H)
__attribute__ ((target ("avx2,avx,fma"))) __attribute__ ((target ("avx2,avx,fma")))
__m256i CalcHash(__m256i vecData) __m256i CalcHash(__m256i vecData)
{ {
...@@ -159,6 +162,7 @@ struct PatternedSimdBloomFilter ...@@ -159,6 +162,7 @@ struct PatternedSimdBloomFilter
uint8_t res_bits = static_cast<uint8_t>(_mm256_movemask_epi8(_mm256_set1_epi64x(res_bytes)) & 0xff); uint8_t res_bits = static_cast<uint8_t>(_mm256_movemask_epi8(_mm256_set1_epi64x(res_bytes)) & 0xff);
return res_bits; return res_bits;
} }
#endif
/******************************************************** /********************************************************
********* non-SIMD fallback version ********************/ ********* non-SIMD fallback version ********************/
......
...@@ -6238,7 +6238,7 @@ Create_func_year_week::create_native(THD *thd, const LEX_CSTRING *name, ...@@ -6238,7 +6238,7 @@ Create_func_year_week::create_native(THD *thd, const LEX_CSTRING *name,
class Create_func_vec_distance: public Create_func_arg2 class Create_func_vec_distance: public Create_func_arg2
{ {
public: public:
Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) Item *create_2_arg(THD *thd, Item *arg1, Item *arg2) override
{ return new (thd->mem_root) Item_func_vec_distance(thd, arg1, arg2); } { return new (thd->mem_root) Item_func_vec_distance(thd, arg1, arg2); }
static Create_func_vec_distance s_singleton; static Create_func_vec_distance s_singleton;
...@@ -6254,7 +6254,7 @@ Create_func_vec_distance Create_func_vec_distance::s_singleton; ...@@ -6254,7 +6254,7 @@ Create_func_vec_distance Create_func_vec_distance::s_singleton;
class Create_func_vec_totext: public Create_func_arg1 class Create_func_vec_totext: public Create_func_arg1
{ {
public: public:
Item *create_1_arg(THD *thd, Item *arg1) Item *create_1_arg(THD *thd, Item *arg1) override
{ return new (thd->mem_root) Item_func_vec_totext(thd, arg1); } { return new (thd->mem_root) Item_func_vec_totext(thd, arg1); }
static Create_func_vec_totext s_singleton; static Create_func_vec_totext s_singleton;
...@@ -6271,7 +6271,7 @@ Create_func_vec_totext Create_func_vec_totext::s_singleton; ...@@ -6271,7 +6271,7 @@ Create_func_vec_totext Create_func_vec_totext::s_singleton;
class Create_func_vec_fromtext: public Create_func_arg1 class Create_func_vec_fromtext: public Create_func_arg1
{ {
public: public:
Item *create_1_arg(THD *thd, Item *arg1) Item *create_1_arg(THD *thd, Item *arg1) override
{ return new (thd->mem_root) Item_func_vec_fromtext(thd, arg1); } { return new (thd->mem_root) Item_func_vec_fromtext(thd, arg1); }
static Create_func_vec_fromtext s_singleton; static Create_func_vec_fromtext s_singleton;
......
...@@ -59,11 +59,10 @@ double Item_func_vec_distance::val_real() ...@@ -59,11 +59,10 @@ double Item_func_vec_distance::val_real()
bool Item_func_vec_totext::fix_length_and_dec(THD *thd) bool Item_func_vec_totext::fix_length_and_dec(THD *thd)
{ {
collation.set(default_charset());
decimals= 0; decimals= 0;
max_length= ((args[0]->max_length / 4) * max_length= ((args[0]->max_length / 4) *
(MAX_FLOAT_STR_LENGTH + 1 /* comma */)) + 2 /* braces */ * (MAX_FLOAT_STR_LENGTH + 1 /* comma */)) + 2 /* braces */;
collation.collation->mbmaxlen; fix_length_and_charset(max_length, default_charset());
set_maybe_null(); set_maybe_null();
return false; return false;
} }
...@@ -140,13 +139,12 @@ Item_func_vec_fromtext::Item_func_vec_fromtext(THD *thd, Item *a) ...@@ -140,13 +139,12 @@ Item_func_vec_fromtext::Item_func_vec_fromtext(THD *thd, Item *a)
bool Item_func_vec_fromtext::fix_length_and_dec(THD *thd) bool Item_func_vec_fromtext::fix_length_and_dec(THD *thd)
{ {
collation.set(&my_charset_bin);
decimals= 0; decimals= 0;
/* Worst case scenario, for a valid input we have a string of the form: /* Worst case scenario, for a valid input we have a string of the form:
[1,2,3,4,5,...] single digit numbers. [1,2,3,4,5,...] single digit numbers.
This means we can have (max_length - 2) / 2 floats. This means we can have (max_length - 1) / 2 floats.
Each float takes 4 bytes, so we do max_length - 2 * 2. */ Each float takes 4 bytes, so we do (max_length - 1) * 2. */
max_length= (args[0]->max_length - 2) * 2 * my_charset_bin.mbmaxlen; fix_length_and_charset((args[0]->max_length - 1) * 2, &my_charset_bin);
set_maybe_null(); set_maybe_null();
return false; return false;
} }
......
...@@ -40,6 +40,11 @@ class Item_func_vec_distance: public Item_real_func ...@@ -40,6 +40,11 @@ class Item_func_vec_distance: public Item_real_func
public: public:
Item_func_vec_distance(THD *thd, Item *a, Item *b) Item_func_vec_distance(THD *thd, Item *a, Item *b)
:Item_real_func(thd, a, b) {} :Item_real_func(thd, a, b) {}
bool fix_length_and_dec(THD *thd) override
{
set_maybe_null();
return Item_real_func::fix_length_and_dec(thd);
}
double val_real() override; double val_real() override;
LEX_CSTRING func_name_cstring() const override LEX_CSTRING func_name_cstring() const override
{ {
......
...@@ -9829,17 +9829,17 @@ int TABLE::hlindex_open(uint nr) ...@@ -9829,17 +9829,17 @@ int TABLE::hlindex_open(uint nr)
mysql_mutex_lock(&s->LOCK_share); mysql_mutex_lock(&s->LOCK_share);
if (!s->hlindex) if (!s->hlindex)
{ {
mysql_mutex_unlock(&s->LOCK_share);
TABLE_SHARE *share; TABLE_SHARE *share;
char *path= NULL; char *path= NULL;
mysql_mutex_unlock(&s->LOCK_share); size_t path_len= s->normalized_path.length + HLINDEX_BUF_LEN;
share= (TABLE_SHARE*)alloc_root(&s->mem_root, sizeof(*share)); share= (TABLE_SHARE*)alloc_root(&s->mem_root, sizeof(*share));
path= (char*)alloc_root(&s->mem_root, path= (char*)alloc_root(&s->mem_root, path_len);
s->normalized_path.length + HLINDEX_BUF_LEN);
if (!share || !path) if (!share || !path)
return 1; return 1;
my_snprintf(path, HLINDEX_BUF_LEN, "%s" HLINDEX_TEMPLATE, my_snprintf(path, path_len, "%s" HLINDEX_TEMPLATE,
s->normalized_path.str, nr); s->normalized_path.str, nr);
init_tmp_table_share(in_use, share, s->db.str, 0, s->table_name.str, init_tmp_table_share(in_use, share, s->db.str, 0, s->table_name.str,
path, false); path, false);
......
...@@ -7228,7 +7228,7 @@ class Type_handler_string: public Type_handler_longstr ...@@ -7228,7 +7228,7 @@ class Type_handler_string: public Type_handler_longstr
bool Key_part_spec_init_ft(Key_part_spec *part, bool Key_part_spec_init_ft(Key_part_spec *part,
const Column_definition &def) const override; const Column_definition &def) const override;
bool Key_part_spec_init_vector(Key_part_spec *part, bool Key_part_spec_init_vector(Key_part_spec *part,
const Column_definition &def) const; const Column_definition &def) const override;
Field *make_table_field(MEM_ROOT *root, Field *make_table_field(MEM_ROOT *root,
const LEX_CSTRING *name, const LEX_CSTRING *name,
const Record_addr &addr, const Record_addr &addr,
...@@ -7327,7 +7327,7 @@ class Type_handler_varchar: public Type_handler_longstr ...@@ -7327,7 +7327,7 @@ class Type_handler_varchar: public Type_handler_longstr
bool Key_part_spec_init_ft(Key_part_spec *part, bool Key_part_spec_init_ft(Key_part_spec *part,
const Column_definition &def) const override; const Column_definition &def) const override;
bool Key_part_spec_init_vector(Key_part_spec *part, bool Key_part_spec_init_vector(Key_part_spec *part,
const Column_definition &def) const; const Column_definition &def) const override;
Field *make_table_field(MEM_ROOT *root, Field *make_table_field(MEM_ROOT *root,
const LEX_CSTRING *name, const LEX_CSTRING *name,
const Record_addr &addr, const Record_addr &addr,
...@@ -7431,7 +7431,7 @@ class Type_handler_blob_common: public Type_handler_longstr ...@@ -7431,7 +7431,7 @@ class Type_handler_blob_common: public Type_handler_longstr
bool Key_part_spec_init_ft(Key_part_spec *part, bool Key_part_spec_init_ft(Key_part_spec *part,
const Column_definition &def) const override; const Column_definition &def) const override;
bool Key_part_spec_init_vector(Key_part_spec *part, bool Key_part_spec_init_vector(Key_part_spec *part,
const Column_definition &def) const; const Column_definition &def) const override;
bool Key_part_spec_init_primary(Key_part_spec *part, bool Key_part_spec_init_primary(Key_part_spec *part,
const Column_definition &def, const Column_definition &def,
const handler *file) const override; const handler *file) const override;
......
...@@ -89,7 +89,7 @@ struct FVector ...@@ -89,7 +89,7 @@ struct FVector
return vec; return vec;
} }
#if __GNUC__ > 7 #if __GNUC__ > 7 && defined(HAVE_IMMINTRIN_H)
__attribute__ ((target ("avx2,avx"))) __attribute__ ((target ("avx2,avx")))
static float dot_product(const int16_t *v1, const int16_t *v2, size_t len) static float dot_product(const int16_t *v1, const int16_t *v2, size_t len)
{ {
...@@ -473,18 +473,24 @@ int MHNSW_Trx::MHNSW_hton::do_savepoint_rollback(handlerton *, THD *thd, void *) ...@@ -473,18 +473,24 @@ int MHNSW_Trx::MHNSW_hton::do_savepoint_rollback(handlerton *, THD *thd, void *)
int MHNSW_Trx::MHNSW_hton::do_rollback(handlerton *, THD *thd, bool) int MHNSW_Trx::MHNSW_hton::do_rollback(handlerton *, THD *thd, bool)
{ {
MHNSW_Trx *trx_next;
for (auto trx= static_cast<MHNSW_Trx*>(thd_get_ha_data(thd, &hton)); for (auto trx= static_cast<MHNSW_Trx*>(thd_get_ha_data(thd, &hton));
trx; trx= trx->next) trx; trx= trx_next)
{
trx_next= trx->next;
trx->~MHNSW_Trx(); trx->~MHNSW_Trx();
}
thd_set_ha_data(current_thd, &hton, nullptr); thd_set_ha_data(current_thd, &hton, nullptr);
return 0; return 0;
} }
int MHNSW_Trx::MHNSW_hton::do_commit(handlerton *, THD *thd, bool) int MHNSW_Trx::MHNSW_hton::do_commit(handlerton *, THD *thd, bool)
{ {
MHNSW_Trx *trx_next;
for (auto trx= static_cast<MHNSW_Trx*>(thd_get_ha_data(thd, &hton)); for (auto trx= static_cast<MHNSW_Trx*>(thd_get_ha_data(thd, &hton));
trx; trx= trx->next) trx; trx= trx_next)
{ {
trx_next= trx->next;
auto ctx= MHNSW_Context::get_from_share(trx->table_share, nullptr); auto ctx= MHNSW_Context::get_from_share(trx->table_share, nullptr);
if (ctx) if (ctx)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment