<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/mariadb-git.git/sql/sql_derived.cc, branch 10.56-MDEV-30986</title>
<subtitle>github.com: MariaDB/server.git
</subtitle>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/'/>
<entry>
<title>Merge remote-tracking branch '10.4' into 10.5</title>
<updated>2023-03-31T19:32:41+00:00</updated>
<author>
<name>Oleksandr Byelkin</name>
<email>sanja@mariadb.com</email>
</author>
<published>2023-03-31T19:32:41+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=ac5a534a4caa6c86762e721dfe7183be2fee29ca'/>
<id>ac5a534a4caa6c86762e721dfe7183be2fee29ca</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-30706 Different results of selects from view and CTE with same definition</title>
<updated>2023-03-02T15:51:33+00:00</updated>
<author>
<name>Igor Babaev</name>
<email>igor@askmonty.org</email>
</author>
<published>2023-03-02T06:49:27+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=ccec9b1de95a66b7597bc30e0a60bd61866f225d'/>
<id>ccec9b1de95a66b7597bc30e0a60bd61866f225d</id>
<content type='text'>
MDEV-30668 Set function aggregated in outer select used in view definition

This patch fixes two bugs concerning views whose specifications contain
subqueries with set functions aggregated in outer selects.
Due to the first bug those such views that have implicit grouping were
considered as mergeable. This led to wrong result sets for selects from
these views.
Due to the second bug the aggregation select was determined incorrectly and
this led to bogus error messages.
The patch added several test cases for these two bugs and for four other
duplicate bugs.
The patch also enables view-protocol for many other test cases.

Approved by Oleksandr Byelkin &lt;sanja@mariadb.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MDEV-30668 Set function aggregated in outer select used in view definition

This patch fixes two bugs concerning views whose specifications contain
subqueries with set functions aggregated in outer selects.
Due to the first bug those such views that have implicit grouping were
considered as mergeable. This led to wrong result sets for selects from
these views.
Due to the second bug the aggregation select was determined incorrectly and
this led to bogus error messages.
The patch added several test cases for these two bugs and for four other
duplicate bugs.
The patch also enables view-protocol for many other test cases.

Approved by Oleksandr Byelkin &lt;sanja@mariadb.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge 10.4 into 10.5</title>
<updated>2022-11-08T15:01:28+00:00</updated>
<author>
<name>Marko Mäkelä</name>
<email>marko.makela@mariadb.com</email>
</author>
<published>2022-11-08T15:01:28+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=a732d5e2ba3d63a08e20670535d4cd29f667daf0'/>
<id>a732d5e2ba3d63a08e20670535d4cd29f667daf0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-29624 MDEV-29655 Fix ASAN errors on pushdown of derived table</title>
<updated>2022-10-31T15:20:17+00:00</updated>
<author>
<name>Oleg Smirnov</name>
<email>olernov@gmail.com</email>
</author>
<published>2022-10-19T09:26:19+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=0d927a57d2bfb32384dd024b9b4d1009fa22555a'/>
<id>0d927a57d2bfb32384dd024b9b4d1009fa22555a</id>
<content type='text'>
Deallocation of TABLE_LIST::dt_handler and TABLE_LIST::pushdown_derived
was performed in multiple places if code. This not only made the code
more difficult to maintain but also led to memory leaks and
ASAN heap-use-after-free errors.
This commit puts deallocation of TABLE_LIST::dt_handler and
TABLE_LIST::pushdown_derived to the single point - JOIN::cleanup()
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Deallocation of TABLE_LIST::dt_handler and TABLE_LIST::pushdown_derived
was performed in multiple places if code. This not only made the code
more difficult to maintain but also led to memory leaks and
ASAN heap-use-after-free errors.
This commit puts deallocation of TABLE_LIST::dt_handler and
TABLE_LIST::pushdown_derived to the single point - JOIN::cleanup()
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge 10.4 into 10.5</title>
<updated>2021-07-02T10:02:26+00:00</updated>
<author>
<name>Marko Mäkelä</name>
<email>marko.makela@mariadb.com</email>
</author>
<published>2021-07-02T10:02:26+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=15dcb8bd3e80d233107a6ad17751d46e1839cf85'/>
<id>15dcb8bd3e80d233107a6ad17751d46e1839cf85</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge 10.3 -&gt; 10.4</title>
<updated>2021-06-30T15:41:46+00:00</updated>
<author>
<name>Sergei Petrunia</name>
<email>psergey@askmonty.org</email>
</author>
<published>2021-06-30T15:13:08+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=eebe2090c848b5cedc5235473d80dbd2c25d2943'/>
<id>eebe2090c848b5cedc5235473d80dbd2c25d2943</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge 10.2-&gt;10.3</title>
<updated>2021-06-30T12:06:54+00:00</updated>
<author>
<name>Sergei Petrunia</name>
<email>psergey@askmonty.org</email>
</author>
<published>2021-06-30T12:06:54+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=586870f9effa48831fda2590f2aee2b95b30be39'/>
<id>586870f9effa48831fda2590f2aee2b95b30be39</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-25969: Condition pushdown into derived table doesn't work if select list uses SP</title>
<updated>2021-06-30T10:52:23+00:00</updated>
<author>
<name>Sergei Petrunia</name>
<email>psergey@askmonty.org</email>
</author>
<published>2021-06-29T13:31:28+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=eb20c91b55e4b51be533314994b36bf9b24016f3'/>
<id>eb20c91b55e4b51be533314994b36bf9b24016f3</id>
<content type='text'>
Consider a query of the form:

  select ... from (select item2 as COL1) as T where COL1=123

Condition pushdown into derived table will try to push "COL1=123" condition
down into table T.
The process of pushdown involves "substituting" the item, that is,
replacing Item_field("T.COL1") with its "producing item" item2.
In order to use item2, one needs to clone it (call Item::build_clone).

If the item is not cloneable (e.g. Item_func_sp is not), the pushdown
process will fail and nothing at all will be pushed.

Fixed by introducing transform_condition_or_part() which will try to apply
the transformation for as many parts of condition as possible. The parts of
condition that couldn't be transformed are dropped.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Consider a query of the form:

  select ... from (select item2 as COL1) as T where COL1=123

Condition pushdown into derived table will try to push "COL1=123" condition
down into table T.
The process of pushdown involves "substituting" the item, that is,
replacing Item_field("T.COL1") with its "producing item" item2.
In order to use item2, one needs to clone it (call Item::build_clone).

If the item is not cloneable (e.g. Item_func_sp is not), the pushdown
process will fail and nothing at all will be pushed.

Fixed by introducing transform_condition_or_part() which will try to apply
the transformation for as many parts of condition as possible. The parts of
condition that couldn't be transformed are dropped.
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-25679 Wrong result selecting from simple view with LIMIT and ORDER BY</title>
<updated>2021-06-22T05:25:37+00:00</updated>
<author>
<name>Igor Babaev</name>
<email>igor@askmonty.org</email>
</author>
<published>2021-06-22T05:25:37+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=6e94ef41859cc628f92224e33dd661d9a4be215b'/>
<id>6e94ef41859cc628f92224e33dd661d9a4be215b</id>
<content type='text'>
This bug affected queries with views / derived_tables / CTEs whose
specifications were of the form
  (SELECT ... LIMIT &lt;n&gt;) ORDER BY ...
Units representing such specifications contains one SELECT_LEX structure
for (SELECT ... LIMIT &lt;n&gt;) and additionally SELECT_LEX structure for
fake_select_lex. This fact should have been taken into account in the
function mysql_derived_fill().

This patch has to be applied to 10.2 and 10.3 only.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This bug affected queries with views / derived_tables / CTEs whose
specifications were of the form
  (SELECT ... LIMIT &lt;n&gt;) ORDER BY ...
Units representing such specifications contains one SELECT_LEX structure
for (SELECT ... LIMIT &lt;n&gt;) and additionally SELECT_LEX structure for
fake_select_lex. This fact should have been taken into account in the
function mysql_derived_fill().

This patch has to be applied to 10.2 and 10.3 only.
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-25679 Wrong result selecting from simple view with LIMIT and ORDER BY</title>
<updated>2021-06-21T23:21:17+00:00</updated>
<author>
<name>Igor Babaev</name>
<email>igor@askmonty.org</email>
</author>
<published>2021-06-21T23:15:07+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=cc0bd8431f9a2b252697afab78e039b8cd294d01'/>
<id>cc0bd8431f9a2b252697afab78e039b8cd294d01</id>
<content type='text'>
This bug affected queries with views / derived_tables / CTEs whose
specifications were of the form
  (SELECT ... LIMIT &lt;n&gt;) ORDER BY ...
Units representing such specifications contains one SELECT_LEX structure
for (SELECT ... LIMIT &lt;n&gt;) and additionally SELECT_LEX structure for
fake_select_lex. This fact should have been taken into account in the
function mysql_derived_fill().

This patch has to be applied to 10.2 and 10.3 only.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This bug affected queries with views / derived_tables / CTEs whose
specifications were of the form
  (SELECT ... LIMIT &lt;n&gt;) ORDER BY ...
Units representing such specifications contains one SELECT_LEX structure
for (SELECT ... LIMIT &lt;n&gt;) and additionally SELECT_LEX structure for
fake_select_lex. This fact should have been taken into account in the
function mysql_derived_fill().

This patch has to be applied to 10.2 and 10.3 only.
</pre>
</div>
</content>
</entry>
</feed>
