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
db4a8602
Commit
db4a8602
authored
Jul 10, 2001
by
serg@serg.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanups
parent
1e6fe8f1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
36 deletions
+53
-36
myisam/mi_write.c
myisam/mi_write.c
+23
-10
mysys/tree.c
mysys/tree.c
+29
-25
sql/sql_show.cc
sql/sql_show.cc
+1
-1
No files found.
myisam/mi_write.c
View file @
db4a8602
...
...
@@ -765,34 +765,47 @@ int _mi_init_bulk_insert(MI_INFO *info)
MYISAM_SHARE
*
share
=
info
->
s
;
MI_KEYDEF
*
key
=
share
->
keyinfo
;
bulk_insert_param
*
params
;
uint
i
;
uint
i
,
num_keys
;
ulonglong
key_map
=
0
;
if
(
info
->
bulk_insert
)
return
0
;
for
(
i
=
num_keys
=
0
;
i
<
share
->
base
.
keys
;
i
++
)
{
if
(
!
(
key
[
i
].
flag
&
HA_NOSAME
)
&&
share
->
base
.
auto_key
!=
i
+
1
&&
test
(
share
->
state
.
key_map
&
((
ulonglong
)
1
<<
i
)))
{
num_keys
++
;
key_map
|=
((
ulonglong
)
1
<<
i
);
}
}
if
(
!
num_keys
)
return
0
;
info
->
bulk_insert
=
(
TREE
*
)
my_malloc
((
sizeof
(
TREE
)
+
sizeof
(
bulk_insert_param
))
*
share
->
base
.
keys
,
MYF
(
0
));
my_malloc
((
sizeof
(
TREE
)
*
share
->
base
.
keys
+
sizeof
(
bulk_insert_param
)
*
num_keys
),
MYF
(
0
));
if
(
!
info
->
bulk_insert
)
return
HA_ERR_OUT_OF_MEM
;
params
=
(
bulk_insert_param
*
)(
info
->
bulk_insert
+
share
->
base
.
keys
);
for
(
i
=
0
;
i
<
share
->
base
.
keys
;
i
++
,
key
++
,
params
++
)
for
(
i
=
0
;
i
<
share
->
base
.
keys
;
i
++
,
key
++
)
{
params
->
info
=
info
;
params
->
keynr
=
i
;
if
(
!
(
key
->
flag
&
HA_NOSAME
)
&&
share
->
base
.
auto_key
!=
i
+
1
&&
test
(
share
->
state
.
key_map
&
((
ulonglong
)
1
<<
i
)))
if
(
test
(
key_map
&
((
ulonglong
)
1
<<
i
)))
{
init_tree
(
&
info
->
bulk_insert
[
i
],
0
,
myisam_bulk_insert_tree_size
/
share
->
base
.
keys
,
0
,
myisam_bulk_insert_tree_size
/
num_
keys
,
0
,
(
qsort_cmp2
)
keys_compare
,
0
,
(
tree_element_free
)
keys_free
,
(
void
*
)
params
);
(
tree_element_free
)
keys_free
,
(
void
*
)
params
++
);
}
else
info
->
bulk_insert
[
i
].
root
=
0
;
}
return
0
;
}
mysys/tree.c
View file @
db4a8602
...
...
@@ -63,31 +63,7 @@ static void rb_delete_fixup(TREE *tree,TREE_ELEMENT ***parent);
/* The actuall code for handling binary trees */
#ifndef DBUG_OFF
/* Test that the proporties for a red-black tree holds */
static
int
test_rb_tree
(
TREE_ELEMENT
*
element
)
{
int
count_l
,
count_r
;
if
(
!
element
->
left
)
return
0
;
/* Found end of tree */
if
(
element
->
colour
==
RED
&&
(
element
->
left
->
colour
==
RED
||
element
->
right
->
colour
==
RED
))
{
printf
(
"Wrong tree: Found two red in a row
\n
"
);
return
-
1
;
}
count_l
=
test_rb_tree
(
element
->
left
);
count_r
=
test_rb_tree
(
element
->
right
);
if
(
count_l
>=
0
&&
count_r
>=
0
)
{
if
(
count_l
==
count_r
)
return
count_l
+
(
element
->
colour
==
BLACK
);
printf
(
"Wrong tree: Incorrect black-count: %d - %d
\n
"
,
count_l
,
count_r
);
}
return
-
1
;
}
static
int
test_rb_tree
(
TREE_ELEMENT
*
element
);
#endif
void
init_tree
(
TREE
*
tree
,
uint
default_alloc_size
,
uint
memory_limit
,
...
...
@@ -546,3 +522,31 @@ static void rb_delete_fixup(TREE *tree, TREE_ELEMENT ***parent)
}
x
->
colour
=
BLACK
;
}
#ifndef DBUG_OFF
/* Test that the proporties for a red-black tree holds */
static
int
test_rb_tree
(
TREE_ELEMENT
*
element
)
{
int
count_l
,
count_r
;
if
(
!
element
->
left
)
return
0
;
/* Found end of tree */
if
(
element
->
colour
==
RED
&&
(
element
->
left
->
colour
==
RED
||
element
->
right
->
colour
==
RED
))
{
printf
(
"Wrong tree: Found two red in a row
\n
"
);
return
-
1
;
}
count_l
=
test_rb_tree
(
element
->
left
);
count_r
=
test_rb_tree
(
element
->
right
);
if
(
count_l
>=
0
&&
count_r
>=
0
)
{
if
(
count_l
==
count_r
)
return
count_l
+
(
element
->
colour
==
BLACK
);
printf
(
"Wrong tree: Incorrect black-count: %d - %d
\n
"
,
count_l
,
count_r
);
}
return
-
1
;
}
#endif
sql/sql_show.cc
View file @
db4a8602
...
...
@@ -114,7 +114,7 @@ int mysqld_show_open_tables(THD *thd,const char *db,const char *wild)
if
(
send_fields
(
thd
,
field_list
,
1
))
DBUG_RETURN
(
1
);
if
(
!
(
open_list
=
list_open_tables
(
thd
,
wild
))
&&
thd
->
fatal_error
)
if
(
!
(
list_open_tables
(
thd
,
&
tables
,
db
,
wild
))
&&
thd
->
fatal_error
)
DBUG_RETURN
(
-
1
);
List_iterator
<
char
>
it
(
tables
);
...
...
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