An error occurred fetching the project authors.
  1. 17 Aug, 2011 1 commit
    • Igor Babaev's avatar
      Fixed LP bug #825035. · 249a10c7
      Igor Babaev authored
      The value of maybe_null flag should be saved for the second execution
      of a prepared statement from SELECT that uses an outer join.
      249a10c7
  2. 19 Jul, 2011 1 commit
    • unknown's avatar
      Fixed LP BUG#800696. · 99cce189
      unknown authored
      The problem was that optimizer removes some outer references (it they are
      constant for example) and the list of outer items built during prepare phase is
      not actual during execution phase when we need it as the cache parameters.
      First solution was use pointer on pointer on outer reference Item and
      initialize temporary table on demand. This solved most problem except case
      when optimiser also reduce Item which contains outer references ('OR' in
      this bug test suite).
      
      The solution is to build the list of outer reference items on execution
      phase (after optimization) on demand (just before temporary table creation)
      by walking Item tree and finding outer references among Item_ident
      (Item_field/Item_ref) and Item_sum items.
      
      Removed depends_on list (because it is not neede any mnore for the cache, in the place where it was used it replaced with upper_refs).
      
      Added processor (collect_outer_ref_processor) and get_cache_parameters() methods to collect outer references (or other expression parameters in future).
      
      mysql-test/r/subselect_cache.result:
        A new test added.
      mysql-test/r/subselect_scache.result:
        Changes in creating the cache and its paremeters order or adding arguments of aggregate function (which is a parameter also, but this has no influence on the result).
      mysql-test/t/subselect_cache.test:
        Added a new test.
      sql/item.cc:
        depends_on removed.
        
        Added processor (collect_outer_ref_processor) and get_cache_parameters() methods to collect outer references.
        
        Item_cache_wrapper collect parameters befor initialization of its cache.
      sql/item.h:
        depends_on removed.
        
        Added processor (collect_outer_ref_processor) and get_cache_parameters() methods to collect outer references.
      sql/item_cmpfunc.cc:
        depends_on removed.
        
        Added processor (collect_outer_ref_processor) to collect outer references.
      sql/item_cmpfunc.h:
        Added processor (collect_outer_ref_processor) to collect outer references.
      sql/item_subselect.cc:
        depends_on removed.
        Added processor get_cache_parameters() method to collect outer references.
      sql/item_subselect.h:
        depends_on removed.
        Added processor get_cache_parameters() method to collect outer references.
      sql/item_sum.cc:
        Added processor (collect_outer_ref_processor) method to collect outer references.
      sql/item_sum.h:
        Added processor (collect_outer_ref_processor) and get_cache_parameters() methods to collect outer references.
      sql/opt_range.cc:
        depends_on removed.
      sql/sql_base.cc:
        depends_on removed.
      sql/sql_class.h:
        New iterator added.
      sql/sql_expression_cache.cc:
        Build of list of items resolved in outer query done just before creating expression cache on the first execution of the subquery which removes influence of optimizer removing items (all optimization already done).
      sql/sql_expression_cache.h:
        Build of list of items resolved in outer query done just before creating expression cache on the first execution of the subquery which removes influence of optimizer removing items (all optimization already done).
      sql/sql_lex.cc:
        depends_on removed.
      sql/sql_lex.h:
        depends_on removed.
      sql/sql_list.h:
        Added add_unique method to add only unique elements to the list.
      sql/sql_select.cc:
        Support of new Item list added.
      sql/sql_select.h:
        Support of new Item list added.
      99cce189
  3. 11 Jul, 2011 1 commit
    • Igor Babaev's avatar
      Fixed LP bug #793386. · 47aee198
      Igor Babaev authored
      Auto-generated names for view field items must be allocated in
      the statement memory, not in the execution memory of the statement.
      47aee198
  4. 27 Jun, 2011 1 commit
    • Michael Widenius's avatar
      New status variables: Rows_tmp_read, Handler_tmp_update and Handler_tmp_write · ba9a890f
      Michael Widenius authored
      Split status variable Rows_read to Rows_read and Rows_tmp_read so that one can see how much real data is read.
      Same was done with with Handler_update and Handler_write.
      Fixed bug in MEMORY tables where some variables was counted twice.
      Added new internal handler call 'ha_close()' to have one place to gather statistics.
      Fixed bug where thd->open_options was set to wrong value when doing admin_recreate_table()
      
      
      mysql-test/r/status.result:
        Updated test results and added new tests
      mysql-test/r/status_user.result:
        Udated test results
      mysql-test/t/status.test:
        Added new test for temporary table status variables
      sql/ha_partition.cc:
        Changed to call ha_close() instead of close()
      sql/handler.cc:
        Added internal_tmp_table variable for easy checking of temporary tables.
        Added new internal handler call 'ha_close()' to have one place to gather statistics.
        Gather statistics for internal temporary tables.
      sql/handler.h:
        Added handler variables internal_tmp_table, rows_tmp_read.
        Split function update_index_statistics() to two.
        Added ha_update_tmp_row() for faster tmp table handling with more statistics.
      sql/item_sum.cc:
        ha_write_row() -> ha_write_tmp_row()
      sql/multi_range_read.cc:
        close() -> ha_close()
      sql/mysqld.cc:
        New status variables: Rows_tmp_read, Handler_tmp_update and Handler_tmp_write
      sql/opt_range.cc:
        close() -> ha_close()
      sql/sql_base.cc:
        close() -> ha_close()
      sql/sql_class.cc:
        Added handling of rows_tmp_read
      sql/sql_class.h:
        Added new satistics variables.
        rows_read++  ->  update_rows_read() to be able to correctly count reads to internal temp tables.
        Added handler::ha_update_tmp_row()
      sql/sql_connect.cc:
        Added comment
      sql/sql_expression_cache.cc:
        ha_write_row() -> ha_write_tmp_row()
      sql/sql_select.cc:
        close() -> ha_close()
        ha_update_row() -> ha_update_tmp_row()
      sql/sql_show.cc:
        ha_write_row() -> ha_write_tmp_row()
      sql/sql_table.cc:
        Fixed bug where thd->open_options was set to wrong value when doing admin_recreate_table()
      sql/sql_union.cc:
        ha_write_row() -> ha_write_tmp_row()
      sql/sql_update.cc:
        ha_write_row() -> ha_write_tmp_row()
      sql/table.cc:
        close() -> ha_close()
      storage/heap/ha_heap.cc:
        Removed double counting of statistic variables.
        close -> ha_close() to get tmp table statistics.
      storage/maria/ha_maria.cc:
        close -> ha_close() to get tmp table statistics.
      ba9a890f
  5. 24 Jun, 2011 1 commit
    • Igor Babaev's avatar
      Fixed a valgrind problem. · d6b0767c
      Igor Babaev authored
      The function setup_tables should handle table_list elements for
      semijoin materialized tables in a special way when executing
      a prepared statement for the second time.
      d6b0767c
  6. 14 Jun, 2011 1 commit
    • Igor Babaev's avatar
      Fixed LP bug #794890. · 56eb6d7e
      Igor Babaev authored
      Changed the code that processing of multi-updates and multi-deletes
      with multitable views at the prepare stage.
      
      A proper solution would be: never to perform any transformations of views
      before and at the prepare stage. Yet it would  require re-engineering
      of the code that checks privileges and updatability of views.
      Ultimately this re-engineering has to be done to provide a clean solution
      for INSERT/UPDATE/DELETE statements that use views.
      
      Fixed a valgrind problem in the function TABLE::use_index.
        
      56eb6d7e
  7. 06 Jun, 2011 1 commit
    • Michael Widenius's avatar
      Fixed that SHOW COLUMNS for a virtual persistent column shows 'PERSISTENT' instead of 'VIRTUAL' · 7e04f7c8
      Michael Widenius authored
      Strict mode now gives error if one tries to update a virtual column.
      
      mysql-test/suite/vcol/r/vcol_column_def_options_innodb.result:
        Updated test results
      mysql-test/suite/vcol/r/vcol_column_def_options_myisam.result:
        Updated test results
      mysql-test/suite/vcol/r/vcol_keys_innodb.result:
        Updated test results
      mysql-test/suite/vcol/r/vcol_keys_myisam.result:
        Updated test results
      mysql-test/suite/vcol/r/vcol_misc.result:
        Added new test for 'show columns' and error handling when trying to update a virtual column.
      mysql-test/suite/vcol/t/vcol_misc.test:
        Added new test for 'show columns' and error handling when trying to update a virtual column.
      sql/sql_base.cc:
        Strict mode now gives error if one tries to update a virtual column.
      sql/sql_show.cc:
        Show PERSISTENT instead of VIRTUAL for persistent columns.
      7e04f7c8
  8. 02 Jun, 2011 1 commit
    • Oleksandr Byelkin's avatar
      Fix of privilege problem in views and PS · dd3b2783
      Oleksandr Byelkin authored
      sql/sql_base.cc:
        Column for views should be looked in views (not in underlying table)
      sql/sql_parse.cc:
        if we reread grants for single table we should read both database and tables grants for views (not only database grants).
      dd3b2783
  9. 29 May, 2011 1 commit
  10. 28 May, 2011 3 commits
    • Sergey Petrunya's avatar
      - Update test results (trivial) · ded7342d
      Sergey Petrunya authored
      - Code cleanup: remove garbage comments
      ded7342d
    • Sergey Petrunya's avatar
      Buildbot fixes: · 6f17421c
      Sergey Petrunya authored
      - Don't call table_list->process_index_hints() for JTBM pseudo-tables
      - Update test results
      6f17421c
    • Sergey Petrunya's avatar
      post-merge fixes: get MWL#90 code to work with MWL#89's · 77c4c4d8
      Sergey Petrunya authored
      way of processing prepared statements:
      - conversion subquery_predicate -> TABLE_LIST is once per-statement
      - However, the code must take into account that materialized temptable
        is dropped and re-created on each execution (the tricky part is that 
        at start of n-th EXECUTE we have TABLE_LIST object but not its TABLE object)
      - IN-equality is injected into WHERE on every execution.
      77c4c4d8
  11. 08 May, 2011 1 commit
    • Michael Widenius's avatar
      Adding support for Dynamic columns (WL#34): · 5ab92b1f
      Michael Widenius authored
      - COLUMN_CREATE(column_nr, value, [column_nr,value]...)
      - COLUMN_ADD(blob,column_nr, value, column_nr,value]...)
      - COLUMN_DELETE(blob, column_nr, column_nr...)
      - COLUMN_EXISTS(blob, column_nr)
      - COLUMN_LIST(blob, column_nr)
      - COLUMN_GET(string, column_nr AS type)
      
      Added cast(X as DOUBLE) and cast(x as INT)
      Better warning and error messages for wrong cast's
      Created some sub functions to simplify and reuse code.
      Added a lot of conversation functions with error/warnings for what went wrong.
      Fixed some issues when casting time to datetime.
      Added functions to dynamic strings and Strings to allow one to move a string buffer from dynamic strings to String (to save malloc+ copy)
      Added dynamic columns library to libmysqlclient
      
      
      include/Makefile.am:
        Added ma_dyncol.h
      include/decimal.h:
        Added 'const' to arguments for some functions.
      include/my_sys.h:
        Added dynstr_reassociate()
      include/my_time.h:
        Added TIME_SUBSECOND_RANGE
        Added double_to_datetime()
        Added flag argument to str_to_time()
      libmysql/CMakeLists.txt:
        Added mysys/ma_dyncol.c
      libmysql/Makefile.shared:
        Added ma_dyncol
      libmysql/libmysql.c:
        Added argument to str_to_time()
      mysql-test/r/bigint.result:
        Better error messages
      mysql-test/r/cast.result:
        Better warning and error messages
        A lot of new cast() tests
      mysql-test/r/func_math.result:
        Better warning messages
      mysql-test/r/func_str.result:
        Better warning messages
      mysql-test/r/func_time.result:
        Better warning messages
      mysql-test/r/sp-vars.result:
        Better warning messages
      mysql-test/r/strict.result:
        Better warning messages
        New test result
      mysql-test/r/type_newdecimal.result:
        Better warning messages
      mysql-test/r/warnings.result:
        Better warning messages
      mysql-test/suite/funcs_1/r/innodb_func_view.result:
        Updated results after better cast warnings
      mysql-test/suite/funcs_1/r/memory_func_view.result:
        Updated results after better cast warnings
      mysql-test/suite/funcs_1/r/myisam_func_view.result:
        Updated results after better cast warnings
      mysql-test/suite/optimizer_unfixed_bugs/t/bug43448.test:
        Added begin...commit to speed up test.
      mysql-test/suite/parts/inc/part_supported_sql_funcs_delete.inc:
        Added begin...commit to speed up test.
      mysql-test/suite/parts/inc/partition_supported_sql_funcs.inc:
        Added begin...commit to speed up test.
      mysql-test/suite/parts/r/part_supported_sql_func_innodb.result:
        Added begin...commit to speed up test.
      mysql-test/suite/parts/r/part_supported_sql_func_myisam.result:
        Added begin...commit to speed up test.
      mysql-test/suite/parts/r/rpl_partition.result:
        Added begin...commit to speed up test.
      mysql-test/suite/parts/t/part_supported_sql_func_innodb.test:
        Removed duplicated --big_test
      mysql-test/suite/parts/t/rpl_partition.test:
        Added begin...commit to speed up test.
      mysql-test/suite/pbxt/r/cast.result:
        Updated results after better cast warnings
      mysql-test/suite/pbxt/r/func_str.result:
        Updated results after better cast warnings
      mysql-test/suite/pbxt/r/type_newdecimal.result:
        Updated results after better cast warnings
      mysql-test/suite/rpl/r/rpl_innodb_bug28430.result:
        Added begin...commit to speed up test.
      mysql-test/suite/rpl/t/rpl_innodb_bug28430.test:
        Added begin...commit to speed up test.
      mysql-test/suite/vcol/r/vcol_supported_sql_funcs_innodb.result:
        More warnings
      mysql-test/suite/vcol/r/vcol_supported_sql_funcs_myisam.result:
        More warnings
      mysql-test/t/cast.test:
        A lot of new cast() tests
      mysql-test/t/strict.test:
        Added new test
      mysys/CMakeLists.txt:
        Added ma_dyncol.c
      mysys/Makefile.am:
        Added ma_dyncol.c
      mysys/string.c:
        Added dynstr_reassociate() to move a buffer from dynamic_strings to some other allocator
      sql-common/my_time.c:
        Added 'fuzzydate' flag to str_to_time()
        Added support for microseconds to my_time_to_str() and my_datetime_to_str()
        Reset second_parts in number_to_datetime()
        Added double_to_datetime()
      sql/field.cc:
        Added double_to_longlong() and truncate_double() to simplify and reuse code
      sql/field.h:
        New prototypes
      sql/item.cc:
        Changed Item::get_date(MYSQL_TIME *ltime,uint fuzzydate) to be aware of type of argument.
        (Needed to make it microsecond safe and get better warnings).
        Updated call to str_to_time_with_warn()
      sql/item.h:
        Added struct st_dyncall_create_def used by dynamic columns
        Added virtual bool dynamic_result() to tell if type of argument may change over calls.
      sql/item_cmpfunc.cc:
        Added Item_func_dyncol_exists()
      sql/item_cmpfunc.h:
        Added class Item_func_dyncol_exists
      sql/item_create.cc:
        Added get_length_and_scale() to simplify other functions
        Simplified and extended create_func_cast()
        Added support for cast(X as double(X,Y))
        Added functions to create dynamic column functions.
      sql/item_create.h:
        Added prototypes
      sql/item_func.cc:
        Extended cast functions Item_func_signed() and Item_func_unsigned() to work with dynamic types
        Added Item_double_typecast()
      sql/item_func.h:
        Added class Item_double_typecast()
      sql/item_strfunc.cc:
        Added functions for COLUMN_CREATE(), COLUMN_ADD(), COLUMN_GET() and COLUMN_LIST()
      sql/item_strfunc.h:
        Added classes for COLUMN_CREATE(), COLUMN_ADD(), COLUMN_GET() and COLUMN_LIST()
      sql/item_timefunc.cc:
        Added flag argument to str_to_time_with_warn()
        Updated Item_char_typecast() to handle result type that may change between calls (for dynamic columns)
        Added Item_time_typecast::get_date() to ensure that we cast a datetime to time properly.
      sql/item_timefunc.h:
        Added get_date() to Item_time_typecast() to allow proper results for casting time to datetime
      sql/lex.h:
        Added new SQL function names
      sql/my_decimal.cc:
        Added 'const' to some arguments.
        Better error message in case of errors (we now print out the wrong value)
        Added my_decimal2int()
      sql/my_decimal.h:
        Moved some constants to my_decimal_limits.h
        Updated prototypes.
        Made my_decimal2int() a function as it's rather long (no reason to have it inline)
        Added decimal2my_decimal() function.
      sql/mysql_priv.h:
        Prototypes for new functions
      sql/share/errmsg.txt:
        New error messages for wrong casts and dynamic columns
      sql/sql_acl.cc:
        Fixed indentation
      sql/sql_base.cc:
        Added dynamic_column_error_message()
      sql/sql_string.h:
        Added reassociate() to move a buffer to be owned by String object.
      sql/sql_yacc.yy:
        Added syntax for COLUMN_ functions.
      sql/time.cc:
        Updated str_to_datetime_with_warn() flag argument to same type as other functions
        Added conversion flag to str_to_time_with_warn() (Similar to all datetime functions)
        Added conversion functions with warnings: double_to_datetime_with_warn() and decimal_to_datetime_with_warn()
      strings/decimal.c:
        Added 'const' to arguments for some functions.
      unittest/mysys/Makefile.am:
        Added test for dynamic columns code
      5ab92b1f
  12. 31 Mar, 2011 1 commit
    • Michael Widenius's avatar
      Fixed all BUILD scripts to use g++ instead of gcc for linking · 1ee94dc2
      Michael Widenius authored
      Fixed memory leak from HEAP tables that was not deleted properly
      
      
      BUILD/compile-alpha-ccc:
        Use g++ instead of gcc for linking
      BUILD/compile-alpha-debug:
        Use g++ instead of gcc for linking
      BUILD/compile-pentium-pgcc:
        Use g++ instead of gcc for linking
      BUILD/compile-solaris-sparc:
        Use g++ instead of gcc for linking
      BUILD/compile-solaris-sparc-debug:
        Use g++ instead of gcc for linking
      BUILD/compile-solaris-sparc-purify:
        Use g++ instead of gcc for linking
      sql/item.cc:
        Safety fixes for expr_cache
        Call Item_result:field::cleanup() in Item_cache_wrapper::cleanup()
        More DBUG_PRINT
      sql/sql_base.cc:
        Simple optimization for setup_wild
        More DBUG_PRINT
      sql/sql_expression_cache.cc:
        Added header
        Removed not needed initialization
      sql/sql_lex.cc:
        More DBUG_PRINT
      sql/sql_select.cc:
        More DBUG_PRINT
        Fixed memory leak from HEAP tables that was not deleted properly
      storage/heap/hp_create.c:
        More DBUG_PRINT
      1ee94dc2
  13. 30 Mar, 2011 1 commit
  14. 29 Mar, 2011 2 commits
    • Sergey Petrunya's avatar
      MWL#90: Address review feedback part #16 · dc937fb5
      Sergey Petrunya authored
      dc937fb5
    • Jon Olav Hauglid's avatar
      Bug# 11763784 (former 56541) · 4e26a41f
      Jon Olav Hauglid authored
      ASSERTION TABLE->DB_STAT FAILED IN
      SQL_BASE.CC::OPEN_TABLE() DURING I_S Q
      
      This assert could be triggered if a statement requiring a name
      lock on a table (e.g. DROP TRIGGER) executed concurrently
      with an I_S query which also used the table.
      
      One connection first started an I_S query that opened a given table.
      Then another connection started a statement requiring a name lock
      on the same table. This statement was blocked since the table was
      in use by the I_S query. When the I_S query resumed and tried to
      open the table again as part of get_all_tables(), it would encounter
      a table instance with an old version number representing the pending
      name lock. Since I_S queries ignore version checks and thus pending
      name locks, it would try to continue. This caused it to encounter
      the assert. The assert checked that the TABLE instance found with a
      different version, was a real, open table. However, since this TABLE
      instance instead represented a pending name lock, the check would
      fail and trigger the assert.
      
      This patch fixes the problem by removing the assert. It is ok for
      TABLE::db_stat to be 0 in this case since the TABLE instance can
      represent a pending name lock.
      
      Test case added to lock_sync.test.
      4e26a41f
  15. 21 Mar, 2011 1 commit
  16. 28 Feb, 2011 1 commit
    • Michael Widenius's avatar
      Change TABLE->alias to String for less memory reallocation · ff3da0f9
      Michael Widenius authored
      Changed some String.ptr() -> String.c_ptr() for String that are not guaranteed to end with \0
      Removed some c_ptr() usage from parameters to functions that takes ptr & length
      Use preallocate buffers to avoid calling malloc() for most operations. 
      
      
      sql/event_db_repository.cc:
        alias is now a String
      sql/event_scheduler.cc:
        c_ptr -> c_ptr_safe() to avoid warnings from valgrind.
      sql/events.cc:
        c_ptr -> c_ptr_safe() to avoid warnings from valgrind.
        c_ptr -> ptr() as function takes ptr & length
      sql/field.cc:
        alias is now a String
      sql/field.h:
        alias is now a String
      sql/ha_partition.cc:
        alias is now a String
      sql/handler.cc:
        alias is now a String
        ptr() -> c_ptr() as string is not guaranteed to be \0 terminated
      sql/item.cc:
        Store error parameter in separarte buffer to ensure correct error message
      sql/item_func.cc:
        ptr() -> c_ptr_safe() as string is not guaranteed to be \0 terminated
      sql/item_sum.h:
        Use my_strtod() instead of my_atof() to not have to make string \0 terminated
      sql/lock.cc:
        alias is now a String
      sql/log.cc:
        c_ptr() -> ptr() as function takes ptr & length
      sql/log_event.cc:
        c_ptr_quick() -> ptr() as we only want to get the pointer to String buffer
      sql/opt_range.cc:
        ptr() -> c_ptr() as string is not guaranteed to be \0 terminated
      sql/opt_table_elimination.cc:
        alias is now a String
      sql/set_var.cc:
        ptr() -> c_ptr() as string is not guaranteed to be \0 terminated
        c_ptr() -> c_ptr_safe() to avoid warnings from valgrind.
        c_ptr() -> ptr() as function takes ptr & length
        Simplify some code.
      sql/sp.cc:
        c_ptr() -> ptr() as function takes ptr & length
      sql/sp_rcontext.cc:
        alias is now a String
      sql/sql_base.cc:
        alias is now a String.
        Here we win a realloc() for most alias usage.
      sql/sql_class.cc:
        Use size descriptor for printf() to avoid accessing bytes outside of buffer
      sql/sql_insert.cc:
        Change allocation of TABLE as it's now contains a String
        _ptr() -> ptr() as function takes ptr & length
      sql/sql_load.cc:
        Use preallocate buffers to avoid calling malloc() for most operations.
      sql/sql_parse.cc:
        Use c_ptr_safe() to ensure string is \0 terminated.
      sql/sql_plugin.cc:
        c_ptr_quick() -> ptr() as function takes ptr & length
      sql/sql_select.cc:
        alias is now a String
      sql/sql_show.cc:
        alias is now a String
      sql/sql_string.h:
        Added move() function to change who owns the string (owner does the free)
      sql/sql_table.cc:
        alias is now a String
        c_ptr() -> c_ptr_safe() to avoid warnings from valgrind.
      sql/sql_test.cc:
        c_ptr() -> c_ptr_safe() to avoid warnings from valgrind.
        alias is now a String
      sql/sql_trigger.cc:
        c_ptr() -> c_ptr_safe() to avoid warnings from valgrind.
        Use field->init() to setup pointers to alias.
      sql/sql_update.cc:
        alias is now a String
      sql/sql_view.cc:
        ptr() -> c_ptr_safe() as string is not guaranteed to be \0 terminated
      sql/sql_yacc.yy:
        r() -> c_ptr() as string is not guaranteed to be \0 terminated
      sql/table.cc:
        alias is now a String
      sql/table.h:
        alias is now a String
      storage/federatedx/ha_federatedx.cc:
        Remove extra 1 byte alloc that is automaticly done by strmake()
        Ensure that error message ends with \0
      storage/maria/ha_maria.cc:
        alias is now a String
      storage/myisam/ha_myisam.cc:
        alias is now a String
      ff3da0f9
  17. 18 Feb, 2011 2 commits
  18. 25 Jan, 2011 1 commit
  19. 24 Jan, 2011 2 commits
  20. 11 Jan, 2011 1 commit
  21. 03 Jan, 2011 1 commit
    • Michael Widenius's avatar
      Implementation of MWL#172: Add support for prepared statements to HANDLER READ · e63b5546
      Michael Widenius authored
      It includes speed optimizations for HANDLER READ by caching as much as possible in HANDLER OPEN
      Other things:
      - Added mysqld option --disable-thr-alarm to be able to benchmark things without thr_alarm
      - Changed 'Locked' state to 'System lock' and 'Table lock' (these where used in the code but never shown to end user)
      - Better error message if mysql_install_db.sh fails
      - Moved handler function prototypes to sql_handler.h
      - Remove not anymore used 'thd->locked' member
      
      
      include/thr_alarm.h:
        Added my_disable_thr_alarm
      include/thr_lock.h:
        Add new member to THR_LOCK_DATA to remember original lock type state. This is needed as thr_unlock() resets type to TL_UNLOCK.
      mysql-test/include/check_no_concurrent_insert.inc:
        Locked -> Table lock
      mysql-test/include/handler.inc:
        Locked -> Table lock
      mysql-test/r/handler_innodb.result:
        Updated results for new tests
      mysql-test/r/handler_myisam.result:
        Updated results for new tests
      mysql-test/r/sp-threads.result:
        Locked -> Table lock
      mysql-test/suite/binlog/t/binlog_stm_row.test:
        Locked -> Table lock
      mysql-test/suite/funcs_1/datadict/processlist_val.inc:
        Locked -> Table lock
      mysql-test/suite/pbxt/t/lock_multi.test:
        Locked -> Table lock
      mysql-test/suite/sys_vars/r/concurrent_insert_func.result:
        Locked -> Table lock
      mysql-test/suite/sys_vars/t/concurrent_insert_func.test:
        Locked -> Table lock
      mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test:
        Locked -> Table lock
      mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test:
        Locked -> Table lock
      mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test:
        Locked -> Table lock
      mysql-test/t/insert_notembedded.test:
        Locked -> Table lock
      mysql-test/t/lock_multi.test:
        Locked -> Table lock
      mysql-test/t/merge-big.test:
        Locked -> Table lock
      mysql-test/t/multi_update.test:
        Locked -> Table lock
      mysql-test/t/query_cache_28249.test:
        Locked -> Table lock
      mysql-test/t/sp_notembedded.test:
        Locked -> Table lock
      mysql-test/t/sp_sync.test:
        Locked -> Table lock
      mysql-test/t/status.test:
        Locked -> Table lock
      mysql-test/t/trigger_notembedded.test:
        Locked -> Table lock
      mysys/thr_alarm.c:
        Added option to disable thr_alarm
      mysys/thr_lock.c:
        Detect loops
      scripts/mysql_install_db.sh:
        Give better error message if something goes wrong
      sql/Makefile.am:
        Added sql_handler.h
      sql/lock.cc:
        Split functions to allow one to cache value if store_lock() (for HANDLER functions).
        - Split mysql_lock_tables() into two functions, where first one allocates MYSQL_LOCK and other other one uses it.
        - Made get_lock_data() an external function.
        - Added argument to mysql_unlock_tables() to not free sql_lock.
        - Added argument to reset_lock_data() to reset lock structure to initial state (as after get_lock_data())
      sql/mysql_priv.h:
        Moved handler function prototypes to sql_handler.h
        Added new lock functions.
      sql/mysqld.cc:
        Added --thread-alarm startup option
      sql/net_serv.cc:
        Don't call vio_blocking() if not needed
      sql/sql_base.cc:
        include sql_handler.h
      sql/sql_class.cc:
        include sql_handler.h
        Remove not anymore used 'thd->locked' member
      sql/sql_class.h:
        Remove not anymore used 'thd->locked' member
      sql/sql_db.cc:
        include sql_handler.h
      sql/sql_delete.cc:
        include sql_handler.h
      sql/sql_handler.cc:
        Rewrote all code to use SQL_HANDLER instead of TABLE_LIST (original interface)
        Rewrote mysql_ha_open() to cache all things from TABLE_LIST and items for field list, where etc.
        In mysql_ha_open() also cache MYSQL_LOCK structure from get_lock_data().
        Split functions into smaller sub functions (needed to be able to implement mysql_ha_read_prepare())
        Added mysql_ha_read_prepare() to allow one to prepare HANDLER READ.
      sql/sql_handler.h:
        Interface to sql_handler.cc
      sql/sql_parse.cc:
        include sql_handler.h
      sql/sql_prepare.cc:
        Added mysql_test_handler_read(), prepare for HANDLER READ
      sql/sql_rename.cc:
        include sql_handler.h
      sql/sql_show.cc:
        Removed usage of thd->locked
      sql/sql_table.cc:
        include sql_handler.h
      sql/sql_trigger.cc:
        include sql_handler.h
      e63b5546
  22. 28 Dec, 2010 1 commit
    • Kent Boortz's avatar
      - Added/updated copyright headers · 85323eda
      Kent Boortz authored
      - Removed files specific to compiling on OS/2
      - Removed files specific to SCO Unix packaging
      - Removed "libmysqld/copyright", text is included in documentation
      - Removed LaTeX headers for NDB Doxygen documentation
      - Removed obsolete NDB files
      - Removed "mkisofs" binaries
      - Removed the "cvs2cl.pl" script
      - Changed a few GPL texts to use "program" instead of "library"
      85323eda
  23. 15 Dec, 2010 1 commit
    • Alexander Nozdrin's avatar
      Patch for Bug#57952 (privilege change is not taken into account by EXECUTE). · 1bd81f6b
      Alexander Nozdrin authored
      The user-visible problem was that changes to column-level privileges,
      happened in between of PREPARE and EXECUTE of a prepared statement, were
      neglected. I.e. a prepared statement could be executed with the
      column-level privileges as of PREPARE-time. The problem existed for
      column-level privileges only.
      
      A similar problem existed for stored programs: the changes between
      executions didn't have an effect.
      
      Technically the thing is that table references are cached in
      Prepared_statement::prepare() call. In subsequent
      Prepared_statement::execute() calls those cached values are used.
      There are two functions to get a field by name: find_field_in_table() and
      find_field_in_table_ref(). On prepare-phase find_field_in_table_ref() is
      called, on execute-phase -- find_field_in_table() because the table is
      cached. find_field_in_table() does not check column-level privileges and
      expects the caller to do that. The problem was that this check was
      forgotten.
      
      The fix is to check them there as it happens in find_field_in_table_ref().
      1bd81f6b
  24. 27 Nov, 2010 1 commit
    • Michael Widenius's avatar
      Added TRASH() to table->record[0] to find out if we access not initialzed data. · 7c56b082
      Michael Widenius authored
      - Changed Cached_item_field not copy data for fields with NULL value
      - In key_copy() and key_restore() don't copy data for fields with NULL value
      
      Fixed code to avoid valgrind warnings
      - Use c_ptr_safe instead of c_ptr()
      
      Removed "QQ" from comments (QQ was ment to be used for internal comments that should be removed before pushing)
      Fixed wrong alias used (from previous patch)
      
      
      sql/event_db_repository.cc:
        Update testing if event table is valid (to avoid valgrind errors)
      sql/ha_partition.cc:
        m_ordered_scan_ongoing was not initialized
        Reset null bits in record to avoid valgrind errors
      sql/handler.h:
        Added flag if storage engine will write row verbatim and the row contains varchar or null fields
        (in which case we must clear the row to avoid valgrind warnings)
      sql/item_buff.cc:
        Changed Cached_item_field not copy data for fields with NULL value
        (Optimization and avoids valgrind warnings)
      sql/item_func.cc:
        c_ptr() -> c_ptr_safe()
      sql/key.cc:
        In key_copy() and key_restore() don't copy data for fields with NULL value
      sql/opt_range.cc:
        c_ptr() -> c_ptr_safe()
      sql/sql_base.cc:
        Added TRASH() to table->record[0] to find out if we access not initialzed data.
        Initialize null_bytes to:
        - Get consistent tests
        - Ensure we don't get valgrind warnings for null fields (as we may only update a couple of bits in a byte)
      sql/sql_class.cc:
        Removed "QQ" from comments
      sql/sql_insert.cc:
        Initialize row to default values if we are using valgrind and row will be copied verbatim to disk in storage engine.
      sql/sql_load.cc:
        QQ -> TODO
      sql/sql_parse.cc:
        Removed old not used code marked QQ and withing "#ifdef REMOVED"
      sql/sql_select.cc:
        QQ -> TODO
        Initialize some variables that was used uninitialized
        Added DBUG_ASSERT() to find out if thd was not properly initialized for sub queries
      sql/sql_test.cc:
        Fixed format for printing to DBUG file
        Fixed wrong alias used (from previous patch)
      sql/sql_trigger.h:
        QQ -> TODO
      sql/table.cc:
        QQ -> TODO
      storage/maria/ha_maria.cc:
        Mark table with HA_RECORD_MUST_BE_CLEAN_ON_WRITE, if row is written verbatim to disk and contains varchar or null fields.
      storage/maria/ma_open.c:
        Added flags if table has varchar or null fields
      storage/maria/maria_def.h:
        Added flags if table has varchar or null fields
      storage/myisam/ha_myisam.cc:
        Mark table with HA_RECORD_MUST_BE_CLEAN_ON_WRITE, if row is written verbatim to disk and contains varchar or null fields.
      storage/myisam/mi_open.c:
        Fixed memory overrun bug when using fulltext keys
      storage/xtradb/row/row0sel.c:
        Removed initialization of null bits. (not needed anymore)
      7c56b082
  25. 23 Nov, 2010 1 commit
    • Michael Widenius's avatar
      Code cleanup to get fewer reallocs() during execution. · 52090a44
      Michael Widenius authored
      - Changed TABLE->alias to String to get fewer reallocs when alias are used.
      - Preallocate some buffers
      
      Changed some String->c_ptr() -> String->ptr() when \0 is not needed.
      Fixed wrong usage of String->ptr() when we need a \0 terminated string.
      Use my_strtod() instead of my_atof() to avoid having to add \0 to string.
      c_ptr() -> c_ptr_safe() to avoid warnings from valgrind.
      zr 
      
      sql/event_db_repository.cc:
        Update usage of TABLE->alias
      sql/event_scheduler.cc:
        c_ptr() -> c_ptr_safe()
      sql/events.cc:
        c_ptr() -> ptr() as \0 was not needed
      sql/field.cc:
        Update usage of TABLE->alias
      sql/field.h:
        Update usage of TABLE->alias
      sql/ha_partition.cc:
        Update usage of TABLE->alias
      sql/handler.cc:
        Update usage of TABLE->alias
        Fixed wrong usage of str.ptr()
      sql/item.cc:
        Fixed error where code wrongly assumed string was \0 terminated.
      sql/item_func.cc:
        c_ptr() -> c_ptr_safe()
        Update usage of TABLE->alias
      sql/item_sum.h:
        Use my_strtod() instead of my_atof() to avoid having to add \0 to string
      sql/lock.cc:
        Update usage of TABLE->alias
      sql/log.cc:
        c_ptr() -> ptr() as \0 was not needed
      sql/log_event.cc:
        c_ptr_quick() -> ptr() as \0 was not needed
      sql/opt_range.cc:
        ptr() -> c_ptr() as \0 is needed
      sql/opt_subselect.cc:
        Update usage of TABLE->alias
      sql/opt_table_elimination.cc:
        Update usage of TABLE->alias
      sql/set_var.cc:
        ptr() -> c_ptr() as \0 is needed
        c_ptr() -> c_ptr_safe()
      sql/sp.cc:
        c_ptr() -> ptr() as \0 was not needed
      sql/sp_rcontext.cc:
        
        Update usage of TABLE->alias
      sql/sql_base.cc:
        Preallocate buffers
        Update usage of TABLE->alias
      sql/sql_class.cc:
        Fix arguments to sprintf() to work even if string is not \0 terminated
      sql/sql_insert.cc:
        Update usage of TABLE->alias
        c_ptr() -> ptr() as \0 was not needed
      sql/sql_load.cc:
        Preallocate buffers
        Trivial optimizations
      sql/sql_parse.cc:
        Trivial optimization
      sql/sql_plugin.cc:
        c_ptr() -> ptr() as \0 was not needed
      sql/sql_select.cc:
        Update usage of TABLE->alias
      sql/sql_show.cc:
        Update usage of TABLE->alias
      sql/sql_string.h:
        Added move() function to move allocated memory from one object to another.
      sql/sql_table.cc:
        Update usage of TABLE->alias
        c_ptr() -> c_ptr_safe()
      sql/sql_test.cc:
        ptr() -> c_ptr_safe()
      sql/sql_trigger.cc:
        Update usage of TABLE->alias
        c_ptr() -> c_ptr_safe()
      sql/sql_update.cc:
        Update usage of TABLE->alias
      sql/sql_view.cc:
        ptr() -> c_ptr_safe()
      sql/sql_yacc.yy:
        ptr() -> c_ptr()
      sql/table.cc:
        
        Update usage of TABLE->alias
      sql/table.h:
        Changed TABLE->alias to String to get fewer reallocs when alias are used.
      storage/federatedx/ha_federatedx.cc:
        Use c_ptr_safe() to ensure strings are \0 terminated.
      storage/maria/ha_maria.cc:
        Update usage of TABLE->alias
      storage/myisam/ha_myisam.cc:
        Update usage of TABLE->alias
      storage/xtradb/row/row0sel.c:
        Ensure that null bits in record are properly reset.
        (Old code didn't work as row_search_for_mysql() can be called twice while reading fields from one row.
      52090a44
  26. 03 Nov, 2010 1 commit
    • Michael Widenius's avatar
      Fixed compiler & valgrind warnings from my previous push. · 5b3159db
      Michael Widenius authored
      Fixed a bug in Aria when two threads was inserting into the same table and row page and one thread did an abort becasue of duplicate key.
      
      
      
      mysys/thr_lock.c:
        Fixed valgrind warning
      sql/sql_base.cc:
        Remove not used variable
      storage/maria/ma_bitmap.c:
        Added ma_bitmap_lock() & ma_bitmap_unlock() to protect against two threads using the bitmap at the same time.
        More DBUG_PRINT()
      storage/maria/ma_blockrec.c:
        Fixed a bug in Aria when two threads was inserting into the same table and row page and one thread did an abort becasue of duplicate key.
        Fix was that we block other threads to modify the bitmap while we are removing the row with a duplicate key.
      storage/maria/ma_blockrec.h:
        Added ma_bitmap_lock() & ma_bitmap_unlock() to protect against two threads using the bitmap at the same time.
      storage/maria/maria_def.h:
        Changed flush_all_requested to be a counter.
      storage/myisam/mi_locking.c:
        Fixed compiler error on windows (typo).
      5b3159db
  27. 02 Nov, 2010 1 commit
    • Michael Widenius's avatar
      Fix for: LP #634955: Assert in _ma_update_at_original_place() · 20acfbf3
      Michael Widenius authored
      Added locking of lock mutex when updating status in external_unlock() for Aria and MyISAM tables.
      Fixed that 'source' command doesn't cause mysql command line tool to exit on error.
      DEBUG_EXECUTE() and DEBUG_EVALUATE_IF() should not execute things based on wildcards. (Allows one to run --debug with mysql-test-run scripts that uses @debug)
      Fixed several core dump, deadlock and crashed table bugs in handling of LOCK TABLE with MERGE tables:
      - Added priority of locks to avoid crashes with MERGE tables.
      - Added thr_lock_merge() to allow one to merge two results of thr_lock().
      Fixed 'not found row' bug in REPLACE with Aria tables.
      Mark MyISAM tables that are part of MERGE with HA_OPEN_MERGE_TABLE and set the locks to have priority THR_LOCK_MERGE_PRIV.
      - By sorting MERGE tables last in thr_multi_unlock() it's safer to release and relock them many times (can happen when TRIGGERS are created)
      Avoid printing (null) in debug file (to easier find out wrong NULL pointer usage with %s).
      
      
      
      client/mysql.cc:
        Fixed that 'source' command doesn't cause mysql command line tool to exit on error.
      client/mysqltest.cc:
        Don't send NULL to fn_format(). (Can cause crash on Solaris when using --debug)
      dbug/dbug.c:
        DEBUG_EXECUTE() and DEBUG_EVALUATE_IF() should not execute things based on wildcards.
      include/my_base.h:
        Added flag to signal if one opens a MERGE table.
        Added extra() command to signal that one is not part of a MERGE table anymore.
      include/thr_lock.h:
        Added priority for locks (needed to fix bug in thr_lock when using MERGE tables)
        Added option to thr_unlock() if get_status() should be called.
        Added prototype for thr_merge_locks().
      mysql-test/mysql-test-run.pl:
        Ignore crashed table warnings for tables named 'crashed'.
      mysql-test/r/merge.result:
        Renamed triggers to make debugging easier.
        Added some CHECK TABLES to catch errors earlier.
        Additional tests.
      mysql-test/r/merge_debug.result:
        Test of error handling when reopening MERGE tables.
      mysql-test/r/udf_query_cache.result:
        Added missing flush status
      mysql-test/suite/parts/r/partition_repair_myisam.result:
        Update results
      mysql-test/t/merge.test:
        Renamed triggers to make debugging easier.
        Added some CHECK TABLES to catch errors earlier.
        Additional tests.
      mysql-test/t/merge_debug.test:
        Test of error handling when reopening MERGE tables.
      mysql-test/t/udf_query_cache.test:
        Added missing flush status
      mysys/my_getopt.c:
        Removed not used variable
      mysys/my_symlink2.c:
        Changed (null) to (NULL) to make it easier to find NULL arguments to DBUG_PRINT() functions.
        (On linux, NULL to sprintf is printed 'null')
      mysys/thr_lock.c:
        Added priority of locks to avoid crashes with MERGE tables.
        Added thr_lock_merge() to allow one to merge two results of thr_lock().
        - This is needed for MyISAM as all locked table must share the same status. If not, you will not see newly inserted rows in other instances of the table.
        If calling thr_unlock() with THR_UNLOCK_UPDATE_STATUS, call update_status() and restore_status() for the locks. This is needed in some rare cases where we call thr_unlock() followed by thr_lock() without calling external_unlock/external_lock in between.
        Simplify loop in thr_multi_lock().
        Added 'start_trans', which is called at end of thr_multi_lock() when all locks are taken.
        - This was needed by Aria to ensure that transaction is started when we got all locks, not at get_status(). Without this, some rows could not be visible when we lock two tables at the same time, causing REPLACE using two tables to fail unexpectedly.
      sql/handler.cc:
        Add an assert() in handler::print_error() for "impossible errors" (like table is crashed) when --debug-assert-if-crashed-table is used.
      sql/lock.cc:
        Simplify mysql_lock_tables() code if get_lock_data() returns 0 locks.
        Added new parameter to thr_multi_unlock()
        In mysql_unlock_read_tables(), call first externa_unlock(), then thr_multi_unlock();  This is same order as we do in mysql_unlock_tables().
        Don't abort locks in mysql_lock_abort() for merged tables when a MERGE table is deleted; Would cause a spin lock.
        Added call to thr_merge_locks() in mysql_lock_merge() to ensure consistency in thr_locks().
        - New locks of same type and table is stored after the old lock to ensure that we get the status from the original lock.
      sql/mysql_priv.h:
        Added debug_assert_if_crashed_table
      sql/mysqld.cc:
        Added --debug-assert-if-crashed-table
      sql/parse_file.cc:
        Don't print '(null)' in DBUG_PRINT of no dir given
      sql/set_var.cc:
        Increase default size of buffer for @debug variable.
      sql/sql_base.cc:
        In case of error from reopen_table() in reopen_tables(), call unlock_open_table() and restart loop.
        - This fixed bug when we twice deleted same table from open_cache.
        Don't take name lock for already name locked table in open_unireg_entry().
        - Fixed bug when doing repair in reopen_table().
        - In detach_merge_children(), always detach if 'clear_refs' is given. We can't trust parent->children_attached as this function can be called twice, first time with clear_refs set to 0.
      sql/sql_class.cc:
        Changed printing of (null) to "" in set_thd_proc_info()
      sql/sql_parse.cc:
        Added DBUG
      sql/sql_trigger.cc:
        Don't call unlink_open_table() if reopen_table() fails as the table may already be freed.
      storage/maria/ma_bitmap.c:
        Fixed DBUG_ASSERT() in allocate_tail()
      storage/maria/ma_blockrec.c:
        Fixed wrong calculation of row length for very small rows in undo_row_update().
        - Fixes ASSERT() when doing undo.
      storage/maria/ma_blockrec.h:
        Added _ma_block_start_trans() and _ma_block_start_trans_no_versioning()
      storage/maria/ma_locking.c:
        Call _ma_update_status_with_lock() when releasing write locks.
        - Fixes potential problem with updating status without the proper lock.
      storage/maria/ma_open.c:
        Changed to use start_trans() instead of get_status() to ensure that we see all rows in all locked tables when we got the locks.
        - Fixed 'not found row' bug in REPLACE with Aria tables.
      storage/maria/ma_state.c:
        Added _ma_update_status_with_lock() and _ma_block_start_trans().
        This is to ensure that we see all rows in all locked tables when we got the locks.
      storage/maria/ma_state.h:
        Added _ma_update_status_with_lock()
      storage/maria/ma_write.c:
        More DBUG_PRINT
      storage/myisam/mi_check.c:
        Fixed error message
      storage/myisam/mi_extra.c:
        Added HA_EXTRA_DETACH_CHILD:
        - Detach MyISAM table to not be part of MERGE table (remove flag & lock priority).
      storage/myisam/mi_locking.c:
        Call mi_update_status_with_lock() when releasing write locks.
        - Fixes potential problem with updating status without the proper lock.
        Change to use new HA_OPEN_MERGE_TABLE flag to test if MERGE table.
        Added mi_fix_status(), called by thr_merge().
      storage/myisam/mi_open.c:
        Added marker if part of MERGE table.
        Call mi_fix_status() in thr_lock() for transactional tables.
      storage/myisam/myisamdef.h:
        Change my_once_flag to uint, as it stored different values than just 0/1
        Added 'open_flag' to store state given to mi_open()
      storage/myisammrg/ha_myisammrg.cc:
        Add THR_LOCK_MERGE_PRIV to THR_LOCK_DATA to get MERGE locks sorted after other types of locks.
      storage/myisammrg/myrg_locking.c:
        Remove windows specific code.
      storage/myisammrg/myrg_open.c:
        Use HA_OPEN_MERGE_TABLE to mi_open().
        Set HA_OPEN_MERGE_TABLE for linked MyISAM tables.
      storage/xtradb/buf/buf0buf.c:
        Fixed compiler warning
      storage/xtradb/buf/buf0lru.c:
        Initialize variable that could be used not initialized.
      20acfbf3
  28. 11 Oct, 2010 1 commit
    • unknown's avatar
      Bug#56226 Table map set to 0 after altering MyISAM table · 42f8d2f2
      unknown authored
      After ALTER TABLE which changed only table's metadata, row-based
      binlog sometimes got corrupted since the tablemap was unexpectedly
      set to 0 for subsequent updates to the same table.
      
      ALTER TABLE which changed only table's metadata always reset
      table_map_id for the table share to 0. Despite the fact that
      0 is a valid value for table_map_id, this step caused problems
      as it could have created situation in which we had more than
      one table share with table_map_id equal 0. If more than one
      table with table_map_id are 0 were updated in the same statement,
      updates to these different tables were written into the same
      rows event. This caused slave server to crash.
      
      This bug happens only on 5.1. It doesn't affect 5.5+.
      
      This patch solves this problem by ensuring that ALTER TABLE
      statements which change metadata only never reset table_map_id
      to 0. To do this it changes reopen_table() to correctly use
      refreshed table_map_id value instead of using the old one/
      resetting it.
      
      
      mysql-test/suite/rpl/r/rpl_alter.result:
        Add test for BUG#56226
      mysql-test/suite/rpl/t/rpl_alter.test:
        Add test for BUG#56226
      42f8d2f2
  29. 23 Sep, 2010 1 commit
    • Michael Widenius's avatar
      Change some my_bool in C++ classes and a few functions to bool to detect wrong... · bdba1d11
      Michael Widenius authored
      Change some my_bool in C++ classes and a few functions to bool to detect wrong usage of bool/my_bool.
      Fix some bugs where we stored values other than 0 or 1 in my_bool
      Fixed some compiler warnings
      
      
      client/mysql.cc:
        Changed interrupted_query from my_bool to int, as we stored 2 in it.
      client/mysqladmin.cc:
        Changed return variable type to same type as function value type
      client/mysqltest.cc:
        Changed 'found' to int as we store other values than 0 or 1 into it
        Changed type for parameter of set_reconnect() to match usage.
      extra/libevent/evbuffer.c:
        Added __attribute__((unused))
      extra/libevent/event.c:
        Added __attribute__((unused))
      extra/libevent/signal.c:
        Added __attribute__((unused))
      sql/event_data_objects.h:
        my_bool -> bool
      sql/event_db_repository.cc:
        my_bool -> bool
      sql/event_db_repository.h:
        my_bool -> bool
      sql/event_parse_data.h:
        my_bool -> bool
      sql/events.cc:
        my_bool -> bool
      sql/events.h:
        my_bool -> bool
      sql/field.cc:
        my_bool -> bool
      sql/field.h:
        my_bool -> bool
      sql/hash_filo.h:
        my_bool -> bool
      sql/item.cc:
        my_bool -> bool
      sql/item.h:
        my_bool -> bool
      sql/item_cmpfunc.h:
        my_bool -> bool
        Changed result_for_null_param from my_bool to int as we stored -1 in it.
      sql/item_func.cc:
        my_bool -> bool
        Modified udf wrapper functions so that the UDF functions would continue to use my_bool. (To keep compatibility with UDF:s)
      sql/item_func.h:
        my_bool -> bool
      sql/item_subselect.h:
        my_bool -> bool
      sql/item_sum.cc:
        Modified udf wrapper functions so that the UDF functions would continue to use my_bool. (To keep compatibility with UDF:s)
      sql/parse_file.h:
        my_bool -> bool
      sql/rpl_mi.h:
        my_bool -> bool
      sql/sp_rcontext.h:
        my_bool -> bool
      sql/sql_analyse.h:
        my_bool -> bool
      sql/sql_base.cc:
        Change some assignments so that we don't initialize bool variables with int's.
      sql/sql_bitmap.h:
        my_bool -> bool
      sql/sql_cache.cc:
        my_bool -> bool
      sql/sql_cache.h:
        my_bool -> bool
      sql/sql_class.h:
        my_bool -> bool
      sql/sql_insert.cc:
        Change some assignments so that we don't initialize bool variables with int's.
      sql/sql_prepare.cc:
        my_bool -> bool
      sql/table.h:
        my_bool -> bool
      storage/maria/ma_check.c:
        Removed duplicate assignment
      strings/decimal.c:
        Fixed wrong variable usage.
        Don't do complex arithmetic on bool when simple works.
      bdba1d11
  30. 03 Sep, 2010 1 commit
    • Michael Widenius's avatar
      Fix that one can run mysql_upgrade with long table names · a4fff491
      Michael Widenius authored
      Fall back to use ALTER TABLE for engines that doesn't support REPAIR when doing repair for upgrade.
      Nicer output from mysql_upgrade and mysql_check
      Updated all arrays that used NAME_LEN to use SAFE_NAME_LEN to ensure that we don't break things accidently as names can now have a #mysql50# prefix.
      
      client/mysql_upgrade.c:
        If we are using verbose, also run mysqlcheck in verbose mode.
      client/mysqlcheck.c:
        Add more information if running in verbose mode
        Print 'Needs upgrade' instead of complex error if table needs to be upgraded
        Don't write connect information if verbose is not 2 or above
      mysql-test/r/drop.result:
        Updated test and results as we now support full table names
      mysql-test/r/grant.result:
        Now you get a correct error message if using #mysql with paths
      mysql-test/r/show_check.result:
        Update results as table names can temporarly be bigger than NAME_LEN (during upgrade)
      mysql-test/r/upgrade.result:
        Test upgrade for long table names.
      mysql-test/suite/funcs_1/r/is_tables_is.result:
        Updated old test result (had note been updated in a while)
      mysql-test/t/drop.test:
        Updated test and results as we now support full table names
      mysql-test/t/grant.test:
        Now you get a correct error message if using #mysql with paths
      mysql-test/t/upgrade.test:
        Test upgrade for long table names.
      sql/ha_partition.cc:
        NAME_LEN -> SAFE_NAME_LEN
      sql/item.cc:
        NAME_LEN -> SAFE_NAME_LEN
      sql/log_event.cc:
        NAME_LEN -> SAFE_NAME_LEN
      sql/mysql_priv.h:
        Added SAFE_NAME_LEN
      sql/rpl_filter.cc:
        NAME_LEN -> SAFE_NAME_LEN
      sql/sp.cc:
        NAME_LEN -> SAFE_NAME_LEN
      sql/sp_head.cc:
        NAME_LEN -> SAFE_NAME_LEN
      sql/sql_acl.cc:
        NAME_LEN -> SAFE_NAME_LEN
      sql/sql_base.cc:
        NAME_LEN -> SAFE_NAME_LEN
      sql/sql_connect.cc:
        NAME_LEN -> SAFE_NAME_LEN
      sql/sql_parse.cc:
        NAME_LEN -> SAFE_NAME_LEN
      sql/sql_prepare.cc:
        NAME_LEN -> SAFE_NAME_LEN
      sql/sql_select.cc:
        NAME_LEN -> SAFE_NAME_LEN
      sql/sql_show.cc:
        NAME_LEN -> SAFE_NAME_LEN
        Enlarge table names for SHOW TABLES to also include optional #mysql50#
      sql/sql_table.cc:
        Fall back to use ALTER TABLE for engines that doesn't support REPAIR when doing repair for upgrade.
      sql/sql_trigger.cc:
        NAME_LEN -> SAFE_NAME_LEN
      sql/sql_udf.cc:
        NAME_LEN -> SAFE_NAME_LEN
      sql/sql_view.cc:
        NAME_LEN -> SAFE_NAME_LEN
      sql/table.cc:
        Fixed check_table_name() to not count #mysql50# as part of name
        If #mysql50# is part of the name, don't allow path characters in name.
      a4fff491
  31. 20 Jul, 2010 1 commit
    • Davi Arnaut's avatar
      Bug#45288: pb2 returns a lot of compilation warnings on linux · 9a5fa17f
      Davi Arnaut authored
      Fix warnings flagged by the new warning option -Wunused-but-set-variable
      that was added to GCC 4.6 and that is enabled by -Wunused and -Wall. The
      option causes a warning whenever a local variable is assigned to but is
      later unused. It also warns about meaningless pointer dereferences.
      
      client/mysql.cc:
        Meaningless pointer dereferences.
      client/mysql_upgrade.c:
        Check whether reading from the file succeeded.
      extra/comp_err.c:
        Unused.
      extra/yassl/src/yassl_imp.cpp:
        Skip instead of reading data that is discarded.
      include/my_pthread.h:
        Variable is only used in debug builds.
      include/mysys_err.h:
        Add new error messages.
      mysys/errors.c:
        Add new error message for permission related functions.
      mysys/mf_iocache.c:
        Variable is only checked under THREAD.
      mysys/my_copy.c:
        Raise a error if chmod or chown fails.
      mysys/my_redel.c:
        Raise a error if chmod or chown fails.
      regex/engine.c:
        Use a equivalent variable for the assert.
      server-tools/instance-manager/instance_options.cc:
        Unused.
      sql/field.cc:
        Unused.
      sql/item.cc:
        Unused.
      sql/log.cc:
        Do not ignore the return value of freopen: only set buffer if
        reopening succeeds.
        
        Adjust doxygen comment to the right function.
        
        Pass message lenght to log function.
      sql/mysqld.cc:
        Do not ignore the return value of freopen: only set buffer if
        reopening succeeds.
      sql/partition_info.cc:
        Unused.
      sql/slave.cc:
        No need to set pointer to the address of '\0'.
      sql/spatial.cc:
        Unused. Left for historical purposes.
      sql/sql_acl.cc:
        Unused.
      sql/sql_base.cc:
        Pointers are always set to the same variables.
      sql/sql_parse.cc:
        End statement if reading fails.
        
        Store the buffer after it has actually been updated.
      sql/sql_repl.cc:
        No need to set pointer to the address of '\0'.
      sql/sql_show.cc:
        Put variable under the same ifdef block.
      sql/udf_example.c:
        Set null pointer flag appropriately.
      storage/csv/ha_tina.cc:
        Meaningless dereferences.
      storage/example/ha_example.cc:
        Return the error since it's available.
      storage/myisam/mi_locking.c:
        Remove unused and dead code.
      9a5fa17f
  32. 17 Jul, 2010 1 commit
    • Igor Babaev's avatar
      Fixed bug #604503. · 452860df
      Igor Babaev authored
      If the expression for a virtual column of table contained datetime
      comparison then the execution of the second query that used this
      virtual column caused a crash. It happened because the execution
      of the first query that used this virtual column inserted a cached
      item into the expression tree. The cached tree was allocated in
      the statement memory while the expression tree was allocated in
      the table memory.
      Now the cached items that are inserted into expressions for virtual
      columns with datetime comparisons are always allocated in the same
      mem_root as the expressions for virtual columns. So now the inserted
      cached items are valid for any queries that use these virtual columns. 
      452860df
  33. 15 Jul, 2010 1 commit
    • Igor Babaev's avatar
      Fixed bug #603186. · 40901007
      Igor Babaev authored
      There were two problems that caused wrong results reported with this bug.
      1. In some cases stored(persistent) virtual columns were not marked
      in the write_set and in the vcol_set bitmaps.
      2. If the list of fields in an insert command was empty then the values of
      the stored virtual columns were set to default.
      
      To fix the first problem the function st_table::mark_virtual_columns_for_write
      was modified. Now the function has a parameter that says whether the virtual 
      columns are to be marked for insert or for update.  
      To fix the second problem a special handling of empty insert lists is
      added in the function fill_record().
      40901007
  34. 10 Jul, 2010 1 commit
    • unknown's avatar
      Subquery cache (MWL#66) added. · ceb5468f
      unknown authored
      libmysqld/Makefile.am:
        The new file added.
      mysql-test/r/index_merge_myisam.result:
        subquery_cache optimization option added.
      mysql-test/r/myisam_mrr.result:
        subquery_cache optimization option added.
      mysql-test/r/subquery_cache.result:
        The subquery cache tests added.
      mysql-test/r/subselect3.result:
        Subquery cache switched off to avoid changing read statistics.
      mysql-test/r/subselect3_jcl6.result:
        Subquery cache switched off to avoid changing read statistics.
      mysql-test/r/subselect_no_mat.result:
        subquery_cache optimization option added.
      mysql-test/r/subselect_no_opts.result:
        subquery_cache optimization option added.
      mysql-test/r/subselect_no_semijoin.result:
        subquery_cache optimization option added.
      mysql-test/r/subselect_sj.result:
        subquery_cache optimization option added.
      mysql-test/r/subselect_sj_jcl6.result:
        subquery_cache optimization option added.
      mysql-test/t/subquery_cache.test:
        The subquery cache tests added.
      mysql-test/t/subselect3.test:
        Subquery cache switched off to avoid changing read statistics.
      sql/CMakeLists.txt:
        The new file added.
      sql/Makefile.am:
        The new files added.
      sql/item.cc:
        Expression cache item (Item_cache_wrapper) added.
        Item_ref and Item_field fixed for correct usage of result field and fast resolwing in SP.
      sql/item.h:
        Expression cache item (Item_cache_wrapper) added.
        Item_ref and Item_field fixed for correct usage of result field and fast resolwing in SP.
      sql/item_cmpfunc.cc:
        Subquery cache added.
      sql/item_cmpfunc.h:
        Subquery cache added.
      sql/item_subselect.cc:
        Subquery cache added.
      sql/item_subselect.h:
        Subquery cache added.
      sql/item_sum.cc:
        Registration of subquery parameters added.
      sql/mysql_priv.h:
        subquery_cache optimization option added.
      sql/mysqld.cc:
        subquery_cache optimization option added.
      sql/opt_range.cc:
        Fix due to subquery cache.
      sql/opt_subselect.cc:
        Parameters of the function cahnged.
      sql/procedure.h:
        .h file guard added.
      sql/sql_base.cc:
        Registration of subquery parameters added.
      sql/sql_class.cc:
        Option to allow add indeces to temporary table.
      sql/sql_class.h:
        Item iterators added.
        Option to allow add indeces to temporary table.
      sql/sql_expression_cache.cc:
        Expression cache for caching subqueries added.
      sql/sql_expression_cache.h:
        Expression cache for caching subqueries added.
      sql/sql_lex.cc:
        Registration of subquery parameters added.
      sql/sql_lex.h:
        Registration of subqueries and subquery parameters added.
      sql/sql_select.cc:
        Subquery cache added.
      sql/sql_select.h:
        Subquery cache added.
      sql/sql_union.cc:
        A new parameter to the function added.
      sql/sql_update.cc:
        A new parameter to the function added.
      sql/table.cc:
        Procedures to manage temporarty tables index added.
      sql/table.h:
        Procedures to manage temporarty tables index added.
      storage/maria/ha_maria.cc:
        Fix of handler to allow destoy a table in case of error during the table creation.
      storage/maria/ha_maria.h:
        .h file guard added.
      storage/myisam/ha_myisam.cc:
        Fix of handler to allow destoy a table in case of error during the table creation.
      ceb5468f
  35. 02 Jul, 2010 1 commit
    • Davi Arnaut's avatar
      Bug#53445: Build with -Wall and fix warnings that it generates · 0eb26fdf
      Davi Arnaut authored
      Apart strict-aliasing warnings, fix the remaining warnings
      generated by GCC 4.4.4 -Wall and -Wextra flags.
      
      One major source of warnings was the in-house function my_bcmp
      which (unconventionally) took pointers to unsigned characters
      as the byte sequences to be compared. Since my_bcmp and bcmp
      are deprecated functions whose only difference with memcmp is
      the return value, every use of the function is replaced with
      memcmp as the special return value wasn't actually being used
      by any caller.
      
      There were also various other warnings, mostly due to type
      mismatches, missing return values, missing prototypes, dead
      code (unreachable) and ignored return values.
      
      BUILD/SETUP.sh:
        Remove flags that are implied by -Wall and -Wextra.
        Do not warn about unused parameters in C++.
      BUILD/check-cpu:
        Print only the compiler version instead of verbose banner.
        Although the option is gcc specific, the check was only
        being used for GCC specific checks anyway.
      client/mysql.cc:
        bcmp is no longer defined.
      client/mysqltest.cc:
        Pass a string to function expecting a format string.
        Replace use of bcmp with memcmp.
      cmd-line-utils/readline/Makefile.am:
        Always define _GNU_SOURCE when compiling GNU readline.
        Required to make certain prototypes visible.
      cmd-line-utils/readline/input.c:
        Condition for the code to be meaningful.
      configure.in:
        Remove check for bcmp.
      extra/comp_err.c:
        Use appropriate type.
      extra/replace.c:
        Replace use of bcmp with memcmp.
      extra/yassl/src/crypto_wrapper.cpp:
        Do not ignore the return value of fgets. Retrieve the file
        position if fgets succeed -- if it fails, the function will
        bail out and return a error.
      extra/yassl/taocrypt/include/blowfish.hpp:
        Use a single array instead of accessing positions of the sbox_
        through a subscript to pbox_.
      extra/yassl/taocrypt/include/runtime.hpp:
        One definition of such functions is enough.
      extra/yassl/taocrypt/src/aes.cpp:
        Avoid potentially ambiguous conditions.
      extra/yassl/taocrypt/src/algebra.cpp:
        Rename arguments to avoid shadowing related warnings.
      extra/yassl/taocrypt/src/blowfish.cpp:
        Avoid potentially ambiguous conditions.
      extra/yassl/taocrypt/src/integer.cpp:
        Do not define type within a anonymous union.
        Use a variable to return a value instead of
        leaving the result in a register -- compiler
        does not know the logic inside the asm.
      extra/yassl/taocrypt/src/misc.cpp:
        Define handler for pure virtual functions.
        Remove unused code.
      extra/yassl/taocrypt/src/twofish.cpp:
        Avoid potentially ambiguous conditions.
      extra/yassl/testsuite/test.hpp:
        Function must have C language linkage.
      include/m_string.h:
        Remove check which relied on bcmp being defined -- they weren't
        being used as bcmp is only visible when _BSD_SOURCE is defined.
      include/my_bitmap.h:
        Remove bogus helpers which were used only in a few files and
        were causing warnings about dead code.
      include/my_global.h:
        Due to G++ bug, always silence false-positive uninitialized
        variables warnings when compiling C++ code with G++.
        Remove bogus helper.
      libmysql/Makefile.shared:
        Remove built-in implementation of bcmp.
      mysql-test/lib/My/SafeProcess/safe_process.cc:
        Cast pid to largest possible type for a process identifier.
      mysys/mf_loadpath.c:
        Leave space of the ending nul.
      mysys/mf_pack.c:
        Replace bcmp with memcmp.
      mysys/my_bitmap.c:
        Dead code removal.
      mysys/my_gethwaddr.c:
        Remove unused variable.
      mysys/my_getopt.c:
        Silence bogus uninitialized variable warning.
        Do not cast away the constant qualifier.
      mysys/safemalloc.c:
        Cast to expected type.
      mysys/thr_lock.c:
        Silence bogus uninitialized variable warning.
      sql/field.cc:
        Replace bogus helper with a more appropriate logic which is
        used throughout the code.
      sql/item.cc:
        Remove bogus logical condition which always evaluates to TRUE.
      sql/item_create.cc:
        Simplify code to avoid signedness related warnings.
      sql/log_event.cc:
        Replace use of bcmp with memcmp.
        No need to use helpers for simple bit operations.
      sql/log_event_old.cc:
        Replace bmove_align with memcpy.
      sql/mysqld.cc:
        Move use declaration of variable to the ifdef block where it
        is used. Remove now-unnecessary casts and arguments.
      sql/set_var.cc:
        Replace bogus helpers with simple and classic bit operations.
      sql/slave.cc:
        Cast to expected type and silence bogus warning.
      sql/sql_class.h:
        Don't use enum values as bit flags, the supposed type safety is
        bogus as the combined bit flags are not a value in the enumeration.
      sql/udf_example.c:
        Only declare variable when necessary.
      sql/unireg.h:
        Replace use of bmove_align with memcpy.
      storage/innobase/os/os0file.c:
        Silence bogus warning.
      storage/myisam/mi_open.c:
        Remove bogus cast, DBUG_DUMP expects a pointer to unsigned
        char.
      storage/myisam/mi_page.c:
        Remove bogus cast, DBUG_DUMP expects a pointer to unsigned
        char.
      strings/bcmp.c:
        Remove built-in bcmp.
      strings/ctype-ucs2.c:
        Silence bogus warning.
      tests/mysql_client_test.c:
        Use a appropriate type as expected by simple_command().
      0eb26fdf