summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2001-09-22 17:40:57 +0300
committerunknown <monty@hundin.mysql.fi>2001-09-22 17:40:57 +0300
commite7b9eabecaf2f7da05a934a5c757b438d4406bd6 (patch)
tree23349a84d09c518565222da27e0607b42d415f18 /include
parent2504336b415dfbc6f47c7666f986e2eae47921b4 (diff)
downloadmariadb-git-e7b9eabecaf2f7da05a934a5c757b438d4406bd6.tar.gz
Added support of INSERT to MERGE tables
Fixes for embedded libary and openssl BUILD/compile-pentium-debug-max: Added --with-openssl acinclude.m4: Cleanup client/client_priv.h: Include mysql_embed.h to remove not used functions in embedded server client/mysql.cc: Don't use openssl with embedded server include/Makefile.am: Move mysql_embed.h to 'include' directory include/myisammrg.h: Added support of INSERT to MERGE tables include/mysql.h: Fixes for embedded libary and openssl include/mysql_com.h: Fixes for embedded libary and openssl include/mysql_embed.h: Fixes for embedded libary and openssl include/violite.h: Cleanup libmysql/libmysql.c: Safety libmysqld/examples/Makefile.am: Fixes for embedded libary and openssl libmysqld/lib_sql.cc: Fixes for embedded libary and openssl libmysqld/lib_vio.c: Fixes for embedded libary and openssl libmysqld/libmysqld.c: Fixes for embedded libary and openssl myisammrg/Makefile.am: Added support of INSERT to MERGE tables myisammrg/myrg_create.c: Added support of INSERT to MERGE tables myisammrg/myrg_open.c: Added support of INSERT to MERGE tables myisammrg/myrg_static.c: Added support of INSERT to MERGE tables mysql-test/t/union.test: Portability fix sql/Makefile.am: Fixes for embedded libary and openssl sql/gen_lex_hash.cc: Added support of INSERT to MERGE tables sql/ha_myisammrg.cc: Added support of INSERT to MERGE tables sql/handler.h: Added support of INSERT to MERGE tables sql/mini_client.cc: Fixes for embedded libary and openssl sql/net_serv.cc: Fixes for embedded libary and openssl sql/sql_show.cc: Cleanup Build-tools/Do-all-build-steps: Don't build openssl (Need to add proper configure test when to build ssl) sql/lex.h: Added support of INSERT to MERGE tables sql/sql_yacc.yy: Fixes for embedded libary and openssl
Diffstat (limited to 'include')
-rw-r--r--include/Makefile.am4
-rw-r--r--include/myisammrg.h15
-rw-r--r--include/mysql.h43
-rw-r--r--include/mysql_com.h10
-rw-r--r--include/mysql_embed.h29
-rw-r--r--include/violite.h102
6 files changed, 114 insertions, 89 deletions
diff --git a/include/Makefile.am b/include/Makefile.am
index 0821afeb01d..aaf11db7a50 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -16,8 +16,8 @@
# MA 02111-1307, USA
BUILT_SOURCES = mysql_version.h m_ctype.h my_config.h
-pkginclude_HEADERS = dbug.h m_string.h my_sys.h mysql.h mysql_com.h \
- mysqld_error.h my_list.h \
+pkginclude_HEADERS = dbug.h m_string.h my_sys.h my_list.h \
+ mysql.h mysql_com.h mysqld_error.h mysql_embed.h \
my_pthread.h my_no_pthread.h raid.h errmsg.h \
my_global.h my_net.h \
sslopt-case.h sslopt-longopts.h sslopt-usage.h \
diff --git a/include/myisammrg.h b/include/myisammrg.h
index a797c954614..1ae825b4b94 100644
--- a/include/myisammrg.h
+++ b/include/myisammrg.h
@@ -34,6 +34,13 @@ extern "C" {
#define MYRG_NAME_EXT ".MRG"
+/* In which table to INSERT rows */
+#define MERGE_INSERT_DISABLED 0
+#define MERGE_INSERT_TO_FIRST 1
+#define MERGE_INSERT_TO_LAST 2
+
+extern TYPELIB merge_insert_method;
+
/* Param to/from myrg_info */
typedef struct st_mymerge_info /* Struct from h_info */
@@ -44,7 +51,7 @@ typedef struct st_mymerge_info /* Struct from h_info */
ulonglong data_file_length;
uint reclength; /* Recordlength */
int errkey; /* With key was dupplicated on err */
- uint options; /* HA_OPTIONS_... used */
+ uint options; /* HA_OPTION_... used */
} MYMERGE_INFO;
typedef struct st_myrg_table_info
@@ -56,6 +63,7 @@ typedef struct st_myrg_table_info
typedef struct st_myrg_info
{
MYRG_TABLE *open_tables,*current_table,*end_table,*last_used_table;
+ uint merge_insert_method;
ulonglong records; /* records in tables */
ulonglong del; /* Removed records */
ulonglong data_file_length;
@@ -81,10 +89,11 @@ extern int myrg_rkey(MYRG_INFO *file,byte *buf,int inx,const byte *key,
extern int myrg_rrnd(MYRG_INFO *file,byte *buf,ulonglong pos);
extern int myrg_rsame(MYRG_INFO *file,byte *record,int inx);
extern int myrg_update(MYRG_INFO *file,const byte *old,byte *new_rec);
+extern int myrg_write(MYRG_INFO *info,byte *rec);
extern int myrg_status(MYRG_INFO *file,MYMERGE_INFO *x,int flag);
extern int myrg_lock_database(MYRG_INFO *file,int lock_type);
-extern int myrg_create(const char *name,const char **table_names,
- my_bool fix_names);
+extern int myrg_create(const char *name, const char **table_names,
+ uint insert_method, my_bool fix_names);
extern int myrg_extra(MYRG_INFO *file,enum ha_extra_function function);
extern ha_rows myrg_records_in_range(MYRG_INFO *info,int inx,
const byte *start_key,uint start_key_len,
diff --git a/include/mysql.h b/include/mysql.h
index 3e3a6f35e56..a1bd96540e8 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -48,32 +48,15 @@ typedef char my_bool;
#endif
typedef char * gptr;
-#ifndef ST_USED_MEM_DEFINED
-#define ST_USED_MEM_DEFINED
-typedef struct st_used_mem { /* struct for once_alloc */
- struct st_used_mem *next; /* Next block in use */
- unsigned int left; /* memory left in block */
- unsigned int size; /* size of block */
-} USED_MEM;
-typedef struct st_mem_root {
- USED_MEM *free;
- USED_MEM *used;
- USED_MEM *pre_alloc;
- unsigned int min_malloc;
- unsigned int block_size;
-
- void (*error_handler)(void);
-} MEM_ROOT;
-#endif
-
#ifndef my_socket_defined
#ifdef __WIN__
#define my_socket SOCKET
#else
typedef int my_socket;
-#endif
-#endif
-#endif
+#endif /* __WIN__ */
+#endif /* my_socket_defined */
+#endif /* _global_h */
+
#include "mysql_com.h"
#include "mysql_version.h"
@@ -118,6 +101,24 @@ typedef struct st_mysql_rows {
typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; /* offset to current row */
+#ifndef ST_USED_MEM_DEFINED
+#define ST_USED_MEM_DEFINED
+typedef struct st_used_mem { /* struct for once_alloc */
+ struct st_used_mem *next; /* Next block in use */
+ unsigned int left; /* memory left in block */
+ unsigned int size; /* size of block */
+} USED_MEM;
+typedef struct st_mem_root {
+ USED_MEM *free;
+ USED_MEM *used;
+ USED_MEM *pre_alloc;
+ unsigned int min_malloc;
+ unsigned int block_size;
+
+ void (*error_handler)(void);
+} MEM_ROOT;
+#endif
+
typedef struct st_mysql_data {
my_ulonglong rows;
unsigned int fields;
diff --git a/include/mysql_com.h b/include/mysql_com.h
index ce134fcab2c..63fbc05b0cb 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -113,10 +113,12 @@ typedef struct st_net {
unsigned int last_errno,max_packet,timeout,pkt_nr;
unsigned char error;
my_bool return_errno,compress;
- my_bool no_send_ok; /* needed if we are doing several
- queries in one command ( as in LOAD TABLE ... FROM MASTER ),
- and do not want to confuse the client with OK at the wrong time
- */
+ /*
+ The following variable is set if we are doing several queries in one
+ command ( as in LOAD TABLE ... FROM MASTER ),
+ and do not want to confuse the client with OK at the wrong time
+ */
+ my_bool no_send_ok;
unsigned long remain_in_buf,length, buf_length, where_b;
unsigned int *return_status;
unsigned char reading_or_writing;
diff --git a/include/mysql_embed.h b/include/mysql_embed.h
new file mode 100644
index 00000000000..77f6f3fa32c
--- /dev/null
+++ b/include/mysql_embed.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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 */
+
+/* Defines that are unique to the embedded version of MySQL */
+
+#ifdef EMBEDDED_LIBRARY
+
+/* Things we don't need in the embedded version of MySQL */
+
+#undef HAVE_PSTACK /* No stacktrace */
+#undef HAVE_DLOPEN /* No udf functions */
+#undef HAVE_OPENSSL
+#undef HAVE_VIO
+
+#define DONT_USE_RAID
+#endif /* EMBEDDED_LIBRARY */
diff --git a/include/violite.h b/include/violite.h
index 49791c6b68a..947b874c46a 100644
--- a/include/violite.h
+++ b/include/violite.h
@@ -33,67 +33,59 @@ extern "C" {
#endif /* __cplusplus */
enum enum_vio_type { VIO_CLOSED, VIO_TYPE_TCPIP, VIO_TYPE_SOCKET,
- VIO_TYPE_NAMEDPIPE, VIO_TYPE_SSL};
+ VIO_TYPE_NAMEDPIPE, VIO_TYPE_SSL};
#ifndef __WIN__
#define HANDLE void *
#endif
-Vio* vio_new(my_socket sd,
- enum enum_vio_type type,
- my_bool localhost);
+Vio* vio_new(my_socket sd, enum enum_vio_type type, my_bool localhost);
#ifdef __WIN__
-Vio* vio_new_win32pipe(HANDLE hPipe);
+Vio* vio_new_win32pipe(HANDLE hPipe);
#endif
-void vio_delete(Vio* vio);
+void vio_delete(Vio* vio);
#ifdef EMBEDDED_LIBRARY
void vio_reset(Vio *vio);
#else
void vio_reset(Vio* vio, enum enum_vio_type type,
- my_socket sd, HANDLE hPipe,
- my_bool localhost);
+ my_socket sd, HANDLE hPipe, my_bool localhost);
#endif
/*
* vio_read and vio_write should have the same semantics
* as read(2) and write(2).
*/
-int vio_read( Vio* vio,
- gptr buf, int size);
-int vio_write( Vio* vio,
- const gptr buf,
- int size);
+int vio_read(Vio *vio, gptr buf, int size);
+int vio_write(Vio *vio, const gptr buf, int size);
/*
* Whenever the socket is set to blocking mode or not.
*/
-int vio_blocking( Vio* vio,
- my_bool onoff);
-my_bool vio_is_blocking( Vio* vio);
+int vio_blocking(Vio *vio, my_bool onoff);
+my_bool vio_is_blocking(Vio *vio);
/*
* setsockopt TCP_NODELAY at IPPROTO_TCP level, when possible.
*/
- int vio_fastsend( Vio* vio);
+int vio_fastsend(Vio *vio);
/*
* setsockopt SO_KEEPALIVE at SOL_SOCKET level, when possible.
*/
-int vio_keepalive( Vio* vio,
- my_bool onoff);
+int vio_keepalive(Vio *vio, my_bool onoff);
/*
* Whenever we should retry the last read/write operation.
*/
-my_bool vio_should_retry( Vio* vio);
+my_bool vio_should_retry(Vio *vio);
/*
* When the workday is over...
*/
-int vio_close(Vio* vio);
+int vio_close(Vio* vio);
/*
* Short text description of the socket for those, who are curious..
*/
-const char* vio_description( Vio* vio);
+const char* vio_description(Vio *vio);
/* Return the type of the connection */
- enum enum_vio_type vio_type(Vio* vio);
+enum enum_vio_type vio_type(Vio* vio);
/* Return last error number */
int vio_errno(Vio*vio);
@@ -117,8 +109,8 @@ my_bool vio_poll_read(Vio *vio,uint timeout);
}
#endif
#endif /* vio_violite_h_ */
-#ifdef HAVE_VIO
-#ifndef DONT_MAP_VIO
+
+#if defined(HAVE_VIO) && !defined(DONT_MAP_VIO)
#define vio_delete(vio) (vio)->viodelete(vio)
#define vio_errno(vio) (vio)->vioerrno(vio)
#define vio_read(vio, buf, size) (vio)->read(vio,buf,size)
@@ -132,9 +124,7 @@ my_bool vio_poll_read(Vio *vio,uint timeout);
#define vio_peer_addr(vio, buf) (vio)->peer_addr(vio, buf)
#define vio_in_addr(vio, in) (vio)->in_addr(vio, in)
#define vio_poll_read(vio,timeout) (vio)->poll_read(vio,timeout)
-#endif /* !DONT_MAP_VIO */
-#endif /* HAVE_VIO */
-
+#endif /* defined(HAVE_VIO) && !defined(DONT_MAP_VIO) */
#ifdef HAVE_OPENSSL
#define HEADER_DES_LOCL_H dummy_something
@@ -142,17 +132,16 @@ my_bool vio_poll_read(Vio *vio,uint timeout);
#include <openssl/err.h>
#include "my_net.h" /* needed because of struct in_addr */
-
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
-void vio_ssl_delete(Vio* vio);
+void vio_ssl_delete(Vio* vio);
-int vio_ssl_read(Vio* vio,gptr buf, int size);
-int vio_ssl_write(Vio* vio,const gptr buf,int size);
-int vio_ssl_blocking(Vio* vio,my_bool onoff);
-my_bool vio_ssl_is_blocking(Vio* vio);
+int vio_ssl_read(Vio* vio,gptr buf, int size);
+int vio_ssl_write(Vio* vio,const gptr buf,int size);
+int vio_ssl_blocking(Vio* vio,my_bool onoff);
+my_bool vio_ssl_is_blocking(Vio* vio);
/* setsockopt TCP_NODELAY at IPPROTO_TCP level, when possible. */
int vio_ssl_fastsend(Vio* vio);
@@ -170,8 +159,6 @@ void vio_ssl_in_addr(Vio *vio, struct in_addr *in);
/* Return 1 if there is data to be read */
my_bool vio_ssl_poll_read(Vio *vio,uint timeout);
-#ifdef HAVE_OPENSSL
-
/* Single copy for server */
struct st_VioSSLAcceptorFd
{
@@ -200,16 +187,14 @@ struct st_VioSSLConnectorFd
void sslaccept(struct st_VioSSLAcceptorFd*, Vio*);
void sslconnect(struct st_VioSSLConnectorFd*, Vio*);
-#else /* HAVE_OPENSSL */
-/* This dummy is required to maintain proper size of st_mysql in mysql.h */
-struct st_VioSSLConnectorFd {};
-#endif /* HAVE_OPENSSL */
-struct st_VioSSLConnectorFd *new_VioSSLConnectorFd(
- const char* key_file,const char* cert_file,const char* ca_file,const char* ca_path);
-struct st_VioSSLAcceptorFd *new_VioSSLAcceptorFd(
- const char* key_file,const char* cert_file,const char* ca_file,const char* ca_path);
+struct st_VioSSLConnectorFd
+*new_VioSSLConnectorFd(const char* key_file, const char* cert_file,
+ const char* ca_file, const char* ca_path);
+struct st_VioSSLAcceptorFd
+*new_VioSSLAcceptorFd(const char* key_file, const char* cert_file,
+ const char* ca_file,const char* ca_path);
Vio* new_VioSSL(struct st_VioSSLAcceptorFd* fd, Vio* sd,int state);
-
+
#ifdef __cplusplus
}
#endif
@@ -229,19 +214,19 @@ struct st_vio
char desc[30]; /* String description */
#ifdef HAVE_VIO
/* function pointers. They are similar for socket/SSL/whatever */
- void (*viodelete)(Vio*);
- int(*vioerrno)(Vio*);
- int(*read)(Vio*, gptr, int);
- int(*write)(Vio*, gptr, int);
- int(*vioblocking)(Vio*, my_bool);
- my_bool(*is_blocking)(Vio*);
- int(*viokeepalive)(Vio*, my_bool);
- int(*fastsend)(Vio*);
- my_bool(*peer_addr)(Vio*, gptr);
- void(*in_addr)(Vio*, struct in_addr*);
- my_bool(*should_retry)(Vio*);
- int(*vioclose)(Vio*);
- my_bool(*poll_read)(Vio*,uint);
+ void (*viodelete)(Vio*);
+ int (*vioerrno)(Vio*);
+ int (*read)(Vio*, gptr, int);
+ int (*write)(Vio*, gptr, int);
+ int (*vioblocking)(Vio*, my_bool);
+ my_bool (*is_blocking)(Vio*);
+ int (*viokeepalive)(Vio*, my_bool);
+ int (*fastsend)(Vio*);
+ my_bool (*peer_addr)(Vio*, gptr);
+ void (*in_addr)(Vio*, struct in_addr*);
+ my_bool (*should_retry)(Vio*);
+ int (*vioclose)(Vio*);
+ my_bool (*poll_read)(Vio*,uint);
#ifdef HAVE_OPENSSL
BIO* bio_;
@@ -252,4 +237,3 @@ struct st_vio
#endif /* HAVE_VIO */
};
#endif /* EMBEDDED_LIBRARY */
-