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
70a515df
Commit
70a515df
authored
Feb 06, 2023
by
Oleksandr Byelkin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '10.6.12' into 10.6
parents
4c79e15c
80ae69c8
Changes
17
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
325 additions
and
102 deletions
+325
-102
VERSION
VERSION
+1
-1
dbug/dbug.c
dbug/dbug.c
+3
-3
mysql-test/main/debug_sync.result
mysql-test/main/debug_sync.result
+43
-16
mysql-test/main/debug_sync.test
mysql-test/main/debug_sync.test
+27
-3
mysql-test/mariadb-test-run.pl
mysql-test/mariadb-test-run.pl
+12
-13
mysql-test/suite/innodb/r/mdev-14846.result
mysql-test/suite/innodb/r/mdev-14846.result
+2
-1
mysql-test/suite/innodb/t/mdev-14846.test
mysql-test/suite/innodb/t/mdev-14846.test
+2
-1
mysql-test/suite/stress/r/deadlock_drop_table.result
mysql-test/suite/stress/r/deadlock_drop_table.result
+2
-1
mysql-test/suite/stress/t/deadlock_drop_table.test
mysql-test/suite/stress/t/deadlock_drop_table.test
+2
-5
mysql-test/suite/sys_vars/r/debug_sync_basic.result
mysql-test/suite/sys_vars/r/debug_sync_basic.result
+3
-3
mysql-test/suite/sys_vars/r/sysvars_debug.result
mysql-test/suite/sys_vars/r/sysvars_debug.result
+1
-1
mysys/stacktrace.c
mysys/stacktrace.c
+4
-4
sql/debug_sync.cc
sql/debug_sync.cc
+198
-27
sql/sql_hset.h
sql/sql_hset.h
+6
-9
sql/sql_string.cc
sql/sql_string.cc
+16
-12
sql/sql_string.h
sql/sql_string.h
+1
-0
storage/connect/bsonudf.cpp
storage/connect/bsonudf.cpp
+2
-2
No files found.
VERSION
View file @
70a515df
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=6
MYSQL_VERSION_PATCH=1
2
MYSQL_VERSION_PATCH=1
3
SERVER_MATURITY=stable
dbug/dbug.c
View file @
70a515df
...
...
@@ -86,7 +86,7 @@
#include <m_string.h>
#include <errno.h>
#ifdef HAVE_gcov
extern
void
__gcov_flush
();
#include <gcov.h>
#endif
#ifndef DBUG_OFF
...
...
@@ -2212,7 +2212,7 @@ void _db_suicide_()
fprintf
(
stderr
,
"SIGKILL myself
\n
"
);
fflush
(
stderr
);
#ifdef HAVE_gcov
__gcov_
flush
();
__gcov_
dump
();
#endif
retval
=
kill
(
getpid
(),
SIGKILL
);
...
...
@@ -2262,7 +2262,7 @@ my_bool _db_my_assert(const char *file, int line, const char *msg)
fprintf
(
stderr
,
"%s:%d: assert: %s
\n
"
,
file
,
line
,
msg
);
fflush
(
stderr
);
#ifdef HAVE_gcov
__gcov_
flush
();
__gcov_
dump
();
#endif
}
return
a
;
...
...
mysql-test/main/debug_sync.result
View file @
70a515df
...
...
@@ -2,7 +2,7 @@ SET DEBUG_SYNC= 'RESET';
DROP TABLE IF EXISTS t1;
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal: ''
debug_sync ON - current signal
s
: ''
SET DEBUG_SYNC='p0 SIGNAL s1 WAIT_FOR s2 TIMEOUT 6 EXECUTE 2 HIT_LIMIT 3';
SET DEBUG_SYNC='p0 SIGNAL s1 WAIT_FOR s2 TIMEOUT 6 EXECUTE 2';
SET DEBUG_SYNC='p0 SIGNAL s1 WAIT_FOR s2 TIMEOUT 6 HIT_LIMIT 3';
...
...
@@ -150,34 +150,34 @@ SET @myvar= 'now SIGNAL from_myvar';
SET DEBUG_SYNC= @myvar;
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal: 'from_myvar'
debug_sync ON - current signal
s
: 'from_myvar'
SET DEBUG_SYNC= LEFT('now SIGNAL from_function_cut_here', 24);
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal
: '
from_function'
debug_sync ON - current signal
s: 'from_myvar,
from_function'
SET DEBUG_SYNC= 'now SIGNAL something';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal
: 'something
'
debug_sync ON - current signal
s: 'something,from_function,from_myvar
'
SET DEBUG_SYNC= 'now WAIT_FOR nothing TIMEOUT 0';
Warnings:
Warning #### debug sync point wait timed out
SET DEBUG_SYNC= 'now SIGNAL nothing';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal
: 'nothing
'
debug_sync ON - current signal
s: 'something,from_function,nothing,from_myvar
'
SET DEBUG_SYNC= 'now WAIT_FOR nothing TIMEOUT 0';
SET DEBUG_SYNC= 'now SIGNAL something EXECUTE 0';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal
: 'nothing
'
debug_sync ON - current signal
s: 'something,from_function,from_myvar
'
SET DEBUG_SYNC= 'now WAIT_FOR anotherthing TIMEOUT 0 EXECUTE 0';
SET DEBUG_SYNC= 'now HIT_LIMIT 1';
ERROR HY000: debug sync point hit limit reached
SET DEBUG_SYNC= 'RESET';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal: ''
debug_sync ON - current signal
s
: ''
SET DEBUG_SYNC= 'p1abcd SIGNAL s1 EXECUTE 2';
SET DEBUG_SYNC= 'p2abc SIGNAL s2 EXECUTE 2';
SET DEBUG_SYNC= 'p9abcdef SIGNAL s9 EXECUTE 2';
...
...
@@ -190,23 +190,30 @@ SET DEBUG_SYNC= 'p3abcdef SIGNAL s3 EXECUTE 2';
SET DEBUG_SYNC= 'p4a TEST';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal: 's4'
debug_sync ON - current signal
s
: 's4'
SET DEBUG_SYNC= 'p1abcd TEST';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal
: '
s1'
debug_sync ON - current signal
s: 's4,
s1'
SET DEBUG_SYNC= 'p7 TEST';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal
: 's7
'
debug_sync ON - current signal
s: 's1,s7,s4
'
SET DEBUG_SYNC= 'p9abcdef TEST';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal
: '
s9'
debug_sync ON - current signal
s: 's1,s7,s4,
s9'
SET DEBUG_SYNC= 'p3abcdef TEST';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal: 's3'
debug_sync ON - current signals: 's1,s3,s4,s9,s7'
SET DEBUG_SYNC= 'now WAIT_FOR s9';
SET DEBUG_SYNC= 'now WAIT_FOR s1';
SET DEBUG_SYNC= 'now WAIT_FOR s4';
SET DEBUG_SYNC= 'now WAIT_FOR s7';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signals: 's3'
SET DEBUG_SYNC= 'p1abcd CLEAR';
SET DEBUG_SYNC= 'p2abc CLEAR';
SET DEBUG_SYNC= 'p5abcde CLEAR';
...
...
@@ -219,19 +226,19 @@ SET DEBUG_SYNC= 'p7 CLEAR';
SET DEBUG_SYNC= 'p1abcd TEST';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal: 's3'
debug_sync ON - current signal
s
: 's3'
SET DEBUG_SYNC= 'p7 TEST';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal: 's3'
debug_sync ON - current signal
s
: 's3'
SET DEBUG_SYNC= 'p9abcdef TEST';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal: 's3'
debug_sync ON - current signal
s
: 's3'
SET DEBUG_SYNC= 'RESET';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signal: ''
debug_sync ON - current signal
s
: ''
CREATE USER mysqltest_1@localhost;
GRANT SUPER ON *.* TO mysqltest_1@localhost;
connect con1,localhost,mysqltest_1,,;
...
...
@@ -292,4 +299,24 @@ disconnect con1;
disconnect con2;
connection default;
DROP TABLE t1;
#
# Test NO_CLEAR_EVENT flag. The signal should still be visible after
# the wait has completed succesfully.
#
SET DEBUG_SYNC= 'now SIGNAL s1';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signals: 's1'
SET DEBUG_SYNC= 'now WAIT_FOR s1 NO_CLEAR_EVENT';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signals: 's1'
SET DEBUG_SYNC= 'now WAIT_FOR s1';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signals: ''
SET DEBUG_SYNC= 'now SIGNAL s1,s2,s5,s7';
SHOW VARIABLES LIKE 'DEBUG_SYNC';
Variable_name Value
debug_sync ON - current signals: 's2,s7,s1,s5'
SET DEBUG_SYNC= 'RESET';
mysql-test/main/debug_sync.test
View file @
70a515df
...
...
@@ -298,6 +298,16 @@ SET DEBUG_SYNC= 'p9abcdef TEST';
SHOW
VARIABLES
LIKE
'DEBUG_SYNC'
;
SET
DEBUG_SYNC
=
'p3abcdef TEST'
;
SHOW
VARIABLES
LIKE
'DEBUG_SYNC'
;
#
# Wait for all signals currently active except s3.
#
SET
DEBUG_SYNC
=
'now WAIT_FOR s9'
;
SET
DEBUG_SYNC
=
'now WAIT_FOR s1'
;
SET
DEBUG_SYNC
=
'now WAIT_FOR s4'
;
SET
DEBUG_SYNC
=
'now WAIT_FOR s7'
;
SHOW
VARIABLES
LIKE
'DEBUG_SYNC'
;
#
# Clear the actions.
#
...
...
@@ -320,7 +330,7 @@ SHOW VARIABLES LIKE 'DEBUG_SYNC';
SET
DEBUG_SYNC
=
'p9abcdef TEST'
;
SHOW
VARIABLES
LIKE
'DEBUG_SYNC'
;
#
# Now cleanup. Actions are clear already, but signal needs to be cleared.
# Now cleanup. Actions are clear already, but s
3 s
ignal needs to be cleared.
#
SET
DEBUG_SYNC
=
'RESET'
;
SHOW
VARIABLES
LIKE
'DEBUG_SYNC'
;
...
...
@@ -418,10 +428,24 @@ disconnect con2;
connection
default
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Test NO_CLEAR_EVENT flag. The signal should still be visible after
--
echo
# the wait has completed succesfully.
--
echo
#
SET
DEBUG_SYNC
=
'now SIGNAL s1'
;
SHOW
VARIABLES
LIKE
'DEBUG_SYNC'
;
SET
DEBUG_SYNC
=
'now WAIT_FOR s1 NO_CLEAR_EVENT'
;
SHOW
VARIABLES
LIKE
'DEBUG_SYNC'
;
SET
DEBUG_SYNC
=
'now WAIT_FOR s1'
;
SHOW
VARIABLES
LIKE
'DEBUG_SYNC'
;
SET
DEBUG_SYNC
=
'now SIGNAL s1,s2,s5,s7'
;
SHOW
VARIABLES
LIKE
'DEBUG_SYNC'
;
#
# Cleanup after test case.
# Otherwise signal would contain 'flushed' here,
# which could confuse the next test.
# Otherwise signal would confuse the next test.
#
SET
DEBUG_SYNC
=
'RESET'
;
mysql-test/mariadb-test-run.pl
View file @
70a515df
...
...
@@ -145,6 +145,7 @@ my $opt_start_exit;
my
$start_only
;
my
$file_wsrep_provider
;
my
$num_saved_cores
=
0
;
# Number of core files saved in vardir/log/ so far.
my
$test_name_for_report
;
our
@global_suppressions
;
...
...
@@ -515,13 +516,13 @@ sub main {
}
if
(
not
@$completed
)
{
my
$test_name
=
mtr_grab_file
(
$path_testlog
);
$test_name
=~
s/^CURRENT_TEST:\s//
;
chomp
(
$test_name
);
my
$tinfo
=
My::
Test
->
new
(
name
=>
$test_name
);
if
(
$test_name_for_report
)
{
my
$tinfo
=
My::
Test
->
new
(
name
=>
$test_name_for_report
);
$tinfo
->
{
result
}
=
'
MTR_RES_FAILED
';
$tinfo
->
{
comment
}
=
'
';
mtr_report_test
(
$tinfo
);
}
mtr_error
("
Test suite aborted
");
}
...
...
@@ -3740,8 +3741,8 @@ sub resfile_report_test ($) {
sub
run_testcase
($$)
{
my
(
$tinfo
,
$server_socket
)
=
@_
;
my
$print_freq
=
20
;
mtr_verbose
("
Running test:
",
$t
info
->
{
name
}
);
$test_name_for_report
=
$tinfo
->
{
name
};
mtr_verbose
("
Running test:
",
$t
est_name_for_report
);
$ENV
{'
MTR_TEST_NAME
'}
=
$tinfo
->
{
name
};
resfile_report_test
(
$tinfo
)
if
$opt_resfile
;
...
...
@@ -5130,12 +5131,10 @@ sub mysqld_start ($$) {
if
(
!
$rc
)
{
# Report failure about the last test case before exit
my
$test_name
=
mtr_grab_file
(
$path_current_testlog
);
$test_name
=~
s/^CURRENT_TEST:\s//
;
my
$tinfo
=
My::
Test
->
new
(
name
=>
$test_name
);
my
$tinfo
=
My::
Test
->
new
(
name
=>
$test_name_for_report
);
$tinfo
->
{
result
}
=
'
MTR_RES_FAILED
';
$tinfo
->
{
failures
}
=
1
;
$tinfo
->
{
logfile
}
=
get_log_from_proc
(
$mysqld
->
{'
proc
'},
$t
info
->
{
name
}
);
$tinfo
->
{
logfile
}
=
get_log_from_proc
(
$mysqld
->
{'
proc
'},
$t
est_name_for_report
);
report_option
('
verbose
',
1
);
mtr_report_test
(
$tinfo
);
}
...
...
mysql-test/suite/innodb/r/mdev-14846.result
View file @
70a515df
...
...
@@ -31,11 +31,12 @@ pk f1 f2 f3
3 t q 1
5 z t NULL
SET DEBUG_SYNC='now SIGNAL default_dml';
SET DEBUG_SYNC='now SIGNAL con2_dml';
connection default;
SET DEBUG_SYNC='now WAIT_FOR default_dml';
UPDATE t3 AS alias1 LEFT JOIN t3 AS alias2 ON ( alias1.f1 <> alias1.f2 ) SET alias1.f3 = 59 WHERE ( EXISTS ( SELECT t1.f3 FROM t1 WHERE t1.f1 = alias1.f1 ) ) OR alias2.f1 = 'h';
connect con2,localhost,root,,test;
set debug_sync='now WAIT_FOR
default
_dml';
set debug_sync='now WAIT_FOR
con2
_dml';
SET DEBUG_SYNC='now SIGNAL con1_dml2';
disconnect con2;
connection con1;
...
...
mysql-test/suite/innodb/t/mdev-14846.test
View file @
70a515df
...
...
@@ -35,6 +35,7 @@ SET DEBUG_SYNC='now WAIT_FOR con1_dml';
begin
;
SELECT
*
FROM
t1
for
update
;
# Holds x lock of all records in the table t1
SET
DEBUG_SYNC
=
'now SIGNAL default_dml'
;
SET
DEBUG_SYNC
=
'now SIGNAL con2_dml'
;
--
connection
default
SET
DEBUG_SYNC
=
'now WAIT_FOR default_dml'
;
...
...
@@ -42,7 +43,7 @@ SET DEBUG_SYNC='now WAIT_FOR default_dml';
# It holds the lock of all record in t3 and tries to acquire record lock for the table t1.
--
connect
(
con2
,
localhost
,
root
,,
test
)
set
debug_sync
=
'now WAIT_FOR
default
_dml'
;
set
debug_sync
=
'now WAIT_FOR
con2
_dml'
;
let
$wait_condition
=
select
count
(
*
)
>
0
from
information_schema
.
innodb_lock_waits
;
--
source
include
/
wait_condition
.
inc
...
...
mysql-test/suite/stress/r/deadlock_drop_table.result
View file @
70a515df
...
...
@@ -19,11 +19,12 @@ a b c
1 NULL NULL
set debug_sync='now SIGNAL go';
set debug_sync='now WAIT_FOR parked2';
set debug_sync='before_wait_for_refs SIGNAL waiting WAIT_FOR go
2
';
set debug_sync='before_wait_for_refs SIGNAL waiting WAIT_FOR go
3
';
drop table t1;;
connection con2;
set debug_sync='now WAIT_FOR waiting';
set debug_sync='now SIGNAL go2';
set debug_sync='now SIGNAL go3';
connection default;
connection con1;
connection default;
...
...
mysql-test/suite/stress/t/deadlock_drop_table.test
View file @
70a515df
...
...
@@ -20,15 +20,12 @@ set debug_sync='now WAIT_FOR parked';
select
*
from
t1
;
set
debug_sync
=
'now SIGNAL go'
;
set
debug_sync
=
'now WAIT_FOR parked2'
;
set
debug_sync
=
'before_wait_for_refs SIGNAL waiting WAIT_FOR go
2
'
;
set
debug_sync
=
'before_wait_for_refs SIGNAL waiting WAIT_FOR go
3
'
;
--
send
drop
table
t1
;
--
connection
con2
set
debug_sync
=
'now WAIT_FOR waiting'
;
set
debug_sync
=
'now SIGNAL go2'
;
# Write out show processlist if the debug sync point times out
let
$wait_condition
=
select
count
(
*
)
=
0
from
information_schema
.
processlist
where
state
like
"%debug%"
;
source
include
/
wait_condition
.
inc
;
set
debug_sync
=
'now SIGNAL go3'
;
--
connection
default
--
reap
...
...
mysql-test/suite/sys_vars/r/debug_sync_basic.result
View file @
70a515df
...
...
@@ -2,17 +2,17 @@ select @@global.debug_sync;
ERROR HY000: Variable 'debug_sync' is a SESSION variable
select @@session.debug_sync;
@@session.debug_sync
ON - current signal: ''
ON - current signal
s
: ''
show global variables like "debug_sync";
Variable_name Value
show session variables like "debug_sync";
Variable_name Value
debug_sync ON - current signal: ''
debug_sync ON - current signal
s
: ''
select * from information_schema.global_variables where variable_name="debug_sync";
VARIABLE_NAME VARIABLE_VALUE
select * from information_schema.session_variables where variable_name="debug_sync";
VARIABLE_NAME VARIABLE_VALUE
DEBUG_SYNC ON - current signal: ''
DEBUG_SYNC ON - current signal
s
: ''
set @@session.debug_sync=1;
ERROR 42000: Incorrect argument type to variable 'debug_sync'
set @@session.debug_sync=1.1;
...
...
mysql-test/suite/sys_vars/r/sysvars_debug.result
View file @
70a515df
...
...
@@ -77,7 +77,7 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT OPTIONAL
GLOBAL_VALUE_PATH NULL
VARIABLE_NAME DEBUG_SYNC
SESSION_VALUE ON - current signal: ''
SESSION_VALUE ON - current signal
s
: ''
GLOBAL_VALUE NULL
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE
...
...
mysys/stacktrace.c
View file @
70a515df
...
...
@@ -34,6 +34,9 @@
#include <execinfo.h>
#endif
#ifdef HAVE_gcov
#include <gcov.h>
#endif
/**
Default handler for printing stacktrace
*/
...
...
@@ -409,9 +412,6 @@ void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack,
/* Produce a core for the thread */
void
my_write_core
(
int
sig
)
{
#ifdef HAVE_gcov
extern
void
__gcov_flush
(
void
);
#endif
signal
(
sig
,
SIG_DFL
);
#ifdef HAVE_gcov
/*
...
...
@@ -419,7 +419,7 @@ void my_write_core(int sig)
information from this process, causing gcov output to be incomplete.
So we force the writing of coverage information here before terminating.
*/
__gcov_
flush
();
__gcov_
dump
();
#endif
pthread_kill
(
pthread_self
(),
sig
);
#if defined(P_MYID) && !defined(SCO)
...
...
sql/debug_sync.cc
View file @
70a515df
This diff is collapsed.
Click to expand it.
sql/sql_hset.h
View file @
70a515df
...
...
@@ -15,6 +15,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
#include "my_global.h"
#include "hash.h"
...
...
@@ -28,20 +29,18 @@ class Hash_set
public:
enum
{
START_SIZE
=
8
};
/**
Constructs an empty hash. Does not allocate memory, it is done upon
the first insert. Thus does not cause or return errors.
Constructs an empty unique hash.
*/
Hash_set
(
PSI_memory_key
psi_key
,
uchar
*
(
*
K
)(
const
T
*
,
size_t
*
,
my_bool
),
CHARSET_INFO
*
cs
=
&
my_charset_bin
)
{
my_hash_clear
(
&
m_hash
);
m_hash
.
get_key
=
(
my_hash_get_key
)
K
;
m_hash
.
charset
=
cs
;
m_hash
.
array
.
m_psi_key
=
psi_key
;
my_hash_init
(
psi_key
,
&
m_hash
,
cs
,
START_SIZE
,
0
,
0
,
(
my_hash_get_key
)
K
,
0
,
HASH_UNIQUE
);
}
Hash_set
(
PSI_memory_key
psi_key
,
CHARSET_INFO
*
charset
,
ulong
default_array_elements
,
size_t
key_offset
,
size_t
key_length
,
my_hash_get_key
get_key
,
void
(
*
free_element
)(
void
*
),
uint
flags
)
void
(
*
free_element
)(
void
*
),
uint
flags
)
{
my_hash_init
(
psi_key
,
&
m_hash
,
charset
,
default_array_elements
,
key_offset
,
key_length
,
get_key
,
free_element
,
flags
);
...
...
@@ -65,8 +64,6 @@ class Hash_set
*/
bool
insert
(
T
*
value
)
{
my_hash_init_opt
(
m_hash
.
array
.
m_psi_key
,
&
m_hash
,
m_hash
.
charset
,
START_SIZE
,
0
,
0
,
m_hash
.
get_key
,
0
,
HASH_UNIQUE
);
return
my_hash_insert
(
&
m_hash
,
reinterpret_cast
<
const
uchar
*>
(
value
));
}
bool
remove
(
T
*
value
)
...
...
sql/sql_string.cc
View file @
70a515df
...
...
@@ -677,24 +677,23 @@ bool String::append_with_prefill(const char *s,uint32 arg_length,
}
int
Binary_string
::
strstr
(
const
Binary_string
&
s
,
uint32
offset
)
int
Binary_string
::
strstr
(
const
char
*
search
,
uint32
search_length
,
uint32
offset
)
{
if
(
s
.
length
()
+
offset
<=
str_length
)
if
(
s
earch_length
+
offset
<=
str_length
)
{
if
(
!
s
.
length
()
)
if
(
!
s
earch_length
)
return
((
int
)
offset
);
// Empty string is always found
const
char
*
str
=
Ptr
+
offset
;
const
char
*
search
=
s
.
ptr
();
const
char
*
end
=
Ptr
+
str_length
-
s
.
length
()
+
1
;
const
char
*
search_end
=
s
.
ptr
()
+
s
.
length
();
const
char
*
str
=
Ptr
+
offset
;
const
char
*
end
=
Ptr
+
str_length
-
search_length
+
1
;
const
char
*
search_end
=
search
+
search_length
;
skip:
while
(
str
!=
end
)
{
if
(
*
str
++
==
*
search
)
{
char
*
i
,
*
j
;
i
=
(
char
*
)
str
;
j
=
(
char
*
)
search
+
1
;
char
*
i
=
(
char
*
)
str
;
char
*
j
=
(
char
*
)
search
+
1
;
while
(
j
!=
search_end
)
if
(
*
i
++
!=
*
j
++
)
goto
skip
;
return
(
int
)
(
str
-
Ptr
)
-
1
;
...
...
@@ -704,6 +703,11 @@ int Binary_string::strstr(const Binary_string &s, uint32 offset)
return
-
1
;
}
int
Binary_string
::
strstr
(
const
Binary_string
&
s
,
uint32
offset
)
{
return
strstr
(
s
.
ptr
(),
s
.
length
(),
offset
);
}
/*
** Search string from end. Offset is offset to the end of string
*/
...
...
sql/sql_string.h
View file @
70a515df
...
...
@@ -330,6 +330,7 @@ class Binary_string: public Sql_alloc
// Returns offset to substring or -1
int
strstr
(
const
Binary_string
&
search
,
uint32
offset
=
0
);
int
strstr
(
const
char
*
search
,
uint32
search_length
,
uint32
offset
=
0
);
// Returns offset to substring or -1
int
strrstr
(
const
Binary_string
&
search
,
uint32
offset
=
0
);
...
...
storage/connect/bsonudf.cpp
View file @
70a515df
...
...
@@ -3571,7 +3571,7 @@ char *bson_item_merge(UDF_INIT *initid, UDF_ARGS *args, char *result,
}
// endif Xchk
if
(
!
CheckMemory
(
g
,
initid
,
args
,
2
,
false
,
false
,
true
))
{
JTYP
type
;
JTYP
type
=
TYPE_JAR
;
BJNX
bnx
(
g
);
PBVAL
jvp
=
NULL
,
top
=
NULL
;
PBVAL
jsp
[
2
]
=
{
NULL
,
NULL
};
...
...
@@ -5724,7 +5724,7 @@ char *bbin_item_merge(UDF_INIT *initid, UDF_ARGS *args, char *result,
}
// endif Xchk
if
(
!
CheckMemory
(
g
,
initid
,
args
,
2
,
false
,
false
,
true
))
{
JTYP
type
;
JTYP
type
=
TYPE_JAR
;
BJNX
bnx
(
g
);
PBVAL
jvp
=
NULL
,
top
=
NULL
;
PBVAL
jsp
[
2
]
=
{
NULL
,
NULL
};
...
...
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