Bug #49365 empty throw in delete for sp_head breaks GCC 2.9.6 systems
Submitted: 2 Dec 2009 20:10 Modified: 3 Dec 2009 7:18
Reporter: Todd Rinaldo Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.1.41 OS:Linux
Assigned to: CPU Architecture:Any
Tags: Contribution

[2 Dec 2009 20:10] Todd Rinaldo
Description:
Due to a bug in GCC 2.96, the compiler does not recognize the 2 argument delete definition if it has an throw on the end of it. The other solution is to remove "size_t size" since I think it's not even used. 

Since an empty throw is unnecessary, I'd request it be removed from the source. This is the only thing preventing MySQL 5.1 from compiling on these systems

How to repeat:
compile MySQL 5.1 on Redhat 9

Suggested fix:
patch as below from 5.1.41 code:

diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index f0c858c..fb4378e 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -489,7 +489,7 @@ sp_head::operator new(size_t size) throw()
 }
 
 void 
-sp_head::operator delete(void *ptr, size_t size) throw()
+sp_head::operator delete(void *ptr, size_t size)
 {
   DBUG_ENTER("sp_head::operator delete");
   MEM_ROOT own_root;
diff --git a/sql/sp_head.h b/sql/sp_head.h
index dd11f86..8d5ca86 100644
--- a/sql/sp_head.h
+++ b/sql/sp_head.h
@@ -264,7 +264,7 @@ public:
   operator new(size_t size) throw ();
 
   static void
-  operator delete(void *ptr, size_t size) throw ();
+  operator delete(void *ptr, size_t size);
 
   sp_head();
[2 Dec 2009 21:17] Valeriy Kravchuk
I'd say that this is a duplicate of your bug #49363 (just for a different version, 5.1.x). Do you agree?
[2 Dec 2009 21:28] Todd Rinaldo
This is the same fix I submitted for 5.0.88. I assumed but have not checked that the patch is slightly different based on location of delete in the file. This source is maintained separately for 5.0 and 5.1 right?
[3 Dec 2009 7:18] Valeriy Kravchuk
OK, so this is a duplicate that differs in target server version and line numbers in the patch.