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
e07e9348
Commit
e07e9348
authored
Jun 24, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/jonas/src/mysql-4.1
parents
802688c6
ca30aaaa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
64 deletions
+49
-64
ndb/src/kernel/SimBlockList.cpp
ndb/src/kernel/SimBlockList.cpp
+22
-19
ndb/src/ndbapi/Ndb.cpp
ndb/src/ndbapi/Ndb.cpp
+16
-28
ndb/src/ndbapi/Ndbinit.cpp
ndb/src/ndbapi/Ndbinit.cpp
+11
-17
No files found.
ndb/src/kernel/SimBlockList.cpp
View file @
e07e9348
...
...
@@ -34,6 +34,9 @@
#include <Dbtux.hpp>
#include <NdbEnv.h>
#ifndef VM_TRACE
#define NEW_BLOCK(B) new B
#else
enum
SIMBLOCKLIST_DUMMY
{
A_VALUE
=
0
};
static
...
...
@@ -60,13 +63,13 @@ void * operator new (size_t sz, SIMBLOCKLIST_DUMMY dummy){
return
tmp
;
}
#define NEW_BLOCK(B) new(A_VALUE) B
#endif
void
SimBlockList
::
load
(
const
Configuration
&
conf
){
noOfBlocks
=
16
;
theList
=
new
SimulatedBlock
*
[
noOfBlocks
];
for
(
int
i
=
0
;
i
<
noOfBlocks
;
i
++
)
theList
[
i
]
=
0
;
Dbdict
*
dbdict
=
0
;
Dbdih
*
dbdih
=
0
;
...
...
@@ -75,28 +78,28 @@ SimBlockList::load(const Configuration & conf){
Uint32
dl
;
const
ndb_mgm_configuration_iterator
*
p
=
conf
.
getOwnConfigIterator
();
if
(
p
&&
!
ndb_mgm_get_int_parameter
(
p
,
CFG_DB_DISCLESS
,
&
dl
)
&&
dl
){
fs
=
new
(
A_VALUE
)
VoidFs
(
conf
);
fs
=
NEW_BLOCK
(
VoidFs
)
(
conf
);
}
else
{
fs
=
new
(
A_VALUE
)
Ndbfs
(
conf
);
fs
=
NEW_BLOCK
(
Ndbfs
)
(
conf
);
}
}
theList
[
0
]
=
new
(
A_VALUE
)
Dbacc
(
conf
);
theList
[
1
]
=
new
(
A_VALUE
)
Cmvmi
(
conf
);
theList
[
0
]
=
NEW_BLOCK
(
Dbacc
)
(
conf
);
theList
[
1
]
=
NEW_BLOCK
(
Cmvmi
)
(
conf
);
theList
[
2
]
=
fs
;
theList
[
3
]
=
dbdict
=
new
(
A_VALUE
)
Dbdict
(
conf
);
theList
[
4
]
=
dbdih
=
new
(
A_VALUE
)
Dbdih
(
conf
);
theList
[
5
]
=
new
(
A_VALUE
)
Dblqh
(
conf
);
theList
[
6
]
=
new
(
A_VALUE
)
Dbtc
(
conf
);
theList
[
7
]
=
new
(
A_VALUE
)
Dbtup
(
conf
);
theList
[
8
]
=
new
(
A_VALUE
)
Ndbcntr
(
conf
);
theList
[
9
]
=
new
(
A_VALUE
)
Qmgr
(
conf
);
theList
[
10
]
=
new
(
A_VALUE
)
Trix
(
conf
);
theList
[
11
]
=
new
(
A_VALUE
)
Backup
(
conf
);
theList
[
12
]
=
new
(
A_VALUE
)
DbUtil
(
conf
);
theList
[
13
]
=
new
(
A_VALUE
)
Suma
(
conf
);
theList
[
14
]
=
new
(
A_VALUE
)
Grep
(
conf
);
theList
[
15
]
=
new
(
A_VALUE
)
Dbtux
(
conf
);
theList
[
3
]
=
dbdict
=
NEW_BLOCK
(
Dbdict
)
(
conf
);
theList
[
4
]
=
dbdih
=
NEW_BLOCK
(
Dbdih
)
(
conf
);
theList
[
5
]
=
NEW_BLOCK
(
Dblqh
)
(
conf
);
theList
[
6
]
=
NEW_BLOCK
(
Dbtc
)
(
conf
);
theList
[
7
]
=
NEW_BLOCK
(
Dbtup
)
(
conf
);
theList
[
8
]
=
NEW_BLOCK
(
Ndbcntr
)
(
conf
);
theList
[
9
]
=
NEW_BLOCK
(
Qmgr
)
(
conf
);
theList
[
10
]
=
NEW_BLOCK
(
Trix
)
(
conf
);
theList
[
11
]
=
NEW_BLOCK
(
Backup
)
(
conf
);
theList
[
12
]
=
NEW_BLOCK
(
DbUtil
)
(
conf
);
theList
[
13
]
=
NEW_BLOCK
(
Suma
)
(
conf
);
theList
[
14
]
=
NEW_BLOCK
(
Grep
)
(
conf
);
theList
[
15
]
=
NEW_BLOCK
(
Dbtux
)
(
conf
);
// Metadata common part shared by block instances
ptrMetaDataCommon
=
new
MetaData
::
Common
(
*
dbdict
,
*
dbdih
);
...
...
ndb/src/ndbapi/Ndb.cpp
View file @
e07e9348
...
...
@@ -38,10 +38,6 @@ Name: Ndb.cpp
#include <NdbEnv.h>
#include <BaseString.hpp>
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
/****************************************************************************
void connect();
...
...
@@ -1028,18 +1024,14 @@ const char * Ndb::getCatalogName() const
void
Ndb
::
setCatalogName
(
const
char
*
a_catalog_name
)
{
if
(
a_catalog_name
)
{
strncpy
(
theDataBase
,
a_catalog_name
,
NDB_MAX_DATABASE_NAME_SIZE
);
// Prepare prefix for faster operations
uint
db_len
=
MIN
(
strlen
(
theDataBase
),
NDB_MAX_DATABASE_NAME_SIZE
-
1
);
uint
schema_len
=
MIN
(
strlen
(
theDataBaseSchema
),
NDB_MAX_SCHEMA_NAME_SIZE
-
1
);
strncpy
(
prefixName
,
theDataBase
,
NDB_MAX_DATABASE_NAME_SIZE
-
1
);
prefixName
[
db_len
]
=
table_name_separator
;
strncpy
(
prefixName
+
db_len
+
1
,
theDataBaseSchema
,
NDB_MAX_SCHEMA_NAME_SIZE
-
1
);
prefixName
[
db_len
+
schema_len
+
1
]
=
table_name_separator
;
prefixName
[
db_len
+
schema_len
+
2
]
=
'\0'
;
prefixEnd
=
prefixName
+
db_len
+
schema_len
+
2
;
snprintf
(
theDataBase
,
sizeof
(
theDataBase
),
"%s"
,
a_catalog_name
?
a_catalog_name
:
""
);
int
len
=
snprintf
(
prefixName
,
sizeof
(
prefixName
),
"%s%c%s%c"
,
theDataBase
,
table_name_separator
,
theDataBaseSchema
,
table_name_separator
);
prefixEnd
=
prefixName
+
(
len
<
sizeof
(
prefixName
)
?
len
:
sizeof
(
prefixName
)
-
1
);
}
}
...
...
@@ -1051,18 +1043,14 @@ const char * Ndb::getSchemaName() const
void
Ndb
::
setSchemaName
(
const
char
*
a_schema_name
)
{
if
(
a_schema_name
)
{
strncpy
(
theDataBaseSchema
,
a_schema_name
,
NDB_MAX_SCHEMA_NAME_SIZE
);
// Prepare prefix for faster operations
uint
db_len
=
MIN
(
strlen
(
theDataBase
),
NDB_MAX_DATABASE_NAME_SIZE
-
1
);
uint
schema_len
=
MIN
(
strlen
(
theDataBaseSchema
),
NDB_MAX_SCHEMA_NAME_SIZE
-
1
);
strncpy
(
prefixName
,
theDataBase
,
NDB_MAX_DATABASE_NAME_SIZE
-
1
);
prefixName
[
db_len
]
=
table_name_separator
;
strncpy
(
prefixName
+
db_len
+
1
,
theDataBaseSchema
,
NDB_MAX_SCHEMA_NAME_SIZE
-
1
);
prefixName
[
db_len
+
schema_len
+
1
]
=
table_name_separator
;
prefixName
[
db_len
+
schema_len
+
2
]
=
'\0'
;
prefixEnd
=
prefixName
+
db_len
+
schema_len
+
2
;
snprintf
(
theDataBaseSchema
,
sizeof
(
theDataBase
),
"%s"
,
a_schema_name
?
a_schema_name
:
""
);
int
len
=
snprintf
(
prefixName
,
sizeof
(
prefixName
),
"%s%c%s%c"
,
theDataBase
,
table_name_separator
,
theDataBaseSchema
,
table_name_separator
);
prefixEnd
=
prefixName
+
(
len
<
sizeof
(
prefixName
)
?
len
:
sizeof
(
prefixName
)
-
1
);
}
}
...
...
ndb/src/ndbapi/Ndbinit.cpp
View file @
e07e9348
...
...
@@ -56,7 +56,7 @@ Ndb(const char* aDataBase);
Parameters: aDataBase : Name of the database.
Remark: Connect to the database.
***************************************************************************/
Ndb
::
Ndb
(
const
char
*
aDataBase
,
const
char
*
a
DataBase
Schema
)
:
Ndb
::
Ndb
(
const
char
*
aDataBase
,
const
char
*
aSchema
)
:
theNdbObjectIdMap
(
0
),
thePreparedTransactionsArray
(
NULL
),
theSentTransactionsArray
(
NULL
),
...
...
@@ -121,22 +121,16 @@ Ndb::Ndb( const char* aDataBase , const char* aDataBaseSchema) :
theLastTupleId
[
i
]
=
0
;
}
//for
if
(
aDataBase
)
strncpy
(
theDataBase
,
aDataBase
,
NDB_MAX_DATABASE_NAME_SIZE
);
else
memset
(
theDataBase
,
0
,
sizeof
(
theDataBase
));
strncpy
(
theDataBaseSchema
,
aDataBaseSchema
,
NDB_MAX_SCHEMA_NAME_SIZE
);
// Prepare prefix for faster operations
uint
db_len
=
MIN
(
strlen
(
theDataBase
),
NDB_MAX_DATABASE_NAME_SIZE
-
1
);
uint
schema_len
=
MIN
(
strlen
(
theDataBaseSchema
),
NDB_MAX_SCHEMA_NAME_SIZE
-
1
);
strncpy
(
prefixName
,
theDataBase
,
NDB_MAX_DATABASE_NAME_SIZE
-
1
);
prefixName
[
db_len
]
=
table_name_separator
;
strncpy
(
prefixName
+
db_len
+
1
,
theDataBaseSchema
,
NDB_MAX_SCHEMA_NAME_SIZE
-
1
);
prefixName
[
db_len
+
schema_len
+
1
]
=
table_name_separator
;
prefixName
[
db_len
+
schema_len
+
2
]
=
'\0'
;
prefixEnd
=
prefixName
+
db_len
+
schema_len
+
2
;
snprintf
(
theDataBase
,
sizeof
(
theDataBase
),
"%s"
,
aDataBase
?
aDataBase
:
""
);
snprintf
(
theDataBaseSchema
,
sizeof
(
theDataBaseSchema
),
"%s"
,
aSchema
?
aSchema
:
""
);
int
len
=
snprintf
(
prefixName
,
sizeof
(
prefixName
),
"%s%c%s%c"
,
theDataBase
,
table_name_separator
,
theDataBaseSchema
,
table_name_separator
);
prefixEnd
=
prefixName
+
(
len
<
sizeof
(
prefixName
)
?
len
:
sizeof
(
prefixName
)
-
1
);
NdbMutex_Lock
(
&
createNdbMutex
);
...
...
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