Commit graph

167 commits

Author SHA1 Message Date
unknown
28028b5f07 Fix bug #12291 Table wasn't reinited for index scan after sequential scan
Optimizer did choose "Range checked for each record" for one of the tables.
For first few loops over that table it choose sequential access, on later
stage it choose to use index. Because table was previously initialized for 
sequential access, it skips intitialization for index access, and when
server tries to retrieve data error occurs.

QUICK_RANGE_SELECT::init() changes so if file already initialized for
sequential access, it calls ha_rnd_end() and initializes file for index
access.


sql/opt_range.cc:
  Fix bug #12291 Table wasn't reinited for index scan after sequential scan
mysql-test/t/select.test:
  Test case for bug #12291 Table wasn't reinited for index scan after sequential scan
mysql-test/r/select.result:
  Test case for bug #12291 Table wasn't reinited for index scan after sequential scan
2005-09-16 01:19:43 +04:00
unknown
3462573fa8 BUG#12943 - post-merge fix
mysql-test/r/select.result:
  post-merge fix
mysql-test/t/select.test:
  post-merge fix
2005-09-12 19:18:17 +03:00
unknown
e08e620c3e Merge mysql.com:/home/timka/mysql/src/5.0-virgin
into  mysql.com:/home/timka/mysql/src/5.0-bug-12943


sql/sql_parse.cc:
  Auto merged
mysql-test/r/select.result:
  merge BUG#12943
mysql-test/t/select.test:
  merge BUG#12943
2005-09-12 19:05:55 +03:00
unknown
25fb012dcf Fix for BUG#13067 "JOIN ... USING is case sensitive".
mysql-test/r/select.result:
  Test for BUG#13067
mysql-test/t/select.test:
  Test for BUG#13067
sql/sql_base.cc:
  Correctly compare field names with respect to case sensitivity.
2005-09-12 08:28:53 +03:00
unknown
0dec682f39 Fix for BUG#12943.
The problem was that in the first production in rule 'join_table', that
processes simple cross joins, the parser was processing the second join operand
before the first one due to unspecified priorities of JOINs. As a result in the
case of cross joins the parser constructed a tree with incorrect nesting:
the expression "t1 join t2 join t3 on some_cond" was interpreted as
"t1 join (t2 join t3 on some_cond)" instead of
"(t1 join t2) join t3 on some_cond".
Because of this incorrect nesting the method make_join_on_context picked an
incorrect table as the first table of the name resolution context.

The solution assignes correct priorities to the related production.


mysql-test/r/select.result:
  Added test for BUG#12943.
mysql-test/t/select.test:
  Added test for BUG#12943.
sql/sql_parse.cc:
  Fixed typo.
sql/sql_yacc.yy:
  Provide explicit priorities of the JOIN operator and the 'table_ref' rule,
  to enforce left-associativity of [INNER | CROSS] JOIN.
2005-09-10 15:01:54 +03:00
unknown
9adffe2926 Fix for BUG#12977.
mysql-test/r/select.result:
  Test for BUG#12977.
mysql-test/t/select.test:
  Test for BUG#12977.
sql/sql_base.cc:
  - Compare table qualifier of qualified fields only with tables that
    are not natural joins or their operands.
  - For qualified fields perform recursive search in all operands of
    natural joins that are nested joins.
  - Symmetrically detect ambiguous columns for both operands of
    NATURAL/USING joins.
2005-09-08 11:29:52 +03:00
unknown
c38e297b64 fix for bug #12841
(Server crash on DO IFNULL(NULL,NULL)
(fixes also "SELECT CAST(IFNULL(NULL,NULL) as DECIMAL)" unreported
 crash)
(new revampled fix with suggestions from Igor)


mysql-test/r/select.result:
  result of test for bug 12841
mysql-test/t/select.test:
  test for bug #12841
  (Server crash on DO IFNULL(NULL,NULL)
sql/item_func.cc:
  don't use the return value of ::str_op() without checking it
  whether checking it for NULL. (fixes bug #12841 as well as
  another not reported bug, but existing one - test case added).
  All other places where ::str_op() is used are safe.
2005-08-29 15:45:03 +02:00
unknown
96f884c03a Test for BUG#6495.
The bug itself is fixed by WL#2486.


mysql-test/r/select.result:
  Test for BUG#6495.
mysql-test/t/select.test:
  Test for BUG#6495.
2005-08-23 22:29:05 +03:00
unknown
4bf5c7c55b Test for BUG#4889 - inconsistent resilts of more than 2-way natural join
due to incorrect transformation to JOIN ... ON.

The bug itself is fixed by WL#2486.


mysql-test/r/select.result:
  Test for BUG#4889.
mysql-test/t/select.test:
  Test for BUG#4889.
2005-08-23 20:24:29 +03:00
unknown
b4e830c3e3 Fix for BUG#6276.
mysql-test/r/select.result:
  Test for BUG#6276.
mysql-test/t/select.test:
  Test for BUG#6276.
sql/sql_base.cc:
  Add a true ON condition for outer joins without common columns.
2005-08-23 20:03:32 +03:00
unknown
142f65834b Test case for BUG#10972 - Natural join of view and underlying table gives wrong result.
The bug itself is fixed by WL#2486.


mysql-test/r/select.result:
  Test case for BUG#10972.
mysql-test/t/select.test:
  Test case for BUG#10972.
2005-08-23 19:00:28 +03:00
unknown
8dbe326628 Merge mysql.com:/home/timka/mysql/src/5.0-virgin
into  mysql.com:/home/timka/mysql/src/5.0-2486


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
2005-08-23 18:43:12 +03:00
unknown
2ef2e0630d Merge mysql.com:/home/timka/mysql/src/5.0-virgin
into  mysql.com:/home/timka/mysql/src/5.0-2486


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
2005-08-23 18:15:51 +03:00
unknown
fe24add743 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. 


mysql-test/include/ps_query.inc:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/bdb.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/innodb.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/join.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/join_nested.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/join_outer.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/null_key.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/order_by.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/ps_2myisam.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/ps_3innodb.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/ps_4heap.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/ps_5merge.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/ps_6bdb.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/ps_7ndb.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/select.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/subselect.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/type_ranges.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/bdb.test:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/innodb.test:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/join.test:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/join_nested.test:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/join_outer.test:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/null_key.test:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/order_by.test:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/select.test:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/subselect.test:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/type_ranges.test:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
sql/sql_base.cc:
  * Applied Monty's patch for backwards compatible name resolution
    of qualified columns. The idea is:
    - When a column is qualified, search for the column in all
      tables/views underlying each natural join. In this case
      natural joins are *not* considered leaves.
    - If a column is not qualified, then consider natural joins
      as leaves, thus directly search the result columns of
      natural joins.
  * Simplified 'find_field_in_tables()' - unified two similar
    loops into one.
sql/table.cc:
  - Removed method & members not needed after Monty's patch.
sql/table.h:
  - Removed method & members not needed after Monty's patch.
tests/mysql_client_test.c:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
2005-08-23 18:08:04 +03:00
unknown
9f70b1758e Test case for BUG#10646
The bug itself is fixed by WL #2486.


mysql-test/r/select.result:
  Test for BUG#10646
mysql-test/t/select.test:
  Test for BUG#10646
2005-08-22 17:34:08 +03:00
unknown
aebf2e49c8 Test case for BUG#6558 - Views: create fails with JOIN ... USING
The bug is non-view specific, and it resulted from incorrect
name resolution of natural join result columns. The bug is
fixed by WL#2486.


mysql-test/r/select.result:
  Added test case for BUG#6558
mysql-test/t/select.test:
  Added test case for BUG#6558
2005-08-22 17:04:55 +03:00
unknown
781540830b Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0
into moonbone.local:/work/11398-bug-5.0-mysql


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
2005-08-22 15:46:09 +04:00
unknown
6dfb784791 Revert patch for Bug #12595, it causes the sql_mode test to fail.
mysql-test/r/select.result:
  Update results
mysql-test/t/select.test:
  Remove regression test
sql/item_cmpfunc.cc:
  Revert patch for checking length of ESCAPE, it is not correct.
2005-08-17 19:56:14 -07:00
unknown
d33b968f03 WL#2486 - natural and using join according to SQL:2003
- fixed a problem with RIGHT JOIN ON and enabled corresponding tests in select.test
- fixed a memory leak


mysql-test/r/select.result:
  Fixed a problem with RIGHT JOIN ON queries, enabling the corresponding tests.
mysql-test/t/select.test:
  Fixed a problem with RIGHT JOIN ON queries, enabling the corresponding tests.
sql/sql_base.cc:
  Fixed a problem with RIGHT JOINs that have operand(s) which are NATURAL JOIN(s).
sql/table.h:
  Inherit from Sql_alloc for proper memory allocation.
  The change fixes a memory leak.
2005-08-17 17:19:31 +03:00
unknown
06ebdbb785 Fix bug #11398 Bug in field_conv() results in wrong result of join with index
When copying varchar fields with field_conv() it's not taken into account
that length_bytes of source and destination fields may be different.
This results in saving wrong data in field and making wrong key later.

Added check so if fields are varchar and have different length_bytes they
are not copied by memcpy().


sql/field_conv.cc:
  Fix bug #11398 Bug in field_conv() results in wrong result of join with index
mysql-test/t/select.test:
  Test case for bug #11398 Bug in field_conv() results in wrong result of join with index
mysql-test/r/select.result:
  Test case for bug #11398 Bug in field_conv() results in wrong result of join with index
2005-08-16 22:13:43 +04:00
unknown
8056a7df59 fix for bug #12595 (Escape character has to be exactly one)
mysql-test/r/select.result:
  results for test of bug 12595
mysql-test/t/select.test:
  test for bug #12595
sql/item_cmpfunc.cc:
  check whether the size of the escape string is exactly 1 (bug #12595)
2005-08-16 15:39:40 +02:00
unknown
7517d7e112 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


mysql-test/include/ps_query.inc:
  Adjusted according to standard NATURAL/USING join semantics.,
mysql-test/r/bdb.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/derived.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/errors.result:
  The column as a whole cannot be resolved, so different error message.
mysql-test/r/fulltext.result:
  Adjusted according to standard JOIN ... ON semantics =>
  the ON condition can refer only to the join operands.
mysql-test/r/fulltext_order_by.result:
  More detailed error message.
mysql-test/r/innodb.result:
  Adjusted according to standard NATURAL/USING join semantics.
  This test doesn't pass completetly yet!
mysql-test/r/insert_select.result:
  More detailed error message.
mysql-test/r/join.result:
  Adjusted according to standard NATURAL/USING join semantics.
  
  NOTICE: there is one test case that still fails, and it is
  commeted out and marked with WL#2486 in the test file.
mysql-test/r/join_crash.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/join_nested.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/join_outer.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/multi_update.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/null_key.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/order_by.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_2myisam.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_3innodb.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_4heap.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_5merge.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_6bdb.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_7ndb.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/select.result:
  Adjusted according to standard NATURAL/USING join semantics.
  
  NOTICE: there is one failing test case which is commented with
  WL#2486 in the test file.
mysql-test/r/subselect.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/type_ranges.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/union.result:
  More detailed error message.
mysql-test/t/bdb.test:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/errors.test:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/fulltext.test:
  Adjusted according to standard JOIN ... ON semantics =>
  the ON condition can refer only to the join operands.
mysql-test/t/fulltext_order_by.test:
  More detailed error message.
mysql-test/t/innodb.test:
  Adjusted according to standard NATURAL/USING join semantics.
  This test doesn't pass completetly yet!
mysql-test/t/insert_select.test:
  More detailed error message.
mysql-test/t/join.test:
  Adjusted according to standard NATURAL/USING join semantics.
  
  NOTICE: there is one test case that still fails, and it is
  commeted out and marked with WL#2486 in the test file.
mysql-test/t/join_crash.test:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/join_nested.test:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/join_outer.test:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/null_key.test:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/order_by.test:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/select.test:
  Adjusted according to standard NATURAL/USING join semantics.
  
  NOTICE: there is one test case that still fails, and it is
  commeted out and marked with WL#2486 in the test file.
mysql-test/t/subselect.test:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/type_ranges.test:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/union.test:
  More detailed error message.
sql/item.cc:
  - extra parameter to find_field_in_tables
  - find_field_in_real_table renamed to find_field_in_table
  - fixed comments/typos
sql/item.h:
  - added [first | last]_name_resolution_table to class
    Name_resolution_context
  - commented old code
  - standardized formatting
sql/mysql_priv.h:
  - refactored the find_field_in_XXX procedures,
  - added a new procedure for natural join table references,
  - renamed the find_field_in_XXX procedures to clearer names
sql/sp.cc:
  - pass the top-most list of the FROM clause to setup_tables
  - extra parameter to find_field_in_tables
sql/sql_acl.cc:
  - renamed find_field_in_table => find_field_in_table_ref
  - extra parameter to find_field_in_table_ref
  - commented old code
sql/sql_base.cc:
  This file contains the core of the implementation of the processing
  of NATURAL/USING joins (WL#2486).
  - added many comments to old code
  - refactored the group of find_field_in_XXX procedures, and added a
    new procedure for natural joins. There is one find_field_in_XXX procedure
    per each type of table reference (stored table, merge view, or natural
    join); one meta-procedure that selects the correct one depeneding on the
    table reference; and one procedure that goes over a list of table
    referenes.
  - NATURAL/USING joins are processed through the procedures:
      mark_common_columns, store_natural_using_join_columns,
      store_top_level_join_columns, setup_natural_join_row_types.
    The entry point to processing NATURAL/USING joins is the
    procedure 'setup_natural_join_row_types'.
  - Replaced the specialized Field_iterator_XXX iterators with one
    generic iterator over the fields of a table reference.
  - Simplified 'insert_fields' and 'setup_conds' due to encapsulation of
    the processing of natural joins in a separate set of procedures.
sql/sql_class.h:
  - Commented old code.
sql/sql_delete.cc:
  - Pass the FROM clause to setup_tables.
sql/sql_help.cc:
  - pass the end name resolution table to find_field_in_tables
  - adjust the list of tables for name resolution
sql/sql_insert.cc:
  - Changed the code that saves and restores the current context to
    support the list of tables for name resolution -
    context->first_name_resolution_table, and
    table_list->next_name_resolution_table.
    Needed to support an ugly trick to resolve inserted columns only in
    the first table.
  - Added Name_resolution_context::[first | last]_name_resolution_table.
  - Commented old code
sql/sql_lex.cc:
  - set select_lex.parent_lex correctly
  - set correct state of the current name resolution context
sql/sql_lex.h:
  - Added a stack of name resolution contexts to support local
    contexts for JOIN ... ON conditions.
  - Commented old code.
sql/sql_load.cc:
  - Pass the FROM clause to setup_tables.
sql/sql_olap.cc:
  - Pass the FROM clause to setup_tables.
sql/sql_parse.cc:
  - correctly set SELECT_LEX::parent_lex
  - set the first table of the current name resoltion context
  - added support for NATURAL/USING joins
  - commented old code
sql/sql_select.cc:
  - Pass the FROM clause to setup_tables.
  - Pass the end table to find_field_in_tables
  - Improved comments
sql/sql_show.cc:
  - Set SELECT_LEX::parent_lex.
sql/sql_update.cc:
  - Pass the FROM clause to setup_tables.
sql/sql_yacc.yy:
  - Added support for a stack of name resolution contexts needed to
    implement name resolution for JOIN ... ON. A context is pushed
    for each new JOIN ... ON, and popped afterwards.
  - Added support for NATURAL/USING joins.
sql/table.cc:
  - Added new class Natural_join_column to hide the heterogeneous
    representation of column references for stored tables and for
    views.
  - Added a new list TABLE_LIST::next_name_resolution_table to
    support name resolution with NATURAL/USING joins. Also added
    other members to TABLE_LIST to support NATURAL/USING joins.
  - Added a generic iterator over the fields of table references
    of various types - class Field_iterator_table_ref
sql/table.h:
  - Added new class Natural_join_column to hide the heterogeneous
    representation of column references for stored tables and for
    views.
  - Added a new list TABLE_LIST::next_name_resolution_table to
    support name resolution with NATURAL/USING joins. Also added
    other members to TABLE_LIST to support NATURAL/USING joins.
  - Added a generic iterator over the fields of table references
    of various types - class Field_iterator_table_ref
tests/mysql_client_test.c:
  Adjusted according to standard NATURAL JOIN syntax.
2005-08-12 17:57:19 +03:00
unknown
79f75d8fad Cleanups during review of new code
Ensure mysql_close() is called if mysql_set_character_set() fails


libmysql/libmysql.c:
  Indentation cleanup
mysql-test/r/select.result:
  Fix bad merge & align code with 4.1
mysql-test/r/type_newdecimal.result:
  Added test of extreme case
mysql-test/t/select.test:
  Fix bad merge & align code with 4.1
mysql-test/t/type_newdecimal.test:
  Added test of extreme case
mysys/charset.c:
  Removed not used variable
mysys/default.c:
  Simplify code
sql-common/client.c:
  Ensure mysql_close() is called if mysql_set_character_set() fails
sql/log.cc:
  strmov(strmov())  -> strxmov()
sql/sp.cc:
  Indentation fixes
sql/sql_acl.cc:
  Indentation fixes
sql/sql_base.cc:
  Added commments
  Moved variable to inner block
sql/sql_show.cc:
  Simple optimization (removed loop variable)
sql/sql_trigger.cc:
  strmov(strmov())  -> strxmov()
strings/decimal.c:
  Indentation fixes
2005-07-28 16:10:14 +03:00
unknown
ccc3052d17 Cleanups after merge from 4.1.
mysql-test/r/ps_1general.result:
  Update results
mysql-test/r/ps_2myisam.result:
  Update results
mysql-test/r/ps_3innodb.result:
  Update results
mysql-test/r/ps_4heap.result:
  Update results
mysql-test/r/ps_5merge.result:
  Update results
mysql-test/r/ps_6bdb.result:
  Update results
mysql-test/r/ps_7ndb.result:
  Update results
mysql-test/r/select.result:
  Update results
mysql-test/t/disabled.def:
  Disable ndb_condition_pushdown test
mysql-test/t/select.test:
  Fix bad merge
sql/field_conv.cc:
  Update name of warning message
sql/mysqld.cc:
  Set proper thd->killed
tests/mysql_client_test.c:
  Update test cases, change verify_prepared_field() help function
  so it is passed the filename and line from where it is called
  and includes that in the error message.
2005-07-19 16:32:38 -07:00
unknown
e9c64ae296 Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into  mysql.com:/home/jimw/my/mysql-5.0-clean


extra/perror.c:
  Auto merged
include/my_global.h:
  Auto merged
mysql-test/r/ps_1general.result:
  Auto merged
mysql-test/r/ps_2myisam.result:
  Auto merged
mysql-test/r/ps_3innodb.result:
  Auto merged
mysql-test/r/ps_4heap.result:
  Auto merged
mysql-test/r/ps_5merge.result:
  Auto merged
mysql-test/r/ps_6bdb.result:
  Auto merged
mysql-test/r/ps_7ndb.result:
  Auto merged
mysql-test/r/select.result:
  Auto merged
ndb/src/mgmsrv/ConfigInfo.cpp:
  Auto merged
ndb/src/mgmsrv/main.cpp:
  Auto merged
sql/des_key_file.cc:
  Auto merged
sql/field_conv.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
mysql-test/t/select.test:
  Resolve conflicts
scripts/mysqld_safe.sh:
  Resolve conflict
sql/item.cc:
  Resolve conflict, don't return FIELD_TYPE_BLOB since VARCHAR
  can be longer in 5.0 than 4.1.
sql/log_event.cc:
  Resolve conflict
sql/mysql_priv.h:
  Resolve conflict
sql/mysqld.cc:
  Remove incorrect fix (merge from 4.1)
sql/sql_show.cc:
  Resolve conflict
2005-07-19 11:05:49 -07:00
unknown
3a31f7b91f Simple fixes during review of new code
include/my_global.h:
  Added floatget() to read unaligned flaot
mysql-test/r/select.result:
  Added test for found_rows()
mysql-test/t/select.test:
  Added test for found_rows()
sql/des_key_file.cc:
  Moved initalization of LOCK_des_key_file to mysqld to make simpler code and avoid theoretical race condition
sql/field_conv.cc:
  Added optimizzed varsion of do_cut_string (for simple character sets)
sql/item_func.cc:
  Simplify code (and ensure DBUG_ENTER is excuted before main code)
sql/item_strfunc.cc:
  Safe calculation of max_length
  This was needed as max_length can now be 1<<32-1 (after konstantins recent patch to fix BLOB_LENGTH)
  Remove init_des_key_file() as this is not initialized in mysqld.cc
sql/item_timefunc.cc:
  Safe calculation of max_length
  This was needed as max_length can now be 1<<32-1 (after konstantins recent patch to fix BLOB_LENGTH)
sql/log_event.cc:
  Simplify code
sql/mysql_priv.h:
  Moved initalization of LOCK_des_key_file to mysqld to make simpler code and avoid theoretical race condition
sql/mysqld.cc:
  Moved initalization of LOCK_des_key_file to mysqld to make simpler code and avoid theoretical race condition
  Revert wrong patch of calling close_connection() in first close_connections() loop. (Bug #7403)
  Instead we now print a warning for closed connections only if mysqld is sarted with --warnings
  Added comments to make the close_connections() logic clearer
sql/sql_prepare.cc:
  Use floatget() and doubleget() to protect against unaligned data
sql/sql_select.cc:
  Fixed some cases unlikely cases where found_rows() would return wrong for queries that would return 0 or 1 rows
2005-07-19 19:25:05 +03:00
unknown
7f6f31ae73 Merge mysql.com:/home/kostja/mysql/mysql-4.1-root
into  mysql.com:/home/kostja/mysql/mysql-5.0-merge


client/mysqltest.c:
  Auto merged
mysql-test/r/rpl_log.result:
  Auto merged
mysql-test/r/rpl_rotate_logs.result:
  Auto merged
mysql-test/r/select.result:
  Auto merged
mysql-test/r/timezone_grant.result:
  Auto merged
mysql-test/t/ctype_utf8.test:
  Auto merged
mysql-test/t/timezone_grant.test:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_repl.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
configure.in:
  Manual merge
mysql-test/r/olap.result:
  Manual merge
mysql-test/t/olap.test:
  Manual merge
mysql-test/t/select.test:
  Manual merge
sql/mysqld.cc:
  Manual merge
sql/sql_parse.cc:
  Manual merge
2005-07-19 00:55:37 +04:00
unknown
6a88fa48ae select.result, select.test:
Added a test case for bug #11745.
sql_select.cc:
  Fixed bug # 11745.
  Added support of where clause for queries with FROM DUAL.
sql_yacc.yy:
  Fixed bug # 11745.
  Added optional where clause for queries with FROM DUAL.


sql/sql_yacc.yy:
  Fixed bug # 11745.
  Added optional where clause for queries with FROM DUAL.
sql/sql_select.cc:
  Fixed bug # 11745.
  Added support of where clause for queries with FROM DUAL.
mysql-test/t/select.test:
  Added a test case for bug #11745.
mysql-test/r/select.result:
  Added a test case for bug #11745.
2005-07-17 09:46:14 -07:00
unknown
40efb3622d Merge mysql.com:/opt/local/work/mysql-4.1-root
into  mysql.com:/media/sda1/mysql/mysql-5.0-merge


mysql-test/r/select.result:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
mysql-test/r/ps.result:
  Manual merge (again).
mysql-test/t/ps.test:
  Manual merge (again).
mysql-test/t/select.test:
  Manual merge (again).
sql/item_func.cc:
  Manual merge (again).
sql/item_func.h:
  Manual merge (again).
sql/set_var.h:
  Manual merge (again).
2005-07-16 13:45:32 +04:00
unknown
7adfe96d9e Added test for Bug #11521
"Negative integer keys incorrectly substituted for 0 during range analysis."

The problem is that the range optimizer incorrectly replaces any negative
constant with '0' for all types except BIGINT because the method save_in_field()
casts negative integers to non-negative. This causes incorrect query
results where (0 = any_negative_number).

The problem caused by this bug is fixed by the patch for BUG#11185.
That patch constitutes an optimization due to which the problem code is
never called with negative constants. This patch adds a test so we are sure
that the problem does not reappear.


mysql-test/r/select.result:
  Test for BUG#11521.
mysql-test/t/select.test:
  Test for BUG#11521.
2005-07-16 10:30:25 +03:00
unknown
0f41fb4234 Fix bug#11482 4.1.12 produces different resultset for a complex query
than in previous 4.1.x

Wrongly applied optimization were adding NOT NULL constraint which results in
rejecting valid rows and reduced result set.

The problem was that add_notnull_conds() while checking subquery were adding
NOT NULL constraint to left joined table, to which, normally, optimization 
don't have to be applied.


sql/sql_select.cc:
  Fix bug #11482 Wrongly applied optimization was erroneously rejecting valid rows
  Constraint were added to optimization appliance test.
mysql-test/t/select.test:
  Test case for bug #11482  Wrongly applied optimization was erroneously rejecting valid rows
mysql-test/r/select.result:
  Test case for bug #11482  Wrongly applied optimization was erroneously rejecting valid rows
2005-07-16 03:29:12 +04:00
unknown
5858a8cd42 Merge mysql.com:/opt/local/work/mysql-4.1-root
into  mysql.com:/opt/local/work/mysql-5.0-root


mysql-test/r/ps_2myisam.result:
  Auto merged
mysql-test/r/ps_3innodb.result:
  Auto merged
mysql-test/r/ps_4heap.result:
  Auto merged
mysql-test/r/ps_5merge.result:
  Auto merged
mysql-test/r/ps_6bdb.result:
  Auto merged
mysql-test/r/ps_7ndb.result:
  Auto merged
sql/field.cc:
  manual merge
tests/mysql_client_test.c:
  manual merge
mysql-test/r/select.result:
  manual merge
mysql-test/t/select.test:
  manual merge
sql/sql_select.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
2005-07-14 20:02:32 +04:00
unknown
d91c901f61 Fix for BUG#11700: in add_not_null_conds(), call full fix_fields() for the created NOT NULL.
This is needed because in some cases range optimization is performed twice and added 
  NOT NULL item must have correct const_table_map() value. 


mysql-test/r/select.result:
  Testcase for BUG#11700
mysql-test/t/select.test:
  Testcase for BUG#11700
2005-07-14 15:13:36 +00:00
unknown
428830c500 After merge fixes
Better fix for ON DUPLICATE KEY UPDATE


mysql-test/r/group_by.result:
  After merge fixes
mysql-test/r/select.result:
  Reorder test to match 4.1 tests (will make future merges easier)
mysql-test/t/group_by.test:
  Added --disable_ps_protocol to avoid extra warning
mysql-test/t/select.test:
  Reorder test to match 4.1 tests (will make future merges easier)
sql/mysql_priv.h:
  Better fix for ON DUPLICATE KEY UPDATE
sql/sql_base.cc:
  After merge fixes
sql/sql_insert.cc:
  Better fix for ON DUPLICATE KEY UPDATE
  (old solution gave problem with item->cached_table)
sql/sql_prepare.cc:
  Better fix for ON DUPLICATE KEY UPDATE
2005-07-04 03:24:25 +03:00
unknown
eeee5fb10b Merge with 4.1
Makefile.am:
  Auto merged
myisam/mi_create.c:
  Auto merged
myisam/mi_open.c:
  Auto merged
mysql-test/r/ctype_utf8.result:
  Auto merged
mysys/thr_alarm.c:
  Auto merged
VC++Files/sql/mysqld.dsp:
  Keep old
client/mysqldump.c:
  Manual merge
client/mysqltest.c:
  Automatic merge
configure.in:
  Manual merge
mysql-test/r/ctype_ucs.result:
  Auto merge
mysql-test/r/func_str.result:
  Auto merge
mysql-test/r/group_by.result:
  Auto merge
mysql-test/r/insert_select.result:
  Auto merge
mysql-test/r/insert_update.result:
  Auto merge
mysql-test/r/lowercase_table2.result:
  Auto merge
mysql-test/r/select.result:
  Manual merge
mysql-test/r/variables.result:
  Auto merge
mysql-test/t/ctype_ucs.test:
  Auto merge
mysql-test/t/func_str.test:
  Auto merge
mysql-test/t/group_by.test:
  Auto merge
mysql-test/t/insert_select.test:
  Auto merge
mysql-test/t/insert_update.test:
  Auto merge
mysql-test/t/ndb_alter_table.test:
  Auto merge
mysql-test/t/select.test:
  Auto merge
mysql-test/t/variables.test:
  Auto merge
mysys/my_access.c:
  Auto merge
scripts/make_win_src_distribution.sh:
  Auto merge
sql/field.cc:
  Manual merge
sql/ha_ndbcluster.cc:
  Auto merge
sql/handler.cc:
  Auto merge
sql/item.cc:
  Auto merge
sql/item.h:
  Manual merge
sql/item_cmpfunc.h:
  Auto merge
sql/item_strfunc.cc:
  Auto merge
sql/item_strfunc.h:
  Auto merge
sql/mysql_priv.h:
  manual merge
sql/mysqld.cc:
  manual merge
sql/opt_range.cc:
  manual merge
sql/set_var.cc:
  Auto merge
sql/sql_base.cc:
  manual merge
  Restore processing of ON DUPLICATE KEY UPDATE
sql/sql_insert.cc:
  manual merge
  Restore processing of ON DUPLICATE KEY UPDATE
  Simplify mysql_prepare_insert by using local variable for select_lex and save old values just before they are changed
sql/sql_parse.cc:
  Restore processing of ON DUPLICATE KEY UPDATE
sql/sql_prepare.cc:
  New ON DUPLICATE KEY UPDATE handling
sql/sql_select.cc:
  manual merge
sql/sql_table.cc:
  auto merge
sql/sql_yacc.yy:
  auto merge
strings/ctype-ucs2.c:
  auto merge
strings/ctype-utf8.c:
  auto merge
2005-07-03 14:17:52 +03:00
unknown
3aca0a0c62 fixed not_null_tables() for IN() (BUG#9393)
(IN() remove NULL rows only for tables from first argument (value which we looking for in IN() list) but not for tables from IN() list)
Also it will be better change Item::not_null_tables() to prohibit this optimisation by default for new created items in 5.0 or 5.1.


mysql-test/r/select.result:
  IN with outer join condition
mysql-test/t/select.test:
  IN with outer join condition
sql/item_cmpfunc.h:
  correct not_null_tables() for IN
2005-06-28 22:20:25 +03:00
unknown
71f7df2766 Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into neptunus.(none):/home/msvensson/mysql/bug10466


mysql-test/r/alias.result:
  Auto merged
mysql-test/r/func_str.result:
  Auto merged
mysql-test/r/func_time.result:
  Auto merged
mysql-test/r/group_by.result:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/ps.result:
  Auto merged
mysql-test/r/ps_2myisam.result:
  Auto merged
mysql-test/r/ps_3innodb.result:
  Auto merged
mysql-test/r/ps_4heap.result:
  Auto merged
mysql-test/r/ps_5merge.result:
  Auto merged
mysql-test/r/ps_6bdb.result:
  Auto merged
mysql-test/r/ps_7ndb.result:
  Auto merged
mysql-test/r/select.result:
  Auto merged
mysql-test/t/alias.test:
  Auto merged
mysql-test/t/func_str.test:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
mysql-test/t/group_by.test:
  Auto merged
mysql-test/t/innodb.test:
  Auto merged
mysql-test/t/ps.test:
  Auto merged
mysql-test/t/select.test:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
2005-06-27 13:12:10 +02:00
unknown
d2b52d1933 bug#10466: Datatype "timestamp" displays "YYYYMMDDHHMMSS" irrespective of display sizes.
- Print warning that says display width is not supported for datatype TIMESTAMP, if user tries to create a TIMESTAMP column with display width.
 - Use display width for TIMESTAMP only in type_timestamp test to make sure warning is displayed correctly.


mysql-test/include/ps_create.inc:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/alias.result:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/func_date_add.result:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/func_str.result:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/func_time.result:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/group_by.result:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/innodb.result:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/ps.result:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/ps_1general.result:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/ps_2myisam.result:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/ps_3innodb.result:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/ps_4heap.result:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/ps_5merge.result:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/ps_6bdb.result:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/ps_7ndb.result:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/select.result:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/r/type_timestamp.result:
  When display width is used for a TIMESTAMP column a warning is printed that the display width will be ignored.
mysql-test/r/update.result:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/t/alias.test:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/t/func_date_add.test:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/t/func_str.test:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/t/func_time.test:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/t/group_by.test:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/t/innodb.test:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/t/ps.test:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/t/ps_4heap.test:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/t/ps_5merge.test:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/t/select.test:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
mysql-test/t/update.test:
  Reove all uses of display width in for TIMESTAMP columns, except in the type_timestamp test.
sql/share/errmsg.txt:
  Correct swedish error message
sql/sql_parse.cc:
  Print warning if datatype is TIMESTAMP and display width is used.
2005-06-20 12:09:00 +02:00
unknown
20eaad0e6e a fix (bug #10650: Bit literal case sensitivity).
mysys/charset.c:
  a fix (bug #10650: Bit literal case sensitivity).
  typo fixed.
2005-06-16 12:17:15 +05:00
unknown
8ab8fca7d5 select.test, select.result:
Added a test case for bug #10084.
sql_yacc.yy:
  Fixed bug #10084: STRAIGHT_JOIN for expressions with ON was
  added.


sql/sql_yacc.yy:
  Fixed bug #10084: STRAIGHT_JOIN for expressions with ON was
  added.
mysql-test/r/select.result:
  Added a test case for bug #10084.
mysql-test/t/select.test:
  Added a test case for bug #10084.
2005-06-09 09:16:16 -07:00
unknown
df16d85926 Corrected merge error in 'mysql-test/r/select.result': two test blocks inserted in wrong order.
mysql-test/r/select.result:
  Corrected merge error (two test blocks inserted in wrong order).
2005-05-26 16:47:44 +02:00
unknown
96f629db87 Manual merge.
client/mysqldump.c:
  Auto merged
include/my_global.h:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/r/select.result:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
support-files/mysql.spec.sh:
  Auto merged
client/client_priv.h:
  Manual merge (still to be corrected!)
2005-05-26 12:51:44 +02:00
unknown
801c2c275a Added a test case for Bug#8009.
sql/item.cc:
  Fixed Bug#8009.
2005-05-24 17:50:17 +03:00
unknown
0100b28de8 after merge 2005-05-19 20:54:37 +02:00
unknown
185b5e4067 merged
sql/sql_udf.cc:
  Auto merged
sql/unireg.cc:
  Auto merged
2005-05-19 15:20:10 +02:00
unknown
275aa24740 after merge fix 2005-05-19 09:47:13 +02:00
unknown
7e507270b8 merged
sql/unireg.cc:
  Auto merged
2005-05-18 22:14:08 +02:00
unknown
06736ab48a Fix for BUG#10095: {wrong query results because of incorrect constant propagation}
The problem: base_list::remove didn't modify base_list::last when removing 
the last list element.
The fix: If we remove the last element, find the element before it (by walking
from the beginning of the list) and set base_list::last accordingly.

The list gets corrupted in both 4.0 and 4.1. There are no visible problems in 
current 4.1 because current 4.1 doesn't call where_cond->fix_fields() after 
constant propagation step.


mysql-test/r/select.result:
  Testcase for BUG#10095
mysql-test/t/select.test:
  Testcase for BUG#10095
sql/sql_list.h:
  Fix for BUG#10095: {wrong query results because of incorrect constant propagation} 
  The problem: base_list::remove didn't modify base_list::last when removing 
  the last list element.
  The fix: If we remove the last element, find the element before it (by walking
  from the beginning of the list) and set base_list::last accordingly.
2005-05-15 22:56:45 +02:00
unknown
f8f714a2fb Merge with 4.1
BitKeeper/etc/logging_ok:
  auto-union
BitKeeper/deleted/.del-errmsg.txt~11edc4db89248c16:
  Auto merged
BitKeeper/deleted/.del-errmsg.txt~184eb1f09242dc72:
  Auto merged
BitKeeper/deleted/.del-errmsg.txt~2cdeb8d6f80eba72:
  Auto merged
BitKeeper/deleted/.del-errmsg.txt~4617575065d612b9:
  Auto merged
BitKeeper/deleted/.del-errmsg.txt~587903f9311db2d1:
  Auto merged
BitKeeper/deleted/.del-errmsg.txt~606dfaeb9e81aa4e:
  Auto merged
BitKeeper/deleted/.del-errmsg.txt~6bbd9eac7f0e6b89:
  Auto merged
BitKeeper/deleted/.del-errmsg.txt~7397c423c52c6d2c:
  Auto merged
BitKeeper/deleted/.del-errmsg.txt~898865062c970766:
  Auto merged
BitKeeper/deleted/.del-errmsg.txt~8ed1999cbd481dc4:
  Auto merged
BitKeeper/deleted/.del-errmsg.txt~94a93cc742fca24d:
  Auto merged
BitKeeper/deleted/.del-errmsg.txt~9dab24f7fb11b1e1:
  Auto merged
BitKeeper/deleted/.del-errmsg.txt~b44a85a177954da0:
  Auto merged
BitKeeper/deleted/.del-errmsg.txt~b6181e29d8282b06:
  Auto merged
BitKeeper/deleted/.del-errmsg.txt~ba132dc9bc936c8a:
  Auto merged
BitKeeper/deleted/.del-errmsg.txt~e2609fdf7870795:
  Auto merged
BitKeeper/deleted/.del-errmsg.txt~e3183b99fbba0a9c:
  Auto merged
BitKeeper/deleted/.del-errmsg.txt~eeb2c47537ed9c23:
  Auto merged
BitKeeper/deleted/.del-errmsg.txt~ef28b592c7591b7:
  Auto merged
BitKeeper/deleted/.del-errmsg.txt~ef53c33ac0ff8a84:
  Auto merged
BitKeeper/deleted/.del-errmsg.txt~f19bfd5d4c918964:
  Auto merged
BitKeeper/deleted/.del-errmsg.txt~f96b7055cac394e:
  Auto merged
libmysql/libmysql.c:
  Auto merged
myisam/mi_key.c:
  Auto merged
mysql-test/r/alter_table.result:
  Auto merged
mysql-test/r/auto_increment.result:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/select.result:
  Auto merged
mysql-test/t/alter_table.test:
  Auto merged
mysql-test/t/innodb.test:
  Auto merged
mysql-test/t/select.test:
  Auto merged
sql/handler.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/r/insert_update.result:
  Auto merged
strings/ctype-ucs2.c:
  Auto merged
sql/sql_table.cc:
  merge
sql/unireg.cc:
  merge
2005-05-14 18:31:22 +03:00
unknown
2a695127a6 Fixes during review
mysql-test/r/select.result:
  Better error message
mysql-test/t/select.test:
  Better error message
sql/hostname.cc:
  Join identical code
sql/sql_yacc.yy:
  Combine code (and get a better error message)
strings/ctype-ucs2.c:
  Cast pointer differencess
2005-05-13 14:04:32 +03:00