summaryrefslogtreecommitdiff
path: root/storage/csv/ha_tina.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@mysql.com>2009-04-25 13:05:32 +0300
committerMichael Widenius <monty@mysql.com>2009-04-25 13:05:32 +0300
commite726e587ec6287472dd450dbcbddf07669b3e028 (patch)
treee644a6134bfe892512501c648c938a2e93f08130 /storage/csv/ha_tina.cc
parent210a412522b10115d34b431c66acf403faab7bfe (diff)
parent086185089e6c7bef58dde49b02950689af9fee63 (diff)
downloadmariadb-git-e726e587ec6287472dd450dbcbddf07669b3e028.tar.gz
Merged with mysql-5.1 tree.
client/mysqltest.cc: Manually merged configure.in: Manually merged mysql-test/r/variables.result: Manually merged mysql-test/t/variables.test: Manually merged mysys/my_pread.c: Manually merged mysys/my_read.c: Manually merged sql/mysqld.cc: Manually merged storage/csv/ha_tina.h: Manually merged storage/myisam/ha_myisam.cc: Manually merged storage/myisam/mi_check.c: Manually merged storage/myisam/mi_search.c: Manually merged
Diffstat (limited to 'storage/csv/ha_tina.cc')
-rw-r--r--storage/csv/ha_tina.cc33
1 files changed, 17 insertions, 16 deletions
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index e29fe4162f4..ad536d40002 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -397,12 +397,12 @@ static int free_share(TINA_SHARE *share)
'\r''\n' -- DOS\Windows line ending
*/
-off_t find_eoln_buff(Transparent_file *data_buff, off_t begin,
- off_t end, int *eoln_len)
+my_off_t find_eoln_buff(Transparent_file *data_buff, my_off_t begin,
+ my_off_t end, int *eoln_len)
{
*eoln_len= 0;
- for (off_t x= begin; x < end; x++)
+ for (my_off_t x= begin; x < end; x++)
{
/* Unix (includes Mac OS X) */
if (data_buff->get_value(x) == '\n')
@@ -553,7 +553,7 @@ int ha_tina::chain_append()
/* We set up for the next position */
if ((off_t)(chain_ptr - chain) == (chain_size -1))
{
- off_t location= chain_ptr - chain;
+ my_off_t location= chain_ptr - chain;
chain_size += DEFAULT_CHAIN_LENGTH;
if (chain_alloced)
{
@@ -586,7 +586,7 @@ int ha_tina::chain_append()
*/
int ha_tina::find_current_row(uchar *buf)
{
- off_t end_offset, curr_offset= current_position;
+ my_off_t end_offset, curr_offset= current_position;
int eoln_len;
my_bitmap_map *org_bitmap;
int error;
@@ -836,7 +836,7 @@ int ha_tina::open(const char *name, int mode, uint open_options)
during locking. This is needed to enable concurrent inserts.
*/
thr_lock_data_init(&share->lock, &lock, (void*) this);
- ref_length=sizeof(off_t);
+ ref_length= sizeof(my_off_t);
share->lock.get_status= tina_get_status;
share->lock.update_status= tina_update_status;
@@ -1140,7 +1140,7 @@ int ha_tina::rnd_pos(uchar * buf, uchar *pos)
{
DBUG_ENTER("ha_tina::rnd_pos");
ha_statistic_increment(&SSV::ha_read_rnd_count);
- current_position= (off_t)my_get_ptr(pos,ref_length);
+ current_position= my_get_ptr(pos,ref_length);
DBUG_RETURN(find_current_row(buf));
}
@@ -1180,7 +1180,7 @@ int ha_tina::extra(enum ha_extra_function operation)
to the given "hole", stored in the buffer. "Valid" here means,
not listed in the chain of deleted records ("holes").
*/
-bool ha_tina::get_write_pos(off_t *end_pos, tina_set *closest_hole)
+bool ha_tina::get_write_pos(my_off_t *end_pos, tina_set *closest_hole)
{
if (closest_hole == chain_ptr) /* no more chains */
*end_pos= file_buff->end();
@@ -1200,7 +1200,7 @@ bool ha_tina::get_write_pos(off_t *end_pos, tina_set *closest_hole)
int ha_tina::rnd_end()
{
char updated_fname[FN_REFLEN];
- off_t file_buffer_start= 0;
+ my_off_t file_buffer_start= 0;
DBUG_ENTER("ha_tina::rnd_end");
free_root(&blobroot, MYF(0));
@@ -1223,17 +1223,17 @@ int ha_tina::rnd_end()
my_qsort(chain, (size_t)(chain_ptr - chain), sizeof(tina_set),
(qsort_cmp)sort_set);
- off_t write_begin= 0, write_end;
+ my_off_t write_begin= 0, write_end;
/* create the file to write updated table if it wasn't yet created */
if (open_update_temp_file_if_needed())
DBUG_RETURN(-1);
/* write the file with updated info */
- while ((file_buffer_start != -1)) // while not end of file
+ while ((file_buffer_start != (my_off_t)-1)) // while not end of file
{
bool in_hole= get_write_pos(&write_end, ptr);
- off_t write_length= write_end - write_begin;
+ my_off_t write_length= write_end - write_begin;
/* if there is something to write, write it */
if (write_length)
@@ -1241,14 +1241,15 @@ int ha_tina::rnd_end()
if (my_write(update_temp_file,
(uchar*) (file_buff->ptr() +
(write_begin - file_buff->start())),
- write_length, MYF_RW))
+ (size_t)write_length, MYF_RW))
goto error;
temp_file_length+= write_length;
}
if (in_hole)
{
/* skip hole */
- while (file_buff->end() <= ptr->end && file_buffer_start != -1)
+ while (file_buff->end() <= ptr->end &&
+ file_buffer_start != (my_off_t)-1)
file_buffer_start= file_buff->read_next();
write_begin= ptr->end;
ptr++;
@@ -1348,7 +1349,7 @@ int ha_tina::repair(THD* thd, HA_CHECK_OPT* check_opt)
File repair_file;
int rc;
ha_rows rows_repaired= 0;
- off_t write_begin= 0, write_end;
+ my_off_t write_begin= 0, write_end;
DBUG_ENTER("ha_tina::repair");
/* empty file */
@@ -1423,7 +1424,7 @@ int ha_tina::repair(THD* thd, HA_CHECK_OPT* check_opt)
write_end= min(file_buff->end(), current_position);
if ((write_end - write_begin) &&
(my_write(repair_file, (uchar*)file_buff->ptr(),
- write_end - write_begin, MYF_RW)))
+ (size_t) (write_end - write_begin), MYF_RW)))
DBUG_RETURN(-1);
write_begin= write_end;