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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
b54fa77b
Commit
b54fa77b
authored
Nov 28, 2002
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New functions
parent
cb0f9b31
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
16 deletions
+16
-16
sql/item.h
sql/item.h
+2
-2
sql/item_func.h
sql/item_func.h
+2
-2
sql/item_sum.h
sql/item_sum.h
+2
-2
strings/ctype-simple.c
strings/ctype-simple.c
+10
-10
No files found.
sql/item.h
View file @
b54fa77b
...
@@ -536,9 +536,9 @@ class Item_copy_string :public Item
...
@@ -536,9 +536,9 @@ class Item_copy_string :public Item
enum
Type
type
()
const
{
return
COPY_STR_ITEM
;
}
enum
Type
type
()
const
{
return
COPY_STR_ITEM
;
}
enum
Item_result
result_type
()
const
{
return
STRING_RESULT
;
}
enum
Item_result
result_type
()
const
{
return
STRING_RESULT
;
}
double
val
()
double
val
()
{
return
null_value
?
0.0
:
atof
(
str_value
.
c_ptr
()
);
}
{
return
null_value
?
0.0
:
my_strntod
(
str_value
.
charset
(),
str_value
.
ptr
(),
str_value
.
length
(),
NULL
);
}
longlong
val_int
()
longlong
val_int
()
{
return
null_value
?
LL
(
0
)
:
strtoll
(
str_value
.
c_ptr
(),(
char
**
)
0
,
10
);
}
{
return
null_value
?
LL
(
0
)
:
my_strntoll
(
str_value
.
charset
(),
str_value
.
ptr
(),
str_value
.
length
(),(
char
**
)
0
,
10
);
}
String
*
val_str
(
String
*
);
String
*
val_str
(
String
*
);
void
make_field
(
Send_field
*
field
)
{
item
->
make_field
(
field
);
}
void
make_field
(
Send_field
*
field
)
{
item
->
make_field
(
field
);
}
void
copy
();
void
copy
();
...
...
sql/item_func.h
View file @
b54fa77b
...
@@ -801,12 +801,12 @@ class Item_func_udf_str :public Item_udf_func
...
@@ -801,12 +801,12 @@ class Item_func_udf_str :public Item_udf_func
double
val
()
double
val
()
{
{
String
*
res
;
res
=
val_str
(
&
str_value
);
String
*
res
;
res
=
val_str
(
&
str_value
);
return
res
?
atof
(
res
->
c_ptr
()
)
:
0.0
;
return
res
?
my_strntod
(
res
->
charset
(),
res
->
ptr
(),
res
->
length
(),
0
)
:
0.0
;
}
}
longlong
val_int
()
longlong
val_int
()
{
{
String
*
res
;
res
=
val_str
(
&
str_value
);
String
*
res
;
res
=
val_str
(
&
str_value
);
return
res
?
strtoll
(
res
->
c_ptr
(),(
char
**
)
0
,
10
)
:
(
longlong
)
0
;
return
res
?
my_strntoll
(
res
->
charset
(),
res
->
ptr
(),
res
->
length
(),(
char
**
)
0
,
10
)
:
(
longlong
)
0
;
}
}
enum
Item_result
result_type
()
const
{
return
STRING_RESULT
;
}
enum
Item_result
result_type
()
const
{
return
STRING_RESULT
;
}
void
fix_length_and_dec
();
void
fix_length_and_dec
();
...
...
sql/item_sum.h
View file @
b54fa77b
...
@@ -442,12 +442,12 @@ class Item_sum_udf_str :public Item_udf_sum
...
@@ -442,12 +442,12 @@ class Item_sum_udf_str :public Item_udf_sum
double
val
()
double
val
()
{
{
String
*
res
;
res
=
val_str
(
&
str_value
);
String
*
res
;
res
=
val_str
(
&
str_value
);
return
res
?
atof
(
res
->
c_ptr
()
)
:
0.0
;
return
res
?
my_strntod
(
res
->
charset
(),
res
->
ptr
(),
res
->
length
(),(
char
**
)
0
)
:
0.0
;
}
}
longlong
val_int
()
longlong
val_int
()
{
{
String
*
res
;
res
=
val_str
(
&
str_value
);
String
*
res
;
res
=
val_str
(
&
str_value
);
return
res
?
strtoll
(
res
->
c_ptr
(),(
char
**
)
0
,
10
)
:
(
longlong
)
0
;
return
res
?
my_strntoll
(
res
->
charset
(),
res
->
ptr
(),
res
->
length
(),(
char
**
)
0
,
10
)
:
(
longlong
)
0
;
}
}
enum
Item_result
result_type
()
const
{
return
STRING_RESULT
;
}
enum
Item_result
result_type
()
const
{
return
STRING_RESULT
;
}
void
fix_length_and_dec
();
void
fix_length_and_dec
();
...
...
strings/ctype-simple.c
View file @
b54fa77b
...
@@ -18,6 +18,8 @@
...
@@ -18,6 +18,8 @@
#include "m_string.h"
#include "m_string.h"
#include "m_ctype.h"
#include "m_ctype.h"
#include "my_sys.h"
/* defines errno */
#include "my_sys.h"
/* defines errno */
#include <errno.h>
#include "stdarg.h"
#include "stdarg.h"
#include "assert.h"
#include "assert.h"
...
@@ -246,8 +248,6 @@ void my_hash_sort_simple(CHARSET_INFO *cs,
...
@@ -246,8 +248,6 @@ void my_hash_sort_simple(CHARSET_INFO *cs,
}
}
#define MY_ERRNO(y)
long
my_strntol_8bit
(
CHARSET_INFO
*
cs
,
long
my_strntol_8bit
(
CHARSET_INFO
*
cs
,
const
char
*
nptr
,
uint
l
,
char
**
endptr
,
int
base
)
const
char
*
nptr
,
uint
l
,
char
**
endptr
,
int
base
)
{
{
...
@@ -349,14 +349,14 @@ long my_strntol_8bit(CHARSET_INFO *cs,
...
@@ -349,14 +349,14 @@ long my_strntol_8bit(CHARSET_INFO *cs,
if
(
overflow
)
if
(
overflow
)
{
{
MY_ERRNO
(
ERANGE
);
my_errno
=
(
ERANGE
);
return
negative
?
LONG_MIN
:
LONG_MAX
;
return
negative
?
LONG_MIN
:
LONG_MAX
;
}
}
return
(
negative
?
-
((
long
)
i
)
:
(
long
)
i
);
return
(
negative
?
-
((
long
)
i
)
:
(
long
)
i
);
noconv:
noconv:
MY_ERRNO
(
EDOM
);
my_errno
=
(
EDOM
);
if
(
endptr
!=
NULL
)
if
(
endptr
!=
NULL
)
*
endptr
=
(
char
*
)
nptr
;
*
endptr
=
(
char
*
)
nptr
;
return
0L
;
return
0L
;
...
@@ -455,14 +455,14 @@ ulong my_strntoul_8bit(CHARSET_INFO *cs,
...
@@ -455,14 +455,14 @@ ulong my_strntoul_8bit(CHARSET_INFO *cs,
if
(
overflow
)
if
(
overflow
)
{
{
MY_ERRNO
(
ERANGE
);
my_errno
=
(
ERANGE
);
return
((
ulong
)
~
0L
);
return
((
ulong
)
~
0L
);
}
}
return
(
negative
?
-
((
long
)
i
)
:
(
long
)
i
);
return
(
negative
?
-
((
long
)
i
)
:
(
long
)
i
);
noconv:
noconv:
MY_ERRNO
(
EDOM
);
my_errno
=
(
EDOM
);
if
(
endptr
!=
NULL
)
if
(
endptr
!=
NULL
)
*
endptr
=
(
char
*
)
nptr
;
*
endptr
=
(
char
*
)
nptr
;
return
0L
;
return
0L
;
...
@@ -570,14 +570,14 @@ longlong my_strntoll_8bit(CHARSET_INFO *cs __attribute__((unused)),
...
@@ -570,14 +570,14 @@ longlong my_strntoll_8bit(CHARSET_INFO *cs __attribute__((unused)),
if
(
overflow
)
if
(
overflow
)
{
{
MY_ERRNO
(
ERANGE
);
my_errno
=
(
ERANGE
);
return
negative
?
LONGLONG_MIN
:
LONGLONG_MAX
;
return
negative
?
LONGLONG_MIN
:
LONGLONG_MAX
;
}
}
return
(
negative
?
-
((
longlong
)
i
)
:
(
longlong
)
i
);
return
(
negative
?
-
((
longlong
)
i
)
:
(
longlong
)
i
);
noconv:
noconv:
MY_ERRNO
(
EDOM
);
my_errno
=
(
EDOM
);
if
(
endptr
!=
NULL
)
if
(
endptr
!=
NULL
)
*
endptr
=
(
char
*
)
nptr
;
*
endptr
=
(
char
*
)
nptr
;
return
0L
;
return
0L
;
...
@@ -677,14 +677,14 @@ ulonglong my_strntoull_8bit(CHARSET_INFO *cs,
...
@@ -677,14 +677,14 @@ ulonglong my_strntoull_8bit(CHARSET_INFO *cs,
if
(
overflow
)
if
(
overflow
)
{
{
MY_ERRNO
(
ERANGE
);
my_errno
=
(
ERANGE
);
return
(
~
(
ulonglong
)
0
);
return
(
~
(
ulonglong
)
0
);
}
}
return
(
negative
?
-
((
longlong
)
i
)
:
(
longlong
)
i
);
return
(
negative
?
-
((
longlong
)
i
)
:
(
longlong
)
i
);
noconv:
noconv:
MY_ERRNO
(
EDOM
);
my_errno
=
(
EDOM
);
if
(
endptr
!=
NULL
)
if
(
endptr
!=
NULL
)
*
endptr
=
(
char
*
)
nptr
;
*
endptr
=
(
char
*
)
nptr
;
return
0L
;
return
0L
;
...
...
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