Commit graph

1710 commits

Author SHA1 Message Date
Sergei Golubchik
4ee5ae3e7f 5.1 merge 2013-05-20 10:53:04 +02:00
Venkatesh Duggirala
7397aa913d Bug#14236170 MYSQLDUMP 5.5.25 CLIENT FAILS TO DUMP
MYSQL DB FROM REMOTE 5.0.96 SERVER

Problem: mysqldump tool assumes the existence of
general_log and slow_log tables in the server.
If mysqldump tool executes on a old server where
there are no log tables like these, mysqldump tool
fails.

Analysis: general_log and slow_log tables are added
in the ignore-table list as part of bug-26121 fix
causes bug-45740 (MYSQLDUMP DOESN'T DUMP GENERAL_LOG
AND SLOW_QUERY CAUSES RESTORE PROBLEM). As part of
the bug-45740 fix, mysqldump tool adds create table
queries for these two tables. But the fix assumes
that on all the servers, general_log and slow_log
will be there. If the new mysqldump tool is executed
against a old server where there are no general_log
and slow_log, the mysqldump tool fails with an error
that 'there is no general_log table'.

Fix: When mysqldump tool is trying to retrieve general_log
and slow_log table structures, first the tool should
check their existence of these tables in the server
instead of trying to dump it blindly.
2013-05-17 18:54:36 +05:30
Venkatesh Duggirala
0dd7348f72 Bug#14236170 MYSQLDUMP 5.5.25 CLIENT FAILS TO DUMP
MYSQL DB FROM REMOTE 5.0.96 SERVER

Problem: mysqldump tool assumes the existence of
general_log and slow_log tables in the server.
If mysqldump tool executes on a old server where
there are no log tables like these, mysqldump tool
fails.

Analysis: general_log and slow_log tables are added
in the ignore-table list as part of bug-26121 fix
causes bug-45740 (MYSQLDUMP DOESN'T DUMP GENERAL_LOG
AND SLOW_QUERY CAUSES RESTORE PROBLEM). As part of
the bug-45740 fix, mysqldump tool adds create table
queries for these two tables. But the fix assumes
that on all the servers, general_log and slow_log
will be there. If the new mysqldump tool is executed
against a old server where there are no general_log
and slow_log, the mysqldump tool fails with an error
that 'there is no general_log table'.

Fix: When mysqldump tool is trying to retrieve general_log
and slow_log table structures, first the tool should
check their existence of these tables in the server
instead of trying to dump it blindly.
2013-05-17 18:54:36 +05:30
Michael Widenius
4b9a6c03fa Fixed compiler warning 2013-05-11 18:57:06 +03:00
Sergei Golubchik
b381cf843c mysql-5.5.31 merge 2013-05-07 13:05:09 +02:00
Sergei Golubchik
a9035be5b7 10.0-base merge 2013-04-15 15:09:22 +02:00
Venkatesh Duggirala
0fe3128c94 BUG#16615117 MYSQLDUMP PRODUCES A CHANGE MASTER STATEMENT
WITH A PORT NUMBER ENCLOSED IN QUOTES

Problem: mysqldump --dump-slave --include-master-host-port
prints the CHANGE MASTER command in the generated logical
backup. The PORT number that is generated with this command
is a string and should be an integer.

Fix: Remove the Enclosed quotes for port number.
2013-04-12 14:18:21 +05:30
Venkatesh Duggirala
40360f0259 BUG#16615117 MYSQLDUMP PRODUCES A CHANGE MASTER STATEMENT
WITH A PORT NUMBER ENCLOSED IN QUOTES

Problem: mysqldump --dump-slave --include-master-host-port
prints the CHANGE MASTER command in the generated logical
backup. The PORT number that is generated with this command
is a string and should be an integer.

Fix: Remove the Enclosed quotes for port number.
2013-04-12 14:18:21 +05:30
Sergei Golubchik
993ea79f2d 5.5 merge 2013-03-27 23:41:02 +01:00
Murthy Narkedimilli
8afe262ae5 Fix for Bug 16395495 - OLD FSF ADDRESS IN GPL HEADER 2013-03-19 15:53:48 +01:00
Murthy Narkedimilli
d978016d93 Fix for Bug 16395495 - OLD FSF ADDRESS IN GPL HEADER 2013-03-19 15:53:48 +01:00
Sergei Golubchik
8161c6772d merge with mysql-5.5.30 minus few incorrect or not applicable changesets 2013-02-28 18:42:49 +01:00
Murthy Narkedimilli
053d7e775c Updated/added copyright headers. 2013-02-25 15:26:00 +01:00
Murthy Narkedimilli
69d8812a61 Updated/added copyright headers. 2013-02-25 15:26:00 +01:00
Murthy Narkedimilli
8f73221035 Updated/added copyright headers 2013-02-26 06:35:17 +01:00
Murthy Narkedimilli
03295edb41 Updated/added copyright headers 2013-02-26 06:35:17 +01:00
Sergei Golubchik
ab83952f29 10.0-base merge 2013-01-31 09:48:19 +01:00
Sergei Golubchik
0af4b6c6ee 5.5 merge 2013-01-29 15:10:47 +01:00
Sergei Golubchik
672b293860 5.3 merge
client/mysqltest.cc:
  make --error to work for --change_user errors
2013-01-25 11:24:42 +01:00
Sergei Golubchik
de10e21411 5.2 merge 2013-01-25 10:20:45 +01:00
Sergei Golubchik
9142c50b07 MDEV-4040 Replace deprecated SET OPTION syntax in mysqldump
mysqldump.c: s/SET OPTION/SET/
(OPTION was, hm, optional since 3.21, so there's no need to use SET OPTION even
in the old compatibility modes)
2013-01-25 10:19:35 +01:00
Sergei Golubchik
682da0aa75 cleanup: use MYF() for mysys flags 2013-01-23 16:18:09 +01:00
Michael Widenius
a260b15554 MDEV-4011 Added per thread memory counting and usage
Base code and idea from a patch from by plinux at Taobao.

The idea is that we mark all memory that are thread specific with MY_THREAD_SPECIFIC.
Memory counting is done per thread in the my_malloc_size_cb_func callback function from my_malloc().
There are plenty of new asserts to ensure that for a debug server the counting is correct.

Information_schema.processlist gets two new columns: MEMORY_USED and EXAMINED_ROWS.
- The later is there mainly to show how query is progressing.

The following changes in interfaces was needed to get this to work:
- init_alloc_root() amd init_sql_alloc() has extra option so that one can mark memory with MY_THREAD_SPECIFIC
- One now have to use alloc_root_set_min_malloc() to set min memory to be allocated by alloc_root()
- my_init_dynamic_array()  has extra option so that one can mark memory with MY_THREAD_SPECIFIC
- my_net_init() has extra option so that one can mark memory with MY_THREAD_SPECIFIC
- Added flag for hash_init() so that one can mark hash table to be thread specific.
- Added flags to init_tree() so that one can mark tree to be thread specific.
- Removed with_delete option to init_tree(). Now one should instead use MY_TREE_WITH_DELETE_FLAG.
- Added flag to Warning_info::Warning_info() if the structure should be fully initialized.
- String elements can now be marked as thread specific.
- Internal HEAP tables are now marking it's memory as MY_THREAD_SPECIFIC.
- Changed type of myf from int to ulong, as this is always a set of bit flags.

Other things:
- Removed calls to net_end() and thd->cleanup() as these are now done in ~THD()
- We now also show EXAMINED_ROWS in SHOW PROCESSLIST
- Added new variable 'memory_used'
- Fixed bug where kill_threads_for_user() was using the wrong mem_root to allocate memory.
- Removed calls to the obsoleted function init_dynamic_array()
- Use set_current_thd() instead of my_pthread_setspecific_ptr(THR_THD,...)


client/completion_hash.cc:
  Updated call to init_alloc_root()
client/mysql.cc:
  Updated call to init_alloc_root()
client/mysqlbinlog.cc:
  init_dynamic_array() -> my_init_dynamic_array()
  Updated call to init_alloc_root()
client/mysqlcheck.c:
  Updated call to my_init_dynamic_array()
client/mysqldump.c:
  Updated call to init_alloc_root()
client/mysqltest.cc:
  Updated call to init_alloc_root()
  Updated call to my_init_dynamic_array()
  Fixed compiler warnings
extra/comp_err.c:
  Updated call to my_init_dynamic_array()
extra/resolve_stack_dump.c:
  Updated call to my_init_dynamic_array()
include/hash.h:
  Added HASH_THREAD_SPECIFIC
include/heap.h:
  Added flag is internal temporary table.
include/my_dir.h:
  Safety fix: Ensure that MY_DONT_SORT and MY_WANT_STAT don't interfer with other mysys flags
include/my_global.h:
  Changed type of myf from int to ulong, as this is always a set of bit flags.
include/my_sys.h:
  Added MY_THREAD_SPECIFIC and MY_THREAD_MOVE
  Added malloc_flags to DYNAMIC_ARRAY
  Added extra mysys flag argument to my_init_dynamic_array()
  Removed deprecated functions init_dynamic_array() and my_init_dynamic_array.._ci
  Updated paramaters for init_alloc_root()
include/my_tree.h:
  Added my_flags to allow one to use MY_THREAD_SPECIFIC with hash tables.
  Removed with_delete. One should now instead use MY_TREE_WITH_DELETE_FLAG
  Updated parameters to init_tree()
include/myisamchk.h:
  Added malloc_flags to allow one to use MY_THREAD_SPECIFIC for checks.
include/mysql.h:
  Added MYSQL_THREAD_SPECIFIC_MALLOC
  Used 'unused1' to mark memory as thread specific.
include/mysql.h.pp:
  Updated file
include/mysql_com.h:
  Used 'unused1' to mark memory as thread specific.
  Updated parameters for my_net_init()
libmysql/libmysql.c:
  Updated call to init_alloc_root() to mark memory thread specific.
libmysqld/emb_qcache.cc:
  Updated call to init_alloc_root()
libmysqld/lib_sql.cc:
  Updated call to init_alloc_root()
mysql-test/r/create.result:
  Updated results
mysql-test/r/user_var.result:
  Updated results
mysql-test/suite/funcs_1/datadict/processlist_priv.inc:
  Update to handle new format of SHOW PROCESSLIST
mysql-test/suite/funcs_1/datadict/processlist_val.inc:
  Update to handle new format of SHOW PROCESSLIST
mysql-test/suite/funcs_1/r/is_columns_is.result:
  Update to handle new format of SHOW PROCESSLIST
mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result:
  Updated results
mysql-test/suite/funcs_1/r/processlist_val_no_prot.result:
  Updated results
mysql-test/t/show_explain.test:
  Fixed usage of debug variable so that one can run test with --debug
mysql-test/t/user_var.test:
  Added test of memory_usage variable.
mysys/array.c:
  Added extra my_flags option to init_dynamic_array() and init_dynamic_array2() so that one can mark memory with MY_THREAD_SPECIFIC
  All allocated memory is marked with the given my_flags.
  Removed obsolete function init_dynamic_array()
mysys/default.c:
  Updated call to init_alloc_root()
  Updated call to my_init_dynamic_array()
mysys/hash.c:
  Updated call to my_init_dynamic_array_ci().
  Allocated memory is marked with MY_THREAD_SPECIFIC if HASH_THREAD_SPECIFIC is used.
mysys/ma_dyncol.c:
  init_dynamic_array() -> my_init_dynamic_array()
  Added #if to get rid of compiler warnings
mysys/mf_tempdir.c:
  Updated call to my_init_dynamic_array()
mysys/my_alloc.c:
  Added extra parameter to init_alloc_root() so that one can mark memory with MY_THREAD_SPECIFIC
  Extend MEM_ROOT with a flag if memory is thread specific.
  This is stored in block_size, to keep the size of the MEM_ROOT object identical as before.
  Allocated memory is marked with MY_THREAD_SPECIFIC if used with init_alloc_root()
mysys/my_chmod.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_chsize.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_copy.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_create.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_delete.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_error.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_fopen.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_fstream.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_getwd.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_lib.c:
  Updated call to init_alloc_root()
  Updated call to my_init_dynamic_array()
  Updated DBUG_PRINT because of change of myf type
mysys/my_lock.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_malloc.c:
  Store at start of each allocated memory block the size of the block and if the block is thread specific.
  Call malloc_size_cb_func, if set, with the memory allocated/freed.
  Updated DBUG_PRINT because of change of myf type
mysys/my_open.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_pread.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_read.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_redel.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_rename.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_seek.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_sync.c:
  Updated DBUG_PRINT because of change of myf type
mysys/my_thr_init.c:
  Ensure that one can call my_thread_dbug_id() even if thread is not properly initialized.
mysys/my_write.c:
  Updated DBUG_PRINT because of change of myf type
mysys/mysys_priv.h:
  Updated parameters to sf_malloc and sf_realloc()
mysys/safemalloc.c:
  Added checking that for memory marked with MY_THREAD_SPECIFIC that it's the same thread that is allocation and freeing the memory.
  Added sf_malloc_dbug_id() to allow MariaDB to specify which THD is handling the memory.
  Added my_flags arguments to sf_malloc() and sf_realloc() to be able to mark memory with MY_THREAD_SPECIFIC.
  Added sf_report_leaked_memory() to get list of memory not freed by a thread.
mysys/tree.c:
  Added flags to init_tree() so that one can mark tree to be thread specific.
  Removed with_delete option to init_tree(). Now one should instead use MY_TREE_WITH_DELETE_FLAG.
  Updated call to init_alloc_root()
  All allocated memory is marked with the given malloc flags
mysys/waiting_threads.c:
  Updated call to my_init_dynamic_array()
sql-common/client.c:
  Updated call to init_alloc_root() and my_net_init() to mark memory thread specific.
  Updated call to my_init_dynamic_array().
  Added MYSQL_THREAD_SPECIFIC_MALLOC so that client can mark memory as MY_THREAD_SPECIFIC.
sql-common/client_plugin.c:
  Updated call to init_alloc_root()
sql/debug_sync.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
sql/event_scheduler.cc:
  Removed calls to net_end() as this is now done in ~THD()
  Call set_current_thd() to ensure that memory is assigned to right thread.
sql/events.cc:
  my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/filesort.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
sql/filesort_utils.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
sql/ha_ndbcluster.cc:
  Updated call to init_alloc_root()
  Updated call to my_net_init()
  Removed calls to net_end() and thd->cleanup() as these are now done in ~THD()
sql/ha_ndbcluster_binlog.cc:
  Updated call to my_net_init()
  Updated call to init_sql_alloc()
  Removed calls to net_end() and thd->cleanup() as these are now done in ~THD()
sql/ha_partition.cc:
  Updated call to init_alloc_root()
sql/handler.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
  Added missing call to my_dir_end()
sql/item_func.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
sql/item_subselect.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
sql/item_sum.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
sql/log.cc:
  More DBUG
  Updated call to init_alloc_root()
sql/mdl.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
sql/mysqld.cc:
  Added total_memory_used
  Updated call to init_alloc_root()
  Move mysql_cond_broadcast() before my_thread_end()
  Added mariadb_dbug_id() to count memory per THD instead of per thread.
  Added my_malloc_size_cb_func() callback function for my_malloc() to count memory.
  Move initialization of mysqld_server_started and mysqld_server_initialized earlier.
  Updated call to my_init_dynamic_array().
  Updated call to my_net_init().
  Call my_pthread_setspecific_ptr(THR_THD,...) to ensure that memory is assigned to right thread.
  Added status variable 'memory_used'.
  Updated call to init_alloc_root()
  my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/mysqld.h:
  Added set_current_thd()
sql/net_serv.cc:
  Added new parameter to my_net_init() so that one can mark memory with MY_THREAD_SPECIFIC.
  Store in net->thread_specific_malloc if memory is thread specific.
  Mark memory to be thread specific if requested.
sql/opt_range.cc:
  Updated call to my_init_dynamic_array()
  Updated call to init_sql_alloc()
  Added MY_THREAD_SPECIFIC to allocated memory.
sql/opt_subselect.cc:
  Updated call to init_sql_alloc() to mark memory thread specific.
sql/protocol.cc:
  Fixed compiler warning
sql/records.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
sql/rpl_filter.cc:
  Updated call to my_init_dynamic_array()
sql/rpl_handler.cc:
  Updated call to my_init_dynamic_array2()
sql/rpl_handler.h:
  Updated call to init_sql_alloc()
sql/rpl_mi.cc:
  Updated call to my_init_dynamic_array()
sql/rpl_tblmap.cc:
  Updated call to init_alloc_root()
sql/rpl_utility.cc:
  Updated call to my_init_dynamic_array()
sql/slave.cc:
  Initialize things properly before calling functions that allocate memory.
  Removed calls to net_end() as this is now done in ~THD()
sql/sp_head.cc:
  Updated call to init_sql_alloc()
  Updated call to my_init_dynamic_array()
  Added parameter to warning_info() that it should be fully initialized.
sql/sp_pcontext.cc:
  Updated call to my_init_dynamic_array()
sql/sql_acl.cc:
  Updated call to init_sql_alloc()
  Updated call to my_init_dynamic_array()
  my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/sql_admin.cc:
  Added parameter to warning_info() that it should be fully initialized.
sql/sql_analyse.h:
  Updated call to init_tree() to mark memory thread specific.
sql/sql_array.h:
  Updated call to my_init_dynamic_array() to mark memory thread specific.
sql/sql_audit.cc:
  Updated call to my_init_dynamic_array()
sql/sql_base.cc:
  Updated call to init_sql_alloc()
  my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/sql_cache.cc:
  Updated comment
sql/sql_class.cc:
  Added parameter to warning_info() that not initialize it until THD is fully created.
  Updated call to init_sql_alloc()
  Mark THD::user_vars has to be thread specific.
  Updated call to my_init_dynamic_array()
  Ensure that memory allocated by THD is assigned to the THD.
  More DBUG
  Always acll net_end() in ~THD()
  Assert that all memory signed to this THD is really deleted at ~THD.
  Fixed set_status_var_init() to not reset memory_used.
  my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/sql_class.h:
  Added MY_THREAD_SPECIFIC to allocated memory.
  Added malloc_size to THD to record allocated memory per THD.
sql/sql_delete.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
sql/sql_error.cc:
  Added 'initialize' parameter to Warning_info() to say if should allocate memory for it's structures.
  This is used by THD::THD() to not allocate memory until THD is ready.
  Added Warning_info::free_memory()
sql/sql_error.h:
  Updated Warning_info() class.
sql/sql_handler.cc:
  Updated call to init_alloc_root() to mark memory thread specific.
sql/sql_insert.cc:
  More DBUG
sql/sql_join_cache.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
sql/sql_lex.cc:
  Updated call to my_init_dynamic_array()
sql/sql_lex.h:
  Updated call to my_init_dynamic_array()
sql/sql_load.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
sql/sql_parse.cc:
  Removed calls to net_end() and thd->cleanup() as these are now done in ~THD()
  Ensure that examined_row_count() is reset before query.
  Fixed bug where kill_threads_for_user() was using the wrong mem_root to allocate memory.
  my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
  Don't restore thd->status_var.memory_used when restoring thd->status_var
sql/sql_plugin.cc:
  Updated call to init_alloc_root()
  Updated call to my_init_dynamic_array()
  Don't allocate THD on the stack, as this causes problems with valgrind when doing thd memory counting.
  my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/sql_prepare.cc:
  Added parameter to warning_info() that it should be fully initialized.
  Updated call to init_sql_alloc() to mark memory thread specific.
sql/sql_reload.cc:
  my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/sql_select.cc:
  Updated call to my_init_dynamic_array() and init_sql_alloc() to mark memory thread specific.
  Added MY_THREAD_SPECIFIC to allocated memory.
  More DBUG
sql/sql_servers.cc:
  Updated call to init_sql_alloc() to mark memory some memory thread specific.
  my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/sql_show.cc:
  Updated call to my_init_dynamic_array()
  Mark my_dir() memory thread specific.
  Use my_pthread_setspecific_ptr(THR_THD,...) to mark that allocated memory should be allocated to calling thread.
  More DBUG.
  Added malloc_size and examined_row_count to SHOW PROCESSLIST.
  Added MY_THREAD_SPECIFIC to allocated memory.
  Updated call to init_sql_alloc()
  Added parameter to warning_info() that it should be fully initialized.
sql/sql_statistics.cc:
  Fixed compiler warning
sql/sql_string.cc:
  String elements can now be marked as thread specific.
sql/sql_string.h:
  String elements can now be marked as thread specific.
sql/sql_table.cc:
  Updated call to init_sql_alloc() and my_malloc() to mark memory thread specific
  my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
  Fixed compiler warning
sql/sql_test.cc:
  Updated call to my_init_dynamic_array() to mark memory thread specific.
sql/sql_trigger.cc:
  Updated call to init_sql_alloc()
sql/sql_udf.cc:
  Updated call to init_sql_alloc()
  my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/sql_update.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
sql/table.cc:
  Updated call to init_sql_alloc().
  Mark memory used by temporary tables, that are not for slave threads, as MY_THREAD_SPECIFIC
  Updated call to init_sql_alloc()
sql/thr_malloc.cc:
  Added my_flags argument to init_sql_alloc() to be able to mark memory as MY_THREAD_SPECIFIC.
sql/thr_malloc.h:
  Updated prototype for init_sql_alloc()
sql/tztime.cc:
  Updated call to init_sql_alloc()
  Updated call to init_alloc_root() to mark memory thread specific.
  my_pthread_setspecific_ptr(THR_THD,...) -> set_current_thd()
sql/uniques.cc:
  Updated calls to init_tree(), my_init_dynamic_array() and my_malloc() to mark memory thread specific.
sql/unireg.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
storage/csv/ha_tina.cc:
  Updated call to init_alloc_root()
storage/federated/ha_federated.cc:
  Updated call to init_alloc_root()
  Updated call to my_init_dynamic_array()
  Ensure that memory allocated by fedarated is registered for the system, not for the thread.
storage/federatedx/federatedx_io_mysql.cc:
  Updated call to my_init_dynamic_array()
storage/federatedx/ha_federatedx.cc:
  Updated call to init_alloc_root()
  Updated call to my_init_dynamic_array()
storage/heap/ha_heap.cc:
  Added MY_THREAD_SPECIFIC to allocated memory.
storage/heap/heapdef.h:
  Added parameter to hp_get_new_block() to be able to do thread specific memory tagging.
storage/heap/hp_block.c:
  Added parameter to hp_get_new_block() to be able to do thread specific memory tagging.
storage/heap/hp_create.c:
  - Internal HEAP tables are now marking it's memory as MY_THREAD_SPECIFIC.
  - Use MY_TREE_WITH_DELETE instead of removed option 'with_delete'.
storage/heap/hp_open.c:
  Internal HEAP tables are now marking it's memory as MY_THREAD_SPECIFIC.
storage/heap/hp_write.c:
  Added new parameter to hp_get_new_block()
storage/maria/ma_bitmap.c:
  Updated call to my_init_dynamic_array()
storage/maria/ma_blockrec.c:
  Updated call to my_init_dynamic_array()
storage/maria/ma_check.c:
  Updated call to init_alloc_root()
storage/maria/ma_ft_boolean_search.c:
  Updated calls to init_tree() and init_alloc_root()
storage/maria/ma_ft_nlq_search.c:
  Updated call to init_tree()
storage/maria/ma_ft_parser.c:
  Updated call to init_tree()
  Updated call to init_alloc_root()
storage/maria/ma_loghandler.c:
  Updated call to my_init_dynamic_array()
storage/maria/ma_open.c:
  Updated call to my_init_dynamic_array()
storage/maria/ma_sort.c:
  Updated call to my_init_dynamic_array()
storage/maria/ma_write.c:
  Updated calls to my_init_dynamic_array() and init_tree()
storage/maria/maria_pack.c:
  Updated call to init_tree()
storage/maria/unittest/sequence_storage.c:
  Updated call to my_init_dynamic_array()
storage/myisam/ft_boolean_search.c:
  Updated call to init_tree()
  Updated call to init_alloc_root()
storage/myisam/ft_nlq_search.c:
  Updated call to init_tree()
storage/myisam/ft_parser.c:
  Updated call to init_tree()
  Updated call to init_alloc_root()
storage/myisam/ft_stopwords.c:
  Updated call to init_tree()
storage/myisam/mi_check.c:
  Updated call to init_alloc_root()
storage/myisam/mi_write.c:
  Updated call to my_init_dynamic_array()
  Updated call to init_tree()
storage/myisam/myisamlog.c:
  Updated call to init_tree()
storage/myisam/myisampack.c:
  Updated call to init_tree()
storage/myisam/sort.c:
  Updated call to my_init_dynamic_array()
storage/myisammrg/ha_myisammrg.cc:
  Updated call to init_sql_alloc()
storage/perfschema/pfs_check.cc:
  Rest current_thd
storage/perfschema/pfs_instr.cc:
  Removed DBUG_ENTER/DBUG_VOID_RETURN as at this point my_thread_var is not allocated anymore, which can cause problems.
support-files/compiler_warnings.supp:
  Disable compiler warning from offsetof macro.
2013-01-23 16:16:14 +01:00
Anirudh Mangipudi
01208b5b0f BUG#14117025: UNABLE TO RESTORE DUMP
Problem: When a view, with a specific character set and collation, 
is created on another view with a different character set and collation the 
dump restoration results in an illegal mix of collations error.
SOLUTION: To avoid this confusion of collations, the create table datatype 
being used is hardcoded as "tinyint NOT NULL". This will not matter as the table 
created will be dropped at runtime and specifically tinyint is used to 
avoid hitting the row size conflicts.
2013-01-16 18:26:27 +05:30
Anirudh Mangipudi
cd3b2ac9b7 BUG#14117025: UNABLE TO RESTORE DUMP
Problem: When a view, with a specific character set and collation, 
is created on another view with a different character set and collation the 
dump restoration results in an illegal mix of collations error.
SOLUTION: To avoid this confusion of collations, the create table datatype 
being used is hardcoded as "tinyint NOT NULL". This will not matter as the table 
created will be dropped at runtime and specifically tinyint is used to 
avoid hitting the row size conflicts.
2013-01-16 18:26:27 +05:30
Igor Babaev
1ef07d0845 Merge 10.0-base -> 10.0.
Also fixed a bug in sql_update.cc: the code of mysql_update() lacked
a call of set_statistics_for_table().
2013-01-10 22:33:23 -08:00
Igor Babaev
f853333e09 Merge 5.5-mwl248 -> 10.0-base 2013-01-08 19:34:33 -08:00
Sergei Golubchik
a128c50ac1 MDEV-3883 Show global status not in order 2013-01-08 21:23:40 +01:00
Igor Babaev
7760efad74 Merge mariadb-5.5 -> 10.0-base. 2012-12-16 16:49:19 -08:00
Michael Widenius
35b6020835 Fixed some compiler warnings
client/mysqldump.c:
  Removed compiler warning
extra/yassl/taocrypt/include/pwdbased.hpp:
  Removed compiler warning (iterations is always unsigned)
support-files/compiler_warnings.supp:
  Ignore warnings from groff
2012-12-19 21:58:05 +02:00
Vamsikrishna Bhagi
2217a9e38b Bug#14463669 FAILURE TO CORRECTLY PARSE ROUTINES IN
MYSQLDUMP OUTPUT

Problem: mysqldump when used with option --routines, dumps
         all the routines of the specified database into
         output. The statements in this output are written
         in such a way that they are version safe using C
         style version commenting (of the format
         /*!<version num> <sql statement>*/). If a semicolon
         is present right before closing of the comment in
         dump output, it results in a syntax error while
         importing.


Solution: Version comments for dumped routines are
          specifically to protect the ones older than 5.0.
          When the import is done on 5.0 or later versions,
          entire create statement gets executed as all the
          check conditions at the beginning of the comments
          are cleared. Since the trade off is between the
          performance of newer versions which are more in
          use and protection of very old versions which are
          no longer supported, it is proposed that these
          comments be removed altogether to maintain
          stability of the versions supported.

client/mysqldump.c:
  Bug#14463669 FAILURE TO CORRECTLY PARSE ROUTINES IN
               MYSQLDUMP OUTPUT
  
  Output of mysqldump is derived by getting the queries from
  show create and appending version comments to them.
  query_str is the variable used to store the final string.
  Since it is no longer required, its declaration and
  manipulations made on it are deleted. At the step where
  output is printed, query_str is replaced with the original
  query string derived from 'show create'.
2012-11-19 21:41:35 +05:30
Vamsikrishna Bhagi
f1e9b7219c Bug#14463669 FAILURE TO CORRECTLY PARSE ROUTINES IN
MYSQLDUMP OUTPUT

Problem: mysqldump when used with option --routines, dumps
         all the routines of the specified database into
         output. The statements in this output are written
         in such a way that they are version safe using C
         style version commenting (of the format
         /*!<version num> <sql statement>*/). If a semicolon
         is present right before closing of the comment in
         dump output, it results in a syntax error while
         importing.


Solution: Version comments for dumped routines are
          specifically to protect the ones older than 5.0.
          When the import is done on 5.0 or later versions,
          entire create statement gets executed as all the
          check conditions at the beginning of the comments
          are cleared. Since the trade off is between the
          performance of newer versions which are more in
          use and protection of very old versions which are
          no longer supported, it is proposed that these
          comments be removed altogether to maintain
          stability of the versions supported.
2012-11-19 21:41:35 +05:30
Anirudh Mangipudi
52a831289a BUG#11762933: MYSQLDUMP WILL SILENTLY SKIP THE EVENT
TABLE DATA IF DUMPS MYSQL DATABA
Problem: If mysqldump is run without --events (or with --skip-events)
it will not dump the mysql.event table's data. This behaviour is inconsistent
with that of --routines option, which does not affect the dumping of
mysql.proc table. According to the Manual, --events (--skip-events) defines,
if the Event Scheduler events for the dumped databases should be included
in the mysqldump output and this has nothing to do with the mysql.event table
itself.
Solution: A warning has been added when mysqldump is used without --events 
(or with --skip-events) and a separate patch with the behavioral change 
will be prepared for 5.6/trunk.
2012-11-09 15:16:49 +05:30
Anirudh Mangipudi
d97caadc22 BUG#11762933: MYSQLDUMP WILL SILENTLY SKIP THE EVENT
TABLE DATA IF DUMPS MYSQL DATABA
Problem: If mysqldump is run without --events (or with --skip-events)
it will not dump the mysql.event table's data. This behaviour is inconsistent
with that of --routines option, which does not affect the dumping of
mysql.proc table. According to the Manual, --events (--skip-events) defines,
if the Event Scheduler events for the dumped databases should be included
in the mysqldump output and this has nothing to do with the mysql.event table
itself.
Solution: A warning has been added when mysqldump is used without --events 
(or with --skip-events) and a separate patch with the behavioral change 
will be prepared for 5.6/trunk.
2012-11-09 15:16:49 +05:30
Anirudh Mangipudi
14dfe6fcc8 BUG#11762933: MYSQLDUMP WILL SILENTLY SKIP THE EVENT
TABLE DATA IF DUMPS MYSQL DATABA
Problem: If mysqldump is run without --events (or with --skip-events)
it will not dump the mysql.event table's data. This behaviour is inconsistent
with that of --routines option, which does not affect the dumping of
mysql.proc table. According to the Manual, --events (--skip-events) defines,
if the Event Scheduler events for the dumped databases should be included
in the mysqldump output and this has nothing to do with the mysql.event table
itself.
Solution: A warning has been added when mysqldump is used without --events 
(or with --skip-events) and a separate patch with the behavioral change 
will be prepared for 5.6/trunk.
2012-11-09 15:15:16 +05:30
Anirudh Mangipudi
27134cbd28 BUG#11762933: MYSQLDUMP WILL SILENTLY SKIP THE EVENT
TABLE DATA IF DUMPS MYSQL DATABA
Problem: If mysqldump is run without --events (or with --skip-events)
it will not dump the mysql.event table's data. This behaviour is inconsistent
with that of --routines option, which does not affect the dumping of
mysql.proc table. According to the Manual, --events (--skip-events) defines,
if the Event Scheduler events for the dumped databases should be included
in the mysqldump output and this has nothing to do with the mysql.event table
itself.
Solution: A warning has been added when mysqldump is used without --events 
(or with --skip-events) and a separate patch with the behavioral change 
will be prepared for 5.6/trunk.
2012-11-09 15:15:16 +05:30
unknown
3f59033536 Merge MariaDB 5.1.66 -> 5.2 -> 5.3 2012-11-09 10:11:20 +02:00
unknown
c5cef4b166 Merge MariaDB 5.1.66 -> 5.2.12 2012-11-08 15:24:35 +02:00
unknown
7c23d6d0c6 Merge MySQL 5.1.66 -> MariaDB 5.1.65 2012-11-06 11:52:55 +02:00
Sergei Golubchik
40e94a3734 merge with 5.5 2012-11-03 12:28:51 +01:00
Sergei Golubchik
e1f681c99b 10.0-base -> 10.0-monty 2012-10-19 20:38:59 +02:00
Sergei Golubchik
ee9afef271 mysql-5.5.28 2012-10-16 13:04:42 +02:00
Sergei Golubchik
474fe6d9d9 fixes for test failures
and small collateral changes

mysql-test/lib/My/Test.pm:
  somehow with "print" we get truncated writes sometimes
mysql-test/suite/perfschema/r/digest_table_full.result:
  md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/dml_handler.result:
  host table is not ported over yet
mysql-test/suite/perfschema/r/information_schema.result:
  host table is not ported over yet
mysql-test/suite/perfschema/r/nesting.result:
  this differs, because we don't rewrite general log queries, and multi-statement
  packets are logged as a one entry. this result file is identical to what mysql-5.6.5
  produces with the --log-raw option.
mysql-test/suite/perfschema/r/relaylog.result:
  MariaDB modifies the binlog index file directly, while MySQL 5.6 has a feature "crash-safe binlog index" and modifies a special "crash-safe" shadow copy of the index file and then moves it over. That's why this test shows "NONE" index file writes in MySQL and "MANY" in MariaDB.
mysql-test/suite/perfschema/r/server_init.result:
  MariaDB initializes the "manager" resources from the "manager" thread, and starts this thread only when --flush-time is not 0. MySQL 5.6 initializes "manager" resources unconditionally on server startup.
mysql-test/suite/perfschema/r/stage_mdl_global.result:
  this differs, because MariaDB disables query cache when query_cache_size=0. MySQL does not
  do that, and this causes useless mutex locks and waits.
mysql-test/suite/perfschema/r/statement_digest.result:
  md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/statement_digest_consumers.result:
  md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/perfschema/r/statement_digest_long_query.result:
  md5 hashes of statement digests differ, because yacc token codes are different in mariadb
mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result:
  will be updated to match 5.6 when alfranio.correia@oracle.com-20110512172919-c1b5kmum4h52g0ni and anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y are merged
mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result:
  will be updated to match 5.6 when anders.song@greatopensource.com-20110105052107-zoab0bsf5a6xxk2y is merged
2012-09-27 20:09:46 +02:00
Sergei Golubchik
b45c551ee3 MDEV-448 Memory loss warnings in mysqldump when more than one schema is dumped 2012-08-29 15:19:17 +02:00
Sergei Golubchik
f72a765997 5.2 merge.
two tests still fail:
  main.innodb_icp and main.range_vs_index_merge_innodb
  call records_in_range() with both range ends being open
  (which triggers an assert)
2012-08-22 16:45:25 +02:00
Sergei Golubchik
1fd8150a5b 5.1 merge
increase xtradb verson from 13.0 to 13.01
2012-08-22 16:13:54 +02:00
Sergei Golubchik
cefc30b166 merge with MySQL 5.1.65 2012-08-22 11:40:39 +02:00
Michael Widenius
60589aeee0 Next part of merge. See TODO for details 2012-08-14 17:23:34 +03:00
Michael Widenius
c0f04fa31c Automatic merge 2012-08-13 23:45:16 +03:00
Michael Widenius
cee888acb3 Fixed compiler warnings (A few of these was bugs)
client/mysqldump.c:
  Slave needs to be initialized with 0
dbug/dbug.c:
  Removed not existing function
plugin/semisync/semisync_master.cc:
  Fixed compiler warning
sql/opt_range.cc:
  thd needs to be set early as it's used in some error conditions.
sql/sql_table.cc:
  Changed to use uchar* to make array indexing portable
storage/innobase/handler/ha_innodb.cc:
  Removed not used variable
storage/maria/ma_delete.c:
  Fixed compiler warning
storage/maria/ma_write.c:
  Fixed compiler warning
2012-08-13 22:23:28 +03:00
Sergei Golubchik
d11829654c merge with MySQL 5.5.27
manually checked every change, reverted incorrect or stupid changes.
2012-08-09 17:22:00 +02:00
Nirbhay Choubey
ffdc4bc8cd Merge of patch for Bug#13928675 from mysql-5.1. 2012-08-07 19:07:13 +05:30
Nirbhay Choubey
fb697972b3 Merge of patch for Bug#13928675 from mysql-5.1. 2012-08-07 19:07:13 +05:30
Nirbhay Choubey
5ad8292c63 Bug#13928675 MYSQL CLIENT COPYRIGHT NOTICE MUST
SHOW 2012 INSTEAD OF 2011

* Added a new macro to hold the current year :
  COPYRIGHT_NOTICE_CURRENT_YEAR
* Modified ORACLE_WELCOME_COPYRIGHT_NOTICE macro
  to take the initial year as parameter and pick
  current year from the above mentioned macro.
2012-08-07 18:58:19 +05:30
Nirbhay Choubey
d4e4538b2d Bug#13928675 MYSQL CLIENT COPYRIGHT NOTICE MUST
SHOW 2012 INSTEAD OF 2011

* Added a new macro to hold the current year :
  COPYRIGHT_NOTICE_CURRENT_YEAR
* Modified ORACLE_WELCOME_COPYRIGHT_NOTICE macro
  to take the initial year as parameter and pick
  current year from the above mentioned macro.
2012-08-07 18:58:19 +05:30
Georgi Kodinov
9ce35ffc86 Bug #11753490: 44939: sql dumps containing broad views fail when
executing

The problem is that mysql lacks information about the objects a view
depends on so it can't dump views and tables in the proper order.
Thus it needs to create "stand-in" myisam tables for each view while 
dumping the tables that it later drops and replaces with the actual view
view definition.
But since views can have much more columns than an actual table creating
these stand-in tables may be problematic.

There's no way to portably find out how many columns an mysiam table
can have. It's a complicated formula depending on internal server constants.
Thus we can't have a reliable error check without repeating the logic and 
the formula inside mysqldump.

1. Changed the type of the columns of the stand-in tables mysqldump
makes to satisfy view dependencies from the original type to smallint 
to save on row space.

2. Added a warning on the mysqldump's standard error for a possible 
problems replaying the dump file if the columns of a view exceed 1000.

3. Added a test case.
2012-07-04 17:48:58 +03:00
Georgi Kodinov
e6f0b97b50 Bug #11753490: 44939: sql dumps containing broad views fail when
executing

The problem is that mysql lacks information about the objects a view
depends on so it can't dump views and tables in the proper order.
Thus it needs to create "stand-in" myisam tables for each view while 
dumping the tables that it later drops and replaces with the actual view
view definition.
But since views can have much more columns than an actual table creating
these stand-in tables may be problematic.

There's no way to portably find out how many columns an mysiam table
can have. It's a complicated formula depending on internal server constants.
Thus we can't have a reliable error check without repeating the logic and 
the formula inside mysqldump.

1. Changed the type of the columns of the stand-in tables mysqldump
makes to satisfy view dependencies from the original type to smallint 
to save on row space.

2. Added a warning on the mysqldump's standard error for a possible 
problems replaying the dump file if the columns of a view exceed 1000.

3. Added a test case.
2012-07-04 17:48:58 +03:00
Michael Widenius
aa67a198e8 automatic merge with 5.5 2012-06-27 17:22:23 +03:00
Michael Widenius
1999be8d4e Automatic merge with 5.5 2012-09-01 00:54:54 +03:00
Sergei Golubchik
bf5df8ccbf merge 2012-06-16 09:03:07 +02:00
Michael Widenius
7cd1dc5de2 Fix for: lp:1013432 and MySQL#64800:
mysqldump with --include-master-host-port putting quotes around port number
Patch from Stewart Smith

client/mysqldump.c:
  Remove quotes from MASTER_PORT
2012-06-15 13:08:10 +03:00
Sergei Golubchik
0522307ed1 mysql-5.5 merge 2012-06-14 20:05:31 +02:00
Michael Widenius
94d68777bb Fixed some compiler warnings and test failures found by buildbot
client/mysqldump.c:
  Added LINT_INIT
mysql-test/mysql-test-run.pl:
  Disable warning if example engine is not found
mysql-test/suite/rpl/t/rpl_semi_sync.test:
  Rpl_semi_sync_master_yes_tx may be different on Windows
sql/sql_plugin.cc:
  More DBUG_PRINT
support-files/compiler_warnings.supp:
  Disable some innobase warnings
unittest/mysys/my_vsnprintf-t.c:
  Fixed test failure on Solaris (typo)
2012-06-13 12:59:45 +03:00
Michael Widenius
56ea8e9c05 Fixed build failures found by buildbot
- Added suppression of warnings
- Fixed some test cases


BUILD/FINISH.sh:
  Added AM_EXTRA_MAKEFLAGS
BUILD/SETUP.sh:
  Added option --extra-makeflags
client/mysqldump.c:
  Added suppression
mysql-test/r/mysql.result:
  Updated results
mysql-test/r/mysql_upgrade.result:
  Updated results
mysql-test/r/partition_innodb_plugin.result:
  Updated results
mysql-test/r/partition_open_files_limit.result:
  Updated results
mysql-test/r/symlink.result:
  Updated results
mysql-test/suite/innodb/r/innodb-create-options.result:
  Updated results
mysql-test/suite/innodb/t/innodb-create-options.test:
  Don't print error message (as it's varies on different system)
mysql-test/t/mysql.test:
  Don't print error message (as it's varies on different system)
mysql-test/t/mysql_upgrade.test:
  Fixed checking of error number
mysql-test/t/partition_innodb_plugin.test:
  Don't print error message (as it's varies on different system)
plugin/semisync/semisync_master.cc:
  Added suppression
sql/ha_partition.cc:
  Added suppression
sql/item_subselect.cc:
  Added suppression
sql/multi_range_read.cc:
  Added suppression
sql/sql_parse.cc:
  Added suppression
sql/sql_select.cc:
  Added suppression
storage/innobase/handler/ha_innodb.cc:
  Removed not used variable
storage/maria/ma_delete.c:
  Added suppression
storage/maria/ma_key_recover.c:
  Added suppression
storage/maria/ma_write.c:
  Added suppression
strings/ctype-ucs2.c:
  Added suppression
support-files/compiler_warnings.supp:
  Added suppressions
unittest/mysys/my_vsnprintf-t.c:
  Fixed test case with %M to also work on Solaris
2012-06-05 14:09:18 +03:00
Venkata Sidagam
1d47bbe3bf Bug #11754178 45740: MYSQLDUMP DOESN'T DUMP GENERAL_LOG AND SLOW_QUERY
CAUSES RESTORE PROBLEM

Merging the fix from mysql-5.1 to mysql-5.5

mysql-test/t/mysqldump.test:
  There is a difference in the testcase which is added as 
  part of this fix, when compared with mysql-5.1. In mysql-5.5 
  and mysql-5.6, "DROP mysql database" fails by enabling 
  logging, hence removed those lines.
2012-05-07 16:51:26 +05:30
Venkata Sidagam
066dc9a281 Bug #11754178 45740: MYSQLDUMP DOESN'T DUMP GENERAL_LOG AND SLOW_QUERY
CAUSES RESTORE PROBLEM

Merging the fix from mysql-5.1 to mysql-5.5
2012-05-07 16:51:26 +05:30
Venkata Sidagam
e7364ec29c Bug #11754178 45740: MYSQLDUMP DOESN'T DUMP GENERAL_LOG AND SLOW_QUERY
CAUSES RESTORE PROBLEM
Problem Statement:
------------------
mysqldump is not having the dump stmts for general_log and slow_log
tables. That is because of the fix for Bug#26121. Hence, after 
dropping the mysql database, and applying the dump by enabling the 
logging, "'general_log' table not found" errors are logged into the 
server log file.

Analysis:
---------
As part of the fix for Bug#26121, we skipped the dumping of tables 
for general_log and slow_log, because the data dump of those tables 
are taking LOCKS, which is not allowed for log tables.

Fix:
----
We came up with an approach that instead of taking both meta data 
and data dump information for those tables, take only the meta data 
dump which doesn't need LOCKS.
As part of fixing the issue we came up with below algorithm.
Design before fix:
1) mysql database is having tables like db, event,... general_log,
   ... slow_log...
2) Skip general_log and slow_log while preparing the tables list
3) Take the TL_READ lock on tables which are present in the table 
   list and do 'show create table'.
4) Release the lock.

Design with the fix:
1) mysql database is having tables like db, event,... general_log,
   ... slow_log...
2) Skip general_log and slow_log while preparing the tables list
3) Explicitly call the 'show create table' for general_log and 
   slow_log
3) Take the TL_READ lock on tables which are present in the table 
   list and do 'show create table'.
4) Release the lock.

While taking the meta data dump for general_log and slow_log the 
"CREATE TABLE" is replaced with "CREATE TABLE IF NOT EXISTS". 
This is because we skipped "DROP TABLE" for those tables, 
"DROP TABLE" fails for these tables if logging is enabled. 
Customer is applying the dump by enabling logging so, if the dump 
has "DROP TABLE" it will fail. Hence, removed the "DROP TABLE" 
stmts for those tables.
  
After the fix we could observe "Table 'mysql.general_log' 
doesn't exist" errors initially that is because in the customer 
scenario they are dropping the mysql database by enabling the 
logging, Hence, those errors are expected. Once we apply the 
dump which is taken before the "drop database mysql", the errors 
will not be there.

client/mysqldump.c:
  In get_table_structure() added code to skip the DROP TABLE stmts for general_log
  and slow_log tables, because when logging is enabled those stmts will fail. And
  replaced CREATE TABLE with CREATE IF NOT EXISTS for those tables, just to make 
  sure CREATE stmt for those tables doesn't fail since we removed DROP stmts for
  those tables.
  In dump_all_tables_in_db() added code to call get_table_structure() for 
  general_log and slow_log tables.
mysql-test/r/mysqldump.result:
  Added a test as part of fix for Bug #11754178
mysql-test/t/mysqldump.test:
  Added a test as part of fix for Bug #11754178
2012-05-07 16:46:44 +05:30
Venkata Sidagam
14aa2c020e Bug #11754178 45740: MYSQLDUMP DOESN'T DUMP GENERAL_LOG AND SLOW_QUERY
CAUSES RESTORE PROBLEM
Problem Statement:
------------------
mysqldump is not having the dump stmts for general_log and slow_log
tables. That is because of the fix for Bug#26121. Hence, after 
dropping the mysql database, and applying the dump by enabling the 
logging, "'general_log' table not found" errors are logged into the 
server log file.

Analysis:
---------
As part of the fix for Bug#26121, we skipped the dumping of tables 
for general_log and slow_log, because the data dump of those tables 
are taking LOCKS, which is not allowed for log tables.

Fix:
----
We came up with an approach that instead of taking both meta data 
and data dump information for those tables, take only the meta data 
dump which doesn't need LOCKS.
As part of fixing the issue we came up with below algorithm.
Design before fix:
1) mysql database is having tables like db, event,... general_log,
   ... slow_log...
2) Skip general_log and slow_log while preparing the tables list
3) Take the TL_READ lock on tables which are present in the table 
   list and do 'show create table'.
4) Release the lock.

Design with the fix:
1) mysql database is having tables like db, event,... general_log,
   ... slow_log...
2) Skip general_log and slow_log while preparing the tables list
3) Explicitly call the 'show create table' for general_log and 
   slow_log
3) Take the TL_READ lock on tables which are present in the table 
   list and do 'show create table'.
4) Release the lock.

While taking the meta data dump for general_log and slow_log the 
"CREATE TABLE" is replaced with "CREATE TABLE IF NOT EXISTS". 
This is because we skipped "DROP TABLE" for those tables, 
"DROP TABLE" fails for these tables if logging is enabled. 
Customer is applying the dump by enabling logging so, if the dump 
has "DROP TABLE" it will fail. Hence, removed the "DROP TABLE" 
stmts for those tables.
  
After the fix we could observe "Table 'mysql.general_log' 
doesn't exist" errors initially that is because in the customer 
scenario they are dropping the mysql database by enabling the 
logging, Hence, those errors are expected. Once we apply the 
dump which is taken before the "drop database mysql", the errors 
will not be there.
2012-05-07 16:46:44 +05:30
Venkata Sidagam
daafaa0f86 Bug #11754178 45740: MYSQLDUMP DOESN'T DUMP GENERAL_LOG AND SLOW_QUERY
CAUSES RESTORE PROBLEM
Problem Statement:
------------------
mysqldump is not having the dump stmts for general_log and slow_log
tables. That is because of the fix for Bug#26121. Hence, after 
dropping the mysql database, and applying the dump by enabling the 
logging, "'general_log' table not found" errors are logged into the 
server log file.

Analysis:
---------
As part of the fix for Bug#26121, we skipped the dumping of tables 
for general_log and slow_log, because the data dump of those tables 
are taking LOCKS, which is not allowed for log tables.

Fix:
----
We came up with an approach that instead of taking both meta data 
and data dump information for those tables, take only the meta data 
dump which doesn't need LOCKS.
As part of fixing the issue we came up with below algorithm.
Design before fix:
1) mysql database is having tables like db, event,... general_log,
   ... slow_log...
2) Skip general_log and slow_log while preparing the tables list
3) Take the TL_READ lock on tables which are present in the table 
   list and do 'show create table'.
4) Release the lock.

Design with the fix:
1) mysql database is having tables like db, event,... general_log,
   ... slow_log...
2) Skip general_log and slow_log while preparing the tables list
3) Explicitly call the 'show create table' for general_log and 
   slow_log
3) Take the TL_READ lock on tables which are present in the table 
   list and do 'show create table'.
4) Release the lock.

While taking the meta data dump for general_log and slow_log the 
"CREATE TABLE" is replaced with "CREATE TABLE IF NOT EXISTS". 
This is because we skipped "DROP TABLE" for those tables, 
"DROP TABLE" fails for these tables if logging is enabled. 
Customer is applying the dump by enabling logging so, if the dump 
has "DROP TABLE" it will fail. Hence, removed the "DROP TABLE" 
stmts for those tables.
  
After the fix we could observe "Table 'mysql.general_log' 
doesn't exist" errors initially that is because in the customer 
scenario they are dropping the mysql database by enabling the 
logging, Hence, those errors are expected. Once we apply the 
dump which is taken before the "drop database mysql", the errors 
will not be there.

client/mysqldump.c:
  In get_table_structure() added code to skip the DROP TABLE stmts for general_log
  and slow_log tables, because when logging is enabled those stmts will fail. And
  replaced CREATE TABLE with CREATE IF NOT EXISTS for those tables, just to make 
  sure CREATE stmt for those tables doesn't fail since we removed DROP stmts for
  those tables.
  In dump_all_tables_in_db() added code to call get_table_structure() for 
  general_log and slow_log tables.
mysql-test/r/mysqldump.result:
  Added a test as part of fix for Bug #11754178
mysql-test/t/mysqldump.test:
  Added a test as part of fix for Bug #11754178
2012-05-04 18:33:34 +05:30
Venkata Sidagam
41cdad9868 Bug #11754178 45740: MYSQLDUMP DOESN'T DUMP GENERAL_LOG AND SLOW_QUERY
CAUSES RESTORE PROBLEM
Problem Statement:
------------------
mysqldump is not having the dump stmts for general_log and slow_log
tables. That is because of the fix for Bug#26121. Hence, after 
dropping the mysql database, and applying the dump by enabling the 
logging, "'general_log' table not found" errors are logged into the 
server log file.

Analysis:
---------
As part of the fix for Bug#26121, we skipped the dumping of tables 
for general_log and slow_log, because the data dump of those tables 
are taking LOCKS, which is not allowed for log tables.

Fix:
----
We came up with an approach that instead of taking both meta data 
and data dump information for those tables, take only the meta data 
dump which doesn't need LOCKS.
As part of fixing the issue we came up with below algorithm.
Design before fix:
1) mysql database is having tables like db, event,... general_log,
   ... slow_log...
2) Skip general_log and slow_log while preparing the tables list
3) Take the TL_READ lock on tables which are present in the table 
   list and do 'show create table'.
4) Release the lock.

Design with the fix:
1) mysql database is having tables like db, event,... general_log,
   ... slow_log...
2) Skip general_log and slow_log while preparing the tables list
3) Explicitly call the 'show create table' for general_log and 
   slow_log
3) Take the TL_READ lock on tables which are present in the table 
   list and do 'show create table'.
4) Release the lock.

While taking the meta data dump for general_log and slow_log the 
"CREATE TABLE" is replaced with "CREATE TABLE IF NOT EXISTS". 
This is because we skipped "DROP TABLE" for those tables, 
"DROP TABLE" fails for these tables if logging is enabled. 
Customer is applying the dump by enabling logging so, if the dump 
has "DROP TABLE" it will fail. Hence, removed the "DROP TABLE" 
stmts for those tables.
  
After the fix we could observe "Table 'mysql.general_log' 
doesn't exist" errors initially that is because in the customer 
scenario they are dropping the mysql database by enabling the 
logging, Hence, those errors are expected. Once we apply the 
dump which is taken before the "drop database mysql", the errors 
will not be there.
2012-05-04 18:33:34 +05:30
Sergei Golubchik
a3073ecd96 merge 2012-04-05 23:07:18 +02:00
Sergei Golubchik
cbd52a42ee merge 2012-04-05 12:01:52 +02:00
Sergei Golubchik
dea3544b2d mysql-5.1.62 merge 2012-04-05 10:49:38 +02:00
Sergei Golubchik
20e706689d mysql-5.5.22 merge
mysql-test/suite/innodb/t/group_commit_crash.test:
  remove autoincrement to avoid rbr being used for insert ... select
mysql-test/suite/innodb/t/group_commit_crash_no_optimize_thread.test:
  remove autoincrement to avoid rbr being used for insert ... select
mysys/my_addr_resolve.c:
  a pointer to a buffer is returned to the caller -> the buffer cannot be on the stack
mysys/stacktrace.c:
  my_vsnprintf() is ok here, in 5.5
2012-03-28 01:04:46 +02:00
Sergei Golubchik
92e2b80c76 MDEV-186 Client programs throw warnings about memory loss when executed with --help or alike
suppress these harmless but confusing warnings.
fix the program name (MY_INIT) in mysqldump

client/mysqldump.c:
  for backward compatibility, prefix mysqldump error messages with "mysqldump", not with the full path of the executable
2012-03-23 10:53:25 +01:00
Sergei Golubchik
4933d21e5d merge with mysql-5.5.21 2012-03-09 08:06:59 +01:00
Joerg Bruehe
bfaebe3f5e Further upmerge the yaSSL upgrade (to 2.2.0) from MySQL 5.1 to 5.5.
Also, take a syntax fix (C++ style comment in C file) in client/mysqldump.c.
2012-03-02 13:23:52 +01:00
Joerg Bruehe
a9f3b2f570 Further upmerge the yaSSL upgrade (to 2.2.0) from MySQL 5.1 to 5.5.
Also, take a syntax fix (C++ style comment in C file) in client/mysqldump.c.
2012-03-02 13:23:52 +01:00
Karen Langford
2efa0ec676 AIX builds fail for comments using // 2012-02-28 17:20:30 +01:00
Karen Langford
bacd6ad2ed AIX builds fail for comments using // 2012-02-28 17:20:30 +01:00
MySQL Build Team
7a35cb9150 Updated/added copyright headers 2012-02-16 10:48:16 +01:00
MySQL Build Team
5734bae576 Updated/added copyright headers 2012-02-16 10:48:16 +01:00
Kent Boortz
6a003dd8ef Updated/added copyright headers 2012-02-15 17:21:38 +01:00
Kent Boortz
79535de206 Updated/added copyright headers 2012-02-15 17:21:38 +01:00
unknown
b8aa31c03d MWL#192 after-merge fixes.
Fix memory leak in one error case in mysqldump.
Fix that HAVE_VALGRIND_VALGRIND_H is now HAVE_VALGRIND in 5.5.
Fix that @have_ssl should not be set in embedded (introduced when
removing #undef HAVE_OPENSSL from my_global.h).
2012-02-23 15:42:21 +01:00
Nirbhay Choubey
2bffb8b1de Bug #11760384 52792: MYSQLDUMP IN XML MODE DOES NOT
DUMP ROUTINES

Minor post-fix to avoid build failure when built with
Werror.
2012-01-17 09:10:58 +05:30
Nirbhay Choubey
429fdb3b09 Bug #11760384 52792: MYSQLDUMP IN XML MODE DOES NOT
DUMP ROUTINES

Minor post-fix to avoid build failure when built with
Werror.
2012-01-17 09:10:58 +05:30
Sergei Golubchik
38e3ae155d mysql-5.5 merge 2012-01-16 20:16:35 +01:00
Sergei Golubchik
4f435bddfd 5.3 merge 2012-01-13 15:50:02 +01:00
Tor Didriksen
72bdeddd34 fix compile warning: may be used uninitialized 2012-01-12 16:27:53 +01:00
Tor Didriksen
8338d21a90 fix compile warning: may be used uninitialized 2012-01-12 16:27:53 +01:00
Nirbhay Choubey
0306cde0a5 Merge of fix for bug#11760384 from mysql-5.1. 2012-01-10 16:10:48 +05:30
Nirbhay Choubey
e2e91b7b7c Merge of fix for bug#11760384 from mysql-5.1. 2012-01-10 16:10:48 +05:30
Nirbhay Choubey
99e462ab0b BUG#11760384 - 52792: mysqldump in XML mode does not dump
routines.

mysqldump in xml mode did not dump routines, events or
triggers.

This patch fixes this issue by fixing the if conditions
that disallowed the dump of above mentioned objects in
xml mode, and added the required code to enable dump
in xml format.


client/mysqldump.c:
  BUG#11760384 - 52792: mysqldump in XML mode does not dump
                        routines.
  
  Fixed some if conditions to allow execution of dump methods
  for xml and further added the relevant code at places to produce
  the dump in xml format.
mysql-test/r/mysqldump.result:
  Added a test case for Bug#11760384.
mysql-test/t/mysqldump.test:
  Added a test case for Bug#11760384.
2012-01-10 13:33:45 +05:30
Nirbhay Choubey
7faf69dd82 BUG#11760384 - 52792: mysqldump in XML mode does not dump
routines.

mysqldump in xml mode did not dump routines, events or
triggers.

This patch fixes this issue by fixing the if conditions
that disallowed the dump of above mentioned objects in
xml mode, and added the required code to enable dump
in xml format.
2012-01-10 13:33:45 +05:30
Nirbhay Choubey
49d2790aff Bug#12809202 61854: MYSQLDUMP --SINGLE-TRANSACTION
--FLUSH-LOG BREAKS CONSISTENCY

Post-fix for some failing tests.
2011-12-24 15:08:59 +05:30
Nirbhay Choubey
0a8824e9c3 Bug#12809202 61854: MYSQLDUMP --SINGLE-TRANSACTION
--FLUSH-LOG BREAKS CONSISTENCY

Post-fix for some failing tests.
2011-12-24 15:08:59 +05:30
Nirbhay Choubey
5e487124aa Bug#12809202 61854: MYSQLDUMP --SINGLE-TRANSACTION
--FLUSH-LOG BREAKS CONSISTENCY

The transaction started by mysqldump gets committed
implicitly when flush-log is specified along with
single-transaction option, and hence can break
consistency.

This is because, COM_REFRESH is executed in order
to flush logs and starting from 5.5 this command
performs an implicit commit.

Fixed by making sure that COM_REFRESH is executed
before the transaction has started and not after it.

Note : This patch triggers following behavioral
       changes in mysqldump :

1) After this patch we no longer flush logs before
   dumping each database if --single-transaction
   option is given like it was done before (in the
   absence of --lock-all-tables and --master-data
   options).

2) Also, after this patch, we start acquiring
   FTWRL before flushing logs in cases when only
   --single-transaction and --flush-logs are given.
   It becomes safe to use mysqldump with these two
   options and without --master-data parameter for
   backups.


client/mysqldump.c:
  Bug#12809202 61854: MYSQLDUMP --SINGLE-TRANSACTION
               --FLUSH-LOG BREAKS CONSISTENCY
  
  Added logic to make sure that, if flush-log option
  is specified, mysql_refresh() is never executed after
  the transaction has started.
  
  Added verbose messages for all the executions of
  mysql_refresh() in order to track its invocation.
mysql-test/r/mysqldump.result:
  Added test case for Bug#12809202.
mysql-test/t/mysqldump.test:
  Added test case for Bug#12809202.
2011-12-23 23:05:00 +05:30
Nirbhay Choubey
a4343d56ed Bug#12809202 61854: MYSQLDUMP --SINGLE-TRANSACTION
--FLUSH-LOG BREAKS CONSISTENCY

The transaction started by mysqldump gets committed
implicitly when flush-log is specified along with
single-transaction option, and hence can break
consistency.

This is because, COM_REFRESH is executed in order
to flush logs and starting from 5.5 this command
performs an implicit commit.

Fixed by making sure that COM_REFRESH is executed
before the transaction has started and not after it.

Note : This patch triggers following behavioral
       changes in mysqldump :

1) After this patch we no longer flush logs before
   dumping each database if --single-transaction
   option is given like it was done before (in the
   absence of --lock-all-tables and --master-data
   options).

2) Also, after this patch, we start acquiring
   FTWRL before flushing logs in cases when only
   --single-transaction and --flush-logs are given.
   It becomes safe to use mysqldump with these two
   options and without --master-data parameter for
   backups.
2011-12-23 23:05:00 +05:30
Michael Widenius
6d4224a31c Merge with 5.2.
no_error handling for select (used by INSERT ... SELECT) still needs to be fixed, but I will do that in a separate commit
2011-12-11 11:34:44 +02:00
Michael Widenius
6920457142 Merge with MariaDB 5.1 2011-11-24 18:48:58 +02:00
Sergei Golubchik
7189f09aa6 compiler warnings/errors 2011-11-23 18:25:07 +01:00
Michael Widenius
a8d03ab235 Initail merge with MySQL 5.1 (XtraDB still needs to be merged)
Fixed up copyright messages.
2011-11-21 19:13:14 +02:00
Sergei Golubchik
0e007344ea mysql-5.5.18 merge 2011-11-03 19:17:05 +01:00
Sergei Golubchik
76f0b94bb0 merge with 5.3
sql/sql_insert.cc:
  CREATE ... IF NOT EXISTS may do nothing, but
  it is still not a failure. don't forget to my_ok it.
  ******
  CREATE ... IF NOT EXISTS may do nothing, but
  it is still not a failure. don't forget to my_ok it.
sql/sql_table.cc:
  small cleanup
  ******
  small cleanup
2011-10-19 21:45:18 +02:00
Michael Widenius
fb135f7ee5 Automatic merge with 5.2 2011-08-15 22:14:08 +03:00
Michael Widenius
397fc34f44 Fixes MySQL bug#48972: mysqldump --insert-ignore leaves set unique_checks=0.
This fixes a bug that when you use mysqldump --no-create-info to generate a dump that you want to merge with an existing table,
you can get an innodb table with duplicated unique keys.
Patch orignally by Eric Bergen.


client/mysqldump.c:
  Only use UNIQUE_CHECKS=0 for tables that are created.
  This solves the issue that you can't get duplicate unique keys when merging two dumps.
mysql-test/r/mysqldump.result:
  Test for mysqldump --no-create-info
2011-08-10 13:08:19 +03:00
Alexander Nozdrin
9312697530 Manual merge from mysql-5.1. 2011-07-22 11:50:44 +04:00
Alexander Nozdrin
f636987d3b Manual merge from mysql-5.1. 2011-07-22 11:50:44 +04:00
Alexander Nozdrin
3a786df2d5 Manual merge from mysql-5.0. 2011-07-22 11:46:45 +04:00
Alexander Nozdrin
c4dad60a73 Manual merge from mysql-5.0. 2011-07-22 11:46:45 +04:00
Alexander Nozdrin
cb5239954b For for Bug#12696072: FIX OUTDATED COPYRIGHT NOTICES IN RUNTIME RELATED CLIENT
TOOLS

Backport a fix for Bug 57094 from 5.5.
The following revision was backported:

# revision-id: alexander.nozdrin@oracle.com-20101006150613-ls60rb2tq5dpyb5c
# parent: bar@mysql.com-20101006121559-am1e05ykeicwnx48
# committer: Alexander Nozdrin <alexander.nozdrin@oracle.com>
# branch nick: mysql-5.5-bugteam-bug57094
# timestamp: Wed 2010-10-06 19:06:13 +0400
# message:
#   Fix for Bug 57094 (Copyright notice incorrect?).
#   
#   The fix is to:
#     - introduce ORACLE_WELCOME_COPYRIGHT_NOTICE define to have a single place
#       to specify copyright notice;
#     - replace custom copyright notices with ORACLE_WELCOME_COPYRIGHT_NOTICE
#       in programs.
2011-07-22 11:45:15 +04:00
Alexander Nozdrin
f7618904bf For for Bug#12696072: FIX OUTDATED COPYRIGHT NOTICES IN RUNTIME RELATED CLIENT
TOOLS

Backport a fix for Bug 57094 from 5.5.
The following revision was backported:

# revision-id: alexander.nozdrin@oracle.com-20101006150613-ls60rb2tq5dpyb5c
# parent: bar@mysql.com-20101006121559-am1e05ykeicwnx48
# committer: Alexander Nozdrin <alexander.nozdrin@oracle.com>
# branch nick: mysql-5.5-bugteam-bug57094
# timestamp: Wed 2010-10-06 19:06:13 +0400
# message:
#   Fix for Bug 57094 (Copyright notice incorrect?).
#   
#   The fix is to:
#     - introduce ORACLE_WELCOME_COPYRIGHT_NOTICE define to have a single place
#       to specify copyright notice;
#     - replace custom copyright notices with ORACLE_WELCOME_COPYRIGHT_NOTICE
#       in programs.
2011-07-22 11:45:15 +04:00
Sergei Golubchik
49501b4ccb fix memory leaks and other problems found by safemalloc
client/mysql_upgrade.c:
  missing DBUG_RETURN
client/mysqladmin.cc:
  client plugin memory wasn't freed
client/mysqlcheck.c:
  client plugin memory, defaults, a result set, a command-line option value were not freed.
  missing DBUG_RETURN.
client/mysqldump.c:
  client plugin memory wasn't freed
client/mysqlslap.c:
  client plugin memory wasn't freed
client/mysqltest.cc:
  hopeless. cannot be fixed.
mysql-test/valgrind.supp:
  Bug#56666 is now fixed.
mysys/array.c:
  really, don't allocate if the caller didn't ask to.
mysys/my_init.c:
  safemalloc checks must be done at the very end
mysys/my_thr_init.c:
  not needed anymore
sql-common/client.c:
  memory leak
sql/log.cc:
  log_file was not closed, memory leak.
sql/mysqld.cc:
  fix bug#56666 (causing many P_S related memory leaks).
  close_active_mi() not called for --bootstrap, memory leak.
sql/sql_lex.cc:
  redo Lex->mi handling
sql/sql_lex.h:
  redo Lex->mi handling
sql/sql_plugin.cc:
  plugins having PLUGIN_VAR_MEMALLOC string variables have this variables allocated in every THD.
  The memory was freed in ~THD but only if plugin was still active. If plugin was unloaded the
  variable was not found and the memory was lost. By loading and unloading plugins an arbitrary
  amount of memory can be lost.
sql/sql_repl.cc:
  redo Lex->mi handling
sql/sql_yacc.yy:
  completely wrong handling of Lex->mi - run-time memory leak, by repeating the statement
  arbitrary amount of memory can be lost.
  
  Lex->mi.repl_ignore_server_ids_opt was allocated when parsing CHANGE MASTER,
  and freed after executing the statement. if parser failed on syntax (or another)
  error the statement was never executed. Lex->mi was simply bzero-ed for the next
  CHANGE MASTER  statement.
sql/table.cc:
  didn't compile
storage/perfschema/pfs_lock.h:
  Bug#56666 is fixed
2011-07-10 20:09:17 +02:00
Kent Boortz
027b5f1ed4 Updated/added copyright headers 2011-07-03 17:47:37 +02:00
Kent Boortz
b6e6097c95 Updated/added copyright headers 2011-07-03 17:47:37 +02:00
Sergei Golubchik
9809f05199 5.5-merge 2011-07-02 22:08:51 +02:00
Kent Boortz
68f00a5686 Updated/added copyright headers 2011-06-30 17:37:13 +02:00
Kent Boortz
1400d7a2cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
Kent Boortz
44135d4725 Updated/added copyright headers 2011-06-30 17:31:31 +02:00
Kent Boortz
e5ce023f57 Updated/added copyright headers 2011-06-30 17:31:31 +02:00
Georgi Kodinov
7ae92503c7 Fixed cast warnings in introducing the pluggable authentication client
options.
2011-06-06 13:27:05 +03:00
Kent Boortz
02e07e3b51 Updated/added copyright headers 2011-06-30 17:46:53 +02:00
Kent Boortz
9da00ebec9 Updated/added copyright headers 2011-06-30 17:46:53 +02:00
Georgi Kodinov
8d7361f803 Fixed cast warnings in introducing the pluggable authentication client
options.
2011-06-06 13:27:05 +03:00
Michael Widenius
f34be18938 Merge with MariaDB 5.2 2011-05-10 18:17:43 +03:00
Michael Widenius
1be5462d59 Merge with MariaDB 5.1 2011-05-03 19:10:10 +03:00
Michael Widenius
e415ba0fb2 Merge with MySQL 5.1.57/58
Moved some BSD string functions from Unireg
2011-05-02 20:58:45 +03:00
Sergei Golubchik
0accbd0364 lots of post-merge changes 2011-04-25 17:22:25 +02:00
unknown
64e43e1cc8 Merge various replication-related patches into MariaDB 5.3:
- MWL#116 Group commit
 - MWL#136 Enhancements for START TRANSACTION WITH CONSISTENT SNAPSHOT
 - MWL#47 Annotate_rows_log_event
 - MWL#163 innodb_release_locks_early
 - Percona patch enhancing row-based replication for tables with no primary key
2011-04-08 09:39:33 +02:00
Michael Widenius
0fae0335d4 Ensure that all clients reads the appropriate 'client', client-mariadb and 'mariadb' sections from my.cnf
The mysqld server and all clients now reads the new client-server section
Fixed that mysqldumpslow supports new slow log formats and new mysqld --slow- options


client/mysql.cc:
  Read also client-server and client-mariadb sections.
client/mysql_upgrade.c:
  Read also client-server and client-mariadb sections.
client/mysqladmin.cc:
  Read also client-server and client-mariadb sections.
client/mysqlbinlog.cc:
  Read also client-server and client-mariadb sections.
client/mysqlcheck.c:
  Read also client-server and client-mariadb sections.
client/mysqldump.c:
  Read also client-server and client-mariadb sections.
client/mysqlimport.c:
  Read also client-server and client-mariadb sections.
client/mysqlshow.c:
  Read also client-server and client-mariadb sections.
client/mysqltest.cc:
  Read also client-server and client-mariadb sections.
extra/my_print_defaults.c:
  Updated help text
scripts/mysql_fix_privilege_tables.sh:
  Read also sections client client-server client-mariadb
scripts/mysql_install_db.pl.in:
  Also allow --data=* option
  Read also groups mariadb, server and client-server.
scripts/mysql_install_db.sh:
  Also allow --data=* option
  Read also groups mariadb, server and client-server.
  Added --lose-skip-pbxt to bootstrap
scripts/mysql_secure_installation.sh:
  Read also groups client-server and client-mariadb
scripts/mysqld_multi.sh:
  Read also group mariadb
scripts/mysqld_safe.sh:
  Read also groups mariadb server and client-server
scripts/mysqldumpslow.sh:
  Fixed to support new slow log formats
  Added sorting on -ae (aggregated number of retreived rows) and e (retrieved rows)
  Read also group 'mariadb'
  If there is many instances of same option, use last one.
  Get slow log file from options log-slow-queries=filename or query-log-file=filename
  Added support for future --log-basename option
sql-common/client.c:
  Read also groups 'client-server' and 'client-mariadb'
tests/mysql_client_test.c:
  Read also groups 'client-server' and 'client-mariadb'
tests/thread_test.c:
  Read also groups 'client-server' and 'client-mariadb'
2011-03-18 17:03:43 +02:00
unknown
753c406994 Merge from mysql-5.5.10-release 2011-03-16 15:11:20 +01:00
hery.ramilison@oracle.com
18d2e55c51 Merge from mysql-5.5.10-release 2011-03-16 15:11:20 +01:00
Nirbhay Choubey
a5f20712a0 Merge of fix for bug#11766310 from mysql-5.1 -> mysql-5.5. 2011-02-21 12:42:27 +05:30
Nirbhay Choubey
000a390e81 Merge of fix for bug#11766310 from mysql-5.1 -> mysql-5.5. 2011-02-21 12:42:27 +05:30
Nirbhay Choubey
876502d743 Bug#11766310 : 59398: MYSQLDUMP 5.1 CAN'T HANDLE A DASH
("-") IN DATABASE NAMES IN ALTER DATABASE.

mysqldump did not quote database name in 'ALTER DATABASE'
statements in its output. This can further cause a failure
while loading if database name contains a hyphen '-'.

This happened as, while printing the 'ALTER DATABASE'
statements, the database name was not quoted.

Fixed by quoting the database name.


client/mysqldump.c:
  Bug#11766310 : 59398: MYSQLDUMP 5.1 CAN'T HANDLE A DASH
                 ("-") IN DATABASE NAMES IN ALTER DATABASE.
  
  Modified the print statement in order to print the quoted
  database name for 'ALTER DATABASE' statements.
mysql-test/r/mysqldump.result:
  Added a test case for bug#11766310.
mysql-test/t/mysqldump.test:
  Added a test case for bug#11766310.
2011-02-21 12:37:24 +05:30
Nirbhay Choubey
a8e6f7c67b Bug#11766310 : 59398: MYSQLDUMP 5.1 CAN'T HANDLE A DASH
("-") IN DATABASE NAMES IN ALTER DATABASE.

mysqldump did not quote database name in 'ALTER DATABASE'
statements in its output. This can further cause a failure
while loading if database name contains a hyphen '-'.

This happened as, while printing the 'ALTER DATABASE'
statements, the database name was not quoted.

Fixed by quoting the database name.
2011-02-21 12:37:24 +05:30
Guilhem Bichot
1756d087cd Fix for BUG#59894
"set optimizer_switch to e or d causes invalid memory writes/valgrind warnings":
due to prefix support, the argument "e" was overwritten with its full value
"engine_condition_pushdown", which caused a buffer overrun.
This was wrong usage of find_type(); other wrong usages are fixed here too.
Please start reading with the comment of typelib.c.

client/mysqldump.c:
  A bug: find_type() expects a bitmap as 3rd argument
  (each bit is a flag controlling a behaviour of the function);
  here it was instead passed the length of the string to search!
  That could give random behaviour of find_type()
  depending on the string.
  We rather need to pass a correct flag to find_type().
  The correct flag is FIND_TYPE_BASIC (0).
  Flag 8 is not needed as buff cannot have a comma (see how buff is filled).
  Flag 1 looks like a superfluous restriction.
  Flag 4 is not user-friendly (why use
  --compatible=2 rather than --compatible=mysql40 ?, and
  we probably not commit to "2" always meaning "mysql40"
  until the end of times).
include/mysql.h.pp:
  This isn't a problematic API change as we go from char* to const char*:
  existing code will run unchanged.
include/typelib.h:
  named constants. Not an enum to not significantly change
  the declaration of find_type() which would be an API change
  (typelib.h is included in mysql.h).
mysql-test/r/mysqldump.result:
  correct result (see the two requested modes in SQL_MODE)
mysql-test/suite/sys_vars/t/optimizer_switch_basic.test:
  test for BUG#59894. The second SET used to crash.
mysql-test/t/mysqldump.test:
  we had no test for multiple modes in --compatible, which is
  supported according to --help
mysys/typelib.c:
  Fix for BUG#59894. parse_name() is asked to match "e" with a row
  of the TYPELIB (the TYPELIB lists permitted flags of optimizer_switch;
  and comes from optimizer_switch_names[] of sys_vars.cc).
  find_type() is capable of supporting prefixes, but if it is not
  passed flag 2 in third argument, it will overwrite its first
  argument (the string to search for) with the complete name,
  here overwriting "e" with "engine_condition_pushdown". But
  as this "e" was a buffer allocated in an Item, it was not big
  enough to host the longer name, thus the crash.
  We don't need to know the complete flag's name; the output used
  from find_type() is just the flag's number (== function's return
  code). So we can pass flag 2 to find_type() in parse_name().
  After doing this fix and the other fixes in this patch, all usages
  of find_type() were using flag 2; in most usages the string to search for,
  is not guaranteed to be long enough to host the complete name
  (it is either directly from argv, or from alloc_root/my_malloc
  done in an earlier call).
  Thus, flag 2 is here made implicit: callers need not pass it anymore,
  it is always automatically turned on.
  This allows to eliminate an oddity: parse_name() took a const char**,
  and then removed "const" before calling find_type(), which could
  theoretically modify the pointed data, thus lying on constness.
  Last, constants for find_type() are now named.
sql-common/client.c:
  Two bugs:
  1) The enum was not in sync with the array (due to a bad porting of WL 1054;
  the extra OPT_ values are about options present in 5.1 and deleted in 5.5);
  added a compile_time_assert() to make sure this doesn't happen again
  2) find_type() was writing past the end of opt_arg; as opt_arg was allocated
  with alloc_root() with no extra space, this was an overrun; it could be seen
  when
  ** building with -DWITH_VALGRIND -DHAVE_purify -DEXTRA_DEBUG
  ** making execution go through the faulty code; this faulty
  code is executed only if the client asks to read a configuration
  file like this:
    mysql_options(mysql, MYSQL_READ_DEFAULT_FILE, "/tmp/cnf.cnf");
  so by adding such line to the start of mysql_client_test.c::client_connect(),
  we could see the valgrind warning:
  ==30548== Invalid write of size 1
  ==30548==    at 0x4C2624C: strcpy (mc_replace_strmem.c:303)
  ==30548==    by 0x48DC29: find_type (typelib.c:120)
  ==30548==    by 0x465686: mysql_read_default_options (client.c:1344)
  ==30548==    by 0x46830F: mysql_real_connect (client.c:2971)
  ==30548==    by 0x409339: client_connect (mysql_client_test.c:331)
  ==30548==    by 0x463A7F: main (mysql_client_test.c:19902)
  ==30548==  Address 0x61875ad is 0 bytes after a block of size 29 alloc'd
  ==30548==    at 0x4C25153: malloc (vg_replace_malloc.c:195)
  ==30548==    by 0x49BFF1: my_malloc (my_malloc.c:38)
  ==30548==    by 0x49C65C: alloc_root (my_alloc.c:166)
  ==30548==    by 0x48EF97: handle_default_option (default.c:381)
  ==30548==    by 0x49068C: search_default_file_with_ext (default.c:992)
  ==30548==    by 0x48F929: search_default_file (default.c:670)
  ==30548==    by 0x48EDC4: my_search_option_files (default.c:312)
  ==30548==    by 0x48F4B1: my_load_defaults (default.c:576)
  ==30548==    by 0x46517A: mysql_read_default_options (client.c:1207)
  ==30548==    by 0x46830F: mysql_real_connect (client.c:2971)
  ==30548==    by 0x409339: client_connect (mysql_client_test.c:331)
  ==30548==    by 0x463A7F: main (mysql_client_test.c:19902)
  This is fixed by having find_type() not overwrite anymore.
sql/sql_help.cc:
  cast not needed anymore.
sql/table.cc:
  cast not needed anymore.
2011-02-11 15:00:09 +01:00
Guilhem Bichot
77c0f33ee2 Fix for BUG#59894
"set optimizer_switch to e or d causes invalid memory writes/valgrind warnings":
due to prefix support, the argument "e" was overwritten with its full value
"engine_condition_pushdown", which caused a buffer overrun.
This was wrong usage of find_type(); other wrong usages are fixed here too.
Please start reading with the comment of typelib.c.
2011-02-11 15:00:09 +01:00
Nirbhay Choubey
ab2d29ec6b Bug#13618 : mysqldump --xml omits comment on table field
When mysqldump tries to dump information in xml format,
the result does not contain field level comments.

In order to retrieve various informations for a field/column,
mysqldump currently uses 'show fields from <tab>' statement.
The attributes returned by the statement lacks the information
regarding field comments.

Fixed by changing the query to one that probes I_S to retrieve
required field informations, including the field comment.


client/mysqldump.c:
  Bug#13618 : mysqldump --xml omits comment on table field.
  
  Replaced the 'show fields' command by a statement that
  queries I_S, in order to retrieve information on all the
  attributes that 'show fields' returns along-with an additional
  column_comment information.
mysql-test/r/client_xml.result:
  Result modifications for bug#13618.
mysql-test/r/mysqldump.result:
  Result modifications for bug#13618.
mysql-test/t/mysqldump.test:
  Added a testcase for bug#13618.
2011-01-14 19:50:34 +05:30
Nirbhay Choubey
95e07a6fb7 Bug#13618 : mysqldump --xml omits comment on table field
When mysqldump tries to dump information in xml format,
the result does not contain field level comments.

In order to retrieve various informations for a field/column,
mysqldump currently uses 'show fields from <tab>' statement.
The attributes returned by the statement lacks the information
regarding field comments.

Fixed by changing the query to one that probes I_S to retrieve
required field informations, including the field comment.
2011-01-14 19:50:34 +05:30
Nirbhay Choubey
6d45683b38 Bug#58139 : default-auth option not recognized in MySQL standard
command line clients.

Postfix covering other mysql standard clients like mysql_upgrade,
mysqlbinlog, mysqlcheck, mysqlimport, mysqlshow and mysqlslap.


client/client_priv.h:
  Bug#58139 : default-auth option not recognized in MySQL standard
              command line clients
  
  Added an entry for 'default-auth' option.
client/mysql.cc:
  Bug#58139 : default-auth option not recognized in MySQL standard
              command line clients
  
  Updated the id entry for default_auth option.
client/mysql_upgrade.c:
  Bug#58139 : default-auth option not recognized in MySQL standard
              command line clients.
  
  Introduced two new variables to hold values from default-auth and
  plugin-dir options and further pushed them to client's st_mysql
  instance.
client/mysqladmin.cc:
  Bug#58139 : default-auth option not recognized in MySQL standard
              command line clients
  
  Updated the id entry for default_auth option.
client/mysqlbinlog.cc:
  Bug#58139 : default-auth option not recognized in MySQL standard
              command line clients.
  
  Introduced two new variables to hold values from default-auth and
  plugin-dir options and further pushed them to client's st_mysql
  instance.
client/mysqlcheck.c:
  Bug#58139 : default-auth option not recognized in MySQL standard
              command line clients.
  
  Introduced two new variables to hold values from default-auth and
  plugin-dir options and further pushed them to client's st_mysql
  instance.
client/mysqldump.c:
  Bug#58139 : default-auth option not recognized in MySQL standard
              command line clients
  
  Updated the id entry for default_auth option.
client/mysqlimport.c:
  Bug#58139 : default-auth option not recognized in MySQL standard
              command line clients.
  
  Introduced two new variables to hold values from default-auth and
  plugin-dir options and further pushed them to client's st_mysql
  instance.
client/mysqlshow.c:
  Bug#58139 : default-auth option not recognized in MySQL standard
              command line clients.
  
  Introduced two new variables to hold values from default-auth and
  plugin-dir options and further pushed them to client's st_mysql
  instance.
client/mysqlslap.c:
  Bug#58139 : default-auth option not recognized in MySQL standard
              command line clients.
  
  Introduced two new variables to hold values from default-auth and
  plugin-dir options and further pushed them to client's st_mysql
  instance.
mysql-test/r/plugin_auth.result:
  Added test case for Bug#58139 for mysql_upgrade.
mysql-test/t/plugin_auth.test:
  Added test case for Bug#58139 for mysql_upgrade.
2011-01-16 09:29:05 +05:30
Nirbhay Choubey
ad6c8d2342 Merging fix of Bug#13618 from mysql-5.1. 2011-01-14 20:11:00 +05:30
Nirbhay Choubey
974bf57dac Bug#58139 : default-auth option not recognized in MySQL standard
command line clients.

Postfix covering other mysql standard clients like mysql_upgrade,
mysqlbinlog, mysqlcheck, mysqlimport, mysqlshow and mysqlslap.
2011-01-16 09:29:05 +05:30
Nirbhay Choubey
43a2f80e16 Merging fix of Bug#13618 from mysql-5.1. 2011-01-14 20:11:00 +05:30
Nirbhay Choubey
e3922b8b91 Bug#58139 : default-auth option not recognized in MySQL standard
command line clients.

Command line tools like mysqladmin and mysqldump did not recognize
default-auth and plugin-dir options.

Support for these options was found missing in these command line
tools.

Fixed by adding support for the same.


client/mysqladmin.cc:
  Bug#58139 : default-auth option not recognized in MySQL standard
              command line clients.
  
  Introduced two new variables to hold values from default-auth and
  plugin-dir options and further pushed them to client's st_mysql
  instance.
client/mysqldump.c:
  Bug#58139 : default-auth option not recognized in MySQL standard
              command line clients.
  
  Introduced two new variables to hold values from default-auth and
  plugin-dir options and further pushed them to client's st_mysql
  instance.
mysql-test/r/plugin_auth.result:
  Added test case for Bug#58139.
mysql-test/t/plugin_auth.test:
  Added test case for Bug#58139.
2010-12-07 17:37:07 +05:30
Nirbhay Choubey
d5e7008bdd Bug#58139 : default-auth option not recognized in MySQL standard
command line clients.

Command line tools like mysqladmin and mysqldump did not recognize
default-auth and plugin-dir options.

Support for these options was found missing in these command line
tools.

Fixed by adding support for the same.
2010-12-07 17:37:07 +05:30
Sergei Golubchik
65ca700def merge.
checkpoint.
does not compile.
2010-11-25 18:17:28 +01:00
unknown
2a97416e9b MWL#136: Rename binlog_trx_{file,position} to the much better binlog_snapshot_{file,position} 2010-11-08 11:59:39 +01:00
unknown
7322e38827 MWL#136: Cross-engine consistency for START TRANSACTION WITH CONSISTENT SNAPSHOT
Make the binlog handlerton participate in START TRANSACTION WITH CONSISTENT
SNAPSHOT, recording the binlog position corresponding to the snapshot taken
in other MVCC storage engines.

Expose this consistent binlog position as the new status variables
binlog_trx_file and binlog_trx_position. This enables to get a fully
non-locking snapshot of the database (including binlog position for
slave provisioning), avoiding the need for FLUSH TABLES WITH READ LOCK.

Modify mysqldump to detect if the server supports this new feature, and
if so, avoid FLUSH TABLES WITH READ LOCK for --single-transaction
--master-data snapshot backups.
2010-11-07 22:37:43 +01:00
Alexander Nozdrin
985fa88f8b Fix for Bug#57094 (Copyright notice incorrect?).
The fix is to:
  - introduce ORACLE_WELCOME_COPYRIGHT_NOTICE define to have a single place
    to specify copyright notice;
  - replace custom copyright notices with ORACLE_WELCOME_COPYRIGHT_NOTICE
    in programs.
2010-10-06 19:06:13 +04:00
Alexander Nozdrin
f79f6e0c34 Fix for Bug#57094 (Copyright notice incorrect?).
The fix is to:
  - introduce ORACLE_WELCOME_COPYRIGHT_NOTICE define to have a single place
    to specify copyright notice;
  - replace custom copyright notices with ORACLE_WELCOME_COPYRIGHT_NOTICE
    in programs.
2010-10-06 19:06:13 +04:00
Magnus Blåudd
8c8080adfb Bug#56117 ha_ndbcluster_tables.h included by mysqldump but not used
- Remove include of ha_ndbcluster_tables.h from mysqldump.c
2010-08-30 14:06:32 +02:00
Magnus Blåudd
1b3d5da50e Bug#56117 ha_ndbcluster_tables.h included by mysqldump but not used
- Remove include of ha_ndbcluster_tables.h from mysqldump.c
2010-08-30 14:06:32 +02:00
Michael Widenius
236478cef7 Fixed compiler warnings from Windows compiler
client/mysqlcheck.c:
  Added missing casts
client/mysqldump.c:
  Added missing casts
client/mysqlimport.c:
  Added missing casts
extra/my_print_defaults.c:
  Added missing casts
mysql-test/mysql-test-run.pl:
  Added suppression for non-critical warning on windows
storage/maria/maria_pack.c:
  Added missing casts
storage/xtradb/buf/buf0lru.c:
  Added missing casts
storage/xtradb/fil/fil0fil.c:
  Added missing casts
storage/xtradb/handler/i_s.cc:
  Added extra argument to call store() function for longlong.
storage/xtradb/srv/srv0srv.c:
  Added cast to suppress compiler warning
support-files/compiler_warnings.supp:
  Added suppression for some non critical compiler warnings on Windows
unittest/mytap/tap.h:
  Fixed prototypes to be same as the actual functions
2010-08-11 13:55:54 +03:00
Michael Widenius
e0a6b02c5d Merge with MySQL 5.1.49
Fixed Bug#52005 'JOIN_TAB->dependent' may be incorrectly propageted for multilevel outer joins' in a better way (patch from Sergey Petrunya)
2010-08-02 12:01:24 +03:00
Davi Arnaut
13f7a1d244 WL#5486: Remove code for unsupported platforms
Remove MS-DOS specific code.
2010-07-15 08:16:06 -03:00
Davi Arnaut
b3d22cef93 WL#5486: Remove code for unsupported platforms
Remove MS-DOS specific code.
2010-07-15 08:16:06 -03:00
Davi Arnaut
07e7b4d6fe WL#5486: Remove code for unsupported platforms
Remove Netware specific code.
2010-07-15 08:13:30 -03:00
Davi Arnaut
f54a118249 WL#5486: Remove code for unsupported platforms
Remove Netware specific code.
2010-07-15 08:13:30 -03:00
Davi Arnaut
f56dd32bf7 Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled
Essentially, the problem is that safemalloc is excruciatingly
slow as it checks all allocated blocks for overrun at each
memory management primitive, yielding a almost exponential
slowdown for the memory management functions (malloc, realloc,
free). The overrun check basically consists of verifying some
bytes of a block for certain magic keys, which catches some
simple forms of overrun. Another minor problem is violation
of aliasing rules and that its own internal list of blocks
is prone to corruption.

Another issue with safemalloc is rather the maintenance cost
as the tool has a significant impact on the server code.
Given the magnitude of memory debuggers available nowadays,
especially those that are provided with the platform malloc
implementation, maintenance of a in-house and largely obsolete
memory debugger becomes a burden that is not worth the effort
due to its slowness and lack of support for detecting more
common forms of heap corruption.

Since there are third-party tools that can provide the same
functionality at a lower or comparable performance cost, the
solution is to simply remove safemalloc. Third-party tools
can provide the same functionality at a lower or comparable
performance cost. 

The removal of safemalloc also allows a simplification of the
malloc wrappers, removing quite a bit of kludge: redefinition
of my_malloc, my_free and the removal of the unused second
argument of my_free. Since free() always check whether the
supplied pointer is null, redudant checks are also removed.

Also, this patch adds unit testing for my_malloc and moves
my_realloc implementation into the same file as the other
memory allocation primitives.

client/mysqldump.c:
  Pass my_free directly as its signature is compatible with the
  callback type -- which wasn't the case for free_table_ent.
2010-07-08 18:20:08 -03:00
Davi Arnaut
a10ae35328 Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled
Essentially, the problem is that safemalloc is excruciatingly
slow as it checks all allocated blocks for overrun at each
memory management primitive, yielding a almost exponential
slowdown for the memory management functions (malloc, realloc,
free). The overrun check basically consists of verifying some
bytes of a block for certain magic keys, which catches some
simple forms of overrun. Another minor problem is violation
of aliasing rules and that its own internal list of blocks
is prone to corruption.

Another issue with safemalloc is rather the maintenance cost
as the tool has a significant impact on the server code.
Given the magnitude of memory debuggers available nowadays,
especially those that are provided with the platform malloc
implementation, maintenance of a in-house and largely obsolete
memory debugger becomes a burden that is not worth the effort
due to its slowness and lack of support for detecting more
common forms of heap corruption.

Since there are third-party tools that can provide the same
functionality at a lower or comparable performance cost, the
solution is to simply remove safemalloc. Third-party tools
can provide the same functionality at a lower or comparable
performance cost. 

The removal of safemalloc also allows a simplification of the
malloc wrappers, removing quite a bit of kludge: redefinition
of my_malloc, my_free and the removal of the unused second
argument of my_free. Since free() always check whether the
supplied pointer is null, redudant checks are also removed.

Also, this patch adds unit testing for my_malloc and moves
my_realloc implementation into the same file as the other
memory allocation primitives.
2010-07-08 18:20:08 -03:00
Michael Widenius
5a2f40d48a Fixes for Opensolaris (to get buildbot green)
- Fixed memory leaks in mysqldump
- Fixed printf of NULL which caused crashes on OpenSolaris when using --debug
- Fixed realloc() problem that caused out of memory when running mysqldump.test on OpenSolaris


client/mysqldump.c:
  Fixed memory leaks
  Fixed printf of NULL which caused crashes on OpenSolaris when using --debug
client/mysqltest.cc:
  Fixed printf of NULL which caused crashes on OpenSolaris when using --debug
include/my_global.h:
  Added simple macro val_or_null() to simplify detecting of NULL strings for printf
sql/handler.cc:
  Fixed printf of NULL which caused crashes on OpenSolaris when using --debug
sql/sql_db.cc:
  Fixed printf of NULL which caused crashes on OpenSolaris when using --debug
  Removed testing of 'new_db_name' as this is guranteed never NULL
sql/sql_show.cc:
  Fixed printf of NULL which caused crashes on OpenSolaris when using --debug
storage/csv/ha_tina.cc:
  Fixed realloc() problem that caused out of memory when running mysqldump.test on OpenSolaris
  (OpenSolaris default malloc() can't handle a lot of reallocs() of strings that are growing one byte at a time)
  This did speed up logging to cvs with a magnitude for large strings.
2010-06-23 03:48:11 +03:00
Michael Widenius
ec281a3c34 Fixed some bugs in the Maria storage engine
- Changed default recovery mode from OFF to NORMAL to get automatic repair of not properly closed tables.
- Fixed a rase condition when two threads calls external_lock and thr_lock() in different order. When this happend the transaction that called external lock first
  and thr_lock() last did not see see the rows from the other transaction, even if if it had to wait in thr_lock() for other to complete.
- Fixed that one can run maria_chk on an automatcally recovered tables without warnings about too small transaction id
- Don't give warning that crashed table could not be repaired if repair was disabled (and thus not run)
- Fixed a error result from flush_key_cache() which caused a DBUG_ASSERT() when one was using concurrent reads on non transactional tables that was updated.

client/mysqldump.c:
  Add "" around error message to make it more readable
client/mysqltest.cc:
  Free environment variables
mysql-test/r/mysqldump.result:
  Updated results
mysql-test/r/openssl_1.result:
  Updated results
mysql-test/suite/maria/r/maria-recover.result:
  Updated results
mysql-test/suite/maria/r/maria3.result:
  Updated results
mysql-test/suite/maria/t/maria3.test:
  Added more test of temporary tables
storage/maria/ha_maria.cc:
  Changed default recovery mode from OFF to NORMAL to get automatic repair of not properly closed tables.
  Start transaction in ma_block_get_status() instead of in ha_maria::external_lock().
  - This fixes a rase condition when two threads calls external lock and thr_lock() in different order. When this happend the transaction that called external lock first and thr_lock() last did not see see the rows from the other transaction, even if if it had to wait in thr_lock() for other to complete.
  Store latest transaction id in controll file if recovery was done.
  - This allows one to run maria_chk on an automatcally recovered tables without warnings about too small transaction id
storage/maria/ha_maria.h:
  Don't give warning that crashed table could not be repaired if repair was disabled (and thus not run)
storage/maria/ma_blockrec.h:
  Added new function "_ma_block_get_status_no_versioning()"
storage/maria/ma_init.c:
  Added hook to create trn in ma_block_get_status() if we are using MariaDB
storage/maria/ma_open.c:
  Ensure we call _ma_block_get_status_no_versioning() for transactional tables without versioning (like tables with fulltext)
storage/maria/ma_pagecache.c:
  Allow one to flush blocks that are pinned for read.
  This fixed a error result from flush_key_cache() which caused a DBUG_ASSERT() when one was using concurrent reads on non transactional tables that was updated.
storage/maria/ma_recovery.c:
  Set maria_recovery_changed_data to 1 if recover changed something.
  Set max_trid_in_control_file to max found trn if we found a bigger trn.
  The allows will ensure that the control file is up to date after recovery which allows one to run maria_chk on the tables without warnings about too big trn
storage/maria/ma_state.c:
  Call maria_create_trn_hook() in _ma_setup_live_state() instead of ha_maria::external_lock()
  This ensures that 'state' and trn are in sync and thus fixes the race condition mentioned for ha_maria.cc
storage/maria/ma_static.c:
  Added maria_create_trn_hook() and maria_recovery_changed_data
storage/maria/maria_def.h:
  Added MARIA_HANDLER->external_ptr, which is used to hold MariaDB thd.
  Added some new external variables
  Removed reference to non existing function: maria_concurrent_inserts()
2010-06-14 01:13:32 +03:00
Davi Arnaut
db2fe44c84 Merge of mysql-5.1-bugteam into mysql-trunk-merge. 2010-06-10 22:30:49 -03:00
Davi Arnaut
d6e003545a Merge of mysql-5.1-bugteam into mysql-trunk-merge. 2010-06-10 22:30:49 -03:00
Davi Arnaut
6f3a540c37 Bug#42733: Type-punning warnings when compiling MySQL --
strict aliasing violations.

Essentially, the problem is that large parts of the server were
developed in simpler times (last decades, pre C99 standard) when
strict aliasing and compilers supporting such optimizations were
rare to non-existent. Thus, when compiling the server with a modern
compiler that uses strict aliasing rules to perform optimizations,
there are several places in the code that might trigger undefined
behavior.

As evinced by some recent bugs, GCC does a somewhat good of job
misoptimizing such code, but on the other hand also gives warnings
about suspicious code. One problem is that the warnings aren't
always accurate, yet we can't afford to just shut them off as we
might miss real cases. False-positive cases are aggravated mostly
by casts that are likely to trigger undefined behavior.

The solution is to start a cleanup process focused on fixing and
reducing the amount of strict-aliasing related warnings produced
by GCC and others compilers. A good deal of noise reduction can
be achieved by just removing useless casts that are product of
historical cruft and are likely to trigger undefined behavior if
dereferenced.

client/mysql.cc:
  Remove now-unnecessary casts.
  Break up large strings.
client/mysql_upgrade.c:
  Remove now-unnecessary casts.
client/mysqladmin.cc:
  Remove now-unnecessary casts.
  Break up large strings.
client/mysqlbinlog.cc:
  Remove now-unnecessary casts.
client/mysqlcheck.c:
  Remove now-unnecessary casts.
client/mysqldump.c:
  Remove now-unnecessary casts.
client/mysqlimport.c:
  Remove now-unnecessary casts.
client/mysqlshow.c:
  Remove now-unnecessary casts.
client/mysqlslap.c:
  Remove now-unnecessary casts.
client/mysqltest.cc:
  Remove now-unnecessary casts.
extra/comp_err.c:
  Remove now-unnecessary casts.
extra/my_print_defaults.c:
  Remove now-unnecessary casts.
  Break up large strings.
extra/mysql_waitpid.c:
  Remove now-unnecessary casts.
extra/perror.c:
  Remove now-unnecessary casts.
extra/resolve_stack_dump.c:
  Remove now-unnecessary casts.
extra/resolveip.c:
  Remove now-unnecessary casts.
include/my_getopt.h:
  Use a void pointer type as the opaque type to avoid problems with type
  incompatibility -- GCC issues warnings when the type name is not type
  compatible with a operand. As a side bonus, a explicit cast won't be
  necessary anymore.
include/sslopt-longopts.h:
  Remove now-unnecessary casts.
  Break up large strings.
mysys/my_getopt.c:
  Update opaque type and introduce a type definition for the
  argument to my_getopt_register_get_addr.
server-tools/instance-manager/options.cc:
  Remove now-unnecessary casts.
sql/mysqld.cc:
  Remove now-unnecessary casts.
  Break up large strings.
  Update mysql_getopt_value prototype (the old prototype
  was different from the definition anyway).
sql/sql_plugin.cc:
  The type of a pointer to a function must be compatible with the
  pointed-to function type, otherwise the behavior is undefined.
sql/table.cc:
  The variable buf pointer to pointer to pointer to constant char
  could improperly alias a incompatible type in call to fix_type_
  pointers. Since this was actually dead code, it is simply removed.
sql/unireg.cc:
  Remove call to get_form_pos. The code creates a new FRM file which
  is always truncated and writes the form position as 0. Hence, no
  need to retrieve it, we now for sure it is 0.
storage/archive/archive_reader.c:
  Remove now-unnecessary casts.
storage/myisam/ft_nlq_search.c:
  Read weight directly from the buffer.
storage/myisam/fulltext.h:
  Add explanation about the type duality of a key buffer.
  Add accessor macro to retrieve a FT float value.
storage/myisam/mi_test1.c:
  Remove now-unnecessary casts.
storage/myisam/myisam_ftdump.c:
  Read weight directly from the buffer.
storage/myisam/myisamchk.c:
  Remove now-unnecessary casts.
storage/myisam/myisamlog.c:
  A pointer to char was used to alias a pointer to pointer to
  unsigned char, thus violating strict aliasing rules.
storage/myisam/myisampack.c:
  Remove now-unnecessary casts.
strings/decimal.c:
  Remove aliasing violation, printing the value is enough for
  debugging purposes.
tests/mysql_client_test.c:
  Remove now-unnecessary casts.
2010-06-10 17:16:43 -03:00
Davi Arnaut
bb036c93b4 Bug#42733: Type-punning warnings when compiling MySQL --
strict aliasing violations.

Essentially, the problem is that large parts of the server were
developed in simpler times (last decades, pre C99 standard) when
strict aliasing and compilers supporting such optimizations were
rare to non-existent. Thus, when compiling the server with a modern
compiler that uses strict aliasing rules to perform optimizations,
there are several places in the code that might trigger undefined
behavior.

As evinced by some recent bugs, GCC does a somewhat good of job
misoptimizing such code, but on the other hand also gives warnings
about suspicious code. One problem is that the warnings aren't
always accurate, yet we can't afford to just shut them off as we
might miss real cases. False-positive cases are aggravated mostly
by casts that are likely to trigger undefined behavior.

The solution is to start a cleanup process focused on fixing and
reducing the amount of strict-aliasing related warnings produced
by GCC and others compilers. A good deal of noise reduction can
be achieved by just removing useless casts that are product of
historical cruft and are likely to trigger undefined behavior if
dereferenced.
2010-06-10 17:16:43 -03:00
Alexander Nozdrin
b3018e8613 Manual merge from mysql-trunk-merge.
Conflicts:
  - client/mysql.cc
  - client/mysqldump.c
  - configure.in
  - mysql-test/r/csv.result
  - mysql-test/r/func_time.result
  - mysql-test/r/show_check.result
  - mysql-test/r/sp-error.result
  - mysql-test/r/sp.result
  - mysql-test/r/sp_trans.result
  - mysql-test/r/type_blob.result
  - mysql-test/r/type_timestamp.result
  - mysql-test/r/warnings.result
  - mysql-test/suite/rpl/r/rpl_sp.result
  - sql/mysql_priv.h
  - sql/mysqld.cc
  - sql/sp.cc
  - sql/sql_base.cc
  - sql/sql_table.cc
  - sql/sql_trigger.cc
  - sql/sql_view.cc
  - sql/table.h
  - sql/share/errmsg.txt
  - mysql-test/suite/sys_vars/r/log_bin_trust_routine_creators_basic.result
2010-02-24 16:52:27 +03:00
Alexander Nozdrin
04b8cb1882 Manual merge from mysql-trunk-merge.
Conflicts:
  - client/mysql.cc
  - client/mysqldump.c
  - configure.in
  - mysql-test/r/csv.result
  - mysql-test/r/func_time.result
  - mysql-test/r/show_check.result
  - mysql-test/r/sp-error.result
  - mysql-test/r/sp.result
  - mysql-test/r/sp_trans.result
  - mysql-test/r/type_blob.result
  - mysql-test/r/type_timestamp.result
  - mysql-test/r/warnings.result
  - mysql-test/suite/rpl/r/rpl_sp.result
  - sql/mysql_priv.h
  - sql/mysqld.cc
  - sql/sp.cc
  - sql/sql_base.cc
  - sql/sql_table.cc
  - sql/sql_trigger.cc
  - sql/sql_view.cc
  - sql/table.h
  - sql/share/errmsg.txt
  - mysql-test/suite/sys_vars/r/log_bin_trust_routine_creators_basic.result
2010-02-24 16:52:27 +03:00
Magne Mahre
68b5c12d76 WL#5182 Remove more deprecated 4.1/5.0 features
WL#5154 was a task for formally deprecating and removing items that
were mentioned in the manual as having been deprecated since MySQL
4.1 or 5.0, but that had never been removed.

Since WL#5154 was created, examination of mysqld.cc, mysql.cc, and
mysqldump.c reveals additional deprecations not mentioned in the
manual. (In some cases, the items are simply not mentioned in the
5.1+ manuals.)

This is a follow-on task to deprecate and remove these additional
items.

The deprecation happened in MySQL 5.1, and the options/variables
are now removed from the code.



client/mysql.cc:
  --no-tee is now removed
client/mysqldump.c:
  --all is now removed
  -a now points to --create-options
sql/mysqld.cc:
  delay-key-write-for-all-tables is removed
  --enable-locking is removed
  --log-update is removed
  --skip-locking is removed
  --skip-symlink is removed
  --sql-bin-update-same is removed
  --warnings is removed
  --record-buffer is removed
2010-02-17 13:15:07 +01:00
Magne Mahre
efaf2ee253 WL#5182 Remove more deprecated 4.1/5.0 features
WL#5154 was a task for formally deprecating and removing items that
were mentioned in the manual as having been deprecated since MySQL
4.1 or 5.0, but that had never been removed.

Since WL#5154 was created, examination of mysqld.cc, mysql.cc, and
mysqldump.c reveals additional deprecations not mentioned in the
manual. (In some cases, the items are simply not mentioned in the
5.1+ manuals.)

This is a follow-on task to deprecate and remove these additional
items.

The deprecation happened in MySQL 5.1, and the options/variables
are now removed from the code.
2010-02-17 13:15:07 +01:00
Magne Mahre
7178879c80 WL#5154 Remove deprecated 4.1 features
A set of program options and variables was deprecated in
MySQL 5.1, and is hereby removed.



client/mysql.cc:
  --no-auto-rehash (-A)  is no longer deprecated
  --no-named-commands (-g) is now removed
  --skip-line-numbers (-L) is no longer deprecated
  --set-variable (-O) is now removed
  --no-pager is now removed
client/mysqlbinlog.cc:
  --position is now removed (use --start-position)
  -j is now equivalent with --start-position
client/mysqldump.c:
  --first-slave is now removed
  --no-set-names (-N) is now removed
  --set-variable (-O) is now removed
mysql-test/include/default_mysqld.cnf:
  default-character-set is removed as an option
  character-set-server is equivalent.
mysql-test/t/bug47671-master.opt:
  default-character-set option is removed
  character-set-server is equivalent
mysql-test/t/ctype_latin1_de-master.opt:
  default-character-set option is removed
  character-set-server is equivalent
mysql-test/t/ctype_ucs2_def-master.opt:
  default-collation is removed
  collation-server is equicalent
scripts/mysqld_multi.sh:
  --config-file has been superseded by
  --defaults-extra-file
sql/mysql_priv.h:
  Removed the version number in the deprecation
  warning text, as decided by ServerPT.
sql/mysqld.cc:
  --default-character-set (-C) is removed
  --default-collation is removed
  --log-long-format (-0) is removed
  --safe-show-database is removed
  --set-variable (-O) is removed
sql/sql_yacc.yy:
  The FRAC_SECOND keyword is removed
sql/sys_vars.cc:
  The sql_log_update system variable is removed
2010-02-17 10:18:17 +01:00
Magne Mahre
1f7f620f30 WL#5154 Remove deprecated 4.1 features
A set of program options and variables was deprecated in
MySQL 5.1, and is hereby removed.
2010-02-17 10:18:17 +01:00
Alexey Kopytov
0888e40fa3 Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Conflicts:

Text conflict in .bzr-mysql/default.conf
Text conflict in mysql-test/suite/rpl/r/rpl_slow_query_log.result
Text conflict in mysql-test/suite/rpl/t/rpl_slow_query_log.test
Conflict adding files to server-tools.  Created directory.
Conflict because server-tools is not versioned, but has versioned children.  Versioned directory.
Conflict adding files to server-tools/instance-manager.  Created directory.
Conflict because server-tools/instance-manager is not versioned, but has versioned children.  Versioned directory.
Contents conflict in server-tools/instance-manager/options.cc
Text conflict in sql/mysqld.cc
2010-02-09 12:59:38 +05:00
Alexey Kopytov
017c969896 Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Conflicts:

Text conflict in .bzr-mysql/default.conf
Text conflict in mysql-test/suite/rpl/r/rpl_slow_query_log.result
Text conflict in mysql-test/suite/rpl/t/rpl_slow_query_log.test
Conflict adding files to server-tools.  Created directory.
Conflict because server-tools is not versioned, but has versioned children.  Versioned directory.
Conflict adding files to server-tools/instance-manager.  Created directory.
Conflict because server-tools/instance-manager is not versioned, but has versioned children.  Versioned directory.
Contents conflict in server-tools/instance-manager/options.cc
Text conflict in sql/mysqld.cc
2010-02-09 12:59:38 +05:00
Alexander Nozdrin
2b0f6b5ace Manual merge from mysql-trunk-merge.
Conflicts:
  - mysql-test/suite/rpl/r/rpl_binlog_grant.result
  - mysql-test/suite/rpl/r/rpl_sp.result
  - mysql-test/suite/rpl/t/rpl_binlog_grant.test
  - sql/sql_parse.cc
  - sql/sql_table.cc
  - sql/sql_test.cc
2010-01-31 01:06:50 +03:00
Alexander Nozdrin
ddc8765a9e Manual merge from mysql-trunk-merge.
Conflicts:
  - mysql-test/suite/rpl/r/rpl_binlog_grant.result
  - mysql-test/suite/rpl/r/rpl_sp.result
  - mysql-test/suite/rpl/t/rpl_binlog_grant.test
  - sql/sql_parse.cc
  - sql/sql_table.cc
  - sql/sql_test.cc
2010-01-31 01:06:50 +03:00
Alexander Nozdrin
0da16c7c2a Manual merge from mysql-5.1-bugteam.
Conflicts:
  - mysql-test/collections/default.experimental
  - mysql-test/suite/rpl/r/rpl_binlog_grant.result
  - mysql-test/suite/rpl/r/rpl_sp.result
  - mysql-test/suite/rpl/t/rpl_binlog_grant.test
  - mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
2010-01-30 22:13:36 +03:00
Alexander Nozdrin
85c54dddc7 Manual merge from mysql-5.1-bugteam.
Conflicts:
  - mysql-test/collections/default.experimental
  - mysql-test/suite/rpl/r/rpl_binlog_grant.result
  - mysql-test/suite/rpl/r/rpl_sp.result
  - mysql-test/suite/rpl/t/rpl_binlog_grant.test
  - mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
2010-01-30 22:13:36 +03:00
Staale Smedseng
18761a9223 Bug #49223 Change help description for mysqldump
--extended-insert

Help message changed to the same as in the 5.1 online 
documentation.
2010-01-27 16:13:39 +01:00
Staale Smedseng
7d5bb84a9a Bug #49223 Change help description for mysqldump
--extended-insert

Help message changed to the same as in the 5.1 online 
documentation.
2010-01-27 16:13:39 +01:00
Magne Mahre
35c6bb89e6 WL#5182 Remove more deprecated 4.1/5.0 features
WL#5182 is a follow-up to WL#5154, deprecating a few more options
and system variables.


client/client_priv.h:
  The warning message has been changed to not include
  a specific version number in the text.
client/mysql.cc:
  --no-tee is deprecated
client/mysqldump.c:
  --all is deprecated
  -a now points to create-options
mysql-test/r/mysqlbinlog.result:
  Warning text changed
mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result:
  Warning text changed
sql/mysql_priv.h:
  The warning message has been changed to not include
  a specific version number in the text.
sql/mysqld.cc:
  --use-symbolic-links is deprecated
  -s now points to --symbolic-links
  --warnings is deprecated
  -W now points to --log-warnings
          
  myisam_max_extra_sort_file_size is deprecated
  record_buffer is deprecated
          
  --log-update is deprecated
  --sql-bin-update-same is deprecated
  --skip-locking is deprecated
  --skip-symlink is deprecated
  --enable-locking is deprecated
  --delay-key-write-for-all-tables is deprecated
2010-01-27 13:23:28 +01:00
Magne Mahre
e17fe14c81 WL#5182 Remove more deprecated 4.1/5.0 features
WL#5182 is a follow-up to WL#5154, deprecating a few more options
and system variables.
2010-01-27 13:23:28 +01:00
Alexey Kopytov
4a1b59b7ab Manual merge of mysql-5.1-bugteam into mysql-trunk-merge. 2010-01-24 00:09:23 +03:00
Alexey Kopytov
7b5f5d5c37 Manual merge of mysql-5.1-bugteam into mysql-trunk-merge. 2010-01-24 00:09:23 +03:00
Magne Mahre
132b46e96e WL#5154 Remove deprecated 4.1 features
Several items said to be deprecated in the 4.1 manual
have never been removed.  This worklog adds deprecation
warnings when these items are used, and warns the user 
that the items will be removed in MySQL 5.6.

A couple of previously deprecation decision have been
reversed (see single file comments)



client/client_priv.h:
  Macro similar to the one in the server (mysql_priv.h)
  for printing a deprecation warning message
client/mysql.cc:
  no-auto-rehash  will not be deprecated
  skip-line-numbers will not be deprecated
  skip-column-names will not be deprecated
  no-pager is deprecated
  set-variable is deprecated
  no-named-commands is deprecated
client/mysqladmin.cc:
  set-variable is deprecated
client/mysqlbinlog.cc:
  position is deprecated
client/mysqldump.c:
  first-slave is deprecated
  no-set-names is deprecated
  set-variable is deprecated
mysql-test/r/mysqlbinlog.result:
  Adding the [Warning] to the test case, just to show that the
  deprecation works.
  The test case will be changed in Celosia to use --start-position.
mysys/my_getopt.c:
  set-variable (include -O) is deprecated
scripts/mysqld_multi.sh:
  Warning for mysqld_multi
sql/mysqld.cc:
  default-collation is deprecated
  log-bin-trust-routine-creators is deprecated
  set-variable is deprecated
  default-character-set is deprecated
  safe-show-database is deprecated
sql/share/errmsg.txt:
  Added version number for sql_log_update deprecation message.
2010-01-21 09:10:05 +01:00
Magne Mahre
0482b6ebca WL#5154 Remove deprecated 4.1 features
Several items said to be deprecated in the 4.1 manual
have never been removed.  This worklog adds deprecation
warnings when these items are used, and warns the user 
that the items will be removed in MySQL 5.6.

A couple of previously deprecation decision have been
reversed (see single file comments)
2010-01-21 09:10:05 +01:00
Alexander Nozdrin
0ae23cd69d Auto-merge from mysql-trunk-merge. 2009-12-24 10:56:13 +03:00
Alexander Nozdrin
7917f0852f Auto-merge from mysql-trunk-merge. 2009-12-24 10:56:13 +03:00
Alexey Kopytov
930a08784c Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Conflicts:

Conflict adding files to server-tools.  Created directory.
Conflict because server-tools is not versioned, but has versioned children.  Versioned directory.
Conflict adding files to server-tools/instance-manager.  Created directory.
Conflict because server-tools/instance-manager is not versioned, but has versioned children.  Versioned directory.
Contents conflict in server-tools/instance-manager/instance_map.cc
Contents conflict in server-tools/instance-manager/listener.cc
Contents conflict in server-tools/instance-manager/options.cc
Contents conflict in server-tools/instance-manager/user_map.cc
2009-12-23 16:42:05 +03:00
Alexey Kopytov
af74c3436f Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Conflicts:

Conflict adding files to server-tools.  Created directory.
Conflict because server-tools is not versioned, but has versioned children.  Versioned directory.
Conflict adding files to server-tools/instance-manager.  Created directory.
Conflict because server-tools/instance-manager is not versioned, but has versioned children.  Versioned directory.
Contents conflict in server-tools/instance-manager/instance_map.cc
Contents conflict in server-tools/instance-manager/listener.cc
Contents conflict in server-tools/instance-manager/options.cc
Contents conflict in server-tools/instance-manager/user_map.cc
2009-12-23 16:42:05 +03:00
Staale Smedseng
8c65b726a5 Recommit of Bug#49447. 2010-02-04 13:39:42 +01:00
Staale Smedseng
e3c1c83a16 Recommit of Bug#49447. 2010-02-04 13:39:42 +01:00
Davi Arnaut
61ae928898 Manual merge. 2009-12-18 16:44:24 -02:00
Davi Arnaut
26f1a8ead2 Manual merge. 2009-12-18 16:44:24 -02:00
Davi Arnaut
06a1df9181 Bug#48983: Bad strmake calls (length one too long)
The problem is a somewhat common misusage of the strmake function.
The strmake(dst, src, len) function writes at most /len/ bytes to
the string pointed to by src, not including the trailing null byte.
Hence, if /len/ is the exact length of the destination buffer, a
one byte buffer overflow can occur if the length of the source
string is equal to or greater than /len/.

client/mysqldump.c:
  Make room for the trailing null byte.
libmysql/libmysql.c:
  Add comment, there is enough room in the buffer.
  Increase buffer length, two strings are concatenated.
libmysqld/lib_sql.cc:
  Make room for the trailing null byte.
mysys/default.c:
  Make room for the trailing null bytes.
mysys/mf_pack.c:
  Make room for the trailing null byte.
server-tools/instance-manager/commands.cc:
  Copy only if overflow isn't possible in both cases.
server-tools/instance-manager/listener.cc:
  Make room for the trailing null byte.
sql/log.cc:
  Make room for the trailing null byte.
sql/sp_pcontext.h:
  Cosmetic fix.
sql/sql_acl.cc:
  MAX_HOSTNAME already specifies space for the trailing null byte.
sql/sql_parse.cc:
  Make room for the trailing null byte.
sql/sql_table.cc:
  Make room for the trailing null byte.
2009-12-17 15:58:38 -02:00
Davi Arnaut
b9380f0e76 Bug#48983: Bad strmake calls (length one too long)
The problem is a somewhat common misusage of the strmake function.
The strmake(dst, src, len) function writes at most /len/ bytes to
the string pointed to by src, not including the trailing null byte.
Hence, if /len/ is the exact length of the destination buffer, a
one byte buffer overflow can occur if the length of the source
string is equal to or greater than /len/.
2009-12-17 15:58:38 -02:00
Marc Alff
bea4ab9bb6 Merge mysql-next-mr (revno 2936) --> mysql-next-mr-marc 2009-12-11 01:58:13 -07:00
Marc Alff
edd5ff174c Merge mysql-next-mr (revno 2936) --> mysql-next-mr-marc 2009-12-11 01:58:13 -07:00
Marc Alff
c082955f06 WL#2360 Performance schema
Part III: mysys instrumentation
2009-12-09 20:19:51 -07:00
Marc Alff
e33a8b2a1a WL#2360 Performance schema
Part III: mysys instrumentation
2009-12-09 20:19:51 -07:00
Alexander Nozdrin
52c66b5671 Manual merge/pull from mysql-next-mr.
Conflicts:
  - sql/sql_insert.cc
2009-11-25 18:03:05 +03:00
Alexander Nozdrin
a8d553e0e3 Manual merge/pull from mysql-next-mr.
Conflicts:
  - sql/sql_insert.cc
2009-11-25 18:03:05 +03:00
Konstantin Osipov
9a9e8d2311 Backport of:
----------------------------------------------------------------------
ChangeSet@1.2571, 2008-04-08 12:30:06+02:00, vvaintroub@wva. +122 -0
  Bug#32082 : definition of VOID in my_global.h conflicts with Windows
  SDK headers
  
  VOID macro is now removed. Its usage is replaced with void cast.
  In some cases, where cast does not make much sense (pthread_*, printf, 
  hash_delete, my_seek), cast is ommited.


client/mysqladmin.cc:
  Bug#32082 : remove VOID macro
client/mysqldump.c:
  Bug#32082 : remove VOID macro
client/mysqlimport.c:
  Bug#32082 : remove VOID macro
client/mysqlslap.c:
  Bug#32082 : remove VOID macro
client/mysqltest.cc:
  Bug#32082 : remove VOID macro
client/sql_string.cc:
  Bug#32082 : remove VOID macro
extra/comp_err.c:
  Bug#32082 : remove VOID macro
extra/replace.c:
  Bug#32082 : remove VOID macro
include/my_alarm.h:
  Bug#32082 : remove VOID macro
include/my_global.h:
  Bug#32082 : remove VOID macro
libmysql/libmysql.c:
  Bug#32082 : remove VOID macro
mysys/errors.c:
  Bug#32082 : remove VOID macro
mysys/hash.c:
  Bug#32082 : remove VOID macro
mysys/mf_iocache2.c:
  Bug#32082 : remove VOID macro
mysys/mf_loadpath.c:
  Bug#32082 : remove VOID macro
mysys/mf_path.c:
  Bug#32082 : remove VOID macro
mysys/my_append.c:
  Bug#32082 : remove VOID macro
mysys/my_clock.c:
  Bug#32082 : remove VOID macro
mysys/my_copy.c:
  Bug#32082 : remove VOID macro
mysys/my_fstream.c:
  Bug#32082 : remove VOID macro
mysys/my_getwd.c:
  Bug#32082 : remove VOID macro
mysys/my_lib.c:
  Bug#32082 : remove VOID macro
mysys/my_lockmem.c:
  Bug#32082 : remove VOID macro
mysys/my_pthread.c:
  Bug#32082 : remove VOID macro
mysys/my_redel.c:
  Bug#32082 : remove VOID macro
mysys/stacktrace.c:
  Bug#32082 : remove VOID macro
mysys/thr_alarm.c:
  Bug#32082 : remove VOID macro
mysys/thr_lock.c:
  Bug#32082 : remove VOID macro
sql/derror.cc:
  Bug#32082 : remove VOID macro
sql/des_key_file.cc:
  Bug#32082 : remove VOID macro
sql/discover.cc:
  Bug#32082 : remove VOID macro
sql/field.cc:
  Bug#32082 : remove VOID macro
sql/filesort.cc:
  Bug#32082 : remove VOID macro
sql/ha_ndbcluster.cc:
  Bug#32082 : remove VOID macro
sql/ha_partition.cc:
  Bug#32082 : remove VOID macro
sql/handler.cc:
  Bug#32082 : remove VOID macro
sql/hostname.cc:
  Bug#32082 : remove VOID macro
sql/init.cc:
  Bug#32082 : remove VOID macro
sql/item.cc:
  Bug#32082 : remove VOID macro
sql/item_cmpfunc.cc:
  Bug#32082 : remove VOID macro
sql/item_strfunc.cc:
  Bug#32082 : remove VOID macro
sql/lock.cc:
  Bug#32082 : remove VOID macro
sql/log.cc:
  Bug#32082 : remove VOID macro
sql/log_event.cc:
  Bug#32082 : remove VOID macro
sql/mysqld.cc:
  Bug#32082 : remove VOID macro
sql/opt_range.h:
  Bug#32082 : remove VOID macro
sql/protocol.cc:
  Bug#32082 : remove VOID macro
sql/records.cc:
  Bug#32082 : remove VOID macro
sql/sp_head.cc:
  Bug#32082 : remove VOID macro
sql/sp_pcontext.cc:
  Bug#32082 : remove VOID macro
sql/sql_acl.cc:
  Bug#32082 : remove VOID macro
sql/sql_base.cc:
  Bug#32082 : remove VOID macro
sql/sql_cache.cc:
  Bug#32082 : remove VOID macro
sql/sql_connect.cc:
  Bug#32082 : remove VOID macro
sql/sql_db.cc:
  Bug#32082 : remove VOID macro
sql/sql_delete.cc:
  Bug#32082 : remove VOID macro
sql/sql_handler.cc:
  Bug#32082 : remove VOID macro
sql/sql_insert.cc:
  Bug#32082 : remove VOID macro
sql/sql_map.cc:
  Bug#32082 : remove VOID macro
sql/sql_parse.cc:
  Bug#32082 : remove VOID macro
sql/sql_select.cc:
  Bug#32082 : remove VOID macro
sql/sql_servers.cc:
  Bug#32082 : remove VOID macro
sql/sql_show.cc:
  Bug#32082 : remove VOID macro
sql/sql_string.cc:
  Bug#32082 : remove VOID macro
sql/sql_table.cc:
  Bug#32082 : remove VOID macro
sql/sql_test.cc:
  Bug#32082 : remove VOID macro
sql/sql_trigger.cc:
  Bug#32082 : remove VOID macro
sql/sql_update.cc:
  Bug#32082 : remove VOID macro
sql/sql_view.cc:
  Bug#32082 : remove VOID macro
sql/table.cc:
  Bug#32082 : remove VOID macro
sql/tztime.cc:
  Bug#32082 : remove VOID macro
sql/udf_example.c:
  Bug#32082 : remove VOID macro
sql/uniques.cc:
  Bug#32082 : remove VOID macro
sql/unireg.cc:
  Bug#32082 : remove VOID macro
storage/archive/ha_archive.cc:
  Bug#32082 : remove VOID macro
storage/blackhole/ha_blackhole.cc:
  Bug#32082 : remove VOID macro
storage/csv/ha_tina.cc:
  Bug#32082 : remove VOID macro
storage/csv/transparent_file.cc:
  Bug#32082 : remove VOID macro
storage/example/ha_example.cc:
  Bug#32082 : remove VOID macro
storage/federated/ha_federated.cc:
  Bug#32082 : remove VOID macro
storage/heap/hp_clear.c:
  Bug#32082 : remove VOID macro
storage/heap/hp_create.c:
  Bug#32082 : remove VOID macro
storage/heap/hp_test1.c:
  Bug#32082 : remove VOID macro
storage/heap/hp_test2.c:
  Bug#32082 : remove VOID macro
storage/innobase/handler/ha_innodb.cc:
  Bug#32082 : remove VOID macro
storage/myisam/ft_eval.c:
  Bug#32082 : remove VOID macro
storage/myisam/ha_myisam.cc:
  Bug#32082 : remove VOID macro
storage/myisam/mi_changed.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_check.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_close.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_create.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_dbug.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_delete.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_delete_all.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_dynrec.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_info.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_locking.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_log.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_open.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_packrec.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_panic.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_rsame.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_statrec.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_test1.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_test2.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_test3.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_update.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_write.c:
  Bug#32082 : remove VOID macro
storage/myisam/myisamchk.c:
  Bug#32082 : remove VOID macro
storage/myisam/myisamlog.c:
  Bug#32082 : remove VOID macro
storage/myisam/myisampack.c:
  Bug#32082 : remove VOID macro
storage/myisam/sort.c:
  Bug#32082 : remove VOID macro
storage/myisammrg/myrg_close.c:
  Bug#32082 : remove VOID macro
storage/myisammrg/myrg_create.c:
  Bug#32082 : remove VOID macro
storage/myisammrg/myrg_open.c:
  Bug#32082 : remove VOID macro
strings/str_test.c:
  Bug#32082 : remove VOID macro
tests/thread_test.c:
  Bug#32082 : remove VOID macro
2009-11-24 16:54:59 +03:00
Konstantin Osipov
4cff617c25 Backport of:
----------------------------------------------------------------------
ChangeSet@1.2571, 2008-04-08 12:30:06+02:00, vvaintroub@wva. +122 -0
  Bug#32082 : definition of VOID in my_global.h conflicts with Windows
  SDK headers
  
  VOID macro is now removed. Its usage is replaced with void cast.
  In some cases, where cast does not make much sense (pthread_*, printf, 
  hash_delete, my_seek), cast is ommited.
2009-11-24 16:54:59 +03:00
Konstantin Osipov
34b11fb627 Merge with next-mr 2009-11-20 17:18:37 +03:00
Konstantin Osipov
d51a4fae32 Merge with next-mr 2009-11-20 17:18:37 +03:00
Alexey Botchkov
6c832ee4bf merging. 2009-11-17 15:27:40 +04:00
Alexey Botchkov
12043816fa merging. 2009-11-17 15:27:40 +04:00
Magne Mahre
a5ab2c30df BUG #8368 "mysqldump needs --slave-data option"
Added this option, named as "--dump-slave". The purpose of this option is to be
able to produce a dump from a slave used for making backups of the master. Originally,
dumping from the main master was fine, but as more data accumulated, the dump process
would take over 30 minutes, locking up the master database hence website for 30 minutes.
A slave dedicated to producing backups was the answer, but I needed a dump that could be

used to restore a slave instantly and in order to do that, it has to have three things 
contained in the dump:
  
  1. "STOP SLAVE;" at the beginning
  2. "CHANGE MASTER TO ...<the master - info from 'show slave status'>"
  3. "START SLAVE;" at the end
  
These options in this changeset contain this.
  
  --stop-slave adds "STOP SLAVE" to the beginning of the dump and "STOP SLAVE" 
  to the end of the dump.
  
  --include-host gives the user the option to have the host explicitely added
  to the "CHANGE MASTER TO ..." line.
  
  --dump-slave adds the "CHANGE MASTER ..." to the dump representing not the slave's
  master binlog info, but the slave's master's info from "SHOW SLAVE STATUS" 


client/client_priv.h:
  Added OPT_SLAVE_DATA to client_priv.h
client/mysqldump.c:
  * Added --dump-slave option (name per Brian)
  * Added --stop-slave to print "STOP SLAVE;" into the dump
  * Added --include-host option to include "MASTER_HOST=..." and "MASTER_PORT=..."
    to the dump since unlike --master-data, the host can't be assumed to be
    the local host
  * Added do_start_slave and do_stop_slave to stop the slave sql thread upon
    start of the dump process, and to start the slave sql upon finish of dump process -
    to keep the log information frozen during this time.
  * Added do_show_slave_status for obtaining slave information needed to compose 
    "CHANGE MASTER ..." output to the master of this slave.
  * Added necessary long options and defines required for new options
2009-11-04 14:31:03 +01:00
Magne Mahre
6eb797f973 BUG #8368 "mysqldump needs --slave-data option"
Added this option, named as "--dump-slave". The purpose of this option is to be
able to produce a dump from a slave used for making backups of the master. Originally,
dumping from the main master was fine, but as more data accumulated, the dump process
would take over 30 minutes, locking up the master database hence website for 30 minutes.
A slave dedicated to producing backups was the answer, but I needed a dump that could be

used to restore a slave instantly and in order to do that, it has to have three things 
contained in the dump:
  
  1. "STOP SLAVE;" at the beginning
  2. "CHANGE MASTER TO ...<the master - info from 'show slave status'>"
  3. "START SLAVE;" at the end
  
These options in this changeset contain this.
  
  --stop-slave adds "STOP SLAVE" to the beginning of the dump and "STOP SLAVE" 
  to the end of the dump.
  
  --include-host gives the user the option to have the host explicitely added
  to the "CHANGE MASTER TO ..." line.
  
  --dump-slave adds the "CHANGE MASTER ..." to the dump representing not the slave's
  master binlog info, but the slave's master's info from "SHOW SLAVE STATUS"
2009-11-04 14:31:03 +01:00
Magne Mahre
0dae88ca2a Bug#35224: mysqldump --help is very confusing
The presence of "--skip" parameters is obscure, when it should be
obvious from the text.
  
Now, for boolean options, when they're default to ON and the --skip
is more useful parameter, then tell the user of its existence.

Backported from 6.0-codebase, revid  2572.14.1
2009-11-03 10:22:22 +01:00
Magne Mahre
6e916e03bd Bug#35224: mysqldump --help is very confusing
The presence of "--skip" parameters is obscure, when it should be
obvious from the text.
  
Now, for boolean options, when they're default to ON and the --skip
is more useful parameter, then tell the user of its existence.

Backported from 6.0-codebase, revid  2572.14.1
2009-11-03 10:22:22 +01:00
Konstantin Osipov
9b41c7532d Backport of:
----------------------------------------------------------
revno: 2617.22.5
committer: Konstantin Osipov <kostja@sun.com>
branch nick: mysql-6.0-runtime
timestamp: Tue 2009-01-27 05:08:48 +0300
message:
  Remove non-prefixed use of HASH.
  Always use my_hash_init(), my_hash_inited(), my_hash_search(),
  my_hash_element(), my_hash_delete(), my_hash_free() rather
  than non-prefixed counterparts (hash_init(), etc).
  Remove the backward-compatible defines.
2009-10-14 20:37:38 +04:00
Konstantin Osipov
64dbe379d7 Backport of:
----------------------------------------------------------
revno: 2617.22.5
committer: Konstantin Osipov <kostja@sun.com>
branch nick: mysql-6.0-runtime
timestamp: Tue 2009-01-27 05:08:48 +0300
message:
  Remove non-prefixed use of HASH.
  Always use my_hash_init(), my_hash_inited(), my_hash_search(),
  my_hash_element(), my_hash_delete(), my_hash_free() rather
  than non-prefixed counterparts (hash_init(), etc).
  Remove the backward-compatible defines.
2009-10-14 20:37:38 +04:00
Alexey Botchkov
760d42e7d0 Bug#47216 programs should quit if the file specified by --defaults-file option isn't found
added code to exit a tool if the forced config file wasn't found

per-file comments:
  client/mysql.cc
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysql_upgrade.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqladmin.cc
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqlcheck.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqldump.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqlimport.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqlshow.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqlslap.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  mysql-test/t/mysql.test
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
   test added
  sql/mysqld.cc
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  storage/myisam/myisamchk.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  storage/myisam/myisampack.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
2009-10-09 19:44:22 +05:00
Alexey Botchkov
de7619823d Bug#47216 programs should quit if the file specified by --defaults-file option isn't found
added code to exit a tool if the forced config file wasn't found

per-file comments:
  client/mysql.cc
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysql_upgrade.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqladmin.cc
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqlcheck.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqldump.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqlimport.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqlshow.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  client/mysqlslap.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  mysql-test/t/mysql.test
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
   test added
  sql/mysqld.cc
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  storage/myisam/myisamchk.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
  storage/myisam/myisampack.c
Bug#47216      programs should quit if the file specified by --defaults-file option isn't found
    added code to exit a tool if the forced config file wasn't found
2009-10-09 19:44:22 +05:00
Alexander Nozdrin
63e5078825 A backport of a patch for Bug#35297.
Original revision in mysql-6.0-codebase is:

revno: 2617.31.14
committer: Konstantin Osipov <kostja@sun.com>
branch nick: mysql-6.0-runtime
timestamp: Sat 2009-03-28 11:42:55 +0300
message:
  Bug#35297 SHOW CREATE EVENT does not show the DEFINER:
  update test result after a merge from now.
2009-10-08 00:57:03 +04:00
Alexander Nozdrin
83177656d9 A backport of a patch for Bug#35297.
Original revision in mysql-6.0-codebase is:

revno: 2617.31.14
committer: Konstantin Osipov <kostja@sun.com>
branch nick: mysql-6.0-runtime
timestamp: Sat 2009-03-28 11:42:55 +0300
message:
  Bug#35297 SHOW CREATE EVENT does not show the DEFINER:
  update test result after a merge from now.
2009-10-08 00:57:03 +04:00
Guilhem Bichot
12e822039d Fix for BUG#42980 "Client doesn't set NUM_FLAG for DECIMAL and TIMESTAMP":
DECIMAL and TIMESTAMP used to have NUM_FLAG, but NEWDECIMAL was forgotten.
It's correct that TIMESTAMP does not have the flag nowadays (manual will be updated, connectors
developers will be notified).

client/mysqldump.c:
  IS_NUM_FIELD(f) removed and replaced by its definition (f>flags & NUM_FLAG).
include/mysql.h:
  - IS_NUM_FIELD() is removed because name is too close to IS_NUM() and it is not used a lot
  - INTERNAL_NUM_FIELD() is removed:
    * it forgets to test NEWDECIMAL (when IS_NUM() was updated for NEWDECIMAL we forgot
    to update INTERNAL_NUM_FIELD()), that's why client didn't mark NEWDECIMAL with NUM_FLAG (a bug).
    * it has an obsolete test for length of the TIMESTAMP field: test became accidentally wrong when length
    of TIMESTAMP was changed to always be 19 (when the format was changed from YYYYMMDDhhmmss to
    YYYY-MM-DD hh:mm:ss), never 8 or 14 anymore. That obsolete test caused TIMESTAMP to lose NUM_FLAG,
    which was an accidental but good change (see below).
    * IS_NUM() should be used instead
  - IS_NUM(f) is changed: TIMESTAMP used to be parsable as a number without quotes (when it was formatted as
  "YYYYMMDDhhmmss"); but it is not anymore (now that it is "YYYY-MM-DD hh:mm:ss"), so it should not have NUM_FLAG
  (mysqldump needs to quote TIMESTAMP values), so IS_NUM() should return false for it.
libmysqld/lib_sql.cc:
  use IS_NUM() instead of INTERNAL_NUM_FIELD()
mysql-test/r/bigint.result:
  result change: NEWDECIMAL fields now have NUM_FLAG (32768)
mysql-test/r/metadata.result:
  result change: NEWDECIMAL fields now have NUM_FLAG (32768)
mysql-test/r/mysqldump.result:
  DECIMAL columns are not quoted anymore by mysqldump. Which is ok, the parser does not need '' for them
mysql-test/r/ps_2myisam.result:
  result change: NEWDECIMAL fields now have NUM_FLAG (32768)
mysql-test/r/ps_3innodb.result:
  result change: NEWDECIMAL fields now have NUM_FLAG (32768)
mysql-test/r/ps_4heap.result:
  result change: NEWDECIMAL fields now have NUM_FLAG (32768)
mysql-test/r/ps_5merge.result:
  result change: NEWDECIMAL fields now have NUM_FLAG (32768)
mysql-test/suite/ndb/r/ps_7ndb.result:
  result change: NEWDECIMAL fields now have NUM_FLAG (32768)
mysql-test/t/metadata.test:
  test for BUG#42980
sql-common/client.c:
  use IS_NUM() instead of INTERNAL_NUM_FIELD()
2009-09-30 12:25:50 +02:00
Guilhem Bichot
b3886f46da Fix for BUG#42980 "Client doesn't set NUM_FLAG for DECIMAL and TIMESTAMP":
DECIMAL and TIMESTAMP used to have NUM_FLAG, but NEWDECIMAL was forgotten.
It's correct that TIMESTAMP does not have the flag nowadays (manual will be updated, connectors
developers will be notified).
2009-09-30 12:25:50 +02:00
Davi Arnaut
169f7da04c Fix for a few assorted compiler warnings.
client/mysql.cc:
  Remove leading whitespace.
  Remove extra text after #else directive.
client/mysqldump.c:
  Function does not take a parameter.
mysys/array.c:
  buffer is a uchar pointer.
sql/item.cc:
  Assert if it should not happen.
storage/myisam/mi_check.c:
  Cast to expected type. This is probably a bug, but it is
  casted in a similar way in another part of the code.
storage/ndb/include/mgmapi/ndb_logevent.h:
  Apply fix from cluster team.
tests/mysql_client_test.c:
  Remove extraneous slash.
2009-08-28 12:06:59 -03:00
Davi Arnaut
a0e44ec1e8 Fix for a few assorted compiler warnings. 2009-08-28 12:06:59 -03:00
Gleb Shchepa
328754dea7 Additional post-commit fix (bug #30946): server version
in a conditional commentary at the new SELECT ... INTO
OUTFILE ... CHARACTER SET syntax has been updated to 5.1.38.
2009-08-04 00:22:28 +05:00
Gleb Shchepa
4e95179af9 Bug# 30946: mysqldump silently ignores --default-character-set
when used with --tab

1) New syntax: added CHARACTER SET clause to the
  SELECT ... INTO OUTFILE (to complement the same clause in
  LOAD DATA INFILE).
  mysqldump is updated to use this in --tab mode.

2) ESCAPED BY/ENCLOSED BY field parameters are documented as
   accepting CHAR argument, however SELECT .. INTO OUTFILE
   silently ignored rests of multisymbol arguments.
   For the symmetrical behavior with LOAD DATA INFILE the
   server has been modified to fail with the same error:

     ERROR 42000: Field separator argument is not what is
                  expected; check the manual

3) Current LOAD DATA INFILE recognizes field/line separators
   "as is" without converting from client charset to data
   file charset. So, it is supposed, that input file of
   LOAD DATA INFILE consists of data in one charset and
   separators in other charset. For the compatibility with
   that [buggy] behaviour SELECT INTO OUTFILE implementation
   has been saved "as is" too, but the new warning message
   has been added:

     Non-ASCII separator arguments are not fully supported

   This message warns on field/line separators that contain
   non-ASCII symbols.


client/mysqldump.c:
  mysqldump has been updated to call SELECT ... INTO OUTFILE
  statement with a charset from the --default-charset command
  line parameter.
mysql-test/r/mysqldump.result:
  Added test case for bug #30946.
mysql-test/r/outfile_loaddata.result:
  Added test case for bug #30946.
mysql-test/t/mysqldump.test:
  Added test case for bug #30946.
mysql-test/t/outfile_loaddata.test:
  Added test case for bug #30946.
sql/field.cc:
  String conversion code has been moved from check_string_copy_error()
  to convert_to_printable() for reuse.
sql/share/errmsg.txt:
  New WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED message has been added.
sql/sql_class.cc:
  The select_export::prepare() method has been modified to:
  
    1) raise the ER_WRONG_FIELD_TERMINATORS error on multisymbol
       ENCLOSED BY/ESCAPED BY field arguments like LOAD DATA INFILE;
  
    2) warn with a new WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED
       message on non-ASCII field or line separators.
  
  The select_export::send_data() merhod has been modified to
  convert item data to output charset (see new SELECT INTO OUTFILE
  syntax). By default the BINARY charset is used for backward
  compatibility.
sql/sql_class.h:
  The select_export::write_cs field added to keep output
  charset.
sql/sql_load.cc:
  mysql_load has been modified to warn on non-ASCII field or
  line separators with a new WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED
  message.
sql/sql_string.cc:
  New global function has been added: convert_to_printable()
  (common code has been moved from check_string_copy_error()).
sql/sql_string.h:
  New String::is_ascii() method and new global convert_to_printable()
  function have been added.
sql/sql_yacc.yy:
  New syntax: added CHARACTER SET clause to the
  SELECT ... INTO OUTFILE (to complement the same clause in
  LOAD DATA INFILE). By default the BINARY charset is used for
  backward compatibility.
2009-07-31 22:14:52 +05:00
Jim Winstead
1286d0f3f9 Merge in bug fixes for client tools 2009-07-14 10:08:38 -07:00
Jim Winstead
62a4848d09 Merge bug fixes 2009-07-13 12:11:16 -07:00
Gleb Shchepa
b42ce44fbf Additional post-commit fix (bug #30946): server version
in a conditional commentary at the new SELECT ... INTO
OUTFILE ... CHARACTER SET syntax has been updated to 5.1.38.
2009-08-04 00:22:28 +05:00
Gleb Shchepa
e642140b18 Bug# 30946: mysqldump silently ignores --default-character-set
when used with --tab

1) New syntax: added CHARACTER SET clause to the
  SELECT ... INTO OUTFILE (to complement the same clause in
  LOAD DATA INFILE).
  mysqldump is updated to use this in --tab mode.

2) ESCAPED BY/ENCLOSED BY field parameters are documented as
   accepting CHAR argument, however SELECT .. INTO OUTFILE
   silently ignored rests of multisymbol arguments.
   For the symmetrical behavior with LOAD DATA INFILE the
   server has been modified to fail with the same error:

     ERROR 42000: Field separator argument is not what is
                  expected; check the manual

3) Current LOAD DATA INFILE recognizes field/line separators
   "as is" without converting from client charset to data
   file charset. So, it is supposed, that input file of
   LOAD DATA INFILE consists of data in one charset and
   separators in other charset. For the compatibility with
   that [buggy] behaviour SELECT INTO OUTFILE implementation
   has been saved "as is" too, but the new warning message
   has been added:

     Non-ASCII separator arguments are not fully supported

   This message warns on field/line separators that contain
   non-ASCII symbols.
2009-07-31 22:14:52 +05:00
Jim Winstead
bd0a44fba2 Merge in bug fixes for client tools 2009-07-14 10:08:38 -07:00
Jim Winstead
f9025ea331 Merge bug fixes 2009-07-13 12:11:16 -07:00
Georgi Kodinov
097c7b38c8 Bug #45287: phase 2 : 5.0 64 bit compilation warnings
Fixed various compilation warnings when compiling on a 
 64 bit windows.
2009-07-16 15:37:38 +03:00
Georgi Kodinov
bf6e255d8c Bug #45287: phase 2 : 5.0 64 bit compilation warnings
Fixed various compilation warnings when compiling on a 
 64 bit windows.
2009-07-16 15:37:38 +03:00
Georgi Kodinov
abfe915ac9 fixed compilation warnings on macosx 2009-07-07 16:11:46 +03:00
Georgi Kodinov
9161d0f815 fixed compilation warnings on macosx 2009-07-07 16:11:46 +03:00
Georgi Kodinov
9ceb37269d merged 5.0-bugteam -> 5.1-bugteam 2009-06-05 19:40:36 +03:00
Georgi Kodinov
845f968369 merged 5.0-bugteam -> 5.1-bugteam 2009-06-05 19:40:36 +03:00
Georgi Kodinov
07f33a21d7 Addendum to Bug #45286 : implement reviewer's remarks. 2009-06-05 19:23:44 +03:00
Georgi Kodinov
c6fdeff0c7 Addendum to Bug #45286 : implement reviewer's remarks. 2009-06-05 19:23:44 +03:00
Georgi Kodinov
898443572f Bug #45286: compilation warnings on mysql-5.0-bugteam on MacOSX
Merged the 5.0 fix to 5.1 and fixed the 5.1 specific warnings.
2009-06-05 16:44:38 +03:00
Georgi Kodinov
a66fd23980 Bug #45286: compilation warnings on mysql-5.0-bugteam on MacOSX
Merged the 5.0 fix to 5.1 and fixed the 5.1 specific warnings.
2009-06-05 16:44:38 +03:00
Georgi Kodinov
5fc05b9528 automerge 2009-06-05 15:30:57 +03:00
Georgi Kodinov
1a8eb91e06 automerge 2009-06-05 15:30:57 +03:00
Georgi Kodinov
22454390c0 Bug #45286: compilation warnings on mysql-5.0-bugteam on MacOSX
Fixed the 5.0-bugteam MacOSX warnings.

client/mysqldump.c:
  Bug #45286: typecasts
cmd-line-utils/readline/bind.c:
  Bug #45286: use variable of right type
cmd-line-utils/readline/display.c:
  Bug #45286: use variable of right type
dbug/user.r:
  Bug #45286: no warnings in generating man pages
strings/ctype.c:
  Bug #45286: typecasts
2009-06-05 15:05:26 +03:00
Georgi Kodinov
5ec61b304c Bug #45286: compilation warnings on mysql-5.0-bugteam on MacOSX
Fixed the 5.0-bugteam MacOSX warnings.
2009-06-05 15:05:26 +03:00
Alexander Nozdrin
744373ecc0 Fix compilation failures: get rid of C++ specifics in C-code. 2009-06-03 15:18:12 +04:00
Alexander Nozdrin
0f742616ce Fix compilation failures: get rid of C++ specifics in C-code. 2009-06-03 15:18:12 +04:00
Tatiana A. Nurnberg
7f50fc02c2 Bug#34861: mysqldump with --tab gives weird output for triggers.
mysqldump --tab still dumped triggers to stdout rather than to
individual tables.

We now append triggers to the .sql file for the corresponding
table.

--events and --routines correspond to a database rather than a
table and will still go to stdout with --tab unless redirected
with --result-file (-r).

client/mysqldump.c:
  Extend open_sql_file_for_table() so we can open-append.
  Change dump_triggers_for_table() so it will append its
  output to the table's .sql-file when --tab is used.
mysql-test/r/mysqldump.result:
  Show that when using --tab, triggers now end up in the .sql
  file with the corresponding table (after that table), while
  --routines and --events go to stdout or --result-file.
mysql-test/t/mysqldump.test:
  Show that when using --tab, triggers now end up in the .sql
  file with the corresponding table (after that table), while
  --routines and --events go to stdout or --result-file.
2009-05-27 15:16:21 +02:00
Tatiana A. Nurnberg
7eeff66cba Bug#34861: mysqldump with --tab gives weird output for triggers.
mysqldump --tab still dumped triggers to stdout rather than to
individual tables.

We now append triggers to the .sql file for the corresponding
table.

--events and --routines correspond to a database rather than a
table and will still go to stdout with --tab unless redirected
with --result-file (-r).
2009-05-27 15:16:21 +02:00