summaryrefslogtreecommitdiff
path: root/plugin/type_inet/sql_type_inet.cc
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.4 into 10.5Marko Mäkelä2020-08-011-4/+9
|
* MDEV-22758 Assertion `!item->null_value' failed in ↵Alexander Barkov2020-06-031-7/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Type_handler_inet6::make_sort_key_part When some expression of an INET6 data type involves conversion to INET6 from other data types, e.g. in: - CAST: SELECT CAST(non_inet6_expr AS INET6) - CASE and hybrid functions: SELECT CASE WHEN expr THEN inet6_expr ELSE non_inet6_expr END - UNION: SELECT inet6_expr UNION SELECT non_inet6_expr the result column must be fixed as NULL-able even if the non-inet6 expression itself is not NULL-able, because at the execution time the conversion can fail. Details: - Forcing NULL-ability if conversion from some data type to INET6 is involved (for non-constant or for expensive expressions). - Non-expensive constant expressions are tested for NULL-ability at fix_fields() time, so things like `CAST('::' AS INET6)` are still detected as NOT NULL. - Adding "bool warn" parameter into a few methods, to avoid redundant warnings at fix_fields() time when calculating NULL-ability of constant values.
* Fixed access to undefined memory found by valgrind and MSANMonty2020-05-231-1/+1
| | | | | | When my_vsnprintf() is patched, the code protected disabled with 'WAITING_FOR_BUGFIX_TO_VSPRINTF' should be enabled again. Also all %b formats in this patch should be revert to %s again
* MDEV-17832 Protocol: extensions for Pluggable types and JSON, GEOMETRYAlexander Barkov2020-03-101-0/+6
|
* MDEV-21580: Allow packed sort keys in sort bufferVarun Gupta2020-03-101-6/+29
| | | | | | | | | | | | | | | | | | This task deals with packing the sort key inside the sort buffer, which would lead to efficient usage of the memory allocated for the sort buffer. The changes brought by this feature are 1) Sort buffers would have sort keys of variable length 2) The format for sort keys inside the sort buffer would look like |<sort_length><null_byte><key_part1><null_byte><key_part2>.......| sort_length is the extra bytes that are required to store the variable length of a sort key. 3) When packing of sort key is done we store the ORIGINAL VALUES inside the sort buffer and not the STRXFRM form (mem-comparable sort keys). 4) Special comparison function packed_keys_comparison() is introduced to compare 2 sort keys. This patch also contains contributions from Sergei Petrunia.
* MDEV-20844: Add missing override qualifiersMarko Mäkelä2019-10-281-2/+2
| | | | | clang warns if only some overridden member functions in a class are tagged with the C++11 override keyword. Add the missing keywords.
* MDEV-20844 RBR from binary(16) to inet6 fails with error 171: The event was ↵Alexander Barkov2019-10-181-0/+24
| | | | | | | | | | | | | | | | | | corrupt, leading to illegal data being read This patch changes the way how INET6 is packed to the RBR binary log: - from fixed length 16 bytes - to BINARY(16) compatible variable length style with trailing 0x00 byte compression. This is to make INET6 fully compatible with BINARY(16) in RBR binary logs, so RBR replication works in this scenarios: - Old master BINARY(16) -> New slave INET6 - New master INET6 -> Old slave BINARY(16) A new class StringPack was added to share the code between Field_string and Field_inet6.
* MDEV-20831 Table partitioned by LIST/RANGE COLUMNS(inet6) can be created, ↵Alexander Barkov2019-10-151-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | but not inserted into This clause in CREATE TABLE: PARTITION BY LIST COLUMNS (inet6column) (PARTITION p1 VALUES IN ('::')) was erroneously written to frm file as: PARTITION BY LIST COLUMNS(inet6column) (PARTITION p1 VALUES IN (_binary 0x3A3A)) I.e. the text value '::' was converted to HEX representation and prefixed with _binary. A simple fix could write `_latin1 0x3A3A` instead of `_binary 0x3A3A`, but in case of INET6 we don't need neither character set introducers, nor HEX encoding, because text representation of INET6 values consist of pure ASCII characters. So this patch changes the above clause to be printed as: PARTITION BY LIST COLUMNS(inet6column) (PARTITION p1 VALUES IN ('::')) Details: The old code in check_part_field() was not friendly to pluggable data types. Replacing this function to two new virtual methods in Type_handler: virtual bool partition_field_check(const LEX_CSTRING &field_name, Item *item_expr) const; virtual bool partition_field_append_value(String *str, Item *item_expr, CHARSET_INFO *field_cs, partition_value_print_mode_t mode) const; so data type plugins can decide whether they need to use character set introducer and/or hex encoding when printing partition values.
* MDEV-20818 ER_CRASHED_ON_USAGE or Assertion `length <= column->length' ↵Alexander Barkov2019-10-141-7/+2
| | | | | | | | | | | | | | | | | | failed in write_block_record on temporary table The patch for `MDEV-20795 CAST(inet6 AS BINARY) returns wrong result` unintentionally changed what Item_char_typecast::type_handler() returns. This broke UNIONs with the BINARY() function, as the Aria engine started to get columns of unexpected data types. Restoring previous behaviour, to return Type_handler::string_type_handler(max_length). The prototype for Item_handed_func::return_type_handler() has changed from: const Type_handler *return_type_handler() const to: const Type_handler *return_type_handler(const Item_handled_func *) const
* MDEV-20800 Server crashes in Field_inet6::store_warning upon updating table ↵Alexander Barkov2019-10-131-3/+4
| | | | | | | | | | | | | | | | | | | statistics Suppress warnings when Field_inet6::store() is called from read_statistics_for_table() and other optimizer related routines. This patch does for Field_inet6 the same thing with what Monty's patch previously did for other Field_xxx: > commit 1bbe8c5e0f6823acd4780d7563e8c02f8b4c5a01 > Author: Michael Widenius <monty@mariadb.org> > Date: Sun Sep 22 04:08:48 2019 +0300 > > Proper fix for disabling warnings in read_statistics_for_table(). > MDEV-20589: Server still crashes in Field::set_warning_truncated_wrong_value Alas, some meaningful warnings disappeared.
* Adding the "override" keyword to ↵Alexander Barkov2019-10-131-1/+2
| | | | | | Item_char_typecast_func_handler_inet6_to_binary::type_handler_for_create_select() Clang fails to compile without it.
* Fixing a mysqld crash on Ubuntu-10.2 (Quantal)Alexander Barkov2019-10-121-2/+2
|
* MDEV-20806 Federated does not work with INET6, returns NULL with warning ↵Alexander Barkov2019-10-121-13/+26
| | | | ER_TRUNCATED_WRONG_VALUE
* MDEV-20798 Conversion from INET6 to other types performed without errors or ↵Alexander Barkov2019-10-111-15/+7
| | | | warnings
* MDEV-20795 CAST(inet6 AS BINARY) returns wrong resultAlexander Barkov2019-10-111-0/+48
|
* MDEV-20783 INET6 cannot be converted to BINARY(16)Alexander Barkov2019-10-101-19/+31
|
* Adding missing "override" keywords, to make clang happy.Alexander Barkov2019-10-091-11/+11
|
* MDEV-274 The data type for IPv6/IPv4 addresses in MariaDBAlexander Barkov2019-10-081-1/+932
|
* MDEV-20768 Turn INET functions into a function collection pluginAlexander Barkov2019-10-071-0/+542