summaryrefslogtreecommitdiff
path: root/mysql-test/t/olap.test
Commit message (Collapse)AuthorAgeFilesLines
* Bug #48475: DISTINCT is ignored with GROUP BY WITH ROLLUP andAlexey Kopytov2009-11-061-0/+13
| | | | | | | | | | | | | | | | only const tables The problem was caused by two shortcuts in the optimizer that are inapplicable in the ROLLUP case. Normally in a case when only const tables are involved in a query, DISTINCT clause can be safely optimized away since there may be only one row produced by the join. Similarly, we don't need to create a temporary table to resolve DISTINCT/GROUP BY/ORDER BY. Both of these are inapplicable when the WITH ROLLUP modifier is present. Fixed by disabling the said optimizations for the WITH ROLLUP case.
* Bug #48131: crash group by with rollup, distinct, filesort,Alexey Kopytov2009-10-301-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with temporary tables There were two problems the test case from this bug was triggering: 1. JOIN::rollup_init() was supposed to wrap all constant Items into another object for queries with the WITH ROLLUP modifier to ensure they are never considered as constants and therefore are written into temporary tables if the optimizer chooses to employ them for DISTINCT/GROUP BY handling. However, JOIN::rollup_init() was called before make_join_statistics(), so Items corresponding to fields in const tables could not be handled as intended, which was causing all kinds of problems later in the query execution. In particular, create_tmp_table() assumed all constant items except "hidden" ones to be removed earlier by remove_const() which led to improperly initialized Field objects for the temporary table being created. This is what was causing crashes and valgrind errors in storage engines. 2. Even when the above problem had been fixed, the query from the test case produced incorrect results due to some DISTINCT/GROUP BY optimizations being performed by the optimizer that are inapplicable in the WITH ROLLUP case. Fixed by disabling inapplicable DISTINCT/GROUP BY optimizations when the WITH ROLLUP modifier is present, and splitting the const-wrapping part of JOIN::rollup_init() into a separate method which is now invoked after make_join_statistics() when the const tables are already known.
* Fix for bug #32558: group by null-returning expression with rollup causes crashramil/ram@mysql.com/ramil.myoffice.izhnet.ru2007-11-211-0/+9
| | | | | | | | Problem: setting Item_func_rollup_const::null_value property to argument's null_value before (without) the argument evaluation may result in a crash due to wrong null_value. Fix: use is_null() to set Item_func_rollup_const::null_value instead as it evaluates the argument if necessary and returns a proper value.
* Bug#31095: Unexpected NULL constant caused server crash.evgen@moonbone.local2007-10-011-0/+9
| | | | | | | | | | The Item_func_rollup_const class is used for wrapping constants to avoid wrong result for ROLLUP queries with DISTINCT and a constant in the select list. This class is also used to wrap up a NULL constant but its null_value wasn't set accordingly. This led to a server crash. Now the null_value of an object of the Item_func_rollup_const class is set by its fix_length_and_dec member function.
* Merge olga.mysql.com:/home/igor/mysql-4.1-optigor@olga.mysql.com2007-04-291-3/+19
|\ | | | | | | into olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug24856
| * Fix in comments.igor@olga.mysql.com2007-04-291-1/+1
| |
| * Fixed bug #24856: the result set of a ROLLUP query with DISTINCT could lackigor@olga.mysql.com2007-04-291-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | some rollup rows (rows with NULLs for grouping attributes) if GROUP BY list contained constant expressions. This happened because the results of constant expressions were not put in the temporary table used for duplicate elimination. In fact a constant item from the GROUP BY list of a ROLLUP query can be replaced for an Item_null_result object when a rollup row is produced . Now the JOIN::rollup_init function wraps any constant item referenced in the GROYP BY list of a ROLLUP query into an Item_func object of a special class that is never detected as constant item. This ensures creation of fields for such constant items in temporary tables and guarantees right results when the result of the rollup operation first has to be written into a temporary table, e.g. in the cases when duplicate elimination is required.
* | Fixed bug #26830: a crash for the query with a subselect containing ROLLUP.igor@olga.mysql.com2007-03-101-0/+15
| | | | | | | | | | Crash happened because the function get_best_group_min_max detected joins with ROLLUP incorrectly.
* | Merge dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-4.1-optgkodinov@dl145s.mysql.com2006-10-191-1/+9
|\ \ | |/ | | | | into dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.0-opt
| * Fixed bug#20825: rollup puts non-equal values togetherevgen@moonbone.local2006-09-291-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix for bug 7894 replaces a field(s) in a non-aggregate function with a item reference if such a field was specified in the GROUP BY clause in order to get a correct result. When ROLLUP is involved this lead to a wrong result due to value of a such field is got through a copy function and copying happens after the function evaluation. Such replacement isn't needed if grouping is also done by such a function. The change_group_ref() function now isn't called for a function present in the group list.
* | Manual mergeevgen@moonbone.local2005-09-151-0/+10
|\ \ | |/
| * Fix bug#12887 Distinct is not always applied after rollupevgen@moonbone.local2005-09-151-0/+9
| | | | | | | | | | | | | | | | | | For queries with GROUP BY and without hidden GROUP BY fields DISTINCT is optimized away becuase such queries produce result set without duplicates. But ROLLUP can add rows which may be same to some rows and this fact was ignored. Added check so if ROLLUP is present DISTINCT can't be optimized away.
* | Post-merge fixessergefp@mysql.com2005-09-091-1/+0
|\ \
| * \ Merge 4.1->5.0sergefp@mysql.com2005-09-091-0/+13
| |\ \ | | |/
| * | Merge mysql.com:/home/my/mysql-4.1monty@mysql.com2005-07-281-0/+2
| |\ \ | | | | | | | | | | | | into mysql.com:/home/my/mysql-5.0
| * | | After-merge fixes.konstantin@mysql.com2005-07-191-0/+1
| | | |
| * | | Merge mysql.com:/home/kostja/mysql/mysql-4.1-rootkonstantin@mysql.com2005-07-191-0/+9
| |\ \ \ | | | | | | | | | | | | | | | into mysql.com:/home/kostja/mysql/mysql-5.0-merge
| * | | | view.result:igor@rurik.mysql.com2005-07-011-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed the results of a test for group_concat. After the fix foor bug #11639 the results became correct. olap.result, olap.test: Added a test case for bug #11639. sql_select.cc: Fixed bug #11639: a wrong result set when using a view instead of the underlying table in a rollup query executed through filesort. The old code did not take into account that we always use an Item_ref object when referring to a view column. item.h: Fixed bug #11639. Now if two Item_ref items ref1 and ref2 refer to the same field then ref1->eq(ref2) returns 1.
| * | | | Manual post mergeigor@rurik.mysql.com2005-05-301-0/+30
| |\ \ \ \
| * \ \ \ \ Resolve merge from 4.1jimw@mysql.com2005-05-181-0/+24
| |\ \ \ \ \
| * | | | | | Tests and results fixed with last precision/decimal related modificationsholyfoot@hf-ibm.(none)2005-05-061-0/+5
| | | | | | |
| * | | | | | Merge of the fix for bug #9681 4.1->5.0igor@rurik.mysql.com2005-04-191-0/+13
| |\ \ \ \ \ \
| * | | | | | | Cleanups during review of codemonty@mysql.com2005-03-211-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed newly introduced bug in rollup
* | | | | | | | olap.result, olap.test:igor@rurik.mysql.com2005-09-081-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a test case with VIEW for bug #12885.
* | | | | | | | Manual mergeigor@rurik.mysql.com2005-09-081-0/+31
| |_|_|_|_|_|/ |/| | | | | |
* | | | | | | sql_select.cc:igor@rurik.mysql.com2005-09-081-0/+13
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed bug #12885. Forced inheritence of the maybe_null flag for the expressions containing GROUP BY attributes in selects with ROLLUP. olap.test, olap.result: Added test case for bug #12885.
* | | | | | Added end marker for tests to make future merges easiermonty@mysql.com2005-07-281-0/+2
| |_|_|_|/ |/| | | |
* | | | | olap.result, olap.test:igor@rurik.mysql.com2005-07-011-0/+11
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a test case for bug #11543. sql_select.cc: Fixed bug #11543. A ROLLUP query could return a wrong result set when its GROUP BY clause contained references to the same column.
* | | | olap.result, olap.test:igor@rurik.mysql.com2005-05-301-0/+30
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added test cases for bug #7894. sql_select.cc: Fixed bug #7894: GROUP BY queries with ROLLUP returned wrong results for expressions containing group by columns. The fix ensured correct results by replacement of all occurrences of group by fields in non-aggregate expressions for corresponding ref objects and preventing creation of fields in temporary tables for expression containing group by fields.
* | | olap.result, olap.test:igor@rurik.mysql.com2005-05-181-0/+24
| |/ |/| | | | | | | | | Added test cases for bug #7914. sql_select.cc: Fixed bug #7914: rollup over expresssions such as sum(a)+1.
* | sql_select.cc:igor@rurik.mysql.com2005-04-191-0/+13
|/ | | | | | | | | | | | | Fixed bug #9681. The bug happened with queries using derived tables specified by a SELECT with ROLLUP, such as: SELECT * FROM (SELECT a, SUM(a) FROM t1 GROUP BY a WITH ROLLUP) t2, if column a of table t1 is declared as NOT NULL. This was to the fact that the first column of the temporary table created to contain the derived table erroneously inherited the NOT NULL attribute from column a. olap.result, olap.test: Added a test case for bug #9681.
* olap.test:igor@rurik.mysql.com2005-03-171-0/+16
| | | | | | | | Added a test case for bug #8617. sql_select.cc: Fixed bug #8617. Queries with ROLLUP and LIMIT n returned more than n rows if SQL_CALC_FOUND_ROWS was used.
* olap.result, olap.test:igor@rurik.mysql.com2005-03-161-1/+4
| | | | | | | | | | Added a test for bug #8615. sql_select.cc: Fixed bug #8615. This fix only removed the cause of the reported crash. It does not resolve other problems of rollup queries with DISTINCT. They were fixed in the previous patch for bug 8616.
* olap.result, olap.test:igor@rurik.mysql.com2005-03-151-0/+27
| | | | | | | | | | | Added a test case for bug #8616. item.h: Fixed bug #8616. Added class Item_null_result used in rollup processing. sql_select.h, sql_select.cc: Fixed bug #8616. Added JOIN::rollup_write_data to cover rollup queries with DISTINCT. Modified other rollup methods.
* olap.test, olap.result:igor@rurik.mysql.com2004-08-121-0/+37
| | | | | | | | | | | | | | | Added test case for bug #4767. item_sum.cc: Added a correct setting of the maybe_null flag for a copy of an Item_sum object where the argument was a field of an inner table in an outer join read from a temporary table. It's part of the fix for bug #4767. sql_select.cc: Made change_refs_to_tmp_fields work correctly for test case of bug #4767 where Item_sum::get_tmp_table_item failed to build a correct copy of an Item_sum object referring to a field in a temporary table. It looks like a hack yet.
* added code covarage for functions convert(), nullif(), crc32(), ↵bell@sanja.is.com.ua2003-10-301-1/+1
| | | | | | | | is_used_lock(), char_lengtrh(), bit_xor() added string length for more speed made code covarage for print() method of Item fixed printability of some items (SCRUM) (WL#1274)
* Fix for bug in ROLLUP when all tables where 'const' tables (Bug #714)monty@narttu.mysql.fi2003-08-261-0/+11
|
* Added SQLSTATE to client/server protocolmonty@narttu.mysql.fi2003-06-041-24/+72
| | | | | | | | | | bmove_allign -> bmove_align Added OLAP function ROLLUP Split mysql_fix_privilege_tables to a script and a .sql data file Added new (MEMROOT*) functions to avoid calling current_thd() when creating some common objects. Added table_alias_charset, for easier --lower-case-table-name handling Better SQL_MODE handling (Setting complex options also sets sub options) New (faster) assembler string functions for x86
* Changed mysql-test to print warnings for not existing table to DROP TABLEmonty@mashka.mysql.fi2003-01-061-9/+13
| | | | | | Cleaned up test; Removed wrong DROP TABLE commands and use standard table and database names. changed store_warning() -> push_warning_print()
* Removed wrong implementation of CUBE/ROLLUPmonty@mashka.mysql.fi2002-07-241-0/+5
| | | | | | Fixed bugfix of INSERT ... SET db_name.table_name.column_name Changed locking to external-locking Fix client hangup for some invalid SQL queries.
* OLAP functionality plus some small bug fixesSinisa@sinisa.nasamreza.org2002-07-201-0/+22