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
7ae3682d
Commit
7ae3682d
authored
Aug 30, 2006
by
brian@zim.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
This pulls two function calls which should have been handlerton calls out of handler.cc.
parent
5c3ac45c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
14 deletions
+58
-14
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+2
-0
sql/handler.cc
sql/handler.cc
+51
-13
sql/handler.h
sql/handler.h
+5
-1
No files found.
sql/ha_ndbcluster.cc
View file @
7ae3682d
...
@@ -6388,6 +6388,8 @@ static int ndbcluster_init()
...
@@ -6388,6 +6388,8 @@ static int ndbcluster_init()
#endif
#endif
h
.
flags
=
HTON_CAN_RECREATE
|
HTON_TEMPORARY_NOT_SUPPORTED
;
h
.
flags
=
HTON_CAN_RECREATE
|
HTON_TEMPORARY_NOT_SUPPORTED
;
h
.
discover
=
ndbcluster_discover
;
h
.
discover
=
ndbcluster_discover
;
h
.
find_files
=
ndbcluster_find_files
;
h
.
table_exists_in_engine
=
ndbcluster_table_exists_in_engine
;
}
}
if
(
have_ndbcluster
!=
SHOW_OPTION_YES
)
if
(
have_ndbcluster
!=
SHOW_OPTION_YES
)
...
...
sql/handler.cc
View file @
7ae3682d
...
@@ -28,11 +28,6 @@
...
@@ -28,11 +28,6 @@
#include <myisampack.h>
#include <myisampack.h>
#include <errno.h>
#include <errno.h>
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
#define NDB_MAX_ATTRIBUTES_IN_TABLE 128
#include "ha_ndbcluster.h"
#endif
#ifdef WITH_PARTITION_STORAGE_ENGINE
#ifdef WITH_PARTITION_STORAGE_ENGINE
#include "ha_partition.h"
#include "ha_partition.h"
#endif
#endif
...
@@ -2745,6 +2740,29 @@ int ha_discover(THD *thd, const char *db, const char *name,
...
@@ -2745,6 +2740,29 @@ int ha_discover(THD *thd, const char *db, const char *name,
to ask engine if there are any new tables that should be written to disk
to ask engine if there are any new tables that should be written to disk
or any dropped tables that need to be removed from disk
or any dropped tables that need to be removed from disk
*/
*/
typedef
struct
st_find_files_args
{
const
char
*
db
;
const
char
*
path
;
const
char
*
wild
;
bool
dir
;
List
<
char
>
*
files
;
};
static
my_bool
find_files_handlerton
(
THD
*
thd
,
st_plugin_int
*
plugin
,
void
*
arg
)
{
st_find_files_args
*
vargs
=
(
st_find_files_args
*
)
arg
;
handlerton
*
hton
=
(
handlerton
*
)
plugin
->
data
;
if
(
hton
->
state
==
SHOW_OPTION_YES
&&
hton
->
find_files
)
if
(
hton
->
find_files
(
thd
,
vargs
->
db
,
vargs
->
path
,
vargs
->
wild
,
vargs
->
dir
,
vargs
->
files
))
return
TRUE
;
return
FALSE
;
}
int
int
ha_find_files
(
THD
*
thd
,
const
char
*
db
,
const
char
*
path
,
ha_find_files
(
THD
*
thd
,
const
char
*
db
,
const
char
*
path
,
...
@@ -2754,10 +2772,11 @@ ha_find_files(THD *thd,const char *db,const char *path,
...
@@ -2754,10 +2772,11 @@ ha_find_files(THD *thd,const char *db,const char *path,
DBUG_ENTER
(
"ha_find_files"
);
DBUG_ENTER
(
"ha_find_files"
);
DBUG_PRINT
(
"enter"
,
(
"db: %s, path: %s, wild: %s, dir: %d"
,
DBUG_PRINT
(
"enter"
,
(
"db: %s, path: %s, wild: %s, dir: %d"
,
db
,
path
,
wild
,
dir
));
db
,
path
,
wild
,
dir
));
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
st_find_files_args
args
=
{
db
,
path
,
wild
,
dir
,
files
};
if
(
have_ndbcluster
==
SHOW_OPTION_YES
)
error
=
ndbcluster_find_files
(
thd
,
db
,
path
,
wild
,
dir
,
files
);
plugin_foreach
(
thd
,
find_files_handlerton
,
#endif
MYSQL_STORAGE_ENGINE_PLUGIN
,
&
args
);
/* The return value is not currently used */
DBUG_RETURN
(
error
);
DBUG_RETURN
(
error
);
}
}
...
@@ -2771,15 +2790,34 @@ ha_find_files(THD *thd,const char *db,const char *path,
...
@@ -2771,15 +2790,34 @@ ha_find_files(THD *thd,const char *db,const char *path,
# Error code
# Error code
*/
*/
typedef
struct
st_table_exists_in_engine_args
{
const
char
*
db
;
const
char
*
name
;
};
static
my_bool
table_exists_in_engine_handlerton
(
THD
*
thd
,
st_plugin_int
*
plugin
,
void
*
arg
)
{
st_table_exists_in_engine_args
*
vargs
=
(
st_table_exists_in_engine_args
*
)
arg
;
handlerton
*
hton
=
(
handlerton
*
)
plugin
->
data
;
if
(
hton
->
state
==
SHOW_OPTION_YES
&&
hton
->
table_exists_in_engine
)
if
((
hton
->
table_exists_in_engine
(
thd
,
vargs
->
db
,
vargs
->
name
))
==
1
)
return
TRUE
;
return
FALSE
;
}
int
ha_table_exists_in_engine
(
THD
*
thd
,
const
char
*
db
,
const
char
*
name
)
int
ha_table_exists_in_engine
(
THD
*
thd
,
const
char
*
db
,
const
char
*
name
)
{
{
int
error
=
0
;
int
error
=
0
;
DBUG_ENTER
(
"ha_table_exists_in_engine"
);
DBUG_ENTER
(
"ha_table_exists_in_engine"
);
DBUG_PRINT
(
"enter"
,
(
"db: %s, name: %s"
,
db
,
name
));
DBUG_PRINT
(
"enter"
,
(
"db: %s, name: %s"
,
db
,
name
));
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
st_table_exists_in_engine_args
args
=
{
db
,
name
};
if
(
have_ndbcluster
==
SHOW_OPTION_YES
)
error
=
plugin_foreach
(
thd
,
table_exists_in_engine_handlerton
,
error
=
ndbcluster_table_exists_in_engine
(
thd
,
db
,
name
);
MYSQL_STORAGE_ENGINE_PLUGIN
,
&
args
);
#endif
DBUG_PRINT
(
"exit"
,
(
"error: %d"
,
error
));
DBUG_PRINT
(
"exit"
,
(
"error: %d"
,
error
));
DBUG_RETURN
(
error
);
DBUG_RETURN
(
error
);
}
}
...
...
sql/handler.h
View file @
7ae3682d
...
@@ -668,7 +668,11 @@ struct handlerton
...
@@ -668,7 +668,11 @@ struct handlerton
(
*
create_iterator
)(
enum
handler_iterator_type
type
,
(
*
create_iterator
)(
enum
handler_iterator_type
type
,
struct
handler_iterator
*
fill_this_in
);
struct
handler_iterator
*
fill_this_in
);
int
(
*
discover
)(
THD
*
thd
,
const
char
*
db
,
const
char
*
name
,
int
(
*
discover
)(
THD
*
thd
,
const
char
*
db
,
const
char
*
name
,
const
void
**
frmblob
,
uint
*
frmlen
);
const
void
**
frmblob
,
uint
*
frmlen
);
int
(
*
find_files
)(
THD
*
thd
,
const
char
*
db
,
const
char
*
path
,
const
char
*
wild
,
bool
dir
,
List
<
char
>
*
files
);
int
(
*
table_exists_in_engine
)(
THD
*
thd
,
const
char
*
db
,
const
char
*
name
);
};
};
...
...
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