<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/mariadb-git.git/sql/item_strfunc.cc, branch bb-10.4-mdev16991</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-16991 Rounding vs truncation for TIME, DATETIME, TIMESTAMP</title>
<updated>2018-11-26T04:10:47+00:00</updated>
<author>
<name>Alexander Barkov</name>
<email>bar@mariadb.com</email>
</author>
<published>2018-11-23T15:04:42+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=4447a02cf13a49876001a40ca7db8fdedb731fd5'/>
<id>4447a02cf13a49876001a40ca7db8fdedb731fd5</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>2018-10-10T07:36:51+00:00</updated>
<author>
<name>Marko Mäkelä</name>
<email>marko.makela@mariadb.com</email>
</author>
<published>2018-10-10T07:36:51+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=2a955c7a834aca8ae966a2922cd289bf2f9d67d9'/>
<id>2a955c7a834aca8ae966a2922cd289bf2f9d67d9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-17216 Assertion `!dt-&gt;fraction_remainder(decimals())' failed in Field_temporal_with_date::store_TIME_with_warning</title>
<updated>2018-10-09T08:02:35+00:00</updated>
<author>
<name>Alexander Barkov</name>
<email>bar@mariadb.com</email>
</author>
<published>2018-10-09T08:02:35+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=5646c4315918c1e4127bfb68b70d1c5333bfc2c7'/>
<id>5646c4315918c1e4127bfb68b70d1c5333bfc2c7</id>
<content type='text'>
The problem happened because {{Field_xxx::store(longlong nr, bool unsigned_val)}} erroneously passed {{unsigned_flag}} to the {{usec}} parameter of this constructor:
{code:cpp}
Datetime(int *warn, longlong sec, ulong usec, date_conv_mode_t flags)
{code}

1. Changing Time and Datetime constructors to accept data as Sec6 rather than as
longlong/double/my_decimal, so it's not possible to do such mistakes
in the future. Additional good effect of these changes:
- This reduced some amount of similar code (minus ~35 lines).
- The code now does not rely on the fact that "unsigned_flag" is
   not important inside Datetime().
  The constructor always gets all three parts: sign, integer part,
  fractional part. The simple the better.

2. Fixing Field_xxx::store() to use the new Datetime constructor format.
   This change actually fixes the problem.

3. Adding "explicit" keyword to all Sec6 constructors,
to avoid automatic hidden conversion from double/my_decimal to Sec6,
as well as from longlong/ulonglong through double to Sec6.

4. Change#1 caused (as a dependency) changes in a few places
   with code like this:

  bool neg= nr &lt; 0 &amp;&amp; !unsigned_val;
  ulonglong value= m_neg ? (ulonglong) -nr : (ulonglong) nr;

These fragments relied on a non-standard behavior with
the operator "minus" applied to the lowest possible negative
signed long long value. This can lead to different results
depending on the platform and compilation flags.
We have fixed such bugs a few times already.
So instead of modifying the old wrong code to a new wrong code,
replacing all such fragments to use Longlong_hybrid,
which correctly handles this special case with -LONGLONG_MIN
in its method abs().
This also reduced the amount of similar code
(1 or 2 new lines instead 3 old lines in all 6 such fragments).

5. Removing ErrConvInteger(longlong nr, bool unsigned_flag= false)
   and adding ErrConvInteger(Longlong_hybrid) instead, to encourage
   use of safe Longlong_hybrid instead of unsafe pairs nr+neg.

6. Removing unused ErrConvInteger from Item_cache_temporal::get_date()
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The problem happened because {{Field_xxx::store(longlong nr, bool unsigned_val)}} erroneously passed {{unsigned_flag}} to the {{usec}} parameter of this constructor:
{code:cpp}
Datetime(int *warn, longlong sec, ulong usec, date_conv_mode_t flags)
{code}

1. Changing Time and Datetime constructors to accept data as Sec6 rather than as
longlong/double/my_decimal, so it's not possible to do such mistakes
in the future. Additional good effect of these changes:
- This reduced some amount of similar code (minus ~35 lines).
- The code now does not rely on the fact that "unsigned_flag" is
   not important inside Datetime().
  The constructor always gets all three parts: sign, integer part,
  fractional part. The simple the better.

2. Fixing Field_xxx::store() to use the new Datetime constructor format.
   This change actually fixes the problem.

3. Adding "explicit" keyword to all Sec6 constructors,
to avoid automatic hidden conversion from double/my_decimal to Sec6,
as well as from longlong/ulonglong through double to Sec6.

4. Change#1 caused (as a dependency) changes in a few places
   with code like this:

  bool neg= nr &lt; 0 &amp;&amp; !unsigned_val;
  ulonglong value= m_neg ? (ulonglong) -nr : (ulonglong) nr;

These fragments relied on a non-standard behavior with
the operator "minus" applied to the lowest possible negative
signed long long value. This can lead to different results
depending on the platform and compilation flags.
We have fixed such bugs a few times already.
So instead of modifying the old wrong code to a new wrong code,
replacing all such fragments to use Longlong_hybrid,
which correctly handles this special case with -LONGLONG_MIN
in its method abs().
This also reduced the amount of similar code
(1 or 2 new lines instead 3 old lines in all 6 such fragments).

5. Removing ErrConvInteger(longlong nr, bool unsigned_flag= false)
   and adding ErrConvInteger(Longlong_hybrid) instead, to encourage
   use of safe Longlong_hybrid instead of unsafe pairs nr+neg.

6. Removing unused ErrConvInteger from Item_cache_temporal::get_date()
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge 10.2 into 10.3</title>
<updated>2018-10-09T06:11:30+00:00</updated>
<author>
<name>Marko Mäkelä</name>
<email>marko.makela@mariadb.com</email>
</author>
<published>2018-10-09T06:11:30+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=43ee6915fa4b8e3088e89b7d4325946190ce04f5'/>
<id>43ee6915fa4b8e3088e89b7d4325946190ce04f5</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove valgrind warnings from Item_str_concat</title>
<updated>2018-10-05T11:25:40+00:00</updated>
<author>
<name>Michael Widenius</name>
<email>monty@mariadb.org</email>
</author>
<published>2018-09-20T03:13:43+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=6c97e85673602199f51dd4bbcb1cf93cbf47ffc9'/>
<id>6c97e85673602199f51dd4bbcb1cf93cbf47ffc9</id>
<content type='text'>
This warning come from a copy() operation of type:
memcpy(ptr, ptr+A, B), which is safe but produces a warning
when run with valgrind.

To avoid the warning, I added copy_or_move() method which uses
memmove() instead of memcpy().

In 10.3 the change in item_strfunc::Item_func_concat() has to be mirroed
in Item_func_concat_oracle() to avoid future valgrind warnings.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This warning come from a copy() operation of type:
memcpy(ptr, ptr+A, B), which is safe but produces a warning
when run with valgrind.

To avoid the warning, I added copy_or_move() method which uses
memmove() instead of memcpy().

In 10.3 the change in item_strfunc::Item_func_concat() has to be mirroed
in Item_func_concat_oracle() to avoid future valgrind warnings.
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-17317 Add THD* parameter into Item::get_date() and stricter data type control to "fuzzydate"</title>
<updated>2018-09-28T10:01:17+00:00</updated>
<author>
<name>Alexander Barkov</name>
<email>bar@mariadb.com</email>
</author>
<published>2018-09-28T10:01:17+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=ad8e02ac452dc94d64b65cb9855b6dba97b651d4'/>
<id>ad8e02ac452dc94d64b65cb9855b6dba97b651d4</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>2018-08-16T07:08:30+00:00</updated>
<author>
<name>Marko Mäkelä</name>
<email>marko.makela@mariadb.com</email>
</author>
<published>2018-08-16T07:08:30+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=734db318ac69f60959bcd0d6c9116a3681449a38'/>
<id>734db318ac69f60959bcd0d6c9116a3681449a38</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-16910 Add class VDec</title>
<updated>2018-08-07T06:48:42+00:00</updated>
<author>
<name>Alexander Barkov</name>
<email>bar@mariadb.com</email>
</author>
<published>2018-08-07T06:48:42+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=cb7b5fbf1cf7c5bcd0509e428a53a8b8d6fbba0f'/>
<id>cb7b5fbf1cf7c5bcd0509e428a53a8b8d6fbba0f</id>
<content type='text'>
Adding classes VDec and VDec2_lazy, according to the task description.
This patch removes around 250 duplicate code lines.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adding classes VDec and VDec2_lazy, according to the task description.
This patch removes around 250 duplicate code lines.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix of type, to make windows compiler happy.</title>
<updated>2018-08-03T20:39:57+00:00</updated>
<author>
<name>Oleksandr Byelkin</name>
<email>sanja@mariadb.com</email>
</author>
<published>2018-08-03T20:39:57+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=7749745b7d688bd35d92219869f93dd0b44117fc'/>
<id>7749745b7d688bd35d92219869f93dd0b44117fc</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.2 into 10.3</title>
<updated>2018-08-03T12:57:23+00:00</updated>
<author>
<name>Marko Mäkelä</name>
<email>marko.makela@mariadb.com</email>
</author>
<published>2018-08-03T12:57:23+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=05459706f22b1d9d22abd24e6de3b505d787beb3'/>
<id>05459706f22b1d9d22abd24e6de3b505d787beb3</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
