Skip to content
Permalink
Browse files
Merge branch '10.1' into 10.2
  • Loading branch information
vuvova committed Feb 22, 2018
2 parents db0484f + 5d8ac1e commit 2daa005
Show file tree
Hide file tree
Showing 15 changed files with 318 additions and 73 deletions.
@@ -160,6 +160,7 @@ INCLUDE(plugin)
INCLUDE(install_macros)
INCLUDE(systemd)
INCLUDE(mysql_add_executable)
INCLUDE(compile_flags)
INCLUDE(crc32-vpmsum)

# Handle options
@@ -186,8 +186,10 @@ sub create_process {
# it and any childs(that hasn't changed group themself)
setpgrp(0,0) if $opts{setpgrp};

if ( $output and !open(STDOUT, $open_mode, $output) ) {
croak("can't redirect STDOUT to '$output': $!");
if ( $output ) {
close STDOUT;
open(STDOUT, $open_mode, $output)
or croak "can't redirect STDOUT to '$output': $!";
}

if ( $error ) {
@@ -196,8 +198,10 @@ sub create_process {
croak("can't dup STDOUT: $!");
}
}
elsif ( ! open(STDERR, $open_mode, $error) ) {
croak("can't redirect STDERR to '$error': $!");
else {
close STDERR;
open(STDERR, $open_mode, $error)
or croak "can't redirect STDERR to '$error': $!";
}
}

@@ -0,0 +1,23 @@
package My::Tee;

# see PerlIO::via

our $copyfh;

sub PUSHED
{
open($copyfh, '>', "$::opt_vardir/log/stdout.log")
or die "open(>$::opt_vardir/log/stdout.log): $!"
unless $copyfh;
bless { }, shift;
}

sub WRITE
{
my ($obj, $buf, $fh) = @_;
print $fh $buf;
print $copyfh $buf;
return length($buf);
}

1;
@@ -91,6 +91,7 @@ BEGIN
use My::SafeProcess;
use My::ConfigFactory;
use My::Options;
use My::Tee;
use My::Find;
use My::SysInfo;
use My::CoreDump;
@@ -384,6 +385,11 @@ sub main {
initialize_servers();
init_timers();

unless (IS_WINDOWS) {
binmode(STDOUT,":via(My::Tee)") or die "binmode(STDOUT, :via(My::Tee)):$!";
binmode(STDERR,":via(My::Tee)") or die "binmode(STDERR, :via(My::Tee)):$!";
}

mtr_report("Checking supported features...");

executable_setup();
@@ -6253,7 +6259,8 @@ sub xterm_stat {
my $done = $num_tests - $left;
my $spent = time - $^T;

printf "\e];mtr: spent %s on %d tests. %s (%d tests) left\a",
syswrite STDOUT, sprintf
"\e];mtr: spent %s on %d tests. %s (%d tests) left\a",
time_format($spent), $done,
time_format($spent/$done * $left), $left;
}
@@ -134,6 +134,13 @@ count(*)
select count(*) from innodb_page_compressed9 where c1 < 500000;
count(*)
2000
flush tables innodb_page_compressed1, innodb_page_compressed2,
innodb_page_compressed3, innodb_page_compressed4,
innodb_page_compressed5, innodb_page_compressed6,
innodb_page_compressed7, innodb_page_compressed8,
innodb_page_compressed9 for export;
unlock tables;
# Wait until dirty pages are compressed and encrypted
SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
variable_value > 0
1
@@ -151,9 +158,14 @@ update innodb_page_compressed6 set c1 = c1 + 1;
update innodb_page_compressed7 set c1 = c1 + 1;
update innodb_page_compressed8 set c1 = c1 + 1;
update innodb_page_compressed9 set c1 = c1 + 1;
SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
variable_value > 0
1
flush tables innodb_page_compressed1, innodb_page_compressed2,
innodb_page_compressed3, innodb_page_compressed4,
innodb_page_compressed5, innodb_page_compressed6,
innodb_page_compressed7, innodb_page_compressed8,
innodb_page_compressed9 for export;
unlock tables;
# Wait until dirty pages are compressed and encrypted 2
unlock tables;
SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
variable_value > 0
1
@@ -73,6 +73,15 @@ select count(*) from innodb_page_compressed7 where c1 < 500000;
select count(*) from innodb_page_compressed8 where c1 < 500000;
select count(*) from innodb_page_compressed9 where c1 < 500000;

flush tables innodb_page_compressed1, innodb_page_compressed2,
innodb_page_compressed3, innodb_page_compressed4,
innodb_page_compressed5, innodb_page_compressed6,
innodb_page_compressed7, innodb_page_compressed8,
innodb_page_compressed9 for export;

unlock tables;

--echo # Wait until dirty pages are compressed and encrypted
let $wait_condition= select variable_value > 0 from information_schema.global_status where variable_name = 'INNODB_NUM_PAGES_PAGE_COMPRESSED';
--source include/wait_condition.inc
let $wait_condition= select variable_value > 0 from information_schema.global_status where variable_name = 'INNODB_NUM_PAGES_ENCRYPTED';
@@ -96,12 +105,20 @@ update innodb_page_compressed7 set c1 = c1 + 1;
update innodb_page_compressed8 set c1 = c1 + 1;
update innodb_page_compressed9 set c1 = c1 + 1;

let $wait_condition= select variable_value > 0 from information_schema.global_status where variable_name = 'INNODB_NUM_PAGES_ENCRYPTED';
--source include/wait_condition.inc
flush tables innodb_page_compressed1, innodb_page_compressed2,
innodb_page_compressed3, innodb_page_compressed4,
innodb_page_compressed5, innodb_page_compressed6,
innodb_page_compressed7, innodb_page_compressed8,
innodb_page_compressed9 for export;
unlock tables;

--echo # Wait until dirty pages are compressed and encrypted 2
let $wait_condition= select variable_value > 0 from information_schema.global_status where variable_name = 'INNODB_NUM_PAGES_PAGE_COMPRESSED';
--source include/wait_condition.inc
unlock tables;
let $wait_condition= select variable_value > 0 from information_schema.global_status where variable_name = 'INNODB_NUM_PAGES_DECRYPTED';
--source include/wait_condition.inc

SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_compressed';
SELECT variable_value > 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_decompressed';
@@ -61,3 +61,6 @@ MW-328B: MDEV-13549 Galera test failures 10.1
MW-328: MDEV-13549 Galera test failures 10.1
galera_suspend_slave: MDEV-13549 Galera test failures 10.1
galera_ist_progress: MDEV-15236 galera_ist_progress fails when trying to read transfer status
galera_gtid : MDEV-13549 Galera test failures 10.1
galera_gtid_slave : MDEV-13549 Galera test failures 10.1
galera_unicode_identifiers : MDEV-13549 Galera test failures 10.1
@@ -1,4 +1,5 @@
--source include/have_partition.inc
--source include/have_symlink.inc
--let $engine=MyISAM
--source inc/part_alter_values.inc

@@ -644,7 +644,7 @@ wait_for_listen()

for i in {1..300}
do
LSOF_OUT=$(lsof -sTCP:LISTEN -i TCP:${PORT} -a -c nc -c socat -F c)
LSOF_OUT=$(lsof -sTCP:LISTEN -i TCP:${PORT} -a -c nc -c socat -F c 2> /dev/null || :)
[ -n "${LSOF_OUT}" ] && break
sleep 0.2
done
@@ -6025,12 +6025,14 @@ int mysqld_main(int argc, char **argv)
mysqld_port, MYSQL_COMPILATION_COMMENT);
}

#ifndef _WIN32
// try to keep fd=0 busy
if (!freopen(IF_WIN("NUL","/dev/null"), "r", stdin))
if (!freopen("/dev/null", "r", stdin))
{
// fall back on failure
fclose(stdin);
}
#endif

#if defined(_WIN32) && !defined(EMBEDDED_LIBRARY)
Service.SetRunning();
@@ -2383,23 +2383,6 @@ bool partition_info::fix_column_value_functions(THD *thd,
}


bool partition_info::error_if_requires_values() const
{
switch (part_type) {
case NOT_A_PARTITION:
case HASH_PARTITION:
break;
case RANGE_PARTITION:
my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0), "RANGE", "LESS THAN");
return true;
case LIST_PARTITION:
my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0), "LIST", "IN");
return true;
}
return false;
}


/**
Fix partition data from parser.
@@ -2893,3 +2876,19 @@ bool check_partition_dirs(partition_info *part_info)
}

#endif /* WITH_PARTITION_STORAGE_ENGINE */

bool partition_info::error_if_requires_values() const
{
switch (part_type) {
case NOT_A_PARTITION:
case HASH_PARTITION:
break;
case RANGE_PARTITION:
my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0), "RANGE", "LESS THAN");
return true;
case LIST_PARTITION:
my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0), "LIST", "IN");
return true;
}
return false;
}
@@ -1754,11 +1754,13 @@ bool ha_connect::CheckVirtualIndex(TABLE_SHARE *s)

bool ha_connect::IsPartitioned(void)
{
#ifdef WITH_PARTITION_STORAGE_ENGINE
if (tshp)
return tshp->partition_info_str_len > 0;
else if (table && table->part_info)
return true;
else
#endif
return false;

} // end of IsPartitioned
@@ -6165,8 +6167,10 @@ int ha_connect::create(const char *name, TABLE *table_arg,
TABLE *st= table; // Probably unuseful
THD *thd= ha_thd();
LEX_STRING cnc = table_arg->s->connect_string;
#if defined(WITH_PARTITION_STORAGE_ENGINE)
#ifdef WITH_PARTITION_STORAGE_ENGINE
partition_info *part_info= table_arg->part_info;
#else
#define part_info 0
#endif // WITH_PARTITION_STORAGE_ENGINE
xp= GetUser(thd, xp);
PGLOBAL g= xp->g;
@@ -6268,9 +6272,7 @@ int ha_connect::create(const char *name, TABLE *table_arg,

// fall through
case TAB_MYSQL:
#if defined(WITH_PARTITION_STORAGE_ENGINE)
if (!part_info)
#endif // WITH_PARTITION_STORAGE_ENGINE
{const char *src= options->srcdef;
PCSZ host, db, tab= options->tabname;
int port;
@@ -6534,7 +6536,6 @@ int ha_connect::create(const char *name, TABLE *table_arg,
} else
lwt[i]= tolower(options->type[i]);

#if defined(WITH_PARTITION_STORAGE_ENGINE)
if (part_info) {
char *p;

@@ -6544,17 +6545,14 @@ int ha_connect::create(const char *name, TABLE *table_arg,
strcat(strcat(strcpy(buf, p), "."), lwt);
*p= 0;
} else {
#endif // WITH_PARTITION_STORAGE_ENGINE
strcat(strcat(strcpy(buf, GetTableName()), "."), lwt);
sprintf(g->Message, "No file name. Table will use %s", buf);

if (sqlcom == SQLCOM_CREATE_TABLE)
push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0, g->Message);

strcat(strcat(strcpy(dbpath, "./"), table->s->db.str), "/");
#if defined(WITH_PARTITION_STORAGE_ENGINE)
} // endif part_info
#endif // WITH_PARTITION_STORAGE_ENGINE

PlugSetPath(fn, buf, dbpath);

@@ -6619,11 +6617,9 @@ int ha_connect::create(const char *name, TABLE *table_arg,
push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 0,
"Unexpected command in create, please contact CONNECT team");

#if defined(WITH_PARTITION_STORAGE_ENGINE)
if (part_info && !inward)
strncpy(partname, decode(g, strrchr(name, '#') + 1), sizeof(partname) - 1);
// strcpy(partname, part_info->curr_part_elem->partition_name);
#endif // WITH_PARTITION_STORAGE_ENGINE

if (g->Alchecked == 0 &&
(!IsFileType(type) || FileExists(options->filename, false))) {
@@ -6659,12 +6655,10 @@ int ha_connect::create(const char *name, TABLE *table_arg,
my_message(ER_UNKNOWN_ERROR, g->Message, MYF(0));
rc = HA_ERR_INTERNAL_ERROR;
} else if (cat) {
#if defined(WITH_PARTITION_STORAGE_ENGINE)
if (part_info)
strncpy(partname,
decode(g, strrchr(name, (inward ? slash : '#')) + 1),
sizeof(partname) - 1);
#endif // WITH_PARTITION_STORAGE_ENGINE

if ((rc= optimize(table->in_use, NULL))) {
htrc("Create rc=%d %s\n", rc, g->Message);

0 comments on commit 2daa005

Please sign in to comment.