Skip to content
Permalink
Browse files
Merge 10.4 into 10.5
  • Loading branch information
dr-m committed Jan 7, 2020
2 parents 1488de6 + d2697df commit 68fe5f5
Show file tree
Hide file tree
Showing 18 changed files with 418 additions and 195 deletions.
@@ -0,0 +1,190 @@
/*
Copyright (c) 2019, 2020, MariaDB
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2 of
the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA
*/

#pragma once

#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
{
list_node(list_node *next= NULL, list_node *prev= NULL)
: next(next), prev(prev)
{
}

list_node *next;
list_node *prev;
};

// Modelled after std::list<T>
template <class T, class Tag= void> class list
{
public:
typedef list_node<Tag> ListNode;
class Iterator;

// 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 Iterator iterator;
typedef Iterator const_iterator; /* FIXME */
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const iterator> const_reverse_iterator;

class Iterator
{
public:
// All iterators in C++ should define these types to implement generic
// iterator interface.
typedef std::bidirectional_iterator_tag iterator_category;
typedef T value_type;
typedef std::ptrdiff_t difference_type;
typedef T *pointer;
typedef T &reference;

Iterator(ListNode *node) : node_(node) {}

Iterator &operator++()
{
node_= node_->next;
return *this;
}
Iterator operator++(int)
{
Iterator tmp(*this);
operator++();
return tmp;
}

Iterator &operator--()
{
node_= node_->prev;
return *this;
}
Iterator operator--(int)
{
Iterator tmp(*this);
operator--();
return tmp;
}

reference operator*() { return *static_cast<pointer>(node_); }
pointer operator->() { return static_cast<pointer>(node_); }

bool operator==(const Iterator &rhs) { return node_ == rhs.node_; }
bool operator!=(const Iterator &rhs) { return !(*this == rhs); }

private:
ListNode *node_;

friend class list;
};

list() : sentinel_(&sentinel_, &sentinel_), size_(0) {}

reference front() { return *begin(); }
reference back() { return *--end(); }
const_reference front() const { return *begin(); }
const_reference back() const { return *--end(); }

iterator begin() { return iterator(sentinel_.next); }
const_iterator begin() const
{
return iterator(const_cast<ListNode *>(sentinel_.next));
}
iterator end() { return iterator(&sentinel_); }
const_iterator end() const
{
return iterator(const_cast<ListNode *>(&sentinel_));
}

reverse_iterator rbegin() { return reverse_iterator(end()); }
const_reverse_iterator rbegin() const { return reverse_iterator(end()); }
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_; }

void clear()
{
sentinel_.next= &sentinel_;
sentinel_.prev= &sentinel_;
size_= 0;
}

iterator insert(iterator pos, reference value)
{
ListNode *curr= pos.node_;
ListNode *prev= pos.node_->prev;

prev->next= &value;
curr->prev= &value;

static_cast<ListNode &>(value).prev= prev;
static_cast<ListNode &>(value).next= curr;

++size_;
return iterator(&value);
}

iterator erase(iterator pos)
{
ListNode *prev= pos.node_->prev;
ListNode *next= pos.node_->next;

prev->next= next;
next->prev= prev;

// This is not required for list functioning. But maybe it'll prevent bugs
// and ease debugging.
ListNode *curr= pos.node_;
curr->prev= NULL;
curr->next= NULL;

--size_;
return next;
}

void push_back(reference value) { insert(end(), value); }
void pop_back() { erase(end()); }

void push_front(reference value) { insert(begin(), value); }
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.
void remove(reference value) { erase(iterator(&value)); }

private:
ListNode sentinel_;
size_type size_;
};

} // namespace intrusive
@@ -2847,16 +2847,16 @@ drop table t1;
# MDEV-20922: Adding an order by changes the query results
#
CREATE TABLE t1(a int, b int);
INSERT INTO t1 values (1, 100), (2, 200), (3, 100), (4, 200);
INSERT INTO t1 values (1, 100), (2, 200), (3, 100), (4, 200), (5, 200);
create view v1 as select a, b+1 as x from t1;
SELECT x, COUNT(DISTINCT a) AS y FROM v1 GROUP BY x ORDER BY y;
x y
101 2
201 2
201 3
SELECT b+1 AS x, COUNT(DISTINCT a) AS y FROM t1 GROUP BY x ORDER BY y;
x y
101 2
201 2
201 3
drop view v1;
drop table t1;
#
@@ -1959,7 +1959,7 @@ drop table t1;
--echo #

CREATE TABLE t1(a int, b int);
INSERT INTO t1 values (1, 100), (2, 200), (3, 100), (4, 200);
INSERT INTO t1 values (1, 100), (2, 200), (3, 100), (4, 200), (5, 200);

create view v1 as select a, b+1 as x from t1;

@@ -2,6 +2,10 @@
-- source include/have_file_key_management_plugin.inc
# embedded does not support restart
-- source include/not_embedded.inc
# MDEV-20839 innodb-redo-badkey sporadically fails on buildbot with page dump
# We only require a debug build to avoid getting page dumps, making use of
# MDEV-19766: Disable page dump output in debug builds
-- source include/have_debug.inc

call mtr.add_suppression("Plugin 'file_key_management'");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error.");
@@ -16,6 +16,30 @@ col_1 TEXT
) ENGINE=INNODB ROW_FORMAT=COMPACT;
Warnings:
Warning 139 Row size too large (> 8126). 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.
TRUNCATE TABLE t1;
Warnings:
Warning 139 Row size too large (> 8126). 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.
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
Warnings:
Warning 139 Row size too large (> 8126). 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.
ALTER TABLE t1 FORCE;
Warnings:
Warning 139 Row size too large (> 8126). 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.
SET innodb_strict_mode = ON;
TRUNCATE TABLE t1;
Warnings:
Warning 139 Row size too large (> 8126). 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.
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
Warnings:
Warning 139 Row size too large (> 8126). 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.
ALTER TABLE t1 FORCE;
Warnings:
Warning 139 Row size too large (> 8126). 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;
SET @@global.log_warnings = 2;
SET innodb_strict_mode = 1;
@@ -139,6 +139,7 @@ CHECK TABLE t1;
DROP TABLE t1;

SET @save_algo = @@GLOBAL.innodb_compression_algorithm;
--error 0,ER_WRONG_VALUE_FOR_VAR
SET GLOBAL innodb_compression_algorithm=2;
CREATE TABLE t1(a SERIAL) PAGE_COMPRESSED=1 ENGINE=InnoDB;
INSERT INTO t1 VALUES(1);
@@ -170,7 +171,7 @@ INSERT INTO t1 VALUES(2);
SELECT * FROM t1;


--error 0,1231
--error 0,ER_WRONG_VALUE_FOR_VAR
SET GLOBAL innodb_compression_algorithm=3;
FLUSH TABLE t1 FOR EXPORT;
--echo # List before copying files
@@ -18,7 +18,15 @@ CREATE TABLE t1 (
,col_10 TEXT
,col_11 TEXT
) ENGINE=INNODB ROW_FORMAT=COMPACT;
--enable_warnings
TRUNCATE TABLE t1;
OPTIMIZE TABLE t1;
ALTER TABLE t1 FORCE;
SET innodb_strict_mode = ON;
TRUNCATE TABLE t1;
OPTIMIZE TABLE t1;
ALTER TABLE t1 FORCE;
DROP TABLE t1;
--disable_warnings

SET @@global.log_warnings = 2;
SET innodb_strict_mode = 1;
@@ -4,7 +4,7 @@ use My::Platform;

@ISA = qw(My::Suite);

if (-d '../sql') {
if (-d '../sql' && !&::using_extern()) {
my $src = "$::bindir/plugin/auth_pam/auth_pam_tool";
my $dst = "$::plugindir/auth_pam_tool_dir/auth_pam_tool";
::mkpath( "$::plugindir/auth_pam_tool_dir");
@@ -170,6 +170,9 @@ SELECT @@global.wsrep_slave_threads;
SELECT @@global.wsrep_cluster_address;
@@global.wsrep_cluster_address

SELECT @@global.wsrep_on;
@@global.wsrep_on
1
SHOW STATUS LIKE 'threads_connected';
Variable_name Value
Threads_connected 1
@@ -183,6 +186,9 @@ SELECT @@global.wsrep_provider;
SELECT @@global.wsrep_cluster_address;
@@global.wsrep_cluster_address

SELECT @@global.wsrep_on;
@@global.wsrep_on
1
SHOW STATUS LIKE 'threads_connected';
Variable_name Value
Threads_connected 1
@@ -210,6 +216,9 @@ SELECT @@global.wsrep_provider;
SELECT @@global.wsrep_cluster_address;
@@global.wsrep_cluster_address
gcomm://
SELECT @@global.wsrep_on;
@@global.wsrep_on
1
SHOW STATUS LIKE 'threads_connected';
Variable_name Value
Threads_connected 1
@@ -79,6 +79,7 @@ eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
SELECT @@global.wsrep_provider;
SELECT @@global.wsrep_slave_threads;
SELECT @@global.wsrep_cluster_address;
SELECT @@global.wsrep_on;
SHOW STATUS LIKE 'threads_connected';
SHOW STATUS LIKE 'wsrep_thread_count';
--echo
@@ -90,6 +91,7 @@ eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
--replace_regex /.*libgalera_smm.*/libgalera_smm.so/
SELECT @@global.wsrep_provider;
SELECT @@global.wsrep_cluster_address;
SELECT @@global.wsrep_on;
SHOW STATUS LIKE 'threads_connected';
SHOW STATUS LIKE 'wsrep_thread_count';
--echo
@@ -112,6 +114,7 @@ SELECT VARIABLE_VALUE AS EXPECT_2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VA
--replace_regex /.*libgalera_smm.*/libgalera_smm.so/
SELECT @@global.wsrep_provider;
SELECT @@global.wsrep_cluster_address;
SELECT @@global.wsrep_on;
SHOW STATUS LIKE 'threads_connected';
SHOW STATUS LIKE 'wsrep_thread_count';
--echo
@@ -134,6 +137,7 @@ SHOW STATUS LIKE 'threads_connected';
#
set wsrep_on=0;
set wsrep_on=1;
--source include/wait_until_connected_again.inc
create user test@localhost;
connect con1,localhost,test;
set auto_increment_increment=10;
@@ -2546,7 +2546,7 @@ static void fil_crypt_rotation_list_fill()
}
}

UT_LIST_ADD_LAST(fil_system.rotation_list, space);
fil_system.rotation_list.push_back(*space);
}
}

0 comments on commit 68fe5f5

Please sign in to comment.