Commit graph

3265 commits

Author SHA1 Message Date
Bjorn Munch
01c0d46af8 Bug #39774 mysql-test-run's remove_file can't use wildcards, this should be documented
Added remove_files_wildcard that allows to remove multiple files at once.
This is a port of original patch to Windows.
2010-02-04 13:15:42 +01:00
Bjorn Munch
84616df3ff merge 49837 2010-01-20 14:23:57 +01:00
Bjorn Munch
87ff57cb7e merge 48888 2010-01-20 14:22:34 +01:00
Bjorn Munch
94ccc34537 Bug #49878 delimiter under false 'if' makes mysqltest test fail with 'Missing end of block'
delimiter not executed so does not recognize end of block
Always execute delimiter command, revert after false if() block.
2010-01-20 14:18:27 +01:00
Bernd Ocklin
75e9a54a53 exporting server version and other as env var (bug#50471) 2010-01-20 12:54:55 +01:00
Bjorn Munch
b554f4c52d Bug #48888 mysqltest crashes on --replace_result if 'from' is longer than ~1024 symbols
valgrind pointed to a buffer allocated by my_realloc which looked fishy
Replaced size with what was probably intended, added test case.
Now also fixed line after review comment
2010-01-20 12:52:35 +01:00
Bjorn Munch
5ae2eda776 Bug #49837 mysqltest exec cannot handle multi-line command correctly
Since the exec command line is passed on externally, it cannot take newlines
Simply replace \n with space
Now also added test case
2010-01-20 12:51:18 +01:00
Bjorn Munch
e1b42965a5 Bug #49269 mysqltest crashes on 'reap' if query executed after 'send'
Undid amendment allowing pending reap after switching connections
Moved check for pending reap earlier; failed if running with ps-protocol
2010-01-07 11:22:45 +01:00
Bjorn Munch
ed64190b23 Bug #49269 mysqltest crashes on 'reap' if query executed after 'send'
Small amendment: ignore pending reap when switching connection, add test
2010-01-06 12:56:22 +01:00
Bjorn Munch
08c8863ec4 Bug #49269 mysqltest crashes on 'reap' if query executed after 'send'
Set a flag after send to trap the case
2010-01-06 09:45:28 +01:00
Bjorn Munch
5b66dab00f Bug #48863 mysql test: enable and disable case insensitive compare mode
Implemented --lowercase_result which lower cases next result
2010-01-06 09:42:21 +01:00
Bjorn Munch
d4676c22e0 Merge from 5.1 main 2009-12-16 10:37:41 +01:00
Bjorn Munch
a88898e692 backport mysqltest send_eval from 42520 2009-12-16 10:06:37 +01:00
Bjorn Munch
69c540588a Bug #48250 mysqtest_embedded can lock destroyed mutex
As suggested, replaced relevant uses of my_fopen with fopen (and close)
Tested on HPUX where it was reproducable with test innodb_bug30919
2009-11-26 11:16:06 +01:00
Satya B
fab8effefe merge to mysql-5.1-bugteam 2009-11-26 13:12:16 +05:30
Satya B
82b115ec16 Fix for BUG#47671 - wrong character-set after upgrade from 5.1.34 to 5.1.39
mysql client displays wrong character-set of server. When a user changes the
charset of a server, mysql client 'status' command displays wrong charset but
the command "SHOW VARIABLES LIKE "%charset%" displayed correct charset results.
The problem is only with the mysql client's 'status' command output.

In mysql client, the method mysql_store_lazy_result() returns 0 for
success and non-zero for failure. The method com_status() was using this method
wrongly. Fixed all such instances according to return value of the method 
mysql_store_lazy_result().

client/mysql.cc:
  Fix for BUG#47671 - wrong character-set after upgrade from 5.1.34 to 5.1.39
  
  Fix com_status() method to use mysql_store_lazy_result() properly.
mysql-test/r/bug47671.result:
  Fix for BUG#47671 - wrong character-set after upgrade from 5.1.34 to 5.1.39
  
  Testcase for BUG#47671
mysql-test/t/bug47671-master.opt:
  Fix for BUG#47671 - wrong character-set after upgrade from 5.1.34 to 5.1.39
  
  Testcase for BUG#47671
mysql-test/t/bug47671.test:
  Fix for BUG#47671 - wrong character-set after upgrade from 5.1.34 to 5.1.39
  
  Testcase for BUG#47671
2009-11-25 12:25:49 +05:30
Tatiana A. Nurnberg
22d0345272 auto-merge 2009-11-24 08:08:47 -08:00
Davi Arnaut
64f097dc80 Post-merge fixes: fix typo and remove unused variables. 2009-11-21 10:11:45 -02:00
Bjorn Munch
b229781c2d Bug #48671 mysqltest fails on 'perl' in file sourced inside 'while'
Actually, fails on 'perl' in any while
Fixed essentially the same way as for append_file
2009-11-11 12:46:19 +01:00
Tatiana A. Nurnberg
1b0be8c5b8 Bug#47655: Memory free error when connecting to 4.1 server from 5.1+ client
When starting the (5.1+) mysql command-line client, we try to get
"select @@version_comment" from the server to present it to the
user. Recent clients are aware that older servers do not have that
variable and fall back on other info to be able to present *something*
at least. This fallback string was allocated through the POSIX interface,
but released through the my*() suite, which rightfully complained about
the imbalance in calls when compiled with --debug. While this wasn't
as bad as it looked (no double-free, use of uninitialized or freed
buffer, etc.), it did look funky.

Using my_strdup() now for what will be my_free()d later.

client/mysql.cc:
  Use my_strdup() for server_version, as we'll my_free() it later
  and don't want to upset the mysql client's memory accounting.
2009-11-02 00:46:00 -08:00
Vladislav Vaintroub
b51777484f merge 2009-11-03 01:52:57 +01:00
Vladislav Vaintroub
2377eed362 Bug #47423 mtr connects to wrong database
The reason for the bug is that mysqtest as well as other client tools
running in test suite (mysqlbinlog, mysqldump) will first try to connect 
whatever database has created shared memory with default base name 
"MySQL" and use this. (Same effect could be seen on Unix if mtr would
not care to calculate "port" and "socket" parameter).
      
The fix ensures that all client tools and  running in mtr use unique  
per-database shared memory base parameters, so there is no possibility
to clash with already installed one. We use socket name for shared memory 
base (it's known to be unique). This shared-memory-base is written to the
MTR config file to the [client] and [mysqld] sections. Fix made also made 
sure all client tools understand and correctly handle --shared-memory-base.
Prior to this patch  it was not the case for  mysqltest, mysqlbinlog and 
mysql_client_test.
      
All new connections done from mtr scripts via connect() will by default 
set shared-memory-base. And finally, there is a possibility to force 
shared memory or pipe connection and overwrite shared memory/pipe base name
from within mtr scripts via optional PIPE or SHM modifier. This functionality
was manually backported from 6.0
(original patch  http://lists.mysql.com/commits/74749)
2009-11-03 01:19:37 +01:00
Georgi Kodinov
27c2af97f7 merge 2009-10-30 16:57:16 +02:00
Georgi Kodinov
ecef6c3308 merge from 5.0-main 2009-10-30 16:34:54 +02:00
unknown
30625323e9 Bug #34777 mysqlbinlog: --help output for --base64-output is hard to understand
Append the description of the 'decode-rows' value for --base64-output argument.
2009-10-28 15:04:06 +08:00
unknown
37743aedda Merge from mysql-5.0.87-release 2009-10-26 19:20:02 +01:00
Tatiana A. Nurnberg
5ef63a4f1c Bug#28141: Control C on query waiting on lock causes ERROR 1053 (server shutdown)
If a thread is killed in the server, we throw "shutdown" only if one is actually in
progress; otherwise, we throw "query interrupted".

Control-C in the mysql command-line client is "incremental" now.
First Control-C sends KILL QUERY (when connected to 5.0+ server, otherwise, see next)
Next  Control-C sends KILL CONNECTION
Next  Control-C aborts client.

As the first two steps only pertain to an existing query,
Control-C will abort the client right away if no query is running.

client will give more detailed/consistent feedback on Control-C now.


client/mysql.cc:
  Extends Control-C handling; enhances up feedback to user.
  
  On 5.0+ servers, we try to be nice and send KILL QUERY first
  if Control-C is pressed in the command-line client, but if
  that doesn't work, we now give the user the opportunity to
  send KILL CONNECTION with another Control-C (and to kill the
  client with another Control-C if that somehow doesn't work
  either).
mysql-test/t/flush_read_lock_kill.test:
  we're getting correct "thread killed" rather than
  "in shutdown" error now
mysql-test/t/kill.test:
  we're getting correct "thread killed" rather than
  "in shutdown" error now
mysql-test/t/rpl000001.test:
  we're getting correct "thread killed" rather than
  "in shutdown" error now
mysql-test/t/rpl_error_ignored_table.test:
  we're getting correct "thread killed" rather than
  "in shutdown" error now
sql/records.cc:
  make error messages on KILL uniform for rr_*()
  by folding that handling into rr_handle_error()
sql/sql_class.h:
  Only throw "shutdown" when we have one flagged as being in progress;
  otherwise, throw "query interrupted" as it's likely to be "KILL CONNECTION"
  or related.
2009-10-19 21:42:10 -07:00
Georgi Kodinov
88084d6763 merged 5.1-main-> 5.1-bugteam 2009-10-23 15:12:26 +03:00
Tatiana A. Nurnberg
495cde347b auto-merge 2009-10-20 20:37:33 -07:00
Tatiana A. Nurnberg
3f0d0d0633 manual merge of 28141 2009-10-20 11:00:07 -07:00
unknown
52db2f3646 Bug #34777 mysqlbinlog: --help output for --base64-output is hard to understand
There are some problems about help text:
- It is stated that "auto" is the default twice. It need be stated only once.
- It is stated that --base64-output is short for --base64-output=always. But that sounds
like the default is "always", not "auto".

Make the help text clear as following:
Determine when the output statements should be base64-encoded BINLOG 
statements: 'never' disables it and works only for binlogs without 
row-based events; 'auto' prints base64 only when necessary (i.e., 
for row-based events and format description events); 'always' prints 
base64 whenever possible. 'always' is for debugging only and should 
not be used in a production system. If this argument is not given, 
the default is 'auto'; if it is given with no argument, 'always' is used.
2009-10-20 13:16:09 +08:00
Bjorn Munch
72c96cbd0e merge from 5.1 main 2009-10-16 23:25:05 +02:00
Hery Ramilison
7df70d09a9 Added make targets 'test-bt-fast' and 'test-bt-debug-fast'
Put variable declaration at the beginning of a block
2009-10-15 00:40:40 +02:00
Georgi Kodinov
67113c2e29 merge 2009-10-14 17:36:11 +03:00
Kent Boortz
128e676c0d "MySQL Network" => "MySQL Enterprise" 2009-10-08 22:55:28 +02:00
Frazer Clement
c7470df2fe Merge 5.0-bugteam-> 5.1-bugteam 2009-10-08 16:36:36 +01:00
Frazer Clement
fd04391340 Fix compile break from bug#39663 fix 2009-10-08 16:23:15 +01:00
Bjorn Munch
9edd40c87e Bug #47218 mysqltest ignores "error" command inside if inside loop
This was affected by same problem as append_file etc.
Added Q_ERROR to special handling, and added small test
2009-10-08 11:30:03 +02:00
Frazer Clement
de985fc732 Merge 5.0-bugteam->5.1 bugteam 2009-10-05 13:57:59 +01:00
Frazer Clement
379d1f19ce Bug#39663 mysqltest: --enable_info, affected_rows and ps-protocol broken 2009-10-05 13:57:00 +01:00
Georgi Kodinov
370acc8b56 automerge 2009-10-04 12:15:05 +03:00
unknown
508527a94c Bug #46998 mysqlbinlog can't output BEGIN even if the database is included in a transaction
The 'BEGIN/COMMIT/ROLLBACK' log event could be filtered out if the
database is not selected by --database option of mysqlbinlog command.
This can result in problem if there are some statements in the
transaction are not filtered out.

To fix the problem, mysqlbinlog will output 'BEGIN/ROLLBACK/COMMIT' 
in regardless of the database filtering rules.

client/mysqlbinlog.cc:
  Skip the database check for BEGIN/COMMIT/ROLLBACK log events.
mysql-test/r/mysqlbinlog.result:
  Test result for bug#46998
mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_db_filter.test:
  The test case is updated duo to the patch of bug#46998
mysql-test/t/mysqlbinlog.test:
  Added test to verify if the 'BEGIN', 'COMMIT' and 'ROLLBACK' are output
  in regardless of database filtering
2009-09-30 10:31:25 +08:00
unknown
de04eb6c37 Bug #46998 mysqlbinlog can't output BEGIN even if the database is included in a transaction
The 'BEGIN/COMMIT/ROLLBACK' log event could be filtered out if the
database is not selected by --database option of mysqlbinlog command.
This can result in problem if there are some statements in the
transaction are not filtered out.

To fix the problem, mysqlbinlog will output 'BEGIN/ROLLBACK/COMMIT' 
in regardless of the database filtering rules.

client/mysqlbinlog.cc:
  Skip the database check for BEGIN/COMMIT/ROLLBACK log events.
mysql-test/r/mysqlbinlog.result:
  Test result for bug#46998
mysql-test/t/mysqlbinlog.test:
  Added test to verify if the 'BEGIN', 'COMMIT' and 'ROLLBACK' are output
  in regardless of database filtering
2009-09-30 10:01:52 +08:00
Joerg Bruehe
d609fdf98b Upmerge 5.0-build -> 5.1-build. 2009-09-28 11:07:31 +02:00
unknown
96665fd9cc BUG#43579 mysql_upgrade tries to alter log tables on replicated database
All statements executed by mysql_upgrade are binlogged and then are replicated to slave.
This will result in some errors. The report of this bug has demonstrated some examples.

Master and slave should be upgraded separately. All statements executed by
mysql_upgrade will not be binlogged. 
--write-binlog and --skip-write-binlog options are added into mysql_upgrade. 
These options control whether sql statements are binlogged or not.
2009-09-28 14:24:19 +08:00
Staale Smedseng
6a89842e36 Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2

Cleaning up warnings not present in 5.0.
2009-09-23 15:21:29 +02:00
Georgi Kodinov
9910148c72 automerge 2009-09-23 11:31:18 +03:00
Georgi Kodinov
4ac694822b automerge 2009-09-18 16:35:40 +03:00
Magnus Blåudd
58628cbbb4 Merge bug#42850 to 5.0 2009-09-28 14:40:20 +02:00
Joerg Bruehe
db89051656 Fix bug#46980
Option "--without-server" still not working in 5.1

The general approach is to make sure that source files
which require thread support are only compiled if the build
really needs thread support,
which means when the server is built or a thread-safe client
library.

This required several changes:
- Make sure the subdirectories "storage/" and "plugin/" are
  only processed if the server is built, not ifclient-only.
- Make the compilation of some modules which inherently
  require threading depend on thread supportin the build.
- Separate the handling of threading in "configure.in" from
  that of server issues, threading is also needed in a
  non-server build of a thread-safe client library.

Also, "libdbug" must get built even in a client-only build,
so "dbug/" must be in the list of client directories.

In addition, calls to thread functions in source files which
can be built without thread support must use the wrapper
functions which handle the non-threaded build.
So the modules "client/mysqlimport.c" and "client/mysqlslap.c"
must call "my_thread_end()" only via "mysql_thread_end()".


Makefile.am:
  The directories "storage/" and "plugin/" contain files
  which are needed for the server only, so their contents
  is to be built only if a server is built.
  
  They must not be named unconditionally, because building
  their contents will fail unless threads are enabled.
  
  These directories are now listed in the "configure"
  variable "sql_server_dirs" which becomes part of
  "sql_union_dirs" if the server is to be built.
client/mysqlimport.c:
  Use the wrapper function "mysql_thread_end()" which
  correctly handles the case of a non-threaded build.
client/mysqlslap.c:
  Use the wrapper function "mysql_thread_end()" which
  correctly handles the case of a non-threaded build.
configure.in:
  Various changes to support builds "--without-server":
  
  1) For the unit tests, we need "libdbug".
  
  2) Separate the treatment of the server from that of the
     thread-safe client library.
  
  3) Introduce an "automake conditional" "NEED_THREAD"
     which can be checked in some "Makefile.am".
  
  4) Include "storage/" and "plugin/" in the list of
     "sql_server_dirs" so that they are handled in the
     top "Makefile.am" only if the server is to be built
     (see the change in that file).
mysys/Makefile.am:
  The code of "mf_keycache.c" in 5.1 is no longer safe
  to be built without thread support.
  (In 5.0, this was possible.)
  
  Rather than fix these issues, which is tedious and risky,
  avoid the need to ever build it without thread support:
  It is needed in the server only, which needs thread support.
  
  The only case where we build a "libmysys" without thread
  support is for a non-threaded client, where "mf_keycache"
  is not neded.
  So its inclusion in the list of source files can depend
  on the new conditional "NEED_THREAD".
unittest/mysys/Makefile.am:
  Test program "my_atomic-t" is to verify the correct handling
  of threads only, it cannot be built without thread support
  and is not needed in such cases either.
  
  Let its build depend on the new conditional "NEED_THREAD".
2009-09-17 18:34:24 +02:00