Merge 10.4 into 10.5

This commit is contained in:
Marko Mäkelä 2020-05-31 10:28:59 +03:00
commit 4a0b56f604
141 changed files with 3170 additions and 952 deletions

View File

@ -108,6 +108,7 @@ ELSEIF(DEB)
SET(WITH_PCRE system CACHE STRING "")
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 "")
SET(PLUGIN_AUTH_SOCKET STATIC CACHE STRING "")
@ -145,7 +146,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()

View File

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

View File

@ -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 --recursive
EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update --init --force --recursive --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 --recursive
EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update --init --recursive --depth=1
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE update_result)
ELSE()

View File

@ -788,6 +788,7 @@ static ha_checksum checksum_format_specifier(const char* msg)
case 'x':
case 's':
case 'M':
case 'T':
start= 0; /* Not in format specifier anymore */
break;
}

View File

@ -21,26 +21,28 @@
#include <cstddef>
#include <iterator>
namespace intrusive
{
// Derive your class from this struct to insert to a linked list.
template <class Tag= void> struct list_node
template <class Tag= void> struct ilist_node
{
list_node(list_node *next= NULL, list_node *prev= NULL)
: next(next), prev(prev)
ilist_node()
#ifndef DBUG_OFF
:
next(NULL), prev(NULL)
#endif
{
}
list_node *next;
list_node *prev;
ilist_node(ilist_node *next, ilist_node *prev) : next(next), prev(prev) {}
ilist_node *next;
ilist_node *prev;
};
// Modelled after std::list<T>
template <class T, class Tag= void> class list
template <class T, class Tag= void> class ilist
{
public:
typedef list_node<Tag> ListNode;
typedef ilist_node<Tag> ListNode;
class Iterator;
// All containers in C++ should define these types to implement generic
@ -103,10 +105,10 @@ public:
private:
ListNode *node_;
friend class list;
friend class ilist;
};
list() : sentinel_(&sentinel_, &sentinel_), size_(0) {}
ilist() : sentinel_(&sentinel_, &sentinel_) {}
reference front() { return *begin(); }
reference back() { return *--end(); }
@ -129,14 +131,18 @@ public:
reverse_iterator rend() { return reverse_iterator(begin()); }
const_reverse_iterator rend() const { return reverse_iterator(begin()); }
bool empty() const { return size_ == 0; }
size_type size() const { return size_; }
bool empty() const { return sentinel_.next == &sentinel_; }
// Not implemented because it's O(N)
// size_type size() const
// {
// return static_cast<size_type>(std::distance(begin(), end()));
// }
void clear()
{
sentinel_.next= &sentinel_;
sentinel_.prev= &sentinel_;
size_= 0;
}
iterator insert(iterator pos, reference value)
@ -150,7 +156,6 @@ public:
static_cast<ListNode &>(value).prev= prev;
static_cast<ListNode &>(value).next= curr;
++size_;
return iterator(&value);
}
@ -162,13 +167,12 @@ public:
prev->next= next;
next->prev= prev;
// This is not required for list functioning. But maybe it'll prevent bugs
// and ease debugging.
#ifndef DBUG_OFF
ListNode *curr= pos.node_;
curr->prev= NULL;
curr->next= NULL;
#endif
--size_;
return next;
}
@ -179,12 +183,63 @@ public:
void pop_front() { erase(begin()); }
// STL version is O(n) but this is O(1) because an element can't be inserted
// several times in the same intrusive list.
// several times in the same ilist.
void remove(reference value) { erase(iterator(&value)); }
private:
ListNode sentinel_;
size_type size_;
};
} // namespace intrusive
// Similar to ilist but also has O(1) size() method.
template <class T, class Tag= void> class sized_ilist : public ilist<T, Tag>
{
typedef ilist<T, Tag> BASE;
public:
// All containers in C++ should define these types to implement generic
// container interface.
typedef T value_type;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
typedef value_type &reference;
typedef const value_type &const_reference;
typedef T *pointer;
typedef const T *const_pointer;
typedef typename BASE::Iterator iterator;
typedef const typename BASE::Iterator const_iterator;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const iterator> const_reverse_iterator;
sized_ilist() : size_(0) {}
size_type size() const { return size_; }
void clear()
{
BASE::clear();
size_= 0;
}
iterator insert(iterator pos, reference value)
{
++size_;
return BASE::insert(pos, value);
}
iterator erase(iterator pos)
{
--size_;
return BASE::erase(pos);
}
void push_back(reference value) { insert(BASE::end(), value); }
void pop_back() { erase(BASE::end()); }
void push_front(reference value) { insert(BASE::begin(), value); }
void pop_front() { erase(BASE::begin()); }
void remove(reference value) { erase(iterator(&value)); }
private:
size_type size_;
};

View File

@ -55,7 +55,8 @@
Supported formats are 's' (null pointer is accepted, printed as
"(null)"), 'b' (extension, see below), 'c', 'd', 'i', 'u', 'x', 'o',
'X', 'p' (works as 0x%x), 'f', 'g', 'M' (extension, see below).
'X', 'p' (works as 0x%x), 'f', 'g', 'M' (extension, see below),
'T' (extension, see below).
Standard syntax for positional arguments $n is supported.
@ -69,6 +70,9 @@
Format 'M': takes one integer, prints this integer, space, double quote
error message, double quote. In other words
printf("%M", n) === printf("%d \"%s\"", n, strerror(n))
Format 'T': takes string and print it like s but if the strints should be
truncated puts "..." at the end.
*/
#ifdef __cplusplus

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

View File

@ -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];
}

View File

@ -2598,6 +2598,11 @@ alter table person_principal add column if not exists date_mask tinyint null;
update person_principal set date_mask = 0;
alter table person_principal modify column date_mask tinyint not null;
drop tables person_principal_hist, person_principal;
CREATE OR REPLACE TABLE `t1` ( `id` varchar(64) NOT NULL, `name` varchar(255) NOT NULL, `extra` text DEFAULT NULL, `password` varchar(128) DEFAULT NULL, `enabled` tinyint(1) DEFAULT NULL, `domain_id` varchar(64) NOT NULL, `default_project_id` varchar(64) DEFAULT NULL, PRIMARY KEY (`id`), CONSTRAINT `CONSTRAINT_1` CHECK (`enabled` in (0,1)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert into t1 (id,name,enabled,domain_id) values (1,"Monty",1,"domain_id");
insert into t1 (id,name,enabled,domain_id) values (2,"Monty2",1,"domain_id2");
ALTER TABLE t1 ADD CONSTRAINT ixu_user2_name_domain_id UNIQUE (domain_id, name);
DROP TABLE t1;
#
# End of 10.4 tests
#
@ -3306,3 +3311,6 @@ t2 CREATE TABLE `t2` (
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t2;
#
# End of 10.5 tests
#

View File

@ -2111,6 +2111,16 @@ update person_principal set date_mask = 0;
alter table person_principal modify column date_mask tinyint not null;
drop tables person_principal_hist, person_principal;
#
# The following ALTER TABLE caused crash in 10.4.13 (Reported on freenode)
#
CREATE OR REPLACE TABLE `t1` ( `id` varchar(64) NOT NULL, `name` varchar(255) NOT NULL, `extra` text DEFAULT NULL, `password` varchar(128) DEFAULT NULL, `enabled` tinyint(1) DEFAULT NULL, `domain_id` varchar(64) NOT NULL, `default_project_id` varchar(64) DEFAULT NULL, PRIMARY KEY (`id`), CONSTRAINT `CONSTRAINT_1` CHECK (`enabled` in (0,1)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
insert into t1 (id,name,enabled,domain_id) values (1,"Monty",1,"domain_id");
insert into t1 (id,name,enabled,domain_id) values (2,"Monty2",1,"domain_id2");
ALTER TABLE t1 ADD CONSTRAINT ixu_user2_name_domain_id UNIQUE (domain_id, name);
DROP TABLE t1;
--echo #
--echo # End of 10.4 tests
--echo #
@ -2506,3 +2516,7 @@ alter table if exists t9 rename t1;
alter table if exists t1 rename t2;
show create table t2;
drop table t2;
--echo #
--echo # End of 10.5 tests
--echo #

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)
) 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;

View File

@ -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;

View File

@ -1,7 +1,4 @@
set names binary;
#
# Start of 5.5 tests
#
SET TIME_ZONE = _latin1 '+03:00';
#
# Start of WL#2649 Number-to-string conversions
@ -2925,9 +2922,6 @@ SET sql_mode=default;
#
# End of 5.5 tests
#
#
# Start of 10.0 tests
#
SET NAMES binary;
#
# MDEV-7149 Constant condition propagation erroneously applied for LIKE
@ -3075,9 +3069,6 @@ SET optimizer_switch=@save_optimizer_switch;
# End of 10.0 tests
#
#
# Start of 10.1 tests
#
#
# MDEV-8695 Wrong result for SELECT..WHERE varchar_column='a' AND CRC32(varchar_column)=3904355907
#
CREATE TABLE t1 (a VARBINARY(10));
@ -3172,9 +3163,148 @@ Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 'a' and weight_string(`test`.`t1`.`a`,0,0,1) = 'a'
DROP TABLE t1;
#
# MDEV-22111 ERROR 1064 & 1033 and SIGSEGV on CREATE TABLE w/ various charsets on 10.4/5 optimized builds | Assertion `(uint) (table_check_constraints - share->check_constraints) == (uint) (share->table_check_constraints - share->field_check_constraints)' failed
#
CREATE TABLE t1(a ENUM(0x6100,0x6200,0x6300) CHARACTER SET 'Binary');
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` enum('a\0','b\0','c\0') CHARACTER SET binary DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (1),(2),(3);
SELECT HEX(a) FROM t1 ORDER BY a;
HEX(a)
6100
6200
6300
DROP TABLE t1;
0x00 in the middle or in the end of a value
CREATE TABLE t1 (a ENUM(0x6100));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` enum('a\0') DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (1);
SELECT HEX(a) FROM t1;
HEX(a)
6100
DROP TABLE t1;
CREATE TABLE t1 (a ENUM(0x610062));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` enum('a\0b') DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (1);
SELECT HEX(a) FROM t1;
HEX(a)
610062
DROP TABLE t1;
0x00 in the beginning of the first value:
CREATE TABLE t1 (a ENUM(0x0061));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` enum('\0a') DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES(1);
SELECT HEX(a) FROM t1;
HEX(a)
0061
DROP TABLE t1;
CREATE TABLE t1 (a ENUM(0x0061), b ENUM('b'));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` enum('\0a') DEFAULT NULL,
`b` enum('b') DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (1,1);
SELECT HEX(a), HEX(b) FROM t1;
HEX(a) HEX(b)
0061 62
DROP TABLE t1;
# 0x00 in the beginning of the second (and following) value of the *last* ENUM/SET in the table:
CREATE TABLE t1 (a ENUM('a',0x0061));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` enum('a','\0a') DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (1),(2);
SELECT HEX(a) FROM t1 ORDER BY a;
HEX(a)
61
0061
DROP TABLE t1;
CREATE TABLE t1 (a ENUM('a'), b ENUM('b',0x0061));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` enum('a') DEFAULT NULL,
`b` enum('b','\0a') DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (1,1);
INSERT INTO t1 VALUES (1,2);
SELECT HEX(a), HEX(b) FROM t1 ORDER BY a, b;
HEX(a) HEX(b)
61 62
61 0061
DROP TABLE t1;
0x00 in the beginning of a value of a non-last ENUM/SET causes an error:
CREATE TABLE t1 (a ENUM('a',0x0061), b ENUM('b'));
ERROR HY000: Incorrect information in file: 'DIR/t1.frm'
#
# End of 10.1 tests
#
#
# MDEV-22111 ERROR 1064 & 1033 and SIGSEGV on CREATE TABLE w/ various charsets on 10.4/5 optimized builds | Assertion `(uint) (table_check_constraints - share->check_constraints) == (uint) (share->table_check_constraints - share->field_check_constraints)' failed
# 10.2 tests
#
SET NAMES latin1;
CREATE TABLE t1(c ENUM(0x0061) CHARACTER SET 'Binary', d JSON);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c` enum('\0a') CHARACTER SET binary DEFAULT NULL,
`d` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`d`))
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (c) VALUES (1);
SELECT HEX(c) FROM t1;
HEX(c)
0061
DROP TABLE t1;
CREATE TABLE t1(
c ENUM(0x0061) CHARACTER SET 'Binary',
d INT DEFAULT NULL CHECK (d>0)
);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c` enum('\0a') CHARACTER SET binary DEFAULT NULL,
`d` int(11) DEFAULT NULL CHECK (`d` > 0)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (1,1);
SELECT HEX(c), d FROM t1;
HEX(c) d
0061 1
DROP TABLE t1;
CREATE TABLE t1(c ENUM(0x0061) CHARACTER SET 'Binary' CHECK (c>0));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c` enum('\0a') CHARACTER SET binary DEFAULT NULL CHECK (`c` > 0)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (1);
SELECT HEX(c) FROM t1;
HEX(c)
0061
DROP TABLE t1;
#
# End of 10.2 tests
#
#
# Start of 10.5 tests
#
#

View File

@ -1,10 +1,6 @@
set names binary;
--echo #
--echo # Start of 5.5 tests
--echo #
--source include/ctype_numconv.inc
--echo #
@ -12,10 +8,6 @@ set names binary;
--echo #
--echo #
--echo # Start of 10.0 tests
--echo #
SET NAMES binary;
--source include/ctype_like_cond_propagation.inc
@ -31,10 +23,6 @@ SET NAMES utf8, character_set_connection=binary;
--echo # End of 10.0 tests
--echo #
--echo #
--echo # Start of 10.1 tests
--echo #
--echo #
--echo # MDEV-8695 Wrong result for SELECT..WHERE varchar_column='a' AND CRC32(varchar_column)=3904355907
--echo #
@ -74,10 +62,101 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE COERCIBILITY(a)=2 AND a='a';
EXPLAIN EXTENDED SELECT * FROM t1 WHERE WEIGHT_STRING(a)='a' AND a='a';
DROP TABLE t1;
--echo #
--echo # MDEV-22111 ERROR 1064 & 1033 and SIGSEGV on CREATE TABLE w/ various charsets on 10.4/5 optimized builds | Assertion `(uint) (table_check_constraints - share->check_constraints) == (uint) (share->table_check_constraints - share->field_check_constraints)' failed
--echo #
CREATE TABLE t1(a ENUM(0x6100,0x6200,0x6300) CHARACTER SET 'Binary');
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES (1),(2),(3);
SELECT HEX(a) FROM t1 ORDER BY a;
DROP TABLE t1;
--echo 0x00 in the middle or in the end of a value
CREATE TABLE t1 (a ENUM(0x6100));
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES (1);
SELECT HEX(a) FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a ENUM(0x610062));
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES (1);
SELECT HEX(a) FROM t1;
DROP TABLE t1;
--echo 0x00 in the beginning of the first value:
CREATE TABLE t1 (a ENUM(0x0061));
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES(1);
SELECT HEX(a) FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a ENUM(0x0061), b ENUM('b'));
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES (1,1);
SELECT HEX(a), HEX(b) FROM t1;
DROP TABLE t1;
--echo # 0x00 in the beginning of the second (and following) value of the *last* ENUM/SET in the table:
CREATE TABLE t1 (a ENUM('a',0x0061));
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES (1),(2);
SELECT HEX(a) FROM t1 ORDER BY a;
DROP TABLE t1;
CREATE TABLE t1 (a ENUM('a'), b ENUM('b',0x0061));
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES (1,1);
INSERT INTO t1 VALUES (1,2);
SELECT HEX(a), HEX(b) FROM t1 ORDER BY a, b;
DROP TABLE t1;
--echo 0x00 in the beginning of a value of a non-last ENUM/SET causes an error:
--replace_regex /'.*t1.frm'/'DIR\/t1.frm'/
--error ER_NOT_FORM_FILE
CREATE TABLE t1 (a ENUM('a',0x0061), b ENUM('b'));
--echo #
--echo # End of 10.1 tests
--echo #
--echo #
--echo # MDEV-22111 ERROR 1064 & 1033 and SIGSEGV on CREATE TABLE w/ various charsets on 10.4/5 optimized builds | Assertion `(uint) (table_check_constraints - share->check_constraints) == (uint) (share->table_check_constraints - share->field_check_constraints)' failed
--echo # 10.2 tests
--echo #
SET NAMES latin1;
CREATE TABLE t1(c ENUM(0x0061) CHARACTER SET 'Binary', d JSON);
SHOW CREATE TABLE t1;
INSERT INTO t1 (c) VALUES (1);
SELECT HEX(c) FROM t1;
DROP TABLE t1;
CREATE TABLE t1(
c ENUM(0x0061) CHARACTER SET 'Binary',
d INT DEFAULT NULL CHECK (d>0)
);
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES (1,1);
SELECT HEX(c), d FROM t1;
DROP TABLE t1;
CREATE TABLE t1(c ENUM(0x0061) CHARACTER SET 'Binary' CHECK (c>0));
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES (1);
SELECT HEX(c) FROM t1;
DROP TABLE t1;
--echo #
--echo # End of 10.2 tests
--echo #
--echo #
--echo # Start of 10.5 tests
--echo #
@ -104,4 +183,3 @@ DROP TABLE t1;
--echo #
--echo # End of 10.5 tests
--echo #

View File

@ -7899,5 +7899,46 @@ a b
DROP TABLE t1;
SET NAMES utf8;
#
# MDEV-22111 ERROR 1064 & 1033 and SIGSEGV on CREATE TABLE w/ various charsets on 10.4/5 optimized builds | Assertion `(uint) (table_check_constraints - share->check_constraints) == (uint) (share->table_check_constraints - share->field_check_constraints)' failed
# 10.2 tests
#
SET NAMES utf8, COLLATION_CONNECTION=utf16_hungarian_ci;
CREATE TABLE t1(c ENUM('aaaaaaaa') CHARACTER SET 'Binary',d JSON);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c` enum('\0a\0a\0a\0a\0a\0a\0a\0a') CHARACTER SET binary DEFAULT NULL,
`d` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`d`))
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (c) VALUES (1);
SELECT HEX(c) FROM t1;
HEX(c)
00610061006100610061006100610061
DROP TABLE t1;
CREATE OR REPLACE TABLE t1(c ENUM('aaaaaaaaa') CHARACTER SET 'Binary',d JSON);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c` enum('\0a\0a\0a\0a\0a\0a\0a\0a\0a') CHARACTER SET binary DEFAULT NULL,
`d` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`d`))
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (c) VALUES (1);
SELECT HEX(c) FROM t1;
HEX(c)
006100610061006100610061006100610061
DROP TABLE t1;
CREATE OR REPLACE TABLE t1(c ENUM('aaaaaaaaaa') CHARACTER SET 'Binary',d JSON);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c` enum('\0a\0a\0a\0a\0a\0a\0a\0a\0a\0a') CHARACTER SET binary DEFAULT NULL,
`d` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`d`))
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (c) VALUES (1);
SELECT HEX(c) FROM t1;
HEX(c)
0061006100610061006100610061006100610061
DROP TABLE t1;
#
# End of 10.2 tests
#

View File

@ -243,6 +243,31 @@ SET NAMES utf8, collation_connection=utf16_unicode_520_nopad_ci;
SET NAMES utf8;
--echo #
--echo # MDEV-22111 ERROR 1064 & 1033 and SIGSEGV on CREATE TABLE w/ various charsets on 10.4/5 optimized builds | Assertion `(uint) (table_check_constraints - share->check_constraints) == (uint) (share->table_check_constraints - share->field_check_constraints)' failed
--echo # 10.2 tests
--echo #
SET NAMES utf8, COLLATION_CONNECTION=utf16_hungarian_ci;
CREATE TABLE t1(c ENUM('aaaaaaaa') CHARACTER SET 'Binary',d JSON); # ERROR 1064 (42000): You have an error in your SQL syntax
SHOW CREATE TABLE t1;
INSERT INTO t1 (c) VALUES (1);
SELECT HEX(c) FROM t1;
DROP TABLE t1;
CREATE OR REPLACE TABLE t1(c ENUM('aaaaaaaaa') CHARACTER SET 'Binary',d JSON); # ERROR 1033 (HY000): Incorrect information in file: './test/t.frm'
SHOW CREATE TABLE t1;
INSERT INTO t1 (c) VALUES (1);
SELECT HEX(c) FROM t1;
DROP TABLE t1;
CREATE OR REPLACE TABLE t1(c ENUM('aaaaaaaaaa') CHARACTER SET 'Binary',d JSON); # Sig 11
SHOW CREATE TABLE t1;
INSERT INTO t1 (c) VALUES (1);
SELECT HEX(c) FROM t1;
DROP TABLE t1;
--echo #
--echo # End of 10.2 tests
--echo #

View File

@ -2868,5 +2868,25 @@ DROP TABLE t1;
#
SET DEFAULT_STORAGE_ENGINE=Default;
#
# MDEV-22111 ERROR 1064 & 1033 and SIGSEGV on CREATE TABLE w/ various charsets on 10.4/5 optimized builds | Assertion `(uint) (table_check_constraints - share->check_constraints) == (uint) (share->table_check_constraints - share->field_check_constraints)' failed
# 10.2 tests
#
SET NAMES utf8, COLLATION_CONNECTION=utf32_bin;
CREATE TABLE t1(c1 ENUM('a','b','ac') CHARACTER SET 'Binary',c2 JSON,c3 INT);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` enum('\0\0\0a','\0\0\0b','\0\0\0a\0\0\0c') CHARACTER SET binary DEFAULT NULL,
`c2` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`c2`)),
`c3` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (c1) VALUES (1),(2),(3);
SELECT HEX(c1) FROM t1 ORDER BY c1;
HEX(c1)
00000061
00000062
0000006100000063
DROP TABLE t1;
#
# End of 10.2 tests
#

View File

@ -1035,6 +1035,19 @@ let $coll='utf32_nopad_bin';
let $coll_pad='utf32_bin';
--source include/ctype_pad_all_engines.inc
--echo #
--echo # MDEV-22111 ERROR 1064 & 1033 and SIGSEGV on CREATE TABLE w/ various charsets on 10.4/5 optimized builds | Assertion `(uint) (table_check_constraints - share->check_constraints) == (uint) (share->table_check_constraints - share->field_check_constraints)' failed
--echo # 10.2 tests
--echo #
SET NAMES utf8, COLLATION_CONNECTION=utf32_bin;
CREATE TABLE t1(c1 ENUM('a','b','ac') CHARACTER SET 'Binary',c2 JSON,c3 INT);
SHOW CREATE TABLE t1;
INSERT INTO t1 (c1) VALUES (1),(2),(3);
SELECT HEX(c1) FROM t1 ORDER BY c1;
DROP TABLE t1;
--echo #
--echo # End of 10.2 tests
--echo #

View File

@ -13,8 +13,8 @@ CREATE TABLE t1 (c01 INT, c02 CHAR(20), c03 TEXT, c04 DOUBLE);
Warnings:
Note 1105 build_frm_image: Field data type info length: 14
Note 1105 DBUG: [0] name='c01' type_info=''
Note 1105 DBUG: [1] name='c02' type_info='xc...'
Note 1105 DBUG: [2] name='c03' type_info='xb...'
Note 1105 DBUG: [1] name='c02' type_info='xchar'
Note 1105 DBUG: [2] name='c03' type_info='xblob'
Note 1105 DBUG: [3] name='c04' type_info=''
SET SESSION debug_dbug="-d,frm_data_type_info_emulate";
SET SESSION debug_dbug="-d,frm_data_type_info";

View File

@ -506,3 +506,17 @@ disconnect con1;
connection default;
UNLOCK TABLES;
DROP TABLE t1, t2;
#
# MDEV-21398 Deadlock (server hang) or assertion failure in
# Diagnostics_area::set_error_status upon ALTER under lock
#
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
LOCK TABLE t1 WRITE, t1 AS t1a READ;
ALTER TABLE t1 CHANGE COLUMN IF EXISTS x xx INT;
Warnings:
Note 1054 Unknown column 'x' in 't1'
UNLOCK TABLES;
DROP TABLE t1;
#
# End of 10.2 tests
#

View File

@ -619,3 +619,17 @@ UNLOCK TABLES;
UNLOCK TABLES;
DROP TABLE t1, t2;
--echo #
--echo # MDEV-21398 Deadlock (server hang) or assertion failure in
--echo # Diagnostics_area::set_error_status upon ALTER under lock
--echo #
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
LOCK TABLE t1 WRITE, t1 AS t1a READ;
ALTER TABLE t1 CHANGE COLUMN IF EXISTS x xx INT;
UNLOCK TABLES;
DROP TABLE t1;
--echo #
--echo # End of 10.2 tests
--echo #

View File

@ -3759,7 +3759,7 @@ DROP TABLE t1;
#
CREATE TABLE t1(a int);
INSERT INTO t1 VALUES (1), (2);
mysqldump: Input filename too long: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
mysqldump: Input filename too long: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
DROP TABLE t1;
CREATE TABLE t2 (a INT) ENGINE=MyISAM;
CREATE TABLE t3 (a INT) ENGINE=MyISAM;

View File

@ -122,7 +122,55 @@ t1 CREATE TABLE `t1` (
PARTITION `p02` ENGINE = MyISAM,
PARTITION `p03` ENGINE = MyISAM)
drop table t1;
create or replace table t1 (x int) partition by hash (x) (partition p1, partition p2);
#
# MDEV-19751 Wrong partitioning by KEY() after key dropped
#
create or replace table t1 (pk int, x timestamp(6), primary key (pk, x)) engine innodb
partition by key() partitions 2;
insert into t1 (pk, x) values (1, '2000-01-01 00:00'), (2, '2000-01-01 00:01');
# Inplace for DROP PRIMARY KEY when partitioned by default field list is denied
alter table t1 drop primary key, drop column x, add primary key (pk), algorithm=inplace;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
alter table t1 drop primary key, drop column x, add primary key (pk);
select * from t1 partition (p0);
pk
1
drop table t1;
create or replace table t1 (pk int not null, x timestamp(6), unique u(pk, x)) engine innodb
partition by key() partitions 2;
insert into t1 (pk, x) values (1, '2000-01-01 00:00'), (2, '2000-01-01 00:01');
# Same for NOT NULL UNIQUE KEY as this is actually primary key
alter table t1 drop key u, drop column x, add unique (pk), algorithm=inplace;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
alter table t1 drop key u, drop column x, add unique (pk);
select * from t1 partition (p0);
pk
1
drop table t1;
create or replace table t1 (pk int, x timestamp(6), primary key (pk)) engine innodb
partition by key(pk) partitions 2;
insert into t1 (pk, x) values (1, '2000-01-01 00:00'), (2, '2000-01-01 00:01');
# Inplace for DROP PRIMARY KEY when partitioned by explicit field list is allowed
alter table t1 drop primary key, add primary key (pk, x), algorithm=inplace;
select * from t1 partition (p0);
pk x
1 2000-01-01 00:00:00.000000
drop table t1;
create or replace table t1 (k int, x timestamp(6), unique key u (x, k)) engine innodb
partition by key(k) partitions 2;
insert into t1 (k, x) values (1, '2000-01-01 00:00'), (2, '2000-01-01 00:01');
# Inplace for DROP KEY is allowed
alter table t1 drop key u, algorithm=inplace;
select * from t1 partition (p0);
k x
1 2000-01-01 00:00:00.000000
drop table t1;
# End of 10.2 tests
#
# MDEV-14817 Server crashes in prep_alter_part_table()
# after table lock and multiple add partition
#
create table t1 (x int) partition by hash (x) (partition p1, partition p2);
lock table t1 write;
alter table t1 add partition (partition p1);
ERROR HY000: Duplicate partition name p1
@ -134,7 +182,7 @@ drop table t1;
# ha_partition::update_row or `part_id == m_last_part' in
# ha_partition::delete_row upon UPDATE/DELETE after dropping versioning
#
create or replace table t1 (pk int, f int, primary key(pk, f)) engine=innodb
create table t1 (pk int, f int, primary key(pk, f)) engine=innodb
partition by key() partitions 2;
insert into t1 values (1,10),(2,11);
# expected to hit same partition
@ -152,3 +200,4 @@ pk
2
delete from t1;
drop table t1;
# End of 10.3 tests

View File

@ -120,10 +120,52 @@ alter online table t1 delay_key_write=1;
show create table t1;
drop table t1;
#
# MDEV-14817 Server crashes in prep_alter_part_table() after table lock and multiple add partition
#
create or replace table t1 (x int) partition by hash (x) (partition p1, partition p2);
--echo #
--echo # MDEV-19751 Wrong partitioning by KEY() after key dropped
--echo #
create or replace table t1 (pk int, x timestamp(6), primary key (pk, x)) engine innodb
partition by key() partitions 2;
insert into t1 (pk, x) values (1, '2000-01-01 00:00'), (2, '2000-01-01 00:01');
--echo # Inplace for DROP PRIMARY KEY when partitioned by default field list is denied
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter table t1 drop primary key, drop column x, add primary key (pk), algorithm=inplace;
alter table t1 drop primary key, drop column x, add primary key (pk);
select * from t1 partition (p0);
drop table t1;
create or replace table t1 (pk int not null, x timestamp(6), unique u(pk, x)) engine innodb
partition by key() partitions 2;
insert into t1 (pk, x) values (1, '2000-01-01 00:00'), (2, '2000-01-01 00:01');
--echo # Same for NOT NULL UNIQUE KEY as this is actually primary key
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter table t1 drop key u, drop column x, add unique (pk), algorithm=inplace;
alter table t1 drop key u, drop column x, add unique (pk);
select * from t1 partition (p0);
drop table t1;
create or replace table t1 (pk int, x timestamp(6), primary key (pk)) engine innodb
partition by key(pk) partitions 2;
insert into t1 (pk, x) values (1, '2000-01-01 00:00'), (2, '2000-01-01 00:01');
--echo # Inplace for DROP PRIMARY KEY when partitioned by explicit field list is allowed
alter table t1 drop primary key, add primary key (pk, x), algorithm=inplace;
select * from t1 partition (p0);
drop table t1;
create or replace table t1 (k int, x timestamp(6), unique key u (x, k)) engine innodb
partition by key(k) partitions 2;
insert into t1 (k, x) values (1, '2000-01-01 00:00'), (2, '2000-01-01 00:01');
--echo # Inplace for DROP KEY is allowed
alter table t1 drop key u, algorithm=inplace;
select * from t1 partition (p0);
drop table t1;
--echo # End of 10.2 tests
--echo #
--echo # MDEV-14817 Server crashes in prep_alter_part_table()
--echo # after table lock and multiple add partition
--echo #
create table t1 (x int) partition by hash (x) (partition p1, partition p2);
lock table t1 write;
--error ER_SAME_NAME_PARTITION
alter table t1 add partition (partition p1);
@ -136,7 +178,7 @@ drop table t1;
--echo # ha_partition::update_row or `part_id == m_last_part' in
--echo # ha_partition::delete_row upon UPDATE/DELETE after dropping versioning
--echo #
create or replace table t1 (pk int, f int, primary key(pk, f)) engine=innodb
create table t1 (pk int, f int, primary key(pk, f)) engine=innodb
partition by key() partitions 2;
insert into t1 values (1,10),(2,11);
@ -149,3 +191,5 @@ select * from t1 partition(p0);
select * from t1 partition(p1);
delete from t1;
drop table t1;
--echo # End of 10.3 tests

View File

@ -2,6 +2,6 @@ MariaDB error code 150: Foreign key constraint is incorrectly formed
Win32 error code 150: System trace information was not specified in your CONFIG.SYS file, or tracing is disallowed.
OS error code 23: Too many open files in system
Win32 error code 23: Data error (cyclic redundancy check).
MariaDB error code 1062 (ER_DUP_ENTRY): Duplicate entry '%-.192s' for key %d
MariaDB error code 1062 (ER_DUP_ENTRY): Duplicate entry '%-.192T' for key %d
Win32 error code 1062: The service has not been started.
Illegal error code: 30000

View File

@ -1,5 +1,5 @@
Illegal error code: 10000
MariaDB error code 1062 (ER_DUP_ENTRY): Duplicate entry '%-.192s' for key %d
MariaDB error code 1062 (ER_DUP_ENTRY): Duplicate entry '%-.192T' for key %d
MariaDB error code 1408 (ER_STARTUP): %s: ready for connections.
Version: '%s' socket: '%s' port: %d %s
MariaDB error code 1459 (ER_TABLE_NEEDS_UPGRADE): Upgrade required. Please do "REPAIR %s %`s" or dump/reload to fix it!

View File

@ -8,6 +8,9 @@ connection default;
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
FOUND 1 /sleep/ in MDEV-20466.text
SET DEBUG_SYNC= 'now SIGNAL go';
connection con1;
User
disconnect con1;
connection default;
SET DEBUG_SYNC = 'RESET';
End of 5.5 tests

View File

@ -30,7 +30,10 @@ remove_file $MYSQLTEST_VARDIR/tmp/MDEV-20466.text;
SET DEBUG_SYNC= 'now SIGNAL go';
connection con1;
reap;
disconnect con1;
connection default;
SET DEBUG_SYNC = 'RESET';

View File

@ -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

View File

@ -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

View File

@ -1866,5 +1866,20 @@ id select_type table type possible_keys key key_len ref rows Extra
set optimizer_switch= @save_optimizer_switch;
set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
drop table t1,t2;
#
# MDEV-21495: Conditional jump or move depends on uninitialised value in sel_arg_range_seq_next
#
CREATE TABLE t1(a INT, b INT);
INSERT INTO t1 SELECT seq, seq from seq_1_to_100;
set optimizer_use_condition_selectivity=4;
ANALYZE TABLE t1 PERSISTENT FOR ALL;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
SELECT * from t1 WHERE a = 5 and b = 5;
a b
5 5
set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
drop table t1;
# End of 10.1 tests
set @@global.histogram_size=@save_histogram_size;

View File

@ -1267,6 +1267,18 @@ set optimizer_switch= @save_optimizer_switch;
set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
drop table t1,t2;
--echo #
--echo # MDEV-21495: Conditional jump or move depends on uninitialised value in sel_arg_range_seq_next
--echo #
CREATE TABLE t1(a INT, b INT);
INSERT INTO t1 SELECT seq, seq from seq_1_to_100;
set optimizer_use_condition_selectivity=4;
ANALYZE TABLE t1 PERSISTENT FOR ALL;
SELECT * from t1 WHERE a = 5 and b = 5;
set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
drop table t1;
--echo # End of 10.1 tests
#

View File

@ -1876,6 +1876,21 @@ id select_type table type possible_keys key key_len ref rows Extra
set optimizer_switch= @save_optimizer_switch;
set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
drop table t1,t2;
#
# MDEV-21495: Conditional jump or move depends on uninitialised value in sel_arg_range_seq_next
#
CREATE TABLE t1(a INT, b INT);
INSERT INTO t1 SELECT seq, seq from seq_1_to_100;
set optimizer_use_condition_selectivity=4;
ANALYZE TABLE t1 PERSISTENT FOR ALL;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
SELECT * from t1 WHERE a = 5 and b = 5;
a b
5 5
set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
drop table t1;
# End of 10.1 tests
set @@global.histogram_size=@save_histogram_size;
set optimizer_switch=@save_optimizer_switch_for_selectivity_test;

View File

@ -889,5 +889,16 @@ Warning 1411 Incorrect date value: '0000-02-28' for function round(datetime)
Warning 1411 Incorrect date value: '0000-12-31' for function round(datetime)
DROP TABLE t1;
#
# MDEV-20984 Possibly wrong result or Assertion `args[0]->type_handler()->mysql_timestamp_type() == MYSQL_TIMESTAMP_DATETIME' failed in Item_func_round::date_op
#
CREATE TABLE t1 (a DATETIME);
INSERT INTO t1 VALUES ('1979-01-03 10:33:32'),('2012-12-12 12:12:12');
SELECT ROUND(a) AS f FROM t1 GROUP BY a WITH ROLLUP;
f
1979-01-03 10:33:32
2012-12-12 12:12:12
NULL
DROP TABLE t1;
#
# End of 10.4 tests
#

View File

@ -146,6 +146,16 @@ SELECT a, ROUND(a,-6) FROM t1;
DROP TABLE t1;
--echo #
--echo # MDEV-20984 Possibly wrong result or Assertion `args[0]->type_handler()->mysql_timestamp_type() == MYSQL_TIMESTAMP_DATETIME' failed in Item_func_round::date_op
--echo #
CREATE TABLE t1 (a DATETIME);
INSERT INTO t1 VALUES ('1979-01-03 10:33:32'),('2012-12-12 12:12:12');
SELECT ROUND(a) AS f FROM t1 GROUP BY a WITH ROLLUP;
DROP TABLE t1;
--echo #
--echo # End of 10.4 tests
--echo #

View File

@ -3723,6 +3723,25 @@ MAX(1) OVER () COUNT(a) abs(a)
1 0 NULL
drop table t1;
#
# MDEV-22461: JOIN::make_aggr_tables_info(): Assertion `select_options & (1ULL << 17)' failed.
#
CREATE TEMPORARY TABLE t0 (a INT PRIMARY KEY ) ;
INSERT INTO t0 VALUES (1),(2),(3);
SELECT a FROM t0
WHERE a < 8
GROUP BY 1.5
WINDOW v2 AS ( PARTITION BY a ORDER BY a DESC );
a
1
SELECT a, ROW_NUMBER() OVER v2
FROM t0
WHERE a < 8
GROUP BY 1.5
WINDOW v2 AS ( PARTITION BY a ORDER BY a DESC );
a ROW_NUMBER() OVER v2
1 1
drop table t0;
#
# End of 10.2 tests
#
#

View File

@ -2425,6 +2425,26 @@ SELECT MAX(1) OVER (), COUNT(a), abs(a) FROM t1 WHERE FALSE;
drop table t1;
--echo #
--echo # MDEV-22461: JOIN::make_aggr_tables_info(): Assertion `select_options & (1ULL << 17)' failed.
--echo #
CREATE TEMPORARY TABLE t0 (a INT PRIMARY KEY ) ;
INSERT INTO t0 VALUES (1),(2),(3);
SELECT a FROM t0
WHERE a < 8
GROUP BY 1.5
WINDOW v2 AS ( PARTITION BY a ORDER BY a DESC );
SELECT a, ROW_NUMBER() OVER v2
FROM t0
WHERE a < 8
GROUP BY 1.5
WINDOW v2 AS ( PARTITION BY a ORDER BY a DESC );
drop table t0;
--echo #
--echo # End of 10.2 tests
--echo #

View File

@ -403,6 +403,22 @@ XA ROLLBACK 'xid1';
#
XA START 'gtrid', 'bqual', 0x80000000;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '0x80000000' at line 1
XA BEGIN 'xid';
CREATE TEMPORARY SEQUENCE s;
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state
XA END 'xid';
XA ROLLBACK 'xid';
XA BEGIN 'xid';
CREATE SEQUENCE s;
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state
XA END 'xid';
XA ROLLBACK 'xid';
#
# End of 10.3 tests
#
#
# Start of 10.5 tests
#
# MDEV-7974 related
# Check XA state when lock_wait_timeout happens
# More tests added to flush_read_lock.test
@ -461,3 +477,6 @@ formatID gtrid_length bqual_length data
drop table asd;
disconnect con_tmp;
connection default;
#
# End of 10.5 tests
#

View File

@ -544,6 +544,37 @@ XA START 'gtrid', 'bqual', 0x80000000;
--source include/wait_until_count_sessions.inc
#
# MDEV-22002 Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())'
# failed upon CREATE TEMPORARY SEQUENCE under XA
#
XA BEGIN 'xid';
--error ER_XAER_RMFAIL
CREATE TEMPORARY SEQUENCE s;
XA END 'xid';
XA ROLLBACK 'xid';
XA BEGIN 'xid';
--error ER_XAER_RMFAIL
CREATE SEQUENCE s;
XA END 'xid';
XA ROLLBACK 'xid';
--echo #
--echo # End of 10.3 tests
--echo #
--echo #
--echo # Start of 10.5 tests
--echo #
--echo # MDEV-7974 related
--echo # Check XA state when lock_wait_timeout happens
--echo # More tests added to flush_read_lock.test
@ -590,3 +621,7 @@ drop table asd;
disconnect con_tmp;
--source include/wait_until_disconnected.inc
connection default;
--echo #
--echo # End of 10.5 tests
--echo #

View File

@ -377,32 +377,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 main {
@ -475,7 +449,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)
@ -916,8 +890,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};
@ -6586,23 +6558,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);
}

View File

@ -106,7 +106,7 @@ RAISE dup_val_on_index;
END;
$$
CALL p1();
ERROR 23000: Duplicate entry '%-.192s' for key %d
ERROR 23000: Duplicate entry '%-.192T' for key %d
DROP PROCEDURE p1;
CREATE PROCEDURE p1
AS

View File

@ -9,8 +9,8 @@ show create table tf;
Table Create Table
tf CREATE TABLE `tf` (
`x` int(11) DEFAULT NULL,
`row_start` SYS_TYPE NOT NULL INVISIBLE DEFAULT 0,
`row_end` SYS_TYPE NOT NULL INVISIBLE DEFAULT 0
`row_start` SYS_TYPE INVISIBLE DEFAULT '1971-01-01 00:00:00.000000',
`row_end` SYS_TYPE INVISIBLE DEFAULT '1971-01-01 00:00:00.000000'
) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:MASTER_MYPORT/test/t1'
# INSERT
insert into t1 values (1);

View File

@ -12,7 +12,7 @@ eval create or replace table t1 (
with system versioning;
--replace_result $MASTER_MYPORT MASTER_MYPORT
eval create or replace table tf engine=FEDERATED connection='mysql://root@127.0.0.1:$MASTER_MYPORT/test/t1';
--replace_result $MASTER_MYPORT MASTER_MYPORT $sys_datatype_expl SYS_TYPE "'0000-00-00 00:00:00.000000'" 0
--replace_result $MASTER_MYPORT MASTER_MYPORT $sys_datatype_expl SYS_TYPE 19710101000000 "'1971-01-01 00:00:00.000000'" " NOT NULL" ""
show create table tf;
--echo # INSERT
insert into t1 values (1);

View File

@ -70,3 +70,20 @@ a b
2 1
disconnect node_2a;
drop table t1;
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
connection node_2a;
CREATE TABLE t1 (i int primary key);
SET DEBUG_SYNC = "before_wsrep_ordered_commit SIGNAL bwoc_reached WAIT_FOR bwoc_continue";
INSERT INTO t1 VALUES (1);
connection node_2;
SET DEBUG_SYNC = "now WAIT_FOR bwoc_reached";
SET DEBUG_SYNC = "now SIGNAL bwoc_continue";
SET DEBUG_SYNC='RESET';
connection node_2a;
connection node_2;
select * from t1;
i
1
disconnect node_2a;
connection node_2;
drop table t1;

View File

@ -1,4 +1,7 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc
#
# Test case 1: Start a transaction on node_2a and kill it
@ -140,4 +143,48 @@ select * from t1;
drop table t1;
#
# Test case 7:
# run a transaction in node 2, and set a sync point to pause the transaction
# in commit phase.
# Through another connection to node 2, kill the committing transaction by
# KILL QUERY command
#
--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
--connection node_2a
--let $connection_id = `SELECT CONNECTION_ID()`
CREATE TABLE t1 (i int primary key);
# Set up sync point
SET DEBUG_SYNC = "before_wsrep_ordered_commit SIGNAL bwoc_reached WAIT_FOR bwoc_continue";
# Send insert which will block in the sync point above
--send INSERT INTO t1 VALUES (1)
--connection node_2
SET DEBUG_SYNC = "now WAIT_FOR bwoc_reached";
--disable_query_log
--disable_result_log
# victim has passed the point of no return, kill is not possible anymore
--eval KILL QUERY $connection_id
--enable_result_log
--enable_query_log
SET DEBUG_SYNC = "now SIGNAL bwoc_continue";
SET DEBUG_SYNC='RESET';
--connection node_2a
--error 0,1213
--reap
--connection node_2
# victim was able to complete the INSERT
select * from t1;
--disconnect node_2a
--connection node_2
drop table t1;

View File

@ -1,4 +1,5 @@
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/big_test.inc
--connection node_1

View File

@ -0,0 +1,13 @@
connection node_2;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
SET SESSION wsrep_trx_fragment_size = 1;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
START TRANSACTION;
INSERT INTO t1 VALUES (1);
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;

View File

@ -0,0 +1,18 @@
#
# MDEV-22616
#
# CHECK TABLE fails with wsrep_trx_fragment_size > 0
#
--source include/galera_cluster.inc
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
SET SESSION wsrep_trx_fragment_size = 1;
CHECK TABLE t1;
START TRANSACTION;
INSERT INTO t1 VALUES (1);
CHECK TABLE t1;
DROP TABLE t1;

View File

@ -152,3 +152,41 @@ SELECT * FROM t1;
a b d
1 NULL NULL
DROP TABLE t1;
#
# MDEV-22637 Rollback of insert fails when column reorder happens
#
SET @@SQL_MODE = REPLACE(@@SQL_MODE, 'STRICT_TRANS_TABLES', '');
SET @@SQL_MODE = REPLACE(@@SQL_MODE, 'STRICT_ALL_TABLES', '');
CREATE TABLE t1(f1 INT NOT NULL, f2 CHAR(100),
f3 CHAR(100), f4 CHAR(100))ENGINE=InnoDB;
INSERT INTO t1 VALUES(1, "This is column2", "This is column3",
"This is column4");
set DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL scanned WAIT_FOR insert_done';
ALTER TABLE t1 ADD COLUMN f6 int after f3, add primary key(f6, f4(3), f3(3));
connect con1,localhost,root,,;
SET DEBUG_SYNC = 'now WAIT_FOR scanned';
BEGIN;
INSERT INTO t1(f1, f2) VALUES(2, "This is column2 value");
ROLLBACK;
set DEBUG_SYNC = 'now SIGNAL insert_done';
connection default;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 3
Warning 1265 Data truncated for column 'f4' at row 3
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL,
`f2` char(100) DEFAULT NULL,
`f3` char(100) NOT NULL,
`f6` int(11) NOT NULL,
`f4` char(100) NOT NULL,
PRIMARY KEY (`f6`,`f4`(3),`f3`(3))
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SELECT COUNT(*) FROM t1;
COUNT(*)
1
disconnect con1;
DROP TABLE t1;
SET DEBUG_SYNC = 'RESET';
SET SQL_MODE=DEFAULT;

View File

@ -0,0 +1,13 @@
--- instant_alter_limit.result 2020-05-26 18:01:27.377946439 +0530
+++ instant_alter_limit,16k.reject 2020-05-26 20:14:38.452463919 +0530
@@ -45,3 +45,10 @@
instants
502
DROP TABLE t;
+#
+# MDEV-21787 Alter table failure tries to access uninitialized column
+#
+CREATE TABLE t1(f1 INT PRIMARY KEY, f2 TEXT GENERATED ALWAYS AS (SUBSTR(f4, 1, 400)), f3 VARCHAR(500), f4 TEXT)ENGINE=InnoDB ROW_FORMAT=Compact;
+ALTER TABLE t1 ADD UNIQUE KEY (f2(9));
+ALTER TABLE t1 ADD COLUMN f5 TEXT, ALGORITHM=INPLACE;
+DROP TABLE t1;

View File

@ -1,9 +1,16 @@
--- instant_alter_limit.result
+++ instant_alter_limit.result
@@ -42,5 +42,5 @@
--- instant_alter_limit.result 2020-05-26 18:01:27.377946439 +0530
+++ instant_alter_limit,32k.reject 2020-05-26 19:59:19.743877366 +0530
@@ -43,5 +43,12 @@
FROM information_schema.global_status
WHERE variable_name = 'innodb_instant_alter_column';
instants
-502
+506
DROP TABLE t;
+#
+# MDEV-21787 Alter table failure tries to access uninitialized column
+#
+CREATE TABLE t1(f1 INT PRIMARY KEY, f2 TEXT GENERATED ALWAYS AS (SUBSTR(f4, 1, 400)), f3 VARCHAR(500), f4 TEXT)ENGINE=InnoDB ROW_FORMAT=Compact;
+ALTER TABLE t1 ADD UNIQUE KEY (f2(9));
+ALTER TABLE t1 ADD COLUMN f5 TEXT, ALGORITHM=INPLACE;
+DROP TABLE t1;

View File

@ -1,5 +1,5 @@
--- instant_alter_limit.result
+++ instant_alter_limit.result
--- instant_alter_limit.result 2020-05-26 18:01:27.377946439 +0530
+++ instant_alter_limit,4k.reject 2020-05-26 20:17:53.314736548 +0530
@@ -5,6 +5,276 @@
ENGINE=InnoDB;
INSERT INTO t VALUES(1,2,3,4,5);
@ -295,10 +295,19 @@
ALTER TABLE t ADD COLUMN b INT NOT NULL, ALGORITHM=INSTANT;
ERROR 0A000: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE
SELECT variable_value-@old_instant instants
@@ -43,5 +319,5 @@
@@ -43,5 +319,14 @@
FROM information_schema.global_status
WHERE variable_name = 'innodb_instant_alter_column';
instants
-502
+474
DROP TABLE t;
+#
+# MDEV-21787 Alter table failure tries to access uninitialized column
+#
+CREATE TABLE t1(f1 INT PRIMARY KEY, f2 TEXT GENERATED ALWAYS AS (SUBSTR(f4, 1, 400)), f3 VARCHAR(500), f4 TEXT)ENGINE=InnoDB ROW_FORMAT=Compact;
+ALTER TABLE t1 ADD UNIQUE KEY (f2(9));
+ALTER TABLE t1 ADD COLUMN f5 TEXT, ALGORITHM=INPLACE;
+Warnings:
+Warning 139 Row size too large (> 1982). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline.
+DROP TABLE t1;

View File

@ -1,9 +1,16 @@
--- instant_alter_limit.result
+++ instant_alter_limit.result
@@ -42,5 +42,5 @@
--- instant_alter_limit.result 2020-05-26 18:01:27.377946439 +0530
+++ instant_alter_limit,64k.reject 2020-05-26 20:00:22.499711222 +0530
@@ -43,5 +43,12 @@
FROM information_schema.global_status
WHERE variable_name = 'innodb_instant_alter_column';
instants
-502
+506
DROP TABLE t;
+#
+# MDEV-21787 Alter table failure tries to access uninitialized column
+#
+CREATE TABLE t1(f1 INT PRIMARY KEY, f2 TEXT GENERATED ALWAYS AS (SUBSTR(f4, 1, 400)), f3 VARCHAR(500), f4 TEXT)ENGINE=InnoDB ROW_FORMAT=Compact;
+ALTER TABLE t1 ADD UNIQUE KEY (f2(9));
+ALTER TABLE t1 ADD COLUMN f5 TEXT, ALGORITHM=INPLACE;
+DROP TABLE t1;

View File

@ -1,5 +1,5 @@
--- instant_alter_limit.result
+++ instant_alter_limit.result
--- instant_alter_limit.result 2020-05-26 18:01:27.377946439 +0530
+++ instant_alter_limit,8k.reject 2020-05-26 20:19:50.881869095 +0530
@@ -5,6 +5,28 @@
ENGINE=InnoDB;
INSERT INTO t VALUES(1,2,3,4,5);
@ -47,10 +47,17 @@
ALTER TABLE t ADD COLUMN b INT NOT NULL, ALGORITHM=INSTANT;
ERROR 0A000: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE
SELECT variable_value-@old_instant instants
@@ -43,5 +71,5 @@
@@ -43,5 +71,12 @@
FROM information_schema.global_status
WHERE variable_name = 'innodb_instant_alter_column';
instants
-502
+492
DROP TABLE t;
+#
+# MDEV-21787 Alter table failure tries to access uninitialized column
+#
+CREATE TABLE t1(f1 INT PRIMARY KEY, f2 TEXT GENERATED ALWAYS AS (SUBSTR(f4, 1, 400)), f3 VARCHAR(500), f4 TEXT)ENGINE=InnoDB ROW_FORMAT=Compact;
+ALTER TABLE t1 ADD UNIQUE KEY (f2(9));
+ALTER TABLE t1 ADD COLUMN f5 TEXT, ALGORITHM=INPLACE;
+DROP TABLE t1;

View File

@ -196,3 +196,30 @@ SHOW CREATE TABLE t1;
UPDATE t1 SET d=NULL;
SELECT * FROM t1;
DROP TABLE t1;
--echo #
--echo # MDEV-22637 Rollback of insert fails when column reorder happens
--echo #
SET @@SQL_MODE = REPLACE(@@SQL_MODE, 'STRICT_TRANS_TABLES', '');
SET @@SQL_MODE = REPLACE(@@SQL_MODE, 'STRICT_ALL_TABLES', '');
CREATE TABLE t1(f1 INT NOT NULL, f2 CHAR(100),
f3 CHAR(100), f4 CHAR(100))ENGINE=InnoDB;
INSERT INTO t1 VALUES(1, "This is column2", "This is column3",
"This is column4");
set DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL scanned WAIT_FOR insert_done';
--send ALTER TABLE t1 ADD COLUMN f6 int after f3, add primary key(f6, f4(3), f3(3))
connect(con1,localhost,root,,);
SET DEBUG_SYNC = 'now WAIT_FOR scanned';
BEGIN;
INSERT INTO t1(f1, f2) VALUES(2, "This is column2 value");
ROLLBACK;
set DEBUG_SYNC = 'now SIGNAL insert_done';
connection default;
reap;
SHOW CREATE TABLE t1;
SELECT COUNT(*) FROM t1;
disconnect con1;
DROP TABLE t1;
SET DEBUG_SYNC = 'RESET';
SET SQL_MODE=DEFAULT;

View File

@ -60,3 +60,17 @@ FROM information_schema.global_status
WHERE variable_name = 'innodb_instant_alter_column';
DROP TABLE t;
--echo #
--echo # MDEV-21787 Alter table failure tries to access uninitialized column
--echo #
CREATE TABLE t1(f1 INT PRIMARY KEY, f2 TEXT GENERATED ALWAYS AS (SUBSTR(f4, 1, 400)), f3 VARCHAR(500), f4 TEXT)ENGINE=InnoDB ROW_FORMAT=Compact;
ALTER TABLE t1 ADD UNIQUE KEY (f2(9));
let $error_code = 0;
let $innodb_page_size = `SELECT @@INNODB_PAGE_SIZE`;
if ($innodb_page_size == 4k) {
let $error_code= ER_TOO_BIG_ROWSIZE;
}
--error $error_code
ALTER TABLE t1 ADD COLUMN f5 TEXT, ALGORITHM=INPLACE;
DROP TABLE t1;

View File

@ -0,0 +1,2 @@
--skip-stack-trace --skip-core-file
--default-storage-engine=Aria

View File

@ -0,0 +1,13 @@
create table t1 (a int primary key, b int, c int, unique key(b), key(c)) engine=aria transactional=1;
insert into t1 values (1000,1000,1000);
insert into t1 select seq,seq+100, seq+200 from seq_1_to_10;
SET GLOBAL debug_dbug="+d,crash_end_bulk_insert";
REPLACE into t1 select seq+20,seq+95, seq + 300 from seq_1_to_10;
ERROR HY000: Lost connection to MySQL server during query
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
select sum(a),sum(b),sum(c) from t1;
sum(a) sum(b) sum(c)
1055 2055 3055
drop table t1;

View File

@ -0,0 +1,36 @@
--source include/not_embedded.inc
--source include/not_valgrind.inc
# Avoid CrashReporter popup on Mac
--source include/not_crashrep.inc
# Binary must be compiled with debug for crash to occur
--source include/have_debug.inc
--source include/have_sequence.inc
#
# MDEV-20578 Got error 126 when executing undo undo_key_delete upon Aria crash
# recovery
#
# Write file to make mysql-test-run.pl expect crash and restart
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
create table t1 (a int primary key, b int, c int, unique key(b), key(c)) engine=aria transactional=1;
insert into t1 values (1000,1000,1000);
insert into t1 select seq,seq+100, seq+200 from seq_1_to_10;
# Insert into t1 with batch insert where we get a rows replaced after
# a few sucessful inserts
SET GLOBAL debug_dbug="+d,crash_end_bulk_insert";
--error 2013
REPLACE into t1 select seq+20,seq+95, seq + 300 from seq_1_to_10;
# Wait until restarted
--enable_reconnect
--source include/wait_until_connected_again.inc
--disable_reconnect
check table t1;
select sum(a),sum(b),sum(c) from t1;
drop table t1;

View File

@ -0,0 +1,291 @@
include/master-slave.inc
[connection master]
connection slave;
include/stop_slave.inc
RESET MASTER;
RESET SLAVE;
connection master;
RESET MASTER;
CREATE TABLE t1 (a int primary key, b text) ENGINE=InnoDB;
INSERT INTO t1 SET a=25, b='trx0';
connection slave;
include/start_slave.inc
connection master;
connection slave;
include/stop_slave.inc
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
SET GLOBAL slave_parallel_threads=2;
SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
SET GLOBAL slave_parallel_mode='optimistic';
connection slave;
SET @old_max_relay_log_size = @@global.max_relay_log_size;
SET @@global.max_relay_log_size=4096;
connection master;
BEGIN;
INSERT INTO t1 SET a=1, b='trx1';
INSERT INTO t1 SET a=2, b='trx1';
INSERT INTO t1 SET a=3, b='trx1';
INSERT INTO t1 SET a=4, b='trx1';
INSERT INTO t1 SET a=5, b='trx1';
INSERT INTO t1 SET a=6, b='trx1';
INSERT INTO t1 SET a=7, b='trx1';
INSERT INTO t1 SET a=8, b='trx1';
INSERT INTO t1 SET a=9, b='trx1';
INSERT INTO t1 SET a=10, b='trx1';
INSERT INTO t1 SET a=11, b='trx1';
INSERT INTO t1 SET a=12, b='trx1';
INSERT INTO t1 SET a=13, b='trx1';
INSERT INTO t1 SET a=14, b='trx1';
INSERT INTO t1 SET a=15, b='trx1';
INSERT INTO t1 SET a=16, b='trx1';
INSERT INTO t1 SET a=17, b='trx1';
INSERT INTO t1 SET a=18, b='trx1';
INSERT INTO t1 SET a=19, b='trx1';
INSERT INTO t1 SET a=20, b='trx1';
INSERT INTO t1 SET a=21, b='trx1';
INSERT INTO t1 SET a=22, b='trx1';
INSERT INTO t1 SET a=23, b='trx1';
INSERT INTO t1 SET a=24, b='trx1';
COMMIT;
FLUSH LOGS;
BEGIN;
UPDATE t1 SET b='trx2_0' WHERE a = 25;
UPDATE t1 SET b='trx2' WHERE a = 25;
COMMIT;
INSERT INTO t1 SET a=26,b='trx3';
*** case 1 UNTIL inside trx2
connection slave1;
BEGIN;
INSERT INTO t1 SET a= 1;
connection slave;
SELECT <pos_0> <= <pos_until> AND <pos_until> < <pos_trx2> as "pos_until < trx0 and is within trx2";
pos_until < trx0 and is within trx2
1
CHANGE MASTER TO MASTER_USE_GTID=no;
START SLAVE UNTIL MASTER_LOG_FILE = 'file_2', MASTER_LOG_POS = <pos_until>;
connection slave1;
ROLLBACK;
Proof 1: Correct stop
connection slave;
include/wait_for_slave_sql_to_stop.inc
SELECT count(*) = 1 as 'trx2 is committed' FROM t1 WHERE b = 'trx2';
trx2 is committed
1
SELECT count(*) = 0 as 'trx3 is not committed' FROM t1 WHERE b = 'trx3';
trx3 is not committed
1
Proof 2: Resume works out
include/start_slave.inc
connection master;
connection slave;
*** case 2 UNTIL inside trx2
connection slave;
DELETE FROM t1 WHERE a <> 25;
UPDATE t1 SET b='trx0' WHERE a = 25;
connection slave1;
BEGIN;
INSERT INTO t1 SET a= 1;
connection slave;
include/stop_slave.inc
SELECT <pos_0> <= <pos_until> AND <pos_until> < <pos_trx2> as "pos_until >= trx0 and is within trx2";
pos_until >= trx0 and is within trx2
1
CHANGE MASTER TO MASTER_LOG_FILE = 'file_1', MASTER_LOG_POS = <pos_trx0>, MASTER_USE_GTID=no;
START SLAVE UNTIL MASTER_LOG_FILE = 'file_2', MASTER_LOG_POS = <pos_until>;
connection slave1;
ROLLBACK;
Proof 1: Correct stop
connection slave;
include/wait_for_slave_sql_to_stop.inc
SELECT count(*) = 1 as 'trx2 is committed' FROM t1 WHERE b = 'trx2';
trx2 is committed
1
SELECT count(*) = 0 as 'trx3 is not committed' FROM t1 WHERE b = 'trx3';
trx3 is not committed
1
Proof 2: Resume works out
include/start_slave.inc
connection master;
connection slave;
*** case 3 UNTIL inside trx1
connection slave;
DELETE FROM t1 WHERE a <> 25;
UPDATE t1 SET b='trx0' WHERE a = 25;
connection slave1;
BEGIN;
INSERT INTO t1 SET a= 1; # block trx1;
connection slave;
include/stop_slave.inc
SELECT <pos_until> < <pos_0> as "pos_until before trx2 start position";
pos_until before trx2 start position
1
CHANGE MASTER TO MASTER_LOG_FILE = 'file_1', MASTER_LOG_POS = <pos_trx0>, MASTER_USE_GTID=no;
START SLAVE UNTIL MASTER_LOG_FILE = 'file_2', MASTER_LOG_POS = <pos_until>;
connection slave1;
ROLLBACK;
Proof 1: Correct stop
connection slave;
include/wait_for_slave_sql_to_stop.inc
SELECT count(*) = 25-1 as 'trx1 is committed' FROM t1 WHERE b = 'trx1';
trx1 is committed
1
SELECT count(*) = 0 as 'trx2 is not committed' FROM t1 WHERE b = 'trx2';
trx2 is not committed
1
Proof 2: Resume works out
include/start_slave.inc
connection master;
connection slave;
*** case 4 Relay-log UNTIL inside trx1
connection slave;
DELETE FROM t1 WHERE a <> 25;
UPDATE t1 SET b='trx0' WHERE a = 25;
connection slave1;
BEGIN;
INSERT INTO t1 SET a= 1; # block trx1;
connection slave;
include/stop_slave.inc
CHANGE MASTER TO MASTER_LOG_FILE = 'file_1', MASTER_LOG_POS = <pos_trx0>, MASTER_USE_GTID=no;
START SLAVE IO_THREAD;
include/wait_for_slave_io_to_start.inc
START SLAVE UNTIL RELAY_LOG_FILE = 'file_2', RELAY_LOG_POS = <pos_until>;
connection slave1;
ROLLBACK;
Proof 1: Correct stop
connection slave;
include/wait_for_slave_sql_to_stop.inc
SELECT count(*) = 25-1 as 'trx1 is committed' FROM t1 WHERE b = 'trx1';
trx1 is committed
1
SELECT count(*) = 0 as 'trx2 is not committed' FROM t1 WHERE b = 'trx2';
trx2 is not committed
1
Proof 2: Resume works out
include/start_slave.inc
connection master;
connection slave;
*** case 5 Relay-log UNTIL inside a "big" trx that spawns few relay logs
connection master;
CREATE TABLE t2 (a TEXT) ENGINE=InnoDB;
FLUSH LOGS;
connection slave;
connection slave;
include/stop_slave.inc
connection master;
BEGIN;
INSERT INTO t2 SET a=repeat('a',1024);
INSERT INTO t2 SET a=repeat('a',1024);
INSERT INTO t2 SET a=repeat('a',1024);
INSERT INTO t2 SET a=repeat('a',1024);
INSERT INTO t2 SET a=repeat('a',1024);
INSERT INTO t2 SET a=repeat('a',1024);
INSERT INTO t2 SET a=repeat('a',1024);
INSERT INTO t2 SET a=repeat('a',1024);
INSERT INTO t2 SET a=repeat('a',1024);
INSERT INTO t2 SET a=repeat('a',1024);
INSERT INTO t2 SET a=repeat('a',1024);
INSERT INTO t2 SET a=repeat('a',1024);
INSERT INTO t2 SET a=repeat('a',1024);
INSERT INTO t2 SET a=repeat('a',1024);
INSERT INTO t2 SET a=repeat('a',1024);
INSERT INTO t2 SET a=repeat('a',1024);
INSERT INTO t2 SET a=repeat('a',1024);
COMMIT;
INSERT INTO t2 SET a='a';
connection slave;
START SLAVE IO_THREAD;
include/wait_for_slave_io_to_start.inc
START SLAVE UNTIL RELAY_LOG_FILE = 'file_2', RELAY_LOG_POS = <pos_until>;
Proof 1: Correct stop
connection slave;
include/wait_for_slave_sql_to_stop.inc
Proof 2: Resume works out
include/start_slave.inc
connection master;
connection slave;
include/diff_tables.inc [master:t2,slave:t2]
*** case 6 Relay-log UNTIL inside a small trx inside a sequence of relay logs
connection slave;
include/stop_slave.inc
connection master;
BEGIN;
DELETE FROM t2 LIMIT 1;
COMMIT;
BEGIN;
DELETE FROM t2 LIMIT 1;
COMMIT;
BEGIN;
DELETE FROM t2 LIMIT 1;
COMMIT;
BEGIN;
DELETE FROM t2 LIMIT 1;
COMMIT;
BEGIN;
DELETE FROM t2 LIMIT 1;
COMMIT;
BEGIN;
DELETE FROM t2 LIMIT 1;
COMMIT;
BEGIN;
DELETE FROM t2 LIMIT 1;
COMMIT;
BEGIN;
DELETE FROM t2 LIMIT 1;
COMMIT;
BEGIN;
DELETE FROM t2 LIMIT 1;
COMMIT;
BEGIN;
DELETE FROM t2 LIMIT 1;
COMMIT;
BEGIN;
DELETE FROM t2 LIMIT 1;
COMMIT;
BEGIN;
DELETE FROM t2 LIMIT 1;
COMMIT;
BEGIN;
DELETE FROM t2 LIMIT 1;
COMMIT;
BEGIN;
DELETE FROM t2 LIMIT 1;
COMMIT;
BEGIN;
DELETE FROM t2 LIMIT 1;
COMMIT;
BEGIN;
DELETE FROM t2 LIMIT 1;
COMMIT;
BEGIN;
DELETE FROM t2 LIMIT 1;
COMMIT;
BEGIN;
DELETE FROM t2 LIMIT 1;
COMMIT;
COMMIT;
connection slave;
START SLAVE IO_THREAD;
include/wait_for_slave_io_to_start.inc
connection master;
include/sync_slave_io_with_master.inc
connection slave;
START SLAVE UNTIL RELAY_LOG_FILE = 'file_2', RELAY_LOG_POS = <pos_until>;
Proof 1: Correct stop
connection slave;
include/wait_for_slave_sql_to_stop.inc
Proof 2: Resume works out
include/start_slave.inc
connection master;
connection slave;
include/diff_tables.inc [master:t2,slave:t2]
connection slave;
include/stop_slave.inc
SET GLOBAL max_relay_log_size=@old_max_relay_log_size;
SET GLOBAL slave_parallel_mode=@old_parallel_mode;
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
include/start_slave.inc
connection master;
DROP TABLE t1, t2;
connection slave;
include/rpl_end.inc

View File

@ -11,7 +11,7 @@ drop table t1;
connection slave;
include/wait_for_slave_sql_to_stop.inc
call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.* error code=1062.*Error on slave:.* error.* 0");
Error: "Query caused different errors on master and slave. Error on master: message (format)='Duplicate entry '%-.192s' for key %d' error code=1062 ; Error on slave: actual message='no error', error code=0. Default database: 'test'. Query: 'insert into t1 values(1),(2)'" (expected different error codes on master and slave)
Error: "Query caused different errors on master and slave. Error on master: message (format)='Duplicate entry '%-.192T' for key %d' error code=1062 ; Error on slave: actual message='no error', error code=0. Default database: 'test'. Query: 'insert into t1 values(1),(2)'" (expected different error codes on master and slave)
Errno: "0" (expected 0)
drop table t1;
include/stop_slave.inc

View File

@ -0,0 +1,465 @@
--source include/have_innodb.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc
--source include/master-slave.inc
# Format is restricted because the test expects a specific result of
# relay-logging that splits a transaction into two different files.
--source include/have_binlog_format_row.inc
#
# MDEV-15152 Optimistic parallel slave doesn't cope well with START SLAVE UNTIL
#
--connection slave
--source include/stop_slave.inc
RESET MASTER;
RESET SLAVE;
--connection master
RESET MASTER;
CREATE TABLE t1 (a int primary key, b text) ENGINE=InnoDB;
--let $a0 = 25
--eval INSERT INTO t1 SET a=$a0, b='trx0'
# Memorize the position for replication restart from it
--let $pos_trx0 = query_get_value(SHOW MASTER STATUS, Position, 1)
--connection slave
--source include/start_slave.inc
--connection master
# --connection slave
--sync_slave_with_master
--source include/stop_slave.inc
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
SET GLOBAL slave_parallel_threads=2;
SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
SET GLOBAL slave_parallel_mode='optimistic';
# Run the slave in the following modes one by one.
#
# 1. the until position is set in the middle of trx2
# below $pos_trx0 of the last exec position in the first file
# 2. and above $pos_trx0
# In either case trx2 must commit before slave stops.
# 3. the until postion is inside trx1
# 4. RELAY log until inside trx1
# 5. RELAY log until inside a "big" trx
# 6. RELAY log until inside a trx within a sequence of relay logs
#
# Execution flaw for Until_Master_Pos cases follows as:
# create the transaction trx1, trx2
# logged at the beginning of two subsequent binlog files.
# Set the until position to at the middle of the 2rd transaction.
# Engage the optimistic scheduler while having trx1 execution blocked.
# Lift the block after trx2 has reached waiting its order to commit.
# *Proof 1*
# Observe that the slave applier stops at a correct position.
# In the bug condition it would stop prematurely having the stop position
# in the first file, therefore trx2 not committed.
# Specifically, an internal transaction position until makes the applier to run
# beyond it to commit commit the current transaction.
# *Proof 2*
# Observe the following START SLAVE resumes OK.
#
# Auxiliary third trx3 on master is just for triggering the actual stop
# (whihc is a legacy UNTIL's property).
# trx0 is to produce a specific value of the last executed binlog file:pos
# to emulate the bug condition.
#
# Intermediate checks via SELECT are supposed to succeed
# with putting out value 1.
#
# NOTE: Relay log until tests have to use explicit log names and position
# which may require to adjust with future changes to event formats etc.
#
--connection slave
SET @old_max_relay_log_size = @@global.max_relay_log_size;
SET @@global.max_relay_log_size=4096;
--connection master
# trx1
--let $a=1
BEGIN;
while (`SELECT $a < $a0`)
{
--eval INSERT INTO t1 SET a=$a, b='trx1'
--inc $a
}
COMMIT;
--let $fil_1 = query_get_value(SHOW MASTER STATUS, File, 1)
--let $pos_trx1 = query_get_value(SHOW MASTER STATUS, Position, 1)
FLUSH LOGS;
# $pos_0 the offset of the first event of trx2 in new file
--let $pos_0=query_get_value(SHOW MASTER STATUS, Position, 1)
# trx2
--let $a=$a0
BEGIN;
--eval UPDATE t1 SET b='trx2_0' WHERE a = $a
--eval UPDATE t1 SET b='trx2' WHERE a = $a
COMMIT;
--let $fil_2=query_get_value(SHOW MASTER STATUS, File, 1)
--let $pos_trx2=query_get_value(SHOW MASTER STATUS, Position, 1)
# trx3
--let $a=$a0
--inc $a
--eval INSERT INTO t1 SET a=$a,b='trx3'
--let $pos_trx3=query_get_value(SHOW MASTER STATUS, Position, 1)
--let $a=
--echo *** case 1 UNTIL inside trx2
--connection slave1
# Blocker to hold off EXEC_MASTER_LOG_POS advance
BEGIN;
--eval INSERT INTO t1 SET a= 1
--connection slave
--let $pos_until=`SELECT $pos_trx0 - 1`
--replace_result $pos_0 <pos_0> $pos_until <pos_until> $pos_trx2 <pos_trx2>
--eval SELECT $pos_0 <= $pos_until AND $pos_until < $pos_trx2 as "pos_until < trx0 and is within trx2"
CHANGE MASTER TO MASTER_USE_GTID=no;
--replace_result $fil_2 file_2 $pos_until <pos_until>
--eval START SLAVE UNTIL MASTER_LOG_FILE = '$fil_2', MASTER_LOG_POS = $pos_until
--let $wait_condition= SELECT COUNT(*) > 0 FROM information_schema.processlist WHERE state = "Waiting for prior transaction to commit"
--source include/wait_condition.inc
--connection slave1
# unblock to see the slave applier stops at $until
ROLLBACK;
--echo Proof 1: Correct stop
--connection slave
--source include/wait_for_slave_sql_to_stop.inc
--let $file_stop= query_get_value(SHOW SLAVE STATUS, Relay_Master_Log_File, 1)
--let $pos_stop= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1)
if (`SELECT "$file_stop" != "$fil_2" OR $pos_stop < $pos_until`)
{
--echo *** ERROR: Slave stopped at $file_stop:$pos_stop which is not $fil_2:$pos_until.
--die
}
--eval SELECT count(*) = 1 as 'trx2 is committed' FROM t1 WHERE b = 'trx2'
--eval SELECT count(*) = 0 as 'trx3 is not committed' FROM t1 WHERE b = 'trx3'
--echo Proof 2: Resume works out
--source include/start_slave.inc
--connection master
--sync_slave_with_master
--echo *** case 2 UNTIL inside trx2
--connection slave
--eval DELETE FROM t1 WHERE a <> $a0
--eval UPDATE t1 SET b='trx0' WHERE a = $a0
--connection slave1
# Blocker to hold off EXEC_MASTER_LOG_POS advance
BEGIN;
--eval INSERT INTO t1 SET a= 1
--connection slave
--source include/stop_slave.inc
--let $pos_until=`SELECT $pos_trx2 - 1`
--replace_result $pos_trx0 <pos_0> $pos_until <pos_until> $pos_trx2 <pos_trx2>
--eval SELECT $pos_trx0 <= $pos_until AND $pos_until < $pos_trx2 as "pos_until >= trx0 and is within trx2"
--replace_result $fil_1 file_1 $pos_trx0 <pos_trx0>
--eval CHANGE MASTER TO MASTER_LOG_FILE = '$fil_1', MASTER_LOG_POS = $pos_trx0, MASTER_USE_GTID=no
--replace_result $fil_2 file_2 $pos_until <pos_until>
--eval START SLAVE UNTIL MASTER_LOG_FILE = '$fil_2', MASTER_LOG_POS = $pos_until
--let $wait_condition= SELECT COUNT(*) > 0 FROM information_schema.processlist WHERE state = "Waiting for prior transaction to commit"
--source include/wait_condition.inc
--connection slave1
# unblock to see the slave applier stops at $until
ROLLBACK;
--echo Proof 1: Correct stop
--connection slave
--source include/wait_for_slave_sql_to_stop.inc
--let $file_stop= query_get_value(SHOW SLAVE STATUS, Relay_Master_Log_File, 1)
--let $pos_stop= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1)
if (`SELECT "$file_stop" != "$fil_2" OR $pos_stop < $pos_until`)
{
--echo *** ERROR: Slave stopped at $file_stop:$pos_stop which is not $fil_2:$pos_until.
--die
}
--eval SELECT count(*) = 1 as 'trx2 is committed' FROM t1 WHERE b = 'trx2'
--eval SELECT count(*) = 0 as 'trx3 is not committed' FROM t1 WHERE b = 'trx3'
--echo Proof 2: Resume works out
--source include/start_slave.inc
--connection master
--sync_slave_with_master
--echo *** case 3 UNTIL inside trx1
--connection slave
--eval DELETE FROM t1 WHERE a <> $a0
--eval UPDATE t1 SET b='trx0' WHERE a = $a0
--connection slave1
# Blocker to hold off EXEC_MASTER_LOG_POS advance
BEGIN;
--eval INSERT INTO t1 SET a= 1; # block trx1
--connection slave
--source include/stop_slave.inc
--let $pos_until=`SELECT $pos_0 - 1`
--replace_result $pos_0 <pos_0> $pos_until <pos_until> $pos_trx2 <pos_trx2>
--eval SELECT $pos_until < $pos_0 as "pos_until before trx2 start position"
--replace_result $fil_1 file_1 $pos_trx0 <pos_trx0>
--eval CHANGE MASTER TO MASTER_LOG_FILE = '$fil_1', MASTER_LOG_POS = $pos_trx0, MASTER_USE_GTID=no
--replace_result $fil_2 file_2 $pos_until <pos_until>
--eval START SLAVE UNTIL MASTER_LOG_FILE = '$fil_2', MASTER_LOG_POS = $pos_until
--connection slave1
# unblock to see the slave applier stops at $until
ROLLBACK;
--echo Proof 1: Correct stop
--connection slave
--source include/wait_for_slave_sql_to_stop.inc
--let $file_stop= query_get_value(SHOW SLAVE STATUS, Relay_Master_Log_File, 1)
--let $pos_stop= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1)
if (`SELECT "$file_stop" != "$fil_2" OR $pos_stop < $pos_until`)
{
--echo *** ERROR: Slave stopped at $file_stop:$pos_stop which is not $fil_2:$pos_until.
--die
}
--eval SELECT count(*) = $a0-1 as 'trx1 is committed' FROM t1 WHERE b = 'trx1'
--eval SELECT count(*) = 0 as 'trx2 is not committed' FROM t1 WHERE b = 'trx2'
--echo Proof 2: Resume works out
--source include/start_slave.inc
--connection master
--sync_slave_with_master
--echo *** case 4 Relay-log UNTIL inside trx1
--connection slave
--eval DELETE FROM t1 WHERE a <> $a0
--eval UPDATE t1 SET b='trx0' WHERE a = $a0
--connection slave1
# Blocker to hold off EXEC_MASTER_LOG_POS advance
BEGIN;
--eval INSERT INTO t1 SET a= 1; # block trx1
--connection slave
--source include/stop_slave.inc
--replace_result $fil_1 file_1 $pos_trx0 <pos_trx0>
--eval CHANGE MASTER TO MASTER_LOG_FILE = '$fil_1', MASTER_LOG_POS = $pos_trx0, MASTER_USE_GTID=no
START SLAVE IO_THREAD;
--source include/wait_for_slave_io_to_start.inc
# The following test sets the stop coordinate is set to inside the first event
# of a relay log that holds events of a transaction started in an earlier log.
# Peek the stop position in the middle of trx1, not even on a event boundary.
--let $pos_until=255
--let $file_rl=slave-relay-bin.000003
--let $binlog_file=$file_rl
--let $pos_xid=508
--let $info= query_get_value(SHOW RELAYLOG EVENTS IN '$file_rl' FROM $pos_xid LIMIT 1, Info, 1)
if (`SELECT "$info" NOT LIKE "COMMIT /* xid=% */" OR $pos_xid < $pos_until`)
{
--echo *** Unexpected offset. Refine it to point to the correct XID event!
--die
}
--replace_result $file_rl file_2 $pos_until <pos_until>
--eval START SLAVE UNTIL RELAY_LOG_FILE = '$file_rl', RELAY_LOG_POS = $pos_until
--connection slave1
# unblock to see the slave applier stops at $until
ROLLBACK;
--echo Proof 1: Correct stop
--connection slave
--source include/wait_for_slave_sql_to_stop.inc
--let $file_stop= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1)
--let $pos_stop= query_get_value(SHOW SLAVE STATUS, Relay_Log_Pos, 1)
if (`SELECT strcmp("$file_rl","$file_stop") > -1`)
{
--echo *** ERROR: Slave stopped at $file_stop:$pos_stop which is not $file_rl:$pos_until.
--die
}
--eval SELECT count(*) = $a0-1 as 'trx1 is committed' FROM t1 WHERE b = 'trx1'
--eval SELECT count(*) = 0 as 'trx2 is not committed' FROM t1 WHERE b = 'trx2'
--echo Proof 2: Resume works out
--source include/start_slave.inc
--connection master
--sync_slave_with_master
--echo *** case 5 Relay-log UNTIL inside a "big" trx that spawns few relay logs
--connection master
CREATE TABLE t2 (a TEXT) ENGINE=InnoDB;
FLUSH LOGS;
--sync_slave_with_master
--let $file_stop= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1)
--let $pos_stop= query_get_value(SHOW SLAVE STATUS, Relay_Log_Pos, 1)
--let $records=`SELECT floor(4*@@global.max_relay_log_size / 1024) + 1`
--connection slave
--source include/stop_slave.inc
--connection master
# trx4
BEGIN;
--let $i=$records
while ($i)
{
INSERT INTO t2 SET a=repeat('a',1024);
--dec $i
}
COMMIT;
# slave will stop there:
--let $file_trx4 = query_get_value(SHOW MASTER STATUS, File, 1)
--let $pos_trx4 = query_get_value(SHOW MASTER STATUS, Position, 1)
# trx5
INSERT INTO t2 SET a='a';
--let $pos_trx5 = query_get_value(SHOW MASTER STATUS, Position, 1)
--connection slave
START SLAVE IO_THREAD;
--source include/wait_for_slave_io_to_start.inc
# Set position inside the transaction though the value
# specified is beyond that relay log file.
# The coordianate may point to in a different event in future changes
# but should not move away from inside this big group of events.
# So we don't test which event in the transaction it points to.
--let $pos_until= 4500
--let $file_rl= slave-relay-bin.000010
--replace_result $file_rl file_2 $pos_until <pos_until>
--eval START SLAVE UNTIL RELAY_LOG_FILE = '$file_rl', RELAY_LOG_POS = $pos_until
--echo Proof 1: Correct stop
--connection slave
--source include/wait_for_slave_sql_to_stop.inc
--let $file_stop= query_get_value(SHOW SLAVE STATUS, Relay_Master_Log_File, 1)
--let $pos_stop= query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1)
# It's showed the actual stop occurred before trx5
if (`SELECT strcmp("$file_trx4", "$file_stop") <> 0 OR $pos_stop >= $pos_trx5 OR count(*) <> $records FROM t2`)
{
--echo *** ERROR: Slave stopped at *binlog* $file_stop:$pos_stop which is not $file_trx4:$pos_trx4.
--die
}
--echo Proof 2: Resume works out
--source include/start_slave.inc
--connection master
--sync_slave_with_master
--let $diff_tables=master:t2,slave:t2
--source include/diff_tables.inc
--echo *** case 6 Relay-log UNTIL inside a small trx inside a sequence of relay logs
--connection slave
--source include/stop_slave.inc
--connection master
# trx6
--let $records=`SELECT count(*) FROM t2`
while ($records)
{
BEGIN;
DELETE FROM t2 LIMIT 1;
COMMIT;
--dec $records
}
COMMIT;
--connection slave
START SLAVE IO_THREAD;
--source include/wait_for_slave_io_to_start.inc
--connection master
--source include/sync_slave_io_with_master.inc
--connection slave
# The relay-log coordinate is not at an event boundary and
# also may change across the server version.
# The test makes its best to check its coherance.
--let $pos_until= 3130
--let $file_rl= slave-relay-bin.000018
--let $pos_gtid = 2987
--let $info= query_get_value(SHOW RELAYLOG EVENTS IN '$file_rl' FROM $pos_gtid LIMIT 1, Info, 1)
if (`SELECT "$info" != "BEGIN GTID 0-1-23"`)
{
--echo *** Unexpected offset. Refine it to point to the correct GTID!
--die
}
--let $pos_event = 3120
--let $type= query_get_value(SHOW RELAYLOG EVENTS IN '$file_rl' FROM $pos_event LIMIT 1, Event_type, 1)
if (`SELECT "$type" != "Delete_rows_v1"`)
{
--echo *** Unexpected offset. Refine it to point to the expected event!
--die
}
--replace_result $file_rl file_2 $pos_until <pos_until>
--eval START SLAVE UNTIL RELAY_LOG_FILE = '$file_rl', RELAY_LOG_POS = $pos_until
--echo Proof 1: Correct stop
--connection slave
--source include/wait_for_slave_sql_to_stop.inc
--let $file_stop= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1)
--let $pos_stop= query_get_value(SHOW SLAVE STATUS, Relay_Log_Pos, 1)
if (`SELECT strcmp("$file_stop", "$file_rl") = -1 OR
strcmp("$file_stop", "$file_rl") = 0 AND $pos_stop < $pos_until`)
{
--echo *** ERROR: Slave stopped at *relay* $file_stop:$pos_stop which is not $file_rl:$pos_until.
--die
}
--echo Proof 2: Resume works out
--source include/start_slave.inc
--connection master
--sync_slave_with_master
--let $diff_tables=master:t2,slave:t2
--source include/diff_tables.inc
#
# Clean up.
#
--connection slave
--source include/stop_slave.inc
SET GLOBAL max_relay_log_size=@old_max_relay_log_size;
SET GLOBAL slave_parallel_mode=@old_parallel_mode;
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
--source include/start_slave.inc
--connection master
DROP TABLE t1, t2;
--sync_slave_with_master
--source include/rpl_end.inc

View File

@ -409,3 +409,12 @@ SELECT * FROM t1 WHERE d2 < d1;
i d1 d2 t
1 2023-03-16 2023-03-15 1
DROP TABLE t1;
#
# MDEV-20015 Assertion `!in_use->is_error()' failed in TABLE::update_virtual_field
#
create or replace table t1 (a int);
insert into t1 (a) values (1), (1);
create or replace table t2 (pk int, b int, c int as (b) virtual, primary key (pk), key(c));
insert into t2 (pk) select a from t1;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
drop tables t1, t2;

View File

@ -300,3 +300,14 @@ DROP TABLE t1;
# Cleanup
--let $datadir= `SELECT @@datadir`
--remove_file $datadir/test/load_t1
--echo #
--echo # MDEV-20015 Assertion `!in_use->is_error()' failed in TABLE::update_virtual_field
--echo #
create or replace table t1 (a int);
insert into t1 (a) values (1), (1);
create or replace table t2 (pk int, b int, c int as (b) virtual, primary key (pk), key(c));
--error ER_DUP_ENTRY
insert into t2 (pk) select a from t1;
drop tables t1, t2;

View File

@ -50,6 +50,10 @@ if ($MTR_COMBINATION_MYISAM)
{
--let $MTR_COMBINATION_TIMESTAMP= 1
}
if ($MTR_COMBINATION_TRADITIONAL)
{
--let $MTR_COMBINATION_TIMESTAMP= 1
}
if ($MTR_COMBINATION_HEAP)
{
--let $MTR_COMBINATION_TIMESTAMP= 1

View File

@ -7,5 +7,10 @@ default-storage-engine=innodb
[myisam]
default-storage-engine=myisam
[traditional]
default-storage-engine=myisam
sql-mode=traditional
[heap]
default-storage-engine=memory

View File

@ -1021,6 +1021,88 @@ insert into t2 values (0), (2);
update t1 left join t2 on a > b set b= 2 order by b;
drop table t1, t2;
#
# MDEV-17091 Assertion `old_part_id == m_last_part' failed in
# ha_partition::update_row or `part_id == m_last_part' in
# ha_partition::delete_row upon UPDATE/DELETE after dropping versioning
#
create or replace table t1 (pk int primary key, f int) engine=innodb
with system versioning
partition by key() partitions 2;
insert into t1 values (1,10),(2,20);
# expected to hit same partition
select * from t1 partition (p0);
pk f
1 10
2 20
alter table t1 drop system versioning;
# 1 and 2 are expected to be in different partitions
select * from t1 partition(p0);
pk f
1 10
select * from t1 partition(p1);
pk f
2 20
update t1 set f=pk;
delete from t1;
drop table t1;
#
# MDEV-22413 Server hangs upon UPDATE/DELETE on a view reading from versioned partitioned table
#
create or replace table t1 (f char(6)) engine innodb with system versioning;
insert into t1 values (null);
update t1 set f= 'foo';
update t1 set f= 'bar';
create or replace view v1 as select * from t1 for system_time all;
update v1 set f = '';
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
create or replace table t1 (f char(6)) engine innodb with system versioning
partition by system_time limit 1
(partition p1 history, partition p2 history, partition pn current);
insert into t1 values (null);
update t1 set f= 'foo';
update t1 set f= 'bar';
create or replace view v1 as select * from t1 for system_time all;
update v1 set f= '';
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
delete from v1;
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
drop view v1;
drop table t1;
# End of 10.3 tests
#
# MDEV-22283 Server crashes in key_copy or unexpected error 156: The table already existed in the storage engine
#
create table t1 (a int primary key) engine=aria page_checksum=0
with system versioning
partition by system_time (partition p1 history, partition pn current);
alter table t1 add partition (partition p2 history);
Warnings:
Warning 4115 Maybe missing parameters: no rotation condition for multiple HISTORY partitions.
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Got error 174 "Fatal error during initialization of handler" from storage engine Aria NULL NULL
Warnings:
Warning 1030 Got error 174 "Fatal error during initialization of handler" from storage engine Aria
drop table t1;
create table t1 (b int) engine=aria row_format=dynamic with system versioning
partition by system_time (partition p1 history, partition pn current);
insert into t1 values (1);
replace into t1 values (1);
drop table t1;
#
# MDEV-18794 Assertion `!m_innodb' failed in ha_partition::cmp_ref upon SELECT from partitioned table
#
create or replace table t1 (pk int auto_increment, i int, c char(1), primary key (pk), key(i))
engine=innodb with system versioning partition by key() partitions 2;
insert into t1 (i, c) values (1, 'a'), (2, 'b'), (null, 'c'), (null, 'b');
alter table t1 drop system versioning;
replace into t1 select * from t1;
select * from t1 where i > 0 or pk = 1000 limit 1;
pk i c
1 1 a
drop table t1;
# End of 10.4 tests
#
# MDEV-22153 ALTER add default history partitions makes table inaccessible
#
create or replace table t1 (x int) with system versioning partition by system_time;
@ -1056,31 +1138,6 @@ t1 CREATE TABLE `t1` (
PARTITIONS 8
drop tables t1;
#
# MDEV-17091 Assertion `old_part_id == m_last_part' failed in
# ha_partition::update_row or `part_id == m_last_part' in
# ha_partition::delete_row upon UPDATE/DELETE after dropping versioning
#
create or replace table t1 (pk int primary key, f int) engine=innodb
with system versioning
partition by key() partitions 2;
insert into t1 values (1,10),(2,20);
# expected to hit same partition
select * from t1 partition (p0);
pk f
1 10
2 20
alter table t1 drop system versioning;
# 1 and 2 are expected to be in different partitions
select * from t1 partition(p0);
pk f
1 10
select * from t1 partition(p1);
pk f
2 20
update t1 set f=pk;
delete from t1;
drop table t1;
#
# MDEV-22207 Drop default history partitions renders table inaccessible
#
create or replace table t1 (i int) with system versioning
@ -1149,3 +1206,6 @@ t1 CREATE TABLE `t1` (
PARTITION `p16` HISTORY ENGINE = DEFAULT_ENGINE,
PARTITION `pn` CURRENT ENGINE = DEFAULT_ENGINE)
drop tables t1;
#
# End of 10.5 tests
#

View File

@ -45,7 +45,7 @@ ASOF_x y
7 107
8 108
9 109
select x as FROMTO_x, y from t1 for system_time from timestamp '0-0-0 0:0:0' to timestamp @t1;
select x as FROMTO_x, y from t1 for system_time from timestamp '1970-01-01 00:00:00' to timestamp @t1;
FROMTO_x y
0 100
1 101
@ -57,7 +57,7 @@ FROMTO_x y
7 107
8 108
9 109
select x as BETWAND_x, y from t1 for system_time between timestamp '0-0-0 0:0:0' and timestamp @t1;
select x as BETWAND_x, y from t1 for system_time between timestamp '1970-01-01 00:00:00' and timestamp @t1;
BETWAND_x y
0 100
1 101
@ -242,8 +242,7 @@ ERROR HY000: Table `t1` is not system-versioned
create or replace table t1 (x int) with system versioning;
insert into t1 values (1);
select * from t1 for system_time all for update;
x
1
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
create or replace table t1 (a int not null auto_increment primary key) with system versioning;
select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1;
a
@ -284,7 +283,7 @@ a b
select * from (select * from (select * from t1 cross join t2) as tmp1) as tmp2;
a b
1 2
select * from (select * from t1 cross join t2 for system_time as of timestamp ('0-0-0')) as tmp;
select * from (select * from t1 cross join t2 for system_time as of timestamp ('1970-01-01 00:00:00')) as tmp;
a b
create or replace table t1(a1 int) with system versioning;
create or replace table t2(a2 int) with system versioning;

View File

@ -22,7 +22,7 @@
7 107
8 108
9 109
-select x as FROMTO2_x, y from t1 for system_time from '0-0-0 0:0:0' to @t1;
-select x as FROMTO2_x, y from t1 for system_time from '1970-01-01 00:00' to @t1;
+select x as FROMTO2_x, y from t1 for system_time from transaction @x0 to transaction @x1;
FROMTO2_x y
0 100
@ -31,7 +31,7 @@
7 107
8 108
9 109
-select x as BETWAND2_x, y from t1 for system_time between '0-0-0 0:0:0' and @t1;
-select x as BETWAND2_x, y from t1 for system_time between '1970-01-01 00:00' and timestamp @t1;
+select x as BETWAND2_x, y from t1 for system_time between transaction @x0 and transaction @x1;
BETWAND2_x y
0 100

View File

@ -48,7 +48,7 @@ ASOF_x y
7 107
8 108
9 109
select x as FROMTO_x, y from t1 for system_time from '0-0-0 0:0:0' to timestamp @t1;
select x as FROMTO_x, y from t1 for system_time from '1970-01-01 00:00' to timestamp @t1;
FROMTO_x y
0 100
1 101
@ -60,7 +60,7 @@ FROMTO_x y
7 107
8 108
9 109
select x as BETWAND_x, y from t1 for system_time between '0-0-0 0:0:0' and timestamp @t1;
select x as BETWAND_x, y from t1 for system_time between '1970-01-01 00:00' and timestamp @t1;
BETWAND_x y
0 100
1 101
@ -98,7 +98,7 @@ ASOF2_x y
7 107
8 108
9 109
select x as FROMTO2_x, y from t1 for system_time from '0-0-0 0:0:0' to @t1;
select x as FROMTO2_x, y from t1 for system_time from '1970-01-01 00:00' to @t1;
FROMTO2_x y
0 100
1 101
@ -110,7 +110,7 @@ FROMTO2_x y
7 107
8 108
9 109
select x as BETWAND2_x, y from t1 for system_time between '0-0-0 0:0:0' and @t1;
select x as BETWAND2_x, y from t1 for system_time between '1970-01-01 00:00' and timestamp @t1;
BETWAND2_x y
0 100
1 101
@ -233,8 +233,7 @@ ERROR HY000: Table `t1` is not system-versioned
create or replace table t1 (x int) with system versioning;
insert into t1 values (1);
select * from t1 for system_time as of now() for update;
x
1
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
create or replace table t1 (a int not null auto_increment primary key) with system versioning;
select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1;
a
@ -275,7 +274,7 @@ a b
select * from (select * from (select * from t1 cross join t2) as tmp1) as tmp2;
a b
1 2
select * from (select * from t1 cross join t2 for system_time as of timestamp ('0-0-0')) as tmp;
select * from (select * from t1 cross join t2 for system_time as of timestamp ('1970-01-01 00:00')) as tmp;
a b
create or replace table t1(a1 int) with system versioning;
create or replace table t2(a2 int) with system versioning;

View File

@ -134,11 +134,11 @@ select * from t for system_time all;
a
2
1
select * from t for system_time from '0-0-0' to current_timestamp(6);
select * from t for system_time from '1970-01-01 00:00' to current_timestamp(6);
a
2
1
select * from t for system_time between '0-0-0' and current_timestamp(6);
select * from t for system_time between '1970-01-01 00:00' and current_timestamp(6);
a
2
1

View File

@ -79,7 +79,7 @@ create or replace view vt12 as select * from t1 cross join t2;
select * from vt12;
a b
1 2
create or replace view vt12 as select * from t1 for system_time as of timestamp ('0-0-0') cross join t2;
create or replace view vt12 as select * from t1 for system_time as of timestamp ('1970-01-01 00:00') cross join t2;
select * from vt12;
a b
# VIEW improvements [tempesta-tech/mariadb#183]

View File

@ -853,21 +853,6 @@ update t1 left join t2 on a > b set b= 2 order by b;
# cleanup
drop table t1, t2;
--echo #
--echo # MDEV-22153 ALTER add default history partitions makes table inaccessible
--echo #
create or replace table t1 (x int) with system versioning partition by system_time;
alter table t1 add partition partitions 1;
--replace_result $default_engine DEFAULT_ENGINE
show create table t1;
alter table t1 add partition partitions 2;
--replace_result $default_engine DEFAULT_ENGINE
show create table t1;
alter table t1 add partition partitions 3;
--replace_result $default_engine DEFAULT_ENGINE
show create table t1;
drop tables t1;
--echo #
--echo # MDEV-17091 Assertion `old_part_id == m_last_part' failed in
--echo # ha_partition::update_row or `part_id == m_last_part' in
@ -889,6 +874,86 @@ update t1 set f=pk;
delete from t1;
drop table t1;
--echo #
--echo # MDEV-22413 Server hangs upon UPDATE/DELETE on a view reading from versioned partitioned table
--echo #
create or replace table t1 (f char(6)) engine innodb with system versioning;
insert into t1 values (null);
update t1 set f= 'foo';
update t1 set f= 'bar';
create or replace view v1 as select * from t1 for system_time all;
--error ER_TABLE_NOT_LOCKED_FOR_WRITE
update v1 set f = '';
create or replace table t1 (f char(6)) engine innodb with system versioning
partition by system_time limit 1
(partition p1 history, partition p2 history, partition pn current);
insert into t1 values (null);
update t1 set f= 'foo';
update t1 set f= 'bar';
create or replace view v1 as select * from t1 for system_time all;
--error ER_TABLE_NOT_LOCKED_FOR_WRITE
update v1 set f= '';
--error ER_TABLE_NOT_LOCKED_FOR_WRITE
delete from v1;
# cleanup
drop view v1;
drop table t1;
--echo # End of 10.3 tests
--echo #
--echo # MDEV-22283 Server crashes in key_copy or unexpected error 156: The table already existed in the storage engine
--echo #
create table t1 (a int primary key) engine=aria page_checksum=0
with system versioning
partition by system_time (partition p1 history, partition pn current);
alter table t1 add partition (partition p2 history);
show table status;
drop table t1;
create table t1 (b int) engine=aria row_format=dynamic with system versioning
partition by system_time (partition p1 history, partition pn current);
insert into t1 values (1);
replace into t1 values (1);
# cleanup
drop table t1;
--echo #
--echo # MDEV-18794 Assertion `!m_innodb' failed in ha_partition::cmp_ref upon SELECT from partitioned table
--echo #
create or replace table t1 (pk int auto_increment, i int, c char(1), primary key (pk), key(i))
engine=innodb with system versioning partition by key() partitions 2;
insert into t1 (i, c) values (1, 'a'), (2, 'b'), (null, 'c'), (null, 'b');
alter table t1 drop system versioning;
replace into t1 select * from t1;
select * from t1 where i > 0 or pk = 1000 limit 1;
drop table t1;
--echo # End of 10.4 tests
--echo #
--echo # MDEV-22153 ALTER add default history partitions makes table inaccessible
--echo #
create or replace table t1 (x int) with system versioning partition by system_time;
alter table t1 add partition partitions 1;
--replace_result $default_engine DEFAULT_ENGINE
show create table t1;
alter table t1 add partition partitions 2;
--replace_result $default_engine DEFAULT_ENGINE
show create table t1;
alter table t1 add partition partitions 3;
--replace_result $default_engine DEFAULT_ENGINE
show create table t1;
drop tables t1;
--echo #
--echo # MDEV-22207 Drop default history partitions renders table inaccessible
--echo #
@ -920,4 +985,8 @@ show create table t1;
drop tables t1;
--echo #
--echo # End of 10.5 tests
--echo #
--source suite/versioning/common_finish.inc

View File

@ -48,8 +48,8 @@ if ($MTR_COMBINATION_TRX_ID)
select x, y from t1;
select x as ASOF_x, y from t1 for system_time as of timestamp @t0;
select x as FROMTO_x, y from t1 for system_time from timestamp '0-0-0 0:0:0' to timestamp @t1;
select x as BETWAND_x, y from t1 for system_time between timestamp '0-0-0 0:0:0' and timestamp @t1;
select x as FROMTO_x, y from t1 for system_time from timestamp '1970-01-01 00:00:00' to timestamp @t1;
select x as BETWAND_x, y from t1 for system_time between timestamp '1970-01-01 00:00:00' and timestamp @t1;
select x as ALL_x, y from t1 for system_time all;
--disable_query_log
@ -62,8 +62,8 @@ if ($MTR_COMBINATION_TRX_ID)
if ($MTR_COMBINATION_TIMESTAMP)
{
select x as ASOF2_x, y from t1 for system_time as of @t0;
select x as FROMTO2_x, y from t1 for system_time from timestamp '0-0-0 0:0:0' to timestamp @t1;
select x as BETWAND2_x, y from t1 for system_time between timestamp '0-0-0 0:0:0' and timestamp @t1;
select x as FROMTO2_x, y from t1 for system_time from timestamp '1970-01-01 00:00:00' to timestamp @t1;
select x as BETWAND2_x, y from t1 for system_time between timestamp '1970-01-01 00:00:00' and timestamp @t1;
}
--enable_query_log
@ -149,6 +149,7 @@ select * from t1 for system_time all;
create or replace table t1 (x int) with system versioning;
insert into t1 values (1);
--error ER_TABLE_NOT_LOCKED_FOR_WRITE
select * from t1 for system_time all for update;
create or replace table t1 (a int not null auto_increment primary key) with system versioning;
@ -186,7 +187,7 @@ insert into t1 values (1);
insert into t2 values (2);
select * from (select * from t1 cross join t2) as tmp;
select * from (select * from (select * from t1 cross join t2) as tmp1) as tmp2;
select * from (select * from t1 cross join t2 for system_time as of timestamp ('0-0-0')) as tmp;
select * from (select * from t1 cross join t2 for system_time as of timestamp ('1970-01-01 00:00:00')) as tmp;
create or replace table t1(a1 int) with system versioning;
create or replace table t2(a2 int) with system versioning;

View File

@ -36,8 +36,8 @@ if($MTR_COMBINATION_TRX_ID) {
select x, y from t1;
select x as ASOF_x, y from t1 for system_time as of timestamp @t0;
select x as FROMTO_x, y from t1 for system_time from '0-0-0 0:0:0' to timestamp @t1;
select x as BETWAND_x, y from t1 for system_time between '0-0-0 0:0:0' and timestamp @t1;
select x as FROMTO_x, y from t1 for system_time from '1970-01-01 00:00' to timestamp @t1;
select x as BETWAND_x, y from t1 for system_time between '1970-01-01 00:00' and timestamp @t1;
select x as ALL_x, y from t1 for system_time all;
if($MTR_COMBINATION_TRX_ID) {
@ -47,8 +47,8 @@ if($MTR_COMBINATION_TRX_ID) {
}
if(!$MTR_COMBINATION_TRX_ID) {
select x as ASOF2_x, y from t1 for system_time as of @t0;
select x as FROMTO2_x, y from t1 for system_time from '0-0-0 0:0:0' to @t1;
select x as BETWAND2_x, y from t1 for system_time between '0-0-0 0:0:0' and @t1;
select x as FROMTO2_x, y from t1 for system_time from '1970-01-01 00:00' to @t1;
select x as BETWAND2_x, y from t1 for system_time between '1970-01-01 00:00' and timestamp @t1;
}
drop table t1;
@ -128,6 +128,7 @@ select * from t1 for system_time all;
create or replace table t1 (x int) with system versioning;
insert into t1 values (1);
--error ER_TABLE_NOT_LOCKED_FOR_WRITE
select * from t1 for system_time as of now() for update;
create or replace table t1 (a int not null auto_increment primary key) with system versioning;
@ -165,7 +166,7 @@ insert into t1 values (1);
insert into t2 values (2);
select * from (select * from t1 cross join t2) as tmp;
select * from (select * from (select * from t1 cross join t2) as tmp1) as tmp2;
select * from (select * from t1 cross join t2 for system_time as of timestamp ('0-0-0')) as tmp;
select * from (select * from t1 cross join t2 for system_time as of timestamp ('1970-01-01 00:00')) as tmp;
create or replace table t1(a1 int) with system versioning;
create or replace table t2(a2 int) with system versioning;

View File

@ -97,8 +97,8 @@ select * from t for system_time all;
select * from t;
select * from t for system_time as of timestamp current_timestamp(6);
select * from t for system_time all;
select * from t for system_time from '0-0-0' to current_timestamp(6);
select * from t for system_time between '0-0-0' and current_timestamp(6);
select * from t for system_time from '1970-01-01 00:00' to current_timestamp(6);
select * from t for system_time between '1970-01-01 00:00' and current_timestamp(6);
show status like "Feature_system_versioning";

View File

@ -65,7 +65,7 @@ insert into t1 values (1);
insert into t2 values (2);
create or replace view vt12 as select * from t1 cross join t2;
select * from vt12;
create or replace view vt12 as select * from t1 for system_time as of timestamp ('0-0-0') cross join t2;
create or replace view vt12 as select * from t1 for system_time as of timestamp ('1970-01-01 00:00') cross join t2;
select * from vt12;
--echo # VIEW improvements [tempesta-tech/mariadb#183]

View File

@ -248,7 +248,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);
@ -281,7 +282,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);
@ -310,8 +312,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);
@ -333,7 +335,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)
@ -386,8 +389,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)
@ -405,8 +408,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)
@ -424,7 +428,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)
@ -469,7 +474,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);
@ -497,8 +503,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)
@ -543,8 +550,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;
@ -557,8 +565,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)
@ -569,8 +578,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++;
}
@ -607,8 +617,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)
@ -737,7 +748,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);
}

View File

@ -6,8 +6,8 @@ SET debug_dbug="+d,frm_data_type_info";
CREATE TABLE t1 (c01 INET6, c02 INET6);
Warnings:
Note 1105 build_frm_image: Field data type info length: 14
Note 1105 DBUG: [0] name='c01' type_info='in...'
Note 1105 DBUG: [1] name='c02' type_info='in...'
Note 1105 DBUG: [0] name='c01' type_info='inet6'
Note 1105 DBUG: [1] name='c02' type_info='inet6'
SET debug_dbug=@old_debug_dbug;
SHOW CREATE TABLE t1;
Table Create Table

View File

@ -8,14 +8,14 @@ SET @@debug_dbug="+d,frm_data_type_info";
CREATE TABLE t1 (a TEST_DOUBLE);
Warnings:
Note 1105 build_frm_image: Field data type info length: 13
Note 1105 DBUG: [0] name='a' type_info='test_dou...'
Note 1105 DBUG: [0] name='a' type_info='test_double'
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` test_double DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
Warnings:
Note 1105 DBUG: [0] name='a' type_info='test_dou...'
Note 1105 DBUG: [0] name='a' type_info='test_double'
DROP TABLE t1;
SET @@debug_dbug=@old_debug_dbug;
# Testing what happens on failure to resolve a type handler by name
@ -24,7 +24,7 @@ SET @@debug_dbug="+d,frm_data_type_info";
CREATE TABLE t1 (a TEST_DOUBLE);
Warnings:
Note 1105 build_frm_image: Field data type info length: 13
Note 1105 DBUG: [0] name='a' type_info='test_dou...'
Note 1105 DBUG: [0] name='a' type_info='test_double'
FLUSH TABLES;
SET @@debug_dbug="+d,emulate_handler_by_name_or_error_failure";
SHOW CREATE TABLE t1;

View File

@ -8,14 +8,14 @@ SET @@debug_dbug="+d,frm_data_type_info";
CREATE TABLE t1 (a TEST_INT8);
Warnings:
Note 1105 build_frm_image: Field data type info length: 11
Note 1105 DBUG: [0] name='a' type_info='test_i...'
Note 1105 DBUG: [0] name='a' type_info='test_int8'
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` test_int8(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
Warnings:
Note 1105 DBUG: [0] name='a' type_info='test_i...'
Note 1105 DBUG: [0] name='a' type_info='test_int8'
DROP TABLE t1;
SET @@debug_dbug=@old_debug_dbug;
# Testing what happens on failure to resolve a type handler by name
@ -24,7 +24,7 @@ SET @@debug_dbug="+d,frm_data_type_info";
CREATE TABLE t1 (a TEST_INT8);
Warnings:
Note 1105 build_frm_image: Field data type info length: 11
Note 1105 DBUG: [0] name='a' type_info='test_i...'
Note 1105 DBUG: [0] name='a' type_info='test_int8'
FLUSH TABLES;
SET @@debug_dbug="+d,emulate_handler_by_name_or_error_failure";
SHOW CREATE TABLE t1;

View File

@ -10957,6 +10957,13 @@ bool Field::save_in_field_default_value(bool view_error_processing)
{
THD *thd= table->in_use;
/*
TODO: MDEV-19597 Refactor TABLE::vers_update_fields() via stored virtual columns
This condition will go away as well as other conditions with vers_sys_field().
*/
if (vers_sys_field())
return false;
if (unlikely(flags & NO_DEFAULT_VALUE_FLAG &&
real_type() != MYSQL_TYPE_ENUM))
{

View File

@ -2270,7 +2270,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;
@ -3725,11 +3726,13 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked)
err_handler:
DEBUG_SYNC(ha_thd(), "partition_open_error");
file= &m_file[m_tot_parts - 1];
while (file-- != m_file)
DBUG_ASSERT(m_tot_parts > 0);
for (uint i= m_tot_parts - 1; ; --i)
{
if (bitmap_is_set(&m_opened_partitions, (uint)(file - m_file)))
(*file)->ha_close();
if (bitmap_is_set(&m_opened_partitions, i))
m_file[i]->ha_close();
if (!i)
break;
}
err_alloc:
free_partition_bitmaps();
@ -3993,7 +3996,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;
@ -4272,8 +4276,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());
}
@ -7175,8 +7179,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);
}
@ -10619,7 +10623,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)
{

View File

@ -1,6 +1,6 @@
/*
Copyright (c) 2017, Aliyun and/or its affiliates.
Copyright (c) 2017, MariaDB corporation
Copyright (c) 2017, 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
@ -115,7 +115,7 @@ int ha_sequence::open(const char *name, int mode, uint flags)
file->ha_close();
}
else if (!table->s->tmp_table)
table->m_needs_reopen= true;
table->internal_set_needs_reopen(true);
/*
The following is needed to fix comparison of rows in

View File

@ -4531,6 +4531,19 @@ int handler::ha_repair(THD* thd, HA_CHECK_OPT* check_opt)
}
/**
End bulk insert
*/
int handler::ha_end_bulk_insert()
{
DBUG_ENTER("handler::ha_end_bulk_insert");
DBUG_EXECUTE_IF("crash_end_bulk_insert",
{ extra(HA_EXTRA_FLUSH) ; DBUG_SUICIDE();});
estimation_rows_to_insert= 0;
DBUG_RETURN(end_bulk_insert());
}
/**
Bulk update row: public interface.

View File

@ -3431,13 +3431,7 @@ public:
start_bulk_insert(rows, flags);
DBUG_VOID_RETURN;
}
int ha_end_bulk_insert()
{
DBUG_ENTER("handler::ha_end_bulk_insert");
estimation_rows_to_insert= 0;
int ret= end_bulk_insert();
DBUG_RETURN(ret);
}
int ha_end_bulk_insert();
int ha_bulk_update_row(const uchar *old_data, const uchar *new_data,
ha_rows *dup_key_found);
int ha_delete_all_rows();

View File

@ -6857,8 +6857,8 @@ Item_float::Item_float(THD *thd, const char *str_arg, size_t length):
value= my_charset_bin.strntod((char*) str_arg, length, &end_not_used, &error);
if (unlikely(error))
{
char tmp[NAME_LEN + 1];
my_snprintf(tmp, sizeof(tmp), "%.*s", (int)length, str_arg);
char tmp[NAME_LEN + 2];
my_snprintf(tmp, sizeof(tmp), "%.*s", static_cast<int>(length), str_arg);
my_error(ER_ILLEGAL_VALUE_FOR_TYPE, MYF(0), "double", tmp);
}
presentation= name.str= str_arg;

View File

@ -3679,9 +3679,11 @@ public:
Field *result_field;
Item_null_result(THD *thd): Item_null(thd), result_field(0) {}
bool is_result_field() { return result_field != 0; }
enum_field_types field_type() const
const Type_handler *type_handler() const
{
return result_field->type();
if (result_field)
return result_field->type_handler();
return &type_handler_null;
}
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
const Tmp_field_param *param)

View File

@ -970,11 +970,16 @@ static Item *create_comparator(MY_XPATH *xpath,
b->fixed_type_handler() == &type_handler_xpath_nodeset)
{
uint len= (uint)(xpath->query.end - context->beg);
set_if_smaller(len, 32);
my_printf_error(ER_UNKNOWN_ERROR,
"XPATH error: "
"comparison of two nodesets is not supported: '%.*s'",
MYF(0), len, context->beg);
if (len <= 32)
my_printf_error(ER_UNKNOWN_ERROR,
"XPATH error: "
"comparison of two nodesets is not supported: '%.*s'",
MYF(0), len, context->beg);
else
my_printf_error(ER_UNKNOWN_ERROR,
"XPATH error: "
"comparison of two nodesets is not supported: '%.32T'",
MYF(0), context->beg);
return 0; // TODO: Comparison of two nodesets
}
@ -2627,9 +2632,12 @@ my_xpath_parse_VariableReference(MY_XPATH *xpath)
xpath->item= NULL;
DBUG_ASSERT(xpath->query.end > dollar_pos);
uint len= (uint)(xpath->query.end - dollar_pos);
set_if_smaller(len, 32);
my_printf_error(ER_UNKNOWN_ERROR, "Unknown XPATH variable at: '%.*s'",
MYF(0), len, dollar_pos);
if (len <= 32)
my_printf_error(ER_UNKNOWN_ERROR, "Unknown XPATH variable at: '%.*s'",
MYF(0), len, dollar_pos);
else
my_printf_error(ER_UNKNOWN_ERROR, "Unknown XPATH variable at: '%.32T'",
MYF(0), dollar_pos);
}
}
return xpath->item ? 1 : 0;
@ -2760,9 +2768,13 @@ bool Item_xml_str_func::fix_fields(THD *thd, Item **ref)
if (!rc)
{
uint clen= (uint)(xpath.query.end - xpath.lasttok.beg);
set_if_smaller(clen, 32);
my_printf_error(ER_UNKNOWN_ERROR, "XPATH syntax error: '%.*s'",
MYF(0), clen, xpath.lasttok.beg);
if (clen <= 32)
my_printf_error(ER_UNKNOWN_ERROR, "XPATH syntax error: '%.*s'",
MYF(0), clen, xpath.lasttok.beg);
else
my_printf_error(ER_UNKNOWN_ERROR, "XPATH syntax error: '%.32T'",
MYF(0), xpath.lasttok.beg);
return true;
}

View File

@ -327,7 +327,6 @@ static bool lower_case_table_names_used= 0;
static bool volatile select_thread_in_use, signal_thread_in_use;
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;
ulong max_used_connections;
static char *mysqld_user, *mysqld_chroot;

View File

@ -673,6 +673,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;

View File

@ -79,6 +79,7 @@ range_seq_t sel_arg_range_seq_init(void *init_param, uint n_ranges, uint flags)
SEL_ARG_RANGE_SEQ *seq= (SEL_ARG_RANGE_SEQ*)init_param;
seq->param->range_count=0;
seq->at_start= TRUE;
seq->param->max_key_parts= 0;
seq->stack[0].key_tree= NULL;
seq->stack[0].min_key= seq->param->min_key;
seq->stack[0].min_key_flag= 0;

View File

@ -93,18 +93,18 @@ handle_queued_pos_update(THD *thd, rpl_parallel_thread::queued_event *qev)
/* Do not update position if an earlier event group caused an error abort. */
DBUG_ASSERT(qev->typ == rpl_parallel_thread::queued_event::QUEUED_POS_UPDATE);
rli= qev->rgi->rli;
e= qev->entry_for_queued;
if (e->stop_on_error_sub_id < (uint64)ULONGLONG_MAX || e->force_abort)
if (e->stop_on_error_sub_id < (uint64)ULONGLONG_MAX ||
(e->force_abort && !rli->stop_for_until))
return;
rli= qev->rgi->rli;
mysql_mutex_lock(&rli->data_lock);
cmp= strcmp(rli->group_relay_log_name, qev->event_relay_log_name);
if (cmp < 0)
{
rli->group_relay_log_pos= qev->future_event_relay_log_pos;
strmake_buf(rli->group_relay_log_name, qev->event_relay_log_name);
rli->notify_group_relay_log_name_update();
} else if (cmp == 0 &&
rli->group_relay_log_pos < qev->future_event_relay_log_pos)
rli->group_relay_log_pos= qev->future_event_relay_log_pos;

View File

@ -62,6 +62,7 @@ Relay_log_info::Relay_log_info(bool is_slave_recovery)
slave_running(MYSQL_SLAVE_NOT_RUN), until_condition(UNTIL_NONE),
until_log_pos(0), retried_trans(0), executed_entries(0),
sql_delay(0), sql_delay_end(0),
until_relay_log_names_defer(false),
m_flags(0)
{
DBUG_ENTER("Relay_log_info::Relay_log_info");
@ -505,6 +506,8 @@ void Relay_log_info::clear_until_condition()
until_condition= Relay_log_info::UNTIL_NONE;
until_log_name[0]= 0;
until_log_pos= 0;
until_relay_log_names_defer= false;
DBUG_VOID_RETURN;
}
@ -995,7 +998,6 @@ void Relay_log_info::inc_group_relay_log_pos(ulonglong log_pos,
{
group_relay_log_pos= rgi->future_event_relay_log_pos;
strmake_buf(group_relay_log_name, rgi->event_relay_log_name);
notify_group_relay_log_name_update();
} else if (cmp == 0 && group_relay_log_pos < rgi->future_event_relay_log_pos)
group_relay_log_pos= rgi->future_event_relay_log_pos;
@ -1285,29 +1287,78 @@ err:
autoincrement or if we have transactions).
Should be called ONLY if until_condition != UNTIL_NONE !
In the parallel execution mode and UNTIL_MASTER_POS the file name is
presented by future_event_master_log_name which may be ahead of
group_master_log_name. Log_event::log_pos does relate to it nevertheless
so the pair comprises a correct binlog coordinate.
Internal group events and events that have zero log_pos also
produce the zero for the local log_pos which may not lead to the
function falsely return true.
In UNTIL_RELAY_POS the original caching and notification are simplified
to straightforward files comparison when the current event can't be
a part of an event group.
RETURN VALUE
true - condition met or error happened (condition seems to have
bad log file name)
false - condition not met
*/
bool Relay_log_info::is_until_satisfied(my_off_t master_beg_pos)
bool Relay_log_info::is_until_satisfied(Log_event *ev)
{
const char *log_name;
ulonglong log_pos;
/* Prevents stopping within transaction; needed solely for Relay UNTIL. */
bool in_trans= false;
DBUG_ENTER("Relay_log_info::is_until_satisfied");
if (until_condition == UNTIL_MASTER_POS)
{
log_name= (mi->using_parallel() ? future_event_master_log_name
: group_master_log_name);
log_pos= master_beg_pos;
log_pos= (get_flag(Relay_log_info::IN_TRANSACTION) || !ev || !ev->log_pos) ?
(mi->using_parallel() ? 0 : group_master_log_pos) :
ev->log_pos - ev->data_written;
}
else
{
DBUG_ASSERT(until_condition == UNTIL_RELAY_POS);
log_name= group_relay_log_name;
log_pos= group_relay_log_pos;
if (!mi->using_parallel())
{
log_name= group_relay_log_name;
log_pos= group_relay_log_pos;
}
else
{
log_name= event_relay_log_name;
log_pos= event_relay_log_pos;
in_trans= get_flag(Relay_log_info::IN_TRANSACTION);
/*
until_log_names_cmp_result is set to UNKNOWN either
- by a non-group event *and* only when it is in the middle of a group
- or by a group event when the preceding group made the above
non-group event to defer the resetting.
*/
if ((ev && !Log_event::is_group_event(ev->get_type_code())))
{
if (in_trans)
{
until_relay_log_names_defer= true;
}
else
{
until_log_names_cmp_result= UNTIL_LOG_NAMES_CMP_UNKNOWN;
until_relay_log_names_defer= false;
}
}
else if (!in_trans && until_relay_log_names_defer)
{
until_log_names_cmp_result= UNTIL_LOG_NAMES_CMP_UNKNOWN;
until_relay_log_names_defer= false;
}
}
}
DBUG_PRINT("info", ("group_master_log_name='%s', group_master_log_pos=%llu",
@ -1361,8 +1412,8 @@ bool Relay_log_info::is_until_satisfied(my_off_t master_beg_pos)
}
DBUG_RETURN(((until_log_names_cmp_result == UNTIL_LOG_NAMES_CMP_EQUAL &&
log_pos >= until_log_pos) ||
until_log_names_cmp_result == UNTIL_LOG_NAMES_CMP_GREATER));
(log_pos >= until_log_pos && !in_trans)) ||
until_log_names_cmp_result == UNTIL_LOG_NAMES_CMP_GREATER));
}

View File

@ -219,7 +219,7 @@ public:
*/
char future_event_master_log_name[FN_REFLEN];
/*
/*
Original log name and position of the group we're currently executing
(whose coordinates are group_relay_log_name/pos in the relay log)
in the master's binlog. These concern the *group*, because in the master's
@ -419,7 +419,7 @@ public:
void close_temporary_tables();
/* Check if UNTIL condition is satisfied. See slave.cc for more. */
bool is_until_satisfied(my_off_t);
bool is_until_satisfied(Log_event *ev);
inline ulonglong until_pos()
{
DBUG_ASSERT(until_condition == UNTIL_MASTER_POS ||
@ -427,7 +427,13 @@ public:
return ((until_condition == UNTIL_MASTER_POS) ? group_master_log_pos :
group_relay_log_pos);
}
inline char *until_name()
{
DBUG_ASSERT(until_condition == UNTIL_MASTER_POS ||
until_condition == UNTIL_RELAY_POS);
return ((until_condition == UNTIL_MASTER_POS) ? group_master_log_name :
group_relay_log_name);
}
/**
Helper function to do after statement completion.
@ -564,6 +570,15 @@ private:
relay_log.info had 4 lines. Now it has 5 lines.
*/
static const int LINES_IN_RELAY_LOG_INFO_WITH_DELAY= 5;
/*
Hint for when to stop event distribution by sql driver thread.
The flag is set ON by a non-group event when this event is in the middle
of a group (e.g a transaction group) so it's too early
to refresh the current-relay-log vs until-log cached comparison result.
And it is checked and to decide whether it's a right time to do so
when the being processed group has been fully scheduled.
*/
bool until_relay_log_names_defer;
/*
Holds the state of the data in the relay log.

View File

@ -315,6 +315,7 @@ extern "C" void wsrep_commit_ordered(THD *thd)
}
if (!wsrep_commit_will_write_binlog(thd))
{
DEBUG_SYNC(thd, "before_wsrep_ordered_commit");
thd->wsrep_cs().ordered_commit();
}
}

View File

@ -1197,30 +1197,30 @@ ER_TABLE_EXISTS_ERROR 42S01
swe "Tabellen '%-.192s' finns redan"
ukr "Таблиця '%-.192s' вже існує"
ER_BAD_TABLE_ERROR 42S02
cze "Neznámá tabulka '%-.100s'"
dan "Ukendt tabel '%-.100s'"
nla "Onbekende tabel '%-.100s'"
eng "Unknown table '%-.100s'"
est "Tundmatu tabel '%-.100s'"
fre "Table '%-.100s' inconnue"
ger "Unbekannte Tabelle '%-.100s'"
greek "Αγνωστος πίνακας '%-.100s'"
hindi "अज्ञात टेबल '%-.100s'"
hun "Ervenytelen tabla: '%-.100s'"
ita "Tabella '%-.100s' sconosciuta"
jpn "'%-.100s' は不明な表です。"
kor "테이블 '%-.100s'는 알수 없음"
nor "Ukjent tabell '%-.100s'"
norwegian-ny "Ukjent tabell '%-.100s'"
pol "Nieznana tabela '%-.100s'"
por "Tabela '%-.100s' desconhecida"
rum "Tabela '%-.100s' este invalida"
rus "Неизвестная таблица '%-.100s'"
serbian "Nepoznata tabela '%-.100s'"
slo "Neznáma tabuľka '%-.100s'"
spa "Tabla '%-.100s' desconocida"
swe "Okänd tabell '%-.100s'"
ukr "Невідома таблиця '%-.100s'"
cze "Neznámá tabulka '%-.100T'"
dan "Ukendt tabel '%-.100T'"
nla "Onbekende tabel '%-.100T'"
eng "Unknown table '%-.100T'"
est "Tundmatu tabel '%-.100T'"
fre "Table '%-.100T' inconnue"
ger "Unbekannte Tabelle '%-.100T'"
greek "Αγνωστος πίνακας '%-.100T'"
hindi "अज्ञात टेबल '%-.100T'"
hun "Ervenytelen tabla: '%-.100T'"
ita "Tabella '%-.100T' sconosciuta"
jpn "'%-.100T' は不明な表です。"
kor "테이블 '%-.100T'는 알수 없음"
nor "Ukjent tabell '%-.100T'"
norwegian-ny "Ukjent tabell '%-.100T'"
pol "Nieznana tabela '%-.100T'"
por "Tabela '%-.100T' desconhecida"
rum "Tabela '%-.100T' este invalida"
rus "Неизвестная таблица '%-.100T'"
serbian "Nepoznata tabela '%-.100T'"
slo "Neznáma tabuľka '%-.100T'"
spa "Tabla '%-.100T' desconocida"
swe "Okänd tabell '%-.100T'"
ukr "Невідома таблиця '%-.100T'"
ER_NON_UNIQ_ERROR 23000
cze "Sloupec '%-.192s' v %-.192s není zcela jasný"
dan "Felt: '%-.192s' i tabel %-.192s er ikke entydigt"
@ -1394,30 +1394,30 @@ ER_WRONG_VALUE_COUNT 21S01
swe "Antalet kolumner motsvarar inte antalet värden"
ukr "Кількість стовбців не співпадає з кількістю значень"
ER_TOO_LONG_IDENT 42000 S1009
cze "Jméno identifikátoru '%-.100s' je příliš dlouhé"
dan "Navnet '%-.100s' er for langt"
nla "Naam voor herkenning '%-.100s' is te lang"
eng "Identifier name '%-.100s' is too long"
est "Identifikaatori '%-.100s' nimi on liiga pikk"
fre "Le nom de l'identificateur '%-.100s' est trop long"
ger "Name des Bezeichners '%-.100s' ist zu lang"
greek "Το identifier name '%-.100s' είναι πολύ μεγάλο"
hindi "पहचानकर्ता का नाम '%-.100s' बहुत लंबा है"
hun "A(z) '%-.100s' azonositonev tul hosszu"
ita "Il nome dell'identificatore '%-.100s' e` troppo lungo"
jpn "識別子名 '%-.100s' は長すぎます。"
kor "Identifier '%-.100s'는 너무 길군요."
nor "Identifikator '%-.100s' er for lang"
norwegian-ny "Identifikator '%-.100s' er for lang"
pol "Nazwa identyfikatora '%-.100s' jest zbyt długa"
por "Nome identificador '%-.100s' é longo demais"
rum "Numele indentificatorului '%-.100s' este prea lung"
rus "Слишком длинный идентификатор '%-.100s'"
serbian "Ime '%-.100s' je predugačko"
slo "Meno identifikátora '%-.100s' je príliš dlhé"
spa "El nombre del identificador '%-.100s' es demasiado grande"
swe "Kolumnnamn '%-.100s' är för långt"
ukr "Ім'я ідентифікатора '%-.100s' задовге"
cze "Jméno identifikátoru '%-.100T' je příliš dlouhé"
dan "Navnet '%-.100T' er for langt"
nla "Naam voor herkenning '%-.100T' is te lang"
eng "Identifier name '%-.100T' is too long"
est "Identifikaatori '%-.100T' nimi on liiga pikk"
fre "Le nom de l'identificateur '%-.100T' est trop long"
ger "Name des Bezeichners '%-.100T' ist zu lang"
greek "Το identifier name '%-.100T' είναι πολύ μεγάλο"
hindi "पहचानकर्ता का नाम '%-.100T' बहुत लंबा है"
hun "A(z) '%-.100T' azonositonev tul hosszu"
ita "Il nome dell'identificatore '%-.100T' e` troppo lungo"
jpn "識別子名 '%-.100T' は長すぎます。"
kor "Identifier '%-.100T'는 너무 길군요."
nor "Identifikator '%-.100T' er for lang"
norwegian-ny "Identifikator '%-.100T' er for lang"
pol "Nazwa identyfikatora '%-.100T' jest zbyt długa"
por "Nome identificador '%-.100T' é longo demais"
rum "Numele indentificatorului '%-.100T' este prea lung"
rus "Слишком длинный идентификатор '%-.100T'"
serbian "Ime '%-.100T' je predugačko"
slo "Meno identifikátora '%-.100T' je príliš dlhé"
spa "El nombre del identificador '%-.100T' es demasiado grande"
swe "Kolumnnamn '%-.100T' är för långt"
ukr "Ім'я ідентифікатора '%-.100T' задовге"
ER_DUP_FIELDNAME 42S21 S1009
cze "Zdvojené jméno sloupce '%-.192s'"
dan "Feltnavnet '%-.192s' findes allerede"
@ -1471,30 +1471,30 @@ ER_DUP_KEYNAME 42000 S1009
# When using this error code, please use ER(ER_DUP_ENTRY_WITH_KEY_NAME)
# for the message string. See, for example, code in handler.cc.
ER_DUP_ENTRY 23000 S1009
cze "Zdvojený klíč '%-.192s' (číslo klíče %d)"
dan "Ens værdier '%-.192s' for indeks %d"
nla "Dubbele ingang '%-.192s' voor zoeksleutel %d"
eng "Duplicate entry '%-.192s' for key %d"
est "Kattuv väärtus '%-.192s' võtmele %d"
fre "Duplicata du champ '%-.192s' pour la clef %d"
ger "Doppelter Eintrag '%-.192s' für Schlüssel %d"
greek "Διπλή εγγραφή '%-.192s' για το κλειδί %d"
hindi "सामान प्रवेश '%-.192s' KEY %d के लिए"
hun "Duplikalt bejegyzes '%-.192s' a %d kulcs szerint"
ita "Valore duplicato '%-.192s' per la chiave %d"
jpn "'%-.192s' は索引 %d で重複しています。"
kor "중복된 입력 값 '%-.192s': key %d"
nor "Like verdier '%-.192s' for nøkkel %d"
norwegian-ny "Like verdiar '%-.192s' for nykkel %d"
pol "Powtórzone wystąpienie '%-.192s' dla klucza %d"
por "Entrada '%-.192s' duplicada para a chave %d"
rum "Cimpul '%-.192s' e duplicat pentru cheia %d"
rus "Дублирующаяся запись '%-.192s' по ключу %d"
serbian "Dupliran unos '%-.192s' za ključ '%d'"
slo "Opakovaný kľúč '%-.192s' (číslo kľúča %d)"
spa "Entrada duplicada '%-.192s' para la clave %d"
swe "Dublett '%-.192s' för nyckel %d"
ukr "Дублюючий запис '%-.192s' для ключа %d"
cze "Zdvojený klíč '%-.192T' (číslo klíče %d)"
dan "Ens værdier '%-.192T' for indeks %d"
nla "Dubbele ingang '%-.192T' voor zoeksleutel %d"
eng "Duplicate entry '%-.192T' for key %d"
est "Kattuv väärtus '%-.192T' võtmele %d"
fre "Duplicata du champ '%-.192T' pour la clef %d"
ger "Doppelter Eintrag '%-.192T' für Schlüssel %d"
greek "Διπλή εγγραφή '%-.192T' για το κλειδί %d"
hindi "सामान प्रवेश '%-.192T' KEY %d के लिए"
hun "Duplikalt bejegyzes '%-.192T' a %d kulcs szerint"
ita "Valore duplicato '%-.192T' per la chiave %d"
jpn "'%-.192T' は索引 %d で重複しています。"
kor "중복된 입력 값 '%-.192T': key %d"
nor "Like verdier '%-.192T' for nøkkel %d"
norwegian-ny "Like verdiar '%-.192T' for nykkel %d"
pol "Powtórzone wystąpienie '%-.192T' dla klucza %d"
por "Entrada '%-.192T' duplicada para a chave %d"
rum "Cimpul '%-.192T' e duplicat pentru cheia %d"
rus "Дублирующаяся запись '%-.192T' по ключу %d"
serbian "Dupliran unos '%-.192T' za ključ '%d'"
slo "Opakovaný kľúč '%-.192T' (číslo kľúča %d)"
spa "Entrada duplicada '%-.192T' para la clave %d"
swe "Dublett '%-.192T' för nyckel %d"
ukr "Дублюючий запис '%-.192T' для ключа %d"
ER_WRONG_FIELD_SPEC 42000 S1009
cze "Chybná specifikace sloupce '%-.192s'"
dan "Forkert kolonnespecifikaton for felt '%-.192s'"
@ -1521,30 +1521,30 @@ ER_WRONG_FIELD_SPEC 42000 S1009
swe "Felaktigt kolumntyp för kolumn '%-.192s'"
ukr "Невірний специфікатор стовбця '%-.192s'"
ER_PARSE_ERROR 42000 s1009
cze "%s blízko '%-.80s' na řádku %d"
dan "%s nær '%-.80s' på linje %d"
nla "%s bij '%-.80s' in regel %d"
eng "%s near '%-.80s' at line %d"
est "%s '%-.80s' ligidal real %d"
fre "%s près de '%-.80s' à la ligne %d"
ger "%s bei '%-.80s' in Zeile %d"
greek "%s πλησίον '%-.80s' στη γραμμή %d"
hindi "%s के पास '%-.80s' लाइन %d में"
hun "A %s a '%-.80s'-hez kozeli a %d sorban"
ita "%s vicino a '%-.80s' linea %d"
jpn "%s : '%-.80s' 付近 %d 行目"
kor "'%s' 에러 같읍니다. ('%-.80s' 명령어 라인 %d)"
nor "%s nær '%-.80s' på linje %d"
norwegian-ny "%s attmed '%-.80s' på line %d"
pol "%s obok '%-.80s' w linii %d"
por "%s próximo a '%-.80s' na linha %d"
rum "%s linga '%-.80s' pe linia %d"
rus "%s около '%-.80s' на строке %d"
serbian "'%s' u iskazu '%-.80s' na liniji %d"
slo "%s blízko '%-.80s' na riadku %d"
spa "%s cerca '%-.80s' en la linea %d"
swe "%s nära '%-.80s' på rad %d"
ukr "%s біля '%-.80s' в строці %d"
cze "%s blízko '%-.80T' na řádku %d"
dan "%s nær '%-.80T' på linje %d"
nla "%s bij '%-.80T' in regel %d"
eng "%s near '%-.80T' at line %d"
est "%s '%-.80T' ligidal real %d"
fre "%s près de '%-.80T' à la ligne %d"
ger "%s bei '%-.80T' in Zeile %d"
greek "%s πλησίον '%-.80T' στη γραμμή %d"
hindi "%s के पास '%-.80T' लाइन %d में"
hun "A %s a '%-.80T'-hez kozeli a %d sorban"
ita "%s vicino a '%-.80T' linea %d"
jpn "%s : '%-.80T' 付近 %d 行目"
kor "'%s' 에러 같읍니다. ('%-.80T' 명령어 라인 %d)"
nor "%s nær '%-.80T' på linje %d"
norwegian-ny "%s attmed '%-.80T' på line %d"
pol "%s obok '%-.80T' w linii %d"
por "%s próximo a '%-.80T' na linha %d"
rum "%s linga '%-.80T' pe linia %d"
rus "%s около '%-.80T' на строке %d"
serbian "'%s' u iskazu '%-.80T' na liniji %d"
slo "%s blízko '%-.80T' na riadku %d"
spa "%s cerca '%-.80T' en la linea %d"
swe "%s nära '%-.80T' på rad %d"
ukr "%s біля '%-.80T' в строці %d"
ER_EMPTY_QUERY 42000
cze "Výsledek dotazu je prázdný"
dan "Forespørgsel var tom"
@ -2380,30 +2380,30 @@ ER_TABLE_NOT_LOCKED
ER_UNUSED_17
eng "You should never see it"
ER_WRONG_DB_NAME 42000
cze "Nepřípustné jméno databáze '%-.100s'"
dan "Ugyldigt database navn '%-.100s'"
nla "Databasenaam '%-.100s' is niet getoegestaan"
eng "Incorrect database name '%-.100s'"
est "Vigane andmebaasi nimi '%-.100s'"
fre "Nom de base de donnée illégal: '%-.100s'"
ger "Unerlaubter Datenbankname '%-.100s'"
greek "Λάθος όνομα βάσης δεδομένων '%-.100s'"
hindi "डेटाबेस नाम '%-.100s' गलत है"
hun "Hibas adatbazisnev: '%-.100s'"
ita "Nome database errato '%-.100s'"
jpn "データベース名 '%-.100s' は不正です。"
kor "'%-.100s' 데이타베이스의 이름이 부정확합니다."
nor "Ugyldig database navn '%-.100s'"
norwegian-ny "Ugyldig database namn '%-.100s'"
pol "Niedozwolona nazwa bazy danych '%-.100s'"
por "Nome de banco de dados '%-.100s' incorreto"
rum "Numele bazei de date este incorect '%-.100s'"
rus "Некорректное имя базы данных '%-.100s'"
serbian "Pogrešno ime baze '%-.100s'"
slo "Neprípustné meno databázy '%-.100s'"
spa "Nombre de base de datos ilegal '%-.100s'"
swe "Felaktigt databasnamn '%-.100s'"
ukr "Невірне ім'я бази данних '%-.100s'"
cze "Nepřípustné jméno databáze '%-.100T'"
dan "Ugyldigt database navn '%-.100T'"
nla "Databasenaam '%-.100T' is niet getoegestaan"
eng "Incorrect database name '%-.100T'"
est "Vigane andmebaasi nimi '%-.100T'"
fre "Nom de base de donnée illégal: '%-.100T'"
ger "Unerlaubter Datenbankname '%-.100T'"
greek "Λάθος όνομα βάσης δεδομένων '%-.100T'"
hindi "डेटाबेस नाम '%-.100T' गलत है"
hun "Hibas adatbazisnev: '%-.100T'"
ita "Nome database errato '%-.100T'"
jpn "データベース名 '%-.100T' は不正です。"
kor "'%-.100T' 데이타베이스의 이름이 부정확합니다."
nor "Ugyldig database navn '%-.100T'"
norwegian-ny "Ugyldig database namn '%-.100T'"
pol "Niedozwolona nazwa bazy danych '%-.100T'"
por "Nome de banco de dados '%-.100T' incorreto"
rum "Numele bazei de date este incorect '%-.100T'"
rus "Некорректное имя базы данных '%-.100T'"
serbian "Pogrešno ime baze '%-.100T'"
slo "Neprípustné meno databázy '%-.100T'"
spa "Nombre de base de datos ilegal '%-.100T'"
swe "Felaktigt databasnamn '%-.100T'"
ukr "Невірне ім'я бази данних '%-.100T'"
ER_WRONG_TABLE_NAME 42000
cze "Nepřípustné jméno tabulky '%-.100s'"
dan "Ugyldigt tabel navn '%-.100s'"
@ -4688,15 +4688,15 @@ ER_NO_DEFAULT 42000
spa "Variable '%-.64s' no tiene un valor patrón"
swe "Variabel '%-.64s' har inte ett DEFAULT-värde"
ER_WRONG_VALUE_FOR_VAR 42000
nla "Variabele '%-.64s' kan niet worden gewijzigd naar de waarde '%-.200s'"
eng "Variable '%-.64s' can't be set to the value of '%-.200s'"
ger "Variable '%-.64s' kann nicht auf '%-.200s' gesetzt werden"
ita "Alla variabile '%-.64s' non puo' essere assegato il valore '%-.200s'"
jpn "変数 '%-.64s' に値 '%-.200s' を設定できません。"
por "Variável '%-.64s' não pode ser configurada para o valor de '%-.200s'"
rus "Переменная '%-.64s' не может быть установлена в значение '%-.200s'"
spa "Variable '%-.64s' no puede ser configurada para el valor de '%-.200s'"
swe "Variabel '%-.64s' kan inte sättas till '%-.200s'"
nla "Variabele '%-.64s' kan niet worden gewijzigd naar de waarde '%-.200T'"
eng "Variable '%-.64s' can't be set to the value of '%-.200T'"
ger "Variable '%-.64s' kann nicht auf '%-.200T' gesetzt werden"
ita "Alla variabile '%-.64s' non puo' essere assegato il valore '%-.200T'"
jpn "変数 '%-.64s' に値 '%-.200T' を設定できません。"
por "Variável '%-.64s' não pode ser configurada para o valor de '%-.200T'"
rus "Переменная '%-.64s' не может быть установлена в значение '%-.200T'"
spa "Variable '%-.64s' no puede ser configurada para el valor de '%-.200T'"
swe "Variabel '%-.64s' kan inte sättas till '%-.200T'"
ER_WRONG_TYPE_FOR_VAR 42000
nla "Foutief argumenttype voor variabele '%-.64s'"
eng "Incorrect argument type to variable '%-.64s'"
@ -5140,11 +5140,11 @@ ER_DUPLICATED_VALUE_IN_TYPE
por "Coluna '%-.100s' tem valor duplicado '%-.64s' em %s"
spa "Columna '%-.100s' tiene valor doblado '%-.64s' en %s"
ER_TRUNCATED_WRONG_VALUE 22007
eng "Truncated incorrect %-.32s value: '%-.128s'"
ger "Falscher %-.32s-Wert gekürzt: '%-.128s'"
jpn "不正な %-.32s の値が切り捨てられました。: '%-.128s'"
por "Truncado errado %-.32s valor: '%-.128s'"
spa "Equivocado truncado %-.32s valor: '%-.128s'"
eng "Truncated incorrect %-.32T value: '%-.128T'"
ger "Falscher %-.32T-Wert gekürzt: '%-.128T'"
jpn "不正な %-.32T の値が切り捨てられました。: '%-.128T'"
por "Truncado errado %-.32T valor: '%-.128T'"
spa "Equivocado truncado %-.32T valor: '%-.128T'"
ER_TOO_MUCH_AUTO_TIMESTAMP_COLS
eng "Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause"
ger "Fehlerhafte Tabellendefinition. Es kann nur eine einzige TIMESTAMP-Spalte mit CURRENT_TIMESTAMP als DEFAULT oder in einer ON-UPDATE-Klausel geben"
@ -5181,8 +5181,8 @@ ER_WARN_INVALID_TIMESTAMP
eng "Invalid TIMESTAMP value in column '%s' at row %lu"
ger "Ungültiger TIMESTAMP-Wert in Feld '%s', Zeile %lu"
ER_INVALID_CHARACTER_STRING
eng "Invalid %s character string: '%.64s'"
ger "Ungültiger %s-Zeichen-String: '%.64s'"
eng "Invalid %s character string: '%.64T'"
ger "Ungültiger %s-Zeichen-String: '%.64T'"
ER_WARN_ALLOWED_PACKET_OVERFLOWED
eng "Result of %s() was larger than max_allowed_packet (%ld) - truncated"
ger "Ergebnis von %s() war größer als max_allowed_packet (%ld) Bytes und wurde deshalb gekürzt"
@ -5426,11 +5426,11 @@ ER_DIVISION_BY_ZERO 22012
ger "Division durch 0"
hindi "0 से विभाजन"
ER_TRUNCATED_WRONG_VALUE_FOR_FIELD 22007
eng "Incorrect %-.32s value: '%-.128s' for column `%.192s`.`%.192s`.`%.192s` at row %lu"
ger "Falscher %-.32s-Wert: '%-.128s' für Feld '`%.192s`.`%.192s`.`%.192s` in Zeile %lu"
eng "Incorrect %-.32s value: '%-.128T' for column `%.192s`.`%.192s`.`%.192s` at row %lu"
ger "Falscher %-.32s-Wert: '%-.128T' für Feld '`%.192s`.`%.192s`.`%.192s` in Zeile %lu"
ER_ILLEGAL_VALUE_FOR_TYPE 22007
eng "Illegal %s '%-.192s' value found during parsing"
ger "Nicht zulässiger %s-Wert '%-.192s' beim Parsen gefunden"
eng "Illegal %s '%-.192T' value found during parsing"
ger "Nicht zulässiger %s-Wert '%-.192T' beim Parsen gefunden"
ER_VIEW_NONUPD_CHECK
eng "CHECK OPTION on non-updatable view %`-.192s.%`-.192s"
ger "CHECK OPTION auf nicht-aktualisierbarem View %`-.192s.%`-.192s"
@ -5576,8 +5576,8 @@ ER_CANT_CREATE_USER_WITH_GRANT 42000
eng "You are not allowed to create a user with GRANT"
ger "Sie dürfen keinen Benutzer mit GRANT anlegen"
ER_WRONG_VALUE_FOR_TYPE
eng "Incorrect %-.32s value: '%-.128s' for function %-.32s"
ger "Falscher %-.32s-Wert: '%-.128s' für Funktion %-.32s"
eng "Incorrect %-.32s value: '%-.128T' for function %-.32s"
ger "Falscher %-.32s-Wert: '%-.128T' für Funktion %-.32s"
ER_TABLE_DEF_CHANGED
eng "Table definition has changed, please retry transaction"
ger "Tabellendefinition wurde geändert, bitte starten Sie die Transaktion neu"
@ -5756,8 +5756,8 @@ ER_HOSTNAME
ger "Hostname"
hindi "होस्ट का नाम"
ER_WRONG_STRING_LENGTH
eng "String '%-.70s' is too long for %s (should be no longer than %d)"
ger "String '%-.70s' ist zu lang für %s (sollte nicht länger sein als %d)"
eng "String '%-.70T' is too long for %s (should be no longer than %d)"
ger "String '%-.70T' ist zu lang für %s (sollte nicht länger sein als %d)"
ER_NON_INSERTABLE_TABLE
eng "The target table %-.100s of the %s is not insertable-into"
ger "Die Zieltabelle %-.100s von %s ist nicht einfügbar"
@ -5962,8 +5962,8 @@ ER_PLUGIN_IS_NOT_LOADED
eng "Plugin '%-.192s' is not loaded"
ger "Plugin '%-.192s' ist nicht geladen"
ER_WRONG_VALUE
eng "Incorrect %-.32s value: '%-.128s'"
ger "Falscher %-.32s-Wert: '%-.128s'"
eng "Incorrect %-.32s value: '%-.128T'"
ger "Falscher %-.32s-Wert: '%-.128T'"
ER_NO_PARTITION_FOR_GIVEN_VALUE
eng "Table has no partition for value %-.64s"
ger "Tabelle hat für den Wert %-.64s keine Partition"
@ -6106,8 +6106,8 @@ ER_WRONG_PARTITION_NAME
ER_CANT_CHANGE_TX_CHARACTERISTICS 25001
eng "Transaction characteristics can't be changed while a transaction is in progress"
ER_DUP_ENTRY_AUTOINCREMENT_CASE
eng "ALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192s' for key '%-.192s'"
ger "ALTER TABLE führt zur Neusequenzierung von auto_increment, wodurch der doppelte Eintrag '%-.192s' für Schlüssel '%-.192s' auftritt"
eng "ALTER TABLE causes auto_increment resequencing, resulting in duplicate entry '%-.192T' for key '%-.192s'"
ger "ALTER TABLE führt zur Neusequenzierung von auto_increment, wodurch der doppelte Eintrag '%-.192T' für Schlüssel '%-.192s' auftritt"
ER_EVENT_MODIFY_QUEUE_ERROR
eng "Internal scheduler error %d"
ger "Interner Scheduler-Fehler %d"
@ -6162,29 +6162,29 @@ ER_NATIVE_FCT_NAME_COLLISION
# When using this error message, use the ER_DUP_ENTRY error code. See, for
# example, code in handler.cc.
ER_DUP_ENTRY_WITH_KEY_NAME 23000 S1009
cze "Zvojený klíč '%-.64s' (číslo klíče '%-.192s')"
dan "Ens værdier '%-.64s' for indeks '%-.192s'"
nla "Dubbele ingang '%-.64s' voor zoeksleutel '%-.192s'"
eng "Duplicate entry '%-.64s' for key '%-.192s'"
est "Kattuv väärtus '%-.64s' võtmele '%-.192s'"
fre "Duplicata du champ '%-.64s' pour la clef '%-.192s'"
ger "Doppelter Eintrag '%-.64s' für Schlüssel '%-.192s'"
greek "Διπλή εγγραφή '%-.64s' για το κλειδί '%-.192s'"
hun "Duplikalt bejegyzes '%-.64s' a '%-.192s' kulcs szerint"
ita "Valore duplicato '%-.64s' per la chiave '%-.192s'"
jpn "'%-.64s' は索引 '%-.192s' で重複しています。"
kor "중복된 입력 값 '%-.64s': key '%-.192s'"
nor "Like verdier '%-.64s' for nøkkel '%-.192s'"
norwegian-ny "Like verdiar '%-.64s' for nykkel '%-.192s'"
pol "Powtórzone wystąpienie '%-.64s' dla klucza '%-.192s'"
por "Entrada '%-.64s' duplicada para a chave '%-.192s'"
rum "Cimpul '%-.64s' e duplicat pentru cheia '%-.192s'"
rus "Дублирующаяся запись '%-.64s' по ключу '%-.192s'"
serbian "Dupliran unos '%-.64s' za ključ '%-.192s'"
slo "Opakovaný kľúč '%-.64s' (číslo kľúča '%-.192s')"
spa "Entrada duplicada '%-.64s' para la clave '%-.192s'"
swe "Dublett '%-.64s' för nyckel '%-.192s'"
ukr "Дублюючий запис '%-.64s' для ключа '%-.192s'"
cze "Zvojený klíč '%-.64T' (číslo klíče '%-.192s')"
dan "Ens værdier '%-.64T' for indeks '%-.192s'"
nla "Dubbele ingang '%-.64T' voor zoeksleutel '%-.192s'"
eng "Duplicate entry '%-.64T' for key '%-.192s'"
est "Kattuv väärtus '%-.64T' võtmele '%-.192s'"
fre "Duplicata du champ '%-.64T' pour la clef '%-.192s'"
ger "Doppelter Eintrag '%-.64T' für Schlüssel '%-.192s'"
greek "Διπλή εγγραφή '%-.64T' για το κλειδί '%-.192s'"
hun "Duplikalt bejegyzes '%-.64T' a '%-.192s' kulcs szerint"
ita "Valore duplicato '%-.64T' per la chiave '%-.192s'"
jpn "'%-.64T' は索引 '%-.192s' で重複しています。"
kor "중복된 입력 값 '%-.64T': key '%-.192s'"
nor "Like verdier '%-.64T' for nøkkel '%-.192s'"
norwegian-ny "Like verdiar '%-.64T' for nykkel '%-.192s'"
pol "Powtórzone wystąpienie '%-.64T' dla klucza '%-.192s'"
por "Entrada '%-.64T' duplicada para a chave '%-.192s'"
rum "Cimpul '%-.64T' e duplicat pentru cheia '%-.192s'"
rus "Дублирующаяся запись '%-.64T' по ключу '%-.192s'"
serbian "Dupliran unos '%-.64T' za ključ '%-.192s'"
slo "Opakovaný kľúč '%-.64T' (číslo kľúča '%-.192s')"
spa "Entrada duplicada '%-.64T' para la clave '%-.192s'"
swe "Dublett '%-.64T' för nyckel '%-.192s'"
ukr "Дублюючий запис '%-.64T' для ключа '%-.192s'"
ER_BINLOG_PURGE_EMFILE
eng "Too many files opened, please execute the command again"
ger "Zu viele offene Dateien, bitte führen Sie den Befehl noch einmal aus"
@ -6465,8 +6465,8 @@ ER_SLAVE_CANT_CREATE_CONVERSION
ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT
eng "Cannot modify @@session.binlog_format inside a transaction"
ER_PATH_LENGTH
eng "The path specified for %.64s is too long"
hindi "%.64s के लिए निर्दिष्ट पथ बहुत लंबा है"
eng "The path specified for %.64T is too long"
hindi "%.64T के लिए निर्दिष्ट पथ बहुत लंबा है"
ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT
eng "'%s' is deprecated and will be removed in a future release"
ger "'%s' ist veraltet und wird in einer zukünftigen Version entfernt werden"
@ -7166,8 +7166,8 @@ ER_UNKNOWN_OPTION
eng "Unknown option '%-.64s'"
hindi "अज्ञात विकल्प '%-.64s'"
ER_BAD_OPTION_VALUE
eng "Incorrect value '%-.64s' for option '%-.64s'"
hindi "गलत मान '%-.64s' विकल्प '%-.64s' के लिए"
eng "Incorrect value '%-.64T' for option '%-.64s'"
hindi "गलत मान '%-.64T' विकल्प '%-.64s' के लिए"
ER_UNUSED_6
eng "You should never see it"
ER_UNUSED_7
@ -7324,8 +7324,8 @@ ER_ROLE_DROP_EXISTS
ER_CANNOT_CONVERT_CHARACTER
eng "Cannot convert '%s' character 0x%-.64s to '%s'"
ER_INVALID_DEFAULT_VALUE_FOR_FIELD 22007
eng "Incorrect default value '%-.128s' for column '%.192s'"
hindi "गलत डिफ़ॉल्ट मान '%-.128s' कॉलम '%.192s' के लिए"
eng "Incorrect default value '%-.128T' for column '%.192s'"
hindi "गलत डिफ़ॉल्ट मान '%-.128T' कॉलम '%.192s' के लिए"
ER_KILL_QUERY_DENIED_ERROR
eng "You are not owner of query %lu"
ger "Sie sind nicht Eigentümer von Abfrage %lu"

View File

@ -4355,12 +4355,8 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli,
rli->until_condition == Relay_log_info::UNTIL_RELAY_POS) &&
(ev->server_id != global_system_variables.server_id ||
rli->replicate_same_server_id) &&
rli->is_until_satisfied((rli->get_flag(Relay_log_info::IN_TRANSACTION) || !ev->log_pos)
? rli->group_master_log_pos
: ev->log_pos - ev->data_written))
rli->is_until_satisfied(ev))
{
sql_print_information("Slave SQL thread stopped because it reached its"
" UNTIL position %llu", rli->until_pos());
/*
Setting abort_slave flag because we do not want additional
message about error in query execution to be printed.
@ -5607,10 +5603,14 @@ pthread_handler_t handle_slave_sql(void *arg)
}
if ((rli->until_condition == Relay_log_info::UNTIL_MASTER_POS ||
rli->until_condition == Relay_log_info::UNTIL_RELAY_POS) &&
rli->is_until_satisfied(rli->group_master_log_pos))
rli->is_until_satisfied(NULL))
{
sql_print_information("Slave SQL thread stopped because it reached its"
" UNTIL position %llu", rli->until_pos());
" UNTIL position %llu in %s %s file",
rli->until_pos(), rli->until_name(),
rli->until_condition ==
Relay_log_info::UNTIL_MASTER_POS ?
"binlog" : "relaylog");
mysql_mutex_unlock(&rli->data_lock);
goto err;
}
@ -5689,7 +5689,24 @@ pthread_handler_t handle_slave_sql(void *arg)
err:
if (mi->using_parallel())
rli->parallel.wait_for_done(thd, rli);
/* Gtid_list_log_event::do_apply_event has already reported the GTID until */
if (rli->stop_for_until && rli->until_condition != Relay_log_info::UNTIL_GTID)
{
if (global_system_variables.log_warnings > 2)
sql_print_information("Slave SQL thread UNTIL stop was requested at position "
"%llu in %s %s file",
rli->until_log_pos, rli->until_log_name,
rli->until_condition ==
Relay_log_info::UNTIL_MASTER_POS ?
"binlog" : "relaylog");
sql_print_information("Slave SQL thread stopped because it reached its"
" UNTIL position %llu in %s %s file",
rli->until_pos(), rli->until_name(),
rli->until_condition ==
Relay_log_info::UNTIL_MASTER_POS ?
"binlog" : "relaylog");
};
/* Thread stopped. Print the current replication position to the log */
{
StringBuffer<100> tmp;

View File

@ -1089,7 +1089,7 @@ send_result_message:
}
/* Make sure this table instance is not reused after the operation. */
if (table->table)
table->table->m_needs_reopen= true;
table->table->mark_table_for_reopen();
}
result_code= result_code ? HA_ADMIN_FAILED : HA_ADMIN_OK;
table->next_local= save_next_local;
@ -1213,7 +1213,7 @@ err:
trans_rollback(thd);
if (table && table->table)
{
table->table->m_needs_reopen= true;
table->table->mark_table_for_reopen();
table->table= 0;
}
close_thread_tables(thd); // Shouldn't be needed

View File

@ -2296,9 +2296,9 @@ Locked_tables_list::init_locked_tables(THD *thd)
in reopen_tables(). reopen_tables() is a critical
path and we don't want to complicate it with extra allocations.
*/
m_reopen_array= (TABLE**)alloc_root(&m_locked_tables_root,
sizeof(TABLE*) *
(m_locked_tables_count+1));
m_reopen_array= (TABLE_LIST**)alloc_root(&m_locked_tables_root,
sizeof(TABLE_LIST*) *
(m_locked_tables_count+1));
if (m_reopen_array == NULL)
{
reset();
@ -2411,6 +2411,7 @@ void Locked_tables_list::reset()
m_locked_tables_last= &m_locked_tables;
m_reopen_array= NULL;
m_locked_tables_count= 0;
some_table_marked_for_reopen= 0;
}
@ -2506,7 +2507,7 @@ unlink_all_closed_tables(THD *thd, MYSQL_LOCK *lock, size_t reopen_count)
in reopen_tables() always links the opened table
to the beginning of the open_tables list.
*/
DBUG_ASSERT(thd->open_tables == m_reopen_array[reopen_count]);
DBUG_ASSERT(thd->open_tables == m_reopen_array[reopen_count]->table);
thd->open_tables->pos_in_locked_tables->table= NULL;
thd->open_tables->pos_in_locked_tables= NULL;
@ -2536,10 +2537,36 @@ unlink_all_closed_tables(THD *thd, MYSQL_LOCK *lock, size_t reopen_count)
}
/*
Mark all instances of the table to be reopened
This is only needed when LOCK TABLES is active
*/
void Locked_tables_list::mark_table_for_reopen(THD *thd, TABLE *table)
{
TABLE_SHARE *share= table->s;
for (TABLE_LIST *table_list= m_locked_tables;
table_list; table_list= table_list->next_global)
{
if (table_list->table->s == share)
table_list->table->internal_set_needs_reopen(true);
}
/* This is needed in the case where lock tables where not used */
table->internal_set_needs_reopen(true);
some_table_marked_for_reopen= 1;
}
/**
Reopen the tables locked with LOCK TABLES and temporarily closed
by a DDL statement or FLUSH TABLES.
@param need_reopen If set, reopen open tables that are marked with
for reopen.
If not set, reopen tables that where closed.
@note This function is a no-op if we're not under LOCK TABLES.
@return TRUE if an error reopening the tables. May happen in
@ -2557,6 +2584,12 @@ Locked_tables_list::reopen_tables(THD *thd, bool need_reopen)
MYSQL_LOCK *merged_lock;
DBUG_ENTER("Locked_tables_list::reopen_tables");
DBUG_ASSERT(some_table_marked_for_reopen || !need_reopen);
/* Reset flag that some table was marked for reopen */
some_table_marked_for_reopen= 0;
for (TABLE_LIST *table_list= m_locked_tables;
table_list; table_list= table_list->next_global)
{
@ -2580,24 +2613,32 @@ Locked_tables_list::reopen_tables(THD *thd, bool need_reopen)
else
{
if (table_list->table) /* The table was not closed */
continue;
continue;
}
/* Links into thd->open_tables upon success */
if (open_table(thd, table_list, &ot_ctx))
{
unlink_all_closed_tables(thd, 0, reopen_count);
DBUG_RETURN(TRUE);
}
table_list->table->pos_in_locked_tables= table_list;
/* See also the comment on lock type in init_locked_tables(). */
table_list->table->reginfo.lock_type= table_list->lock_type;
DBUG_ASSERT(reopen_count < m_locked_tables_count);
m_reopen_array[reopen_count++]= table_list->table;
m_reopen_array[reopen_count++]= table_list;
}
if (reopen_count)
{
TABLE **tables= (TABLE**) my_alloca(reopen_count * sizeof(TABLE*));
for (uint i= 0 ; i < reopen_count ; i++)
{
TABLE_LIST *table_list= m_reopen_array[i];
/* Links into thd->open_tables upon success */
if (open_table(thd, table_list, &ot_ctx))
{
unlink_all_closed_tables(thd, 0, i);
my_afree((void*) tables);
DBUG_RETURN(TRUE);
}
tables[i]= table_list->table;
table_list->table->pos_in_locked_tables= table_list;
/* See also the comment on lock type in init_locked_tables(). */
table_list->table->reginfo.lock_type= table_list->lock_type;
}
thd->in_lock_tables= 1;
/*
We re-lock all tables with mysql_lock_tables() at once rather
@ -2610,7 +2651,7 @@ Locked_tables_list::reopen_tables(THD *thd, bool need_reopen)
works fine. Patching legacy code of thr_lock.c is risking to
break something else.
*/
lock= mysql_lock_tables(thd, m_reopen_array, reopen_count,
lock= mysql_lock_tables(thd, tables, reopen_count,
MYSQL_OPEN_REOPEN | MYSQL_LOCK_USE_MALLOC);
thd->in_lock_tables= 0;
if (lock == NULL || (merged_lock=
@ -2619,9 +2660,11 @@ Locked_tables_list::reopen_tables(THD *thd, bool need_reopen)
unlink_all_closed_tables(thd, lock, reopen_count);
if (! thd->killed)
my_error(ER_LOCK_DEADLOCK, MYF(0));
my_afree((void*) tables);
DBUG_RETURN(TRUE);
}
thd->lock= merged_lock;
my_afree((void*) tables);
}
DBUG_RETURN(FALSE);
}

Some files were not shown because too many files have changed in this diff Show More