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
08312bfb
Commit
08312bfb
authored
Sep 20, 2004
by
magnus@neptunus.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge changes
parent
2a344c0b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
30 deletions
+11
-30
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+11
-30
No files found.
sql/ha_ndbcluster.cc
View file @
08312bfb
...
@@ -32,8 +32,6 @@
...
@@ -32,8 +32,6 @@
#include <ndbapi/NdbApi.hpp>
#include <ndbapi/NdbApi.hpp>
#include <ndbapi/NdbScanFilter.hpp>
#include <ndbapi/NdbScanFilter.hpp>
//#define USE_NDB_POOL
// Default value for parallelism
// Default value for parallelism
static
const
int
parallelism
=
240
;
static
const
int
parallelism
=
240
;
...
@@ -125,6 +123,8 @@ static const err_code_mapping err_map[]=
...
@@ -125,6 +123,8 @@ static const err_code_mapping err_map[]=
{
827
,
HA_ERR_RECORD_FILE_FULL
},
{
827
,
HA_ERR_RECORD_FILE_FULL
},
{
832
,
HA_ERR_RECORD_FILE_FULL
},
{
832
,
HA_ERR_RECORD_FILE_FULL
},
{
0
,
1
},
{
-
1
,
-
1
}
{
-
1
,
-
1
}
};
};
...
@@ -3536,13 +3536,7 @@ Thd_ndb* ha_ndbcluster::seize_thd_ndb()
...
@@ -3536,13 +3536,7 @@ Thd_ndb* ha_ndbcluster::seize_thd_ndb()
Thd_ndb
*
thd_ndb
;
Thd_ndb
*
thd_ndb
;
DBUG_ENTER
(
"seize_thd_ndb"
);
DBUG_ENTER
(
"seize_thd_ndb"
);
#ifdef USE_NDB_POOL
// Seize from pool
ndb
=
Ndb
::
seize
();
xxxxxxxxxxxxxx
error
#else
thd_ndb
=
new
Thd_ndb
();
thd_ndb
=
new
Thd_ndb
();
#endif
thd_ndb
->
ndb
->
getDictionary
()
->
set_local_table_data_size
(
sizeof
(
Ndb_table_local_info
));
thd_ndb
->
ndb
->
getDictionary
()
->
set_local_table_data_size
(
sizeof
(
Ndb_table_local_info
));
if
(
thd_ndb
->
ndb
->
init
(
max_transactions
)
!=
0
)
if
(
thd_ndb
->
ndb
->
init
(
max_transactions
)
!=
0
)
{
{
...
@@ -3563,56 +3557,45 @@ Thd_ndb* ha_ndbcluster::seize_thd_ndb()
...
@@ -3563,56 +3557,45 @@ Thd_ndb* ha_ndbcluster::seize_thd_ndb()
void
ha_ndbcluster
::
release_thd_ndb
(
Thd_ndb
*
thd_ndb
)
void
ha_ndbcluster
::
release_thd_ndb
(
Thd_ndb
*
thd_ndb
)
{
{
DBUG_ENTER
(
"release_thd_ndb"
);
DBUG_ENTER
(
"release_thd_ndb"
);
#ifdef USE_NDB_POOL
// Release to pool
Ndb
::
release
(
ndb
);
xxxxxxxxxxxx
error
#else
delete
thd_ndb
;
delete
thd_ndb
;
#endif
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
}
}
/*
/*
If this thread already has a
N
db object allocated
If this thread already has a
Thd_n
db object allocated
in current THD, reuse it. Otherwise
in current THD, reuse it. Otherwise
seize a Ndb object, assign it to current THD and use it.
seize a Thd_ndb object, assign it to current THD and use it.
Having a Ndb object also means that a connection to
NDB cluster has been opened.
*/
*/
Ndb
*
check_ndb_in_thd
(
THD
*
thd
)
Ndb
*
check_ndb_in_thd
(
THD
*
thd
)
{
{
DBUG_ENTER
(
"check_ndb_in_thd"
);
DBUG_ENTER
(
"check_ndb_in_thd"
);
THD
*
thd
=
current_thd
;
Thd_ndb
*
thd_ndb
=
(
Thd_ndb
*
)
thd
->
transaction
.
thd_ndb
;
Thd_ndb
*
thd_ndb
=
(
Thd_ndb
*
)
thd
->
transaction
.
thd_ndb
;
if
(
!
thd_ndb
)
if
(
!
thd_ndb
)
{
{
thd_ndb
=
seize_thd_ndb
();
if
(
!
(
thd_ndb
=
ha_ndbcluster
::
seize_thd_ndb
()))
if
(
!
thd_ndb
)
DBUG_RETURN
(
NULL
);
DBUG_RETURN
(
NULL
);
thd
->
transaction
.
thd_ndb
=
thd_ndb
;
thd
->
transaction
.
thd_ndb
=
thd_ndb
;
}
}
DBUG_RETURN
(
ndb
);
DBUG_RETURN
(
thd_ndb
->
ndb
);
}
}
int
ha_ndbcluster
::
check_ndb_connection
()
int
ha_ndbcluster
::
check_ndb_connection
()
{
{
THD
*
thd
=
current_thd
;
THD
*
thd
=
current_thd
;
Ndb
*
ndb
;
DBUG_ENTER
(
"check_ndb_connection"
);
DBUG_ENTER
(
"check_ndb_connection"
);
if
(
!
(
ndb
=
check_ndb_in_thd
(
thd
)))
if
(
!
(
m_
ndb
=
check_ndb_in_thd
(
thd
)))
DBUG_RETURN
(
HA_ERR_NO_CONNECTION
);
DBUG_RETURN
(
HA_ERR_NO_CONNECTION
);
m_ndb
=
thd_ndb
->
ndb
;
m_ndb
->
setDatabaseName
(
m_dbname
);
m_ndb
->
setDatabaseName
(
m_dbname
);
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
}
}
void
ndbcluster_close_connection
(
THD
*
thd
)
void
ndbcluster_close_connection
(
THD
*
thd
)
{
{
Thd_ndb
*
thd_ndb
=
(
Thd_ndb
*
)
thd
->
transaction
.
thd_ndb
;
Thd_ndb
*
thd_ndb
=
(
Thd_ndb
*
)
thd
->
transaction
.
thd_ndb
;
...
@@ -3638,7 +3621,6 @@ int ndbcluster_discover(THD* thd, const char *db, const char *name,
...
@@ -3638,7 +3621,6 @@ int ndbcluster_discover(THD* thd, const char *db, const char *name,
const
NDBTAB
*
tab
;
const
NDBTAB
*
tab
;
Ndb
*
ndb
;
Ndb
*
ndb
;
DBUG_ENTER
(
"ndbcluster_discover"
);
DBUG_ENTER
(
"ndbcluster_discover"
);
ndb
.
getDictionary
()
->
set_local_table_data_size
(
sizeof
(
Ndb_table_local_info
));
DBUG_PRINT
(
"enter"
,
(
"db: %s, name: %s"
,
db
,
name
));
DBUG_PRINT
(
"enter"
,
(
"db: %s, name: %s"
,
db
,
name
));
if
(
!
(
ndb
=
check_ndb_in_thd
(
thd
)))
if
(
!
(
ndb
=
check_ndb_in_thd
(
thd
)))
...
@@ -3646,6 +3628,7 @@ int ndbcluster_discover(THD* thd, const char *db, const char *name,
...
@@ -3646,6 +3628,7 @@ int ndbcluster_discover(THD* thd, const char *db, const char *name,
ndb
->
setDatabaseName
(
db
);
ndb
->
setDatabaseName
(
db
);
NDBDICT
*
dict
=
ndb
->
getDictionary
();
NDBDICT
*
dict
=
ndb
->
getDictionary
();
dict
->
set_local_table_data_size
(
sizeof
(
Ndb_table_local_info
));
dict
->
invalidateTable
(
name
);
dict
->
invalidateTable
(
name
);
if
(
!
(
tab
=
dict
->
getTable
(
name
)))
if
(
!
(
tab
=
dict
->
getTable
(
name
)))
{
{
...
@@ -3701,6 +3684,7 @@ int ndbcluster_table_exists(THD* thd, const char *db, const char *name)
...
@@ -3701,6 +3684,7 @@ int ndbcluster_table_exists(THD* thd, const char *db, const char *name)
ndb
->
setDatabaseName
(
db
);
ndb
->
setDatabaseName
(
db
);
NDBDICT
*
dict
=
ndb
->
getDictionary
();
NDBDICT
*
dict
=
ndb
->
getDictionary
();
dict
->
set_local_table_data_size
(
sizeof
(
Ndb_table_local_info
));
dict
->
invalidateTable
(
name
);
dict
->
invalidateTable
(
name
);
if
(
!
(
tab
=
dict
->
getTable
(
name
)))
if
(
!
(
tab
=
dict
->
getTable
(
name
)))
{
{
...
@@ -3821,9 +3805,6 @@ bool ndbcluster_end()
...
@@ -3821,9 +3805,6 @@ bool ndbcluster_end()
if
(
!
ndbcluster_inited
)
if
(
!
ndbcluster_inited
)
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
hash_free
(
&
ndbcluster_open_tables
);
hash_free
(
&
ndbcluster_open_tables
);
#ifdef USE_NDB_POOL
ndb_pool_release
();
#endif
pthread_mutex_destroy
(
&
ndbcluster_mutex
);
pthread_mutex_destroy
(
&
ndbcluster_mutex
);
ndbcluster_inited
=
0
;
ndbcluster_inited
=
0
;
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
...
...
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