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
f2ad519e
Commit
f2ad519e
authored
Mar 09, 2006
by
mskold@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug#18040: Create unique index cause error 4243
parent
a111db40
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+6
-4
sql/ha_ndbcluster.h
sql/ha_ndbcluster.h
+2
-1
No files found.
sql/ha_ndbcluster.cc
View file @
f2ad519e
...
...
@@ -1368,15 +1368,17 @@ int ha_ndbcluster::drop_indexes(Ndb *ndb, TABLE *tab)
*/
NDB_INDEX_TYPE
ha_ndbcluster
::
get_index_type_from_table
(
uint
inx
)
const
{
return
get_index_type_from_key
(
inx
,
table_share
->
key_info
);
return
get_index_type_from_key
(
inx
,
table_share
->
key_info
,
inx
==
table_share
->
primary_key
);
}
NDB_INDEX_TYPE
ha_ndbcluster
::
get_index_type_from_key
(
uint
inx
,
KEY
*
key_info
)
const
KEY
*
key_info
,
bool
primary
)
const
{
bool
is_hash_index
=
(
key_info
[
inx
].
algorithm
==
HA_KEY_ALG_HASH
);
if
(
inx
==
table_share
->
primary_ke
y
)
if
(
primar
y
)
return
is_hash_index
?
PRIMARY_KEY_INDEX
:
PRIMARY_KEY_ORDERED_INDEX
;
return
((
key_info
[
inx
].
flags
&
HA_NOSAME
)
?
...
...
@@ -4645,7 +4647,7 @@ int ha_ndbcluster::add_index(TABLE *table_arg,
KEY
*
key
=
key_info
+
idx
;
KEY_PART_INFO
*
key_part
=
key
->
key_part
;
KEY_PART_INFO
*
end
=
key_part
+
key
->
key_parts
;
NDB_INDEX_TYPE
idx_type
=
get_index_type_from_key
(
idx
,
key
);
NDB_INDEX_TYPE
idx_type
=
get_index_type_from_key
(
idx
,
key
,
false
);
DBUG_PRINT
(
"info"
,
(
"Adding index: '%s'"
,
key_info
[
idx
].
name
));
// Add fields to key_part struct
for
(;
key_part
!=
end
;
key_part
++
)
...
...
sql/ha_ndbcluster.h
View file @
f2ad519e
...
...
@@ -722,7 +722,8 @@ private:
void
release_metadata
();
NDB_INDEX_TYPE
get_index_type
(
uint
idx_no
)
const
;
NDB_INDEX_TYPE
get_index_type_from_table
(
uint
index_no
)
const
;
NDB_INDEX_TYPE
get_index_type_from_key
(
uint
index_no
,
KEY
*
key_info
)
const
;
NDB_INDEX_TYPE
get_index_type_from_key
(
uint
index_no
,
KEY
*
key_info
,
bool
primary
)
const
;
int
check_index_fields_not_null
(
uint
index_no
);
uint
set_up_partition_info
(
partition_info
*
part_info
,
...
...
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