diff options
author | unknown <cmiller@zippy.cornsilk.net> | 2006-08-17 10:49:56 -0400 |
---|---|---|
committer | unknown <cmiller@zippy.cornsilk.net> | 2006-08-17 10:49:56 -0400 |
commit | 7faa9efe4b2fbc236960580687583dfa4051303f (patch) | |
tree | 01ab52ededacb35944b725cd2dac7befb3c9c613 /tests | |
parent | d82c1514e715c2a8d261b3812987dd1bc92f7d79 (diff) | |
parent | d09ba5a874909b997caa43725b6990b0a46aaeec (diff) | |
download | mariadb-git-7faa9efe4b2fbc236960580687583dfa4051303f.tar.gz |
Merge zippy.cornsilk.net:/home/cmiller/work/mysql/merge/tmp_merge
into zippy.cornsilk.net:/home/cmiller/work/mysql/merge/mysql-5.0
tests/mysql_client_test.c:
Auto merged
Diffstat (limited to 'tests')
-rw-r--r-- | tests/mysql_client_test.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index fd3b1783100..4e9cfeebaf7 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -122,7 +122,7 @@ static void client_disconnect(); void die(const char *file, int line, const char *expr) { fprintf(stderr, "%s:%d: check failed: '%s'\n", file, line, expr); - fflush(stderr); + fflush(NULL); abort(); } @@ -14942,11 +14942,14 @@ static void test_bug17667() myquery(rc); } - sleep(1); /* The server may need time to flush the data to the log. */ + /* Make sure the server has written the logs to disk before reading it */ + rc= mysql_query(mysql, "flush logs"); + myquery(rc); master_log_filename = (char *) malloc(strlen(opt_vardir) + strlen("/log/master.log") + 1); strcpy(master_log_filename, opt_vardir); strcat(master_log_filename, "/log/master.log"); + printf("Opening '%s'\n", master_log_filename); log_file= fopen(master_log_filename, "r"); free(master_log_filename); @@ -14960,12 +14963,24 @@ static void test_bug17667() do { memset(line_buffer, '/', MAX_TEST_QUERY_LENGTH*2); - DIE_UNLESS(fgets(line_buffer, MAX_TEST_QUERY_LENGTH*2, log_file) != - NULL); - /* If we reach EOF before finishing the statement list, then we failed. */ + if(fgets(line_buffer, MAX_TEST_QUERY_LENGTH*2, log_file) == NULL) + { + /* If fgets returned NULL, it indicates either error or EOF */ + if (feof(log_file)) + DIE("Found EOF before all statements where found"); + else + { + fprintf(stderr, "Got error %d while reading from file\n", + ferror(log_file)); + DIE("Read error"); + } + } } while (my_memmem(line_buffer, MAX_TEST_QUERY_LENGTH*2, statement_cursor->buffer, statement_cursor->length) == NULL); + + printf("Found statement starting with \"%s\"\n", + statement_cursor->buffer); } printf("success. All queries found intact in the log.\n"); |