Commit graph

9387 commits

Author SHA1 Message Date
Marko Mäkelä
d470ed6857 Merge 11.0 into 11.1 2023-12-20 16:11:45 +02:00
Marko Mäkelä
590036b021 Merge 10.11 into 11.0 2023-12-20 16:05:20 +02:00
Marko Mäkelä
2b99e5f7ef Merge 10.6 into 10.11 2023-12-20 15:58:36 +02:00
Sergei Golubchik
7a5448f8da Merge branch '11.0' into 11.1 2023-12-19 20:11:54 +01:00
Marko Mäkelä
2b01e5103d Merge 10.5 into 10.6 2023-12-19 18:41:42 +02:00
Marko Mäkelä
12995559f9 Merge 10.4 into 10.5 2023-12-19 18:30:58 +02:00
Sergei Golubchik
8c8bce05d2 Merge branch '10.11' into 11.0 2023-12-19 15:53:18 +01:00
hsser
be694384d4 MDEV-31925 Fix for File Leak in mysql_upgrade with --check-if-upgrade-is-needed Option
This commit addresses the file leakage problem encountered with the mysql_upgrade --check-if-upgrade-is-needed command.
2023-12-19 19:30:02 +11:00
Sergei Golubchik
fd0b47f9d6 Merge branch '10.6' into 10.11 2023-12-18 11:19:04 +01:00
Marko Mäkelä
4ae105a37d Merge 10.4 into 10.5 2023-12-18 08:59:07 +02:00
Sergei Golubchik
e95bba9c58 Merge branch '10.5' into 10.6 2023-12-17 11:20:43 +01:00
Sergei Golubchik
a2c6d61db8 don't use dynstr_append() in mysqltest.cc
followup for ad796aaa94
2023-12-15 10:26:48 +01:00
Sergei Golubchik
98a39b0c91 Merge branch '10.4' into 10.5 2023-12-02 01:02:50 +01:00
Monty
18166e4501 mysqladmin -vv processlist now shows more information
What is shown in this case is the result from the following query:
select * from information_schema.processlist where id != connection_id()

This allows easy monitoring of for example MAX_MEMORY_USED
2023-11-30 18:40:43 +02:00
Marko Mäkelä
02701a8430 Merge 11.2 into 11.3 2023-11-28 11:19:50 +02:00
Marko Mäkelä
0d29f3759c Merge 11.1 into 11.2 2023-11-28 11:19:06 +02:00
Marko Mäkelä
edc478847b Merge 11.0 into 11.1 2023-11-24 15:58:35 +02:00
Marko Mäkelä
5b6134b040 Merge 10.11 into 11.0 2023-11-24 11:20:56 +02:00
Oleksandr Byelkin
ad796aaa94 Remove unneeded strlen() calls. 2023-11-23 13:20:50 +01:00
Lena Startseva
9e701518e7 MDEV-32177: Add to the ps-protocol a comparison of the result
sets of the first and second execution. The results of the first
and second execution are compared only if result logging is enabled
Comparing two result sets is done as comparing two strings.

Added a new method 'read_stmt_results' to get a result set
after execution of prepare statement.
2023-11-23 13:20:31 +01:00
Oleksandr Byelkin
0ad4839429 Rename variables to make operation comprehansive 2023-11-23 13:19:47 +01:00
Marko Mäkelä
90d968dab9 Merge 10.6 into 10.11 2023-11-20 10:08:19 +02:00
Marko Mäkelä
52ca2e65af Merge 10.5 into 10.6 2023-11-15 14:10:21 +02:00
Oleksandr Byelkin
34272bd6a5 Merge branch '11.2' into 11.3 2023-11-14 18:33:03 +01:00
Oleksandr Byelkin
0427c4739e MariaDB 11.1.3 release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEF39AEP5WyjM2MAMF8WVvJMdM0dgFAmVSLiUACgkQ8WVvJMdM
 0dhj4A/7B2GIx75Mv4IcExE2s4bfR7sOKZzvjWbMHysovMHhsHAV5fHN7dRQojyV
 HxmSY8lxykm/LMoJ8RASmrojRZsgvkJ84z+fLK7is327Vms7fW7ZWc3eqotIgs7I
 m9Dz3+wiexvl6NKeHnafTZtkJOe8MEqZEGPV1e8V4I3SAJQWyQLnRr4si/VmjAMi
 miKuieTuKoZUYSkdNLwicEFHXysgg6/U8367sgMsJe9V3HYSD3pVQJ/nboTL5uZL
 vTbmEPS1pICKPvPu75DdedSdxSASMyXis9/IWtk13NqPPzX16uHtjkhffAuBT3+k
 CUgRggTYAuoF3MjvyspIS3pdC/73PBb1O+w/9vlHPiwSXVn3d48Ay55uvFgM/pVB
 UKLorw+As0oH2N1HWUp/d4Rbvrnjdq5OgzhmMTrWDAtYyrNU9Jw5S1CAp+G/s2dD
 5j+FUPBBnHo5UfxI+EVTqUggm56R+vJTx4H3q82n05bdJTJYNJ+nixvsYuf7hS3f
 oEqJAUizgGI3h6FGPD9bN0HSYGblEeNgAYv1YogfVX/Eq10RriWic9PtxxOxgOmE
 n+UhdH4YTTyaTv0jssWTJVmVNzjjXMvI4aB8A1FkXeIz2iohSziSkJzaBuzNq2QY
 kKHr8XqiyNnckcoRxfoxNPtrWcmiykpHOBFnuyMRWoXPKcr7idc=
 =ShdC
 -----END PGP SIGNATURE-----

Merge tag '11.1' into 11.2

MariaDB 11.1.3 release
2023-11-14 18:28:37 +01:00
Oleksandr Byelkin
9f83a8822f Merge branch '10.5' into mariadb-10.5.23 2023-11-14 08:41:23 +01:00
Oleksandr Byelkin
0f5613a25f Merge branch '11.0' into 11.1 2023-11-08 18:03:08 +01:00
Oleksandr Byelkin
48af85db21 Merge branch '10.11' into 11.0 2023-11-08 17:09:44 +01:00
Oleksandr Byelkin
fecd78b837 Merge branch '10.10' into 10.11 2023-11-08 16:46:47 +01:00
Oleksandr Byelkin
04d9a46c41 Merge branch '10.6' into 10.10 2023-11-08 16:23:30 +01:00
Oleksandr Byelkin
b83c379420 Merge branch '10.5' into 10.6 2023-11-08 15:57:05 +01:00
Oleksandr Byelkin
6cfd2ba397 Merge branch '10.4' into 10.5 2023-11-08 12:59:00 +01:00
Anel Husakovic
4eb8aeee8e MDEV-32462: mysql_upgrade -s still checks for non system tables
- Prevent opening of any user tables in case `upgrade-system-table`
option is used.
- Still there may be uninstalled data types in `mysql` system table so
allow it to perform.
- Closes PR #2790
- Reviewer: <daniel@mariadb.org>, <vicentiu@mariadb.org>
2023-10-30 21:33:06 +01:00
Marko Mäkelä
7b842f1536 Merge 11.2 into 11.3 2023-10-27 10:48:29 +03:00
Yuchen Pei
d0f8dfbcf0
Merge branch '11.1' into 11.2 2023-10-27 18:11:56 +11:00
Marko Mäkelä
9b2a65e41a Merge 11.0 into 11.1 2023-10-19 08:26:16 +03:00
Marko Mäkelä
be24e75229 Merge 10.11 into 11.0 2023-10-19 08:12:16 +03:00
Marko Mäkelä
2ecc0443ec Merge 10.10 into 10.11 2023-10-17 16:04:21 +03:00
Marko Mäkelä
d5e15424d8 Merge 10.6 into 10.10
The MDEV-29693 conflict resolution is from Monty, as well as is
a bug fix where ANALYZE TABLE wrongly built histograms for
single-column PRIMARY KEY.
Also includes a fix for safe_malloc error reporting.

Other things:
- Copied main.log_slow from 10.4 to avoid mtr issue

Disabled test:
- spider/bugfix.mdev_27239 because we started to get
  +Error	1429 Unable to connect to foreign data source: localhost
  -Error	1158 Got an error reading communication packets
- main.delayed
  - Bug#54332 Deadlock with two connections doing LOCK TABLE+INSERT DELAYED
    This part is disabled for now as it fails randomly with different
    warnings/errors (no corruption).
2023-10-14 13:36:11 +03:00
Oleg Smirnov
cbe61bf87f MDEV-30664 mysqldump output is truncated on Windows
Flush stdout on finalizing of mysqldump/mysqlbinlog output
to avoid truncation.

The same patch has been applied to the mysqltest.cc code with
  commit 34ff714b0d
  Author: Magnus Svensson <msvensson@mysql.com>
  Date:   Fri Nov 14 11:06:56 2008 +0100
    WL#4189 Make mysqltest flush log file at close if logfile is stdout

but not to mysqldump.c/mysqlbinlog.cc
2023-10-10 14:04:48 +07:00
Daniel Black
a34b989f0c MDEV-22418 mysqladmin wrong error with simple_password_check
mysqladmin's presumption about the cause of an error by looking
at the error code was presumptious. Server knows best, so pass
the error along.

Avoid returning -1 as a exit code, Linux makes this 255 and Windows
keeps this as -1.
2023-10-06 11:08:47 +03:00
Monty
4e9322e2ff MDEV-32203 Raise notes when an index cannot be used on data type mismatch
Raise notes if indexes cannot be used:
- in case of data type or collation mismatch (diferent error messages).
- in case if a table field was replaced to something else
  (e.g. Item_func_conv_charset) during a condition rewrite.

Added option to write warnings and notes to the slow query log for
slow queries.

New variables added/changed:

- note_verbosity, with is a set of the following options:
  basic            - All old notes
  unusable_keys    - Print warnings about keys that cannot be used
                     for select, delete or update.
  explain          - Print unusable_keys warnings for EXPLAIN querys.

The default is 'basic,explain'. This means that for old installations
the only notable new behavior is that one will get notes about
unusable keys when one does an EXPLAIN for a query. One can turn all
of all notes by either setting note_verbosity to "" or setting sql_notes=0.

- log_slow_verbosity has a new option 'warnings'. If this is set
  then warnings and notes generated are printed in the slow query log
  (up to log_slow_max_warnings times per statement).

- log_slow_max_warnings   - Max number of warnings written to
                            slow query log.

Other things:
- One can now use =ALL for any 'set' variable to set all options at once.
  For example using "note_verbosity=ALL" in a config file or
  "SET @@note_verbosity=ALL' in SQL.
- mysqldump will in the future use @@note_verbosity=""' instead of
  @sql_notes=0 to disable notes.
- Added "enum class Data_type_compatibility" and changing the return type
  of all Field::can_optimize*() methods from "bool" to this new data type.

Reviewer & Co-author: Alexander Barkov <bar@mariadb.com>
- The code that prints out the notes comes mainly from Alexander
2023-10-03 08:25:31 +03:00
Nikita Malyavin
28b4037242 Merge branch '11.2' into 11.3 2023-09-21 14:15:04 +04:00
Dwarf Mason
9f8c5e01ae Add break statement in mysqltest 2023-09-14 06:58:20 +01:00
Marko Mäkelä
0dd25f28f7 Merge 10.5 into 10.6 2023-09-11 14:46:39 +03:00
Marko Mäkelä
f8f7d9de2c Merge 10.4 into 10.5 2023-09-11 11:29:31 +03:00
Sergei Golubchik
4d96dba767 MDEV-25369 mysqlbinlog (mariadb-binlog) -T/--table option
clarify the help text
2023-09-06 22:38:41 +02:00
Sergei Golubchik
18ddde4826 Merge branch '11.1' into 11.2 2023-08-18 00:59:16 +02:00
Oleksandr Byelkin
f5fae75652 Merge branch '11.0' into 11.1 2023-08-09 08:25:14 +02:00
Oleksandr Byelkin
51f9d62005 Merge branch '10.11' into 11.0 2023-08-09 07:53:48 +02:00
Oleksandr Byelkin
036df5f970 Merge branch '10.10' into 10.11 2023-08-08 14:57:31 +02:00
Oleksandr Byelkin
ced243a099 Merge branch '10.9' into 10.10 2023-08-05 20:34:09 +02:00
Oleksandr Byelkin
34a8e78581 Merge branch '10.6' into 10.9 2023-08-04 08:01:06 +02:00
Sergei Golubchik
1ba5a0205c MDEV-31836 mysqldump against MYSQL server 8 creates invalid dump
`select * from information_schema.columns` can return columns in any
order, but we need them ordered by the ordinal position
2023-08-03 14:24:16 +02:00
Oleksandr Byelkin
6bf8483cac Merge branch '10.5' into 10.6 2023-08-01 15:08:52 +02:00
Oleksandr Byelkin
65405308a1 Merge branch '10.4' into 10.5 2023-08-01 11:52:13 +02:00
Sergei Golubchik
ab10a675ac MDEV-31092 mysqldump --force doesn't ignore error as it should
failed SHOW CREATE FUNCTION means we don't dump this function,
but should still try to dump all other functions
2023-07-31 22:46:47 +02:00
Oleksandr Byelkin
f291c3df2c Merge branch '10.4' into 10.5 2023-07-27 15:43:21 +02:00
Lena Startseva
9854fb6fa7 MDEV-31003: Second execution for ps-protocol
This patch adds for "--ps-protocol" second execution
of queries "SELECT".
Also in this patch it is added ability to disable/enable
(--disable_ps2_protocol/--enable_ps2_protocol) second
execution for "--ps-prototocol" in testcases.
2023-07-26 17:15:00 +07:00
Oleksandr Byelkin
f52954ef42 Merge commit '10.4' into 10.5 2023-07-20 11:54:52 +02:00
Alexander Barkov
75f25e4ca7 MDEV-30164 System variable for default collations
This patch adds a way to override default collations
(or "character set collations") for desired character sets.

The SQL standard says:
> Each collation known in an SQL-environment is applicable to one
> or more character sets, and for each character set, one or more
> collations are applicable to it, one of which is associated with
> it as its character set collation.

In MariaDB, character set collations has been hard-coded so far,
e.g. utf8mb4_general_ci has been a hard-coded character set collation
for utf8mb4.

This patch allows to override (globally per server, or per session)
character set collations, so for example, uca1400_ai_ci can be set as a
character set collation for Unicode character sets
(instead of compiled xxx_general_ci).

The array of overridden character set collations is stored in a new
(session and global) system variable @@character_set_collations and
can be set as a comma separated list of charset=collation pairs, e.g.:

SET @@character_set_collations='utf8mb3=uca1400_ai_ci,utf8mb4=uca1400_ai_ci';

The variable is empty by default, which mean use the hard-coded
character set collations (e.g. utf8mb4_general_ci for utf8mb4).

The variable can also be set globally by passing to the server startup command
line, and/or in my.cnf.
2023-07-17 14:56:17 +04:00
Andrew Hutchings
584c2351de MDEV-15736 Remove mariadb-admin --vertical
The `--vertical` option does not appear to behave as documented and
research shows it never appears to have behaved as intended.

As this appears to be a completely unused feature, let's remove it.
2023-07-12 10:58:43 +10:00
Marko Mäkelä
cee9b3b850 Merge 11.0 into 11.1 2023-07-04 08:20:55 +03:00
Marko Mäkelä
a906046f1f Merge 10.11 into 11.0 2023-07-04 08:20:20 +03:00
Marko Mäkelä
3430767e00 Merge 10.10 into 10.11 2023-07-04 08:19:48 +03:00
Marko Mäkelä
c2d5523545 Merge 10.9 into 10.10 2023-07-04 08:18:30 +03:00
Oleg Smirnov
6d911219d6 MDEV-30639 Upgrade to 10.8 and later does not work on Windows
During the upgrade procedure on Windows mysqld.exe is started with
the named pipe connection protocol. mysqladmin.exe then pings the
server to check if is up and running. Command line looks like:
   mysqladmin.exe --protocol=pipe --socket=mysql_upgrade_service_xxx ping
But the "socket" parameter resets the "protocol" which was previously
initialized with the "pipe" value, setting it to "socket".
As a result, connection cannot be established and the upgrade
procedure fails.
"socket" in Windows is used to pass the name of the pipe so resetting
the protocol is not valid in this case.

This commit fixes resetting of the "protocol" parameter with "socket"
parameter in the case when protocol has been previously initialized
to "pipe" value
2023-06-30 15:59:14 +07:00
Oleg Smirnov
8e2b20bfb0 MDEV-30639 Upgrade to 10.8 and later does not work on Windows
During the upgrade procedure on Windows mysqld.exe is started with
the named pipe connection protocol. mysqladmin.exe then pings the
server to check if is up and running. Command line looks like:
   mysqladmin.exe --protocol=pipe --socket=mysql_upgrade_service_xxx ping
But the "socket" parameter resets the "protocol" which was previously
initialized with the "pipe" value, setting it to "socket".
As a result, connection cannot be established and the upgrade
procedure fails.
"socket" in Windows is used to pass the name of the pipe so resetting
the protocol is not valid in this case.

This commit fixes resetting of the "protocol" parameter with "socket"
parameter in the case when protocol has been previously initialized
to "pipe" value
2023-06-29 19:16:45 +07:00
Marko Mäkelä
8290a46d50 Merge 11.0 into 11.1 2023-06-28 09:38:59 +03:00
Marko Mäkelä
1fe4bcbe05 Merge 10.11 into 11.0 2023-06-28 09:19:19 +03:00
Marko Mäkelä
71a1a28a49 Merge 10.10 into 10.11 2023-06-27 17:45:06 +03:00
Marko Mäkelä
135e976696 Merge 10.9 into 10.10 2023-06-27 17:43:31 +03:00
Marko Mäkelä
eb6b521f1b Merge 10.6 into 10.9 2023-06-27 13:48:46 +03:00
Monty
d671fec431 Fixed some errors & warnings when running mariadb-upgrade on MySQL instance
- Moved view checks after privilege tables are fixed. This is to avoid
  warnings about wrongly defined mysql.proc when checking views.
- Don't use stat tables before they have been fixed.
- Don't run mysql_fix_view() if 'FOR MYSQL' is used if the view is
  already a MariaDB view.
- Added 'FOR UPGRADE' as an option for 'REPAIR VIEW' to be able to
  detect if the REPAIR command comes from mariadb_upgrade. In this
  case we get a warning, instead of an error, if a definer of a view
  does not exists.
2023-06-25 16:15:08 +03:00
Sergei Golubchik
d32fc5b8e0 MDEV-31461 mariadb SIGSEGV when built with -DCLIENT_PLUGIN_DIALOG=STATIC 2023-06-19 12:12:21 +02:00
Sergei Golubchik
cbabb95915 Merge branch '11.0' into 11.1 2023-06-05 20:15:15 +02:00
Sergei Golubchik
0005f2f06c Merge branch 'bb-10.11-release' into bb-11.0-release 2023-06-05 19:27:00 +02:00
Sergei Golubchik
69684f689c use correct collation_connection in --view
mysqltest should use the same collation_connection in the service
connection (that creates views) as in the main connection

this makes weight_string("aaa") to return the expected value in --view
and fixes main.func_str failure in --view
2023-06-02 17:51:40 +02:00
Oleksandr Byelkin
06d03dcdd3 Merge branch '10.10' into 10.11 2023-05-03 21:05:34 +02:00
Marko Mäkelä
e02a2f4e9f Merge 10.9 into 10.10 2023-05-02 10:22:43 +03:00
Marko Mäkelä
d8997f875e Merge 10.8 into 10.9 2023-04-28 13:39:33 +03:00
Marko Mäkelä
5028b7c7c8 Merge 10.6 into 10.8 2023-04-27 17:14:36 +03:00
Monty
f272463b02 Cleanup of MDEV-14974: --port ignored for --host=localhost
The old code added to 10.6 was inconsisting in how TCP/IP and
socket connection was chosen. One got also a confusing warning
in some cases.

Examples:
> ../client/mysql --print-defaults
../client/mysql would have been started with the following arguments:
--socket=/tmp/mariadbd.sock --port=3307 --no-auto-rehash
> ../client/mysql
ERROR 2002 (HY000): Can't connect to local server through socket '/tmp/mariadbd.sock' (2)
> ../client/mysql --print-defaults
../client/mysql would have been started with the following arguments:
--socket=/tmp/mariadbd.sock --port=3307 --no-auto-rehash
> ../client/mysql --port=3333
WARNING: Forcing protocol to  TCP  due to option specification. Please explicitly state intended protocol.
ERROR 2002 (HY000): Can't connect to server on 'localhost' (111)
> ../client/mysql --port=3333 --socket=sss
ERROR 2002 (HY000): Can't connect to local server through socket 'sss' (2)
> ../client/mysql --socket=sss --port=3333
ERROR 2002 (HY000): Can't connect to local server through socket 'sss' (2)

Some notable things:
- One gets a warning if one uses just --port if config file sets socket
- Using port and socket gives no warning
- Using socket and then port still uses socket

This patch changes things the following ways:
If --port= is given on the command line, the the protocol is automatically
  changed to "TCP/IP".
- If --socket= is given on the command line, the protocol is automatically
  changed to "socket".
- The last option wins
- No warning is given if protocol changes automatically.
2023-04-27 11:34:26 +03:00
Marko Mäkelä
54819192fe Merge 10.11 into 11.0 2023-04-26 18:50:15 +03:00
Marko Mäkelä
52f6f364d9 Merge 10.10 into 10.11 2023-04-26 18:31:50 +03:00
Marko Mäkelä
ce6616aa28 Merge 10.9 into 10.10 2023-04-26 18:31:03 +03:00
Marko Mäkelä
e3f6e1c92e Merge 10.8 into 10.9 2023-04-26 17:48:13 +03:00
Marko Mäkelä
c15c8ef3e3 Merge 10.6 into 10.8 2023-04-26 13:58:40 +03:00
Marko Mäkelä
818d5e4814 Merge 10.5 into 10.6 2023-04-25 13:10:33 +03:00
Oleksandr Byelkin
1d74927c58 Merge branch '10.4' into 10.5 2023-04-24 12:43:47 +02:00
Marko Mäkelä
854e8b189e MDEV-28976 fixup: A better fix
do_shutdown_server(): After sending SIGKILL, invoke wait_until_dead().
Thanks to Sergei Golubchik for pointing out that the previous fix
does not actually work.
2023-04-19 15:53:26 +03:00
Marko Mäkelä
d665186477 MDEV-28976: mtr must wait for server to actually die
do_shutdown_server(): Call wait_until_dead() also when we are forcibly
killing the process (timeout=0). We have evidence that killing
the process may take some time and cause mystery failures in
crash recovery tests. For InnoDB, several failures were observed between
commit da094188f6 and
commit 0ee1082bd2
when no advisory file locking was being used by default.
2023-04-19 14:08:53 +03:00
Sergei Petrunia
c7fe8e51de Merge 10.11 into 11.0 2023-04-17 16:50:01 +03:00
Marko Mäkelä
656c2e18b1 Merge 10.10 into 10.11 2023-04-14 13:08:28 +03:00
Marko Mäkelä
a009280e60 Merge 10.9 into 10.10 2023-04-14 12:24:14 +03:00
Marko Mäkelä
44281b88f3 Merge 10.8 into 10.9 2023-04-14 11:32:36 +03:00
Marko Mäkelä
1d1e0ab2cc Merge 10.6 into 10.8 2023-04-12 15:50:08 +03:00
Marko Mäkelä
5bada1246d Merge 10.5 into 10.6 2023-04-11 16:15:19 +03:00
Daniel Black
320a4b52c9 MDEV-30205 Move /usr/share/mysql to /usr/share/mariadb
These are mainly internal files so is a low impact change.

The few scripts/mysql*sql where renames to mariadb_* prefix
on the name.

mysql-test renamed to mariadb-test in the final packages
2023-04-11 07:59:02 +10:00
Alexander Barkov
62e137d4d7 Merge remote-tracking branch 'origin/10.4' into 10.5 2023-04-05 16:16:19 +04:00
Lorna Luo
da73db2382 Make 'move_file' command more reliable in mysqltest
The tests innodb.import_tablespace_race, innodn.restart, and innodb.innodb-wl5522 move
the tablespace file between the data directory and the tmp directory specified by
global environment variables. However this is risky because it's not unusual that the
set tmp directory (often under /tmp) is mounted on another disk partition or device,
and 'move_file' command may fail with "Errcode: 18 'Invalid cross-device link.'"

To stabilize mysqltest in the described scenario, and prevent such
behavior in the future, let make_file() check both from file path and to
file path and make sure they are either both under MYSQLTEST_VARDIR or
MYSQL_TMP_DIR.

All new code of the whole pull request, including one or several files that
are either new files or modified ones, are contributed under the BSD-new license.
I am contributing on behalf of my employer Amazon Web Services, Inc.
2023-04-03 14:36:11 +02:00
Oleksandr Byelkin
ac5a534a4c Merge remote-tracking branch '10.4' into 10.5 2023-03-31 21:32:41 +02:00
Debjyoti
d575b07c86 MDEV-24453 Added support for a 5th --verbose parameter in mariadb-upgrade to show mysql results for mysql_fix_privilege_tables 2023-03-27 16:29:14 +02:00
Anel Husakovic
2f6bb9cda5 MDEV-30698 Cover missing test cases for mariadb-binlog options --raw [and] --flashback
- Adding test case for --raw without -R
- Adding unsuported combination of --raw and --flashback parameters and
covered with test case
2023-03-08 12:26:00 +00:00
Anel Husakovic
7300ab32cc Update handling of mysqlbinlog's die() function
- Update per Monty's review for commit 5328dbdaa237d97e443120f2e08437fb274198c2
2023-03-08 12:26:00 +00:00
Anel Husakovic
f0ab1a28c9 MDEV-30697: Memory leak detected when mariadb-binlog is used with option flashback 2023-03-08 12:26:00 +00:00
Monty
fb8c1762ad Ensure that mysqlbinlog frees all memory at exit 2023-03-08 12:26:00 +00:00
Hugo Wen
7bdd878ae4 Fix few vulnerabilities found by Cppcheck
While performing SAST scanning using Cppcheck against source code of
commit 81196469, several code vulnerabilities were found.

Fix following issues:

1. Parameters of `snprintf` function are incorrect.

   Cppcheck error:

       client/mysql_plugin.c:1228: error: snprintf format string requires 6 parameters but only 5 are given.

   It is due to commit 630d7229 introduced option `--lc-messages-dir`
   in the bootstrap command. However the parameter was not even given
   in the `snprintf` after changing the format string.

   Fix:
   Restructure the code logic and correct the function parameters for
   `snprintf`.

2. Null pointer is used in a `snprintf` which could cause a crash.

   Cppcheck error:

       extra/mariabackup/xbcloud.cc:2534: error: Null pointer dereference

   The code intended to print the swift_project name, if the
   opt_swift_project_id is NULL but opt_swift_project is not NULL.
   However the parameter of `snprintf` was mistakenly using
   `opt_swift_project_id`.

   Fix:
   Change to use the correct string from `opt_swift_project`.

3. Potential double release of a memory

   Cppcheck error:

       plugin/auth_pam/testing/pam_mariadb_mtr.c:69: error: Memory pointed to by 'resp' is freed twice.

   A pointer `resp` is reused and allocated new memory after it has been
   freed. However, `resp` was not set to NULL after freed.
   Potential double release of the same pointer if the call back
   function doesn't allocate new memory for `resp` pointer.

   Fix:
   Set the `resp` pointer to NULL after the first free() to make sure
   the same address is not freed twice.

All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license. I am contributing on behalf of my employer Amazon Web
Services, Inc.
2023-03-02 14:38:24 +11:00
Anel Husakovic
bd0d7ea540 MDBF-534: Coverity scan: fix client folder
---------------------------------
File: `mysqltest`
---------------------------------
- Coverity (SIZEOF_MISMATCH):
  - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728385&defectInstanceId=53074863&mergedDefectId=972322
    Function `qsort` have to use size of element that is `uchar *`

- Coverity (REVERSE_INULL):
  - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728385&defectInstanceId=53074524&mergedDefectId=1519693&fileStart=3376&fileEnd=3625
    First check if null and then use `strlen`, not reversed.

- FALSE POSITIVES
  - Coverity (TAINTED_SCALAR):
    https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728385&defectInstanceId=53074760&mergedDefectId=1519321

  - Coverity (CHECKED_RETURN):
    - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728385&defectInstanceId=53074692&mergedDefectId=971714
    - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728385&defectInstanceId=53072839&mergedDefectId=971715

  - Coverity (FORWARD_NULL):
    There is already issued DBUG_ASSERT(query_end) few lines before
    https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728385&defectInstanceId=53074002&mergedDefectId=971916&eventId=53074002-5

  - Coverity (OVERRUN):
    - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728385&defectInstanceId=53074470&mergedDefectId=1519697
    - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728385&defectInstanceId=53074862&mergedDefectId=1520391
      `uint64_max` and `SIZE_MAX` (max for `size_t`) are same as `count` argument
      for `memcmp`.

  - Coverity (RESOURCE_LEAK):
    - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728385&defectInstanceId=53074163&mergedDefectId=1519889&eventId=53074163-446

- INTENTION:
  - Coverity (SIZEOF_MISMATCH):
    - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728385&defectInstanceId=53074650&mergedDefectId=1520109
      `len` argument is used only in printing so it is not making impact (may be removed as an alternative).
      In this example size of pointer (8B) is used, that is not the size of value that pointer points to.
2023-02-17 13:43:43 +00:00
Anel Husakovic
24911a34b3 MDBF-534: Coverity scan: fix client folder
---------------------------------
File: `mysqlslap`
---------------------------------
- Coverity (CHECKED_RETURN):
  https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728428&defectInstanceId=53073524&mergedDefectId=1520114

- FALSE POSITIVES
  - Coverity (DC.WEAK_CRYPTO) (`random()`):
    https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728428&defectInstanceId=53073112&mergedDefectId=1225806
    https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728428&defectInstanceId=53074491&mergedDefectId=1409160
    https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728428&defectInstanceId=53074151&mergedDefectId=1409180
    https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728428&defectInstanceId=53073799&mergedDefectId=1409183

  - Coverity (TAINTED_SCALAR):
    https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728428&defectInstanceId=53074667&mergedDefectId=1519586
  - Coverity (UNINT):
  - Coverity (BAD_FREE):
    https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728428&defectInstanceId=53074415&mergedDefectId=1520371
2023-02-17 13:43:43 +00:00
Anel Husakovic
023bb2fc20 MDBF-534: Coverity scan: fix client folder
--------------------------------
    File: `mysqldump`:
    --------------------------------
    -Coverity (`BAD_SHIFT`):
    https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53073433&mergedDefectId=1211186&eventId=53073433-25

    `mysqldump` - Error obtained by coverity is implication of type
    conversion.
    It may happen that function `find_type` returns -1 which
    is assigned to `uint` that gets converted by compiler to max
    (UINT_32/64). In that situation left bit shift may lead to UB.
    Converting from `uint` to `int` will solve the problem.

    - Coverity (`RESOURCE_LEAK`):
      - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53072912&mergedDefectId=1519239
      - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53073706&mergedDefectId=1519368
      - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53073560&mergedDefectId=1519655
      - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53074494&mergedDefectId=1519822&fileStart=4001&fileEnd=4250
      - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53074999&mergedDefectId=1519915&eventId=53074999-53
      - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53075060&mergedDefectId=1519964
      - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53073268&mergedDefectId=1519967
      - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53073015&mergedDefectId=1520164

    `mysqldump` - in case of error memory should be freeed.

    - Coverity (`UNINT`) - FALSE POSITIVES:
      - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53074364&mergedDefectId=1519587&eventId=53074364-10
      - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53072619&mergedDefectId=1519684&eventId=53072619-1
      - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53073256&mergedDefectId=1519722
      - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53074251&mergedDefectId=1519979
      - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53074996&mergedDefectId=1520021
      - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728415&defectInstanceId=53073425&mergedDefectId=1520166&eventId=53073425-9

    ---------------------------------
    File: `mysqladmin`
    ---------------------------------
    - Coverity (PRECEDANCE_ERROR) a.k.a MDEV-15736:
      https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728425&defectInstanceId=53074187&mergedDefectId=1519944

    - Coverity (BAD_FREE) - FALSE POSITIVE:
      https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728425&defectInstanceId=53074614&mergedDefectId=1520042

    ---------------------------------
    File: `mysqlimport`
    ---------------------------------
    - FALSE POSITIVES
      - Coverity (TAINTED_SCALAR):
        https://scan5.scan.coverity.com/reports.htm#v58936/p10357/  fileInstanceId=231728411&defectInstanceId=53074012&mergedDefectId=1519158&eventId=53074012-6
      - Coverity (UNINT):
        https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728411&defectInstanceId=53072860&mergedDefectId=1520020

    ---------------------------------
    File: `mysqlshow`
    ---------------------------------
    - FALSE POSITIVES
      - Coverity (TAINTED_SCALAR):
        https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728418&defectInstanceId=53074361&mergedDefectId=1519232&eventId=53074361-4
      - Coverity (UNINT):
        https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728411&defectInstanceId=53072860&mergedDefectId=1520020

      - Coverity (BAD_FREE):
        https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728418&defectInstanceId=53073408&mergedDefectId=1519972
2023-02-17 13:43:43 +00:00
Anel Husakovic
ff7e0977f3 MDBF-534: Coverity scan: fix client folder
---------------------------------
File: `mysqlcheck`
---------------------------------

- Coverity (FORWARD_NULL):
https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728409&defectInstanceId=53075052&mergedDefectId=1520314&eventId=53075052-7

`mysqlcheck` - make sure `op` is non-null

- Coverity (TAINTED_SCALAR) - FALSE POSITIVES:
https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728409&defectInstanceId=53074482&mergedDefectId=1519904
2023-02-17 13:43:43 +00:00
Anel Husakovic
f0ea22a1e2 MDBF-534: Coverity scan: fix client folder
---------------------------------
File: `mysqlbinlog`
---------------------------------
- Coverity (FORWARD_NULL):
https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728438&defectInstanceId=53074517&mergedDefectId=1519690&eventId=53074517-46

`mysqlbinlog` - for `opt_raw_mode` file is set to 0, make sure it opened
before.
2023-02-17 13:43:43 +00:00
Anel Husakovic
4878891193 MDBF-534: Coverity scan: fix client folder
---------------------------------
File: `mysqladmin`
---------------------------------
- Coverity (PRINTF_ARGS):
https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728412&defectInstanceId=53073308&mergedDefectId=1520228&eventId=53073308-0

`mysql_upgrade` - extra argument to printf format specifiera

- Coverity (TAINTED_SCALAR) - FAlSE POSITIVE:
https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728412&defectInstanceId=53072897&mergedDefectId=1519349
2023-02-17 13:43:43 +00:00
Anel Husakovic
560c15c44b MDBF-534: Coverity scan: fix client folder
---------------------------------
File: `mysql`
---------------------------------

- Coverity (RESOURCE_LEAK):
  https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728394&defectInstanceId=53073025&mergedDefectId=1520090&eventId=53073025-15

  `mysql`: memory allocated by `mysql_fetch_row` is not freed.

- FALSE POSITIVES:
  - Coverity (TAINTED_SCALAR):
    - https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728394&defectInstanceId=53074559&mergedDefectId=1520403
  - Coverity (COPY_PASTE_ERROR):
    https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728394&defectInstanceId=53074521&mergedDefectId=1520300
  - Coverity (STRING_NULL):
    https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728394&defectInstanceId=53072524&mergedDefectId=1519374
  - Coverity (CHECKED_RETURN):
    https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728394&defectInstanceId=53074932&mergedDefectId=971708

- INTENTIONAL:
  - Coverity (UNINIT):
    https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728394&defectInstanceId=53074758&mergedDefectId=1519932
    https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728394&defectInstanceId=53073939&mergedDefectId=1519738
  - Coverity(BAD_FREE):
    https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728394&defectInstanceId=53073938&mergedDefectId=1519491
    https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728394&defectInstanceId=53074819&mergedDefectId=1519462

---------------------------------
File: `mysql_plugin`
---------------------------------

- Coverity (FORWARD_NULL):
  https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728420&defectInstanceId=53074485&mergedDefectId=971915

  Dereference after null check when using `fclose`.

- FALSE POSITIVES:
  - Coverity (STRING_OVERFLOW):
    https://scan5.scan.coverity.com/reports.htm#v58936/p10357/fileInstanceId=231728420&defectInstanceId=53075014&mergedDefectId=972410

- Additionally fix typo
2023-02-17 13:43:43 +00:00
Marko Mäkelä
2e431ff7e6 Merge 10.11 into 11.0 2023-02-16 13:34:45 +02:00
Marko Mäkelä
1fd0099839 Merge 10.10 into 10.11 2023-02-16 11:41:18 +02:00
Marko Mäkelä
345356b868 Merge 10.9 into 10.10 2023-02-16 11:36:38 +02:00
Marko Mäkelä
0d55914d96 Merge 10.8 into 10.9 2023-02-16 10:25:34 +02:00
Sergei Petrunia
10a974adc9 Merge 11.0-selectivity into 11.0 2023-02-15 12:03:12 +03:00
Marko Mäkelä
dbab3e8d90 Merge 10.6 into 10.8 2023-02-10 13:43:53 +02:00
Marko Mäkelä
6aec87544c Merge 10.5 into 10.6 2023-02-10 13:03:01 +02:00
Monty
1a13dbff01 MDEV-30327 Client crashes in print_last_query_cost
Fixed by calling init_pager() before tee_fprintf()
2023-02-10 12:58:50 +02:00
Marko Mäkelä
c41c79650a Merge 10.4 into 10.5 2023-02-10 12:02:11 +02:00
Vicențiu Ciorbaru
08c852026d Apply clang-tidy to remove empty constructors / destructors
This patch is the result of running
run-clang-tidy -fix -header-filter=.* -checks='-*,modernize-use-equals-default' .

Code style changes have been done on top. The result of this change
leads to the following improvements:

1. Binary size reduction.
* For a -DBUILD_CONFIG=mysql_release build, the binary size is reduced by
  ~400kb.
* A raw -DCMAKE_BUILD_TYPE=Release reduces the binary size by ~1.4kb.

2. Compiler can better understand the intent of the code, thus it leads
   to more optimization possibilities. Additionally it enabled detecting
   unused variables that had an empty default constructor but not marked
   so explicitly.

   Particular change required following this patch in sql/opt_range.cc

   result_keys, an unused template class Bitmap now correctly issues
   unused variable warnings.

   Setting Bitmap template class constructor to default allows the compiler
   to identify that there are no side-effects when instantiating the class.
   Previously the compiler could not issue the warning as it assumed Bitmap
   class (being a template) would not be performing a NO-OP for its default
   constructor. This prevented the "unused variable warning".
2023-02-09 16:09:08 +02:00
Christian Gonzalez
3622644836 MDEV-30498 Rename mysql_upgrade state file to mariadb_upgrade
Renames the upgrade state file, and ensures the old
file is properly removed when `mariadb-upgrade` tool is executed.

All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license. I am contributing on behalf of my employer
Amazon Web Services, Inc.
2023-02-07 07:29:04 +00:00
Sergei Golubchik
760d149067 MDEV-30128 remove support for 5.1- replication events
including patches from Andrei Elkin
2023-02-05 22:02:30 +01:00
Monty
b66cdbd1ea Changing all cost calculation to be given in milliseconds
This makes it easier to compare different costs and also allows
the optimizer to optimizer different storage engines more reliably.

- Added tests/check_costs.pl, a tool to verify optimizer cost calculations.
  - Most engine costs has been found with this program. All steps to
    calculate the new costs are documented in Docs/optimizer_costs.txt

- User optimizer_cost variables are given in microseconds (as individual
  costs can be very small). Internally they are stored in ms.
- Changed DISK_READ_COST (was DISK_SEEK_BASE_COST) from a hard disk cost
  (9 ms) to common SSD cost (400MB/sec).
- Removed cost calculations for hard disks (rotation etc).
- Changed the following handler functions to return IO_AND_CPU_COST.
  This makes it easy to apply different cost modifiers in ha_..time()
  functions for io and cpu costs.
  - scan_time()
  - rnd_pos_time() & rnd_pos_call_time()
  - keyread_time()
- Enhanched keyread_time() to calculate the full cost of reading of a set
  of keys with a given number of ranges and optional number of blocks that
  need to be accessed.
- Removed read_time() as keyread_time() + rnd_pos_time() can do the same
  thing and more.
- Tuned cost for: heap, myisam, Aria, InnoDB, archive and MyRocks.
  Used heap table costs for json_table. The rest are using default engine
  costs.
- Added the following new optimizer variables:
  - optimizer_disk_read_ratio
  - optimizer_disk_read_cost
  - optimizer_key_lookup_cost
  - optimizer_row_lookup_cost
  - optimizer_row_next_find_cost
  - optimizer_scan_cost
- Moved all engine specific cost to OPTIMIZER_COSTS structure.
- Changed costs to use 'records_out' instead of 'records_read' when
  recalculating costs.
- Split optimizer_costs.h to optimizer_costs.h and optimizer_defaults.h.
  This allows one to change costs without having to compile a lot of
  files.
- Updated costs for filter lookup.
- Use a better cost estimate in best_extension_by_limited_search()
  for the sorting cost.
- Fixed previous issues with 'filtered' explain column as we are now
  using 'records_out' (min rows seen for table) to calculate filtering.
  This greatly simplifies the filtering code in
  JOIN_TAB::save_explain_data().

This change caused a lot of queries to be optimized differently than
before, which exposed different issues in the optimizer that needs to
be fixed.  These fixes are in the following commits.  To not have to
change the same test case over and over again, the changes in the test
cases are done in a single commit after all the critical change sets
are done.

InnoDB changes:
- Updated InnoDB to not divide big range cost with 2.
- Added cost for InnoDB (innobase_update_optimizer_costs()).
- Don't mark clustered primary key with HA_KEYREAD_ONLY. This will
  prevent that the optimizer is trying to use index-only scans on
  the clustered key.
- Disabled ha_innobase::scan_time() and ha_innobase::read_time() and
  ha_innobase::rnd_pos_time() as the default engine cost functions now
  works good for InnoDB.

Other things:
- Added  --show-query-costs (\Q) option to mysql.cc to show the query
  cost after each query (good when working with query costs).
- Extended my_getopt with GET_ADJUSTED_VALUE which allows one to adjust
  the value that user is given. This is used to change cost from
  microseconds (user input) to milliseconds (what the server is
  internally using).
- Added include/my_tracker.h  ; Useful include file to quickly test
  costs of a function.
- Use handler::set_table() in all places instead of 'table= arg'.
- Added SHOW_OPTIMIZER_COSTS to sys variables. These are input and
  shown in microseconds for the user but stored as milliseconds.
  This is to make the numbers easier to read for the user (less
  pre-zeros).  Implemented in 'Sys_var_optimizer_cost' class.
- In test_quick_select() do not use index scans if 'no_keyread' is set
  for the table. This is what we do in other places of the server.
- Added THD parameter to Unique::get_use_cost() and
  check_index_intersect_extension() and similar functions to be able
  to provide costs to called functions.
- Changed 'records' to 'rows' in optimizer_trace.
- Write more information to optimizer_trace.
- Added INDEX_BLOCK_FILL_FACTOR_MUL (4) and INDEX_BLOCK_FILL_FACTOR_DIV (3)
  to calculate usage space of keys in b-trees. (Before we used numeric
  constants).
- Removed code that assumed that b-trees has similar costs as binary
  trees. Replaced with engine calls that returns the cost.
- Added Bitmap::find_first_bit()
- Added timings to join_cache for ANALYZE table (patch by Sergei Petrunia).
- Added records_init and records_after_filter to POSITION to remember
  more of what best_access_patch() calculates.
- table_after_join_selectivity() changed to recalculate 'records_out'
  based on the new fields from best_access_patch()

Bug fixes:
- Some queries did not update last_query_cost (was 0). Fixed by moving
  setting thd->...last_query_cost in JOIN::optimize().
- Write '0' as number of rows for const tables with a matching row.

Some internals:
- Engine cost are stored in OPTIMIZER_COSTS structure.  When a
  handlerton is created, we also created a new cost variable for the
  handlerton. We also create a new variable if the user changes a
  optimizer cost for a not yet loaded handlerton either with command
  line arguments or with SET
  @@global.engine.optimizer_cost_variable=xx.
- There are 3 global OPTIMIZER_COSTS variables:
  default_optimizer_costs   The default costs + changes from the
                            command line without an engine specifier.
  heap_optimizer_costs      Heap table costs, used for temporary tables
  tmp_table_optimizer_costs The cost for the default on disk internal
                            temporary table (MyISAM or Aria)
- The engine cost for a table is stored in table_share. To speed up
  accesses the handler has a pointer to this. The cost is copied
  to the table on first access. If one wants to change the cost one
  must first update the global engine cost and then do a FLUSH TABLES.
  This was done to be able to access the costs for an open table
  without any locks.
- When a handlerton is created, the cost are updated the following way:
  See sql/keycaches.cc for details:
  - Use 'default_optimizer_costs' as a base
  - Call hton->update_optimizer_costs() to override with the engines
    default costs.
  - Override the costs that the user has specified for the engine.
  - One handler open, copy the engine cost from handlerton to TABLE_SHARE.
  - Call handler::update_optimizer_costs() to allow the engine to update
    cost for this particular table.
  - There are two costs stored in THD. These are copied to the handler
    when the table is used in a query:
    - optimizer_where_cost
    - optimizer_scan_setup_cost
- Simply code in best_access_path() by storing all cost result in a
  structure. (Idea/Suggestion by Igor)
2023-02-02 23:54:45 +03:00
Sergei Petrunia
249475b99c Make --ps-protocol command work in --ps-protocol mode 2023-02-02 22:55:15 +03:00
Oleksandr Byelkin
c7c415734d Merge branch '10.10' into 10.11 2023-01-31 11:07:08 +01:00
Oleksandr Byelkin
76bcea3154 Merge branch '10.9' into 10.10 2023-01-31 11:01:48 +01:00
Oleksandr Byelkin
de2d089942 Merge branch '10.8' into 10.9 2023-01-31 10:37:31 +01:00
Oleksandr Byelkin
638625278e Merge branch '10.7' into 10.8 2023-01-31 09:57:52 +01:00
Oleksandr Byelkin
b923b80cfd Merge branch '10.6' into 10.7 2023-01-31 09:33:58 +01:00
Oleksandr Byelkin
c3a5cf2b5b Merge branch '10.5' into 10.6 2023-01-31 09:31:42 +01:00
Oleksandr Byelkin
a977054ee0 Merge branch '10.3' into 10.4 2023-01-28 18:22:55 +01:00
Oleksandr Byelkin
7fa02f5c0b Merge branch '10.4' into 10.5 2023-01-27 13:54:14 +01:00
Oleksandr Byelkin
dd24fa3063 Merge branch '10.3' into 10.4 2023-01-26 10:34:26 +01:00
Daniel Black
f8ca355ed8 MDEV-26548: replace .mysql_history with .mariadb_history
Fall back to using .mysql_history if .mariadb_history isn't
present and .mysql_history is present.

Also replace the use of MYSQL_HISTFILE as an environment variable
with MARIADB_HISTFILE and fall back to using MYSQL_HISTFILE if
MARIADB_HISTFILE isn't present.
2023-01-24 20:22:23 +11:00
Mikhail Chalov
567b681299 Minimize unsafe C functions usage - replace strcat() and strcpy() (and strncat() and strncpy()) with custom safe_strcat() and safe_strcpy() functions
The MariaDB code base uses strcat() and strcpy() in several
places. These are known to have memory safety issues and their usage is
discouraged. Common security scanners like Flawfinder flags them. In MariaDB we
should start using modern and safer variants on these functions.

This is similar to memory issues fixes in 19af1890b5
and 9de9f105b5 but now replace use of strcat()
and strcpy() with safer options strncat() and strncpy().

However, add '\0' forcefully to make sure the result string is correct since
for these two functions it is not guaranteed what new string will be null-terminated.

Example:

    size_t dest_len = sizeof(g->Message);
    strncpy(g->Message, "Null json tree", dest_len); strncat(g->Message, ":",
    sizeof(g->Message) - strlen(g->Message)); size_t wrote_sz = strlen(g->Message);
    size_t cur_len = wrote_sz >= dest_len ? dest_len - 1 : wrote_sz;
    g->Message[cur_len] = '\0';

All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the BSD-new
license. I am contributing on behalf of my employer Amazon Web Services

-- Reviewer and co-author Vicențiu Ciorbaru <vicentiu@mariadb.org>
-- Reviewer additions:
* The initial function implementation was flawed. Replaced with a simpler
  and also correct version.
* Simplified code by making use of snprintf instead of chaining strcat.
* Simplified code by removing dynamic string construction in the first
  place and using static strings if possible. See connect storage engine
  changes.
2023-01-20 15:18:52 +02:00
Eric Herman
6fe882cd85 Add my_afree after my_alloca in early return case
The code already had a call to `my_afree` in the normal return case,
but failed to do so in the early return case.
2023-01-20 09:28:35 +11:00
Sergei Golubchik
c37ebaf6c2 MDEV-30153 ad hoc client versions are confusing
try to make them less confusing for users.
Hopefully, if the version string will be changed like

- mariadb Ver 15.1 Distrib 10.11.2-MariaDB for Linux (x86_64)
+ mariadb from 10.11.2-MariaDB, client 15.1 for Linux (x86_64)

users will be less inclined to reply "15.1" to the question
"what mariadb version are you using?"
2023-01-19 12:39:37 +01:00
Sergei Golubchik
eb26bf6e09 unify client/tool version string
it should now always be

/path/to/exe Ver <tool version> Distrib <server version> for <OS> (<ARCH>)

in all tools and clients
2023-01-19 12:39:28 +01:00
Marko Mäkelä
ae79cedf4b Merge 10.11 into 11.0 2023-01-11 11:45:56 +02:00
Daniel Black
a5be6c91cb MDEV-29889 mariadb-dump --tab --header is slow
--header applied an ORDER BY to ensure that the header
row was the first row in the output given UNION ALL
doesn't in the standard enforce the order.

We change that now only add the ORDER BY if --order-by-primary
is used.

An assumption that if UNION ALL change to a different behaviour
the resulting mysqldump-header test may also change.
2023-01-03 14:57:02 +11:00
Sergei Golubchik
71a72dd770 11.0 branch 2022-12-20 16:02:19 +01:00
Marko Mäkelä
64071d30bd Merge 10.10 into 10.11 2022-12-07 10:00:52 +02:00
Marko Mäkelä
3ff4eb07ed Merge 10.9 into 10.10 2022-12-07 09:49:38 +02:00
Marko Mäkelä
23f705f3a2 Merge 10.8 into 10.9 2022-12-07 09:43:38 +02:00
Marko Mäkelä
b3c254339b Merge 10.7 into 10.8 2022-12-07 09:43:13 +02:00
Marko Mäkelä
9e27e53dfa Merge 10.6 into 10.7 2022-12-07 09:39:46 +02:00
Marko Mäkelä
e55397a46d Merge 10.5 into 10.6 2022-12-05 18:04:23 +02:00
Jan Lindström
4eb8e51c26 Merge 10.4 into 10.5 2022-11-30 13:10:52 +02:00
Julius Goryavsky
1ebf0b7372 MDEV-29817: Issues with handling options for SSL CRLs (and some others)
This patch adds the correct setting of the "--tls-version" and
"--ssl-verify-server-cert" options in the client-side utilities
such as mysqltest, mysqlcheck and mysqlslap, as well as the correct
setting of the "--ssl-crl" option when executing queries on the
slave side, and also the correct option codes in the "sslopts-logopts.h"
file (in the latter case, incorrect values are not a problem right
now, but may cause subtle test failures in the future, if the option
handling code changes).
2022-11-22 15:16:12 +01:00
Julius Goryavsky
f0820400ee MDEV-29817: Issues with handling options for SSL CRLs (and some others)
This patch adds the correct setting of the "--ssl-verify-server-cert"
option in the client-side utilities such as mysqlcheck and mysqlslap,
as well as the correct setting of the "--ssl-crl" option when executing
queries on the slave side, and also add the correct option codes in
the "sslopts-logopts.h" file (in the latter case, incorrect values
are not a problem right now, but may cause subtle test failures in
the future, if the option handling code changes).
2022-11-22 14:07:39 +01:00
Marko Mäkelä
7933367a27 Merge 10.10 into 10.11 2022-11-21 10:51:10 +02:00
Marko Mäkelä
bebe193979 Merge 10.9 into 10.10 2022-11-21 10:32:08 +02:00
Marko Mäkelä
91a7e9eb1e Merge 10.8 into 10.9 2022-11-10 09:50:30 +02:00
Marko Mäkelä
fe9412dbc9 Merge 10.7 into 10.8 2022-11-09 13:05:44 +02:00
Marko Mäkelä
27eaa963ff Merge 10.6 into 10.7 2022-11-09 12:27:54 +02:00
Vladislav Vaintroub
e3a5a69524 MDEV-29822 - make mysqltest fail loudly when out of memory
When allocation failed, fail consistently with error message and abort()
by using flags MY_WME|MY_FAE with my_malloc() and friends.

This ensures that better diagnostic information is available
when mysqltest fails.
2022-11-08 08:02:18 +01:00
Oleksandr Byelkin
ad937cf33a Merge branch '10.10' into 10.11 2022-11-02 13:08:01 +01:00
Oleksandr Byelkin
749c127822 MDEV-5215 prerequisite of prerequisite: if DB is not mentioned in connect ignore errors of switching to it 2022-11-01 15:40:49 +01:00
Oleksandr Byelkin
49a22c5897 Merge branch '10.9' into 10.10 2022-11-01 11:55:28 +01:00
Oleksandr Byelkin
ebf2121529 Merge branch '10.8' into 10.9 2022-11-01 10:33:44 +01:00
Marko Mäkelä
e0421b7cc8 Merge 10.7 into 10.8 2022-11-01 08:50:28 +02:00
Oleksandr Byelkin
1ebfa2af62 Merge branch '10.6' into 10.7 2022-10-29 19:22:04 +02:00
Sergei Golubchik
dc3be24268 MDEV-29828 Indicate that --dump-history only applies to timestamp-based versioning 2022-10-26 15:30:39 +02:00
Sergei Golubchik
a6f9694650 MDEV-29736 mysqldump sets system_versioning_insert_history=1 twice and doesn't restore previous value 2022-10-26 15:30:39 +02:00
Sergei Golubchik
73b2a326d2 MDEV-29730 mysqldump --dump-history creates broken dump if there are precision-versioned tables 2022-10-26 15:30:39 +02:00
Sergei Golubchik
d249761ae5 MDEV-16029 mysqldump: dump and restore historical data 2022-10-26 15:30:39 +02:00
Sergei Golubchik
a39b4848e4 MDEV-16733 mysqldump --tab and --xml options are conflicting 2022-10-26 15:30:39 +02:00
Sergei Golubchik
a3dbd5de44 cleanup: mysqldump
remove extra loop over result set, don't check for INVISIBLE columns,
when not needed (xml ignores complete_insert and old servers cannot
have INVISIBLE)
2022-10-26 15:30:39 +02:00
Sergei Golubchik
768a10d02a MDEV-22200 maridb-dump add --header option
fix quoting
2022-10-26 15:30:35 +02:00
rmfalves
f45f60636f MDEV-22200: maridb-dump add --header option
This adds a header row in txt files exported by mariadb-dump --tab

Reviewed by: Daniel Black and Dan Lenski
2022-10-26 15:01:04 +11:00
Marko Mäkelä
aeccbbd926 Merge 10.5 into 10.6
To prevent ASAN heap-use-after-poison in the MDEV-16549 part of
./mtr --repeat=6 main.derived
the initialization of Name_resolution_context was cleaned up.
2022-10-25 14:25:42 +03:00
Marko Mäkelä
9a0b9e3360 Merge 10.4 into 10.5 2022-10-25 11:26:37 +03:00
Marko Mäkelä
667d3fbbb5 Merge 10.3 into 10.4 2022-10-25 10:04:37 +03:00
Anel Husakovic
1a057a923b MDEV-15530: Variable replicate_rewrite_db cannot be found in "show global variables"
- Add `replicate_rewrite_db` status variable, that may accept comma
separated key-value pairs.
- Note that option `OPT_REPLICATE_REWRITE_DB` already existed in `mysqld.h`
  from this commit 23d8586dbf

Reviewer:Brandon Nesterenko <brandon.nesterenko@mariadb.com>
2022-10-21 14:49:05 -06:00
Sergei Golubchik
8e6a64194b MDEV-29463 mysqlimport occasionally fails to fail in main.mysqldump
don't invoke atexit handlers if other threads are still running,
OpenSSL doesn't like concurrent cleanup (and who does?)
2022-10-20 15:47:15 +02:00
kurt
64d85c369b MDEV-28720 add log message if flush log failure 2022-10-19 16:00:36 +11:00
Oleksandr Byelkin
35b831d971 Merge branch 'bb-10.11-vp-MDEV-27691' into 10.11 2022-10-17 19:12:21 +02:00
Oleksandr Byelkin
2665fe4556 Merge branch 'bb-10.10-vp-MDEV-27691' into 10.10 2022-10-17 16:13:46 +02:00
Oleksandr Byelkin
069552a41d Merge branch 'bb-10.9-vp-MDEV-27691' into 10.9 2022-10-17 12:39:02 +02:00
Oleksandr Byelkin
851b31bcc4 Merge branch 'bb-10.8-vp-MDEV-27691' into 10.8 2022-10-17 08:43:55 +02:00
Oleksandr Byelkin
8a9e17103b Merge branch 'bb-10.7-vp-MDEV-27691' into 10.7 2022-10-16 21:40:08 +02:00
Oleksandr Byelkin
ce6efb584d Merge branch 'bb-10.6-vp-MDEV-27691' into 10.6 2022-10-15 23:36:57 +02:00
Oleksandr Byelkin
2a62e61511 Merge branch 'bb-10.5-vp-MDEV-27691' into 10.5 2022-10-14 12:25:11 +02:00
Oleksandr Byelkin
7cad2e94b1 Merge branch 'bb-10.4-vp-MDEV-27691' into 10.4 2022-10-14 09:04:54 +02:00
Oleksandr Byelkin
89e3815b39 Merge branch 'bb-10.3-vp-MDEV-27691' into 10.3 2022-10-14 08:29:11 +02:00
Marko Mäkelä
945a5439cc Merge 10.10 into 10.11 2022-10-13 11:03:21 +03:00
Marko Mäkelä
d66f6f0cb4 Merge 10.9 into 10.10 2022-10-13 10:57:21 +03:00
Marko Mäkelä
5197d81cdb Merge 10.8 into 10.9 2022-10-13 10:56:57 +03:00
Marko Mäkelä
618d820646 Merge 10.7 into 10.8 2022-10-13 10:42:41 +03:00
Marko Mäkelä
588efca237 Merge 10.6 into 10.7 2022-10-13 10:05:29 +03:00
Marko Mäkelä
a992c615a6 Merge 10.5 into 10.6 2022-10-12 12:14:13 +03:00
Marko Mäkelä
977c385df3 Merge 10.4 into 10.5 2022-10-12 11:29:32 +03:00
Marko Mäkelä
7434eb566e Merge 10.3 into 10.4 2022-10-11 15:18:49 +03:00
Zhibo Zhang
7a28c82dcd
MDEV-29183: Clarify mysqlbinlog command description (#2245)
The statement 'Verify checksum binlog events.' is confusing. Fix word order to make it clear.
2022-10-11 11:40:50 +01:00
Marko Mäkelä
6dc157f8a6 Merge 10.5 into 10.6 2022-10-06 09:22:39 +03:00
Marko Mäkelä
de078e060e Merge 10.4 into 10.5 2022-10-06 08:29:56 +03:00
Marko Mäkelä
df97eb1432 Remove HAVE_SNPRINTF
This fixes up commit 77c184df7c
which explicitly specifies that we use ISO/IEC 9899:1999 (C99),
which includes the snprintf() function.
2022-10-05 10:09:49 +03:00
Oleksandr Byelkin
9206c1ea97 Merge branch '10.10' into 10.11 2022-10-04 13:55:38 +02:00
Oleksandr Byelkin
bb76dcbec7 Merge branch '10.9' into 10.10 2022-10-04 13:32:38 +02:00
Oleksandr Byelkin
55e07d9ade Merge branch '10.8' into 10.9 2022-10-04 13:23:13 +02:00
Sergei Golubchik
8759967d1c MDEV-29625 Some clients/scripts refer to old slow log variables 2022-10-04 12:28:04 +02:00
Oleksandr Byelkin
2f70784c2a Merge branch '10.7' into 10.8 2022-10-04 11:42:37 +02:00
Oleksandr Byelkin
b6ebadaa66 Merge branch '10.6' into 10.7 2022-10-04 07:41:35 +02:00
Sergei Golubchik
900d7bf360 Merge branch '10.5' into 10.6 2022-10-02 22:14:21 +02:00
Sergei Golubchik
3a2116241b Merge branch '10.4' into 10.5 2022-10-02 14:38:13 +02:00
Sergei Golubchik
d4f6d2f08f Merge branch '10.3' into 10.4 2022-10-01 23:07:26 +02:00
Sergei Golubchik
194cc36805 Merge branch '10.5' into 10.6 2022-09-30 12:29:24 +02:00
Mikhail Chalov
9de9f105b5
Use memory safe snprintf() in Connect Engine and elsewhere (#2210)
Continue with similar changes as done in 19af1890 to replace sprintf(buf, ...)
with snprintf(buf, sizeof(buf), ...), specifically in the "easy" cases where buf
is allocated with a size known at compile time.

All new code of the whole pull request, including one or several files that are
either new files or modified ones, are contributed under the BSD-new license.  I
am contributing on behalf of my employer Amazon Web Services, Inc.
2022-09-28 15:45:25 +01:00
Daniel Black
620d520d68
MDEV-29614 mariadb-upgrade calls mysql and mysql-check (#2279)
rather than mariadb/mariadb-check
2022-09-28 15:20:23 +01:00
Lena Startseva
f9bf41632e Merge branch 'bb-10.9-all-builders' into bb-10.10-all-builders 2022-09-28 09:40:17 +07:00
Lena Startseva
8111d42ff3 Merge branch 'bb-10.8-all-builders' into bb-10.9-all-builders 2022-09-27 18:58:22 +07:00
Lena Startseva
c5cc8a7a75 Merge branch 'bb-10.7-all-builders' into bb-10.8-all-builders 2022-09-27 18:12:06 +07:00
Lena Startseva
410a07277f Merge branch 'bb-10.6-all-builders' into bb-10.7-all-builders 2022-09-27 14:59:07 +07:00
Lena Startseva
f8f25b472e Merge branch 'bb-10.5-all-builders' into bb-10.6-all-builders 2022-09-27 13:17:59 +07:00
Lena Startseva
d444536e1d Merge branch 'bb-10.4-all-builders' into bb-10.5-all-builders 2022-09-26 10:24:59 +07:00
Lena Startseva
78dcf71e88 Merge branch 'bb-10.3-all-builders' into bb-10.4-all-builders 2022-09-23 19:47:13 +07:00
Oleksandr Byelkin
1dd6255ffe MDEV-27691: prequisite enable/disable service connection 2022-09-23 17:36:08 +07:00
Alexander Barkov
133446828c MDEV-27009 Add UCA-14.0.0 collations
- Added one neutral and 22 tailored (language specific) collations based on
  Unicode Collation Algorithm version 14.0.0.

  Collations were added for Unicode character sets
  utf8mb3, utf8mb4, ucs2, utf16, utf32.

  Every tailoring was added with four accent and case
  sensitivity flag combinations, e.g:

  * utf8mb4_uca1400_swedish_as_cs
  * utf8mb4_uca1400_swedish_as_ci
  * utf8mb4_uca1400_swedish_ai_cs
  * utf8mb4_uca1400_swedish_ai_ci

  and their _nopad_ variants:

  * utf8mb4_uca1400_swedish_nopad_as_cs
  * utf8mb4_uca1400_swedish_nopad_as_ci
  * utf8mb4_uca1400_swedish_nopad_ai_cs
  * utf8mb4_uca1400_swedish_nopad_ai_ci

- Introducing a conception of contextually typed named collations:

  CREATE DATABASE db1 CHARACTER SET utf8mb4;
  CREATE TABLE db1.t1 (a CHAR(10) COLLATE uca1400_as_ci);

  The idea is that there is no a need to specify the character set prefix
  in the new collation names. It's enough to type just the suffix
  "uca1400_as_ci". The character set is taken from the context.

  In the above example script the context character set is utf8mb4.
  So the CREATE TABLE will make a column with the collation
  utf8mb4_uca1400_as_ci.

  Short collations names can be used in any parts of the SQL syntax
  where the COLLATE clause is understood.

- New collations are displayed only one time
  (without character set combinations) by these statements:

     SELECT * FROM INFORMATION_SCHEMA.COLLATIONS;
     SHOW COLLATION;

  For example, all these collations:
  - utf8mb3_uca1400_swedish_as_ci
  - utf8mb4_uca1400_swedish_as_ci
  - ucs2_uca1400_swedish_as_ci
  - utf16_uca1400_swedish_as_ci
  - utf32_uca1400_swedish_as_ci
  have just one entry in INFORMATION_SCHEMA.COLLATIONS and SHOW COLLATION,
  with COLLATION_NAME equal to "uca1400_swedish_as_ci", which is the suffix
  without the character set name:

SELECT COLLATION_NAME FROM INFORMATION_SCHEMA.COLLATIONS
WHERE COLLATION_NAME LIKE '%uca1400_swedish_as_ci';

+-----------------------+
| COLLATION_NAME        |
+-----------------------+
| uca1400_swedish_as_ci |
+-----------------------+

  Note, the behaviour of old collations did not change.
  Non-unicode collations (e.g. latin1_swedish_ci) and
  old UCA-4.0.0 collations (e.g. utf8mb4_unicode_ci)
  are still displayed with the character set prefix, as before.

- The structure of the table INFORMATION_SCHEMA.COLLATIONS was changed.

  The NOT NULL constraint was removed from these columns:
  - CHARACTER_SET_NAME
  - ID
  - IS_DEFAULT
  and from the corresponding columns in SHOW COLLATION.

  For example:

SELECT COLLATION_NAME, CHARACTER_SET_NAME, ID, IS_DEFAULT
FROM INFORMATION_SCHEMA.COLLATIONS
WHERE COLLATION_NAME LIKE '%uca1400_swedish_as_ci';
+-----------------------+--------------------+------+------------+
| COLLATION_NAME        | CHARACTER_SET_NAME | ID   | IS_DEFAULT |
+-----------------------+--------------------+------+------------+
| uca1400_swedish_as_ci | NULL               | NULL | NULL       |
+-----------------------+--------------------+------+------------+

  The NULL value in these columns now means that the collation
  is applicable to multiple character sets.
  The behavioir of old collations did not change.
  Make sure your client programs can handle NULL values in these columns.

- The structure of the table
  INFORMATION_SCHEMA.COLLATION_CHARACTER_SET_APPLICABILITY was changed.

  Three new NOT NULL columns were added:
  - FULL_COLLATION_NAME
  - ID
  - IS_DEFAULT

  New collations have multiple entries in COLLATION_CHARACTER_SET_APPLICABILITY.
  The column COLLATION_NAME contains the collation name without the character
  set prefix. The column FULL_COLLATION_NAME contains the collation name with
  the character set prefix.

  Old collations have full collation name in both FULL_COLLATION_NAME and
  COLLATION_NAME.

SELECT COLLATION_NAME, FULL_COLLATION_NAME, CHARACTER_SET_NAME, ID, IS_DEFAULT
FROM INFORMATION_SCHEMA.COLLATION_CHARACTER_SET_APPLICABILITY
WHERE FULL_COLLATION_NAME RLIKE '^(utf8mb4|latin1).*swedish.*ci$';
+-----------------------------+-------------------------------------+--------------------+------+------------+
| COLLATION_NAME              | FULL_COLLATION_NAME                 | CHARACTER_SET_NAME | ID   | IS_DEFAULT |
+-----------------------------+-------------------------------------+--------------------+------+------------+
| latin1_swedish_ci           | latin1_swedish_ci                   | latin1             |    8 | Yes        |
| latin1_swedish_nopad_ci     | latin1_swedish_nopad_ci             | latin1             | 1032 |            |
| utf8mb4_swedish_ci          | utf8mb4_swedish_ci                  | utf8mb4            |  232 |            |
| uca1400_swedish_ai_ci       | utf8mb4_uca1400_swedish_ai_ci       | utf8mb4            | 2368 |            |
| uca1400_swedish_as_ci       | utf8mb4_uca1400_swedish_as_ci       | utf8mb4            | 2370 |            |
| uca1400_swedish_nopad_ai_ci | utf8mb4_uca1400_swedish_nopad_ai_ci | utf8mb4            | 2372 |            |
| uca1400_swedish_nopad_as_ci | utf8mb4_uca1400_swedish_nopad_as_ci | utf8mb4            | 2374 |            |
+-----------------------------+-------------------------------------+--------------------+------+------------+

- Other INFORMATION_SCHEMA queries:

  SELECT COLLATION_NAME FROM INFORMATION_SCHEMA.COLUMNS;
  SELECT COLLATION_NAME FROM INFORMATION_SCHEMA.PARAMETERS;
  SELECT TABLE_COLLATION FROM INFORMATION_SCHEMA.TABLES;
  SELECT DEFAULT_COLLATION_NAME FROM INFORMATION_SCHEMA.SCHEMATA;
  SELECT COLLATION_NAME FROM INFORMATION_SCHEMA.ROUTINES;
  SELECT COLLATION_CONNECTION FROM INFORMATION_SCHEMA.EVENTS;
  SELECT DATABASE_COLLATION FROM INFORMATION_SCHEMA.EVENTS;
  SELECT COLLATION_CONNECTION FROM INFORMATION_SCHEMA.ROUTINES;
  SELECT DATABASE_COLLATION FROM INFORMATION_SCHEMA.ROUTINES;
  SELECT COLLATION_CONNECTION FROM INFORMATION_SCHEMA.TRIGGERS;
  SELECT DATABASE_COLLATION FROM INFORMATION_SCHEMA.TRIGGERS;
  SELECT COLLATION_CONNECTION FROM INFORMATION_SCHEMA.VIEWS;

  display full collation names, including character sets prefix,
  for all collations, including new collations.

  Corresponding SHOW commands also display full collation names
  in collation related columns:

  SHOW CREATE TABLE t1;
  SHOW CREATE DATABASE db1;
  SHOW TABLE STATUS;
  SHOW CREATE FUNCTION f1;
  SHOW CREATE PROCEDURE p1;
  SHOW CREATE EVENT ev1;
  SHOW CREATE TRIGGER tr1;
  SHOW CREATE VIEW;

  These INFORMATION_SCHEMA queries and SHOW statements may change in
  the future, to display show collation names.
2022-08-10 15:04:24 +02:00
Oleksandr Byelkin
1c192843f2 Merge branch '10.9' into 10.10 2022-08-10 14:19:15 +02:00
Oleksandr Byelkin
10ed52767d Merge branch '10.8' into 10.9 2022-08-10 13:57:24 +02:00
Oleksandr Byelkin
6ffbc0e510 Merge branch '10.7' into 10.8 2022-08-10 13:36:20 +02:00
Oleksandr Byelkin
65a963f755 Merge branch '10.6' into 10.7 2022-08-10 13:12:32 +02:00
Oleksandr Byelkin
c442e1ae21 Merge branch '10.5' into 10.6 2022-08-10 13:06:08 +02:00
Oleksandr Byelkin
1ac0bce36e Merge branch '10.4' into 10.5 2022-08-10 12:24:31 +02:00
Oleksandr Byelkin
65e8506ca9 Merge branch '10.3' into bb-10.4-release 2022-08-10 12:21:08 +02:00
fluesvamp
f2830af16c Fix typos in the codebase. 2022-08-09 18:41:09 +03:00
Oleksandr Byelkin
22d455612b Merge branch '10.8' into 10.9 2022-08-09 09:57:13 +02:00
Oleksandr Byelkin
75d631f333 Merge branch '10.7' into 10.8 2022-08-09 09:52:15 +02:00
Oleksandr Byelkin
4c18f68d59 Merge branch '10.9' into 10.10 2022-08-09 09:47:16 +02:00
Oleksandr Byelkin
564d374704 Merge branch '10.8' into 10.9 2022-08-08 17:17:45 +02:00
Oleksandr Byelkin
50b270525a Merge branch '10.7' into 10.8 2022-08-08 17:15:13 +02:00
Oleksandr Byelkin
1d48041982 Merge branch '10.6' into 10.7 2022-08-08 17:12:32 +02:00
Oleksandr Byelkin
ee620a7416 Merge branch '10.5' into 10.6 2022-08-04 16:58:42 +02:00
Oleksandr Byelkin
1e71ea806b Merge branch '10.4' into 10.5 2022-08-04 08:30:03 +02:00
Oleksandr Byelkin
e509065247 Merge branch '10.3' into 10.4 2022-08-03 19:51:44 +02:00
Sergei Golubchik
07a670b884 MDEV-23097 heap-use-after-free in mysqlimport
mysqlimport starts many worker threads. when one of the worker
encounters an error, it frees global memory and calls exit().

it suppresses memory leak detector, because, as the comment says
"dirty exit, some threads are still running", indeed, it cannot
free the memory from other threads.

but precisely because some threads are still running, they
might use this global memory, so it cannot be freed.

fix: if we know that some threads are still running and accept
that we cannot free all memory anyway, let's not free global
allocations either
2022-08-02 20:10:37 +02:00
Daniel Black
92b0a367aa MDEV-26447: mysqldump to use temporary view instead of tables.
This is particularly important for Azure where there is no
MyISAM support in their MariaDB cloud product.

Like mysqldumper does, a view can satisfy the requirement
like a table, without constraints. The views in frm files are
text form and don't have column limits.

Thanks Thomas Casteleyn for the suggestion.
2022-08-03 02:51:11 +10:00
Mike Griffin
53c4e4d054 MDEV-18702 mysqldump: add variable 'max-statement-time'
With a global non-default max-statement-time of a time interval that exceed
the query time mysqldump queries when doing a backup.

To solve both, add a max-statement-time option, defaulting to 0 (unlimited time).

Also like mariabackup, set the session wait_timeout=DEFAULT (28800). The
time/processing between mysqldump times isn't expected to get that
close ever, but let's adopt the standard of mariabackup as no-one has
challenged it has having a detrimental effect.

Reviewer and test case author Daniel Black
2022-08-02 20:31:08 +10:00
Sergei Golubchik
e1caa4bd5e don't use ssl for windows named pipes - it doesn't work 2022-07-28 17:18:40 +02:00
Sergei Golubchik
ce9385b73c MDEV-27105 --ssl option set as default for mariadb CLI
but without server cert verification
2022-07-28 17:18:39 +02:00
Marko Mäkelä
f53f64b7b9 Merge 10.8 into 10.9 2022-07-28 10:47:33 +03:00
Marko Mäkelä
f79cebb4d0 Merge 10.7 into 10.8 2022-07-28 10:33:26 +03:00
Marko Mäkelä
742e1c727f Merge 10.6 into 10.7 2022-07-27 18:26:21 +03:00
Marko Mäkelä
30914389fe Merge 10.5 into 10.6 2022-07-27 17:52:37 +03:00
Marko Mäkelä
098c0f2634 Merge 10.4 into 10.5 2022-07-27 17:17:24 +03:00