Commit graph

167 commits

Author SHA1 Message Date
Sergei Golubchik
72c20282db 10.0-base merge 2014-02-03 15:22:39 +01:00
Michael Widenius
04bee0af2e Fix for MDEV-5547: Bad error message when moving very old .frm files to MariaDB 5.5.
mysql_upgrade --help now also prints out --default options and variable values.
mysql_upgrade now prints permission errors.
mysql_upgrade doesn't print some non essential info if --silent is used.
Added handler error message about incompatible versions
Fixed that mysqlbug and mysql_install_db have the executable flag set.
Removed executable flag for some non executable files.
Changed in mysql_install_db askmonty.org to mariadb.com.
Ensured that all client executables prints --default options the same way.
Allow REPAIR ... USE_FRM for old .frm files if the are still compatible.
Extended shown error for storage engine messages.


client/mysql.cc:
  print_defaults() should be first (as in all other programs)
client/mysql_upgrade.c:
  --help now also prints out --default options and variable values
  Print out error if wrong permissions
  Don't print info if --silent
client/mysqladmin.cc:
  print_defaults() should be first (as in all other programs)
client/mysqlbinlog.cc:
  Added print_defaults() to --help
client/mysqlcheck.c:
  Added empty line in --help
client/mysqlimport.c:
  Added empty line in --help
client/mysqlshow.c:
  Made --help compatible
client/mysqlslap.c:
  Made --help compatible
client/mysqltest.cc:
  Added print_defaults() to --help
include/handler_ername.h:
  Added handler error message
include/my_base.h:
  Added handler error message
mysql-test/r/mysql_upgrade.result:
  Updated results
mysql-test/r/repair.result:
  Added test case for better error messages
mysql-test/std_data/host_old.MYD:
  Added test case for better error messages
mysql-test/std_data/host_old.MYI:
  Added test case for better error messages
mysql-test/std_data/host_old.frm:
  Added test case for better error messages
mysql-test/t/repair.test:
  Added test case for better error messages
mysys/my_handler_errors.h:
  Added handler error message
scripts/CMakeLists.txt:
  Fixed that mysqlbug and mysql_install_db have the executable flag set
scripts/mysql_install_db.sh:
  askmonty.org -> mariadb.com
sql/ha_partition.cc:
  Sometimes table_type() can be called for errors even if partition didn't manage to open any files
sql/handler.cc:
  Write clear text for not handled, but defined error messages.
sql/share/errmsg-utf8.txt:
  Extended shown error for storage engine messages
sql/sql_admin.cc:
  Allow REPAIR ... USE_FRM for old .frm files if the are still compatible
storage/myisam/ha_myisam.cc:
  Use new error message
2014-01-22 15:16:57 +02:00
unknown
c776f5ac26 Client attributes 2013-10-03 18:00:44 +03:00
unknown
e5746665c9 merge 10.0-base -> 10.0 2013-09-26 21:20:15 +03:00
Sergey Vojtovich
45d3ada7c2 MDEV-4684 - Enhancement request: --init-command support for mysqlslap
Added --init-command argument to mysqlslap: SQL Command to execute
when connecting to MySQL server. Will automatically be re-executed
when reconnecting.
2013-09-17 18:51:14 +04:00
Sergei Golubchik
40e94a3734 merge with 5.5 2012-11-03 12:28:51 +01: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
Michael Widenius
60589aeee0 Next part of merge. See TODO for details 2012-08-14 17:23:34 +03:00
Nirbhay Choubey
ffdc4bc8cd 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
Georgi Kodinov
06f6e4fe95 Bug #12998841: libmysql divulges plaintext password upon request in 5.5
1. Clear text password client plugin disabled by default.
2. Added an environment variable LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN, that
when set to something starting with '1', 'Y' or 'y' will enable the clear
text
plugin for all connections.
3. Added a new mysql_options() option : MYSQL_ENABLE_CLEARTEXT_PLUGIN
that takes an my_bool argument. When the value of the argument is non-zero
the clear text plugin is enabled for this connection only.
4. Added an enable-cleartext-plugin config file option that takes a numeric

argument. If the numeric value of the numeric argument is non-zero the
clear
text plugin is enabled for the connection
5. Added a boolean command line option "--enable_cleartext_plugin" to
mysql, mysqlslap and mysqladmin. When specified it will call mysql_options
with the effect of #3
6. Added a new CLEARTEXT option to the connect command in mysqltest.
When specified it will enable the cleartext plugin for usage.
7. Added test cases and updated existing ones that need the clear text
plugin.
2012-07-05 09:55:20 +03:00
Sergei Golubchik
431e042b5d c 2012-05-21 15:30:25 +02:00
Venkata Sidagam
5ddbb751c0 Merged from 5.1 to 5.5 2012-04-09 16:43:54 +05:30
Venkata Sidagam
af90fc04ff Bug #11766072 59107: MYSQLSLAP CRASHES IF STARTED WITH NO ARGUMENTS ON WINDOWS
This bug is a duplicate of Bug #31173, which was pushed to the 
mysql-trunk 5.6 on 4th Aug, 2010. This is just a back-port of 
the fix


mysql-test/r/mysqlslap.result:
  A test added as part of the fix for Bug #59107
mysql-test/t/mysqlslap.test:
  A test added as part of the fix for Bug #59107
2012-04-09 16:42:41 +05:30
Venkata Sidagam
1fa5d5b83a Bug #11766072 59107: MYSQLSLAP CRASHES IF STARTED WITH NO ARGUMENTS ON WINDOWS
This bug is a duplicate of Bug #31173, which was pushed to the 
mysql-trunk 5.6 on 4th Aug, 2010. This is just a back-port of 
the fix


mysql-test/r/mysqlslap.result:
  A test added as part of the fix for Bug #59107
mysql-test/t/mysqlslap.test:
  A test added as part of the fix for Bug #59107
2012-04-09 14:51:46 +05:30
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
4f435bddfd 5.3 merge 2012-01-13 15:50:02 +01:00
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
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
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
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
Vladislav Vaintroub
06490b208a fix warnings 2011-06-13 02:38:16 +02:00
Vladislav Vaintroub
4171483b53 Backport Fix for Bug#24509 - 2048 file descriptor limit on windows needs increasing.
The patch replaces the use of the POSIX I/O interfaces in mysys on Windows with 
the Win32 API calls (CreateFile, WriteFile, etc). The Windows HANDLE for the open
 file is stored in the my_file_info struct, along with a flag for append mode 
(because the Windows API does not support opening files in append mode in all cases)
The default max open files has been increased to 16384 and can be increased further
by setting --max-open-files=<value> during the server start.

Noteworthy benefit of this patch is that it removes limits from the table_cache size - 
allowing for more simultaneus users
2011-06-12 15:52:07 +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
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
Nirbhay Choubey
cb0e49c000 Bug#11765157 - 58090: mysqlslap drops schema specified in
create_schema if auto-generate-sql also set.

mysqlslap uses a schema to run its tests on and later
drops it if auto-generate-sql is used. This can be a
problem, if the schema is an already existing one.

If create-schema is used with auto-generate-sql option,
mysqlslap while performing the cleanup, drops the specified
database.

Fixed by introducing an option --no-drop, which, if used,
will prevent the dropping of schema at the end of the test.


client/client_priv.h:
  Bug#11765157 - 58090: mysqlslap drops schema specified in
                 create_schema if auto-generate-sql also set.
  
  Added an option.
client/mysqlslap.c:
  Bug#11765157 - 58090: mysqlslap drops schema specified in
                 create_schema if auto-generate-sql also set.
  
  Introduced an option 'no-drop' to forbid the removal of schema
  even if 'create' or 'auto-generate-sql' options are used.
mysql-test/r/mysqlslap.result:
  Added a testcase for Bug#11765157.
mysql-test/t/mysqlslap.test:
  Added a testcase for Bug#11765157.
2011-04-08 12:22:44 +05:30
Nirbhay Choubey
01f0090c6a Merging patch for bug#11765157 from mysql-5.1. 2011-04-08 12:25:59 +05:30
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
Nirbhay Choubey
db36f63984 Bug#59109 : mysqlslap crashes on mysql_fetch_row after ignoring
null from mysql_store_result.

mysqlslap segfaults at a point when it tries to fetch rows from
the result set.

Under some circumstances, mysql_store_result can return 'NULL',
even after query execution (mysql_query) succeeds, and eventually
a segfault might occur if same unchecked return value is passed
to mysql_fetch_row.

Fixed by adding a check on mysql_store_result's return value.


client/mysqlslap.c:
  Bug#59109 : mysqlslap crashes on mysql_fetch_row after ignoring
              null from mysql_store_result.
  
  Added a check on mysql_store_result's return value. A 'NULL' return
  value here shows an erroneous situation as mysql_field_count has already
  reported a non-zero value.
2011-01-13 15:56:42 +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
24eba429dd Merging from mysql-5.1. 2011-01-13 15:59:13 +05:30
Sergei Golubchik
65ca700def merge.
checkpoint.
does not compile.
2010-11-25 18:17:28 +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
Michael Widenius
0d3039d49d This patch fixes LP#613408 Memory corruption with (M)aria storage engine and virtual columns in MariaDB 5.2
Fixed compiler warnings
Disabled some tests that doesn't work on windows (uses shell tools or strange characters)



client/mysqlshow.c:
  Fixed compiler warnings
client/mysqlslap.c:
  Fixed compiler warnings
mysql-test/mysql-test-run.pl:
  Use an error file instead of /dev/null
  (Fixes problem on Windows and the output may be usefull)
mysql-test/suite/maria/r/maria.result:
  Test case for bug LP#613408 (not complete)
mysql-test/suite/maria/t/maria.test:
  Test case for bug LP#613408 (not complete)
mysql-test/suite/percona/percona_log_slow_slave_statements-and-use_global_long_query_time.test:
  This test doesn't work one windows (needs shell tools)
mysql-test/suite/percona/percona_log_slow_slave_statements.test:
  This test doesn't work one windows (needs shell tools)
mysql-test/suite/percona/percona_slow_query_log-control_global_slow.test:
  This test doesn't work one windows (needs shell tools)
mysql-test/suite/percona/percona_slow_query_log-log_slow_filter.test:
  This test doesn't work one windows (needs shell tools)
mysql-test/suite/percona/percona_slow_query_log-log_slow_verbosity.test:
  This test doesn't work one windows (needs shell tools)
mysql-test/suite/percona/percona_slow_query_log-long_query_time.test:
  This test doesn't work one windows (needs shell tools)
mysql-test/suite/percona/percona_slow_query_log-microseconds_in_slow_query_log.test:
  This test doesn't work one windows (needs shell tools)
mysql-test/suite/percona/percona_slow_query_log-min_examined_row_limit.test:
  This test doesn't work one windows (needs shell tools)
mysql-test/suite/percona/percona_slow_query_log-use_global_long_query_time.test:
  This test doesn't work one windows (needs shell tools)
mysql-test/t/ctype_filesystem.test:
  This test doesn't work one windows (problem with character sets)
mysql-test/t/events_time_zone.test:
  Use longer times to get predictable tests
mysql-test/t/show_check-master.opt:
  set long query time to get more predictable tests
storage/maria/ma_check.c:
  Restore info->s->lock_key_trees after repair.
  Disable logging to temp tables for all repair cases (safety fix)
storage/maria/ma_state.c:
  Ensurethat info->state_start doesn't point to freed memory. (Could happen after running an internal repair to fast create indexes)
storage/maria/trnman.c:
  Added longer comment
2010-08-07 17:42:30 +03:00
Michael Widenius
50b43cf805 Fix for LP#614265 Crash in _ma_unpin_all_pages / _ma_search on DELETE with Aria search engine
Fixed compiler warnings

client/mysqlslap.c:
  Fixed compiler warnings
mysql-test/suite/maria/r/maria.result:
  Test case for LP#614265
mysql-test/suite/maria/t/maria.test:
  Test case for LP#614265
mysql-test/suite/pbxt/t/skip_name_resolve-master.opt:
  Ensure that we get restart before test (as test uses show processlist)
sql/handler.cc:
  Added cloned marker if clone was called (for safety checks & debugging)
sql/handler.h:
  Added cloned marker if clone was called (for safety checks & debugging)
storage/maria/ha_maria.cc:
  In clone call, set file->trn if cloned file had this set. This is needed as maria_create_trn_for_mysql() and thus file->trn is never set for cloned table.
  Ensure that file->trn is properly reset after calls to repair/check/zerofill.
  Increment locked table count if file->trn is set (as we decrement this in the unlock call)
tests/mysql_client_test.c:
  Fixed compiler warnings
2010-08-06 15:39:37 +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
07e7b4d6fe 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
db2fe44c84 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
unknown
b1e00b6be8 Merge MySQL 5.1.46 into MariaDB.
Still two test failures to be solved: main.myisam and main.subselect.
2010-04-28 14:52:24 +02: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