Commit graph

31359 commits

Author SHA1 Message Date
unknown
0c0f49bce2 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.(none):/home/kgeorge/mysql/autopush/B11551-5.0-opt
2006-08-01 06:11:11 +03:00
unknown
b91f3bace1 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  sunlight.local:/local_work/tmp_merge-5.0-opt-mysql
2006-08-01 06:42:33 +04:00
unknown
45871dbfd9 select.result, func_group.result, sql_select.cc:
After merge fix


mysql-test/r/select.result:
  After merge fix
mysql-test/r/func_group.result:
  After merge fix
sql/sql_select.cc:
  After merge fix
2006-07-31 23:05:54 +04:00
unknown
464cb603f0 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.(none):/home/kgeorge/mysql/autopush/B11551-5.0-opt


mysql-test/r/view.result:
  Auto merged
mysql-test/t/view.test:
  Auto merged
sql/sql_view.cc:
  Auto merged
2006-07-31 21:17:20 +03:00
unknown
b74cb62348 Bug #11551: Asymmetric + undocumented behaviour of DROP VIEW and DROP TABLE
made DROP VIEW to continue on error and report an aggregated error 
 at its end. This makes it similar to DROP TABLE.


mysql-test/r/view.result:
  Bug #11551: Asymmetric + undocumented behaviour of DROP VIEW and DROP TABLE
   - test case
   - changed error message
mysql-test/t/view.test:
  Bug #11551: Asymmetric + undocumented behaviour of DROP VIEW and DROP TABLE
   - test case
sql/sql_view.cc:
  Bug #11551: Asymmetric + undocumented behaviour of DROP VIEW and DROP TABLE
   - made DROP VIEW to continue on error and report an aggregated error
2006-07-31 20:56:06 +03:00
unknown
4acf6de89b Merge bk-internal:/home/bk/mysql-5.0-opt
into  macbook.gmz:/Users/kgeorge/mysql/work/B21080-5.0-opt


mysql-test/r/view.result:
  merge
mysql-test/t/view.test:
  merge
2006-07-31 17:40:09 +03:00
unknown
c8673b09b8 Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM
When executing ALTER TABLE all the attributes of the view were overwritten.
  This is contrary to the user's expectations.
  So some of the view attributes are preserved now : namely security and 
  algorithm. This means that if they are not specified in ALTER VIEW
  their values are preserved from CREATE VIEW instead of being defaulted.


mysql-test/r/view.result:
  Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM
   - test suite
mysql-test/t/view.test:
  Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM
   - test suite
sql/sql_lex.h:
  Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM
   - must make create_view_suid a tristate : on/off/unspecified
sql/sql_view.cc:
  Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM
   - open the view to get it's attributes and put then as defaults 
     for ALTER VIEW
sql/sql_yacc.yy:
  Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM
   - must make create_view_suid a tristate : on/off/unspecified
sql/table.h:
  Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM
   - must make create_view_suid a tristate : on/off/unspecified
2006-07-31 17:33:37 +03:00
unknown
08be4e96a9 Merge sunlight.local:/local_work/tmp_merge-4.1-opt-mysql
into  sunlight.local:/local_work/tmp_merge-5.0-opt-mysql


mysql-test/t/select.test:
  Auto merged
sql/sql_select.cc:
  Auto merged
mysql-test/r/func_group.result:
  Manual merge
mysql-test/r/select.result:
  Manual merge
mysql-test/r/subselect.result:
  Manual merge
2006-07-29 23:59:53 +04:00
unknown
667c73be65 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.(none):/home/kgeorge/mysql/autopush/B21019-5.0-opt


sql/sql_select.cc:
  Auto merged
2006-07-27 10:11:13 +03:00
unknown
9c7a329eba Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  rakia.(none):/home/kgeorge/mysql/autopush/B20792-4.1-opt


sql/sql_select.cc:
  Auto merged
2006-07-27 10:06:37 +03:00
unknown
d81d6e7430 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.(none):/home/kgeorge/mysql/autopush/B20792-5.0-opt


sql/sql_select.cc:
  Auto merged
2006-07-27 10:05:03 +03:00
unknown
f15c568657 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/work/19862-bug-5.0-opt-mysql
2006-07-26 21:36:33 +04:00
unknown
1150869c4a item_func.h, item_func.cc, sql_select.cc, item.h:
Post review changes for bug#19862.


sql/sql_select.cc:
  Post review changes for bug#19862.
sql/item_func.h:
  Post review changes for bug#19862.
sql/item_func.cc:
  Post review changes for bug#19862.
sql/item.h:
  Post review changes for bug#19862.
2006-07-26 21:36:03 +04:00
unknown
bb81f6ac2d Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  rakia.(none):/home/kgeorge/mysql/autopush/B20792-4.1-opt


sql/sql_select.cc:
  Auto merged
2006-07-26 19:55:33 +03:00
unknown
c7c8c33c5b Merge macbook.gmz:/Users/kgeorge/mysql/work/B20792-4.1-opt
into  macbook.gmz:/Users/kgeorge/mysql/work/B20792-5.0-opt


mysql-test/r/subselect2.result:
  Auto merged
sql/sql_select.cc:
  Auto merged
2006-07-26 19:23:44 +03:00
unknown
6b75e24b73 * Bug #20792: Incorrect results from aggregate subquery
When processing aggregate functions all tables values are reset
to NULLs at the end of each group. 
When doing that if there are no rows found for a group
the const tables must not be reset as they are not recalculated 
by do_select()/sub_select() for each group.


mysql-test/r/subselect2.result:
  * Bug #20792: Incorrect results from aggregate subquery
   - test suite for the bug. This is dependent on InnoDB despite
     the fact that the bug and the fix are not InnoDB specific.
     This is because of the table flag HA_NOT_EXACT_COUNT.
     When this flag is off (as in MyISAM) both t2 and t3 become of
     join type 'system' as they are estimated to have 1 record and
     and this statistics can be trusted (according to the absence of
     HA_NOT_EXACT_COUNT).
mysql-test/t/subselect2.test:
  * Bug #20792: Incorrect results from aggregate subquery
   - test suite for the bug
sql/sql_select.cc:
  * Bug #20792: Incorrect results from aggregate subquery
   - when clearing results if there are not rows found for group
     the const tables must not be reset as they are not recalculated
     for each group.
2006-07-26 19:19:30 +03:00
unknown
70d27b3503 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  rakia.(none):/home/kgeorge/mysql/autopush/B21019-4.1-opt


sql/sql_select.cc:
  Auto merged
mysql-test/r/select.result:
  SCCS merged
mysql-test/t/select.test:
  SCCS merged
2006-07-26 18:49:26 +03:00
unknown
8c92143b4b Bug #21019: First result of SELECT COUNT(*) different than consecutive runs
Correct merge
2006-07-26 18:18:34 +03:00
unknown
048fbb845d Merge macbook.gmz:/Users/kgeorge/mysql/work/B21019-4.1-opt
into  macbook.gmz:/Users/kgeorge/mysql/work/B21019-5.0-opt


mysql-test/t/select.test:
  Auto merged
sql/sql_select.cc:
  Auto merged
mysql-test/r/select.result:
  SCCS merged
2006-07-26 17:31:34 +03:00
unknown
5ca1ee5eea Bug #21019: First result of SELECT COUNT(*) different than consecutive runs
When optimizing conditions like 'a = <some_val> OR a IS NULL' so that they're
 united into a single condition on the key and checked together the server must 
 check which value is the NULL value in a correct way : not only using ->is_null 
 but also check if the expression doesn't depend on any tables referenced in the 
 current statement. 
 This additional check must be performed because that optimization takes place 
 before the actual execution of the statement, so if the field was initialized 
 to NULL from a previous statement the optimization would be applied incorrectly.


mysql-test/r/select.result:
  Bug #21019: First result of SELECT COUNT(*) different than consecutive runs
   - test case
mysql-test/t/select.test:
  Bug #21019: First result of SELECT COUNT(*) different than consecutive runs
   - test case. 
     Note that ALTER TABLE is important here : it happens to
     leave the Field instance for t1.b set to NULL, witch is vital for
     demonstrating the problem fixed by this changeset.
sql/sql_select.cc:
  Bug #21019: First result of SELECT COUNT(*) different than consecutive runs
   - check whether a value is null taking into account its table dependency.
2006-07-26 13:32:28 +03:00
unknown
3809117084 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.(none):/home/kgeorge/mysql/autopush/B21086-5.0-opt
2006-07-26 11:56:39 +03:00
unknown
03fc0a8fb1 Merge tkatchaounov@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  lamia.home:/home/tkatchaounov/autopush/4.1-bug-20954


mysql-test/r/subselect.result:
  Auto merged
2006-07-26 01:21:35 +03:00
unknown
585b5bbc92 Fix for BUG#20954: avg(keyval) retuns 0.38 but max(keyval) returns an empty set
The problem was in that opt_sum_query() replaced MIN/MAX functions
with the corresponding constant found in a key, but due to imprecise
representation of float numbers, when evaluating the where clause,
this comparison failed.

When MIN/MAX optimization detects that all tables can be removed,
also remove all conjuncts in a where clause that refer to these
tables. As a result of this fix, these conditions are not evaluated
twice, and in the case of float number comparisons we do not discard
result rows due to imprecise float representation.

As a side-effect this fix also corrects an unnoticed problem in
bug 12882.


mysql-test/r/func_group.result:
  BUG#20954 - test result adjustment.
  Adjusted the test result of bug 12882 which was not preperly fixed.
  The current patch corrects the problem that was fully corrected by the
  patch for 12882.
  
  The problem was that opt_sum_query() indicated that the optimizer may
  remove all tables because all MIN/MAX/COUNT functions are constants,
  but this lead to an empty result instead of NULL because the WHERE
  clause was still evaluated.
  
  The current fix removes all conjuncts in the where clause that
  reference the removed tables, and thus corrects the problem.
mysql-test/r/select.result:
  BUG#20954 - added test
mysql-test/r/subselect.result:
  BUG#20954 - test result adjustment.
  
  The fix removes those conditions in a where clause that refer to
  tables optimized away by MIN/MAX optimization (opt_sum_query()).
mysql-test/t/select.test:
  BUG#20954 - added test
sql/sql_select.cc:
  Fix for BUG#20954: avg(keyval) retuns 0.38 but max(keyval) returns an empty set
  
  When MIN/MAX optimization detects that all tables can be removed,
  also remove all conjuncts in a where clause that refer to these
  tables. As a result of this fix, these conditions are not evaluated
  twice, and in the case of float number comparisons we do not discard
  result rows due to imprecise float representation.
  
  As a side-effect this fix also corrects an unnoticed problem in
  bug 12882.
2006-07-26 01:11:19 +03:00
unknown
beb6f57c41 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/work/19862-bug-5.0-opt-mysql


sql/item_func.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
2006-07-26 00:37:35 +04:00
unknown
9a63adc8fd Fixed bug#19862: Sort with filesort by function evaluates function twice
When there is no index defined filesort is used to sort the result of a
query. If there is a function in the select list and the result set should be
ordered by it's value then this function will be evaluated twice. First time to
get the value of the sort key and second time to send its value to a user.
This happens because filesort when sorts a table remembers only values of its
fields but not values of functions.
All functions are affected. But taking into account that SP and UDF functions
can be both expensive and non-deterministic a temporary table should be used 
to store their results and then sort it to avoid twice SP evaluation and to 
get a correct result.

If an expression referenced in an ORDER clause contains a SP or UDF 
function, force the use of a temporary table.

A new Item_processor function called func_type_checker_processor is added
to check whether the expression contains a function of a particular type.


mysql-test/t/udf.test:
  Added test case for bug#19862: Sort with filesort by function evaluates function twice
mysql-test/t/sp.test:
  Added test case for bug#19862: Sort with filesort by function evaluates function twice
mysql-test/r/sp.result:
  Added test case for bug#19862: Sort with filesort by function evaluates function twice
mysql-test/r/udf.result:
  Added test case for bug#19862: Sort with filesort by function evaluates function twice
sql/sql_select.cc:
  Fixed bug#19862: Sort with filesort by function evaluates function twice
  If an expression referenced in an ORDER clause contains a SP or UDF
  function, force the use of a temporary table.
sql/item_func.h:
  Fixed bug#19862: Sort with filesort by function evaluates function twice
  A new Item_processor function called func_type_checker_processor is added
  to check whether the expression contains a function of a particular type.
sql/item.h:
  Fixed bug#19862: Sort with filesort by function evaluates function twice
  A new Item_processor function called func_type_checker_processor is added
  to check whether the expression contains a function of a particular type.
sql/item_func.cc:
  Fixed bug#19862: Sort with filesort by function evaluates function twice
  A new Item_processor function called func_type_checker_processor is added
  to check whether the expression contains a function of a particular type.
2006-07-26 00:31:29 +04:00
unknown
ca3dbd26d4 Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  olga.mysql.com:/home/igor/mysql-5.0-opt
2006-07-25 12:47:01 -07:00
unknown
1b3cdb6085 Bug #21086: server crashes when VIEW defined with a SELECT with COLLATE clause is called
When executing INSERT over a view with calculated columns it was assuming all
  elements of the fields collection are actually Item_field instances.
  This may not be true when inserting into a view and that view has columns that are 
  such expressions that allow updating (like setting a collation for example).
  Corrected to access field information through the filed_for_view_update() function and 
  retrieve correctly the field info even for "update-friendly" non-Item_field items.


mysql-test/r/view.result:
  Bug #21086: server crashes when VIEW defined with a SELECT with COLLATE clause is called
   - test suite
mysql-test/t/view.test:
  Bug #21086: server crashes when VIEW defined with a SELECT with COLLATE clause is called
   - test suite
sql/item_strfunc.h:
  Bug #21086: server crashes when VIEW defined with a SELECT with COLLATE clause is called
   - obvious typo fixed
sql/sql_base.cc:
  Bug #21086: server crashes when VIEW defined with a SELECT with COLLATE clause is called
   - must access field information through the filed_for_view_update() function to retrieve
     correctly the field info even for "update-friendly" non-Item_field items.
2006-07-25 18:42:49 +03:00
unknown
bc6fd749b7 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.(none):/home/kgeorge/mysql/autopush/B16712-5.0-opt


sql/item_sum.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
2006-07-25 11:56:22 +03:00
unknown
4e7121c07b Bug#16712: group_concat returns odd srting insead of intended result
when calculating GROUP_CONCAT all blob fields are transformed
  to varchar when making the temp table.
  However a varchar has at max 2 bytes for length. 
  This fix makes the conversion only for blobs whose max length 
  is below that limit. 
  Otherwise blob field is created by make_string_field() call.


mysql-test/r/func_gconcat.result:
  Bug#16712: group_concat returns odd srting insead of intended result
    * testsuite for the bug
mysql-test/t/func_gconcat.test:
  Bug#16712: group_concat returns odd srting insead of intended result
    * testsuite for the bug
sql/item_sum.cc:
  Bug#16712: group_concat returns odd srting insead of intended result
    * force blob->varchar conversion for small enough blobs only
sql/sql_select.cc:
  Bug#16712: group_concat returns odd srting insead of intended result
    * force blob->varchar conversion for small enough blobs only
2006-07-25 11:45:10 +03:00
unknown
d64f605e48 Fixed bug #21231: wrong results for a simple query with a
a non-correlated single-row subquery over information schema.

The function get_all_tables filling all information schema
tables reset lex->sql_command to SQLCOM_SHOW_FIELDS. After
this the function could evaluate partial conditions related to
some columns. If these conditions contained a subquery over
information schema it led to a wrong evaluation and a wrong 
result set.
This bug was already fixed in 5.1.
This patch follows the way how it was done in 5.1 where
the value of lex->sql_command is set to SQLCOM_SHOW_FIELDS
in get_all_tables only for the calls of the function 
open_normal_and_derived_tables and is restored after these
calls.


mysql-test/r/information_schema.result:
  Added a test case for bug #21231.
mysql-test/t/information_schema.test:
  Added a test case for bug #21231.
2006-07-24 19:05:46 -07:00
unknown
800b160031 Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  olga.mysql.com:/home/igor/mysql-5.0-opt
2006-07-22 12:45:45 -07:00
unknown
43df9fd34c Fixed bug #18925: wrong results for queries with
subqueries on information schema that use MIN/MAX aggregation.

Execution of some correlated subqueries may set the value
of null_row to 1 for tables used in the subquery.
If the the subquery is on information schema it causes
rejection of any row for the following executions of
the subquery in the case when an optimization filtering
by some condition is applied.

The fix restores the value of the null_row flag for 
each execution of a subquery on information schema.


mysql-test/r/information_schema.result:
  Added a test case for bug #18925.
mysql-test/t/information_schema.test:
  Added a test case for bug #18925.
sql/sql_show.cc:
  Fixed bug #18925.
  Execution of some correlated subqueries may set the value
  of null_row to 1 for tables used in the subquery.
  If the the subquery is on information schema it causes
  rejection of any row for the following execitions of
  the subquery in the case when an optimization filtering
  by some condition is applied.
  
  The fix restores the value of the null_row flag for 
  each execution of a subquery on information schema.
2006-07-22 12:44:54 -07:00
unknown
8a596b0237 Merge office:mysql/autopush/B20466-5.0-opt
into  macbook.mshome.net:/Users/kgeorge/mysql/work/B20466-5.0-opt


sql/sql_select.cc:
  Auto merged
2006-07-22 15:18:30 +03:00
unknown
6c6c280bbc Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.(none):/home/kgeorge/mysql/autopush/B20868-5.0-opt
2006-07-22 15:18:29 +03:00
unknown
0f5797f576 Post-merge fixes 2006-07-22 16:18:28 +04:00
unknown
c24e91ece7 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.(none):/home/kgeorge/mysql/autopush/B20868-5.0-opt
2006-07-22 14:03:42 +03:00
unknown
0950a31683 Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/psergey/mysql-5.0-opt2
2006-07-22 15:03:41 +04:00
unknown
cf1c7cb203 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.(none):/home/kgeorge/mysql/autopush/B20868-5.0-opt
2006-07-22 09:11:50 +03:00
unknown
5a3a1c98a4 field.h:
Fixed typo.


sql/field.h:
  Fixed typo.
2006-07-22 05:52:37 +04:00
unknown
8fc51f7aa6 Merge mysql.com:/home/psergey/mysql-4.1-opt
into  mysql.com:/home/psergey/mysql-5.0-opt2


mysql-test/r/subselect.result:
  Manual merge
mysql-test/t/subselect.test:
  Manual merge
2006-07-22 02:41:29 +04:00
unknown
9d432f0dae Add missing "DROP TABLE" clause 2006-07-22 02:36:17 +04:00
unknown
f171d628c7 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/work/autopush/12185-bug-5.0-opt-mysql


mysql-test/r/create.result:
  Auto merged
mysql-test/t/innodb.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/item.cc:
  Auto merged
mysql-test/r/union.result:
  SCCS merged
mysql-test/t/union.test:
  SCCS merged
2006-07-22 02:15:36 +04:00
unknown
35209c68ea Fixed bug#12185: Data type aggregation may produce wrong result
The Item::tmp_table_field_from_field_type() function creates Field_datetime
object instead of Field_timestamp object for timestamp field thus always
changing data type is a tmp table is used.

The Field_blob object constructor which is used in the 
Item::tmp_table_field_from_field_type() is always setting packlength field of
newly created blob to 4. This leads to changing fields data type for example
from the blob to the longblob if a temporary table is used.

The Item::make_string_field() function always converts Field_string objects 
to Field_varstring objects. This leads to changing data type from the 
char/binary to varchar/varbinary.

Added appropriate Field_timestamp object constructor for using in the 
Item::tmp_table_field_from_field_type() function.

Added Field_blob object constructor which sets pack length according to
max_length argument.

The Item::tmp_table_field_from_field_type() function now creates
Field_timestamp object for a timestamp field.

The Item_type_holder::display_length() now returns correct NULL length NULL
length. 

The Item::make_string_field() function now doesn't change Field_string to
Field_varstring in the case of Item_type_holder. 

The Item::tmp_table_field_from_field_type() function now uses the Field_blob
constructor which sets packlength according to max_length.


mysql-test/t/union.test:
  Added test case for bug#12185: Data type aggregation may produce wrong result
  Corrected test case after fix for bug#12185
mysql-test/t/innodb.test:
  Corrected test case after fix for bug#12185
mysql-test/r/union.result:
  Added test case for bug#12185: Data type aggregation may produce wrong result
   Corrected test case after fix for bug#12185
mysql-test/r/innodb.result:
  Corrected test case after fix for bug#12185
mysql-test/r/create.result:
  Corrected the test case after fixing bug#12185
sql/field.h:
  Fixed bug#12185: Data type aggregation may produce wrong result
  Added Field_blob object constructor which sets packlength according to
  max_length argument.
sql/item.cc:
  Fixed bug#12185: Data type aggregation may produce wrong result
  The Item::make_string_field() function now doesn't change Field_string to
  Field_varstring in the case of Item_type_holder.
  The Item::tmp_table_field_from_field_type() function now creates
  Field_timestamp object for a timestamp field.
  The Item::tmp_table_field_from_field_type() function now uses the Field_blob
  constructor which sets packlength according to max_length.
  The Item_type_holder::display_length() now returns correct NULL length NULL
  length.
sql/field.cc:
  Fixed bug#12185: Data type aggregation may produce wrong result
  Added appropriate Field_timestamp object constructor for using in the 
  Item::tmp_table_field_from_field_type() function.
2006-07-22 02:08:00 +04:00
unknown
c13be23004 Merge mysql.com:/home/psergey/mysql-4.1-opt
into  mysql.com:/home/psergey/mysql-5.0-opt


sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_subselect.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
mysql-test/r/subselect.result:
  Manual merge
mysql-test/t/subselect.test:
  Manual merge
sql/mysql_priv.h:
  Manual merge
2006-07-21 23:45:34 +04:00
unknown
7118c2523c Bug #20466: a view is mixing data when there's a trigger on the table
When making a place to store field values at the start of each group
  the real item (not the reference) must be used when deciding which column
  to copy.


mysql-test/r/group_by.result:
  Bug #20466: a view is mixing data when there's a trigger on the table
   - test suite for the bug
mysql-test/t/group_by.test:
  Bug #20466: a view is mixing data when there's a trigger on the table
   - test suite for the bug
sql/sql_select.cc:
  Bug #20466: a view is mixing data when there's a trigger on the table
   - deal correctly with references
2006-07-21 20:44:35 +03:00
unknown
47d6f7a60c Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.(none):/home/kgeorge/mysql/autopush/B20868-5.0-opt
2006-07-21 18:10:37 +03:00
unknown
8024aabb76 Bug #20868: Client connection is broken on SQL query error
An aggregate function reference was resolved incorrectly and
caused a crash in count_field_types.
 Must use real_item() to get to the real Item instance through
the reference


mysql-test/r/func_group.result:
  Bug #20868: Client connection is broken on SQL query error
   * test case for the bug
mysql-test/t/func_group.test:
  Bug #20868: Client connection is broken on SQL query error
   * test case for the bug
sql/sql_select.cc:
  Bug #20868: Client connection is broken on SQL query error
   * correctly resolve aggregate function references.
2006-07-21 17:59:52 +03:00
unknown
f57bb34775 Merge tkatchaounov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  lamia.home:/home/tkatchaounov/autopush/5.0-bug-21007


client/mysql.cc:
  Auto merged
mysql-test/r/date_formats.result:
  Auto merged
mysql-test/r/func_str.result:
  Auto merged
mysql-test/t/date_formats.test:
  Auto merged
mysql-test/t/func_str.test:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/time.cc:
  Auto merged
2006-07-21 13:04:40 +03:00
unknown
4e59d30dc9 Fix for BUG#21007.
The problem was that store_top_level_join_columns() incorrectly assumed
that the left/right neighbor of a nested join table reference can be only
at the same level in the join tree.

The fix checks if the current nested join table reference has no immediate
left/right neighbor, and if so chooses the left/right neighbors of the
nearest upper level, where these references are != NULL.


mysql-test/r/group_min_max.result:
  Test for BUG#21007.
mysql-test/t/group_min_max.test:
  Test for BUG#21007.
sql/sql_base.cc:
  After computing and materializing the columns of all NATURAL joins in a FROM clause,
  the procedure store_top_level_join_columns() has to change the current natural join
  into a leaf table reference for name resolution. For this it needs to make the left
  neighbor point to the natural join table reference, and the natural join itself point
  to its left neighbor.
  
  This fix correctly determines the left/right neighbors of a table reference, even if
  the neghbors are at higher levels in the nested join tree. The rule is that if a table
  reference has no immediate left/right neighbors, we recursively pick the left/right
  neighbor of the level(s) above.
2006-07-21 11:59:46 +03:00
unknown
68698c04ab BUG#20975: Incorrect query result for NOT (subquery):
Add implementations of Item_func_{nop,not}_all::neg_transformer


mysql-test/r/subselect.result:
  BUG#20975: testcase
mysql-test/t/subselect.test:
  BUG#20975: testcase
sql/mysql_priv.h:
  Make chooser_compare_func_creator visible in item.h
2006-07-21 03:04:04 +04:00