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
4602b180
Commit
4602b180
authored
Jun 16, 2005
by
msvensson@neptunus.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG10365 Cluster handler uses non-standard error code
- Updated after review
parent
8771c732
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
11 deletions
+12
-11
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+1
-1
sql/handler.cc
sql/handler.cc
+10
-8
sql/sql_base.cc
sql/sql_base.cc
+1
-2
No files found.
sql/ha_ndbcluster.cc
View file @
4602b180
...
@@ -4300,7 +4300,7 @@ int ndbcluster_discover(THD* thd, const char *db, const char *name,
...
@@ -4300,7 +4300,7 @@ int ndbcluster_discover(THD* thd, const char *db, const char *name,
{
{
const
NdbError
err
=
dict
->
getNdbError
();
const
NdbError
err
=
dict
->
getNdbError
();
if
(
err
.
code
==
709
)
if
(
err
.
code
==
709
)
DBUG_RETURN
(
1
);
DBUG_RETURN
(
-
1
);
ERR_RETURN
(
err
);
ERR_RETURN
(
err
);
}
}
DBUG_PRINT
(
"info"
,
(
"Found table %s"
,
tab
->
getName
()));
DBUG_PRINT
(
"info"
,
(
"Found table %s"
,
tab
->
getName
()));
...
...
sql/handler.cc
View file @
4602b180
...
@@ -1340,8 +1340,9 @@ int ha_create_table(const char *name, HA_CREATE_INFO *create_info,
...
@@ -1340,8 +1340,9 @@ int ha_create_table(const char *name, HA_CREATE_INFO *create_info,
if found, write the frm file to disk.
if found, write the frm file to disk.
RETURN VALUES:
RETURN VALUES:
-1 : Table did not exists
0 : Table created ok
0 : Table created ok
1 : Table
could not be created
> 0 : Error, table existed but
could not be created
*/
*/
...
@@ -1361,10 +1362,10 @@ int ha_create_table_from_engine(THD* thd,
...
@@ -1361,10 +1362,10 @@ int ha_create_table_from_engine(THD* thd,
bzero
((
char
*
)
&
create_info
,
sizeof
(
create_info
));
bzero
((
char
*
)
&
create_info
,
sizeof
(
create_info
));
if
(
ha_discover
(
thd
,
db
,
name
,
&
frmblob
,
&
frmlen
))
if
(
error
=
ha_discover
(
thd
,
db
,
name
,
&
frmblob
,
&
frmlen
))
{
{
// Table could not be discovered and thus not created
// Table could not be discovered and thus not created
DBUG_RETURN
(
1
);
DBUG_RETURN
(
error
);
}
}
/*
/*
...
@@ -1377,11 +1378,11 @@ int ha_create_table_from_engine(THD* thd,
...
@@ -1377,11 +1378,11 @@ int ha_create_table_from_engine(THD* thd,
if
(
writefrm
(
path
,
frmblob
,
frmlen
))
if
(
writefrm
(
path
,
frmblob
,
frmlen
))
{
{
my_free
((
char
*
)
frmblob
,
MYF
(
MY_ALLOW_ZERO_PTR
));
my_free
((
char
*
)
frmblob
,
MYF
(
MY_ALLOW_ZERO_PTR
));
DBUG_RETURN
(
1
);
DBUG_RETURN
(
2
);
}
}
if
(
openfrm
(
path
,
""
,
0
,(
uint
)
READ_ALL
,
0
,
&
table
))
if
(
openfrm
(
path
,
""
,
0
,(
uint
)
READ_ALL
,
0
,
&
table
))
DBUG_RETURN
(
1
);
DBUG_RETURN
(
3
);
update_create_info_from_table
(
&
create_info
,
&
table
);
update_create_info_from_table
(
&
create_info
,
&
table
);
create_info
.
table_options
|=
HA_CREATE_FROM_ENGINE
;
create_info
.
table_options
|=
HA_CREATE_FROM_ENGINE
;
...
@@ -1506,14 +1507,15 @@ int ha_change_key_cache(KEY_CACHE *old_key_cache,
...
@@ -1506,14 +1507,15 @@ int ha_change_key_cache(KEY_CACHE *old_key_cache,
Try to discover one table from handler(s)
Try to discover one table from handler(s)
RETURN
RETURN
0 ok. In this case *frmblob and *frmlen are set
-1 : Table did not exists
>=1 error. frmblob and frmlen may not be set
0 : OK. In this case *frmblob and *frmlen are set
>0 : error. frmblob and frmlen may not be set
*/
*/
int
ha_discover
(
THD
*
thd
,
const
char
*
db
,
const
char
*
name
,
int
ha_discover
(
THD
*
thd
,
const
char
*
db
,
const
char
*
name
,
const
void
**
frmblob
,
uint
*
frmlen
)
const
void
**
frmblob
,
uint
*
frmlen
)
{
{
int
error
=
1
;
// Table does not exist in any handler
int
error
=
-
1
;
// Table does not exist in any handler
DBUG_ENTER
(
"ha_discover"
);
DBUG_ENTER
(
"ha_discover"
);
DBUG_PRINT
(
"enter"
,
(
"db: %s, name: %s"
,
db
,
name
));
DBUG_PRINT
(
"enter"
,
(
"db: %s, name: %s"
,
db
,
name
));
#ifdef HAVE_NDBCLUSTER_DB
#ifdef HAVE_NDBCLUSTER_DB
...
...
sql/sql_base.cc
View file @
4602b180
...
@@ -1376,8 +1376,7 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db,
...
@@ -1376,8 +1376,7 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db,
*/
*/
if
(
discover_retry_count
++
!=
0
)
if
(
discover_retry_count
++
!=
0
)
goto
err
;
goto
err
;
if
(
ha_table_exists_in_engine
(
thd
,
db
,
name
)
&&
if
(
ha_create_table_from_engine
(
thd
,
db
,
name
)
>
0
)
ha_create_table_from_engine
(
thd
,
db
,
name
))
{
{
/* Give right error message */
/* Give right error message */
thd
->
clear_error
();
thd
->
clear_error
();
...
...
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