Commit Graph

19 Commits

Author SHA1 Message Date
862ae099b0 Construct diagnostics results in the monitor thread
MariaDBMonitor diagnostics printing is unsafe as some of the read
fields are arrays. To be on the safe side, the fields are now read
in the monitor worker thread.

Since diagnostics must work even for stopped monitors, a worker task
is used. In practice, it usually runs when the monitor is sleeping.
2018-07-20 10:18:58 +03:00
7f67fe6f14 Add string tokenization helper
The mxs::strtok function splits a string into a vector of strings based on
a set of delimiters. The function makes it easier to iterate over a set of
values given as a delimited string.
2018-07-11 14:08:52 +03:00
77a1417479 Replace TR1 headers with standard headers
Now that the C++11 standard is the default one, we can remove the TR1
headers and classes.
2018-07-11 14:08:46 +03:00
cc0299aee6 Update change date of 2.3 2018-06-25 10:07:52 +03:00
445eece95b MXS-1507: Fix replaying of empty transactions
If the starting of a transaction was interrupted by a server failure, the
query needs to be retried. This needs to be done as a transaction replay
to keep the routing logic consistent and simple.

When a non-autocommit transaction is interrupted, there will be no query
in progress and no replaying is needed. To handle this case, the replay
initialization logic needed to be altered to treat truly empty
transactions as a success case.
2018-06-04 19:26:36 +03:00
a2cd4feeaf Store server states as 64-bit to the monitor journal
The journal schema version was changed.
2018-05-24 11:35:34 +03:00
498572c671 MXS-1775 Add mxs::[l|r]trimmed_copy(const std::string&)
Make it more convenient to get a left-trimmed, right-trimmed
or trimmed copy of a string.
2018-05-22 16:18:17 +03:00
0f8bf9b6e2 Implement mxs::[l|r]trim(std::string&);
Also remove the non-used implementation in httprequest.cc
2018-05-21 10:18:42 +03:00
92e0b944a9 MXS-1810: Create reset method for Checksum
Resetting checksum calculations avoids some unnecessary calculations when
the result is not needed.
2018-04-26 13:44:24 +03:00
bb96c368c2 MXS-1810: Create generic Checksum class
The Checksum class defines an interface which the SHA1Checksum and
CRC32Checksum implement.

Added test unit test cases to verify that the checksums work and perform
as expected.
2018-04-26 13:44:23 +03:00
602f977be6 MXS-1810: Add mxs::Checksum class
The class is a wrapper to the SHA1 function. This should make checksum
calculations over buffers easier.
2018-04-26 13:44:23 +03:00
755d080161 MXS-1810: Add C++ hex conversion functions
Added mxs::to_hex for uint8_t types and uint8_t containers.
2018-04-26 13:44:23 +03:00
640501c03a MXS-1810: Format utils.hh
Formatted utils.hh with Astyle.
2018-04-26 13:44:23 +03:00
221658299d MXS-1502: Derive EqualPointees from std::unary_function
This is done to make it clear that the class is intended to be used as an
unary function.
2018-04-03 16:27:18 +03:00
98fb2cf5ed MXS-1503: Add EqualPointees<T> template
The templated provides an unary predicate for (shared) pointers that
allows containers containing pointers to objects to be searched, not by
pointer comparisons but by comparisons of the values that they point
to. This allows std::find_if to be used with shared pointers in a similar
manner that std::find is used with non-pointer objects.
2018-04-03 13:31:40 +03:00
f546a17e77 Update change date of 2.2 2017-06-01 10:24:20 +03:00
dbfd631fed Change session registry to a template class
The template class wraps a HashMap such that only a few operations
are allowed. Usage requires specializing a RegistryTraits class
template for each entry type.
2017-05-19 10:16:37 +03:00
5648f708af Update license to BSL 1.1 2017-02-14 21:42:28 +02:00
0b4c379539 Add Closer, partial RAII class
Closer is a template using which C-style resources can be managed
in a C++ context where exceptions can occur. By placing a C resource
in a Closer instance, it is certain the resource will be freed when
the closing scope is exited irrespective of whether that occurs due
to the normal control flow, due to a return statement or an exception
having been thrown.

To be used with Closer, the CloserTraits template must be specialized
for the type in question. With this change specializations are provided
for FILE*, json_t*, pcre_code* and pcre2_match_data*.
2017-01-09 09:19:59 +02:00