diff options
author | unknown <tim@black.box> | 2001-09-16 22:10:50 -0400 |
---|---|---|
committer | unknown <tim@black.box> | 2001-09-16 22:10:50 -0400 |
commit | dd02abb187d00ed7d0f2aa0baace2d3d0e730511 (patch) | |
tree | 6784f5457669bae83fdca495c6affbe7e3e41b30 /client | |
parent | 5810866b69ab1ef14b26305fa45943686377da2b (diff) | |
parent | 5fffbb123615ad0b256652390467b33ed2919afc (diff) | |
download | mariadb-git-dd02abb187d00ed7d0f2aa0baace2d3d0e730511.tar.gz |
Merge
BitKeeper/etc/ignore:
auto-union
configure.in:
SCCS merged
client/mysql.cc:
SCCS merged
client/mysqltest.c:
SCCS merged
mysql-test/mysql-test-run.sh:
Auto merged
libmysqld/libmysqld.c:
SCCS merged
Diffstat (limited to 'client')
-rw-r--r-- | client/mysql.cc | 9 | ||||
-rw-r--r-- | client/mysqltest.c | 15 |
2 files changed, 24 insertions, 0 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index 43df5037a68..bb425ea33b1 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -243,6 +243,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 */ @@ -270,6 +271,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]); @@ -363,6 +365,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 @@ -372,9 +375,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) { @@ -2208,9 +2213,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) { @@ -2562,6 +2569,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) @@ -2573,3 +2581,4 @@ void sql_element_free(void *ptr) { my_free((gptr) ptr,MYF(0)); } +#endif /* EMBEDDED_SERVER */ diff --git a/client/mysqltest.c b/client/mysqltest.c index a021478d737..beea95720d1 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -1931,12 +1931,26 @@ static void init_var_hash() var_from_env("BIG_TEST", opt_big_test ? "1" : "0"); } +static const char *embedded_server_args[] = { + "", /* XXX: argv[0] is program name - we should fix the API */ + "--datadir=.", + "--language=/home/tim/my/4/sql/share/english", + "--skip-innodb", + NullS +}; +static const char *embedded_server_groups[] = { + "mysql-test-server", + NullS +}; + int main(int argc, char** argv) { int error = 0; struct st_query* q; my_bool require_file=0, q_send_flag=0; char save_file[FN_REFLEN]; + mysql_server_init(sizeof(embedded_server_args) / sizeof(char *) - 1, + embedded_server_args, embedded_server_groups); MY_INIT(argv[0]); save_file[0]=0; @@ -2100,6 +2114,7 @@ int main(int argc, char** argv) printf("ok\n"); } + mysql_server_end(); free_used_memory(); exit(error ? 1 : 0); return error ? 1 : 0; /* Keep compiler happy */ |