Merge 10.2 into 10.3
This commit is contained in:
commit
e9aaa10c11
@ -104,6 +104,7 @@ ELSEIF(DEB)
|
||||
SET(HAVE_EMBEDDED_PRIVILEGE_CONTROL ON)
|
||||
ELSE()
|
||||
SET(WITH_SSL bundled CACHE STRING "")
|
||||
SET(WITH_PCRE bundled CACHE STRING "")
|
||||
SET(WITH_ZLIB bundled CACHE STRING "")
|
||||
SET(WITH_JEMALLOC static CACHE STRING "")
|
||||
ENDIF()
|
||||
@ -138,7 +139,7 @@ IF(UNIX)
|
||||
RedHat/Fedora/Oracle Linux: yum 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()
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
|
||||
SET(CPACK_SOURCE_IGNORE_FILES
|
||||
\\\\.git/
|
||||
\\\\.git$
|
||||
\\\\.gitignore$
|
||||
\\\\.gitattributes$
|
||||
CMakeCache\\\\.txt$
|
||||
|
@ -19,11 +19,11 @@ IF(GIT_EXECUTABLE AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
|
||||
SET(update_result 0)
|
||||
ELSEIF (cmake_update_submodules MATCHES force)
|
||||
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}"
|
||||
RESULT_VARIABLE update_result)
|
||||
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}"
|
||||
RESULT_VARIABLE update_result)
|
||||
ELSE()
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit cdfecebc9932a0dd5516c10505bfe78d79132e7d
|
||||
Subproject commit ce74fd0c4009ed9f4bcbdb4a01e96c823e961dc3
|
@ -37,8 +37,20 @@ use My::Platform;
|
||||
use POSIX qw[ _exit ];
|
||||
use IO::Handle qw[ flush ];
|
||||
use mtr_results;
|
||||
|
||||
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
|
||||
retry-pass green
|
||||
@ -47,20 +59,39 @@ my %color_map = qw/pass green
|
||||
disabled bright_black
|
||||
skipped yellow
|
||||
reset reset/;
|
||||
sub xterm_color {
|
||||
if (-t STDOUT and defined $ENV{TERM} and $ENV{TERM} =~ /xterm/) {
|
||||
syswrite STDOUT, color($color_map{$_[0]});
|
||||
|
||||
my $set_titlebar;
|
||||
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;
|
||||
our $timediff= 0;
|
||||
our $name;
|
||||
our $verbose;
|
||||
our $verbose_restart= 0;
|
||||
our $timer= 1;
|
||||
sub time_format($) {
|
||||
sprintf '%d:%02d:%02d', $_[0]/3600, ($_[0]/60)%60, $_[0]%60;
|
||||
}
|
||||
|
||||
$tests_done++;
|
||||
$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 {
|
||||
my ($opt, $value)= @_;
|
||||
@ -321,8 +352,6 @@ sub mtr_report_stats ($$$$) {
|
||||
|
||||
if ( $timer )
|
||||
{
|
||||
use English;
|
||||
|
||||
mtr_report("Spent", sprintf("%.3f", $tot_real_time),"of",
|
||||
time - $BASETIME, "seconds executing testcases");
|
||||
}
|
||||
@ -620,10 +649,11 @@ sub mtr_report (@) {
|
||||
my @s = split /\[ (\S+) \]/, _name() . "@_\n";
|
||||
if (@s > 1) {
|
||||
print $s[0];
|
||||
xterm_color($s[1]);
|
||||
&$set_color($s[1]);
|
||||
print "[ $s[1] ]";
|
||||
xterm_color('reset');
|
||||
&$set_color('reset');
|
||||
print $s[2];
|
||||
titlebar_stat($s[1]) if $set_titlebar;
|
||||
} else {
|
||||
print $s[0];
|
||||
}
|
||||
|
@ -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)
|
||||
) COMMENT='abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcd';
|
||||
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)
|
||||
SELECT column_comment,char_length(column_comment) FROM information_schema.columns WHERE table_name='t1';
|
||||
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;
|
||||
|
@ -1,6 +1,3 @@
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
#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)
|
||||
) COMMENT='abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcd';
|
||||
@ -53,3 +50,11 @@ create table t1 (c1 VARCHAR(10) NOT NULL COMMENT 'c1 comment', c2 INTEGER,c3 INT
|
||||
) COMMENT='abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcde';
|
||||
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';
|
||||
|
||||
#
|
||||
# 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;
|
||||
|
@ -233,3 +233,24 @@ i
|
||||
UNLOCK TABLES;
|
||||
DROP TABLE t1;
|
||||
# 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
|
||||
|
@ -1,6 +1,7 @@
|
||||
#
|
||||
# Test of repair table
|
||||
#
|
||||
--source include/have_sequence.inc
|
||||
--source include/default_charset.inc
|
||||
|
||||
call mtr.add_suppression("character set is multi-byte");
|
||||
@ -246,3 +247,23 @@ UNLOCK TABLES;
|
||||
DROP TABLE t1;
|
||||
|
||||
--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
|
||||
|
@ -374,32 +374,6 @@ my $opt_stop_keep_alive= $ENV{MTR_STOP_KEEP_ALIVE};
|
||||
select(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();
|
||||
|
||||
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" ) {
|
||||
# Try to find a suitable value for number of workers
|
||||
if (IS_WINDOWS)
|
||||
@ -1078,8 +1052,6 @@ sub run_test_server ($$$) {
|
||||
delete $next->{reserved};
|
||||
}
|
||||
|
||||
titlebar_stat(scalar(@$tests)) if $set_titlebar;
|
||||
|
||||
if ($next) {
|
||||
# We don't need this any more
|
||||
delete $next->{criteria};
|
||||
@ -6684,23 +6656,3 @@ sub list_options ($) {
|
||||
|
||||
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);
|
||||
}
|
||||
|
@ -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 res;
|
||||
DBUG_ASSERT(map->bitmap && bitmap_bit < map->n_bits);
|
||||
DBUG_ASSERT(map->bitmap);
|
||||
DBUG_ASSERT(bitmap_bit < map->n_bits);
|
||||
bitmap_lock(map);
|
||||
res= bitmap_fast_test_and_set(map, bitmap_bit);
|
||||
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 res;
|
||||
DBUG_ASSERT(map->bitmap && bitmap_bit < map->n_bits);
|
||||
DBUG_ASSERT(map->bitmap);
|
||||
DBUG_ASSERT(bitmap_bit < map->n_bits);
|
||||
bitmap_lock(map);
|
||||
res= bitmap_fast_test_and_clear(map, bitmap_bit);
|
||||
bitmap_unlock(map);
|
||||
@ -320,8 +322,8 @@ void bitmap_set_prefix(MY_BITMAP *map, uint prefix_size)
|
||||
uint prefix_bytes, prefix_bits, d;
|
||||
uchar *m= (uchar *)map->bitmap;
|
||||
|
||||
DBUG_ASSERT(map->bitmap &&
|
||||
(prefix_size <= map->n_bits || prefix_size == (uint) ~0));
|
||||
DBUG_ASSERT(map->bitmap);
|
||||
DBUG_ASSERT(prefix_size <= map->n_bits || prefix_size == (uint) ~0);
|
||||
set_if_smaller(prefix_size, map->n_bits);
|
||||
if ((prefix_bytes= prefix_size / 8))
|
||||
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 *end_prefix= m+(prefix_size-1)/8;
|
||||
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 */
|
||||
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;
|
||||
|
||||
DBUG_ASSERT(map1->bitmap && map2->bitmap &&
|
||||
map1->n_bits==map2->n_bits);
|
||||
DBUG_ASSERT(map1->bitmap && map2->bitmap);
|
||||
DBUG_ASSERT(map1->n_bits==map2->n_bits);
|
||||
|
||||
end= map1->last_word_ptr;
|
||||
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;
|
||||
|
||||
DBUG_ASSERT(map1->bitmap && map2->bitmap &&
|
||||
map1->n_bits==map2->n_bits);
|
||||
DBUG_ASSERT(map1->bitmap);
|
||||
DBUG_ASSERT(map2->bitmap);
|
||||
DBUG_ASSERT(map1->n_bits==map2->n_bits);
|
||||
|
||||
end= map1->last_word_ptr;
|
||||
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;
|
||||
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);
|
||||
while (to < end)
|
||||
@ -479,7 +484,8 @@ my_bool bitmap_exists_intersection(const MY_BITMAP **bitmap_array,
|
||||
uint i, j, start_idx, end_idx;
|
||||
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++)
|
||||
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;
|
||||
|
||||
DBUG_ASSERT(map1->bitmap && map2->bitmap &&
|
||||
map1->n_bits==map2->n_bits);
|
||||
DBUG_ASSERT(map1->bitmap);
|
||||
DBUG_ASSERT(map2->bitmap);
|
||||
DBUG_ASSERT(map1->n_bits==map2->n_bits);
|
||||
end= map1->last_word_ptr;
|
||||
while ( m1 < end)
|
||||
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)
|
||||
{
|
||||
my_bitmap_map *to= map->bitmap, *from= map2->bitmap, *end;
|
||||
DBUG_ASSERT(map->bitmap && map2->bitmap &&
|
||||
map->n_bits==map2->n_bits);
|
||||
DBUG_ASSERT(map->bitmap);
|
||||
DBUG_ASSERT(map2->bitmap);
|
||||
DBUG_ASSERT(map->n_bits==map2->n_bits);
|
||||
|
||||
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;
|
||||
|
||||
DBUG_ASSERT(map->bitmap && map2->bitmap &&
|
||||
map->n_bits==map2->n_bits);
|
||||
DBUG_ASSERT(map->bitmap);
|
||||
DBUG_ASSERT(map2->bitmap);
|
||||
DBUG_ASSERT(map->n_bits == map2->n_bits);
|
||||
end= map->last_word_ptr;
|
||||
|
||||
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)
|
||||
{
|
||||
my_bitmap_map *to= map->bitmap, *from= map2->bitmap, *end= map->last_word_ptr;
|
||||
DBUG_ASSERT(map->bitmap && map2->bitmap &&
|
||||
map->n_bits==map2->n_bits);
|
||||
DBUG_ASSERT(map->bitmap);
|
||||
DBUG_ASSERT(map2->bitmap);
|
||||
DBUG_ASSERT(map->n_bits == map2->n_bits);
|
||||
while (to <= end)
|
||||
*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;
|
||||
|
||||
DBUG_ASSERT(map->bitmap && map2->bitmap &&
|
||||
map->n_bits==map2->n_bits);
|
||||
DBUG_ASSERT(map->bitmap);
|
||||
DBUG_ASSERT(map2->bitmap);
|
||||
DBUG_ASSERT(map->n_bits == map2->n_bits);
|
||||
end= map->last_word_ptr;
|
||||
|
||||
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)
|
||||
{
|
||||
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_unlock(map);
|
||||
}
|
||||
|
@ -2240,7 +2240,8 @@ void ha_partition::update_create_info(HA_CREATE_INFO *create_info)
|
||||
sub_elem= subpart_it++;
|
||||
DBUG_ASSERT(sub_elem);
|
||||
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;
|
||||
m_file[part]->update_create_info(&dummy_info);
|
||||
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;
|
||||
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)
|
||||
used_partitions= &m_locked_partitions;
|
||||
@ -4184,8 +4186,8 @@ void ha_partition::unlock_row()
|
||||
bool ha_partition::was_semi_consistent_read()
|
||||
{
|
||||
DBUG_ENTER("ha_partition::was_semi_consistent_read");
|
||||
DBUG_ASSERT(m_last_part < m_tot_parts &&
|
||||
bitmap_is_set(&(m_part_info->read_partitions), m_last_part));
|
||||
DBUG_ASSERT(m_last_part < m_tot_parts);
|
||||
DBUG_ASSERT(bitmap_is_set(&(m_part_info->read_partitions), m_last_part));
|
||||
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);
|
||||
m_ordered_scan_ongoing= m_ordered;
|
||||
}
|
||||
DBUG_ASSERT(m_part_spec.start_part < m_tot_parts &&
|
||||
m_part_spec.end_part < m_tot_parts);
|
||||
DBUG_ASSERT(m_part_spec.start_part < m_tot_parts);
|
||||
DBUG_ASSERT(m_part_spec.end_part < m_tot_parts);
|
||||
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 "
|
||||
"first_value: %lu", (ulong) offset, (ulong) increment,
|
||||
(ulong) nb_desired_values, (ulong) *first_value));
|
||||
DBUG_ASSERT(increment && nb_desired_values);
|
||||
DBUG_ASSERT(increment);
|
||||
DBUG_ASSERT(nb_desired_values);
|
||||
*first_value= 0;
|
||||
if (table->s->next_number_keypart)
|
||||
{
|
||||
|
@ -351,7 +351,6 @@ static bool volatile select_thread_in_use, signal_thread_in_use;
|
||||
static volatile bool ready_to_exit;
|
||||
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;
|
||||
bool my_disable_leak_check= false;
|
||||
|
||||
uint kill_cached_threads;
|
||||
static uint wake_thread;
|
||||
|
@ -667,6 +667,7 @@ public:
|
||||
bool statement_should_be_aborted() const
|
||||
{
|
||||
return
|
||||
thd->killed ||
|
||||
thd->is_fatal_error ||
|
||||
thd->is_error() ||
|
||||
alloced_sel_args > SEL_ARG::MAX_SEL_ARGS;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
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
|
||||
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
|
||||
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;
|
||||
::strmake((char*) killed_err->msg, killed_err_msg_arg,
|
||||
|
@ -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();
|
||||
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())
|
||||
{
|
||||
my_error(err_code, MYF(0), name, static_cast<ulong>(max_len));
|
||||
|
3
storage/mroonga/vendor/groonga/lib/db.c
vendored
3
storage/mroonga/vendor/groonga/lib/db.c
vendored
@ -445,6 +445,9 @@ grn_db_close(grn_ctx *ctx, grn_obj *db)
|
||||
|
||||
ctx_used_db = ctx->impl && ctx->impl->db == db;
|
||||
if (ctx_used_db) {
|
||||
#ifdef GRN_WITH_MECAB
|
||||
grn_db_fin_mecab_tokenizer(ctx);
|
||||
#endif
|
||||
grn_ctx_loader_clear(ctx);
|
||||
if (ctx->impl->parser) {
|
||||
grn_expr_parser_close(ctx);
|
||||
|
@ -30,6 +30,7 @@ grn_rc grn_tokenizers_init(void);
|
||||
grn_rc grn_tokenizers_fin(void);
|
||||
|
||||
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);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
30
storage/mroonga/vendor/groonga/lib/tokenizers.c
vendored
30
storage/mroonga/vendor/groonga/lib/tokenizers.c
vendored
@ -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)\
|
||||
(grn_proc_create(ctx, (name), (sizeof(name) - 1),\
|
||||
GRN_PROC_TOKENIZER, (init), (next), (fin), 3, (vars)))
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
static unsigned int sole_mecab_init_counter = 0;
|
||||
static mecab_t *sole_mecab = NULL;
|
||||
static grn_plugin_mutex *sole_mecab_mutex = NULL;
|
||||
static grn_encoding sole_mecab_encoding = GRN_ENC_NONE;
|
||||
@ -563,6 +564,11 @@ check_mecab_dictionary_encoding(grn_ctx *ctx)
|
||||
grn_rc
|
||||
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];
|
||||
|
||||
@ -636,6 +642,11 @@ GRN_PLUGIN_REGISTER(grn_ctx *ctx)
|
||||
grn_rc
|
||||
GRN_PLUGIN_FIN(grn_ctx *ctx)
|
||||
{
|
||||
--sole_mecab_init_counter;
|
||||
if (sole_mecab_init_counter > 0)
|
||||
{
|
||||
return GRN_SUCCESS;
|
||||
}
|
||||
if (sole_mecab) {
|
||||
mecab_destroy(sole_mecab);
|
||||
sole_mecab = NULL;
|
||||
|
@ -1583,6 +1583,8 @@ int mi_repair(HA_CHECK *param, register MI_INFO *info,
|
||||
sort_param.filepos=new_header_length;
|
||||
param->read_cache.end_of_file=sort_info.filelength=
|
||||
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_param.fix_datafile= (my_bool) (! rep_quick);
|
||||
sort_param.master=1;
|
||||
@ -2288,6 +2290,8 @@ int mi_repair_by_sort(HA_CHECK *param, register MI_INFO *info,
|
||||
sort_info.buff=0;
|
||||
param->read_cache.end_of_file=sort_info.filelength=
|
||||
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;
|
||||
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;
|
||||
param->read_cache.end_of_file=sort_info.filelength=
|
||||
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)
|
||||
rec_length=MY_MAX(share->base.min_pack_length+1,share->base.min_block_length);
|
||||
|
@ -67,7 +67,7 @@ if(SNAPPY_FOUND AND (NOT WITH_ROCKSDB_snappy STREQUAL "OFF"))
|
||||
endif()
|
||||
|
||||
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)
|
||||
CHECK_FUNCTION_EXISTS(ZDICT_trainFromBuffer ZSTD_VALID)
|
||||
UNSET(CMAKE_REQUIRED_LIBRARIES)
|
||||
|
@ -114,7 +114,6 @@ int thd_binlog_format(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;
|
||||
|
||||
// Needed in rocksdb_init_func
|
||||
@ -5716,13 +5715,6 @@ static int rocksdb_init_func(void *const p) {
|
||||
}
|
||||
#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,
|
||||
HA_ERR_ROCKSDB_LAST);
|
||||
if (err != 0) {
|
||||
|
@ -20,6 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
|
||||
#undef NOMINMAX
|
||||
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#include <windows.h>
|
||||
#include <winreg.h>
|
||||
#include <msi.h>
|
||||
@ -33,6 +34,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
|
||||
#include <stdlib.h>
|
||||
#include <winservice.h>
|
||||
|
||||
|
||||
#define ONE_MB 1048576
|
||||
UINT ExecRemoveDataDirectory(wchar_t *dir)
|
||||
{
|
||||
@ -256,36 +258,89 @@ bool ExecRemoveService(const wchar_t *name)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
Check if port is free by trying to bind to the port
|
||||
*/
|
||||
bool IsPortFree(short port)
|
||||
/* Find whether TCP port is in use by trying to bind to the port. */
|
||||
static bool IsPortInUse(unsigned short port)
|
||||
{
|
||||
WORD wVersionRequested;
|
||||
WSADATA wsaData;
|
||||
struct addrinfo* ai, * a;
|
||||
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);
|
||||
|
||||
struct sockaddr_in sin;
|
||||
SOCKET sock;
|
||||
sock = socket(AF_INET, SOCK_STREAM, 0);
|
||||
if(sock == INVALID_SOCKET)
|
||||
if (getaddrinfo(NULL, port_buf, &hints, &ai))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
sin.sin_port = htons(port);
|
||||
sin.sin_addr.s_addr = 0;
|
||||
sin.sin_addr.s_addr = INADDR_ANY;
|
||||
sin.sin_family = AF_INET;
|
||||
if(bind(sock, (struct sockaddr *)&sin,sizeof(struct sockaddr_in) ) == -1)
|
||||
|
||||
/*
|
||||
Prefer IPv6 socket to IPv4, since we'll use IPv6 dual socket,
|
||||
which coveres both IP versions.
|
||||
*/
|
||||
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;
|
||||
}
|
||||
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();
|
||||
return true;
|
||||
return !in_use;
|
||||
}
|
||||
|
||||
|
||||
@ -641,7 +696,7 @@ extern "C" UINT __stdcall CheckDatabaseProperties (MSIHANDLE hInstall)
|
||||
goto LExit;
|
||||
}
|
||||
|
||||
short port = (short)_wtoi(Port);
|
||||
unsigned short port = (unsigned short)_wtoi(Port);
|
||||
if (!IsPortFree(port))
|
||||
{
|
||||
ErrorMsg =
|
||||
|
@ -34,10 +34,12 @@ IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
SET(Win64 " Win64='yes'")
|
||||
SET(Platform x64)
|
||||
SET(PlatformProgramFilesFolder ProgramFiles64Folder)
|
||||
SET(CA_QUIET_EXEC CAQuietExec64)
|
||||
ELSE()
|
||||
SET(CANDLE_ARCH -arch x86)
|
||||
SET(Platform x86)
|
||||
SET(PlatformProgramFilesFolder ProgramFilesFolder)
|
||||
SET(CA_QUIET_EXEC CAQuietExec)
|
||||
SET(Win64)
|
||||
ENDIF()
|
||||
|
||||
|
@ -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="&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="&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="&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="&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="&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="&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=""[#F.bin.mysql_install_db.exe]" "--service=[SERVICENAME]" "--password=[ROOT_PASSWORD]" "--datadir=[DATABASELOCATION]""
|
||||
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>
|
@ -666,7 +666,7 @@
|
||||
<CustomAction Id="CreateDatabaseRollbackCommand" Property="CreateDatabaseRollback"
|
||||
Value="[SERVICENAME]\[DATADIR]"
|
||||
Execute="immediate"/>
|
||||
<CustomAction Id="CreateDatabase" BinaryKey="WixCA" DllEntry="CAQuietExec"
|
||||
<CustomAction Id="CreateDatabase" BinaryKey="WixCA" DllEntry="@CA_QUIET_EXEC@"
|
||||
Execute="deferred" Return="check" Impersonate="no" />
|
||||
<CustomAction Id="CreateDatabaseRollback" BinaryKey="wixca.dll" DllEntry="CreateDatabaseRollback"
|
||||
Execute="rollback" Return="check" Impersonate="no"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user