Commit d437c35d authored by Alexander Barkov's avatar Alexander Barkov

Adding a few warning related protected methods in Field and reducing

some duplicate code.
parent 36f37a48
This diff is collapsed.
...@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment