From ce3f182604e9949fdb03347ca4879b3b254816f7 Mon Sep 17 00:00:00 2001 From: "sergefp@mysql.com" <> Date: Wed, 28 Mar 2007 18:38:42 +0400 Subject: [PATCH] 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/sql_list.h b/sql/sql_list.h index 47379ab1ddf..2075361a398 100644 --- a/sql/sql_list.h +++ b/sql/sql_list.h @@ -30,7 +30,7 @@ class Sql_alloc { public: - static void *operator new(size_t size) + static void *operator new(size_t size) throw () { return (void*) sql_alloc((uint) size); } @@ -38,7 +38,7 @@ public: { 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); } static void operator delete(void *ptr, size_t size) { TRASH(ptr, size); } static void operator delete(void *ptr, MEM_ROOT *mem_root)