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
bbee2343
Commit
bbee2343
authored
Apr 28, 2005
by
mskold@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for avoiding gettin Invalid schema object version when doing local changes, post review fixes
parent
5f9843ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
+20
-4
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+20
-4
No files found.
sql/ha_ndbcluster.cc
View file @
bbee2343
...
@@ -336,7 +336,17 @@ void ha_ndbcluster::invalidate_dictionary_cache(bool global)
...
@@ -336,7 +336,17 @@ void ha_ndbcluster::invalidate_dictionary_cache(bool global)
NDBDICT
*
dict
=
get_ndb
()
->
getDictionary
();
NDBDICT
*
dict
=
get_ndb
()
->
getDictionary
();
DBUG_PRINT
(
"info"
,
(
"invalidating %s"
,
m_tabname
));
DBUG_PRINT
(
"info"
,
(
"invalidating %s"
,
m_tabname
));
if
(
global
)
if
(
global
)
dict
->
invalidateTable
(
m_tabname
);
{
if
(((
const
NDBTAB
*
)
m_table
)
->
getObjectStatus
()
==
NdbDictionary
::
Object
::
Invalid
)
{
// Global cache has already been invalidated
dict
->
removeCachedTable
(
m_tabname
);
global
=
FALSE
;
}
else
dict
->
invalidateTable
(
m_tabname
);
}
else
else
dict
->
removeCachedTable
(
m_tabname
);
dict
->
removeCachedTable
(
m_tabname
);
table
->
version
=
0L
;
/* Free when thread is ready */
table
->
version
=
0L
;
/* Free when thread is ready */
...
@@ -779,6 +789,7 @@ int ha_ndbcluster::get_metadata(const char *path)
...
@@ -779,6 +789,7 @@ int ha_ndbcluster::get_metadata(const char *path)
if
(
!
(
tab
=
dict
->
getTable
(
m_tabname
)))
if
(
!
(
tab
=
dict
->
getTable
(
m_tabname
)))
ERR_RETURN
(
dict
->
getNdbError
());
ERR_RETURN
(
dict
->
getNdbError
());
// Check if thread has stale local cache
if
(
tab
->
getObjectStatus
()
==
NdbDictionary
::
Object
::
Invalid
)
if
(
tab
->
getObjectStatus
()
==
NdbDictionary
::
Object
::
Invalid
)
{
{
invalidate_dictionary_cache
(
FALSE
);
invalidate_dictionary_cache
(
FALSE
);
...
@@ -804,6 +815,7 @@ int ha_ndbcluster::get_metadata(const char *path)
...
@@ -804,6 +815,7 @@ int ha_ndbcluster::get_metadata(const char *path)
if
(
!
invalidating_ndb_table
)
if
(
!
invalidating_ndb_table
)
{
{
DBUG_PRINT
(
"info"
,
(
"Invalidating table"
));
DBUG_PRINT
(
"info"
,
(
"Invalidating table"
));
m_table
=
(
void
*
)
tab
;
invalidate_dictionary_cache
(
TRUE
);
invalidate_dictionary_cache
(
TRUE
);
invalidating_ndb_table
=
TRUE
;
invalidating_ndb_table
=
TRUE
;
}
}
...
@@ -3288,7 +3300,6 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type)
...
@@ -3288,7 +3300,6 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type)
thd
->
transaction
.
stmt
.
ndb_tid
=
0
;
thd
->
transaction
.
stmt
.
ndb_tid
=
0
;
}
}
}
}
m_table
=
NULL
;
m_table_info
=
NULL
;
m_table_info
=
NULL
;
/*
/*
This is the place to make sure this handler instance
This is the place to make sure this handler instance
...
@@ -3910,7 +3921,13 @@ int ha_ndbcluster::rename_table(const char *from, const char *to)
...
@@ -3910,7 +3921,13 @@ int ha_ndbcluster::rename_table(const char *from, const char *to)
dict
=
ndb
->
getDictionary
();
dict
=
ndb
->
getDictionary
();
if
(
!
(
orig_tab
=
dict
->
getTable
(
m_tabname
)))
if
(
!
(
orig_tab
=
dict
->
getTable
(
m_tabname
)))
ERR_RETURN
(
dict
->
getNdbError
());
ERR_RETURN
(
dict
->
getNdbError
());
// Check if thread has stale local cache
if
(
orig_tab
->
getObjectStatus
()
==
NdbDictionary
::
Object
::
Invalid
)
{
dict
->
removeCachedTable
(
m_tabname
);
if
(
!
(
orig_tab
=
dict
->
getTable
(
m_tabname
)))
ERR_RETURN
(
dict
->
getNdbError
());
}
m_table
=
(
void
*
)
orig_tab
;
m_table
=
(
void
*
)
orig_tab
;
// Change current database to that of target table
// Change current database to that of target table
set_dbname
(
to
);
set_dbname
(
to
);
...
@@ -4278,7 +4295,6 @@ int ndbcluster_discover(THD* thd, const char *db, const char *name,
...
@@ -4278,7 +4295,6 @@ int ndbcluster_discover(THD* thd, const char *db, const char *name,
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
()));
len
=
tab
->
getFrmLength
();
len
=
tab
->
getFrmLength
();
...
...
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