Commit graph

40 commits

Author SHA1 Message Date
vasil
2ee633f8eb Revert r1850 as MySQL did not approve the addition.
log for r1850:

Implement this feature request:
http://bugs.mysql.com/30706

* Add a function that returns the number of microseconds since
  epoch - ut_time_us().

* Add (innodb|innobase|srv)_replication_delay MySQL config parameter.

* Add UT_WAIT_FOR() macro that waits for a specified condition to occur
  until a timeout elapses.

* Using all of the above, handle the replication thread specially in
  srv_conc_enter_innodb().
2007-09-20 14:37:03 +00:00
vasil
8785af49a3 Implement this feature request:
http://bugs.mysql.com/30706

* Add a function that returns the number of microseconds since
  epoch - ut_time_us().

* Add (innodb|innobase|srv)_replication_delay MySQL config parameter.

* Add UT_WAIT_FOR() macro that waits for a specified condition to occur
  until a timeout elapses.

* Using all of the above, handle the replication thread specially in
  srv_conc_enter_innodb().

Approved by:	Heikki
2007-09-17 18:15:44 +00:00
marko
487677d01b Merge r1264 from branches/zip: Avoid memory fragmentation when
adding column definitions to tables.

dict_mem_table_add_col(): Add the parameter "heap" for temporary memory
allocation.  Allow it and "name" to be NULL.  These parameters are NULL
when creating dummy indexes.

dict_add_col_name(): Remove calls to ut_malloc() and ut_free().

dict_table_get_col_name(): Allow table->col_names to be NULL.

dict_table_add_system_columns(), dict_table_add_to_cache():
Add the parameter "heap".
---
Additional changes that had to be merged from branches/zip:

dict_table_add_system_columns(): New function, factored out from
dict_table_add_to_cache().

mlog_parse_index(): Add some consistency checks, and make use of
dict_table_add_system_columns().
2007-08-15 12:41:46 +00:00
vasil
00255d962b Fix Bug#20090 as suggested in the bug followup by Heikki.
Approved by:	Heikki
2007-06-04 14:00:44 +00:00
marko
a808cafee8 srv_lock_timeout_and_monitor_thread(): Correct the indentation that was
broken in r1521.
2007-05-29 08:41:59 +00:00
inaam
b1b1002a71 Forward port r1520 from branches/5.0
Patch to allow monitor threads to stop before proceeding with normal shutdown. 
Also have a separate time counter for tablespace monitor.

reviewed by: Heikki
2007-05-23 01:23:34 +00:00
vasil
02507a762a Fix typo in comment.
Spotted by:	Marko
2007-05-09 14:09:57 +00:00
vasil
05c9821a7c Fix Bug#25078 by always letting the replication thread on the slave
server to enter InnoDB. This can be made further customizable by the
user if we introduce a new config parameter. This will wait until
config parameters can be easily added.

Approved by:	Marko
2007-05-08 07:20:02 +00:00
vasil
f75a4b04a6 Fix typo in the comment. 2007-04-25 04:47:10 +00:00
sunny
5cdc5685d0 Fix code indentation from r1424. 2007-04-11 06:04:11 +00:00
sunny
f30895bdfc Bug# 20352. Added variable srv_insert_buffer_batch_size. We want to make
this variable settable. Since the pluggable engine interface currently
doesn't provide a usable mechanism, we will add the latter functionality
once it's available.
2007-04-11 04:12:40 +00:00
marko
86f93590f3 Merge a change from MySQL AB:
ChangeSet@1.2409.1.83  2007-03-06 10:36:15-07:00  tsmith@hindu.god
Bug #26598: Create variable to allow turning off of statistic gathering
on metadata commands

Add innodb_stats_on_metadata option, which enables gathering
index statistics when processing metadata commands such as
SHOW TABLE STATUS.  Default behavior of the server does not
change (this option is enabled by default).
2007-03-26 08:16:35 +00:00
sunny
7c5df80879 Fix for Bug# 23666. On Windows ut_usectime returns secs
and usecs relative to the UNIX epoch (which is Jan, 1 1970).
2007-01-24 23:05:06 +00:00
marko
4c643e0e1a Merge r1239 from
branches/zip: Make mutex_own() work with UNIV_DEBUG, without UNIV_SYNC_DEBUG.
2007-01-18 21:27:31 +00:00
osku
a2a7c6cab5 Revamp the line splits done in r763 and r764 that can now be done better,
thanks to r826.
2006-09-19 07:22:21 +00:00
marko
79644bdb8e dict_col_t: Copy the fields of "dtype_t type" directly to this structure,
so that all integer fields can be packed into 64 bits.  (Bug #20877)

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

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

dict_index_get_nth_type(): Replace with dict_index_get_nth_col().

dict_col_get_type(): Replace with dict_col_copy_type().

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

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

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

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

dtype_set_mblen(): Replaced with dtype_get_mblen().

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

cmp_types_are_equal(): Replace with cmp_cols_are_equal().

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

dtype_binary, dtype_binary_val: Remove.

dtype_is_fixed_size(): Remove.
2006-09-18 11:51:38 +00:00
osku
3729812895 Add dict_table_get_col_name() in preparation for getting rid of
dict_col_t::name, and use it instead of col->name everywhere.
2006-09-18 09:46:05 +00:00
marko
1c1026ec0d Reduce the size of the data dictionary cache. (Bug #20877)
dtype_t: Remove unused field "prec", which was supposed to be used for
the precision of decimal columns in stand-alone InnoDB.

dtype_get_prec(): Remove.

dtype_set(), dict_mem_table_add_col(): Remove parameter "prec".

dtype_t: Turn all fields (mtype, prtype, len, mbminlen, mbmaxlen, len)
into bit-fields.

dict_table_t, dict_index_t, dict_tree_t: Omit magic_n from non-debug builds.

dict_col_t: Turn ind, clust_pos, and ord_part into bit-fields.

Replace the default clust_pos value ULINT_UNDEFINED with
REC_MAX_N_FIELDS and replace all references to clust_pos with calls to
the accessor function dict_col_get_clust_pos().

dict_field_t: Turn prefix_len and fixed_len into bit-fields.

dict_tree_t: Remove pad[64].

dict_table_t: Turn the fields ibd_file_missing, tablespace_discarded,
cached, flags, stat_initialized, and autoinc_inited into bit-fields.
Remove does_not_fit_in_memory from non-debug builds.

dict_index_t: Turn the fields trx_id_offset, n_user_defined_cols,
n_uniq, n_def, n_fields, n_nullable, and cached into bit-fields.

dict_foreign_struct: Turn n_fields and type into bit-fields.

rw_lock_t: Turn cline, last_s_line, and last_x_line into bit-fields.
Omit level unless #defined UNIV_SYNC_DEBUG.

Move REC_MAX_N_FIELDS (and REC_MAX_HEAP_NO and REC_MAX_N_OWNED)
from rem0rec.c to rem0types.h, as they are needed in dict0dict.ic.
dict_col_get_clust_pos(): Map REC_MAX_N_FIELDS to ULINT_UNDEFINED.
2006-09-12 14:06:46 +00:00
osku
42f9837428 Add a warning comment above the place where we set srv_main_thread_op_info
to "waiting for server activity" that mentions that this string should not
be changed.
2006-08-31 11:01:15 +00:00
marko
27dffa4f7d Split lines before binary operators, not after them. 2006-08-29 08:27:56 +00:00
marko
917941e44c Split lines before an opening parenthesis, not after one.
Replace some printf(...) in debug builds with fprintf(stderr, ...).
2006-08-29 07:33:51 +00:00
marko
8f18616ef0 Reindent the code base (except for ha_innodb.{cc,h} and generated parser
and lexer files).  From now on, the following Emacs cc-mode settings apply
when indenting C function bodies in InnoDB:

(setq c-basic-offset 8)
(setq c-label-minimum-indentation 0)
(add-to-list 'c-offsets-alist '(c . 0))
(add-to-list 'c-offsets-alist '(label . [0]))

The indentation rules for function declarations still have not been
formalized, and they must be formatted manually.

Try to limit all lines to at most 79 characters (assuming TAB stops every
8 characters) by splitting lines before opening parenthesis, or at
string constants.

Fix some grammar mistakes in diagnostic output:
 match to, match with -> match
 found from -> found in
 trying rename -> trying to rename

Fix an error in page_check_dir(): it said "supremum not pointed to"
when the infimum was not pointed to.

Enclose commented-out code snippets in #if 0 ... #endif instead of /* ... */.
Add (void*) casts to some %p parameters in fprintf() calls.  Try to
split lines before a binary operator, not after one.  (These three fixes
were not made everywhere.)
2006-08-28 17:42:45 +00:00
marko
abe9dae496 srv_master_thread(): Add OS_THREAD_DUMMY_RETURN to get rid of a compiler
warning "no return value from a function returning non-void".
2006-08-17 08:51:42 +00:00
marko
b4270e7081 Merge a change from MySQL AB (originally implemented by Marko
in the 5.0 tree and now merged to the 5.1 tree):

# ChangeSet
#   2006/07/29 07:17:33+04:00 aivanov@mysql.com 
#   Make innodb_flush_log_at_trx_commit a settable global variable.
# 
# sql/ha_innodb.cc
#   2006/07/29 07:17:29+04:00 aivanov@mysql.com +1 -3
#   Remove innobase_flush_log_at_trx_commit
#   (set srv_flush_log_at_trx_commit directly).
# 
# sql/ha_innodb.h
#   2006/07/29 07:17:29+04:00 aivanov@mysql.com +1 -1
#   Remove innobase_flush_log_at_trx_commit.
#   Declare srv_flush_log_at_trx_commit.
# 
# storage/innobase/include/srv0srv.h
#   2006/07/29 07:17:30+04:00 aivanov@mysql.com +1 -1
#   Change the type of srv_flush_log_at_trx_commit.
# 
# storage/innobase/srv/srv0srv.c
#   2006/07/29 07:17:30+04:00 aivanov@mysql.com +1 -1
#   Change the type of srv_flush_log_at_trx_commit.
#
2006-08-11 08:05:40 +00:00
marko
85ccc78fe3 Adapt InnoDB to the new tablename to filename encoding in MySQL 5.1.
ut_print_name(), ut_print_namel(): Add parameter table_id for distinguishing
names of tables from other identifiers (names of indexes, columns and
constraints).

innobase_convert_from_table_id(), innobase_convert_from_id(),
innobase_convert_from_filename(), innobase_get_charset(): New functions.

dict_accept(), dict_scan_id(), dict_scan_col(), dict_scan_table_name(),
dict_skip_word(), dict_create_foreign_constraints_low():
Add parameter "cs", so that isspace() can be replaced with my_isspace(),
whose operation depends on the connection character set.

dict_scan_id(): Convert the identifier to UTF-8.

dict_str_starts_with_keyword(): New extern function, to replace dict_accept()
in row_search_for_mysql().

mysql_get_identifier_quote_char(): Replaced with innobase_print_identifier().

ha_innobase::create(): Remove the thd->convert_string() call.
Pass the statement to InnoDB in the connection character set
and let InnoDB convert the identifiers to UTF-8.
2006-05-24 10:27:17 +00:00
osku
47f0a5aa7a srv_master_thread(): Remove unreachable code. 2006-04-29 04:43:37 +00:00
osku
f970488ae0 Add 'level' parameter to mutex_create(), remove mutex_set_level().
Rename SYNC_LEVEL_NONE to SYNC_LEVEL_VARYING, add comment clarifying what it
is used for.
2006-04-28 05:43:08 +00:00
osku
ca150507fc Add platform-specific os_thread_ret_t and OS_THREAD_DUMMY_RETURN, and
convert thread start functions to use them.
2006-04-21 12:09:12 +00:00
osku
99585c9bae Remove srv_sys->operational since it is unused. 2006-04-21 07:04:02 +00:00
osku
5f00145409 Remove obsolete and unused global variables from srv0srv.c. 2006-04-20 11:06:41 +00:00
osku
6384ac2043 Print dictionary memory size in SHOW INNODB STATUS. 2006-04-11 13:56:12 +00:00
osku
1a8f28e6dd Remove "ibool comp" from dict_table_t and replace it with "ulint flags"
which can contain the new flag DICT_TF_COMPACT. Change dict_mem_table_create
to take a flags argument. Add dict_table_is_comp(). Adapt all users.

Change some places to explicitly assume that system tables do not use the
compact page format.
2006-02-27 09:11:57 +00:00
osku
ac69f8c21b Style cleanups: Convert spaces to tabs, remove trailing whitespace, other
misc cleanups.
2006-02-21 12:37:54 +00:00
marko
9596f6d82d Merge r102 from hotbackup/trunk.
Corrected some comments.

os_file_create_tmpfile(): Remove the implementation from InnoDB Hot Backup.

In InnoDB Hot Backup builds, do not define dict_casedn_str(),
which is invoked in fil_load_single_table_tablespace() on
Windows.  This function depends on innobase_casedn_str() and
my_casedn_str().

Define btr_check_node_ptr() and data_error only #ifdef UNIV_DEBUG.
They are only being used in ut_ad() assertions.

Replace the occurrences of the type uint with ulint, because InnoDB
Hot Backup does not define any uint data type.

Disable lock_validate() in InnoDB Hot Backup builds.

Disable some unused static variables of srv0srv.c in InnoDB Hot Backup builds.

Disable some srv_table_...() functions in InnoDB Hot Backup builds.

Disable some unused static variables in srv0start.c in
InnoDB Hot Backup builds.

Disable io_handler_thread() in InnoDB Hot Backup builds.

Disable srv_calc_low32() and srv_calc_high32() in InnoDB Hot Backup builds
to avoid warnings about unused functions.

In fil_node_open_file(), avoid bogus assertions in InnoDB Hot Backup builds.

In fil_load_single_table_tablespace(), remove the call to dict_casedn_str(),
as it depends on MySQL code.

Copy the code of recv_reset_log_files_for_backup() from InnoDB Hot Backup.

Disable innobase_mysql_cmp(), cmp_whole_field(), cmp_data_data_slow(),
cmp_dtuple_rec_with_match() and cmp_rec_rec_with_match()
in InnoDB Hot Backup builds, as they depend on MySQL code.

Adapt dtype_set_mblen() and dtype_get_fixed_size() for InnoDB Hot Backup
builds, assuming that they will only be called on system tables, which
do not contain multi-byte characters.

Disable the static functions row_ins_set_exclusive_rec_lock() and
row_ins_dupl_error_with_rec() in InnoDB Hot Backup builds
to avoid warnings about unused functions.

In row_sel_field_store_in_mysql_format(), disable some UTF-8 related
assertions #ifndef UNIV_RELEASE_NOT_YET_STABLE.
2006-02-21 08:43:31 +00:00
osku
460042ef0d Remove the concept of "field order", as we will not support descending order
indexes.
2006-02-20 12:38:10 +00:00
marko
fb345eefe5 Revert r148 until MySQL AB has finally merged the code to the 5.1 tree:
Port r146 from branches/5.0:

Make innodb_flush_log_at_trx_commit a settable global variable.
2006-02-13 11:57:38 +00:00
marko
6234dd648e Port r146 from branches/5.0:
Make innodb_flush_log_at_trx_commit a settable global variable.
2006-01-19 13:31:02 +00:00
marko
34f1d3e6d6 Port r145 from branches/5.0:
Make innodb_thread_concurrency 0 by default, and extend the useable
range from 0 to 1000 (0 disables the thread throttling).

Remove SRV_CONCURRENCY_THRESHOLD (20).  The magic value to
disable the thread throttling is 0 from now on.
2006-01-19 13:30:20 +00:00
osku
389c33b746 Port r87 from branches/5.0:
Work around Bug #12071: Do not call os_file_create_tmpfile() at runtime.
Instead, create all tempfiles at startup and guard access to them with
mutexes.
2005-12-08 14:27:09 +00:00
osku
2903c72469 Import 5.0 code. 2005-10-27 07:29:40 +00:00