diff options
author | Alexander Nozdrin <alik@sun.com> | 2009-11-05 15:08:37 +0300 |
---|---|---|
committer | Alexander Nozdrin <alik@sun.com> | 2009-11-05 15:08:37 +0300 |
commit | 411a6bfeb94e89f4cd4b8daaee96fe1913218a85 (patch) | |
tree | 64caab6e7d4a7167ee56b4f7d6572bb07c30750a /include | |
parent | afe8b83bb82055c2510244e26fd2d7ad409f9fbf (diff) | |
parent | 06bfaf21f2965539ab76fed3338b3cb0089adc57 (diff) | |
download | mariadb-git-411a6bfeb94e89f4cd4b8daaee96fe1913218a85.tar.gz |
Auto-merge from mysql-next-mr.
Diffstat (limited to 'include')
-rw-r--r-- | include/config-win.h | 1 | ||||
-rw-r--r-- | include/errmsg.h | 3 | ||||
-rw-r--r-- | include/hash.h | 34 | ||||
-rw-r--r-- | include/my_base.h | 12 | ||||
-rw-r--r-- | include/mysql.h | 128 | ||||
-rw-r--r-- | include/mysql.h.pp | 83 | ||||
-rw-r--r-- | include/mysql_com.h | 27 |
7 files changed, 50 insertions, 238 deletions
diff --git a/include/config-win.h b/include/config-win.h index 702c6bcdeae..364c4f92134 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -356,7 +356,6 @@ inline ulonglong double2ulonglong(double d) #define HAVE_OPENSSL 1 #define HAVE_YASSL 1 -#define COMMUNITY_SERVER 1 #define ENABLED_PROFILING 1 /* diff --git a/include/errmsg.h b/include/errmsg.h index 5754e99ba5e..c55c94af169 100644 --- a/include/errmsg.h +++ b/include/errmsg.h @@ -100,7 +100,8 @@ extern const char *client_errors[]; /* Error messages */ #define CR_SERVER_LOST_EXTENDED 2055 #define CR_STMT_CLOSED 2056 #define CR_NEW_STMT_METADATA 2057 -#define CR_ERROR_LAST /*Copy last error nr:*/ 2057 +#define CR_ALREADY_CONNECTED 2058 +#define CR_ERROR_LAST /*Copy last error nr:*/ 2058 /* Add error numbers before CR_ERROR_LAST and change it accordingly. */ #endif /* ERRMSG_INCLUDED */ diff --git a/include/hash.h b/include/hash.h index 629b404e8a7..d870e17c341 100644 --- a/include/hash.h +++ b/include/hash.h @@ -22,40 +22,6 @@ extern "C" { #endif /* - There was a problem on MacOSX with a shared object ha_example.so. - It used hash_search(). During build of ha_example.so no libmysys - was specified. Since MacOSX had a hash_search() in the system - library, it built the shared object so that the dynamic linker - linked hash_search() to the system library, which caused a crash - when called. To come around this, we renamed hash_search() to - my_hash_search(), as we did long ago with hash_insert() and - hash_reset(). However, this time we made the move complete with - all names. To keep compatibility, we redefine the old names. - Since every C and C++ file, that uses HASH, needs to include - this file, the change is complete. Both names could be used - in the code, but the my_* versions are recommended now. -*/ -#define hash_get_key my_hash_get_key -#define hash_free_key my_hash_free_key -#define hash_init my_hash_init -#define hash_init2 my_hash_init2 -#define _hash_init _my_hash_init -#define hash_free my_hash_free -#define hash_reset my_hash_reset -#define hash_element my_hash_element -#define hash_search my_hash_search -#define hash_first my_hash_first -#define hash_next my_hash_next -#define hash_insert my_hash_insert -#define hash_delete my_hash_delete -#define hash_update my_hash_update -#define hash_replace my_hash_replace -#define hash_check my_hash_check -#define hash_clear my_hash_clear -#define hash_inited my_hash_inited -#define hash_init_opt my_hash_init_opt - -/* Overhead to store an element in hash Can be used to approximate memory consumption for a hash */ diff --git a/include/my_base.h b/include/my_base.h index a01b2ec9b82..70bd9b5e073 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -255,7 +255,17 @@ enum ha_base_keytype { HA_BINARY_PACK_KEY | HA_FULLTEXT | HA_UNIQUE_CHECK | \ HA_SPATIAL | HA_NULL_ARE_EQUAL | HA_GENERATED_KEY) -#define HA_KEY_HAS_PART_KEY_SEG 65536 /* Key contains partial segments */ +/* + Key contains partial segments. + + This flag is internal to the MySQL server by design. It is not supposed + neither to be saved in FRM-files, nor to be passed to storage engines. + It is intended to pass information into internal static sort_keys(KEY *, + KEY *) function. + + This flag can be calculated -- it's based on key lengths comparison. +*/ +#define HA_KEY_HAS_PART_KEY_SEG 65536 /* Automatic bits in key-flag */ diff --git a/include/mysql.h b/include/mysql.h index 70faf3cb2c1..452b4374cf7 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -188,24 +188,10 @@ struct st_mysql_options { unsigned long max_allowed_packet; my_bool use_ssl; /* if to use SSL or not */ my_bool compress,named_pipe; - /* - On connect, find out the replication role of the server, and - establish connections to all the peers - */ - my_bool rpl_probe; - /* - Each call to mysql_real_query() will parse it to tell if it is a read - or a write, and direct it to the slave or the master - */ - my_bool rpl_parse; - /* - If set, never read from a master, only from slave, when doing - a read that is replication-aware - */ - my_bool no_master_reads; -#if !defined(CHECK_EMBEDDED_DIFFERENCES) || defined(EMBEDDED_LIBRARY) - my_bool separate_thread; -#endif + my_bool unused1; + my_bool unused2; + my_bool unused3; + my_bool unused4; enum mysql_option methods_to_use; char *client_ip; /* Refuse client connecting to server if it uses old (pre-4.1.1) protocol */ @@ -232,15 +218,6 @@ enum mysql_protocol_type MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET, MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY }; -/* - There are three types of queries - the ones that have to go to - the master, the ones that go to a slave, and the adminstrative - type which must happen on the pivot connectioin -*/ -enum mysql_rpl_type -{ - MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN -}; typedef struct character_set { @@ -285,21 +262,8 @@ typedef struct st_mysql /* session-wide random string */ char scramble[SCRAMBLE_LENGTH+1]; - - /* - Set if this is the original connection, not a master or a slave we have - added though mysql_rpl_probe() or mysql_set_master()/ mysql_add_slave() - */ - my_bool rpl_pivot; - /* - Pointers to the master, and the next slave connections, points to - itself if lone connection. - */ - struct st_mysql* master, *next_slave; - - struct st_mysql* last_used_slave; /* needed for round-robin slave pick */ - /* needed for send/read/store/use result to work correctly with replication */ - struct st_mysql* last_used_con; + my_bool unused1; + void *unused2, *unused3, *unused4, *unused5; LIST *stmts; /* list of all statements */ const struct st_mysql_methods *methods; @@ -333,35 +297,12 @@ typedef struct st_mysql_res { void *extension; } MYSQL_RES; -#define MAX_MYSQL_MANAGER_ERR 256 -#define MAX_MYSQL_MANAGER_MSG 256 - -#define MANAGER_OK 200 -#define MANAGER_INFO 250 -#define MANAGER_ACCESS 401 -#define MANAGER_CLIENT_ERR 450 -#define MANAGER_INTERNAL_ERR 500 #if !defined(MYSQL_SERVER) && !defined(MYSQL_CLIENT) #define MYSQL_CLIENT #endif -typedef struct st_mysql_manager -{ - NET net; - char *host, *user, *passwd; - char *net_buf, *net_buf_pos, *net_data_end; - unsigned int port; - int cmd_status; - int last_errno; - int net_buf_size; - my_bool free_me; - my_bool eof; - char last_error[MAX_MYSQL_MANAGER_ERR]; - void *extension; -} MYSQL_MANAGER; - typedef struct st_mysql_parameters { unsigned long *p_max_allowed_packet; @@ -454,16 +395,6 @@ int STDCALL mysql_real_query(MYSQL *mysql, const char *q, MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql); MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql); -/* perform query on master */ -my_bool STDCALL mysql_master_query(MYSQL *mysql, const char *q, - unsigned long length); -my_bool STDCALL mysql_master_send_query(MYSQL *mysql, const char *q, - unsigned long length); -/* perform query on slave */ -my_bool STDCALL mysql_slave_query(MYSQL *mysql, const char *q, - unsigned long length); -my_bool STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q, - unsigned long length); void STDCALL mysql_get_character_set_info(MYSQL *mysql, MY_CHARSET_INFO *charset); @@ -485,37 +416,6 @@ mysql_set_local_infile_handler(MYSQL *mysql, void mysql_set_local_infile_default(MYSQL *mysql); - -/* - enable/disable parsing of all queries to decide if they go on master or - slave -*/ -void STDCALL mysql_enable_rpl_parse(MYSQL* mysql); -void STDCALL mysql_disable_rpl_parse(MYSQL* mysql); -/* get the value of the parse flag */ -int STDCALL mysql_rpl_parse_enabled(MYSQL* mysql); - -/* enable/disable reads from master */ -void STDCALL mysql_enable_reads_from_master(MYSQL* mysql); -void STDCALL mysql_disable_reads_from_master(MYSQL* mysql); -/* get the value of the master read flag */ -my_bool STDCALL mysql_reads_from_master_enabled(MYSQL* mysql); - -enum mysql_rpl_type STDCALL mysql_rpl_query_type(const char* q, int len); - -/* discover the master and its slaves */ -my_bool STDCALL mysql_rpl_probe(MYSQL* mysql); - -/* set the master, close/free the old one, if it is not a pivot */ -int STDCALL mysql_set_master(MYSQL* mysql, const char* host, - unsigned int port, - const char* user, - const char* passwd); -int STDCALL mysql_add_slave(MYSQL* mysql, const char* host, - unsigned int port, - const char* user, - const char* passwd); - int STDCALL mysql_shutdown(MYSQL *mysql, enum mysql_enum_shutdown_level shutdown_level); @@ -562,18 +462,6 @@ void STDCALL mysql_debug(const char *debug); void STDCALL myodbc_remove_escape(MYSQL *mysql,char *name); unsigned int STDCALL mysql_thread_safe(void); my_bool STDCALL mysql_embedded(void); -MYSQL_MANAGER* STDCALL mysql_manager_init(MYSQL_MANAGER* con); -MYSQL_MANAGER* STDCALL mysql_manager_connect(MYSQL_MANAGER* con, - const char* host, - const char* user, - const char* passwd, - unsigned int port); -void STDCALL mysql_manager_close(MYSQL_MANAGER* con); -int STDCALL mysql_manager_command(MYSQL_MANAGER* con, - const char* cmd, int cmd_len); -int STDCALL mysql_manager_fetch_line(MYSQL_MANAGER* con, - char* res_buf, - int res_buf_size); my_bool STDCALL mysql_read_query_result(MYSQL *mysql); @@ -768,7 +656,7 @@ typedef struct st_mysql_methods MYSQL_RES * (*use_result)(MYSQL *mysql); void (*fetch_lengths)(unsigned long *to, MYSQL_ROW column, unsigned int field_count); - void (*flush_use_result)(MYSQL *mysql); + void (*flush_use_result)(MYSQL *mysql, my_bool flush_all_results); #if !defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY) MYSQL_FIELD * (*list_fields)(MYSQL *mysql); my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt); @@ -828,6 +716,7 @@ my_bool STDCALL mysql_rollback(MYSQL * mysql); my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode); my_bool STDCALL mysql_more_results(MYSQL *mysql); int STDCALL mysql_next_result(MYSQL *mysql); +int STDCALL mysql_stmt_next_result(MYSQL_STMT *stmt); void STDCALL mysql_close(MYSQL *sock); @@ -842,7 +731,6 @@ MYSQL * STDCALL mysql_connect(MYSQL *mysql, const char *host, const char *user, const char *passwd); int STDCALL mysql_create_db(MYSQL *mysql, const char *DB); int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB); -#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT) #endif #define HAVE_MYSQL_REAL_CONNECT diff --git a/include/mysql.h.pp b/include/mysql.h.pp index 633cde41130..0ea1d0974c2 100644 --- a/include/mysql.h.pp +++ b/include/mysql.h.pp @@ -28,15 +28,15 @@ typedef struct st_net { unsigned int *return_status; unsigned char reading_or_writing; char save_char; - my_bool unused0; - my_bool unused; - my_bool compress; my_bool unused1; - unsigned char *query_cache_query; + my_bool unused2; + my_bool compress; + my_bool unused3; + unsigned char *unused; unsigned int last_errno; unsigned char error; - my_bool unused2; - my_bool return_errno; + my_bool unused4; + my_bool unused5; char last_error[512]; char sqlstate[5 +1]; void *extension; @@ -277,10 +277,10 @@ struct st_mysql_options { unsigned long max_allowed_packet; my_bool use_ssl; my_bool compress,named_pipe; - my_bool rpl_probe; - my_bool rpl_parse; - my_bool no_master_reads; - my_bool separate_thread; + my_bool unused1; + my_bool unused2; + my_bool unused3; + my_bool unused4; enum mysql_option methods_to_use; char *client_ip; my_bool secure_auth; @@ -301,10 +301,6 @@ enum mysql_protocol_type MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET, MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY }; -enum mysql_rpl_type -{ - MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN -}; typedef struct character_set { unsigned int number; @@ -344,10 +340,8 @@ typedef struct st_mysql my_bool free_me; my_bool reconnect; char scramble[20 +1]; - my_bool rpl_pivot; - struct st_mysql* master, *next_slave; - struct st_mysql* last_used_slave; - struct st_mysql* last_used_con; + my_bool unused1; + void *unused2, *unused3, *unused4, *unused5; LIST *stmts; const struct st_mysql_methods *methods; void *thd; @@ -371,20 +365,6 @@ typedef struct st_mysql_res { my_bool unbuffered_fetch_cancelled; void *extension; } MYSQL_RES; -typedef struct st_mysql_manager -{ - NET net; - char *host, *user, *passwd; - char *net_buf, *net_buf_pos, *net_data_end; - unsigned int port; - int cmd_status; - int last_errno; - int net_buf_size; - my_bool free_me; - my_bool eof; - char last_error[256]; - void *extension; -} MYSQL_MANAGER; typedef struct st_mysql_parameters { unsigned long *p_max_allowed_packet; @@ -437,14 +417,6 @@ int mysql_real_query(MYSQL *mysql, const char *q, unsigned long length); MYSQL_RES * mysql_store_result(MYSQL *mysql); MYSQL_RES * mysql_use_result(MYSQL *mysql); -my_bool mysql_master_query(MYSQL *mysql, const char *q, - unsigned long length); -my_bool mysql_master_send_query(MYSQL *mysql, const char *q, - unsigned long length); -my_bool mysql_slave_query(MYSQL *mysql, const char *q, - unsigned long length); -my_bool mysql_slave_send_query(MYSQL *mysql, const char *q, - unsigned long length); void mysql_get_character_set_info(MYSQL *mysql, MY_CHARSET_INFO *charset); void @@ -459,22 +431,6 @@ mysql_set_local_infile_handler(MYSQL *mysql, void *); void mysql_set_local_infile_default(MYSQL *mysql); -void mysql_enable_rpl_parse(MYSQL* mysql); -void mysql_disable_rpl_parse(MYSQL* mysql); -int mysql_rpl_parse_enabled(MYSQL* mysql); -void mysql_enable_reads_from_master(MYSQL* mysql); -void mysql_disable_reads_from_master(MYSQL* mysql); -my_bool mysql_reads_from_master_enabled(MYSQL* mysql); -enum mysql_rpl_type mysql_rpl_query_type(const char* q, int len); -my_bool mysql_rpl_probe(MYSQL* mysql); -int mysql_set_master(MYSQL* mysql, const char* host, - unsigned int port, - const char* user, - const char* passwd); -int mysql_add_slave(MYSQL* mysql, const char* host, - unsigned int port, - const char* user, - const char* passwd); int mysql_shutdown(MYSQL *mysql, enum mysql_enum_shutdown_level shutdown_level); @@ -521,18 +477,6 @@ void mysql_debug(const char *debug); void myodbc_remove_escape(MYSQL *mysql,char *name); unsigned int mysql_thread_safe(void); my_bool mysql_embedded(void); -MYSQL_MANAGER* mysql_manager_init(MYSQL_MANAGER* con); -MYSQL_MANAGER* mysql_manager_connect(MYSQL_MANAGER* con, - const char* host, - const char* user, - const char* passwd, - unsigned int port); -void mysql_manager_close(MYSQL_MANAGER* con); -int mysql_manager_command(MYSQL_MANAGER* con, - const char* cmd, int cmd_len); -int mysql_manager_fetch_line(MYSQL_MANAGER* con, - char* res_buf, - int res_buf_size); my_bool mysql_read_query_result(MYSQL *mysql); enum enum_mysql_stmt_state { @@ -616,7 +560,7 @@ typedef struct st_mysql_methods MYSQL_RES * (*use_result)(MYSQL *mysql); void (*fetch_lengths)(unsigned long *to, MYSQL_ROW column, unsigned int field_count); - void (*flush_use_result)(MYSQL *mysql); + void (*flush_use_result)(MYSQL *mysql, my_bool flush_all_results); MYSQL_FIELD * (*list_fields)(MYSQL *mysql); my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt); int (*stmt_execute)(MYSQL_STMT *stmt); @@ -671,4 +615,5 @@ my_bool mysql_rollback(MYSQL * mysql); my_bool mysql_autocommit(MYSQL * mysql, my_bool auto_mode); my_bool mysql_more_results(MYSQL *mysql); int mysql_next_result(MYSQL *mysql); +int mysql_stmt_next_result(MYSQL_STMT *stmt); void mysql_close(MYSQL *sock); diff --git a/include/mysql_com.h b/include/mysql_com.h index b571ce3e894..345ecd5dd93 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -146,6 +146,7 @@ enum enum_server_command #define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */ #define CLIENT_MULTI_STATEMENTS (1UL << 16) /* Enable/disable multi-stmt support */ #define CLIENT_MULTI_RESULTS (1UL << 17) /* Enable/disable multi-results */ +#define CLIENT_PS_MULTI_RESULTS (1UL << 18) /* Multi-results in PS-protocol */ #define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30) #define CLIENT_REMEMBER_OPTIONS (1UL << 31) @@ -169,6 +170,7 @@ enum enum_server_command CLIENT_SECURE_CONNECTION | \ CLIENT_MULTI_STATEMENTS | \ CLIENT_MULTI_RESULTS | \ + CLIENT_PS_MULTI_RESULTS | \ CLIENT_SSL_VERIFY_SERVER_CERT | \ CLIENT_REMEMBER_OPTIONS) @@ -205,6 +207,12 @@ enum enum_server_command number of result set columns. */ #define SERVER_STATUS_METADATA_CHANGED 1024 +#define SERVER_QUERY_WAS_SLOW 2048 + +/** + To mark ResultSet containing output parameter values. +*/ +#define SERVER_PS_OUT_PARAMS 4096 /** Server status flags that must be cleared when starting @@ -256,24 +264,23 @@ typedef struct st_net { unsigned int *return_status; unsigned char reading_or_writing; char save_char; - my_bool unused0; /* Please remove with the next incompatible ABI change. */ - my_bool unused; /* Please remove with the next incompatible ABI change */ - my_bool compress; my_bool unused1; /* Please remove with the next incompatible ABI change. */ + my_bool unused2; /* Please remove with the next incompatible ABI change */ + my_bool compress; + my_bool unused3; /* Please remove with the next incompatible ABI change. */ /* Pointer to query object in query cache, do not equal NULL (0) for queries in cache that have not stored its results yet */ #endif /* - 'query_cache_query' should be accessed only via query cache - functions and methods to maintain proper locking. + Unused, please remove with the next incompatible ABI change. */ - unsigned char *query_cache_query; + unsigned char *unused; unsigned int last_errno; unsigned char error; - my_bool unused2; /* Please remove with the next incompatible ABI change. */ - my_bool return_errno; + my_bool unused4; /* Please remove with the next incompatible ABI change. */ + my_bool unused5; /* Please remove with the next incompatible ABI change. */ /** Client library error message buffer. Actually belongs to struct MYSQL. */ char last_error[MYSQL_ERRMSG_SIZE]; /** Client library sqlstate buffer. Set along with the error message. */ @@ -411,10 +418,6 @@ void my_net_set_write_timeout(NET *net, uint timeout); void my_net_set_read_timeout(NET *net, uint timeout); #endif -/* - The following function is not meant for normal usage - Currently it's used internally by manager.c -*/ struct sockaddr; int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen, unsigned int timeout); |