summaryrefslogtreecommitdiff
path: root/storage/csv
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2012-04-07 15:58:46 +0200
committerSergei Golubchik <sergii@pisem.net>2012-04-07 15:58:46 +0200
commitf860b2aad41cd1b5ed0438ea211dcd78eec82b94 (patch)
tree650133297bec368a1cdeb50ea1950e1b4d1b679e /storage/csv
parentb43494620f6cd57e8249940f4fb0406ffff8dff7 (diff)
parentb95ae56b9f47cc19d3498d4be3142b2449a04600 (diff)
downloadmariadb-git-f860b2aad41cd1b5ed0438ea211dcd78eec82b94.tar.gz
merge
Diffstat (limited to 'storage/csv')
-rw-r--r--storage/csv/ha_tina.cc15
-rw-r--r--storage/csv/ha_tina.h3
2 files changed, 14 insertions, 4 deletions
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index 9091c101183..d31e5ee8d89 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -961,6 +961,7 @@ int ha_tina::open(const char *name, int mode, uint open_options)
*/
thr_lock_data_init(&share->lock, &lock, (void*) this);
ref_length= sizeof(my_off_t);
+ init_alloc_root(&blobroot, BLOB_MEMROOT_ALLOC_SIZE, 0);
share->lock.get_status= tina_get_status;
share->lock.update_status= tina_update_status;
@@ -978,6 +979,7 @@ int ha_tina::close(void)
{
int rc= 0;
DBUG_ENTER("ha_tina::close");
+ free_root(&blobroot, MYF(0));
rc= mysql_file_close(data_file, MYF(0));
DBUG_RETURN(free_share(share) || rc);
}
@@ -1196,7 +1198,7 @@ int ha_tina::rnd_init(bool scan)
current_position= next_position= 0;
stats.records= 0;
- records_is_known= 0;
+ records_is_known= found_end_of_file= 0;
chain_ptr= chain;
DBUG_RETURN(0);
@@ -1246,6 +1248,7 @@ int ha_tina::rnd_next(uchar *buf)
stats.records++;
rc= 0;
end:
+ found_end_of_file= (rc == HA_ERR_END_OF_FILE);
MYSQL_READ_ROW_DONE(rc);
DBUG_RETURN(rc);
}
@@ -1345,8 +1348,7 @@ int ha_tina::rnd_end()
my_off_t file_buffer_start= 0;
DBUG_ENTER("ha_tina::rnd_end");
- free_root(&blobroot, MYF(0));
- records_is_known= 1;
+ records_is_known= found_end_of_file;
if ((chain_ptr - chain) > 0)
{
@@ -1759,6 +1761,13 @@ int ha_tina::check(THD* thd, HA_CHECK_OPT* check_opt)
}
+int ha_tina::reset(void)
+{
+ free_root(&blobroot, MYF(0));
+ return 0;
+}
+
+
bool ha_tina::check_if_incompatible_data(HA_CREATE_INFO *info,
uint table_changes)
{
diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h
index d024b31c127..88af2c9652c 100644
--- a/storage/csv/ha_tina.h
+++ b/storage/csv/ha_tina.h
@@ -81,7 +81,7 @@ class ha_tina: public handler
uchar chain_alloced;
uint32 chain_size;
uint local_data_file_version; /* Saved version of the data file used */
- bool records_is_known;
+ bool records_is_known, found_end_of_file;
MEM_ROOT blobroot;
private:
@@ -155,6 +155,7 @@ public:
bool auto_repair() const { return 1; }
void position(const uchar *record);
int info(uint);
+ int reset();
int extra(enum ha_extra_function operation);
int delete_all_rows(void);
int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info);