Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
f169dfb4
Commit
f169dfb4
authored
Mar 10, 2023
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.5 into 10.6
parents
25c04806
08267ba0
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
172 additions
and
159 deletions
+172
-159
debian/libmariadb-dev.install
debian/libmariadb-dev.install
+1
-0
include/CMakeLists.txt
include/CMakeLists.txt
+3
-0
include/my_alloca.h
include/my_alloca.h
+45
-0
include/my_global.h
include/my_global.h
+1
-7
include/my_sys.h
include/my_sys.h
+1
-13
include/mysql/service_encryption.h
include/mysql/service_encryption.h
+4
-7
plugin/cracklib_password_check/cracklib_password_check.c
plugin/cracklib_password_check/cracklib_password_check.c
+1
-1
plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp
plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp
+1
-4
plugin/handler_socket/libhsclient/allocator.hpp
plugin/handler_socket/libhsclient/allocator.hpp
+1
-0
sql/sql_class.h
sql/sql_class.h
+1
-1
sql/temporary_tables.cc
sql/temporary_tables.cc
+7
-6
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+13
-1
storage/innobase/ibuf/ibuf0ibuf.cc
storage/innobase/ibuf/ibuf0ibuf.cc
+14
-13
storage/innobase/rem/rem0rec.cc
storage/innobase/rem/rem0rec.cc
+78
-105
storage/innobase/srv/srv0start.cc
storage/innobase/srv/srv0start.cc
+1
-1
No files found.
debian/libmariadb-dev.install
View file @
f169dfb4
...
...
@@ -14,6 +14,7 @@ usr/include/mariadb/mariadb_version.h
usr
/
include
/
mariadb
/
my_config
.
h
usr
/
include
/
mariadb
/
my_global
.
h
usr
/
include
/
mariadb
/
my_sys
.
h
usr
/
include
/
mariadb
/
my_alloca
.
h
usr
/
include
/
mariadb
/
mysql
.
h
usr
/
include
/
mariadb
/
mysql
/
usr
/
include
/
mariadb
/
mysql
/
client_plugin
.
h
...
...
include/CMakeLists.txt
View file @
f169dfb4
...
...
@@ -37,6 +37,7 @@ SET(HEADERS
ma_dyncol.h
my_list.h
my_alloc.h
my_alloca.h
typelib.h
my_dbug.h
m_string.h
...
...
@@ -111,7 +112,9 @@ ${footer}
ENDMACRO
()
INSTALL_COMPAT_HEADER
(
my_global.h
""
)
INSTALL_COMPAT_HEADER
(
my_alloca.h
""
)
INSTALL_COMPAT_HEADER
(
my_config.h
""
)
INSTALL_COMPAT_HEADER
(
my_alloca.h
""
)
INSTALL_COMPAT_HEADER
(
my_sys.h
""
)
INSTALL_COMPAT_HEADER
(
mysql_version.h
"
#include <mariadb_version.h>
...
...
include/my_alloca.h
0 → 100644
View file @
f169dfb4
/* Copyright (c) 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 Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
#ifndef MY_ALLOCA_INCLUDED
#define MY_ALLOCA_INCLUDED
#ifdef _WIN32
#include <malloc.h>
/*for alloca*/
/*
MSVC may define "alloca" when compiling in /Ze mode
(with extensions from Microsoft), but otherwise only
the _alloca function is defined:
*/
#ifndef alloca
#define alloca _alloca
#endif
#else
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif
#endif
#if defined(HAVE_ALLOCA)
/*
If the GCC/LLVM compiler from the MinGW is used,
alloca may not be defined when using the MSVC CRT:
*/
#if defined(__GNUC__) && !defined(HAVE_ALLOCA_H) && !defined(alloca)
#define alloca __builtin_alloca
#endif
/* GNUC */
#endif
#endif
/* MY_ALLOCA_INCLUDED */
include/my_global.h
View file @
f169dfb4
...
...
@@ -322,13 +322,6 @@ C_MODE_END
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#if defined(__cplusplus) && defined(NO_CPLUSPLUS_ALLOCA)
#undef HAVE_ALLOCA
#undef HAVE_ALLOCA_H
#endif
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif
#include <errno.h>
/* Recommended by debian */
/* We need the following to go around a problem with openssl on solaris */
...
...
@@ -485,6 +478,7 @@ typedef unsigned short ushort;
#endif
#include <my_compiler.h>
#include <my_alloca.h>
/*
Wen using the embedded library, users might run into link problems,
...
...
include/my_sys.h
View file @
f169dfb4
...
...
@@ -28,9 +28,7 @@ C_MODE_START
#include <m_ctype.h>
/* for CHARSET_INFO */
#include <stdarg.h>
#include <typelib.h>
#ifdef _WIN32
#include <malloc.h>
/*for alloca*/
#endif
#include <my_alloca.h>
#include <mysql/plugin.h>
#include <mysql/service_my_print_error.h>
...
...
@@ -193,16 +191,6 @@ my_bool my_test_if_thinly_provisioned(File handle);
extern
my_bool
my_may_have_atomic_write
;
#if defined(HAVE_ALLOCA) && !defined(HAVE_valgrind)
#if defined(_AIX) && !defined(__GNUC__) && !defined(_AIX43)
#pragma alloca
#endif
/* _AIX */
#if defined(__MWERKS__)
#undef alloca
#define alloca _alloca
#endif
/* __MWERKS__ */
#if defined(__GNUC__) && !defined(HAVE_ALLOCA_H) && ! defined(alloca)
#define alloca __builtin_alloca
#endif
/* GNUC */
#define my_alloca(SZ) alloca((size_t) (SZ))
#define my_afree(PTR) ((void)0)
#define MAX_ALLOCA_SZ 4096
...
...
include/mysql/service_encryption.h
View file @
f169dfb4
...
...
@@ -24,22 +24,19 @@
*provider* (encryption plugin).
*/
#ifdef __cplusplus
extern
"C"
{
#endif
#ifndef MYSQL_ABI_CHECK
#include <my_alloca.h>
#ifdef _WIN32
#include <malloc.h>
#ifndef __cplusplus
#define inline __inline
#endif
#else
#include <stdlib.h>
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif
#endif
#ifdef __cplusplus
extern
"C"
{
#endif
/* returned from encryption_key_get_latest_version() */
...
...
plugin/cracklib_password_check/cracklib_password_check.c
View file @
f169dfb4
...
...
@@ -13,7 +13,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
#include <my_
global
.h>
#include <my_
alloca
.h>
#include <mysql/plugin_password_validation.h>
#include <crack.h>
#include <string.h>
...
...
plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp
View file @
f169dfb4
...
...
@@ -6,7 +6,7 @@
* See COPYRIGHT.txt for details.
*/
#include <my_
global
.h>
#include <my_
alloca
.h>
#include <netinet/in.h>
#include <errno.h>
#include <poll.h>
...
...
@@ -17,9 +17,6 @@
#if __linux__
#include <sys/epoll.h>
#endif
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif
#include "hstcpsvr_worker.hpp"
#include "string_buffer.hpp"
...
...
plugin/handler_socket/libhsclient/allocator.hpp
View file @
f169dfb4
...
...
@@ -11,6 +11,7 @@
#include <stdlib.h>
#include <string.h>
#include <my_alloca.h>
#if 0
extern "C" {
...
...
sql/sql_class.h
View file @
f169dfb4
...
...
@@ -5302,7 +5302,7 @@ class THD: public THD_count, /* this must be first */
bool
use_temporary_table
(
TABLE
*
table
,
TABLE
**
out_table
);
void
close_temporary_table
(
TABLE
*
table
);
bool
log_events_and_free_tmp_shares
();
void
free_tmp_table_share
(
TMP_TABLE_SHARE
*
share
,
bool
delete_table
);
bool
free_tmp_table_share
(
TMP_TABLE_SHARE
*
share
,
bool
delete_table
);
void
free_temporary_table
(
TABLE
*
table
);
bool
lock_temporary_tables
();
void
unlock_temporary_tables
();
...
...
sql/temporary_tables.cc
View file @
f169dfb4
...
...
@@ -670,7 +670,7 @@ bool THD::drop_temporary_table(TABLE *table, bool *is_trans, bool delete_table)
temporary_tables
->
remove
(
share
);
/* Free the TABLE_SHARE and/or delete the files. */
free_tmp_table_share
(
share
,
delete_table
);
result
=
free_tmp_table_share
(
share
,
delete_table
);
end:
if
(
locked
)
...
...
@@ -1455,20 +1455,21 @@ bool THD::log_events_and_free_tmp_shares()
@param share [IN] TABLE_SHARE to free
@param delete_table [IN] Whether to delete the table files?
@return void
@return false Success
true Error
*/
void
THD
::
free_tmp_table_share
(
TMP_TABLE_SHARE
*
share
,
bool
delete_table
)
bool
THD
::
free_tmp_table_share
(
TMP_TABLE_SHARE
*
share
,
bool
delete_table
)
{
bool
error
=
false
;
DBUG_ENTER
(
"THD::free_tmp_table_share"
);
if
(
delete_table
)
{
rm_temporary_table
(
share
->
db_type
(),
share
->
path
.
str
);
error
=
rm_temporary_table
(
share
->
db_type
(),
share
->
path
.
str
);
}
free_table_share
(
share
);
my_free
(
share
);
DBUG_VOID_RETURN
;
DBUG_RETURN
(
error
);
}
...
...
storage/innobase/handler/ha_innodb.cc
View file @
f169dfb4
...
...
@@ -19488,10 +19488,22 @@ static MYSQL_SYSVAR_BOOL(numa_interleave, srv_numa_interleave,
NULL
,
NULL
,
FALSE
);
#endif
/* HAVE_LIBNUMA */
static
void
innodb_change_buffering_update
(
THD
*
thd
,
struct
st_mysql_sys_var
*
,
void
*
,
const
void
*
save
)
{
ulong
i
=
*
static_cast
<
const
ulong
*>
(
save
);
if
(
i
!=
IBUF_USE_NONE
&&
!
ibuf
.
index
)
push_warning
(
thd
,
Sql_condition
::
WARN_LEVEL_WARN
,
ER_NOT_KEYFILE
,
"InnoDB: The change buffer is corrupted."
);
else
innodb_change_buffering
=
i
;
}
static
MYSQL_SYSVAR_ENUM
(
change_buffering
,
innodb_change_buffering
,
PLUGIN_VAR_RQCMDARG
,
"Buffer changes to secondary indexes."
,
NULL
,
NULL
,
IBUF_USE_NONE
,
&
innodb_change_buffering_typelib
);
nullptr
,
innodb_change_buffering_update
,
IBUF_USE_NONE
,
&
innodb_change_buffering_typelib
);
static
MYSQL_SYSVAR_UINT
(
change_buffer_max_size
,
srv_change_buffer_max_size
,
...
...
storage/innobase/ibuf/ibuf0ibuf.cc
View file @
f169dfb4
...
...
@@ -403,8 +403,13 @@ ibuf_init_at_db_start(void)
if
(
!
header_page
)
{
err_exit:
sql_print_error
(
"InnoDB: The change buffer is corrupted"
);
sql_print_error
(
"InnoDB: The change buffer is corrupted"
" or has been removed on upgrade"
" to MariaDB 11.0 or later"
);
mtr
.
commit
();
if
(
innodb_change_buffering
==
IBUF_USE_NONE
)
{
err
=
DB_SUCCESS
;
}
return
err
;
}
...
...
@@ -1978,6 +1983,7 @@ void
ibuf_free_excess_pages
(
void
)
/*========================*/
{
if
(
UNIV_UNLIKELY
(
!
ibuf
.
index
))
return
;
/* Free at most a few pages at a time, so that we do not delay the
requested service too much */
...
...
@@ -2419,6 +2425,7 @@ will be merged from ibuf trees to the pages read
@retval 0 if ibuf.empty */
ulint
ibuf_contract
()
{
if
(
UNIV_UNLIKELY
(
!
ibuf
.
index
))
return
0
;
mtr_t
mtr
;
btr_cur_t
cur
;
ulint
sum_sizes
;
...
...
@@ -2468,6 +2475,7 @@ ibuf_merge_space(
/*=============*/
ulint
space
)
/*!< in: tablespace id to merge */
{
if
(
UNIV_UNLIKELY
(
!
ibuf
.
index
))
return
0
;
mtr_t
mtr
;
btr_pcur_t
pcur
;
...
...
@@ -2933,13 +2941,14 @@ void
ibuf_update_max_tablespace_id
(
void
)
/*===============================*/
{
if
(
UNIV_UNLIKELY
(
!
ibuf
.
index
))
return
;
const
rec_t
*
rec
;
const
byte
*
field
;
ulint
len
;
btr_pcur_t
pcur
;
mtr_t
mtr
;
ut_a
(
!
dict_table_is_comp
(
ibuf
.
index
->
table
));
ut_a
d
(
!
ibuf
.
index
->
table
->
not_redundant
(
));
ibuf_mtr_start
(
&
mtr
);
...
...
@@ -4418,6 +4427,8 @@ in DISCARD TABLESPACE, IMPORT TABLESPACE, or read-ahead.
@param[in] space missing or to-be-discarded tablespace */
void
ibuf_delete_for_discarded_space
(
ulint
space
)
{
if
(
UNIV_UNLIKELY
(
!
ibuf
.
index
))
return
;
btr_pcur_t
pcur
;
const
rec_t
*
ibuf_rec
;
mtr_t
mtr
;
...
...
@@ -4531,6 +4542,7 @@ ibuf_print(
/*=======*/
FILE
*
file
)
/*!< in: file where to print */
{
if
(
UNIV_UNLIKELY
(
!
ibuf
.
index
))
return
;
mysql_mutex_lock
(
&
ibuf_mutex
);
fprintf
(
file
,
...
...
@@ -4570,8 +4582,6 @@ dberr_t ibuf_check_bitmap_on_import(const trx_t* trx, fil_space_t* space)
mtr_t
mtr
;
mysql_mutex_lock
(
&
ibuf_mutex
);
/* The two bitmap pages (allocation bitmap and ibuf bitmap) repeat
every page_size pages. For example if page_size is 16 KiB, then the
two bitmap pages repeat every 16 KiB * 16384 = 256 MiB. In the loop
...
...
@@ -4580,18 +4590,14 @@ dberr_t ibuf_check_bitmap_on_import(const trx_t* trx, fil_space_t* space)
for
(
uint32_t
page_no
=
0
;
page_no
<
size
;
page_no
+=
physical_size
)
{
if
(
trx_is_interrupted
(
trx
))
{
mysql_mutex_unlock
(
&
ibuf_mutex
);
return
(
DB_INTERRUPTED
);
}
mtr_start
(
&
mtr
);
ibuf_enter
(
&
mtr
);
buf_block_t
*
bitmap_page
=
ibuf_bitmap_get_map_page
(
page_id_t
(
space
->
id
,
page_no
),
zip_size
,
&
mtr
);
if
(
!
bitmap_page
)
{
mysql_mutex_unlock
(
&
ibuf_mutex
);
ibuf_exit
(
&
mtr
);
mtr
.
commit
();
return
DB_CORRUPTION
;
}
...
...
@@ -4614,7 +4620,6 @@ dberr_t ibuf_check_bitmap_on_import(const trx_t* trx, fil_space_t* space)
physical_size
)));
}
#endif
/* UNIV_DEBUG */
ibuf_exit
(
&
mtr
);
mtr_commit
(
&
mtr
);
continue
;
}
...
...
@@ -4629,8 +4634,6 @@ dberr_t ibuf_check_bitmap_on_import(const trx_t* trx, fil_space_t* space)
cur_page_id
,
zip_size
,
IBUF_BITMAP_IBUF
,
&
mtr
))
{
mysql_mutex_unlock
(
&
ibuf_mutex
);
ibuf_exit
(
&
mtr
);
mtr_commit
(
&
mtr
);
ib_errf
(
trx
->
mysql_thd
,
...
...
@@ -4664,11 +4667,9 @@ dberr_t ibuf_check_bitmap_on_import(const trx_t* trx, fil_space_t* space)
}
}
ibuf_exit
(
&
mtr
);
mtr_commit
(
&
mtr
);
}
mysql_mutex_unlock
(
&
ibuf_mutex
);
return
(
DB_SUCCESS
);
}
...
...
storage/innobase/rem/rem0rec.cc
View file @
f169dfb4
...
...
@@ -217,14 +217,12 @@ rec_get_n_extern_new(
stored in one byte for 0..127. The length
will be encoded in two bytes when it is 128 or
more, or when the field is stored externally. */
if
(
DATA_BIG_COL
(
col
))
{
if
(
len
&
0x80
)
{
/* 1exxxxxxx xxxxxxxx */
if
(
len
&
0x40
)
{
n_extern
++
;
}
lens
--
;
if
(
UNIV_UNLIKELY
(
len
&
0x80
)
&&
DATA_BIG_COL
(
col
))
{
/* 1exxxxxxx xxxxxxxx */
if
(
len
&
0x40
)
{
n_extern
++
;
}
lens
--
;
}
}
}
while
(
++
i
<
n
);
...
...
@@ -244,6 +242,10 @@ enum rec_leaf_format {
REC_LEAF_INSTANT
};
#if defined __GNUC__ && !defined __clang__ && __GNUC__ < 11
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wconversion"
/* GCC 5 to 10 need this */
#endif
/** Determine the offset to each field in a leaf-page record
in ROW_FORMAT=COMPACT,DYNAMIC,COMPRESSED.
This is a special case of rec_init_offsets() and rec_get_offsets_func().
...
...
@@ -361,8 +363,7 @@ rec_init_offsets_comp_ordinary(
do
{
if
(
mblob
)
{
if
(
i
==
index
->
first_user_field
())
{
offs
=
static_cast
<
rec_offs
>
(
offs
+
FIELD_REF_SIZE
);
offs
+=
FIELD_REF_SIZE
;
len
=
combine
(
offs
,
STORED_OFFPAGE
);
any
|=
REC_OFFS_EXTERNAL
;
field
--
;
...
...
@@ -433,27 +434,23 @@ rec_init_offsets_comp_ordinary(
stored in one byte for 0..127. The length
will be encoded in two bytes when it is 128 or
more, or when the field is stored externally. */
if
((
len
&
0x80
)
&&
DATA_BIG_COL
(
col
))
{
if
(
UNIV_UNLIKELY
(
len
&
0x80
)
&&
DATA_BIG_COL
(
col
))
{
/* 1exxxxxxx xxxxxxxx */
len
=
static_cast
<
rec_offs
>
(
len
<<
8
|
*
lens
--
);
offs
=
static_cast
<
rec_offs
>
(
offs
+
get_value
(
len
));
if
(
UNIV_UNLIKELY
(
len
&
0x4000
))
{
ut_ad
(
index
->
is_primary
());
any
|=
REC_OFFS_EXTERNAL
;
len
=
combine
(
offs
,
STORED_OFFPAGE
);
}
else
{
len
=
offs
;
}
len
<<=
8
;
len
|=
*
lens
--
;
static_assert
(
STORED_OFFPAGE
==
0x4000
,
""
);
static_assert
(
REC_OFFS_EXTERNAL
==
0x4000
,
""
);
const
rec_offs
ext
=
len
&
REC_OFFS_EXTERNAL
;
offs
+=
get_value
(
len
);
len
=
offs
|
ext
;
any
|=
ext
;
ut_ad
(
!
ext
||
index
->
is_primary
());
continue
;
}
len
=
offs
=
static_cast
<
rec_offs
>
(
offs
+
len
)
;
len
=
offs
+=
len
;
}
else
{
len
=
offs
=
static_cast
<
rec_offs
>
(
offs
+
field
->
fixed_len
);
len
=
offs
+=
field
->
fixed_len
;
}
}
while
(
field
++
,
rec_offs_base
(
offsets
)[
++
i
]
=
len
,
i
<
rec_offs_n_fields
(
offsets
));
...
...
@@ -679,8 +676,7 @@ rec_init_offsets(
do
{
rec_offs
len
;
if
(
UNIV_UNLIKELY
(
i
==
n_node_ptr_field
))
{
len
=
offs
=
static_cast
<
rec_offs
>
(
offs
+
REC_NODE_PTR_SIZE
);
len
=
offs
+=
REC_NODE_PTR_SIZE
;
goto
resolved
;
}
...
...
@@ -720,29 +716,25 @@ rec_init_offsets(
encoded in two bytes when it is 128 or
more, or when the field is stored
externally. */
if
(
DATA_BIG_COL
(
col
))
{
if
(
len
&
0x80
)
{
/* 1exxxxxxx xxxxxxxx */
len
=
static_cast
<
rec_offs
>
(
len
<<
8
|
*
lens
--
);
/* B-tree node pointers
must not contain externally
stored columns. Thus
the "e" flag must be 0. */
ut_a
(
!
(
len
&
0x4000
));
offs
=
static_cast
<
rec_offs
>
(
offs
+
get_value
(
len
));
len
=
offs
;
goto
resolved
;
}
if
(
UNIV_UNLIKELY
(
len
&
0x80
)
&&
DATA_BIG_COL
(
col
))
{
/* 1exxxxxxx xxxxxxxx */
len
<<=
8
;
len
|=
*
lens
--
;
/* B-tree node pointers
must not contain externally
stored columns. Thus
the "e" flag must be 0. */
ut_a
(
!
(
len
&
0x4000
));
offs
+=
len
&
0x3fff
;
len
=
offs
;
goto
resolved
;
}
len
=
offs
=
static_cast
<
rec_offs
>
(
offs
+
len
)
;
len
=
offs
+=
len
;
}
else
{
len
=
offs
=
static_cast
<
rec_offs
>
(
offs
+
field
->
fixed_len
);
len
=
offs
+=
field
->
fixed_len
;
}
resolved:
rec_offs_base
(
offsets
)[
i
+
1
]
=
len
;
...
...
@@ -759,35 +751,30 @@ rec_init_offsets(
rec_offs
any
;
if
(
rec_get_1byte_offs_flag
(
rec
))
{
offs
=
static_cast
<
rec_offs
>
(
offs
+
n_fields
);
offs
+=
static_cast
<
rec_offs
>
(
n_fields
);
any
=
offs
;
/* Determine offsets to fields */
do
{
offs
=
rec_1_get_field_end_info
(
rec
,
i
);
if
(
offs
&
REC_1BYTE_SQL_NULL_MASK
)
{
offs
&=
static_cast
<
rec_offs
>
(
~
REC_1BYTE_SQL_NULL_MASK
);
set_type
(
offs
,
SQL_NULL
);
offs
^=
REC_1BYTE_SQL_NULL_MASK
|
SQL_NULL
;
}
rec_offs_base
(
offsets
)[
1
+
i
]
=
offs
;
}
while
(
++
i
<
n
);
}
else
{
offs
=
static_cast
<
rec_offs
>
(
offs
+
2
*
n_fields
);
offs
+=
static_cast
<
rec_offs
>
(
2
*
n_fields
);
any
=
offs
;
/* Determine offsets to fields */
do
{
offs
=
rec_2_get_field_end_info
(
rec
,
i
);
if
(
offs
&
REC_2BYTE_SQL_NULL_MASK
)
{
offs
&=
static_cast
<
rec_offs
>
(
~
REC_2BYTE_SQL_NULL_MASK
);
set_type
(
offs
,
SQL_NULL
);
}
if
(
offs
&
REC_2BYTE_EXTERN_MASK
)
{
offs
&=
static_cast
<
rec_offs
>
(
~
REC_2BYTE_EXTERN_MASK
);
set_type
(
offs
,
STORED_OFFPAGE
);
any
|=
REC_OFFS_EXTERNAL
;
}
static_assert
(
REC_2BYTE_SQL_NULL_MASK
==
SQL_NULL
,
""
);
static_assert
(
REC_2BYTE_EXTERN_MASK
==
STORED_OFFPAGE
,
""
);
static_assert
(
REC_OFFS_EXTERNAL
==
STORED_OFFPAGE
,
""
);
any
|=
(
offs
&
REC_OFFS_EXTERNAL
);
rec_offs_base
(
offsets
)[
1
+
i
]
=
offs
;
}
while
(
++
i
<
n
);
}
...
...
@@ -999,8 +986,7 @@ rec_get_offsets_reverse(
do
{
rec_offs
len
;
if
(
UNIV_UNLIKELY
(
i
==
n_node_ptr_field
))
{
len
=
offs
=
static_cast
<
rec_offs
>
(
offs
+
REC_NODE_PTR_SIZE
);
len
=
offs
+=
REC_NODE_PTR_SIZE
;
goto
resolved
;
}
...
...
@@ -1037,30 +1023,23 @@ rec_get_offsets_reverse(
stored in one byte for 0..127. The length
will be encoded in two bytes when it is 128 or
more, or when the field is stored externally. */
if
(
DATA_BIG_COL
(
col
))
{
if
(
len
&
0x80
)
{
/* 1exxxxxxx xxxxxxxx */
len
=
static_cast
<
rec_offs
>
(
len
<<
8
|
*
lens
++
);
offs
=
static_cast
<
rec_offs
>
(
offs
+
get_value
(
len
));
if
(
UNIV_UNLIKELY
(
len
&
0x4000
))
{
any_ext
=
REC_OFFS_EXTERNAL
;
len
=
combine
(
offs
,
STORED_OFFPAGE
);
}
else
{
len
=
offs
;
}
goto
resolved
;
}
if
(
UNIV_UNLIKELY
(
len
&
0x80
)
&&
DATA_BIG_COL
(
col
))
{
/* 1exxxxxxx xxxxxxxx */
len
&=
0x7f
;
len
<<=
8
;
len
|=
*
lens
++
;
static_assert
(
STORED_OFFPAGE
==
0x4000
,
""
);
static_assert
(
REC_OFFS_EXTERNAL
==
0x4000
,
""
);
rec_offs
ext
=
len
&
REC_OFFS_EXTERNAL
;
offs
+=
get_value
(
len
);
len
=
offs
|
ext
;
any_ext
|=
ext
;
goto
resolved
;
}
len
=
offs
=
static_cast
<
rec_offs
>
(
offs
+
len
)
;
len
=
offs
+=
len
;
}
else
{
len
=
offs
=
static_cast
<
rec_offs
>
(
offs
+
field
->
fixed_len
);
len
=
offs
+=
field
->
fixed_len
;
}
resolved:
rec_offs_base
(
offsets
)[
i
+
1
]
=
len
;
...
...
@@ -1100,7 +1079,7 @@ rec_get_nth_field_offs_old(
return
(
os
);
}
next_os
=
next_os
&
~
REC_1BYTE_SQL_NULL_MASK
;
next_os
&=
~
REC_1BYTE_SQL_NULL_MASK
;
}
else
{
os
=
rec_2_get_field_start_offs
(
rec
,
n
);
...
...
@@ -1112,8 +1091,7 @@ rec_get_nth_field_offs_old(
return
(
os
);
}
next_os
=
next_os
&
~
(
REC_2BYTE_SQL_NULL_MASK
|
REC_2BYTE_EXTERN_MASK
);
next_os
&=
~
(
REC_2BYTE_SQL_NULL_MASK
|
REC_2BYTE_EXTERN_MASK
);
}
*
len
=
next_os
-
os
;
...
...
@@ -1266,7 +1244,8 @@ rec_get_converted_size_comp_prefix_low(
}
else
if
(
dfield_is_ext
(
dfield
))
{
ut_ad
(
DATA_BIG_COL
(
field
->
col
));
extra_size
+=
2
;
}
else
if
(
len
<
128
||
!
DATA_BIG_COL
(
field
->
col
))
{
}
else
if
(
UNIV_LIKELY
(
len
<
128
)
||
!
DATA_BIG_COL
(
field
->
col
))
{
extra_size
++
;
}
else
{
/* For variable-length columns, we look up the
...
...
@@ -1617,14 +1596,7 @@ rec_convert_dtuple_to_rec_comp(
/* set the null flag if necessary */
if
(
dfield_is_null
(
field
))
{
#if defined __GNUC__ && !defined __clang__ && __GNUC__ < 6
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wconversion"
/* GCC 5 may need this here */
#endif
*
nulls
|=
static_cast
<
byte
>
(
null_mask
);
#if defined __GNUC__ && !defined __clang__ && __GNUC__ < 6
# pragma GCC diagnostic pop
#endif
null_mask
<<=
1
;
continue
;
}
...
...
@@ -1733,6 +1705,9 @@ rec_convert_dtuple_to_rec_new(
REC_INFO_BITS_MASK
,
REC_INFO_BITS_SHIFT
);
return
buf
;
}
#if defined __GNUC__ && !defined __clang__ && __GNUC__ < 11
# pragma GCC diagnostic pop
/* ignored "-Wconversion" */
#endif
/*********************************************************//**
Builds a physical record out of a data tuple and
...
...
@@ -2095,14 +2070,12 @@ rec_copy_prefix_to_buf(
stored in one byte for 0..127. The length
will be encoded in two bytes when it is 128 or
more, or when the column is stored externally. */
if
(
DATA_BIG_COL
(
col
))
{
if
(
len
&
0x80
)
{
/* 1exxxxxx */
len
&=
0x3f
;
len
<<=
8
;
len
|=
*
lens
--
;
UNIV_PREFETCH_R
(
lens
);
}
if
(
UNIV_UNLIKELY
(
len
&
0x80
)
&&
DATA_BIG_COL
(
col
))
{
/* 1exxxxxx */
len
&=
0x3f
;
len
<<=
8
;
len
|=
*
lens
--
;
UNIV_PREFETCH_R
(
lens
);
}
prefix_len
+=
len
;
}
...
...
storage/innobase/srv/srv0start.cc
View file @
f169dfb4
...
...
@@ -2001,7 +2001,7 @@ void innodb_shutdown()
||
srv_force_recovery
>=
SRV_FORCE_NO_TRX_UNDO
);
ut_ad
(
lock_sys
.
is_initialised
()
||
!
srv_was_started
);
ut_ad
(
log_sys
.
is_initialised
()
||
!
srv_was_started
);
ut_ad
(
ibuf
.
index
||
!
srv_was_started
ut_ad
(
ibuf
.
index
||
!
innodb_change_buffering
||
!
srv_was_started
||
srv_force_recovery
>=
SRV_FORCE_NO_DDL_UNDO
);
dict_stats_deinit
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment