Skip to content

Commit 0899dcc

Browse files
author
Magne Mahre
committed
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) --BZR-- revision-id: [email protected] property-branch-nick: mysql-5.1-11900714 testament3-sha1: f7314db892077d4a7cda7275401e039bdbd9cf3e
1 parent c0c604b commit 0899dcc

24 files changed

+350
-438
lines changed

.bzrfileids

-214 Bytes
Binary file not shown.

extra/perror.c

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ static my_bool verbose, print_all_codes;
3232

3333
#include "../include/my_base.h"
3434
#include "../mysys/my_handler_errors.h"
35-
#include "../include/my_handler.h"
3635

3736
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
3837
static my_bool ndb_code;
@@ -185,6 +184,36 @@ static const char *get_ha_error_msg(int code)
185184
}
186185

187186

187+
/*
188+
Register handler error messages for usage with my_error()
189+
190+
NOTES
191+
This is safe to call multiple times as my_error_register()
192+
will ignore calls to register already registered error numbers.
193+
*/
194+
void my_handler_error_register(void)
195+
{
196+
/*
197+
If you got compilation error here about compile_time_assert array, check
198+
that every HA_ERR_xxx constant has a corresponding error message in
199+
handler_error_messages[] list (check mysys/ma_handler_errors.h and
200+
include/my_base.h).
201+
*/
202+
compile_time_assert(HA_ERR_FIRST + array_elements(handler_error_messages) ==
203+
HA_ERR_LAST + 1);
204+
my_error_register(handler_error_messages, HA_ERR_FIRST,
205+
HA_ERR_FIRST+ array_elements(handler_error_messages)-1);
206+
}
207+
208+
209+
void my_handler_error_unregister(void)
210+
{
211+
my_error_unregister(HA_ERR_FIRST,
212+
HA_ERR_FIRST+ array_elements(handler_error_messages)-1);
213+
}
214+
215+
216+
188217
#if defined(__WIN__)
189218
static my_bool print_win_error_msg(DWORD error, my_bool verbose)
190219
{

include/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ noinst_HEADERS = config-win.h config-netware.h my_bit.h \
3737
my_nosys.h my_alarm.h queues.h rijndael.h sha1.h \
3838
my_aes.h my_tree.h my_trie.h hash.h thr_alarm.h \
3939
thr_lock.h t_ctype.h violite.h my_md5.h base64.h \
40-
my_handler.h my_time.h my_vle.h my_user.h \
40+
my_compare.h my_time.h my_vle.h my_user.h \
4141
my_libwrap.h my_stacktrace.h
4242

4343
EXTRA_DIST = mysql.h.pp mysql/plugin.h.pp

include/heap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ extern "C" {
3030
#include <thr_lock.h>
3131
#endif
3232

33-
#include "my_handler.h"
33+
#include "my_compare.h"
3434
#include "my_tree.h"
3535

3636
/* defines used by heap-funktions */

include/my_compare.h

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
2+
3+
This program is free software; you can redistribute it and/or modify
4+
it under the terms of the GNU General Public License as published by
5+
the Free Software Foundation; version 2 of the License.
6+
7+
This program is distributed in the hope that it will be useful,
8+
but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+
GNU General Public License for more details.
11+
12+
You should have received a copy of the GNU General Public License
13+
along with this program; if not, write to the Free Software
14+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
15+
16+
#ifndef _my_compare_h
17+
#define _my_compare_h
18+
19+
#include "my_base.h"
20+
#include "m_ctype.h"
21+
#include "myisampack.h"
22+
23+
typedef struct st_HA_KEYSEG /* Key-portion */
24+
{
25+
CHARSET_INFO *charset;
26+
uint32 start; /* Start of key in record */
27+
uint32 null_pos; /* position to NULL indicator */
28+
uint16 bit_pos; /* Position to bit part */
29+
uint16 flag;
30+
uint16 length; /* Keylength */
31+
uint8 type; /* Type of key (for sort) */
32+
uint8 language;
33+
uint8 null_bit; /* bitmask to test for NULL */
34+
uint8 bit_start,bit_end; /* if bit field */
35+
uint8 bit_length; /* Length of bit part */
36+
} HA_KEYSEG;
37+
38+
#define get_key_length(length,key) \
39+
{ if ((uchar) *(key) != 255) \
40+
length= (uint) (uchar) *((key)++); \
41+
else \
42+
{ length=mi_uint2korr((key)+1); (key)+=3; } \
43+
}
44+
45+
#define get_key_length_rdonly(length,key) \
46+
{ if ((uchar) *(key) != 255) \
47+
length= ((uint) (uchar) *((key))); \
48+
else \
49+
{ length=mi_uint2korr((key)+1); } \
50+
}
51+
52+
#define get_key_pack_length(length,length_pack,key) \
53+
{ if ((uchar) *(key) != 255) \
54+
{ length= (uint) (uchar) *((key)++); length_pack=1; }\
55+
else \
56+
{ length=mi_uint2korr((key)+1); (key)+=3; length_pack=3; } \
57+
}
58+
59+
#define store_key_length_inc(key,length) \
60+
{ if ((length) < 255) \
61+
{ *(key)++=(length); } \
62+
else \
63+
{ *(key)=255; mi_int2store((key)+1,(length)); (key)+=3; } \
64+
}
65+
66+
#define get_rec_bits(bit_ptr, bit_ofs, bit_len) \
67+
(((((uint16) (bit_ptr)[1] << 8) | (uint16) (bit_ptr)[0]) >> (bit_ofs)) & \
68+
((1 << (bit_len)) - 1))
69+
70+
#define set_rec_bits(bits, bit_ptr, bit_ofs, bit_len) \
71+
{ \
72+
(bit_ptr)[0]= ((bit_ptr)[0] & ~(((1 << (bit_len)) - 1) << (bit_ofs))) | \
73+
((bits) << (bit_ofs)); \
74+
if ((bit_ofs) + (bit_len) > 8) \
75+
(bit_ptr)[1]= ((bit_ptr)[1] & ~((1 << ((bit_len) - 8 + (bit_ofs))) - 1)) | \
76+
((bits) >> (8 - (bit_ofs))); \
77+
}
78+
79+
#define clr_rec_bits(bit_ptr, bit_ofs, bit_len) \
80+
set_rec_bits(0, bit_ptr, bit_ofs, bit_len)
81+
82+
extern int ha_compare_text(CHARSET_INFO *, uchar *, uint, uchar *, uint ,
83+
my_bool, my_bool);
84+
extern int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
85+
register uchar *b, uint key_length, uint nextflag,
86+
uint *diff_pos);
87+
88+
89+
#endif /* _my_compare_h */

include/my_global.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ C_MODE_END
359359
#define ulonglong2double(A) my_ulonglong2double(A)
360360
#define my_off_t2double(A) my_ulonglong2double(A)
361361
C_MODE_START
362-
double my_ulonglong2double(unsigned long long A);
362+
inline double my_ulonglong2double(unsigned long long A) { return (double) A; }
363363
C_MODE_END
364364
#endif /* _AIX */
365365

include/my_handler.h

Lines changed: 0 additions & 128 deletions
This file was deleted.

include/myisam.h

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,30 @@ extern "C" {
3030
#ifndef _keycache_h
3131
#include "keycache.h"
3232
#endif
33-
#include "my_handler.h"
3433
#include <mysql/plugin.h>
34+
#include "my_compare.h"
35+
36+
/*
37+
There is a hard limit for the maximum number of keys as there are only
38+
8 bits in the index file header for the number of keys in a table.
39+
This means that 0..255 keys can exist for a table. The idea of
40+
HA_MAX_POSSIBLE_KEY is to ensure that one can use myisamchk & tools on
41+
a MyISAM table for which one has more keys than MyISAM is normally
42+
compiled for. If you don't have this, you will get a core dump when
43+
running myisamchk compiled for 128 keys on a table with 255 keys.
44+
*/
45+
46+
#define HA_MAX_POSSIBLE_KEY 255 /* For myisamchk */
47+
/*
48+
The following defines can be increased if necessary.
49+
But beware the dependency of MI_MAX_POSSIBLE_KEY_BUFF and HA_MAX_KEY_LENGTH.
50+
*/
51+
52+
#define HA_MAX_KEY_LENGTH 1000 /* Max length in bytes */
53+
#define HA_MAX_KEY_SEG 16 /* Max segments for key */
54+
55+
#define HA_MAX_POSSIBLE_KEY_BUFF (HA_MAX_KEY_LENGTH + 24+ 6+6)
56+
#define HA_MAX_KEY_BUFF (HA_MAX_KEY_LENGTH+HA_MAX_KEY_SEG*6+8+8)
3557

3658
/*
3759
Limit max keys according to HA_MAX_POSSIBLE_KEY

libmysql/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ SET(CLIENT_SOURCES ../mysys/array.c ../strings/bchange.c ../strings/bmove.c
8282
../mysys/mf_wcomp.c ../mysys/mulalloc.c ../mysys/my_access.c ../mysys/my_alloc.c
8383
../mysys/my_chsize.c ../mysys/my_compress.c ../mysys/my_create.c
8484
../mysys/my_delete.c ../mysys/my_div.c ../mysys/my_error.c ../mysys/my_file.c
85-
../mysys/my_fopen.c ../mysys/my_fstream.c ../mysys/my_gethostbyname.c
85+
../mysys/my_fopen.c ../mysys/my_fstream.c
8686
../mysys/my_getopt.c ../mysys/my_getwd.c ../mysys/my_init.c ../mysys/my_lib.c
8787
../mysys/my_malloc.c ../mysys/my_messnc.c ../mysys/my_net.c ../mysys/my_once.c
8888
../mysys/my_open.c ../mysys/my_pread.c ../mysys/my_pthread.c ../mysys/my_read.c

libmysql/Makefile.shared

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \
6666
charset.lo charset-def.lo hash.lo mf_iocache.lo \
6767
mf_iocache2.lo my_seek.lo my_sleep.lo \
6868
my_pread.lo mf_cache.lo md5.lo sha1.lo \
69-
my_getopt.lo my_gethostbyname.lo my_port.lo \
69+
my_getopt.lo \
7070
my_rename.lo my_chsize.lo my_sync.lo my_getsystime.lo
7171
sqlobjects = net.lo
7272
sql_cmn_objects = pack.lo client.lo my_time.lo

0 commit comments

Comments
 (0)