mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
14decc4fbc
(Mostly in DBUG_PRINT() and unused arguments) Fixed bug in query cache when used with traceing (--with-debug) Fixed memory leak in mysqldump Removed warnings from mysqltest scripts (replaced -- with #) BitKeeper/etc/ignore: added mysql-test/r/*.warnings BUILD/SETUP.sh: Don't build with BDB as default client/client_priv.h: Added OPT_DEBUG_INFO client/mysqlbinlog.cc: Fixed compiler warning client/mysqldump.c: Removed compiler warnings Added option --debug-info to detect memory leaks Fixed memory leak Don't backup cluster replication tables (if used with 5.1) cmd-line-utils/readline/bind.c: Fixed compiler warning cmd-line-utils/readline/chardefs.h: Fixed compiler warning cmd-line-utils/readline/complete.c: Fixed compiler warning cmd-line-utils/readline/display.c: Fixed compiler warning cmd-line-utils/readline/histexpand.c: Fixed compiler warning cmd-line-utils/readline/input.c: Fixed compiler warning cmd-line-utils/readline/isearch.c: Fixed compiler warning cmd-line-utils/readline/kill.c: Fixed compiler warning cmd-line-utils/readline/macro.c: Fixed compiler warning cmd-line-utils/readline/misc.c: Fixed compiler warning cmd-line-utils/readline/nls.c: Fixed compiler warning cmd-line-utils/readline/readline.c: Fixed compiler warning cmd-line-utils/readline/rltty.c: Fixed compiler warning cmd-line-utils/readline/search.c: Fixed compiler warning cmd-line-utils/readline/terminal.c: Fixed compiler warning cmd-line-utils/readline/text.c: Fixed compiler warning cmd-line-utils/readline/tilde.c: Fixed compiler warning cmd-line-utils/readline/undo.c: Fixed compiler warning cmd-line-utils/readline/util.c: Fixed compiler warning cmd-line-utils/readline/vi_mode.c: Fixed compiler warning dbug/dbug_analyze.c: Fixed compiler warning extra/yassl/src/ssl.cpp: Fixed compiler warning extra/yassl/testsuite/testsuite.cpp: Fixed compiler warning heap/_check.c: Fixed compiler warning heap/hp_delete.c: Fixed compiler warning heap/hp_hash.c: Fixed compiler warning heap/hp_open.c: Fixed compiler warning heap/hp_rkey.c: Fixed compiler warning heap/hp_rrnd.c: Fixed compiler warning heap/hp_write.c: Fixed compiler warning libmysql/libmysql.c: Fixed compiler warning libmysqld/libmysqld.c: Fixed compiler warning myisam/mi_close.c: Fixed compiler warning myisam/mi_delete.c: Fixed compiler warning myisam/mi_dynrec.c: Fixed compiler warning myisam/mi_keycache.c: Fixed compiler warning myisam/mi_page.c: Fixed compiler warning myisam/mi_statrec.c: Fixed compiler warning myisam/mi_test2.c: Fixed compiler warning myisam/mi_write.c: Fixed compiler warning myisam/myisampack.c: Fixed compiler warning myisammrg/myrg_extra.c: Fixed compiler warning mysql-test/mysql-test-run.pl: Remove .reject, .progress, .log and .warnings flag at start cluster -> mysql database (for 5.1) mysql-test/include/federated.inc: Remove mysqltest warnings mysql-test/include/sp-vars.inc: Remove mysqltest warnings mysql-test/mysql-test-run.sh: Fix so that 'make test' works again Remove .reject, .progress .log and .warnings files at startup mysql-test/r/ctype_cp1250_ch.result: Drop used tables at startup mysql-test/t/create.test: Remove mysqltest warnings mysql-test/t/csv.test: Remove mysqltest warnings mysql-test/t/ctype_collate.test: Remove mysqltest warnings mysql-test/t/ctype_cp1250_ch.test: Drop used tables at startup mysql-test/t/ctype_ucs.test: Remove mysqltest warnings mysql-test/t/func_sapdb.test: Remove mysqltest warnings mysql-test/t/func_str.test: Remove mysqltest warnings mysql-test/t/grant.test: Remove mysqltest warnings mysql-test/t/greedy_optimizer.test: Remove mysqltest warnings mysql-test/t/group_min_max.test: Remove mysqltest warnings mysql-test/t/innodb.test: Remove mysqltest warnings mysql-test/t/join.test: Remove mysqltest warnings mysql-test/t/limit.test: Remove mysqltest warnings mysql-test/t/null.test: Remove mysqltest warnings mysql-test/t/select.test: Remove mysqltest warnings mysql-test/t/sp-prelocking.test: Remove mysqltest warnings mysql-test/t/strict.test: Remove mysqltest warnings mysql-test/t/subselect.test: Remove mysqltest warnings mysql-test/t/type_newdecimal.test: Remove mysqltest warnings mysql-test/t/view_grant.test: Remove mysqltest warnings mysys/default.c: Fixed compiler warning mysys/hash.c: Fixed compiler warning mysys/list.c: Fixed compiler warning mysys/mf_iocache.c: Fixed compiler warning mysys/mf_keycache.c: Fixed compiler warning mysys/mf_keycaches.c: Fixed compiler warning mysys/my_alloc.c: Fixed compiler warning mysys/my_dup.c: Fixed compiler warning mysys/my_fopen.c: Fixed compiler warning mysys/my_fstream.c: Fixed compiler warning mysys/my_getwd.c: Fixed compiler warning mysys/my_handler.c: Fixed compiler warning Added missing enums in switch mysys/my_lib.c: Fixed compiler warning mysys/my_lread.c: Fixed compiler warning mysys/my_lwrite.c: Fixed compiler warning mysys/my_malloc.c: Fixed compiler warning mysys/my_pread.c: Fixed compiler warning mysys/my_read.c: Fixed compiler warning mysys/my_realloc.c: Fixed compiler warning mysys/my_seek.c: Fixed compiler warning mysys/my_write.c: Fixed compiler warning mysys/safemalloc.c: Fixed compiler warning mysys/thr_lock.c: Fixed compiler warning mysys/tree.c: Fixed compiler warning mysys/typelib.c: Fixed compiler warning ndb/include/logger/LogHandler.hpp: Changed SetErrorStr() to take const char* to remove compiler warnings (as many arguments to this are const strings) ndb/include/ndb_global.h.in: Added LINT_SET_PTR macro to be able to remove some compiler warnings ndb/include/util/InputStream.hpp: Fixed compiler warning ndb/include/util/OutputStream.hpp: Fixed compiler warning ndb/include/util/SimpleProperties.hpp: Fixed compiler warning ndb/src/common/debugger/EventLogger.cpp: remove if on 'signal' as this is a function pointer and is always true ndb/src/common/debugger/signaldata/BackupSignalData.cpp: Add missing enums ndb/src/common/logger/LogHandler.cpp: Changed SetErrorStr() to take const char* to remove compiler warnings (as many arguments to this are const strings) ndb/src/common/portlib/NdbMutex.c: Fixed compiler warning ndb/src/common/portlib/NdbThread.c: Fixed compiler warning ndb/src/common/transporter/Transporter.cpp: Swapped arguments to remove compiler warnings ndb/src/cw/cpcd/CPCD.hpp: Fixed compiler warning ndb/src/kernel/blocks/backup/Backup.cpp: Fixed compiler warning ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: Fixed compiler warning ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Fixed compiler warning ndb/src/kernel/blocks/dbtux/DbtuxSearch.cpp: Fixed compiler warning ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp: Added missing enums ndb/src/kernel/blocks/qmgr/QmgrMain.cpp: Fixed compiler warning ndb/src/kernel/error/ErrorReporter.cpp: Fixed compiler warning ndb/src/kernel/error/ErrorReporter.hpp: Fixed compiler warning ndb/src/kernel/error/ndbd_exit_codes.c: Fixed compiler warning ndb/src/kernel/vm/TransporterCallback.cpp: Fixed compiler warning ndb/src/mgmapi/mgmapi.cpp: Fixed compiler warning ndb/src/mgmclient/CommandInterpreter.cpp: Fixed compiler warning ndb/src/mgmsrv/MgmtSrvr.cpp: Fixed compiler warning ndb/src/mgmsrv/Services.cpp: Fixed compiler warning ndb/src/ndbapi/ClusterMgr.cpp: Fixed compiler warning ndb/src/ndbapi/DictCache.cpp: Fixed compiler warning ndb/src/ndbapi/Ndb.cpp: Fixed compiler warning ndb/src/ndbapi/NdbOperationDefine.cpp: Fixed compiler warning ndb/src/ndbapi/NdbOperationExec.cpp: Fixed compiler warning ndb/src/ndbapi/NdbOperationInt.cpp: Fixed compiler warning ndb/src/ndbapi/NdbOperationSearch.cpp: Fixed compiler warning ndb/src/ndbapi/NdbTransaction.cpp: Fixed compiler warning ndb/src/ndbapi/Ndbif.cpp: Fixed compiler warning ndb/src/ndbapi/Ndbinit.cpp: Fixed compiler warning ndb/src/ndbapi/ndb_cluster_connection.cpp: Fixed compiler warning ndb/tools/drop_index.cpp: Fixed compiler warning ndb/tools/drop_tab.cpp: Fixed compiler warning ndb/tools/ndb_config.cpp: Fixed compiler warning regex/regexec.c: Fixed compiler warning server-tools/instance-manager/mysql_connection.cc: Fixed compiler warning sql/Makefile.am: Fix for bison 1.875, which adds an attribute statement that gcc 4.1.0 can't parse sql/filesort.cc: Fixed compiler warning sql/ha_archive.cc: Fixed compiler warning sql/ha_federated.cc: Fixed compiler warning sql/ha_federated.h: Fixed compiler warning sql/ha_innodb.cc: Fixed compiler warning sql/ha_myisam.cc: Fixed compiler warning sql/ha_myisammrg.cc: Fixed compiler warning sql/ha_ndbcluster.cc: Fixed compiler warning sql/handler.cc: Fixed compiler warning sql/item_cmpfunc.cc: Fixed compiler warning sql/item_subselect.cc: Fixed compiler warning sql/item_timefunc.cc: Fixed compiler warning sql/log_event.cc: Fixed compiler warning sql/mysqld.cc: Fixed compiler warning sql/net_serv.cc: Fixed compiler warning sql/opt_range.cc: Fixed compiler warning Formated DBUG statements to be as rest of code sql/slave.cc: Fixed compiler warning sql/sql_acl.cc: Fixed compiler warning sql/sql_cache.cc: Fixed compiler warning Fixed bug in query cache when used with DBUG traceing sql/sql_class.cc: Fixed compiler warning sql/sql_class.h: Fixed compiler warning sql/sql_delete.cc: Fixed compiler warning sql/sql_parse.cc: Fixed compiler warning Hack to fix my_sprintf() strings with %b sql/sql_prepare.cc: Fixed compiler warning Hack to fix my_sprintf() strings with %b sql/sql_repl.cc: Fixed compiler warning sql/sql_select.cc: Fixed compiler warning sql/sql_update.cc: Fixed compiler warning sql/sql_view.cc: Fixed compiler warning sql/strfunc.cc: Fixed compiler warning sql-common/client.c: Fixed compiler warning sql-common/my_time.c: Fixed compiler warning sql/table.cc: Fixed compiler warning sql/tztime.cc: Fixed compiler warning sql/unireg.cc: Fixed compiler warning strings/decimal.c: Fixed compiler warning tests/mysql_client_test.c: Fixed compiler warning vio/viosocket.c: Fixed compiler warning vio/viossl.c: Fixed compiler warning vio/viosslfactories.c: Fixed compiler warning
313 lines
12 KiB
C++
313 lines
12 KiB
C++
/* Copyright (C) 2003 MySQL AB
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
|
|
|
/*
|
|
Please read ha_exmple.cc before reading this file.
|
|
Please keep in mind that the federated storage engine implements all methods
|
|
that are required to be implemented. handler.h has a full list of methods
|
|
that you can implement.
|
|
*/
|
|
|
|
#ifdef USE_PRAGMA_INTERFACE
|
|
#pragma interface /* gcc class implementation */
|
|
#endif
|
|
|
|
#include <mysql.h>
|
|
|
|
/*
|
|
handler::print_error has a case statement for error numbers.
|
|
This value is (10000) is far out of range and will envoke the
|
|
default: case.
|
|
(Current error range is 120-159 from include/my_base.h)
|
|
*/
|
|
#define HA_FEDERATED_ERROR_WITH_REMOTE_SYSTEM 10000
|
|
|
|
#define FEDERATED_QUERY_BUFFER_SIZE STRING_BUFFER_USUAL_SIZE * 5
|
|
#define FEDERATED_RECORDS_IN_RANGE 2
|
|
|
|
#define FEDERATED_INFO " SHOW TABLE STATUS LIKE "
|
|
#define FEDERATED_INFO_LEN sizeof(FEDERATED_INFO)
|
|
#define FEDERATED_SELECT "SELECT "
|
|
#define FEDERATED_SELECT_LEN sizeof(FEDERATED_SELECT)
|
|
#define FEDERATED_WHERE " WHERE "
|
|
#define FEDERATED_WHERE_LEN sizeof(FEDERATED_WHERE)
|
|
#define FEDERATED_FROM " FROM "
|
|
#define FEDERATED_FROM_LEN sizeof(FEDERATED_FROM)
|
|
#define FEDERATED_PERCENT "%"
|
|
#define FEDERATED_PERCENT_LEN sizeof(FEDERATED_PERCENT)
|
|
#define FEDERATED_IS " IS "
|
|
#define FEDERATED_IS_LEN sizeof(FEDERATED_IS)
|
|
#define FEDERATED_NULL " NULL "
|
|
#define FEDERATED_NULL_LEN sizeof(FEDERATED_NULL)
|
|
#define FEDERATED_ISNULL " IS NULL "
|
|
#define FEDERATED_ISNULL_LEN sizeof(FEDERATED_ISNULL)
|
|
#define FEDERATED_LIKE " LIKE "
|
|
#define FEDERATED_LIKE_LEN sizeof(FEDERATED_LIKE)
|
|
#define FEDERATED_TRUNCATE "TRUNCATE "
|
|
#define FEDERATED_TRUNCATE_LEN sizeof(FEDERATED_TRUNCATE)
|
|
#define FEDERATED_DELETE "DELETE "
|
|
#define FEDERATED_DELETE_LEN sizeof(FEDERATED_DELETE)
|
|
#define FEDERATED_INSERT "INSERT INTO "
|
|
#define FEDERATED_INSERT_LEN sizeof(FEDERATED_INSERT)
|
|
#define FEDERATED_OPTIMIZE "OPTIMIZE TABLE "
|
|
#define FEDERATED_OPTIMIZE_LEN sizeof(FEDERATED_OPTIMIZE)
|
|
#define FEDERATED_REPAIR "REPAIR TABLE "
|
|
#define FEDERATED_REPAIR_LEN sizeof(FEDERATED_REPAIR)
|
|
#define FEDERATED_QUICK " QUICK"
|
|
#define FEDERATED_QUICK_LEN sizeof(FEDERATED_QUICK)
|
|
#define FEDERATED_EXTENDED " EXTENDED"
|
|
#define FEDERATED_EXTENDED_LEN sizeof(FEDERATED_EXTENDED)
|
|
#define FEDERATED_USE_FRM " USE_FRM"
|
|
#define FEDERATED_USE_FRM_LEN sizeof(FEDERATED_USE_FRM)
|
|
#define FEDERATED_LIMIT1 " LIMIT 1"
|
|
#define FEDERATED_LIMIT1_LEN sizeof(FEDERATED_LIMIT1)
|
|
#define FEDERATED_VALUES "VALUES "
|
|
#define FEDERATED_VALUES_LEN sizeof(FEDERATED_VALUES)
|
|
#define FEDERATED_UPDATE "UPDATE "
|
|
#define FEDERATED_UPDATE_LEN sizeof(FEDERATED_UPDATE)
|
|
#define FEDERATED_SET " SET "
|
|
#define FEDERATED_SET_LEN sizeof(FEDERATED_SET)
|
|
#define FEDERATED_AND " AND "
|
|
#define FEDERATED_AND_LEN sizeof(FEDERATED_AND)
|
|
#define FEDERATED_CONJUNCTION ") AND ("
|
|
#define FEDERATED_CONJUNCTION_LEN sizeof(FEDERATED_CONJUNCTION)
|
|
#define FEDERATED_OR " OR "
|
|
#define FEDERATED_OR_LEN sizeof(FEDERATED_OR)
|
|
#define FEDERATED_NOT " NOT "
|
|
#define FEDERATED_NOT_LEN sizeof(FEDERATED_NOT)
|
|
#define FEDERATED_STAR "* "
|
|
#define FEDERATED_STAR_LEN sizeof(FEDERATED_STAR)
|
|
#define FEDERATED_SPACE " "
|
|
#define FEDERATED_SPACE_LEN sizeof(FEDERATED_SPACE)
|
|
#define FEDERATED_SQUOTE "'"
|
|
#define FEDERATED_SQUOTE_LEN sizeof(FEDERATED_SQUOTE)
|
|
#define FEDERATED_COMMA ", "
|
|
#define FEDERATED_COMMA_LEN sizeof(FEDERATED_COMMA)
|
|
#define FEDERATED_BTICK "`"
|
|
#define FEDERATED_BTICK_LEN sizeof(FEDERATED_BTICK)
|
|
#define FEDERATED_OPENPAREN " ("
|
|
#define FEDERATED_OPENPAREN_LEN sizeof(FEDERATED_OPENPAREN)
|
|
#define FEDERATED_CLOSEPAREN ") "
|
|
#define FEDERATED_CLOSEPAREN_LEN sizeof(FEDERATED_CLOSEPAREN)
|
|
#define FEDERATED_NE " != "
|
|
#define FEDERATED_NE_LEN sizeof(FEDERATED_NE)
|
|
#define FEDERATED_GT " > "
|
|
#define FEDERATED_GT_LEN sizeof(FEDERATED_GT)
|
|
#define FEDERATED_LT " < "
|
|
#define FEDERATED_LT_LEN sizeof(FEDERATED_LT)
|
|
#define FEDERATED_LE " <= "
|
|
#define FEDERATED_LE_LEN sizeof(FEDERATED_LE)
|
|
#define FEDERATED_GE " >= "
|
|
#define FEDERATED_GE_LEN sizeof(FEDERATED_GE)
|
|
#define FEDERATED_EQ " = "
|
|
#define FEDERATED_EQ_LEN sizeof(FEDERATED_EQ)
|
|
#define FEDERATED_FALSE " 1=0"
|
|
#define FEDERATED_FALSE_LEN sizeof(FEDERATED_FALSE)
|
|
|
|
/*
|
|
FEDERATED_SHARE is a structure that will be shared amoung all open handlers
|
|
The example implements the minimum of what you will probably need.
|
|
*/
|
|
typedef struct st_federated_share {
|
|
/*
|
|
the primary select query to be used in rnd_init
|
|
*/
|
|
char *select_query;
|
|
/*
|
|
remote host info, parse_url supplies
|
|
*/
|
|
char *scheme;
|
|
char *connect_string;
|
|
char *hostname;
|
|
char *username;
|
|
char *password;
|
|
char *database;
|
|
char *table_name;
|
|
char *table;
|
|
char *socket;
|
|
char *sport;
|
|
ushort port;
|
|
uint table_name_length, connect_string_length, use_count;
|
|
pthread_mutex_t mutex;
|
|
THR_LOCK lock;
|
|
} FEDERATED_SHARE;
|
|
|
|
/*
|
|
Class definition for the storage engine
|
|
*/
|
|
class ha_federated: public handler
|
|
{
|
|
THR_LOCK_DATA lock; /* MySQL lock */
|
|
FEDERATED_SHARE *share; /* Shared lock info */
|
|
MYSQL *mysql; /* MySQL connection */
|
|
MYSQL_RES *stored_result;
|
|
uint fetch_num; // stores the fetch num
|
|
MYSQL_ROW_OFFSET current_position; // Current position used by ::position()
|
|
int remote_error_number;
|
|
char remote_error_buf[FEDERATED_QUERY_BUFFER_SIZE];
|
|
|
|
private:
|
|
/*
|
|
return 0 on success
|
|
return errorcode otherwise
|
|
*/
|
|
uint convert_row_to_internal_format(byte *buf, MYSQL_ROW row,
|
|
MYSQL_RES *result);
|
|
bool create_where_from_key(String *to, KEY *key_info,
|
|
const key_range *start_key,
|
|
const key_range *end_key,
|
|
bool records_in_range);
|
|
int stash_remote_error();
|
|
|
|
public:
|
|
ha_federated(TABLE *table_arg);
|
|
~ha_federated()
|
|
{
|
|
}
|
|
/* The name that will be used for display purposes */
|
|
const char *table_type() const { return "FEDERATED"; }
|
|
/*
|
|
The name of the index type that will be used for display
|
|
don't implement this method unless you really have indexes
|
|
*/
|
|
// perhaps get index type
|
|
const char *index_type(uint inx) { return "REMOTE"; }
|
|
const char **bas_ext() const;
|
|
/*
|
|
This is a list of flags that says what the storage engine
|
|
implements. The current table flags are documented in
|
|
handler.h
|
|
*/
|
|
ulong table_flags() const
|
|
{
|
|
/* fix server to be able to get remote server table flags */
|
|
return (HA_NOT_EXACT_COUNT |
|
|
HA_PRIMARY_KEY_IN_READ_INDEX | HA_FILE_BASED | HA_REC_NOT_IN_SEQ |
|
|
HA_AUTO_PART_KEY | HA_CAN_INDEX_BLOBS| HA_NO_PREFIX_CHAR_KEYS |
|
|
HA_NULL_IN_KEY
|
|
);
|
|
}
|
|
/*
|
|
This is a bitmap of flags that says how the storage engine
|
|
implements indexes. The current index flags are documented in
|
|
handler.h. If you do not implement indexes, just return zero
|
|
here.
|
|
|
|
part is the key part to check. First key part is 0
|
|
If all_parts it's set, MySQL want to know the flags for the combined
|
|
index up to and including 'part'.
|
|
*/
|
|
/* fix server to be able to get remote server index flags */
|
|
ulong index_flags(uint inx, uint part, bool all_parts) const
|
|
{
|
|
return (HA_READ_NEXT | HA_READ_RANGE | HA_READ_AFTER_KEY);
|
|
}
|
|
uint max_supported_record_length() const { return HA_MAX_REC_LENGTH; }
|
|
uint max_supported_keys() const { return MAX_KEY; }
|
|
uint max_supported_key_parts() const { return MAX_REF_PARTS; }
|
|
uint max_supported_key_length() const { return MAX_KEY_LENGTH; }
|
|
/*
|
|
Called in test_quick_select to determine if indexes should be used.
|
|
Normally, we need to know number of blocks . For federated we need to
|
|
know number of blocks on remote side, and number of packets and blocks
|
|
on the network side (?)
|
|
Talk to Kostja about this - how to get the
|
|
number of rows * ...
|
|
disk scan time on other side (block size, size of the row) + network time ...
|
|
The reason for "records * 1000" is that such a large number forces
|
|
this to use indexes "
|
|
*/
|
|
double scan_time()
|
|
{
|
|
DBUG_PRINT("info", ("records %ld", (long) records));
|
|
return (double)(records*1000);
|
|
}
|
|
/*
|
|
The next method will never be called if you do not implement indexes.
|
|
*/
|
|
double read_time(uint index, uint ranges, ha_rows rows)
|
|
{
|
|
/*
|
|
Per Brian, this number is bugus, but this method must be implemented,
|
|
and at a later date, he intends to document this issue for handler code
|
|
*/
|
|
return (double) rows / 20.0+1;
|
|
}
|
|
|
|
const key_map *keys_to_use_for_scanning() { return &key_map_full; }
|
|
/*
|
|
Everything below are methods that we implment in ha_federated.cc.
|
|
|
|
Most of these methods are not obligatory, skip them and
|
|
MySQL will treat them as not implemented
|
|
*/
|
|
int open(const char *name, int mode, uint test_if_locked); // required
|
|
int close(void); // required
|
|
|
|
int write_row(byte *buf);
|
|
int update_row(const byte *old_data, byte *new_data);
|
|
int delete_row(const byte *buf);
|
|
int index_init(uint keynr);
|
|
int index_read(byte *buf, const byte *key,
|
|
uint key_len, enum ha_rkey_function find_flag);
|
|
int index_read_idx(byte *buf, uint idx, const byte *key,
|
|
uint key_len, enum ha_rkey_function find_flag);
|
|
int index_next(byte *buf);
|
|
int index_end();
|
|
int read_range_first(const key_range *start_key,
|
|
const key_range *end_key,
|
|
bool eq_range, bool sorted);
|
|
int read_range_next();
|
|
/*
|
|
unlike index_init(), rnd_init() can be called two times
|
|
without rnd_end() in between (it only makes sense if scan=1).
|
|
then the second call should prepare for the new table scan
|
|
(e.g if rnd_init allocates the cursor, second call should
|
|
position it to the start of the table, no need to deallocate
|
|
and allocate it again
|
|
*/
|
|
int rnd_init(bool scan); //required
|
|
int rnd_end();
|
|
int rnd_next(byte *buf); //required
|
|
int rnd_pos(byte *buf, byte *pos); //required
|
|
void position(const byte *record); //required
|
|
int info(uint); //required
|
|
|
|
void update_auto_increment(void);
|
|
int repair(THD* thd, HA_CHECK_OPT* check_opt);
|
|
int optimize(THD* thd, HA_CHECK_OPT* check_opt);
|
|
|
|
int delete_all_rows(void);
|
|
int create(const char *name, TABLE *form,
|
|
HA_CREATE_INFO *create_info); //required
|
|
ha_rows records_in_range(uint inx, key_range *start_key,
|
|
key_range *end_key);
|
|
uint8 table_cache_type() { return HA_CACHE_TBL_NOCACHE; }
|
|
|
|
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
|
|
enum thr_lock_type lock_type); //required
|
|
virtual bool get_error_message(int error, String *buf);
|
|
|
|
int read_next(byte *buf, MYSQL_RES *result);
|
|
int index_read_idx_with_result_set(byte *buf, uint index,
|
|
const byte *key,
|
|
uint key_len,
|
|
ha_rkey_function find_flag,
|
|
MYSQL_RES **result);
|
|
};
|
|
|
|
bool federated_db_init(void);
|
|
bool federated_db_end(void);
|