Below is the list of changes that have just been committed into a local
5.1 repository of tsmith. When tsmith does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-06-12 02:07:08+02:00, tsmith@stripped +12 -0
Merge tsmith@stripped:m/bk/maint/inno-thd-patch/51
into quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/inno/jun12/51
MERGE: 1.2482.49.1
include/m_string.h@stripped, 2007-06-12 02:07:03+02:00, tsmith@stripped +0 -0
SCCS merged
MERGE: 1.46.1.4
include/my_global.h@stripped, 2007-06-12 02:00:12+02:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.171.1.1
sql/handler.h@stripped, 2007-06-12 02:00:12+02:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.258.3.1
sql/log.cc@stripped, 2007-06-12 02:00:12+02:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.281.1.1
sql/mysql_priv.h@stripped, 2007-06-12 02:00:12+02:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.514.1.1
sql/sql_cache.cc@stripped, 2007-06-12 02:00:12+02:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.109.2.1
sql/sql_class.cc@stripped, 2007-06-12 02:00:13+02:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.334.3.1
sql/sql_class.h@stripped, 2007-06-12 02:07:03+02:00, tsmith@stripped +0 -0
SCCS merged
MERGE: 1.362.4.1
sql/sql_parse.cc@stripped, 2007-06-12 02:00:13+02:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.668.3.3
sql/sql_show.cc@stripped, 2007-06-12 02:00:14+02:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.413.1.1
storage/innobase/handler/ha_innodb.cc@stripped, 2007-06-12 02:00:14+02:00,
tsmith@stripped +0 -0
Auto merged
MERGE: 1.338.1.1
storage/innobase/handler/ha_innodb.h@stripped, 2007-06-12 02:00:14+02:00,
tsmith@stripped +0 -0
Auto merged
MERGE: 1.139.1.1
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: tsmith
# Host: quadxeon.mysql.com
# Root: /benchmarks/ext3/TOSAVE/tsmith/bk/inno/jun12/51/RESYNC
--- 1.48/include/m_string.h 2007-06-05 17:31:37 +02:00
+++ 1.49/include/m_string.h 2007-06-12 02:07:03 +02:00
@@ -246,17 +246,17 @@ extern size_t my_snprintf(char *to, size
/*
LEX_STRING -- a pair of a C-string and its length.
-
- NOTE: this exactly form of declaration is required for some C-compilers
- (for one, Sun C 5.7 2005/01/07). Unfortunately with such declaration
- LEX_STRING can not be forward declared.
*/
-typedef struct
+#ifndef _my_plugin_h
+/* This definition must match the one given in mysql/plugin.h */
+struct st_mysql_lex_string
{
char *str;
size_t length;
-} LEX_STRING;
+};
+#endif /* _my_plugin_h */
+typedef struct st_mysql_lex_string LEX_STRING;
#define STRING_WITH_LEN(X) (X), ((size_t) (sizeof(X) - 1))
#define USTRING_WITH_LEN(X) ((uchar*) X), ((size_t) (sizeof(X) - 1))
--- 1.262/sql/handler.h 2007-06-04 07:07:20 +02:00
+++ 1.263/sql/handler.h 2007-06-12 02:00:12 +02:00
@@ -316,13 +316,21 @@ typedef ulonglong my_xid; // this line i
#define MYSQL_XID_OFFSET (MYSQL_XID_PREFIX_LEN+sizeof(server_id))
#define MYSQL_XID_GTRID_LEN (MYSQL_XID_OFFSET+sizeof(my_xid))
-#define XIDDATASIZE 128
+#define XIDDATASIZE MYSQL_XIDDATASIZE
#define MAXGTRIDSIZE 64
#define MAXBQUALSIZE 64
#define COMPATIBLE_DATA_YES 0
#define COMPATIBLE_DATA_NO 1
+/**
+ struct xid_t is binary compatible with the XID structure as
+ in the X/Open CAE Specification, Distributed Transaction Processing:
+ The XA Specification, X/Open Company Ltd., 1991.
+ http://www.opengroup.org/bookstore/catalog/c193.htm
+
+ @see MYSQL_XID in mysql/plugin.h
+*/
struct xid_t {
long formatID;
long gtrid_length;
--- 1.283/sql/log.cc 2007-05-31 16:45:16 +02:00
+++ 1.284/sql/log.cc 2007-06-12 02:00:12 +02:00
@@ -5127,6 +5127,29 @@ err1:
return 1;
}
+
+#ifdef INNODB_COMPATIBILITY_HOOKS
+/**
+ Get the file name of the MySQL binlog.
+ @return the name of the binlog file
+*/
+extern "C"
+const char* mysql_bin_log_file_name(void)
+{
+ return mysql_bin_log.get_log_fname();
+}
+/**
+ Get the current position of the MySQL binlog.
+ @return byte offset from the beginning of the binlog
+*/
+extern "C"
+ulonglong mysql_bin_log_file_pos(void)
+{
+ return (ulonglong) mysql_bin_log.get_log_file()->pos_in_file;
+}
+#endif /* INNODB_COMPATIBILITY_HOOKS */
+
+
struct st_mysql_storage_engine binlog_storage_engine=
{ MYSQL_HANDLERTON_INTERFACE_VERSION };
--- 1.516/sql/mysql_priv.h 2007-06-05 22:49:12 +02:00
+++ 1.517/sql/mysql_priv.h 2007-06-12 02:00:12 +02:00
@@ -1091,7 +1091,11 @@ bool mysqld_show_open_tables(THD *thd,co
bool mysqld_show_logs(THD *thd);
void append_identifier(THD *thd, String *packet, const char *name,
uint length);
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
int get_quote_char_for_identifier(THD *thd, const char *name, uint length);
+#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
+#ifdef MYSQL_SERVER
void mysqld_list_fields(THD *thd,TABLE_LIST *table, const char *wild);
int mysqld_dump_create_info(THD *thd, TABLE_LIST *table_list, int fd);
bool mysqld_show_create(THD *thd, TABLE_LIST *table_list);
@@ -1120,9 +1124,6 @@ void reset_status_vars();
/* information schema */
extern LEX_STRING INFORMATION_SCHEMA_NAME;
extern const LEX_STRING partition_keywords[];
-LEX_STRING *make_lex_string(THD *thd, LEX_STRING *lex_str,
- const char* str, uint length,
- bool allocate_lex_string);
ST_SCHEMA_TABLE *find_schema_table(THD *thd, const char* table_name);
ST_SCHEMA_TABLE *get_schema_table(enum enum_schema_tables schema_table_idx);
int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident,
@@ -1598,8 +1599,13 @@ extern int creating_table; // How man
*/
extern time_t server_start_time;
-extern char *mysql_data_home,server_version[SERVER_VERSION_LENGTH],
- mysql_real_data_home[], *opt_mysql_tmpdir, mysql_charsets_dir[],
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
+extern char *mysql_data_home, server_version[SERVER_VERSION_LENGTH],
+ mysql_real_data_home[];
+#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
+#ifdef MYSQL_SERVER
+extern char *opt_mysql_tmpdir, mysql_charsets_dir[],
def_ft_boolean_syntax[sizeof(ft_boolean_syntax)];
#define mysql_tmpdir (my_tmpdir(&mysql_tmpdir_list))
extern MY_TMPDIR mysql_tmpdir_list;
@@ -1616,8 +1622,13 @@ extern Gt_creator gt_creator;
extern Lt_creator lt_creator;
extern Ge_creator ge_creator;
extern Le_creator le_creator;
-extern char language[FN_REFLEN], reg_ext[FN_EXTLEN];
+extern char language[FN_REFLEN];
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
+extern char reg_ext[FN_EXTLEN];
extern uint reg_ext_length;
+#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
+#ifdef MYSQL_SERVER
extern char glob_hostname[FN_REFLEN], mysql_home[FN_REFLEN];
extern char pidfile_name[FN_REFLEN], system_time_zone[30], *opt_init_file;
extern char log_error_file[FN_REFLEN], *opt_tc_log_file;
@@ -1646,17 +1657,32 @@ extern ulong max_binlog_size, max_relay_
extern ulong opt_binlog_rows_event_max_size;
extern ulong rpl_recovery_rank, thread_cache_size, thread_pool_size;
extern ulong back_log;
-extern ulong specialflag, current_pid;
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
+extern ulong specialflag;
+#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
+#ifdef MYSQL_SERVER
+extern ulong current_pid;
extern ulong expire_logs_days, sync_binlog_period, sync_binlog_counter;
extern ulong opt_tc_log_size, tc_log_max_pages_used, tc_log_page_size;
extern ulong tc_log_page_waits;
extern my_bool relay_log_purge, opt_innodb_safe_binlog, opt_innodb;
extern uint test_flags,select_errors,ha_open_options;
extern uint protocol_version, mysqld_port, dropping_tables;
-extern uint delay_key_write_options, lower_case_table_names;
+extern uint delay_key_write_options;
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
+extern uint lower_case_table_names;
+#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
+#ifdef MYSQL_SERVER
extern bool opt_endinfo, using_udf_functions;
extern my_bool locked_in_memory;
-extern bool opt_using_transactions, mysqld_embedded;
+extern bool opt_using_transactions;
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
+extern bool mysqld_embedded;
+#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
+#ifdef MYSQL_SERVER
extern bool using_update_log, opt_large_files, server_id_supplied;
extern bool opt_update_log, opt_bin_log, opt_error_log;
extern my_bool opt_log, opt_slow_log;
@@ -1680,7 +1706,11 @@ extern uint opt_crash_binlog_innodb;
extern char *shared_memory_base_name, *mysqld_unix_port;
extern my_bool opt_enable_shared_memory;
extern char *default_tz_name;
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
extern my_bool opt_large_pages;
+#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
+#ifdef MYSQL_SERVER
extern uint opt_large_page_size;
extern char *opt_logname, *opt_slow_logname;
extern const char *log_output_str;
@@ -1717,7 +1747,11 @@ extern MY_BITMAP temp_pool;
extern String my_empty_string;
extern const String my_null_string;
extern SHOW_VAR status_vars[];
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
extern struct system_variables global_system_variables;
+#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
+#ifdef MYSQL_SERVER
extern struct system_variables max_system_variables;
extern struct system_status_var global_status_var;
extern struct rand_struct sql_rand;
@@ -1914,10 +1948,14 @@ int wild_case_compare(CHARSET_INFO *cs,
char *fn_rext(char *name);
/* Conversion functions */
+#endif /* MYSQL_SERVER */
+#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
uint strconvert(CHARSET_INFO *from_cs, const char *from,
CHARSET_INFO *to_cs, char *to, uint to_length, uint *errors);
uint filename_to_tablename(const char *from, char *to, uint to_length);
uint tablename_to_filename(const char *from, char *to, uint to_length);
+#endif /* MYSQL_SERVER || INNODB_COMPATIBILITY_HOOKS */
+#ifdef MYSQL_SERVER
uint build_table_filename(char *buff, size_t bufflen, const char *db,
const char *table, const char *ext, uint flags);
/* Flags for conversion functions. */
--- 1.112/sql/sql_cache.cc 2007-06-01 10:12:02 +02:00
+++ 1.113/sql/sql_cache.cc 2007-06-12 02:00:12 +02:00
@@ -765,6 +765,18 @@ void query_cache_invalidate_by_MyISAM_fi
}
+/*
+ The following function forms part of the C plugin API
+*/
+extern "C"
+void mysql_query_cache_invalidate4(THD *thd,
+ const char *key, unsigned key_length,
+ int using_trx)
+{
+ query_cache.invalidate(thd, key, (uint32) key_length, (my_bool) using_trx);
+}
+
+
/*****************************************************************************
Query_cache methods
*****************************************************************************/
--- 1.337/sql/sql_class.cc 2007-06-01 09:43:53 +02:00
+++ 1.338/sql/sql_class.cc 2007-06-12 02:00:13 +02:00
@@ -207,6 +207,31 @@ Open_tables_state::Open_tables_state(ulo
The following functions form part of the C plugin API
*/
+extern "C" int mysql_tmpfile(const char *prefix)
+{
+ char filename[FN_REFLEN];
+ File fd = create_temp_file(filename, mysql_tmpdir, prefix,
+#ifdef __WIN__
+ O_BINARY | O_TRUNC | O_SEQUENTIAL |
+ O_SHORT_LIVED |
+#endif /* __WIN__ */
+ O_CREAT | O_EXCL | O_RDWR | O_TEMPORARY,
+ MYF(MY_WME));
+ if (fd >= 0) {
+#ifndef __WIN__
+ /*
+ This can be removed once the following bug is fixed:
+ Bug #28903 create_temp_file() doesn't honor O_TEMPORARY option
+ (file not removed) (Unix)
+ */
+ unlink(filename);
+#endif /* !__WIN__ */
+ }
+
+ return fd;
+}
+
+
extern "C"
int thd_in_lock_tables(const THD *thd)
{
@@ -253,6 +278,52 @@ int thd_tx_isolation(const THD *thd)
return (int) thd->variables.tx_isolation;
}
+extern "C"
+char *thd_alloc(THD *thd, unsigned int size)
+{
+ return thd->alloc(size);
+}
+
+extern "C"
+char *thd_calloc(THD *thd, unsigned int size)
+{
+ return thd->calloc(size);
+}
+
+extern "C"
+char *thd_strdup(THD *thd, const char *str)
+{
+ return thd->strdup(str);
+}
+
+extern "C"
+char *thd_strmake(THD *thd, const char *str, unsigned int size)
+{
+ return thd->strmake(str, size);
+}
+
+extern "C"
+char *thd_memdup(THD *thd, const char* str, unsigned int size)
+{
+ return thd->memdup(str, size);
+}
+
+extern "C"
+MYSQL_LEX_STRING *thd_make_lex_string(THD *thd, LEX_STRING *lex_str,
+ const char *str, unsigned int size,
+ int allocate_lex_string)
+{
+ return thd->make_lex_string(lex_str, str, size,
+ (bool) allocate_lex_string);
+}
+
+extern "C"
+MYSQL_XID *thd_get_xid(const THD *thd)
+{
+ // MYSQL_XID and XID are binary compatible
+ return (MYSQL_XID *) &thd->transaction.xid_state.xid;
+}
+
/*
Dumps a text description of a thread, its security context
@@ -321,6 +392,24 @@ char *thd_security_context(THD *thd, cha
return thd->strmake(str.ptr(), str.length());
}
+/*
+ The following functions are required for the InnoDB
+ storage engine plugin, but do not form part of the
+ general plugin interface
+*/
+#ifdef INNODB_COMPATIBILITY_HOOKS
+extern "C"
+struct charset_info_st *thd_charset(THD *thd)
+{
+ return thd->charset();
+}
+
+extern "C"
+char **thd_query(THD *thd)
+{
+ return &(thd->query);
+}
+#endif /* INNODB_COMPATIBILITY_HOOKS */
THD::THD()
@@ -847,6 +936,29 @@ void THD::cleanup_after_query()
free_items();
/* Reset where. */
where= THD::DEFAULT_WHERE;
+}
+
+
+/**
+ Create a LEX_STRING in this connection
+ @param lex_str pointer to LEX_STRING object to be initialized
+ @param str initializer to be copied into lex_str
+ @param length length of str, in bytes
+ @param allocate_lex_string if TRUE, allocate new LEX_STRING object,
+ instead of using lex_str value
+ @return NULL on failure, or pointer to the LEX_STRING object
+*/
+LEX_STRING *THD::make_lex_string(LEX_STRING *lex_str,
+ const char* str, uint length,
+ bool allocate_lex_string)
+{
+ if (allocate_lex_string)
+ if (!(lex_str= (LEX_STRING *)alloc(sizeof(LEX_STRING))))
+ return 0;
+ if (!(lex_str->str= strmake_root(mem_root, str, length)))
+ return 0;
+ lex_str->length= length;
+ return lex_str;
}
--- 1.366/sql/sql_class.h 2007-06-04 12:14:20 +02:00
+++ 1.367/sql/sql_class.h 2007-06-12 02:07:03 +02:00
@@ -484,13 +484,6 @@ public:
{ return strdup_root(mem_root,str); }
inline char *strmake(const char *str, size_t size)
{ return strmake_root(mem_root,str,size); }
- inline bool LEX_STRING_make(LEX_STRING *lex_str, const char *str,
- size_t size)
- {
- return ((lex_str->str=
- strmake_root(mem_root, str, (lex_str->length= size)))) == 0;
- }
-
inline void *memdup(const void *str, size_t size)
{ return memdup_root(mem_root,str,size); }
inline void *memdup_w_gap(const void *str, size_t size, uint gap)
@@ -1577,6 +1570,10 @@ public:
{
return alloc_root(&transaction.mem_root,size);
}
+
+ LEX_STRING *make_lex_string(LEX_STRING *lex_str,
+ const char* str, uint length,
+ bool allocate_lex_string);
bool convert_string(LEX_STRING *to, CHARSET_INFO *to_cs,
const char *from, uint from_length,
--- 1.678/sql/sql_parse.cc 2007-06-11 21:55:26 +02:00
+++ 1.679/sql/sql_parse.cc 2007-06-12 02:00:13 +02:00
@@ -1022,8 +1022,8 @@ bool dispatch_command(enum enum_server_c
HA_CREATE_INFO create_info;
status_var_increment(thd->status_var.com_stat[SQLCOM_CREATE_DB]);
- if (thd->LEX_STRING_make(&db, packet, packet_length -1) ||
- thd->LEX_STRING_make(&alias, db.str, db.length) ||
+ if (thd->make_lex_string(&db, packet, packet_length - 1, FALSE) ||
+ thd->make_lex_string(&alias, db.str, db.length, FALSE) ||
check_db_name(&db))
{
my_error(ER_WRONG_DB_NAME, MYF(0), db.str ? db.str : "NULL");
@@ -1043,7 +1043,7 @@ bool dispatch_command(enum enum_server_c
status_var_increment(thd->status_var.com_stat[SQLCOM_DROP_DB]);
LEX_STRING db;
- if (thd->LEX_STRING_make(&db, packet, packet_length - 1) ||
+ if (thd->make_lex_string(&db, packet, packet_length - 1, FALSE) ||
check_db_name(&db))
{
my_error(ER_WRONG_DB_NAME, MYF(0), db.str ? db.str : "NULL");
--- 1.414/sql/sql_show.cc 2007-06-05 17:31:45 +02:00
+++ 1.415/sql/sql_show.cc 2007-06-12 02:00:14 +02:00
@@ -2202,20 +2202,6 @@ void calc_sum_of_all_status(STATUS_VAR *
}
-LEX_STRING *make_lex_string(THD *thd, LEX_STRING *lex_str,
- const char* str, uint length,
- bool allocate_lex_string)
-{
- MEM_ROOT *mem= thd->mem_root;
- if (allocate_lex_string)
- if (!(lex_str= (LEX_STRING *)thd->alloc(sizeof(LEX_STRING))))
- return 0;
- lex_str->str= strmake_root(mem, str, length);
- lex_str->length= length;
- return lex_str;
-}
-
-
/* INFORMATION_SCHEMA name */
LEX_STRING INFORMATION_SCHEMA_NAME= { C_STRING_WITH_LEN("information_schema")};
@@ -5139,10 +5125,10 @@ int make_schema_select(THD *thd, SELECT_
We have to make non const db_name & table_name
because of lower_case_table_names
*/
- make_lex_string(thd, &db, INFORMATION_SCHEMA_NAME.str,
- INFORMATION_SCHEMA_NAME.length, 0);
- make_lex_string(thd, &table, schema_table->table_name,
- strlen(schema_table->table_name), 0);
+ thd->make_lex_string(&db, INFORMATION_SCHEMA_NAME.str,
+ INFORMATION_SCHEMA_NAME.length, 0);
+ thd->make_lex_string(&table, schema_table->table_name,
+ strlen(schema_table->table_name), 0);
if (schema_table->old_format(thd, schema_table) || /* Handle old syntax */
!sel->add_table_to_list(thd, new Table_ident(thd, db, table, 0),
0, 0, TL_READ))
--- 1.339/storage/innobase/handler/ha_innodb.cc 2007-05-24 12:24:29 +02:00
+++ 1.340/storage/innobase/handler/ha_innodb.cc 2007-06-12 02:00:14 +02:00
@@ -837,22 +837,9 @@ innobase_mysql_tmpfile(void)
/*========================*/
/* out: temporary file descriptor, or < 0 on error */
{
- char filename[FN_REFLEN];
int fd2 = -1;
- File fd = create_temp_file(filename, mysql_tmpdir, "ib",
-#ifdef __WIN__
- O_BINARY | O_TRUNC | O_SEQUENTIAL |
- O_TEMPORARY | O_SHORT_LIVED |
-#endif /* __WIN__ */
- O_CREAT | O_EXCL | O_RDWR,
- MYF(MY_WME));
+ File fd = mysql_tmpfile("ib");
if (fd >= 0) {
-#ifndef __WIN__
- /* On Windows, open files cannot be removed, but files can be
- created with the O_TEMPORARY flag to the same effect
- ("delete on close"). */
- unlink(filename);
-#endif /* !__WIN__ */
/* Copy the file descriptor, so that the additional resources
allocated by create_temp_file() can be freed by invoking
my_close().
@@ -867,7 +854,7 @@ innobase_mysql_tmpfile(void)
my_errno=errno;
my_error(EE_OUT_OF_FILERESOURCES,
MYF(ME_BELL+ME_WAITTANG),
- filename, my_errno);
+ "ib*", my_errno);
}
my_close(fd, MYF(MY_WME));
}
@@ -5893,8 +5880,8 @@ ha_innobase::get_foreign_key_list(THD *t
while (tmp_buff[i] != '/')
i++;
tmp_buff+= i + 1;
- f_key_info.forein_id= make_lex_string(thd, 0, tmp_buff,
- (uint) strlen(tmp_buff), 1);
+ f_key_info.forein_id= thd_make_lex_string(thd, 0,
+ tmp_buff, (uint) strlen(tmp_buff), 1);
tmp_buff= foreign->referenced_table_name;
/* Database name */
@@ -5906,22 +5893,23 @@ ha_innobase::get_foreign_key_list(THD *t
}
db_name[i]= 0;
ulen= filename_to_tablename(db_name, uname, sizeof(uname));
- f_key_info.referenced_db= make_lex_string(thd, 0, uname, ulen, 1);
+ f_key_info.referenced_db=
+ thd_make_lex_string(thd, 0, uname, ulen, 1);
/* Table name */
tmp_buff+= i + 1;
ulen= filename_to_tablename(tmp_buff, uname, sizeof(uname));
- f_key_info.referenced_table= make_lex_string(thd, 0, uname,
- ulen, 1);
+ f_key_info.referenced_table=
+ thd_make_lex_string(thd, 0, uname, ulen, 1);
for (i= 0;;) {
tmp_buff= foreign->foreign_col_names[i];
- name= make_lex_string(thd, name, tmp_buff,
- (uint) strlen(tmp_buff), 1);
+ name= thd_make_lex_string(thd, name,
+ tmp_buff, (uint) strlen(tmp_buff), 1);
f_key_info.foreign_fields.push_back(name);
tmp_buff= foreign->referenced_col_names[i];
- name= make_lex_string(thd, name, tmp_buff,
- (uint) strlen(tmp_buff), 1);
+ name= thd_make_lex_string(thd, name,
+ tmp_buff, (uint) strlen(tmp_buff), 1);
f_key_info.referenced_fields.push_back(name);
if (++i >= foreign->n_fields)
break;
@@ -5948,8 +5936,8 @@ ha_innobase::get_foreign_key_list(THD *t
length=8;
tmp_buff= "RESTRICT";
}
- f_key_info.delete_method= make_lex_string(thd, f_key_info.delete_method,
- tmp_buff, length, 1);
+ f_key_info.delete_method= thd_make_lex_string(thd,
+ f_key_info.delete_method, tmp_buff, length, 1);
if (foreign->type & DICT_FOREIGN_ON_UPDATE_CASCADE)
@@ -5972,15 +5960,16 @@ ha_innobase::get_foreign_key_list(THD *t
length=8;
tmp_buff= "RESTRICT";
}
- f_key_info.update_method= make_lex_string(thd, f_key_info.update_method,
- tmp_buff, length, 1);
+ f_key_info.update_method= thd_make_lex_string(thd,
+ f_key_info.update_method, tmp_buff, length, 1);
if (foreign->referenced_index &&
foreign->referenced_index->name)
{
f_key_info.referenced_key_name=
- make_lex_string(thd, f_key_info.referenced_key_name,
- foreign->referenced_index->name,
- strlen(foreign->referenced_index->name), 1);
+ thd_make_lex_string(thd,
+ f_key_info.referenced_key_name,
+ foreign->referenced_index->name,
+ strlen(foreign->referenced_index->name), 1);
}
FOREIGN_KEY_INFO *pf_key_info= ((FOREIGN_KEY_INFO *)
--- 1.140/storage/innobase/handler/ha_innodb.h 2007-05-24 00:39:27 +02:00
+++ 1.141/storage/innobase/handler/ha_innodb.h 2007-06-12 02:00:14 +02:00
@@ -213,6 +213,29 @@ extern ulong srv_commit_concurrency;
extern ulong srv_flush_log_at_trx_commit;
}
+/* Some accessor functions which the InnoDB plugin needs, but which
+can not be added to mysql/plugin.h as part of the public interface;
+the definitions are bracketed with #ifdef INNODB_COMPATIBILITY_HOOKS */
+
+#ifndef INNODB_COMPATIBILITY_HOOKS
+#error INNODB_COMPATIBILITY_HOOKS must be defined to build InnoDB
+#endif
+
+extern "C" {
+struct charset_info_st *thd_charset(MYSQL_THD thd);
+char **thd_query(MYSQL_THD thd);
+
+/** Get the file name of the MySQL binlog.
+ * @return the name of the binlog file
+ */
+const char* mysql_bin_log_file_name(void);
+
+/** Get the current position of the MySQL binlog.
+ * @return byte offset from the beginning of the binlog
+ */
+ulonglong mysql_bin_log_file_pos(void);
+}
+
/*
don't delete it - it may be re-enabled later
as an optimization for the most common case InnoDB+binlog
--- 1.172/include/my_global.h 2007-06-05 17:36:29 +02:00
+++ 1.173/include/my_global.h 2007-06-12 02:00:12 +02:00
@@ -23,6 +23,17 @@
#define HAVE_EXTERNAL_CLIENT
#endif
+/*
+ InnoDB depends on some MySQL internals which other plugins should not
+ need. This is because of InnoDB's foreign key support, "safe" binlog
+ truncation, and other similar legacy features.
+
+ We define accessors for these internals unconditionally, but do not
+ expose them in mysql/plugin.h. They are declared in ha_innodb.h for
+ InnoDB's use.
+*/
+#define INNODB_COMPATIBILITY_HOOKS
+
#ifdef __CYGWIN__
/* We use a Unix API, so pretend it's not Windows */
#undef WIN
| Thread |
|---|
| • bk commit into 5.1 tree (tsmith:1.2487) | tim | 12 Jun |