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
89647b1d
Commit
89647b1d
authored
Jul 02, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed ndbcluster_print_error to use table name from failed NdbOperation
parent
89e30e83
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
10 deletions
+16
-10
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+13
-3
sql/ha_ndbcluster.h
sql/ha_ndbcluster.h
+1
-1
sql/handler.cc
sql/handler.cc
+2
-6
No files found.
sql/ha_ndbcluster.cc
View file @
89647b1d
...
...
@@ -1179,7 +1179,7 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data)
int
insert_res
=
write_row
(
new_data
);
if
(
!
insert_res
)
{
DBUG_PRINT
(
"info"
,
(
"
delete
succeded"
));
DBUG_PRINT
(
"info"
,
(
"
insert
succeded"
));
int
delete_res
=
delete_row
(
old_data
);
if
(
!
delete_res
)
{
...
...
@@ -2211,8 +2211,11 @@ int ndbcluster_commit(THD *thd, void *ndb_transaction)
if
(
trans
->
execute
(
Commit
)
!=
0
)
{
const
NdbError
err
=
trans
->
getNdbError
();
const
NdbOperation
*
error_op
=
trans
->
getNdbErrorOperation
();
ERR_PRINT
(
err
);
res
=
ndb_to_mysql_error
(
&
err
);
if
(
res
!=
-
1
)
ndbcluster_print_error
(
res
,
error_op
);
}
ndb
->
closeTransaction
(
trans
);
DBUG_RETURN
(
res
);
...
...
@@ -2238,8 +2241,11 @@ int ndbcluster_rollback(THD *thd, void *ndb_transaction)
if
(
trans
->
execute
(
Rollback
)
!=
0
)
{
const
NdbError
err
=
trans
->
getNdbError
();
const
NdbOperation
*
error_op
=
trans
->
getNdbErrorOperation
();
ERR_PRINT
(
err
);
res
=
ndb_to_mysql_error
(
&
err
);
if
(
res
!=
-
1
)
ndbcluster_print_error
(
res
,
error_op
);
}
ndb
->
closeTransaction
(
trans
);
DBUG_RETURN
(
0
);
...
...
@@ -2964,13 +2970,17 @@ bool ndbcluster_end()
static handler method ndbcluster_commit
and ndbcluster_rollback
*/
void
ndbcluster_print_error
(
int
error
)
void
ndbcluster_print_error
(
int
error
,
const
NdbOperation
*
error_op
)
{
DBUG_ENTER
(
"ndbcluster_print_error"
);
TABLE
tab
;
tab
.
table_name
=
NULL
;
const
char
*
tab_name
=
(
error_op
)
?
error_op
->
getTableName
()
:
""
;
tab
.
table_name
=
(
char
*
)
tab_name
;
ha_ndbcluster
error_handler
(
&
tab
);
tab
.
file
=
&
error_handler
;
error_handler
.
print_error
(
error
,
MYF
(
0
));
DBUG_VOID_RETURN
}
/*
...
...
sql/ha_ndbcluster.h
View file @
89647b1d
...
...
@@ -230,7 +230,7 @@ int ndbcluster_discover(const char* dbname, const char* name,
const
void
**
frmblob
,
uint
*
frmlen
);
int
ndbcluster_drop_database
(
const
char
*
path
);
void
ndbcluster_print_error
(
int
error
);
void
ndbcluster_print_error
(
int
error
,
const
NdbOperation
*
error_op
);
...
...
sql/handler.cc
View file @
89647b1d
...
...
@@ -495,9 +495,7 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans)
if
((
error
=
ndbcluster_commit
(
thd
,
trans
->
ndb_tid
)))
{
if
(
error
==
-
1
)
my_error
(
ER_ERROR_DURING_COMMIT
,
MYF
(
0
),
error
);
else
ndbcluster_print_error
(
error
);
my_error
(
ER_ERROR_DURING_COMMIT
,
MYF
(
0
));
error
=
1
;
}
if
(
trans
==
&
thd
->
transaction
.
all
)
...
...
@@ -564,9 +562,7 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans)
if
((
error
=
ndbcluster_rollback
(
thd
,
trans
->
ndb_tid
)))
{
if
(
error
==
-
1
)
my_error
(
ER_ERROR_DURING_ROLLBACK
,
MYF
(
0
),
error
);
else
ndbcluster_print_error
(
error
);
my_error
(
ER_ERROR_DURING_ROLLBACK
,
MYF
(
0
));
error
=
1
;
}
trans
->
ndb_tid
=
0
;
...
...
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