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
8b8f17dd
Commit
8b8f17dd
authored
Jan 04, 2005
by
marty@linux.site
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide internal unique index naming
parent
2e714857
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
15 deletions
+28
-15
ndb/examples/ndbapi_simple_index_example/ndbapi_simple_index.cpp
...mples/ndbapi_simple_index_example/ndbapi_simple_index.cpp
+3
-3
ndb/src/ndbapi/NdbTransaction.cpp
ndb/src/ndbapi/NdbTransaction.cpp
+25
-12
No files found.
ndb/examples/ndbapi_simple_index_example/ndbapi_simple_index.cpp
View file @
8b8f17dd
...
@@ -143,7 +143,7 @@ int main()
...
@@ -143,7 +143,7 @@ int main()
if
(
myTransaction
==
NULL
)
APIERROR
(
myNdb
->
getNdbError
());
if
(
myTransaction
==
NULL
)
APIERROR
(
myNdb
->
getNdbError
());
NdbIndexOperation
*
myIndexOperation
=
NdbIndexOperation
*
myIndexOperation
=
myTransaction
->
getNdbIndexOperation
(
"MYINDEXNAME
$unique
"
,
"MYTABLENAME"
);
myTransaction
->
getNdbIndexOperation
(
"MYINDEXNAME"
,
"MYTABLENAME"
);
if
(
myIndexOperation
==
NULL
)
APIERROR
(
myTransaction
->
getNdbError
());
if
(
myIndexOperation
==
NULL
)
APIERROR
(
myTransaction
->
getNdbError
());
myIndexOperation
->
readTuple
(
NdbOperation
::
LM_Read
);
myIndexOperation
->
readTuple
(
NdbOperation
::
LM_Read
);
...
@@ -166,7 +166,7 @@ int main()
...
@@ -166,7 +166,7 @@ int main()
if
(
myTransaction
==
NULL
)
APIERROR
(
myNdb
->
getNdbError
());
if
(
myTransaction
==
NULL
)
APIERROR
(
myNdb
->
getNdbError
());
NdbIndexOperation
*
myIndexOperation
=
NdbIndexOperation
*
myIndexOperation
=
myTransaction
->
getNdbIndexOperation
(
"MYINDEXNAME
$unique
"
,
"MYTABLENAME"
);
myTransaction
->
getNdbIndexOperation
(
"MYINDEXNAME"
,
"MYTABLENAME"
);
if
(
myIndexOperation
==
NULL
)
APIERROR
(
myTransaction
->
getNdbError
());
if
(
myIndexOperation
==
NULL
)
APIERROR
(
myTransaction
->
getNdbError
());
myIndexOperation
->
updateTuple
();
myIndexOperation
->
updateTuple
();
...
@@ -187,7 +187,7 @@ int main()
...
@@ -187,7 +187,7 @@ int main()
if
(
myTransaction
==
NULL
)
APIERROR
(
myNdb
->
getNdbError
());
if
(
myTransaction
==
NULL
)
APIERROR
(
myNdb
->
getNdbError
());
NdbIndexOperation
*
myIndexOperation
=
NdbIndexOperation
*
myIndexOperation
=
myTransaction
->
getNdbIndexOperation
(
"MYINDEXNAME
$unique
"
,
"MYTABLENAME"
);
myTransaction
->
getNdbIndexOperation
(
"MYINDEXNAME"
,
"MYTABLENAME"
);
if
(
myIndexOperation
==
NULL
)
APIERROR
(
myTransaction
->
getNdbError
());
if
(
myIndexOperation
==
NULL
)
APIERROR
(
myTransaction
->
getNdbError
());
myIndexOperation
->
deleteTuple
();
myIndexOperation
->
deleteTuple
();
...
...
ndb/src/ndbapi/NdbTransaction.cpp
View file @
8b8f17dd
...
@@ -1076,15 +1076,15 @@ NdbTransaction::getNdbScanOperation(const char* aTableName)
...
@@ -1076,15 +1076,15 @@ NdbTransaction::getNdbScanOperation(const char* aTableName)
}
//NdbTransaction::getNdbScanOperation()
}
//NdbTransaction::getNdbScanOperation()
/*****************************************************************************
/*****************************************************************************
NdbScanOperation* getNdbScanOperation(const char* anIndexName, const char* aTableName);
NdbScanOperation* getNdb
Index
ScanOperation(const char* anIndexName, const char* aTableName);
Return Value Return a pointer to a Ndb
ScanOperation object if getNdb
ScanOperation was succesful.
Return Value Return a pointer to a Ndb
IndexScanOperation object if getNdbIndex
ScanOperation was succesful.
Return NULL : In all other case.
Return NULL : In all other case.
Parameters: anIndexName : Name of the index to use.
Parameters: anIndexName : Name of the index to use.
aTableName : Name of the database table.
aTableName : Name of the database table.
Remark: Get an operation from NdbScanOperation idlelist and get the NdbTransaction object
Remark: Get an operation from Ndb
Index
ScanOperation idlelist and get the NdbTransaction object
who was fetch by startTransaction pointing to this operation
who was fetch by startTransaction pointing to this operation
getOperation will set the theTableId in the NdbOperation object.synchronous
getOperation will set the theTableId in the Ndb
IndexScan
Operation object.synchronous
******************************************************************************/
******************************************************************************/
NdbIndexScanOperation
*
NdbIndexScanOperation
*
NdbTransaction
::
getNdbIndexScanOperation
(
const
char
*
anIndexName
,
NdbTransaction
::
getNdbIndexScanOperation
(
const
char
*
anIndexName
,
...
@@ -1134,12 +1134,12 @@ NdbTransaction::getNdbIndexScanOperation(const NdbDictionary::Index * index,
...
@@ -1134,12 +1134,12 @@ NdbTransaction::getNdbIndexScanOperation(const NdbDictionary::Index * index,
/*****************************************************************************
/*****************************************************************************
NdbScanOperation* getNdbScanOperation(int aTableId);
NdbScanOperation* getNdbScanOperation(int aTableId);
Return Value Return a pointer to a Ndb
Operation object if getNdb
Operation was succesful.
Return Value Return a pointer to a Ndb
ScanOperation object if getNdbScan
Operation was succesful.
Return NULL: In all other case.
Return NULL: In all other case.
Parameters: tableId : Id of the database table beeing deleted.
Parameters: tableId : Id of the database table beeing deleted.
Remark: Get an operation from NdbScanOperation object idlelist and get the NdbTransaction
Remark: Get an operation from NdbScanOperation object idlelist and get the NdbTransaction
object who was fetch by startTransaction pointing to this operation
object who was fetch by startTransaction pointing to this operation
getOperation will set the theTableId in the NdbOperation object, synchronous.
getOperation will set the theTableId in the Ndb
Scan
Operation object, synchronous.
*****************************************************************************/
*****************************************************************************/
NdbIndexScanOperation
*
NdbIndexScanOperation
*
NdbTransaction
::
getNdbScanOperation
(
const
NdbTableImpl
*
tab
)
NdbTransaction
::
getNdbScanOperation
(
const
NdbTableImpl
*
tab
)
...
@@ -1203,12 +1203,12 @@ NdbTransaction::getNdbScanOperation(const NdbDictionary::Table * table)
...
@@ -1203,12 +1203,12 @@ NdbTransaction::getNdbScanOperation(const NdbDictionary::Table * table)
NdbIndexOperation* getNdbIndexOperation(const char* anIndexName,
NdbIndexOperation* getNdbIndexOperation(const char* anIndexName,
const char* aTableName);
const char* aTableName);
Return Value Return a pointer to a NdbOperation object if getNdb
Scan
Operation was succesful.
Return Value Return a pointer to a NdbOperation object if getNdb
Index
Operation was succesful.
Return NULL : In all other case.
Return NULL : In all other case.
Parameters: aTableName : Name of the database table.
Parameters: aTableName : Name of the database table.
Remark: Get an operation from Ndb
Scan
Operation idlelist and get the NdbTransaction object
Remark: Get an operation from Ndb
Index
Operation idlelist and get the NdbTransaction object
who was fetch by startTransaction pointing to this
operation
who was fetch by startTransaction pointing to this operation
getOperation will set the theTableId in the Ndb
Scan
Operation object.synchronous
getOperation will set the theTableId in the Ndb
Index
Operation object.synchronous
******************************************************************************/
******************************************************************************/
NdbIndexOperation
*
NdbIndexOperation
*
NdbTransaction
::
getNdbIndexOperation
(
const
char
*
anIndexName
,
NdbTransaction
::
getNdbIndexOperation
(
const
char
*
anIndexName
,
...
@@ -1216,8 +1216,21 @@ NdbTransaction::getNdbIndexOperation(const char* anIndexName,
...
@@ -1216,8 +1216,21 @@ NdbTransaction::getNdbIndexOperation(const char* anIndexName,
{
{
if
(
theCommitStatus
==
Started
)
{
if
(
theCommitStatus
==
Started
)
{
NdbTableImpl
*
table
=
theNdb
->
theDictionary
->
getTable
(
aTableName
);
NdbTableImpl
*
table
=
theNdb
->
theDictionary
->
getTable
(
aTableName
);
NdbIndexImpl
*
index
=
theNdb
->
theDictionary
->
getIndex
(
anIndexName
,
NdbIndexImpl
*
index
;
aTableName
);
if
(
table
->
m_frm
.
get_data
())
{
// This unique index is defined from SQL level
static
const
char
*
uniqueSuffix
=
"$unique"
;
char
uniqueIndexName
[
MAX_TAB_NAME_SIZE
];
strxnmov
(
uniqueIndexName
,
MAX_TAB_NAME_SIZE
,
anIndexName
,
uniqueSuffix
,
NullS
);
index
=
theNdb
->
theDictionary
->
getIndex
(
uniqueIndexName
,
aTableName
);
}
else
index
=
theNdb
->
theDictionary
->
getIndex
(
anIndexName
,
aTableName
);
if
(
table
!=
0
&&
index
!=
0
){
if
(
table
!=
0
&&
index
!=
0
){
return
getNdbIndexOperation
(
index
,
table
);
return
getNdbIndexOperation
(
index
,
table
);
}
}
...
...
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