Commit graph

195664 commits

Author SHA1 Message Date
Haidong Ji
d7189fbcb4 MDEV-28227 Error message Chinese translation
- Simplified Chinese translation added
- Character encoding is gdk
-- gdk covers more characters
-- gdk includes both Simplified and Traditional
-- best option I think, may need to work along with other locale
settings
- Other cleanup
-- Within each error, messages are sorted according to language code
-- More consistent formatting (8 spaces proceeding each translation)
-- jps removed as duplicate of jpn translation

This should be a good starting point. More refinement is appreciated,
and needed down the road.

English "containt" (sic) spelling fixes on ER_FK_NO_INDEX_{CHILD,PARENT}
resulting in mtr test case adjustments.

Edited/reviewed by Daniel Black
2022-04-21 13:57:08 +10:00
Thirunarayanan Balathandayuthapani
372b0e6355 MDEV-20194 Warnings inconsistently issued upon CHECK on table from older versions
The following condition has to added:
1) InnoDB fails to include the offset of the node pointer field
in non-leaf record for redundant row format.

2) If the Fixed length field does have only prefix length then
calculate the field maximum size as prefix length.

- Added the test case to test (2) and to check maximum number of
fields can exist in the index.
2022-04-20 19:55:17 +05:30
Thirunarayanan Balathandayuthapani
d91c268096 MDEV-28370 ASAN failure: InnoDB fails to free the memory allocated on dict_load_indexes()
- While loading the indexes, InnoDB fails to clear the index if the
system record has TEMP_INDEX_PREFIX_STR. This lead to ASAN failure.
The leak was introduced by commit cc2ddde4d8
(MDEV-18518)
2022-04-20 19:14:55 +05:30
Daniele Sciascia
11e5aba792 MDEV-26575 Crash on shutdown after starting an XA transaction
Disallow XA when Galera library is loaded.

Reviewed-by: Jan Lindström <jan.lindstrom@mariadb.com>
2022-04-20 10:41:19 +03:00
Rucha Deodhar
72a1250585 MDEV-28029: No warnings if server starts with "--old"
Analysis: When --old option is used, the corresponding --old-mode variables
are set but warning is not given.
Fix: Use sql_print_warning() to give warning.
2022-04-20 11:05:15 +05:30
Jan Lindström
84b135065c MDEV-28314 : The Galera cluster primary node goes into hang mode when innodb_encryption_threads is enabled
When we enable writes after Galera SST srv_n_fil_crypt_threads needs
to be set temporally to 0 (as was done when writes were disabled)
to make sure that encryption threads will be really started based
on old value of encryption threads.

Fix provided by Marko Mäkelä.
2022-04-20 07:42:21 +03:00
Rucha Deodhar
5945e420f1 MDEV-24920: Merge "old" SQL variable to "old_mode" sql variable
Analysis: There are 2 server variables- "old_mode" and "old". "old" is no
longer needed as "old_mode" has replaced it (however still used in some places
 in the code). "old_mode" and "old" has same purpose- emulate behavior from
previous MariaDB versions. So they can be merged to avoid confusion.
Fix: Deprecate "old" variable and create another mode for @@old_mode to mimic
behavior of previous "old" variable. Create specific modes for specifix task
that --old sql variable was doing earlier and use the new modes instead.
2022-04-20 00:30:22 +05:30
Brandon Nesterenko
c132bce1a1 MDEV-20119: Implement the --do-domain-ids, --ignore-domain-ids, and --ignore-server-ids options for mysqlbinlog
New Feature:
============
Extend mariadb-binlog command-line tool to allow for filtering
events using GTID domain and server ids. The functionality mimics
that of a replica server’s DO_DOMAIN_IDS, IGNORE_DOMAIN_IDS, and
IGNORE_SERVER_IDS from CHANGE MASTER TO. For completeness, this
patch additionally adds the option --do-server-ids as an alias for
--server-id, which now accepts a list of server ids instead of a
single one.

Example usage:
  mariadb-binlog --do-domain-ids=2,3,4 --do-server-ids=1,3
  master-bin.000001

Functional Notes:
 1. --do-domain-ids cannot be combined with --ignore-domain-ids
 2. --do-server-ids cannot be combined with --ignore-server-ids
 3. A domain id filter can be combined with a server id filter
 4. When any new filter options are combined with the
--gtid-strict-mode option, events from excluded domains/servers are
not validated.
 5. Domain/server id filters can be combined with GTID ranges (i.e.
specifications of --start-position and --stop-position). However,
because the --stop-position option implicitly undertakes filtering
to only output events within its range of domains, when combined
with --do-domain-ids or --ignore-domain-ids, output will consist of
the intersection between the filters. Specifically, with
--do-domain-ids and --stop-position, only events with domain ids
present in both argument lists will be output. Conversely, with
--ignore-domain-ids and --stop-position, only events with domain ids
present in the --stop-position and absent from the
--ignore-domain-ids options will be output.

Reviewed By
============
Andrei Elkin <andrei.elkin@mariadb.com>
2022-04-19 11:09:24 -06:00
Marko Mäkelä
d1edb011ee Cleanup: Remove os0thread
Let us use the common pthread_t wrapper for Microsoft Windows.

This fixes up commit dbe941e06f
2022-04-19 13:49:52 +03:00
Marko Mäkelä
b3c3291f0b MDEV-24176 fixup: GCC -Wmaybe-uninitialized 2022-04-19 10:29:21 +03:00
Jan Lindström
89b1172373 MDEV-28329 : galera_3nodes.galera_garbd_backup fails with extra connection lines
Add missing connection lines to result set
2022-04-19 08:44:51 +03:00
Aleksey Midenkov
9e314fcf6e MDEV-27749 Binary changes for --as-of and --tz-utc options
Help text update for --as-of and --tz-utc.
2022-04-18 21:45:16 +03:00
Aleksey Midenkov
08c7ab404f MDEV-24176 Server crashes after insert in the table with virtual
column generated using date_format() and if()

vcol_info->expr is allocated on expr_arena at parsing stage. Since
expr item is allocated on expr_arena all its containee items must be
allocated on expr_arena too. Otherwise fix_session_expr() will
encounter prematurely freed item.

When table is reopened from cache vcol_info contains stale
expression. We refresh expression via TABLE::vcol_fix_exprs() but
first we must prepare a proper context (Vcol_expr_context) which meets
some requirements:

1. As noted above expr update must be done on expr_arena as there may
be new items created. It was a bug in fix_session_expr_for_read() and
was just not reproduced because of no second refix. Now refix is done
for more cases so it does reproduce. Tests affected: vcol.binlog

2. Also name resolution context must be narrowed to the single table.
Tested by: vcol.update main.default vcol.vcol_syntax gcol.gcol_bugfixes

3. sql_mode must be clean and not fail expr update.

sql_mode such as MODE_NO_BACKSLASH_ESCAPES, MODE_NO_ZERO_IN_DATE, etc
must not affect vcol expression update. If the table was created
successfully any further evaluation must not fail. Tests affected:
main.func_like

Reviewed by: Sergei Golubchik <serg@mariadb.org>
2022-04-18 12:44:27 +03:00
Aleksey Midenkov
c02ebf3510 MDEV-24176 Preparations
1. moved fix_vcol_exprs() call to open_table()

mysql_alter_table() doesn't do lock_tables() so it cannot win from
fix_vcol_exprs() from there. Tests affected: main.default_session

2. Vanilla cleanups and comments.
2022-04-18 12:44:27 +03:00
Oleg Smirnov
39cc2545af MDEV-24529 Assertion failed in vers_select_conds_t::print
This commit adds processing of SYSTEM_TIME_BEFORE and SYSTEM_TIME_HISTORY
to vers_select_conds_t::print().
2022-04-18 11:19:34 +03:00
Oleg Smirnov
7498978e6a MDEV-27699 ANALYZE FORMAT=JSON fields are incorrect for UNION ALL queries
UNION ALL queries are a subject of optimization introduced in MDEV-334
when creation of a temporary table is skipped.
While there is a check for this optimization in Explain_union::print_explain()
there was no such in Explain_union::print_explain_json(). This resulted in
printing irrelevant data like:
  "union_result": {
    "table_name": "<union2,3>",
    "access_type": "ALL",
    "r_loops": 0,
    "r_rows": null
in case when creation of the temporary table was actually optimized out.
This commits adds a check whether the temporary table was actually created
during the UNION ALL processing and eliminates printing of the irrelevant data.
2022-04-18 07:50:14 +03:00
Daniele Sciascia
8a322b6b0c Disable galera_bf_abort_ps_bind under --ps-protocol 2022-04-16 08:20:54 +03:00
Marko Mäkelä
7da351d804 Merge 10.5 into 10.6 2022-04-15 21:02:10 +03:00
Marko Mäkelä
a9adfc0f68 MDEV-9948 Failing assertion: new_state->key_version != ENCRYPTION_KEY_VERSION_INVALID in fil0crypt.cc
The test encryption.innodb-redo-nokeys did not actually test
recovery without valid keys, because due to the setting
innodb_encrypt_tables, InnoDB refused to start up at all,
without even attempting any crash recovery.

fil_ibd_load(): If the encryption key is not available,
refuse to load the file.
2022-04-15 20:28:33 +03:00
Norio Akagi
1866fb0537
MDEV-28297 Deprecate spider_internal_offset
Deprecate the server variable spider_internal_offset and the corresponding
table parameters "ios" and "internal_offset".

We believe this variable is not much use to users, therefore decided to
deprecate it.

Reviewed-by: Nayuta Yanagisawa <nayuta.yanagisawa@hey.com>
2022-04-15 19:06:35 +09:00
Nayuta Yanagisawa
4abb023ba5 Spider: disable spider/bugfix.mdev_27239 2022-04-15 18:53:51 +09:00
Rucha Deodhar
f326b43cb9 Fixing merge conflicts for 10.9 json task and related bugs 2022-04-15 12:46:25 +05:30
Rucha Deodhar
c69d72c2e4 MDEV-28072: JSON_EXTRACT has inconsistent behavior with '0' value in json
path (when range is used)

Analysis: When 0 comes after space, then the json path parser changes the
state to JE_SYN instead of PS_Z (meaning parse zero). Hence the warning.
Fix: Make the state PS_Z instead of JE_SYN.
2022-04-15 01:04:52 +05:30
Rucha Deodhar
95a9078efc MDEV-28071: JSON_EXISTS returns always 1 if it is used range notation for
json path
Analysis: When searching for the given path in json string, if the current
step is of array range type, then path was considered reached which meant
path exists. So output was always true. The end indexes of range were not
evaluated.
Fix: If the current step type for a path is array range, then check if the
value array_counter[] is in range of n_item and n_item_end. If it is, then
path exists. Only then return true. If the range criteria is never met
then return false.
2022-04-15 01:04:25 +05:30
Rucha Deodhar
e6511a39f8 vcol.wrong_arena failing on buildbot when current date is '2022-03-17'
Analysis: When current date is '2022-03-17', dayname() gives 'Thursday'. The
previous json state is PS_KEYX which means key started with quote.
So now json parser for path is supposed to parse the key.
The keyname starts with 'T'. But the path transition table has JE_SYN when
previous state is PS_KEYX and next letter is 'T'. So it gives error.
Fix: We want to continue parsing the quoted keyname. So JE_SYN is incorrect.
Replaced it with PS_KNMX.
2022-04-15 01:02:44 +05:30
Rucha Deodhar
c781cefd8a MDEV-27911: Implement range notation for json path
Range can be thought about in similar manner as wildcard (*) where
more than one elements are processed. To implement range notation, extended
json parser to parse the 'to' keyword and added JSON_PATH_ARRAY_RANGE for
path type. If there is 'to' keyword then use JSON_PATH_ARRAY range for
path type along with existing type.
This new integer to store the end index of range is n_item_end.
When there is 'to' keyword, store the integer in n_item_end else store in
n_item.
2022-04-15 01:02:44 +05:30
Nayuta Yanagisawa
cc13ab0ffc MDEV-28010 Deprecate spider_crd_type and spider_crd_weight
Deprecate the variables spider_crd_type and spider_crd_weight.
The value should be defined by the engine developers.
2022-04-14 23:41:16 +09:00
Nayuta Yanagisawa
075c94fe2b MDEV-28008 Deprecate spider_crd_mode and spider_sts_mode
The variables, spider_crd_mode and spider_sts_mode, specify the
ways to fetch statistics from data nodes.

Using the SHOW command seems to work for any cases. Thus, we deprecate
the variables.
2022-04-14 23:39:42 +09:00
Nayuta Yanagisawa
7310e93ef6 MDEV-28007 Deprecate Spider plugin variables regarding statistics persistence
Deprecate the following variables:

* spider_store_last_crd
* spider_store_last_sts
* spider_load_crd_at_startup
* spider_load_sts_at_startup
2022-04-14 23:33:24 +09:00
Nayuta Yanagisawa
3be8f66185 MDEV-28244 Deprecate spider_xa_register_mode
We deprecate the variable spider_xa_register_mode because there is
no need to perform a two phase commit for a read-only transaction.

Note that the variable only affects Spider's internal XA transactions.
2022-04-14 23:31:15 +09:00
Marko Mäkelä
c235295525 Merge 10.6 into 10.7 2022-04-14 13:31:07 +03:00
Alexander Barkov
83516a33a8 An additional patch for MDEV-27690 Crash on CHARACTER SET csname COLLATE DEFAULT in column definition
Applying the fix to sql_yacc_ora.yy. Adding a test for sql_mode=ORACLE.
2022-04-14 12:22:28 +04:00
Alexander Barkov
9d734cdd61 Merge remote-tracking branch 'origin/10.2' into 10.3 2022-04-14 11:50:34 +04:00
Marko Mäkelä
2aed566d22 Cleanup: alignas(CPU_LEVEL1_DCACHE_LINESIZE)
Let us replace all use of MY_ALIGNED in InnoDB with C++11 alignas.

CACHE_LINE_SIZE: Replaced with CPU_LEVEL1_DCACHE_LINESIZE.
2022-04-14 10:40:26 +03:00
Marko Mäkelä
03f9bb8c90 MDEV-28313: Shrink ReadView::m_mutex
A few PERFORMANCE_SCHEMA instrumentation keys were not exposed
in all_innodb_mutexes[]. Let us remove them.

The keys fts_pll_tokenize_mutex_key and read_view_mutex_key were
internally used. Let us make ReadView::m_mutex use the simpler
and smaller srw_mutex, hoping to improve memory access patterns.
2022-04-14 10:21:43 +03:00
Marko Mäkelä
8074ab5784 MDEV-28313: Shrink rw_trx_hash_element_t::mutex
The element mutex is unnecessarily large. The PERFORMANCE_SCHEMA
instrumentation was not even enabled.
2022-04-14 10:10:44 +03:00
Marko Mäkelä
0cd2e6c614 MDEV-28313: InnoDB transactions are not aligned at cache lines
trx_lock_t: Remove byte pad[256] and use
alignas(CPU_LEVEL1_DCACHE_LINESIZE) instead.

trx_t: Declare n_ref (the first member) aligned at cache line.

Pool: Assert that the sizes are multiples of
CPU_LEVEL1_DCACHE_LINESIZE, and invoke an aligned allocator.
2022-04-14 10:06:34 +03:00
Sergei Golubchik
f7f0bc748e cleanup: un-inline dtype_get_mblen()
per Marko request
2022-04-13 17:50:00 +02:00
Sergei Golubchik
fc8396448c MDEV-27767 poor scaling with InnoDB and utf8mb3 because of charset stats
Access the all_charsets[] array directly in a hot loop.
This avoids get_charset() that increments a shared counter via
my_collation_statistics_inc_use_count(), causing a scalability issue.

Instead, call get_charset() when a table is opened (and InnoDB
fills in dtype_t values) - this is enough, as charset is marked
ready (MY_CS_READY) only once, on the first get_charset() call,
after that it can be accessed directly.

This also fixes a potential bug in InnoDB. It used to access charsets
directly when filling dtype_t values. This wasn't preceded by any
get_charset() call inside InnoDB. Normally the server would call
get_charset() on reading the frm, but if the table was first opened
from a purge thread InnoDB could, theoretically, access a not-ready
charset in innobase_get_cset_width().
2022-04-13 17:50:00 +02:00
Rucha Deodhar
abe9712194 MDEV-27972: Unexpected behavior with negative zero (-0) in
JSON Path

Analysis: When we have '-' followed by 0, then the state is
changed to JE_SYN, meaning syntax error.
Fix: Change the state to PS_INT instead, because we are
reading '0' next (integer) and it is not a syntax error.
2022-04-13 21:16:32 +05:30
Rucha Deodhar
dfcbb30a92 MDEV-22224: Support JSON Path negative index
This patch can be viewed as combination of two parts:
1) Enabling '-' in the path so that the parser does not give out a warning.
2) Setting the negative index to a correct value and returning the
   appropriate value.

1) To enable using the negative index in the path:
To make the parser not return warning when negative index is used in path
'-' needs to be allowed in json path characters. P_NEG is added
to enable this and is made recognizable by setting the 45th index of
json_path_chr_map[] to P_NEG (instead of previous P_ETC)
because 45 corresponds to '-' in unicode.
When the path is being parsed and '-' is encountered, the parser should
recognize it as parsing '-' sign, so a new json state PS_NEG is required.
When the state is PS_NEG, it means that a negative integer is
going to be parsed so set is_negative_index of current step to 1 and
n_item is set accordingly when integer is encountered after '-'.
Next proceed with parsing rest of the path and get the correct path.
Next thing is parsing the json and returning correct value.

2) Setting the negative index to a correct value and returning the value:
While parsing json if we encounter array and the path step for the array
is a negative index (n_item < 0), then we can count the number of elements
in the array and set n_item to correct corresponding value. This is done in
json_skip_array_and_count.
2022-04-13 21:16:32 +05:30
Oleksandr Byelkin
f130a5ea3c MDEV-28266 Crash in Field_string::type_handler when calling procedures
on_table_fill_finished() should always be done at the end of open()
even if result is not Select_materialize but (for example)
Select_fetch_into_spvars.
2022-04-13 15:37:46 +02:00
Oleksandr Byelkin
5615a78a69 MDEV-28266 Crash in Field_string::type_handler when calling procedures
on_table_fill_finished() should always be done at the end of open()
even if result is not Select_materialize but (for example)
Select_fetch_into_spvars.
2022-04-13 15:11:59 +02:00
Marko Mäkelä
e98013cb5c Merge 10.8 into 10.9 2022-04-13 13:39:00 +03:00
Nayuta Yanagisawa
cbf9d8a8d5 Merge 10.7 into 10.8 2022-04-13 17:52:27 +09:00
Marko Mäkelä
e4835bf572 MDEV-28304 innodb.instant_alter,8k.rdiff does not apply on FreeBSD
This is conceptually a backport of
commit 6f4740fde7
(re-recording the .rdiff files).
2022-04-13 09:23:52 +03:00
KiyoshiTakeda
e87c710dfc
MDEV-27981 Deprecate spider_internal_limit
The variable spider_internal_limit is for specifying the number of
records acquired by Spider from each remote server. 

There seems not to be much use of the variable. Thus, we deprecate it
and the corresponding table options. 

Reviewed-by: Nayuta Yanagisawa <nayuta.yanagisawa@hey.com>
2022-04-13 15:21:15 +09:00
Daniel Black
bea47a6f59 MDEV-27791: rocksdb_log_dir test postfix
We can only remove a subdirectory in mtr on an installed instance

Example failure previously:

CURRENT_TEST: rocksdb.rocksdb_log_dir
mysqltest: At line 15: Path '/usr/local/mariadb-10.9.0-linux-systemd-x86_64/mysql-test/var/tmp/1' is not a subdirectory of MYSQLTEST_VARDIR '/usr/local/mariadb-10.9.0-linux-systemd-x86_64/mysql-test/var/1'or MYSQL_TMP_DIR '/usr/local/mariadb-10.9.0-linux-systemd-x86_64/mysql-test/var/tmp/1'
2022-04-13 15:46:56 +10:00
Xinyi Hong
1ac87d6dd4 MDEV-27791: Create a new MyRocks parameter rocksdb_log_dir
Parameter rocksdb_log_dir specifies the path of MyRocks error logs.

By default, the error logs are stored in the same folder with MyRocks
redo logs. Being able to put human readable logs in one place and
machine logs in another place improves usability.

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-04-13 08:36:33 +10:00
Julius Goryavsky
42908dc5fb MDEV-26171: wsrep_sst_receive_address does not parse IPv6 address correctly
This commit fixes problems with parsing ipv6 addresses given via
the wsrep_sst_receive_address and wsrep_node_address options.

Also, this commit removes extra lines in the configuration files
in the mtr test suites for Galera related to these parameters.
2022-04-12 17:14:39 +02:00