Skip to content

Commit 428e28e

Browse files
author
Ignacio Galarza
committed
auto-merge
2 parents 2d9421c + ec39e58 commit 428e28e

426 files changed

Lines changed: 27120 additions & 5534 deletions

File tree

Some content is hidden

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

.bzrignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,6 +1295,8 @@ mysql-test/linux_sys_vars.inc
12951295
mysql-test/load_sysvars.inc
12961296
mysql-test/mtr
12971297
mysql-test/mysql-test-run
1298+
mysql-test/mysql-test-gcov.err
1299+
mysql-test/mysql-test-gcov.msg
12981300
mysql-test/mysql-test-run-shell
12991301
mysql-test/mysql-test-run.log
13001302
mysql-test/mysql_test_run_new

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,13 @@ IF(MSVC)
144144
STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
145145
STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_INIT ${CMAKE_CXX_FLAGS_INIT})
146146
STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS_DEBUG_INIT ${CMAKE_CXX_FLAGS_DEBUG_INIT})
147-
147+
148+
# Mark 32 bit executables large address aware so they can
149+
# use > 2GB address space
150+
IF(CMAKE_SIZEOF_VOID_P MATCHES 4)
151+
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
152+
ENDIF(CMAKE_SIZEOF_VOID_P MATCHES 4)
153+
148154
# Disable automatic manifest generation.
149155
STRING(REPLACE "/MANIFEST" "/MANIFEST:NO" CMAKE_EXE_LINKER_FLAGS
150156
${CMAKE_EXE_LINKER_FLAGS})

client/mysql.cc

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ static COMMANDS commands[] = {
250250
{ "connect",'r', com_connect,1,
251251
"Reconnect to the server. Optional arguments are db and host." },
252252
{ "delimiter", 'd', com_delimiter, 1,
253-
"Set statement delimiter. NOTE: Takes the rest of the line as new delimiter." },
253+
"Set statement delimiter." },
254254
#ifdef USE_POPEN
255255
{ "edit", 'e', com_edit, 0, "Edit command with $EDITOR."},
256256
#endif
@@ -2245,8 +2245,22 @@ static bool add_line(String &buffer,char *line,char *in_string,
22452245
}
22462246
if (out != line || !buffer.is_empty())
22472247
{
2248-
*out++='\n';
22492248
uint length=(uint) (out-line);
2249+
2250+
if (length < 9 ||
2251+
my_strnncoll (charset_info,
2252+
(uchar *)line, 9, (const uchar *) "delimiter", 9))
2253+
{
2254+
/*
2255+
Don't add a new line in case there's a DELIMITER command to be
2256+
added to the glob buffer (e.g. on processing a line like
2257+
"<command>;DELIMITER <non-eof>") : similar to how a new line is
2258+
not added in the case when the DELIMITER is the first command
2259+
entered with an empty glob buffer.
2260+
*/
2261+
*out++='\n';
2262+
length++;
2263+
}
22502264
if (buffer.length() + length >= buffer.alloced_length())
22512265
buffer.realloc(buffer.length()+length+IO_SIZE);
22522266
if ((!*ml_comment || preserve_comments) && buffer.append(line, length))
@@ -2855,7 +2869,7 @@ com_charset(String *buffer __attribute__((unused)), char *line)
28552869
param= get_arg(buff, 0);
28562870
if (!param || !*param)
28572871
{
2858-
return put_info("Usage: \\C char_setname | charset charset_name",
2872+
return put_info("Usage: \\C charset_name | charset charset_name",
28592873
INFO_ERROR, 0);
28602874
}
28612875
new_cs= get_charset_by_csname(param, MY_CS_PRIMARY, MYF(MY_WME));

client/mysqldump.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
1+
/* Copyright 2000-2008 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -1475,7 +1475,8 @@ static int connect_to_db(char *host, char *user,char *passwd)
14751475
DB_error(&mysql_connection, "when trying to connect");
14761476
DBUG_RETURN(1);
14771477
}
1478-
if (mysql_get_server_version(&mysql_connection) < 40100)
1478+
if ((mysql_get_server_version(&mysql_connection) < 40100) ||
1479+
(opt_compatible_mode & 3))
14791480
{
14801481
/* Don't dump SET NAMES with a pre-4.1 server (bug#7997). */
14811482
opt_set_charset= 0;
@@ -2421,11 +2422,11 @@ static uint get_table_structure(char *table, char *db, char *table_type,
24212422

24222423
row= mysql_fetch_row(result);
24232424

2424-
fprintf(sql_file,
2425-
"SET @saved_cs_client = @@character_set_client;\n"
2426-
"SET character_set_client = utf8;\n"
2425+
fprintf(sql_file, (opt_compatible_mode & 3) ? "%s;\n" :
2426+
"/*!40101 SET @saved_cs_client = @@character_set_client */;\n"
2427+
"/*!40101 SET character_set_client = utf8 */;\n"
24272428
"%s;\n"
2428-
"SET character_set_client = @saved_cs_client;\n",
2429+
"/*!40101 SET character_set_client = @saved_cs_client */;\n",
24292430
row[1]);
24302431

24312432
check_io(sql_file);

client/mysqltest.cc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4647,6 +4647,10 @@ void safe_connect(MYSQL* mysql, const char *name, const char *host,
46474647
int failed_attempts= 0;
46484648

46494649
DBUG_ENTER("safe_connect");
4650+
4651+
verbose_msg("Connecting to server %s:%d (socket %s) as '%s'"
4652+
", connection '%s', attempt %d ...",
4653+
host, port, sock, user, name, failed_attempts);
46504654
while(!mysql_real_connect(mysql, host,user, pass, db, port, sock,
46514655
CLIENT_MULTI_STATEMENTS | CLIENT_REMEMBER_OPTIONS))
46524656
{
@@ -4678,6 +4682,7 @@ void safe_connect(MYSQL* mysql, const char *name, const char *host,
46784682
}
46794683
failed_attempts++;
46804684
}
4685+
verbose_msg("... Connected.");
46814686
DBUG_VOID_RETURN;
46824687
}
46834688

@@ -7511,8 +7516,12 @@ int main(int argc, char **argv)
75117516
parse_args(argc, argv);
75127517

75137518
log_file.open(opt_logdir, result_file_name, ".log");
7519+
verbose_msg("Logging to '%s'.", log_file.file_name());
75147520
if (opt_mark_progress)
7521+
{
75157522
progress_file.open(opt_logdir, result_file_name, ".progress");
7523+
verbose_msg("Tracing progress in '%s'.", progress_file.file_name());
7524+
}
75167525

75177526
var_set_int("$PS_PROTOCOL", ps_protocol);
75187527
var_set_int("$SP_PROTOCOL", sp_protocol);
@@ -7521,6 +7530,8 @@ int main(int argc, char **argv)
75217530

75227531
DBUG_PRINT("info",("result_file: '%s'",
75237532
result_file_name ? result_file_name : ""));
7533+
verbose_msg("Results saved in '%s'.",
7534+
result_file_name ? result_file_name : "");
75247535
if (mysql_server_init(embedded_server_arg_count,
75257536
embedded_server_args,
75267537
(char**) embedded_server_groups))
@@ -7591,6 +7602,7 @@ int main(int argc, char **argv)
75917602
open_file(opt_include);
75927603
}
75937604

7605+
verbose_msg("Start processing test commands from '%s' ...", cur_file->file_name);
75947606
while (!read_command(&command) && !abort_flag)
75957607
{
75967608
int current_line_inc = 1, processed = 0;
@@ -7908,6 +7920,7 @@ int main(int argc, char **argv)
79087920
log_file.close();
79097921

79107922
start_lineno= 0;
7923+
verbose_msg("... Done processing test commands.");
79117924

79127925
if (parsing_disabled)
79137926
die("Test ended with parsing disabled");
@@ -7958,6 +7971,7 @@ int main(int argc, char **argv)
79587971
if (!command_executed && result_file_name)
79597972
die("No queries executed but result file found!");
79607973

7974+
verbose_msg("Test has succeeded!");
79617975
timer_output();
79627976
/* Yes, if we got this far the test has suceeded! Sakila smiles */
79637977
cleanup_and_exit(0);

client/sql_string.cc

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,25 +71,22 @@ bool String::realloc(uint32 alloc_length)
7171
char *new_ptr;
7272
if (alloced)
7373
{
74-
if ((new_ptr= (char*) my_realloc(Ptr,len,MYF(MY_WME))))
75-
{
76-
Ptr=new_ptr;
77-
Alloced_length=len;
78-
}
79-
else
80-
return TRUE; // Signal error
74+
if (!(new_ptr= (char*) my_realloc(Ptr,len,MYF(MY_WME))))
75+
return TRUE; // Signal error
8176
}
8277
else if ((new_ptr= (char*) my_malloc(len,MYF(MY_WME))))
8378
{
79+
if (str_length > len - 1)
80+
str_length= 0;
8481
if (str_length) // Avoid bugs in memcpy on AIX
8582
memcpy(new_ptr,Ptr,str_length);
8683
new_ptr[str_length]=0;
87-
Ptr=new_ptr;
88-
Alloced_length=len;
8984
alloced=1;
9085
}
9186
else
9287
return TRUE; // Signal error
88+
Ptr= new_ptr;
89+
Alloced_length= len;
9390
}
9491
Ptr[alloc_length]=0; // This make other funcs shorter
9592
return FALSE;
@@ -125,7 +122,7 @@ bool String::set(double num,uint decimals, CHARSET_INFO *cs)
125122
str_charset=cs;
126123
if (decimals >= NOT_FIXED_DEC)
127124
{
128-
uint32 len= my_sprintf(buff,(buff, "%.14g",num));// Enough for a DATETIME
125+
uint32 len= my_sprintf(buff,(buff, "%.15g",num));// Enough for a DATETIME
129126
return copy(buff, len, &my_charset_latin1, cs, &dummy_errors);
130127
}
131128
#ifdef HAVE_FCONVERT
@@ -677,7 +674,7 @@ void String::qs_append(const char *str, uint32 len)
677674
void String::qs_append(double d)
678675
{
679676
char *buff = Ptr + str_length;
680-
str_length+= my_sprintf(buff, (buff, "%.14g", d));
677+
str_length+= my_sprintf(buff, (buff, "%.15g", d));
681678
}
682679

683680
void String::qs_append(double *d)

cmd-line-utils/libedit/makelist.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ case $FLAG in
8484
cat $FILES | $AWK '
8585
BEGIN {
8686
printf("/* Automatically generated file, do not edit */\n");
87-
printf("#include \"sys.h\"\n#include \"el.h\"\n");
87+
printf("#include \"config.h\"\n#include \"el.h\"\n");
8888
printf("private const struct el_bindings_t el_func_help[] = {\n");
8989
low = "abcdefghijklmnopqrstuvwxyz_";
9090
high = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_";
@@ -169,7 +169,7 @@ case $FLAG in
169169
cat $FILES | $AWK '/el_action_t/ { print $3 }' | sort | $AWK '
170170
BEGIN {
171171
printf("/* Automatically generated file, do not edit */\n");
172-
printf("#include \"sys.h\"\n#include \"el.h\"\n");
172+
printf("#include \"config.h\"\n#include \"el.h\"\n");
173173
printf("private const el_func_t el_func[] = {");
174174
maxlen = 80;
175175
needn = 1;

cmd-line-utils/libedit/readline.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,10 @@
5151
#else
5252
#include "np/vis.h"
5353
#endif
54-
#ifdef HAVE_ALLOCA_H
55-
#include <alloca.h>
56-
#endif
54+
#include "readline/readline.h"
5755
#include "el.h"
5856
#include "fcns.h" /* for EL_NUM_FCNS */
5957
#include "histedit.h"
60-
#include "readline/readline.h"
6158
#include "filecomplete.h"
6259

6360
void rl_prep_terminal(int);

cmd-line-utils/libedit/readline/readline.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ typedef KEYMAP_ENTRY *Keymap;
6666

6767
#ifndef CTRL
6868
#include <sys/ioctl.h>
69-
#if !defined(__sun__) && !defined(__hpux__)
69+
#if !defined(__sun) && !defined(__hpux) && !defined(_AIX)
7070
#include <sys/ttydefaults.h>
7171
#endif
7272
#ifndef CTRL

cmd-line-utils/libedit/vi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -914,14 +914,14 @@ vi_comment_out(EditLine *el, int c)
914914
* NB: posix implies that we should enter insert mode, however
915915
* this is against historical precedent...
916916
*/
917-
#ifdef __weak_reference
917+
#if defined(__weak_reference) && !defined(__FreeBSD__)
918918
extern char *get_alias_text(const char *) __weak_reference(get_alias_text);
919919
#endif
920920
protected el_action_t
921921
/*ARGSUSED*/
922922
vi_alias(EditLine *el, int c)
923923
{
924-
#ifdef __weak_reference
924+
#if defined(__weak_reference) && !defined(__FreeBSD__)
925925
char alias_name[3];
926926
char *alias_text;
927927

0 commit comments

Comments
 (0)