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
032a4a92
Commit
032a4a92
authored
Oct 03, 2002
by
ram@mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Additional key segment (HA_KEYTYPE_END) creation has been moved from handler to hp_create.c
parent
43a506c0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
20 deletions
+12
-20
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+1
-0
heap/hp_create.c
heap/hp_create.c
+11
-7
sql/ha_heap.cc
sql/ha_heap.cc
+0
-13
No files found.
BitKeeper/etc/logging_ok
View file @
032a4a92
...
@@ -74,3 +74,4 @@ WAX@sergbook.mysql.com
...
@@ -74,3 +74,4 @@ WAX@sergbook.mysql.com
bar@bar.udmsearch.izhnet.ru
bar@bar.udmsearch.izhnet.ru
nick@mysql.com
nick@mysql.com
bar@bar.mysql.r18.ru
bar@bar.mysql.r18.ru
ram@mysql.r18.ru
heap/hp_create.c
View file @
032a4a92
...
@@ -85,15 +85,24 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
...
@@ -85,15 +85,24 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
memcpy
(
share
->
keydef
,
keydef
,
(
size_t
)
(
sizeof
(
keydef
[
0
])
*
keys
));
memcpy
(
share
->
keydef
,
keydef
,
(
size_t
)
(
sizeof
(
keydef
[
0
])
*
keys
));
for
(
i
=
0
,
keyinfo
=
share
->
keydef
;
i
<
keys
;
i
++
,
keyinfo
++
)
for
(
i
=
0
,
keyinfo
=
share
->
keydef
;
i
<
keys
;
i
++
,
keyinfo
++
)
{
{
uint
nsegs
=
keydef
[
i
].
keysegs
;
keyinfo
->
seg
=
keyseg
;
memcpy
(
keyseg
,
keydef
[
i
].
seg
,
(
size_t
)
(
sizeof
(
keyseg
[
0
])
*
keydef
[
i
].
keysegs
));
keyseg
+=
keydef
[
i
].
keysegs
;
if
(
keydef
[
i
].
algorithm
==
HA_KEY_ALG_BTREE
)
if
(
keydef
[
i
].
algorithm
==
HA_KEY_ALG_BTREE
)
{
{
/* additional HA_KEYTYPE_END keyseg */
keyseg
->
type
=
HA_KEYTYPE_END
;
keyseg
->
length
=
sizeof
(
byte
*
);
keyseg
->
flag
=
0
;
keyseg
->
null_bit
=
0
;
keyseg
++
;
init_tree
(
&
keyinfo
->
rb_tree
,
0
,
0
,
sizeof
(
byte
*
),
init_tree
(
&
keyinfo
->
rb_tree
,
0
,
0
,
sizeof
(
byte
*
),
(
qsort_cmp2
)
keys_compare
,
1
,
NULL
,
NULL
);
(
qsort_cmp2
)
keys_compare
,
1
,
NULL
,
NULL
);
keyinfo
->
delete_key
=
hp_rb_delete_key
;
keyinfo
->
delete_key
=
hp_rb_delete_key
;
keyinfo
->
write_key
=
hp_rb_write_key
;
keyinfo
->
write_key
=
hp_rb_write_key
;
nsegs
++
;
}
}
else
else
{
{
...
@@ -102,12 +111,7 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
...
@@ -102,12 +111,7 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
keyinfo
->
delete_key
=
hp_delete_key
;
keyinfo
->
delete_key
=
hp_delete_key
;
keyinfo
->
write_key
=
hp_write_key
;
keyinfo
->
write_key
=
hp_write_key
;
}
}
keyinfo
->
seg
=
keyseg
;
memcpy
(
keyseg
,
keydef
[
i
].
seg
,
(
size_t
)
(
sizeof
(
keyseg
[
0
])
*
nsegs
));
keyseg
+=
nsegs
;
}
}
share
->
min_records
=
min_records
;
share
->
min_records
=
min_records
;
share
->
max_records
=
max_records
;
share
->
max_records
=
max_records
;
share
->
data_length
=
share
->
index_length
=
0
;
share
->
data_length
=
share
->
index_length
=
0
;
...
...
sql/ha_heap.cc
View file @
032a4a92
...
@@ -243,11 +243,7 @@ int ha_heap::create(const char *name, TABLE *table, HA_CREATE_INFO *create_info)
...
@@ -243,11 +243,7 @@ int ha_heap::create(const char *name, TABLE *table, HA_CREATE_INFO *create_info)
int
error
;
int
error
;
for
(
key
=
parts
=
0
;
key
<
table
->
keys
;
key
++
)
for
(
key
=
parts
=
0
;
key
<
table
->
keys
;
key
++
)
{
parts
+=
table
->
key_info
[
key
].
key_parts
;
parts
+=
table
->
key_info
[
key
].
key_parts
;
if
(
table
->
key_info
[
key
].
algorithm
==
HA_KEY_ALG_BTREE
)
parts
++
;
/* additional HA_KEYTYPE_END keyseg */
}
if
(
!
(
keydef
=
(
HP_KEYDEF
*
)
my_malloc
(
table
->
keys
*
sizeof
(
HP_KEYDEF
)
+
if
(
!
(
keydef
=
(
HP_KEYDEF
*
)
my_malloc
(
table
->
keys
*
sizeof
(
HP_KEYDEF
)
+
parts
*
sizeof
(
HA_KEYSEG
),
MYF
(
MY_WME
))))
parts
*
sizeof
(
HA_KEYSEG
),
MYF
(
MY_WME
))))
...
@@ -299,15 +295,6 @@ int ha_heap::create(const char *name, TABLE *table, HA_CREATE_INFO *create_info)
...
@@ -299,15 +295,6 @@ int ha_heap::create(const char *name, TABLE *table, HA_CREATE_INFO *create_info)
seg
->
null_pos
=
0
;
seg
->
null_pos
=
0
;
}
}
}
}
if
(
pos
->
algorithm
==
HA_KEY_ALG_BTREE
)
{
/* additional HA_KEYTYPE_END keyseg */
seg
->
type
=
HA_KEYTYPE_END
;
seg
->
length
=
sizeof
(
byte
*
);
seg
->
flag
=
0
;
seg
->
null_bit
=
0
;
seg
++
;
}
}
}
mem_per_row
+=
MY_ALIGN
(
table
->
reclength
+
1
,
sizeof
(
char
*
));
mem_per_row
+=
MY_ALIGN
(
table
->
reclength
+
1
,
sizeof
(
char
*
));
max_rows
=
(
ulong
)
(
max_heap_table_size
/
mem_per_row
);
max_rows
=
(
ulong
)
(
max_heap_table_size
/
mem_per_row
);
...
...
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