Skip to content

Commit ad436d9

Browse files
committed
Merge 10.5 into 10.6
2 parents 8c68b54 + 39378e1 commit ad436d9

File tree

12 files changed

+128
-119
lines changed

12 files changed

+128
-119
lines changed

cmake/cpack_rpm.cmake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,7 @@ ENDIF()
302302
IF(CMAKE_VERSION VERSION_GREATER "3.9.99")
303303

304304
SET(CPACK_SOURCE_GENERATOR "RPM")
305-
SETA(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS
306-
"-DRPM=${RPM}"
307-
)
305+
SETA(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS "-DRPM=${RPM}")
308306

309307
MACRO(ADDIF var)
310308
IF(DEFINED ${var})

cmake/plugin.cmake

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,21 @@ INCLUDE(CMakeParseArguments)
1919

2020
# MYSQL_ADD_PLUGIN(plugin_name source1...sourceN
2121
# [STORAGE_ENGINE]
22-
# [CLIENT]
22+
# [STATIC_ONLY|MODULE_ONLY]
2323
# [MANDATORY|DEFAULT]
24-
# [STATIC_ONLY|DYNAMIC_ONLY]
24+
# [DISABLED]
25+
# [NOT_EMBEDDED|RECOMPILE_FOR_EMBEDDED]
26+
# [CLIENT]
2527
# [MODULE_OUTPUT_NAME module_name]
2628
# [STATIC_OUTPUT_NAME static_name]
27-
# [RECOMPILE_FOR_EMBEDDED]
28-
# [NOT_EMBEDDED]
29+
# [COMPONENT component]
30+
# [CONFIG cnf_file_name]
2931
# [LINK_LIBRARIES lib1...libN]
3032
# [DEPENDENCIES target1...targetN]
3133

3234
MACRO(MYSQL_ADD_PLUGIN)
3335
CMAKE_PARSE_ARGUMENTS(ARG
34-
"STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;NOT_EMBEDDED;RECOMPILE_FOR_EMBEDDED;CLIENT;EXPORT_SYMBOLS"
36+
"STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;NOT_EMBEDDED;RECOMPILE_FOR_EMBEDDED;CLIENT"
3537
"MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG"
3638
"LINK_LIBRARIES;DEPENDENCIES"
3739
${ARGN}
@@ -140,9 +142,7 @@ MACRO(MYSQL_ADD_PLUGIN)
140142
ADD_LIBRARY(${target} STATIC ${SOURCES})
141143
DTRACE_INSTRUMENT(${target})
142144
ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES})
143-
IF(NOT ARG_EXPORT_SYMBOLS)
144-
RESTRICT_SYMBOL_EXPORTS(${target})
145-
ENDIF()
145+
RESTRICT_SYMBOL_EXPORTS(${target})
146146
IF(WITH_EMBEDDED_SERVER AND (NOT ARG_NOT_EMBEDDED))
147147
# Embedded library should contain PIC code and be linkable
148148
# to shared libraries (on systems that need PIC)

mysql-test/suite/innodb/r/innodb-page_compression_tables.result

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ innodb_redundant CREATE TABLE `innodb_redundant` (
5555
`b` char(200) DEFAULT NULL
5656
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT `page_compressed`=1
5757
drop table innodb_redundant;
58+
#
59+
# MDEV-24455 Assertion `!m_freed_space' failed in mtr_t::start
60+
#
61+
CREATE TABLE t1 (a TEXT, b TEXT) ENGINE=InnoDB PAGE_COMPRESSED='ON';
62+
BEGIN;
63+
INSERT INTO t1 VALUES(REPEAT('x',81),REPEAT('x',8034));
64+
ROLLBACK;
65+
DROP TABLE t1;
5866
create procedure innodb_insert_proc (repeat_count int)
5967
begin
6068
declare current_num int;

mysql-test/suite/innodb/t/innodb-page_compression_tables.test

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ alter table innodb_redundant row_format=compact page_compressed=1;
3030
show create table innodb_redundant;
3131
drop table innodb_redundant;
3232

33+
--echo #
34+
--echo # MDEV-24455 Assertion `!m_freed_space' failed in mtr_t::start
35+
--echo #
36+
CREATE TABLE t1 (a TEXT, b TEXT) ENGINE=InnoDB PAGE_COMPRESSED='ON';
37+
BEGIN; INSERT INTO t1 VALUES(REPEAT('x',81),REPEAT('x',8034)); ROLLBACK;
38+
DROP TABLE t1;
39+
3340
delimiter //;
3441
create procedure innodb_insert_proc (repeat_count int)
3542
begin

plugin/type_inet/mysql-test/type_inet/type_inet6_plugin.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ PLUGIN_TYPE DATA TYPE
2424
PLUGIN_AUTHOR MariaDB Corporation
2525
PLUGIN_DESCRIPTION Data type INET6
2626
PLUGIN_LICENSE GPL
27-
PLUGIN_MATURITY Beta
27+
PLUGIN_MATURITY Gamma
2828
PLUGIN_AUTH_VERSION 1.0
2929
#
3030
# End of 10.5 tests

plugin/type_inet/plugin.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ maria_declare_plugin(type_inet)
186186
NULL, // Status variables
187187
NULL, // System variables
188188
"1.0", // String version representation
189-
MariaDB_PLUGIN_MATURITY_BETA // Maturity(see include/mysql/plugin.h)*/
189+
MariaDB_PLUGIN_MATURITY_GAMMA // Maturity(see include/mysql/plugin.h)*/
190190
},
191191
{
192192
MariaDB_FUNCTION_PLUGIN, // the plugin type (see include/mysql/plugin.h)

sql/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,14 @@ IF(WITH_WSREP AND NOT EMBEDDED_LIBRARY)
3636
wsrep_plugin.cc
3737
service_wsrep.cc
3838
)
39-
MYSQL_ADD_PLUGIN(wsrep ${WSREP_SOURCES} MANDATORY NOT_EMBEDDED EXPORT_SYMBOLS LINK_LIBRARIES wsrep-lib wsrep_api_v26)
39+
MYSQL_ADD_PLUGIN(wsrep ${WSREP_SOURCES} MANDATORY NOT_EMBEDDED LINK_LIBRARIES wsrep-lib wsrep_api_v26)
40+
IF(VISIBILITY_HIDDEN_FLAG AND TARGET wsrep)
41+
# wsrep_info plugin needs some wsrep symbols from inside mysqld
42+
# we have to remove -fvisibility=hidden from wsrep
43+
GET_TARGET_PROPERTY(f wsrep COMPILE_FLAGS)
44+
STRING(REPLACE "${VISIBILITY_HIDDEN_FLAG}" "" f ${f})
45+
SET_TARGET_PROPERTIES(wsrep PROPERTIES COMPILE_FLAGS "${f}")
46+
ENDIF()
4047
ELSE()
4148
ADD_LIBRARY(wsrep STATIC wsrep_dummy.cc)
4249
ADD_DEPENDENCIES(wsrep GenError)

sql/item_cmpfunc.cc

Lines changed: 48 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -5613,61 +5613,6 @@ void Item_func_like::print(String *str, enum_query_type query_type)
56135613
}
56145614

56155615

5616-
static bool fix_escape_item_now(THD *thd, Item *escape_item, String *tmp_str,
5617-
bool escape_used_in_parsing, CHARSET_INFO *cmp_cs,
5618-
int *escape)
5619-
{
5620-
String *escape_str= escape_item->val_str(tmp_str);
5621-
if (escape_str)
5622-
{
5623-
const char *escape_str_ptr= escape_str->ptr();
5624-
if (escape_used_in_parsing &&
5625-
((((thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) &&
5626-
escape_str->numchars() != 1) ||
5627-
escape_str->numchars() > 1)))
5628-
{
5629-
my_error(ER_WRONG_ARGUMENTS,MYF(0),"ESCAPE");
5630-
return TRUE;
5631-
}
5632-
5633-
if (cmp_cs->use_mb())
5634-
{
5635-
CHARSET_INFO *cs= escape_str->charset();
5636-
my_wc_t wc;
5637-
int rc= cs->mb_wc(&wc,
5638-
(const uchar*) escape_str_ptr,
5639-
(const uchar*) escape_str_ptr +
5640-
escape_str->length());
5641-
*escape= (int) (rc > 0 ? wc : '\\');
5642-
}
5643-
else
5644-
{
5645-
/*
5646-
In the case of 8bit character set, we pass native
5647-
code instead of Unicode code as "escape" argument.
5648-
Convert to "cs" if charset of escape differs.
5649-
*/
5650-
uint32 unused;
5651-
if (escape_str->needs_conversion(escape_str->length(),
5652-
escape_str->charset(),cmp_cs,&unused))
5653-
{
5654-
char ch;
5655-
uint errors;
5656-
uint32 cnvlen= copy_and_convert(&ch, 1, cmp_cs, escape_str_ptr,
5657-
escape_str->length(),
5658-
escape_str->charset(), &errors);
5659-
*escape= cnvlen ? ch : '\\';
5660-
}
5661-
else
5662-
*escape= escape_str_ptr ? *escape_str_ptr : '\\';
5663-
}
5664-
}
5665-
else
5666-
*escape= '\\';
5667-
return FALSE;
5668-
}
5669-
5670-
56715616
longlong Item_func_like::val_int()
56725617
{
56735618
DBUG_ASSERT(fixed == 1);
@@ -5686,17 +5631,6 @@ longlong Item_func_like::val_int()
56865631
null_value=0;
56875632
if (canDoTurboBM)
56885633
return turboBM_matches(res->ptr(), res->length()) ? !negated : negated;
5689-
if (unlikely(!escape_item_evaluated))
5690-
{
5691-
if (fix_escape_item_now(current_thd, escape_item, &cmp_value1,
5692-
escape_used_in_parsing,
5693-
cmp_collation.collation, &escape))
5694-
{
5695-
null_value= 1;
5696-
return 0;
5697-
}
5698-
escape_item_evaluated= 1;
5699-
}
57005634
return cmp_collation.collation->wildcmp(
57015635
res->ptr(),res->ptr()+res->length(),
57025636
res2->ptr(),res2->ptr()+res2->length(),
@@ -5777,13 +5711,58 @@ bool fix_escape_item(THD *thd, Item *escape_item, String *tmp_str,
57775711
if (escape_item->const_item())
57785712
{
57795713
/* If we are on execution stage */
5780-
return fix_escape_item_now(thd, escape_item, tmp_str, escape_used_in_parsing,
5781-
cmp_cs, escape);
5714+
String *escape_str= escape_item->val_str(tmp_str);
5715+
if (escape_str)
5716+
{
5717+
const char *escape_str_ptr= escape_str->ptr();
5718+
if (escape_used_in_parsing && (
5719+
(((thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) &&
5720+
escape_str->numchars() != 1) ||
5721+
escape_str->numchars() > 1)))
5722+
{
5723+
my_error(ER_WRONG_ARGUMENTS,MYF(0),"ESCAPE");
5724+
return TRUE;
5725+
}
5726+
5727+
if (cmp_cs->use_mb())
5728+
{
5729+
CHARSET_INFO *cs= escape_str->charset();
5730+
my_wc_t wc;
5731+
int rc= cs->mb_wc(&wc,
5732+
(const uchar*) escape_str_ptr,
5733+
(const uchar*) escape_str_ptr +
5734+
escape_str->length());
5735+
*escape= (int) (rc > 0 ? wc : '\\');
5736+
}
5737+
else
5738+
{
5739+
/*
5740+
In the case of 8bit character set, we pass native
5741+
code instead of Unicode code as "escape" argument.
5742+
Convert to "cs" if charset of escape differs.
5743+
*/
5744+
uint32 unused;
5745+
if (escape_str->needs_conversion(escape_str->length(),
5746+
escape_str->charset(),cmp_cs,&unused))
5747+
{
5748+
char ch;
5749+
uint errors;
5750+
uint32 cnvlen= copy_and_convert(&ch, 1, cmp_cs, escape_str_ptr,
5751+
escape_str->length(),
5752+
escape_str->charset(), &errors);
5753+
*escape= cnvlen ? ch : '\\';
5754+
}
5755+
else
5756+
*escape= escape_str_ptr ? *escape_str_ptr : '\\';
5757+
}
5758+
}
5759+
else
5760+
*escape= '\\';
57825761
}
5762+
57835763
return FALSE;
57845764
}
57855765

5786-
57875766
bool Item_func_like::fix_fields(THD *thd, Item **ref)
57885767
{
57895768
DBUG_ASSERT(fixed == 0);
@@ -5793,10 +5772,8 @@ bool Item_func_like::fix_fields(THD *thd, Item **ref)
57935772
cmp_collation.collation, &escape))
57945773
return TRUE;
57955774

5796-
escape_item_evaluated= 0;
57975775
if (escape_item->const_item())
57985776
{
5799-
escape_item_evaluated= 1;
58005777
/*
58015778
We could also do boyer-more for non-const items, but as we would have to
58025779
recompute the tables for each row it's not worth it.

sql/item_cmpfunc.h

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2672,31 +2672,28 @@ class Item_func_isnotnull :public Item_func_null_predicate
26722672

26732673
class Item_func_like :public Item_bool_func2
26742674
{
2675+
// Turbo Boyer-Moore data
2676+
bool canDoTurboBM; // pattern is '%abcd%' case
26752677
const char* pattern;
2676-
Item *escape_item;
2677-
DTCollation cmp_collation;
2678-
String cmp_value1, cmp_value2;
2678+
int pattern_len;
26792679

2680-
// Turbo Boyer-Moore data
26812680
// TurboBM buffers, *this is owner
2682-
int *bmGs; // good suffix shift table, size is pattern_len + 1
2683-
int *bmBc; // bad character shift table, size is alphabet_size
2684-
int pattern_len;
2685-
public:
2686-
int escape;
2687-
bool negated;
2688-
private:
2689-
bool canDoTurboBM; // pattern is '%abcd%' case
2690-
bool escape_item_evaluated;
2691-
bool escape_used_in_parsing;
2692-
bool use_sampling;
2681+
int* bmGs; // good suffix shift table, size is pattern_len + 1
2682+
int* bmBc; // bad character shift table, size is alphabet_size
26932683

26942684
void turboBM_compute_suffixes(int* suff);
26952685
void turboBM_compute_good_suffix_shifts(int* suff);
26962686
void turboBM_compute_bad_character_shifts();
26972687
bool turboBM_matches(const char* text, int text_len) const;
26982688
enum { alphabet_size = 256 };
26992689

2690+
Item *escape_item;
2691+
2692+
bool escape_used_in_parsing;
2693+
bool use_sampling;
2694+
2695+
DTCollation cmp_collation;
2696+
String cmp_value1, cmp_value2;
27002697
bool with_sargable_pattern() const;
27012698
protected:
27022699
SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
@@ -2709,13 +2706,13 @@ class Item_func_like :public Item_bool_func2
27092706
KEY_PART *key_part,
27102707
Item_func::Functype type, Item *value);
27112708
public:
2709+
int escape;
2710+
bool negated;
27122711

27132712
Item_func_like(THD *thd, Item *a, Item *b, Item *escape_arg, bool escape_used):
2714-
Item_bool_func2(thd, a, b), pattern(0), escape_item(escape_arg),
2715-
bmGs(0), bmBc(0), pattern_len(0), negated(0), canDoTurboBM(FALSE),
2716-
escape_item_evaluated(0), escape_used_in_parsing(escape_used),
2717-
use_sampling(0)
2718-
{}
2713+
Item_bool_func2(thd, a, b), canDoTurboBM(FALSE), pattern(0), pattern_len(0),
2714+
bmGs(0), bmBc(0), escape_item(escape_arg),
2715+
escape_used_in_parsing(escape_used), use_sampling(0), negated(0) {}
27192716

27202717
bool get_negated() const { return negated; } // Used by ColumnStore
27212718

sql/log.cc

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -393,12 +393,12 @@ class binlog_cache_data
393393
In the future, we can refactor this and change it to avoid
394394
the set_binlog_info.
395395
*/
396-
DBUG_ASSERT(saved_max_binlog_cache_size == 0 &&
397-
param_max_binlog_cache_size != 0 &&
398-
ptr_binlog_cache_use == 0 &&
399-
param_ptr_binlog_cache_use != 0 &&
400-
ptr_binlog_cache_disk_use == 0 &&
401-
param_ptr_binlog_cache_disk_use != 0);
396+
DBUG_ASSERT(saved_max_binlog_cache_size == 0);
397+
DBUG_ASSERT(param_max_binlog_cache_size != 0);
398+
DBUG_ASSERT(ptr_binlog_cache_use == 0);
399+
DBUG_ASSERT(param_ptr_binlog_cache_use != 0);
400+
DBUG_ASSERT(ptr_binlog_cache_disk_use == 0);
401+
DBUG_ASSERT(param_ptr_binlog_cache_disk_use != 0);
402402

403403
saved_max_binlog_cache_size= param_max_binlog_cache_size;
404404
ptr_binlog_cache_use= param_ptr_binlog_cache_use;
@@ -1814,8 +1814,8 @@ binlog_flush_cache(THD *thd, binlog_cache_mngr *cache_mngr,
18141814
}
18151815
cache_mngr->reset(using_stmt, using_trx);
18161816

1817-
DBUG_ASSERT((!using_stmt || cache_mngr->stmt_cache.empty()) &&
1818-
(!using_trx || cache_mngr->trx_cache.empty()));
1817+
DBUG_ASSERT(!using_stmt || cache_mngr->stmt_cache.empty());
1818+
DBUG_ASSERT(!using_trx || cache_mngr->trx_cache.empty());
18191819
DBUG_RETURN(error);
18201820
}
18211821

@@ -9273,7 +9273,8 @@ int TC_LOG_MMAP::log_and_order(THD *thd, my_xid xid, bool all,
92739273
prev= queue;
92749274
queue= next;
92759275
}
9276-
DBUG_ASSERT(prev == &entry && prev->thd == thd);
9276+
DBUG_ASSERT(prev == &entry);
9277+
DBUG_ASSERT(prev->thd == thd);
92779278
}
92789279
else
92799280
{
@@ -9367,7 +9368,8 @@ int TC_LOG_MMAP::open(const char *opt_name)
93679368
PAGE *pg;
93689369

93699370
DBUG_ASSERT(total_ha_2pc > 1);
9370-
DBUG_ASSERT(opt_name && opt_name[0]);
9371+
DBUG_ASSERT(opt_name);
9372+
DBUG_ASSERT(opt_name[0]);
93719373

93729374
tc_log_page_size= my_getpagesize();
93739375

@@ -9786,7 +9788,8 @@ int TC_LOG_MMAP::delete_entry(ulong cookie)
97869788
PAGE *p=pages+(cookie/tc_log_page_size);
97879789
my_xid *x=(my_xid *)(data+cookie);
97889790

9789-
DBUG_ASSERT(x >= p->start && x < p->end);
9791+
DBUG_ASSERT(x >= p->start);
9792+
DBUG_ASSERT(x < p->end);
97909793

97919794
mysql_mutex_lock(&p->lock);
97929795
*x=0;
@@ -9931,7 +9934,8 @@ int TC_LOG_BINLOG::open(const char *opt_name)
99319934
int error= 1;
99329935

99339936
DBUG_ASSERT(total_ha_2pc > 1);
9934-
DBUG_ASSERT(opt_name && opt_name[0]);
9937+
DBUG_ASSERT(opt_name);
9938+
DBUG_ASSERT(opt_name[0]);
99359939

99369940
if (!my_b_inited(&index_file))
99379941
{

0 commit comments

Comments
 (0)