Commit graph

674 commits

Author SHA1 Message Date
Timothy Smith
021d7d72f8 Cherry-pick InnoDB fixes for Bug#34286, Bug#35352, and Bug#36600 from snapshot
innodb-5.0-ss2475.

Bug #34286  Assertion failure in thread 2816 in file .\row\row0sel.c line 3500
Since autoinc init performs a MySQL SELECT query to determine the auto-inc
value, set prebuilt->sql_stat_start = TRUE so that it is performed like any
normal SELECT, regardless of the context in which it was invoked.


Bug #35352  If InnoDB crashes with UNDO slots full error the error persists on restart
We've added a heuristic that checks the size of the UNDO slots cache lists
(insert and upate). If either of cached lists has more than 500 entries then we
add any UNDO slots that are freed, to the common free list instead of the cache
list, this is to avoid the case where all the free slots end up in only one of
the lists on startup after a crash.

Tested with test case for 26590 and passes all mysql-test(s).

Bug #36600  SHOW STATUS takes a lot of CPU in buf_get_latched_pages_number
Fixed by removing the Innodb_buffer_pool_pages_latched variable from SHOW
STATUS output in non-UNIV_DEBUG compilation.
2008-07-31 15:47:57 -06:00
gkodinov/kgeorge@macbook.gmz
7cb4b7c19d fixed warnings and compile errors from the fix for bug 26243 2008-03-29 09:52:16 +02:00
iggy@amd64.(none)
79e434bc67 Bug#26243 mysql command line crash after control-c
- Backported the 5.1 DBUG to 5.0.
- Avoid memory cleanup race on Windows client for CTRL-C
2008-03-28 14:02:27 -04:00
tsmith@ramayana.hindu.god
fa257c031c Applied innodb-5.0-ss2223 snapshot
Fixes:

Bug #32083: server crashes on show status when InnoDB is not initialized
  innodb_export_status(): Check that InnoDB has been initialized
  before invoking srv_export_innodb_status().  (Bug #32083)
  This bug does not exist in MySQL/InnoDB 5.1.
2008-01-23 18:20:04 -07:00
tsmith@ramayana.hindu.god
2b985d0762 Applied InnoDB snapshot innodb-5.0-ss2095
Fixes the following bugs:

- Bug #29560: InnoDB >= 5.0.30 hangs on adaptive hash rw-lock 'waiting for an X-lock'

  Fixed a race condition in the rw_lock where an os_event_reset()
  can overwrite an earlier os_event_set() triggering an indefinite
  wait.
  NOTE: This fix for windows is different from that for other platforms.
  NOTE2: This bug is introduced in the scalability fix to the
  sync0arr which was applied to 5.0 only. Therefore, it need not be
  applied to the 5.1 tree. If we decide to port the scalability fix
  to 5.1 then this fix should be ported as well.

- Bug #32125: Database crash due to ha_innodb.cc:3896: ulint convert_search_mode_to_innobase

  When unknown find_flag is encountered in convert_search_mode_to_innobase()
  do not call assert(0); instead queue a MySQL error using my_error() and
  return the error code PAGE_CUR_UNSUPP. Change the functions that call
  convert_search_mode_to_innobase() to handle that error code by "canceling"
  execution and returning appropriate error code further upstream.
2007-11-20 10:53:19 -07:00
gluh@eagle.(none)
237383f0fe Merge mysql.com:/home/gluh/MySQL/Merge/5.0
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt
2007-10-23 18:51:43 +05:00
holyfoot/hf@mysql.com/hfmain.(none)
9f323e1a3a type conversions fixed to avoid warnings on Windows 2007-10-23 14:27:11 +05:00
tsmith@sita.local
0111438b45 Bug #20358: InnoDB hang on the adaptive hash index latch in btr0sea.c
Add --skip-innodb-adaptive-hash-index option, which is a way to
work around the bug (by disabling the adaptive hash feature entirely).

This may be useful even once the bug is fixed, for benchmarking purposes.
There are some workloads for which the adaptive hash index is not effective.
2007-10-02 23:47:30 -06:00
tsmith@ramayana.hindu.god
5e926bc120 NULL MERGE this ChangeSet to 5.1
Apply innodb-5.0-ss1696 snapshot

Fixes:
- Bug#20090: InnoDB: Error: trying to declare trx to enter InnoDB
- Bug#23710: crash_commit_before fails if innodb_file_per_table=1
  At InnoDB startup consider the case where log scan went beyond
  checkpoint_lsn as a crash and initiate crash recovery code path.
- Bug#28781: InnoDB increments auto-increment value incorrectly with ON DUPLICATE KEY UPDATE
  We need to do some special AUTOINC handling for the following case:
  INSERT INTO t (c1,c2) VALUES(x,y) ON DUPLICATE KEY UPDATE ...
  We need to use the AUTOINC counter that was actually used by
  MySQL in the UPDATE statement, which can be different from the
  value used in the INSERT statement.
- Bug#29097: fsp_get_available_space_in_free_extents() is capped at 4TB
  Fix by typecasting the variables before multiplying them, so that the
  result of the multiplication is of type "unsigned long long".
- Bug#29155: Innodb "Parallel recovery" is not prevented
  Fix by enabling file locking on FreeBSD.  It has been disabled because
  InnoDB has refused to start on FreeBSD & LinuxThreads, but now it
  starts just fine.
2007-08-15 17:20:54 -06:00
evgen@moonbone.local
86c3d95c3c ha_innodb.cc:
Warning fixed.
2007-07-31 17:42:48 +04:00
evgen@moonbone.local
002696b648 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/24989-bug-5.0-opt-mysql
2007-07-30 18:10:34 +04:00
evgen@moonbone.local
8de5603d1d Bug#24989: The DEADLOCK error is improperly handled by InnoDB.
When innodb detects a deadlock it calls ha_rollback_trans() to rollback the 
main transaction. But such action isn't allowed from inside of triggers and
functions. When it happen the 'Explicit or implicit commit' error is thrown
even if there is no commit/rollback statements in the trigger/function. This
leads to the user confusion.

Now the convert_error_code_to_mysql() function doesn't call the 
ha_rollback_trans() function directly but rather calls the
mark_transaction_to_rollback function and returns an error.
The sp_rcontext::find_handler() now doesn't allow errors to be caught by the
trigger/function error handlers when the thd->is_fatal_sub_stmt_error flag
is set. Procedures are still allowed to catch such errors.
The sp_rcontext::find_handler function now accepts a THD handle as a parameter.
The transaction_rollback_request and the is_fatal_sub_stmt_error flags are 
added to the THD class. The are initialized by the THD class constructor.
Now the ha_autocommit_or_rollback function rolls back main transaction
when not in a sub statement and the thd->transaction_rollback_request
is set.
The THD::restore_sub_statement_state function now resets the 
thd->is_fatal_sub_stmt_error flag on exit from a sub-statement.
2007-07-30 17:14:34 +04:00
gkodinov/kgeorge@magare.gmz
33518801fb Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B29644-5.0-opt
2007-07-23 17:07:29 +03:00
gkodinov/kgeorge@magare.gmz
174dcb07ab Bug #29644: alter table hangs if records locked in share mode
by long running transaction

On Windows opened files can't be deleted. There was a special
upgraded lock mode (TL_WRITE instead of TL_WRITE_ALLOW_READ) 
in ALTER TABLE to make sure nobody has the table opened
when deleting the old table in ALTER TABLE. This special mode
was causing ALTER TABLE to hang waiting on a lock inside InnoDB.
This special lock is no longer necessary as the server is 
closing the tables it needs to delete in ALTER TABLE.
Fixed by removing the special lock.
Note that this also reverses the fix for bug 17264 that deals with
another consequence of this special lock mode being used.
2007-07-20 14:17:15 +03:00
tsmith@sita.local
ccea97fa6f NULL MERGE UP to 5.1.
Apply innodb-5.0-* snapshots:  ss1489 and ss1547.

Fixes:
Bug#9709:  InnoDB inconsistensy causes "Operating System Error 32/33"
Bug#22819: SHOW INNODB STATUS crashes the server with an assertion failure under high load
Bug#25645: Assertion failure in file srv0srv.c
Bug#27294: insert into ... select ... causes crash with innodb_locks_unsafe_for_binlog=1
Bug#28138: indexing column prefixes produces corruption in InnoDB
2007-07-10 08:16:51 -06:00
monty@mysql.com/narttu.mysql.fi
9a59083163 Allow multiple calls to mysql_server_end()
(Part of fix for Bug#25621 Error in my_thread_global_end(): 1 threads didn't exit)
Give correct error message if InnoDB table is not found
(This allows us to drop a an innodb table that is not in the InnoDB registery)
2007-06-20 19:22:27 +03:00
holyfoot/hf@mysql.com/hfmain.(none)
e2f6bd86b4 Merge bk@192.168.21.1:mysql-5.0
into  mysql.com:/d2/hf/mrg/mysql-5.0-opt
2007-04-29 18:42:50 +05:00
gshchepa/uchum@gshchepa.loc
5983038a66 Fixed bug #27650:
INSERT into InnoDB table may cause "ERROR 1062 (23000): Duplicate entry..."
errors or lost records after multi-row INSERT of the form:
"INSERT INTO t (id...) VALUES (NULL...) ON DUPLICATE KEY UPDATE id=VALUES(id)",
where "id" is an AUTO_INCREMENT column.

It happens because InnoDB handler forgets to save next insert id after
updating of auto_increment column with new values. As result of that
last insert id stored inside InnoDB dictionary tables differs from it's
cached thd->next_insert_id value.
2007-04-26 02:01:23 +05:00
tsmith@siva.hindu.god
d232cead7b Apply innodb-5.0-ss1405 snapshot
NULL MERGE: this ChangeSet will be null merged into mysql-5.1

Fixes:

- Bug #26662: mysqld assertion when creating temporary (InnoDB) table on a tmpfs filesystem
  Fix by not open(2)ing with O_DIRECT but rather calling fcntl(2) to set
  this flag immediately after open(2)ing. This way an error caused by
  O_DIRECT not being supported can easily be ignored.
- Bug #23313: AUTO_INCREMENT=# not reported back for InnoDB tables
- Bug #21404: AUTO_INCREMENT value reset when Adding FKEY (or ALTER?)
  Report the current value of the AUTO_INCREMENT counter to MySQL.
2007-04-18 19:36:22 -06:00
tsmith@siva.hindu.god
8abc953662 NULL MERGE this to 5.1
Apply the following InnoDB snapshots:
innodb-5.0-ss1319
innodb-5.0-ss1331
innodb-5.0-ss1333
innodb-5.0-ss1341

Fixes:
- Bug #21409: Incorrect result returned when in READ-COMMITTED with query_cache ON
  At low transaction isolation levels we let each consistent read set
  its own snapshot.
- Bug #23666: strange Innodb_row_lock_time_% values in show status; also millisecs wrong
  On Windows ut_usectime returns secs and usecs relative to the UNIX
  epoch (which is Jan, 1 1970).

- Bug #25494: LATEST DEADLOCK INFORMATION is not always cleared
  lock_deadlock_recursive(): When the search depth or length is exceeded,
  rewind lock_latest_err_file and display the two transactions at the
  point of aborting the search.

- Bug #25927: Foreign key with ON DELETE SET NULL on NOT NULL can crash server
  Prevent ALTER TABLE ... MODIFY ... NOT NULL on columns for which
  there is a foreign key constraint ON ... SET NULL.

- Bug #26835: Repeatable corruption of utf8-enabled tables inside InnoDB
  The bug could be reproduced as follows:

  Define a table so that the first column of the clustered index is
  a VARCHAR or a UTF-8 CHAR in a collation where sequences of bytes
  of differing length are considered equivalent.

  Insert and delete a record.  Before the delete-marked record is
  purged, insert another record whose first column is of different
  length but equivalent to the first record.  Under certain conditions,
  the insertion can be incorrectly performed as update-in-place.

  Likewise, an operation that could be done as update-in-place can
  unnecessarily be performed as delete and insert, but that would not
  cause corruption but merely degraded performance.
2007-03-22 14:40:52 -06:00
anozdrin/alik@booka.opbmk
c666e2f276 Polishing: use constants instead of magic numbers. 2007-03-09 08:05:08 +03:00
monty@mysql.com/narttu.mysql.fi
e5cc397f33 Fixed compiler warnings (for linux and win32 and win64)
Fixed a couple of usage of not initialized warnings (unlikely cases)
2007-02-22 16:59:57 +02:00
kent@mysql.com/kent-amd64.(none)
226a5c833f Many files:
Changed header to GPL version 2 only
2006-12-23 20:17:15 +01:00
tsmith/tim@siva.hindu.god
0d5dc51438 Added innodb_rollback_on_timeout option to restore the 4.1
InnoDB timeout behavior (Bug #24200)
2006-12-19 16:57:51 -07:00
dfischer/mysqldev@mysql.com/production.mysql.com
3cc1a4251a Merge mysql.com:/data0/mysqldev/my/mysql-5.0-release
into  mysql.com:/data0/mysqldev/my/build-200612151202-5.0.32/mysql-5.0-release
2006-12-19 11:48:08 +01:00
tsmith/tim@siva.hindu.god
d60550a4d6 This ChangeSet must be null-merged to 5.1.
Applied innodb-5.0-ss1040 and innodb-5.0-ss1099 snapshots.

Bugs fixed:
- Bug #21468: InnoDB crash during recovery with corrupted data pages: XA bug?
- Bug #24299: Identifiers in foreign keys cannot contain U+0160, U+0360, ..., U+FF60
- Bug #24386: Performance degradation caused by instrumentation in mutex_struct
- Bug #24712: SHOW TABLE STATUS for file-per-table showing incorrect time fields
2006-12-18 18:41:38 -07:00
monty@mysql.com/narttu.mysql.fi
3d40956039 Fixed portability issue in my_thr_init.c (was added in my last push)
Fixed compiler warnings (detected by VC++):
- Removed not used variables
- Added casts
- Fixed wrong assignments to bool
- Fixed wrong calls with bool arguments
- Added missing argument to store(longlong), which caused wrong store method to be called.
2006-11-30 18:25:05 +02:00
monty@mysql.com/nosik.monty.fi
e825879800 Remove compiler warnings
(Mostly in DBUG_PRINT() and unused arguments)
Fixed bug in query cache when used with traceing (--with-debug)
Fixed memory leak in mysqldump
Removed warnings from mysqltest scripts (replaced -- with #)
2006-11-20 22:42:06 +02:00
cmiller@zippy.cornsilk.net
af5acac047 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
2006-11-02 17:39:52 -05:00
tsmith/tim@siva.hindu.god
deee020489 Apply InnoDB snapshot ss923
Fixes:
- Bug #18077: InnoDB uses full explicit table locks in stored FUNCTION
2006-10-20 12:34:31 -06:00
stewart@willster.(none)
c1903d967a Merge willster.(none):/home/stewart/Documents/MySQL/4.1/bug19914-mk2
into  willster.(none):/home/stewart/Documents/MySQL/5.0/bug19914-mk2-merge
2006-10-16 17:39:38 +10:00
cmiller@zippy.cornsilk.net
987b1b59e3 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
2006-09-23 09:48:43 -04:00
tsmith/tim@siva.hindu.god
3724c1276b Applied innodb snapshot ss792 and ss854.
This ChangeSet will be null-merged to mysql-5.1.

Bugs fixed:
- Bug #21638:  InnoDB: possible segfault in page_copy_rec_list_end_no_locks
  If prefix_len is specified, write it to the insert buffer instead of type->len
- bug #10746:  InnoDB: Error: stored_select_lock_type is 0 inside ::start_stmt()!
  INSERT ... SELECT uses LOCK_NONE in innodb_locks_unsafe_for_binlog mode, so do
  not check for LOCK_X or LOCK_S in start_stmt()
2006-09-20 13:00:49 -06:00
acurtis/antony@xiphis.org/ltantony.xiphis.org
678e15174e Bug#20573
"strict mode: inserts autogenerated auto_increment value bigger than max"
  Strict mode should fail if autoincrement value is out of range
2006-08-30 13:20:39 -07:00
tnurnberg@salvation.intern.azundris.com
c8d1c498fb innodb r702
innodb r719
2006-08-18 14:16:11 +02:00
stewart@willster.(none)
9d2e6b8d23 BUG#19914 SELECT COUNT(*) sometimes returns MAX_INT on cluster tables
allow handler::info to return an error code (that will be returned to the user)
2006-08-10 22:55:20 +08:00
tsmith@maint1.mysql.com
951eb48a62 Applied innodb-5.0-ss677 snapshot.
Fixes:
- bug #19834: Using cursors when running in READ-COMMITTED can cause InnoDB to crash
- bug #21112: InnoDB slow with > 100,000 .ibd files
- bug #21113: Duplicate printout in SHOW INNODB STATUS
2006-08-01 21:59:58 +02:00
elliot@mysql.com
37e5ec9f50 Applying patch from SergeyV
Fixes bug#17264, for alter table on win32 for successfull operation completion
it is used TL_WRITE(=10) lock instead of TL_WRITE_ALLOW_READ(=6), however here
in innodb handler TL_WRTIE is lifted to TL_WRITE_ALLOW_WRITE, which causes
race condition when several clients do alter table simultaneously.
2006-06-20 13:43:13 -04:00
aivanov@mysql.com
f748232437 Applied innodb-5.0-ss547 snapshot.
Fix BUG#19542 "InnoDB doesn't increase the Handler_read_prev counter".
2006-05-15 18:02:21 +04:00
aivanov@mysql.com
9595317cfa Applied innodb-4.1-ss29 snapshot.
Fix BUG#19542 "InnoDB doesn't increase the Handler_read_prev counter.
2006-05-15 17:25:37 +04:00
grog@mysql.com[grog]
3eb783813f foo2 2006-04-13 17:22:56 +09:30
grog@mysql.com[grog]
b2cd3a963a foo1 2006-04-13 17:20:33 +09:30
aivanov@mysql.com
771fb26e58 Applied innodb-5.0-ss398 snapshot.
Fixed BUG#15650: DELETE with LEFT JOIN crashes server
 with innodb_locks_unsafe_for_binlog.
 Fixed compilation problem with non-C99 compilers
 in btr0sea.c
2006-04-01 01:54:15 +04:00
aivanov@mysql.com
99d178033a Applied innodb-5.0-ss368 snapshot
Fixed bugs:
  #16814: SHOW INNODB STATUS format error in LATEST FOREIGN KEY ERROR section
    dict_foreign_key_error_report(): Always print a newline after invoking
    dict_print_info_on_foreign_key_in_create_format().
  #16827: Better InnoDB error message if ibdata files omitted from my.cnf.
  #17126: CHECK TABLE on InnoDB causes a short hang during check of adaptive hash.
    CHECK TABLE blocking other queries, by releasing the btr_search_latch
    periodically during the adaptive hash table validation.
  #17405: Valgrind: conditional jump or move depends on uninitialised valuesw.
    buf_block_init(): Reset magic_n, buf_fix_count, and io_fix to avoid testing
    uninitialised variables.
  #18077: InnoDB uses full explicit table locks in stored FUNCTION.
  #18238: When locks exhaust the buffer pool, InnoDB does not roll back the trx.
    Check in pessimistic insert and update if the buffer pool is exhausted by locks.
  #18252: Disk space leaks in updates of InnoDB BLOB rows.
    btr_cur_pessimistic_update(): Invoke rec_get_offset() after rec_set_field_extern_bits().
    btr_store_big_rec_extern_fields(): Note that offsets will no longer be valid
    after calling this function.
  #18283: When InnoDB returns error 'lock table full', MySQL can write to binlog too much.
  #18384: InnoDB memory leak on duplicate key errors if row has many columns.
    row_ins_duplicate_error_in_clust(): Call mem_heap_free(heap) at func_exit if needed.
  #18350: Use consistent read in CREATE ... SELECT .. if innodb_locks_unsafe_for_binlog is used.
2006-03-29 23:04:32 +04:00
kent@mysql.com
36da096324 Merge 2006-03-18 10:11:36 +01:00
kent@mysql.com
882d9b6e1f configure.in:
Changed release name to 5.0.19a
ha_innodb.cc:
  InnoDB used table locks (not row locks) within stored functions. (Bug #18077)
2006-03-17 11:32:02 +01:00
elliot@mysql.com
a37fa18a69 Merge mysql.com:/home/emurphy/src/mysql/bk-clean/mysql-4.1
into  mysql.com:/home/emurphy/src/mysql/bk-clean/mysql-5.0
2006-03-17 10:50:01 +01:00
elliot@mysql.com
56fca811bb BUG#18283 When InnoDB returns error 'lock table full', MySQL can write
to binlog too much.

When InnoDB has to rollback a transaction because the lock table has
filled up, it also needs to inform the upper layer that the transaction
was rolled back so that the cached transaction is not written to the
binary log.
2006-03-17 10:25:29 +01:00
aivanov@mysql.com
9296fb241d Fixed: BUG#15653, BUG#16157, BUG#16229, BUG#16298, BUG#16387, BUG#16582.
Applied innodb-5.0-ss149/162 snapshots.
2006-01-31 21:41:48 +03:00
aivanov@mysql.com
5f7279d0d5 Applied patch recieved from Marko:
Make innodb_thread_concurrency 0 by default, and extend the usable
 range from 0 to 1000 (0 disables the thread throttling).
2006-01-18 15:20:56 +03:00