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
34ee747f
Commit
34ee747f
authored
Feb 10, 2018
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: remove MARK_COLUMNS_NONE
parent
103715d0
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
20 additions
and
15 deletions
+20
-15
sql/item.cc
sql/item.cc
+4
-3
sql/sql_base.cc
sql/sql_base.cc
+2
-2
sql/sql_class.h
sql/sql_class.h
+6
-2
sql/sql_do.cc
sql/sql_do.cc
+1
-1
sql/sql_insert.cc
sql/sql_insert.cc
+1
-1
sql/sql_partition.cc
sql/sql_partition.cc
+1
-1
sql/sql_prepare.cc
sql/sql_prepare.cc
+3
-3
sql/sql_view.cc
sql/sql_view.cc
+1
-1
sql/table.cc
sql/table.cc
+1
-1
No files found.
sql/item.cc
View file @
34ee747f
...
...
@@ -6214,7 +6214,7 @@ bool Item_field::fix_fields(THD *thd, Item **reference)
set_field
(
from_field
);
}
else
if
(
thd
->
column_usage
!=
MARK_COLUMNS_NONE
)
else
if
(
should_mark_column
(
thd
->
column_usage
)
)
{
TABLE
*
table
=
field
->
table
;
MY_BITMAP
*
current_bitmap
,
*
other_bitmap
;
...
...
@@ -9248,7 +9248,7 @@ bool Item_default_value::fix_fields(THD *thd, Item **items)
if
(
!
newptr
)
goto
error
;
fix_session_vcol_expr_for_read
(
thd
,
def_field
,
def_field
->
default_value
);
if
(
thd
->
column_usage
!=
MARK_COLUMNS_NONE
)
if
(
should_mark_column
(
thd
->
column_usage
)
)
def_field
->
default_value
->
expr
->
walk
(
&
Item
::
register_field_in_read_map
,
1
,
0
);
def_field
->
move_field
(
newptr
+
1
,
def_field
->
maybe_null
()
?
newptr
:
0
,
1
);
}
...
...
@@ -9527,7 +9527,8 @@ void Item_trigger_field::setup_field(THD *thd, TABLE *table,
method which is called during execution of these statements.
*/
enum_column_usage
saved_column_usage
=
thd
->
column_usage
;
thd
->
column_usage
=
MARK_COLUMNS_NONE
;
thd
->
column_usage
=
want_privilege
==
SELECT_ACL
?
COLUMNS_READ
:
COLUMNS_WRITE
;
/*
Try to find field by its name and if it will be found
set field_idx properly.
...
...
sql/sql_base.cc
View file @
34ee747f
...
...
@@ -5352,7 +5352,7 @@ Field *view_ref_found= (Field*) 0x2;
static
void
update_field_dependencies
(
THD
*
thd
,
Field
*
field
,
TABLE
*
table
)
{
DBUG_ENTER
(
"update_field_dependencies"
);
if
(
thd
->
column_usage
!=
MARK_COLUMNS_NONE
)
if
(
should_mark_column
(
thd
->
column_usage
)
)
{
MY_BITMAP
*
bitmap
;
...
...
@@ -5834,7 +5834,7 @@ find_field_in_table_ref(THD *thd, TABLE_LIST *table_list,
fld
=
WRONG_GRANT
;
else
#endif
if
(
thd
->
column_usage
!=
MARK_COLUMNS_NONE
)
if
(
should_mark_column
(
thd
->
column_usage
)
)
{
/*
Get rw_set correct for this field so that the handler
...
...
sql/sql_class.h
View file @
34ee747f
...
...
@@ -94,7 +94,8 @@ enum enum_slave_type_conversions { SLAVE_TYPE_CONVERSIONS_ALL_LOSSY,
SLAVE_TYPE_CONVERSIONS_ALL_NON_LOSSY
};
/*
MARK_COLUMNS_NONE: It is unknown whether the column will be read or written
MARK_COLUMNS_READ: A column is goind to be read.
MARK_COLUMNS_WRITE: A column is going to be written to.
MARK_COLUMNS_READ: A column is goind to be read.
A bit in read set is set to inform handler that the field
is to be read. If field list contains duplicates, then
...
...
@@ -105,7 +106,10 @@ enum enum_slave_type_conversions { SLAVE_TYPE_CONVERSIONS_ALL_LOSSY,
to update this field in write_row and update_row.
*/
enum
enum_column_usage
{
MARK_COLUMNS_NONE
,
MARK_COLUMNS_READ
,
MARK_COLUMNS_WRITE
};
{
COLUMNS_READ
,
COLUMNS_WRITE
,
MARK_COLUMNS_READ
,
MARK_COLUMNS_WRITE
};
static
inline
bool
should_mark_column
(
enum_column_usage
column_usage
)
{
return
column_usage
>=
MARK_COLUMNS_READ
;
}
enum
enum_filetype
{
FILETYPE_CSV
,
FILETYPE_XML
};
...
...
sql/sql_do.cc
View file @
34ee747f
...
...
@@ -29,7 +29,7 @@ bool mysql_do(THD *thd, List<Item> &values)
List_iterator
<
Item
>
li
(
values
);
Item
*
value
;
DBUG_ENTER
(
"mysql_do"
);
if
(
setup_fields
(
thd
,
Ref_ptr_array
(),
values
,
MARK_COLUMNS_NONE
,
0
,
NULL
,
0
))
if
(
setup_fields
(
thd
,
Ref_ptr_array
(),
values
,
COLUMNS_READ
,
0
,
NULL
,
0
))
DBUG_RETURN
(
TRUE
);
while
((
value
=
li
++
))
(
void
)
value
->
is_null
();
...
...
sql/sql_insert.cc
View file @
34ee747f
...
...
@@ -1315,7 +1315,7 @@ static bool check_view_insertability(THD * thd, TABLE_LIST *view)
we must not set query_id for fields as they're not
really used in this context
*/
thd
->
column_usage
=
MARK_COLUMNS_NON
E
;
thd
->
column_usage
=
COLUMNS_WRIT
E
;
/* check simplicity and prepare unique test of view */
for
(
trans
=
trans_start
;
trans
!=
trans_end
;
trans
++
)
{
...
...
sql/sql_partition.cc
View file @
34ee747f
...
...
@@ -1590,7 +1590,7 @@ bool fix_partition_func(THD *thd, TABLE *table,
{
DBUG_RETURN
(
FALSE
);
}
thd
->
column_usage
=
MARK_COLUMNS_NON
E
;
thd
->
column_usage
=
COLUMNS_WRIT
E
;
DBUG_PRINT
(
"info"
,
(
"thd->column_usage: %d"
,
thd
->
column_usage
));
if
(
!
is_create_table_ind
||
...
...
sql/sql_prepare.cc
View file @
34ee747f
...
...
@@ -1318,7 +1318,7 @@ static bool mysql_test_insert(Prepared_statement *stmt,
goto
error
;
}
if
(
setup_fields
(
thd
,
Ref_ptr_array
(),
*
values
,
MARK_COLUMNS_NONE
,
0
,
NULL
,
0
))
*
values
,
COLUMNS_READ
,
0
,
NULL
,
0
))
goto
error
;
}
}
...
...
@@ -1424,7 +1424,7 @@ static int mysql_test_update(Prepared_statement *stmt,
table_list
->
register_want_access
(
SELECT_ACL
);
#endif
if
(
setup_fields
(
thd
,
Ref_ptr_array
(),
stmt
->
lex
->
value_list
,
MARK_COLUMNS_NONE
,
0
,
NULL
,
0
)
||
stmt
->
lex
->
value_list
,
COLUMNS_READ
,
0
,
NULL
,
0
)
||
check_unique_table
(
thd
,
table_list
))
goto
error
;
/* TODO: here we should send types of placeholders to the client. */
...
...
@@ -1597,7 +1597,7 @@ static bool mysql_test_do_fields(Prepared_statement *stmt,
DT_PREPARE
|
DT_CREATE
))
DBUG_RETURN
(
TRUE
);
DBUG_RETURN
(
setup_fields
(
thd
,
Ref_ptr_array
(),
*
values
,
MARK_COLUMNS_NONE
,
0
,
NULL
,
0
));
*
values
,
COLUMNS_READ
,
0
,
NULL
,
0
));
}
...
...
sql/sql_view.cc
View file @
34ee747f
...
...
@@ -1935,7 +1935,7 @@ bool check_key_in_view(THD *thd, TABLE_LIST *view)
marking as used fields which are not used
*/
enum_column_usage
saved_column_usage
=
thd
->
column_usage
;
thd
->
column_usage
=
MARK_COLUMNS_NON
E
;
thd
->
column_usage
=
COLUMNS_WRIT
E
;
DBUG_PRINT
(
"info"
,
(
"thd->column_usage: %d"
,
thd
->
column_usage
));
for
(
Field_translator
*
fld
=
trans
;
fld
<
end_of_trans
;
fld
++
)
{
...
...
sql/table.cc
View file @
34ee747f
...
...
@@ -2859,7 +2859,7 @@ static bool fix_vcol_expr(THD *thd, Virtual_column_info *vcol)
DBUG_ENTER
(
"fix_vcol_expr"
);
const
enum
enum_column_usage
saved_column_usage
=
thd
->
column_usage
;
thd
->
column_usage
=
MARK_COLUMNS_NON
E
;
thd
->
column_usage
=
COLUMNS_WRIT
E
;
int
error
=
vcol
->
expr
->
fix_fields
(
thd
,
&
vcol
->
expr
);
...
...
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