339
339
Number of rows in table. It will only be called if
340
340
(table_flags() & (HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT)) != 0
342
virtual ha_rows records() { return stats.records; }
342
virtual ha_rows records();
344
344
Return upper bound of current number of records in the table
345
345
(max. of how many records one will retrieve when doing a full table scan)
1181
1181
#define ha_commit(session) (ha_commit_trans((session), true))
1182
1182
#define ha_rollback(session) (ha_rollback_trans((session), true))
1185
handlerton *ha_default_handlerton(Session *session);
1186
plugin_ref ha_resolve_by_name(Session *session, const LEX_STRING *name);
1187
plugin_ref ha_lock_engine(Session *session, handlerton *hton);
1188
handlerton *ha_resolve_by_legacy_type(Session *session, enum legacy_db_type db_type);
1189
handler *get_new_handler(TABLE_SHARE *share, MEM_ROOT *alloc,
1190
handlerton *db_type);
1191
handlerton *ha_checktype(Session *session, enum legacy_db_type database_type,
1192
bool no_substitute, bool report_error);
1195
static inline enum legacy_db_type ha_legacy_type(const handlerton *db_type)
1197
return (db_type == NULL) ? DB_TYPE_UNKNOWN : db_type->db_type;
1200
static inline const char *ha_resolve_storage_engine_name(const handlerton *db_type)
1202
return db_type == NULL ? "UNKNOWN" : hton2plugin[db_type->slot]->name.str;
1205
static inline bool ha_check_storage_engine_flag(const handlerton *db_type, uint32_t flag)
1207
return db_type == NULL ? false : test(db_type->flags & flag);
1210
static inline bool ha_storage_engine_is_enabled(const handlerton *db_type)
1212
return (db_type && db_type->create) ?
1213
(db_type->state == SHOW_OPTION_YES) : false;
1216
1184
/* basic stuff */
1217
1185
int ha_init_errors(void);
1218
1186
int ha_init(void);