summaryrefslogtreecommitdiff
path: root/storage/xtradb
diff options
context:
space:
mode:
Diffstat (limited to 'storage/xtradb')
-rw-r--r--storage/xtradb/CMakeLists.txt.disabled (renamed from storage/xtradb/CMakeLists.txt)0
-rw-r--r--storage/xtradb/handler/ha_innodb.cc87
-rw-r--r--storage/xtradb/handler/ha_innodb.h10
-rw-r--r--storage/xtradb/handler/handler0alter.cc4
-rw-r--r--storage/xtradb/handler/i_s.cc2
-rw-r--r--storage/xtradb/handler/mysql_addons.cc2
-rw-r--r--storage/xtradb/include/handler0alter.h4
-rw-r--r--storage/xtradb/include/row0merge.h2
-rw-r--r--storage/xtradb/include/row0types.h2
-rw-r--r--storage/xtradb/os/os0thread.c4
-rw-r--r--storage/xtradb/plug.in5
-rw-r--r--storage/xtradb/row/row0merge.c12
12 files changed, 68 insertions, 66 deletions
diff --git a/storage/xtradb/CMakeLists.txt b/storage/xtradb/CMakeLists.txt.disabled
index 789dbd5327e..789dbd5327e 100644
--- a/storage/xtradb/CMakeLists.txt
+++ b/storage/xtradb/CMakeLists.txt.disabled
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index f511918e845..4a341b4a83e 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -47,14 +47,17 @@ Place, Suite 330, Boston, MA 02111-1307 USA
#define MYSQL_SERVER
#endif
-#include <mysql_priv.h>
-#ifdef MYSQL_SERVER
-#include <log_event.h>
-#endif /* MYSQL_SERVER */
+#include <sql_table.h> // explain_filename, nz2, EXPLAIN_PARTITIONS_AS_COMMENT,
+ // EXPLAIN_FILENAME_MAX_EXTRA_LENGTH
+#include <sql_acl.h> // PROCESS_ACL
+#include <slave.h> // relay_log_info_file
+#include <log_event.h> // rpl_get_position_info
#include <m_ctype.h>
#include <mysys_err.h>
#include <mysql/plugin.h>
+#include <mysql/innodb_priv.h>
+//#include <mysql/psi/psi.h>
/** @file ha_innodb.cc */
@@ -2282,8 +2285,7 @@ skip_relay:
"InnoDB: syntax error in innodb_data_file_path");
mem_free_and_error:
srv_free_paths_and_sizes();
- my_free(internal_innobase_data_file_path,
- MYF(MY_ALLOW_ZERO_PTR));
+ my_free(internal_innobase_data_file_path);
goto error;
}
@@ -2607,8 +2609,7 @@ innobase_end(
err = 1;
}
srv_free_paths_and_sizes();
- my_free(internal_innobase_data_file_path,
- MYF(MY_ALLOW_ZERO_PTR));
+ my_free(internal_innobase_data_file_path);
pthread_mutex_destroy(&innobase_share_mutex);
pthread_mutex_destroy(&prepare_commit_mutex);
pthread_mutex_destroy(&commit_threads_m);
@@ -2995,7 +2996,7 @@ innobase_rollback_to_savepoint(
/* TODO: use provided savepoint data area to store savepoint data */
- longlong2str((ulint)savepoint, name, 36, 1);
+ longlong2str((ulint)savepoint, name, 36);
error = (int) trx_rollback_to_savepoint_for_mysql(trx, name,
&mysql_binlog_cache_pos);
@@ -3026,7 +3027,7 @@ innobase_release_savepoint(
/* TODO: use provided savepoint data area to store savepoint data */
- longlong2str((ulint)savepoint, name, 36, 1);
+ longlong2str((ulint)savepoint, name, 36);
error = (int) trx_release_savepoint_for_mysql(trx, name);
@@ -3073,7 +3074,7 @@ innobase_savepoint(
/* TODO: use provided savepoint data area to store savepoint data */
char name[64];
- longlong2str((ulint)savepoint,name,36,1);
+ longlong2str((ulint)savepoint,name,36);
error = (int) trx_savepoint_for_mysql(trx, name, (ib_int64_t)0);
@@ -3575,7 +3576,7 @@ innobase_build_index_translation(
func_exit:
if (!ret) {
/* Build translation table failed. */
- my_free(index_mapping, MYF(MY_ALLOW_ZERO_PTR));
+ my_free(index_mapping);
share->idx_trans_tbl.array_size = 0;
share->idx_trans_tbl.index_count = 0;
@@ -3793,7 +3794,7 @@ retry:
if (ib_table && ib_table->is_corrupt) {
free_share(share);
- my_free(upd_buff, MYF(0));
+ my_free(upd_buff);
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);
}
@@ -3833,7 +3834,7 @@ retry:
"how you can resolve the problem.\n",
norm_name);
free_share(share);
- my_free(upd_buff, MYF(0));
+ my_free(upd_buff);
my_errno = ENOENT;
DBUG_RETURN(HA_ERR_NO_SUCH_TABLE);
@@ -3849,7 +3850,7 @@ retry:
"how you can resolve the problem.\n",
norm_name);
free_share(share);
- my_free(upd_buff, MYF(0));
+ my_free(upd_buff);
my_errno = ENOENT;
dict_table_decrement_handle_count(ib_table, FALSE);
@@ -4042,7 +4043,7 @@ ha_innobase::close(void)
row_prebuilt_free(prebuilt, FALSE);
- my_free(upd_buff, MYF(0));
+ my_free(upd_buff);
free_share(share);
/* Tell InnoDB server that there might be work for
@@ -5251,7 +5252,7 @@ calc_row_difference(
upd_t* uvect, /*!< in/out: update vector */
uchar* old_row, /*!< in: old row in MySQL format */
uchar* new_row, /*!< in: new row in MySQL format */
- struct st_table* table, /*!< in: table in MySQL data
+ TABLE* table, /*!< in: table in MySQL data
dictionary */
uchar* upd_buff, /*!< in: buffer to use */
ulint buff_len, /*!< in: buffer length */
@@ -6699,7 +6700,7 @@ create_index(
error = convert_error_code_to_mysql(error, flags, NULL);
- my_free(field_lengths, MYF(0));
+ my_free(field_lengths);
DBUG_RETURN(error);
}
@@ -7519,7 +7520,7 @@ innobase_drop_database(
trx = innobase_trx_allocate(thd);
#endif
error = row_drop_database_for_mysql(namebuf, trx);
- my_free(namebuf, MYF(0));
+ my_free(namebuf);
/* Flush the log to reduce probability that the .frm files and
the InnoDB data dictionary get out-of-sync if the user runs
@@ -7597,8 +7598,8 @@ innobase_rename_table(
log_buffer_flush_to_disk();
}
- my_free(norm_to, MYF(0));
- my_free(norm_from, MYF(0));
+ my_free(norm_to);
+ my_free(norm_from);
DBUG_RETURN(error);
}
@@ -7765,7 +7766,7 @@ ha_innobase::records_in_range(
mem_heap_free(heap);
func_exit:
- my_free(key_val_buff2, MYF(0));
+ my_free(key_val_buff2);
prebuilt->trx->op_info = (char*)"";
@@ -8825,7 +8826,7 @@ ha_innobase::free_foreign_key_create_info(
char* str) /*!< in, own: create info string to free */
{
if (str) {
- my_free(str, MYF(0));
+ my_free(str);
}
}
@@ -9053,19 +9054,20 @@ ha_innobase::external_lock(
ulong const tx_isolation = thd_tx_isolation(ha_thd());
if (tx_isolation <= ISO_READ_COMMITTED
&& binlog_format == BINLOG_FORMAT_STMT
-#if MYSQL_VERSION_ID > 50140
&& thd_binlog_filter_ok(thd)
-#endif /* MYSQL_VERSION_ID > 50140 */
+ && thd_sqlcom_can_generate_row_events(thd)
)
{
- char buf[256];
- my_snprintf(buf, sizeof(buf),
- "Transaction level '%s' in"
- " InnoDB is not safe for binlog mode '%s'",
- tx_isolation_names[tx_isolation],
- binlog_format_names[binlog_format]);
- my_error(ER_BINLOG_LOGGING_IMPOSSIBLE, MYF(0), buf);
- DBUG_RETURN(HA_ERR_LOGGING_IMPOSSIBLE);
+ int skip = 0;
+ /* used by test case */
+ DBUG_EXECUTE_IF("no_innodb_binlog_errors", skip = 1;);
+ if (!skip) {
+ my_error(ER_BINLOG_STMT_MODE_AND_ROW_ENGINE, MYF(0),
+ " InnoDB is limited to row-logging when "
+ "transaction isolation level is "
+ "READ COMMITTED or READ UNCOMMITTED.");
+ DBUG_RETURN(HA_ERR_LOGGING_IMPOSSIBLE);
+ }
}
}
@@ -9404,7 +9406,7 @@ innodb_show_status(
STRING_WITH_LEN(""), str, flen)) {
result= TRUE;
}
- my_free(str, MYF(0));
+ my_free(str);
DBUG_RETURN(FALSE);
}
@@ -9673,10 +9675,9 @@ static void free_share(INNOBASE_SHARE* share)
thr_lock_delete(&share->lock);
/* Free any memory from index translation table */
- my_free(share->idx_trans_tbl.index_mapping,
- MYF(MY_ALLOW_ZERO_PTR));
+ my_free(share->idx_trans_tbl.index_mapping);
- my_free(share, MYF(0));
+ my_free(share);
/* TODO: invoke HASH_MIGRATE if innobase_open_tables
shrinks too much */
@@ -11280,14 +11281,8 @@ static MYSQL_SYSVAR_ULONG(io_capacity, srv_io_capacity,
static MYSQL_SYSVAR_ULONG(fast_shutdown, innobase_fast_shutdown,
PLUGIN_VAR_OPCMDARG,
"Speeds up the shutdown process of the InnoDB storage engine. Possible "
- "values are 0, 1 (faster)"
- /*
- NetWare can't close unclosed files, can't automatically kill remaining
- threads, etc, so on this OS we disable the crash-like InnoDB shutdown.
- */
- IF_NETWARE("", " or 2 (fastest - crash-like)")
- ".",
- NULL, NULL, 1, 0, IF_NETWARE(1,2), 0);
+ "values are 0, 1 (faster) or 2 (fastest - crash-like).",
+ NULL, NULL, 1, 0, 2, 0);
static MYSQL_SYSVAR_BOOL(file_per_table, srv_file_per_table,
PLUGIN_VAR_NOCMDARG,
@@ -11449,7 +11444,7 @@ static MYSQL_SYSVAR_ULONG(autoextend_increment, srv_auto_extend_increment,
static MYSQL_SYSVAR_LONGLONG(buffer_pool_size, innobase_buffer_pool_size,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"The size of the memory buffer InnoDB uses to cache data and indexes of its tables.",
- NULL, NULL, 128*1024*1024L, 32*1024*1024L, LONGLONG_MAX, 1024*1024L);
+ NULL, NULL, 128*1024*1024L, 5*1024*1024L, LONGLONG_MAX, 1024*1024L);
static MYSQL_SYSVAR_UINT(buffer_pool_shm_key, srv_buffer_pool_shm_key,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
diff --git a/storage/xtradb/handler/ha_innodb.h b/storage/xtradb/handler/ha_innodb.h
index 50a43aaebed..03358012878 100644
--- a/storage/xtradb/handler/ha_innodb.h
+++ b/storage/xtradb/handler/ha_innodb.h
@@ -296,14 +296,20 @@ int thd_binlog_format(const MYSQL_THD thd);
*/
void thd_mark_transaction_to_rollback(MYSQL_THD thd, bool all);
-#if MYSQL_VERSION_ID > 50140
/**
Check if binary logging is filtered for thread's current db.
@param thd Thread handle
@retval 1 the query is not filtered, 0 otherwise.
*/
bool thd_binlog_filter_ok(const MYSQL_THD thd);
-#endif /* MYSQL_VERSION_ID > 50140 */
+
+/**
+ Check if the query may generate row changes which
+ may end up in the binary.
+ @param thd Thread handle
+ @return 1 the query may generate row changes, 0 otherwise.
+*/
+bool thd_sqlcom_can_generate_row_events(const MYSQL_THD thd);
}
typedef struct trx_struct trx_t;
diff --git a/storage/xtradb/handler/handler0alter.cc b/storage/xtradb/handler/handler0alter.cc
index 3a32ed9cf36..daad61ed341 100644
--- a/storage/xtradb/handler/handler0alter.cc
+++ b/storage/xtradb/handler/handler0alter.cc
@@ -21,8 +21,10 @@ Place, Suite 330, Boston, MA 02111-1307 USA
Smart ALTER TABLE
*******************************************************/
-#include <mysql_priv.h>
+#include <unireg.h>
#include <mysqld_error.h>
+#include <sql_lex.h> // SQLCOM_CREATE_INDEX
+#include <mysql/innodb_priv.h>
extern "C" {
#include "log0log.h"
diff --git a/storage/xtradb/handler/i_s.cc b/storage/xtradb/handler/i_s.cc
index 0f656528315..17c22212ab5 100644
--- a/storage/xtradb/handler/i_s.cc
+++ b/storage/xtradb/handler/i_s.cc
@@ -23,8 +23,8 @@ InnoDB INFORMATION SCHEMA tables interface to MySQL.
Created July 18, 2007 Vasil Dimov
*******************************************************/
-#include <mysql_priv.h>
#include <mysqld_error.h>
+#include <sql_acl.h> // PROCESS_ACL
#include <m_ctype.h>
#include <hash.h>
diff --git a/storage/xtradb/handler/mysql_addons.cc b/storage/xtradb/handler/mysql_addons.cc
index eae1fe9fbc2..ae6306e5db9 100644
--- a/storage/xtradb/handler/mysql_addons.cc
+++ b/storage/xtradb/handler/mysql_addons.cc
@@ -36,7 +36,7 @@ Created November 07, 2007 Vasil Dimov
#define MYSQL_SERVER
#endif /* MYSQL_SERVER */
-#include <mysql_priv.h>
+#include <sql_priv.h>
#include "mysql_addons.h"
#include "univ.i"
diff --git a/storage/xtradb/include/handler0alter.h b/storage/xtradb/include/handler0alter.h
index 985b76f4f50..7f5af6d2e76 100644
--- a/storage/xtradb/include/handler0alter.h
+++ b/storage/xtradb/include/handler0alter.h
@@ -27,7 +27,7 @@ UNIV_INTERN
void
innobase_rec_to_mysql(
/*==================*/
- TABLE* table, /*!< in/out: MySQL table */
+ struct TABLE* table, /*!< in/out: MySQL table */
const rec_t* rec, /*!< in: record */
const dict_index_t* index, /*!< in: index */
const ulint* offsets); /*!< in: rec_get_offsets(
@@ -39,4 +39,4 @@ UNIV_INTERN
void
innobase_rec_reset(
/*===============*/
- TABLE* table); /*!< in/out: MySQL table */
+ struct TABLE* table); /*!< in/out: MySQL table */
diff --git a/storage/xtradb/include/row0merge.h b/storage/xtradb/include/row0merge.h
index 62a5efd11f7..fbeb125ce7b 100644
--- a/storage/xtradb/include/row0merge.h
+++ b/storage/xtradb/include/row0merge.h
@@ -191,7 +191,7 @@ row_merge_build_indexes(
unless creating a PRIMARY KEY */
dict_index_t** indexes, /*!< in: indexes to be created */
ulint n_indexes, /*!< in: size of indexes[] */
- TABLE* table); /*!< in/out: MySQL table, for
+ struct TABLE* table); /*!< in/out: MySQL table, for
reporting erroneous key value
if applicable */
#endif /* row0merge.h */
diff --git a/storage/xtradb/include/row0types.h b/storage/xtradb/include/row0types.h
index 7920fd75061..1be729206ba 100644
--- a/storage/xtradb/include/row0types.h
+++ b/storage/xtradb/include/row0types.h
@@ -54,6 +54,6 @@ typedef struct purge_node_struct purge_node_t;
typedef struct row_ext_struct row_ext_t;
/* MySQL data types */
-typedef struct st_table TABLE;
+struct TABLE;
#endif
diff --git a/storage/xtradb/os/os0thread.c b/storage/xtradb/os/os0thread.c
index 34818ada804..e41c1163371 100644
--- a/storage/xtradb/os/os0thread.c
+++ b/storage/xtradb/os/os0thread.c
@@ -200,10 +200,6 @@ os_thread_create(
#ifndef UNIV_HPUX10
pthread_attr_destroy(&attr);
#endif
- if (srv_set_thread_priorities) {
-
- my_pthread_setprio(pthread, srv_query_thread_priority);
- }
if (thread_id) {
*thread_id = pthread;
diff --git a/storage/xtradb/plug.in b/storage/xtradb/plug.in
index 37c895fb520..24ab62ec24b 100644
--- a/storage/xtradb/plug.in
+++ b/storage/xtradb/plug.in
@@ -15,7 +15,10 @@
#
MYSQL_STORAGE_ENGINE(xtradb, xtradb, [XtraDB Storage Engine],
- [XtraDB - a drop-in replacement for InnoDB], [max,max-no-ndb])
+ [XtraDB - a drop-in replacement for InnoDB],
+ dnl[max,max-no-ndb]
+ )
+MYSQL_PLUGIN_DISABLED(xtradb)
MYSQL_PLUGIN_DIRECTORY(xtradb, [storage/xtradb])
MYSQL_PLUGIN_STATIC(xtradb, [libxtradb.a])
MYSQL_PLUGIN_DYNAMIC(xtradb, [ha_xtradb.la])
diff --git a/storage/xtradb/row/row0merge.c b/storage/xtradb/row/row0merge.c
index 65102851bdf..1e1d19f28c8 100644
--- a/storage/xtradb/row/row0merge.c
+++ b/storage/xtradb/row/row0merge.c
@@ -408,7 +408,7 @@ row_merge_buf_add(
/** Structure for reporting duplicate records. */
struct row_merge_dup_struct {
const dict_index_t* index; /*!< index being sorted */
- TABLE* table; /*!< MySQL table object */
+ struct TABLE* table; /*!< MySQL table object */
ulint n_dup; /*!< number of duplicates */
};
@@ -1108,7 +1108,7 @@ ulint
row_merge_read_clustered_index(
/*===========================*/
trx_t* trx, /*!< in: transaction */
- TABLE* table, /*!< in/out: MySQL table object,
+ struct TABLE* table, /*!< in/out: MySQL table object,
for reporting erroneous records */
const dict_table_t* old_table,/*!< in: table where rows are
read from */
@@ -1403,7 +1403,7 @@ row_merge_blocks(
ulint* foffs1, /*!< in/out: offset of second
source list in the file */
merge_file_t* of, /*!< in/out: output file */
- TABLE* table) /*!< in/out: MySQL table, for
+ struct TABLE* table) /*!< in/out: MySQL table, for
reporting erroneous key value
if applicable */
{
@@ -1587,7 +1587,7 @@ row_merge(
index entries */
row_merge_block_t* block, /*!< in/out: 3 buffers */
int* tmpfd, /*!< in/out: temporary file handle */
- TABLE* table, /*!< in/out: MySQL table, for
+ struct TABLE* table, /*!< in/out: MySQL table, for
reporting erroneous key value
if applicable */
ulint* num_run,/*!< in/out: Number of runs remain
@@ -1709,7 +1709,7 @@ row_merge_sort(
index entries */
row_merge_block_t* block, /*!< in/out: 3 buffers */
int* tmpfd, /*!< in/out: temporary file handle */
- TABLE* table) /*!< in/out: MySQL table, for
+ struct TABLE* table) /*!< in/out: MySQL table, for
reporting erroneous key value
if applicable */
{
@@ -2558,7 +2558,7 @@ row_merge_build_indexes(
unless creating a PRIMARY KEY */
dict_index_t** indexes, /*!< in: indexes to be created */
ulint n_indexes, /*!< in: size of indexes[] */
- TABLE* table) /*!< in/out: MySQL table, for
+ struct TABLE* table) /*!< in/out: MySQL table, for
reporting erroneous key value
if applicable */
{