summaryrefslogtreecommitdiff
path: root/plugin
Commit message (Collapse)AuthorAgeFilesLines
* Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabledDavi Arnaut2010-07-082-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* mergeDaniel Fischer2010-06-182-2/+4
|\
| * fix syntax errorJonathan Perkin2010-05-051-1/+1
| |
| * Build all plugins.Jonathan Perkin2010-05-053-4/+6
| | | | | | | | | | Try to fix ia64/icc builds.
* | Post-merge fix: header is used by the client API. Obvious in retrospect.Davi Arnaut2010-06-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, update a few cases missed by the initial patch. client/mysqltest.cc: Remove trailing comma. include/my_alloc.h: Do not use wrapper. include/mysql.h.pp: Update ABI file. plugin/semisync/semisync_master.h: Initialize variable. sql/debug_sync.cc: Use C linkage.
* | Bug#53445: Build with -Wall and fix warnings that it generatesDavi Arnaut2010-05-312-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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). client/mysql.cc: Mismatch between prototype and declaration. client/mysqltest.cc: mysqltest used to be C code. Use C linkage where appropriate. cmd-line-utils/readline/input.c: Isolate unreachable code. include/my_alloc.h: Function type must have C linkage. include/my_base.h: Function type must have C linkage. include/my_global.h: Add helper macros to avoid spurious namespace indentation. include/mysql.h.pp: Update ABI file. mysys/my_gethwaddr.c: Remove stray carriage return and fix coding style. plugin/semisync/semisync_master_plugin.cc: Callback function types have C linkage. plugin/semisync/semisync_slave_plugin.cc: Callback function types have C linkage. sql/derror.cc: Expected function type has C linkage. sql/field.cc: Use helper macro and fix indentation. sql/handler.cc: Expected function type has C linkage. sql/item_sum.cc: Correct function linkages. Remove now unnecessary cast. sql/item_sum.h: Add prototypes with the appropriate linkage as otherwise they are distinct. sql/mysqld.cc: Wrap functions in C linkage mode. sql/opt_range.cc: C language linkage is ignored for class member functions. sql/partition_info.cc: Add wrapper functions with C linkage for class member functions. sql/rpl_utility.h: Use helper macro and fix indentation. sql/sql_class.cc: Change type of thd argument -- THD is a class. Use helper macro and fix indentation. sql/sql_class.h: Change type of thd argument -- THD is a class. sql/sql_select.cc: Expected function type has C linkage. sql/sql_select.h: Move prototype to sql_test.h sql/sql_show.cc: Expected function type has C linkage. sql/sql_test.cc: Fix required function prototype and fix coding style. sql/sql_test.h: Removed unnecessary export and add another. storage/myisammrg/ha_myisammrg.cc: Expected function type has C linkage. storage/perfschema/pfs.cc: PSI headers are declared with C language linkage, which also applies to function types.
* | Auto merge from 5.1-rep-semisyncHe Zhenxing2010-06-021-1/+2
|\ \
| * | Post fix for bug#52748He Zhenxing2010-06-021-1/+2
| | |
* | | BUG#52748 Semi-Sync ACK packet isn't check for lengthHe Zhenxing2010-06-011-4/+14
|\ \ \ | |/ / | | | | | | Check the length and use strncpy to make the code safer.
| * | BUG#52748 Semi-Sync ACK packet isn't check for lengthHe Zhenxing2010-06-011-4/+14
| | | | | | | | | | | | | | | | | | | | | Check the length and use strncpy to make the code safer. plugin/semisync/semisync_master.cc: replace strcpy with strncpy to make the code safer
* | | Fix HP-UX localtime_r issue correctly, patch from mats.Jonathan Perkin2010-05-271-2/+1
| | |
* | | Pull in time.h for localtime_r.Jonathan Perkin2010-05-251-0/+1
| | |
* | | Another incarnation of the patch for Bug#30708Alexander Nozdrin2010-05-193-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (make relies GNU extentions). The patch was partially backport from 6.0. Original comment: bug#30708: make relies GNU extensions. Now that we no longer use BitKeeper we can safely remove the SCCS handling with no loss of functionality.
* | | Revert back to new CMake names for audit_null/daemon_example plugins.Jonathan Perkin2010-05-122-4/+2
| | |
* | | Changes to build using CMake according to existing release packages:Jonathan Perkin2010-05-123-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Update/fix file layouts for each package type, add new types for native package formats including deb, rpm and svr4. - Build all plugins, including debug versions - Update compiler flags to match current release - Add missing @VAR@ expansions - Install correct mysqclient library symlinks - Fix icc/ia64 builds - Fix install of libmysqld-debug - Don't include mysql_embedded - Remove unpackaged manual pages to avoid missing files warnings - Don't install mtr's test suite
* | | Merge fixes for BUG46587 and BUG47059 to trunk-bugfixing.Sergey Vojtovich2010-04-151-10/+38
|\ \ \
| * | | BUG#47059 - In audit plugin I cannot see the event subclasses,Sergey Vojtovich2010-04-151-10/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | e.g.MYSQL_AUDIT_GENERAL_ERROR General audit API (MYSQL_AUDIT_GENERAL_CLASS) didn't expose event subclass to plugins. This patch exposes event subclass to plugins via struct mysql_event_general::event_subclass. This change is not compatible with existing general audit plugins. Audit interface major version has been incremented. include/mysql/plugin_audit.h: Expose event subclass to audit general plugins. plugin/audit_null/audit_null.c: Added distinct counters for general event sub-classes. Removed printf() from deinit(). One can easily see number of calls via status variables. To make code nicer, modified class mask to use macro instead of hardcoded number. Incremented audit plugin minor version. sql/sql_audit.cc: Expose event subclass to audit general plugins.
* | | | WL#5030: Split and remove mysql_priv.hMats Kindahl2010-03-314-2/+10
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch: - Moves all definitions from the mysql_priv.h file into header files for the component where the variable is defined - Creates header files if the component lacks one - Eliminates all include directives from mysql_priv.h - Eliminates all circular include cycles - Rename time.cc to sql_time.cc - Rename mysql_priv.h to sql_priv.h
* | | Automerge the bug#49022 fix correction into next-mr-bugfixing.Joerg Bruehe2010-03-121-1/+1
|\ \ \
| * | | Fix for the bug#49022 patch, detected by further testing.Joerg Bruehe2010-03-111-1/+1
| | | |
* | | | Auto mergeHe Zhenxing2010-03-111-1/+6
|\ \ \ \ | |/ / /
| * | | Part of the fixes for bug#49022Joerg Bruehe2010-03-101-1/+6
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Plugins included into bin release cannot be installed on debug version of server IF the build process was split into separate "debug" and "optimized" builds AND the plugin files of the debug build got copied into "plugin/debug/" (both is done for MySQL release builds starting from 5.5.3), THEN these debug plugin files are to be included in the final binary package. This change deals with the inclusion only, the other parts are done in different changesets. plugin/Makefile.am: The "install" rule must not assume that "debug" files are present, this depends on the preceding steps in the build. If they are present, we cannot copy them by simply using "libtool install" (as we could do during an ordinary build) because they are already kept in "plugin/debug/". When doing the copy to the destination hierarchy, we must ensure that symlinks are not expanded but rather copied as symlinks. "cp -d" is specific to GNU, the portable way would use "cp -P", but that is not fully specified with recursion. So we fall back on "tar c | tar x", which is known to keep symlinks unchanged (and un-expanded). Using "$(TAR)" is just a precaution in case of weird path settings or other portability issues.
* | | Auto merge from 5.1-rep-semisyncHe Zhenxing2010-03-111-126/+84
|\ \ \ | |/ / |/| / | |/
| * Post fix for Bug#49557He Zhenxing2010-03-101-1/+2
| |
| * Bug#49557 "semisync" plugin test fails on WindowsHe Zhenxing2010-02-231-126/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was because the gettimeofday function was incorrect implemented for Windows, and so the semisync master did not wait for slave reply properly on Windows. Fixed by removing the gettimeofday function for Windows, and using set_timespec function to get current time for all platforms. plugin/semisync/semisync_master.cc: removing the gettimeofday function for Windows, using set_timespec function to get current time for all platforms.
* | Fix truncated GPL text.Jonathan Perkin2010-02-261-1/+1
| |
* | mergeVladislav Vaintroub2010-02-132-36/+272
|\ \
| * \ Manual Merge for bug#50157unknown2010-01-312-36/+272
| |\ \ | | |/
| | * BUG#50157 Assertion !active_tranxs_->is_tranx_end_pos(..) in ↵unknown2010-01-312-36/+273
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ReplSemiSyncMaster::commitTrx The root cause of the crash is that a TranxNode is freed before it is used. A TranxNode is allocated and inserted into the active list each time a log event is written and flushed into the binlog file. The memory for TranxNode is allocated with thd_alloc and will be freed at the end of the statement. The after_commit/after_rollback callback was supposed to be called before the end of each statement and remove the node from the active list. However this assumption is not correct in all cases(e.g. call 'CREATE TEMPORARY TABLE myisam_t SELECT * FROM innodb_t' in a transaction and delete all temporary tables automatically when a session closed), and can cause the memory allocated for TranxNode be freed before it was removed from the active list. So The TranxNode pointer in the active list would become a wild pointer and cause the crash. After this patch, We have a class called a TranxNodeAllocate which manages the memory for allocating and freeing TranxNode. It uses my_malloc to allocate memory. sql/rpl_handler.cc: params are not initialized.
* | | Cleanup casing in MYSQL_ADD_PLUGIN, patch provided by KentVladislav Vaintroub2010-02-012-2/+2
| | |
* | | add CMakeLists.txt to EXTRA_DIST for audit_nullVladislav Vaintroub2010-01-261-1/+1
| | |
* | | merge, add plugin/audit_null/CMakeLists.txtVladislav Vaintroub2010-01-264-0/+182
|\ \ \ | |/ /
| * | Merge backport of WL#3771 with mysql-next-mr.Sergey Vojtovich2010-01-193-0/+166
| |\ \
| | * | Backport from 6.0-codebase.Sergey Vojtovich2009-12-153-0/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | WL#3771 "Audit Plugin Interface" Implement new plug-in type - AUDIT New plug-in: audit_null simply increments counter for how many times it was called. include/Makefile.am: wl3771 add new headers to distribution include/mysql/plugin.h: wl3771 define new AUDIT plugin type Split out fulltext plugin type into its own header include/mysql/plugin.h.pp: wl3771 no real API change, just re-arranged some code include/mysql/plugin_audit.h: wl3771 pluggable audit interface include/mysql/plugin_ftparser.h: wl3771 Split out fulltext plugin type into its own header libmysqld/CMakeLists.txt: wl3771 add sql_audit.cc to build libmysqld/Makefile.am: wl3771 add sql_audit.cc to build plugin/audit_null: wl3771 an example plugin for testing pluggable audit interface plugin/audit_null/Makefile.am: wl3771 an example plugin for testing pluggable audit interface plugin/audit_null/audit_null.c: wl3771 an example plugin for testing pluggable audit interface plugin/audit_null/plug.in: wl3771 an example plugin for testing pluggable audit interface sql/CMakeLists.txt: wl3771 add sql_audit.cc to build sql/Makefile.am: wl3771 add sql_audit.cc to build sql/event_queue.cc: wl3771 release audit resources before waiting sql/log.cc: wl3771 add general audit call for log sql/mysqld.cc: wl3771 add audit initialize/finalize add general audit call for error sql/sql_audit.cc: wl3771 pluggable audit interface implementation sql/sql_audit.h: wl3771 pluggable audit interface implementation sql/sql_class.cc: wl3771 add thd audit init/deinit calls sql/sql_class.h: wl3771 add required data structures for audit to THD sql/sql_connect.cc: wl3771 release audit resources before waiting sql/sql_insert.cc: wl3771 release audit plugins before waiting sql/sql_parse.cc: wl3771 add general audit call for results sql/sql_plugin.cc: wl3771 add declarations for audit plugin type
| * | | Auto-merge from mysql-next-mr.Alexander Nozdrin2009-12-193-16/+58
| |\ \ \
| * \ \ \ mergeVladislav Vaintroub2009-12-181-3/+0
| |\ \ \ \ | | |_|/ / | |/| | |
| | * | | Bug #49811: inconsistent usage of SAFEMALLOC in debug compilation on windowsVladislav Vaintroub2009-12-181-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Remove per-project SAFEMALLOCs definitions, as they result in malloc/free mismatches.
| | * | | Backporing patch for Bug#48351 (Inconsistent library names for semisync plugin)Alexander Nozdrin2009-12-152-10/+10
| | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from mysql-next-mr-bugfixing to mysql-trunk-bugfixing. Original revision: ------------------------------------------------------------ revision-id: zhenxing.he@sun.com-20091127084945-wng7gakygduv3q8k committer: He Zhenxing <zhenxing.he@sun.com> branch nick: 5.1-rep-semisync timestamp: Fri 2009-11-27 16:49:45 +0800 message: Bug#48351 Inconsistent library names for semisync plugin The semisync plugin library names on Unix like systems were prefixed with 'lib', which did not follow the conventions. Fix the problem by removing the 'lib' prefix on Unix systems. ------------------------------------------------------------
* | | \ \ \ mergeVladislav Vaintroub2009-12-193-16/+58
|\ \ \ \ \ \ | | |_|_|/ / | |/| | | |
| * | | | | Merge mysql-next-mr (revno 2936) --> mysql-next-mr-marcMarc Alff2009-12-115-92/+40
| |\ \ \ \ \ | | |/ / / /
| * | | | | WL#2360 Performance schemaMarc Alff2009-12-093-16/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part III: mysys instrumentation
* | | | | | mergeVladislav Vaintroub2009-12-114-91/+39
|\ \ \ \ \ \ | | |/ / / / | |/| | | |
| * | | | | Merge from trunk-bugfixingHe Zhenxing2009-12-052-3/+3
| |\ \ \ \ \ | | | |/ / / | | |/| | |
| | * | | | Postfix after merge patch for Bug#49020He Zhenxing2009-12-042-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | plugin/semisync/CMakeLists.txt: Add mysqlservices to link libraries plugin/semisync/Makefile.am: Add mysqlservices to link libraries
| | * | | | Auto merge fixes for Bug#49020He Zhenxing2009-12-042-81/+29
| | |\ \ \ \ | | | |/ / / | | |/| | |
| * | | | | Auto merge from 5.1-rep-semisyncHe Zhenxing2009-12-052-81/+29
| |\ \ \ \ \ | | | |_|_|/ | | |/| | |
| | * | | | Auto merge postfix of Bug#49020He Zhenxing2009-12-041-2/+3
| | |\ \ \ \ | | | | |/ / | | | |/| |
| | | * | | Post fix for previous patch of Bug#49020He Zhenxing2009-12-041-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added back n_frees, use 'clear' instead of 'free' since memory is not freed here. plugin/semisync/semisync_master.cc: Added back n_frees, use 'clear' instead of 'free' in the message since memory is not freed here.
| | * | | | Auto merge fix for Bug#49020He Zhenxing2009-12-042-80/+27
| | |\ \ \ \ | | | |/ / / | | | | | / | | | |_|/ | | |/| |
| | | * | Bug#49020 Semi-sync master crashed with free_pool == NULL, assertion ↵He Zhenxing2009-12-042-80/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `free_pool_' Before this patch, semisync assumed transactions running in parallel can not be larger than max_connections, but this is not true when the event scheduler is executing events, and cause semisync run out of preallocated transaction nodes. Fix the problem by allocating transaction nodes dynamically. This patch also fixed a possible deadlock when running UNINSTALL PLUGIN rpl_semi_sync_master and updating in parallel. Fixed by releasing the internal Delegate lock before unlock the plugins. mysql-test/suite/rpl/t/rpl_semi_sync_event.test: Add test case for bug#49020 plugin/semisync/semisync_master.cc: Allocating TranxNode dynamically plugin/semisync/semisync_master.h: Allocating TranxNode dynamically sql/rpl_handler.cc: Unlock plugins after we have released the Delegate lock to avoid possible deadlock when uninstalling semisync master plugin and doing update in parallel.