Commit ec28f953 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-19740: Fix C++11 violations caught by GCC 9.2.1

parent 0b20b9e9
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#define SQL_ITEM_INCLUDED #define SQL_ITEM_INCLUDED
/* Copyright (c) 2000, 2017, Oracle and/or its affiliates. /* Copyright (c) 2000, 2017, Oracle and/or its affiliates.
Copyright (c) 2009, 2018, MariaDB Corporation Copyright (c) 2009, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -651,7 +651,6 @@ class Item: public Value_source, ...@@ -651,7 +651,6 @@ class Item: public Value_source,
public Type_std_attributes, public Type_std_attributes,
public Type_handler public Type_handler
{ {
void operator=(Item &);
/** /**
The index in the JOIN::join_tab array of the JOIN_TAB this Item is attached The index in the JOIN::join_tab array of the JOIN_TAB this Item is attached
to. Items are attached (or 'pushed') to JOIN_TABs during optimization by the to. Items are attached (or 'pushed') to JOIN_TABs during optimization by the
......
#ifndef INCLUDES_MYSQL_SQL_LIST_H #ifndef INCLUDES_MYSQL_SQL_LIST_H
#define INCLUDES_MYSQL_SQL_LIST_H #define INCLUDES_MYSQL_SQL_LIST_H
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. /* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
Copyright (c) 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -86,6 +87,14 @@ class SQL_I_List :public Sql_alloc ...@@ -86,6 +87,14 @@ class SQL_I_List :public Sql_alloc
next= elements ? tmp.next : &first; next= elements ? tmp.next : &first;
} }
SQL_I_List& operator=(const SQL_I_List &tmp)
{
elements= tmp.elements;
first= tmp.first;
next= tmp.next;
return *this;
}
inline void empty() inline void empty()
{ {
elements= 0; elements= 0;
...@@ -176,6 +185,13 @@ class base_list :public Sql_alloc ...@@ -176,6 +185,13 @@ class base_list :public Sql_alloc
first == rhs.first && first == rhs.first &&
last == rhs.last; last == rhs.last;
} }
base_list& operator=(const base_list &rhs)
{
elements= rhs.elements;
first= rhs.first;
last= elements ? rhs.last : &first;
return *this;
}
inline void empty() { elements=0; first= &end_of_list; last=&first;} inline void empty() { elements=0; first= &end_of_list; last=&first;}
inline base_list() { empty(); } inline base_list() { empty(); }
...@@ -190,9 +206,7 @@ class base_list :public Sql_alloc ...@@ -190,9 +206,7 @@ class base_list :public Sql_alloc
*/ */
inline base_list(const base_list &tmp) :Sql_alloc() inline base_list(const base_list &tmp) :Sql_alloc()
{ {
elements= tmp.elements; *this= tmp;
first= tmp.first;
last= elements ? tmp.last : &first;
} }
/** /**
Construct a deep copy of the argument in memory root mem_root. Construct a deep copy of the argument in memory root mem_root.
...@@ -202,7 +216,7 @@ class base_list :public Sql_alloc ...@@ -202,7 +216,7 @@ class base_list :public Sql_alloc
*/ */
bool copy(const base_list *rhs, MEM_ROOT *mem_root); bool copy(const base_list *rhs, MEM_ROOT *mem_root);
base_list(const base_list &rhs, MEM_ROOT *mem_root) { copy(&rhs, mem_root); } base_list(const base_list &rhs, MEM_ROOT *mem_root) { copy(&rhs, mem_root); }
inline base_list(bool error) { } inline base_list(bool) {}
inline bool push_back(void *info) inline bool push_back(void *info)
{ {
if (((*last)=new list_node(info, &end_of_list))) if (((*last)=new list_node(info, &end_of_list)))
...@@ -523,7 +537,6 @@ template <class T> class List :public base_list ...@@ -523,7 +537,6 @@ template <class T> class List :public base_list
{ {
public: public:
inline List() :base_list() {} inline List() :base_list() {}
inline List(const List<T> &tmp) :base_list(tmp) {}
inline List(const List<T> &tmp, MEM_ROOT *mem_root) : inline List(const List<T> &tmp, MEM_ROOT *mem_root) :
base_list(tmp, mem_root) {} base_list(tmp, mem_root) {}
inline bool push_back(T *a) { return base_list::push_back(a); } inline bool push_back(T *a) { return base_list::push_back(a); }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment