Commit graph

335 commits

Author SHA1 Message Date
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
fb697972b3 Merge of patch for Bug#13928675 from mysql-5.1. 2012-08-07 19:07:13 +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
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
Georgi Kodinov
31a9208bd0 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
baec942a3f Merged from 5.1 to 5.5 2012-04-09 16:43:54 +05:30
Venkata Sidagam
17743904ba 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
2012-04-09 16:42:41 +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
Venkata Sidagam
3ee454f9b6 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
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
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
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
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
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
b563350e7a 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.
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
Nirbhay Choubey
4cf9d978ec 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
cbeb4e7630 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.
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
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
e17c9279ee 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
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
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
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
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
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
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
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
Michael Widenius
e9bce6c9d4 Patch set contributed by Alex Budovski (MCA)
Fix for Bug#31173: mysqlslap.exe crashes if called without any parameters

.bzrignore:
  Fixed .bzrignore rules. Many were simply not ignoring what they were meant to.
client/mysqlslap.c:
  Fixed bug for Bug#31173: mysqlslap.exe crashes if called without any parameters
  The original patch could cause memory leaks and odd problems depending on how connection was made.
  This code ensures that all mysql_options() are set for each mysql_real_connect().
  (This patch by Monty)
mysys/my_thr_init.c:
  Fixed multiply-initialized critical section on Windows, due to code incorrectly
  checking the wrong field in an attempt to prevent multiple-initialization.
sql-common/client.c:
  Don't use shared memory if it's not set (for example after failed mysql_real_connect).
  Ensure that mysql_close() resets all resources so that it's safe to call it twice.
  (Patch by monty, related to Bug#31173: mysqlslap.exe crashes if called without any parameters)
sql/CMakeLists.txt:
   Added page fault counters for SHOW PROFILE on Windows.
sql/mysqld.cc:
  Fixed attempt to set a NULL event. The code now only sets the event if appropriate (i.e. shared memory is being used)
sql/sql_profile.cc:
  Added page fault counters for SHOW PROFILE on Windows.
sql/sql_profile.h:
  Added page fault counters for SHOW PROFILE on Windows.
sql/udf_example.def:
  Some cleanup functions were not exported from udf_example.dll, causing them to
  never be executed, and as a result multiple-initialization of kernel objects
  occurred and resources were not being freed correctly.
storage/maria/ma_close.c:
  Condition variable share->key_del_cond was never being destroyed, while its
  containing heap block was being freed in maria_close(), leaking kernel
  resources.
2010-01-29 20:42:22 +02: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
Michael Widenius
65ca2521f1 Merge 2009-12-03 13:34:11 +02:00
Michael Widenius
82e910d146 Merge with maria-5.1-federatedx; A patch to fix bugs in federatedx and enable federated_server.test
Author: Antony Curtis
License: BSD


client/mysql.cc:
  Reset variable if CTRL-C was used to kill running query, so that the user can do it again
client/mysqlcheck.c:
  Indentation fix
client/mysqlslap.c:
  Indentation fixes
client/mysqltest.cc:
  Make testing of commands safer by also testing length
  Removed not used variable
  Fixed indentation to be as it was before last patch
mysql-test/lib/mtr_report.pm:
  Fixed typo
mysql-test/mysql-test-run.pl:
  Merge (Align code with default mysql-tes-run.pl)
mysql-test/suite/federated/disabled.def:
  Removed test case
storage/federatedx/ha_federatedx.cc:
  Removed my changes and applied Antony's instead
2009-12-03 13:19:05 +02:00
unknown
db260b19e3 Merge MySQL 5.1.41 into MariaDB trunk, including a number of after-merge fixes.
Also merge charset patch.
2009-11-30 22:37:27 +01: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
Alexey Botchkov
6c832ee4bf merging. 2009-11-17 15:27:40 +04:00
Alexey Botchkov
12043816fa merging. 2009-11-17 15:27:40 +04:00
unknown
a962160eec Merge with MySQL 5.1, with following additions:
- Moved some code from innodb_plugin to xtradb, to ensure that all tests runs
- Did changes in pbxt and maria storage engines becasue of changes in thd->query
- Reverted wrong code in sql_table.cc for how ROW_FORMAT is used.

This is a re-commit of Monty's merge to eliminate an extra commit from
MySQL-5.1.42 that was accidentally included in the merge.

This is a merge of the MySQL 5.1.41 clone-off (clone-5.1.41-build). In
case there are any extra changes done before final MySQL 5.1.41
release, these will need to be merged later before MariaDB 5.1.41
release.
2009-11-16 21:49:51 +01:00
Hakan Kuecuekyilmaz
4792703dc5 Fixed typos of --engine help text. 2009-11-11 23:13:07 +01:00
Michael Widenius
edd792fe12 Merge with MySQL 5.1, with following additions:
- Moved some code from innodb_plugin to xtradb, to ensure that all tests runs
- Did changes in pbxt and maria storage engines becasue of changes in thd->query
- Reverted wrong code in sql_table.cc for how ROW_FORMAT is used.

Todo before joining with main 5.1 tree:
- Join test fails (Igor to investigate)
- mysql-test-run shows warnings from tests; Some suppression rule is not working (Kristian to investiage)
- Run through all buildbots



sql/sql_table.cc:
  Reverted code for ROW_FORMAT is used. We must set the HA_CREATE_USED_ROW_FORMAT flag in alter table
  to signal the handler that it should not change row_type in update_create_info() (as happens for SHOW CREATE).
storage/maria/ha_maria.cc:
  Update for change in defintion of thd->query
storage/myisam/mi_check.c:
  Simplify code
storage/pbxt/src/discover_xt.cc:
  Update for change in defintion of thd->query
storage/xtradb/dict/dict0dict.c:
  Update for change in defintion of thd->query
storage/xtradb/handler/ha_innodb.cc:
  Copy some critical changes from innodb_plugin to get tests to pass
storage/xtradb/handler/ha_innodb.h:
  Copy some critical changes from innodb_plugin to get tests to pass
storage/xtradb/handler/handler0alter.cc:
  Copy some critical changes from innodb_plugin to get tests to pass
2009-11-11 13:17:49 +02:00
Michael Widenius
5bddbc44c6 Fixed compiler warning message
- Added checking of return value for system(), freopen(), fgets() and chown()
- Ensure that calls that require a format strings gets a format string
- Other trivial things
Updated test suite results (especially for pbxt and embedded server)
Removed warning for "Invalid (old?) table or database name 'mysqld.1'" from pbxt tests
Speed up some pbxt tests by inserting begin ; commit; around "while loops with inserts"
Added mysqld startup option '--debug-flush'
Create maria_recovery.trace in data directory instead of current directory

client/mysql.cc:
  Check return value from system()
client/mysql_upgrade.c:
  Check return value from fgets()
client/mysqladmin.cc:
  Check return value from fgets()
client/mysqlslap.c:
  Check return value from system() (but ignore it, as it's not critical)
extra/yassl/src/crypto_wrapper.cpp:
  Check return value from fgets() (but ignore it, as it's internal file)
extra/yassl/taocrypt/src/aes.cpp:
  Added extra {} to remove compiler warning
extra/yassl/taocrypt/src/blowfish.cpp:
  Added extra {} to remove compiler warning
extra/yassl/taocrypt/src/misc.cpp:
  Ifdef not used code
include/mysys_err.h:
  Added error message for failing chown()
mysql-test/mysql-test-run.pl:
  Don't give warning for skipping ndbcluster (never enabled in MariaDB)
mysql-test/suite/funcs_1/r/is_columns_is_embedded.result:
  Update with new information schema information
mysql-test/suite/funcs_1/r/is_tables_is_embedded.result:
  New test
mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result:
  Update test results (has not been tested for a long time)
mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result:
  Update test results (has not been tested for a long time)
mysql-test/suite/funcs_1/t/is_tables_is.test:
  Don't run with embedded server (as results differ)
  I added a new test for embedded server
mysql-test/suite/funcs_1/t/is_tables_is_embedded.test:
  New test
mysql-test/suite/pbxt/my.cnf:
  Allow one to run pbxt tests without having to specify --mysqld=--default-storage-engine=pbxt
mysql-test/suite/pbxt/t/count_distinct3.test:
  Speed up test by inserting begin; ... commit;
mysql-test/suite/pbxt/t/subselect.test:
  Speed up test by inserting begin; ... commit;
mysys/errors.c:
  Added error message for failing chown()
mysys/my_copy.c:
  Added error message for failing chown()
mysys/my_redel.c:
  Added error message for failing chown()
mysys/safemalloc.c:
  Added cast to get rid of compiler warning
sql/ha_partition.cc:
  Fixed wrong argument to sql_print_error() (it requires a format string)
sql/log.cc:
  Test return value of freopen()
sql/mysqld.cc:
  Test return value of freopen()
  Added startup option '--debug-flush' to be used when one gets a core dump (easy to explain to people on IRC)
sql/rpl_rli.cc:
  Fixed wrong argument to sql_print_error() (it requires a format string)
sql/set_var.cc:
  Added {} to get rid of compiler warnings
sql/slave.cc:
  Fixed wrong argument to mi->report() and sql_print...() (they require a format string)
sql/sql_cache.cc:
  Fixed wrong argument to sql_printinformation() (it requires a format string)
sql/sql_parse.cc:
  Test return value of fgets()
sql/sql_plugin.cc:
  Fixed wrong argument to sql_print_error() (it requires a format string)
sql/sql_select.cc:
  Use unique table name for internal temp tables instead of full path
  (Simple speed & space optimization)
sql/udf_example.c:
  Removed compiler warning about not used variable
storage/maria/ha_maria.cc:
  Fixed wrong argument to sql_print_error() and ma_check_print_error() (they require a format string)
storage/maria/ma_recovery.c:
  Create maria_recovery.trace in data directory instead of current directory
storage/maria/unittest/ma_test_loghandler-t.c:
  Fixed wrong argument to ok();  Requires a format string
storage/pbxt/src/strutil_xt.cc:
  Detect temporary tables by checking if that path for the table is in the mysql data directory.
  The database for temporary tables is after this patch, from PBXT point of view, ""
  This is needed to stop PBXT from calling filename_to_tablename() with the base directory as an argument, which caused
  ERROR: Invalid (old?) table or database name 'mysqld.1'" in the log when running the test suite.
tests/mysql_client_test.c:
  Fixed compiler warnings
unittest/mysys/base64-t.c:
  Fixed wrong argument to diag() (it requires a format string)
  Added a comment that the current 'print' of differing buffers doesn't print the right thing,
  but didn't fix this as it's not important (unless we find a bug in the real code)
2009-10-26 13:35:42 +02:00
Alexander Nozdrin
c30d924dd5 Manual merge from mysql-trunk-merge. 2009-10-14 12:25:39 +04:00
Alexander Nozdrin
ca08f10ccd Manual merge from mysql-trunk-merge. 2009-10-14 12:25:39 +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
Georgi Kodinov
370acc8b56 automerge 2009-10-04 12:15:05 +03:00
Georgi Kodinov
db35fb7961 automerge 2009-10-04 12:15:05 +03:00
Joerg Bruehe
3fddd10268 Merge "trunk-build" up into "next-mr". 2009-09-30 22:31:22 +02:00
Joerg Bruehe
de0285a2e5 Merge "trunk-build" up into "next-mr". 2009-09-30 22:31:22 +02:00
unknown
44718ad445 Merge MySQL-5.1.38 and XtraDB-7 into MariaDB.
Merge Percona microsec_process patch.
Includes lots of after-merge fixes, Windows fixes, and other misc. small fixes.
2009-09-25 10:56:53 +02:00
Staale Smedseng
6a89842e36 Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2

Cleaning up warnings not present in 5.0.
2009-09-23 15:21:29 +02:00
Staale Smedseng
8b9843408d Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2

Cleaning up warnings not present in 5.0.
2009-09-23 15:21:29 +02:00
Hakan Kuecuekyilmaz
1ee2d81734 Fix for
mysqlslap: setting --engine does not get replicated
    http://bugs.mysql.com/bug.php?id=46967

and
    mysqlslap: specifying --engine and --create does not
    work with --engine=<storage_engine>:<option>
    https://bugs.launchpad.net/maria/+bug/429773

Problems were that an --engine=<storage_engine> was translated
to a "set storage_engine = <storage_engine>", wich is _not_
replicated. A --engine=<storage_engine>:<option> was not always
properly parsed and in some cases crashed.

Fixed by eliminating "set storage_engine = ..." and adding
proper DDL generation. Initialized an unitialized buffer to
prevent crashes and fixed to use proper pointer for in
case of --engine=<storage_engine>:<option> being the last
element in list of --engines.

Also cleaned up code for better readability.

Q: Should MySQL's replication actually replicate a
   "set storage_engine = ..." command or not?
A: No it should not. It is documented here:
   http://dev.mysql.com/doc/refman/5.1/en/replication-features-variables.html
   ...
   "The storage_engine system variable is not replicated, which is a
   good thing for replication between different storage engines." ...

Before the patch, mysqlslap was behaving this way:

+-------------------------------+--------+-------------+
|                               | single | replication |
+-------------------------------+--------+-------------+
| Before patch                                         | 
+-------------------------------+--------+-------------+
| --engine[1]                                          |
+-----+-------------------------+--------+-------------+
| 1.1 | eng1                    |  OK    |   Not OK    |
| 1.2 | eng1,eng2               |  OK    |   Not OK    |
| 1.3 | eng1,eng2,eng3          |  OK    |   Not OK    |
| 1.4 | memory:option           |  OK    |   Not OK    |
| 1.5 | memory:option,eng1      |  OK    |   Not OK    |
| 1.6 | eng1,memory:option      | Not OK |   Not OK    |
| 1.7 | memory:option,eng1,eng2 | Crash  |   Not OK    |
| 1.8 | eng1,memory:option,eng2 |  OK    |   Not OK    |
| 1.9 | eng1,eng2,memory:option | Not OK |   Not OK    |
+-----+-------------------------+--------+-------------+
+-------------------------------+--------+-------------+
| --create --engine[2]                                 |
+-----+-------------------------+--------+-------------+
| 2.1 | eng1                    |  OK    |   Not OK    |
| 2.2 | eng1,eng2               |  OK    |   Not OK    |
| 2.3 | eng1,eng2,eng3          |  OK    |   Not OK    |
| 2.4 | memory:option           | Not OK |   Not OK    |
| 2.5 | memory:option,eng1      | Not OK |   Not OK    |
| 2.6 | eng1,memory:option      | Not OK |   Not OK    |
| 2.7 | memory:option,eng1,eng2 | Crash  |   Not OK    |
| 2.8 | eng1,memory:option,eng2 | Not OK |   Not OK    |
| 2.9 | eng1,eng2,memory:option | Not OK |   Not OK    |
+-----+-------------------------+--------+-------------+

After my final patch, mysqlslap now runs like this:

+-------------------------------+--------+-------------+
|                               | single | replication |
+-------------------------------+--------+-------------+
| After third patch                                    | 
+-------------------------------+--------+-------------+
| --engine[1]                                          |
+-----+-------------------------+--------+-------------+
| 1.1 | eng1                    |  OK    |  OK         |
| 1.2 | eng1,eng2               |  OK    |  OK         |
| 1.3 | eng1,eng2,eng3          |  OK    |  OK         |
| 1.4 | memory:option           |  OK    |  OK         |
| 1.5 | memory:option,eng1      |  OK    |  OK         |
| 1.6 | eng1,memory:option      |  OK    |  OK         |
| 1.7 | memory:option,eng1,eng2 |  OK    |  OK         |
| 1.8 | eng1,memory:option,eng2 |  OK    |  OK         |
| 1.9 | eng1,eng2,memory:option |  OK    |  OK         |
+-----+-------------------------+--------+-------------+
+-------------------------------+--------+-------------+
| --create --engine[2]                                 |
+-----+-------------------------+--------+-------------+
| 2.1 | eng1                    |  OK    |  OK         |
| 2.2 | eng1,eng2               |  OK    |  OK         |
| 2.3 | eng1,eng2,eng3          |  OK    |  OK         |
| 2.4 | memory:option           |  OK    |  OK         |
| 2.5 | memory:option,eng1      |  OK    |  OK         |
| 2.6 | eng1,memory:option      |  OK    |  OK         |
| 2.7 | memory:option,eng1,eng2 |  OK    |  OK         |
| 2.8 | eng1,memory:option,eng2 |  OK    |  OK         |
| 2.9 | eng1,eng2,memory:option |  OK    |  OK         |
+-----+-------------------------+--------+-------------+
2009-09-18 05:30:54 +02:00
Joerg Bruehe
db89051656 Fix bug#46980
Option "--without-server" still not working in 5.1

The general approach is to make sure that source files
which require thread support are only compiled if the build
really needs thread support,
which means when the server is built or a thread-safe client
library.

This required several changes:
- Make sure the subdirectories "storage/" and "plugin/" are
  only processed if the server is built, not ifclient-only.
- Make the compilation of some modules which inherently
  require threading depend on thread supportin the build.
- Separate the handling of threading in "configure.in" from
  that of server issues, threading is also needed in a
  non-server build of a thread-safe client library.

Also, "libdbug" must get built even in a client-only build,
so "dbug/" must be in the list of client directories.

In addition, calls to thread functions in source files which
can be built without thread support must use the wrapper
functions which handle the non-threaded build.
So the modules "client/mysqlimport.c" and "client/mysqlslap.c"
must call "my_thread_end()" only via "mysql_thread_end()".


Makefile.am:
  The directories "storage/" and "plugin/" contain files
  which are needed for the server only, so their contents
  is to be built only if a server is built.
  
  They must not be named unconditionally, because building
  their contents will fail unless threads are enabled.
  
  These directories are now listed in the "configure"
  variable "sql_server_dirs" which becomes part of
  "sql_union_dirs" if the server is to be built.
client/mysqlimport.c:
  Use the wrapper function "mysql_thread_end()" which
  correctly handles the case of a non-threaded build.
client/mysqlslap.c:
  Use the wrapper function "mysql_thread_end()" which
  correctly handles the case of a non-threaded build.
configure.in:
  Various changes to support builds "--without-server":
  
  1) For the unit tests, we need "libdbug".
  
  2) Separate the treatment of the server from that of the
     thread-safe client library.
  
  3) Introduce an "automake conditional" "NEED_THREAD"
     which can be checked in some "Makefile.am".
  
  4) Include "storage/" and "plugin/" in the list of
     "sql_server_dirs" so that they are handled in the
     top "Makefile.am" only if the server is to be built
     (see the change in that file).
mysys/Makefile.am:
  The code of "mf_keycache.c" in 5.1 is no longer safe
  to be built without thread support.
  (In 5.0, this was possible.)
  
  Rather than fix these issues, which is tedious and risky,
  avoid the need to ever build it without thread support:
  It is needed in the server only, which needs thread support.
  
  The only case where we build a "libmysys" without thread
  support is for a non-threaded client, where "mf_keycache"
  is not neded.
  So its inclusion in the list of source files can depend
  on the new conditional "NEED_THREAD".
unittest/mysys/Makefile.am:
  Test program "my_atomic-t" is to verify the correct handling
  of threads only, it cannot be built without thread support
  and is not needed in such cases either.
  
  Let its build depend on the new conditional "NEED_THREAD".
2009-09-17 18:34:24 +02:00
Joerg Bruehe
67bcf54df6 Fix bug#46980
Option "--without-server" still not working in 5.1

The general approach is to make sure that source files
which require thread support are only compiled if the build
really needs thread support,
which means when the server is built or a thread-safe client
library.

This required several changes:
- Make sure the subdirectories "storage/" and "plugin/" are
  only processed if the server is built, not ifclient-only.
- Make the compilation of some modules which inherently
  require threading depend on thread supportin the build.
- Separate the handling of threading in "configure.in" from
  that of server issues, threading is also needed in a
  non-server build of a thread-safe client library.

Also, "libdbug" must get built even in a client-only build,
so "dbug/" must be in the list of client directories.

In addition, calls to thread functions in source files which
can be built without thread support must use the wrapper
functions which handle the non-threaded build.
So the modules "client/mysqlimport.c" and "client/mysqlslap.c"
must call "my_thread_end()" only via "mysql_thread_end()".
2009-09-17 18:34:24 +02:00
Vladislav Vaintroub
716099e07c This is the downport of
Bug#24509 - 2048 file descriptor limit on windows needs increasing, also 
WL#3049 - improved Windows I/O
                        
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.
                              
Another major change in this patch that almost all Windows specific file IO code
has been moved to a new file my_winfile.c, greatly reducing the amount of code 
in #ifdef blocks within mysys, thus improving readability.
                               
                                    
Minor enhancements:
- my_(f)stat() is changed to use __stati64 structure with  64 file size
and timestamps. It will return correct file size now (C runtime implementation
used to report outdated information)
- my_lock on Windows is prepared to handle additional timeout parameter
- after review : changed __WIN__ to _WIN32 in the new and changed code.

client/mysqlbinlog.cc:
  fileno -> my_fileno
client/readline.cc:
  fileno -> my_fileno
include/config-win.h:
  Increase OS_FILE_LIMIT for Windows.
  Remove O_SHARE - Windows does not support it. Its definition conflicts with
  O_SHORT_LIVED, that has different semantics.
include/my_dir.h:
  Use stat64 for stat() family of functions on Windows, because of 64 bit file size.
include/my_global.h:
  Increased default value for open file limit to 16K
include/my_sys.h:
  - my_file_info got new structure members - file handle and open flags
  - 2 new Windows-only mysys functions : my_get_osfhandle and my_osmaperr,
    modelled after Windows C runtime functions _get_osfhandle and _dosmaperr
libmysql/CMakeLists.txt:
  new files my_winfile.c and my_winerr.c
mysql-test/suite/large_tests/r/lock_tables_big.result:
  test for more then 2048 open file descriptors on Windows
mysql-test/suite/large_tests/t/lock_tables_big.test:
  test for more then 2048 open file descriptors on Windows
mysys/CMakeLists.txt:
  new files my_winfile.c and my_winerr.c
mysys/Makefile.am:
  new files my_winfile.c and my_winerr.c
mysys/default_modify.c:
  fileno -> my_fileno
mysys/my_chsize.c:
  implementation of chsize on Windows now moved to my_winfile.c
mysys/my_create.c:
  - my_sopen->my_win_open
  - close open file before removing (won't generally work on Windows otherwise)
mysys/my_file.c:
  On Windows, files returned by my_open will not start with 0, but 2048 
  (making it simple to detect incompatible mix of CRT and mysys  io functions)
mysys/my_fopen.c:
  fileno->my_win_fileno , fclose->my_win_fclose, fdopen->my_win_fdopen
  Check for legal filename is done by my_win_[f]open functions
mysys/my_fstream.c:
  fileno->my_fileno
mysys/my_lib.c:
  Windows stat() functions are moved to my_winfile.c
mysys/my_lock.c:
  Move Windows code under #ifdef to a separate function win_lock().
  Add a parameter for lock wait timeout
mysys/my_mmap.c:
   _get_osfhandle->my_get_osfhandle
mysys/my_open.c:
  my_sopen->my_win_open (simpler interface)
mysys/my_pread.c:
  moved most windows specific code to my_win_file.c
  Use my_win_pread
mysys/my_quick.c:
  Use my_win_read/my_win_write
mysys/my_read.c:
  Moved most of windows specific code to my_win_file.c
  Use my_win_read()
mysys/my_seek.c:
  On Windows, use my_win_lseek() in my_seek()/my_tell()
  Removed dead code (synchronization of lseeks)
  Improved DBUG tracing (file position is ulonglong, not ulong)
mysys/my_static.c:
  Removed array initialization. my_file_info_default is global variable
  thus it is initialized with all zeros anyway
mysys/my_sync.c:
  _commit->my_win_fsync
mysys/my_winerr.c:
  New file my_winerr.c
  Exports my_osmaperr modelled after undocumented C runtime
  function _dosmaperr(). The problem with _dosmaperr() used previously is that 
  1) it is nowhere documented and thus code relying on it is not guaranteed to work
     in subsequent releases on the C runtime
  2) it is present only in static C runtime (mysqld does not link if compiled with
    /MD)
mysys/my_winfile.c:
  New file my_winfile.c
  Implements ANSI/Posix file IO routines, when possible using native Windows IO, without
  C runtime (C runtime dropped because of the 2048 file descriptor limit).
mysys/my_write.c:
  write->my_win_write
mysys/mysys_priv.h:
  Declaration of Windows Posix functions (private to mysys, shall not be visible
  outside)
storage/innobase/handler/ha_innodb.cc:
  mysys native Windows IO : correct innodb tmp file handling
  mysql_tmpfile does not return valid CRT file descriptor, thus
  it is not possible to dup() it. Instead, the native file handle has 
  to be duplicated and then converted to CRT descriptor.
storage/myisam/mi_locking.c:
  _commit->my_sync
2009-09-11 22:26:35 +02:00
Vladislav Vaintroub
4e92af9f43 This is the downport of
Bug#24509 - 2048 file descriptor limit on windows needs increasing, also 
WL#3049 - improved Windows I/O
                        
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.
                              
Another major change in this patch that almost all Windows specific file IO code
has been moved to a new file my_winfile.c, greatly reducing the amount of code 
in #ifdef blocks within mysys, thus improving readability.
                               
                                    
Minor enhancements:
- my_(f)stat() is changed to use __stati64 structure with  64 file size
and timestamps. It will return correct file size now (C runtime implementation
used to report outdated information)
- my_lock on Windows is prepared to handle additional timeout parameter
- after review : changed __WIN__ to _WIN32 in the new and changed code.
2009-09-11 22:26:35 +02:00