<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/mariadb-git.git/sql/rpl_utility.cc, branch bb-10.2-MDEV-23989</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-19925: Column ... cannot be converted from type 'varchar(20)' to type 'varchar(20)'</title>
<updated>2019-08-27T07:35:04+00:00</updated>
<author>
<name>Sujatha</name>
<email>sujatha.sivakumar@mariadb.com</email>
</author>
<published>2019-08-27T07:35:04+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=e7b71e0daa49ca9b5becbf2739ed13d7c8c4fcd6'/>
<id>e7b71e0daa49ca9b5becbf2739ed13d7c8c4fcd6</id>
<content type='text'>
Cherry picking:
Bug#25135304: RBR: WRONG FIELD LENGTH IN ERROR MESSAGE
commit 47bd3f7cf3c8518f62b1580ec65af2ba7ac13b95

Description:
============
In row based replication, when replicating from a table with a field with
character set set to UTF8mb3 to the same table with the same field set to
character set UTF8mb4 I get a confusing error message:

For VARCHAR: VARCHAR(1) 'utf8mb3' to VARCHAR(1) 'utf8mb4'
"Column 0 of table 'test.t1' cannot be converted from type 'varchar(3)' to
type 'varchar(1)'"

Similar issue with CHAR type as well.

Issue with respect to BLOB types:

For BLOB: LONGBLOB to TINYBLOB - Error message displays incorrect blob type.
"Column 0 of table 'test.t1' cannot be converted from type 'tinyblob' to type
'tinyblob'"

For BINARY to BINARY - Error message displays incorrect type for master side
field.
"Column 0 of table 'test.t' cannot be converted from type 'char(1)' to type
'binary(10)'"
Similar issue exists for VARBINARY type. It is displayed as 'VARCHAR'.

Analysis:
=========
In Row based replication charset information is not sent as part of metadata
from master to slave.

For VARCHAR field its character length is converted into equivalent
octets/bytes and stored internally. At the time of displaying the data to user
it is converted back to original character length.

For example:
VARCHAR(2)- utf8mb3 is stored as:2*3 = VARCHAR(6)
At the time of displaying it to user
VARCHAR(6)- charset utf8mb3:6/3= VARCHAR(2).

At present the internally converted octect length is sent from master to slave
with out providing the charset information. On slave side if the type
conversion fails 'show_sql_type' function is used to get the type specific
information from metadata. Since there is no charset information is available
the filed type is displayed as VARCHAR(6).

This results in confused error message.

For CHAR fields
CHAR(1)- utf8mb3 - CHAR(3)
CHAR(1)- utf8mb4 - CHAR(4)

'show_sql_type' function which retrieves type information from metadata uses
(bytes/local charset length) to get actual character length. If slave's chaset
is 'utf8mb4' then

CHAR(3/4)--&gt;CHAR(0)
CHAR(4/4)--&gt;CHAR(1).

This results in confused error message.

Analysis for BLOB type issue:

BLOB's length is represented in two forms.
1. Actual length
i.e
  (length &lt; 256) type= MYSQL_TYPE_TINY_BLOB;
  (length &lt; 65536) type= MYSQL_TYPE_BLOB; ...

2. packlength - The number of bytes used to represent the length of the blob
  1- tinyblob
  2- blob ...

In row based replication only the packlength is written in the binary log. On
the slave side this packlength is interpreted as actual length of the blob.
Hence the length is always &lt; 256 and the type is displayed as tiny blob.

Analysis for BINARY to BINARY type issue:
The character set information is needed to identify a filed's type as char or
binary. Since master side character set information is not available on the
slave side both binary and char fields are displayed as char.

Fix:
===
For CHAR and VARCHAR fields display their length in octets for both source and
target fields. For target field display the charset information if it is
relevant.

For blob type changed the code to use the packlength and display appropriate
blob type in error message.

For binary and varbinary fields use the slave side character set as reference
to map them to binary or varbinary fields.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Cherry picking:
Bug#25135304: RBR: WRONG FIELD LENGTH IN ERROR MESSAGE
commit 47bd3f7cf3c8518f62b1580ec65af2ba7ac13b95

Description:
============
In row based replication, when replicating from a table with a field with
character set set to UTF8mb3 to the same table with the same field set to
character set UTF8mb4 I get a confusing error message:

For VARCHAR: VARCHAR(1) 'utf8mb3' to VARCHAR(1) 'utf8mb4'
"Column 0 of table 'test.t1' cannot be converted from type 'varchar(3)' to
type 'varchar(1)'"

Similar issue with CHAR type as well.

Issue with respect to BLOB types:

For BLOB: LONGBLOB to TINYBLOB - Error message displays incorrect blob type.
"Column 0 of table 'test.t1' cannot be converted from type 'tinyblob' to type
'tinyblob'"

For BINARY to BINARY - Error message displays incorrect type for master side
field.
"Column 0 of table 'test.t' cannot be converted from type 'char(1)' to type
'binary(10)'"
Similar issue exists for VARBINARY type. It is displayed as 'VARCHAR'.

Analysis:
=========
In Row based replication charset information is not sent as part of metadata
from master to slave.

For VARCHAR field its character length is converted into equivalent
octets/bytes and stored internally. At the time of displaying the data to user
it is converted back to original character length.

For example:
VARCHAR(2)- utf8mb3 is stored as:2*3 = VARCHAR(6)
At the time of displaying it to user
VARCHAR(6)- charset utf8mb3:6/3= VARCHAR(2).

At present the internally converted octect length is sent from master to slave
with out providing the charset information. On slave side if the type
conversion fails 'show_sql_type' function is used to get the type specific
information from metadata. Since there is no charset information is available
the filed type is displayed as VARCHAR(6).

This results in confused error message.

For CHAR fields
CHAR(1)- utf8mb3 - CHAR(3)
CHAR(1)- utf8mb4 - CHAR(4)

'show_sql_type' function which retrieves type information from metadata uses
(bytes/local charset length) to get actual character length. If slave's chaset
is 'utf8mb4' then

CHAR(3/4)--&gt;CHAR(0)
CHAR(4/4)--&gt;CHAR(1).

This results in confused error message.

Analysis for BLOB type issue:

BLOB's length is represented in two forms.
1. Actual length
i.e
  (length &lt; 256) type= MYSQL_TYPE_TINY_BLOB;
  (length &lt; 65536) type= MYSQL_TYPE_BLOB; ...

2. packlength - The number of bytes used to represent the length of the blob
  1- tinyblob
  2- blob ...

In row based replication only the packlength is written in the binary log. On
the slave side this packlength is interpreted as actual length of the blob.
Hence the length is always &lt; 256 and the type is displayed as tiny blob.

Analysis for BINARY to BINARY type issue:
The character set information is needed to identify a filed's type as char or
binary. Since master side character set information is not available on the
slave side both binary and char fields are displayed as char.

Fix:
===
For CHAR and VARCHAR fields display their length in octets for both source and
target fields. For target field display the charset information if it is
relevant.

For blob type changed the code to use the packlength and display appropriate
blob type in error message.

For binary and varbinary fields use the slave side character set as reference
to map them to binary or varbinary fields.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge 10.1 into 10.2</title>
<updated>2019-05-13T14:54:04+00:00</updated>
<author>
<name>Marko Mäkelä</name>
<email>marko.makela@mariadb.com</email>
</author>
<published>2019-05-13T14:47:26+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=26a14ee1308df65ebb9dda9a8618e64f2f2fc518'/>
<id>26a14ee1308df65ebb9dda9a8618e64f2f2fc518</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 '5.5' into 10.1</title>
<updated>2019-05-11T19:19:05+00:00</updated>
<author>
<name>Vicențiu Ciorbaru</name>
<email>vicentiu@mariadb.org</email>
</author>
<published>2019-05-11T19:19:05+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=cb248f880619431850e5638009a6098048050edf'/>
<id>cb248f880619431850e5638009a6098048050edf</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Update FSF Address</title>
<updated>2019-05-11T18:29:06+00:00</updated>
<author>
<name>Vicențiu Ciorbaru</name>
<email>vicentiu@mariadb.org</email>
</author>
<published>2019-05-11T18:29:06+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=5543b75550962f07b4adcd47a6e52accec0a7d0f'/>
<id>5543b75550962f07b4adcd47a6e52accec0a7d0f</id>
<content type='text'>
* Update wrong zip-code
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Update wrong zip-code
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-17098 DATE -&gt; DATETIME replication conversion not working, even in ALL_NON_LOSSY mode</title>
<updated>2018-10-16T09:56:33+00:00</updated>
<author>
<name>Andrei Elkin</name>
<email>andrei.elkin@mariadb.com</email>
</author>
<published>2018-10-03T18:45:05+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=2308b9afec559cd8c5717007a7ad6821c374370d'/>
<id>2308b9afec559cd8c5717007a7ad6821c374370d</id>
<content type='text'>
Opened up MYSQL_TYPE _DATETIME{,2} &lt;-&gt; _NEWDATE conversions for replication.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Opened up MYSQL_TYPE _DATETIME{,2} &lt;-&gt; _NEWDATE conversions for replication.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch '10.1' into 10.2</title>
<updated>2016-02-25T17:19:55+00:00</updated>
<author>
<name>Sergei Golubchik</name>
<email>serg@mariadb.org</email>
</author>
<published>2016-02-25T17:19:55+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=00d1db7a38b17d4512a6ba5147926608aca5624d'/>
<id>00d1db7a38b17d4512a6ba5147926608aca5624d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-9560 Mariadb 10.1 Crashes when replicating from 10.0</title>
<updated>2016-02-23T09:46:16+00:00</updated>
<author>
<name>Sergei Golubchik</name>
<email>serg@mariadb.org</email>
</author>
<published>2016-02-20T18:30:14+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=a38b705fe072f282c4d27fe48d7863d6c0cdbdf2'/>
<id>a38b705fe072f282c4d27fe48d7863d6c0cdbdf2</id>
<content type='text'>
when replicating old temporal type fields (that don't store
metadata in the binlog), take the precision from
destination fields.

(this fixes the replication failure, crashes were
fixed in a different commit)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
when replicating old temporal type fields (that don't store
metadata in the binlog), take the precision from
destination fields.

(this fixes the replication failure, crashes were
fixed in a different commit)
</pre>
</div>
</content>
</entry>
<entry>
<title>correct temporal fields in max_display_length_for_field()</title>
<updated>2016-02-23T09:46:16+00:00</updated>
<author>
<name>Sergei Golubchik</name>
<email>serg@mariadb.org</email>
</author>
<published>2016-02-19T13:17:35+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=4cabc608b6c3c16d800d6cd80c730171a534566f'/>
<id>4cabc608b6c3c16d800d6cd80c730171a534566f</id>
<content type='text'>
it's *display length* (a.k.a. field_length)
not storage length (a.k.a. pack_length)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
it's *display length* (a.k.a. field_length)
not storage length (a.k.a. pack_length)
</pre>
</div>
</content>
</entry>
<entry>
<title>cleanup</title>
<updated>2016-02-23T09:46:16+00:00</updated>
<author>
<name>Sergei Golubchik</name>
<email>serg@mariadb.org</email>
</author>
<published>2016-02-19T11:06:37+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=d4b1425b604b8be9fc35cefe45d00cfecbac39e9'/>
<id>d4b1425b604b8be9fc35cefe45d00cfecbac39e9</id>
<content type='text'>
* make a local variable for target_table-&gt;field[col]
* move an often-used bit function to my_bit.h
* remove a non-static and not really needed trivial comparison
  function with a very generic name
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* make a local variable for target_table-&gt;field[col]
* move an often-used bit function to my_bit.h
* remove a non-static and not really needed trivial comparison
  function with a very generic name
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-9238 Wrap create_virtual_tmp_table() into a class, split into different steps</title>
<updated>2015-12-04T12:38:42+00:00</updated>
<author>
<name>Alexander Barkov</name>
<email>bar@mariadb.org</email>
</author>
<published>2015-12-04T12:38:42+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=aee068085ddb13f700780eeb61fce29c1e37df63'/>
<id>aee068085ddb13f700780eeb61fce29c1e37df63</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
