Commit graph

70 commits

Author SHA1 Message Date
inaam
35bcc4ee2b branches/zip
Non functional change. s/Percona/Percona Inc./
2009-06-30 17:21:09 +00:00
inaam
99c57a5251 branches/zip rb://131
This patch changes the following defaults:

max_dirty_pages_pct: default from 90 to 75. max allowed from 100 to 99
additional_mem_pool_size: default from 1 to 8 MB
buffer_pool_size: default from 8 to 128 MB
log_buffer_size: default from 1 to 8 MB
read_io_threads/write_io_threads: default from 1 to 4

The log file sizes are untouched because of upgrade issues

Reviewed by: Heikki
2009-06-11 12:15:41 +00:00
inaam
b667060360 branches/zip
Non functional change:

Added legal notices acknowledging percona contribution to the multiple
IO helper threads patch i.e.: r5262
2009-06-08 15:18:21 +00:00
vasil
5d3b805292 branches/zip:
Enable functionality to have multiple background io helper threads.
This patch is based on percona contributions.

More details about this patch will be written at:
https://svn.innodb.com/innobase/MultipleBackgroundThreads

The patch essentially does the following:

expose following knobs:
innodb_read_io_threads = [1 - 64] default 1
innodb_write_io_threads = [1 - 64] default 1

deprecate innodb_file_io_threads (this parameter was relevant only on windows)

Internally it allows multiple segments for read and write IO request arrays
where one thread works on one segement.

Submitted by:	Inaam (rb://124)
Approved by:	Heikki (rb://124)
2009-06-05 15:04:25 +00:00
vasil
a3548774c6 branches/zip:
Fix Mantis Issue#244 fix bug in linear read ahead (no check on access pattern)

The changes are:

1) Take into account access pattern when deciding whether or not to do linear
  read ahead.
2) Expose a knob innodb_read_ahead_factor = [0-64] default (8), dynamic,
  global to control linear read ahead behvior
3) Disable random read ahead. Keep the code for now.

Submitted by:	Inaam (rb://122)
Approved by:	Heikki (rb://122)
2009-06-05 14:13:31 +00:00
marko
1be6982709 branches/zip: Clean up some comments.
Make the rec parameter of mlog_open_and_write_index() const.
2009-06-01 09:35:25 +00:00
marko
68a1ee9960 branches/zip: Add some Doxygen comments for many structs, typedefs,
#defines and global variables.  Many are still missing.
2009-05-26 12:28:49 +00:00
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
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
288a29458b branches/zip: Clean up some comments. 2009-05-20 10:06:59 +00:00
marko
db9dc3bb20 branches/zip: Add missing out: comments to nullary functions. 2009-05-19 06:30:02 +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
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
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
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
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
marko
93ec81bb6d branches/zip: Correct the initialization of the memory subsystem once
again, to finally put Issue #181 to rest.

Revert some parts of r4274.  It is best not to call ut_malloc() before
srv_general_init().

mem_init(): Do not call ut_mem_init().

srv_general_init(): Initialize the memory subsystem in two phases:
first ut_mem_init(), then mem_init().  This is because os_sync_init()
and sync_init() depend on ut_mem_init() and mem_init() depends on
os_sync_init() or sync_init().

srv_parse_data_file_paths_and_sizes(),
srv_parse_log_group_home_dirs(): Remove the output parameters.  Assign
to the global variables directly.  Allocate memory with malloc()
instead of ut_malloc(), because these functions will be called before
srv_general_init().

srv_free_paths_and_sizes(): New function, for cleaning up after
srv_parse_data_file_paths_and_sizes() and
srv_parse_log_group_home_dirs().

rb://92 approved by Sunny Bains
2009-02-25 10:09:15 +00:00
marko
d25cf61788 branches/zip: Fix bugs in the fix of Issue #181. Tested inside and
outside Valgrind, with innodb_use_sys_malloc set to 0 and 1.

mem_init(): Invoke ut_mem_init() before mem_pool_create(), because
the latter one will invoke ut_malloc().

srv_general_init(): Do not initialize the memory subsystem (mem_init()).

innobase_init(): Initialize the memory subsystem (mem_init()) before
calling srv_parse_data_file_paths_and_sizes(), which needs ut_malloc().
Call ut_free_all_mem() in error handling to clean up after the mem_init().
2009-02-23 22:14:38 +00:00
marko
e31baa849f branches/zip: Make innodb_use_sys_malloc=ON the default.
Replace srv_use_sys_malloc with UNIV_LIKELY(srv_use_sys_malloc)
to improve branch prediction in the default case.

Approved by Ken over the IM.
2009-02-20 20:31:03 +00:00
vasil
c6232c06fa branches/zip:
To the files touched by the Google patch from c4144 (excluding
include/os0sync.ic because later we removed Google code from that file):

* Remove the Google license
* Remove old Innobase copyright lines
* Add a reference to the Google license and to the GPLv2 license at the top,
as recommended by the lawyers at Oracle Legal.
2009-02-17 07:56:33 +00:00
inaam
a1bb700fd2 branches/zip rb://30
This patch changes the innodb mutexes and rw_locks implementation.
On supported platforms it uses GCC builtin atomics. These changes
are based on the patch sent by Mark Callaghan of Google under BSD
license. More technical discussion can be found at rb://30

Approved by: Heikki
2009-02-09 23:36:25 +00:00
marko
7b526e0118 branches/zip: srv_suspend_mysql_thread(): Add some clarifying comments. 2009-01-02 22:23:30 +00:00
inaam
09a089ecf8 branches/zip: Implement the parameter innodb_use_sys_malloc
(false by default), for disabling InnoDB's internal memory allocator
and using system malloc/free instead.

rb://62 approved by Marko
2009-01-02 13:10:50 +00:00
calvin
cb876f88df branches/zip: fix Mantis issue #138 InnoDB fails if
innodb_buffer_pool_size >= 4096M on x64 Windows

All three srv_buf_pool related variables are defined as ulong, which is
32-bit on 64-bit Windows. They are changed to 64-bit ulint. Also
system_info.dwPageSize appears to be 32-bit only. Casting to 64-bit
is required.

Approved by:	Marko (on IM)
2008-12-10 22:19:07 +00:00
vasil
7ed448ce95 branches/zip:
Merge 2929:3458 from branches/5.1 (resolving conflict in c3257,
note also that r3363 reverted r2933 so there are not changes in
mysql-test/innodb-autoinc.result with the current merge):

  ------------------------------------------------------------------------
  r2933 | calvin | 2008-10-30 02:57:31 +0200 (Thu, 30 Oct 2008) | 10 lines
  Changed paths:
     M /branches/5.1/mysql-test/innodb-autoinc.result
  
  branches/5.1: correct the result file innodb-autoinc.result
  
  Change the followings:
    auto_increment_increment
    auto_increment_offset
  
  to
    auto-increment-increment
    auto-increment-offset
  
  ------------------------------------------------------------------------
  r2981 | marko | 2008-11-07 14:54:10 +0200 (Fri, 07 Nov 2008) | 5 lines
  Changed paths:
     M /branches/5.1/row/row0mysql.c
  
  branches/5.0: row_mysql_store_col_in_innobase_format(): Correct a misleading
  comment. In the UTF-8 encoding, ASCII takes 1 byte per character, while
  the "latin1" character set (normally ISO-8859-1, but in MySQL it actually
  refers to the Windows Code Page 1252 a.k.a. CP1252, WinLatin1)
  takes 1 to 3 bytes (1 to 2 bytes for the ISO-8859-1 subset).
  ------------------------------------------------------------------------
  r3114 | calvin | 2008-11-14 20:31:48 +0200 (Fri, 14 Nov 2008) | 8 lines
  Changed paths:
     M /branches/5.1/handler/ha_innodb.cc
  
  branches/5.1: fix bug#40386: Not flushing query cache after truncate
  
  ha_statistics.records can not be 0 unless the table is empty, set to
  1 instead. The original problem of bug#29507 is fixed in the server.
  
  Additional test was done with the fix of bug#29507 in the server.
  
  Approved by: Heikki (on IM)
  ------------------------------------------------------------------------
  r3257 | inaam | 2008-11-24 22:06:50 +0200 (Mon, 24 Nov 2008) | 13 lines
  Changed paths:
     M /branches/5.1/handler/ha_innodb.cc
     M /branches/5.1/srv/srv0srv.c
     M /branches/5.1/trx/trx0trx.c
  
  branches/5.1 bug#40760
  
  The config param innodb_thread_concurrency is dynamically set and is
  read when a thread enters/exits innodb. If the value is changed between
  the enter and exit time the behaviour becomes erratic.
  The fix is not to use srv_thread_concurrency when exiting, instead use
  the flag trx->declared_to_be_inside_innodb.
  
  rb://57
  
  Approved by: Marko
  
  
  ------------------------------------------------------------------------
  r3363 | calvin | 2008-12-04 19:00:20 +0200 (Thu, 04 Dec 2008) | 13 lines
  Changed paths:
     M /branches/5.1/mysql-test/innodb-autoinc.result
  
  branches/5.1: revert the changes in r2933
  
  The changes in r2933 causes test failure on Linux.
  More investigation is needed for Windows.
  
  Change the followings in innodb-autoinc.result:
    auto-increment-increment
    auto-increment-offset
  
  back to:
    auto_increment_increment
    auto_increment_offset
  
  ------------------------------------------------------------------------
  r3412 | vasil | 2008-12-05 10:46:18 +0200 (Fri, 05 Dec 2008) | 7 lines
  Changed paths:
     M /branches/5.1/trx/trx0undo.c
  
  branches/5.1:
  
  Add the traditional 2 spaces after the timestamp so the message does
  not look like:
  
  070223 13:26:01InnoDB: Warning: canno....
  
  ------------------------------------------------------------------------
  r3458 | vasil | 2008-12-09 11:21:08 +0200 (Tue, 09 Dec 2008) | 51 lines
  Changed paths:
     M /branches/5.1/mysql-test/innodb_bug34300.test
  
  branches/5.1:
  
  Merge a change from MySQL to fix the failing innodb_bug34300 mysql-test:
  
    main.innodb_bug34300           [ fail ]
    
    mysqltest: At line 11: query 'SET @@max_allowed_packet=16777216' failed: 1621: SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
    
    Aborting: main.innodb_bug34300 failed in default mode. 
  
  The changeset is this:
  
    ------------------------------------------------------------
    revno: 2709.1.10
    committer: Staale Smedseng <staale.smedseng@sun.com>
    branch nick: b22891-51-bugteam
    timestamp: Thu 2008-11-20 08:51:48 +0100
    message:
      A fix for Bug#22891 "session level max_allowed_packet can be
      set but is ignored".
    
      This patch makes @@session.max_allowed_packed and
      @@session.net_buffer_length read-only as suggested in the bug
      report. The user will have to use SET GLOBAL (and reconnect)
      to alter the session values of these variables.
    
      The error string ER_VARIABLE_IS_READONLY is introduced.
    
      Tests are modified accordingly.
    modified:
      mysql-test/r/func_compress.result
      mysql-test/r/max_allowed_packet_basic.result
      mysql-test/r/max_allowed_packet_func.result
      mysql-test/r/net_buffer_length_basic.result
      mysql-test/r/packet.result
      mysql-test/r/union.result
      mysql-test/r/variables.result
      mysql-test/t/func_compress.test
      mysql-test/t/innodb_bug34300.test
      mysql-test/t/max_allowed_packet_basic.test
      mysql-test/t/max_allowed_packet_func.test
      mysql-test/t/net_buffer_length_basic.test
      mysql-test/t/packet.test
      mysql-test/t/union.test
      mysql-test/t/variables.test
      sql/set_var.cc
      sql/set_var.h
      sql/share/errmsg.txt
    ------------------------------------------------------------
  
  
  ------------------------------------------------------------------------
2008-12-09 09:49:03 +00:00
marko
bd3514db33 branches/zip: Merge revisions 2854:2929 from branches/5.1,
except r2924, which was merged from branches/zip r2866 to branches/5.1
and except r2879 which was merged separately by Calvin:

  ------------------------------------------------------------------------
  r2902 | vasil | 2008-10-28 12:10:25 +0200 (Tue, 28 Oct 2008) | 10 lines

  branches/5.1:

  Fix Bug#38189 innodb_stats_on_metadata missing

  Make the variable innodb_stats_on_metadata visible to the users and
  also settable at runtime. Previously it was only "visible" as a command
  line startup option to mysqld.

  Approved by:    Marko (https://svn.innodb.com/rb/r/36)
  ------------------------------------------------------------------------
  r2929 | marko | 2008-10-29 21:26:14 +0200 (Wed, 29 Oct 2008) | 13 lines

  branches/5.1: dtype_get_sql_null_size(): return the correct storage
  size of a SQL NULL column. (Bug #40369)

  When MySQL Bug #20877 was fixed in r834, this function was
  accidentally modified to return 0 or 1. Apparently, the only impact of
  this bug is that fixed-length columns cannot be updated in-place from
  or to SQL NULL, even in ROW_FORMAT=REDUNDANT.  After this fix,
  fixed-length columns in ROW_FORMAT=REDUNDANT will have a constant
  storage size as they should, no matter if NULL or non-NULL.  The bug
  caused fixed-length NULL columns to occupy 1 byte.

  rb://37 approved by Heikki over IM.
  ------------------------------------------------------------------------
2008-10-29 19:39:24 +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
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
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
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
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
calvin
e978b4a235 branches/zip: Implementation of using animal names for innodb_file_format,
described in Mantis#30. Specifically:

- Allow innodb_file_format to take string arguments
- Make innodb_file_format system variable a string instead of a number
- Implement the callback functions
- Update warning messages

Three new functions are implemented:

file_format_name_lookup(): Validate the file format name and return
its corresponding id.

innodb_file_format_check(): Check if it is a valid file format. This
function is registered as a callback with MySQL.

innodb_file_format_update(): Update the global variable using the
"saved" value. This functions is registered as a callback with MySQL.
2008-04-10 11:02:16 +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
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
c853494ea2 branches/zip: Make innodb_file_per_table a settable global variable.
There is one consideration: fil_init() chooses the tablespace hash size
based on the initial value of srv_file_per_table.  However, this is nothing
new: InnoDB could be started with innodb_file_per_table=0 even though
*.ibd files exist.

srv_file_per_table: Declare as my_bool instead of ibool, because
MYSQL_SYSVAR_BOOL() expects a pointer to my_bool.  Document the
variable also in srv0srv.h.

innobase_start_or_create_for_mysql(): Note why it is OK to temporarily
clear srv_file_per_table.

innobase_file_per_table: Remove.
2008-03-07 12:56:52 +00:00
marko
9d58e3ff99 branches/zip: Improve the LRU algorithm with a separate unzip_LRU list of
blocks that contains uncompressed and compressed frames.  This patch was
designed by Heikki and Inaam, implemented by Inaam, and refined and reviewed
by Marko and Sunny.

buf_buddy_n_frames, buf_buddy_min_n_frames, buf_buddy_max_n_frames: Remove.

buf_page_belongs_to_unzip_LRU(): New predicate:
bpage->zip.data && buf_page_get_state(bpage) == BUF_BLOCK_FILE_PAGE.

buf_pool_t, buf_block_t: Add the linked list unzip_LRU.  A block in the
regular LRU list is in unzip_LRU iff buf_page_belongs_to_unzip_LRU() holds.

buf_LRU_free_block(): Add a third return value to refine the case
"cannot free the block".

buf_LRU_search_and_free_block(): Update the documentation to reflect the
implementation.

buf_LRU_stat_t, buf_LRU_stat_cur, buf_LRU_stat_sum, buf_LRU_stat_arr[]:
Statistics for the unzip_LRU algorithm.

buf_LRU_stat_update(): New function: Update the statistics.  Called once
per second by srv_error_monitor_thread().

buf_LRU_validate(): Validate the unzip_LRU list as well.

buf_LRU_evict_from_unzip_LRU(): New predicate: Use the unzip_LRU before
falling back to the regular LRU?

buf_LRU_free_from_unzip_LRU_list(), buf_LRU_free_from_common_LRU_list():
Subfunctions of buf_LRU_search_and_free_block().

buf_LRU_search_and_free_block(): Reimplement.  Try to evict an uncompressed
page from the unzip_LRU list before falling back to evicting an entire block
from the common LRU list.

buf_unzip_LRU_remove_block_if_needed(): New function.

buf_unzip_LRU_add_block(): New function: Add a block to the unzip_LRU list.
2008-03-03 12:48:38 +00:00
marko
cdba733fb5 branches/zip: Merge 2263:2295 from branches/5.1. 2008-02-18 20:09:03 +00:00
inaam
c087bec896 branches/zip:
srv_log_file_size is misspelled as srv_log_filen_size in r2276

reviewed by: non-functional change.
2008-02-07 20:12:11 +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
ddcf4f8d9c branches/zip: Remove some unnecessary memory references in the master thread.
srv_print_thread_releases, srv_print_lock_waits, srv_print_buf_io,
srv_print_log_io, srv_print_latch_waits: Define these variables as
constants (FALSE), unless UNIV_DEBUG is defined.  These variables
are never assigned to, and they are initialized to FALSE.  It could
be useful to set them when debugging InnoDB.

srv_slot_t: Fuse the fields type, in_use, suspended to a single machine word.

srv_meter[], srv_meter_low_water[], srv_meter_high_water[],
srv_meter_high_water2[], srv_meter_foreground[]: Enclose these arrays
inside #if 0.  The arrays are essentially constants that do not affect
the control flow.

enum srv_thread_type: New enum, to replace the #defines SRV_COM, ...
Enclose the unused values SRV_BUFFER, SRV_RECOVERY, SRV_INSERT
inside #if 0, so that some arrays and loops can be reduced.
2007-10-24 07:12:11 +00:00
marko
e6f452c7cd branches/zip: srv_suspend_mysql_thread(): Allow the transaction to
hold an X-latch to the data dictionary, to avoid an assertion failure
when a lock wait occurs in row_merge_lock_table().
2007-10-19 10:30:34 +00:00
vasil
b9982ac9ec Implement INFORMATION_SCHEMA tables innodb_trx, innodb_locks,
innodb_lock_waits. See
https://svn.innodb.com/innobase/InformationSchema/TransactionsAndLocks
for design notes.

Things that need to be resolved before this goes live:
* MySQL must add thd_get_thread_id() function to their code
  http://bugs.mysql.com/30930
* Allocate memory from mem_heap instead of using mem_alloc()
* Copy table name and index name into the cache because they may be
  freed later which will result in referencing freed memory

Approved by:	Marko
2007-09-20 11:23:44 +00:00
marko
f5e4a4c3ed branches/zip: Merge 1830:1862 from trunk. 2007-09-20 08:36:22 +00:00
marko
7fbc04fcdc branches/zip: Merge 1533:1553 from trunk. 2007-06-06 11:07:37 +00:00
marko
d75e64f98a branches/zip: Merge 1493:1533 from trunk.
Make use of UT_BITS_IN_BYTES().
2007-05-29 08:48:16 +00:00
marko
e7284367dc branches/zip: Merge revisions 1402:1493 from trunk.
Remove mysql.patch, because the configuration parameter interface has changed.
2007-05-14 09:07:15 +00:00
marko
33c1125d55 branches/zip: Merge revisions 1322:1402 from trunk. 2007-04-02 05:39:41 +00:00
marko
16ffd00dc1 branches/zip: Merge revisions 1206:1271 from trunk. 2007-02-02 11:31:29 +00:00