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
85f35cbf
Commit
85f35cbf
authored
Oct 30, 2002
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
All String->set() now have charset argument
parent
2b6c55db
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
94 additions
and
76 deletions
+94
-76
sql/field.cc
sql/field.cc
+4
-6
sql/item.cc
sql/item.cc
+7
-7
sql/item_func.cc
sql/item_func.cc
+17
-17
sql/item_strfunc.cc
sql/item_strfunc.cc
+1
-1
sql/item_subselect.cc
sql/item_subselect.cc
+1
-1
sql/item_sum.cc
sql/item_sum.cc
+8
-8
sql/item_timefunc.h
sql/item_timefunc.h
+9
-2
sql/mysql_priv.h
sql/mysql_priv.h
+2
-0
sql/procedure.h
sql/procedure.h
+4
-4
sql/sql_analyse.cc
sql/sql_analyse.cc
+3
-3
sql/sql_analyse.h
sql/sql_analyse.h
+28
-20
sql/sql_string.cc
sql/sql_string.cc
+7
-3
sql/sql_string.h
sql/sql_string.h
+3
-4
No files found.
sql/field.cc
View file @
85f35cbf
...
...
@@ -4316,17 +4316,15 @@ int Field_blob::store(const char *from,uint len,CHARSET_INFO *cs)
int
Field_blob
::
store
(
double
nr
)
{
value
.
set
(
nr
);
return
Field_blob
::
store
(
value
.
ptr
(),(
uint
)
value
.
length
(),
default_charset_info
);
value
.
set
(
nr
,
2
,
my_thd_charset
);
return
Field_blob
::
store
(
value
.
ptr
(),(
uint
)
value
.
length
(),
value
.
charset
());
}
int
Field_blob
::
store
(
longlong
nr
)
{
value
.
set
(
nr
);
return
Field_blob
::
store
(
value
.
ptr
(),
(
uint
)
value
.
length
(),
default_charset_info
);
value
.
set
(
nr
,
my_thd_charset
);
return
Field_blob
::
store
(
value
.
ptr
(),
(
uint
)
value
.
length
(),
value
.
charset
());
}
...
...
sql/item.cc
View file @
85f35cbf
...
...
@@ -234,7 +234,7 @@ table_map Item_field::used_tables() const
String
*
Item_int
::
val_str
(
String
*
str
)
{
str
->
set
(
value
);
str
->
set
(
value
,
my_thd_charset
);
return
str
;
}
...
...
@@ -242,7 +242,7 @@ void Item_int::print(String *str)
{
if
(
!
name
)
{
str_value
.
set
(
value
);
str_value
.
set
(
value
,
my_thd_charset
);
name
=
str_value
.
c_ptr
();
}
str
->
append
(
name
);
...
...
@@ -250,7 +250,7 @@ void Item_int::print(String *str)
String
*
Item_uint
::
val_str
(
String
*
str
)
{
str
->
set
((
ulonglong
)
value
);
str
->
set
((
ulonglong
)
value
,
my_thd_charset
);
return
str
;
}
...
...
@@ -258,7 +258,7 @@ void Item_uint::print(String *str)
{
if
(
!
name
)
{
str_value
.
set
((
ulonglong
)
value
);
str_value
.
set
((
ulonglong
)
value
,
my_thd_charset
);
name
=
str_value
.
c_ptr
();
}
str
->
append
(
name
);
...
...
@@ -267,7 +267,7 @@ void Item_uint::print(String *str)
String
*
Item_real
::
val_str
(
String
*
str
)
{
str
->
set
(
value
,
decimals
);
str
->
set
(
value
,
decimals
,
my_thd_charset
);
return
str
;
}
...
...
@@ -384,10 +384,10 @@ String *Item_param::val_str(String* str)
{
switch
(
item_result_type
)
{
case
INT_RESULT
:
str
->
set
(
int_value
);
str
->
set
(
int_value
,
my_thd_charset
);
return
str
;
case
REAL_RESULT
:
str
->
set
(
real_value
);
str
->
set
(
real_value
,
2
,
my_thd_charset
);
return
str
;
default:
return
(
String
*
)
&
str_value
;
...
...
sql/item_func.cc
View file @
85f35cbf
...
...
@@ -245,7 +245,7 @@ String *Item_real_func::val_str(String *str)
if
(
null_value
)
return
0
;
/* purecov: inspected */
else
str
->
set
(
nr
,
decimals
);
str
->
set
(
nr
,
decimals
,
my_thd_charset
);
return
str
;
}
...
...
@@ -258,9 +258,9 @@ String *Item_num_func::val_str(String *str)
if
(
null_value
)
return
0
;
/* purecov: inspected */
else
if
(
!
unsigned_flag
)
str
->
set
(
nr
);
str
->
set
(
nr
,
my_thd_charset
);
else
str
->
set
((
ulonglong
)
nr
);
str
->
set
((
ulonglong
)
nr
,
my_thd_charset
);
}
else
{
...
...
@@ -268,7 +268,7 @@ String *Item_num_func::val_str(String *str)
if
(
null_value
)
return
0
;
/* purecov: inspected */
else
str
->
set
(
nr
,
decimals
);
str
->
set
(
nr
,
decimals
,
my_thd_charset
);
}
return
str
;
}
...
...
@@ -288,9 +288,9 @@ String *Item_int_func::val_str(String *str)
if
(
null_value
)
return
0
;
else
if
(
!
unsigned_flag
)
str
->
set
(
nr
);
str
->
set
(
nr
,
my_thd_charset
);
else
str
->
set
((
ulonglong
)
nr
);
str
->
set
((
ulonglong
)
nr
,
my_thd_charset
);
return
str
;
}
...
...
@@ -317,9 +317,9 @@ String *Item_num_op::val_str(String *str)
if
(
null_value
)
return
0
;
/* purecov: inspected */
else
if
(
!
unsigned_flag
)
str
->
set
(
nr
);
str
->
set
(
nr
,
my_thd_charset
);
else
str
->
set
((
ulonglong
)
nr
);
str
->
set
((
ulonglong
)
nr
,
my_thd_charset
);
}
else
{
...
...
@@ -327,7 +327,7 @@ String *Item_num_op::val_str(String *str)
if
(
null_value
)
return
0
;
/* purecov: inspected */
else
str
->
set
(
nr
,
decimals
);
str
->
set
(
nr
,
decimals
,
my_thd_charset
);
}
return
str
;
}
...
...
@@ -815,9 +815,9 @@ String *Item_func_min_max::val_str(String *str)
if
(
null_value
)
return
0
;
else
if
(
!
unsigned_flag
)
str
->
set
(
nr
);
str
->
set
(
nr
,
my_thd_charset
);
else
str
->
set
((
ulonglong
)
nr
);
str
->
set
((
ulonglong
)
nr
,
my_thd_charset
);
return
str
;
}
case
REAL_RESULT
:
...
...
@@ -826,7 +826,7 @@ String *Item_func_min_max::val_str(String *str)
if
(
null_value
)
return
0
;
/* purecov: inspected */
else
str
->
set
(
nr
,
decimals
);
str
->
set
(
nr
,
decimals
,
my_thd_charset
);
return
str
;
}
case
STRING_RESULT
:
...
...
@@ -1449,7 +1449,7 @@ String *Item_func_udf_float::val_str(String *str)
if
(
null_value
)
return
0
;
/* purecov: inspected */
else
str
->
set
(
nr
,
decimals
);
str
->
set
(
nr
,
decimals
,
my_thd_charset
);
return
str
;
}
...
...
@@ -1470,9 +1470,9 @@ String *Item_func_udf_int::val_str(String *str)
if
(
null_value
)
return
0
;
else
if
(
!
unsigned_flag
)
str
->
set
(
nr
);
str
->
set
(
nr
,
my_thd_charset
);
else
str
->
set
((
ulonglong
)
nr
);
str
->
set
((
ulonglong
)
nr
,
my_thd_charset
);
return
str
;
}
...
...
@@ -2036,10 +2036,10 @@ Item_func_get_user_var::val_str(String *str)
return
NULL
;
switch
(
entry
->
type
)
{
case
REAL_RESULT
:
str
->
set
(
*
(
double
*
)
entry
->
value
,
decimals
);
str
->
set
(
*
(
double
*
)
entry
->
value
,
decimals
,
my_thd_charset
);
break
;
case
INT_RESULT
:
str
->
set
(
*
(
longlong
*
)
entry
->
value
);
str
->
set
(
*
(
longlong
*
)
entry
->
value
,
my_thd_charset
);
break
;
case
STRING_RESULT
:
if
(
str
->
copy
(
entry
->
value
,
entry
->
length
-
1
))
...
...
sql/item_strfunc.cc
View file @
85f35cbf
...
...
@@ -1469,7 +1469,7 @@ String *Item_func_format::val_str(String *str)
if
((
null_value
=
args
[
0
]
->
null_value
))
return
0
;
/* purecov: inspected */
dec
=
decimals
?
decimals
+
1
:
0
;
str
->
set
(
nr
,
decimals
);
str
->
set
(
nr
,
decimals
,
my_thd_charset
);
str_length
=
str
->
length
();
if
(
nr
<
0
)
str_length
--
;
// Don't count sign
...
...
sql/item_subselect.cc
View file @
85f35cbf
...
...
@@ -200,7 +200,7 @@ String *Item_exists_subselect::val_str(String *str)
assign_null
();
return
0
;
}
str
->
set
(
value
);
str
->
set
(
value
,
my_thd_charset
);
return
str
;
}
...
...
sql/item_sum.cc
View file @
85f35cbf
...
...
@@ -93,7 +93,7 @@ Item_sum_num::val_str(String *str)
double
nr
=
val
();
if
(
null_value
)
return
0
;
str
->
set
(
nr
,
decimals
);
str
->
set
(
nr
,
decimals
,
my_thd_charset
);
return
str
;
}
...
...
@@ -359,13 +359,13 @@ Item_sum_hybrid::val_str(String *str)
case
STRING_RESULT
:
return
&
value
;
case
REAL_RESULT
:
str
->
set
(
sum
,
decimals
);
str
->
set
(
sum
,
decimals
,
my_thd_charset
);
break
;
case
INT_RESULT
:
if
(
unsigned_flag
)
str
->
set
((
ulonglong
)
sum_int
);
str
->
set
((
ulonglong
)
sum_int
,
my_thd_charset
);
else
str
->
set
((
longlong
)
sum_int
);
str
->
set
((
longlong
)
sum_int
,
my_thd_charset
);
break
;
}
return
str
;
// Keep compiler happy
...
...
@@ -810,7 +810,7 @@ String *Item_avg_field::val_str(String *str)
double
nr
=
Item_avg_field
::
val
();
if
(
null_value
)
return
0
;
str
->
set
(
nr
,
decimals
);
str
->
set
(
nr
,
decimals
,
my_thd_charset
);
return
str
;
}
...
...
@@ -847,7 +847,7 @@ String *Item_std_field::val_str(String *str)
double
nr
=
val
();
if
(
null_value
)
return
0
;
str
->
set
(
nr
,
decimals
);
str
->
set
(
nr
,
decimals
,
my_thd_charset
);
return
str
;
}
...
...
@@ -1174,7 +1174,7 @@ String *Item_sum_udf_float::val_str(String *str)
if
(
null_value
)
return
0
;
/* purecov: inspected */
else
str
->
set
(
nr
,
decimals
);
str
->
set
(
nr
,
decimals
,
my_thd_charset
);
return
str
;
}
...
...
@@ -1193,7 +1193,7 @@ String *Item_sum_udf_int::val_str(String *str)
if
(
null_value
)
return
0
;
else
str
->
set
(
nr
);
str
->
set
(
nr
,
my_thd_charset
);
return
str
;
}
...
...
sql/item_timefunc.h
View file @
85f35cbf
...
...
@@ -67,7 +67,11 @@ public:
Item_func_month
(
Item
*
a
)
:
Item_func
(
a
)
{}
longlong
val_int
();
double
val
()
{
return
(
double
)
Item_func_month
::
val_int
();
}
String
*
val_str
(
String
*
str
)
{
str
->
set
(
val_int
());
return
null_value
?
0
:
str
;}
String
*
val_str
(
String
*
str
)
{
str
->
set
(
val_int
(),
my_thd_charset
);
return
null_value
?
0
:
str
;
}
const
char
*
func_name
()
const
{
return
"month"
;
}
enum
Item_result
result_type
()
const
{
return
INT_RESULT
;
}
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
2
;
maybe_null
=
1
;
}
...
...
@@ -172,7 +176,10 @@ public:
:
Item_func
(
a
),
odbc_type
(
type_arg
)
{}
longlong
val_int
();
double
val
()
{
return
(
double
)
val_int
();
}
String
*
val_str
(
String
*
str
)
{
str
->
set
(
val_int
());
return
null_value
?
0
:
str
;}
String
*
val_str
(
String
*
str
)
{
str
->
set
(
val_int
(),
my_thd_charset
);
return
null_value
?
0
:
str
;
}
const
char
*
func_name
()
const
{
return
"weekday"
;
}
enum
Item_result
result_type
()
const
{
return
INT_RESULT
;
}
void
fix_length_and_dec
()
{
decimals
=
0
;
max_length
=
1
;
maybe_null
=
1
;
}
...
...
sql/mysql_priv.h
View file @
85f35cbf
...
...
@@ -61,6 +61,8 @@ char* query_table_status(THD *thd,const char *db,const char *table_name);
#endif
#endif
#define my_thd_charset default_charset_info
/***************************************************************************
Configuration parameters
****************************************************************************/
...
...
sql/procedure.h
View file @
85f35cbf
...
...
@@ -62,7 +62,7 @@ public:
{
value
=
atof
(
str
);
}
double
val
()
{
return
value
;
}
longlong
val_int
()
{
return
(
longlong
)
value
;
}
String
*
val_str
(
String
*
s
)
{
s
->
set
(
value
,
decimals
);
return
s
;
}
String
*
val_str
(
String
*
s
)
{
s
->
set
(
value
,
decimals
,
my_thd_charset
);
return
s
;
}
unsigned
int
size_of
()
{
return
sizeof
(
*
this
);}
};
...
...
@@ -80,7 +80,7 @@ public:
{
value
=
strtoll
(
str
,
NULL
,
10
);
}
double
val
()
{
return
(
double
)
value
;
}
longlong
val_int
()
{
return
value
;
}
String
*
val_str
(
String
*
s
)
{
s
->
set
(
value
);
return
s
;
}
String
*
val_str
(
String
*
s
)
{
s
->
set
(
value
,
my_thd_charset
);
return
s
;
}
unsigned
int
size_of
()
{
return
sizeof
(
*
this
);}
};
...
...
@@ -92,8 +92,8 @@ public:
{
this
->
max_length
=
length
;
}
enum
Item_result
result_type
()
const
{
return
STRING_RESULT
;
}
enum_field_types
field_type
()
const
{
return
FIELD_TYPE_STRING
;
}
void
set
(
double
nr
)
{
str_value
.
set
(
nr
);
}
void
set
(
longlong
nr
)
{
str_value
.
set
(
nr
);
}
void
set
(
double
nr
)
{
str_value
.
set
(
nr
,
2
,
my_thd_charset
);
}
void
set
(
longlong
nr
)
{
str_value
.
set
(
nr
,
my_thd_charset
);
}
void
set
(
const
char
*
str
,
uint
length
)
{
str_value
.
copy
(
str
,
length
);
}
double
val
()
{
return
atof
(
str_value
.
ptr
());
}
longlong
val_int
()
{
return
strtoll
(
str_value
.
ptr
(),
NULL
,
10
);
}
...
...
sql/sql_analyse.cc
View file @
85f35cbf
...
...
@@ -903,7 +903,7 @@ int collect_real(double *element, element_count count __attribute__((unused)),
else
info
->
found
=
1
;
info
->
str
->
append
(
'\''
);
s
.
set
(
*
element
,
info
->
item
->
decimals
);
s
.
set
(
*
element
,
info
->
item
->
decimals
,
my_thd_charset
);
info
->
str
->
append
(
s
);
info
->
str
->
append
(
'\''
);
return
0
;
...
...
@@ -922,7 +922,7 @@ int collect_longlong(longlong *element,
else
info
->
found
=
1
;
info
->
str
->
append
(
'\''
);
s
.
set
(
*
element
);
s
.
set
(
*
element
,
default_charset_info
);
info
->
str
->
append
(
s
);
info
->
str
->
append
(
'\''
);
return
0
;
...
...
@@ -941,7 +941,7 @@ int collect_ulonglong(ulonglong *element,
else
info
->
found
=
1
;
info
->
str
->
append
(
'\''
);
s
.
set
(
*
element
);
s
.
set
(
*
element
,
default_charset_info
);
info
->
str
->
append
(
s
);
info
->
str
->
append
(
'\''
);
return
0
;
...
...
sql/sql_analyse.h
View file @
85f35cbf
...
...
@@ -128,10 +128,10 @@ public:
String
*
avg
(
String
*
s
,
ha_rows
rows
)
{
if
(
!
(
rows
-
nulls
))
s
->
set
((
double
)
0.0
,
1
);
s
->
set
((
double
)
0.0
,
1
,
my_thd_charset
);
else
s
->
set
((
ulonglong2double
(
sum
)
/
ulonglong2double
(
rows
-
nulls
)),
DEC_IN_AVG
);
DEC_IN_AVG
,
my_thd_charset
);
return
s
;
}
friend
int
collect_string
(
String
*
element
,
element_count
count
,
...
...
@@ -160,26 +160,34 @@ public:
void
add
();
void
get_opt_type
(
String
*
,
ha_rows
);
String
*
get_min_arg
(
String
*
s
)
{
s
->
set
(
min_arg
,
item
->
decimals
);
return
s
;
}
String
*
get_max_arg
(
String
*
s
)
{
s
->
set
(
max_arg
,
item
->
decimals
);
return
s
;
}
String
*
get_min_arg
(
String
*
s
)
{
s
->
set
(
min_arg
,
item
->
decimals
,
my_thd_charset
);
return
s
;
}
String
*
get_max_arg
(
String
*
s
)
{
s
->
set
(
max_arg
,
item
->
decimals
,
my_thd_charset
);
return
s
;
}
String
*
avg
(
String
*
s
,
ha_rows
rows
)
{
if
(
!
(
rows
-
nulls
))
s
->
set
((
double
)
0.0
,
1
);
s
->
set
((
double
)
0.0
,
1
,
my_thd_charset
);
else
s
->
set
(((
double
)
sum
/
(
double
)
(
rows
-
nulls
)),
item
->
decimals
);
s
->
set
(((
double
)
sum
/
(
double
)
(
rows
-
nulls
)),
item
->
decimals
,
my_thd_charset
);
return
s
;
}
String
*
std
(
String
*
s
,
ha_rows
rows
)
{
double
tmp
=
ulonglong2double
(
rows
);
if
(
!
(
tmp
-
nulls
))
s
->
set
((
double
)
0.0
,
1
);
s
->
set
((
double
)
0.0
,
1
,
my_thd_charset
);
else
{
double
tmp2
=
((
sum_sqr
-
sum
*
sum
/
(
tmp
-
nulls
))
/
(
tmp
-
nulls
));
s
->
set
(((
double
)
tmp2
<=
0.0
?
0.0
:
sqrt
(
tmp2
)),
item
->
decimals
);
s
->
set
(((
double
)
tmp2
<=
0.0
?
0.0
:
sqrt
(
tmp2
)),
item
->
decimals
,
my_thd_charset
);
}
return
s
;
}
...
...
@@ -206,26 +214,26 @@ public:
void
add
();
void
get_opt_type
(
String
*
,
ha_rows
);
String
*
get_min_arg
(
String
*
s
)
{
s
->
set
(
min_arg
);
return
s
;
}
String
*
get_max_arg
(
String
*
s
)
{
s
->
set
(
max_arg
);
return
s
;
}
String
*
get_min_arg
(
String
*
s
)
{
s
->
set
(
min_arg
,
my_thd_charset
);
return
s
;
}
String
*
get_max_arg
(
String
*
s
)
{
s
->
set
(
max_arg
,
my_thd_charset
);
return
s
;
}
String
*
avg
(
String
*
s
,
ha_rows
rows
)
{
if
(
!
(
rows
-
nulls
))
s
->
set
((
double
)
0.0
,
1
);
s
->
set
((
double
)
0.0
,
1
,
my_thd_charset
);
else
s
->
set
(((
double
)
sum
/
(
double
)
(
rows
-
nulls
)),
DEC_IN_AVG
);
s
->
set
(((
double
)
sum
/
(
double
)
(
rows
-
nulls
)),
DEC_IN_AVG
,
my_thd_charset
);
return
s
;
}
String
*
std
(
String
*
s
,
ha_rows
rows
)
{
double
tmp
=
ulonglong2double
(
rows
);
if
(
!
(
tmp
-
nulls
))
s
->
set
((
double
)
0.0
,
1
);
s
->
set
((
double
)
0.0
,
1
,
my_thd_charset
);
else
{
double
tmp2
=
((
sum_sqr
-
sum
*
sum
/
(
tmp
-
nulls
))
/
(
tmp
-
nulls
));
s
->
set
(((
double
)
tmp2
<=
0.0
?
0.0
:
sqrt
(
tmp2
)),
DEC_IN_AVG
);
s
->
set
(((
double
)
tmp2
<=
0.0
?
0.0
:
sqrt
(
tmp2
)),
DEC_IN_AVG
,
my_thd_charset
);
}
return
s
;
}
...
...
@@ -250,28 +258,28 @@ public:
(
qsort_cmp2
)
compare_ulonglong2
,
0
,
NULL
,
NULL
);
}
void
add
();
void
get_opt_type
(
String
*
,
ha_rows
);
String
*
get_min_arg
(
String
*
s
)
{
s
->
set
(
min_arg
);
return
s
;
}
String
*
get_max_arg
(
String
*
s
)
{
s
->
set
(
max_arg
);
return
s
;
}
String
*
get_min_arg
(
String
*
s
)
{
s
->
set
(
min_arg
,
my_thd_charset
);
return
s
;
}
String
*
get_max_arg
(
String
*
s
)
{
s
->
set
(
max_arg
,
my_thd_charset
);
return
s
;
}
String
*
avg
(
String
*
s
,
ha_rows
rows
)
{
if
(
!
(
rows
-
nulls
))
s
->
set
((
double
)
0.0
,
1
);
s
->
set
((
double
)
0.0
,
1
,
my_thd_charset
);
else
s
->
set
((
ulonglong2double
(
sum
)
/
ulonglong2double
(
rows
-
nulls
)),
DEC_IN_AVG
);
DEC_IN_AVG
,
my_thd_charset
);
return
s
;
}
String
*
std
(
String
*
s
,
ha_rows
rows
)
{
double
tmp
=
ulonglong2double
(
rows
);
if
(
!
(
tmp
-
nulls
))
s
->
set
((
double
)
0.0
,
1
);
s
->
set
((
double
)
0.0
,
1
,
my_thd_charset
);
else
{
double
tmp2
=
((
ulonglong2double
(
sum_sqr
)
-
ulonglong2double
(
sum
*
sum
)
/
(
tmp
-
nulls
))
/
(
tmp
-
nulls
));
s
->
set
(((
double
)
tmp2
<=
0.0
?
0.0
:
sqrt
(
tmp2
)),
DEC_IN_AVG
);
s
->
set
(((
double
)
tmp2
<=
0.0
?
0.0
:
sqrt
(
tmp2
)),
DEC_IN_AVG
,
my_thd_charset
);
}
return
s
;
}
...
...
sql/sql_string.cc
View file @
85f35cbf
...
...
@@ -91,25 +91,29 @@ bool String::realloc(uint32 alloc_length)
return
FALSE
;
}
bool
String
::
set
(
longlong
num
)
bool
String
::
set
(
longlong
num
,
CHARSET_INFO
*
cs
)
{
if
(
alloc
(
21
))
return
TRUE
;
str_length
=
(
uint32
)
(
longlong10_to_str
(
num
,
Ptr
,
-
10
)
-
Ptr
);
str_charset
=
cs
;
return
FALSE
;
}
bool
String
::
set
(
ulonglong
num
)
bool
String
::
set
(
ulonglong
num
,
CHARSET_INFO
*
cs
)
{
if
(
alloc
(
21
))
return
TRUE
;
str_length
=
(
uint32
)
(
longlong10_to_str
(
num
,
Ptr
,
10
)
-
Ptr
);
str_charset
=
cs
;
return
FALSE
;
}
bool
String
::
set
(
double
num
,
uint
decimals
)
bool
String
::
set
(
double
num
,
uint
decimals
,
CHARSET_INFO
*
cs
)
{
char
buff
[
331
];
str_charset
=
cs
;
if
(
decimals
>=
NOT_FIXED_DEC
)
{
sprintf
(
buff
,
"%.14g"
,
num
);
// Enough for a DATETIME
...
...
sql/sql_string.h
View file @
85f35cbf
...
...
@@ -125,10 +125,9 @@ public:
}
str_charset
=
cs
;
}
bool
set
(
longlong
num
);
/* bool set(long num); */
bool
set
(
ulonglong
num
);
bool
set
(
double
num
,
uint
decimals
=
2
);
bool
set
(
longlong
num
,
CHARSET_INFO
*
cs
);
bool
set
(
ulonglong
num
,
CHARSET_INFO
*
cs
);
bool
set
(
double
num
,
uint
decimals
,
CHARSET_INFO
*
cs
);
inline
void
free
()
{
if
(
alloced
)
...
...
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