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
e358ba2e
Commit
e358ba2e
authored
Sep 26, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testDict -n InvalidTables
parent
10d30486
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
ndb/src/kernel/blocks/dbdict/Dbdict.cpp
ndb/src/kernel/blocks/dbdict/Dbdict.cpp
+23
-2
No files found.
ndb/src/kernel/blocks/dbdict/Dbdict.cpp
View file @
e358ba2e
...
@@ -3475,12 +3475,19 @@ int Dbdict::handleAlterTab(AlterTabReq * req,
...
@@ -3475,12 +3475,19 @@ int Dbdict::handleAlterTab(AlterTabReq * req,
jam
();
jam
();
// Table rename
// Table rename
// Remove from hashtable
// Remove from hashtable
#ifdef VM_TRACE
TableRecordPtr
tmp
;
ndbrequire
(
c_tableRecordHash
.
find
(
tmp
,
*
origTablePtr
.
p
));
#endif
c_tableRecordHash
.
remove
(
origTablePtr
);
c_tableRecordHash
.
remove
(
origTablePtr
);
strcpy
(
regAlterTabPtr
->
previousTableName
,
origTablePtr
.
p
->
tableName
);
strcpy
(
regAlterTabPtr
->
previousTableName
,
origTablePtr
.
p
->
tableName
);
strcpy
(
origTablePtr
.
p
->
tableName
,
newTablePtr
.
p
->
tableName
);
strcpy
(
origTablePtr
.
p
->
tableName
,
newTablePtr
.
p
->
tableName
);
// Set new schema version
// Set new schema version
origTablePtr
.
p
->
tableVersion
=
newTablePtr
.
p
->
tableVersion
;
origTablePtr
.
p
->
tableVersion
=
newTablePtr
.
p
->
tableVersion
;
// Put it back
// Put it back
#ifdef VM_TRACE
ndbrequire
(
!
c_tableRecordHash
.
find
(
tmp
,
*
origTablePtr
.
p
));
#endif
c_tableRecordHash
.
add
(
origTablePtr
);
c_tableRecordHash
.
add
(
origTablePtr
);
return
0
;
return
0
;
...
@@ -3501,12 +3508,19 @@ void Dbdict::revertAlterTable(Signal * signal,
...
@@ -3501,12 +3508,19 @@ void Dbdict::revertAlterTable(Signal * signal,
TableRecordPtr
tablePtr
;
TableRecordPtr
tablePtr
;
c_tableRecordPool
.
getPtr
(
tablePtr
,
tableId
);
c_tableRecordPool
.
getPtr
(
tablePtr
,
tableId
);
// Remove from hashtable
// Remove from hashtable
#ifdef VM_TRACE
TableRecordPtr
tmp
;
ndbrequire
(
c_tableRecordHash
.
find
(
tmp
,
*
tablePtr
.
p
));
#endif
c_tableRecordHash
.
remove
(
tablePtr
);
c_tableRecordHash
.
remove
(
tablePtr
);
// Restore name
// Restore name
strcpy
(
tablePtr
.
p
->
tableName
,
regAlterTabPtr
->
previousTableName
);
strcpy
(
tablePtr
.
p
->
tableName
,
regAlterTabPtr
->
previousTableName
);
// Revert schema version
// Revert schema version
tablePtr
.
p
->
tableVersion
=
tablePtr
.
p
->
tableVersion
-
1
;
tablePtr
.
p
->
tableVersion
=
tablePtr
.
p
->
tableVersion
-
1
;
// Put it back
// Put it back
#ifdef VM_TRACE
ndbrequire
(
!
c_tableRecordHash
.
find
(
tmp
,
*
tablePtr
.
p
));
#endif
c_tableRecordHash
.
add
(
tablePtr
);
c_tableRecordHash
.
add
(
tablePtr
);
return
;
return
;
...
@@ -4644,6 +4658,8 @@ void Dbdict::handleTabInfoInit(SimpleProperties::Reader & it,
...
@@ -4644,6 +4658,8 @@ void Dbdict::handleTabInfoInit(SimpleProperties::Reader & it,
jam
();
jam
();
#ifdef VM_TRACE
#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
);
TableRecordPtr
tmp
;
ndbrequire
(
!
c_tableRecordHash
.
find
(
tmp
,
*
tablePtr
.
p
));
#endif
#endif
c_tableRecordHash
.
add
(
tablePtr
);
c_tableRecordHash
.
add
(
tablePtr
);
}
}
...
@@ -4690,7 +4706,7 @@ void Dbdict::handleTabInfoInit(SimpleProperties::Reader & it,
...
@@ -4690,7 +4706,7 @@ void Dbdict::handleTabInfoInit(SimpleProperties::Reader & it,
/**
/**
* Release table
* Release table
*/
*/
releaseTableObject
(
tablePtr
.
i
,
!
checkExist
);
releaseTableObject
(
tablePtr
.
i
,
checkExist
);
}
}
}
//handleTabInfoInit()
}
//handleTabInfoInit()
...
@@ -5501,8 +5517,13 @@ void Dbdict::releaseTableObject(Uint32 tableId, bool removeFromHash)
...
@@ -5501,8 +5517,13 @@ void Dbdict::releaseTableObject(Uint32 tableId, bool removeFromHash)
AttributeRecordPtr
attrPtr
;
AttributeRecordPtr
attrPtr
;
c_tableRecordPool
.
getPtr
(
tablePtr
,
tableId
);
c_tableRecordPool
.
getPtr
(
tablePtr
,
tableId
);
if
(
removeFromHash
)
if
(
removeFromHash
)
{
#ifdef VM_TRACE
TableRecordPtr
tmp
;
ndbrequire
(
c_tableRecordHash
.
find
(
tmp
,
*
tablePtr
.
p
));
#endif
c_tableRecordHash
.
remove
(
tablePtr
);
c_tableRecordHash
.
remove
(
tablePtr
);
}
tablePtr
.
p
->
tabState
=
TableRecord
::
NOT_DEFINED
;
tablePtr
.
p
->
tabState
=
TableRecord
::
NOT_DEFINED
;
Uint32
nextAttrRecord
=
tablePtr
.
p
->
firstAttribute
;
Uint32
nextAttrRecord
=
tablePtr
.
p
->
firstAttribute
;
...
...
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