Merge 10.2 into 10.3

This commit is contained in:
Marko Mäkelä 2020-05-29 22:21:19 +03:00
commit e9aaa10c11
27 changed files with 304 additions and 318 deletions

View File

@ -104,6 +104,7 @@ ELSEIF(DEB)
SET(HAVE_EMBEDDED_PRIVILEGE_CONTROL ON) SET(HAVE_EMBEDDED_PRIVILEGE_CONTROL ON)
ELSE() ELSE()
SET(WITH_SSL bundled CACHE STRING "") SET(WITH_SSL bundled CACHE STRING "")
SET(WITH_PCRE bundled CACHE STRING "")
SET(WITH_ZLIB bundled CACHE STRING "") SET(WITH_ZLIB bundled CACHE STRING "")
SET(WITH_JEMALLOC static CACHE STRING "") SET(WITH_JEMALLOC static CACHE STRING "")
ENDIF() ENDIF()
@ -138,7 +139,7 @@ IF(UNIX)
RedHat/Fedora/Oracle Linux: yum install libaio-devel RedHat/Fedora/Oracle Linux: yum install libaio-devel
SuSE: zypper install libaio-devel SuSE: zypper install libaio-devel
If you really do not want it, pass -DIGNORE_AIO_CHECK to cmake. If you really do not want it, pass -DIGNORE_AIO_CHECK=ON to cmake.
") ")
ENDIF() ENDIF()

View File

@ -15,6 +15,7 @@
SET(CPACK_SOURCE_IGNORE_FILES SET(CPACK_SOURCE_IGNORE_FILES
\\\\.git/ \\\\.git/
\\\\.git$
\\\\.gitignore$ \\\\.gitignore$
\\\\.gitattributes$ \\\\.gitattributes$
CMakeCache\\\\.txt$ CMakeCache\\\\.txt$

View File

@ -19,11 +19,11 @@ IF(GIT_EXECUTABLE AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
SET(update_result 0) SET(update_result 0)
ELSEIF (cmake_update_submodules MATCHES force) ELSEIF (cmake_update_submodules MATCHES force)
MESSAGE(STATUS "Updating submodules (forced)") MESSAGE(STATUS "Updating submodules (forced)")
EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update --init --force EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update --init --force --depth=1
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE update_result) RESULT_VARIABLE update_result)
ELSEIF (cmake_update_submodules MATCHES yes) ELSEIF (cmake_update_submodules MATCHES yes)
EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update --init EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update --init --depth=1
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE update_result) RESULT_VARIABLE update_result)
ELSE() ELSE()

@ -1 +1 @@
Subproject commit cdfecebc9932a0dd5516c10505bfe78d79132e7d Subproject commit ce74fd0c4009ed9f4bcbdb4a01e96c823e961dc3

View File

@ -37,8 +37,20 @@ use My::Platform;
use POSIX qw[ _exit ]; use POSIX qw[ _exit ];
use IO::Handle qw[ flush ]; use IO::Handle qw[ flush ];
use mtr_results; use mtr_results;
use Term::ANSIColor; use Term::ANSIColor;
use English;
my $tot_real_time= 0;
my $tests_done= 0;
my $tests_failed= 0;
our $timestamp= 0;
our $timediff= 0;
our $name;
our $verbose;
our $verbose_restart= 0;
our $timer= 1;
our $tests_total;
my %color_map = qw/pass green my %color_map = qw/pass green
retry-pass green retry-pass green
@ -47,20 +59,39 @@ my %color_map = qw/pass green
disabled bright_black disabled bright_black
skipped yellow skipped yellow
reset reset/; reset reset/;
sub xterm_color {
if (-t STDOUT and defined $ENV{TERM} and $ENV{TERM} =~ /xterm/) { my $set_titlebar;
syswrite STDOUT, color($color_map{$_[0]}); my $set_color= sub { };
if (-t STDOUT) {
if (IS_WINDOWS) {
eval {
require Win32::Console;
$set_titlebar = sub { &Win32::Console::Title($_[0]);};
}
} elsif ($ENV{TERM} =~ /xterm/) {
$set_titlebar = sub { syswrite STDOUT, "\e]0;$_[0]\a"; };
$set_color = sub { syswrite STDOUT, color($color_map{$_[0]}); }
} }
} }
my $tot_real_time= 0; sub titlebar_stat($) {
our $timestamp= 0; sub time_format($) {
our $timediff= 0; sprintf '%d:%02d:%02d', $_[0]/3600, ($_[0]/60)%60, $_[0]%60;
our $name; }
our $verbose;
our $verbose_restart= 0; $tests_done++;
our $timer= 1; $tests_failed++ if $_[0] =~ /fail/;
$tests_total++ if $_[0] =~ /retry/;
my $spent = time - $BASETIME;
my $left = $tests_total - $tests_done;
&$set_titlebar(sprintf "mtr: spent %s on %d tests. %s (%d tests) left, %d failed",
time_format($spent), $tests_done,
time_format($spent/$tests_done * $left), $left, $tests_failed);
}
sub report_option { sub report_option {
my ($opt, $value)= @_; my ($opt, $value)= @_;
@ -321,8 +352,6 @@ sub mtr_report_stats ($$$$) {
if ( $timer ) if ( $timer )
{ {
use English;
mtr_report("Spent", sprintf("%.3f", $tot_real_time),"of", mtr_report("Spent", sprintf("%.3f", $tot_real_time),"of",
time - $BASETIME, "seconds executing testcases"); time - $BASETIME, "seconds executing testcases");
} }
@ -620,10 +649,11 @@ sub mtr_report (@) {
my @s = split /\[ (\S+) \]/, _name() . "@_\n"; my @s = split /\[ (\S+) \]/, _name() . "@_\n";
if (@s > 1) { if (@s > 1) {
print $s[0]; print $s[0];
xterm_color($s[1]); &$set_color($s[1]);
print "[ $s[1] ]"; print "[ $s[1] ]";
xterm_color('reset'); &$set_color('reset');
print $s[2]; print $s[2];
titlebar_stat($s[1]) if $set_titlebar;
} else { } else {
print $s[0]; print $s[0];
} }

View File

@ -1,4 +1,3 @@
DROP TABLE IF EXISTS t1;
create table t1 (c1 VARCHAR(10) NOT NULL COMMENT 'c1 comment', c2 INTEGER,c3 INTEGER COMMENT '012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789', c4 INTEGER, c5 INTEGER, c6 INTEGER, c7 INTEGER, INDEX i1 (c1) COMMENT 'i1 comment',INDEX i2(c2) create table t1 (c1 VARCHAR(10) NOT NULL COMMENT 'c1 comment', c2 INTEGER,c3 INTEGER COMMENT '012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789', c4 INTEGER, c5 INTEGER, c6 INTEGER, c7 INTEGER, INDEX i1 (c1) COMMENT 'i1 comment',INDEX i2(c2)
) COMMENT='abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcd'; ) COMMENT='abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcd';
SELECT table_comment,char_length(table_comment) FROM information_schema.tables WHERE table_name='t1'; SELECT table_comment,char_length(table_comment) FROM information_schema.tables WHERE table_name='t1';
@ -125,3 +124,7 @@ SELECT table_comment,char_length(table_comment) FROM information_schema.tables W
table_comment char_length(table_comment) table_comment char_length(table_comment)
SELECT column_comment,char_length(column_comment) FROM information_schema.columns WHERE table_name='t1'; SELECT column_comment,char_length(column_comment) FROM information_schema.columns WHERE table_name='t1';
column_comment char_length(column_comment) column_comment char_length(column_comment)
set names utf8;
create table t1 (x int comment 'a');
ERROR HY000: Invalid utf8 character string: 'a'
set names latin1;

View File

@ -1,6 +1,3 @@
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
#1024 bytes #1024 bytes
create table t1 (c1 VARCHAR(10) NOT NULL COMMENT 'c1 comment', c2 INTEGER,c3 INTEGER COMMENT '012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789', c4 INTEGER, c5 INTEGER, c6 INTEGER, c7 INTEGER, INDEX i1 (c1) COMMENT 'i1 comment',INDEX i2(c2) create table t1 (c1 VARCHAR(10) NOT NULL COMMENT 'c1 comment', c2 INTEGER,c3 INTEGER COMMENT '012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789', c4 INTEGER, c5 INTEGER, c6 INTEGER, c7 INTEGER, INDEX i1 (c1) COMMENT 'i1 comment',INDEX i2(c2)
) COMMENT='abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcd'; ) COMMENT='abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcd';
@ -53,3 +50,11 @@ create table t1 (c1 VARCHAR(10) NOT NULL COMMENT 'c1 comment', c2 INTEGER,c3 INT
) COMMENT='abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde'; ) COMMENT='abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde';
SELECT table_comment,char_length(table_comment) FROM information_schema.tables WHERE table_name='t1'; SELECT table_comment,char_length(table_comment) FROM information_schema.tables WHERE table_name='t1';
SELECT column_comment,char_length(column_comment) FROM information_schema.columns WHERE table_name='t1'; SELECT column_comment,char_length(column_comment) FROM information_schema.columns WHERE table_name='t1';
#
# MDEV-22558 wrong error for invalid utf8 table comment
#
set names utf8;
--error ER_INVALID_CHARACTER_STRING
create table t1 (x int comment 'a');
set names latin1;

View File

@ -233,3 +233,24 @@ i
UNLOCK TABLES; UNLOCK TABLES;
DROP TABLE t1; DROP TABLE t1;
# End of 10.0 tests # End of 10.0 tests
create table t1 (a int, b varchar(200));
insert t1 select seq, repeat(200, seq) from seq_1_to_30;
delete from t1 where a % 13 = 0;
repair table t1 use_frm;
Table Op Msg_type Msg_text
test.t1 repair warning Number of rows changed from 0 to 28
test.t1 repair status OK
delete from t1 where a % 11 = 0;
repair table t1 extended use_frm;
Table Op Msg_type Msg_text
test.t1 repair warning Number of rows changed from 0 to 26
test.t1 repair status OK
delete from t1 where a % 7 = 0;
set myisam_repair_threads = 2;
repair table t1 use_frm;
Table Op Msg_type Msg_text
test.t1 repair warning Number of rows changed from 0 to 22
test.t1 repair status OK
set myisam_repair_threads = default;
drop table t1;
# End of 10.2 tests

View File

@ -1,6 +1,7 @@
# #
# Test of repair table # Test of repair table
# #
--source include/have_sequence.inc
--source include/default_charset.inc --source include/default_charset.inc
call mtr.add_suppression("character set is multi-byte"); call mtr.add_suppression("character set is multi-byte");
@ -246,3 +247,23 @@ UNLOCK TABLES;
DROP TABLE t1; DROP TABLE t1;
--echo # End of 10.0 tests --echo # End of 10.0 tests
#
# MDEV-17153 server crash on repair table ... use_frm
#
# Note, this test case doesn't crash, but shows spurios warnings
# unless the bug is fixed
#
create table t1 (a int, b varchar(200));
insert t1 select seq, repeat(200, seq) from seq_1_to_30;
delete from t1 where a % 13 = 0;
repair table t1 use_frm;
delete from t1 where a % 11 = 0;
repair table t1 extended use_frm;
delete from t1 where a % 7 = 0;
set myisam_repair_threads = 2;
repair table t1 use_frm;
set myisam_repair_threads = default;
drop table t1;
--echo # End of 10.2 tests

View File

@ -374,32 +374,6 @@ my $opt_stop_keep_alive= $ENV{MTR_STOP_KEEP_ALIVE};
select(STDOUT); select(STDOUT);
$| = 1; # Automatically flush STDOUT $| = 1; # Automatically flush STDOUT
my $set_titlebar;
BEGIN {
if (IS_WINDOWS) {
my $have_win32_console= 0;
eval {
require Win32::Console;
Win32::Console->import();
$have_win32_console = 1;
};
eval 'sub HAVE_WIN32_CONSOLE { $have_win32_console }';
} else {
eval 'sub HAVE_WIN32_CONSOLE { 0 }';
}
}
if (-t STDOUT) {
if (IS_WINDOWS and HAVE_WIN32_CONSOLE) {
$set_titlebar = sub {Win32::Console::Title $_[0];};
} elsif (defined $ENV{TERM} and $ENV{TERM} =~ /xterm/) {
$set_titlebar = sub { syswrite STDOUT, "\e];$_[0]\a"; };
}
}
main(); main();
sub have_wsrep() { sub have_wsrep() {
@ -637,7 +611,7 @@ sub main {
} }
####################################################################### #######################################################################
my $num_tests= @$tests; my $num_tests= $mtr_report::tests_total= @$tests;
if ( $opt_parallel eq "auto" ) { if ( $opt_parallel eq "auto" ) {
# Try to find a suitable value for number of workers # Try to find a suitable value for number of workers
if (IS_WINDOWS) if (IS_WINDOWS)
@ -1078,8 +1052,6 @@ sub run_test_server ($$$) {
delete $next->{reserved}; delete $next->{reserved};
} }
titlebar_stat(scalar(@$tests)) if $set_titlebar;
if ($next) { if ($next) {
# We don't need this any more # We don't need this any more
delete $next->{criteria}; delete $next->{criteria};
@ -6684,23 +6656,3 @@ sub list_options ($) {
exit(1); exit(1);
} }
sub time_format($) {
sprintf '%d:%02d:%02d', $_[0]/3600, ($_[0]/60)%60, $_[0]%60;
}
our $num_tests;
sub titlebar_stat {
my ($left) = @_;
# 2.5 -> best by test
$num_tests = $left + 2.5 unless $num_tests;
my $done = $num_tests - $left;
my $spent = time - $^T;
&$set_titlebar(sprintf "mtr: spent %s on %d tests. %s (%d tests) left",
time_format($spent), $done,
time_format($spent/$done * $left), $left);
}

View File

@ -258,7 +258,8 @@ my_bool bitmap_fast_test_and_set(MY_BITMAP *map, uint bitmap_bit)
my_bool bitmap_test_and_set(MY_BITMAP *map, uint bitmap_bit) my_bool bitmap_test_and_set(MY_BITMAP *map, uint bitmap_bit)
{ {
my_bool res; my_bool res;
DBUG_ASSERT(map->bitmap && bitmap_bit < map->n_bits); DBUG_ASSERT(map->bitmap);
DBUG_ASSERT(bitmap_bit < map->n_bits);
bitmap_lock(map); bitmap_lock(map);
res= bitmap_fast_test_and_set(map, bitmap_bit); res= bitmap_fast_test_and_set(map, bitmap_bit);
bitmap_unlock(map); bitmap_unlock(map);
@ -291,7 +292,8 @@ my_bool bitmap_fast_test_and_clear(MY_BITMAP *map, uint bitmap_bit)
my_bool bitmap_test_and_clear(MY_BITMAP *map, uint bitmap_bit) my_bool bitmap_test_and_clear(MY_BITMAP *map, uint bitmap_bit)
{ {
my_bool res; my_bool res;
DBUG_ASSERT(map->bitmap && bitmap_bit < map->n_bits); DBUG_ASSERT(map->bitmap);
DBUG_ASSERT(bitmap_bit < map->n_bits);
bitmap_lock(map); bitmap_lock(map);
res= bitmap_fast_test_and_clear(map, bitmap_bit); res= bitmap_fast_test_and_clear(map, bitmap_bit);
bitmap_unlock(map); bitmap_unlock(map);
@ -320,8 +322,8 @@ void bitmap_set_prefix(MY_BITMAP *map, uint prefix_size)
uint prefix_bytes, prefix_bits, d; uint prefix_bytes, prefix_bits, d;
uchar *m= (uchar *)map->bitmap; uchar *m= (uchar *)map->bitmap;
DBUG_ASSERT(map->bitmap && DBUG_ASSERT(map->bitmap);
(prefix_size <= map->n_bits || prefix_size == (uint) ~0)); DBUG_ASSERT(prefix_size <= map->n_bits || prefix_size == (uint) ~0);
set_if_smaller(prefix_size, map->n_bits); set_if_smaller(prefix_size, map->n_bits);
if ((prefix_bytes= prefix_size / 8)) if ((prefix_bytes= prefix_size / 8))
memset(m, 0xff, prefix_bytes); memset(m, 0xff, prefix_bytes);
@ -343,7 +345,8 @@ my_bool bitmap_is_prefix(const MY_BITMAP *map, uint prefix_size)
uchar *m= (uchar*) map->bitmap; uchar *m= (uchar*) map->bitmap;
uchar *end_prefix= m+(prefix_size-1)/8; uchar *end_prefix= m+(prefix_size-1)/8;
uchar *end; uchar *end;
DBUG_ASSERT(m && prefix_size <= map->n_bits); DBUG_ASSERT(m);
DBUG_ASSERT(prefix_size <= map->n_bits);
/* Empty prefix is always true */ /* Empty prefix is always true */
if (!prefix_size) if (!prefix_size)
@ -396,8 +399,8 @@ my_bool bitmap_is_subset(const MY_BITMAP *map1, const MY_BITMAP *map2)
{ {
my_bitmap_map *m1= map1->bitmap, *m2= map2->bitmap, *end; my_bitmap_map *m1= map1->bitmap, *m2= map2->bitmap, *end;
DBUG_ASSERT(map1->bitmap && map2->bitmap && DBUG_ASSERT(map1->bitmap && map2->bitmap);
map1->n_bits==map2->n_bits); DBUG_ASSERT(map1->n_bits==map2->n_bits);
end= map1->last_word_ptr; end= map1->last_word_ptr;
while (m1 < end) while (m1 < end)
@ -415,8 +418,9 @@ my_bool bitmap_is_overlapping(const MY_BITMAP *map1, const MY_BITMAP *map2)
{ {
my_bitmap_map *m1= map1->bitmap, *m2= map2->bitmap, *end; my_bitmap_map *m1= map1->bitmap, *m2= map2->bitmap, *end;
DBUG_ASSERT(map1->bitmap && map2->bitmap && DBUG_ASSERT(map1->bitmap);
map1->n_bits==map2->n_bits); DBUG_ASSERT(map2->bitmap);
DBUG_ASSERT(map1->n_bits==map2->n_bits);
end= map1->last_word_ptr; end= map1->last_word_ptr;
while (m1 < end) while (m1 < end)
@ -434,7 +438,8 @@ void bitmap_intersect(MY_BITMAP *map, const MY_BITMAP *map2)
my_bitmap_map *to= map->bitmap, *from= map2->bitmap, *end; my_bitmap_map *to= map->bitmap, *from= map2->bitmap, *end;
uint len= no_words_in_map(map), len2 = no_words_in_map(map2); uint len= no_words_in_map(map), len2 = no_words_in_map(map2);
DBUG_ASSERT(map->bitmap && map2->bitmap); DBUG_ASSERT(map->bitmap);
DBUG_ASSERT(map2->bitmap);
end= to+MY_MIN(len,len2); end= to+MY_MIN(len,len2);
while (to < end) while (to < end)
@ -479,7 +484,8 @@ my_bool bitmap_exists_intersection(const MY_BITMAP **bitmap_array,
uint i, j, start_idx, end_idx; uint i, j, start_idx, end_idx;
my_bitmap_map cur_res; my_bitmap_map cur_res;
DBUG_ASSERT(bitmap_count && end_bit >= start_bit); DBUG_ASSERT(bitmap_count);
DBUG_ASSERT(end_bit >= start_bit);
for (j= 0; j < bitmap_count; j++) for (j= 0; j < bitmap_count; j++)
DBUG_ASSERT(end_bit < bitmap_array[j]->n_bits); DBUG_ASSERT(end_bit < bitmap_array[j]->n_bits);
@ -507,8 +513,9 @@ my_bool bitmap_union_is_set_all(const MY_BITMAP *map1, const MY_BITMAP *map2)
{ {
my_bitmap_map *m1= map1->bitmap, *m2= map2->bitmap, *end; my_bitmap_map *m1= map1->bitmap, *m2= map2->bitmap, *end;
DBUG_ASSERT(map1->bitmap && map2->bitmap && DBUG_ASSERT(map1->bitmap);
map1->n_bits==map2->n_bits); DBUG_ASSERT(map2->bitmap);
DBUG_ASSERT(map1->n_bits==map2->n_bits);
end= map1->last_word_ptr; end= map1->last_word_ptr;
while ( m1 < end) while ( m1 < end)
if ((*m1++ | *m2++) != 0xFFFFFFFF) if ((*m1++ | *m2++) != 0xFFFFFFFF)
@ -553,8 +560,9 @@ void bitmap_set_above(MY_BITMAP *map, uint from_byte, uint use_bit)
void bitmap_subtract(MY_BITMAP *map, const MY_BITMAP *map2) void bitmap_subtract(MY_BITMAP *map, const MY_BITMAP *map2)
{ {
my_bitmap_map *to= map->bitmap, *from= map2->bitmap, *end; my_bitmap_map *to= map->bitmap, *from= map2->bitmap, *end;
DBUG_ASSERT(map->bitmap && map2->bitmap && DBUG_ASSERT(map->bitmap);
map->n_bits==map2->n_bits); DBUG_ASSERT(map2->bitmap);
DBUG_ASSERT(map->n_bits==map2->n_bits);
end= map->last_word_ptr; end= map->last_word_ptr;
@ -567,8 +575,9 @@ void bitmap_union(MY_BITMAP *map, const MY_BITMAP *map2)
{ {
my_bitmap_map *to= map->bitmap, *from= map2->bitmap, *end; my_bitmap_map *to= map->bitmap, *from= map2->bitmap, *end;
DBUG_ASSERT(map->bitmap && map2->bitmap && DBUG_ASSERT(map->bitmap);
map->n_bits==map2->n_bits); DBUG_ASSERT(map2->bitmap);
DBUG_ASSERT(map->n_bits == map2->n_bits);
end= map->last_word_ptr; end= map->last_word_ptr;
while (to <= end) while (to <= end)
@ -579,8 +588,9 @@ void bitmap_union(MY_BITMAP *map, const MY_BITMAP *map2)
void bitmap_xor(MY_BITMAP *map, const MY_BITMAP *map2) void bitmap_xor(MY_BITMAP *map, const MY_BITMAP *map2)
{ {
my_bitmap_map *to= map->bitmap, *from= map2->bitmap, *end= map->last_word_ptr; my_bitmap_map *to= map->bitmap, *from= map2->bitmap, *end= map->last_word_ptr;
DBUG_ASSERT(map->bitmap && map2->bitmap && DBUG_ASSERT(map->bitmap);
map->n_bits==map2->n_bits); DBUG_ASSERT(map2->bitmap);
DBUG_ASSERT(map->n_bits == map2->n_bits);
while (to <= end) while (to <= end)
*to++ ^= *from++; *to++ ^= *from++;
} }
@ -617,8 +627,9 @@ void bitmap_copy(MY_BITMAP *map, const MY_BITMAP *map2)
{ {
my_bitmap_map *to= map->bitmap, *from= map2->bitmap, *end; my_bitmap_map *to= map->bitmap, *from= map2->bitmap, *end;
DBUG_ASSERT(map->bitmap && map2->bitmap && DBUG_ASSERT(map->bitmap);
map->n_bits==map2->n_bits); DBUG_ASSERT(map2->bitmap);
DBUG_ASSERT(map->n_bits == map2->n_bits);
end= map->last_word_ptr; end= map->last_word_ptr;
while (to <= end) while (to <= end)
@ -747,7 +758,8 @@ uint bitmap_lock_set_next(MY_BITMAP *map)
void bitmap_lock_clear_bit(MY_BITMAP *map, uint bitmap_bit) void bitmap_lock_clear_bit(MY_BITMAP *map, uint bitmap_bit)
{ {
bitmap_lock(map); bitmap_lock(map);
DBUG_ASSERT(map->bitmap && bitmap_bit < map->n_bits); DBUG_ASSERT(map->bitmap);
DBUG_ASSERT(bitmap_bit < map->n_bits);
bitmap_clear_bit(map, bitmap_bit); bitmap_clear_bit(map, bitmap_bit);
bitmap_unlock(map); bitmap_unlock(map);
} }

View File

@ -2240,7 +2240,8 @@ void ha_partition::update_create_info(HA_CREATE_INFO *create_info)
sub_elem= subpart_it++; sub_elem= subpart_it++;
DBUG_ASSERT(sub_elem); DBUG_ASSERT(sub_elem);
part= i * num_subparts + j; part= i * num_subparts + j;
DBUG_ASSERT(part < m_file_tot_parts && m_file[part]); DBUG_ASSERT(part < m_file_tot_parts);
DBUG_ASSERT(m_file[part]);
dummy_info.data_file_name= dummy_info.index_file_name = NULL; dummy_info.data_file_name= dummy_info.index_file_name = NULL;
m_file[part]->update_create_info(&dummy_info); m_file[part]->update_create_info(&dummy_info);
sub_elem->data_file_name = (char*) dummy_info.data_file_name; sub_elem->data_file_name = (char*) dummy_info.data_file_name;
@ -3905,7 +3906,8 @@ int ha_partition::external_lock(THD *thd, int lock_type)
MY_BITMAP *used_partitions; MY_BITMAP *used_partitions;
DBUG_ENTER("ha_partition::external_lock"); DBUG_ENTER("ha_partition::external_lock");
DBUG_ASSERT(!auto_increment_lock && !auto_increment_safe_stmt_log_lock); DBUG_ASSERT(!auto_increment_lock);
DBUG_ASSERT(!auto_increment_safe_stmt_log_lock);
if (lock_type == F_UNLCK) if (lock_type == F_UNLCK)
used_partitions= &m_locked_partitions; used_partitions= &m_locked_partitions;
@ -4184,8 +4186,8 @@ void ha_partition::unlock_row()
bool ha_partition::was_semi_consistent_read() bool ha_partition::was_semi_consistent_read()
{ {
DBUG_ENTER("ha_partition::was_semi_consistent_read"); DBUG_ENTER("ha_partition::was_semi_consistent_read");
DBUG_ASSERT(m_last_part < m_tot_parts && DBUG_ASSERT(m_last_part < m_tot_parts);
bitmap_is_set(&(m_part_info->read_partitions), m_last_part)); DBUG_ASSERT(bitmap_is_set(&(m_part_info->read_partitions), m_last_part));
DBUG_RETURN(m_file[m_last_part]->was_semi_consistent_read()); DBUG_RETURN(m_file[m_last_part]->was_semi_consistent_read());
} }
@ -7067,8 +7069,8 @@ int ha_partition::partition_scan_set_up(uchar * buf, bool idx_read_flag)
DBUG_ASSERT(m_part_spec.start_part < m_tot_parts); DBUG_ASSERT(m_part_spec.start_part < m_tot_parts);
m_ordered_scan_ongoing= m_ordered; m_ordered_scan_ongoing= m_ordered;
} }
DBUG_ASSERT(m_part_spec.start_part < m_tot_parts && DBUG_ASSERT(m_part_spec.start_part < m_tot_parts);
m_part_spec.end_part < m_tot_parts); DBUG_ASSERT(m_part_spec.end_part < m_tot_parts);
DBUG_RETURN(0); DBUG_RETURN(0);
} }
@ -10472,7 +10474,8 @@ void ha_partition::get_auto_increment(ulonglong offset, ulonglong increment,
DBUG_PRINT("enter", ("offset: %lu inc: %lu desired_values: %lu " DBUG_PRINT("enter", ("offset: %lu inc: %lu desired_values: %lu "
"first_value: %lu", (ulong) offset, (ulong) increment, "first_value: %lu", (ulong) offset, (ulong) increment,
(ulong) nb_desired_values, (ulong) *first_value)); (ulong) nb_desired_values, (ulong) *first_value));
DBUG_ASSERT(increment && nb_desired_values); DBUG_ASSERT(increment);
DBUG_ASSERT(nb_desired_values);
*first_value= 0; *first_value= 0;
if (table->s->next_number_keypart) if (table->s->next_number_keypart)
{ {

View File

@ -351,7 +351,6 @@ static bool volatile select_thread_in_use, signal_thread_in_use;
static volatile bool ready_to_exit; static volatile bool ready_to_exit;
static my_bool opt_debugging= 0, opt_external_locking= 0, opt_console= 0; static my_bool opt_debugging= 0, opt_external_locking= 0, opt_console= 0;
static my_bool opt_short_log_format= 0, opt_silent_startup= 0; static my_bool opt_short_log_format= 0, opt_silent_startup= 0;
bool my_disable_leak_check= false;
uint kill_cached_threads; uint kill_cached_threads;
static uint wake_thread; static uint wake_thread;

View File

@ -667,6 +667,7 @@ public:
bool statement_should_be_aborted() const bool statement_should_be_aborted() const
{ {
return return
thd->killed ||
thd->is_fatal_error || thd->is_fatal_error ||
thd->is_error() || thd->is_error() ||
alloced_sel_args > SEL_ARG::MAX_SEL_ARGS; alloced_sel_args > SEL_ARG::MAX_SEL_ARGS;

View File

@ -1,6 +1,6 @@
/* /*
Copyright (c) 2000, 2016, Oracle and/or its affiliates. Copyright (c) 2000, 2016, Oracle and/or its affiliates.
Copyright (c) 2009, 2019, MariaDB Corporation. Copyright (c) 2009, 2020, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -4003,7 +4003,8 @@ public:
The worst things that can happen is that we get The worst things that can happen is that we get
a suboptimal error message. a suboptimal error message.
*/ */
if (likely((killed_err= (err_info*) alloc(sizeof(*killed_err))))) killed_err= (err_info*) alloc_root(&main_mem_root, sizeof(*killed_err));
if (likely(killed_err))
{ {
killed_err->no= killed_errno_arg; killed_err->no= killed_errno_arg;
::strmake((char*) killed_err->msg, killed_err_msg_arg, ::strmake((char*) killed_err->msg, killed_err_msg_arg,

View File

@ -4335,6 +4335,25 @@ bool validate_comment_length(THD *thd, LEX_CSTRING *comment, size_t max_len,
Well_formed_prefix(system_charset_info, *comment, max_len).length(); Well_formed_prefix(system_charset_info, *comment, max_len).length();
if (tmp_len < comment->length) if (tmp_len < comment->length)
{ {
#if MARIADB_VERSION_ID < 100500
if (comment->length <= max_len)
{
if (thd->is_strict_mode())
{
my_error(ER_INVALID_CHARACTER_STRING, MYF(0),
system_charset_info->csname, comment->str);
DBUG_RETURN(true);
}
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_INVALID_CHARACTER_STRING,
ER_THD(thd, ER_INVALID_CHARACTER_STRING),
system_charset_info->csname, comment->str);
comment->length= tmp_len;
DBUG_RETURN(false);
}
#else
#error do it in TEXT_STRING_sys
#endif
if (thd->is_strict_mode()) if (thd->is_strict_mode())
{ {
my_error(err_code, MYF(0), name, static_cast<ulong>(max_len)); my_error(err_code, MYF(0), name, static_cast<ulong>(max_len));

View File

@ -445,6 +445,9 @@ grn_db_close(grn_ctx *ctx, grn_obj *db)
ctx_used_db = ctx->impl && ctx->impl->db == db; ctx_used_db = ctx->impl && ctx->impl->db == db;
if (ctx_used_db) { if (ctx_used_db) {
#ifdef GRN_WITH_MECAB
grn_db_fin_mecab_tokenizer(ctx);
#endif
grn_ctx_loader_clear(ctx); grn_ctx_loader_clear(ctx);
if (ctx->impl->parser) { if (ctx->impl->parser) {
grn_expr_parser_close(ctx); grn_expr_parser_close(ctx);

View File

@ -30,6 +30,7 @@ grn_rc grn_tokenizers_init(void);
grn_rc grn_tokenizers_fin(void); grn_rc grn_tokenizers_fin(void);
grn_rc grn_db_init_mecab_tokenizer(grn_ctx *ctx); grn_rc grn_db_init_mecab_tokenizer(grn_ctx *ctx);
void grn_db_fin_mecab_tokenizer(grn_ctx *ctx);
grn_rc grn_db_init_builtin_tokenizers(grn_ctx *ctx); grn_rc grn_db_init_builtin_tokenizers(grn_ctx *ctx);
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -797,6 +797,36 @@ grn_db_init_mecab_tokenizer(grn_ctx *ctx)
} }
} }
void
grn_db_fin_mecab_tokenizer(grn_ctx *ctx)
{
switch (GRN_CTX_GET_ENCODING(ctx)) {
case GRN_ENC_EUC_JP :
case GRN_ENC_UTF8 :
case GRN_ENC_SJIS :
#if defined(GRN_EMBEDDED) && defined(GRN_WITH_MECAB)
{
GRN_PLUGIN_DECLARE_FUNCTIONS(tokenizers_mecab);
GRN_PLUGIN_IMPL_NAME_TAGGED(fin, tokenizers_mecab)(ctx);
}
#else /* defined(GRN_EMBEDDED) && defined(GRN_WITH_MECAB) */
{
const char *mecab_plugin_name = "tokenizers/mecab";
char *path;
path = grn_plugin_find_path(ctx, mecab_plugin_name);
if (path) {
GRN_FREE(path);
grn_plugin_unregister(ctx, mecab_plugin_name);
}
}
#endif /* defined(GRN_EMBEDDED) && defined(GRN_WITH_MECAB) */
break;
default :
break;
}
return;
}
#define DEF_TOKENIZER(name, init, next, fin, vars)\ #define DEF_TOKENIZER(name, init, next, fin, vars)\
(grn_proc_create(ctx, (name), (sizeof(name) - 1),\ (grn_proc_create(ctx, (name), (sizeof(name) - 1),\
GRN_PROC_TOKENIZER, (init), (next), (fin), 3, (vars))) GRN_PROC_TOKENIZER, (init), (next), (fin), 3, (vars)))

View File

@ -31,6 +31,7 @@
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
static unsigned int sole_mecab_init_counter = 0;
static mecab_t *sole_mecab = NULL; static mecab_t *sole_mecab = NULL;
static grn_plugin_mutex *sole_mecab_mutex = NULL; static grn_plugin_mutex *sole_mecab_mutex = NULL;
static grn_encoding sole_mecab_encoding = GRN_ENC_NONE; static grn_encoding sole_mecab_encoding = GRN_ENC_NONE;
@ -563,6 +564,11 @@ check_mecab_dictionary_encoding(grn_ctx *ctx)
grn_rc grn_rc
GRN_PLUGIN_INIT(grn_ctx *ctx) GRN_PLUGIN_INIT(grn_ctx *ctx)
{ {
++sole_mecab_init_counter;
if (sole_mecab_init_counter > 1)
{
return GRN_SUCCESS;
}
{ {
char env[GRN_ENV_BUFFER_SIZE]; char env[GRN_ENV_BUFFER_SIZE];
@ -636,6 +642,11 @@ GRN_PLUGIN_REGISTER(grn_ctx *ctx)
grn_rc grn_rc
GRN_PLUGIN_FIN(grn_ctx *ctx) GRN_PLUGIN_FIN(grn_ctx *ctx)
{ {
--sole_mecab_init_counter;
if (sole_mecab_init_counter > 0)
{
return GRN_SUCCESS;
}
if (sole_mecab) { if (sole_mecab) {
mecab_destroy(sole_mecab); mecab_destroy(sole_mecab);
sole_mecab = NULL; sole_mecab = NULL;

View File

@ -1583,6 +1583,8 @@ int mi_repair(HA_CHECK *param, register MI_INFO *info,
sort_param.filepos=new_header_length; sort_param.filepos=new_header_length;
param->read_cache.end_of_file=sort_info.filelength= param->read_cache.end_of_file=sort_info.filelength=
mysql_file_seek(info->dfile, 0L, MY_SEEK_END, MYF(0)); mysql_file_seek(info->dfile, 0L, MY_SEEK_END, MYF(0));
if (info->state->data_file_length == 0)
info->state->data_file_length= sort_info.filelength;
sort_info.dupp=0; sort_info.dupp=0;
sort_param.fix_datafile= (my_bool) (! rep_quick); sort_param.fix_datafile= (my_bool) (! rep_quick);
sort_param.master=1; sort_param.master=1;
@ -2288,6 +2290,8 @@ int mi_repair_by_sort(HA_CHECK *param, register MI_INFO *info,
sort_info.buff=0; sort_info.buff=0;
param->read_cache.end_of_file=sort_info.filelength= param->read_cache.end_of_file=sort_info.filelength=
mysql_file_seek(param->read_cache.file, 0L, MY_SEEK_END, MYF(0)); mysql_file_seek(param->read_cache.file, 0L, MY_SEEK_END, MYF(0));
if (info->state->data_file_length == 0)
info->state->data_file_length= sort_info.filelength;
sort_param.wordlist=NULL; sort_param.wordlist=NULL;
init_alloc_root(&sort_param.wordroot, "sort", FTPARSER_MEMROOT_ALLOC_SIZE, 0, init_alloc_root(&sort_param.wordroot, "sort", FTPARSER_MEMROOT_ALLOC_SIZE, 0,
@ -2755,6 +2759,8 @@ int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info,
sort_info.buff=0; sort_info.buff=0;
param->read_cache.end_of_file=sort_info.filelength= param->read_cache.end_of_file=sort_info.filelength=
mysql_file_seek(param->read_cache.file, 0L, MY_SEEK_END, MYF(0)); mysql_file_seek(param->read_cache.file, 0L, MY_SEEK_END, MYF(0));
if (info->state->data_file_length == 0)
info->state->data_file_length= sort_info.filelength;
if (share->data_file_type == DYNAMIC_RECORD) if (share->data_file_type == DYNAMIC_RECORD)
rec_length=MY_MAX(share->base.min_pack_length+1,share->base.min_block_length); rec_length=MY_MAX(share->base.min_pack_length+1,share->base.min_block_length);

View File

@ -67,7 +67,7 @@ if(SNAPPY_FOUND AND (NOT WITH_ROCKSDB_snappy STREQUAL "OFF"))
endif() endif()
include(CheckFunctionExists) include(CheckFunctionExists)
if(ZSTD_FOUND AND (NOT WITH_ROCKSDB_zstd STREQUAL "OFF")) if(ZSTD_FOUND AND (NOT WITH_ROCKSDB_ZSTD STREQUAL "OFF"))
SET(CMAKE_REQUIRED_LIBRARIES zstd) SET(CMAKE_REQUIRED_LIBRARIES zstd)
CHECK_FUNCTION_EXISTS(ZDICT_trainFromBuffer ZSTD_VALID) CHECK_FUNCTION_EXISTS(ZDICT_trainFromBuffer ZSTD_VALID)
UNSET(CMAKE_REQUIRED_LIBRARIES) UNSET(CMAKE_REQUIRED_LIBRARIES)

View File

@ -114,7 +114,6 @@ int thd_binlog_format(const MYSQL_THD thd);
bool thd_binlog_filter_ok(const MYSQL_THD thd); bool thd_binlog_filter_ok(const MYSQL_THD thd);
} }
MYSQL_PLUGIN_IMPORT bool my_disable_leak_check;
extern my_bool opt_core_file; extern my_bool opt_core_file;
// Needed in rocksdb_init_func // Needed in rocksdb_init_func
@ -5716,13 +5715,6 @@ static int rocksdb_init_func(void *const p) {
} }
#endif #endif
/**
Rocksdb does not always shutdown its threads, when
plugin is shut down. Disable server's leak check
at exit to avoid crash.
*/
my_disable_leak_check = true;
err = my_error_register(rdb_get_error_messages, HA_ERR_ROCKSDB_FIRST, err = my_error_register(rdb_get_error_messages, HA_ERR_ROCKSDB_FIRST,
HA_ERR_ROCKSDB_LAST); HA_ERR_ROCKSDB_LAST);
if (err != 0) { if (err != 0) {

View File

@ -20,6 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
#undef NOMINMAX #undef NOMINMAX
#include <winsock2.h> #include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h> #include <windows.h>
#include <winreg.h> #include <winreg.h>
#include <msi.h> #include <msi.h>
@ -33,6 +34,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
#include <stdlib.h> #include <stdlib.h>
#include <winservice.h> #include <winservice.h>
#define ONE_MB 1048576 #define ONE_MB 1048576
UINT ExecRemoveDataDirectory(wchar_t *dir) UINT ExecRemoveDataDirectory(wchar_t *dir)
{ {
@ -256,36 +258,89 @@ bool ExecRemoveService(const wchar_t *name)
return ret; return ret;
} }
/* /* Find whether TCP port is in use by trying to bind to the port. */
Check if port is free by trying to bind to the port static bool IsPortInUse(unsigned short port)
*/
bool IsPortFree(short port)
{ {
WORD wVersionRequested; struct addrinfo* ai, * a;
WSADATA wsaData; struct addrinfo hints {};
wVersionRequested = MAKEWORD(2, 2); char port_buf[NI_MAXSERV];
SOCKET ip_sock = INVALID_SOCKET;
hints.ai_flags = AI_PASSIVE;
hints.ai_socktype = SOCK_STREAM;
hints.ai_family = AF_UNSPEC;
snprintf(port_buf, NI_MAXSERV, "%u", (unsigned)port);
WSAStartup(wVersionRequested, &wsaData); if (getaddrinfo(NULL, port_buf, &hints, &ai))
struct sockaddr_in sin;
SOCKET sock;
sock = socket(AF_INET, SOCK_STREAM, 0);
if(sock == INVALID_SOCKET)
{ {
return false; return false;
} }
sin.sin_port = htons(port);
sin.sin_addr.s_addr = 0; /*
sin.sin_addr.s_addr = INADDR_ANY; Prefer IPv6 socket to IPv4, since we'll use IPv6 dual socket,
sin.sin_family = AF_INET; which coveres both IP versions.
if(bind(sock, (struct sockaddr *)&sin,sizeof(struct sockaddr_in) ) == -1) */
for (a = ai; a; a = a->ai_next)
{
if (a->ai_family == AF_INET6 &&
(ip_sock = socket(a->ai_family, a->ai_socktype, a->ai_protocol)) != INVALID_SOCKET)
{
break;
}
}
if (ip_sock == INVALID_SOCKET)
{
for (a = ai; a; a = a->ai_next)
{
if (ai->ai_family == AF_INET &&
(ip_sock = socket(a->ai_family, a->ai_socktype, a->ai_protocol)) != INVALID_SOCKET)
{
break;
}
}
}
if (ip_sock == INVALID_SOCKET)
{ {
return false; return false;
} }
closesocket(sock);
/* Use SO_EXCLUSIVEADDRUSE to prevent multiple binding. */
int arg = 1;
setsockopt(ip_sock, SOL_SOCKET, SO_EXCLUSIVEADDRUSE, (char*)&arg, sizeof(arg));
/* Allow dual socket, so that IPv4 and IPv6 are both covered.*/
if (a->ai_family == AF_INET6)
{
arg = 0;
setsockopt(ip_sock, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&arg, sizeof(arg));
}
bool in_use = false;
if (bind(ip_sock, a->ai_addr, a->ai_addrlen) == SOCKET_ERROR)
{
DWORD last_error = WSAGetLastError();
in_use = (last_error == WSAEADDRINUSE || last_error == WSAEACCES);
}
freeaddrinfo(ai);
closesocket(ip_sock);
return in_use;
}
/*
Check if TCP port is free
*/
bool IsPortFree(unsigned short port)
{
WORD wVersionRequested = MAKEWORD(2, 2);
WSADATA wsaData;
WSAStartup(wVersionRequested, &wsaData);
bool in_use = IsPortInUse(port);
WSACleanup(); WSACleanup();
return true; return !in_use;
} }
@ -641,7 +696,7 @@ extern "C" UINT __stdcall CheckDatabaseProperties (MSIHANDLE hInstall)
goto LExit; goto LExit;
} }
short port = (short)_wtoi(Port); unsigned short port = (unsigned short)_wtoi(Port);
if (!IsPortFree(port)) if (!IsPortFree(port))
{ {
ErrorMsg = ErrorMsg =

View File

@ -34,10 +34,12 @@ IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(Win64 " Win64='yes'") SET(Win64 " Win64='yes'")
SET(Platform x64) SET(Platform x64)
SET(PlatformProgramFilesFolder ProgramFiles64Folder) SET(PlatformProgramFilesFolder ProgramFiles64Folder)
SET(CA_QUIET_EXEC CAQuietExec64)
ELSE() ELSE()
SET(CANDLE_ARCH -arch x86) SET(CANDLE_ARCH -arch x86)
SET(Platform x86) SET(Platform x86)
SET(PlatformProgramFilesFolder ProgramFilesFolder) SET(PlatformProgramFilesFolder ProgramFilesFolder)
SET(CA_QUIET_EXEC CAQuietExec)
SET(Win64) SET(Win64)
ENDIF() ENDIF()

View File

@ -1,183 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<Property Id="PortTemplate" Value="####" />
<Property Id="PORT" Value="3306"></Property>
<Property Id="MSIRESTARTMANAGERCONTROL" Value="Disable"/>
<Property Id="CREATEDBINSTANCE"><![CDATA[&DBInstance=3 AND NOT !DBInstance=3]]></Property>
<UI>
<Dialog Id="DatabaseCreationDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
<Control Id="ServiceNameLabel" Type="Text" X="20" Y="73" Width="70" Height="15" TabSkip="no" Text="Service Name:" />
<Control Id="ServiceName" Type="Edit" X="90" Y="73" Width="120" Height="15" Property="SERVICENAME" Text="{20}" />
<Control Id="RootPasswordLabel" Type="Text" X="20" Y="90" Width="120" Height="15" TabSkip="no" Text="&amp;Root password:" />
<Control Id="RootPassword" Type="Edit" X="20" Y="105" Width="120" Height="18" Property="ROOT_PASSWORD" Password="yes" Text="{20}" />
<Control Id="RootPasswordConfirmLabel" Type="Text" X="150" Y="90" Width="150" Height="15" TabSkip="no" Text="&amp;Confirm Root password:" />
<Control Id="RootPasswordConfirm" Type="Edit" X="150" Y="105" Width="120" Height="18" Property="ROOT_PASSWORD_CONFIRM" Password="yes" Text="{20}" />
<Control Id="BannerLine0" Type="Line" X="0" Y="128" Width="370" Height="0" />
<Control Id="PortLabel" Type="Text" X="20" Y="137" Width="40" Height="15" TabSkip="no" Text="TCP port:" />
<Control Id="Port" Type="MaskedEdit" X="60" Y="136" Width="30" Height="15" Property="PORT" Text="[PortTemplate]"/>
<!--<Control Id="FirewallExceptionCheckBox" Type="CheckBox" X="150" Y="136" Height="15" Property="FIREWALL_EXCEPTION" Width="200" CheckBoxValue="1"
Text="Create Firewall exception for this port"/>-->
<Control Id="BannerLine2" Type="Line" X="0" Y="155" Width="370" Height="0" />
<Control Id="FolderLabel" Type="Text" X="20" Y="181" Width="100" Height="15" TabSkip="no" Text="Database location:" />
<Control Id="Folder" Type="PathEdit" X="20" Y="204" Width="200" Height="18" Property="DATABASELOCATION" Indirect="no" />
<!-- Navigation buttons-->
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="&amp;Back">
<Publish Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
</Control>
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="&amp;Next">
<!--
<Publish Event="ValidateProductID" Value="0">1</Publish>
<Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg">CostingComplete = 1</Publish>
-->
<!--<Publish Event="NewDialog" Value="SetupTypeDlg">ProductID</Publish>-->
</Control>
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Cancel">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="WixUI_Bmp_Banner" />
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes">
<Text>Create default [ProductName] instance</Text>
</Control>
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes">
<Text>{\WixUI_Font_Title}Default instance properties</Text>
</Control>
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
</Dialog>
<Dialog Id="ConfirmDataCleanupDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
<Control Id="ServiceRemoveText" Type="Text" X="20" Y="73" Width="300" Height="15" TabSkip="no">
<Text>Service '[SERVICENAME]' will be removed</Text>
</Control>
<Control Id="CleanupDataCheckBox" Type="CheckBox" X="20" Y="100" Height="15" Property="CLEANUP_DATA" Width="15" CheckBoxValue="0"/>
<Control Id="RemoveDataText" Type="Text" X="37" Y="101" Width="300" Height="200" TabSkip="no">
<Text>Remove default database directory '[DATABASELOCATION]'</Text>
</Control>
<!-- Navigation buttons-->
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="&amp;Back">
<Publish Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
</Control>
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="&amp;Next">
<Publish Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
</Control>
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Cancel">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
<Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="WixUI_Bmp_Banner" />
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes">
<Text>Remove default [ProductName] database</Text>
</Control>
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes">
<Text>{\WixUI_Font_Title}Default instance properties</Text>
</Control>
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
</Dialog>
</UI>
<UI Id="MyWixUI_Mondo">
<UIRef Id="WixUI_FeatureTree" />
<UIRef Id="WixUI_ErrorProgressText" />
<DialogRef Id="DatabaseCreationDlg" />
<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="DatabaseCreationDlg" Order="999"><![CDATA[&DBInstance=3 AND NOT !DBInstance=3]]></Publish>
<Publish Dialog="DatabaseCreationDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="3">1</Publish>
<Publish Dialog="DatabaseCreationDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="3">1</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="DatabaseCreationDlg" Order="3" ><![CDATA[&DBInstance=3 AND NOT !DBInstance=3]]></Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="ConfirmDataCleanupDlg" Order="3" ><![CDATA[(&DBInstance=2) AND (!DBInstance=3)]]></Publish>
<Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="ConfirmDataCleanupDlg" Order="999"><![CDATA[(&DBInstance=2) AND (!DBInstance=3)]]></Publish>
<Publish Dialog="ConfirmDataCleanupDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg">WixUI_InstallMode = "Change"</Publish>
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="ConfirmDataCleanupDlg" Order="999">!DBInstance=3</Publish>
<Publish Dialog="ConfirmDataCleanupDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg">WixUI_InstallMode = "Remove"</Publish>
</UI>
<DirectoryRef Id='TARGETDIR'>
<Directory Id="CommonAppDataFolder">
<Directory Id="DatabasesRoot" Name="MariaDB">
<Directory Id="DATABASELOCATION" Name="MariaDB Server 5.1">
</Directory>
</Directory>
</Directory>
</DirectoryRef>
<Feature Id='DBInstance'
Title='Database instance'
Description='Install database instance'
ConfigurableDirectory='DATABASELOCATION'
AllowAdvertise='no'
Level='1'>
<Component Id="C.datadir" Guid="*" Directory="DATABASELOCATION">
<RegistryValue Root='HKLM'
Key='SOFTWARE\[Manufacturer]\[ProductName]'
Name='DatabaseLocation' Value='[DATABASELOCATION]' Type='string' KeyPath='yes'/>
<CreateFolder />
</Component>
<Component Id="C.service" Guid="*" Directory="DATABASELOCATION">
<Condition>SERVICENAME</Condition>
<RegistryValue Root='HKLM'
Key='SOFTWARE\[Manufacturer]\[ProductName]'
Name='ServiceName' Value='[SERVICENAME]' Type='string' KeyPath='yes'/>
<ServiceControl Id='DBInstanceServiceStop' Name='[SERVICENAME]' Stop='uninstall' Wait='yes'></ServiceControl>
<ServiceControl Id='DBInstanceServiceStart' Name='[SERVICENAME]' Start='install' Wait='no'></ServiceControl>
<ServiceControl Id='DBInstanceServiceRemove' Name='[SERVICENAME]' Remove='uninstall' Wait='yes'></ServiceControl>
</Component>
</Feature>
<CustomAction Id="QtExecDeferredExampleWithProperty_Cmd" Property="QtExecDeferredExampleWithProperty"
Value="&quot;[#F.bin.mysql_install_db.exe]&quot; &quot;--service=[SERVICENAME]&quot; &quot;--password=[ROOT_PASSWORD]&quot; &quot;--datadir=[DATABASELOCATION]&quot;"
Execute="immediate"/>
<CustomAction Id="QtExecDeferredExampleWithProperty" BinaryKey="WixCA" DllEntry="CAQuietExec"
Execute="deferred" Return="check" Impersonate="no"/>
<UI>
<ProgressText Action="QtExecDeferredExampleWithProperty">Running mysql_install_db.exe</ProgressText>
</UI>
<!-- Use Wix toolset "remember property" pattern to store properties between major upgrades etc -->
<InstallExecuteSequence>
<Custom Action="QtExecDeferredExampleWithProperty_Cmd" After="CostFinalize"><![CDATA[&DBInstance=3 AND NOT !DBInstance=3]]></Custom>
<Custom Action="QtExecDeferredExampleWithProperty" After="InstallFiles"><![CDATA[&DBInstance=3 AND NOT !DBInstance=3]]></Custom>
</InstallExecuteSequence>
<Property Id='SERVICENAME'>
<RegistrySearch Id='ServiceNameProperty' Root='HKLM'
Key='SOFTWARE\[Manufacturer]\[ProductName]'
Name='ServiceName' Type='raw' />
</Property>
<SetProperty After='AppSearch' Id="SERVICENAME" Value="MariaDB_51"><![CDATA[NOT SERVICENAME]]></SetProperty>
<Property Id="DATABASELOCATION">
<RegistrySearch Id='DatabaseLocationProperty' Root='HKLM'
Key='SOFTWARE\[Manufacturer]\[ProductName]'
Name='´DatabaseLocation' Type='raw' />
</Property>
<SetProperty After='AppSearch' Id="DATABASELOCATION" Value="[CommonAppDataFolder]\MariaDB\[ProductName]"><![CDATA[NOT DATABASELOCATION]]></SetProperty>
<CustomAction Id='SaveCmdLineValue_SERVICENAME' Property='CMDLINE_SERVICENAME'
Value='[SERVICENAME]' Execute='firstSequence' />
<CustomAction Id='SetFromCmdLineValue_SERVICENAME' Property='SERVICENAME' Value='[CMDLINE_SERVICENAME]' Execute='firstSequence' />
<CustomAction Id='SaveCmdLineValue_DATABASELOCATION' Property='CMDLINE_DATABASELOCATION'
Value='[DATABASELOCATION]' Execute='firstSequence' />
<CustomAction Id='SetFromCmdLineValue_DATABASELOCATION' Property='DATABASELOCATION' Value='[CMDLINE_DATABASELOCATION]' Execute='firstSequence' />
<InstallUISequence>
<Custom Action='SaveCmdLineValue_SERVICENAME' Before='AppSearch' />
<Custom Action='SetFromCmdLineValue_SERVICENAME' After='AppSearch'>CMDLINE_SERVICENAME</Custom>
<Custom Action='SaveCmdLineValue_DATABASELOCATION' Before='AppSearch' />
<Custom Action='SetFromCmdLineValue_DATABASELOCATION' After='AppSearch'>CMDLINE_DATABASELOCATION</Custom>
</InstallUISequence>
<InstallExecuteSequence>
<Custom Action='SaveCmdLineValue_SERVICENAME' Before='AppSearch' />
<Custom Action='SetFromCmdLineValue_SERVICENAME' After='AppSearch'>CMDLINE_SERVICENAME</Custom>
<Custom Action='SaveCmdLineValue_DATABASELOCATION' Before='AppSearch' />
<Custom Action='SetFromCmdLineValue_DATABASELOCATION' After='AppSearch'>CMDLINE_DATABASELOCATION</Custom>
</InstallExecuteSequence>
</Fragment>
</Wix>

View File

@ -666,7 +666,7 @@
<CustomAction Id="CreateDatabaseRollbackCommand" Property="CreateDatabaseRollback" <CustomAction Id="CreateDatabaseRollbackCommand" Property="CreateDatabaseRollback"
Value="[SERVICENAME]\[DATADIR]" Value="[SERVICENAME]\[DATADIR]"
Execute="immediate"/> Execute="immediate"/>
<CustomAction Id="CreateDatabase" BinaryKey="WixCA" DllEntry="CAQuietExec" <CustomAction Id="CreateDatabase" BinaryKey="WixCA" DllEntry="@CA_QUIET_EXEC@"
Execute="deferred" Return="check" Impersonate="no" /> Execute="deferred" Return="check" Impersonate="no" />
<CustomAction Id="CreateDatabaseRollback" BinaryKey="wixca.dll" DllEntry="CreateDatabaseRollback" <CustomAction Id="CreateDatabaseRollback" BinaryKey="wixca.dll" DllEntry="CreateDatabaseRollback"
Execute="rollback" Return="check" Impersonate="no"/> Execute="rollback" Return="check" Impersonate="no"/>