58 changed files with 831 additions and 479 deletions
-
6.bzrignore
-
14client/mysqlbinlog.cc
-
31extra/perror.c
-
2include/Makefile.am
-
2include/heap.h
-
89include/my_compare.h
-
2include/my_global.h
-
128include/my_handler.h
-
24include/myisam.h
-
2libmysql/CMakeLists.txt
-
2libmysql/Makefile.shared
-
20mysql-test/extra/rpl_tests/rpl_record_compare.test
-
8mysql-test/r/events_bugs.result
-
7mysql-test/r/func_math.result
-
30mysql-test/r/func_time.result
-
27mysql-test/r/lock_sync.result
-
12mysql-test/r/mysqlbinlog.result
-
1mysql-test/r/packet.result
-
2mysql-test/r/shm.result
-
24mysql-test/r/variables-notembedded.result
-
20mysql-test/r/variables.result
-
2mysql-test/suite/rpl/r/rpl_packet.result
-
6mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result
-
20mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result
-
2mysql-test/suite/rpl/t/rpl_loaddata_map-master.opt
-
2mysql-test/suite/rpl/t/rpl_loaddata_map-slave.opt
-
6mysql-test/suite/rpl/t/rpl_row_rec_comp_myisam.test
-
8mysql-test/t/events_bugs.test
-
9mysql-test/t/func_math.test
-
32mysql-test/t/func_time.test
-
54mysql-test/t/lock_sync.test
-
20mysql-test/t/mysqlbinlog.test
-
27mysql-test/t/variables-notembedded.test
-
14mysql-test/t/variables.test
-
4mysys/CMakeLists.txt
-
6mysys/Makefile.am
-
157mysys/my_compare.c
-
113mysys/my_gethostbyname.c
-
91mysys/my_net.c
-
40mysys/my_port.c
-
2sql/field.h
-
1sql/handler.h
-
6sql/item.cc
-
13sql/item_func.cc
-
5sql/item_timefunc.cc
-
7sql/item_timefunc.h
-
31sql/log_event.cc
-
8sql/mysqld.cc
-
38sql/set_var.cc
-
3sql/sql_base.cc
-
2storage/myisam/ft_stopwords.c
-
87storage/myisam/mi_check.c
-
1storage/myisam/mi_test1.c
-
1storage/myisam/mi_write.c
-
2storage/myisam/myisamdef.h
-
1storage/myisam/sp_test.c
-
18win/build-vs10.bat
-
18win/build-vs10_x64.bat
@ -0,0 +1,89 @@ |
|||
/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. |
|||
|
|||
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 |
|||
the Free Software Foundation; version 2 of the License. |
|||
|
|||
This program is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
GNU General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU General Public License |
|||
along with this program; if not, write to the Free Software |
|||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ |
|||
|
|||
#ifndef _my_compare_h |
|||
#define _my_compare_h |
|||
|
|||
#include "my_base.h" |
|||
#include "m_ctype.h" |
|||
#include "myisampack.h" |
|||
|
|||
typedef struct st_HA_KEYSEG /* Key-portion */ |
|||
{ |
|||
CHARSET_INFO *charset; |
|||
uint32 start; /* Start of key in record */ |
|||
uint32 null_pos; /* position to NULL indicator */ |
|||
uint16 bit_pos; /* Position to bit part */ |
|||
uint16 flag; |
|||
uint16 length; /* Keylength */ |
|||
uint8 type; /* Type of key (for sort) */ |
|||
uint8 language; |
|||
uint8 null_bit; /* bitmask to test for NULL */ |
|||
uint8 bit_start,bit_end; /* if bit field */ |
|||
uint8 bit_length; /* Length of bit part */ |
|||
} HA_KEYSEG; |
|||
|
|||
#define get_key_length(length,key) \ |
|||
{ if ((uchar) *(key) != 255) \ |
|||
length= (uint) (uchar) *((key)++); \ |
|||
else \ |
|||
{ length=mi_uint2korr((key)+1); (key)+=3; } \ |
|||
} |
|||
|
|||
#define get_key_length_rdonly(length,key) \ |
|||
{ if ((uchar) *(key) != 255) \ |
|||
length= ((uint) (uchar) *((key))); \ |
|||
else \ |
|||
{ length=mi_uint2korr((key)+1); } \ |
|||
} |
|||
|
|||
#define get_key_pack_length(length,length_pack,key) \ |
|||
{ if ((uchar) *(key) != 255) \ |
|||
{ length= (uint) (uchar) *((key)++); length_pack=1; }\ |
|||
else \ |
|||
{ length=mi_uint2korr((key)+1); (key)+=3; length_pack=3; } \ |
|||
} |
|||
|
|||
#define store_key_length_inc(key,length) \ |
|||
{ if ((length) < 255) \ |
|||
{ *(key)++=(length); } \ |
|||
else \ |
|||
{ *(key)=255; mi_int2store((key)+1,(length)); (key)+=3; } \ |
|||
} |
|||
|
|||
#define get_rec_bits(bit_ptr, bit_ofs, bit_len) \ |
|||
(((((uint16) (bit_ptr)[1] << 8) | (uint16) (bit_ptr)[0]) >> (bit_ofs)) & \ |
|||
((1 << (bit_len)) - 1)) |
|||
|
|||
#define set_rec_bits(bits, bit_ptr, bit_ofs, bit_len) \ |
|||
{ \ |
|||
(bit_ptr)[0]= ((bit_ptr)[0] & ~(((1 << (bit_len)) - 1) << (bit_ofs))) | \ |
|||
((bits) << (bit_ofs)); \ |
|||
if ((bit_ofs) + (bit_len) > 8) \ |
|||
(bit_ptr)[1]= ((bit_ptr)[1] & ~((1 << ((bit_len) - 8 + (bit_ofs))) - 1)) | \ |
|||
((bits) >> (8 - (bit_ofs))); \ |
|||
} |
|||
|
|||
#define clr_rec_bits(bit_ptr, bit_ofs, bit_len) \ |
|||
set_rec_bits(0, bit_ptr, bit_ofs, bit_len) |
|||
|
|||
extern int ha_compare_text(CHARSET_INFO *, uchar *, uint, uchar *, uint , |
|||
my_bool, my_bool); |
|||
extern int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a, |
|||
register uchar *b, uint key_length, uint nextflag, |
|||
uint *diff_pos); |
|||
|
|||
|
|||
#endif /* _my_compare_h */ |
|||
@ -1,128 +0,0 @@ |
|||
/* Copyright (C) 2002-2006 MySQL AB |
|||
|
|||
This program is free software; you can redistribute it and/or |
|||
modify it under the terms of the GNU Library General Public |
|||
License as published by the Free Software Foundation; version 2 |
|||
of the License. |
|||
|
|||
This program is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|||
Library General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU Library General Public |
|||
License along with this library; if not, write to the Free |
|||
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
|||
MA 02111-1307, USA */ |
|||
|
|||
#ifndef _my_handler_h |
|||
#define _my_handler_h |
|||
|
|||
#include "myisampack.h" |
|||
#ifdef __cplusplus |
|||
extern "C" { |
|||
#endif |
|||
|
|||
/* |
|||
There is a hard limit for the maximum number of keys as there are only |
|||
8 bits in the index file header for the number of keys in a table. |
|||
This means that 0..255 keys can exist for a table. The idea of |
|||
HA_MAX_POSSIBLE_KEY is to ensure that one can use myisamchk & tools on |
|||
a MyISAM table for which one has more keys than MyISAM is normally |
|||
compiled for. If you don't have this, you will get a core dump when |
|||
running myisamchk compiled for 128 keys on a table with 255 keys. |
|||
*/ |
|||
|
|||
#define HA_MAX_POSSIBLE_KEY 255 /* For myisamchk */ |
|||
/* |
|||
The following defines can be increased if necessary. |
|||
But beware the dependency of MI_MAX_POSSIBLE_KEY_BUFF and HA_MAX_KEY_LENGTH. |
|||
*/ |
|||
|
|||
#define HA_MAX_KEY_LENGTH 1000 /* Max length in bytes */ |
|||
#define HA_MAX_KEY_SEG 16 /* Max segments for key */ |
|||
|
|||
#define HA_MAX_POSSIBLE_KEY_BUFF (HA_MAX_KEY_LENGTH + 24+ 6+6) |
|||
#define HA_MAX_KEY_BUFF (HA_MAX_KEY_LENGTH+HA_MAX_KEY_SEG*6+8+8) |
|||
|
|||
typedef struct st_HA_KEYSEG /* Key-portion */ |
|||
{ |
|||
CHARSET_INFO *charset; |
|||
uint32 start; /* Start of key in record */ |
|||
uint32 null_pos; /* position to NULL indicator */ |
|||
uint16 bit_pos; /* Position to bit part */ |
|||
uint16 flag; |
|||
uint16 length; /* Keylength */ |
|||
uint8 type; /* Type of key (for sort) */ |
|||
uint8 language; |
|||
uint8 null_bit; /* bitmask to test for NULL */ |
|||
uint8 bit_start,bit_end; /* if bit field */ |
|||
uint8 bit_length; /* Length of bit part */ |
|||
} HA_KEYSEG; |
|||
|
|||
#define get_key_length(length,key) \ |
|||
{ if (*(uchar*) (key) != 255) \ |
|||
length= (uint) *(uchar*) ((key)++); \ |
|||
else \ |
|||
{ length= mi_uint2korr((key)+1); (key)+=3; } \ |
|||
} |
|||
|
|||
#define get_key_length_rdonly(length,key) \ |
|||
{ if (*(uchar*) (key) != 255) \ |
|||
length= ((uint) *(uchar*) ((key))); \ |
|||
else \ |
|||
{ length= mi_uint2korr((key)+1); } \ |
|||
} |
|||
|
|||
#define get_key_pack_length(length,length_pack,key) \ |
|||
{ if (*(uchar*) (key) != 255) \ |
|||
{ length= (uint) *(uchar*) ((key)++); length_pack= 1; }\ |
|||
else \ |
|||
{ length=mi_uint2korr((key)+1); (key)+= 3; length_pack= 3; } \ |
|||
} |
|||
|
|||
#define store_key_length_inc(key,length) \ |
|||
{ if ((length) < 255) \ |
|||
{ *(key)++= (length); } \ |
|||
else \ |
|||
{ *(key)=255; mi_int2store((key)+1,(length)); (key)+=3; } \ |
|||
} |
|||
|
|||
#define size_to_store_key_length(length) ((length) < 255 ? 1 : 3) |
|||
|
|||
#define get_rec_bits(bit_ptr, bit_ofs, bit_len) \ |
|||
(((((uint16) (bit_ptr)[1] << 8) | (uint16) (bit_ptr)[0]) >> (bit_ofs)) & \ |
|||
((1 << (bit_len)) - 1)) |
|||
|
|||
#define set_rec_bits(bits, bit_ptr, bit_ofs, bit_len) \ |
|||
{ \ |
|||
(bit_ptr)[0]= ((bit_ptr)[0] & ~(((1 << (bit_len)) - 1) << (bit_ofs))) | \ |
|||
((bits) << (bit_ofs)); \ |
|||
if ((bit_ofs) + (bit_len) > 8) \ |
|||
(bit_ptr)[1]= ((bit_ptr)[1] & ~((1 << ((bit_len) - 8 + (bit_ofs))) - 1)) | \ |
|||
((bits) >> (8 - (bit_ofs))); \ |
|||
} |
|||
|
|||
#define clr_rec_bits(bit_ptr, bit_ofs, bit_len) \ |
|||
set_rec_bits(0, bit_ptr, bit_ofs, bit_len) |
|||
|
|||
extern int ha_compare_text(CHARSET_INFO *, uchar *, uint, uchar *, uint , |
|||
my_bool, my_bool); |
|||
extern int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a, |
|||
register uchar *b, uint key_length, uint nextflag, |
|||
uint *diff_pos); |
|||
|
|||
extern HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a); |
|||
extern void my_handler_error_register(void); |
|||
extern void my_handler_error_unregister(void); |
|||
/* |
|||
Inside an in-memory data record, memory pointers to pieces of the |
|||
record (like BLOBs) are stored in their native byte order and in |
|||
this amount of bytes. |
|||
*/ |
|||
#define portable_sizeof_char_ptr 8 |
|||
#ifdef __cplusplus |
|||
} |
|||
#endif |
|||
|
|||
#endif /* _my_handler_h */ |
|||
@ -1 +1 @@ |
|||
--read_buffer_size=12K --max_allowed_packet=8K |
|||
--read_buffer_size=12K --max_allowed_packet=8K --net-buffer-length=8K |
|||
@ -1 +1 @@ |
|||
--max_allowed_packet=8K |
|||
--max_allowed_packet=8K --net-buffer-length=8K |
|||
27
mysql-test/t/variables-notembedded.test
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,113 +0,0 @@ |
|||
/* Copyright (C) 2002, 2004 MySQL AB |
|||
|
|||
This library is free software; you can redistribute it and/or |
|||
modify it under the terms of the GNU Library General Public |
|||
License as published by the Free Software Foundation; version 2 |
|||
of the License. |
|||
|
|||
This library is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|||
Library General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU Library General Public |
|||
License along with this library; if not, write to the Free |
|||
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
|||
MA 02111-1307, USA */ |
|||
|
|||
/* Thread safe version of gethostbyname_r() */ |
|||
|
|||
#include "mysys_priv.h" |
|||
#if !defined(__WIN__) |
|||
#include <netdb.h> |
|||
#endif |
|||
#include <my_net.h> |
|||
|
|||
/* This file is not needed if my_gethostbyname_r is a macro */ |
|||
#if !defined(my_gethostbyname_r) |
|||
|
|||
/* |
|||
Emulate SOLARIS style calls, not because it's better, but just to make the |
|||
usage of getbostbyname_r simpler. |
|||
*/ |
|||
|
|||
#if defined(HAVE_GETHOSTBYNAME_R) |
|||
|
|||
#if defined(HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE) |
|||
|
|||
struct hostent *my_gethostbyname_r(const char *name, |
|||
struct hostent *result, char *buffer, |
|||
int buflen, int *h_errnop) |
|||
{ |
|||
struct hostent *hp; |
|||
DBUG_ASSERT((size_t) buflen >= sizeof(*result)); |
|||
if (gethostbyname_r(name,result, buffer, (size_t) buflen, &hp, h_errnop)) |
|||
return 0; |
|||
return hp; |
|||
} |
|||
|
|||
#elif defined(HAVE_GETHOSTBYNAME_R_RETURN_INT) |
|||
|
|||
struct hostent *my_gethostbyname_r(const char *name, |
|||
struct hostent *result, char *buffer, |
|||
int buflen, int *h_errnop) |
|||
{ |
|||
if (gethostbyname_r(name,result,(struct hostent_data *) buffer) == -1) |
|||
{ |
|||
*h_errnop= errno; |
|||
return 0; |
|||
} |
|||
return result; |
|||
} |
|||
|
|||
#else |
|||
|
|||
/* gethostbyname_r with similar interface as gethostbyname() */ |
|||
|
|||
struct hostent *my_gethostbyname_r(const char *name, |
|||
struct hostent *result, char *buffer, |
|||
int buflen, int *h_errnop) |
|||
{ |
|||
struct hostent *hp; |
|||
DBUG_ASSERT(buflen >= sizeof(struct hostent_data)); |
|||
hp= gethostbyname_r(name,result,(struct hostent_data *) buffer); |
|||
*h_errnop= errno; |
|||
return hp; |
|||
} |
|||
#endif /* GLIBC2_STYLE_GETHOSTBYNAME_R */ |
|||
|
|||
#else /* !HAVE_GETHOSTBYNAME_R */ |
|||
|
|||
#ifdef THREAD |
|||
extern pthread_mutex_t LOCK_gethostbyname_r; |
|||
#endif |
|||
|
|||
/* |
|||
No gethostbyname_r() function exists. |
|||
In this case we have to keep a mutex over the call to ensure that no |
|||
other thread is going to reuse the internal memory. |
|||
|
|||
The user is responsible to call my_gethostbyname_r_free() when he |
|||
is finished with the structure. |
|||
*/ |
|||
|
|||
struct hostent *my_gethostbyname_r(const char *name, |
|||
struct hostent *res __attribute__((unused)), |
|||
char *buffer __attribute__((unused)), |
|||
int buflen __attribute__((unused)), |
|||
int *h_errnop) |
|||
{ |
|||
struct hostent *hp; |
|||
pthread_mutex_lock(&LOCK_gethostbyname_r); |
|||
hp= gethostbyname(name); |
|||
*h_errnop= h_errno; |
|||
return hp; |
|||
} |
|||
|
|||
void my_gethostbyname_r_free() |
|||
{ |
|||
pthread_mutex_unlock(&LOCK_gethostbyname_r); |
|||
} |
|||
|
|||
#endif /* !HAVE_GETHOSTBYNAME_R */ |
|||
#endif /* !my_gethostbyname_r */ |
|||
@ -1,40 +0,0 @@ |
|||
/* Copyright (C) 2002 MySQL AB |
|||
|
|||
This library is free software; you can redistribute it and/or |
|||
modify it under the terms of the GNU Library General Public |
|||
License as published by the Free Software Foundation; version 2 |
|||
of the License. |
|||
|
|||
This library is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|||
Library General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU Library General Public |
|||
License along with this library; if not, write to the Free |
|||
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
|||
MA 02111-1307, USA */ |
|||
|
|||
/* |
|||
Small functions to make code portable |
|||
*/ |
|||
|
|||
#include "mysys_priv.h" |
|||
|
|||
#ifdef _AIX |
|||
|
|||
/* |
|||
On AIX, at least with gcc 3.1, the expression |
|||
'(double) (ulonglong) var' doesn't always work for big unsigned |
|||
integers like '18446744073709551615'. The end result is that the |
|||
high bit is simply dropped. (probably bug in gcc optimizations) |
|||
Handling the conversion in a sub function seems to work. |
|||
*/ |
|||
|
|||
|
|||
|
|||
double my_ulonglong2double(unsigned long long nr) |
|||
{ |
|||
return (double) nr; |
|||
} |
|||
#endif /* _AIX */ |
|||
@ -0,0 +1,18 @@ |
|||
@echo off |
|||
|
|||
REM Copyright (c) 2006,2010 Oracle and/or its affiliates. All rights reserved. |
|||
REM |
|||
REM This program is free software; you can redistribute it and/or modify |
|||
REM it under the terms of the GNU General Public License as published by |
|||
REM the Free Software Foundation; version 2 of the License. |
|||
REM |
|||
REM This program is distributed in the hope that it will be useful, |
|||
REM but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
REM GNU General Public License for more details. |
|||
REM |
|||
REM You should have received a copy of the GNU General Public License |
|||
REM along with this program; if not, write to the Free Software |
|||
REM Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|||
cmake -G "Visual Studio 10" |
|||
|
|||
@ -0,0 +1,18 @@ |
|||
@echo off |
|||
|
|||
REM Copyright (c) 2006,2010 Oracle and/or its affiliates. All rights reserved. |
|||
REM |
|||
REM This program is free software; you can redistribute it and/or modify |
|||
REM it under the terms of the GNU General Public License as published by |
|||
REM the Free Software Foundation; version 2 of the License. |
|||
REM |
|||
REM This program is distributed in the hope that it will be useful, |
|||
REM but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
REM GNU General Public License for more details. |
|||
REM |
|||
REM You should have received a copy of the GNU General Public License |
|||
REM along with this program; if not, write to the Free Software |
|||
REM Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|||
cmake -G "Visual Studio 10 Win64" |
|||
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue