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
0caf2a46
Commit
0caf2a46
authored
Feb 22, 2006
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes for push version of discover of on-line altered table
parent
18069347
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
9 deletions
+17
-9
sql/ha_ndbcluster_binlog.cc
sql/ha_ndbcluster_binlog.cc
+13
-7
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
+4
-2
No files found.
sql/ha_ndbcluster_binlog.cc
View file @
0caf2a46
...
...
@@ -1320,11 +1320,16 @@ ndb_handle_schema_change(THD *thd, Ndb *ndb, NdbEventOperation *pOp,
Invalidate table and all it's indexes
*/
ndb
->
setDatabaseName
(
share
->
table
->
s
->
db
.
str
);
Thd_ndb
*
thd_ndb
=
get_thd_ndb
(
thd
);
DBUG_ASSERT
(
thd_ndb
!=
NULL
);
Ndb
*
old_ndb
=
thd_ndb
->
ndb
;
thd_ndb
->
ndb
=
ndb
;
ha_ndbcluster
table_handler
(
table_share
);
table_handler
.
set_dbname
(
share
->
key
);
table_handler
.
set_tabname
(
share
->
key
);
table_handler
.
open_indexes
(
ndb
,
table
,
TRUE
);
table_handler
.
invalidate_dictionary_cache
(
TRUE
);
thd_ndb
->
ndb
=
old_ndb
;
if
(
online_alter_table
)
{
...
...
@@ -1349,6 +1354,9 @@ ndb_handle_schema_change(THD *thd, Ndb *ndb, NdbEventOperation *pOp,
DBUG_DUMP
(
"frm"
,
(
char
*
)
altered_table
->
getFrmData
(),
altered_table
->
getFrmLength
());
pthread_mutex_lock
(
&
LOCK_open
);
const
NDBTAB
*
old
=
dict
->
getTable
(
tabname
);
if
(
!
old
&&
old
->
getObjectVersion
()
!=
altered_table
->
getObjectVersion
())
dict
->
putTable
(
altered_table
);
if
((
error
=
unpackfrm
(
&
data
,
&
length
,
altered_table
->
getFrmData
()))
||
...
...
@@ -1359,12 +1367,12 @@ ndb_handle_schema_change(THD *thd, Ndb *ndb, NdbEventOperation *pOp,
}
pthread_mutex_unlock
(
&
LOCK_open
);
close_cached_tables
((
THD
*
)
0
,
0
,
(
TABLE_LIST
*
)
0
);
/*
pthread_mutex_lock
(
&
LOCK_open
);
if
((
error
=
ndbcluster_binlog_open_table
(
thd
,
share
,
table_share
,
table
)))
sql_print_information
(
"NDB: Failed to re-open table %s.%s"
,
dbname
,
tabname
);
*/
pthread_mutex_unlock
(
&
LOCK_open
);
}
}
remote_drop_table
=
1
;
...
...
@@ -2172,7 +2180,6 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab,
op
=
ndb
->
createEventOperation
(
event_name
);
// reset to catch errors
ndb
->
setDatabaseName
(
""
);
ndb
->
setDatabaseSchemaName
(
""
);
}
if
(
!
op
)
{
...
...
@@ -2745,8 +2752,8 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
goto
err
;
}
// empty database
and schema
if
(
!
(
ndb
=
new
Ndb
(
g_ndb_cluster_connection
,
""
,
""
))
||
// empty database
if
(
!
(
ndb
=
new
Ndb
(
g_ndb_cluster_connection
,
""
))
||
ndb
->
init
())
{
sql_print_error
(
"NDB Binlog: Getting Ndb object failed"
);
...
...
@@ -3010,7 +3017,6 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
ndb_binlog_thread_handle_non_data_event
(
ndb
,
pOp
,
row
);
// reset to catch errors
ndb
->
setDatabaseName
(
""
);
ndb
->
setDatabaseSchemaName
(
""
);
}
pOp
=
ndb
->
nextEvent
();
...
...
storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
View file @
0caf2a46
...
...
@@ -1310,8 +1310,10 @@ NdbDictionaryImpl::putTable(NdbTableImpl *impl)
m_globalHash
->
lock
();
if
((
old
=
m_globalHash
->
get
(
impl
->
m_internalName
.
c_str
())))
{
old
->
m_status
=
NdbDictionary
::
Object
::
Invalid
;
m_globalHash
->
drop
(
old
);
m_globalHash
->
alter_table_rep
(
old
->
m_internalName
.
c_str
(),
impl
->
m_id
,
impl
->
m_version
,
FALSE
);
}
m_globalHash
->
put
(
impl
->
m_internalName
.
c_str
(),
impl
);
m_globalHash
->
unlock
();
...
...
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