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
8cec2f3e
Commit
8cec2f3e
authored
May 03, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge april.(none):/home/svoj/devel/mysql/BUG18160/mysql-5.0
into april.(none):/home/svoj/devel/mysql/BUG17810/mysql-5.0
parents
aa4ad136
4441e34e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
6 deletions
+26
-6
heap/hp_delete.c
heap/hp_delete.c
+2
-1
include/my_tree.h
include/my_tree.h
+1
-1
myisam/myisamlog.c
myisam/myisamlog.c
+1
-1
mysql-test/r/heap_btree.result
mysql-test/r/heap_btree.result
+10
-0
mysql-test/t/heap_btree.test
mysql-test/t/heap_btree.test
+10
-0
mysys/tree.c
mysys/tree.c
+2
-3
No files found.
heap/hp_delete.c
View file @
8cec2f3e
...
...
@@ -79,7 +79,8 @@ int hp_rb_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo,
custom_arg
.
key_length
=
hp_rb_make_key
(
keyinfo
,
info
->
recbuf
,
record
,
recpos
);
custom_arg
.
search_flag
=
SEARCH_SAME
;
old_allocated
=
keyinfo
->
rb_tree
.
allocated
;
res
=
tree_delete
(
&
keyinfo
->
rb_tree
,
info
->
recbuf
,
&
custom_arg
);
res
=
tree_delete
(
&
keyinfo
->
rb_tree
,
info
->
recbuf
,
custom_arg
.
key_length
,
&
custom_arg
);
info
->
s
->
index_length
-=
(
old_allocated
-
keyinfo
->
rb_tree
.
allocated
);
return
res
;
}
...
...
include/my_tree.h
View file @
8cec2f3e
...
...
@@ -84,7 +84,7 @@ TREE_ELEMENT *tree_insert(TREE *tree,void *key, uint key_size,
void
*
tree_search
(
TREE
*
tree
,
void
*
key
,
void
*
custom_arg
);
int
tree_walk
(
TREE
*
tree
,
tree_walk_action
action
,
void
*
argument
,
TREE_WALK
visit
);
int
tree_delete
(
TREE
*
tree
,
void
*
key
,
void
*
custom_arg
);
int
tree_delete
(
TREE
*
tree
,
void
*
key
,
uint
key_size
,
void
*
custom_arg
);
void
*
tree_search_key
(
TREE
*
tree
,
const
void
*
key
,
TREE_ELEMENT
**
parents
,
TREE_ELEMENT
***
last_pos
,
enum
ha_rkey_function
flag
,
void
*
custom_arg
);
...
...
myisam/myisamlog.c
View file @
8cec2f3e
...
...
@@ -475,7 +475,7 @@ static int examine_log(my_string file_name, char **table_names)
{
if
(
!
curr_file_info
->
closed
)
files_open
--
;
VOID
(
tree_delete
(
&
tree
,
(
gptr
)
curr_file_info
,
tree
.
custom_arg
));
VOID
(
tree_delete
(
&
tree
,
(
gptr
)
curr_file_info
,
0
,
tree
.
custom_arg
));
}
break
;
case
MI_LOG_EXTRA
:
...
...
mysql-test/r/heap_btree.result
View file @
8cec2f3e
...
...
@@ -246,3 +246,13 @@ DELETE from t1 where a < 100;
SELECT * from t1;
a
DROP TABLE t1;
CREATE TABLE t1(val INT, KEY USING BTREE(val)) ENGINE=memory;
INSERT INTO t1 VALUES(0);
SELECT INDEX_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME='t1';
INDEX_LENGTH
21
UPDATE t1 SET val=1;
SELECT INDEX_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME='t1';
INDEX_LENGTH
21
DROP TABLE t1;
mysql-test/t/heap_btree.test
View file @
8cec2f3e
...
...
@@ -164,4 +164,14 @@ DELETE from t1 where a < 100;
SELECT
*
from
t1
;
DROP
TABLE
t1
;
#
# BUG#18160 - Memory-/HEAP Table endless growing indexes
#
CREATE
TABLE
t1
(
val
INT
,
KEY
USING
BTREE
(
val
))
ENGINE
=
memory
;
INSERT
INTO
t1
VALUES
(
0
);
SELECT
INDEX_LENGTH
FROM
INFORMATION_SCHEMA
.
TABLES
WHERE
TABLE_SCHEMA
=
DATABASE
()
AND
TABLE_NAME
=
't1'
;
UPDATE
t1
SET
val
=
1
;
SELECT
INDEX_LENGTH
FROM
INFORMATION_SCHEMA
.
TABLES
WHERE
TABLE_SCHEMA
=
DATABASE
()
AND
TABLE_NAME
=
't1'
;
DROP
TABLE
t1
;
# End of 4.1 tests
mysys/tree.c
View file @
8cec2f3e
...
...
@@ -271,7 +271,7 @@ TREE_ELEMENT *tree_insert(TREE *tree, void *key, uint key_size,
return
element
;
}
int
tree_delete
(
TREE
*
tree
,
void
*
key
,
void
*
custom_arg
)
int
tree_delete
(
TREE
*
tree
,
void
*
key
,
uint
key_size
,
void
*
custom_arg
)
{
int
cmp
,
remove_colour
;
TREE_ELEMENT
*
element
,
***
parent
,
***
org_parent
,
*
nod
;
...
...
@@ -326,8 +326,7 @@ int tree_delete(TREE *tree, void *key, void *custom_arg)
rb_delete_fixup
(
tree
,
parent
);
if
(
tree
->
free
)
(
*
tree
->
free
)(
ELEMENT_KEY
(
tree
,
element
),
free_free
,
tree
->
custom_arg
);
/* This doesn't include key_size, but better than nothing */
tree
->
allocated
-=
sizeof
(
TREE_ELEMENT
)
+
tree
->
size_of_element
;
tree
->
allocated
-=
sizeof
(
TREE_ELEMENT
)
+
tree
->
size_of_element
+
key_size
;
my_free
((
gptr
)
element
,
MYF
(
0
));
tree
->
elements_in_tree
--
;
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