summaryrefslogtreecommitdiff
path: root/storage/csv/ha_tina.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/csv/ha_tina.cc')
-rw-r--r--storage/csv/ha_tina.cc18
1 files changed, 13 insertions, 5 deletions
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index 64fd7102e93..d31e5ee8d89 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -1,5 +1,4 @@
-/*
- Copyright (c) 2004, 2010, Oracle and/or its affiliates
+/* Copyright (c) 2004, 2011, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -962,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;
@@ -979,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);
}
@@ -1197,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);
@@ -1247,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);
}
@@ -1346,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)
{
@@ -1760,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)
{