Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
e8150697
Commit
e8150697
authored
Jul 23, 2010
by
Davi Arnaut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WL#5498: Remove dead and unused source code
Remove workarounds for ancient systems.
parent
68cd3bce
Changes
29
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
94 additions
and
117 deletions
+94
-117
include/m_string.h
include/m_string.h
+0
-6
include/my_global.h
include/my_global.h
+14
-26
mysys/default.c
mysys/default.c
+1
-1
mysys/my_pthread.c
mysys/my_pthread.c
+3
-3
sql/field.cc
sql/field.cc
+19
-19
sql/field.h
sql/field.h
+5
-5
sql/field_conv.cc
sql/field_conv.cc
+1
-1
sql/filesort.cc
sql/filesort.cc
+1
-1
sql/hostname.cc
sql/hostname.cc
+2
-2
sql/udf_example.c
sql/udf_example.c
+1
-2
storage/csv/ha_tina.cc
storage/csv/ha_tina.cc
+3
-3
storage/federated/ha_federated.cc
storage/federated/ha_federated.cc
+5
-5
storage/heap/ha_heap.cc
storage/heap/ha_heap.cc
+1
-1
storage/myisam/ft_parser.c
storage/myisam/ft_parser.c
+1
-1
storage/myisam/ft_update.c
storage/myisam/ft_update.c
+1
-2
storage/myisam/mi_dynrec.c
storage/myisam/mi_dynrec.c
+3
-3
storage/myisam/mi_key.c
storage/myisam/mi_key.c
+1
-1
storage/myisam/mi_log.c
storage/myisam/mi_log.c
+1
-1
storage/myisam/mi_open.c
storage/myisam/mi_open.c
+2
-2
storage/myisam/mi_packrec.c
storage/myisam/mi_packrec.c
+1
-2
storage/myisam/mi_test1.c
storage/myisam/mi_test1.c
+6
-6
storage/myisam/mi_test2.c
storage/myisam/mi_test2.c
+1
-1
storage/myisam/mi_test3.c
storage/myisam/mi_test3.c
+1
-1
storage/myisam/mi_unique.c
storage/myisam/mi_unique.c
+3
-3
storage/myisam/myisamlog.c
storage/myisam/myisamlog.c
+2
-2
storage/myisam/myisampack.c
storage/myisam/myisampack.c
+4
-5
storage/myisam/sp_key.c
storage/myisam/sp_key.c
+1
-1
storage/myisam/sp_test.c
storage/myisam/sp_test.c
+8
-8
storage/perfschema/pfs_events_waits.cc
storage/perfschema/pfs_events_waits.cc
+2
-3
No files found.
include/m_string.h
View file @
e8150697
...
...
@@ -90,12 +90,6 @@ extern char _dig_vec_lower[];
#ifndef strmov
#define strmov_overlapp(A,B) strmov(A,B)
#define strmake_overlapp(A,B,C) strmake(A,B,C)
#endif
#ifdef BAD_MEMCPY
/* Problem with gcc on Alpha */
#define memcpy_fixed(A,B,C) bmove((A),(B),(C))
#else
#define memcpy_fixed(A,B,C) memcpy((A),(B),(C))
#endif
/* Prototypes for string functions */
...
...
include/my_global.h
View file @
e8150697
...
...
@@ -341,18 +341,6 @@ C_MODE_END
#error "Please add -fno-exceptions to CXXFLAGS and reconfigure/recompile"
#endif
/* Fix a bug in gcc 2.8.0 on IRIX 6.2 */
#if SIZEOF_LONG == 4 && defined(__LONG_MAX__) && (__GNUC__ == 2 && __GNUC_MINOR__ == 8)
#undef __LONG_MAX__
/* Is a longlong value in gcc 2.8.0 ??? */
#define __LONG_MAX__ 2147483647
#endif
/* egcs 1.1.2 has a problem with memcpy on Alpha */
#if defined(__GNUC__) && defined(__alpha__) && ! (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
#define BAD_MEMCPY
#endif
#if defined(_lint) && !defined(lint)
#define lint
#endif
...
...
@@ -1263,8 +1251,8 @@ do { doubleget_union _tmp; \
((uchar*) &def_temp)[7]=(M)[0];\
(V) = def_temp; } while(0)
#else
#define float4get(V,M) memcpy
_fixed((uchar*) &V,(uchar*) (M),
sizeof(float))
#define float4store(V,M) memcpy
_fixed((uchar*) V,(uchar*) (&M),
sizeof(float))
#define float4get(V,M) memcpy
(&V, (M),
sizeof(float))
#define float4store(V,M) memcpy
(V, (&M),
sizeof(float))
#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
#define doublestore(T,V) do { *(((char*)T)+0)=(char) ((uchar *) &V)[4];\
...
...
@@ -1334,12 +1322,12 @@ do { doubleget_union _tmp; \
*(((char*)T)+1)=(((A) >> 16));\
*(((char*)T)+0)=(((A) >> 24)); } while(0)
#define floatget(V,M) memcpy
_fixed((uchar*) &V,(uchar*) (M),
sizeof(float))
#define floatstore(T,V) memcpy
_fixed((uchar*) (T),(uchar*)(&V),
sizeof(float))
#define doubleget(V,M) memcpy
_fixed((uchar*) &V,(uchar*) (M),
sizeof(double))
#define doublestore(T,V) memcpy
_fixed((uchar*) (T),(uchar*) &V,
sizeof(double))
#define longlongget(V,M) memcpy
_fixed((uchar*) &V,(uchar*) (M),
sizeof(ulonglong))
#define longlongstore(T,V) memcpy
_fixed((uchar*) (T),(uchar*) &V,
sizeof(ulonglong))
#define floatget(V,M) memcpy
(&V, (M),
sizeof(float))
#define floatstore(T,V) memcpy
((T), (void*) (&V),
sizeof(float))
#define doubleget(V,M) memcpy
(&V, (M),
sizeof(double))
#define doublestore(T,V) memcpy
((T), (void *) &V,
sizeof(double))
#define longlongget(V,M) memcpy
(&V, (M),
sizeof(ulonglong))
#define longlongstore(T,V) memcpy
((T), &V,
sizeof(ulonglong))
#else
...
...
@@ -1350,15 +1338,15 @@ do { doubleget_union _tmp; \
#define shortstore(T,V) int2store(T,V)
#define longstore(T,V) int4store(T,V)
#ifndef floatstore
#define floatstore(T,V) memcpy
_fixed((uchar*) (T),(uchar*) (&V),
sizeof(float))
#define floatget(V,M) memcpy
_fixed((uchar*) &V, (uchar*)
(M), sizeof(float))
#define floatstore(T,V) memcpy
((T), (void *) (&V),
sizeof(float))
#define floatget(V,M) memcpy
(&V,
(M), sizeof(float))
#endif
#ifndef doubleget
#define doubleget(V,M) memcpy
_fixed((uchar*) &V,(uchar*) (M),
sizeof(double))
#define doublestore(T,V) memcpy
_fixed((uchar*) (T),(uchar*) &V,
sizeof(double))
#define doubleget(V,M) memcpy
(&V, (M),
sizeof(double))
#define doublestore(T,V) memcpy
((T), (void *) &V,
sizeof(double))
#endif
/* doubleget */
#define longlongget(V,M) memcpy
_fixed((uchar*) &V,(uchar*) (M),
sizeof(ulonglong))
#define longlongstore(T,V) memcpy
_fixed((uchar*) (T),(uchar*) &V,
sizeof(ulonglong))
#define longlongget(V,M) memcpy
(&V, (M),
sizeof(ulonglong))
#define longlongstore(T,V) memcpy
((T), &V,
sizeof(ulonglong))
#endif
/* WORDS_BIGENDIAN */
...
...
mysys/default.c
View file @
e8150697
...
...
@@ -575,7 +575,7 @@ int my_load_defaults(const char *conf_file, const char **groups,
void
free_defaults
(
char
**
argv
)
{
MEM_ROOT
ptr
;
memcpy
_fixed
((
char
*
)
&
ptr
,(
char
*
)
argv
-
sizeof
(
ptr
),
sizeof
(
ptr
));
memcpy
(
&
ptr
,
((
char
*
)
argv
)
-
sizeof
(
ptr
),
sizeof
(
ptr
));
free_root
(
&
ptr
,
MYF
(
0
));
}
...
...
mysys/my_pthread.c
View file @
e8150697
...
...
@@ -138,7 +138,7 @@ void sigwait_setup(sigset_t *set)
sact
.
sa_flags
=
0
;
sact
.
sa_handler
=
px_handle_sig
;
memcpy
_fixed
(
&
sact
.
sa_mask
,
set
,
sizeof
(
*
set
));
/* handler isn't thread_safe */
memcpy
(
&
sact
.
sa_mask
,
set
,
sizeof
(
*
set
));
/* handler isn't thread_safe */
sigemptyset
(
&
unblock_mask
);
pthread_sigmask
(
SIG_UNBLOCK
,(
sigset_t
*
)
0
,
&
rev_sigwait_set
);
...
...
@@ -164,7 +164,7 @@ void sigwait_setup(sigset_t *set)
}
}
}
memcpy
_fixed
(
&
sigwait_set
,
set
,
sizeof
(
*
set
));
memcpy
(
&
sigwait_set
,
set
,
sizeof
(
*
set
));
pthread_sigmask
(
SIG_BLOCK
,(
sigset_t
*
)
set
,(
sigset_t
*
)
0
);
pthread_sigmask
(
SIG_UNBLOCK
,
&
unblock_mask
,(
sigset_t
*
)
0
);
}
...
...
@@ -252,7 +252,7 @@ void *sigwait_thread(void *set_arg)
struct
sigaction
sact
;
sact
.
sa_flags
=
0
;
sact
.
sa_handler
=
sigwait_handle_sig
;
memcpy
_fixed
(
&
sact
.
sa_mask
,
set
,
sizeof
(
*
set
));
/* handler isn't thread_safe */
memcpy
(
&
sact
.
sa_mask
,
set
,
sizeof
(
*
set
));
/* handler isn't thread_safe */
sigemptyset
(
&
pending_set
);
for
(
i
=
1
;
i
<=
sizeof
(
pending_set
)
*
8
;
i
++
)
...
...
sql/field.cc
View file @
e8150697
...
...
@@ -4143,7 +4143,7 @@ int Field_float::store(double nr)
}
else
#endif
memcpy
_fixed
(
ptr
,(
uchar
*
)
&
j
,
sizeof
(
j
));
memcpy
(
ptr
,
&
j
,
sizeof
(
j
));
return
error
;
}
...
...
@@ -4166,7 +4166,7 @@ double Field_float::val_real(void)
}
else
#endif
memcpy
_fixed
((
uchar
*
)
&
j
,
ptr
,
sizeof
(
j
));
memcpy
(
&
j
,
ptr
,
sizeof
(
j
));
return
((
double
)
j
);
}
...
...
@@ -4180,7 +4180,7 @@ longlong Field_float::val_int(void)
}
else
#endif
memcpy
_fixed
((
uchar
*
)
&
j
,
ptr
,
sizeof
(
j
));
memcpy
(
&
j
,
ptr
,
sizeof
(
j
));
return
(
longlong
)
rint
(
j
);
}
...
...
@@ -4197,7 +4197,7 @@ String *Field_float::val_str(String *val_buffer,
}
else
#endif
memcpy
_fixed
((
uchar
*
)
&
nr
,
ptr
,
sizeof
(
nr
));
memcpy
(
&
nr
,
ptr
,
sizeof
(
nr
));
uint
to_length
=
max
(
field_length
,
70
);
val_buffer
->
alloc
(
to_length
);
...
...
@@ -4235,8 +4235,8 @@ int Field_float::cmp(const uchar *a_ptr, const uchar *b_ptr)
else
#endif
{
memcpy
_fixed
(
&
a
,
a_ptr
,
sizeof
(
float
));
memcpy
_fixed
(
&
b
,
b_ptr
,
sizeof
(
float
));
memcpy
(
&
a
,
a_ptr
,
sizeof
(
float
));
memcpy
(
&
b
,
b_ptr
,
sizeof
(
float
));
}
return
(
a
<
b
)
?
-
1
:
(
a
>
b
)
?
1
:
0
;
}
...
...
@@ -4253,7 +4253,7 @@ void Field_float::sort_string(uchar *to,uint length __attribute__((unused)))
}
else
#endif
memcpy
_fixed
(
&
nr
,
ptr
,
sizeof
(
float
));
memcpy
(
&
nr
,
ptr
,
sizeof
(
float
));
uchar
*
tmp
=
to
;
if
(
nr
==
(
float
)
0.0
)
...
...
@@ -4264,7 +4264,7 @@ void Field_float::sort_string(uchar *to,uint length __attribute__((unused)))
else
{
#ifdef WORDS_BIGENDIAN
memcpy
_fixed
(
tmp
,
&
nr
,
sizeof
(
nr
));
memcpy
(
tmp
,
&
nr
,
sizeof
(
nr
));
#else
tmp
[
0
]
=
ptr
[
3
];
tmp
[
1
]
=
ptr
[
2
];
tmp
[
2
]
=
ptr
[
1
];
tmp
[
3
]
=
ptr
[
0
];
#endif
...
...
@@ -7442,7 +7442,7 @@ double Field_blob::val_real(void)
uint32
length
;
CHARSET_INFO
*
cs
;
memcpy
_fixed
(
&
blob
,
ptr
+
packlength
,
sizeof
(
char
*
));
memcpy
(
&
blob
,
ptr
+
packlength
,
sizeof
(
char
*
));
if
(
!
blob
)
return
0.0
;
length
=
get_length
(
ptr
);
...
...
@@ -7456,7 +7456,7 @@ longlong Field_blob::val_int(void)
ASSERT_COLUMN_MARKED_FOR_READ
;
int
not_used
;
char
*
blob
;
memcpy
_fixed
(
&
blob
,
ptr
+
packlength
,
sizeof
(
char
*
));
memcpy
(
&
blob
,
ptr
+
packlength
,
sizeof
(
char
*
));
if
(
!
blob
)
return
0
;
uint32
length
=
get_length
(
ptr
);
...
...
@@ -7468,7 +7468,7 @@ String *Field_blob::val_str(String *val_buffer __attribute__((unused)),
{
ASSERT_COLUMN_MARKED_FOR_READ
;
char
*
blob
;
memcpy
_fixed
(
&
blob
,
ptr
+
packlength
,
sizeof
(
char
*
));
memcpy
(
&
blob
,
ptr
+
packlength
,
sizeof
(
char
*
));
if
(
!
blob
)
val_ptr
->
set
(
""
,
0
,
charset
());
// A bit safer than ->length(0)
else
...
...
@@ -7482,7 +7482,7 @@ my_decimal *Field_blob::val_decimal(my_decimal *decimal_value)
ASSERT_COLUMN_MARKED_FOR_READ
;
const
char
*
blob
;
size_t
length
;
memcpy
_fixed
(
&
blob
,
ptr
+
packlength
,
sizeof
(
const
uchar
*
));
memcpy
(
&
blob
,
ptr
+
packlength
,
sizeof
(
const
uchar
*
));
if
(
!
blob
)
{
blob
=
""
;
...
...
@@ -7510,8 +7510,8 @@ int Field_blob::cmp_max(const uchar *a_ptr, const uchar *b_ptr,
uint
max_length
)
{
uchar
*
blob1
,
*
blob2
;
memcpy
_fixed
(
&
blob1
,
a_ptr
+
packlength
,
sizeof
(
char
*
));
memcpy
_fixed
(
&
blob2
,
b_ptr
+
packlength
,
sizeof
(
char
*
));
memcpy
(
&
blob1
,
a_ptr
+
packlength
,
sizeof
(
char
*
));
memcpy
(
&
blob2
,
b_ptr
+
packlength
,
sizeof
(
char
*
));
uint
a_len
=
get_length
(
a_ptr
),
b_len
=
get_length
(
b_ptr
);
set_if_smaller
(
a_len
,
max_length
);
set_if_smaller
(
b_len
,
max_length
);
...
...
@@ -7525,8 +7525,8 @@ int Field_blob::cmp_binary(const uchar *a_ptr, const uchar *b_ptr,
char
*
a
,
*
b
;
uint
diff
;
uint32
a_length
,
b_length
;
memcpy
_fixed
(
&
a
,
a_ptr
+
packlength
,
sizeof
(
char
*
));
memcpy
_fixed
(
&
b
,
b_ptr
+
packlength
,
sizeof
(
char
*
));
memcpy
(
&
a
,
a_ptr
+
packlength
,
sizeof
(
char
*
));
memcpy
(
&
b
,
b_ptr
+
packlength
,
sizeof
(
char
*
));
a_length
=
get_length
(
a_ptr
);
if
(
a_length
>
max_length
)
a_length
=
max_length
;
...
...
@@ -7607,7 +7607,7 @@ int Field_blob::key_cmp(const uchar *key_ptr, uint max_key_length)
{
uchar
*
blob1
;
uint
blob_length
=
get_length
(
ptr
);
memcpy
_fixed
(
&
blob1
,
ptr
+
packlength
,
sizeof
(
char
*
));
memcpy
(
&
blob1
,
ptr
+
packlength
,
sizeof
(
char
*
));
CHARSET_INFO
*
cs
=
charset
();
uint
local_char_length
=
max_key_length
/
cs
->
mbmaxlen
;
local_char_length
=
my_charpos
(
cs
,
blob1
,
blob1
+
blob_length
,
...
...
@@ -7685,7 +7685,7 @@ void Field_blob::sort_string(uchar *to,uint length)
break
;
}
}
memcpy
_fixed
(
&
blob
,
ptr
+
packlength
,
sizeof
(
char
*
));
memcpy
(
&
blob
,
ptr
+
packlength
,
sizeof
(
char
*
));
blob_length
=
my_strnxfrm
(
field_charset
,
to
,
length
,
blob
,
blob_length
);
...
...
@@ -8654,7 +8654,7 @@ String *Field_bit::val_str(String *val_buffer,
mi_int8store
(
buff
,
bits
);
val_buffer
->
alloc
(
length
);
memcpy
_fixed
((
char
*
)
val_buffer
->
ptr
(),
buff
+
8
-
length
,
length
);
memcpy
((
char
*
)
val_buffer
->
ptr
(),
buff
+
8
-
length
,
length
);
val_buffer
->
length
(
length
);
val_buffer
->
set_charset
(
&
my_charset_bin
);
return
val_buffer
;
...
...
sql/field.h
View file @
e8150697
...
...
@@ -1762,22 +1762,22 @@ public:
void
put_length
(
uchar
*
pos
,
uint32
length
);
inline
void
get_ptr
(
uchar
**
str
)
{
memcpy
_fixed
((
uchar
*
)
str
,
ptr
+
packlength
,
sizeof
(
uchar
*
));
memcpy
(
str
,
ptr
+
packlength
,
sizeof
(
uchar
*
));
}
inline
void
get_ptr
(
uchar
**
str
,
uint
row_offset
)
{
memcpy
_fixed
((
uchar
*
)
str
,
ptr
+
packlength
+
row_offset
,
sizeof
(
char
*
));
memcpy
(
str
,
ptr
+
packlength
+
row_offset
,
sizeof
(
char
*
));
}
inline
void
set_ptr
(
uchar
*
length
,
uchar
*
data
)
{
memcpy
(
ptr
,
length
,
packlength
);
memcpy
_fixed
(
ptr
+
packlength
,
&
data
,
sizeof
(
char
*
));
memcpy
(
ptr
+
packlength
,
&
data
,
sizeof
(
char
*
));
}
void
set_ptr_offset
(
my_ptrdiff_t
ptr_diff
,
uint32
length
,
uchar
*
data
)
{
uchar
*
ptr_ofs
=
ADD_TO_PTR
(
ptr
,
ptr_diff
,
uchar
*
);
store_length
(
ptr_ofs
,
packlength
,
length
);
memcpy
_fixed
(
ptr_ofs
+
packlength
,
&
data
,
sizeof
(
char
*
));
memcpy
(
ptr_ofs
+
packlength
,
&
data
,
sizeof
(
char
*
));
}
inline
void
set_ptr
(
uint32
length
,
uchar
*
data
)
{
...
...
@@ -1796,7 +1796,7 @@ public:
return
1
;
}
tmp
=
(
uchar
*
)
value
.
ptr
();
memcpy
_fixed
(
ptr
+
packlength
,
&
tmp
,
sizeof
(
char
*
));
memcpy
(
ptr
+
packlength
,
&
tmp
,
sizeof
(
char
*
));
return
0
;
}
virtual
uchar
*
pack
(
uchar
*
to
,
const
uchar
*
from
,
...
...
sql/field_conv.cc
View file @
e8150697
...
...
@@ -286,7 +286,7 @@ static void do_copy_blob(Copy_field *copy)
{
ulong
length
=
((
Field_blob
*
)
copy
->
from_field
)
->
get_length
();
((
Field_blob
*
)
copy
->
to_field
)
->
store_length
(
length
);
memcpy
_fixed
(
copy
->
to_ptr
,
copy
->
from_ptr
,
sizeof
(
char
*
));
memcpy
(
copy
->
to_ptr
,
copy
->
from_ptr
,
sizeof
(
char
*
));
}
static
void
do_conv_blob
(
Copy_field
*
copy
)
...
...
sql/filesort.cc
View file @
e8150697
...
...
@@ -1665,7 +1665,7 @@ void change_double_for_sort(double nr,uchar *to)
else
{
#ifdef WORDS_BIGENDIAN
memcpy
_fixed
(
tmp
,
&
nr
,
sizeof
(
nr
));
memcpy
(
tmp
,
&
nr
,
sizeof
(
nr
));
#else
{
uchar
*
ptr
=
(
uchar
*
)
&
nr
;
...
...
sql/hostname.cc
View file @
e8150697
...
...
@@ -126,7 +126,7 @@ static void prepare_hostname_cache_key(const char *ip_string,
DBUG_ASSERT
(
ip_string_length
<
HOST_ENTRY_KEY_SIZE
);
memset
(
ip_key
,
0
,
HOST_ENTRY_KEY_SIZE
);
memcpy
_fixed
(
ip_key
,
ip_string
,
ip_string_length
);
memcpy
(
ip_key
,
ip_string
,
ip_string_length
);
}
static
inline
Host_entry
*
hostname_cache_search
(
const
char
*
ip_key
)
...
...
@@ -148,7 +148,7 @@ static bool add_hostname_impl(const char *ip_key, const char *hostname)
char
*
hostname_copy
;
memcpy
_fixed
(
&
entry
->
ip_key
,
ip_key
,
HOST_ENTRY_KEY_SIZE
);
memcpy
(
&
entry
->
ip_key
,
ip_key
,
HOST_ENTRY_KEY_SIZE
);
if
(
hostname_size
)
{
...
...
sql/udf_example.c
View file @
e8150697
...
...
@@ -133,7 +133,6 @@ typedef long long longlong;
#include <string.h>
#define strmov(a,b) stpcpy(a,b)
#define bzero(a,b) memset(a,0,b)
#define memcpy_fixed(a,b,c) memcpy(a,b,c)
#endif
#endif
#include <mysql.h>
...
...
@@ -778,7 +777,7 @@ char *lookup(UDF_INIT *initid __attribute__((unused)), UDF_ARGS *args,
}
pthread_mutex_unlock
(
&
LOCK_hostname
);
#endif
memcpy
_fixed
((
char
*
)
&
in
,(
char
*
)
*
hostent
->
h_addr_list
,
sizeof
(
in
.
s_addr
));
memcpy
(
&
in
,
*
hostent
->
h_addr_list
,
sizeof
(
in
.
s_addr
));
*
res_length
=
(
ulong
)
(
strmov
(
result
,
inet_ntoa
(
in
))
-
result
);
return
result
;
}
...
...
storage/csv/ha_tina.cc
View file @
e8150697
...
...
@@ -807,15 +807,15 @@ int ha_tina::find_current_row(uchar *buf)
Field_blob
*
blob
=
*
(
Field_blob
**
)
field
;
uchar
*
src
,
*
tgt
;
uint
length
,
packlength
;
packlength
=
blob
->
pack_length_no_ptr
();
length
=
blob
->
get_length
(
blob
->
ptr
);
memcpy
_fixed
(
&
src
,
blob
->
ptr
+
packlength
,
sizeof
(
char
*
));
memcpy
(
&
src
,
blob
->
ptr
+
packlength
,
sizeof
(
char
*
));
if
(
src
)
{
tgt
=
(
uchar
*
)
alloc_root
(
&
blobroot
,
length
);
bmove
(
tgt
,
src
,
length
);
memcpy
_fixed
(
blob
->
ptr
+
packlength
,
&
tgt
,
sizeof
(
char
*
));
memcpy
(
blob
->
ptr
+
packlength
,
&
tgt
,
sizeof
(
char
*
));
}
}
}
...
...
storage/federated/ha_federated.cc
View file @
e8150697
...
...
@@ -2752,9 +2752,9 @@ void ha_federated::position(const uchar *record __attribute__ ((unused)))
position_called
=
TRUE
;
/* Store result set address. */
memcpy
_fixed
(
ref
,
&
stored_result
,
sizeof
(
MYSQL_RES
*
));
memcpy
(
ref
,
&
stored_result
,
sizeof
(
MYSQL_RES
*
));
/* Store data cursor position. */
memcpy
_fixed
(
ref
+
sizeof
(
MYSQL_RES
*
),
&
current_position
,
memcpy
(
ref
+
sizeof
(
MYSQL_RES
*
),
&
current_position
,
sizeof
(
MYSQL_ROW_OFFSET
));
DBUG_VOID_RETURN
;
}
...
...
@@ -2780,11 +2780,11 @@ int ha_federated::rnd_pos(uchar *buf, uchar *pos)
ha_statistic_increment
(
&
SSV
::
ha_read_rnd_count
);
/* Get stored result set. */
memcpy
_fixed
(
&
result
,
pos
,
sizeof
(
MYSQL_RES
*
));
memcpy
(
&
result
,
pos
,
sizeof
(
MYSQL_RES
*
));
DBUG_ASSERT
(
result
);
/* Set data cursor position. */
memcpy
_fixed
(
&
result
->
data_cursor
,
pos
+
sizeof
(
MYSQL_RES
*
),
sizeof
(
MYSQL_ROW_OFFSET
));
memcpy
(
&
result
->
data_cursor
,
pos
+
sizeof
(
MYSQL_RES
*
),
sizeof
(
MYSQL_ROW_OFFSET
));
/* Read a row. */
ret_val
=
read_next
(
buf
,
result
);
MYSQL_READ_ROW_DONE
(
ret_val
);
...
...
storage/heap/ha_heap.cc
View file @
e8150697
...
...
@@ -390,7 +390,7 @@ int ha_heap::rnd_pos(uchar * buf, uchar *pos)
MYSQL_READ_ROW_START
(
table_share
->
db
.
str
,
table_share
->
table_name
.
str
,
FALSE
);
ha_statistic_increment
(
&
SSV
::
ha_read_rnd_count
);
memcpy
_fixed
((
char
*
)
&
heap_position
,
pos
,
sizeof
(
HEAP_PTR
));
memcpy
(
&
heap_position
,
pos
,
sizeof
(
HEAP_PTR
));
error
=
heap_rrnd
(
file
,
buf
,
heap_position
);
table
->
status
=
error
?
STATUS_NOT_FOUND
:
0
;
MYSQL_READ_ROW_DONE
(
error
);
...
...
storage/myisam/ft_parser.c
View file @
e8150697
...
...
@@ -39,7 +39,7 @@ static int walk_and_copy(FT_WORD *word,uint32 count,FT_DOCSTAT *docstat)
{
word
->
weight
=
LWS_IN_USE
;
docstat
->
sum
+=
word
->
weight
;
memcpy
_fixed
((
docstat
->
list
)
++
,
word
,
sizeof
(
FT_WORD
));
memcpy
((
docstat
->
list
)
++
,
word
,
sizeof
(
FT_WORD
));
return
0
;
}
...
...
storage/myisam/ft_update.c
View file @
e8150697
...
...
@@ -83,8 +83,7 @@ uint _mi_ft_segiterator(register FT_SEG_ITERATOR *ftsi)
if
(
ftsi
->
seg
->
flag
&
HA_BLOB_PART
)
{
ftsi
->
len
=
_mi_calc_blob_length
(
ftsi
->
seg
->
bit_start
,
ftsi
->
pos
);
memcpy_fixed
((
char
*
)
&
ftsi
->
pos
,
ftsi
->
pos
+
ftsi
->
seg
->
bit_start
,
sizeof
(
char
*
));
memcpy
(
&
ftsi
->
pos
,
ftsi
->
pos
+
ftsi
->
seg
->
bit_start
,
sizeof
(
char
*
));
DBUG_RETURN
(
1
);
}
ftsi
->
len
=
ftsi
->
seg
->
length
;
...
...
storage/myisam/mi_dynrec.c
View file @
e8150697
...
...
@@ -995,7 +995,7 @@ uint _mi_rec_pack(MI_INFO *info, register uchar *to,
char
*
temp_pos
;
size_t
tmp_length
=
length
-
portable_sizeof_char_ptr
;
memcpy
((
uchar
*
)
to
,
from
,
tmp_length
);
memcpy
_fixed
(
&
temp_pos
,
from
+
tmp_length
,
sizeof
(
char
*
));
memcpy
(
&
temp_pos
,
from
+
tmp_length
,
sizeof
(
char
*
));
memcpy
(
to
+
tmp_length
,
temp_pos
,(
size_t
)
blob
->
length
);
to
+=
tmp_length
+
blob
->
length
;
}
...
...
@@ -1310,9 +1310,9 @@ ulong _mi_rec_unpack(register MI_INFO *info, register uchar *to, uchar *from,
from_left
-
size_length
<
blob_length
||
from_left
-
size_length
-
blob_length
<
min_pack_length
)
goto
err
;
memcpy
(
(
uchar
*
)
to
,(
uchar
*
)
from
,
(
size_t
)
size_length
);
memcpy
(
to
,
from
,
(
size_t
)
size_length
);
from
+=
size_length
;
memcpy
_fixed
((
uchar
*
)
to
+
size_length
,(
uchar
*
)
&
from
,
sizeof
(
char
*
));
memcpy
(
to
+
size_length
,
&
from
,
sizeof
(
char
*
));
from
+=
blob_length
;
}
else
...
...
storage/myisam/mi_key.c
View file @
e8150697
...
...
@@ -139,7 +139,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
else
if
(
keyseg
->
flag
&
HA_BLOB_PART
)
{
uint
tmp_length
=
_mi_calc_blob_length
(
keyseg
->
bit_start
,
pos
);
memcpy
_fixed
((
uchar
*
)
&
pos
,
pos
+
keyseg
->
bit_start
,
sizeof
(
char
*
));
memcpy
(
&
pos
,
pos
+
keyseg
->
bit_start
,
sizeof
(
char
*
));
set_if_smaller
(
length
,
tmp_length
);
FIX_LENGTH
(
cs
,
pos
,
length
,
char_length
);
store_key_length_inc
(
key
,
char_length
);
...
...
storage/myisam/mi_log.c
View file @
e8150697
...
...
@@ -149,7 +149,7 @@ void _myisam_log_record(enum myisam_log_commands command, MI_INFO *info,
blob
!=
end
;
blob
++
)
{
memcpy
_fixed
((
uchar
*
)
&
pos
,
record
+
blob
->
offset
+
blob
->
pack_length
,
memcpy
(
&
pos
,
record
+
blob
->
offset
+
blob
->
pack_length
,
sizeof
(
char
*
));
(
void
)
mysql_file_write
(
myisam_log_file
,
pos
,
blob
->
length
,
MYF
(
0
));
}
...
...
storage/myisam/mi_open.c
View file @
e8150697
...
...
@@ -858,7 +858,7 @@ uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite)
key_blocks
=
state
->
header
.
max_block_size_index
;
DBUG_ENTER
(
"mi_state_info_write"
);
memcpy
_fixed
(
ptr
,
&
state
->
header
,
sizeof
(
state
->
header
));
memcpy
(
ptr
,
&
state
->
header
,
sizeof
(
state
->
header
));
ptr
+=
sizeof
(
state
->
header
);
/* open_count must be first because of _mi_mark_file_changed ! */
...
...
@@ -917,7 +917,7 @@ uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite)
uchar
*
mi_state_info_read
(
uchar
*
ptr
,
MI_STATE_INFO
*
state
)
{
uint
i
,
keys
,
key_parts
,
key_blocks
;
memcpy
_fixed
(
&
state
->
header
,
ptr
,
sizeof
(
state
->
header
));
memcpy
(
&
state
->
header
,
ptr
,
sizeof
(
state
->
header
));
ptr
+=
sizeof
(
state
->
header
);
keys
=
(
uint
)
state
->
header
.
keys
;
key_parts
=
mi_uint2korr
(
state
->
header
.
key_parts
);
...
...
storage/myisam/mi_packrec.c
View file @
e8150697
...
...
@@ -1051,8 +1051,7 @@ static void uf_blob(MI_COLUMNDEF *rec, MI_BIT_BUFF *bit_buff,
}
decode_bytes
(
rec
,
bit_buff
,
bit_buff
->
blob_pos
,
bit_buff
->
blob_pos
+
length
);
_my_store_blob_length
((
uchar
*
)
to
,
pack_length
,
length
);
memcpy_fixed
((
char
*
)
to
+
pack_length
,(
char
*
)
&
bit_buff
->
blob_pos
,
sizeof
(
char
*
));
memcpy
((
char
*
)
to
+
pack_length
,
&
bit_buff
->
blob_pos
,
sizeof
(
char
*
));
bit_buff
->
blob_pos
+=
length
;
}
}
...
...
storage/myisam/mi_test1.c
View file @
e8150697
...
...
@@ -411,7 +411,7 @@ static void create_record(uchar *record,uint rownr)
tmp
=
strlen
((
char
*
)
blob_key
);
int4store
(
pos
,
tmp
);
ptr
=
blob_key
;
memcpy
_fixed
(
pos
+
4
,
&
ptr
,
sizeof
(
char
*
));
memcpy
(
pos
+
4
,
&
ptr
,
sizeof
(
char
*
));
pos
+=
recinfo
[
1
].
length
;
}
else
if
(
recinfo
[
1
].
type
==
FIELD_VARCHAR
)
...
...
@@ -439,7 +439,7 @@ static void create_record(uchar *record,uint rownr)
tmp
=
strlen
((
char
*
)
blob_record
);
int4store
(
pos
,
tmp
);
ptr
=
blob_record
;
memcpy
_fixed
(
pos
+
4
,
&
ptr
,
sizeof
(
char
*
));
memcpy
(
pos
+
4
,
&
ptr
,
sizeof
(
char
*
));
}
else
if
(
recinfo
[
2
].
type
==
FIELD_VARCHAR
)
{
...
...
@@ -468,10 +468,10 @@ static void update_record(uchar *record)
uchar
*
column
,
*
ptr
;
int
length
;
length
=
uint4korr
(
pos
);
/* Long blob */
memcpy
_fixed
(
&
column
,
pos
+
4
,
sizeof
(
char
*
));
memcpy
(
&
column
,
pos
+
4
,
sizeof
(
char
*
));
memcpy
(
blob_key
,
column
,
length
);
/* Move old key */
ptr
=
blob_key
;
memcpy
_fixed
(
pos
+
4
,
&
ptr
,
sizeof
(
char
*
));
/* Store pointer to new key */
memcpy
(
pos
+
4
,
&
ptr
,
sizeof
(
char
*
));
/* Store pointer to new key */
if
(
keyinfo
[
0
].
seg
[
0
].
type
!=
HA_KEYTYPE_NUM
)
default_charset_info
->
cset
->
casedn
(
default_charset_info
,
(
char
*
)
blob_key
,
length
,
...
...
@@ -501,13 +501,13 @@ static void update_record(uchar *record)
uchar
*
column
;
int
length
;
length
=
uint4korr
(
pos
);
memcpy
_fixed
(
&
column
,
pos
+
4
,
sizeof
(
char
*
));
memcpy
(
&
column
,
pos
+
4
,
sizeof
(
char
*
));
memcpy
(
blob_record
,
column
,
length
);
bfill
(
blob_record
+
length
,
20
,
'.'
);
/* Make it larger */
length
+=
20
;
int4store
(
pos
,
length
);
column
=
blob_record
;
memcpy
_fixed
(
pos
+
4
,
&
column
,
sizeof
(
char
*
));
memcpy
(
pos
+
4
,
&
column
,
sizeof
(
char
*
));
}
else
if
(
recinfo
[
2
].
type
==
FIELD_VARCHAR
)
{
...
...
storage/myisam/mi_test2.c
View file @
e8150697
...
...
@@ -1030,7 +1030,7 @@ static void put_blob_in_record(uchar *blob_pos, char **blob_buffer)
for
(
i
=
0
;
i
<
length
;
i
++
)
(
*
blob_buffer
)[
i
]
=
(
char
)
(
length
+
i
);
int4store
(
blob_pos
,
length
);
memcpy
_fixed
(
blob_pos
+
4
,(
char
*
)
blob_buffer
,
sizeof
(
char
*
));
memcpy
(
blob_pos
+
4
,
blob_buffer
,
sizeof
(
char
*
));
}
else
{
...
...
storage/myisam/mi_test3.c
View file @
e8150697
...
...
@@ -458,7 +458,7 @@ int test_update(MI_INFO *file,int id,int lock_type)
}
}
}
memcpy
_fixed
(
new_record
.
id
,
record
.
id
,
sizeof
(
record
.
id
));
memcpy
(
new_record
.
id
,
record
.
id
,
sizeof
(
record
.
id
));
tmp
=
rnd
(
20000
)
+
40000
;
int4store
(
new_record
.
nr
,
tmp
);
if
(
!
mi_update
(
file
,
record
.
id
,
new_record
.
id
))
...
...
storage/myisam/mi_unique.c
View file @
e8150697
...
...
@@ -111,7 +111,7 @@ ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const uchar *record)
else
if
(
keyseg
->
flag
&
HA_BLOB_PART
)
{
uint
tmp_length
=
_mi_calc_blob_length
(
keyseg
->
bit_start
,
pos
);
memcpy
_fixed
((
uchar
*
)
&
pos
,
pos
+
keyseg
->
bit_start
,
sizeof
(
char
*
));
memcpy
(
&
pos
,
pos
+
keyseg
->
bit_start
,
sizeof
(
char
*
));
if
(
!
length
||
length
>
tmp_length
)
length
=
tmp_length
;
/* The whole blob */
}
...
...
@@ -206,8 +206,8 @@ int mi_unique_comp(MI_UNIQUEDEF *def, const uchar *a, const uchar *b,
set_if_smaller
(
a_length
,
keyseg
->
length
);
set_if_smaller
(
b_length
,
keyseg
->
length
);
}
memcpy
_fixed
((
uchar
*
)
&
pos_a
,
pos_a
+
keyseg
->
bit_start
,
sizeof
(
char
*
));
memcpy
_fixed
((
uchar
*
)
&
pos_b
,
pos_b
+
keyseg
->
bit_start
,
sizeof
(
char
*
));
memcpy
(
&
pos_a
,
pos_a
+
keyseg
->
bit_start
,
sizeof
(
char
*
));
memcpy
(
&
pos_b
,
pos_b
+
keyseg
->
bit_start
,
sizeof
(
char
*
));
}
if
(
type
==
HA_KEYTYPE_TEXT
||
type
==
HA_KEYTYPE_VARTEXT1
||
type
==
HA_KEYTYPE_VARTEXT2
)
...
...
storage/myisam/myisamlog.c
View file @
e8150697
...
...
@@ -619,7 +619,7 @@ static int examine_log(char * file_name, char **table_names)
case
MI_LOG_LOCK
:
if
(
my_b_read
(
&
cache
,(
uchar
*
)
head
,
sizeof
(
lock_command
)))
goto
err
;
memcpy
_fixed
(
&
lock_command
,
head
,
sizeof
(
lock_command
));
memcpy
(
&
lock_command
,
head
,
sizeof
(
lock_command
));
if
(
verbose
&&
!
record_pos_file
&&
(
!
table_names
[
0
]
||
(
curr_file_info
&&
curr_file_info
->
used
)))
printf_log
(
"%s: %s(%d) -> %d
\n
"
,
FILENAME
(
curr_file_info
),
...
...
@@ -728,7 +728,7 @@ static void fix_blob_pointers(MI_INFO *info, uchar *record)
blob
!=
end
;
blob
++
)
{
memcpy
_fixed
(
record
+
blob
->
offset
+
blob
->
pack_length
,
&
pos
,
sizeof
(
char
*
));
memcpy
(
record
+
blob
->
offset
+
blob
->
pack_length
,
&
pos
,
sizeof
(
char
*
));
pos
+=
_mi_calc_blob_length
(
blob
->
pack_length
,
record
+
blob
->
offset
);
}
}
...
...
storage/myisam/myisampack.c
View file @
e8150697
...
...
@@ -1040,7 +1040,7 @@ static int get_statistic(PACK_MRG_INFO *mrg,HUFF_COUNTS *huff_counts)
{
uint
field_length
=
count
->
field_length
-
portable_sizeof_char_ptr
;
ulong
blob_length
=
_mi_calc_blob_length
(
field_length
,
start_pos
);
memcpy
_fixed
((
char
*
)
&
pos
,
start_pos
+
field_length
,
sizeof
(
char
*
));
memcpy
(
&
pos
,
start_pos
+
field_length
,
sizeof
(
char
*
));
end_pos
=
pos
+
blob_length
;
tot_blob_length
+=
blob_length
;
set_if_bigger
(
count
->
max_length
,
blob_length
);
...
...
@@ -1889,7 +1889,7 @@ static uint join_same_trees(HUFF_COUNTS *huff_counts, uint trees)
i
->
tree
->
tree_pack_length
+
j
->
tree
->
tree_pack_length
+
ALLOWED_JOIN_DIFF
)
{
memcpy
_fixed
((
uchar
*
)
i
->
counts
,(
uchar
*
)
count
.
counts
,
memcpy
(
i
->
counts
,
count
.
counts
,
sizeof
(
count
.
counts
[
0
])
*
256
);
my_free
(
j
->
tree
->
element_buffer
);
j
->
tree
->
element_buffer
=
0
;
...
...
@@ -2040,7 +2040,7 @@ static int write_header(PACK_MRG_INFO *mrg,uint head_length,uint trees,
uchar
*
buff
=
(
uchar
*
)
file_buffer
.
pos
;
bzero
(
buff
,
HEAD_LENGTH
);
memcpy
_fixed
(
buff
,
myisam_pack_file_magic
,
4
);
memcpy
(
buff
,
myisam_pack_file_magic
,
4
);
int4store
(
buff
+
4
,
head_length
);
int4store
(
buff
+
8
,
mrg
->
min_pack_length
);
int4store
(
buff
+
12
,
mrg
->
max_pack_length
);
...
...
@@ -2697,8 +2697,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
DBUG_PRINT
(
"fields"
,
(
"FIELD_BLOB %lu bytes, bits: %2u"
,
blob_length
,
count
->
length_bits
));
write_bits
(
blob_length
,
count
->
length_bits
);
memcpy_fixed
(
&
blob
,
end_pos
-
portable_sizeof_char_ptr
,
sizeof
(
char
*
));
memcpy
(
&
blob
,
end_pos
-
portable_sizeof_char_ptr
,
sizeof
(
char
*
));
blob_end
=
blob
+
blob_length
;
/* Encode the blob bytes. */
for
(
;
blob
<
blob_end
;
blob
++
)
...
...
storage/myisam/sp_key.c
View file @
e8150697
...
...
@@ -47,7 +47,7 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key,
pos
=
(
uchar
*
)
record
+
keyseg
->
start
;
dlen
=
_mi_calc_blob_length
(
keyseg
->
bit_start
,
pos
);
memcpy
_fixed
(
&
dptr
,
pos
+
keyseg
->
bit_start
,
sizeof
(
char
*
));
memcpy
(
&
dptr
,
pos
+
keyseg
->
bit_start
,
sizeof
(
char
*
));
if
(
!
dptr
)
{
my_errno
=
HA_ERR_NULL_IN_SPATIAL
;
...
...
storage/myisam/sp_test.c
View file @
e8150697
...
...
@@ -310,7 +310,7 @@ static void print_record(uchar * record, my_off_t offs,const char * tail)
len
=
sint4korr
(
pos
);
pos
+=
4
;
printf
(
" len=%d "
,
len
);
memcpy
_fixed
(
&
ptr
,
pos
,
sizeof
(
char
*
));
memcpy
(
&
ptr
,
pos
,
sizeof
(
char
*
));
if
(
ptr
)
rtree_PrintWKB
((
uchar
*
)
ptr
,
SPDIMS
);
else
...
...
@@ -328,23 +328,23 @@ static void create_linestring(uchar *record,uint rownr)
double
x
[
200
];
int
i
,
j
;
int
npoints
=
2
;
for
(
j
=
0
;
j
<
npoints
;
j
++
)
for
(
i
=
0
;
i
<
SPDIMS
;
i
++
)
x
[
i
+
j
*
SPDIMS
]
=
rownr
*
j
;
bzero
((
char
*
)
record
,
MAX_REC_LENGTH
);
*
pos
=
0x01
;
/* DEL marker */
pos
++
;
memset
(
blob_key
,
0
,
sizeof
(
blob_key
));
tmp
=
rtree_CreateLineStringWKB
(
x
,
SPDIMS
,
npoints
,
(
uchar
*
)
blob_key
);
int4store
(
pos
,
tmp
);
pos
+=
4
;
ptr
=
blob_key
;
memcpy
_fixed
(
pos
,
&
ptr
,
sizeof
(
char
*
));
memcpy
(
pos
,
&
ptr
,
sizeof
(
char
*
));
}
...
...
@@ -353,7 +353,7 @@ static void create_key(uchar *key,uint rownr)
double
c
=
rownr
;
uchar
*
pos
;
uint
i
;
bzero
(
key
,
MAX_REC_LENGTH
);
for
(
pos
=
key
,
i
=
0
;
i
<
2
*
SPDIMS
;
i
++
)
{
...
...
storage/perfschema/pfs_events_waits.cc
View file @
e8150697
...
...
@@ -95,9 +95,8 @@ static void copy_events_waits(PFS_events_waits *dest,
/* Signal readers they are about to read garbage ... */
dest
->
m_wait_class
=
NO_WAIT_CLASS
;
/* ... that this can generate. */
memcpy_fixed
(
dest_body
,
source_body
,
sizeof
(
PFS_events_waits
)
-
sizeof
(
events_waits_class
));
memcpy
(
dest_body
,
source_body
,
sizeof
(
PFS_events_waits
)
-
sizeof
(
events_waits_class
));
/* Signal readers the record is now clean again. */
dest
->
m_wait_class
=
source
->
m_wait_class
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment