Commit graph

577 commits

Author SHA1 Message Date
marko
344481d597 branches/zip: row_create_table_for_mysql(), row_create_index_for_mysql():
Note that the dictionary object will be freed.
2008-10-15 06:00:06 +00:00
calvin
e197d7dcf7 branches/zip: fix Mantis issue #96 Problem compiling ha_innodb.cc
on 64-bit Windows

Change the definition of srv_replication_delay from ulint to ulong.
ulint is 64-bit on Win64.

Approved by:	Heikki (on IM)
2008-10-14 15:14:47 +00:00
marko
41953325b9 branches/zip: Fix some locking issues, mainly in fast index creation.
This should hopefully address Issue #85.

ha_innobase::add_index(): Lock the data dictionary before invoking
row_merge_rename_indexes() or row_merge_drop_indexes(), because neither
function will commit the transaction.

ha_innobase::final_drop_index(): Commit the transactions before
unlocking the data dictionary.

row_merge_drop_index(), row_merge_drop_indexes(), row_merge_rename_tables(),
row_merge_rename_indexes(): Note and assert that the data dictionary must
have been exclusively locked by the caller, because the transaction will
not be committed.

row_drop_database_for_mysql(): Commit the transaction immediately after
dropping each table.  When MySQL is holding open handles to some tables,
it can otherwise occur than the data dictionary is unlocked while the
transaction has not been committed.  This bug was introduced in r2739,
which changed the semantics of row_drop_table_for_mysql().

row_drop_database_for_mysql(): Postpone mem_free(table_name), so that
an error printout will not dereference freed memory.
2008-10-10 11:44:27 +00:00
marko
a9a21fb983 branches/zip: Do not release the data dictionary latch while holding locks
to the data dictionary records.  This should fix Issue #83.

row_drop_table_for_mysql_no_commit(): Rename back to
row_drop_table_for_mysql().  Commit the transaction if the data
dictionary was not locked when the function was called.  Otherwise,
neither commit the transaction nor unlock the data dictionary.

row_merge_drop_table(): Let row_drop_table_for_mysql() take care of
locking the data dictionary.

dict_create_or_check_foreign_constraint_tables(),
trx_rollback_active(), row_create_table_for_mysql(),
row_create_index_for_mysql(), row_table_add_foreign_constraints():
Explicitly commit the transaction, because row_drop_table_for_mysql()
would no longer commit it, given that the data dictionary will be
locked during the calls.

Approved by Sunny (over IM). rb://23
2008-10-08 08:54:16 +00:00
marko
5f3fbb7b84 branches/zip: Relax the page_zip_validate() check during crash recovery:
ignore intermittent differences in the "predefined minimum record" flag.

page_zip_validate_low(): Renamed from page_zip_validate(), with an
additional parameter: ibool sloppy.  Ignore REC_INFO_MIN_REC_FLAG when
sloppy == TRUE.

page_zip_validate(): Wrapper for page_zip_validate_low().  Pass
sloppy = recv_recovery_is_on().

recv_recover_page(): After applying the changes from the redo log to a
compressed B-tree page, invoke page_zip_validate_low() in strict mode.
2008-10-06 07:13:52 +00:00
sunny
0eff3d3ca6 branches/zip: 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.

This also fixes Bug#39830 Table autoinc value not updated on first insert.
rb://16
2008-10-04 06:24:56 +00:00
sunny
cb0cacc2d8 branches/zip: Merge revisions 2702:2722 from branches/5.1:
------------------------------------------------------------------------
  r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines
  Changed paths:
     M /branches/5.1/handler/ha_innodb.cc
  
  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.
  
  ------------------------------------------------------------------------
  r2709 | vasil | 2008-10-01 10:13:13 +0300 (Wed, 01 Oct 2008) | 10 lines
  Changed paths:
     M /branches/5.1/include/lock0lock.h
     M /branches/5.1/lock/lock0lock.c
     A /branches/5.1/mysql-test/innodb_bug38231.result
     A /branches/5.1/mysql-test/innodb_bug38231.test
     M /branches/5.1/row/row0mysql.c
  
  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)
  
  ------------------------------------------------------------------------
  r2710 | vasil | 2008-10-01 14:13:58 +0300 (Wed, 01 Oct 2008) | 6 lines
  Changed paths:
     M /branches/5.1/include/sync0sync.ic
  
  branches/5.1:
  
  Silence a compilation warning in UNIV_DEBUG.
  
  Approved by:	Marko (via IM)
  
  ------------------------------------------------------------------------
  r2719 | vasil | 2008-10-03 18:17:28 +0300 (Fri, 03 Oct 2008) | 49 lines
  Changed paths:
     M /branches/5.1/handler/ha_innodb.cc
     A /branches/5.1/mysql-test/innodb_bug39438-master.opt
     A /branches/5.1/mysql-test/innodb_bug39438.result
     A /branches/5.1/mysql-test/innodb_bug39438.test
  
  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
  
  ------------------------------------------------------------------------
  r2720 | vasil | 2008-10-03 19:52:39 +0300 (Fri, 03 Oct 2008) | 8 lines
  Changed paths:
     M /branches/5.1/handler/ha_innodb.cc
  
  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
  
  ------------------------------------------------------------------------
  r2721 | sunny | 2008-10-04 02:08:23 +0300 (Sat, 04 Oct 2008) | 6 lines
  Changed paths:
     M /branches/5.1/handler/ha_innodb.cc
  
  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
  
  ------------------------------------------------------------------------
  r2722 | sunny | 2008-10-04 02:48:04 +0300 (Sat, 04 Oct 2008) | 18 lines
  Changed paths:
     M /branches/5.1/dict/dict0mem.c
     M /branches/5.1/handler/ha_innodb.cc
     M /branches/5.1/include/dict0mem.h
     M /branches/5.1/include/row0mysql.h
     M /branches/5.1/mysql-test/innodb-autoinc.result
     M /branches/5.1/mysql-test/innodb-autoinc.test
     M /branches/5.1/row/row0mysql.c
  
  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-04 03:22:36 +00:00
marko
be56c64772 branches/zip: Make innodb_lock_wait_timeout a settable session variable
(Bug #36285, rb://9).

innodb-index.test, innodb-index.result: Set innodb_lock_wait_timeout as
a session variable instead of relying on the global value.

innodb-index-master.opt: Remove.

innodb-timeout.test: Test that setting the innodb_lock_wait_timeout
works as advertised.

thd_lock_wait_timeout(): New function, to retrieve the lock wait timeout
for a given MySQL client connection (thd), or the global value (thd==NULL).

srv_lock_wait_timeout, innobase_lock_wait_timeout: Remove.

Replace MYSQL_SYSVAR_LONG(lock_wait_timeout)
with MYSQL_THDVAR_ULONG(lock_wait_timeout).
2008-10-03 09:24:23 +00:00
marko
ac51cfb4d2 branches/zip: page_mem_free(): Remove the obsolete remark that there
should be space left in the modification log of the compressed page.
Record deletion does not require any space in the modification log.
2008-10-01 19:04:44 +00:00
marko
482595ad8e branches/zip: btr_cur_optimistic_insert(): Correct an error that was made
in r2631.  Include the node pointer field in the size calculation.

rec_get_converted_size_comp_prefix(): New function, to compute the storage
size of the prefix of an ordinary record in COMPACT format.

rec_get_converted_size_comp(): Use rec_get_converted_size_comp_prefix().
2008-09-29 07:40:02 +00:00
marko
e24dfa77b8 branches/zip: Non-functional change:
page_zip_copy_recs(): Rename from page_zip_copy().
Update the function comment.
2008-09-25 12:17:52 +00:00
marko
d9317eb699 branches/zip: Non-functional change:
buf_block_dbg_add_level(block, level): Define as an empty macro when
UNIV_SYNC_DEBUG is not defined.  Remove #ifdef UNIV_SYNC_DEBUG around
all invocations.
2008-09-22 06:59:58 +00:00
marko
75fe6fa6a4 branches/zip: When creating an index in innodb_strict_mode, check that
the maximum record size will never exceed the B-tree page size limit.
For uncompressed tables, there should always be enough space for two
records in an empty B-tree page.  For compressed tables, there should
be enough space for storing two node pointer records or one data
record in an empty page in uncompressed format.

dict_build_table_def_step(): Remove the inaccurate check for table row
size.

dict_index_too_big_for_tree(): New function: check if the index
records would be too big for a B-tree page.

dict_index_add_to_cache(): Add the parameter "strict".  Invoke
dict_index_too_big_for_tree() if it is set.

trx_is_strict(), thd_is_strict(): New functions, for determining if
innodb_strict_mode is enabled for the current transaction.

dict_create_index_step(): Pass the new parameter strict of
dict_index_add_to_cache() as trx_is_strict(trx).  All other callers
pass it as FALSE.

innodb.test: Enable innodb_strict_mode before attempting to create a
table with a too big record size.

innodb-zip.test: Remove the test of inserting random data.  Add tests
for checking that the maximum record lengths are enforced at table
creation time.
2008-09-18 12:31:17 +00:00
marko
00e68e25b1 branches/zip: btr_cur_del_unmark_for_ibuf(): Correct the function comment. 2008-09-18 06:10:49 +00:00
marko
c1cc5b1316 branches/zip: innobase_convert_from_id(), innobase_convert_from_table_id():
Add the parameter struct charset_info_st* cs, so that the call
thd_charset(current_thd) can be avoided.  The macro current_thd has no
defined value in the Windows plugin.
2008-09-17 10:07:36 +00:00
marko
5dc842cf08 branches/zip: Non-functional change: Move the declarations of the
functions innobase_convert_from_table_id(), innobase_convert_from_id(),
innobase_casedn_str(), and innobase_get_charset() to ha_prototypes.h.
2008-09-17 10:03:43 +00:00
marko
9971b1d080 branches/zip: HASH_INSERT: Add a type conversion that is needed to keep
the Microsoft Visual C compiler happy.  This fix was from Calvin.
2008-09-17 09:50:28 +00:00
marko
6378cae6bb branches/zip: Prevent infinite B-tree page splits by ensuring that
there will always be enough space for two node pointer records in an
empty B-tree page.  This was reported as Mantis issue #73.

page_zip_rec_needs_ext(): Add the parameter n_fields, for accurate
estimation of the compressed size of the data dictionary information.
Given that this function is only invoked for records on leaf pages,
require that there be enough space for one record in the compressed
page.  We check elsewhere that there will be enough room for two node
pointer records on higher-level pages.

btr_cur_optimistic_insert(): Ensure that there will be enough room for
two node pointer records on an empty non-leaf page.  The rule for
leaf-page records will be enforced by the callers of
page_zip_rec_needs_ext().

btr_cur_pessimistic_insert(): Remove the insufficient check that the
leaf page record should be compressible by itself.  Instead, now we
require that two node pointer records fit on a non-leaf page, and one
record will fit in uncompressed form on the leaf page.

page_zip_write_header(), page_zip_write_rec(): Re-enable the debug
assertions that were violated by the insufficient check in
btr_cur_pessimistic_insert().

innodb_bug36172.test: Use a larger compressed page size.
2008-09-17 06:23:52 +00:00
marko
222b221da2 branches/zip: Minor cleanup.
btr_search_drop_page_hash_index(): Add const qualifiers to the local
variables page, rec, and index, to ensure that they are not modified
by this function.

page_get_infimum_offset(), page_get_supremum_offset(): New functions.

page_get_infimum_rec(), page_get_supremum_rec(): Replaced by
const-preserving macros that invoke the accessor functions.
2008-09-16 13:16:36 +00:00
marko
f19cbe507d branches/zip: ha_innobase::prepare_drop_index(): When there is a
foreign key constraint, find a truly equivalent index for it.
If none is available, refuse to drop the index.  MySQL can drop
an index when creating a "stronger" index.

This was reported as Mantis issue #70 and MySQL Bug #38786.

innodb-index.test: Add a test case.

dict_foreign_find_equiv_index(): New function, to replace the
incorrectly written function dict_table_find_equivalent_index().

dict_table_replace_index_in_foreign_list(): Simplify the implementation.
2008-09-09 11:05:56 +00:00
marko
97be6faaa4 branches/zip: Write clarifying comments about the insert buffer and the
"free" bits in the insert buffer bitmap in particular.
2008-09-04 07:47:49 +00:00
vasil
22ecced647 branches/zip:
Merge 2537:2605 from branches/5.1:

  ------------------------------------------------------------------------
  r2545 | vasil | 2008-07-25 17:24:23 +0300 (Fri, 25 Jul 2008) | 37 lines
  Changed paths:
     M /branches/5.1/handler/ha_innodb.cc
  
  branches/5.1:
  
  Fix Bug#38185 ha_innobase::info can hold locks even when called with HA_STATUS_NO_LOCK
  
  The fix is to call fsp_get_available_space_in_free_extents() from
  ha_innobase::info() only if HA_STATUS_NO_LOCK is not present in the flag
  *AND*
  change get_schema_tables_record() in MySQL's sql/sql_show.cc to call
  ::info() *without* HA_STATUS_NO_LOCK whenever a user issues SELECT FROM
  information_schema.tables;
  
  Without the change to sql/sql_show.cc this patch would lead to Bug#32440
  resurfacing. I.e. delete_length would never be updated in ::info() and
  will remain 0 forever, resulting in the free space not being shown
  anywhere.
  
  This is the change to sql/sql_show.cc for reference, it needs to be
  committed to the MySQL repo before or at the same time with this change
  to ha_innodb.cc:
  
   --- patch begins here ---
   --- sql/sql_show.cc.orig	2008-07-23 09:32:14.000000000 +0300
   +++ sql/sql_show.cc	2008-07-23 09:32:19.000000000 +0300
   @@ -3549,8 +3549,7 @@ static int get_schema_tables_record(THD 
    
        if(file)
        {
   -      file->info(HA_STATUS_VARIABLE | HA_STATUS_TIME | HA_STATUS_AUTO |
   -                 HA_STATUS_NO_LOCK);
   +      file->info(HA_STATUS_VARIABLE | HA_STATUS_TIME | HA_STATUS_AUTO);
          enum row_type row_type = file->get_row_type();
          switch (row_type) {
          case ROW_TYPE_NOT_USED:
   --- patch ends here ---
  
  Approved by:	Heikki
  
  ------------------------------------------------------------------------
  r2603 | marko | 2008-08-21 16:25:05 +0300 (Thu, 21 Aug 2008) | 10 lines
  Changed paths:
     M /branches/5.1/handler/ha_innodb.cc
     M /branches/5.1/include/ha_prototypes.h
     M /branches/5.1/row/row0sel.c
  
  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 14:23:46 +00:00
marko
f4f8113488 branches/zip: Minor cleanup.
dict_table_get_referenced_constraint(), dict_table_get_foreign_constraint():
Simplify the iteration loop.

dict_table_find_equivalent_index(): Correct the function comment.
2008-08-21 10:56:01 +00:00
marko
0d0e36741f branches/zip: Cleanup: make dict_scan_to() a static function. 2008-08-20 11:53:11 +00:00
marko
0d8f5237dd branches/zip: Introduce UNIV_LRU_DEBUG for debugging the LRU buffer pool
cache, especially buf_pool->LRU_old and bpage->old.

buf_LRU_old_adjust_len(), buf_LRU_remove_block(): Check that blocks in
buf_pool->LRU_old have the "old" flag set and the blocks preceding
buf_pool->LRU_old have the "old" flag clear.

buf_LRU_add_block_low(), buf_relocate(): Check that buf_pool->LRU_old
is the first block in the LRU list whose "old" flag is set.

buf_LRU_free_block(): When replacing a control block in the LRU list
with a control block for a compressed page, assert that the "old"
flags in the neighboring LRU list entries grow monotonically.

buf_page_set_old(): Assert that the "old" flags in the neighboring LRU
list entries grow monotonically.
2008-08-18 18:28:20 +00:00
marko
aebc0edf5a branches/zip: buf_page_set_old(): Add the assertion ut_ad(bpage->in_LRU_list).
Adjust the callers where necessary:
buf_LRU_add_block_to_end_low() and buf_LRU_add_block_low().
2008-08-18 18:06:33 +00:00
marko
0a07814087 branches/zip: flst_write_addr(), flst_read_addr(): Assert that no
file list link is written or read below FIL_PAGE_DATA.  This has
helped diagnose issue#63.
2008-08-18 06:56:52 +00:00
marko
7d69d45534 branches/zip: buf_LRU_free_block(): When buf_page_is_old(b), we incremented
buf_pool->LRU_old_len.  However, we forgot to check if buf_pool->LRU_old
happens to point to b's successor in the LRU list.  If it does, we must
assign buf_pool->LRU_old = b.  The following invariants hold:

In the LRU list, the "old" flag should grow monotonically, i.e., it is 0
for the first few items and 1 from thereafter.

If buf_pool->LRU_old != NULL, it must point to the first item with old=1
in the LRU list, and there must be buf_pool->LRU_old_len old items in the list.

This should fix Mantis issue#50 and issue#68.
2008-08-08 13:01:02 +00:00
vasil
9bbd5454db branches/zip:
The cardinality of every index (the number of different key values) is
calculated when the table is opened, at SHOW TABLE STATUS,
ANALYZE TABLE and on other circumstances (like when the table has
changed too much). Note that if the mysql client is running with the
auto-rehash setting turned on (default) this causes all tables to be
opened when it starts.

Previously InnoDB sampled 8 random pages from the index to get an
estimate of the cardinality. Now the number of sampled pages can be
changed via the global parameter innodb_stats_sample_pages which can
be tuned at runtime. The default value for this parameter is 8.

If the value of this parameter is changed, there may be serious problems:

- small values (say, 1) can cause an error in table stats;
- values much larger than 8 (say, 100), can cause a big slowdown in
  table opening time, SHOW TABLE status, etc.
- query plans may be different from the old ones.

Approved by:	Heikki
2008-08-07 13:47:44 +00:00
marko
9c0d868a8d branches/zip: Correct some typos in comments. 2008-08-06 12:45:35 +00:00
marko
9fb4f7ab7c branches/zip: Fix terminology that was introduced in r2569:
replace rbmode and "rollback mode"
with rb_ctx and "rollback context".
Suggested by Sunny.
2008-08-06 08:59:28 +00:00
marko
ba78ee0d47 branches/zip: In the rollback of incomplete transactions after crash
recovery, tolerate clustered index records whose externally stored
columns have not been written.  This should remove the assertion failures
that were reported as Mantis issue#58, issue#62, issue#64.

trx_is_recv(): New function: TRUE if this transaction is rolling back
an incomplete transaction in crash recovery.

enum trx_rbmode: Rollback modes: no rollback, normal rollback, crash recovery.

btr_cur_pessimistic_delete(), btr_free_externally_stored_field(),
btr_rec_free_externally_stored_fields():
Replace the ibool parameter with enum trx_rbmode.

btr_free_externally_stored_field(): If field_ref is zero, return
but assert ut_a(rbmode == RB_RECOVERY).  Unless InnoDB has crashed
while inserting a clustered index record, field_ref should not be zero.

btr_rec_free_updated_extern_fields(): Add the parameter enum trx_rbmode.

btr_cur_pessimistic_update(): Pass the rbmode parameter to
btr_rec_free_updated_extern_fields().

row_undo_ins(), row_undo_mod_upd_del_sec(): If row_build_index_entry()
fails, assert trx_is_recv() and skip this secondary index.

row_undo_mod_upd_del_sec(): Empty the heap at the end of each loop
iteration in order to conserve memory and to reduce the number of
low-level memory allocations.
2008-08-06 08:48:34 +00:00
marko
038f4dcfc8 branches/zip: Disable two debug assertions that attempt to call
buf_block_align() on a non-file page frame that was created in
btr_cur_pessimistic_insert(), to see if a record fits on a compressed
page by itself.  These assertions caused an assertion failure in
buf_block_align() in innodb_bug36172.test.

page_zip_write_rec(), page_zip_write_header(): Remove the assertion
that calls buf_frame_get_page_zip().
2008-08-06 06:20:05 +00:00
vasil
34ec18394e branches/zip:
Fix typo in comment.
2008-08-01 13:58:11 +00:00
inaam
e0ce800fa7 branches/zip issue# 33
This fix makes two basic changes in blob handling:
(The bug was introduced in r2252)

1) The blob prefixes are no longer stored in the undo if
  a) We are modifying a delete marked record and
  b) The record was delete marked by an already committed trx.

2) When building old row version to check if one of these versions
can hold an implicit lock on the record we stop our probe if
  a) The version is delete marked and
  b) The delete marking is done by a trx which is different from
     the current active trx on the record.

Reviewed by: Heikki
2008-07-29 17:06:18 +00:00
inaam
afb44e21e2 branches/zip:
Fixed a mistake in r2539 where I changed UNIV_INLINE to UNIV_INTERN
for the wrong function in btr0sea.h
2008-07-15 19:28:29 +00:00
inaam
208ba019de branches/zip: Merge 2524:2537 from branches/5.1:
------------------------------------------------------------------------
  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
  
  ------------------------------------------------------------------------
2008-07-15 17:38:53 +00:00
sunny
dd4efa3993 branches/zip: Function doesn't exist, remove declaration. 2008-06-26 07:24:23 +00:00
inaam
6fe27b5d6c branches/zip: internal mantis issue#49
This is to fix an unintended side effect of file_format_check changes.
We were reading the trx system page (TRX_SYS_PAGE_NO) before starting
recovery and that resulted in redo logs not being applied to the page.
The fix is to force a reread by calling buf_pool_invalidate().
This, however, made necessary that any writes to page are deferred to
until after the redo log application.

Reviewed by: Sunny
2008-06-18 15:45:34 +00:00
vasil
b21c94dc01 branches/zip: Merge 2437:2485 from branches/5.1:
(r2478 was skipped for the obvious reason)

  ------------------------------------------------------------------------
  r2464 | vasil | 2008-05-19 17:59:42 +0300 (Mon, 19 May 2008) | 9 lines
  
  branches/5.1:
  
  Fix Bug#36600 SHOW STATUS takes a lot of CPU in buf_get_latched_pages_number
  
  by removing the Innodb_buffer_pool_pages_latched variable from
  SHOW STATUS output in non-UNIV_DEBUG compilation.
   
  Approved by:	Heikki
  
  ------------------------------------------------------------------------
  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
  ------------------------------------------------------------------------
  r2478 | sunny | 2008-05-23 08:29:08 +0300 (Fri, 23 May 2008) | 3 lines
  
  branches/5.1: Fix for bug# 36793. This is a back port from branches/zip. This
  code has been tested on a big-endian machine too.
  
  ------------------------------------------------------------------------
  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.
  
  ------------------------------------------------------------------------
  r2482 | sunny | 2008-05-28 12:18:35 +0300 (Wed, 28 May 2008) | 5 lines
  
  branches/5.1: Fix for Bug#35602, "Failed to read auto-increment value from
  storage engine". 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.
  
  ------------------------------------------------------------------------
  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-06-06 15:24:58 +00:00
inaam
18c421230e branches/zip:
Clean up the POSIX_ASYNC_IO code which is currently not used and is unlikely to be ever used.
2008-05-16 14:41:18 +00:00
calvin
fc02f76d78 branches/zip:
Implement the system tablespace tagging described on the wiki:
https://svn.innodb.com/innobase/InnoDB_version_and_feature_compatibility

A brief description of the changes:

* The file format tag will be saved in the trx system page, starting at
  (UNIV_PAGE_SIZE - 16) for 8 bytes.
* The configuration parameter innodb_file_format_check is introduced.
  This variable can be set to on/off and any of the supported file
  formats in the configuration file, but can only be set to any of
  the supported file formats during runtime. The default is on.
* During table create/open, check the current file format against
  the max in file_format_max. If the current file format is newer,
  update file_format_max and tag the system tablespace with the
  newer one in a normal mtr.
* During startup, write the tag to the error log and check it against
  DICT_TF_FORMAT_MAX. Refuse to start with error, if
  -- DICT_TF_FORMAT_MAX < the tag, and
  -- innodb_file_format_check is ON
  Print out a warning , if
  -- DICT_TF_FORMAT_MAX < the tag, but
  -- innodb_file_format_check is off
* The system tablespace tag is re-settable using:
  set innodb_file_format_check = <file_format>

Approved by:	Sunny
2008-05-06 15:00:25 +00:00
vasil
3bad6e2511 branches/zip:
Add InnoDB version in these places:
 
* In INFORMATION_SCHEMA.PLUGINS.PLUGIN_VERSION, only 1.2 out of 1.2.3
  because MySQL supports only one dot there
 
* At startup:
  "080501 12:28:06 InnoDB Plugin 1.0.1 started; log sequence number 46509"

* In a server variable innodb_version;
  mysql> select @@innodb_version;
  +------------------+
  | @@innodb_version |
  +------------------+
  | 1.0.1            |
  +------------------+

Approved by:	Sunny
2008-05-06 11:10:09 +00:00
vasil
03a3d076d6 branches/zip:
Fix Mantis issue#34 https://svn.innodb.com/mantis/view.php?id=34
"I_S plugins should refuse to load if the storage engine plugin is not loaded"
and MySQL Bug#36310 http://bugs.mysql.com/36310
"InnoDB plugin crash"

* Make srv_was_started public
* Set srv_was_started at the end of innobase_start_or_create_for_mysql()
  so it is not set to TRUE if innodb encounters some startup error
* Refuse to start any of the I_S plugins if srv_was_started is not TRUE

Approved by:	Heikki
2008-04-29 14:57:06 +00:00
marko
eb04f0f8ef branches/zip: Implement the INFORMATION_SCHEMA tables
INNODB_COMPRESSION_BUDDY and INNODB_COMPRESSION_BUDDY_RESET.

buf_buddy_stat_struct, buf_buddy_stat_t, buf_buddy_stat[]:
Statistics of the buddy system grouped by block size.

i_s_innodb_compression_buddy, i_s_innodb_compression_buddy_reset:
New INFORMATION_SCHEMA plugins.

i_s_compression_buddy_fields_info[]: Define the fields:
size, used, free, relocated, relocated_sec.

i_s_compression_buddy_fill_low(), i_s_compression_buddy_fill(),
i_s_compression_buddy_reset_fill(): Fill the fields.

i_s_compression_buddy_init(), i_s_compression_buddy_reset_init():
Initialize the tables.
2008-03-28 10:03:58 +00:00
marko
f29b8ee0c3 branches/zip: Rename the INFORMATION_SCHEMA tables
INNODB_ZIP and INNODB_ZIP_RESET to
INNODB_COMPRESSION and INNODB_COMPRESSION_RESET,
and remove the statistics of the buddy system.

This change was discussed with Ken.  It makes the tables shorter
and easier to understand.  The removed data will be represented in
the tables INNODB_COMPRESSION_BUDDY and INNODB_COMPRESSION_BUDDY_RESET
that will be added later.

i_s_innodb_zip, i_s_innodb_zip_reset, i_s_zip_fields_info[],
i_s_zip_fill_low(), i_s_zip_fill(), i_s_zip_reset_fill(),
i_s_zip_init(), i_s_zip_reset_init(): Replace "zip" with "compression".

i_s_compression_fields_info[]: Remove "used", "free",
"relocated", "relocated_usec".  In "compressed_usec" and "decompressed_usec",
replace microseconds with seconds ("usec" with "sec").

page_zip_decompress(): Correct a typo in the function comment.

PAGE_ZIP_SSIZE_BITS, PAGE_ZIP_NUM_SSIZE: New constants.

page_zip_stat_t, page_zip_stat: Statistics of the compression, grouped
by page size.

page_zip_simple_validate(): Assert that page_zip->ssize is reasonable.
2008-03-28 09:28:54 +00:00
marko
60ae240d23 branches/zip: Merge 2367:2384 from branches/5.1. 2008-03-26 17:14:00 +00:00
marko
15c670988f branches/zip: Pass the tablespace flags correctly when creating or opening
single-table tablespaces.  This bug was reported by Sunny as Mantis issue #26.

fil_space_create(), fil_create_new_single_table_tablespace(),
fil_open_single_table_tablespace(), fsp_header_init_fields():
Add ut_a(flags != DICT_TF_COMPACT).

dict_build_table_def_step(), row_import_tablespace_for_mysql(),
row_truncate_table_for_mysql(): Pass correct flags to
fil_create_new_single_table_tablespace() or fil_open_single_table_tablespace().
2008-03-18 10:10:51 +00:00
marko
77d8c98735 branches/zip: Rename ib_ulonglong to ib_uint64_t and ib_longlong to ib_int64_t. 2008-03-17 14:19:04 +00:00
marko
ebdb9daa9b branches/zip: Merge 2295:2367 from branches/5.1. 2008-03-17 14:09:44 +00:00