diff options
Diffstat (limited to 'storage')
31 files changed, 102 insertions, 73 deletions
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index 4f4d81ffdb2..2df54567285 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -242,6 +242,20 @@ Archive_share::Archive_share() } +Archive_share::~Archive_share() +{ + DBUG_PRINT("ha_archive", ("~Archive_share: %p", this)); + if (archive_write_open) + { + mysql_mutex_lock(&mutex); + (void) close_archive_writer(); // Will reset archive_write_open + mysql_mutex_unlock(&mutex); + } + thr_lock_delete(&lock); + mysql_mutex_destroy(&mutex); +} + + ha_archive::ha_archive(handlerton *hton, TABLE_SHARE *table_arg) :handler(hton, table_arg), delayed_insert(0), bulk_insert(0) { @@ -675,7 +689,6 @@ int ha_archive::close(void) if (azclose(&archive)) rc= 1; } - DBUG_RETURN(rc); } diff --git a/storage/archive/ha_archive.h b/storage/archive/ha_archive.h index c1b4f27e45e..2bb5079868b 100644 --- a/storage/archive/ha_archive.h +++ b/storage/archive/ha_archive.h @@ -46,19 +46,7 @@ public: bool dirty; /* Flag for if a flush should occur */ bool crashed; /* Meta file is crashed */ Archive_share(); - ~Archive_share() - { - DBUG_PRINT("ha_archive", ("~Archive_share: %p", - this)); - if (archive_write_open) - { - mysql_mutex_lock(&mutex); - (void) close_archive_writer(); - mysql_mutex_unlock(&mutex); - } - thr_lock_delete(&lock); - mysql_mutex_destroy(&mutex); - } + virtual ~Archive_share(); int init_archive_writer(); void close_archive_writer(); int write_v1_metafile(); diff --git a/storage/connect/colblk.h b/storage/connect/colblk.h index b22933d9ebb..51ab32cfae2 100644 --- a/storage/connect/colblk.h +++ b/storage/connect/colblk.h @@ -62,7 +62,7 @@ class DllExport COLBLK : public XOBJECT { bool IsVirtual(void) {return Cdp->IsVirtual();} bool IsNullable(void) {return Nullable;} void SetNullable(bool b) {Nullable = b;} - + void SetName(PSZ name_var) { Name= name_var; } // Methods virtual void Reset(void); virtual bool Compare(PXOB xp); diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc index 484f75d6a04..ee62e0cd03e 100644 --- a/storage/connect/connect.cc +++ b/storage/connect/connect.cc @@ -294,9 +294,9 @@ bool CntOpenTable(PGLOBAL g, PTDB tdbp, MODE mode, char *c1, char *c2, /* its column blocks in mode write (required by XML tables). */ /*******************************************************************/ if (mode == MODE_UPDATE) { - PTDBASE utp; + PTDB utp; - if (!(utp = (PTDBASE)tdbp->Duplicate(g))) { + if (!(utp = tdbp->Duplicate(g))) { sprintf(g->Message, MSG(INV_UPDT_TABLE), tdbp->GetName()); throw 4; } // endif tp @@ -591,7 +591,7 @@ int CntCloseTable(PGLOBAL g, PTDB tdbp, bool nox, bool abort) if (!tdbp->IsRemote()) { // Make all the eventual indexes - PTDBDOS tbxp = (PTDBDOS)tdbp; + PTDBASE tbxp = (PTDBASE)tdbp; tbxp->ResetKindex(g, NULL); tbxp->SetKey_Col(NULL); rc = tbxp->ResetTableOpt(g, true, tbxp->GetDef()->Indexable() == 1); diff --git a/storage/connect/filamvct.cpp b/storage/connect/filamvct.cpp index 9b1e5d7689e..d2add16b31d 100644 --- a/storage/connect/filamvct.cpp +++ b/storage/connect/filamvct.cpp @@ -4117,7 +4117,8 @@ bool BGVFAM::CleanUnusedSpace(PGLOBAL g) } else { int req; - memset(To_Buf, 0, Buflen); + if (To_Buf) + memset(To_Buf, 0, Buflen); for (n = Fpos - Tpos; n > 0; n -= req) { /*****************************************************************/ diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index eb53f4c3bc5..abf30774b09 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -286,7 +286,12 @@ static char *strz(PGLOBAL g, LEX_CSTRING &ls) { char *str= (char*)PlugSubAlloc(g, NULL, ls.length + 1); - memcpy(str, ls.str, ls.length); + /* + ls.str can be NULL, for example when called with + create_info->connect_string + */ + if (ls.str) + memcpy(str, ls.str, ls.length); str[ls.length]= 0; return str; } // end of strz @@ -2829,7 +2834,6 @@ PFIL ha_connect::CondFilter(PGLOBAL g, Item *cond) } else { char buff[256]; String *res, tmp(buff, sizeof(buff), &my_charset_bin); - Item_basic_constant *pval= (Item_basic_constant *)args[i]; PPARM pp= (PPARM)PlugSubAlloc(g, NULL, sizeof(PARM)); // IN and BETWEEN clauses should be col VOP list @@ -2838,6 +2842,8 @@ PFIL ha_connect::CondFilter(PGLOBAL g, Item *cond) switch (args[i]->real_type()) { case COND::CONST_ITEM: + { + Item *pval= (Item *)args[i]; switch (args[i]->cmp_type()) { case STRING_RESULT: res= pval->val_str(&tmp); @@ -2864,6 +2870,7 @@ PFIL ha_connect::CondFilter(PGLOBAL g, Item *cond) DBUG_ASSERT(0); return NULL; } + } break; case COND::CACHE_ITEM: // Possible ??? case COND::NULL_ITEM: // TODO: handle this @@ -3119,7 +3126,7 @@ PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, const Item *cond) } else { char buff[256]; String *res, tmp(buff, sizeof(buff), &my_charset_bin); - Item_basic_constant *pval= (Item_basic_constant *)args[i]; + Item *pval= (Item *)args[i]; Item::Type type= args[i]->real_type(); switch (type) { diff --git a/storage/connect/tabutil.cpp b/storage/connect/tabutil.cpp index 65361acfcd8..705f567f464 100644 --- a/storage/connect/tabutil.cpp +++ b/storage/connect/tabutil.cpp @@ -708,7 +708,7 @@ bool PRXCOL::Init(PGLOBAL g, PTDB tp) MODE mode = To_Tdb->GetMode(); // Needed for MYSQL subtables - ((XCOLBLK*)Colp)->Name = Decode(g, Colp->GetName()); + ((COLBLK*)Colp)->SetName(Decode(g, Colp->GetName())); // May not have been done elsewhere Colp->InitValue(g); diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index 158c017f1b0..c02fb72a102 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -3551,7 +3551,8 @@ fail_err: || thr->graph->trx->id == trx_read_trx_id( static_cast<const byte*>( - trx_id->data))); + trx_id->data)) + || index->table->is_temporary()); } } #endif @@ -4269,7 +4270,8 @@ btr_cur_update_in_place( index = cursor->index; ut_ad(rec_offs_validate(rec, index, offsets)); ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table)); - ut_ad(trx_id > 0 || (flags & BTR_KEEP_SYS_FLAG)); + ut_ad(trx_id > 0 || (flags & BTR_KEEP_SYS_FLAG) + || index->table->is_temporary()); /* The insert buffer tree should never be updated in place. */ ut_ad(!dict_index_is_ibuf(index)); ut_ad(dict_index_is_online_ddl(index) == !!(flags & BTR_CREATE_FLAG) @@ -4566,7 +4568,8 @@ btr_cur_optimistic_update( page = buf_block_get_frame(block); rec = btr_cur_get_rec(cursor); index = cursor->index; - ut_ad(trx_id > 0 || (flags & BTR_KEEP_SYS_FLAG)); + ut_ad(trx_id > 0 || (flags & BTR_KEEP_SYS_FLAG) + || index->table->is_temporary()); ut_ad(!!page_rec_is_comp(rec) == dict_table_is_comp(index->table)); ut_ad(mtr->memo_contains_flagged(block, MTR_MEMO_PAGE_X_FIX)); /* This is intended only for leaf page updates */ @@ -4922,8 +4925,8 @@ btr_cur_pessimistic_update( ut_ad(!page_zip || !index->table->is_temporary()); /* The insert buffer tree should never be updated in place. */ ut_ad(!dict_index_is_ibuf(index)); - ut_ad(trx_id > 0 - || (flags & BTR_KEEP_SYS_FLAG)); + ut_ad(trx_id > 0 || (flags & BTR_KEEP_SYS_FLAG) + || index->table->is_temporary()); ut_ad(dict_index_is_online_ddl(index) == !!(flags & BTR_CREATE_FLAG) || dict_index_is_clust(index)); ut_ad(thr_get_trx(thr)->id == trx_id diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index b9f5984f3f4..2c0a1b9f972 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -5496,8 +5496,10 @@ ha_innobase::open(const char* name, int, uint) innobase_copy_frm_flags_from_table_share(ib_table, table->s); - /* No point to init any statistics if tablespace is still encrypted. */ - if (ib_table->is_readable()) { + /* No point to init any statistics if tablespace is still encrypted + or if table is being opened by background thread */ + if (THDVAR(thd, background_thread)) { + } else if (ib_table->is_readable()) { dict_stats_init(ib_table); } else { ib_table->stat_initialized = 1; diff --git a/storage/innobase/include/page0page.ic b/storage/innobase/include/page0page.ic index 2de2ad38080..6514886dd67 100644 --- a/storage/innobase/include/page0page.ic +++ b/storage/innobase/include/page0page.ic @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1994, 2019, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2016, 2020, MariaDB Corporation. +Copyright (c) 2016, 2021, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -717,7 +717,7 @@ page_get_instant(const page_t* page) break; } #endif /* UNIV_DEBUG */ - return i / 8; + return static_cast<uint16_t>(i >> 3); /* i / 8 */ } #endif /* !UNIV_INNOCHECKSUM */ diff --git a/storage/innobase/include/trx0sys.h b/storage/innobase/include/trx0sys.h index 392d44a3cdd..c318251eaa9 100644 --- a/storage/innobase/include/trx0sys.h +++ b/storage/innobase/include/trx0sys.h @@ -88,7 +88,6 @@ void trx_write_trx_id(byte* db_trx_id, trx_id_t id) { compile_time_assert(DATA_TRX_ID_LEN == 6); - ut_ad(id); mach_write_to_6(db_trx_id, id); } diff --git a/storage/innobase/include/ut0ut.h b/storage/innobase/include/ut0ut.h index 1437cee9b85..69abd932375 100644 --- a/storage/innobase/include/ut0ut.h +++ b/storage/innobase/include/ut0ut.h @@ -151,7 +151,7 @@ ut_time_ms(void); store the given number of bits. @param b in: bits @return number of bytes (octets) needed to represent b */ -#define UT_BITS_IN_BYTES(b) (((b) + 7) / 8) +#define UT_BITS_IN_BYTES(b) (((b) + 7) >> 3) /** Determines if a number is zero or a power of two. @param[in] n number diff --git a/storage/innobase/pars/pars0pars.cc b/storage/innobase/pars/pars0pars.cc index 6efc74f3038..ec922e85e29 100644 --- a/storage/innobase/pars/pars0pars.cc +++ b/storage/innobase/pars/pars0pars.cc @@ -1220,6 +1220,7 @@ pars_update_statement( sel_node->row_lock_mode = LOCK_X; } else { node->has_clust_rec_x_lock = sel_node->set_x_locks; + ut_ad(node->has_clust_rec_x_lock); } ut_a(sel_node->n_tables == 1); diff --git a/storage/innobase/rem/rem0rec.cc b/storage/innobase/rem/rem0rec.cc index 4a32cb0556c..c4886101499 100644 --- a/storage/innobase/rem/rem0rec.cc +++ b/storage/innobase/rem/rem0rec.cc @@ -1420,8 +1420,9 @@ rec_convert_dtuple_to_rec_old( /* If the data is not SQL null, store it */ len = dfield_get_len(field); - memcpy(rec + end_offset, - dfield_get_data(field), len); + if (len) + memcpy(rec + end_offset, + dfield_get_data(field), len); end_offset += len; ored_offset = end_offset; @@ -1448,8 +1449,9 @@ rec_convert_dtuple_to_rec_old( /* If the data is not SQL null, store it */ len = dfield_get_len(field); - memcpy(rec + end_offset, - dfield_get_data(field), len); + if (len) + memcpy(rec + end_offset, + dfield_get_data(field), len); end_offset += len; ored_offset = end_offset; diff --git a/storage/innobase/row/row0ins.cc b/storage/innobase/row/row0ins.cc index 880554d76b4..2704d265f04 100644 --- a/storage/innobase/row/row0ins.cc +++ b/storage/innobase/row/row0ins.cc @@ -3378,7 +3378,8 @@ row_ins_index_entry( dtuple_t* entry, /*!< in/out: index entry to insert */ que_thr_t* thr) /*!< in: query thread */ { - ut_ad(thr_get_trx(thr)->id || index->table->no_rollback()); + ut_ad(thr_get_trx(thr)->id || index->table->no_rollback() + || index->table->is_temporary()); DBUG_EXECUTE_IF("row_ins_index_entry_timeout", { DBUG_SET("-d,row_ins_index_entry_timeout"); @@ -3796,6 +3797,10 @@ row_ins_step( node->state = INS_NODE_ALLOC_ROW_ID; + if (node->table->is_temporary()) { + node->trx_id = trx->id; + } + /* It may be that the current session has not yet started its transaction, or it has been committed: */ diff --git a/storage/innobase/row/row0uins.cc b/storage/innobase/row/row0uins.cc index 1a61a529e2c..e4a4e2f18e3 100644 --- a/storage/innobase/row/row0uins.cc +++ b/storage/innobase/row/row0uins.cc @@ -111,7 +111,8 @@ row_undo_ins_remove_clust_rec( rec_t* rec = btr_pcur_get_rec(&node->pcur); - ut_ad(rec_get_trx_id(rec, index) == node->trx->id); + ut_ad(rec_get_trx_id(rec, index) == node->trx->id + || node->table->is_temporary()); ut_ad(!rec_get_deleted_flag(rec, index->table->not_redundant()) || rec_is_alter_metadata(rec, index->table->not_redundant())); ut_ad(rec_is_metadata(rec, index->table->not_redundant()) diff --git a/storage/innobase/row/row0umod.cc b/storage/innobase/row/row0umod.cc index 064a7ffd888..760d7dd1f5f 100644 --- a/storage/innobase/row/row0umod.cc +++ b/storage/innobase/row/row0umod.cc @@ -110,7 +110,8 @@ row_undo_mod_clust_low( ut_ad(success); ut_ad(rec_get_trx_id(btr_cur_get_rec(btr_cur), btr_cur_get_index(btr_cur)) - == thr_get_trx(thr)->id); + == thr_get_trx(thr)->id + || btr_cur_get_index(btr_cur)->table->is_temporary()); ut_ad(node->ref != &trx_undo_metadata || node->update->info_bits == REC_INFO_METADATA_ADD || node->update->info_bits == REC_INFO_METADATA_ALTER); diff --git a/storage/innobase/row/row0undo.cc b/storage/innobase/row/row0undo.cc index eb672eb0caa..bfffcbdcdc6 100644 --- a/storage/innobase/row/row0undo.cc +++ b/storage/innobase/row/row0undo.cc @@ -196,7 +196,7 @@ row_undo_search_clust_to_pcur( if (found) { ut_ad(row_get_rec_trx_id(rec, clust_index, offsets) - == node->trx->id); + == node->trx->id || node->table->is_temporary()); if (dict_table_has_atomic_blobs(node->table)) { /* There is no prefix of externally stored diff --git a/storage/mroonga/lib/mrn_multiple_column_key_codec.cpp b/storage/mroonga/lib/mrn_multiple_column_key_codec.cpp index 5536eecb255..73639685d0e 100644 --- a/storage/mroonga/lib/mrn_multiple_column_key_codec.cpp +++ b/storage/mroonga/lib/mrn_multiple_column_key_codec.cpp @@ -675,7 +675,8 @@ namespace mrn { &normalized, &normalized_length, NULL); uint16 new_blob_data_length; if (normalized_length <= UINT_MAX16) { - memcpy(grn_key, normalized, normalized_length); + if (normalized_length) + memcpy(grn_key, normalized, normalized_length); if (normalized_length < *mysql_key_size) { memset(grn_key + normalized_length, '\0', *mysql_key_size - normalized_length); diff --git a/storage/mroonga/vendor/groonga/lib/alloc.c b/storage/mroonga/vendor/groonga/lib/alloc.c index 2e28431595a..5e556b83712 100644 --- a/storage/mroonga/vendor/groonga/lib/alloc.c +++ b/storage/mroonga/vendor/groonga/lib/alloc.c @@ -310,13 +310,13 @@ grn_alloc_info_free(grn_ctx *ctx) } #endif /* USE_MEMORY_DEBUG */ -#define GRN_CTX_SEGMENT_SIZE (1<<22) +#define GRN_CTX_SEGMENT_SIZE (1U <<22) #define GRN_CTX_SEGMENT_MASK (GRN_CTX_SEGMENT_SIZE - 1) -#define GRN_CTX_SEGMENT_WORD (1<<31) -#define GRN_CTX_SEGMENT_VLEN (1<<30) -#define GRN_CTX_SEGMENT_LIFO (1<<29) -#define GRN_CTX_SEGMENT_DIRTY (1<<28) +#define GRN_CTX_SEGMENT_WORD (1U <<31) +#define GRN_CTX_SEGMENT_VLEN (1U <<30) +#define GRN_CTX_SEGMENT_LIFO (1U <<29) +#define GRN_CTX_SEGMENT_DIRTY (1U <<28) void grn_alloc_init_ctx_impl(grn_ctx *ctx) @@ -400,8 +400,8 @@ grn_ctx_alloc(grn_ctx *ctx, size_t size, int flags, header[0] = i; header[1] = (int32_t) size; } else { - i = ctx->impl->currseg; - mi = &ctx->impl->segs[i]; + if ((i = ctx->impl->currseg) >= 0) + mi = &ctx->impl->segs[i]; if (i < 0 || size + mi->nref > GRN_CTX_SEGMENT_SIZE) { for (i = 0, mi = ctx->impl->segs;; i++, mi++) { if (i >= GRN_CTX_N_SEGMENTS) { diff --git a/storage/mroonga/vendor/groonga/lib/db.c b/storage/mroonga/vendor/groonga/lib/db.c index 46f3f783e59..7749d4c0165 100644 --- a/storage/mroonga/vendor/groonga/lib/db.c +++ b/storage/mroonga/vendor/groonga/lib/db.c @@ -12494,7 +12494,7 @@ grn_db_init_builtin_types(grn_ctx *ctx) GRN_OBJ_KEY_VAR_SIZE, 1 << 16); if (!obj || DB_OBJ(obj)->id != GRN_DB_TEXT) { return GRN_FILE_CORRUPT; } obj = deftype(ctx, "LongText", - GRN_OBJ_KEY_VAR_SIZE, 1 << 31); + GRN_OBJ_KEY_VAR_SIZE, 1U << 31); if (!obj || DB_OBJ(obj)->id != GRN_DB_LONG_TEXT) { return GRN_FILE_CORRUPT; } obj = deftype(ctx, "TokyoGeoPoint", GRN_OBJ_KEY_GEO_POINT, sizeof(grn_geo_point)); diff --git a/storage/mroonga/vendor/groonga/lib/pat.c b/storage/mroonga/vendor/groonga/lib/pat.c index 642173e2fdc..01f6108fbd0 100644 --- a/storage/mroonga/vendor/groonga/lib/pat.c +++ b/storage/mroonga/vendor/groonga/lib/pat.c @@ -899,7 +899,7 @@ chop(grn_ctx *ctx, grn_pat *pat, const char **key, const char *end, uint32_t *lk case GRN_OBJ_KEY_FLOAT :\ if ((size) == sizeof(int64_t)) {\ int64_t v = *(int64_t *)(key);\ - v ^= ((v >> 63)|(1LL << 63));\ + v ^= ((v >> 63)|(1ULL << 63));\ grn_hton((keybuf), &v, (size));\ }\ break;\ @@ -924,7 +924,7 @@ chop(grn_ctx *ctx, grn_pat *pat, const char **key, const char *end, uint32_t *lk if ((size) == sizeof(int64_t)) {\ int64_t v;\ grn_hton(&v, (key), (size));\ - *((int64_t *)(keybuf)) = v ^ (((v^(1LL<<63))>> 63)|(1LL<<63)); \ + *((int64_t *)(keybuf)) = v ^ ((((int64_t)(v^(1ULL<<63)))>> 63)|(1ULL<<63)); \ }\ break;\ }\ diff --git a/storage/mroonga/vendor/groonga/lib/proc/proc_select.c b/storage/mroonga/vendor/groonga/lib/proc/proc_select.c index d17571c3470..a665b1cc898 100644 --- a/storage/mroonga/vendor/groonga/lib/proc/proc_select.c +++ b/storage/mroonga/vendor/groonga/lib/proc/proc_select.c @@ -2989,7 +2989,8 @@ grn_select(grn_ctx *ctx, grn_select_data *data) char *cp = cache_key; #define PUT_CACHE_KEY(string) \ - grn_memcpy(cp, (string).value, (string).length); \ + if ((string).value) \ + grn_memcpy(cp, (string).value, (string).length); \ cp += (string).length; \ *cp++ = '\0' diff --git a/storage/mroonga/vendor/groonga/lib/str.c b/storage/mroonga/vendor/groonga/lib/str.c index 6b2d17769ca..4f0a3a98699 100644 --- a/storage/mroonga/vendor/groonga/lib/str.c +++ b/storage/mroonga/vendor/groonga/lib/str.c @@ -46,7 +46,7 @@ grn_str_charlen_utf8(grn_ctx *ctx, const unsigned char *str, const unsigned char if (*str & 0x80) { int i; int len; - GRN_BIT_SCAN_REV(~(*str << 24), len); + GRN_BIT_SCAN_REV(~(((uint) *str) << 24), len); len = 31 - len; if ((unsigned int)(len - 2) >= 3) { /* (len == 1 || len >= 5) */ GRN_LOG(ctx, GRN_LOG_WARNING, @@ -1963,7 +1963,8 @@ grn_bulk_write(grn_ctx *ctx, grn_obj *buf, const char *str, unsigned int len) if ((rc = grn_bulk_resize(ctx, buf, GRN_BULK_VSIZE(buf) + len))) { return rc; } } curr = GRN_BULK_CURR(buf); - grn_memcpy(curr, str, len); + if (str) + grn_memcpy(curr, str, len); GRN_BULK_INCR_LEN(buf, len); return rc; } diff --git a/storage/myisam/myisampack.c b/storage/myisam/myisampack.c index f7626f93acf..d6cd9334a55 100644 --- a/storage/myisam/myisampack.c +++ b/storage/myisam/myisampack.c @@ -1953,7 +1953,7 @@ static void make_traverse_code_tree(HUFF_TREE *huff_tree, { chr=element->a.leaf.element_nr; huff_tree->code_len[chr]= (uchar) (8 * sizeof(ulonglong) - size); - huff_tree->code[chr]= (code >> size); + huff_tree->code[chr]= (size == 8 * sizeof(ulonglong)) ? 0 : (code >> size); if (huff_tree->height < 8 * sizeof(ulonglong) - size) huff_tree->height= 8 * sizeof(ulonglong) - size; } @@ -2944,12 +2944,15 @@ static void flush_bits(void) ulonglong bit_buffer; bits= file_buffer.bits & ~7; - bit_buffer= file_buffer.bitbucket >> bits; - bits= BITS_SAVED - bits; - while (bits > 0) + if (bits != BITS_SAVED) { - bits-= 8; - *file_buffer.pos++= (uchar) (bit_buffer >> bits); + bit_buffer= file_buffer.bitbucket >> bits; + bits= BITS_SAVED - bits; + while (bits > 0) + { + bits-= 8; + *file_buffer.pos++= (uchar) (bit_buffer >> bits); + } } if (file_buffer.pos >= file_buffer.end) (void) flush_buffer(~ (ulong) 0); diff --git a/storage/rocksdb/mysql-test/rocksdb/r/add_index_inplace_crash.result b/storage/rocksdb/mysql-test/rocksdb/r/add_index_inplace_crash.result index d3801258f0c..439383b04f4 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/add_index_inplace_crash.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/add_index_inplace_crash.result @@ -7,7 +7,7 @@ INSERT INTO t1 (a, b) VALUES (3, 7); flush logs; SET SESSION debug_dbug="+d,crash_during_online_index_creation"; ALTER TABLE t1 ADD INDEX kb(b), ALGORITHM=INPLACE; -ERROR HY000: Lost connection to MySQL server during query +ERROR HY000: Lost connection to server during query SET SESSION debug_dbug="-d,crash_during_online_index_creation"; SHOW CREATE TABLE t1; Table Create Table @@ -26,7 +26,7 @@ CREATE TABLE t1 (i INT, j INT, k INT, PRIMARY KEY (i), KEY(j)) ENGINE = ROCKSDB flush logs; SET SESSION debug_dbug="+d,crash_during_index_creation_partition"; ALTER TABLE t1 ADD INDEX kij(i,j), ALGORITHM=INPLACE; -ERROR HY000: Lost connection to MySQL server during query +ERROR HY000: Lost connection to server during query SET SESSION debug_dbug="-d,crash_during_index_creation_partition"; SHOW CREATE TABLE t1; Table Create Table diff --git a/storage/rocksdb/mysql-test/rocksdb/r/allow_to_start_after_corruption.result b/storage/rocksdb/mysql-test/rocksdb/r/allow_to_start_after_corruption.result index 9b5a335b6f8..9bf297579ed 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/allow_to_start_after_corruption.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/allow_to_start_after_corruption.result @@ -14,7 +14,7 @@ pk col1 1 1 set session debug_dbug= "+d,rocksdb_return_status_corrupted"; select * from t1 where pk=1; -ERROR HY000: Lost connection to MySQL server during query +ERROR HY000: Lost connection to server during query FOUND 1 /data corruption detected/ in allow_to_start_after_corruption_debug.err # # The same for scan queries @@ -26,7 +26,7 @@ pk col1 3 3 set session debug_dbug= "+d,rocksdb_return_status_corrupted"; select * from t1; -ERROR HY000: Lost connection to MySQL server during query +ERROR HY000: Lost connection to server during query FOUND 1 /data corruption detected/ in allow_to_start_after_corruption_debug.err # # Test restart failure. The server is shutdown at this point. diff --git a/storage/rocksdb/mysql-test/rocksdb/r/autoinc_debug.result b/storage/rocksdb/mysql-test/rocksdb/r/autoinc_debug.result index 604e5572eab..ab81b4f5cde 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/autoinc_debug.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/autoinc_debug.result @@ -58,7 +58,7 @@ insert into t values (); insert into t values (); set debug_dbug="+d,crash_commit_before"; commit; -ERROR HY000: Lost connection to MySQL server during query +ERROR HY000: Lost connection to server during query select max(i) into @row_max from t; select table_schema, table_name, auto_increment > @row_max from information_schema.tables where table_name = 't'; table_schema table_name auto_increment > @row_max @@ -69,7 +69,7 @@ insert into t values (); insert into t values (); set debug_dbug="+d,crash_commit_after_prepare"; commit; -ERROR HY000: Lost connection to MySQL server during query +ERROR HY000: Lost connection to server during query select max(i) into @row_max from t; select table_schema, table_name, auto_increment > @row_max from information_schema.tables where table_name = 't'; table_schema table_name auto_increment > @row_max @@ -80,7 +80,7 @@ insert into t values (); insert into t values (); set debug_dbug="+d,crash_commit_after_log"; commit; -ERROR HY000: Lost connection to MySQL server during query +ERROR HY000: Lost connection to server during query select max(i) into @row_max from t; select table_schema, table_name, auto_increment > @row_max from information_schema.tables where table_name = 't'; table_schema table_name auto_increment > @row_max @@ -91,7 +91,7 @@ insert into t values (); insert into t values (); set debug_dbug="+d,crash_commit_after"; commit; -ERROR HY000: Lost connection to MySQL server during query +ERROR HY000: Lost connection to server during query select max(i) into @row_max from t; select table_schema, table_name, auto_increment > @row_max from information_schema.tables where table_name = 't'; table_schema table_name auto_increment > @row_max diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_gtid_rocksdb_sys_header.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_gtid_rocksdb_sys_header.result index b2703ee0cbb..2b5c5300a0f 100644 --- a/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_gtid_rocksdb_sys_header.result +++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_gtid_rocksdb_sys_header.result @@ -7,7 +7,7 @@ create table t1 (a int primary key) engine=rocksdb; insert into t1 values(1); SET GLOBAL debug = '+d,crash_before_writing_xid'; insert into t1 values(2); -ERROR HY000: Lost connection to MySQL server during query +ERROR HY000: Lost connection to server during query include/rpl_reconnect.inc SET GLOBAL debug = ``; include/start_slave.inc diff --git a/storage/spider/mysql-test/spider/bugfix/r/mdev_22246.result b/storage/spider/mysql-test/spider/bugfix/r/mdev_22246.result index 4884f60637e..0254d8bfd1c 100644 --- a/storage/spider/mysql-test/spider/bugfix/r/mdev_22246.result +++ b/storage/spider/mysql-test/spider/bugfix/r/mdev_22246.result @@ -47,7 +47,7 @@ SELECT * FROM tbl_a; id node 2 DB-G1 1 DB-G0 -SELECT * FROM tbl_a WHERE id != 0; +SELECT * FROM tbl_a WHERE id <0 || id >0; id node 1 DB-G0 2 DB-G1 diff --git a/storage/spider/mysql-test/spider/bugfix/t/mdev_22246.test b/storage/spider/mysql-test/spider/bugfix/t/mdev_22246.test index 63b04c14e11..9e58bc1a836 100644 --- a/storage/spider/mysql-test/spider/bugfix/t/mdev_22246.test +++ b/storage/spider/mysql-test/spider/bugfix/t/mdev_22246.test @@ -64,7 +64,7 @@ TRUNCATE TABLE mysql.general_log; --connection master_1 SELECT * FROM tbl_a; -SELECT * FROM tbl_a WHERE id != 0; +SELECT * FROM tbl_a WHERE id <0 || id >0; --connection child2_1 eval $CHILD2_1_SELECT_TABLES; |