An error occurred fetching the project authors.
  1. 07 Oct, 2008 1 commit
    • Gleb Shchepa's avatar
      Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while · fd777ae1
      Gleb Shchepa authored
                ``FLUSH TABLES WITH READ LOCK''
      
      Concurrent execution of 1) multitable update with a
      NATURAL/USING join and 2) a such query as "FLUSH TABLES
      WITH READ LOCK" or "ALTER TABLE" of updating table led
      to a server crash.
      
      
      The mysql_multi_update_prepare() function call is optimized
      to lock updating tables only, so it postpones locking to
      the last, and if locking fails, it does cleanup of modified
      syntax structures and repeats a query analysis.  However,
      that cleanup procedure was incomplete for NATURAL/USING join
      syntax data: 1) some Field_item items pointed into freed
      table structures, and 2) the TABLE_LIST::join_columns fields
      was not reset.
      
      Major change:
        short-living Field *Natural_join_column::table_field has
        been replaced with long-living Item*.
      
      
      mysql-test/r/lock_multi.result:
        Added test case for bug #38691.
      mysql-test/t/lock_multi.test:
        Added test case for bug #38691.
      sql/item.cc:
        Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
                  ``FLUSH TABLES WITH READ LOCK''
        
        The Item_field constructor has been modified to allocate
        and copy original database/table/field names always (not
        during PS preparation/1st execution only), because
        an initialization of Item_field items with a pointer to
        short-living Field structures is a common practice.
      sql/sql_base.cc:
        Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
                  ``FLUSH TABLES WITH READ LOCK''
        
        1) Type adjustment for Natural_join_column::table_field
           (Field to Item_field);
        2) The setup_natural_join_row_types function has been
           updated to take into account new
           first_natural_join_processing flag to skip unnecessary
           reinitialization of Natural_join_column::join_columns
           during table reopening after lock_tables() failure
           (like the 'first_execution' flag for PS).
      sql/sql_lex.cc:
        Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
                  ``FLUSH TABLES WITH READ LOCK''
        
        Initialization of the new
        st_select_lex::first_natural_join_processing flag has
        been added.
      sql/sql_lex.h:
        Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
                  ``FLUSH TABLES WITH READ LOCK''
        
        The st_select_lex::first_natural_join_processing flag
        has been added to skip unnecessary rebuilding of
        NATURAL/USING JOIN structures during table reopening
        after lock_tables failure.
      sql/sql_update.cc:
        Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
                  ``FLUSH TABLES WITH READ LOCK''
        
        Extra cleanup calls have been added to reset
        Natural_join_column::table_field items.
      sql/table.cc:
        Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
                  ``FLUSH TABLES WITH READ LOCK''
        
        Type adjustment for Natural_join_column::table_field
        (Field to Item_field).
      sql/table.h:
        Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
                  ``FLUSH TABLES WITH READ LOCK''
        
        Type of the Natural_join_column::table_field field has
        been changed from Field that points into short-living
        TABLE memory to long-living Item_field that can be
        linked to (fixed) reopened table.
      fd777ae1
  2. 02 Oct, 2008 1 commit
    • Georgi Kodinov's avatar
      Bug #37348: Crash in or immediately after JOIN::make_sum_func_list · 47f405f5
      Georgi Kodinov authored
            
      The optimizer pulls up aggregate functions which should be aggregated in
      an outer select. At some point it may substitute such a function for a field
      in the temporary table. The setup_copy_fields function doesn't take this
      into account and may overrun the copy_field buffer.
            
      Fixed by filtering out the fields referenced through the specialized
      reference for aggregates (Item_aggregate_ref).
      Added an assertion to make sure bugs that cause similar discrepancy 
      don't go undetected.
      
      mysql-test/r/func_group.result:
        Bug #37348: test case
      mysql-test/t/func_group.test:
        Bug #37348: test case
      sql/item.cc:
        Bug #37348: Added a way to distinguish Item_aggregate_ref from the other types of refs
      sql/item.h:
        Bug #37348: Added a way to distinguish Item_aggregate_ref from the other types of refs
      sql/sql_select.cc:
        Bug #37348: 
         - Don't consider copying field references
            seen through Item_aggregate_ref
         - check for discrepancies between the number of expected 
           fields that need copying and the actual fields copied.
      47f405f5
  3. 01 Oct, 2008 1 commit
    • Ramil Kalimullin's avatar
      Fix for bug#39182: Binary log producing incompatible character set query · 29cc9af5
      Ramil Kalimullin authored
      from stored procedure. 
      
      Problem: we replace all references to local variables in stored procedures     
      with NAME_CONST(name, value) logging to the binary log. However, if the
      value's collation differs we might get an 'illegal mix of collation'           
      error as we don't pass the collation to the function.
      
      Fix: pass the value's collation to NAME_CONST().
      
      Note: actually we should pass to NAME_CONST() the value's derivation as well.
      It's impossible without the parser modifying. Now we always set the 
      derivation to DERIVATION_IMPLICIT, the same as local variables have.
      
      
      mysql-test/r/binlog.result:
        Fix for bug#39182: Binary log producing incompatible character set query
        from stored procedure.
          - test result.
      mysql-test/r/ctype_cp932_binlog.result:
        Fix for bug#39182: Binary log producing incompatible character set query
        from stored procedure.
          - results adjusted.
      mysql-test/r/rpl_sp.result:
        Fix for bug#39182: Binary log producing incompatible character set query
        from stored procedure.
          - results adjusted.
      mysql-test/t/binlog.test:
        Fix for bug#39182: Binary log producing incompatible character set query
        from stored procedure.
          - test case.
      sql/item.cc:
        Fix for bug#39182: Binary log producing incompatible character set query
        from stored procedure.
          - allow NAME_CONST() to get _charset'foo' COLLATE 'bar' strings
        (see Item_func_set_collation).
      sql/sp_head.cc:
        Fix for bug#39182: Binary log producing incompatible character set query
        from stored procedure. 
          - pass the value's collation to NAME_CONST().
      29cc9af5
  4. 18 Sep, 2008 1 commit
    • Georgi Kodinov's avatar
      Bug #39353: Multiple conditions on timestamp column crashes server · a3c58404
      Georgi Kodinov authored
            
      The fix for bug 31887 was incomplete : it assumes that all the 
      field types returned by the IS_NUM macro are descendants of 
      Item_num and tries to zero-fill the values before doing constant
      substitution with such fields when they are compared to constant string
      values.
      The only exception to this is Field_timestamp : it's in the IS_NUM
      macro, but is not a descendant of Field_num.
      Fixed by excluding timestamp fields (Field_timestamp) when zero-filling
      when converting the constant to compare with to a string.
      Note that this will not exclude the timestamp columns from const 
      propagation.
      
      mysql-test/r/compare.result:
        Bug #39353: test case
      mysql-test/t/compare.test:
        Bug #39353: test case
      sql/item.cc:
        Bug #39353: don't zero-fill timestamp fields when const propagating
        to a string : they'll be converted to a string in a date/time format
        and not as an integer.
      a3c58404
  5. 03 Sep, 2008 2 commits
    • Martin Hansson's avatar
      Bug#36086: SELECT * from views don't check column grants · d88ceff0
      Martin Hansson authored
      This patch also fixes bugs 36963 and 35600.
                            
      - In many places a view was confused with an anonymous derived
        table, i.e. access checking was skipped. Fixed by introducing a
        predicate to tell the difference between named and anonymous
        derived tables.
                            
      - When inserting fields for "SELECT * ", there was no 
        distinction between base tables and views, where one should be
        made. View privileges are checked elsewhere.
      
      mysql-test/include/grant_cache.inc:
        Bug#36086: Changed test case.
      mysql-test/r/grant2.result:
        Bug#36086: Changed test result.
      mysql-test/r/grant_cache_no_prot.result:
        Bug#36086: Changed test result.
      mysql-test/r/grant_cache_ps_prot.result:
        Bug#36086: Changed test result.
      mysql-test/r/view_grant.result:
        Bug#36086: Test result.
      mysql-test/t/grant2.test:
        Bug#36086: Changed test case.
      mysql-test/t/view_grant.test:
        Bug#36086: Test case.
      sql/item.cc:
        Bug#36086: Replaced conditional with new methods.
      sql/sql_acl.cc:
        Bug no 35600: 
        In mysql_table_grant:
          Replaced conditional with the new accessor method.
        
        In check_grant:
         - Changed the requirement table->derived != null to 
           checking all anonymous derived tables.
         - Use of the accessor methods for getting object and database 
           names.
            
        Bug#36086: In check_grant_all_columns:
          - Updated comment. This function is now called for views
            as well.
          - The error message should not disclose any column names 
            unless the user has privilege to see all column names.
          - Changed names of Field_iterator_table_ref methods.
      sql/sql_base.cc:
        Bug no 36963: In insert_fields()
          - Commented.
          - We should call check_grant_all_columns() for views in  
            this case.        
          - Changed names of Field_iterator_table_ref methods.
          - We should not disclose column names in the error message
            when the user has no approprate privilege.
      sql/sql_cache.cc:
        Bug#36086: Replaced test with new predicate method.
      sql/sql_derived.cc:
        Bug#36086: commenting only. Updated and doxygenated
        comment for mysql_derived_prepare().
      sql/sql_parse.cc:
        Bug no 35600: 
        - In check_single_table_access:
          Due to the bug, check_grant would raise an error for a
          SHOW CREATE TABLE command for a TEMPTABLE view. It should in
          fact not be be invoked in this case. This table privilege
          is checked already.
          There is a test case for this in information_schema_db.test.
            
        - In check_access: replaced table->derived
      sql/table.cc:
        Bug#36086: 
        
        - In TABLE_LIST::set_underlying_merge(): 
          Commenting only. Doxygenated, corrected spelling,
          added.
        
        - Renamed table_name() and db_name() methods of 
          Field_iterator_table_ref in order to be consistent
          with new methods in TABLE_LIST.
      sql/table.h:
        Bug#36086: 
          - Commented GRANT_INFO.
          - Added a predicate is_anonymous_derived_table() to    
            TABLE_LIST.
          - Added get_table_name() and get_db_name() to   
            TABLE_LIST in order to hide the disparate   
            representation of these properties.
      d88ceff0
    • Gleb Shchepa's avatar
      Bug #39002: The server crashes on the query: · 0e9cba18
      Gleb Shchepa authored
        INSERT .. SELECT .. ON DUPLICATE KEY UPDATE col=DEFAULT
      
      In order to get correct values from update fields that
      belongs to the SELECT part in the INSERT .. SELECT .. ON
      DUPLICATE KEY UPDATE statement, the server adds referenced
      fields to the select list. Part of the code that does this
      transformation is shared between implementations of
      the DEFAULT(col) function and the DEFAULT keyword (in
      the col=DEFAULT expression), and an implementation of
      the DEFAULT keyword is incomplete.
      
      
      mysql-test/r/default.result:
        Added test case for bug #39002.
      mysql-test/t/default.test:
        Added test case for bug #39002.
      sql/item.cc:
        The Item_default_value::transform() function has been
        modified to take into account the fact that the DEFAULT
        keyword has no arguments unlike the DEFAULT(col) function
        that always has an argument.
      0e9cba18
  6. 20 Aug, 2008 1 commit
    • Sergey Glukhov's avatar
      Bug#38291 memory corruption and server crash with view/sp/function · 1b39f28f
      Sergey Glukhov authored
      Send_field.org_col_name has broken value on secondary execution.
      It happens when result field is created from the field which belongs to view
      due to forgotten assignment of some Send_field attributes. 
      The fix:
      set Send_field.org_col_name,org_table_name with correct value during Send_field intialization.
      
      mysql-test/r/metadata.result:
        result fix
        The result file was changed because now forgotten attributes are properly set.
      mysql-test/r/sp.result:
        test result
      mysql-test/t/sp.test:
        test case
      sql/item.cc:
        Send_field.org_col_name has broken value on secondary execution.
        It happens when result field is created from the field which belongs to view
        due to forgotten assignment of some Send_field attributes. 
        The fix:
        set Send_field.org_col_name,org_table_name with correct value during Send_field intialization.
      tests/mysql_client_test.c:
        test case fix
        The test was changed because now forgotten attributes are properly set.
      1b39f28f
  7. 30 Jul, 2008 1 commit
    • Georgi Kodinov's avatar
      Bug#37662 nested if() inside sum() is parsed in exponential time · 03805cbb
      Georgi Kodinov authored
            
      min() and max() functions are implemented in MySQL as macros.
      This means that max(a,b) is expanded to: ((a) > (b) ? (a) : (b))
      Note how 'a' is quoted two times.
      Now imagine 'a' is a recursive function call that's several 10s of levels deep.
      And the recursive function does max() with a function arg as well to dive into
      recursion.
      This means that simple function call can take most of the clock time.
      Identified and fixed several such calls to max()/min() : including the IF() 
      sql function implementation.
      
      mysql-test/r/func_if.result:
        Bug#37662 test case
      mysql-test/t/func_if.test:
        Bug#37662 test case
      sql/item.cc:
        Bug#37662 don't call expensive functions as arguments to min/max
      sql/item_cmpfunc.cc:
        Bug#37662 don't call expensive functions as arguments to min/max
      sql/item_func.cc:
        Bug#37662 don't call expensive functions as arguments to min/max
      03805cbb
  8. 27 Jun, 2008 3 commits
    • Gleb Shchepa's avatar
      backport from 6.0 · 4e9d0160
      Gleb Shchepa authored
            
      Bug#35658 (An empty binary value leads to mysqld crash)
              
      Before this fix, the following token
        b''
      caused the parser to crash when reading the binary value from the empty string.
      The crash was caused by:
        ptr+= max_length - 1;
      because max_length is unsigned and was 0, causing an overflow.
              
      With this fix, an empty binary literal b'' is parsed as a binary value 0,
      in Item_bin_string.
      
      mysql-test/r/varbinary.result:
        Bug#35658 (An empty binary value leads to mysqld crash)
      mysql-test/t/varbinary.test:
        Bug#35658 (An empty binary value leads to mysqld crash)
      sql/item.cc:
        Bug#35658 (An empty binary value leads to mysqld crash)
      4e9d0160
    • Gleb Shchepa's avatar
      buckport to 5.1.26 from 6.0 · c5f3597f
      Gleb Shchepa authored
      Bug#35658 (An empty binary value leads to mysqld crash)
        
      Before this fix, the following token
        b''
      caused the parser to crash when reading the binary value from the empty string.
      The crash was caused by:
        ptr+= max_length - 1;
      because max_length is unsigned and was 0, causing an overflow.
        
      With this fix, an empty binary literal b'' is parsed as a binary value 0,
      in Item_bin_string.
      
      mysql-test/r/varbinary.result:
        Bug#35658 (An empty binary value leads to mysqld crash)
      mysql-test/t/varbinary.test:
        Bug#35658 (An empty binary value leads to mysqld crash)
      sql/item.cc:
        Bug#35658 (An empty binary value leads to mysqld crash)
      c5f3597f
    • Gleb Shchepa's avatar
      backport to 5.1 from 6.0 · 4b8e4637
      Gleb Shchepa authored
      Bug#35658 (An empty binary value leads to mysqld crash)
        
      Before this fix, the following token
        b''
      caused the parser to crash when reading the binary value from the empty string.
      The crash was caused by:
        ptr+= max_length - 1;
      because max_length is unsigned and was 0, causing an overflow.
        
      With this fix, an empty binary literal b'' is parsed as a binary value 0,
      in Item_bin_string.
      
      mysql-test/r/varbinary.result:
        Bug#35658 (An empty binary value leads to mysqld crash)
      mysql-test/t/varbinary.test:
        Bug#35658 (An empty binary value leads to mysqld crash)
      sql/item.cc:
        Bug#35658 (An empty binary value leads to mysqld crash)
      4b8e4637
  9. 17 May, 2008 1 commit
    • unknown's avatar
      Implement some code review fixes for the fix for Bug#27430 · 724f1d9c
      unknown authored
      "Crash in subquery code when in PS and table DDL changed after PREPARE"
      
      
      include/my_sys.h:
        Add two new flags for my_error(). These flags help parameterize
        behavoiur of my_message_sql()
      sql/item.cc:
        Update comments.
        Fix a typo in Item_param::set_param_type_and_swap_value()
      sql/mysqld.cc:
        Implement two additional flags for my_error():
         - if ME_NO_SP_HANDLER is specified, ignore stored procedure continue/
            exit handlers
         - if ME_NO_WARNING_FOR_ERROR is specified, do not push warning
      sql/sql_base.cc:
        Update comments.
        Rename a few methods.
      sql/sql_class.h:
        Update and improve comments.
      sql/sql_prepare.cc:
        Update comments.
        Style changes.
      sql/table.h:
        Update comments.
        Style changes.
        Rename a few methods.
      tests/mysql_client_test.c:
        Zero the bind array, to follow C API requirements.
      724f1d9c
  10. 21 Apr, 2008 1 commit
    • unknown's avatar
      BUG#36139 "float, zerofill, crash with subquery" · 84182140
      unknown authored
      - Make convert_zerofill_number_to_string() take into account that the 
        constant it is converting may evaluate to NULL.
      
      
      mysql-test/r/subselect.result:
        BUG#36139 "float, zerofill, crash with subquery"
        - Testcase
      mysql-test/t/subselect.test:
        BUG#36139 "float, zerofill, crash with subquery"
        - Testcase
      84182140
  11. 08 Apr, 2008 1 commit
    • unknown's avatar
      Tentative implementation of · 486e74c1
      unknown authored
      WL#4165 Prepared statements: validation 
      WL#4166 Prepared statements: automatic re-prepare
      Fixes
      Bug#27430 Crash in subquery code when in PS and table DDL changed after PREPARE
      Bug#27690 Re-execution of prepared statement after table was replaced with a view crashes
      Bug#27420 A combination of PS and view operations cause error + assertion on shutdown
      
      The basic idea of the patch is to keep track of table metadata between
      prepared statement prepare and execute. If some table used in the statement
      has changed, the prepared statement is re-prepared before execution.
      
      See WL#4165 and WL#4166 contents and comments in the code for details
      of the implementation.
      
      
      include/my_global.h:
        Remove 'register' keyword to avoid warnings when swapping large structures
        that don't fit into a register. Any modern compiler is capable of placing
        a variable in a register when that would benefit performance.
      mysql-test/r/ps_1general.result:
        Update test results: since now we re-prepare automatically,
        more correct results are produced in prepare-ddl-execute scenario.
      mysql-test/r/query_cache_merge.result:
        Ensure that the table definition cache is large enough for
        the test to pass in --ps-protocol
      mysql-test/r/trigger.result:
        Update test results to reflect automatic statement reprepare.
      mysql-test/t/disabled.def:
        Enable ps_ddl.test, which now passes.
      mysql-test/t/ps_1general.test:
        Since now we re-execute prepared statements after DDL successfully,
        change the test to produce repeatable results. Remove expectancy of
        an error in one place where now we automatically reprepare the prepared
        statement.
      mysql-test/t/query_cache_merge.test:
        Ensure the table definition cache is large enough for the test to pass
        in --ps-protocol
      mysql-test/t/trigger.test:
        Sinc
      sql/item.cc:
        Implement Item_param "copy" functionality, used at re-prepare of
        a prepared statement.
        We copy the type of the original parameter, and move the assigned value,
        if any. Sic, the value is "moved", since it can be quite big --
        e.g. in case we deal with a LONG DATA parameter.
        It's essential to move the value from the old parameter since
        at the time of re-prepare the client packet with the necessary information
        may be not available.
      sql/item.h:
        Declare a new method used for reprepare.
      sql/my_decimal.h:
        Implement "swap()" functionality of class my_decimal to be
        able to easily swap two decimal values.
      sql/mysql_priv.h:
        Declare enum_metadata_type.
      sql/mysqld.cc:
        Implement a status variable for the number of reprepared statements.
      sql/sql_base.cc:
        Implement metadata version validation.
      sql/share/errmsg.txt:
        Add two new error messages: ER_NEED_REPREPARE and ER_PS_REBIND.
        The first error (theoretically) never reaches the user.
        It is issued by the metadata validation framework when a metadata version
        has changed between prepare and execute. Later on it's intercepted
        and the statement is automatically re-prepared. Only if the error
        has occurred repeatedly MAX_REPREPARE_ATTEMTS (3) times do we
        return it to the user.
        
        The second error is issued when after re-prepare we discover
        that the metadata we sent over to the client using the binary
        protocol differs drammatically from the new result set metadata 
        that the reprepared statement produces (e.g. number of result
        set columns is different).
      sql/sql_class.cc:
        Implement metadata version validation framework.
      sql/sql_class.h:
        Declarations for metadata version validation framework.
      sql/sql_parse.cc:
        Mark commands for which we must invalidate and reprepare a prepared
        statement when metadata has changed.
      sql/sql_prepare.cc:
        Implement WL#4165 and WL#4166 (limited support of metadata validation
        and re-prepare).
      sql/table.h:
        Implement metadata validation.
      tests/mysql_client_test.c:
        Add a test case for WL#4166
      486e74c1
  12. 27 Mar, 2008 1 commit
    • unknown's avatar
      Bug#27219: Aggregate functions in ORDER BY. · 9e65582b
      unknown authored
      Mixing aggregate functions and non-grouping columns is not allowed in the
      ONLY_FULL_GROUP_BY mode. However in some cases the error wasn't thrown because
      of insufficient check.
      
      In order to check more thoroughly the new algorithm employs a list of outer
      fields used in a sum function and a SELECT_LEX::full_group_by_flag.
      Each non-outer field checked to find out whether it's aggregated or not and
      the current select is marked accordingly.
      All outer fields that are used under an aggregate function are added to the
      Item_sum::outer_fields list and later checked by the Item_sum::check_sum_func
      function.
      
      
      mysql-test/t/group_by.test:
        Added a test case for the bug#27219: Aggregate functions in ORDER BY.
      mysql-test/r/group_by.result:
        Added a test case for the bug#27219: Aggregate functions in ORDER BY.
      sql/sql_select.cc:
        Bug#27219: Aggregate functions in ORDER BY.
        Implementation of new check for mixing non aggregated fields and aggregation
        function in the ONLY_FULL_GROUP_BY mode.
      sql/sql_lex.cc:
        Bug#27219: Aggregate functions in ORDER BY.
        Initialization of the full_group_by_flag bitmap.
        SELECT_LEX::test_limit function doesn't reset ORDER BY
        clause anymore.
      sql/sql_lex.h:
        Bug#27219: Aggregate functions in ORDER BY.
        The full_group_by_flag is added to the SELECT_LEX class.
      sql/item_sum.h:
        Bug#27219: Aggregate functions in ORDER BY.
        The outer_fields list is added to the Item_sum class.
      sql/mysql_priv.h:
        Bug#27219: Aggregate functions in ORDER BY.
        Defined a set of constants used in the new check for mixing non aggregated
        fields and sum functions in the ONLY_FULL_GROUP_BY_MODE.
      sql/item_subselect.cc:
        Bug#27219: Aggregate functions in ORDER BY.
        The Item_in_subselect::select_in_like_transformer function now drops
        ORDER BY clause in all selects in a subquery.
      sql/item_sum.cc:
        Bug#27219: Aggregate functions in ORDER BY.
        Now the Item_sum::check_sum_func function now checks whether fields in the
        outer_fields list are aggregated or not and marks selects accordingly.
      sql/item.cc:
        Bug#27219: Aggregate functions in ORDER BY.
        Now the Item_field::fix_fields function checks whether the field is aggregated
        or not and marks its select_lex accordingly.
      9e65582b
  13. 14 Mar, 2008 1 commit
    • unknown's avatar
      Fixed bug #34763. · a000e8f0
      unknown authored
      Queries like:
      
        SELECT ROW(1, 2) IN (SELECT t1.a, 2)
          FROM t1 GROUP BY t1.a
      
      or 
      
        SELECT ROW(1, 2) IN (SELECT t1.a, 2 FROM t2)
          FROM t1 GROUP BY t1.a
      
      lead to assertion failure in the
      Item_in_subselect::row_value_transformer method in debugging
      build, or to unexpected error message in release build:
      
        ERROR 1247 (42S22): Reference '<list ref>' not supported (forward
                            reference in item list)
      
      Unexpected error message and assertion failure have been
      eliminated.
      
      
      mysql-test/r/subselect3.result:
        Added test case for bug #34763.
      mysql-test/t/subselect3.test:
        Added test case for bug #34763.
      sql/item.cc:
        Fixed bug #34763.
        The Item_ref::fix_fields method has been modified to silently
        ignore not fixed outer references: by the definition, those
        references should be fixed later by the call to the
        fix_inner_refs function.
      sql/item_subselect.cc:
        Fixed bug #34763.
        The Item_in_subselect::row_value_transformer method has been
        modified to eliminate assertion failure on not fixed outer
        references: by the definition those references are allowed in
        this context and should be fixed later by the call to the
        fix_inner_refs function.
      a000e8f0
  14. 28 Feb, 2008 3 commits
    • unknown's avatar
      Post-merge fix for Bug 33851. The initialization order of members · bc489574
      unknown authored
      must match the order which they were declared in the class definition. 
      
      
      sql/item.cc:
        Fix initialization order, parameter was the last one declared.
      bc489574
    • unknown's avatar
      Bug#33851 Passing UNSIGNED param to EXECUTE returns ERROR 1210 · 8d4c99e3
      unknown authored
      The problem is that passing anything other than a integer to a limit
      clause in a prepared statement would fail. This limitation was introduced
      to avoid replication problems (e.g: replicating the statement with a
      string argument would cause a parse failure in the slave).
      
      The solution is to convert arguments to the limit clause to a integer
      value and use this converted value when persisting the query to the log.
      
      
      mysql-test/r/limit.result:
        Update test case result.
      mysql-test/r/ps.result:
        Add test case result for Bug#33851
      mysql-test/r/rpl_user_variables.result:
        Test case result for replication of prepared statement with
        limit clause.
      mysql-test/t/limit.test:
        Test parameters to limit clause.
      mysql-test/t/ps.test:
        Add test case for Bug#33851
      mysql-test/t/rpl_user_variables.test:
        Test replication of a parameter which value is converted.
      sql/item.cc:
        Convert value to integer if it's a parameter to a limit clause.
      sql/item.h:
        Flag signal that item is a parameter to a limit clause.
      sql/item_func.cc:
        Const member functions, object is not mutated.
      sql/sql_class.h:
        Const member functions, object is not mutated.
      sql/sql_yacc.yy:
        Flag that item is a parameter to a limit clause.
      8d4c99e3
    • unknown's avatar
      Bug#34749: Server crash when using NAME_CONST() with an aggregate function · 4715b478
      unknown authored
      NAME_CONST('whatever', -1) * MAX(whatever) bombed since -1 was
      not seen as constant, but as FUNCTION_UNARY_MINUS(constant)
      while we are at the same time pretending it was a basic const
      item. This confused the aggregate handlers in exciting ways.
      We now make NAME_CONST() behave more consistently.
      
      
      mysql-test/r/func_misc.result:
        show that a combination of NAME_CONST('x', -y) and an aggregate
        no longer crashes the server.
      mysql-test/t/func_misc.test:
        show that a combination of NAME_CONST('x', -y) and an aggregate
        no longer crashes the server.
      sql/ha_ndbcluster_cond.cc:
        tell cluster about "new" function type NEG_FUNC.
        (this was previous identified as UNKNOWN_FUNC,
        so we just handle it the same way, that's all.)
      sql/ha_ndbcluster_cond.h:
        tell cluster about "new" function type NEG_FUNC.
        (this was previous identified as UNKNOWN_FUNC,
        so we just handle it the same way, that's all.)
      sql/item.cc:
        make NAME_CONST() transparent in that type() of
        -constant is that of constant, not that of unary
        minus (id est, FUNC_ITEM).
      sql/item.h:
        Move constructor to item.cc
      sql/item_func.h:
        Revert Bug#30832; we can apply the magic more narrowly
        (just for NAME_CONST() rather than all Item_func_neg).
        
        Introduce new function type "NEG_FUNC."
      4715b478
  15. 22 Feb, 2008 1 commit
    • unknown's avatar
      Fix for Bug#30217: Views: changes in metadata behaviour · 367d37b2
      unknown authored
      between 5.0 and 5.1.
        
      The problem was that in the patch for Bug#11986 it was decided
      to store original query in UTF8 encoding for the INFORMATION_SCHEMA.
      This approach however turned out to be quite difficult to implement
      properly. The main problem is to preserve the same IS-output after
      dump/restore.
        
      So, the fix is to rollback to the previous functionality, but also
      to fix it to support multi-character-set-queries properly. The idea
      is to generate INFORMATION_SCHEMA-query from the item-tree after
      parsing view declaration. The IS-query should:
        - be completely in UTF8;
        - not contain character set introducers.
        
      For more information, see WL4052.
      
      
      mysql-test/include/ddl_i18n.check_views.inc:
        Add a test case for Bug#30217.
      mysql-test/r/ddl_i18n_koi8r.result:
        Update result file.
      mysql-test/r/ddl_i18n_utf8.result:
        Update result file.
      mysql-test/r/information_schema.result:
        Update result file.
      mysql-test/r/information_schema_db.result:
        Update result file.
      mysql-test/r/mysqldump.result:
        Update result file.
      mysql-test/r/show_check.result:
        Update result file.
      mysql-test/t/ddl_i18n_koi8r.test:
        Add a test case for Bug#30217.
      mysql-test/t/ddl_i18n_utf8.test:
        Add a test case for Bug#30217.
      mysql-test/t/mysqldump.test:
        Add a test case for Bug#30217.
      sql/ha_ndbcluster.cc:
        Add a parameter to print().
      sql/item.cc:
        1. Add a parameter to print().
        2. Item_string::print():
              - Do not append character set introducer to the text literal
                if we're building a query for INFORMATION_SCHEMA;
              - Convert text literal to UTF8 if we're building a query
                for INFORMATION_SCHEMA.
      sql/item.h:
        Add a parameter to print().
      sql/item_cmpfunc.cc:
        Add a parameter to print().
      sql/item_cmpfunc.h:
        Add a parameter to print().
      sql/item_func.cc:
        Add a parameter to print().
      sql/item_func.h:
        Add a parameter to print().
      sql/item_geofunc.h:
        Add a parameter to print().
      sql/item_row.cc:
        Add a parameter to print().
      sql/item_row.h:
        Add a parameter to print().
      sql/item_strfunc.cc:
        Add a parameter to print().
      sql/item_strfunc.h:
        Add a parameter to print().
      sql/item_subselect.cc:
        Add a parameter to print().
      sql/item_subselect.h:
        Add a parameter to print().
      sql/item_sum.cc:
        Add a parameter to print().
      sql/item_sum.h:
        Add a parameter to print().
      sql/item_timefunc.cc:
        Add a parameter to print().
      sql/item_timefunc.h:
        Add a parameter to print().
      sql/mysql_priv.h:
        Add a parameter to print().
      sql/sp_head.cc:
        Add a parameter to print().
      sql/sql_lex.cc:
        Add a parameter to print().
      sql/sql_lex.h:
        Add a parameter to print().
      sql/sql_parse.cc:
        Add a parameter to print().
      sql/sql_select.cc:
        Add a parameter to print().
      sql/sql_show.cc:
        Add a parameter to print().
      sql/sql_test.cc:
        Add a parameter to print().
      sql/sql_view.cc:
        Build INFORMATION_SCHEMA query from Item-tree.
      sql/sql_yacc.yy:
        Build INFORMATION_SCHEMA query from Item-tree.
      sql/table.h:
        Add a parameter to print().
      367d37b2
  16. 19 Feb, 2008 1 commit
    • unknown's avatar
      BUG#34289 - Incorrect NAME_CONST substitution in stored procedures · 4181bf0b
      unknown authored
                  breaks replication
      
      NAME_CONST() didn't replicate constant character set and collation
      correctly.
      
      With this fix NAME_CONST() inherits collation from the value argument.
      
      
      mysql-test/r/func_misc.result:
        A test case for BUG#34289.
      mysql-test/t/func_misc.test:
        A test case for BUG#34289.
      sql/item.cc:
        Inherit collation from value argument.
      4181bf0b
  17. 18 Feb, 2008 1 commit
  18. 15 Feb, 2008 1 commit
    • unknown's avatar
      Bug #31887: DML Select statement not returning same results · 72e48bf2
      unknown authored
      when executed in version 5
      
      Zero fill is a field attribute only. So we can't always 
      propagate  constants for zerofill fields : the values and 
      expression results don't have that flag.
      
      Fixed by converting the const value to a string and 
      using that in const propagation when the context allows it. 
      Disable const propagation for fields with ZEROFILL flag in
      all the other cases.
      
      
      mysql-test/r/compare.result:
        Bug #31887: test case
      mysql-test/t/compare.test:
        Bug #31887: test case
      sql/item.cc:
        Bug #31887: If the context allows conversion
        of an int constant to a zero-filled string constant
        put the string constant instead of the int constant
        when doing const propagation
      sql/mysql_priv.h:
        Bug #31887: a macro to get all the Field_num
        descendant fields.
      72e48bf2
  19. 12 Feb, 2008 2 commits
    • unknown's avatar
      Fix for Bug#32538: View definition picks up character set, · 3a8c0e34
      unknown authored
      but not collation.
      
      The problem here was that text literals in a view were always
      dumped with character set introducer. That lead to loosing
      collation information.
      
      The fix is to dump character set introducer only if it was
      in the original query. That is now possible because there 
      is no problem any more of loss of character set of string
      literals in views -- after WL#4052 the view is dumped 
      in the original character set.
      
      
      mysql-test/r/case.result:
        Update result file.
      mysql-test/r/compress.result:
        Update result file.
      mysql-test/r/ctype_collate.result:
        Update result file.
      mysql-test/r/date_formats.result:
        Update result file.
      mysql-test/r/ddl_i18n_koi8r.result:
        Update result file.
      mysql-test/r/ddl_i18n_utf8.result:
        Update result file.
      mysql-test/r/fulltext.result:
        Update result file.
      mysql-test/r/func_crypt.result:
        Update result file.
      mysql-test/r/func_encrypt.result:
        Update result file.
      mysql-test/r/func_if.result:
        Update result file.
      mysql-test/r/func_in.result:
        Update result file.
      mysql-test/r/func_like.result:
        Update result file.
      mysql-test/r/func_regexp.result:
        Update result file.
      mysql-test/r/func_set.result:
        Update result file.
      mysql-test/r/func_str.result:
        Update result file.
      mysql-test/r/func_time.result:
        Update result file.
      mysql-test/r/gis.result:
        Update result file.
      mysql-test/r/group_min_max.result:
        Update result file.
      mysql-test/r/mysqldump.result:
        Update result file.
      mysql-test/r/negation_elimination.result:
        Update result file.
      mysql-test/r/null.result:
        Update result file.
      mysql-test/r/select.result:
        Update result file.
      mysql-test/r/show_check.result:
        Update result file.
      mysql-test/r/sp-code.result:
        Update result file.
      mysql-test/r/ssl.result:
        Update result file.
      mysql-test/r/ssl_compress.result:
        Update result file.
      mysql-test/r/subselect.result:
        Update result file.
      mysql-test/r/temp_table.result:
        Update result file.
      mysql-test/r/type_blob.result:
        Update result file.
      mysql-test/r/view.result:
        Update result file.
      mysql-test/suite/binlog/r/binlog_stm_blackhole.result:
        Update result file.
      mysql-test/suite/rpl/r/rpl_get_lock.result:
        Update result file.
      mysql-test/suite/rpl/r/rpl_master_pos_wait.result:
        Update result file.
      mysql-test/t/view.test:
        Add a test case for Bug#32538.
      sql/item.cc:
        Do not dump character set introducer if it was not specified
        explicitly in the original query.
      sql/item.h:
        Add 'cs_specified' property to Item_string.
      sql/sql_yacc.yy:
        Set Item_string::cs_specified property to TRUE
        when character set introducer is explicitly specified.
      3a8c0e34
    • unknown's avatar
      Fix for bug #33389: Selecting from a view into a table from within SP · eee4d8cc
      unknown authored
                          or trigger crashes server
      
      Under some circumstances a combination of VIEWs, subselects with outer
      references and PS/SP/triggers could lead to use of uninitialized memory
      and server crash as a result.
      
      Fixed by changing the code in Item_field::fix_fields() so that in cases
      when the field is a VIEW reference, we first check whether the field
      is also an outer reference, and mark it appropriately before returning.
      
      
      mysql-test/r/view.result:
        Added a test case for bug #33389.
      mysql-test/t/view.test:
        Added a test case for bug #33389.
      sql/item.cc:
        In cases when in Item_field::fix_fields() from_field is a view reference,
        do not return too early, i.e. before marking the reference as an outer
        one when needed.
      eee4d8cc
  20. 08 Feb, 2008 2 commits
    • unknown's avatar
      Manual merge of Bug 33798 · bd76a175
      unknown authored
      mysql-test/extra/binlog_tests/binlog.test:
        Manual merge of binlog test case for Bug#33798
      mysql-test/suite/binlog/r/binlog_row_binlog.result:
        Add test case result for Bug#33798
      mysql-test/suite/binlog/r/binlog_stm_binlog.result:
        Add test case result for Bug#33798
      sql/item.cc:
        Use new method which accepts a unsigned flag.
      bd76a175
    • unknown's avatar
      Bug#33798 prepared statements improperly handle large unsigned ints · cea021da
      unknown authored
      The unsignedness of large integer user variables was not being
      properly preserved when feeded to prepared statements. This was
      happening because the unsigned flags wasn't being updated when
      converting the user variable is converted to a parameter.
      
      The solution is to copy the unsigned flag when converting the
      user variable to a parameter and take the unsigned flag into
      account when converting the integer to a string.
      
      
      mysql-test/r/binlog.result:
        Add test case result for Bug#33798
      mysql-test/r/ps.result:
        Add test case result for Bug#33798
      mysql-test/t/binlog.test:
        Add test case for Bug#33798
      mysql-test/t/ps.test:
        Add test case for Bug#33798
      sql/item.cc:
        Take the unsigned flag into account when converting the
        user variable.
      cea021da
  21. 27 Jan, 2008 1 commit
    • unknown's avatar
      Fixed bug #33833. · 7dc4e4a5
      unknown authored
      Two disjuncts containing equalities of the form key=const1 and key=const2 can
      be merged into one if const1 is equal to const2. To check it the common 
      collation of the constants were used rather than the collation of the field key.
      For example when the default collation of the constants was cases insensitive
      while the collation of the field was case sensitive, then two or-ed equality 
      predicates key='b' and key='B' incorrectly were merged into one f='b'. As a 
      result ref access was used instead of range access and wrong result sets were 
      returned in many cases. 
      Fixed the problem by comparing constant in the or-ed predicate with collation of
      the key field.
      
      
      mysql-test/r/range.result:
        Added a test case for bug #33833.
      mysql-test/t/range.test:
        Added a test case for bug #33833.
      sql/item.cc:
        Fixed bug #33833.
        Added the method eq_by_collation that compares two items almost as 
        the method Item::eq, but it rather enforces a given collation for
        the comparison.
      sql/item.h:
        Fixed bug #33833.
        Added the method eq_by_collation that compares two items almost as 
        the method Item::eq, but it rather enforces a given collation for
        the comparison.
      7dc4e4a5
  22. 11 Jan, 2008 1 commit
    • unknown's avatar
      Bug#31797: error while parsing subqueries -- WHERE is parsed as HAVING · 2771cf8b
      unknown authored
      The name resolution for correlated subqueries and HAVING clauses
      failed to distinguish which of two was being performed when there 
      was a reference to an outer aliased field.
      Fixed by adding the condition that HAVING clause name resulotion
      is being performed.
      
      
      mysql-test/r/group_by.result:
        Bug#31797: Test result
      mysql-test/t/group_by.test:
        Bug#31797: Test case
      sql/item.cc:
        Bug#31797: 
        Corrected function comment.
        The fix, raising the error is restricted to HAVING name resolution.
      2771cf8b
  23. 21 Dec, 2007 1 commit
    • unknown's avatar
      Bug #33256: CREATE ... SELECT creates obsolete table · cb3cfe74
      unknown authored
       w/ Field_date instead of Field_newdate
        
      Field_date was still used in temp table creation.
      Fixed by using Field_newdate consistently throughout the server
      except when reading tables defined with older MySQL version.
      No test suite is possible because both Field_date and Field_newdate
      return the same values in all the metadata calls. 
      
      
      mysql-test/r/type_decimal.result:
        Bug #33256: removed redundant warnings
      sql/field.h:
        Bug #33256: Add a constructor similar to Field_date::Field_date()
      sql/item.cc:
        Bug #33256: Use Field_newdate instead of Field_date 
        for all temp tables and CREATE .. SELECT
      sql/item_sum.cc:
        Bug #33256: Use Field_newdate instead of Field_date 
        for all temp tables and CREATE .. SELECT
      sql/item_timefunc.cc:
        Bug #33256: Use Field_newdate instead of Field_date 
        for all temp tables and CREATE .. SELECT
      sql/item_timefunc.h:
        Bug #33256: Use Field_newdate instead of Field_date 
        for all temp tables and CREATE .. SELECT
      cb3cfe74
  24. 11 Dec, 2007 1 commit
    • unknown's avatar
      Bug#32848: Data type conversion bug in union subselects in MySQL 5.0.38 · 8870d015
      unknown authored
      There were two problems when inferring the correct field types resulting from
      UNION queries.
      - If the type is NULL for all corresponding fields in the UNION, the resulting 
        type would be NULL, while the type is BINARY(0) if there is just a single 
        SELECT NULL.
      - If one SELECT in the UNION uses a subselect, a temporary table is created
        to represent the subselect, and the result type defaults to a STRING type,
        hiding the fact that the type was unknown(just a NULL value).
      Fixed by remembering whenever a field was created from a NULL value and pass
      type NULL to the type coercion if that is the case, and creating a string field
      as result of UNION only if the type would otherwise be NULL.
      
      
      mysql-test/r/union.result:
        Bug#32848: Test result
      mysql-test/t/union.test:
        Bug#32848: Test case
      sql/field.cc:
        Bug#32848: Initialization of new field
      sql/field.h:
        Bug#32848: New member to record when a field was created from a NULL value.
      sql/item.cc:
        Bug#32848: 
        A field created from a NULL value will submit NULL as type to the 
        type coercion procedure.
        If Item_type_holder has not inferred the correct type after processing all
        SELECTs in a UNION, a string field is created.
      sql/sql_select.cc:
        Bug#32848: Recording when a field is created from a NULL value.
      8870d015
  25. 08 Dec, 2007 1 commit
    • unknown's avatar
      Fixed bug #27545. · 5d71f3d8
      unknown authored
      Both arguments of the function NAME_CONST must be constant expressions.
      This constraint is checked in the Item_name_const::fix_fields method. 
      Yet if the argument of the function was not a constant expression no
      error message was reported. As a result the client hanged waiting for a
      response.
      Now the function Item_name_const::fix_fields reports an error message
      when any of the additional context conditions imposed on the function
      NAME_CONST is not satisfied. 
      
      
      mysql-test/r/func_misc.result:
        Added a test case for bug #26545.
      mysql-test/t/func_misc.test:
        Added a test case for bug #26545.
      5d71f3d8
  26. 27 Nov, 2007 1 commit
    • unknown's avatar
      Fix for bug #32559: connection hangs on query with name_const · b98c21c7
      unknown authored
      Problem: passing a non-constant name to the NAME_CONST function results in a crash.
      
      Fix: check the NAME_CONST name argument; return fake item type if we got
      non-constant argument(s).
      
      
      mysql-test/r/func_misc.result:
        Fix for bug #32559: connection hangs on query with name_const
          - test result.
      mysql-test/t/func_misc.test:
        Fix for bug #32559: connection hangs on query with name_const
          - test case.
      sql/item.cc:
        Fix for bug #32559: connection hangs on query with name_const
          - Item_name_const::type() now returns NULL_ITEM if non-constant arguments 
            were used to create the item to avoid wrong type casting.
      sql/item.h:
        Fix for bug #32559: connection hangs on query with name_const
          - NAME_CONST name argument checked for invariability.
      b98c21c7
  27. 20 Nov, 2007 1 commit
    • unknown's avatar
      Bug #32400: Complex SELECT query returns correct result · 5a49b5f0
      unknown authored
       only on some occasions
      
      Referencing an element from the SELECT list in a WHERE 
      clause is not permitted. The namespace of the WHERE
      clause is the table columns only. This was not enforced
      correctly when resolving outer references in sub-queries.
      
      Fixed by not allowing references to aliases in a 
      sub-query in WHERE.
      
      
      mysql-test/include/ps_query.inc:
        Bug #32400: fixed old test queries
      mysql-test/r/ps_2myisam.result:
        Bug #32400: fixed old test queries
      mysql-test/r/ps_3innodb.result:
        Bug #32400: fixed old test queries
      mysql-test/r/ps_4heap.result:
        Bug #32400: fixed old test queries
      mysql-test/r/ps_5merge.result:
        Bug #32400: fixed old test queries
      mysql-test/r/ps_6bdb.result:
        Bug #32400: fixed old test queries
      mysql-test/r/ps_7ndb.result:
        Bug #32400: fixed old test queries
      mysql-test/r/subselect.result:
        Bug #32400: test case
      mysql-test/t/subselect.test:
        Bug #32400: test case
      sql/item.cc:
        Bug #32400: don't allow references to aliases in WHERE
      tests/mysql_client_test.c:
        Bug #32400: fixed old test queries
      5a49b5f0
  28. 13 Nov, 2007 1 commit
    • unknown's avatar
      Bug #31562: HAVING and lower case · 5dc81f4f
      unknown authored
      The columns in HAVING can reference the GROUP BY and 
      SELECT columns. There can be "table" prefixes when
      referencing these columns. And these "table" prefixes
      in HAVING use the table alias if available.
      This means that table aliases are subject to the same
      storage rules as table names and are dependent on 
      lower_case_table_names in the same way as the table 
      names are.
      Fixed by :
      1. Treating table aliases as table names
      and make them lowercase when printing out the SQL
      statement for view persistence.
      2. Using case insensitive comparison for table 
      aliases when requested by lower_case_table_names
      
      
      mysql-test/r/lowercase_view.result:
        Bug #31562: test case
      mysql-test/t/lowercase_view.test:
        Bug #31562: test case
      sql/item.cc:
        Bug #31562: lower_case_table_name contious comparison
        when searching in GROUP BY
      sql/sql_base.cc:
        Bug #31562: lower_case_table_name contious comparison
        when searching in SELECT
      sql/sql_select.cc:
        Bug #31562: treat table aliases as table names
        and make them lowercase when printing
      5dc81f4f
  29. 10 Nov, 2007 1 commit
    • unknown's avatar
      Fixed bug #28076: inconsistent binary/varbinary comparison. · 419eb9aa
      unknown authored
      After adding an index the <VARBINARY> IN (SELECT <BINARY> ...)
      clause returned a wrong result: the VARBINARY value was illegally padded
      with zero bytes to the length of the BINARY column for the index search.
      (<VARBINARY>, ...) IN (SELECT <BINARY>, ... ) clauses are affected too.
      
      
      sql/item.cc:
        Fixed bug #28076.
        The Item_cache_str::save_in_field method has been overloaded
        to check cached values for an illegal padding before the saving
        into a field.
      sql/item.h:
        Fixed bug #28076.
        The Item_cache_str::is_varbinary flag has been added and the
        Item_cache_str::save_in_field method has been overloaded to prevent
        cached values from an illegal padding when saving in fields.
        The signature of the Item_cache::get_cache method has been
        changed to accept pointers to Item instead of Item_result
        values.
      sql/item_cmpfunc.cc:
        Fixed bug #28076.
        The Item_in_optimizer::fix_left method has been modified to
        to call Item_cache::get_cache in a new manner.
      sql/item_subselect.cc:
        Fixed bug #28076.
        The subselect_indexsubquery_engine::exec method has been
        modified to take into account field conversion errors
        (copy&paste from subselect_uniquesubquery_engine::exec).
      sql/sp_rcontext.cc:
        Fixed bug #28076.
        The sp_rcontext::create_case_expr_holder method has been
        modified to call Item_cache::get_cache in a new manner.
      sql/sp_rcontext.h:
        Fixed bug #28076.
        The sp_rcontext::create_case_expr_holder method signature
        has been modified to pass Item pointers to the
        Item_cache::get_cache method.
      sql/sql_class.cc:
        Fixed bug #28076.
        The select_max_min_finder_subselect::send_data method has been
        modified to call Item_cache::get_cache in a new manner.
      mysql-test/t/subselect.test:
        Added test case for bug #28076.
      mysql-test/r/subselect.result:
        Added test case for bug #28076.
      419eb9aa
  30. 23 Oct, 2007 1 commit
    • unknown's avatar
      BUG#31450: Query causes error 1048 · 7c345d45
      unknown authored
      - Let Item::save_in_field() call set_field_to_null_with_conversions() 
        for decimal type, like this is done for the other item result types.
      
      
      mysql-test/r/type_decimal.result:
        BUG#31450: Query causes error 1048: testcase
      mysql-test/t/type_decimal.test:
        BUG#31450: Query causes error 1048: testcase
      7c345d45
  31. 22 Oct, 2007 1 commit
    • unknown's avatar
      Bug #28687: Search fails on '0000-00-00' date after sql_mode change · af3764b1
      unknown authored
      When doing indexed search the server constructs a key image for 
      faster comparison to the stored keys. While doing that it must not
      perform (and stop if they fail) the additional date checks that can 
      be turned on by the SQL mode because there already may be values in 
      the table that don't comply with the error checks.
      Fixed by ignoring these SQL mode bits while making the key image.
      
      
      mysql-test/r/type_date.result:
        Bug #28687: test case
      mysql-test/t/type_date.test:
        Bug #28687: test case
      sql/item.cc:
        Bug #28687: no invalid date warnings
      af3764b1
  32. 21 Oct, 2007 1 commit
    • unknown's avatar
      Bug #28550 "Potential bugs related to the return type of the CHAR function". · 0ca57427
      unknown authored
        
      Since, as of MySQL 5.0.15, CHAR() arguments larger than 255 are converted into multiple result bytes, a single CHAR() argument can now take up to 4 bytes. This patch fixes Item_func_char::fix_length_and_dec() to take this into account.
        
      This patch also fixes a regression introduced by the patch for bug21513. As now we do not always have the 'name' member of Item set for Item_hex_string and Item_bin_string, an own print() method has been added to Item_hex_string so that it could correctly be printed by Item_func::print_args().
      
      
      mysql-test/r/func_str.result:
        Import patch bug288550.patch
      mysql-test/t/func_str.test:
        Import patch bug288550.patch
      sql/item.cc:
        Import patch bug288550.patch
      sql/item.h:
        Import patch bug288550.patch
      sql/item_strfunc.h:
        Import patch bug288550.patch
      0ca57427
  33. 15 Oct, 2007 1 commit
    • unknown's avatar
      Bug#30986 Character set introducer followed by a HEX string can return bad result(addon) · 2024dedb
      unknown authored
      issue an error if string has illegal characters
      
      
      mysql-test/r/ctype_utf8.result:
        issue an error if string has illegal characters
      mysql-test/t/ctype_utf8.test:
        issue an error if string has illegal characters
      sql/item.cc:
        issue an error if string has illegal characters
      sql/item.h:
        issue an error if string has illegal characters
      sql/sql_yacc.yy:
        issue an error if string has illegal characters
      2024dedb