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
3fa4a9e6
Commit
3fa4a9e6
authored
Dec 30, 2019
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.4 into 10.5
parents
b36154a1
ffc0a08d
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
68 additions
and
13 deletions
+68
-13
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+3
-1
mysql-test/suite.pm
mysql-test/suite.pm
+0
-10
mysql-test/suite/versioning/r/trx_id.result
mysql-test/suite/versioning/r/trx_id.result
+22
-0
mysql-test/suite/versioning/t/trx_id.test
mysql-test/suite/versioning/t/trx_id.test
+27
-0
sql/handler.cc
sql/handler.cc
+2
-1
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+9
-0
storage/innobase/include/dict0mem.h
storage/innobase/include/dict0mem.h
+5
-1
No files found.
mysql-test/mysql-test-run.pl
View file @
3fa4a9e6
...
...
@@ -2445,8 +2445,10 @@ sub environment_setup {
#
$ENV
{'
LC_ALL
'}
=
"
C
";
$ENV
{'
LC_CTYPE
'}
=
"
C
";
$ENV
{'
LC_COLLATE
'}
=
"
C
";
$ENV
{'
OPENSSL_CONF
'}
=
"
/dev/null
";
$ENV
{'
USE_RUNNING_SERVER
'}
=
using_extern
();
$ENV
{'
MYSQL_TEST_DIR
'}
=
$glob_mysql_test_dir
;
$ENV
{'
DEFAULT_MASTER_PORT
'}
=
$mysqld_variables
{'
port
'};
...
...
mysql-test/suite.pm
View file @
3fa4a9e6
...
...
@@ -89,16 +89,6 @@ sub skip_combinations {
$skip
{'
main/ssl_verify_ip.test
'}
=
'
x509v3 support required
'
unless
$openssl_ver
ge
"
1.0.2
";
my
$openssl_cnf
=
'
/etc/ssl/openssl.cnf
';
if
(
$openssl_ver
and
open
my
$f
,
'
<
',
$openssl_cnf
)
{
local
$/
;
my
$cnf
=<
$f
>
;
$skip
{'
main/tls_version.test
'}
=
"
TLSv1.1 disabled in
$openssl_cnf
"
if
$cnf
=~
/^\s*MinProtocol\s*=\s*TLSv1.[2-9]/m
;
$skip
{'
main/tls_version1.test
'}
=
"
TLSv1.0 disabled in
$openssl_cnf
"
if
$cnf
=~
/^\s*MinProtocol\s*=\s*TLSv1.[1-9]/m
;
}
%
skip
;
}
...
...
mysql-test/suite/versioning/r/trx_id.result
View file @
3fa4a9e6
...
...
@@ -469,3 +469,25 @@ SET @@SYSTEM_VERSIONING_ALTER_HISTORY=ERROR;
SELECT count(*) from mysql.transaction_registry where begin_timestamp>=commit_timestamp;
count(*)
0
# MDEV-18875 Assertion `thd->transaction.stmt.ha_list == __null ||
# trans == &thd->transaction.stmt' failed or bogus ER_DUP_ENTRY upon
# ALTER TABLE with versioning
create or replace table t (x int) engine=innodb;
set autocommit= 0;
alter table t
algorithm=copy,
add column row_start bigint unsigned as row start,
add column row_end bigint unsigned as row end,
add period for system_time(row_start,row_end),
with system versioning;
set autocommit= 1;
# MDEV-18865 Assertion `t->first->versioned_by_id()'
# failed in innodb_prepare_commit_versioned
create or replace table t (x int) engine=innodb;
insert into t values (0);
alter table t add `row_start` bigint unsigned as row start,
add `row_end` bigint unsigned as row end,
add period for system_time(`row_start`,`row_end`),
modify x int after row_start,
with system versioning;
create or replace database test;
mysql-test/suite/versioning/t/trx_id.test
View file @
3fa4a9e6
...
...
@@ -465,3 +465,30 @@ DROP TABLE t;
SET
@@
SYSTEM_VERSIONING_ALTER_HISTORY
=
ERROR
;
SELECT
count
(
*
)
from
mysql
.
transaction_registry
where
begin_timestamp
>=
commit_timestamp
;
--
echo
# MDEV-18875 Assertion `thd->transaction.stmt.ha_list == __null ||
--
echo
# trans == &thd->transaction.stmt' failed or bogus ER_DUP_ENTRY upon
--
echo
# ALTER TABLE with versioning
create
or
replace
table
t
(
x
int
)
engine
=
innodb
;
set
autocommit
=
0
;
alter
table
t
algorithm
=
copy
,
add
column
row_start
bigint
unsigned
as
row
start
,
add
column
row_end
bigint
unsigned
as
row
end
,
add
period
for
system_time
(
row_start
,
row_end
),
with
system
versioning
;
set
autocommit
=
1
;
--
echo
# MDEV-18865 Assertion `t->first->versioned_by_id()'
--
echo
# failed in innodb_prepare_commit_versioned
create
or
replace
table
t
(
x
int
)
engine
=
innodb
;
insert
into
t
values
(
0
);
alter
table
t
add
`row_start`
bigint
unsigned
as
row
start
,
add
`row_end`
bigint
unsigned
as
row
end
,
add
period
for
system_time
(
`row_start`
,
`row_end`
),
modify
x
int
after
row_start
,
with
system
versioning
;
create
or
replace
database
test
;
sql/handler.cc
View file @
3fa4a9e6
...
...
@@ -1515,7 +1515,8 @@ int ha_commit_trans(THD *thd, bool all)
#if 1 // FIXME: This should be done in ha_prepare().
if
(
rw_trans
||
(
thd
->
lex
->
sql_command
==
SQLCOM_ALTER_TABLE
&&
thd
->
lex
->
alter_info
.
flags
&
ALTER_ADD_SYSTEM_VERSIONING
))
thd
->
lex
->
alter_info
.
flags
&
ALTER_ADD_SYSTEM_VERSIONING
&&
is_real_trans
))
{
ulonglong
trx_start_id
=
0
,
trx_end_id
=
0
;
for
(
Ha_trx_info
*
ha_info
=
trans
->
ha_list
;
ha_info
;
ha_info
=
ha_info
->
next
())
...
...
storage/innobase/handler/ha_innodb.cc
View file @
3fa4a9e6
...
...
@@ -10669,6 +10669,9 @@ create_table_info_t::create_table_def()
heap
=
mem_heap_create
(
1000
);
ut_d
(
bool
have_vers_start
=
false
);
ut_d
(
bool
have_vers_end
=
false
);
for
(
ulint
i
=
0
,
j
=
0
;
j
<
n_cols
;
i
++
)
{
Field
*
field
=
m_form
->
field
[
i
];
ulint
vers_row
=
0
;
...
...
@@ -10676,8 +10679,10 @@ create_table_info_t::create_table_def()
if
(
m_form
->
versioned
())
{
if
(
i
==
m_form
->
s
->
vers
.
start_fieldno
)
{
vers_row
=
DATA_VERS_START
;
ut_d
(
have_vers_start
=
true
);
}
else
if
(
i
==
m_form
->
s
->
vers
.
end_fieldno
)
{
vers_row
=
DATA_VERS_END
;
ut_d
(
have_vers_end
=
true
);
}
else
if
(
!
(
field
->
flags
&
VERS_UPDATE_UNVERSIONED_FLAG
))
{
vers_row
=
DATA_VERSIONED
;
...
...
@@ -10798,6 +10803,10 @@ create_table_info_t::create_table_def()
j
++
;
}
ut_ad
(
have_vers_start
==
have_vers_end
);
ut_ad
(
table
->
versioned
()
==
have_vers_start
);
ut_ad
(
!
table
->
versioned
()
||
table
->
vers_start
!=
table
->
vers_end
);
if
(
num_v
)
{
for
(
ulint
i
=
0
,
j
=
0
;
i
<
n_cols
;
i
++
)
{
dict_v_col_t
*
v_col
;
...
...
storage/innobase/include/dict0mem.h
View file @
3fa4a9e6
...
...
@@ -1852,10 +1852,14 @@ struct dict_table_t {
/** Add the table definition to the data dictionary cache */
void
add_to_cache
();
/** @return whether the table is versioned.
It is assumed that both vers_start and vers_end set to 0
iff table is not versioned. In any other case,
these fields correspond to actual positions in cols[]. */
bool
versioned
()
const
{
return
vers_start
||
vers_end
;
}
bool
versioned_by_id
()
const
{
return
vers
_start
&&
cols
[
vers_start
].
mtype
==
DATA_INT
;
return
vers
ioned
()
&&
cols
[
vers_start
].
mtype
==
DATA_INT
;
}
void
inc_fk_checks
()
...
...
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