diff options
author | unknown <monty@narttu.mysql.fi> | 2003-04-22 22:41:59 +0300 |
---|---|---|
committer | unknown <monty@narttu.mysql.fi> | 2003-04-22 22:41:59 +0300 |
commit | ac02f54022f2a64ada230ef4a3f446b26b143275 (patch) | |
tree | 5d018897c694206dbaf1995bb7862e5d5ad8a93d /tests/ssl_test.c | |
parent | 43f1511a31a8e47682410ca5b02eb0dd4aba16d8 (diff) | |
download | mariadb-git-ac02f54022f2a64ada230ef4a3f446b26b143275.tar.gz |
Removed some not used files
Remove the 'fs' file systems as this is not maintained.
Moved programs from client to tests
tests/deadlock_test.c:
Rename: div/deadlock_test.c -> tests/deadlock_test.c
BitKeeper/deleted/.del-CorbaFS.idl~719ba9d93c206620:
Delete: fs/CorbaFS.idl
BitKeeper/deleted/.del-Makefile.am~95f21e278745904c:
Delete: fs/Makefile.am
BitKeeper/deleted/.del-RunServer.sh~34ea2653535fbb5c:
Delete: fs/RunServer.sh
BitKeeper/deleted/.del-database.c~af098622e818ce0d:
Delete: fs/database.c
BitKeeper/deleted/.del-dump.sql~68646092f0c5bc96:
Delete: fs/dump.sql
BitKeeper/deleted/.del-korbit-kernel-2.4.1-patch~742e5e67c1132b2e:
Delete: fs/korbit-kernel-2.4.1-patch
BitKeeper/deleted/.del-libmysqlfs.c~70cc07d61deedd16:
Delete: fs/libmysqlfs.c
BitKeeper/deleted/.del-libmysqlfs.h~7b60f308be50370e:
Delete: fs/libmysqlfs.h
BitKeeper/deleted/.del-my.cnf~bbd975fd6377e704:
Delete: fs/my.cnf
BitKeeper/deleted/.del-mysqlcorbafs.c~fc58c116eeea996a:
Delete: fs/mysqlcorbafs.c
BitKeeper/deleted/.del-mysqlcorbafs.h~414821d6836e655a:
Delete: fs/mysqlcorbafs.h
BitKeeper/deleted/.del-mysqlcorbafs_test.c~8bb3afa230542e05:
Delete: fs/mysqlcorbafs_test.c
BitKeeper/deleted/.del-README~b9f437fbd6dce7a5:
Delete: fs/README
BitKeeper/deleted/.del-mysqlfsck~247a2d2b9729b95e:
Delete: fs/mysqlfsck
tests/insert_test.c:
Rename: client/insert_test.c -> tests/insert_test.c
tests/list_test.c:
Rename: client/list_test.c -> tests/list_test.c
tests/select_test.c:
Rename: client/select_test.c -> tests/select_test.c
BitKeeper/deleted/.del-thimble.cc~3fa3754a4c639242:
Delete: client/thimble.cc
tests/thread_test.c:
Rename: client/thread_test.c -> tests/thread_test.c
tests/connect_test.c:
Rename: client/connect_test.c -> tests/connect_test.c
tests/showdb_test.c:
Rename: client/showdb_test.c -> tests/showdb_test.c
tests/ssl_test.c:
Rename: client/ssl_test.c -> tests/ssl_test.c
BitKeeper/deleted/.del-mysql_install.c~8c089740d79a92:
Delete: extra/mysql_install.c
BitKeeper/deleted/.del-cache_manager.cc~c506b365b140d30c:
Delete: sql/cache_manager.cc
BitKeeper/deleted/.del-cache_manager.h~adb8639e510c6f6e:
Delete: sql/cache_manager.h
client/Makefile.am:
Move insert_test, select_test and thread_test under 'tests'
extra/Makefile.am:
Remove not used program mysql_install
sql/item_strfunc.cc:
Simple optimization
sql/item_sum.cc:
Simple code cleanup.
tests/Makefile.am:
Added test programs
Diffstat (limited to 'tests/ssl_test.c')
-rw-r--r-- | tests/ssl_test.c | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/tests/ssl_test.c b/tests/ssl_test.c new file mode 100644 index 00000000000..279c1e95fdc --- /dev/null +++ b/tests/ssl_test.c @@ -0,0 +1,81 @@ +/* Copyright (C) 2000 MySQL 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 */ + + +#ifdef __WIN__ +#include <windows.h> +#endif +#include <stdio.h> +#include <stdlib.h> +#include "mysql.h" +#include "config.h" +#define SELECT_QUERY "select name from test where num = %d" + + +int main(int argc, char **argv) +{ +#ifdef HAVE_OPENSSL + int count, num; + MYSQL mysql,*sock; + MYSQL_RES *res; + char qbuf[160]; + + if (argc != 3) + { + fprintf(stderr,"usage : ssl_test <dbname> <num>\n\n"); + exit(1); + } + + mysql_init(&mysql); +#ifdef HAVE_OPENSSL + mysql_ssl_set(&mysql,"../SSL/MySQL-client-key.pem","../SSL/MySQL-client-cert.pem","../SSL/MySQL-ca-cert.pem","../SSL/"); +#endif + if (!(sock = mysql_real_connect(&mysql,"127.0.0.1",0,0,argv[1],3306,NULL,0))) + { + fprintf(stderr,"Couldn't connect to engine!\n%s\n\n",mysql_error(&mysql)); + perror(""); + exit(1); + } + printf("Cipher:%s\n",mysql_ssl_cipher(&mysql)); + count = 0; + num = atoi(argv[2]); + while (count < num) + { + sprintf(qbuf,SELECT_QUERY,count); + if(mysql_query(sock,qbuf)) + { + fprintf(stderr,"Query failed (%s)\n",mysql_error(sock)); + exit(1); + } + if (!(res=mysql_store_result(sock))) + { + fprintf(stderr,"Couldn't get result from query failed\n", + mysql_error(sock)); + exit(1); + } +#ifdef TEST + printf("number of fields: %d\n",mysql_num_fields(res)); +#endif + mysql_free_result(res); + count++; + } + mysql_close(sock); +#else /* HAVE_OPENSSL */ + printf("ssl_test: SSL not configured.\n"); +#endif /* HAVE_OPENSSL */ + exit(0); + return 0; /* Keep some compilers happy */ +} |