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
3afd1939
Commit
3afd1939
authored
Dec 16, 2004
by
konstantin@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Portability fix in libmysql (FreeBSD)
parent
7216594f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
include/my_global.h
include/my_global.h
+1
-0
libmysql/libmysql.c
libmysql/libmysql.c
+11
-11
No files found.
include/my_global.h
View file @
3afd1939
...
@@ -661,6 +661,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
...
@@ -661,6 +661,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define UINT_MAX16 0xFFFF
#define UINT_MAX16 0xFFFF
#define INT_MIN8 (~0x7F)
#define INT_MIN8 (~0x7F)
#define INT_MAX8 0x7F
#define INT_MAX8 0x7F
#define UINT_MAX8 0xFF
/* From limits.h instead */
/* From limits.h instead */
#ifndef DBL_MIN
#ifndef DBL_MIN
...
...
libmysql/libmysql.c
View file @
3afd1939
...
@@ -3442,7 +3442,7 @@ static void fetch_string_with_conversion(MYSQL_BIND *param, char *value,
...
@@ -3442,7 +3442,7 @@ static void fetch_string_with_conversion(MYSQL_BIND *param, char *value,
longlong
data
=
my_strntoll
(
&
my_charset_latin1
,
value
,
length
,
10
,
longlong
data
=
my_strntoll
(
&
my_charset_latin1
,
value
,
length
,
10
,
&
endptr
,
&
err
);
&
endptr
,
&
err
);
*
param
->
error
=
(
IS_TRUNCATED
(
data
,
param
->
is_unsigned
,
*
param
->
error
=
(
IS_TRUNCATED
(
data
,
param
->
is_unsigned
,
INT
8_MIN
,
INT8_MAX
,
UINT8_MAX
)
|
INT
_MIN8
,
INT_MAX8
,
UINT_MAX8
)
|
test
(
err
));
test
(
err
));
*
buffer
=
(
uchar
)
data
;
*
buffer
=
(
uchar
)
data
;
break
;
break
;
...
@@ -3452,7 +3452,7 @@ static void fetch_string_with_conversion(MYSQL_BIND *param, char *value,
...
@@ -3452,7 +3452,7 @@ static void fetch_string_with_conversion(MYSQL_BIND *param, char *value,
longlong
data
=
my_strntoll
(
&
my_charset_latin1
,
value
,
length
,
10
,
longlong
data
=
my_strntoll
(
&
my_charset_latin1
,
value
,
length
,
10
,
&
endptr
,
&
err
);
&
endptr
,
&
err
);
*
param
->
error
=
(
IS_TRUNCATED
(
data
,
param
->
is_unsigned
,
*
param
->
error
=
(
IS_TRUNCATED
(
data
,
param
->
is_unsigned
,
INT
16_MIN
,
INT16_MAX
,
UINT16_MAX
)
|
INT
_MIN16
,
INT_MAX16
,
UINT_MAX16
)
|
test
(
err
));
test
(
err
));
shortstore
(
buffer
,
(
short
)
data
);
shortstore
(
buffer
,
(
short
)
data
);
break
;
break
;
...
@@ -3462,7 +3462,7 @@ static void fetch_string_with_conversion(MYSQL_BIND *param, char *value,
...
@@ -3462,7 +3462,7 @@ static void fetch_string_with_conversion(MYSQL_BIND *param, char *value,
longlong
data
=
my_strntoll
(
&
my_charset_latin1
,
value
,
length
,
10
,
longlong
data
=
my_strntoll
(
&
my_charset_latin1
,
value
,
length
,
10
,
&
endptr
,
&
err
);
&
endptr
,
&
err
);
*
param
->
error
=
(
IS_TRUNCATED
(
data
,
param
->
is_unsigned
,
*
param
->
error
=
(
IS_TRUNCATED
(
data
,
param
->
is_unsigned
,
INT
32_MIN
,
INT32_MAX
,
UINT32_MAX
)
|
INT
_MIN32
,
INT_MAX32
,
UINT_MAX32
)
|
test
(
err
));
test
(
err
));
longstore
(
buffer
,
(
int32
)
data
);
longstore
(
buffer
,
(
int32
)
data
);
break
;
break
;
...
@@ -3564,17 +3564,17 @@ static void fetch_long_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
...
@@ -3564,17 +3564,17 @@ static void fetch_long_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
break
;
break
;
case
MYSQL_TYPE_TINY
:
case
MYSQL_TYPE_TINY
:
*
param
->
error
=
IS_TRUNCATED
(
value
,
param
->
is_unsigned
,
*
param
->
error
=
IS_TRUNCATED
(
value
,
param
->
is_unsigned
,
INT
8_MIN
,
INT8_MAX
,
UINT8_MAX
);
INT
_MIN8
,
INT_MAX8
,
UINT_MAX8
);
*
(
uchar
*
)
param
->
buffer
=
(
uchar
)
value
;
*
(
uchar
*
)
param
->
buffer
=
(
uchar
)
value
;
break
;
break
;
case
MYSQL_TYPE_SHORT
:
case
MYSQL_TYPE_SHORT
:
*
param
->
error
=
IS_TRUNCATED
(
value
,
param
->
is_unsigned
,
*
param
->
error
=
IS_TRUNCATED
(
value
,
param
->
is_unsigned
,
INT
16_MIN
,
INT16_MAX
,
UINT16_MAX
);
INT
_MIN16
,
INT_MAX16
,
UINT_MAX16
);
shortstore
(
buffer
,
(
short
)
value
);
shortstore
(
buffer
,
(
short
)
value
);
break
;
break
;
case
MYSQL_TYPE_LONG
:
case
MYSQL_TYPE_LONG
:
*
param
->
error
=
IS_TRUNCATED
(
value
,
param
->
is_unsigned
,
*
param
->
error
=
IS_TRUNCATED
(
value
,
param
->
is_unsigned
,
INT
32_MIN
,
INT32_MAX
,
UINT32_MAX
);
INT
_MIN32
,
INT_MAX32
,
UINT_MAX32
);
longstore
(
buffer
,
(
int32
)
value
);
longstore
(
buffer
,
(
int32
)
value
);
break
;
break
;
case
MYSQL_TYPE_LONGLONG
:
case
MYSQL_TYPE_LONGLONG
:
...
@@ -3978,7 +3978,7 @@ static void fetch_result_tinyint(MYSQL_BIND *param, MYSQL_FIELD *field,
...
@@ -3978,7 +3978,7 @@ static void fetch_result_tinyint(MYSQL_BIND *param, MYSQL_FIELD *field,
my_bool
field_is_unsigned
=
test
(
field
->
flags
&
UNSIGNED_FLAG
);
my_bool
field_is_unsigned
=
test
(
field
->
flags
&
UNSIGNED_FLAG
);
uchar
data
=
**
row
;
uchar
data
=
**
row
;
*
(
uchar
*
)
param
->
buffer
=
data
;
*
(
uchar
*
)
param
->
buffer
=
data
;
*
param
->
error
=
param
->
is_unsigned
!=
field_is_unsigned
&&
data
>
INT
8_MAX
;
*
param
->
error
=
param
->
is_unsigned
!=
field_is_unsigned
&&
data
>
INT
_MAX8
;
(
*
row
)
++
;
(
*
row
)
++
;
}
}
...
@@ -3988,7 +3988,7 @@ static void fetch_result_short(MYSQL_BIND *param, MYSQL_FIELD *field,
...
@@ -3988,7 +3988,7 @@ static void fetch_result_short(MYSQL_BIND *param, MYSQL_FIELD *field,
my_bool
field_is_unsigned
=
test
(
field
->
flags
&
UNSIGNED_FLAG
);
my_bool
field_is_unsigned
=
test
(
field
->
flags
&
UNSIGNED_FLAG
);
ushort
data
=
(
ushort
)
sint2korr
(
*
row
);
ushort
data
=
(
ushort
)
sint2korr
(
*
row
);
shortstore
(
param
->
buffer
,
data
);
shortstore
(
param
->
buffer
,
data
);
*
param
->
error
=
param
->
is_unsigned
!=
field_is_unsigned
&&
data
>
INT
16_MAX
;
*
param
->
error
=
param
->
is_unsigned
!=
field_is_unsigned
&&
data
>
INT
_MAX16
;
*
row
+=
2
;
*
row
+=
2
;
}
}
...
@@ -3999,7 +3999,7 @@ static void fetch_result_int32(MYSQL_BIND *param,
...
@@ -3999,7 +3999,7 @@ static void fetch_result_int32(MYSQL_BIND *param,
my_bool
field_is_unsigned
=
test
(
field
->
flags
&
UNSIGNED_FLAG
);
my_bool
field_is_unsigned
=
test
(
field
->
flags
&
UNSIGNED_FLAG
);
uint32
data
=
(
uint32
)
sint4korr
(
*
row
);
uint32
data
=
(
uint32
)
sint4korr
(
*
row
);
longstore
(
param
->
buffer
,
data
);
longstore
(
param
->
buffer
,
data
);
*
param
->
error
=
param
->
is_unsigned
!=
field_is_unsigned
&&
data
>
INT
32_MAX
;
*
param
->
error
=
param
->
is_unsigned
!=
field_is_unsigned
&&
data
>
INT
_MAX32
;
*
row
+=
4
;
*
row
+=
4
;
}
}
...
@@ -4009,7 +4009,7 @@ static void fetch_result_int64(MYSQL_BIND *param,
...
@@ -4009,7 +4009,7 @@ static void fetch_result_int64(MYSQL_BIND *param,
{
{
my_bool
field_is_unsigned
=
test
(
field
->
flags
&
UNSIGNED_FLAG
);
my_bool
field_is_unsigned
=
test
(
field
->
flags
&
UNSIGNED_FLAG
);
ulonglong
data
=
(
ulonglong
)
sint8korr
(
*
row
);
ulonglong
data
=
(
ulonglong
)
sint8korr
(
*
row
);
*
param
->
error
=
param
->
is_unsigned
!=
field_is_unsigned
&&
data
>
INT64
_MAX
;
*
param
->
error
=
param
->
is_unsigned
!=
field_is_unsigned
&&
data
>
LONGLONG
_MAX
;
longlongstore
(
param
->
buffer
,
data
);
longlongstore
(
param
->
buffer
,
data
);
*
row
+=
8
;
*
row
+=
8
;
}
}
...
@@ -4149,7 +4149,7 @@ static my_bool is_binary_compatible(enum enum_field_types type1,
...
@@ -4149,7 +4149,7 @@ static my_bool is_binary_compatible(enum enum_field_types type1,
MYSQL_TYPE_DECIMAL
,
0
},
MYSQL_TYPE_DECIMAL
,
0
},
*
range_list
[]
=
{
range1
,
range2
,
range3
,
range4
},
*
range_list
[]
=
{
range1
,
range2
,
range3
,
range4
},
**
range_list_end
=
range_list
+
sizeof
(
range_list
)
/
sizeof
(
*
range_list
);
**
range_list_end
=
range_list
+
sizeof
(
range_list
)
/
sizeof
(
*
range_list
);
enum
enum_field_types
**
range
,
*
type
;
const
enum
enum_field_types
**
range
,
*
type
;
if
(
type1
==
type2
)
if
(
type1
==
type2
)
return
TRUE
;
return
TRUE
;
...
...
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