<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/mariadb-git.git/sql/sql_select.h, branch bb-10.2gr</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>MDEV-15853: Assertion `tab-&gt;filesort_result == 0' failed</title>
<updated>2018-05-10T21:53:17+00:00</updated>
<author>
<name>Varun Gupta</name>
<email>varunraiko1803@gmail.com</email>
</author>
<published>2018-05-08T09:30:17+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=16319409bf53ffb9860d82778ae0997a7a19d381'/>
<id>16319409bf53ffb9860d82778ae0997a7a19d381</id>
<content type='text'>
The issue here is that the window function execution is not called for the correct join tab, when we have GROUP BY
where we create extra temporary tables then we need to call window function execution for the last join tab. For doing
so the current code does not take into account the JOIN::aggr_tables.
Fixed by introducing a new function JOIN::total_join_tab_cnt that takes in account the temporary tables also.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The issue here is that the window function execution is not called for the correct join tab, when we have GROUP BY
where we create extra temporary tables then we need to call window function execution for the last join tab. For doing
so the current code does not take into account the JOIN::aggr_tables.
Fixed by introducing a new function JOIN::total_join_tab_cnt that takes in account the temporary tables also.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'github/10.1' into 10.2</title>
<updated>2018-02-06T13:50:50+00:00</updated>
<author>
<name>Sergei Golubchik</name>
<email>serg@mariadb.org</email>
</author>
<published>2018-02-06T13:50:50+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=4771ae4b22d2bdef0aafc563570c71d4636a2493'/>
<id>4771ae4b22d2bdef0aafc563570c71d4636a2493</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'github/10.0' into 10.1</title>
<updated>2018-02-02T09:09:44+00:00</updated>
<author>
<name>Sergei Golubchik</name>
<email>serg@mariadb.org</email>
</author>
<published>2018-02-01T20:55:30+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=d4df7bc9b1fbdfb5c98134091a9ff998af60954f'/>
<id>d4df7bc9b1fbdfb5c98134091a9ff998af60954f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge remote-tracking branch '5.5' into 10.0</title>
<updated>2018-01-24T10:29:31+00:00</updated>
<author>
<name>Vicențiu Ciorbaru</name>
<email>vicentiu@mariadb.org</email>
</author>
<published>2018-01-24T10:29:31+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=d833bb65d53b9a4375fa71cc485b4719fdb0ee53'/>
<id>d833bb65d53b9a4375fa71cc485b4719fdb0ee53</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-14715: Assertion `!table || (!table-&gt;read_set... failed in Field_num::val_decimal</title>
<updated>2018-01-22T13:39:42+00:00</updated>
<author>
<name>Vicențiu Ciorbaru</name>
<email>vicentiu@mariadb.org</email>
</author>
<published>2018-01-21T19:18:57+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=b20c3dc664314a3045fa31e2245d4613e9efa508'/>
<id>b20c3dc664314a3045fa31e2245d4613e9efa508</id>
<content type='text'>
The assertion failure was caused by an incorrectly set read_set for
functions in the ORDER BY clause in part of a union, when we are using
a mergeable view and the order by clause can be skipped (removed).

An order by clause can be skipped if it's part of one part of the UNION as
the result set is not meaningful when multiple SELECT queries are UNIONed. The
server is aware of this optimization and tries to remove the order by
clause before JOIN::prepare. The problem is that we need to throw an
error when the ORDER BY clause contains invalid columns. To do this, we
attempt resolving the ORDER BY expressions, then subsequently drop them
if resolution succeeded. However, ORDER BY resolution had the side
effect of adding the expressions to the all_fields list, which is used
to construct temporary tables to store the result. We may be ignoring
the ORDER BY statement, but the tmp table still tried to compute the
values for the expressions, even if the columns are never used.

The assertion only shows itself if the order by clause contains members
which were not previously in the select list, and are part of a
function.

There is an additional question as to why this only manifests when using
VIEWS and not when using a regular table. The difference lies with the
"reset" of the read_set for the temporary table during
SELECT_LEX::update_used_tables() in JOIN::optimize(). The changes
introduced in fdf789a7eadf864ecc0e617f25f795fafda55026 cleared the
read_set when a mergeable view is encountered in the TABLE_LIST
defintion.

Upon initial order_list resolution, the table's read_set is updated
correctly. JOIN::optimize() will only reset the read_set if it
encounters a VIEW. Since we no longer have ORDER BY clause in
JOIN::optimize() we never get to correctly update the read_set again.

Other relevant commit by Timour, which first introduced the order
resolution when we "can_skip_sort_order":
883af99e7dac91e3f258135a2053e6b8e3c05fc3

Solution:
Don't add the resolved ORDER BY elements to all_fields. We only resolve
them to check if an error should be returned for the query. Ignore them
completely otherwise.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The assertion failure was caused by an incorrectly set read_set for
functions in the ORDER BY clause in part of a union, when we are using
a mergeable view and the order by clause can be skipped (removed).

An order by clause can be skipped if it's part of one part of the UNION as
the result set is not meaningful when multiple SELECT queries are UNIONed. The
server is aware of this optimization and tries to remove the order by
clause before JOIN::prepare. The problem is that we need to throw an
error when the ORDER BY clause contains invalid columns. To do this, we
attempt resolving the ORDER BY expressions, then subsequently drop them
if resolution succeeded. However, ORDER BY resolution had the side
effect of adding the expressions to the all_fields list, which is used
to construct temporary tables to store the result. We may be ignoring
the ORDER BY statement, but the tmp table still tried to compute the
values for the expressions, even if the columns are never used.

The assertion only shows itself if the order by clause contains members
which were not previously in the select list, and are part of a
function.

There is an additional question as to why this only manifests when using
VIEWS and not when using a regular table. The difference lies with the
"reset" of the read_set for the temporary table during
SELECT_LEX::update_used_tables() in JOIN::optimize(). The changes
introduced in fdf789a7eadf864ecc0e617f25f795fafda55026 cleared the
read_set when a mergeable view is encountered in the TABLE_LIST
defintion.

Upon initial order_list resolution, the table's read_set is updated
correctly. JOIN::optimize() will only reset the read_set if it
encounters a VIEW. Since we no longer have ORDER BY clause in
JOIN::optimize() we never get to correctly update the read_set again.

Other relevant commit by Timour, which first introduced the order
resolution when we "can_skip_sort_order":
883af99e7dac91e3f258135a2053e6b8e3c05fc3

Solution:
Don't add the resolved ORDER BY elements to all_fields. We only resolve
them to check if an error should be returned for the query. Ignore them
completely otherwise.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix Compile Error while using Flag '-DUSE_ARIA_FOR_TMP_TABLES:BOOL=OFF'</title>
<updated>2018-01-06T19:03:17+00:00</updated>
<author>
<name>Sachin Setiya</name>
<email>sachinsetia1001@gmail.com</email>
</author>
<published>2018-01-06T18:21:37+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=73cf630ffc2e971fac68addc60c6fbf805665127'/>
<id>73cf630ffc2e971fac68addc60c6fbf805665127</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix out-of-date comments.</title>
<updated>2018-01-04T11:04:52+00:00</updated>
<author>
<name>Sergei Petrunia</name>
<email>psergey@askmonty.org</email>
</author>
<published>2018-01-04T11:04:52+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=c584a496d7000def48b8aad1f065c07f147998a3'/>
<id>c584a496d7000def48b8aad1f065c07f147998a3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fixed mdev-14093 Wrong result upon JOIN with INDEX with no rows</title>
<updated>2017-11-02T22:57:13+00:00</updated>
<author>
<name>Igor Babaev</name>
<email>igor@askmonty.org</email>
</author>
<published>2017-11-02T22:56:18+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=beac522b550b0c8b9c7a4451bf1b851e83fd828f'/>
<id>beac522b550b0c8b9c7a4451bf1b851e83fd828f</id>
<content type='text'>
in joined table + GROUP BY + GROUP_CONCAT + HAVING + ORDER BY
[by field from HAVING] + 1 row expected

The fix is actually a port of the fix for bug #17055185 from
mysql code line (see commit f289aeeef0743508ff87211084453b3b88a6d017
by Mithun C Y into mysql-5.6). The test case for the bug #17055185
was also ported.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
in joined table + GROUP BY + GROUP_CONCAT + HAVING + ORDER BY
[by field from HAVING] + 1 row expected

The fix is actually a port of the fix for bug #17055185 from
mysql code line (see commit f289aeeef0743508ff87211084453b3b88a6d017
by Mithun C Y into mysql-5.6). The test case for the bug #17055185
was also ported.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch '10.1' into 10.2</title>
<updated>2017-07-05T17:08:55+00:00</updated>
<author>
<name>Sergei Golubchik</name>
<email>serg@mariadb.org</email>
</author>
<published>2017-07-05T17:08:55+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=f6633bf058802ad7da8196d01fd19d75c53f7274'/>
<id>f6633bf058802ad7da8196d01fd19d75c53f7274</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge remote-tracking branch '10.0' into 10.1</title>
<updated>2017-06-21T13:19:43+00:00</updated>
<author>
<name>Vicențiu Ciorbaru</name>
<email>vicentiu@mariadb.org</email>
</author>
<published>2017-06-21T13:19:43+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=2e335a471ced0d86716f8c657f4d67f510712a30'/>
<id>2e335a471ced0d86716f8c657f4d67f510712a30</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
