#At file:///home/os136802/mysql/develop/repo/falcon-sunstudio/
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
per-file messages:
storage/falcon/ha_falcon.cpp
During initialisation: check that Falcon 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 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));