18 #ifndef HA_NDBCLUSTER_GLUE_H
19 #define HA_NDBCLUSTER_GLUE_H
21 #include <mysql_version.h>
27 #if MYSQL_VERSION_ID >= 50501
31 #include "sql_table.h"
34 #include "sql_partition.h"
38 #include "transaction.h"
42 #include "mysql_priv.h"
49 #if MYSQL_VERSION_ID >= 50501
53 void my_free(
void* ptr, myf MyFlags)
61 bool close_cached_tables(THD *thd,
TABLE_LIST *tables,
bool have_lock,
62 bool wait_for_refresh,
bool wait_for_placeholders)
64 return close_cached_tables(thd, tables, wait_for_refresh, LONG_TIMEOUT);
68 #define NDB_THD_HAS_NO_VERSION
71 #define NDB_THD_BINLOG_QUERY_HAS_DIRECT
74 #define NDB_NO_MYSQL_RM_TABLE_PART2
78 extern ulong opt_server_id_mask;
81 uint32 thd_unmasked_server_id(
const THD* thd)
83 #ifndef NDB_WITHOUT_SERVER_ID_BITS
84 const uint32 unmasked_server_id = thd->unmasked_server_id;
85 assert(thd->server_id == (thd->unmasked_server_id & opt_server_id_mask));
86 return unmasked_server_id;
88 return thd->server_id;
95 ulonglong thd_options(
const THD * thd)
97 #if MYSQL_VERSION_ID < 50500
101 return thd->variables.option_bits;
107 void thd_set_command(THD* thd,
enum enum_server_command command)
109 #if MYSQL_VERSION_ID < 50600
110 thd->command = command;
113 thd->set_command(command);
121 #if MYSQL_VERSION_ID < 50500
122 return &(thd->main_da);
124 #if MYSQL_VERSION_ID < 50603
129 return thd->get_stmt_da();
134 #if MYSQL_VERSION_ID < 50500
147 return pthread_mutex_lock(mutex);
153 return pthread_mutex_unlock(mutex);
159 return safe_mutex_assert_owner(mutex);
167 return pthread_cond_wait(cond, mutex);
174 return pthread_cond_timedwait(cond, mutex, abstime);
180 uint partition_info_num_full_part_fields(
const partition_info* part_info)
182 #if MYSQL_VERSION_ID < 50500
183 return part_info->no_full_part_fields;
186 return part_info->num_full_part_fields;
193 #if MYSQL_VERSION_ID < 50500
194 return part_info->no_parts;
197 return part_info->num_parts;
202 uint partition_info_num_list_values(
const partition_info* part_info)
204 #if MYSQL_VERSION_ID < 50500
205 return part_info->no_list_values;
208 return part_info->num_list_values;
213 bool partition_info_use_default_num_partitions(
const partition_info* part_info)
215 #if MYSQL_VERSION_ID < 50500
216 return part_info->use_default_no_partitions;
219 return part_info->use_default_num_partitions;
226 #if MYSQL_VERSION_ID < 50500
227 return part_info->no_subparts;
230 return part_info->num_subparts;
234 #if MYSQL_VERSION_ID >= 50600
237 #define NDB_WITH_NEW_MRR_INTERFACE