diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2023-01-13 11:11:04 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2023-01-13 11:11:04 +0200 |
commit | 88c35781cc9f5f3c63de98a8b6e7eb3378d4fae5 (patch) | |
tree | 1a2c280180c19e71b87e520546b3d2473af3b1bd /storage | |
parent | 92c8d6f168f329bf7e3998a4f580781d0239b59a (diff) | |
parent | 1e04cafcba88e1801e828a5bbab7fe9fdd7ca61c (diff) | |
download | mariadb-git-88c35781cc9f5f3c63de98a8b6e7eb3378d4fae5.tar.gz |
Merge 10.7 into 10.8
Diffstat (limited to 'storage')
-rw-r--r-- | storage/archive/azio.c | 21 | ||||
-rw-r--r-- | storage/connect/connect.cc | 6 | ||||
-rw-r--r-- | storage/connect/ioapi.c | 3 | ||||
-rw-r--r-- | storage/connect/tabfmt.cpp | 2 | ||||
-rw-r--r-- | storage/connect/tabtbl.cpp | 4 | ||||
-rw-r--r-- | storage/connect/zip.c | 5 | ||||
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 4 | ||||
-rw-r--r-- | storage/innobase/lock/lock0lock.cc | 8 | ||||
-rw-r--r-- | storage/perfschema/pfs_timer.cc | 4 | ||||
-rw-r--r-- | storage/rocksdb/ha_rocksdb.cc | 5 | ||||
-rw-r--r-- | storage/rocksdb/ha_rocksdb.h | 2 | ||||
-rw-r--r-- | storage/spider/spd_db_conn.cc | 6 |
12 files changed, 28 insertions, 42 deletions
diff --git a/storage/archive/azio.c b/storage/archive/azio.c index d4aae2094a7..9cb9f4693ec 100644 --- a/storage/archive/azio.c +++ b/storage/archive/azio.c @@ -249,8 +249,7 @@ int azdopen(azio_stream *s, File fd, int Flags) for end of file. IN assertion: the stream s has been sucessfully opened for reading. */ -int get_byte(s) - azio_stream *s; +int get_byte(azio_stream *s) { if (s->z_eof) return EOF; if (s->stream.avail_in == 0) @@ -427,8 +426,7 @@ void read_header(azio_stream *s, unsigned char *buffer) * Cleanup then free the given azio_stream. Return a zlib error code. Try freeing in the reverse order of allocations. */ -int destroy (s) - azio_stream *s; +int destroy (azio_stream *s) { int err = Z_OK; @@ -679,9 +677,7 @@ int do_flush (azio_stream *s, int flush) return s->z_err == Z_STREAM_END ? Z_OK : s->z_err; } -int ZEXPORT azflush (s, flush) - azio_stream *s; - int flush; +int ZEXPORT azflush (azio_stream *s, int flush) { int err; @@ -708,8 +704,7 @@ int ZEXPORT azflush (s, flush) /* =========================================================================== Rewinds input file. */ -int azrewind (s) - azio_stream *s; +int azrewind (azio_stream *s) { if (s == NULL || s->mode != 'r') return -1; @@ -733,10 +728,7 @@ int azrewind (s) SEEK_END is not implemented, returns error. In this version of the library, azseek can be extremely slow. */ -my_off_t azseek (s, offset, whence) - azio_stream *s; - my_off_t offset; - int whence; +my_off_t azseek (azio_stream *s, my_off_t offset, int whence) { if (s == NULL || whence == SEEK_END || @@ -812,8 +804,7 @@ my_off_t azseek (s, offset, whence) given compressed file. This position represents a number of bytes in the uncompressed data stream. */ -my_off_t ZEXPORT aztell (file) - azio_stream *file; +my_off_t ZEXPORT aztell (azio_stream *file) { return azseek(file, 0L, SEEK_CUR); } diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc index 41bce530aeb..72b12552b95 100644 --- a/storage/connect/connect.cc +++ b/storage/connect/connect.cc @@ -237,7 +237,7 @@ bool CntOpenTable(PGLOBAL g, PTDB tdbp, MODE mode, char *c1, char *c2, bool del, PHC) { char *p; - int i, n; + int n; bool rcop= true; PCOL colp; //PCOLUMN cp; @@ -276,7 +276,7 @@ bool CntOpenTable(PGLOBAL g, PTDB tdbp, MODE mode, char *c1, char *c2, n = strlen(p) + 1; } // endfor p - for (i = 0, colp = tdbp->GetColumns(); colp; i++, colp = colp->GetNext()) { + for (colp = tdbp->GetColumns(); colp; colp = colp->GetNext()) { if (colp->InitValue(g)) throw 2; @@ -317,7 +317,7 @@ bool CntOpenTable(PGLOBAL g, PTDB tdbp, MODE mode, char *c1, char *c2, n = strlen(p) + 1; } // endfor p - for (i = 0, colp = utp->GetColumns(); colp; i++, colp = colp->GetNext()) { + for (colp = utp->GetColumns(); colp; colp = colp->GetNext()) { if (colp->InitValue(g)) throw 5; diff --git a/storage/connect/ioapi.c b/storage/connect/ioapi.c index 1f339982926..b6a0ec318e6 100644 --- a/storage/connect/ioapi.c +++ b/storage/connect/ioapi.c @@ -221,8 +221,7 @@ static int ZCALLBACK ferror_file_func (voidpf opaque __attribute__((unused)), vo return ret; } -void fill_fopen_filefunc (pzlib_filefunc_def) - zlib_filefunc_def* pzlib_filefunc_def; +void fill_fopen_filefunc (zlib_filefunc_def* pzlib_filefunc_def) { pzlib_filefunc_def->zopen_file = fopen_file_func; pzlib_filefunc_def->zread_file = fread_file_func; diff --git a/storage/connect/tabfmt.cpp b/storage/connect/tabfmt.cpp index e742ed223c8..7edffc638fa 100644 --- a/storage/connect/tabfmt.cpp +++ b/storage/connect/tabfmt.cpp @@ -1054,7 +1054,7 @@ bool TDBCSV::PrepareWriting(PGLOBAL g) if (!strlen(Field[i])) { // Generally null fields are not quoted if (Quoted > 2) - // Except if explicitely required + // Except if explicitly required strcat(strcat(To_Line, qot), qot); } else if (Qot && (strchr(Field[i], Sep) || *Field[i] == Qot diff --git a/storage/connect/tabtbl.cpp b/storage/connect/tabtbl.cpp index b2240bffa2c..607e7d131f3 100644 --- a/storage/connect/tabtbl.cpp +++ b/storage/connect/tabtbl.cpp @@ -230,7 +230,6 @@ PCOL TDBTBL::InsertSpecialColumn(PCOL scp) /***********************************************************************/ bool TDBTBL::InitTableList(PGLOBAL g) { - int n; uint sln; const char *scs; PTABLE tp, tabp; @@ -243,7 +242,7 @@ bool TDBTBL::InitTableList(PGLOBAL g) sln = hc->get_table()->s->connect_string.length; // PlugSetPath(filename, Tdbp->GetFile(g), Tdbp->GetPath()); - for (n = 0, tp = tdp->Tablep; tp; tp = tp->GetNext()) { + for (tp = tdp->Tablep; tp; tp = tp->GetNext()) { if (TestFil(g, To_CondFil, tp)) { tabp = new(g) XTAB(tp); @@ -276,7 +275,6 @@ bool TDBTBL::InitTableList(PGLOBAL g) else Tablist = tabp; - n++; } // endif filp } // endfor tp diff --git a/storage/connect/zip.c b/storage/connect/zip.c index 52d63e108e7..f6a10601968 100644 --- a/storage/connect/zip.c +++ b/storage/connect/zip.c @@ -1471,11 +1471,6 @@ extern int ZEXPORT zipWriteInFileInZip (zipFile file,const void* buf,unsigned in { uLong uTotalOutBefore = zi->ci.stream.total_out; err=deflate(&zi->ci.stream, Z_NO_FLUSH); - if(uTotalOutBefore > zi->ci.stream.total_out) - { - int bBreak = 0; - bBreak++; - } zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ; } diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index ea4e4f6094f..71ee54b7094 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -8580,10 +8580,12 @@ ha_innobase::update_row( const bool vers_ins_row = vers_set_fields && thd_sql_command(m_user_thd) != SQLCOM_ALTER_TABLE; + TABLE_LIST *tl= table->pos_in_table_list; + uint8 op_map= tl->trg_event_map | tl->slave_fk_event_map; /* This is not a delete */ m_prebuilt->upd_node->is_delete = (vers_set_fields && !vers_ins_row) || - (thd_sql_command(m_user_thd) == SQLCOM_DELETE && + (op_map & trg2bit(TRG_EVENT_DELETE) && table->versioned(VERS_TIMESTAMP)) ? VERSIONED_DELETE : NO_DELETE; diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index db4035157b0..46cfb6e5c88 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1996, 2022, Oracle and/or its affiliates. -Copyright (c) 2014, 2022, MariaDB Corporation. +Copyright (c) 2014, 2023, 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 @@ -593,8 +593,6 @@ UNIV_INLINE bool lock_rec_has_to_wait( /*=================*/ - bool for_locking, - /*!< in is called locking or releasing */ const trx_t* trx, /*!< in: trx of new lock */ unsigned type_mode,/*!< in: precise mode of the new lock to set: LOCK_S or LOCK_X, possibly @@ -748,7 +746,7 @@ lock_has_to_wait( } return lock_rec_has_to_wait( - false, lock1->trx, lock1->type_mode, lock2, + lock1->trx, lock1->type_mode, lock2, lock_rec_get_nth_bit(lock1, PAGE_HEAP_NO_SUPREMUM)); } @@ -1025,7 +1023,7 @@ static lock_t *lock_rec_other_has_conflicting(unsigned mode, for (lock_t* lock = lock_sys_t::get_first(cell, id, heap_no); lock; lock = lock_rec_get_next(heap_no, lock)) { - if (lock_rec_has_to_wait(true, trx, mode, lock, is_supremum)) { + if (lock_rec_has_to_wait(trx, mode, lock, is_supremum)) { return(lock); } } diff --git a/storage/perfschema/pfs_timer.cc b/storage/perfschema/pfs_timer.cc index 505e49de968..36cd0df141d 100644 --- a/storage/perfschema/pfs_timer.cc +++ b/storage/perfschema/pfs_timer.cc @@ -167,7 +167,7 @@ void init_timers(void) /* For STAGE and STATEMENT, a timer with a fixed frequency is better. - The prefered timer is nanosecond, or lower resolutions. + The preferred timer is nanosecond, or lower resolutions. */ if (nanosec_to_pico != 0) @@ -209,7 +209,7 @@ void init_timers(void) /* For IDLE, a timer with a fixed frequency is critical, as the CPU clock may slow down a lot if the server is completely idle. - The prefered timer is microsecond, or lower resolutions. + The preferred timer is microsecond, or lower resolutions. */ if (microsec_to_pico != 0) diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index a492685eb84..0fe578e825b 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -8488,8 +8488,7 @@ int ha_rocksdb::index_read_map_impl(uchar *const buf, const uchar *const key, const key_range *end_key) { DBUG_ENTER_FUNC(); - DBUG_EXECUTE_IF("myrocks_busy_loop_on_row_read", int debug_i = 0; - while (1) { debug_i++; }); + DBUG_EXECUTE_IF("myrocks_busy_loop_on_row_read", my_sleep(50000);); int rc = 0; @@ -12159,7 +12158,6 @@ static int calculate_stats( } } - int num_sst = 0; for (const auto &it : props) { std::vector<Rdb_index_stats> sst_stats; Rdb_tbl_prop_coll::read_stats_from_tbl_props(it.second, &sst_stats); @@ -12188,7 +12186,6 @@ static int calculate_stats( stats[it1.m_gl_index_id].merge( it1, true, it_index->second->max_storage_fmt_length()); } - num_sst++; } if (include_memtables) { diff --git a/storage/rocksdb/ha_rocksdb.h b/storage/rocksdb/ha_rocksdb.h index 63bf7ffd602..2d6400231fc 100644 --- a/storage/rocksdb/ha_rocksdb.h +++ b/storage/rocksdb/ha_rocksdb.h @@ -406,7 +406,7 @@ class ha_rocksdb : public my_core::handler { void free_key_buffers(); // the buffer size should be at least 2*Rdb_key_def::INDEX_NUMBER_SIZE - rocksdb::Range get_range(const int i, uchar buf[]) const; + rocksdb::Range get_range(const int i, uchar buf[2 * 4]) const; /* Perf timers for data reads diff --git a/storage/spider/spd_db_conn.cc b/storage/spider/spd_db_conn.cc index ac1346349e7..09bc66f09b4 100644 --- a/storage/spider/spd_db_conn.cc +++ b/storage/spider/spd_db_conn.cc @@ -8812,6 +8812,12 @@ int spider_db_print_item_type( DBUG_ENTER("spider_db_print_item_type"); DBUG_PRINT("info",("spider COND type=%d", item->type())); + if (item->type() == Item::REF_ITEM && + ((Item_ref*)item)->ref_type() == Item_ref::DIRECT_REF) + { + item= item->real_item(); + DBUG_PRINT("info",("spider new COND type=%d", item->type())); + } switch (item->type()) { case Item::FUNC_ITEM: |