summaryrefslogtreecommitdiff
path: root/sql/ha_blackhole.cc
diff options
context:
space:
mode:
authorunknown <aelkin/andrei@mysql1000.(none)>2008-03-19 18:44:50 +0200
committerunknown <aelkin/andrei@mysql1000.(none)>2008-03-19 18:44:50 +0200
commit5a6996dbcde4ca833f7936413cfa090cba060af5 (patch)
tree51178a12ca585907874608cebef66e7bd695c34f /sql/ha_blackhole.cc
parent1836625fb4e42b1629b59a4f070d6849da2ee434 (diff)
downloadmariadb-git-5a6996dbcde4ca833f7936413cfa090cba060af5.tar.gz
Bug #35178 INSERT_ID not written to binary log for inserts against BLACKHOLE backed tables
binlogging of insert into a autoincrement blackhole table ignored an explicit set insert_id. Fixed with refining of the blackhole's insert method to call update_auto_increment() that prepares binlogging the insert query with the preceeding set insert_id. Note, as the engine does not store any actual data one has to explicitly provide to the server with the value of the autoincrement column via set insert_id. Otherwise binlogging will happend with the default set insert_id=1. mysql-test/r/blackhole.result: results changed mysql-test/t/blackhole.test: a regression test for the bug added sql/ha_blackhole.cc: blackhole's insert method is refined to call update_auto_increment() that prepares binlogging the insert query with the preceeding set insert_id.
Diffstat (limited to 'sql/ha_blackhole.cc')
-rw-r--r--sql/ha_blackhole.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/ha_blackhole.cc b/sql/ha_blackhole.cc
index e477686d18e..01ede3d3bd2 100644
--- a/sql/ha_blackhole.cc
+++ b/sql/ha_blackhole.cc
@@ -115,7 +115,7 @@ const char *ha_blackhole::index_type(uint key_number)
int ha_blackhole::write_row(byte * buf)
{
DBUG_ENTER("ha_blackhole::write_row");
- DBUG_RETURN(0);
+ DBUG_RETURN(table->next_number_field ? update_auto_increment() : 0);
}
int ha_blackhole::rnd_init(bool scan)