summaryrefslogtreecommitdiff
path: root/include/mysql.h
diff options
context:
space:
mode:
authorunknown <tim@black.box>2001-08-10 12:37:36 -0400
committerunknown <tim@black.box>2001-08-10 12:37:36 -0400
commitb538ff90dad25d5975b68182bd064bc7a95ebfc2 (patch)
tree0b1bf2d0aed5c3d69b112448bb146dcc526f9890 /include/mysql.h
parent4bb40187438bdfb8b1d8b091399bd01e0e3425c1 (diff)
downloadmariadb-git-b538ff90dad25d5975b68182bd064bc7a95ebfc2.tar.gz
Embedded mysql fixes.
There is now a mysql_server_init() function which needs to be called at the beginning of the program (and _end() for the end of the program). This routine handles argument parsing for the embedded server. Use the embedded version of mysql_load_file() (ignore the LOCAL argument, since the client and server are the same program). There are now mysql_thread_init/end() functions for the client to use in a multi-threaded app. They are just wrappers for my_thread_init/end(). BitKeeper/deleted/.del-README~434e9cae5fa9a4c4: Delete: libmysqld/README libmysqld/lib_load.cc: minor cleanup include/mysql.h: add mysql_server/thread_init/end() libmysql/libmysql.c: add mysql_server/thread_init/end() libmysqld/lib_sql.cc: add mysql_server/thread_init/end() libmysqld/libmysqld.c: add mysql_server/thread_init/end() sql/mysqld.cc: allow get_options() to be called more than once libmysqld/Makefile.am: use lib_load.cc instead of sql_load.cc BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'include/mysql.h')
-rw-r--r--include/mysql.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/include/mysql.h b/include/mysql.h
index b4a7f977cd5..9578336a945 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -15,8 +15,6 @@
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA */
-/* defines for the libmysql library */
-
#ifndef _mysql_h
#define _mysql_h
@@ -222,6 +220,20 @@ typedef struct st_mysql_res {
my_bool eof; /* Used my mysql_fetch_row */
} MYSQL_RES;
+
+/* Set up and bring down the server; to ensure that applications will
+ * work when linked against either the standard client library or the
+ * embedded server library, these functions should be called. */
+void mysql_server_init(int argc, char **argv, const char **groups);
+void mysql_server_end();
+
+/* Set up and bring down a thread; these function should be called
+ * for each thread in an application which opens at least one MySQL
+ * connection. All uses of the connection(s) should be between these
+ * function calls. */
+my_bool mysql_thread_init();
+void mysql_thread_end();
+
/* Functions to get information from the MYSQL and MYSQL_RES structures */
/* Should definitely be used if one uses shared libraries */
@@ -359,15 +371,13 @@ unsigned int STDCALL mysql_thread_safe(void);
#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT)
-#ifndef USE_OLD_FUNCTIONS
+#ifdef USE_OLD_FUNCTIONS
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);
#endif
-/* new api functions */
-
#define HAVE_MYSQL_REAL_CONNECT
#ifndef MYSQL_SERVER