Commit 425304f5 authored by unknown's avatar unknown

BUG#26625: crash in range optimizer (out of mem)

- Define Sql_alloc::operator new() as thow() so that C++ compiler
  handles NULL return values
(there is no testcase as there is no portable way to set limit on the 
amount of memory that a process can allocate)


sql/sql_list.h:
  BUG#26625: crash in range optimizer (out of mem) 
  - Define Sql_alloc::operator new() as thow() so that C++ compiler
    handles NULL return values
parent 3335f68d
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
class Sql_alloc class Sql_alloc
{ {
public: public:
static void *operator new(size_t size) static void *operator new(size_t size) throw ()
{ {
return (void*) sql_alloc((uint) size); return (void*) sql_alloc((uint) size);
} }
...@@ -38,7 +38,7 @@ public: ...@@ -38,7 +38,7 @@ public:
{ {
return (void*) sql_alloc((uint) size); return (void*) sql_alloc((uint) size);
} }
static void *operator new(size_t size, MEM_ROOT *mem_root) static void *operator new(size_t size, MEM_ROOT *mem_root) throw ()
{ return (void*) alloc_root(mem_root, (uint) size); } { return (void*) alloc_root(mem_root, (uint) size); }
static void operator delete(void *ptr, size_t size) { TRASH(ptr, size); } static void operator delete(void *ptr, size_t size) { TRASH(ptr, size); }
static void operator delete(void *ptr, MEM_ROOT *mem_root) static void operator delete(void *ptr, MEM_ROOT *mem_root)
......
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