Commit graph

94 commits

Author SHA1 Message Date
Eric Herman
401ff6994d MDEV-26221: DYNAMIC_ARRAY use size_t for sizes
https://jira.mariadb.org/browse/MDEV-26221
my_sys DYNAMIC_ARRAY and DYNAMIC_STRING inconsistancy

The DYNAMIC_STRING uses size_t for sizes, but DYNAMIC_ARRAY used uint.
This patch adjusts DYNAMIC_ARRAY to use size_t like DYNAMIC_STRING.

As the MY_DIR member number_of_files is copied from a DYNAMIC_ARRAY,
this is changed to be size_t.

As MY_TMPDIR members 'cur' and 'max' are copied from a DYNAMIC_ARRAY,
these are also changed to be size_t.

The lists of plugins and stored procedures use DYNAMIC_ARRAY,
but their APIs assume a size of 'uint'; these are unchanged.
2021-10-19 16:00:26 +03:00
Sergei Golubchik
25d9d2e37f Merge branch 'bb-10.4-release' into bb-10.5-release 2021-02-15 16:43:15 +01:00
Sergei Golubchik
00a313ecf3 Merge branch 'bb-10.3-release' into bb-10.4-release
Note, the fix for "MDEV-23328 Server hang due to Galera lock conflict resolution"
was null-merged. 10.4 version of the fix is coming up separately
2021-02-12 17:44:22 +01:00
Sergei Golubchik
60ea09eae6 Merge branch '10.2' into 10.3 2021-02-01 13:49:33 +01:00
Sergei Golubchik
63f9192787 MDEV-17251 SHOW STATUS unnecessary calls calc_sum_of_all_status
1. only call calc_sum_of_all_status() if a global
   SHOW_xxx_STATUS variable is to be returned
2. only lock LOCK_status when copying global_status_var,
   but not when iterating all threads
2021-01-11 21:54:47 +01:00
Marko Mäkelä
fbe2712705 Merge 10.4 into 10.5
The functional changes of commit 5836191c8f
(MDEV-21168) are omitted due to MDEV-742 having addressed the issue.
2020-04-25 21:57:52 +03:00
Sergey Vojtovich
4bd9f82a8f slave_open_temp_tables to Atomic_counter 2020-04-15 21:05:21 +04:00
Sergei Golubchik
8ab693847e cleanup: remove unused PLUGIN_INIT_SKIP_DYNAMIC_LOADING 2020-03-31 17:42:33 +02:00
Marko Mäkelä
e82fe21e3a Merge 10.2 into 10.3 2019-07-02 17:46:22 +03:00
Eugene Kosov
ddeeb42e0b Merge 10.1 into 10.2 2019-06-23 20:33:13 +03:00
Alexey Botchkov
65e0c9b91b MDEV-18661 loading the audit plugin causes performance regression.
Plugin fixed to not lock the LOCK_operations when not active.
Server fixed to lock the LOCK_plugin less - do it once per
thread and then only if a plugin was installed/uninstalled.
2019-06-15 01:02:55 +04:00
Marko Mäkelä
be85d3e61b Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
Marko Mäkelä
26a14ee130 Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
Vicențiu Ciorbaru
cb248f8806 Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
Vicențiu Ciorbaru
5543b75550 Update FSF Address
* Update wrong zip-code
2019-05-11 21:29:06 +03:00
Sergey Vojtovich
894df7edb6 Adieu find_sys_var_ex()
Only take LOCK_plugin for plugin system variables.

Reverted optimisation that was originally done for session tracker: it
makes much less sense now. Specifically only if connections would want to
track plugin session variables changes and these changes would actually
happen frequently. If this ever becomes an issue, there're much better
ways to optimise this workload.

Part of MDEV-14984 - regression in connect performance
2019-05-03 16:46:11 +04:00
Monty
f55dc7f733 Change C_STRING_WITH_LEN to STRING_WITH_LEN
This preserves const str for constant strings

Other things
- A few variables where changed from LEX_STRING to LEX_CSTRING
- Incident_log_event::Incident_log_event and record_incident where
  changed to take LEX_CSTRING* as an argument instead of LEX_STRING
2018-01-30 21:33:56 +02:00
Sergey Vojtovich
159a6c2e60 MDEV-14505 - Threads_running becomes scalability bottleneck
Instead of updating global counter, calculate Threads_running on the fly.
All threads having command != COM_SLEEP are included.

Behaviour changes:

Previously SHOW STATUS and SHOW GLOBAL STATUS returned the same values
representing global status. Now SHOW STATUS always returns 1 indicating that
current session has 1 thread running.

Previously only threads that were executing dispatch_command() or running events
were accounted by Threads_running. Now it is rough equivalent of
SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE state!='Sleep'
2017-12-13 12:46:33 +04:00
Michael Widenius
4aaa38d26e Enusure that my_global.h is included first
- Added sql/mariadb.h file that should be included first by files in sql
  directory, if sql_plugin.h is not used (sql_plugin.h adds SHOW variables
  that must be done before my_global.h is included)
- Removed a lot of include my_global.h from include files
- Removed include's of some files that my_global.h automatically includes
- Removed duplicated include's of my_sys.h
- Replaced include my_config.h with my_global.h
2017-08-24 01:05:44 +02:00
Monty
5a759d31f7 Changing field::field_name and Item::name to LEX_CSTRING
Benefits of this patch:
- Removed a lot of calls to strlen(), especially for field_string
- Strings generated by parser are now const strings, less chance of
  accidently changing a string
- Removed a lot of calls with LEX_STRING as parameter (changed to pointer)
- More uniform code
- Item::name_length was not kept up to date. Now fixed
- Several bugs found and fixed (Access to null pointers,
  access of freed memory, wrong arguments to printf like functions)
- Removed a lot of casts from (const char*) to (char*)

Changes:
- This caused some ABI changes
  - lex_string_set now uses LEX_CSTRING
  - Some fucntions are now taking const char* instead of char*
- Create_field::change and after changed to LEX_CSTRING
- handler::connect_string, comment and engine_name() changed to LEX_CSTRING
- Checked printf() related calls to find bugs. Found and fixed several
  errors in old code.
- A lot of changes from LEX_STRING to LEX_CSTRING, especially related to
  parsing and events.
- Some changes from LEX_STRING and LEX_STRING & to LEX_CSTRING*
- Some changes for char* to const char*
- Added printf argument checking for my_snprintf()
- Introduced null_clex_str, star_clex_string, temp_lex_str to simplify
  code
- Added item_empty_name and item_used_name to be able to distingush between
  items that was given an empty name and items that was not given a name
  This is used in sql_yacc.yy to know when to give an item a name.
- select table_name."*' is not anymore same as table_name.*
- removed not used function Item::rename()
- Added comparision of item->name_length before some calls to
  my_strcasecmp() to speed up comparison
- Moved Item_sp_variable::make_field() from item.h to item.cc
- Some minimal code changes to avoid copying to const char *
- Fixed wrong error message in wsrep_mysql_parse()
- Fixed wrong code in find_field_in_natural_join() where real_item() was
  set when it shouldn't
- ER_ERROR_ON_RENAME was used with extra arguments.
- Removed some (wrong) ER_OUTOFMEMORY, as alloc_root will already
  give the error.

TODO:
- Check possible unsafe casts in plugin/auth_examples/qa_auth_interface.c
- Change code to not modify LEX_CSTRING for database name
  (as part of lower_case_table_names)
2017-04-23 22:35:46 +03:00
Marko Mäkelä
89d80c1b0b Fix many -Wconversion warnings.
Define my_thread_id as an unsigned type, to avoid mismatch with
ulonglong.  Change some parameters to this type.

Use size_t in a few more places.

Declare many flag constants as unsigned to avoid sign mismatch
when shifting bits or applying the unary ~ operator.

When applying the unary ~ operator to enum constants, explictly
cast the result to an unsigned type, because enum constants can
be treated as signed.

In InnoDB, change the source code line number parameters from
ulint to unsigned type. Also, make some InnoDB functions return
a narrower type (unsigned or uint32_t instead of ulint;
bool instead of ibool).
2017-03-07 19:07:27 +02:00
Nirbhay Choubey
6bb6f30ff9 MDEV-9312: storage engine not enforced during galera cluster replication
Perform a post initialization of plugin-related variables
of wsrep threads after their global counterparts have been
initialized.
2016-11-07 11:53:56 -05:00
Nirbhay Choubey
7c525ce36b MDEV-9312: storage engine not enforced during galera cluster replication
Perform a post initialization of plugin-related variables
of wsrep threads after their global counterparts have been
initialized.
2016-09-28 13:26:13 -04:00
Sergei Golubchik
06b7fce9f2 Merge branch '10.1' into 10.2 2016-09-09 08:33:08 +02:00
Oleksandr Byelkin
c8948b0d0d MDEV-8931: (server part of) session state tracking
System variables tracking
2016-08-31 17:17:46 +02:00
Oleksandr Byelkin
e7608a78ef MDEV-8931: (server part of) session state tracking
initial commit to test
2016-08-31 17:17:46 +02:00
Sergei Golubchik
6b1863b830 Merge branch '10.0' into 10.1 2016-08-25 12:40:09 +02:00
Sergei Golubchik
309c08c17c Merge branch '5.5' into 10.0 2016-08-10 19:19:05 +02:00
Vladislav Vaintroub
511313b9d6 MDEV-10010 - potential deadlock on windows due to recursive
SRWLock acquisition

Backport patch from 10.1
2016-08-03 13:42:46 +00:00
Sergey Vojtovich
ecb27d2650 MDEV-10010 - Recursive call to mysql_rwlock_rdlock for LOCK_system_variables_hash
Avoid recursive LOCK_system_variables_hash acquisition in
intern_sys_var_ptr() by pre-syncing dynamic session variables.
2016-07-08 23:38:05 +04:00
Sergei Golubchik
3361aee591 Merge branch '10.0' into 10.1 2016-06-28 22:01:55 +02:00
Vladislav Vaintroub
69f1a3215e Replace dynamic loading of mysqld.exe data for plugins, replace with MYSQL_PLUGIN_IMPORT 2016-06-21 19:20:11 +02:00
Monty
d7d589dc01 Push for testing of encryption 2015-02-10 10:21:17 +01:00
Oleksandr Byelkin
1827d9e6d1 MDEV-5231: Per query variables from Percona Server (rewritten) 2014-11-11 11:48:50 +01:00
Sergei Golubchik
5389300f49 cleanup: option_type -> scope 2014-10-10 22:27:41 +02:00
Sergei Golubchik
f6fcb348ad remove sys_var specific restore_pluginvar_names() function,
use generic restore_ptr_backup() approach
2013-12-09 12:39:19 +01:00
Sergei Golubchik
47ee721923 MDEV-4403 Attempting to use cassandra storage engine causes "service 'my_snprintf_service' interface version mismatch"
When a DSO is loaded we rewrite service pointers to point to the actual service structures.
But when a DSO is unloaded, we have to restore their original values, in case this DSO
wasn't removed from memory on dlclose() and is later loaded again.
2013-12-09 12:39:13 +01:00
Alexander Barkov
1fe92fb87d Fixing the problem with my_bool_t defined two times.
(it worked fine with the modern gcc, but failed on some other compilers).


modified:
  include/my_global.h
  include/mysql/plugin.h
  include/mysql/plugin_audit.h.pp
  include/mysql/plugin_auth.h.pp
  include/mysql/plugin_ftparser.h.pp
  include/mysql/service_thd_timezone.h
  sql/item_func.cc
  sql/mysqld.cc
  sql/set_var.cc
  sql/sql_plugin.cc
  sql/sql_plugin.h
  sql/sql_show.cc
  sql/sys_vars.cc
  storage/perfschema/ha_perfschema.cc
2013-06-03 11:57:34 +04:00
Sergei Golubchik
a9035be5b7 10.0-base merge 2013-04-15 15:09:22 +02:00
Sergei Golubchik
c7eead7a96 MDEV-3807 show plugins soname 'xxx'
and INFORMATION_SCHEMA.ALL_PLUGINS table
with condition pushdown for I_S.ALL_PLUGINS
and a  new status variable to cound successful dlopen's
2013-04-09 23:27:29 +02:00
Sergei Golubchik
5f293dd694 MDEV-4022 table attributes with sysvar as a default value 2013-04-09 23:27:24 +02:00
Sergei Golubchik
0d405ed02f remove long time obsolete xyz_ci() copies of xyz() macros 2013-04-07 15:40:59 +02:00
Sergei Golubchik
2217717ff6 MDEV-3860 backport --plugin-load-add (and related mysql-test changes)
revno: 3383
  revision-id: georgi.kodinov@oracle.com-20110818083108-qa3h3ufqu4zne80a
  committer: Georgi Kodinov <Georgi.Kodinov@Oracle.com>
  timestamp: Thu 2011-08-18 11:31:08 +0300
  message:

  Bug #11766001: 59026: ALLOW MULTIPLE --PLUGIN-LOAD OPTIONS
  
  Implemented support for a new command line option :
  --plugin-load-add=<comma-separated-name-equals-value-list>
  This option takes the same type of arguments that --plugin-load does
  and complements --plugin-load (that continues to operate as before) by
  appending its argument to the list specified by --plugin-load.
  So --plugin-load can be considered a composite option consisting of 
  resetting the plugin load list and then calling --plugin-load-add to process
  the argument.
  Note that the order in which you specify --plugin-load and --plugin-load-add 
  is important : "--plugin-load=x --plugin-load-add=y" will be equivalent to
  "--plugin-load=x,y" whereas "--plugin-load-add=y --plugin-load=x" will be 
  equivalent to "plugin-load=x".
  
  Incompatible change : the --help --verbose command will no longer print the 
  --plugin-load variable's values (as it doesn't have one). Otherwise both --plugin-load 
  and --plugin-load-add are mentioned in it.
2012-12-15 18:24:11 +01:00
Sergei Golubchik
d11829654c merge with MySQL 5.5.27
manually checked every change, reverted incorrect or stupid changes.
2012-08-09 17:22:00 +02:00
Jon Olav Hauglid
66ef5b0d48 Bug#14238406 NEW COMPILATION WARNINGS WITH GCC 4.7 (-WERROR=NARROWING)
Manual merge from mysql-5.1 to mysql-5.5
2012-06-29 13:36:01 +02:00
Sergei Golubchik
6e827f3455 mdev-224 plugin usage statistics in the feedback reports 2012-04-18 04:00:08 +02:00
Sergei Golubchik
1c530b36d1 mdev-20: INSTALL PLUGIN SONAME 2012-03-05 21:48:06 +01:00
Sergei Golubchik
4f435bddfd 5.3 merge 2012-01-13 15:50:02 +01:00
Michael Widenius
6920457142 Merge with MariaDB 5.1 2011-11-24 18:48:58 +02:00
Michael Widenius
a8d03ab235 Initail merge with MySQL 5.1 (XtraDB still needs to be merged)
Fixed up copyright messages.
2011-11-21 19:13:14 +02:00