37 changed files with 640 additions and 167 deletions
-
2VERSION
-
14client/mysqlbinlog.cc
-
2client/mysqldump.c
-
10include/queues.h
-
2mysql-test/lib/My/SafeProcess/safe_process_win.cc
-
2mysql-test/mysql-test-run.pl
-
52mysql-test/r/index_merge_myisam.result
-
3mysql-test/r/processlist_notembedded.result
-
19mysql-test/r/range.result
-
30mysql-test/r/range_innodb.result
-
19mysql-test/r/range_mrr_icp.result
-
2mysql-test/r/range_vs_index_merge.result
-
5mysql-test/suite.pm
-
15mysql-test/suite/rpl/r/rpl_conditional_comments.result
-
16mysql-test/suite/rpl/r/rpl_fail_register.result
-
12mysql-test/suite/rpl/t/rpl_conditional_comments.test
-
33mysql-test/suite/rpl/t/rpl_fail_register.test
-
49mysql-test/t/index_merge_myisam.test
-
9mysql-test/t/processlist_notembedded.test
-
14mysql-test/t/range.test
-
29mysql-test/t/range_innodb.test
-
12mysys/my_addr_resolve.c
-
169mysys/queues.c
-
20sql-common/client.c
-
4sql/event_scheduler.cc
-
28sql/opt_range.cc
-
34sql/slave.cc
-
2sql/sql_class.cc
-
18sql/sql_lex.cc
-
1sql/sql_parse.cc
-
1sql/table.cc
-
6storage/tokudb/PerconaFT/cmake_modules/TokuSetupCompiler.cmake
-
2support-files/rpm/my.cnf
-
2unittest/mysys/CMakeLists.txt
-
139unittest/mysys/queues-t.c
-
2win/packaging/heidisql.cmake
-
28win/packaging/heidisql.wxi.in
@ -1,4 +1,4 @@ |
|||
MYSQL_VERSION_MAJOR=10 |
|||
MYSQL_VERSION_MINOR=0 |
|||
MYSQL_VERSION_PATCH=40 |
|||
MYSQL_VERSION_EXTRA=-3 |
|||
MYSQL_VERSION_EXTRA=-4 |
@ -1,8 +1,9 @@ |
|||
# |
|||
# MDEV-20466: SHOW PROCESSLIST truncates query text on \0 bytes |
|||
# |
|||
SET DEBUG_SYNC= 'before_join_optimize SIGNAL in_sync'; |
|||
SET DEBUG_SYNC= 'before_join_optimize SIGNAL in_sync WAIT_FOR go'; |
|||
SET DEBUG_SYNC= 'now WAIT_FOR in_sync'; |
|||
FOUND /sleep/ in MDEV-20466.text |
|||
SET DEBUG_SYNC= 'now SIGNAL go'; |
|||
SET DEBUG_SYNC = 'RESET'; |
|||
End of 5.5 tests |
@ -0,0 +1,16 @@ |
|||
include/master-slave.inc |
|||
[connection master] |
|||
set @old_dbug=@@global.debug_dbug; |
|||
set global debug_dbug='d,fail_com_register_slave'; |
|||
stop slave; |
|||
reset slave; |
|||
include/wait_for_slave_to_stop.inc |
|||
start slave; |
|||
stop slave; |
|||
include/wait_for_slave_to_stop.inc |
|||
set global debug_dbug=@old_dbug; |
|||
kill DUMP_THREAD; |
|||
show slave hosts; |
|||
Server_id Host Port Master_id |
|||
start slave; |
|||
include/rpl_end.inc |
@ -0,0 +1,33 @@ |
|||
source include/have_debug.inc; |
|||
source include/have_binlog_format_mixed.inc; |
|||
source include/master-slave.inc; |
|||
|
|||
connection slave; |
|||
|
|||
set @old_dbug=@@global.debug_dbug; |
|||
set global debug_dbug='d,fail_com_register_slave'; |
|||
|
|||
stop slave; |
|||
reset slave; |
|||
source include/wait_for_slave_to_stop.inc; |
|||
start slave; |
|||
stop slave; |
|||
source include/wait_for_slave_to_stop.inc; |
|||
set global debug_dbug=@old_dbug; |
|||
|
|||
connection master; |
|||
|
|||
### why is that needed? |
|||
let $id=`SELECT id from information_schema.processlist where command='Binlog Dump'`; |
|||
if ($id) { |
|||
replace_result $id DUMP_THREAD; |
|||
eval kill $id; |
|||
let $wait_condition= SELECT count(*)=0 from information_schema.processlist where command='Binlog Dump'; |
|||
source include/wait_condition.inc; |
|||
} |
|||
|
|||
show slave hosts; |
|||
|
|||
connection slave; |
|||
start slave; |
|||
source include/rpl_end.inc; |
@ -0,0 +1,139 @@ |
|||
/* Copyright (c) 2020, 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 St, Fifth Floor, Boston, MA 02110-1335 USA */ |
|||
|
|||
#include <my_global.h> |
|||
#include <my_sys.h> |
|||
#include <my_rnd.h> |
|||
#include <queues.h> |
|||
#include "tap.h" |
|||
|
|||
int cmp(void *arg __attribute__((unused)), uchar *a, uchar *b) |
|||
{ |
|||
return *a < *b ? -1 : *a > *b; |
|||
} |
|||
|
|||
#define rnd(R) ((uint)(my_rnd(R) * INT_MAX32)) |
|||
|
|||
#define el(Q,I) ((uint)*queue_element(Q, I)) |
|||
|
|||
my_bool verbose; |
|||
|
|||
my_bool check_queue(QUEUE *queue) |
|||
{ |
|||
char b[1024]={0}, *s, *e=b+sizeof(b)-2; |
|||
my_bool ok=1; |
|||
uint i; |
|||
|
|||
s= b + my_snprintf(b, e-b, "%x", el(queue, 1)); |
|||
for (i=2; i <= queue->elements; i++) |
|||
{ |
|||
s+= my_snprintf(s, e-s, ", %x", el(queue, i)); |
|||
ok &= el(queue, i) <= el(queue, i>>1); |
|||
} |
|||
if (!ok || verbose) |
|||
diag("%s", b); |
|||
return ok; |
|||
} |
|||
|
|||
int main(int argc __attribute__((unused)), char *argv[]) |
|||
{ |
|||
QUEUE q, *queue=&q; |
|||
MY_INIT(argv[0]); |
|||
plan(19); |
|||
|
|||
verbose=1; |
|||
|
|||
init_queue(queue, 256, 0, 1, cmp, NULL, 0, 0); |
|||
queue_insert(queue, (uchar*)"\x99"); |
|||
queue_insert(queue, (uchar*)"\x19"); |
|||
queue_insert(queue, (uchar*)"\x36"); |
|||
queue_insert(queue, (uchar*)"\x17"); |
|||
queue_insert(queue, (uchar*)"\x12"); |
|||
queue_insert(queue, (uchar*)"\x05"); |
|||
queue_insert(queue, (uchar*)"\x25"); |
|||
queue_insert(queue, (uchar*)"\x09"); |
|||
queue_insert(queue, (uchar*)"\x15"); |
|||
queue_insert(queue, (uchar*)"\x06"); |
|||
queue_insert(queue, (uchar*)"\x11"); |
|||
queue_insert(queue, (uchar*)"\x01"); |
|||
queue_insert(queue, (uchar*)"\x04"); |
|||
queue_insert(queue, (uchar*)"\x13"); |
|||
queue_insert(queue, (uchar*)"\x24"); |
|||
ok(check_queue(queue), "after insert"); |
|||
queue_remove(queue, 5); |
|||
ok(check_queue(queue), "after remove 5th"); |
|||
|
|||
queue_element(queue, 1) = (uchar*)"\x01"; |
|||
queue_element(queue, 2) = (uchar*)"\x10"; |
|||
queue_element(queue, 3) = (uchar*)"\x04"; |
|||
queue_element(queue, 4) = (uchar*)"\x09"; |
|||
queue_element(queue, 5) = (uchar*)"\x13"; |
|||
queue_element(queue, 6) = (uchar*)"\x03"; |
|||
queue_element(queue, 7) = (uchar*)"\x08"; |
|||
queue_element(queue, 8) = (uchar*)"\x07"; |
|||
queue_element(queue, 9) = (uchar*)"\x06"; |
|||
queue_element(queue,10) = (uchar*)"\x12"; |
|||
queue_element(queue,11) = (uchar*)"\x05"; |
|||
queue_element(queue,12) = (uchar*)"\x02"; |
|||
queue_element(queue,13) = (uchar*)"\x11"; |
|||
queue->elements= 13; |
|||
ok(!check_queue(queue), "manually filled (queue property violated)"); |
|||
|
|||
queue_fix(queue); |
|||
ok(check_queue(queue), "fixed"); |
|||
|
|||
ok(*queue_remove_top(queue) == 0x13, "remove top 13"); |
|||
ok(*queue_remove_top(queue) == 0x12, "remove top 12"); |
|||
ok(*queue_remove_top(queue) == 0x11, "remove top 11"); |
|||
ok(*queue_remove_top(queue) == 0x10, "remove top 10"); |
|||
ok(*queue_remove_top(queue) == 0x09, "remove top 9"); |
|||
ok(*queue_remove_top(queue) == 0x08, "remove top 8"); |
|||
ok(*queue_remove_top(queue) == 0x07, "remove top 7"); |
|||
ok(*queue_remove_top(queue) == 0x06, "remove top 6"); |
|||
ok(*queue_remove_top(queue) == 0x05, "remove top 5"); |
|||
ok(*queue_remove_top(queue) == 0x04, "remove top 4"); |
|||
ok(*queue_remove_top(queue) == 0x03, "remove top 3"); |
|||
ok(*queue_remove_top(queue) == 0x02, "remove top 2"); |
|||
ok(*queue_remove_top(queue) == 0x01, "remove top 1"); |
|||
|
|||
/* random test */ |
|||
{ |
|||
int i, res; |
|||
struct my_rnd_struct rand; |
|||
my_rnd_init(&rand, (ulong)(intptr)&i, (ulong)(intptr)argv); |
|||
verbose=0; |
|||
|
|||
for (res= i=1; i <= 250; i++) |
|||
{ |
|||
uchar *s=alloca(2); |
|||
*s= rnd(&rand) % 251; |
|||
queue_insert(queue, s); |
|||
res &= check_queue(queue); |
|||
} |
|||
ok(res, "inserted 250"); |
|||
|
|||
while (queue->elements) |
|||
{ |
|||
queue_remove(queue, (rnd(&rand) % queue->elements) + 1); |
|||
res &= check_queue(queue); |
|||
} |
|||
ok(res, "removed 250"); |
|||
} |
|||
|
|||
delete_queue(queue); |
|||
my_end(0); |
|||
return exit_status(); |
|||
} |
|||
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue