diff options
author | unknown <tim@black.box> | 2001-09-16 21:41:22 -0400 |
---|---|---|
committer | unknown <tim@black.box> | 2001-09-16 21:41:22 -0400 |
commit | 5fffbb123615ad0b256652390467b33ed2919afc (patch) | |
tree | 7ff6a4243043fa71bd04fa3434bd8e13992df771 /client/mysql.cc | |
parent | 34925f8d823c700c939f0622b6af85001458a226 (diff) | |
download | mariadb-git-5fffbb123615ad0b256652390467b33ed2919afc.tar.gz |
Add some examples for using libmysqld, including a hack for running the
mysql test suite.
A few minor libmysqld fixes.
Add mysql_server_init() and _end() to mysql.cc and mysqltest.c, so they
can be linked against libmysqlclient or libmysqld.
sql/mysqld.cc:
have unireg_end() exit(), instead of pthread_exit()
if inside the EMBEDDED_LIBRARY. This is a hack
which hopefully won't be needed. But without it,
the program hangs at end.
client/mysql.cc:
Don't call mysql_ssl_clear() unless HAVE_OPENSSL.
client/mysqltest.c:
Add mysql_server_init() and _end().
acinclude.m4:
change .. to $(top_builddir) in innodb_libs
Makefile.am:
Add libmysqld/examples to link_sources target
configure.in:
output libmysqld/examples/Makefile
Also, change .. to $(top_builddir) in readline_link
BitKeeper/etc/ignore:
added linked_libmysqldex_sources
mysql-test/mysql-test-run.sh:
use latin1, not latin1_de, in tests
libmysqld/libmysqld.c:
Add replication functions.
Diffstat (limited to 'client/mysql.cc')
-rw-r--r-- | client/mysql.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index ec8b6689dcd..658f9941d50 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -248,6 +248,7 @@ static COMMANDS commands[] = { }; static const char *load_default_groups[]= { "mysql","client",0 }; +static const char *server_default_groups[]= { "server", "mysql_SERVER", 0 }; #ifdef HAVE_READLINE extern "C" void add_history(char *command); /* From readline directory */ @@ -275,6 +276,7 @@ int main(int argc,char *argv[]) { char buff[80]; + mysql_server_init(0, NULL, server_default_groups); MY_INIT(argv[0]); DBUG_ENTER("main"); DBUG_PROCESS(argv[0]); @@ -368,6 +370,7 @@ int main(int argc,char *argv[]) if (opt_outfile) end_tee(); mysql_end(0); + mysql_server_end(); #ifndef _lint DBUG_RETURN(0); // Keep compiler happy #endif @@ -377,9 +380,11 @@ sig_handler mysql_end(int sig) { if (connected) mysql_close(&mysql); +#ifdef HAVE_OPENSSL else mysql_ssl_clear(&mysql); /* SSL data structres should be freed even if connection was not made */ +#endif #ifdef HAVE_READLINE if (!status.batch && !quick && !opt_html && !opt_xml) { @@ -2217,9 +2222,11 @@ sql_real_connect(char *host,char *database,char *user,char *password, mysql_close(&mysql); connected= 0; } +#ifdef HAVE_OPENSSL else mysql_ssl_clear(&mysql); /* SSL data structres should be freed even if connection was not made */ +#endif mysql_init(&mysql); if (opt_connect_timeout) { @@ -2571,6 +2578,7 @@ static void mysql_end_timer(ulong start_time,char *buff) strmov(strend(buff),")"); } +#ifndef EMBEDDED_SERVER /* Keep sql_string library happy */ gptr sql_alloc(unsigned int Size) @@ -2582,3 +2590,4 @@ void sql_element_free(void *ptr) { my_free((gptr) ptr,MYF(0)); } +#endif /* EMBEDDED_SERVER */ |