From c4d0901d00bdeb496aeffedc80e6d583711086d3 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Nov 2007 18:59:25 +0300 Subject: Fix for bug #32221: bug25714, mytest, mysql_client_test complaints and crashes. MySQL distributions contain a number of programs that are used only by the MySQL test suite internally, i.e. they are not indended to be invoked directly by a user. As a result, such programs are not documented, do not have any built-in help or proper error reporting, which may confuse users. This patch fixes the problem with the following changes: - mytest, libmysqltest and all references to them were removed from the distribution since they are not used anymore - bug25714 now displays an error message when run with incorrect arguments or with the --help option - mysql_client_test now does not call abort() in case of errors, instead it does a clean exit() with a proper error status. BitKeeper/deleted/.del-mytest.c: Delete: libmysql/mytest.c BitKeeper/deleted/.del-myTest-package.dsp: Delete: VC++Files/libmysqltest/myTest-package.dsp BitKeeper/deleted/.del-myTest-package_ia64.dsp: Delete: VC++Files/libmysqltest/myTest-package_ia64.dsp BitKeeper/deleted/.del-myTest.dsp~4a8c480769193952: Delete: VC++Files/libmysqltest/myTest.dsp BitKeeper/deleted/.del-myTest.vcproj: Delete: VC++Files/libmysqltest/myTest.vcproj BitKeeper/deleted/.del-myTest_ia64.dsp: Delete: VC++Files/libmysqltest/myTest_ia64.dsp BitKeeper/deleted/.del-mytest.c~9a99338689e5de8: Delete: VC++Files/libmysqltest/mytest.c BitKeeper/deleted/.del-mytest.dsw~2324698861155335: Delete: VC++Files/libmysqltest/mytest.dsw VC++Files/copy_mysql_files.bat: Removed references to libmysqltest. libmysql/CMakeLists.txt: Removed rules for myTest. libmysql/Makefile.am: Removed mytest.c from EXTRA_DIST. tests/bug25714.c: Display a meaningful error message when run incorrectly or with the --help option. tests/mysql_client_test.c: In case of error, don't cause abnormal program termination, do a clean exit() with an error status. --- tests/bug25714.c | 6 +++++- tests/mysql_client_test.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/bug25714.c b/tests/bug25714.c index e9b2be44209..88485aa1962 100644 --- a/tests/bug25714.c +++ b/tests/bug25714.c @@ -29,8 +29,12 @@ int main (int argc, char **argv) MY_INIT(argv[0]); - if (argc != 2) + if (argc != 2 || !strcmp(argv[1], "--help")) + { + fprintf(stderr, "This program is a part of the MySQL test suite. " + "It is not intended to be executed directly by a user.\n"); return -1; + } mysql_init(&conn); if (!mysql_real_connect( diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index b9f39021114..8ab8f209ae6 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -123,7 +123,7 @@ static void die(const char *file, int line, const char *expr) fflush(stdout); fprintf(stderr, "%s:%d: check failed: '%s'\n", file, line, expr); fflush(stderr); - abort(); + exit(1); } -- cgit v1.2.1