1. 23 Mar, 2012 1 commit
    • Igor Babaev's avatar
      Fixed LP bug #954900. · a44995e6
      Igor Babaev authored
      If the first component of a ref key happened to be a constant appeared
      after constant row substitution then no store_key element should be
      created for such a component. Yet create_ref_for_key() erroneously could
      create such an element that caused construction of invalid ref keys and
      wrong results for some joins.
      a44995e6
  2. 22 Mar, 2012 2 commits
  3. 21 Mar, 2012 6 commits
  4. 18 Mar, 2012 2 commits
    • Sergey Petrunya's avatar
      BUG#952583: Server crashes in Item_field::fix_after_pullout on INSERT .. SELECT · 28f80b5e
      Sergey Petrunya authored
      - Take into account that there may exist Item_field objects with context==NULL.
      28f80b5e
    • Sergey Petrunya's avatar
      BUG#952372: Server crashes on 2nd execution of PS in find_field_in_tables with... · fb86cc4f
      Sergey Petrunya authored
      BUG#952372: Server crashes on 2nd execution of PS in find_field_in_tables with semijoin+materialization
      - The problem was that convert_subq_to_jtbm() attached the semi-join
        TABLE_LIST object into the wrong list: they used to attach it to the 
        end of parent_lex->leaf_tables.head()->next_local->...->next_local.
        This was apparently inccorect, as one can construct an example where 
        JTBM nest is attached to a table that is inside some mergeable VIEW, which
        breaks (causes crash) for name resolution on the subsequent statement
        re-execution.
      - Solution: Attach to the "right" list. The "wording" was copied from
        st_select_lex::handle_derived.
      
      fb86cc4f
  5. 15 Mar, 2012 1 commit
  6. 14 Mar, 2012 3 commits
  7. 13 Mar, 2012 3 commits
    • Igor Babaev's avatar
      Merge. · 38471061
      Igor Babaev authored
      38471061
    • Igor Babaev's avatar
      Fixed LP bug #953649. · 8a0e110a
      Igor Babaev authored
      Do not call, directly or indirectly, SQL_SELECT::test_quick_select()
      for derived materialized tables / views when optimizing joins referring
      to these tables / views to get cost estimates of materialization.
      The current code does not create B-tree indexes for materialized 
      derived tables / views. So now it's not possible to get any estimates
      for ranges conditions over the results of the materialization.
      
      The function mysql_derived_create() must take into account the fact
      that array of the KEY structures specifying the keys over a derived
      table / view may be moved after the optimization phase if the
      derived table / view  is materialized.
      
      8a0e110a
    • Michael Widenius's avatar
      Fixed bug lp:917689 "Archive table corruption crashing MariaDB signal 11" · e1f6da82
      Michael Widenius authored
      Added 'from_end' as extra parameter to Field::unpack() to detect wrong from data.
      Change ha_archive::unpack_row() to detect wrong field lengths.
      Replication code changed to detect wrong field information in events.
      
      
      mysql-test/r/archive.result:
        dded test case for lp:917689
      sql/field.cc:
        Added 'from_end' as extra parameter to Field::unpack() to detect wrong from data.
        Removed not used 'unpack_key' functions.
      sql/field.h:
        Added 'from_end' as extra parameter to Field::unpack() to detect wrong from data.
        Removed not used 'unpack_key' functions.
        Removed some not needed unpack() functions.
      sql/filesort.cc:
        Added buffer end parameter to unpack_addon_fields()
      sql/log_event.h:
        Added end of buffer argument to unpack_row()
      sql/log_event_old.cc:
        Added end of buffer argument to unpack_row()
      sql/log_event_old.h:
        Added end of buffer argument to unpack_row()
      sql/records.cc:
        Added buffer end parameter to unpack_addon_fields()
      sql/rpl_record.cc:
        Added end of buffer argument to unpack_row()
        Added detection of wrong field information in events
      sql/rpl_record.h:
        Added end of buffer argument to unpack_row()
      sql/rpl_record_old.cc:
        Added end of buffer argument to unpack_row()
        Added detection of wrong field information in events
      sql/rpl_record_old.h:
        Added end of buffer argument to unpack_row()
      sql/table.h:
        Added buffer end parameter to unpack()
      storage/archive/ha_archive.cc:
        Change ha_archive::unpack_row() to detect wrong field lengths.
        This fixes lp:917689
      e1f6da82
  8. 12 Mar, 2012 7 commits
  9. 09 Mar, 2012 4 commits
    • Igor Babaev's avatar
      Fixed LP bug #930814. · ea3ffc7f
      Igor Babaev authored
      This bug was introduced into mariadb 5.2 in the December 2010 with
      the patch that added a new engine property: the ability to support
      virtual columns.    
      As a result of this bug the information from frm files for tables 
      that contained virtual columns did not appear in the information schema
      tables.
      ea3ffc7f
    • Michael Widenius's avatar
      Added test case for lp:905782 "Assertion `pageno < ((1ULL) << 40)' failed at... · 9598f1c5
      Michael Widenius authored
      Added test case for lp:905782 "Assertion `pageno < ((1ULL) << 40)' failed at ma_pagecache.c:3438: pagecache_read or table corruption on INSERT into a ucs2 table"
      The orignal bug has been fixed earlier
      9598f1c5
    • unknown's avatar
      160eb5b0
    • Igor Babaev's avatar
      Fixed LP bug #884175. · a8cbfd38
      Igor Babaev authored
      If in the where clause of the a query some comparison conditions on the
      field under a MIN/MAX aggregate function contained constants whose sizes
      exceeded the size of the field then the query could return a wrong result
      when the optimizer had chosen to apply the MIN/MAX optimization.
      With such conditions the MIN/MAX optimization still could be applied, yet
      it would require a more thorough analysis of the keys built to find
      the value of MIN/MAX aggregate functions with index look-ups.   
      The current patch just prohibits using the MIN/MAX optimization in this
      situation.
      a8cbfd38
  10. 06 Mar, 2012 4 commits
  11. 05 Mar, 2012 4 commits
    • Michael Widenius's avatar
      Automatic merge · 9ea7bac8
      Michael Widenius authored
      9ea7bac8
    • Michael Widenius's avatar
      Ensure that we mark all processed tables as 'properly closed'. · 5d06eb14
      Michael Widenius authored
      This is needed as last log entry may be a DDL that is not processed and then a table may be left in 'not properly closed state' even if information is correct in it.
      5d06eb14
    • unknown's avatar
      Fix for LP BUG#944504 · 883f1dd6
      unknown authored
      Problem is that subquery execution can't be called during prepare/optimize phase.
      
      Also small fix for subquery test suite.
      883f1dd6
    • Igor Babaev's avatar
      Fixed LP bug #944782. · d8438ef7
      Igor Babaev authored
      This bug in the function JOIN::drop_unused_derived_keys() could
      leave the internal structures for a materialized derived table
      in an inconsistent state. This led to a not quite correct EXPLAIN
      output when no additional key had been created to access the table.
      It also may lead to more serious consequences: so, the test case
      added with this fix caused a crash in mariadb-5.5.20.  
      d8438ef7
  12. 01 Mar, 2012 2 commits
    • Igor Babaev's avatar
      Fixed LP bug #943543. · 84575fc4
      Igor Babaev authored
      This bug appeared after the patch for bug 939009 that in the
      function merge_key_fields forgot to reset a proper value for
      the val field in the result of the merge operation of the key
      field created for a regular key access and  the key field
      created to look for a NULL key.
      
      Adjusted the results of the test case for bug 939009 that
      actually were incorrect. 
      84575fc4
    • unknown's avatar
      Return original checksum value inside the test. · b3fd92a2
      unknown authored
      Move ucs2 test in separate file (MDEV-167).
      b3fd92a2
  13. 28 Feb, 2012 1 commit
    • Michael Widenius's avatar
      Fixed lp:925377 "Querying myisam table metadata while 'alter table..enable... · d8038704
      Michael Widenius authored
      Fixed lp:925377 "Querying myisam table metadata while 'alter table..enable keys' is running may corrupt the table"
      Fixed wrong mutex order bug in Aria when flush_log_for_bitmap() was called when table is not yet marked for change.
      
      include/my_base.h:
        Added flag that table is opened only for status
      mysql-test/r/myisam-big.result:
        Test case for lp:925377
      mysql-test/t/myisam-big.test:
        Test case for lp:925377
      sql/sql_base.cc:
        If thd->version == 0 (happens only when we are opening a table that is flushed under  MYSQL_LOCK_IGNORE_FLUSH), open the table in HA_OPEN_FOR_STATUS mode
      storage/maria/ma_bitmap.c:
        Fixed wrong mutex order bug in Aria when flush_log_for_bitmap() was called when table is not yet marked for change.
      storage/maria/ma_dbug.c:
        Ignore last_version <= 1 as these are either flushed or only opened for status
      storage/maria/ma_open.c:
        Use last_version=1 as a marker that table was opened with HA_OPEN_FOR_STATUS.
        In this case we just open a new version of the table in read only mode.
      storage/myisam/mi_create.c:
        Update prototype
      storage/myisam/mi_dbug.c:
        Ignore last_version <= 1 as these are either flushed or only opened for status
      storage/myisam/mi_open.c:
        Use last_version=1 as a marker that table was opened with HA_OPEN_FOR_STATUS.
        If HA_OPEN_FOR_STATUS is used, we will not assert if there is an old not-to-be-used version of the table existing.
        In this case we just open a new version of the table in read only mode.
      storage/myisam/myisamdef.h:
        Updated prototype
      d8038704