summaryrefslogtreecommitdiff
path: root/sql/handler.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/handler.h')
-rw-r--r--sql/handler.h84
1 files changed, 32 insertions, 52 deletions
diff --git a/sql/handler.h b/sql/handler.h
index 6d675683ada..0a561ec8b3f 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -52,7 +52,6 @@ class Rowid_filter;
class Field_string;
class Field_varstring;
class Field_blob;
-class Field_geom;
class Column_definition;
// the following is for checking tables
@@ -213,7 +212,8 @@ enum enum_alter_inplace_result {
#define HA_HAS_NEW_CHECKSUM (1ULL << 38)
#define HA_CAN_VIRTUAL_COLUMNS (1ULL << 39)
#define HA_MRR_CANT_SORT (1ULL << 40)
-#define HA_RECORD_MUST_BE_CLEAN_ON_WRITE (1ULL << 41) /* unused */
+/* All of VARCHAR is stored, including bytes after real varchar data */
+#define HA_RECORD_MUST_BE_CLEAN_ON_WRITE (1ULL << 41)
/*
This storage engine supports condition pushdown
@@ -297,6 +297,9 @@ enum enum_alter_inplace_result {
#define HA_PERSISTENT_TABLE (1ULL << 48)
+/* If storage engine uses another engine as a base */
+#define HA_REUSES_FILE_NAMES (1ULL << 49)
+
/*
Set of all binlog flags. Currently only contain the capabilities
flags.
@@ -511,6 +514,7 @@ enum legacy_db_type
DB_TYPE_BINLOG=21,
DB_TYPE_PBXT=23,
DB_TYPE_PERFORMANCE_SCHEMA=28,
+ DB_TYPE_S3=41,
DB_TYPE_ARIA=42,
DB_TYPE_TOKUDB=43,
DB_TYPE_SEQUENCE=44,
@@ -1029,11 +1033,7 @@ enum enum_schema_tables
SCH_TABLE_PRIVILEGES,
SCH_TRIGGERS,
SCH_USER_PRIVILEGES,
- SCH_VIEWS,
-#ifdef HAVE_SPATIAL
- SCH_GEOMETRY_COLUMNS,
- SCH_SPATIAL_REF_SYS,
-#endif /*HAVE_SPATIAL*/
+ SCH_VIEWS
};
struct TABLE_SHARE;
@@ -1247,11 +1247,6 @@ typedef struct st_order ORDER;
struct handlerton
{
/*
- Historical marker for if the engine is available of not
- */
- SHOW_COMP_OPTION state;
-
- /*
Historical number used for frm file to determine the correct
storage engine. This is going away and new engines will just use
"name" for this.
@@ -1650,6 +1645,14 @@ struct handlerton
int (*discover_table_structure)(handlerton *hton, THD* thd,
TABLE_SHARE *share, HA_CREATE_INFO *info);
+ /*
+ Notify the storage engine that the definition of the table (and the .frm
+ file) has changed. Returns 0 if ok.
+ */
+ int (*notify_tabledef_changed)(handlerton *hton, LEX_CSTRING *db,
+ LEX_CSTRING *table_name, LEX_CUSTRING *frm,
+ LEX_CUSTRING *org_tabledef_version);
+
/*
System Versioning
*/
@@ -1663,6 +1666,9 @@ struct handlerton
/* backup */
void (*prepare_for_backup)(void);
void (*end_backup)(void);
+
+ /* Server shutdown early notification.*/
+ void (*pre_shutdown)(void);
};
@@ -1954,11 +1960,13 @@ enum enum_stats_auto_recalc { HA_STATS_AUTO_RECALC_DEFAULT= 0,
It stores the "schema_specification" part of the CREATE/ALTER statements and
is passed to mysql_create_db() and mysql_alter_db().
- Currently consists only of the schema default character set and collation.
+ Currently consists of the schema default character set, collation
+ and schema_comment.
*/
struct Schema_specification_st
{
CHARSET_INFO *default_table_charset;
+ LEX_CSTRING *schema_comment;
void init()
{
bzero(this, sizeof(*this));
@@ -1967,13 +1975,6 @@ struct Schema_specification_st
class Create_field;
-enum vers_sys_type_t
-{
- VERS_UNDEFINED= 0,
- VERS_TIMESTAMP,
- VERS_TRX_ID
-};
-
struct Table_period_info: Sql_alloc
{
Table_period_info() :
@@ -2056,8 +2057,7 @@ public:
bool fix_create_like(Alter_info &alter_info, HA_CREATE_INFO &create_info,
TABLE_LIST &src_table, TABLE_LIST &table);
bool check_sys_fields(const Lex_table_name &table_name,
- const Lex_table_name &db, Alter_info *alter_info,
- bool can_native) const;
+ const Lex_table_name &db, Alter_info *alter_info) const;
/**
At least one field was specified 'WITH/WITHOUT SYSTEM VERSIONING'.
@@ -2200,10 +2200,14 @@ struct Table_scope_and_contents_source_st:
struct HA_CREATE_INFO: public Table_scope_and_contents_source_st,
public Schema_specification_st
{
+ /* TODO: remove after MDEV-20865 */
+ Alter_info *alter_info;
+
void init()
{
Table_scope_and_contents_source_st::init();
Schema_specification_st::init();
+ alter_info= NULL;
}
bool check_conflicting_charset_declarations(CHARSET_INFO *cs);
bool add_table_option_default_charset(CHARSET_INFO *cs)
@@ -4305,7 +4309,7 @@ public:
*) Update SQL-layer data-dictionary by installing .FRM file for the new version
of the table.
*) Inform the storage engine about this change by calling the
- handler::ha_notify_table_changed() method.
+ hton::notify_table_changed()
*) Destroy the Alter_inplace_info and handler_ctx objects.
*/
@@ -4372,16 +4376,6 @@ public:
bool commit);
- /**
- Public function wrapping the actual handler call.
- @see notify_table_changed()
- */
- void ha_notify_table_changed()
- {
- notify_table_changed();
- }
-
-
protected:
/**
Allows the storage engine to update internal structures with concurrent
@@ -4480,14 +4474,6 @@ protected:
return false;
}
-
- /**
- Notify the storage engine that the table structure (.FRM) has been updated.
-
- @note No errors are allowed during notify_table_changed().
- */
- virtual void notify_table_changed() { }
-
public:
/* End of On-line/in-place ALTER TABLE interface. */
@@ -4511,7 +4497,6 @@ public:
TABLE_SHARE* get_table_share() { return table_share; }
protected:
/* Service methods for use by storage engines. */
- void **ha_data(THD *) const;
THD *ha_thd(void) const;
/**
@@ -4871,11 +4856,6 @@ public:
{
return false;
}
- virtual bool can_convert_geom(const Field_geom *field,
- const Column_definition &new_type) const
- {
- return false;
- }
protected:
Handler_share *get_ha_share_ptr();
@@ -4929,8 +4909,7 @@ static inline bool ha_check_storage_engine_flag(const handlerton *db_type, uint3
static inline bool ha_storage_engine_is_enabled(const handlerton *db_type)
{
- return (db_type && db_type->create) ?
- (db_type->state == SHOW_OPTION_YES) : FALSE;
+ return db_type && db_type->create;
}
#define view_pseudo_hton ((handlerton *)1)
@@ -4946,7 +4925,7 @@ TYPELIB *ha_known_exts(void);
int ha_panic(enum ha_panic_function flag);
void ha_close_connection(THD* thd);
void ha_kill_query(THD* thd, enum thd_kill_levels level);
-bool ha_flush_logs(handlerton *db_type);
+bool ha_flush_logs();
void ha_drop_database(char* path);
void ha_checkpoint_state(bool disable);
void ha_commit_checkpoint_request(void *cookie, void (*pre_hook)(void *));
@@ -4957,6 +4936,7 @@ int ha_delete_table(THD *thd, handlerton *db_type, const char *path,
const LEX_CSTRING *db, const LEX_CSTRING *alias, bool generate_warning);
void ha_prepare_for_backup();
void ha_end_backup();
+void ha_pre_shutdown();
/* statistics and info */
bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat);
@@ -5056,12 +5036,12 @@ int binlog_log_row(TABLE* table,
{ \
Exec_time_tracker *this_tracker; \
if (unlikely((this_tracker= tracker))) \
- tracker->start_tracking(); \
+ tracker->start_tracking(table->in_use); \
\
MYSQL_TABLE_IO_WAIT(PSI, OP, INDEX, FLAGS, PAYLOAD); \
\
if (unlikely(this_tracker)) \
- tracker->stop_tracking(); \
+ tracker->stop_tracking(table->in_use); \
}
void print_keydup_error(TABLE *table, KEY *key, const char *msg, myf errflag);