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
4233b284
Commit
4233b284
authored
Apr 19, 2019
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-19283 Move the code from Field_str::is_equal() to Field_string::is_equal()
parent
878ca5ca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
sql/field.cc
sql/field.cc
+11
-6
sql/field.h
sql/field.h
+3
-2
No files found.
sql/field.cc
View file @
4233b284
...
...
@@ -2436,6 +2436,15 @@ void Field_null::sql_type(String &res) const
}
uint
Field_null
::
is_equal
(
Create_field
*
new_field
)
{
DBUG_ASSERT
(
!
compression_method
());
return
new_field
->
type_handler
()
==
type_handler
()
&&
new_field
->
charset
==
field_charset
&&
new_field
->
length
==
max_display_length
();
}
/****************************************************************************
Field_row, e.g. for ROW-type SP variables
****************************************************************************/
...
...
@@ -7069,14 +7078,10 @@ int Field_str::store(double nr)
return
store
(
buff
,
(
uint
)
length
,
&
my_charset_numeric
);
}
uint
Field
::
is_equal
(
Create_field
*
new_field
)
{
return
new_field
->
type_handler
()
==
type_handler
();
}
uint
Field_str
::
is_equal
(
Create_field
*
new_field
)
uint
Field_str
ing
::
is_equal
(
Create_field
*
new_field
)
{
DBUG_ASSERT
(
!
compression_method
());
if
(
new_field
->
type_handler
()
!=
type_handler
())
return
IS_EQUAL_NO
;
if
(
new_field
->
length
<
max_display_length
())
...
...
sql/field.h
View file @
4233b284
...
...
@@ -1504,7 +1504,7 @@ class Field: public Value_source
of a table is compatible with the old definition so that it can
determine if data needs to be copied over (table data change).
*/
virtual
uint
is_equal
(
Create_field
*
new_field
);
virtual
uint
is_equal
(
Create_field
*
new_field
)
=
0
;
/* convert decimal to longlong with overflow check */
longlong
convert_decimal2longlong
(
const
my_decimal
*
val
,
bool
unsigned_flag
,
int
*
err
);
...
...
@@ -1868,7 +1868,6 @@ class Field_str :public Field {
my_decimal
*
val_decimal
(
my_decimal
*
);
bool
val_bool
()
{
return
val_real
()
!=
0e0
;
}
virtual
bool
str_needs_quotes
()
{
return
TRUE
;
}
uint
is_equal
(
Create_field
*
new_field
);
bool
eq_cmp_as_binary
()
{
return
MY_TEST
(
flags
&
BINARY_FLAG
);
}
virtual
uint
length_size
()
{
return
0
;
}
double
pos_in_interval
(
Field
*
min
,
Field
*
max
)
...
...
@@ -2640,6 +2639,7 @@ class Field_null :public Field_str {
my_decimal
*
val_decimal
(
my_decimal
*
)
{
return
0
;
}
String
*
val_str
(
String
*
value
,
String
*
value2
)
{
value2
->
length
(
0
);
return
value2
;}
uint
is_equal
(
Create_field
*
new_field
);
int
cmp
(
const
uchar
*
a
,
const
uchar
*
b
)
{
return
0
;}
void
sort_string
(
uchar
*
buff
,
uint
length
)
{}
uint32
pack_length
()
const
{
return
0
;
}
...
...
@@ -3563,6 +3563,7 @@ class Field_string :public Field_longstr {
int
cmp
(
const
uchar
*
,
const
uchar
*
);
void
sort_string
(
uchar
*
buff
,
uint
length
);
void
sql_type
(
String
&
str
)
const
;
uint
is_equal
(
Create_field
*
new_field
);
virtual
uchar
*
pack
(
uchar
*
to
,
const
uchar
*
from
,
uint
max_length
);
virtual
const
uchar
*
unpack
(
uchar
*
to
,
const
uchar
*
from
,
...
...
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