summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2003-07-04 13:21:14 +0500
committerunknown <hf@deer.(none)>2003-07-04 13:21:14 +0500
commit7248ab7b59ca11b83cb9543a3050499157d8d5fc (patch)
tree8d9d48e6d2ba9a4f0332cb4bda4fe3dbe23651d6 /include
parentc2a4a0ec552e3000b45c6ef2b4148fb0845d5f41 (diff)
parent14fd42e13ff008247ede01c48780539f23931e2d (diff)
downloadmariadb-git-7248ab7b59ca11b83cb9543a3050499157d8d5fc.tar.gz
Resolving conflicts
BitKeeper/etc/logging_ok: auto-union client/mysqltest.c: Auto merged sql-common/client.c: Auto merged sql/protocol.cc: Auto merged sql/sql_client.cc: Auto merged include/mysql.h: Merging (prolly it's the mistake) libmysqld/libmysqld.c: This code seems to be unnecessary
Diffstat (limited to 'include')
-rw-r--r--include/mysql.h81
-rw-r--r--include/mysql_com.h6
-rw-r--r--include/mysql_embed.h2
-rw-r--r--include/sql_common.h5
-rw-r--r--include/violite.h3
5 files changed, 47 insertions, 50 deletions
diff --git a/include/mysql.h b/include/mysql.h
index bd63a10ba45..e4f1d283899 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -129,11 +129,22 @@ typedef struct st_mysql_data {
unsigned int fields;
MYSQL_ROWS *data;
MEM_ROOT alloc;
-#ifdef EMBEDDED_LIBRARY
+#if !defined(CHECK_EMBEDDED_DIFFERENCES) || defined(EMBEDDED_LIBRARY)
MYSQL_ROWS **prev_ptr;
#endif
} MYSQL_DATA;
+enum mysql_option
+{
+ MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE,
+ MYSQL_INIT_COMMAND, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP,
+ MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME, MYSQL_OPT_LOCAL_INFILE,
+ MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME, MYSQL_OPT_READ_TIMEOUT,
+ MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT,
+ MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION,
+ MYSQL_OPT_GUESS_CONNECTION
+};
+
struct st_mysql_options {
unsigned int connect_timeout, read_timeout, write_timeout;
unsigned int port, protocol;
@@ -165,18 +176,10 @@ struct st_mysql_options {
a read that is replication-aware
*/
my_bool no_master_reads;
-#ifdef EMBEDDED_LIBRARY
+#if !defined(CHECK_EMBEDDED_DIFFERENCES) || defined(EMBEDDED_LIBRARY)
my_bool separate_thread;
#endif
-};
-
-enum mysql_option
-{
- MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE,
- MYSQL_INIT_COMMAND, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP,
- MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME, MYSQL_OPT_LOCAL_INFILE,
- MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME, MYSQL_OPT_READ_TIMEOUT,
- MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT
+ enum mysql_option methods_to_use;
};
enum mysql_status
@@ -199,8 +202,7 @@ enum mysql_rpl_type
MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN
};
-
-#ifndef EMBEDDED_LIBRARY
+struct st_mysql_methods;
typedef struct st_mysql
{
@@ -245,34 +247,14 @@ typedef struct st_mysql
struct st_mysql* last_used_con;
LIST *stmts; /* list of all statements */
-} MYSQL;
-
-#else
-
-struct st_mysql_res;
-
-typedef struct st_mysql
-{
+ const struct st_mysql_methods *methods;
struct st_mysql_res *result;
void *thd;
- struct charset_info_st *charset;
- unsigned int server_language;
- MYSQL_FIELD *fields;
- MEM_ROOT field_alloc;
- my_ulonglong affected_rows;
- unsigned int field_count;
- struct st_mysql_options options;
- enum mysql_status status;
- my_bool free_me; /* If free in mysql_close */
- my_ulonglong insert_id; /* id if insert on table with NEXTNR */
unsigned int last_errno;
- unsigned int server_status;
- char *last_error; /* Used by embedded server */
+ char *last_error;
char sqlstate[SQLSTATE_LENGTH+1]; /* Used by embedded server */
} MYSQL;
-#endif
-
typedef struct st_mysql_res {
my_ulonglong row_count;
MYSQL_FIELD *fields;
@@ -371,12 +353,10 @@ MYSQL * STDCALL mysql_real_connect(MYSQL *mysql, const char *host,
unsigned int port,
const char *unix_socket,
unsigned long clientflag);
-void STDCALL mysql_close(MYSQL *sock);
int STDCALL mysql_select_db(MYSQL *mysql, const char *db);
int STDCALL mysql_query(MYSQL *mysql, const char *q);
int STDCALL mysql_send_query(MYSQL *mysql, const char *q,
unsigned long length);
-my_bool STDCALL mysql_read_query_result(MYSQL *mysql);
int STDCALL mysql_real_query(MYSQL *mysql, const char *q,
unsigned long length);
/* perform query on master */
@@ -437,8 +417,6 @@ MYSQL_RES * STDCALL mysql_list_tables(MYSQL *mysql,const char *wild);
MYSQL_RES * STDCALL mysql_list_fields(MYSQL *mysql, const char *table,
const char *wild);
MYSQL_RES * STDCALL mysql_list_processes(MYSQL *mysql);
-MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql);
-MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql);
int STDCALL mysql_options(MYSQL *mysql,enum mysql_option option,
const char *arg);
void STDCALL mysql_free_result(MYSQL_RES *result);
@@ -559,6 +537,25 @@ typedef struct st_mysql_stmt
} MYSQL_STMT;
+#define mysql_close(sock) (*(sock)->methods->close)(sock)
+#define mysql_read_query_result(mysql) (*(mysql)->methods->read_query_result)(mysql)
+#define mysql_store_result(mysql) (*(mysql)->methods->store_result)(mysql)
+#define mysql_use_result(mysql) (*(mysql)->methods->use_result)(mysql)
+
+typedef struct st_mysql_methods
+{
+ void STDCALL (*close)(MYSQL *sock);
+ my_bool STDCALL (*read_query_result)(MYSQL *mysql);
+ my_bool STDCALL (*advanced_command)(MYSQL *mysql,
+ enum enum_server_command command,
+ const char *header,
+ ulong header_length,
+ const char *arg,
+ ulong arg_length, my_bool skip_check);
+ MYSQL_RES * STDCALL (*store_result)(MYSQL *mysql);
+ MYSQL_RES * STDCALL (*use_result)(MYSQL *mysql);
+} MYSQL_METHODS;
+
MYSQL_STMT * STDCALL mysql_prepare(MYSQL * mysql, const char *query,
unsigned long length);
int STDCALL mysql_execute(MYSQL_STMT * stmt);
@@ -612,9 +609,9 @@ int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB);
They are not for general usage
*/
-my_bool
-simple_command(MYSQL *mysql,enum enum_server_command command, const char *arg,
- unsigned long length, my_bool skip_check);
+#define simple_command(mysql, command, arg, length, skip_check) \
+ (*(mysql)->methods->advanced_command)(mysql, command, \
+ NullS, 0, arg, length, skip_check)
unsigned long net_safe_read(MYSQL* mysql);
void mysql_once_init(void);
diff --git a/include/mysql_com.h b/include/mysql_com.h
index e87001ff27d..ab6330dbe53 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -129,7 +129,7 @@ typedef struct st_vio Vio;
#define MAX_BLOB_WIDTH 8192 /* Default width for blob */
typedef struct st_net {
-#ifndef EMBEDDED_LIBRARY
+#if !defined(CHECK_EMBEDDED_DIFFERENCES) || !defined(EMBEDDED_LIBRARY)
Vio* vio;
unsigned char *buff,*buff_end,*write_pos,*read_pos;
my_socket fd; /* For Perl DBI/dbd */
@@ -233,7 +233,8 @@ void my_net_local_init(NET *net);
void net_end(NET *net);
void net_clear(NET *net);
my_bool net_realloc(NET *net, unsigned long length);
-#ifndef EMBEDDED_LIBRARY
+
+#ifndef EMBEDDED_LIBRARY /* To be removed by HF */
my_bool net_flush(NET *net);
#else
#define net_flush(A)
@@ -338,6 +339,7 @@ void my_thread_end(void);
#ifdef _global_h
ulong STDCALL net_field_length(uchar **packet);
my_ulonglong net_field_length_ll(uchar **packet);
+char *net_store_length(char *pkg, ulonglong length);
#endif
#ifdef __cplusplus
diff --git a/include/mysql_embed.h b/include/mysql_embed.h
index d48b0440660..7a169d4133e 100644
--- a/include/mysql_embed.h
+++ b/include/mysql_embed.h
@@ -19,11 +19,11 @@
#ifdef EMBEDDED_LIBRARY
/* Things we don't need in the embedded version of MySQL */
+/* TODO HF add #undef HAVE_VIO if we don't want client in embedded library */
#undef HAVE_PSTACK /* No stacktrace */
#undef HAVE_DLOPEN /* No udf functions */
#undef HAVE_OPENSSL
-#undef HAVE_VIO
#undef HAVE_ISAM
#undef HAVE_SMEM /* No shared memory */
diff --git a/include/sql_common.h b/include/sql_common.h
index f3300281f29..cd1d2331d96 100644
--- a/include/sql_common.h
+++ b/include/sql_common.h
@@ -27,9 +27,6 @@ my_ulonglong net_field_length_ll(uchar **packet);
MYSQL_FIELD *unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
my_bool default_value, uint server_capabilities);
-my_bool advanced_command(MYSQL *mysql, enum enum_server_command command,
- const char *header, ulong header_length,
- const char *arg, ulong arg_length, my_bool skip_check);
void free_rows(MYSQL_DATA *cur);
MYSQL_DATA *read_rows (MYSQL *mysql,MYSQL_FIELD *fields,
uint field_count);
@@ -38,6 +35,8 @@ void fetch_lengths(ulong *to, MYSQL_ROW column, uint field_count);
void free_old_query(MYSQL *mysql);
void end_server(MYSQL *mysql);
my_bool mysql_reconnect(MYSQL *mysql);
+void mysql_read_default_options(struct st_mysql_options *options,
+ const char *filename,const char *group);
#ifdef __cplusplus
}
#endif
diff --git a/include/violite.h b/include/violite.h
index 3b61fbf344e..9205f5b799a 100644
--- a/include/violite.h
+++ b/include/violite.h
@@ -220,7 +220,7 @@ enum SSL_type
};
-#ifndef EMBEDDED_LIBRARY
+/* HFTODO - hide this if we don't want client in embedded server */
/* This structure is for every connection on both sides */
struct st_vio
{
@@ -263,5 +263,4 @@ struct st_vio
#endif /* HAVE_SMEM */
#endif /* HAVE_VIO */
};
-#endif /* EMBEDDED_LIBRARY */
#endif /* vio_violite_h_ */