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
0933607b
Commit
0933607b
authored
May 04, 2006
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb:
stilled small memleak + changed clear/init indexes code a litter
parent
a0c1806d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
28 deletions
+24
-28
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+24
-26
sql/ha_ndbcluster.h
sql/ha_ndbcluster.h
+0
-2
No files found.
sql/ha_ndbcluster.cc
View file @
0933607b
...
...
@@ -1061,22 +1061,30 @@ int ha_ndbcluster::create_indexes(Ndb *ndb, TABLE *tab)
DBUG_RETURN
(
error
);
}
void
ha_ndbcluster
::
clear_index
(
int
i
)
static
void
ndb_init_index
(
NDB_INDEX_DATA
&
data
)
{
m_index
[
i
]
.
type
=
UNDEFINED_INDEX
;
m_index
[
i
]
.
status
=
UNDEFINED
;
m_index
[
i
]
.
unique_index
=
NULL
;
m_index
[
i
]
.
index
=
NULL
;
m_index
[
i
]
.
unique_index_attrid_map
=
NULL
;
m_index
[
i
]
.
index_stat
=
NULL
;
m_index
[
i
]
.
index_stat_cache_entries
=
0
;
m_index
[
i
]
.
index_stat_update_freq
=
0
;
m_index
[
i
]
.
index_stat_query_count
=
0
;
data
.
type
=
UNDEFINED_INDEX
;
data
.
status
=
UNDEFINED
;
data
.
unique_index
=
NULL
;
data
.
index
=
NULL
;
data
.
unique_index_attrid_map
=
NULL
;
data
.
index_stat
=
NULL
;
data
.
index_stat_cache_entries
=
0
;
data
.
index_stat_update_freq
=
0
;
data
.
index_stat_query_count
=
0
;
}
void
ha_ndbcluster
::
clear_indexes
(
)
static
void
ndb_clear_index
(
NDB_INDEX_DATA
&
data
)
{
for
(
int
i
=
0
;
i
<
MAX_KEY
;
i
++
)
clear_index
(
i
);
if
(
data
.
unique_index_attrid_map
)
{
my_free
((
char
*
)
data
.
unique_index_attrid_map
,
MYF
(
0
));
}
if
(
data
.
index_stat
)
{
delete
data
.
index_stat
;
}
ndb_init_index
(
data
);
}
/*
...
...
@@ -1295,7 +1303,7 @@ int ha_ndbcluster::drop_indexes(Ndb *ndb, TABLE *tab)
}
if
(
error
)
DBUG_RETURN
(
error
);
clear_index
(
i
);
ndb_clear_index
(
m_index
[
i
]
);
continue
;
}
}
...
...
@@ -1378,24 +1386,13 @@ void ha_ndbcluster::release_metadata(THD *thd, Ndb *ndb)
{
DBUG_ASSERT
(
m_table
!=
NULL
);
dict
->
removeIndexGlobal
(
*
m_index
[
i
].
unique_index
,
invalidate_indexes
);
m_index
[
i
].
unique_index
=
NULL
;
}
if
(
m_index
[
i
].
index
)
{
DBUG_ASSERT
(
m_table
!=
NULL
);
dict
->
removeIndexGlobal
(
*
m_index
[
i
].
index
,
invalidate_indexes
);
m_index
[
i
].
index
=
NULL
;
}
if
(
m_index
[
i
].
unique_index_attrid_map
)
{
my_free
((
char
*
)
m_index
[
i
].
unique_index_attrid_map
,
MYF
(
0
));
m_index
[
i
].
unique_index_attrid_map
=
NULL
;
}
if
(
m_index
[
i
].
index_stat
)
{
delete
m_index
[
i
].
index_stat
;
m_index
[
i
].
index_stat
=
NULL
;
}
ndb_clear_index
(
m_index
[
i
]);
}
m_table
=
NULL
;
...
...
@@ -5295,7 +5292,8 @@ ha_ndbcluster::ha_ndbcluster(TABLE_SHARE *table_arg):
records
=
~
(
ha_rows
)
0
;
// uninitialized
block_size
=
1024
;
clear_indexes
();
for
(
i
=
0
;
i
<
MAX_KEY
;
i
++
)
ndb_init_index
(
m_index
[
i
]);
DBUG_VOID_RETURN
;
}
...
...
sql/ha_ndbcluster.h
View file @
0933607b
...
...
@@ -720,8 +720,6 @@ static void set_tabname(const char *pathname, char *tabname);
NDB_INDEX_TYPE
idx_type
,
uint
idx_no
);
// Index list management
int
create_indexes
(
Ndb
*
ndb
,
TABLE
*
tab
);
void
clear_index
(
int
i
);
void
clear_indexes
();
int
open_indexes
(
Ndb
*
ndb
,
TABLE
*
tab
,
bool
ignore_error
);
void
renumber_indexes
(
Ndb
*
ndb
,
TABLE
*
tab
);
int
drop_indexes
(
Ndb
*
ndb
,
TABLE
*
tab
);
...
...
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