mariadb/mysql-test
Guilhem Bichot dc65d9217c Fix for Bug#11765141 - "58072: LOAD DATA INFILE: LEAKS IO CACHE MEMORY WHEN ERROR OCCURS"
mysql-test/t/loaddata.test:
  test for bug; without fix, running the test with --valgrind would show the leak
  and make the test fail.
sql/sql_load.cc:
  * In READ_INFO class, 'need_end_io_cache' is true as long as init_io_cache() was called,
  so if it's true, we need to call end_io_cache(), to free memory allocated
  by init_io_cache(). No matter the value of 'error'. In the bug's scenario,
  'error' was set to true in read_sep_field() because
  '1' (read from file) isn't suitable to load into a geometric column. Because of
  'error', end_io_cache() was not called.
  Note: end_io_cache() calls my_b_flush_io_cache(), which will do nothing wrong given
  that the file is opened for reads only; see the init_io_cache() call which uses
  only those read-only types:
  (get_it_from_net) ? READ_NET : (is_fifo ? READ_FIFO : READ_CACHE).
  IF the cache were rather used to write to the file, my_b_flush_io_cache() may
  write to it, and it may be questionable to write to the file
  if 'error' is true. But here there's no problem.
  * Now that 'need_end_io_cache' is checked even if 'error' is true, it needs
  to be initialized in all cases.
  * Bonus: move some variables to the initialization list.
2011-04-07 15:09:19 +02:00
..
collections BUG#12371924 2011-04-18 23:59:15 +04:00
extra One more test suppression for rpl_extra_col_master tests 2011-03-31 15:48:05 +02:00
include mtr: cleaned up some superfluos global warning suppressions 2011-03-30 14:33:53 +02:00
lib Bug #12351213 MTR --VS-CONFIG DOES NOT WORK LIKE MTR_VS_CONFIG 2011-04-14 16:17:58 +02:00
r Fix for Bug#11765141 - "58072: LOAD DATA INFILE: LEAKS IO CACHE MEMORY WHEN ERROR OCCURS" 2011-04-07 15:09:19 +02:00
std_data Fix for Bug#56817 - mysqlhotcopy tests fail when DBI and DBD-mysql perl modules are not found 2011-01-29 12:38:36 +01:00
suite BUG#12371924. Fxi test case 2011-04-25 23:49:56 +04:00
t Fix for Bug#11765141 - "58072: LOAD DATA INFILE: LEAKS IO CACHE MEMORY WHEN ERROR OCCURS" 2011-04-07 15:09:19 +02:00
Makefile.am Fixed copyright headers in mtr src files 2011-01-18 11:03:44 +01:00
mysql-stress-test.pl Fixed copyright headers in mtr src files 2011-01-18 11:03:44 +01:00
mysql-test-run.pl Bug #12360195 MTR DOES NOT IGNORE TABS IN EXPERIMENTAL FILE 2011-04-15 10:30:52 +02:00
purify.supp - Added/updated copyright headers 2010-12-28 19:57:23 +01:00
README
README.gcov
README.stress
valgrind.supp Backport the fix for Bug#59875 Valgrind warning in buf0buddy.c from 5.5 2011-02-07 16:45:37 +02:00

This directory contains a test suite for the MySQL daemon. To run
the currently existing test cases, simply execute ./mysql-test-run in
this directory. It will fire up the newly built mysqld and test it.

Note that you do not have to have to do "make install", and you could
actually have a co-existing MySQL installation. The tests will not
conflict with it.

All tests must pass. If one or more of them fail on your system, please
read the following manual section for instructions on how to report the
problem:

http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html

If you want to use an already running MySQL server for specific tests,
use the --extern option to mysql-test-run. Please note that in this mode,
the test suite expects you to provide the names of the tests to run.
For example, here is the command to run the "alias" and "analyze" tests
with an external server:

mysql-test-run --extern alias analyze

To match your setup, you might also need to provide --socket, --user, and
other relevant options.

With no test cases named on the command line, mysql-test-run falls back
to the normal "non-extern" behavior. The reason for this is that some
tests cannot run with an external server.


You can create your own test cases. To create a test case, create a new
file in the t subdirectory using a text editor. The file should have a .test
extension. For example:

 xemacs t/test_case_name.test

 In the file, put a set of SQL statements that create some tables,
 load test data, and run some queries to manipulate it.

 We would appreciate it if you name your test tables t1, t2, t3 ... (to not
 conflict too much with existing tables).

 Your test should begin by dropping the tables you are going to create and
 end by dropping them again.  This ensures that you can run the test over
 and over again.
 
 If you are using mysqltest commands (like result file names) in your
 test case, you should create the result file as follows:

 mysql-test-run --record test_case_name

 or

 mysqltest --record < t/test_case_name.test

 If you only have a simple test cases consisting of SQL statements and
 comments, you can create the test case in one of the following ways:

 mysql-test-run --record test_case_name

 mysql test < t/test_case_name.test > r/test_case_name.result

 mysqltest --record --record-file=r/test_case_name.result < t/test_case_name.test

 When this is done, take a look at r/test_case_name.result
 - If the result is incorrect, you have found a bug. In this case, you should
   edit the test result to the correct results so that we can verify
   that the bug is corrected in future releases.

To submit your test case, put your .test file and .result file(s) into
a tar.gz archive, add a README that explains the problem, ftp the 
archive to ftp://support.mysql.com/pub/mysql/secret/ and send a mail
to bugs@lists.mysql.com