<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/mariadb-git.git/sql/table.cc, branch bb-10.5-MDEV-29693</title>
<subtitle>github.com: MariaDB/server.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/mariadb-git.git/'/>
<entry>
<title>MDEV-29693 Fix review comments</title>
<updated>2023-01-30T11:40:53+00:00</updated>
<author>
<name>Oleg Smirnov</name>
<email>olernov@gmail.com</email>
</author>
<published>2023-01-21T14:01:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/mariadb-git.git/commit/?id=855c95e2b5742788f3252ddc1c0ebea60c53252a'/>
<id>855c95e2b5742788f3252ddc1c0ebea60c53252a</id>
<content type='text'>
Part2. Get rid of virtual functions in Shared_ptr
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Part2. Get rid of virtual functions in Shared_ptr
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-29693 ANALYZE TABLE still flushes table definition cache when engine-independent statistics is used</title>
<updated>2022-12-10T06:56:40+00:00</updated>
<author>
<name>Oleg Smirnov</name>
<email>olernov@gmail.com</email>
</author>
<published>2022-10-15T10:54:40+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/mariadb-git.git/commit/?id=4b607210a817bda8c556a0674dd51c545c45b89a'/>
<id>4b607210a817bda8c556a0674dd51c545c45b89a</id>
<content type='text'>
This commits enables reloading of engine-independent statistics
without flushing the table from table definition cache. This is
achieved by using shared ownership of the statistics between TABLE
and TABLE_SHARE structures. The updated statistics replace the ones
stored in TABLE_SHARE but TABLE objects continue using the old ones
to guarantee consistency for the optimizer. Once there are no
objects referencing the old statistics they are deallocated
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commits enables reloading of engine-independent statistics
without flushing the table from table definition cache. This is
achieved by using shared ownership of the statistics between TABLE
and TABLE_SHARE structures. The updated statistics replace the ones
stored in TABLE_SHARE but TABLE objects continue using the old ones
to guarantee consistency for the optimizer. Once there are no
objects referencing the old statistics they are deallocated
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge 10.4 into 10.5</title>
<updated>2022-10-13T14:05:30+00:00</updated>
<author>
<name>Marko Mäkelä</name>
<email>marko.makela@mariadb.com</email>
</author>
<published>2022-10-13T14:05:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/mariadb-git.git/commit/?id=66e44afd946777607fd769ccf6c8c1b6d3bad174'/>
<id>66e44afd946777607fd769ccf6c8c1b6d3bad174</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 into 10.4</title>
<updated>2022-10-13T13:50:26+00:00</updated>
<author>
<name>Marko Mäkelä</name>
<email>marko.makela@mariadb.com</email>
</author>
<published>2022-10-13T13:50:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/mariadb-git.git/commit/?id=f40491155704ba6e280e2c22b722a7af1d202895'/>
<id>f40491155704ba6e280e2c22b722a7af1d202895</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-29753 An error is wrongly reported during INSERT with vcol index</title>
<updated>2022-10-12T17:49:45+00:00</updated>
<author>
<name>Nikita Malyavin</name>
<email>nikitamalyavin@gmail.com</email>
</author>
<published>2022-10-10T16:41:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/mariadb-git.git/commit/?id=128356b4b1cf3c8289ac1ba7e69a44d42e06e40c'/>
<id>128356b4b1cf3c8289ac1ba7e69a44d42e06e40c</id>
<content type='text'>
See also commits aa8a31da and 64678c for a Bug #22990029 fix.

In this scenario INSERT chose to check if delete unmarking is available for
a just deleted record. To build an update vector, it needed to calculate
the vcols as well. Since this INSERT was not IGNORE-flagged, recalculation
failed.

Solutiuon: temporarily set abort_on_warning=true, while calculating the
column for delete-unmarked insert.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
See also commits aa8a31da and 64678c for a Bug #22990029 fix.

In this scenario INSERT chose to check if delete unmarking is available for
a just deleted record. To build an update vector, it needed to calculate
the vcols as well. Since this INSERT was not IGNORE-flagged, recalculation
failed.

Solutiuon: temporarily set abort_on_warning=true, while calculating the
column for delete-unmarked insert.
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-29299 SELECT from table with vcol index reports warning</title>
<updated>2022-10-12T17:49:45+00:00</updated>
<author>
<name>Nikita Malyavin</name>
<email>nikitamalyavin@gmail.com</email>
</author>
<published>2022-08-17T15:46:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/mariadb-git.git/commit/?id=3cd2c1e8b6fa8435e634360c2ff63f5d645b65dc'/>
<id>3cd2c1e8b6fa8435e634360c2ff63f5d645b65dc</id>
<content type='text'>
As of now innodb does not store trx_id for each record in secondary index.
The idea behind is following: let us store only per-page max_trx_id, and
delete-mark the records when they are deleted/updated.

If the read starts, it rememders the lowest id of currently active
transaction. Innodb refers to it as trx-&gt;read_view-&gt;m_up_limit_id.
See also ReadView::open.

When the page is fetched, its max_trx_id is compared to m_up_limit_id.
If the value is lower, and the secondary index record is not delete-marked,
then this page is just safe to read as is. Else, a clustered index could be
needed ato access. See page_get_max_trx_id call in row_search_mvcc, and the
corresponding switch (row_search_idx_cond_check(...)) below.

Virtual columns are required to be updated in case if the record was
delete-marked. The motivation behind it is documented in
Row_sel_get_clust_rec_for_mysql::operator() near
row_sel_sec_rec_is_for_clust_rec call.

This was basically a description why virtual column computation can
normally happen during SELECT, and, generally, a vcol index access.

Sometimes stats tables are updated by innodb. This starts a new
transaction, and it can happen that it didn't finish to the moment of
SELECT execution, forcing virtual columns recomputation. If the result was
a something that normally outputs a warning, like division by zero, then
it could be outputted in a racy manner.

The solution is to suppress the warnings when a column is computed
for the described purpose.
ignore_wrnings argument is added innobase_get_computed_value.
Currently, it is only true for a call from
row_sel_sec_rec_is_for_clust_rec.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As of now innodb does not store trx_id for each record in secondary index.
The idea behind is following: let us store only per-page max_trx_id, and
delete-mark the records when they are deleted/updated.

If the read starts, it rememders the lowest id of currently active
transaction. Innodb refers to it as trx-&gt;read_view-&gt;m_up_limit_id.
See also ReadView::open.

When the page is fetched, its max_trx_id is compared to m_up_limit_id.
If the value is lower, and the secondary index record is not delete-marked,
then this page is just safe to read as is. Else, a clustered index could be
needed ato access. See page_get_max_trx_id call in row_search_mvcc, and the
corresponding switch (row_search_idx_cond_check(...)) below.

Virtual columns are required to be updated in case if the record was
delete-marked. The motivation behind it is documented in
Row_sel_get_clust_rec_for_mysql::operator() near
row_sel_sec_rec_is_for_clust_rec call.

This was basically a description why virtual column computation can
normally happen during SELECT, and, generally, a vcol index access.

Sometimes stats tables are updated by innodb. This starts a new
transaction, and it can happen that it didn't finish to the moment of
SELECT execution, forcing virtual columns recomputation. If the result was
a something that normally outputs a warning, like division by zero, then
it could be outputted in a racy manner.

The solution is to suppress the warnings when a column is computed
for the described purpose.
ignore_wrnings argument is added innobase_get_computed_value.
Currently, it is only true for a call from
row_sel_sec_rec_is_for_clust_rec.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch '10.4' into 10.5</title>
<updated>2022-10-02T12:38:13+00:00</updated>
<author>
<name>Sergei Golubchik</name>
<email>serg@mariadb.org</email>
</author>
<published>2022-10-02T12:38:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/mariadb-git.git/commit/?id=3a2116241b128b811ee2455845ff9710da3115ac'/>
<id>3a2116241b128b811ee2455845ff9710da3115ac</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 '10.3' into 10.4</title>
<updated>2022-10-01T21:07:26+00:00</updated>
<author>
<name>Sergei Golubchik</name>
<email>serg@mariadb.org</email>
</author>
<published>2022-10-01T21:07:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/mariadb-git.git/commit/?id=d4f6d2f08f228778fd7744554d8b12be05b6a114'/>
<id>d4f6d2f08f228778fd7744554d8b12be05b6a114</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-17124: mariadb 10.1.34, views and prepared statements:  ERROR 1615 (HY000): Prepared statement needs to be re-prepared</title>
<updated>2022-09-30T10:11:37+00:00</updated>
<author>
<name>Oleksandr Byelkin</name>
<email>sanja@mariadb.com</email>
</author>
<published>2019-04-17T13:50:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/mariadb-git.git/commit/?id=f65ba9aeb7eea75656c74da7c20cb4157cb8d943'/>
<id>f65ba9aeb7eea75656c74da7c20cb4157cb8d943</id>
<content type='text'>
The problem is that if table definition cache (TDC) is full of real tables
which are in tables cache, view definition can not stay there so will be
removed by its own underlying tables.
In situation above old mechanism of detection matching definition in PS
and current version always require reprepare and so prevent executing
the PS.

One work around is to increase TDC, other - improve version check for
views/triggers (which is done here). Now in suspicious cases we check:
 - timestamp (microseconds) of the view to be sure that version really
   have changed;
 - time (microseconds) of creation of a trigger related to time
   (microseconds) of statement preparation.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The problem is that if table definition cache (TDC) is full of real tables
which are in tables cache, view definition can not stay there so will be
removed by its own underlying tables.
In situation above old mechanism of detection matching definition in PS
and current version always require reprepare and so prevent executing
the PS.

One work around is to increase TDC, other - improve version check for
views/triggers (which is done here). Now in suspicious cases we check:
 - timestamp (microseconds) of the view to be sure that version really
   have changed;
 - time (microseconds) of creation of a trigger related to time
   (microseconds) of statement preparation.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge 10.4 into 10.5</title>
<updated>2022-09-26T10:34:38+00:00</updated>
<author>
<name>Marko Mäkelä</name>
<email>marko.makela@mariadb.com</email>
</author>
<published>2022-09-26T10:34:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/mariadb-git.git/commit/?id=6286a05d80f9911b7cd6ba57b04a6f67d39e499d'/>
<id>6286a05d80f9911b7cd6ba57b04a6f67d39e499d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
