Commit graph

3904 commits

Author SHA1 Message Date
unknown
db020fb30f Merge Toby Thain's Solaris fixes. 2009-05-11 17:31:30 +02:00
Toby Thain
13c45ccbd3 Portability changes for Solaris 10 (amd64). Re-hash BUILD/ scripts for Solaris to be more in line with generic scripts. 2009-05-09 00:01:53 -04:00
unknown
b125770aaa We are now using Valgrind rather than purify, and have for quite some time.
Consequently, rename HAVE_purify to HAVE_valgrind, and related changes.
Leave some comments about purify when not clear that they apply also to Valgrind.
Fix redundant IF_VALGRIND declaration.

Misc. small fixes:
 - Fixes for pool-of-threads patch.
 - Fixes for push of PBXT storage engine.
 - mysql-test-run.pl fix.
 - Fix build problem in compile-pentium64-max.


BUILD/SETUP.sh:
  Rename purify -> valgrind.
BUILD/build_mccge.sh:
  Rename purify -> valgrind.
BUILD/compile-dist:
  Fix that PBXT was missing in source tarball after `BUILD/compile-dist && make dist`
BUILD/compile-pentium64-max:
  Fix a build problem with BUILD/compile-pentium64-max on CentOS/Fedora Core 10 amd64.
        
  On these systems, there is libz.so but no libz.a. Finding libz.so, ./configure decides
  to use system zlib. But since BUILD/compile-pentium64-max builds a fully static binary
  with -all-static, the link of mysqld fails due to missing libz.a.
        
  Fix by using bundled zlib in the build script.
BUILD/compile-solaris-sparc-purify:
  Rename purify -> valgrind.
include/m_string.h:
  Rename purify -> valgrind.
include/my_global.h:
  Rename purify -> valgrind.
mysql-test/Makefile.am:
  Fix that PBXT test suite was missing from `make dist` source tarball.
mysql-test/lib/mtr_unique.pm:
  Better fix to avoid races when chmod'ing the semaphore file.
  (Though using chmod 666 shared files in /tmp/ is still not a very good solution).
mysql-test/t/pool_of_threads.cnf:
  Fix that test case pool_of_threads fails if run on mysqld with no --with-libevent support.
mysys/mf_qsort.c:
  Rename purify -> valgrind.
mysys/my_alloc.c:
  Rename purify -> valgrind.
mysys/my_init.c:
  Rename purify -> valgrind.
mysys/my_rnd.c:
  Rename purify -> valgrind.
mysys/safemalloc.c:
  Rename purify -> valgrind.
scripts/mysql_config.pl.in:
  Rename purify -> valgrind.
scripts/mysql_config.sh:
  Rename purify -> valgrind.
sql/field_conv.cc:
  Rename purify -> valgrind.
sql/filesort.cc:
  Rename purify -> valgrind.
sql/ha_partition.cc:
  Rename purify -> valgrind.
sql/hostname.cc:
  Rename purify -> valgrind.
sql/item_timefunc.cc:
  Rename purify -> valgrind.
sql/log_event.cc:
  Rename purify -> valgrind.
sql/log_event_old.cc:
  Rename purify -> valgrind.
sql/my_decimal.h:
  Rename purify -> valgrind.
sql/mysqld.cc:
  Rename purify -> valgrind.
  Fix redundant IF_VALGRIND declaration.
sql/opt_range.cc:
  Rename purify -> valgrind.
sql/opt_range.h:
  Rename purify -> valgrind.
sql/records.cc:
  Rename purify -> valgrind.
sql/rpl_rli.cc:
  Rename purify -> valgrind.
sql/rpl_rli.h:
  Rename purify -> valgrind.
sql/set_var.cc:
  Fix missing static declaration on pool_of_threads.
sql/slave.cc:
  Rename purify -> valgrind.
sql/sql_base.cc:
  Rename purify -> valgrind.
sql/sql_binlog.cc:
  Rename purify -> valgrind.
sql/sql_class.cc:
  Rename purify -> valgrind.
sql/sql_list.h:
  Rename purify -> valgrind.
sql/sql_load.cc:
  Rename purify -> valgrind.
sql/sql_select.cc:
  Rename purify -> valgrind.
sql/table.cc:
  Rename purify -> valgrind.
storage/archive/azio.c:
  Rename purify -> valgrind.
storage/innobase/buf/buf0buf.c:
  Rename purify -> valgrind.
storage/innobase/include/univ.i:
  Rename purify -> valgrind.
storage/innobase/srv/srv0start.c:
  Rename purify -> valgrind.
storage/maria/ha_maria.cc:
  Rename purify -> valgrind.
storage/maria/ma_blockrec.c:
  Rename purify -> valgrind.
storage/maria/ma_check.c:
  Rename purify -> valgrind.
storage/maria/ma_loghandler.c:
  Rename purify -> valgrind.
storage/maria/ma_packrec.c:
  Rename purify -> valgrind.
storage/maria/ma_page.c:
  Rename purify -> valgrind.
storage/maria/ma_pagecrc.c:
  Rename purify -> valgrind.
storage/maria/ma_search.c:
  Rename purify -> valgrind.
storage/myisam/mi_check.c:
  Rename purify -> valgrind.
storage/myisam/mi_page.c:
  Rename purify -> valgrind.
storage/myisam/mi_search.c:
  Rename purify -> valgrind.
storage/myisammrg/ha_myisammrg.cc:
  Rename purify -> valgrind.
strings/bcmp.c:
  Rename purify -> valgrind.
strings/decimal.c:
  Rename purify -> valgrind.
strings/strmake.c:
  Rename purify -> valgrind.
2009-05-06 14:03:24 +02:00
Jim Winstead
3636eab703 Merge with 5.1-bugteam. 2009-05-05 10:29:01 -07:00
Narayanan V
fdce101978 Bug#44232 Error msg should be improved when collation not supported.
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.
2009-05-05 15:03:52 +05:30
Sergey Vojtovich
6a43ad1d53 Merge to 5.1-bugteam. 2009-04-30 19:41:43 +05:00
Georgi Kodinov
9a50874dba merged 5.1-main to 5.1-bugteam 2009-04-30 16:42:38 +03:00
Narayanan V
bb668b284d merging with mysql-5.1-bugteam 2009-04-30 18:22:48 +05:30
Narayanan V
db83fda90d BUG#37631 - Incorrect key file for table after upgrading from 5.0 to 5.1
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)
2009-04-30 18:16:49 +05:30
Satya B
a5badbfe6d Fix for BUG#40827 - Killing insert-select to MyISAM can cause table corruption
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.
2009-04-30 12:40:12 +05:30
Martin Hansson
4ba05b50a2 merge 2009-04-29 20:52:37 +02:00
Martin Hansson
45cbd32697 Bug#43737: Select query return bad result
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.
2009-04-29 14:00:34 +02:00
Narayanan V
70f53b1a65 Bug#44337 Select query using index merge fails with MCH3601
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
2009-04-29 16:51:14 +05:30
Alexey Botchkov
0e88c80580 merging 2009-04-29 07:59:10 +05:00
Jim Winstead
3e0214b8c6 Add missing newline to usage message of ndb_print_backup_file (Bug #34989) 2009-04-28 11:21:47 -07:00
Michael Widenius
e726e587ec Merged with mysql-5.1 tree.
client/mysqltest.cc:
  Manually merged
configure.in:
  Manually merged
mysql-test/r/variables.result:
  Manually merged
mysql-test/t/variables.test:
  Manually merged
mysys/my_pread.c:
  Manually merged
mysys/my_read.c:
  Manually merged
sql/mysqld.cc:
  Manually merged
storage/csv/ha_tina.h:
  Manually merged
storage/myisam/ha_myisam.cc:
  Manually merged
storage/myisam/mi_check.c:
  Manually merged
storage/myisam/mi_search.c:
  Manually merged
2009-04-25 13:05:32 +03:00
Michael Widenius
210a412522 bzr merge from guilhem's maria tree to our local 5.1
configure.in:
  Manually merged
mysql-test/lib/My/ConfigFactory.pm:
  Manually merged
mysql-test/mysql-test-run.pl:
  Manually merged
mysql-test/t/information_schema.test:
  Manually merged
sql/handler.cc:
  Manually merged
support-files/mysql.spec.sh:
  Manually merged
2009-04-25 12:04:38 +03:00
Sergey Vojtovich
509a9cee1c BUG#42907 - Multi-term boolean fulltext query containing a
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.
2009-04-23 16:24:08 +05:00
Satya B
3cac98cb93 Applying InnoDB snashot 5.1-ss3603. Fixes BUG#27276
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.
2009-04-20 12:57:41 +05:30
Satya B
24146bb2ab BUG#40827 - Killing insert-select to MyISAM can cause table corruption
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.
2009-04-16 17:02:56 +05:30
Staale Smedseng
3bea588ca1 Merge from 5.0-bugteam 2009-04-16 11:47:21 +02:00
Satya B
c470d5e46e Applying InnoDB snashot 5.1-ss4699, part 3. Fixes BUG#43660
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)
2009-04-15 18:11:54 +05:30
Satya B
58c33f5514 Applying InnoDB snashot 5.1-ss4699, part 1. Fixes BUG#39320 and other
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.
2009-04-15 17:16:08 +05:30
Narayanan V
2187c60bf4 merging with mysql-5.1-bugteam 2009-04-13 17:05:40 +05:30
Narayanan V
097262a85b merging with mysql-5.1-bugteam tree 2009-04-13 16:51:24 +05:30
Narayanan V
f286444bd5 Bug#44025 Some schema names longer than 8 characters not supported by IBMDB2I
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.
2009-04-10 13:18:07 +05:30
Narayanan V
63e2b7dd08 Bug#44022 CREATE TABLE sometimes fails silently for IBMDB2I engine
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.
2009-04-10 13:01:15 +05:30
Narayanan V
ee64a8d4f0 Bug#44020 Unicode Swedish collations not working with IBMDB2I
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.
2009-04-10 11:56:54 +05:30
Narayanan V
cce39fe8cf merging with mysql-5.1-bugteam tree 2009-04-09 14:04:34 +05:30
Narayanan V
53f8922307 Bug#38848 myisam_use_mmap causes widespread myisam corruption on windows
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.
2009-04-09 13:48:23 +05:30
Anurag Shekhar
b1b8ab5159 merging with 5.0 bugteam tree 2009-04-09 13:36:47 +05:30
unknown
83290da1e6 Merge mariadb-5.1 2009-04-08 18:59:24 +02:00
unknown
c558b3e068 Fix Valgrind errors seen in buildbot.
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.
2009-04-08 18:55:26 +02:00
Michael Widenius
21a195dd0d Merge with trunc (no conflicts) 2009-04-08 11:55:19 +03:00
Michael Widenius
92b2b45e4f Updated comment 2009-04-08 11:47:30 +03:00
Narayanan V
92aee5a6c6 Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1
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.
2009-04-08 12:25:19 +05:30
Satya B
440858b816 merge to latest 5.1-bugteam 2009-04-07 18:44:37 +05:30
Satya B
543abcd48e merge 5.0-bugteam to 5.1-bugteam 2009-04-07 17:06:15 +05:30
Satya B
58fa483a20 merge 5.0-bugteam to 5.1-bugteam 2009-04-06 12:31:17 +05:30
unknown
cce577ebd4 5.1 -> 5.2 merge 2009-04-03 12:23:26 +03:00
Paul McCullagh
823d0cdae0 Fixed references 2009-04-02 22:36:52 +02:00
Paul McCullagh
e5e979cb3a Handle create table error correctly 2009-04-02 13:49:57 +02:00
Paul McCullagh
5f513d0941 Added the PBXT test suite 2009-04-02 12:03:14 +02:00
MySQL Build Team
d434e1269b Add new headers to noinst_HEADERS (ibmdb2i storage engine) 2009-04-01 22:18:49 +02:00
Ignacio Galarza
4a9461f7af Bug#29248 - MyISAMchk & MyISAMpack failing with * wildcard on Windows platform
- Link against setargv.obj for wild-card expansion.
2009-04-01 12:03:45 -04:00
Georgi Kodinov
3346c5c9d3 merged 5.1-main -> 5.1-bugteam 2009-04-01 12:57:34 +03:00
Guilhem Bichot
c71aae73f6 merge of 5.1-main into 5.1-maria. MyISAM changes are propagated to Maria except
those of davi.arnaut@sun.com-20090219210935-9vilvcisyyieffxl (TODO).
2009-04-01 11:34:52 +02:00
Paul McCullagh
e1e48d82d4 Corrected automake 2009-04-01 08:40:11 +02:00
Ignacio Galarza
b334dd443a Bug#29248 MyISAMchk & MyISAMpack failing with * wildcard on Windows platform 2009-03-31 18:17:42 -04:00
Sergey Glukhov
d9a9f5c71f fixed archive test. It might be OOM error on boxes with low amount of memory.
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
2009-03-26 18:27:34 +04:00
Paul McCullagh
a61584ad84 Added PBXT storage engine 2009-03-26 13:18:01 +01:00
Satya B
c084645ca0 merge 5.0-bugteam to 5.1-bugteam 2009-03-25 15:43:49 +05:30
Sergey Glukhov
ae3f8c7eab compiler warning fix 2009-03-24 13:02:01 +04:00
Georgi Kodinov
e8cc09dc8d fixed compilation warnings. addendum to the fix for bug 29125 2009-03-20 16:27:53 +02:00
Ignacio Galarza
868db2f21d auto-merge 2009-03-19 09:59:10 -04:00
Ignacio Galarza
0d588edf61 auto-merge 2009-03-17 16:29:24 -04:00
unknown
36252821b3 Fixed bug of waiting for flush pass end.
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).
2009-03-17 21:05:01 +02:00
Satya B
1367981c66 merge to 5.1-bugteam branch 2009-03-18 12:39:44 +05:30
Satya B
497db6ac0f Fix for BUG#32880 - Repairing Archive table fails with internal error 144
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
2009-03-18 11:16:21 +05:30
Timothy Smith
8cbd34f0d7 Applying InnoDB snashot 5.1-ss4350, part 5. Fixes
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
2009-03-11 18:18:44 -06:00
Timothy Smith
08ee9470a9 Applying InnoDB snashot 5.1-ss4350, part 4. Fixes
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.
2009-03-11 18:17:53 -06:00
Timothy Smith
7ae516e1ca Applying InnoDB snashot 5.1-ss4350, part 3. No functional changes.
Detailed revision comments:

r4165 | calvin | 2009-02-12 01:34:27 +0200 (Thu, 12 Feb 2009) | 1 line
branches/5.1: minor non-functional changes.
2009-03-11 18:16:53 -06:00
Timothy Smith
a33a51e2a8 Applying InnoDB snashot 5.1-ss4350, part 2. Fixes
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.
2009-03-11 18:15:46 -06:00
Timothy Smith
50851796a5 Applying InnoDB snashot 5.1-ss4350, part 1. Fixes
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
2009-03-11 18:14:24 -06:00
Guilhem Bichot
b0fcbc84ef merge of 5.1-main into 5.1-maria; MyISAM changes are also ported to Maria. 2009-03-11 16:32:42 +01:00
Sergey Vojtovich
2b87788517 Merge 5.1-ibmdb2isee to 5.1-bugteam. 2009-03-10 16:27:53 +04:00
Timothy Smith
a5216560d0 Import the ibmdb2i-ga4-src snapshot from IBM 2009-03-09 15:20:14 -06:00
Anurag Shekhar
9540d3017e fixing warning during compilation. 2009-03-09 15:03:02 +05:30
Guilhem Bichot
a15d25f07e In maria_recovery.trace we can see the Query which generated this record, but this printed too much
(query is not 0-terminated in the log record): limit it to the true query's size.
2009-03-05 17:47:31 +01:00
Guilhem Bichot
8a715a5990 Fix for BUG#42180 "Maria: maria-recovery-bitmap.test fails repeatedly"
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.
2009-03-05 14:46:45 +01:00
Anurag Shekhar
aa13f72b90 Bug#41305 server crashes when inserting duplicate row into a merge table
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.
2009-03-04 14:48:07 +05:30
Timothy Smith
17c0218a18 Applying InnoDB snashot 5.1-ss4007, part 2. Fixes
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
2009-03-02 18:10:37 -07:00
Timothy Smith
d2e4204a1e Applying InnoDB snashot 5.1-ss4007, part 1. Fixes
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
2009-03-02 18:09:35 -07:00
Timothy Smith
39a4ab6ce3 Applying InnoDB snashot 5.1-ss3931, part 2. Fixes
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)
2009-03-02 18:08:02 -07:00
Timothy Smith
20b1c21bf0 Applying InnoDB snashot 5.1-ss3931, part 1. Fixes
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
2009-03-02 18:06:44 -07:00
Anurag Shekhar
da3c773166 Bug #38103 myisamchk: --help output incomplete
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
2009-02-24 20:44:47 +05:30
Alexey Botchkov
e641a297b0 merging. 2009-02-24 15:34:00 +04:00
Alexey Botchkov
5a7d6382bf merging. 2009-02-24 15:17:50 +04:00
Anurag Shekhar
e6babb70a6 merging with changes in bugteam branch. 2009-02-23 15:39:08 +05:30
Davi Arnaut
664bb23a30 Bug#41098: Query Cache returns wrong result with concurrent insert
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.
2009-02-19 18:09:35 -03:00
Michael Widenius
945fa0d913 Merge with mysql-maria tree
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
2009-02-19 11:01:25 +02:00
Michael Widenius
a8fdaa6f2c Merge with base MySQL 5.1
Contains fixes for test cases
Changed release tag to beta

configure.in:
  change release tag to beta
2009-02-15 12:58:34 +02:00
Timothy Smith
338aefcb38 Add the IBM DB2 for i storage engine.
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.
2009-02-15 03:18:30 +01:00
Ignacio Galarza
5b7347bda3 Bug#29125 Windows Server X64: so many compiler warnings
- Remove bothersome warning messages.  This change focuses on the warnings 
that are covered by the ignore file: support-files/compiler_warnings.supp.
- Strings are guaranteed to be max uint in length
2009-02-13 11:41:47 -05:00
Anurag Shekhar
39bf734088 Bug#40321 ha_myisam::info could update rec_per_key incorrectly
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).
2009-02-13 17:11:54 +05:30
Guilhem Bichot
998b4ae52d Merge of MyISAM changes done in 5.1-main, into Maria 2009-02-12 18:51:00 +01:00
Guilhem Bichot
704b4845aa merge of 5.1-main into 5.1-maria. Myisam->Maria change propagation will follow.
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.
2009-02-12 15:08:56 +01:00
Sergey Vojtovich
984c2489d1 Merge 5.1-bugteam -> 5.1-bugteam (local). 2009-02-12 14:25:12 +04:00
V Narayanan
e80537b791 Bug#40675 MySQL 5.1 crash with index merge algorithm and Merge tables
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.
2009-02-12 16:42:07 +05:30
Guilhem Bichot
9653feb160 Callers of translog_deassign_id_from_share() need intern_lock.
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.
2009-02-09 22:52:42 +01:00
Guilhem Bichot
554eb6c2cf Comments. Take bitmap mutex lock when changing bitmap.changed.
storage/maria/ha_maria.cc:
  comment
storage/maria/ma_checkpoint.c:
  comment
storage/maria/ma_extra.c:
  use bitmap mutex when changing bitmap.changed, sounds safer
storage/maria/ma_pagecache.c:
  comment
storage/maria/ma_recovery.c:
  comments
2009-02-09 22:02:04 +01:00
Guilhem Bichot
790fbc566e merge with latest 5.1-maria 2009-02-09 18:22:50 +01:00
Sergei Golubchik
f0261aca0b Bug#42201 Maria: after a deadlock, table is marked as corrupted
don't treat deadlock or timeout as a sign of corruption
2009-02-06 22:14:13 +01:00
unknown
5564e53c42 merge 2009-02-06 00:38:30 +02:00
Sergey Vojtovich
071cfc03b7 BUG#39185 - Cardinality for merge tables calculated incorrectly.
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.
2009-02-05 17:03:47 +04:00
Alexey Botchkov
aa964b7913 merging 2009-02-05 10:33:06 +04:00
Alexey Botchkov
9036f1aa97 Bug#37995 Error message truncation in test "innodb" in embedded mode.
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.
2009-02-05 10:16:00 +04:00
Alfranio Correia
0f57761141 auto-merge for BUG#42445. 2009-02-04 19:17:16 +00:00
Sergey Vojtovich
aa13a4b95e Merge 5.0-bugteam -> 5.1-bugteam. 2009-02-04 17:00:40 +04:00
unknown
a9376429a6 merge 2009-02-04 10:51:17 +02:00
unknown
e844a5fd6d Storing information in newly started buffer added. 2009-02-04 10:13:10 +02:00
Alfranio Correia
c29994edb1 BUG#42445 Warning messages in innobase/handler/ha_innodb.cc
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.
2009-02-03 11:36:46 +00:00
Michael Widenius
f0da84c3a8 Fixes Bug #40711 "Maria crash in my_no_flags_free"
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.
2009-02-01 09:29:56 +02:00
Michael Widenius
bd4e65515f Fixed compiler warnings found by gcc 4.3.2
- 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
2009-01-31 23:22:44 +02:00
Michael Widenius
37db97b0e2 Merge with mysql-maria
Changed _ma_ft_convert_to_ft2() to my_bool

storage/maria/ma_ft_update.c:
  Changed _ma_ft_convert_to_ft2() to my_bool
storage/maria/ma_fulltext.h:
  Changed _ma_ft_convert_to_ft2() to my_bool
storage/maria/ma_write.c:
  Manual merge
  Changed _ma_ft_convert_to_ft2() to my_bool
2009-01-30 23:55:42 +02:00
Georgi Kodinov
87eb2cb938 merged 5.1-main -> 5.1-bugteam 2009-01-30 15:44:49 +02:00
Guilhem Bichot
45f7a93914 Putting back some fixes lost in a colleague's merge a while back; that was
about problems when the R-tree index is not the first index.
2009-01-26 22:14:43 +01:00
Ramil Kalimullin
80fe6268f7 Fix for bug #37756: enabling fulltext indexes with
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.
2009-01-26 10:35:15 +04:00
Luis Soares
df8543868d merge: 5.1 -> 5.1-rpl
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
2009-01-23 13:22:05 +01:00
Guilhem Bichot
55fbc5dd77 Merge from 5.1-maria (no conflicts) 2009-01-19 09:25:55 +01:00
Sergei Golubchik
e3da48ba69 merged 2009-01-16 23:14:31 +01:00
Guilhem Bichot
92c4218224 merge 2009-01-16 22:10:31 +01:00
Guilhem Bichot
3907cb1d70 Fix for BUG#42112 "Maria: recovery failure (pushbuild2) Assertion `rownr == 0 && new_page' failed"
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.
2009-01-16 22:00:39 +01:00
Timothy Smith
75e1ed9618 Add another cast to ignore int/ulong difference in error types, silence warning on Win64 2009-01-16 17:49:07 +01:00
Sergei Golubchik
60f3a340ab merged
trnman_get_state/trnman_set_state renamed to trnman_get/set_flags
TRN::state - to TRN::flags accordingly
2009-01-16 17:18:17 +01:00
Michael Widenius
364f8611b0 Fixed issues in last push found by pushbuild
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
2009-01-16 11:38:02 +02:00
Michael Widenius
3fca23902c Log queries to maria_log if compiled with EXTRA_DEBUG
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
2009-01-16 00:25:53 +02:00
Sergei Golubchik
9c96fde120 post-review fixes
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
2009-01-15 22:27:36 +01:00
Guilhem Bichot
a955efc40c Fix for BUG#41493 "Maria: two recovery failures (wrong logging of BLOB pages)" and some more debugging
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).
2009-01-15 16:14:47 +01:00
Timothy Smith
96415bb39d Applying InnoDB snapshot innodb-5.1-ss3603
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
2009-01-13 15:14:11 +01:00
Timothy Smith
13927f53c5 Applying InnoDB snapshot innodb-5.1-ss3603
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
2009-01-12 23:35:05 +01:00
Timothy Smith
8759d9275d Applying InnoDB snapshot innodb-5.1-ss3603
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
2009-01-12 23:32:50 +01:00
Timothy Smith
14c7d56ba8 Applying InnoDB snapshot innodb-5.1-ss3603
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....
2009-01-12 23:32:11 +01:00
Timothy Smith
fc3b2bfc9e Applying InnoDB snapshot innodb-5.1-ss3603
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
2009-01-12 23:31:05 +01:00
Timothy Smith
9eddf5762c Applying InnoDB snapshot innodb-5.1-ss3603
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)
2009-01-12 23:28:56 +01:00
Timothy Smith
897d00ce89 Applying InnoDB snapshot innodb-5.1-ss3603
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.
2009-01-12 23:27:11 +01:00
Timothy Smith
293e9c49c4 Applying InnoDB snapshot innodb-5.1-ss3603
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)
2009-01-12 23:08:22 +01:00
unknown
08d61de720 Separated service thread framework to be used for update/delete purge (WL#3067) and group commit (WL#3080).
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.
2009-01-12 21:27:02 +02:00
Michael Widenius
dd5b9fc6cd Merge with base MySQL-5.1-maria 2009-01-12 13:12:00 +02:00
Tatiana A. Nurnberg
95e0d3bd06 Bug#31177: Server variables can't be set to their current values
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!
2009-01-12 06:32:49 +01:00
Michael Widenius
7eda7f1337 Code cleanup:
- 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
2009-01-09 06:23:25 +02:00
Michael Widenius
7dc83c5043 Fixed bugs from my latest patch found by pushbuild:
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
2009-01-09 06:11:37 +02:00
Luis Soares
b2cdc3b6cb merge: 5.1 -> 5.1-rpl
conflicts:
  Text conflict in mysql-test/lib/mtr_report.pm
  Text conflict in mysql-test/mysql-test-run.pl
2009-01-08 19:03:56 +00:00
unknown
dd8e57af7b _ma_state_info_write numeric flags changed with constants.
storage/maria/maria_def.h:
  Constants for _ma_state_info_write added.
2009-01-08 10:20:04 +02:00
unknown
6aa97fb664 merge 2009-01-05 21:30:33 +02:00
Georgi Kodinov
f97ef7a40e merged 5.1-main -> 5.1-bugteam 2009-01-05 18:10:20 +02:00
unknown
4da218f0d2 Fixed mutex taking order on recovery of bulk insert.
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.
2008-12-29 15:00:52 +02:00
Sergey Glukhov
47c0ec5084 Bug#41441 repair csv table crashes debug server
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.
2008-12-29 16:50:51 +04:00
Michael Widenius
910284e6e6 Fixed bugs found by pushbuild
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)
2008-12-27 04:05:16 +02:00
Michael Widenius
86fcfb1508 Fix for Bug#40311 Assert in MARIA_RECORD_POS during pushbuild 2 test:
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.
2008-12-22 02:17:37 +02:00
Timothy Smith
4dc447e1ea Auto-merge from 5.1-bugteam 2008-12-19 01:56:58 +01:00
Davi Arnaut
3ce026ec2f Fix warnings and bug spotted by gcc-4.3.
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.
2008-12-16 10:12:22 -02:00
Timothy Smith
d29aaf893c Apply InnoDB snapshot innodb-5.1-ss2858, part 15. Fixes
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
2008-12-14 13:59:50 -07:00
Timothy Smith
5e421fb8fe Apply InnoDB snapshot innodb-5.1-ss2858, part 14. Fixes
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.
2008-12-14 13:57:54 -07:00
Timothy Smith
a32e048645 Apply InnoDB snapshot innodb-5.1-ss2858, part 13. Fixes
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
2008-12-14 13:56:33 -07:00
Timothy Smith
3d2d2d0c17 Apply InnoDB snapshot innodb-5.1-ss2858, part 12.
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
2008-12-14 13:52:47 -07:00
Timothy Smith
3692ae364e Apply InnoDB snapshot innodb-5.1-ss2858, part 11. White space changes.
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.
2008-12-14 13:52:05 -07:00
Timothy Smith
7cd7760d2f Apply InnoDB snapshot innodb-5.1-ss2858, part 10.
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.
2008-12-14 13:50:41 -07:00
Timothy Smith
9f8f9715d3 Apply InnoDB snapshot innodb-5.1-ss2858, part 9. Improve a comment.
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.
2008-12-14 13:48:44 -07:00
Timothy Smith
915635bbbe Apply InnoDB snapshot innodb-5.1-2858, part 8. Fixes
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
2008-12-14 13:47:17 -07:00
Timothy Smith
22f6a8424c Apply InnoDB snapshot innodb-5.1-2858, part 7.
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
2008-12-14 13:42:37 -07:00
Timothy Smith
e366921268 Apply InnoDB snapshot innodb-5.1-ss2858, part 6.
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
2008-12-14 13:38:14 -07:00
Timothy Smith
c50d60852e Apply InnoDB snapshot innodb-5.1-ss2858, part 5.
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
2008-12-14 13:34:48 -07:00
Timothy Smith
19fed02ce9 Apply InnoDB snapshot innodb-5.1-ss2858, part 4. Fixes
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
2008-12-14 13:31:13 -07:00
Timothy Smith
f4d38a034f Apply InnoDB snapshot innodb-5.1-ss2858, part 3.
branches/5.1:

Silence a compilation warning in UNIV_DEBUG.

Approved by:    Marko (via IM)
2008-12-14 13:27:13 -07:00
Timothy Smith
19cdcb1f6b Apply InnoDB snapshot innodb-5.1-ss2858, part 2. Fixes
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)
2008-12-14 13:00:37 -07:00
Timothy Smith
fae4abd759 Apply InnoDB snapshot innodb-5.1-ss2858, part 1. Fixes
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.
2008-12-14 12:37:23 -07:00
Timothy Smith
bb9ee6b684 Apply InnoDB snapshot innodb-5.1-ss2637, part 3. Fixes
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
2008-12-14 12:31:26 -07:00
Timothy Smith
ea912a97c7 Apply InnoDB snapshot innodb-5.1-ss2637, part 2. Fixes
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
2008-12-14 12:29:59 -07:00
Timothy Smith
2450190eed Apply InnoDB snapshot innodb-5.1-ss2637, part 1. Fixes
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.
2008-12-14 12:28:19 -07:00
Timothy Smith
f6bf85c09e Complete application of InnoDB snapshot innodb-5.1-ss2545.
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
2008-12-14 12:25:33 -07:00
Timothy Smith
1c0d9aa082 Complete application of InnoDB snapshot innodb-5.1-ss2485, part 2. Fixes
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)
2008-12-14 12:21:24 -07:00
Timothy Smith
efbac9aabc Complete application of InnoDB snapshot innodb-5.1-ss2485, part 1. Fixes
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.
2008-12-14 12:18:59 -07:00
Timothy Smith
1945f661f7 Complete applying InnoDB snapshot innodb-5.1-ss2479. Fixes
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
2008-12-14 12:15:12 -07:00
Timothy Smith
25f3574a4f Completing snapshot innodb-5.1-ss2438, part 3.
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.
2008-12-14 11:54:01 -07:00
Timothy Smith
e361d4487b Completing snapshot innodb-5.1-ss2438, part 2. Fixes
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
2008-12-14 11:26:53 -07:00
Timothy Smith
040f3e9e5b Completing snapshot innodb-5.1-ss2438, part 1. Fixes
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().
2008-12-14 11:24:16 -07:00
Michael Widenius
7f91cf0861 Merge with main Maria tree 2008-12-09 14:36:51 +02:00
Michael Widenius
9948682b43 Merge with base Maria tree
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
2008-12-09 12:29:33 +02:00
Guilhem Bichot
c9a29373e1 Fix for BUG#41159 "Maria: deadlock between checkpoint and maria_write() when extending data file".
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.
2008-12-09 10:56:02 +01:00
Sergey Vojtovich
0e62ee8e79 Merge. 2008-12-09 13:27:46 +04:00
unknown
131a6a57a4 merge 2008-12-08 22:12:23 +02:00
unknown
c9b0c5a15c Fixed mutexes lock order in maria_close(): LOCK_trn_list -> MARIA_SHARE::intern_lock (then will be WL to revert the order).
(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).
2008-12-08 22:09:59 +02:00
Michael Widenius
d0fb8270df Fixed problem with crash in Maria _ma_setup_live_state() where history link didn't include needed state
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
2008-12-08 20:31:16 +02:00
unknown
7f3631c2bf merge 2008-12-08 12:06:08 +02:00
unknown
e1ee25e4fb False alarm about incorrect mutex taking removed.
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.
2008-12-08 11:22:49 +02:00
Guilhem Bichot
ccfb9c32f8 merge with latest 5.1-maria 2008-12-05 22:25:38 +01:00
Guilhem Bichot
91bc9cc9e6 Fix for BUG#41037 "Maria: recovery failure (pushbuild2)" (checkpoint bug).
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
2008-12-05 22:11:46 +01:00
Sergei Golubchik
633eabc643 compilation warnings 2008-12-05 19:13:08 +01:00
Sergei Golubchik
d00d63dda2 merged 2008-12-05 14:42:14 +01:00
Sergei Golubchik
c151d0cc05 bug#41024 maria: Server crashes in sysbench OLTP_RW test at lf_hash.c:94
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
2008-12-05 11:51:51 +01:00
Sergei Golubchik
f82866f588 bug#40416 - Maria: Memory allocated at trnman.c:129 was underrun.
we cannot access a trn after we put it in the pool
2008-12-05 11:20:11 +01:00
Guilhem Bichot
45521d9710 Fix for pushbuild failure (test which can't run in embedded mode) and compiler warning
mysql-test/suite/maria/t/maria_showlog_error.test:
  test which can't run in embedded mode
storage/innobase/handler/ha_innodb.cc:
  compiler warning
2008-12-05 10:15:23 +01:00
Guilhem Bichot
fb945ef224 Fixing Valgrind error: deadlock detector was set to random; seen in many InnoDB tests like innodb-replace.test
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)
2008-12-04 22:17:47 +01:00
Michael Widenius
d83f647024 Fixed warnings and errors discovered by pushbuild2
mysys/my_init.c:
  Fixed link error when compiling without thread support
sql/item_create.cc:
  Fixed compiler warning
sql/mysqld.cc:
  Fixed compile error on windows
sql/protocol.cc:
  Fixed compiler warning
sql/sql_class.cc:
  Fixed compiler warning
sql/sql_class.h:
  Fixed compiler warning
storage/myisam/mi_open.c:
  Fixed compiler warning
storage/myisammrg/ha_myisammrg.cc:
  Fixed compiler warning (shadow variable)
2008-12-04 02:36:55 +02:00
Michael Widenius
fb68158856 Merge with base MySQL-5.1-maria 2008-12-03 06:07:50 +02:00
Michael Widenius
32f81bab7d WL#3262 add mutex lock order checking to safemutex (also called safe_mutex_deadlock_detector)
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)
2008-12-03 00:02:52 +02:00
Sergei Golubchik
7881dc1f9f dbug fix: only do safemalloc checks if a function is selected
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
2008-12-02 16:29:59 +01:00
unknown
2b51150231 Do not use MY_WME in the stat call which errors we process on high level.
(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.
2008-12-01 15:21:37 +02:00
unknown
96e0bf50d9 Merge from mysql-5.1.30-release 2008-11-27 00:02:10 +01:00
Build Team
74b3540919 mysql-test/r/partition.result
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
2008-11-25 03:04:58 +01:00
Guilhem Bichot
f2d05437d5 In pushbuild2 when testing Maria's recovery, it can happen that a page was not entirely written
(i.e. file's size % 8192 != 0). Don't assert on this, Recovery is supposed to fix it.
2008-11-24 15:23:48 +01:00
unknown
ef5d498348 merge 2008-11-24 09:54:07 +02:00
unknown
094d92e242 Prevent reenabling logging by thread which tries to lock table used by bulk insert.
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.
2008-11-24 09:48:21 +02:00
Guilhem Bichot
33b194c36e Merge of 5.1-main into 5.1-maria. There were no changes to storage/myisam, or mysql-test/t/*myisam*.
However there were three new tests mysql-test/suite/parts/t/partition*myisam.test, of which I make here
copies for Maria.
2008-11-21 15:21:50 +01:00
Alexey Botchkov
fc570243cf Bug#40634 table scan temporary table is 4x slower due to mmap instead instead of caching
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
2008-11-20 19:16:20 +04:00
Guilhem Bichot
8d96bcda72 During Maria's checkpoint, use the proper mutex to read transaction's short_id
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.
2008-11-20 15:11:00 +01:00
unknown
bfba620e45 Changes of copyright output from "--version" and similar.
Changes of copyright in RPM spec file.
2008-11-14 17:29:38 +01:00
unknown
f36a9625e3 Added correct reaction on find operation status during writing the page. (BUG#40308)
storage/maria/ma_pagecache.c:
  Added correct reaction on find operation status during writing the page.
2008-11-13 00:06:18 +02:00
unknown
bbb68f4cf3 Added correct reaction on find operation status during writing the page. (BUG#40308)
storage/maria/ma_pagecache.c:
  Added correct reaction on find operation status during writing the page.
2008-11-12 23:59:06 +02:00