Commit graph

10 commits

Author SHA1 Message Date
Kent Boortz
02e07e3b51 Updated/added copyright headers 2011-06-30 17:46:53 +02:00
Tor Didriksen
029a5df870 Bug #58699 cannot build with gcc dbg on solaris
cmake/os/SunOS.cmake:
  Remove TARGET_OS_SOLARIS
config.h.cmake:
  Remove TARGET_OS_SOLARIS
  Add PTHREAD_ONCE_INITIALIZER
configure.cmake:
  Add function for testing whether we need { PTHREAD_ONCE_INIT } rather than PTHREAD_ONCE_INIT
include/my_pthread.h:
  Use PTHREAD_ONCE_INITIALIZER if set by cmake.
include/mysql/psi/mysql_file.h:
  Include my_global.h first, to get correct platform definitions.
mysys/ptr_cmp.c:
  Hide the unused static functions in #ifdef's on solaris.
  Use __sun (defined by both gcc and SunPro cc) rather than TARGET_OS_SOLARIS
sql/my_decimal.cc:
  Include my_global.h first, to get correct platform definitions.
sql/mysqld.cc:
  Fix signed/unsigned comparison warning.
sql/sql_audit.h:
  Include my_global.h first, to get correct platform definitions.
sql/sql_plugin.h:
  Include my_global.h first, to get correct platform definitions.
sql/sql_show.cc:
  Fix: warning: cast from pointer to integer of different size
sql/sys_vars.h:
  Use reinterpret_cast rather than c-style cast.
storage/perfschema/pfs_instr.cc:
  Include my_global.h first, to get correct platform definitions.
2010-12-21 13:00:26 +01:00
Sergey Vojtovich
9a3e46c520 WL#5571 - Audit interface: MYSQL_AUDIT_GENERAL_STATUS event
include/mysql/plugin_audit.h:
  Connection auditing class.
include/mysql/plugin_audit.h.pp:
  Connection auditing class.
sql/mysqld.cc:
  Notify disconnect to auditing.
sql/sql_audit.cc:
  Connection class event dispatcher.
sql/sql_audit.h:
  mysql_audit_notify() is not available in embedded.
sql/sql_connect.cc:
  Notify connect to auditing.
sql/sql_parse.cc:
  Notify user change to auditing.
2010-12-14 17:34:23 +03:00
Alexander Barkov
185e189da3 Bug#57306 SHOW PROCESSLIST does not display string literals well.
Problem: Extended characters outside of ASCII range where not displayed
properly in SHOW PROCESSLIST, because thd_info->query was always sent as 
system_character_set (utf8). This was wrong, because query buffer
is never converted to utf8 - it is always have client character set.

Fix: sending query buffer using query character set

  @ sql/sql_class.cc
  @ sql/sql_class.h
    Introducing a new class CSET_STRING, a LEX_STRING with character set.
    Adding set_query(&CSET_STRING)
    Adding reset_query(), to use instead of set_query(0, NULL).

  @ sql/event_data_objects.cc
    Using reset_query()

  @ sql/log_event.cc
    Using reset_query()
    Adding charset argument to set_query_and_id().

  @ sql/slave.cc
    Using reset_query().

  @ sql/sp_head.cc
    Changing backing up and restore code to use CSET_STRING.

  @ sql/sql_audit.h
    Using CSET_STRING.
    In the "else" branch it's OK not to use
    global_system_variables.character_set_client.
    &my_charset_latin1, which is set in constructor, is fine
    (verified with Sergey Vojtovich).

  @ sql/sql_insert.cc
    Using set_query() with proper character set: table_name is utf8.

  @ sql/sql_parse.cc
    Adding character set argument to set_query_and_id().
    (This is the main point where thd->charset() is stored
     into thd->query_string.cs, for use in "SHOW PROCESSLIST".)
    Using reset_query().
    
  @ sql/sql_prepare.cc
    Storing client character set into thd->query_string.cs.

  @ sql/sql_show.cc
    Using CSET_STRING to fetch and send charset-aware query information
    from threads.

  @ storage/myisam/ha_myisam.cc
    Using set_query() with proper character set: table_name is utf8.

  @ mysql-test/r/show_check.result
  @ mysql-test/t/show_check.test
    Adding tests
2010-11-18 17:08:32 +03:00
Georgi Kodinov
353739fdef merge of mysql-5.5 into mysql-5.5-wl1054 2010-09-20 17:17:32 +03:00
Sergey Vojtovich
b51c8cab3e BUG#54989 - With null_audit installed, server hangs on an
attempt to install a plugin twice

Server crashes when [UN]INSTALL PLUGIN fails (returns an
error) and general log is disabled and there are audit
plugins interested in MYSQL_AUDIT_GENERAL_CLASS. 

When audit event is triggered, audit subsystem acquires interested
plugins by walking through plugin list. Evidently plugin list
iterator protects plugin list by acquiring LOCK_plugin, see
plugin_foreach_with_mask().

On the other hand [UN]INSTALL PLUGIN is acquiring LOCK_plugin
rather for a long time.

When audit event is triggered during [UN]INSTALL PLUGIN, plugin
list iterator acquires the same lock (within the same thread)
second time.

Repeatable only with general_log disabled, because general_log
triggers MYSQL_AUDIT_GENERAL_LOG event, which acquires audit
plugins before [UN]INSTALL PLUGIN acquired LOCK_plugin.

With this fix we pre-acquire audit plugins for events that
may potentially occur during [UN]INSTALL PLUGIN.

This hack should be removed when LOCK_plugin is fixed so it
protects only what it supposed to protect.

No test case for this fix - we do not have facility to test
audit plugins yet.

sql/sql_audit.cc:
  Move "acquire audit plugin" logics to a separate
  function.
sql/sql_audit.h:
  Move "acquire audit plugin" logics to a separate
  function.
sql/sql_plugin.cc:
  Pre-acquire audit plugins for events that may potentially occur
  during [UN]INSTALL PLUGIN.
2010-08-20 13:58:28 +04:00
Georgi Kodinov
9705711596 WL#1054: Pluggable authentication support
Merged the implementation to a new base tree.
2010-08-09 11:32:50 +03:00
Mats Kindahl
23d8586dbf WL#5030: Split and remove mysql_priv.h
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
2010-03-31 16:05:33 +02:00
Sergey Vojtovich
9130563708 Backport from 6.0-codebase.
Bug #36098 Audit plugin (wl 3771) feature disabled in 6.0
avoid recusrive locking of LOCK_plugin

include/mysql/plugin_audit.h:
  fix incorrect version
sql/log.cc:
  move the common code to a shared header
sql/mysqld.cc:
  restore the deleted functionality
sql/set_var.cc:
  remove unused parameter
sql/sql_audit.h:
  two inline convenience functions
sql/sql_parse.cc:
  use a simplified convenience call
sql/sql_plugin.cc:
  unlock LOCK_plugin for plugin->init() call, add missing OOM check,
  issue "unknown variable" error in find_sys_var, not down the stack
2009-12-16 15:56:36 +04:00
Sergey Vojtovich
45f2e0a7aa Backport from 6.0-codebase.
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
2009-12-15 23:52:47 +04:00