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.
Fix mysql-test-run.pl to not terminate early when warnings in error logs are detected during
server shutdown. Instead, give a nice summary report at the end of the failures.
Fix code to make 100% sure no failures will go undetected.
Revert earlier wrong change.
Fix race with port allocation semaphore file permissions.
Adjust testsuite to copy with new PBXT engine now in the tree. The PBXT engine causes an
extra table to appear in the INFORMATION_SCHEMA. This causes different output for a few
test cases.
dbug/dbug.c:
If DbugParse() is called multiple times, the stack->keywords for the
top stack frame could be overwritten without being freed, causing a
memory leak reported by Valgrind.
include/my_global.h:
Add useful macro for different values when Valgrind (HAVE_purify) and not.
mysql-test/extra/rpl_tests/rpl_auto_increment.test:
Omit pbxt variables from show variables output.
mysql-test/include/have_pbxt.inc:
Add facility to disable test if PBXT engine is not available.
mysql-test/lib/mtr_report.pm:
Give a nice summary report at the end of tests of any warnings seen in logs during
server shutdowns.
mysql-test/lib/mtr_unique.pm:
Move chmod 777 to greatly reduce the risk of leaving the port semaphore file unaccessible
bu other users.
mysql-test/mysql-test-run.pl:
Don't abort in case of warnings detected, instead give a nice summary report.
Fix code to make 100% sure no failures will go undetected.
Revert earlier wrong change when master disconnects early.
mysql-test/r/information_schema.result:
Omit PBXT INFORMATION_SCHEMA table from output.
Move part of test to information_schema_all_engines.
mysql-test/r/information_schema_all_engines.result:
New file for information_schema tests that depend on which engines are available.
mysql-test/r/information_schema_db.result:
Move part of test to information_schema_all_engines.
mysql-test/r/innodb-autoinc.result:
Omit pbxt variables from show variables output.
mysql-test/r/mysqlshow.result:
Move part of test to information_schema_all_engines.
mysql-test/suite/rpl/r/rpl_auto_increment.result:
Omit pbxt variables from show variables output.
mysql-test/t/information_schema.test:
Omit PBXT INFORMATION_SCHEMA table from output.
Move part of test to information_schema_all_engines.
mysql-test/t/information_schema_all_engines.test:
New file for information_schema tests that depend on which engines are available.
mysql-test/t/information_schema_db.test:
Move part of test to information_schema_all_engines.
mysql-test/t/innodb-autoinc.test:
Omit pbxt variables from show variables output.
mysql-test/t/mysqlshow.test:
Move part of test to information_schema_all_engines.
mysql-test/valgrind.supp:
Add variant suppression (different system library versions).
Add suppression for problem with inet_ntoa().
sql/mysqld.cc:
Fix missing DBUG_RETURN.
Fix uninitialised thd->connect_utime, likely introduced by pool_of_threads.
sql/set_var.cc:
Fix one-byte buffer overflow in several places.
Fix unsafe use of String::c_ptr() of stack-allocated String buffer.
sql/sql_select.cc:
Silence valgrind warning due to GCC bug.
sql/sql_string.h:
Document potential problem with String::c_ptr() and String() constructor with caller-supplied buffer.
storage/archive/azio.c:
Silence Valgrind false warning for libz.
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
storage/maria/ma_loghandler.c:
Fixed bug of waiting for flush pass end: in case of two sequential flushes waiting thread can not detect end of the pass it is waiting because till the time it will check the flush in progress flag will be set on again. Solution is to have pass number and compare the number before before waits start and check it as condition of the flush pass end (of course it does not matter if the counter of pass number overflows).
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.
Bug #42400 InnoDB autoinc code can't handle floating-point columns
Detailed revision comments:
r4065 | sunny | 2009-01-29 16:01:36 +0200 (Thu, 29 Jan 2009) | 8 lines
branches/5.1: In the last round of AUTOINC cleanup we assumed that AUTOINC
is only defined for integer columns. This caused an assertion failure when
we checked for the maximum value of a column type. We now calculate the
max value for floating-point autoinc columns too.
Fix Bug#42400 - InnoDB autoinc code can't handle floating-point columns
rb://84 and Mantis issue://162
r4111 | sunny | 2009-02-03 22:06:52 +0200 (Tue, 03 Feb 2009) | 2 lines
branches/5.1: Add the ULL suffix otherwise there is an overflow.
Bug #42279 Race condition in btr_search_drop_page_hash_when_freed()
Detailed revision comments:
r4032 | marko | 2009-01-23 15:43:51 +0200 (Fri, 23 Jan 2009) | 10 lines
branches/5.1: Merge r4031 from branches/5.0:
btr_search_drop_page_hash_when_freed(): Check if buf_page_get_gen()
returns NULL. The page may have been evicted from the buffer pool
between buf_page_peek_if_search_hashed() and buf_page_get_gen(),
because the buffer pool mutex will be released between these two calls.
(Bug #42279)
rb://82 approved by Heikki Tuuri
storage/maria/ma_loghandler.c:
Normally, when we log LOGREC_LONG_TRANSACTION_ID, undo_lsn should be 0: assert this.
storage/maria/ma_test_force_start.pl:
this script does not work with mtr2, make it use mtr1
storage/maria/trnman.c:
The bug's cause was that: transaction would log LOGREC_LONG_TRANSACTION_ID, then Checkpoint would run
and skip it (because its undo_lsn is still 0), then transaction would log REDO+UNDO, then crash. At Recovery,
REDO phase would start from Checkpoint's record LSN, so wouldn't see LOGREC_LONG_TRANSACTION_ID, and
as Checkpoint record does not mention transaction, transaction would be unknown, so its REDO+UNDO would
be thrown away (assumed to belong to a transaction committed long ago as unknown), so transaction
would not be rolled back, which is wrong. Fix is: it was wrong to skip a transaction if undo_lsn is 0;
as soon as LOGREC_LONG_TRANSACTION_ID has been logged, it becomes potentially invisible to the REDO
phase, and so we must include this transaction in the checkpoint record.
This problem comes while inserting a duplicate row in merge table
without key but the child table has a primary key.
While forming the error message handler tries to locate the key field
which is creating this problem but as there is no key on the merge
table there is a segmentation fault.
mysql-test/r/merge.result:
Updated results with new test for this bug.
mysql-test/t/merge.test:
Added new test to test error generated from a key on child table
where merge table doesn't have any key.
storage/myisammrg/ha_myisammrg.cc:
Added a new check to see if the value of error key is higher than
the number of key in merge table and if it is the error key set
to MAX_KEY. The error message generation routine treats MAX_KEY as
unknown key and doesn't tries to access this in key_info.
Bug #42152: Race condition in lock_is_table_exclusive()
Detailed revision comments:
r4005 | marko | 2009-01-20 16:22:36 +0200 (Tue, 20 Jan 2009) | 8 lines
branches/5.1: lock_is_table_exclusive(): Acquire kernel_mutex before
accessing table->locks and release kernel_mutex before returning from
the function. This fixes a portential race condition in the
"commit every 10,000 rows" in ALTER TABLE, CREATE INDEX, DROP INDEX,
and OPTIMIZE TABLE. (Bug #42152)
rb://80 approved by Heikki Tuuri
Bug #41571: MySQL segfaults after innodb recovery
Detailed revision comments:
r4004 | marko | 2009-01-20 16:19:00 +0200 (Tue, 20 Jan 2009) | 12 lines
branches/5.1: Merge r4003 from branches/5.0:
rec_set_nth_field(): When the field already is SQL null,
do nothing when it is being changed to SQL null. (Bug #41571)
Normally, MySQL does not pass "do-nothing" updates to the storage engine.
When it does and a column of an InnoDB table that is in ROW_FORMAT=COMPACT
is being updated from NULL to NULL, the InnoDB buffer pool will be corrupted
without this fix.
rb://81 approved by Heikki Tuuri
Bug #42075: dict_load_indexes failure in dict_load_table will corrupt the dictionary cache
Detailed revision comments:
r3930 | marko | 2009-01-14 15:51:30 +0200 (Wed, 14 Jan 2009) | 4 lines
branches/5.1: dict_load_table(): If dict_load_indexes() fails,
invoke dict_table_remove_from_cache() instead of dict_mem_table_free(),
so that the data dictionary will not point to freed data.
(Bug #42075, Issue #153, rb://76 approved by Heikki Tuuri)
Bug #38187: Error 153 when creating savepoints
Detailed revision comments:
r3911 | sunny | 2009-01-13 14:15:24 +0200 (Tue, 13 Jan 2009) | 13 lines
branches/5.1: Fix Bug#38187 Error 153 when creating savepoints
InnoDB previously treated savepoints as a stack e.g.,
SAVEPOINT a;
SAVEPOINT b;
SAVEPOINT c;
SAVEPOINT b; <- This would delete b and c.
This fix changes the behavior to:
SAVEPOINT a;
SAVEPOINT b;
SAVEPOINT c;
SAVEPOINT b; <- Does not delete savepoint c
In the output message for --help entry for -H --HELP was missing.
Added this entry while printing the help text.
storage/myisam/myisamchk.c:
Added entry for -H --HELP while printing message for -? --help
The problem is that select queries executed concurrently with
a concurrent insert on a MyISAM table could be cached if the
select started after the query cache invalidation but before
the unlock of tables performed by the concurrent insert. This
race could happen because the concurrent insert was failing
to prevent cache of select queries happening at the same time.
The solution is to add a 'uncacheable' status flag to signal
that a concurrent insert is being performed on the table and
that queries executing at the same time shouldn't cache the
results.
mysql-test/r/query_cache_debug.result:
Add test case result for Bug#41098
mysql-test/t/disabled.def:
Re-enable test case.
mysql-test/t/query_cache_debug.test:
Add test case for Bug#41098
sql/sql_cache.cc:
Debug sync point for regression testing purposes.
sql/sql_insert.cc:
Remove meaningless query cache invalidate. There is already
a preceding invalidate for queries that started before the
concurrent insert.
storage/myisam/ha_myisam.cc:
Check for a active concurrent insert.
storage/myisam/mi_locking.c:
Signal the start of a concurrent insert. Flag is zeroed once
the state is updated back.
storage/myisam/myisamdef.h:
Add flag to signal a active concurrent insert.
mysql-test/t/variables.test:
Reset delay_key_write, otherwise maria.maria test may fail
sql/set_var.cc:
Reset ha_open_options if one resets the delay_key_write variable.
Before there was no way to reset it without restarting mysqld, which caused some tests to fail
Modify plugins.m4 configuration framework so that plugins which are
not built still get added to the source distribution during make dist.
This came up now because we can only build ibmdb2i on i5/OS, and we
can't bootstrap our source dist on that platform. The solution is to
specify DIST_SUBDIRS containing all plugins, separate from SUBDIRS
which contains the plugins which are actually built.
This ibmdb2i code is from the ibmdb2i-ga3-src.zip file, with a patch
to plug.in to disable the plugin if the PASE environment isn't available.
- 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
MyISAM did copy of key statistics incorrectly, which may cause
server crash or incorrect cardinality values. This may happen only on
platforms where size of long differs from size of pointer.
To determine number of bytes to be copied from array of ulong,
MyISAM mistakenly used sizoef(pointer) instead of sizeof(ulong).
There were so many changes into mtr (this is the new mtr coming) that I rather
copied mtr from 6.0-main here (at least this one knows how to run Maria tests).
I also fixed suite/maria tests to be accepted by the new mtr.
mysys/thr_mutex.c:
adding DBUG_PRINT here, so that we can locate where the warning is issued.
A Query in the MyISAM merge table was crashing
if the index merge algorithm was being used
Index Merge optimization requires the reading of
multiple indexes at the same time. Reading multiple
indexes at once with current SE API means that we
need to have handler instance for each to-be-read
index. This is done by creating clones of the handlers
instances. The clone internally does a open of the handler.
The open for a MERGE engine is handled in the following
phases
1) open parent table
2) generate list of underlying
table
3) attach underlying tables
But the current implementation does only the first
phase (i.e.) open parent table.
The current patch fixes this at the MERGE engine level,
by handling the clone operation within the MERGE engine
rather than in the storage engine API. It opens and
attaches the MyISAM tables on the MyISAM storage engine
interface directly within the MERGE engine. The new MyISAM
table instances, as well as the MERGE clone itself, are not
visible in the table cache. This is not a problem because
all locking is handled by the original MERGE table from which
this is cloned of.
mysql-test/r/merge.result:
updated the result file to reflect the new tests
added to test the fix
mysql-test/t/merge.test:
Added new tests to verify that the index merge
algorithm does not crash in the merge engine.
storage/myisammrg/ha_myisammrg.cc:
Implement the clone method, that handles
1) Cloning the handler
2) Opening underlying MYISAM child tables
3) Copies the state of the original handler and the children
into the cloned instances
4) Sets the appropriate flags
storage/myisammrg/ha_myisammrg.h:
Added a flag that is set to indicate that the current
instance is cloned. Also added the prototype or the clone
method.
storage/myisammrg/myrg_open.c:
Since we do now again use myrg_open() in the server
removed the comments marking this as deadcode.
Assert that keys don't point to bitmap pages.
storage/maria/ma_blockrec.h:
assertion
storage/maria/ma_locking.c:
With concurrent INSERTs, it is possible that two threads enter _ma_mark_file_changed()
at the same time, so they should serialize their access to the "changed" state/share
members; another reason is that this function may call _ma_update_state_lsns_sub()
which may call translog_deassign_id_from_share() (I saw it during testing of
online backup) which requires the intern_lock mutex.
As INSERTs only change from "not changed" to "changed", we can first check without mutex:
if it says "changed", some other thread has set or is setting the variables now,
we don't need to do it; if it says "not changed", we serialize and re-check.
Every subsequent query to a merge table with indexes was lowering
down cardinality.
The problem was that key statistics was not cleared when merge
children were detached. Causing next attach children perform
incremental key statistics calculation.
Fixed by clearing key statistics when attaching first child.
mysql-test/r/merge.result:
A test case for BUG#39185.
mysql-test/t/merge.test:
A test case for BUG#39185.
storage/myisammrg/myrg_open.c:
Clear key statistics when we're attaching first child, even
if it's buffer was allocated before. This is needed because
detach_children() doesn't clear statistics, causing incremental
statistics calculation.
code backported from 6.0
per-file messages:
include/my_global.h
Remove SC_MAXWIDTH. This is unused and irrelevant nowadays.
include/my_sys.h
Remove errbuf declaration and unused definitions.
mysys/my_error.c
Remove errbuf definition and move and adjust ERRMSGSIZE.
mysys/my_init.c
Declare buffer on the stack and use my_snprintf.
mysys/safemalloc.c
Use size explicitly. It's more than enough for the message at hand.
sql/sql_error.cc
Use size explicitly. It's more than enough for the message at hand.
sql/sql_parse.cc
Declare buffer on the stack. Use my_snprintf as it will result in
less stack space being used than by a system provided sprintf --
this allows us to put the buffer on the stack without causing much
trouble. Also, the use of errbuff here was not thread-safe as the
function can be entered concurrently from multiple threads.
sql/sql_table.cc
Use MYSQL_ERRMSG_SIZE. Extra space is not needed as my_snprintf will
nul terminate strings.
storage/myisam/ha_myisam.cc
Use MYSQL_ERRMSG_SIZE.
sql/share/errmsg.txt
Error message truncation in test "innodb" in embedded mode
filename in the error message can safely take up to 210 symbols.
There was a type casting problem in the storage/innobase/handler/ha_innodb.cc,
(int ha_innobase::write_row(...)). Innobase uses has an internal error variable
of type 'ulint' while mysql uses an 'int'.
To fix the problem the function manipulates an error variable of
type 'ulint' and only casts it into 'int' when needs to return the value.
storage/maria/ma_close.c:
Reset state_history when closing file.
This fixes a race condition when the checkpoint is using the file while the file is beeing closed.
The bug was that checkpoint was accessing the freed state_history.
- Added braces around expressions with &&, ||, & and |
- Added empty line before ; for empty while and for loops
- Added () around if with assignments
- Removed const before function returning simple type
Changed BUILD scripts to not build with NDB
BUILD/SETUP.sh:
By default, don't build ndb with --max in Maria tree.
NDB is not kept up to date anyway in 5.1
client/mysql.cc:
Added braces around && to get rid of compiler warnings
sql/event_db_repository.cc:
Added braces around && to get rid of compiler warnings
sql/events.cc:
Added braces around && to get rid of compiler warnings
sql/field.cc:
Added braces around && to get rid of compiler warnings
Fixed for loops
sql/field.h:
Added braces around & to get rid of compiler warnings
sql/field_conv.cc:
Added braces around && to get rid of compiler warnings
Fixed bug when copying between DATETIME fields and strict dates are used
Removed not needeed else
sql/gstream.cc:
Added braces around && to get rid of compiler warnings
sql/ha_ndbcluster.cc:
Added braces around && to get rid of compiler warnings
Added {} to get rid of compiler warnings
sql/handler.cc:
Added braces around && to get rid of compiler warnings
sql/item.cc:
Added braces around && to get rid of compiler warnings
sql/item_cmpfunc.cc:
Added braces around && to get rid of compiler warnings
Removed some not needed space
sql/item_func.cc:
Added braces around && to get rid of compiler warnings
sql/item_strfunc.cc:
Added braces around && to get rid of compiler warnings
sql/item_subselect.cc:
Added braces around && to get rid of compiler warnings
sql/item_sum.cc:
Added braces around && to get rid of compiler warnings
sql/item_timefunc.cc:
Added braces around && to get rid of compiler warnings
sql/item_xmlfunc.cc:
Added empty line before ; for empty while and for loops
sql/log.cc:
Added braces around && to get rid of compiler warnings
sql/log_event.cc:
Added braces around && to get rid of compiler warnings
Removed not needed else
sql/log_event_old.cc:
Added braces around && to get rid of compiler warnings
sql/opt_range.cc:
Added braces around && to get rid of compiler warnings
sql/opt_sum.cc:
Added braces around && to get rid of compiler warnings
sql/set_var.cc:
Added empty line before ; for empty while and for loops
Added () around if with assignments
sql/slave.cc:
Added braces around && to get rid of compiler warnings
Added empty line before ; for empty while and for loops
sql/spatial.h:
Added braces around && to get rid of compiler warnings
sql/sql_acl.cc:
Added braces around && to get rid of compiler warnings
sql/sql_analyse.cc:
Added empty line before ; for empty while and for loops
sql/sql_base.cc:
Added braces around && to get rid of compiler warnings
sql/sql_connect.cc:
Added braces around && to get rid of compiler warnings
sql/sql_db.cc:
Added braces around && to get rid of compiler warnings
sql/sql_delete.cc:
Added braces around && to get rid of compiler warnings
sql/sql_help.cc:
Added empty line before ; for empty while and for loops
sql/sql_insert.cc:
Added braces around && to get rid of compiler warnings
Added () around if with assignments
sql/sql_lex.cc:
Cast char array references to uchar; Fixed wrong array referencing when using characters > ASCII 128 in SQL statments
Added empty line before ; for empty while and for loops
Trivial indent fixes
Added braces around && to get rid of compiler warnings
sql/sql_load.cc:
Added braces around && to get rid of compiler warnings
sql/sql_parse.cc:
Added braces around && to get rid of compiler warnings
sql/sql_partition.cc:
Added braces around && to get rid of compiler warnings
sql/sql_plugin.cc:
Fixed bug in detecing if option variable should be readonly
Added empty line before ; for empty while and for loops
sql/sql_prepare.cc:
Added braces around && to get rid of compiler warnings
sql/sql_select.cc:
Added braces around && to get rid of compiler warnings
Added () around if with assignments
Added empty line before ; for empty while and for loops
sql/sql_show.cc:
Added braces around && to get rid of compiler warnings
sql/sql_table.cc:
Added braces around && to get rid of compiler warnings
sql/sql_trigger.cc:
Added braces around && to get rid of compiler warnings
sql/sql_update.cc:
Added braces around && to get rid of compiler warnings
sql/sql_yacc.yy:
Added braces around && to get rid of compiler warnings
sql/table.cc:
Added braces around && to get rid of compiler warnings
sql/table.h:
Added braces around && to get rid of compiler warnings
sql/time.cc:
Added braces around && to get rid of compiler warnings
sql/tztime.cc:
Added braces around && to get rid of compiler warnings
sql/uniques.cc:
Added braces around && to get rid of compiler warnings
storage/federated/ha_federated.cc:
Fixed bug in testing of variable to ha_info() (Not critical)
storage/heap/ha_heap.cc:
Added braces around && to get rid of compiler warnings
storage/maria/ha_maria.cc:
Fixed bug: Mark that maria_log_dir_path is readonly
Added braces around && to get rid of compiler warnings
storage/ndb/include/ndbapi/NdbEventOperation.hpp:
Removed const before function returning simple type
storage/ndb/include/ndbapi/NdbOperation.hpp:
Removed const before function returning simple type
storage/ndb/src/ndbapi/Ndb.cpp:
Added empty line before ; for empty while and for loops
storage/ndb/src/ndbapi/NdbEventOperation.cpp:
Removed const before function returning simple type
storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp:
Removed const before function returning simple type
storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp:
Removed const before function returning simple type
storage/ndb/src/ndbapi/NdbRecAttr.cpp:
Added empty line before ; for empty while and for loops
storage/ndb/src/ndbapi/TransporterFacade.hpp:
Added braces around && to get rid of compiler warnings
myisam_repair_threads > 1 causes crash
Problem: parallel repair (myisam_repair_threads > 1) of a myisam
table with two or more fulltext keys that use the same parser may
lead to a server crash. ALTER TABLE ENABLE KEYS is affected as well.
Fix: properly initialize fulltext structures for parallel repair.
Note: 1. there's no deterministic test case.
2. now we call parser->init() for each fulltext key
(not for each fulltext parser used).
storage/myisam/ft_parser.c:
Fix for bug #37756: enabling fulltext indexes with
myisam_repair_threads > 1 causes crash
In ftparser_call_initializer() we "group" parsers
and allocate parameters for each unique parser used.
In case of parallel repairing we may have a bunch
of parsers that use the only MI_INFO structure.
Each of these parsers must have its own parameter
structure in order not to interfere with others.
Moreover, the allocation is done without mutex
lock so parallel ftparser_call_initializer() calls
are unsafe.
Now we don't "group" the fulltext parsers.
Parameter allocation code moved to ftparser_alloc_param()
function which is called from mi_repair_parallel() as well
to allocate parameters for each parser used.
storage/myisam/ftdefs.h:
Fix for bug #37756: enabling fulltext indexes with
myisam_repair_threads > 1 causes crash
ftparser_alloc_param(MI_INFO *info) added.
storage/myisam/mi_check.c:
Fix for bug #37756: enabling fulltext indexes with
myisam_repair_threads > 1 causes crash
ftparser_alloc_param(info) called in case of parallel
repair to allocate fulltext parser parameters.
storage/myisam/mi_open.c:
Fix for bug #37756: enabling fulltext indexes with
myisam_repair_threads > 1 causes crash
set keyinfo->ftkey_nr and share->ftkeys.
conflicts:
Text conflict in client/mysqltest.cc
Text conflict in mysql-test/include/wait_until_connected_again.inc
Text conflict in mysql-test/lib/mtr_report.pm
Text conflict in mysql-test/mysql-test-run.pl
Text conflict in mysql-test/r/events_bugs.result
Text conflict in mysql-test/r/log_state.result
Text conflict in mysql-test/r/myisam_data_pointer_size_func.result
Text conflict in mysql-test/r/mysqlcheck.result
Text conflict in mysql-test/r/query_cache.result
Text conflict in mysql-test/r/status.result
Text conflict in mysql-test/suite/binlog/r/binlog_index.result
Text conflict in mysql-test/suite/binlog/r/binlog_innodb.result
Text conflict in mysql-test/suite/rpl/r/rpl_packet.result
Text conflict in mysql-test/suite/rpl/t/rpl_packet.test
Text conflict in mysql-test/t/disabled.def
Text conflict in mysql-test/t/events_bugs.test
Text conflict in mysql-test/t/log_state.test
Text conflict in mysql-test/t/myisam_data_pointer_size_func.test
Text conflict in mysql-test/t/mysqlcheck.test
Text conflict in mysql-test/t/query_cache.test
Text conflict in mysql-test/t/rpl_init_slave_func.test
Text conflict in mysql-test/t/status.test
mysql-test/suite/maria/r/maria-recovery3.result:
result update
mysql-test/suite/maria/t/maria-recovery3.test:
Test for BUG#42112; before the bugfix, recovery would assert like this:
ma_blockrec.c:6051: _ma_apply_redo_insert_row_head_or_tail: Assertion `rownr == 0 && new_page' failed.
storage/maria/ma_create.c:
Fix for BUG#42112; plus some intentional crashes to test the fix. The bug was that if crash happened during
TRUNCATE TABLE, in maria_create(), after the index file's state has been written but before its LSNs
have been updated (so, if crash happened between _ma_state_info_write_sub() and _ma_update_state__lsns_sub()),
then that would leave a table with create_rename_lsn==0. Recovery would then try old pre-TRUNCATE REDOs
on this table, and fail as this table is already partly shortened. Fix is to write create_rename_lsn==LSN_MAX
as soon as TRUNCATE touches the index file, so that Recovery ignores this table. This allows Maria to start;
the table is still corrupted but the user can successfully repeat TRUNCATE TABLE (which required Maria to start).
storage/maria/ma_delete_all.c:
A comment.
sql/sql_insert.cc:
Removed DBUG_ASSERT() that is triggered by deadlock-innodb test
storage/maria/ma_loghandler.c:
Removed compiler warnings
storage/maria/trnman_public.h:
Fixed wrong code from last push
Added DBUG_ASSERT() to unlikely error senario
Don't use errno == 0 in maria_create() / myisam_create()
sql/sql_insert.cc:
Added DBUG_ASSERT() for case that should never happen in real life
Added my_error() to avoid assert if mysql_lock() or postlock() doesn't call my_error()
storage/maria/ha_maria.cc:
Log queries to maria_log if compiled with EXTRA_DEBUG
storage/maria/ma_create.c:
Don't use errno == 0
storage/maria/ma_loghandler.c:
Added logging of debug info to maria_log
storage/maria/ma_loghandler.h:
Added logging of debug info to maria_log
storage/maria/ma_recovery.c:
Added printing of debug info from maria_log
storage/maria/trnman.c:
Added functions to read/store state in TRN
storage/maria/trnman.h:
Added functions to read/store state in TRN
storage/maria/trnman_public.h:
Added state in TRN to remmeber if we have already logged the query
storage/myisam/mi_create.c:
Don't use errno == 0
include/atomic/generic-msvc.h:
prevent possible compiler warnings
include/lf.h:
comments, better definition for LF_HASH_OVERHEAD
include/maria.h:
define MARIA_CANNOT_ROLLBACK here
include/my_pthread.h:
avoid possible name clash
include/waiting_threads.h:
comments, const, move WT_RESOURCE to waiting_threads.c
mysql-test/suite/maria/r/maria_notembedded.result:
new test
mysql-test/suite/maria/t/maria_notembedded.test:
new test - 5-way deadlock
mysys/lf_hash.c:
better definition for LF_HASH_OVERHEAD
mysys/my_static.c:
comment
mysys/my_thr_init.c:
casts
mysys/waiting_threads.c:
comments, asserts, etc
server-tools/instance-manager/parse.cc:
fix my_init_dynamic_array() to follow new calling conventions
sql/mysqld.cc:
call wt_init after set_proper_floating_point_mode
sql/sql_class.h:
comment
storage/maria/ha_maria.cc:
move MARIA_CANNOT_ROLLBACK to a common header
storage/maria/ma_commit.c:
comment
storage/maria/ma_write.c:
comments, check for HA_ERR_FOUND_DUPP_KEY
storage/maria/trnman.c:
comments, assert
storage/maria/trnman.h:
comments
storage/maria/unittest/trnman-t.c:
be paranoid
unittest/mysys/lf-t.c:
comments
unittest/mysys/waiting_threads-t.c:
comments, safety, memory leak
output related to this.
mysql-test/suite/maria/r/maria-recovery3.result:
result update
mysql-test/suite/maria/t/maria-recovery3.test:
Test for bug; before the fix, the "CHECK TABLE EXTENDED" would mention a bad bitmap, because the
REDO_INSERT_ROW_BLOBS was containing a page number which was actually the one of a tail, so execution of this
record would mark the tail page as full in bitmap (like if it were a blob page), though it wasn't full.
Also, the assertion added around ma_blockrec.c:6580 in the present revision fired.
storage/maria/ma_blockrec.c:
- fix for BUG#41493: if we found out that logging was not needed at this point (blob_length==0 i.e. tail page),
then we forgot to increment tmp_block, so in the second iteration (assuming two BLOB columns), we would log the
page range of the first iteration (i.e. the tail page's number) for this second BLOB, which would cause
Recovery to overwrite the tail page with the second BLOB.
- assert when marking the table corrupted during REDO phase; this catches some problems earlier
otherwise they get caught only when a later record wants to use the table.
- _ma_apply_redo_insert_row_blobs() now fills some synthetic info about the blobs and pages involved
in a REDO_INSERT_ROW_BLOBS record, for inclusion into maria_recovery.trace: number of blobs, of ranges,
first and last page (does not tell about any gaps in the middle, but good enough for now). It also asserts
that it's not overwriting a tail/head page (which happened in the bug).
storage/maria/ma_blockrec.h:
new prototype for _ma_apply_redo_insert_row_blobs
storage/maria/ma_recovery.c:
Print info got from _ma_apply_redo_insert_row_blobs() to maria_recovery.trace (so far this file had mentioned
what head and tail pages a record touched, but not blob pages).
Detailed description of changes:
r3601 | marko | 2008-12-22 16:05:19 +0200 (Mon, 22 Dec 2008) | 9 lines
branches/5.1: Make
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED
a true replacement of SET GLOBAL INNODB_LOCKS_UNSAFE_FOR_BINLOG=1.
This fixes an error that was introduced in r370, causing
semi-consistent read not to not unlock rows in READ UNCOMMITTED mode.
(Bug #41671, Issue #146)
rb://67 approved by Heikki Tuuri
Detailed description of changes:
r3590 | marko | 2008-12-18 15:33:36 +0200 (Thu, 18 Dec 2008) | 11 lines
branches/5.1: When converting a record to MySQL format, copy the default
column values for columns that are SQL NULL. This addresses failures in
row-based replication (Bug #39648).
row_prebuilt_t: Add default_rec, for the default values of the columns in
MySQL format.
row_sel_store_mysql_rec(): Use prebuilt->default_rec instead of
padding columns.
rb://64 approved by Heikki Tuuri
Detailed description of changes:
r3588 | inaam | 2008-12-18 14:26:54 +0200 (Thu, 18 Dec 2008) | 8 lines
branches/5.1
It is a bug in unused code. If we don't calculate the hash value when
calculating the mutex number then two pages which map to same hash
value can get two different mutex numbers.
Approved by: Marko
Detailed description of changes:
r3412 | vasil | 2008-12-05 10:46:18 +0200 (Fri, 05 Dec 2008) | 7 lines
branches/5.1:
Add the traditional 2 spaces after the timestamp so the message does
not look like:
070223 13:26:01InnoDB: Warning: canno....
Detailed description of changes:
r3257 | inaam | 2008-11-24 22:06:50 +0200 (Mon, 24 Nov 2008) | 13 lines
branches/5.1 bug#40760
The config param innodb_thread_concurrency is dynamically set and is
read when a thread enters/exits innodb. If the value is changed between
the enter and exit time the behaviour becomes erratic.
The fix is not to use srv_thread_concurrency when exiting, instead use
the flag trx->declared_to_be_inside_innodb.
rb://57
Approved by: Marko
Detailed description of changes:
r2981 | marko | 2008-11-07 14:54:10 +0200 (Fri, 07 Nov 2008) | 6 lines
branches/5.1: row_mysql_store_col_in_innobase_format(): Correct a misleading
comment. In the UTF-8 encoding, ASCII takes 1 byte per character, while
the "latin1" character set (normally ISO-8859-1, but in MySQL it actually
refers to the Windows Code Page 1252 a.k.a. CP1252, WinLatin1)
takes 1 to 3 bytes (1 to 2 bytes for the ISO-8859-1 subset).
r3114 | calvin | 2008-11-14 20:31:48 +0200 (Fri, 14 Nov 2008) | 8 lines
branches/5.1: fix bug#40386: Not flushing query cache after truncate
ha_statistics.records can not be 0 unless the table is empty, set to
1 instead. The original problem of bug 29507 is fixed in the server.
Additional test was done with the fix of bug 29507 in the server.
Approved by: Heikki (on IM)
Detailed description of changes:
r2929 | marko | 2008-10-29 21:26:14 +0200 (Wed, 29 Oct 2008) | 13 lines
branches/5.1: dtype_get_sql_null_size(): return the correct storage
size of a SQL NULL column. (Bug #40369)
When MySQL Bug #20877 was fixed in r834, this function was
accidentally modified to return 0 or 1. Apparently, the only impact of
this bug is that fixed-length columns cannot be updated in-place from
or to SQL NULL, even in ROW_FORMAT=REDUNDANT. After this fix,
fixed-length columns in ROW_FORMAT=REDUNDANT will have a constant
storage size as they should, no matter if NULL or non-NULL. The bug
caused fixed-length NULL columns to occupy 1 byte.
rb://37 approved by Heikki over IM.
Detailed description of changes:
r2902 | vasil | 2008-10-28 12:10:25 +0200 (Tue, 28 Oct 2008) | 10 lines
branches/5.1:
Fix Bug#38189 innodb_stats_on_metadata missing
Make the variable innodb_stats_on_metadata visible to the users and
also settable at runtime. Previously it was only "visible" as a command
line startup option to mysqld.
Approved by: Marko (https://svn.innodb.com/rb/r/36)
storage/maria/CMakeLists.txt:
Added files of service thread framework.
storage/maria/Makefile.am:
Added files of service thread framework.
storage/maria/ma_checkpoint.c:
Separated service thread framework.
storage/maria/ma_servicethread.c:
Added files of service thread framework.
storage/maria/ma_servicethread.h:
Added files of service thread framework.
Bounds-checks and blocksize corrections were applied to user-input,
but constants in the server were trusted implicitly. If these values
did not actually meet the requirements, the user could not set change
a variable, then set it back to the (wonky) factory default or maximum
by explicitly specifying it (SET <var>=<value> vs SET <var>=DEFAULT).
Now checks also apply to the server's presets. Wonky values and maxima
get corrected at startup. Consequently all non-offsetted values the user
sees are valid, and users can set the variable to that exact value if
they so desire.
mysql-test/r/read_buffer_size_basic.result:
test sets out of bounds value; we now throw a warning for this.
This is a side-effect: before, the maximum was higher than the
value we set here. The value was corrected to block-size, the
maximum was not, hence the value was smaller than the maximum
in this particular case. Now that we align the maxima at startup,
the value in SET is larger than the (corrected) maximum, and we
see a warning in this particular case. "This means we're doing it right."
mysql-test/r/read_rnd_buffer_size_basic.result:
test sets out of bounds value; we now throw a warning for this.
This is a side-effect: before, the maximum was higher than the
value we set here. The value was corrected to block-size, the
maximum was not, hence the value was smaller than the maximum
in this particular case. Now that we align the maxima at startup,
the value in SET is larger than the (corrected) maximum, and we
see a warning in this particular case. "This means we're doing it right."
mysys/my_getopt.c:
Do bounds-checking at start-up time so we'll catch and correct
wonky default values and upper limits.
sql/mysqld.cc:
If 0 is a legal value per the docs, not to mention the default, we shouldn't give 1 as
the lower limit.
storage/innobase/handler/ha_innodb.cc:
We are setting upper bounds here.
~0L gives -1. That is NOT what we want!
- Removed not needed casts
- Indentation fixes
- Changed some buffer variables to uchar, to be able to remove casts
storage/maria/ma_bitmap.c:
Removed not needed casts
storage/maria/ma_blockrec.c:
Removed not needed casts
storage/maria/ma_check.c:
Removed not needed casts.
Changed type of buffers to be able to remove casts
storage/maria/ma_create.c:
Removed not needed casts
storage/maria/ma_delete.c:
Removed not needed casts
storage/maria/ma_dynrec.c:
Removed not needed casts
storage/maria/ma_extra.c:
Removed not needed casts
storage/maria/ma_ft_boolean_search.c:
Removed not needed casts
storage/maria/ma_ft_nlq_search.c:
Removed not needed casts
storage/maria/ma_ft_parser.c:
Removed not needed casts
storage/maria/ma_loghandler.c:
Removed not needed casts
storage/maria/ma_open.c:
Removed not needed casts
storage/maria/ma_packrec.c:
Removed not needed casts
storage/maria/ma_pagecache.c:
Removed not needed casts
storage/maria/ma_preload.c:
Removed not needed casts
Removed not needed initialization
storage/maria/ma_rnext_same.c:
Removed not needed casts
storage/maria/ma_rt_index.c:
Removed not needed casts
storage/maria/ma_search.c:
Removed not needed casts
storage/maria/ma_sort.c:
Removed not needed casts
Removed not needed if
Fixed indentation
storage/maria/ma_statrec.c:
Removed not needed casts
storage/maria/ma_test2.c:
Removed not needed casts
storage/maria/ma_write.c:
Removed not needed casts
Indentation fixes
storage/maria/maria_chk.c:
Removed not needed casts
storage/maria/maria_pack.c:
Removed not needed casts
Bug #41962 Maria: view-related test failures (insert, view, maria, trigger tests)
Added error handling for wrong update of view.
See Bug #41760 Inserting into multiple-table views is not working
mysql-test/r/delayed.result:
Fixed test as we are now testing values before fields.
Added new tests to test all error combinations
mysql-test/suite/maria/r/maria.result:
Added error handling for not supported update of view.
mysql-test/suite/maria/t/maria.test:
Added error handling for not supported update of view.
mysql-test/t/delayed.test:
Fixed test as we are now testing values before fields.
Added new tests to test all error combinations
sql/sql_base.cc:
Fixed warning from valgrind
sql/sql_insert.cc:
Don't test from which table values are in case of INSERT ... SELECT
Run fix_fields() in values before we do it on fields.
This is needed becasue check_view_single_update() are accessing values.
storage/maria/ma_blockrec.c:
Don't call pagecache_delete_pages() if no pages to delete.
This fixes a DBUG_ASSERT() error in maria_test_recovery
storage/maria/ma_key_recover.c:
Takes intern_lock before writing CLR_END of bulk insert.
Added debug info about writing trigger.
Check of mutex taken in _ma_state_info_write() where we need it.
The problem: data file can not be deleted on win because
there is another opened instance of this file.
Data file might be opened twice, on table opening stage and
during write_row execution. We need to close both instances
to satisfy Win.
mysql-test/r/csv.result:
test result
mysql-test/t/csv.test:
test case
storage/csv/ha_tina.cc:
The problem: data file can not be deleted on win because
there is another opened instance of this file.
Data file might be opened twice, on table opening stage and
during write_row execution. We need to close both instances
to satisfy Win.
Added code to detect and give error when doing an insert into a view where we accessed fields in a not yet read table
Disabled test in subselect.test as the CHECK_OPTION for views doesn't work for insert.
This needs to be fixed properly later.
The problem with views are described in Bug #41760 Inserting into multiple-table views is not working
mysql-test/r/insert.result:
Fixed wrong usage of insert into view.
mysql-test/r/subselect.result:
Disabled wrong test (temporary)
mysql-test/suite/maria/r/maria.result:
Added test of size of table
mysql-test/suite/maria/t/maria.test:
Added test of size of table
mysql-test/t/insert.test:
Fixed wrong usage of insert into view
The bug is that during insert/update we currently don't read any of the referenced tables of the view.
This means that we can't get a value from another table to use as part of the update.
mysql-test/t/subselect.test:
Disabled not working test until someone has time to fix insert into view properly
Here we where refering to last used value in t2, which is wrong.
sql/sql_insert.cc:
Detect if we are trying to update one table in a view based on value in another, not yet read, table.
This fixes the problem discovered in insert.test
storage/maria/ma_blockrec.c:
Don't ignore not critical changes to the last page in the table.
We need to write the last page as otherwise we can during aborting of a row with a duplicate key get
state.data_file_length and the real length of file out of sync
storage/maria/ma_check.c:
Flush the page cache even if we got an error during zerofill.
(This fixes a call to assert() in case of a too short data file)
storage/maria/ma_pagecache.c:
Mark page as read when we do a write of a full page.
This fixes a bug when we got an error during read and then used direct write to page to update it
storage/maria/ma_state.c:
Restore info->lock.type after call to maria_versioning.
Fixed crash in maria_recover.test
storage/maria/maria_read_log.c:
Don't write thread id in debug log. (Not needed as maria_read_log is a single treaded program)
Fixed bug when removing a newly inserted record (in case of duplicate key).
The bug caused a crash for rows with several blobs and the first blob was small enough to fit into the head page.
Don't change state_history if nothing changed (speed optimization that also simplifies logic).
Reset state_history if we added/deleted or updated rows without versioning.
Fixed wrong test in trnman_exists_active_transactions() if state is visible or not.
Other bugs fixed:
Fixed wrong argument to (lock->get_status) when we had to wait for TL_WRITE_CONCURRENT_INSERT.
Item_equal::update_used_tables() didn't calculate const_item_cache properly.
Added assert's to detect if join_read_const_table() was called under wrong assumptions..
Fixed that _ma_setup_live_state() is called from thr_lock() instead of handler::external_lock().
This was needed to get versioning information to be setup correctly.
Fixed error in debug binaries during a call to _ma_check_table_is_closed() when another thread was opening/closing a table.
Fixed wrong test when finding right history_state to use.
mysql-test/suite/maria/r/maria.result:
Added test for Bug#40311 Assert in MARIA_RECORD_POS during pushbuild 2 test
mysql-test/suite/maria/t/maria.test:
Added test for Bug#40311 Assert in MARIA_RECORD_POS during pushbuild 2 test
mysys/thr_lock.c:
Fixed wrong argument to (lock->get_status) when we had to wait for TL_WRITE_CONCURRENT_INSERT
sql/item_cmpfunc.cc:
Item_equal::update_used_tables() didn't calculate const_item_cache properly, which later caused a wrong result for item->const_item()
sql/sql_base.cc:
In debug mode, Initilize record buffer with unexpected data to catch usage of uninitialized memory
sql/sql_select.cc:
Fixed indentation
Added assert's to detect if join_read_const_table() was called under wrong assumptions.
One assert() is disabled for now as Item_equal() doesn't behave as expected.
storage/maria/ha_maria.cc:
Move calling to _ma_setup_live_state() to ma_state.c::_ma_block_get_status()
This was needed as _ma_setup_live_state() needed to know if the table will be used concurrently or not
storage/maria/ma_blockrec.c:
Fixed bug when removing a newly inserted record (in case of duplicate key).
The bug caused a crash for rows with several blobs and the first blob was small enough to fit into the head page.
storage/maria/ma_dbug.c:
Added mutex to protect the open table list during _ma_check_table_is_closed().
Without the protection we could get a error in debug binaries during a call to _ma_check_table_is_closed()
storage/maria/ma_delete_table.c:
Removed not used code
storage/maria/ma_rename.c:
Removed not used code
storage/maria/ma_state.c:
Fixed wrong test when finding right history_state to use
Mark in tables->state_current.no_transid if we are using transid's or not.
Don't change state_history if nothing changed (speed optimization that also simplifies logic)
Reset state_history if we added/deleted or updated rows without versioning.
More DBUG_ASSERT's and more DBUG
Updated maria_versioning() to initialize environment before calling _ma_blok_get_status(). This was needed because of the new logic in _ma_block_get_status()
storage/maria/ma_state.h:
Added flags to detect if table changed and/or if we changed table without versioning
storage/maria/ma_write.c:
Simple cleanups (No logic changes)
storage/maria/trnman.c:
Fixed wrong test in trnman_exists_active_transactions() if state is visible or not.
Related to operator precedence and associativity.
Make the expressions as explicit as possible.
sql/field.h:
Silence gcc-4.3 warning: be more explicit.
sql/item.cc:
Silence gcc-4.3 warning: be more explicit.
sql/item_sum.cc:
Silence gcc-4.3 warning: be more explicit.
sql/log_event.cc:
Silence gcc-4.3 warning: be more explicit.
sql/spatial.h:
Silence gcc-4.3 warning: be more explicit.
sql/sql_lex.cc:
Silence gcc-4.3 warning: be more explicit.
sql/table.h:
Silence gcc-4.3 warning: be more explicit.
storage/federated/ha_federated.cc:
Fix operator precedence bug.
storage/heap/ha_heap.cc:
Silence gcc-4.3 warning: be more explicit.
Bug #39830: Table autoinc value not updated on first insert.
Bug #35498: Cannot get table test/table1 auto-inccounter value in ::info
Bug #36411: Failed to read auto-increment value from storage engine" in 5.1.24 auto-inc
Detailed revision comments:
r2854 | sunny | 2008-10-23 08:30:32 +0300 (Thu, 23 Oct 2008) | 13 lines
branches/5.1: Backport changes from branches/zip r2725
Simplify the autoinc initialization code. This removes the
non-determinism related to reading the table's autoinc value for the first
time. This change has also reduced the sizeof dict_table_t by sizeof(ibool)
bytes because we don't need the dict_table_t::autoinc_inited field anymore.
rb://16
Bug #37788: InnoDB Plugin: AUTO_INCREMENT wrong for compressed tables
(Note, this bug is not only in the plugin, the overflow checks are relevant
for MySQL's InnoDB as well.)
Detailed revision comments:
r2852 | sunny | 2008-10-23 01:42:24 +0300 (Thu, 23 Oct 2008) | 9 lines
branches/5.1: Backport r2724 from branches/zip
Check column value against the col max value before updating the table's
global autoinc counter value. This is part of simplifying the AUTOINC
sub-system. We extract the type info from MySQL data structures at runtime.
Bug #40224: New AUTOINC changes mask reporting of deadlock/timeout errors
Detailed revision comments:
r2849 | sunny | 2008-10-22 12:01:18 +0300 (Wed, 22 Oct 2008) | 8 lines
branches/5.1: Return the actual error code encountered when allocating
a new autoinc value. The change in behavior (bug) was introduced in 5.1.22
when we introduced the new AUTOINC locking model.
rb://31
A follow-up to fix for bug #39438. This moves some errro messages from the
server error log to the client, to make it easier for users (especially in
shared hosting environment) to get info about why their statement is failing.
Detailed revision comments:
r2832 | vasil | 2008-10-21 10:08:30 +0300 (Tue, 21 Oct 2008) | 10 lines
branches/5.1:
In ha_innobase::info():
Replace sql_print_warning() which prints to mysqld error log with
push_warning_printf() which sends the error message to the client.
Suggested by: Marko, Sunny, Michael
Objected by: Inaam
Detailed revision comments:
r2826 | vasil | 2008-10-20 14:09:01 +0300 (Mon, 20 Oct 2008) | 5 lines
branches/5.1:
Non-functional change: use a single tab instead of 12 spaces between
variable type and variable name.
Fix memory handling to avoid possible crash during error printout. (Code
review, no associated bug.)
Detailed revision comments:
r2782 | marko | 2008-10-13 14:21:02 +0300 (Mon, 13 Oct 2008) | 5 lines
branches/5.1: Backport a fix from branches/zip r2763:
row_drop_database_for_mysql(): Postpone mem_free(table_name), so that
an error printout will not dereference freed memory.
Detailed revision comments:
r2744 | marko | 2008-10-09 10:53:09 +0300 (Thu, 09 Oct 2008) | 5 lines
branches/5.1: ha_innobase::delete_all_rows(): In response to a user asking
<http://forums.innodb.com/read.php?4,215,215> why DELETE FROM t is not
mapped to TRUNCATE TABLE t as it is in MyISAM, note in a comment that
DELETE is transactional while TRUNCATE is not.
Bug #39939: DROP TABLE/DISCARD TABLESPACE takes long time in buf_LRU_invalidate_tablespace()
Detailed revision comments:
r2742 | inaam | 2008-10-08 22:02:15 +0300 (Wed, 08 Oct 2008) | 11 lines
branches/5.1:
Improve implementation of buf_LRU_invalidate_tablespace by attempting
hash index drop in batches instead of doing it one by one.
Reviewed by: Heikki, Sunny, Marko
Approved by: Heikki
A follow-up fix for Bug 38839, which exposed a pre-existing bug in the
autoinc handling.
Detailed revision comments:
r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines
branches/5.1: This bug has always existed but was masked by other errors. The
fix for bug# 38839 triggered this bug. When the offset and increment are > 1
we need to calculate the next value taking into consideration the two
variables. Previously we simply assumed they were 1 particularly offset was
never used. MySQL does its own calculation and that's probably why it seemed
to work in the past. We would return what we thought was the correct next
value and then MySQL would recalculate the actual value from that and return
it to the caller (e.g., handler::write_row()). Several new tests have been
added that try and catch some edge cases. The tests exposed a wrap around
error in MySQL next value calculation which was filed as bug 39828. The tests
will need to be updated once MySQL fix that bug.
One good side effect of this fix is that dict_table_t size has been
reduced by 8 bytes because we have moved the autoinc_increment field to
the row_prebuilt_t structure. See review-board for a detailed discussion.
rb://3
Send error message to the client when a rollback occurs when trying to get an
autoincrement value. This is related to the fixes for Bug#36411 and
Bug#35498.
Detailed revision comments:
r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines
branches/5.1: We need to send the messages to the client because
handler::get_auto_increment() doesn't allow a way to return the
specific error for why it failed.
rb://18
A follow-up to the previous patch, fix for Bug #39438.
r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines
branches/5.1:
Print a warning if an attempt is made to get the free space for a table
whose .ibd file is missing or the tablespace has been discarded. This is a
followup to r2719.
Suggested by: Inaam
Bug #39438: Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch
Detailed revision comments:
r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines
branches/5.1:
Fix Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch
In ha_innobase::info() - do not try to get the free space for a tablespace
which has been discarded with ALTER TABLE ... DISCARD TABLESPACE or if the
.ibd file is missing for some other reason.
ibd_file_missing and tablespace_discarded are manipulated only in
row_discard_tablespace_for_mysql() and in row_import_tablespace_for_mysql()
and the manipulation is protected/surrounded by
row_mysql_lock_data_dictionary()/row_mysql_unlock_data_dictionary() thus we
do the same in ha_innobase::info() when checking the values of those members
to avoid race conditions. I have tested the code-path with UNIV_DEBUG and
UNIV_SYNC_DEBUG.
rb://20
Reviewed by: Inaam, Calvin
Approved by: Heikki
Bug#38231: Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK
branches/5.1:
Fix Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK
In TRUNCATE TABLE and discard tablespace: do not remove table-level S
and X locks and do not assert on such locks not being wait locks.
Leave such locks alone.
Approved by: Heikki (rb://14)
Bug #35498: Cannot get table test/table1 auto-inccounter value in ::info
Detailed revison comments:
r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines
branches/5.1: Since handler::get_auto_increment() doesn't allow us
to return the cause of failure we have to inform MySQL using the
sql_print_warning() function to return the cause for autoinc failure.
Previously we simply printed the error code, this patch prints the
text string representing the following two error codes:
DB_LOCK_WAIT_TIMEOUT
DB_DEADLOCK.
Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info
Approved by Marko.
Bug #39483: InnoDB hang on adaptive hash because of out of order ::open() call by MySQL
Detailed revision comments:
r2630 | inaam | 2008-09-16 19:11:26 +0300 (Tue, 16 Sep 2008) | 11 lines
branches/5.1 bug#39483 InnoDB hang on adaptive hash because of out
of order ::open() call by MySQL
Forward port of r2629
Under some conditions MySQL calls ::open with search_latch leading
to a deadlock as we try to acquire dict_sys->mutex inside ::open
breaking the latching order. The fix is to release search_latch.
Reviewed by: Heikki
Bug #38839: auto increment does not work properly with InnoDB after update
Detailed revision comments:
r2609 | sunny | 2008-08-24 01:19:05 +0300 (Sun, 24 Aug 2008) | 12 lines
branches/5.1: Fix for MySQL Bug#38839. Reset the statement level last
value field in prebuilt. This field tracks the last value in an autoincrement
interval. We use this value to check whether we need to update a table's
AUTOINC counter, if the value written to a table is less than this value
then we avoid updating the table's AUTOINC value in order to reduce
mutex contention. If it's not reset (e.g., after a DELETE statement) then
there is the possibility of missing updates to the table's AUTOINC counter
resulting in a subsequent duplicate row error message under certain
conditions (see the test case for details).
Bug #38839 - auto increment does not work properly with InnoDB after update
Bug #37885: row_search_for_mysql may gap lock unnecessarily with SQL comments in query
Detailed revision comments:
r2603 | marko | 2008-08-21 16:25:05 +0300 (Thu, 21 Aug 2008) | 10 lines
branches/5.1: Identify SELECT statements by thd_sql_command() == SQLCOM_SELECT
instead of parsing the query string. This fixes MySQL Bug #37885 without
us having to implement lexical analysis of SQL comments in yet another place.
thd_is_select(): A new predicate.
row_search_for_mysql(): Use thd_is_select().
Approved by Heikki.
Fix race condition which could result in freeing a struct that is
still in use by another thread.
Detailed revision comments:
r2537 | inaam | 2008-07-15 20:46:03 +0300 (Tue, 15 Jul 2008) | 12 lines
branches/5.1 issue# 4
Fixed a timing hole where a thread dropping an index can free the
in-memory index struct while another thread is still using
that structure to remove entries from adaptive hash index belonging
to one of the pages that belongs to the index being dropped.
The fix is to have a reference counter in the index struct and to
wait for this counter to drop to zero beforing freeing the struct.
Reviewed by: Heikki
r2543 | inaam | 2008-07-22 18:57:43 +0300 (Tue, 22 Jul 2008) | 7 lines
branches/5.1:
Removed UNIV_INLINE qualifier from btr_search_info_get_ref_count().
Otherwise compilation failed on non-debug builds.
Pointed by: Vasil
Bug #36149: Read buffer overflow in srv0start.c found during "make test"
Detailed revision comments:
r2485 | vasil | 2008-05-28 16:01:14 +0300 (Wed, 28 May 2008) | 9 lines
branches/5.1:
Fix Bug#36149 Read buffer overflow in srv0start.c found during "make test"
Use strncmp(3) instead of memcmp(3) to avoid reading past end of the string
if it is empty (*str == '\0'). This bug is _not_ a buffer overflow.
Discussed with: Sunny (via IM)
Bug #36819: ut_usectime does not handle errors from gettimeofday
Detailed revision comments:
r2480 | vasil | 2008-05-27 11:40:07 +0300 (Tue, 27 May 2008) | 11 lines
branches/5.1:
Fix Bug#36819 ut_usectime does not handle errors from gettimeofday
by retrying gettimeofday() several times if it fails in ut_usectime().
If it fails on all calls then return error to the caller to be handled
at higher level.
Update the variable innodb_row_lock_time_max in SHOW STATUS output only
if ut_usectime() was successful.
Bug #11894: innodb_file_per_table crashes w/ Windows .sym symbolic link hack
Detailed revision comments:
r2466 | calvin | 2008-05-20 01:37:14 +0300 (Tue, 20 May 2008) | 12 lines
branches/5.1:
Fix Bug#11894 innodb_file_per_table crashes w/ Windows .sym symbolic
link hack
The crash was due to un-handled error 3 (path not found). In the case
of file per table, change the call to os_file_handle_error_no_exit()
from os_file_handle_error(). Also, checks for full path pattern during
table create (Windows only), which is used in symbolic link and temp
table creation.
Approved by: Heikki
Changes to plug.in structure, some INNODB_CFLAGS improvements for better
maintenance, and some comments and whitespace changes.
Detailed revision comments:
r2433 | vasil | 2008-04-30 12:02:35 +0300 (Wed, 30 Apr 2008) | 5 lines
branches/5.1:
Add vim modeline to hint it that plug.in is a config file
so it can be colorized.
r2429 | vasil | 2008-04-30 11:19:06 +0300 (Wed, 30 Apr 2008) | 10 lines
branches/5.1:
* Use INNODB_CFLAGS insead of cluttering CFLAGS with InnoDB specific
flags. CFLAGS are used to compile every file in the MySQL source tree.
* Add INNODB_DYNAMIC_CFLAGS to the flags of the dynamic plugin and use
-prefer-non-pic to make the dynamic plugin faster on i386.
Approved by: Sunny
r2430 | vasil | 2008-04-30 11:48:35 +0300 (Wed, 30 Apr 2008) | 8 lines
branches/5.1:
Use CFLAGS instead of INNODB_CFLAGS to avoid having incompatible flags
inserted in CFLAGS and INNODB_CFLAGS and to avoid compiling mysql and
innodb with different flags.
Discussed with: Sunny
r2431 | vasil | 2008-04-30 11:54:49 +0300 (Wed, 30 Apr 2008) | 4 lines
branches/5.1:
Fix r2430, it should be CFLAGS="$CFLAGS ..." not CFLAGS="..."
r2432 | vasil | 2008-04-30 11:58:38 +0300 (Wed, 30 Apr 2008) | 4 lines
branches/5.1:
Non-functional change: use tabs for indentation in plug.in.
r2436 | vasil | 2008-04-30 19:15:46 +0300 (Wed, 30 Apr 2008) | 7 lines
branches/5.1:
Non-functional white space change in Makefile.am:
Use tabs for indentation and be consistent about spaces around the
equal sign.
Bug #36169: create innodb compressed table with too large row size crashed
Revision comments:
r2422 | vasil | 2008-04-24 16:00:30 +0300 (Thu, 24 Apr 2008) | 11 lines
branches/5.1:
Fix Bug#36169 create innodb compressed table with too large row size crashed
Sometimes it is possible that
row_drop_table_for_mysql(index->table_name, trx, FALSE); is invoked in
row_create_index_for_mysql() when the index object is freed so copy the
table name to a safe place beforehand and use the copy.
Approved by: Sunny
Bug #35537: Innodb doesn't increment handler_update and handler_delete
Detailed revision comments:
r2388 | vasil | 2008-03-27 14:02:34 +0200 (Thu, 27 Mar 2008) | 7 lines
branches/5.1:
Swap the order in which mysql_thd, mysql_query_str and *mysql_query_str
are checked for non-NULL.
Suggested by: Marko
r2421 | calvin | 2008-04-24 15:32:30 +0300 (Thu, 24 Apr 2008) | 6 lines
branches/5.1: Fix bug#35537 - Innodb doesn't increment handler_update
and handler_delete
Add the calls to ha_statistic_increment() in ha_innobase::delete_row()
and ha_innobase::update_row().
Remove warnings from test logs about depricated options
mysql-test/t/events_logs_tests-master.opt:
Remove warnings from test logs about depricated options
mysql-test/t/log_tables-big-master.opt:
Remove warnings from test logs about depricated options
mysql-test/t/log_tables-master.opt:
Remove warnings from test logs about depricated options
mysql-test/t/multi_statement-master.opt:
Remove warnings from test logs about depricated options
mysql-test/t/ps-master.opt:
Remove warnings from test logs about depricated options
mysql-test/t/show_check-master.opt:
Remove warnings from test logs about depricated options
mysql-test/t/slow_query_log_file_basic-master.opt:
Remove warnings from test logs about depricated options
mysql-test/t/slow_query_log_file_func-master.opt:
Remove warnings from test logs about depricated options
mysql-test/t/union-master.opt:
Remove warnings from test logs about depricated options
sql/mysqld.cc:
Don't give warnings for empty log file names
No testcase (concurrency, tested by pushbuild2).
storage/maria/ha_maria.cc:
a comment about what Sanja had discovered a while ago
storage/maria/ma_bitmap.c:
guard against concurrent flush of bitmap by checkpoint: we must have close_lock here
storage/maria/ma_blockrec.c:
comment fixed for new behaviour
storage/maria/ma_checkpoint.c:
Release intern_lock before flushing bitmap, or it deadlocks with allocate_and_write_block_record()
when that function needs to increase the data file's length (that function makes bitmap non flushable,
then wants intern_lock to increase data_file_length).
The checkpoint section which looks at the share's content (bitmap, state) needs to be protected from the possible
my_free-ing done by a concurrent maria_close(); intern_lock is not enough as
both maria_close() and checkpoint now have to release it in the middle.
So the protection is done with close_lock. in_checkpoint is now protected by close_lock
in places where it was protected by intern_lock.
storage/maria/ma_close.c:
hold close_lock in maria_close() from start to end, to guard against checkpoint trying to flush
bitmap while we have my_free'd its structures, for example. intern_lock was not enough as
both maria_close() and checkpoint have to release it in the middle, to avoid deadlocks.
storage/maria/ma_open.c:
initialize new mutex
storage/maria/ma_recovery.c:
a comment about what Sanja had discovered a while ago
storage/maria/maria_def.h:
comment.
new mutex protecting the close of a MARIA_SHARE, from _start_ to _end_ of it.
(BUG#40981 Maria: deadlock between checkpoint and maria_close() when freeing state info)
storage/maria/ma_checkpoint.c:
The argument added to the function to use it in maria_close().
storage/maria/ma_close.c:
Locking/unlocking MARIA_SHARE::intern_lock added to use correct order of the mutexes taking.
storage/maria/ma_state.c:
Removed assert becase now we have externally locked mutex in maria_close().
The argument added to the _ma_remove_not_visible_states_with_lock() to use it in maria_close().
_ma_remove_not_visible_states_with_lock() fixed tio be usable from maria_chk where transaction manager is not initialized.
storage/maria/ma_state.h:
The argument added to the function to use it in maria_close().
storage/maria/maria_def.h:
Fixed comment to the variable.
storage/maria/trnman.c:
The debugging assert added.
New function to detect transaction manager initialization added (maria_chk do not initialize it).
storage/maria/trnman_public.h:
New function to detect transaction manager initialization added (maria_chk do not initialize it).
mysql-test/mysql-test-run.pl:
Remove warnings in log about depricated mysqld options
storage/maria/ma_state.c:
More DBUG_PRINT
storage/maria/trnman.c:
Fixed wrong test if commit_trid is visible
storage/maria/ma_loghandler.c:
Number of the buffer now passed to buffer initialization function to assign buffer number and break false alarm "chain" by switching off deadlock detection for one buffer.
mysql-test/suite/maria/r/maria-recovery3.result:
result.
mysql-test/suite/maria/t/maria-recovery3-master.opt:
usual recovery test options
mysql-test/suite/maria/t/maria-recovery3.test:
Test for BUG#41037. Without the bugfix, the test would hang because Recovery would fail with "undo_key_insert got error 126": Recovery would believe INSERT of 2 is uncommitted, try to execute its UNDO_KEY_INSERT, fail to find the key to delete because DELETE deleted it. That failure of _ma_ck_real_delete() would mark table as corrupted (see
in d_search()) which is error 126 (HA_ERR_CRASHED).
storage/maria/ma_blockrec.c:
set trn->rec_lsn to LSN of commit record, when writing it.
storage/maria/ma_blockrec.h:
new function
storage/maria/ma_commit.c:
when committing or rolling back, rec_lsn should be LSN_IMPOSSIBLE: assertion is moved here
from trnman_end_trn(), because now ma_commit() can set rec_lsn and so when we reach trnman_end_trn()
it's not LSN_IMPOSSIBLE anymore.
Adding debug possibility to pause between COMMIT record write and trnman_commit_trn(), to be
able to fire checkpoint in between.
storage/maria/ma_loghandler.c:
in-write hook for COMMIT records
storage/maria/ma_recovery.c:
More debugging info in maria_recovery.trace, to see how the starting point of REDO phase is determined
storage/maria/trnman.c:
assertion cannot be here anymore see ma_commit.c
bug#41023 maria: Server asserts in sysbench OLTP_RO test
bug#40888 maria: Server crashes in sysbench OLTP_RW test at lf_alloc-pin.c:513
bug#40892 maria: Livelock in sysbench OLTP_RW test
bug#40895 maria: Server crashes in sysbench OLTP_RO test at lf_alloc-pin.c:367
bug#40890 maria: Server crashes in sysbench OLTP_RW test at ctype-bin.c:8
Yet another strict aliasing issue
storage/innobase/handler/ha_innodb.cc:
Fixing Valgrind error: deadlock detector was set to random. Making the recently added lines closer
to the InnoDB style (tabs not spaces)
This writes a warning on stderr if one uses mutex in different order,
like if one in one case would lock mutex in the order A,B and in another case
would lock mutex in the order B,A
This is inspired by and loosely based on the LOCKDEP patch by Jonas
Wrong mutex order is either fixed or mutex are marked with MYF_NO_DEADLOCK_DETECTION
if used inconsistently (need to be fixed by server team)
KNOWN_BUGS.txt:
Added information that one need to dump and restore Maria tables
include/hash.h:
Added prototype function for walking over all elements in a hash
include/my_pthread.h:
Added my_pthread_mutex_init() and my_pthread_mutex_lock(); These should be used if one wants to disable mutex order checking.
Changed names of the nonposix mutex_init functions to not conflict with my_phread_mutex_init()
Added and extended structures for mutex deadlock detection.
New arguments to sage_mutex_init() and safe_mutex_lock() to allow one to disable mutex order checking.
Added variable 'safe_mutex_deadlock_detector' to enable/disable deadlock detection for all pthread_mutex_init()
mysys/Makefile.am:
Added cleaning of test files
Added test_thr_mutex
mysys/hash.c:
Added hash_iterate() to iterate over all elements in a hash
More comments
mysys/my_init.c:
Added calls to destory all mutex uses by mysys()
Added waiting for threads to end before calling TERMINATE() to list not freed memory
mysys/my_pthread.c:
Changed names to free my_pthread_mutex_init() for mutex-lock-order-checking
mysys/my_sleep.c:
Fixed too long wait if using 1000000L as argument
mysys/my_thr_init.c:
Mark THR_LOCK_threads and THR_LOCK_malloc to not have mutex deadlock detection.
(We can't have it enabled for this as these are internal mutex used by the detector
Call my_thread_init() early as we need thread specific variables enabled for the following pthread_mutex_init()
Move code to wait for threads to end to my_wait_for_other_threads_to_die()
Don't destroy mutex and conditions unless all threads have died
Added my_thread_destroy_mutex() to destroy all mutex used by the mysys thread system
Name the thread specific mutex as "mysys_var->mutex"
Added my_thread_var_mutex_in_use() to return pointer to mutex in use or 0 if thread variables are not initialized
mysys/mysys_priv.h:
Added prototypes for functions used internally with mutex-wrong-usage detection
mysys/thr_mutex.c:
Added runtime detection of mutex used in conflicting order
See WL#3262 or test_thr_mutex.c for examples
The base idea is for each mutex have two hashes:
- mutex->locked_mutex points to all mutex used after this one
- mutex->used_mutex points to all mutex which has this mutex in it's mutex->locked_mutex
There is a wrong mutex order if any mutex currently locked before this mutex is in the mutex->locked_mutex hash
sql/event_queue.cc:
Mark mutex used inconsistently (need to be fixed by server team)
sql/event_scheduler.cc:
Declare the right order to take the mutex
sql/events.cc:
Mark mutex used inconsistently (need to be fixed by server team)
sql/ha_ndbcluster_binlog.cc:
Mark mutex used inconsistently (need to be fixed by server team)
sql/log.cc:
Mark mutex used inconsistently (need to be fixed by server team)
sql/mysqld.cc:
Use pthread_mutex_trylock instead of pthread_mutex_unlock() when sending kill signal to thread
This is needed to avoid wrong mutex order as normally one takes 'current_mutex' before mysys_var->mutex.
Added call to free sp cache.
Add destruction of LOCK_server_started and COND_server_started.
Added register_mutex_order() function to register in which order mutex should be taken
(to initiailize mutex_deadlock_detector).
Added option to turn off safe_mutex_deadlock_detector
sql/protocol.cc:
Fixed wrong argument to DBUG_PRINT (found by valgrind)
sql/rpl_mi.cc:
Mark mutex used inconsistently (need to be fixed by server team)
sql/set_var.cc:
Remove wrong locking of LOCK_global_system_variables when reading and setting log variables
(would cause inconsistent mutex order).
Update global variables outside of logger.unlock() as LOCK_global_system_variables has to be taken before logger locks
Reviewed by gluh
sql/sp_cache.cc:
Added function to destroy mutex used by sp cache
sql/sp_cache.h:
Added function to destroy mutex used by sp cache
sql/sql_class.cc:
Use pthread_mutex_trylock instead of pthread_mutex_unlock() when sending kill signal to thread
This is needed to avoid wrong mutex order as normally one takes 'current_mutex' before mysys_var->mutex.
Register order in which LOCK_delete and mysys_var->mutex is taken
sql/sql_insert.cc:
Give a name for Delayed_insert::mutex
Mark mutex used inconsistently (need to be fixed by server team)
Move closing of tables outside of di->mutex (to avoid wrong mutex order)
sql/sql_show.cc:
Don't keep LOCK_global_system_variables locked over value->show_type() as this leads to wrong mutex order
storage/innobase/handler/ha_innodb.cc:
Disable safe_muted_deadlock_detector for innobase intern mutex (to speed up page cache initialization)
storage/maria/ha_maria.cc:
Added flag to ha_maria::info() to signal if we need to lock table share or not.
This is needed to avoid locking mutex in wrong order
storage/maria/ha_maria.h:
Added flag to ha_maria::info() to signal if we need to lock table share or not.
storage/maria/ma_close.c:
Destroy key_del_lock
Simplify freeing ftparser_param
storage/maria/ma_key.c:
Better comment
storage/maria/ma_loghandler.c:
Mark mutex used inconsistently (need to be fixed by sanja)
storage/maria/ma_state.c:
More comments
storage/maria/ma_test1.c:
Ensure that safe_mutex_deadlock_detector is always on (should be, this is just for safety)
storage/maria/ma_test2.c:
Ensure that safe_mutex_deadlock_detector is always on (should be, this is just for safety)
mysqlslap: fix a crash when mysql_store_result() fails
client/mysqlslap.c:
fix a crash
dbug/dbug.c:
only do safemalloc checks if a function is selected
mysql-test/mysql-test-run.pl:
it's easier to add new gdb parameters this way
storage/maria/ma_open.c:
typo in a comment
(BUG#41127: Maria: assertion when SHOW ENGINE MARIA LOGS and missing logs)
mysql-test/suite/maria/r/maria_showlog_error.result:
test suite for the BUG#41127
mysql-test/suite/maria/t/maria_showlog_error.test:
test suite for the BUG#41127
storage/maria/ha_maria.cc:
Do not use MY_WME in the stat call which errors we process on high level.
mysql-test/t/partition.test
sql/ha_partition.cc
Bug#40954: Crash in MyISAM index code with concurrency test using partitioned tables
Problem was usage of read_range_first with an empty key.
Solution was to not to give a key if it was empty. (real author Mattias Jonsson)
storage/archive/archive_reader.c
client/mysqlslap.c
Aligned the copyright texts output from "--version" of tools, to
let internal tools be able to change them if needed.
storage/ndb/test/tools/connect.cpp
storage/ndb/test/run-test/atrt.hpp
Corrected a few GPL headers not restricted to GPL version 2
Makefile.am
Added missing --report-features to the 'test-bt-fast' target
support-files/mysql.spec.sh
Reversed the removal of the "%define license GPL" in as internal
tools depended on it
Scenario of the BUG#40731 ("Maria: hang (probably in page cache) under concurrency"):
T1: Disable logging for the table
T1: Start inserting into the table
T2: Tries to lock the table so waits.
T2: Tries unlock and relock during the process see that the table has disabled logging and reenables it
T1: Got DBUG_ASSERT because suddenly start use table with transaction switched on which is not expected during bulk insert
storage/maria/ma_pagecache.c:
Page type print added for debugging purposes.
storage/maria/ma_recovery.c:
Check that it was this thred which switched off logging (transactional mode).
storage/maria/maria_def.h:
Flag for controling which thread switched off transactiona mode for the table added.
mmap is slower that caching indeed.
Here the problem is that mmap is used even if --myisam-use-mmap=OFF
solved by checking the flag in ha_myisam::extra() as it is called in
init_read_record()
per-file comments:
storage/myisam/ha_myisam.cc
Bug#40634 table scan temporary table is 4x slower due to mmap instead instead of caching
do nothing for HA_EXTRA_MMAP if no opt_myisam_use_mmap
storage/maria/trnman.c:
During Maria's checkpoint, we walk the list of active transactions; in this list we may find a transaction with a short_id of 0 which means "uninitialized" (is being created right now) and want to ignore this transaction. Such short_id is set under trn->state_lock, so use this mutex to reliably read short_id during checkpoint.