summaryrefslogtreecommitdiff
path: root/sql
Commit message (Collapse)AuthorAgeFilesLines
* Improved the descriptionVarun Gupta2020-02-091-56/+57
|
* Minor fix for duplicate weedoutVarun Gupta2020-02-092-6/+27
|
* Introduced an optimizer_switch for ORDER BY LIMITVarun Gupta2020-02-093-7/+4
|
* Updated the descriptionVarun Gupta2020-02-091-24/+18
|
* Sort nest not allowed inside dependent subqueriesVarun Gupta2020-02-091-1/+2
|
* minor fixVarun Gupta2020-02-094-6/+8
|
* ORDER BY LIMITVarun Gupta2020-02-0928-472/+3235
|
* MDEV-21689 Add Sql_cmd for GRANT/REVOKE statementsAlexander Barkov2020-02-0812-316/+811
| | | | | | | | | | | | | | | | | | | | | Rewriting GRANT/REVOKE grammar to use more bison stack and use Sql_cmd_ style 1. Removing a few members from LEX: - uint grant, grant_to_col, which_columns - List<LEX_COLUMN> columns - bool all_privileges 2. Adding classes Grand_object_name, Lex_grant_object_name 3. Adding classes Grand_privilege, Lex_grand_privilege 4. Adding struct Lex_column_list_privilege_st, class Lex_column_list_privilege 5. Rewriting the GRANT/REVOKE grammar to use new classes and pass them through bison stack (rather than directly access LEX members) 6. Adding classes Sql_cmd_grant* and Sql_cmd_revoke*, changing GRANT/REVOKE to use LEX::m_sql_cmd. 7. Adding the "sp_handler" grammar rule and removing some duplicate grammar for GRANT/REVOKE for different kinds of SP objects. 8. Adding a new rule comma_separated_ident_list, reusing it in: - with_column_list - colum_list_privilege
* MDEV-21248: Do not break the build on clangMarko Mäkelä2020-02-081-1/+1
|
* MDEV-21248: Prevent optimizing out buf argument in check_stack_overrun.Martin Liska2020-02-081-2/+11
| | | | | | When using LTO, one can see optimization of stack variables that are passed to check_stack_overrun as argument buf. That prevents proper stack overrun detection.
* Merge 10.4 into 10.5Marko Mäkelä2020-02-074-53/+85
|\
| * MDEV-21616: Server crash when using "SET STATEMENT max_statement_time=0 FOR ↵Oleksandr Byelkin2020-02-051-0/+6
| | | | | | | | | | | | desc xxx" lead to collapse Main select should be pushed first.
| * MDEV-20625 : MariaDB asserting when enabling wsrep_onbb-10.4-MDEV-20625Jan Lindström2020-02-041-10/+11
| | | | | | | | | | | | | | We need to release global system variables mutex before doing wsrep_init to avoid race with next show status and we need to save wsrep_on value as it is changed on wsrep_init. Added test case.
| * MDEV-20625 : MariaDB asserting when enabling wsrep_onJan Lindström2020-02-031-48/+68
| | | | | | | | | | When wsrep_on is changed to ON we might need to run wsrep_init if wsrep-provider is set and wsrep is not inited.
| * MDEV-17798 System variable system_versioning_asof accepts wrong values (10.4)Aleksey Midenkov2020-02-021-2/+7
| |
| * Fixed compiler warnings from gcc 7.4.1Monty2020-01-291-1/+1
| | | | | | | | - Fixed possible error in rocksdb/rdb_datadic.cc
* | Incorrect behaviour of WSREP_SYNC_WAIT_UPTO_GTID (#1442)mkaruza2020-02-052-23/+37
| | | | | | | | | | | | | | Function `signal_waiters` assigned `m_committed_seqno` variable outside of mutex lock which caused incorrect behavior of WSREP_SYNC_WAIT_UPTO_GTID. Fixed by moving assignment inside lock. Added handling of OOM and now error is reported. Remove hard-coded seqno value and read seqno directly from current node state.
* | MDEV-20601: Make REPLICA a synonym for SLAVE in SQL statementsSujatha2020-02-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix: === Add "REPLICA" as an alias for "SLAVE". All commands which use "SLAVE" keyword can be used with new alias "REPLICA". List of commands: On Master: ========= SHOW REPLICA HOSTS <--> SHOW SLAVE HOSTS Privilege "SLAVE" <--> "REPLICA" On Slave: ========= START SLAVE <--> START REPLICA START ALL SLAVES <--> START ALL REPLICAS START SLAVE UNTIL <--> START REPLICA UNTIL STOP SLAVE <--> STOP REPLICA STOP ALL SLAVES <--> STOP ALL REPLICAS RESET SLAVE <--> RESET REPLICA RESET SLAVE ALL <--> RESET REPLICA ALL SLAVE_POS <--> REPLICA_POS
* | MDEV-21598 Galera test galera.galera_sst_mysqldump does not take ↵mkaruza2020-01-302-3/+4
| | | | | | | | | | | | | | | | wsrep-new-cluster into account Variable `wsrep_new_cluster` should be set to false after `wsrep_init_startup`. Problem was that this was done before when mysqldump is used as SST method so option wsrep-new-cluster didn't have any effect.
* | Galera GTID supportmkaruza2020-01-2920-242/+602
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support for galera GTID consistency thru cluster. All nodes in cluster should have same GTID for replicated events which are originating from cluster. Cluster originating commands need to contain sequential WSREP GTID seqno Ignore manual setting of gtid_seq_no=X. In master-slave scenario where master is non galera node replicated GTID is replicated and is preserved in all nodes. To have this - domain_id, server_id and seqnos should be same on all nodes. Node which bootstraps the cluster, to achieve this, sends domain_id and server_id to other nodes and this combination is used to write GTID for events that are replicated inside cluster. Cluster nodes that are executing non replicated events are going to have different GTID than replicated ones, difference will be visible in domain part of gtid. With wsrep_gtid_domain_id you can set domain_id for WSREP cluster. Functions WSREP_LAST_WRITTEN_GTID, WSREP_LAST_SEEN_GTID and WSREP_SYNC_WAIT_UPTO_GTID now works with "native" GTID format. Fixed galera tests to reflect this chances. Add variable to manually update WSREP GTID seqno in cluster Add variable to manipulate and change WSREP GTID seqno. Next command originating from cluster and on same thread will have set seqno and cluster should change their internal counter to it's value. Behavior is same as using @@gtid_seq_no for non WSREP transaction.
* | Merge 10.4 into 10.5Marko Mäkelä2020-01-2811-49/+313
|\ \ | |/
| * Merge branch '10.3' into 10.4Oleksandr Byelkin2020-01-252-1/+73
| |\
| | * MDEV-21383: Possible range plan is not used under certain conditionsbb-10.3-mdev21383Sergei Petrunia2020-01-242-1/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [Variant 2 of the fix: collect the attached conditions] Problem: make_join_select() has a section of code which starts with "We plan to scan all rows. Check again if we should use an index." the code in that section will [unnecessarily] re-run the range optimizer using this condition: condition_attached_to_current_table AND current_table's_ON_expr Note that the original invocation of range optimizer in make_join_statistics was done using the whole select's WHERE condition. Taking the whole select's WHERE condition and using multiple-equalities allowed the range optimizer to infer more range restrictions. The fix: - Do range optimization using a condition that is an AND of this table's condition and all of the previous tables' conditions. - Also, fix the range optimizer to prefer SEL_ARGs with type=KEY_RANGE over SEL_ARGS with type=MAYBE_KEY, regardless of the key part. Computing key_and( SEL_ARG(type=MAYBE_KEY key_part=1), SEL_ARG(type=KEY_RANGE, key_part=2) ) will now produce the SEL_ARG with type=KEY_RANGE.
| * | Merge branch '10.3' into 10.4Oleksandr Byelkin2020-01-243-2/+21
| |\ \
| | * \ Merge branch '10.2' into 10.3Oleksandr Byelkin2020-01-244-3/+26
| | |\ \ | | | |/ | | |/|
| | | * Merge branch '10.1' into 10.2Oleksandr Byelkin2020-01-243-3/+22
| | | |\
| | | | * MDEV-21490: binlog tests fail with valgrind: Conditional jump or move ↵Sujatha2020-01-242-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | depends on uninitialised value in sql_ex_info::init Problem: ======= P1) Conditional jump or move depends on uninitialised value(s) sql_ex_info::init(char const*, char const*, bool) (log_event.cc:3083) code: All the following variables are not initialized. ---- return ((cached_new_format != -1) ? cached_new_format : (cached_new_format=(field_term_len > 1 || enclosed_len > 1 || line_term_len > 1 || line_start_len > 1 || escaped_len > 1))); P2) Conditional jump or move depends on uninitialised value(s) Rows_log_event::Rows_log_event(char const*, unsigned int, Format_description_log_event const*) (log_event.cc:9571) Code: Uninitialized values is reported for 'var_header_len' variable. ---- if (var_header_len < 2 || event_len < static_cast<unsigned int>(var_header_len + (post_start - buf))) P3) Conditional jump or move depends on uninitialised value(s) Table_map_log_event::pack_info(Protocol*) (log_event.cc:11553) code:'m_table_id' is uninitialized. ---- void Table_map_log_event::pack_info(Protocol *protocol) ... size_t bytes= my_snprintf(buf, sizeof(buf), "table_id: %lu (%s.%s)", m_table_id, m_dbnam, m_tblnam); Fix: === P1 - Fix) Initialize cached_new_format,field_term_len, enclosed_len, line_term_len, line_start_len, escaped_len members in default constructor. P2 - Fix) "var_header_len" is initialized by reading the event buffer. In case of an invalid event the buffer will contain invalid data. Hence added a check to validate the event data. If event_len is smaller than valid header length return immediately. P3 - Fix) 'm_table_id' within Table_map_log_event is initialized by reading data from the event buffer. Use 'VALIDATE_BYTES_READ' macro to validate the current state of the buffer. If it is invalid return immediately.
| | | | * MDEV-19457: sys_vars.wsrep_provider_basic failed in buildbotJulius Goryavsky2020-01-201-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the initialization of the wsrep provider failed, in some cases the internal variable wrep_inited indicating that the initialization has already been completed is still set to "1", which then leads to confusion in the initialization status. To solve the problem, we should set this variable to "1" only if the wsrep provider initialization really completed successfully. An earlier issue has already been fixed for branch 10.4, and this patch contains a fix for earlier versions (where Galera 3.x is used).
| | | * | MDEV-21249 MariaDB 10.3.10 When referring to bigint to generate timestamp ↵Sergei Golubchik2020-01-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | data in the virtual generated column, the value of the generated column does not change when the time zone changes FROM_UNIXTIME() depends on @@time_zone, so it's VCOL_SESSION_FUNC
| * | | | MDEV-17571 : Make systemd timeout behavior more compatible with long Galera SSTsJan Lindström2020-01-223-36/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is 10.4 version. Idea is to create monitor thread for both donor and joiner that will periodically if needed extend systemd timeout while SST is being processed. In 10.4 actual SST is executed by running SST script and exchanging messages on pipe using blocking fgets. This fix starts monitoring thread before SST script is started and we stop monitoring thread when SST has been completed.
| * | | | Merge branch '10.3' into 10.4Oleksandr Byelkin2020-01-213-5/+12
| |\ \ \ \ | | |/ / /
| | * | | Merge branch '10.2' into 10.3Oleksandr Byelkin2020-01-213-5/+12
| | |\ \ \ | | | |/ /
| | | * | Merge branch '10.1' into 10.2Oleksandr Byelkin2020-01-203-5/+12
| | | |\ \ | | | | |/
| | | | * Merge branch '5.5' into 10.1Oleksandr Byelkin2020-01-193-5/+11
| | | | |\
| | | | | * Bug#29630767 - USE OF UNINITIALIZED VALUE IN LIBMYSQL (CLIENT.CC FUNCTION ↵mariadb-5.5.67Sergei Golubchik2020-01-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | RUN_PLUGIN_AUTH)
| | | | | * Improve documentation of Unique classVicențiu Ciorbaru2020-01-161-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * size represents the size of an element in the Unique class * full_size is used when the Unique class counts the number of duplicates stored per element. This requires additional space per Unique element.
| | | | | * Use get_ident_len in heartbeat event error messagesMarkus Mäkelä2020-01-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The string doesn't appear to be null-terminated when binlog checksums are enabled. This causes a corrupt binlog name in the error message when a slave is ahead of the master.
| * | | | | MDEV-20821 parallel slave server shutdown hangAndrei Elkin2020-01-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Parallel slave server shutdown found to be hanging in close_connections() triggered by shutdown due to a slave worker thread would not be notified to exit in case the worker was sitting idle. Fixed with destroying the worker pool earlier that is in slave_prepare_for_shutdown() when all their driver threads have already left. A test file is added to simulate the bug condition as well as check multi-sourced and not-idle worker cases.
* | | | | | MDEV-21581 Helper functions and methods for CHARSET_INFOAlexander Barkov2020-01-2856-575/+489
| | | | | |
* | | | | | Cleanup: Make Bounds_checked_array default-constructibleMarko Mäkelä2020-01-221-3/+4
| | | | | |
* | | | | | MDEV-21263: Fix -Wclass-memaccessMarko Mäkelä2020-01-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit f52bf92014efae6a1da9c2f26a7e3792ed5f5396 the type Sql_sort is non-trivial, because it includes a data member Bounds_checked_array<SORT_FIELD> local_sortorder. There still is no vtable, so memset() is safe to invoke, but we must add a cast to silence a warning in GCC 8 or later.
* | | | | | MDEV-21541: main.sum_distinct-big fails with Assertion `m_buffer_end == ↵Varun Gupta2020-01-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | __null || end <= m_buffer_end' For Merge_chuck structures first set the start and end positions of the buffer and then adjust the end positions of the buffer if the records are dynamic in nature.
* | | | | | MDEV-21537 InnoDB INFORMATION_SCHEMA tables fail to define DEFAULT for ENUM ↵Alexander Barkov2020-01-222-5/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NOT NULL - Adding a way to define I_S columns without DEFAULT. - Fixing all ENUM columns in I_S.INNODB* table definitions to have no DEFAULT.
* | | | | | MDEV-21548 Explicitly declare sql_bultins library STATIC.Vladislav Vaintroub2020-01-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Someone tried -DBUILD_SHARED_LIBS:BOOL=ON. This did not work well
* | | | | | MDEV-21263: Use C++11 default constructorMarko Mäkelä2020-01-211-17/+15
| | | | | |
* | | | | | Fix a compilation issueVarun Gupta2020-01-211-1/+0
| | | | | |
* | | | | | MDEV-21263: Allow packed values of non-sorted fields in the sort bufferVarun Gupta2020-01-2113-431/+1172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This task deals with packing the non-sorted fields (or addon fields). This 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 records of variable length 2) Each record in the sort buffer would be stored like <sort_key1><sort_key2>....<addon_length><null_bytes><field1><field2>.... addon_length is the extra bytes that are required to store the variable length of addon field across different records. 3) Changes in rr_unpack_from_buffer and rr_from_tempfile to take into account the variable length of records. Ported WL#1509 Pack values of non-sorted fields in the sort buffer from MySQL by Tor Didriksen
* | | | | | Merge 10.4 into 10.5Marko Mäkelä2020-01-2027-139/+283
|\ \ \ \ \ \ | |/ / / / /
| * | | | | MDEV-17062: Fix a typo in an error messageMarko Mäkelä2020-01-201-3/+1
| | | | | |
| * | | | | MDEV-17062 : Test failure on galera.MW-336Jan Lindström2020-01-203-11/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add mutex protection while we calculate required slave thread change and create them. Add error handling.