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
16366564
Commit
16366564
authored
Jun 10, 2019
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-19724 Add Field::tmp_engine_column_type()
parent
b6851095
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
20 deletions
+26
-20
sql/field.cc
sql/field.cc
+6
-0
sql/field.h
sql/field.h
+18
-0
sql/opt_subselect.cc
sql/opt_subselect.cc
+1
-9
sql/sql_select.cc
sql/sql_select.cc
+1
-11
No files found.
sql/field.cc
View file @
16366564
...
...
@@ -7529,6 +7529,12 @@ Field *Field_string::make_new_field(MEM_ROOT *root, TABLE *new_table,
}
en_fieldtype
Field_string
::
tmp_engine_column_type
(
bool
use_packed_rows
)
const
{
return
field_length
>=
MIN_STRING_LENGTH_TO_PACK_ROWS
?
FIELD_SKIP_ENDSPACE
:
FIELD_NORMAL
;
}
/****************************************************************************
VARCHAR type
Data in field->ptr is stored as:
...
...
sql/field.h
View file @
16366564
...
...
@@ -1125,6 +1125,10 @@ class Field: public Value_source
*/
return
type
();
}
virtual
en_fieldtype
tmp_engine_column_type
(
bool
use_packed_rows
)
const
{
return
FIELD_NORMAL
;
}
/*
Conversion type for from the source to the current field.
*/
...
...
@@ -3647,6 +3651,7 @@ class Field_string :public Field_longstr {
}
enum
ha_base_keytype
key_type
()
const
{
return
binary
()
?
HA_KEYTYPE_BINARY
:
HA_KEYTYPE_TEXT
;
}
en_fieldtype
tmp_engine_column_type
(
bool
use_packed_rows
)
const
;
bool
zero_pack
()
const
{
return
0
;
}
Copy_func
*
get_copy_func
(
const
Field
*
from
)
const
;
int
reset
(
void
)
...
...
@@ -3747,6 +3752,10 @@ class Field_varstring :public Field_longstr {
}
const
Type_handler
*
type_handler
()
const
{
return
&
type_handler_varchar
;
}
en_fieldtype
tmp_engine_column_type
(
bool
use_packed_rows
)
const
{
return
FIELD_VARCHAR
;
}
enum
ha_base_keytype
key_type
()
const
;
uint16
key_part_flag
()
const
{
return
HA_VAR_LENGTH_PART
;
}
uint16
key_part_length_bytes
()
const
{
return
HA_KEY_BLOB_LENGTH
;
}
...
...
@@ -3967,6 +3976,10 @@ class Field_blob :public Field_longstr {
{
return
binary
()
?
HA_KEYTYPE_VARBINARY2
:
HA_KEYTYPE_VARTEXT2
;
}
uint16
key_part_flag
()
const
{
return
HA_BLOB_PART
;
}
uint16
key_part_length_bytes
()
const
{
return
HA_KEY_BLOB_LENGTH
;
}
en_fieldtype
tmp_engine_column_type
(
bool
use_packed_rows
)
const
{
return
FIELD_BLOB
;
}
Type_std_attributes
type_std_attributes
()
const
{
return
Type_std_attributes
(
Field_blob
::
max_display_length
(),
decimals
(),
...
...
@@ -4632,6 +4645,11 @@ class Field_row: public Field_null
m_table
(
NULL
)
{}
~
Field_row
();
en_fieldtype
tmp_engine_column_type
(
bool
use_packed_rows
)
const
{
DBUG_ASSERT
(
0
);
return
Field
::
tmp_engine_column_type
(
use_packed_rows
);
}
enum_conv_type
rpl_conv_type_from
(
const
Conv_source
&
source
,
const
Relay_log_info
*
rli
,
const
Conv_param
&
param
)
const
...
...
sql/opt_subselect.cc
View file @
16366564
...
...
@@ -4483,15 +4483,7 @@ SJ_TMP_TABLE::create_sj_weedout_tmp_table(THD *thd)
/* Make entry for create table */
recinfo
->
length
=
length
;
if
(
field
->
flags
&
BLOB_FLAG
)
recinfo
->
type
=
FIELD_BLOB
;
else
if
(
use_packed_rows
&&
field
->
real_type
()
==
MYSQL_TYPE_STRING
&&
length
>=
MIN_STRING_LENGTH_TO_PACK_ROWS
)
recinfo
->
type
=
FIELD_SKIP_ENDSPACE
;
else
recinfo
->
type
=
FIELD_NORMAL
;
recinfo
->
type
=
field
->
tmp_engine_column_type
(
use_packed_rows
);
field
->
set_table_name
(
&
table
->
alias
);
}
...
...
sql/sql_select.cc
View file @
16366564
...
...
@@ -18378,17 +18378,7 @@ bool Create_tmp_table::finalize(THD *thd,
/* Make entry for create table */
recinfo
->
length
=
length
;
if
(
field
->
flags
&
BLOB_FLAG
)
recinfo
->
type
=
FIELD_BLOB
;
else
if
(
use_packed_rows
&&
field
->
real_type
()
==
MYSQL_TYPE_STRING
&&
length
>=
MIN_STRING_LENGTH_TO_PACK_ROWS
)
recinfo
->
type
=
FIELD_SKIP_ENDSPACE
;
else
if
(
field
->
real_type
()
==
MYSQL_TYPE_VARCHAR
)
recinfo
->
type
=
FIELD_VARCHAR
;
else
recinfo
->
type
=
FIELD_NORMAL
;
recinfo
->
type
=
field
->
tmp_engine_column_type
(
use_packed_rows
);
if
(
!--
m_hidden_field_count
)
m_null_count
=
(
m_null_count
+
7
)
&
~
7
;
// move to next byte
...
...
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