Commit graph

30 commits

Author SHA1 Message Date
igor@rurik.mysql.com
e2feeb88f9 Made the test case for bug #15917 independent on platforms. 2006-04-10 14:14:20 -07:00
igor@rurik.mysql.com
9bd0b97824 Fixed bug #15917: unexpected complain for a NIST test case.
The problem was due to the fact that with --lower-case-table-names set to 1 
the function find_field_in_group did not convert the prefix 'HU' in
HU.PROJ.CITY into lower case when looking for it in the group list. Yet the
names in the group list were extended by the database name in lower case.
2006-04-06 15:29:15 -07:00
igor@rurik.mysql.com
af2d79a771 Fixed bug #16504.
Multiple equalities were not adjusted after reading constant tables.
It resulted in neglecting good index based methods that could be
used to access of other tables.
2006-03-31 21:26:17 -08:00
igor@rurik.mysql.com
7b58b91fe4 Fixes after manual merge 2006-02-02 23:56:08 -08:00
igor@rurik.mysql.com
f61517d60b Merge rurik.mysql.com:/home/igor/dev/mysql-4.1-0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-0
2006-02-02 21:23:36 -08:00
igor@rurik.mysql.com
d6370b48a7 FIxed bug #14927.
A query with a group by and having clauses could return a wrong
result set if the having condition contained a constant conjunct 
evaluated to FALSE.
It happened because the pushdown condition for table with
grouping columns lost its constant conjuncts.
Pushdown conditions are always built by the function make_cond_for_table
that ignores constant conjuncts. This is apparently not correct when
constant false conjuncts are present.
2006-01-31 21:48:32 -08:00
igor@rurik.mysql.com
bf78fd5438 Merge rurik.mysql.com:/home/igor/dev/mysql-4.1-0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-0
2006-01-07 23:10:08 -08:00
igor@rurik.mysql.com
05947d9916 Fixed bug #14274: a query with a having clause containing only set function returned a wrong result set. 2006-01-07 23:00:06 -08:00
timour@mysql.com
3220f721dd Fix for BUG#11211 "GROUP BY doesn't work correctly"
When the GROUP BY clause contains a column reference that can be resolved to
both an aliased column in the SELECT list, and to a column in the FROM clause,
the group column is resolved to the column in the FROM clause (for ANSI conformance).
However, it may be so that the user's intent is just the other way around, and he/she
gets the query results grouped by a completely different column than expexted.
This patch adds a warning in such cases that tells the user that there is potential
ambiguity in the group column.

sql/sql_select.cc
- Added a warning when a GROUP column is ambiguous due to that there is a
  column reference with the same name both in the SELECT and FROM clauses.
  In this case we resolve to the column in FROM clause and warn the user
  of a possible ambiguity.
- More extensive comments.
- Changed the function to return bool instead of int (as in other places).

mysql-test/t/group_by.test
  Added test for BUG#11211.

mysql-test/r/group_by.result
  Added test for BUG#11211.
2005-06-15 10:12:49 +03:00
timour@mysql.com
974c29b97b WL#1972 "Evaluate HAVING before SELECT select-list"
- post-review fix regarding Item_fields
- added test for the changed name resolution
2004-11-09 17:56:33 +02:00
timour@mysql.com
660e1236b5 WL#1972 "Evaluate HAVING before SELECT"
- more tests, post-review changes, bug-fixes, simplifications, and improved comments
2004-11-05 15:48:44 +02:00
timour@mysql.com
09f1c7096c WL#1972 "Evaluate HAVING before SELECT select-list"
- Changed name resolution for GROUP BY so that derived columns do not shadow table columns
  from the FROM clause. As a result GROUP BY now is handled as a true ANSI extentsion.
- Issue a warning when HAVING is resolved into ambiguous columns, and prefer the columns from
  the GROUP BY clause over SELECT columns.
2004-11-02 18:23:15 +02:00
timour@mysql.com
9161669492 Implementation of WL#1972 "Evaluate HAVING before SELECT select-list" 2004-10-28 17:31:26 +03:00
monty@mysql.com
31122efde7 Merge with 4.1
(Includes merge of arena code in 4.1 and 5.0)
2004-09-06 15:14:10 +03:00
monty@mysql.com
ea687ba5da Portability fixes
Fixed bug in end space handle for WHERE text_column="constant"
2004-08-26 18:26:38 +03:00
serg@serg.mylan
3f2210c064 after merge fixes 2004-08-19 03:02:09 +02:00
serg@serg.mylan
e1237cbc53 manually merged 2004-08-18 19:57:55 +02:00
vva@eagle.mysql.r18.ru
5406709672 fixed Bug #4358 Problem with HAVING clause that uses alias
from the select list and TEXT field 

make setup_copy_fields to insert Item_copy_string for blobs in 
the beginning of the copy_funcs (push_back instead of push_front)

the thing is that Item_copy_string::copy for function can call 
Item_copy_string::val_int for blob via Item_ref.
But if Item_copy_string::copy for blob isn't called before, 
it's value will be wrong.

So all the Item_copy_string::copy for blobs should be called before 
Item_copy_string::copy for functions.
2004-08-12 20:37:31 +05:00
bell@sanja.is.com.ua
1e3f10a4b1 mark subquery in the FROM clause like derived and quoate all identifiers (BUG#4609) 2004-07-20 08:48:28 +03:00
bell@sanja.is.com.ua
4c774e0c18 fixed flags of printed query 2004-05-13 23:47:20 +03:00
bell@sanja.is.com.ua
33346e26af added code covarage for functions convert(), nullif(), crc32(), 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)
2003-10-30 12:57:26 +02:00
monty@narttu.mysql.fi
dd2b7918cd Merge with 4.0.13 2003-05-19 16:35:49 +03:00
monty@mashka.mysql.fi
4bde719df7 Safety fix to enable RAID in max binaries
Better fix for format('nan')
Fix for HAVING COUNT(DISTINCT...)
2003-05-13 10:54:07 +03:00
Sinisa@sinisa.nasamreza.org
8c36b3b4ec A fix for bug #176
code cleanup
2003-03-24 22:52:46 +02:00
vva@eagle.mysql.r18.ru
b624df724b add VARIANCE function 2002-12-14 03:36:59 +04:00
monty@tik.mysql.fi
9d9bcf25e7 Fix sorting of NULL values (Should always be first)
Fix problem with HAVING and MAX() IS NOT NULL
2002-03-02 09:51:24 +02:00
monty@hundin.mysql.fi
3afb157ca2 Fixes up things after merge from 3.23.44
Portability fixes.
Don't delete temporary tables on FLUSH tables.
2001-11-05 01:04:08 +02:00
monty@hundin.mysql.fi
5609e21d70 use local version when doing merge with 3.23.44 2001-11-04 16:14:57 +02:00
monty@hundin.mysql.fi
d89690e606 Portability fixes
Fix for consistent 0000-00-00 date handling
Close + open binary logs on flush tables
Fix for AVG() in HAVING.
2001-10-31 18:27:49 +02:00
monty@donna.mysql.com
0732f7475e Fixed for bugs that was found when getting full code coverage of BDB
Fixed bug with HEAP tables on windows
Fixed bug with HAVING on empty tables
2001-01-17 03:15:20 +02:00