Commit 72292c18 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

refs #5195 rearrange some handlerton files

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@45857 c7de825b-a66e-492c-adef-691d508d4ae1
parent ce75d7e9
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#endif #endif
#define MYSQL_SERVER 1 #define MYSQL_SERVER 1
#include "toku_mysql_priv.h" #include "hatoku_defines.h"
#include "hatoku_cmp.h" #include "hatoku_cmp.h"
extern "C" { extern "C" {
#include "stdint.h" #include "stdint.h"
...@@ -11,7 +11,6 @@ extern "C" { ...@@ -11,7 +11,6 @@ extern "C" {
#include "misc.h" #include "misc.h"
#endif #endif
} }
#include "hatoku_assert.h"
static inline void *thd_data_get(THD *thd, int slot) { static inline void *thd_data_get(THD *thd, int slot) {
return thd->ha_data[slot].ha_ptr; return thd->ha_data[slot].ha_ptr;
...@@ -26,15 +25,12 @@ static inline void thd_data_set(THD *thd, int slot, void *data) { ...@@ -26,15 +25,12 @@ static inline void thd_data_set(THD *thd, int slot, void *data) {
#undef HAVE_DTRACE #undef HAVE_DTRACE
#undef _DTRACE_VERSION #undef _DTRACE_VERSION
//#include "tokudb_config.h"
/* We define DTRACE after mysql_priv.h in case it disabled dtrace in the main server */ /* We define DTRACE after mysql_priv.h in case it disabled dtrace in the main server */
#ifdef HAVE_DTRACE #ifdef HAVE_DTRACE
#define _DTRACE_VERSION 1 #define _DTRACE_VERSION 1
#else #else
#endif #endif
#include "hatoku_defines.h"
#include "ha_tokudb.h" #include "ha_tokudb.h"
#include "hatoku_hton.h" #include "hatoku_hton.h"
#include <mysql/plugin.h> #include <mysql/plugin.h>
...@@ -44,17 +40,6 @@ static const char *ha_tokudb_exts[] = { ...@@ -44,17 +40,6 @@ static const char *ha_tokudb_exts[] = {
NullS NullS
}; };
// In older (< 5.5) versions of MySQL and MariaDB, it is necessary to
// use a read/write lock on the key_file array in a table share,
// because table locks do not protect the race of some thread closing
// a table and another calling ha_tokudb::info()
//
// In version 5.5 and, a higher layer "metadata lock" was introduced
// to synchronize threads that open, close, call info(), etc on tables.
// In these versions, we don't need the key_file lock
#if MYSQL_VERSION_ID < 50500
#define HA_TOKUDB_NEEDS_KEY_FILE_LOCK
#endif
static void share_key_file_lock_init(TOKUDB_SHARE * share) static void share_key_file_lock_init(TOKUDB_SHARE * share)
{ {
...@@ -8071,5 +8056,4 @@ void ha_tokudb::set_dup_value_for_pk(DBT* key) { ...@@ -8071,5 +8056,4 @@ void ha_tokudb::set_dup_value_for_pk(DBT* key) {
#include "hatoku_cmp.cc" #include "hatoku_cmp.cc"
// handlerton // handlerton
#include "hatoku_hton.h"
#include "hatoku_hton.cc" #include "hatoku_hton.cc"
#if !defined(HA_TOKUDB_H) #if !defined(HA_TOKUDB_H)
#define HA_TOKUDB_H #define HA_TOKUDB_H
#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
#endif
// In MariaDB 5.3, thread progress reporting was introduced.
// Only include that functionality if we're using maria 5.3 +
#ifdef MARIADB_BASE_VERSION
#if MYSQL_VERSION_ID >= 50300
#define HA_TOKUDB_HAS_THD_PROGRESS
#endif
#endif
#if 50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699
#define TOKU_INCLUDE_ALTER_56 1
#define TOKU_INCLUDE_ROW_TYPE_COMPRESSION 0
#define TOKU_INCLUDE_XA 1
#endif
#if 50500 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50599
#define TOKU_INCLUDE_ALTER_56 1
#define TOKU_INCLUDE_ALTER_55 1
#define TOKU_INCLUDE_ROW_TYPE_COMPRESSION 1
#define TOKU_INCLUDE_XA 1
#endif
#if MYSQL_VERSION_ID < 50500
#define TOKU_INCLUDE_ALTER_51 1
#define TOKU_INCLUDE_ROW_TYPE_COMPRESSION 1
#define TOKU_INCLUDE_XA 1
#endif
#if !defined(HA_CLUSTERING)
#define HA_CLUSTERING 0
#endif
#if !defined(HA_CLUSTERED_INDEX)
#define HA_CLUSTERED_INDEX 0
#endif
#if !defined(HA_CAN_WRITE_DURING_OPTIMIZE)
#define HA_CAN_WRITE_DURING_OPTIMIZE 0
#endif
#include <db.h> #include <db.h>
#include "hatoku_cmp.h" #include "hatoku_cmp.h"
......
#ifndef TOKU_ASSERT_H
#define TOKU_ASSERT_H
/* The purpose of this file is to define assert() for use by the handlerton.
* The intention is for a failed handlerton assert to invoke a failed assert
* in the fractal tree layer, which dumps engine status to the error log.
*/
void toku_hton_assert_fail(const char*/*expr_as_string*/,const char */*fun*/,const char*/*file*/,int/*line*/, int/*errno*/) __attribute__((__visibility__("default"))) __attribute__((__noreturn__));
#undef assert
#define assert(expr) ((expr) ? (void)0 : toku_hton_assert_fail(#expr, __FUNCTION__, __FILE__, __LINE__, errno))
#endif
#include "hatoku_cmp.h" #include "hatoku_cmp.h"
#include "hatoku_assert.h"
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
#error "WORDS_BIGENDIAN not supported" #error "WORDS_BIGENDIAN not supported"
......
#ifndef _HATOKU_CMP #ifndef _HATOKU_CMP
#define _HATOKU_CMP #define _HATOKU_CMP
#include "toku_mysql_priv.h"
extern "C" { extern "C" {
#include "stdint.h" #include "stdint.h"
} }
......
#ifndef _HATOKU_DEF #ifndef _HATOKU_DEF
#define _HATOKU_DEF #define _HATOKU_DEF
#include "mysql_version.h"
#if MYSQL_VERSION_ID < 50506
#include "mysql_priv.h"
#else
#include "sql_table.h"
#include "handler.h"
#include "table.h"
#include "log.h"
#include "sql_class.h"
#include "sql_show.h"
#include "discover.h"
#endif
#include "db.h" #include "db.h"
extern "C" { extern "C" {
#include "toku_os.h" #include "toku_os.h"
} }
#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
#endif
extern ulong tokudb_debug; // In MariaDB 5.3, thread progress reporting was introduced.
// Only include that functionality if we're using maria 5.3 +
#ifdef MARIADB_BASE_VERSION
#if MYSQL_VERSION_ID >= 50300
#define HA_TOKUDB_HAS_THD_PROGRESS
#endif
#endif
#if 50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699
#define TOKU_INCLUDE_ALTER_56 1
#define TOKU_INCLUDE_ROW_TYPE_COMPRESSION 0
#define TOKU_INCLUDE_XA 1
#endif
#if 50500 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50599
#define TOKU_INCLUDE_ALTER_56 1
#define TOKU_INCLUDE_ALTER_55 1
#define TOKU_INCLUDE_ROW_TYPE_COMPRESSION 1
#define TOKU_INCLUDE_XA 1
#endif
#if MYSQL_VERSION_ID < 50500
#define TOKU_INCLUDE_ALTER_51 1
#define TOKU_INCLUDE_ROW_TYPE_COMPRESSION 1
#define TOKU_INCLUDE_XA 1
#endif
#if !defined(HA_CLUSTERING)
#define HA_CLUSTERING 0
#endif
#if !defined(HA_CLUSTERED_INDEX)
#define HA_CLUSTERED_INDEX 0
#endif
#if !defined(HA_CAN_WRITE_DURING_OPTIMIZE)
#define HA_CAN_WRITE_DURING_OPTIMIZE 0
#endif
// In older (< 5.5) versions of MySQL and MariaDB, it is necessary to
// use a read/write lock on the key_file array in a table share,
// because table locks do not protect the race of some thread closing
// a table and another calling ha_tokudb::info()
//
// In version 5.5 and, a higher layer "metadata lock" was introduced
// to synchronize threads that open, close, call info(), etc on tables.
// In these versions, we don't need the key_file lock
#if MYSQL_VERSION_ID < 50500
#define HA_TOKUDB_NEEDS_KEY_FILE_LOCK
#endif
extern ulong tokudb_debug;
// //
// returns maximum length of dictionary name, such as key-NAME // returns maximum length of dictionary name, such as key-NAME
...@@ -16,7 +82,6 @@ extern ulong tokudb_debug; ...@@ -16,7 +82,6 @@ extern ulong tokudb_debug;
// //
#define MAX_DICT_NAME_LEN NAME_CHAR_LEN + 10 #define MAX_DICT_NAME_LEN NAME_CHAR_LEN + 10
// QQQ how to tune these? // QQQ how to tune these?
#define HA_TOKUDB_RANGE_COUNT 100 #define HA_TOKUDB_RANGE_COUNT 100
/* extra rows for estimate_rows_upper_bound() */ /* extra rows for estimate_rows_upper_bound() */
...@@ -164,5 +229,14 @@ static inline void abort_txn(DB_TXN* txn) { ...@@ -164,5 +229,14 @@ static inline void abort_txn(DB_TXN* txn) {
assert(r == 0); assert(r == 0);
} }
/* The purpose of this file is to define assert() for use by the handlerton.
* The intention is for a failed handlerton assert to invoke a failed assert
* in the fractal tree layer, which dumps engine status to the error log.
*/
void toku_hton_assert_fail(const char*/*expr_as_string*/,const char */*fun*/,const char*/*file*/,int/*line*/, int/*errno*/) __attribute__((__visibility__("default"))) __attribute__((__noreturn__));
#undef assert
#define assert(expr) ((expr) ? (void)0 : toku_hton_assert_fail(#expr, __FUNCTION__, __FILE__, __LINE__, errno))
#endif #endif
/* -*- mode: C; c-basic-offset: 4 -*- */ /* -*- mode: C; c-basic-offset: 4 -*- */
#define MYSQL_SERVER 1 #define MYSQL_SERVER 1
#include "toku_mysql_priv.h" #include "hatoku_defines.h"
#include <db.h> #include <db.h>
extern "C" { extern "C" {
...@@ -22,9 +22,7 @@ extern "C" { ...@@ -22,9 +22,7 @@ extern "C" {
#include <mysql/plugin.h> #include <mysql/plugin.h>
#include "hatoku_hton.h" #include "hatoku_hton.h"
#include "hatoku_defines.h"
#include "ha_tokudb.h" #include "ha_tokudb.h"
#include "hatoku_assert.h"
#undef PACKAGE #undef PACKAGE
#undef VERSION #undef VERSION
......
#if !defined(TOKU_MYSQL_PRIV_H)
#define TOKU_MYSQL_PRIV_H
#include "mysql_version.h"
#if MYSQL_VERSION_ID < 50506
#include "mysql_priv.h"
#else
#include "sql_table.h"
#include "handler.h"
#include "table.h"
#include "log.h"
#include "sql_class.h"
#include "sql_show.h"
#include "discover.h"
#endif
#endif
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