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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
3f20e69c
Commit
3f20e69c
authored
Jul 02, 2004
by
mskold@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed ndbcluster_print_error to use table name from failed NdbOperation
parent
c708619d
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 @
3f20e69c
...
@@ -1179,7 +1179,7 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data)
...
@@ -1179,7 +1179,7 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data)
int
insert_res
=
write_row
(
new_data
);
int
insert_res
=
write_row
(
new_data
);
if
(
!
insert_res
)
if
(
!
insert_res
)
{
{
DBUG_PRINT
(
"info"
,
(
"
delete
succeded"
));
DBUG_PRINT
(
"info"
,
(
"
insert
succeded"
));
int
delete_res
=
delete_row
(
old_data
);
int
delete_res
=
delete_row
(
old_data
);
if
(
!
delete_res
)
if
(
!
delete_res
)
{
{
...
@@ -2211,8 +2211,11 @@ int ndbcluster_commit(THD *thd, void *ndb_transaction)
...
@@ -2211,8 +2211,11 @@ int ndbcluster_commit(THD *thd, void *ndb_transaction)
if
(
trans
->
execute
(
Commit
)
!=
0
)
if
(
trans
->
execute
(
Commit
)
!=
0
)
{
{
const
NdbError
err
=
trans
->
getNdbError
();
const
NdbError
err
=
trans
->
getNdbError
();
const
NdbOperation
*
error_op
=
trans
->
getNdbErrorOperation
();
ERR_PRINT
(
err
);
ERR_PRINT
(
err
);
res
=
ndb_to_mysql_error
(
&
err
);
res
=
ndb_to_mysql_error
(
&
err
);
if
(
res
!=
-
1
)
ndbcluster_print_error
(
res
,
error_op
);
}
}
ndb
->
closeTransaction
(
trans
);
ndb
->
closeTransaction
(
trans
);
DBUG_RETURN
(
res
);
DBUG_RETURN
(
res
);
...
@@ -2238,8 +2241,11 @@ int ndbcluster_rollback(THD *thd, void *ndb_transaction)
...
@@ -2238,8 +2241,11 @@ int ndbcluster_rollback(THD *thd, void *ndb_transaction)
if
(
trans
->
execute
(
Rollback
)
!=
0
)
if
(
trans
->
execute
(
Rollback
)
!=
0
)
{
{
const
NdbError
err
=
trans
->
getNdbError
();
const
NdbError
err
=
trans
->
getNdbError
();
const
NdbOperation
*
error_op
=
trans
->
getNdbErrorOperation
();
ERR_PRINT
(
err
);
ERR_PRINT
(
err
);
res
=
ndb_to_mysql_error
(
&
err
);
res
=
ndb_to_mysql_error
(
&
err
);
if
(
res
!=
-
1
)
ndbcluster_print_error
(
res
,
error_op
);
}
}
ndb
->
closeTransaction
(
trans
);
ndb
->
closeTransaction
(
trans
);
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
...
@@ -2964,13 +2970,17 @@ bool ndbcluster_end()
...
@@ -2964,13 +2970,17 @@ bool ndbcluster_end()
static handler method ndbcluster_commit
static handler method ndbcluster_commit
and ndbcluster_rollback
and ndbcluster_rollback
*/
*/
void
ndbcluster_print_error
(
int
error
)
void
ndbcluster_print_error
(
int
error
,
const
NdbOperation
*
error_op
)
{
{
DBUG_ENTER
(
"ndbcluster_print_error"
);
DBUG_ENTER
(
"ndbcluster_print_error"
);
TABLE
tab
;
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
);
ha_ndbcluster
error_handler
(
&
tab
);
tab
.
file
=
&
error_handler
;
error_handler
.
print_error
(
error
,
MYF
(
0
));
error_handler
.
print_error
(
error
,
MYF
(
0
));
DBUG_VOID_RETURN
}
}
/*
/*
...
...
sql/ha_ndbcluster.h
View file @
3f20e69c
...
@@ -230,7 +230,7 @@ int ndbcluster_discover(const char* dbname, const char* name,
...
@@ -230,7 +230,7 @@ int ndbcluster_discover(const char* dbname, const char* name,
const
void
**
frmblob
,
uint
*
frmlen
);
const
void
**
frmblob
,
uint
*
frmlen
);
int
ndbcluster_drop_database
(
const
char
*
path
);
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 @
3f20e69c
...
@@ -495,9 +495,7 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans)
...
@@ -495,9 +495,7 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans)
if
((
error
=
ndbcluster_commit
(
thd
,
trans
->
ndb_tid
)))
if
((
error
=
ndbcluster_commit
(
thd
,
trans
->
ndb_tid
)))
{
{
if
(
error
==
-
1
)
if
(
error
==
-
1
)
my_error
(
ER_ERROR_DURING_COMMIT
,
MYF
(
0
),
error
);
my_error
(
ER_ERROR_DURING_COMMIT
,
MYF
(
0
));
else
ndbcluster_print_error
(
error
);
error
=
1
;
error
=
1
;
}
}
if
(
trans
==
&
thd
->
transaction
.
all
)
if
(
trans
==
&
thd
->
transaction
.
all
)
...
@@ -564,9 +562,7 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans)
...
@@ -564,9 +562,7 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans)
if
((
error
=
ndbcluster_rollback
(
thd
,
trans
->
ndb_tid
)))
if
((
error
=
ndbcluster_rollback
(
thd
,
trans
->
ndb_tid
)))
{
{
if
(
error
==
-
1
)
if
(
error
==
-
1
)
my_error
(
ER_ERROR_DURING_ROLLBACK
,
MYF
(
0
),
error
);
my_error
(
ER_ERROR_DURING_ROLLBACK
,
MYF
(
0
));
else
ndbcluster_print_error
(
error
);
error
=
1
;
error
=
1
;
}
}
trans
->
ndb_tid
=
0
;
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