1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-14 13:41:20 +03:00
Commit Graph

1024 Commits

Author SHA1 Message Date
28b4037242 Merge branch '11.2' into 11.3 2023-09-21 14:15:04 +04:00
e0949cd6f0 MDEV-32013 Add Field::val_lex_string_strmake()
There are two functions to extract a Field::val_str() value
as a LEX_STRING or LEX_CSTRING pointing to the data allocated on a MEM_ROOT:

  char *get_field(MEM_ROOT *mem, Field *field);
  bool get_field(MEM_ROOT *mem, Field *field, class String *res);

The first function requires strlen() calls to make a LEX_CSTRING/LEX_STRING.
The second function requires a redundant String buffer,
which is used only as a temporary proxy value pointing to a MEM_ROOT fragment
(and does not use any String dynamic allocation methods).

This patch add a native way to extract a Field::val_str() value
as a LEX_STRING or LEX_CSTRING pointing to a MEM_ROOT fragment.
It helps to remove redundant strlen() calls and redundant String buffers.

- Adding a new method:

    LEX_STRING Field::val_lex_string_strmake(MEM_ROOT *mem);

- Reusing the new method Field::val_lex_string_strmake() in;

    bool get_field(MEM_ROOT *mem, Field *field, String *res);

  Also, moving it from table.cc to a static function in sql_help.cc.
  It is used in sql_help.cc only, and we don't want it to be reused
  in other parts of the code (to avoid redundant String buffers).

- Reusing the new method Field::val_lex_string_strmake() in this function:

    char *get_field(MEM_ROOT *mem, Field *field);

- Replacing get_field() to Field::val_lex_string_strmake() in these files:

    sql_plugin.cc  (redundant String buffers were removed)
    sql_udf.cc     (redundant strlen() calls were removed)

Note, this function:

   char *get_field(MEM_ROOT *mem, Field *field);

is still used in a number of files:

   event_data_objects.cc
   event_db_repository.cc
   sql_acl.cc
   sql_servers.cc

These remaining calls will be removed by separate patches,
and get_field() will be removed after that.
2023-08-25 16:06:34 +04:00
51f9d62005 Merge branch '10.11' into 11.0 2023-08-09 07:53:48 +02:00
34a8e78581 Merge branch '10.6' into 10.9 2023-08-04 08:01:06 +02:00
6bf8483cac Merge branch '10.5' into 10.6 2023-08-01 15:08:52 +02:00
7564be1352 Merge branch '10.4' into 10.5 2023-07-26 16:02:57 +02:00
734583b0d7 MDEV-31400 Simple plugin dependency resolution
We introduce simple plugin dependency. A plugin init function may
return HA_ERR_RETRY_INIT. If this happens during server startup when
the server is trying to initialise all plugins, the failed plugins
will be retried, until no more plugins succeed in initialisation or
want to be retried.

This will fix spider init bugs which is caused in part by its
dependency on Aria for initialisation.

The reason we need a new return code, instead of treating every
failure as a request for retry, is that it may be impossible to clean
up after a failed plugin initialisation. Take InnoDB for example, it
has a global variable `buf_page_cleaner_is_active`, which may not
satisfy an assertion during a second initialisation try, probably
because InnoDB does not expect the initialisation to be called
twice.
2023-07-25 18:24:20 +10:00
2e431ff7e6 Merge 10.11 into 11.0 2023-02-16 13:34:45 +02:00
6418c24c94 Set thd->query() for internal (startup) transactions
This helps with debugging as 'Query: ' in DBUG traces will show something
useful, for internal transactions, instead of just "".
2023-02-03 10:34:49 +03:00
b923b80cfd Merge branch '10.6' into 10.7 2023-01-31 09:33:58 +01:00
c3a5cf2b5b Merge branch '10.5' into 10.6 2023-01-31 09:31:42 +01:00
7fa02f5c0b Merge branch '10.4' into 10.5 2023-01-27 13:54:14 +01:00
db50919f97 MDEV-27631 Assertion `global_status_var.global_memory_used == 0' failed in mysqld_exit
plugin_vars_free_values() was walking plugin sysvars and thus
did not free memory of plugin PLUGIN_VAR_NOSYSVAR vars.

* change it to walk all plugin vars
* add the pluginname_ prefix to NOSYSVARS var names too,
  so that plugin_vars_free_values() would be able to find their
  bookmarks
2023-01-20 15:44:15 +01:00
5fdbb3a72e Merge 10.6 into 10.7 2022-09-05 14:55:47 +03:00
9fefd440b5 Merge 10.5 into 10.6 2022-09-05 14:05:30 +03:00
ba987a46c9 Merge 10.4 into 10.5 2022-09-05 13:28:56 +03:00
2917bd0d2c Reduce compilation dependencies on wsrep_mysqld.h
Making changes to wsrep_mysqld.h causes large parts of server code to
be recompiled. The reason is that wsrep_mysqld.h is included by
sql_class.h, even tough very little of wsrep_mysqld.h is needed in
sql_class.h. This commit introduces a new header file, wsrep_on.h,
which is meant to be included from sql_class.h, and contains only
macros and variable declarations used to determine whether wsrep is
enabled.
Also, header wsrep.h should only contain definitions that are also
used outside of sql/. Therefore, move WSREP_TO_ISOLATION* and
WSREP_SYNC_WAIT macros to wsrep_mysqld.h.

Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
2022-08-31 11:05:23 +03:00
1d48041982 Merge branch '10.6' into 10.7 2022-08-08 17:12:32 +02:00
d2f1c3ed6c Merge branch '10.5' into bb-10.6-release 2022-08-03 12:19:59 +02:00
af143474d8 Merge branch '10.4' into 10.5 2022-08-03 07:12:27 +02:00
48e35b8cf6 Merge branch '10.3' into 10.4 2022-08-02 14:15:39 +02:00
40c2460d8c in INFORMATION_SCHEMA.ALL_PLUGINS match installed plugins better
look for an installed plugin with the same name _and the same type_
(in case there are many plugins with the same name and different type,
which is, technically, possible for built-in plugins).
2022-08-01 11:11:45 +02:00
fd132be117 Merge branch '10.6' into 10.7 2022-05-11 11:25:33 +02:00
3bc98a4ec4 Merge branch '10.5' into 10.6 2022-05-10 14:01:23 +02:00
ef781162ff Merge branch '10.4' into 10.5 2022-05-09 22:04:06 +02:00
a70a1cf3f4 Merge branch '10.3' into 10.4 2022-05-08 23:03:08 +02:00
6f6c74b0d1 Merge branch '10.2' into 10.3 2022-04-21 10:05:50 +02:00
c05fd70097 MDEV-26323 use-after-poison issue of MariaDB server 2022-04-14 17:12:30 +04:00
507084517f Merge 10.6 into 10.7 2022-02-22 12:47:48 +02:00
92f79a22e6 Merge 10.5 into 10.6 2022-02-22 12:12:49 +02:00
a112a80b47 Merge 10.4 into 10.5 2022-02-22 10:35:16 +03:00
f6f055a191 Merge 10.3 into 10.4 2022-02-21 14:10:27 +03:00
66f55a018b MDEV-27730 Add PLUGIN_VAR_DEPRECATED flag to plugin variables
The sys_var class has the deprecation_substitute member to mark the
deprecated variables. As it's set, the server produces warnings when
these variables are used. However, the plugin has no means to utilize
that functionality.

So, the PLUGIN_VAR_DEPRECATED flag is introduced to set the
deprecation_substitute with the empty string. A non-empty string can
make the warning more informative, but there's no nice way seen to
specify it, and not that needed at the moment.
2022-02-18 13:10:20 +09:00
9ed8deb656 Merge branch '10.6' into 10.7 2022-02-04 14:11:46 +01:00
f5c5f8e41e Merge branch '10.5' into 10.6 2022-02-03 17:01:31 +01:00
cf63eecef4 Merge branch '10.4' into 10.5 2022-02-01 20:33:04 +01:00
a576a1cea5 Merge branch '10.3' into 10.4 2022-01-30 09:46:52 +01:00
41a163ac5c Merge branch '10.2' into 10.3 2022-01-29 15:41:05 +01:00
47e18af906 MDEV-27494 Rename .ic files to .inl 2022-01-17 16:41:51 +01:00
a010959a56 MDEV-26774 Compression provider unloading at runtime has no effect but doesn't produce a warning 2021-10-27 15:55:14 +02:00
9e32f229d4 plugin can signal that it cannot be unloaded by failing deinit()
if plugin->deinit() returns a failure, it is no longer ignored, it
means that the plugin isn't ready to be unloaded from memory yet.
So it's marked "dying", deinitialized as much as possible,
but stays in memory until shutdown.

also:

* increment MARIA_PLUGIN_INTERFACE_VERSION
* rewrite ha_rocksdb to use the new approach, update the test
2021-10-27 15:55:14 +02:00
06a8412b16 cleanup: plugin unload
* reduce code duplication
2021-10-27 15:55:14 +02:00
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
af8b2c6cec MDEV-26637: (plugin) ASAN: main.metadata and user_variables.basic MTR failures after MDEV-26572
Get rid of locking "empty" plugin.
This problem present in our tests in case of malformed frm-file, for example.
2021-10-12 10:15:06 +02:00
6efb5e9f5e Merge branch '10.5' into 10.6 2021-08-02 10:11:41 +02:00
ae6bdc6769 Merge branch '10.4' into 10.5 2021-07-31 23:19:51 +02:00
7841a7eb09 Merge branch '10.3' into 10.4 2021-07-31 22:59:58 +02:00
6ed47508c8 add const qualifiers to sys_var::value_ptr functions and fix const casts
This is important since Sys_var_typelib and its descendants return
pointers to constant symbols from *_value_ptr, which are situated in
write-protected-memory.

* functions const-qualified:
  - value_ptr
  - session_value_ptr
  - global_value_ptr
  - default_value_ptr
  - Sys_var_vers_asof::value_ptr
  - other minor private ones

* remove C-style typecasts when it discards qualifiers
2021-07-27 14:15:01 +03:00
3d6eb7afcf MDEV-25602 get rid of __WIN__ in favor of standard _WIN32
This fixed the MySQL bug# 20338 about misuse of double underscore
prefix __WIN__, which was old MySQL's idea of identifying Windows
Replace it by _WIN32 standard symbol for targeting Windows OS
(both 32 and 64 bit)

Not that connect storage engine is not fixed in this patch (must be
fixed in "upstream" branch)
2021-06-06 13:21:03 +02:00
83e529eced MDEV-18465 Logging of DDL statements during backup
Many of the changes was needed to be able to collect and print engine
name and table version id's in the ddl log.
2021-05-19 22:54:13 +02:00