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
fa56adff
Commit
fa56adff
authored
Mar 17, 2023
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.6 into 10.8
parents
acf46b7b
e8e0559e
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
71 additions
and
11 deletions
+71
-11
mysql-test/suite/innodb/r/insert_into_empty.result
mysql-test/suite/innodb/r/insert_into_empty.result
+15
-0
mysql-test/suite/innodb/r/undo_truncate.result
mysql-test/suite/innodb/r/undo_truncate.result
+5
-0
mysql-test/suite/innodb/t/insert_into_empty.test
mysql-test/suite/innodb/t/insert_into_empty.test
+14
-0
mysql-test/suite/innodb/t/undo_truncate.opt
mysql-test/suite/innodb/t/undo_truncate.opt
+1
-0
mysql-test/suite/innodb/t/undo_truncate.test
mysql-test/suite/innodb/t/undo_truncate.test
+3
-0
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+21
-8
storage/innobase/handler/i_s.cc
storage/innobase/handler/i_s.cc
+7
-2
storage/innobase/trx/trx0roll.cc
storage/innobase/trx/trx0roll.cc
+5
-1
No files found.
mysql-test/suite/innodb/r/insert_into_empty.result
View file @
fa56adff
...
...
@@ -214,6 +214,21 @@ WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test';
TABLE_ROWS AVG_ROW_LENGTH>0
3 1
DROP TABLE t1;
#
# MDEV-29975 InnoDB fails to release savepoint during bulk insert
#
CREATE TABLE t (c INT KEY) ENGINE=InnoDB;
begin;
INSERT INTO t VALUES (0,0);
ERROR 21S01: Column count doesn't match value count at row 1
SAVEPOINT a;
INSERT INTO t VALUES (0),(0);
ERROR HY000: Got error 1 "Operation not permitted" during COMMIT
SAVEPOINT a;
commit;
SELECT * FROM t;
c
DROP TABLE t;
# End of 10.6 tests
#
# MDEV-26947 UNIQUE column checks fail in InnoDB resulting
...
...
mysql-test/suite/innodb/r/undo_truncate.result
View file @
fa56adff
SET GLOBAL innodb_undo_log_truncate = 0;
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
Space_Name Page_Size Zip_Size Path
innodb_undo001 DEFAULT DEFAULT MYSQLD_DATADIR//undo001
innodb_undo002 DEFAULT DEFAULT MYSQLD_DATADIR//undo002
innodb_temporary DEFAULT DEFAULT MYSQLD_DATADIR/ibtmp1
create table t1(keyc int primary key, c char(100)) engine = innodb;
create table t2(keyc int primary key, c char(100)) engine = innodb;
connect con1,localhost,root,,;
...
...
mysql-test/suite/innodb/t/insert_into_empty.test
View file @
fa56adff
...
...
@@ -235,6 +235,20 @@ SELECT TABLE_ROWS, AVG_ROW_LENGTH>0 FROM INFORMATION_SCHEMA.TABLES
WHERE
TABLE_NAME
=
't1'
AND
TABLE_SCHEMA
=
'test'
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-29975 InnoDB fails to release savepoint during bulk insert
--
echo
#
CREATE
TABLE
t
(
c
INT
KEY
)
ENGINE
=
InnoDB
;
begin
;
--
error
ER_WRONG_VALUE_COUNT_ON_ROW
INSERT
INTO
t
VALUES
(
0
,
0
);
SAVEPOINT
a
;
--
error
ER_ERROR_DURING_COMMIT
INSERT
INTO
t
VALUES
(
0
),(
0
);
SAVEPOINT
a
;
commit
;
SELECT
*
FROM
t
;
DROP
TABLE
t
;
--
echo
# End of 10.6 tests
--
echo
#
...
...
mysql-test/suite/innodb/t/undo_truncate.opt
View file @
fa56adff
--innodb-buffer-pool-size=24M
--innodb-immediate-scrub-data-uncompressed=ON
--loose-innodb-sys-tablespaces
mysql-test/suite/innodb/t/undo_truncate.test
View file @
fa56adff
...
...
@@ -15,6 +15,9 @@ call mtr.add_suppression("InnoDB: Trying to delete tablespace.*pending operation
SET
GLOBAL
innodb_undo_log_truncate
=
0
;
SET
GLOBAL
innodb_purge_rseg_truncate_frequency
=
1
;
LET
$MYSQLD_DATADIR
=
`select @@datadir`
;
LET
$INNODB_PAGE_SIZE
=
`select @@innodb_page_size`
;
--
source
suite
/
innodb
/
include
/
show_i_s_tablespaces
.
inc
#-----------------------------------------------------------------------------
#
# Perform DML action using multiple clients and multiple undo tablespace.
...
...
storage/innobase/handler/ha_innodb.cc
View file @
fa56adff
...
...
@@ -4473,6 +4473,25 @@ innobase_commit_ordered(
DBUG_VOID_RETURN
;
}
/** Mark the end of a statement.
@param trx transaction
@return whether an error occurred */
static
bool
end_of_statement
(
trx_t
*
trx
)
{
trx_mark_sql_stat_end
(
trx
);
if
(
UNIV_LIKELY
(
trx
->
error_state
==
DB_SUCCESS
))
return
false
;
trx_savept_t
savept
;
savept
.
least_undo_no
=
0
;
trx
->
rollback
(
&
savept
);
/* MariaDB will roll back the entire transaction. */
trx
->
bulk_insert
=
false
;
trx
->
last_sql_stat_start
.
least_undo_no
=
0
;
trx
->
savepoints_discard
();
return
true
;
}
/*****************************************************************//**
Commits a transaction in an InnoDB database or marks an SQL statement
ended.
...
...
@@ -4549,10 +4568,7 @@ innobase_commit(
/* Store the current undo_no of the transaction so that we
know where to roll back if we have to roll back the next
SQL statement */
trx_mark_sql_stat_end
(
trx
);
if
(
UNIV_UNLIKELY
(
trx
->
error_state
!=
DB_SUCCESS
))
{
trx_rollback_for_mysql
(
trx
);
if
(
UNIV_UNLIKELY
(
end_of_statement
(
trx
)))
{
DBUG_RETURN
(
1
);
}
}
...
...
@@ -16986,10 +17002,7 @@ innobase_xa_prepare(
/* Store the current undo_no of the transaction so that we
know where to roll back if we have to roll back the next
SQL statement */
trx_mark_sql_stat_end
(
trx
);
if
(
UNIV_UNLIKELY
(
trx
->
error_state
!=
DB_SUCCESS
))
{
trx_rollback_for_mysql
(
trx
);
if
(
UNIV_UNLIKELY
(
end_of_statement
(
trx
)))
{
return
1
;
}
}
...
...
storage/innobase/handler/i_s.cc
View file @
fa56adff
...
...
@@ -6436,8 +6436,13 @@ static int i_s_sys_tablespaces_fill(THD *thd, const fil_space_t &s, TABLE *t)
OK
(
f
->
store
(
name
.
data
(),
name
.
size
(),
system_charset_info
));
f
->
set_notnull
();
}
else
f
->
set_notnull
();
else
if
(
srv_is_undo_tablespace
(
s
.
id
))
{
char
name
[
15
];
snprintf
(
name
,
sizeof
name
,
"innodb_undo%03u"
,
(
s
.
id
-
srv_undo_space_id_start
+
1
));
OK
(
f
->
store
(
name
,
strlen
(
name
),
system_charset_info
));
}
else
f
->
set_notnull
();
}
fields
[
SYS_TABLESPACES_NAME
]
->
set_null
();
...
...
storage/innobase/trx/trx0roll.cc
View file @
fa56adff
...
...
@@ -557,9 +557,13 @@ trx_release_savepoint_for_mysql(
if
(
savep
!=
NULL
)
{
trx_roll_savepoint_free
(
trx
,
savep
);
return
DB_SUCCESS
;
}
else
if
(
trx
->
last_sql_stat_start
.
least_undo_no
==
0
)
{
/* Bulk insert could have discarded savepoints */
return
DB_SUCCESS
;
}
return
(
savep
!=
NULL
?
DB_SUCCESS
:
DB_NO_SAVEPOINT
)
;
return
DB_NO_SAVEPOINT
;
}
/*******************************************************************//**
...
...
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