summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorunknown <mkindahl@dl145h.mysql.com>2007-07-25 15:40:43 +0200
committerunknown <mkindahl@dl145h.mysql.com>2007-07-25 15:40:43 +0200
commitef9738fe92e16b74c84b7f071e2cefb7b13b7fdd (patch)
tree86abdb47243643d4d06ad915695763fe597197c7 /include
parentb9c18aead4c151a555325462c20121d8c8a654a3 (diff)
parent6d0e34413d0aee7553b826d4cb5c9c64939ee990 (diff)
downloadmariadb-git-ef9738fe92e16b74c84b7f071e2cefb7b13b7fdd.tar.gz
Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1-main
into dl145h.mysql.com:/data0/mkindahl/mysql-5.1-2team include/my_bitmap.h: Auto merged mysql-test/suite/binlog/r/binlog_multi_engine.result: Auto merged mysql-test/suite/ndb/r/ndb_binlog_multi.result: Auto merged mysql-test/suite/ndb/t/ndb_autodiscover3.test: Auto merged mysql-test/suite/ndb/t/ndb_binlog_basic.test: Auto merged mysql-test/suite/ndb/t/ndb_binlog_ddl_multi.test: Auto merged mysql-test/suite/ndb/t/ndb_binlog_discover.test: Auto merged mysql-test/suite/ndb/t/ndb_binlog_ignore_db.test: Auto merged mysql-test/suite/ndb/t/ndb_binlog_log_bin.test: Auto merged mysql-test/suite/ndb/t/ndb_binlog_multi.test: Auto merged mysql-test/suite/ndb/t/ndb_multi_row.test: Auto merged mysql-test/suite/rpl/r/rpl_row_log.result: Auto merged mysql-test/suite/rpl/r/rpl_row_log_innodb.result: Auto merged mysql-test/suite/rpl/r/rpl_stm_log.result: Auto merged mysql-test/suite/rpl/r/rpl_truncate_7ndb_2.result: Auto merged mysql-test/suite/rpl_ndb/r/rpl_ndb_dd_partitions.result: Auto merged mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_UUID.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_bank.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_advance.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_basic.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_dd_partitions.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_ddl.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_extraCol.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_multi.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update2.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_ndbapi_multi.test: Auto merged mysql-test/suite/rpl_ndb/t/rpl_row_basic_7ndb.test: Auto merged sql/log_event.cc: Auto merged mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb.result: Manual merge mysql-test/t/disabled.def: Manual merge of main tree into replication tree
Diffstat (limited to 'include')
-rw-r--r--include/Makefile.am2
-rw-r--r--include/m_string.h12
-rw-r--r--include/my_base.h8
-rw-r--r--include/my_bitmap.h11
-rw-r--r--include/my_global.h18
-rw-r--r--include/my_md5.h (renamed from include/md5.h)0
-rw-r--r--include/mysql/plugin.h124
7 files changed, 166 insertions, 9 deletions
diff --git a/include/Makefile.am b/include/Makefile.am
index b803f614a93..0796341cc91 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -33,7 +33,7 @@ noinst_HEADERS = config-win.h config-netware.h \
mysys_err.h my_base.h help_start.h help_end.h \
my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \
my_aes.h my_tree.h my_trie.h hash.h thr_alarm.h \
- thr_lock.h t_ctype.h violite.h md5.h base64.h \
+ thr_lock.h t_ctype.h violite.h my_md5.h base64.h \
mysql_version.h.in my_handler.h my_time.h \
my_vle.h my_user.h my_atomic.h atomic/nolock.h \
atomic/rwlock.h atomic/x86-gcc.h atomic/x86-msvc.h \
diff --git a/include/m_string.h b/include/m_string.h
index 715720df294..00fb4cb0656 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -246,17 +246,17 @@ extern size_t my_snprintf(char *to, size_t n, const char *fmt, ...)
/*
LEX_STRING -- a pair of a C-string and its length.
-
- NOTE: this exactly form of declaration is required for some C-compilers
- (for one, Sun C 5.7 2005/01/07). Unfortunately with such declaration
- LEX_STRING can not be forward declared.
*/
-typedef struct
+#ifndef _my_plugin_h
+/* This definition must match the one given in mysql/plugin.h */
+struct st_mysql_lex_string
{
char *str;
size_t length;
-} LEX_STRING;
+};
+#endif
+typedef struct st_mysql_lex_string LEX_STRING;
#define STRING_WITH_LEN(X) (X), ((size_t) (sizeof(X) - 1))
#define USTRING_WITH_LEN(X) ((uchar*) X), ((size_t) (sizeof(X) - 1))
diff --git a/include/my_base.h b/include/my_base.h
index bb5fdfc8392..04127b81b78 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -180,7 +180,12 @@ enum ha_extra_function {
These flags are reset by the handler::extra(HA_EXTRA_RESET) call.
*/
HA_EXTRA_DELETE_CANNOT_BATCH,
- HA_EXTRA_UPDATE_CANNOT_BATCH
+ HA_EXTRA_UPDATE_CANNOT_BATCH,
+ /*
+ Inform handler that an "INSERT...ON DUPLICATE KEY UPDATE" will be
+ executed. This condition is unset by HA_EXTRA_NO_IGNORE_DUP_KEY.
+ */
+ HA_EXTRA_INSERT_WITH_UPDATE
};
/* The following is parameter to ha_panic() */
@@ -294,6 +299,7 @@ enum ha_base_keytype {
#define HA_PACK_RECORD 2 /* Request packed record format */
#define HA_CREATE_TMP_TABLE 4
#define HA_CREATE_CHECKSUM 8
+#define HA_CREATE_KEEP_FILES 16 /* don't overwrite .MYD and MYI */
#define HA_CREATE_DELAY_KEY_WRITE 64
#define HA_CREATE_RELIES_ON_SQL_LAYER 128
diff --git a/include/my_bitmap.h b/include/my_bitmap.h
index b2a24f98149..ab69b2d671d 100644
--- a/include/my_bitmap.h
+++ b/include/my_bitmap.h
@@ -104,6 +104,17 @@ extern void bitmap_lock_invert(MY_BITMAP *map);
&= ~ (1 << ((BIT) & 7)))
#define _bitmap_is_set(MAP, BIT) (uint) (((uchar*)(MAP)->bitmap)[(BIT) / 8] \
& (1 << ((BIT) & 7)))
+/*
+ WARNING!
+
+ The below symbols are inline functions in DEBUG builds and macros in
+ non-DEBUG builds. The latter evaluate their 'bit' argument twice.
+
+ NEVER use an increment/decrement operator with the 'bit' argument.
+ It would work with DEBUG builds, but fails later in production builds!
+
+ FORBIDDEN: bitmap_set_bit($my_bitmap, (field++)->field_index);
+*/
#ifndef DBUG_OFF
static inline void
bitmap_set_bit(MY_BITMAP *map,uint bit)
diff --git a/include/my_global.h b/include/my_global.h
index d6f331019f6..91860f6e7a9 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -23,6 +23,17 @@
#define HAVE_EXTERNAL_CLIENT
#endif
+/*
+ InnoDB depends on some MySQL internals which other plugins should not
+ need. This is because of InnoDB's foreign key support, "safe" binlog
+ truncation, and other similar legacy features.
+
+ We define accessors for these internals unconditionally, but do not
+ expose them in mysql/plugin.h. They are declared in ha_innodb.h for
+ InnoDB's use.
+*/
+#define INNODB_COMPATIBILITY_HOOKS
+
#ifdef __CYGWIN__
/* We use a Unix API, so pretend it's not Windows */
#undef WIN
@@ -968,7 +979,12 @@ typedef unsigned long uint32;
typedef unsigned long ulong; /* Short for unsigned long */
#endif
#ifndef longlong_defined
-#if defined(HAVE_LONG_LONG) && SIZEOF_LONG != 8
+/*
+ Using [unsigned] long long is preferable as [u]longlong because we use
+ [unsigned] long long unconditionally in many places,
+ for example in constants with [U]LL suffix.
+*/
+#if defined(HAVE_LONG_LONG) && SIZEOF_LONG_LONG == 8
typedef unsigned long long int ulonglong; /* ulong or unsigned long long */
typedef long long int longlong;
#else
diff --git a/include/md5.h b/include/my_md5.h
index f92976b3beb..f92976b3beb 100644
--- a/include/md5.h
+++ b/include/my_md5.h
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h
index 7b224695324..b87fcc60692 100644
--- a/include/mysql/plugin.h
+++ b/include/mysql/plugin.h
@@ -24,6 +24,32 @@ class Item;
#define MYSQL_THD void*
#endif
+#ifndef _m_string_h
+/* This definition must match the one given in m_string.h */
+struct st_mysql_lex_string
+{
+ char *str;
+ unsigned int length;
+};
+#endif /* _m_string_h */
+typedef struct st_mysql_lex_string MYSQL_LEX_STRING;
+
+#define MYSQL_XIDDATASIZE 128
+/**
+ struct st_mysql_xid is binary compatible with the XID structure as
+ in the X/Open CAE Specification, Distributed Transaction Processing:
+ The XA Specification, X/Open Company Ltd., 1991.
+ http://www.opengroup.org/bookstore/catalog/c193.htm
+
+ @see XID in sql/handler.h
+*/
+struct st_mysql_xid {
+ long formatID;
+ long gtrid_length;
+ long bqual_length;
+ char data[MYSQL_XIDDATASIZE]; /* Not \0-terminated */
+};
+typedef struct st_mysql_xid MYSQL_XID;
/*************************************************************************
Plugin API. Common for all plugin types.
@@ -655,7 +681,105 @@ void **thd_ha_data(const MYSQL_THD thd, const struct handlerton *hton);
int thd_tx_isolation(const MYSQL_THD thd);
char *thd_security_context(MYSQL_THD thd, char *buffer, unsigned int length,
unsigned int max_query_len);
+/* Increments the row counter, see THD::row_count */
+void thd_inc_row_count(MYSQL_THD thd);
+
+/**
+ Create a temporary file.
+
+ @details
+ The temporary file is created in a location specified by the mysql
+ server configuration (--tmpdir option). The caller does not need to
+ delete the file, it will be deleted automatically.
+
+ @param prefix prefix for temporary file name
+ @retval -1 error
+ @retval >= 0 a file handle that can be passed to dup or my_close
+*/
+int mysql_tmpfile(const char *prefix);
+
+/**
+ Check the killed state of a connection
+
+ @details
+ In MySQL support for the KILL statement is cooperative. The KILL
+ statement only sets a "killed" flag. This function returns the value
+ of that flag. A thread should check it often, especially inside
+ time-consuming loops, and gracefully abort the operation if it is
+ non-zero.
+
+ @param thd user thread connection handle
+ @retval 0 the connection is active
+ @retval 1 the connection has been killed
+*/
+int thd_killed(const MYSQL_THD thd);
+
+/**
+ Allocate memory in the connection's local memory pool
+
+ @details
+ When properly used in place of @c my_malloc(), this can significantly
+ improve concurrency. Don't use this or related functions to allocate
+ large chunks of memory. Use for temporary storage only. The memory
+ will be freed automatically at the end of the statement; no explicit
+ code is required to prevent memory leaks.
+ @see alloc_root()
+*/
+void *thd_alloc(MYSQL_THD thd, unsigned int size);
+/**
+ @see thd_alloc()
+*/
+void *thd_calloc(MYSQL_THD thd, unsigned int size);
+/**
+ @see thd_alloc()
+*/
+char *thd_strdup(MYSQL_THD thd, const char *str);
+/**
+ @see thd_alloc()
+*/
+char *thd_strmake(MYSQL_THD thd, const char *str, unsigned int size);
+/**
+ @see thd_alloc()
+*/
+void *thd_memdup(MYSQL_THD thd, const void* str, unsigned int size);
+
+/**
+ Create a LEX_STRING in this connection's local memory pool
+
+ @param thd user thread connection handle
+ @param lex_str pointer to LEX_STRING object to be initialized
+ @param str initializer to be copied into lex_str
+ @param length length of str, in bytes
+ @param allocate_lex_string flag: if TRUE, allocate new LEX_STRING object,
+ instead of using lex_str value
+ @return NULL on failure, or pointer to the LEX_STRING object
+
+ @see thd_alloc()
+*/
+MYSQL_LEX_STRING *thd_make_lex_string(MYSQL_THD thd, MYSQL_LEX_STRING *lex_str,
+ const char *str, unsigned int size,
+ int allocate_lex_string);
+
+/**
+ Get the XID for this connection's transaction
+
+ @param thd user thread connection handle
+ @param xid location where identifier is stored
+*/
+void thd_get_xid(const MYSQL_THD thd, MYSQL_XID *xid);
+
+/**
+ Invalidate the query cache for a given table.
+
+ @param thd user thread connection handle
+ @param key databasename\0tablename\0
+ @param key_length length of key in bytes, including the NUL bytes
+ @param using_trx flag: TRUE if using transactions, FALSE otherwise
+*/
+void mysql_query_cache_invalidate4(MYSQL_THD thd,
+ const char *key, unsigned int key_length,
+ int using_trx);
#ifdef __cplusplus
}