Commit graph

725 commits

Author SHA1 Message Date
marko
aff9b3854f branches/zip: Introduce the macro TEMP_INDEX_PREFIX_STR.
This is to avoid triggering an error in Doxygen.
2009-05-25 08:42:47 +00:00
marko
d075e80c49 branches/zip: Split some long lines that were introduced in r5091. 2009-05-25 08:09:45 +00:00
marko
a45e6d2bae branches/zip: Adjust some function comments after r5091. 2009-05-25 05:54:17 +00:00
marko
e49dee377b branches/zip: Convert the function comments to Doxygen format.
This patch was created by running the following commands:

for i in */*[ch]; do doxygenify.pl $i; done
perl -i -pe 's#\*{3} \*/$#****/#' */*[ch]

where doxygenify.pl is
https://svn.innodb.com/svn/misc/trunk/tools/doxygenify.pl r510

Verified the consistency as follows:

(0) not too many /* in: */ or /* out: */ comments left in the code:
grep -l '/\*\s*\(in\|out\)[,:/]' */*[ch]

(1) no difference when ignoring blank lines, after stripping all
C90-style /* comments */, including multi-line ones, before and after
applying this patch:

perl -i -e 'undef $/;while(<ARGV>){s#/\*(.*?)\*/##gs;print}' */*[ch]
diff -I'^\s*$' --exclude .svn -ru TREE1 TREE2

(2) after stripping @return comments and !<, generated a diff and omitted
the hunks where /* out: */ function return comments were removed:

perl -i -e'undef $/;while(<ARGV>){s#!<##g;s#\n\@return\t.*?\*/# \*/#gs;print}'\
 */*[ch]
svn diff|
perl -e 'undef $/;$_=<>;s#\n-\s*/\* out[:,]([^\n]*?)(\n-[^\n]*?)*\*/##gs;print'

Some unintended changes were left.  These will be removed in a
subsequent patch.
2009-05-25 05:30:14 +00:00
marko
90e50d964e branches/zip: Fix some function comments. 2009-05-20 20:51:23 +00:00
marko
d8b91c90a2 branches/zip: ut_dulint_sort(): Write proper comments. 2009-05-20 12:10:17 +00:00
marko
288a29458b branches/zip: Clean up some comments. 2009-05-20 10:06:59 +00:00
marko
a29de5108e branches/zip: Clean up some function comments. 2009-05-20 09:06:03 +00:00
marko
a092c0a7e5 branches/zip: Remove bogus in: comments from struct members. 2009-05-20 08:45:17 +00:00
marko
94b4ba74a8 branches/zip: ib_vector_is_empty(): Fix the function comment. 2009-05-20 08:32:37 +00:00
marko
3174e395f3 branches/zip: ut_snprintf(): Fix the function comments. 2009-05-20 08:26:49 +00:00
marko
cea9a03ab6 branches/zip: Fix some function comments. 2009-05-20 08:19:40 +00:00
marko
dbe13c2ba2 branches/zip: mlog_parse_index(): Correct a parameter comment
and add a const qualifier that was missing.
2009-05-20 07:11:58 +00:00
marko
cab1802cee branches/zip: sync0rw.ic: Remove an extra ; that was added in r5041. 2009-05-20 04:46:01 +00:00
marko
b04cffec7d branches/zip: Add missing function comments. 2009-05-20 04:42:12 +00:00
marko
62718d0e0c branches/zip: ib_wqueue_wait(): Add decorative comment. 2009-05-19 19:13:12 +00:00
marko
9649c3e3b3 branches/zip: Write PAGE_MAX_TRX_ID to the redo log. Otherwise,
transactions that are started before the rollback of incomplete
transactions has finished may have an inconsistent view of the
secondary indexes.

dict_index_is_sec_or_ibuf(): Auxiliary function for controlling
updates and checks of PAGE_MAX_TRX_ID: check whether an index is a
secondary index or the insert buffer tree.

page_set_max_trx_id(), page_update_max_trx_id(),
lock_rec_insert_check_and_lock(),
lock_sec_rec_modify_check_and_lock(), btr_cur_ins_lock_and_undo(),
btr_cur_upd_lock_and_undo(): Add the parameter mtr.

page_set_max_trx_id(): Allow mtr to be NULL.  When mtr==NULL, do not
attempt to write to the redo log.  This only occurs when creating a
page or reorganizing a compressed page.  In these cases, the
PAGE_MAX_TRX_ID will be set correctly during the application of redo
log records, even though there is no explicit log record about it.

btr_discard_only_page_on_level(): Preserve PAGE_MAX_TRX_ID.  This
function should be unreachable, though.

btr_cur_pessimistic_update(): Update PAGE_MAX_TRX_ID.

Add some assertions for checking that PAGE_MAX_TRX_ID is set on all
secondary index leaf pages.

rb://115 tested by Michael, fixes Issue #211
2009-05-19 18:59:07 +00:00
marko
5c5817cccb branches/zip: Fix a typo that was introduced in r5036. 2009-05-19 09:08:16 +00:00
marko
c0d9e7b96a branches/zip: Add proper comments to some file page accessors. 2009-05-19 09:05:50 +00:00
marko
1c0cf56c45 branches/zip: row_update_prebuilt_trx(): Correct bogus comment. 2009-05-19 08:41:32 +00:00
marko
79362a389d branches/zip: Remove bogus out: comments of functions returning void. 2009-05-19 07:00:51 +00:00
marko
db9dc3bb20 branches/zip: Add missing out: comments to nullary functions. 2009-05-19 06:30:02 +00:00
marko
a7942035c2 branches/zip: os_thread_get_curr_id(), os_thread_get_curr():
Add missing out: comments.
2009-05-19 06:04:04 +00:00
marko
b10bc48d35 branches/zip: Add some missing out: comments to buf0buf.h, buf0buf.c. 2009-05-18 12:36:10 +00:00
marko
a512de6783 branches/zip: buf_validate(): Add missing out: comment. 2009-05-18 12:29:51 +00:00
marko
bc48ebd870 branches/zip: Merge revisions 4976:4994 from branches/5.1:
------------------------------------------------------------------------
  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-14 11:31:43 +00:00
marko
bd237c4b63 branches/zip: Distinguish temporary tables in MLOG_FILE_CREATE.
This addresses Mantis Issue #23 in InnoDB Hot Backup and some
of MySQL Bug #41609.

In MLOG_FILE_CREATE, we need to distinguish temporary tables, so that
InnoDB Hot Backup can work correctly.  It turns out that we can do this
easily, by using a bit of the previously unused parameter for page number.
(The page number parameter of MLOG_FILE_CREATE has been written as 0 
ever since MySQL 4.1, which introduced MLOG_FILE_CREATE.)

MLOG_FILE_FLAG_TEMP: A flag for indicating a temporary table in
the page number parameter of MLOG_FILE_ operations.

fil_op_write_log(): Add the parameter log_flags.

fil_op_log_parse_or_replay(): Add the parameter log_flags.
Do not replay MLOG_FILE_CREATE when MLOG_FILE_FLAG_TEMP is set in log_flags.
This only affects ibbackup --apply-log.  InnoDB itself never replays file
operations.

rb://117 approved by Heikki Tuuri
2009-04-29 19:23:27 +00:00
marko
ab7803b005 branches/zip: Correct a misleading comment. PAGE_MAX_TRX_ID
will be updated in ibuf_insert_low() and updated from the
insert buffer tree page to the secondary index tree page
during the insert buffer merge.
2009-04-23 11:15:07 +00:00
marko
e9a3aa18c8 branches/zip: Introduce the logical type names trx_id_t, roll_ptr_t,
and undo_no_t. Each type is still defined as dulint.

This is an initial step towards replacing dulint with a 64-bit data type.
Because modern compilers have no trouble supporting 64-bit arithmetics
even on 32-bit targets, the dulint struct is a relic that should go.

The last remaining major use of dulint is dictionary IDs
(table, index, and row ids).

rb://114 approved by Sunny Bains
2009-04-23 05:32:36 +00:00
vasil
06e8e00ed9 branches/zip: Merge revisions 4710:4746 from branches/5.1:
------------------------------------------------------------------------
  r4746 | vasil | 2009-04-18 00:32:08 +0300 (Sat, 18 Apr 2009) | 110 lines
  Changed paths:
     M /branches/5.1/handler/ha_innodb.cc
     M /branches/5.1/include/pars0pars.h
  
  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:50:09 +00:00
marko
a0714b182c branches/zip: univ.i: Define REFMAN as the base URL of the
MySQL Reference Manual and use it in every string.
This fixes Issue #221.
2009-04-16 12:02:27 +00:00
calvin
6fd7b63c8e branches/zip: Use the Windows Interlocked functions for atomic memory
access

Mapping the atomic operations to Windows Interlocked functions:

os_compare_and_swap_* to InterlockedCompareExchange(64)
os_atomic_increment_* to InterlockedExchangeAdd(64)
os_atomic_test_and_set_byte to InterlockedExchange

In this patch, the legacy code under UNIV_CAN_USE_X86_ASSEMBLER is
removed all together, and add HAVE_WINDOWS_ATOMICS and
INNODB_RW_LOCKS_USE_ATOMICS to CMakeLists.txt

This is to address mantis issue#194.

rb://113

Approved by: Marko
2009-04-15 21:22:35 +00:00
marko
cd1909f6b3 branches/zip: Hide unnecessarily visible globals.
dict_ind_redundant, dict_ind_compact: Declare these UNIV_INTERN.
innodb_hton_ptr: Declare static.  We do not attempt to access the
built-in InnoDB any more.
trx_roll_savepoints_free(): Declare UNIV_INTERN.
2009-04-08 10:24:49 +00:00
inaam
99b5d9e21f branches/zip
Enable atomics on solaris (using the libc functions as defined in
atomic.h) if GCC atomic builtins are not present.

There still remains some work to be done (by Vasil?). This patch
makes changes to plug.in to check pthread_t size and presence of
atomic functions when running on solaris. The same has to become
a part of the generated Makefile.in when we bake our source.

Reviewed by: Heikki rb://106
2009-04-07 14:45:37 +00:00
marko
ab341009d7 branches/zip: Allow in-place updates of UTF-8 CHAR columns
from or to NULL in ROW_FORMAT=REDUNDANT. (Bug #44032)

rb://107 approved by Heikki Tuuri.
2009-04-07 11:45:28 +00:00
marko
ab67f4eb4a branches/zip: Refuse to use newly created indexes that may lack
history.  This addresses Mantis issue #116.

dict_index_t: Enable the storage of trx_id.

row_prebuilt_t: Make many fields bit-fields to reduce the memory
footprint. Add index_usable.

ha_innobase::change_active_index(): Check if the index is usable and
set prebuilt->index_usable accordingly. Unfortunately, the return
status of this function is ignored by MySQL, and the actual refusal to
use the index must be made in row_search_for_mysql().

row_search_for_mysql(): Return DB_MISSING_HISTORY if
!prebuilt->index_usable.

convert_error_code_to_mysql(): Map DB_MISSING_HISTORY to
HA_ERR_TABLE_DEF_CHANGED.

innodb-index.test: Add a test case where access to a newly created
secondary index must be blocked for old transactions.

rb://100 approved by Heikki Tuuri
2009-04-02 12:23:12 +00:00
calvin
dacfdf4a1d branches/zip: Mantis issue #197 - Make srv_spin_wait_delay configurable
New parameter innodb_spin_wait_delay to set the maximum delay between
polling for a spin lock. 5 is the default.

Approved by: Marko (on IM)
2009-04-02 11:46:47 +00:00
marko
c9534b6ec3 branches/zip: struct read_view_struct: Add clarifying comments about
low_limit_id and up_limit_id.
2009-03-31 06:40:58 +00:00
inaam
b76aa20cbc branches/zip
SHOW ENGINE INNODB MUTEX shows all mutexes and rw_locks. This can
be overwhelming particularly when the buffer pool is very large
(note that each block in buffer pool has at least one mutex, one
rw_lock and an additional mutex if rw_lock does not use atomics).
With this patch status of following mutexes and rw-locks is not shown:

1) block->mutex
2) block->lock
3) block->lock->mutex (if applicable)
4) All other mutexes and rw-locks for which number of os-waits are zero

Addresses issue# 179 rb://99

Approved by: Marko
2009-03-25 17:18:33 +00:00
marko
da3661412c branches/zip: Note that buf_page_t::list and buf_page_t::in_flush_list
are only protected by buf_pool_mutex, not by the block mutex.

buf_page_release(): Remove the assertion on in_flush_list.
The function is only holding block->mutex, not buf_pool_mutex.
This was reported by Sunny.  This was the only piece of code
that accessed in_flush_list while not holding buf_pool_mutex.
2009-03-24 13:46:12 +00:00
marko
349090707c branches/zip: Remove references to UNIV_HOTBACKUP from files that are
not used when building InnoDB Hot Backup.  Declare
innobase_invalidate_query_cache() in ha_prototypes.h.
2009-03-24 12:02:29 +00:00
marko
d90bea085a branches/zip: Remove unneeded definitions and dependencies
from UNIV_HOTBACKUP builds.
2009-03-23 14:21:34 +00:00
marko
78c70c076d branches/zip: Enclose recv_recovery_from_backup_on and
recv_recovery_from_backup_is_on() in #ifdef UNIV_LOG_ARCHIVE.
2009-03-23 12:05:18 +00:00
marko
a7328dccd4 branches/zip: Exclude some operating system interface code
from UNIV_HOTBACKUP builds.
2009-03-23 10:20:50 +00:00
marko
412893d6f3 branches/zip: Define and use PAGE_ZIP_MATCH.
In UNIV_HOTBACKUP builds, assume fixed allocation.
2009-03-23 09:07:20 +00:00
marko
ac8e5d597e branches/zip: Define and use ASSERT_HASH_MUTEX_OWN.
Make it a no-op in UNIV_HOTBACKUP builds.
2009-03-23 08:57:16 +00:00
marko
2febfb273c branches/zip: hash_table_t: adaptive: Remove from UNIV_HOTBACKUP builds. 2009-03-23 08:49:53 +00:00
marko
2225a61798 branches/zip: fil_init(): Add the parameter hash_size. 2009-03-20 13:47:17 +00:00
marko
1d2299398f branches/zip: recv_scan_log_recs(): Remove a compile-time constant parameter. 2009-03-20 13:10:25 +00:00
marko
da474c033b branches/zip: recv_sys_init(): Remove a compile-time constant parameter. 2009-03-20 12:56:19 +00:00