Commit 1203b658 authored by Sergei Golubchik's avatar Sergei Golubchik

compilation fixes for sys-devel/gcc-11.2.0:11

for example:

sql/sql_prepare.cc:5714:63: error: 'static void Ed_result_set::operator delete(void*, MEM_ROOT*)' called on pointer returned from a mismatched allocation function [-Werror=mismatched-new-delete]
parent 657bcf92
...@@ -39,7 +39,7 @@ class JOIN; ...@@ -39,7 +39,7 @@ class JOIN;
its base class. its base class.
*/ */
class Server_side_cursor: protected Query_arena, public Sql_alloc class Server_side_cursor: protected Query_arena
{ {
protected: protected:
/** Row destination used for fetch */ /** Row destination used for fetch */
...@@ -61,6 +61,8 @@ class Server_side_cursor: protected Query_arena, public Sql_alloc ...@@ -61,6 +61,8 @@ class Server_side_cursor: protected Query_arena, public Sql_alloc
} }
virtual ~Server_side_cursor(); virtual ~Server_side_cursor();
static void *operator new(size_t size, MEM_ROOT *mem_root)
{ return alloc_root(mem_root, size); }
static void operator delete(void *ptr, size_t size); static void operator delete(void *ptr, size_t size);
static void operator delete(void *, MEM_ROOT *){} static void operator delete(void *, MEM_ROOT *){}
}; };
......
...@@ -115,7 +115,7 @@ class Ed_row; ...@@ -115,7 +115,7 @@ class Ed_row;
automatic type conversion. automatic type conversion.
*/ */
class Ed_result_set: public Sql_alloc class Ed_result_set
{ {
public: public:
operator List<Ed_row>&() { return *m_rows; } operator List<Ed_row>&() { return *m_rows; }
...@@ -129,6 +129,8 @@ class Ed_result_set: public Sql_alloc ...@@ -129,6 +129,8 @@ class Ed_result_set: public Sql_alloc
size_t get_field_count() const { return m_column_count; } size_t get_field_count() const { return m_column_count; }
static void *operator new(size_t size, MEM_ROOT *mem_root)
{ return alloc_root(mem_root, size); }
static void operator delete(void *ptr, size_t size) throw (); static void operator delete(void *ptr, size_t size) throw ();
static void operator delete(void *, MEM_ROOT *){} static void operator delete(void *, MEM_ROOT *){}
private: private:
......
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