summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Don't crash in S3 if Aria is not initialzedbb-10.5-sertMonty2019-10-201-1/+4
|
* Fixed compilation issueMonty2019-10-201-6/+4
|
* MDEV-20844 RBR from binary(16) to inet6 fails with error 171: The event was ↵Alexander Barkov2019-10-1811-78/+322
| | | | | | | | | | | | | | | | | | 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-20856 Bad values in metadata views for partitions on VARBINARYAlexander Barkov2019-10-189-257/+368
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old code to print partition values was too complicated: - it created new Items for character set conversion purposes. - it mixed string conversion and partition error reporting in the same code blocks. Simplifying the code as follows: - Adding helper methods String::can_be_safely_convert_to() and String::append_introducer_and_hex(). - Adding DBUG_EXECUTE_IF("generate_partition_syntax_for_frm", push_warning...) into generate_partition_syntax_for_frm(), to test the PARTITON clause written to FRM. Adding test partition_utf8-debug.test for this. - Removing functions get_cs_converted_part_value_from_string() and get_cs_converted_string_value. Changing get_partition_column_description() to use Type_handler::partition_field_append_value() instead. This makes SHOW CREATE TABLE and SELECT FROM I_S.PARTITIONS use the same code path. - Changing Type_handler::partition_field_append_value() not to call convert_charset_partition_constant(), to avoid creating a new Item for string conversion pursposes. Rewritting the code to use only String methods. - Removing error reporting code (ER_PARTITION_FUNCTION_IS_NOT_ALLOWED) from Type_handler::partition_field_append_value(). The error is correctly detected and reported on the caller level. So error reporting was redundant here. Also: - Moving methods Type_handler::partition_field_*() from sql_partition.cc to sql_type.cc. This fixes compilation problem with -DPLUGIN_PARTITION=NO, earlier introduced by the patch for MDEV-20831.
* Part2: MDEV-20837 Add MariaDB_FUNCTION_PLUGINAlexander Barkov2019-10-168-905/+69
| | | | Removing MariaDB_FUNCTION_COLLECTION_PLUGIN
* Part1: MDEV-20837 Add MariaDB_FUNCTION_PLUGINAlexander Barkov2019-10-1613-63/+967
| | | | | | | - Defining MariaDB_FUNCTION_PLUGIN - Changing the code in /plugins/type_inet/ and /plugins/type_test/ to use MariaDB_FUNCTION_PLUGIN instead of MariaDB_FUNCTION_COLLECTION_PLUGIN. - Changing maturity for the INET6 data type plugin from experimental to alpha.
* MDEV-20831 Table partitioned by LIST/RANGE COLUMNS(inet6) can be created, ↵Alexander Barkov2019-10-156-111/+252
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-20822 INET6 crashes in combination with RBR extended metadataAlexander Barkov2019-10-143-4/+136
| | | | | | | | | | | | | | | | | | | | | The code erroneously assumed that only Field_str descendants can store character set information. After adding Field_inet6, it's not true anymore. Also, after adding Field_inet6, storing field->charset() become not correct either: - Field_inet6::charset() return &my_charset_latin1, because clients see INET6 as VARCHAR(39). - Field_inet6::binlog_type_info().m_cs returns &my_charset_bin because storage engines see INET6 as BINARY(16). We need to store &my_charset_bin to the binlog metadata, so the slave sees INET6 as BINARY(16), like storage engines do, to make the slave treat the replicated data as binary IPv6 address representation (rather than text representation). The correct character set that needs to be stored to the metadata is already populated to binlog_type_info_array[i].m_cs. So the fixed code version uses this value rather than field->charset().
* MDEV-20826 Wrong result of MIN(inet6) with GROUP BYAlexander Barkov2019-10-143-0/+19
| | | | | | | | | | | Type_handler_inet6::is_val_native_ready() was not overriden and returned "false" by default, so Item_sum_min_max::update_field() erroneously went through the min_max_update_str_field() rather than min_max_update_native_field() execution path. As a result '8888::' was compared to 'fff::' in string format (rather than INET6 binary format) and gave "less" instead of "greater". Adding the forgotten overriding method returning "true".
* MDEV-16620 JSON_ARRAYAGG and JSON_OBJECTAGG.Alexey Botchkov2019-10-148-16/+237
| | | | Ison_objectagg implemented.
* MDEV-10014 Add RETURNING to INSERTSergei Golubchik2019-10-145-65/+101
| | | | | | | | post-review fixes: * test for dependent subqueries * test for triggers and routines * disallow INSERT...RETURNING in triggers and stored functions * don't return anything if INSERT IGNORE ignored an error
* bugfix: PS and dependent subqueriesSergei Golubchik2019-10-141-2/+2
| | | | | | | | | | | | | | | | | | | | when there are nested subqueries, and a field in a subquery is resolved as an outer reference to a table few levels up, all subqueries the subquery with a reference and all subqueries up to subquery with the table must be marked as dependent. in the text protocol and PS-prepare step it happens in Item_field::fix_outer_field in a loop that walks contexts using context->outer_context. in PS-execute step Item_field->cached_table is set and subqueries are walked in a PS-only mark_select_range_as_dependent(), which inconsistently walks SELECT_LEX'es using select_lex->outer_select(). Fix mark_select_range_as_dependent() to walk contexts, not SELECT_LEX'es, to have the same logic both in prepare and execute steps. This fixes a crash in main.insert_returning in --ps-protocol
* MDEV-10014 Add RETURNING to INSERTRucha Deodhar2019-10-1426-108/+1846
| | | | Closes #1384
* cleanup st_select_lex_unit::explainableSergei Golubchik2019-10-146-63/+18
|
* cleanup: formattingSergei Golubchik2019-10-148-64/+53
| | | | comments, whitespaces
* cleanup: reduce code duplicationSergei Golubchik2019-10-142-192/+96
|
* cleanup: don't pass wild_num to setup_wild()Sergei Golubchik2019-10-1410-82/+39
| | | | | | | | | because internally setup_wild() adjusts select_lex->with_wild directly anyway, so there is no reason to pretend that the number of '*' may be anything else but select_lex->with_wild And don't update select_lex->item_list, because fields can come from anywhere and don't necessarily have to be copied into select_lex.
* outer references in subqueries in INSERTSergei Golubchik2019-10-1410-33/+29
| | | | remove inconsistent limitation
* MDEV-12684 Show what config file a sysvar got a value fromSergei Golubchik2019-10-1414-13/+270
| | | | | Show the config file in I_S.SYSTEM_VARIABLES But only if the user has FILE privilege
* MDEV-12684 Show what config file a sysvar got a value fromSergei Golubchik2019-10-1444-153/+151
| | | | | change get_one_option() prototype to pass the filename and not to pass the redundant optid.
* MDEV-12684 Show what config file a sysvar got a value fromSergei Golubchik2019-10-144-57/+39
| | | | | | | | | | | make load_defaults() store the file name in the generated option list using a special marker ---file-marker--- option. Pick up this filename in handle_options(). Remove ---args-separator---, use ---file-marker--- with an empty file name instead - this simplifies checks on the caller, only one special option to recognize.
* cleanup: don't use my_getopt_is_args_separator()Sergei Golubchik2019-10-146-8/+4
| | | | | | only my_getopt should use it, because it changes my_getopt's behavior. If one simply wants to skip the separator - don't ask it to be added in the first place
* cleanup: unify --defaults* option handlingSergei Golubchik2019-10-145-210/+113
| | | | | | process all --defaults* options uniformly, get rid of special case for --no-defaults and --print-defaults use realpath instead of blindly concatenating pwd and relative path.
* cleanup: my_getopt, get_one_option isn't optionalSergei Golubchik2019-10-143-48/+37
| | | | | | it turns out that practically every single user of handle_options() used the get_one_option callback. Simplify the code, make it mandatory, adjust unit tests.
* cleanup: my_getopt, consistencySergei Golubchik2019-10-143-23/+14
| | | | | | | | | almost all my_getopt settings and callbacks are global variables, directly assignable to configure my_getopt. Only getopt_get_addr was using a setter function. Get rid of it, make it a global directly assignable variable like all other settings. Also make getopt_compare_strings() static.
* cleanup: my_defaults, remove Process_option_funcSergei Golubchik2019-10-142-105/+39
| | | | | | | This is a remnant of "MySQL Instance Manager", which was removed in MySQL-5.5.0 and never existed in MariaDB Remove callback, simplify and optimize the code accordingly.
* MDEV-20818 ER_CRASHED_ON_USAGE or Assertion `length <= column->length' ↵Alexander Barkov2019-10-149-18/+171
| | | | | | | | | | | | | | | | | | 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
* clang failed to compile the embedded library with unused constant errorsAlexander Barkov2019-10-131-0/+2
| | | | | | | Putting "#ifndef NO_EMBEDDED_ACCESS_CHECKS" around these constant declarations: const uint max_hostname_length= 60; const uint max_dbname_length= 64;
* MDEV-20800 Server crashes in Field_inet6::store_warning upon updating table ↵Alexander Barkov2019-10-136-31/+40
| | | | | | | | | | | | | | | | | | | 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.
* Removing redundant `--source include/have_innodb.inc` from ↵Alexander Barkov2019-10-132-4/+0
| | | | | | type_inet6_{memory|myisam}.test These tests use only HEAP and MyISAM tables.
* 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.
* MDEV-16327: Server doesn't account for engines that supports OFFSET on their ↵Oleksandr Byelkin2019-10-136-7/+71
| | | | | | own. Engine get LIMIT/OFFSET info an can it use/reset.
* MDEV-18553: MDEV-16327 pre-requisits part 3: move kill check in one placeOleksandr Byelkin2019-10-135-22/+6
| | | | | Kill check moved from send_data() methids in its wrapper: send_data_with_check().
* MDEV-18553: MDEV-16327 pre-requisits part 2: uniform of LIMIT/OFFSET handlingOleksandr Byelkin2019-10-1314-83/+63
| | | | | | | Now both offset and limit are stored and do not chenged during execution (offset is decreased during processing in versions before 10.5). (Big part of this changes made by Monty)
* MDEV-18553: MDEV-16327 pre-requisits part 1: isolation of LIMIT/OFFSET handlingOleksandr Byelkin2019-10-1318-154/+198
|
* Merge 10.4 into 10.5Marko Mäkelä2019-10-1249-644/+763
|\
| * Merge 10.3 into 10.4Marko Mäkelä2019-10-121-1/+3
| |\
| | * MDEV-20814 Assertion index->is_instant() failed on trivial upgrade from 10.1Marko Mäkelä2019-10-121-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rec_init_offsets(): Relax the assertion that was added in commit 01f45becd1b71433e240959228e35266f271bba1 to catch ROW_FORMAT=REDUNDANT records that have fewer fields than expected. This assertion would fail when accessing the records of the built-in InnoDB table SYS_INDEXES. The column MERGE_THRESHOLD had been effectively instantly added in MariaDB Server 10.2 (and MySQL 5.7), but is_instant() does not hold for that index. Relax the assertion, so that it will not fail in this case.
| * | Null-merge 10.3 into 10.4Marko Mäkelä2019-10-120-0/+0
| |\ \ | | |/
| | * Merge 10.2 into 10.3Marko Mäkelä2019-10-122-3/+12
| | |\
| | | * MDEV-20813 Assertion failure in buf_flush_init_for_writing() for ↵Marko Mäkelä2019-10-122-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | innodb_immediate_scrub_data_uncompressed=ON The assertion that was added in commit c0c003beb48b099b5e6516e9d36adf096cd2d09c to augment the fix of MDEV-20805 turns out to be invalid when innodb_immediate_scrub_data_uncompressed is enabled. In this mode, fsp_init_file_page() will be invoked on data pages that have been freed, causing writes of almost-all-zero pages. btr_page_free(): Adjust the comment. buf_flush_init_for_writing(): Disable the assertion with a note that it should be re-enabled in MDEV-15528.
| * | | Fix -Wunused-variableMarko Mäkelä2019-10-121-2/+2
| | | |
| * | | Merge 10.3 into 10.4Marko Mäkelä2019-10-1246-640/+757
| |\ \ \ | | |/ /
| | * | Merge 10.2 into 10.3Marko Mäkelä2019-10-1246-640/+757
| | |\ \ | | | |/
| | | * Merge 10.1 into 10.2Marko Mäkelä2019-10-120-0/+0
| | | |\
| | | | * MDEV-20728: /usr/sbin/mysqld: unknown variable 'defaults-group-suffix=mysqld1Julius Goryavsky2019-10-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the mysqld_multi script passes the --defaults-group-suffix option to mysqld, it must remove the initial substring with the group name ("mysqld") from option value, because otherwise substring "mysqld" will be added to the group name and then the group name will contain the word "mysqld" twice, which is wrong, because mysqld itself adds the suffix received to the group name.
| | | * | MDEV-20728: /usr/sbin/mysqld: unknown variable 'defaults-group-suffix=mysqld1Julius Goryavsky2019-10-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the mysqld_multi script passes the --defaults-group-suffix option to mysqld, it must remove the initial substring with the group name ("mysqld") from option value, because otherwise substring "mysqld" will be added to the group name and then the group name will contain the word "mysqld" twice, which is wrong, because mysqld itself adds the suffix received to the group name.
| | | * | Fix -std=c++98 -Wzero-length-arrayMarko Mäkelä2019-10-114-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is another follow-up fix to commit b393e2cb0c079b30563dcc87a62002c9c778643c which turned out to be still broken. Replace the C++11 keyword 'constexpr' with #define. debug_sync_t::str: Remove the zero-length array. Replace sync->str with reinterpret_cast<char*>(&sync[1]).
| | | * | After-merge fix: Correct an assertionMarko Mäkelä2019-10-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | During IMPORT TABLESPACE, we do invoke buf_flush_init_for_writing() with block==NULL and newest_lsn!=0.
| | | * | Merge 10.1 into 10.2Marko Mäkelä2019-10-1138-631/+485
| | | |\ \ | | | | |/