diff options
author | acurtis/antony@ltamd64.xiphis.org <> | 2007-07-24 00:03:01 -0700 |
---|---|---|
committer | acurtis/antony@ltamd64.xiphis.org <> | 2007-07-24 00:03:01 -0700 |
commit | f736a40f826c5b06b83ab0e2b68696557c4d0d1c (patch) | |
tree | b4297e5a5bc8285bb3d7526f32a7ffe3a50b3959 /storage/federated | |
parent | ab22b0a33728cb6a4940567f69770b39b688d099 (diff) | |
parent | 6b38c5b762361ccf6960f448a34e4f3cf42ebad0 (diff) | |
download | mariadb-git-f736a40f826c5b06b83ab0e2b68696557c4d0d1c.tar.gz |
Merge xiphis.org:/anubis/antony/work/p2-bug25714.1
into xiphis.org:/anubis/antony/work/p2-bug25714.1.merge-5.1
Diffstat (limited to 'storage/federated')
-rw-r--r-- | storage/federated/ha_federated.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc index 67dc37a8ff2..9d070dfa7b1 100644 --- a/storage/federated/ha_federated.cc +++ b/storage/federated/ha_federated.cc @@ -2025,8 +2025,13 @@ int ha_federated::write_row(uchar *buf) field, then store the last_insert_id() value from the foreign server */ if (auto_increment_update_required) + { update_auto_increment(); + /* mysql_insert() uses this for protocol return value */ + table->next_number_field->store(auto_increment_value, 1); + } + DBUG_RETURN(0); } @@ -2110,8 +2115,9 @@ void ha_federated::update_auto_increment(void) THD *thd= current_thd; DBUG_ENTER("ha_federated::update_auto_increment"); + ha_federated::info(HA_STATUS_AUTO); thd->first_successful_insert_id_in_cur_stmt= - mysql->last_used_con->insert_id; + stats.auto_increment_value; DBUG_PRINT("info",("last_insert_id: %ld", (long) stats.auto_increment_value)); DBUG_VOID_RETURN; @@ -2933,8 +2939,10 @@ int ha_federated::info(uint flag) } - if (result) - mysql_free_result(result); + if (flag & HA_STATUS_AUTO) + auto_increment_value= mysql->last_used_con->insert_id; + + mysql_free_result(result); DBUG_RETURN(0); |