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
db3f1108
Commit
db3f1108
authored
Mar 09, 2016
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: remove unused Field::utype values
and FIELDFLAG_xxx constants
parent
42105381
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
45 deletions
+18
-45
sql/field.cc
sql/field.cc
+1
-1
sql/field.h
sql/field.h
+13
-16
sql/sql_table.cc
sql/sql_table.cc
+0
-4
sql/table.cc
sql/table.cc
+1
-1
sql/unireg.cc
sql/unireg.cc
+3
-19
sql/unireg.h
sql/unireg.h
+0
-4
No files found.
sql/field.cc
View file @
db3f1108
...
...
@@ -80,7 +80,7 @@ const char field_separator=',';
NOTE: to avoid 256*256 table, gap in table types numeration is skiped
following #defines describe that gap and how to canculate number of fields
and index of field in thi
a
array.
and index of field in thi
s
array.
*/
#define FIELDTYPE_TEAR_FROM (MYSQL_TYPE_BIT + 1)
#define FIELDTYPE_TEAR_TO (MYSQL_TYPE_NEWDECIMAL - 1)
...
...
sql/field.h
View file @
db3f1108
...
...
@@ -709,10 +709,14 @@ class Field: public Value_source
in more clean way with transition to new text based .frm format.
See also comment for Field_timestamp::Field_timestamp().
*/
enum
utype
{
NONE
,
DATE
,
SHIELD
,
NOEMPTY
,
CASEUP
,
PNR
,
BGNR
,
PGNR
,
YES
,
NO
,
REL
,
CHECK
,
EMPTY
,
UNKNOWN_FIELD
,
CASEDN
,
NEXT_NUMBER
,
INTERVAL_FIELD
,
BIT_FIELD
,
TIMESTAMP_OLD_FIELD
,
CAPITALIZE
,
BLOB_FIELD
,
TIMESTAMP_DN_FIELD
,
TIMESTAMP_UN_FIELD
,
TIMESTAMP_DNUN_FIELD
};
enum
utype
{
NONE
=
0
,
NEXT_NUMBER
=
15
,
// AUTO_INCREMENT
TIMESTAMP_OLD_FIELD
=
18
,
// TIMESTAMP created before 4.1.3
TIMESTAMP_DN_FIELD
=
21
,
// TIMESTAMP DEFAULT NOW()
TIMESTAMP_UN_FIELD
=
22
,
// TIMESTAMP ON UPDATE NOW()
TIMESTAMP_DNUN_FIELD
=
23
// TIMESTAMP DEFAULT NOW() ON UPDATE NOW()
};
enum
geometry_type
{
GEOM_GEOMETRY
=
0
,
GEOM_POINT
=
1
,
GEOM_LINESTRING
=
2
,
GEOM_POLYGON
=
3
,
...
...
@@ -3905,19 +3909,13 @@ bool check_expression(Virtual_column_info *vcol, const char *type,
#define FIELDFLAG_GEOM 2048 // mangled with decimals!
#define FIELDFLAG_TREAT_BIT_AS_CHAR 4096
/* use Field_bit_as_char */
#define FIELDFLAG_LEFT_FULLSCREEN 8192
#define FIELDFLAG_RIGHT_FULLSCREEN 16384
#define FIELDFLAG_FORMAT_NUMBER 16384 // predit: ###,,## in output
#define FIELDFLAG_LONG_DECIMAL 8192
#define FIELDFLAG_NO_DEFAULT 16384
/* sql */
#define FIELDFLAG_SUM ((uint) 32768)// predit: +#fieldflag
#define FIELDFLAG_MAYBE_NULL ((uint) 32768)// sql
#define FIELDFLAG_HEX_ESCAPE ((uint) 0x10000)
#define FIELDFLAG_PACK_SHIFT 3
#define FIELDFLAG_DEC_SHIFT 8
#define FIELDFLAG_MAX_DEC 63
#define FIELDFLAG_NUM_SCREEN_TYPE 0x7F01
#define FIELDFLAG_ALFA_SCREEN_TYPE 0x7800
#define MTYP_TYPENR(type) (type & 127)
/* Remove bits from type */
...
...
@@ -3933,10 +3931,9 @@ bool check_expression(Virtual_column_info *vcol, const char *type,
#define f_is_bitfield(x) (((x) & (FIELDFLAG_BITFIELD | FIELDFLAG_NUMBER)) == FIELDFLAG_BITFIELD)
#define f_is_blob(x) (((x) & (FIELDFLAG_BLOB | FIELDFLAG_NUMBER)) == FIELDFLAG_BLOB)
#define f_is_geom(x) (((x) & (FIELDFLAG_GEOM | FIELDFLAG_NUMBER)) == FIELDFLAG_GEOM)
#define f_is_equ(x) ((x) & (1+2+FIELDFLAG_PACK+31*256))
#define f_settype(x) (((int) x) << FIELDFLAG_PACK_SHIFT)
#define f_maybe_null(x) (x & FIELDFLAG_MAYBE_NULL)
#define f_no_default(x) (x & FIELDFLAG_NO_DEFAULT)
#define f_settype(x) (((int) (x)) << FIELDFLAG_PACK_SHIFT)
#define f_maybe_null(x) ((x) & FIELDFLAG_MAYBE_NULL)
#define f_no_default(x) ((x) & FIELDFLAG_NO_DEFAULT)
#define f_bit_as_char(x) ((x) & FIELDFLAG_TREAT_BIT_AS_CHAR)
#define f_is_hex_escape(x) ((x) & FIELDFLAG_HEX_ESCAPE)
...
...
sql/sql_table.cc
View file @
db3f1108
...
...
@@ -2898,7 +2898,6 @@ int prepare_create_field(Column_definition *sql_field,
if
(
sql_field
->
charset
->
state
&
MY_CS_BINSORT
)
sql_field
->
pack_flag
|=
FIELDFLAG_BINARY
;
sql_field
->
length
=
8
;
// Unireg field length
sql_field
->
unireg_check
=
Field
::
BLOB_FIELD
;
(
*
blob_columns
)
++
;
break
;
case
MYSQL_TYPE_GEOMETRY
:
...
...
@@ -2914,7 +2913,6 @@ int prepare_create_field(Column_definition *sql_field,
if
(
sql_field
->
charset
->
state
&
MY_CS_BINSORT
)
sql_field
->
pack_flag
|=
FIELDFLAG_BINARY
;
sql_field
->
length
=
8
;
// Unireg field length
sql_field
->
unireg_check
=
Field
::
BLOB_FIELD
;
(
*
blob_columns
)
++
;
break
;
#else
...
...
@@ -2950,7 +2948,6 @@ int prepare_create_field(Column_definition *sql_field,
FIELDFLAG_INTERVAL
;
if
(
sql_field
->
charset
->
state
&
MY_CS_BINSORT
)
sql_field
->
pack_flag
|=
FIELDFLAG_BINARY
;
sql_field
->
unireg_check
=
Field
::
INTERVAL_FIELD
;
if
(
check_duplicates_in_interval
(
"ENUM"
,
sql_field
->
field_name
,
sql_field
->
interval
,
sql_field
->
charset
,
&
dup_val_count
))
...
...
@@ -2961,7 +2958,6 @@ int prepare_create_field(Column_definition *sql_field,
FIELDFLAG_BITFIELD
;
if
(
sql_field
->
charset
->
state
&
MY_CS_BINSORT
)
sql_field
->
pack_flag
|=
FIELDFLAG_BINARY
;
sql_field
->
unireg_check
=
Field
::
BIT_FIELD
;
if
(
check_duplicates_in_interval
(
"SET"
,
sql_field
->
field_name
,
sql_field
->
interval
,
sql_field
->
charset
,
&
dup_val_count
))
...
...
sql/table.cc
View file @
db3f1108
...
...
@@ -1724,7 +1724,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
/* Remove >32 decimals from old files */
if
(
share
->
mysql_version
<
100200
)
pack_flag
&=
~
(
FIELDFLAG_LEFT_FULLSCREEN
)
;
pack_flag
&=
~
FIELDFLAG_LONG_DECIMAL
;
if
(
interval_nr
&&
charset
->
mbminlen
>
1
)
{
...
...
sql/unireg.cc
View file @
db3f1108
...
...
@@ -592,7 +592,7 @@ static bool pack_header(THD *thd, uchar *forminfo,
HA_CREATE_INFO
*
create_info
,
ulong
data_offset
,
handler
*
file
)
{
uint
length
,
int_count
,
int_length
,
no_empty
,
int_parts
;
uint
length
,
int_count
,
int_length
,
int_parts
;
uint
time_stamp_pos
,
null_fields
;
uint
table_options
=
create_info
->
table_options
;
size_t
reclength
,
totlength
,
n_length
,
com_length
,
expression_length
;
...
...
@@ -606,7 +606,7 @@ static bool pack_header(THD *thd, uchar *forminfo,
totlength
=
0L
;
reclength
=
data_offset
;
no_empty
=
int_count
=
int_parts
=
int_length
=
time_stamp_pos
=
null_fields
=
0
;
int_count
=
int_parts
=
int_length
=
time_stamp_pos
=
null_fields
=
0
;
com_length
=
0
;
n_length
=
2L
;
create_info
->
field_check_constraints
=
0
;
...
...
@@ -640,13 +640,6 @@ static bool pack_header(THD *thd, uchar *forminfo,
totlength
+=
field
->
length
;
com_length
+=
field
->
comment
.
length
;
if
(
MTYP_TYPENR
(
field
->
unireg_check
)
==
Field
::
NOEMPTY
||
field
->
unireg_check
&
MTYP_NOEMPTY_BIT
)
{
field
->
unireg_check
=
(
Field
::
utype
)
((
uint
)
field
->
unireg_check
|
MTYP_NOEMPTY_BIT
);
no_empty
++
;
}
/*
We mark first TIMESTAMP field with NOW() in DEFAULT or ON UPDATE
as auto-update field.
...
...
@@ -745,7 +738,7 @@ static bool pack_header(THD *thd, uchar *forminfo,
int2store
(
forminfo
+
258
,
create_fields
.
elements
);
int2store
(
forminfo
+
260
,
0
);
// Screen length, not used anymore
int2store
(
forminfo
+
262
,
totlength
);
int2store
(
forminfo
+
264
,
no_empty
);
int2store
(
forminfo
+
264
,
0
);
// unused
int2store
(
forminfo
+
266
,
reclength
);
int2store
(
forminfo
+
268
,
n_length
);
int2store
(
forminfo
+
270
,
int_count
);
...
...
@@ -998,7 +991,6 @@ static bool make_empty_rec(THD *thd, uchar *buff, uint table_options,
uint
reclength
,
ulong
data_offset
)
{
int
error
=
0
;
Field
::
utype
type
;
uint
null_count
;
uchar
*
null_pos
;
TABLE
table
;
...
...
@@ -1061,8 +1053,6 @@ static bool make_empty_rec(THD *thd, uchar *buff, uint table_options,
if
(
field
->
sql_type
==
MYSQL_TYPE_BIT
&&
!
f_bit_as_char
(
field
->
pack_flag
))
null_count
+=
field
->
length
&
7
;
type
=
(
Field
::
utype
)
MTYP_TYPENR
(
field
->
unireg_check
);
if
(
field
->
default_value
&&
!
field
->
has_default_expression
())
{
int
res
=
field
->
default_value
->
expr_item
->
save_in_field
(
regfield
,
1
);
...
...
@@ -1081,12 +1071,6 @@ static bool make_empty_rec(THD *thd, uchar *buff, uint table_options,
regfield
->
set_notnull
();
regfield
->
store
((
longlong
)
1
,
TRUE
);
}
else
if
(
type
==
Field
::
YES
)
// Old unireg type
regfield
->
store
(
ER_THD
(
thd
,
ER_YES
),(
uint
)
strlen
(
ER_THD
(
thd
,
ER_YES
)),
system_charset_info
);
else
if
(
type
==
Field
::
NO
)
// Old unireg type
regfield
->
store
(
ER_THD
(
thd
,
ER_NO
),
(
uint
)
strlen
(
ER_THD
(
thd
,
ER_NO
)),
system_charset_info
);
else
regfield
->
reset
();
}
...
...
sql/unireg.h
View file @
db3f1108
...
...
@@ -142,10 +142,6 @@
*/
#define OPEN_TRIGGER_ONLY (OPTIMIZE_I_S_TABLE*2)
#define SC_INFO_LENGTH 4
/* Form format constant */
#define TE_INFO_LENGTH 3
#define MTYP_NOEMPTY_BIT 128
/*
Minimum length pattern before Turbo Boyer-Moore is used
for SELECT "text" LIKE "%pattern%", excluding the two
...
...
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