Commit graph

778 commits

Author SHA1 Message Date
Mattias Jonsson
a6b70da9a3 Bug#11766249 bug#59316: PARTITIONING AND INDEX_MERGE MEMORY LEAK
When executing row-ordered-retrieval index merge,
the handler was cloned, but it used the wrong
memory root, so instead of allocating memory
on the thread/query's mem_root, it used the table's
mem_root, resulting in non released memory in the
table object, and was not freed until the table was
closed.

Solution was to ensure that memory used during cloning
of a handler was allocated from the correct memory root.

This was implemented by fixing handler::clone() to also
take a name argument, so it can be used with partitioning.
And in ha_partition only allocate the ha_partition's ref, and
call the original ha_partition partitions clone() and set at cloned
partitions.

Fix of .bzrignore on Windows with VS 2010
2011-03-25 12:36:02 +01:00
Karen Langford
a3acdfacd1 Updating header copyright/README in source for 2011 2011-01-25 15:42:40 +01:00
Jan Wedvik
f4adb7c6e4 Fix for bug#58553, "Queries with pushed conditions causes 'explain extended'
to crash mysqld". 
      
handler::pushed_cond was not always properly reset when table objects where
recycled via the table cache.
      
handler::pushed_cond is now set to NULL in handler::ha_reset(). This should 
prevent pushed conditions from (incorrectly) re-apperaring in later queries.
2011-01-11 12:09:54 +01:00
Luis Soares
60f650069b BUG#46166
Merging to latest mysql-5.1-bugteam.
2010-12-16 19:11:08 +00:00
Sergey Glukhov
0e77c3295a Bug#39828 : Autoinc wraps around when offset and increment > 1
Auto increment value wraps when performing a bulk insert with
auto_increment_increment and auto_increment_offset greater than
one.
The fix:
If overflow happened then return MAX_ULONGLONG value as an
indication of overflow and check this before storing the
value into the field in update_auto_increment().
2010-12-13 14:48:12 +03:00
Luis Soares
aaefb52df8 BUG#46166: MYSQL_BIN_LOG::new_file_impl is not propagating error
when generating new name.
      
If find_uniq_filename returns an error, then this error is not
being propagated upwards, and execution does not report error to
the user (although a entry in the error log is generated).
                  
Additionally, some more errors were ignored in new_file_impl:
- when writing the rotate event
- when reopening the index and binary log file
                  
This patch addresses this by propagating the error up in the
execution stack. Furthermore, when rotation of the binary log
fails, an incident event is written, because there may be a
chance that some changes for a given statement, were not properly
logged. For example, in SBR, LOAD DATA INFILE statement requires
more than one event to be logged, should rotation fail while
logging part of the LOAD DATA events, then the logged data would
become inconsistent with the data in the storage engine.
2010-11-30 23:32:51 +00:00
Davi Arnaut
80246ac8b8 Bug#58057: 5.1 libmysql/libmysql.c unused variable/compile failure
Bug#57995: Compiler flag change build error on OSX 10.4: my_getncpus.c
Bug#57996: Compiler flag change build error on OSX 10.5 : bind.c
Bug#57994: Compiler flag change build error : my_redel.c
Bug#57993: Compiler flag change build error on FreeBsd 7.0 : regexec.c
Bug#57992: Compiler flag change build error on FreeBsd : mf_keycache.c
Bug#57997: Compiler flag change build error on OSX 10.6: debug_sync.cc

Fix assorted compiler generated warnings.
2010-11-10 19:14:47 -02:00
Tor Didriksen
0853153346 Bug#52172 test binlog.binlog_index needs --skip-core-file to avoid leaving core files
For crash testing: kill the server without generating core file.

include/my_dbug.h
  Use kill(getpid(), SIGKILL) which cannot be caught by signal handlers.
  All DBUG_XXX macros should be no-ops in optimized mode, do that for DBUG_ABORT as well.
sql/handler.cc
  Kill server without generating core.
sql/log.cc
  Kill server without generating core.
2010-10-18 13:24:34 +02:00
Sergey Vojtovich
b89feb5b28 BUG#39053 - UNISTALL PLUGIN does not allow the storage engine
to cleanup open connections

It was possible to UNINSTALL storage engine plugin when binding
between THD object and storage engine is still active (e.g. in
the middle of transaction).

To avoid unclean deactivation (uninstall) of storage engine plugin
in the middle of transaction, additional storage engine plugin
lock is acquired by thd_set_ha_data().

If ha_data is not null and storage engine plugin was not locked
by thd_set_ha_data() in this connection before, storage engine
plugin gets locked.

If ha_data is null and storage engine plugin was locked by
thd_set_ha_data() in this connection before, storage engine
plugin lock gets released.

If handlerton::close_connection() didn't reset ha_data, server does
it immediately after calling handlerton::close_connection().

Note that this is just a framework fix, storage engines must switch
to thd_set_ha_data() from thd_ha_data() if they want to see fit.
2010-04-14 13:53:59 +04:00
Georgi Kodinov
0852721dbe Revert of the push of bug #20837 due to failing regression tests. 2009-12-01 11:19:51 +02:00
Magne Mahre
8c24f5d14a Bug #20837 Apparent change of isolation level during transaction
SET TRANSACTION ISOLATION LEVEL is used to temporarily set
the trans.iso.level for the next transaction.  After the
transaction, the iso.level is (re-)set to value of the 
session variable 'tx_isolation'.

The bug is caused by setting the thd->variables.tx_isolation 
field to the value of the session variable upon each
statement commit.  It should only be set at the end of the
full transaction.

The fix has been to remove the setting of the variable in
ha_autocommit_or_rollback if we're in a transaction, as it 
will be correctly set in  either ha_rollback or 
ha_commit_one_phase.  

If, on the other hand, we're in  autocommit mode, tx_isolation 
will be explicitly set here.
2009-11-30 12:30:28 +01:00
Sergey Vojtovich
d6f27e58b7 BUG#43171 - Assertion failed: thd->transaction.xid_state.xid.is_null()
XA START may cause assertion failure/server crash when it is called
after unilateral roll back issued by the Resource Manager (both
in regular transaction and after XA transaction).

The problem was that rm_error variable wasn't set/reset properly.
2009-10-28 19:39:08 +04: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
Sergey Vojtovich
16c57d9099 BUG#45638 - Create temporary table with engine innodb fails
Create temporary InnoDB table fails on case insensitive
filesystems, when lower_case_table_names is 2 (e.g. OS X)
and temporary directory path contains upper case letters.

The problem was that tmpdir prefix was converted to lower
case when table was created, but was passed as is when
table was opened.

Fixed by leaving tmpdir prefix part intact.
2009-09-09 14:38:50 +05:00
Guilhem Bichot
b1073fb7a7 Bug#45829 "CREATE TABLE TRANSACTIONAL PAGE_CHECKSUM ROW_FORMAT=PAGE accepted, does nothing":
those keywords do nothing in 5.1 (they are meant for future versions, for example featuring the Maria engine)
so they are here removed from the syntax. Adding those keywords to future versions when needed is:
- WL#5034 "Add TRANSACTIONA=0|1 and PAGE_CHECKSUM=0|1 clauses to CREATE TABLE"
- WL#5037 "New ROW_FORMAT value for CREATE TABLE: PAGE"
2009-07-29 10:54:20 +02:00
Satya B
cae3c58a10 merging with mysql-5.1-bugteam branch 2009-07-27 11:50:13 +05:30
Anurag Shekhar
4e1ec3bb0b Bug#30102: Rename table does corrupt tables with partition files on failure
Problem was that a failing rename just left the partitions at the state
it was at the failure.

Solution was to try to revert the started rename if a failure occured.
2009-07-24 15:41:23 +05:30
Satya B
ba7c6884d0 merge 5.0-bugteam to 5.1-bugteam 2009-07-24 12:15:06 +05:30
Satya B
cbce1f5e69 Fix for BUG#18828 - If InnoDB runs out of undo slots,
it returns misleading 'table is full'

Innodb returns a misleading error message "table is full" 
when the number of active concurrent transactions is greater
than 1024.

Fixed by adding errorcode "ER_TOO_MANY_CONCURRENT_TRXS" to the
error codes. Innodb should return HA_TOO_MANY_CONCURRENT_TRXS
to mysql which is then mapped to ER_TOO_MANY_CONCURRENT_TRXS


Note: testcase is not written as this was reproducible only by
      changing innodb code.
2009-07-17 14:13:53 +05:30
Davi Arnaut
4c1333e6ed Bug#45548: XA transaction without access to InnoDB tables crashes the server
The problem is that the one phase commit function failed to
properly end a empty transaction. The solution is to ensure
that the transaction cleanup procedure is invoked even for
empty transactions.
2009-06-25 12:25:23 -03:00
Sergey Glukhov
c92abdc2a0 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
2009-06-19 13:24:43 +05:00
Staale Smedseng
27eff2bcac Merge from 5.0-bugteam for 43414 2009-06-09 18:44:26 +02:00
Staale Smedseng
dae006c17f 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 first patch, fixing a number 
of the warnings, predominantly "suggest using parentheses 
around && in ||", and empty for and while bodies.
2009-06-09 18:11:21 +02:00
Staale Smedseng
53d9b3d92d 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 first patch, fixing a number 
of the warnings, predominantly "suggest using parentheses 
around && in ||", and empty for and while bodies.
2009-06-09 14:55:30 +02:00
Davi Arnaut
f3e8609960 Bug#44672: Assertion failed: thd->transaction.xid_state.xid.is_null()
The problem is that when a optimization of read-only transactions
(bypass 2-phase commit) was implemented, it removed the code that
reseted the XID once a transaction wasn't active anymore:

sql/sql_parse.cc:

-  bzero(&thd->transaction.stmt, sizeof(thd->transaction.stmt));
-  if (!thd->active_transaction())
-    thd->transaction.xid_state.xid.null();
+  thd->transaction.stmt.reset();

This mostly worked fine as the transaction commit and rollback
functions (in handler.cc) reset the XID once the transaction is
ended. But those functions wouldn't reset the XID in case of
a empty transaction, leading to a assertion when a new starting
a new XA transaction.

The solution is to ensure that the XID state is reset when empty
transactions are ended (by either commit or rollback). This is
achieved by reorganizing the code so that the transaction cleanup
routine is invoked whenever a transaction is ended.
2009-06-05 19:16:54 -03:00
Ramil Kalimullin
8d3aceb09e Merge 2009-03-27 13:34:24 +04:00
Ramil Kalimullin
2005f3c72c Fix for bug #26288: savepoint not deleted, comit on empty transaction
Problem: commit doesn't delete savepoints if there are no changes 
in the transaction.

Fix: delete them in such cases.
2009-03-27 10:24:32 +04:00
Mattias Jonsson
e2cf7f14a0 Backport of bug#38719 from 6.0 to 5.1
handler::get_dup_key used the called handler for the
info call, but used table->file handler for errkey.
Fixed by using table->file->info instead.
2009-02-18 21:29:30 +01:00
Ignacio Galarza
2b85c64d65 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
Ramil Kalimullin
f6017fc4bd Fix for bug #40757: Starting server on Windows with
innodb_flush_method=wrong_value causes crash

Problem: after a failed plugin initialization, incompletely 
initialized data remained in the plugin and handlerton data 
structures. These were used later and caused the crash.

Fix: clean-up plugin related data if initialization failed.

Note: no test case added, hand tested.
2009-02-10 12:37:27 +04:00
Satya B
acb8a5dd0f Fix for BUG#39886 - Table full for MEMORY table is not written into error log
When a MEMORY table is full the error is returned to client but not written
to error log.

Fixed the handler api to write the error mesage to error log when the table is
full.

Note: No TestCase included as testing the error log is non-trivial.
2009-01-28 17:22:53 +05:30
Joerg Bruehe
c7d03ca35b Merge main 5.1 into 5.1-build 2008-12-10 21:14:50 +01:00
timothy.smith@sun.com
abd8574914 Merge from mysql-5.1.30-release 2008-11-27 00:02:10 +01:00
Ramil Kalimullin
03a27c45cd Fix for bug#40984: backport fix from 39585 into 5.0
Problem: in 5.0 'check table for upgrade' doesn't detect
incompatible collation changes made in 5.0.48.

Fix: backport #39585 fix to 5.0
2008-11-25 10:22:02 +04:00
Vladislav Vaintroub
7d5e156c78 Bug#39494 : key_buffer_size > 4GB does not work on 64 bit Windows
Cache size  is truncated via 32bit ulong  in  ha_init_key_cache() and 
ha_resize_key_cache() 

This change fixes the cast to size_t instead of ulong. This cast is safe,
because key_buffer_size parameter is limited to SIZE_T_MAX
2008-11-19 16:02:38 +01:00
Build Team
366adeab08 Added "Sun Microsystems, Inc." to copyright headers on files modified
since Oct 1st
2008-11-10 21:21:49 +01:00
Georgi Kodinov
90bc97a583 merged 5.1 main -> 5.1-bugteam 2008-11-06 16:18:25 +02:00
Mattias Jonsson
f2f556cfc7 merge 2008-11-05 20:44:19 +01:00
Joerg Bruehe
a9611262fd Merge 5.1-build -> main, to be used in 5.1.30 2008-11-04 13:44:19 +01:00
Ramil Kalimullin
ffbf00e6a2 Merge 2008-10-31 14:02:06 +04:00
Mattias Jonsson
cb6cb742f3 Bug#39084: Getting intermittent errors with statement-based binary logging
Problem was that partitioning cached the table flags.
These flags could change due to TRANSACTION LEVEL changes.
Solution was to remove the cache and always return the table flags
from the first partition (if the handler was initialized).
2008-10-29 21:20:04 +01:00
Davi Arnaut
188293f5b3 Merge Bug#28323 to mysql-5.1.29-rc 2008-10-21 18:28:01 -02:00
Davi Arnaut
b0d673fc4d Bug#28323: Server crashed in xid cache operations
The problem was that the server did not robustly handle a
unilateral roll back issued by the Resource Manager (RM)
due to a resource deadlock within the transaction branch.
By not acknowledging the roll back, the server (TM) would
eventually corrupt the XA transaction state and crash.

The solution is to mark the transaction as rollback-only
if the RM indicates that it rolled back its branch of the
transaction.
2008-10-21 16:07:31 -02:00
Davi Arnaut
ca53651d40 Bug#28323: Server crashed in xid cache operations
The problem was that the server did not robustly handle a
unilateral roll back issued by the Resource Manager (RM)
due to a resource deadlock within the transaction branch.
By not acknowledging the roll back, the server (TM) would
eventually corrupt the XA transaction state and crash.

The solution is to mark the transaction as rollback-only
if the RM indicates that it rolled back its branch of the
transaction.
2008-10-21 15:45:43 -02:00
Ramil Kalimullin
bde82a86f4 Fix for bug #40053: 'check table .. for upgrade' doesn't detect
collation change made in 5.1.24-rc

Problem: 'CHECK TABLE ... FOR UPGRADE' did not check for 
incompatible collation changes made in MySQL 5.1.24-rc.

Fix: add the check.
2008-10-17 17:45:17 +05:00
kent.boortz@sun.com
71b125ce18 Aligned declaration and defintion of ha_change_partitions(), to avoid link
error using SunStudio 12.
2008-10-11 18:35:49 +02:00
Ramil Kalimullin
03b5e7df78 Fix for bug#39585: innodb and myisam corruption after binary
upgrade from <=5.0.46 to >=5.0.48

Problem: 'check table .. for upgrade' doesn't detect 
incompatible collation changes made in 5.0.48.

Fix: check for incompatible collation changes.
2008-10-08 18:52:57 +05:00
Mats Kindahl
d40b2cb7af Merging with 5.1-5.1.29-rc 2008-10-08 13:37:13 +02:00
Mats Kindahl
70b18065d0 Bug #34707: Row based replication: slave creates table within wrong database
The failure was caused by executing a CREATE-SELECT statement that creates a
table in another database than the current one. In row-based logging, the
CREATE statement was written to the binary log without the database, hence
creating the table in the wrong database, causing the following inserts to
fail since the table didn't exist in the given database.

Fixed the bug by adding a parameter to store_create_info() that will make
the function print the database name before the table name and used that
in the calls that write the CREATE statement to the binary log. The database
name is only printed if it is different than the currently selected database.

The output of SHOW CREATE TABLE has not changed and is still printed without
the database name.
2008-10-08 11:15:00 +02:00
Georgi Kodinov
b437a0863b merged 5.1-5.1.29-rc -> 5.1-bugteam 2008-10-07 18:19:32 +03:00