File tree Expand file tree Collapse file tree 2 files changed +6
-28
lines changed Expand file tree Collapse file tree 2 files changed +6
-28
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ Completed by Sunny Bains and Marko Makela
27
27
#include < my_config.h>
28
28
#include < log.h>
29
29
#include < sql_class.h>
30
+ #include < math.h>
30
31
31
32
#include " row0merge.h"
32
33
#include " row0ext.h"
@@ -42,15 +43,8 @@ Completed by Sunny Bains and Marko Makela
42
43
#include " row0import.h"
43
44
#include " handler0alter.h"
44
45
#include " ha_prototypes.h"
45
- #include " math.h" /* log() */
46
46
#include " fil0crypt.h"
47
47
48
- float my_log2f (float n)
49
- {
50
- /* log(n) / log(2) is log2. */
51
- return (float )(log ((double )n) / log ((double )2 ));
52
- }
53
-
54
48
/* Ignore posix_fadvise() on those platforms where it does not exist */
55
49
#if defined __WIN__
56
50
# define posix_fadvise (fd, offset, len, advice ) /* nothing */
@@ -2503,18 +2497,13 @@ row_merge_sort(
2503
2497
/* Record the number of merge runs we need to perform */
2504
2498
num_runs = file->offset ;
2505
2499
2506
- /* Find the number N which 2^N is greater or equal than num_runs */
2507
- /* N is merge sort running count */
2508
- total_merge_sort_count = ceil (my_log2f (num_runs));
2509
- if (total_merge_sort_count <= 0 ) {
2510
- total_merge_sort_count=1 ;
2511
- }
2512
-
2513
2500
/* If num_runs are less than 1, nothing to merge */
2514
2501
if (num_runs <= 1 ) {
2515
2502
DBUG_RETURN (error);
2516
2503
}
2517
2504
2505
+ total_merge_sort_count = ceil (log2f (num_runs));
2506
+
2518
2507
/* "run_offset" records each run's first offset number */
2519
2508
run_offset = (ulint*) mem_alloc (file->offset * sizeof (ulint));
2520
2509
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ Completed by Sunny Bains and Marko Makela
27
27
#include < my_config.h>
28
28
#include < log.h>
29
29
#include < sql_class.h>
30
+ #include < math.h>
30
31
31
32
#include " row0merge.h"
32
33
#include " row0ext.h"
@@ -42,15 +43,8 @@ Completed by Sunny Bains and Marko Makela
42
43
#include " row0import.h"
43
44
#include " handler0alter.h"
44
45
#include " ha_prototypes.h"
45
- #include " math.h" /* log2() */
46
46
#include " fil0crypt.h"
47
47
48
- float my_log2f (float n)
49
- {
50
- /* log(n) / log(2) is log2. */
51
- return (float )(log ((double )n) / log ((double )2 ));
52
- }
53
-
54
48
/* Ignore posix_fadvise() on those platforms where it does not exist */
55
49
#if defined __WIN__
56
50
# define posix_fadvise (fd, offset, len, advice ) /* nothing */
@@ -2516,18 +2510,13 @@ row_merge_sort(
2516
2510
/* Record the number of merge runs we need to perform */
2517
2511
num_runs = file->offset ;
2518
2512
2519
- /* Find the number N which 2^N is greater or equal than num_runs */
2520
- /* N is merge sort running count */
2521
- total_merge_sort_count = ceil (my_log2f (num_runs));
2522
- if (total_merge_sort_count <= 0 ) {
2523
- total_merge_sort_count=1 ;
2524
- }
2525
-
2526
2513
/* If num_runs are less than 1, nothing to merge */
2527
2514
if (num_runs <= 1 ) {
2528
2515
DBUG_RETURN (error);
2529
2516
}
2530
2517
2518
+ total_merge_sort_count = ceil (log2f (num_runs));
2519
+
2531
2520
/* "run_offset" records each run's first offset number */
2532
2521
run_offset = (ulint*) mem_alloc (file->offset * sizeof (ulint));
2533
2522
You can’t perform that action at this time.
0 commit comments