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
ac54f00f
Commit
ac54f00f
authored
Oct 30, 2006
by
msvensson@shellback.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add an extra block to avoid that DBUG_ENTER declare variables after code
parent
02f56cc1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
132 additions
and
126 deletions
+132
-126
myisam/sort.c
myisam/sort.c
+132
-126
No files found.
myisam/sort.c
View file @
ac54f00f
...
@@ -322,6 +322,9 @@ pthread_handler_t thr_find_all_keys(void *arg)
...
@@ -322,6 +322,9 @@ pthread_handler_t thr_find_all_keys(void *arg)
if
(
my_thread_init
())
if
(
my_thread_init
())
goto
err
;
goto
err
;
{
/* Add extra block since DBUG_ENTER declare variables */
DBUG_ENTER
(
"thr_find_all_keys"
);
DBUG_ENTER
(
"thr_find_all_keys"
);
DBUG_PRINT
(
"enter"
,
(
"master: %d"
,
sort_param
->
master
));
DBUG_PRINT
(
"enter"
,
(
"master: %d"
,
sort_param
->
master
));
if
(
sort_param
->
sort_info
->
got_error
)
if
(
sort_param
->
sort_info
->
got_error
)
...
@@ -361,7 +364,7 @@ pthread_handler_t thr_find_all_keys(void *arg)
...
@@ -361,7 +364,7 @@ pthread_handler_t thr_find_all_keys(void *arg)
uint
skr
;
uint
skr
;
do
do
{
{
skr
=
maxbuffer
;
skr
=
maxbuffer
;
if
(
memavl
<
sizeof
(
BUFFPEK
)
*
maxbuffer
||
if
(
memavl
<
sizeof
(
BUFFPEK
)
*
maxbuffer
||
(
keys
=
(
memavl
-
sizeof
(
BUFFPEK
)
*
maxbuffer
)
/
(
keys
=
(
memavl
-
sizeof
(
BUFFPEK
)
*
maxbuffer
)
/
(
sort_length
+
sizeof
(
char
*
)))
<=
1
||
(
sort_length
+
sizeof
(
char
*
)))
<=
1
||
...
@@ -388,13 +391,15 @@ pthread_handler_t thr_find_all_keys(void *arg)
...
@@ -388,13 +391,15 @@ pthread_handler_t thr_find_all_keys(void *arg)
else
else
break
;
break
;
}
}
old_memavl
=
memavl
;
old_memavl
=
memavl
;
if
((
memavl
=
memavl
/
4
*
3
)
<
MIN_SORT_MEMORY
&&
old_memavl
>
MIN_SORT_MEMORY
)
if
((
memavl
=
memavl
/
4
*
3
)
<
MIN_SORT_MEMORY
&&
memavl
=
MIN_SORT_MEMORY
;
old_memavl
>
MIN_SORT_MEMORY
)
memavl
=
MIN_SORT_MEMORY
;
}
}
if
(
memavl
<
MIN_SORT_MEMORY
)
if
(
memavl
<
MIN_SORT_MEMORY
)
{
{
mi_check_print_error
(
sort_param
->
sort_info
->
param
,
"Sort buffer too small"
);
mi_check_print_error
(
sort_param
->
sort_info
->
param
,
"Sort buffer too small"
);
goto
err
;
/* purecov: tested */
goto
err
;
/* purecov: tested */
}
}
...
@@ -403,8 +408,8 @@ pthread_handler_t thr_find_all_keys(void *arg)
...
@@ -403,8 +408,8 @@ pthread_handler_t thr_find_all_keys(void *arg)
sort_param
->
key
+
1
,
keys
);
sort_param
->
key
+
1
,
keys
);
sort_param
->
sort_keys
=
sort_keys
;
sort_param
->
sort_keys
=
sort_keys
;
idx
=
error
=
0
;
idx
=
error
=
0
;
sort_keys
[
0
]
=
(
uchar
*
)
(
sort_keys
+
keys
);
sort_keys
[
0
]
=
(
uchar
*
)
(
sort_keys
+
keys
);
DBUG_PRINT
(
"info"
,
(
"reading keys"
));
DBUG_PRINT
(
"info"
,
(
"reading keys"
));
while
(
!
(
error
=
sort_param
->
sort_info
->
got_error
)
&&
while
(
!
(
error
=
sort_param
->
sort_info
->
got_error
)
&&
...
@@ -424,9 +429,9 @@ pthread_handler_t thr_find_all_keys(void *arg)
...
@@ -424,9 +429,9 @@ pthread_handler_t thr_find_all_keys(void *arg)
(
BUFFPEK
*
)
alloc_dynamic
(
&
sort_param
->
buffpek
),
(
BUFFPEK
*
)
alloc_dynamic
(
&
sort_param
->
buffpek
),
&
sort_param
->
tempfile
))
&
sort_param
->
tempfile
))
goto
err
;
goto
err
;
sort_keys
[
0
]
=
(
uchar
*
)
(
sort_keys
+
keys
);
sort_keys
[
0
]
=
(
uchar
*
)
(
sort_keys
+
keys
);
memcpy
(
sort_keys
[
0
],
sort_keys
[
idx
-
1
],
(
size_t
)
sort_param
->
key_length
);
memcpy
(
sort_keys
[
0
],
sort_keys
[
idx
-
1
],
(
size_t
)
sort_param
->
key_length
);
idx
=
1
;
idx
=
1
;
}
}
sort_keys
[
idx
]
=
sort_keys
[
idx
-
1
]
+
sort_param
->
key_length
;
sort_keys
[
idx
]
=
sort_keys
[
idx
-
1
]
+
sort_param
->
key_length
;
}
}
...
@@ -475,6 +480,7 @@ pthread_handler_t thr_find_all_keys(void *arg)
...
@@ -475,6 +480,7 @@ pthread_handler_t thr_find_all_keys(void *arg)
pthread_mutex_unlock
(
&
sort_param
->
sort_info
->
mutex
);
pthread_mutex_unlock
(
&
sort_param
->
sort_info
->
mutex
);
DBUG_PRINT
(
"exit"
,
(
"======== ending thread ========"
));
DBUG_PRINT
(
"exit"
,
(
"======== ending thread ========"
));
}
my_thread_end
();
my_thread_end
();
return
NULL
;
return
NULL
;
}
}
...
...
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