Skip to content

Commit cd75806

Browse files
author
jani@a88-113-38-195.elisa-laajakaista.fi
committed
Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1
into a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1
2 parents ad7b10c + 25e481a commit cd75806

251 files changed

Lines changed: 3798 additions & 3573 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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2080,6 +2080,7 @@ storage/archive/.deps/ha_archive_la-azio.Plo
20802080
storage/archive/.deps/ha_archive_la-ha_archive.Plo
20812081
storage/archive/.deps/libarchive_a-azio.Po
20822082
storage/archive/.deps/libarchive_a-ha_archive.Po
2083+
storage/archive/archive_reader
20832084
storage/archive/archive_test
20842085
storage/bdb/*.ds?
20852086
storage/bdb/*.vcproj

BUILD/SETUP.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ if [ "x$warning_mode" != "xpedantic" ]; then
9393
warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W"
9494
warnings="$warnings -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare"
9595
warnings="$warnings -Wwrite-strings -Wunused-function -Wunused-label -Wunused-value -Wunused-variable"
96+
97+
# For more warnings, uncomment the following line
98+
# warnings="$global_warnings -Wshadow"
99+
96100
# C warnings
97101
c_warnings="$warnings -Wunused-parameter"
98102
# C++ warnings
@@ -191,6 +195,12 @@ fi
191195
# (http://samba.org/ccache) is installed, use it.
192196
# We use 'grep' and hope 'grep' will work as expected
193197
# (returns 0 if finds lines)
198+
if test "$USING_GCOV" != "1"
199+
then
200+
# Not using gcov; Safe to use ccache
201+
CCACHE_GCOV_VERSION_ENABLED=1
202+
fi
203+
194204
if ccache -V > /dev/null 2>&1 && test "$CCACHE_GCOV_VERSION_ENABLED" = "1"
195205
then
196206
echo "$CC" | grep "ccache" > /dev/null || CC="ccache $CC"

BUILD/compile-pentium-gcov

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# Need to disable ccache, or we loose the gcov-needed compiler output files.
44

5+
USING_GCOV=1
56
CCACHE_GCOV_VERSION_ENABLED=0
67
if ccache -V > /dev/null 2>&1
78
then
@@ -26,8 +27,10 @@ export LDFLAGS="-fprofile-arcs -ftest-coverage"
2627
# The -fprofile-arcs and -ftest-coverage options cause GCC to instrument the
2728
# code with profiling information used by gcov.
2829
# the -DDISABLE_TAO_ASM is needed to avoid build failures in Yassl.
29-
extra_flags="$pentium_cflags -fprofile-arcs -ftest-coverage -DDISABLE_TAO_ASM -DHAVE_MUTEX_THREAD_ONLY $debug_extra_flags"
30+
extra_flags="$pentium_cflags -fprofile-arcs -ftest-coverage -DDISABLE_TAO_ASM -DHAVE_MUTEX_THREAD_ONLY $debug_extra_flags $debug_cflags $max_cflags -DMYSQL_SERVER_SUFFIX=-gcov"
3031
extra_configs="$pentium_configs $debug_configs --disable-shared $static_link"
3132
extra_configs="$extra_configs $max_configs"
33+
c_warnings="$c_warnings $debug_extra_warnings"
34+
cxx_warnings="$cxx_warnings $debug_extra_warnings"
3235

3336
. "$path/FINISH.sh"

client/mysql.cc

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ typedef enum enum_info_type INFO_TYPE;
131131
static MYSQL mysql; /* The connection */
132132
static my_bool info_flag=0,ignore_errors=0,wait_flag=0,quick=0,
133133
connected=0,opt_raw_data=0,unbuffered=0,output_tables=0,
134-
rehash=1,skip_updates=0,safe_updates=0,one_database=0,
134+
opt_rehash=1,skip_updates=0,safe_updates=0,one_database=0,
135135
opt_compress=0, using_opt_local_infile=0,
136136
vertical=0, line_numbers=1, column_names=1,opt_html=0,
137137
opt_xml=0,opt_nopager=1, opt_outfile=0, named_cmds= 0,
@@ -591,7 +591,8 @@ static struct my_option my_long_options[] =
591591
#endif
592592
{"auto-rehash", OPT_AUTO_REHASH,
593593
"Enable automatic rehashing. One doesn't need to use 'rehash' to get table and field completion, but startup and reconnecting may take a longer time. Disable with --disable-auto-rehash.",
594-
(gptr*) &rehash, (gptr*) &rehash, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
594+
(gptr*) &opt_rehash, (gptr*) &opt_rehash, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
595+
0, 0},
595596
{"no-auto-rehash", 'A',
596597
"No automatic rehashing. One has to use 'rehash' to get table and field completion. This gives a quicker start of mysql and disables rehashing on reconnect. WARNING: options deprecated; use --disable-auto-rehash instead.",
597598
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -898,7 +899,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
898899
}
899900
break;
900901
case 'A':
901-
rehash= 0;
902+
opt_rehash= 0;
902903
break;
903904
case 'N':
904905
column_names= 0;
@@ -1756,15 +1757,17 @@ char *rindex(const char *s,int c)
17561757

17571758
static int reconnect(void)
17581759
{
1760+
/* purecov: begin tested */
17591761
if (opt_reconnect)
17601762
{
17611763
put_info("No connection. Trying to reconnect...",INFO_INFO);
17621764
(void) com_connect((String *) 0, 0);
1763-
if (rehash)
1765+
if (opt_rehash)
17641766
com_rehash(NULL, NULL);
17651767
}
17661768
if (!connected)
17671769
return put_info("Can't connect to the server\n",INFO_ERROR);
1770+
/* purecov: end */
17681771
return 0;
17691772
}
17701773

@@ -2933,7 +2936,7 @@ static int
29332936
com_connect(String *buffer, char *line)
29342937
{
29352938
char *tmp, buff[256];
2936-
bool save_rehash= rehash;
2939+
bool save_rehash= opt_rehash;
29372940
int error;
29382941

29392942
bzero(buff, sizeof(buff));
@@ -2957,13 +2960,16 @@ com_connect(String *buffer, char *line)
29572960
}
29582961
}
29592962
else
2960-
rehash= 0; // Quick re-connect
2963+
{
2964+
/* Quick re-connect */
2965+
opt_rehash= 0; /* purecov: tested */
2966+
}
29612967
buffer->length(0); // command used
29622968
}
29632969
else
2964-
rehash= 0;
2970+
opt_rehash= 0;
29652971
error=sql_connect(current_host,current_db,current_user,opt_password,0);
2966-
rehash= save_rehash;
2972+
opt_rehash= save_rehash;
29672973

29682974
if (connected)
29692975
{
@@ -3125,7 +3131,7 @@ com_use(String *buffer __attribute__((unused)), char *line)
31253131
current_db=my_strdup(tmp,MYF(MY_WME));
31263132
#ifdef HAVE_READLINE
31273133
if (select_db > 1)
3128-
build_completion_hash(rehash, 1);
3134+
build_completion_hash(opt_rehash, 1);
31293135
#endif
31303136
}
31313137

@@ -3279,7 +3285,7 @@ sql_real_connect(char *host,char *database,char *user,char *password,
32793285
mysql.reconnect= 1;
32803286
#endif
32813287
#ifdef HAVE_READLINE
3282-
build_completion_hash(rehash, 1);
3288+
build_completion_hash(opt_rehash, 1);
32833289
#endif
32843290
return 0;
32853291
}
@@ -3324,8 +3330,8 @@ static int
33243330
com_status(String *buffer __attribute__((unused)),
33253331
char *line __attribute__((unused)))
33263332
{
3327-
const char *status;
3328-
char buff[22];
3333+
const char *status_str;
3334+
char buff[40];
33293335
ulonglong id;
33303336
MYSQL_RES *result;
33313337
LINT_INIT(result);
@@ -3351,9 +3357,9 @@ com_status(String *buffer __attribute__((unused)),
33513357
mysql_free_result(result);
33523358
}
33533359
#ifdef HAVE_OPENSSL
3354-
if ((status= mysql_get_ssl_cipher(&mysql)))
3360+
if ((status_str= mysql_get_ssl_cipher(&mysql)))
33553361
tee_fprintf(stdout, "SSL:\t\t\tCipher in use is %s\n",
3356-
status);
3362+
status_str);
33573363
else
33583364
#endif /* HAVE_OPENSSL */
33593365
tee_puts("SSL:\t\t\tNot in use", stdout);
@@ -3412,23 +3418,20 @@ com_status(String *buffer __attribute__((unused)),
34123418
tee_fprintf(stdout, "Protocol:\t\tCompressed\n");
34133419
#endif
34143420

3415-
if ((status=mysql_stat(&mysql)) && !mysql_error(&mysql)[0])
3421+
if ((status_str= mysql_stat(&mysql)) && !mysql_error(&mysql)[0])
34163422
{
34173423
ulong sec;
3418-
char buff[40];
3419-
const char *pos= strchr(status,' ');
3424+
const char *pos= strchr(status_str,' ');
34203425
/* print label */
3421-
tee_fprintf(stdout, "%.*s\t\t\t", (int) (pos-status), status);
3422-
if ((status=str2int(pos,10,0,LONG_MAX,(long*) &sec)))
3426+
tee_fprintf(stdout, "%.*s\t\t\t", (int) (pos-status_str), status_str);
3427+
if ((status_str= str2int(pos,10,0,LONG_MAX,(long*) &sec)))
34233428
{
34243429
nice_time((double) sec,buff,0);
34253430
tee_puts(buff, stdout); /* print nice time */
3426-
while (*status == ' ') status++; /* to next info */
3427-
}
3428-
if (status)
3429-
{
3431+
while (*status_str == ' ')
3432+
status_str++; /* to next info */
34303433
tee_putc('\n', stdout);
3431-
tee_puts(status, stdout);
3434+
tee_puts(status_str, stdout);
34323435
}
34333436
}
34343437
if (safe_updates)
@@ -3448,7 +3451,7 @@ select_limit, max_join_size);
34483451
}
34493452

34503453
static const char *
3451-
server_version_string(MYSQL *mysql)
3454+
server_version_string(MYSQL *con)
34523455
{
34533456
static char buf[MAX_SERVER_VERSION_LENGTH] = "";
34543457

@@ -3458,11 +3461,11 @@ server_version_string(MYSQL *mysql)
34583461
char *bufp = buf;
34593462
MYSQL_RES *result;
34603463

3461-
bufp = strnmov(buf, mysql_get_server_info(mysql), sizeof buf);
3464+
bufp= strnmov(buf, mysql_get_server_info(con), sizeof buf);
34623465

34633466
/* "limit 1" is protection against SQL_SELECT_LIMIT=0 */
3464-
if (!mysql_query(mysql, "select @@version_comment limit 1") &&
3465-
(result = mysql_use_result(mysql)))
3467+
if (!mysql_query(con, "select @@version_comment limit 1") &&
3468+
(result = mysql_use_result(con)))
34663469
{
34673470
MYSQL_ROW cur = mysql_fetch_row(result);
34683471
if (cur && cur[0])
@@ -3552,10 +3555,10 @@ put_info(const char *str,INFO_TYPE info_type, uint error, const char *sqlstate)
35523555

35533556

35543557
static int
3555-
put_error(MYSQL *mysql)
3558+
put_error(MYSQL *con)
35563559
{
3557-
return put_info(mysql_error(mysql), INFO_ERROR, mysql_errno(mysql),
3558-
mysql_sqlstate(mysql));
3560+
return put_info(mysql_error(con), INFO_ERROR, mysql_errno(con),
3561+
mysql_sqlstate(con));
35593562
}
35603563

35613564

@@ -3802,8 +3805,6 @@ static const char* construct_prompt()
38023805
break;
38033806
case 'D':
38043807
char* dateTime;
3805-
time_t lclock;
3806-
lclock = time(NULL);
38073808
dateTime = ctime(&lclock);
38083809
processed_prompt.append(strtok(dateTime,"\n"));
38093810
break;

client/mysql_upgrade.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,9 @@ int main(int argc, char **argv)
449449

450450
char *forced_defaults_file;
451451
char *forced_extra_defaults;
452-
char *defaults_group_suffix;
452+
char *local_defaults_group_suffix;
453453
const char *script_line;
454-
char *upgrade_defaults_path;
454+
char *upgrade_defaults_path= 0;
455455
char *defaults_to_use= NULL;
456456
int upgrade_defaults_created= 0;
457457

@@ -466,7 +466,7 @@ int main(int argc, char **argv)
466466
/* Check if we are forced to use specific defaults */
467467
get_defaults_options(argc, argv,
468468
&forced_defaults_file, &forced_extra_defaults,
469-
&defaults_group_suffix);
469+
&local_defaults_group_suffix);
470470

471471
load_defaults("my", load_default_groups, &argc, &argv);
472472

0 commit comments

Comments
 (0)