1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Added NDB storage engine

include/my_base.h:
  Added three new errorcodes to be returned by the handler
sql/Makefile.am:
  Add new files discover.cc, ha_ndbcluster.cc and ha_ndbcluster.h
  Add include path of NDB files
sql/handler.cc:
  Added variable for keeping track of number of "discovers"
  Added NDB to list of storage engines
  Added calls to NDB for commit, rollback etc.
  Added function ha_discover for discovering a table from handler
sql/handler.h:
  Added NDB to list of storage engines
  Added vbariable in transaction for keeping a ndb transaction handle
sql/lex.h:
  Changed AND to AND_SYM and OR to OR_SYM to avoid nameclash
sql/mysql_priv.h:
  Added prototypes for new functions readfrm, writefrm and create_table_from_handler
sql/mysqld.cc:
  Added NDB support
  Disable NDB with --skip-ndbcluster
sql/set_var.cc:
  Add posibilty to show if NDB handler is supported
sql/ha_ndbcluster.cc:
  Add ifdef for whole file for not compiling anything if NDB sholdn't be included
  Updated timestamp handling to use new vars timestamp_default_now and timestamp_on_update_now
sql/sql_base.cc:
  If frm file is not found on disk, ask handler if it knows about the table. Then retry the open.
  This new functionality is called "discover" and can be used by any handler.
sql/sql_class.h:
  Added variable for keeping a NDB connection handle
sql/sql_table.cc:
  Before trying to create a table, ask handler if a table with that name already exists.
  If user said CREATE TABLE IF NOT EXISTS, disocver the table from handler
sql/sql_yacc.yy:
  Add NDBCLUSTER_SYM
  Change AND to AND_SYM
  Change OR to OR_SYM
sql/table.cc:
  Fixe for probelm when NullS is returned from bas_ext of a handler.
This commit is contained in:
unknown
2004-04-15 09:14:14 +02:00
parent fd1d14a017
commit b43af929f8
16 changed files with 3564 additions and 48 deletions

View File

@@ -28,7 +28,8 @@
#define NO_HASH /* Not yet implemented */
#endif
#if defined(HAVE_BERKELEY_DB) || defined(HAVE_INNOBASE_DB)
#if defined(HAVE_BERKELEY_DB) || defined(HAVE_INNOBASE_DB) || \
defined(HAVE_NDBCLUSTER_DB)
#define USING_TRANSACTIONS
#endif
@@ -80,7 +81,6 @@
#define HA_FILE_BASED (1 << 26)
/* bits in index_flags(index_number) for what you can do with index */
#define HA_WRONG_ASCII_ORDER 1 /* Can't use sorting through key */
#define HA_READ_NEXT 2 /* Read next record with same key */
@@ -141,12 +141,17 @@
#define HA_CACHE_TBL_ASKTRANSACT 1
#define HA_CACHE_TBL_TRANSACT 2
enum db_type { DB_TYPE_UNKNOWN=0,DB_TYPE_DIAB_ISAM=1,
DB_TYPE_HASH,DB_TYPE_MISAM,DB_TYPE_PISAM,
DB_TYPE_RMS_ISAM, DB_TYPE_HEAP, DB_TYPE_ISAM,
DB_TYPE_MRG_ISAM, DB_TYPE_MYISAM, DB_TYPE_MRG_MYISAM,
DB_TYPE_BERKELEY_DB, DB_TYPE_INNODB, DB_TYPE_GEMINI,
DB_TYPE_DEFAULT };
enum db_type
{
DB_TYPE_UNKNOWN=0,DB_TYPE_DIAB_ISAM=1,
DB_TYPE_HASH,DB_TYPE_MISAM,DB_TYPE_PISAM,
DB_TYPE_RMS_ISAM, DB_TYPE_HEAP, DB_TYPE_ISAM,
DB_TYPE_MRG_ISAM, DB_TYPE_MYISAM, DB_TYPE_MRG_MYISAM,
DB_TYPE_BERKELEY_DB, DB_TYPE_INNODB,
DB_TYPE_GEMINI, DB_TYPE_NDBCLUSTER,
DB_TYPE_DEFAULT // Must be last
};
struct show_table_type_st {
const char *type;
@@ -176,6 +181,7 @@ typedef struct st_thd_trans {
void *bdb_tid;
void *innobase_tid;
bool innodb_active_trans;
void *ndb_tid;
} THD_TRANS;
enum enum_tx_isolation { ISO_READ_UNCOMMITTED, ISO_READ_COMMITTED,
@@ -479,3 +485,5 @@ bool ha_flush_logs(void);
int ha_recovery_logging(THD *thd, bool on);
int ha_change_key_cache(KEY_CACHE *old_key_cache,
KEY_CACHE *new_key_cache);
int ha_discover(const char* dbname, const char* name,
const void** frmblob, uint* frmlen);