mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Added options --auto-increment-increment and --auto-increment-offset.
This allows one to setup a master <-> master replication with non conflicting auto-increment series. Cleaned up binary log code to make it easyer to add new state variables. Added simpler 'upper level' logic for artificial events (events that should not cause cleanups on slave). Simplified binary log handling. Changed how auto_increment works together with to SET INSERT_ID=# to make it more predictable: Now the inserted rows in a multi-row statement are set independent of the existing rows in the table. (Before only InnoDB did this correctly)
This commit is contained in:
@@ -160,8 +160,8 @@ bool foreign_key_prefix(Key *a, Key *b)
|
||||
|
||||
THD::THD()
|
||||
:user_time(0), global_read_lock(0), is_fatal_error(0),
|
||||
last_insert_id_used(0),
|
||||
insert_id_used(0), rand_used(0), time_zone_used(0),
|
||||
rand_used(0), time_zone_used(0),
|
||||
last_insert_id_used(0), insert_id_used(0), clear_next_insert_id(0),
|
||||
in_lock_tables(0), bootstrap(0), spcont(NULL)
|
||||
{
|
||||
current_arena= this;
|
||||
@@ -496,6 +496,24 @@ bool THD::store_globals()
|
||||
}
|
||||
|
||||
|
||||
/* Cleanup after a query */
|
||||
|
||||
void THD::cleanup_after_query()
|
||||
{
|
||||
if (clear_next_insert_id)
|
||||
{
|
||||
clear_next_insert_id= 0;
|
||||
next_insert_id= 0;
|
||||
}
|
||||
/* Free Items that were created during this execution */
|
||||
free_items(free_list);
|
||||
/*
|
||||
In the rest of code we assume that free_list never points to garbage:
|
||||
Keep this predicate true.
|
||||
*/
|
||||
free_list= 0;
|
||||
}
|
||||
|
||||
/*
|
||||
Convert a string to another character set
|
||||
|
||||
@@ -1461,8 +1479,8 @@ void Statement::end_statement()
|
||||
lex_end(lex);
|
||||
delete lex->result;
|
||||
lex->result= 0;
|
||||
free_items(free_list);
|
||||
free_list= 0;
|
||||
/* Note that free_list is freed in cleanup_after_query() */
|
||||
|
||||
/*
|
||||
Don't free mem_root, as mem_root is freed in the end of dispatch_command
|
||||
(once for any command).
|
||||
|
||||
Reference in New Issue
Block a user