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
04ca407d
Commit
04ca407d
authored
Oct 08, 2019
by
Will DeVries
Committed by
Sergei Petrunia
Mar 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix more transaction assertions and issues.
parent
e3bd28ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
storage/clustrixdb/clustrix_connection.cc
storage/clustrixdb/clustrix_connection.cc
+9
-2
storage/clustrixdb/ha_clustrixdb.cc
storage/clustrixdb/ha_clustrixdb.cc
+2
-8
No files found.
storage/clustrixdb/clustrix_connection.cc
View file @
04ca407d
...
...
@@ -148,7 +148,7 @@ int clustrix_connection::connect()
int
clustrix_connection
::
begin_command
(
uchar
command
)
{
assert
(
has_transaction
);
assert
(
command
==
CLUSTRIX_TRANSACTION_CMD
||
has_transaction
);
command_length
=
0
;
int
error_code
=
0
;
if
((
error_code
=
add_command_operand_uchar
(
command
)))
...
...
@@ -192,7 +192,6 @@ int clustrix_connection::read_query_response()
return
error_code
;
}
auto_commit_closed
();
return
0
;
}
...
...
@@ -205,8 +204,10 @@ int clustrix_connection::send_transaction_cmd()
int
error_code
;
if
((
error_code
=
begin_command
(
CLUSTRIX_TRANSACTION_CMD
)))
DBUG_RETURN
(
error_code
);
if
((
error_code
=
send_command
()))
DBUG_RETURN
(
error_code
);
if
((
error_code
=
read_query_response
()))
DBUG_RETURN
(
mysql_errno
(
&
clustrix_net
));
...
...
@@ -346,6 +347,7 @@ int clustrix_connection::write_row(ulonglong clustrix_table_oid,
if
((
error_code
=
read_query_response
()))
return
error_code
;
auto_commit_closed
();
*
last_insert_id
=
clustrix_net
.
insert_id
;
return
error_code
;
}
...
...
@@ -381,6 +383,7 @@ int clustrix_connection::key_update(ulonglong clustrix_table_oid,
if
((
error_code
=
read_query_response
()))
return
error_code
;
auto_commit_closed
();
return
error_code
;
}
...
...
@@ -406,6 +409,7 @@ int clustrix_connection::key_delete(ulonglong clustrix_table_oid,
if
((
error_code
=
read_query_response
()))
return
error_code
;
auto_commit_closed
();
return
error_code
;
}
...
...
@@ -719,9 +723,11 @@ int clustrix_connection::update_query(String &stmt, LEX_CSTRING &dbname,
if
((
error_code
=
send_command
()))
return
error_code
;
if
((
error_code
=
read_query_response
()))
return
error_code
;
auto_commit_closed
();
*
affected_rows
=
clustrix_net
.
affected_rows
;
return
0
;
...
...
@@ -837,6 +843,7 @@ int clustrix_connection::scan_end(clustrix_connection_cursor *scan)
if
((
error_code
=
read_query_response
()))
return
error_code
;
auto_commit_closed
();
return
0
;
}
...
...
storage/clustrixdb/ha_clustrixdb.cc
View file @
04ca407d
...
...
@@ -409,8 +409,6 @@ int ha_clustrixdb::write_row(const uchar *buf)
if
(
!
trx
)
return
error_code
;
assert
(
trx
->
has_open_transaction
());
/* Convert the row format to binlog (packed) format */
uchar
*
packed_new_row
=
(
uchar
*
)
my_alloca
(
estimate_row_size
(
table
));
size_t
packed_size
=
pack_row
(
table
,
table
->
write_set
,
packed_new_row
,
buf
);
...
...
@@ -442,8 +440,6 @@ int ha_clustrixdb::update_row(const uchar *old_data, const uchar *new_data)
if
(
!
trx
)
DBUG_RETURN
(
error_code
);
assert
(
trx
->
has_open_transaction
());
size_t
row_size
=
estimate_row_size
(
table
);
size_t
packed_key_len
;
uchar
*
packed_key
=
(
uchar
*
)
my_alloca
(
row_size
);
...
...
@@ -502,8 +498,6 @@ int ha_clustrixdb::delete_row(const uchar *buf)
if
(
!
trx
)
return
error_code
;
assert
(
trx
->
has_open_transaction
());
// The estimate should consider only key fields widths.
size_t
packed_key_len
;
uchar
*
packed_key
=
(
uchar
*
)
my_alloca
(
estimate_row_size
(
table
));
...
...
@@ -1037,7 +1031,7 @@ static int clustrixdb_commit(handlerton *hton, THD *thd, bool all)
clustrix_connection
*
trx
=
(
clustrix_connection
*
)
thd_get_ha_data
(
thd
,
hton
);
assert
(
trx
);
bool
send_cmd
;
bool
send_cmd
=
FALSE
;
if
(
all
||
!
thd_test_options
(
thd
,
OPTION_NOT_AUTOCOMMIT
|
OPTION_BEGIN
))
{
if
(
trx
->
has_open_transaction
())
send_cmd
=
trx
->
commit_transaction
();
...
...
@@ -1057,7 +1051,7 @@ static int clustrixdb_rollback(handlerton *hton, THD *thd, bool all)
clustrix_connection
*
trx
=
(
clustrix_connection
*
)
thd_get_ha_data
(
thd
,
hton
);
assert
(
trx
);
bool
send_cmd
;
bool
send_cmd
=
FALSE
;
if
(
all
||
!
thd_test_options
(
thd
,
OPTION_NOT_AUTOCOMMIT
|
OPTION_BEGIN
))
{
if
(
trx
->
has_open_transaction
())
send_cmd
=
trx
->
rollback_transaction
();
...
...
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