Commit graph

656 commits

Author SHA1 Message Date
Martin Hansson
acdbef4520 Bug#46616: Merge
mysql-test/r/auto_increment.result:
  Bug#46616: Test result.
mysql-test/t/auto_increment.test:
  Bug#46616: Test case.
sql/sql_update.cc:
  Bug#46616: Fix.
2009-08-20 14:30:59 +02:00
Martin Hansson
e66fba53a7 Bug#46616: Assertion `!table->auto_increment_field_not_null' on
view manipulations
      
The bespoke flag was not properly reset after last call to 
fill_record. Fixed by resetting in caller mysql_update.

mysql-test/r/auto_increment.result:
  Bug#46616: Test result.
mysql-test/t/auto_increment.test:
  Bug#46616: Test case.
sql/sql_update.cc:
  Bug#46616: Fix.
2009-08-20 13:56:29 +02:00
Georgi Kodinov
bef74a2335 Merge of the fix for bug #40113 to 5.1. 2009-07-13 20:36:54 +03:00
Georgi Kodinov
410e1a72b9 Bug #40113: Embedded SELECT inside UPDATE or DELETE can timeout
without error

When using quick access methods for searching rows in UPDATE or 
DELETE there was no check if a fatal error was not already sent 
to the client while evaluating the quick condition.
As a result a false OK (following the error) was sent to the 
client and the error was thus transformed into a warning.

Fixed by checking for errors sent to the client during 
SQL_SELECT::check_quick() and treating them as real errors.

Fixed a wrong test case in group_min_max.test
Fixed a wrong return code in mysql_update() and mysql_delete()

mysql-test/r/bug40113.result:
  Bug #40013: test case
mysql-test/r/group_min_max.result:
  Bug #40013: fixed a wrong test case
mysql-test/t/bug40113-master.opt:
  Bug #40013: test case
mysql-test/t/bug40113.test:
  Bug #40013: test case
mysql-test/t/group_min_max.test:
  Bug #40013: fixed a wrong test case
sql/sql_delete.cc:
  Bug #40113: check for errors evaluating the quick select
sql/sql_update.cc:
  Bug #40113: check for errors evaluating the quick select
2009-07-13 18:11:16 +03:00
Alfranio Correia
f45b12dc5e auto-merge mysql-5.1-bugteam (local) --> mysql-5.1-bugteam 2009-06-18 15:16:14 +01:00
Alfranio Correia
3cf052b76c BUG#43929 binlog corruption when max_binlog_cache_size is exceeded
Large transactions and statements may corrupt the binary log if the size of the
cache, which is set by the max_binlog_cache_size, is not enough to store the
the changes.

In a nutshell, to fix the bug, we save the position of the next character in the
cache before starting processing a statement. If there is a problem, we simply
restore the position thus removing any effect of the statement from the cache.
Unfortunately, to avoid corrupting the binary log, we may end up loosing changes
on non-transactional tables if they do not fit in the cache. In such cases, we
store an Incident_log_event in order to stop the slave and alert users that some
changes were not logged.

Precisely, for every non-transactional changes that do not fit into the cache,
we do the following:
  a) the statement is *not* logged
  b) an incident event is logged after committing/rolling back the transaction,
  if any. Note that if a failure happens before writing the incident event to
  the binary log, the slave will not stop and the master will not have reported
  any error.
  c) its respective statement gives an error

For transactional changes that do not fit into the cache, we do the following:
  a) the statement is *not* logged
  b) its respective statement gives an error

To work properly, this patch requires two additional things. Firstly, callers to
MYSQL_BIN_LOG::write and THD::binlog_query must handle any error returned and
take the appropriate actions such as undoing the effects of a statement. We
already changed some calls in the sql_insert.cc, sql_update.cc and sql_insert.cc
modules but the remaining calls spread all over the code should be handled in
BUG#37148. Secondly, statements must be either classified as DDL or DML because
DDLs that do not get into the cache must generate an incident event since they
cannot be rolled back.
2009-06-18 14:52:46 +01:00
Staale Smedseng
2380d465f0 Merge from 5.0-bugteam 2009-06-17 16:56:44 +02:00
Staale Smedseng
3b0e6e4109 Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2
      
Compiling MySQL with gcc 4.3.2 and later produces a number of 
warnings, many of which are new with the recent compiler
versions.
                  
This bug will be resolved in more than one patch to limit the
size of changesets. This is the second patch, fixing more
of the warnings.
2009-06-17 15:54:01 +02:00
Staale Smedseng
a103509788 Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2

Compiling MySQL with gcc 4.3.2 and later produces a number of 
warnings, many of which are new with the recent compiler
versions.
            
This bug will be resolved in more than one patch to limit the
size of changesets. This is the second patch, fixing more
of the warnings.
2009-06-10 16:04:07 +02:00
He Zhenxing
abf5f8dac2 BUG#41948 Query_log_event constructor needlessly contorted
Make the caller of Query_log_event, Execute_load_log_event
constructors and THD::binlog_query to provide the error code
instead of having the constructors to figure out the error code.

sql/log_event.cc:
  Changed constructors of Query_log_event and Execute_load_log_event to accept the error code argument instead of figuring it out by itself
sql/log_event.h:
  Changed constructors of Query_log_event and Execute_load_log_event to accept the error code argument
2009-05-30 21:32:28 +08:00
Martin Hansson
5811a13712 Merge. 2009-05-13 17:24:27 +02:00
Chad MILLER
767501a9b1 Merge community up to enterprise, thus ending the community-server
adventure.
2009-05-06 09:06:32 -04:00
Martin Hansson
391364fac7 Bug#43580: Issue with Innodb on multi-table update
Certain multi-updates gave different results on InnoDB from
to MyISAM, due to on-the-fly updates being used on the former and
the update order matters.
Fixed by turning off on-the-fly updates when update order 
dependencies are present.


mysql-test/r/innodb_mysql.result:
  Bug#43580: Test result.
mysql-test/suite/rpl/r/rpl_slave_skip.result:
  Bug#43580: Changed test result. The InnoDB result is now what it would have been on MyISAM.
mysql-test/t/innodb_mysql.test:
  Bug#43580: Test case.
sql/sql_base.cc:
  Bug#43580: Added a word of caution about using tmp_set here.
sql/sql_update.cc:
  Bug#43580: Fix.
  Calls to TABLE::mark_columns_needed_for_update() are moved
  from mysql_multi_update_prepare() and right before the decison
  to do on-the-fly updates to the place where we do (or don't do)
  on-the-fly updates.
2009-05-05 11:38:19 +02:00
Sergei Golubchik
ad7518418c bug#44166
removed few sprintf's
2009-05-04 22:33:23 +02:00
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
He Zhenxing
51a9116638 BUG#37145 Killing a statement doing DDL may log binlog event with error code 1053
When the thread executing a DDL was killed after finished its
execution but before writing the binlog event, the error code in
the binlog event could be set wrongly to ER_SERVER_SHUTDOWN or
ER_QUERY_INTERRUPTED.

This patch fixed the problem by ignoring the kill status when
constructing the event for DDL statements.

This patch also included the following changes in order to
provide the test case.

 1) modified mysqltest to support variable for connection command

 2) modified mysql-test-run.pl, add new variable MYSQL_SLAVE to
    run mysql client against the slave mysqld.
2009-03-27 13:19:50 +08:00
He Zhenxing
b4fdb8aec1 BUG#37051 Replication rules not evaluated correctly
Backporting patch to 5.0.
2009-03-05 18:10:44 +08:00
Gleb Shchepa
b9d02d4669 Bug #39265: fix for the bug 33699 should be reverted
Documented behaviour was broken by the patch for bug 33699
that actually is not a bug.

This fix reverts patch for bug 33699 and reverts the
UPDATE of NOT NULL field with NULL query to old
behavior.


mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test:
  Bug #39265: fix for the bug 33699 should be reverted
mysql-test/include/ps_modify.inc:
  Bug #39265: fix for the bug 33699 should be reverted
mysql-test/r/auto_increment.result:
  Bug #39265: fix for the bug 33699 should be reverted
mysql-test/r/csv_not_null.result:
  Bug #39265: fix for the bug 33699 should be reverted
mysql-test/r/null.result:
  Bug #39265: fix for the bug 33699 should be reverted
mysql-test/r/ps_2myisam.result:
  Bug #39265: fix for the bug 33699 should be reverted
mysql-test/r/ps_3innodb.result:
  Bug #39265: fix for the bug 33699 should be reverted
mysql-test/r/ps_4heap.result:
  Bug #39265: fix for the bug 33699 should be reverted
mysql-test/r/ps_5merge.result:
  Bug #39265: fix for the bug 33699 should be reverted
mysql-test/r/warnings.result:
  Bug #39265: fix for the bug 33699 should be reverted
mysql-test/suite/ndb/r/ps_7ndb.result:
  Bug #39265: fix for the bug 33699 should be reverted
mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result:
  Bug #39265: fix for the bug 33699 should be reverted
mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result:
  Bug #39265: fix for the bug 33699 should be reverted
mysql-test/suite/rpl/t/rpl_err_ignoredtable.test:
  Bug #39265: fix for the bug 33699 should be reverted
mysql-test/t/auto_increment.test:
  Bug #39265: fix for the bug 33699 should be reverted
mysql-test/t/csv_not_null.test:
  Bug #39265: fix for the bug 33699 should be reverted
mysql-test/t/null.test:
  Bug #39265: fix for the bug 33699 should be reverted
mysql-test/t/warnings.test:
  Bug #39265: fix for the bug 33699 should be reverted
sql/sql_update.cc:
  Bug #39265: fix for the bug 33699 should be reverted
2009-02-05 13:49:32 +04:00
Chad MILLER
926e5f6694 Merged from 5.0 (enterprise). 2008-12-17 15:01:34 -05:00
Joerg Bruehe
2181c95918 Merge main 5.1 into 5.1-build 2008-12-10 21:14:50 +01:00
Gleb Shchepa
d15cbc1a1a Bug #40745: Error during WHERE clause calculation in UPDATE
leads to an assertion failure

Any run-time error in stored function (like recursive function
call or update of table that is already updating by statement
which invoked this stored function etc.) that was used in some
expression of the single-table UPDATE statement caused an
assertion failure.
Multiple-table UPDATE (as well as INSERT and both single- and
multiple-table DELETE) are not affected.


mysql-test/r/update.result:
  Added test case for bug #40745.
mysql-test/t/update.test:
  Added test case for bug #40745.
sql/sql_update.cc:
  Bug #40745: Error during WHERE clause calculation in UPDATE
              leads to an assertion failure
  
  The mysql_update function has been updated to take into account
  the status of invoked stored functions before setting the status
  of whole UPDATE query to OK.
2008-11-28 20:36:07 +04:00
Sergey Glukhov
9ac57f01d7 5.0-bugteam->5.1-bugteam merge 2008-11-27 18:11:54 +04:00
Sergey Glukhov
89d044062c Bug#37460 Assertion failed: !table->file || table->file->inited == handler::NONE
enable uncacheable flag if we update a view with check option
and check option has a subselect, otherwise, the check option
can be evaluated after the subselect was freed as independent
(See full_local in JOIN::join_free())


mysql-test/r/subselect.result:
  test result
mysql-test/t/subselect.test:
  test case
sql/mysql_priv.h:
  added UNCACHEABLE_CHECKOPTION flag
sql/sql_update.cc:
  enable uncacheable flag if we update a view with check option
  and check option has a subselect, otherwise, the check option
  can be evaluated after the subselect was freed as independent
  (See full_local in JOIN::join_free())
2008-11-27 17:57:34 +04:00
Build Team
e85fe79430 Added "Sun Microsystems, Inc." to copyright headers on files modified
since Oct 1st
2008-11-10 21:21:49 +01:00
Gleb Shchepa
0c20c0f12f manual merge 5.0-5.1.29-rc --> 5.1-5.1.29-rc 2008-10-09 20:57:41 +05:00
Gleb Shchepa
a83f5b18ef Bug#38499: flush tables and multitable table update with
derived table cause crash

When a multi-UPDATE command fails to lock some table, and
subsequently succeeds, the tables need to be reopened if
they were altered. But the reopening procedure failed for
derived tables.

Extra cleanup has been added.


mysql-test/r/lock_multi.result:
  Added test case for bug #38499.
mysql-test/t/lock_multi.test:
  Added test case for bug #38499.
sql/sql_union.cc:
  Bug#38499: flush tables and multitable table update with
             derived table cause crash
  
  Obsolete assertion has been removed.
sql/sql_update.cc:
  Bug#38499: flush tables and multitable table update with
             derived table cause crash
  
  Extra cleanup for derived tables has been added:
  1) unit.cleanup(),
  2) unit->reinit_exec_mechanism().
2008-10-09 20:24:31 +05:00
Gleb Shchepa
39996b44cc manual merge 5.0-5.1.29-rc --> 5.1-5.1.29-rc 2008-10-08 02:52:49 +05:00
Gleb Shchepa
f48b42e776 Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
``FLUSH TABLES WITH READ LOCK''

Concurrent execution of 1) multitable update with a
NATURAL/USING join and 2) a such query as "FLUSH TABLES
WITH READ LOCK" or "ALTER TABLE" of updating table led
to a server crash.


The mysql_multi_update_prepare() function call is optimized
to lock updating tables only, so it postpones locking to
the last, and if locking fails, it does cleanup of modified
syntax structures and repeats a query analysis.  However,
that cleanup procedure was incomplete for NATURAL/USING join
syntax data: 1) some Field_item items pointed into freed
table structures, and 2) the TABLE_LIST::join_columns fields
was not reset.

Major change:
  short-living Field *Natural_join_column::table_field has
  been replaced with long-living Item*.


mysql-test/r/lock_multi.result:
  Added test case for bug #38691.
mysql-test/t/lock_multi.test:
  Added test case for bug #38691.
sql/item.cc:
  Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
            ``FLUSH TABLES WITH READ LOCK''
  
  The Item_field constructor has been modified to allocate
  and copy original database/table/field names always (not
  during PS preparation/1st execution only), because
  an initialization of Item_field items with a pointer to
  short-living Field structures is a common practice.
sql/sql_base.cc:
  Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
            ``FLUSH TABLES WITH READ LOCK''
  
  1) Type adjustment for Natural_join_column::table_field
     (Field to Item_field);
  2) The setup_natural_join_row_types function has been
     updated to take into account new
     first_natural_join_processing flag to skip unnecessary
     reinitialization of Natural_join_column::join_columns
     during table reopening after lock_tables() failure
     (like the 'first_execution' flag for PS).
sql/sql_lex.cc:
  Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
            ``FLUSH TABLES WITH READ LOCK''
  
  Initialization of the new
  st_select_lex::first_natural_join_processing flag has
  been added.
sql/sql_lex.h:
  Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
            ``FLUSH TABLES WITH READ LOCK''
  
  The st_select_lex::first_natural_join_processing flag
  has been added to skip unnecessary rebuilding of
  NATURAL/USING JOIN structures during table reopening
  after lock_tables failure.
sql/sql_update.cc:
  Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
            ``FLUSH TABLES WITH READ LOCK''
  
  Extra cleanup calls have been added to reset
  Natural_join_column::table_field items.
sql/table.cc:
  Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
            ``FLUSH TABLES WITH READ LOCK''
  
  Type adjustment for Natural_join_column::table_field
  (Field to Item_field).
sql/table.h:
  Bug #38691: segfault/abort in ``UPDATE ...JOIN'' while
            ``FLUSH TABLES WITH READ LOCK''
  
  Type of the Natural_join_column::table_field field has
  been changed from Field that points into short-living
  TABLE memory to long-living Item_field that can be
  linked to (fixed) reopened table.
2008-10-08 02:34:00 +05:00
Davi Arnaut
0406d409ea Bug#34306: Can't make copy of log tables when server binary log is enabled
The problem is that when statement-based replication was enabled,
statements such as INSERT INTO .. SELECT FROM .. and CREATE TABLE
.. SELECT FROM need to grab a read lock on the source table that
does not permit concurrent inserts, which would in turn be denied
if the source table is a log table because log tables can't be
locked exclusively.

The solution is to not take such a lock when the source table is
a log table as it is unsafe to replicate log tables under statement
based replication. Furthermore, the read lock that does not permits
concurrent inserts is now only taken if statement-based replication
is enabled and if the source table is not a log table.

include/thr_lock.h:
  Introduce yet another lock type that my get upgraded depending
  on the binary log format. This is not a optimal solution but
  can be easily improved later.
mysql-test/r/log_tables.result:
  Add test case result for Bug#34306
mysql-test/suite/binlog/r/binlog_stm_row.result:
  Add test case result for Bug#34306
mysql-test/suite/binlog/t/binlog_stm_row.test:
  Add test case for Bug#34306
mysql-test/t/log_tables.test:
  Add test case for Bug#34306
sql/lock.cc:
  Assert that TL_READ_DEFAULT is not a real lock type.
sql/mysql_priv.h:
  Export new function.
sql/mysqld.cc:
  Remove using_update_log.
sql/sql_base.cc:
  Introduce function that returns the appropriate read lock type
  depending on how the statement is going to be replicated. It will
  only take a TL_READ_NO_INSERT log if the binary is enabled and the
  binary log format is statement-based and the table is not a log table.
sql/sql_parse.cc:
  Remove using_update_log.
sql/sql_update.cc:
  Use new function to choose read lock type.
sql/sql_yacc.yy:
  The lock type is now decided at open_tables time. This old behavior was
  actually misleading as the binary log format can be dynamically switched
  and this would not change for statements that have already been parsed
  when the binary log format is changed (ie: prepared statements).
2008-09-29 10:53:40 -03:00
He Zhenxing
923f61039e Cherry picking patch for BUG#37051 2008-08-26 18:01:49 +08:00
Sergey Petrunia
7a92412c59 Merge fix for BUG#35478 into 5.1 2008-07-15 21:46:02 +04:00
Sergey Petrunia
62513bb1bc BUG#35478: sort_union() returns bad data when sort_buffer_size is hit
- In QUICK_INDEX_MERGE_SELECT::read_keys_and_merge: when we got table->sort from Unique,
  tell init_read_record() not to use rr_from_cache() because a) rowids are already sorted
  and b) it might be that the the data is used by filesort(), which will need record rowids
  (which rr_from_cache() cannot provide).
- Fully de-initialize the table->sort read in QUICK_INDEX_MERGE_SELECT::get_next(). This fixes BUG#35477.
(bk trigger: file as fix for BUG#35478).

sql/filesort.cc:
  BUG#35478: sort_union() returns bad data when sort_buffer_size is hit
  - make find_all_keys() use quick->get_next() instead of init_read_record(r)/r.read_record() calls
  - added dbug printout
sql/mysql_priv.h:
  BUG#35478: sort_union() returns bad data when sort_buffer_size is hit
  - Added parameter to init_read_record
sql/opt_range.cc:
  BUG#35478: sort_union() returns bad data when sort_buffer_size is hit
  - In QUICK_INDEX_MERGE_SELECT::read_keys_and_merge: when we got table->sort from Unique,
    tell init_read_record() not to use rr_from_cache() because a) rowids are already sorted
    and b) it might be that the the data is used by filesort(), which will need record rowids
    (which rr_from_cache() cannot provide).
  - Fully de-initialize the table->sort read in QUICK_INDEX_MERGE_SELECT::get_next().
sql/records.cc:
  BUG#35478: sort_union() returns bad data when sort_buffer_size is hit
  - Added disable_rr_cache parameter to init_read_record
  - Added comment
sql/sql_acl.cc:
  BUG#35478: sort_union() returns bad data when sort_buffer_size is hit
  - Added parameter to init_read_record
sql/sql_delete.cc:
  BUG#35478: sort_union() returns bad data when sort_buffer_size is hit
  - Added parameter to init_read_record
sql/sql_help.cc:
  BUG#35478: sort_union() returns bad data when sort_buffer_size is hit
  - Added parameter to init_read_record
sql/sql_select.cc:
  BUG#35478: sort_union() returns bad data when sort_buffer_size is hit
  - Added parameter to init_read_record
sql/sql_table.cc:
  BUG#35478: sort_union() returns bad data when sort_buffer_size is hit
  - Added parameter to init_read_record
sql/sql_udf.cc:
  BUG#35478: sort_union() returns bad data when sort_buffer_size is hit
  - Added parameter to init_read_record
sql/sql_update.cc:
  BUG#35478: sort_union() returns bad data when sort_buffer_size is hit
  - Added parameter to init_read_record
2008-07-15 18:13:21 +04:00
Chad MILLER
a4e7283a92 Merge from 5.0 trunk. 2008-07-14 16:16:37 -04:00
Chad MILLER
c425bf421d Merge chunk from trunk. 2008-07-10 14:50:07 -04:00
unknown
4175806efc Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  bodhi.(none):/opt/local/work/mysql-5.1-27430


Makefile.am:
  Auto merged
include/my_global.h:
  Auto merged
mysql-test/include/mix1.inc:
  Auto merged
sql/item.cc:
  Auto merged
sql/my_decimal.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
libmysqld/CMakeLists.txt:
  Manual merge.
libmysqld/lib_sql.cc:
  Manual merge.
mysql-test/t/disabled.def:
  Manual merge.
2008-05-20 11:38:17 +04:00
unknown
c5865cfdb6 Merge host.loc:/work/bk/5.0-bugteam
into  host.loc:/work/bk/5.1-bugteam


sql/sql_update.cc:
  Auto merged
2008-05-18 14:27:44 +05:00
unknown
29e7fa258d Fixed bug#36676: multiupdate using LEFT JOIN updates only
first row or fails with an error:
  ERROR 1022 (23000): Can't write; duplicate key in table ''

The server uses intermediate temporary table to store updated
row data.  The first column of this table contains rowid.
Current server implementation doesn't reset NULL flag of that
column even if the server fills a column with rowid.
To keep each rowid unique, there is an unique index.
An insertion into an unique index takes into account NULL
flag of key value and ignores real data if NULL flag is set.
So, insertion of actually different rowids may lead to two
kind of problems.  Visible effect of each of these problems
depends on an initial engine type of temporary table:

1. If multiupdate initially creates temporary table as
a MyISAM table (a table contains blob columns, and the
create_tmp_table function assumes, that this table is
large), it inserts only one single row and updates
only rows with one corresponding rowid. Other rows are
silently ignored. 

2. If multiupdate initially creates MEMORY temporary
table, fills it with data and reaches size limit for
MEMORY tables (max_heap_table_size), multiupdate
converts MEMORY table into MyISAM table and fails
with an error:
  ERROR 1022 (23000): Can't write; duplicate key in table ''


Multiupdate has been fixed to update the NULL flag of
temporary table rowid columns.



mysql-test/r/multi_update_tiny_hash.result:
  Added test case for bug#36676.
mysql-test/t/multi_update_tiny_hash-master.opt:
  Added test case for bug#36676.
mysql-test/t/multi_update_tiny_hash.test:
  Added test case for bug#36676.
sql/sql_update.cc:
  Fixed bug#36676: multiupdate using LEFT JOIN updates only
                   first row or fails with an error:
    ERROR 1022 (23000): Can't write; duplicate key in table ''
  
  The multi_update::send_data method has been modified to reset null bits of
  fields containing rowids.
2008-05-18 14:21:25 +05:00
unknown
797bfd6e3f Fix a compilation warning (unused variable). 2008-04-07 23:57:47 +04:00
unknown
f2d504aa64 Bug#26208 a typo (wrong variable name) in mysql_prepare_update function's source code?
This is a code clean up.
Removed redundant (and unused) TABLE_LIST variable intended as an IN-
parameter for setup_order.


sql/sql_update.cc:
  Removed redundant (and unused) TABLE_LIST variable intended as an IN-
  parameter for setup_order.
2008-04-01 14:41:13 +02:00
unknown
a451de2f59 Merge host.loc:/home/uchum/work/mysql-5.1
into  host.loc:/home/uchum/work/5.1-opt


client/mysqltest.c:
  Auto merged
mysql-test/r/information_schema.result:
  Auto merged
mysql-test/t/information_schema.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
2008-03-27 15:54:45 +04:00
unknown
11cfd2ed67 Merge host.loc:/home/uchum/work/mysql-5.0
into  host.loc:/home/uchum/work/5.0-opt


sql/sql_delete.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
2008-03-27 15:52:55 +04:00
unknown
cebc10e3c0 Merge stella.local:/home2/mydev/mysql-5.1-ateam
into  stella.local:/home2/mydev/mysql-5.1-axmrg


mysql-test/r/federated.result:
  Auto merged
mysql-test/t/federated.test:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
storage/federated/ha_federated.cc:
  Auto merged
mysql-test/suite/binlog/r/binlog_unsafe.result:
  Manual merge
mysql-test/suite/binlog/t/binlog_unsafe.test:
  Manual merge
2008-03-26 10:56:03 +01:00
unknown
1b6118190e Merge magare.gmz:/home/kgeorge/mysql/autopush/B26461-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/B26461-5.1-opt


CMakeLists.txt:
  Auto merged
include/config-win.h:
  Auto merged
include/my_global.h:
  Auto merged
sql/procedure.h:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_acl.h:
  Auto merged
sql/sql_analyse.cc:
  Auto merged
sql/sql_analyse.h:
  Auto merged
sql/sql_db.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_load.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/handler.h:
  merged bug 26461 to 5.1-opt
sql/mysql_priv.h:
  merged bug 26461 to 5.1-opt
sql/sql_base.cc:
  merged bug 26461 to 5.1-opt
sql/sql_prepare.cc:
  merged bug 26461 to 5.1-opt
2008-03-21 17:48:28 +02:00
unknown
cebb6727b3 Bug #26461: Intrinsic data type bool (1 byte) redefined to BOOL (4 bytes)
The bool data type was redefined to BOOL (4 bytes on windows).
Removed the #define and fixed some of the warnings that were uncovered
by this.
Note that the fix also disables 2 warnings :
4800 : 'type' : forcing value to bool 'true' or 'false' (performance warning)
4805: 'operation' : unsafe mix of type 'type' and type 'type' in operation

These warnings will be handled in a separate bug, as they are performance related or bogus.

Fixed to int the return type of functions that return more than 
2 distinct values.


CMakeLists.txt:
  Bug #26461: disable the C4800 and C4805 warnings temporarily
include/config-win.h:
  Bug #26461: 
   - no need for this define for Windows.
   - windows C++ compilers have a bool type
include/my_global.h:
  Bug #26461: removed bool_defined (no longer needed)
sql/handler.h:
  Bug #26461: bool functions must return boolean values
sql/mysql_priv.h:
  Bug #26461: fixed return type of functions that return more than
  2 distinct values.
sql/procedure.h:
  Bug #26461: fixed return type of functions that return more than
  2 distinct values.
sql/sql_acl.cc:
  Bug #26461: fixed return type of functions that return more than
  2 distinct values.
sql/sql_acl.h:
  Bug #26461: fixed return type of functions that return more than
  2 distinct values.
sql/sql_analyse.cc:
  Bug #26461: fixed return type of functions that return more than
  2 distinct values.
sql/sql_analyse.h:
  Bug #26461: fixed return type of functions that return more than
  2 distinct values.
sql/sql_base.cc:
  Bug #26461: fixed return type of functions that return more than
  2 distinct values.
sql/sql_db.cc:
  Bug #26461: fixed return type of functions that return more than
  2 distinct values.
sql/sql_delete.cc:
  Bug #26461: fixed return type of functions that return more than
  2 distinct values.
sql/sql_load.cc:
  Bug #26461: fixed return type of functions that return more than
  2 distinct values.
sql/sql_parse.cc:
  Bug #26461: fixed return type of functions that return more than
  2 distinct values.
sql/sql_prepare.cc:
  Bug #26461: fixed return type of functions that return more than
  2 distinct values.
sql/sql_update.cc:
  Bug #26461: fixed return type of functions that return more than
  2 distinct values.
2008-03-21 17:23:17 +02:00
unknown
1626b42ca3 BUG#34768 - nondeterministic INSERT using LIMIT logged in stmt mode if
binlog_format=mixed

Statement-based replication of DELETE ... LIMIT, UPDATE ... LIMIT,
INSERT ... SELECT ... LIMIT is not safe as order of rows is not
defined.

With this fix, we issue a warning that this statement is not safe to
replicate in statement mode, or go to row-based mode in mixed mode.

Note that we may consider a statement as safe if ORDER BY primary_key
is present. However it may confuse users to see very similiar statements
replicated differently.

Note 2: regular UPDATE statement (w/o LIMIT) is unsafe as well, but
this patch doesn't address this issue. See comment from Kristian
posted 18 Mar 10:55.


mysql-test/suite/binlog/r/binlog_stm_ps.result:
  Updated a test case according to fix for BUG#34768:
  INSERT ... SELECT ... LIMIT is now replicated in row mode.
mysql-test/suite/binlog/r/binlog_unsafe.result:
  A test case for BUG#34768.
mysql-test/suite/binlog/t/binlog_unsafe.test:
  A test case for BUG#34768.
sql/sql_delete.cc:
  Statement-based replication of DELETE ... LIMIT is not safe as order of
  rows is not defined, so in mixed mode we go to row-based.
sql/sql_insert.cc:
  Statement-based replication of INSERT ... SELECT ... LIMIT is not safe
  as order of rows is not defined, so in mixed mode we go to row-based.
sql/sql_update.cc:
  Statement-based replication of UPDATE ... LIMIT is not safe as order of
  rows is not defined, so in mixed mode we go to row-based.
2008-03-18 20:25:34 +04:00
unknown
d9833dc41f Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl


mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
  Auto merged
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
sql/log.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/handler.cc:
  Manual merge.
sql/sql_update.cc:
  Manual merge.
2008-03-05 10:16:20 +01:00
unknown
86301df6d4 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  mysql.com:/Users/davi/mysql/mysql-5.1-runtime


sql/sql_update.cc:
  Auto merged
2008-02-19 10:39:14 -03:00
unknown
14021c96c4 Rename send_ok to my_ok. Similarly to my_error, it only records the status,
does not send it to the client.
2008-02-19 15:45:21 +03:00
unknown
526798dbb5 A fix and a test case for Bug#12713 "Error in a stored function called from
a SELECT doesn't cause ROLLBACK of statem".

The idea of the fix is to ensure that we always commit the current
statement at the end of dispatch_command(). In order to not issue
redundant disc syncs, an optimization of the two-phase commit
protocol is implemented to bypass the two phase commit if
the transaction is read-only.


mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result:
  Update test results.
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
  Update test results.
mysql-test/suite/rpl_ndb/t/disabled.def:
  Disable the tests, for which this changeset reveals a bug:
  the injector thread does not always add 'statement commit' to the
  rows injected in circular replication set up.
  To be investigated separately.
sql/ha_ndbcluster_binlog.cc:
  Add close_thread_tables() to run_query: this ensures
  that all tables are closed and there is no pending statement transaction.
sql/handler.cc:
  Implement optimisation of read-only transactions.
  If a transaction consists only of DML statements that do not change
  data, we do not perform a two-phase commit for it 
  (run one phase commit only).
sql/handler.h:
  Implement optimisation of read-only transactions.
  If a transaction consists only of DML statements that do not change
  data, we do not perform a two-phase commit for it 
  (run one phase commit only).
sql/log.cc:
  Mark the binlog transaction read-write whenever it's started.
  We never read from binlog, so it's safe and least intrusive to add
  this mark up here.
sql/log_event.cc:
  Update to the new layout of thd->transaction.
sql/rpl_injector.cc:
  Always commit statement transaction before committing the global one.
sql/sp.cc:
  Ad comments.
sql/sp_head.cc:
  Add comments.
sql/sql_base.cc:
  Commit transaction at the end of the statement. Always.
sql/sql_class.cc:
  Update thd_ha_data to return the right pointer in the new layout.
  
  Fix select_dumpvar::send_data to properly return operation status.
  A test case from commit.inc would lead to an assertion failure in the 
  diagnostics area (double assignment). Not test otherwise by the test suite.
sql/sql_class.h:
  Implement a new layout of storage engine transaction info in which 
  it is easy to access all members related to the handlerton only
  based on ht->slot.
sql/sql_cursor.cc:
  Update to the new layout of thd->transaction.
sql/sql_delete.cc:
  Remove wrong and now redundant calls to ha_autocommit_or_rollback.
  The transaction is committed in one place, at the end of the statement.
  Remove calls to mysql_unlock_tables, since some engines count locks
  and commit statement transaction in unlock_tables(), which essentially
  equates mysql_unlock_tables to ha_autocommit_or_rollback.
  Previously it was necessary to unlock tables soon because we wanted
  to avoid sending of 'ok' packet to the client under locked tables.
  This is no longer necessary, since OK packet is also sent from one place
  at the end of transaction.
sql/sql_do.cc:
  Add DO always clears the error, we must rollback the current
  statement before this happens. Otherwise the statement will be committed,
  and not rolled back in the end.
sql/sql_insert.cc:
  Remove wrong and now redundant calls to ha_autocommit_or_rollback.
  The transaction is committed in one place, at the end of the statement.
  Remove calls to mysql_unlock_tables, since some engines count locks
  and commit statement transaction in unlock_tables(), which essentially
  equates mysql_unlock_tables to ha_autocommit_or_rollback.
  Previously it was necessary to unlock tables soon because we wanted
  to avoid sending of 'ok' packet to the client under locked tables.
  This is no longer necessary, since OK packet is also sent from one place
  at the end of transaction.
sql/sql_load.cc:
  Remove wrong and now redundant calls to ha_autocommit_or_rollback.
  The transaction is committed in one place, at the end of the statement.
  Remove calls to mysql_unlock_tables, since some engines count locks
  and commit statement transaction in unlock_tables(), which essentially
  equates mysql_unlock_tables to ha_autocommit_or_rollback.
  Previously it was necessary to unlock tables soon because we wanted
  to avoid sending of 'ok' packet to the client under locked tables.
  This is no longer necessary, since OK packet is also sent from one place
  at the end of transaction.
sql/sql_parse.cc:
  Implement optimisation of read-only transactions: bypass 2-phase
  commit for them.
  Always commit statement transaction before commiting the global one.
  Fix an unrelated crash in check_table_access, when called from 
  information_schema.
sql/sql_partition.cc:
  Partitions commit at the end of a DDL operation.
  Make sure that send_ok() is done only if the commit has succeeded.
sql/sql_table.cc:
  Use ha_autocommit_or_rollback and end_active_trans everywhere.
  Add end_trans to mysql_admin_table, so that it leaves no pending
  transaction.
sql/sql_udf.cc:
  Remvove a redundant call to close_thread_tables()
sql/sql_update.cc:
  Remove wrong and now redundant calls to ha_autocommit_or_rollback.
  The transaction is committed in one place, at the end of the statement.
  Remove calls to mysql_unlock_tables, since some engines count locks
  and commit statement transaction in unlock_tables(), which essentially
  equates mysql_unlock_tables to ha_autocommit_or_rollback.
  Previously it was necessary to unlock tables soon because we wanted
  to avoid sending of 'ok' packet to the client under locked tables.
  This is no longer necessary, since OK packet is also sent from one place
  at the end of transaction.
mysql-test/include/commit.inc:
  New BitKeeper file ``mysql-test/include/commit.inc''
mysql-test/r/commit_1innodb.result:
  New BitKeeper file ``mysql-test/r/commit_1innodb.result''
mysql-test/t/commit_1innodb.test:
  New BitKeeper file ``mysql-test/t/commit_1innodb.test''
2008-02-19 14:43:01 +03:00
unknown
51cd734d8a Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.0-rpl
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl


sql/sql_delete.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
BitKeeper/deleted/.del-rpl_variables.test:
  Manual merge.
mysql-test/r/multi_update.result:
  Manual merge.
mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result:
  Manual merge.
sql/slave.cc:
  Manual merge.
2008-02-15 17:49:05 +01:00