From: Rafal Somla Date: October 18 2012 11:04am Subject: bzr push into mysql-trunk branch (rafal.somla:4730 to 4731) List-Archive: http://lists.mysql.com/commits/145097 Message-Id: <201210181105.q9IB558l005223@acsmt357.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 4731 Rafal Somla 2012-10-18 Fix for linux build. modified: libmysql/test_trace_plugin.cc 4730 Rafal Somla 2012-10-17 WL#6226 - initial patch - work in progress... added: include/mysql/plugin_trace.h libmysql/mysql_trace.c libmysql/mysql_trace.h libmysql/test_trace_plugin.cc modified: CMakeLists.txt include/mysql/client_plugin.h include/sql_common.h libmysql/CMakeLists.txt libmysql/libmysql.c sql-common/client.c sql-common/client_plugin.c === modified file 'libmysql/test_trace_plugin.cc' --- a/libmysql/test_trace_plugin.cc 2012-10-17 13:22:15 +0000 +++ b/libmysql/test_trace_plugin.cc 2012-10-18 11:02:55 +0000 @@ -5,8 +5,8 @@ Test trace plugin =========================== - If TEST_TRACE_PLUGIN build option was checked when building libmysql then - this plugin is built into client library (no plugin loading required). + If WITH_TEST_TRACE_PLUGIN build option was checked when building libmysql + then this plugin is built into client library (no plugin loading required). The plugin follows the protocol flow based on the trace evnets reported to it. If MYSQL_TEST_TRACE_DEBUG environment variable is non-zero then it logs @@ -47,10 +47,18 @@ static int plugin_deinit(); } -} // namespace test_trace_ns +} // namespace test_trace + +extern "C" { + +/* + Test_trace_plugin symbol is to be used by C code (client.c) and thus it + is declared inside extern "C" to avoid C++ name mangling problems. Current + C++ compilers do not mangle data symbol names but to be on the safe side + we explicitly declare it as extern "C". +*/ -extern "C" struct st_mysql_client_plugin_TRACE test_trace_plugin= { MYSQL_CLIENT_TRACE_PLUGIN, @@ -69,6 +77,7 @@ struct st_mysql_client_plugin_TRACE test test_trace::trace_event }; +} namespace test_trace { @@ -267,12 +276,6 @@ void Logger::send() } -#define OK_PACKET(PKT) (*((byte*)PKT) == 0x00) -#define ERR_PACKET(PKT) (*((byte*)PKT) == 0xFF) -#define EOF_PACKET(PKT) (*((byte*)PKT) == 0xFE) -#define FILE_REQUEST(PKT) (*((byte*)PKT) == 0xFB) - - /** The "top-level" logger used when no connection context is given. */ @@ -327,6 +330,12 @@ plugin_deinit() ========================== */ +#define OK_PACKET(PKT) (*((byte*)PKT) == 0x00) +#define ERR_PACKET(PKT) (*((byte*)PKT) == 0xFF) +#define EOF_PACKET(PKT) (*((byte*)PKT) == 0xFE) +#define FILE_REQUEST(PKT) (*((byte*)PKT) == 0xFB) + + void* trace_start(struct st_mysql_client_plugin_TRACE *self, MYSQL *conn, enum protocol_stage stage) No bundle (reason: useless for push emails).