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
26cc7364
Commit
26cc7364
authored
Jan 31, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-5.1-new
into mysql.com:/usr/local/mysql/x/mysql-5.1-new
parents
7d901198
91b0d093
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
6 deletions
+26
-6
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+23
-4
sql/ha_ndbcluster_binlog.cc
sql/ha_ndbcluster_binlog.cc
+1
-1
sql/ha_ndbcluster_binlog.h
sql/ha_ndbcluster_binlog.h
+2
-1
No files found.
sql/ha_ndbcluster.cc
View file @
26cc7364
...
@@ -5388,6 +5388,18 @@ static void ndbcluster_drop_database(char *path)
...
@@ -5388,6 +5388,18 @@ static void ndbcluster_drop_database(char *path)
/*
/*
find all tables in ndb and discover those needed
find all tables in ndb and discover those needed
*/
*/
int
ndb_create_table_from_engine
(
THD
*
thd
,
const
char
*
db
,
const
char
*
table_name
)
{
LEX
*
old_lex
=
thd
->
lex
,
newlex
;
thd
->
lex
=
&
newlex
;
newlex
.
current_select
=
NULL
;
lex_start
(
thd
,
(
const
uchar
*
)
""
,
0
);
int
res
=
ha_create_table_from_engine
(
thd
,
db
,
table_name
);
thd
->
lex
=
old_lex
;
return
res
;
}
int
ndbcluster_find_all_files
(
THD
*
thd
)
int
ndbcluster_find_all_files
(
THD
*
thd
)
{
{
DBUG_ENTER
(
"ndbcluster_find_all_files"
);
DBUG_ENTER
(
"ndbcluster_find_all_files"
);
...
@@ -5440,8 +5452,15 @@ int ndbcluster_find_all_files(THD *thd)
...
@@ -5440,8 +5452,15 @@ int ndbcluster_find_all_files(THD *thd)
if
(
ndbtab
->
getFrmLength
()
==
0
)
if
(
ndbtab
->
getFrmLength
()
==
0
)
continue
;
continue
;
strxnmov
(
key
,
FN_LEN
-
1
,
mysql_data_home
,
"/"
,
/* check if database exists */
elmt
.
database
,
"/"
,
elmt
.
name
,
NullS
);
char
*
end
=
strxnmov
(
key
,
FN_LEN
-
1
,
mysql_data_home
,
"/"
,
elmt
.
database
,
NullS
);
if
(
my_access
(
key
,
F_OK
))
{
/* no such database defined, skip table */
continue
;
}
strxnmov
(
end
,
FN_LEN
-
1
-
(
key
-
end
),
"/"
,
elmt
.
name
,
NullS
);
const
void
*
data
=
0
,
*
pack_data
=
0
;
const
void
*
data
=
0
,
*
pack_data
=
0
;
uint
length
,
pack_length
;
uint
length
,
pack_length
;
int
discover
=
0
;
int
discover
=
0
;
...
@@ -5471,7 +5490,7 @@ int ndbcluster_find_all_files(THD *thd)
...
@@ -5471,7 +5490,7 @@ int ndbcluster_find_all_files(THD *thd)
{
{
/* ToDo 4.1 database needs to be created if missing */
/* ToDo 4.1 database needs to be created if missing */
pthread_mutex_lock
(
&
LOCK_open
);
pthread_mutex_lock
(
&
LOCK_open
);
if
(
ha
_create_table_from_engine
(
thd
,
elmt
.
database
,
elmt
.
name
))
if
(
ndb
_create_table_from_engine
(
thd
,
elmt
.
database
,
elmt
.
name
))
{
{
/* ToDo 4.1 handle error */
/* ToDo 4.1 handle error */
}
}
...
@@ -5699,7 +5718,7 @@ int ndbcluster_find_files(THD *thd,const char *db,const char *path,
...
@@ -5699,7 +5718,7 @@ int ndbcluster_find_files(THD *thd,const char *db,const char *path,
while
((
file_name
=
it2
++
))
while
((
file_name
=
it2
++
))
{
{
DBUG_PRINT
(
"info"
,
(
"Table %s need discovery"
,
file_name
));
DBUG_PRINT
(
"info"
,
(
"Table %s need discovery"
,
file_name
));
if
(
ha
_create_table_from_engine
(
thd
,
db
,
file_name
)
==
0
)
if
(
ndb
_create_table_from_engine
(
thd
,
db
,
file_name
)
==
0
)
files
->
push_back
(
thd
->
strdup
(
file_name
));
files
->
push_back
(
thd
->
strdup
(
file_name
));
}
}
...
...
sql/ha_ndbcluster_binlog.cc
View file @
26cc7364
...
@@ -1314,7 +1314,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
...
@@ -1314,7 +1314,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
/* fall through */
/* fall through */
case
SOT_ALTER_TABLE
:
case
SOT_ALTER_TABLE
:
pthread_mutex_lock
(
&
LOCK_open
);
pthread_mutex_lock
(
&
LOCK_open
);
if
(
ha
_create_table_from_engine
(
thd
,
schema
->
db
,
schema
->
name
))
if
(
ndb
_create_table_from_engine
(
thd
,
schema
->
db
,
schema
->
name
))
{
{
sql_print_error
(
"Could not discover table '%s.%s' from "
sql_print_error
(
"Could not discover table '%s.%s' from "
"binlog schema event '%s' from node %d"
,
"binlog schema event '%s' from node %d"
,
...
...
sql/ha_ndbcluster_binlog.h
View file @
26cc7364
...
@@ -90,7 +90,8 @@ int ndbcluster_handle_drop_table(Ndb *ndb, const char *event_name,
...
@@ -90,7 +90,8 @@ int ndbcluster_handle_drop_table(Ndb *ndb, const char *event_name,
NDB_SHARE
*
share
);
NDB_SHARE
*
share
);
void
ndb_rep_event_name
(
String
*
event_name
,
void
ndb_rep_event_name
(
String
*
event_name
,
const
char
*
db
,
const
char
*
tbl
);
const
char
*
db
,
const
char
*
tbl
);
int
ndb_create_table_from_engine
(
THD
*
thd
,
const
char
*
db
,
const
char
*
table_name
);
int
ndbcluster_binlog_start
();
int
ndbcluster_binlog_start
();
pthread_handler_t
ndb_binlog_thread_func
(
void
*
arg
);
pthread_handler_t
ndb_binlog_thread_func
(
void
*
arg
);
...
...
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