1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-23 08:45:18 +03:00
Commit Graph

89 Commits

Author SHA1 Message Date
36eba98817 MDEV-19123 Change default charset from latin1 to utf8mb4
Changing the default server character set from latin1 to utf8mb4.
2024-07-11 10:21:07 +04:00
903b5d6a83 MDEV-25829 Change default Unicode collation to uca1400_ai_ci
Step#3 The main patch
2024-05-24 15:50:05 +04:00
99b370e023 Merge branch '11.2' into 11.4 2024-05-21 19:38:51 +02:00
f9807aadef Merge branch '10.11' into 11.0 2024-05-12 12:18:28 +02:00
018d537ec1 Merge branch '10.6' into 10.11 2024-04-22 15:23:10 +02:00
829cb1a49c Merge 10.5 into 10.6 2024-04-17 14:14:58 +03:00
16aa4b5f59 Merge from 10.4 to 10.5
Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2024-04-15 17:46:49 +02:00
ed027d65f1 MDEV-33747: Optimization of (SELECT) IN (SELECT ...) executes subquery at prepare stage
Make IN->EXISTS rewrite not to compute constant left expression if it
has a subquery in it.
2024-03-26 12:45:36 +03:00
193b22d822 Merge 11.2 into 11.3 2024-01-05 14:20:35 +02:00
5be8b13735 Merge 10.11 into 11.0 2024-01-03 15:55:17 +02:00
bdf65893dd Merge 10.6 into 10.11 2024-01-03 15:37:57 +02:00
8bd5a3de7f Merge 10.5 into 10.6 2024-01-03 14:24:47 +02:00
3a3a4f044f Merge 10.4 into 10.5 2024-01-03 12:07:51 +02:00
832e96deb6 MDEV-29362 Crash with query using constant subquery as left part of IN subquery
If a query has a HAVING clause that contains a predicate with a constant
IN subquery whose lef part in its turn is a subquery and the predicate is
subject to pushdown from HAVING to WHERE then execution of the query could
cause a crash of the server.

The cause of the problem was the missing implementation of the walk()
method for the class Item_in_optimizer. As a result in some cases the left
operand of the Item_in_optimizer condition could be traversed twice by
the walk procedure. For many call-back functions used as an argument of
this procedure it does not matter. Yet it matters for the call-back
function cleanup_excluding_immutables_processor() used in pushdown of
predicates from HAVING to WHERE. If the processed item is marked with
the IMMUTABLE_FL flag then the processor just removes this flag, otherwise
it performs cleanup of the item making it unfixed. If an item is marked
with an the IMMUTABLE_FL and it traversed with this processor twice then
it becomes unfixed after the second traversal though the flag indicates
that the item should not be cleaned up.

Approved by Oleksandr Byelkin <sanja@mariadb.com>
2024-01-02 16:21:53 -08:00
34272bd6a5 Merge branch '11.2' into 11.3 2023-11-14 18:33:03 +01:00
48af85db21 Merge branch '10.11' into 11.0 2023-11-08 17:09:44 +01:00
04d9a46c41 Merge branch '10.6' into 10.10 2023-11-08 16:23:30 +01:00
b83c379420 Merge branch '10.5' into 10.6 2023-11-08 15:57:05 +01:00
6cfd2ba397 Merge branch '10.4' into 10.5 2023-11-08 12:59:00 +01:00
c886689261 MDEV-32320: Server crashes at TABLE::add_tmp_key
The code inside Item_subselect::fix_fields() could fail to check
that left expression had an Item_row, like this:

  (('x', 1.0) ,1) IN (SELECT 'x', 1.23 FROM ... UNION ...)

In order to hit the failure, the first SELECT of the subquery had
to be a degenerate no-tables select. In this case, execution will
not enter into Item_in_subselect::create_row_in_to_exists_cond()
and will not check if left_expr is composed of scalars.

But the subquery is a UNION so as a whole it is not degenerate.
We try to create an expression cache for the subquery.
We create a temp.table from left_expr columns. No field is created
for the Item_row. Then, we crash when trying to add an index over a
non-existent field.

Fixed by moving the left_expr cardinality check to a point in
check_and_do_in_subquery_rewrites() which gets executed for all
cases.
It's better to make the check early so we don't have to care about
subquery rewrite code hitting Item_row in left_expr.
2023-10-15 18:11:15 +03:00
d594f1e531 Removing MDEV-27871 because it is not a bug
Part 1
2023-10-13 14:09:22 +02:00
82174dae06 MDEV-32104 remove deprecated features
In particular:

* @@debug
  deprecated since 5.5.37
* sr_YU locale
  deprecated since 10.0.11
* "engine_condition_pushdown" in the @@optimizer_switch
  deprecated since 10.1.1
* @@date_format, @@datetime_format, @@time_format, @@max_tmp_tables
  deprecated since  10.1.2
* @@wsrep_causal_reads
  deprecated since 10.1.3
* "parser" in mroonga table comment
  deprecated since 10.2.11
2023-09-30 14:43:12 +02:00
51f9d62005 Merge branch '10.11' into 11.0 2023-08-09 07:53:48 +02:00
34a8e78581 Merge branch '10.6' into 10.9 2023-08-04 08:01:06 +02:00
6bf8483cac Merge branch '10.5' into 10.6 2023-08-01 15:08:52 +02:00
f291c3df2c Merge branch '10.4' into 10.5 2023-07-27 15:43:21 +02:00
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
4515a89814 Fixed cost calculations for materialized tables
One effect of this change in the test suite is that tests with very few
rows changed to use sub queries instead of materialization. This is
correct and expected as for these the materialization overhead is too high.

A lot of tests where fixed to still use materialization by adding a
few rows to the tables (most tests has only 2-3 rows and are thus easily
affected when cost computations are changed).

Other things:
- Added more variables to TMPTABLE_COSTS for better cost calculation
- Added cost of copying rows to TMPTABLE_COSTS lookup and write
- Added THD::optimizer_cache_hit_ratio for easier cost calculations
- Added DISK_FAST_READ_SIZE to be used when calculating costs when
  reading big blocks from a disk
2023-02-02 22:58:38 +03:00
8111d42ff3 Merge branch 'bb-10.8-all-builders' into bb-10.9-all-builders 2022-09-27 18:58:22 +07:00
f8f25b472e Merge branch 'bb-10.5-all-builders' into bb-10.6-all-builders 2022-09-27 13:17:59 +07:00
d444536e1d Merge branch 'bb-10.4-all-builders' into bb-10.5-all-builders 2022-09-26 10:24:59 +07:00
78dcf71e88 Merge branch 'bb-10.3-all-builders' into bb-10.4-all-builders 2022-09-23 19:47:13 +07:00
72ba96a48e MDEV-27691: make working view-protocol
Tests with checking metadata or that cannot be run with
the view-protocol are excluded from --view-protocol.
For tests that do not allow the use of an additional connection,
the util connection is disabled with "--disable_service_connection".
Also cases with bugs for --view-protocol are disabled.
2022-09-23 17:36:20 +07:00
50d6966c50 Merge 10.8 into 10.9 2022-08-30 13:22:57 +03:00
f410974f0f Merge 10.5 into 10.6 2022-08-30 13:01:16 +03:00
29fa9bcee0 Merge 10.4 into 10.5 2022-08-30 12:29:04 +03:00
7e574eb52c Merge 10.3 into 10.4 2022-08-30 12:17:33 +03:00
94e3f02db7 MDEV-29350 Crash when IN predicand is used in eliminated GROUP BY clause
This bug affected some queries with an IN/ALL/ANY predicand or an EXISTS
predicate whose subquery contained a GROUP BY clause that could be
eliminated. If this clause used a IN/ALL/ANY predicand whose left operand
was a single-value subquery then execution of the query caused a crash of
the server after invokation of remove_redundant_subquery_clauses().
The crash was caused by an attempt to exclude the unit for the single-value
subquery from the query tree for the second time by the function
Item_subselect::eliminate_subselect_processor().

This bug had been masked by the bug MDEV-28617 until a fix for the latter
that properly excluded units was pushed into 10.3.

Approved by Oleksandr Byelkin <sanja@mariadb.com>
2022-08-25 09:53:23 -07:00
f53f64b7b9 Merge 10.8 into 10.9 2022-07-28 10:47:33 +03:00
30914389fe Merge 10.5 into 10.6 2022-07-27 17:52:37 +03:00
098c0f2634 Merge 10.4 into 10.5 2022-07-27 17:17:24 +03:00
3bb36e9495 Merge branch '10.3' into 10.4 2022-07-27 11:02:57 +02:00
bd935a4106 MDEV-29139 Crash when using ANY predicand with redundant subquery in GROUP BY clause
This bug could cause a crash of the server when executing queries containing
ANY/ALL predicands with redundant subqueries in GROUP BY clauses.
These subqueries are eliminated by remove_redundant_subquery_clause()
together with elimination of GROUP BY list containing these subqueries.
However the references to the elements of the GROUP BY remained in the
JOIN::all_fields list of the right operand of of the ALL/ANY predicand.
Later these references confused make_aggr_tables_info() when forming
proper execution structures after ALL/ANY predicands had been replaced
with expressions containing MIN/MAX set functions.
The patch just removes these references from JOIN::all_fields list used
by the subquery of the ALL/ANY predicand when its GROUP BY clause is
eliminated.

Approved by Oleksandr Byelkin <sanja@mariadb.com>
2022-07-26 18:03:34 -07:00
3bc98a4ec4 Merge branch '10.5' into 10.6 2022-05-10 14:01:23 +02:00
ef781162ff Merge branch '10.4' into 10.5 2022-05-09 22:04:06 +02:00
a70a1cf3f4 Merge branch '10.3' into 10.4 2022-05-08 23:03:08 +02:00
9614fde1aa Merge branch '10.2' into 10.3 2022-05-03 10:59:54 +02:00
8db9aa496c MDEV-28268: Server crashes in Expression_cache_tracker::fetch_current_stats
(cherry-pick into preview-10.9-MDEV-27021-explain tree)

Expression_cache_tmptable object uses an Expression_cache_tracker object
to report the statistics.

In the common scenario, Expression_cache_tmptable destructor sets
tracker->cache=NULL. The tracker object survives after the expression
cache is deleted and one may call cache_tracker->fetch_current_stats()
for it with no harm.

However a degenerate cache with no parameters does not set
tracker->cache=NULL in Expression_cache_tmptable destructor which
results in an attempt to use freed data in the
cache_tracker->fetch_current_stats() call.

Fixed by setting tracker->cache to NULL and wrapping the assignment into
a function.
2022-04-29 11:00:37 +03:00
6daf8f8a0d Merge 10.5 into 10.6 2022-02-25 13:48:47 +02:00
b791b942e1 Merge 10.4 into 10.5 2022-02-25 13:27:41 +02:00