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
bac728a2
Commit
bac728a2
authored
Jul 19, 2022
by
Nikita Malyavin
Committed by
Sergei Golubchik
Aug 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-29069 follow-up: allow deterministic DEFAULTs
parent
2be4c836
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
mysql-test/main/alter_table_online_debug.result
mysql-test/main/alter_table_online_debug.result
+4
-4
sql/log_event_server.cc
sql/log_event_server.cc
+13
-3
No files found.
mysql-test/main/alter_table_online_debug.result
View file @
bac728a2
...
...
@@ -1073,8 +1073,8 @@ update t set a = a + 1 where a = 10;
set debug_sync= 'now signal goforit';
connection default;
Warnings:
Note 1105 Key chosen:
-1
Note 1105 Key chosen:
-1
Note 1105 Key chosen:
0
Note 1105 Key chosen:
0
select a from t;
a
11
...
...
@@ -1093,8 +1093,8 @@ update t set a = a + 1 where a = 10;
set debug_sync= 'now signal goforit';
connection default;
Warnings:
Note 1105 Key chosen:
-1
Note 1105 Key chosen:
-1
Note 1105 Key chosen:
0
Note 1105 Key chosen:
0
#
# Add key for old row
#
...
...
sql/log_event_server.cc
View file @
bac728a2
...
...
@@ -7107,11 +7107,12 @@ static bool record_compare(TABLE *table, bool vers_from_plain= false)
bool
Rows_log_event
::
is_key_usable
(
const
KEY
*
key
)
const
{
RPL_TABLE_LIST
*
tl
=
(
RPL_TABLE_LIST
*
)
m_table
->
pos_in_table_list
;
const
bool
online_alter
=
tl
->
m_online_alter_copy_fields
;
if
(
!
m_table
->
s
->
keys_in_use
.
is_set
(
uint
(
key
-
m_table
->
key_info
)))
return
false
;
if
(
!
tl
->
m_online_alter_copy_fields
)
if
(
!
online_alter
)
{
if
(
m_cols
.
n_bits
>=
m_table
->
s
->
fields
)
return
true
;
...
...
@@ -7126,8 +7127,17 @@ bool Rows_log_event::is_key_usable(const KEY *key) const
for
(
uint
p
=
0
;
p
<
key
->
user_defined_key_parts
;
p
++
)
{
uint
field_idx
=
key
->
key_part
[
p
].
fieldnr
-
1
;
if
(
!
bitmap_is_set
(
&
m_table
->
has_value_set
,
field_idx
))
Field
*
f
=
key
->
key_part
[
p
].
field
;
/*
in the online alter case (but not in replication) we don't have
to reject an index if it includes new columns, as long as
their values are deterministic.
*/
bool
non_deterministic_default
=
f
->
default_value
&&
f
->
default_value
->
flags
&
VCOL_NOT_STRICTLY_DETERMINISTIC
;
bool
next_number_field
=
f
==
f
->
table
->
next_number_field
;
if
(
!
bitmap_is_set
(
&
m_table
->
has_value_set
,
f
->
field_index
)
&&
(
!
online_alter
||
non_deterministic_default
||
next_number_field
))
return
false
;
}
return
true
;
...
...
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