summaryrefslogtreecommitdiff
path: root/mysql-test/main/having.test
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'bb-10.5-all-builders' into bb-10.6-all-buildersLena Startseva2022-09-271-0/+11
|\
| * Merge branch 'bb-10.3-all-builders' into bb-10.4-all-buildersLena Startseva2022-09-231-0/+11
| |\
| | * MDEV-27691: make working view-protocolLena Startseva2022-09-231-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | Tests with checking metadata or that cannot be run with the view-protocol are excluded from --view-protocol. For tests that do not allow the use of an additional connection, the util connection is disabled with "--disable_service_connection". Also cases with bugs for --view-protocol are disabled.
* | | Merge branch '10.5' into 10.6Sergei Golubchik2022-05-101-14/+14
|\ \ \ | |/ /
| * | MDEV-28097 use-after-free when WHERE has subquery with an outer reference in ↵Sergei Golubchik2022-04-291-1/+2
| | | | | | | | | | | | | | | | | | | | | HAVING when resolving WHERE and ON clauses, do not look in SELECT list/aliases.
| * | cleanup: (*order->item) -> itemSergei Golubchik2022-04-291-13/+12
| | | | | | | | | | | | and minor style fixes
* | | MDEV-24089 support oracle syntax: rownumMonty2021-05-191-2/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ROWNUM() function is for SELECT mapped to JOIN->accepted_rows, which is incremented for each accepted rows. For Filesort, update, insert, delete and load data, we map ROWNUM() to internal variables incremented when the table is changed. The connection between the row counter and Item_func_rownum is done in sql_select.cc::fix_items_after_optimize() and sql_insert.cc::fix_rownum_pointers() When ROWNUM() is used anywhere in query, the optimization to ignore ORDER BY in sub queries are disabled. This was done to get the following common Oracle query to work: select * from (select * from t1 order by a desc) as t where rownum() <= 2; MDEV-3926 "Wrong result with GROUP BY ... WITH ROLLUP" contains a discussion about this topic. LIMIT optimization is enabled when in a top level WHERE clause comparing ROWNUM() with a numerical constant using any of the following expressions: - ROWNUM() < # - ROWNUM() <= # - ROWNUM() = 1 ROWNUM() can be also be the right argument to the comparison function. LIMIT optimization is done in two cases: - For the current sub query when the ROWNUM comparison is done on the top level: SELECT * from t1 WHERE rownum() <= 2 AND t1.a > 0 - For an inner sub query, when the upper level has only a ROWNUM comparison in the WHERE clause: SELECT * from (select * from t1) as t WHERE rownum() <= 2 In Oracle mode, one can also use ROWNUM without parentheses. Other things: - Fixed bug where the optimizer tries to optimize away sub queries with RAND_TABLE_BIT set (non-deterministic queries). Now these sub queries will not be converted to joins. This bug fix was also needed to get rownum() working inside subqueries. - In remove_const() remove setting simple_order to FALSE if ROLLUP is USED. This code was disable a long time ago because of wrong assignment in the following code. Instead we set simple_order to false if RAND_TABLE_BIT was used in the SELECT list. This ensures that we don't delete ORDER BY if the result set is not deterministic, like in 'SELECT RAND() AS 'r' FROM t1 ORDER BY r'; - Updated parameters for Sort_param::init_for_filesort() to be able to provide filesort with information where the number of accepted rows should be stored - Reordered fields in class Filesort to optimize storage layout - Added new error messsage to tell that a function can't be used in HAVING - Added field 'with_rownum' to THD to mark that ROWNUM() is used in the query. Co-author: Oleksandr Byelkin <sanja@mariadb.com> LIMIT optimization for sub query
* | Merge 10.3 into 10.4Marko Mäkelä2021-03-051-0/+21
|\ \ | |/
| * MDEV-24958 Server crashes in my_strtod ... with DEFAULT(blob)Monty2021-03-011-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes also: MDEV-24942 Server crashes in _ma_rec_pack... with DEFAULT() on BLOB This was caused by two different bugs, both related to that the default value for the blob was not calculated before it was used: - There where now Item_default_value::..result() wrappers, which is needed as item in HAVING uses these. This causes crashes when using a reference to a DEFAULT(blob_field) in HAVING. It also caused wrong results when used with other fields with default value expressions that are not constants. - create_tmp_field() did not take into account that blob fields with default expressions are not yet initialized. Fixed by treating Item_default_value(blob) like a normal item expression.
* | MDEV-20200: AddressSanitizer: use-after-poison in ↵Oleksandr Byelkin2019-07-291-0/+13
| | | | | | | | | | | | Item_direct_view_ref::get_null_ref_table Do not cast wrong type.
* | MDEV-18681 Server crashes in embedding_sjmIgor Babaev2019-02-241-0/+20
|/ | | | | Do not do substitution for best equal field in HAVING conditions. It's not needed.
* Merge branch '10.2' into 10.3Sergei Golubchik2018-06-301-0/+17
|
* Create 'main' test directory and move 't' and 'r' thereMichael Widenius2018-03-291-0/+875