Skip to content

Commit 38c89b8

Browse files
author
Luis Soares
committed
Automerge from mysql-next-mr.
2 parents fda0ce9 + 19df110 commit 38c89b8

File tree

235 files changed

+6268
-7828
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

235 files changed

+6268
-7828
lines changed

.bzrignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3075,3 +3075,4 @@ dbug/tests
30753075
libmysqld/sys_vars.cc
30763076
libmysqld/keycaches.cc
30773077
client/dtoa.c
3078+
libmysqld/sql_audit.cc

client/mysql.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3612,7 +3612,8 @@ print_table_data_vertically(MYSQL_RES *result)
36123612
for (uint off=0; off < mysql_num_fields(result); off++)
36133613
{
36143614
field= mysql_fetch_field(result);
3615-
tee_fprintf(PAGER, "%*s: ",(int) max_length,field->name);
3615+
if (column_names)
3616+
tee_fprintf(PAGER, "%*s: ",(int) max_length,field->name);
36163617
if (cur[off])
36173618
{
36183619
unsigned int i;
@@ -4282,7 +4283,7 @@ char *get_arg(char *line, my_bool get_next_arg)
42824283
if (*ptr == '\\' && ptr[1]) // escaped character
42834284
{
42844285
// Remove the backslash
4285-
strmov(ptr, ptr+1);
4286+
strmov_overlapp(ptr, ptr+1);
42864287
}
42874288
else if ((!quoted && *ptr == ' ') || (quoted && *ptr == qtype))
42884289
{

client/mysqldump.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ static struct my_option my_long_options[] =
290290
(uchar**) &opt_events, (uchar**) &opt_events, 0, GET_BOOL,
291291
NO_ARG, 0, 0, 0, 0, 0, 0},
292292
{"extended-insert", 'e',
293-
"Allows utilization of the new, much faster INSERT syntax.",
293+
"Use multiple-row INSERT syntax that include several VALUES lists.",
294294
(uchar**) &extended_insert, (uchar**) &extended_insert, 0, GET_BOOL, NO_ARG,
295295
1, 0, 0, 0, 0, 0},
296296
{"fields-terminated-by", OPT_FTB,
@@ -840,7 +840,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
840840
&err_ptr, &err_len);
841841
if (err_len)
842842
{
843-
strmake(buff, err_ptr, min(sizeof(buff), err_len));
843+
strmake(buff, err_ptr, min(sizeof(buff) - 1, err_len));
844844
fprintf(stderr, "Invalid mode to --compatible: %s\n", buff);
845845
exit(1);
846846
}
@@ -4630,7 +4630,7 @@ static ulong find_set(TYPELIB *lib, const char *x, uint length,
46304630

46314631
for (; pos != end && *pos != ','; pos++) ;
46324632
var_len= (uint) (pos - start);
4633-
strmake(buff, start, min(sizeof(buff), var_len));
4633+
strmake(buff, start, min(sizeof(buff) - 1, var_len));
46344634
find= find_type(buff, lib, var_len);
46354635
if (!find)
46364636
{

configure.in

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,22 @@ dnl Process this file with autoconf to produce a configure script.
1616
# along with this program; if not, write to the Free Software
1717
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1818

19-
AC_PREREQ(2.52)dnl Minimum Autoconf version required.
19+
# Minimum Autoconf version required.
20+
AC_PREREQ(2.59)
2021

21-
AC_INIT(sql/mysqld.cc)
22-
AC_CANONICAL_SYSTEM
23-
# The Docs Makefile.am parses this line!
24-
# remember to also update version.c in ndb
25-
#
22+
# Remember to also update version.c in ndb.
2623
# When changing major version number please also check switch statement
2724
# in client/mysqlbinlog.cc:check_master_version().
28-
AM_INIT_AUTOMAKE(mysql, 5.5.99-m3)
29-
AM_CONFIG_HEADER([include/config.h:config.h.in])
25+
AC_INIT([MySQL Server], [5.5.99-m3], [], [mysql])
26+
AC_CONFIG_SRCDIR([sql/mysqld.cc])
27+
AC_CANONICAL_SYSTEM
28+
# USTAR format gives us the possibility to store longer path names in
29+
# TAR files, the path name is split into two parts, a 155 chacater
30+
# first part and a 100 character second part.
31+
AM_INIT_AUTOMAKE([1.9 tar-ustar])
32+
AC_PROG_LIBTOOL
33+
34+
AM_CONFIG_HEADER([include/config.h])
3035

3136
# Request support for automake silent-rules if available.
3237
# Default to verbose output. One can use the configure-time
@@ -46,12 +51,14 @@ NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0
4651
# Remember that regexps needs to quote [ and ] since this is run through m4
4752
# We take some made up examples
4853
#
49-
# VERSION 5.1.40sp1-alpha 5.0.34a
50-
# MYSQL_NO_DASH_VERSION 5.1.40sp1 5.0.34a
51-
# MYSQL_NUMERIC_VERSION 5.1.40 5.0.34
52-
# MYSQL_BASE_VERSION 5.1 5.0
53-
# MYSQL_VERSION_ID 50140 50034
54+
# VERSION 5.1.40sp1-alpha 5.0.34a 5.5.1-m2
55+
# MYSQL_U_SCORE_VERSION 5.1.40sp1_alpha 5.0.34a 5.5.1_m2
56+
# MYSQL_NO_DASH_VERSION 5.1.40sp1 5.0.34a 5.5.1
57+
# MYSQL_NUMERIC_VERSION 5.1.40 5.0.34 5.5.1
58+
# MYSQL_BASE_VERSION 5.1 5.0 5.5
59+
# MYSQL_VERSION_ID 50140 50034 50501
5460
#
61+
MYSQL_U_SCORE_VERSION=`echo $VERSION | sed -e "s|-|_|"`
5562
MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|-.*$||"`
5663
MYSQL_NUMERIC_VERSION=`echo $MYSQL_NO_DASH_VERSION | sed -e "s|[[a-z]][[a-z0-9]]*$||"`
5764
MYSQL_BASE_VERSION=`echo $MYSQL_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
@@ -89,6 +96,7 @@ romanian russian serbian slovak spanish swedish ukrainian"
8996
#####
9097
#####
9198

99+
AC_SUBST(MYSQL_U_SCORE_VERSION)
92100
AC_SUBST(MYSQL_NO_DASH_VERSION)
93101
AC_SUBST(MYSQL_BASE_VERSION)
94102
AC_SUBST(MYSQL_VERSION_ID)

extra/yassl/taocrypt/include/asn.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ class CertDecoder : public BER_Decoder {
305305
bool ValidateSignature(SignerList*);
306306
bool ConfirmSignature(Source&);
307307
void GetKey();
308+
char* AddTag(char*, const char*, const char*, word32, word32);
308309
void GetName(NameType);
309310
void GetValidity();
310311
void GetDate(DateType);

extra/yassl/taocrypt/src/asn.cpp

Lines changed: 68 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -652,18 +652,45 @@ word32 CertDecoder::GetDigest()
652652
}
653653

654654

655+
char *CertDecoder::AddTag(char *ptr, const char *buf_end,
656+
const char *tag_name, word32 tag_name_length,
657+
word32 tag_value_length)
658+
{
659+
if (ptr + tag_name_length + tag_value_length > buf_end)
660+
return 0;
661+
662+
memcpy(ptr, tag_name, tag_name_length);
663+
ptr+= tag_name_length;
664+
665+
memcpy(ptr, source_.get_current(), tag_value_length);
666+
ptr+= tag_value_length;
667+
668+
return ptr;
669+
}
670+
671+
655672
// process NAME, either issuer or subject
656673
void CertDecoder::GetName(NameType nt)
657674
{
658675
if (source_.GetError().What()) return;
659676

660677
SHA sha;
661678
word32 length = GetSequence(); // length of all distinguished names
662-
assert (length < ASN_NAME_MAX);
679+
680+
if (length >= ASN_NAME_MAX)
681+
goto err;
663682
length += source_.get_index();
664683

665-
char* ptr = (nt == ISSUER) ? issuer_ : subject_;
666-
word32 idx = 0;
684+
char *ptr, *buf_end;
685+
686+
if (nt == ISSUER) {
687+
ptr= issuer_;
688+
buf_end= ptr + sizeof(issuer_) - 1; // 1 byte for trailing 0
689+
}
690+
else {
691+
ptr= subject_;
692+
buf_end= ptr + sizeof(subject_) - 1; // 1 byte for trailing 0
693+
}
667694

668695
while (source_.get_index() < length) {
669696
GetSet();
@@ -685,47 +712,36 @@ void CertDecoder::GetName(NameType nt)
685712
byte id = source_.next();
686713
b = source_.next(); // strType
687714
word32 strLen = GetLength(source_);
688-
bool copy = false;
689715

690-
if (id == COMMON_NAME) {
691-
memcpy(&ptr[idx], "/CN=", 4);
692-
idx += 4;
693-
copy = true;
694-
}
695-
else if (id == SUR_NAME) {
696-
memcpy(&ptr[idx], "/SN=", 4);
697-
idx += 4;
698-
copy = true;
699-
}
700-
else if (id == COUNTRY_NAME) {
701-
memcpy(&ptr[idx], "/C=", 3);
702-
idx += 3;
703-
copy = true;
704-
}
705-
else if (id == LOCALITY_NAME) {
706-
memcpy(&ptr[idx], "/L=", 3);
707-
idx += 3;
708-
copy = true;
709-
}
710-
else if (id == STATE_NAME) {
711-
memcpy(&ptr[idx], "/ST=", 4);
712-
idx += 4;
713-
copy = true;
714-
}
715-
else if (id == ORG_NAME) {
716-
memcpy(&ptr[idx], "/O=", 3);
717-
idx += 3;
718-
copy = true;
719-
}
720-
else if (id == ORGUNIT_NAME) {
721-
memcpy(&ptr[idx], "/OU=", 4);
722-
idx += 4;
723-
copy = true;
724-
}
725-
726-
if (copy) {
727-
memcpy(&ptr[idx], source_.get_current(), strLen);
728-
idx += strLen;
716+
switch (id) {
717+
case COMMON_NAME:
718+
if (!(ptr= AddTag(ptr, buf_end, "/CN=", 4, strLen)))
719+
goto err;
720+
break;
721+
case SUR_NAME:
722+
if (!(ptr= AddTag(ptr, buf_end, "/SN=", 4, strLen)))
723+
goto err;
724+
break;
725+
case COUNTRY_NAME:
726+
if (!(ptr= AddTag(ptr, buf_end, "/C=", 3, strLen)))
727+
goto err;
728+
break;
729+
case LOCALITY_NAME:
730+
if (!(ptr= AddTag(ptr, buf_end, "/L=", 3, strLen)))
731+
goto err;
732+
break;
733+
case STATE_NAME:
734+
if (!(ptr= AddTag(ptr, buf_end, "/ST=", 4, strLen)))
735+
goto err;
736+
break;
737+
case ORG_NAME:
738+
if (!(ptr= AddTag(ptr, buf_end, "/O=", 3, strLen)))
739+
goto err;
740+
break;
741+
case ORGUNIT_NAME:
742+
if (!(ptr= AddTag(ptr, buf_end, "/OU=", 4, strLen)))
743+
goto err;
744+
break;
729745
}
730746

731747
sha.Update(source_.get_current(), strLen);
@@ -739,23 +755,20 @@ void CertDecoder::GetName(NameType nt)
739755
source_.advance(oidSz + 1);
740756
word32 length = GetLength(source_);
741757

742-
if (email) {
743-
memcpy(&ptr[idx], "/emailAddress=", 14);
744-
idx += 14;
745-
746-
memcpy(&ptr[idx], source_.get_current(), length);
747-
idx += length;
748-
}
758+
if (email && !(ptr= AddTag(ptr, buf_end, "/emailAddress=", 14, length)))
759+
goto err;
749760

750761
source_.advance(length);
751762
}
752763
}
753-
ptr[idx++] = 0;
764+
*ptr= 0;
754765

755-
if (nt == ISSUER)
756-
sha.Final(issuerHash_);
757-
else
758-
sha.Final(subjectHash_);
766+
sha.Final(nt == ISSUER ? issuerHash_ : subjectHash_);
767+
768+
return;
769+
770+
err:
771+
source_.SetError(CONTENT_E);
759772
}
760773

761774

include/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ BUILT_SOURCES = $(HEADERS_GEN_MAKE) link_sources probes_mysql_nodtrace.h
1919
HEADERS_GEN_CONFIGURE = mysql_version.h
2020
HEADERS_GEN_MAKE = my_config.h
2121
HEADERS_ABI = mysql.h mysql_com.h mysql_time.h \
22-
my_list.h my_alloc.h typelib.h mysql/plugin.h
22+
my_list.h my_alloc.h typelib.h mysql/plugin.h \
23+
mysql/plugin_audit.h mysql/plugin_ftparser.h
2324
pkginclude_HEADERS = $(HEADERS_ABI) my_dbug.h m_string.h my_sys.h \
2425
my_xml.h mysql_embed.h mysql/services.h \
2526
mysql/service_my_snprintf.h mysql/service_thd_alloc.h \

include/config-win.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ typedef SSIZE_T ssize_t;
190190
#define isnan(X) _isnan(X)
191191
#define finite(X) _finite(X)
192192

193-
#ifndef UNDEF_THREAD_HACK
193+
#ifndef MYSQL_CLIENT_NO_THREADS
194194
#define THREAD
195195
#endif
196196
#define VOID_SIGHANDLER

include/m_string.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,7 @@ extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 */
9292
extern char NEAR _dig_vec_upper[];
9393
extern char NEAR _dig_vec_lower[];
9494

95-
#ifdef BAD_STRING_COMPILER
96-
#define strmov(A,B) (memccpy(A,B,0,INT_MAX)-1)
97-
#else
95+
#ifndef strmov
9896
#define strmov_overlapp(A,B) strmov(A,B)
9997
#define strmake_overlapp(A,B,C) strmake(A,B,C)
10098
#endif
@@ -152,12 +150,11 @@ extern size_t strinstr(const char *str,const char *search);
152150
extern size_t r_strinstr(const char *str, size_t from, const char *search);
153151
extern char *strkey(char *dst,char *head,char *tail,char *flags);
154152
extern char *strmake(char *dst,const char *src,size_t length);
155-
#ifndef strmake_overlapp
156-
extern char *strmake_overlapp(char *dst,const char *src, size_t length);
157-
#endif
158153

159154
#ifndef strmov
160155
extern char *strmov(char *dst,const char *src);
156+
#else
157+
extern char *strmov_overlapp(char *dst,const char *src);
161158
#endif
162159
extern char *strnmov(char *dst,const char *src,size_t n);
163160
extern char *strsuff(const char *src,const char *suffix);

include/my_stacktrace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
(defined(__alpha__) && defined(__GNUC__))
2424
#define HAVE_STACKTRACE 1
2525
#endif
26-
#elif defined(__WIN__) || defined(__sun)
26+
#elif defined(__WIN__) || defined(HAVE_PRINTSTACK)
2727
#define HAVE_STACKTRACE 1
2828
#endif
2929

0 commit comments

Comments
 (0)