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
2ecf2f9b
Commit
2ecf2f9b
authored
Feb 03, 2018
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding "const" qualifier to the MYSQL_TIME* argument of Field::store_time_dec()
parent
705283f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
17 deletions
+17
-17
sql/field.cc
sql/field.cc
+8
-8
sql/field.h
sql/field.h
+9
-9
No files found.
sql/field.cc
View file @
2ecf2f9b
...
...
@@ -2196,7 +2196,7 @@ bool Field::get_date(MYSQL_TIME *ltime,ulonglong fuzzydate)
Needs to be changed if/when we want to support different time formats.
*/
int
Field
::
store_time_dec
(
MYSQL_TIME
*
ltime
,
uint
dec
)
int
Field
::
store_time_dec
(
const
MYSQL_TIME
*
ltime
,
uint
dec
)
{
ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED
;
char
buff
[
MAX_DATE_STRING_REP_LENGTH
];
...
...
@@ -3241,7 +3241,7 @@ int Field_new_decimal::store_decimal(const my_decimal *decimal_value)
}
int
Field_new_decimal
::
store_time_dec
(
MYSQL_TIME
*
ltime
,
uint
dec_arg
)
int
Field_new_decimal
::
store_time_dec
(
const
MYSQL_TIME
*
ltime
,
uint
dec_arg
)
{
my_decimal
decimal_value
;
return
store_value
(
date2my_decimal
(
ltime
,
&
decimal_value
));
...
...
@@ -3480,7 +3480,7 @@ Item *Field_new_decimal::get_equal_const_item(THD *thd, const Context &ctx,
}
int
Field_num
::
store_time_dec
(
MYSQL_TIME
*
ltime
,
uint
dec_arg
)
int
Field_num
::
store_time_dec
(
const
MYSQL_TIME
*
ltime
,
uint
dec_arg
)
{
longlong
v
=
TIME_to_ulonglong
(
ltime
);
if
(
ltime
->
neg
==
0
)
...
...
@@ -4734,7 +4734,7 @@ int Field_real::store_decimal(const my_decimal *dm)
return
store
(
dbl
);
}
int
Field_real
::
store_time_dec
(
MYSQL_TIME
*
ltime
,
uint
dec_arg
)
int
Field_real
::
store_time_dec
(
const
MYSQL_TIME
*
ltime
,
uint
dec_arg
)
{
return
store
(
TIME_to_double
(
ltime
));
}
...
...
@@ -5016,7 +5016,7 @@ copy_or_convert_to_datetime(THD *thd, const MYSQL_TIME *from, MYSQL_TIME *to)
}
int
Field_timestamp
::
store_time_dec
(
MYSQL_TIME
*
ltime
,
uint
dec
)
int
Field_timestamp
::
store_time_dec
(
const
MYSQL_TIME
*
ltime
,
uint
dec
)
{
int
unused
;
ErrConvTime
str
(
ltime
);
...
...
@@ -5582,7 +5582,7 @@ int Field_temporal_with_date::store(longlong nr, bool unsigned_val)
}
int
Field_temporal_with_date
::
store_time_dec
(
MYSQL_TIME
*
ltime
,
uint
dec
)
int
Field_temporal_with_date
::
store_time_dec
(
const
MYSQL_TIME
*
ltime
,
uint
dec
)
{
int
error
=
0
,
have_smth_to_conv
=
1
;
ErrConvTime
str
(
ltime
);
...
...
@@ -5774,7 +5774,7 @@ static void calc_datetime_days_diff(MYSQL_TIME *ltime, long days)
}
int
Field_time
::
store_time_dec
(
MYSQL_TIME
*
ltime
,
uint
dec
)
int
Field_time
::
store_time_dec
(
const
MYSQL_TIME
*
ltime
,
uint
dec
)
{
MYSQL_TIME
l_time
=
*
ltime
;
ErrConvTime
str
(
ltime
);
...
...
@@ -6234,7 +6234,7 @@ int Field_year::store(longlong nr, bool unsigned_val)
}
int
Field_year
::
store_time_dec
(
MYSQL_TIME
*
ltime
,
uint
dec_arg
)
int
Field_year
::
store_time_dec
(
const
MYSQL_TIME
*
ltime
,
uint
dec_arg
)
{
ErrConvTime
str
(
ltime
);
if
(
Field_year
::
store
(
ltime
->
year
,
0
))
...
...
sql/field.h
View file @
2ecf2f9b
...
...
@@ -815,9 +815,9 @@ class Field: public Value_source
virtual
int
store
(
double
nr
)
=
0
;
virtual
int
store
(
longlong
nr
,
bool
unsigned_val
)
=
0
;
virtual
int
store_decimal
(
const
my_decimal
*
d
)
=
0
;
virtual
int
store_time_dec
(
MYSQL_TIME
*
ltime
,
uint
dec
);
virtual
int
store_time_dec
(
const
MYSQL_TIME
*
ltime
,
uint
dec
);
virtual
int
store_timestamp
(
my_time_t
timestamp
,
ulong
sec_part
);
int
store_time
(
MYSQL_TIME
*
ltime
)
int
store_time
(
const
MYSQL_TIME
*
ltime
)
{
return
store_time_dec
(
ltime
,
TIME_SECOND_PART_DIGITS
);
}
int
store
(
const
char
*
to
,
uint
length
,
CHARSET_INFO
*
cs
,
enum_check_fields
check_level
);
...
...
@@ -1673,7 +1673,7 @@ class Field_num :public Field {
field_metadata
,
length
));
return
length
;
}
int
store_time_dec
(
MYSQL_TIME
*
ltime
,
uint
dec
);
int
store_time_dec
(
const
MYSQL_TIME
*
ltime
,
uint
dec
);
double
pos_in_interval
(
Field
*
min
,
Field
*
max
)
{
return
pos_in_interval_val_real
(
min
,
max
);
...
...
@@ -1813,7 +1813,7 @@ class Field_real :public Field_num {
field_length
>=
from
->
field_length
;
}
int
store_decimal
(
const
my_decimal
*
);
int
store_time_dec
(
MYSQL_TIME
*
ltime
,
uint
dec
);
int
store_time_dec
(
const
MYSQL_TIME
*
ltime
,
uint
dec
);
bool
get_date
(
MYSQL_TIME
*
ltime
,
ulonglong
fuzzydate
);
my_decimal
*
val_decimal
(
my_decimal
*
);
bool
val_bool
()
{
return
val_real
()
!=
0e0
;
}
...
...
@@ -1903,7 +1903,7 @@ class Field_new_decimal :public Field_num {
int
store
(
const
char
*
to
,
uint
length
,
CHARSET_INFO
*
charset
);
int
store
(
double
nr
);
int
store
(
longlong
nr
,
bool
unsigned_val
);
int
store_time_dec
(
MYSQL_TIME
*
ltime
,
uint
dec
);
int
store_time_dec
(
const
MYSQL_TIME
*
ltime
,
uint
dec
);
int
store_decimal
(
const
my_decimal
*
);
double
val_real
(
void
);
longlong
val_int
(
void
);
...
...
@@ -2382,7 +2382,7 @@ class Field_temporal_with_date: public Field_temporal {
int
store
(
const
char
*
to
,
uint
length
,
CHARSET_INFO
*
charset
);
int
store
(
double
nr
);
int
store
(
longlong
nr
,
bool
unsigned_val
);
int
store_time_dec
(
MYSQL_TIME
*
ltime
,
uint
dec
);
int
store_time_dec
(
const
MYSQL_TIME
*
ltime
,
uint
dec
);
int
store_decimal
(
const
my_decimal
*
);
bool
validate_value_in_record
(
THD
*
thd
,
const
uchar
*
record
)
const
;
};
...
...
@@ -2404,7 +2404,7 @@ class Field_timestamp :public Field_temporal {
int
store
(
const
char
*
to
,
uint
length
,
CHARSET_INFO
*
charset
);
int
store
(
double
nr
);
int
store
(
longlong
nr
,
bool
unsigned_val
);
int
store_time_dec
(
MYSQL_TIME
*
ltime
,
uint
dec
);
int
store_time_dec
(
const
MYSQL_TIME
*
ltime
,
uint
dec
);
int
store_decimal
(
const
my_decimal
*
);
int
store_timestamp
(
my_time_t
timestamp
,
ulong
sec_part
);
int
save_in_field
(
Field
*
to
);
...
...
@@ -2601,7 +2601,7 @@ class Field_year :public Field_tiny {
int
store
(
const
char
*
to
,
uint
length
,
CHARSET_INFO
*
charset
);
int
store
(
double
nr
);
int
store
(
longlong
nr
,
bool
unsigned_val
);
int
store_time_dec
(
MYSQL_TIME
*
ltime
,
uint
dec
);
int
store_time_dec
(
const
MYSQL_TIME
*
ltime
,
uint
dec
);
double
val_real
(
void
);
longlong
val_int
(
void
);
String
*
val_str
(
String
*
,
String
*
);
...
...
@@ -2711,7 +2711,7 @@ class Field_time :public Field_temporal {
return
real_type
()
==
from
->
real_type
()
&&
decimals
()
==
from
->
decimals
();
}
int
store_time_dec
(
MYSQL_TIME
*
ltime
,
uint
dec
);
int
store_time_dec
(
const
MYSQL_TIME
*
ltime
,
uint
dec
);
int
store
(
const
char
*
to
,
uint
length
,
CHARSET_INFO
*
charset
);
int
store
(
double
nr
);
int
store
(
longlong
nr
,
bool
unsigned_val
);
...
...
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