Commit e22b271b authored by Sergei Petrunia's avatar Sergei Petrunia

MariaRocks port: compilation fixes

parent 86d963eb
......@@ -3275,7 +3275,7 @@ class Field_blob :public Field_longstr {
memcpy(ptr,length,packlength);
memcpy(ptr+packlength, &data,sizeof(char*));
}
void set_ptr_offset(my_ptrdiff_t ptr_diff, uint32 length, uchar *data)
void set_ptr_offset(my_ptrdiff_t ptr_diff, uint32 length, const uchar *data)
{
uchar *ptr_ofs= ADD_TO_PTR(ptr,ptr_diff,uchar*);
store_length(ptr_ofs, packlength, length);
......
......@@ -4,7 +4,7 @@ IF (NOT EXISTS "${CMAKE_SOURCE_DIR}/storage/rocksdb/rocksdb/Makefile")
MESSAGE(SEND_ERROR "Missing Makefile in rocksdb directory. Try \"git submodule update\".")
ENDIF()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -frtti")
# get a list of rocksdb library source files
# run with env -i to avoid passing variables
......@@ -36,6 +36,9 @@ ADD_DEFINITIONS(-DROCKSDB_PLATFORM_POSIX -DROCKSDB_LIB_IO_POSIX -DOS_LINUX
# (facebook/mysql-5.6 just compiles everything without -f*rtti, which means
# everything is compiled with -frtti)
#
# (also had to add -frtti above, because something that event_listener.cc
# includes requires it. So, now everything in MariaRocks is compiled with
# -frtti)
set_source_files_properties(${ROCKSDB_LIB_SOURCES} PROPERTIES COMPILE_FLAGS -frtti)
SET(ROCKSDB_SOURCES
......
......@@ -10780,7 +10780,7 @@ double ha_rocksdb::read_time(uint index, uint ranges, ha_rows rows)
struct st_mysql_storage_engine rocksdb_storage_engine=
{ MYSQL_HANDLERTON_INTERFACE_VERSION };
mysql_declare_plugin(rocksdb_se)
maria_declare_plugin(rocksdb_se)
{
MYSQL_STORAGE_ENGINE_PLUGIN, /* Plugin Type */
&rocksdb_storage_engine, /* Plugin Descriptor */
......@@ -10793,8 +10793,8 @@ mysql_declare_plugin(rocksdb_se)
0x0001, /* version number (0.1) */
myrocks::rocksdb_status_vars, /* status variables */
myrocks::rocksdb_system_variables, /* system variables */
nullptr, /* config options */
0, /* flags */
"1.0", /* string version */
MariaDB_PLUGIN_MATURITY_ALPHA /* maturity */
},
myrocks::rdb_i_s_cfstats,
myrocks::rdb_i_s_dbstats,
......@@ -10804,4 +10804,4 @@ myrocks::rdb_i_s_cfoptions,
myrocks::rdb_i_s_global_info,
myrocks::rdb_i_s_ddl,
myrocks::rdb_i_s_index_file_map
mysql_declare_plugin_end;
maria_declare_plugin_end;
......@@ -1052,7 +1052,7 @@ static int rdb_i_s_deinit(void *p __attribute__((__unused__)))
static struct st_mysql_information_schema rdb_i_s_info=
{ MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION };
struct st_mysql_plugin rdb_i_s_cfstats=
struct st_maria_plugin rdb_i_s_cfstats=
{
MYSQL_INFORMATION_SCHEMA_PLUGIN,
&rdb_i_s_info,
......@@ -1069,7 +1069,7 @@ struct st_mysql_plugin rdb_i_s_cfstats=
0, /* flags */
};
struct st_mysql_plugin rdb_i_s_dbstats=
struct st_maria_plugin rdb_i_s_dbstats=
{
MYSQL_INFORMATION_SCHEMA_PLUGIN,
&rdb_i_s_info,
......@@ -1086,7 +1086,7 @@ struct st_mysql_plugin rdb_i_s_dbstats=
0, /* flags */
};
struct st_mysql_plugin rdb_i_s_perf_context=
struct st_maria_plugin rdb_i_s_perf_context=
{
MYSQL_INFORMATION_SCHEMA_PLUGIN,
&rdb_i_s_info,
......@@ -1103,7 +1103,7 @@ struct st_mysql_plugin rdb_i_s_perf_context=
0, /* flags */
};
struct st_mysql_plugin rdb_i_s_perf_context_global=
struct st_maria_plugin rdb_i_s_perf_context_global=
{
MYSQL_INFORMATION_SCHEMA_PLUGIN,
&rdb_i_s_info,
......@@ -1120,7 +1120,7 @@ struct st_mysql_plugin rdb_i_s_perf_context_global=
0, /* flags */
};
struct st_mysql_plugin rdb_i_s_cfoptions=
struct st_maria_plugin rdb_i_s_cfoptions=
{
MYSQL_INFORMATION_SCHEMA_PLUGIN,
&rdb_i_s_info,
......@@ -1137,7 +1137,7 @@ struct st_mysql_plugin rdb_i_s_cfoptions=
0, /* flags */
};
struct st_mysql_plugin rdb_i_s_global_info=
struct st_maria_plugin rdb_i_s_global_info=
{
MYSQL_INFORMATION_SCHEMA_PLUGIN,
&rdb_i_s_info,
......@@ -1154,7 +1154,7 @@ struct st_mysql_plugin rdb_i_s_global_info=
0, /* flags */
};
struct st_mysql_plugin rdb_i_s_ddl=
struct st_maria_plugin rdb_i_s_ddl=
{
MYSQL_INFORMATION_SCHEMA_PLUGIN,
&rdb_i_s_info,
......@@ -1171,7 +1171,7 @@ struct st_mysql_plugin rdb_i_s_ddl=
0, /* flags */
};
struct st_mysql_plugin rdb_i_s_index_file_map=
struct st_maria_plugin rdb_i_s_index_file_map=
{
MYSQL_INFORMATION_SCHEMA_PLUGIN,
&rdb_i_s_info,
......
......@@ -21,14 +21,14 @@ namespace myrocks {
Declare INFORMATION_SCHEMA (I_S) plugins needed by MyRocks storage engine.
*/
extern struct st_mysql_plugin rdb_i_s_cfstats;
extern struct st_mysql_plugin rdb_i_s_dbstats;
extern struct st_mysql_plugin rdb_i_s_perf_context;
extern struct st_mysql_plugin rdb_i_s_perf_context_global;
extern struct st_mysql_plugin rdb_i_s_cfoptions;
extern struct st_mysql_plugin rdb_i_s_global_info;
extern struct st_mysql_plugin rdb_i_s_ddl;
extern struct st_mysql_plugin rdb_i_s_index_file_map;
extern struct st_maria_plugin rdb_i_s_cfstats;
extern struct st_maria_plugin rdb_i_s_dbstats;
extern struct st_maria_plugin rdb_i_s_perf_context;
extern struct st_maria_plugin rdb_i_s_perf_context_global;
extern struct st_maria_plugin rdb_i_s_cfoptions;
extern struct st_maria_plugin rdb_i_s_global_info;
extern struct st_maria_plugin rdb_i_s_ddl;
extern struct st_maria_plugin rdb_i_s_index_file_map;
} // namespace myrocks
......@@ -19,10 +19,17 @@
/* This C++ file's header file */
#include "./rdb_mutex_wrapper.h"
/* The following are for THD_ENTER_COND: */
#define MYSQL_SERVER 1
#include "sql_priv.h"
#include "my_decimal.h"
#include "sql_class.h"
/* MyRocks header files */
#include "./ha_rocksdb.h"
#include "./rdb_utils.h"
// Internal MySQL APIs not exposed in any header.
extern "C"
{
......@@ -92,8 +99,8 @@ Rdb_cond_var::WaitFor(std::shared_ptr<TransactionDBMutex> mutex_arg,
if (current_thd && mutex_obj->m_old_stage_info.count(current_thd) == 0)
{
my_core::thd_enter_cond(current_thd, &m_cond, mutex_ptr,
&stage_waiting_on_row_lock2, &old_stage);
THD_ENTER_COND(current_thd, &m_cond, mutex_ptr,
&stage_waiting_on_row_lock2, &old_stage);
/*
After the mysql_cond_timedwait we need make this call
......@@ -226,7 +233,7 @@ void Rdb_mutex::UnLock() {
std::shared_ptr<PSI_stage_info> old_stage = m_old_stage_info[current_thd];
m_old_stage_info.erase(current_thd);
/* The following will call mysql_mutex_unlock */
my_core::thd_exit_cond(current_thd, old_stage.get());
THD_EXIT_COND(current_thd, old_stage.get());
return;
}
#endif
......
......@@ -3,6 +3,7 @@
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory.
//
#include <my_config.h>
#include "rocksdb/ldb_tool.h"
#include "../rdb_comparator.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment