Commit graph

366 commits

Author SHA1 Message Date
marko
5f73dd4b2e Port r983 from branches/zip: Enclose some more debug code in
#ifdef UNIV_SYNC_DEBUG to allow the code to be built
with UNIV_DEBUG but without UNIV_SYNC_DEBUG.
2006-11-21 13:53:48 +00:00
marko
d6732adabb Port r972 from branches/zip: Enclose some debug code in #ifdef UNIV_SYNC_DEBUG.
The code was previously unused in non-debug builds.
2006-11-21 13:53:05 +00:00
marko
7868898e89 Merge a change from MySQL AB.
ChangeSet
  2006/11/10 17:22:43+02:00 aelkin@dsl-hkibras-fe30f900-107.dhcp.inet.fi 
  Bug #24190  many exportable definitions of field_in_record_is_null
  
  mysql had several(2) exportable definitions of field_in_record_is_null function.
  
  Fixed with adding static.

storage/innobase/handler/ha_innodb.cc
  2006/11/10 17:22:36+02:00 aelkin@dsl-hkibras-fe30f900-107.dhcp.inet.fi +1 -1
  made static
2006-11-16 15:05:23 +00:00
osku
15ca287cbe Remove duplicate printing of row lock counts in SHOW INNODB STATUS, and in
the remaining print, add a comma so it doesn't get combined with the heap
size. Both problems were introduced in r383.
2006-11-10 10:39:00 +00:00
marko
9954212f5c Minor cleanup.
ha_innobase::rnd_pos(): Use correct format in DBUG_PRINT statements.

buf_page_release(): Remove the local variable buf_fix_count.
2006-11-10 10:09:41 +00:00
marko
caf26af033 Merge changes from MySQL AB to innodb_mysql.result. 2006-11-09 16:50:10 +00:00
marko
7cc0c62e77 Introduce #define UNIV_LIST_DEBUG for enabling the debug code in
UT_LIST_REMOVE_CLEAR().
2006-11-09 12:52:45 +00:00
marko
c0fd7331fd UT_LIST_REMOVE(): Invalidate the node pointers #ifdef UNIV_DEBUG.
buf_LRU_invalidate_tablespace(): Invoke UT_LIST_GET_PREV(LRU, block)
before UT_LIST_REMOVE(LRU, buf_pool->LRU, block).
2006-11-08 14:31:47 +00:00
marko
cb169c6744 fil_flush_file_spaces(): Copy the system->unflushed_spaces list to an
array while holding the mutex.  This removes the crash-triggering
race condition that was introduced when fixing Bug #15653.  (Bug #24089)
2006-11-08 13:33:24 +00:00
marko
0011a8a91a Reduce buffer pool mutex contention under >= 4 big concurrent
CPU-bound SELECT queries.  (Bug #15815)

Fix: replace the mutex by one mutex protecting the 'flush list'
(and the free list) and several mutexes protecting portions of the
buffer pool, where we keep several indivudual LRU lists of pages.

This patch is from Sunny Bains and Heikki Tuuri.
2006-11-08 12:49:15 +00:00
osku
b4b9a10700 Merge changes from MySQL to get the code compiling again:
Change return type of ha_innobase::info to int.

 plug.in: Add MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS.
2006-11-03 11:44:29 +00:00
marko
3b8ef8a822 Do not break the latching order in TRUNCATE TABLE.
dict_truncate_index_tree(): Replace parameter rec_t* rec with
btr_pcur_t* pcur.  Reposition pcur before calling btr_create().

sync_thread_add_level(): Remove the relaxation of the assertion added in r968.
2006-10-30 13:15:46 +00:00
marko
ef8d9962c7 sync_thread_add_level(): When level == SYNC_TREE_NODE, allow the latching
order to be violated if the thread holds dict_operation_lock, whose level is
SYNC_DICT_OPERATION.  This removes the assertion failure of TRUNCATE TABLE
#ifdef UNIV_SYNC_DEBUG.
2006-10-30 08:46:53 +00:00
marko
197e6a0723 innodb.result, innodb_mysql.result: Merge changes from MySQL AB:
ChangeSet
  2006/10/09 19:51:41+04:00 gkodinov@macbook.local 
  Bug #22781: SQL_BIG_RESULT fails to influence sort plan
   Currently SQL_BIG_RESULT is checked only at compile time.
   However, additional optimizations may take place after
   this check that change the sort method from 'filesort'
   to sorting via index. As a result the actual plan
   executed is not the one specified by the SQL_BIG_RESULT
   hint. Similarly, there is no such test when executing
   EXPLAIN, resulting in incorrect output.
   The patch corrects the problem by testing for
   SQL_BIG_RESULT both during the explain and execution
   phases.
2006-10-26 11:37:56 +00:00
osku
4a8e394132 btr_lift_page_up(): Set new page levels in all ancestor pages, not just
in the father page.

btr0btr.h: Add a BTR_MAX_LEVELS define.
2006-10-19 10:43:14 +00:00
marko
3d9db439cd dict_print_info_on_foreign_key_in_create_format(): Use ut_print_name()
instead of passing the wrong length to ut_print_namel().  (Bug #23368)

ut_print_name(), ut_print_namel(): Document the special treatment of '/'.

ut_print_namel(): Replace strchr() with memchr(), as the string might
not be NUL-terminated.
2006-10-18 11:24:58 +00:00
marko
7241316fba ha_innobase::store_lock(): When downgrading table locks, do not
check thd->in_lock_tables but test if
thd->lex->sql_command == SQLCOM_LOCK_TABLES
instead.  Otherwise, stored functions will use table locks.  (Bug #18077)

This patch is from Heikki.
2006-10-16 12:19:36 +00:00
marko
e8b18d9e7f btr_page_get_father_for_rec(): Remove bogus comment about removed dict_tree_t. 2006-10-16 07:29:59 +00:00
marko
c2f508b38d Send all SHOW ENGINE INNODB STATUS information to the client also when
UNIV_SYNC_DEBUG is defined.

rw_lock_list_print_info(): Add parameter "file".

mutex_list_print_info(): Add parameter "file".  Make the function static.
2006-10-12 10:26:25 +00:00
marko
0298d3552b mem0dbg.c: Enclose some more function definitions in #ifdef UNIV_MEM_DEBUG.
The declarations were already enclosed in #ifdef UNIV_MEM_DEBUG.
2006-10-10 09:58:47 +00:00
marko
bb4c94bfb1 Enclose some mem debug functions in #ifdef UNIV_DEBUG or #ifdef UNIV_MEM_DEBUG. 2006-10-10 08:27:08 +00:00
marko
11961fe84c dict_index_get_if_in_cache(): Enclose in #ifdef UNIV_DEBUG.
Replace the search loop with a call to dict_index_find_on_id_low().
2006-10-09 11:47:02 +00:00
marko
80c208a18a mem0pool.c: Remove obsolete comments about the dictionary cache being
managed with an LRU algorithm.
2006-10-09 09:45:47 +00:00
marko
e8bcfd5ede Merge changes from MySQL AB, and remove two compilation warnings.
ha_innodb.cc: innodb_mutex_show_status(): Add (ulong) casts to
ulonglong expressions being passed to fprintf %lu.  The warnings
were apparently introduced by MySQL AB developers.

mysql_declare_plugin(innobase): Add PLUGIN_LICENSE_GPL.

have_innodb.inc: Merge changes from MySQL AB.
2006-10-09 09:08:50 +00:00
marko
4bc0663b7d univ.i: Indent some of the directives, and remove conditions about Windows
in the "#else" branch of "#if building on Windows".
2006-10-06 19:51:33 +00:00
marko
4351bedba7 Merge changes from MySQL AB.
dict_col_copy_type_noninline(): Remove the return statement.
Some compilers do not allow return expressions of void type.

innobase_start_or_create_for_mysql(): Do not cap srv_max_threads to 1000
on Windows.

Makefile.am (EXTRA_DIST): Add plug.in
2006-10-05 11:00:06 +00:00
marko
a3a432119d Merge changes to mysql-test from MySQL AB.
innodb_unsafe_binlog, innodb_handler, innodb-big, innodb_cache-master,
innodb-deadlock, innodb_cache: Remove.  These have been renamed in the
MySQL tree.

innodb_mysql: Update.
2006-10-05 09:07:49 +00:00
marko
e1d04a690c storage/innobase/handler: Merge changes from MySQL AB:
ChangeSet
  2006/09/30 18:44:42-07:00 brian@zim.(none) 
  Merge zim.(none):/home/brian/mysql/merge-5.1
  into  zim.(none):/home/brian/mysql/arch-5.1

ChangeSet
  2006/09/30 12:49:46-07:00 brian@zim.(none) 
  This patch adds handlerton passing to functions. NDB and Innodb still require a global hanlderton in the main code due to the nature of the sql_cache call back function (should be solveable... another patch).
  Partitioning now has a flag to allow disabling of engines from being compatible with partitioning. Cleaned up heap naming convention on panic call. 

ChangeSet
  2006/09/29 17:19:02-07:00 brian@zim.(none) 
  This removes the passing of global hton to engine instance. 

ChangeSet
  2006/09/28 13:22:56+02:00 gbichot@dl145h.mysql.com 
  Merge gbichot@bk-internal:/home/bk/mysql-5.1-arch
  into  dl145h.mysql.com:/users/gbichot/mysql-5.1-arch

ChangeSet
  2006/09/28 13:19:43+02:00 gbichot@dl145h.mysql.com 
  In the handlerton, cursor creation function don't have an argument
  and so the engine calls current_thd to derive transaction information;
  instead we now pass THD to those functions, it looks more logical
  (it makes the implicit current_thd parameter more visible).
  Approved by Brian and Monty.

ChangeSet
  2006/09/26 22:51:53-07:00 brian@zim.(none) 
  Merge zim.(none):/home/brian/mysql/merge-5.1
  into  zim.(none):/home/brian/mysql/arch-5.1
2006-10-03 12:46:23 +00:00
marko
693f1954f6 setup.sh: Once more. Remember that the glob expansion works relative to
the current directory.
2006-10-03 12:20:10 +00:00
marko
99a1a96058 setup.sh: Correctly link the test files. This was broken in r882. 2006-10-03 12:17:28 +00:00
marko
2602c728be Make storage/innobase the working directory of Subversion. 2006-10-02 09:02:03 +00:00
marko
eba6d0713f row_purge_parse_undo_rec(): Correct a faulty condition. Luckily, this
bug would only surface if the InnoDB SQL interpreter were used for
updating fixed-length columns.  Currently (as the UPD_NODE_NO_SIZE_CHANGE
flag is never set), cmpl_info can only be 0 or UPD_NODE_NO_ORD_CHANGE.
Luckily, UPD_NODE_NO_ORD_CHANGE is 1, and the condition was simplified
to !cmpl_info.
2006-09-26 11:37:58 +00:00
marko
58a0e283ab mtr_print(), mtr_memo_contains(): Disable unless #ifdef UNIV_DEBUG. 2006-09-26 07:08:48 +00:00
marko
961aa8ea04 row_build_index_entry(): Declare variables in the beginning of a block,
to comply with ISO/IEC 9899:1989.  This error was made in r834.  (Bug #22575)
2006-09-22 06:48:56 +00:00
osku
379c0d23c0 export.sh: Adapt to ha_innodb now living in storage/innobase in the MySQL
tree.
2006-09-21 09:44:03 +00:00
osku
e6ac06219e row_upd_sec_step(): Fix false comment. 2006-09-20 11:05:12 +00:00
marko
e8a1b21d25 Merge changes from MySQL AB to the innodb_mysql test. 2006-09-20 10:52:02 +00:00
marko
3916e2ead2 Merge code from MySQL AB:
Make innobase_hton a pointer.
2006-09-20 09:38:09 +00:00
marko
5c1a11892d ha_innobase::start_stmt(): Remove the check for
prebuilt->stored_select_lock_type being LOCK_X or LOCK_S.
This would cause false alarms with INSERT ... SELECT, which would use
LOCK_NONE in innodb_locks_unsafe_for_binlog mode.  (Bug #10746)
2006-09-20 08:52:00 +00:00
osku
6819c897ae Split long lines with [] operators better. 2006-09-20 06:41:30 +00:00
osku
a2a7c6cab5 Revamp the line splits done in r763 and r764 that can now be done better,
thanks to r826.
2006-09-19 07:22:21 +00:00
marko
0d298ea513 page_offset(): New function to replace many ut_align_offset(., UNIV_PAGE_SIZE)
calls.

dict_index_build_node_ptr(): Correct a typo in a comment.
2006-09-19 05:55:10 +00:00
osku
fd1bd26ba4 Remove dict_col_t::name, replace it with a packed array of column names in
dict_table_t. This saves 8-15+ bytes of memory per column on 64-bit
machines.
2006-09-19 04:36:56 +00:00
marko
f77f36b246 Change the recently introduced ulint bit-fields to unsigned. 2006-09-18 12:02:43 +00:00
marko
79644bdb8e dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
so that all integer fields can be packed into 64 bits.  (Bug #20877)

dtype_t: Change the type of all bit-fields to unsigned.

dict_table_get_nth_col(), dict_table_get_sys_col_noninline(),
dict_table_get_sys_col(), dict_field_get_col(): Return const
dict_col_t*, so that changes to dict_col_t can be detected more
easily.  Add const to many dict_col_t* declarations.

dict_index_get_nth_type(): Replace with dict_index_get_nth_col().

dict_col_get_type(): Replace with dict_col_copy_type().

dict_col_get_min_size(), dict_col_get_max_size(), dict_col_get_fixed_size(),
dict_col_get_sql_null_size(): New functions.

dtype_get_at_most_n_mbchars(): Replace the parameter dtype
with the parameters prtype, mbminlen, mbmaxlen.

dtype_get_pad_char(), cmp_data_data(), cmp_data_data_slow(),
cmp_whole_field(): Replace the dtype_t* parameter with the ulint
parameters mtype, prtype.

dtype_copy(): Add a const qualifier to type2 (the one being copied from).

dtype_set_mblen(): Replaced with dtype_get_mblen().

dtype_get_fixed_size_low(), dtype_get_min_size_low(),
dtype_get_fixed_max_low(): Replace dtype_get_fixed_size(),
dtype_get_min_size(), and dtype_get_max_size().  These are used by the
dict_col_get_{fixed,min,max}_size() functions.

cmp_types_are_equal(): Replace with cmp_cols_are_equal().

dict_table_get_col_name(): Add a const qualifier parameter to the
parameter "table".

dtype_binary, dtype_binary_val: Remove.

dtype_is_fixed_size(): Remove.
2006-09-18 11:51:38 +00:00
marko
0b25b850b7 Tweak the bit-field definitions introduced since r813 to address Bug #20877.
rw_lock_t: Do not make writer_is_wait_ex a bit-field.  There are no fields
yet that could be fused to the same machine word, but we play it safe,
because the field writer_is_wait_ex may be modified by several threads
simultaneously.  Such fields should always be allocated an own machine
word.

dict_table_t: Change the type of all bit-fields to "unsigned".  Make
"space" a bit-field of 32 bits.  Move name_hash and id_hash after all
bit-fields, so that the bit-fields can be allocated together.  Do not
make autoinc_inited a bit-field, as we cannot allocate any field
from the same machine word.

dict_build_table_def_step(): Pass a local variable to
fil_create_new_single_table_tablespace() and initialize table->space
from it after the call, now that table->space is a bit-field.
2006-09-18 10:31:51 +00:00
osku
3729812895 Add dict_table_get_col_name() in preparation for getting rid of
dict_col_t::name, and use it instead of col->name everywhere.
2006-09-18 09:46:05 +00:00
marko
799dfe0f85 Add dict_col_get_clust_pos_noninline(), which was forgotten from r820. 2006-09-18 08:50:31 +00:00
marko
96ac3d46a7 page_align(ptr): New utility function to replace
ut_align_down(ptr, UNIV_PAGE_SIZE) calls.
2006-09-18 07:14:41 +00:00
heikki
05b222ffb2 Erase the magic number in the trx sys header using a redo-logged write;
it should be redo-logged because the data structure is file-based;
this patch does not fix any bug; the original erase operation was added
in r781 to fix Valgrind Bug #20791
2006-09-15 12:43:40 +00:00