A REPLACE in the MERGE engine is actually a REPLACE
into one (FIRST or LAST) of the underlying MyISAM
tables. So in effect the server works on the meta
data of the MERGE table, while the real insert happens
in the MyISAM table.
The MERGE table has no index, while MyISAM has a
unique index. When a REPLACE into a MERGE table (
and the REPLACE conflicts with a duplicate in a
child table) is done, we try to access the duplicate
key information for the MERGE table. This information
actually does not exist, hence this results in a crash.
The problem can be resolved by modifying the MERGE
engine to provide us the duplicate key information
directly, instead of just returning the MyISAM index
number as the error key. Then the SQL layer (or "the
server") does not try to access the key_info of the
MERGE table, which does not exist.
The current patch modifies the MERGE engine to provide
the position for a record where a unique key violation
occurs.
include/myisammrg.h:
Bug#45800 crash when replacing into a merge table and there is a duplicate
Add a member to the st_mymerge_info structure that will
store the duplicate key offset in the MERGE table. This
offset will be the sum of the record offset of the MyISAM
table within the MERGE table and the offset of the record
within the MyISAM table.
mysql-test/r/merge.result:
Bug#45800 crash when replacing into a merge table and there is a duplicate
Result file for the test case.
mysql-test/t/merge.test:
Bug#45800 crash when replacing into a merge table and there is a duplicate
Added test case for both REPLACE and INSERT...ON DUPLICATE UPDATE.
storage/myisammrg/ha_myisammrg.cc:
Bug#45800 crash when replacing into a merge table and there is a duplicate
The info method now will process the HA_STATUS_ERRKEY flag
and will return the index and the offset of the duplicate
key.
storage/myisammrg/ha_myisammrg.h:
Bug#45800 crash when replacing into a merge table and there is a duplicate
Set the HA_DUPLICATE_POS flag to indicate that the duplicate
key information is now available in the MERGE storage engine.
storage/myisammrg/myrg_info.c:
Bug#45800 crash when replacing into a merge table and there is a duplicate
We modify the myrg_status function to return the position of the
duplicate key. The duplicate key position in the MERGE table will
be the MyISAM file_offset and the offset within the MyISAM table
of the start position of the records.
1. BUG#21704 - Renaming column does not update FK definition
2. Changes in mysql-test/include/mtr_warnings.sql so that the testcase
for BUG#21704 doesn't fail because of the warnings generated.
Detailed revision comments:
r5488 | vasil | 2009-07-09 19:16:44 +0300 (Thu, 09 Jul 2009) | 13 lines
branches/5.1:
Fix Bug#21704 Renaming column does not update FK definition
by checking whether a column that participates in a FK definition is being
renamed and denying the ALTER in this case.
The patch was originally developed by Davi Arnaut <Davi.Arnaut@Sun.COM>:
http://lists.mysql.com/commits/77714
and was later adjusted to conform to InnoDB coding style by me (Vasil),
I also added some more comments and moved the bug specific mysql-test to
a separate file to make it more manageable and flexible.
and base tables
myrg_attach_children() could reuse a buffer that was allocated
previously based on a definition of a child table. The problem
was that the child's definition might have been changed, so
reusing the buffer could lead to crashes or valgrind errors
under some circumstances.
Fixed by changing myrg_attach_children() so that the
rec_per_key_part buffer is reused only when the child table
have not changed, and reallocated otherwise (the old buffer is
deallocated if necessary).
include/myisammrg.h:
Added a pointer to need_compat_check as an argument to
myrg_attach_children().
mysql-test/r/merge.result:
Added a test case for bug #45796.
mysql-test/t/merge.test:
Added a test case for bug #45796.
storage/myisammrg/ha_myisammrg.cc:
Pass a pointer to need_compat_check to myrg_attach_children().
storage/myisammrg/myrg_open.c:
Changed myrg_attach_children() so that the
rec_per_key_part buffer is reused only when the child table
have not changed, and reallocated otherwise (the old buffer
is deallocated if necessary).
BUG#45749 - Race condition in SET GLOBAL innodb_commit_concurrency=DEFAULT
Detailed revision comments:
r5419 | marko | 2009-06-25 16:11:57 +0300 (Thu, 25 Jun 2009) | 18 lines
branches/5.1: Merge r5418 from branches/zip:
------------------------------------------------------------------------
r5418 | marko | 2009-06-25 15:55:52 +0300 (Thu, 25 Jun 2009) | 5 lines
Changed paths:
M /branches/zip/ChangeLog
M /branches/zip/handler/ha_innodb.cc
M /branches/zip/mysql-test/innodb_bug42101-nonzero.result
M /branches/zip/mysql-test/innodb_bug42101-nonzero.test
M /branches/zip/mysql-test/innodb_bug42101.result
M /branches/zip/mysql-test/innodb_bug42101.test
branches/zip: Fix a race condition caused by
SET GLOBAL innodb_commit_concurrency=DEFAULT. (Bug #45749)
When innodb_commit_concurrency is initially set nonzero,
DEFAULT would change it back to 0, triggering Bug #42101.
rb://139 approved by Heikki Tuuri.
------------------------------------------------------------------------
1. Fixes build warnings caused by applying snapshot 5.1-ss5282
2. Fix the Makefile.am in storage/innobase to remove the header file
'fsp0types.h' which was added twice to fix build warning generated
after applying the 5.1-ss5282 snapshot
Detailed revision comments:
r5410 | marko | 2009-06-24 22:26:34 +0300 (Wed, 24 Jun 2009) | 2 lines
branches/5.1: Add missing #include "mtr0log.h" to avoid warnings
when compiling with -DUNIV_MUST_NOT_INLINE.
- when finding out a way to hide symbols, make decision basing
on compiler, not operating system.
- Sun Studio supports __hidden declaration specifier for this
purpose.
the auto_increment value
This is an alternative patch that instead of allowing RECREATE TABLE
on TRUNCATE TABLE it implements reset_auto_increment that is called
after delete_all_rows.
Note: this bug was fixed by Mattias Jonsson:
Pusing this patch: http://lists.mysql.com/commits/70370
mysql-test/suite/parts/r/partition_auto_increment_memory.result:
Bug#35111: Truncate a MyISAM partitioned table does not reset
the auto_increment value
mysql-test/suite/parts/r/partition_auto_increment_myisam.result:
Bug#35111: Truncate a MyISAM partitioned table does not reset
the auto_increment value
sql/ha_partition.cc:
Bug#35111: Truncate a MyISAM partitioned table does not reset
the auto_increment value
Added reset_auto_increment, to be used after delete_all_rows
to simulate truncate.
storage/heap/ha_heap.cc:
Bug#35111: Truncate a MyISAM partitioned table does not reset
the auto_increment value
Added reset_auto_increment, to be used after delete_all_rows
to simulate truncate
storage/heap/ha_heap.h:
Bug#35111: Truncate a MyISAM partitioned table does not reset
the auto_increment value
Added reset_auto_increment, to be used after delete_all_rows
to simulate truncate
storage/myisam/ha_myisam.cc:
Bug#35111: Truncate a MyISAM partitioned table does not reset
the auto_increment value
Added reset_auto_increment, to be used after delete_all_rows
to simulate truncate.
storage/myisam/ha_myisam.h:
Bug#35111: Truncate a MyISAM partitioned table does not reset
the auto_increment value
Added reset_auto_increment, to be used after delete_all_rows
to simulate truncate.
With ibmdb2i_create_index_option set to 1, creating an IBMDB2I table
with a primary key should produce an additional index that uses EBCDIC
hexadecimal sorting. However, this does not work. Adding indexes that
are not primary keys does work. The ibmdb2i_create_index_option should
be honoured when creating a table with a primary key.
This patch adds code to the create() function to check for the value
of the ibmdb2i_create_index_option variable and, when appropriate, to
generate a *HEX-based shadow index in DB2 for the primary key. Previously
this behavior was limited to secondary indexes.
Additionally, this patch restricts the creation of shadow indexes to
cases in which a non-*HEX sort sequence is used, as the documentation
for ibmdb2i_create_index_option describes. Previously, the shadow index
would in some cases be created even when the MySQL-specific index used
*HEX sorting, leading to redundant indexes.
Finally, the code used to generate the list of fields for indexes
and the code used to generate the SQL statement for the shadow
indexes has been refactored into individual functions.
mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45983.result:
Bug#45983 ibmdb2i_create_index_option=1 not working for primary key
Result file for the test case.
mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45983.test:
Bug#45983 ibmdb2i_create_index_option=1 not working for primary key
Add tests to verify that the ibmdb2i_create_index_option is being honoured
when creating a table with a primary key.
storage/ibmdb2i/ha_ibmdb2i.cc:
Bug#45983 ibmdb2i_create_index_option=1 not working for primary key
- Add code to the create() function to check for the value of the
ibmdb2i_create_index_option variable and, when appropriate, to
generate a *HEX-based shadow index in DB2 for the primary key.
- Restrict the creation of shadow indexes to cases in which a
non-*HEX sort sequence is used.
- Refractor code used to generate the list of fields for indexes
and the code used to generate the SQL statement for the shadow
indexes into individual functions.
storage/ibmdb2i/ha_ibmdb2i.h:
Bug#45983 ibmdb2i_create_index_option=1 not working for primary key
Add function prototypes for the functions that.
- Generate the list of fields for indexes
- Generate the SQL statement for the shadow
indexes
Some collations were causing IBMDB2I to report
inaccurate key range estimations to the optimizer
for LIKE clauses that select substrings. This can
be seen by running EXPLAIN. This problem primarily
affects multi-byte and unicode character sets.
This patch involves substantial changes to several
modules. There are a number of problems with the
character set and collation handling. These problems
have been or are being fixed, and a comprehensive
test has been included which should provide much
better coverage than there was before. This test
is enabled only for IBM i 6.1, because that version
has support for the greatest number of collations.
mysql-test/suite/ibmdb2i/r/ibmdb2i_collations.result:
Bug#45803 Inaccurate estimates for partial key values with IBMDB2I
result file for test case.
mysql-test/suite/ibmdb2i/t/ibmdb2i_collations.test:
Bug#45803 Inaccurate estimates for partial key values with IBMDB2I
Tests for character sets and collations. This test
is enabled only for IBM i 6.1, because that version
has support for the greatest number of collations.
storage/ibmdb2i/db2i_conversion.cc:
Bug#45803 Inaccurate estimates for partial key values with IBMDB2I
- Added support in convertFieldChars to enable records_in_range
to determine how many substitute characters were inserted and
to suppress conversion warnings.
- Fixed bug which was causing all multi-byte and Unicode fields
to be created as UTF16 (CCSID 1200) fields in DB2. The corrected
code will now create UCS2 fields as UCS2 (CCSID 13488), UTF8
fields (except for utf8_general_ci) as UTF8 (CCSID 1208), and
all other multi-byte or Unicode fields as UTF16. This will only
affect tables that are newly created through the IBMDB2I storage
engine. Existing IBMDB2I tables will retain the original CCSID
until recreated. The existing behavior is believed to be
functionally correct, but it may negatively impact performance
by causing unnecessary character conversion. Additionally, users
accessing IBMDB2I tables through DB2 should be aware that mixing
tables created before and after this change may require extra type
casts or other workarounds. For this reason, users who have
existing IBMDB2I tables using a Unicode collation other than
utf8_general_ci are encouraged to recreate their tables (e.g.
ALTER TABLE t1 ENGINE=IBMDB2I) in order to get the updated CCSIDs
associated with their DB2 tables.
- Improved error reporting for unsupported character sets by forcing
a check for the iconv conversion table at table creation time,
rather than at data access time.
storage/ibmdb2i/db2i_myconv.h:
Bug#45803 Inaccurate estimates for partial key values with IBMDB2I
Fix to set errno when iconv fails.
storage/ibmdb2i/db2i_rir.cc:
Bug#45803 Inaccurate estimates for partial key values with IBMDB2I
Significant improvements were made to the records_in_range code
that handles partial length string data in keys for optimizer plan
estimation. Previously, to obtain an estimate for a partial key
value, the implementation would perform any necessary character
conversion and then attempt to determine the unpadded length of
the partial key by searching for the minimum or maximum sort
character. While this algorithm was sufficient for most single-byte
character sets, it did not treat Unicode and multi-byte strings
correctly. Furthermore, due to an operating system limitation,
partial keys having UTF8 collations (ICU sort sequences in DB2)
could not be estimated with this method.
With this patch, the code no longer attempts to explicitly determine
the unpadded length of the key. Instead, the entire key is converted
(if necessary), including padding, and then passed to the operating
system for estimation. Depending on the source and target character
sets and collations, additional logic is required to correctly
handle cases in which MySQL uses unconvertible or differently
-weighted values to pad the key. The bulk of the patch exists
to implement this additional logic.
storage/ibmdb2i/ha_ibmdb2i.h:
Bug#45803 Inaccurate estimates for partial key values with IBMDB2I
The convertFieldChars declaration was updated to support additional
optional behaviors.
Creating an IBMDB2I table with the macce character set
is successful, but any attempt to insert data into the
table was failing.
This was happening because the character set name "macce"
is not a valid iconv descriptor for IBM i PASE. This patch
adds an override to convertTextDesc to use the equivalent
valid iconv descriptor "IBM-1282" instead.
mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45793.result:
Bug#45793 macce charset causes error with IBMDB2I
Result file for the test case.
mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45793.test:
Bug#45793 macce charset causes error with IBMDB2I
Add a testcase for the macce charater set.
storage/ibmdb2i/db2i_charsetSupport.cc:
Bug#45793 macce charset causes error with IBMDB2I
The character set name "macce" is not a valid iconv
descriptor for IBM i PASE. Add an override to convertTextDesc
to use the equivalent valid iconv descriptor "IBM-1282"
instead.
After applying Innodb snapshot 5.1-ss5282, build was broken
because of missing header file.
Adding the header file to Makefile.am after informing the
innodb developers.
Some collations--including cp1250_czech_cs,latin2_czech_cs,
ucs2/utf8_czech_ci, ucs2/utf8_danish_ci--are not being
sorted correctly by the IBMDB2I storage engine. This
was being caused because the sort order used by DB2 is
incompatible with the order expected by MySQL.
This patch removes support for the cp1250_czech_cs and
latin2_czech_cs collations because it has been determined
that the sort order used by DB2 is incompatible with the
order expected by MySQL. Users needing a czech collation
with IBMDB2I are encouraged to use a Unicode-based collation
instead of these single-byte collations. This patch also
modifies the DB2 sort sequence used for ucs2/utf8_czech_ci
and ucs2/utf8_danish_ci collations to better match the
sorting expected by MySQL. This will only affect indexes
or tables that are newly created through the IBMDB2I storage
engine. Existing IBMDB2I tables will retain the old sort
sequence until recreated.
mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45196.result:
Bug#45196 Some collations do not sort correctly with IBMDB2I
Result file for the test case.
mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45196.test:
Bug#45196 Some collations do not sort correctly with IBMDB2I
Adding tests for testing the sort order with the modified collations.
storage/ibmdb2i/db2i_collationSupport.cc:
Bug#45196 Some collations do not sort correctly with IBMDB2I
Remove the support for the cp1250_czech_cs and latin2_czech_cs
collations because it has been determined that the sort order
used by DB2 is incompatible with the order expected by MySQL.
Users needing a czech collation with IBMDB2I are encouraged to
use a Unicode-based collation instead of these single-byte
collations. This patch also modifies the DB2 sort sequence
used for ucs2/utf8_czech_ci and ucs2/utf8_danish_ci collations
to better match the sorting expected by MySQL. This will only
affect indexes or tables that are newly created through the
IBMDB2I storage engine. Existing IBMDB2I tables will retain
the old sort sequence until recreated.
1. BUG#45357 - 5.1.35 crashes with Failing assertion: index->type & DICT_CLUSTERED
2. Also fixes the compilation problem when the flag -DUNIV_MUST_NOT_INLINE
Detailed revision comments:
r5340 | marko | 2009-06-17 12:11:49 +0300 (Wed, 17 Jun 2009) | 4 lines
branches/5.1: row_unlock_for_mysql(): When the clustered index is unknown,
refuse to unlock the record.
(Bug #45357, caused by the fix of Bug #39320).
rb://132 approved by Sunny Bains.
r5339 | marko | 2009-06-17 11:01:37 +0300 (Wed, 17 Jun 2009) | 2 lines
branches/5.1: Add missing #include "mtr0log.h" so that the code compiles
with -DUNIV_MUST_NOT_INLINE.
It used to be declared as ulint, which is 32/64 bit integer depending on OS bitness.
However this declaration lead to problems with os_compare_and_swap_thread_id
implementation which operated on 32 bit integers (InterlockedCompareExchange)
Using 64 bit int lead to wrong result in os_compare_and_swap_thread_id
and to crash/assertion in rw_lock_set_writer_id_and_recursion_flag()
The fix is to use 4 byte integer to os_thread_id type definition.
zlib headers in wrong location.
Fixed by using path exported by zlib.m4 macro.
storage/innodb_plugin/Makefile.am:
Include zlib headers from a proper location.
BUG#45097 - Hang during recovery, redo logs for doublewrite buffer pages
Detailed revision comments:
r5128 | vasil | 2009-05-26 17:26:37 +0300 (Tue, 26 May 2009) | 7 lines
branches/5.1:
Fix Bug#45097 Hang during recovery, redo logs for doublewrite buffer pages
Do not write redo log for the pages in the doublewrite buffer. Also, do not
make a dummy change to the page because this is not needed.
r5150 | vasil | 2009-05-27 18:56:03 +0300 (Wed, 27 May 2009) | 4 lines
branches/5.1:
Whitespace fixup.
BUG#45097 - Hang during recovery, redo logs for doublewrite buffer pages
Detailed revision comments:
r5126 | vasil | 2009-05-26 16:57:12 +0300 (Tue, 26 May 2009) | 9 lines
branches/5.1:
Preparation for the fix of
Bug#45097 Hang during recovery, redo logs for doublewrite buffer pages
Non-functional change: move FSP_* macros from fsp0fsp.h to a new file
fsp0types.h. This is needed in order to be able to use FSP_EXTENT_SIZE
in mtr0log.ic.
r5127 | vasil | 2009-05-26 17:05:43 +0300 (Tue, 26 May 2009) | 9 lines
branches/5.1:
Preparation for the fix of
Bug#45097 Hang during recovery, redo logs for doublewrite buffer pages
Do not include unnecessary headers mtr0log.h and fut0lst.h in trx0sys.h
and include fsp0fsp.h just before it is needed. This is needed in order
to be able to use TRX_SYS_SPACE in mtr0log.ic.
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
Running a SELECT query over an IBMDB2I table with a cp1250 character set
was producing an error 2027 (ibmdb2i error 2027: Error converting single-byte
sort sequence to UCS-2).
The QMY_DESCRIBE_RANGE API was returning error 2027 to the storage engine
because the CCSID used for a cp1250 column (870) does not match the CCSID
used by the DB2 sort sequences associated with cp1250_* collations (1153).
This was because the storage engine relies on a set of system APIs to
determine which CCSID value most closely matches a particular MySQL
character set. However, in the case of cp1250, the system is returning
CCSID 870, which does not have a codepoint for the euro symbol, making it
an incorrect match.
This patch overrides the selection of a compatible CCSID to always return
1153 for cp1250.
storage/ibmdb2i/db2i_charsetSupport.cc:
Bug#45197 cp1250 character set with IBMDB2I generates 2027 error
override the selection of a compatible CCSID to
always return 1153 for cp1250.
The Innodb plugin 1.0.4 can be installed dynamically using the 'INSTALL PLUGIN' syntax
If mysqld is already statically linked with the inbuilt innodb, it is not possible to
install the innodb plugin 1.0.4 dynamically. Doing so would throw this error - Function
'innodb' already exists.
storage/innodb_plugin/Makefile.am:
Remove references of 'storage/innobase' and use $(srcdir) instead.
Renamed the dynamic plugin library name to 'ha_innodb_plugin' so
that it can be installed along with inbuilt plugin.
storage/innodb_plugin/Makefile.in:
Remove this file as it can be generated automatically by automake
using the Makefile.am
storage/innodb_plugin/handler/ha_innodb.cc:
Remove refernces to "storage/innobase" and the headers can be included directly.
Declare the plugin with the new name innodb_plugin
storage/innodb_plugin/plug.in:
Rename the plugin innobase as innodb_plugin
wmemset was being used to fill the row buffers.
wmemset was intended to fill the buffer with
16-bit UCS2 pad values. However, the 64-bit
version of wmemset uses 32-bit wide characters
and thus filled the buffer incorrectly. In some
cases, the null byte map would be overwritten,
causing ctype_utf8.test and ibmdb2i_rir.test to
fail, giving the error message CPF5035.
This patch eliminates the use of wmemset to fill
the row buffer. wmemset has been replaced with
memset16, which always fills memory with 16-bit
values.
storage/ibmdb2i/db2i_conversion.cc:
Bug#44811 Tests with utf8 charset fail with ibmdb2i on 64bit MySQL
Eliminate the use of wmemset to fill
the row buffer. Replace wmemset with
memset16, which always fills memory
with 16-bit values.
storage/ibmdb2i/db2i_misc.h:
Bug#44811 Tests with utf8 charset fail with ibmdb2i on 64bit MySQL
Eliminate the use of wmemset to fill
the row buffer. Replace wmemset with
memset16, which always fills memory
with 16-bit values.
The fix is to allow myisamchk to use >4G key_buffer_size on win64
include/myisam.h:
use ulonglong instead of ulong for use_buffers
storage/myisam/myisamchk.c:
use ulonglong instead of ulong for use_buffers
BUG#42101 - Race condition in innodb_commit_concurrency
Detailed revision comments:
r4994 | marko | 2009-05-14 15:04:55 +0300 (Thu, 14 May 2009) | 18 lines
branches/5.1: Prevent a race condition in innobase_commit() by ensuring
that innodb_commit_concurrency>0 remains constant at run time. (Bug #42101)
srv_commit_concurrency: Make this a static variable in ha_innodb.cc.
innobase_commit_concurrency_validate(): Check that innodb_commit_concurrency
is not changed from or to 0 at run time. This is needed, because
innobase_commit() assumes that innodb_commit_concurrency>0 remains constant.
Without this limitation, the checks for innodb_commit_concurrency>0
in innobase_commit() should be removed and that function would have to
acquire and release commit_cond_m at least twice per invocation.
Normally, innodb_commit_concurrency=0, and introducing the mutex operations
would mean significant overhead.
innodb_bug42101.test, innodb_bug42101-nonzero.test: Test cases.
rb://123 approved by Heikki Tuuri
BUG#44320 - InnoDB: missing DB_ROLL_PTR in Table Monitor COLUMNS output
Detailed revision comments:
r4976 | marko | 2009-05-13 15:44:54 +0300 (Wed, 13 May 2009) | 6 lines
branches/5.1: Display DB_ROLL_PTR in the COLUMNS section of the
innodb_table_monitor output. It was accidentally omitted due to an
off-by-one loop condition. (Bug #44320)
rb://116 approved by Heikki Tuuri
Detailed revision comments:
r4705 | vasil | 2009-04-14 14:30:13 +0300 (Tue, 14 Apr 2009) | 7 lines
branches/5.1:
When using the random function, first take the modulus by the number of pages
and then typecast to ulint.
This is a followup to r4699 - the fix of Bug#43660.
Occasionally, if both the partition_pruning
and partition_range tests are run sequentially
against the IBMDB2I engine, the partition_range
test will fail.
Compiler padding on a 64-bit build allowed
garbage data in the hash key used for
caching open iconv descriptors. As a
result, cached descriptors were not found,
and multiple duplicate iconv descriptors
were opened for a single character set.
Eventually, the maximum number of open
iconv descriptors was reached, and further
iconv_open() calls would fail, leading the
storage engine to report incorrectly that
the character set was not supported.
This patch widens the 16-bit members of the
hash key to 32 bits to eliminate compiler
padding. The entire length of the hash key
is now initialized correctly on both 32-bit
and 64-bit builds.
storage/ibmdb2i/db2i_charsetSupport.cc:
Bug#44856 IBMDB2I gives misleading 2504 error
widen the 16-bit members of the
hash key to 32 bits to eliminate
compiler padding.
In order to better support the usage of
IBMDB2I tables from within RPG programs,
the storage engine should ensure that the
RCDFMT name is consistent and predictable
for DB2 tables.
This patch appends a "RCDFMT <name>"
clause to the CREATE TABLE statement
that is passed to DB2. <name> is
generated from the original name of
the table itself. This ensures a
consistent and deterministic mapping
from the original table.
For the sake of simplicity only
the alpha-numeric characters are
preserved when generating the new
name, and these are upper-cased;
other characters are replaced with
an underscore (_). Following DB2
system identifier rules, the name
always begins with an alpha-character
and has a maximum of ten characters.
If no usable characters are found in
the table name, the name X is used.
mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44610.result:
Bug#44610 RCDFMT clause requested when creating DB2 table
Result file for the test case.
mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44610.test:
Bug#44610 RCDFMT clause requested when creating DB2 table
Test case that confirms that the names that are being generated are valid.
storage/ibmdb2i/ha_ibmdb2i.cc:
Bug#44610 RCDFMT clause requested when creating DB2 table
This patch appends a "RCDFMT <name>"
clause to the CREATE TABLE statement
that is passed to DB2. <name> is
generated from the original name of
the table itself. This ensures a
consistent and deterministic mapping
from the original table.
storage/ibmdb2i/ha_ibmdb2i.h:
Bug#44610 RCDFMT clause requested when creating DB2 table
This patch appends a "RCDFMT <name>"
clause to the CREATE TABLE statement
that is passed to DB2. <name> is
generated from the original name of
the table itself. This ensures a
consistent and deterministic mapping
from the original table.
This patch fixes compilation warning, "conversion from 'time_t' to 'ulong',
possible loss of data".
The fix is to typecast time_t to ulong before assigning it to ulong.
Backported this from 6.0-bugteam tree.
storage/archive/ha_archive.cc:
type casting time_t to ulong before assigning.
storage/federated/ha_federated.cc:
type casting time_t to ulong before assigning.
storage/innobase/handler/ha_innodb.cc:
type casting time_t to ulong before assigning.
storage/myisam/ha_myisam.cc:
type casting time_t to ulong before assigning.
When a user selected an unsupported character set for an
IBMDB2I table, error 2501 or 2511 may have been returned,
giving the appearance of an internal programming error.
This patch consolidates these errors into a single descriptive
error message for the common case of an unsupported character
set.
The new error number is 2504 and indicates a user error.
The errors 2501 and 2511 remain to indicate cases of internal
programming errors.
storage/ibmdb2i/db2i_charsetSupport.cc:
Bug#44232 Error msg should be improved when collation not supported.
consolidate errors 2501 and 2511 into a single
descriptive error message for the common case
of an unsupported character set.
storage/ibmdb2i/db2i_conversion.cc:
Bug#44232 Error msg should be improved when collation not supported.
consolidate errors 2501 and 2511 into a single
descriptive error message for the common case
of an unsupported character set.
storage/ibmdb2i/db2i_errors.cc:
Bug#44232 Error msg should be improved when collation not supported.
consolidate errors 2501 and 2511 into a single
descriptive error message for the common case
of an unsupported character set.
storage/ibmdb2i/db2i_errors.h:
Bug#44232 Error msg should be improved when collation not supported.
consolidate errors 2501 and 2511 into a single
descriptive error message for the common case
of an unsupported character set.
This patch adds corrections to the original patch
submitted 2009-04-08 (http://lists.mysql.com/commits/71607):
- fixed that the original patch didn't work because of an
incorrect condition;
- added a test case.
mysql-test/r/upgrade.result:
Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1
Result file for test case
mysql-test/std_data/bug37631.MYD:
Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1
table created in mysql 4.0
mysql-test/std_data/bug37631.MYI:
Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1
table created in mysql 4.0
mysql-test/std_data/bug37631.frm:
Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1
table created in mysql 4.0
mysql-test/t/upgrade.test:
Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1
Adds test for checking that upgrade works
on a table which is created by a mysql
server version <= 4.0.
storage/myisam/ha_myisam.cc:
Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1
Fix the conformance checker to relax checking
for the correct version of the tables (for tables
created by mysql server version <= 4.0)
Killing the insert-select statement corrupts the MyISAM table only
when the destination table is empty and when it has indexes. When
we bulk insert huge data and if the destination table is empty we
disable the indexes for fast inserts, data is then inserted and
indexes are re-enabled after bulk_insert operation
Killing the query, aborts the repair table operation during enable
indexes phase leading to table corruption.
We now truncate the table when we detect that enable indexes is
killed for bulk insert query.As we have an empty table before the
operation, we can fix by truncating the table.
mysql-test/r/myisam.result:
Result file for BUG#40827
mysql-test/t/myisam.test:
Testcase for BUG#40827
storage/myisam/ha_myisam.cc:
Fixed end_bulk_insert() method to truncate the table when we detect enable
index operation is killed.
A bug in the initialization of key segment information made it point
to the wrong bit, since a bit index was used when its int value
was needed. This lead to misinterpretation of bit columns
read from MyISAM record format when a NULL bit pushed them over
a byte boundary.
Fixed by using the int value of the bit instead.
mysql-test/r/myisam.result:
Bug#43737: Test result.
mysql-test/t/myisam.test:
Bug#43737: Test case.
storage/myisam/mi_open.c:
Bug#43737: fix.
The storage engine was not correctly handling the case in
which rnd_pos is executed for a handler without a preceding
rnd_next or index read operation. As a result, an unitialized
file handle was sometimes being passed to the QMY_READ API.
The fix clears the rrnAssocHandle at the beginning of each
read operation and then checks to see whether it has been
set to a valid handle value before attempting to use it
in rnd_pos. If rrnAssocHandle has not been set by a previous
read operation, rnd_pos instead falls back to the use of the
currently active handle.
storage/ibmdb2i/ha_ibmdb2i.cc:
Bug#44337 Select query using index merge fails with MCH3601
- clear the rrnAssocHandle at the beginning of each
read operation
- checks to see whether it has been set to a valid
handle value before attempting to use it in rnd_pos
single quote fails in 5.1.x
Performing fulltext prefix search (a word with truncation
operator) may cause a dead-loop.
The problem was in smarter index merge algorithm - it was writing
record reference to an incorrect memory area.
mysql-test/r/fulltext.result:
A test case for BUG#42907.
mysql-test/t/fulltext.test:
A test case for BUG#42907.
storage/myisam/ft_boolean_search.c:
Fixed incorrect memory update by _mi_dpointer() when performing
fulltext prefix search.
1) BUG#27276 - InnoDB Error: ibuf cursor restoration fails
2) Follow up fix for BUG#27276 which fixes the bug introduced in
the previous revision r2924
Detailed revision comments:
r2924 | marko | 2008-10-29 10:07:48 +0200 (Wed, 29 Oct 2008) | 7 lines
branches/5.1: Merge revision 2866 from branches/zip:
ibuf_delete_rec(): When the cursor to the insert buffer record cannot be
restored, do not complain if the tablespace does not exist. (Bug #27276)
Approved by Sunny Bains (rb://34)
r3598 | marko | 2008-12-22 15:28:03 +0200 (Mon, 22 Dec 2008) | 6 lines
branches/5.1: ibuf_delete_rec(): When the record cannot be found and
the tablespace has been dropped, commit the mini-transaction, so that
InnoDB will not hold the insert buffer tree latch in exclusive mode,
causing a potential deadlock. This bug was introduced in the fix of
Bug #27276 in r2924.
Killing insert-select statement on MyISAM corrupts the table.
Killing the insert-select statement corrupts the MyISAM table only
when the destination table is empty and when it has indexes. When
we bulk insert huge data and if the destination table is empty we
disable the indexes for fast inserts, data is then inserted and
indexes are re-enabled after bulk_insert operation
Killing the query, aborts the repair table operation during enable
indexes phase leading to table corruption.
We now truncate the table when we detect that enable indexes is
killed for bulk insert query.As we have an empty table before the
operation, we can fix by truncating the table.
mysql-test/r/myisam.result:
Result file for BUG#40827
mysql-test/t/myisam.test:
Testcase for BUG#40827
storage/myisam/ha_myisam.cc:
Fixed end_bulk_insert() method to truncate the table when we detect enable
index operation is killed.
1) BUG#43660 - SHOW INDEXES/ANALYZE does NOT update cardinality
for indexes of InnoDB table
Detailed revision comments:
r4699 | vasil | 2009-04-09 14:01:52 +0300 (Thu, 09 Apr 2009) | 15 lines
branches/5.1:
Fix Bug#43660 SHOW INDEXES/ANALYZE does NOT update cardinality for indexes
of InnoDB table
by replacing the PRNG that is used to pick random pages with a better
one.
This is based on r4670 but also adds a new configuration option and
enables the fix only if this option is changed. Please skip the present
revision when merging.
Approved by: Heikki (via email)
problems
1) BUG#39320 - innodb crash in file btr/btr0pcur.c line 217 with
innodb_locks_unsafe_for_binlog
2) Fixes bug in multi-table semi consistent reads.
3) Fixes email address from dev@innodb.com to innodb_dev_ww@oracle.com
4) Fixes warning message generated by main.innodb test
Detailed revision comments:
r4399 | marko | 2009-03-12 09:38:05 +0200 (Thu, 12 Mar 2009) | 5 lines
branches/5.1: row_sel_get_clust_rec_for_mysql(): Store the cursor position
also for unlock_row(). (Bug #39320)
rb://96 approved by Heikki Tuuri.
r4400 | marko | 2009-03-12 10:06:44 +0200 (Thu, 12 Mar 2009) | 8 lines
branches/5.1: Fix a bug in multi-table semi-consistent reads.
Remember the acquired record locks per table handle (row_prebuilt_t)
rather than per transaction (trx_t), so that unlock_row should successfully
unlock all non-matching rows in multi-table operations.
This deficiency was found while investigating Bug #39320.
rb://94 approved by Heikki Tuuri.
r4481 | marko | 2009-03-19 15:01:48 +0200 (Thu, 19 Mar 2009) | 6 lines
branches/5.1: row_unlock_for_mysql(): Do not unlock records that were
modified by the current transaction. This bug was introduced or unmasked
in r4400.
rb://97 approved by Heikki Tuuri
r4573 | vasil | 2009-03-30 14:17:13 +0300 (Mon, 30 Mar 2009) | 4 lines
branches/5.1:
Fix email address from dev@innodb.com to innodb_dev_ww@oracle.com
r4574 | vasil | 2009-03-30 14:27:08 +0300 (Mon, 30 Mar 2009) | 38 lines
branches/5.1:
Restore the state of INNODB_THREAD_CONCURRENCY to silence this warning:
TEST RESULT TIME (ms)
------------------------------------------------------------
worker[1] Using MTR_BUILD_THREAD 250, with reserved ports 12500..12509
main.innodb [ pass ] 8803
MTR's internal check of the test case 'main.innodb' failed.
This means that the test case does not preserve the state that existed
before the test case was executed. Most likely the test case did not
do a proper clean-up.
This is the diff of the states of the servers before and after the
test case was executed:
mysqltest: Logging to '/tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.log'.
mysqltest: Results saved in '/tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.result'.
mysqltest: Connecting to server localhost:12500 (socket /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/mysqld.1.sock) as 'root', connection 'default', attempt 0 ...
mysqltest: ... Connected.
mysqltest: Start processing test commands from './include/check-testcase.test' ...
mysqltest: ... Done processing test commands.
--- /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.result 2009-03-30 14:12:31.000000000 +0300
+++ /tmp/autotest.sh-20090330_033000-5.1.5Hg8CY/mysql-5.1/mysql-test/var/tmp/check-mysqld_1.reject 2009-03-30 14:12:41.000000000 +0300
@@ -99,7 +99,7 @@
INNODB_SUPPORT_XA ON
INNODB_SYNC_SPIN_LOOPS 20
INNODB_TABLE_LOCKS ON
-INNODB_THREAD_CONCURRENCY 8
+INNODB_THREAD_CONCURRENCY 16
INNODB_THREAD_SLEEP_DELAY 10000
INSERT_ID 0
INTERACTIVE_TIMEOUT 28800
mysqltest: Result content mismatch
not ok
r4576 | vasil | 2009-03-30 16:25:10 +0300 (Mon, 30 Mar 2009) | 4 lines
branches/5.1:
Revert a change to Makefile.am that I committed accidentally in c4574.
On IBM i 5.4, schemas with names that are longer
than 8 characters and contain digits or an underscore
cannot contain IBMDB2I tables, even though this should
theoritically be possible if all alpha characters
are uppercase.
THe current patch fixes the IBMDB2I engine to
allow digits and the underscore(_) to be used in
schema names longer than 8 characters on IBM i 5.4.
storage/ibmdb2i/db2i_misc.h:
The function which detected whether the
operating system would treat a schema as an "ordinary identifier" (allowing 10 characters in the name instead of 8) did not cover all possible cases.Function was
renamed and enhanced to detect all
possible cases of "ordinary identifiers".
storage/ibmdb2i/ha_ibmdb2i.cc:
use the renamed function to cover all
possible cases of ordinary identifiers.
In some circumstances, when a table is created with
the IBMDB2I engine, the CREATE TABLE statement will
return successfully but the table will not exist.
The current patch addresses the above issue and causes
CREATE to fail and report and error to the user.
storage/ibmdb2i/ha_ibmdb2i.cc:
Locally declared return code hid function-
scoped declaration and went out of scope
before being returned. Removed inner
declaration.
The utf8_swedish_ci and ucs2_swedish_ci
collations do not work with indexes on
IBMDB2I tables.
The current patch adds the mapping for
ucs2_swedish collation and removes the
ucs2_spanish2 mapping which is not
supported by any version of the operating
system.
storage/ibmdb2i/db2i_collationSupport.cc:
Removed mapping for ucs2_spanish2 collation
since it is not supported by any version of the operating system. Added mapping for ucs2_swedish
collation which had been overlooked but is
supported by the IBM i 6.1.
Currently the memory map is being created
with a size that is greater than the size
of the underlying datafile. This can cause
varying behaviour,
e.g.
In windows the size of the datafile
is increased, while on linux it remains
the same.
This fix removes the increment margin to
the size that is used while creating the
memory map.
storage/myisam/mi_dynrec.c:
remove MEMMAP_EXTRA_MARGIN that is used as
the increment margin to the underlying
datafile size while creating the mmap.
storage/myisam/mi_packrec.c:
The size of the underlying datafile is
increased by MEMMAP_EXTRA_MARGIN when
using a packed record format. Hence in
this case the size of the memory map should
be incremented by the same factor.
The conformance checker was not taking into
account, and, making concessions for acceptable
incompatibilites in tables created by
versions earlier than 4.1.
The current patch relaxes the conformance
checker to ignore differences in key_alg
and language for tables created by versions
earlier than 4.1.
storage/myisam/ha_myisam.cc:
Modify check_definition to ignore differences
in key_alg and language for tables created
by versions earlier than 4.1.
It leads to crash because there is no OOM check in ha_archive::unpack_row().
The fix:
added OOM error check
mysql-test/r/archive.result:
remover test case
mysql-test/std_data/bug32880.ARN:
remover test case
mysql-test/std_data/bug32880.ARZ:
remover test case
mysql-test/std_data/bug32880.frm:
remover test case
mysql-test/t/archive.test:
remover test case
Any statement reading corrupt archive data file
(CHECK/REPAIR/SELECT/UPDATE/DELETE) may cause assertion
failure in debug builds. This assertion has been removed
and an error is returned instead.
Also fixed that CHECK/REPAIR returns vague error message
when it mets corruption in archive data file. This is
fixed by returning proper error code.
mysql-test/r/archive.result:
A test case for BUG#32880
mysql-test/std_data/bug32880.ARN:
corrupted archive table to test check and repair table operation
mysql-test/std_data/bug32880.ARZ:
corrupted archive table to test check and repair table operation
mysql-test/std_data/bug32880.frm:
corrupted archive table to test check and repair table operation
mysql-test/t/archive.test:
A test case for BUG#32880
storage/archive/ha_archive.cc:
Fixed unpack_row() to return the error instead of throwing assertion
and also fixed repair() to throw better error when repair table
operation fails on corrupted archive table
Bug #43203 Overflow from auto incrementing causes server segv
Detailed revision comments:
r4325 | sunny | 2009-03-02 02:28:52 +0200 (Mon, 02 Mar 2009) | 10 lines
branches/5.1: Bug#43203: Overflow from auto incrementing causes server segv
It was not a SIGSEGV but an assertion failure. The assertion was checking
the invariant that *first_value passed in by MySQL doesn't contain a value
that is greater than the max value for that type. The assertion has been
changed to a check and if the value is greater than the max we report a
generic AUTOINC failure.
rb://93
Approved by Heikki
Bug #42714 AUTO_INCREMENT errors in 5.1.31
Detailed revision comments:
r4287 | sunny | 2009-02-25 05:32:01 +0200 (Wed, 25 Feb 2009) | 10 lines
branches/5.1: Fix Bug#42714 AUTO_INCREMENT errors in 5.1.31. There are two
changes to the autoinc handling.
1. To fix the immediate problem from the bug report, we must ensure that the
value written to the table is always less than the max value stored in
dict_table_t.
2. The second related change is that according to MySQL documentation when
the offset is greater than the increment, we should ignore the offset.