<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/mariadb-git.git/mysql-test/main/func_sformat.test, branch 11.1</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-27691: make working view-protocol</title>
<updated>2022-09-27T10:47:12+00:00</updated>
<author>
<name>Lena Startseva</name>
<email>lena.startseva@mariadb.com</email>
</author>
<published>2022-09-27T10:47:12+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=cee61e37b92ede2b20842b7dd9b86aff92019434'/>
<id>cee61e37b92ede2b20842b7dd9b86aff92019434</id>
<content type='text'>
Update tests for version 10.7
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update tests for version 10.7
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-26646 SFORMAT Does not allow @variable use</title>
<updated>2021-10-12T11:28:10+00:00</updated>
<author>
<name>Sergei Golubchik</name>
<email>serg@mariadb.org</email>
</author>
<published>2021-10-09T14:00:13+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=57bf8c1f35158c3bc22b343816ffe7e76af163d8'/>
<id>57bf8c1f35158c3bc22b343816ffe7e76af163d8</id>
<content type='text'>
If charset aggregation decides to convert arguments to some specific
charset and some arguments are numbers, they'll be wrapped into a
Item_func_conv_charset(), that changes result_type() to STRING_RESULT.

Fix: don't convert numbers, sformat needs their numerical value only.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If charset aggregation decides to convert arguments to some specific
charset and some arguments are numbers, they'll be wrapped into a
Item_func_conv_charset(), that changes result_type() to STRING_RESULT.

Fix: don't convert numbers, sformat needs their numerical value only.
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-26691 SFORMAT: Pass down FLOAT as FLOAT, without upcast to DOUBLE</title>
<updated>2021-10-12T11:28:10+00:00</updated>
<author>
<name>Sergei Golubchik</name>
<email>serg@mariadb.org</email>
</author>
<published>2021-10-09T13:35:22+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=6a7c10de92e913c1c9fddbf8ed34693e7d682661'/>
<id>6a7c10de92e913c1c9fddbf8ed34693e7d682661</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>remove auto-switch between char and string based on the string length</title>
<updated>2021-10-12T11:28:10+00:00</updated>
<author>
<name>Sergei Golubchik</name>
<email>serg@mariadb.org</email>
</author>
<published>2021-09-23T10:26:21+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=62d4e7e2dfce986c3cd113ca77a70aa77f73363e'/>
<id>62d4e7e2dfce986c3cd113ca77a70aa77f73363e</id>
<content type='text'>
1. it is against sql way, auto-detection should use metadata, not data,
consider:

create table t1 (qwe varchar(10)) as values ('qwe'),('qw'),('q'),('werty');
select sformat('{:*&gt;5s}', qwe) from t1;

this will auto-break on the third row.

2. using max_char_length() instead of length() fixes that, but
there's a second big issue, fmt &lt; 8.0 doesn't natively support unicode,
so {:c} would only work for one-byte strings, for 'a', not for 'я'

because of all that let's always format strings as strings.
{:c} will only now work for numbers and still only in the ascii range.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1. it is against sql way, auto-detection should use metadata, not data,
consider:

create table t1 (qwe varchar(10)) as values ('qwe'),('qw'),('q'),('werty');
select sformat('{:*&gt;5s}', qwe) from t1;

this will auto-break on the third row.

2. using max_char_length() instead of length() fixes that, but
there's a second big issue, fmt &lt; 8.0 doesn't natively support unicode,
so {:c} would only work for one-byte strings, for 'a', not for 'я'

because of all that let's always format strings as strings.
{:c} will only now work for numbers and still only in the ascii range.
</pre>
</div>
</content>
</entry>
<entry>
<title>cannot allocate a new String[] in the ::val_str() method</title>
<updated>2021-10-12T11:28:10+00:00</updated>
<author>
<name>Sergei Golubchik</name>
<email>serg@mariadb.org</email>
</author>
<published>2021-09-06T07:37:33+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=513c8b4c25e5b917916e2c6f26ef9ad1bff4890e'/>
<id>513c8b4c25e5b917916e2c6f26ef9ad1bff4890e</id>
<content type='text'>
String inherits from Sql_alloc, so it's allocated on the thd's memroot,
this cannot be done per row.

Moved String[] allocation into the Item_func_sformat constructor
(not fix_fields(), because we want it on the same memroot where the item
is).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
String inherits from Sql_alloc, so it's allocated on the thd's memroot,
this cannot be done per row.

Moved String[] allocation into the Item_func_sformat constructor
(not fix_fields(), because we want it on the same memroot where the item
is).
</pre>
</div>
</content>
</entry>
<entry>
<title>support charsets with mbminlen &gt; 1</title>
<updated>2021-10-12T11:28:10+00:00</updated>
<author>
<name>Sergei Golubchik</name>
<email>serg@mariadb.org</email>
</author>
<published>2021-09-05T11:09:40+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=8150f52e4769cd3b894549656933987c1ef8af2d'/>
<id>8150f52e4769cd3b894549656933987c1ef8af2d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>disallow {:p}</title>
<updated>2021-10-12T11:28:10+00:00</updated>
<author>
<name>Sergei Golubchik</name>
<email>serg@mariadb.org</email>
</author>
<published>2021-09-05T08:18:24+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=519bb2e41cee2d76826ae29d43c13941ebcf82c4'/>
<id>519bb2e41cee2d76826ae29d43c13941ebcf82c4</id>
<content type='text'>
by printing a String as an std::string_view, not as a char*
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
by printing a String as an std::string_view, not as a char*
</pre>
</div>
</content>
</entry>
<entry>
<title>misc cleanups</title>
<updated>2021-10-12T11:28:10+00:00</updated>
<author>
<name>Sergei Golubchik</name>
<email>serg@mariadb.org</email>
</author>
<published>2021-09-04T21:11:54+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=a363ccd6811458e0b8d0be113b08efc11b9b67cd'/>
<id>a363ccd6811458e0b8d0be113b08efc11b9b67cd</id>
<content type='text'>
* comment - use the standard style
* no need to reimplement for with while
* TODO comments for not implemented types
* rename the error not to refer to the underlying library, it's
  the implementation detail
* use res-&gt;length(0) to set length to 0, but preserve the already
  allocated buffer
* rename main.sformat -&gt; main.func_sformat
* removed a duplicated part of the test
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* comment - use the standard style
* no need to reimplement for with while
* TODO comments for not implemented types
* rename the error not to refer to the underlying library, it's
  the implementation detail
* use res-&gt;length(0) to set length to 0, but preserve the already
  allocated buffer
* rename main.sformat -&gt; main.func_sformat
* removed a duplicated part of the test
</pre>
</div>
</content>
</entry>
</feed>
