An error occurred fetching the project authors.
  1. 19 Dec, 2005 1 commit
    • unknown's avatar
      Fix for bug#14861 aliased column names are not preserved. · c7a440d1
      unknown authored
        Create tmp table filed using original item name when it's necessary
      
      
      mysql-test/r/view.result:
        Fix for bug#14861 aliased column names are not preserved.
          test case
      mysql-test/t/view.test:
        Fix for bug#14861 aliased column names are not preserved.
          test case
      c7a440d1
  2. 07 Dec, 2005 1 commit
    • unknown's avatar
      Patch for WL#2894: Make stored routine variables work · 6b2f1309
      unknown authored
      according to the standard.
      
      The idea is to use Field-classes to implement stored routines
      variables. Also, we should provide facade to Item-hierarchy
      by Item_field class (it is necessary, since SRVs take part
      in expressions).
      
      The patch fixes the following bugs:
        - BUG#8702: Stored Procedures: No Error/Warning shown for inappropriate data 
          type matching; 
       
        - BUG#8768: Functions: For any unsigned data type, -ve values can be passed 
          and returned; 
       
        - BUG#8769: Functions: For Int datatypes, out of range values can be passed 
          and returned; 
       
        - BUG#9078: STORED PROCDURE: Decimal digits are not displayed when we use 
          DECIMAL datatype; 
       
        - BUG#9572: Stored procedures: variable type declarations ignored; 
       
        - BUG#12903: upper function does not work inside a function; 
       
        - BUG#13705: parameters to stored procedures are not verified; 
       
        - BUG#13808: ENUM type stored procedure parameter accepts non-enumerated
          data; 
       
        - BUG#13909: Varchar Stored Procedure Parameter always BINARY string (ignores 
          CHARACTER SET); 
       
        - BUG#14161: Stored procedure cannot retrieve bigint unsigned;
      
        - BUG#14188: BINARY variables have no 0x00 padding;
      
        - BUG#15148: Stored procedure variables accept non-scalar values;
      
      
      mysql-test/r/ctype_ujis.result:
        Explicitly specify correct charset.
      mysql-test/r/schema.result:
        Drop our test database to not affect this test if some test
        left it cause of failure.
      mysql-test/r/show_check.result:
        Drop our test database to not affect this test if some test
        left it cause of failure.
      mysql-test/r/skip_name_resolve.result:
        Ignore columns with unpredictable values.
      mysql-test/r/sp-big.result:
        Add cleanup statement.
      mysql-test/r/sp-dynamic.result:
        Add cleanup statements.
      mysql-test/r/sp.result:
        Update result file.
      mysql-test/r/sum_distinct-big.result:
        Update result file.
      mysql-test/r/type_newdecimal-big.result:
        Update result file.
      mysql-test/t/ctype_ujis.test:
        Explicitly specify correct charset.
      mysql-test/t/schema.test:
        Drop our test database to not affect this test if some test
        left it cause of failure.
      mysql-test/t/show_check.test:
        Drop our test database to not affect this test if some test
        left it cause of failure.
      mysql-test/t/skip_name_resolve.test:
        Ignore columns with unpredictable values.
      mysql-test/t/sp-big.test:
        Add cleanup statement.
      mysql-test/t/sp-dynamic.test:
        Add cleanup statements.
      mysql-test/t/sp.test:
        Non-scalar values prohibited for assignment to SP-vars;
        polishing.
      mysql-test/t/type_newdecimal-big.test:
        Update type specification so that the variables
        can contain the large values used in the test.
      sql/field.cc:
        Extract create_field::init() to initialize an existing
        instance of create_field from new_create_field().
      sql/field.h:
        Extract create_field::init() to initialize an existing
        instance of create_field from new_create_field().
      sql/item.cc:
        - Introduce a new class: Item_sp_variable -- a base class
          of stored-routine-variables classes;
        - Introduce Item_case_expr -- an Item, which is used to access
          to the expression of CASE statement;
      sql/item.h:
        - Introduce a new class: Item_sp_variable -- a base class
          of stored-routine-variables classes;
        - Introduce Item_case_expr -- an Item, which is used to access
          to the expression of CASE statement;
      sql/item_func.cc:
        Pass the Field (instead of Item) for the return value of
        a function to the function execution routine.
      sql/item_func.h:
        Pass the Field (instead of Item) for the return value of
        a function to the function execution routine.
      sql/mysql_priv.h:
        Move create_virtual_tmp_table() out of sql_select.h.
      sql/sp.cc:
        Use create_result_field() instead of make_field().
      sql/sp_head.cc:
        - Add a function to map enum_field_types to Item::Type;
        - Add sp_instr_push_case_expr instruction -- an instruction
          to push CASE expression into the active running context;
        - Add sp_instr_pop_case_expr instruction -- an instruction
          to pop CASE expression from the active running context;
        - Adapt the SP-execution code to using Fields instead of Items
          for SP-vars;
        - Use create_field structure for field description instead of
          a set of members.
      sql/sp_head.h:
        - Add a function to map enum_field_types to Item::Type;
        - Add sp_instr_push_case_expr instruction -- an instruction
          to push CASE expression into the active running context;
        - Add sp_instr_pop_case_expr instruction -- an instruction
          to pop CASE expression from the active running context;
        - Adapt the SP-execution code to using Fields instead of Items
          for SP-vars;
        - Use create_field structure for field description instead of
          a set of members.
      sql/sp_pcontext.cc:
        - Change rules to assign an index of SP-variable: use
          transparent index;
        - Add an operation to retrieve a list of defined SP-vars
          from the processing context recursively.
      sql/sp_pcontext.h:
        - Change rules to assign an index of SP-variable: use
          transparent index;
        - Add an operation to retrieve a list of defined SP-vars
          from the processing context recursively.
      sql/sp_rcontext.cc:
        - Change rules to assign an index of SP-variable: use
          transparent index;
        - Use a tmp virtual table to store SP-vars instead of Items;
        - Provide operations to work with CASE expresion.
      sql/sp_rcontext.h:
        - Change rules to assign an index of SP-variable: use
          transparent index;
        - Use a tmp virtual table to store SP-vars instead of Items;
        - Provide operations to work with CASE expresion.
      sql/sql_class.cc:
        - Reflect Item_splocal ctor changes;
        - Item_splocal::get_offset() has been renamed to get_var_idx().
      sql/sql_class.h:
        Polishing.
      sql/sql_parse.cc:
        Extract create_field::init() to initialize an existing
        instance of create_field from new_create_field().
      sql/sql_select.cc:
        Take care of BLOB columns in create_virtual_tmp_table().
      sql/sql_select.h:
        Move create_virtual_tmp_table() out of sql_select.h.
      sql/sql_trigger.cc:
        Use boolean constants for boolean type instead of numerical ones.
      sql/sql_yacc.yy:
        Provide an instance of create_field for each SP-var.
      mysql-test/include/sp-vars.inc:
        The definitions of common-procedures, which are created
        under different circumstances.
      mysql-test/r/sp-vars.result:
        Result file for the SP-vars test.
      mysql-test/sp-vars.test:
        A new test for checking SP-vars functionality.
      6b2f1309
  3. 30 Nov, 2005 1 commit
    • unknown's avatar
      Fix for BUG#14920 Ordering aggregated result sets corrupts resultset. · e3f57552
      unknown authored
      The cause of the bug was the use of end_write_group instead of end_write
      in the case when ORDER BY required a temporary table, which didn't take
      into account the fact that loose index scan already computes the result
      of MIN/MAX aggregate functions (and performs grouping).
      
      The solution is to call end_write instead of end_write_group and to add
      the MIN/MAX functions to the list of regular functions so that their
      values are inserted into the temporary table.
      
      
      mysql-test/r/group_min_max.result:
        Test for BUG#14920
      mysql-test/t/group_min_max.test:
        Test for BUG#14920
      sql/sql_class.cc:
        Added new member to TMP_TABLE_PARAM.
      sql/sql_class.h:
        Added new member to TMP_TABLE_PARAM.
      sql/sql_select.cc:
        Enable result rows generated by loose index scan being written into
        a temporary table. The change is necessary because loose index
        scan already computes the result of GROUP BY and the MIN/MAX aggregate
        functions. This is realized by three changes:
        - create_tmp_table allocates space for aggregate functions in the
          list of regular functions,
        - use end_write instead of end_write group,
        - copy the pointers to the MIN/MAX aggregate functions to the list
          of regular functions TMP_TABLE_PARAM::items_to_copy.
      sql/sql_select.h:
        New parameter to create_tmp_table.
      e3f57552
  4. 20 Nov, 2005 1 commit
    • unknown's avatar
      Inefficient usage of String::append() fixed. · fe63e095
      unknown authored
      Bad examples of usage of a string with its length fixed.
      The incorrect length in the trigger file configuration descriptor
        fixed (BUG#14090).
      A hook for unknown keys added to the parser to support old .TRG files.
      
      
      sql/field.cc:
        Inefficient usage of String::append() fixed.
        Bad examples of usage of a string with its length fixed.
      sql/ha_berkeley.cc:
        A bad example of usage of a string with its length fixed.
      sql/ha_federated.cc:
        Inefficient usage of String::append() fixed.
      sql/ha_myisammrg.cc:
        Bad examples of usage of a string with its length fixed.
      sql/handler.cc:
        Inefficient usage of String::append() fixed.
      sql/item.cc:
        Bad examples of usage of a string with its length fixed.
      sql/item.h:
        A bad example of usage of a string with its length fixed.
      sql/item_cmpfunc.cc:
        Bad examples of usage of a string with its length fixed.
      sql/item_func.cc:
        Bad examples of usage of a string with its length fixed.
      sql/item_strfunc.cc:
        Bad examples of usage of a string with its length fixed.
      sql/item_subselect.cc:
        Bad examples of usage of a string with its length fixed.
      sql/item_sum.cc:
        Bad examples of usage of a string with its length fixed.
        Inefficient usage of String::append() fixed.
      sql/item_timefunc.cc:
        Inefficient using of String::append() fixed.
        Bad examples of usage of a string with its length fixed.
      sql/item_uniq.h:
        Bad examples of usage of a string with its length fixed.
      sql/key.cc:
        Bad examples of usage of a string with its length fixed.
      sql/log.cc:
        Bad examples of usage of a string with its length fixed.
      sql/log_event.cc:
        Bad examples of usage of a string with its length fixed.
      sql/mysqld.cc:
        The dummy parser hook allocated.
      sql/opt_range.cc:
        Inefficient usage of String::append() fixed.
      sql/parse_file.cc:
        Bad examples of usage of a string with its length fixed.
        A hook for unknown keys added to the parser.
      sql/parse_file.h:
        A hook for unknown keys added to the parser.
      sql/protocol.cc:
        A bad example of usage of a string with its length fixed.
      sql/repl_failsafe.cc:
        Bad examples of usage of a string with its length fixed.
      sql/share/errmsg.txt:
        A warning for old format config file.
      sql/slave.cc:
        Bad examples of usage of a string with its length fixed.
      sql/sp.cc:
        Bad examples of usage of a string with its length fixed.
      sql/sp_head.cc:
        Bad examples of usage of a string with its length fixed.
      sql/spatial.cc:
        A bad example of usage of a string with its length fixed.
      sql/sql_acl.cc:
        Bad examples of usage of a string with its length fixed.
      sql/sql_analyse.cc:
        Bad examples of usage of a string with its length fixed.
        Inefficient usage of String::append() fixed.
      sql/sql_lex.cc:
        Bad examples of usage of a string with its length fixed.
      sql/sql_load.cc:
        A bad example of usage of a string with its length fixed.
      sql/sql_parse.cc:
        Bad examples of usage of a string with its length fixed.
      sql/sql_prepare.cc:
        A bad example of usage of a string with its length fixed.
      sql/sql_select.cc:
        Bad examples of usage of a string with its length fixed.
      sql/sql_show.cc:
        Bad examples of usage of a string with its length fixed.
      sql/sql_string.cc:
        Bad examples of usage of a string with its length fixed.
      sql/sql_string.h:
        The macro definition moved to sql_string.h to
          be accessible in all parts of server.
      sql/sql_table.cc:
        Bad examples of usage of a string with its length fixed.
      sql/sql_trigger.cc:
        Bad examples of usage of a string with its length fixed.
        The incorrect length in the trigger file configuration descriptor
          fixed (BUG#14090).
        The hook for processing incorrect sql_mode record added.
      sql/sql_view.cc:
        A dummy  hook used for parsing views.
      sql/structs.h:
        The macro definition moved to sql_string.h to be
          accessible in all parts of server.
      sql/table.cc:
        A bad example of usage of a string with its length fixed.
      sql/tztime.cc:
        A bad example of usage of a string with its length fixed.
      fe63e095
  5. 16 Nov, 2005 1 commit
  6. 14 Nov, 2005 1 commit
    • unknown's avatar
      Fix bug #14816 test_if_order_by_key() expected only Item_fields. · 0a9badec
      unknown authored
      test_if_order_by_key() expected only Item_fields to be in order->item, thus
      failing to find available index on view's field, which results in reported
      error.
      
      Now test_if_order_by_key() calls order->item->real_item() to get field for
      choosing index.
      
      
      sql/sql_select.cc:
        Fix bug #14816 test_if_order_by_key() expected only Item_fields.
        Make test_if_order_by_key() use real_item() to get field.
      mysql-test/r/view.result:
        Test case for bug#14816 test_if_order_by_key() expected only Item_fields.
      mysql-test/t/view.test:
        Test case for bug#14816 test_if_order_by_key() expected only Item_fields.
      0a9badec
  7. 07 Nov, 2005 1 commit
    • unknown's avatar
      Bug#14616 - Freshly imported table returns error 124 when using LIMIT · 5412ee4f
      unknown authored
      Initialized usable_keys from table->keys_in_use instead of ~0
      in test_if_skip_sort_order(). It was possible that a disabled
      index was used for sorting.
      
      
      mysql-test/r/myisam.result:
        Bug#14616 - Freshly imported table returns error 124 when using LIMIT
        The test result.
      mysql-test/t/myisam.test:
        Bug#14616 - Freshly imported table returns error 124 when using LIMIT
        The test case.
      5412ee4f
  8. 03 Nov, 2005 1 commit
    • unknown's avatar
      A fix and a test case for Bug#14210 "Simple query with > operator on · 3fa0dd23
      unknown authored
      large table gives server crash": make sure that when a MyISAM temporary
      table is created for a cursor, it's created in its memory root,
      not the memory root of the current query.
      
      
      mysql-test/r/sp.result:
        Test results fixed: a test case for Bug#14210
      mysql-test/t/sp.test:
        A test case for Bug#14210 "Simple query with > operator on large table 
        gives server crash"
      sql/handler.cc:
        - rewrite get_new_handler to accept a memory root and use it for
      sql/handler.h:
        - get_new_handler declaration changed
      sql/opt_range.cc:
        - get_new_handler declaration changed
      sql/sql_base.cc:
        - get_new_handler declaration changed
      sql/sql_select.cc:
        - the actual fix for Bug#14210. In create_myisam_from_heap we should
        create the new table handler in TABLE::mem_root, not in THD::mem_root:
        the latter is freed shortly after cursor is open.
        - adjust create_tmp_table to explicitly supply &table->mem_root
        to get_new_handler when creating a handler for a new temporary table
      sql/sql_table.cc:
        - get_new_handler declaration changed
      sql/table.cc:
        - get_new_handler declaration changed
      sql/unireg.cc:
        - get_new_handler declaration changed
      tests/mysql_client_test.c:
        A test case for Bug#14210 "Simple query with > operator on large table
         gives server crash": a C API test case is worth adding because of different
        memory allocation/freeing patterns in handling of C API and SP cursors
      3fa0dd23
  9. 01 Nov, 2005 2 commits
    • unknown's avatar
      Reverting patch for BUG #14009 (use of abs() on null value causes problems with filesort · ee380a07
      unknown authored
      Fix for bug #14536: SELECT @A,@A:=... fails with prepared statements
      
      
      mysql-test/r/func_sapdb.result:
        Correct tests after reverting patch for BUG #14009 (use of abs() on null value causes problems with filesort)
      mysql-test/r/type_newdecimal.result:
        Correct tests after reverting patch for BUG #14009 (use of abs() on null value causes problems with filesort)
      mysql-test/r/user_var.result:
        More test with SELECT @A:=
      mysql-test/t/disabled.def:
        Enable user_var.test for
      mysql-test/t/user_var.test:
        More test with SELECT @A:=
      sql/item.cc:
        Simple optimization during review of new code
      sql/item_func.cc:
        Reverting patch for BUG #14009 (use of abs() on null value causes problems with filesort)
      sql/item_timefunc.h:
        timediff() can return NULL for not NULL arguments
      sql/sql_base.cc:
        Remove usage of current_thd() in mysql_make_view()
      sql/sql_lex.h:
        Remove usage of current_thd() in mysql_make_view()
      sql/sql_select.cc:
        Fix for bug #14536: SELECT @A,@A:=... fails with prepared statements
      sql/sql_view.cc:
        Remove usage of current_thd() in mysql_make_view()
        Simple optimization of new code
      sql/sql_view.h:
        Remove usage of current_thd() in mysql_make_view()
      sql/table.cc:
        Simple optimization of new code
      ee380a07
    • unknown's avatar
      BUG#13126: Post-review fixes: better comments, some function renaming. · abf4f669
      unknown authored
      sql/mysql_priv.h:
        BUG#13126: Post-review fixes: better comments
      abf4f669
  10. 28 Oct, 2005 3 commits
    • unknown's avatar
      sql_select.cc: · 57152ef9
      unknown authored
        After merge fix
      
      
      sql/sql_select.cc:
        After merge fix
      57152ef9
    • unknown's avatar
      Fix bug #14138 ROLLUP and PROCEDURE ANALYSE() hang server · a7ed6ce4
      unknown authored
      Procedure analyse() redefines select's fields_list. setup_copy_fields() assumes
      that fields_list is a part of all_fields_list. Because select have only 
      3 columns and analyse() redefines it to have 10 columns, int overrun in
      setup_copy_fields() occurs and server goes to almost infinite loop.
      
      Because fields_list used not only to send data ad fields types, it's wrong 
      to allow procedure redefine it. This patch separates select's fileds_list 
      and procedure's one. Now if procedure is present, copy of fields_list is 
      created in procedure_fields_list and it is used for sending data and fields.
      
      
      mysql-test/t/analyse.test:
        Test case for bug #14138  ROLLUP and PROCEDURE ANALYSE() hang server
      mysql-test/r/analyse.result:
        Test case for bug #14138  ROLLUP and PROCEDURE ANALYSE() hang server
      sql/sql_select.h:
        Fix bug #14138  ROLLUP and PROCEDURE ANALYSE() hang server
        To JOIN  Added separate fields_list for procedure.
      sql/sql_select.cc:
        Fix bug #14138  ROLLUP and PROCEDURE ANALYSE() hang server
        SELECT's fields_list and procedure's fields_list made split. If procedure is defined
        then procedure's fields_list is used to send fields and data.
      a7ed6ce4
    • unknown's avatar
      Fix for bug #9551 (Show commands fail) · d44316cd
      unknown authored
      sql/sql_select.cc:
        stop using temp_pool if we have TEST_KEEP_TMP_TABLES on
      d44316cd
  11. 27 Oct, 2005 1 commit
    • unknown's avatar
      Fix bug#14186 select datefield is null not updated · 6020281e
      unknown authored
      Date field was declared as not null, thus expression 'datefield is null'
      was always false. For SELECT special handling of such cases is used. 
      There 'datefield is null' converted to 'datefield eq "0000-00-00"'.
      
      In mysql_update() before creation of select added remove_eq_conds() call.
      It makes some optimization of conds and in particular performs conversion
      from 'is null' to 'eq'. 
      Also remove_eq_conds() makes some evaluation of conds and if it founds that
      conds is always false then update statement is not processed further.
      All this allows to perform some update statements process faster due to
      optimized conds, and not wasting resources if conds known to be false. 
      
      
      sql/sql_select.cc:
        Fix bug#14186  select datefield is null not updated
        Remove static from remove_eq_conds()
      sql/sql_select.h:
         Fix bug#14186  select datefield is null not updated
        Added remove_eq_conds() prototype.
      mysql-test/r/update.result:
        Test case for  bug#14186  select datefield is null not updated
      mysql-test/t/update.test:
        Test case for  bug#14186  select datefield is null not updated
      sql/sql_update.cc:
        Fix bug#14186  select datefield is null not updated
        To mysql_update() added call to remove_eq_conds() to optimize conds and convert 'datefield is null' to 'datefield eq 0000-00-00'
      6020281e
  12. 25 Oct, 2005 1 commit
    • unknown's avatar
      BUG#13126: When choosing join order for join with nested joins, don't produce join · 2b7f5a45
      unknown authored
      orders that cannot be handled by the executioner.
      
      
      mysql-test/r/bigint.result:
        Added mssing "drop table if exists"
      mysql-test/r/join_nested.result:
        Testcase for BUG#13126
      mysql-test/t/bigint.test:
        Added mssing "drop table if exists"
      mysql-test/t/join_nested.test:
        Testcase for BUG#13126
      sql/mysql_priv.h:
        BUG#13126: Added nested_join_map type.
      sql/sql_prepare.cc:
        BUG#13126: Don't set NESTED_JOIN::counter to 0 here as it is reset in other place now.
      sql/sql_select.cc:
        BUG#13126: When choosing join order for join with nested joins, don't produce join orders
        that the executioner cannot handle. The work is done by check_interleaving_with_nj() and 
        restore_prev_nj_state() functions that are used from the join optimizer to avoid building
        invalid join orders.
      sql/sql_select.h:
        BUG#13126: Added JOIN_TAB::embedding_map and JOIN::cur_embedding_map.
      sql/table.h:
        BUG#13126: In NESTED_JOIN: added nj_map, added comment about where counter is used.
      2b7f5a45
  13. 15 Oct, 2005 1 commit
    • unknown's avatar
      Fixed bug #12762: · 6a0695fe
      unknown authored
      allowed set functions aggregated in outer subqueries, allowed nested set functions.
      
      
      mysql-test/r/func_gconcat.result:
        Changed a query when fixing bug #12762.
      mysql-test/r/subselect.result:
        Added test cases for bug #12762.
        Allowed set functions aggregated in outer subqueries. Allowed nested set functions.
      mysql-test/t/func_gconcat.test:
        Changed a query when fixing bug #12762.
      mysql-test/t/subselect.test:
        Added test cases for bug #12762.
        Allowed set functions aggregated in outer subqueries. Allowed nested set functions.
      sql/item.cc:
        Fixed bug #12762:
        allowed set functions aggregated in outer subqueries, allowed nested set functions.
        Added a parameter to Item::split_sum_func2 aliowing to defer splitting for set functions
        aggregated in outer subquries.
        Changed Item_field::fix_fields to calculate attributes used when checking context conditions
        for set functions.
        Allowed alliases for set functions defined in outer subqueries.
      sql/item.h:
        Fixed bug #12762:
        allowed set functions aggregated in outer subqueries, allowed nested set functions.
        Added a parameter to Item::split_sum_func2 aliowing to defer splitting for set functions
        aggregated in outer subquries.
      sql/item_cmpfunc.cc:
        Fixed bug #12762:
        allowed set functions aggregated in outer subqueries, allowed nested set functions.
        Added a parameter to Item::split_sum_func2 aliowing to defer splitting for set functions
        aggregated in outer subquries.
      sql/item_func.cc:
        Fixed bug #12762:
        allowed set functions aggregated in outer subqueries, allowed nested set functions.
        Added a parameter to Item::split_sum_func2 aliowing to defer splitting for set functions
        aggregated in outer subquries.
      sql/item_row.cc:
        Fixed bug #12762:
        allowed set functions aggregated in outer subqueries, allowed nested set functions.
        Added a parameter to Item::split_sum_func2 aliowing to defer splitting for set functions
        aggregated in outer subquries.
      sql/item_strfunc.cc:
        Fixed bug #12762:
        allowed set functions aggregated in outer subqueries, allowed nested set functions.
        Added a parameter to Item::split_sum_func2 aliowing to defer splitting for set functions
        aggregated in outer subquries.
      sql/item_subselect.cc:
        Fixed bug #12762:
        allowed set functions aggregated in outer subqueries, allowed nested set functions.
        Introduced next levels for subqueries and a bitmap of nesting levels showing
        in what subqueries a set function can be aggregated.
      sql/item_sum.cc:
        Fixed bug #12762:
        allowed set functions aggregated in outer subqueries, allowed nested set functions.
        Added Item_sum methods to check context conditions imposed on set functions.
      sql/item_sum.h:
        Fixed bug #12762:
        allowed set functions aggregated in outer subqueries, allowed nested set functions.
        Added Item_sum methods to check context conditions imposed on set functions.
      sql/mysql_priv.h:
        Fixed bug #12762:
        allowed set functions aggregated in outer subqueries, allowed nested set functions.
        Introduced a type of bitmaps to be used for nesting constructs.
      sql/sql_base.cc:
        Fixed bug #12762:
        allowed set functions aggregated in outer subqueries, allowed nested set functions.
        Introduced next levels for subqueries and a bitmap of nesting levels showing
        in what subqueries a set function can be aggregated.
      sql/sql_class.cc:
        Fixed bug #12762:
        allowed set functions aggregated in outer subqueries, allowed nested set functions.
        Introduced a bitmap of nesting levels showing in what subqueries a set function can be aggregated.
      sql/sql_class.h:
        Fixed bug #12762:
        allowed set functions aggregated in outer subqueries, allowed nested set functions.
        Introduced a bitmap of nesting levels showing in what subqueries a set function can be aggregated.
      sql/sql_delete.cc:
        Fixed bug #12762:
        allowed set functions aggregated in outer subqueries, allowed nested set functions.
        Introduced a bitmap of nesting levels showing in what subqueries a set function can be aggregated.
      sql/sql_lex.cc:
        Fixed bug #12762:
        allowed set functions aggregated in outer subqueries, allowed nested set functions.
        Introduced next levels for subqueries and a bitmap of nesting levels showing
        in what subqueries a set function can be aggregated.
      sql/sql_lex.h:
        Fixed bug #12762:
        allowed set functions aggregated in outer subqueries, allowed nested set functions.
        Introduced next levels for subqueries and a bitmap of nesting levels showing
        in what subqueries a set function can be aggregated.
      sql/sql_parse.cc:
        Fixed bug #12762:
        allowed set functions aggregated in outer subqueries, allowed nested set functions.
        Introduced next levels for subqueries.
      sql/sql_prepare.cc:
        Fixed bug #12762:
        allowed set functions aggregated in outer subqueries, allowed nested set functions.
        Introduced a bitmap of nesting levels showingin what subqueries a set function can be aggregated.
      sql/sql_select.cc:
        Fixed bug #12762:
        allowed set functions aggregated in outer subqueries, allowed nested set functions.
        Introduced next levels for subqueries and a bitmap of nesting levels showing
        in what subqueries a set function can be aggregated.
      sql/sql_update.cc:
        Fixed bug #12762:
        allowed set functions aggregated in outer subqueries, allowed nested set functions.
        Introduced a bitmap of nesting levels showing in what subqueries a set function can be aggregated.
      sql/sql_yacc.yy:
        Fixed bug #12762:
        allowed set functions aggregated in outer subqueries, allowed nested set functions.
        Introduced next levels for subqueries.
      6a0695fe
  14. 13 Oct, 2005 5 commits
    • unknown's avatar
      Fix bug #13855 select distinct with group by caused server crash · 0390de86
      unknown authored
      DISTINCT wasn't optimized away and caused creation of tmp table in wrong
      case. This result in integer overrun and running out of memory.
      
      Fix backported from 4.1. Now if optimizer founds that in result be only 1
      row it removes distinct.
      
      
      sql/sql_select.cc:
        Fix bug #13855 select distinct with group by caused server crash
      mysql-test/r/select.result:
        Test case for bug#13855 select distinct with group by caused server crash
      mysql-test/t/select.test:
         Test case for bug#13855 select distinct with group by caused server crash
      0390de86
    • unknown's avatar
      Move handling of suffix_length from strnxfrm_bin() to filesort to ensure... · b896d334
      unknown authored
      Move handling of suffix_length from strnxfrm_bin() to filesort to ensure proper sorting of all kind of binary objects
      field::sort_key() now adds length last for varbinary/blob
      VARBINARY/BLOB is now sorted by filesort so that shorter strings comes before longer ones
      Fixed issues in test cases from last merge
      
      
      
      mysql-test/r/select.result:
        Change column name in test to get GROUP BY to use the alias
      mysql-test/r/type_blob.result:
        Test BLOB and VARCHAR sorting
      mysql-test/t/select.test:
        Change column name in test to get GROUP BY to use the alias
        Drop used tables at start of test
        Don't use table names 'a', 'b' or 'c'
      mysql-test/t/type_blob.test:
        Test BLOB and VARCHAR sorting
      sql/field.cc:
        Store length last in VARBINARY() and BLOB() columns to get shorter strings sorted before longer onces
      sql/field.h:
        Added method 'sort_length()' to allow one to have length bytes last for VARBINARY/BLOB to get these to sort properly
      sql/filesort.cc:
        Use 'sort_length()' instead of 'pack_length()' to get length of field.
        Store suffix_length last for varbinary (blob) objects.
        The above ensures that BLOB/VARBINARY are correctly sorted (shorter strings before longer ones)
      sql/sql_class.h:
        Added sort suffix length (to get varbinary/blob to sort correctly)
      sql/sql_select.cc:
        Use sort_length() instead of pack_lengths()
      strings/ctype-bin.c:
        Don't let strnxfrm_bin store length last
        Better to do it in MySQL field object to ensure it's done properly for all cases
      b896d334
    • unknown's avatar
      Fix for bug #3874 (Group by field is not considered) · 2e887f79
      unknown authored
      mysql-test/r/select.result:
        test result fixed
      mysql-test/t/select.test:
        test case added
      sql/sql_select.cc:
        do the same for nullable
      2e887f79
    • unknown's avatar
      A post-review fix (Bug#12736) · af43bd9d
      unknown authored
      af43bd9d
    • unknown's avatar
      A fix and a test case for Bug#12736 "Server crash during a select". · d31e997d
      unknown authored
      The bug was in JOIN::join_free which was wrongly determining that
      all joins have been already executed and therefore all used tables
      can be closed.
      
      
      mysql-test/r/subselect_innodb.result:
        - test results fixed (Bug#12736 "Server crash during a select
      mysql-test/t/subselect_innodb.test:
        - a test case for Bug#12736 "Server crash during a select": test
        that ha_index_or_rnd_end and mysql_unlock_tables are called
        for all used tables in proper order.
      sql/item_subselect.cc:
        - implement subselect_union_engine::is_executed
      sql/item_subselect.h:
        - implement Item_subselect::is_evaluated. This function is used
        to check whether we can clean up a non-correlated join of a subquery
        when cleaning up the join of the outer query
      sql/sql_lex.h:
        - declare st_select_lex::cleanup_all_joins
      sql/sql_select.cc:
        - remove an argument from JOIN::join_free, it's now not used
        - reimplement JOIN::join_free to not unlock tables if there
          is a subquery that has not yet been evaluated. Make sure that the
          new implementation calls ha_index_or_rnd_end for every table in
          the join and inner joins, because all table cursors must be closed
          before mysql_unlock_tables.
      sql/sql_select.h:
        - JOIN::join_free signature changed
      sql/sql_union.cc:
        - implement a helper method st_select_lex::cleanup_all_joins, which
          recursively walks over a tree of joins and calls cleanup() for
          each join.
      d31e997d
  15. 12 Oct, 2005 1 commit
    • unknown's avatar
      select.test, sql_select.cc, sql_lex.cc, item.cc: · a46e8e23
      unknown authored
        Bug #7672 after merge fix
      
      
      sql/item.cc:
        Bug #7672 after merge fix
      sql/sql_lex.cc:
        Bug #7672 after merge fix
      sql/sql_select.cc:
        Bug #7672 after merge fix
      mysql-test/t/select.test:
        Bug #7672 after merge fix
      a46e8e23
  16. 11 Oct, 2005 1 commit
    • unknown's avatar
      Reviewing new pushed code · 0ce12f70
      unknown authored
      - CHAR() now returns binary string as default
      - CHAR(X*65536+Y*256+Z) is now equal to CHAR(X,Y,Z) independent of the character set for CHAR()
      - Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
        (Some old systems returns ETIME and it's safer to test for both values
         than to try to write a wrapper for each old system)
      - Fixed new introduced bug in NOT BETWEEN X and X
      - Ensure we call commit_by_xid or rollback_by_xid for all engines, even if one engine has failed
      - Use octet2hex() for all conversion of string to hex
      - Simplify and optimize code
      
      
      client/mysqldump.c:
        Simple optimizations of new code
        Indentation fixes
      client/mysqltest.c:
        Removed not needed variable
      include/mysql_com.h:
        Made octec2hex() more usable
      mysql-test/r/ctype_utf8.result:
        CHAR() now returns binary string as default
      mysql-test/r/func_str.result:
        CHAR() now returns binary string as default
      mysql-test/r/range.result:
        Added test to verify new introduced bug in NOT BETWEEN X and X
      mysql-test/r/user_var-binlog.result:
        CHAR() now returns binary string as default
      mysql-test/r/view.result:
        More tests of view rename
      mysql-test/t/ctype_utf8.test:
        CHAR() now returns binary string as default
      mysql-test/t/func_str.test:
        CHAR() now returns binary string as default
      mysql-test/t/range.test:
        Added test to verify new introduced bug in NOT BETWEEN X and X
      mysql-test/t/view.test:
        More tests of view rename
      mysys/mf_keycache.c:
        Indentation changes
        Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
      mysys/my_os2cond.c:
        Fix to MySQL coding style
        Optimized functions
      mysys/thr_lock.c:
        Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
      mysys/thr_mutex.c:
        Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
      server-tools/instance-manager/instance.cc:
        Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
      server-tools/instance-manager/thread_registry.cc:
        Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
      sql/ha_federated.cc:
        Use octet2hex()
      sql/ha_ndbcluster.cc:
        Removed not used variable
      sql/handler.cc:
        Simplify code
        Use *NONE* instead of 'none' for not existing storage engine
        Ensure we call commit_by_xid or rollback_by_xid for all engines, even if one engine has failed
      sql/item.h:
        Remove not needed test for *ref.  (If ref is set, it should never point at 0)
      sql/item_func.cc:
        Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
        Simplify code
        More comments
        Require that last argument to find_and_check_access() is given
        (Made code shorter and faster)
      sql/item_strfunc.cc:
        Changed CHAR() to return result in binary collation
        CHAR(X*65536+Y*256+Z) is now equal to CHAR(X,Y,Z) independent of the character set for CHAR()
        
        Bar will shortly add the following syntax:
        CHAR(.... USING character_set)
        and ensure that
        CONVERT(CHAR(....) USING utf8) cuts not legal utf8 strings
        Use ocet2hex()
      sql/item_strfunc.h:
        CHAR() now returns a binary string
      sql/log_event.cc:
        Use octet2hex()
        Simplify code
      sql/parse_file.cc:
        Indentation fixes
        Use for() instead of while()
      sql/password.c:
        Make octet2hex() more generally usable by returning pointer to end 0
      sql/slave.cc:
        Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
      sql/sql_base.cc:
        Indentation fixes
      sql/sql_insert.cc:
        Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
      sql/sql_manager.cc:
        Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
      sql/sql_parse.cc:
        Don't check thd->db when checking for function privileges
      sql/sql_prepare.cc:
        Fixed wrong merge
      sql/sql_select.cc:
        Fixed new bug for NOT BETWEEN X and X
      sql/sql_show.cc:
        Removed not used variable
      sql/sql_table.cc:
        Indentation fixed
        Removed DBUG_PRINT that is obvious from context
      sql/sql_view.cc:
        Simplify code
      sql/unireg.cc:
        Use octet2hex()
      0ce12f70
  17. 10 Oct, 2005 1 commit
    • unknown's avatar
      Fix bug#13327 check_equality() wasn't checking view's fields · ee5795f2
      unknown authored
      check_equality() finds equalities among field items. It checks input items
      to be Item_fields thus skipping view's fields, which are represented by
      Item_direct_view_ref. Because of this index wasn't applied in all cases
      it can be.
      
      To fix this problem check_equality() now takes real item of
      Item_direct_view_ref, except outer view refs (with depended_from set).
      
      
      sql/sql_select.cc:
        Fix bug #13327 VIEW performs index scan
         For proper views fields handling check_equality() now takes real item from Item_direct_view_ref, with exception of outer view refs.
      mysql-test/r/view.result:
        Test case for bug#13327 VIEW performs index scan
      mysql-test/t/view.test:
        Test case for bug#13327 VIEW performs index scan
      ee5795f2
  18. 09 Oct, 2005 1 commit
    • unknown's avatar
      Fix bug#7672 Unknown column error in order clause · f3f84ed8
      unknown authored
      When fixing Item_func_plus in ORDER BY clause field c is searched in all
      opened tables, but because c is an alias it wasn't found there.
      
      This patch adds a flag to select_lex which allows Item_field::fix_fields() 
      to look up in select's item_list to find aliased fields.
      
      
      sql/item.cc:
        Fix bug#7672 Unknown column error in order clause
        When fixing fields in ORDER BY clause allow Item_field::fix_fields() to look up items in select's item list to find aliased fields.
      sql/sql_lex.cc:
         Fix bug#7672 Unknown column error in order clause
      sql/sql_lex.h:
        Fix bug#7672 Unknown column error in order clause
        Added flag to select_lex allowing Item_field::fix_fields to look up items in select's item list.
      sql/sql_select.cc:
        Fix bug#7672 Unknown column error in order clause
      mysql-test/t/select.test:
        Test case for bug#7672 Unknown column error in order clause
      mysql-test/r/select.result:
        Test case for bug#7672 Unknown column error in order clause
      f3f84ed8
  19. 29 Sep, 2005 1 commit
    • unknown's avatar
      Fix for BUG#13455: Make "ref" optimizer able to make this inference: · 8bdb41ab
      unknown authored
      "t.key BETWEEN c1 AND c2" and c1 = c2 -> can access table t using "t.key = c1".
      
      
      mysql-test/r/heap.result:
        BUG#13455: updated test results
      mysql-test/r/innodb.result:
        BUG#13455: updated test results
      mysql-test/r/myisam.result:
        BUG#13455: updated test results
      mysql-test/r/range.result:
        Testcase for BUG#13455
      mysql-test/t/range.test:
        Testcase for BUG#13455
      8bdb41ab
  20. 23 Sep, 2005 1 commit
    • unknown's avatar
      Fix for BUG#13419: In "ref" optimizer, take into account that item=Item_func_in(x,y) is · 32de9735
      unknown authored
      not equivalent to "x=y" when item->negated == TRUE.
      
      
      mysql-test/r/func_in.result:
        Testcase for BUG#13419
      mysql-test/t/func_in.test:
        Testcase for BUG#13419
      sql/sql_select.cc:
        Fix for BUG#13419:
        * Take into account that item=Item_func_in(x,y) is not equivalent to "x=y" when 
          item->negated == TRUE.
        * Removed comment that is no longer true.
      32de9735
  21. 22 Sep, 2005 1 commit
    • unknown's avatar
      Fixed problems found by valgrind · 7d6d4c83
      unknown authored
      Fixed problems in test suite where some test failed
      Fixed access to not initialized memory in federated
      Fixed access to not initialized memory when using BIT fields in internal temporary tables
      
      
      BitKeeper/etc/ignore:
        added libmysqld/sql_cursor.h
      mysql-test/r/information_schema.result:
        Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middlecd
      mysql-test/r/information_schema_inno.result:
        Remove used tables at start
      mysql-test/r/multi_statement.result:
        Remove used tables at start
      mysql-test/r/temp_table.result:
        Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middle
      mysql-test/r/type_bit.result:
        More tests
      mysql-test/t/information_schema.test:
        Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middle
      mysql-test/t/information_schema_inno.test:
        Remove used tables at start
      mysql-test/t/multi_statement.test:
        Remove used tables at start
      mysql-test/t/temp_table.test:
        Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middle
      mysql-test/t/type_bit.test:
        More tests
      mysql-test/valgrind.supp:
        Removed some valgrind warnings that isn't errors
      sql/ha_federated.cc:
        Fixed errors discovered by valgrind:
        - Socket was not initialized
        - share->scheme was deleted while there was still pointer into it from the hash
      sql/item_func.h:
        Remove access to table object from cleanup() as the table object may have been dropped earlier (In case of temporary tables or of close_thread_tables() is run before cleanup())
        This fixed a bug with access to already freed memory
      sql/sql_base.cc:
        Reset variables used by fulltext
      sql/sql_select.cc:
        Fixed various problems with bit fields when used in internal temporary tables.
        Calculate space needed for bit fields correctly (previously we allocated more space than needed for rows in heap/myisam tables)
      7d6d4c83
  22. 21 Sep, 2005 1 commit
    • unknown's avatar
      A fix and a test case for Bug#6513 "Test Suite: Values inserted by using · 813fc410
      unknown authored
      cursor is interpreted latin1 character and Bug#9819 "Cursors: Mysql Server
      Crash while fetching from table with 5 million records."
      A fix for a possible memory leak when fetching into an SP cursor
      in a long loop.
      The patch uses a common implementation of cursors in the binary protocol and 
      in stored procedures and implements materialized cursors.
      For implementation details, see comments in sql_cursor.cc
      
      
      include/my_sys.h:
        - declaration for multi_alloc_root
      libmysqld/Makefile.am:
        - drop protocol_cursor.cc, add sql_cursor.cc (replaces the old
        implementation of cursors with a new one)
      mysql-test/r/ctype_ujis.result:
        - test results fixed (a test case for Bug#6513)
      mysql-test/r/sp-big.result:
        - test results fixed (a test case for Bug#9819)
      mysql-test/t/ctype_ujis.test:
        Add a test case for Bug#6513 "Test Suite: Values inserted by using cursor is
         interpreted latin1 character"
      mysql-test/t/sp-big.test:
        Add a restricted test case for Bug#9819 "Cursors: Mysql Server Crash
        while fetching from table with 5 million records."
      mysys/my_alloc.c:
        - an implementation of multi_alloc_root; this is largely a copy-paste
          from mulalloc.c, but the function is small and there is no easy way
          to reuse the existing C function.
      sql/Makefile.am:
        - add sql_cursor.h, sql_cursor.cc (a new implementation of stored procedure
        cursors) and drop protocol_cursor.cc (the old one)
      sql/handler.cc:
        - now TABLE object has its mem_root always initialized.
          Adjust the implementation handler::ha_open
      sql/item_subselect.cc:
        - adjust to the changed declaration of st_select_lex_unit::prepare
      sql/protocol.h:
        - drop Protocol_cursor
      sql/sp_head.cc:
        - move juggling with Query_arena::free_list and Item::next to
          sp_eval_func_item, as this is needed in 3 places already.
      sql/sp_head.h:
        - declare a no-op implementation for cleanup_stmt in sp_instr_cpush.
          This method is needed for non-materializing cursors, which are yet not 
          used in stored procedures.
        - declaration for sp_eval_func_item
      sql/sp_rcontext.cc:
        - reimplement sp_cursor using the new implementation of server side cursors.
        - use sp_eval_func_item to assign values of SP variables from the
          row fetched from a cursor. This should fix a possible memory leak in 
          the old implementation of sp_cursor::fetch
      sql/sp_rcontext.h:
        - reimplement sp_cursor using the new implementation of server side cursors.
      sql/sql_class.cc:
        - disable the functionality that closes transient cursors at commit/rollback;
          transient cursors are not used in 5.0, instead we use materialized ones.
          To be enabled in a later version.
      sql/sql_class.h:
        - adjust to the rename Cursor -> Server_side_cursor
        - additional declarations of select_union used in materialized cursors
      sql/sql_derived.cc:
        - reuse bits of tmp table code in UNION, derived tables, and materialized
          cursors
        - cleanup comments
      sql/sql_lex.h:
        - declarations of auxiliary methods used by materialized cursors
        - a cleanup in st_select_lex_unit interface
      sql/sql_list.h:
        - add an array operator new[] to class Sql_alloc
      sql/sql_prepare.cc:
        - split the tight coupling of cursors and prepared statements to reuse 
          the same implementation in stored procedures
        - cleanups of error processing in Prepared_statement::{prepare,execute}
      sql/sql_select.cc:
        - move the implementation of sensitive (non-materializing) cursors to 
          sql_cursor.cc
        - make temporary tables self-contained: the table, its record and fields
          are allocated in TABLE::mem_root. This implementation is not clean
          and resets thd->mem_root several times because of the way create_tmp_table 
          works (many additional things are done inside it).
        - adjust to the changed declaration of st_select_lex_unit::prepare
      sql/sql_select.h:
        - move the declaration of sensitive (non-materializing) cursors to 
          sql_cursor.cc
      sql/sql_union.cc:
        - move pieces of st_select_unit::prepare to select_union and st_table
          methods to be able to reuse code in the implementation of materialized
          cursors
      sql/sql_view.cc:
        - adjust to the changed signature of st_select_lex_unit::prepare
      sql/table.cc:
        - implement auxiliary st_table methods for use with temporary tables
      sql/table.h:
        - add declarations for auxiliary methods of st_table used to work with 
         temporary tables
      tests/mysql_client_test.c:
        - if cursors are materialized, a parallel update of the table used
          in the cursor may go through: update the test.
      sql/sql_cursor.cc:
        New BitKeeper file ``sql/sql_cursor.cc'' -- implementation of server side
        cursors
      sql/sql_cursor.h:
        New BitKeeper file ``sql/sql_cursor.h'' - declarations for
        server side cursors.
      813fc410
  23. 15 Sep, 2005 1 commit
    • unknown's avatar
      Fix bug#12887 Distinct is not always applied after rollup · 36d163d6
      unknown authored
      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.
      
      
      sql/sql_select.cc:
        Fix bug #12887 Distinct is not always applied after rollup
      mysql-test/r/olap.result:
        Test case for bug #12887 Distinct is not always applied after rollup
      mysql-test/t/olap.test:
        Test case for bug #12887 Distinct is not always applied after rollup
      36d163d6
  24. 12 Sep, 2005 1 commit
    • unknown's avatar
      Review fixes since last pull · 90ca6d15
      unknown authored
      Fix for bug #13025; Server crash in filesort because wrong call to handler::position()
      
      
      client/mysqltest.c:
        Code cleanup during review
      mysql-test/r/innodb.result:
        Added test case for bug #13025; Server crash in filesort because wrong call to handler::position()
      mysql-test/t/innodb.test:
        Added test case for bug #13025; Server crash in filesort because wrong call to handler::position()
      sql/filesort.cc:
        Don't call handler::position() if row was not found
      sql/item_cmpfunc.cc:
        Indentation changes
      sql/sql_select.cc:
        Moved variable to outer level
      90ca6d15
  25. 10 Sep, 2005 1 commit
  26. 08 Sep, 2005 1 commit
    • unknown's avatar
      sql_select.cc: · 91d2150d
      unknown authored
        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.
      
      
      mysql-test/r/olap.result:
        Added test case for bug #12885.
      mysql-test/t/olap.test:
        Added test case for bug #12885.
      sql/sql_select.cc:
        Fixed bug #12885.
        Forced inheritence of the maybe_null flag for the expressions
        containing GROUP BY attributes in selects with ROLLUP.
      91d2150d
  27. 07 Sep, 2005 2 commits
    • unknown's avatar
      join_outer.result, opt_range.cc, item_cmpfunc.cc: · 0a61c3ab
      unknown authored
        Post merge changes
      sql_yacc.yy:
        Post merge changes
      sql_select.cc:
        Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
         for some expressions (post merge changes).
         The function add_key_fields() is modified. There cannot be NOT before
         BETWEEN/IN anymore. Rather Item_func_between/in objects can represent
         now [NOT]BETWEEN/IN expressions.
      
      
      sql/item_cmpfunc.cc:
        Post merge changes
      sql/opt_range.cc:
        Post merge changes
      sql/sql_select.cc:
        Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
         for some expressions (post merge changes).
         The function add_key_fields() is modified. There cannot be NOT before
         BETWEEN/IN anymore. Rather Item_func_between/in objects can represent
         now [NOT]BETWEEN/IN expressions.
      sql/sql_yacc.yy:
        Post merge changes.
      mysql-test/r/join_outer.result:
        Post merge changes
      0a61c3ab
    • unknown's avatar
      Fix for BUG#12941: in create_tmp_field(), if the passed item is an Item_ref, put newly · 3003e5a0
      unknown authored
      created item into item->result_field, not *(item->ref)->result_field.
      
      
      mysql-test/r/view.result:
        Tescase for BUG#12941
      mysql-test/t/view.test:
        Tescase for BUG#12941
      3003e5a0
  28. 02 Sep, 2005 1 commit
    • unknown's avatar
      Rename: · dc922213
      unknown authored
      - current_arena to stmt_arena: the thread may have more than one
      'current' arenas: one for runtime data, and one for the parsed 
      tree of a statement. Only one of them is active at any moment.
      - set_item_arena -> set_query_arena, because Item_arena was renamed to 
      Query_arena a while ago
      - set_n_backup_item_arena -> set_n_backup_active_arena;
      the active arena is the arena thd->mem_root and thd->free_list
      are currently pointing at.
      - restore_backup_item_arena -> restore_active_arena (with the same
      rationale)
      - change_arena_if_needed -> activate_stmt_arena_if_needed; this
      method sets thd->stmt_arena active if it's not done yet.
      
      
      sql/item.cc:
        Rename.
      sql/item_cmpfunc.cc:
        Rename.
      sql/item_func.cc:
        Rename.
      sql/item_subselect.cc:
        Rename.
      sql/item_subselect.h:
        Remove an unused forward declaration.
      sql/item_sum.h:
        Remove an unused forward declaration.
      sql/mysql_priv.h:
        Remove an unused forward declaration.
      sql/sp.cc:
        Rename.
      sql/sp_head.cc:
        Rename.
      sql/sql_base.cc:
        Rename.
      sql/sql_class.cc:
        Rename.
      sql/sql_class.h:
        Rename.
      sql/sql_lex.cc:
        Rename.
      sql/sql_parse.cc:
        Rename.
      sql/sql_prepare.cc:
        Rename.
      sql/sql_select.cc:
        Rename.
      sql/sql_show.cc:
        Rename.
      sql/sql_union.cc:
        Rename.
      sql/sql_view.cc:
        Rename.
      sql/table.cc:
        Rename.
      dc922213
  29. 01 Sep, 2005 2 commits
    • unknown's avatar
      a fix (bug #10303: Misleading Last_query_cost value). · 2a0f9f33
      unknown authored
      sql/sql_select.cc:
        a fix (bug #10303: Misleading Last_query_cost value).
        reset last_query_cost in the very beginning.
      2a0f9f33
    • unknown's avatar
      Bug10213 mysqldump crashes when dumping VIEWs · 74ea939f
      unknown authored
       - Added testcase for this bug
       - Check if compact view format can be used
       - Clean up mysqld_show_create
      
      
      mysql-test/r/mysqldump.result:
        Updated test result
      mysql-test/t/mysqldump.test:
        Added testcase
      sql/item.cc:
        Check if compact format can be used
      sql/sql_select.cc:
        Check if compact format can be used
      sql/sql_show.cc:
        Cleanup of mysqld_show_create
         -remove extra invocation of view_store_create_info
         -Remove unused vars
         -Remove unused codes
        Check if compact show view format can be used 
          - if user has db of this view as current db
          - if this view only references table inside it's own db
      sql/table.h:
        Add variable for compact_view_format indicator
      74ea939f
  30. 31 Aug, 2005 1 commit
    • unknown's avatar
      create.test, create.result, sql_select.cc, item.cc: · c6b54efe
      unknown authored
        After merge fix for bug #12537
      
      
      sql/item.cc:
        After merge fix for bug #12537
      sql/sql_select.cc:
        After merge fix for bug #12537
      mysql-test/r/create.result:
        After merge fix for bug #12537
      mysql-test/t/create.test:
        After merge fix for bug #12537
      c6b54efe
  31. 30 Aug, 2005 1 commit
    • unknown's avatar
      Fix bug #12537 UNION produces longtext instead of varchar · 033faf72
      unknown authored
      Item::tmp_table_field_from_field_type() and create_tmp_field_from_item()
      was converting string field to blob depending on byte-wise length instead of
      character length, which results in converting valid varchar string with
      length == 86 to longtext.
      
      Made that functions above take into account max width of character when
      converting string fields to blobs.
      
      
      sql/item.cc:
        Fix bug #12537 UNION produces longtext instead of varchar
        Item::tmp_table_field_from_field_type() now taking into account max char width when creating tmp field for string fields.
      sql/sql_select.cc:
        Fix bug #12537 UNION produces longtext instead of varchar
         create_tmp_field_from_item()now taking into account max char width when creating tmp field for string fields.
      mysql-test/r/create.result:
        Test case for bug #12537 UNION produces longtext instead of varchar
      mysql-test/t/create.test:
        Test case for bug #12537 UNION produces longtext instead of varchar
      033faf72