MariaDB server is a community developed fork of MySQL server. Started by core members of the original MySQL team, MariaDB actively works with outside developers to deliver the most featureful, stable, and sanely licensed open SQL server in the industry.
Find a file
Sven Sandberg f3985c649d BUG#39934: Slave stops for engine that only support row-based logging
General overview:
The logic for switching to row format when binlog_format=MIXED had
numerous flaws. The underlying problem was the lack of a consistent
architecture.
General purpose of this changeset:
This changeset introduces an architecture for switching to row format
when binlog_format=MIXED. It enforces the architecture where it has
to. It leaves some bugs to be fixed later. It adds extensive tests to
verify that unsafe statements work as expected and that appropriate
errors are produced by problems with the selection of binlog format.
It was not practical to split this into smaller pieces of work.

Problem 1:
To determine the logging mode, the code has to take several parameters
into account (namely: (1) the value of binlog_format; (2) the
capabilities of the engines; (3) the type of the current statement:
normal, unsafe, or row injection). These parameters may conflict in
several ways, namely:
 - binlog_format=STATEMENT for a row injection
 - binlog_format=STATEMENT for an unsafe statement
 - binlog_format=STATEMENT for an engine only supporting row logging
 - binlog_format=ROW for an engine only supporting statement logging
 - statement is unsafe and engine does not support row logging
 - row injection in a table that does not support statement logging
 - statement modifies one table that does not support row logging and
   one that does not support statement logging
Several of these conflicts were not detected, or were detected with
an inappropriate error message. The problem of BUG#39934 was that no
appropriate error message was written for the case when an engine
only supporting row logging executed a row injection with
binlog_format=ROW. However, all above cases must be handled.
Fix 1:
Introduce new error codes (sql/share/errmsg.txt). Ensure that all
conditions are detected and handled in decide_logging_format()

Problem 2:
The binlog format shall be determined once per statement, in
decide_logging_format(). It shall not be changed before or after that.
Before decide_logging_format() is called, all information necessary to
determine the logging format must be available. This principle ensures
that all unsafe statements are handled in a consistent way.
However, this principle is not followed:
thd->set_current_stmt_binlog_row_based_if_mixed() is called in several
places, including from code executing UPDATE..LIMIT,
INSERT..SELECT..LIMIT, DELETE..LIMIT, INSERT DELAYED, and
SET @@binlog_format. After Problem 1 was fixed, that caused
inconsistencies where these unsafe statements would not print the
appropriate warnings or errors for some of the conflicts.
Fix 2:
Remove calls to THD::set_current_stmt_binlog_row_based_if_mixed() from
code executed after decide_logging_format(). Compensate by calling the
set_current_stmt_unsafe() at parse time. This way, all unsafe statements
are detected by decide_logging_format().

Problem 3:
INSERT DELAYED is not unsafe: it is logged in statement format even if
binlog_format=MIXED, and no warning is printed even if
binlog_format=STATEMENT. This is BUG#45825.
Fix 3:
Made INSERT DELAYED set itself to unsafe at parse time. This allows
decide_logging_format() to detect that a warning should be printed or
the binlog_format changed.

Problem 4:
LIMIT clause were not marked as unsafe when executed inside stored
functions/triggers/views/prepared statements. This is
BUG#45785.
Fix 4:
Make statements containing the LIMIT clause marked as unsafe at
parse time, instead of at execution time. This allows propagating
unsafe-ness to the view.
2009-07-14 21:31:19 +02:00
.bzr-mysql fixed .bzr-mysql/default.conf 2009-05-29 13:10:20 +02:00
BitKeeper Merge trift2.:/MySQL/M51/mysql-5.1 2008-01-28 15:16:40 +01:00
BUILD Merge the bashism removal from 5.0 up to 5.1-build 2008-12-28 16:18:08 +01:00
client Merge from 5.1 main. 2009-06-08 09:55:37 -03:00
cmd-line-utils Addendum to Bug #45286: backport macro name form other tree 2009-06-06 15:05:44 +02:00
config/ac-macros Automerge 2009-03-25 16:23:47 +03:00
dbug automerge 2009-06-05 15:30:57 +03:00
Docs Makefile.am: 2008-04-08 11:44:18 +02:00
extra Fix incorrect filename in verbose output of innochecksum. (Bug #44484, 2009-05-05 11:07:26 -07:00
include Bug #45286: compilation warnings on mysql-5.0-bugteam on MacOSX 2009-06-05 16:44:38 +03:00
libmysql auto-merge 2009-03-19 09:44:58 -04:00
libmysql_r Makefile.am: 2007-10-08 20:55:44 +02:00
libmysqld Bug #43715 Link errors when trying to link mysql_embedded.exe 2009-03-17 23:28:24 +01:00
man Bug#37098 Get rid of "Installed (but unpackaged)" files in the RPM build 2008-08-27 16:03:39 +02:00
mysql-test BUG#39934: Slave stops for engine that only support row-based logging 2009-07-14 21:31:19 +02:00
mysys auto-merge 5.1-bugteam (local) --> 5.1-bugteam 2009-05-21 09:36:38 +01:00
netware Auto-merge up from 5.0 2009-02-07 16:50:31 +01:00
plugin Add the IBM DB2 for i storage engine. 2009-02-15 03:18:30 +01:00
pstack Makefile.am, configure.in: 2007-09-27 21:39:23 +02:00
regex Fix for server bug experienced in Maria (wrong "Truncated incorrect <var_name> 2008-02-18 23:29:39 +01:00
scripts Bug #44736 mysqld_safe's my_which() is broken and 2009-05-25 18:21:40 +02:00
server-tools auto-merge 2009-03-19 09:42:36 -04:00
sql BUG#39934: Slave stops for engine that only support row-based logging 2009-07-14 21:31:19 +02:00
sql-bench Up-merge from 5.0 2009-03-11 15:03:25 -06:00
sql-common Merge from mysql-5.0-bugteam. 2009-06-10 11:05:07 -03:00
storage BUG#39934: Slave stops for engine that only support row-based logging 2009-07-14 21:31:19 +02:00
strings Addendum to Bug #45286: backport macro name form other tree 2009-06-06 15:05:44 +02:00
support-files automerge 2009-06-12 17:07:47 +03:00
tests Workaround a compiler that does not support certain C99 features for C code. 2009-05-23 10:19:58 -03:00
unittest Fix for server bug experienced in Maria (wrong "Truncated incorrect <var_name> 2008-02-18 23:29:39 +01:00
vio Bug#33899: Deadlock in mysql_real_query with shared memory connections 2009-03-26 20:25:10 -03:00
win Updates to build with community features enabled for community builds. 2009-05-20 23:04:34 +02:00
zlib The header "config.h" needs to be included "early" to control other headers. 2008-10-13 14:23:39 +02:00
.bzrignore Bug#40446 - mysql-test-run --gcov is broken 2009-02-27 12:20:53 +01:00
.cvsignore Import changeset 2000-07-31 21:29:14 +02:00
CMakeLists.txt merged 5.0-bugteam 2009-05-27 18:14:09 +03:00
configure.in Raise version number after cloning 5.1.35 2009-05-14 13:07:11 +02:00
COPYING - manual.texi will be replaced with a manual written in DocBook/XML. This ChangeSet removes all 2005-04-13 11:51:38 +02:00
EXCEPTIONS-CLIENT EXCEPTIONS-CLIENT: 2007-03-14 18:28:16 +01:00
INSTALL-SOURCE ReadMe.txt, INSTALL-WIN-SOURCE, INSTALL-BINARY, INSTALL-SOURCE: 2007-11-23 10:15:55 +01:00
INSTALL-WIN-SOURCE ReadMe.txt, INSTALL-WIN-SOURCE, INSTALL-BINARY, INSTALL-SOURCE: 2007-11-23 10:15:55 +01:00
Makefile.am merge: 5.1 -> 5.1-rpl 2009-01-08 19:03:56 +00:00
README Added clarification about GPL v2, changed to Sun Microsystems, Inc. 2009-05-05 16:27:35 +02:00

This is a release of MySQL, a dual-license SQL database server.
MySQL is brought to you by the MySQL team at Sun Microsystems, Inc.

License information can be found in these files:
- For GPL (free) distributions, see the COPYING file and
  the EXCEPTIONS-CLIENT file.
- For commercial distributions, see the LICENSE.mysql file.

GPLv2 Disclaimer
For the avoidance of doubt, except that if any license choice
other than GPL or LGPL is available it will apply instead, Sun
elects to use only the General Public License version 2 (GPLv2)
at this time for any software where a choice of GPL license versions
is made available with the language indicating that GPLv2 or any
later version may be used, or where a choice of which version of
the GPL is applied is otherwise unspecified.

For further information about MySQL or additional documentation, see:
- The latest information about MySQL: http://www.mysql.com
- The current MySQL documentation: http://dev.mysql.com/doc

Some manual sections of special interest:

- If you are migrating from an older version of MySQL, please read the
  "Upgrading from..." section first!
- To see what MySQL can do, take a look at the features section.
- For installation instructions, see the Installing and Upgrading chapter.
- For the new features/bugfix history, see the Change History appendix.
- For the currently known bugs/misfeatures (known errors) see the Problems
  and Common Errors appendix.
- For a list of developers and other contributors, see the Credits
  appendix.

A local copy of the MySQL Reference Manual can be found in the Docs
directory in GNU Info format.  You can also browse the manual online or
download it in any of several formats at the URL given earlier in this
file.

************************************************************

IMPORTANT:

Bug or error reports should be sent to http://bugs.mysql.com.