<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/mariadb-git.git/mysql-test/t, branch 10.0-merge</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>WIP Merge 5.5 into bb-10.0-vicentiu</title>
<updated>2018-01-23T18:49:31+00:00</updated>
<author>
<name>Marko Mäkelä</name>
<email>marko.makela@mariadb.com</email>
</author>
<published>2018-01-23T18:49:31+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=c93405b7153df01362f9869bac7c2e305dd06af9'/>
<id>c93405b7153df01362f9869bac7c2e305dd06af9</id>
<content type='text'>
Unresolved conflicts:
	both modified:   sql/item_cmpfunc.cc
	both modified:   sql/item_cmpfunc.h
	both modified:   sql/sql_partition.cc
	both modified:   storage/tokudb/CMakeLists.txt
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Unresolved conflicts:
	both modified:   sql/item_cmpfunc.cc
	both modified:   sql/item_cmpfunc.h
	both modified:   sql/sql_partition.cc
	both modified:   storage/tokudb/CMakeLists.txt
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-14786: Server crashes in Item_cond::transform on 2nd execution of SP querying from a view</title>
<updated>2018-01-23T12:42:41+00:00</updated>
<author>
<name>Oleksandr Byelkin</name>
<email>sanja@mariadb.com</email>
</author>
<published>2018-01-15T13:50:35+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=ba8d0fa700a73893979793785ed53f7bbd950df8'/>
<id>ba8d0fa700a73893979793785ed53f7bbd950df8</id>
<content type='text'>
MDEV-14957: JOIN::prepare gets unusable "conds" as argument

Do not touch merged derived (it is irreversible)

Fix first argument of in_optimizer for calls possible before fix_fields()
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MDEV-14957: JOIN::prepare gets unusable "conds" as argument

Do not touch merged derived (it is irreversible)

Fix first argument of in_optimizer for calls possible before fix_fields()
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-14586 Assertion `0' failed in retrieve_auto_increment ...</title>
<updated>2018-01-23T11:59:58+00:00</updated>
<author>
<name>Sachin Setiya</name>
<email>sachin.setiya@maridb.com</email>
</author>
<published>2018-01-23T10:17:54+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=94da1cb4a67ecb2e2590748381eebac072308ce6'/>
<id>94da1cb4a67ecb2e2590748381eebac072308ce6</id>
<content type='text'>
Problem:-
 If we create table using myisam/aria then this crashes the server.
  CREATE TABLE t1(a bit(1), b int auto_increment , index(a,b));
  insert into t1 values(1,1);
 Or this query
  CREATE TABLE t1 (b BIT(1), pk INTEGER AUTO_INCREMENT PRIMARY KEY);
  ALTER TABLE t1 ADD INDEX(b,pk);
  INSERT INTO t1 VALUES (1,b'1');
  ALTER TABLE t1 DROP PRIMARY KEY;

Reason:-
 The reason for this is
 1st- find_ref_key() finds what key an auto_increment field belongs to by
  comparing key_part-&gt;offset and field-&gt;ptr. But BIT fields might have
  zero length in the record, so a key might have many key parts with the
  same offset. That is, comparing offsets cannot uniquely identify the
  correct key part.
 2nd- Since next_number_key_offset is zero it myisam/aria will think that
  auto_increment is in first part of key.
 3nd- myisam/aria will call retrieve_auto_key which will see first key_part
  field as a bit field and call assert(0)

Solution:-
  Many key parts might have the same offset, but BIT fields do not
  support auto_increment. So, we can skip all key parts over BIT fields,
  and then comparing offsets will be unambiguous.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem:-
 If we create table using myisam/aria then this crashes the server.
  CREATE TABLE t1(a bit(1), b int auto_increment , index(a,b));
  insert into t1 values(1,1);
 Or this query
  CREATE TABLE t1 (b BIT(1), pk INTEGER AUTO_INCREMENT PRIMARY KEY);
  ALTER TABLE t1 ADD INDEX(b,pk);
  INSERT INTO t1 VALUES (1,b'1');
  ALTER TABLE t1 DROP PRIMARY KEY;

Reason:-
 The reason for this is
 1st- find_ref_key() finds what key an auto_increment field belongs to by
  comparing key_part-&gt;offset and field-&gt;ptr. But BIT fields might have
  zero length in the record, so a key might have many key parts with the
  same offset. That is, comparing offsets cannot uniquely identify the
  correct key part.
 2nd- Since next_number_key_offset is zero it myisam/aria will think that
  auto_increment is in first part of key.
 3nd- myisam/aria will call retrieve_auto_key which will see first key_part
  field as a bit field and call assert(0)

Solution:-
  Many key parts might have the same offset, but BIT fields do not
  support auto_increment. So, we can skip all key parts over BIT fields,
  and then comparing offsets will be unambiguous.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch '5.5' into 10.0</title>
<updated>2018-01-22T21:35:50+00:00</updated>
<author>
<name>Vicențiu Ciorbaru</name>
<email>vicentiu@mariadb.org</email>
</author>
<published>2018-01-22T21:35:50+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=6e449d1ef0c79864d150090505d5b4e555ae6ab6'/>
<id>6e449d1ef0c79864d150090505d5b4e555ae6ab6</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>MDEV-14241: Server crash in key_copy / get_matching_chain_by_join_key or valgrind warnings</title>
<updated>2018-01-19T07:59:31+00:00</updated>
<author>
<name>Varun Gupta</name>
<email>varunraiko1803@gmail.com</email>
</author>
<published>2018-01-19T07:59:31+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=a7a4519a40c58947796c6d9b2e4e58acc18aeef8'/>
<id>a7a4519a40c58947796c6d9b2e4e58acc18aeef8</id>
<content type='text'>
In this case we were using the optimization derived_with_keys but we could not create a key
because the length of the key was greater than the max allowed(MI_MAX_KEY_LENGTH).
To do the join we needed to create a hash join key instead, but in the explain output it
showed that we were still referring to derived keys which were created but not used.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In this case we were using the optimization derived_with_keys but we could not create a key
because the length of the key was greater than the max allowed(MI_MAX_KEY_LENGTH).
To do the join we needed to create a hash join key instead, but in the explain output it
showed that we were still referring to derived keys which were created but not used.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fixed mdev-14960 [ERROR] mysqld got signal 11 with join_buffer and join_cache</title>
<updated>2018-01-18T17:57:25+00:00</updated>
<author>
<name>Igor Babaev</name>
<email>igor@askmonty.org</email>
</author>
<published>2018-01-18T17:20:55+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=4f96b401d9dd9f876c2d3e6e266e8670d30ca2c8'/>
<id>4f96b401d9dd9f876c2d3e6e266e8670d30ca2c8</id>
<content type='text'>
In the function JOIN::shrink_join_buffers the iteration over joined
tables was organized in a wrong way. This could cause a crash if
the optimizer chose to materialize a semi-join that used join caches
for which the sizes must be adjusted.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the function JOIN::shrink_join_buffers the iteration over joined
tables was organized in a wrong way. This could cause a crash if
the optimizer chose to materialize a semi-join that used join caches
for which the sizes must be adjusted.
</pre>
</div>
</content>
</entry>
<entry>
<title>crash with too long index comments</title>
<updated>2018-01-18T16:50:34+00:00</updated>
<author>
<name>Sergei Golubchik</name>
<email>serg@mariadb.org</email>
</author>
<published>2018-01-17T12:09:47+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=8aff418ec867419950bc2e0010f679b8f0216829'/>
<id>8aff418ec867419950bc2e0010f679b8f0216829</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-14911: zero_date is considered as NULL, depending on</title>
<updated>2018-01-15T19:19:14+00:00</updated>
<author>
<name>Igor Babaev</name>
<email>igor@askmonty.org</email>
</author>
<published>2018-01-12T23:51:10+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=6267be460ab5147e3bc0fffd03e690b3650f2fe2'/>
<id>6267be460ab5147e3bc0fffd03e690b3650f2fe2</id>
<content type='text'>
optimizer_switch

For DATE and DATETIME columns defined as NOT NULL,
"date_notnull IS NULL" has to be modified to:
"date_notnull IS NULL OR date_notnull == 0"
if date_notnull is from an inner table of outer join);
"date_notnull == 0" - otherwise.

This must hold for such columns of mergeable views and derived
tables as well. So far the code did the above re-writing only
for columns of base tables and temporary tables.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
optimizer_switch

For DATE and DATETIME columns defined as NOT NULL,
"date_notnull IS NULL" has to be modified to:
"date_notnull IS NULL OR date_notnull == 0"
if date_notnull is from an inner table of outer join);
"date_notnull == 0" - otherwise.

This must hold for such columns of mergeable views and derived
tables as well. So far the code did the above re-writing only
for columns of base tables and temporary tables.
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-14609 XA Transction unable to ROLLBACK TO SAVEPOINT</title>
<updated>2018-01-15T09:50:28+00:00</updated>
<author>
<name>Alexander Barkov</name>
<email>bar@mariadb.org</email>
</author>
<published>2018-01-15T09:50:28+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=88a9b23396531f0f0f63c1f989af69772216d442'/>
<id>88a9b23396531f0f0f63c1f989af69772216d442</id>
<content type='text'>
The function trans_rollback_to_savepoint(), unlike trans_savepoint(),
did not allow xa_state=XA_ACTIVE, so an attempt to do ROLLBCK TO SAVEPOINT
inside an XA transaction incorrectly returned an error
"...command cannot be executed ... in the ACTIVE state...".

Partially merging a MySQL patch:
  7fb5c47390311d9b1b5367f97cb8fedd4102dd05
  This is WL#7193 (Decouple THD and st_transactions)...

The currently merged part includes these changes:
- Introducing st_xid_state::check_has_uncommitted_xa()
- Reusing it in both trans_rollback_to_savepoint() and trans_savepoint(),
  so now both allow XA_ACTIVE.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The function trans_rollback_to_savepoint(), unlike trans_savepoint(),
did not allow xa_state=XA_ACTIVE, so an attempt to do ROLLBCK TO SAVEPOINT
inside an XA transaction incorrectly returned an error
"...command cannot be executed ... in the ACTIVE state...".

Partially merging a MySQL patch:
  7fb5c47390311d9b1b5367f97cb8fedd4102dd05
  This is WL#7193 (Decouple THD and st_transactions)...

The currently merged part includes these changes:
- Introducing st_xid_state::check_has_uncommitted_xa()
- Reusing it in both trans_rollback_to_savepoint() and trans_savepoint(),
  so now both allow XA_ACTIVE.
</pre>
</div>
</content>
</entry>
</feed>
