summaryrefslogtreecommitdiff
path: root/sql/ha_myisam.cc
diff options
context:
space:
mode:
authormonty@mishka.local <>2004-09-15 22:10:31 +0300
committermonty@mishka.local <>2004-09-15 22:10:31 +0300
commit91ff64e107866821efc8591fc6ecf28f3b7ee9a0 (patch)
treed4323a7f81c07c98095c922e124755d6ac3253b8 /sql/ha_myisam.cc
parent3ce78a27cdcb9b0ba4d6e0f36f2953cf8db7b518 (diff)
downloadmariadb-git-91ff64e107866821efc8591fc6ecf28f3b7ee9a0.tar.gz
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)
Diffstat (limited to 'sql/ha_myisam.cc')
-rw-r--r--sql/ha_myisam.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index 4a6f2c556bf..938f3a40629 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -1520,8 +1520,12 @@ int ha_myisam::rename_table(const char * from, const char * to)
}
-longlong ha_myisam::get_auto_increment()
+ulonglong ha_myisam::get_auto_increment()
{
+ ulonglong nr;
+ int error;
+ byte key[MI_MAX_KEY_LENGTH];
+
if (!table->next_number_key_offset)
{ // Autoincrement at key-start
ha_myisam::info(HA_STATUS_AUTO);
@@ -1531,19 +1535,16 @@ longlong ha_myisam::get_auto_increment()
/* it's safe to call the following if bulk_insert isn't on */
mi_flush_bulk_insert(file, table->next_number_index);
- longlong nr;
- int error;
- byte key[MI_MAX_KEY_LENGTH];
(void) extra(HA_EXTRA_KEYREAD);
key_copy(key,table,table->next_number_index,
table->next_number_key_offset);
error=mi_rkey(file,table->record[1],(int) table->next_number_index,
key,table->next_number_key_offset,HA_READ_PREFIX_LAST);
if (error)
- nr=1;
+ nr= 1;
else
- nr=(longlong)
- table->next_number_field->val_int_offset(table->rec_buff_length)+1;
+ nr= ((ulonglong) table->next_number_field->
+ val_int_offset(table->rec_buff_length)+1);
extra(HA_EXTRA_NO_KEYREAD);
return nr;
}