Commit d09ba5a8 authored by unknown's avatar unknown

Add some more code to analyze why the fgets fails.

parent 703c50e6
...@@ -14951,9 +14951,18 @@ static void test_bug17667() ...@@ -14951,9 +14951,18 @@ static void test_bug17667()
do { do {
memset(line_buffer, '/', MAX_TEST_QUERY_LENGTH*2); memset(line_buffer, '/', MAX_TEST_QUERY_LENGTH*2);
DIE_UNLESS(fgets(line_buffer, MAX_TEST_QUERY_LENGTH*2, log_file) != if(fgets(line_buffer, MAX_TEST_QUERY_LENGTH*2, log_file) == NULL)
NULL); {
/* If we reach EOF before finishing the statement list, then we failed. */ /* 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, } while (my_memmem(line_buffer, MAX_TEST_QUERY_LENGTH*2,
statement_cursor->buffer, statement_cursor->length) == NULL); statement_cursor->buffer, statement_cursor->length) == NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment