Commit graph

204 commits

Author SHA1 Message Date
Bjorn Munch
32da790381 upmerge 52828 2010-09-30 12:53:36 +02:00
Bjorn Munch
87234b74ca 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
1a75a23ce1 merge from 5.1 2010-09-29 12:56:10 +02:00
Bjorn Munch
cf362a41b9 upmerge 56125,56921 2010-09-28 16:00:11 +02:00
Bjorn Munch
3a404d4966 Bug #57036 Add checks in mysqltest that variables treated as ints are in fact ints
Adds boolean flag is_int and a separete function to check for int value
Added tests to mysqltest.test
2010-09-27 14:36:16 +02:00
Bjorn Munch
80d666bc21 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
c679e8dc80 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
0eaa320c2c upmerge 56753 2010-09-20 10:08:32 +02:00
Bjorn Munch
38604de3a0 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
45ec20594f upmerge 55426(55546), 56647 2010-09-14 14:19:51 +02:00
Bjorn Munch
4e23534bf7 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
c824cbbaff 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
2154211192 merge from 5.5 2010-09-01 15:49:43 +02:00
Bjorn Munch
8ee29b7e6a upmerge 55178,55413 2010-08-30 15:19:46 +02:00
Bjorn Munch
c3f69b4191 merge 55413 2010-08-30 11:26:40 +02:00
Sergey Vojtovich
ab2414577a Merge 5.1-bugteam to 5.5-merge. 2010-08-27 15:33:32 +04:00
Bjorn Munch
fba50f8401 Reduced #ifndef for 52301, caused compile warning 2010-08-26 15:14:50 +02:00
Bjorn Munch
79aefacb04 merge followup fix for 52301 2010-08-25 22:49:52 +02:00
Bjorn Munch
a22b5651fd 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
Bjorn Munch
3ca814b760 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
6777cc0db6 merge from 5.1-bugteam of merge from 5.1-mtr 2010-08-06 13:37:05 +02:00
Bjorn Munch
8e242e8140 merge from 5.1-mtr 2010-08-06 11:13:52 +02:00
Bjorn Munch
f886745dfa merge from trunk-mtr 2010-08-05 14:53:09 +02:00
Bjorn Munch
489e6c136b upmerge 55582 2010-08-05 14:41:07 +02:00
Bjorn Munch
992f49c0c4 merge from 5.1 2010-08-04 12:19:51 +02:00
Bjorn Munch
1ba9d79b7b 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
Davi Arnaut
c1545bec1e Bug#42733: Type-punning warnings when compiling MySQL
Post-merge fix: remove remaining casts which are now
unnecessary and are actually causing warnings.
2010-07-24 09:24:44 -03:00
Davi Arnaut
60ab2b9283 WL#5498: Remove dead and unused source code
Remove unused macros or macro which are always defined.
2010-07-23 17:16:29 -03:00
Bjorn Munch
be55e8d59d merge from trunk 2010-07-23 15:12:58 +02:00
Davi Arnaut
649390ac81 Merge of mysql-trunk-bugfixing into mysql-trunk-merge. 2010-07-15 10:47:50 -03:00
Davi Arnaut
f54a118249 WL#5486: Remove code for unsupported platforms
Remove Netware specific code.
2010-07-15 08:13:30 -03:00
Davi Arnaut
dbf76b0deb Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled
Post-merge fix: cast argument and correct type in assignment.
2010-07-08 22:19:57 -03:00
Davi Arnaut
a10ae35328 Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled
Essentially, the problem is that safemalloc is excruciatingly
slow as it checks all allocated blocks for overrun at each
memory management primitive, yielding a almost exponential
slowdown for the memory management functions (malloc, realloc,
free). The overrun check basically consists of verifying some
bytes of a block for certain magic keys, which catches some
simple forms of overrun. Another minor problem is violation
of aliasing rules and that its own internal list of blocks
is prone to corruption.

Another issue with safemalloc is rather the maintenance cost
as the tool has a significant impact on the server code.
Given the magnitude of memory debuggers available nowadays,
especially those that are provided with the platform malloc
implementation, maintenance of a in-house and largely obsolete
memory debugger becomes a burden that is not worth the effort
due to its slowness and lack of support for detecting more
common forms of heap corruption.

Since there are third-party tools that can provide the same
functionality at a lower or comparable performance cost, the
solution is to simply remove safemalloc. Third-party tools
can provide the same functionality at a lower or comparable
performance cost. 

The removal of safemalloc also allows a simplification of the
malloc wrappers, removing quite a bit of kludge: redefinition
of my_malloc, my_free and the removal of the unused second
argument of my_free. Since free() always check whether the
supplied pointer is null, redudant checks are also removed.

Also, this patch adds unit testing for my_malloc and moves
my_realloc implementation into the same file as the other
memory allocation primitives.
2010-07-08 18:20:08 -03:00
Davi Arnaut
74283a052e Merge of mysql-5.1-bugteam into mysql-trunk-merge. 2010-07-02 16:38:04 -03:00
Davi Arnaut
93fb8bb235 Bug#53445: Build with -Wall and fix warnings that it generates
Apart strict-aliasing warnings, fix the remaining warnings
generated by GCC 4.4.4 -Wall and -Wextra flags.

One major source of warnings was the in-house function my_bcmp
which (unconventionally) took pointers to unsigned characters
as the byte sequences to be compared. Since my_bcmp and bcmp
are deprecated functions whose only difference with memcmp is
the return value, every use of the function is replaced with
memcmp as the special return value wasn't actually being used
by any caller.

There were also various other warnings, mostly due to type
mismatches, missing return values, missing prototypes, dead
code (unreachable) and ignored return values.
2010-07-02 15:30:47 -03:00
Bjorn Munch
7c181c5974 merge from trunk 2010-06-17 12:27:50 +02:00
Bjorn Munch
e21e5e82d5 upmerge 52321,53374,53949,54111,54364,54368 2010-06-15 12:37:13 +02:00
Bjorn Munch
711ce77612 Bug #54111 mysqltest command remove_files_wildcard does not work in embedded server
Wildcard chars are changed in embedded mode
Temporarily reset the wild_* variables before wild_compare, also for list_files
2010-06-15 11:29:24 +02:00
Davi Arnaut
d6e003545a Merge of mysql-5.1-bugteam into mysql-trunk-merge. 2010-06-10 22:30:49 -03:00
Davi Arnaut
bb036c93b4 Bug#42733: Type-punning warnings when compiling MySQL --
strict aliasing violations.

Essentially, the problem is that large parts of the server were
developed in simpler times (last decades, pre C99 standard) when
strict aliasing and compilers supporting such optimizations were
rare to non-existent. Thus, when compiling the server with a modern
compiler that uses strict aliasing rules to perform optimizations,
there are several places in the code that might trigger undefined
behavior.

As evinced by some recent bugs, GCC does a somewhat good of job
misoptimizing such code, but on the other hand also gives warnings
about suspicious code. One problem is that the warnings aren't
always accurate, yet we can't afford to just shut them off as we
might miss real cases. False-positive cases are aggravated mostly
by casts that are likely to trigger undefined behavior.

The solution is to start a cleanup process focused on fixing and
reducing the amount of strict-aliasing related warnings produced
by GCC and others compilers. A good deal of noise reduction can
be achieved by just removing useless casts that are product of
historical cruft and are likely to trigger undefined behavior if
dereferenced.
2010-06-10 17:16:43 -03:00
Bjorn Munch
f9fa3b7a3f Bug #53374 Don't delete temporary perl file if perl fails
Simple condition on the delete stmt
But NB: next mtr run will clean up and remove the temp file
2010-06-07 13:30:23 +02:00
Davi Arnaut
75dce25ca8 Post-merge fix: header is used by the client API. Obvious in retrospect.
Also, update a few cases missed by the initial patch.
2010-06-05 16:39:03 -03:00
Bjorn Munch
9a3a7297bb Merge from mysql-trunk 2010-06-02 18:08:06 +02:00
Bjorn Munch
b7c8385e05 Merge from 5.1 up to rev 3392 2010-06-02 16:23:29 +02:00
Davi Arnaut
5dec0c9637 Bug#53445: Build with -Wall and fix warnings that it generates
Fix various mismatches between function's language linkage. Any
particular function that is declared in C++ but should be callable
from C must have C linkage. Note that function types with different
linkages are also distinct. Thus, if a function type is declared in
C code, it will have C linkage (same if declared in a extern "C"
block).
2010-05-31 12:29:54 -03:00
Konstantin Osipov
53fecff1ef Backport of:
ChangeSet@1.2703, 2007-12-07 09:35:28-05:00, cmiller@zippy.cornsilk.net +40 -0
Bug#13174: SHA2 function
Patch contributed from Bill Karwin, paper unnumbered CLA in Seattle

Implement SHA2 functions.

Chad added code to make it work with YaSSL.  Also, he removed the 
(probable) bug of embedded server never using SSL-dependent 
functions.  (libmysqld/Makefile.am didn't read ANY autoconf defs.)

Function specification:
  SHA2( string cleartext, integer hash_length ) 
    -> string hash, or NULL
where hash_length is one of 224, 256, 384, or 512.  If either is 
NULL or a length is unsupported, then the result is NULL.  The 
resulting string is always the length of the hash_length parameter
or is NULL.

Include the canonical hash examples from the NIST in the test
results.
---
Polish and address concerns of reviewers.
2010-04-13 19:04:45 +04:00
Bjorn Munch
83e673474b upmerge 42513,52214 2010-04-13 13:55:11 +02:00
Bjorn Munch
2682fb67c3 Bug #52214 Misleading error msg when test fails before having produced any query
output
Print error message only if real error
2010-04-13 12:41:42 +02:00
Bjorn Munch
723293de3e Bug #42513 mtr2: mysqltest doesn't count internal commands output as real output
MTR insited in exit; if run without result file
Simply remove the else part producing the error and let test finish
2010-04-13 10:01:04 +02:00
Bjorn Munch
b9a3e71171 upmerge 52301 2010-03-31 12:53:56 +02:00