summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorDavi Arnaut <davi.arnaut@oracle.com>2010-07-20 16:30:10 -0300
committerDavi Arnaut <davi.arnaut@oracle.com>2010-07-20 16:30:10 -0300
commit182599dd13f280ce4d51333bca98dbd5e4816bba (patch)
treec02d7fe89f0e9d9cbd05e83dd77ceeed812eb293 /storage
parent774194634297aebf6ecbbda7c5601c796f43e5fc (diff)
parent9a5fa17fd3c4885262e31bf14cf495d02e5f6b27 (diff)
downloadmariadb-git-182599dd13f280ce4d51333bca98dbd5e4816bba.tar.gz
Merge of mysql-5.1-bugteam into mysql-trunk-merge.
Diffstat (limited to 'storage')
-rw-r--r--storage/csv/ha_tina.cc12
-rw-r--r--storage/example/ha_example.cc2
-rw-r--r--storage/myisam/mi_locking.c14
-rw-r--r--storage/myisam/rt_split.c3
-rw-r--r--storage/myisammrg/myrg_open.c5
5 files changed, 6 insertions, 30 deletions
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index 30c4c4d58ca..a62444aba79 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -519,7 +519,7 @@ int ha_tina::encode_quote(uchar *buf)
const char *ptr;
const char *end_ptr;
const bool was_null= (*field)->is_null();
-
+
/*
assistance for backwards compatibility in production builds.
note: this will not work for ENUM columns.
@@ -531,7 +531,7 @@ int ha_tina::encode_quote(uchar *buf)
}
(*field)->val_str(&attribute,&attribute);
-
+
if (was_null)
(*field)->set_null();
@@ -542,34 +542,30 @@ int ha_tina::encode_quote(uchar *buf)
buffer.append('"');
- while (ptr < end_ptr)
+ for (; ptr < end_ptr; ptr++)
{
if (*ptr == '"')
{
buffer.append('\\');
buffer.append('"');
- *ptr++;
}
else if (*ptr == '\r')
{
buffer.append('\\');
buffer.append('r');
- *ptr++;
}
else if (*ptr == '\\')
{
buffer.append('\\');
buffer.append('\\');
- *ptr++;
}
else if (*ptr == '\n')
{
buffer.append('\\');
buffer.append('n');
- *ptr++;
}
else
- buffer.append(*ptr++);
+ buffer.append(*ptr);
}
buffer.append('"');
}
diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc
index 899f55a33f7..306f8eaeccd 100644
--- a/storage/example/ha_example.cc
+++ b/storage/example/ha_example.cc
@@ -180,7 +180,7 @@ static int example_done_func(void *p)
my_hash_free(&example_open_tables);
mysql_mutex_destroy(&example_mutex);
- DBUG_RETURN(0);
+ DBUG_RETURN(error);
}
diff --git a/storage/myisam/mi_locking.c b/storage/myisam/mi_locking.c
index 065f18965d1..6134b4f46df 100644
--- a/storage/myisam/mi_locking.c
+++ b/storage/myisam/mi_locking.c
@@ -29,7 +29,6 @@ int mi_lock_database(MI_INFO *info, int lock_type)
int error;
uint count;
MYISAM_SHARE *share=info->s;
- uint flag;
DBUG_ENTER("mi_lock_database");
DBUG_PRINT("enter",("lock_type: %d old lock %d r_locks: %u w_locks: %u "
"global_changed: %d open_count: %u name: '%s'",
@@ -49,7 +48,7 @@ int mi_lock_database(MI_INFO *info, int lock_type)
DBUG_RETURN(0);
}
- flag=error=0;
+ error= 0;
mysql_mutex_lock(&share->intern_lock);
if (share->kfile >= 0) /* May only be false on windows */
{
@@ -121,14 +120,12 @@ int mi_lock_database(MI_INFO *info, int lock_type)
{
if (share->r_locks)
{ /* Only read locks left */
- flag=1;
if (my_lock(share->kfile,F_RDLCK,0L,F_TO_EOF,
MYF(MY_WME | MY_SEEK_NOT_DONE)) && !error)
error=my_errno;
}
else if (!share->w_locks)
{ /* No more locks */
- flag=1;
if (my_lock(share->kfile,F_UNLCK,0L,F_TO_EOF,
MYF(MY_WME | MY_SEEK_NOT_DONE)) && !error)
error=my_errno;
@@ -150,7 +147,6 @@ int mi_lock_database(MI_INFO *info, int lock_type)
*/
if (share->w_locks == 1)
{
- flag=1;
if (my_lock(share->kfile,lock_type,0L,F_TO_EOF,
MYF(MY_SEEK_NOT_DONE)))
{
@@ -165,7 +161,6 @@ int mi_lock_database(MI_INFO *info, int lock_type)
}
if (!share->r_locks && !share->w_locks)
{
- flag=1;
if (my_lock(share->kfile,lock_type,0L,F_TO_EOF,
info->lock_wait | MY_SEEK_NOT_DONE))
{
@@ -191,7 +186,6 @@ int mi_lock_database(MI_INFO *info, int lock_type)
{ /* Change READONLY to RW */
if (share->r_locks == 1)
{
- flag=1;
if (my_lock(share->kfile,lock_type,0L,F_TO_EOF,
MYF(info->lock_wait | MY_SEEK_NOT_DONE)))
{
@@ -208,7 +202,6 @@ int mi_lock_database(MI_INFO *info, int lock_type)
{
if (!share->w_locks)
{
- flag=1;
if (my_lock(share->kfile,lock_type,0L,F_TO_EOF,
info->lock_wait | MY_SEEK_NOT_DONE))
{
@@ -256,11 +249,6 @@ int mi_lock_database(MI_INFO *info, int lock_type)
}
#endif
mysql_mutex_unlock(&share->intern_lock);
-#if defined(FULL_LOG) || defined(_lint)
- lock_type|=(int) (flag << 8); /* Set bit to set if real lock */
- myisam_log_command(MI_LOG_LOCK,info,(uchar*) &lock_type,sizeof(lock_type),
- error);
-#endif
DBUG_RETURN(error);
} /* mi_lock_database */
diff --git a/storage/myisam/rt_split.c b/storage/myisam/rt_split.c
index 88cf643faf9..03d22de68fa 100644
--- a/storage/myisam/rt_split.c
+++ b/storage/myisam/rt_split.c
@@ -255,7 +255,6 @@ int rtree_split_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key,
SplitStruct *stop;
double *coord_buf;
double *next_coord;
- double *old_coord;
int n_dim;
uchar *source_cur, *cur1, *cur2;
uchar *new_page= info->buff;
@@ -293,8 +292,6 @@ int rtree_split_page(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uchar *key,
rtree_d_mbr(keyinfo->seg, key, key_length, cur->coords);
cur->key = key;
- old_coord = next_coord;
-
if (split_rtree_node(task, max_keys + 1,
mi_getint(page) + full_length + 2, full_length,
rt_PAGE_MIN_SIZE(keyinfo->block_length),
diff --git a/storage/myisammrg/myrg_open.c b/storage/myisammrg/myrg_open.c
index c9e19d32e96..b8e86b89181 100644
--- a/storage/myisammrg/myrg_open.c
+++ b/storage/myisammrg/myrg_open.c
@@ -226,9 +226,7 @@ MYRG_INFO *myrg_parent_open(const char *parent_name,
int save_errno;
int insert_method;
uint length;
- uint dir_length;
uint child_count;
- size_t name_buff_length;
File fd;
IO_CACHE file_cache;
char parent_name_buff[FN_REFLEN * 2];
@@ -300,7 +298,6 @@ MYRG_INFO *myrg_parent_open(const char *parent_name,
}
/* Call callback for each child. */
- dir_length= dirname_part(parent_name_buff, parent_name, &name_buff_length);
my_b_seek(&file_cache, 0);
while ((length= my_b_gets(&file_cache, child_name_buff, FN_REFLEN - 1)))
{
@@ -381,7 +378,6 @@ int myrg_attach_children(MYRG_INFO *m_info, int handle_locking,
{
ulonglong file_offset;
MI_INFO *myisam;
- int rc;
int errpos;
int save_errno;
uint idx;
@@ -400,7 +396,6 @@ int myrg_attach_children(MYRG_INFO *m_info, int handle_locking,
here and in ha_myisammrg::store_lock() forces consistent data.
*/
mysql_mutex_lock(&m_info->mutex);
- rc= 1;
errpos= 0;
file_offset= 0;
min_keys= 0;