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
d437c35d
Commit
d437c35d
authored
Jun 11, 2015
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding a few warning related protected methods in Field and reducing
some duplicate code.
parent
36f37a48
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
115 additions
and
109 deletions
+115
-109
sql/field.cc
sql/field.cc
+93
-109
sql/field.h
sql/field.h
+22
-0
No files found.
sql/field.cc
View file @
d437c35d
This diff is collapsed.
Click to expand it.
sql/field.h
View file @
d437c35d
...
@@ -885,14 +885,32 @@ public:
...
@@ -885,14 +885,32 @@ public:
virtual
int
set_time
()
{
return
1
;
}
virtual
int
set_time
()
{
return
1
;
}
bool
set_warning
(
Sql_condition
::
enum_warning_level
,
unsigned
int
code
,
bool
set_warning
(
Sql_condition
::
enum_warning_level
,
unsigned
int
code
,
int
cuted_increment
)
const
;
int
cuted_increment
)
const
;
protected:
bool
set_warning
(
unsigned
int
code
,
int
cuted_increment
)
const
{
return
set_warning
(
Sql_condition
::
WARN_LEVEL_WARN
,
code
,
cuted_increment
);
}
bool
set_note
(
unsigned
int
code
,
int
cuted_increment
)
const
{
return
set_warning
(
Sql_condition
::
WARN_LEVEL_NOTE
,
code
,
cuted_increment
);
}
void
set_datetime_warning
(
Sql_condition
::
enum_warning_level
,
uint
code
,
void
set_datetime_warning
(
Sql_condition
::
enum_warning_level
,
uint
code
,
const
ErrConv
*
str
,
timestamp_type
ts_type
,
const
ErrConv
*
str
,
timestamp_type
ts_type
,
int
cuted_increment
);
int
cuted_increment
);
void
set_datetime_warning
(
uint
code
,
const
ErrConv
*
str
,
timestamp_type
ts_type
,
int
cuted_increment
)
{
set_datetime_warning
(
Sql_condition
::
WARN_LEVEL_WARN
,
code
,
str
,
ts_type
,
cuted_increment
);
}
void
set_warning_truncated_wrong_value
(
const
char
*
type
,
const
char
*
value
);
inline
bool
check_overflow
(
int
op_result
)
inline
bool
check_overflow
(
int
op_result
)
{
{
return
(
op_result
==
E_DEC_OVERFLOW
);
return
(
op_result
==
E_DEC_OVERFLOW
);
}
}
int
warn_if_overflow
(
int
op_result
);
int
warn_if_overflow
(
int
op_result
);
public:
void
set_table_name
(
String
*
alias
)
void
set_table_name
(
String
*
alias
)
{
{
table_name
=
&
alias
->
Ptr
;
table_name
=
&
alias
->
Ptr
;
...
@@ -1139,6 +1157,10 @@ class Field_longstr :public Field_str
...
@@ -1139,6 +1157,10 @@ class Field_longstr :public Field_str
protected:
protected:
int
report_if_important_data
(
const
char
*
ptr
,
const
char
*
end
,
int
report_if_important_data
(
const
char
*
ptr
,
const
char
*
end
,
bool
count_spaces
);
bool
count_spaces
);
bool
check_string_copy_error
(
const
char
*
well_formed_error_pos
,
const
char
*
cannot_convert_error_pos
,
const
char
*
end
,
CHARSET_INFO
*
cs
);
public:
public:
Field_longstr
(
uchar
*
ptr_arg
,
uint32
len_arg
,
uchar
*
null_ptr_arg
,
Field_longstr
(
uchar
*
ptr_arg
,
uint32
len_arg
,
uchar
*
null_ptr_arg
,
uchar
null_bit_arg
,
utype
unireg_check_arg
,
uchar
null_bit_arg
,
utype
unireg_check_arg
,
...
...
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