Skip to content

Commit ac7ba1b

Browse files
author
Alexander Nozdrin
committed
Merge from mysql-next-mr.
2 parents f89b249 + 273a0a4 commit ac7ba1b

331 files changed

Lines changed: 15751 additions & 2542 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.

.bzr-mysql/default.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[MYSQL]
22
post_commit_to = "[email protected]"
33
post_push_to = "[email protected]"
4-
tree_name = "mysql-5.5.0-next-mr-runtime"
4+
tree_name = "mysql-5.5-next-mr-runtime"

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,10 @@ FOREACH(DIR ${DYNAMIC_ENGINE_DIRECTORIES})
291291
ADD_SUBDIRECTORY(${DIR})
292292
ENDFOREACH(DIR ${DYNAMIC_ENGINE_DIRECTORIES})
293293

294+
# Add subdirectories for semisync plugin
295+
IF(NOT WITHOUT_DYNAMIC_PLUGINS)
296+
ADD_SUBDIRECTORY(plugin/semisync)
297+
ENDIF(NOT WITHOUT_DYNAMIC_PLUGINS)
294298

295299
# FIXME "debug" only needed if build type is "Debug", but
296300
# CMAKE_BUILD_TYPE is not set during configure time.

client/my_readline.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#ifndef CLIENT_MY_READLINE_INCLUDED
2+
#define CLIENT_MY_READLINE_INCLUDED
3+
14
/* Copyright (C) 2000 MySQL AB
25
36
This program is free software; you can redistribute it and/or modify
@@ -31,3 +34,5 @@ extern LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file);
3134
extern LINE_BUFFER *batch_readline_command(LINE_BUFFER *buffer, char * str);
3235
extern char *batch_readline(LINE_BUFFER *buffer, bool *truncated);
3336
extern void batch_readline_end(LINE_BUFFER *buffer);
37+
38+
#endif /* CLIENT_MY_READLINE_INCLUDED */

client/mysql.cc

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static my_bool ignore_errors=0,wait_flag=0,quick=0,
141141
vertical=0, line_numbers=1, column_names=1,opt_html=0,
142142
opt_xml=0,opt_nopager=1, opt_outfile=0, named_cmds= 0,
143143
tty_password= 0, opt_nobeep=0, opt_reconnect=1,
144-
default_charset_used= 0, opt_secure_auth= 0,
144+
opt_secure_auth= 0,
145145
default_pager_set= 0, opt_sigint_ignore= 0,
146146
show_warnings= 0, executing_query= 0, interrupted_query= 0,
147147
ignore_spaces= 0;
@@ -155,7 +155,7 @@ static char * opt_mysql_unix_port=0;
155155
static int connect_flag=CLIENT_INTERACTIVE;
156156
static char *current_host,*current_db,*current_user=0,*opt_password=0,
157157
*current_prompt=0, *delimiter_str= 0,
158-
*default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME,
158+
*default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME,
159159
*opt_init_command= 0;
160160
static char *histfile;
161161
static char *histfile_tmp;
@@ -1581,9 +1581,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
15811581
strmake(mysql_charsets_dir, argument, sizeof(mysql_charsets_dir) - 1);
15821582
charsets_dir = mysql_charsets_dir;
15831583
break;
1584-
case OPT_DEFAULT_CHARSET:
1585-
default_charset_used= 1;
1586-
break;
15871584
case OPT_DELIMITER:
15881585
if (argument == disabled_my_option)
15891586
{
@@ -1788,10 +1785,6 @@ static int get_options(int argc, char **argv)
17881785
connect_flag= 0; /* Not in interactive mode */
17891786
}
17901787

1791-
if (strcmp(default_charset, charset_info->csname) &&
1792-
!(charset_info= get_charset_by_csname(default_charset,
1793-
MY_CS_PRIMARY, MYF(MY_WME))))
1794-
exit(1);
17951788
if (argc > 1)
17961789
{
17971790
usage(0);
@@ -2919,7 +2912,6 @@ com_charset(String *buffer __attribute__((unused)), char *line)
29192912
charset_info= new_cs;
29202913
mysql_set_character_set(&mysql, charset_info->csname);
29212914
default_charset= (char *)charset_info->csname;
2922-
default_charset_used= 1;
29232915
put_info("Charset changed", INFO_INFO);
29242916
}
29252917
else put_info("Charset is not found", INFO_INFO);
@@ -4243,8 +4235,9 @@ sql_real_connect(char *host,char *database,char *user,char *password,
42434235
select_limit,max_join_size);
42444236
mysql_options(&mysql, MYSQL_INIT_COMMAND, init_command);
42454237
}
4246-
if (default_charset_used)
4247-
mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
4238+
4239+
mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
4240+
42484241
if (!mysql_real_connect(&mysql, host, user, password,
42494242
database, opt_mysql_port, opt_mysql_unix_port,
42504243
connect_flag | CLIENT_MULTI_STATEMENTS))
@@ -4259,6 +4252,9 @@ sql_real_connect(char *host,char *database,char *user,char *password,
42594252
}
42604253
return -1; // Retryable
42614254
}
4255+
4256+
charset_info= mysql.charset;
4257+
42624258
connected=1;
42634259
#ifndef EMBEDDED_LIBRARY
42644260
mysql.reconnect= debug_info_flag; // We want to know if this happens

client/mysqladmin.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#define MAX_TRUNC_LENGTH 3
3131

3232
char *host= NULL, *user= 0, *opt_password= 0,
33-
*default_charset= NULL;
33+
*default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME;
3434
char truncated_var_names[MAX_MYSQL_VAR][MAX_TRUNC_LENGTH];
3535
char ex_var_names[MAX_MYSQL_VAR][FN_REFLEN];
3636
ulonglong last_values[MAX_MYSQL_VAR];
@@ -348,8 +348,7 @@ int main(int argc,char *argv[])
348348
if (shared_memory_base_name)
349349
mysql_options(&mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
350350
#endif
351-
if (default_charset)
352-
mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
351+
mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
353352
error_flags= (myf)(opt_nobeep ? 0 : ME_BELL);
354353

355354
if (sql_connect(&mysql, option_wait))

client/mysqlbinlog.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,7 +1349,6 @@ static int parse_args(int *argc, char*** argv)
13491349
int ho_error;
13501350

13511351
result_file = stdout;
1352-
load_defaults("my",load_default_groups,argc,argv);
13531352
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
13541353
exit(ho_error);
13551354
if (debug_info_flag)
@@ -2001,8 +2000,9 @@ int main(int argc, char** argv)
20012000

20022001
my_init_time(); // for time functions
20032002

2003+
load_defaults("my", load_default_groups, &argc, &argv);
2004+
defaults_argv= argv;
20042005
parse_args(&argc, (char***)&argv);
2005-
defaults_argv=argv;
20062006

20072007
if (!argc)
20082008
{

client/mysqlcheck.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -369,12 +369,15 @@ static int get_options(int *argc, char ***argv)
369369
If there's no --default-character-set option given with
370370
--fix-table-name or --fix-db-name set the default character set to "utf8".
371371
*/
372-
if (!default_charset && (opt_fix_db_names || opt_fix_table_names))
372+
if (!default_charset)
373373
{
374-
default_charset= (char*) "utf8";
374+
if (opt_fix_db_names || opt_fix_table_names)
375+
default_charset= (char*) "utf8";
376+
else
377+
default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME;
375378
}
376-
if (default_charset && !get_charset_by_csname(default_charset, MY_CS_PRIMARY,
377-
MYF(MY_WME)))
379+
if (strcmp(default_charset, MYSQL_AUTODETECT_CHARSET_NAME) &&
380+
!get_charset_by_csname(default_charset, MY_CS_PRIMARY, MYF(MY_WME)))
378381
{
379382
printf("Unsupported character set: %s\n", default_charset);
380383
return 1;
@@ -798,8 +801,7 @@ static int dbConnect(char *host, char *user, char *passwd)
798801
if (shared_memory_base_name)
799802
mysql_options(&mysql_connection,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
800803
#endif
801-
if (default_charset)
802-
mysql_options(&mysql_connection, MYSQL_SET_CHARSET_NAME, default_charset);
804+
mysql_options(&mysql_connection, MYSQL_SET_CHARSET_NAME, default_charset);
803805
if (!(sock = mysql_real_connect(&mysql_connection, host, user, passwd,
804806
NULL, opt_mysql_port, opt_mysql_unix_port, 0)))
805807
{

client/mysqlimport.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,10 @@ static char *opt_password=0, *current_user=0,
5555
*current_host=0, *current_db=0, *fields_terminated=0,
5656
*lines_terminated=0, *enclosed=0, *opt_enclosed=0,
5757
*escaped=0, *opt_columns=0,
58-
*default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME;
58+
*default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME;
5959
static uint opt_mysql_port= 0, opt_protocol= 0;
6060
static char * opt_mysql_unix_port=0;
6161
static longlong opt_ignore_lines= -1;
62-
static CHARSET_INFO *charset_info= &my_charset_latin1;
6362
#include <sslopt-vars.h>
6463

6564
#ifdef HAVE_SMEM
@@ -282,10 +281,6 @@ static int get_options(int *argc, char ***argv)
282281
fprintf(stderr, "You can't use --ignore (-i) and --replace (-r) at the same time.\n");
283282
return(1);
284283
}
285-
if (strcmp(default_charset, charset_info->csname) &&
286-
!(charset_info= get_charset_by_csname(default_charset,
287-
MY_CS_PRIMARY, MYF(MY_WME))))
288-
exit(1);
289284
if (*argc < 2)
290285
{
291286
usage();
@@ -440,6 +435,7 @@ static MYSQL *db_connect(char *host, char *database,
440435
if (shared_memory_base_name)
441436
mysql_options(mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
442437
#endif
438+
mysql_options(mysql, MYSQL_SET_CHARSET_NAME, default_charset);
443439
if (!(mysql_real_connect(mysql,host,user,passwd,
444440
database,opt_mysql_port,opt_mysql_unix_port,
445441
0)))

client/mysqlshow.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static my_bool tty_password= 0, opt_table_type= 0;
3232
static my_bool debug_info_flag= 0, debug_check_flag= 0;
3333
static uint my_end_arg= 0;
3434
static uint opt_verbose=0;
35-
static char *default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME;
35+
static char *default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME;
3636

3737
#ifdef HAVE_SMEM
3838
static char *shared_memory_base_name=0;

client/sql_string.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#ifndef CLIENT_SQL_STRING_INCLUDED
2+
#define CLIENT_SQL_STRING_INCLUDED
3+
14
/* Copyright (C) 2000 MySQL AB
25
36
This program is free software; you can redistribute it and/or modify
@@ -353,3 +356,5 @@ class String
353356
return (s->alloced && Ptr >= s->Ptr && Ptr < s->Ptr + s->str_length);
354357
}
355358
};
359+
360+
#endif /* CLIENT_SQL_STRING_INCLUDED */

0 commit comments

Comments
 (0)