An error occurred fetching the project authors.
  1. 06 Feb, 2018 1 commit
  2. 30 Jan, 2018 2 commits
    • Monty's avatar
      Renamed Item_user_var_as_out_param::name to org_name · 29fd049a
      Monty authored
      Rename was done as the old 'name' hide the original item name.
      29fd049a
    • Monty's avatar
      Changed database, tablename and alias to be LEX_CSTRING · a7e352b5
      Monty authored
      This was done in, among other things:
      - thd->db and thd->db_length
      - TABLE_LIST tablename, db, alias and schema_name
      - Audit plugin database name
      - lex->db
      - All db and table names in Alter_table_ctx
      - st_select_lex db
      
      Other things:
      - Changed a lot of functions to take const LEX_CSTRING* as argument
        for db, table_name and alias. See init_one_table() as an example.
      - Changed some function arguments from LEX_CSTRING to const LEX_CSTRING
      - Changed some lists from LEX_STRING to LEX_CSTRING
      - threads_mysql.result changed because process list_db wasn't always
        correctly updated
      - New append_identifier() function that takes LEX_CSTRING* as arguments
      - Added new element tmp_buff to Alter_table_ctx to separate temp name
        handling from temporary space
      - Ensure we store the length after my_casedn_str() of table/db names
      - Removed not used version of rename_table_in_stat_tables()
      - Changed Natural_join_column::table_name and db_name() to never return
        NULL (used for print)
      - thd->get_db() now returns db as a printable string (thd->db.str or "")
      a7e352b5
  3. 14 Jan, 2018 1 commit
    • Eugene Kosov's avatar
      Compilation speed (#546) · 72136ae7
      Eugene Kosov authored
      Speed up compilation
      
      Standard C++ headers contribute a lot to compilation time. Avoid algorithm
      and sstream in frequently used headers.
      72136ae7
  4. 22 Dec, 2017 1 commit
    • Monty's avatar
      MDEV 13679 Enabled sequences to be used in DEFAULT · 9cc7789e
      Monty authored
      Other changes done to get this to work:
      - Added 'internal_tables' to TABLE object to list which sequence tables
        is needed to use the table.
      - Mark any expression using DEFAULT() with LEX->default_used.
        This is needed when deciding if we should open internal sequence
        tables when a table is opened (we don't need to open sequence tables
        if the main table is only used with SELECT).
      - Create_and_open_temporary_table() can now also open all internal
        sequence tables.
      - Added option MYSQL_LOCK_USE_MALLOC to mysql_lock_tables()
        to force memory allocation to be used with malloc instead of
        memroot.
      - Added flag to MYSQL_LOCK to remember if allocation was done with
        malloc or memroot (makes code simpler and safer).
      - init_one_table_for_prelocking() now takes argument for what lock to
        use instead of it's a routine or something else.
      - Renamed prelocking placeholders to make them more understandable as
        they are now used in more code.
      - Changed test in check_lock_and_start_stmt() if found table has correct
        locks. The old test didn't work for tables that has lock
        TL_WRITE_ALLOW_WRITE, which is what sequence tables are using.
      - Added VCOL_NOT_VIRTUAL option to ensure that sequence functions can't
        be used with virtual columns
      - More sequence tests
      9cc7789e
  5. 07 Dec, 2017 1 commit
  6. 04 Dec, 2017 3 commits
    • Varun Gupta's avatar
      MDEV-7773: Aggregate stored functions · 60c44658
      Varun Gupta authored
      This commit implements aggregate stored functions. The basic idea behind
      the feature is:
      
      * Implement a special instruction FETCH GROUP NEXT ROW that will pause
      the execution of the stored function. When the instruction is reached,
      execution of the initial query resumes "as if" the function returned.
      This gives the server the opportunity to advance to the next row in the
      result set.
      
      * Stored aggregates behave like regular aggregate functions. The
      implementation of thus resides in the class Item_sum_sp. Because it is
      an aggregate function, for each new row in the group, the
      Item_sum_sp::add() method will be called. This is when execution resumes
      and the function does another iteration to "add" one extra element to
      the final result.
      
      * When the end of group is reached, val_xxx() method will be called for
      the item. This case is handled by another execute step for the stored
      function, only with a special flag to force a call to the return
      handler. See Item_sum_sp::execute() for details.
      
      To allow this pause and resume semantic, we must preserve the function
      context across executions. This is stored in Item_sp::sp_query_arena only for
      aggregate stored functions, but has no impact for regular functions.
      
      We also enforce aggregate functions to include the "FETCH GROUP NEXT ROW"
      instruction.
      Signed-off-by: default avatarVicențiu Ciorbaru <vicentiu@mariadb.org>
      60c44658
    • Vicențiu Ciorbaru's avatar
      Remove the side effect of setting m_sp from Item_sp::init_result_field · 7448b01b
      Vicențiu Ciorbaru authored
      Item_sp::init_result_field no longer takes sp_head* parameter. It
      expects the m_sp member to be already set to something valid.
      7448b01b
    • Varun Gupta's avatar
      Refactor parts of Item_func_sp into Item_sp · c12d1ed4
      Varun Gupta authored
      In preparation for implementing custom aggregate functions, refactor
      the common code between regular stored functions and aggregate stored
      functions. This includes:
      
      * initialising SP result field
      * executing a SP
      * access checks
      
      In addition, refactor sp_head::execute_function to take two extra
      parameters, a function rcontext and a Query_arena. These two paremeters
      were initially initialised and destroyed within
      sp_head::execute_function, but for aggregate stored functions we will
      require control over their lifetime. The owner of these objects now
      becomes Item_sp.
      Signed-off-by: default avatarVicențiu Ciorbaru <vicentiu@mariadb.org>
      c12d1ed4
  7. 28 Nov, 2017 1 commit
  8. 17 Nov, 2017 1 commit
    • Michael Widenius's avatar
      Handle failures from malloc · 87933d52
      Michael Widenius authored
      Most "new" failures fixed in the following files:
      - sql_select.cc
      - item.cc
      - item_func.cc
      - opt_subselect.cc
      
      Other things:
      - Allocate udf_handler strings in mem_root
        - Required changes in sql_string.h
      - Add mem_root as argument to some new [] calls
      - Mark udf_handler strings as thread specific
      - Removed some comment blocks with code
      87933d52
  9. 09 Nov, 2017 1 commit
    • Oleksandr Byelkin's avatar
      MDEV-14164: Unknown column error when adding aggregate to function in oracle... · c2c93fc6
      Oleksandr Byelkin authored
      MDEV-14164: Unknown column error when adding aggregate to function in oracle style procedure FOR loop
      
      Make differentiation between pullout for merge and pulout of outer field during exists2in transformation.
      In last case the field was outer and so we can safely start from name resolution context of the SELECT where it was pulled.
      Old behavior lead to inconsistence between list of tables and outer name resolution context (which skips one SELECT for merge purposes) which creates problem vor name resolution.
      c2c93fc6
  10. 17 Oct, 2017 1 commit
  11. 30 Sep, 2017 2 commits
  12. 29 Sep, 2017 1 commit
  13. 28 Sep, 2017 1 commit
  14. 18 Sep, 2017 1 commit
    • Sergei Golubchik's avatar
      MDEV-13673 Bad result in view · fb2035a1
      Sergei Golubchik authored
      When printing an expression, like a/(b*c), we need to print parentheses,
      even though / and * have the same precedence. Basically, we should
      always treat the second argument as having one level higher precedence
      than it normally is.
      fb2035a1
  15. 23 Aug, 2017 2 commits
    • Michael Widenius's avatar
      Fixed some compiler warnings · 9e1cc831
      Michael Widenius authored
      9e1cc831
    • Michael Widenius's avatar
      Lots of small cleanups · 458d5ed8
      Michael Widenius authored
      - Simplified use_trans_cache() to return at once if is_transactional is set
      - Indentation and spelling errors fixed
      - Don't call signal_update() if update_binlog_end_pos() is called as the
        function already calls signal_update()
      - Removed not used function wait_for_update_bin_log(), which would cause
        errors if ever used.
      - Simplified handler::clone() by always allocating 'ref' in ha_open(). To do
        this I added an optional MEM_ROOT argument to ha_open() to be used when
        allocating 'ref'
      - Changed arguments to get_system_var() from LEX_CSTRING to LEX_CSTRING*
      - Added THD as argument to create_select_for_variable(). Changed also char*
        argument to LEX_CSTRING to avoid strlen() call.
      - Change calls to append() to use LEX_CSTRING
      458d5ed8
  16. 15 Aug, 2017 1 commit
  17. 07 Aug, 2017 1 commit
  18. 31 Jul, 2017 1 commit
  19. 20 Jul, 2017 1 commit
  20. 12 Jul, 2017 1 commit
  21. 03 Jul, 2017 1 commit
  22. 01 Jul, 2017 1 commit
  23. 28 Jun, 2017 1 commit
    • Vicențiu Ciorbaru's avatar
      MDEV-12851: Case with window functions query crashes server · 31ba0fa4
      Vicențiu Ciorbaru authored
      The "is null" function performs one operation which no other Item_func
      does, which is to update used tables during fix_length_and_dec().
      
      This however can not be performed before window functions have had a
      chance to resolve their order by and partition by definitions, which
      happens after the initial setup_fields call. Consequently, do not call
      Item_func_isnull update_used_tables during fix_length_and_dec().
      
      There was another issue detected once the crash was resolved.
      Because window functions did not implement is_null() method, we would
      end up returning bad results for "is null" and "is not null" functions.
      Implemented is_null() method for Item_windowfunc.
      31ba0fa4
  24. 29 May, 2017 1 commit
  25. 24 May, 2017 2 commits
  26. 23 May, 2017 1 commit
    • Alexander Barkov's avatar
      Fixing a few problems with data type and metadata for INT result functions... · d9304914
      Alexander Barkov authored
      Fixing a few problems with data type and metadata for INT result functions (MDEV-12852, MDEV-12853, MDEV-12869)
      
      This is a joint patch for:
      MDEV-12852 Out-of-range errors when CAST(1-2 AS UNSIGNED
      MDEV-12853 Out-of-range errors when CAST('-1' AS UNSIGNED
      MDEV-12869 Wrong metadata for integer additive and multiplicative operators
      
      1. Fixing all Item_func_numhybrid descendants to set the precise
         data type handler (type_handler_long or type_handler_longlong)
         at fix_fields() time. This fixes MDEV-12869.
      
      2. Fixing Item_func_unsigned_typecast to set the precise data type handler
         at fix_fields() time. This fixes MDEV-12852 and MDEV-12853.
         This is done by:
         - fixing Type_handler::Item_func_unsigned_fix_length_and_dec()
           and Type_handler_string_result::Item_func_unsigned_fix_length_and_dec()
           to properly detect situations when a negative epxression is converted
           to UNSIGNED. In this case, length of the result is now always set to
           MAX_BIGINT_WIDTH without trying to use args[0]->max_length, as very
           short arguments can produce very long result in such conversion:
              CAST(-1 AS UNSIGNED) -> 18446744073709551614
         - adding a new virtual method "longlong Item::val_int_max() const",
           to preserve the old behavior for expressions like this:
              CAST(1 AS UNSIGNED)
           to stay under the INT data type (instead of BIGINT) for small
           positive integer literals. Using Item::unsigned_flag would not help,
           because Item_int does not set unsigned_flag to "true" for positive
           numbers.
      
      3. Adding helper methods:
        * Item::type_handler_long_or_longlong()
        * Type_handler::type_handler_long_or_longlong()
        and reusing them in a few places, to reduce code duplication.
      
      4. Making reorganation in create_tmp_field() and
         create_field_for_create_select() for Item_hybrid_func and descendants,
         to reduce duplicate code. They all now have a similar behavior in
         respect of creating fields. Only Item_func_user_var descendants have
         a different behavior. So moving the default behvior to Item_hybrid_func,
         and overriding behavior on Item_func_user_var level.
      d9304914
  27. 20 May, 2017 1 commit
  28. 17 May, 2017 3 commits
  29. 15 May, 2017 1 commit
    • Alexander Barkov's avatar
      MDEV-12775 Reuse data type aggregation code for hybrid functions and UNION · 705fc43e
      Alexander Barkov authored
      Introducing a new class Type_holder (used internally in sql_union.cc),
      to reuse exactly the same data type attribute aggregation Type_handler API
      for hybrid functions and UNION.
      
      This fixes a number of bugs in UNION:
      
      - MDEV-9495 Wrong field type for a UNION of a signed and an unsigned INT expression
      - MDEV-9497 UNION and COALESCE produce different field types for DECIMAL+INT
      - MDEV-12594 UNION between fixed length double columns does not always preserve scale
      - MDEV-12595 UNION converts INT to BIGINT
      - MDEV-12599 UNION is not symmetric when mixing INT and CHAR
      
      Details:
      
      - sql_union.cc: Reusing attribute aggregation for UNION.
        Adding new methods:
        * st_select_lex_unit::join_union_type_handlers()
        * st_select_lex_unit::join_union_type_attributes()
        * st_select_lex_unit::join_union_item_types()
        Removing the old join_types()-based code.
      
      - Changing Type_handler::Item_hybrid_func_fix_attributes()
        to accept "name", Type_handler_hybrid_field_type, Type_all_attributes
        as three separate parameters instead of a single Item_hybrid_func parameter,
        to make it possible to pass both Item_hybrid_func and Type_holder.
      
      - Moving the former special GEOMETRY and ENUM/SET attribute aggregation code
        from Item_type_holder::join_types() to
        * Type_handler_typelib::Item_hybrid_func_fix_attributes().
        * Type_handler_geometry::Item_hybrid_func_fix_attrubutes().
        This makes GEOMETRY/ENUM/SET symmetric with all other data types
        (from the UNION point of view).
        Removing Item_type_holder::join_types() and Item_type_holder::get_full_info().
      
      - Adding new methods into Type_all_attributes:
        * Type_all_attributes::set_geometry_type() and
          Item_hybrid_func::set_geometry_type().
        * Adding Type_all_attributes::get_typelib().
        * Adding Type_all_attributes::set_typelib().
      
      - Adding Type_handler_typelib as a common parent for
        Type_handler_enum and Type_handler_set, to avoid code duplication: they have
        already had two common methods, and we're adding one more shared method.
      
      - Adding Type_all_attributes::set_maybe_null(), as some type handlers
        may want to set maybe_null (e.g. Type_handler_geometry) during data type
        attribute aggregation.
      
      - Changing Type_geometry_attributes() to accept Type_handler
        and Type_all_attributes as two separate parameters, instead
        of a single Item parameter, to make it possible to pass Type_holder.
      
      - Adding Item_args::add_argument().
      
      - Moving Item_args::alloc_arguments() from "protected" to "public".
      
      - Moving Item_type_holder::Item_type_holder() from item.cc to item.h, as
        now it's very simple.
        Btw, this constructor should probably be eventually removed.
        It's now used only in sql_show.cc, which could be modified to use
        Item_return_decimal (for symmetry with Item_return_xxx created for all
        other data types). Or, another option: remove all Item_return_xxx and
        use Item_type_holder for all data types instead.
      
      - storage/tokudb/mysql-test/tokudb/r/type_float.result
        Recording new results (MDEV-12594).
      
      - mysql-test/r/cte_recursive.result
        Recording new results (MDEV-9497)
      
      - mysql-test/r/subselect*.result
        Recording new results (MDEV-12595)
      
      - mysql-test/r/metadata.result
        Recording new results (MDEV-9495)
      
      - mysql-test/r/temp_table.result
        Recording new results (MDEV-12594)
      
      - mysql-test/r/type_float.result
        Recording new results (MDEV-12594)
      705fc43e
  30. 11 May, 2017 1 commit
  31. 07 May, 2017 2 commits