summaryrefslogtreecommitdiff
path: root/libmysqld
Commit message (Collapse)AuthorAgeFilesLines
* WL#7076: Backporting wl6715 to support both formats in 5.5, 5.6, 5.7Ashish Agarwal2013-07-021-6/+7
| | | | Backporting wl6715 to mysql-5.5
* Correcting the permissions of the executable files.Murthy Narkedimilli2013-03-201-0/+0
|
* Fix for Bug 16395495 - OLD FSF ADDRESS IN GPL HEADERMurthy Narkedimilli2013-03-191-1/+1
|
* mysql_client_test did not build within limbysqld/examplesBjorn Munch2012-07-101-0/+1
|\
| * mysql_client_test did not build within limbysqld/examplesBjorn Munch2012-07-102-2/+4
| |
* | BUG#13738989 : 62136 : FAILED TO FETCH SELECT RESULT USING EMBEDDED MYSQLDMayank Prasad2012-04-061-0/+2
|\ \ | |/ | | | | Merge : 5.1->5.5
| * BUG#13738989 : 62136 : FAILED TO FETCH SELECT RESULT USING EMBEDDED MYSQLDMayank Prasad2012-04-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Background : In mysql-5.1, in a fix for bug#47485, code has been changed for mysql client (libmysql/libmysql.c) but corresponding code was not changed for embedded mysql. In that code change, after execution of a statement, mysql_stmt_store_result() checks for mysql->state to be MYSQL_STATUS_STATEMENT_GET_RESULT, instead of MYSQL_STATUS_GET_RESULT (earlier). Reason: In embedded mysql code, after execution, mysql->state was not set to MYSQL_STATUS_STATEMENT_GET_RESULT, so it was throwing OUT_OF_SYNC error. Fix: Fixed the code in libmysqld/lib_sql.cc to have mysql->state to be set to MYSQL_STATUS_STATEMENT_GET_RESULT after execution.
* | Updated/added copyright headersMySQL Build Team2012-02-162-2/+2
|\ \ | |/
| * Updated/added copyright headersKent Boortz2012-02-151-2/+1
| |\
| * | Bug#11761576 54082: HANDLE_SEGFAULT MAKES USE OF UNSAFE FUNCTIONSTor Didriksen2011-11-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | handle_segfault is the signal handler code of mysqld. however, it makes calls to potentially unsafe functions localtime_r, fprintf, fflush. include/my_stacktrace.h: Add safe versions of itoa() write() and snprintf(). libmysqld/CMakeLists.txt: Move signal handler to separate file. mysys/stacktrace.c: Remove unsafe function calls. sql/CMakeLists.txt: Move signal handler to separate file. sql/Makefile.am: Move signal handler to separate file. sql/mysqld.cc: Move signal handler to separate file. sql/signal_handler.cc: Remove unsafe function calls.
| * | Updated/added copyright headersKent Boortz2011-07-031-2/+26
| |\ \
| | * | Bug#11764633 : 57491: THD->MAIN_DA.IS_OK() ASSERT IN EMBEDDEDMayank Prasad2011-05-181-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue: While running embedded server, if client issues TEE command (\T foo/bar) and "foo/bar" directory doesn't exist, it is suppose to give error. But it was aborting. This was happening because wrong error handler was being called. Solution: Modified calls to correct error handler. In embedded server case, there are two error handler (client and server) which are supposed to be called based on which context code is in. If it is in client context, client error handler should be called otherwise server. Test case: Test case automation is not possible as current (following) code doesn't allow '\T' to be executed from command line (OR command read from a file): [client/mysql.cc] ... static int com_tee(String *buffer __attribute__((unused)), char *line __attribute__((unused))) { char file_name[FN_REFLEN], *end, *param; if (status.batch) << THIS IS TRUE WHILE EXECUTING FROM COMMAND LINE. return 0; ... So, not adding test case in GA. WIll add a test case in mysql-trunk after removing above code so that this could be properly tested before GA. libmysqld/lib_sql.cc: Added code to call client/server error handler based on in control is in client/server code respectively. sql/mysql_priv.h: Added comments for THR_THD, THR_MALLOC keys. sql/sql_class.cc: Function definition of new function restore_global to removes thread specific data from stack (which was stored in store global). sql/sql_class.h: Function declaration of new function restore_global.
* | | | Bug#11761576 54082: HANDLE_SEGFAULT MAKES USE OF UNSAFE FUNCTIONSTor Didriksen2011-12-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | handle_segfault is the signal handler code of mysqld. however, it makes calls to potentially unsafe functions localtime_r, fprintf, fflush. include/my_stacktrace.h: Add safe versions of itoa() write() and snprintf(). libmysqld/CMakeLists.txt: Move signal handler to separate file. mysys/stacktrace.c: Remove unsafe function calls. sql/CMakeLists.txt: Move signal handler to separate file. sql/mysqld.cc: Move signal handler to separate file. sql/set_var.h: Add missing #include dependency. sql/sys_vars.cc: Cleanup .h and .cc files. sql/sys_vars.h: Cleanup .h and .cc files.
* | | | #41836: Eventum Request to enable the mysql_embedded binarySunanda Menon2011-07-191-3/+1
| | | |
* | | | Bug#12727287: Maintainer mode compilation fails with gcc 4.6Davi Arnaut2011-07-071-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 4.6 has new -Wunused-but-set-variable flag, which is enabled by -Wall, that causes GCC to emit a warning whenever a local variable is assigned to, but otherwise unused (aside from its declaration). Since the maintainer mode uses -Wall and -Werror, source code which triggers these warnings will be rejected. That is, these warnings become hard errors. The solution is to fix the code which triggers these specific warnings. In most of the cases, this is a welcome cleanup as code which triggers this warning is probably dead anyway. dbug/dbug.c: Unused but set. libmysqld/lib_sql.cc: Length is not necessary as the converted error message is always null-terminated. sql/item_func.cc: Make get_var_with_binlog private to this compilation unit. If a error was raised, do not attempt to evaluate the user variable as the statement execution will be interrupted anyway. sql/mysqld.cc: Use a void expression to silence the warning. Avoids the use of macros that would make the code more unreadable than it already is. sql/protocol.cc: Length is not necessary as the converted error message is always null-terminated. Remove unnecessary casts and assignment. sql/sql_class.h: Function is only used in a single compilation unit. sql/sql_load.cc: Only use the variable outside of EMBEDDED_LIBRARY. storage/innobase/btr/btr0cur.c: Do not retrieve field, only the record length is being used. storage/perfschema/pfs.cc: Use a void expression to silence the warning. tests/mysql_client_test.c: Unused but set. unittest/mysys/lf-t.c: Unused but set.
* | | | Updated/added copyright headersKent Boortz2011-07-041-2/+2
|\ \ \ \
| * | | | BUG#12561297:LIBMYSQLD/EXAMPLE/MYSQL_EMBEDDED IS ABORTING.Mayank Prasad2011-06-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue: When libmysqld/example/mysql_embedded is executed, it was getting abort. Its a regression as it was working in 5.1 and failed in 5.5. Issue is there because remaining_argc/remaining_argv were not getting assigned correctly in init_embedded_server() which were being used later in init_common_variable(). Solution: Rectified code to pass correct argc/argv to be used in init_common_variable(). libmysqld/lib_sql.cc: Rectified remaining_argc/remaining_argv assignment. mysql-test/r/mysql_embedded.result: Result file for the test case added. mysql-test/t/mysql_embedded.test: Added test case to verify libmysqld/example/mysql_embedded works.
* | | | | Updated/added copyright headersKent Boortz2011-06-308-8/+72
|\ \ \ \ \ | |/ / / / |/| / / / | |/ / /
| * | | Updated/added copyright headersKent Boortz2011-06-3010-11/+84
| |\ \ \ | | |/ / | |/| / | | |/
| | * Updated/added copyright headersKent Boortz2011-06-302-5/+7
| | |
* | | merge from 5.1 for bug#11764633Mayank Prasad2011-05-181-2/+26
| | |
* | | MergeKent Boortz2010-12-292-14/+15
|\ \ \ | |/ /
| * | MergeKent Boortz2010-12-292-14/+15
| |\ \ | | |/
| | * - Added/updated copyright headersKent Boortz2010-12-282-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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"
| | * Bug#48983: Bad strmake calls (length one too long)Davi Arnaut2009-12-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is a somewhat common misusage of the strmake function. The strmake(dst, src, len) function writes at most /len/ bytes to the string pointed to by src, not including the trailing null byte. Hence, if /len/ is the exact length of the destination buffer, a one byte buffer overflow can occur if the length of the source string is equal to or greater than /len/. client/mysqldump.c: Make room for the trailing null byte. libmysql/libmysql.c: Add comment, there is enough room in the buffer. Increase buffer length, two strings are concatenated. libmysqld/lib_sql.cc: Make room for the trailing null byte. mysys/default.c: Make room for the trailing null bytes. mysys/mf_pack.c: Make room for the trailing null byte. server-tools/instance-manager/commands.cc: Copy only if overflow isn't possible in both cases. server-tools/instance-manager/listener.cc: Make room for the trailing null byte. sql/log.cc: Make room for the trailing null byte. sql/sp_pcontext.h: Cosmetic fix. sql/sql_acl.cc: MAX_HOSTNAME already specifies space for the trailing null byte. sql/sql_parse.cc: Make room for the trailing null byte. sql/sql_table.cc: Make room for the trailing null byte.
* | | Merge 5.5-bug58158 into 5.5-bugteamMagnus Blåudd2010-11-241-2/+1
|\ \ \
| * | | Bug#58158 LINK_LIBRARIES for MYSQL_ADD_PLUGIN is not added to libmysqldMagnus Blåudd2010-11-161-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add ARG_LINK_LIBRARIES to MYSQLD_STATIC_PLUGIN_LIBS in MYSQL_ADD_PLUGIN so that any libraries listed by the plugin is added to libmysqld - remove the variables NDB_CLIENT_LIBS and NDB_CLUSTER_INCLUDES from libmysqld/CMakeLists.txt since those are just old remnants
* | | | WL#5665: Removal of the autotools-based build systemDavi Arnaut2010-11-202-282/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | BUG#57108: mysqld crashes when I attempt to install pluginMats Kindahl2010-11-041-1/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a relative path is supplied to option --defaults-file or --defaults-extra-file, the server will crash when executing an INSTALL PLUGIN command. The reason is that the defaults file is initially read relative the current working directory when the server is started, but when INSTALL PLUGIN is executed, the server has changed working directory to the data directory. Since there is no check that the call to my_load_defaults() inside mysql_install_plugin(), the subsequence call to free_defaults() will crash the server. This patch fixes the problem by: - Prepending the current working directory to the file name when a relative path is given to the --defaults-file or --defaults- extra-file option the first time my_load_defaults() is called, which is just after the server has started in main(). - Adding a check of the return value of my_load_defaults() inside mysql_install_plugin() and aborting command (with an error) if an error is returned. - It also adds a check of the return value for load_defaults in lib_sql.cc for the embedded server since that was missing. To test that the relative files for the options --defaults-file and --defaults-extra-file is handled properly, mysql-test-run.pl is also changed to not add a --defaults-file option if one is provided in the tests *.opt file.
* | | mergeGeorgi Kodinov2010-10-042-14/+14
|\ \ \
| * | | Bug#53251 mysql_library_init fails on second execution with embedded ↵Alexey Botchkov2010-09-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | library thread-specific variables weren't set when we load error message files. per-file comments: libmysqld/lib_sql.cc Bug#53251 mysql_library_init fails on second execution with embedded library we need to call my_thread_init() once more. Normally it's called at the my_init() stage but that doesn't happen on the second my_init() call. sql/derror.cc Bug#53251 mysql_library_init fails on second execution with embedded library use default errors for the embedded server. sql/mysqld.cc Bug#53251 mysql_library_init fails on second execution with embedded library unregister server errors in clean_up(). Without it the error list contains that on the second mysql_server_init() which is not good. sql/set_var.cc Bug#53251 mysql_library_init fails on second execution with embedded library sys_var::cleanup() call instead of the destructor sql/set_var.h Bug#53251 mysql_library_init fails on second execution with embedded library sys_var::cleanup() introduced instead of the destructor sql/sys_vars.h Bug#53251 mysql_library_init fails on second execution with embedded library Sys_var_charptr::cleanup() implemented
| * | | Bug#54906 Inconsistent license of libmysqldAlexey Botchkov2010-09-011-14/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | made libmysqld/Makefile.am to have same licence as libmysqld/CMakeLists.txt per-file comments: libmysqld/Makefile.am Bug#54906 Inconsistent license of libmysqld Added GPL license header instead of Library GPL.
* | | | merge of mysql-5.5 into mysql-5.5-wl1054Georgi Kodinov2010-09-202-4/+7
|\ \ \ \ | |/ / /
| * | | Manual merge from mysql-5.5-bugfixing to mysql-5.5-runtime.Jon Olav Hauglid2010-08-183-8/+10
| |\ \ \
| | * \ \ mergeMattias Jonsson2010-08-162-4/+4
| | |\ \ \
| | | * | | Rename of sql_alter_table -> sql_alter and sql_table_maintenance -> sql_adminMattias Jonsson2010-08-162-4/+4
| | | | | |
| | * | | | mergeMattias Jonsson2010-08-162-4/+6
| | |\ \ \ \ | | | |/ / /
| | | * | | Bug#49907: ALTER TABLE ... TRUNCATE PARTITION does not wait forMattias Jonsson2010-08-162-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | locks on the table Fixing the partitioning specifics after TRUNCATE TABLE in bug-42643 was fixed. Reorganize of code to decrease the size of the giant switch in mysql_execute_command, and to prepare for future parser reengineering. Moved code into Sql_statement objects. Updated patch according to davi's review comments. libmysqld/CMakeLists.txt: Added new files. libmysqld/Makefile.am: Added new files. mysql-test/r/not_partition.result: now returning error on partitioning commands if partitioning is not enabled. mysql-test/r/partition_disabled.result: There is no partition handlerton, so it cannot find the specified engine in the .frm file. mysql-test/r/partition_truncate.result: Updated test results. mysql-test/suite/parts/inc/partition_mgm.inc: Added check that TRUNCATE PARTITION does not delete on failure. mysql-test/suite/parts/r/partition_debug_sync_innodb.result: updated results. mysql-test/suite/parts/r/partition_mgm_lc0_archive.result: updated results. mysql-test/suite/parts/r/partition_mgm_lc1_archive.result: updated results. mysql-test/suite/parts/r/partition_mgm_lc2_archive.result: updated results. mysql-test/suite/parts/t/partition_debug_sync_innodb.test: Test case for this bug. mysql-test/t/not_partition.test: Added check for TRUNCATE PARTITION without partitioning. mysql-test/t/partition_truncate.test: Added test of TRUNCATE PARTITION on non partitioned table. sql/CMakeLists.txt: Added new files. sql/Makefile.am: Added new files. sql/datadict.cc: Moved out the storage engine check into an own function, including assert for lock. sql/datadict.h: added dd_frm_storage_engine. sql/sql_alter_table.cc: moved the code for SQLCOM_ALTER_TABLE in mysql_execute_command into its own file, and using the Sql_statement object to prepare for future parser reengineering. sql/sql_alter_table.h: Created Sql_statement object for ALTER TABLE. sql/sql_lex.cc: resetting m_stmt. sql/sql_lex.h: Temporary hack for forward declaration of enum_alter_table_change_level. sql/sql_parse.cc: Moved out ALTER/ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE from the giant switch into their own Sql_statement objects. sql/sql_parse.h: Exporting check_merge_table_access. sql/sql_partition_admin.cc: created Sql_statement for ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR/TRUNCATE PARTITION. To be able to reuse the TABLE equivalents. sql/sql_partition_admin.h: Added Sql_statement of partition admin statements. sql/sql_table.cc: Moved table maintenance code into sql_table_maintenance.cc sql/sql_table.h: Moved table maintenance code into sql_table_maintenance.h exporting functions used by sql_table_maintenance. sql/sql_table_maintenance.cc: Moved table maintenance code from sql_table.cc sql/sql_table_maintenance.h: Sql_statement objects for ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE. Also declaring the keycache functions. sql/sql_truncate.cc: Moved code from SQLCOM_TRUNCATE in mysql_execute_command into Truncate_statement::execute. Added check for partitioned table on TRUNCATE PARTITION. Moved locking fix for partitioned table into Alter_table_truncate_partition::execute. sql/sql_truncate.h: Truncate_statement declaration (sub class of Sql_statement). sql/sql_yacc.yy: Using the new Sql_statment objects.
| * | | | | Extract reload_acl_and_cache() and flush_tables_with_read_lock()Konstantin Osipov2010-08-132-1/+2
| | |/ / / | |/| | | | | | | | | | | | | into an own implementation file.
* | | | | merged mysql-5.5 into WL1054-5.5Georgi Kodinov2010-08-162-4/+4
|\ \ \ \ \ | | |/ / / | |/| | |
| * | | | Patch for Bug#55854 (MySQL AB should not be AUTHOR, copyright incorrect).Alexander Nozdrin2010-08-122-4/+4
| |/ / / | | | | | | | | | | | | Fixing copyright text.
* | | | WL#1054: Pluggable authentication supportGeorgi Kodinov2010-08-095-37/+56
|/ / / | | | | | | | | | | | | Merged the implementation to a new base tree.
* | | WL#5498: Remove dead and unused source codeDavi Arnaut2010-07-232-2/+2
| | | | | | | | | | | | Remove unused source code and associated paraphernalia.
* | | Automerge.Ramil Kalimullin2010-07-161-1/+2
|\ \ \ | |/ /
| * | Fix for bug #50667: The InnoDB plugin prevents initializationRamil Kalimullin2010-07-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of the "embedded" server Problem: mysqltest_embedded failed to load ha_innodb_plugin library on some platforms (due to some unresolved references). Fix: on FreeBSD use -export-dynamic flag building mysqltest_embedded. That allows to use its global symbols to resolve references in the dynamically loaded plugin library. libmysqld/examples/Makefile.am: Fix for bug #50667: The InnoDB plugin prevents initialization of the "embedded" server - use -export-dynamic (on FreeBSD/DragonFly) building mysqltest_embedded to allow using its global symbols to resolve references in the dynamically loaded plugin libraries.
* | | WL#5486: Remove code for unsupported platformsDavi Arnaut2010-07-151-0/+16
| | | | | | | | | | | | Restore hack necessary to setup a libmysqld archive.
* | | WL#5486: Remove code for unsupported platformsDavi Arnaut2010-07-151-2/+2
| | | | | | | | | | | | Remove OS/2 specific code.
* | | WL#5486: Remove code for unsupported platformsDavi Arnaut2010-07-151-2/+2
| | | | | | | | | | | | Remove MS-DOS specific code.
* | | WL#5486: Remove code for unsupported platformsDavi Arnaut2010-07-151-21/+0
| | | | | | | | | | | | Remove Netware specific code.
* | | Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabledDavi Arnaut2010-07-082-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.