1. 02 Apr, 2012 1 commit
    • Michael Widenius's avatar
      Fixed lp:886479 "[PATCH] plugin boolean result" · c1b2b515
      Michael Widenius authored
      Thanks to Maarten Vanraes for the patch
      
      
      sql/sql_plugin.cc:
        Fix plugin boolean variables to receive the value "1", not "-1", when they are set to 1.
        Aside from being bizarre, the existing behavior is unportable: machines where char is unsigned print "255" instead.
      c1b2b515
  2. 30 Mar, 2012 5 commits
  3. 29 Mar, 2012 5 commits
  4. 28 Mar, 2012 3 commits
    • Michael Widenius's avatar
      Automatic merge · c404e51a
      Michael Widenius authored
      c404e51a
    • Michael Widenius's avatar
      Merge with 5.1 · fbd6b0c7
      Michael Widenius authored
      fbd6b0c7
    • Michael Widenius's avatar
      Fixed lp:944422 "mysql_upgrade destroys Maria tables?" · 0a190b6b
      Michael Widenius authored
      The issue was that check/optimize/anaylze did not zerofill the table before they started to work on it.
      Added one more element to not often used function handler::auto_repair() to allow handler to decide when to auto repair.
      
      
      mysql-test/suite/maria/r/maria-autozerofill.result:
        Test case for lp:944422
      mysql-test/suite/maria/t/maria-autozerofill.test:
        Test case for lp:944422
      sql/ha_partition.cc:
        Added argument to auto_repair()
      sql/ha_partition.h:
        Added argument to auto_repair()
      sql/handler.h:
        Added argument to auto_repair()
      sql/table.cc:
        Let auto_repair() decide which errors to trigger auto-repair
      storage/archive/ha_archive.h:
        Added argument to auto_repair()
      storage/csv/ha_tina.h:
        Added argument to auto_repair()
      storage/maria/ha_maria.cc:
        Give better error & warning messages for auto-repaired tables.
      storage/maria/ha_maria.h:
        Added argument to auto_repair()
        Always auto-repair in case of moved table.
      storage/maria/ma_open.c:
        Remove special handling of HA_ERR_OLD_FILE (this is now handled in auto_repair())
      storage/myisam/ha_myisam.h:
        Added argument to auto_repair()
      0a190b6b
  5. 27 Mar, 2012 2 commits
  6. 26 Mar, 2012 8 commits
  7. 25 Mar, 2012 1 commit
    • Sergey Petrunya's avatar
      BUG#962667: Assertion `0' failed in QUICK_INDEX_SORT_SELECT::need_sorted_output() · 85af7417
      Sergey Petrunya authored
      - The problem was that
        = we've picked a LooseScan that used full index scan (tab->type==JT_ALL) on certain index.
        = there was also a quick select (tab->quick!=NULL), that used other indexes.
        = some old code assumes that (tab->type==JT_ALL && tab->quick) -> means that the
          quick select should be used, which is not true.
      Fixed by discarding the quick select as soon as we know we're using LooseScan
      without using the quick select.
      85af7417
  8. 24 Mar, 2012 1 commit
  9. 23 Mar, 2012 4 commits
    • Michael Widenius's avatar
      Speedup: · 698aed2e
      Michael Widenius authored
      - Don't call update_virtual_fields() if table->vfield is not set
      - Don't prealloc memory for in open_tables() as this is very seldom used.
      
      
      sql/records.cc:
        Don't call update_virtual_fields() if table->vfield is not set
      sql/sql_base.cc:
        Don't prealloc memory for in open_tables() as this is very seldom used.
        Don't call update_virtual_fields() if table->vfield is not set
      sql/sql_delete.cc:
        Don't call update_virtual_fields() if table->vfield is not set
      sql/sql_handler.cc:
        Don't call update_virtual_fields() if table->vfield is not set
      sql/sql_join_cache.cc:
        Don't call update_virtual_fields() if table->vfield is not set
        Move some frequent values to local variables
      sql/sql_table.cc:
        Don't call update_virtual_fields() if table->vfield is not set
      sql/sql_update.cc:
        Don't call update_virtual_fields() if table->vfield is not set
      sql/table.cc:
        Assert if update_virtual_fields is called with wrong parameters
      698aed2e
    • Michael Widenius's avatar
      Fixes lp:941889 "JOIN constructors takes a long time in 5.3" · e6c3d2ba
      Michael Widenius authored
      - Remove all references of MAX_TABLES from JOIN struct and make these dynamic
      - Updated Join_plan_state to allocate just as many elements as it's needed
      
      
      sql/opt_subselect.cc:
        Optimized version of Join_plan_state
      sql/sql_select.cc:
        Set join->positions and join->best_positions dynamicly
        Don't call update_virtual_fields() if table->vfield is not set.
      sql/sql_select.h:
        Remove all references of MAX_TABLES from JOIN struct and Join_plan_state and make these dynamic
      e6c3d2ba
    • Michael Widenius's avatar
      Speedups: · 50b87fa6
      Michael Widenius authored
      - Optimize away calls to hp_rec_hashnr() by cashing hash
      - Try to get more rows / block (to minimize overhead of HP_PTRS) in HEAP tables.
      
      
      storage/heap/_check.c:
        Optimize away calls to hp_rec_hashnr() by cashing hash.
        Print cleanups
      storage/heap/heapdef.h:
        Added place to hold calculated hash value for row
      storage/heap/hp_create.c:
        Try to get more rows / block (to minimize overhead of HP_PTRS)
      storage/heap/hp_delete.c:
        Optimize away calls to hp_rec_hashnr() by cashing hash.
      storage/heap/hp_hash.c:
        Optimize away calls to hp_rec_hashnr() by cashing hash.
        Remove some not needed DBUG_PRINT
      storage/heap/hp_test2.c:
        Increased max table size as now heap tables takes a bit more space (a few %)
      storage/heap/hp_write.c:
        Optimize away calls to hp_rec_hashnr() by cashing hash.
        Remove duplicated code
        More DBUG_PRINT
      storage/maria/ma_create.c:
        More DBUG_PRINT
      50b87fa6
    • 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
  10. 22 Mar, 2012 2 commits
  11. 21 Mar, 2012 6 commits
  12. 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