summaryrefslogtreecommitdiff
path: root/storage/myisam
diff options
context:
space:
mode:
authorMagne Mahre <magne.mahre@oracle.com>2011-03-28 10:47:30 +0200
committerMagne Mahre <magne.mahre@oracle.com>2011-03-28 10:47:30 +0200
commit9ff72a1acfffe95cd5e6d9e06c61c5ee9b0000e0 (patch)
treed9ded1526828e9a2bd239908dbd08d7d439d865d /storage/myisam
parentd499851be03a2a20f7cb230d9b2d69e169aa81c8 (diff)
downloadmariadb-git-9ff72a1acfffe95cd5e6d9e06c61c5ee9b0000e0.tar.gz
Bug#11900714 REMOVE LGPL LICENSED FILES IN MYSQL 5.1
The LGPL license is used in some legacy code, and to adhere to current licensing polity, we remove those files that are no longer used, and reorganize the remaining LGPL code so it will be GPL licensed from now on. Note: This patch only removed LGPL licensed files in MySQL 5.1, and is the second of a set of patches to remove LGPL from all trees. (See Bug# 11840513 for details)
Diffstat (limited to 'storage/myisam')
-rw-r--r--storage/myisam/ft_stopwords.c2
-rw-r--r--storage/myisam/mi_check.c87
-rw-r--r--storage/myisam/mi_test1.c1
-rw-r--r--storage/myisam/mi_write.c1
-rw-r--r--storage/myisam/myisamdef.h2
-rw-r--r--storage/myisam/sp_test.c1
6 files changed, 93 insertions, 1 deletions
diff --git a/storage/myisam/ft_stopwords.c b/storage/myisam/ft_stopwords.c
index 9838b15af34..dbab71f4381 100644
--- a/storage/myisam/ft_stopwords.c
+++ b/storage/myisam/ft_stopwords.c
@@ -16,7 +16,7 @@
/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
#include "ftdefs.h"
-#include "my_handler.h"
+#include "my_compare.h"
typedef struct st_ft_stopwords
{
diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c
index 935465e7edf..7bc26729e03 100644
--- a/storage/myisam/mi_check.c
+++ b/storage/myisam/mi_check.c
@@ -85,6 +85,7 @@ static SORT_KEY_BLOCKS *alloc_key_blocks(MI_CHECK *param, uint blocks,
uint buffer_length);
static ha_checksum mi_byte_checksum(const uchar *buf, uint length);
static void set_data_file_type(SORT_INFO *sort_info, MYISAM_SHARE *share);
+static HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a);
void myisamchk_init(MI_CHECK *param)
{
@@ -4739,3 +4740,89 @@ set_data_file_type(SORT_INFO *sort_info, MYISAM_SHARE *share)
share->delete_record=tmp.delete_record;
}
}
+
+/*
+ Find the first NULL value in index-suffix values tuple
+
+ SYNOPSIS
+ ha_find_null()
+ keyseg Array of keyparts for key suffix
+ a Key suffix value tuple
+
+ DESCRIPTION
+ Find the first NULL value in index-suffix values tuple.
+ TODO Consider optimizing this fuction or its use so we don't search for
+ NULL values in completely NOT NULL index suffixes.
+
+ RETURN
+ First key part that has NULL as value in values tuple, or the last key part
+ (with keyseg->type==HA_TYPE_END) if values tuple doesn't contain NULLs.
+*/
+
+static HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a)
+{
+ for (; (enum ha_base_keytype) keyseg->type != HA_KEYTYPE_END; keyseg++)
+ {
+ uchar *end;
+ if (keyseg->null_bit)
+ {
+ if (!*a++)
+ return keyseg;
+ }
+ end= a+ keyseg->length;
+
+ switch ((enum ha_base_keytype) keyseg->type) {
+ case HA_KEYTYPE_TEXT:
+ case HA_KEYTYPE_BINARY:
+ case HA_KEYTYPE_BIT:
+ if (keyseg->flag & HA_SPACE_PACK)
+ {
+ int a_length;
+ get_key_length(a_length, a);
+ a += a_length;
+ break;
+ }
+ else
+ a= end;
+ break;
+ case HA_KEYTYPE_VARTEXT1:
+ case HA_KEYTYPE_VARTEXT2:
+ case HA_KEYTYPE_VARBINARY1:
+ case HA_KEYTYPE_VARBINARY2:
+ {
+ int a_length;
+ get_key_length(a_length, a);
+ a+= a_length;
+ break;
+ }
+ case HA_KEYTYPE_NUM:
+ if (keyseg->flag & HA_SPACE_PACK)
+ {
+ int alength= *a++;
+ end= a+alength;
+ }
+ a= end;
+ break;
+ case HA_KEYTYPE_INT8:
+ case HA_KEYTYPE_SHORT_INT:
+ case HA_KEYTYPE_USHORT_INT:
+ case HA_KEYTYPE_LONG_INT:
+ case HA_KEYTYPE_ULONG_INT:
+ case HA_KEYTYPE_INT24:
+ case HA_KEYTYPE_UINT24:
+#ifdef HAVE_LONG_LONG
+ case HA_KEYTYPE_LONGLONG:
+ case HA_KEYTYPE_ULONGLONG:
+#endif
+ case HA_KEYTYPE_FLOAT:
+ case HA_KEYTYPE_DOUBLE:
+ a= end;
+ break;
+ case HA_KEYTYPE_END: /* purecov: inspected */
+ /* keep compiler happy */
+ DBUG_ASSERT(0);
+ break;
+ }
+ }
+ return keyseg;
+}
diff --git a/storage/myisam/mi_test1.c b/storage/myisam/mi_test1.c
index 363b024737a..142ee9b4909 100644
--- a/storage/myisam/mi_test1.c
+++ b/storage/myisam/mi_test1.c
@@ -16,6 +16,7 @@
/* Testing of the basic functions of a MyISAM table */
#include "myisam.h"
+#include "myisamdef.h"
#include <my_getopt.h>
#include <m_string.h>
diff --git a/storage/myisam/mi_write.c b/storage/myisam/mi_write.c
index 72a4e006cc6..3c8ebe5dbd8 100644
--- a/storage/myisam/mi_write.c
+++ b/storage/myisam/mi_write.c
@@ -17,6 +17,7 @@
#include "fulltext.h"
#include "rt_index.h"
+#include "my_compare.h"
#define MAX_POINTER_LENGTH 8
diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h
index 962155e884c..c91601f6503 100644
--- a/storage/myisam/myisamdef.h
+++ b/storage/myisam/myisamdef.h
@@ -424,6 +424,8 @@ typedef struct st_mi_sort_param
#define get_pack_length(length) ((length) >= 255 ? 3 : 1)
+#define portable_sizeof_char_ptr 8
+
#define MI_MIN_BLOCK_LENGTH 20 /* Because of delete-link */
#define MI_EXTEND_BLOCK_LENGTH 20 /* Don't use to small record-blocks */
#define MI_SPLIT_LENGTH ((MI_EXTEND_BLOCK_LENGTH+4)*2)
diff --git a/storage/myisam/sp_test.c b/storage/myisam/sp_test.c
index f572c7ab19b..7a30a742fd6 100644
--- a/storage/myisam/sp_test.c
+++ b/storage/myisam/sp_test.c
@@ -17,6 +17,7 @@
/* Written by Alex Barkov, who has a shared copyright to this code */
#include "myisam.h"
+#include "myisamdef.h"
#ifdef HAVE_SPATIAL
#include "sp_defs.h"