Commit graph

63006 commits

Author SHA1 Message Date
Bjorn Munch
0455ff8faf Follow-up to Bug #55582 which allows chaecking strings in if
Simplified cases where a select was used to compare variable against ''
2010-10-20 16:15:32 +02:00
Bjorn Munch
05062d579a Bug #56654 pb2 log is very hard to read
Added some more info in a number of fail cases
(re-commit for administrative reasons)
2010-10-19 14:01:14 +02:00
Bjorn Munch
84c57a5e27 Bug #52828 Tests that use perl fail when perl is not in path
main.mysqltest skipped on Windows because a perl intentionally does exit(1)
Use exit(2), as exit(1) on Windows is indistinguishable from failing to
execute perl.
2010-10-19 13:56:30 +02:00
Bjorn Munch
8a67fc8c82 Test wait_timeout: do not fail by SQL syntax error, use die 2010-10-19 13:54:28 +02:00
Bjorn Munch
abaa5c91b4 Bug #20304 mysqltest: reap with no preceding statement hangs forever
Added sanity check, similar to the one preventing send without reap
2010-10-01 11:00:18 +02:00
Bjorn Munch
be7b3c0040 Bug #52828 Tests that use perl fail when perl is not in path
Trying to run perl fails, just like it does when perl is started but fails
Trap the case that perl was not found/could not be started, and skip test
Also force a restart of servers since test may already have done something
mtr now also appends path of current perl to PATH to aid mysqltest
2010-09-30 12:42:37 +02:00
Bjorn Munch
9ec4724866 Small test fix after 56753 2010-09-30 10:28:22 +02:00
Bjorn Munch
dae793978a merge from 5.1 2010-09-29 12:56:10 +02:00
Bjorn Munch
9605bc63fc Bug #56125 MTR2 start-and-exit removes server tmpdir, server becomes not operational
This happens when creating new tmpdir due to too long socket path
Don't delete it if --start-and-exit, but warn user to do it.
2010-09-28 15:58:01 +02:00
Bjorn Munch
7b216d7625 Bug #56921 It should be possible to log connection statements in mysqltest
Added --enable-connect-log, somewhet similar to --enable-query-log
If query log is disabled, disable connect log too
Also some related cleanup in mysqltest.test: removing duplicate test loop
2010-09-22 10:57:10 +02:00
Bjorn Munch
ee6f8ae1bd test fixes after 56753 2010-09-21 11:16:20 +02:00
Bjorn Munch
c18a34bda6 Bug #55426 mysqltest crashes when trying to unlock not acquired mutex
Follow-up: don't call pthread_join() on Windows
This change only valid for 5.1
2010-09-20 11:21:27 +02:00
Bjorn Munch
6ff48a61f2 Bug #56753 mtr silently ignores junk after backticks
When stepping backward to end of `` expression, check for illegal chars
2010-09-15 14:56:22 +02:00
Bjorn Munch
64ae6d4a7e Bug #55426 mysqltest crashes when trying to unlock not acquired mutex
Bug #55546 mysqltest fails to create a new thread on HPUX
Missing call to pthread_join(), in embedded mode
This independently solves both problems, see 55426 for details.
Addendum: cannot test against a pthread_t, adds boolean flag instead
2010-09-14 14:04:37 +02:00
Bjorn Munch
4937eec1a2 Bug #56647 Valgrind warnings for memory leak in mysqltest.cc
Moved an init_dynamic_string() from before to after potential die()
2010-09-10 13:08:06 +02:00
Bjorn Munch
7749cd8fd8 Bug #56383 provide option to restart mysqld after each mtr test
Added --force-restart
2010-08-31 11:27:57 +02:00
Bjorn Munch
6d2ff118bc merge 55413 2010-08-30 11:26:40 +02:00
Bjorn Munch
93b8156365 Bug #55178 Set timeout on test-to-test-basis
Allow --testcase-timeout=<mins> to be set in .opt file for test
2010-08-30 11:25:10 +02:00
Bjorn Munch
09c62e4ff8 Cherry pick 55501 2010-08-25 16:34:31 +02:00
Bjorn Munch
76907f8591 Bug #52301 Add --protocol to mysqltest
Added code resulted in strange linking problem for embedded on Windows
Avoided by not doing this for embedded mode
It's irrelevant for embedded server anyway, --protocol will be ignored
2010-08-25 10:23:19 +02:00
unknown
69c2805068 Merge from mysql-5.1.50-release 2010-08-19 17:18:58 +02:00
MySQL Build Team
3ac03a0b1b Raise the version number, 5.1.50 is (was) being built in a parellel tree. 2010-08-19 17:03:29 +02:00
Bjorn Munch
788b4e404b Bug #55413 mysqltest gives parse error for lines matching "^let.*\\.*;$"
Allow escaped quotes also in statements not starting with --
But will not support single unescaped ' or `
2010-08-10 12:13:58 +02:00
Bjorn Munch
f3f5e04a36 merge from 5.1 2010-08-04 12:19:51 +02:00
Bjorn Munch
2d2da6e793 Bug #55582 mtr root detection (and if-expression execution) broken
Follow-up patch: added test cases for -0 and while
2010-08-04 10:52:45 +02:00
Bjorn Munch
5e92df6e0e Bug #55582 mtr root detection (and if-expression execution) broken
if() treated any non-numeric string as false
Fixed to treat those as true instead
Added some test cases
Fixed missing $ in variable name in include/mix2.inc
2010-08-03 16:11:23 +02:00
Alfranio Correia
7909541953 auto-merge mysql-5.1-security (local) --> mysql-5.1-security 2010-08-03 12:52:02 +01:00
Alfranio Correia
f62e89fade BUG#55625 RBR breaks on failing 'CREATE TABLE'
A CREATE...SELECT that fails is written to the binary log if a non-transactional
statement is updated. If the logging format is ROW, the CREATE statement and the
changes are written to the binary log as distinct events and by consequence the
created table is not rolled back in the slave.

In this patch, we opted to let the slave goes out of sync by not writting to the
binary log the CREATE statement. We do this by simply reseting the binary log's
cache.

mysql-test/suite/rpl/r/rpl_drop.result:
  Added a test case.
mysql-test/suite/rpl/t/rpl_drop.test:
  Added a test case.
sql/log.cc:
  Introduced a function to clean up the cache.
sql/log.h:
  Introduced a function to clean up the cache.
sql/sql_insert.cc:
  Cleaned up the binary log cache if a CREATE...SELECT fails.
2010-08-02 20:48:56 +01:00
Bjorn Munch
f3d4e72cf1 Bug #55597 MTR: Restart the server, from within the test case, with new CLI options.
The expect file can now include "restart:<server options>"
Also drop check-testcase if this has been done
Added comment explaining the restart: syntax
2010-08-02 12:43:28 +02:00
Georgi Kodinov
c65e99e00c merge 2010-08-02 11:03:41 +03:00
Georgi Kodinov
4f738e9b7c merge mysql-5.1-bugteam into mysql-5.1-security 2010-08-02 10:50:15 +03:00
Georgi Kodinov
e1feae1db9 merge 2010-08-02 10:45:43 +03:00
Gleb Shchepa
80aa882497 Bug #54461: crash with longblob and union or update with subquery
Queries may crash, if
  1) the GREATEST or the LEAST function has a mixed list of
     numeric and LONGBLOB arguments and
  2) the result of such a function goes through an intermediate
     temporary table.

An Item that references a LONGBLOB field has max_length of
UINT_MAX32 == (2^32 - 1).

The current implementation of GREATEST/LEAST returns REAL
result for a mixed list of numeric and string arguments (that
contradicts with the current documentation, this contradiction
was discussed and it was decided to update the documentation).

The max_length of such a function call was calculated as a
maximum of argument max_length values (i.e. UINT_MAX32).

That max_length value of UINT_MAX32 was used as a length for
the intermediate temporary table Field_double to hold
GREATEST/LEAST function result.

The Field_double::val_str() method call on that field
allocates a String value.

Since an allocation of String reserves an additional byte
for a zero-termination, the size of String buffer was
set to (UINT_MAX32 + 1), that caused an integer overflow:
actually, an empty buffer of size 0 was allocated.

An initialization of the "first" byte of that zero-size
buffer with '\0' caused a crash.

The Item_func_min_max::fix_length_and_dec() has been
modified to calculate max_length for the REAL result like
we do it for arithmetical operators.


******
Bug #54461: crash with longblob and union or update with subquery

Queries may crash, if
  1) the GREATEST or the LEAST function has a mixed list of
     numeric and LONGBLOB arguments and
  2) the result of such a function goes through an intermediate
     temporary table.

An Item that references a LONGBLOB field has max_length of
UINT_MAX32 == (2^32 - 1).

The current implementation of GREATEST/LEAST returns REAL
result for a mixed list of numeric and string arguments (that
contradicts with the current documentation, this contradiction
was discussed and it was decided to update the documentation).

The max_length of such a function call was calculated as a
maximum of argument max_length values (i.e. UINT_MAX32).

That max_length value of UINT_MAX32 was used as a length for
the intermediate temporary table Field_double to hold
GREATEST/LEAST function result.

The Field_double::val_str() method call on that field
allocates a String value.

Since an allocation of String reserves an additional byte
for a zero-termination, the size of String buffer was
set to (UINT_MAX32 + 1), that caused an integer overflow:
actually, an empty buffer of size 0 was allocated.

An initialization of the "first" byte of that zero-size
buffer with '\0' caused a crash.

The Item_func_min_max::fix_length_and_dec() has been
modified to calculate max_length for the REAL result like
we do it for arithmetical operators.



mysql-test/r/func_misc.result:
  Test case for bug #54461.
  
  ******
  Test case for bug #54461.
mysql-test/t/func_misc.test:
  Test case for bug #54461.
  
  ******
  Test case for bug #54461.
sql/item_func.cc:
  Bug #54461: crash with longblob and union or update with subquery
  
  The Item_func_min_max::fix_length_and_dec() has been
  modified to calculate max_length for the REAL result like
  we do it for arithmetical operators.
  
  ******
  Bug #54461: crash with longblob and union or update with subquery
  
  The Item_func_min_max::fix_length_and_dec() has been
  modified to calculate max_length for the REAL result like
  we do it for arithmetical operators.
2010-08-01 22:12:36 +04:00
Davi Arnaut
9899e690f0 Bug#45288: pb2 returns a lot of compilation warnings on linux
Fix compiler warnings.

mysys/stacktrace.c:
  Tag unused parameters.
sql/sql_lex.cc:
  Variable becomes unused in non-debug builds. Also, no need to
  assert the obvious.
2010-07-30 17:33:10 -03:00
Luis Soares
655d913bfc Automerge mysql-5.1-bugteam into mysql-5.1-bugteam latest. 2010-07-30 15:32:28 +01:00
Georgi Kodinov
ae02cad707 Disable the tests failing under valgrind because of bug #55503 2010-07-30 17:09:24 +03:00
Luis Soares
55e60e14fa Revert patch for BUG#34283. Causing lots of test failures in PB2,
mostly because existing test result files were not updated.
2010-07-30 14:44:39 +01:00
Georgi Kodinov
de5029a458 Bug #55188: GROUP BY, GROUP_CONCAT and TEXT - inconsistent results
In order to be able to check if the set of the grouping fields in a 
GROUP BY has changed (and thus to start a new group) the optimizer
caches the current values of these fields in a set of Cached_item 
derived objects.
The Cached_item_str, used for caching varchar and TEXT columns,
is limited in length by the max_sort_length variable.
A String buffer to store the value with an alloced length of either
the max length of the string or the value of max_sort_length 
(whichever is smaller) in Cached_item_str's constructor.
Then, at compare time the value of the string to compare to was 
truncated to the alloced length of the string buffer inside 
Cached_item_str.
This is all fine and valid, but only if you're not assigning 
values near or equal to the alloced length of this buffer.
Because when assigning values like this the alloced length is 
rounded up and as a result the next set of data will not match the
group buffer, thus leading to wrong results because of the changed
alloced_length.
Fixed by preserving the original maximum length in the 
Cached_item_str's constructor and using this instead of the 
alloced_length to limit the string to compare to.
Test case added.
2010-07-30 16:35:06 +03:00
Davi Arnaut
415fea54c5 Merge of mysql-5.0-bugteam into mysql-5.1-bugteam. 2010-07-30 09:38:18 -03:00
Davi Arnaut
a6f726c585 Bug#54041: MySQL 5.0.92 fails when tests from Connector/C suite run
Fix a regression (due to a typo) which caused spurious incorrect
argument errors for long data stream parameters if all forms of
logging were disabled (binary, general and slow logs).

sql/sql_prepare.cc:
  Add a missing logical NOT operator.
2010-07-30 09:34:40 -03:00
Davi Arnaut
a9538cacda Bug#54041: MySQL 5.0.92 fails when tests from Connector/C suite run
Fix a regression (due to a typo) which caused spurious incorrect
argument errors for long data stream parameters if all forms of
logging were disabled (binary, general and slow logs).

mysql-test/t/mysql_client_test.test:
  Save the status of the slow_log.
sql/sql_prepare.cc:
  Add a missing logical NOT operator.
tests/mysql_client_test.c:
  Disable all query logs when running C tests. Fixes a omission
  when, slow log should have been disabled too.
  
  Run test case for Bug#54041 with query logs enabled and disabled.
2010-07-30 09:17:10 -03:00
unknown
5e13086bf8 Bug #34283 mysqlbinlog leaves tmpfile after termination if binlog contains load data infile
With statement- or mixed-mode logging, "LOAD DATA INFILE" queries
are written to the binlog using special types of log events.
When mysqlbinlog reads such events, it re-creates the file in a
temporary directory with a generated filename and outputs a
"LOAD DATA INFILE" query where the filename is replaced by the
generated file. The temporary file is not deleted by mysqlbinlog
after termination.

To fix the problem, in mixed mode we go to row-based. In SBR, we
document it to remind user the tmpfile is left in a temporary
directory.


mysql-test/suite/binlog/r/binlog_mixed_load_data.result:
  Test result for BUG#34283.
mysql-test/suite/binlog/t/binlog_mixed_load_data.test:
  Added the test file to verify that 'load data infile...' statement
  will go to row-based in mixed mode.
sql/sql_load.cc:
  Added code to go to row-based in mixed mode for
  'load data infile ...' statement
2010-07-30 11:59:34 +08:00
Vasil Dimov
060db3d325 Merge mysql-5.1-innodb -> mysql-5.1-bugteam 2010-07-29 11:57:33 +03:00
Vasil Dimov
c110066bda Merge mysql-5.1-bugteam -> mysql-5.1-innodb 2010-07-29 11:51:00 +03:00
Alexander Barkov
6f6a3e5293 Postfix for BUG#45012.
Problem: The original patch didn't compile on debug_werror
due to wrong format in printf("%d") for size_t variables.

Fix: Adding cast to (int).
2010-07-29 10:12:44 +04:00
unknown
2124538d9c BUG#49124 Security issue with /*!-versioned */ SQL statements on Slave
/*![:version:] Query Code */, where [:version:] is a sequence of 5 
digits representing the mysql server version(e.g /*!50200 ... */),
is a special comment that the query in it can be executed on those 
servers whose versions are larger than the version appearing in the 
comment. It leads to a security issue when slave's version is larger 
than master's. A malicious user can improve his privileges on slaves. 
Because slave SQL thread is running with SUPER privileges, so it can
execute queries that he/she does not have privileges on master.

This bug is fixed with the logic below: 
- To replace '!' with ' ' in the magic comments which are not applied on
  master. So they become common comments and will not be applied on slave.

- Example:
  'INSERT INTO t1 VALUES (1) /*!10000, (2)*/ /*!99999 ,(3)*/
  will be binlogged as
  'INSERT INTO t1 VALUES (1) /*!10000, (2)*/ /* 99999 ,(3)*/

mysql-test/suite/rpl/t/rpl_conditional_comments.test:
  Test the patch for this bug.
sql/mysql_priv.h:
  Rename inBuf as rawBuf and remove the const limitation.
sql/sql_lex.cc:
  To replace '!' with ' ' in the magic comments which are not applied on
  master.
sql/sql_lex.h:
  Remove the const limitation on parameter buff, as it can be modified in the function since
  this patch.
  Add member function yyUnput for Lex_input_stream. It set a character back the query buff.
sql/sql_parse.cc:
  Rename inBuf as rawBuf and remove the const limitation.
sql/sql_partition.cc:
  Remove the const limitation on parameter part_buff, as it can be modified in the function since
  this patch.
sql/sql_partition.h:
  Remove the const limitation on parameter part_buff, as it can be modified in the function since
  this patch.
sql/table.h:
  Remove the const limitation on variable partition_info, as it can be modified since
  this patch.
2010-07-29 11:00:57 +08:00
Davi Arnaut
f67481558d Bug#53463: YaSSL patch appears to be reverted
The problem is that the fix Bug#29784 was mistakenly
reverted when updating YaSSL to a newer version.

The solution is to re-apply the fix and this time
actually add a meaningful test case so that possible
regressions are caught.

extra/yassl/taocrypt/src/coding.cpp:
  Fixed buffer allocation to compute the proper maximum
  decoded size: (EncodedLength * 3/4) + 3
mysql-test/std_data/server8k-cert.pem:
  Update certificate.
mysql-test/std_data/server8k-key.pem:
  Update key.
mysql-test/t/ssl_8k_key-master.opt:
  Start the server using the certificate and key that
  triggers the problem.
2010-07-28 12:59:19 -03:00
Bjorn Munch
cf5b700bac Bug #55597 MTR: Restart the server, from within the test case, with new CLI options.
The expect file can now include "restart:<server options>"
Also drop check-testcase if this has been done
2010-07-28 12:24:38 +02:00
Jimmy Yang
277b055f14 Fix bug #55581 by backporting fix of #52546 from mysql-trunk-innodb
to mysql-5.1-innodb plugin.
2010-07-28 03:20:44 -07:00
Davi Arnaut
2529ee72ec Bug#55501: Disable innodb plugin usage in the embedded server on certain OSes
Do not attempt to test the innodb plugin with the embedded server,
it's not supported for now.
2010-07-23 21:55:03 -03:00