diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/intrusive_list.h | 190 | ||||
-rw-r--r-- | include/lf.h | 1 | ||||
-rw-r--r-- | include/mysql/psi/mysql_file.h | 13 | ||||
-rw-r--r-- | include/mysql/psi/mysql_idle.h | 13 | ||||
-rw-r--r-- | include/mysql/psi/mysql_socket.h | 18 | ||||
-rw-r--r-- | include/mysql/psi/mysql_stage.h | 13 | ||||
-rw-r--r-- | include/mysql/psi/mysql_statement.h | 13 | ||||
-rw-r--r-- | include/mysql/psi/mysql_table.h | 13 | ||||
-rw-r--r-- | include/mysql/psi/mysql_thread.h | 13 | ||||
-rw-r--r-- | include/mysql/psi/psi.h | 13 | ||||
-rw-r--r-- | include/mysql/psi/psi_abi_v0.h | 13 | ||||
-rw-r--r-- | include/mysql/psi/psi_abi_v1.h | 13 | ||||
-rw-r--r-- | include/mysql/psi/psi_abi_v2.h | 13 | ||||
-rw-r--r-- | include/sslopt-case.h | 2 |
14 files changed, 303 insertions, 38 deletions
diff --git a/include/intrusive_list.h b/include/intrusive_list.h new file mode 100644 index 00000000000..d745c6c6c62 --- /dev/null +++ b/include/intrusive_list.h @@ -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 diff --git a/include/lf.h b/include/lf.h index e4cad7eabb3..10a60c5c949 100644 --- a/include/lf.h +++ b/include/lf.h @@ -65,7 +65,6 @@ typedef struct { typedef struct { void * volatile pin[LF_PINBOX_PINS]; LF_PINBOX *pinbox; - void **stack_ends_here; void *purgatory; uint32 purgatory_count; uint32 volatile link; diff --git a/include/mysql/psi/mysql_file.h b/include/mysql/psi/mysql_file.h index a206003ad7f..1d2ec34fc98 100644 --- a/include/mysql/psi/mysql_file.h +++ b/include/mysql/psi/mysql_file.h @@ -1,13 +1,20 @@ /* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. 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. + it under the terms of the GNU General Public License, version 2.0, + as published by the Free Software Foundation. + + This program is also distributed with certain software (including + but not limited to OpenSSL) that is licensed under separate terms, + as designated in a particular file or component or in included license + documentation. The authors of MySQL hereby grant you an additional + permission to link the program and your derivative works with the + separately licensed software that they have included with MySQL. 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. + GNU General Public License, version 2.0, 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, diff --git a/include/mysql/psi/mysql_idle.h b/include/mysql/psi/mysql_idle.h index e60da6953df..1eb19f8f684 100644 --- a/include/mysql/psi/mysql_idle.h +++ b/include/mysql/psi/mysql_idle.h @@ -2,13 +2,20 @@ Copyright (c) 2017, 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 - the Free Software Foundation; version 2 of the License. + it under the terms of the GNU General Public License, version 2.0, + as published by the Free Software Foundation. + + This program is also distributed with certain software (including + but not limited to OpenSSL) that is licensed under separate terms, + as designated in a particular file or component or in included license + documentation. The authors of MySQL hereby grant you an additional + permission to link the program and your derivative works with the + separately licensed software that they have included with MySQL. 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. + GNU General Public License, version 2.0, 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, diff --git a/include/mysql/psi/mysql_socket.h b/include/mysql/psi/mysql_socket.h index 086df145e59..1277b97a52a 100644 --- a/include/mysql/psi/mysql_socket.h +++ b/include/mysql/psi/mysql_socket.h @@ -1,15 +1,21 @@ /* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2017, 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 the Free Software Foundation; version 2 of the -License. +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License, version 2.0, +as published by the Free Software Foundation. + +This program is also distributed with certain software (including +but not limited to OpenSSL) that is licensed under separate terms, +as designated in a particular file or component or in included license +documentation. The authors of MySQL hereby grant you an additional +permission to link the program and your derivative works with the +separately licensed software that they have included with MySQL. 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. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License, version 2.0, 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 diff --git a/include/mysql/psi/mysql_stage.h b/include/mysql/psi/mysql_stage.h index b6ab09fef55..1dbaed6c682 100644 --- a/include/mysql/psi/mysql_stage.h +++ b/include/mysql/psi/mysql_stage.h @@ -1,13 +1,20 @@ /* Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. 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. + it under the terms of the GNU General Public License, version 2.0, + as published by the Free Software Foundation. + + This program is also distributed with certain software (including + but not limited to OpenSSL) that is licensed under separate terms, + as designated in a particular file or component or in included license + documentation. The authors of MySQL hereby grant you an additional + permission to link the program and your derivative works with the + separately licensed software that they have included with MySQL. 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. + GNU General Public License, version 2.0, 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 diff --git a/include/mysql/psi/mysql_statement.h b/include/mysql/psi/mysql_statement.h index 509c9371fe1..6d38131ea99 100644 --- a/include/mysql/psi/mysql_statement.h +++ b/include/mysql/psi/mysql_statement.h @@ -2,13 +2,20 @@ Copyright (c) 2017, 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 - the Free Software Foundation; version 2 of the License. + it under the terms of the GNU General Public License, version 2.0, + as published by the Free Software Foundation. + + This program is also distributed with certain software (including + but not limited to OpenSSL) that is licensed under separate terms, + as designated in a particular file or component or in included license + documentation. The authors of MySQL hereby grant you an additional + permission to link the program and your derivative works with the + separately licensed software that they have included with MySQL. 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. + GNU General Public License, version 2.0, 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 diff --git a/include/mysql/psi/mysql_table.h b/include/mysql/psi/mysql_table.h index 104f8567b5b..c1244e38866 100644 --- a/include/mysql/psi/mysql_table.h +++ b/include/mysql/psi/mysql_table.h @@ -2,13 +2,20 @@ Copyright (c) 2017, 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 - the Free Software Foundation; version 2 of the License. + it under the terms of the GNU General Public License, version 2.0, + as published by the Free Software Foundation. + + This program is also distributed with certain software (including + but not limited to OpenSSL) that is licensed under separate terms, + as designated in a particular file or component or in included license + documentation. The authors of MySQL hereby grant you an additional + permission to link the program and your derivative works with the + separately licensed software that they have included with MySQL. 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. + GNU General Public License, version 2.0, 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, diff --git a/include/mysql/psi/mysql_thread.h b/include/mysql/psi/mysql_thread.h index 9a987cf992b..eab87402140 100644 --- a/include/mysql/psi/mysql_thread.h +++ b/include/mysql/psi/mysql_thread.h @@ -1,13 +1,20 @@ /* Copyright (c) 2008, 2013, Oracle and/or its affiliates. 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. + it under the terms of the GNU General Public License, version 2.0, + as published by the Free Software Foundation. + + This program is also distributed with certain software (including + but not limited to OpenSSL) that is licensed under separate terms, + as designated in a particular file or component or in included license + documentation. The authors of MySQL hereby grant you an additional + permission to link the program and your derivative works with the + separately licensed software that they have included with MySQL. 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. + GNU General Public License, version 2.0, 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, diff --git a/include/mysql/psi/psi.h b/include/mysql/psi/psi.h index 8f412982ae2..238471c7af1 100644 --- a/include/mysql/psi/psi.h +++ b/include/mysql/psi/psi.h @@ -1,13 +1,20 @@ /* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. 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. + it under the terms of the GNU General Public License, version 2.0, + as published by the Free Software Foundation. + + This program is also distributed with certain software (including + but not limited to OpenSSL) that is licensed under separate terms, + as designated in a particular file or component or in included license + documentation. The authors of MySQL hereby grant you an additional + permission to link the program and your derivative works with the + separately licensed software that they have included with MySQL. 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. + GNU General Public License, version 2.0, 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, diff --git a/include/mysql/psi/psi_abi_v0.h b/include/mysql/psi/psi_abi_v0.h index 0601b61a5c7..ca4373f847b 100644 --- a/include/mysql/psi/psi_abi_v0.h +++ b/include/mysql/psi/psi_abi_v0.h @@ -1,13 +1,20 @@ /* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 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. + it under the terms of the GNU General Public License, version 2.0, + as published by the Free Software Foundation. + + This program is also distributed with certain software (including + but not limited to OpenSSL) that is licensed under separate terms, + as designated in a particular file or component or in included license + documentation. The authors of MySQL hereby grant you an additional + permission to link the program and your derivative works with the + separately licensed software that they have included with MySQL. 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. + GNU General Public License, version 2.0, 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, diff --git a/include/mysql/psi/psi_abi_v1.h b/include/mysql/psi/psi_abi_v1.h index 2d5e81f5972..488e832c3ed 100644 --- a/include/mysql/psi/psi_abi_v1.h +++ b/include/mysql/psi/psi_abi_v1.h @@ -1,13 +1,20 @@ /* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. 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. + it under the terms of the GNU General Public License, version 2.0, + as published by the Free Software Foundation. + + This program is also distributed with certain software (including + but not limited to OpenSSL) that is licensed under separate terms, + as designated in a particular file or component or in included license + documentation. The authors of MySQL hereby grant you an additional + permission to link the program and your derivative works with the + separately licensed software that they have included with MySQL. 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. + GNU General Public License, version 2.0, 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, diff --git a/include/mysql/psi/psi_abi_v2.h b/include/mysql/psi/psi_abi_v2.h index 420cc63fc13..67c054848a1 100644 --- a/include/mysql/psi/psi_abi_v2.h +++ b/include/mysql/psi/psi_abi_v2.h @@ -1,13 +1,20 @@ /* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. 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. + it under the terms of the GNU General Public License, version 2.0, + as published by the Free Software Foundation. + + This program is also distributed with certain software (including + but not limited to OpenSSL) that is licensed under separate terms, + as designated in a particular file or component or in included license + documentation. The authors of MySQL hereby grant you an additional + permission to link the program and your derivative works with the + separately licensed software that they have included with MySQL. 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. + GNU General Public License, version 2.0, 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, diff --git a/include/sslopt-case.h b/include/sslopt-case.h index fe53088e89b..fe83051c275 100644 --- a/include/sslopt-case.h +++ b/include/sslopt-case.h @@ -30,7 +30,7 @@ */ opt_use_ssl= 1; /* crl has no effect in yaSSL */ -#ifdef HAVE_YASSL +#if defined (HAVE_YASSL) && (!defined (_WIN32) || defined (MYSQL_SERVER)) opt_ssl_crl= NULL; opt_ssl_crlpath= NULL; #endif |