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
6a7911d4
Commit
6a7911d4
authored
Nov 30, 2017
by
Sergei Golubchik
Committed by
Aleksey Midenkov
Dec 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
has_vers_fields should be calculated per table, not globally
parent
9d2f1dde
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
sql/sql_update.cc
sql/sql_update.cc
+12
-5
No files found.
sql/sql_update.cc
View file @
6a7911d4
...
...
@@ -155,14 +155,20 @@ static bool check_fields(THD *thd, List<Item> &items)
return
FALSE
;
}
static
bool
check_has_vers_fields
(
List
<
Item
>
&
items
)
static
bool
check_has_vers_fields
(
TABLE
*
table
,
List
<
Item
>
&
items
)
{
List_iterator
<
Item
>
it
(
items
);
if
(
!
table
->
versioned
())
return
false
;
while
(
Item
*
item
=
it
++
)
{
if
(
Item_field
*
item_field
=
item
->
field_for_view_update
())
if
(
!
item_field
->
field
->
vers_update_unversioned
())
{
Field
*
field
=
item_field
->
field
;
if
(
field
->
table
==
table
&&
!
field
->
vers_update_unversioned
())
return
true
;
}
}
return
false
;
}
...
...
@@ -369,8 +375,7 @@ int mysql_update(THD *thd,
{
DBUG_RETURN
(
1
);
}
bool
has_vers_fields
=
table
->
versioned
()
?
check_has_vers_fields
(
fields
)
:
false
;
bool
has_vers_fields
=
check_has_vers_fields
(
table
,
fields
);
if
(
check_key_in_view
(
thd
,
table_list
))
{
my_error
(
ER_NON_UPDATABLE_TABLE
,
MYF
(
0
),
table_list
->
alias
,
"UPDATE"
);
...
...
@@ -1682,7 +1687,6 @@ multi_update::multi_update(THD *thd_arg, TABLE_LIST *table_list,
transactional_tables
(
0
),
ignore
(
ignore_arg
),
error_handled
(
0
),
prepared
(
0
),
updated_sys_ver
(
0
)
{
has_vers_fields
=
check_has_vers_fields
(
*
field_list
);
}
...
...
@@ -1987,6 +1991,7 @@ multi_update::initialize_tables(JOIN *join)
if
(
safe_update_on_fly
(
thd
,
join
->
join_tab
,
table_ref
,
all_tables
))
{
table_to_update
=
table
;
// Update table on the fly
has_vers_fields
=
check_has_vers_fields
(
table
,
*
fields
);
continue
;
}
}
...
...
@@ -2440,6 +2445,8 @@ int multi_update::do_updates()
if
(
table
->
vfield
)
empty_record
(
table
);
has_vers_fields
=
check_has_vers_fields
(
table
,
*
fields
);
check_opt_it
.
rewind
();
while
(
TABLE
*
tbl
=
check_opt_it
++
)
{
...
...
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