From: Date: September 10 2008 4:03pm Subject: bzr push into mysql-6.0-falcon branch (olav:2818 to 2819) Bug#39260 List-Archive: http://lists.mysql.com/commits/53695 X-Bug: 39260 Message-Id: <20080910140330.9374.qmail@khepri11> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 2819 Olav Sandstaa 2008-09-10 Bug#39260 Falcon should detect that it has been compiled without support for C++ exception During initialisation of Falcon: check that it has been compiled with support for exception. If it has not been compiled with support for exception it will write an error message and return an error status to the server. modified: storage/falcon/ha_falcon.cpp 2818 lars-erik.bjork@stripped 2008-09-10 Added assert to ensure that NULL is not secretly inserted modified: storage/falcon/ha_falcon.cpp === modified file 'storage/falcon/ha_falcon.cpp' === modified file 'storage/falcon/ha_falcon.cpp' --- a/storage/falcon/ha_falcon.cpp 2008-09-10 11:33:37 +0000 +++ b/storage/falcon/ha_falcon.cpp 2008-09-10 13:42:36 +0000 @@ -157,12 +157,34 @@ fflush(falcon_log_file); } +bool checkExceptionSupport() +{ + // Validate that the code has been compiled with support for exceptions + // by throwing and catching an exception. If the executable does not + // support exceptions we will reach the return false statement + try + { + throw 1; + } + catch (int) + { + return true; + } + return false; +} + int StorageInterface::falcon_init(void *p) { DBUG_ENTER("falcon_init"); falcon_hton = (handlerton *)p; my_bool error = false; + if (!checkExceptionSupport()) + { + sql_print_error("Falcon must be compiled with C++ exceptions enabled to work"); + DBUG_RETURN(1); + } + StorageHandler::setDataDirectory(mysql_real_data_home); storageHandler = getFalconStorageHandler(sizeof(THR_LOCK));