MDEV-4252 geometry query crashes server.
      The bug was found by Alyssa Milburn.
      If the number of points of a geometry feature read from
      binary representation is greater than 0x10000000, then
      the (uint32) (num_points * 16) will cut the higher byte,
      which leads to various errors.
      Fixed by additional check if (num_points > max_n_points).
MDEV-4281 Assertion `maybe_null && item->null_value' fails in make_sortkey on CASE with different return types, GROUP_CONCAT, GROUP BY

Fix Item::get_date() to mark the item NULL when returning an error.
MDEV-4286 Server crashes in Protocol_text::store, stack smashing detected

AVG() returns a double, its max_length is reasonably
limited by a double number length, even if the argument
is many Kbytes long.
MDEV-4283 Assertion `scale <= precision' fails in strings/decimal.c
  
with decimals=NOT_FIXED_DEC it is possible to have 'decimals' larger
than 'max_length', it's not an error for temporal functions.
  
But when Item_func_numhybrid converts the value to DECIMAL_RESULT,
it must limit 'decimals' to be a valid scale of a decimal number.
MDEV-4289 Assertion `0' fails in make_sortkey with GROUP_CONCAT, MAKE_SET, GROUP BY

Item_func_make_set wasn't taking into account the first argument when
calculating maybe_null.
MDEV-4252 geometry query crashes server.
    Additional fixes for possible overflows in length-related
    calculations in 'spatial' implementations.
    Checks added to the ::get_data_size() methods.
    max_n_points decreased to occupy less 2G size. An
    object of that size is practically inoperable anyway.
MDEV-4269 fix.
Item_default_value inherited form Item_field so should create temporary table field similary.
MDEV-4296 Assertion `n_linear_rings > 0' fails in Gis_polygon::centroid_xy.
        Forgotten DBUG_ASSERT should be replaced with the 'return error'.
MDEV-4295 Server crashes in get_point on a query with Area, AsBinary, MultiPoint.
        Need to check if the number of points is 0 for the polygon.
Patch by Ian Good for MDEV-4319: mysqlbinlog output ambiguous escaping

The output of mysqlbinlog (with "-v --base64-output=DECODE-ROWS" flags) can not always be read or parsed correctly
when string columns contain single-quotes or backslash characters.

The fix for this bug is to escape single-quote and backslash characters on output, so that the result is both more
readable and more easily parse-able.

Note that this is just for comments, so it doesn't affect the replication.
MDEV-4330 - get_tty_password() does not work if input redirection is used.
  
The reason is the limitation of ReadConsole() API, it returns error if handle to redirected  input  is used.
  
 The fix is to use a  handle returned by CreateFile("CONIN$",...), rather than GetStdHandle(STD_HANDLE_INPUT) to get the true console handle.
Fixes for Windows XP
extend check_global_access() to avoid my_error when it's not needed
(in INFORMATION_SCHEMA).
MDEV-4293 Valgrind warnings (Conditional jump or move depends on uninitialised value) in remove_eq_conds on time functions with NULL argument

val_int() is expected to return 0 for NULL's
MDEV-249 QUERY CACHE INFORMATION
add 'plugins' suite - empty, but the line
./mtr --suite=main,plugins
will work on all branches.
MDEV-4277: Crash inside mi_killed_in_mariadb() with myisammrg
- Set MI_INFO::external_ref for MyISAM tables that are parts of myisamMRG table.
Merge
MDEV-4310 geometry function equals hangs forever.
        The Geometry::get_mbr() function can return an error on
        a bad data. We have to check for that and act respectively.
Fixed bug mdev-4318.
In some cases, when using views the optimizer incorrectly determined
possible join orders for queries with nested outer and inner joins.
This could lead to invalid execution plans for such queries.