Commit graph

188 commits

Author SHA1 Message Date
Sergei Golubchik
2853f6bfbb unit test fixes for ctest 2011-07-16 09:09:01 +02:00
Sergei Golubchik
55d13e8dc7 * build dbug manual and unit tests
* document safemalloc
2011-07-12 13:12:07 +02:00
Sergei Golubchik
172f5e28ba add safemalloc back
... but differently

client/mysqltest.cc:
  my_safe_print_str() don't append \n anymore
dbug/dbug.c:
  restore safemalloc as a part of dbug suite
dbug/user.r:
  restore 'S' flag documentation
include/my_dbug.h:
  restore safemalloc as a part of dbug suite
include/my_sys.h:
  move valgrind defines to a dedicated header
mysys/my_malloc.c:
  use new safemalloc
mysys/stacktrace.c:
  don't append \n. let the calller do it, if needed
sql/mysqld.cc:
  my_safe_print_str() don't append \n anymore
2011-07-10 19:55:54 +02:00
Sergei Golubchik
02b8232629 small dbug cleanup 2011-07-10 19:50:29 +02:00
Sergei Golubchik
b4a0b2c2f8 post-merge fixes.
most tests pass.
5.3 merge is next
2011-07-02 22:12:12 +02:00
Sergei Golubchik
9809f05199 5.5-merge 2011-07-02 22:08:51 +02:00
Sergei Golubchik
0accbd0364 lots of post-merge changes 2011-04-25 17:22:25 +02:00
Magne Mahre
8ede0759c3 Remove configuration preprocessor symbols 'THREAD'
and 'THREAD_SAFE_CLIENT'.
  
As of MySQL 5.5, we no longer support non-threaded
builds.   This patch removes all references to the
obsolete THREAD and THREAD_SAFE_CLIENT preprocessor
symbols.  These were used to distinguish between
threaded and non-threaded builds.
2011-01-11 10:07:37 +01:00
Kent Boortz
be6c3fd8aa Merge 2010-12-29 01:26:31 +01:00
Kent Boortz
4acfdb9df1 Merge 2010-12-29 00:47:05 +01:00
Kent Boortz
85323eda8a - Added/updated copyright headers
- Removed files specific to compiling on OS/2
- Removed files specific to SCO Unix packaging
- Removed "libmysqld/copyright", text is included in documentation
- Removed LaTeX headers for NDB Doxygen documentation
- Removed obsolete NDB files
- Removed "mkisofs" binaries
- Removed the "cvs2cl.pl" script
- Changed a few GPL texts to use "program" instead of "library"
2010-12-28 19:57:23 +01:00
Tor Didriksen
fda6290041 Bug #58426 Crashing tests not failing as they are supposed to on Solaris 10 debug
On this platform we seem to get lots of other signals
while waiting for SIGKILL to be delivered.

Solution: use sigsuspend(<all signals blocked>)



dbug/dbug.c:
  New function _db_suicide_() which does kill(myself, -9) and then waits forever.
include/my_dbug.h:
  Let DBUG_SUICE wait forever until the KILL signal is delivered, and process dies.
2010-12-13 17:13:01 +01:00
Tor Didriksen
8d311a8551 Automerge 5.1-bugteam => 5.5-bugteam 2010-12-13 17:13:31 +01:00
Tor Didriksen
0611bf2203 Bug #58426 Crashing tests not failing as they are supposed to on Solaris 10 debug
On this platform we seem to get lots of other signals
while waiting for SIGKILL to be delivered.

Solution: use sigsuspend(<all signals blocked>)



dbug/dbug.c:
  New function _db_suicide_() which does kill(myself, -9) and then waits forever.
include/my_dbug.h:
  Let DBUG_SUICE wait forever until the KILL signal is delivered, and process dies.
2010-12-13 12:19:30 +01:00
Sergei Golubchik
65ca700def merge.
checkpoint.
does not compile.
2010-11-25 18:17:28 +01:00
Davi Arnaut
8664de2230 WL#5665: Removal of the autotools-based build system
The autotools-based build system has been superseded and
is being removed in order to ease the maintenance burden on
developers tweaking and maintaining the build system.

In order to support tools that need to extract the server
version, a new file that (only) contains the server version,
called VERSION, is introduced. The file contents are human
and machine-readable. The format is:

MYSQL_VERSION_MAJOR=5
MYSQL_VERSION_MINOR=5
MYSQL_VERSION_PATCH=8
MYSQL_VERSION_EXTRA=-rc

The CMake based version extraction in cmake/mysql_version.cmake
is changed to extract the version from this file. The configure
to CMake wrapper is retained for backwards compatibility and to
support the BUILD/ scripts. Also, a new a makefile target
show-dist-name that prints the server version is introduced.

VERSION:
  Add top-level version file.
cmake/mysql_version.cmake:
  Get version information from the top-level VERSION file.
  Do not cache the version components (MAJOR_VERSION, etc).
  Add MYSQL_RPM_VERSION as a replacement for MYSQL_U_SCORE_VERSION.
2010-11-20 12:47:50 -02:00
Michael Widenius
3bac9cf7fe Fixed compile error when not using gcc (crashes at least on windows) 2010-11-03 21:02:23 +02:00
Michael Widenius
20acfbf30d Fix for: LP #634955: Assert in _ma_update_at_original_place()
Added locking of lock mutex when updating status in external_unlock() for Aria and MyISAM tables.
Fixed that 'source' command doesn't cause mysql command line tool to exit on error.
DEBUG_EXECUTE() and DEBUG_EVALUATE_IF() should not execute things based on wildcards. (Allows one to run --debug with mysql-test-run scripts that uses @debug)
Fixed several core dump, deadlock and crashed table bugs in handling of LOCK TABLE with MERGE tables:
- Added priority of locks to avoid crashes with MERGE tables.
- Added thr_lock_merge() to allow one to merge two results of thr_lock().
Fixed 'not found row' bug in REPLACE with Aria tables.
Mark MyISAM tables that are part of MERGE with HA_OPEN_MERGE_TABLE and set the locks to have priority THR_LOCK_MERGE_PRIV.
- By sorting MERGE tables last in thr_multi_unlock() it's safer to release and relock them many times (can happen when TRIGGERS are created)
Avoid printing (null) in debug file (to easier find out wrong NULL pointer usage with %s).



client/mysql.cc:
  Fixed that 'source' command doesn't cause mysql command line tool to exit on error.
client/mysqltest.cc:
  Don't send NULL to fn_format(). (Can cause crash on Solaris when using --debug)
dbug/dbug.c:
  DEBUG_EXECUTE() and DEBUG_EVALUATE_IF() should not execute things based on wildcards.
include/my_base.h:
  Added flag to signal if one opens a MERGE table.
  Added extra() command to signal that one is not part of a MERGE table anymore.
include/thr_lock.h:
  Added priority for locks (needed to fix bug in thr_lock when using MERGE tables)
  Added option to thr_unlock() if get_status() should be called.
  Added prototype for thr_merge_locks().
mysql-test/mysql-test-run.pl:
  Ignore crashed table warnings for tables named 'crashed'.
mysql-test/r/merge.result:
  Renamed triggers to make debugging easier.
  Added some CHECK TABLES to catch errors earlier.
  Additional tests.
mysql-test/r/merge_debug.result:
  Test of error handling when reopening MERGE tables.
mysql-test/r/udf_query_cache.result:
  Added missing flush status
mysql-test/suite/parts/r/partition_repair_myisam.result:
  Update results
mysql-test/t/merge.test:
  Renamed triggers to make debugging easier.
  Added some CHECK TABLES to catch errors earlier.
  Additional tests.
mysql-test/t/merge_debug.test:
  Test of error handling when reopening MERGE tables.
mysql-test/t/udf_query_cache.test:
  Added missing flush status
mysys/my_getopt.c:
  Removed not used variable
mysys/my_symlink2.c:
  Changed (null) to (NULL) to make it easier to find NULL arguments to DBUG_PRINT() functions.
  (On linux, NULL to sprintf is printed 'null')
mysys/thr_lock.c:
  Added priority of locks to avoid crashes with MERGE tables.
  Added thr_lock_merge() to allow one to merge two results of thr_lock().
  - This is needed for MyISAM as all locked table must share the same status. If not, you will not see newly inserted rows in other instances of the table.
  If calling thr_unlock() with THR_UNLOCK_UPDATE_STATUS, call update_status() and restore_status() for the locks. This is needed in some rare cases where we call thr_unlock() followed by thr_lock() without calling external_unlock/external_lock in between.
  Simplify loop in thr_multi_lock().
  Added 'start_trans', which is called at end of thr_multi_lock() when all locks are taken.
  - This was needed by Aria to ensure that transaction is started when we got all locks, not at get_status(). Without this, some rows could not be visible when we lock two tables at the same time, causing REPLACE using two tables to fail unexpectedly.
sql/handler.cc:
  Add an assert() in handler::print_error() for "impossible errors" (like table is crashed) when --debug-assert-if-crashed-table is used.
sql/lock.cc:
  Simplify mysql_lock_tables() code if get_lock_data() returns 0 locks.
  Added new parameter to thr_multi_unlock()
  In mysql_unlock_read_tables(), call first externa_unlock(), then thr_multi_unlock();  This is same order as we do in mysql_unlock_tables().
  Don't abort locks in mysql_lock_abort() for merged tables when a MERGE table is deleted; Would cause a spin lock.
  Added call to thr_merge_locks() in mysql_lock_merge() to ensure consistency in thr_locks().
  - New locks of same type and table is stored after the old lock to ensure that we get the status from the original lock.
sql/mysql_priv.h:
  Added debug_assert_if_crashed_table
sql/mysqld.cc:
  Added --debug-assert-if-crashed-table
sql/parse_file.cc:
  Don't print '(null)' in DBUG_PRINT of no dir given
sql/set_var.cc:
  Increase default size of buffer for @debug variable.
sql/sql_base.cc:
  In case of error from reopen_table() in reopen_tables(), call unlock_open_table() and restart loop.
  - This fixed bug when we twice deleted same table from open_cache.
  Don't take name lock for already name locked table in open_unireg_entry().
  - Fixed bug when doing repair in reopen_table().
  - In detach_merge_children(), always detach if 'clear_refs' is given. We can't trust parent->children_attached as this function can be called twice, first time with clear_refs set to 0.
sql/sql_class.cc:
  Changed printing of (null) to "" in set_thd_proc_info()
sql/sql_parse.cc:
  Added DBUG
sql/sql_trigger.cc:
  Don't call unlink_open_table() if reopen_table() fails as the table may already be freed.
storage/maria/ma_bitmap.c:
  Fixed DBUG_ASSERT() in allocate_tail()
storage/maria/ma_blockrec.c:
  Fixed wrong calculation of row length for very small rows in undo_row_update().
  - Fixes ASSERT() when doing undo.
storage/maria/ma_blockrec.h:
  Added _ma_block_start_trans() and _ma_block_start_trans_no_versioning()
storage/maria/ma_locking.c:
  Call _ma_update_status_with_lock() when releasing write locks.
  - Fixes potential problem with updating status without the proper lock.
storage/maria/ma_open.c:
  Changed to use start_trans() instead of get_status() to ensure that we see all rows in all locked tables when we got the locks.
  - Fixed 'not found row' bug in REPLACE with Aria tables.
storage/maria/ma_state.c:
  Added _ma_update_status_with_lock() and _ma_block_start_trans().
  This is to ensure that we see all rows in all locked tables when we got the locks.
storage/maria/ma_state.h:
  Added _ma_update_status_with_lock()
storage/maria/ma_write.c:
  More DBUG_PRINT
storage/myisam/mi_check.c:
  Fixed error message
storage/myisam/mi_extra.c:
  Added HA_EXTRA_DETACH_CHILD:
  - Detach MyISAM table to not be part of MERGE table (remove flag & lock priority).
storage/myisam/mi_locking.c:
  Call mi_update_status_with_lock() when releasing write locks.
  - Fixes potential problem with updating status without the proper lock.
  Change to use new HA_OPEN_MERGE_TABLE flag to test if MERGE table.
  Added mi_fix_status(), called by thr_merge().
storage/myisam/mi_open.c:
  Added marker if part of MERGE table.
  Call mi_fix_status() in thr_lock() for transactional tables.
storage/myisam/myisamdef.h:
  Change my_once_flag to uint, as it stored different values than just 0/1
  Added 'open_flag' to store state given to mi_open()
storage/myisammrg/ha_myisammrg.cc:
  Add THR_LOCK_MERGE_PRIV to THR_LOCK_DATA to get MERGE locks sorted after other types of locks.
storage/myisammrg/myrg_locking.c:
  Remove windows specific code.
storage/myisammrg/myrg_open.c:
  Use HA_OPEN_MERGE_TABLE to mi_open().
  Set HA_OPEN_MERGE_TABLE for linked MyISAM tables.
storage/xtradb/buf/buf0buf.c:
  Fixed compiler warning
storage/xtradb/buf/buf0lru.c:
  Initialize variable that could be used not initialized.
2010-11-02 17:22:57 +02:00
Jon Olav Hauglid
4776282bed Bug #57274 SET GLOBAL debug crashes on Solaris in embedded server mode
(variables_debug fails)

The problem was that "SET GLOBAL debug" could cause a crash on Solaris.
The crash happened if the server failed to open the trace file given in 
the "SET GLOBAL debug" statement. This caused an error message to be
printed to stderr containing the process name. However, printing to
stderr crashed the server since the pointer to the process name had
not been initialized.

This patch fixes the problem by initializing the process name 
properly when doing "SET GLOBAL debug".

No test case added as this bug was repeatable with existing test
coverage in variables_debug.test.
2010-10-19 10:19:57 +02:00
Tor Didriksen
af665ea977 Bug#52172 post-push fix: init auto-variable to NULL 2010-10-19 09:06:48 +02:00
Jon Olav Hauglid
87b91752f9 Merge from mysql-5.1-bugteam to mysql-5.5-bugteam
No conflicts
2010-10-19 10:30:26 +02:00
Tor Didriksen
ebe356cb32 automerge from 5.1-bugteam: Bug#52172 post-push fix: init auto-variable to NULL 2010-10-19 09:17:26 +02:00
Tor Didriksen
9074307102 Bug#52172 test binlog.binlog_index needs --skip-core-file to avoid leaving core files
For crash testing: kill the server without generating core file.

include/my_dbug.h
  Use kill(getpid(), SIGKILL) which cannot be caught by signal handlers.
  All DBUG_XXX macros should be no-ops in optimized mode, do that for DBUG_ABORT as well.
sql/handler.cc
  Kill server without generating core.
sql/log.cc
  Kill server without generating core.
2010-10-18 13:24:34 +02:00
Michael Widenius
01672cc026 Fixes for bugs found by running test case for LP#608369 "Page: 1 Found wrong page type 0' on CHECK TABLE EXTENDED"
Fixed overflow when using long --debug=xxxxxx line.
Fixed that "mysqld --disable-debug --debug" works.
Ensure that MariaDB doesn't start if the Aria engine didn't start and we are using Aria for temporary tables.
More DBUG_ASSERT() and more info in debug log.


dbug/dbug.c:
  Fixed crash in mysqld caused by an overflow when using long --debug=xxxxxx line
sql/mysqld.cc:
  Fixed that "mysqld --disable-debug --debug" works.
  Documented myisam-recover=OFF option
storage/maria/ha_maria.cc:
  Ensure that MariaDB doesn't start if the Aria engine didn't start and we are using Aria for temporary tables.
storage/maria/ma_delete.c:
  Added missing write of changed key on node page.
  This could fix LP#608369 "Page: 1 Found wrong page type 0' on CHECK TABLE EXTENDED"
  Changed so that we log page numbers (not positions)
  Added KEY_OP_DEBUG_2 log entry to get more debug information into the log
storage/maria/ma_key_recover.c:
  Changed so that we log page numbers (not positions)
  In case of wrong page information after index_redo, dump pages to debug log
storage/maria/ma_loghandler.h:
  Added KEY_OP_DEBUG_2
storage/maria/ma_search.c:
  Changed so that we log page numbers (not positions)
storage/maria/ma_write.c:
  Changed so that we log page numbers (not positions)
2010-10-13 18:15:43 +03:00
Alexey Kopytov
d72c594739 Manual merge from mysql-5.1-bugteam into mysql-5.5-bugteam.
conflicts:
   conflict      dbug/dbug.c
   conflict      sql/sql_load.cc
2010-10-02 00:12:27 +04:00
Jon Olav Hauglid
7f80cffa52 Bug #46165 server crash in dbug
This crash occured if the same debug trace file was closed twice,
leading to the same memory being free'd twice. This could occur
if the "debug" server system variable refered to the same trace
file in both global and session scope.

Example of an order of events that would lead to a crash:
1) Enable debug tracing to a trace file (global scope)
2) Enable debug tracing to the same trace file (session scope)
3) Reset debug settings (global scope)
4) Reset debug settings (session scope)

This caused a crash because the trace file was, by mistake, closed
in 3), leading to the same memory being free'd twice when the file
was closed again in 4).

Internally, the debug settings are stored in a stack, with session
settings (if any) on top and the global settings below. Each connection
has its own stack. When a set of settings is changed, it must be 
determined if its debug trace file is to be closed. Before, this was done
by only checking below on the settings stack. So if the global settings
were changed, an existing debug trace file reference in session settings
would be missed. This caused the file to be closed even if it was in use,
leading to a crash later when it was closed again.

This patch fixes the problem by preventing the trace file from being shared
between global and session settings. If session debug settings are set without
specifying a new trace file, stderr is used for output. This is a change
in behaviour and should be reflected in the documentation.

Test case added to variables.test.
2010-09-28 11:07:58 +02:00
Alexey Kopytov
faf54ff95c Bug #56709: Memory leaks at running the 5.1 test suite
Fixed a number of memory leaks discovered by valgrind.

dbug/dbug.c:
  This is actually an addendum to the fix for bug #52629:
  
  - there is no point in limiting the fix to just global
  variables, session ones are also affected.
  - zero all fields when allocating a new 'state' structure so
  that FreeState() does not deal with unitialized data later.
  - add a check for a NULL pointer in DBUGCloseFile()
mysql-test/r/partition_error.result:
  Added a test case for bug #56709.
mysql-test/r/variables_debug.result:
  Added a test case for bug #56709.
mysql-test/t/partition_error.test:
  Added a test case for bug #56709.
mysql-test/t/variables_debug.test:
  Added a test case for bug #56709.
sql/item_timefunc.cc:
  There is no point in declaring 'value' as a member of
  Item_extract and dynamically allocating memory for it in
  Item_extract::fix_length_and_dec(), since this string is only
  used as a temporary storage in Item_extract::val_int().
sql/item_timefunc.h:
  Removed 'value' from the Item_extract class definition.
sql/sql_load.cc:
  - we may need to deallocate 'buffer' even when 'error' is
    non-zero in some cases, since 'error' is public, and there is
    external code modifying it.
  - assign NULL to buffer when deallocating it so that we don't
    do it twice in the destructor
  - there is no point in changing 'error' in the destructor.
2010-09-22 23:33:18 +04:00
Olav Sandstaa
77844bd10b Fix for Bug#54478 "mysqld crashes during boot when running mtr with --debug option"
The crash during boot was caused by a DBUG_PRINT statement in fill_schema_schemata() (in
sql_show.cc). This DBUG_PRINT statement contained several instances of %s in the format 
string and for one of these we gave a NULL pointer as the argument. This caused the
call to vsnprintf() to crash when running on Solaris.
      
The fix for this problem is to replace the call to vsnprintf() with my_vsnprintf()
which handles that a NULL pointer is passed as argumens for %s.

This patch also extends my_vsnprintf() to support %i in the format string.

dbug/dbug.c:
  Replace the use of vsnprintf() with my_vsnprintf(). On some platforms
  vsnprintf() did not handle that a NULL pointer was given as an argument
  for a %s in the format string.
include/mysql/service_my_snprintf.h:
  Add support for %i in format string to my_vsnprintf().
strings/my_vsnprintf.c:
  Add support for %i in format string to my_vsnprintf().
unittest/mysys/my_vsnprintf-t.c:
  Add unit tests for %i in format string to my_vsnprintf().
2010-09-15 13:33:22 +02:00
Michael Widenius
b7158601d3 Fixed bug LP#605798 "wrong data in bitmap" after recovery.
Extend remove_function_from_trace.pl to work with many threads (patch from Sergei)


dbug/remove_function_from_trace.pl:
  Extend remove_function_from_trace.pl to work with many threads (patch from Sergei)
storage/maria/ma_bitmap.c:
  Added marker that table had changed since last checkpoint.
  This ensures that we will flush all bitmap pages from cache at checkpoint.
  This fixes bug LP#605798 "wrong data in bitmap" after recovery.
storage/maria/ma_check.c:
  Cleaned up error output
storage/maria/ma_recovery.c:
  Cleaned up error output
storage/maria/maria_def.h:
  Added changed_not_flushed
2010-09-10 02:42:12 +03:00
Michael Widenius
ad6d95d3cb Merge with MySQL 5.1.50
- Changed to still use bcmp() in certain cases becasue
  - Faster for short unaligneed strings than memcmp()
  - Bettern when using valgrind
- Changed to use my_sprintf() instead of sprintf() to get higher portability for old systems
- Changed code to use MariaDB version of select->skip_record()
- Removed -%::SCCS/s.% from Makefile.am:s to remove automake warnings
2010-08-27 17:12:44 +03:00
Alexander Nozdrin
8b645bed97 Patch for Bug#55854 (MySQL AB should not be AUTHOR, copyright incorrect).
Fixing copyright text.
2010-08-12 19:19:57 +04:00
Davi Arnaut
711c318c07 Merge of mysql-trunk-bugfixing into mysql-trunk-merge. 2010-07-15 10:47:50 -03:00
Davi Arnaut
13f7a1d244 WL#5486: Remove code for unsupported platforms
Remove MS-DOS specific code.
2010-07-15 08:16:06 -03:00
Davi Arnaut
f56dd32bf7 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.

client/mysqldump.c:
  Pass my_free directly as its signature is compatible with the
  callback type -- which wasn't the case for free_table_ent.
2010-07-08 18:20:08 -03:00
Davi Arnaut
54a5c00de9 Unset the execute bit where it's not needed. 2010-07-03 20:17:03 -03:00
Alexander Nozdrin
eb27f163a3 Fix for Bug#53925 (valgrind failures in rpl.rpl_get_master_version_and_clock
in mysql-trunk-merge).

There were two problems:
  - a mistake during merge of a patch for Bug 52629 from 5.1;
  - MTR treated auxilary output of newer valgrind as an error.

The fixes are:
  - Fix merge error;
  - Teach MTR to skip 'HEAP summary' section of valgrind output.
2010-05-24 22:57:25 +04:00
Alexey Kopytov
598cf5aec7 Manual merge of mysql-5.1-bugteam to mysql-trunk-merge.
Conflicts:

   conflict      Makefile.am
   conflict      mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result
   conflict      mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test
   conflict      sql/opt_sum.cc
   conflict      sql/set_var.cc
   conflict      sql/sql_base.cc
   conflict      sql/sql_priv.h
   conflict      sql/sql_show.cc
2010-05-24 00:41:18 +04:00
Sergey Glukhov
b8af4ab216 Bug#52884 mysql-test-run does not work with --debug option
Server crashes on 64bit linux with 'double free or corruption'
message, on 32bit mysql-test-run silently fails on bootstrap
stage. The problem is that FreeState() is called twice
for init_settings struct in _db_end_ function.
The fix is to remove superfluous FreeState() call.
Additional fix:
fixed discrepancy of result file when
debug & valgrind options are enabled
for MTR.

dbug/dbug.c:
  The problem is that FreeState() is called twice
  for init_settings struct in _db_end_ function.
  The fix is to remove superfluous FreeState() call.
mysql-test/r/variables_debug.result:
  fixed discrepancy of result file when
  debug & valgrind options are enabled
  for MTR.
mysql-test/t/variables_debug.test:
  fixed discrepancy of result file when
  debug & valgrind options are enabled
  for MTR.
sql/set_var.cc:
  fixed discrepancy of result file when
  debug & valgrind options are enabled
  for MTR.
2010-05-20 10:31:03 +04:00
Alexey Kopytov
85ed11c60d Manual merge of mysql-5.1-bugteam to mysql-trunk-merge.
Conflicts:

Text conflict in configure.in
Text conflict in dbug/dbug.c
Text conflict in mysql-test/r/ps.result
Text conflict in mysql-test/t/ps.test
Text conflict in sql/CMakeLists.txt
Text conflict in sql/ha_ndbcluster.cc
Text conflict in sql/mysqld.cc
Text conflict in sql/sql_plugin.cc
Text conflict in sql/sql_table.cc
2010-04-30 00:33:06 +04:00
Joerg Bruehe
4b68b2d289 Merge the changes of the 5.5.3-m3 release build
back into the development branches.
2010-04-18 15:32:05 +02:00
Georgi Kodinov
16fadb10b5 Bug #52629: memory leak from sys_var_thd_dbug in binlog.binlog_write_error
When re-setting (SET GLOBAL debug='') the GLOBAL debug settings the 
server was not freeing the data elements from the top (initial) frame 
before setting them to 0 without freeing the underlying memory. As these 
are global settings there's a chance that something is there already.
Fixed by :
1. making sure the allocated data are cleaned up before re-setting them
while parsing a debug string
2. making sure the stuff allocated in the global settings is freed on 
shutdown.
2010-04-16 10:30:53 +03:00
Vladislav Vaintroub
b1073a2213 Fix errors when building release
- package some more perl scripts on Windows (mysqlhotcopy and mysqldumpslow)
- do not try to pack .map files (no more produced)
- (CMake-unrelated) fix debug build on FreeBSD, trying to use uninitialized attribute
MY_MUTEX_INIT_FAST
2010-03-19 18:33:48 +01:00
Joerg Bruehe
48734d0461 Another case of C++ syntax used for a comment in C. 2010-03-15 19:01:22 +01:00
Vladislav Vaintroub
a6f6932e26 merge 2009-12-11 21:17:17 +01:00
Michael Widenius
f6b6ae912c Protect stack->keywords with THR_LOCK_dbug
This solves a core dump in MariaDB when one sets the GLOBAL.DEBUG variable in mysql-test-run when other threads are checking the keyword list

dbug/dbug.c:
  Protect stack->keywords with THR_LOCK_dbug
2009-12-07 02:52:40 +02:00
Tor Didriksen
1574c6d081 Use vsnprintf() rather than my_vsnprintf() in DbugVfprintf,
since support for "%g" and "%f" has not been backported yet.

dbug/dbug.c:
  Use vsnprintf rather than my_vsnprintf.
2009-11-27 15:40:33 +01:00
Vladislav Vaintroub
7377c50cb4 implement convenience libraries 2009-11-24 23:15:47 +00:00
Vladislav Vaintroub
bc76ad8f6b WL#5161 : Cross-platform build with CMake
BUILD-CMAKE:
  WL#5161 : Documentation on how to build with CMake on Unix/Windows
BUILD/Makefile.am:
  Add new file
BUILD/autorun.sh:
  WL#5161 : use choose_configure instead of autotools configure script
  (choose configure will call cmake if cmake is available)
BUILD/choose_configure.sh:
  WL#5161 : use choose_configure instead of autotools configure script
  (choose configure will call cmake if cmake is available)
CMakeLists.txt:
  WL#5161 : Rewrite top-level CMakeLists.txt. 
  Remove  Windows specifics
  - compiler flags handling moved to configure.cmake
  - storage engine/plugin stuff moved into cmake/plugin.cmake
  - copy docs
Makefile.am:
  Added new files
client/CMakeLists.txt:
  WL#5161 : Rewrite CMakeLists.txt to be platform-independent
  Handle packagng (add INSTALL commands)
cmake/Makefile.am:
  WL#5161 : use choose_configure instead of autotools configure script
  (choose configure will call cmake if cmake is available)
cmake/abi_check.cmake:
  Custom targets for abi_check (for cmake)
cmake/bison.cmake:
  - Check bison availability
  - Add RUN_BISON macro (used to create sql_yacc.cc and sql_yacc.h)
cmake/cat.cmake:
  Add helper script to concatenate files.
cmake/character_sets.cmake:
  Handle configuration parameters WITH_EXTRA_CHARSETS
cmake/check_minimal_version.cmake:
  Helper script to check the minimum required version of cmake
cmake/configure.pl:
  Add perl script to convert ./configure parameters for cmake
cmake/create_initial_db.cmake.in:
  Add script helper to create initial database. 
  (on Windows, we pack initial db with the redistribution
  package)
cmake/do_abi_check.cmake:
  Perform abi check
cmake/dtrace.cmake:
  Handle dtrace in CMake Build.
  Check for dtrace availablility,
  run dtrace -G on solaris in prelink step
cmake/dtrace_prelink.cmake:
  Run dtrace -G on Solaris in pre-link step,
  link the object it creates together with library or
  executable
cmake/install_macros.cmake:
  Helper macros for packaging
  (install pdb on Windows, install symlinks on Unix)
cmake/make_dist.cmake.in:
  "make dist" - 
  - pack autotools ./configure script with the source
  (renamed to configure.am)
  - pack bison output
cmake/merge_archives_unix.cmake.in:
  script to merge static libraries on Unix
cmake/misc.cmake:
  Build helper macros
  - MERGE_STATIC_LIBS 
  We use it when building client library and embedded
  (avoid recompilation)
  
  - Convert source file paths to absolute names.
  We use it in  to locate files of a different project,
  when the files need to be recompiled (e.g in embedded
  several storage engines are recompiled with 
  -DEMBEDDED_LIBRARY)
cmake/mysql_version.cmake:
  Extract version info from configure.in
  Handle package names.
cmake/plugin.cmake:
  Rewrote storage/mysql_storage_engine.cmake to handle 
  other types of plugins and do it in OS-independent manner.
cmake/readline.cmake:
  Macros to handle WITH_READLINE/WITH_LIBEDIT parameters
cmake/ssl.cmake:
  Add macros to handle WITH_SSL parameter.
cmake/stack_direction.c:
  Helper to check stack direction.
cmake/zlib.cmake:
  Add macros to handle WITH_ZLIB parameter
cmd-line-utils/libedit/CMakeLists.txt:
  Build libedit with cmake.
cmd-line-utils/libedit/Makefile.am:
  Add new file
cmd-line-utils/readline/CMakeLists.txt:
  Build readline with CMake.
cmd-line-utils/readline/Makefile.am:
  Add new file
config.h.cmake:
  WL#5161 : Add config.h template for cmake
configure.cmake:
  WL#5161 : Add platform tests ( for cmake)
configure.in:
  Added new subdirectories
dbug/CMakeLists.txt:
  WL#5161
extra/CMakeLists.txt:
  WL#5161
extra/yassl/CMakeLists.txt:
  WL#5161
extra/yassl/taocrypt/CMakeLists.txt:
  WL#5161
include/Makefile.am:
  Add new file
include/keycache.h:
  remove configure-win.h and remove HUGE_PTR defined there.
include/my_global.h:
  use my_config.h for Windows, not config-win.h anymore
include/my_pthread.h:
  - Move thread_safe_increment from config-win.h to other headers
  (config-win.h is not used anymore)
  - Declare pthread_cancel on Windows (it is used in daemon_example)
include/my_sys.h:
  Add malloc.h on Windows (we use -D_WIN32_LEAN_AND_MEAN now, and 
  with this define malloc.h is not included automatically via windows.h)
include/mysql/plugin.h:
  Handle pure-C plugins with Microsoft compiler.
include/thr_alarm.h:
  remove rf_SetTimer that used to be defined in config-win.h
  Replace with UINT_PTR (we do not use config-win.h anymore
  and typedef was needed in this single place only)
libmysql/CMakeLists.txt:
  Avoid pointless recompilation of source files 
  in client library if possible. Merge static 
  libs (dbug, mysys) to create static client 
  library.
libmysqld/CMakeLists.txt:
  Avoid pointless recompilation of source files 
  when building embedded. Instead, merge dbug and 
  mysys (and some other static libs) into embedded.
libmysqld/examples/CMakeLists.txt:
  Embedded compilation on Unix
libmysqld/lib_sql.cc:
  Do not define THD::clear_error() in lib_sql.cc
  for embedded. Instead, use the same inline 
  definition from sql_class.h as in none-embedded 
  case (fixes duplicate symbol errors on Windows
  and removes pointless #ifdef EMBEDDED)
man/CMakeLists.txt:
  Install man files.
man/Makefile.am:
  Add new file.
mysql-test/CMakeLists.txt:
  Install mysql-test files
mysql-test/Makefile.am:
  Add new files
mysql-test/lib/My/ConfigFactory.pm:
  Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/Find.pm:
  the build configurations are now also available on Unix
  Xcode on Mac uses the Release, RelwithDebinfo and Debug 
  subdirectories for executables. Earlier, build configurations 
  were available only on Windows.
mysql-test/lib/My/SafeProcess.pm:
  Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/SafeProcess/CMakeLists.txt:
  Port CMakeLists.txt to Unix
mysql-test/lib/My/SafeProcess/safe_kill_win.cc:
  add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
mysql-test/lib/My/SafeProcess/safe_process_win.cc:
  Add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
  define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE if not defined 
  (can happen using MinGW compiler that comes with old SDK)
mysql-test/mtr.out-of-source:
  Allow testing with mtr in out-of-source builds.
mysql-test/mysql-test-run.pl:
  Allow testing with mtr in out-of-source builds.
  Use common find_plugin macro for Windows and unix.
mysql-test/t/fulltext_plugin.test:
  This test can now run on Windows as well.
mysys/CMakeLists.txt:
  Port CMakeLists.txt to Unix
mysys/my_create.c:
  config-win.h is dead => NO_OPEN_3 is never defined.
mysys/my_getsystime.c:
  config-win.h is dead => define OFFSET_TO_EPOCH where it is used.
mysys/my_winthread.c:
  Add  win32 pthread_cancel - used by daemon_example
mysys/mysys_priv.h:
  config-win.h is dead => include <sys/stat.h> where it is used
  fix prototype of my_win_(f)stat
plugin/daemon_example/CMakeLists.txt:
  Compile daemon_example with CMake
plugin/daemon_example/Makefile.am:
  Add new file
plugin/fulltext/CMakeLists.txt:
  Compile full-text example with CMake
plugin/fulltext/Makefile.am:
  Add new file.
plugin/semisync/CMakeLists.txt:
  Fix semisync to use common  macro for plugins.
regex/CMakeLists.txt:
  Use absolute filenames, when adding regex library 
  (we recompile files in embedded, and want to locate 
  sources via GET_TARGET_PROPERTY( ... SOURCES ..))
regex/regex2.h:
  Remove pointless typedef (produces error with MinGW compiler)
scripts/CMakeLists.txt:
  Add configure/install for scripts
sql-bench/CMakeLists.txt:
  install sql-bench files
sql-bench/Makefile.am:
  Add new file
sql/CMakeLists.txt:
  Port CmakeLists.txt to Unix
sql/nt_servc.cc:
  compile server with -DWIN32_LEAN_AND_MEAN
sql/share/CMakeLists.txt:
  Install charsets
sql/share/Makefile.am:
  Add new file
sql/sql_builtin.cc.in:
  Handle pure-C plugins on Windows.
sql/sql_class.h:
  Use the same clear_error macro in embedded and not embedded.
  Fixes pointless #ifdef and avoids duplicate symbols when linking
  on Windows.
storage/Makefile.am:
  storage/mysql_storage_engine.cmake => cmake/plugin.cmake
storage/archive/CMakeLists.txt:
  Add names for static and dynamic plugin libraries.
  Link archive with zlib
storage/blackhole/CMakeLists.txt:
  Add names for static and dynamic storage 
  engine libraries
storage/csv/CMakeLists.txt:
  Add names for static and dynamic storage engine
  libraries
storage/example/CMakeLists.txt:
  Add names for static and dynamic storage engine 
  libraries
storage/federated/CMakeLists.txt:
  Add names for static and dynamic storage engine 
  libraries
storage/heap/CMakeLists.txt:
  Add names for static and dynamic storage engine 
  libraries
storage/ibmdb2i/CMakeLists.txt:
  Better port for ibmdb2i plugin
storage/innobase/CMakeLists.txt:
  Run system checks.
  
  Add names for static and dynamic storage engine 
  libraries.
storage/innobase/include/page0page.ic:
  Fix compile error on OpenSolaris.
storage/myisam/CMakeLists.txt:
  Port CmakeLists.txt to Unix
storage/myisammrg/CMakeLists.txt:
  Add names for static and dynamic storage engine 
  libraries
storage/mysql_storage_engine.cmake:
  storage/mysql_storage_engine.cmake => cmake/plugin.cmake
support-files/CMakeLists.txt:
  Configure and install some files from support-files.
support-files/Makefile.am:
  Add new file
tests/CMakeLists.txt:
  In general case, mysqlclient library can be dependent
  on C++ runtime(if it includes yassl and is not compiled
  with gcc or MSVC)
unittest/mysys/CMakeLists.txt:
  Add unit tests
unittest/mysys/Makefile.am:
  Add new file
unittest/mytap/CMakeLists.txt:
  Add library for unit tests
unittest/mytap/Makefile.am:
  Add new file
unittest/mytap/tap.c:
  fix function definitions to match declarations
win/create_def_file.js:
  Fix link error with intel compiler (icl 
  defines of special label for exception handler)
2009-11-09 12:32:48 +01:00
Sergei Golubchik
2cb9f48bab robust protection against missing DBUG_RETURN
(instead of a C++ only thingy that was lost in a merge)
2009-10-31 08:23:47 +01:00
Sergei Golubchik
319847a4ec backport of dbug extensions from 6.0:
function/ syntax
  glob(7) wildcards
  unit tests
2009-10-30 19:13:58 +01:00