Commit graph

249 commits

Author SHA1 Message Date
sunny
e7b359e597 branches/5.1: Reset the statement level autoinc counter on ROLLBACK. Fix
the test results too.
rb://164
2009-10-12 03:09:56 +00:00
sunny
ef9f6104ea branches/5.1: Ignore negative values supplied by the user when calculating the
next value to store in dict_table_t. Setting autoincrement columns top negative
values is undefined behavior and this change should bring the behavior of
InnoDB closer to what users expect. Added several tests to check.
rb://162
2009-10-12 03:05:00 +00:00
jyang
d20d02dd11 branches/5.1: Fix bug #47777. Treat the Geometry data same as
Binary BLOB in ha_innobase::store_key_val_for_row(), since the
Geometry data is stored as Binary BLOB in Innodb.

Review: rb://180 approved by Marko Makela.
2009-10-07 22:27:08 +00:00
vasil
ece195f79f branches/5.1:
Fix Bug#38996 Race condition in ANALYZE TABLE

by serializing ANALYZE TABLE inside InnoDB.

Approved by:	Heikki (rb://175)
2009-10-01 11:55:49 +00:00
calvin
e38c14d772 branches/5.1: fix bug#42383: Can't create table 'test.bug39438'
For embedded server, MySQL may pass in full path, which is
currently disallowed. It is needed to relax the condition by
accepting full paths in the embedded case.

Approved by: Heikki (on IM)
2009-09-22 15:45:07 +00:00
jyang
1e3087580f branches/5.1: Disallow creating index with the name of
"GEN_CLUST_INDEX" which is reserved for the default system
primary index. (Bug #46000) rb://149 approved by Marko Makela.
2009-09-14 23:39:21 +00:00
jyang
5224d8a7b5 branches/5.1: Block creating table with column name conflicting
with Innodb reserved key words. (Bug #44369) rb://151 approved
by Sunny Bains.
2009-09-10 20:43:05 +00:00
vasil
2fb3a5a7e4 branches/5.1:
Fix a compilation warning caused by c5799:

handler/ha_innodb.cc: In function 'void innobase_get_cset_width(ulint, ulint*, ulint*)':
handler/ha_innodb.cc:830: warning: format '%d' expects type 'int', but argument 2 has type 'ulint'
2009-09-10 04:41:48 +00:00
calvin
d6784c3d49 branches/5.1: fix bug#46256
Allow tables to be dropped even if the collation is not found,
but issue a warning.

Could not find an easy way to add mysql-test since it requires
changes to charsets and restarting the server. Tests were
executed manually.

Approved by: Heikki (on IM)
2009-09-09 16:47:31 +00:00
calvin
180ed3e47f branches/5.1: merge change from 5.1.38
HA_ERR_TOO_MANY_CONCURRENT_TRXS is added in 5.1.38.
2009-09-09 14:26:29 +00:00
jyang
db933d00cf branches/5.1: This is to revert change 5741. A return status for
create_table_def() needs to be fixed.
2009-09-04 03:07:34 +00:00
jyang
c62eae809d branches/5.1: Revert change in 5740. Making the fix in a subsequent
check in.
2009-09-04 00:26:13 +00:00
jyang
4af9311006 branches/5.1: Block creating table with column name conflicting
with Innodb reserved key words. (Bug #44369) rb://151 approved
by Sunny Bains.
2009-09-03 03:16:01 +00:00
jyang
6d890859de branches/5.1: Disallow creating index with the name of
"GEN_CLUST_INDEX" which is reserved for the default system
primary index. (Bug #46000) rb://149 approved by Sunny Bains.
2009-09-03 02:33:47 +00:00
vasil
03906dfb7c branches/5.1:
Merge a change from MySQL:

  ------------------------------------------------------------
  revno: 2874.2.1
  committer: Anurag Shekhar <anurag.shekhar@sun.com>
  branch nick: mysql-5.1-bugteam-windows-warning
  timestamp: Wed 2009-05-13 15:41:24 +0530
  message:
    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.
  modified:
    storage/archive/ha_archive.cc
    storage/federated/ha_federated.cc
    storage/innobase/handler/ha_innodb.cc
    storage/myisam/ha_myisam.cc
2009-07-20 07:29:47 +00:00
vasil
6fab83e12e branches/5.1:
Fix Bug#21704 Renaming column does not update FK definition

by checking whether a column that participates in a FK definition is being
renamed and denying the ALTER in this case.

The patch was originally developed by Davi Arnaut <Davi.Arnaut@Sun.COM>:
http://lists.mysql.com/commits/77714
and was later adjusted to conform to InnoDB coding style by me (Vasil),
I also added some more comments and moved the bug specific mysql-test to
a separate file to make it more manageable and flexible.
2009-07-09 15:16:44 +00:00
marko
274dd54952 branches/5.1: Merge r5418 from branches/zip:
------------------------------------------------------------------------
  r5418 | marko | 2009-06-25 15:55:52 +0300 (Thu, 25 Jun 2009) | 5 lines
  Changed paths:
     M /branches/zip/ChangeLog
     M /branches/zip/handler/ha_innodb.cc
     M /branches/zip/mysql-test/innodb_bug42101-nonzero.result
     M /branches/zip/mysql-test/innodb_bug42101-nonzero.test
     M /branches/zip/mysql-test/innodb_bug42101.result
     M /branches/zip/mysql-test/innodb_bug42101.test
  
  branches/zip: Fix a race condition caused by
  SET GLOBAL innodb_commit_concurrency=DEFAULT. (Bug #45749)
  When innodb_commit_concurrency is initially set nonzero,
  DEFAULT would change it back to 0, triggering Bug #42101.
  rb://139 approved by Heikki Tuuri.
  ------------------------------------------------------------------------
2009-06-25 12:11:57 +00:00
vasil
13738529ee branches/5.1:
Remove the word "Error" from the printout because the mysqltest suite
interprets it as an error and thus the innodb-autoinc test fails.

Approved by:	Sunny (via IM)
2009-06-05 06:29:16 +00:00
sunny
992a74f4d1 branches/5.1: When the InnoDB and MySQL data dictionaries go out of sync, before
the bug fix we would assert on missing autoinc columns. With this fix we allow
MySQL to open the table but set the next autoinc value for the column to the
MAX value. This effectively disables the next value generation. INSERTs will
fail with a generic AUTOINC failure. However, the user should be able to
read/dump the table, set the column values explicitly, use ALTER TABLE to
set the next autoinc value and/or sync the two data dictionaries to resume
normal operations.

Fix Bug#44030 Error: (1500) Couldn't read the MAX(ID) autoinc value from the
index (PRIMARY)

rb://118
2009-06-03 23:17:14 +00:00
marko
f1439b00db 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-14 11:04:55 +00:00
vasil
1bf3bcbc99 branches/5.1:
Merge a change from MySQL:

  ------------------------------------------------------------
  revno: 2728.10.2
  committer: Ignacio Galarza <iggy@mysql.com>
  branch nick: mysql-5.1-bugteam-bug29125
  timestamp: Fri 2009-02-13 11:41:47 -0500
  message:
    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
  modified:
    client/mysql_upgrade.c
    client/mysqladmin.cc
    client/mysqlbinlog.cc
    client/mysqlcheck.c
    client/mysqldump.c
    client/mysqlslap.c
    client/mysqltest.cc
    client/sql_string.cc
    extra/comp_err.c
    extra/yassl/src/buffer.cpp
    extra/yassl/taocrypt/include/block.hpp
    extra/yassl/taocrypt/src/algebra.cpp
    extra/yassl/taocrypt/src/asn.cpp
    include/config-win.h
    libmysql/libmysql.c
    mysys/array.c
    mysys/base64.c
    mysys/charset.c
    mysys/checksum.c
    mysys/default.c
    mysys/default_modify.c
    mysys/hash.c
    mysys/mf_keycache.c
    mysys/mf_tempdir.c
    mysys/my_append.c
    mysys/my_compress.c
    mysys/my_conio.c
    mysys/my_copy.c
    mysys/my_getwd.c
    mysys/my_pread.c
    mysys/my_quick.c
    mysys/my_read.c
    mysys/safemalloc.c
    mysys/string.c
    server-tools/instance-manager/buffer.cc
    server-tools/instance-manager/instance.cc
    server-tools/instance-manager/options.cc
    server-tools/instance-manager/parse.h
    sql-common/client.c
    sql-common/my_user.c
    sql/event_data_objects.cc
    sql/event_parse_data.cc
    sql/events.cc
    sql/gen_lex_hash.cc
    sql/item.h
    sql/item_func.cc
    sql/item_strfunc.cc
    sql/item_timefunc.cc
    sql/lock.cc
    sql/log_event.cc
    sql/log_event.h
    sql/log_event_old.cc
    sql/net_serv.cc
    sql/sp_head.h
    sql/spatial.h
    sql/sql_class.h
    sql/sql_connect.cc
    sql/sql_crypt.cc
    sql/sql_error.cc
    sql/sql_insert.cc
    sql/sql_lex.cc
    sql/sql_lex.h
    sql/sql_load.cc
    sql/sql_prepare.cc
    sql/sql_profile.cc
    sql/sql_repl.cc
    sql/sql_servers.cc
    sql/sql_string.cc
    sql/sql_table.cc
    sql/sql_trigger.cc
    sql/sql_udf.cc
    sql/sql_view.cc
    sql/udf_example.c
    sql/uniques.cc
    storage/archive/azio.c
    storage/archive/azlib.h
    storage/csv/ha_tina.cc
    storage/csv/ha_tina.h
    storage/csv/transparent_file.h
    storage/federated/ha_federated.cc
    storage/federated/ha_federated.h
    storage/heap/hp_write.c
    storage/innobase/handler/ha_innodb.cc
    storage/innobase/include/pars0pars.h
    storage/myisam/ha_myisam.cc
    storage/myisam/mi_check.c
    storage/myisam/mi_packrec.c
    storage/myisam/mi_search.c
    storage/myisam/rt_index.c
    storage/myisammrg/ha_myisammrg.cc
    strings/ctype.c
    strings/my_vsnprintf.c
    tests/bug25714.c
    tests/mysql_client_test.c
2009-04-17 20:32:08 +00:00
vasil
996238b4a6 branches/5.1:
Merge a change from MySQL (looks like this is against 5.0 but they later
merged it to 5.1):

  ------------------------------------------------------------
  revno: 1810.3846.1
  committer: Alexey Botchkov <holyfoot@mysql.com>
  branch nick: 31435
  timestamp: Tue 2008-11-11 14:42:32 +0400
  message:
    Bug#31435 ha_innodb.cc:3983: ulint convert_search_mode_to_innobase(ha_rkey_function): Asse 
        I think we don't need to issue an error statement in the convert_search_mode_to_innobase().
        Returning the PAGE_CUR_UNSUPP value is enough as allows to handle this
        case depending on the requirements.
    
    per-file comments:
      sql/ha_innodb.cc 
    Bug#31435 ha_innodb.cc:3983: ulint convert_search_mode_to_innobase(ha_rkey_function): Asse 
         no error issued in convert_search_mode_to_innobase.
         ha_innobase::records_in_range() returns HA_POS_ERROR if search mode isn't supported.
  modified:
    sql/ha_innodb.cc
2009-04-15 07:55:18 +00:00
vasil
fc7d1cf033 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-09 10:01:52 +00:00
vasil
e0281553ce branches/5.1:
Merge a change from MySQL:

  ------------------------------------------------------------
  revno: 2747
  committer: Timothy Smith <timothy.smith@sun.com>
  branch nick: 51
  timestamp: Fri 2009-01-16 17:49:07 +0100
  message:
    Add another cast to ignore int/ulong difference in error types, silence warning on Win64
  modified:
    storage/innobase/handler/ha_innodb.cc
2009-03-05 19:42:01 +00:00
vasil
c3fb485c2a branches/5.1:
Merge a change from MySQL:

  ------------------------------------------------------------
  revno: 2728.19.1
  committer: Alfranio Correia <alfranio.correia@sun.com>
  branch nick: mysql-5.1-bugteam
  timestamp: Tue 2009-02-03 11:36:46 +0000
  message:
    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.
  modified:
    storage/innobase/handler/ha_innodb.cc
2009-03-05 19:21:10 +00:00
sunny
e2cd6d3572 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-02 00:28:52 +00:00
sunny
2016ae3262 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-02-25 03:32:01 +00:00
calvin
2560a78eeb branches/5.1: minor non-functional changes. 2009-02-11 23:34:27 +00:00
sunny
5f580c47f8 branches/5.1: Add the ULL suffix otherwise there is an overflow. 2009-02-03 20:06:52 +00:00
sunny
64076dc477 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
2009-01-29 14:01:36 +00:00
vasil
3f5355a0e1 branches/5.1:
Merge a change from MySQL:

  ------------------------------------------------------------
  revno: 2646.161.4
  committer: Tatiana A. Nurnberg <azundris@mysql.com>
  branch nick: 51-31177v2
  timestamp: Mon 2009-01-12 06:32:49 +0100
  message:
    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-26 15:26:25 +00:00
marko
d32440100b 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 COMMITTED mode.
(Bug #41671, Issue #146)

rb://67 approved by Heikki Tuuri
2008-12-22 14:05:19 +00:00
marko
7f5f09d63a 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
2008-12-18 13:33:36 +00:00
inaam
9b4f5f6f9f branches/5.1:
Fix Bug#40760 "set global innodb_thread_concurrency = 0;" is not safe

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
2008-11-24 20:06:50 +00:00
calvin
fff52da321 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)
2008-11-14 18:31:48 +00:00
vasil
fd5bac6715 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)
2008-10-28 10:10:25 +00:00
sunny
4ef075b54b 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.

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
rb://16
2008-10-23 04:30:32 +00:00
sunny
a37b1be6df 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.

This fixes Bug#37788 InnoDB Plugin: AUTO_INCREMENT wrong for compressed tables
2008-10-22 21:42:24 +00:00
sunny
2e84d822af 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

Bug#40224 New AUTOINC changes mask reporting of deadlock/timeout errors
2008-10-22 08:01:18 +00:00
vasil
06683f69d4 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-10-21 06:08:30 +00:00
vasil
efadb7ce97 branches/5.1:
Non-functional change: use a single tab instead of 12 spaces between
variable type and variable name.
2008-10-20 10:09:01 +00:00
marko
60bc29b7c4 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-10-09 06:53:09 +00:00
sunny
5ad03895b3 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-10-03 22:48:04 +00:00
sunny
717ad60f18 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-10-03 22:08:23 +00:00
vasil
78e5879137 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-10-03 15:52:39 +00:00
vasil
859c2873fc 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.

Looks like it is not possible to avoid mysqld printing warnings in the
mysql-test case and thus this test innodb_bug39438 must be added to the
list of exceptional test cases that are allowed to print warnings. For this,
the following patch must be applied to the mysql source tree:

  --- cut ---
  === modified file 'mysql-test/lib/mtr_report.pl'
  --- mysql-test/lib/mtr_report.pl	2008-08-12 10:26:23 +0000
  +++ mysql-test/lib/mtr_report.pl	2008-10-01 11:57:41 +0000
  @@ -412,7 +412,10 @@
   
                   # When trying to set lower_case_table_names = 2
                   # on a case sensitive file system. Bug#37402.
  -                /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive.  Now setting lower_case_table_names to 0 to avoid future problems./
  +                /lower_case_table_names was set to 2, even though your the file system '.*' is case sensitive.  Now setting lower_case_table_names to 0 to avoid future problems./ or
  +
  +                # this test is expected to print warnings
  +                ($testname eq 'main.innodb_bug39438')
   		)
               {
                 next;                       # Skip these lines
  
  --- cut ---

The mysql-test is currently somewhat disabled (see inside
innodb_bug39438.test), after the above patch has been applied to the mysql
source tree, the test can be enabled.

rb://20

Reviewed by:	Inaam, Calvin
Approved by:	Heikki
2008-10-03 14:17:28 +00:00
sunny
8a92f6fe2c 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-09-30 07:41:56 +00:00
inaam
e085881474 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-09-16 15:11:26 +00:00
sunny
0e039a4caf 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-08-23 21:19:05 +00:00
marko
06be45c3d1 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-08-21 12:25:05 +00:00