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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
69edf1dd
Commit
69edf1dd
authored
Sep 25, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-4.1-ndb
into mysql.com:/home/jonas/src/mysql-4.1-ndb
parents
45a7efa3
339d362d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
26 deletions
+56
-26
ndb/src/kernel/blocks/dbdict/Dbdict.cpp
ndb/src/kernel/blocks/dbdict/Dbdict.cpp
+30
-8
ndb/src/ndbapi/NdbDictionary.cpp
ndb/src/ndbapi/NdbDictionary.cpp
+6
-1
ndb/src/ndbapi/NdbDictionaryImpl.cpp
ndb/src/ndbapi/NdbDictionaryImpl.cpp
+19
-16
ndb/src/ndbapi/NdbDictionaryImpl.hpp
ndb/src/ndbapi/NdbDictionaryImpl.hpp
+1
-1
No files found.
ndb/src/kernel/blocks/dbdict/Dbdict.cpp
View file @
69edf1dd
...
...
@@ -4538,6 +4538,15 @@ void Dbdict::handleTabInfoInit(SimpleProperties::Reader & it,
parseP
->
errorLine
=
__LINE__
;
return
;
}
if
(
parseP
->
requestType
==
DictTabInfo
::
AlterTableFromAPI
)
{
ndbrequire
(
!
checkExist
);
}
if
(
!
checkExist
)
{
ndbrequire
(
parseP
->
requestType
==
DictTabInfo
::
AlterTableFromAPI
);
}
/* ---------------------------------------------------------------- */
// Verify that table name is an allowed table name.
...
...
@@ -4633,12 +4642,10 @@ void Dbdict::handleTabInfoInit(SimpleProperties::Reader & it,
strcpy
(
tablePtr
.
p
->
tableName
,
keyRecord
.
tableName
);
if
(
parseP
->
requestType
!=
DictTabInfo
::
AlterTableFromAPI
)
{
jam
();
c_tableRecordHash
.
add
(
tablePtr
);
}
#ifdef VM_TRACE
ndbout_c
(
"Dbdict: name=%s,id=%u"
,
tablePtr
.
p
->
tableName
,
tablePtr
.
i
);
ndbout_c
(
"Dbdict: name=%s,id=%u"
,
tablePtr
.
p
->
tableName
,
tablePtr
.
i
);
#endif
}
//tablePtr.p->noOfPrimkey = tableDesc.NoOfKeyAttr;
//tablePtr.p->noOfNullAttr = tableDesc.NoOfNullable;
...
...
@@ -4677,11 +4684,12 @@ void Dbdict::handleTabInfoInit(SimpleProperties::Reader & it,
handleTabInfo
(
it
,
parseP
);
if
(
parseP
->
errorCode
!=
0
){
if
(
parseP
->
errorCode
!=
0
)
{
/**
* Release table
*/
releaseTableObject
(
tablePtr
.
i
);
releaseTableObject
(
tablePtr
.
i
,
!
checkExist
);
}
}
//handleTabInfoInit()
...
...
@@ -6563,14 +6571,28 @@ Dbdict::execDROP_INDX_REQ(Signal* signal)
int
res
=
getMetaTablePtr
(
tmp
,
indexId
,
indexVersion
);
switch
(
res
){
case
MetaData
:
:
InvalidArgument
:
case
MetaData
:
:
TableNotFound
:
err
=
DropTableRef
::
NoSuchTable
;
err
=
DropIndxRef
::
IndexNotFound
;
goto
error
;
case
MetaData
:
:
TableNotFound
:
case
MetaData
:
:
InvalidTableVersion
:
err
=
DropIndxRef
::
InvalidIndexVersion
;
goto
error
;
}
if
(
!
tmp
.
p
->
isIndex
())
{
jam
();
err
=
DropIndxRef
::
NotAnIndex
;
goto
error
;
}
if
(
tmp
.
p
->
indexState
==
TableRecord
::
IS_DROPPING
){
jam
();
err
=
DropIndxRef
::
IndexNotFound
;
goto
error
;
}
tmp
.
p
->
indexState
=
TableRecord
::
IS_DROPPING
;
req
->
setOpKey
(
++
c_opRecordSequence
);
NodeReceiverGroup
rg
(
DBDICT
,
c_aliveNodes
);
sendSignal
(
rg
,
GSN_DROP_INDX_REQ
,
...
...
ndb/src/ndbapi/NdbDictionary.cpp
View file @
69edf1dd
...
...
@@ -856,7 +856,12 @@ NdbDictionary::Dictionary::listObjects(List& list, Object::Type type)
int
NdbDictionary
::
Dictionary
::
listIndexes
(
List
&
list
,
const
char
*
tableName
)
{
return
m_impl
.
listIndexes
(
list
,
tableName
);
const
NdbDictionary
::
Table
*
tab
=
getTable
(
tableName
);
if
(
tab
==
0
)
{
return
-
1
;
}
return
m_impl
.
listIndexes
(
list
,
tab
->
getTableId
());
}
const
struct
NdbError
&
...
...
ndb/src/ndbapi/NdbDictionaryImpl.cpp
View file @
69edf1dd
...
...
@@ -1407,16 +1407,15 @@ int NdbDictionaryImpl::alterTable(NdbTableImpl &impl)
// Remove cached information and let it be refreshed at next access
if
(
m_localHash
.
get
(
originalInternalName
)
!=
NULL
)
{
m_localHash
.
drop
(
originalInternalName
);
m_globalHash
->
lock
();
NdbTableImpl
*
cachedImpl
=
m_globalHash
->
get
(
originalInternalName
);
// If in local cache it must be in global
if
(
!
cachedImpl
)
abort
();
m_globalHash
->
lock
();
m_globalHash
->
drop
(
cachedImpl
);
m_globalHash
->
unlock
();
}
}
return
ret
;
}
...
...
@@ -1714,6 +1713,7 @@ NdbDictionaryImpl::dropTable(const char * name)
int
NdbDictionaryImpl
::
dropTable
(
NdbTableImpl
&
impl
)
{
int
res
;
const
char
*
name
=
impl
.
getName
();
if
(
impl
.
m_status
==
NdbDictionary
::
Object
::
New
){
return
dropTable
(
name
);
...
...
@@ -1725,28 +1725,34 @@ NdbDictionaryImpl::dropTable(NdbTableImpl & impl)
}
List
list
;
if
(
listIndexes
(
list
,
name
)
==
-
1
)
if
(
(
res
=
listIndexes
(
list
,
impl
.
m_tableId
))
==
-
1
){
return
-
1
;
}
for
(
unsigned
i
=
0
;
i
<
list
.
count
;
i
++
)
{
const
List
::
Element
&
element
=
list
.
elements
[
i
];
if
(
dropIndex
(
element
.
name
,
name
)
==
-
1
)
if
((
res
=
dropIndex
(
element
.
name
,
name
))
==
-
1
)
{
return
-
1
;
}
}
if
(
impl
.
m_noOfBlobs
!=
0
)
{
if
(
dropBlobTables
(
impl
)
!=
0
)
if
(
dropBlobTables
(
impl
)
!=
0
)
{
return
-
1
;
}
}
int
ret
=
m_receiver
.
dropTable
(
impl
);
if
(
ret
==
0
){
if
(
ret
==
0
||
m_error
.
code
==
709
){
const
char
*
internalTableName
=
impl
.
m_internalName
.
c_str
();
m_localHash
.
drop
(
internalTableName
);
m_globalHash
->
lock
();
m_globalHash
->
drop
(
&
impl
);
m_globalHash
->
unlock
();
return
0
;
}
return
ret
;
...
...
@@ -1762,8 +1768,9 @@ NdbDictionaryImpl::dropBlobTables(NdbTableImpl & t)
char
btname
[
NdbBlob
::
BlobTableNameSize
];
NdbBlob
::
getBlobTableName
(
btname
,
&
t
,
&
c
);
if
(
dropTable
(
btname
)
!=
0
)
{
if
(
m_error
.
code
!=
709
)
if
(
m_error
.
code
!=
709
)
{
return
-
1
;
}
}
}
return
0
;
...
...
@@ -2132,7 +2139,6 @@ NdbDictionaryImpl::dropIndex(NdbIndexImpl & impl, const char * tableName)
m_globalHash
->
drop
(
impl
.
m_table
);
m_globalHash
->
unlock
();
}
return
ret
;
}
...
...
@@ -2816,14 +2822,11 @@ NdbDictionaryImpl::listObjects(List& list, NdbDictionary::Object::Type type)
}
int
NdbDictionaryImpl
::
listIndexes
(
List
&
list
,
const
char
*
tableName
)
NdbDictionaryImpl
::
listIndexes
(
List
&
list
,
Uint32
indexId
)
{
ListTablesReq
req
;
NdbTableImpl
*
impl
=
getTable
(
tableName
);
if
(
impl
==
0
)
return
-
1
;
req
.
requestData
=
0
;
req
.
setTableId
(
i
mpl
->
m_table
Id
);
req
.
setTableId
(
i
ndex
Id
);
req
.
setListNames
(
true
);
req
.
setListIndexes
(
true
);
return
m_receiver
.
listObjects
(
list
,
req
.
requestData
,
m_ndb
.
usingFullyQualifiedNames
());
...
...
ndb/src/ndbapi/NdbDictionaryImpl.hpp
View file @
69edf1dd
...
...
@@ -390,7 +390,7 @@ public:
int
stopSubscribeEvent
(
NdbEventImpl
&
);
int
listObjects
(
List
&
list
,
NdbDictionary
::
Object
::
Type
type
);
int
listIndexes
(
List
&
list
,
const
char
*
tableName
);
int
listIndexes
(
List
&
list
,
Uint32
indexId
);
NdbTableImpl
*
getTable
(
const
char
*
tableName
,
void
**
data
=
0
);
Ndb_local_table_info
*
get_local_table_info
(
const
char
*
internalName
);
...
...
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