Skip to content

Commit

Permalink
Merge 10.0 into 10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Jan 4, 2017
2 parents ba8198a + 80d5d14 commit 0c1de94
Show file tree
Hide file tree
Showing 28 changed files with 111 additions and 2,725 deletions.
12 changes: 12 additions & 0 deletions client/mysqltest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5800,6 +5800,7 @@ void do_connect(struct st_command *command)
my_bool con_shm __attribute__ ((unused))= 0;
int read_timeout= 0;
int write_timeout= 0;
int connect_timeout= 0;
struct st_connection* con_slot;

static DYNAMIC_STRING ds_connection_name;
Expand Down Expand Up @@ -5906,6 +5907,11 @@ void do_connect(struct st_command *command)
{
write_timeout= atoi(con_options + sizeof("write_timeout=")-1);
}
else if (strncasecmp(con_options, "connect_timeout=",
sizeof("connect_timeout=")-1) == 0)
{
connect_timeout= atoi(con_options + sizeof("connect_timeout=")-1);
}
else
die("Illegal option to connect: %.*s",
(int) (end - con_options), con_options);
Expand Down Expand Up @@ -5990,6 +5996,12 @@ void do_connect(struct st_command *command)
(char*)&write_timeout);
}

if (connect_timeout)
{
mysql_options(con_slot->mysql, MYSQL_OPT_CONNECT_TIMEOUT,
(char*)&connect_timeout);
}

#ifdef HAVE_SMEM
if (con_shm)
{
Expand Down
21 changes: 10 additions & 11 deletions mysql-test/r/pool_of_threads.result
Original file line number Diff line number Diff line change
Expand Up @@ -2157,23 +2157,22 @@ Warnings:
Warning 1052 Column 'kundentyp' in group statement is ambiguous
drop table t1;
SET optimizer_switch=@save_optimizer_switch;
SELECT sleep(5.5);
SELECT sleep(5);
SELECT sleep(50);
SELECT sleep(50);
# -- Success: more than --thread_pool_max_threads normal connections not possible
sleep(5.5)
0
sleep(5)
0
SELECT sleep(5);
SELECT sleep(5);
SELECT 'Connection on extra port ok';
Connection on extra port ok
Connection on extra port ok
SELECT sleep(5.5);
SELECT 'Connection on extra port 2 ok';
Connection on extra port 2 ok
Connection on extra port 2 ok
# -- Success: more than --extra-max-connections + 1 normal connections not possible
sleep(5)
0
sleep(5)
KILL QUERY <default_connection_ID>;
KILL QUERY <con2_connection_ID>;
sleep(50)
1
sleep(50)
1
sleep(5.5)
0
1 change: 1 addition & 0 deletions mysql-test/t/mdev-504.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
--source include/not_valgrind.inc
--disable_ps_protocol

SET GLOBAL net_write_timeout = 900;
Expand Down
3 changes: 0 additions & 3 deletions mysql-test/t/pool_of_threads.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@ loose-thread_pool_max_threads= 2
extra-port= @ENV.MASTER_EXTRA_PORT
extra-max-connections=1

[client]
connect-timeout= 2

[ENV]
MASTER_EXTRA_PORT= @OPT.port
47 changes: 25 additions & 22 deletions mysql-test/t/pool_of_threads.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,26 @@ SET optimizer_switch=@save_optimizer_switch;
# connections on the extra port.

# First set two connections running, and check that extra connection
# on normal port fails due to--thread-pool-max_threads=2
# on normal port fails due to --thread-pool-max-threads=2.
# We can afford using a really long sleep, because we won't wait
# till it ends, we'll interrupt it as soon as we don't need it anymore

connection default;
--let $con1_id= `SELECT CONNECTION_ID()`

# Sleep for slightly longer than 5 sec to trigger MDEV-4566
# (abort in interruptible wait connection check)
send SELECT sleep(5.5);
send SELECT sleep(50);
--sleep 1

connect(con2,localhost,root,,);
connection con2;
send SELECT sleep(5);
--let $con2_id= `SELECT CONNECTION_ID()`

send SELECT sleep(50);
--sleep 0.5

--disable_abort_on_error
--disable_result_log
--disable_query_log
connect(con3,localhost,root,,);
connect(con3,localhost,root,,,,,connect_timeout=2);
--enable_query_log
--enable_result_log
--enable_abort_on_error
Expand All @@ -45,32 +48,23 @@ if ($error)
--echo # -- Success: more than --thread_pool_max_threads normal connections not possible
}

connection default;
--reap
connection con2;
--reap

# Now try again, but this time use the extra port to successfully connect.

connection default;
send SELECT sleep(5);

connection con2;
send SELECT sleep(5);
--sleep 1

connect(extracon,127.0.0.1,root,,test,$MASTER_EXTRA_PORT,);
connection extracon;
SELECT 'Connection on extra port ok';

# Here, sleep just for slightly longer than 5 sec to trigger MDEV-4566
# (abort in interruptible wait connection check).
send SELECT sleep(5.5);


connect(extracon2,127.0.0.1,root,,test,$MASTER_EXTRA_PORT,);
connection extracon2;
SELECT 'Connection on extra port 2 ok';

--disable_abort_on_error
--disable_result_log
--disable_query_log
connect(extracon3,127.0.0.1,root,,test,$MASTER_EXTRA_PORT,);
connect(extracon3,127.0.0.1,root,,test,$MASTER_EXTRA_PORT,,connect_timeout=2);
--enable_query_log
--enable_result_log
--enable_abort_on_error
Expand All @@ -84,7 +78,16 @@ if ($error)
--echo # -- Success: more than --extra-max-connections + 1 normal connections not possible
}

connection extracon2;
--replace_result $con1_id <default_connection_ID>
eval KILL QUERY $con1_id;
--replace_result $con2_id <con2_connection_ID>
eval KILL QUERY $con2_id;

connection default;
--reap
connection con2;
--reap

connection extracon;
--reap
3 changes: 1 addition & 2 deletions sql/rpl_record.cc
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,7 @@ unpack_row(rpl_group_info *rgi,
/*
Add Extra slave persistent columns
*/
int error= 0;
if ((error= fill_extra_persistent_columns(table, cols->n_bits)))
if (int error= fill_extra_persistent_columns(table, cols->n_bits))
DBUG_RETURN(error);

/*
Expand Down
6 changes: 1 addition & 5 deletions storage/xtradb/dict/dict0boot.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2012, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2016, MariaDB Corporation.
Copyright (c) 2016, 2017, 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
Expand Down Expand Up @@ -273,10 +273,6 @@ dict_boot(void)
ut_ad(DICT_NUM_FIELDS__SYS_FOREIGN_FOR_NAME == 2);
ut_ad(DICT_NUM_COLS__SYS_FOREIGN_COLS == 4);
ut_ad(DICT_NUM_FIELDS__SYS_FOREIGN_COLS == 6);
ut_ad(DICT_NUM_COLS__SYS_ZIP_DICT == 3);
ut_ad(DICT_NUM_FIELDS__SYS_ZIP_DICT == 5);
ut_ad(DICT_NUM_COLS__SYS_ZIP_DICT_COLS == 3);
ut_ad(DICT_NUM_FIELDS__SYS_ZIP_DICT_COLS == 5);

mtr_start(&mtr);

Expand Down
Loading

0 comments on commit 0c1de94

Please sign in to comment.