mirror of
https://github.com/MariaDB/server.git
synced 2026-05-06 15:15:34 +02:00
Merge jlindstrom@build.mysql.com:/home/bk/mysql-4.1
into hundin.mysql.fi:/home/jan/mysql-4.1
This commit is contained in:
commit
3e3981b558
77 changed files with 794 additions and 628 deletions
|
|
@ -123,14 +123,16 @@ if (($opt_directory ne $PWD) && (!-d $opt_directory && !$opt_dry_run))
|
|||
if ($opt_pull)
|
||||
{
|
||||
&logger("Updating BK tree $REPO to latest ChangeSet first");
|
||||
$command= "cd $REPO; bk pull; cd ..";
|
||||
&run_command($command, "Could not update $REPO!");
|
||||
chdir ($REPO) or &abort("Could not chdir to $REPO!");
|
||||
&run_command("bk pull", "Could not update $REPO!");
|
||||
chdir ($PWD) or &abort("Could not chdir to $PWD!");
|
||||
|
||||
unless ($opt_skip_manual)
|
||||
{
|
||||
&logger("Updating manual tree in $opt_docdir");
|
||||
$command= "cd $opt_docdir; bk pull; cd ..";
|
||||
&run_command($command, "Could not update $opt_docdir!");
|
||||
chdir ($opt_docdir) or &abort("Could not chdir to $opt_docdir!");
|
||||
&run_command("bk pull", "Could not update $opt_docdir!");
|
||||
chdir ($PWD) or &abort("Could not chdir to $PWD!");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -150,20 +150,20 @@ sub main
|
|||
####
|
||||
sub fix_mysql_version
|
||||
{
|
||||
chdir("$destdir");
|
||||
my $header_file= (-f 'include/mysql_version.h.in')? 'include/mysql_version.h.in' : 'include/mysql_version.h';
|
||||
|
||||
open(MYSQL_VERSION,"<$header_file") or die "Unable to open include/mysql_version.h for read: $!\n";
|
||||
undef $/;
|
||||
my $mysql_version= <MYSQL_VERSION>;
|
||||
close(MYSQL_VERSION);
|
||||
chdir("$destdir");
|
||||
my $header_file= (-f 'include/mysql_version.h.in')? 'include/mysql_version.h.in' : 'include/mysql_version.h';
|
||||
|
||||
$mysql_version=~ s/\#define LICENSE[\s\t]+GPL/#define LICENSE Commercial/;
|
||||
|
||||
open(MYSQL_VERSION,">$header_file") or die "Unable to open include/mysql_version.h for write: $!\n";
|
||||
print MYSQL_VERSION $mysql_version;
|
||||
close(MYSQL_VERSION);
|
||||
chdir("$cwd");
|
||||
open(MYSQL_VERSION,"<$header_file") or die "Unable to open $header_file for read: $!\n";
|
||||
undef $/;
|
||||
my $mysql_version= <MYSQL_VERSION>;
|
||||
close(MYSQL_VERSION);
|
||||
|
||||
$mysql_version=~ s/\#define LICENSE[\s\t]+GPL/#define LICENSE Commercial/;
|
||||
|
||||
open(MYSQL_VERSION,">$header_file") or die "Unable to open $header_file for write: $!\n";
|
||||
print MYSQL_VERSION $mysql_version;
|
||||
close(MYSQL_VERSION);
|
||||
chdir("$cwd");
|
||||
}
|
||||
|
||||
####
|
||||
|
|
|
|||
|
|
@ -859,7 +859,7 @@ static int get_options(int argc, char **argv)
|
|||
opt_max_allowed_packet= *mysql_params->p_max_allowed_packet;
|
||||
opt_net_buffer_length= *mysql_params->p_net_buffer_length;
|
||||
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option, 0)))
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
|
||||
exit(ho_error);
|
||||
|
||||
*mysql_params->p_max_allowed_packet= opt_max_allowed_packet;
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ int main(int argc,char *argv[])
|
|||
mysql_init(&mysql);
|
||||
load_defaults("my",load_default_groups,&argc,&argv);
|
||||
save_argv = argv; /* Save for free_defaults */
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option, 0)))
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
|
||||
{
|
||||
free_defaults(save_argv);
|
||||
exit(ho_error);
|
||||
|
|
|
|||
|
|
@ -666,7 +666,7 @@ static int parse_args(int *argc, char*** argv)
|
|||
|
||||
result_file = stdout;
|
||||
load_defaults("my",load_default_groups,argc,argv);
|
||||
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, NULL)))
|
||||
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
|
||||
exit(ho_error);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -295,7 +295,7 @@ static int get_options(int *argc, char ***argv)
|
|||
|
||||
load_defaults("my", load_default_groups, argc, argv);
|
||||
|
||||
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, 0)))
|
||||
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
|
||||
exit(ho_error);
|
||||
|
||||
if (!what_to_do)
|
||||
|
|
|
|||
|
|
@ -604,7 +604,7 @@ static int get_options(int *argc, char ***argv)
|
|||
md_result_file= stdout;
|
||||
load_defaults("my",load_default_groups,argc,argv);
|
||||
|
||||
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, 0)))
|
||||
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
|
||||
exit(ho_error);
|
||||
|
||||
*mysql_params->p_max_allowed_packet= opt_max_allowed_packet;
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@ static int get_options(int *argc, char ***argv)
|
|||
{
|
||||
int ho_error;
|
||||
|
||||
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, 0)))
|
||||
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
|
||||
exit(ho_error);
|
||||
|
||||
if (enclosed && opt_enclosed)
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ int parse_args(int argc, char** argv)
|
|||
{
|
||||
int ho_error;
|
||||
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option, NULL)))
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
|
||||
exit(ho_error);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ int parse_args(int argc, char **argv)
|
|||
load_defaults("my",load_default_groups,&argc,&argv);
|
||||
default_argv= argv;
|
||||
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option, NULL)))
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
|
||||
exit(ho_error);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -297,7 +297,7 @@ get_options(int *argc,char ***argv)
|
|||
{
|
||||
int ho_error;
|
||||
|
||||
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, 0)))
|
||||
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
|
||||
exit(ho_error);
|
||||
|
||||
if (tty_password)
|
||||
|
|
|
|||
|
|
@ -2100,7 +2100,7 @@ int parse_args(int argc, char **argv)
|
|||
load_defaults("my",load_default_groups,&argc,&argv);
|
||||
default_argv= argv;
|
||||
|
||||
if ((handle_options(&argc, &argv, my_long_options, get_one_option, 0)))
|
||||
if ((handle_options(&argc, &argv, my_long_options, get_one_option)))
|
||||
exit(1);
|
||||
|
||||
if (argc > 1)
|
||||
|
|
|
|||
|
|
@ -2452,8 +2452,10 @@ elif test "$extra_charsets" = none; then
|
|||
CHARSETS="$CHARSETS"
|
||||
elif test "$extra_charsets" = complex; then
|
||||
CHARSETS="$CHARSETS $CHARSETS_COMPLEX"
|
||||
AC_DEFINE([DEFINE_ALL_CHARACTER_SETS])
|
||||
elif test "$extra_charsets" = all; then
|
||||
CHARSETS="$CHARSETS $CHARSETS_AVAILABLE"
|
||||
AC_DEFINE([DEFINE_ALL_CHARACTER_SETS])
|
||||
else
|
||||
EXTRA_CHARSETS=`echo $extra_charsets | sed -e 's/,/ /g'`
|
||||
CHARSETS="$CHARSETS $EXTRA_CHARSETS"
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ static int get_options(int *argc,char ***argv)
|
|||
{
|
||||
int ho_error;
|
||||
|
||||
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, NULL)))
|
||||
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
|
||||
exit(ho_error);
|
||||
|
||||
if (*argc < 1)
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
progname= argv[0];
|
||||
|
||||
if (handle_options(&argc, &argv, my_long_options, get_one_option, NULL))
|
||||
if (handle_options(&argc, &argv, my_long_options, get_one_option))
|
||||
exit(-1);
|
||||
if (!argv[0] || !argv[1] || (pid= atoi(argv[0])) <= 0 ||
|
||||
(t= atoi(argv[1])) <= 0)
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ static int get_options(int *argc,char ***argv)
|
|||
{
|
||||
int ho_error;
|
||||
|
||||
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, NULL)))
|
||||
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
|
||||
exit(ho_error);
|
||||
|
||||
if (!*argc && !print_all_codes)
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ static int parse_args(int argc, char **argv)
|
|||
{
|
||||
int ho_error;
|
||||
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option, NULL)))
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
|
||||
exit(ho_error);
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ static int get_options(int *argc,char ***argv)
|
|||
{
|
||||
int ho_error;
|
||||
|
||||
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, NULL)))
|
||||
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
|
||||
exit(ho_error);
|
||||
|
||||
if (*argc == 0)
|
||||
|
|
|
|||
|
|
@ -151,9 +151,7 @@ typedef uint rf_SetTimer;
|
|||
#endif
|
||||
|
||||
/* ERROR is defined in wingdi.h */
|
||||
#ifdef ERROR
|
||||
#undef ERROR
|
||||
#endif
|
||||
|
||||
/* We need to close files to break connections on shutdown */
|
||||
#ifndef SIGNAL_WITH_VIO_CLOSE
|
||||
|
|
|
|||
|
|
@ -54,15 +54,15 @@ struct my_option
|
|||
int app_type; /* To be used by an application */
|
||||
};
|
||||
|
||||
extern char *disabled_my_option;
|
||||
extern my_bool my_getopt_print_errors;
|
||||
|
||||
typedef my_bool (* my_get_one_option) (int, const struct my_option *, char * );
|
||||
typedef void (* my_error_reporter) (enum loglevel level, const char *format, ... );
|
||||
|
||||
extern char *disabled_my_option;
|
||||
extern my_bool my_getopt_print_errors;
|
||||
extern my_error_reporter my_getopt_error_reporter;
|
||||
|
||||
extern int handle_options (int *argc, char ***argv,
|
||||
const struct my_option *longopts, my_get_one_option,
|
||||
my_error_reporter );
|
||||
const struct my_option *longopts, my_get_one_option);
|
||||
extern void my_print_help(const struct my_option *options);
|
||||
extern void my_print_variables(const struct my_option *options);
|
||||
extern void my_getopt_register_get_addr(gptr* (*func_addr)(const char *, uint,
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@ void init_time(void);
|
|||
my_time_t
|
||||
my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap);
|
||||
|
||||
void set_zero_time(MYSQL_TIME *tm);
|
||||
|
||||
C_MODE_END
|
||||
|
||||
#endif /* _my_time_h_ */
|
||||
|
|
|
|||
|
|
@ -2337,21 +2337,6 @@ row_drop_table_for_mysql(
|
|||
srv_print_innodb_table_monitor = FALSE;
|
||||
}
|
||||
|
||||
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
|
||||
ut_a(name != NULL);
|
||||
|
||||
if (srv_created_new_raw) {
|
||||
fputs(
|
||||
"InnoDB: A new raw disk partition was initialized or\n"
|
||||
"InnoDB: innodb_force_recovery is on: we do not allow\n"
|
||||
"InnoDB: database modifications by the user. Shut down\n"
|
||||
"InnoDB: mysqld and edit my.cnf so that newraw is replaced\n"
|
||||
"InnoDB: with raw, and innodb_force_... is removed.\n",
|
||||
stderr);
|
||||
|
||||
return(DB_ERROR);
|
||||
}
|
||||
|
||||
quoted_name = mem_strdupq(name, '\'');
|
||||
namelen = strlen(quoted_name);
|
||||
sql = mem_alloc((sizeof str1) + (sizeof str2) - 2 + 1 + namelen);
|
||||
|
|
|
|||
|
|
@ -1587,9 +1587,10 @@ NetWare. */
|
|||
|
||||
fprintf(stderr,
|
||||
"InnoDB: You have now successfully upgraded to the multiple tablespaces\n"
|
||||
"InnoDB: format. You should NOT DOWNGRADE again to an earlier version of\n"
|
||||
"InnoDB: InnoDB! But if you absolutely need to downgrade, see section 4.6 of\n"
|
||||
"InnoDB: http://www.innodb.com/ibman.php for instructions.\n");
|
||||
"InnoDB: format. You should NOT DOWNGRADE to an earlier version of\n"
|
||||
"InnoDB: InnoDB! But if you absolutely need to downgrade, see\n"
|
||||
"InnoDB: http://dev.mysql.com/doc/mysql/en/Multiple_tablespaces.html\n"
|
||||
"InnoDB: for instructions.\n");
|
||||
}
|
||||
|
||||
if (srv_force_recovery == 0) {
|
||||
|
|
|
|||
|
|
@ -671,7 +671,7 @@ static void get_options(register int *argc, register char ***argv)
|
|||
if (isatty(fileno(stdout)))
|
||||
testflag|=T_WRITE_LOOP;
|
||||
|
||||
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, NULL)))
|
||||
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
|
||||
exit(ho_error);
|
||||
|
||||
if (*argc == 0)
|
||||
|
|
|
|||
|
|
@ -337,7 +337,7 @@ static void get_options(int *argc, char ***argv)
|
|||
{
|
||||
int ho_error;
|
||||
|
||||
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, NULL)))
|
||||
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
|
||||
exit(ho_error);
|
||||
|
||||
my_progname= argv[0][0];
|
||||
|
|
|
|||
|
|
@ -3167,13 +3167,6 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number,
|
|||
Fetch and conversion of result set rows (binary protocol).
|
||||
*********************************************************************/
|
||||
|
||||
static void set_zero_time(MYSQL_TIME *tm)
|
||||
{
|
||||
bzero((void *)tm, sizeof(*tm));
|
||||
tm->time_type= MYSQL_TIMESTAMP_NONE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Read date, (time, datetime) value from network buffer and store it
|
||||
in MYSQL_TIME structure.
|
||||
|
|
|
|||
|
|
@ -644,7 +644,7 @@ static void get_options(int argc, char *argv[])
|
|||
{
|
||||
int ho_error;
|
||||
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option, NULL)))
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
|
||||
exit(ho_error);
|
||||
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ int main(int argc,char *argv[])
|
|||
struct { MI_INFO *info; } aio0, *aio=&aio0; /* for GWS_IN_USE */
|
||||
|
||||
MY_INIT(argv[0]);
|
||||
if ((error=handle_options(&argc, &argv, my_long_options, get_one_option, 0)))
|
||||
if (error=handle_options(&argc, &argv, my_long_options, get_one_option))
|
||||
exit(error);
|
||||
if (count || dump)
|
||||
verbose=0;
|
||||
|
|
|
|||
|
|
@ -696,7 +696,7 @@ static void get_options(register int *argc,register char ***argv)
|
|||
if (isatty(fileno(stdout)))
|
||||
check_param.testflag|=T_WRITE_LOOP;
|
||||
|
||||
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, NULL)))
|
||||
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
|
||||
exit(ho_error);
|
||||
|
||||
/* If using repair, then update checksum if one uses --update-state */
|
||||
|
|
|
|||
|
|
@ -350,7 +350,7 @@ static void get_options(int *argc,char ***argv)
|
|||
if (isatty(fileno(stdout)))
|
||||
write_loop=1;
|
||||
|
||||
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option, NULL)))
|
||||
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
|
||||
exit(ho_error);
|
||||
|
||||
if (!*argc)
|
||||
|
|
|
|||
|
|
@ -34,14 +34,17 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
|
|||
{
|
||||
int save_errno,errpos=0;
|
||||
uint files=0,i,dir_length,length,key_parts;
|
||||
ulonglong file_offset;
|
||||
ulonglong file_offset=0;
|
||||
char name_buff[FN_REFLEN*2],buff[FN_REFLEN],*end;
|
||||
MYRG_INFO *m_info=0;
|
||||
File fd;
|
||||
IO_CACHE file;
|
||||
MI_INFO *isam=0;
|
||||
uint found_merge_insert_method= 0;
|
||||
DBUG_ENTER("myrg_open");
|
||||
|
||||
LINT_INIT(key_parts);
|
||||
|
||||
bzero((char*) &file,sizeof(file));
|
||||
if ((fd=my_open(fn_format(name_buff,name,"",MYRG_NAME_EXT,4),
|
||||
O_RDONLY | O_SHARE,MYF(0))) < 0)
|
||||
|
|
@ -69,10 +72,10 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
|
|||
continue; /* Skip empty lines */
|
||||
if (buff[0] == '#')
|
||||
{
|
||||
if( !strncmp(buff+1,"INSERT_METHOD=",14))
|
||||
if (!strncmp(buff+1,"INSERT_METHOD=",14))
|
||||
{ /* Lookup insert method */
|
||||
int tmp=find_type(buff+15,&merge_insert_method,2);
|
||||
m_info->merge_insert_method = (uint) (tmp >= 0 ? tmp : 0);
|
||||
found_merge_insert_method = (uint) (tmp >= 0 ? tmp : 0);
|
||||
}
|
||||
continue; /* Skip comments */
|
||||
}
|
||||
|
|
@ -84,8 +87,8 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
|
|||
VOID(cleanup_dirname(buff,name_buff));
|
||||
}
|
||||
if (!(isam=mi_open(buff,mode,(handle_locking?HA_OPEN_WAIT_IF_LOCKED:0))))
|
||||
goto err;
|
||||
if (!m_info)
|
||||
goto err;
|
||||
if (!m_info) /* First file */
|
||||
{
|
||||
key_parts=isam->s->base.key_parts;
|
||||
if (!(m_info= (MYRG_INFO*) my_malloc(sizeof(MYRG_INFO) +
|
||||
|
|
@ -97,15 +100,10 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
|
|||
{
|
||||
m_info->open_tables=(MYRG_TABLE *) (m_info+1);
|
||||
m_info->rec_per_key_part=(ulong *) (m_info->open_tables+files);
|
||||
m_info->tables= files;
|
||||
files= 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_info->open_tables=0;
|
||||
m_info->rec_per_key_part=0;
|
||||
}
|
||||
m_info->tables=files;
|
||||
m_info->reclength=isam->s->base.reclength;
|
||||
file_offset=files=0;
|
||||
errpos=3;
|
||||
}
|
||||
m_info->open_tables[files].table= isam;
|
||||
|
|
@ -122,14 +120,16 @@ MYRG_INFO *myrg_open(const char *name, int mode, int handle_locking)
|
|||
m_info->del+= isam->state->del;
|
||||
m_info->data_file_length+= isam->state->data_file_length;
|
||||
for (i=0; i < key_parts; i++)
|
||||
m_info->rec_per_key_part[i]+=isam->s->state.rec_per_key_part[i] / m_info->tables;
|
||||
m_info->rec_per_key_part[i]+= (isam->s->state.rec_per_key_part[i] /
|
||||
m_info->tables);
|
||||
}
|
||||
|
||||
if (!m_info && !(m_info= (MYRG_INFO*) my_malloc(sizeof(MYRG_INFO),
|
||||
MYF(MY_WME|MY_ZEROFILL))))
|
||||
MYF(MY_WME | MY_ZEROFILL))))
|
||||
goto err;
|
||||
/* Don't mark table readonly, for ALTER TABLE ... UNION=(...) to work */
|
||||
m_info->options&= ~(HA_OPTION_COMPRESS_RECORD | HA_OPTION_READ_ONLY_DATA);
|
||||
m_info->merge_insert_method= found_merge_insert_method;
|
||||
|
||||
if (sizeof(my_off_t) == 4 && file_offset > (ulonglong) (ulong) ~0L)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -438,7 +438,7 @@ SLAVE_MYERR="$MYSQL_TEST_DIR/var/log/slave.err"
|
|||
CURRENT_TEST="$MYSQL_TEST_DIR/var/log/current_test"
|
||||
SMALL_SERVER="--key_buffer_size=1M --sort_buffer=256K --max_heap_table_size=1M"
|
||||
|
||||
export MASTER_MYPORT SLAVE_MYPORT MYSQL_TCP_PORT
|
||||
export MASTER_MYPORT SLAVE_MYPORT MYSQL_TCP_PORT MASTER_MYSOCK
|
||||
|
||||
if [ x$SOURCE_DIST = x1 ] ; then
|
||||
MY_BASEDIR=$MYSQL_TEST_DIR
|
||||
|
|
@ -525,13 +525,6 @@ else
|
|||
fi
|
||||
fi
|
||||
|
||||
MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
|
||||
MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR $EXTRA_MYSQLBINLOG_OPT"
|
||||
MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose"
|
||||
MYSQL="$MYSQL --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD"
|
||||
export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR
|
||||
|
||||
|
||||
if [ -z "$MASTER_MYSQLD" ]
|
||||
then
|
||||
MASTER_MYSQLD=$MYSQLD
|
||||
|
|
@ -564,6 +557,12 @@ then
|
|||
fi
|
||||
|
||||
|
||||
MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
|
||||
MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR $EXTRA_MYSQLBINLOG_OPT"
|
||||
MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose"
|
||||
MYSQL="$MYSQL --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD"
|
||||
export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR
|
||||
|
||||
MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \
|
||||
--user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \
|
||||
--tmpdir=$MYSQL_TMP_DIR --port=$MASTER_MYPORT $MYSQL_TEST_SSL_OPTS"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
drop table if exists t1,t2,t3;
|
||||
drop database if exists test_$1;
|
||||
drop database if exists mysqltest;
|
||||
create table t1 (b char(0));
|
||||
insert into t1 values (""),(null);
|
||||
select * from t1;
|
||||
|
|
@ -58,18 +58,18 @@ select 1ea10.1a20,1e+ 1e+10 from 1ea10;
|
|||
drop table 1ea10;
|
||||
create table t1 (t1.index int);
|
||||
drop table t1;
|
||||
drop database if exists test_$1;
|
||||
drop database if exists mysqltest;
|
||||
Warnings:
|
||||
Note 1008 Can't drop database 'test_$1'; database doesn't exist
|
||||
create database test_$1;
|
||||
create table test_$1.$test1 (a$1 int, $b int, c$ int);
|
||||
insert into test_$1.$test1 values (1,2,3);
|
||||
select a$1, $b, c$ from test_$1.$test1;
|
||||
Note 1008 Can't drop database 'mysqltest'; database doesn't exist
|
||||
create database mysqltest;
|
||||
create table mysqltest.$test1 (a$1 int, $b int, c$ int);
|
||||
insert into mysqltest.$test1 values (1,2,3);
|
||||
select a$1, $b, c$ from mysqltest.$test1;
|
||||
a$1 $b c$
|
||||
1 2 3
|
||||
create table test_$1.test2$ (a int);
|
||||
drop table test_$1.test2$;
|
||||
drop database test_$1;
|
||||
create table mysqltest.test2$ (a int);
|
||||
drop table mysqltest.test2$;
|
||||
drop database mysqltest;
|
||||
create table `` (a int);
|
||||
ERROR 42000: Incorrect table name ''
|
||||
drop table if exists ``;
|
||||
|
|
@ -320,9 +320,9 @@ t3 CREATE TABLE `t3` (
|
|||
select * from t3;
|
||||
id name
|
||||
drop table t2, t3;
|
||||
create database test_$1;
|
||||
create table test_$1.t3 like t1;
|
||||
create temporary table t3 like test_$1.t3;
|
||||
create database mysqltest;
|
||||
create table mysqltest.t3 like t1;
|
||||
create temporary table t3 like mysqltest.t3;
|
||||
show create table t3;
|
||||
Table Create Table
|
||||
t3 CREATE TEMPORARY TABLE `t3` (
|
||||
|
|
@ -339,7 +339,7 @@ t2 CREATE TABLE `t2` (
|
|||
select * from t2;
|
||||
id name
|
||||
create table t3 like t1;
|
||||
create table t3 like test_$1.t3;
|
||||
create table t3 like mysqltest.t3;
|
||||
ERROR 42S01: Table 't3' already exists
|
||||
create table non_existing_database.t1 like t1;
|
||||
Got one of the listed errors
|
||||
|
|
@ -351,7 +351,7 @@ create table t3 like `a/a`;
|
|||
ERROR 42000: Incorrect table name 'a/a'
|
||||
drop table t1, t2, t3;
|
||||
drop table t3;
|
||||
drop database test_$1;
|
||||
drop database mysqltest;
|
||||
SET SESSION storage_engine="heap";
|
||||
SELECT @@storage_engine;
|
||||
@@storage_engine
|
||||
|
|
@ -488,12 +488,12 @@ Note 1291 Column 'cset' has duplicated value 'b' in SET
|
|||
Note 1291 Column 'cset' has duplicated value 'B' in SET
|
||||
Note 1291 Column 'cset' has duplicated value 'd' in SET
|
||||
drop table t1, t2, t3;
|
||||
create database test_$1;
|
||||
use test_$1;
|
||||
create database mysqltest;
|
||||
use mysqltest;
|
||||
select database();
|
||||
database()
|
||||
test_$1
|
||||
drop database test_$1;
|
||||
mysqltest
|
||||
drop database mysqltest;
|
||||
select database();
|
||||
database()
|
||||
NULL
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
drop table if exists t1,t2,t3,t4;
|
||||
drop table if exists t0,t5,t6,t7,t8,t9;
|
||||
drop database if exists mysqltest;
|
||||
create table T1 (id int primary key, Word varchar(40) not null, Index(Word));
|
||||
create table t4 (id int primary key, Word varchar(40) not null);
|
||||
INSERT INTO T1 VALUES (1, 'a'), (2, 'b'), (3, 'c');
|
||||
|
|
@ -42,6 +44,26 @@ select count(bags.a) from t1 as Bags;
|
|||
count(bags.a)
|
||||
0
|
||||
drop table t1;
|
||||
create database mysqltest;
|
||||
use MYSQLTEST;
|
||||
create table t1 (a int);
|
||||
select T1.a from MYSQLTEST.T1;
|
||||
a
|
||||
select t1.a from MYSQLTEST.T1;
|
||||
a
|
||||
select mysqltest.t1.* from MYSQLTEST.t1;
|
||||
a
|
||||
select MYSQLTEST.t1.* from MYSQLTEST.t1;
|
||||
a
|
||||
select MYSQLTEST.T1.* from MYSQLTEST.T1;
|
||||
a
|
||||
select MYSQLTEST.T1.* from T1;
|
||||
a
|
||||
alter table t1 rename to T1;
|
||||
select MYSQLTEST.t1.* from MYSQLTEST.t1;
|
||||
a
|
||||
drop database mysqltest;
|
||||
use test;
|
||||
create table t1 (a int);
|
||||
create table t2 (a int);
|
||||
delete p1.*,P2.* from t1 as p1, t2 as p2 where p1.a=P2.a;
|
||||
|
|
@ -58,10 +80,3 @@ ERROR 42000: Not unique table/alias: 'C'
|
|||
drop table t1, t2;
|
||||
show tables;
|
||||
Tables_in_test
|
||||
create table t1 (a int);
|
||||
select TEST.t1.* from TEST.t1;
|
||||
a
|
||||
alter table t1 rename to T1;
|
||||
select TEST.t1.* from TEST.t1;
|
||||
a
|
||||
drop table t1;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
|
||||
drop database if exists test2;
|
||||
drop database if exists mysqltest;
|
||||
CREATE TABLE t1 (
|
||||
pk1 INT NOT NULL PRIMARY KEY,
|
||||
attr1 INT NOT NULL,
|
||||
|
|
@ -369,8 +369,8 @@ attr2 INT,
|
|||
attr3 VARCHAR(10)
|
||||
) ENGINE=ndbcluster;
|
||||
INSERT INTO t1 VALUES (9410,9412, NULL, '9412'), (9411,9413, 17, '9413');
|
||||
create database test2;
|
||||
use test2;
|
||||
create database mysqltest;
|
||||
use mysqltest;
|
||||
CREATE TABLE t2 (
|
||||
a bigint unsigned NOT NULL PRIMARY KEY,
|
||||
b int unsigned not null,
|
||||
|
|
@ -388,4 +388,4 @@ select b,test.t1.attr1 from test.t1, t2 where test.t1.pk1 < a;
|
|||
b attr1
|
||||
9413 9412
|
||||
drop table test.t1, t2;
|
||||
drop database test2;
|
||||
drop database mysqltest;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
drop table if exists t1;
|
||||
drop database if exists test2;
|
||||
drop database if exists mysqltest;
|
||||
set autocommit=0;
|
||||
create table t1 (
|
||||
a int not null primary key,
|
||||
|
|
@ -256,8 +256,8 @@ a b c d
|
|||
7 7xb7 777 7xdd7
|
||||
8 8xb8 888 8xdd8
|
||||
9 9xb9 999 9xdd9
|
||||
create database test2;
|
||||
use test2;
|
||||
create database mysqltest;
|
||||
use mysqltest;
|
||||
CREATE TABLE t2 (
|
||||
a bigint unsigned NOT NULL PRIMARY KEY,
|
||||
b int unsigned not null,
|
||||
|
|
@ -320,3 +320,5 @@ rollback;
|
|||
select count(*) from t1;
|
||||
count(*)
|
||||
0
|
||||
drop table t1;
|
||||
drop database mysqltest;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
|
||||
drop database if exists test2;
|
||||
drop database if exists mysqltest;
|
||||
CREATE TABLE t1 (
|
||||
pk1 INT NOT NULL PRIMARY KEY,
|
||||
attr1 INT NOT NULL
|
||||
|
|
@ -211,8 +211,8 @@ CREATE TABLE t1 (
|
|||
pk1 INT NOT NULL PRIMARY KEY,
|
||||
attr1 INT NOT NULL
|
||||
) ENGINE=ndbcluster;
|
||||
create database test2;
|
||||
use test2;
|
||||
create database mysqltest;
|
||||
use mysqltest;
|
||||
CREATE TABLE t2 (
|
||||
a bigint unsigned NOT NULL PRIMARY KEY,
|
||||
b int unsigned not null,
|
||||
|
|
@ -254,4 +254,4 @@ select count(*) from t2;
|
|||
count(*)
|
||||
0
|
||||
drop table test.t1, t2;
|
||||
drop database test2;
|
||||
drop database mysqltest;
|
||||
|
|
|
|||
|
|
@ -334,12 +334,12 @@ prepare stmt1 from ' deallocate prepare never_prepared ' ;
|
|||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'never_prepared' at line 1
|
||||
prepare stmt4 from ' use test ' ;
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
prepare stmt3 from ' create database drop_me ';
|
||||
prepare stmt3 from ' create database mysqltest ';
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
create database drop_me ;
|
||||
prepare stmt3 from ' drop database drop_me ';
|
||||
create database mysqltest ;
|
||||
prepare stmt3 from ' drop database mysqltest ';
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
drop database drop_me ;
|
||||
drop database mysqltest ;
|
||||
prepare stmt3 from ' grant all on test.t1 to drop_user@localhost
|
||||
identified by ''looser'' ';
|
||||
ERROR HY000: This command is not supported in the prepared statement protocol yet
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
drop table if exists t0,t1,t2,t3,t4;
|
||||
drop table if exists t0,t5,t6,t7,t8,t9;
|
||||
create table t0 SELECT 1,"table 1";
|
||||
create table t2 SELECT 2,"table 2";
|
||||
create table t3 SELECT 3,"table 3";
|
||||
|
|
|
|||
|
|
@ -4,41 +4,41 @@ reset master;
|
|||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
drop database if exists test2;
|
||||
drop database if exists test3;
|
||||
create database test2 character set latin2;
|
||||
drop database if exists mysqltest2;
|
||||
drop database if exists mysqltest3;
|
||||
create database mysqltest2 character set latin2;
|
||||
set @@character_set_server=latin5;
|
||||
create database test3;
|
||||
create database mysqltest3;
|
||||
|
||||
--- --master--
|
||||
show create database test2;
|
||||
show create database mysqltest2;
|
||||
Database Create Database
|
||||
test2 CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET latin2 */
|
||||
show create database test3;
|
||||
mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */
|
||||
show create database mysqltest3;
|
||||
Database Create Database
|
||||
test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET latin5 */
|
||||
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */
|
||||
|
||||
--- --slave--
|
||||
show create database test2;
|
||||
show create database mysqltest2;
|
||||
Database Create Database
|
||||
test2 CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET latin2 */
|
||||
show create database test3;
|
||||
mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */
|
||||
show create database mysqltest3;
|
||||
Database Create Database
|
||||
test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET latin5 */
|
||||
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET latin5 */
|
||||
set @@collation_server=armscii8_bin;
|
||||
drop database test3;
|
||||
create database test3;
|
||||
drop database mysqltest3;
|
||||
create database mysqltest3;
|
||||
|
||||
--- --master--
|
||||
show create database test3;
|
||||
show create database mysqltest3;
|
||||
Database Create Database
|
||||
test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
|
||||
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
|
||||
|
||||
--- --slave--
|
||||
show create database test3;
|
||||
show create database mysqltest3;
|
||||
Database Create Database
|
||||
test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
|
||||
use test2;
|
||||
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
|
||||
use mysqltest2;
|
||||
create table t1 (a int auto_increment primary key, b varchar(100));
|
||||
set character_set_client=cp850, collation_connection=latin2_croatian_ci;
|
||||
insert into t1 (b) values(@@character_set_server);
|
||||
|
|
@ -57,7 +57,7 @@ a b
|
|||
5 latin2_croatian_ci
|
||||
|
||||
--- --slave--
|
||||
select * from test2.t1 order by a;
|
||||
select * from mysqltest2.t1 order by a;
|
||||
a b
|
||||
1 armscii8
|
||||
2 armscii8_bin
|
||||
|
|
@ -81,7 +81,7 @@ a b
|
|||
4 Müller
|
||||
|
||||
--- --slave--
|
||||
select * from test2.t1 order by a;
|
||||
select * from mysqltest2.t1 order by a;
|
||||
a b
|
||||
1 latin1_german1_ci
|
||||
2 Muffler
|
||||
|
|
@ -98,69 +98,69 @@ a b
|
|||
1 cp850_general_ci
|
||||
|
||||
--- --slave--
|
||||
select * from test2.t1 order by a;
|
||||
select * from mysqltest2.t1 order by a;
|
||||
a b
|
||||
1 cp850_general_ci
|
||||
drop database test2;
|
||||
drop database test3;
|
||||
drop database mysqltest2;
|
||||
drop database mysqltest3;
|
||||
show binlog events from 79;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
master-bin.000001 79 Query 1 79 use `test`; drop database if exists test2
|
||||
master-bin.000001 143 Query 1 143 use `test`; drop database if exists test3
|
||||
master-bin.000001 207 Query 1 207 use `test`; create database test2 character set latin2
|
||||
master-bin.000001 284 Query 1 284 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=30
|
||||
master-bin.000001 418 Query 1 418 use `test`; create database test3
|
||||
master-bin.000001 474 Query 1 474 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64
|
||||
master-bin.000001 608 Query 1 608 use `test`; drop database test3
|
||||
master-bin.000001 662 Query 1 662 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64
|
||||
master-bin.000001 796 Query 1 796 use `test`; create database test3
|
||||
master-bin.000001 852 Query 1 852 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 987 Query 1 987 use `test2`; create table t1 (a int auto_increment primary key, b varchar(100))
|
||||
master-bin.000001 1089 Query 1 1089 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 1225 Intvar 1 1225 INSERT_ID=1
|
||||
master-bin.000001 1253 Query 1 1253 use `test2`; insert into t1 (b) values(@@character_set_server)
|
||||
master-bin.000001 1338 Query 1 1338 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 1474 Intvar 1 1474 INSERT_ID=2
|
||||
master-bin.000001 1502 Query 1 1502 use `test2`; insert into t1 (b) values(@@collation_server)
|
||||
master-bin.000001 1583 Query 1 1583 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 1719 Intvar 1 1719 INSERT_ID=3
|
||||
master-bin.000001 1747 Query 1 1747 use `test2`; insert into t1 (b) values(@@character_set_client)
|
||||
master-bin.000001 1832 Query 1 1832 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 1968 Intvar 1 1968 INSERT_ID=4
|
||||
master-bin.000001 1996 Query 1 1996 use `test2`; insert into t1 (b) values(@@character_set_connection)
|
||||
master-bin.000001 2085 Query 1 2085 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 2221 Intvar 1 2221 INSERT_ID=5
|
||||
master-bin.000001 2249 Query 1 2249 use `test2`; insert into t1 (b) values(@@collation_connection)
|
||||
master-bin.000001 2334 Query 1 2334 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 2469 Query 1 2469 use `test2`; truncate table t1
|
||||
master-bin.000001 2522 Query 1 2522 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 2657 Intvar 1 2657 INSERT_ID=1
|
||||
master-bin.000001 2685 Query 1 2685 use `test2`; insert into t1 (b) values(@@collation_connection)
|
||||
master-bin.000001 2770 Query 1 2770 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 2905 Intvar 1 2905 INSERT_ID=2
|
||||
master-bin.000001 2933 Query 1 2933 use `test2`; insert into t1 (b) values(LEAST("Müller","Muffler"))
|
||||
master-bin.000001 3021 Query 1 3021 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 3157 Intvar 1 3157 INSERT_ID=3
|
||||
master-bin.000001 3185 Query 1 3185 use `test2`; insert into t1 (b) values(@@collation_connection)
|
||||
master-bin.000001 3270 Query 1 3270 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 3406 Intvar 1 3406 INSERT_ID=4
|
||||
master-bin.000001 3434 Query 1 3434 use `test2`; insert into t1 (b) values(LEAST("Müller","Muffler"))
|
||||
master-bin.000001 3522 Query 1 3522 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 3658 Intvar 1 3658 INSERT_ID=74
|
||||
master-bin.000001 3686 Create_file 1 3686 db=test2;table=t1;file_id=1;block_len=581
|
||||
master-bin.000001 4354 Query 1 4354 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 4490 Intvar 1 4490 INSERT_ID=5
|
||||
master-bin.000001 4518 Exec_load 1 4518 ;file_id=1
|
||||
master-bin.000001 4541 Query 1 4541 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 4677 Query 1 4677 use `test2`; truncate table t1
|
||||
master-bin.000001 4730 Query 1 4730 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 4866 Intvar 1 4866 INSERT_ID=1
|
||||
master-bin.000001 4894 User var 1 4894 @`a`=_cp850 0x4DFC6C6C6572 COLLATE cp850_general_ci
|
||||
master-bin.000001 4934 Query 1 4934 use `test2`; insert into t1 (b) values(collation(@a))
|
||||
master-bin.000001 5010 Query 1 5010 use `test2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 5146 Query 1 5146 use `test2`; drop database test2
|
||||
master-bin.000001 5201 Query 1 5201 SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 5332 Query 1 5332 drop database test3
|
||||
master-bin.000001 79 Query 1 79 use `test`; drop database if exists mysqltest2
|
||||
master-bin.000001 148 Query 1 148 use `test`; drop database if exists mysqltest3
|
||||
master-bin.000001 217 Query 1 217 use `test`; create database mysqltest2 character set latin2
|
||||
master-bin.000001 299 Query 1 299 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=30
|
||||
master-bin.000001 433 Query 1 433 use `test`; create database mysqltest3
|
||||
master-bin.000001 494 Query 1 494 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64
|
||||
master-bin.000001 628 Query 1 628 use `test`; drop database mysqltest3
|
||||
master-bin.000001 687 Query 1 687 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64
|
||||
master-bin.000001 821 Query 1 821 use `test`; create database mysqltest3
|
||||
master-bin.000001 882 Query 1 882 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 1022 Query 1 1022 use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100))
|
||||
master-bin.000001 1129 Query 1 1129 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 1270 Intvar 1 1270 INSERT_ID=1
|
||||
master-bin.000001 1298 Query 1 1298 use `mysqltest2`; insert into t1 (b) values(@@character_set_server)
|
||||
master-bin.000001 1388 Query 1 1388 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 1529 Intvar 1 1529 INSERT_ID=2
|
||||
master-bin.000001 1557 Query 1 1557 use `mysqltest2`; insert into t1 (b) values(@@collation_server)
|
||||
master-bin.000001 1643 Query 1 1643 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 1784 Intvar 1 1784 INSERT_ID=3
|
||||
master-bin.000001 1812 Query 1 1812 use `mysqltest2`; insert into t1 (b) values(@@character_set_client)
|
||||
master-bin.000001 1902 Query 1 1902 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 2043 Intvar 1 2043 INSERT_ID=4
|
||||
master-bin.000001 2071 Query 1 2071 use `mysqltest2`; insert into t1 (b) values(@@character_set_connection)
|
||||
master-bin.000001 2165 Query 1 2165 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 2306 Intvar 1 2306 INSERT_ID=5
|
||||
master-bin.000001 2334 Query 1 2334 use `mysqltest2`; insert into t1 (b) values(@@collation_connection)
|
||||
master-bin.000001 2424 Query 1 2424 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 2564 Query 1 2564 use `mysqltest2`; truncate table t1
|
||||
master-bin.000001 2622 Query 1 2622 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 2762 Intvar 1 2762 INSERT_ID=1
|
||||
master-bin.000001 2790 Query 1 2790 use `mysqltest2`; insert into t1 (b) values(@@collation_connection)
|
||||
master-bin.000001 2880 Query 1 2880 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 3020 Intvar 1 3020 INSERT_ID=2
|
||||
master-bin.000001 3048 Query 1 3048 use `mysqltest2`; insert into t1 (b) values(LEAST("Müller","Muffler"))
|
||||
master-bin.000001 3141 Query 1 3141 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 3282 Intvar 1 3282 INSERT_ID=3
|
||||
master-bin.000001 3310 Query 1 3310 use `mysqltest2`; insert into t1 (b) values(@@collation_connection)
|
||||
master-bin.000001 3400 Query 1 3400 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 3541 Intvar 1 3541 INSERT_ID=4
|
||||
master-bin.000001 3569 Query 1 3569 use `mysqltest2`; insert into t1 (b) values(LEAST("Müller","Muffler"))
|
||||
master-bin.000001 3662 Query 1 3662 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 3803 Intvar 1 3803 INSERT_ID=74
|
||||
master-bin.000001 3831 Create_file 1 3831 db=mysqltest2;table=t1;file_id=1;block_len=581
|
||||
master-bin.000001 4504 Query 1 4504 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 4645 Intvar 1 4645 INSERT_ID=5
|
||||
master-bin.000001 4673 Exec_load 1 4673 ;file_id=1
|
||||
master-bin.000001 4696 Query 1 4696 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 4837 Query 1 4837 use `mysqltest2`; truncate table t1
|
||||
master-bin.000001 4895 Query 1 4895 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 5036 Intvar 1 5036 INSERT_ID=1
|
||||
master-bin.000001 5064 User var 1 5064 @`a`=_cp850 0x4DFC6C6C6572 COLLATE cp850_general_ci
|
||||
master-bin.000001 5104 Query 1 5104 use `mysqltest2`; insert into t1 (b) values(collation(@a))
|
||||
master-bin.000001 5185 Query 1 5185 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 5326 Query 1 5326 use `mysqltest2`; drop database mysqltest2
|
||||
master-bin.000001 5391 Query 1 5391 SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64
|
||||
master-bin.000001 5522 Query 1 5522 drop database mysqltest3
|
||||
set global character_set_server=latin2;
|
||||
ERROR HY000: Binary logging and replication forbid changing the global server character set or collation
|
||||
set global character_set_server=latin2;
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@ reset master;
|
|||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
create database test1;
|
||||
drop database if exists test1;
|
||||
create database mysqltest;
|
||||
drop database if exists mysqltest;
|
||||
Warnings:
|
||||
Note 1008 Can't drop database 'test1'; database doesn't exist
|
||||
show tables from test1;
|
||||
ERROR HY000: Can't read dir of './test1/' (Errcode: X)
|
||||
Note 1008 Can't drop database 'mysqltest'; database doesn't exist
|
||||
show tables from mysqltest;
|
||||
ERROR HY000: Can't read dir of './mysqltest/' (Errcode: X)
|
||||
create table t1 (a int);
|
||||
drop table if exists t1;
|
||||
Warnings:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
drop table if exists t1,t2;
|
||||
drop database if exists mysqltest;
|
||||
create table t1 (a int not null primary key, b int not null,c int not null, key(b,c));
|
||||
insert into t1 values (1,2,2),(2,2,3),(3,2,4),(4,2,4);
|
||||
check table t1 fast;
|
||||
|
|
@ -362,39 +363,39 @@ t1 HEAP 9 Fixed 0 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL
|
|||
t2 HEAP 9 Fixed 0 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL
|
||||
t3 HEAP 9 Fixed 0 9 # # # 9 NULL NULL NULL NULL latin1_swedish_ci NULL
|
||||
drop table t1, t2, t3;
|
||||
create database test_$1;
|
||||
show create database test_$1;
|
||||
create database mysqltest;
|
||||
show create database mysqltest;
|
||||
Database Create Database
|
||||
test_$1 CREATE DATABASE `test_$1` /*!40100 DEFAULT CHARACTER SET latin1 */
|
||||
create table test_$1.t1(a int);
|
||||
insert into test_$1.t1 values(1);
|
||||
grant select on `test_$1`.* to mysqltest_1@localhost;
|
||||
grant usage on `test_$1`.* to mysqltest_2@localhost;
|
||||
grant drop on `test_$1`.* to mysqltest_3@localhost;
|
||||
mysqltest CREATE DATABASE `mysqltest` /*!40100 DEFAULT CHARACTER SET latin1 */
|
||||
create table mysqltest.t1(a int);
|
||||
insert into mysqltest.t1 values(1);
|
||||
grant select on `mysqltest`.* to mysqltest_1@localhost;
|
||||
grant usage on `mysqltest`.* to mysqltest_2@localhost;
|
||||
grant drop on `mysqltest`.* to mysqltest_3@localhost;
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
show create database test_$1;
|
||||
show create database mysqltest;
|
||||
Database Create Database
|
||||
test_$1 CREATE DATABASE `test_$1` /*!40100 DEFAULT CHARACTER SET latin1 */
|
||||
mysqltest CREATE DATABASE `mysqltest` /*!40100 DEFAULT CHARACTER SET latin1 */
|
||||
drop table t1;
|
||||
ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'test_$1'
|
||||
drop database test_$1;
|
||||
ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'test_$1'
|
||||
select * from test_$1.t1;
|
||||
ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'test_$1'
|
||||
show create database test_$1;
|
||||
ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'test_$1'
|
||||
drop table test_$1.t1;
|
||||
ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'test_$1'
|
||||
drop database test_$1;
|
||||
ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'test_$1'
|
||||
select * from test_$1.t1;
|
||||
ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'test_$1'
|
||||
show create database test_$1;
|
||||
ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'test_$1'
|
||||
drop table test_$1.t1;
|
||||
drop database test_$1;
|
||||
ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysqltest'
|
||||
drop database mysqltest;
|
||||
ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysqltest'
|
||||
select * from mysqltest.t1;
|
||||
ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'mysqltest'
|
||||
show create database mysqltest;
|
||||
ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'mysqltest'
|
||||
drop table mysqltest.t1;
|
||||
ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'mysqltest'
|
||||
drop database mysqltest;
|
||||
ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'mysqltest'
|
||||
select * from mysqltest.t1;
|
||||
ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysqltest'
|
||||
show create database mysqltest;
|
||||
ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysqltest'
|
||||
drop table mysqltest.t1;
|
||||
drop database mysqltest;
|
||||
set names binary;
|
||||
delete from mysql.user
|
||||
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
|
||||
|
|
|
|||
|
|
@ -18,71 +18,71 @@ user
|
|||
show create table db;
|
||||
Table Create Table
|
||||
db CREATE TABLE `db` (
|
||||
`Host` char(60) character set latin1 collate latin1_bin NOT NULL default '',
|
||||
`Db` char(64) character set latin1 collate latin1_bin NOT NULL default '',
|
||||
`User` char(16) character set latin1 collate latin1_bin NOT NULL default '',
|
||||
`Select_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Insert_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Update_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Delete_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Create_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Drop_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Grant_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`References_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Index_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Alter_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Create_tmp_table_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Lock_tables_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Host` char(60) collate utf8_bin NOT NULL default '',
|
||||
`Db` char(64) collate utf8_bin NOT NULL default '',
|
||||
`User` char(16) collate utf8_bin NOT NULL default '',
|
||||
`Select_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Insert_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Update_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Delete_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Create_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Drop_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Grant_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`References_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Index_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Alter_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Create_tmp_table_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Lock_tables_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
PRIMARY KEY (`Host`,`Db`,`User`),
|
||||
KEY `User` (`User`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Database privileges'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Database privileges'
|
||||
show create table host;
|
||||
Table Create Table
|
||||
host CREATE TABLE `host` (
|
||||
`Host` char(60) character set latin1 collate latin1_bin NOT NULL default '',
|
||||
`Db` char(64) character set latin1 collate latin1_bin NOT NULL default '',
|
||||
`Select_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Insert_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Update_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Delete_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Create_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Drop_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Grant_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`References_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Index_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Alter_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Create_tmp_table_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Lock_tables_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Host` char(60) collate utf8_bin NOT NULL default '',
|
||||
`Db` char(64) collate utf8_bin NOT NULL default '',
|
||||
`Select_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Insert_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Update_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Delete_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Create_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Drop_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Grant_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`References_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Index_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Alter_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Create_tmp_table_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Lock_tables_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
PRIMARY KEY (`Host`,`Db`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Host privileges; Merged with database privileges'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Host privileges; Merged with database privileges'
|
||||
show create table user;
|
||||
Table Create Table
|
||||
user CREATE TABLE `user` (
|
||||
`Host` varchar(60) character set latin1 collate latin1_bin NOT NULL default '',
|
||||
`User` varchar(16) character set latin1 collate latin1_bin NOT NULL default '',
|
||||
`Password` varchar(41) character set latin1 collate latin1_bin NOT NULL default '',
|
||||
`Select_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Insert_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Update_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Delete_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Create_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Drop_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Reload_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Shutdown_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Process_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`File_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Grant_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`References_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Index_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Alter_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Show_db_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Super_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Create_tmp_table_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Lock_tables_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Execute_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Repl_slave_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`Repl_client_priv` enum('N','Y') NOT NULL default 'N',
|
||||
`ssl_type` enum('','ANY','X509','SPECIFIED') NOT NULL default '',
|
||||
`Host` varchar(60) collate utf8_bin NOT NULL default '',
|
||||
`User` varchar(16) collate utf8_bin NOT NULL default '',
|
||||
`Password` varchar(41) collate utf8_bin NOT NULL default '',
|
||||
`Select_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Insert_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Update_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Delete_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Create_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Drop_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Reload_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Shutdown_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Process_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`File_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Grant_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`References_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Index_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Alter_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Show_db_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Super_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Create_tmp_table_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Lock_tables_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Execute_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Repl_slave_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`Repl_client_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N',
|
||||
`ssl_type` enum('','ANY','X509','SPECIFIED') collate utf8_bin NOT NULL default '',
|
||||
`ssl_cipher` blob NOT NULL,
|
||||
`x509_issuer` blob NOT NULL,
|
||||
`x509_subject` blob NOT NULL,
|
||||
|
|
@ -90,41 +90,41 @@ user CREATE TABLE `user` (
|
|||
`max_updates` int(11) unsigned NOT NULL default '0',
|
||||
`max_connections` int(11) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (`Host`,`User`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Users and global privileges'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges'
|
||||
show create table func;
|
||||
Table Create Table
|
||||
func CREATE TABLE `func` (
|
||||
`name` char(64) character set latin1 collate latin1_bin NOT NULL default '',
|
||||
`name` char(64) collate utf8_bin NOT NULL default '',
|
||||
`ret` tinyint(1) NOT NULL default '0',
|
||||
`dl` char(128) NOT NULL default '',
|
||||
`type` enum('function','aggregate') NOT NULL default 'function',
|
||||
`dl` char(128) collate utf8_bin NOT NULL default '',
|
||||
`type` enum('function','aggregate') collate utf8_bin NOT NULL default 'function',
|
||||
PRIMARY KEY (`name`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='User defined functions'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User defined functions'
|
||||
show create table tables_priv;
|
||||
Table Create Table
|
||||
tables_priv CREATE TABLE `tables_priv` (
|
||||
`Host` char(60) character set latin1 collate latin1_bin NOT NULL default '',
|
||||
`Db` char(64) character set latin1 collate latin1_bin NOT NULL default '',
|
||||
`User` char(16) character set latin1 collate latin1_bin NOT NULL default '',
|
||||
`Table_name` char(64) character set latin1 collate latin1_bin NOT NULL default '',
|
||||
`Grantor` char(77) NOT NULL default '',
|
||||
`Host` char(60) collate utf8_bin NOT NULL default '',
|
||||
`Db` char(64) collate utf8_bin NOT NULL default '',
|
||||
`User` char(16) collate utf8_bin NOT NULL default '',
|
||||
`Table_name` char(64) collate utf8_bin NOT NULL default '',
|
||||
`Grantor` char(77) collate utf8_bin NOT NULL default '',
|
||||
`Timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
|
||||
`Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') NOT NULL default '',
|
||||
`Column_priv` set('Select','Insert','Update','References') NOT NULL default '',
|
||||
`Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') collate utf8_bin NOT NULL default '',
|
||||
`Column_priv` set('Select','Insert','Update','References') collate utf8_bin NOT NULL default '',
|
||||
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`),
|
||||
KEY `Grantor` (`Grantor`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Table privileges'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Table privileges'
|
||||
show create table columns_priv;
|
||||
Table Create Table
|
||||
columns_priv CREATE TABLE `columns_priv` (
|
||||
`Host` char(60) character set latin1 collate latin1_bin NOT NULL default '',
|
||||
`Db` char(64) character set latin1 collate latin1_bin NOT NULL default '',
|
||||
`User` char(16) character set latin1 collate latin1_bin NOT NULL default '',
|
||||
`Table_name` char(64) character set latin1 collate latin1_bin NOT NULL default '',
|
||||
`Column_name` char(64) character set latin1 collate latin1_bin NOT NULL default '',
|
||||
`Host` char(60) collate utf8_bin NOT NULL default '',
|
||||
`Db` char(64) collate utf8_bin NOT NULL default '',
|
||||
`User` char(16) collate utf8_bin NOT NULL default '',
|
||||
`Table_name` char(64) collate utf8_bin NOT NULL default '',
|
||||
`Column_name` char(64) collate utf8_bin NOT NULL default '',
|
||||
`Timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
|
||||
`Column_priv` set('Select','Insert','Update','References') NOT NULL default '',
|
||||
`Column_priv` set('Select','Insert','Update','References') collate utf8_bin NOT NULL default '',
|
||||
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Column privileges'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges'
|
||||
show tables;
|
||||
Tables_in_test
|
||||
|
|
|
|||
|
|
@ -110,14 +110,14 @@ drop database mysqltest;
|
|||
#
|
||||
# Rights for renaming test (Bug #3270)
|
||||
#
|
||||
connect (root,localhost,root,,test,$MASTER_MYPORT,master.sock);
|
||||
connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||
connection root;
|
||||
--disable_warnings
|
||||
create database mysqltest;
|
||||
--enable_warnings
|
||||
create table mysqltest.t1 (a int,b int,c int);
|
||||
grant all on mysqltest.t1 to mysqltest_1@localhost;
|
||||
connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,master.sock);
|
||||
connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
|
||||
connection user1;
|
||||
-- error 1142
|
||||
alter table t1 rename t2;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2,t3;
|
||||
drop database if exists test_$1;
|
||||
drop database if exists mysqltest;
|
||||
--enable_warnings
|
||||
|
||||
create table t1 (b char(0));
|
||||
|
|
@ -69,14 +69,14 @@ drop table 1ea10;
|
|||
create table t1 (t1.index int);
|
||||
drop table t1;
|
||||
# Test that we get warning for this
|
||||
drop database if exists test_$1;
|
||||
create database test_$1;
|
||||
create table test_$1.$test1 (a$1 int, $b int, c$ int);
|
||||
insert into test_$1.$test1 values (1,2,3);
|
||||
select a$1, $b, c$ from test_$1.$test1;
|
||||
create table test_$1.test2$ (a int);
|
||||
drop table test_$1.test2$;
|
||||
drop database test_$1;
|
||||
drop database if exists mysqltest;
|
||||
create database mysqltest;
|
||||
create table mysqltest.$test1 (a$1 int, $b int, c$ int);
|
||||
insert into mysqltest.$test1 values (1,2,3);
|
||||
select a$1, $b, c$ from mysqltest.$test1;
|
||||
create table mysqltest.test2$ (a int);
|
||||
drop table mysqltest.test2$;
|
||||
drop database mysqltest;
|
||||
|
||||
--error 1103
|
||||
create table `` (a int);
|
||||
|
|
@ -281,16 +281,16 @@ drop table t3;
|
|||
show create table t3;
|
||||
select * from t3;
|
||||
drop table t2, t3;
|
||||
create database test_$1;
|
||||
create table test_$1.t3 like t1;
|
||||
create temporary table t3 like test_$1.t3;
|
||||
create database mysqltest;
|
||||
create table mysqltest.t3 like t1;
|
||||
create temporary table t3 like mysqltest.t3;
|
||||
show create table t3;
|
||||
create table t2 like t3;
|
||||
show create table t2;
|
||||
select * from t2;
|
||||
create table t3 like t1;
|
||||
--error 1050
|
||||
create table t3 like test_$1.t3;
|
||||
create table t3 like mysqltest.t3;
|
||||
--error 1044,1
|
||||
create table non_existing_database.t1 like t1;
|
||||
--error 1051
|
||||
|
|
@ -301,7 +301,7 @@ create temporary table t3 like t1;
|
|||
create table t3 like `a/a`;
|
||||
drop table t1, t2, t3;
|
||||
drop table t3;
|
||||
drop database test_$1;
|
||||
drop database mysqltest;
|
||||
|
||||
#
|
||||
# Test default table type
|
||||
|
|
@ -393,10 +393,10 @@ drop table t1, t2, t3;
|
|||
# Bug #1209
|
||||
#
|
||||
|
||||
create database test_$1;
|
||||
use test_$1;
|
||||
create database mysqltest;
|
||||
use mysqltest;
|
||||
select database();
|
||||
drop database test_$1;
|
||||
drop database mysqltest;
|
||||
select database();
|
||||
|
||||
# Connect without a database
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@
|
|||
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2,t3,t4;
|
||||
# Clear up from other tests (to ensure that SHOW TABLES below is right)
|
||||
drop table if exists t0,t5,t6,t7,t8,t9;
|
||||
drop database if exists mysqltest;
|
||||
--enable_warnings
|
||||
|
||||
create table T1 (id int primary key, Word varchar(40) not null, Index(Word));
|
||||
|
|
@ -31,6 +34,23 @@ select count(T1.a) from t1;
|
|||
select count(bags.a) from t1 as Bags;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test all caps database name
|
||||
#
|
||||
create database mysqltest;
|
||||
use MYSQLTEST;
|
||||
create table t1 (a int);
|
||||
select T1.a from MYSQLTEST.T1;
|
||||
select t1.a from MYSQLTEST.T1;
|
||||
select mysqltest.t1.* from MYSQLTEST.t1;
|
||||
select MYSQLTEST.t1.* from MYSQLTEST.t1;
|
||||
select MYSQLTEST.T1.* from MYSQLTEST.T1;
|
||||
select MYSQLTEST.T1.* from T1;
|
||||
alter table t1 rename to T1;
|
||||
select MYSQLTEST.t1.* from MYSQLTEST.t1;
|
||||
drop database mysqltest;
|
||||
use test;
|
||||
|
||||
#
|
||||
# multiupdate/delete & --lower-case-table-names
|
||||
#
|
||||
|
|
@ -54,13 +74,3 @@ select C.a, c.a from t1 c, t2 C;
|
|||
drop table t1, t2;
|
||||
|
||||
show tables;
|
||||
|
||||
#
|
||||
# Test all caps database name
|
||||
#
|
||||
create table t1 (a int);
|
||||
select TEST.t1.* from TEST.t1;
|
||||
alter table t1 rename to T1;
|
||||
select TEST.t1.* from TEST.t1;
|
||||
drop table t1;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
|
||||
drop database if exists test2;
|
||||
drop database if exists mysqltest;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
|
|
@ -340,8 +340,8 @@ CREATE TABLE t1 (
|
|||
|
||||
INSERT INTO t1 VALUES (9410,9412, NULL, '9412'), (9411,9413, 17, '9413');
|
||||
|
||||
create database test2;
|
||||
use test2;
|
||||
create database mysqltest;
|
||||
use mysqltest;
|
||||
|
||||
CREATE TABLE t2 (
|
||||
a bigint unsigned NOT NULL PRIMARY KEY,
|
||||
|
|
@ -355,7 +355,5 @@ select b from test.t1, t2 where c = test.t1.attr2;
|
|||
select b,test.t1.attr1 from test.t1, t2 where test.t1.pk1 < a;
|
||||
|
||||
drop table test.t1, t2;
|
||||
|
||||
drop database test2;
|
||||
|
||||
drop database mysqltest;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
drop database if exists test2;
|
||||
drop database if exists mysqltest;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
|
|
@ -214,8 +214,8 @@ select * from t1 order by a;
|
|||
|
||||
# multi db
|
||||
|
||||
create database test2;
|
||||
use test2;
|
||||
create database mysqltest;
|
||||
use mysqltest;
|
||||
|
||||
CREATE TABLE t2 (
|
||||
a bigint unsigned NOT NULL PRIMARY KEY,
|
||||
|
|
@ -271,5 +271,5 @@ select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
|
|||
from t1 order by a;
|
||||
rollback;
|
||||
select count(*) from t1;
|
||||
|
||||
--drop table t1;
|
||||
drop table t1;
|
||||
drop database mysqltest;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7;
|
||||
drop database if exists test2;
|
||||
drop database if exists mysqltest;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
|
|
@ -263,8 +263,8 @@ CREATE TABLE t1 (
|
|||
attr1 INT NOT NULL
|
||||
) ENGINE=ndbcluster;
|
||||
|
||||
create database test2;
|
||||
use test2;
|
||||
create database mysqltest;
|
||||
use mysqltest;
|
||||
|
||||
CREATE TABLE t2 (
|
||||
a bigint unsigned NOT NULL PRIMARY KEY,
|
||||
|
|
@ -292,7 +292,6 @@ select count(*) from test.t1;
|
|||
select count(*) from t2;
|
||||
|
||||
drop table test.t1, t2;
|
||||
|
||||
drop database test2;
|
||||
drop database mysqltest;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -350,11 +350,11 @@ prepare stmt4 from ' use test ' ;
|
|||
|
||||
## create/drop database
|
||||
--error 1295
|
||||
prepare stmt3 from ' create database drop_me ';
|
||||
create database drop_me ;
|
||||
prepare stmt3 from ' create database mysqltest ';
|
||||
create database mysqltest ;
|
||||
--error 1295
|
||||
prepare stmt3 from ' drop database drop_me ';
|
||||
drop database drop_me ;
|
||||
prepare stmt3 from ' drop database mysqltest ';
|
||||
drop database mysqltest ;
|
||||
|
||||
## grant/revoke + drop user
|
||||
--error 1295
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
--disable_warnings
|
||||
drop table if exists t0,t1,t2,t3,t4;
|
||||
# Clear up from other tests (to ensure that SHOW TABLES below is right)
|
||||
drop table if exists t0,t5,t6,t7,t8,t9;
|
||||
--enable_warnings
|
||||
|
||||
create table t0 SELECT 1,"table 1";
|
||||
|
|
|
|||
|
|
@ -6,41 +6,41 @@
|
|||
|
||||
source include/master-slave.inc;
|
||||
--disable_warnings
|
||||
drop database if exists test2;
|
||||
drop database if exists test3;
|
||||
drop database if exists mysqltest2;
|
||||
drop database if exists mysqltest3;
|
||||
--enable_warnings
|
||||
|
||||
create database test2 character set latin2;
|
||||
create database mysqltest2 character set latin2;
|
||||
set @@character_set_server=latin5;
|
||||
create database test3;
|
||||
create database mysqltest3;
|
||||
--disable_query_log
|
||||
select "--- --master--" as "";
|
||||
--enable_query_log
|
||||
show create database test2;
|
||||
show create database test3;
|
||||
show create database mysqltest2;
|
||||
show create database mysqltest3;
|
||||
sync_slave_with_master;
|
||||
--disable_query_log
|
||||
select "--- --slave--" as "";
|
||||
--enable_query_log
|
||||
show create database test2;
|
||||
show create database test3;
|
||||
show create database mysqltest2;
|
||||
show create database mysqltest3;
|
||||
|
||||
connection master;
|
||||
set @@collation_server=armscii8_bin;
|
||||
drop database test3;
|
||||
create database test3;
|
||||
drop database mysqltest3;
|
||||
create database mysqltest3;
|
||||
--disable_query_log
|
||||
select "--- --master--" as "";
|
||||
--enable_query_log
|
||||
show create database test3;
|
||||
show create database mysqltest3;
|
||||
sync_slave_with_master;
|
||||
--disable_query_log
|
||||
select "--- --slave--" as "";
|
||||
--enable_query_log
|
||||
show create database test3;
|
||||
show create database mysqltest3;
|
||||
|
||||
connection master;
|
||||
use test2;
|
||||
use mysqltest2;
|
||||
create table t1 (a int auto_increment primary key, b varchar(100));
|
||||
set character_set_client=cp850, collation_connection=latin2_croatian_ci;
|
||||
insert into t1 (b) values(@@character_set_server);
|
||||
|
|
@ -59,7 +59,7 @@ sync_slave_with_master;
|
|||
--disable_query_log
|
||||
select "--- --slave--" as "";
|
||||
--enable_query_log
|
||||
select * from test2.t1 order by a;
|
||||
select * from mysqltest2.t1 order by a;
|
||||
|
||||
connection master;
|
||||
set character_set_client=latin1, collation_connection=latin1_german1_ci;
|
||||
|
|
@ -77,7 +77,7 @@ sync_slave_with_master;
|
|||
--disable_query_log
|
||||
select "--- --slave--" as "";
|
||||
--enable_query_log
|
||||
select * from test2.t1 order by a;
|
||||
select * from mysqltest2.t1 order by a;
|
||||
|
||||
# See if SET ONE_SHOT gets into binlog when LOAD DATA
|
||||
connection master;
|
||||
|
|
@ -101,11 +101,11 @@ sync_slave_with_master;
|
|||
--disable_query_log
|
||||
select "--- --slave--" as "";
|
||||
--enable_query_log
|
||||
select * from test2.t1 order by a;
|
||||
select * from mysqltest2.t1 order by a;
|
||||
|
||||
connection master;
|
||||
drop database test2;
|
||||
drop database test3;
|
||||
drop database mysqltest2;
|
||||
drop database mysqltest3;
|
||||
show binlog events from 79;
|
||||
sync_slave_with_master;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
source include/master-slave.inc;
|
||||
|
||||
connection slave;
|
||||
create database test1;
|
||||
create database mysqltest;
|
||||
connection master;
|
||||
drop database if exists test1;
|
||||
drop database if exists mysqltest;
|
||||
sync_slave_with_master;
|
||||
# can't read dir
|
||||
--replace_result "Errcode: 1" "Errcode: X" "Errcode: 2" "Errcode: X"
|
||||
--error 12
|
||||
show tables from test1;
|
||||
show tables from mysqltest;
|
||||
|
||||
connection slave;
|
||||
create table t1 (a int);
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
--disable_warnings
|
||||
drop table if exists t1,t2;
|
||||
drop database if exists mysqltest;
|
||||
--enable_warnings
|
||||
|
||||
create table t1 (a int not null primary key, b int not null,c int not null, key(b,c));
|
||||
|
|
@ -261,42 +262,42 @@ drop table t1, t2, t3;
|
|||
# Test for bug #3342 SHOW CREATE DATABASE seems to require DROP privilege
|
||||
#
|
||||
|
||||
create database test_$1;
|
||||
show create database test_$1;
|
||||
create table test_$1.t1(a int);
|
||||
insert into test_$1.t1 values(1);
|
||||
grant select on `test_$1`.* to mysqltest_1@localhost;
|
||||
grant usage on `test_$1`.* to mysqltest_2@localhost;
|
||||
grant drop on `test_$1`.* to mysqltest_3@localhost;
|
||||
create database mysqltest;
|
||||
show create database mysqltest;
|
||||
create table mysqltest.t1(a int);
|
||||
insert into mysqltest.t1 values(1);
|
||||
grant select on `mysqltest`.* to mysqltest_1@localhost;
|
||||
grant usage on `mysqltest`.* to mysqltest_2@localhost;
|
||||
grant drop on `mysqltest`.* to mysqltest_3@localhost;
|
||||
|
||||
connect (con1,localhost,mysqltest_1,,test_$1);
|
||||
connect (con1,localhost,mysqltest_1,,mysqltest);
|
||||
connection con1;
|
||||
select * from t1;
|
||||
show create database test_$1;
|
||||
show create database mysqltest;
|
||||
--error 1044
|
||||
drop table t1;
|
||||
--error 1044
|
||||
drop database test_$1;
|
||||
drop database mysqltest;
|
||||
|
||||
connect (con2,localhost,mysqltest_2,,test);
|
||||
connection con2;
|
||||
--error 1044
|
||||
select * from test_$1.t1;
|
||||
select * from mysqltest.t1;
|
||||
--error 1044
|
||||
show create database test_$1;
|
||||
show create database mysqltest;
|
||||
--error 1044
|
||||
drop table test_$1.t1;
|
||||
drop table mysqltest.t1;
|
||||
--error 1044
|
||||
drop database test_$1;
|
||||
drop database mysqltest;
|
||||
|
||||
connect (con3,localhost,mysqltest_3,,test);
|
||||
connection con3;
|
||||
--error 1044
|
||||
select * from test_$1.t1;
|
||||
select * from mysqltest.t1;
|
||||
--error 1044
|
||||
show create database test_$1;
|
||||
drop table test_$1.t1;
|
||||
drop database test_$1;
|
||||
show create database mysqltest;
|
||||
drop table mysqltest.t1;
|
||||
drop database mysqltest;
|
||||
|
||||
connection default;
|
||||
set names binary;
|
||||
|
|
|
|||
|
|
@ -21,6 +21,9 @@
|
|||
#include <mysys_err.h>
|
||||
#include <my_getopt.h>
|
||||
|
||||
static void default_reporter(enum loglevel level, const char *format, ...);
|
||||
my_error_reporter my_getopt_error_reporter= &default_reporter;
|
||||
|
||||
static int findopt(char *optpat, uint length,
|
||||
const struct my_option **opt_res,
|
||||
char **ffname);
|
||||
|
|
@ -56,7 +59,8 @@ char *disabled_my_option= (char*) "0";
|
|||
|
||||
my_bool my_getopt_print_errors= 1;
|
||||
|
||||
void default_reporter(enum loglevel level, const char *format, ...)
|
||||
static void default_reporter(enum loglevel level __attribute__((unused)),
|
||||
const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
|
|
@ -83,8 +87,8 @@ void my_getopt_register_get_addr(gptr* (*func_addr)(const char *, uint,
|
|||
}
|
||||
|
||||
int handle_options(int *argc, char ***argv,
|
||||
const struct my_option *longopts, my_get_one_option get_one_option,
|
||||
my_error_reporter reporter)
|
||||
const struct my_option *longopts,
|
||||
my_get_one_option get_one_option)
|
||||
{
|
||||
uint opt_found, argvpos= 0, length, i;
|
||||
my_bool end_of_options= 0, must_be_var, set_maximum_value,
|
||||
|
|
@ -100,8 +104,6 @@ int handle_options(int *argc, char ***argv,
|
|||
(*argv)++; /* --- || ---- */
|
||||
init_variables(longopts);
|
||||
|
||||
if (! reporter) reporter = &default_reporter;
|
||||
|
||||
for (pos= *argv, pos_end=pos+ *argc; pos != pos_end ; pos++)
|
||||
{
|
||||
char *cur_arg= *pos;
|
||||
|
|
@ -125,8 +127,9 @@ int handle_options(int *argc, char ***argv,
|
|||
if (!*++pos)
|
||||
{
|
||||
if (my_getopt_print_errors)
|
||||
reporter(ERROR_LEVEL, "%s: Option '-O' requires an argument\n",
|
||||
my_progname);
|
||||
my_getopt_error_reporter(ERROR_LEVEL,
|
||||
"%s: Option '-O' requires an argument\n",
|
||||
my_progname);
|
||||
return EXIT_ARGUMENT_REQUIRED;
|
||||
}
|
||||
cur_arg= *pos;
|
||||
|
|
@ -142,8 +145,9 @@ int handle_options(int *argc, char ***argv,
|
|||
if (!*cur_arg)
|
||||
{
|
||||
if (my_getopt_print_errors)
|
||||
reporter(ERROR_LEVEL, "%s: Option '--set-variable' requires an argument\n",
|
||||
my_progname);
|
||||
my_getopt_error_reporter(ERROR_LEVEL,
|
||||
"%s: Option '--set-variable' requires an argument\n",
|
||||
my_progname);
|
||||
return EXIT_ARGUMENT_REQUIRED;
|
||||
}
|
||||
}
|
||||
|
|
@ -155,8 +159,9 @@ int handle_options(int *argc, char ***argv,
|
|||
if (!*++pos)
|
||||
{
|
||||
if (my_getopt_print_errors)
|
||||
reporter(ERROR_LEVEL, "%s: Option '--set-variable' requires an argument\n",
|
||||
my_progname);
|
||||
my_getopt_error_reporter(ERROR_LEVEL,
|
||||
"%s: Option '--set-variable' requires an argument\n",
|
||||
my_progname);
|
||||
return EXIT_ARGUMENT_REQUIRED;
|
||||
}
|
||||
cur_arg= *pos;
|
||||
|
|
@ -215,10 +220,11 @@ int handle_options(int *argc, char ***argv,
|
|||
if (opt_found > 1)
|
||||
{
|
||||
if (my_getopt_print_errors)
|
||||
reporter(ERROR_LEVEL,
|
||||
"%s: ambiguous option '--%s-%s' (--%s-%s)\n",
|
||||
my_progname, special_opt_prefix[i], opt_str,
|
||||
special_opt_prefix[i], prev_found);
|
||||
my_getopt_error_reporter(ERROR_LEVEL,
|
||||
"%s: ambiguous option '--%s-%s' (--%s-%s)\n",
|
||||
my_progname, special_opt_prefix[i],
|
||||
cur_arg, special_opt_prefix[i],
|
||||
prev_found);
|
||||
return EXIT_AMBIGUOUS_OPTION;
|
||||
}
|
||||
switch (i) {
|
||||
|
|
@ -250,16 +256,20 @@ int handle_options(int *argc, char ***argv,
|
|||
if (must_be_var)
|
||||
{
|
||||
if (my_getopt_print_errors)
|
||||
reporter(option_is_loose ? WARNING_LEVEL : ERROR_LEVEL,
|
||||
"%s: unknown variable '%s'\n", my_progname, cur_arg);
|
||||
my_getopt_error_reporter(option_is_loose ?
|
||||
WARNING_LEVEL : ERROR_LEVEL,
|
||||
"%s: unknown variable '%s'\n",
|
||||
my_progname, cur_arg);
|
||||
if (!option_is_loose)
|
||||
return EXIT_UNKNOWN_VARIABLE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (my_getopt_print_errors)
|
||||
reporter(option_is_loose ? WARNING_LEVEL : ERROR_LEVEL,
|
||||
"%s: unknown option '--%s'\n", my_progname, cur_arg);
|
||||
my_getopt_error_reporter(option_is_loose ?
|
||||
WARNING_LEVEL : ERROR_LEVEL,
|
||||
"%s: unknown option '--%s'\n",
|
||||
my_progname, cur_arg);
|
||||
if (!option_is_loose)
|
||||
return EXIT_UNKNOWN_OPTION;
|
||||
}
|
||||
|
|
@ -275,15 +285,18 @@ int handle_options(int *argc, char ***argv,
|
|||
if (must_be_var)
|
||||
{
|
||||
if (my_getopt_print_errors)
|
||||
reporter(ERROR_LEVEL, "%s: variable prefix '%s' is not unique\n",
|
||||
my_progname, opt_str);
|
||||
my_getopt_error_reporter(ERROR_LEVEL,
|
||||
"%s: variable prefix '%s' is not unique\n",
|
||||
my_progname, opt_str);
|
||||
return EXIT_VAR_PREFIX_NOT_UNIQUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (my_getopt_print_errors)
|
||||
reporter(ERROR_LEVEL, "%s: ambiguous option '--%s' (%s, %s)\n",
|
||||
my_progname, opt_str, prev_found, optp->name);
|
||||
my_getopt_error_reporter(ERROR_LEVEL,
|
||||
"%s: ambiguous option '--%s' (%s, %s)\n",
|
||||
my_progname, opt_str, prev_found,
|
||||
optp->name);
|
||||
return EXIT_AMBIGUOUS_OPTION;
|
||||
}
|
||||
}
|
||||
|
|
@ -303,8 +316,9 @@ int handle_options(int *argc, char ***argv,
|
|||
if (must_be_var && (optp->var_type & GET_TYPE_MASK) == GET_NO_ARG)
|
||||
{
|
||||
if (my_getopt_print_errors)
|
||||
reporter(ERROR_LEVEL, "%s: option '%s' cannot take an argument\n",
|
||||
my_progname, optp->name);
|
||||
my_getopt_error_reporter(ERROR_LEVEL,
|
||||
"%s: option '%s' cannot take an argument\n",
|
||||
my_progname, optp->name);
|
||||
return EXIT_NO_ARGUMENT_ALLOWED;
|
||||
}
|
||||
value= optp->var_type & GET_ASK_ADDR ?
|
||||
|
|
@ -315,8 +329,9 @@ int handle_options(int *argc, char ***argv,
|
|||
if (optend && (optp->var_type & GET_TYPE_MASK) != GET_BOOL)
|
||||
{
|
||||
if (my_getopt_print_errors)
|
||||
reporter(ERROR_LEVEL, "%s: option '--%s' cannot take an argument\n",
|
||||
my_progname, optp->name);
|
||||
my_getopt_error_reporter(ERROR_LEVEL,
|
||||
"%s: option '--%s' cannot take an argument\n",
|
||||
my_progname, optp->name);
|
||||
return EXIT_NO_ARGUMENT_ALLOWED;
|
||||
}
|
||||
if ((optp->var_type & GET_TYPE_MASK) == GET_BOOL)
|
||||
|
|
@ -354,8 +369,9 @@ int handle_options(int *argc, char ***argv,
|
|||
if (!*++pos)
|
||||
{
|
||||
if (my_getopt_print_errors)
|
||||
reporter(ERROR_LEVEL, "%s: option '--%s' requires an argument\n",
|
||||
my_progname, optp->name);
|
||||
my_getopt_error_reporter(ERROR_LEVEL,
|
||||
"%s: option '--%s' requires an argument\n",
|
||||
my_progname, optp->name);
|
||||
return EXIT_ARGUMENT_REQUIRED;
|
||||
}
|
||||
argument= *pos;
|
||||
|
|
@ -413,9 +429,9 @@ int handle_options(int *argc, char ***argv,
|
|||
if (!pos[1])
|
||||
{
|
||||
if (my_getopt_print_errors)
|
||||
reporter(ERROR_LEVEL,
|
||||
"%s: option '-%c' requires an argument\n",
|
||||
my_progname, optp->id);
|
||||
my_getopt_error_reporter(ERROR_LEVEL,
|
||||
"%s: option '-%c' requires an argument\n",
|
||||
my_progname, optp->id);
|
||||
return EXIT_ARGUMENT_REQUIRED;
|
||||
}
|
||||
argument= *++pos;
|
||||
|
|
@ -426,9 +442,9 @@ int handle_options(int *argc, char ***argv,
|
|||
if ((error= setval(optp, optp->value, argument,
|
||||
set_maximum_value)))
|
||||
{
|
||||
reporter(ERROR_LEVEL,
|
||||
"%s: Error while setting value '%s' to '%s'\n",
|
||||
my_progname, argument, optp->name);
|
||||
my_getopt_error_reporter(ERROR_LEVEL,
|
||||
"%s: Error while setting value '%s' to '%s'\n",
|
||||
my_progname, argument, optp->name);
|
||||
return error;
|
||||
}
|
||||
get_one_option(optp->id, optp, argument);
|
||||
|
|
@ -438,8 +454,9 @@ int handle_options(int *argc, char ***argv,
|
|||
if (!opt_found)
|
||||
{
|
||||
if (my_getopt_print_errors)
|
||||
reporter(ERROR_LEVEL,
|
||||
"%s: unknown option '-%c'\n", my_progname, *optend);
|
||||
my_getopt_error_reporter(ERROR_LEVEL,
|
||||
"%s: unknown option '-%c'\n",
|
||||
my_progname, *optend);
|
||||
return EXIT_UNKNOWN_OPTION;
|
||||
}
|
||||
}
|
||||
|
|
@ -448,9 +465,9 @@ int handle_options(int *argc, char ***argv,
|
|||
}
|
||||
if ((error= setval(optp, value, argument, set_maximum_value)))
|
||||
{
|
||||
reporter(ERROR_LEVEL,
|
||||
"%s: Error while setting value '%s' to '%s'\n",
|
||||
my_progname, argument, optp->name);
|
||||
my_getopt_error_reporter(ERROR_LEVEL,
|
||||
"%s: Error while setting value '%s' to '%s'\n",
|
||||
my_progname, argument, optp->name);
|
||||
return error;
|
||||
}
|
||||
get_one_option(optp->id, optp, argument);
|
||||
|
|
|
|||
|
|
@ -5660,7 +5660,7 @@ void Dbdict::execGET_TABINFOREQ(Signal* signal)
|
|||
signal->getSection(ssPtr,GetTabInfoReq::TABLE_NAME);
|
||||
SimplePropertiesSectionReader r0(ssPtr, getSectionSegmentPool());
|
||||
r0.reset(); // undo implicit first()
|
||||
if(r0.getWords((Uint32*)tableName, len))
|
||||
if(r0.getWords((Uint32*)tableName, ((len + 3)/4)))
|
||||
memcpy(keyRecord.tableName, tableName, len);
|
||||
else {
|
||||
jam();
|
||||
|
|
|
|||
|
|
@ -943,6 +943,7 @@ private:
|
|||
void ndbStartReqLab(Signal *, BlockReference ref);
|
||||
void nodeRestartStartRecConfLab(Signal *);
|
||||
void dihCopyCompletedLab(Signal *);
|
||||
void release_connect(ConnectRecordPtr ptr);
|
||||
void copyTableNode(Signal *,
|
||||
CopyTableNode* ctn,
|
||||
NodeRecordPtr regNodePtr);
|
||||
|
|
|
|||
|
|
@ -6130,13 +6130,9 @@ void Dbdih::execDIRELEASEREQ(Signal* signal)
|
|||
ptrCheckGuard(connectPtr, cconnectFileSize, connectRecord);
|
||||
ndbrequire(connectPtr.p->connectState != ConnectRecord::FREE);
|
||||
ndbrequire(connectPtr.p->userblockref == userRef);
|
||||
connectPtr.p->connectState = ConnectRecord::FREE;
|
||||
signal->theData[0] = connectPtr.p->userpointer;
|
||||
sendSignal(connectPtr.p->userblockref, GSN_DIRELEASECONF, signal, 1, JBB);
|
||||
connectPtr.p->nfConnect = cfirstconnect;
|
||||
cfirstconnect = connectPtr.i;
|
||||
connectPtr.p->userblockref = ZNIL;
|
||||
connectPtr.p->userpointer = RNIL;
|
||||
release_connect(connectPtr);
|
||||
}//Dbdih::execDIRELEASEREQ()
|
||||
|
||||
/*
|
||||
|
|
@ -6573,11 +6569,16 @@ Dbdih::sendAddFragreq(Signal* signal, ConnectRecordPtr connectPtr,
|
|||
DiAddTabConf::SignalLength, JBB);
|
||||
|
||||
// Release
|
||||
connectPtr.p->userblockref = ZNIL;
|
||||
connectPtr.p->userpointer = RNIL;
|
||||
connectPtr.p->connectState = ConnectRecord::FREE;
|
||||
connectPtr.p->nfConnect = cfirstconnect;
|
||||
cfirstconnect = connectPtr.i;
|
||||
release_connect(connectPtr);
|
||||
}
|
||||
void
|
||||
Dbdih::release_connect(ConnectRecordPtr ptr)
|
||||
{
|
||||
ptr.p->userblockref = ZNIL;
|
||||
ptr.p->userpointer = RNIL;
|
||||
ptr.p->connectState = ConnectRecord::FREE;
|
||||
ptr.p->nfConnect = cfirstconnect;
|
||||
cfirstconnect = ptr.i;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -6614,11 +6615,7 @@ Dbdih::execADD_FRAGREF(Signal* signal){
|
|||
}
|
||||
|
||||
// Release
|
||||
connectPtr.p->userblockref = ZNIL;
|
||||
connectPtr.p->userpointer = RNIL;
|
||||
connectPtr.p->connectState = ConnectRecord::FREE;
|
||||
connectPtr.p->nfConnect = cfirstconnect;
|
||||
cfirstconnect = connectPtr.i;
|
||||
release_connect(connectPtr);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -6627,10 +6624,10 @@ Dbdih::execADD_FRAGREF(Signal* signal){
|
|||
*/
|
||||
void Dbdih::addtabrefuseLab(Signal* signal, ConnectRecordPtr connectPtr, Uint32 errorCode)
|
||||
{
|
||||
connectPtr.p->connectState = ConnectRecord::INUSE;
|
||||
signal->theData[0] = connectPtr.p->userpointer;
|
||||
signal->theData[1] = errorCode;
|
||||
sendSignal(connectPtr.p->userblockref, GSN_DIADDTABREF, signal, 2, JBB);
|
||||
release_connect(connectPtr);
|
||||
return;
|
||||
}//Dbdih::addtabrefuseLab()
|
||||
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ then
|
|||
c_d="$c_d PRIMARY KEY Host (Host,Db,User),"
|
||||
c_d="$c_d KEY User (User)"
|
||||
c_d="$c_d )"
|
||||
c_d="$c_d CHARACTER SET utf8 COLLATE utf8_bin"
|
||||
c_d="$c_d comment='Database privileges';"
|
||||
|
||||
i_d="INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y');
|
||||
|
|
@ -98,6 +99,7 @@ then
|
|||
c_h="$c_h Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,"
|
||||
c_h="$c_h PRIMARY KEY Host (Host,Db)"
|
||||
c_h="$c_h )"
|
||||
c_h="$c_h CHARACTER SET utf8 COLLATE utf8_bin"
|
||||
c_h="$c_h comment='Host privileges; Merged with database privileges';"
|
||||
fi
|
||||
|
||||
|
|
@ -141,6 +143,7 @@ then
|
|||
c_u="$c_u max_connections int(11) unsigned DEFAULT 0 NOT NULL,"
|
||||
c_u="$c_u PRIMARY KEY Host (Host,User)"
|
||||
c_u="$c_u )"
|
||||
c_u="$c_u CHARACTER SET utf8 COLLATE utf8_bin"
|
||||
c_u="$c_u comment='Users and global privileges';"
|
||||
|
||||
if test "$1" = "test"
|
||||
|
|
@ -180,6 +183,7 @@ then
|
|||
c_f="$c_f type enum ('function','aggregate') NOT NULL,"
|
||||
c_f="$c_f PRIMARY KEY (name)"
|
||||
c_f="$c_f )"
|
||||
c_f="$c_f CHARACTER SET utf8 COLLATE utf8_bin"
|
||||
c_f="$c_f comment='User defined functions';"
|
||||
fi
|
||||
|
||||
|
|
@ -201,6 +205,7 @@ then
|
|||
c_t="$c_t PRIMARY KEY (Host,Db,User,Table_name),"
|
||||
c_t="$c_t KEY Grantor (Grantor)"
|
||||
c_t="$c_t )"
|
||||
c_t="$c_t CHARACTER SET utf8 COLLATE utf8_bin"
|
||||
c_t="$c_t comment='Table privileges';"
|
||||
fi
|
||||
|
||||
|
|
@ -220,6 +225,7 @@ then
|
|||
c_c="$c_c Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL,"
|
||||
c_c="$c_c PRIMARY KEY (Host,Db,User,Table_name,Column_name)"
|
||||
c_c="$c_c )"
|
||||
c_c="$c_c CHARACTER SET utf8 COLLATE utf8_bin"
|
||||
c_c="$c_c comment='Column privileges';"
|
||||
fi
|
||||
|
||||
|
|
@ -231,14 +237,15 @@ then
|
|||
|
||||
c_ht="$c_ht CREATE TABLE help_topic ("
|
||||
c_ht="$c_ht help_topic_id int unsigned not null,"
|
||||
c_ht="$c_ht name nvarchar(64) not null,"
|
||||
c_ht="$c_ht name varchar(64) not null,"
|
||||
c_ht="$c_ht help_category_id smallint unsigned not null,"
|
||||
c_ht="$c_ht description text not null,"
|
||||
c_ht="$c_ht example text not null,"
|
||||
c_ht="$c_ht url nvarchar(128) not null,"
|
||||
c_ht="$c_ht url varchar(128) not null,"
|
||||
c_ht="$c_ht primary key (help_topic_id),"
|
||||
c_ht="$c_ht unique index (name)"
|
||||
c_ht="$c_ht )"
|
||||
c_ht="$c_ht CHARACTER SET utf8"
|
||||
c_ht="$c_ht comment='help topics';"
|
||||
fi
|
||||
|
||||
|
|
@ -252,12 +259,13 @@ then
|
|||
|
||||
c_hc="$c_hc CREATE TABLE help_category ("
|
||||
c_hc="$c_hc help_category_id smallint unsigned not null,"
|
||||
c_hc="$c_hc name nvarchar(64) not null,"
|
||||
c_hc="$c_hc name varchar(64) not null,"
|
||||
c_hc="$c_hc parent_category_id smallint unsigned null,"
|
||||
c_hc="$c_hc url nvarchar(128) not null,"
|
||||
c_hc="$c_hc url varchar(128) not null,"
|
||||
c_hc="$c_hc primary key (help_category_id),"
|
||||
c_hc="$c_hc unique index (name)"
|
||||
c_hc="$c_hc )"
|
||||
c_hc="$c_hc CHARACTER SET utf8"
|
||||
c_hc="$c_hc comment='help categories';"
|
||||
fi
|
||||
|
||||
|
|
@ -269,10 +277,11 @@ then
|
|||
|
||||
c_hk="$c_hk CREATE TABLE help_keyword ("
|
||||
c_hk="$c_hk help_keyword_id int unsigned not null,"
|
||||
c_hk="$c_hk name nvarchar(64) not null,"
|
||||
c_hk="$c_hk name varchar(64) not null,"
|
||||
c_hk="$c_hk primary key (help_keyword_id),"
|
||||
c_hk="$c_hk unique index (name)"
|
||||
c_hk="$c_hk )"
|
||||
c_hk="$c_hk CHARACTER SET utf8"
|
||||
c_hk="$c_hk comment='help keywords';"
|
||||
fi
|
||||
|
||||
|
|
@ -287,6 +296,7 @@ then
|
|||
c_hr="$c_hr help_keyword_id int unsigned not null references help_keyword,"
|
||||
c_hr="$c_hr primary key (help_keyword_id, help_topic_id)"
|
||||
c_hr="$c_hr )"
|
||||
c_hr="$c_hr CHARACTER SET utf8"
|
||||
c_hr="$c_hr comment='keyword-topic relation';"
|
||||
fi
|
||||
|
||||
|
|
@ -300,7 +310,8 @@ then
|
|||
c_tzn="$c_tzn Name char(64) NOT NULL,"
|
||||
c_tzn="$c_tzn Time_zone_id int unsigned NOT NULL,"
|
||||
c_tzn="$c_tzn PRIMARY KEY Name (Name)"
|
||||
c_tzn="$c_tzn ) DEFAULT CHARACTER SET latin1"
|
||||
c_tzn="$c_tzn )"
|
||||
c_tzn="$c_tzn CHARACTER SET utf8"
|
||||
c_tzn="$c_tzn comment='Time zone names';"
|
||||
|
||||
if test "$1" = "test"
|
||||
|
|
@ -322,7 +333,8 @@ then
|
|||
c_tz="$c_tz Time_zone_id int unsigned NOT NULL auto_increment,"
|
||||
c_tz="$c_tz Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,"
|
||||
c_tz="$c_tz PRIMARY KEY TzId (Time_zone_id)"
|
||||
c_tz="$c_tz ) DEFAULT CHARACTER SET latin1"
|
||||
c_tz="$c_tz )"
|
||||
c_tz="$c_tz CHARACTER SET utf8"
|
||||
c_tz="$c_tz comment='Time zones';"
|
||||
|
||||
if test "$1" = "test"
|
||||
|
|
@ -343,7 +355,8 @@ then
|
|||
c_tzt="$c_tzt Transition_time bigint signed NOT NULL,"
|
||||
c_tzt="$c_tzt Transition_type_id int unsigned NOT NULL,"
|
||||
c_tzt="$c_tzt PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)"
|
||||
c_tzt="$c_tzt ) DEFAULT CHARACTER SET latin1"
|
||||
c_tzt="$c_tzt )"
|
||||
c_tzt="$c_tzt CHARACTER SET utf8"
|
||||
c_tzt="$c_tzt comment='Time zone transitions';"
|
||||
|
||||
if test "$1" = "test"
|
||||
|
|
@ -565,7 +578,8 @@ then
|
|||
c_tztt="$c_tztt Is_DST tinyint unsigned DEFAULT 0 NOT NULL,"
|
||||
c_tztt="$c_tztt Abbreviation char(8) DEFAULT '' NOT NULL,"
|
||||
c_tztt="$c_tztt PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)"
|
||||
c_tztt="$c_tztt ) DEFAULT CHARACTER SET latin1"
|
||||
c_tztt="$c_tztt )"
|
||||
c_tztt="$c_tztt CHARACTER SET utf8"
|
||||
c_tztt="$c_tztt comment='Time zone transition types';"
|
||||
|
||||
if test "$1" = "test"
|
||||
|
|
@ -601,7 +615,8 @@ then
|
|||
c_tzls="$c_tzls Transition_time bigint signed NOT NULL,"
|
||||
c_tzls="$c_tzls Correction int signed NOT NULL,"
|
||||
c_tzls="$c_tzls PRIMARY KEY TranTime (Transition_time)"
|
||||
c_tzls="$c_tzls ) DEFAULT CHARACTER SET latin1"
|
||||
c_tzls="$c_tzls )"
|
||||
c_tzts="$c_tzts CHARACTER SET utf8"
|
||||
c_tzls="$c_tzls comment='Leap seconds information for time zones';"
|
||||
|
||||
if test "$1" = "test"
|
||||
|
|
|
|||
|
|
@ -9,12 +9,12 @@
|
|||
-- this sql script.
|
||||
-- On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql'
|
||||
|
||||
ALTER TABLE user type=MyISAM;
|
||||
ALTER TABLE db type=MyISAM;
|
||||
ALTER TABLE host type=MyISAM;
|
||||
ALTER TABLE func type=MyISAM;
|
||||
ALTER TABLE columns_priv type=MyISAM;
|
||||
ALTER TABLE tables_priv type=MyISAM;
|
||||
ALTER TABLE user type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
ALTER TABLE db type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
ALTER TABLE host type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
ALTER TABLE func type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
ALTER TABLE columns_priv type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
ALTER TABLE tables_priv type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
ALTER TABLE user change Password Password char(41) binary not null;
|
||||
ALTER TABLE user add File_priv enum('N','Y') NOT NULL;
|
||||
CREATE TABLE IF NOT EXISTS func (
|
||||
|
|
@ -23,7 +23,7 @@ CREATE TABLE IF NOT EXISTS func (
|
|||
dl char(128) DEFAULT '' NOT NULL,
|
||||
type enum ('function','aggregate') NOT NULL,
|
||||
PRIMARY KEY (name)
|
||||
);
|
||||
) CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
|
||||
-- Detect whether or not we had the Grant_priv column
|
||||
SET @hadGrantPriv:=0;
|
||||
|
|
@ -63,7 +63,7 @@ CREATE TABLE IF NOT EXISTS tables_priv (
|
|||
Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL,
|
||||
Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (Host,Db,User,Table_name)
|
||||
);
|
||||
) CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS columns_priv (
|
||||
Host char(60) DEFAULT '' NOT NULL,
|
||||
|
|
@ -74,7 +74,7 @@ CREATE TABLE IF NOT EXISTS columns_priv (
|
|||
Timestamp timestamp(14),
|
||||
Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (Host,Db,User,Table_name,Column_name)
|
||||
);
|
||||
) CHARACTER SET utf8 COLLATE utf8_bin;
|
||||
|
||||
|
||||
--
|
||||
|
|
@ -156,7 +156,7 @@ description text not null,
|
|||
example text not null,
|
||||
url varchar(128) not null,
|
||||
primary key (help_topic_id), unique index (name)
|
||||
) comment='help topics';
|
||||
) CHARACTER SET utf8 comment='help topics';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS help_category (
|
||||
help_category_id smallint unsigned not null,
|
||||
|
|
@ -165,20 +165,20 @@ parent_category_id smallint unsigned null,
|
|||
url varchar(128) not null,
|
||||
primary key (help_category_id),
|
||||
unique index (name)
|
||||
) comment='help categories';
|
||||
) CHARACTER SET utf8 comment='help categories';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS help_relation (
|
||||
help_topic_id int unsigned not null references help_topic,
|
||||
help_keyword_id int unsigned not null references help_keyword,
|
||||
primary key (help_keyword_id, help_topic_id)
|
||||
) comment='keyword-topic relation';
|
||||
) CHARACTER SET utf8 comment='keyword-topic relation';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS help_keyword (
|
||||
help_keyword_id int unsigned not null,
|
||||
name varchar(64) not null,
|
||||
primary key (help_keyword_id),
|
||||
unique index (name)
|
||||
) comment='help keywords';
|
||||
) CHARACTER SET utf8 comment='help keywords';
|
||||
|
||||
#
|
||||
# Create missing time zone related tables
|
||||
|
|
@ -188,20 +188,20 @@ CREATE TABLE IF NOT EXISTS time_zone_name (
|
|||
Name char(64) NOT NULL,
|
||||
Time_zone_id int unsigned NOT NULL,
|
||||
PRIMARY KEY Name (Name)
|
||||
) DEFAULT CHARACTER SET latin1 comment='Time zone names';
|
||||
) CHARACTER SET utf8 comment='Time zone names';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS time_zone (
|
||||
Time_zone_id int unsigned NOT NULL auto_increment,
|
||||
Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,
|
||||
PRIMARY KEY TzId (Time_zone_id)
|
||||
) DEFAULT CHARACTER SET latin1 comment='Time zones';
|
||||
) CHARACTER SET utf8 comment='Time zones';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS time_zone_transition (
|
||||
Time_zone_id int unsigned NOT NULL,
|
||||
Transition_time bigint signed NOT NULL,
|
||||
Transition_type_id int unsigned NOT NULL,
|
||||
PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)
|
||||
) DEFAULT CHARACTER SET latin1 comment='Time zone transitions';
|
||||
) CHARACTER SET utf8 comment='Time zone transitions';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS time_zone_transition_type (
|
||||
Time_zone_id int unsigned NOT NULL,
|
||||
|
|
@ -210,11 +210,11 @@ Offset int signed DEFAULT 0 NOT NULL,
|
|||
Is_DST tinyint unsigned DEFAULT 0 NOT NULL,
|
||||
Abbreviation char(8) DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)
|
||||
) DEFAULT CHARACTER SET latin1 comment='Time zone transition types';
|
||||
) CHARACTER SET utf8 comment='Time zone transition types';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS time_zone_leap_second (
|
||||
Transition_time bigint signed NOT NULL,
|
||||
Correction int signed NOT NULL,
|
||||
PRIMARY KEY TranTime (Transition_time)
|
||||
) DEFAULT CHARACTER SET latin1 comment='Leap seconds information for time zones';
|
||||
) CHARACTER SET utf8 comment='Leap seconds information for time zones';
|
||||
|
||||
|
|
|
|||
|
|
@ -716,3 +716,13 @@ my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap)
|
|||
|
||||
return (my_time_t) tmp;
|
||||
} /* my_system_gmt_sec */
|
||||
|
||||
|
||||
/* Set MYSQL_TIME structure to 0000-00-00 00:00:00.000000 */
|
||||
|
||||
void set_zero_time(MYSQL_TIME *tm)
|
||||
{
|
||||
bzero((void*) tm, sizeof(*tm));
|
||||
tm->time_type= MYSQL_TIMESTAMP_NONE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -908,7 +908,7 @@ public:
|
|||
void reset(void) { charset()->cset->fill(charset(),ptr,field_length,' '); }
|
||||
int store(const char *to,uint length,CHARSET_INFO *charset);
|
||||
int store(longlong nr);
|
||||
int store(double nr) { return Field_str::store(nr); }
|
||||
int store(double nr) { return Field_str::store(nr); } /* QQ: To be deleted */
|
||||
double val_real(void);
|
||||
longlong val_int(void);
|
||||
String *val_str(String*,String *);
|
||||
|
|
@ -955,7 +955,7 @@ public:
|
|||
uint32 key_length() const { return (uint32) field_length; }
|
||||
int store(const char *to,uint length,CHARSET_INFO *charset);
|
||||
int store(longlong nr);
|
||||
int store(double nr) { return Field_str::store(nr); }
|
||||
int store(double nr) { return Field_str::store(nr); } /* QQ: To be deleted */
|
||||
double val_real(void);
|
||||
longlong val_int(void);
|
||||
String *val_str(String*,String *);
|
||||
|
|
|
|||
|
|
@ -362,7 +362,7 @@ static int get_options(int argc, char **argv)
|
|||
{
|
||||
int ho_error;
|
||||
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option, 0)))
|
||||
if ((ho_error= handle_options(&argc, &argv, my_long_options, get_one_option)))
|
||||
exit(ho_error);
|
||||
|
||||
if (argc >= 1)
|
||||
|
|
|
|||
|
|
@ -2752,7 +2752,6 @@ longlong Item_cond_xor::val_int()
|
|||
|
||||
Item *Item_func_not::neg_transformer(THD *thd) /* NOT(x) -> x */
|
||||
{
|
||||
// We should apply negation elimination to the argument of the NOT function
|
||||
return args[0];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -779,7 +779,8 @@ void unlock_global_read_lock(THD *thd)
|
|||
(is_not_commit || \
|
||||
global_read_lock_blocks_commit))
|
||||
|
||||
bool wait_if_global_read_lock(THD *thd, bool abort_on_refresh, bool is_not_commit)
|
||||
bool wait_if_global_read_lock(THD *thd, bool abort_on_refresh,
|
||||
bool is_not_commit)
|
||||
{
|
||||
const char *old_message;
|
||||
bool result= 0, need_exit_cond;
|
||||
|
|
|
|||
157
sql/log.cc
157
sql/log.cc
|
|
@ -43,37 +43,41 @@ static bool test_if_number(const char *str,
|
|||
|
||||
#ifdef __NT__
|
||||
static int eventSource = 0;
|
||||
void setupWindowsEventSource()
|
||||
|
||||
void setup_windows_event_source()
|
||||
{
|
||||
if (eventSource) return;
|
||||
HKEY hRegKey= NULL;
|
||||
DWORD dwError= 0;
|
||||
TCHAR szPath[MAX_PATH];
|
||||
DWORD dwTypes;
|
||||
|
||||
if (eventSource) // Ensure that we are only called once
|
||||
return;
|
||||
eventSource= 1;
|
||||
|
||||
eventSource = 1;
|
||||
HKEY hRegKey = NULL;
|
||||
DWORD dwError = 0;
|
||||
TCHAR szPath[ MAX_PATH ];
|
||||
// Create the event source registry key
|
||||
dwError= RegCreateKey(HKEY_LOCAL_MACHINE,
|
||||
"SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\MySQL",
|
||||
&hRegKey);
|
||||
|
||||
// Create the event source registry key
|
||||
dwError = RegCreateKey(HKEY_LOCAL_MACHINE,
|
||||
"SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\MySQL",
|
||||
&hRegKey);
|
||||
/* Name of the PE module that contains the message resource */
|
||||
GetModuleFileName(NULL, szPath, MAX_PATH);
|
||||
|
||||
// Name of the PE module that contains the message resource
|
||||
GetModuleFileName(NULL, szPath, MAX_PATH);
|
||||
/* Register EventMessageFile */
|
||||
dwError = RegSetValueEx(hRegKey, "EventMessageFile", 0, REG_EXPAND_SZ,
|
||||
(PBYTE) szPath, strlen(szPath)+1);
|
||||
|
||||
|
||||
// Register EventMessageFile
|
||||
dwError = RegSetValueEx(hRegKey, "EventMessageFile", 0, REG_EXPAND_SZ,
|
||||
(PBYTE) szPath, strlen(szPath)+1);
|
||||
/* Register supported event types */
|
||||
dwTypes= (EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE |
|
||||
EVENTLOG_INFORMATION_TYPE);
|
||||
dwError= RegSetValueEx(hRegKey, "TypesSupported", 0, REG_DWORD,
|
||||
(LPBYTE) &dwTypes, sizeof dwTypes);
|
||||
|
||||
|
||||
// Register supported event types
|
||||
DWORD dwTypes = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | EVENTLOG_INFORMATION_TYPE;
|
||||
dwError = RegSetValueEx(hRegKey, "TypesSupported", 0, REG_DWORD,
|
||||
(LPBYTE) &dwTypes, sizeof dwTypes);
|
||||
|
||||
RegCloseKey(hRegKey);
|
||||
RegCloseKey(hRegKey);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* __NT__ */
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -1413,12 +1417,24 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u",
|
|||
|
||||
/* Write log events to reset the 'run environment' of the SQL command */
|
||||
|
||||
if (thd && thd->options & OPTION_NO_FOREIGN_KEY_CHECKS)
|
||||
if (thd)
|
||||
{
|
||||
Query_log_event e(thd, "SET FOREIGN_KEY_CHECKS=1", 24, 0);
|
||||
e.set_log_pos(this);
|
||||
if (e.write(file))
|
||||
goto err;
|
||||
if (thd->options & OPTION_NO_FOREIGN_KEY_CHECKS)
|
||||
{
|
||||
Query_log_event e(thd, "SET FOREIGN_KEY_CHECKS=1", 24, 0);
|
||||
e.set_log_pos(this);
|
||||
if (e.write(file))
|
||||
goto err;
|
||||
}
|
||||
#if MYSQL_VERSION_ID < 40100
|
||||
if (thd->variables.convert_set)
|
||||
{
|
||||
Query_log_event e(thd, "SET CHARACTER SET DEFAULT", 25, 0);
|
||||
e.set_log_pos(this);
|
||||
if (e.write(file))
|
||||
goto err;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1984,8 +2000,8 @@ void print_buffer_to_file(enum loglevel level, const char *buffer)
|
|||
time_t skr;
|
||||
struct tm tm_tmp;
|
||||
struct tm *start;
|
||||
|
||||
DBUG_ENTER("print_buffer_to_log");
|
||||
DBUG_ENTER("print_buffer_to_file");
|
||||
DBUG_PRINT("enter",("buffer: %s", buffer));
|
||||
|
||||
VOID(pthread_mutex_lock(&LOCK_error_log));
|
||||
|
||||
|
|
@ -1999,13 +2015,13 @@ void print_buffer_to_file(enum loglevel level, const char *buffer)
|
|||
start->tm_hour,
|
||||
start->tm_min,
|
||||
start->tm_sec,
|
||||
level == ERROR_LEVEL ? "ERROR" : level == WARNING_LEVEL ? "WARNING" : "INFORMATION",
|
||||
buffer);
|
||||
(level == ERROR_LEVEL ? "ERROR" : level == WARNING_LEVEL ?
|
||||
"WARNING" : "INFORMATION"),
|
||||
buffer);
|
||||
|
||||
fflush(stderr);
|
||||
|
||||
VOID(pthread_mutex_unlock(&LOCK_error_log));
|
||||
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
|
@ -2019,6 +2035,7 @@ void sql_perror(const char *message)
|
|||
#endif
|
||||
}
|
||||
|
||||
|
||||
bool flush_error_log()
|
||||
{
|
||||
bool result=0;
|
||||
|
|
@ -2204,93 +2221,95 @@ void MYSQL_LOG::report_pos_in_innodb()
|
|||
}
|
||||
|
||||
#ifdef __NT__
|
||||
void print_buffer_to_nt_eventlog(enum loglevel level, char *buff, int buffLen)
|
||||
void print_buffer_to_nt_eventlog(enum loglevel level, char *buff,
|
||||
uint length, int buffLen)
|
||||
{
|
||||
HANDLE event;
|
||||
char *buffptr;
|
||||
LPCSTR *buffmsgptr;
|
||||
|
||||
DBUG_ENTER("print_buffer_to_nt_eventlog");
|
||||
|
||||
buffptr = buff;
|
||||
if (strlen(buff) > (uint)(buffLen-4))
|
||||
buffptr= buff;
|
||||
if (length > (uint)(buffLen-4))
|
||||
{
|
||||
char *newBuff = new char[ strlen(buff) + 4 ];
|
||||
char *newBuff= new char[length + 4];
|
||||
strcpy(newBuff, buff);
|
||||
buffptr = newBuff;
|
||||
buffptr= newBuff;
|
||||
}
|
||||
strcat(buffptr, "\r\n\r\n");
|
||||
buffmsgptr = (LPCSTR*)&buffptr;
|
||||
strmov(buffptr+length, "\r\n\r\n");
|
||||
buffmsgptr= (LPCSTR*) &buffptr; // Keep windows happy
|
||||
|
||||
setupWindowsEventSource();
|
||||
if (event = RegisterEventSource(NULL,"MySQL"))
|
||||
setup_windows_event_source();
|
||||
if ((event= RegisterEventSource(NULL,"MySQL")))
|
||||
{
|
||||
switch (level){
|
||||
switch (level) {
|
||||
case ERROR_LEVEL:
|
||||
ReportEvent(event, EVENTLOG_ERROR_TYPE, 0, MSG_DEFAULT, NULL, 1, 0, buffmsgptr, NULL);
|
||||
ReportEvent(event, EVENTLOG_ERROR_TYPE, 0, MSG_DEFAULT, NULL, 1, 0,
|
||||
buffmsgptr, NULL);
|
||||
break;
|
||||
case WARNING_LEVEL:
|
||||
ReportEvent(event, EVENTLOG_WARNING_TYPE, 0, MSG_DEFAULT, NULL, 1, 0, buffmsgptr, NULL);
|
||||
ReportEvent(event, EVENTLOG_WARNING_TYPE, 0, MSG_DEFAULT, NULL, 1, 0,
|
||||
buffmsgptr, NULL);
|
||||
break;
|
||||
case INFORMATION_LEVEL:
|
||||
ReportEvent(event, EVENTLOG_INFORMATION_TYPE, 0, MSG_DEFAULT, NULL, 1, 0, buffmsgptr, NULL);
|
||||
ReportEvent(event, EVENTLOG_INFORMATION_TYPE, 0, MSG_DEFAULT, NULL, 1,
|
||||
0, buffmsgptr, NULL);
|
||||
break;
|
||||
}
|
||||
DeregisterEventSource(event);
|
||||
}
|
||||
|
||||
// if we created a string buffer, then delete it
|
||||
/* if we created a string buffer, then delete it */
|
||||
if (buffptr != buff)
|
||||
delete[] buffptr;
|
||||
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
#endif
|
||||
#endif /* __NT__ */
|
||||
|
||||
|
||||
/*
|
||||
Prints a printf style message to the error log and, under NT, to the Windows event log.
|
||||
Prints a printf style message to the error log and, under NT, to the
|
||||
Windows event log.
|
||||
|
||||
SYNOPSIS
|
||||
vprint_msg_to_log()
|
||||
event_type Type of event to write (Error, Warning, or Info)
|
||||
format Printf style format of message
|
||||
args va_list list of arguments for the message
|
||||
event_type Type of event to write (Error, Warning, or Info)
|
||||
format Printf style format of message
|
||||
args va_list list of arguments for the message
|
||||
|
||||
NOTE
|
||||
|
||||
IMPLEMENTATION
|
||||
This function prints the message into a buffer and then sends that buffer to other
|
||||
functions to write that message to other logging sources.
|
||||
This function prints the message into a buffer and then sends that buffer
|
||||
to other functions to write that message to other logging sources.
|
||||
|
||||
RETURN VALUES
|
||||
void
|
||||
*/
|
||||
|
||||
void vprint_msg_to_log(enum loglevel level, const char *format, va_list args)
|
||||
{
|
||||
char buff[1024];
|
||||
uint length;
|
||||
DBUG_ENTER("vprint_msg_to_log");
|
||||
|
||||
my_vsnprintf(buff, sizeof(buff)-5, format, args);
|
||||
|
||||
length= my_vsnprintf(buff, sizeof(buff)-5, format, args);
|
||||
print_buffer_to_file(level, buff);
|
||||
|
||||
#ifndef DBUG_OFF
|
||||
DBUG_PRINT("error",("%s",buff));
|
||||
#endif
|
||||
|
||||
#ifdef __NT__
|
||||
print_buffer_to_nt_eventlog(level, buff, sizeof(buff));
|
||||
print_buffer_to_nt_eventlog(level, buff, length, sizeof(buff));
|
||||
#endif
|
||||
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
||||
void sql_print_error(const char *format, ...)
|
||||
void sql_print_error(const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
DBUG_ENTER("sql_print_error");
|
||||
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
vprint_msg_to_log(ERROR_LEVEL, format, args);
|
||||
va_end(args);
|
||||
|
|
@ -2298,11 +2317,12 @@ void sql_print_error(const char *format, ...)
|
|||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
void sql_print_warning(const char *format, ...)
|
||||
|
||||
void sql_print_warning(const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
DBUG_ENTER("sql_print_warning");
|
||||
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
vprint_msg_to_log(WARNING_LEVEL, format, args);
|
||||
va_end(args);
|
||||
|
|
@ -2310,11 +2330,12 @@ void sql_print_warning(const char *format, ...)
|
|||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
void sql_print_information(const char *format, ...)
|
||||
|
||||
void sql_print_information(const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
DBUG_ENTER("sql_print_information");
|
||||
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
vprint_msg_to_log(INFORMATION_LEVEL, format, args);
|
||||
va_end(args);
|
||||
|
|
|
|||
|
|
@ -1084,10 +1084,6 @@ end:
|
|||
thd->query= 0; // just to be sure
|
||||
thd->query_length= 0;
|
||||
VOID(pthread_mutex_unlock(&LOCK_thread_count));
|
||||
// assume no convert for next query unless set explictly
|
||||
#ifdef TO_BE_REMOVED
|
||||
thd->variables.convert_set = 0;
|
||||
#endif
|
||||
close_thread_tables(thd);
|
||||
free_root(&thd->mem_root,MYF(MY_KEEP_PREALLOC));
|
||||
return (thd->query_error ? thd->query_error : Log_event::exec_event(rli));
|
||||
|
|
|
|||
|
|
@ -6108,14 +6108,16 @@ mysql_getopt_value(const char *keyname, uint key_length,
|
|||
return option->value;
|
||||
}
|
||||
|
||||
void option_error_reporter( enum loglevel level, const char *format, ... )
|
||||
|
||||
void option_error_reporter(enum loglevel level, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start( args, format );
|
||||
vprint_msg_to_log( level, format, args );
|
||||
va_end( args );
|
||||
va_start(args, format);
|
||||
vprint_msg_to_log(level, format, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
|
||||
static void get_options(int argc,char **argv)
|
||||
{
|
||||
int ho_error;
|
||||
|
|
@ -6123,7 +6125,9 @@ static void get_options(int argc,char **argv)
|
|||
my_getopt_register_get_addr(mysql_getopt_value);
|
||||
strmake(def_ft_boolean_syntax, ft_boolean_syntax,
|
||||
sizeof(ft_boolean_syntax)-1);
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option, option_error_reporter)))
|
||||
my_getopt_error_reporter= option_error_reporter;
|
||||
if ((ho_error= handle_options(&argc, &argv, my_long_options,
|
||||
get_one_option)))
|
||||
exit(ho_error);
|
||||
if (argc > 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2138,7 +2138,10 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
|
|||
select list over other fields from the tables participating in
|
||||
this select in case of ambiguity.
|
||||
|
||||
QQ: Why do we use simple strcmp for table name comparison here ?
|
||||
We use strcmp for table names and database names as these may be
|
||||
case sensitive.
|
||||
In cases where they are not case sensitive, they are always in lower
|
||||
case.
|
||||
*/
|
||||
if (!my_strcasecmp(system_charset_info, item_field->field_name,
|
||||
field_name) &&
|
||||
|
|
@ -2157,10 +2160,12 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
|
|||
}
|
||||
found= li.ref();
|
||||
*counter= i;
|
||||
if (db_name)
|
||||
break; // Perfect match
|
||||
}
|
||||
}
|
||||
else if (!my_strcasecmp(system_charset_info, item_field->name,
|
||||
field_name))
|
||||
field_name))
|
||||
{
|
||||
/*
|
||||
If table name was not given we should scan through aliases
|
||||
|
|
@ -2230,7 +2235,7 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
|
|||
}
|
||||
if (found)
|
||||
return found;
|
||||
else if (report_error != REPORT_EXCEPT_NOT_FOUND)
|
||||
if (report_error != REPORT_EXCEPT_NOT_FOUND)
|
||||
{
|
||||
if (report_error == REPORT_ALL_ERRORS)
|
||||
my_printf_error(ER_BAD_FIELD_ERROR, ER(ER_BAD_FIELD_ERROR), MYF(0),
|
||||
|
|
@ -2445,13 +2450,16 @@ insert_fields(THD *thd,TABLE_LIST *tables, const char *db_name,
|
|||
uint found;
|
||||
DBUG_ENTER("insert_fields");
|
||||
|
||||
|
||||
if (db_name && lower_case_table_names)
|
||||
{
|
||||
/* convert database to lower case for comparison */
|
||||
/*
|
||||
convert database to lower case for comparison
|
||||
We can't do this in Item_field as this would change the
|
||||
'name' of the item which may be used in the select list
|
||||
*/
|
||||
strmake(name_buff, db_name, sizeof(name_buff)-1);
|
||||
my_casedn_str(system_charset_info,name_buff);
|
||||
db_name = name_buff;
|
||||
my_casedn_str(files_charset_info, name_buff);
|
||||
db_name= name_buff;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -890,8 +890,10 @@ static File create_file(THD *thd, char *path, sql_exchange *exchange,
|
|||
#ifdef DONT_ALLOW_FULL_LOAD_DATA_PATHS
|
||||
option|= MY_REPLACE_DIR; // Force use of db directory
|
||||
#endif
|
||||
(void) fn_format(path, exchange->file_name, thd->db ? thd->db : "", "",
|
||||
option);
|
||||
|
||||
strxnmov(path, FN_REFLEN, mysql_real_data_home, thd->db ? thd->db : "",
|
||||
NullS);
|
||||
(void) fn_format(path, exchange->file_name, path, "", option);
|
||||
if (!access(path, F_OK))
|
||||
{
|
||||
my_error(ER_FILE_EXISTS_ERROR, MYF(0), exchange->file_name);
|
||||
|
|
|
|||
|
|
@ -180,26 +180,16 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
|
|||
ex->file_name+=dirname_length(ex->file_name);
|
||||
#endif
|
||||
if (!dirname_length(ex->file_name) &&
|
||||
strlen(ex->file_name)+strlen(mysql_data_home)+strlen(tdb)+3 <
|
||||
strlen(ex->file_name)+strlen(mysql_real_data_home)+strlen(tdb)+3 <
|
||||
FN_REFLEN)
|
||||
{
|
||||
(void) sprintf(name,"%s/%s/%s",mysql_data_home,tdb,ex->file_name);
|
||||
(void) sprintf(name,"%s%s/%s",mysql_real_data_home,tdb,ex->file_name);
|
||||
unpack_filename(name,name); /* Convert to system format */
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef EMBEDDED_LIBRARY
|
||||
char *chk_name= ex->file_name;
|
||||
while ((*chk_name == ' ') || (*chk_name == 't'))
|
||||
chk_name++;
|
||||
if (*chk_name == FN_CURLIB)
|
||||
{
|
||||
sprintf(name, "%s%s", mysql_data_home, ex->file_name);
|
||||
unpack_filename(name, name);
|
||||
}
|
||||
else
|
||||
#endif /*EMBEDDED_LIBRARY*/
|
||||
unpack_filename(name,ex->file_name);
|
||||
my_load_path(name, ex->file_name, mysql_real_data_home);
|
||||
unpack_filename(name, name);
|
||||
#if !defined(__WIN__) && !defined(OS2) && ! defined(__NETWARE__)
|
||||
MY_STAT stat_info;
|
||||
if (!my_stat(name,&stat_info,MYF(MY_WME)))
|
||||
|
|
|
|||
|
|
@ -329,15 +329,22 @@ static void set_param_double(Item_param *param, uchar **pos, ulong len)
|
|||
}
|
||||
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
|
||||
/*
|
||||
Read date/time/datetime parameter values from network (binary
|
||||
protocol). See writing counterparts of these functions in
|
||||
libmysql.c (store_param_{time,date,datetime}).
|
||||
*/
|
||||
|
||||
static void set_param_time(Item_param *param, uchar **pos, ulong len)
|
||||
{
|
||||
ulong length;
|
||||
uint day;
|
||||
MYSQL_TIME tm;
|
||||
ulong length= get_param_length(pos, len);
|
||||
|
||||
if ((length= get_param_length(pos, len)) >= 8)
|
||||
if (length >= 8)
|
||||
{
|
||||
uchar *to= *pos;
|
||||
TIME tm;
|
||||
uint day;
|
||||
|
||||
tm.neg= (bool) to[0];
|
||||
day= (uint) sint4korr(to+1);
|
||||
|
|
@ -359,21 +366,22 @@ static void set_param_time(Item_param *param, uchar **pos, ulong len)
|
|||
tm.second= 59;
|
||||
}
|
||||
tm.day= tm.year= tm.month= 0;
|
||||
|
||||
param->set_time(&tm, MYSQL_TIMESTAMP_TIME,
|
||||
MAX_TIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN);
|
||||
}
|
||||
else
|
||||
set_zero_time(&tm);
|
||||
param->set_time(&tm, MYSQL_TIMESTAMP_TIME,
|
||||
MAX_TIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN);
|
||||
*pos+= length;
|
||||
}
|
||||
|
||||
static void set_param_datetime(Item_param *param, uchar **pos, ulong len)
|
||||
{
|
||||
uint length;
|
||||
MYSQL_TIME tm;
|
||||
ulong length= get_param_length(pos, len);
|
||||
|
||||
if ((length= get_param_length(pos, len)) >= 4)
|
||||
if (length >= 4)
|
||||
{
|
||||
uchar *to= *pos;
|
||||
TIME tm;
|
||||
|
||||
tm.neg= 0;
|
||||
tm.year= (uint) sint2korr(to);
|
||||
|
|
@ -394,21 +402,22 @@ static void set_param_datetime(Item_param *param, uchar **pos, ulong len)
|
|||
tm.hour= tm.minute= tm.second= 0;
|
||||
|
||||
tm.second_part= (length > 7) ? (ulong) sint4korr(to+7) : 0;
|
||||
|
||||
param->set_time(&tm, MYSQL_TIMESTAMP_DATETIME,
|
||||
MAX_DATETIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN);
|
||||
}
|
||||
else
|
||||
set_zero_time(&tm);
|
||||
param->set_time(&tm, MYSQL_TIMESTAMP_DATETIME,
|
||||
MAX_DATETIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN);
|
||||
*pos+= length;
|
||||
}
|
||||
|
||||
static void set_param_date(Item_param *param, uchar **pos, ulong len)
|
||||
{
|
||||
ulong length;
|
||||
|
||||
if ((length= get_param_length(pos, len)) >= 4)
|
||||
MYSQL_TIME tm;
|
||||
ulong length= get_param_length(pos, len);
|
||||
|
||||
if (length >= 4)
|
||||
{
|
||||
uchar *to= *pos;
|
||||
TIME tm;
|
||||
/*
|
||||
Note, that though ranges of hour, minute and second are not checked
|
||||
here we rely on them being < 256: otherwise
|
||||
|
|
@ -421,10 +430,11 @@ static void set_param_date(Item_param *param, uchar **pos, ulong len)
|
|||
tm.hour= tm.minute= tm.second= 0;
|
||||
tm.second_part= 0;
|
||||
tm.neg= 0;
|
||||
|
||||
param->set_time(&tm, MYSQL_TIMESTAMP_DATE,
|
||||
MAX_DATE_WIDTH * MY_CHARSET_BIN_MB_MAXLEN);
|
||||
}
|
||||
else
|
||||
set_zero_time(&tm);
|
||||
param->set_time(&tm, MYSQL_TIMESTAMP_DATE,
|
||||
MAX_DATE_WIDTH * MY_CHARSET_BIN_MB_MAXLEN);
|
||||
*pos+= length;
|
||||
}
|
||||
|
||||
|
|
@ -1041,7 +1051,7 @@ static int mysql_test_select(Prepared_statement *stmt,
|
|||
THD *thd= stmt->thd;
|
||||
LEX *lex= stmt->lex;
|
||||
SELECT_LEX_UNIT *unit= &lex->unit;
|
||||
|
||||
int result= 1;
|
||||
DBUG_ENTER("mysql_test_select");
|
||||
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
|
|
@ -1087,13 +1097,12 @@ static int mysql_test_select(Prepared_statement *stmt,
|
|||
goto err_prep;
|
||||
}
|
||||
}
|
||||
unit->cleanup();
|
||||
DBUG_RETURN(0);
|
||||
result= 0; // ok
|
||||
|
||||
err_prep:
|
||||
unit->cleanup();
|
||||
err:
|
||||
DBUG_RETURN(1);
|
||||
DBUG_RETURN(result);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3220,7 +3220,7 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, KEYUSE *org_keyuse,
|
|||
|
||||
store_key **ref_key= j->ref.key_copy;
|
||||
byte *key_buff=j->ref.key_buff, *null_ref_key= 0;
|
||||
bool keyuse_uses_no_tables= true;
|
||||
bool keyuse_uses_no_tables= TRUE;
|
||||
if (ftkey)
|
||||
{
|
||||
j->ref.items[0]=((Item_func*)(keyuse->val))->key_item();
|
||||
|
|
@ -3240,7 +3240,7 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, KEYUSE *org_keyuse,
|
|||
|
||||
uint maybe_null= test(keyinfo->key_part[i].null_bit);
|
||||
j->ref.items[i]=keyuse->val; // Save for cond removal
|
||||
keyuse_uses_no_tables= keyuse_uses_no_tables & !keyuse->used_tables;
|
||||
keyuse_uses_no_tables= keyuse_uses_no_tables && !keyuse->used_tables;
|
||||
if (!keyuse->used_tables &&
|
||||
!(join->select_options & SELECT_DESCRIBE))
|
||||
{ // Compare against constant
|
||||
|
|
|
|||
|
|
@ -1579,7 +1579,7 @@ static int prepare_for_restore(THD* thd, TABLE_LIST* table,
|
|||
reg_ext))
|
||||
DBUG_RETURN(-1); // protect buffer overflow
|
||||
|
||||
my_snprintf(dst_path, sizeof(dst_path), "%s/%s/%s",
|
||||
my_snprintf(dst_path, sizeof(dst_path), "%s%s/%s",
|
||||
mysql_real_data_home, db, table_name);
|
||||
|
||||
if (lock_and_wait_for_table_name(thd,table))
|
||||
|
|
|
|||
11
sql/table.cc
11
sql/table.cc
|
|
@ -1084,6 +1084,17 @@ void append_unescaped(String *res, const char *pos, uint length)
|
|||
|
||||
for (; pos != end ; pos++)
|
||||
{
|
||||
#if defined(USE_MB) && MYSQL_VERSION_ID < 40100
|
||||
uint mblen;
|
||||
if (use_mb(default_charset_info) &&
|
||||
(mblen= my_ismbchar(default_charset_info, pos, end)))
|
||||
{
|
||||
res->append(pos, mblen);
|
||||
pos+= mblen;
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (*pos) {
|
||||
case 0: /* Must be escaped for 'mysql' */
|
||||
res->append('\\');
|
||||
|
|
|
|||
|
|
@ -10091,6 +10091,78 @@ static void test_bug5126()
|
|||
}
|
||||
|
||||
|
||||
static void test_bug4231()
|
||||
{
|
||||
MYSQL_STMT *stmt;
|
||||
MYSQL_BIND bind[2];
|
||||
MYSQL_TIME tm[2];
|
||||
const char *stmt_text;
|
||||
int rc;
|
||||
|
||||
myheader("test_bug4231");
|
||||
|
||||
stmt_text= "DROP TABLE IF EXISTS t1";
|
||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
||||
myquery(rc);
|
||||
|
||||
stmt_text= "CREATE TABLE t1 (a int)";
|
||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
||||
myquery(rc);
|
||||
|
||||
stmt_text= "INSERT INTO t1 VALUES (1)";
|
||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
||||
myquery(rc);
|
||||
|
||||
stmt= mysql_stmt_init(mysql);
|
||||
stmt_text= "SELECT a FROM t1 WHERE ? = ?";
|
||||
rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text));
|
||||
check_execute(stmt, rc);
|
||||
|
||||
/* Bind input buffers */
|
||||
bzero(bind, sizeof(bind));
|
||||
bzero(tm, sizeof(tm));
|
||||
|
||||
bind[0].buffer_type= MYSQL_TYPE_TIME;
|
||||
bind[0].buffer= (void*) tm;
|
||||
bind[1].buffer_type= MYSQL_TYPE_TIME;
|
||||
bind[1].buffer= (void*) tm+1;
|
||||
|
||||
mysql_stmt_bind_param(stmt, bind);
|
||||
check_execute(stmt, rc);
|
||||
|
||||
/*
|
||||
First set server-side params to some non-zero non-equal values:
|
||||
then we will check that they are not used when client sends
|
||||
new (zero) times.
|
||||
*/
|
||||
tm[0].time_type = MYSQL_TIMESTAMP_DATE;
|
||||
tm[0].year = 2000;
|
||||
tm[0].month = 1;
|
||||
tm[0].day = 1;
|
||||
tm[1]= tm[0];
|
||||
--tm[1].year; /* tm[0] != tm[1] */
|
||||
|
||||
rc= mysql_stmt_execute(stmt);
|
||||
check_execute(stmt, rc);
|
||||
|
||||
rc= mysql_stmt_fetch(stmt);
|
||||
|
||||
/* binds are unequal, no rows should be returned */
|
||||
DBUG_ASSERT(rc == MYSQL_NO_DATA);
|
||||
|
||||
/* Set one of the dates to zero */
|
||||
tm[0].year= tm[0].month= tm[0].day= 0;
|
||||
tm[1]= tm[1];
|
||||
mysql_stmt_execute(stmt);
|
||||
rc= mysql_stmt_fetch(stmt);
|
||||
DBUG_ASSERT(rc == 0);
|
||||
|
||||
mysql_stmt_close(stmt);
|
||||
stmt_text= "DROP TABLE t1";
|
||||
rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text));
|
||||
myquery(rc);
|
||||
}
|
||||
|
||||
/*
|
||||
Read and parse arguments and MySQL options from my.cnf
|
||||
*/
|
||||
|
|
@ -10189,7 +10261,7 @@ static void get_options(int argc, char **argv)
|
|||
int ho_error;
|
||||
|
||||
if ((ho_error= handle_options(&argc, &argv, client_test_long_options,
|
||||
get_one_option, 0)))
|
||||
get_one_option)))
|
||||
exit(ho_error);
|
||||
|
||||
if (tty_password)
|
||||
|
|
@ -10389,6 +10461,8 @@ int main(int argc, char **argv)
|
|||
test_bug4030(); /* test conversion string -> time types in
|
||||
libmysql */
|
||||
test_bug5126(); /* support for mediumint type in libmysql */
|
||||
test_bug4231(); /* proper handling of all-zero times and
|
||||
dates in the server */
|
||||
/*
|
||||
XXX: PLEASE RUN THIS PROGRAM UNDER VALGRIND AND VERIFY THAT YOUR TEST
|
||||
DOESN'T CONTAIN WARNINGS/ERRORS BEFORE YOU PUSH.
|
||||
|
|
|
|||
|
|
@ -1335,7 +1335,7 @@ static int parse_args(int argc, char **argv)
|
|||
{
|
||||
int ho_error;
|
||||
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option, NULL)))
|
||||
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
|
||||
exit(ho_error);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue