Merge with 4.1
BitKeeper/etc/logging_ok: auto-union client/mysqltest.c: Auto merged configure.in: Auto merged include/my_global.h: Auto merged mysql-test/r/bdb.result: Auto merged mysql-test/r/connect.result: Auto merged mysql-test/r/multi_update.result: Auto merged mysql-test/r/show_check.result: Auto merged mysql-test/r/system_mysql_db.result: Auto merged mysql-test/t/multi_update.test: Auto merged sql/ha_berkeley.cc: Auto merged sql/ha_berkeley.h: Auto merged sql/ha_heap.h: Auto merged sql/ha_innodb.h: Auto merged sql/handler.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/log.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/set_var.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_db.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_update.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/opt_range.cc: Merge with 4.1 true -> TRUE and false -> FALSE
This commit is contained in:
commit
677d60bc61
@ -11,6 +11,7 @@ administrador@light.hegel.local
|
|||||||
ahlentz@co3064164-a.rochd1.qld.optusnet.com.au
|
ahlentz@co3064164-a.rochd1.qld.optusnet.com.au
|
||||||
akishkin@work.mysql.com
|
akishkin@work.mysql.com
|
||||||
antony@ltantony.dsl-verizon.net
|
antony@ltantony.dsl-verizon.net
|
||||||
|
antony@ltantony.rdg.cyberkinetica.com
|
||||||
antony@ltantony.rdg.cyberkinetica.homeunix.net
|
antony@ltantony.rdg.cyberkinetica.homeunix.net
|
||||||
arjen@bitbike.com
|
arjen@bitbike.com
|
||||||
arjen@co3064164-a.bitbike.com
|
arjen@co3064164-a.bitbike.com
|
||||||
@ -124,6 +125,7 @@ mwagner@work.mysql.com
|
|||||||
mydev@mysql.com
|
mydev@mysql.com
|
||||||
mysql@home.(none)
|
mysql@home.(none)
|
||||||
mysqldev@build.mysql2.com
|
mysqldev@build.mysql2.com
|
||||||
|
mysqldev@melody.local
|
||||||
mysqldev@mysql.com
|
mysqldev@mysql.com
|
||||||
ndbdev@ndbmaster.mysql.com
|
ndbdev@ndbmaster.mysql.com
|
||||||
nick@mysql.com
|
nick@mysql.com
|
||||||
|
@ -46,6 +46,7 @@ $opt_test= undef;
|
|||||||
$opt_skip_check= undef;
|
$opt_skip_check= undef;
|
||||||
$opt_skip_manual= undef;
|
$opt_skip_manual= undef;
|
||||||
$opt_win_dist= undef;
|
$opt_win_dist= undef;
|
||||||
|
$opt_quiet= undef;
|
||||||
$version= "unknown";
|
$version= "unknown";
|
||||||
$major=$minor=$release=0;
|
$major=$minor=$release=0;
|
||||||
|
|
||||||
@ -67,7 +68,8 @@ GetOptions(
|
|||||||
"suffix=s",
|
"suffix=s",
|
||||||
"test|t",
|
"test|t",
|
||||||
"verbose|v",
|
"verbose|v",
|
||||||
"win-dist|w"
|
"win-dist|w",
|
||||||
|
"quiet|q",
|
||||||
) || print_help("");
|
) || print_help("");
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -99,8 +101,6 @@ if (defined $opt_build_command)
|
|||||||
print_help("") if ($opt_help);
|
print_help("") if ($opt_help);
|
||||||
defined($REPO=$ARGV[0]) || print_help("Please enter the BK repository to be used!");
|
defined($REPO=$ARGV[0]) || print_help("Please enter the BK repository to be used!");
|
||||||
|
|
||||||
$subject= "Bootstrap of $REPO failed" if $opt_mail;
|
|
||||||
|
|
||||||
&logger("Starting build");
|
&logger("Starting build");
|
||||||
&abort("The directory \"$REPO\" could not be found!") if (!-d $REPO);
|
&abort("The directory \"$REPO\" could not be found!") if (!-d $REPO);
|
||||||
&logger("Using $REPO as the BK parent repository");
|
&logger("Using $REPO as the BK parent repository");
|
||||||
@ -306,7 +306,7 @@ if (!$opt_dry_run)
|
|||||||
#
|
#
|
||||||
# Now build the source distribution
|
# Now build the source distribution
|
||||||
#
|
#
|
||||||
&logger("Compiling");
|
&logger("Compiling...");
|
||||||
$command= $build_command;
|
$command= $build_command;
|
||||||
&run_command($command, "Compilation failed!");
|
&run_command($command, "Compilation failed!");
|
||||||
|
|
||||||
@ -403,6 +403,7 @@ Options:
|
|||||||
include a log file snippet, if logging is enabled)
|
include a log file snippet, if logging is enabled)
|
||||||
Note that the \@-Sign needs to be quoted!
|
Note that the \@-Sign needs to be quoted!
|
||||||
Example: --mail=user\\\@domain.com
|
Example: --mail=user\\\@domain.com
|
||||||
|
-q, --quiet Be quiet
|
||||||
-p, --pull Update the source BK trees before building
|
-p, --pull Update the source BK trees before building
|
||||||
-r, --revision=<rev> Export the tree as of revision <rev>
|
-r, --revision=<rev> Export the tree as of revision <rev>
|
||||||
(default is up to the latest revision)
|
(default is up to the latest revision)
|
||||||
|
@ -204,6 +204,17 @@ if ($opt_stage == 0)
|
|||||||
safe_cd($host);
|
safe_cd($host);
|
||||||
if ($opt_stage == 0 && ! $opt_use_old_distribution)
|
if ($opt_stage == 0 && ! $opt_use_old_distribution)
|
||||||
{
|
{
|
||||||
|
$md5_result= safe_system("./my_md5sum -c ${opt_distribution}.md5");
|
||||||
|
|
||||||
|
if ($md5_result != 0)
|
||||||
|
{
|
||||||
|
abort("MD5 failed for $opt_distribution!");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
info("SUCCESS: MD5 checks for $opt_distribution");
|
||||||
|
}
|
||||||
|
|
||||||
safe_system("gunzip < $opt_distribution | $tar xf -");
|
safe_system("gunzip < $opt_distribution | $tar xf -");
|
||||||
|
|
||||||
# Fix file times; This is needed because the time for files may be
|
# Fix file times; This is needed because the time for files may be
|
||||||
@ -331,6 +342,9 @@ if ($opt_stage <= 3)
|
|||||||
$tar_file=<$pwd/$host/mysql*.t*gz>;
|
$tar_file=<$pwd/$host/mysql*.t*gz>;
|
||||||
abort ("Could not find tarball!") unless ($tar_file);
|
abort ("Could not find tarball!") unless ($tar_file);
|
||||||
|
|
||||||
|
# Generate the MD5 for the binary distribution
|
||||||
|
safe_system("./my_md5sum $tar_file > ${tar_file}.md5}");
|
||||||
|
|
||||||
#
|
#
|
||||||
# Unpack the binary distribution
|
# Unpack the binary distribution
|
||||||
#
|
#
|
||||||
@ -660,7 +674,10 @@ sub safe_system
|
|||||||
my($com,$res)=@_;
|
my($com,$res)=@_;
|
||||||
print LOG "$com\n";
|
print LOG "$com\n";
|
||||||
print "$host: $com\n" if ($opt_debug);
|
print "$host: $com\n" if ($opt_debug);
|
||||||
system("$com >> $log 2>&1") && abort("error: Couldn't execute command, error: " . ($? / 256));
|
my $result= system("$com >> $log 2>&1");
|
||||||
|
abort("error: Couldn't execute command, error: " . ($? / 256)) unless $result == 0;
|
||||||
|
|
||||||
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub check_system
|
sub check_system
|
||||||
|
@ -6,6 +6,9 @@
|
|||||||
sub logger
|
sub logger
|
||||||
{
|
{
|
||||||
my $message= $_[0];
|
my $message= $_[0];
|
||||||
|
my $cmnd= $_[1];
|
||||||
|
|
||||||
|
print $message . "\n" if !$opt_quiet && !$opt_verbose && !$cmnd;
|
||||||
print timestamp() . " " . $message . "\n" if $opt_verbose;
|
print timestamp() . " " . $message . "\n" if $opt_verbose;
|
||||||
if (defined $opt_log && !$opt_dry_run)
|
if (defined $opt_log && !$opt_dry_run)
|
||||||
{
|
{
|
||||||
@ -30,9 +33,12 @@ sub run_command
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
&logger($command);
|
&logger($command, 1);
|
||||||
$command.= " >> $LOGFILE 2>&1" if defined $opt_log;
|
|
||||||
$command.= " > /dev/null" if (!$opt_verbose && !$opt_log);
|
$command.= ';' unless ($command =~ m/^.*;$/);
|
||||||
|
|
||||||
|
$command =~ s/;/ >> $LOGFILE 2>&1;/g if defined $opt_log;
|
||||||
|
$command =~ s/;/ > \/dev\/null;/g if (!$opt_verbose && !$opt_log);
|
||||||
system($command) == 0 or &abort("$errormsg\n");
|
system($command) == 0 or &abort("$errormsg\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -47,6 +53,7 @@ sub abort
|
|||||||
{
|
{
|
||||||
my $message= $_[0];
|
my $message= $_[0];
|
||||||
my $messagefile;
|
my $messagefile;
|
||||||
|
my $subject= "Bootstrap of $REPO failed" if $opt_mail;
|
||||||
$message= "ERROR: " . $message;
|
$message= "ERROR: " . $message;
|
||||||
&logger($message);
|
&logger($message);
|
||||||
|
|
||||||
|
@ -10,10 +10,22 @@
|
|||||||
# Written by Matt Wagner <matt@mysql.com>
|
# Written by Matt Wagner <matt@mysql.com>
|
||||||
#
|
#
|
||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Use local perl libraries first. 'unshift' adds to the front of @INC
|
||||||
|
# The local perl library dir hidden is $HOME/.perllibs on each build host
|
||||||
|
#
|
||||||
|
BEGIN
|
||||||
|
{
|
||||||
|
my $homedir= $ENV{HOME};
|
||||||
|
unshift (@INC, "$homedir/.perllibs");
|
||||||
|
}
|
||||||
|
|
||||||
use Digest::MD5;
|
use Digest::MD5;
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
|
|
||||||
my $VER= "1.1";
|
my $VER= "1.3";
|
||||||
|
my $EXIT= 0;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Strip the leading path info off the program name ($0). We want 'my_md5sum'
|
# Strip the leading path info off the program name ($0). We want 'my_md5sum'
|
||||||
@ -67,6 +79,9 @@ if ($opt_check)
|
|||||||
# Print an error message if they don't match, else print OK
|
# Print an error message if they don't match, else print OK
|
||||||
print "$checkfile: FAILED\n" if $digest ne $checksum;
|
print "$checkfile: FAILED\n" if $digest ne $checksum;
|
||||||
print "$checkfile: OK\n" if $digest eq $checksum;
|
print "$checkfile: OK\n" if $digest eq $checksum;
|
||||||
|
|
||||||
|
# Set the exit() status to non-zero if FAILED
|
||||||
|
$EXIT= 1 if $digest ne $checksum;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
# Else generate the MD5 digest to STDOUT
|
# Else generate the MD5 digest to STDOUT
|
||||||
@ -80,6 +95,8 @@ else
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exit($EXIT);
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# This routine generates the MD5 digest of a file
|
# This routine generates the MD5 digest of a file
|
||||||
|
@ -162,7 +162,23 @@ sub trim_the_fat
|
|||||||
undef $/;
|
undef $/;
|
||||||
my $configure= <CONFIGURE>;
|
my $configure= <CONFIGURE>;
|
||||||
close(CONFIGURE);
|
close(CONFIGURE);
|
||||||
$configure=~ s|${the_fat}/Makefile dnl\n?||g;
|
|
||||||
|
#
|
||||||
|
# If $the_fat Makefile line closes the parenthesis, then
|
||||||
|
# replace that line with just the closing parenthesis.
|
||||||
|
#
|
||||||
|
if ($configure=~ m|${the_fat}/Makefile\)\n?|)
|
||||||
|
{
|
||||||
|
$configure=~ s|${the_fat}/Makefile(\)\n?)|$1|;
|
||||||
|
}
|
||||||
|
#
|
||||||
|
# Else just delete the line
|
||||||
|
#
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$configure=~ s|${the_fat}/Makefile dnl\n?||;
|
||||||
|
}
|
||||||
|
|
||||||
open(CONFIGURE,">configure.in") or die "Unable to open configure.in for write: $!\n";
|
open(CONFIGURE,">configure.in") or die "Unable to open configure.in for write: $!\n";
|
||||||
print CONFIGURE $configure;
|
print CONFIGURE $configure;
|
||||||
close(CONFIGURE);
|
close(CONFIGURE);
|
||||||
|
@ -224,7 +224,6 @@ Q_ENABLE_QUERY_LOG, Q_DISABLE_QUERY_LOG,
|
|||||||
Q_ENABLE_RESULT_LOG, Q_DISABLE_RESULT_LOG,
|
Q_ENABLE_RESULT_LOG, Q_DISABLE_RESULT_LOG,
|
||||||
Q_SERVER_START, Q_SERVER_STOP,Q_REQUIRE_MANAGER,
|
Q_SERVER_START, Q_SERVER_STOP,Q_REQUIRE_MANAGER,
|
||||||
Q_WAIT_FOR_SLAVE_TO_STOP,
|
Q_WAIT_FOR_SLAVE_TO_STOP,
|
||||||
Q_REQUIRE_VERSION, Q_REQUIRE_OS,
|
|
||||||
Q_ENABLE_WARNINGS, Q_DISABLE_WARNINGS,
|
Q_ENABLE_WARNINGS, Q_DISABLE_WARNINGS,
|
||||||
Q_ENABLE_INFO, Q_DISABLE_INFO,
|
Q_ENABLE_INFO, Q_DISABLE_INFO,
|
||||||
Q_ENABLE_METADATA, Q_DISABLE_METADATA,
|
Q_ENABLE_METADATA, Q_DISABLE_METADATA,
|
||||||
@ -297,8 +296,6 @@ const char *command_names[]=
|
|||||||
"server_stop",
|
"server_stop",
|
||||||
"require_manager",
|
"require_manager",
|
||||||
"wait_for_slave_to_stop",
|
"wait_for_slave_to_stop",
|
||||||
"require_version",
|
|
||||||
"require_os",
|
|
||||||
"enable_warnings",
|
"enable_warnings",
|
||||||
"disable_warnings",
|
"disable_warnings",
|
||||||
"enable_info",
|
"enable_info",
|
||||||
@ -818,63 +815,6 @@ int do_server_op(struct st_query* q,const char* op)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int do_require_version(struct st_query* q)
|
|
||||||
{
|
|
||||||
MYSQL* mysql = &cur_con->mysql;
|
|
||||||
MYSQL_RES* res;
|
|
||||||
MYSQL_ROW row;
|
|
||||||
char* p=q->first_argument, *ver_arg;
|
|
||||||
uint ver_arg_len,ver_len;
|
|
||||||
LINT_INIT(res);
|
|
||||||
|
|
||||||
if (!*p)
|
|
||||||
die("Missing version argument in require_version\n");
|
|
||||||
ver_arg = p;
|
|
||||||
while (*p && !my_isspace(charset_info,*p))
|
|
||||||
p++;
|
|
||||||
*p = 0;
|
|
||||||
ver_arg_len = p - ver_arg;
|
|
||||||
|
|
||||||
if (mysql_query(mysql, "select version()") ||
|
|
||||||
!(res=mysql_store_result(mysql)))
|
|
||||||
die("Query failed while check server version: %s",
|
|
||||||
mysql_error(mysql));
|
|
||||||
if (!(row=mysql_fetch_row(res)) || !row[0])
|
|
||||||
{
|
|
||||||
mysql_free_result(res);
|
|
||||||
die("Strange result from query while checking version");
|
|
||||||
}
|
|
||||||
ver_len = strlen(row[0]);
|
|
||||||
if (ver_len < ver_arg_len || memcmp(row[0],ver_arg,ver_arg_len))
|
|
||||||
{
|
|
||||||
mysql_free_result(res);
|
|
||||||
abort_not_supported_test();
|
|
||||||
}
|
|
||||||
mysql_free_result(res);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int do_require_os(struct st_query* q)
|
|
||||||
{
|
|
||||||
char *p=q->first_argument, *os_arg;
|
|
||||||
DBUG_ENTER("do_require_os");
|
|
||||||
|
|
||||||
if (!*p)
|
|
||||||
die("Missing version argument in require_os\n");
|
|
||||||
os_arg= p;
|
|
||||||
while (*p && !my_isspace(charset_info,*p))
|
|
||||||
p++;
|
|
||||||
*p = 0;
|
|
||||||
|
|
||||||
if (strcmp(os_arg, "unix"))
|
|
||||||
die("For now only testing of os=unix is implemented\n");
|
|
||||||
|
|
||||||
#if defined(__NETWARE__) || defined(__WIN__) || defined(__OS2__)
|
|
||||||
abort_not_supported_test();
|
|
||||||
#endif
|
|
||||||
DBUG_RETURN(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int do_source(struct st_query* q)
|
int do_source(struct st_query* q)
|
||||||
{
|
{
|
||||||
char* p=q->first_argument, *name;
|
char* p=q->first_argument, *name;
|
||||||
@ -1628,6 +1568,7 @@ int do_connect(struct st_query* q)
|
|||||||
if (opt_compress)
|
if (opt_compress)
|
||||||
mysql_options(&next_con->mysql,MYSQL_OPT_COMPRESS,NullS);
|
mysql_options(&next_con->mysql,MYSQL_OPT_COMPRESS,NullS);
|
||||||
mysql_options(&next_con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
|
mysql_options(&next_con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
|
||||||
|
mysql_options(&next_con->mysql, MYSQL_SET_CHARSET_NAME, "latin1");
|
||||||
|
|
||||||
#ifdef HAVE_OPENSSL
|
#ifdef HAVE_OPENSSL
|
||||||
if (opt_use_ssl)
|
if (opt_use_ssl)
|
||||||
@ -1910,12 +1851,6 @@ int read_query(struct st_query** q_ptr)
|
|||||||
q->record_file[0]= 0;
|
q->record_file[0]= 0;
|
||||||
q->require_file= 0;
|
q->require_file= 0;
|
||||||
q->first_word_len= 0;
|
q->first_word_len= 0;
|
||||||
memcpy((gptr) q->expected_errno, (gptr) global_expected_errno,
|
|
||||||
sizeof(global_expected_errno));
|
|
||||||
q->expected_errors= global_expected_errors;
|
|
||||||
q->abort_on_error= global_expected_errors == 0;
|
|
||||||
bzero((gptr) global_expected_errno, sizeof(global_expected_errno));
|
|
||||||
global_expected_errors=0;
|
|
||||||
|
|
||||||
q->type = Q_UNKNOWN;
|
q->type = Q_UNKNOWN;
|
||||||
q->query_buf= q->query= 0;
|
q->query_buf= q->query= 0;
|
||||||
@ -1928,8 +1863,16 @@ int read_query(struct st_query** q_ptr)
|
|||||||
if (*p == '#')
|
if (*p == '#')
|
||||||
{
|
{
|
||||||
q->type = Q_COMMENT;
|
q->type = Q_COMMENT;
|
||||||
|
/* This goto is to avoid losing the "expected error" info. */
|
||||||
|
goto end;
|
||||||
}
|
}
|
||||||
else if (p[0] == '-' && p[1] == '-')
|
memcpy((gptr) q->expected_errno, (gptr) global_expected_errno,
|
||||||
|
sizeof(global_expected_errno));
|
||||||
|
q->expected_errors= global_expected_errors;
|
||||||
|
q->abort_on_error= global_expected_errors == 0;
|
||||||
|
bzero((gptr) global_expected_errno, sizeof(global_expected_errno));
|
||||||
|
global_expected_errors=0;
|
||||||
|
if (p[0] == '-' && p[1] == '-')
|
||||||
{
|
{
|
||||||
q->type= Q_COMMENT_WITH_COMMAND;
|
q->type= Q_COMMENT_WITH_COMMAND;
|
||||||
p+= 2; /* To calculate first word */
|
p+= 2; /* To calculate first word */
|
||||||
@ -1964,6 +1907,8 @@ int read_query(struct st_query** q_ptr)
|
|||||||
*p1 = 0;
|
*p1 = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
end:
|
||||||
while (*p && my_isspace(charset_info, *p))
|
while (*p && my_isspace(charset_info, *p))
|
||||||
p++;
|
p++;
|
||||||
if (!(q->query_buf= q->query= my_strdup(p, MYF(MY_WME))))
|
if (!(q->query_buf= q->query= my_strdup(p, MYF(MY_WME))))
|
||||||
@ -2692,6 +2637,8 @@ int main(int argc, char **argv)
|
|||||||
if (opt_compress)
|
if (opt_compress)
|
||||||
mysql_options(&cur_con->mysql,MYSQL_OPT_COMPRESS,NullS);
|
mysql_options(&cur_con->mysql,MYSQL_OPT_COMPRESS,NullS);
|
||||||
mysql_options(&cur_con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
|
mysql_options(&cur_con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
|
||||||
|
mysql_options(&cur_con->mysql, MYSQL_SET_CHARSET_NAME, "latin1");
|
||||||
|
|
||||||
#ifdef HAVE_OPENSSL
|
#ifdef HAVE_OPENSSL
|
||||||
if (opt_use_ssl)
|
if (opt_use_ssl)
|
||||||
mysql_ssl_set(&cur_con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
|
mysql_ssl_set(&cur_con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
|
||||||
@ -2736,8 +2683,6 @@ int main(int argc, char **argv)
|
|||||||
case Q_SOURCE: do_source(q); break;
|
case Q_SOURCE: do_source(q); break;
|
||||||
case Q_SLEEP: do_sleep(q, 0); break;
|
case Q_SLEEP: do_sleep(q, 0); break;
|
||||||
case Q_REAL_SLEEP: do_sleep(q, 1); break;
|
case Q_REAL_SLEEP: do_sleep(q, 1); break;
|
||||||
case Q_REQUIRE_VERSION: do_require_version(q); break;
|
|
||||||
case Q_REQUIRE_OS: do_require_os(q); break;
|
|
||||||
case Q_WAIT_FOR_SLAVE_TO_STOP: do_wait_for_slave_to_stop(q); break;
|
case Q_WAIT_FOR_SLAVE_TO_STOP: do_wait_for_slave_to_stop(q); break;
|
||||||
case Q_REQUIRE_MANAGER: do_require_manager(q); break;
|
case Q_REQUIRE_MANAGER: do_require_manager(q); break;
|
||||||
#ifndef EMBEDDED_LIBRARY
|
#ifndef EMBEDDED_LIBRARY
|
||||||
|
@ -521,7 +521,7 @@ fi
|
|||||||
AC_SUBST(CHECK_PID)
|
AC_SUBST(CHECK_PID)
|
||||||
AC_MSG_RESULT("$CHECK_PID")
|
AC_MSG_RESULT("$CHECK_PID")
|
||||||
|
|
||||||
# We need a ANSI C compiler
|
# We need an ANSI C compiler
|
||||||
AM_PROG_CC_STDC
|
AM_PROG_CC_STDC
|
||||||
|
|
||||||
# We need an assembler, too
|
# We need an assembler, too
|
||||||
@ -529,7 +529,7 @@ AM_PROG_AS
|
|||||||
|
|
||||||
if test "$am_cv_prog_cc_stdc" = "no"
|
if test "$am_cv_prog_cc_stdc" = "no"
|
||||||
then
|
then
|
||||||
AC_MSG_ERROR([MySQL requires a ANSI C compiler (and a C++ compiler). Try gcc. See the Installation chapter in the Reference Manual.])
|
AC_MSG_ERROR([MySQL requires an ANSI C compiler (and a C++ compiler). Try gcc. See the Installation chapter in the Reference Manual.])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
NOINST_LDFLAGS=
|
NOINST_LDFLAGS=
|
||||||
@ -2527,7 +2527,7 @@ done
|
|||||||
case $default_charset in
|
case $default_charset in
|
||||||
armscii8)
|
armscii8)
|
||||||
default_charset_default_collation="armscii8_general_ci"
|
default_charset_default_collation="armscii8_general_ci"
|
||||||
default_charset_collations="armscii8_general_ci armscii_bin"
|
default_charset_collations="armscii8_general_ci armscii8_bin"
|
||||||
;;
|
;;
|
||||||
ascii)
|
ascii)
|
||||||
default_charset_default_collation="ascii_general_ci"
|
default_charset_default_collation="ascii_general_ci"
|
||||||
|
@ -348,6 +348,9 @@ inline double ulonglong2double(ulonglong value)
|
|||||||
#define MYSQL_DEFAULT_CHARSET_NAME "latin1"
|
#define MYSQL_DEFAULT_CHARSET_NAME "latin1"
|
||||||
#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"
|
#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"
|
||||||
|
|
||||||
|
#define HAVE_SPATIAL 1
|
||||||
|
#define HAVE_RTREE_KEYS 1
|
||||||
|
|
||||||
/* Define charsets you want */
|
/* Define charsets you want */
|
||||||
/* #undef HAVE_CHARSET_armscii8 */
|
/* #undef HAVE_CHARSET_armscii8 */
|
||||||
/* #undef HAVE_CHARSET_ascii */
|
/* #undef HAVE_CHARSET_ascii */
|
||||||
|
@ -16,10 +16,17 @@
|
|||||||
|
|
||||||
C_MODE_START
|
C_MODE_START
|
||||||
|
|
||||||
enum get_opt_var_type { GET_NO_ARG, GET_BOOL, GET_INT, GET_UINT, GET_LONG,
|
#define GET_NO_ARG 1
|
||||||
GET_ULONG, GET_LL, GET_ULL, GET_STR, GET_STR_ALLOC,
|
#define GET_BOOL 2
|
||||||
GET_DISABLED
|
#define GET_INT 3
|
||||||
};
|
#define GET_UINT 4
|
||||||
|
#define GET_LONG 5
|
||||||
|
#define GET_ULONG 6
|
||||||
|
#define GET_LL 7
|
||||||
|
#define GET_ULL 8
|
||||||
|
#define GET_STR 9
|
||||||
|
#define GET_STR_ALLOC 10
|
||||||
|
#define GET_DISABLED 11
|
||||||
|
|
||||||
#define GET_ASK_ADDR 128
|
#define GET_ASK_ADDR 128
|
||||||
#define GET_TYPE_MASK 127
|
#define GET_TYPE_MASK 127
|
||||||
@ -34,7 +41,7 @@ struct my_option
|
|||||||
gptr *value; /* The variable value */
|
gptr *value; /* The variable value */
|
||||||
gptr *u_max_value; /* The user def. max variable value */
|
gptr *u_max_value; /* The user def. max variable value */
|
||||||
const char **str_values; /* Pointer to possible values */
|
const char **str_values; /* Pointer to possible values */
|
||||||
enum get_opt_var_type var_type;
|
ulong var_type;
|
||||||
enum get_opt_arg_type arg_type;
|
enum get_opt_arg_type arg_type;
|
||||||
longlong def_value; /* Default value */
|
longlong def_value; /* Default value */
|
||||||
longlong min_value; /* Min allowed value */
|
longlong min_value; /* Min allowed value */
|
||||||
|
@ -213,7 +213,11 @@ C_MODE_END
|
|||||||
|
|
||||||
/* Fix problem when linking c++ programs with gcc 3.x */
|
/* Fix problem when linking c++ programs with gcc 3.x */
|
||||||
#ifdef DEFINE_CXA_PURE_VIRTUAL
|
#ifdef DEFINE_CXA_PURE_VIRTUAL
|
||||||
#define FIX_GCC_LINKING_PROBLEM extern "C" { int __cxa_pure_virtual() {return 0;} }
|
#define FIX_GCC_LINKING_PROBLEM \
|
||||||
|
extern "C" { int __cxa_pure_virtual() {\
|
||||||
|
DBUG_ASSERT("Pure virtual method called." == "Aborted");\
|
||||||
|
return 0;\
|
||||||
|
} }
|
||||||
#else
|
#else
|
||||||
#define FIX_GCC_LINKING_PROBLEM
|
#define FIX_GCC_LINKING_PROBLEM
|
||||||
#endif
|
#endif
|
||||||
|
@ -316,46 +316,47 @@
|
|||||||
#define ER_GET_TEMPORARY_ERRMSG 1297
|
#define ER_GET_TEMPORARY_ERRMSG 1297
|
||||||
#define ER_UNKNOWN_TIME_ZONE 1298
|
#define ER_UNKNOWN_TIME_ZONE 1298
|
||||||
#define ER_WARN_INVALID_TIMESTAMP 1299
|
#define ER_WARN_INVALID_TIMESTAMP 1299
|
||||||
#define ER_SP_NO_RECURSIVE_CREATE 1300
|
#define ER_INVALID_CHARACTER_STRING 1300
|
||||||
#define ER_SP_ALREADY_EXISTS 1301
|
#define ER_SP_NO_RECURSIVE_CREATE 1301
|
||||||
#define ER_SP_DOES_NOT_EXIST 1302
|
#define ER_SP_ALREADY_EXISTS 1302
|
||||||
#define ER_SP_DROP_FAILED 1303
|
#define ER_SP_DOES_NOT_EXIST 1303
|
||||||
#define ER_SP_STORE_FAILED 1304
|
#define ER_SP_DROP_FAILED 1304
|
||||||
#define ER_SP_LILABEL_MISMATCH 1305
|
#define ER_SP_STORE_FAILED 1305
|
||||||
#define ER_SP_LABEL_REDEFINE 1306
|
#define ER_SP_LILABEL_MISMATCH 1306
|
||||||
#define ER_SP_LABEL_MISMATCH 1307
|
#define ER_SP_LABEL_REDEFINE 1307
|
||||||
#define ER_SP_UNINIT_VAR 1308
|
#define ER_SP_LABEL_MISMATCH 1308
|
||||||
#define ER_SP_BADSELECT 1309
|
#define ER_SP_UNINIT_VAR 1309
|
||||||
#define ER_SP_BADRETURN 1310
|
#define ER_SP_BADSELECT 1310
|
||||||
#define ER_SP_BADSTATEMENT 1311
|
#define ER_SP_BADRETURN 1311
|
||||||
#define ER_UPDATE_LOG_DEPRECATED_IGNORED 1312
|
#define ER_SP_BADSTATEMENT 1312
|
||||||
#define ER_UPDATE_LOG_DEPRECATED_TRANSLATED 1313
|
#define ER_UPDATE_LOG_DEPRECATED_IGNORED 1313
|
||||||
#define ER_QUERY_INTERRUPTED 1314
|
#define ER_UPDATE_LOG_DEPRECATED_TRANSLATED 1314
|
||||||
#define ER_SP_WRONG_NO_OF_ARGS 1315
|
#define ER_QUERY_INTERRUPTED 1315
|
||||||
#define ER_SP_COND_MISMATCH 1316
|
#define ER_SP_WRONG_NO_OF_ARGS 1316
|
||||||
#define ER_SP_NORETURN 1317
|
#define ER_SP_COND_MISMATCH 1317
|
||||||
#define ER_SP_NORETURNEND 1318
|
#define ER_SP_NORETURN 1318
|
||||||
#define ER_SP_BAD_CURSOR_QUERY 1319
|
#define ER_SP_NORETURNEND 1319
|
||||||
#define ER_SP_BAD_CURSOR_SELECT 1320
|
#define ER_SP_BAD_CURSOR_QUERY 1320
|
||||||
#define ER_SP_CURSOR_MISMATCH 1321
|
#define ER_SP_BAD_CURSOR_SELECT 1321
|
||||||
#define ER_SP_CURSOR_ALREADY_OPEN 1322
|
#define ER_SP_CURSOR_MISMATCH 1322
|
||||||
#define ER_SP_CURSOR_NOT_OPEN 1323
|
#define ER_SP_CURSOR_ALREADY_OPEN 1323
|
||||||
#define ER_SP_UNDECLARED_VAR 1324
|
#define ER_SP_CURSOR_NOT_OPEN 1324
|
||||||
#define ER_SP_WRONG_NO_OF_FETCH_ARGS 1325
|
#define ER_SP_UNDECLARED_VAR 1325
|
||||||
#define ER_SP_FETCH_NO_DATA 1326
|
#define ER_SP_WRONG_NO_OF_FETCH_ARGS 1326
|
||||||
#define ER_SP_DUP_PARAM 1327
|
#define ER_SP_FETCH_NO_DATA 1327
|
||||||
#define ER_SP_DUP_VAR 1328
|
#define ER_SP_DUP_PARAM 1328
|
||||||
#define ER_SP_DUP_COND 1329
|
#define ER_SP_DUP_VAR 1329
|
||||||
#define ER_SP_DUP_CURS 1330
|
#define ER_SP_DUP_COND 1330
|
||||||
#define ER_SP_CANT_ALTER 1331
|
#define ER_SP_DUP_CURS 1331
|
||||||
#define ER_SP_SUBSELECT_NYI 1332
|
#define ER_SP_CANT_ALTER 1332
|
||||||
#define ER_SP_NO_USE 1333
|
#define ER_SP_SUBSELECT_NYI 1333
|
||||||
#define ER_SP_VARCOND_AFTER_CURSHNDLR 1334
|
#define ER_SP_NO_USE 1334
|
||||||
#define ER_SP_CURSOR_AFTER_HANDLER 1335
|
#define ER_SP_VARCOND_AFTER_CURSHNDLR 1335
|
||||||
#define ER_SP_CASE_NOT_FOUND 1336
|
#define ER_SP_CURSOR_AFTER_HANDLER 1336
|
||||||
#define ER_FPARSER_TOO_BIG_FILE 1337
|
#define ER_SP_CASE_NOT_FOUND 1337
|
||||||
#define ER_FPARSER_BAD_HEADER 1338
|
#define ER_FPARSER_TOO_BIG_FILE 1338
|
||||||
#define ER_FPARSER_EOF_IN_COMMENT 1339
|
#define ER_FPARSER_BAD_HEADER 1339
|
||||||
#define ER_FPARSER_ERROR_IN_PARAMETER 1340
|
#define ER_FPARSER_EOF_IN_COMMENT 1340
|
||||||
#define ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER 1341
|
#define ER_FPARSER_ERROR_IN_PARAMETER 1341
|
||||||
#define ER_ERROR_MESSAGES 342
|
#define ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER 1342
|
||||||
|
#define ER_ERROR_MESSAGES 343
|
||||||
|
@ -1,9 +1,23 @@
|
|||||||
############### include/ps_create.inc ##################
|
############### include/ps_create.inc ##################
|
||||||
# #
|
# #
|
||||||
# drop + create the tables used in most PS test cases #
|
# drop + create the tables used in most PS test cases #
|
||||||
|
# t/ps_*.test #
|
||||||
# #
|
# #
|
||||||
########################################################
|
########################################################
|
||||||
|
|
||||||
|
#
|
||||||
|
# NOTE: PLEASE SEE ps_1general.test (bottom)
|
||||||
|
# BEFORE ADDING NEW TABLES HERE !!!
|
||||||
|
#
|
||||||
|
# Please be aware, that this file will be sourced by several
|
||||||
|
# test case files stored within the subdirectory 't'.
|
||||||
|
# So every change here will affect several test cases.
|
||||||
|
|
||||||
|
#----------- Please insert your table definitions here ----------#
|
||||||
|
|
||||||
|
|
||||||
|
#---- Please do not alter the following table definitions -------#
|
||||||
|
|
||||||
--disable_warnings
|
--disable_warnings
|
||||||
drop table if exists t1, t_many_col_types ;
|
drop table if exists t1, t_many_col_types ;
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
|
@ -4,6 +4,38 @@
|
|||||||
# #
|
# #
|
||||||
##############################################################
|
##############################################################
|
||||||
|
|
||||||
|
#
|
||||||
|
# NOTE: PLEASE SEE ps_1general.test (bottom)
|
||||||
|
# BEFORE ADDING NEW TEST CASES HERE !!!
|
||||||
|
|
||||||
|
#
|
||||||
|
# Please be aware, that this file will be sourced by several test case files
|
||||||
|
# stored within the subdirectory 't'. So every change here will affect
|
||||||
|
# several test cases.
|
||||||
|
#
|
||||||
|
# Please do not modify the structure (DROP/ALTER..) of the tables
|
||||||
|
# 't1' and 't_many_col_types'.
|
||||||
|
#
|
||||||
|
# But you are encouraged to use these two tables within your statements
|
||||||
|
# whenever possible.
|
||||||
|
# t1 - very simple table
|
||||||
|
# t_many_col_types - table with nearly all available column types
|
||||||
|
#
|
||||||
|
# The structure and the content of these tables can be found in
|
||||||
|
# include/ps_create.inc CREATE TABLE ...
|
||||||
|
# include/ps_renew.inc DELETE all rows and INSERT some rows
|
||||||
|
#
|
||||||
|
# Both tables are managed by the same storage engine.
|
||||||
|
# The type of the storage engine is stored in the variable '$type' .
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#------------------- Please insert your test cases here -------------------#
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-------- Please be very carefull when editing behind this line ----------#
|
||||||
|
|
||||||
--disable_query_log
|
--disable_query_log
|
||||||
select '------ delete tests ------' as test_sequence ;
|
select '------ delete tests ------' as test_sequence ;
|
||||||
--enable_query_log
|
--enable_query_log
|
||||||
|
@ -4,6 +4,43 @@
|
|||||||
# #
|
# #
|
||||||
##############################################################
|
##############################################################
|
||||||
|
|
||||||
|
#
|
||||||
|
# NOTE: THESE TESTS CANNOT BE APPLIED TO TABLES OF TYPE MERGE.
|
||||||
|
# Test which can be applied to MERGE tables should be stored in
|
||||||
|
# include/ps_modify.inc .
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# NOTE: PLEASE SEE ps_1general.test (bottom)
|
||||||
|
# BEFORE ADDING NEW TEST CASES HERE !!!
|
||||||
|
|
||||||
|
#
|
||||||
|
# Please be aware, that this file will be sourced by several test case files
|
||||||
|
# stored within the subdirectory 't'. So every change here will affect
|
||||||
|
# several test cases.
|
||||||
|
#
|
||||||
|
# Please do not modify the structure (DROP/ALTER..) of the tables
|
||||||
|
# 't1' and 't_many_col_types'.
|
||||||
|
#
|
||||||
|
# But you are encouraged to use these two tables within your statements
|
||||||
|
# (DELETE/UPDATE/...) whenever possible.
|
||||||
|
# t1 - very simple table
|
||||||
|
# t_many_col_types - table with nearly all available column types
|
||||||
|
#
|
||||||
|
# The structure and the content of these tables can be found in
|
||||||
|
# include/ps_create.inc CREATE TABLE ...
|
||||||
|
# include/ps_renew.inc DELETE all rows and INSERT some rows
|
||||||
|
#
|
||||||
|
# Both tables are managed by the same storage engine.
|
||||||
|
# The type of the storage engine is stored in the variable '$type' .
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#------------------- Please insert your test cases here -------------------#
|
||||||
|
|
||||||
|
|
||||||
|
#-------- Please be very carefull when editing behind this line ----------#
|
||||||
|
|
||||||
## big insert select statements
|
## big insert select statements
|
||||||
set @duplicate='duplicate ' ;
|
set @duplicate='duplicate ' ;
|
||||||
set @1000=1000 ;
|
set @1000=1000 ;
|
||||||
|
@ -4,10 +4,39 @@
|
|||||||
# #
|
# #
|
||||||
##############################################################
|
##############################################################
|
||||||
|
|
||||||
|
#
|
||||||
|
# NOTE: PLEASE SEE ps_1general.test (bottom)
|
||||||
|
# BEFORE ADDING NEW TEST CASES HERE !!!
|
||||||
|
|
||||||
# Please do not modify (INSERT/UPDATE/DELETE) the content of the tables
|
#
|
||||||
# t1 and t_many_col_types.
|
# Please be aware, that this file will be sourced by several test case files
|
||||||
# Such tests should be done in include/ps_modify.inc
|
# stored within the subdirectory 't'. So every change here will affect
|
||||||
|
# several test cases.
|
||||||
|
#
|
||||||
|
# Please do not modify (INSERT/UPDATE/DELETE) the content or the
|
||||||
|
# structure (DROP/ALTER..) of the tables
|
||||||
|
# 't1' and 't_many_col_types'.
|
||||||
|
# Such tests should be done in include/ps_modify.inc .
|
||||||
|
#
|
||||||
|
# But you are encouraged to use these two tables within your SELECT statements
|
||||||
|
# whenever possible.
|
||||||
|
# t1 - very simple table
|
||||||
|
# t_many_col_types - table with nearly all available column types
|
||||||
|
#
|
||||||
|
# The structure and the content of these tables can be found in
|
||||||
|
# include/ps_create.inc CREATE TABLE ...
|
||||||
|
# include/ps_renew.inc DELETE all rows and INSERT some rows
|
||||||
|
#
|
||||||
|
# Both tables are managed by the same storage engine.
|
||||||
|
# The type of the storage engine is stored in the variable '$type' .
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#------------------- Please insert your test cases here -------------------#
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-------- Please be very carefull when editing behind this line ----------#
|
||||||
|
|
||||||
--disable_query_log
|
--disable_query_log
|
||||||
select '------ simple select tests ------' as test_sequence ;
|
select '------ simple select tests ------' as test_sequence ;
|
||||||
|
@ -370,7 +370,7 @@ while test $# -gt 0; do
|
|||||||
$ECHO "You need to have the 'valgrind' program in your PATH to run mysql-test-run with option --valgrind. Valgrind's home page is http://developer.kde.org/~sewardj ."
|
$ECHO "You need to have the 'valgrind' program in your PATH to run mysql-test-run with option --valgrind. Valgrind's home page is http://developer.kde.org/~sewardj ."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
VALGRIND="$VALGRIND --alignment=8 --leak-check=yes --num-callers=16"
|
VALGRIND="$VALGRIND --tool=memcheck --alignment=8 --leak-check=yes --num-callers=16"
|
||||||
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-safemalloc --skip-bdb"
|
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-safemalloc --skip-bdb"
|
||||||
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-safemalloc --skip-bdb"
|
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-safemalloc --skip-bdb"
|
||||||
SLEEP_TIME_AFTER_RESTART=10
|
SLEEP_TIME_AFTER_RESTART=10
|
||||||
@ -525,7 +525,7 @@ fi
|
|||||||
|
|
||||||
MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
|
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_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR $EXTRA_MYSQLBINLOG_OPT"
|
||||||
MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose=1"
|
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"
|
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
|
export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ if [ ! -x $exec_ndb ]; then
|
|||||||
echo "$exec_ndb missing"
|
echo "$exec_ndb missing"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [ ! -x $exec_mgmtsrv ]; then
|
if [ ! -x $exec_mgmtsrvr ]; then
|
||||||
echo "$exec_mgmtsrvr missing"
|
echo "$exec_mgmtsrvr missing"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -123,7 +123,7 @@ grant all on mysqltest.t1 to mysqltest_1@localhost;
|
|||||||
alter table t1 rename t2;
|
alter table t1 rename t2;
|
||||||
ERROR 42000: insert command denied to user 'mysqltest_1'@'localhost' for table 't2'
|
ERROR 42000: insert command denied to user 'mysqltest_1'@'localhost' for table 't2'
|
||||||
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
|
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
|
||||||
delete from mysql.user where user='mysqltest_1';
|
delete from mysql.user where user=_binary'mysqltest_1';
|
||||||
drop database mysqltest;
|
drop database mysqltest;
|
||||||
create table t1 (n1 int not null, n2 int, n3 int, n4 float,
|
create table t1 (n1 int not null, n2 int, n3 int, n4 float,
|
||||||
unique(n1),
|
unique(n1),
|
||||||
|
@ -40,7 +40,7 @@ time_zone_transition_type
|
|||||||
user
|
user
|
||||||
show tables;
|
show tables;
|
||||||
Tables_in_test
|
Tables_in_test
|
||||||
update mysql.user set password=old_password("gambling2") where user="test";
|
update mysql.user set password=old_password("gambling2") where user=_binary"test";
|
||||||
flush privileges;
|
flush privileges;
|
||||||
set password=old_password('gambling3');
|
set password=old_password('gambling3');
|
||||||
show tables;
|
show tables;
|
||||||
@ -63,5 +63,5 @@ time_zone_transition_type
|
|||||||
user
|
user
|
||||||
show tables;
|
show tables;
|
||||||
Tables_in_test
|
Tables_in_test
|
||||||
delete from mysql.user where user="test";
|
delete from mysql.user where user=_binary"test";
|
||||||
flush privileges;
|
flush privileges;
|
||||||
|
@ -1,15 +1,37 @@
|
|||||||
SET @@character_set_server=latin5;
|
SET @@character_set_server=latin5;
|
||||||
CREATE DATABASE db1 DEFAULT CHARACTER SET cp1251;
|
CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET cp1251;
|
||||||
USE db1;
|
USE mysqltest1;
|
||||||
CREATE DATABASE db2;
|
CREATE DATABASE mysqltest2;
|
||||||
SHOW CREATE DATABASE db1;
|
SHOW CREATE DATABASE mysqltest1;
|
||||||
Database Create Database
|
Database Create Database
|
||||||
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET cp1251 */
|
mysqltest1 CREATE DATABASE `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp1251 */
|
||||||
SHOW CREATE DATABASE db2;
|
SHOW CREATE DATABASE mysqltest2;
|
||||||
Database Create Database
|
Database Create Database
|
||||||
db2 CREATE DATABASE `db2` /*!40100 DEFAULT CHARACTER SET latin5 */
|
mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin5 */
|
||||||
DROP DATABASE db2;
|
CREATE TABLE mysqltest2.t1 (a char(10));
|
||||||
USE db1;
|
SHOW CREATE TABLE mysqltest2.t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`a` char(10) default NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin5
|
||||||
|
DROP TABLE mysqltest2.t1;
|
||||||
|
ALTER DATABASE mysqltest2 DEFAULT CHARACTER SET latin7;
|
||||||
|
CREATE TABLE mysqltest2.t1 (a char(10));
|
||||||
|
SHOW CREATE TABLE mysqltest2.t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`a` char(10) default NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin7
|
||||||
|
DROP DATABASE mysqltest2;
|
||||||
|
CREATE DATABASE mysqltest2 CHARACTER SET latin2;
|
||||||
|
CREATE TABLE mysqltest2.t1 (a char(10));
|
||||||
|
SHOW CREATE TABLE mysqltest2.t1;
|
||||||
|
Table Create Table
|
||||||
|
t1 CREATE TABLE `t1` (
|
||||||
|
`a` char(10) default NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin2
|
||||||
|
DROP DATABASE mysqltest2;
|
||||||
|
USE mysqltest1;
|
||||||
CREATE TABLE t1 (a char(10));
|
CREATE TABLE t1 (a char(10));
|
||||||
SHOW CREATE TABLE t1;
|
SHOW CREATE TABLE t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
@ -32,4 +54,4 @@ t1 CREATE TABLE `t1` (
|
|||||||
`a` char(10) collate latin1_german1_ci default NULL
|
`a` char(10) collate latin1_german1_ci default NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
DROP DATABASE db1;
|
DROP DATABASE mysqltest1;
|
||||||
|
@ -111,3 +111,34 @@ SET character_set_connection=cp1251;
|
|||||||
SELECT hex('ÔÅÓÔ');
|
SELECT hex('ÔÅÓÔ');
|
||||||
hex('ÔÅÓÔ')
|
hex('ÔÅÓÔ')
|
||||||
F2E5F1F2
|
F2E5F1F2
|
||||||
|
USE test;
|
||||||
|
SET NAMES binary;
|
||||||
|
CREATE TABLE `теÑ<C2B5>Ñ‚` (`теÑ<C2B5>Ñ‚` int);
|
||||||
|
SHOW CREATE TABLE `теÑ<C2B5>Ñ‚`;
|
||||||
|
Table Create Table
|
||||||
|
теÑ<EFBFBD>Ñ‚ CREATE TABLE `теÑ<C2B5>Ñ‚` (
|
||||||
|
`теÑ<C2B5>Ñ‚` int(11) default NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
SET NAMES utf8;
|
||||||
|
SHOW CREATE TABLE `теÑ<C2B5>Ñ‚`;
|
||||||
|
Table Create Table
|
||||||
|
теÑ<EFBFBD>Ñ‚ CREATE TABLE `теÑ<C2B5>Ñ‚` (
|
||||||
|
`теÑ<C2B5>Ñ‚` int(11) default NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
DROP TABLE `теÑ<C2B5>Ñ‚`;
|
||||||
|
SET NAMES binary;
|
||||||
|
SET character_set_connection=utf8;
|
||||||
|
SELECT 'теÑ<C2B5>Ñ‚' as s;
|
||||||
|
s
|
||||||
|
теÑ<EFBFBD>Ñ‚
|
||||||
|
SET NAMES utf8;
|
||||||
|
SET character_set_connection=binary;
|
||||||
|
SELECT 'теÑ<C2B5>Ñ‚' as s;
|
||||||
|
s
|
||||||
|
теÑ<EFBFBD>Ñ‚
|
||||||
|
SET NAMES binary;
|
||||||
|
CREATE TABLE `goodÐÌÏÈÏ` (a int);
|
||||||
|
ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ'
|
||||||
|
SET NAMES utf8;
|
||||||
|
CREATE TABLE `goodÐÌÏÈÏ` (a int);
|
||||||
|
ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ` (a int)'
|
||||||
|
@ -1655,3 +1655,110 @@ Z,z,Ź,ź,Ż,ż,Ž,ž
|
|||||||
ǁ
|
ǁ
|
||||||
ǂ
|
ǂ
|
||||||
ǃ
|
ǃ
|
||||||
|
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_roman_ci;
|
||||||
|
group_concat(c1 order by c1)
|
||||||
|
÷
|
||||||
|
×
|
||||||
|
A,a,À,Á,Â,Ã,Ä,Å,à,á,â,ã,ä,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ
|
||||||
|
AA,Aa,aA,aa
|
||||||
|
Æ,æ,Ǣ,ǣ,Ǽ,ǽ
|
||||||
|
B,b
|
||||||
|
ƀ
|
||||||
|
Ɓ
|
||||||
|
Ƃ,ƃ
|
||||||
|
C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ,Č,č
|
||||||
|
CH,Ch,cH,ch
|
||||||
|
Ƈ,ƈ
|
||||||
|
D,d,Ď,ď
|
||||||
|
DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
|
||||||
|
Đ,đ
|
||||||
|
Ɖ
|
||||||
|
Ɗ
|
||||||
|
Ƌ,ƌ
|
||||||
|
Ð,ð
|
||||||
|
E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
|
||||||
|
Ǝ,ǝ
|
||||||
|
Ə
|
||||||
|
Ɛ
|
||||||
|
F,f
|
||||||
|
Ƒ,ƒ
|
||||||
|
G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ
|
||||||
|
Ǥ,ǥ
|
||||||
|
Ɠ
|
||||||
|
Ɣ
|
||||||
|
Ƣ,ƣ
|
||||||
|
H,h,Ĥ,ĥ
|
||||||
|
ƕ,Ƕ
|
||||||
|
Ħ,ħ
|
||||||
|
I,J,i,j,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ
|
||||||
|
IJ,Ij,iJ,ij
|
||||||
|
IJ,ij
|
||||||
|
ı
|
||||||
|
Ɨ
|
||||||
|
Ɩ
|
||||||
|
Ĵ,ĵ,ǰ
|
||||||
|
K,k,Ķ,ķ,Ǩ,ǩ
|
||||||
|
Ƙ,ƙ
|
||||||
|
L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
|
||||||
|
Ŀ,ŀ
|
||||||
|
LJ,Lj,lJ,lj
|
||||||
|
LJ,Lj,lj
|
||||||
|
LL,Ll,lL,ll
|
||||||
|
Ł,ł
|
||||||
|
ƚ
|
||||||
|
ƛ
|
||||||
|
M,m
|
||||||
|
N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
|
||||||
|
NJ,Nj,nJ,nj
|
||||||
|
NJ,Nj,nj
|
||||||
|
Ɲ
|
||||||
|
ƞ
|
||||||
|
Ŋ,ŋ
|
||||||
|
O,o,Ò,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ
|
||||||
|
OE,Oe,oE,oe,Œ,œ
|
||||||
|
Ø,ø,Ǿ,ǿ
|
||||||
|
Ɔ
|
||||||
|
Ɵ
|
||||||
|
P,p
|
||||||
|
Ƥ,ƥ
|
||||||
|
Q,q
|
||||||
|
ĸ
|
||||||
|
R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
|
||||||
|
RR,Rr,rR,rr
|
||||||
|
Ʀ
|
||||||
|
S,s,Ś,ś,Ŝ,ŝ,Ş,ş,Š,š,ſ
|
||||||
|
SS,Ss,sS,ss,ß
|
||||||
|
Ʃ
|
||||||
|
ƪ
|
||||||
|
T,t,Ţ,ţ,Ť,ť
|
||||||
|
ƾ
|
||||||
|
Ŧ,ŧ
|
||||||
|
ƫ
|
||||||
|
Ƭ,ƭ
|
||||||
|
Ʈ
|
||||||
|
Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
|
||||||
|
Ɯ
|
||||||
|
Ʊ
|
||||||
|
U,V,u,v
|
||||||
|
Ʋ
|
||||||
|
W,w,Ŵ,ŵ
|
||||||
|
X,x
|
||||||
|
Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ
|
||||||
|
Ƴ,ƴ
|
||||||
|
Z,z,Ź,ź,Ż,ż,Ž,ž
|
||||||
|
ƍ
|
||||||
|
Ƶ,ƶ
|
||||||
|
Ʒ,Ǯ,ǯ
|
||||||
|
Ƹ,ƹ
|
||||||
|
ƺ
|
||||||
|
Þ,þ
|
||||||
|
ƿ,Ƿ
|
||||||
|
ƻ
|
||||||
|
Ƨ,ƨ
|
||||||
|
Ƽ,ƽ
|
||||||
|
Ƅ,ƅ
|
||||||
|
ʼn
|
||||||
|
ǀ
|
||||||
|
ǁ
|
||||||
|
ǂ
|
||||||
|
ǃ
|
||||||
|
@ -192,9 +192,9 @@ length(quote(concat(char(0),"test")))
|
|||||||
select hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235))));
|
select hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235))));
|
||||||
hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235))))
|
hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235))))
|
||||||
27E0E3E6E7E8EAEB27
|
27E0E3E6E7E8EAEB27
|
||||||
select unhex(hex("foobar")), hex(unhex("1234567890ABCDEF")), unhex("345678");
|
select unhex(hex("foobar")), hex(unhex("1234567890ABCDEF")), unhex("345678"), unhex(NULL);
|
||||||
unhex(hex("foobar")) hex(unhex("1234567890ABCDEF")) unhex("345678")
|
unhex(hex("foobar")) hex(unhex("1234567890ABCDEF")) unhex("345678") unhex(NULL)
|
||||||
foobar 1234567890ABCDEF 4Vx
|
foobar 1234567890ABCDEF 4Vx NULL
|
||||||
select hex(unhex("1")), hex(unhex("12")), hex(unhex("123")), hex(unhex("1234")), hex(unhex("12345")), hex(unhex("123456"));
|
select hex(unhex("1")), hex(unhex("12")), hex(unhex("123")), hex(unhex("1234")), hex(unhex("12345")), hex(unhex("123456"));
|
||||||
hex(unhex("1")) hex(unhex("12")) hex(unhex("123")) hex(unhex("1234")) hex(unhex("12345")) hex(unhex("123456"))
|
hex(unhex("1")) hex(unhex("12")) hex(unhex("123")) hex(unhex("1234")) hex(unhex("12345")) hex(unhex("123456"))
|
||||||
01 12 0123 1234 012345 123456
|
01 12 0123 1234 012345 123456
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
drop table if exists t1;
|
drop table if exists t1;
|
||||||
|
SET NAMES binary;
|
||||||
delete from mysql.user where user='mysqltest_1';
|
delete from mysql.user where user='mysqltest_1';
|
||||||
delete from mysql.db where user='mysqltest_1';
|
delete from mysql.db where user='mysqltest_1';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
SET NAMES binary;
|
||||||
delete from mysql.user where user like 'mysqltest\_%';
|
delete from mysql.user where user like 'mysqltest\_%';
|
||||||
delete from mysql.db where user like 'mysqltest\_%';
|
delete from mysql.db where user like 'mysqltest\_%';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
|
@ -198,6 +198,7 @@ Qcache_hits 8
|
|||||||
show status like "Qcache_not_cached";
|
show status like "Qcache_not_cached";
|
||||||
Variable_name Value
|
Variable_name Value
|
||||||
Qcache_not_cached 8
|
Qcache_not_cached 8
|
||||||
|
set names binary;
|
||||||
delete from mysql.user where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
|
delete from mysql.user where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
|
||||||
delete from mysql.db where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
|
delete from mysql.db where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
|
||||||
delete from mysql.tables_priv where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
|
delete from mysql.tables_priv where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
|
||||||
|
@ -447,7 +447,7 @@ update t1, t2 set t1.b=1 where t1.a=t2.a;
|
|||||||
update t1, t2 set t1.b=(select t3.b from t3 where t1.a=t3.a) where t1.a=t2.a;
|
update t1, t2 set t1.b=(select t3.b from t3 where t1.a=t3.a) where t1.a=t2.a;
|
||||||
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
|
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
|
||||||
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
|
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
|
||||||
delete from mysql.user where user='mysqltest_1';
|
delete from mysql.user where user=_binary'mysqltest_1';
|
||||||
drop database mysqltest;
|
drop database mysqltest;
|
||||||
create table t1 (a int, primary key (a));
|
create table t1 (a int, primary key (a));
|
||||||
create table t2 (a int, primary key (a));
|
create table t2 (a int, primary key (a));
|
||||||
|
@ -175,10 +175,10 @@ insert into t1 values (19,4, 0);
|
|||||||
select * from t1 where b<=5 and c=0;
|
select * from t1 where b<=5 and c=0;
|
||||||
a b c
|
a b c
|
||||||
19 4 0
|
19 4 0
|
||||||
select * from t1 where b=4 and c<=5;
|
select * from t1 where b=4 and c<=5 order by a;
|
||||||
a b c
|
a b c
|
||||||
19 4 0
|
|
||||||
17 4 4
|
17 4 4
|
||||||
|
19 4 0
|
||||||
select * from t1 where b<=4 and c<=5 order by a;
|
select * from t1 where b<=4 and c<=5 order by a;
|
||||||
a b c
|
a b c
|
||||||
7 2 1
|
7 2 1
|
||||||
|
@ -389,12 +389,12 @@ where @arg01 = first.b or first.a = second.a or second.b = @arg02;
|
|||||||
a @arg00 a
|
a @arg00 a
|
||||||
1 ABC 1
|
1 ABC 1
|
||||||
2 ABC 1
|
2 ABC 1
|
||||||
|
3 ABC 1
|
||||||
|
4 ABC 1
|
||||||
2 ABC 2
|
2 ABC 2
|
||||||
2 ABC 3
|
2 ABC 3
|
||||||
2 ABC 4
|
|
||||||
3 ABC 1
|
|
||||||
3 ABC 3
|
3 ABC 3
|
||||||
4 ABC 1
|
2 ABC 4
|
||||||
4 ABC 4
|
4 ABC 4
|
||||||
prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
|
prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
|
||||||
where ? = first.b or first.a = second.a or second.b = ? ';
|
where ? = first.b or first.a = second.a or second.b = ? ';
|
||||||
@ -402,12 +402,12 @@ execute stmt1 using @arg00, @arg01, @arg02;
|
|||||||
a ? a
|
a ? a
|
||||||
1 ABC 1
|
1 ABC 1
|
||||||
2 ABC 1
|
2 ABC 1
|
||||||
|
3 ABC 1
|
||||||
|
4 ABC 1
|
||||||
2 ABC 2
|
2 ABC 2
|
||||||
2 ABC 3
|
2 ABC 3
|
||||||
2 ABC 4
|
|
||||||
3 ABC 1
|
|
||||||
3 ABC 3
|
3 ABC 3
|
||||||
4 ABC 1
|
2 ABC 4
|
||||||
4 ABC 4
|
4 ABC 4
|
||||||
test_sequence
|
test_sequence
|
||||||
------ subquery tests ------
|
------ subquery tests ------
|
||||||
|
@ -548,14 +548,14 @@ def in_s 8 21 1 Y 32768 0 8
|
|||||||
def in_row_s 8 21 1 Y 32768 0 8
|
def in_row_s 8 21 1 Y 32768 0 8
|
||||||
scalar_s exists_s in_s in_row_s
|
scalar_s exists_s in_s in_row_s
|
||||||
2.0000 0 1 0
|
2.0000 0 1 0
|
||||||
2.0000 0 1 0
|
|
||||||
18.0000 1 0 1
|
18.0000 1 0 1
|
||||||
|
2.0000 0 1 0
|
||||||
18.0000 1 0 1
|
18.0000 1 0 1
|
||||||
execute stmt1 ;
|
execute stmt1 ;
|
||||||
scalar_s exists_s in_s in_row_s
|
scalar_s exists_s in_s in_row_s
|
||||||
2.0000 0 1 0
|
2.0000 0 1 0
|
||||||
2.0000 0 1 0
|
|
||||||
18.0000 1 0 1
|
18.0000 1 0 1
|
||||||
|
2.0000 0 1 0
|
||||||
18.0000 1 0 1
|
18.0000 1 0 1
|
||||||
set @stmt= concat('explain ',@stmt);
|
set @stmt= concat('explain ',@stmt);
|
||||||
prepare stmt1 from @stmt ;
|
prepare stmt1 from @stmt ;
|
||||||
@ -572,8 +572,8 @@ def ref 253 1024 0 Y 0 31 63
|
|||||||
def rows 8 10 1 N 32801 0 8
|
def rows 8 10 1 N 32801 0 8
|
||||||
def Extra 253 255 44 N 1 31 63
|
def Extra 253 255 44 N 1 31 63
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2
|
1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3
|
||||||
1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3 Using where
|
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
|
||||||
6 DERIVED t2 ALL NULL NULL NULL NULL 2
|
6 DERIVED t2 ALL NULL NULL NULL NULL 2
|
||||||
5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
|
5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
|
||||||
4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
|
4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
|
||||||
@ -581,8 +581,8 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||||||
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
|
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; Using temporary; Using filesort
|
||||||
execute stmt1 ;
|
execute stmt1 ;
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2
|
1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3
|
||||||
1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3 Using where
|
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
|
||||||
6 DERIVED t2 ALL NULL NULL NULL NULL 2
|
6 DERIVED t2 ALL NULL NULL NULL NULL 2
|
||||||
5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
|
5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
|
||||||
4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
|
4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
|
||||||
@ -617,15 +617,15 @@ def in_s 8 21 1 Y 32768 0 8
|
|||||||
def in_row_s 8 21 1 Y 32768 0 8
|
def in_row_s 8 21 1 Y 32768 0 8
|
||||||
scalar_s exists_s in_s in_row_s
|
scalar_s exists_s in_s in_row_s
|
||||||
2 0 1 0
|
2 0 1 0
|
||||||
2 0 1 0
|
|
||||||
18 1 0 1
|
18 1 0 1
|
||||||
|
2 0 1 0
|
||||||
18 1 0 1
|
18 1 0 1
|
||||||
execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
|
execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
|
||||||
@arg07, @arg08, @arg09 ;
|
@arg07, @arg08, @arg09 ;
|
||||||
scalar_s exists_s in_s in_row_s
|
scalar_s exists_s in_s in_row_s
|
||||||
2 0 1 0
|
2 0 1 0
|
||||||
2 0 1 0
|
|
||||||
18 1 0 1
|
18 1 0 1
|
||||||
|
2 0 1 0
|
||||||
18 1 0 1
|
18 1 0 1
|
||||||
set @stmt= concat('explain ',@stmt);
|
set @stmt= concat('explain ',@stmt);
|
||||||
prepare stmt1 from @stmt ;
|
prepare stmt1 from @stmt ;
|
||||||
@ -643,8 +643,8 @@ def ref 253 1024 0 Y 0 31 63
|
|||||||
def rows 8 10 1 N 32801 0 8
|
def rows 8 10 1 N 32801 0 8
|
||||||
def Extra 253 255 44 N 1 31 63
|
def Extra 253 255 44 N 1 31 63
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2
|
1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3
|
||||||
1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3 Using where
|
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
|
||||||
6 DERIVED t2 ALL NULL NULL NULL NULL 2
|
6 DERIVED t2 ALL NULL NULL NULL NULL 2
|
||||||
5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
|
5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
|
||||||
4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
|
4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
|
||||||
@ -653,8 +653,8 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||||||
execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
|
execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
|
||||||
@arg07, @arg08, @arg09 ;
|
@arg07, @arg08, @arg09 ;
|
||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2
|
1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3
|
||||||
1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3 Using where
|
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
|
||||||
6 DERIVED t2 ALL NULL NULL NULL NULL 2
|
6 DERIVED t2 ALL NULL NULL NULL NULL 2
|
||||||
5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
|
5 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
|
||||||
4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
|
4 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
|
||||||
|
@ -432,12 +432,12 @@ where @arg01 = first.b or first.a = second.a or second.b = @arg02;
|
|||||||
a @arg00 a
|
a @arg00 a
|
||||||
1 ABC 1
|
1 ABC 1
|
||||||
2 ABC 1
|
2 ABC 1
|
||||||
|
3 ABC 1
|
||||||
|
4 ABC 1
|
||||||
2 ABC 2
|
2 ABC 2
|
||||||
2 ABC 3
|
2 ABC 3
|
||||||
2 ABC 4
|
|
||||||
3 ABC 1
|
|
||||||
3 ABC 3
|
3 ABC 3
|
||||||
4 ABC 1
|
2 ABC 4
|
||||||
4 ABC 4
|
4 ABC 4
|
||||||
prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
|
prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
|
||||||
where ? = first.b or first.a = second.a or second.b = ? ';
|
where ? = first.b or first.a = second.a or second.b = ? ';
|
||||||
@ -445,12 +445,12 @@ execute stmt1 using @arg00, @arg01, @arg02;
|
|||||||
a ? a
|
a ? a
|
||||||
1 ABC 1
|
1 ABC 1
|
||||||
2 ABC 1
|
2 ABC 1
|
||||||
|
3 ABC 1
|
||||||
|
4 ABC 1
|
||||||
2 ABC 2
|
2 ABC 2
|
||||||
2 ABC 3
|
2 ABC 3
|
||||||
2 ABC 4
|
|
||||||
3 ABC 1
|
|
||||||
3 ABC 3
|
3 ABC 3
|
||||||
4 ABC 1
|
2 ABC 4
|
||||||
4 ABC 4
|
4 ABC 4
|
||||||
test_sequence
|
test_sequence
|
||||||
------ subquery tests ------
|
------ subquery tests ------
|
||||||
@ -1615,12 +1615,12 @@ where @arg01 = first.b or first.a = second.a or second.b = @arg02;
|
|||||||
a @arg00 a
|
a @arg00 a
|
||||||
1 ABC 1
|
1 ABC 1
|
||||||
2 ABC 1
|
2 ABC 1
|
||||||
|
3 ABC 1
|
||||||
|
4 ABC 1
|
||||||
2 ABC 2
|
2 ABC 2
|
||||||
2 ABC 3
|
2 ABC 3
|
||||||
2 ABC 4
|
|
||||||
3 ABC 1
|
|
||||||
3 ABC 3
|
3 ABC 3
|
||||||
4 ABC 1
|
2 ABC 4
|
||||||
4 ABC 4
|
4 ABC 4
|
||||||
prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
|
prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
|
||||||
where ? = first.b or first.a = second.a or second.b = ? ';
|
where ? = first.b or first.a = second.a or second.b = ? ';
|
||||||
@ -1628,12 +1628,12 @@ execute stmt1 using @arg00, @arg01, @arg02;
|
|||||||
a ? a
|
a ? a
|
||||||
1 ABC 1
|
1 ABC 1
|
||||||
2 ABC 1
|
2 ABC 1
|
||||||
|
3 ABC 1
|
||||||
|
4 ABC 1
|
||||||
2 ABC 2
|
2 ABC 2
|
||||||
2 ABC 3
|
2 ABC 3
|
||||||
2 ABC 4
|
|
||||||
3 ABC 1
|
|
||||||
3 ABC 3
|
3 ABC 3
|
||||||
4 ABC 1
|
2 ABC 4
|
||||||
4 ABC 4
|
4 ABC 4
|
||||||
test_sequence
|
test_sequence
|
||||||
------ subquery tests ------
|
------ subquery tests ------
|
||||||
|
@ -389,12 +389,12 @@ where @arg01 = first.b or first.a = second.a or second.b = @arg02;
|
|||||||
a @arg00 a
|
a @arg00 a
|
||||||
1 ABC 1
|
1 ABC 1
|
||||||
2 ABC 1
|
2 ABC 1
|
||||||
|
3 ABC 1
|
||||||
|
4 ABC 1
|
||||||
2 ABC 2
|
2 ABC 2
|
||||||
2 ABC 3
|
2 ABC 3
|
||||||
2 ABC 4
|
|
||||||
3 ABC 1
|
|
||||||
3 ABC 3
|
3 ABC 3
|
||||||
4 ABC 1
|
2 ABC 4
|
||||||
4 ABC 4
|
4 ABC 4
|
||||||
prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
|
prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
|
||||||
where ? = first.b or first.a = second.a or second.b = ? ';
|
where ? = first.b or first.a = second.a or second.b = ? ';
|
||||||
@ -402,12 +402,12 @@ execute stmt1 using @arg00, @arg01, @arg02;
|
|||||||
a ? a
|
a ? a
|
||||||
1 ABC 1
|
1 ABC 1
|
||||||
2 ABC 1
|
2 ABC 1
|
||||||
|
3 ABC 1
|
||||||
|
4 ABC 1
|
||||||
2 ABC 2
|
2 ABC 2
|
||||||
2 ABC 3
|
2 ABC 3
|
||||||
2 ABC 4
|
|
||||||
3 ABC 1
|
|
||||||
3 ABC 3
|
3 ABC 3
|
||||||
4 ABC 1
|
2 ABC 4
|
||||||
4 ABC 4
|
4 ABC 4
|
||||||
test_sequence
|
test_sequence
|
||||||
------ subquery tests ------
|
------ subquery tests ------
|
||||||
|
@ -76,17 +76,17 @@ create table t1 (n int);
|
|||||||
insert into t1 values(3456);
|
insert into t1 values(3456);
|
||||||
insert into mysql.user (Host, User, Password)
|
insert into mysql.user (Host, User, Password)
|
||||||
VALUES ("10.10.10.%", "blafasel2", password("blafasel2"));
|
VALUES ("10.10.10.%", "blafasel2", password("blafasel2"));
|
||||||
select select_priv,user from mysql.user where user = 'blafasel2';
|
select select_priv,user from mysql.user where user = _binary'blafasel2';
|
||||||
select_priv user
|
select_priv user
|
||||||
N blafasel2
|
N blafasel2
|
||||||
update mysql.user set Select_priv = "Y" where User="blafasel2";
|
update mysql.user set Select_priv = "Y" where User= _binary"blafasel2";
|
||||||
select select_priv,user from mysql.user where user = 'blafasel2';
|
select select_priv,user from mysql.user where user = _binary'blafasel2';
|
||||||
select_priv user
|
select_priv user
|
||||||
Y blafasel2
|
Y blafasel2
|
||||||
select n from t1;
|
select n from t1;
|
||||||
n
|
n
|
||||||
3456
|
3456
|
||||||
select select_priv,user from mysql.user where user = 'blafasel2';
|
select select_priv,user from mysql.user where user = _binary'blafasel2';
|
||||||
select_priv user
|
select_priv user
|
||||||
Y blafasel2
|
Y blafasel2
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
@ -25,19 +25,19 @@ test2 CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET latin2 */
|
|||||||
show create database test3;
|
show create database test3;
|
||||||
Database Create Database
|
Database Create Database
|
||||||
test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET latin5 */
|
test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET latin5 */
|
||||||
set @@collation_server=armscii_bin;
|
set @@collation_server=armscii8_bin;
|
||||||
drop database test3;
|
drop database test3;
|
||||||
create database test3;
|
create database test3;
|
||||||
|
|
||||||
--- --master--
|
--- --master--
|
||||||
show create database test3;
|
show create database test3;
|
||||||
Database Create Database
|
Database Create Database
|
||||||
test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii_bin */
|
test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
|
||||||
|
|
||||||
--- --slave--
|
--- --slave--
|
||||||
show create database test3;
|
show create database test3;
|
||||||
Database Create Database
|
Database Create Database
|
||||||
test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii_bin */
|
test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
|
||||||
use test2;
|
use test2;
|
||||||
create table t1 (a int auto_increment primary key, b varchar(100));
|
create table t1 (a int auto_increment primary key, b varchar(100));
|
||||||
set character_set_client=cp850, collation_connection=latin2_croatian_ci;
|
set character_set_client=cp850, collation_connection=latin2_croatian_ci;
|
||||||
@ -51,7 +51,7 @@ insert into t1 (b) values(@@collation_connection);
|
|||||||
select * from t1 order by a;
|
select * from t1 order by a;
|
||||||
a b
|
a b
|
||||||
1 armscii8
|
1 armscii8
|
||||||
2 armscii_bin
|
2 armscii8_bin
|
||||||
3 cp850
|
3 cp850
|
||||||
4 latin2
|
4 latin2
|
||||||
5 latin2_croatian_ci
|
5 latin2_croatian_ci
|
||||||
@ -60,7 +60,7 @@ a b
|
|||||||
select * from test2.t1 order by a;
|
select * from test2.t1 order by a;
|
||||||
a b
|
a b
|
||||||
1 armscii8
|
1 armscii8
|
||||||
2 armscii_bin
|
2 armscii8_bin
|
||||||
3 cp850
|
3 cp850
|
||||||
4 latin2
|
4 latin2
|
||||||
5 latin2_croatian_ci
|
5 latin2_croatian_ci
|
||||||
|
@ -4,11 +4,11 @@ reset master;
|
|||||||
reset slave;
|
reset slave;
|
||||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||||
start slave;
|
start slave;
|
||||||
delete from mysql.user where user='rpl_do_grant';
|
delete from mysql.user where user=_binary'rpl_do_grant';
|
||||||
delete from mysql.db where user='rpl_do_grant';
|
delete from mysql.db where user=_binary'rpl_do_grant';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
delete from mysql.user where user='rpl_ignore_grant';
|
delete from mysql.user where user=_binary'rpl_ignore_grant';
|
||||||
delete from mysql.db where user='rpl_ignore_grant';
|
delete from mysql.db where user=_binary'rpl_ignore_grant';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
grant select on *.* to rpl_do_grant@localhost;
|
grant select on *.* to rpl_do_grant@localhost;
|
||||||
grant drop on test.* to rpl_do_grant@localhost;
|
grant drop on test.* to rpl_do_grant@localhost;
|
||||||
@ -17,10 +17,10 @@ Grants for rpl_do_grant@localhost
|
|||||||
GRANT SELECT ON *.* TO 'rpl_do_grant'@'localhost'
|
GRANT SELECT ON *.* TO 'rpl_do_grant'@'localhost'
|
||||||
GRANT DROP ON `test`.* TO 'rpl_do_grant'@'localhost'
|
GRANT DROP ON `test`.* TO 'rpl_do_grant'@'localhost'
|
||||||
set password for rpl_do_grant@localhost=password("does it work?");
|
set password for rpl_do_grant@localhost=password("does it work?");
|
||||||
select password<>'' from mysql.user where user='rpl_do_grant';
|
select password<>_binary'' from mysql.user where user=_binary'rpl_do_grant';
|
||||||
password<>''
|
password<>_binary''
|
||||||
1
|
1
|
||||||
delete from mysql.user where user='rpl_do_grant';
|
delete from mysql.user where user=_binary'rpl_do_grant';
|
||||||
delete from mysql.db where user='rpl_do_grant';
|
delete from mysql.db where user=_binary'rpl_do_grant';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
flush privileges;
|
flush privileges;
|
||||||
|
@ -4,11 +4,11 @@ reset master;
|
|||||||
reset slave;
|
reset slave;
|
||||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||||
start slave;
|
start slave;
|
||||||
delete from mysql.user where user='rpl_ignore_grant';
|
delete from mysql.user where user=_binary'rpl_ignore_grant';
|
||||||
delete from mysql.db where user='rpl_ignore_grant';
|
delete from mysql.db where user=_binary'rpl_ignore_grant';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
delete from mysql.user where user='rpl_ignore_grant';
|
delete from mysql.user where user=_binary'rpl_ignore_grant';
|
||||||
delete from mysql.db where user='rpl_ignore_grant';
|
delete from mysql.db where user=_binary'rpl_ignore_grant';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
grant select on *.* to rpl_ignore_grant@localhost;
|
grant select on *.* to rpl_ignore_grant@localhost;
|
||||||
grant drop on test.* to rpl_ignore_grant@localhost;
|
grant drop on test.* to rpl_ignore_grant@localhost;
|
||||||
@ -18,20 +18,20 @@ GRANT SELECT ON *.* TO 'rpl_ignore_grant'@'localhost'
|
|||||||
GRANT DROP ON `test`.* TO 'rpl_ignore_grant'@'localhost'
|
GRANT DROP ON `test`.* TO 'rpl_ignore_grant'@'localhost'
|
||||||
show grants for rpl_ignore_grant@localhost;
|
show grants for rpl_ignore_grant@localhost;
|
||||||
ERROR 42000: There is no such grant defined for user 'rpl_ignore_grant' on host 'localhost'
|
ERROR 42000: There is no such grant defined for user 'rpl_ignore_grant' on host 'localhost'
|
||||||
select count(*) from mysql.user where user='rpl_ignore_grant';
|
select count(*) from mysql.user where user=_binary'rpl_ignore_grant';
|
||||||
count(*)
|
count(*)
|
||||||
0
|
0
|
||||||
select count(*) from mysql.db where user='rpl_ignore_grant';
|
select count(*) from mysql.db where user=_binary'rpl_ignore_grant';
|
||||||
count(*)
|
count(*)
|
||||||
0
|
0
|
||||||
grant select on *.* to rpl_ignore_grant@localhost;
|
grant select on *.* to rpl_ignore_grant@localhost;
|
||||||
set password for rpl_ignore_grant@localhost=password("does it work?");
|
set password for rpl_ignore_grant@localhost=password("does it work?");
|
||||||
select password<>'' from mysql.user where user='rpl_ignore_grant';
|
select password<>_binary'' from mysql.user where user=_binary'rpl_ignore_grant';
|
||||||
password<>''
|
password<>_binary''
|
||||||
0
|
0
|
||||||
delete from mysql.user where user='rpl_ignore_grant';
|
delete from mysql.user where user=_binary'rpl_ignore_grant';
|
||||||
delete from mysql.db where user='rpl_ignore_grant';
|
delete from mysql.db where user=_binary'rpl_ignore_grant';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
delete from mysql.user where user='rpl_ignore_grant';
|
delete from mysql.user where user=_binary'rpl_ignore_grant';
|
||||||
delete from mysql.db where user='rpl_ignore_grant';
|
delete from mysql.db where user=_binary'rpl_ignore_grant';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
|
@ -395,8 +395,16 @@ show create database test_$1;
|
|||||||
ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'test_$1'
|
ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'test_$1'
|
||||||
drop table test_$1.t1;
|
drop table test_$1.t1;
|
||||||
drop database test_$1;
|
drop database test_$1;
|
||||||
|
set names binary;
|
||||||
delete from mysql.user
|
delete from mysql.user
|
||||||
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
|
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
|
||||||
delete from mysql.db
|
delete from mysql.db
|
||||||
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
|
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
|
set names latin1;
|
||||||
|
create database `ä`;
|
||||||
|
create table `ä`.`ä` (a int) engine=heap;
|
||||||
|
show table status from `ä` LIKE 'ä';
|
||||||
|
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||||
|
ä HEAP 9 Fixed 0 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
|
||||||
|
drop database `ä`;
|
||||||
|
@ -123,7 +123,7 @@ connection user1;
|
|||||||
alter table t1 rename t2;
|
alter table t1 rename t2;
|
||||||
connection root;
|
connection root;
|
||||||
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
|
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
|
||||||
delete from mysql.user where user='mysqltest_1';
|
delete from mysql.user where user=_binary'mysqltest_1';
|
||||||
drop database mysqltest;
|
drop database mysqltest;
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -42,7 +42,7 @@ show tables;
|
|||||||
|
|
||||||
|
|
||||||
# check if old password version also works
|
# check if old password version also works
|
||||||
update mysql.user set password=old_password("gambling2") where user="test";
|
update mysql.user set password=old_password("gambling2") where user=_binary"test";
|
||||||
flush privileges;
|
flush privileges;
|
||||||
|
|
||||||
#connect (con1,localhost,test,gambling2,"");
|
#connect (con1,localhost,test,gambling2,"");
|
||||||
@ -68,5 +68,5 @@ show tables;
|
|||||||
# remove user 'test' so that other tests which may use 'test'
|
# remove user 'test' so that other tests which may use 'test'
|
||||||
# do not depend on this test.
|
# do not depend on this test.
|
||||||
|
|
||||||
delete from mysql.user where user="test";
|
delete from mysql.user where user=_binary"test";
|
||||||
flush privileges;
|
flush privileges;
|
||||||
|
@ -13,25 +13,48 @@
|
|||||||
|
|
||||||
|
|
||||||
SET @@character_set_server=latin5;
|
SET @@character_set_server=latin5;
|
||||||
CREATE DATABASE db1 DEFAULT CHARACTER SET cp1251;
|
CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET cp1251;
|
||||||
USE db1;
|
USE mysqltest1;
|
||||||
CREATE DATABASE db2;
|
CREATE DATABASE mysqltest2;
|
||||||
|
|
||||||
#
|
#
|
||||||
# This should be cp1251
|
# This should be cp1251
|
||||||
#
|
#
|
||||||
SHOW CREATE DATABASE db1;
|
SHOW CREATE DATABASE mysqltest1;
|
||||||
|
|
||||||
#
|
#
|
||||||
# This should take the default latin5 value from server level.
|
# Database "mysqltest2" should take the default latin5 value from
|
||||||
|
# the server level.
|
||||||
|
# Afterwards, table "d2.t1" should inherit the default latin5 value from
|
||||||
|
# the database "mysqltest2", using database option hash.
|
||||||
#
|
#
|
||||||
SHOW CREATE DATABASE db2;
|
SHOW CREATE DATABASE mysqltest2;
|
||||||
DROP DATABASE db2;
|
CREATE TABLE mysqltest2.t1 (a char(10));
|
||||||
|
SHOW CREATE TABLE mysqltest2.t1;
|
||||||
|
DROP TABLE mysqltest2.t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Now we check if the database charset is updated in
|
||||||
|
# the database options hash when we ALTER DATABASE.
|
||||||
|
#
|
||||||
|
ALTER DATABASE mysqltest2 DEFAULT CHARACTER SET latin7;
|
||||||
|
CREATE TABLE mysqltest2.t1 (a char(10));
|
||||||
|
SHOW CREATE TABLE mysqltest2.t1;
|
||||||
|
DROP DATABASE mysqltest2;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Now we check if the database charset is removed from
|
||||||
|
# the database option hash when we DROP DATABASE.
|
||||||
|
#
|
||||||
|
CREATE DATABASE mysqltest2 CHARACTER SET latin2;
|
||||||
|
CREATE TABLE mysqltest2.t1 (a char(10));
|
||||||
|
SHOW CREATE TABLE mysqltest2.t1;
|
||||||
|
DROP DATABASE mysqltest2;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Check that table value uses database level by default
|
# Check that table value uses database level by default
|
||||||
#
|
#
|
||||||
USE db1;
|
USE mysqltest1;
|
||||||
CREATE TABLE t1 (a char(10));
|
CREATE TABLE t1 (a char(10));
|
||||||
SHOW CREATE TABLE t1;
|
SHOW CREATE TABLE t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
@ -50,4 +73,4 @@ DROP TABLE t1;
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
DROP DATABASE db1;
|
DROP DATABASE mysqltest1;
|
||||||
|
@ -78,3 +78,32 @@ SET NAMES koi8r;
|
|||||||
SELECT hex('ÔÅÓÔ');
|
SELECT hex('ÔÅÓÔ');
|
||||||
SET character_set_connection=cp1251;
|
SET character_set_connection=cp1251;
|
||||||
SELECT hex('ÔÅÓÔ');
|
SELECT hex('ÔÅÓÔ');
|
||||||
|
|
||||||
|
USE test;
|
||||||
|
|
||||||
|
# Bug#4417
|
||||||
|
# Check that identifiers and strings are not converted
|
||||||
|
# when the client character set is binary.
|
||||||
|
|
||||||
|
SET NAMES binary;
|
||||||
|
CREATE TABLE `теÑ<C2B5>Ñ‚` (`теÑ<C2B5>Ñ‚` int);
|
||||||
|
SHOW CREATE TABLE `теÑ<C2B5>Ñ‚`;
|
||||||
|
SET NAMES utf8;
|
||||||
|
SHOW CREATE TABLE `теÑ<C2B5>Ñ‚`;
|
||||||
|
DROP TABLE `теÑ<C2B5>Ñ‚`;
|
||||||
|
SET NAMES binary;
|
||||||
|
SET character_set_connection=utf8;
|
||||||
|
SELECT 'теÑ<C2B5>Ñ‚' as s;
|
||||||
|
SET NAMES utf8;
|
||||||
|
SET character_set_connection=binary;
|
||||||
|
SELECT 'теÑ<C2B5>Ñ‚' as s;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Test that we allow only well-formed UTF8 identitiers
|
||||||
|
#
|
||||||
|
SET NAMES binary;
|
||||||
|
--error 1300
|
||||||
|
CREATE TABLE `goodÐÌÏÈÏ` (a int);
|
||||||
|
SET NAMES utf8;
|
||||||
|
--error 1300
|
||||||
|
CREATE TABLE `goodÐÌÏÈÏ` (a int);
|
||||||
|
@ -178,4 +178,5 @@ select group_concat(c1 order by c1) from t1 group by c1 collate utf8_danish_ci;
|
|||||||
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_lithuanian_ci;
|
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_lithuanian_ci;
|
||||||
--select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovak_ci;
|
--select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovak_ci;
|
||||||
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish2_ci;
|
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish2_ci;
|
||||||
|
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_roman_ci;
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ select quote(concat('abc\'', '\\cba'));
|
|||||||
select quote(1/0), quote('\0\Z');
|
select quote(1/0), quote('\0\Z');
|
||||||
select length(quote(concat(char(0),"test")));
|
select length(quote(concat(char(0),"test")));
|
||||||
select hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235))));
|
select hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235))));
|
||||||
select unhex(hex("foobar")), hex(unhex("1234567890ABCDEF")), unhex("345678");
|
select unhex(hex("foobar")), hex(unhex("1234567890ABCDEF")), unhex("345678"), unhex(NULL);
|
||||||
select hex(unhex("1")), hex(unhex("12")), hex(unhex("123")), hex(unhex("1234")), hex(unhex("12345")), hex(unhex("123456"));
|
select hex(unhex("1")), hex(unhex("12")), hex(unhex("123")), hex(unhex("1234")), hex(unhex("12345")), hex(unhex("123456"));
|
||||||
select length(unhex(md5("abrakadabra")));
|
select length(unhex(md5("abrakadabra")));
|
||||||
|
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
drop table if exists t1;
|
drop table if exists t1;
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
|
|
||||||
|
SET NAMES binary;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test that SSL options works properly
|
# Test that SSL options works properly
|
||||||
#
|
#
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
SET NAMES binary;
|
||||||
|
|
||||||
#
|
#
|
||||||
# GRANT tests that require several connections
|
# GRANT tests that require several connections
|
||||||
# (usually it's GRANT, reconnect as another user, try something)
|
# (usually it's GRANT, reconnect as another user, try something)
|
||||||
|
@ -126,6 +126,15 @@ show status like "Qcache_not_cached";
|
|||||||
# Cleanup
|
# Cleanup
|
||||||
|
|
||||||
connection root;
|
connection root;
|
||||||
|
#
|
||||||
|
# A temporary 4.1 workaround to make this test pass if
|
||||||
|
# mysql was compiled with other than latin1 --with-charset=XXX.
|
||||||
|
# Without "set names binary" the below queries fail with
|
||||||
|
# "Illegal mix of collations" error.
|
||||||
|
# In 5.0 we will change grant tables to use NCHAR(N) instead
|
||||||
|
# of "CHAR(N) BINARY", and use cast-to-nchar: N'mysqltest_1'.
|
||||||
|
#
|
||||||
|
set names binary;
|
||||||
delete from mysql.user where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
|
delete from mysql.user where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
|
||||||
delete from mysql.db where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
|
delete from mysql.db where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
|
||||||
delete from mysql.tables_priv where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
|
delete from mysql.tables_priv where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
|
||||||
|
@ -405,7 +405,7 @@ update t1, t2 set t1.b=(select t3.b from t3 where t1.a=t3.a) where t1.a=t2.a;
|
|||||||
connection root;
|
connection root;
|
||||||
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
|
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
|
||||||
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
|
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
|
||||||
delete from mysql.user where user='mysqltest_1';
|
delete from mysql.user where user=_binary'mysqltest_1';
|
||||||
drop database mysqltest;
|
drop database mysqltest;
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -106,7 +106,7 @@ select * from t1 where b<=5 order by a;
|
|||||||
select * from t1 where b<=5 and c=0;
|
select * from t1 where b<=5 and c=0;
|
||||||
insert into t1 values (19,4, 0);
|
insert into t1 values (19,4, 0);
|
||||||
select * from t1 where b<=5 and c=0;
|
select * from t1 where b<=5 and c=0;
|
||||||
select * from t1 where b=4 and c<=5;
|
select * from t1 where b=4 and c<=5 order by a;
|
||||||
select * from t1 where b<=4 and c<=5 order by a;
|
select * from t1 where b<=4 and c<=5 order by a;
|
||||||
select * from t1 where b<=5 and c=0 or b<=5 and c=2;
|
select * from t1 where b<=5 and c=0 or b<=5 and c=2;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
@ -4,15 +4,9 @@
|
|||||||
# #
|
# #
|
||||||
##############################################################
|
##############################################################
|
||||||
|
|
||||||
|
|
||||||
# Please do not
|
|
||||||
# - modify (INSERT/UPDATE/DELETE) the content of the tables
|
|
||||||
# t1 and t_many_col_types. Such tests should be done in
|
|
||||||
# include/ps_modify.inc
|
|
||||||
# - insert test cases where the results depend on the
|
|
||||||
# table type. Such tests should be done in the files
|
|
||||||
# include/ps_query.inc, include/ps_modify ...
|
|
||||||
#
|
#
|
||||||
|
# NOTE: PLEASE SEE THE DETAILED DESCRIPTION AT THE BOTTOM OF THIS FILE
|
||||||
|
# BEFORE ADDING NEW TEST CASES HERE !!!
|
||||||
|
|
||||||
use test;
|
use test;
|
||||||
--disable_query_log
|
--disable_query_log
|
||||||
@ -375,7 +369,6 @@ revoke all privileges on test.t1 from drop_user@localhost ;
|
|||||||
--error 1295
|
--error 1295
|
||||||
prepare stmt3 from ' drop user drop_user@localhost ';
|
prepare stmt3 from ' drop user drop_user@localhost ';
|
||||||
drop user drop_user@localhost;
|
drop user drop_user@localhost;
|
||||||
--error 1141
|
|
||||||
|
|
||||||
#### table related commands
|
#### table related commands
|
||||||
## describe
|
## describe
|
||||||
@ -737,3 +730,101 @@ execute stmt1 using
|
|||||||
@arg60, @arg61 ;
|
@arg60, @arg61 ;
|
||||||
|
|
||||||
drop table t1 ;
|
drop table t1 ;
|
||||||
|
|
||||||
|
##### RULES OF THUMB TO PRESERVE THE SYSTEMATICS OF THE PS TEST CASES #####
|
||||||
|
#
|
||||||
|
# 0. You don't have the time to
|
||||||
|
# - read and pay attention to these rules of thumb
|
||||||
|
# - accept that QA may move your test case to a different place
|
||||||
|
# (I will not change your code!!) .
|
||||||
|
# Please append your test case to
|
||||||
|
# t/ps.test
|
||||||
|
#
|
||||||
|
# 1. You have more time and want to get as much value from you test case as
|
||||||
|
# possible. Please try to make the following decisions:
|
||||||
|
#
|
||||||
|
# Will the execution or result of the sub test case depend on the
|
||||||
|
# properties of a storage engine ?
|
||||||
|
#
|
||||||
|
# NO --> alter t/ps_1general.test (Example: Command with syntax error)
|
||||||
|
# If you need a table, please try to use
|
||||||
|
# t1 - very simple table
|
||||||
|
# t_many_col_types - table with nearly all available column types
|
||||||
|
# whenever possible.
|
||||||
|
#
|
||||||
|
# The structure and the content of these tables can be found in
|
||||||
|
# include/ps_create.inc CREATE TABLE ...
|
||||||
|
# include/ps_renew.inc DELETE all rows and INSERT some rows
|
||||||
|
#
|
||||||
|
# Both tables are managed by the same storage engine.
|
||||||
|
# The type of the storage engine is stored in the variable
|
||||||
|
# '$type' . In ps_1general.test $type is set to 'MYISAM'.
|
||||||
|
#
|
||||||
|
# Please feel free to source ps_create.inc or ps_renew.inc
|
||||||
|
# whenever you think it helps. But please restore the original
|
||||||
|
# state of these tables after your tests, because the following
|
||||||
|
# statements may depend on it.
|
||||||
|
#
|
||||||
|
# YES
|
||||||
|
# |
|
||||||
|
# |
|
||||||
|
# Is it possible to apply the sub test case to all table types ?
|
||||||
|
# YES --> alter include/ps_query.inc (for SELECTs)
|
||||||
|
# include/ps_modify.inc (for INSERT/UPDATE/DELETE)
|
||||||
|
# include/ps_modify1.inc (also for INSERT/UPDATE/DELETE,
|
||||||
|
# but t/ps_5merge.test will not source that file)
|
||||||
|
# Please try to find an appropriate place within the file.
|
||||||
|
# It would be nice if we have some systematics in the
|
||||||
|
# order of the sub test cases (if possible).
|
||||||
|
#
|
||||||
|
# Please be aware, that
|
||||||
|
# include: ps_query.inc, ps_modify.inc, ps_modify1.inc
|
||||||
|
# will be sourced by several test case files stored within the
|
||||||
|
# subdirectory 't'. So every change here will affect several test
|
||||||
|
# cases.
|
||||||
|
#
|
||||||
|
# NO
|
||||||
|
# |
|
||||||
|
# |
|
||||||
|
# Append the sub test case to the appropriate
|
||||||
|
# ps_<number><table type>.test .
|
||||||
|
#
|
||||||
|
# 2. The current structure of the PS tests
|
||||||
|
#
|
||||||
|
# t/ps_1general.test Check of basic PS features, SHOW commands and DDL
|
||||||
|
# The tests should not depend on the table type.
|
||||||
|
#
|
||||||
|
# t/ps_2myisam Check of PS on tables of type MYISAM .
|
||||||
|
# t/ps_3innodb Check of PS on tables of type InnoDB .
|
||||||
|
# ...
|
||||||
|
# t/ps_6bdb Check of PS on tables of type BDB .
|
||||||
|
# All storage engine related tests use the variable $type to hold the
|
||||||
|
# name of the storage engine.
|
||||||
|
#
|
||||||
|
# include/ps_query.inc test cases with SELECT/...
|
||||||
|
# These test cases should not modify the content or
|
||||||
|
# the structure (DROP/ALTER..) of the tables
|
||||||
|
# 't1' and 't_many_col_types'.
|
||||||
|
# include/ps_modify.inc test cases with INSERT/UPDATE/...
|
||||||
|
# These test cases should not modify the structure
|
||||||
|
# (DROP/ALTER..) of the tables
|
||||||
|
# 't1' and 't_many_col_types'.
|
||||||
|
# These two test sequences will be applied to all table types .
|
||||||
|
#
|
||||||
|
# include/ps_modify1.inc test cases with INSERT/UPDATE/...
|
||||||
|
# This test sequences will be applied to all table types
|
||||||
|
# except MERGE tables.
|
||||||
|
#
|
||||||
|
# include/ps_create.inc DROP and CREATE of the tables
|
||||||
|
# 't1' and 't_many_col_types' .
|
||||||
|
# include/ps_renew.inc DELETE all rows and INSERT some rows, that means
|
||||||
|
# recreate the original content of these tables.
|
||||||
|
# Please do not alter the commands concerning these two tables.
|
||||||
|
#
|
||||||
|
# Please feel free and encouraged to exploit the current code sharing
|
||||||
|
# mechanism of the 'ps_<number><table type>' test cases. It is an convenient
|
||||||
|
# way to check all storage engines.
|
||||||
|
#
|
||||||
|
# Thank you for reading these rules of thumb.
|
||||||
|
#
|
||||||
|
# Matthias
|
||||||
|
@ -4,6 +4,10 @@
|
|||||||
# #
|
# #
|
||||||
###############################################
|
###############################################
|
||||||
|
|
||||||
|
#
|
||||||
|
# NOTE: PLEASE SEE ps_1general.test (bottom)
|
||||||
|
# BEFORE ADDING NEW TEST CASES HERE !!!
|
||||||
|
|
||||||
use test;
|
use test;
|
||||||
|
|
||||||
let $type= 'MYISAM' ;
|
let $type= 'MYISAM' ;
|
||||||
|
@ -4,8 +4,14 @@
|
|||||||
# #
|
# #
|
||||||
###############################################
|
###############################################
|
||||||
|
|
||||||
|
#
|
||||||
|
# NOTE: PLEASE SEE ps_1general.test (bottom)
|
||||||
|
# BEFORE ADDING NEW TEST CASES HERE !!!
|
||||||
|
|
||||||
use test;
|
use test;
|
||||||
|
|
||||||
|
-- source include/have_innodb.inc
|
||||||
|
|
||||||
let $type= 'InnoDB' ;
|
let $type= 'InnoDB' ;
|
||||||
-- source include/ps_create.inc
|
-- source include/ps_create.inc
|
||||||
-- source include/ps_renew.inc
|
-- source include/ps_renew.inc
|
||||||
|
@ -4,6 +4,10 @@
|
|||||||
# #
|
# #
|
||||||
###############################################
|
###############################################
|
||||||
|
|
||||||
|
#
|
||||||
|
# NOTE: PLEASE SEE ps_1general.test (bottom)
|
||||||
|
# BEFORE ADDING NEW TEST CASES HERE !!!
|
||||||
|
|
||||||
use test;
|
use test;
|
||||||
|
|
||||||
let $type= 'HEAP' ;
|
let $type= 'HEAP' ;
|
||||||
@ -19,7 +23,8 @@ eval create table t1
|
|||||||
--disable_warnings
|
--disable_warnings
|
||||||
drop table if exists t_many_col_types;
|
drop table if exists t_many_col_types;
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
# The used table type doesn't support BLOB/TEXT columns (error 1163)
|
# The used table type doesn't support BLOB/TEXT columns.
|
||||||
|
# (The server would send error 1163 .)
|
||||||
# So we use char(100) instead.
|
# So we use char(100) instead.
|
||||||
eval create table t_many_col_types
|
eval create table t_many_col_types
|
||||||
(
|
(
|
||||||
|
@ -4,6 +4,10 @@
|
|||||||
# #
|
# #
|
||||||
###############################################
|
###############################################
|
||||||
|
|
||||||
|
#
|
||||||
|
# NOTE: PLEASE SEE ps_1general.test (bottom)
|
||||||
|
# BEFORE ADDING NEW TEST CASES HERE !!!
|
||||||
|
|
||||||
use test;
|
use test;
|
||||||
|
|
||||||
--disable_warnings
|
--disable_warnings
|
||||||
|
@ -4,6 +4,10 @@
|
|||||||
# #
|
# #
|
||||||
###############################################
|
###############################################
|
||||||
|
|
||||||
|
#
|
||||||
|
# NOTE: PLEASE SEE ps_1general.test (bottom)
|
||||||
|
# BEFORE ADDING NEW TEST CASES HERE !!!
|
||||||
|
|
||||||
use test;
|
use test;
|
||||||
|
|
||||||
-- source include/have_bdb.inc
|
-- source include/have_bdb.inc
|
||||||
|
@ -110,14 +110,14 @@ create table t1 (n int);
|
|||||||
insert into t1 values(3456);
|
insert into t1 values(3456);
|
||||||
insert into mysql.user (Host, User, Password)
|
insert into mysql.user (Host, User, Password)
|
||||||
VALUES ("10.10.10.%", "blafasel2", password("blafasel2"));
|
VALUES ("10.10.10.%", "blafasel2", password("blafasel2"));
|
||||||
select select_priv,user from mysql.user where user = 'blafasel2';
|
select select_priv,user from mysql.user where user = _binary'blafasel2';
|
||||||
update mysql.user set Select_priv = "Y" where User="blafasel2";
|
update mysql.user set Select_priv = "Y" where User= _binary"blafasel2";
|
||||||
select select_priv,user from mysql.user where user = 'blafasel2';
|
select select_priv,user from mysql.user where user = _binary'blafasel2';
|
||||||
save_master_pos;
|
save_master_pos;
|
||||||
connection slave;
|
connection slave;
|
||||||
sync_with_master;
|
sync_with_master;
|
||||||
select n from t1;
|
select n from t1;
|
||||||
select select_priv,user from mysql.user where user = 'blafasel2';
|
select select_priv,user from mysql.user where user = _binary'blafasel2';
|
||||||
connection master1;
|
connection master1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
save_master_pos;
|
save_master_pos;
|
||||||
|
@ -26,7 +26,7 @@ show create database test2;
|
|||||||
show create database test3;
|
show create database test3;
|
||||||
|
|
||||||
connection master;
|
connection master;
|
||||||
set @@collation_server=armscii_bin;
|
set @@collation_server=armscii8_bin;
|
||||||
drop database test3;
|
drop database test3;
|
||||||
create database test3;
|
create database test3;
|
||||||
--disable_query_log
|
--disable_query_log
|
||||||
|
@ -4,16 +4,16 @@ source include/master-slave.inc;
|
|||||||
|
|
||||||
# do not be influenced by other tests.
|
# do not be influenced by other tests.
|
||||||
connection master;
|
connection master;
|
||||||
delete from mysql.user where user='rpl_do_grant';
|
delete from mysql.user where user=_binary'rpl_do_grant';
|
||||||
delete from mysql.db where user='rpl_do_grant';
|
delete from mysql.db where user=_binary'rpl_do_grant';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
save_master_pos;
|
save_master_pos;
|
||||||
connection slave;
|
connection slave;
|
||||||
sync_with_master;
|
sync_with_master;
|
||||||
# if these DELETE did nothing on the master, we need to do them manually on the
|
# if these DELETE did nothing on the master, we need to do them manually on the
|
||||||
# slave.
|
# slave.
|
||||||
delete from mysql.user where user='rpl_ignore_grant';
|
delete from mysql.user where user=_binary'rpl_ignore_grant';
|
||||||
delete from mysql.db where user='rpl_ignore_grant';
|
delete from mysql.db where user=_binary'rpl_ignore_grant';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
|
|
||||||
# test replication of GRANT
|
# test replication of GRANT
|
||||||
@ -31,12 +31,12 @@ set password for rpl_do_grant@localhost=password("does it work?");
|
|||||||
save_master_pos;
|
save_master_pos;
|
||||||
connection slave;
|
connection slave;
|
||||||
sync_with_master;
|
sync_with_master;
|
||||||
select password<>'' from mysql.user where user='rpl_do_grant';
|
select password<>_binary'' from mysql.user where user=_binary'rpl_do_grant';
|
||||||
|
|
||||||
# clear what we have done, to not influence other tests.
|
# clear what we have done, to not influence other tests.
|
||||||
connection master;
|
connection master;
|
||||||
delete from mysql.user where user='rpl_do_grant';
|
delete from mysql.user where user=_binary'rpl_do_grant';
|
||||||
delete from mysql.db where user='rpl_do_grant';
|
delete from mysql.db where user=_binary'rpl_do_grant';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
save_master_pos;
|
save_master_pos;
|
||||||
connection slave;
|
connection slave;
|
||||||
|
@ -6,16 +6,16 @@ source include/master-slave.inc;
|
|||||||
|
|
||||||
# do not be influenced by other tests.
|
# do not be influenced by other tests.
|
||||||
connection master;
|
connection master;
|
||||||
delete from mysql.user where user='rpl_ignore_grant';
|
delete from mysql.user where user=_binary'rpl_ignore_grant';
|
||||||
delete from mysql.db where user='rpl_ignore_grant';
|
delete from mysql.db where user=_binary'rpl_ignore_grant';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
save_master_pos;
|
save_master_pos;
|
||||||
connection slave;
|
connection slave;
|
||||||
sync_with_master;
|
sync_with_master;
|
||||||
# as these DELETE were not replicated, we need to do them manually on the
|
# as these DELETE were not replicated, we need to do them manually on the
|
||||||
# slave.
|
# slave.
|
||||||
delete from mysql.user where user='rpl_ignore_grant';
|
delete from mysql.user where user=_binary'rpl_ignore_grant';
|
||||||
delete from mysql.db where user='rpl_ignore_grant';
|
delete from mysql.db where user=_binary'rpl_ignore_grant';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
|
|
||||||
# test non-replication of GRANT
|
# test non-replication of GRANT
|
||||||
@ -29,8 +29,8 @@ sync_with_master;
|
|||||||
--error 1141 #("no such grant for user")
|
--error 1141 #("no such grant for user")
|
||||||
show grants for rpl_ignore_grant@localhost;
|
show grants for rpl_ignore_grant@localhost;
|
||||||
# check it another way
|
# check it another way
|
||||||
select count(*) from mysql.user where user='rpl_ignore_grant';
|
select count(*) from mysql.user where user=_binary'rpl_ignore_grant';
|
||||||
select count(*) from mysql.db where user='rpl_ignore_grant';
|
select count(*) from mysql.db where user=_binary'rpl_ignore_grant';
|
||||||
|
|
||||||
# test non-replication of SET PASSWORD
|
# test non-replication of SET PASSWORD
|
||||||
# first force creation of the user on slave (because as the user does not exist
|
# first force creation of the user on slave (because as the user does not exist
|
||||||
@ -42,16 +42,16 @@ set password for rpl_ignore_grant@localhost=password("does it work?");
|
|||||||
save_master_pos;
|
save_master_pos;
|
||||||
connection slave;
|
connection slave;
|
||||||
sync_with_master;
|
sync_with_master;
|
||||||
select password<>'' from mysql.user where user='rpl_ignore_grant';
|
select password<>_binary'' from mysql.user where user=_binary'rpl_ignore_grant';
|
||||||
|
|
||||||
# clear what we have done, to not influence other tests.
|
# clear what we have done, to not influence other tests.
|
||||||
connection master;
|
connection master;
|
||||||
delete from mysql.user where user='rpl_ignore_grant';
|
delete from mysql.user where user=_binary'rpl_ignore_grant';
|
||||||
delete from mysql.db where user='rpl_ignore_grant';
|
delete from mysql.db where user=_binary'rpl_ignore_grant';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
save_master_pos;
|
save_master_pos;
|
||||||
connection slave;
|
connection slave;
|
||||||
sync_with_master;
|
sync_with_master;
|
||||||
delete from mysql.user where user='rpl_ignore_grant';
|
delete from mysql.user where user=_binary'rpl_ignore_grant';
|
||||||
delete from mysql.db where user='rpl_ignore_grant';
|
delete from mysql.db where user=_binary'rpl_ignore_grant';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
|
@ -299,8 +299,17 @@ drop table test_$1.t1;
|
|||||||
drop database test_$1;
|
drop database test_$1;
|
||||||
|
|
||||||
connection default;
|
connection default;
|
||||||
|
set names binary;
|
||||||
delete from mysql.user
|
delete from mysql.user
|
||||||
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
|
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
|
||||||
delete from mysql.db
|
delete from mysql.db
|
||||||
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
|
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
|
||||||
flush privileges;
|
flush privileges;
|
||||||
|
|
||||||
|
#Bug #4374 SHOW TABLE STATUS FROM ignores collation_connection
|
||||||
|
set names latin1;
|
||||||
|
create database `ä`;
|
||||||
|
create table `ä`.`ä` (a int) engine=heap;
|
||||||
|
--replace_column 7 # 8 # 9 #
|
||||||
|
show table status from `ä` LIKE 'ä';
|
||||||
|
drop database `ä`;
|
||||||
|
@ -80,4 +80,3 @@ DROP TABLE help_relation;
|
|||||||
DROP TABLE help_topic;
|
DROP TABLE help_topic;
|
||||||
|
|
||||||
-- enable_query_log
|
-- enable_query_log
|
||||||
|
|
||||||
|
@ -99,4 +99,3 @@ drop table test_func;
|
|||||||
drop table test_host;
|
drop table test_host;
|
||||||
drop table test_user;
|
drop table test_user;
|
||||||
drop table test_db;
|
drop table test_db;
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ extern CHARSET_INFO my_charset_ucs2_danish_uca_ci;
|
|||||||
extern CHARSET_INFO my_charset_ucs2_lithuanian_uca_ci;
|
extern CHARSET_INFO my_charset_ucs2_lithuanian_uca_ci;
|
||||||
extern CHARSET_INFO my_charset_ucs2_slovak_uca_ci;
|
extern CHARSET_INFO my_charset_ucs2_slovak_uca_ci;
|
||||||
extern CHARSET_INFO my_charset_ucs2_spanish2_uca_ci;
|
extern CHARSET_INFO my_charset_ucs2_spanish2_uca_ci;
|
||||||
|
extern CHARSET_INFO my_charset_ucs2_roman_uca_ci;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CHARSET_utf8
|
#ifdef HAVE_CHARSET_utf8
|
||||||
@ -56,6 +57,7 @@ extern CHARSET_INFO my_charset_utf8_danish_uca_ci;
|
|||||||
extern CHARSET_INFO my_charset_utf8_lithuanian_uca_ci;
|
extern CHARSET_INFO my_charset_utf8_lithuanian_uca_ci;
|
||||||
extern CHARSET_INFO my_charset_utf8_slovak_uca_ci;
|
extern CHARSET_INFO my_charset_utf8_slovak_uca_ci;
|
||||||
extern CHARSET_INFO my_charset_utf8_spanish2_uca_ci;
|
extern CHARSET_INFO my_charset_utf8_spanish2_uca_ci;
|
||||||
|
extern CHARSET_INFO my_charset_utf8_roman_uca_ci;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
my_bool init_compiled_charsets(myf flags __attribute__((unused)))
|
my_bool init_compiled_charsets(myf flags __attribute__((unused)))
|
||||||
@ -124,6 +126,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
|
|||||||
add_compiled_collation(&my_charset_ucs2_lithuanian_uca_ci);
|
add_compiled_collation(&my_charset_ucs2_lithuanian_uca_ci);
|
||||||
add_compiled_collation(&my_charset_ucs2_slovak_uca_ci);
|
add_compiled_collation(&my_charset_ucs2_slovak_uca_ci);
|
||||||
add_compiled_collation(&my_charset_ucs2_spanish2_uca_ci);
|
add_compiled_collation(&my_charset_ucs2_spanish2_uca_ci);
|
||||||
|
add_compiled_collation(&my_charset_ucs2_roman_uca_ci);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CHARSET_ujis
|
#ifdef HAVE_CHARSET_ujis
|
||||||
@ -149,6 +152,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
|
|||||||
add_compiled_collation(&my_charset_utf8_lithuanian_uca_ci);
|
add_compiled_collation(&my_charset_utf8_lithuanian_uca_ci);
|
||||||
add_compiled_collation(&my_charset_utf8_slovak_uca_ci);
|
add_compiled_collation(&my_charset_utf8_slovak_uca_ci);
|
||||||
add_compiled_collation(&my_charset_utf8_spanish2_uca_ci);
|
add_compiled_collation(&my_charset_utf8_spanish2_uca_ci);
|
||||||
|
add_compiled_collation(&my_charset_utf8_roman_uca_ci);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Copy compiled charsets */
|
/* Copy compiled charsets */
|
||||||
|
@ -127,6 +127,7 @@ void my_end(int infoflag)
|
|||||||
FILE *info_file;
|
FILE *info_file;
|
||||||
if (!(info_file=DBUG_FILE))
|
if (!(info_file=DBUG_FILE))
|
||||||
info_file=stderr;
|
info_file=stderr;
|
||||||
|
DBUG_PRINT("info",("Shutting down"));
|
||||||
if (infoflag & MY_CHECK_ERROR || info_file != stderr)
|
if (infoflag & MY_CHECK_ERROR || info_file != stderr)
|
||||||
{ /* Test if some file is left open */
|
{ /* Test if some file is left open */
|
||||||
if (my_file_opened | my_stream_opened)
|
if (my_file_opened | my_stream_opened)
|
||||||
|
@ -461,6 +461,17 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
|
|||||||
else
|
else
|
||||||
finfo.mystat= NULL;
|
finfo.mystat= NULL;
|
||||||
|
|
||||||
|
/*
|
||||||
|
If the directory is the root directory of the drive, Windows sometimes
|
||||||
|
creates hidden or system files there (like RECYCLER); do not show
|
||||||
|
them. We would need to see how this can be achieved with a Borland
|
||||||
|
compiler.
|
||||||
|
*/
|
||||||
|
#ifndef __BORLANDC__
|
||||||
|
if (attrib & (_A_HIDDEN | _A_SYSTEM))
|
||||||
|
continue;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (push_dynamic(dir_entries_storage, (gptr)&finfo))
|
if (push_dynamic(dir_entries_storage, (gptr)&finfo))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
@ -24,8 +24,8 @@ public:
|
|||||||
ValueType m_type;
|
ValueType m_type;
|
||||||
union {
|
union {
|
||||||
Uint32 m_int;
|
Uint32 m_int;
|
||||||
const char * m_string;
|
|
||||||
Uint64 m_int64;
|
Uint64 m_int64;
|
||||||
|
const char * m_string;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -72,8 +72,8 @@ private:
|
|||||||
friend class ConstIterator;
|
friend class ConstIterator;
|
||||||
|
|
||||||
bool getByPos(Uint32 pos, Entry *) const;
|
bool getByPos(Uint32 pos, Entry *) const;
|
||||||
Uint64 & get64(Uint32 index) const;
|
Uint64 * get64(Uint32 index) const;
|
||||||
char * & getString(Uint32 index) const;
|
char ** getString(Uint32 index) const;
|
||||||
|
|
||||||
Uint32 m_size;
|
Uint32 m_size;
|
||||||
Uint32 m_dataSize;
|
Uint32 m_dataSize;
|
||||||
|
@ -60,7 +60,7 @@ ConfigValues::ConfigValues(Uint32 sz, Uint32 dsz){
|
|||||||
|
|
||||||
ConfigValues::~ConfigValues(){
|
ConfigValues::~ConfigValues(){
|
||||||
for(Uint32 i = 0; i<m_stringCount; i++){
|
for(Uint32 i = 0; i<m_stringCount; i++){
|
||||||
free(getString(i));
|
free(* getString(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,10 +87,10 @@ ConfigValues::getByPos(Uint32 pos, Entry * result) const {
|
|||||||
result->m_int = val;
|
result->m_int = val;
|
||||||
break;
|
break;
|
||||||
case StringType:
|
case StringType:
|
||||||
result->m_string = getString(val);
|
result->m_string = * getString(val);
|
||||||
break;
|
break;
|
||||||
case Int64Type:
|
case Int64Type:
|
||||||
result->m_int64 = get64(val);
|
result->m_int64 = * get64(val);
|
||||||
break;
|
break;
|
||||||
case InvalidType:
|
case InvalidType:
|
||||||
default:
|
default:
|
||||||
@ -102,18 +102,23 @@ ConfigValues::getByPos(Uint32 pos, Entry * result) const {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Uint64 &
|
Uint64 *
|
||||||
ConfigValues::get64(Uint32 index) const {
|
ConfigValues::get64(Uint32 index) const {
|
||||||
assert(index < m_int64Count);
|
assert(index < m_int64Count);
|
||||||
Uint64 * ptr = (Uint64*)(&m_values[m_size << 1]);
|
const Uint32 * data = m_values + (m_size << 1);
|
||||||
return ptr[index];
|
Uint64 * ptr = (Uint64*)data;
|
||||||
|
ptr += index;
|
||||||
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
char * &
|
char **
|
||||||
ConfigValues::getString(Uint32 index) const {
|
ConfigValues::getString(Uint32 index) const {
|
||||||
assert(index < m_stringCount);
|
assert(index < m_stringCount);
|
||||||
char ** ptr = (char**)(((char *)&(m_values[m_size << 1])) + m_dataSize);
|
const Uint32 * data = m_values + (m_size << 1);
|
||||||
return ptr[-index];
|
char * ptr = (char*)data;
|
||||||
|
ptr += m_dataSize;
|
||||||
|
ptr -= (index * sizeof(char *));
|
||||||
|
return (char**)ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
@ -176,7 +181,7 @@ ConfigValues::Iterator::set(Uint32 key, Uint64 value){
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_cfg.get64(m_cfg.m_values[pos+1]) = value;
|
* m_cfg.get64(m_cfg.m_values[pos+1]) = value;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,9 +196,9 @@ ConfigValues::Iterator::set(Uint32 key, const char * value){
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
char * & str = m_cfg.getString(m_cfg.m_values[pos+1]);
|
char ** str = m_cfg.getString(m_cfg.m_values[pos+1]);
|
||||||
free(str);
|
free(* str);
|
||||||
str = strdup(value ? value : "");
|
* str = strdup(value ? value : "");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -457,7 +462,8 @@ ConfigValuesFactory::put(const ConfigValues::Entry & entry){
|
|||||||
case ConfigValues::StringType:{
|
case ConfigValues::StringType:{
|
||||||
Uint32 index = m_cfg->m_stringCount++;
|
Uint32 index = m_cfg->m_stringCount++;
|
||||||
m_cfg->m_values[pos+1] = index;
|
m_cfg->m_values[pos+1] = index;
|
||||||
m_cfg->getString(index) = strdup(entry.m_string ? entry.m_string : "");
|
char ** ref = m_cfg->getString(index);
|
||||||
|
* ref = strdup(entry.m_string ? entry.m_string : "");
|
||||||
m_freeKeys--;
|
m_freeKeys--;
|
||||||
m_freeData -= sizeof(char *);
|
m_freeData -= sizeof(char *);
|
||||||
DEBUG printf("Putting at: %d(%d) (loop = %d) key: %d value(%d): %s\n",
|
DEBUG printf("Putting at: %d(%d) (loop = %d) key: %d value(%d): %s\n",
|
||||||
@ -470,7 +476,7 @@ ConfigValuesFactory::put(const ConfigValues::Entry & entry){
|
|||||||
case ConfigValues::Int64Type:{
|
case ConfigValues::Int64Type:{
|
||||||
Uint32 index = m_cfg->m_int64Count++;
|
Uint32 index = m_cfg->m_int64Count++;
|
||||||
m_cfg->m_values[pos+1] = index;
|
m_cfg->m_values[pos+1] = index;
|
||||||
m_cfg->get64(index) = entry.m_int64;
|
* m_cfg->get64(index) = entry.m_int64;
|
||||||
m_freeKeys--;
|
m_freeKeys--;
|
||||||
m_freeData -= 8;
|
m_freeData -= 8;
|
||||||
DEBUG printf("Putting at: %d(%d) (loop = %d) key: %d value64(%d): %lld\n",
|
DEBUG printf("Putting at: %d(%d) (loop = %d) key: %d value64(%d): %lld\n",
|
||||||
@ -558,7 +564,7 @@ ConfigValues::getPackedSize() const {
|
|||||||
break;
|
break;
|
||||||
case StringType:
|
case StringType:
|
||||||
size += 8; // key + len
|
size += 8; // key + len
|
||||||
size += mod4(strlen(getString(m_values[i+1])) + 1);
|
size += mod4(strlen(* getString(m_values[i+1])) + 1);
|
||||||
break;
|
break;
|
||||||
case InvalidType:
|
case InvalidType:
|
||||||
default:
|
default:
|
||||||
@ -587,7 +593,7 @@ ConfigValues::pack(void * _dst, Uint32 _len) const {
|
|||||||
* (Uint32*)dst = htonl(val); dst += 4;
|
* (Uint32*)dst = htonl(val); dst += 4;
|
||||||
break;
|
break;
|
||||||
case Int64Type:{
|
case Int64Type:{
|
||||||
Uint64 i64 = get64(val);
|
Uint64 i64 = * get64(val);
|
||||||
Uint32 hi = (i64 >> 32);
|
Uint32 hi = (i64 >> 32);
|
||||||
Uint32 lo = (i64 & 0xFFFFFFFF);
|
Uint32 lo = (i64 & 0xFFFFFFFF);
|
||||||
* (Uint32*)dst = htonl(key); dst += 4;
|
* (Uint32*)dst = htonl(key); dst += 4;
|
||||||
@ -596,7 +602,7 @@ ConfigValues::pack(void * _dst, Uint32 _len) const {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case StringType:{
|
case StringType:{
|
||||||
const char * str = getString(val);
|
const char * str = * getString(val);
|
||||||
Uint32 len = strlen(str) + 1;
|
Uint32 len = strlen(str) + 1;
|
||||||
* (Uint32*)dst = htonl(key); dst += 4;
|
* (Uint32*)dst = htonl(key); dst += 4;
|
||||||
* (Uint32*)dst = htonl(len); dst += 4;
|
* (Uint32*)dst = htonl(len); dst += 4;
|
||||||
|
@ -63,7 +63,7 @@ Ndbfs::Ndbfs(const Configuration & conf) :
|
|||||||
const ndb_mgm_configuration_iterator * p = conf.getOwnConfigIterator();
|
const ndb_mgm_configuration_iterator * p = conf.getOwnConfigIterator();
|
||||||
ndbrequire(p != 0);
|
ndbrequire(p != 0);
|
||||||
|
|
||||||
m_maxOpenedFiles = 40;
|
m_maxFiles = 40;
|
||||||
//ndb_mgm_get_int_parameter(p, CFG_DB_MAX_OPEN_FILES, &m_maxFiles);
|
//ndb_mgm_get_int_parameter(p, CFG_DB_MAX_OPEN_FILES, &m_maxFiles);
|
||||||
|
|
||||||
// Create idle AsyncFiles
|
// Create idle AsyncFiles
|
||||||
|
@ -795,8 +795,8 @@ inline
|
|||||||
void
|
void
|
||||||
UnsafeArrayPool<T>::getPtrForce(Ptr<T> & ptr){
|
UnsafeArrayPool<T>::getPtrForce(Ptr<T> & ptr){
|
||||||
Uint32 i = ptr.i;
|
Uint32 i = ptr.i;
|
||||||
if(i < size){
|
if(i < this->size){
|
||||||
ptr.p = &theArray[i];
|
ptr.p = &this->theArray[i];
|
||||||
} else {
|
} else {
|
||||||
ErrorReporter::handleAssert("UnsafeArrayPool<T>::getPtr",
|
ErrorReporter::handleAssert("UnsafeArrayPool<T>::getPtr",
|
||||||
__FILE__, __LINE__);
|
__FILE__, __LINE__);
|
||||||
@ -808,8 +808,8 @@ inline
|
|||||||
void
|
void
|
||||||
UnsafeArrayPool<T>::getPtrForce(ConstPtr<T> & ptr) const{
|
UnsafeArrayPool<T>::getPtrForce(ConstPtr<T> & ptr) const{
|
||||||
Uint32 i = ptr.i;
|
Uint32 i = ptr.i;
|
||||||
if(i < size){
|
if(i < this->size){
|
||||||
ptr.p = &theArray[i];
|
ptr.p = &this->theArray[i];
|
||||||
} else {
|
} else {
|
||||||
ErrorReporter::handleAssert("UnsafeArrayPool<T>::getPtr",
|
ErrorReporter::handleAssert("UnsafeArrayPool<T>::getPtr",
|
||||||
__FILE__, __LINE__);
|
__FILE__, __LINE__);
|
||||||
@ -820,8 +820,8 @@ template <class T>
|
|||||||
inline
|
inline
|
||||||
T *
|
T *
|
||||||
UnsafeArrayPool<T>::getPtrForce(Uint32 i){
|
UnsafeArrayPool<T>::getPtrForce(Uint32 i){
|
||||||
if(i < size){
|
if(i < this->size){
|
||||||
return &theArray[i];
|
return &this->theArray[i];
|
||||||
} else {
|
} else {
|
||||||
ErrorReporter::handleAssert("UnsafeArrayPool<T>::getPtr",
|
ErrorReporter::handleAssert("UnsafeArrayPool<T>::getPtr",
|
||||||
__FILE__, __LINE__);
|
__FILE__, __LINE__);
|
||||||
@ -833,8 +833,8 @@ template <class T>
|
|||||||
inline
|
inline
|
||||||
const T *
|
const T *
|
||||||
UnsafeArrayPool<T>::getConstPtrForce(Uint32 i) const {
|
UnsafeArrayPool<T>::getConstPtrForce(Uint32 i) const {
|
||||||
if(i < size){
|
if(i < this->size){
|
||||||
return &theArray[i];
|
return &this->theArray[i];
|
||||||
} else {
|
} else {
|
||||||
ErrorReporter::handleAssert("UnsafeArrayPool<T>::getPtr",
|
ErrorReporter::handleAssert("UnsafeArrayPool<T>::getPtr",
|
||||||
__FILE__, __LINE__);
|
__FILE__, __LINE__);
|
||||||
@ -847,8 +847,8 @@ inline
|
|||||||
void
|
void
|
||||||
UnsafeArrayPool<T>::getPtrForce(Ptr<T> & ptr, Uint32 i){
|
UnsafeArrayPool<T>::getPtrForce(Ptr<T> & ptr, Uint32 i){
|
||||||
ptr.i = i;
|
ptr.i = i;
|
||||||
if(i < size){
|
if(i < this->size){
|
||||||
ptr.p = &theArray[i];
|
ptr.p = &this->theArray[i];
|
||||||
return ;
|
return ;
|
||||||
} else {
|
} else {
|
||||||
ErrorReporter::handleAssert("UnsafeArrayPool<T>::getPtr",
|
ErrorReporter::handleAssert("UnsafeArrayPool<T>::getPtr",
|
||||||
@ -861,8 +861,8 @@ inline
|
|||||||
void
|
void
|
||||||
UnsafeArrayPool<T>::getPtrForce(ConstPtr<T> & ptr, Uint32 i) const{
|
UnsafeArrayPool<T>::getPtrForce(ConstPtr<T> & ptr, Uint32 i) const{
|
||||||
ptr.i = i;
|
ptr.i = i;
|
||||||
if(i < size){
|
if(i < this->size){
|
||||||
ptr.p = &theArray[i];
|
ptr.p = &this->theArray[i];
|
||||||
return ;
|
return ;
|
||||||
} else {
|
} else {
|
||||||
ErrorReporter::handleAssert("UnsafeArrayPool<T>::getPtr",
|
ErrorReporter::handleAssert("UnsafeArrayPool<T>::getPtr",
|
||||||
|
@ -153,11 +153,11 @@ public:
|
|||||||
LocalDLFifoList(ArrayPool<T> & thePool, typename DLFifoList<T>::Head & _src)
|
LocalDLFifoList(ArrayPool<T> & thePool, typename DLFifoList<T>::Head & _src)
|
||||||
: DLFifoList<T>(thePool), src(_src)
|
: DLFifoList<T>(thePool), src(_src)
|
||||||
{
|
{
|
||||||
head = src;
|
this->head = src;
|
||||||
}
|
}
|
||||||
|
|
||||||
~LocalDLFifoList(){
|
~LocalDLFifoList(){
|
||||||
src = head;
|
src = this->head;
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
typename DLFifoList<T>::Head & src;
|
typename DLFifoList<T>::Head & src;
|
||||||
|
@ -169,11 +169,11 @@ public:
|
|||||||
LocalDLList(ArrayPool<T> & thePool, typename DLList<T>::Head & _src)
|
LocalDLList(ArrayPool<T> & thePool, typename DLList<T>::Head & _src)
|
||||||
: DLList<T>(thePool), src(_src)
|
: DLList<T>(thePool), src(_src)
|
||||||
{
|
{
|
||||||
head = src;
|
this->head = src;
|
||||||
}
|
}
|
||||||
|
|
||||||
~LocalDLList(){
|
~LocalDLList(){
|
||||||
src = head;
|
src = this->head;
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
typename DLList<T>::Head & src;
|
typename DLList<T>::Head & src;
|
||||||
|
@ -174,11 +174,11 @@ public:
|
|||||||
typename DataBuffer<sz>::Head & _src)
|
typename DataBuffer<sz>::Head & _src)
|
||||||
: DataBuffer<sz>(thePool), src(_src)
|
: DataBuffer<sz>(thePool), src(_src)
|
||||||
{
|
{
|
||||||
head = src;
|
this->head = src;
|
||||||
}
|
}
|
||||||
|
|
||||||
~LocalDataBuffer(){
|
~LocalDataBuffer(){
|
||||||
src = head;
|
src = this->head;
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
typename DataBuffer<sz>::Head & src;
|
typename DataBuffer<sz>::Head & src;
|
||||||
|
@ -137,11 +137,11 @@ public:
|
|||||||
LocalSLList(ArrayPool<T> & thePool, typename SLList<T>::Head & _src)
|
LocalSLList(ArrayPool<T> & thePool, typename SLList<T>::Head & _src)
|
||||||
: SLList<T>(thePool), src(_src)
|
: SLList<T>(thePool), src(_src)
|
||||||
{
|
{
|
||||||
head = src;
|
this->head = src;
|
||||||
}
|
}
|
||||||
|
|
||||||
~LocalSLList(){
|
~LocalSLList(){
|
||||||
src = head;
|
src = this->head;
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
typename SLList<T>::Head & src;
|
typename SLList<T>::Head & src;
|
||||||
|
@ -1417,7 +1417,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
|
|||||||
s = SimpleProperties::pack(w,
|
s = SimpleProperties::pack(w,
|
||||||
&tmpAttr,
|
&tmpAttr,
|
||||||
DictTabInfo::AttributeMapping,
|
DictTabInfo::AttributeMapping,
|
||||||
DictTabInfo::TableMappingSize, true);
|
DictTabInfo::AttributeMappingSize, true);
|
||||||
w.add(DictTabInfo::AttributeEnd, 1);
|
w.add(DictTabInfo::AttributeEnd, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,8 +17,24 @@ bindir=""
|
|||||||
|
|
||||||
file=mysql_fix_privilege_tables.sql
|
file=mysql_fix_privilege_tables.sql
|
||||||
|
|
||||||
|
# The following test is to make this script compatible with the 4.0 where
|
||||||
|
# the single argument could be a password
|
||||||
|
if test "$#" = 1
|
||||||
|
then
|
||||||
|
case "$1" in
|
||||||
|
--*) ;;
|
||||||
|
*) old_style_password="$1" ; shift ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
# The following code is almost identical to the code in mysql_install_db.sh
|
# The following code is almost identical to the code in mysql_install_db.sh
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
--no-defaults|--defaults-file=*|--defaults-extra-file=*)
|
||||||
|
defaults="$1"; shift
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
parse_arguments() {
|
parse_arguments() {
|
||||||
# We only need to pass arguments through to the server if we don't
|
# We only need to pass arguments through to the server if we don't
|
||||||
# handle them here. So, we collect unrecognized options (passed on
|
# handle them here. So, we collect unrecognized options (passed on
|
||||||
@ -47,7 +63,7 @@ parse_arguments() {
|
|||||||
then
|
then
|
||||||
# This sed command makes sure that any special chars are quoted,
|
# This sed command makes sure that any special chars are quoted,
|
||||||
# so the arg gets passed exactly to the server.
|
# so the arg gets passed exactly to the server.
|
||||||
args="$args "`echo "$arg" | sed -e 's,\([^a-zA-Z0-9_.-]\),\\\\\1,g'`
|
args="$args "`echo "$arg" | sed -e 's,\([^=a-zA-Z0-9_.-]\),\\\\\1,g'`
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@ -94,11 +110,9 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# The following test is to make this script compatible with the 4.0 where
|
|
||||||
# the first argument was the password
|
|
||||||
if test -z "$password"
|
if test -z "$password"
|
||||||
then
|
then
|
||||||
password=`echo $args | sed -e 's/ *//g'`
|
password=$old_style_password
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cmd="$bindir/mysql -f --user=$user --host=$host"
|
cmd="$bindir/mysql -f --user=$user --host=$host"
|
||||||
|
@ -8,6 +8,7 @@ use File::Path;
|
|||||||
use DBI;
|
use DBI;
|
||||||
use Sys::Hostname;
|
use Sys::Hostname;
|
||||||
use File::Copy;
|
use File::Copy;
|
||||||
|
use File::Temp;
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
@ -626,7 +627,6 @@ sub copy_files {
|
|||||||
sub copy_index
|
sub copy_index
|
||||||
{
|
{
|
||||||
my ($method, $files, $source, $target) = @_;
|
my ($method, $files, $source, $target) = @_;
|
||||||
my $tmpfile="$opt_tmpdir/mysqlhotcopy$$";
|
|
||||||
|
|
||||||
print "Copying indices for ".@$files." files...\n" unless $opt{quiet};
|
print "Copying indices for ".@$files." files...\n" unless $opt{quiet};
|
||||||
foreach my $file (@$files)
|
foreach my $file (@$files)
|
||||||
@ -652,23 +652,23 @@ sub copy_index
|
|||||||
}
|
}
|
||||||
close OUTPUT || die "Error on close of $to: $!\n";
|
close OUTPUT || die "Error on close of $to: $!\n";
|
||||||
}
|
}
|
||||||
elsif ($opt{method} eq 'scp')
|
elsif ($opt{method} =~ /^scp\b/)
|
||||||
{
|
{
|
||||||
my $tmp=$tmpfile;
|
my ($fh, $tmp)=tempfile('mysqlhotcopy-XXXXXX', DIR => $opt_tmpdir);
|
||||||
open(OUTPUT,">$tmp") || die "Can\'t create file $tmp: $!\n";
|
die "Can\'t create/open file in $opt_tmpdir\n";
|
||||||
if (syswrite(OUTPUT,$buff) != length($buff))
|
if (syswrite($fh,$buff) != length($buff))
|
||||||
{
|
{
|
||||||
die "Error when writing data to $tmp: $!\n";
|
die "Error when writing data to $tmp: $!\n";
|
||||||
}
|
}
|
||||||
close OUTPUT || die "Error on close of $tmp: $!\n";
|
close $fh || die "Error on close of $tmp: $!\n";
|
||||||
safe_system("scp $tmp $to");
|
safe_system("$opt{method} $tmp $to");
|
||||||
|
unlink $tmp;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
die "Can't use unsupported method '$opt{method}'\n";
|
die "Can't use unsupported method '$opt{method}'\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unlink "$tmpfile" if ($opt{method} eq 'scp');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -188,9 +188,9 @@ static int free_share(ARCHIVE_SHARE *share)
|
|||||||
hash_delete(&archive_open_tables, (byte*) share);
|
hash_delete(&archive_open_tables, (byte*) share);
|
||||||
thr_lock_delete(&share->lock);
|
thr_lock_delete(&share->lock);
|
||||||
pthread_mutex_destroy(&share->mutex);
|
pthread_mutex_destroy(&share->mutex);
|
||||||
my_free((gptr) share, MYF(0));
|
|
||||||
if (gzclose(share->archive_write) == Z_ERRNO)
|
if (gzclose(share->archive_write) == Z_ERRNO)
|
||||||
rc= -1;
|
rc= -1;
|
||||||
|
my_free((gptr) share, MYF(0));
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&archive_mutex);
|
pthread_mutex_unlock(&archive_mutex);
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ public:
|
|||||||
return (HA_REC_NOT_IN_SEQ | HA_NOT_EXACT_COUNT | HA_NO_AUTO_INCREMENT |
|
return (HA_REC_NOT_IN_SEQ | HA_NOT_EXACT_COUNT | HA_NO_AUTO_INCREMENT |
|
||||||
HA_FILE_BASED);
|
HA_FILE_BASED);
|
||||||
}
|
}
|
||||||
ulong index_flags(uint idx, uint part) const
|
ulong index_flags(uint idx, uint part, bool all_parts) const
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -69,12 +69,16 @@ public:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
This is a list of flags that says how the storage engine
|
This is a bitmap of flags that says how the storage engine
|
||||||
implements indexes. The current index flags are documented in
|
implements indexes. The current index flags are documented in
|
||||||
handler.h. If you do not implement indexes, just return zero
|
handler.h. If you do not implement indexes, just return zero
|
||||||
here.
|
here.
|
||||||
|
|
||||||
|
part is the key part to check. First key part is 0
|
||||||
|
If all_parts it's set, MySQL want to know the flags for the combined
|
||||||
|
index up to and including 'part'.
|
||||||
*/
|
*/
|
||||||
ulong index_flags(uint inx, uint part) const
|
ulong index_flags(uint inx, uint part, bool all_parts) const
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -431,9 +431,9 @@ void Field::store_time(TIME *ltime,timestamp_type type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Field::optimize_range(uint idx)
|
bool Field::optimize_range(uint idx, uint part)
|
||||||
{
|
{
|
||||||
return test(table->file->index_flags(idx) & HA_READ_RANGE);
|
return test(table->file->index_flags(idx, part, 1) & HA_READ_RANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -178,7 +178,7 @@ public:
|
|||||||
inline bool real_maybe_null(void) { return null_ptr != 0; }
|
inline bool real_maybe_null(void) { return null_ptr != 0; }
|
||||||
virtual void make_field(Send_field *)=0;
|
virtual void make_field(Send_field *)=0;
|
||||||
virtual void sort_string(char *buff,uint length)=0;
|
virtual void sort_string(char *buff,uint length)=0;
|
||||||
virtual bool optimize_range(uint idx);
|
virtual bool optimize_range(uint idx, uint part);
|
||||||
virtual bool store_for_compare() { return 0; }
|
virtual bool store_for_compare() { return 0; }
|
||||||
virtual void free() {}
|
virtual void free() {}
|
||||||
Field *new_field(MEM_ROOT *root, struct st_table *new_table)
|
Field *new_field(MEM_ROOT *root, struct st_table *new_table)
|
||||||
@ -1134,7 +1134,7 @@ public:
|
|||||||
uint size_of() const { return sizeof(*this); }
|
uint size_of() const { return sizeof(*this); }
|
||||||
enum_field_types real_type() const { return FIELD_TYPE_ENUM; }
|
enum_field_types real_type() const { return FIELD_TYPE_ENUM; }
|
||||||
virtual bool zero_pack() const { return 0; }
|
virtual bool zero_pack() const { return 0; }
|
||||||
bool optimize_range(uint idx) { return 0; }
|
bool optimize_range(uint idx, uint part) { return 0; }
|
||||||
bool eq_def(Field *field);
|
bool eq_def(Field *field);
|
||||||
bool has_charset(void) const { return TRUE; }
|
bool has_charset(void) const { return TRUE; }
|
||||||
field_cast_enum field_cast_type() { return FIELD_CAST_ENUM; }
|
field_cast_enum field_cast_type() { return FIELD_CAST_ENUM; }
|
||||||
|
@ -340,6 +340,35 @@ const char **ha_berkeley::bas_ext() const
|
|||||||
{ static const char *ext[]= { ha_berkeley_ext, NullS }; return ext; }
|
{ static const char *ext[]= { ha_berkeley_ext, NullS }; return ext; }
|
||||||
|
|
||||||
|
|
||||||
|
ulong ha_berkeley::index_flags(uint idx, uint part, bool all_parts) const
|
||||||
|
{
|
||||||
|
ulong flags= (HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | HA_KEYREAD_ONLY
|
||||||
|
| HA_READ_RANGE);
|
||||||
|
for (uint i= all_parts ? 0 : part ; i <= part ; i++)
|
||||||
|
{
|
||||||
|
if (table->key_info[idx].key_part[i].field->type() == FIELD_TYPE_BLOB)
|
||||||
|
{
|
||||||
|
/* We can't use BLOBS to shortcut sorts */
|
||||||
|
flags&= ~(HA_READ_ORDER | HA_KEYREAD_ONLY | HA_READ_RANGE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
switch (table->key_info[idx].key_part[i].field->key_type()) {
|
||||||
|
case HA_KEYTYPE_TEXT:
|
||||||
|
case HA_KEYTYPE_VARTEXT:
|
||||||
|
/*
|
||||||
|
As BDB stores only one copy of equal strings, we can't use key read
|
||||||
|
on these
|
||||||
|
*/
|
||||||
|
flags&= ~HA_KEYREAD_ONLY;
|
||||||
|
break;
|
||||||
|
default: // Keep compiler happy
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return flags;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
berkeley_cmp_hidden_key(DB* file, const DBT *new_key, const DBT *saved_key)
|
berkeley_cmp_hidden_key(DB* file, const DBT *new_key, const DBT *saved_key)
|
||||||
{
|
{
|
||||||
|
@ -94,14 +94,7 @@ class ha_berkeley: public handler
|
|||||||
changed_rows(0),last_dup_key((uint) -1),version(0),using_ignore(0) {}
|
changed_rows(0),last_dup_key((uint) -1),version(0),using_ignore(0) {}
|
||||||
~ha_berkeley() {}
|
~ha_berkeley() {}
|
||||||
const char *table_type() const { return "BerkeleyDB"; }
|
const char *table_type() const { return "BerkeleyDB"; }
|
||||||
ulong index_flags(uint idx, uint part) const
|
ulong index_flags(uint idx, uint part, bool all_parts) const;
|
||||||
{
|
|
||||||
ulong flags=HA_READ_NEXT | HA_READ_PREV;
|
|
||||||
if (part == (uint)~0 ||
|
|
||||||
table->key_info[idx].key_part[part].field->key_type() != HA_KEYTYPE_TEXT)
|
|
||||||
flags|= HA_READ_ORDER | HA_KEYREAD_ONLY | HA_READ_RANGE;
|
|
||||||
return flags;
|
|
||||||
}
|
|
||||||
const char *index_type(uint key_number) { return "BTREE"; }
|
const char *index_type(uint key_number) { return "BTREE"; }
|
||||||
const char **bas_ext() const;
|
const char **bas_ext() const;
|
||||||
ulong table_flags(void) const { return int_table_flags; }
|
ulong table_flags(void) const { return int_table_flags; }
|
||||||
|
@ -44,7 +44,7 @@ class ha_heap: public handler
|
|||||||
HA_REC_NOT_IN_SEQ | HA_READ_RND_SAME |
|
HA_REC_NOT_IN_SEQ | HA_READ_RND_SAME |
|
||||||
HA_CAN_INSERT_DELAYED);
|
HA_CAN_INSERT_DELAYED);
|
||||||
}
|
}
|
||||||
ulong index_flags(uint inx, uint part) const
|
ulong index_flags(uint inx, uint part, bool all_parts) const
|
||||||
{
|
{
|
||||||
return ((table->key_info[inx].algorithm == HA_KEY_ALG_BTREE) ?
|
return ((table->key_info[inx].algorithm == HA_KEY_ALG_BTREE) ?
|
||||||
HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | HA_READ_RANGE :
|
HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | HA_READ_RANGE :
|
||||||
|
@ -94,7 +94,7 @@ class ha_innobase: public handler
|
|||||||
const char *index_type(uint key_number) { return "BTREE"; }
|
const char *index_type(uint key_number) { return "BTREE"; }
|
||||||
const char** bas_ext() const;
|
const char** bas_ext() const;
|
||||||
ulong table_flags() const { return int_table_flags; }
|
ulong table_flags() const { return int_table_flags; }
|
||||||
ulong index_flags(uint idx, uint part) const
|
ulong index_flags(uint idx, uint part, bool all_parts) const
|
||||||
{
|
{
|
||||||
return (HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | HA_READ_RANGE |
|
return (HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | HA_READ_RANGE |
|
||||||
HA_KEYREAD_ONLY);
|
HA_KEYREAD_ONLY);
|
||||||
|
@ -36,7 +36,7 @@ class ha_isam: public handler
|
|||||||
HA_DUPP_POS | HA_NOT_DELETE_WITH_CACHE | HA_FILE_BASED)
|
HA_DUPP_POS | HA_NOT_DELETE_WITH_CACHE | HA_FILE_BASED)
|
||||||
{}
|
{}
|
||||||
~ha_isam() {}
|
~ha_isam() {}
|
||||||
ulong index_flags(uint idx, uint part) const
|
ulong index_flags(uint idx, uint part, bool all_parts) const
|
||||||
{ return HA_READ_NEXT; } // but no HA_READ_PREV here!!!
|
{ return HA_READ_NEXT; } // but no HA_READ_PREV here!!!
|
||||||
const char *table_type() const { return "ISAM"; }
|
const char *table_type() const { return "ISAM"; }
|
||||||
const char *index_type(uint key_number) { return "BTREE"; }
|
const char *index_type(uint key_number) { return "BTREE"; }
|
||||||
|
@ -34,7 +34,8 @@ class ha_isammrg: public handler
|
|||||||
const char **bas_ext() const;
|
const char **bas_ext() const;
|
||||||
ulong table_flags() const { return (HA_READ_RND_SAME |
|
ulong table_flags() const { return (HA_READ_RND_SAME |
|
||||||
HA_REC_NOT_IN_SEQ | HA_FILE_BASED); }
|
HA_REC_NOT_IN_SEQ | HA_FILE_BASED); }
|
||||||
ulong index_flags(uint idx, uint part) const { DBUG_ASSERT(0); return 0; }
|
ulong index_flags(uint idx, uint part, bool all_parts) const
|
||||||
|
{ DBUG_ASSERT(0); return 0; }
|
||||||
|
|
||||||
uint max_supported_keys() const { return 0; }
|
uint max_supported_keys() const { return 0; }
|
||||||
bool low_byte_first() const { return 0; }
|
bool low_byte_first() const { return 0; }
|
||||||
|
@ -55,7 +55,7 @@ class ha_myisam: public handler
|
|||||||
const char *index_type(uint key_number);
|
const char *index_type(uint key_number);
|
||||||
const char **bas_ext() const;
|
const char **bas_ext() const;
|
||||||
ulong table_flags() const { return int_table_flags; }
|
ulong table_flags() const { return int_table_flags; }
|
||||||
ulong index_flags(uint inx, uint part) const
|
ulong index_flags(uint inx, uint part, bool all_parts) const
|
||||||
{
|
{
|
||||||
return ((table->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ?
|
return ((table->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ?
|
||||||
0 : HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE |
|
0 : HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE |
|
||||||
|
@ -38,7 +38,7 @@ class ha_myisammrg: public handler
|
|||||||
HA_NULL_IN_KEY | HA_CAN_INDEX_BLOBS | HA_FILE_BASED |
|
HA_NULL_IN_KEY | HA_CAN_INDEX_BLOBS | HA_FILE_BASED |
|
||||||
HA_CAN_INSERT_DELAYED);
|
HA_CAN_INSERT_DELAYED);
|
||||||
}
|
}
|
||||||
ulong index_flags(uint inx, uint part) const
|
ulong index_flags(uint inx, uint part, bool all_parts) const
|
||||||
{
|
{
|
||||||
return ((table->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ?
|
return ((table->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ?
|
||||||
0 : HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE |
|
0 : HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE |
|
||||||
|
@ -524,7 +524,8 @@ inline NDB_INDEX_TYPE ha_ndbcluster::get_index_type(uint idx_no) const
|
|||||||
flags depending on the type of the index.
|
flags depending on the type of the index.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
inline ulong ha_ndbcluster::index_flags(uint idx_no, uint part) const
|
inline ulong ha_ndbcluster::index_flags(uint idx_no, uint part,
|
||||||
|
bool all_parts) const
|
||||||
{
|
{
|
||||||
DBUG_ENTER("index_flags");
|
DBUG_ENTER("index_flags");
|
||||||
DBUG_PRINT("info", ("idx_no: %d", idx_no));
|
DBUG_PRINT("info", ("idx_no: %d", idx_no));
|
||||||
|
@ -93,7 +93,7 @@ class ha_ndbcluster: public handler
|
|||||||
const char * table_type() const { return("ndbcluster");}
|
const char * table_type() const { return("ndbcluster");}
|
||||||
const char ** bas_ext() const;
|
const char ** bas_ext() const;
|
||||||
ulong table_flags(void) const { return m_table_flags; }
|
ulong table_flags(void) const { return m_table_flags; }
|
||||||
ulong index_flags(uint idx, uint part) const;
|
ulong index_flags(uint idx, uint part, bool all_parts) const;
|
||||||
uint max_supported_record_length() const { return NDB_MAX_TUPLE_SIZE; };
|
uint max_supported_record_length() const { return NDB_MAX_TUPLE_SIZE; };
|
||||||
uint max_supported_keys() const { return MAX_KEY; }
|
uint max_supported_keys() const { return MAX_KEY; }
|
||||||
uint max_supported_key_parts() const
|
uint max_supported_key_parts() const
|
||||||
|
@ -449,7 +449,7 @@ public:
|
|||||||
virtual const char *table_type() const =0;
|
virtual const char *table_type() const =0;
|
||||||
virtual const char **bas_ext() const =0;
|
virtual const char **bas_ext() const =0;
|
||||||
virtual ulong table_flags(void) const =0;
|
virtual ulong table_flags(void) const =0;
|
||||||
virtual ulong index_flags(uint idx, uint part=~0) const =0;
|
virtual ulong index_flags(uint idx, uint part, bool all_parts) const =0;
|
||||||
virtual ulong index_ddl_flags(KEY *wanted_index) const
|
virtual ulong index_ddl_flags(KEY *wanted_index) const
|
||||||
{ return (HA_DDL_SUPPORT); }
|
{ return (HA_DDL_SUPPORT); }
|
||||||
virtual int add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys)
|
virtual int add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys)
|
||||||
|
@ -483,6 +483,13 @@ bool Item_in_optimizer::fix_left(THD *thd,
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
cache->setup(args[0]);
|
cache->setup(args[0]);
|
||||||
|
/*
|
||||||
|
If it is preparation PS only then we do not know values of parameters =>
|
||||||
|
cant't get there values and do not need that values.
|
||||||
|
|
||||||
|
TODO: during merge with 5.0 it should be changed on !thd->only_prepare()
|
||||||
|
*/
|
||||||
|
if (!thd->current_statement)
|
||||||
cache->store(args[0]);
|
cache->store(args[0]);
|
||||||
if (cache->cols() == 1)
|
if (cache->cols() == 1)
|
||||||
{
|
{
|
||||||
|
@ -313,12 +313,12 @@ err:
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Functions to concatinate various spatial objects
|
Functions to concatenate various spatial objects
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Concatinate doubles into Point
|
* Concatenate doubles into Point
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@ -343,7 +343,7 @@ String *Item_func_point::val_str(String *str)
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Concatinates various items into various collections
|
Concatenates various items into various collections
|
||||||
with checkings for valid wkb type of items.
|
with checkings for valid wkb type of items.
|
||||||
For example, MultiPoint can be a collection of Points only.
|
For example, MultiPoint can be a collection of Points only.
|
||||||
coll_type contains wkb type of target collection.
|
coll_type contains wkb type of target collection.
|
||||||
@ -388,7 +388,7 @@ String *Item_func_spatial_collection::val_str(String *str)
|
|||||||
const char *data= res->ptr() + 1;
|
const char *data= res->ptr() + 1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
In the case of named collection we must to check that items
|
In the case of named collection we must check that items
|
||||||
are of specific type, let's do this checking now
|
are of specific type, let's do this checking now
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -2294,40 +2294,49 @@ inline int hexchar_to_int(char c)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Convert given hex string to a binary string */
|
||||||
|
|
||||||
String *Item_func_unhex::val_str(String *str)
|
String *Item_func_unhex::val_str(String *str)
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(fixed == 1);
|
const char *from, *end;
|
||||||
/* Convert given hex string to a binary string */
|
|
||||||
String *res= args[0]->val_str(str);
|
|
||||||
const char *from=res->ptr(), *end;
|
|
||||||
char *to;
|
char *to;
|
||||||
int r;
|
String *res;
|
||||||
if (!res || tmp_value.alloc((1+res->length())/2))
|
uint length;
|
||||||
|
DBUG_ASSERT(fixed == 1);
|
||||||
|
|
||||||
|
res= args[0]->val_str(str);
|
||||||
|
if (!res || tmp_value.alloc(length= (1+res->length())/2))
|
||||||
{
|
{
|
||||||
null_value=1;
|
null_value=1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
from= res->ptr();
|
||||||
null_value= 0;
|
null_value= 0;
|
||||||
tmp_value.length((1+res->length())/2);
|
tmp_value.length(length);
|
||||||
to= (char*) tmp_value.ptr();
|
to= (char*) tmp_value.ptr();
|
||||||
if (res->length() % 2)
|
if (res->length() % 2)
|
||||||
{
|
{
|
||||||
*to++= r= hexchar_to_int(*from++);
|
int hex_char;
|
||||||
if ((null_value= (r == -1)))
|
*to++= hex_char= hexchar_to_int(*from++);
|
||||||
|
if ((null_value= (hex_char == -1)))
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
for (end=res->ptr()+res->length(); from < end ; from+=2, to++)
|
for (end=res->ptr()+res->length(); from < end ; from+=2, to++)
|
||||||
{
|
{
|
||||||
*to= (r= hexchar_to_int(from[0])) << 4;
|
int hex_char;
|
||||||
if ((null_value= (r == -1)))
|
*to= (hex_char= hexchar_to_int(from[0])) << 4;
|
||||||
|
if ((null_value= (hex_char == -1)))
|
||||||
return 0;
|
return 0;
|
||||||
*to|= r= hexchar_to_int(from[1]);
|
*to|= hex_char= hexchar_to_int(from[1]);
|
||||||
if ((null_value= (r == -1)))
|
if ((null_value= (hex_char == -1)))
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return &tmp_value;
|
return &tmp_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Item_func_binary::print(String *str)
|
void Item_func_binary::print(String *str)
|
||||||
{
|
{
|
||||||
str->append("cast(", 5);
|
str->append("cast(", 5);
|
||||||
|
@ -2108,10 +2108,8 @@ bool flush_error_log()
|
|||||||
bool MYSQL_LOG::cut_spurious_tail()
|
bool MYSQL_LOG::cut_spurious_tail()
|
||||||
{
|
{
|
||||||
int error= 0;
|
int error= 0;
|
||||||
char llbuf1[22], llbuf2[22];
|
|
||||||
ulonglong actual_size;
|
|
||||||
|
|
||||||
DBUG_ENTER("cut_spurious_tail");
|
DBUG_ENTER("cut_spurious_tail");
|
||||||
|
|
||||||
#ifdef HAVE_INNOBASE_DB
|
#ifdef HAVE_INNOBASE_DB
|
||||||
if (have_innodb != SHOW_OPTION_YES)
|
if (have_innodb != SHOW_OPTION_YES)
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
@ -2121,6 +2119,9 @@ bool MYSQL_LOG::cut_spurious_tail()
|
|||||||
*/
|
*/
|
||||||
char *name= ha_innobase::get_mysql_bin_log_name();
|
char *name= ha_innobase::get_mysql_bin_log_name();
|
||||||
ulonglong pos= ha_innobase::get_mysql_bin_log_pos();
|
ulonglong pos= ha_innobase::get_mysql_bin_log_pos();
|
||||||
|
ulonglong actual_size;
|
||||||
|
char llbuf1[22], llbuf2[22];
|
||||||
|
|
||||||
if (name[0] == 0 || pos == ULONGLONG_MAX)
|
if (name[0] == 0 || pos == ULONGLONG_MAX)
|
||||||
{
|
{
|
||||||
DBUG_PRINT("info", ("InnoDB has not set binlog info"));
|
DBUG_PRINT("info", ("InnoDB has not set binlog info"));
|
||||||
|
@ -2422,9 +2422,9 @@ void Load_log_event::set_fields(List<Item> &field_list)
|
|||||||
int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli,
|
int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli,
|
||||||
bool use_rli_only_for_errors)
|
bool use_rli_only_for_errors)
|
||||||
{
|
{
|
||||||
|
char *load_data_query= 0;
|
||||||
thd->db= (char*) rewrite_db(db);
|
thd->db= (char*) rewrite_db(db);
|
||||||
DBUG_ASSERT(thd->query == 0);
|
DBUG_ASSERT(thd->query == 0);
|
||||||
thd->query= 0; // Should not be needed
|
|
||||||
thd->query_length= 0; // Should not be needed
|
thd->query_length= 0; // Should not be needed
|
||||||
thd->query_error= 0;
|
thd->query_error= 0;
|
||||||
clear_all_errors(thd, rli);
|
clear_all_errors(thd, rli);
|
||||||
@ -2476,6 +2476,19 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli,
|
|||||||
{
|
{
|
||||||
char llbuff[22];
|
char llbuff[22];
|
||||||
enum enum_duplicates handle_dup;
|
enum enum_duplicates handle_dup;
|
||||||
|
/*
|
||||||
|
Make a simplified LOAD DATA INFILE query, for the information of the
|
||||||
|
user in SHOW PROCESSLIST. Note that db is known in the 'db' column.
|
||||||
|
*/
|
||||||
|
if ((load_data_query= (char *) my_alloca(18 + strlen(fname) + 14 +
|
||||||
|
strlen(tables.real_name) + 8)))
|
||||||
|
{
|
||||||
|
thd->query_length= (uint)(strxmov(load_data_query,
|
||||||
|
"LOAD DATA INFILE '", fname,
|
||||||
|
"' INTO TABLE `", tables.real_name,
|
||||||
|
"` <...>", NullS) - load_data_query);
|
||||||
|
thd->query= load_data_query;
|
||||||
|
}
|
||||||
if (sql_ex.opt_flags & REPLACE_FLAG)
|
if (sql_ex.opt_flags & REPLACE_FLAG)
|
||||||
handle_dup= DUP_REPLACE;
|
handle_dup= DUP_REPLACE;
|
||||||
else if (sql_ex.opt_flags & IGNORE_FLAG)
|
else if (sql_ex.opt_flags & IGNORE_FLAG)
|
||||||
@ -2557,9 +2570,14 @@ Slave: load data infile on table '%s' at log position %s in log \
|
|||||||
}
|
}
|
||||||
|
|
||||||
thd->net.vio = 0;
|
thd->net.vio = 0;
|
||||||
/* Same reason as in Query_log_event::exec_event() */
|
VOID(pthread_mutex_lock(&LOCK_thread_count));
|
||||||
thd->db= thd->catalog= 0;
|
thd->db= thd->catalog= 0;
|
||||||
|
thd->query= 0;
|
||||||
|
thd->query_length= 0;
|
||||||
|
VOID(pthread_mutex_unlock(&LOCK_thread_count));
|
||||||
close_thread_tables(thd);
|
close_thread_tables(thd);
|
||||||
|
if (load_data_query)
|
||||||
|
my_afree(load_data_query);
|
||||||
if (thd->query_error)
|
if (thd->query_error)
|
||||||
{
|
{
|
||||||
/* this err/sql_errno code is copy-paste from send_error() */
|
/* this err/sql_errno code is copy-paste from send_error() */
|
||||||
@ -3114,17 +3132,18 @@ void User_var_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* las
|
|||||||
> the string constant is still unescaped according to SJIS, not
|
> the string constant is still unescaped according to SJIS, not
|
||||||
> according to UCS2.
|
> according to UCS2.
|
||||||
*/
|
*/
|
||||||
char *p, *q;
|
char *hex_str;
|
||||||
if (!(p= (char *)my_alloca(2*val_len+1+2))) // 2 hex digits per byte
|
CHARSET_INFO *cs;
|
||||||
|
|
||||||
|
if (!(hex_str= (char *)my_alloca(2*val_len+1+2))) // 2 hex digits / byte
|
||||||
break; // no error, as we are 'void'
|
break; // no error, as we are 'void'
|
||||||
str_to_hex(p, val, val_len);
|
str_to_hex(hex_str, val, val_len);
|
||||||
/*
|
/*
|
||||||
For proper behaviour when mysqlbinlog|mysql, we need to explicitely
|
For proper behaviour when mysqlbinlog|mysql, we need to explicitely
|
||||||
specify the variable's collation. It will however cause problems when
|
specify the variable's collation. It will however cause problems when
|
||||||
people want to mysqlbinlog|mysql into another server not supporting the
|
people want to mysqlbinlog|mysql into another server not supporting the
|
||||||
character set. But there's not much to do about this and it's unlikely.
|
character set. But there's not much to do about this and it's unlikely.
|
||||||
*/
|
*/
|
||||||
CHARSET_INFO *cs;
|
|
||||||
if (!(cs= get_charset(charset_number, MYF(0))))
|
if (!(cs= get_charset(charset_number, MYF(0))))
|
||||||
/*
|
/*
|
||||||
Generate an unusable command (=> syntax error) is probably the best
|
Generate an unusable command (=> syntax error) is probably the best
|
||||||
@ -3132,8 +3151,8 @@ void User_var_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* las
|
|||||||
*/
|
*/
|
||||||
fprintf(file, ":=???;\n");
|
fprintf(file, ":=???;\n");
|
||||||
else
|
else
|
||||||
fprintf(file, ":=_%s %s COLLATE %s;\n", cs->csname, p, cs->name);
|
fprintf(file, ":=_%s %s COLLATE %s;\n", cs->csname, hex_str, cs->name);
|
||||||
my_afree(p);
|
my_afree(hex_str);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ROW_RESULT:
|
case ROW_RESULT:
|
||||||
@ -3601,7 +3620,7 @@ void Create_file_log_event::pack_info(Protocol *protocol)
|
|||||||
#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
|
#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
|
||||||
int Create_file_log_event::exec_event(struct st_relay_log_info* rli)
|
int Create_file_log_event::exec_event(struct st_relay_log_info* rli)
|
||||||
{
|
{
|
||||||
char fname_buf[FN_REFLEN+10];
|
char proc_info[17+FN_REFLEN+10], *fname_buf= proc_info+17;
|
||||||
char *p;
|
char *p;
|
||||||
int fd = -1;
|
int fd = -1;
|
||||||
IO_CACHE file;
|
IO_CACHE file;
|
||||||
@ -3610,6 +3629,8 @@ int Create_file_log_event::exec_event(struct st_relay_log_info* rli)
|
|||||||
bzero((char*)&file, sizeof(file));
|
bzero((char*)&file, sizeof(file));
|
||||||
p = slave_load_file_stem(fname_buf, file_id, server_id);
|
p = slave_load_file_stem(fname_buf, file_id, server_id);
|
||||||
strmov(p, ".info"); // strmov takes less code than memcpy
|
strmov(p, ".info"); // strmov takes less code than memcpy
|
||||||
|
strnmov(proc_info, "Making temp file ", 17); // no end 0
|
||||||
|
thd->proc_info= proc_info;
|
||||||
if ((fd = my_open(fname_buf, O_WRONLY|O_CREAT|O_BINARY|O_TRUNC,
|
if ((fd = my_open(fname_buf, O_WRONLY|O_CREAT|O_BINARY|O_TRUNC,
|
||||||
MYF(MY_WME))) < 0 ||
|
MYF(MY_WME))) < 0 ||
|
||||||
init_io_cache(&file, fd, IO_SIZE, WRITE_CACHE, (my_off_t)0, 0,
|
init_io_cache(&file, fd, IO_SIZE, WRITE_CACHE, (my_off_t)0, 0,
|
||||||
@ -3653,6 +3674,7 @@ err:
|
|||||||
end_io_cache(&file);
|
end_io_cache(&file);
|
||||||
if (fd >= 0)
|
if (fd >= 0)
|
||||||
my_close(fd, MYF(0));
|
my_close(fd, MYF(0));
|
||||||
|
thd->proc_info= 0;
|
||||||
return error ? 1 : Log_event::exec_event(rli);
|
return error ? 1 : Log_event::exec_event(rli);
|
||||||
}
|
}
|
||||||
#endif /* defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) */
|
#endif /* defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) */
|
||||||
@ -3755,13 +3777,15 @@ void Append_block_log_event::pack_info(Protocol *protocol)
|
|||||||
#if defined( HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
|
#if defined( HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
|
||||||
int Append_block_log_event::exec_event(struct st_relay_log_info* rli)
|
int Append_block_log_event::exec_event(struct st_relay_log_info* rli)
|
||||||
{
|
{
|
||||||
char fname[FN_REFLEN+10];
|
char proc_info[17+FN_REFLEN+10], *fname= proc_info+17;
|
||||||
char *p= slave_load_file_stem(fname, file_id, server_id);
|
char *p= slave_load_file_stem(fname, file_id, server_id);
|
||||||
int fd;
|
int fd;
|
||||||
int error = 1;
|
int error = 1;
|
||||||
DBUG_ENTER("Append_block_log_event::exec_event");
|
DBUG_ENTER("Append_block_log_event::exec_event");
|
||||||
|
|
||||||
memcpy(p, ".data", 6);
|
memcpy(p, ".data", 6);
|
||||||
|
strnmov(proc_info, "Making temp file ", 17); // no end 0
|
||||||
|
thd->proc_info= proc_info;
|
||||||
if ((fd = my_open(fname, O_WRONLY|O_APPEND|O_BINARY, MYF(MY_WME))) < 0)
|
if ((fd = my_open(fname, O_WRONLY|O_APPEND|O_BINARY, MYF(MY_WME))) < 0)
|
||||||
{
|
{
|
||||||
slave_print_error(rli,my_errno, "Error in Append_block event: could not open file '%s'", fname);
|
slave_print_error(rli,my_errno, "Error in Append_block event: could not open file '%s'", fname);
|
||||||
@ -3777,6 +3801,7 @@ int Append_block_log_event::exec_event(struct st_relay_log_info* rli)
|
|||||||
err:
|
err:
|
||||||
if (fd >= 0)
|
if (fd >= 0)
|
||||||
my_close(fd, MYF(0));
|
my_close(fd, MYF(0));
|
||||||
|
thd->proc_info= 0;
|
||||||
DBUG_RETURN(error ? error : Log_event::exec_event(rli));
|
DBUG_RETURN(error ? error : Log_event::exec_event(rli));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -675,6 +675,8 @@ int mysqld_show_variables(THD *thd,const char *wild);
|
|||||||
int mysqld_show(THD *thd, const char *wild, show_var_st *variables,
|
int mysqld_show(THD *thd, const char *wild, show_var_st *variables,
|
||||||
enum enum_var_type value_type,
|
enum enum_var_type value_type,
|
||||||
pthread_mutex_t *mutex);
|
pthread_mutex_t *mutex);
|
||||||
|
int mysql_find_files(THD *thd,List<char> *files, const char *db,
|
||||||
|
const char *path, const char *wild, bool dir);
|
||||||
int mysqld_show_charsets(THD *thd,const char *wild);
|
int mysqld_show_charsets(THD *thd,const char *wild);
|
||||||
int mysqld_show_collations(THD *thd,const char *wild);
|
int mysqld_show_collations(THD *thd,const char *wild);
|
||||||
int mysqld_show_storage_engines(THD *thd);
|
int mysqld_show_storage_engines(THD *thd);
|
||||||
@ -844,6 +846,9 @@ bool is_keyword(const char *name, uint len);
|
|||||||
|
|
||||||
#define MY_DB_OPT_FILE "db.opt"
|
#define MY_DB_OPT_FILE "db.opt"
|
||||||
bool load_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create);
|
bool load_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create);
|
||||||
|
bool my_dbopt_init(void);
|
||||||
|
void my_dbopt_cleanup(void);
|
||||||
|
void my_dbopt_free(void);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
External variables
|
External variables
|
||||||
|
@ -890,6 +890,7 @@ extern "C" void unireg_abort(int exit_code)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void clean_up(bool print_message)
|
void clean_up(bool print_message)
|
||||||
{
|
{
|
||||||
DBUG_PRINT("exit",("clean_up"));
|
DBUG_PRINT("exit",("clean_up"));
|
||||||
@ -905,6 +906,7 @@ void clean_up(bool print_message)
|
|||||||
bitmap_free(&slave_error_mask);
|
bitmap_free(&slave_error_mask);
|
||||||
#endif
|
#endif
|
||||||
my_tz_free();
|
my_tz_free();
|
||||||
|
my_dbopt_free();
|
||||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||||
acl_free(1);
|
acl_free(1);
|
||||||
grant_free();
|
grant_free();
|
||||||
@ -1303,6 +1305,19 @@ void yyerror(const char *s)
|
|||||||
|
|
||||||
|
|
||||||
#ifndef EMBEDDED_LIBRARY
|
#ifndef EMBEDDED_LIBRARY
|
||||||
|
/*
|
||||||
|
Close a connection
|
||||||
|
|
||||||
|
SYNOPSIS
|
||||||
|
close_connection()
|
||||||
|
thd Thread handle
|
||||||
|
errcode Error code to print to console
|
||||||
|
lock 1 if we have have to lock LOCK_thread_count
|
||||||
|
|
||||||
|
NOTES
|
||||||
|
For the connection that is doing shutdown, this is called twice
|
||||||
|
*/
|
||||||
|
|
||||||
void close_connection(THD *thd, uint errcode, bool lock)
|
void close_connection(THD *thd, uint errcode, bool lock)
|
||||||
{
|
{
|
||||||
st_vio *vio;
|
st_vio *vio;
|
||||||
@ -2282,7 +2297,6 @@ static int init_common_variables(const char *conf_file_name, int argc,
|
|||||||
*/
|
*/
|
||||||
global_system_variables.time_zone= my_tz_SYSTEM;
|
global_system_variables.time_zone= my_tz_SYSTEM;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Init mutexes for the global MYSQL_LOG objects.
|
Init mutexes for the global MYSQL_LOG objects.
|
||||||
As safe_mutex depends on what MY_INIT() does, we can't init the mutexes of
|
As safe_mutex depends on what MY_INIT() does, we can't init the mutexes of
|
||||||
@ -2388,6 +2402,9 @@ static int init_common_variables(const char *conf_file_name, int argc,
|
|||||||
|
|
||||||
if (use_temp_pool && bitmap_init(&temp_pool,0,1024,1))
|
if (use_temp_pool && bitmap_init(&temp_pool,0,1024,1))
|
||||||
return 1;
|
return 1;
|
||||||
|
if (my_dbopt_init())
|
||||||
|
return 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4755,26 +4772,26 @@ log and this option does nothing anymore.",
|
|||||||
"The size of the buffer used for index blocks for MyISAM tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford; 64M on a 256M machine that mainly runs MySQL is quite common.",
|
"The size of the buffer used for index blocks for MyISAM tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford; 64M on a 256M machine that mainly runs MySQL is quite common.",
|
||||||
(gptr*) &dflt_key_cache_var.param_buff_size,
|
(gptr*) &dflt_key_cache_var.param_buff_size,
|
||||||
(gptr*) 0,
|
(gptr*) 0,
|
||||||
0, (enum get_opt_var_type) (GET_ULL | GET_ASK_ADDR),
|
0, (GET_ULL | GET_ASK_ADDR),
|
||||||
REQUIRED_ARG, KEY_CACHE_SIZE, MALLOC_OVERHEAD, (long) ~0, MALLOC_OVERHEAD,
|
REQUIRED_ARG, KEY_CACHE_SIZE, MALLOC_OVERHEAD, (long) ~0, MALLOC_OVERHEAD,
|
||||||
IO_SIZE, 0},
|
IO_SIZE, 0},
|
||||||
{"key_cache_block_size", OPT_KEY_CACHE_BLOCK_SIZE,
|
{"key_cache_block_size", OPT_KEY_CACHE_BLOCK_SIZE,
|
||||||
"The default size of key cache blocks",
|
"The default size of key cache blocks",
|
||||||
(gptr*) &dflt_key_cache_var.param_block_size,
|
(gptr*) &dflt_key_cache_var.param_block_size,
|
||||||
(gptr*) 0,
|
(gptr*) 0,
|
||||||
0, (enum get_opt_var_type) (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG,
|
0, (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG,
|
||||||
KEY_CACHE_BLOCK_SIZE , 512, 1024*16, MALLOC_OVERHEAD, 512, 0},
|
KEY_CACHE_BLOCK_SIZE , 512, 1024*16, MALLOC_OVERHEAD, 512, 0},
|
||||||
{"key_cache_division_limit", OPT_KEY_CACHE_DIVISION_LIMIT,
|
{"key_cache_division_limit", OPT_KEY_CACHE_DIVISION_LIMIT,
|
||||||
"The minimum percentage of warm blocks in key cache",
|
"The minimum percentage of warm blocks in key cache",
|
||||||
(gptr*) &dflt_key_cache_var.param_division_limit,
|
(gptr*) &dflt_key_cache_var.param_division_limit,
|
||||||
(gptr*) 0,
|
(gptr*) 0,
|
||||||
0, (enum get_opt_var_type) (GET_ULONG | GET_ASK_ADDR) , REQUIRED_ARG, 100,
|
0, (GET_ULONG | GET_ASK_ADDR) , REQUIRED_ARG, 100,
|
||||||
1, 100, 0, 1, 0},
|
1, 100, 0, 1, 0},
|
||||||
{"key_cache_age_threshold", OPT_KEY_CACHE_AGE_THRESHOLD,
|
{"key_cache_age_threshold", OPT_KEY_CACHE_AGE_THRESHOLD,
|
||||||
"This characterizes the number of hits a hot block has to be untouched until it is considered aged enough to be downgraded to a warm block. This specifies the percentage ratio of that number of hits to the total number of blocks in key cache",
|
"This characterizes the number of hits a hot block has to be untouched until it is considered aged enough to be downgraded to a warm block. This specifies the percentage ratio of that number of hits to the total number of blocks in key cache",
|
||||||
(gptr*) &dflt_key_cache_var.param_age_threshold,
|
(gptr*) &dflt_key_cache_var.param_age_threshold,
|
||||||
(gptr*) 0,
|
(gptr*) 0,
|
||||||
0, (enum get_opt_var_type) (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG,
|
0, (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG,
|
||||||
300, 100, ~0L, 0, 100, 0},
|
300, 100, ~0L, 0, 100, 0},
|
||||||
{"long_query_time", OPT_LONG_QUERY_TIME,
|
{"long_query_time", OPT_LONG_QUERY_TIME,
|
||||||
"Log all queries that have taken more than long_query_time seconds to execute to file.",
|
"Log all queries that have taken more than long_query_time seconds to execute to file.",
|
||||||
|
193
sql/opt_range.cc
193
sql/opt_range.cc
@ -343,7 +343,7 @@ typedef struct st_qsel_param {
|
|||||||
uint *imerge_cost_buff; /* buffer for index_merge cost estimates */
|
uint *imerge_cost_buff; /* buffer for index_merge cost estimates */
|
||||||
uint imerge_cost_buff_size; /* size of the buffer */
|
uint imerge_cost_buff_size; /* size of the buffer */
|
||||||
|
|
||||||
/* true if last checked tree->key can be used for ROR-scan */
|
/* TRUE if last checked tree->key can be used for ROR-scan */
|
||||||
bool is_ror_scan;
|
bool is_ror_scan;
|
||||||
} PARAM;
|
} PARAM;
|
||||||
|
|
||||||
@ -585,7 +585,7 @@ inline void imerge_list_and_list(List<SEL_IMERGE> *im1, List<SEL_IMERGE> *im2)
|
|||||||
i.e. all conjuncts except the first one are currently dropped.
|
i.e. all conjuncts except the first one are currently dropped.
|
||||||
This is done to avoid producing N*K ways to do index_merge.
|
This is done to avoid producing N*K ways to do index_merge.
|
||||||
|
|
||||||
If (a_1||b_1) produce a condition that is always true, NULL is returned
|
If (a_1||b_1) produce a condition that is always TRUE, NULL is returned
|
||||||
and index_merge is discarded (while it is actually possible to try
|
and index_merge is discarded (while it is actually possible to try
|
||||||
harder).
|
harder).
|
||||||
|
|
||||||
@ -848,7 +848,7 @@ int QUICK_ROR_INTERSECT_SELECT::init()
|
|||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
QUICK_RANGE_SELECT::init_ror_merged_scan()
|
QUICK_RANGE_SELECT::init_ror_merged_scan()
|
||||||
reuse_handler If true, use head->file, otherwise create a separate
|
reuse_handler If TRUE, use head->file, otherwise create a separate
|
||||||
handler object
|
handler object
|
||||||
|
|
||||||
NOTES
|
NOTES
|
||||||
@ -906,7 +906,7 @@ int QUICK_RANGE_SELECT::init_ror_merged_scan(bool reuse_handler)
|
|||||||
file->close();
|
file->close();
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
free_file= true;
|
free_file= TRUE;
|
||||||
last_rowid= file->ref;
|
last_rowid= file->ref;
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
|
|
||||||
@ -920,7 +920,7 @@ failure:
|
|||||||
Initialize this quick select to be a part of a ROR-merged scan.
|
Initialize this quick select to be a part of a ROR-merged scan.
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
QUICK_ROR_INTERSECT_SELECT::init_ror_merged_scan()
|
QUICK_ROR_INTERSECT_SELECT::init_ror_merged_scan()
|
||||||
reuse_handler If true, use head->file, otherwise create separate
|
reuse_handler If TRUE, use head->file, otherwise create separate
|
||||||
handler object.
|
handler object.
|
||||||
RETURN
|
RETURN
|
||||||
0 OK
|
0 OK
|
||||||
@ -941,13 +941,13 @@ int QUICK_ROR_INTERSECT_SELECT::init_ror_merged_scan(bool reuse_handler)
|
|||||||
There is no use of this->file. Use it for the first of merged range
|
There is no use of this->file. Use it for the first of merged range
|
||||||
selects.
|
selects.
|
||||||
*/
|
*/
|
||||||
if (quick->init_ror_merged_scan(true))
|
if (quick->init_ror_merged_scan(TRUE))
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
quick->file->extra(HA_EXTRA_KEYREAD_PRESERVE_FIELDS);
|
quick->file->extra(HA_EXTRA_KEYREAD_PRESERVE_FIELDS);
|
||||||
}
|
}
|
||||||
while((quick= quick_it++))
|
while((quick= quick_it++))
|
||||||
{
|
{
|
||||||
if (quick->init_ror_merged_scan(false))
|
if (quick->init_ror_merged_scan(FALSE))
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
quick->file->extra(HA_EXTRA_KEYREAD_PRESERVE_FIELDS);
|
quick->file->extra(HA_EXTRA_KEYREAD_PRESERVE_FIELDS);
|
||||||
/* All merged scans share the same record buffer in intersection. */
|
/* All merged scans share the same record buffer in intersection. */
|
||||||
@ -976,7 +976,7 @@ int QUICK_ROR_INTERSECT_SELECT::reset()
|
|||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
DBUG_ENTER("QUICK_ROR_INTERSECT_SELECT::reset");
|
DBUG_ENTER("QUICK_ROR_INTERSECT_SELECT::reset");
|
||||||
result= init_ror_merged_scan(true);
|
result= init_ror_merged_scan(TRUE);
|
||||||
DBUG_RETURN(result);
|
DBUG_RETURN(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -992,8 +992,8 @@ int QUICK_ROR_INTERSECT_SELECT::reset()
|
|||||||
This call can only be made before init() is called.
|
This call can only be made before init() is called.
|
||||||
|
|
||||||
RETURN
|
RETURN
|
||||||
false OK
|
FALSE OK
|
||||||
true Out of memory.
|
TRUE Out of memory.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool
|
bool
|
||||||
@ -1037,7 +1037,7 @@ QUICK_ROR_UNION_SELECT::QUICK_ROR_UNION_SELECT(THD *thd_param,
|
|||||||
int QUICK_ROR_UNION_SELECT::init()
|
int QUICK_ROR_UNION_SELECT::init()
|
||||||
{
|
{
|
||||||
if (init_queue(&queue, quick_selects.elements, 0,
|
if (init_queue(&queue, quick_selects.elements, 0,
|
||||||
false , QUICK_ROR_UNION_SELECT::queue_cmp,
|
FALSE , QUICK_ROR_UNION_SELECT::queue_cmp,
|
||||||
(void*) this))
|
(void*) this))
|
||||||
{
|
{
|
||||||
bzero(&queue, sizeof(QUEUE));
|
bzero(&queue, sizeof(QUEUE));
|
||||||
@ -1084,7 +1084,7 @@ int QUICK_ROR_UNION_SELECT::reset()
|
|||||||
QUICK_SELECT_I* quick;
|
QUICK_SELECT_I* quick;
|
||||||
int error;
|
int error;
|
||||||
DBUG_ENTER("QUICK_ROR_UNION_SELECT::reset");
|
DBUG_ENTER("QUICK_ROR_UNION_SELECT::reset");
|
||||||
have_prev_rowid= false;
|
have_prev_rowid= FALSE;
|
||||||
/*
|
/*
|
||||||
Initialize scans for merged quick selects and put all merged quick
|
Initialize scans for merged quick selects and put all merged quick
|
||||||
selects into the queue.
|
selects into the queue.
|
||||||
@ -1092,7 +1092,7 @@ int QUICK_ROR_UNION_SELECT::reset()
|
|||||||
List_iterator_fast<QUICK_SELECT_I> it(quick_selects);
|
List_iterator_fast<QUICK_SELECT_I> it(quick_selects);
|
||||||
while ((quick= it++))
|
while ((quick= it++))
|
||||||
{
|
{
|
||||||
if (quick->init_ror_merged_scan(false))
|
if (quick->init_ror_merged_scan(FALSE))
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
if ((error= quick->get_next()))
|
if ((error= quick->get_next()))
|
||||||
{
|
{
|
||||||
@ -1310,7 +1310,7 @@ public:
|
|||||||
ha_rows records; /* estimate of #rows to be examined */
|
ha_rows records; /* estimate of #rows to be examined */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
If true, the scan returns rows in rowid order. This is used only for
|
If TRUE, the scan returns rows in rowid order. This is used only for
|
||||||
scans that can be both ROR and non-ROR.
|
scans that can be both ROR and non-ROR.
|
||||||
*/
|
*/
|
||||||
bool is_ror;
|
bool is_ror;
|
||||||
@ -1320,7 +1320,7 @@ public:
|
|||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
make_quick()
|
make_quick()
|
||||||
param Parameter from test_quick_select
|
param Parameter from test_quick_select
|
||||||
retrieve_full_rows If true, created quick select will do full record
|
retrieve_full_rows If TRUE, created quick select will do full record
|
||||||
retrieval.
|
retrieval.
|
||||||
parent_alloc Memory pool to use, if any.
|
parent_alloc Memory pool to use, if any.
|
||||||
|
|
||||||
@ -1390,7 +1390,7 @@ public:
|
|||||||
struct st_ror_scan_info **first_scan;
|
struct st_ror_scan_info **first_scan;
|
||||||
struct st_ror_scan_info **last_scan; /* End of the above array */
|
struct st_ror_scan_info **last_scan; /* End of the above array */
|
||||||
struct st_ror_scan_info *cpk_scan; /* Clustered PK scan, if there is one */
|
struct st_ror_scan_info *cpk_scan; /* Clustered PK scan, if there is one */
|
||||||
bool is_covering; /* true if no row retrieval phase is necessary */
|
bool is_covering; /* TRUE if no row retrieval phase is necessary */
|
||||||
double index_scan_costs; /* SUM(cost(index_scan)) */
|
double index_scan_costs; /* SUM(cost(index_scan)) */
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1449,7 +1449,7 @@ static int fill_used_fields_bitmap(PARAM *param)
|
|||||||
uint pk;
|
uint pk;
|
||||||
if (!(tmp= (uchar*)alloc_root(param->mem_root,param->fields_bitmap_size)) ||
|
if (!(tmp= (uchar*)alloc_root(param->mem_root,param->fields_bitmap_size)) ||
|
||||||
bitmap_init(¶m->needed_fields, tmp, param->fields_bitmap_size*8,
|
bitmap_init(¶m->needed_fields, tmp, param->fields_bitmap_size*8,
|
||||||
false))
|
FALSE))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
bitmap_clear_all(¶m->needed_fields);
|
bitmap_clear_all(¶m->needed_fields);
|
||||||
@ -1644,10 +1644,10 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
|
|||||||
{
|
{
|
||||||
double best_read_time= read_time;
|
double best_read_time= read_time;
|
||||||
TRP_ROR_INTERSECT *new_trp;
|
TRP_ROR_INTERSECT *new_trp;
|
||||||
bool can_build_covering= false;
|
bool can_build_covering= FALSE;
|
||||||
|
|
||||||
/* Get best 'range' plan and prepare data for making other plans */
|
/* Get best 'range' plan and prepare data for making other plans */
|
||||||
if ((best_trp= get_key_scans_params(¶m, tree, false,
|
if ((best_trp= get_key_scans_params(¶m, tree, FALSE,
|
||||||
best_read_time)))
|
best_read_time)))
|
||||||
best_read_time= best_trp->read_cost;
|
best_read_time= best_trp->read_cost;
|
||||||
|
|
||||||
@ -1705,7 +1705,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
|
|||||||
if (best_trp)
|
if (best_trp)
|
||||||
{
|
{
|
||||||
records= best_trp->records;
|
records= best_trp->records;
|
||||||
if (!(quick= best_trp->make_quick(¶m, true)) || quick->init())
|
if (!(quick= best_trp->make_quick(¶m, TRUE)) || quick->init())
|
||||||
{
|
{
|
||||||
delete quick;
|
delete quick;
|
||||||
quick= NULL;
|
quick= NULL;
|
||||||
@ -1858,13 +1858,13 @@ TABLE_READ_PLAN *get_best_disjunct_quick(PARAM *param, SEL_IMERGE *imerge,
|
|||||||
TRP_RANGE **range_scans;
|
TRP_RANGE **range_scans;
|
||||||
TRP_RANGE **cur_child;
|
TRP_RANGE **cur_child;
|
||||||
TRP_RANGE **cpk_scan= NULL;
|
TRP_RANGE **cpk_scan= NULL;
|
||||||
bool imerge_too_expensive= false;
|
bool imerge_too_expensive= FALSE;
|
||||||
double imerge_cost= 0.0;
|
double imerge_cost= 0.0;
|
||||||
ha_rows cpk_scan_records= 0;
|
ha_rows cpk_scan_records= 0;
|
||||||
ha_rows non_cpk_scan_records= 0;
|
ha_rows non_cpk_scan_records= 0;
|
||||||
bool pk_is_clustered= param->table->file->primary_key_is_clustered();
|
bool pk_is_clustered= param->table->file->primary_key_is_clustered();
|
||||||
bool all_scans_ror_able= true;
|
bool all_scans_ror_able= TRUE;
|
||||||
bool all_scans_rors= true;
|
bool all_scans_rors= TRUE;
|
||||||
uint unique_calc_buff_size;
|
uint unique_calc_buff_size;
|
||||||
TABLE_READ_PLAN **roru_read_plans;
|
TABLE_READ_PLAN **roru_read_plans;
|
||||||
TABLE_READ_PLAN **cur_roru_plan;
|
TABLE_READ_PLAN **cur_roru_plan;
|
||||||
@ -1891,7 +1891,7 @@ TABLE_READ_PLAN *get_best_disjunct_quick(PARAM *param, SEL_IMERGE *imerge,
|
|||||||
{
|
{
|
||||||
DBUG_EXECUTE("info", print_sel_tree(param, *ptree, &(*ptree)->keys_map,
|
DBUG_EXECUTE("info", print_sel_tree(param, *ptree, &(*ptree)->keys_map,
|
||||||
"tree in SEL_IMERGE"););
|
"tree in SEL_IMERGE"););
|
||||||
if (!(*cur_child= get_key_scans_params(param, *ptree, true, read_time)))
|
if (!(*cur_child= get_key_scans_params(param, *ptree, TRUE, read_time)))
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
One of index scans in this index_merge is more expensive than entire
|
One of index scans in this index_merge is more expensive than entire
|
||||||
@ -1899,7 +1899,7 @@ TABLE_READ_PLAN *get_best_disjunct_quick(PARAM *param, SEL_IMERGE *imerge,
|
|||||||
any possible ROR-union) will be more expensive then, too. We continue
|
any possible ROR-union) will be more expensive then, too. We continue
|
||||||
here only to update SQL_SELECT members.
|
here only to update SQL_SELECT members.
|
||||||
*/
|
*/
|
||||||
imerge_too_expensive= true;
|
imerge_too_expensive= TRUE;
|
||||||
}
|
}
|
||||||
if (imerge_too_expensive)
|
if (imerge_too_expensive)
|
||||||
continue;
|
continue;
|
||||||
@ -2170,7 +2170,7 @@ ROR_SCAN_INFO *make_ror_scan(const PARAM *param, int idx, SEL_ARG *sel_arg)
|
|||||||
DBUG_RETURN(NULL);
|
DBUG_RETURN(NULL);
|
||||||
|
|
||||||
if (bitmap_init(&ror_scan->covered_fields, bitmap_buf,
|
if (bitmap_init(&ror_scan->covered_fields, bitmap_buf,
|
||||||
param->fields_bitmap_size*8, false))
|
param->fields_bitmap_size*8, FALSE))
|
||||||
DBUG_RETURN(NULL);
|
DBUG_RETURN(NULL);
|
||||||
bitmap_clear_all(&ror_scan->covered_fields);
|
bitmap_clear_all(&ror_scan->covered_fields);
|
||||||
|
|
||||||
@ -2251,7 +2251,7 @@ typedef struct
|
|||||||
const PARAM *param;
|
const PARAM *param;
|
||||||
MY_BITMAP covered_fields; /* union of fields covered by all scans */
|
MY_BITMAP covered_fields; /* union of fields covered by all scans */
|
||||||
|
|
||||||
/* true if covered_fields is a superset of needed_fields */
|
/* TRUE if covered_fields is a superset of needed_fields */
|
||||||
bool is_covering;
|
bool is_covering;
|
||||||
|
|
||||||
double index_scan_costs; /* SUM(cost of 'index-only' scans) */
|
double index_scan_costs; /* SUM(cost of 'index-only' scans) */
|
||||||
@ -2274,7 +2274,7 @@ typedef struct
|
|||||||
|
|
||||||
static void ror_intersect_reinit(ROR_INTERSECT_INFO *info)
|
static void ror_intersect_reinit(ROR_INTERSECT_INFO *info)
|
||||||
{
|
{
|
||||||
info->is_covering= false;
|
info->is_covering= FALSE;
|
||||||
info->index_scan_costs= 0.0f;
|
info->index_scan_costs= 0.0f;
|
||||||
info->records_fract= 1.0f;
|
info->records_fract= 1.0f;
|
||||||
bitmap_clear_all(&info->covered_fields);
|
bitmap_clear_all(&info->covered_fields);
|
||||||
@ -2286,7 +2286,7 @@ static void ror_intersect_reinit(ROR_INTERSECT_INFO *info)
|
|||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
ror_intersect_init()
|
ror_intersect_init()
|
||||||
param Parameter from test_quick_select
|
param Parameter from test_quick_select
|
||||||
is_index_only If true, set ROR_INTERSECT_INFO to be covering
|
is_index_only If TRUE, set ROR_INTERSECT_INFO to be covering
|
||||||
|
|
||||||
RETURN
|
RETURN
|
||||||
allocated structure
|
allocated structure
|
||||||
@ -2305,7 +2305,7 @@ ROR_INTERSECT_INFO* ror_intersect_init(const PARAM *param, bool is_index_only)
|
|||||||
if (!(buf= (uchar*)alloc_root(param->mem_root, param->fields_bitmap_size)))
|
if (!(buf= (uchar*)alloc_root(param->mem_root, param->fields_bitmap_size)))
|
||||||
return NULL;
|
return NULL;
|
||||||
if (bitmap_init(&info->covered_fields, buf, param->fields_bitmap_size*8,
|
if (bitmap_init(&info->covered_fields, buf, param->fields_bitmap_size*8,
|
||||||
false))
|
FALSE))
|
||||||
return NULL;
|
return NULL;
|
||||||
ror_intersect_reinit(info);
|
ror_intersect_reinit(info);
|
||||||
return info;
|
return info;
|
||||||
@ -2322,7 +2322,7 @@ ROR_INTERSECT_INFO* ror_intersect_init(const PARAM *param, bool is_index_only)
|
|||||||
param Parameter from test_quick_select
|
param Parameter from test_quick_select
|
||||||
info ROR-intersection structure to add the scan to.
|
info ROR-intersection structure to add the scan to.
|
||||||
ror_scan ROR scan info to add.
|
ror_scan ROR scan info to add.
|
||||||
is_cpk_scan If true, add the scan as CPK scan (this can be inferred
|
is_cpk_scan If TRUE, add the scan as CPK scan (this can be inferred
|
||||||
from other parameters and is passed separately only to
|
from other parameters and is passed separately only to
|
||||||
avoid duplicating the inference code)
|
avoid duplicating the inference code)
|
||||||
|
|
||||||
@ -2420,12 +2420,12 @@ ROR_INTERSECT_INFO* ror_intersect_init(const PARAM *param, bool is_index_only)
|
|||||||
and reduce adjacent fractions.
|
and reduce adjacent fractions.
|
||||||
|
|
||||||
RETURN
|
RETURN
|
||||||
true ROR scan added to ROR-intersection, cost updated.
|
TRUE ROR scan added to ROR-intersection, cost updated.
|
||||||
false It doesn't make sense to add this ROR scan to this ROR-intersection.
|
FALSE It doesn't make sense to add this ROR scan to this ROR-intersection.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool ror_intersect_add(const PARAM *param, ROR_INTERSECT_INFO *info,
|
bool ror_intersect_add(const PARAM *param, ROR_INTERSECT_INFO *info,
|
||||||
ROR_SCAN_INFO* ror_scan, bool is_cpk_scan=false)
|
ROR_SCAN_INFO* ror_scan, bool is_cpk_scan=FALSE)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
SEL_ARG *sel_arg;
|
SEL_ARG *sel_arg;
|
||||||
@ -2504,7 +2504,7 @@ bool ror_intersect_add(const PARAM *param, ROR_INTERSECT_INFO *info,
|
|||||||
{
|
{
|
||||||
/* Don't add this scan if it doesn't improve selectivity. */
|
/* Don't add this scan if it doesn't improve selectivity. */
|
||||||
DBUG_PRINT("info", ("The scan doesn't improve selectivity."));
|
DBUG_PRINT("info", ("The scan doesn't improve selectivity."));
|
||||||
DBUG_RETURN(false);
|
DBUG_RETURN(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
info->records_fract *= selectivity_mult;
|
info->records_fract *= selectivity_mult;
|
||||||
@ -2525,7 +2525,7 @@ bool ror_intersect_add(const PARAM *param, ROR_INTERSECT_INFO *info,
|
|||||||
&info->covered_fields))
|
&info->covered_fields))
|
||||||
{
|
{
|
||||||
DBUG_PRINT("info", ("ROR-intersect is covering now"));
|
DBUG_PRINT("info", ("ROR-intersect is covering now"));
|
||||||
info->is_covering= true;
|
info->is_covering= TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
info->total_cost= info->index_scan_costs;
|
info->total_cost= info->index_scan_costs;
|
||||||
@ -2539,7 +2539,7 @@ bool ror_intersect_add(const PARAM *param, ROR_INTERSECT_INFO *info,
|
|||||||
DBUG_PRINT("info", ("New selectivity= %g", info->records_fract));
|
DBUG_PRINT("info", ("New selectivity= %g", info->records_fract));
|
||||||
DBUG_PRINT("info", ("New cost= %g, %scovering", info->total_cost,
|
DBUG_PRINT("info", ("New cost= %g, %scovering", info->total_cost,
|
||||||
info->is_covering?"" : "non-"));
|
info->is_covering?"" : "non-"));
|
||||||
DBUG_RETURN(true);
|
DBUG_RETURN(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -2553,7 +2553,7 @@ bool ror_intersect_add(const PARAM *param, ROR_INTERSECT_INFO *info,
|
|||||||
tree Transformed restriction condition to be used to look
|
tree Transformed restriction condition to be used to look
|
||||||
for ROR scans.
|
for ROR scans.
|
||||||
read_time Do not return read plans with cost > read_time.
|
read_time Do not return read plans with cost > read_time.
|
||||||
are_all_covering [out] set to true if union of all scans covers all
|
are_all_covering [out] set to TRUE if union of all scans covers all
|
||||||
fields needed by the query (and it is possible to build
|
fields needed by the query (and it is possible to build
|
||||||
a covering ROR-intersection)
|
a covering ROR-intersection)
|
||||||
|
|
||||||
@ -2621,7 +2621,7 @@ TRP_ROR_INTERSECT *get_best_ror_intersect(const PARAM *param, SEL_TREE *tree,
|
|||||||
*/
|
*/
|
||||||
ROR_SCAN_INFO **cur_ror_scan;
|
ROR_SCAN_INFO **cur_ror_scan;
|
||||||
ROR_SCAN_INFO *cpk_scan= NULL;
|
ROR_SCAN_INFO *cpk_scan= NULL;
|
||||||
bool cpk_scan_used= false;
|
bool cpk_scan_used= FALSE;
|
||||||
if (!(tree->ror_scans= (ROR_SCAN_INFO**)alloc_root(param->mem_root,
|
if (!(tree->ror_scans= (ROR_SCAN_INFO**)alloc_root(param->mem_root,
|
||||||
sizeof(ROR_SCAN_INFO*)*
|
sizeof(ROR_SCAN_INFO*)*
|
||||||
param->keys)))
|
param->keys)))
|
||||||
@ -2670,7 +2670,7 @@ TRP_ROR_INTERSECT *get_best_ror_intersect(const PARAM *param, SEL_TREE *tree,
|
|||||||
|
|
||||||
/* Create and incrementally update ROR intersection. */
|
/* Create and incrementally update ROR intersection. */
|
||||||
ROR_INTERSECT_INFO *intersect;
|
ROR_INTERSECT_INFO *intersect;
|
||||||
if (!(intersect= ror_intersect_init(param, false)))
|
if (!(intersect= ror_intersect_init(param, FALSE)))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* [intersect_scans, intersect_scans_best) will hold the best combination */
|
/* [intersect_scans, intersect_scans_best) will hold the best combination */
|
||||||
@ -2739,7 +2739,7 @@ TRP_ROR_INTERSECT *get_best_ror_intersect(const PARAM *param, SEL_TREE *tree,
|
|||||||
|
|
||||||
if (ror_intersect_add(param, intersect, cpk_scan))
|
if (ror_intersect_add(param, intersect, cpk_scan))
|
||||||
{
|
{
|
||||||
cpk_scan_used= true;
|
cpk_scan_used= TRUE;
|
||||||
min_cost= intersect->total_cost;
|
min_cost= intersect->total_cost;
|
||||||
best_rows= (ha_rows)(intersect->records_fract*
|
best_rows= (ha_rows)(intersect->records_fract*
|
||||||
rows2double(param->table->file->records));
|
rows2double(param->table->file->records));
|
||||||
@ -2826,7 +2826,7 @@ TRP_ROR_INTERSECT *get_best_covering_ror_intersect(PARAM *param,
|
|||||||
|
|
||||||
uchar buf[MAX_KEY/8+1];
|
uchar buf[MAX_KEY/8+1];
|
||||||
MY_BITMAP covered_fields;
|
MY_BITMAP covered_fields;
|
||||||
if (bitmap_init(&covered_fields, buf, nbits, false))
|
if (bitmap_init(&covered_fields, buf, nbits, FALSE))
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
bitmap_clear_all(&covered_fields);
|
bitmap_clear_all(&covered_fields);
|
||||||
|
|
||||||
@ -2903,7 +2903,7 @@ TRP_ROR_INTERSECT *get_best_covering_ror_intersect(PARAM *param,
|
|||||||
DBUG_RETURN(NULL);
|
DBUG_RETURN(NULL);
|
||||||
memcpy(trp->first_scan, ror_scan_mark, best_num*sizeof(ROR_SCAN_INFO*));
|
memcpy(trp->first_scan, ror_scan_mark, best_num*sizeof(ROR_SCAN_INFO*));
|
||||||
trp->last_scan= trp->first_scan + best_num;
|
trp->last_scan= trp->first_scan + best_num;
|
||||||
trp->is_covering= true;
|
trp->is_covering= TRUE;
|
||||||
trp->read_cost= total_cost;
|
trp->read_cost= total_cost;
|
||||||
trp->records= records;
|
trp->records= records;
|
||||||
|
|
||||||
@ -2918,7 +2918,7 @@ TRP_ROR_INTERSECT *get_best_covering_ror_intersect(PARAM *param,
|
|||||||
get_key_scans_params
|
get_key_scans_params
|
||||||
param parameters from test_quick_select
|
param parameters from test_quick_select
|
||||||
tree make range select for this SEL_TREE
|
tree make range select for this SEL_TREE
|
||||||
index_read_must_be_used if true, assume 'index only' option will be set
|
index_read_must_be_used if TRUE, assume 'index only' option will be set
|
||||||
(except for clustered PK indexes)
|
(except for clustered PK indexes)
|
||||||
read_time don't create read plans with cost > read_time.
|
read_time don't create read plans with cost > read_time.
|
||||||
RETURN
|
RETURN
|
||||||
@ -2959,7 +2959,7 @@ static TRP_RANGE *get_key_scans_params(PARAM *param, SEL_TREE *tree,
|
|||||||
(*key)->maybe_flag)
|
(*key)->maybe_flag)
|
||||||
param->needed_reg->set_bit(keynr);
|
param->needed_reg->set_bit(keynr);
|
||||||
|
|
||||||
bool read_index_only= index_read_must_be_used? true :
|
bool read_index_only= index_read_must_be_used ? TRUE :
|
||||||
(bool) param->table->used_keys.is_set(keynr);
|
(bool) param->table->used_keys.is_set(keynr);
|
||||||
|
|
||||||
found_records= check_quick_select(param, idx, *key);
|
found_records= check_quick_select(param, idx, *key);
|
||||||
@ -2970,7 +2970,8 @@ static TRP_RANGE *get_key_scans_params(PARAM *param, SEL_TREE *tree,
|
|||||||
}
|
}
|
||||||
if (found_records != HA_POS_ERROR && found_records > 2 &&
|
if (found_records != HA_POS_ERROR && found_records > 2 &&
|
||||||
read_index_only &&
|
read_index_only &&
|
||||||
(param->table->file->index_flags(keynr) & HA_KEYREAD_ONLY) &&
|
(param->table->file->index_flags(keynr, param.max_key_part,1) &
|
||||||
|
HA_KEYREAD_ONLY) &&
|
||||||
!(pk_is_clustered && keynr == param->table->primary_key))
|
!(pk_is_clustered && keynr == param->table->primary_key))
|
||||||
{
|
{
|
||||||
/* We can resolve this by only reading through this key. */
|
/* We can resolve this by only reading through this key. */
|
||||||
@ -3038,7 +3039,7 @@ QUICK_SELECT_I *TRP_INDEX_MERGE::make_quick(PARAM *param,
|
|||||||
range_scan++)
|
range_scan++)
|
||||||
{
|
{
|
||||||
if (!(quick= (QUICK_RANGE_SELECT*)
|
if (!(quick= (QUICK_RANGE_SELECT*)
|
||||||
((*range_scan)->make_quick(param, false, &quick_imerge->alloc)))||
|
((*range_scan)->make_quick(param, FALSE, &quick_imerge->alloc)))||
|
||||||
quick_imerge->push_quick_back(quick))
|
quick_imerge->push_quick_back(quick))
|
||||||
{
|
{
|
||||||
delete quick;
|
delete quick;
|
||||||
@ -3060,7 +3061,7 @@ QUICK_SELECT_I *TRP_ROR_INTERSECT::make_quick(PARAM *param,
|
|||||||
|
|
||||||
if ((quick_intrsect=
|
if ((quick_intrsect=
|
||||||
new QUICK_ROR_INTERSECT_SELECT(param->thd, param->table,
|
new QUICK_ROR_INTERSECT_SELECT(param->thd, param->table,
|
||||||
retrieve_full_rows? (!is_covering):false,
|
retrieve_full_rows? (!is_covering):FALSE,
|
||||||
parent_alloc)))
|
parent_alloc)))
|
||||||
{
|
{
|
||||||
DBUG_EXECUTE("info", print_ror_scans_arr(param->table,
|
DBUG_EXECUTE("info", print_ror_scans_arr(param->table,
|
||||||
@ -3110,7 +3111,7 @@ QUICK_SELECT_I *TRP_ROR_UNION::make_quick(PARAM *param,
|
|||||||
{
|
{
|
||||||
for(scan= first_ror; scan != last_ror; scan++)
|
for(scan= first_ror; scan != last_ror; scan++)
|
||||||
{
|
{
|
||||||
if (!(quick= (*scan)->make_quick(param, false, &quick_roru->alloc)) ||
|
if (!(quick= (*scan)->make_quick(param, FALSE, &quick_roru->alloc)) ||
|
||||||
quick_roru->push_quick_back(quick))
|
quick_roru->push_quick_back(quick))
|
||||||
DBUG_RETURN(NULL);
|
DBUG_RETURN(NULL);
|
||||||
}
|
}
|
||||||
@ -3231,7 +3232,7 @@ static SEL_TREE *get_mm_tree(PARAM *param,COND *cond)
|
|||||||
param->current_table))
|
param->current_table))
|
||||||
DBUG_RETURN(0); // Can't be calculated yet
|
DBUG_RETURN(0); // Can't be calculated yet
|
||||||
if (!(ref_tables & param->current_table))
|
if (!(ref_tables & param->current_table))
|
||||||
DBUG_RETURN(new SEL_TREE(SEL_TREE::MAYBE)); // This may be false or true
|
DBUG_RETURN(new SEL_TREE(SEL_TREE::MAYBE)); // This may be FALSE or TRUE
|
||||||
|
|
||||||
/* check field op const */
|
/* check field op const */
|
||||||
/* btw, ft_func's arguments()[0] isn't FIELD_ITEM. SerG*/
|
/* btw, ft_func's arguments()[0] isn't FIELD_ITEM. SerG*/
|
||||||
@ -3372,7 +3373,8 @@ get_mm_leaf(PARAM *param, COND *conf_func, Field *field, KEY_PART *key_part,
|
|||||||
String tmp(buff1,sizeof(buff1),value->collation.collation),*res;
|
String tmp(buff1,sizeof(buff1),value->collation.collation),*res;
|
||||||
uint length,offset,min_length,max_length;
|
uint length,offset,min_length,max_length;
|
||||||
|
|
||||||
if (!field->optimize_range(param->real_keynr[key_part->key]))
|
if (!field->optimize_range(param->real_keynr[key_part->key],
|
||||||
|
key_part->part))
|
||||||
DBUG_RETURN(0); // Can't optimize this
|
DBUG_RETURN(0); // Can't optimize this
|
||||||
if (!(res= value->val_str(&tmp)))
|
if (!(res= value->val_str(&tmp)))
|
||||||
DBUG_RETURN(&null_element);
|
DBUG_RETURN(&null_element);
|
||||||
@ -3437,7 +3439,8 @@ get_mm_leaf(PARAM *param, COND *conf_func, Field *field, KEY_PART *key_part,
|
|||||||
DBUG_RETURN(new SEL_ARG(field,min_str,max_str));
|
DBUG_RETURN(new SEL_ARG(field,min_str,max_str));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!field->optimize_range(param->real_keynr[key_part->key]) &&
|
if (!field->optimize_range(param->real_keynr[key_part->key],
|
||||||
|
key_part->part) &&
|
||||||
type != Item_func::EQ_FUNC &&
|
type != Item_func::EQ_FUNC &&
|
||||||
type != Item_func::EQUAL_FUNC)
|
type != Item_func::EQUAL_FUNC)
|
||||||
DBUG_RETURN(0); // Can't optimize this
|
DBUG_RETURN(0); // Can't optimize this
|
||||||
@ -3454,7 +3457,7 @@ get_mm_leaf(PARAM *param, COND *conf_func, Field *field, KEY_PART *key_part,
|
|||||||
if (value->save_in_field(field, 1) < 0)
|
if (value->save_in_field(field, 1) < 0)
|
||||||
{
|
{
|
||||||
/* This happens when we try to insert a NULL field in a not null column */
|
/* This happens when we try to insert a NULL field in a not null column */
|
||||||
DBUG_RETURN(&null_element); // cmp with NULL is never true
|
DBUG_RETURN(&null_element); // cmp with NULL is never TRUE
|
||||||
}
|
}
|
||||||
/* Get local copy of key */
|
/* Get local copy of key */
|
||||||
copies= 1;
|
copies= 1;
|
||||||
@ -3559,8 +3562,8 @@ get_mm_leaf(PARAM *param, COND *conf_func, Field *field, KEY_PART *key_part,
|
|||||||
** If tree is 0 it means that the condition can't be tested. It refers
|
** If tree is 0 it means that the condition can't be tested. It refers
|
||||||
** to a non existent table or to a field in current table with isn't a key.
|
** to a non existent table or to a field in current table with isn't a key.
|
||||||
** The different tree flags:
|
** The different tree flags:
|
||||||
** IMPOSSIBLE: Condition is never true
|
** IMPOSSIBLE: Condition is never TRUE
|
||||||
** ALWAYS: Condition is always true
|
** ALWAYS: Condition is always TRUE
|
||||||
** MAYBE: Condition may exists when tables are read
|
** MAYBE: Condition may exists when tables are read
|
||||||
** MAYBE_KEY: Condition refers to a key that may be used in join loop
|
** MAYBE_KEY: Condition refers to a key that may be used in join loop
|
||||||
** KEY_RANGE: Condition uses a key
|
** KEY_RANGE: Condition uses a key
|
||||||
@ -3683,7 +3686,7 @@ bool sel_trees_can_be_ored(SEL_TREE *tree1, SEL_TREE *tree2, PARAM* param)
|
|||||||
common_keys.intersect(tree2->keys_map);
|
common_keys.intersect(tree2->keys_map);
|
||||||
|
|
||||||
if (common_keys.is_clear_all())
|
if (common_keys.is_clear_all())
|
||||||
DBUG_RETURN(false);
|
DBUG_RETURN(FALSE);
|
||||||
|
|
||||||
/* trees have a common key, check if they refer to same key part */
|
/* trees have a common key, check if they refer to same key part */
|
||||||
SEL_ARG **key1,**key2;
|
SEL_ARG **key1,**key2;
|
||||||
@ -3695,11 +3698,11 @@ bool sel_trees_can_be_ored(SEL_TREE *tree1, SEL_TREE *tree2, PARAM* param)
|
|||||||
key2= tree2->keys + key_no;
|
key2= tree2->keys + key_no;
|
||||||
if ((*key1)->part == (*key2)->part)
|
if ((*key1)->part == (*key2)->part)
|
||||||
{
|
{
|
||||||
DBUG_RETURN(true);
|
DBUG_RETURN(TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DBUG_RETURN(false);
|
DBUG_RETURN(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static SEL_TREE *
|
static SEL_TREE *
|
||||||
@ -4669,7 +4672,7 @@ check_quick_select(PARAM *param,uint idx,SEL_ARG *tree)
|
|||||||
uint key;
|
uint key;
|
||||||
DBUG_ENTER("check_quick_select");
|
DBUG_ENTER("check_quick_select");
|
||||||
|
|
||||||
param->is_ror_scan= false;
|
param->is_ror_scan= FALSE;
|
||||||
|
|
||||||
if (!tree)
|
if (!tree)
|
||||||
DBUG_RETURN(HA_POS_ERROR); // Can't use it
|
DBUG_RETURN(HA_POS_ERROR); // Can't use it
|
||||||
@ -4686,7 +4689,7 @@ check_quick_select(PARAM *param,uint idx,SEL_ARG *tree)
|
|||||||
if ((key_alg != HA_KEY_ALG_BTREE) && (key_alg!= HA_KEY_ALG_UNDEF))
|
if ((key_alg != HA_KEY_ALG_BTREE) && (key_alg!= HA_KEY_ALG_UNDEF))
|
||||||
{
|
{
|
||||||
/* Records are not ordered by rowid for other types of indexes. */
|
/* Records are not ordered by rowid for other types of indexes. */
|
||||||
cpk_scan= false;
|
cpk_scan= FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -4707,7 +4710,7 @@ check_quick_select(PARAM *param,uint idx,SEL_ARG *tree)
|
|||||||
param->table->quick_key_parts[key]=param->max_key_part+1;
|
param->table->quick_key_parts[key]=param->max_key_part+1;
|
||||||
|
|
||||||
if (cpk_scan)
|
if (cpk_scan)
|
||||||
param->is_ror_scan= true;
|
param->is_ror_scan= TRUE;
|
||||||
}
|
}
|
||||||
DBUG_PRINT("exit", ("Records: %lu", (ulong) records));
|
DBUG_PRINT("exit", ("Records: %lu", (ulong) records));
|
||||||
DBUG_RETURN(records);
|
DBUG_RETURN(records);
|
||||||
@ -4766,7 +4769,7 @@ check_quick_keys(PARAM *param,uint idx,SEL_ARG *key_tree,
|
|||||||
(keyXpartY less/equals c1) OR (keyXpartY more/equals c2).
|
(keyXpartY less/equals c1) OR (keyXpartY more/equals c2).
|
||||||
This is not a ROR scan if the key is not Clustered Primary Key.
|
This is not a ROR scan if the key is not Clustered Primary Key.
|
||||||
*/
|
*/
|
||||||
param->is_ror_scan= false;
|
param->is_ror_scan= FALSE;
|
||||||
records=check_quick_keys(param,idx,key_tree->left,min_key,min_key_flag,
|
records=check_quick_keys(param,idx,key_tree->left,min_key,min_key_flag,
|
||||||
max_key,max_key_flag);
|
max_key,max_key_flag);
|
||||||
if (records == HA_POS_ERROR) // Impossible
|
if (records == HA_POS_ERROR) // Impossible
|
||||||
@ -4791,7 +4794,7 @@ check_quick_keys(PARAM *param,uint idx,SEL_ARG *key_tree,
|
|||||||
key_part[key_tree->part].fieldnr - 1;
|
key_part[key_tree->part].fieldnr - 1;
|
||||||
if (param->table->field[fieldnr]->key_length() !=
|
if (param->table->field[fieldnr]->key_length() !=
|
||||||
param->key[idx][key_tree->part].length)
|
param->key[idx][key_tree->part].length)
|
||||||
param->is_ror_scan= false;
|
param->is_ror_scan= FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (key_tree->next_key_part &&
|
if (key_tree->next_key_part &&
|
||||||
@ -4810,7 +4813,7 @@ check_quick_keys(PARAM *param,uint idx,SEL_ARG *key_tree,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* The interval for current key part is not c1 <= keyXpartY <= c1 */
|
/* The interval for current key part is not c1 <= keyXpartY <= c1 */
|
||||||
param->is_ror_scan= false;
|
param->is_ror_scan= FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp_min_flag=key_tree->min_flag;
|
tmp_min_flag=key_tree->min_flag;
|
||||||
@ -4856,7 +4859,7 @@ check_quick_keys(PARAM *param,uint idx,SEL_ARG *key_tree,
|
|||||||
!memcmp(min_key,max_key, (uint) (tmp_max_key - max_key)) &&
|
!memcmp(min_key,max_key, (uint) (tmp_max_key - max_key)) &&
|
||||||
!key_tree->min_flag && !key_tree->max_flag &&
|
!key_tree->min_flag && !key_tree->max_flag &&
|
||||||
is_key_scan_ror(param, keynr, key_tree->part + 1)))
|
is_key_scan_ror(param, keynr, key_tree->part + 1)))
|
||||||
param->is_ror_scan= false;
|
param->is_ror_scan= FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tmp_min_flag & GEOM_FLAG)
|
if (tmp_min_flag & GEOM_FLAG)
|
||||||
@ -4901,7 +4904,7 @@ check_quick_keys(PARAM *param,uint idx,SEL_ARG *key_tree,
|
|||||||
(keyXpartY less/equals c1) OR (keyXpartY more/equals c2).
|
(keyXpartY less/equals c1) OR (keyXpartY more/equals c2).
|
||||||
This is not a ROR scan if the key is not Clustered Primary Key.
|
This is not a ROR scan if the key is not Clustered Primary Key.
|
||||||
*/
|
*/
|
||||||
param->is_ror_scan= false;
|
param->is_ror_scan= FALSE;
|
||||||
tmp=check_quick_keys(param,idx,key_tree->right,min_key,min_key_flag,
|
tmp=check_quick_keys(param,idx,key_tree->right,min_key,min_key_flag,
|
||||||
max_key,max_key_flag);
|
max_key,max_key_flag);
|
||||||
if (tmp == HA_POS_ERROR)
|
if (tmp == HA_POS_ERROR)
|
||||||
@ -4947,8 +4950,8 @@ check_quick_keys(PARAM *param,uint idx,SEL_ARG *key_tree,
|
|||||||
Check (2) is made by this function.
|
Check (2) is made by this function.
|
||||||
|
|
||||||
RETURN
|
RETURN
|
||||||
true If the scan is ROR-scan
|
TRUE If the scan is ROR-scan
|
||||||
false otherwise
|
FALSE otherwise
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static bool is_key_scan_ror(PARAM *param, uint keynr, uint8 nparts)
|
static bool is_key_scan_ror(PARAM *param, uint keynr, uint8 nparts)
|
||||||
@ -4959,10 +4962,10 @@ static bool is_key_scan_ror(PARAM *param, uint keynr, uint8 nparts)
|
|||||||
table_key->key_parts;
|
table_key->key_parts;
|
||||||
|
|
||||||
if (key_part == key_part_end)
|
if (key_part == key_part_end)
|
||||||
return true;
|
return TRUE;
|
||||||
uint pk_number= param->table->primary_key;
|
uint pk_number= param->table->primary_key;
|
||||||
if (!param->table->file->primary_key_is_clustered() || pk_number == MAX_KEY)
|
if (!param->table->file->primary_key_is_clustered() || pk_number == MAX_KEY)
|
||||||
return false;
|
return FALSE;
|
||||||
|
|
||||||
KEY_PART_INFO *pk_part= param->table->key_info[pk_number].key_part;
|
KEY_PART_INFO *pk_part= param->table->key_info[pk_number].key_part;
|
||||||
KEY_PART_INFO *pk_part_end= pk_part +
|
KEY_PART_INFO *pk_part_end= pk_part +
|
||||||
@ -4972,7 +4975,7 @@ static bool is_key_scan_ror(PARAM *param, uint keynr, uint8 nparts)
|
|||||||
{
|
{
|
||||||
if ((key_part->field != pk_part->field) ||
|
if ((key_part->field != pk_part->field) ||
|
||||||
(key_part->length != pk_part->length))
|
(key_part->length != pk_part->length))
|
||||||
return false;
|
return FALSE;
|
||||||
}
|
}
|
||||||
return (key_part == key_part_end);
|
return (key_part == key_part_end);
|
||||||
}
|
}
|
||||||
@ -5173,7 +5176,7 @@ bool QUICK_RANGE_SELECT::unique_key_range()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Returns true if any part of the key is NULL */
|
/* Returns TRUE if any part of the key is NULL */
|
||||||
|
|
||||||
static bool null_part_in_key(KEY_PART *key_part, const char *key, uint length)
|
static bool null_part_in_key(KEY_PART *key_part, const char *key, uint length)
|
||||||
{
|
{
|
||||||
@ -5311,7 +5314,7 @@ err:
|
|||||||
/*
|
/*
|
||||||
Fetch all row ids into unique.
|
Fetch all row ids into unique.
|
||||||
|
|
||||||
If table has a clustered primary key that covers all rows (true for bdb
|
If table has a clustered primary key that covers all rows (TRUE for bdb
|
||||||
and innodb currently) and one of the index_merge scans is a scan on PK,
|
and innodb currently) and one of the index_merge scans is a scan on PK,
|
||||||
then
|
then
|
||||||
primary key scan rowids are not put into Unique and also
|
primary key scan rowids are not put into Unique and also
|
||||||
@ -5380,11 +5383,11 @@ int QUICK_INDEX_MERGE_SELECT::prepare_unique()
|
|||||||
if (result)
|
if (result)
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
|
|
||||||
}while(true);
|
}while(TRUE);
|
||||||
|
|
||||||
/* ok, all row ids are in Unique */
|
/* ok, all row ids are in Unique */
|
||||||
result= unique->get(head);
|
result= unique->get(head);
|
||||||
doing_pk_scan= false;
|
doing_pk_scan= FALSE;
|
||||||
init_read_record(&read_record, thd, head, NULL, 1, 1);
|
init_read_record(&read_record, thd, head, NULL, 1, 1);
|
||||||
/* index_merge currently doesn't support "using index" at all */
|
/* index_merge currently doesn't support "using index" at all */
|
||||||
head->file->extra(HA_EXTRA_NO_KEYREAD);
|
head->file->extra(HA_EXTRA_NO_KEYREAD);
|
||||||
@ -5419,7 +5422,7 @@ int QUICK_INDEX_MERGE_SELECT::get_next()
|
|||||||
/* All rows from Unique have been retrieved, do a clustered PK scan */
|
/* All rows from Unique have been retrieved, do a clustered PK scan */
|
||||||
if(pk_quick_select)
|
if(pk_quick_select)
|
||||||
{
|
{
|
||||||
doing_pk_scan= true;
|
doing_pk_scan= TRUE;
|
||||||
if ((result= pk_quick_select->init()))
|
if ((result= pk_quick_select->init()))
|
||||||
DBUG_RETURN(result);
|
DBUG_RETURN(result);
|
||||||
DBUG_RETURN(pk_quick_select->get_next());
|
DBUG_RETURN(pk_quick_select->get_next());
|
||||||
@ -5567,8 +5570,8 @@ int QUICK_ROR_UNION_SELECT::get_next()
|
|||||||
if (!have_prev_rowid)
|
if (!have_prev_rowid)
|
||||||
{
|
{
|
||||||
/* No rows have been returned yet */
|
/* No rows have been returned yet */
|
||||||
dup_row= false;
|
dup_row= FALSE;
|
||||||
have_prev_rowid= true;
|
have_prev_rowid= TRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
dup_row= !head->file->cmp_ref(cur_rowid, prev_rowid);
|
dup_row= !head->file->cmp_ref(cur_rowid, prev_rowid);
|
||||||
@ -5691,8 +5694,8 @@ int QUICK_RANGE_SELECT_GEOM::get_next()
|
|||||||
index_merge quick select.
|
index_merge quick select.
|
||||||
|
|
||||||
RETURN
|
RETURN
|
||||||
true if current row will be retrieved by this quick select
|
TRUE if current row will be retrieved by this quick select
|
||||||
false if not
|
FALSE if not
|
||||||
*/
|
*/
|
||||||
|
|
||||||
bool QUICK_RANGE_SELECT::row_in_ranges()
|
bool QUICK_RANGE_SELECT::row_in_ranges()
|
||||||
@ -5889,7 +5892,7 @@ int QUICK_RANGE_SELECT::cmp_prev(QUICK_RANGE *range_arg)
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* True if this range will require using HA_READ_AFTER_KEY
|
* TRUE if this range will require using HA_READ_AFTER_KEY
|
||||||
See comment in get_next() about this
|
See comment in get_next() about this
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -5901,7 +5904,7 @@ bool QUICK_SELECT_DESC::range_reads_after_key(QUICK_RANGE *range_arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* True if we are reading over a key that may have a NULL value */
|
/* TRUE if we are reading over a key that may have a NULL value */
|
||||||
|
|
||||||
#ifdef NOT_USED
|
#ifdef NOT_USED
|
||||||
bool QUICK_SELECT_DESC::test_if_null_range(QUICK_RANGE *range_arg,
|
bool QUICK_SELECT_DESC::test_if_null_range(QUICK_RANGE *range_arg,
|
||||||
@ -5958,7 +5961,7 @@ void QUICK_RANGE_SELECT::add_info_string(String *str)
|
|||||||
void QUICK_INDEX_MERGE_SELECT::add_info_string(String *str)
|
void QUICK_INDEX_MERGE_SELECT::add_info_string(String *str)
|
||||||
{
|
{
|
||||||
QUICK_RANGE_SELECT *quick;
|
QUICK_RANGE_SELECT *quick;
|
||||||
bool first= true;
|
bool first= TRUE;
|
||||||
List_iterator_fast<QUICK_RANGE_SELECT> it(quick_selects);
|
List_iterator_fast<QUICK_RANGE_SELECT> it(quick_selects);
|
||||||
str->append("sort_union(");
|
str->append("sort_union(");
|
||||||
while ((quick= it++))
|
while ((quick= it++))
|
||||||
@ -5966,7 +5969,7 @@ void QUICK_INDEX_MERGE_SELECT::add_info_string(String *str)
|
|||||||
if (!first)
|
if (!first)
|
||||||
str->append(',');
|
str->append(',');
|
||||||
else
|
else
|
||||||
first= false;
|
first= FALSE;
|
||||||
quick->add_info_string(str);
|
quick->add_info_string(str);
|
||||||
}
|
}
|
||||||
if (pk_quick_select)
|
if (pk_quick_select)
|
||||||
@ -5979,7 +5982,7 @@ void QUICK_INDEX_MERGE_SELECT::add_info_string(String *str)
|
|||||||
|
|
||||||
void QUICK_ROR_INTERSECT_SELECT::add_info_string(String *str)
|
void QUICK_ROR_INTERSECT_SELECT::add_info_string(String *str)
|
||||||
{
|
{
|
||||||
bool first= true;
|
bool first= TRUE;
|
||||||
QUICK_RANGE_SELECT *quick;
|
QUICK_RANGE_SELECT *quick;
|
||||||
List_iterator_fast<QUICK_RANGE_SELECT> it(quick_selects);
|
List_iterator_fast<QUICK_RANGE_SELECT> it(quick_selects);
|
||||||
str->append("intersect(");
|
str->append("intersect(");
|
||||||
@ -5989,7 +5992,7 @@ void QUICK_ROR_INTERSECT_SELECT::add_info_string(String *str)
|
|||||||
if (!first)
|
if (!first)
|
||||||
str->append(',');
|
str->append(',');
|
||||||
else
|
else
|
||||||
first= false;
|
first= FALSE;
|
||||||
str->append(key_info->name);
|
str->append(key_info->name);
|
||||||
}
|
}
|
||||||
if (cpk_quick)
|
if (cpk_quick)
|
||||||
@ -6003,7 +6006,7 @@ void QUICK_ROR_INTERSECT_SELECT::add_info_string(String *str)
|
|||||||
|
|
||||||
void QUICK_ROR_UNION_SELECT::add_info_string(String *str)
|
void QUICK_ROR_UNION_SELECT::add_info_string(String *str)
|
||||||
{
|
{
|
||||||
bool first= true;
|
bool first= TRUE;
|
||||||
QUICK_SELECT_I *quick;
|
QUICK_SELECT_I *quick;
|
||||||
List_iterator_fast<QUICK_SELECT_I> it(quick_selects);
|
List_iterator_fast<QUICK_SELECT_I> it(quick_selects);
|
||||||
str->append("union(");
|
str->append("union(");
|
||||||
@ -6012,7 +6015,7 @@ void QUICK_ROR_UNION_SELECT::add_info_string(String *str)
|
|||||||
if (!first)
|
if (!first)
|
||||||
str->append(',');
|
str->append(',');
|
||||||
else
|
else
|
||||||
first= false;
|
first= FALSE;
|
||||||
quick->add_info_string(str);
|
quick->add_info_string(str);
|
||||||
}
|
}
|
||||||
str->append(')');
|
str->append(')');
|
||||||
@ -6035,14 +6038,14 @@ void QUICK_INDEX_MERGE_SELECT::add_keys_and_lengths(String *key_names,
|
|||||||
{
|
{
|
||||||
char buf[64];
|
char buf[64];
|
||||||
uint length;
|
uint length;
|
||||||
bool first= true;
|
bool first= TRUE;
|
||||||
QUICK_RANGE_SELECT *quick;
|
QUICK_RANGE_SELECT *quick;
|
||||||
|
|
||||||
List_iterator_fast<QUICK_RANGE_SELECT> it(quick_selects);
|
List_iterator_fast<QUICK_RANGE_SELECT> it(quick_selects);
|
||||||
while ((quick= it++))
|
while ((quick= it++))
|
||||||
{
|
{
|
||||||
if (first)
|
if (first)
|
||||||
first= false;
|
first= FALSE;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
key_names->append(',');
|
key_names->append(',');
|
||||||
@ -6070,14 +6073,14 @@ void QUICK_ROR_INTERSECT_SELECT::add_keys_and_lengths(String *key_names,
|
|||||||
{
|
{
|
||||||
char buf[64];
|
char buf[64];
|
||||||
uint length;
|
uint length;
|
||||||
bool first= true;
|
bool first= TRUE;
|
||||||
QUICK_RANGE_SELECT *quick;
|
QUICK_RANGE_SELECT *quick;
|
||||||
List_iterator_fast<QUICK_RANGE_SELECT> it(quick_selects);
|
List_iterator_fast<QUICK_RANGE_SELECT> it(quick_selects);
|
||||||
while ((quick= it++))
|
while ((quick= it++))
|
||||||
{
|
{
|
||||||
KEY *key_info= head->key_info + quick->index;
|
KEY *key_info= head->key_info + quick->index;
|
||||||
if (first)
|
if (first)
|
||||||
first= false;
|
first= FALSE;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
key_names->append(',');
|
key_names->append(',');
|
||||||
@ -6102,13 +6105,13 @@ void QUICK_ROR_INTERSECT_SELECT::add_keys_and_lengths(String *key_names,
|
|||||||
void QUICK_ROR_UNION_SELECT::add_keys_and_lengths(String *key_names,
|
void QUICK_ROR_UNION_SELECT::add_keys_and_lengths(String *key_names,
|
||||||
String *used_lengths)
|
String *used_lengths)
|
||||||
{
|
{
|
||||||
bool first= true;
|
bool first= TRUE;
|
||||||
QUICK_SELECT_I *quick;
|
QUICK_SELECT_I *quick;
|
||||||
List_iterator_fast<QUICK_SELECT_I> it(quick_selects);
|
List_iterator_fast<QUICK_SELECT_I> it(quick_selects);
|
||||||
while ((quick= it++))
|
while ((quick= it++))
|
||||||
{
|
{
|
||||||
if (first)
|
if (first)
|
||||||
first= false;
|
first= FALSE;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
used_lengths->append(',');
|
used_lengths->append(',');
|
||||||
@ -6222,7 +6225,7 @@ static void print_quick(QUICK_SELECT_I *quick, const key_map *needed_reg)
|
|||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
DBUG_LOCK_FILE;
|
DBUG_LOCK_FILE;
|
||||||
|
|
||||||
quick->dbug_dump(0, true);
|
quick->dbug_dump(0, TRUE);
|
||||||
fprintf(DBUG_FILE,"other_keys: 0x%s:\n", needed_reg->print(buf));
|
fprintf(DBUG_FILE,"other_keys: 0x%s:\n", needed_reg->print(buf));
|
||||||
|
|
||||||
DBUG_UNLOCK_FILE;
|
DBUG_UNLOCK_FILE;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user