Commit graph

288 commits

Author SHA1 Message Date
sayantan.dutta@oracle.com
3068eee354 Bug #11754855 46528: NEED A WAY TO PASS A VARIABLE TO MTR COMMANDS
modified function do_get_error in mysqltest.cc to handle multiple variable passed
added test case to mysqltest.test to verify handling to multiple errors passed
2011-10-19 12:53:52 +05:30
Bjorn Munch
0bc430286e 12956584 followup fix for mysqltest
run_query_stmt() might use disable_xxx vars after calling handle_no_error
  But handle_no_error() hes reverted any ONCE settings
  Fix is to take revert_properties() out of handle_no_error()
2011-09-30 15:25:19 +02:00
Bjorn Munch
e08fa4affc upmerge 12793118,12912120 2011-09-15 13:09:24 +02:00
Bjorn Munch
50f05fab28 Bug #12956584 - MYSQLTEST: --ENABLE_X OR --DISABLE_X APPLYING ONLY TO NEXT COMMAND/STMT
Followup fixes for --ps-protocol:
  1) Incorrectly set ps_protocol variable instead of ps_protocol_enabled
  2) disable_result_log was tested after calling handle_no_error()
        which would revert a temporary setting.
2011-09-15 10:53:19 +02:00
Bjorn Munch
d75f2a4a6b Bug #12793118 MYSQLTEST: --ERROR AND --DISABLE_ABORT_ON_ERROR DO NOT WORK FOR SQL IN COMMANDS
Call handle_error() instead of die() when evaluating these
  Must remember "current command" with link to errors to ignore
  Added test cases to mysqltest.test
2011-09-14 15:19:24 +02:00
Bjorn Munch
79b7d05c4c Bug #12956584 MYSQLTEST: --ENABLE_X OR --DISABLE_X APPLYING ONLY TO NEXT COMMAND/STMT
Added a keyword ONCE to add to those commands
  Some internal tables to keep track of which properties are
    temporarily overriden
  Added tests in mysqltest.test
  Updates to other tests will be done later
2011-09-14 15:15:36 +02:00
Bjorn Munch
7dc28845ca Bug #12793170 MYSQLTEST: PROVIDE ACCESS TO ERROR NAMES THROUGH NUMERIC
CODES AND VICE VERSA
  Followup: Some statement may give errors not in the list,
  map these to "<Unknown>" rather than failing.
2011-08-22 14:42:12 +02:00
Bjorn Munch
4ad7b28cd7 Bug #12793170 MYSQLTEST: PROVIDE ACCESS TO ERROR NAMES THROUGH NUMERIC CODES AND VICE VERSA
Added a second internal variable $mysql_errname
  This is set the same way as $mysql_errno
  Can be used like "if ($mysql_errname == ER_NO_SUCH_TABLE)...."
2011-08-22 13:58:49 +02:00
Alexander Nozdrin
f636987d3b Manual merge from mysql-5.1. 2011-07-22 11:50:44 +04:00
Alexander Nozdrin
c4dad60a73 Manual merge from mysql-5.0. 2011-07-22 11:46:45 +04:00
Kent Boortz
b6e6097c95 Updated/added copyright headers 2011-07-03 17:47:37 +02:00
Kent Boortz
1400d7a2cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
Georgi Kodinov
8d7361f803 Fixed cast warnings in introducing the pluggable authentication client
options.
2011-06-06 13:27:05 +03:00
Luis Soares
6f3e97a6cb BUG#11762616: BUG#55229: 'POSTION'
Manual merge from mysql-5.1 into mysql-5.5.

Conflicts
=========
Text conflict in mysql-test/suite/rpl/t/rpl_row_until.test
Text conflict in sql/handler.h
Text conflict in storage/archive/ha_archive.cc
2011-05-06 00:50:31 +01:00
Luis Soares
ed6aae83c3 BUG#11762616: BUG#55229: 'POSTION'
Fix for all "postion" in Oracle files (s/postion/position). 
Updated the copyright notices where needed.
2011-05-06 00:46:53 +01:00
Marko Mäkelä
1a0dde9206 Bug #11766513 - 59641: Prepared XA transaction in system after hard crash
causes future shutdown hang

InnoDB would hang on shutdown if any XA transactions exist in the
system in the PREPARED state. This has been masked by the fact that
MySQL would roll back any PREPARED transaction on shutdown, in the
spirit of Bug #12161 Xa recovery and client disconnection.

[mysql-test-run] do_shutdown_server: Interpret --shutdown_server 0 as
a request to kill the server immediately without initiating a
shutdown procedure.

xid_cache_insert(): Initialize XID_STATE::rm_error in order to avoid a
bogus error message on XA ROLLBACK of a recovered PREPARED transaction.

innobase_commit_by_xid(), innobase_rollback_by_xid(): Free the InnoDB
transaction object after rolling back a PREPARED transaction.

trx_get_trx_by_xid(): Only consider transactions whose
trx->is_prepared flag is set. The MySQL layer seems to prevent
attempts to roll back connected transactions that are in the PREPARED
state from another connection, but it is better to play it safe. The
is_prepared flag was introduced in the InnoDB Plugin.

trx_n_prepared: A new counter, counting the number of InnoDB
transactions in the PREPARED state.

logs_empty_and_mark_files_at_shutdown(): On shutdown, allow
trx_n_prepared transactions to exist in the system.

trx_undo_free_prepared(), trx_free_prepared(): New functions, to free
the memory objects of PREPARED transactions on shutdown. This is not
needed in the built-in InnoDB, because it would collect all allocated
memory on shutdown. The InnoDB Plugin needs this because of
innodb_use_sys_malloc.

trx_sys_close(): Invoke trx_free_prepared() on all remaining
transactions.
2011-04-07 21:12:54 +03:00
Marko Mäkelä
cdba023d9a Merge mysql-5.1-innodb to mysql-5.5-innodb. 2011-04-11 17:03:32 +03:00
Bjorn Munch
0563ff5ec5 merge from 5.5 main 2011-03-22 15:40:25 +01:00
Bjorn Munch
dd8574288c upmerge 11885854 2011-03-18 15:42:58 +01:00
Bjorn Munch
f4ac6eb117 Bug #11885854 MYSQLTEST: PS-PROTOCOL IMPLIED BY CURSOR-PROTOCOL LOST AFTER ENABLE_PS_PROTOCOL
The condition cursor-protocol => ps-protocol was done at "current setting" level"
Moved it to "set by command line" level
2011-03-18 12:13:54 +01:00
Guilhem Bichot
77c0f33ee2 Fix for BUG#59894
"set optimizer_switch to e or d causes invalid memory writes/valgrind warnings":
due to prefix support, the argument "e" was overwritten with its full value
"engine_condition_pushdown", which caused a buffer overrun.
This was wrong usage of find_type(); other wrong usages are fixed here too.
Please start reading with the comment of typelib.c.
2011-02-11 15:00:09 +01:00
Mattias Jonsson
04a8611112 merge of bug 47902 and (null-merge) of bug 57924.
bug#57924 does not occur in 5.5, so I reverted the 5.1 specific
code and used the errors from 5.5 instead in the tests
2011-01-26 19:33:53 +01:00
Mattias Jonsson
15f635fdf6 merge 2011-01-26 16:34:34 +01:00
Bjorn Munch
097445ebf5 Fixed copyright headers in mtr src files 2011-01-18 11:03:44 +01:00
Bjorn Munch
7b9c438099 Fixed copyright headers in mtr src files 2011-01-18 11:21:37 +01:00
Bjorn Munch
443b3bed2f Bug #59153 mysqltest produces a valgrind warning when the running test fails
Local variable ds_warnings in run_query not cleared.
But when we call die() we don't have access to it.
Set global var. to point to it when allocated.
2011-01-11 15:23:39 +01:00
Bjorn Munch
3494a915fa upmerge 58896,58900,59002 2011-01-11 15:15:25 +01:00
Bjorn Munch
0630418539 Bug #58900 query_get_value crashes when result begins with dollar sign
Generalized fix for recursive backtick
Optional arg to eval_expr telling it not to interpret
2011-01-11 10:54:42 +01:00
Bjorn Munch
c6ad5c819e Bug #59002 Please make mtr print correct file and line number when tests fail
This patchs adds printing of a file stack (with line numbers)
It does not fix the problem of a failure in the non-first iteration of a loop
2011-01-11 10:51:31 +01:00
Mattias Jonsson
3a0b067654 Bug#47902: partition_recover_myisam fails with --ps-protocol
The problem was that the warnings was never written out
when running with --ps-protocol. This was because the
warnings only appeared during the prepare phase, not
the execute phase.

Solved by not clearing the warnings from the prepare phase
if there was no other warnings.

If there are warnings from the execute phase, it is very
likely to be the same as from the prepare phase. My tests
show that if not clearing the warnings from the prepare
phase when there are warnings from the execute phase, there
will be duplicated warnings in the result.
2011-01-10 23:42:37 +01:00
Sven Sandberg
e37c86de18 Merged BUG#49978 from 5.1-bugteam to 5.5-bugteam. 2010-12-19 18:15:12 +01:00
Sven Sandberg
09c80e12c5 BUG#49978: Replication tests don't clean up replication state at the end
Major replication test framework cleanup. This does the following:
 - Ensure that all tests clean up the replication state when they
   finish, by making check-testcase check the output of SHOW SLAVE STATUS.
   This implies:
    - Slave must not be running after test finished. This is good
      because it removes the risk for sporadic errors in subsequent
      tests when a test forgets to sync correctly.
    - Slave SQL and IO errors must be cleared when test ends. This is
      good because we will notice if a test gets an unexpected error in
      the slave threads near the end.
    - We no longer have to clean up before a test starts.
 - Ensure that all tests that wait for an error in one of the slave
   threads waits for a specific error. It is no longer possible to
   source wait_for_slave_[sql|io]_to_stop.inc when there is an error
   in one of the slave threads. This is good because:
    - If a test expects an error but there is a bug that causes
      another error to happen, or if it stops the slave thread without
      an error, then we will notice.
    - When developing tests, wait_for_*_to_[start|stop].inc will fail
      immediately if there is an error in the relevant slave thread.
      Before this patch, we had to wait for the timeout.
 - Remove duplicated and repeated code for setting up unusual replication
   topologies. Now, there is a single file that is capable of setting
   up arbitrary topologies (include/rpl_init.inc, but
   include/master-slave.inc is still available for the most common
   topology). Tests can now end with include/rpl_end.inc, which will clean
   up correctly no matter what topology is used. The topology can be
   changed with include/rpl_change_topology.inc.
 - Improved debug information when tests fail. This includes:
    - debug info is printed on all servers configured by include/rpl_init.inc
    - User can set $rpl_debug=1, which makes auxiliary replication files
      print relevant debug info.
 - Improved documentation for all auxiliary replication files. Now they
   describe purpose, usage, parameters, and side effects.
 - Many small code cleanups:
    - Made have_innodb.inc output a sensible error message.
    - Moved contents of rpl000017-slave.sh into rpl000017.test
    - Added mysqltest variables that expose the current state of
      disable_warnings/enable_warnings and friends.
    - Too many to list here: see per-file comments for details.
2010-12-19 18:07:28 +01:00
Georgi Kodinov
7bdecb1d4a merge 2010-12-16 16:40:52 +02:00
Bjorn Munch
09889ea2c3 merge from 5.5-mtr 2010-12-09 20:53:22 +01:00
Bjorn Munch
f072749e06 upmerge 58511,58522,58608,58092 2010-12-09 15:32:39 +01:00
Bjorn Munch
bff782d0f0 Bug #58511 mysqltest doesn't always run statements in ps mode
mysqltest checks if the stmt is one that should be run in ps mode,
  but regexp doesn't match if preceeded by /* */ comment.
Fix: match function will jump over /*..*/ if found at start
2010-12-09 14:43:42 +01:00
Bjorn Munch
83e7edde87 Bug #58522 mtr --debug leaks memory when test fails
Backported use of setenv() from 5.5
This will remove the leak on systems that have setenv()
I have not fixed the string.c leak, it's a local variable
   that the cleanup function cannot access.
2010-12-09 14:42:04 +01:00
Bjorn Munch
955f42588e Bug #58695 mysqltest coredumps on "if($x == ){"
Add check that there is a RHS of the expression
Added to mysqltest.test
2010-12-09 12:15:25 +01:00
Bjorn Munch
57f7b9f468 Bug #58710 Valgrind warnings in mysqltest
Var's string value was not 0-terminated if intially null.
While at it, also removed some reported memory leaks
Added sanity check, setting val_len=0 if val==0
2010-12-09 12:14:00 +01:00
Bjorn Munch
7a404214e0 merge from 5.1-mtr 2010-12-09 20:32:47 +01:00
Bjorn Munch
9dca123d02 Bug #58092 Test "rpl_cross_version" has "copy_file" failing
I am not fixing the test failure
Adds printing of my_errno when commands fail, could hopefully help
2010-12-01 11:11:16 +01:00
Davi Arnaut
1ab37fd3c0 Merge of mysql-5.1-bugteam into mysql-5.5-bugteam. 2010-11-30 17:06:53 -02:00
Bjorn Munch
d2fb19855e merge from 5.5-mtr 2010-11-27 11:52:17 +01:00
Davi Arnaut
0008e06489 Bug#51817: incorrect assumption: thd->query at 0x2ab2a8360360 is an invalid pointer
The problem is that the logic which checks if a pointer is
valid relies on a poor heuristic based on the start and end
addresses of the data segment and heap.

Apart from miscalculating the heap bounds, this approach also
suffers from the fact that memory can come from places other
than the heap. See Bug#58528 for a more detailed explanation.

On Linux, the solution is to access the process's memory
through /proc/self/task/<tid>/mem, which allows for retrieving
the contents of pages within the virtual address space of
the calling process. If a address range is not mapped, a
input/output error is returned.
2010-11-26 19:59:10 -02:00
Bjorn Munch
20851e4012 Bug #58412 mysqltest: allow quoting of strings in let and in if comparison
Stripping quotes in let was a bad idea, will not fix
Added code to strip quotes from rhs in comparisons
2010-11-26 10:57:01 +01:00
Ramil Kalimullin
0628752fe9 Manual-merge from mysql-5.1-bugteam. 2010-11-22 12:21:10 +03:00
Bjorn Munch
b295a25109 merge from 5.1-mtr 2010-11-19 10:29:08 +01:00
Bjorn Munch
374c6447ca upmerge 58257 2010-11-18 16:41:35 +01:00
Bjorn Munch
d718af063e Bug #58257 mysqltest: in if(), ! $var with space is always false
Evaluation would start with the space and thus ignore the $
Added while() to skip past white space
2010-11-17 16:05:52 +01:00
Bjorn Munch
f45b6605a2 avoid compilation warning about incomplete switch 2010-11-19 12:35:53 +01:00