maria:bb-11.4-bar-MDEV-32380

Last commit made on 2024-02-19
Get this branch:
git clone -b bb-11.4-bar-MDEV-32380 https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-11.4-bar-MDEV-32380
Repository:
lp:maria

Recent commits

0a3a4f2... by Alexander Barkov

MDEV-32380 Array data type for stored routnes

43e4e3f... by Alexander Barkov

MDEV-12252 ROW data type for stored function return values

Adding support for the ROW data type in the stored function RETURNS clause:

- explicit ROW(..members...) for both sql_mode=DEFAULT and sql_mode=ORACLE

  CREATE FUNCTION f1() RETURNS ROW(a INT, b VARCHAR(32)) ...

- anchored "ROW TYPE OF [db1.]table1" declarations for sql_mode=DEFAULT

  CREATE FUNCTION f1() RETURNS ROW TYPE OF test.t1 ...

- anchored "[db1.]table1%ROWTYPE" declarations for sql_mode=ORACLE

  CREATE FUNCTION f1() RETURN test.t1%ROWTYPE ...

Adding support for anchored scalar data types in RETURNS clause:

- "TYPE OF [db1.]table1.column1" for sql_mode=DEFAULT

  CREATE FUNCTION f1() RETURNS TYPE OF test.t1.column1;

- "[db1.]table1.column1" for sql_mode=ORACLE

  CREATE FUNCTION f1() RETURN test.t1.column1%TYPE;

Details:

- Adding a new sql_mode_t parameter to
    sp_head::create()
    sp_head::sp_head()
    sp_package::create()
    sp_package::sp_package()
  to guarantee early initialization of sp_head::m_sql_mode.
  Before this change, this member was not initialized at all during
  CREATE FUNCTION/PROCEDURE/PACKAGE statements, and was not used.
  Now it needs to be initialized to write properly the
  mysql.proc.returns column, according to the create time sql_mode.

- Moving the code from the loop body in sp_rcontext::init_var_items()
  into a separate member Spvar_definition::make_item_field_row(),
  to reuse this code for variable/parameter definitions
  and for the RETURNS clause.

- Changing the data type of sp_head::m_return_field_def
  from Column_definition to Spvar_definition.
  So now it supports not only SQL column field types,
  but also explicit ROW and anchored ROW data types.

- Modifying sql_yacc.yy to support the new grammar.
  Adding new helper methods:
    * sf_return_fill_definition_row()
    * sf_return_fill_definition_rowtype_of()
    * sf_return_fill_definition_type_of()

- Fixing tests in:
  * Virtual_tmp_table::setup_field_pointers() in sql_select.cc
  * Send_field::normalize() in field.h
  to prevent calling Type_handler_row::field_type(),
  which is implemented a DBUG_ASSERT(0).
  Before this patch the affected methods were called only
  for scalar data types. Now ROW is also possible.

- Adding a new virtual method Field::cols()

- Overriding methods:
   Item_func_sp::cols()
   Item_func_sp::element_index()
   Item_func_sp::check_cols()
   Item_func_sp::bring_value()
  to support the ROW data type.

- Extending sp_returns_type() to support
  * explicit ROW and anchored ROW data types
  * anchored scalar data types

- Overriding Field_row::sql_type() to print
  the data type of an explicit ROW.

6b2287f... by Daniel Black

MDEV-15543: tmpfile.d not for datadir

With the default datadir path of /var/lib/mysql the same
as the path of the unix socket, this tmpfiles.d file
was generated to "create" a datadir. This wasn't intended.

In this case we comment out the entry and explain why.

Add extra ideas on other temporary directories that
may be specified in this file.

a119c5f... by Libing Song <email address hidden>

MDEV-32589 FULL_NODUP mode for binlog_row_image

This patch provides a new mode FULL_NODUP to binlog_row_image system
variable. With FULL_NODUP mode, all columns are included in before
image, but only updated columns are included in after image for UPDATE.
While all columns are included in the after image for INSERT.

FULL_NODUP is for replacing FULL mode. It includes all data of
the before and after image as FULL mode, but it uses less storage
especially in the case that only a few columns are updated.

Note: It will binlog full before and after image for all modes if the
      table has no primary key. FULL_NODUP follows the behavior.

6218b5f... by Daniel Black

MDEV-32567 Remove thr_alarm from server codebase - socket activation fix

Systemd socket activation cannot handle a shutdown on the file
descriptor[1].

Enumerate past the socket activation descriptors.

If there was no shutdown to trigger the breaking of the event loop,
then write to the termination_event_fd that was setup during
the socket activation code for this purpose.

As abort_loop= true is already set at the top of break_connect_loop,
and this is checked in loop before sockets are processed, no
additional checking to read from the termination_event_fd is needed.

Without socket activation defined, or used, termination_event_fd keeps
its -1 default value.

Close the eventfd outside the while loop so retries can happen if
the write fails for some reason.

ref[1]: https://www.freedesktop.org/software/systemd/man/latest/sd_listen_fds.html

Reviewed by: Vladislav Vaintroub

f8600b1... by VladislavVaintroub

MDEV-32567 Remove thr_alarm from server codebase

Remove alarm() remnants

- Replace thread-unsafe use of alarm() inside my_lock.c with a
  timed loop.
- Remove configure time checks
- Remove mysys my_alarm.c/my_alarm.h

013fc02... by VladislavVaintroub

MDEV-32567 Remove thr_alarm from server codebase

This allows to simplify net_real_read() and net_real_write() a bit.

Removed some superfluous #ifdef/ifndef MYSQL_SERVER from net_serv.cc
The code always runs in server, either normal or embedded.
Dead code for switching socket between blocking and non-blocking modes,
is also removed.

Removed pthread_kill() with alarm signal that woke up main thread on
server shutdown. Used shutdown(2) on polling sockets instead, to the same
effect.

Removed yet another superstitious pthread_kill(), that ran on non-Windows
in terminate_slave_thread().

3424ed7... by VladislavVaintroub

MDEV-32189 Use icu for timezones on windows

Use ICU to work with timezones, to retrieve current timezone name,
abbreviation, and offset from GMT. However in case TZ environment variable
is used to set timezone, and ICU does not have corresponding one,
C runtime functions will be used.

Moved some of timezone handling to mysys.
Added unit tests.

bb8e1bf... by VladislavVaintroub

Merge 11.3 into 11.4

99a3fe5... by =?utf-8?q?Jan_Lindstr=C3=B6m?= <email address hidden>

MDEV-31273: Precompute binlog checksums

After b8f9f796 Format_description_log_event constructor
requires binlog checksum algorithm or BINLOG_CHECKSUM_ALG_OFF
for Galera also.

Thanks to Kristian Nielsen <email address hidden>
for pointing a fix.