2005-03-16 00:34:15 +02:00
|
|
|
/* Copyright (C) 2000-2005 MySQL AB && Innobase Oy
|
2000-12-06 01:54:17 +02:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
2001-02-17 14:19:19 +02:00
|
|
|
|
2000-12-06 01:54:17 +02:00
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
2001-02-17 14:19:19 +02:00
|
|
|
|
2000-12-06 01:54:17 +02:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
|
|
|
|
2002-01-12 15:42:54 +02:00
|
|
|
/*
|
|
|
|
This file is based on ha_berkeley.h of MySQL distribution
|
|
|
|
|
|
|
|
This file defines the Innodb handler: the interface between MySQL and
|
|
|
|
Innodb
|
|
|
|
*/
|
|
|
|
|
2005-05-04 15:05:56 +02:00
|
|
|
#ifdef USE_PRAGMA_INTERFACE
|
2000-12-06 01:54:17 +02:00
|
|
|
#pragma interface /* gcc class implementation */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef struct st_innobase_share {
|
|
|
|
THR_LOCK lock;
|
|
|
|
pthread_mutex_t mutex;
|
|
|
|
char *table_name;
|
|
|
|
uint table_name_length,use_count;
|
|
|
|
} INNOBASE_SHARE;
|
|
|
|
|
2003-10-07 17:28:59 +03:00
|
|
|
|
sql/ha_innodb.cc
enabled query cache for ndb
modified engine interface somewhat
sql/ha_innodb.h
enabled query cache for ndb
modified engine interface somewhat
sql/ha_ndbcluster.cc
enabled query cache for ndb
modified engine interface somewhat
ndb will only allow caching and retrieval if running autocommit
- return false, but do not invalidate
commit count is used as engine data, i.e.
- store commit count before store of cache
- allow retrieval if commit count has not changed on a table
- invalidate if commit count has changed
sql/ha_ndbcluster.h
enabled query cache for ndb
modified engine interface somewhat
sql/handler.cc
enabled query cache for ndb
modified engine interface somewhat
sql/handler.h
enabled query cache for ndb
modified engine interface somewhat
new virtual handler method cached_table_registration called on each table before alowing store in query cache
- return TRUE - ok to cache, FALSE - not allowed to cache, invalidate queries if engine_data below has changed
- sets ulonglong (engine_data) that is stored in query cache for each table
- sets callback to be called for each table before usage of cached query, callback = 0 -> no check later
sql/mysql_priv.h
enabled query cache for ndb
modified engine interface somewhat
callcack prototype for callback to engine before query cache retrieval
sql/sql_cache.cc
enabled query cache for ndb
modified engine interface somewhat
if callback is set on table in cache, do callback to check if allowed to use cache
if not allowed to use cache, check if engine_data has changed, if so, invalidate all queries with that table
+ changes to store and pass callback and engine_data around
sql/sql_cache.h
enabled query cache for ndb
modified engine interface somewhat
changes to store callback and engine_data
sql/table.h
enabled query cache for ndb
modified engine interface somewhat
changes to store callback and engine_data
sql/ha_innodb.cc:
enabled query cache for ndb
modified engine interface somewhat
sql/ha_innodb.h:
enabled query cache for ndb
modified engine interface somewhat
sql/ha_ndbcluster.cc:
enabled query cache for ndb
modified engine interface somewhat
ndb will only allow caching and retrieval if running autocommit
- return false, but do not invalidate
commit count is used as engine data, i.e.
- store commit count before store of cache
- allow retrieval if commit count has not changed on a table
- invalidate if commit count has changed
sql/ha_ndbcluster.h:
enabled query cache for ndb
modified engine interface somewhat
sql/handler.cc:
enabled query cache for ndb
modified engine interface somewhat
sql/handler.h:
enabled query cache for ndb
modified engine interface somewhat
new virtual handler method cached_table_registration called on each table before alowing store in query cache
- return TRUE - ok to cache, FALSE - not allowed to cache, invalidate queries if engine_data below has changed
- sets ulonglong (engine_data) that is stored in query cache for each table
- sets callback to be called for each table before usage of cached query, callback = 0 -> no check later
sql/mysql_priv.h:
enabled query cache for ndb
modified engine interface somewhat
callcack prototype for callback to engine before query cache retrieval
sql/sql_cache.cc:
enabled query cache for ndb
modified engine interface somewhat
if callback is set on table in cache, do callback to check if allowed to use cache
if not allowed to use cache, check if engine_data has changed, if so, invalidate all queries with that table
+ changes to store and pass callback and engine_data around
sql/sql_cache.h:
enabled query cache for ndb
modified engine interface somewhat
changes to store callback and engine_data
sql/table.h:
enabled query cache for ndb
modified engine interface somewhat
changes to store callback and engine_data
2004-11-24 11:56:51 +00:00
|
|
|
my_bool innobase_query_caching_of_table_permitted(THD* thd, char* full_name,
|
|
|
|
uint full_name_len,
|
|
|
|
ulonglong *unused);
|
|
|
|
|
2002-01-12 15:42:54 +02:00
|
|
|
/* The class defining a handle to an Innodb table */
|
2000-12-06 01:54:17 +02:00
|
|
|
class ha_innobase: public handler
|
|
|
|
{
|
2005-03-16 00:34:15 +02:00
|
|
|
void* innobase_prebuilt;/* (row_prebuilt_t*) prebuilt
|
|
|
|
struct in InnoDB, used to save
|
|
|
|
CPU time with prebuilt data
|
|
|
|
structures*/
|
2000-12-06 01:54:17 +02:00
|
|
|
THD* user_thd; /* the thread handle of the user
|
|
|
|
currently using the handle; this is
|
|
|
|
set in external_lock function */
|
2005-03-18 16:12:25 -08:00
|
|
|
query_id_t last_query_id; /* the latest query id where the
|
2001-04-10 21:58:07 +03:00
|
|
|
handle was used */
|
2000-12-06 01:54:17 +02:00
|
|
|
THR_LOCK_DATA lock;
|
|
|
|
INNOBASE_SHARE *share;
|
|
|
|
|
|
|
|
gptr alloc_ptr;
|
|
|
|
byte* upd_buff; /* buffer used in updates */
|
|
|
|
byte* key_val_buff; /* buffer used in converting
|
|
|
|
search key values from MySQL format
|
2002-01-12 15:42:54 +02:00
|
|
|
to Innodb format */
|
2003-06-15 01:04:28 +03:00
|
|
|
ulong upd_and_key_val_buff_len;
|
|
|
|
/* the length of each of the previous
|
|
|
|
two buffers */
|
2002-04-12 21:35:46 +03:00
|
|
|
ulong int_table_flags;
|
2000-12-06 01:54:17 +02:00
|
|
|
uint primary_key;
|
2001-02-21 14:16:00 +02:00
|
|
|
uint last_dup_key;
|
2001-02-17 14:19:19 +02:00
|
|
|
ulong start_of_scan; /* this is set to 1 when we are
|
|
|
|
starting a table scan but have not
|
|
|
|
yet fetched any row, else 0 */
|
2000-12-06 01:54:17 +02:00
|
|
|
uint last_match_mode;/* match mode of the latest search:
|
2001-02-17 14:19:19 +02:00
|
|
|
ROW_SEL_EXACT, ROW_SEL_EXACT_PREFIX,
|
|
|
|
or undefined */
|
2004-11-03 21:32:48 +02:00
|
|
|
uint num_write_row; /* number of write_row() calls */
|
2004-06-23 12:29:05 +02:00
|
|
|
ulong max_supported_row_length(const byte *buf);
|
2000-12-06 01:54:17 +02:00
|
|
|
|
2003-06-15 23:23:04 +03:00
|
|
|
uint store_key_val_for_row(uint keynr, char* buff, uint buff_len,
|
|
|
|
const byte* record);
|
2000-12-06 01:54:17 +02:00
|
|
|
int update_thd(THD* thd);
|
|
|
|
int change_active_index(uint keynr);
|
|
|
|
int general_fetch(byte* buf, uint direction, uint match_mode);
|
2002-07-31 00:47:20 +03:00
|
|
|
int innobase_read_and_init_auto_inc(longlong* ret);
|
2000-12-06 01:54:17 +02:00
|
|
|
|
|
|
|
/* Init values for the class: */
|
|
|
|
public:
|
Table definition cache, part 2
The table opening process now works the following way:
- Create common TABLE_SHARE object
- Read the .frm file and unpack it into the TABLE_SHARE object
- Create a TABLE object based on the information in the TABLE_SHARE
object and open a handler to the table object
Other noteworthy changes:
- In TABLE_SHARE the most common strings are now LEX_STRING's
- Better error message when table is not found
- Variable table_cache is now renamed 'table_open_cache'
- New variable 'table_definition_cache' that is the number of table defintions that will be cached
- strxnmov() calls are now fixed to avoid overflows
- strxnmov() will now always add one end \0 to result
- engine objects are now created with a TABLE_SHARE object instead of a TABLE object.
- After creating a field object one must call field->init(table) before using it
- For a busy system this change will give you:
- Less memory usage for table object
- Faster opening of tables (if it's has been in use or is in table definition cache)
- Allow you to cache many table definitions objects
- Faster drop of table
mysql-test/mysql-test-run.sh:
Fixed some problems with --gdb option
Test both with socket and tcp/ip port that all old servers are killed
mysql-test/r/flush_table.result:
More tests with lock table with 2 threads + flush table
mysql-test/r/information_schema.result:
Removed old (now wrong) result
mysql-test/r/innodb.result:
Better error messages (thanks to TDC patch)
mysql-test/r/merge.result:
Extra flush table test
mysql-test/r/ndb_bitfield.result:
Better error messages (thanks to TDC patch)
mysql-test/r/ndb_partition_error.result:
Better error messages (thanks to TDC patch)
mysql-test/r/query_cache.result:
Remove tables left from old tests
mysql-test/r/temp_table.result:
Test truncate with temporary tables
mysql-test/r/variables.result:
Table_cache -> Table_open_cache
mysql-test/t/flush_table.test:
More tests with lock table with 2 threads + flush table
mysql-test/t/merge.test:
Extra flush table test
mysql-test/t/multi_update.test:
Added 'sleep' to make test predictable
mysql-test/t/query_cache.test:
Remove tables left from old tests
mysql-test/t/temp_table.test:
Test truncate with temporary tables
mysql-test/t/variables.test:
Table_cache -> Table_open_cache
mysql-test/valgrind.supp:
Remove warning that may happens becasue threads dies in different order
mysys/hash.c:
Fixed wrong DBUG_PRINT
mysys/mf_dirname.c:
More DBUG
mysys/mf_pack.c:
Better comment
mysys/mf_tempdir.c:
More DBUG
Ensure that we call cleanup_dirname() on all temporary directory paths.
If we don't do this, we will get a failure when comparing temporary table
names as in some cases the temporary table name is run through convert_dirname())
mysys/my_alloc.c:
Indentation fix
sql/examples/ha_example.cc:
We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/examples/ha_example.h:
We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/examples/ha_tina.cc:
We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/examples/ha_tina.h:
We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/field.cc:
Update for table definition cache:
- Field creation now takes TABLE_SHARE instead of TABLE as argument
(This is becasue field definitions are now cached in TABLE_SHARE)
When a field is created, one now must call field->init(TABLE) before using it
- Use s->db instead of s->table_cache_key
- Added Field::clone() to create a field in TABLE from a field in TABLE_SHARE
- make_field() takes TABLE_SHARE as argument instead of TABLE
- move_field() -> move_field_offset()
sql/field.h:
Update for table definition cache:
- Field creation now takes TABLE_SHARE instead of TABLE as argument
(This is becasue field definitions are now cached in TABLE_SHARE)
When a field is created, one now must call field->init(TABLE) before using it
- Added Field::clone() to create a field in TABLE from a field in TABLE_SHARE
- make_field() takes TABLE_SHARE as argument instead of TABLE
- move_field() -> move_field_offset()
sql/ha_archive.cc:
We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/ha_archive.h:
We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/ha_berkeley.cc:
We new use TABLE_SHARE instead of TABLE when creating engine handlers
Changed name of argument create() to not hide internal 'table' variable.
table->s -> table_share
sql/ha_berkeley.h:
We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/ha_blackhole.cc:
We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/ha_blackhole.h:
We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/ha_federated.cc:
We new use TABLE_SHARE instead of TABLE when creating engine handlers
Fixed comments
Remove index variable and replace with pointers (simple optimization)
move_field() -> move_field_offset()
Removed some strlen() calls
sql/ha_federated.h:
We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/ha_heap.cc:
We new use TABLE_SHARE instead of TABLE when creating engine handlers
Simplify delete_table() and create() as the given file names are now without extension
sql/ha_heap.h:
We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/ha_innodb.cc:
We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/ha_innodb.h:
We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/ha_myisam.cc:
We new use TABLE_SHARE instead of TABLE when creating engine handlers
Remove not needed fn_format()
Fixed for new table->s structure
sql/ha_myisam.h:
We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/ha_myisammrg.cc:
We new use TABLE_SHARE instead of TABLE when creating engine handlers
Don't set 'is_view' for MERGE tables
Use new interface to find_temporary_table()
sql/ha_myisammrg.h:
We new use TABLE_SHARE instead of TABLE when creating engine handlers
Added flag HA_NO_COPY_ON_ALTER
sql/ha_ndbcluster.cc:
We new use TABLE_SHARE instead of TABLE when creating engine handlers
Fixed wrong calls to strxnmov()
Give error HA_ERR_TABLE_DEF_CHANGED if table definition has changed
drop_table -> intern_drop_table()
table->s -> table_share
Move part_info to TABLE
Fixed comments & DBUG print's
New arguments to print_error()
sql/ha_ndbcluster.h:
We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/ha_partition.cc:
We new use TABLE_SHARE instead of TABLE when creating engine handlers
We can't set up or use part_info when creating handler as there is not yet any table object
New ha_intialise() to work with TDC (Done by Mikael)
sql/ha_partition.h:
We new use TABLE_SHARE instead of TABLE when creating engine handlers
Got set_part_info() from Mikael
sql/handler.cc:
We new use TABLE_SHARE instead of TABLE when creating engine handlers
ha_delete_table() now also takes database as an argument
handler::ha_open() now takes TABLE as argument
ha_open() now calls ha_allocate_read_write_set()
Simplify ha_allocate_read_write_set()
Remove ha_deallocate_read_write_set()
Use table_share (Cached by table definition cache)
sql/handler.h:
New table flag: HA_NO_COPY_ON_ALTER (used by merge tables)
Remove ha_deallocate_read_write_set()
get_new_handler() now takes TABLE_SHARE as argument
ha_delete_table() now gets database as argument
sql/item.cc:
table_name and db are now LEX_STRING objects
When creating fields, we have now have to call field->init(table)
move_field -> move_field_offset()
sql/item.h:
tmp_table_field_from_field_type() now takes an extra paramenter 'fixed_length' to allow one to force usage of CHAR
instead of BLOB
sql/item_cmpfunc.cc:
Fixed call to tmp_table_field_from_field_type()
sql/item_create.cc:
Assert if new not handled cast type
sql/item_func.cc:
When creating fields, we have now have to call field->init(table)
dummy_table used by 'sp' now needs a TABLE_SHARE object
sql/item_subselect.cc:
Trivial code cleanups
sql/item_sum.cc:
When creating fields, we have now have to call field->init(table)
sql/item_timefunc.cc:
Item_func_str_to_date::tmp_table_field() now replaced by call to
tmp_table_field_from_field_type() (see item_timefunc.h)
sql/item_timefunc.h:
Simply tmp_table_field()
sql/item_uniq.cc:
When creating fields, we have now have to call field->init(table)
sql/key.cc:
Added 'KEY' argument to 'find_ref_key' to simplify code
sql/lock.cc:
More debugging
Use create_table_def_key() to create key for table cache
Allocate TABLE_SHARE properly when creating name lock
Fix that locked_table_name doesn't test same table twice
sql/mysql_priv.h:
New functions for table definition cache
New interfaces to a lot of functions.
New faster interface to find_temporary_table() and close_temporary_table()
sql/mysqld.cc:
Added support for table definition cache of size 'table_def_size'
Fixed som calls to strnmov()
Changed name of 'table_cache' to 'table_open_cache'
sql/opt_range.cc:
Use new interfaces
Fixed warnings from valgrind
sql/parse_file.cc:
Safer calls to strxnmov()
Fixed typo
sql/set_var.cc:
Added variable 'table_definition_cache'
Variable table_cache renamed to 'table_open_cache'
sql/slave.cc:
Use new interface
sql/sp.cc:
Proper use of TABLE_SHARE
sql/sp_head.cc:
Remove compiler warnings
We have now to call field->init(table)
sql/sp_head.h:
Pointers to parsed strings are now const
sql/sql_acl.cc:
table_name is now a LEX_STRING
sql/sql_base.cc:
Main implementation of table definition cache
(The #ifdef's are there for the future when table definition cache will replace open table cache)
Now table definitions are cached indepndent of open tables, which will speed up things when a table is in use at once from several places
Views are not yet cached; For the moment we only cache if a table is a view or not.
Faster implementation of find_temorary_table()
Replace 'wait_for_refresh()' with the more general function 'wait_for_condition()'
Drop table is slightly faster as we can use the table definition cache to know the type of the table
sql/sql_cache.cc:
table_cache_key and table_name are now LEX_STRING
'sDBUG print fixes
sql/sql_class.cc:
table_cache_key is now a LEX_STRING
safer strxnmov()
sql/sql_class.h:
Added number of open table shares (table definitions)
sql/sql_db.cc:
safer strxnmov()
sql/sql_delete.cc:
Use new interface to find_temporary_table()
sql/sql_derived.cc:
table_name is now a LEX_STRING
sql/sql_handler.cc:
TABLE_SHARE->db and TABLE_SHARE->table_name are now LEX_STRING's
sql/sql_insert.cc:
TABLE_SHARE->db and TABLE_SHARE->table_name are now LEX_STRING's
sql/sql_lex.cc:
Make parsed string a const (to quickly find out if anything is trying to change the query string)
sql/sql_lex.h:
Make parsed string a const (to quickly find out if anything is trying to change the query string)
sql/sql_load.cc:
Safer strxnmov()
sql/sql_parse.cc:
Better error if wrong DB name
sql/sql_partition.cc:
part_info moved to TABLE from TABLE_SHARE
Indentation changes
sql/sql_select.cc:
Indentation fixes
Call field->init(TABLE) for new created fields
Update create_tmp_table() to use TABLE_SHARE properly
sql/sql_select.h:
Call field->init(TABLE) for new created fields
sql/sql_show.cc:
table_name is now a LEX_STRING
part_info moved to TABLE
sql/sql_table.cc:
Use table definition cache to speed up delete of tables
Fixed calls to functions with new interfaces
Don't use 'share_not_to_be_used'
Instead of doing openfrm() when doing repair, we now have to call
get_table_share() followed by open_table_from_share().
Replace some fn_format() with faster unpack_filename().
Safer strxnmov()
part_info is now in TABLE
Added Mikaels patch for partition and ALTER TABLE
Instead of using 'TABLE_SHARE->is_view' use 'table_flags() & HA_NO_COPY_ON_ALTER
sql/sql_test.cc:
table_name and table_cache_key are now LEX_STRING's
sql/sql_trigger.cc:
TABLE_SHARE->db and TABLE_SHARE->table_name are now LEX_STRING's
safer strxnmov()
Removed compiler warnings
sql/sql_update.cc:
Call field->init(TABLE) after field is created
sql/sql_view.cc:
safer strxnmov()
Create common TABLE_SHARE object for views to allow us to cache if table is a view
sql/structs.h:
Added SHOW_TABLE_DEFINITIONS
sql/table.cc:
Creation and destruct of TABLE_SHARE objects that are common for many TABLE objects
The table opening process now works the following way:
- Create common TABLE_SHARE object
- Read the .frm file and unpack it into the TABLE_SHARE object
- Create a TABLE object based on the information in the TABLE_SHARE
object and open a handler to the table object
open_table_def() is written in such a way that it should be trival to add parsing of the .frm files in new formats
sql/table.h:
TABLE objects for the same database table now share a common TABLE_SHARE object
In TABLE_SHARE the most common strings are now LEX_STRING's
sql/unireg.cc:
Changed arguments to rea_create_table() to have same order as other functions
Call field->init(table) for new created fields
sql/unireg.h:
Added OPEN_VIEW
strings/strxnmov.c:
Change strxnmov() to always add end \0
This makes usage of strxnmov() safer as most of MySQL code assumes that strxnmov() will create a null terminated string
2005-11-23 22:45:02 +02:00
|
|
|
ha_innobase(TABLE_SHARE *table_arg);
|
2000-12-06 01:54:17 +02:00
|
|
|
~ha_innobase() {}
|
2005-02-08 13:35:10 +02:00
|
|
|
/*
|
|
|
|
Get the row type from the storage engine. If this method returns
|
|
|
|
ROW_TYPE_NOT_USED, the information in HA_CREATE_INFO should be used.
|
|
|
|
*/
|
|
|
|
enum row_type get_row_type() const;
|
2000-12-06 01:54:17 +02:00
|
|
|
|
2001-05-09 23:02:36 +03:00
|
|
|
const char* table_type() const { return("InnoDB");}
|
2002-01-02 21:29:41 +02:00
|
|
|
const char *index_type(uint key_number) { return "BTREE"; }
|
2000-12-06 01:54:17 +02:00
|
|
|
const char** bas_ext() const;
|
2002-04-12 21:35:46 +03:00
|
|
|
ulong table_flags() const { return int_table_flags; }
|
2004-07-08 15:45:25 +03:00
|
|
|
ulong index_flags(uint idx, uint part, bool all_parts) const
|
2002-04-12 21:35:46 +03:00
|
|
|
{
|
2005-03-16 00:34:15 +02:00
|
|
|
return (HA_READ_NEXT |
|
|
|
|
HA_READ_PREV |
|
|
|
|
HA_READ_ORDER |
|
|
|
|
HA_READ_RANGE |
|
2004-06-23 12:29:05 +02:00
|
|
|
HA_KEYREAD_ONLY);
|
2002-04-12 21:35:46 +03:00
|
|
|
}
|
2004-06-23 12:29:05 +02:00
|
|
|
uint max_supported_keys() const { return MAX_KEY; }
|
2001-12-22 11:18:22 +02:00
|
|
|
/* An InnoDB page must store >= 2 keys;
|
|
|
|
a secondary key record must also contain the
|
|
|
|
primary key value:
|
|
|
|
max key length is therefore set to slightly
|
2001-12-23 13:06:48 +02:00
|
|
|
less than 1 / 4 of page size which is 16 kB;
|
|
|
|
but currently MySQL does not work with keys
|
|
|
|
whose size is > MAX_KEY_LENGTH */
|
2004-06-23 12:29:05 +02:00
|
|
|
uint max_supported_key_length() const { return 3500; }
|
2005-12-13 16:49:24 +03:00
|
|
|
uint max_supported_key_part_length() const;
|
2003-10-24 22:44:48 +02:00
|
|
|
const key_map *keys_to_use_for_scanning() { return &key_map_full; }
|
2000-12-06 01:54:17 +02:00
|
|
|
bool has_transactions() { return 1;}
|
|
|
|
|
2001-01-12 13:53:06 +02:00
|
|
|
int open(const char *name, int mode, uint test_if_locked);
|
2000-12-06 01:54:17 +02:00
|
|
|
int close(void);
|
|
|
|
double scan_time();
|
2003-04-23 21:52:16 +03:00
|
|
|
double read_time(uint index, uint ranges, ha_rows rows);
|
2000-12-06 01:54:17 +02:00
|
|
|
|
|
|
|
int write_row(byte * buf);
|
|
|
|
int update_row(const byte * old_data, byte * new_data);
|
|
|
|
int delete_row(const byte * buf);
|
2005-12-22 06:39:02 +01:00
|
|
|
bool was_semi_consistent_read();
|
|
|
|
void try_semi_consistent_read(bool yes);
|
2004-11-08 14:52:15 +02:00
|
|
|
void unlock_row();
|
2000-12-06 01:54:17 +02:00
|
|
|
|
2005-07-18 13:31:02 +02:00
|
|
|
int index_init(uint index, bool sorted);
|
2000-12-06 01:54:17 +02:00
|
|
|
int index_end();
|
|
|
|
int index_read(byte * buf, const byte * key,
|
2002-01-12 15:42:54 +02:00
|
|
|
uint key_len, enum ha_rkey_function find_flag);
|
2000-12-06 01:54:17 +02:00
|
|
|
int index_read_idx(byte * buf, uint index, const byte * key,
|
2002-01-12 15:42:54 +02:00
|
|
|
uint key_len, enum ha_rkey_function find_flag);
|
|
|
|
int index_read_last(byte * buf, const byte * key, uint key_len);
|
2000-12-06 01:54:17 +02:00
|
|
|
int index_next(byte * buf);
|
|
|
|
int index_next_same(byte * buf, const byte *key, uint keylen);
|
|
|
|
int index_prev(byte * buf);
|
|
|
|
int index_first(byte * buf);
|
|
|
|
int index_last(byte * buf);
|
|
|
|
|
2004-06-25 18:49:36 +03:00
|
|
|
int rnd_init(bool scan);
|
2000-12-06 01:54:17 +02:00
|
|
|
int rnd_end();
|
|
|
|
int rnd_next(byte *buf);
|
|
|
|
int rnd_pos(byte * buf, byte *pos);
|
|
|
|
|
|
|
|
void position(const byte *record);
|
|
|
|
void info(uint);
|
2003-04-24 15:34:43 +03:00
|
|
|
int analyze(THD* thd,HA_CHECK_OPT* check_opt);
|
2003-06-23 13:03:04 +03:00
|
|
|
int optimize(THD* thd,HA_CHECK_OPT* check_opt);
|
2003-10-13 11:20:19 +03:00
|
|
|
int discard_or_import_tablespace(my_bool discard);
|
2000-12-06 01:54:17 +02:00
|
|
|
int extra(enum ha_extra_function operation);
|
|
|
|
int external_lock(THD *thd, int lock_type);
|
2004-12-09 11:10:45 +02:00
|
|
|
int transactional_table_lock(THD *thd, int lock_type);
|
2005-09-30 20:20:10 +02:00
|
|
|
int start_stmt(THD *thd, thr_lock_type lock_type);
|
2002-09-20 23:26:21 +03:00
|
|
|
|
2005-05-02 15:45:33 +02:00
|
|
|
int ha_retrieve_all_cols()
|
|
|
|
{
|
|
|
|
ha_set_all_bits_in_read_set();
|
|
|
|
return extra(HA_EXTRA_RETRIEVE_ALL_COLS);
|
|
|
|
}
|
|
|
|
int ha_retrieve_all_pk()
|
|
|
|
{
|
|
|
|
ha_set_primary_key_in_read_set();
|
|
|
|
return extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY);
|
|
|
|
}
|
2000-12-06 01:54:17 +02:00
|
|
|
void position(byte *record);
|
2005-03-16 00:34:15 +02:00
|
|
|
ha_rows records_in_range(uint inx, key_range *min_key, key_range
|
|
|
|
*max_key);
|
2004-09-13 06:14:25 +04:00
|
|
|
ha_rows estimate_rows_upper_bound();
|
2000-12-06 01:54:17 +02:00
|
|
|
|
|
|
|
int create(const char *name, register TABLE *form,
|
|
|
|
HA_CREATE_INFO *create_info);
|
2005-01-11 16:28:07 +02:00
|
|
|
int delete_all_rows();
|
2000-12-06 01:54:17 +02:00
|
|
|
int delete_table(const char *name);
|
|
|
|
int rename_table(const char* from, const char* to);
|
manual.texi website address change
row0sel.c CHECK TABLE now also for InnoDB, a join speed optimization
trx0trx.c CHECK TABLE now also for InnoDB, a join speed optimization
rem0cmp.c CHECK TABLE now also for InnoDB, a join speed optimization
row0mysql.c CHECK TABLE now also for InnoDB, a join speed optimization
page0page.c CHECK TABLE now also for InnoDB, a join speed optimization
row0mysql.h CHECK TABLE now also for InnoDB, a join speed optimization
trx0trx.h CHECK TABLE now also for InnoDB, a join speed optimization
btr0btr.h CHECK TABLE now also for InnoDB, a join speed optimization
btr0cur.h CHECK TABLE now also for InnoDB, a join speed optimization
btr0pcur.h CHECK TABLE now also for InnoDB, a join speed optimization
btr0pcur.ic CHECK TABLE now also for InnoDB, a join speed optimization
btr0btr.c CHECK TABLE now also for InnoDB, a join speed optimization
btr0cur.c CHECK TABLE now also for InnoDB, a join speed optimization
btr0sea.c CHECK TABLE now also for InnoDB, a join speed optimization
innodb.result CHECK TABLE now also for InnoDB, a join speed optimization
ha_innobase.cc CHECK TABLE now also for InnoDB, a join speed optimization
ha_innobase.h CHECK TABLE now also for InnoDB, a join speed optimization
sql/ha_innobase.cc:
CHECK TABLE now also for InnoDB, a join speed optimization
sql/ha_innobase.h:
CHECK TABLE now also for InnoDB, a join speed optimization
mysql-test/r/innodb.result:
CHECK TABLE now also for InnoDB, a join speed optimization
innobase/btr/btr0btr.c:
CHECK TABLE now also for InnoDB, a join speed optimization
innobase/btr/btr0cur.c:
CHECK TABLE now also for InnoDB, a join speed optimization
innobase/btr/btr0sea.c:
CHECK TABLE now also for InnoDB, a join speed optimization
innobase/include/btr0btr.h:
CHECK TABLE now also for InnoDB, a join speed optimization
innobase/include/btr0cur.h:
CHECK TABLE now also for InnoDB, a join speed optimization
innobase/include/btr0pcur.h:
CHECK TABLE now also for InnoDB, a join speed optimization
innobase/include/btr0pcur.ic:
CHECK TABLE now also for InnoDB, a join speed optimization
innobase/include/row0mysql.h:
CHECK TABLE now also for InnoDB, a join speed optimization
innobase/include/trx0trx.h:
CHECK TABLE now also for InnoDB, a join speed optimization
innobase/page/page0page.c:
CHECK TABLE now also for InnoDB, a join speed optimization
innobase/rem/rem0cmp.c:
CHECK TABLE now also for InnoDB, a join speed optimization
innobase/row/row0mysql.c:
CHECK TABLE now also for InnoDB, a join speed optimization
innobase/row/row0sel.c:
CHECK TABLE now also for InnoDB, a join speed optimization
innobase/trx/trx0trx.c:
CHECK TABLE now also for InnoDB, a join speed optimization
Docs/manual.texi:
website address change
2001-06-03 22:58:03 +03:00
|
|
|
int check(THD* thd, HA_CHECK_OPT* check_opt);
|
2001-02-17 14:19:19 +02:00
|
|
|
char* update_table_comment(const char* comment);
|
2002-03-21 18:03:09 +02:00
|
|
|
char* get_foreign_key_create_info();
|
2004-11-13 13:56:39 +03:00
|
|
|
int get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list);
|
2005-04-07 12:16:41 +03:00
|
|
|
bool can_switch_engines();
|
2004-02-09 23:57:29 +02:00
|
|
|
uint referenced_by_foreign_key();
|
2002-03-21 18:03:09 +02:00
|
|
|
void free_foreign_key_create_info(char* str);
|
2000-12-06 01:54:17 +02:00
|
|
|
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
|
|
|
|
enum thr_lock_type lock_type);
|
2002-08-21 20:55:34 +00:00
|
|
|
void init_table_handle_for_HANDLER();
|
2004-09-15 22:10:31 +03:00
|
|
|
ulonglong get_auto_increment();
|
2005-08-30 12:39:20 +03:00
|
|
|
int reset_auto_increment(ulonglong value);
|
2005-09-23 16:22:27 +03:00
|
|
|
|
|
|
|
virtual bool get_error_message(int error, String *buf);
|
2005-08-17 11:00:20 +03:00
|
|
|
|
2003-10-07 17:28:59 +03:00
|
|
|
uint8 table_cache_type() { return HA_CACHE_TBL_ASKTRANSACT; }
|
sql/ha_innodb.cc
enabled query cache for ndb
modified engine interface somewhat
sql/ha_innodb.h
enabled query cache for ndb
modified engine interface somewhat
sql/ha_ndbcluster.cc
enabled query cache for ndb
modified engine interface somewhat
ndb will only allow caching and retrieval if running autocommit
- return false, but do not invalidate
commit count is used as engine data, i.e.
- store commit count before store of cache
- allow retrieval if commit count has not changed on a table
- invalidate if commit count has changed
sql/ha_ndbcluster.h
enabled query cache for ndb
modified engine interface somewhat
sql/handler.cc
enabled query cache for ndb
modified engine interface somewhat
sql/handler.h
enabled query cache for ndb
modified engine interface somewhat
new virtual handler method cached_table_registration called on each table before alowing store in query cache
- return TRUE - ok to cache, FALSE - not allowed to cache, invalidate queries if engine_data below has changed
- sets ulonglong (engine_data) that is stored in query cache for each table
- sets callback to be called for each table before usage of cached query, callback = 0 -> no check later
sql/mysql_priv.h
enabled query cache for ndb
modified engine interface somewhat
callcack prototype for callback to engine before query cache retrieval
sql/sql_cache.cc
enabled query cache for ndb
modified engine interface somewhat
if callback is set on table in cache, do callback to check if allowed to use cache
if not allowed to use cache, check if engine_data has changed, if so, invalidate all queries with that table
+ changes to store and pass callback and engine_data around
sql/sql_cache.h
enabled query cache for ndb
modified engine interface somewhat
changes to store callback and engine_data
sql/table.h
enabled query cache for ndb
modified engine interface somewhat
changes to store callback and engine_data
sql/ha_innodb.cc:
enabled query cache for ndb
modified engine interface somewhat
sql/ha_innodb.h:
enabled query cache for ndb
modified engine interface somewhat
sql/ha_ndbcluster.cc:
enabled query cache for ndb
modified engine interface somewhat
ndb will only allow caching and retrieval if running autocommit
- return false, but do not invalidate
commit count is used as engine data, i.e.
- store commit count before store of cache
- allow retrieval if commit count has not changed on a table
- invalidate if commit count has changed
sql/ha_ndbcluster.h:
enabled query cache for ndb
modified engine interface somewhat
sql/handler.cc:
enabled query cache for ndb
modified engine interface somewhat
sql/handler.h:
enabled query cache for ndb
modified engine interface somewhat
new virtual handler method cached_table_registration called on each table before alowing store in query cache
- return TRUE - ok to cache, FALSE - not allowed to cache, invalidate queries if engine_data below has changed
- sets ulonglong (engine_data) that is stored in query cache for each table
- sets callback to be called for each table before usage of cached query, callback = 0 -> no check later
sql/mysql_priv.h:
enabled query cache for ndb
modified engine interface somewhat
callcack prototype for callback to engine before query cache retrieval
sql/sql_cache.cc:
enabled query cache for ndb
modified engine interface somewhat
if callback is set on table in cache, do callback to check if allowed to use cache
if not allowed to use cache, check if engine_data has changed, if so, invalidate all queries with that table
+ changes to store and pass callback and engine_data around
sql/sql_cache.h:
enabled query cache for ndb
modified engine interface somewhat
changes to store callback and engine_data
sql/table.h:
enabled query cache for ndb
modified engine interface somewhat
changes to store callback and engine_data
2004-11-24 11:56:51 +00:00
|
|
|
/*
|
|
|
|
ask handler about permission to cache table during query registration
|
|
|
|
*/
|
2005-02-04 10:56:53 +01:00
|
|
|
my_bool register_query_cache_table(THD *thd, char *table_key,
|
|
|
|
uint key_length,
|
|
|
|
qc_engine_callback *call_back,
|
|
|
|
ulonglong *engine_data)
|
sql/ha_innodb.cc
enabled query cache for ndb
modified engine interface somewhat
sql/ha_innodb.h
enabled query cache for ndb
modified engine interface somewhat
sql/ha_ndbcluster.cc
enabled query cache for ndb
modified engine interface somewhat
ndb will only allow caching and retrieval if running autocommit
- return false, but do not invalidate
commit count is used as engine data, i.e.
- store commit count before store of cache
- allow retrieval if commit count has not changed on a table
- invalidate if commit count has changed
sql/ha_ndbcluster.h
enabled query cache for ndb
modified engine interface somewhat
sql/handler.cc
enabled query cache for ndb
modified engine interface somewhat
sql/handler.h
enabled query cache for ndb
modified engine interface somewhat
new virtual handler method cached_table_registration called on each table before alowing store in query cache
- return TRUE - ok to cache, FALSE - not allowed to cache, invalidate queries if engine_data below has changed
- sets ulonglong (engine_data) that is stored in query cache for each table
- sets callback to be called for each table before usage of cached query, callback = 0 -> no check later
sql/mysql_priv.h
enabled query cache for ndb
modified engine interface somewhat
callcack prototype for callback to engine before query cache retrieval
sql/sql_cache.cc
enabled query cache for ndb
modified engine interface somewhat
if callback is set on table in cache, do callback to check if allowed to use cache
if not allowed to use cache, check if engine_data has changed, if so, invalidate all queries with that table
+ changes to store and pass callback and engine_data around
sql/sql_cache.h
enabled query cache for ndb
modified engine interface somewhat
changes to store callback and engine_data
sql/table.h
enabled query cache for ndb
modified engine interface somewhat
changes to store callback and engine_data
sql/ha_innodb.cc:
enabled query cache for ndb
modified engine interface somewhat
sql/ha_innodb.h:
enabled query cache for ndb
modified engine interface somewhat
sql/ha_ndbcluster.cc:
enabled query cache for ndb
modified engine interface somewhat
ndb will only allow caching and retrieval if running autocommit
- return false, but do not invalidate
commit count is used as engine data, i.e.
- store commit count before store of cache
- allow retrieval if commit count has not changed on a table
- invalidate if commit count has changed
sql/ha_ndbcluster.h:
enabled query cache for ndb
modified engine interface somewhat
sql/handler.cc:
enabled query cache for ndb
modified engine interface somewhat
sql/handler.h:
enabled query cache for ndb
modified engine interface somewhat
new virtual handler method cached_table_registration called on each table before alowing store in query cache
- return TRUE - ok to cache, FALSE - not allowed to cache, invalidate queries if engine_data below has changed
- sets ulonglong (engine_data) that is stored in query cache for each table
- sets callback to be called for each table before usage of cached query, callback = 0 -> no check later
sql/mysql_priv.h:
enabled query cache for ndb
modified engine interface somewhat
callcack prototype for callback to engine before query cache retrieval
sql/sql_cache.cc:
enabled query cache for ndb
modified engine interface somewhat
if callback is set on table in cache, do callback to check if allowed to use cache
if not allowed to use cache, check if engine_data has changed, if so, invalidate all queries with that table
+ changes to store and pass callback and engine_data around
sql/sql_cache.h:
enabled query cache for ndb
modified engine interface somewhat
changes to store callback and engine_data
sql/table.h:
enabled query cache for ndb
modified engine interface somewhat
changes to store callback and engine_data
2004-11-24 11:56:51 +00:00
|
|
|
{
|
|
|
|
*call_back= innobase_query_caching_of_table_permitted;
|
|
|
|
*engine_data= 0;
|
|
|
|
return innobase_query_caching_of_table_permitted(thd, table_key,
|
|
|
|
key_length,
|
|
|
|
engine_data);
|
|
|
|
}
|
2004-07-07 11:29:39 +03:00
|
|
|
static char *get_mysql_bin_log_name();
|
Robustness feature.
Won't be pushed as is - separate email sent for internal review.
WL#1717 "binlog-innodb consistency".
Now when mysqld starts, if InnoDB does a crash recovery, we use the binlog name
and position retrieved from InnoDB (corresponding to the last transaction
successfully committed by InnoDB) to cut any rolled back transaction from
the binary log. This is triggered by the --innodb-safe-binlog option.
Provided you configure mysqld to fsync() InnoDB at every commit (using
flush_log_at_trx_commit) and to fsync() the binlog at every write
(using --sync-binlog=1), this behaviour guarantees that a master always has
consistency between binlog and InnoDB, whenever the crash happens.
6 tests to verify that it works.
client/mysqltest.c:
New command require_os (only "unix" accepted for now).
innobase/include/trx0sys.h:
when InnoDB does crash recovery, we now save the binlog coords it prints, into variables for later use.
innobase/trx/trx0sys.c:
when InnoDB does crash recovery, we now save the binlog coords it prints, into variables for later use.
mysql-test/mysql-test-run.sh:
The tests which check that the binlog is cut at restart, need to not delete those binlogs, of course.
And not delete replication info, so that we can test that the slave does not receive anything
wrong from the cut binlog.
sql/ha_innodb.cc:
methods to read from InnoDB the binlog coords stored into it
sql/ha_innodb.h:
ethods to read from InnoDB the binlog coords stored into it
sql/log.cc:
Added my_sync() when we create a binlog (my_sync of the binlog and of the index file);
this is always done, whether --sync-binlog or not (binlog creation is rare, so no speed
problem, and I like to have the existence of the binlog always reliably recorded, even if
later content is not).
If --crash-binlog-innodb, crash between the binlog write and the InnoDB commit.
New methods:
- report_pos_in_innodb() to store the binlog name and position into InnoDB (used only when
we create a new binlog: at startup and at FLUSH LOGS)
- cut_spurious_tail() to possibly cut the tail of a binlog based on the info we read
from InnoDB (does something only if InnoDB has just done a crash recovery).
sql/mysql_priv.h:
new option, to crash (use for testing only)
sql/mysqld.cc:
New option --innodb-safe-binlog and --crash-binlog-innodb (the latter is for testing, it makes mysqld crash).
Just after opening the logs and opening the storage engines, cut any wrong statement from the binlog, based
on info read from InnoDB.
sql/sql_class.h:
new methods for MYSQL_LOG.
2004-06-20 19:11:02 +02:00
|
|
|
static ulonglong get_mysql_bin_log_pos();
|
2003-12-18 06:08:00 +03:00
|
|
|
bool primary_key_is_clustered() { return true; }
|
2004-05-13 01:38:40 +04:00
|
|
|
int cmp_ref(const byte *ref1, const byte *ref2);
|
2005-08-18 12:24:52 +02:00
|
|
|
bool check_if_incompatible_data(HA_CREATE_INFO *info,
|
|
|
|
uint table_changes);
|
2000-12-06 01:54:17 +02:00
|
|
|
};
|
|
|
|
|
2006-01-07 14:41:57 +01:00
|
|
|
extern SHOW_VAR innodb_status_variables[];
|
2000-12-06 01:54:17 +02:00
|
|
|
extern uint innobase_init_flags, innobase_lock_type;
|
2002-09-11 06:40:08 +03:00
|
|
|
extern uint innobase_flush_log_at_trx_commit;
|
2005-04-15 18:00:38 +02:00
|
|
|
extern ulong innobase_cache_size, innobase_fast_shutdown;
|
2004-12-14 22:26:31 +03:00
|
|
|
extern ulong innobase_large_page_size;
|
2000-12-06 01:54:17 +02:00
|
|
|
extern char *innobase_home, *innobase_tmpdir, *innobase_logdir;
|
|
|
|
extern long innobase_lock_scan_time;
|
2001-01-12 13:53:06 +02:00
|
|
|
extern long innobase_mirrored_log_groups, innobase_log_files_in_group;
|
2005-11-17 15:08:49 +01:00
|
|
|
extern longlong innobase_buffer_pool_size, innobase_log_file_size;
|
|
|
|
extern long innobase_log_buffer_size;
|
|
|
|
extern long innobase_additional_mem_pool_size;
|
2003-10-07 17:28:59 +03:00
|
|
|
extern long innobase_buffer_pool_awe_mem_mb;
|
2001-02-17 14:19:19 +02:00
|
|
|
extern long innobase_file_io_threads, innobase_lock_wait_timeout;
|
2005-05-03 15:55:53 +03:00
|
|
|
extern long innobase_force_recovery;
|
2003-10-07 17:28:59 +03:00
|
|
|
extern long innobase_open_files;
|
2000-12-06 01:54:17 +02:00
|
|
|
extern char *innobase_data_home_dir, *innobase_data_file_path;
|
|
|
|
extern char *innobase_log_group_home_dir, *innobase_log_arch_dir;
|
2001-05-23 18:04:49 +03:00
|
|
|
extern char *innobase_unix_file_flush_method;
|
2002-02-07 21:34:35 +02:00
|
|
|
/* The following variables have to be my_bool for SHOW VARIABLES to work */
|
2002-09-11 06:40:08 +03:00
|
|
|
extern my_bool innobase_log_archive,
|
2004-12-14 22:26:31 +03:00
|
|
|
innobase_use_doublewrite,
|
|
|
|
innobase_use_checksums,
|
|
|
|
innobase_use_large_pages,
|
2005-04-15 18:00:38 +02:00
|
|
|
innobase_use_native_aio,
|
2004-08-18 19:57:55 +02:00
|
|
|
innobase_file_per_table, innobase_locks_unsafe_for_binlog,
|
2004-08-06 15:55:50 +03:00
|
|
|
innobase_create_status_file;
|
2004-10-13 20:04:52 +03:00
|
|
|
extern my_bool innobase_very_fast_shutdown; /* set this to 1 just before
|
|
|
|
calling innobase_end() if you want
|
|
|
|
InnoDB to shut down without
|
|
|
|
flushing the buffer pool: this
|
|
|
|
is equivalent to a 'crash' */
|
2003-05-16 16:27:50 +03:00
|
|
|
extern "C" {
|
|
|
|
extern ulong srv_max_buf_pool_modified_pct;
|
2004-10-27 13:33:11 +03:00
|
|
|
extern ulong srv_max_purge_lag;
|
2004-09-30 12:31:41 +03:00
|
|
|
extern ulong srv_auto_extend_increment;
|
2005-01-05 12:43:48 +01:00
|
|
|
extern ulong srv_n_spin_wait_rounds;
|
2005-01-08 15:01:37 +01:00
|
|
|
extern ulong srv_n_free_tickets_to_enter;
|
|
|
|
extern ulong srv_thread_sleep_delay;
|
|
|
|
extern ulong srv_thread_concurrency;
|
2005-08-11 18:03:01 +02:00
|
|
|
extern ulong srv_commit_concurrency;
|
2003-05-16 16:27:50 +03:00
|
|
|
}
|
2000-12-06 01:54:17 +02:00
|
|
|
|
|
|
|
extern TYPELIB innobase_lock_typelib;
|
|
|
|
|
2005-10-02 19:44:28 -07:00
|
|
|
bool innobase_init(void);
|
2005-11-07 16:25:06 +01:00
|
|
|
int innobase_end(ha_panic_function type);
|
2000-12-06 01:54:17 +02:00
|
|
|
bool innobase_flush_logs(void);
|
2001-02-17 14:19:19 +02:00
|
|
|
uint innobase_get_free_space(void);
|
2000-12-06 01:54:17 +02:00
|
|
|
|
XA (not completely polished out yet)
include/my_pthread.h:
cleanup. don't use gcc extensions
innobase/include/trx0sys.ic:
Jan's fix for innobase_xa_prepare
innobase/read/read0read.c:
Jan's fix for innobase_xa_prepare
innobase/trx/trx0trx.c:
Jan's fix for innobase_xa_prepare
mysql-test/include/varchar.inc:
test fix
mysql-test/r/ctype_ucs.result:
new log event - all binlog positions are changed :(
mysql-test/r/drop_temp_table.result:
new log event - all binlog positions are changed :(
mysql-test/r/insert_select.result:
new log event - all binlog positions are changed :(
mysql-test/r/mix_innodb_myisam_binlog.result:
new log event - all binlog positions are changed :(
mysql-test/r/myisam.result:
test fix
mysql-test/r/rpl000015.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_change_master.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_charset.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_error_ignored_table.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_flush_log_loop.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_flush_tables.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_loaddata.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_loaddata_rule_m.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_loaddata_rule_s.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_log.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_log_pos.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_max_relay_size.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_relayrotate.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_replicate_do.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_reset_slave.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_rotate_logs.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_server_id1.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_server_id2.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_temporary.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_timezone.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_until.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_user_variables.result:
new log event - all binlog positions are changed :(
mysql-test/r/user_var.result:
new log event - all binlog positions are changed :(
mysql-test/t/ctype_ucs.test:
new log event - all binlog positions are changed :(
mysql-test/t/mix_innodb_myisam_binlog.test:
new log event - all binlog positions are changed :(
mysql-test/t/mysqlbinlog.test:
new log event - all binlog positions are changed :(
mysql-test/t/mysqlbinlog2.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_charset.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_error_ignored_table.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_loaddata_rule_m.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_loaddata_rule_s.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_log.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_log_pos.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_user_variables.test:
new log event - all binlog positions are changed :(
mysql-test/t/user_var.test:
new log event - all binlog positions are changed :(
mysys/hash.c:
typo fixed
sql/ha_berkeley.cc:
handlerton framework
sql/ha_berkeley.h:
handlerton framework
sql/ha_innodb.cc:
handlerton framework
sql/ha_innodb.h:
handlerton framework
sql/handler.cc:
new transaction handling, handlerton framework, two-phase commit, XA support
sql/handler.h:
new transaction handling, handlerton framework, two-phase commit, XA support
sql/lex.h:
XA commands
sql/log.cc:
new transaction handling, handlerton framework, two-phase commit,
XA support, tc-logging, TC_LOG_MMAP class
sql/log_event.cc:
Xid_log_event
sql/log_event.h:
Xid_log_event, LOG_EVENT_BINLOG_CLOSED_F flag
sql/mysql_priv.h:
wrapper for query_id++
sql/mysqld.cc:
new command-line options --log-tc, --log-tc-size, --tc-heuristic-recover,
new status variables Tc_log_page_size, Tc_log_max_pages_used, Tc_log_page_waits.
init/stop tc logging
sql/set_var.h:
warning fixed
sql/share/errmsg.txt:
XA error messages
sql/sp_head.cc:
s/query_id++/next_query_id()/
sql/sql_base.cc:
typo fixed. new transaction handling.
sql/sql_class.cc:
cleanup of THD.transaction
sql/sql_class.h:
TC_LOG classes, new status variables, new savepoint handling, XA support
sql/sql_insert.cc:
comments
sql/sql_lex.cc:
s/found_colon/found_semicolon/
sql/sql_lex.h:
SQLCOM_XA_xxx, XA related changes in Lex
sql/sql_parse.cc:
cleanup, XA commands, new savepoint handling
sql/sql_repl.cc:
two functions moved to log.cc
sql/sql_repl.h:
two functions moved to log.cc
sql/sql_trigger.cc:
s/lex.name_and_length/lex.ident/
sql/sql_yacc.yy:
XA commands, cleanup
2005-01-16 13:16:23 +01:00
|
|
|
/*
|
|
|
|
don't delete it - it may be re-enabled later
|
|
|
|
as an optimization for the most common case InnoDB+binlog
|
|
|
|
*/
|
|
|
|
#if 0
|
2002-01-22 22:57:56 +02:00
|
|
|
int innobase_report_binlog_offset_and_commit(
|
|
|
|
THD* thd,
|
|
|
|
void* trx_handle,
|
|
|
|
char* log_file_name,
|
|
|
|
my_off_t end_offset);
|
XA (not completely polished out yet)
include/my_pthread.h:
cleanup. don't use gcc extensions
innobase/include/trx0sys.ic:
Jan's fix for innobase_xa_prepare
innobase/read/read0read.c:
Jan's fix for innobase_xa_prepare
innobase/trx/trx0trx.c:
Jan's fix for innobase_xa_prepare
mysql-test/include/varchar.inc:
test fix
mysql-test/r/ctype_ucs.result:
new log event - all binlog positions are changed :(
mysql-test/r/drop_temp_table.result:
new log event - all binlog positions are changed :(
mysql-test/r/insert_select.result:
new log event - all binlog positions are changed :(
mysql-test/r/mix_innodb_myisam_binlog.result:
new log event - all binlog positions are changed :(
mysql-test/r/myisam.result:
test fix
mysql-test/r/rpl000015.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_change_master.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_charset.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_error_ignored_table.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_flush_log_loop.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_flush_tables.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_loaddata.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_loaddata_rule_m.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_loaddata_rule_s.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_log.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_log_pos.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_max_relay_size.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_relayrotate.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_replicate_do.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_reset_slave.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_rotate_logs.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_server_id1.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_server_id2.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_temporary.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_timezone.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_until.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_user_variables.result:
new log event - all binlog positions are changed :(
mysql-test/r/user_var.result:
new log event - all binlog positions are changed :(
mysql-test/t/ctype_ucs.test:
new log event - all binlog positions are changed :(
mysql-test/t/mix_innodb_myisam_binlog.test:
new log event - all binlog positions are changed :(
mysql-test/t/mysqlbinlog.test:
new log event - all binlog positions are changed :(
mysql-test/t/mysqlbinlog2.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_charset.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_error_ignored_table.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_loaddata_rule_m.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_loaddata_rule_s.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_log.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_log_pos.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_user_variables.test:
new log event - all binlog positions are changed :(
mysql-test/t/user_var.test:
new log event - all binlog positions are changed :(
mysys/hash.c:
typo fixed
sql/ha_berkeley.cc:
handlerton framework
sql/ha_berkeley.h:
handlerton framework
sql/ha_innodb.cc:
handlerton framework
sql/ha_innodb.h:
handlerton framework
sql/handler.cc:
new transaction handling, handlerton framework, two-phase commit, XA support
sql/handler.h:
new transaction handling, handlerton framework, two-phase commit, XA support
sql/lex.h:
XA commands
sql/log.cc:
new transaction handling, handlerton framework, two-phase commit,
XA support, tc-logging, TC_LOG_MMAP class
sql/log_event.cc:
Xid_log_event
sql/log_event.h:
Xid_log_event, LOG_EVENT_BINLOG_CLOSED_F flag
sql/mysql_priv.h:
wrapper for query_id++
sql/mysqld.cc:
new command-line options --log-tc, --log-tc-size, --tc-heuristic-recover,
new status variables Tc_log_page_size, Tc_log_max_pages_used, Tc_log_page_waits.
init/stop tc logging
sql/set_var.h:
warning fixed
sql/share/errmsg.txt:
XA error messages
sql/sp_head.cc:
s/query_id++/next_query_id()/
sql/sql_base.cc:
typo fixed. new transaction handling.
sql/sql_class.cc:
cleanup of THD.transaction
sql/sql_class.h:
TC_LOG classes, new status variables, new savepoint handling, XA support
sql/sql_insert.cc:
comments
sql/sql_lex.cc:
s/found_colon/found_semicolon/
sql/sql_lex.h:
SQLCOM_XA_xxx, XA related changes in Lex
sql/sql_parse.cc:
cleanup, XA commands, new savepoint handling
sql/sql_repl.cc:
two functions moved to log.cc
sql/sql_repl.h:
two functions moved to log.cc
sql/sql_trigger.cc:
s/lex.name_and_length/lex.ident/
sql/sql_yacc.yy:
XA commands, cleanup
2005-01-16 13:16:23 +01:00
|
|
|
int innobase_commit_complete(void* trx_handle);
|
2005-02-14 21:50:09 +01:00
|
|
|
void innobase_store_binlog_offset_and_flush_log(char *binlog_name,longlong offset);
|
XA (not completely polished out yet)
include/my_pthread.h:
cleanup. don't use gcc extensions
innobase/include/trx0sys.ic:
Jan's fix for innobase_xa_prepare
innobase/read/read0read.c:
Jan's fix for innobase_xa_prepare
innobase/trx/trx0trx.c:
Jan's fix for innobase_xa_prepare
mysql-test/include/varchar.inc:
test fix
mysql-test/r/ctype_ucs.result:
new log event - all binlog positions are changed :(
mysql-test/r/drop_temp_table.result:
new log event - all binlog positions are changed :(
mysql-test/r/insert_select.result:
new log event - all binlog positions are changed :(
mysql-test/r/mix_innodb_myisam_binlog.result:
new log event - all binlog positions are changed :(
mysql-test/r/myisam.result:
test fix
mysql-test/r/rpl000015.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_change_master.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_charset.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_error_ignored_table.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_flush_log_loop.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_flush_tables.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_loaddata.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_loaddata_rule_m.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_loaddata_rule_s.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_log.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_log_pos.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_max_relay_size.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_relayrotate.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_replicate_do.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_reset_slave.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_rotate_logs.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_server_id1.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_server_id2.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_temporary.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_timezone.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_until.result:
new log event - all binlog positions are changed :(
mysql-test/r/rpl_user_variables.result:
new log event - all binlog positions are changed :(
mysql-test/r/user_var.result:
new log event - all binlog positions are changed :(
mysql-test/t/ctype_ucs.test:
new log event - all binlog positions are changed :(
mysql-test/t/mix_innodb_myisam_binlog.test:
new log event - all binlog positions are changed :(
mysql-test/t/mysqlbinlog.test:
new log event - all binlog positions are changed :(
mysql-test/t/mysqlbinlog2.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_charset.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_error_ignored_table.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_loaddata_rule_m.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_loaddata_rule_s.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_log.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_log_pos.test:
new log event - all binlog positions are changed :(
mysql-test/t/rpl_user_variables.test:
new log event - all binlog positions are changed :(
mysql-test/t/user_var.test:
new log event - all binlog positions are changed :(
mysys/hash.c:
typo fixed
sql/ha_berkeley.cc:
handlerton framework
sql/ha_berkeley.h:
handlerton framework
sql/ha_innodb.cc:
handlerton framework
sql/ha_innodb.h:
handlerton framework
sql/handler.cc:
new transaction handling, handlerton framework, two-phase commit, XA support
sql/handler.h:
new transaction handling, handlerton framework, two-phase commit, XA support
sql/lex.h:
XA commands
sql/log.cc:
new transaction handling, handlerton framework, two-phase commit,
XA support, tc-logging, TC_LOG_MMAP class
sql/log_event.cc:
Xid_log_event
sql/log_event.h:
Xid_log_event, LOG_EVENT_BINLOG_CLOSED_F flag
sql/mysql_priv.h:
wrapper for query_id++
sql/mysqld.cc:
new command-line options --log-tc, --log-tc-size, --tc-heuristic-recover,
new status variables Tc_log_page_size, Tc_log_max_pages_used, Tc_log_page_waits.
init/stop tc logging
sql/set_var.h:
warning fixed
sql/share/errmsg.txt:
XA error messages
sql/sp_head.cc:
s/query_id++/next_query_id()/
sql/sql_base.cc:
typo fixed. new transaction handling.
sql/sql_class.cc:
cleanup of THD.transaction
sql/sql_class.h:
TC_LOG classes, new status variables, new savepoint handling, XA support
sql/sql_insert.cc:
comments
sql/sql_lex.cc:
s/found_colon/found_semicolon/
sql/sql_lex.h:
SQLCOM_XA_xxx, XA related changes in Lex
sql/sql_parse.cc:
cleanup, XA commands, new savepoint handling
sql/sql_repl.cc:
two functions moved to log.cc
sql/sql_repl.h:
two functions moved to log.cc
sql/sql_trigger.cc:
s/lex.name_and_length/lex.ident/
sql/sql_yacc.yy:
XA commands, cleanup
2005-01-16 13:16:23 +01:00
|
|
|
#endif
|
|
|
|
|
2005-11-07 16:25:06 +01:00
|
|
|
void innobase_drop_database(char *path);
|
|
|
|
bool innobase_show_status(THD* thd, stat_print_fn*, enum ha_stat_type);
|
2001-10-10 22:47:08 +03:00
|
|
|
|
2005-11-07 16:25:06 +01:00
|
|
|
int innobase_release_temporary_latches(THD *thd);
|
2004-06-10 15:01:16 +03:00
|
|
|
|
|
|
|
void innobase_store_binlog_offset_and_flush_log(char *binlog_name,longlong offset);
|
2004-09-03 15:26:29 +03:00
|
|
|
|
2004-10-13 20:04:52 +03:00
|
|
|
int innobase_start_trx_and_assign_read_view(THD* thd);
|
2004-11-30 11:45:02 +02:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
This function is used to prepare X/Open XA distributed transaction */
|
|
|
|
|
|
|
|
int innobase_xa_prepare(
|
|
|
|
/*====================*/
|
|
|
|
/* out: 0 or error number */
|
|
|
|
THD* thd, /* in: handle to the MySQL thread of the user
|
|
|
|
whose XA transaction should be prepared */
|
|
|
|
bool all); /* in: TRUE - commit transaction
|
|
|
|
FALSE - the current SQL statement ended */
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
This function is used to recover X/Open XA distributed transactions */
|
|
|
|
|
|
|
|
int innobase_xa_recover(
|
|
|
|
/*====================*/
|
|
|
|
/* out: number of prepared transactions
|
|
|
|
stored in xid_list */
|
|
|
|
XID* xid_list, /* in/out: prepared transactions */
|
|
|
|
uint len); /* in: number of slots in xid_list */
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
This function is used to commit one X/Open XA distributed transaction
|
|
|
|
which is in the prepared state */
|
|
|
|
|
|
|
|
int innobase_commit_by_xid(
|
|
|
|
/*=======================*/
|
|
|
|
/* out: 0 or error number */
|
|
|
|
XID* xid); /* in : X/Open XA Transaction Identification */
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
This function is used to rollback one X/Open XA distributed transaction
|
|
|
|
which is in the prepared state */
|
|
|
|
|
|
|
|
int innobase_rollback_by_xid(
|
|
|
|
/* out: 0 or error number */
|
2005-08-03 17:09:21 +03:00
|
|
|
XID *xid); /* in : X/Open XA Transaction Identification */
|
2004-11-30 11:45:02 +02:00
|
|
|
|
|
|
|
|
|
|
|
int innobase_xa_end(THD *thd);
|
|
|
|
|
|
|
|
|
Many files:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/ha_innodb.cc:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/handler.cc:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/mysqld.cc:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/set_var.cc:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/sql_repl.cc:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/ha_innodb.h:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
sql/handler.h:
Semi-synchronous replication for InnoDB type tables; before telling the client that a commit has been processed, wait that the replication thread has returned from my_net_send() where it sends the binlog to the slave; note that TCP/IP, even with the TCP_NODELAY option does not guarantee that the slave has RECEIVED the data - this is just heuristic at the moment; this is useful in failover: in almost all cases, every transaction that has returned from the commit has been sent and processed in the slave, which makes failover to the slave simpler if the master crashes; the code does not work yet as is, because MySQL should call innobase_report_binlog_offset_and_commit() in a commit; we will most probably return that call to 5.0.x, to make InnoDB Hot Backup and group commit to work again; XA code broke them temporarily in 5.0.3
2005-04-20 19:27:46 +03:00
|
|
|
int innobase_repl_report_sent_binlog(THD *thd, char *log_file_name,
|
|
|
|
my_off_t end_offset);
|
2005-07-22 14:10:03 +03:00
|
|
|
|
|
|
|
/***********************************************************************
|
2005-08-03 17:09:21 +03:00
|
|
|
Create a consistent view for a cursor based on current transaction
|
|
|
|
which is created if the corresponding MySQL thread still lacks one.
|
|
|
|
This consistent view is then used inside of MySQL when accessing records
|
|
|
|
using a cursor. */
|
2005-07-22 14:10:03 +03:00
|
|
|
|
|
|
|
void*
|
|
|
|
innobase_create_cursor_view(void);
|
|
|
|
/*=============================*/
|
|
|
|
/* out: Pointer to cursor view or NULL */
|
|
|
|
|
|
|
|
/***********************************************************************
|
2005-08-03 17:09:21 +03:00
|
|
|
Close the given consistent cursor view of a transaction and restore
|
|
|
|
global read view to a transaction read view. Transaction is created if the
|
|
|
|
corresponding MySQL thread still lacks one. */
|
2005-07-22 14:10:03 +03:00
|
|
|
|
|
|
|
void
|
|
|
|
innobase_close_cursor_view(
|
|
|
|
/*=======================*/
|
|
|
|
void* curview); /* in: Consistent read view to be closed */
|
|
|
|
|
|
|
|
/***********************************************************************
|
2005-08-03 17:09:21 +03:00
|
|
|
Set the given consistent cursor view to a transaction which is created
|
|
|
|
if the corresponding MySQL thread still lacks one. If the given
|
|
|
|
consistent cursor view is NULL global read view of a transaction is
|
|
|
|
restored to a transaction read view. */
|
2005-07-22 14:10:03 +03:00
|
|
|
|
|
|
|
void
|
|
|
|
innobase_set_cursor_view(
|
|
|
|
/*=====================*/
|
2005-09-22 13:09:14 +03:00
|
|
|
void* curview); /* in: Consistent read view to be set */
|