Commit graph

342 commits

Author SHA1 Message Date
evgen@sunlight.local
5866eb948a Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0
into sunlight.local:/work_local/17336-bug-5.0-mysql
2006-03-14 15:33:13 +03:00
evgen@sunlight.local
af660df0ef Fixed bug#17366: Unchecked Item_int results in server crash
When there is conjunction of conds, the substitute_for_best_equal_field()
will call the eliminate_item_equal() function in loop to build final
expression. But if eliminate_item_equal() finds that some cond will always
evaluate to 0, then that cond will be substituted by Item_int with value ==
0. In this case on the next iteration eliminate_item_equal() will get that 
Item_int and treat it as Item_cond. This is leads to memory corruption and
server crash on cleanup phase.

To the eliminate_item_equal() function was added DBUG_ASSERT for checking
that all items treaten as Item_cond are really Item_cond.
The substitute_for_best_equal_field() now checks that if
eliminate_item_equal() returns Item_int and it's value is 0 then this 
value is returned as the result of whole conjunction.
2006-03-13 21:11:15 +03:00
monty@mysql.com
82b77cdd90 Fixes to embedded server to be able to run tests with it
(Needed for "list of pushes" web page and autopush)
2006-02-24 18:34:15 +02:00
igor@rurik.mysql.com
75b6930d54 Fixed bug #16603.
A subquery transformation changes the HAVING clause of the embedding query if the subquery contains
a GROUP BY clause. Yet the split_sum_func2 function was not applied to the modified HAVING clause.
This could result in wrong answers.
2006-02-13 18:50:06 -08:00
igor@rurik.mysql.com
c136e9c43b Fixed bug #12762:
allowed set functions aggregated in outer subqueries, allowed nested set functions.
2005-10-15 14:32:37 -07:00
guilhem@mysql.com
a6ceb59491 fixes after merge of 4.1. 2005-10-13 00:29:23 +02:00
guilhem@mysql.com
4252b546b3 Merge mysql.com:/home/mysql_src/mysql-4.1
into  mysql.com:/home/mysql_src/mysql-5.0;
a very bad automerge (issues with non-ascii chars), plus some hard conflicts I'll fix by hand in a next cset
2005-10-12 21:58:02 +02:00
grog@mysql.com
c248a36e30 sql_yacc.yy:
Bug #10308: Parse 'purge master logs' with subselect correctly.
subselect.test:
  Bug #10308: Test for 'purge master logs' with subselect.
subselect.result:
  Bug #10308: Test result for 'purge master logs' with subselect.
2005-10-12 09:47:59 +02:00
timour@mysql.com
e040300393 WL#2486 - natural and using join according to SQL:2003
* Provide backwards compatibility extension to name resolution of
  coalesced columns. The patch allows such columns to be qualified
  with a table (and db) name, as it is in 4.1.
  Based on a patch from Monty.

* Adjusted tests accordingly to test both backwards compatible name
  resolution of qualified columns, and ANSI-style resolution of
  non-qualified columns.
  For this, each affected test has two versions - one with qualified
  columns, and one without.
2005-08-23 18:08:04 +03:00
igor@rurik.mysql.com
c5ac7e8d95 Manual merge 2005-08-15 21:58:17 -07:00
igor@rurik.mysql.com
d553e16518 subselect.result:
Added missing drop statement
subselect.test:
  Added missing drop statement.
2005-08-15 21:43:46 -07:00
igor@rurik.mysql.com
9693dc6a6b sql_select.cc:
Fixed bug #11479.
  The JOIN::reinit method cannot call setup_tables
  after the optimization phase since this function
  removes some optimization settings for joined
  tables. E.g. it resets values of the null_row flag to 0.
subselect.result, subselect.test:
  Added a test case for bug #11479.
2005-08-15 21:33:58 -07:00
sanja@hasky.mysql.fi
16d279bb12 Merge abelkin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  hasky.mysql.fi:/home/sanja/work-merge-5.0
2005-08-13 08:19:34 +03:00
bell@50.0.168.192.in-addr.arpa
1e248ceaf1 fixed convertion and handling IN subqueries with rows (BUG#11867) 2005-08-13 07:45:14 +03:00
timour@mysql.com
354ce1d024 Merge mysql.com:/home/timka/mysql/src/5.0-virgin
into  mysql.com:/home/timka/mysql/src/5.0-2486-merge
2005-08-12 19:27:54 +03:00
timour@mysql.com
a247282aa6 Implementation of WL#2486 -
"Process NATURAL and USING joins according to SQL:2003".

* Some of the main problems fixed by the patch:
  - in "select *" queries the * expanded correctly according to
    ANSI for arbitrary natural/using joins
  - natural/using joins are correctly transformed into JOIN ... ON
    for any number/nesting of the joins.
  - column references are correctly resolved against natural joins
    of any nesting and combined with arbitrary other joins.

* This patch also contains a fix for name resolution of items
  inside the ON condition of JOIN ... ON - in this case items must
  be resolved only against the JOIN operands. To support such
  'local' name resolution, the patch introduces a stack of
  name resolution contexts used at parse time.

NOTICE:
- This patch is not complete in the sense that
  - there are 2 test cases that still do not pass -
    one in join.test, one in select.test. Both are marked
    with a comment "TODO: WL#2486".
  - it does not include a new test specific for the task
2005-08-12 17:57:19 +03:00
acurtis@xiphis.org
b9476f7d50 Merge xiphis.org:/usr/home/antony/work2/mysql-4.1
into  xiphis.org:/usr/home/antony/work2/merge-5.0
2005-08-11 12:18:53 +01:00
igor@rurik.mysql.com
253883803b Merge rurik.mysql.com:/home/igor/mysql-4.1
into rurik.mysql.com:/home/igor/dev/mysql-4.1-0
2005-08-08 16:55:29 -07:00
igor@rurik.mysql.com
73be194f96 subselect.test, subselect.result:
Added a test case for bug #12392.
item_cmpfunc.cc:
  Fixed bug #12392.
  Missing handling of rows containing NULL components
  when evaluating IN predicates caused a crash.
2005-08-08 16:51:12 -07:00
monty@mysql.com
99cb083549 Review of new pushed code
- Fixed some error condtion when handling dates with 'T'
- Added extra test for bug #11867 (Wrong result with "... WHERE ROW( a, b ) IN ( SELECT DISTINCT a, b WHERE ...)" to show it's not yet fixed
- Safety fixes and cleanups
2005-08-09 00:13:49 +03:00
igor@rurik.mysql.com
c6d1a05aa0 Manual merge 2005-08-07 15:10:06 -07:00
igor@rurik.mysql.com
b2a189ab07 subselect.result:
Added test case for bug #11867.
  Fixed results for two existing test cases.
subselect.test:
  Added test case for bug #11867.
item_subselect.cc:
  Fixed bug #11867.
  Added missing code in Item_in_subselect::row_value_transformer
  that caused problems for queries with
  ROW(elems) IN (SELECT DISTINCT cols FROM ...).
2005-08-07 14:03:46 -07:00
monty@mysql.com
15d48525af Merge mysql.com:/home/my/mysql-4.1
into  mysql.com:/home/my/mysql-5.0
2005-07-28 17:09:54 +03:00
monty@mysql.com
3c12d0ae54 Added end marker for tests to make future merges easier 2005-07-28 03:22:47 +03:00
sergefp@mysql.com
32a4e52d97 Fix for BUG#11821 manually merged 2005-07-12 17:11:24 +00:00
sergefp@mysql.com
55e70fd1f6 Fix for BUG#11821: Make Item_type_holder be able to work with MIN(field),
MAX(field).
2005-07-12 16:30:45 +00:00
igor@rurik.mysql.com
893c6c9b46 opt_range.cc:
Fixed buf #11487.
  Added a call of  QUICK_RANGE_SELECT::init to the
  QUICK_RANGE_SELECT::reset method. Without it the second
  evaluation of a subquery employing the range access failed.
subselect.result, subselect.test:
  Added a test case for bug #11487.
2005-06-23 02:08:30 -07:00
monty@mysql.com
2229d9a964 Add missing test result 2005-05-20 16:31:46 +03:00
bell@sanja.is.com.ua
77735f2f35 do not try to use equal field from outer query as field of local join (BUG#6384) 2005-05-20 16:01:41 +03:00
jimw@mysql.com
3f6aad900c Resolve merge from 4.1 2005-05-18 11:06:34 -07:00
bell@book.sanja.is.com.ua
1ff9f55920 relaxed DBUG_ASSERT in Item_int_with_ref::new_item() to "any constant" (BUG#10020) 2005-05-16 12:19:10 +03:00
igor@rurik.mysql.com
d92d4007f2 subselect.result, subselect.test:
Added a test case for bug #9516.
item_subselect.h:
  Fixed bug #9516.
  The bug was due to that fact that the class Item_subselect
  inherited the generic implementation of the function
  not_null_tables that was not valid for the objects
  of this class. As a result evaluation of the
  not_null_tables attribute was not correct for subqueries.
  This caused invalid transformations of outer joins into
  inner joins.
2005-04-15 22:08:34 -07:00
igor@rurik.mysql.com
0f043429e4 subselect.result, subselect.test:
Added a test case for bug #9338.
sql_select.cc:
  Fixed bug #9338.
  When an occurence of a field reference has to be replaced
  by another field reference the whole Item_field must be
  replaced.
item.cc:
  Fixed bug #9338.
  The method Item_field::replace_equal_field_processor was
  replaced by Item_field::replace_equal_field. The new method
  is used to replace the occurences of Item_field objects.
item.h:
  Fixed bug #9338.
  The virtual function replace_equal_field_processor was replaced
  by replace_equal_field. The latter is supposed to be used as a
  callback function in calls of the method transform.
2005-04-15 20:43:45 -07:00
monty@mysql.com
9616c9a80d Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0
2005-04-01 15:06:35 +03:00
monty@mysql.com
201ee3eb78 Invalid DEFAULT values for CREATE TABLE now generates errors. (Bug #5902)
CAST() now produces warnings when casting a wrong INTEGER or CHAR values. This also applies to implicite string to number casts. (Bug #5912)
ALTER TABLE now fails in STRICT mode if it generates warnings.
Inserting a zero date in a DATE, DATETIME or TIMESTAMP column during TRADITIONAL mode now produces an error. (Bug #5933)
2005-04-01 15:04:50 +03:00
bell@sanja.is.com.ua
1029e533df postmerge 4.1->5.0 fixes 2005-04-01 02:14:30 +03:00
bell@sanja.is.com.ua
05d4ed14e4 merge 4.1->5.0 2005-03-31 10:39:48 +03:00
bell@sanja.is.com.ua
4fdb0f48e7 postreview changes
fixed bug in IN/ALL/ANY subqeries with HAVING clause (BUG#9350)
2005-03-30 10:07:08 +03:00
bell@sanja.is.com.ua
056d5a3934 fixed left expression of IN/ALL/ANY subquery transformation support (BUG#8888) 2005-03-10 14:01:22 +02:00
hf@deer.(none)
803ed1a116 Tests modified to coved decimal-related code 2005-02-21 19:20:05 +04:00
sergefp@mysql.com
c30f7feba1 Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/psergey/mysql-4.1-bug8218
2005-02-14 23:49:01 +03:00
sergefp@mysql.com
919f2f2364 Merge mysql.com:/home/psergey/mysql-4.1-bug8218
into mysql.com:/home/psergey/mysql-5.0-bug8218
2005-02-14 23:47:31 +03:00
sergefp@mysql.com
021f9849ef Remove redundant DROP TABLE from test case 2005-02-14 23:45:48 +03:00
sergefp@mysql.com
c0c50efdef Fix for BUG#8218:
Remove TMP_TABLE_PARAM::copy_funcs_it. TMP_TABLE_PARAM is a member of JOIN which is 
copied via memcpy, and List_iterator_fast TMP_TABLE_PARAM::copy_funcs_it ends up 
pointing to the wrong List.
2005-02-12 22:58:54 +03:00
monty@mysql.com
a1a39fab84 Merge with 4.1 2005-02-10 02:27:37 +02:00
bell@sanja.is.com.ua
90c0024217 reverted patch for BUG#7351 (because of performance ussie) 2005-02-09 21:08:08 +02:00
bell@sanja.is.com.ua
0a8595df42 Merge sanja.is.com.ua:/home/bell/mysql/bk/work-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-5.0
2005-02-06 13:17:12 +02:00
bell@sanja.is.com.ua
1853c2fe89 fixed test 'subselect' in case when innodb is not compiled in (thanks HF who niticed it) 2005-02-06 13:06:12 +02:00
monty@mysql.com
422c2eb868 4.1 -> 5.0 merge 2005-02-03 13:18:30 +02:00
bell@sanja.is.com.ua
0bf6e3aefc fixed cleanup of result object of subqueries. (BUG#8125) 2005-01-26 15:27:45 +02:00