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
47ea526e
Commit
47ea526e
authored
Nov 28, 2017
by
Aleksey Midenkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IB: get template with virtual columns [#365 bug 1]
Affected tests (forced mode): binlog_encryption.encrypted_slave
parent
f924a94d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
4 deletions
+37
-4
mysql-test/suite/versioning/r/insert.result
mysql-test/suite/versioning/r/insert.result
+10
-0
mysql-test/suite/versioning/t/insert.test
mysql-test/suite/versioning/t/insert.test
+9
-0
storage/innobase/include/row0mysql.h
storage/innobase/include/row0mysql.h
+14
-0
storage/innobase/row/row0mysql.cc
storage/innobase/row/row0mysql.cc
+4
-4
No files found.
mysql-test/suite/versioning/r/insert.result
View file @
47ea526e
...
...
@@ -360,6 +360,16 @@ insert into t2(x) values (1);
insert into t1(x) values (1);
ERROR HY000: Some versioned DML requires `transaction_registry` to be set to ON.
set global transaction_registry= on;
create or replace table t1 (
x int,
y int as (x) virtual
) engine=innodb with system versioning;
insert into t1 values (1, null);
update t1 set x= x + 1;
select *, sys_trx_end = 18446744073709551615 as current from t1 for system_time all;
x y current
2 2 1
1 1 0
drop table t1;
drop table t2;
drop procedure test_01;
...
...
mysql-test/suite/versioning/t/insert.test
View file @
47ea526e
...
...
@@ -191,6 +191,15 @@ insert into t2(x) values (1);
insert
into
t1
(
x
)
values
(
1
);
set
global
transaction_registry
=
on
;
# virtual columns
create
or
replace
table
t1
(
x
int
,
y
int
as
(
x
)
virtual
)
engine
=
innodb
with
system
versioning
;
insert
into
t1
values
(
1
,
null
);
update
t1
set
x
=
x
+
1
;
select
*
,
sys_trx_end
=
18446744073709551615
as
current
from
t1
for
system_time
all
;
drop
table
t1
;
drop
table
t2
;
...
...
storage/innobase/include/row0mysql.h
View file @
47ea526e
...
...
@@ -859,6 +859,20 @@ struct row_prebuilt_t {
/** The MySQL table object */
TABLE
*
m_mysql_table
;
/** Get template by column number */
const
mysql_row_templ_t
*
get_template_by_col
(
ulint
col
)
const
{
ut_a
(
col
<
n_template
);
ut_a
(
mysql_template
);
for
(
int
i
=
col
;
i
<
n_template
;
++
i
)
{
const
mysql_row_templ_t
*
templ
=
mysql_template
+
i
;
if
(
!
templ
->
is_virtual
&&
templ
->
col_no
==
col
)
return
templ
;
}
return
NULL
;
}
};
/** Callback for row_mysql_sys_index_iterate() */
...
...
storage/innobase/row/row0mysql.cc
View file @
47ea526e
...
...
@@ -1517,8 +1517,8 @@ row_insert_for_mysql(
ut_ad
(
table
->
vers_start
!=
table
->
vers_end
);
/* Return back modified fields into mysql_rec, so that
upper logic may benefit from it (f.ex. 'on duplicate key'). */
const
mysql_row_templ_t
*
t
=
&
prebuilt
->
mysql_template
[
table
->
vers_end
]
;
ut_ad
(
t
->
mysql_col_len
==
8
);
const
mysql_row_templ_t
*
t
=
prebuilt
->
get_template_by_col
(
table
->
vers_end
)
;
ut_ad
(
t
&&
t
->
mysql_col_len
==
8
);
if
(
ins_mode
==
ROW_INS_HISTORICAL
)
{
set_tuple_col_8
(
node
->
row
,
table
->
vers_end
,
trx
->
id
,
node
->
vers_end_buf
);
...
...
@@ -1526,8 +1526,8 @@ row_insert_for_mysql(
else
/* ROW_INS_VERSIONED */
{
set_tuple_col_8
(
node
->
row
,
table
->
vers_end
,
TRX_ID_MAX
,
node
->
vers_end_buf
);
int8store
(
&
mysql_rec
[
t
->
mysql_col_offset
],
TRX_ID_MAX
);
t
=
&
prebuilt
->
mysql_template
[
table
->
vers_start
]
;
ut_ad
(
t
->
mysql_col_len
==
8
);
t
=
prebuilt
->
get_template_by_col
(
table
->
vers_start
)
;
ut_ad
(
t
&&
t
->
mysql_col_len
==
8
);
set_tuple_col_8
(
node
->
row
,
table
->
vers_start
,
trx
->
id
,
node
->
vers_start_buf
);
int8store
(
&
mysql_rec
[
t
->
mysql_col_offset
],
trx
->
id
);
}
...
...
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