diff options
author | unknown <monty@mashka.mysql.fi> | 2002-09-18 21:04:49 +0300 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2002-09-18 21:04:49 +0300 |
commit | 83fc12f21653f1e6fc12c61791f4e6f2dd87be96 (patch) | |
tree | 83f34b98c4e43e4f23f9b941d93676b65ef1b657 /myisam/mi_extra.c | |
parent | aef675029f198c61a1a1c46dbb68890f705d40db (diff) | |
download | mariadb-git-83fc12f21653f1e6fc12c61791f4e6f2dd87be96.tar.gz |
Added code to flush a bulk_insert index.
This fixes a bug when doing multi-row inserts on table with an auto_increment key that is not in the first key segment.
Docs/manual.texi:
Changelog
include/my_base.h:
Added code to flush a bulk_insert index
myisam/mi_extra.c:
Added code to flush a bulk_insert index
mysql-test/r/insert.result:
test of auto_increment and bulk_insert
mysql-test/t/insert.test:
test of auto_increment and bulk_insert
sql/ha_myisam.cc:
Added code to flush a bulk_insert index
sql/sql_insert.cc:
Mark that bulk_insert is used
sql/sql_load.cc:
Mark that bulk_insert is used
Remove duplicated call to initialize bulk insert
sql/table.h:
Mark that bulk_insert is used
vio/viosslfactories.c:
Remove compiler warning
Diffstat (limited to 'myisam/mi_extra.c')
-rw-r--r-- | myisam/mi_extra.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/myisam/mi_extra.c b/myisam/mi_extra.c index 519cc5bc2b8..39eb4b0bd99 100644 --- a/myisam/mi_extra.c +++ b/myisam/mi_extra.c @@ -34,7 +34,9 @@ HA_EXTRA_WRITE_CACHE HA_EXTRA_CACHE HA_EXTRA_BULK_INSERT_BEGIN - If extra_arg is 0, then the default cache size is used. + If extra_arg is 0, then the default cache size is used. + HA_EXTRA_BULK_INSERT_FLUSH + extra_arg is a a pointer to which index to flush (uint*) RETURN VALUES 0 ok */ @@ -356,6 +358,14 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg) error=_mi_init_bulk_insert(info, (extra_arg ? *(ulong*) extra_arg : myisam_bulk_insert_tree_size)); break; + case HA_EXTRA_BULK_INSERT_FLUSH: + if (info->bulk_insert) + { + uint index_to_flush= *(uint*) extra_arg; + if (is_tree_inited(&info->bulk_insert[index_to_flush])) + reset_tree(&info->bulk_insert[index_to_flush]); + } + break; case HA_EXTRA_BULK_INSERT_END: if (info->bulk_insert) { |