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
73b2a326
Commit
73b2a326
authored
Oct 10, 2022
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-29730 mysqldump --dump-history creates broken dump if there are precision-versioned tables
parent
d249761a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
3 deletions
+53
-3
client/mysqldump.c
client/mysqldump.c
+11
-3
mysql-test/suite/versioning/r/data.result
mysql-test/suite/versioning/r/data.result
+23
-0
mysql-test/suite/versioning/t/data.test
mysql-test/suite/versioning/t/data.test
+19
-0
No files found.
client/mysqldump.c
View file @
73b2a326
...
...
@@ -3399,7 +3399,7 @@ static uint get_table_structure(const char *table, const char *db, char *table_t
mysql_free_result
(
result
);
}
my_snprintf
(
query_buff
,
sizeof
(
query_buff
),
"select column_name, extra, generation_expression "
"select column_name, extra, generation_expression
, data_type
"
"from information_schema.columns where table_schema=database() "
"and table_name=%s"
,
quote_for_equal
(
table
,
temp_buff
));
if
(
mysql_query_with_error_report
(
mysql
,
&
result
,
query_buff
))
...
...
@@ -3413,8 +3413,16 @@ static uint get_table_structure(const char *table, const char *db, char *table_t
{
if
(
strstr
(
row
[
1
],
"INVISIBLE"
))
complete_insert
=
1
;
if
(
vers_hidden
&&
row
[
2
])
vers_hidden
=
strcmp
(
row
[
2
],
"ROW START"
);
if
(
vers_hidden
&&
row
[
2
]
&&
strcmp
(
row
[
2
],
"ROW START"
)
==
0
)
{
vers_hidden
=
0
;
if
(
row
[
3
]
&&
strcmp
(
row
[
3
],
"bigint"
)
==
0
)
{
maybe_die
(
EX_ILLEGAL_TABLE
,
"Cannot use --dump-history for table %s with transaction-precise history"
,
result_table
);
*
versioned
=
0
;
}
}
if
(
init
)
{
dynstr_append_checked
(
&
select_field_names
,
", "
);
...
...
mysql-test/suite/versioning/r/data.result
View file @
73b2a326
...
...
@@ -183,3 +183,26 @@ x check_row_ts(row_start, row_end)
2 CURRENT ROW
drop tables t1, t2;
drop function check_fields;
#
# MDEV-29730 mysqldump --dump-history creates broken dump if there are precision-versioned tables
#
create table t1 (x int,
rs BIGINT unsigned as row start, re BiGiNt unsigned as row end,
period for system_time (rs,re)) with system versioning engine=innodb;
insert t1 (x) values (1);
insert t1 (x) values (2);
delete from t1 where x=1;
mysqldump: Cannot use --dump-history for table `t1` with transaction-precise history
mysqldump: Cannot use --dump-history for table `t1` with transaction-precise history
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t1` (
`x` int(11) DEFAULT NULL,
`rs` bigint(20) unsigned GENERATED ALWAYS AS ROW START,
`re` bigint(20) unsigned GENERATED ALWAYS AS ROW END,
PERIOD FOR SYSTEM_TIME (`rs`, `re`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING;
/*!40101 SET character_set_client = @saved_cs_client */;
INSERT INTO `t1` VALUES
(2,XXX,18446744073709551615);
drop table t1;
mysql-test/suite/versioning/t/data.test
View file @
73b2a326
...
...
@@ -147,4 +147,23 @@ select *, check_row_ts(row_start, row_end) from t2 for system_time all;
drop
tables
t1
,
t2
;
drop
function
check_fields
;
--
echo
#
--
echo
# MDEV-29730 mysqldump --dump-history creates broken dump if there are precision-versioned tables
--
echo
#
create
table
t1
(
x
int
,
rs
BIGINT
unsigned
as
row
start
,
re
BiGiNt
unsigned
as
row
end
,
period
for
system_time
(
rs
,
re
))
with
system
versioning
engine
=
innodb
;
insert
t1
(
x
)
values
(
1
);
insert
t1
(
x
)
values
(
2
);
delete
from
t1
where
x
=
1
;
--
replace_result
mysqldump
.
exe
mysqldump
--
error
6
--
exec
$MYSQL_DUMP
--
dump
-
history
test
2
>&
1
>/
dev
/
null
--
replace_regex
/
2
,
\d
+
,
/
2
,
XXX
,
/
/
mysqldump
\
.
exe
/
mysqldump
/
--
error
6
--
exec
$MYSQL_DUMP
--
force
--
dump
-
history
--
compact
test
2
>&
1
drop
table
t1
;
--
source
suite
/
versioning
/
common_finish
.
inc
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