Commit graph

3904 commits

Author SHA1 Message Date
Satya B
95e2fd1472 merge to 5.1-bugteam 2009-07-01 11:07:02 +05:30
Satya B
f903db6753 Fix build failure after applying Innodb snapshot 5.1-ss5282
After applying Innodb snapshot 5.1-ss5282, build was broken
because of missing header file. 

Adding the header file to Makefile.am after informing the 
innodb developers.
2009-07-01 11:06:05 +05:30
Davi Arnaut
8d83b73985 Post-merge fix for Innodb snapshot.
Add new header to Makefile.am so it gets bundled.

storage/innobase/Makefile.am:
  Add header so it becomes part of a source distribution.
2009-06-30 15:29:10 -03:00
Michael Widenius
f1183fc160 Changed default thread stack to 288K to get better memory missalignment between stacks of different threads (should speed up things) and to get a bit extra safety.
In maria_open(), don't allocate big arrays on stack as this may lead to stack overflow.
This fixes a valgrind warning detected by buildbot

include/my_pthread.h:
  Changed default thread stack to 288K to get better memory missalignment between stacks of different threads (should speed up things) and to get a bit extra safety.
storage/maria/ma_open.c:
  In maria_open(), don't allocate big arrays on stack as this may lead to stack overflow.
2009-06-30 15:01:29 +03:00
Michael Widenius
bb55791994 Added some changes inspired by Zardosht Kasheff:
- Added a handler call (prepare_index_scan()) to inform storage engines that an index scan is about to take place.
- Extended the maximun key parts for an index from 16 to 32
- Extended MyISAM and Maria engines to support up to 32 parts

Added checks for return value from ha_index_init()



include/my_handler.h:
  Extended number of key parts for MyISAM and Maria from 16 to 32
include/my_pthread.h:
  Ensure we always have 256M of stack.
  (Required to be able to handle the current number of keys and key parts in MyISAM)
mysql-test/r/create.result:
  Extended to test for 32 key parts
mysql-test/r/myisam.result:
  Test that we can create 32 but not 33 key parts
mysql-test/r/ps_1general.result:
  Length of ref is now 2048 as we can have more key parts
mysql-test/r/ps_2myisam.result:
  Length of ref is now 2048 as we can have more key parts
mysql-test/r/ps_3innodb.result:
  Length of ref is now 2048 as we can have more key parts
mysql-test/r/ps_4heap.result:
  Length of ref is now 2048 as we can have more key parts
mysql-test/r/ps_5merge.result:
  Length of ref is now 2048 as we can have more key parts
mysql-test/suite/maria/r/maria.result:
  Max key length is now 1208 bytes
mysql-test/suite/maria/r/maria3.result:
  Max key length is now 1208 bytes
mysql-test/suite/maria/r/ps_maria.result:
  Max key length is now 1208 byte
mysql-test/t/create.test:
  Extended to test for 32 key parts
mysql-test/t/myisam.test:
  Test that we can create 32 but not 33 key parts
sql/handler.cc:
  Check return value from ha_index_init()
sql/handler.h:
  Added a handler call (prepare_index_scan()) to inform storage engines that an index scan is about to take place.
sql/sql_select.cc:
  Checks all return values from ha_index_init()
  Call prepare_index_scan()) to inform storage engines that an index scan is about to take place.
  Fixed indentation
sql/table.cc:
  Fixed wrong types for key_length (rest of code assumed this was 32 bit)
sql/unireg.h:
  Extended the maximun key parts for an index from 16 to 32
storage/maria/ha_maria.cc:
  Don't allocate HA_CHECK on the stack in functions where we call repair() as HA_CHECK is HUGE and will overflow stack
storage/myisam/ha_myisam.cc:
  Don't allocate HA_CHECK on the stack in functions where we call repair() as HA_CHECK is HUGE and will overflow stack
storage/myisam/mi_check.c:
  Fixed wrong check if value overflow
tests/mysql_client_test.c:
  Added fflush() to fix output in case of error
  Fixed wrong check of 'ref' length in EXPLAIN
2009-06-30 00:03:30 +03:00
Staale Smedseng
300a8721fa Merge from 5.0 2009-06-29 16:00:47 +02:00
Satya B
889b96b9c9 merge to mysql-5.1-bugteam 2009-06-29 18:33:11 +05:30
V Narayanan
db044ad94f Bug#45196 Some collations do not sort correctly with IBMDB2I
Some collations--including cp1250_czech_cs,latin2_czech_cs,
ucs2/utf8_czech_ci, ucs2/utf8_danish_ci--are not being
sorted correctly by the IBMDB2I storage engine. This
was being caused because the sort order used by DB2 is
incompatible with the order expected by MySQL.

This patch removes support for the cp1250_czech_cs and
latin2_czech_cs collations because it has been determined
that the sort order used by DB2 is incompatible with the
order expected by MySQL. Users needing a czech collation
with IBMDB2I are encouraged to use a Unicode-based collation 
instead of these single-byte collations. This patch also
modifies the DB2 sort sequence used for ucs2/utf8_czech_ci
and ucs2/utf8_danish_ci collations to better match the
sorting expected by MySQL. This will only affect indexes
or tables that are newly created through the IBMDB2I storage
engine. Existing IBMDB2I tables will retain the old sort
sequence until recreated.

mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45196.result:
  Bug#45196  Some collations do not sort correctly with IBMDB2I
  
  Result file for the test case.
mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45196.test:
  Bug#45196  Some collations do not sort correctly with IBMDB2I
  
  Adding tests for testing the sort order with the modified collations.
storage/ibmdb2i/db2i_collationSupport.cc:
  Bug#45196  Some collations do not sort correctly with IBMDB2I
  
  Remove the support for the cp1250_czech_cs and latin2_czech_cs 
  collations because it has been determined that the sort order
  used by DB2 is incompatible with the order expected by MySQL.
  Users needing a czech collation with IBMDB2I are encouraged to
  use a Unicode-based collation instead of these single-byte
  collations. This patch also modifies the DB2 sort sequence
  used for ucs2/utf8_czech_ci and ucs2/utf8_danish_ci collations
  to better match the sorting expected by MySQL. This will only 
  affect indexes or tables that are newly created through the
  IBMDB2I storage engine. Existing IBMDB2I tables will retain
  the old sort sequence until recreated.
2009-06-29 07:32:17 +05:30
Sergey Vojtovich
9b78102aaf Fixed InnoDB plugin compilation failure from source distribution
on Windows.

Added missing file to a source distribution.
2009-06-25 19:16:40 +05:00
Satya B
7d0675f613 Applying InnoDB snashot 5.1-ss5343, Fixes BUG#45357
1. BUG#45357 - 5.1.35 crashes with Failing assertion: index->type & DICT_CLUSTERED

2. Also fixes the compilation problem when the flag -DUNIV_MUST_NOT_INLINE

Detailed revision comments:

r5340 | marko | 2009-06-17 12:11:49 +0300 (Wed, 17 Jun 2009) | 4 lines
branches/5.1: row_unlock_for_mysql(): When the clustered index is unknown,
refuse to unlock the record.
(Bug #45357, caused by the fix of Bug #39320).
rb://132 approved by Sunny Bains.
r5339 | marko | 2009-06-17 11:01:37 +0300 (Wed, 17 Jun 2009) | 2 lines
branches/5.1: Add missing #include "mtr0log.h" so that the code compiles
with -DUNIV_MUST_NOT_INLINE.
2009-06-22 16:58:00 +05:30
unknown
7c5e321bb8 More XtraDB after-merge fixes following review and buildbot runs:
- Better fix for --innodb-use-sys-malloc causing Valgrind warnings.
 - Different fix for INNODB_IBUF_MAX_SIZE variable changing default value.
 - Fix some problems with the safe mutex lazy init patch.

mysql-test/include/mtr_check.sql:
  Do not check INNODB_IBUF_MAX_SIZE for changes. It is not a dynamic variable, so cannot
  be changed by a test case anyway, and the value may vary slightly from one start of the
  server to the next.
mysql-test/lib/mtr_cases.pm:
  Even just starting and stopping the server with --innodb-use-sys-malloc to check for
  disabled test case under valgrind will cause valgrind leak warnings. So add not_valgrind
  to the list of conditions also tested for directly in mysql-test-run.pl.
mysql-test/mysql-test-run.pl:
  Even just starting and stopping the server with --innodb-use-sys-malloc to check for
  disabled test case under valgrind will cause valgrind leak warnings. So add not_valgrind
  to the list of conditions also tested for directly in mysql-test-run.pl.
mysys/thr_mutex.c:
  Fix a few problems found during review of the lazy init safe mutex patch.
storage/xtradb/ibuf/ibuf0ibuf.c:
  Revert previous fix of INNODB_IBUF_MAX_SIZE default varying slightly between server starts.
  (Fixed instead by ignoring that variable in the test suite).
2009-06-22 10:06:35 +02:00
unknown
2a663359a4 Fix test cases after merge of XtraDB into MariaDB.
Manually merge some InnoDB changes into XtraDB.
Fix ALTER TABLE bug in XtraDB with wrong comparison of row type.

mysql-test/include/varchar.inc:
  Fix in test case that which of several duplicate keys triggers an error is not
  deterministic.
mysql-test/mysql-test-run.pl:
  InnoDB does not bother to free resources individually during shutdown, but due to using
  its own memory tracking it nevertheless can free everything at exit. But XtraDB adds an
  option, on by default, to skip this extra tracking. This causes lots of Valgrind
  warnings, so needs to be disabled for Valgrind testing.
mysql-test/r/innodb.result:
  Fix in test case that which of several duplicate keys triggers an error is not
  deterministic.
mysql-test/t/innodb-use-sys-malloc.test:
  InnoDB does not bother to free resources individually during shutdown, but due to using
  its own memory tracking it nevertheless can free everything at exit. But XtraDB adds an
  option, on by default, to skip this extra tracking. This causes lots of Valgrind
  warnings, so needs to be disabled for Valgrind testing.
sql/sql_table.cc:
  Add some useful DBUG while debugging alter table.
storage/xtradb/handler/ha_innodb.cc:
  Fix that check_if_incompatible_data did not realise that ROW_TYPE_DEFAULT is identical
  to the default row format ROW_TYPE_COMPACT, causing excessive table copying in
  ALTER TABLE
  Add some useful DBUG while debugging alter table.
  Manually merge into XtraDB a few small changes for InnoDB from upstream MySQL.
storage/xtradb/include/pars0pars.h:
  Manually merge into XtraDB a few small changes for InnoDB from upstream MySQL.
storage/xtradb/include/univ.i:
  Manually merge a MariaDB fix in InnoDB into XtraDB.
2009-06-18 14:39:21 +02:00
Sergey Vojtovich
0fa4924fe5 Fixed build failures.
storage/innodb_plugin/Makefile.am:
  Removed handler0vars.h from source distribution.
win/Makefile.am:
  Fixed incorrect merge.
2009-06-18 13:49:44 +05:00
Staale Smedseng
2380d465f0 Merge from 5.0-bugteam 2009-06-17 16:56:44 +02:00
Vladislav Vaintroub
87da3df623 merge 2009-06-17 16:32:16 +02:00
Vladislav Vaintroub
00182614bd Fixed type defintion for os_thread_id_t on 64 bit Windows.
It used to be declared as ulint, which is 32/64 bit integer depending on OS bitness.
However this declaration lead to problems with os_compare_and_swap_thread_id 
implementation which operated on 32 bit integers (InterlockedCompareExchange)

Using 64 bit int   lead to  wrong result in os_compare_and_swap_thread_id 
and to crash/assertion in  rw_lock_set_writer_id_and_recursion_flag()

The fix is to use 4 byte integer to os_thread_id type definition.
2009-06-17 16:14:08 +02:00
Sergey Vojtovich
8469eee8c3 When using bundled zlib, INNODB_PLUGIN was looking for
zlib headers in wrong location.

Fixed by using path exported by zlib.m4 macro.

storage/innodb_plugin/Makefile.am:
  Include zlib headers from a proper location.
2009-06-17 14:38:41 +05:00
unknown
4b2aafb35c Merge of Percona XtraDB into MariaDB. 2009-06-11 19:49:51 +02:00
Satya B
03bd6f025b Applying InnoDB snashot 5.1-ss5282, Fix for BUG#45097
BUG#45097 - Hang during recovery, redo logs for doublewrite buffer pages 

Detailed revision comments:

r5128 | vasil | 2009-05-26 17:26:37 +0300 (Tue, 26 May 2009) | 7 lines
branches/5.1:

Fix Bug#45097 Hang during recovery, redo logs for doublewrite buffer pages

Do not write redo log for the pages in the doublewrite buffer. Also, do not
make a dummy change to the page because this is not needed.

r5150 | vasil | 2009-05-27 18:56:03 +0300 (Wed, 27 May 2009) | 4 lines
branches/5.1:

Whitespace fixup.
2009-06-11 18:35:12 +05:30
unknown
93bcda598b Merge latest XtraDB from lp:percona-xtradb into MariaDB.
include/my_sys.h:
  Move generic file parsing functions out to shared code, as they are used in several places.
mysys/mf_iocache2.c:
  Move generic file parsing functions out to shared code, as they are used in several places.
sql/log_event.cc:
  Fix XtraDB build with embedded server.
  XtraDB needs access to replication stuff, which is missing in embedded server.
  Solved by defining wrapper function for this which is compiled differently for normal and
  embedded case.
sql/log_event.h:
  Fix XtraDB build with embedded server.
  XtraDB needs access to replication stuff, which is missing in embedded server.
  Solved by defining wrapper function for this which is compiled differently for normal and
  embedded case.
sql/slave.cc:
  Move generic file parsing functions out to shared code, as they are used in several places.
2009-06-11 14:53:26 +02:00
Satya B
afa76a9d7a Applying InnoDB snashot 5.1-ss5282, PRE-Fix for BUG#45097
BUG#45097 - Hang during recovery, redo logs for doublewrite buffer pages 

Detailed revision comments:

r5126 | vasil | 2009-05-26 16:57:12 +0300 (Tue, 26 May 2009) | 9 lines
branches/5.1:

Preparation for the fix of
Bug#45097 Hang during recovery, redo logs for doublewrite buffer pages 

Non-functional change: move FSP_* macros from fsp0fsp.h to a new file
fsp0types.h. This is needed in order to be able to use FSP_EXTENT_SIZE 
in mtr0log.ic.

r5127 | vasil | 2009-05-26 17:05:43 +0300 (Tue, 26 May 2009) | 9 lines
branches/5.1:

Preparation for the fix of
Bug#45097 Hang during recovery, redo logs for doublewrite buffer pages

Do not include unnecessary headers mtr0log.h and fut0lst.h in trx0sys.h
and include fsp0fsp.h just before it is needed. This is needed in order
to be able to use TRX_SYS_SPACE in mtr0log.ic.
2009-06-11 18:21:54 +05:30
Sergey Vojtovich
c182f70115 Removed legacy name for innodb_plugin SE, so --with[out]-innodb
option doesn't affect innodb_plugin.

Currently it works as following:
* configure without relevant options producing two dynamic plugins
* configure --with-plugin-innodb (or legacy --with-innodb) producing
  static standard InnoDB
* configure --without-plugin-innodb (or legacy --without-innodb)
  disabling standard InnoDB
* configure --with-plugin-innodb_plugin producing dynamic innodb_plugin
* configure --without-plugin-innodb_plugin disabling innodb_plugin

storage/innodb_plugin/plug.in:
  Removed legacy name for innodb_plugin SE.
2009-06-10 22:50:00 +05:00
Vladislav Vaintroub
768bbae90e Backport WL#3653 to 5.1 to enable bundled innodb plugin.
Remove custom DLL loader code from innodb plugin code, use 
symbols exported from mysqld.


storage/innodb_plugin/handler/ha_innodb.cc:
  Remove a Win32 workaround for current_thd.
  The original  problem that innodb plugin used
  value of TLS variable across DLL boundaries is 
  solved in MySQL server (current_thd is a function
  not TLS variable now)
storage/innodb_plugin/handler/handler0alter.cc:
  Remove custom delay loader
storage/innodb_plugin/handler/handler0vars.h:
  Remove custom delay loader
storage/innodb_plugin/handler/i_s.cc:
  Remove custom delay loader
storage/innodb_plugin/handler/win_delay_loader.cc:
  Remove custom delay loader
storage/innodb_plugin/plug.in:
  Remove commented out MYSQL_PLUGIN_STATIC, 
  CMake would not parse that correctly
2009-06-10 10:59:49 +02:00
Tomas Ulin
bf893bea7e add missing file in Makefile.am 2009-06-09 21:26:04 +02:00
unknown
bb9a3f0c2b XtraDB after-merge fixes.
Fixes to get the test suite to run without failures.

mysql-test/r/information_schema.result:
  Additional variables available now.
  Sort output to avoid depending on engine order.
mysql-test/r/information_schema_all_engines.result:
  More variables now.
mysql-test/r/innodb-autoinc.result:
  Avoid picking up pbxt variables in result
mysql-test/r/innodb-index.result:
  Save state to not corrupt following testcases.
  Suppress an expected warning.
mysql-test/r/innodb-zip.result:
  Work around a problem with dependency on zlib version
mysql-test/r/innodb.result:
  Checksums have changed in Maria.
  Save and restore server state to not corrupt following testcases.
mysql-test/r/innodb_bug36169.result:
  Save and restore server state to not corrupt following testcases.
mysql-test/r/innodb_xtradb_bug317074.result:
  Save and restore server state to not corrupt following testcases.
mysql-test/r/row-checksum-old.result:
  Update result file
mysql-test/r/row-checksum.result:
  Update result file
mysql-test/t/information_schema.test:
  Sort output to avoid depending on engine order.
mysql-test/t/innodb-analyze.test:
  Save and restore server state to not corrupt following testcases.
mysql-test/t/innodb-autoinc.test:
  Save and restore server state to not corrupt following testcases.
mysql-test/t/innodb-index.test:
  Save state to not corrupt following testcases.
  Suppress an expected warning.
mysql-test/t/innodb-zip.test:
  Work around a problem with dependency on zlib version
mysql-test/t/innodb.test:
  Save and restore server state to not corrupt following testcases.
  Update --replace statements for new mysql-test-run
mysql-test/t/innodb_bug34300.test:
  Save and restore server state to not corrupt following testcases.
mysql-test/t/innodb_bug36169.test:
  Save and restore server state to not corrupt following testcases.
mysql-test/t/innodb_bug36172.test:
  Save and restore server state to not corrupt following testcases.
mysql-test/t/innodb_xtradb_bug317074.test:
  Save and restore server state to not corrupt following testcases.
mysql-test/t/partition_innodb.test:
  Fix regexps to work with new SHOW INNODB STATUS output.
mysys/thr_mutex.c:
  Initialize mutex deadlock detection lazily.
  This allows to test XtraDB, which initializes huge amounts of mutexes without using any but a few of them.
storage/xtradb/ibuf/ibuf0ibuf.c:
  Fix problem where value of INNODB_IBUF_MAX_SIZE would depend on the alignment of memory
  allocated by the buffer pool.
storage/xtradb/include/sync0rw.h:
  Fix XtraDB to compile without GCC atomic operation intrinsics (performance may suffer
  when they are not available though).
storage/xtradb/include/sync0rw.ic:
  Fix XtraDB to compile without GCC atomic operation intrinsics (performance may suffer
  when they are not available though).
storage/xtradb/include/univ.i:
  Fix for MariaDB
storage/xtradb/setup.sh:
  Remove no longer needed file from XtraDB.
storage/xtradb/srv/srv0start.c:
  Fix for MariaDB
2009-06-09 17:08:46 +02:00
unknown
a03c9ff55f XtraDB after-merge fixes.
The original XtraDB (and InnoDB plugin) is shipped as a separate source tree which is copied
into the MySQL source, after which a setup.sh script must be run to move things into place.

Now that XtraDB is part of the MariaDB source tree, this commit fixes these things up once
and for all:

 - New innodb build scripts.
 - Test suite fixes (new tests and patches to existing).
 - Remove files no longer needed due to this.
2009-06-09 15:19:13 +02:00
unknown
8be051d703 XtraDB after-merge fix: Fix building from storage/xtradb/ instead of storage/innodb/
.bzrignore:
  XtraDB compiles innodb in storage/xtradb instead of storage/innobase
CMakeLists.txt:
  Take InnoDB code from storage/xtradb/ instead of storage/innobase/
libmysqld/CMakeLists.txt:
  Take InnoDB code from storage/xtradb/ instead of storage/innobase/
storage/innobase/plug.in.disabled:
  Disable building old InnoDB from storage/innobase/ directory.
  
  We will keep the files around to avoid getting merge conflicts for every MySQL upstream
  change to InnoDB.
storage/xtradb/CMakeLists.txt:
  Take InnoDB code from storage/xtradb/ instead of storage/innobase/
storage/xtradb/COPYING:
  Remove not needed file from XtraDB.
storage/xtradb/Makefile.am:
  Take InnoDB code from storage/xtradb/ instead of storage/innobase/
storage/xtradb/Makefile.in:
  Remove not needed file from XtraDB.
storage/xtradb/handler/ha_innodb.cc:
  Take InnoDB code from storage/xtradb/ instead of storage/innobase/
storage/xtradb/plug.in:
  Take InnoDB code from storage/xtradb/ instead of storage/innobase/
storage/xtradb/row/row0ins.c:
  Take InnoDB code from storage/xtradb/ instead of storage/innobase/
2009-06-09 14:21:26 +02:00
unknown
a6b7f71329 Import Percona XtraDB into the MariaDB source tree. 2009-06-09 13:16:11 +02:00
Tatiana A. Nurnberg
3c080754c1 auto-merge 2009-06-06 18:05:00 +02:00
Georgi Kodinov
898443572f Bug #45286: compilation warnings on mysql-5.0-bugteam on MacOSX
Merged the 5.0 fix to 5.1 and fixed the 5.1 specific warnings.
2009-06-05 16:44:38 +03:00
Satya B
b6312995f1 merge from mysql-5.1-innodb_plugin branch.
change tree name to 'mysql-5.1-innodb_plugin'
2009-06-05 17:03:33 +05:30
Tatiana A. Nurnberg
406f018d33 auto-merge 2009-06-05 01:30:08 +02:00
Narayanan V
094ddf2266 Bug#45197 cp1250 character set with IBMDB2I generates 2027 error
Running a SELECT query over an IBMDB2I table with a cp1250 character set
was producing an error 2027 (ibmdb2i error 2027: Error converting single-byte
sort sequence to UCS-2).

The QMY_DESCRIBE_RANGE API was returning error 2027 to the storage engine
because the CCSID used for a cp1250 column (870) does not match the CCSID
used by the DB2 sort sequences associated with cp1250_* collations (1153).
This was because the storage engine relies on a set of system APIs to
determine which CCSID value most closely matches a particular MySQL
character set. However, in the case of cp1250, the system is returning
CCSID 870, which does not have a codepoint for the euro symbol, making it
an incorrect match.

This patch overrides the selection of a compatible CCSID to always return
1153 for cp1250.

storage/ibmdb2i/db2i_charsetSupport.cc:
  Bug#45197 cp1250 character set with IBMDB2I generates 2027 error
  
  override the selection of a compatible CCSID to
  always return 1153 for cp1250.
2009-06-01 12:52:10 +05:30
Satya B
797cc5a739 Compile the Innodb plugin so that it can be installed as dynamic plugin only for now.
The Innodb plugin 1.0.4 can be installed dynamically using the 'INSTALL PLUGIN' syntax

If mysqld is already statically linked with the inbuilt innodb, it is not possible to 
install the innodb plugin 1.0.4 dynamically. Doing so would throw this error - Function
'innodb' already exists.

storage/innodb_plugin/Makefile.am:
  Remove references of 'storage/innobase' and use $(srcdir) instead. 
  Renamed the dynamic plugin library name to 'ha_innodb_plugin' so 
  that it can be installed along with inbuilt plugin.
storage/innodb_plugin/Makefile.in:
  Remove this file as it can be generated automatically by automake
  using the Makefile.am
storage/innodb_plugin/handler/ha_innodb.cc:
  Remove refernces to "storage/innobase" and the headers can be included directly.
  Declare the plugin with the new name innodb_plugin
storage/innodb_plugin/plug.in:
  Rename the plugin innobase as innodb_plugin
2009-05-29 18:30:29 +05:30
Narayanan V
858e118ab9 Bug#44811 Tests with utf8 charset fail with ibmdb2i on 64bit MySQL
wmemset was being used to fill the row buffers.
wmemset was intended  to  fill the buffer with
16-bit UCS2 pad values.  However,  the  64-bit
version of wmemset uses 32-bit wide characters
and thus filled the buffer incorrectly. In some
cases, the null  byte  map would be overwritten,
causing ctype_utf8.test and ibmdb2i_rir.test to
fail, giving the error message CPF5035.

This patch eliminates the use of wmemset to fill
the row buffer. wmemset has  been  replaced with
memset16, which always  fills  memory with 16-bit
values.

storage/ibmdb2i/db2i_conversion.cc:
  Bug#44811 Tests with utf8 charset fail with ibmdb2i on 64bit MySQL
  
  Eliminate the use of wmemset to fill
  the row buffer. Replace wmemset with
  memset16, which always  fills  memory
  with 16-bit values.
storage/ibmdb2i/db2i_misc.h:
  Bug#44811 Tests with utf8 charset fail with ibmdb2i on 64bit MySQL
  
  Eliminate the use of wmemset to fill
  the row buffer. Replace wmemset with
  memset16, which always  fills  memory
  with 16-bit values.
2009-05-29 15:01:00 +05:30
Sergey Glukhov
c8a7b79142 5.0-bugteam->5.1-bugteam merge 2009-05-27 15:42:19 +05:00
Satya B
3945d5e554 Adding innodb_plugin-1.0.4 as storage/innodb_plugin. 2009-05-27 15:15:59 +05:30
Sergey Glukhov
d31b6e4784 Bug#43940 64-bit windows myisamchk doesn't support key_buffer_size > 4G
The fix is to allow myisamchk to use >4G key_buffer_size on win64


include/myisam.h:
  use ulonglong instead of ulong for use_buffers
storage/myisam/myisamchk.c:
  use ulonglong instead of ulong for use_buffers
2009-05-27 13:11:28 +05:00
unknown
48083d73d3 After-merge fixes for problems seen in buildbot after merging MySQL-5.1.35.
- Version number.
 - Valgrind false alarms in libz.
 - New variant of suppression for Valgrind warning in dlclose().
 - Fix double free() in plugin init error case.

configure.in:
  Fix version number. We should reset the maria variant back to `1' when the MySQL version
  number increases.
include/my_sys.h:
  Fix false alarms in Valgrind for zlib.
  
  Apply same fix as for archive storage handler also to the cases of compression in the
  client protocol, and to the compression SQL function.
mysql-test/valgrind.supp:
  A new variant of the dlclose() suppression is needed now.
mysys/my_compress.c:
  Fix false alarms in Valgrind for zlib.
  
  Apply same fix as for archive storage handler also to the cases of compression in the
  client protocol, and to the compression SQL function.
sql/handler.cc:
  Fix a double free() in error case for plugin initialisation.
sql/item_strfunc.cc:
  Fix false alarms in Valgrind for zlib.
  
  Apply same fix as for archive storage handler also to the cases of compression in the
  client protocol, and to the compression SQL function.
2009-05-22 14:38:50 +02:00
unknown
115f4b275a merge 5.1->5.2 2009-05-21 12:19:33 +03:00
Michael Widenius
224108a19e Fixed problems in merge
mysql-test/r/information_schema.result:
  Fixed a result file.
mysql-test/r/innodb-autoinc.result:
  Fixed a result file.
mysql-test/t/connect.test:
  Fixed a problem with merge, needed to close
  connections and use the default
2009-05-19 12:28:05 +03:00
Satya B
ab99c2347b merge to 5.1-bugteam tree 2009-05-19 14:01:29 +05:30
Satya B
07b9358860 Applying InnoDB snashot 5.1-ss5024,part 3. Fixes BUG#42101
BUG#42101 - Race condition in innodb_commit_concurrency

Detailed revision comments:

r4994 | marko | 2009-05-14 15:04:55 +0300 (Thu, 14 May 2009) | 18 lines
branches/5.1: Prevent a race condition in innobase_commit() by ensuring
that innodb_commit_concurrency>0 remains constant at run time. (Bug #42101)

srv_commit_concurrency: Make this a static variable in ha_innodb.cc.

innobase_commit_concurrency_validate(): Check that innodb_commit_concurrency
is not changed from or to 0 at run time.  This is needed, because
innobase_commit() assumes that innodb_commit_concurrency>0 remains constant.
Without this limitation, the checks for innodb_commit_concurrency>0
in innobase_commit() should be removed and that function would have to
acquire and release commit_cond_m at least twice per invocation.
Normally, innodb_commit_concurrency=0, and introducing the mutex operations
would mean significant overhead.

innodb_bug42101.test, innodb_bug42101-nonzero.test: Test cases.

rb://123 approved by Heikki Tuuri
2009-05-19 13:50:28 +05:30
Satya B
65eac15004 Applying InnoDB snashot 5.1-ss5024, part 2. Fix for BUG#44320
BUG#44320 - InnoDB: missing DB_ROLL_PTR in Table Monitor COLUMNS output

Detailed revision comments:

r4976 | marko | 2009-05-13 15:44:54 +0300 (Wed, 13 May 2009) | 6 lines
branches/5.1: Display DB_ROLL_PTR in the COLUMNS section of the
innodb_table_monitor output.  It was accidentally omitted due to an
off-by-one loop condition.  (Bug #44320)

rb://116 approved by Heikki Tuuri
2009-05-19 13:26:49 +05:30
Satya B
9854967b92 Applying InnoDB snashot 5.1-ss5024 part 1, Follow up Fix for BUG#43660
Detailed revision comments:

r4705 | vasil | 2009-04-14 14:30:13 +0300 (Tue, 14 Apr 2009) | 7 lines
branches/5.1:

When using the random function, first take the modulus by the number of pages
and then typecast to ulint.

This is a followup to r4699 - the fix of Bug#43660.
2009-05-19 13:22:19 +05:30
Sergey Glukhov
6b57f95cb2 5.0-bugteam->5.1-bugteam merge 2009-05-19 11:48:04 +05:00
Narayanan V
02b90ed9c3 Bug#44856 IBMDB2I gives misleading 2504 error
Occasionally, if both the partition_pruning
and partition_range tests are run sequentially
against the IBMDB2I engine, the partition_range
test will fail.

Compiler padding on a 64-bit build allowed
garbage data in the hash key used for
caching open iconv descriptors. As a
result, cached descriptors were not found,
and multiple duplicate iconv descriptors
were opened for a single character set.
Eventually, the maximum number of open
iconv descriptors was reached, and further
iconv_open() calls would fail, leading the
storage engine to report incorrectly that
the character set was not supported.

This patch widens the 16-bit members of the
hash key to 32 bits to eliminate compiler
padding. The entire length of the hash key
is now initialized correctly on both 32-bit
and 64-bit builds.

storage/ibmdb2i/db2i_charsetSupport.cc:
  Bug#44856 IBMDB2I gives misleading 2504 error
  
  widen the 16-bit members of the
  hash key to 32 bits to eliminate
  compiler padding.
2009-05-17 22:50:20 +05:30
Narayanan V
a8df3d3c90 Bug#44610 RCDFMT clause requested when creating DB2 table
In order to better support the usage of
IBMDB2I tables from within RPG programs,
the storage engine should ensure that the
RCDFMT name is consistent and predictable
for DB2 tables.

This patch appends a "RCDFMT <name>"
clause to the CREATE TABLE statement
that is passed to DB2.  <name> is
generated from the original name of
the table itself. This ensures a
consistent and deterministic mapping
from the original table.

For the sake of simplicity only
the alpha-numeric characters are
preserved when generating the new
name, and these are upper-cased;
other characters are replaced with
an underscore (_). Following DB2
system identifier rules, the name
always begins with an alpha-character
and has a maximum of ten characters.
If no usable characters are found in
the table name, the name X is used.

mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44610.result:
  Bug#44610 RCDFMT clause requested when creating DB2 table
  
  Result file for the test case.
mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44610.test:
  Bug#44610 RCDFMT clause requested when creating DB2 table
  
  Test case that confirms that the names that are being generated are valid.
storage/ibmdb2i/ha_ibmdb2i.cc:
  Bug#44610 RCDFMT clause requested when creating DB2 table
  
  This patch appends a "RCDFMT <name>"
  clause to the CREATE TABLE statement
  that is passed to DB2.  <name> is
  generated from the original name of
  the table itself. This ensures a
  consistent and deterministic mapping
  from the original table.
storage/ibmdb2i/ha_ibmdb2i.h:
  Bug#44610 RCDFMT clause requested when creating DB2 table
  
  This patch appends a "RCDFMT <name>"
  clause to the CREATE TABLE statement
  that is passed to DB2.  <name> is
  generated from the original name of
  the table itself. This ensures a
  consistent and deterministic mapping
  from the original table.
2009-05-17 21:55:23 +05:30
Michael Widenius
b94f191a77 Merge fixes.
mysql-test/mysql-test-run.pl:
  Fixed missed lines in merge.
storage/maria/plug.in:
  Fixed problem with configuration. This is now included
  top level.
storage/pbxt/plug.in:
  Fixed problem with configuration. This is
  included now in top level.
2009-05-12 09:44:01 +03:00
Anurag Shekhar
da0fe3cb31 Bug #39802 On Windows, 32-bit time_t should be enforced
This patch fixes compilation warning, "conversion from 'time_t' to 'ulong', 
possible loss of data". 
The fix is to typecast time_t to ulong before assigning it to ulong. 
Backported this from 6.0-bugteam tree.


storage/archive/ha_archive.cc:
  type casting time_t to ulong before assigning.
storage/federated/ha_federated.cc:
  type casting time_t to ulong before assigning.
storage/innobase/handler/ha_innodb.cc:
  type casting time_t to ulong before assigning.
storage/myisam/ha_myisam.cc:
  type casting time_t to ulong before assigning.
2009-05-13 15:41:24 +05:30
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