Commit graph

63 commits

Author SHA1 Message Date
vasil
e0ea9e3fb3 branches/zip:
Add a test program to check whether the PAUSE instruction is available.
2009-07-21 09:28:27 +00:00
calvin
eda5850256 branches/zip: add copyright info to files related to PAUSE
instruction patch, contributed by Sun Microsystems.
2009-07-10 15:19:17 +00:00
vasil
900f489a19 branches/zip:
Use PAUSE instruction inside spinloop if it is available.

The patch was originally developed by Mikael Ronstrom <mikael@mysql.com>
and can be found here:
http://bazaar.launchpad.net/%7Emysql/mysql-server/mysql-5.4/revision/2768
http://bazaar.launchpad.net/%7Emysql/mysql-server/mysql-5.4/revision/2771
http://bazaar.launchpad.net/%7Emysql/mysql-server/mysql-5.4/revision/2772
http://bazaar.launchpad.net/%7Emysql/mysql-server/mysql-5.4/revision/2774
http://bazaar.launchpad.net/%7Emysql/mysql-server/mysql-5.4/revision/2777
http://bazaar.launchpad.net/%7Emysql/mysql-server/mysql-5.4/revision/2799
http://bazaar.launchpad.net/%7Emysql/mysql-server/mysql-5.4/revision/2800

Approved by:	Heikki (rb://137)
2009-07-02 12:12:36 +00:00
marko
3fdc16ea5b branches/zip: Replace a non-ASCII character
(ISO 8859-1 encoded U+00AD SOFT HYPHEN) with a cheap ASCII substitute.
2009-06-30 11:42:52 +00:00
marko
5929cea0fe branches/zip: Add some Doxygen comments, mainly to structs, typedefs,
macros and global variables.  Many more to go.
2009-05-25 12:09:24 +00:00
marko
c7d9b4bcd7 branches/zip: Revert ut0auxconf_* to r5102,
that is, make Doxygen ignore these test programs.
2009-05-25 10:39:07 +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
aa5ceec5d7 branches/zip: Add missing file comments. 2009-05-25 09:47:14 +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
d8b91c90a2 branches/zip: ut_dulint_sort(): Write proper comments. 2009-05-20 12:10:17 +00:00
marko
3174e395f3 branches/zip: ut_snprintf(): Fix the function comments. 2009-05-20 08:26:49 +00:00
marko
b04cffec7d branches/zip: Add missing function comments. 2009-05-20 04:42:12 +00:00
marko
62718d0e0c branches/zip: ib_wqueue_wait(): Add decorative comment. 2009-05-19 19:13:12 +00:00
marko
70f15d3fd9 branches/zip: ut0auxconf_have_solaris_atomics.c: Get the
function declarations from <atomic.h>.
Call the functions with proper arguments.
2009-05-19 09:04:58 +00:00
vasil
e6081cf140 branches/zip:
Add aux config programs to emulate the newly added checks in plug.in
(from r4678).
2009-04-17 22:40:47 +00:00
vasil
25aea25a45 branches/zip:
Add comment and copyright notice to the aux config program.
2009-04-17 22:22:33 +00:00
vasil
5550172262 branches/zip:
Rename the aux config program and give it a more specific name because
more are coming.
2009-04-17 22:19:03 +00:00
vasil
dd554ccf72 branches/zip:
Include the needed header for memset().
2009-04-17 21:30:37 +00:00
vasil
1cf2c95850 branches/zip:
Silence warning about unused variables.
2009-04-17 21:29:16 +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
d90bea085a branches/zip: Remove unneeded definitions and dependencies
from UNIV_HOTBACKUP builds.
2009-03-23 14:21:34 +00:00
vasil
3c9bec1100 branches/zip:
Implement a check whether pthread_t objects can be used by GCC atomic
builtin functions. This check is implemented in plug.in and defines the
macro HAVE_ATOMIC_PTHREAD_T. This macro is checked in univ.i and the
relevant part of the code enabled (the one that uses GCC atomics against
pthread_t objects).

In addition to this, the same program that is compiled as part of the
plug.in check is added in ut/ut0auxconf.c. In the InnoDB Plugin source
archives that are shipped to the users, a generated Makefile.in is added.
That Makefile.in will be modified to compile ut/ut0auxconf.c and define
the macro HAVE_ATOMIC_PTHREAD_T if the compilation succeeds. I.e.
Makefile.in will emulate the work that is done by plug.in. This is done in
order to make the check happen and HAVE_ATOMIC_PTHREAD_T eventually
defined without regenerating MySQL's ./configure from
./storage/innobase/plug.in. The point is not to ask users to install the
autotools and regenerate ./configure.

rb://95

Approved by:	Marko
2009-03-05 14:38:59 +00:00
marko
6ef2553098 branches/zip: ut_mem_init(): Add the assertion !ut_mem_block_list_inited. 2009-02-23 22:11:11 +00:00
marko
e2196c3419 branches/zip: Initialize ut_list_mutex at startup. Without this fix,
ut_list_mutex would be used uninitialized when innodb_use_sys_malloc=1.
This fix addresses Issue #181.

ut_mem_block_list_init(): Rename to ut_mem_init() and make public.

ut_malloc_low(), ut_free_all_mem(): Add ut_a(ut_mem_block_list_inited).

mem_init(): Call ut_mem_init().
2009-02-23 10:43:51 +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
marko
732f9dd7fb branches/zip: Protect ut_total_allocated_memory with ut_list_mutex.
Unprotected updates to ut_total_allocated_memory in
os_mem_alloc_large() and os_mem_free_large(), called during
fast index creation, may corrupt the variable and cause assertion failures.

Also, add UNIV_MEM_ALLOC() and UNIV_MEM_FREE() instrumentation around
os_mem_alloc_large() and os_mem_free_large(), so that Valgrind can
detect more errors.

rb://90 approved by Heikki Tuuri.  This addresses Issue #177.
2009-02-18 15:25:45 +00:00
vasil
a6c09afa90 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 28/28]
2009-02-17 10:14:04 +00:00
vasil
20c13efe91 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 27/28]
2009-02-17 10:12:56 +00:00
marko
f4cccb1f81 branches/zip: Map ut_malloc(), ut_realloc(), ut_free() to
malloc(), realloc(), free() when innodb_use_sys_malloc is set.

ut_free_all_mem(): If innodb_use_sys_malloc is set, do nothing,
because then ut_mem_block_list_inited will never be set.

log_init(): Use mem_alloc() instead of ut_malloc(), so that the
memory will be freed.  (Tested with Valgrind, although it is not
clear why the memory would be freed.)

rb://86 approved by Heikki Tuuri and Ken Jacobs.  This addresses Issue #168.
2009-02-10 08:38:41 +00:00
marko
15b9f877ec branches/zip: Enclose some functions inside #ifdef UNIV_HOTBACKUP:
ut_sprintf_timestamp_without_extra_chars(), ut_get_year_month_day(),
log_reset_first_header_and_checkpoint(): These functions are only used
in InnoDB Hot Backup.
2009-01-28 13:21:45 +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
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
788650088b branches/zip: Add a UNIV_INTERN qualifier to every global function declaration
in *.h files, so that the function signatures in the *.h and *.c files fully
match each other.

ut_dulint_sort(): Add a UNIV_INTERN qualifier also to the function definition.
2008-02-18 18:38:33 +00:00
marko
753a5a1df0 branches/zip: Hide some global variables that were accidentally not hidden
in r2276.  Now the following symbols will be exported when InnoDB is built
as a dynamic plugin:

* the virtual method pointer table of class ha_innodb
* the three variables that MySQL will reference when linking at runtime:

	_mysql_plugin_declarations_
	_mysql_plugin_interface_version_
	_mysql_sizeof_struct_st_plugin_

Furthermore, the following symbols are weak globals, to allow us to access
the built-in InnoDB in the mysqld executable, in case it contains a statically
linked InnoDB:

	builtin_innobase_plugin
	innodb_hton_ptr
2008-02-06 16:11:46 +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
afccd4afd2 branches/zip: INFORMATION_SCHEMA.INNODB_LOCKS: Quote lock_table, lock_index.
innodb_information_schema.test. Add tests that display most columns from
INFORMATION_SCHEMA.INNODB_LOCKS.  Test that quoting of table names works
and respects SQL_MODE='ANSI_QUOTES'.

innobase_print_identifier(): Remove.

innobase_convert_identifier(): New function,
based on innobase_print_identifier().

innobase_convert_name(): New function, similar to ut_print_namel(), but
using a memory buffer.

ut_print_namel(): Use innobase_convert_name().

fill_innodb_locks_from_cache(): Convert lock_table and lock_index by
calling innobase_convert_name().
2007-11-21 08:46:11 +00:00
vasil
e8de094a3f branches/zip:
Add innodb_locks.lock_data column and some relevant tests.
For record locks this column represents the ordering fields of the
locked row in a human readable, SQL-valid, format.

Approved by:	Marko
2007-10-29 13:03:53 +00:00
marko
a344db96e7 branches/zip: Merge 1918:1937 from trunk. 2007-10-03 08:44:50 +00:00
marko
23f80a6f54 branches/zip: Merge 1862:1894 from trunk, except 1866. 2007-09-27 11:17:45 +00:00
marko
f5e4a4c3ed branches/zip: Merge 1830:1862 from trunk. 2007-09-20 08:36:22 +00:00
marko
52a8928693 branches/zip: Simplify crash recovery in fast index creation.
trx_t: Remove dict_undo_list and dict_redo_list.

innobase_create_temporary_tablename(): Replace TEMP_TABLE_PREFIX with
a table name suffix "#1" or "#2".  In this way, the user can restore
precious data, should anything go wrong.  It is possible to reach an
inconsistent state, because the creation, deletion and renaming of
single-table tablespaces are not transactional.

ut_print_namel(), fil_make_ibd_name(), innobase_rename_table(): Remove
the special treatment of TEMP_TABLE_PREFIX.

Introduce TEMP_INDEX_PREFIX == 0xff for temporary indexes.  This byte
cannot occur in index names since MySQL 4.1.  However, it might have
been possible to use this byte in MySQL 4.0.

recv_recovery_from_checkpoint_finish(): Call the new function
row_merge_drop_temp_indexes(), to drop all indexes whose name starts
with the byte 0xff.

row_merge_rename_indexes(): Renamed from row_merge_rename_index().
Remove the parameter "index".

row_drop_table_for_mysql(): Unconditionally call trx_commit_for_mysql().

row_drop_table_for_mysql_no_commit(): Correct the function commit,
based on the corrected comment of row_drop_table_for_mysql().  Rely on
table->to_be_dropped instead of TEMP_TABLE_PREFIX.

ha_innobase::add_index(): Simplify the control flow.
2007-09-05 10:18:03 +00:00
marko
97b8960beb branches/zip: Merge 1783:1792 from trunk. 2007-09-03 08:44:39 +00:00
marko
a4132905cd branches/zip: Introduce TEMP_INDEX_PREFIX == 0xff for indexes being populated
in fast index creation.  The prefix was previously TEMP_TABLE_PREFIX == '/',
which may occur in index names.

ut_print_namel(): Do not assume that all '/' are separators between
database and table names.
2007-08-31 09:58:22 +00:00
marko
5288876e23 branches/zip: Make merge sort handle externally stored columns.
Some things still fail in innodb-index.test, and there seems to be
a race condition (data dictionary lock wait) when running with --valgrind.

dfield_t: Add an "external storage" flag, dfield->ext.

dfield_is_null(), dfield_is_ext(), dfield_set_ext(), dfield_set_null():
New functions.

dfield_copy(), dfield_copy_data(): Add const qualifiers, fix in/out comments.

data_write_sql_null(): Use memset().

big_rec_field_t: Replace byte* data with const void* data.

ut_ulint_sort(): Remove.

upd_field_t: Remove extern_storage.

upd_node_t: Replace ext_vec, n_ext_vec with n_ext.

row_merge_copy_blobs(): New function.

row_ins_index_entry(): Add the parameter "ibool foreign" for suppressing
foreign key checks during fast index creation or when inserting into
secondary indexes.

btr_page_insert_fits(): Add const qualifiers.

btr_cur_add_ext(), upd_ext_vec_contains(): Remove.

dfield_print_also_hex(), dfield_print(): Replace if...else if with switch.
Observe dfield_is_ext().
2007-06-21 09:43:15 +00:00
marko
4ed9adb502 branches/zip: Correctly print the names of temporary tables and indexes
during fast index creation.

TEMP_TABLE_PREFIX: Move the definition from dict0dict.h to ut0ut.h.

ut_print_namel(): Check if the name starts with TEMP_TABLE_PREFIX.

innobase_rename_table(): Print all names with ut_print_name().

row_prebuilt_free(): Replace assert() with ut_a().
2007-06-12 07:06:36 +00:00
marko
2379a7e3e9 branches/zip: Revert r1523. Passing extra parameters to SORT_FUN and CMP_FUN
of UT_SORT_FUNCTION_BODY is best done by defining SORT_FUN and CMP_FUN as
macros when needed.  The solution of r1523 allows for only one extra parameter.
2007-05-28 07:42:28 +00:00
marko
6eb0d1ad53 branches/zip: UT_SORT_FUNCTION_BODY(): Add the parameter CTX, which will be
needed in row0merge.c for merge sorting the small blocks in main memory.
Pass CTX also to SORT_FUN.  Adjust all users.
2007-05-24 13:14:57 +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
3a23bff39b branches/zip: Add Valgrind instrumentation to the InnoDB memory management
functions.

ut_malloc_low(): Flag the block with UNIV_MEM_ALLOC().  Do not flag the
block with UNIV_MEM_FREE() in ut_free(), because it would cause bogus
Valgrind warnings in the underlying memory allocator.

mem_pool_create(): Flag the data area with UNIV_MEM_FREE().

mem_pool_fill_free_list(): Flag the area header with UNIV_MEM_ALLOC().

mem_area_alloc(): Flag the data area with UNIV_MEM_ALLOC().

mem_area_free(): Flag the data area with UNIV_MEM_FREE().

mem_heap_alloc(): Flag the buffer with UNIV_MEM_ALLOC().

mem_heap_block_free(): Flag the block with UNIV_MEM_FREE().

mem_heap_free_top(): Flag the block with UNIV_MEM_FREE().
2007-03-28 09:02:55 +00:00