Commit graph

139 commits

Author SHA1 Message Date
marko
11ff89d994 branches/zip: Add @file comments, and convert decorative
/*********************************
comments to Doxygen /** style like this:
/*****************************//**

This conversion was performed by the following command:

perl -i -e 'while(<ARGV>){if (m|^/\*{30}\**$|) {
s|\*{4}$|//**| if ++$com>1; $_ .= "\@file $ARGV\n" if $com==2}
print; if(eof){$.=0;undef $com}}' */*[ch] include/univ.i
2009-05-25 09:52:29 +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
vasil
1b3cac5689 branches/zip:
Whitespace fixup.
2009-05-21 04:27:00 +00:00
marko
288a29458b branches/zip: Clean up some comments. 2009-05-20 10:06:59 +00:00
marko
6ec131d6f7 branches/zip: Merge revisions 4746:4976 from branches/5.1:
------------------------------------------------------------------------
  r4976 | marko | 2009-05-13 15:44:54 +0300 (Wed, 13 May 2009) | 6 lines

  branches/5.1: Display DB_ROLL_PTR in the COLUMNS section of the
  innodb_table_monitor output.  It was accidentally omitted due to an
  off-by-one loop condition.  (Bug #44320)

  rb://116 approved by Heikki Tuuri
  ------------------------------------------------------------------------
2009-05-13 11:49:38 +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
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
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
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
184ee4885c branches/zip: Non-functional change for reducing dependencies in InnoDB Hot Backup:
Replace srv_sys->dummy_ind1 and srv_sys->dummy_ind2 with
dict_ind_redundant and dict_ind_compact, initialized in dict_init().
2009-03-20 10:33:33 +00:00
vasil
4e0e5e1e53 branches/zip:
* Remove old Innobase copyright lines from C source files
* Add a reference to the GPLv2 license as recommended by the lawyers
at Oracle Legal

[Step 2/28]
2009-02-17 08:15:06 +00:00
vasil
9bc861b4e8 branches/zip:
* Remove old Innobase copyright lines from C source files
* Add a reference to the GPLv2 license as recommended by the lawyers
at Oracle Legal

[Step 1/28]
2009-02-17 08:12:02 +00:00
marko
bef98e3442 branches/zip: Remove some redundant #include statements. 2009-01-23 09:04:49 +00:00
marko
2341d537a4 branches/zip: Merge revisions 3601:3930 from branches/5.1:
------------------------------------------------------------------------
  r3911 | sunny | 2009-01-13 14:15:24 +0200 (Tue, 13 Jan 2009) | 13 lines

  branches/5.1: Fix Bug#38187 Error 153 when creating savepoints
  InnoDB previously treated savepoints as a stack e.g.,
    SAVEPOINT a;
    SAVEPOINT b;
    SAVEPOINT c;
    SAVEPOINT b; <- This would delete b and c.

  This fix changes the behavior to:
    SAVEPOINT a;
    SAVEPOINT b;
    SAVEPOINT c;
    SAVEPOINT b; <- Does not delete savepoint c
  ------------------------------------------------------------------------
  r3930 | marko | 2009-01-14 15:51:30 +0200 (Wed, 14 Jan 2009) | 4 lines

  branches/5.1: dict_load_table(): If dict_load_indexes() fails,
  invoke dict_table_remove_from_cache() instead of dict_mem_table_free(),
  so that the data dictionary will not point to freed data.
  (Bug #42075, Issue #153, rb://76 approved by Heikki Tuuri)
  ------------------------------------------------------------------------
2009-01-14 14:06:22 +00:00
marko
2f7bcc7d99 branches/zip: In hash table lookups, assert that the traversed items
satisfy some conditions when UNIV_DEBUG is defined.

HASH_SEARCH(): New parameter: ASSERTION. All users will pass an appropriate
ut_ad() or nothing.

dict_table_add_to_columns(): Assert that the table being added to the data
dictionary cache is not already being pointed to by the name_hash and
id_hash tables.

HASH_SEARCH_ALL(): New macro, for use in dict_table_add_to_columns().

dict_mem_table_free(): Set ut_d(table->cached = FALSE), so that we can
check ut_ad(table->cached) when traversing the hash tables, as in
HASH_SEARCH(name_hash, dict_sys->table_hash, ...) and
HASH_SEARCH(id_hash, dict_sys->table_id_hash, ...).

dict_table_get_low(), dict_table_get_on_id_low(): Assert
ut_ad(!table || table->cached).

fil_space_get_by_id(): Check ut_ad(space->magic_n == FIL_SPACE_MAGIC_N)
in HASH_SEARCH(hash, fil_system->spaces, ...).

fil_space_get_by_name(): Check ut_ad(space->magic_n == FIL_SPACE_MAGIC_N)
in HASH_SEARCH(name_hash, fil_system->name_hash, ...).

buf_buddy_block_free(): Check that the blocks are in valid state in
HASH_SEARCH(hash, buf_pool->zip_hash, ...).

buf_page_hash_get(): Check that the blocks are in valid state in
HASH_SEARCH(hash, buf_pool->page_hash, ...).

get_share(), free_share(): Check ut_ad(share->use_count > 0) in
HASH_SEARCH(table_name_hash, innobase_open_tables, ...).

This was posted as rb://75 for tracking down errors similar to Issue #153.
2009-01-13 19:46:22 +00:00
marko
6bdab319ad branches/zip: Always check for "row too large" when executing SQL to create
an index or table.  We have to skip this check when loading table definitions
from the data dictionary, because we could otherwise refuse to load old
tables (even uncompressed ones).  This addresses Issue #119.

The first "row too large" check was implemented in MySQL 5.0.3
to address MySQL Bug #5682.  In the InnoDB Plugin 1.0.2, a more
accurate check was implemented in innodb_strict_mode.  We now
make the check unconditional.

dict_create_index_step(): Pass strict=TRUE to dict_index_add_to_cache().

trx_is_strict(), thd_is_strict(): Remove.

innodb-zip.test: Test in innodb_strict_mode=OFF.

innodb_bug36169.test: Ensure that none of the tables can be created.

rb://56 approved by Sunny Bains.
2008-11-20 10:22:40 +00:00
sunny
7fed1c703e branches/zip:
1. We add a vector of locks to trx_t. This array contains the autoinc
  locks granted to a transaction. There is one per table.

  2. We enforce releasing of these locks in the reverse order from the
  one in which they are acquired. The assumption is that since the
  AUTOINC locks are statement level locks. Nested statements introduced
  by triggers are stacked it should hold.

There was some cleanup done to the vector code too by adding const and
some new functions. Rename dict_table_t::auto_inc_lock to autoinc_lock.

Fix Bug#26316 Triggers create duplicate entries on auto-increment columns
rb://22
2008-10-31 07:40:29 +00:00
marko
f3f2de1614 branches/zip: dict_str_starts_with_keyword(): Removed this unused function.
Spotted by Sunny.
2008-10-28 06:36:39 +00:00
sunny
119142d2d1 branches/zip:
Merge revisions 2852:2854 from branches/5.1:

  ------------------------------------------------------------------------
  r2854 | sunny | 2008-10-23 08:30:32 +0300 (Thu, 23 Oct 2008) | 13 lines
  Changed paths:
     M /branches/5.1/dict/dict0dict.c
     M /branches/5.1/dict/dict0mem.c
     M /branches/5.1/handler/ha_innodb.cc
     M /branches/5.1/handler/ha_innodb.h
     M /branches/5.1/include/dict0dict.h
     M /branches/5.1/include/dict0mem.h
     M /branches/5.1/row/row0mysql.c
  
  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 06:24:33 +00:00
marko
bb4b3f4008 branches/zip: Skip the undo log size check on REDUNDANT and COMPACT tables.
In ROW_FORMAT=DYNAMIC and ROW_FORMAT=COMPRESSED, column prefix indexes
require that prefixes of externally stored columns be written to the
undo log. This may make the undo log record bigger than the record on
the B-tree page.  The maximum size of an undo log record is the page
size.  That must be checked for, in dict_index_add_to_cache().

dict_index_add_to_cache(): Skip the undo log size check for REDUNDANT
and COMPACT tables. These tables store prefixes of externally stored
columns locally within the clustered index record.  There are no special
considerations for the undo log record size.

innodb-index.test: Ensure that the check exists for ROW_FORMAT=DYNAMIC,
but not for ROW_FORMAT=COMPACT.

This fixes issue #99.  rb://28 approved by Sunny.
2008-10-16 05:41:13 +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
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
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
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
inaam
b5d1e283af branches/zip
Add missing semicolon. Introduced in r2602 which was obviously not
compiled with UNIV_DEBUG.
2008-09-13 11:44:14 +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
93f57e92dc branches/zip: Clean up: do not assign index->id as a special case
in fast index creation.  In r1399, we wrote undo log records about
creating indexes.  The special undo log records were deemed
unnecessary later, but this special handling was not removed then.

row_merge_create_index(): Do not assign index->id.

dict_build_index_def_step(): Unconditionally assign index->id.
2008-08-29 09:13:16 +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
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
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
bd8968b45d branches/zip: dict_load_table(): Remove a redundant check for !flags.
The function dict_sys_tables_get_flags() already ensures that the
table flags are 0 unless ROW_FORMAT=COMPACT.
2008-03-18 10:03: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
marko
94c7701081 branches/zip: dict_table_print_low(): Print table->flags, so that users
can create the table innodb_table_monitor and see in the error log which
tables are incompatible with older versions of InnoDB.
2008-03-11 08:57:25 +00:00
marko
86361e032b branches/zip: Implement the configuration parameter and settable global
variable innodb_file_format.  Implement file format version stamping of
*.ibd files and SYS_TABLES.TYPE.

This change breaks introduces an incompatible change for for
compressed tables.  We can do this, as we have not released yet.

innodb-zip.test: Add tests for stricter KEY_BLOCK_SIZE and ROW_FORMAT
checks.

DICT_TF_COMPRESSED_MASK, DICT_TF_COMPRESSED_SHIFT: Replace with
DICT_TF_ZSSIZE_MASK, DICT_TF_ZSSIZE_SHIFT.

DICT_TF_FORMAT_MASK, DICT_TF_FORMAT_SHIFT, DICT_TF_FORMAT_51,
DICT_TF_FORMAT_ZIP: File format version, stored in table->flags,
in the .ibd file header, and in SYS_TABLES.TYPE.

dict_create_sys_tables_tuple(): Write the table flags to SYS_TABLES.TYPE
if the format is at least DICT_TF_FORMAT_ZIP.  For old formats
(DICT_TF_FORMAT_51), write DICT_TABLE_ORDINARY as the table type.

DB_TABLE_ZIP_NO_IBD: Remove the error code.  The error handling is done
in ha_innodb.cc; as a failsafe measure, dict_build_table_def_step() will
silently clear the compression and format flags instead of returning this
error.

dict_mem_table_create(): Assert that no extra bits are set in the flags.

dict_sys_tables_get_zip_size(): Rename to dict_sys_tables_get_flags().
Check all flag bits, and return ULINT_UNDEFINED if the combination is
unsupported.

dict_boot(): Document the SYS_TABLES columns N_COLS and TYPE.

dict_table_get_format(), dict_table_set_format(),
dict_table_flags_to_zip_size(): New accessors to table->flags.

dtuple_convert_big_rec(): Introduce the auxiliary variables
local_len, local_prefix_len.  Store a 768-byte prefix locally
if the file format is less than DICT_TF_FORMAT_ZIP.

dtuple_convert_back_big_rec(): Restore the columns.

srv_file_format: New variable: innodb_file_format.

fil_create_new_single_table_tablespace(): Replace the parameter zip_size
with table->flags.

fil_open_single_table_tablespace(): Replace the parameter zip_size_in_k
with table->flags.  Check the flags.

fil_space_struct, fil_space_create(), fil_op_write_log():
Replace zip_size with flags.

fil_node_open_file(): Note a TODO item for InnoDB Hot Backup.
Check that the tablespace flags match.

fil_space_get_zip_size(): Rename to fil_space_get_flags().  Add a
wrapper for fil_space_get_zip_size().

fsp_header_get_flags(): New function.

fsp_header_init_fields(): Replace zip_size with flags.

FSP_SPACE_FLAGS: New name for the tablespace flags.  This field used
to be called FSP_PAGE_ZIP_SIZE, or FSP_LOWEST_NO_WRITE.  It has always
been written as 0 in MySQL/InnoDB versions 4.1 to 5.1.

MLOG_ZIP_FILE_CREATE: Rename to MLOG_FILE_CREATE2.  Add a 32-bit
parameter for the tablespace flags.

ha_innobase::create(): Check the table attributes ROW_FORMAT and
KEY_BLOCK_SIZE.  Issue errors if they are inappropriate, or warnings
if the inherited attributes (in ALTER TABLE) will be ignored.

PAGE_ZIP_MIN_SIZE_SHIFT: New constant: the 2-logarithm of PAGE_ZIP_MIN_SIZE.
2008-03-10 11:05:32 +00:00
marko
583ce8e896 branches/zip: Fix two more bogus MSVC C4090 warnings on constness differences
(Warning C4090 is incorrectly issued when using Visual C++ .NET 2003,
bug 101661, http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=101661)

dict_table_find_equivalent_index(): Cast away constness in the mem_free()
call.  MSVC seems to think that an array of pointers to const data is
const itself.

UT_SORT_FUNCTION_BODY(): Cast away constness in the memcpy() call.
MSVC seems to think that an array of pointers to const data is const itself.
2008-03-05 09:54:48 +00:00
marko
997de88df6 branches/zip: dict0dict.c: Add the #include "ha_prototypes.h" that should
have been added in r2327.
2008-02-28 08:33:19 +00:00
vasil
26402257da branches/zip:
Use innobase_strcasecmp() insteaed of strcasecmp() in i_s.cc and get rid
of strings.h (that file is not present on Windows).

Move the prototype of innobase_strcasecmp() from ha_innodb.cc and
dict0dict.c to ha_prototypes.h.

Approved by:	Heikki
2008-02-27 16:53:56 +00:00
marko
2c2b06ad75 branches/zip: Introduce UNIV_INTERN, a linkage specifier for InnoDB-global
symbols.  Use it for all definitions of non-static variables and functions.

lexyy.c, make_flex.sh: Declare yylex as UNIV_INTERN, not static.  It is
referenced from pars0grm.c.

Actually, according to
	nm .libs/ha_innodb.so|grep -w '[ABCE-TVXYZ]'
the following symbols are still global:

* The vtable for class ha_innodb
* pars0grm.c: The function yyparse() and the variables yychar, yylval, yynerrs

The required changes to the Bison-generated file pars0grm.c will be addressed
in a separate commit, which will add a script similar to make_flex.sh.

The class ha_innodb is renamed from class ha_innobase by a #define.  Thus,
there will be no clash with the builtin InnoDB.  However, there will be some
overhead for invoking virtual methods of class ha_innodb.  Ideas for making
the vtable hidden are welcome.  -fvisibility=hidden is not available in GCC 3.
2008-02-06 14:17:36 +00:00
marko
7d34b71cb9 branches/zip: Introduce the accessor function dict_index_is_ibuf()
for determining if an index is the insert buffer B-tree.
2008-01-25 08:13:12 +00:00
marko
463141d149 branches/zip: Implement a limit for the size of undo log records.
innodb-index.test: Add a test with a large number of externally stored
columns.  Check that there may not be prefix indexes on too many columns.

dict_index_too_big_for_undo(): New function: Check if the undo log may
overflow.

dict_index_add_to_cache(): Return DB_SUCCESS or DB_TOO_BIG_RECORD.
Postpone the creation and linking of some data structures, so that
when dict_index_too_big_for_undo() holds, it will be easier to clean up.
Check the return status in all callers.
2007-12-19 14:03:39 +00:00