summaryrefslogtreecommitdiff
path: root/sql
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-7769 MY_CHARSET_INFO refactoring# On branch 10.2Alexander Barkov2016-10-109-69/+73
| | | | Part 3 (final): removing MY_CHARSET_HANDLER::well_formed_len().
* MDEV-10866 Extend PREPARE and EXECUTE IMMEDIATE to understand expressionsAlexander Barkov2016-10-084-99/+108
| | | | MDEV-10867 PREPARE..EXECUTE is not consistent about non-ASCII characters
* MDEV-10585 EXECUTE IMMEDIATE statementAlexander Barkov2016-10-089-9/+112
|
* MDEV-10709 Expressions as parameters to Dynamic SQLAlexander Barkov2016-10-086-80/+221
|
* MDEV-10772 Introduce Item_param::CONVERSION_INFOAlexander Barkov2016-10-082-47/+70
|
* After merge and bug fixesMonty2016-10-051-1/+1
| | | | | | | | | | - Fixed compiler warnings - Removed have_debug.inc from innochecksum_3 - Fixed race condition in innodb_buffer_pool_load - Fixed merge issue in innodb-bad-key-change.test - Fixed missing array allocation that could cause function_defaults_notembedded to fail - Fixed thread_cache_size_func
* Remove end . from error messages to get them consistentMonty2016-10-051-235/+235
| | | | Fixed a few failing tests
* Fixed compiler warnings and failing testsMonty2016-10-051-0/+2
|
* Use sql_mode_t for sql_mode.Monty2016-10-0530-56/+84
| | | | This fixed several cases where we where using just ulong for sql_mode
* MDEV-6112 multiple triggers per tableMonty2016-10-0520-840/+1004
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is similar to MysQL Worklog 3253, but with a different implementation. The disk format and SQL syntax is identical with MySQL 5.7. Fetures supported: - "Any" ammount of any trigger - Supports FOLLOWS and PRECEDES to be able to put triggers in a certain execution order. Implementation details: - Class Trigger added to hold information about a trigger. Before this trigger information was stored in a set of lists in Table_triggers_list and in Table_triggers_list::bodies - Each Trigger has a next field that poinst to the next Trigger with the same action and time. - When accessing a trigger, we now always access all linked triggers - The list are now only used to load and save trigger files. - MySQL trigger test case (trigger_wl3253) added and we execute these identically. - Even more gracefully handling of wrong trigger files than before. This is useful if a trigger file uses functions or syntax not provided by the server. - Each trigger now has a "Created" field that shows when the trigger was created, with 2 decimals. Other comments: - Many of the changes in test files was done because of the new "Created" field in the trigger file. This shows up in SHOW ... TRIGGER and when using information_schema.trigger. - Don't check if all memory is released if on uses --gdb; This is needed to be able to get a list from safemalloc of not freed memory while debugging. - Added option to trim_whitespace() to know how many prefix characters was skipped. - Changed a few ulonglong sql_mode to sql_mode_t, to find some wrong usage of sql_mode.
* Fixed bug mdev-10933.Igor Babaev2016-09-301-2/+2
| | | | | The bug was caused by a misplaced construct opt_with_clause for one of the variants of CREATE ... SELECT.
* Post-review addition to the fix for mdev-10868.Igor Babaev2016-09-301-1/+6
|
* Fixed bug mdev-10923.Igor Babaev2016-09-301-4/+9
| | | | | | | The code for st_select_lex::find_table_def_in_with_clauses() did not take into account the fact that the specs for mergeable CTEs were cloned and were not processed by the function With_element::check_dependencies_in_spec().
* Fixed bug mdev-10868.Igor Babaev2016-09-304-1/+95
| | | | | | | | There was no implementation of the virtual method print() for the Item_window_func class. As a result for a view containing window function an invalid view definition could be written in the frm file. When a query that refers to this view was executed a syntax error was reported.
* Fixed bug mdev-10889Igor Babaev2016-09-261-2/+2
| | | | | | The bug was in the code of the recursive method With_element::check_unrestricted_recursive. For recursive calls of this method sel->get_with_element()->owner != owner.
* Fixed bug mdev-10884.mariadb-10.2.2Igor Babaev2016-09-252-12/+16
| | | | | | | | | If a materialized derived table / view is specified by a unit with SELECTs containing ORDER BY ... LIMIT then condition pushdown cannot be done for these SELECTs. If a materialized derived table / view is specified by a unit containing global ORDER BY ... LIMIT then condition pushdown cannot be done for this unit.
* Fixed bug mdev-10881Igor Babaev2016-09-241-0/+6
| | | | | | The server missed to call check_dependencies_in_with_clauses() when processing PREPARE ... FROM CREATE ... SELECT / INSERT ... SELECT with WITH clause before SELECT.
* Fixed bug mdev-10883.Igor Babaev2016-09-241-0/+1
| | | | | | When a prepared statement uses a CTE definition with a column list renaming of columns of the CTE expression must be performed for every execution of the prepared statement.
* Window functions can have an empty over clauseVicențiu Ciorbaru2016-09-241-2/+2
| | | | Make sure we select one window function if we have an empty over clause.
* Make sure to call Rowid_seq_cursor::next to not face infinite recursionVicențiu Ciorbaru2016-09-241-1/+1
|
* MDEV-9736: Window functions: multiple cursors to read filesort resultSergei Petrunia2016-09-241-43/+109
| | | | | | | | | | Add support for having multiple IO_CACHEs with type=READ_CACHE to share the file they are reading from. Each IO_CACHE keeps its own in-memory buffer. When doing a read or seek operation on the file, it notifies other IO_CACHEs that the file position has been changed. Make Rowid_seq_cursor use cloned IO_CACHE when reading filesort result.
* Clean up nth_valueVicențiu Ciorbaru2016-09-242-29/+9
| | | | Implement nth_value correctly and add a test case for it.
* Implement LEAD and LAG and NTH_VALUE functionsVicențiu Ciorbaru2016-09-247-69/+531
| | | | | | | | | | | | | | Refactour out (into a copy for now) the logic of Item_sum_hybrid, to allow for multiple arguments. It does not contain the comparator members. The result is the class Item_sum_hybrid_simple. LEAD and LAG make use of this Item to store previous rows in a chache. It also helps in specifying the field type. Currently LEAD/LAG do not support default values. NTH_VALUE behaves identical to LEAD and LAG, except that the starting position cursor is placed on the top of the frame instead of the current row.
* MDEV-9935: Window functions: assertion failure with empty OVER () clauseVicențiu Ciorbaru2016-09-242-3/+26
| | | | | | Make window functions work with an empty over clause by forcing a sort on the first column of the current join_tab. This is a temporary fix until we get window functions to work with big tables.
* Update Frame_positional_cursor to also take an optional boundVicențiu Ciorbaru2016-09-241-7/+69
| | | | | | The positional cursor now fetches rows based on the positional cursor and an offset (if present). It will fetch rows, based on the offset, only if the required position is not out of bounds.
* Allow first/last value functions to have frame definitionsVicențiu Ciorbaru2016-09-242-2/+12
| | | | Add a test case to check this behavior.
* Make first_value and last_value computation efficientVicențiu Ciorbaru2016-09-242-16/+91
| | | | | | With clever use of partition bounds, we only need to add one row to the items at a time. This way we remove the need to "reset" the item and run through the full partition again.
* Implement first_value and last_value as window functionsVicențiu Ciorbaru2016-09-245-3/+128
| | | | | Currently the implementation doesn't support removal, thus the computation is performed by running over the window frame again.
* Move table record writing outside of loopVicențiu Ciorbaru2016-09-241-19/+4
| | | | | | | | We can set values in the record buffer first and only perform one table write call at the end. No need to write to file every time one column is updated. Also, remove unused method from Table_read_cursor.
* Add a counter for the number of select statements using window functionsVicențiu Ciorbaru2016-09-243-0/+4
| | | | | The counter is available via SHOW [GLOBAL] STATUS and will be reported by the feedback plugin.
* MDEV-10669: Crash in SELECT with window function usedVicențiu Ciorbaru2016-09-241-1/+1
| | | | | Make sure to call split_sum_func on all items that contain window functions, so that all the column references are set up correctly.
* MDEV-10815: Window Function Expressions Wrong ResultsVicențiu Ciorbaru2016-09-243-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | Fix window function expressions such as win_func() <operator> expr. The problem was found in 2 places. First, when we have complex expressions containing window functions, we can only compute their final value _after_ we have computed the window function's values. These values must be stored within the temporary table that we are using, before sending them off. This is done by performing an extra copy_funcs call before the final end_send() call. Second, such expressions need to have their inner arguments, changed such that the references within those arguments point to fields within the temporary table. Ex: sum(t.a) over (order by t.b) + sum(t.a) over (order by t.b) Before this fix, t.a pointed to the original table's a field. In order to compute the sum function's value correctly, it needs to point to the copy of this field inside the temp table. This is done by calling split_sum_func for each argument in the expression in turn. The win.test results have also been updated as they contained wrong values for such a use case.
* Frame bounds using FOLLOWING or PRECEDING can have 0 as cardinal valueVicențiu Ciorbaru2016-09-241-1/+0
| | | | | | | This makes them behave exactly like CURRENT ROW. Standard specifies unsigned integer, which includes the value 0. Expand the win_min_max test to include this kind of frame definitions.
* MDEV-10174: Make the fix for MDEV-8989 enabled by default in 10.2Sergei Petrunia2016-09-241-0/+1
| | | | | - Change the default @@optimizer_switch value - Adjust the testcases
* Fixed bug mdev-10874.Igor Babaev2016-09-231-6/+15
| | | | | In some cases the method Window_funcs_sort::setup() did not build the sequence of sorting keys correctly.
* MDEV-10297 Add priorization to threadpoolVladislav Vaintroub2016-09-228-614/+886
| | | | Also MDEV-10385 Threadpool refactoring
* Merge branch '10.2' into bb-10.2-connector-c-integ-submSergei Golubchik2016-09-222-10/+22
|\
| * Allowed to use WITH clauses before SELECT in CREATE ... SELECTbb-10.2-mdev9864Igor Babaev2016-09-222-10/+22
| | | | | | | | | | and INSERT ... SELECT. Added test cases.
* | Merge branch '10.2' into bb-10.2-connector-c-integ-submSergei Golubchik2016-09-21121-2492/+10193
|\ \ | |/
| * valgrind failuresSergei Golubchik2016-09-213-4/+5
| | | | | | | | | | | | and a couple of collaterals: * debugging assert in my_valgrind.h * trivial cleanup in sql_union.cc
| * Fixed bug mdev-10842.Igor Babaev2016-09-201-1/+1
| | | | | | | | | | In some cases the function compare_order_elements() erroneously returned CMP_EQ for not equal elements.
| * Merge branch '10.2' of github.com:MariaDB/server into 10.2Igor Babaev2016-09-196-19/+25
| |\
| | * Merge branch '10.2' into bb-10.2-janSergei Golubchik2016-09-19125-2753/+10600
| | |\
| | * | increase I_S.FILES.FILE_NANE column lengthSergei Golubchik2016-09-161-1/+1
| | | | | | | | | | | | | | | | because InnoDB 5.7 tdecided to store a full path there
| | * | fix some quoting in error messagesSergei Golubchik2016-09-162-9/+12
| | | | | | | | | | | | | | | | add_identifier change comes from 5.7, everything else is a follow-up
| | * | Remove a bunch of TODO's, fix perfschema.threads_innodb testSergei Golubchik2016-09-111-0/+2
| | | |
| | * | misc after-merge changes:Sergei Golubchik2016-09-104-66/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * remove new InnoDB-specific ER_ and HA_ERR_ codes * renamed few old ER_ and HA_ERR_ error messages to be less MyISAM-specific * remove duplicate enum definitions (durability_properties, icp_result) * move new mysql-test include files to their owner suite * rename xtradb.rdiff files to *-disabled * remove mistakenly committed helper perl module * remove long obsolete handler::ha_statistic_increment() method * restore the standard C xid_t structure to not have setters and getters * remove xid_t::reset that was cleaning too much * move MySQL-5.7 ER_ codes where they belong * fir innodb to include service_wsrep.h not internal wsrep headers * update tests and results
| | * | Merge InnoDB 5.7 from mysql-5.7.14.Jan Lindström2016-09-082-2/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Contains also: MDEV-10549 mysqld: sql/handler.cc:2692: int handler::ha_index_first(uchar*): Assertion `table_share->tmp_table != NO_TMP_TABLE || m_lock_type != 2' failed. (branch bb-10.2-jan) Unlike MySQL, InnoDB still uses THR_LOCK in MariaDB MDEV-10548 Some of the debug sync waits do not work with InnoDB 5.7 (branch bb-10.2-jan) enable tests that were fixed in MDEV-10549 MDEV-10548 Some of the debug sync waits do not work with InnoDB 5.7 (branch bb-10.2-jan) fix main.innodb_mysql_sync - re-enable online alter for partitioned innodb tables
| | * | Merge InnoDB 5.7 from mysql-5.7.9.Jan Lindström2016-09-021-3/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Contains also MDEV-10547: Test multi_update_innodb fails with InnoDB 5.7 The failure happened because 5.7 has changed the signature of the bool handler::primary_key_is_clustered() const virtual function ("const" was added). InnoDB was using the old signature which caused the function not to be used. MDEV-10550: Parallel replication lock waits/deadlock handling does not work with InnoDB 5.7 Fixed mutexing problem on lock_trx_handle_wait. Note that rpl_parallel and rpl_optimistic_parallel tests still fail. MDEV-10156 : Group commit tests fail on 10.2 InnoDB (branch bb-10.2-jan) Reason: incorrect merge MDEV-10550: Parallel replication can't sync with master in InnoDB 5.7 (branch bb-10.2-jan) Reason: incorrect merge
| * | | Fixed a failure with --valgrind for cte_recursive.test.Igor Babaev2016-09-191-1/+0
| | |/ | |/|