Commit graph

2523 commits

Author SHA1 Message Date
Davi Arnaut
b928a3295c Merge from mysql-5.1-bugteam. 2009-08-11 11:29:07 -03:00
Sergey Vojtovich
24e418df69 Merge mysql-5.1-innodb_plugin to mysql-5.1. 2009-08-11 18:05:25 +05:00
Ignacio Galarza
466847a0b8 Auto-merge 2009-08-06 10:54:53 -04:00
Ignacio Galarza
a791f20089 Bug #27535 Installing Windows service with --defaults-file option - quotation marks issues
- Remove offensive quotes.
2009-08-06 10:24:28 -04:00
Ignacio Galarza
09877515f2 Bug#17270 - mysql client tool could not find ../share/charsets folder and fails.
- Define and pass compile time path variables as pre-processor definitions to 
  mimic the makefile build.
- Set new CMake version and policy requirements explicitly.
- Changed DATADIR to MYSQL_DATADIR to avoid conflicting definition in 
  Platform SDK header ObjIdl.h which also defines DATADIR.
2009-07-31 15:22:02 -04:00
Ignacio Galarza
008dd95f70 Auto-merge 2009-07-31 15:28:15 -04:00
Davi Arnaut
88780b03b9 Bug#43435: LOCK_open does not use MY_MUTEX_INIT_FAST
Initialize LOCK_open as a adapative mutex on platforms where the
PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP macro is available. The flag
indicates that a thread should spin (busy wait) for some time on a
locked adaptive mutex before blocking (sleeping). It's intended to
to alleviate performance problems due to LOCK_open being a highly
contended mutex.

sql/mysqld.cc:
  Initialize LOCK_open as a adapative mutex.
2009-07-30 17:52:42 -03:00
Davi Arnaut
c8e67f4a3f Manual merge. 2009-07-30 16:11:39 -03:00
Davi Arnaut
e265609834 Bug#46385: [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted t
The maximum value of the max_join_size variable is set by converting
a signed type (long int) with negative value (-1) to a wider unsigned
type (unsigned long long), which yields the largest possible value of
the wider unsigned type -- as per the language conversion rules. But,
depending on build options, the type of the max_join_size might be a
shorter type (ha_rows - unsigned long) which causes the warning to be
thrown once the large value is truncated to fit.

The solution is to ensure that the maximum value of the variable is
always set to the maximum value of integer type of max_join_size.

Furthermore, it would be interesting to always have a fixed type for
this variable, but this would incur in a change of behavior which is
not acceptable for a GA version. See Bug#35346.

sql/mysqld.cc:
  Set max value for type.
2009-07-27 20:31:48 -03:00
Konstantin Osipov
b4bf7dd31e Code review for Bug#43587 Putting event_scheduler=1 in init SQL file crashes
mysqld
2009-07-24 20:20:46 +04:00
Staale Smedseng
9c708fdf1e Merge from 5.0 2009-07-23 13:53:28 +02:00
Staale Smedseng
1e32574c65 Bug #45770 errors reading server SSL files are printed, but
not logged
        
Errors encountered during initialization of the SSL subsystem
are printed to stderr, rather than to the error log.
        
This patch adds a parameter to several SSL init functions to
report the error (if any) out to the caller. The function
init_ssl() in mysqld.cc is moved after the initialization of
the log subsystem, so that any error messages can be logged to
the error log. Printing of messages to stderr has been 
retained to get diagnostic output in a client context.


include/violite.h:
  Adding an enumeration for the various errors that can
  occur during initialization of the SSL module.
sql/mysqld.cc:
  Adding more logging of SSL init errors, and moving
  init_ssl() till after initialization of logging 
  subsystem.
vio/viosslfactories.c:
  Define error strings, provide an access method for these
  strings, and maintain an error parameter in several funcs
  to return the error (if any) to the caller.
2009-07-23 13:38:11 +02:00
Sergey Vojtovich
058cd62565 Merge 5.1-bugteam -> 5.1-innodb_plugin. 2009-07-14 15:06:04 +05:00
Georgi Kodinov
097c7b38c8 Bug #45287: phase 2 : 5.0 64 bit compilation warnings
Fixed various compilation warnings when compiling on a 
 64 bit windows.
2009-07-16 15:37:38 +03:00
Andrei Elkin
e2ac8c07bd Bug #38240 Crash in safe_mutex_lock () thr_mutex.c line 97 on rotate_relay_log
The reason for the crash was rotate_relay_log (mi=0x0) did not verify
the passed value of active_mi.  There are more cases where active_mi
is supposed to be non-zero e.g change_master(), stop_slave(), and it's
reasonable to protect from a similar crash all of them with common
fixes.
            
Fixed with spliting end_slave() in slave threads release and slave
data clean-up parts (a new close_active_mi()). The new function is
invoked at the very end of close_connections() so that all users of
active_mi are proven to have left.

sql/mysqld.cc:
  added the 2nd part (data) of the slave's clean up.
sql/slave.cc:
  end_slave() is split in two part to release the slave threads and the remained
  resources separately.
  The new close_active_mi() should be called after all possible users ofactive_mi
  has left, i.e at the very end of close_connections().
sql/slave.h:
  interface to the new end_active_mi() function is added.
2009-06-23 12:10:04 +03:00
Sergey Glukhov
9347649c16 Bug#44834 strxnmov is expected to behave as you'd expect
The problem: described in the bug report.
The fix:
--increase buffers where it's necessary
  (buffers which are used in stxnmov)
--decrease buffer lengths which are used


client/mysql.cc:
  --increase buffers where it's necessary
    (buffers which are used in stxnmov)
  --decrease buffer lengths which are used
    as argument for strxnmov function
sql/ha_ndbcluster.cc:
  --increase buffers where it's necessary
    (buffers which are used in stxnmov)
  --decrease buffer lengths which are used
    as argument for strxnmov function
sql/ha_ndbcluster_binlog.cc:
  --increase buffers where it's necessary
    (buffers which are used in stxnmov)
  --decrease buffer lengths which are used
    as argument for strxnmov function
sql/handler.cc:
  --increase buffers where it's necessary
    (buffers which are used in stxnmov)
  --decrease buffer lengths which are used
    as argument for strxnmov function
sql/log.cc:
  --increase buffers where it's necessary
    (buffers which are used in stxnmov)
  --decrease buffer lengths which are used
    as argument for strxnmov function
sql/mysqld.cc:
  removed unnecessary line
sql/parse_file.cc:
  --increase buffers where it's necessary
    (buffers which are used in stxnmov)
  --decrease buffer lengths which are used
    as argument for strxnmov function
sql/sql_acl.cc:
  --increase buffers where it's necessary
    (buffers which are used in stxnmov)
  --decrease buffer lengths which are used
    as argument for strxnmov function
sql/sql_base.cc:
  --increase buffers where it's necessary
    (buffers which are used in stxnmov)
  --decrease buffer lengths which are used
    as argument for strxnmov function
sql/sql_db.cc:
  --increase buffers where it's necessary
    (buffers which are used in stxnmov)
  --decrease buffer lengths which are used
    as argument for strxnmov function
sql/sql_delete.cc:
  --increase buffers where it's necessary
    (buffers which are used in stxnmov)
  --decrease buffer lengths which are used
    as argument for strxnmov function
sql/sql_partition.cc:
  --increase buffers where it's necessary
    (buffers which are used in stxnmov)
  --decrease buffer lengths which are used
    as argument for strxnmov function
sql/sql_rename.cc:
  --increase buffers where it's necessary
    (buffers which are used in stxnmov)
  --decrease buffer lengths which are used
    as argument for strxnmov function
sql/sql_show.cc:
  --increase buffers where it's necessary
    (buffers which are used in stxnmov)
  --decrease buffer lengths which are used
    as argument for strxnmov function
sql/sql_table.cc:
  --increase buffers where it's necessary
    (buffers which are used in stxnmov)
  --decrease buffer lengths which are used
    as argument for strxnmov function
sql/sql_view.cc:
  --increase buffers where it's necessary
    (buffers which are used in stxnmov)
  --decrease buffer lengths which are used
    as argument for strxnmov function
2009-06-19 13:24:43 +05:00
Vladislav Vaintroub
768bbae90e Backport WL#3653 to 5.1 to enable bundled innodb plugin.
Remove custom DLL loader code from innodb plugin code, use 
symbols exported from mysqld.


storage/innodb_plugin/handler/ha_innodb.cc:
  Remove a Win32 workaround for current_thd.
  The original  problem that innodb plugin used
  value of TLS variable across DLL boundaries is 
  solved in MySQL server (current_thd is a function
  not TLS variable now)
storage/innodb_plugin/handler/handler0alter.cc:
  Remove custom delay loader
storage/innodb_plugin/handler/handler0vars.h:
  Remove custom delay loader
storage/innodb_plugin/handler/i_s.cc:
  Remove custom delay loader
storage/innodb_plugin/handler/win_delay_loader.cc:
  Remove custom delay loader
storage/innodb_plugin/plug.in:
  Remove commented out MYSQL_PLUGIN_STATIC, 
  CMake would not parse that correctly
2009-06-10 10:59:49 +02:00
Davi Arnaut
01912b20bc Fix for a valgrind warning due to use of a uninitialized
variable. The problem was that THD::connect_utime could be
used without being initialized when the main thread is used
to handle connections (--thread-handling=no-threads).

sql/mysqld.cc:
  Set THD::start_utime even in no-threads handling mode.
sql/sql_class.cc:
  Initialize variable.
sql/sql_class.h:
  Rename connect_utime to prior_thr_create_utime as to
  better reflect it's use intention.
sql/sql_connect.cc:
  Check only if a thread was actually created.
2009-06-08 19:05:24 -03:00
Satya B
d93325626a Followup Fix for BUG#10206 - InnoDB: Transaction requiring Max_BinLog_Cache_size > 4GB
always rollsback.

There is failure on pushbuild machines which are using old compilers complaining about
ULLONG_MAX declaration. Changing this to ULONGLONG_MAX to solve the problem.

sql/mysqld.cc:
  Change ULLONG_MAX to ULONGLONG_MAX for the max_binlog_cache_size option
2009-06-02 18:07:47 +05:30
Satya B
1e37c919ef Fix for BUG#10206 - InnoDB: Transaction requiring Max_BinLog_Cache_size > 4GB
always rollsback.

The global variable max_binlog_cache_size cannot be set more than 4GB on
32 bit systems, limiting transactions of all storage engines to 4G of changes.

The problem is max_binlog_cache_size is declared as ulong which is 4 bytes
on 32 bit and 8 bytes on 64 bit machines.

Fixed by using ulonglong for max_binlog_cache_size which is 8bytes on 32 
and 64 bit machines.The range for max_binlog_cache_size on 32 bit and 64 bit
systems is 4096-18446744073709547520 bytes.

mysql-test/r/variables.result:
  Result file for BUG#10206
mysql-test/t/variables.test:
  Testcase for BUG#10206
sql/mysql_priv.h:
  change the extern declaration of max_binlog_cache_size to ulonglong
sql/mysqld.cc:
  change the declaration of max_binlog_cache_size to ulonglong and the option is fixed to extend the range of max_binlog_cache_size
sql/set_var.cc:
  change the variable declaration of max_binlog_cache_size to ulonglong
2009-05-15 16:33:08 +05:30
Chad MILLER
767501a9b1 Merge community up to enterprise, thus ending the community-server
adventure.
2009-05-06 09:06:32 -04:00
Chad MILLER
4822696ecb Pull 5.1 treatment of community features into 5.0. 2009-05-05 17:03:23 -04:00
Satya B
4610c13a24 Fix for BUG#43660- SHOW INDEXES/ANALYZE does NOT update cardinality
for indexes of InnoDB table

Fixes by replacing the PRNG that is used to pick random pages with a 
better one. 

Also adds a configuration option "innodb_use_legacy_cardinality_algorithm"
to enable the fix only when the option is set.

This patch is from http://bugs.mysql.com/file.php?id=11789
2009-04-24 16:33:50 +05:30
Chad MILLER
14f923c028 Merge 5.0.80 release and 5.0 community. Version left at 5.0.80. 2009-04-14 13:20:13 -04:00
Ignacio Galarza
675c3ce2bb auto-merge 2009-03-19 09:44:58 -04:00
Sergey Petrunia
3f0a54e35e Merge 2009-03-14 22:04:31 +03:00
Sergey Petrunia
6551e173f9 @@optimizer_switch backport and change from no_xxx to xx=on|off: post-review fixes
mysql-test/r/index_merge_myisam.result:
  More tests
mysql-test/t/index_merge_myisam.test:
  More tests
2009-03-14 21:58:23 +03:00
Sergey Glukhov
7b2d7bea5e compilation(embedded server) failure fix 2009-03-13 14:25:50 +04:00
Sergey Glukhov
a5dc03fb68 Bug#42610 Dynamic plugin broken in 5.1.31
--added ability to obtain plugin variables from my.cnf on INSTALL PLUGIN stage
--option 'ignore-builtin-innodb' disables all InnoDB builtin plugins
  (including I_S plugins)


sql/mysql_priv.h:
  --added ability to obtain plugin variables from my.cnf on INSTALL PLUGIN stage
sql/mysqld.cc:
  --added ability to obtain plugin variables from my.cnf on INSTALL PLUGIN stage
sql/sql_plugin.cc:
  --added ability to obtain plugin variables from my.cnf on INSTALL PLUGIN stage
  --option 'ignore-builtin-innodb' disables all InnoDB builtin plugins
    (including I_S plugins)
2009-03-13 12:51:25 +04:00
Sergey Petrunia
5d55f7c543 Merge 2009-03-11 23:52:22 +03:00
Davi Arnaut
402bc523b2 Bug#36540: CREATE EVENT and ALTER EVENT statements fail with large server_id
The problem is that creating a event could fail if the value of
the variable server_id didn't fit in the originator column of
the event system table. The cause is two-fold: it was possible
to set server_id to a value outside the documented range (from
0 to 2^32-1) and the originator column of the event table didn't
have enough room for values in this range.

The log tables (general_log and slow_log) also don't have a proper
column type to store the server_id and having a large server_id
value could prevent queries from being logged.

The solution is to ensure that all system tables that store the
server_id value have a proper column type (int unsigned) and that
the variable can't be set to a value that is not within the range.

mysql-test/r/events_bugs.result:
  Add test case result for Bug#36540
mysql-test/r/log_tables.result:
  Update column type.
mysql-test/r/system_mysql_db.result:
  Update column type.
mysql-test/r/variables.result:
  Add test case result for server_id value range.
mysql-test/suite/sys_vars/r/server_id_basic_64.result:
  Update test case results.
mysql-test/t/events_bugs.test:
  Add test case for Bug#36540
mysql-test/t/log_tables.test:
  Fix column type.
mysql-test/t/variables.test:
  Add test case for server_id value range.
scripts/mysql_system_tables.sql:
  Columns that store the server_id value must be of type INT UNSIGNED,
  fix event (originator), general_log and slow_log (server_id) tables
  in accordance.
scripts/mysql_system_tables_fix.sql:
  Columns that store the server_id value must be of type INT UNSIGNED,
  fix event (originator), general_log and slow_log (server_id) tables
  in accordance.
sql/mysqld.cc:
  Set min and max values for the server_id variable.
  Unfortunately we can't easily change server_id variable type
  from ulong to uint32 because of the sys_var classes.
2009-03-11 17:30:56 -03:00
Sergey Petrunia
fd35040890 Change optimizer_switch from no_xxx to xxx=on/xx=off.
mysql-test/r/index_merge_myisam.result:
  Testcases
mysql-test/t/index_merge_myisam.test:
  Testcases
sql/strfunc.cc:
  Change optimizer_switch from no_xxx to xxx=on/xx=off.
  - Add functions to parse the new syntax
2009-03-11 23:13:39 +03:00
Sergey Petrunia
989ee96b64 Post-merge fixes 2009-03-10 11:49:30 +03:00
Sergey Petrunia
632a33f8fc Merge 2009-03-10 00:53:38 +03:00
Narayanan V
31443a6f73 Bug#42790 Test 'main.innodb' fails from "InnoDB: Error: in ALTER TABLE"
The problem here seem to be that when mysql
is redirecting stderr to a file, stderr becomes 
buffered, whereas it is unbuffered by definition.

The solution is to unbuffer it by setting buffer
to null.

sql/log.cc:
  use setbuf(stderr, NULL) to set the buffer to null.
sql/mysqld.cc:
  use setbuf(stderr, NULL) to set the buffer to null.
2009-03-05 15:18:03 +05:30
Alexey Kopytov
cfa529fc3f Automerge. 2009-02-25 10:49:02 +02:00
Alexey Kopytov
318f23c712 Automerge. 2009-02-25 10:39:28 +02:00
Alexey Kopytov
0f6e7f1176 Fixed a build failure on Ubuntu 8.10 introduced by the patch
for bug #15936.

On some platforms fenv.h may #undef the min/max macros
defined in my_global.h.

Fixed by moving the #include directive for fenv.h from
mysqld.cc to my_global.h before definitions for min/max.

include/my_global.h:
  Moved #include <fenv.h> from mysqld.cc.
sql/mysqld.cc:
  Moved #include <fenv.h> to my_global.h.
2009-02-25 10:36:11 +02:00
Alexey Botchkov
a34bb2b8d8 merging. 2009-02-24 15:29:49 +04:00
Sergey Petrunia
cb6581d894 - Backport @@optimizer_switch support from 6.0
- Add support for setting it as a server commandline argument
- Add support for those switches:
  = no_index_merge
  = no_index_merge_union
  = no_index_merge_sort_union
  = no_index_merge_intersection

mysql-test/r/index_merge_myisam.result:
  Testcases for index_merge related @@optimizer_switch flags.
mysql-test/t/index_merge_myisam.test:
  Testcases for index_merge related @@optimizer_switch flags.
sql/set_var.cc:
  - Backport @@optimizer_switch support from 6.0
  - Add support for setting it as a server commandline argument
sql/sql_class.h:
  - Backport @@optimizer_switch support from 6.0
sql/sql_select.h:
  - Backport @@optimizer_switch support from 6.0
2009-02-23 19:16:48 +03:00
Alexey Kopytov
8ae8162403 Manual merge to 5.1. 2009-02-23 14:42:31 +02:00
Alexey Kopytov
0e62c9aa63 Fix for bug #15936: "round" differs on Windows to Unix
Both of our own implementations of rint(3) were inconsistent with the
most common behavior of rint() on those platforms that have it: round
to nearest, break ties by rounding to nearest even.

Fixed by leaving just one implementation of rint() in our source tree,
and changing its behavior to match the most common native
implementations on other platforms.

configure.in:
  Added checks for fenv.h and fesetround().
include/config-win.h:
  Removed the incorrect implementation of rint() for Windows.
include/my_global.h:
  Added an rint() implementation for platforms that do not have it.
mysql-test/r/func_math.result:
  Added a test case for bug #15936.
mysql-test/t/func_math.test:
  Added a test case for bug #15936.
sql/mysqld.cc:
  Explicitly set the FPU rounding mode with fesetround().
2009-02-23 14:28:26 +02:00
Davi Arnaut
d3a10ec6ef Bug#41077: Warning contains wrong future version
Substitute all references of MySQL version "5.2" to "6.0" in
deprecation warning messages.Deprecated constructs are being
removed in the 6.0 tree.
2009-02-16 08:38:15 -03:00
Chad MILLER
b8149f09d6 Merge from bug tree. 2009-02-11 23:44:32 -05:00
Ignacio Galarza
54fbbf9591 Bug#29125 Windows Server X64: so many compiler warnings
- Remove bothersome warning messages.  This change focuses on the warnings 
that are covered by the ignore file: support-files/compiler_warnings.supp.
- Strings are guaranteed to be max uint in length
2009-02-10 17:47:54 -05:00
Chad MILLER
d880862549 Bug#30261: "mysqld --help" no longer possible for root
The check for root-ness would signal an error.  Errors would make the
server exit before usage (help) information was printed.

Now, test for whether we want help regardless of whether we're going
to exit with an error.  If plugins are not initialized by the time we 
print usage information, inform the user that some parameters are 
missing.
2009-02-10 09:41:55 -05:00
Sergey Glukhov
4d0557a2e6 Bug#42610 Dynamic plugin broken in 5.1.31
added ignore-builtin-innodb option which disabled
initialization of builtin InnoDB plugin

mysql-test/r/innodb_ignore_builtin.result:
  test case
mysql-test/t/innodb_ignore_builtin-master.opt:
  test case
mysql-test/t/innodb_ignore_builtin.test:
  test case
sql/mysql_priv.h:
  added ignore-builtin-innodb option which disabled
  initialization of builtin InnoDB plugin
sql/mysqld.cc:
  added ignore-builtin-innodb option which disabled
  initialization of builtin InnoDB plugin
sql/set_var.cc:
  added ignore-builtin-innodb option which disabled
  initialization of builtin InnoDB plugin
sql/sql_plugin.cc:
  added ignore-builtin-innodb option which disabled
  initialization of builtin InnoDB plugin
2009-02-09 19:03:52 +04:00
Chad MILLER
d3629d7489 Merge from Tim's 5.0.76-release tree to make 5.0.77 . 2009-01-21 13:45:23 -05:00
Tatiana A. Nurnberg
95e0d3bd06 Bug#31177: Server variables can't be set to their current values
Bounds-checks and blocksize corrections were applied to user-input,
but constants in the server were trusted implicitly. If these values
did not actually meet the requirements, the user could not set change
a variable, then set it back to the (wonky) factory default or maximum
by explicitly specifying it (SET <var>=<value> vs SET <var>=DEFAULT).

Now checks also apply to the server's presets. Wonky values and maxima
get corrected at startup. Consequently all non-offsetted values the user
sees are valid, and users can set the variable to that exact value if
they so desire.

mysql-test/r/read_buffer_size_basic.result:
  test sets out of bounds value; we now throw a warning for this.
  This is a side-effect: before, the maximum was higher than the
  value we set here. The value was corrected to block-size, the
  maximum was not, hence the value was smaller than the maximum
  in this particular case. Now that we align the maxima at startup,
  the value in SET is larger than the (corrected) maximum, and we
  see a warning in this particular case. "This means we're doing it right."
mysql-test/r/read_rnd_buffer_size_basic.result:
  test sets out of bounds value; we now throw a warning for this.
  This is a side-effect: before, the maximum was higher than the
  value we set here. The value was corrected to block-size, the
  maximum was not, hence the value was smaller than the maximum
  in this particular case. Now that we align the maxima at startup,
  the value in SET is larger than the (corrected) maximum, and we
  see a warning in this particular case. "This means we're doing it right."
mysys/my_getopt.c:
  Do bounds-checking at start-up time so we'll catch and correct
  wonky default values and upper limits.
sql/mysqld.cc:
  If 0 is a legal value per the docs, not to mention the default, we shouldn't give 1 as
  the lower limit.
storage/innobase/handler/ha_innodb.cc:
  We are setting upper bounds here.
  ~0L gives -1. That is NOT what we want!
2009-01-12 06:32:49 +01:00
Vladislav Vaintroub
4bd55050ad fix misspelling 2009-01-07 13:44:32 +01:00