summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
Diffstat (limited to 'mysys')
-rw-r--r--mysys/CMakeLists.txt1
-rw-r--r--mysys/mf_iocache2.c4
-rw-r--r--mysys/ptr_cmp.c7
3 files changed, 10 insertions, 2 deletions
diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt
index eb7f75ed6a8..704ddf8bb49 100644
--- a/mysys/CMakeLists.txt
+++ b/mysys/CMakeLists.txt
@@ -1,4 +1,5 @@
# Copyright (c) 2006, 2014, Oracle and/or its affiliates
+# Copyright (c) 2009, 2018, MariaDB Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c
index 2499094037d..fa3b6e672d7 100644
--- a/mysys/mf_iocache2.c
+++ b/mysys/mf_iocache2.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2018, Oracle and/or its affiliates.
+ Copyright (c) 2009, 2018, MariaDB Corporation
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -491,4 +492,3 @@ process_flags:
err:
return (size_t) -1;
}
-
diff --git a/mysys/ptr_cmp.c b/mysys/ptr_cmp.c
index 6d853a8db25..add92edd713 100644
--- a/mysys/ptr_cmp.c
+++ b/mysys/ptr_cmp.c
@@ -52,6 +52,11 @@ static int ptr_compare_0(size_t *compare_length, uchar **a, uchar **b);
static int ptr_compare_1(size_t *compare_length, uchar **a, uchar **b);
static int ptr_compare_2(size_t *compare_length, uchar **a, uchar **b);
static int ptr_compare_3(size_t *compare_length, uchar **a, uchar **b);
+static int degenerate_compare_func(size_t *compare_length, uchar **a, uchar **b)
+{
+ DBUG_ASSERT(*compare_length == 0);
+ return 0;
+}
#endif /* __sun */
/* Get a pointer to a optimal byte-compare function for a given size */
@@ -64,6 +69,8 @@ qsort2_cmp get_ptr_compare (size_t size __attribute__((unused)))
#else
qsort2_cmp get_ptr_compare (size_t size)
{
+ if (size == 0)
+ return (qsort2_cmp) degenerate_compare_func;
if (size < 4)
return (qsort2_cmp) ptr_compare;
switch (size & 3) {