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
7d6860a7
Commit
7d6860a7
authored
Sep 20, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for calculating index cadinality
parent
ca65afeb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
4 deletions
+22
-4
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+21
-4
sql/ha_ndbcluster.h
sql/ha_ndbcluster.h
+1
-0
No files found.
sql/ha_ndbcluster.cc
View file @
7d6860a7
...
@@ -166,9 +166,19 @@ struct Ndb_table_local_info {
...
@@ -166,9 +166,19 @@ struct Ndb_table_local_info {
ha_rows
records
;
ha_rows
records
;
};
};
void
ha_ndbcluster
::
set_rec_per_key
()
{
DBUG_ENTER
(
"ha_ndbcluster::get_status_const"
);
for
(
uint
i
=
0
;
i
<
table
->
keys
;
i
++
)
{
table
->
key_info
[
i
].
rec_per_key
[
table
->
key_info
[
i
].
key_parts
-
1
]
=
1
;
}
DBUG_VOID_RETURN
;
}
void
ha_ndbcluster
::
records_update
()
void
ha_ndbcluster
::
records_update
()
{
{
DBUG_ENTER
(
"ha_ndbcluster::
records_updat
e"
);
DBUG_ENTER
(
"ha_ndbcluster::
get_status_variabl
e"
);
struct
Ndb_table_local_info
*
info
=
(
struct
Ndb_table_local_info
*
)
m_table_info
;
struct
Ndb_table_local_info
*
info
=
(
struct
Ndb_table_local_info
*
)
m_table_info
;
DBUG_PRINT
(
"info"
,
(
"id=%d, no_uncommitted_rows_count=%d"
,
DBUG_PRINT
(
"info"
,
(
"id=%d, no_uncommitted_rows_count=%d"
,
((
const
NDBTAB
*
)
m_table
)
->
getTableId
(),
((
const
NDBTAB
*
)
m_table
)
->
getTableId
(),
...
@@ -2380,13 +2390,16 @@ void ha_ndbcluster::info(uint flag)
...
@@ -2380,13 +2390,16 @@ void ha_ndbcluster::info(uint flag)
DBUG_PRINT
(
"info"
,
(
"HA_STATUS_NO_LOCK"
));
DBUG_PRINT
(
"info"
,
(
"HA_STATUS_NO_LOCK"
));
if
(
flag
&
HA_STATUS_TIME
)
if
(
flag
&
HA_STATUS_TIME
)
DBUG_PRINT
(
"info"
,
(
"HA_STATUS_TIME"
));
DBUG_PRINT
(
"info"
,
(
"HA_STATUS_TIME"
));
if
(
flag
&
HA_STATUS_CONST
)
DBUG_PRINT
(
"info"
,
(
"HA_STATUS_CONST"
));
if
(
flag
&
HA_STATUS_VARIABLE
)
if
(
flag
&
HA_STATUS_VARIABLE
)
{
{
DBUG_PRINT
(
"info"
,
(
"HA_STATUS_VARIABLE"
));
DBUG_PRINT
(
"info"
,
(
"HA_STATUS_VARIABLE"
));
records_update
();
records_update
();
}
}
if
(
flag
&
HA_STATUS_CONST
)
{
DBUG_PRINT
(
"info"
,
(
"HA_STATUS_CONST"
));
set_rec_per_key
();
}
if
(
flag
&
HA_STATUS_ERRKEY
)
if
(
flag
&
HA_STATUS_ERRKEY
)
{
{
DBUG_PRINT
(
"info"
,
(
"HA_STATUS_ERRKEY"
));
DBUG_PRINT
(
"info"
,
(
"HA_STATUS_ERRKEY"
));
...
@@ -3432,6 +3445,7 @@ ha_ndbcluster::~ha_ndbcluster()
...
@@ -3432,6 +3445,7 @@ ha_ndbcluster::~ha_ndbcluster()
int
ha_ndbcluster
::
open
(
const
char
*
name
,
int
mode
,
uint
test_if_locked
)
int
ha_ndbcluster
::
open
(
const
char
*
name
,
int
mode
,
uint
test_if_locked
)
{
{
int
res
;
KEY
*
key
;
KEY
*
key
;
DBUG_ENTER
(
"open"
);
DBUG_ENTER
(
"open"
);
DBUG_PRINT
(
"enter"
,
(
"name: %s mode: %d test_if_locked: %d"
,
DBUG_PRINT
(
"enter"
,
(
"name: %s mode: %d test_if_locked: %d"
,
...
@@ -3458,8 +3472,11 @@ int ha_ndbcluster::open(const char *name, int mode, uint test_if_locked)
...
@@ -3458,8 +3472,11 @@ int ha_ndbcluster::open(const char *name, int mode, uint test_if_locked)
free_share
(
m_share
);
m_share
=
0
;
free_share
(
m_share
);
m_share
=
0
;
DBUG_RETURN
(
HA_ERR_NO_CONNECTION
);
DBUG_RETURN
(
HA_ERR_NO_CONNECTION
);
}
}
res
=
get_metadata
(
name
);
if
(
!
res
)
info
(
HA_STATUS_VARIABLE
|
HA_STATUS_CONST
);
DBUG_RETURN
(
get_metadata
(
name
)
);
DBUG_RETURN
(
res
);
}
}
...
...
sql/ha_ndbcluster.h
View file @
7d6860a7
...
@@ -258,6 +258,7 @@ class ha_ndbcluster: public handler
...
@@ -258,6 +258,7 @@ class ha_ndbcluster: public handler
uint32
blobs_buffer_size
;
uint32
blobs_buffer_size
;
uint
dupkey
;
uint
dupkey
;
void
set_rec_per_key
();
void
records_update
();
void
records_update
();
void
no_uncommitted_rows_execute_failure
();
void
no_uncommitted_rows_execute_failure
();
void
no_uncommitted_rows_update
(
int
);
void
no_uncommitted_rows_update
(
int
);
...
...
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