Commit 1fabfe9c authored by marko's avatar marko

branches/zip: Move the code related to fast index creation

(smart ALTER TABLE) from ha_innodb.cc to a separate module, handler0alter.cc.
parent fbcd7fbe
......@@ -122,7 +122,8 @@ noinst_HEADERS = include/btr0btr.h include/btr0btr.ic \
include/ut0ut.ic include/ut0vec.h \
include/ut0vec.ic include/ut0list.h \
include/ut0list.ic include/ut0wqueue.h \
include/ha_prototypes.h handler/ha_innodb.h
include/ha_prototypes.h handler/ha_innodb.h \
include/handler0alter.h
EXTRA_LIBRARIES = libinnobase.a
noinst_LIBRARIES = @plugin_innobase_static_target@
......@@ -159,7 +160,7 @@ libinnobase_a_SOURCES = btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c \
usr/usr0sess.c ut/ut0byte.c ut/ut0dbg.c \
ut/ut0list.c ut/ut0mem.c ut/ut0rnd.c \
ut/ut0ut.c ut/ut0vec.c ut/ut0wqueue.c \
handler/ha_innodb.cc
handler/ha_innodb.cc handler/handler0alter.cc
libinnobase_a_CXXFLAGS= $(AM_CFLAGS)
libinnobase_a_CFLAGS = $(AM_CFLAGS)
......
This diff is collapsed.
......@@ -198,10 +198,12 @@ class ha_innobase: public handler
static ulonglong get_mysql_bin_log_pos();
bool primary_key_is_clustered() { return true; }
int cmp_ref(const uchar *ref1, const uchar *ref2);
/** Fast index creation (smart ALTER TABLE) @see handler0alter.cc @{ */
int add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys);
int prepare_drop_index(TABLE *table_arg, uint *key_num,
uint num_of_keys);
int final_drop_index(TABLE *table_arg);
/** @} */
bool check_if_incompatible_data(HA_CREATE_INFO *info,
uint table_changes);
};
......@@ -265,3 +267,27 @@ int innobase_report_binlog_offset_and_commit(
int innobase_commit_complete(void* trx_handle);
void innobase_store_binlog_offset_and_flush_log(char *binlog_name,longlong offset);
#endif
typedef struct trx_struct trx_t;
/*************************************************************************
Gets the InnoDB transaction handle for a MySQL handler object, creates
an InnoDB transaction struct if the corresponding MySQL thread struct still
lacks one. */
extern "C"
trx_t*
check_trx_exists(
/*=============*/
/* out: InnoDB transaction handle */
MYSQL_THD thd) /* in: user thread handle */
__attribute__((nonnull));
/************************************************************************
Converts an InnoDB error code to a MySQL error code and also tells to MySQL
about a possible transaction rollback inside InnoDB caused by a lock wait
timeout or a deadlock. */
extern "C"
int
convert_error_code_to_mysql(
/*========================*/
/* out: MySQL error code */
int error, /* in: InnoDB error code */
MYSQL_THD thd); /* in: user thread handle or NULL */
This diff is collapsed.
......@@ -73,5 +73,24 @@ innobase_mysql_print_thd(
void* thd, /* in: pointer to a MySQL THD object */
uint max_query_len); /* in: max query length to print, or 0 to
use the default max length */
/******************************************************************
Converts a MySQL type to an InnoDB type. Note that this function returns
the 'mtype' of InnoDB. InnoDB differentiates between MySQL's old <= 4.1
VARCHAR and the new true VARCHAR in >= 5.0.3 by the 'prtype'. */
ulint
get_innobase_type_from_mysql_type(
/*==============================*/
/* out: DATA_BINARY,
DATA_VARCHAR, ... */
ulint* unsigned_flag, /* out: DATA_UNSIGNED if an
'unsigned type';
at least ENUM and SET,
and unsigned integer
types are 'unsigned types' */
const void* field) /* in: MySQL Field */
__attribute__((nonnull));
#endif
#endif
/******************************************************
Smart ALTER TABLE
(c) 2005-2007 Innobase Oy
*******************************************************/
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