Commit graph

167 commits

Author SHA1 Message Date
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
Staale Smedseng
9ea5576662 Bug#46261 Plugins can be installed with --skip-grant-tables
Previously installed dynamic plugins are explicitly not loaded
on startup with --skip-grant-tables enabled. However, INSTALL
PLUGIN/UNINSTALL PLUGIN commands are allowed, and result in
inconsistent error messages (reporting duplicate plugin or
plugin does not exist).

This patch adds a check for --skip-grant-tables mode, and
returns error ER_OPTION_PREVENTS_STATEMENT to the user when
the above commands are attempted.
2010-04-22 15:52:00 +02:00
Staale Smedseng
6156581e07 Bug#51591 deadlock in the plugins+status+variables
Potential deadlock situation involving LOCK_plugin,
LOCK_global_system_variables and LOCK_status.
      
This patch backports the fix from next-mr, unlocking
LOCK_plugin before calling plugin->init() and
add_status_vars().
2010-04-16 15:02:23 +02:00
Davi Arnaut
91223c4d25 Bug#51770: UNINSTALL PLUGIN requires no privileges
The problem was that UNINSTALL PLUGIN wasn't performing privilege
checks before removing a plugin. Any user (including users without 
any kind of privileges) could uninstall any plugin.

The solution is to verify if the user has the DELETE privilege for
the mysql.plugin table before uninstalling a plugin.
2010-03-09 09:16:17 -03:00
Davi Arnaut
2887dd45b7 Bug#48983: Bad strmake calls (length one too long)
MySQL 5.1 specific fixes.
2009-12-18 17:14:09 -02:00
Tatiana A. Nurnberg
2f069a2c9b Bug#46586: When using the plugin interface the type "set" for options caused a crash.
"What do you mean, there's a bug? There isn't even code!"

There was some token code for plug-in variables of the SET type,
but clearly this never worked, or was subject to massive bit rot
since. Bug-fixes ... fail-safes ... tests -- fais au mieux, mon chou!
2009-10-27 06:16:02 -07: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
Kristofer Pettersson
4f6b8707dc Bug#46486 warnings produced when running mysql_install_db
Incremental patch part 2

Removing dead code and changing a note level message to a warning.
2009-09-04 12:32:21 +02:00
Kristofer Pettersson
cae61b1ce4 Bug#46486 warnings produced when running mysql_install_db
During start up some plugins are disabled by default. This caused an additional
warning level message to be emitted as a result of a previous bug patch. Since
there is risk of unnecessary confusion regarding the operation level of the server
the redundant information is removed.
2009-09-03 12:08:55 +02:00
Kristofer Pettersson
9c4eb2910b Bug#19027 MySQL 5.0 starts even with Fatal InnoDB errors
convert_dash_to_underscore was supplied with a character length containing
my byte too many which caused valgrind errors of invalid read.
2009-05-18 10:10:30 +02:00
Kristofer Pettersson
8b39abe245 Bug#19027 MySQL 5.0 starts even with Fatal InnoDB errors
It is not possible to prevent the server from starting if a mandatory
built-in plugin fails to start. This can in some cases lead to data
corruption when the old table name space suddenly is used by a different
storage engine.

A boolean command line option in the form of --foobar is automatically
created for every existing plugin "foobar". By changing this command line
option from a boolean to a tristate { OFF, ON, FORCE } it is possible to
specify the plugin loading policy for each plugin.

The behavior is specified as follows:
   OFF   = Disable the plugin and start the server
   ON    = Enable the plugin and start the server even if an error occurrs
           during plugin initialization.
   FORCE = Enable the plugin but don't start the server if an error occurrs
           during plugin initialization.
2009-05-14 14:03:33 +02:00
Alexey Kopytov
b00996e85f Manual merge of patch for bug #40552 into the team tree.
Replaced a call to load_defaults() in sql_plugin.cc with 
its thread-safe version.
2009-03-16 13:37:13 +03:00
Sergey Glukhov
390afdd16e 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)
2009-03-13 12:51:25 +04:00
Sergey Glukhov
53eed773e3 Bug#42610 Dynamic plugin broken in 5.1.31
added ignore-builtin-innodb option which disabled
initialization of builtin InnoDB plugin
2009-02-09 19:03:52 +04:00
Sergey Glukhov
fcba66f10c Bug#29263 disabled storage engines omitted in SHOW ENGINES
Static disabled plugins|engines and dynamic plugins which installed but disabled
are not visible in I_S PLUGINS|ENGINES tables because they are not stored into
global plugin array.
The fix: add such plugins|engines to plugin array with PLUGIN_IS_DISABLED status.
I_S.ENGINES 'Transactions', 'XA', 'Savepoints' fields have NULL value in this case.
2008-12-17 19:45:34 +04:00
Marc Alff
e76bb8c665 Bug#36768 (partition_info::check_partition_info() reports mal formed
warnings)

Before this fix, several places in the code would raise a warning with an
error code 0, making it impossible for a stored procedure, a connector,
or a client application to trigger logic to handle the warning.
Also, the warning text was hard coded, and therefore not translated.

With this fix, new errors numbers have been created to represent these
warnings, and the warning text is coded in the errmsg.txt file.
2008-10-06 14:36:15 -06:00
Sven Sandberg
28ce5ab20e Bug#35807 - INSTALL PLUGIN replicates row-based, but not stmt-based
INSTALL PLUGIN and UNINSTALL PLUGIN worked with statement-based and
mixed-mode replication only, but not with row-based replication.

There is no statement-based replication of these statements.
But there was row-based replication of the inserts and deletes
to and from the mysql.plugin table.

The fix is to suppress binlogging during insert and delete to
and from the mysql.plugin table.
2008-08-19 17:35:56 +02:00
Sergey Petrunia
eb8d8d3e3a Merge fix for BUG#35478 into 5.1 2008-07-15 21:46:02 +04:00
Ramil Kalimullin
db56fd008c Fix for bug#37669: Server crash by setting "@@session.innodb_table_locks"
Problem: reading/writing data from/to an address without proper
alignment leads to SIGBUS on some platforms.

Fix: use the correct data type when dereferencing variable values.
2008-07-09 16:52:26 +05:00
Georgi Kodinov
bd4c6d9b8c Bug#37069: Make federated disabled by default
The federated storage engine is now disabled by default.
mysql-test-run.pl is updated to enable it whenever it's required and available.
2008-05-30 13:21:45 +03:00
gkodinov/kgeorge@magare.gmz
fd64a7735d fixed compiler error in 5.1-marvel. 2008-03-28 18:43:13 +02:00
gkodinov/kgeorge@macbook.gmz
450a6385c4 fixed a hand in 5.1-marvel :
Removed a double release of the mutex on error
2008-03-28 17:24:23 +02:00
jani@a88-113-38-195.elisa-laajakaista.fi
090d1396cf Merge a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-main
into  a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-marvel
2008-03-28 12:14:27 +02:00
istruewing@stella.local
eabe082d6f Manual merge 2008-03-14 12:02:11 +01:00
jani@a88-113-38-195.elisa-laajakaista.fi
74cbd71e94 Merge a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-main
into  a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-marvel
2008-03-13 23:35:52 +02:00
kaa@kaamos.(none)
0a7052e4d3 Merge kaamos.(none):/data/src/mysql-5.1
into  kaamos.(none):/data/src/opt/mysql-5.1-opt
2008-03-12 11:19:46 +03:00
antony@pcg5ppc.xiphis.org
820068f1b7 Merge pcg5ppc.xiphis.org:/Network/Servers/anubis.xiphis.org/home/antony/work/mysql-5.1-engines
into  pcg5ppc.xiphis.org:/Network/Servers/anubis.xiphis.org/home/antony/work/merge.20080307/mysql-5.1
2008-03-07 13:46:29 -08:00
jani@hynda.mysql.fi
b806eea262 Merge hynda.mysql.fi:/home/my/mysql-5.1-main
into  hynda.mysql.fi:/home/my/mysql-5.1-marvel
2008-02-27 16:46:32 +02:00
tnurnberg@white.intern.koehntopp.de
468c8ebde7 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  mysql.com:/misc/mysql/99999/51-99999
2008-02-24 14:23:28 +01:00
tnurnberg@mysql.com/white.intern.koehntopp.de
79491f93c8 Bug#32757: hang with sql_mode set when setting some global variables
If setting a system-variable provided by a plug-in failed, no OK or
error was sent in some cases, hanging the client. We now send an error
in the case from the ticket (integer-argument out of range in STRICT
mode). We also provide a semi-generic fallback message for possible
future cases like this where an error is signalled, but no message is
sent to the client. The error/warning handling is unified so it's the
same again for variables provided by plugins and those in the server
proper.
2008-02-24 14:12:17 +01:00
acurtis/antony@ltamd64.xiphis.org
f6c3587eab Merge xiphis.org:/anubis/antony/work/p1-bug34598.2
into  xiphis.org:/anubis/antony/work/p1-bug34598.2.merge.1
2008-02-19 13:36:49 -08:00
acurtis/antony@xiphis.org/ltamd64.xiphis.org
118ebdf720 Bug#34598
"crash on hpita: Invalid address alignment"
  Replace dangerous pointer arithmetic - it may occurr where sizeof(int) is
  less than size of machine alignment requirement.
2008-02-19 12:55:13 -08:00
guilhem@gbichot4.local
045f3c4a5d Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-5.1-build
into  gbichot4.local:/home/mysql_src/mysql-5.1-build-gca
2008-02-18 23:36:57 +01:00
guilhem@gbichot4.local
9e2b31b026 Fix for server bug experienced in Maria (wrong "Truncated incorrect <var_name>
value" error even though the value was correct): a C function in my_getopt.c
was taking bool* in parameter and was called from C++ sql_plugin.cc,
but on some Mac OS X sizeof(bool) is 1 in C and 4 in C++, giving funny
mismatches. Fixed, all other occurences of bool in C are removed, future
ones are blocked by a "C-bool-catcher" in my_global.h (use my_bool).
2008-02-18 23:29:39 +01:00
istruewing@stella.local
9a4d57e319 Merge stella.local:/home2/mydev/mysql-5.1-amain
into  stella.local:/home2/mydev/mysql-5.1-axmrg
2008-02-14 16:53:03 +01:00
jani@a88-113-38-195.elisa-laajakaista.fi
1569f152da Merge a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-main
into  a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-marvel
2008-02-12 10:45:08 +01:00
jani@a88-113-38-195.elisa-laajakaista.fi
4f98f3e683 Merge a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-main
into  a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-marvel
2008-02-08 12:13:33 +01:00
kostja@dipika.(none)
b46ce80902 A fix and a test case for Bug#34166 Server crash in SHOW OPEN TABLES and
pre-locking.

The crash was caused by an implicit assumption in check_table_access() that
table_list parameter is always a part of lex->query_tables.

When iterating over the passed list of tables, check_table_access() used
to stop only when lex->query_tables_last_not_own was reached. 
In case of pre-locking, lex->query_tables_last_own is not NULL and points
to some element of lex->query_tables. When the parameter
of check_table_access() was not part of lex->query_tables, loop invariant
could never be violated and a crash would happen when the current table
pointer would point beyond the end of the provided list.

The fix is to change the signature of check_table_access() to also accept
a numeric limit of loop iterations, similarly to check_grant(), and 
supply this limit in all places when we want to check access of tables
that are outside lex->query_tables, or just want to check access to one table.
2008-01-30 18:27:41 +03:00
acurtis/antony@xiphis.org/ltamd64.xiphis.org
82839a0bbb fixes to make pushbuild tests green 2008-01-26 02:13:35 -08:00
acurtis/antony@xiphis.org/ltamd64.xiphis.org
98515df213 Bug#33358
"Plugin enum variables can't be set from command line"
  fix crash of LOCK_plugins mutex when loading plug-ins from command line.
  fix off-by-one bug when loading multiple plug-ins from the command line.
  initialize command line handling for ENUM and SET plugin variable types.
2008-01-25 16:05:15 -08:00
bell@desktop.sanja.is.com.ua
707e899c9e Mutex protection added for loading plugins. (BUG#33345) 2007-12-19 10:13:13 +02:00
gluh@eagle.(none)
4f5868114a Merge mysql.com:/home/gluh/MySQL/Merge/5.1
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
2007-12-13 15:56:04 +04:00
tnurnberg@sin.intern.azundris.com
5cab4a77e1 Bug#31177: Server variables can't be set to their current values
initialise limits properly for getopt_ll_limit()
(fixes falcon_opt test)
2007-12-06 18:03:30 +01:00
tnurnberg@mysql.com/white.intern.koehntopp.de
ae8b22d91e Bug#31177: Server variables can't be set to their current values
additional fixes for 64-bit
---
Merge mysql.com:/misc/mysql/31177/50-31177
into  mysql.com:/misc/mysql/31177/51-31177
---
Bug#31177: Server variables can't be set to their current values

additional 5.1 fixes (for plugins)
2007-12-04 01:17:52 +01:00
tnurnberg@white.intern.koehntopp.de
f561e8ddf3 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  mysql.com:/misc/mysql/31177/51-31177
2007-12-02 03:19:07 +01:00
tnurnberg@mysql.com/white.intern.koehntopp.de
56274466be Bug#31177: Server variables can't be set to their current values
5.1+ specific fixes (plugins etc.)
2007-12-01 19:55:06 +01:00
serg@janus.mylan
6f689c91d8 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  janus.mylan:/usr/home/serg/Abk/mysql-5.1
2007-11-19 17:12:49 +01:00
gluh@eagle.(none)
58336411c9 Merge mysql.com:/home/gluh/MySQL/Merge/5.1
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
2007-11-14 17:30:16 +04:00
gshchepa/uchum@gleb.loc
70f36562bc Fixed bug #32034: On 64bit platforms assigning values of
storage engine system variables was not validated and
unexpected value was assigned.

The check_func_enum function used subtraction from the uint
value with the probably negative result. That result of
type uint was compared with 0 after casting to signed long
type. On architectures where long type is longer than int
type the result of comparison was unexpected.
2007-11-14 13:48:21 +04:00
istruewing@stella.local
3eaf82a175 Bug#31210 - INSERT DELAYED crashes server when used on
partitioned table

Trying INSERT DELAYED on a partitioned table, that has not been
used right before, crashes the server. When a table is used for
select or update, it is kept open for some time. This period I
mean with "right before".

Information about partitioning of a table is stored in form of
a string in the .frm file. Parsing of this string requires a
correctly set up lexical analyzer (lex). The partitioning code
uses a new temporary instance of a lex. But it does still refer
to the previously active lex. The delayd insert thread does not
initialize its lex though...

Added initialization for thd->lex before open table in the delayed
thread and at all other places where it is necessary to call
lex_start() if all tables would be partitioned and need to parse
the .frm file.
2007-11-05 16:25:40 +01:00