Commit graph

3289 commits

Author SHA1 Message Date
Mikael Ronstrom
4557f4ee9e Fix for BUG#45131 2009-06-10 12:23:02 +02:00
Vladislav Vaintroub
31b79618e3 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.
2009-06-10 10:59:49 +02:00
Tomas Ulin
8ff151e655 add missing file in Makefile.am 2009-06-09 21:26:04 +02:00
Tatiana A. Nurnberg
e66f753820 auto-merge 2009-06-06 18:05:00 +02:00
Georgi Kodinov
a66fd23980 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
518e249853 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
640b7cd6e2 auto-merge 2009-06-05 01:30:08 +02:00
MySQL Build Team
8ad237190a Some portability fixes.
include/Makefile.am: use @PERL@ to call scripts/dheadgen.pl - don't rely on #! /usr/bin/perl
scripts/dheadgen.pl: use 2-arg open() for compatibility with older Perl versions
storage/innobase/srv/srv0srv.c: Don't use C++-style comments in C code
2009-06-04 18:47:38 +02:00
Narayanan V
8880590158 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.
2009-06-01 12:52:10 +05:30
Satya B
a4f69c8951 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.
2009-05-29 18:30:29 +05:30
Narayanan V
5a64492333 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.
2009-05-29 15:01:00 +05:30
Sergey Glukhov
a6ccad60b4 5.0-bugteam->5.1-bugteam merge 2009-05-27 15:42:19 +05:00
Satya B
1b9fe0bbac Adding innodb_plugin-1.0.4 as storage/innodb_plugin. 2009-05-27 15:15:59 +05:30
Sergey Glukhov
7dc42f175f 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
2009-05-27 13:11:28 +05:00
MySQL Build Team
508084bca6 Pull in the few changes from mysql-5.4.0-release; also a minor portability fix up from mysql-5.1 2009-05-22 21:50:02 +02:00
MySQL Build Team
60cad950c9 Bug #44536: MySQL 5.4 version mismatch in the sources
Update version number; also modify NDB's version.c for compatibility.
2009-05-22 21:05:46 +02:00
Satya B
06c5c3007c merge to 5.1-bugteam tree 2009-05-19 14:01:29 +05:30
Satya B
3ea0fd9d89 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
be52668735 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
5db3bfbe33 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
2b373758af 5.0-bugteam->5.1-bugteam merge 2009-05-19 11:48:04 +05:00
Narayanan V
162fa0059d 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.
2009-05-17 22:50:20 +05:30
Narayanan V
ca3dbc91ed 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.
2009-05-17 21:55:23 +05:30
Anurag Shekhar
8c73cafc4c 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.
2009-05-13 15:41:24 +05:30
Jim Winstead
ce33c94849 Merge with 5.1-bugteam. 2009-05-05 10:29:01 -07:00
Narayanan V
5158be8fe7 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.
2009-05-05 15:03:52 +05:30
Sergey Vojtovich
5530867103 Merge to 5.1-bugteam. 2009-04-30 19:41:43 +05:00
Georgi Kodinov
a60ff1e9f5 merged 5.1-main to 5.1-bugteam 2009-04-30 16:42:38 +03:00
Narayanan V
6299dbb356 merging with mysql-5.1-bugteam 2009-04-30 18:22:48 +05:30
Narayanan V
2b491daa1c 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.
2009-04-30 18:16:49 +05:30
Satya B
1cdd699022 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.
2009-04-30 12:40:12 +05:30
Martin Hansson
de2c4f0ad0 merge 2009-04-29 20:52:37 +02:00
Martin Hansson
7d24441119 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.
2009-04-29 14:00:34 +02:00
Narayanan V
f51e62cfa3 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.
2009-04-29 16:51:14 +05:30
Alexey Botchkov
08690ef254 merging 2009-04-29 07:59:10 +05:00
Jim Winstead
fef968c8db Add missing newline to usage message of ndb_print_backup_file (Bug #34989) 2009-04-28 11:21:47 -07:00
Sergey Vojtovich
f3d921c082 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.
2009-04-23 16:24:08 +05:00
Satya B
669060712f 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
f6c28cd948 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.
2009-04-16 17:02:56 +05:30
Staale Smedseng
fc35ded3f4 Merge from 5.0-bugteam 2009-04-16 11:47:21 +02:00
Satya B
3e90469f95 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
df7f5472c9 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
6c08e3c2fb merging with mysql-5.1-bugteam 2009-04-13 17:05:40 +05:30
Narayanan V
d7026cb968 merging with mysql-5.1-bugteam tree 2009-04-13 16:51:24 +05:30
Narayanan V
4a12ecf7d9 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.
2009-04-10 13:18:07 +05:30
Narayanan V
9887dd7a66 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.
2009-04-10 13:01:15 +05:30
Narayanan V
39d9d106bf 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.
2009-04-10 11:56:54 +05:30
Narayanan V
f9b33d2286 merging with mysql-5.1-bugteam tree 2009-04-09 14:04:34 +05:30
Narayanan V
9b1076b471 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.
2009-04-09 13:48:23 +05:30
Anurag Shekhar
b745d02a03 merging with 5.0 bugteam tree 2009-04-09 13:36:47 +05:30
Narayanan V
998697fd4c 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.
2009-04-08 12:25:19 +05:30
Satya B
bd19731a7d merge to latest 5.1-bugteam 2009-04-07 18:44:37 +05:30
Satya B
8502705de4 merge 5.0-bugteam to 5.1-bugteam 2009-04-07 17:06:15 +05:30
Satya B
809486414c merge 5.0-bugteam to 5.1-bugteam 2009-04-06 12:31:17 +05:30
MySQL Build Team
00ebbd793a Ensure that all dtrace files are properly removed during make clean 2009-04-05 22:18:21 +02:00
MySQL Build Team
5c2ba04cba Add new headers to noinst_HEADERS (ibmdb2i storage engine) 2009-04-01 22:18:49 +02:00
Ignacio Galarza
f6b6bced56 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
dccbde7a11 merged 5.1-main -> 5.1-bugteam 2009-04-01 12:57:34 +03:00
Ignacio Galarza
f64596ab77 Bug#29248 MyISAMchk & MyISAMpack failing with * wildcard on Windows platform 2009-03-31 18:17:42 -04:00
Sergey Glukhov
99369b1027 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
2009-03-26 18:27:34 +04:00
Satya B
e557c3306a merge 5.0-bugteam to 5.1-bugteam 2009-03-25 15:43:49 +05:30
Sergey Glukhov
40138ba72a compiler warning fix 2009-03-24 13:02:01 +04:00
Georgi Kodinov
ef4ab5cfaa fixed compilation warnings. addendum to the fix for bug 29125 2009-03-20 16:27:53 +02:00
Ignacio Galarza
22b919cc50 auto-merge 2009-03-19 09:59:10 -04:00
MC Brown
8578e16ce3 Fixing some issues in the build when using DTrace probes
Probe definition file is now a separate file that is copied during
build to the correct location, this enforces dependency requirements
correctly and allows builds to work when using the current or separate
build directories
2009-03-18 10:04:15 +00:00
Ignacio Galarza
428e28e00c auto-merge 2009-03-17 16:29:24 -04:00
Satya B
079baf4c23 merge to 5.1-bugteam branch 2009-03-18 12:39:44 +05:30
Satya B
bbd694a3b0 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.
2009-03-18 11:16:21 +05:30
Timothy Smith
2ca84a4c6f 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
071cd48967 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
4e42869a0a 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
ff8b3d81bf 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
556135a1a1 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
Sergey Vojtovich
77d957af67 Merge 5.1-ibmdb2isee to 5.1-bugteam. 2009-03-10 16:27:53 +04:00
Timothy Smith
5d1f153e30 Import the ibmdb2i-ga4-src snapshot from IBM 2009-03-09 15:20:14 -06:00
Anurag Shekhar
9eba69618d fixing warning during compilation. 2009-03-09 15:03:02 +05:30
Mikael Ronstrom
a0ef9fb9a8 Fix silly mistakes 2009-03-07 00:12:36 +01:00
Mikael Ronstrom
d1d11d6baf Add support for Atomic instructions for Windows
Enables Google patch support on Windows
2009-03-06 19:25:38 +01:00
Mikael Ronstrom
3c7a00f3be Fix for warning on -1 converted to 100 due to that
-1 was MAX which isn't a great idea.
2009-03-05 20:12:53 +01:00
Anurag Shekhar
16aedd6d50 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.
2009-03-04 14:48:07 +05:30
Timothy Smith
896aba9630 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
67b5c9d4d1 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
7e5f269408 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
ed0973581b 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
Mikael Ronstrom
f1d563547c Yet another attempt to fix Windows 2009-02-26 07:44:36 +01:00
Mikael Ronstrom
d2c74eb98a Trying a workaround for the Windows crashes 2009-02-26 00:58:28 +01:00
Mikael Ronstrom
72fbdeecab Fix for Windows 2009-02-24 16:43:05 +01:00
Anurag Shekhar
102dd4933c 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.
2009-02-24 20:44:47 +05:30
Alexey Botchkov
5beaba1d5b merging. 2009-02-24 15:34:00 +04:00
Alexey Botchkov
95f5d6a2cd merging. 2009-02-24 15:17:50 +04:00
Mikael Ronstrom
7f9af48946 Fixed silly mistake plus extra parenthesis 2009-02-23 22:21:22 +01:00
Mikael Ronstrom
664a1f9276 Fix ridiculous bug 2009-02-23 15:11:40 +01:00
Mikael Ronstrom
0180d7f589 Workaround for bug with gcc on Solaris using pthread_setschedprio
Improved data typing of server variables in InnoDB to avoid bugs on
Windows.
Workaround for bug in gcc assembler on 32-bit Mac OS X as well as
on Solaris.
2009-02-23 14:05:17 +01:00
Anurag Shekhar
84a72d4593 merging with changes in bugteam branch. 2009-02-23 15:39:08 +05:30
Mikael Ronstrom
d6278c115d Missed updating heap engine 2009-02-21 21:59:35 +01:00
Mikael Ronstrom
bccf56e535 Yet another attempt of getting DTrace builds done properly 2009-02-21 21:32:46 +01:00
Mikael Ronstrom
391fff8f73 A workaround to handle the problem with that
abs_top_srcdir doesn't work on some automake
platforms.

Done by copying the .d files to the build
directories.
2009-02-20 23:11:09 +01:00
Mikael Ronstrom
5767c1f826 Fix build issue on 32-bit Solaris using gcc 2009-02-20 12:32:51 +01:00
Mikael Ronstrom
76afa7ce07 Changed to use top_srcdir instead of abs_top_srcdir since many
automake tools on Solaris seems to have a bug related to the
use of abs_top_srcdir
2009-02-20 01:06:32 +01:00
Mikael Ronstrom
f603e1b634 More readability for DTrace commands 2009-02-20 00:56:25 +01:00
Davi Arnaut
a2e4449bfc 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.
2009-02-19 18:09:35 -03:00
Mikael Ronstrom
dd9119be20 Merged Performance Version 0.2.1 with latest 5.1 tree (last push 11 feb 14.01.13 2009) 2009-02-17 13:24:09 +01:00
Timothy Smith
858d40d82c 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
2d9421c3bb 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
c55d8297d8 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
Sergey Vojtovich
4c6692b707 Merge 5.1-bugteam -> 5.1-bugteam (local). 2009-02-12 14:25:12 +04:00
V Narayanan
d325957f88 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.
2009-02-12 16:42:07 +05:30
Mikael Ronstrom
d7d7cf6ce9 Updated InnoDB defaults
1) Buffer Pool size now defaults to 1GB and a minimum of 64MB
2) Log files are 3 by default and each 128MB in size
3) Removed innodb-file-io-threads config variable since no longer used
4) Set read io and write io threads to 8 by default for better default performance
5) Set log buffer size to 16 MB by default and minimum to 2MB
6) Set additional memory buffer pool to 8 MB and minimum to 2MB
7) Set max dirty percent to 75% and decreased to 99% to never allow a completely dirty buffer pool
8) Increased io capacity to 200 for a good default
2009-02-06 15:59:28 +01:00
Mikael Ronstrom
ec38999ae7 Reverted DTrace fix 2009-02-06 14:35:00 +01:00
Sergey Vojtovich
0acdf23f16 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.
2009-02-05 17:03:47 +04:00
Alexey Botchkov
9404e88dac merging 2009-02-05 10:33:06 +04:00
Alexey Botchkov
cf0d0a5e96 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
0924179398 auto-merge for BUG#42445. 2009-02-04 19:17:16 +00:00
Sergey Vojtovich
1ab3b31ff6 Merge 5.0-bugteam -> 5.1-bugteam. 2009-02-04 17:00:40 +04:00
Mikael Ronstrom
b040b460ed Added support for rep; nop replacing PAUSE due to Solaris bug
Replaced abs_top_srcdir with top_srcdir, not sure it's an
improvement but at least it's known that abs_top_srcdir
in cases have a problem and this is a more common variable
to use for the same purpose.
2009-02-03 12:46:52 +01:00
Alfranio Correia
70c94f3663 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
Georgi Kodinov
3aec7ca415 merged 5.1-main -> 5.1-bugteam 2009-01-30 15:44:49 +02:00
MySQL Build Team
8a2e76e629 Use sun_prefetch_read_many() and friends, instead of sparc_prefetch_read_many(),
etc.  The sparc_* are defined only for sparc, but the sun_* are generic for x86
and sparc (and are defined empty for any other platform).
2009-01-28 22:17:20 +01:00
Ramil Kalimullin
0151145310 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).
2009-01-26 10:35:15 +04:00
Luis Soares
14d4576bfe 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
Timothy Smith
2389815aba Add another cast to ignore int/ulong difference in error types, silence warning on Win64 2009-01-16 17:49:07 +01:00
Timothy Smith
5d8c3529ec 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
a2ccdd8b6a 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
e26b8a6cfe 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
c22f99ef81 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
c36cf42f05 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
2030b8cc09 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
9b79805805 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
ab216c8721 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
Tatiana A. Nurnberg
a7d03bf4ed 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.
2009-01-12 06:32:49 +01:00
Luis Soares
9d8c117598 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
Georgi Kodinov
8c25823f94 merged 5.1-main -> 5.1-bugteam 2009-01-05 18:10:20 +02:00
Sergey Glukhov
c9245922d6 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.
2008-12-29 16:50:51 +04:00
Mikael Ronstrom
bceeb36b45 DTrace fixes plus fixing a too long file name 2008-12-22 18:10:24 +01:00
Mikael Ronstrom
806cf36be0 A number of fixes to DTrace patch
Removed instance manager from builds
2008-12-20 15:16:46 +01:00
Mikael Ronstrom
0e5081cf85 Fixed missing declaration 2008-12-20 12:33:00 +01:00
Mikael Ronstrom
460cde4c6e Merge dtrace patch with latest performance version 2008-12-20 11:53:27 +01:00
Mikael Ronstrom
16a024c486 Backport of DTrace patches from 6.0 2008-12-20 11:01:41 +01:00
Timothy Smith
a146cd941f Auto-merge from 5.1-bugteam 2008-12-19 01:56:58 +01:00
Davi Arnaut
4bdb3d87fa Fix warnings and bug spotted by gcc-4.3.
Related to operator precedence and associativity.
Make the expressions as explicit as possible.
2008-12-16 10:12:22 -02:00
Mikael Ronstrom
2f2758604b Fixed bug 2008-12-15 11:19:47 +01:00
Mikael Ronstrom
da8108cfc8 Fixed missing header 2008-12-15 10:46:02 +01:00
Mikael Ronstrom
3bc2048309 Merge 2008-12-15 10:13:32 +01:00
Mikael Ronstrom
771fd7f017 Fix compiler error 2008-12-15 10:05:35 +01:00
Mikael Ronstrom
db5cf8bd90 Merged latest performance version 2008-12-15 09:55:07 +01:00
Mikael Ronstrom
cb52ac91da Merge latest 5.1 into performance version 2008-12-15 09:47:39 +01:00
Mikael Ronstrom
2f1a94ac40 Fixed compiler warnings on various platforms 2008-12-15 09:44:00 +01:00
Timothy Smith
03b790c2a7 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
2ae86017c5 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
2fb7a53f4d 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
3d3487658d 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
0dece1b2f0 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
a751331793 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
80ba0bf66f 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
cc231f988c 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
220ee82cb7 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
968608efb7 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
3b4e69ead5 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
b3d77069e9 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
cfd1095c79 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
fe769c968e 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
e4591eb25b 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
bc896a54c8 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
fef8e27a79 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
8b0a676eb4 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
980ec41fe7 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
85b06b4ea9 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
8b88249b0a 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
63a5c5708e 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
4e7bc33e0b 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
01710fb472 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
46c1980538 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
Mikael Ronstrom
0f0115a798 Yet another idef error 2008-12-12 23:44:39 +01:00
Mikael Ronstrom
5c52a441cc Fix of ifdef error 2008-12-12 22:39:12 +01:00
Mikael Ronstrom
625b7a00e9 Introduced a new timer based innodb thread concurrency. A new
parameter innodb_thread_concurrency_timer_based is used to
get this new feature (it is set by default). The new feature
is only available on platforms where atomic instructions are
available.
2008-12-12 21:17:15 +01:00
Mikael Ronstrom
2fd7cf9a25 Minor modifications to spin values which showed to be slightly better. 2008-12-10 18:54:23 +01:00
Mikael Ronstrom
8e2b83e733 Added a PAUSE instruction to the SPIN loop
according to recommendation from Intel.
2008-12-10 14:02:52 +01:00
Sergey Vojtovich
51f2783577 Merge. 2008-12-09 13:27:46 +04:00
Mikael Ronstrom
9eff32d900 Ensure background wake-up thread doesn't cause deadlocks 2008-12-05 14:08:28 +01:00
Mikael Ronstrom
fa5529eeb8 Added memory barriers to the portability layer in InnoDB
Removed dependency on pthread being an int
2008-12-05 13:43:10 +01:00
Mikael Ronstrom
2ed1383f6b call ha_release_temporary_latches to fix bug 32149 2008-12-04 16:03:02 +01:00
Mikael Ronstrom
f31e349ffd Fix to avoid compilation errors on Windows
Not the final fix, only a temporary fix
2008-12-04 11:57:56 +01:00
timothy.smith@sun.com
abd8574914 Merge from mysql-5.1.30-release 2008-11-27 00:02:10 +01:00
Build Team
d2c4816716 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
Alexey Botchkov
21c8760014 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
Mikael Ronstrom
b9ecc2b5dd Removed assert on waiters == 0 since that is now possible and not serious 2008-11-19 02:09:24 +01:00
Mikael Ronstrom
61cc839253 Fix for Percona reported bug with manual merge and fix of bug in
patch (changed to use of UNIV_SYNC_ATOMIC from faulty HAVE_ATOMIC_BUILTINS).
2008-11-17 23:04:36 +01:00
Mikael Ronstrom
d575f6ce34 Added counter of number of missed wakeups of InnoDB threads 2008-11-17 22:54:32 +01:00
kent.boortz@sun.com
906e12124c Changes of copyright output from "--version" and similar.
Changes of copyright in RPM spec file.
2008-11-14 17:29:38 +01:00
Andrei Elkin
2618337eb6 merging 5.1 -> 5.1 rpl. 3 of 4 conflicts are resolved similarly to 6.0->6.0-rpl merging.
mysql_upgrade results changed due to the error messesge of mysqlcheck has changed.
2008-11-12 19:51:47 +02:00
Build Team
366adeab08 Added "Sun Microsystems, Inc." to copyright headers on files modified
since Oct 1st
2008-11-10 21:21:49 +01:00
Mikael Ronstrom
8d162b444a Fixed spelling error 2008-10-30 18:38:47 +01:00
Mikael Ronstrom
090bcb74ab Merge port of Google SMP patch to Solaris 2008-10-30 10:23:36 +01:00
Mats Kindahl
1f29c52581 Merging 5.1 main into 5.1-rpl 2008-10-23 21:27:09 +02:00
Mikael Ronstrom
e21ed0a83e Fixed more compiler warnings 2008-10-17 13:50:14 +02:00
Mikael Ronstrom
96263b1d68 Fixed compiler warnings 2008-10-17 13:43:34 +02:00
Mikael Ronstrom
f0d789f190 Merged fixes to compiler errors and warnings 2008-10-17 12:09:45 +02:00
Mikael Ronstrom
9b848d9e7a Fixed a number of compiler issues and attempted a fix for
Windows compilation error.
2008-10-17 12:01:14 +02:00
Mikael Ronstrom
832f7c0274 Fixed a bug introduced by bazaar merge 2008-10-16 23:24:11 +02:00
Mikael Ronstrom
e2b66087e2 merge silly error 2008-10-16 22:18:26 +02:00
Mikael Ronstrom
eeddb067f4 Fixed silly error 2008-10-16 22:11:48 +02:00
Mikael Ronstrom
93805d96ad Merged Google compiler fixes 2008-10-16 21:13:42 +02:00
Mikael Ronstrom
27261d2d13 Fixed Windows compile issues 2008-10-16 21:06:14 +02:00
Mikael Ronstrom
c45dc11f41 merge Google changes to make it compile 2008-10-16 20:59:38 +02:00
Mikael Ronstrom
207225d542 A number of fixes of portability issues in Google patches 2008-10-16 20:45:12 +02:00
Mikael Ronstrom
d7de0b1774 merged into one Google InnoDB tree 2008-10-16 20:28:03 +02:00
Mikael Ronstrom
1f9e6ffc58 merged innobase changes into one tree 2008-10-16 20:18:39 +02:00
Mikael Ronstrom
b90c9a50b6 Remove compiler warnings 2008-10-16 20:07:50 +02:00
Mikael Ronstrom
57787e8dbc Fixed compiler issues 2008-10-16 19:59:04 +02:00
Mikael Ronstrom
5a45142242 Merged fix of compiler issue 2008-10-16 19:48:53 +02:00
Mikael Ronstrom
847c375bc0 Compile fixes, sun_prefetch.h only available on Sun Studio 2008-10-16 17:06:48 +02:00
Mikael Ronstrom
fcd2da609f Compile fix, sun_prefetch.h only available in Sun Studio 2008-10-16 17:04:44 +02:00
Mikael Ronstrom
f0e42724ad Fixed Windows bug in background IO patch 2008-10-16 09:10:30 +02:00
Mikael Ronstrom
7522b1975f merge Google SMP patch 2008-10-15 23:32:54 +02:00
Mikael Ronstrom
fd34712bc2 merged Google background IO threads 2008-10-15 20:56:47 +02:00
Mikael Ronstrom
2c252ba96b Google SMP patch 2008-10-15 20:54:18 +02:00
Mikael Ronstrom
186a5311dd merged io rate patch from Google 2008-10-15 20:48:46 +02:00
Mikael Ronstrom
bab9666d1c Google IO rate patch with a portability fix 2008-10-15 14:30:31 +02:00
Mikael Ronstrom
59ce72dedd merged configuration changes 2008-10-15 12:18:12 +02:00
Mikael Ronstrom
a6a94f83f7 Changed configuration defaults for improved performance on modern computers 2008-10-15 11:08:01 +02:00
Mikael Ronstrom
c4957c250d Merged Sparc Prefetch patch 2008-10-15 10:53:58 +02:00
Mikael Ronstrom
11157d3c56 3 google patches
SMP patch
Rate IO patch
Multiple IO threads patch
2008-10-14 09:56:07 +02:00
Mikael Ronstrom
e521a7588b Performance inline patch 2008-10-13 21:49:39 +02:00
Mikael Ronstrom
6c7f938a16 Sparc prefetch patch 2008-10-13 21:46:29 +02:00
Mattias Jonsson
2ae79e4fca Bug#37719: Crash if rename Archive table to same name with different
case and then select

Problem was that the archive share was using a case insensitive
charset when comparing table names

Solution was to use a case sensitive char set when the table
names are case sensitive
2008-10-03 20:08:40 +02:00
Mats Kindahl
43fb8633b0 Bug #38360: BLACKHOLE replication with RBR is broken
The Blackhole engine did not support row-based replication
since the delete_row(), update_row(), and the index and range
searching functions were not implemented.

This patch adds row-based replication support for the
Blackhole engine by implementing the two functions mentioned
above, and making the engine pretend that it has found the
correct row to delete or update when executed from the slave
SQL thread by implementing index and range searching functions.

It is necessary to only pretend this for the SQL thread, since
a SELECT executed on the Blackhole engine will otherwise never
return EOF, causing a livelock.
2008-10-02 11:02:38 +02:00
He Zhenxing
6e86e05823 Merge 5.1 main -> 5.1-rpl 2008-09-06 08:51:17 +08:00
Ramil Kalimullin
47f3a9acfb Merge 2008-08-26 18:53:22 +05:00
Alexey Botchkov
60fffe65b5 merging fixes 2008-08-26 14:31:17 +05:00
Alexey Botchkov
871201db3d merging 2008-08-23 07:47:43 +05:00
Timothy Smith
d8aa83b270 Cherry-pick some changes from innodb-5.1-ss2545 snapshot. Includes fixes for
Bug#37531, Bug#36941, Bug#36941, Bug#36942, Bug#38185.

Also include test case from Bug 34300 which was left out from earlier snapshot
(5.1-ss2387).

Also include fix for Bug #29507, "TRUNCATE shows to many rows effected", since
the fix for Bug 37531 depends on it.
2008-08-20 16:18:33 -06:00
Timothy Smith
1999186d89 Cherry-pick one change from innodb-5.1-ss2485 snapshot. Fixes Bug#35602.
Bug #35602 "Failed to read auto-increment value from storage engine" with
Innodb

The test for REPLACE was an error of ommission since it's classified as
a simple INSERT. For REPLACE statements we don't acquire the special
AUTOINC lock for AUTOINC_NEW_STYLE_LOCKING with this fix.
2008-08-19 18:40:56 -06:00
Timothy Smith
1a01d6a93b Cherry-pick some changes from innodb-5.1-ss2479 snapshot. Includes fixes for
Bug#36600 and Bug#36793:

Bug #36600 SHOW STATUS takes a lot of CPU in buf_get_latched_pages_number

Fix by removing the Innodb_buffer_pool_pages_latched variable from SHOW
STATUS output in non-UNIV_DEBUG compilation.

Bug #36793 rpl_innodb_bug28430 fails on Solaris

This is a back port from branches/zip. This code has been tested on a
big-endian machine too.
2008-08-19 18:37:41 -06:00
Timothy Smith
0473a0d670 Cherry-pick one part of innodb-5.1-ss2438 snapshot.
Bug #36278 Data_free in SHOW TABLE STATUS for InnoDB is in kilobytes

Change the fix for Bug 32440 to show bytes instead of kilobytes in
INFORMATION_SCHEMA.TABLES.DATA_FREE.
2008-08-19 18:29:46 -06:00
Chad MILLER
572a356617 Merge from 5.0-bugteam. 2008-08-15 15:30:17 -04:00
Sergey Glukhov
7eb1507ad1 Bug#36638 mysqld crashes when open file limit is passed and general query log enabled
The problem:
CSV storage engine open function returns success even
thought it failed to open the data file
The fix:
return error
Additional fixes:
added MY_WME to my_open to avoid mysterious error message
free share struct if open the file was unsuccessful
2008-08-15 11:53:54 +05:00
Ramil Kalimullin
5bafde319e Fix for bug#37537: myisamchk fails with Assertion failure with partitioned table
Problem: missed "break" in a switch leads to unexpected assertion failure
of 'myisamchk compressed_table'.

Fix: add the break.
2008-08-15 10:55:20 +05:00
Mattias Jonsson
07e9a6dc2a Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
partition is corrupt

The main problem was that ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR
PARTITION took another code path (over mysql_alter_table instead of
mysql_admin_table) which differs in two ways:
1) alter table opens the tables in a different way than admin tables do
   resulting in returning with error before it tried the command
2) alter table does not start to send any diagnostic rows to the client
   which the lower admin functions continue to use -> resulting in
   assertion crash

The fix:
Remapped ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION to use
the same code path as ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE t.
Adding check in mysql_admin_table to setup the partition list for
which partitions that should be used.


Partitioned tables will still not work with
REPAIR TABLE/PARTITION USE_FRM, since that requires moving partitions
to tables, REPAIR TABLE t USE_FRM, and check that the data still
fulfills the partitioning function and then move the table back to
being a partition.

NOTE: I have removed the following functions from the handler
interface:
analyze_partitions, check_partitions, optimize_partitions,
repair_partitions
Since they are not longer needed.
THIS ALTERS THE STORAGE ENGINE API
2008-08-11 20:02:03 +02:00
Sven Sandberg
500aa80db3 Merge 5.1 -> 5.1-rpl 2008-07-06 19:07:30 +02:00
Tatiana A. Nurnberg
5d7c155c6e Bug#36434: ha_innodb.so is installed in the wrong directory
ha_innodb.so was incorrectly installed in the lib/mysql
directory rather than in lib/mysql/plugin.

Amending CS for 31736.
2008-06-19 06:44:22 +02:00
Magnus Svensson
3d34d34c88 Merge 5.1->5.1-rpl
Fix paths and name of a few files to make it work with new mtr.pl
2008-05-30 11:12:07 +02:00
kostja@bodhi.(none)
2c0ce2a832 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  bodhi.(none):/opt/local/work/mysql-5.1-27430
2008-05-20 11:38:17 +04:00
tnurnberg@noir.wlan.koehntopp.de
71fdcc349c revert the following CS on grounds of "right patch, wrong time":
"Apply InnoDB snapshot innodb-5.1-ss2438.

  Addresses the following bugs:

  Change the fix for Bug#32440 to show bytes instead of kilobytes in
  INFORMATION_SCHEMA.TABLES.DATA_FREE.

  branches/5.1: Fix bug#29507 TRUNCATE shows to many rows effected
  In InnoDB, the row count is only a rough estimate used by SQL
  optimization. InnoDB is now return row count 0 for TRUNCATE operation.

  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().

  Fix Bug#36169 create innodb compressed table with too large row size crash
  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.

  Fix Bug#36434 ha_innodb.so is installed in the wrong directory
  Change pkglib_LTLIBRARIES with pkgplugin_LTLIBRARIES which has been
  forgotten in this commit: http://lists.mysql.com/commits/40206"
2008-05-14 10:45:32 +02:00
tsmith@ramayana.hindu.god
5bdd04bffa Apply InnoDB snapshot innodb-5.1-ss2438.
Addresses the following bugs:

  Change the fix for Bug#32440 to show bytes instead of kilobytes in
  INFORMATION_SCHEMA.TABLES.DATA_FREE.

  branches/5.1: Fix bug#29507 TRUNCATE shows to many rows effected
  In InnoDB, the row count is only a rough estimate used by SQL
  optimization. InnoDB is now return row count 0 for TRUNCATE operation.

  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().

  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.

  Fix Bug#36434 ha_innodb.so is installed in the wrong directory
  Change pkglib_LTLIBRARIES with pkgplugin_LTLIBRARIES which has been
  forgotten in this commit: http://lists.mysql.com/commits/40206
2008-05-10 11:55:53 -06:00
tsmith@ramayana.hindu.god
6265518976 Bug #34297: MySQL Server crashes when processing large table
Remove optimizations on innobase/mem/* to avoid apparent compiler bug which
causes memory overruns.  See also bug 19424, and probably bug 36366.

This is done in 5.1+; 5.0 already has this workaround in place.
2008-05-09 00:38:17 -06:00
msvensson@pilot.mysql.com
83283d8371 Revert faulty commit 2008-04-27 19:06:27 +02:00
msvensson@pilot.mysql.com
6f2e5dbf5a Add supression for expected warning(s) in slaves error log 2008-04-27 16:13:08 +02:00
gshchepa/uchum@host.loc
107b84f9bd Fixed bug#36006: Optimizer does table scan for SELECT COUNT(*)
for ENGINE=MRG_MYISAM (should be optimized out).

Before WL#3281 MERGE engine had the HA_NOT_EXACT_COUNT flag
unset, and it worked with COUNT optimization as desired.
After the removal of the HA_NOT_EXACT_COUNT flag neither
HA_STATS_RECORDS_IS_EXACT (opposite to former HA_NOT_EXACT_COUNT
flag) nor modern HA_HAS_RECORDS flag were not added to MERGE
table flag mask.

1. The HA_HAS_RECORDS table flag has been set.
2. The ha_myisammrg::records method has been overridden to
   calculate total number of records in underlying tables.
2008-04-26 02:45:58 +05:00
thek@kpdesk.mysql.com
f932e51b45 Merge kpdesk.mysql.com:/home/thek/Development/cpp/mysql-5.1
into  kpdesk.mysql.com:/home/thek/Development/cpp/mysql-5.1-merge
2008-04-14 12:58:53 +02:00
dlenev@mockturtle.local
15fd42b7dd Fix for bug #35733 "main.symlink.test fails".
The problem was that symlink.test failed due to debug assertions or
due to errors emitted for wrong statements (in non-debug builds)
if 6.0 version of server was run with --thread-handling=pool-of-threads
option.

The above problems were caused by that on the one hand code mi_create()
which handles case when error is returned relies on my_errno being set
to appropriate non-0 value, but on the other it has not done this
in case when error was emitted due to discovery that share for table
which we are going to create is already present in the list of open
shares. Running server with pool-of-threads option just exposed this
bug since in this scheduler mode my_errno is reset to 0 when connection
(THD) is reattached to the "real" thread.

This fix ensures that code in mi_create() properly sets my_errno in
the case described above.

Since original reason that caused this bug to be exposed in 6.0 tree
might also under very special conditions lead to incorrect behavior
of earlier versions of server (i.e. to errors emitted for wrong
statements) this patch is also being pushed into 5.1 tree.

No test case is present as this code is already covered by a test
case + pushbuild options combination in 6.0.
2008-04-07 12:59:57 +04:00