mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 12:32:27 +01:00
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-4.1
This commit is contained in:
commit
2c6a2b5306
143 changed files with 1567 additions and 645 deletions
|
@ -11,6 +11,7 @@ administrador@light.hegel.local
|
|||
ahlentz@co3064164-a.rochd1.qld.optusnet.com.au
|
||||
akishkin@work.mysql.com
|
||||
antony@ltantony.dsl-verizon.net
|
||||
antony@ltantony.rdg.cyberkinetica.com
|
||||
antony@ltantony.rdg.cyberkinetica.homeunix.net
|
||||
arjen@bitbike.com
|
||||
arjen@co3064164-a.bitbike.com
|
||||
|
@ -123,6 +124,7 @@ mwagner@work.mysql.com
|
|||
mydev@mysql.com
|
||||
mysql@home.(none)
|
||||
mysqldev@build.mysql2.com
|
||||
mysqldev@melody.local
|
||||
mysqldev@mysql.com
|
||||
ndbdev@ndbmaster.mysql.com
|
||||
nick@mysql.com
|
||||
|
|
|
@ -46,6 +46,7 @@ $opt_test= undef;
|
|||
$opt_skip_check= undef;
|
||||
$opt_skip_manual= undef;
|
||||
$opt_win_dist= undef;
|
||||
$opt_quiet= undef;
|
||||
$version= "unknown";
|
||||
$major=$minor=$release=0;
|
||||
|
||||
|
@ -67,7 +68,8 @@ GetOptions(
|
|||
"suffix=s",
|
||||
"test|t",
|
||||
"verbose|v",
|
||||
"win-dist|w"
|
||||
"win-dist|w",
|
||||
"quiet|q",
|
||||
) || print_help("");
|
||||
|
||||
#
|
||||
|
@ -99,8 +101,6 @@ if (defined $opt_build_command)
|
|||
print_help("") if ($opt_help);
|
||||
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");
|
||||
&abort("The directory \"$REPO\" could not be found!") if (!-d $REPO);
|
||||
&logger("Using $REPO as the BK parent repository");
|
||||
|
@ -306,7 +306,7 @@ if (!$opt_dry_run)
|
|||
#
|
||||
# Now build the source distribution
|
||||
#
|
||||
&logger("Compiling");
|
||||
&logger("Compiling...");
|
||||
$command= $build_command;
|
||||
&run_command($command, "Compilation failed!");
|
||||
|
||||
|
@ -403,6 +403,7 @@ Options:
|
|||
include a log file snippet, if logging is enabled)
|
||||
Note that the \@-Sign needs to be quoted!
|
||||
Example: --mail=user\\\@domain.com
|
||||
-q, --quiet Be quiet
|
||||
-p, --pull Update the source BK trees before building
|
||||
-r, --revision=<rev> Export the tree as of revision <rev>
|
||||
(default is up to the latest revision)
|
||||
|
|
|
@ -204,6 +204,17 @@ if ($opt_stage == 0)
|
|||
safe_cd($host);
|
||||
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 -");
|
||||
|
||||
# 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>;
|
||||
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
|
||||
#
|
||||
|
@ -660,7 +674,10 @@ sub safe_system
|
|||
my($com,$res)=@_;
|
||||
print LOG "$com\n";
|
||||
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
|
||||
|
|
|
@ -96,7 +96,7 @@ $SI_PARAMS= <$SUPFILEDIR/StartupParameters.plist>;
|
|||
$SI_POST= <$SUPFILEDIR/StartupItem.postinstall>;
|
||||
$SI_NAME= "MySQLStartupItem";
|
||||
$SI_DIR_NAME= "MySQLCOM";
|
||||
$SI_SCRIPT= <$SUPFILEDIR/MySQL>;
|
||||
$SI_SCRIPT= <$SUPFILEDIR/MySQLCOM>;
|
||||
@RESOURCES= qw/ ReadMe.txt postinstall preinstall /;
|
||||
@LICENSES= ("$SRCBASEDIR/COPYING","$SRCBASEDIR/MySQLEULA.txt");
|
||||
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
#
|
||||
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;
|
||||
if (defined $opt_log && !$opt_dry_run)
|
||||
{
|
||||
|
@ -30,9 +33,12 @@ sub run_command
|
|||
}
|
||||
else
|
||||
{
|
||||
&logger($command);
|
||||
$command.= " >> $LOGFILE 2>&1" if defined $opt_log;
|
||||
$command.= " > /dev/null" if (!$opt_verbose && !$opt_log);
|
||||
&logger($command, 1);
|
||||
|
||||
$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");
|
||||
}
|
||||
}
|
||||
|
@ -47,6 +53,7 @@ sub abort
|
|||
{
|
||||
my $message= $_[0];
|
||||
my $messagefile;
|
||||
my $subject= "Bootstrap of $REPO failed" if $opt_mail;
|
||||
$message= "ERROR: " . $message;
|
||||
&logger($message);
|
||||
|
||||
|
|
|
@ -10,10 +10,22 @@
|
|||
# Written by Matt Wagner <matt@mysql.com>
|
||||
#
|
||||
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 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'
|
||||
|
@ -67,6 +79,9 @@ if ($opt_check)
|
|||
# Print an error message if they don't match, else print OK
|
||||
print "$checkfile: FAILED\n" if $digest ne $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
|
||||
|
@ -80,6 +95,8 @@ else
|
|||
}
|
||||
}
|
||||
|
||||
exit($EXIT);
|
||||
|
||||
|
||||
#
|
||||
# This routine generates the MD5 digest of a file
|
||||
|
|
|
@ -1727,7 +1727,7 @@ com_help(String *buffer __attribute__((unused)),
|
|||
commands[i].cmd_char, commands[i].doc);
|
||||
}
|
||||
if (connected && mysql_get_server_version(&mysql) >= 40100)
|
||||
put_info("\nFor server side help, type 'help all'\n", INFO_INFO);
|
||||
put_info("\nFor server side help, type 'help contents'\n", INFO_INFO);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -224,7 +224,6 @@ Q_ENABLE_QUERY_LOG, Q_DISABLE_QUERY_LOG,
|
|||
Q_ENABLE_RESULT_LOG, Q_DISABLE_RESULT_LOG,
|
||||
Q_SERVER_START, Q_SERVER_STOP,Q_REQUIRE_MANAGER,
|
||||
Q_WAIT_FOR_SLAVE_TO_STOP,
|
||||
Q_REQUIRE_VERSION, Q_REQUIRE_OS,
|
||||
Q_ENABLE_WARNINGS, Q_DISABLE_WARNINGS,
|
||||
Q_ENABLE_INFO, Q_DISABLE_INFO,
|
||||
Q_ENABLE_METADATA, Q_DISABLE_METADATA,
|
||||
|
@ -297,8 +296,6 @@ const char *command_names[]=
|
|||
"server_stop",
|
||||
"require_manager",
|
||||
"wait_for_slave_to_stop",
|
||||
"require_version",
|
||||
"require_os",
|
||||
"enable_warnings",
|
||||
"disable_warnings",
|
||||
"enable_info",
|
||||
|
@ -818,63 +815,6 @@ int do_server_op(struct st_query* q,const char* op)
|
|||
}
|
||||
#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)
|
||||
{
|
||||
char* p=q->first_argument, *name;
|
||||
|
@ -1628,6 +1568,7 @@ int do_connect(struct st_query* q)
|
|||
if (opt_compress)
|
||||
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_SET_CHARSET_NAME, "latin1");
|
||||
|
||||
#ifdef HAVE_OPENSSL
|
||||
if (opt_use_ssl)
|
||||
|
@ -1910,12 +1851,6 @@ int read_query(struct st_query** q_ptr)
|
|||
q->record_file[0]= 0;
|
||||
q->require_file= 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->query_buf= q->query= 0;
|
||||
|
@ -1928,8 +1863,16 @@ int read_query(struct st_query** q_ptr)
|
|||
if (*p == '#')
|
||||
{
|
||||
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;
|
||||
p+= 2; /* To calculate first word */
|
||||
|
@ -1964,6 +1907,8 @@ int read_query(struct st_query** q_ptr)
|
|||
*p1 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
end:
|
||||
while (*p && my_isspace(charset_info, *p))
|
||||
p++;
|
||||
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)
|
||||
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_SET_CHARSET_NAME, "latin1");
|
||||
|
||||
#ifdef HAVE_OPENSSL
|
||||
if (opt_use_ssl)
|
||||
mysql_ssl_set(&cur_con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
|
||||
|
@ -2729,15 +2676,13 @@ int main(int argc, char **argv)
|
|||
case Q_DISABLE_RESULT_LOG: disable_result_log=1; break;
|
||||
case Q_ENABLE_WARNINGS: disable_warnings=0; break;
|
||||
case Q_DISABLE_WARNINGS: disable_warnings=1; break;
|
||||
case Q_ENABLE_INFO: disable_info=0; break;
|
||||
case Q_DISABLE_INFO: disable_info=1; break;
|
||||
case Q_ENABLE_INFO: disable_info=0; break;
|
||||
case Q_DISABLE_INFO: disable_info=1; break;
|
||||
case Q_ENABLE_METADATA: display_metadata=1; break;
|
||||
case Q_DISABLE_METADATA: display_metadata=0; break;
|
||||
case Q_DISABLE_METADATA: display_metadata=0; break;
|
||||
case Q_SOURCE: do_source(q); break;
|
||||
case Q_SLEEP: do_sleep(q, 0); 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_REQUIRE_MANAGER: do_require_manager(q); break;
|
||||
#ifndef EMBEDDED_LIBRARY
|
||||
|
|
|
@ -348,6 +348,9 @@ inline double ulonglong2double(ulonglong value)
|
|||
#define MYSQL_DEFAULT_CHARSET_NAME "latin1"
|
||||
#define MYSQL_DEFAULT_COLLATION_NAME "latin1_swedish_ci"
|
||||
|
||||
#define HAVE_SPATIAL 1
|
||||
#define HAVE_RTREE_KEYS 1
|
||||
|
||||
/* Define charsets you want */
|
||||
/* #undef HAVE_CHARSET_armscii8 */
|
||||
/* #undef HAVE_CHARSET_ascii */
|
||||
|
|
|
@ -16,10 +16,17 @@
|
|||
|
||||
C_MODE_START
|
||||
|
||||
enum get_opt_var_type { GET_NO_ARG, GET_BOOL, GET_INT, GET_UINT, GET_LONG,
|
||||
GET_ULONG, GET_LL, GET_ULL, GET_STR, GET_STR_ALLOC,
|
||||
GET_DISABLED
|
||||
};
|
||||
#define GET_NO_ARG 1
|
||||
#define GET_BOOL 2
|
||||
#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_TYPE_MASK 127
|
||||
|
@ -34,7 +41,7 @@ struct my_option
|
|||
gptr *value; /* The variable value */
|
||||
gptr *u_max_value; /* The user def. max variable value */
|
||||
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;
|
||||
longlong def_value; /* Default value */
|
||||
longlong min_value; /* Min allowed value */
|
||||
|
|
|
@ -120,26 +120,6 @@
|
|||
#define __STDC_EXT__ 1 /* To get large file support on hpux */
|
||||
#endif
|
||||
|
||||
#ifdef HPUX11
|
||||
/*
|
||||
Fix warnings on HPUX11
|
||||
There is something really strange with HPUX11 include files as you get
|
||||
error about wrongly declared symbols or missing defines if you don't
|
||||
do the following:
|
||||
*/
|
||||
#if !defined(_XOPEN_SOURCE_EXTENDED) && ! defined(__cplusplus)
|
||||
#define _XOPEN_SOURCE_EXTENDED 1
|
||||
#endif
|
||||
|
||||
/* Fix type of socklen as this is depending on the above define */
|
||||
#undef SOCKET_SIZE_TYPE
|
||||
#ifdef _XOPEN_SOURCE_EXTENDED
|
||||
#define SOCKET_SIZE_TYPE socklen_t
|
||||
#else
|
||||
#define SOCKET_SIZE_TYPE int
|
||||
#endif /* _XOPEN_SOURCE_EXTENDED */
|
||||
#endif /* HPUX11 */
|
||||
|
||||
#if defined(THREAD) && !defined(__WIN__) && !defined(OS2)
|
||||
#ifndef _POSIX_PTHREAD_SEMANTICS
|
||||
#define _POSIX_PTHREAD_SEMANTICS /* We want posix threads */
|
||||
|
@ -213,7 +193,11 @@ C_MODE_END
|
|||
|
||||
/* Fix problem when linking c++ programs with gcc 3.x */
|
||||
#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
|
||||
#define FIX_GCC_LINKING_PROBLEM
|
||||
#endif
|
||||
|
|
|
@ -316,4 +316,5 @@
|
|||
#define ER_GET_TEMPORARY_ERRMSG 1297
|
||||
#define ER_UNKNOWN_TIME_ZONE 1298
|
||||
#define ER_WARN_INVALID_TIMESTAMP 1299
|
||||
#define ER_ERROR_MESSAGES 300
|
||||
#define ER_INVALID_CHARACTER_STRING 1300
|
||||
#define ER_ERROR_MESSAGES 301
|
||||
|
|
|
@ -129,6 +129,18 @@ EXPORTS
|
|||
mysql_stmt_prepare
|
||||
mysql_stmt_init
|
||||
mysql_stmt_insert_id
|
||||
mysql_stmt_attr_get
|
||||
mysql_stmt_attr_set
|
||||
mysql_stmt_attr_get
|
||||
mysql_stmt_attr_set
|
||||
mysql_stmt_field_count
|
||||
client_errors
|
||||
mysql_set_local_infile_default
|
||||
mysql_set_local_infile_handler
|
||||
mysql_disable_reads_from_master
|
||||
mysql_disable_rpl_parse
|
||||
mysql_enable_reads_from_master
|
||||
mysql_enable_rpl_parse
|
||||
mysql_master_query
|
||||
mysql_rpl_parse_enabled
|
||||
mysql_rpl_probe
|
||||
mysql_rpl_query_type
|
||||
mysql_slave_query
|
||||
|
|
|
@ -1,9 +1,23 @@
|
|||
############### include/ps_create.inc ##################
|
||||
# #
|
||||
# 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
|
||||
drop table if exists t1, t_many_col_types ;
|
||||
--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
|
||||
select '------ delete tests ------' as test_sequence ;
|
||||
--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
|
||||
set @duplicate='duplicate ' ;
|
||||
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.
|
||||
# Such tests should be done in include/ps_modify.inc
|
||||
#
|
||||
# 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 (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
|
||||
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 ."
|
||||
exit 1
|
||||
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_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-safemalloc --skip-bdb"
|
||||
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_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"
|
||||
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"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -x $exec_mgmtsrv ]; then
|
||||
if [ ! -x $exec_mgmtsrvr ]; then
|
||||
echo "$exec_mgmtsrvr missing"
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
@ -123,7 +123,7 @@ grant all on mysqltest.t1 to mysqltest_1@localhost;
|
|||
alter table t1 rename t2;
|
||||
ERROR 42000: insert command denied to user 'mysqltest_1'@'localhost' for table 't2'
|
||||
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;
|
||||
create table t1 (n1 int not null, n2 int, n3 int, n4 float,
|
||||
unique(n1),
|
||||
|
|
|
@ -38,7 +38,7 @@ time_zone_transition_type
|
|||
user
|
||||
show tables;
|
||||
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;
|
||||
set password=old_password('gambling3');
|
||||
show tables;
|
||||
|
@ -60,5 +60,5 @@ time_zone_transition_type
|
|||
user
|
||||
show tables;
|
||||
Tables_in_test
|
||||
delete from mysql.user where user="test";
|
||||
delete from mysql.user where user=_binary"test";
|
||||
flush privileges;
|
||||
|
|
|
@ -1,15 +1,37 @@
|
|||
SET @@character_set_server=latin5;
|
||||
CREATE DATABASE db1 DEFAULT CHARACTER SET cp1251;
|
||||
USE db1;
|
||||
CREATE DATABASE db2;
|
||||
SHOW CREATE DATABASE db1;
|
||||
CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET cp1251;
|
||||
USE mysqltest1;
|
||||
CREATE DATABASE mysqltest2;
|
||||
SHOW CREATE DATABASE mysqltest1;
|
||||
Database Create Database
|
||||
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET cp1251 */
|
||||
SHOW CREATE DATABASE db2;
|
||||
mysqltest1 CREATE DATABASE `mysqltest1` /*!40100 DEFAULT CHARACTER SET cp1251 */
|
||||
SHOW CREATE DATABASE mysqltest2;
|
||||
Database Create Database
|
||||
db2 CREATE DATABASE `db2` /*!40100 DEFAULT CHARACTER SET latin5 */
|
||||
DROP DATABASE db2;
|
||||
USE db1;
|
||||
mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin5 */
|
||||
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=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));
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
|
@ -32,4 +54,4 @@ t1 CREATE TABLE `t1` (
|
|||
`a` char(10) collate latin1_german1_ci default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci
|
||||
DROP TABLE t1;
|
||||
DROP DATABASE db1;
|
||||
DROP DATABASE mysqltest1;
|
||||
|
|
|
@ -111,3 +111,34 @@ SET character_set_connection=cp1251;
|
|||
SELECT hex('ÔÅÓÔ');
|
||||
hex('ÔÅÓÔ')
|
||||
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))));
|
||||
hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235))))
|
||||
27E0E3E6E7E8EAEB27
|
||||
select unhex(hex("foobar")), hex(unhex("1234567890ABCDEF")), unhex("345678");
|
||||
unhex(hex("foobar")) hex(unhex("1234567890ABCDEF")) unhex("345678")
|
||||
foobar 1234567890ABCDEF 4Vx
|
||||
select unhex(hex("foobar")), hex(unhex("1234567890ABCDEF")), unhex("345678"), unhex(NULL);
|
||||
unhex(hex("foobar")) hex(unhex("1234567890ABCDEF")) unhex("345678") unhex(NULL)
|
||||
foobar 1234567890ABCDEF 4Vx NULL
|
||||
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"))
|
||||
01 12 0123 1234 012345 123456
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
drop table if exists t1;
|
||||
SET NAMES binary;
|
||||
delete from mysql.user where user='mysqltest_1';
|
||||
delete from mysql.db where user='mysqltest_1';
|
||||
flush privileges;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
SET NAMES binary;
|
||||
delete from mysql.user where user like 'mysqltest\_%';
|
||||
delete from mysql.db where user like 'mysqltest\_%';
|
||||
flush privileges;
|
||||
|
|
|
@ -198,6 +198,7 @@ Qcache_hits 8
|
|||
show status like "Qcache_not_cached";
|
||||
Variable_name Value
|
||||
Qcache_not_cached 8
|
||||
set names binary;
|
||||
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.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;
|
||||
revoke all privileges on mysqltest.t1 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;
|
||||
create table t1 (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;
|
||||
a b c
|
||||
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
|
||||
19 4 0
|
||||
17 4 4
|
||||
19 4 0
|
||||
select * from t1 where b<=4 and c<=5 order by a;
|
||||
a b c
|
||||
7 2 1
|
||||
|
|
|
@ -389,12 +389,12 @@ where @arg01 = first.b or first.a = second.a or second.b = @arg02;
|
|||
a @arg00 a
|
||||
1 ABC 1
|
||||
2 ABC 1
|
||||
3 ABC 1
|
||||
4 ABC 1
|
||||
2 ABC 2
|
||||
2 ABC 3
|
||||
2 ABC 4
|
||||
3 ABC 1
|
||||
3 ABC 3
|
||||
4 ABC 1
|
||||
2 ABC 4
|
||||
4 ABC 4
|
||||
prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
|
||||
where ? = first.b or first.a = second.a or second.b = ? ';
|
||||
|
@ -402,12 +402,12 @@ execute stmt1 using @arg00, @arg01, @arg02;
|
|||
a ? a
|
||||
1 ABC 1
|
||||
2 ABC 1
|
||||
3 ABC 1
|
||||
4 ABC 1
|
||||
2 ABC 2
|
||||
2 ABC 3
|
||||
2 ABC 4
|
||||
3 ABC 1
|
||||
3 ABC 3
|
||||
4 ABC 1
|
||||
2 ABC 4
|
||||
4 ABC 4
|
||||
test_sequence
|
||||
------ 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
|
||||
scalar_s exists_s in_s in_row_s
|
||||
2.0000 0 1 0
|
||||
2.0000 0 1 0
|
||||
18.0000 1 0 1
|
||||
2.0000 0 1 0
|
||||
18.0000 1 0 1
|
||||
execute stmt1 ;
|
||||
scalar_s exists_s in_s in_row_s
|
||||
2.0000 0 1 0
|
||||
2.0000 0 1 0
|
||||
18.0000 1 0 1
|
||||
2.0000 0 1 0
|
||||
18.0000 1 0 1
|
||||
set @stmt= concat('explain ',@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 Extra 253 255 44 N 1 31 63
|
||||
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 Using where
|
||||
1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3
|
||||
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
|
||||
6 DERIVED t2 ALL NULL NULL NULL NULL 2
|
||||
5 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
|
||||
execute stmt1 ;
|
||||
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 Using where
|
||||
1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3
|
||||
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
|
||||
6 DERIVED t2 ALL NULL NULL NULL NULL 2
|
||||
5 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
|
||||
scalar_s exists_s in_s in_row_s
|
||||
2 0 1 0
|
||||
2 0 1 0
|
||||
18 1 0 1
|
||||
2 0 1 0
|
||||
18 1 0 1
|
||||
execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06,
|
||||
@arg07, @arg08, @arg09 ;
|
||||
scalar_s exists_s in_s in_row_s
|
||||
2 0 1 0
|
||||
2 0 1 0
|
||||
18 1 0 1
|
||||
2 0 1 0
|
||||
18 1 0 1
|
||||
set @stmt= concat('explain ',@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 Extra 253 255 44 N 1 31 63
|
||||
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 Using where
|
||||
1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3
|
||||
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
|
||||
6 DERIVED t2 ALL NULL NULL NULL NULL 2
|
||||
5 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,
|
||||
@arg07, @arg08, @arg09 ;
|
||||
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 Using where
|
||||
1 PRIMARY t_many_col_types ALL NULL NULL NULL NULL 3
|
||||
1 PRIMARY <derived6> ALL NULL NULL NULL NULL 2 Using where
|
||||
6 DERIVED t2 ALL NULL NULL NULL NULL 2
|
||||
5 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
|
||||
1 ABC 1
|
||||
2 ABC 1
|
||||
3 ABC 1
|
||||
4 ABC 1
|
||||
2 ABC 2
|
||||
2 ABC 3
|
||||
2 ABC 4
|
||||
3 ABC 1
|
||||
3 ABC 3
|
||||
4 ABC 1
|
||||
2 ABC 4
|
||||
4 ABC 4
|
||||
prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
|
||||
where ? = first.b or first.a = second.a or second.b = ? ';
|
||||
|
@ -445,12 +445,12 @@ execute stmt1 using @arg00, @arg01, @arg02;
|
|||
a ? a
|
||||
1 ABC 1
|
||||
2 ABC 1
|
||||
3 ABC 1
|
||||
4 ABC 1
|
||||
2 ABC 2
|
||||
2 ABC 3
|
||||
2 ABC 4
|
||||
3 ABC 1
|
||||
3 ABC 3
|
||||
4 ABC 1
|
||||
2 ABC 4
|
||||
4 ABC 4
|
||||
test_sequence
|
||||
------ subquery tests ------
|
||||
|
@ -1615,12 +1615,12 @@ where @arg01 = first.b or first.a = second.a or second.b = @arg02;
|
|||
a @arg00 a
|
||||
1 ABC 1
|
||||
2 ABC 1
|
||||
3 ABC 1
|
||||
4 ABC 1
|
||||
2 ABC 2
|
||||
2 ABC 3
|
||||
2 ABC 4
|
||||
3 ABC 1
|
||||
3 ABC 3
|
||||
4 ABC 1
|
||||
2 ABC 4
|
||||
4 ABC 4
|
||||
prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
|
||||
where ? = first.b or first.a = second.a or second.b = ? ';
|
||||
|
@ -1628,12 +1628,12 @@ execute stmt1 using @arg00, @arg01, @arg02;
|
|||
a ? a
|
||||
1 ABC 1
|
||||
2 ABC 1
|
||||
3 ABC 1
|
||||
4 ABC 1
|
||||
2 ABC 2
|
||||
2 ABC 3
|
||||
2 ABC 4
|
||||
3 ABC 1
|
||||
3 ABC 3
|
||||
4 ABC 1
|
||||
2 ABC 4
|
||||
4 ABC 4
|
||||
test_sequence
|
||||
------ subquery tests ------
|
||||
|
|
|
@ -389,12 +389,12 @@ where @arg01 = first.b or first.a = second.a or second.b = @arg02;
|
|||
a @arg00 a
|
||||
1 ABC 1
|
||||
2 ABC 1
|
||||
3 ABC 1
|
||||
4 ABC 1
|
||||
2 ABC 2
|
||||
2 ABC 3
|
||||
2 ABC 4
|
||||
3 ABC 1
|
||||
3 ABC 3
|
||||
4 ABC 1
|
||||
2 ABC 4
|
||||
4 ABC 4
|
||||
prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second
|
||||
where ? = first.b or first.a = second.a or second.b = ? ';
|
||||
|
@ -402,12 +402,12 @@ execute stmt1 using @arg00, @arg01, @arg02;
|
|||
a ? a
|
||||
1 ABC 1
|
||||
2 ABC 1
|
||||
3 ABC 1
|
||||
4 ABC 1
|
||||
2 ABC 2
|
||||
2 ABC 3
|
||||
2 ABC 4
|
||||
3 ABC 1
|
||||
3 ABC 3
|
||||
4 ABC 1
|
||||
2 ABC 4
|
||||
4 ABC 4
|
||||
test_sequence
|
||||
------ subquery tests ------
|
||||
|
|
|
@ -76,17 +76,17 @@ create table t1 (n int);
|
|||
insert into t1 values(3456);
|
||||
insert into mysql.user (Host, User, Password)
|
||||
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
|
||||
N blafasel2
|
||||
update mysql.user set Select_priv = "Y" where User="blafasel2";
|
||||
select select_priv,user from mysql.user where user = 'blafasel2';
|
||||
update mysql.user set Select_priv = "Y" where User= _binary"blafasel2";
|
||||
select select_priv,user from mysql.user where user = _binary'blafasel2';
|
||||
select_priv user
|
||||
Y blafasel2
|
||||
select n from t1;
|
||||
n
|
||||
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
|
||||
Y blafasel2
|
||||
drop table t1;
|
||||
|
|
|
@ -25,19 +25,19 @@ test2 CREATE DATABASE `test2` /*!40100 DEFAULT CHARACTER SET latin2 */
|
|||
show create database test3;
|
||||
Database Create Database
|
||||
test3 CREATE DATABASE `test3` /*!40100 DEFAULT CHARACTER SET latin5 */
|
||||
set @@collation_server=armscii_bin;
|
||||
set @@collation_server=armscii8_bin;
|
||||
drop database test3;
|
||||
create database test3;
|
||||
|
||||
--- --master--
|
||||
show create database test3;
|
||||
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--
|
||||
show create database test3;
|
||||
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;
|
||||
create table t1 (a int auto_increment primary key, b varchar(100));
|
||||
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;
|
||||
a b
|
||||
1 armscii8
|
||||
2 armscii_bin
|
||||
2 armscii8_bin
|
||||
3 cp850
|
||||
4 latin2
|
||||
5 latin2_croatian_ci
|
||||
|
@ -60,7 +60,7 @@ a b
|
|||
select * from test2.t1 order by a;
|
||||
a b
|
||||
1 armscii8
|
||||
2 armscii_bin
|
||||
2 armscii8_bin
|
||||
3 cp850
|
||||
4 latin2
|
||||
5 latin2_croatian_ci
|
||||
|
|
|
@ -4,11 +4,11 @@ reset master;
|
|||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
delete from mysql.user where user='rpl_do_grant';
|
||||
delete from mysql.db where user='rpl_do_grant';
|
||||
delete from mysql.user where user=_binary'rpl_do_grant';
|
||||
delete from mysql.db where user=_binary'rpl_do_grant';
|
||||
flush privileges;
|
||||
delete from mysql.user where user='rpl_ignore_grant';
|
||||
delete from mysql.db where user='rpl_ignore_grant';
|
||||
delete from mysql.user where user=_binary'rpl_ignore_grant';
|
||||
delete from mysql.db where user=_binary'rpl_ignore_grant';
|
||||
flush privileges;
|
||||
grant select on *.* 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 DROP ON `test`.* TO 'rpl_do_grant'@'localhost'
|
||||
set password for rpl_do_grant@localhost=password("does it work?");
|
||||
select password<>'' from mysql.user where user='rpl_do_grant';
|
||||
password<>''
|
||||
select password<>_binary'' from mysql.user where user=_binary'rpl_do_grant';
|
||||
password<>_binary''
|
||||
1
|
||||
delete from mysql.user where user='rpl_do_grant';
|
||||
delete from mysql.db where user='rpl_do_grant';
|
||||
delete from mysql.user where user=_binary'rpl_do_grant';
|
||||
delete from mysql.db where user=_binary'rpl_do_grant';
|
||||
flush privileges;
|
||||
flush privileges;
|
||||
|
|
|
@ -4,11 +4,11 @@ reset master;
|
|||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
delete from mysql.user where user='rpl_ignore_grant';
|
||||
delete from mysql.db where user='rpl_ignore_grant';
|
||||
delete from mysql.user where user=_binary'rpl_ignore_grant';
|
||||
delete from mysql.db where user=_binary'rpl_ignore_grant';
|
||||
flush privileges;
|
||||
delete from mysql.user where user='rpl_ignore_grant';
|
||||
delete from mysql.db where user='rpl_ignore_grant';
|
||||
delete from mysql.user where user=_binary'rpl_ignore_grant';
|
||||
delete from mysql.db where user=_binary'rpl_ignore_grant';
|
||||
flush privileges;
|
||||
grant select on *.* 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'
|
||||
show grants for rpl_ignore_grant@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(*)
|
||||
0
|
||||
select count(*) from mysql.db where user='rpl_ignore_grant';
|
||||
select count(*) from mysql.db where user=_binary'rpl_ignore_grant';
|
||||
count(*)
|
||||
0
|
||||
grant select on *.* to rpl_ignore_grant@localhost;
|
||||
set password for rpl_ignore_grant@localhost=password("does it work?");
|
||||
select password<>'' from mysql.user where user='rpl_ignore_grant';
|
||||
password<>''
|
||||
select password<>_binary'' from mysql.user where user=_binary'rpl_ignore_grant';
|
||||
password<>_binary''
|
||||
0
|
||||
delete from mysql.user where user='rpl_ignore_grant';
|
||||
delete from mysql.db where user='rpl_ignore_grant';
|
||||
delete from mysql.user where user=_binary'rpl_ignore_grant';
|
||||
delete from mysql.db where user=_binary'rpl_ignore_grant';
|
||||
flush privileges;
|
||||
delete from mysql.user where user='rpl_ignore_grant';
|
||||
delete from mysql.db where user='rpl_ignore_grant';
|
||||
delete from mysql.user where user=_binary'rpl_ignore_grant';
|
||||
delete from mysql.db where user=_binary'rpl_ignore_grant';
|
||||
flush privileges;
|
||||
|
|
|
@ -395,6 +395,7 @@ show create database test_$1;
|
|||
ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'test_$1'
|
||||
drop table test_$1.t1;
|
||||
drop database test_$1;
|
||||
set names binary;
|
||||
delete from mysql.user
|
||||
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
|
||||
delete from mysql.db
|
||||
|
|
|
@ -126,3 +126,5 @@ columns_priv CREATE TABLE `columns_priv` (
|
|||
`Column_priv` set('Select','Insert','Update','References') NOT NULL default '',
|
||||
PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Column privileges'
|
||||
show tables;
|
||||
Tables_in_test
|
||||
|
|
|
@ -18,44 +18,44 @@ create table test_columns_priv select * from mysql.columns_priv;
|
|||
delete from test_columns_priv;
|
||||
insert into test_columns_priv (Host,Db,User,Table_name,Column_name) values (@name,@name,@name,@name,@name);
|
||||
select
|
||||
if(isnull(test_db.Host),'WRONG!!!','ok') as test_db_Host,
|
||||
if(isnull(test_host.Host),'WRONG!!!','ok') as test_host_Host,
|
||||
if(isnull(test_user.Host),'WRONG!!!','ok') as test_user_Host,
|
||||
if(isnull(test_tables_priv.Host),'WRONG!!!','ok') as test_tables_priv_Host,
|
||||
if(isnull(test_columns_priv.Host),'WRONG!!!','ok') as test_columns_priv_Host
|
||||
from test_db
|
||||
left join test_host on test_db.Host=test_host.Host
|
||||
left join test_user on test_db.Host=test_user.Host
|
||||
left join test_tables_priv on test_db.Host=test_tables_priv.Host
|
||||
if(isnull(test_db.Host),'WRONG!!!','ok') as test_db_Host,
|
||||
if(isnull(test_host.Host),'WRONG!!!','ok') as test_host_Host,
|
||||
if(isnull(test_user.Host),'WRONG!!!','ok') as test_user_Host,
|
||||
if(isnull(test_tables_priv.Host),'WRONG!!!','ok') as test_tables_priv_Host,
|
||||
if(isnull(test_columns_priv.Host),'WRONG!!!','ok') as test_columns_priv_Host
|
||||
from test_db
|
||||
left join test_host on test_db.Host=test_host.Host
|
||||
left join test_user on test_db.Host=test_user.Host
|
||||
left join test_tables_priv on test_db.Host=test_tables_priv.Host
|
||||
left join test_columns_priv on test_db.Host=test_columns_priv.Host;
|
||||
test_db_Host test_host_Host test_user_Host test_tables_priv_Host test_columns_priv_Host
|
||||
ok ok ok ok ok
|
||||
select
|
||||
if(isnull(test_db.Db),'WRONG!!!','ok') as test_db_Db,
|
||||
if(isnull(test_host.Db),'WRONG!!!','ok') as test_host_Db,
|
||||
if(isnull(test_tables_priv.Db),'WRONG!!!','ok') as test_tables_priv_Db,
|
||||
if(isnull(test_columns_priv.Db),'WRONG!!!','ok') as est_columns_priv_Db
|
||||
from test_db
|
||||
left join test_host on test_db.Db=test_host.Db
|
||||
left join test_tables_priv on test_db.Db=test_tables_priv.Db
|
||||
if(isnull(test_db.Db),'WRONG!!!','ok') as test_db_Db,
|
||||
if(isnull(test_host.Db),'WRONG!!!','ok') as test_host_Db,
|
||||
if(isnull(test_tables_priv.Db),'WRONG!!!','ok') as test_tables_priv_Db,
|
||||
if(isnull(test_columns_priv.Db),'WRONG!!!','ok') as est_columns_priv_Db
|
||||
from test_db
|
||||
left join test_host on test_db.Db=test_host.Db
|
||||
left join test_tables_priv on test_db.Db=test_tables_priv.Db
|
||||
left join test_columns_priv on test_db.Db=test_columns_priv.Db;
|
||||
test_db_Db test_host_Db test_tables_priv_Db est_columns_priv_Db
|
||||
ok ok ok ok
|
||||
select
|
||||
if(isnull(test_db.User),'WRONG!!!','ok') as test_db_User,
|
||||
if(isnull(test_user.User),'WRONG!!!','ok') as test_user_User,
|
||||
if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User,
|
||||
if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User
|
||||
from test_db
|
||||
left join test_user on test_db.User=test_user.User
|
||||
left join test_tables_priv on test_db.User=test_tables_priv.User
|
||||
select
|
||||
if(isnull(test_db.User),'WRONG!!!','ok') as test_db_User,
|
||||
if(isnull(test_user.User),'WRONG!!!','ok') as test_user_User,
|
||||
if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User,
|
||||
if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User
|
||||
from test_db
|
||||
left join test_user on test_db.User=test_user.User
|
||||
left join test_tables_priv on test_db.User=test_tables_priv.User
|
||||
left join test_columns_priv on test_db.User=test_columns_priv.User;
|
||||
test_db_User test_user_User test_tables_priv_User test_columns_priv_User
|
||||
ok ok ok ok
|
||||
select
|
||||
if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User,
|
||||
if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User
|
||||
from test_tables_priv
|
||||
select
|
||||
if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User,
|
||||
if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User
|
||||
from test_tables_priv
|
||||
left join test_columns_priv on test_tables_priv.Table_name=test_columns_priv.Table_name;
|
||||
test_tables_priv_User test_columns_priv_User
|
||||
ok ok
|
||||
|
|
|
@ -123,7 +123,7 @@ connection user1;
|
|||
alter table t1 rename t2;
|
||||
connection root;
|
||||
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;
|
||||
|
||||
#
|
||||
|
|
|
@ -42,7 +42,7 @@ show tables;
|
|||
|
||||
|
||||
# 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;
|
||||
|
||||
#connect (con1,localhost,test,gambling2,"");
|
||||
|
@ -68,5 +68,5 @@ show tables;
|
|||
# remove user 'test' so that other tests which may use 'test'
|
||||
# do not depend on this test.
|
||||
|
||||
delete from mysql.user where user="test";
|
||||
delete from mysql.user where user=_binary"test";
|
||||
flush privileges;
|
||||
|
|
|
@ -13,25 +13,48 @@
|
|||
|
||||
|
||||
SET @@character_set_server=latin5;
|
||||
CREATE DATABASE db1 DEFAULT CHARACTER SET cp1251;
|
||||
USE db1;
|
||||
CREATE DATABASE db2;
|
||||
CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET cp1251;
|
||||
USE mysqltest1;
|
||||
CREATE DATABASE mysqltest2;
|
||||
|
||||
#
|
||||
# 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;
|
||||
DROP DATABASE db2;
|
||||
SHOW CREATE DATABASE mysqltest2;
|
||||
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
|
||||
#
|
||||
USE db1;
|
||||
USE mysqltest1;
|
||||
CREATE TABLE t1 (a char(10));
|
||||
SHOW CREATE 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('ÔÅÓÔ');
|
||||
SET character_set_connection=cp1251;
|
||||
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_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_roman_ci;
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ select quote(concat('abc\'', '\\cba'));
|
|||
select quote(1/0), quote('\0\Z');
|
||||
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 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 length(unhex(md5("abrakadabra")));
|
||||
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
SET NAMES binary;
|
||||
|
||||
#
|
||||
# Test that SSL options works properly
|
||||
#
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
SET NAMES binary;
|
||||
|
||||
#
|
||||
# GRANT tests that require several connections
|
||||
# (usually it's GRANT, reconnect as another user, try something)
|
||||
|
|
|
@ -126,6 +126,15 @@ show status like "Qcache_not_cached";
|
|||
# Cleanup
|
||||
|
||||
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.db 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;
|
||||
revoke all privileges on mysqltest.t1 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;
|
||||
|
||||
#
|
||||
|
|
|
@ -106,7 +106,7 @@ select * from t1 where b<=5 order by a;
|
|||
select * from t1 where b<=5 and c=0;
|
||||
insert into t1 values (19,4, 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<=5 and c=0 or b<=5 and c=2;
|
||||
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;
|
||||
--disable_query_log
|
||||
|
@ -375,7 +369,6 @@ revoke all privileges on test.t1 from drop_user@localhost ;
|
|||
--error 1295
|
||||
prepare stmt3 from ' drop user drop_user@localhost ';
|
||||
drop user drop_user@localhost;
|
||||
--error 1141
|
||||
|
||||
#### table related commands
|
||||
## describe
|
||||
|
@ -737,3 +730,101 @@ execute stmt1 using
|
|||
@arg60, @arg61 ;
|
||||
|
||||
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;
|
||||
|
||||
let $type= 'MYISAM' ;
|
||||
|
|
|
@ -4,8 +4,14 @@
|
|||
# #
|
||||
###############################################
|
||||
|
||||
#
|
||||
# NOTE: PLEASE SEE ps_1general.test (bottom)
|
||||
# BEFORE ADDING NEW TEST CASES HERE !!!
|
||||
|
||||
use test;
|
||||
|
||||
-- source include/have_innodb.inc
|
||||
|
||||
let $type= 'InnoDB' ;
|
||||
-- source include/ps_create.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;
|
||||
|
||||
let $type= 'HEAP' ;
|
||||
|
@ -19,7 +23,8 @@ eval create table t1
|
|||
--disable_warnings
|
||||
drop table if exists t_many_col_types;
|
||||
--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.
|
||||
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;
|
||||
|
||||
--disable_warnings
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
# #
|
||||
###############################################
|
||||
|
||||
#
|
||||
# NOTE: PLEASE SEE ps_1general.test (bottom)
|
||||
# BEFORE ADDING NEW TEST CASES HERE !!!
|
||||
|
||||
use test;
|
||||
|
||||
-- source include/have_bdb.inc
|
||||
|
|
|
@ -110,14 +110,14 @@ create table t1 (n int);
|
|||
insert into t1 values(3456);
|
||||
insert into mysql.user (Host, User, Password)
|
||||
VALUES ("10.10.10.%", "blafasel2", password("blafasel2"));
|
||||
select select_priv,user from mysql.user where user = 'blafasel2';
|
||||
update mysql.user set Select_priv = "Y" where User="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= _binary"blafasel2";
|
||||
select select_priv,user from mysql.user where user = _binary'blafasel2';
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
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;
|
||||
drop table t1;
|
||||
save_master_pos;
|
||||
|
|
|
@ -26,7 +26,7 @@ show create database test2;
|
|||
show create database test3;
|
||||
|
||||
connection master;
|
||||
set @@collation_server=armscii_bin;
|
||||
set @@collation_server=armscii8_bin;
|
||||
drop database test3;
|
||||
create database test3;
|
||||
--disable_query_log
|
||||
|
|
|
@ -4,16 +4,16 @@ source include/master-slave.inc;
|
|||
|
||||
# do not be influenced by other tests.
|
||||
connection master;
|
||||
delete from mysql.user where user='rpl_do_grant';
|
||||
delete from mysql.db where user='rpl_do_grant';
|
||||
delete from mysql.user where user=_binary'rpl_do_grant';
|
||||
delete from mysql.db where user=_binary'rpl_do_grant';
|
||||
flush privileges;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
# if these DELETE did nothing on the master, we need to do them manually on the
|
||||
# slave.
|
||||
delete from mysql.user where user='rpl_ignore_grant';
|
||||
delete from mysql.db where user='rpl_ignore_grant';
|
||||
delete from mysql.user where user=_binary'rpl_ignore_grant';
|
||||
delete from mysql.db where user=_binary'rpl_ignore_grant';
|
||||
flush privileges;
|
||||
|
||||
# test replication of GRANT
|
||||
|
@ -31,12 +31,12 @@ set password for rpl_do_grant@localhost=password("does it work?");
|
|||
save_master_pos;
|
||||
connection slave;
|
||||
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.
|
||||
connection master;
|
||||
delete from mysql.user where user='rpl_do_grant';
|
||||
delete from mysql.db where user='rpl_do_grant';
|
||||
delete from mysql.user where user=_binary'rpl_do_grant';
|
||||
delete from mysql.db where user=_binary'rpl_do_grant';
|
||||
flush privileges;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
|
|
|
@ -6,16 +6,16 @@ source include/master-slave.inc;
|
|||
|
||||
# do not be influenced by other tests.
|
||||
connection master;
|
||||
delete from mysql.user where user='rpl_ignore_grant';
|
||||
delete from mysql.db where user='rpl_ignore_grant';
|
||||
delete from mysql.user where user=_binary'rpl_ignore_grant';
|
||||
delete from mysql.db where user=_binary'rpl_ignore_grant';
|
||||
flush privileges;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
# as these DELETE were not replicated, we need to do them manually on the
|
||||
# slave.
|
||||
delete from mysql.user where user='rpl_ignore_grant';
|
||||
delete from mysql.db where user='rpl_ignore_grant';
|
||||
delete from mysql.user where user=_binary'rpl_ignore_grant';
|
||||
delete from mysql.db where user=_binary'rpl_ignore_grant';
|
||||
flush privileges;
|
||||
|
||||
# test non-replication of GRANT
|
||||
|
@ -29,8 +29,8 @@ sync_with_master;
|
|||
--error 1141 #("no such grant for user")
|
||||
show grants for rpl_ignore_grant@localhost;
|
||||
# check it another way
|
||||
select count(*) from mysql.user where user='rpl_ignore_grant';
|
||||
select count(*) from mysql.db where user='rpl_ignore_grant';
|
||||
select count(*) from mysql.user where user=_binary'rpl_ignore_grant';
|
||||
select count(*) from mysql.db where user=_binary'rpl_ignore_grant';
|
||||
|
||||
# test non-replication of SET PASSWORD
|
||||
# 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;
|
||||
connection slave;
|
||||
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.
|
||||
connection master;
|
||||
delete from mysql.user where user='rpl_ignore_grant';
|
||||
delete from mysql.db where user='rpl_ignore_grant';
|
||||
delete from mysql.user where user=_binary'rpl_ignore_grant';
|
||||
delete from mysql.db where user=_binary'rpl_ignore_grant';
|
||||
flush privileges;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
delete from mysql.user where user='rpl_ignore_grant';
|
||||
delete from mysql.db where user='rpl_ignore_grant';
|
||||
delete from mysql.user where user=_binary'rpl_ignore_grant';
|
||||
delete from mysql.db where user=_binary'rpl_ignore_grant';
|
||||
flush privileges;
|
||||
|
|
|
@ -299,6 +299,7 @@ drop table test_$1.t1;
|
|||
drop database test_$1;
|
||||
|
||||
connection default;
|
||||
set names binary;
|
||||
delete from mysql.user
|
||||
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
|
||||
delete from mysql.db
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
#
|
||||
# This test must examine integrity of system database "mysql"
|
||||
#
|
||||
|
||||
-- disable_query_log
|
||||
use mysql;
|
||||
-- enable_query_log
|
||||
-- source include/system_db_struct.inc
|
||||
#
|
||||
# This test must examine integrity of system database "mysql"
|
||||
#
|
||||
|
||||
-- disable_query_log
|
||||
use mysql;
|
||||
-- enable_query_log
|
||||
-- source include/system_db_struct.inc
|
||||
-- disable_query_log
|
||||
use test;
|
||||
-- enable_query_log
|
||||
# keep results same with system_mysql_db_fix
|
||||
show tables;
|
||||
|
|
|
@ -1,83 +1,76 @@
|
|||
#
|
||||
#
|
||||
# This is the test for mysql_fix_privilege_tables
|
||||
#
|
||||
#
|
||||
|
||||
-- disable_result_log
|
||||
-- disable_query_log
|
||||
|
||||
use test;
|
||||
|
||||
# create system tables as in mysql-3.20
|
||||
|
||||
CREATE TABLE db (
|
||||
Host char(60) binary DEFAULT '' NOT NULL,
|
||||
Db char(32) binary DEFAULT '' NOT NULL,
|
||||
User char(16) binary DEFAULT '' NOT NULL,
|
||||
Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
PRIMARY KEY Host (Host,Db,User),
|
||||
KEY User (User)
|
||||
)
|
||||
type=ISAM;
|
||||
-- disable_result_log
|
||||
-- disable_query_log
|
||||
|
||||
INSERT INTO db VALUES ('%','test', '','Y','Y','Y','Y','Y','Y');
|
||||
INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y');
|
||||
use test;
|
||||
|
||||
CREATE TABLE host (
|
||||
Host char(60) binary DEFAULT '' NOT NULL,
|
||||
Db char(32) binary DEFAULT '' NOT NULL,
|
||||
Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
PRIMARY KEY Host (Host,Db)
|
||||
)
|
||||
type=ISAM;
|
||||
# create system tables as in mysql-3.20
|
||||
|
||||
CREATE TABLE user (
|
||||
Host char(60) binary DEFAULT '' NOT NULL,
|
||||
User char(16) binary DEFAULT '' NOT NULL,
|
||||
Password char(16),
|
||||
Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Process_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
PRIMARY KEY Host (Host,User)
|
||||
)
|
||||
type=ISAM;
|
||||
CREATE TABLE db (
|
||||
Host char(60) binary DEFAULT '' NOT NULL,
|
||||
Db char(32) binary DEFAULT '' NOT NULL,
|
||||
User char(16) binary DEFAULT '' NOT NULL,
|
||||
Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
PRIMARY KEY Host (Host,Db,User),
|
||||
KEY User (User)
|
||||
)
|
||||
type=ISAM;
|
||||
|
||||
INSERT INTO db VALUES ('%','test', '','Y','Y','Y','Y','Y','Y');
|
||||
INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y');
|
||||
|
||||
CREATE TABLE host (
|
||||
Host char(60) binary DEFAULT '' NOT NULL,
|
||||
Db char(32) binary DEFAULT '' NOT NULL,
|
||||
Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
PRIMARY KEY Host (Host,Db)
|
||||
)
|
||||
type=ISAM;
|
||||
|
||||
CREATE TABLE user (
|
||||
Host char(60) binary DEFAULT '' NOT NULL,
|
||||
User char(16) binary DEFAULT '' NOT NULL,
|
||||
Password char(16),
|
||||
Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
Process_priv enum('N','Y') DEFAULT 'N' NOT NULL,
|
||||
PRIMARY KEY Host (Host,User)
|
||||
)
|
||||
type=ISAM;
|
||||
|
||||
INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y');
|
||||
INSERT INTO user VALUES ('localhost','', '','N','N','N','N','N','N','N','N','N');
|
||||
|
||||
INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y');
|
||||
INSERT INTO user VALUES ('localhost','', '','N','N','N','N','N','N','N','N','N');
|
||||
|
||||
-- exec $MYSQL_FIX_SYSTEM_TABLES --database=test
|
||||
-- enable_query_log
|
||||
-- enable_result_log
|
||||
|
||||
-- source include/system_db_struct.inc
|
||||
|
||||
-- disable_query_log
|
||||
|
||||
DROP TABLE db;
|
||||
DROP TABLE host;
|
||||
DROP TABLE user;
|
||||
DROP TABLE func;
|
||||
DROP TABLE tables_priv;
|
||||
DROP TABLE columns_priv;
|
||||
DROP TABLE help_category;
|
||||
DROP TABLE help_keyword;
|
||||
DROP TABLE help_relation;
|
||||
DROP TABLE help_topic;
|
||||
|
||||
-- enable_query_log
|
||||
-- enable_query_log
|
||||
-- enable_result_log
|
||||
|
||||
-- source include/system_db_struct.inc
|
||||
|
||||
-- disable_query_log
|
||||
|
||||
DROP TABLE db, host, user, func, tables_priv, columns_priv, help_category, help_keyword, help_relation, help_topic, time_zone, time_zone_leap_second, time_zone_name, time_zone_transition, time_zone_transition_type;
|
||||
|
||||
-- enable_query_log
|
||||
|
||||
# check that we droped all system tables
|
||||
show tables;
|
||||
|
|
|
@ -1,102 +1,101 @@
|
|||
#
|
||||
# This test must examine integrity of current system database
|
||||
#
|
||||
|
||||
set @name="This is a very long string, that mustn't find room in a system field like Table_name. Thus it should be cut by the actual size of the field. So we can use this string to find out the actual length of the field and to use it in any compare queries";
|
||||
|
||||
#
|
||||
# If this part is wrong, most likely you've done wrong modification of system database "mysql"
|
||||
#
|
||||
|
||||
create table test_db select * from mysql.db;
|
||||
delete from test_db;
|
||||
#
|
||||
# This test must examine integrity of current system database
|
||||
#
|
||||
|
||||
set @name="This is a very long string, that mustn't find room in a system field like Table_name. Thus it should be cut by the actual size of the field. So we can use this string to find out the actual length of the field and to use it in any compare queries";
|
||||
|
||||
#
|
||||
# If this part is wrong, most likely you've done wrong modification of system database "mysql"
|
||||
#
|
||||
|
||||
create table test_db select * from mysql.db;
|
||||
delete from test_db;
|
||||
--disable_warnings
|
||||
insert into test_db (Host,Db,User) values (@name,@name,@name);
|
||||
insert into test_db (Host,Db,User) values (@name,@name,@name);
|
||||
--enable_warnings
|
||||
|
||||
create table test_host select * from mysql.host;
|
||||
delete from test_host;
|
||||
|
||||
create table test_host select * from mysql.host;
|
||||
delete from test_host;
|
||||
--disable_warnings
|
||||
insert into test_host (Host,Db) values (@name,@name);
|
||||
insert into test_host (Host,Db) values (@name,@name);
|
||||
--enable_warnings
|
||||
|
||||
create table test_user select * from mysql.user;
|
||||
delete from test_user;
|
||||
|
||||
create table test_user select * from mysql.user;
|
||||
delete from test_user;
|
||||
--disable_warnings
|
||||
insert into test_user (Host,User) values (@name,@name);
|
||||
insert into test_user (Host,User) values (@name,@name);
|
||||
--enable_warnings
|
||||
|
||||
create table test_func select * from mysql.func;
|
||||
delete from test_func;
|
||||
|
||||
create table test_func select * from mysql.func;
|
||||
delete from test_func;
|
||||
--disable_warnings
|
||||
insert into test_func (name) values (@name);
|
||||
insert into test_func (name) values (@name);
|
||||
--enable_warnings
|
||||
|
||||
create table test_tables_priv select * from mysql.tables_priv;
|
||||
delete from test_tables_priv;
|
||||
|
||||
create table test_tables_priv select * from mysql.tables_priv;
|
||||
delete from test_tables_priv;
|
||||
--disable_warnings
|
||||
insert into test_tables_priv (Host,Db,User,Table_name) values (@name,@name,@name,@name);
|
||||
insert into test_tables_priv (Host,Db,User,Table_name) values (@name,@name,@name,@name);
|
||||
--enable_warnings
|
||||
|
||||
create table test_columns_priv select * from mysql.columns_priv;
|
||||
delete from test_columns_priv;
|
||||
|
||||
create table test_columns_priv select * from mysql.columns_priv;
|
||||
delete from test_columns_priv;
|
||||
--disable_warnings
|
||||
insert into test_columns_priv (Host,Db,User,Table_name,Column_name) values (@name,@name,@name,@name,@name);
|
||||
insert into test_columns_priv (Host,Db,User,Table_name,Column_name) values (@name,@name,@name,@name,@name);
|
||||
--enable_warnings
|
||||
|
||||
# 'Host' field must be the same for all the tables:
|
||||
|
||||
|
||||
# 'Host' field must be the same for all the tables:
|
||||
|
||||
select
|
||||
if(isnull(test_db.Host),'WRONG!!!','ok') as test_db_Host,
|
||||
if(isnull(test_host.Host),'WRONG!!!','ok') as test_host_Host,
|
||||
if(isnull(test_user.Host),'WRONG!!!','ok') as test_user_Host,
|
||||
if(isnull(test_tables_priv.Host),'WRONG!!!','ok') as test_tables_priv_Host,
|
||||
if(isnull(test_columns_priv.Host),'WRONG!!!','ok') as test_columns_priv_Host
|
||||
if(isnull(test_db.Host),'WRONG!!!','ok') as test_db_Host,
|
||||
if(isnull(test_host.Host),'WRONG!!!','ok') as test_host_Host,
|
||||
if(isnull(test_user.Host),'WRONG!!!','ok') as test_user_Host,
|
||||
if(isnull(test_tables_priv.Host),'WRONG!!!','ok') as test_tables_priv_Host,
|
||||
if(isnull(test_columns_priv.Host),'WRONG!!!','ok') as test_columns_priv_Host
|
||||
|
||||
from test_db
|
||||
left join test_host on test_db.Host=test_host.Host
|
||||
left join test_user on test_db.Host=test_user.Host
|
||||
left join test_tables_priv on test_db.Host=test_tables_priv.Host
|
||||
left join test_columns_priv on test_db.Host=test_columns_priv.Host;
|
||||
|
||||
# 'Db' field must be the same for all the tables:
|
||||
|
||||
from test_db
|
||||
left join test_host on test_db.Host=test_host.Host
|
||||
left join test_user on test_db.Host=test_user.Host
|
||||
left join test_tables_priv on test_db.Host=test_tables_priv.Host
|
||||
left join test_columns_priv on test_db.Host=test_columns_priv.Host;
|
||||
|
||||
# 'Db' field must be the same for all the tables:
|
||||
|
||||
select
|
||||
if(isnull(test_db.Db),'WRONG!!!','ok') as test_db_Db,
|
||||
if(isnull(test_host.Db),'WRONG!!!','ok') as test_host_Db,
|
||||
if(isnull(test_tables_priv.Db),'WRONG!!!','ok') as test_tables_priv_Db,
|
||||
if(isnull(test_columns_priv.Db),'WRONG!!!','ok') as est_columns_priv_Db
|
||||
if(isnull(test_db.Db),'WRONG!!!','ok') as test_db_Db,
|
||||
if(isnull(test_host.Db),'WRONG!!!','ok') as test_host_Db,
|
||||
if(isnull(test_tables_priv.Db),'WRONG!!!','ok') as test_tables_priv_Db,
|
||||
if(isnull(test_columns_priv.Db),'WRONG!!!','ok') as est_columns_priv_Db
|
||||
|
||||
from test_db
|
||||
left join test_host on test_db.Db=test_host.Db
|
||||
left join test_tables_priv on test_db.Db=test_tables_priv.Db
|
||||
left join test_columns_priv on test_db.Db=test_columns_priv.Db;
|
||||
|
||||
# 'User' field must be the same for all the tables:
|
||||
|
||||
select
|
||||
if(isnull(test_db.User),'WRONG!!!','ok') as test_db_User,
|
||||
if(isnull(test_user.User),'WRONG!!!','ok') as test_user_User,
|
||||
if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User,
|
||||
if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User
|
||||
from test_db
|
||||
left join test_host on test_db.Db=test_host.Db
|
||||
left join test_tables_priv on test_db.Db=test_tables_priv.Db
|
||||
left join test_columns_priv on test_db.Db=test_columns_priv.Db;
|
||||
|
||||
from test_db
|
||||
left join test_user on test_db.User=test_user.User
|
||||
left join test_tables_priv on test_db.User=test_tables_priv.User
|
||||
left join test_columns_priv on test_db.User=test_columns_priv.User;
|
||||
|
||||
# 'Table_name' field must be the same for all the tables:
|
||||
|
||||
select
|
||||
if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User,
|
||||
if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User
|
||||
from test_tables_priv
|
||||
left join test_columns_priv on test_tables_priv.Table_name=test_columns_priv.Table_name;
|
||||
|
||||
drop table test_columns_priv;
|
||||
drop table test_tables_priv;
|
||||
drop table test_func;
|
||||
drop table test_host;
|
||||
drop table test_user;
|
||||
drop table test_db;
|
||||
# 'User' field must be the same for all the tables:
|
||||
|
||||
select
|
||||
if(isnull(test_db.User),'WRONG!!!','ok') as test_db_User,
|
||||
if(isnull(test_user.User),'WRONG!!!','ok') as test_user_User,
|
||||
if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User,
|
||||
if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User
|
||||
|
||||
from test_db
|
||||
left join test_user on test_db.User=test_user.User
|
||||
left join test_tables_priv on test_db.User=test_tables_priv.User
|
||||
left join test_columns_priv on test_db.User=test_columns_priv.User;
|
||||
|
||||
# 'Table_name' field must be the same for all the tables:
|
||||
|
||||
select
|
||||
if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User,
|
||||
if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User
|
||||
from test_tables_priv
|
||||
left join test_columns_priv on test_tables_priv.Table_name=test_columns_priv.Table_name;
|
||||
|
||||
drop table test_columns_priv;
|
||||
drop table test_tables_priv;
|
||||
drop table test_func;
|
||||
drop table test_host;
|
||||
drop table test_user;
|
||||
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_slovak_uca_ci;
|
||||
extern CHARSET_INFO my_charset_ucs2_spanish2_uca_ci;
|
||||
extern CHARSET_INFO my_charset_ucs2_roman_uca_ci;
|
||||
#endif
|
||||
|
||||
#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_slovak_uca_ci;
|
||||
extern CHARSET_INFO my_charset_utf8_spanish2_uca_ci;
|
||||
extern CHARSET_INFO my_charset_utf8_roman_uca_ci;
|
||||
#endif
|
||||
|
||||
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_slovak_uca_ci);
|
||||
add_compiled_collation(&my_charset_ucs2_spanish2_uca_ci);
|
||||
add_compiled_collation(&my_charset_ucs2_roman_uca_ci);
|
||||
#endif
|
||||
|
||||
#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_slovak_uca_ci);
|
||||
add_compiled_collation(&my_charset_utf8_spanish2_uca_ci);
|
||||
add_compiled_collation(&my_charset_utf8_roman_uca_ci);
|
||||
#endif
|
||||
|
||||
/* Copy compiled charsets */
|
||||
|
|
|
@ -127,6 +127,7 @@ void my_end(int infoflag)
|
|||
FILE *info_file;
|
||||
if (!(info_file=DBUG_FILE))
|
||||
info_file=stderr;
|
||||
DBUG_PRINT("info",("Shutting down"));
|
||||
if (infoflag & MY_CHECK_ERROR || info_file != stderr)
|
||||
{ /* Test if some file is left open */
|
||||
if (my_file_opened | my_stream_opened)
|
||||
|
|
|
@ -461,6 +461,17 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
|
|||
else
|
||||
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))
|
||||
goto error;
|
||||
|
||||
|
|
|
@ -24,8 +24,8 @@ public:
|
|||
ValueType m_type;
|
||||
union {
|
||||
Uint32 m_int;
|
||||
const char * m_string;
|
||||
Uint64 m_int64;
|
||||
const char * m_string;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -72,14 +72,14 @@ private:
|
|||
friend class ConstIterator;
|
||||
|
||||
bool getByPos(Uint32 pos, Entry *) const;
|
||||
Uint64 & get64(Uint32 index) const;
|
||||
char * & getString(Uint32 index) const;
|
||||
Uint64 * get64(Uint32 index) const;
|
||||
char ** getString(Uint32 index) const;
|
||||
|
||||
Uint32 m_size;
|
||||
Uint32 m_dataSize;
|
||||
Uint32 m_stringCount;
|
||||
Uint32 m_int64Count;
|
||||
|
||||
|
||||
Uint32 m_values[1];
|
||||
void * m_data[1];
|
||||
};
|
||||
|
|
|
@ -60,7 +60,7 @@ ConfigValues::ConfigValues(Uint32 sz, Uint32 dsz){
|
|||
|
||||
ConfigValues::~ConfigValues(){
|
||||
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;
|
||||
break;
|
||||
case StringType:
|
||||
result->m_string = getString(val);
|
||||
result->m_string = * getString(val);
|
||||
break;
|
||||
case Int64Type:
|
||||
result->m_int64 = get64(val);
|
||||
result->m_int64 = * get64(val);
|
||||
break;
|
||||
case InvalidType:
|
||||
default:
|
||||
|
@ -102,18 +102,23 @@ ConfigValues::getByPos(Uint32 pos, Entry * result) const {
|
|||
return true;
|
||||
}
|
||||
|
||||
Uint64 &
|
||||
Uint64 *
|
||||
ConfigValues::get64(Uint32 index) const {
|
||||
assert(index < m_int64Count);
|
||||
Uint64 * ptr = (Uint64*)(&m_values[m_size << 1]);
|
||||
return ptr[index];
|
||||
const Uint32 * data = m_values + (m_size << 1);
|
||||
Uint64 * ptr = (Uint64*)data;
|
||||
ptr += index;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
char * &
|
||||
char **
|
||||
ConfigValues::getString(Uint32 index) const {
|
||||
assert(index < m_stringCount);
|
||||
char ** ptr = (char**)(((char *)&(m_values[m_size << 1])) + m_dataSize);
|
||||
return ptr[-index];
|
||||
assert(index < m_stringCount);
|
||||
const Uint32 * data = m_values + (m_size << 1);
|
||||
char * ptr = (char*)data;
|
||||
ptr += m_dataSize;
|
||||
ptr -= (index * sizeof(char *));
|
||||
return (char**)ptr;
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -176,7 +181,7 @@ ConfigValues::Iterator::set(Uint32 key, Uint64 value){
|
|||
return false;
|
||||
}
|
||||
|
||||
m_cfg.get64(m_cfg.m_values[pos+1]) = value;
|
||||
* m_cfg.get64(m_cfg.m_values[pos+1]) = value;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -191,9 +196,9 @@ ConfigValues::Iterator::set(Uint32 key, const char * value){
|
|||
return false;
|
||||
}
|
||||
|
||||
char * & str = m_cfg.getString(m_cfg.m_values[pos+1]);
|
||||
free(str);
|
||||
str = strdup(value ? value : "");
|
||||
char ** str = m_cfg.getString(m_cfg.m_values[pos+1]);
|
||||
free(* str);
|
||||
* str = strdup(value ? value : "");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -457,7 +462,8 @@ ConfigValuesFactory::put(const ConfigValues::Entry & entry){
|
|||
case ConfigValues::StringType:{
|
||||
Uint32 index = m_cfg->m_stringCount++;
|
||||
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_freeData -= sizeof(char *);
|
||||
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:{
|
||||
Uint32 index = m_cfg->m_int64Count++;
|
||||
m_cfg->m_values[pos+1] = index;
|
||||
m_cfg->get64(index) = entry.m_int64;
|
||||
* m_cfg->get64(index) = entry.m_int64;
|
||||
m_freeKeys--;
|
||||
m_freeData -= 8;
|
||||
DEBUG printf("Putting at: %d(%d) (loop = %d) key: %d value64(%d): %lld\n",
|
||||
|
@ -558,7 +564,7 @@ ConfigValues::getPackedSize() const {
|
|||
break;
|
||||
case StringType:
|
||||
size += 8; // key + len
|
||||
size += mod4(strlen(getString(m_values[i+1])) + 1);
|
||||
size += mod4(strlen(* getString(m_values[i+1])) + 1);
|
||||
break;
|
||||
case InvalidType:
|
||||
default:
|
||||
|
@ -587,7 +593,7 @@ ConfigValues::pack(void * _dst, Uint32 _len) const {
|
|||
* (Uint32*)dst = htonl(val); dst += 4;
|
||||
break;
|
||||
case Int64Type:{
|
||||
Uint64 i64 = get64(val);
|
||||
Uint64 i64 = * get64(val);
|
||||
Uint32 hi = (i64 >> 32);
|
||||
Uint32 lo = (i64 & 0xFFFFFFFF);
|
||||
* (Uint32*)dst = htonl(key); dst += 4;
|
||||
|
@ -596,7 +602,7 @@ ConfigValues::pack(void * _dst, Uint32 _len) const {
|
|||
}
|
||||
break;
|
||||
case StringType:{
|
||||
const char * str = getString(val);
|
||||
const char * str = * getString(val);
|
||||
Uint32 len = strlen(str) + 1;
|
||||
* (Uint32*)dst = htonl(key); 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();
|
||||
ndbrequire(p != 0);
|
||||
|
||||
m_maxOpenedFiles = 40;
|
||||
m_maxFiles = 40;
|
||||
//ndb_mgm_get_int_parameter(p, CFG_DB_MAX_OPEN_FILES, &m_maxFiles);
|
||||
|
||||
// Create idle AsyncFiles
|
||||
|
|
|
@ -795,8 +795,8 @@ inline
|
|||
void
|
||||
UnsafeArrayPool<T>::getPtrForce(Ptr<T> & ptr){
|
||||
Uint32 i = ptr.i;
|
||||
if(i < size){
|
||||
ptr.p = &theArray[i];
|
||||
if(i < this->size){
|
||||
ptr.p = &this->theArray[i];
|
||||
} else {
|
||||
ErrorReporter::handleAssert("UnsafeArrayPool<T>::getPtr",
|
||||
__FILE__, __LINE__);
|
||||
|
@ -808,8 +808,8 @@ inline
|
|||
void
|
||||
UnsafeArrayPool<T>::getPtrForce(ConstPtr<T> & ptr) const{
|
||||
Uint32 i = ptr.i;
|
||||
if(i < size){
|
||||
ptr.p = &theArray[i];
|
||||
if(i < this->size){
|
||||
ptr.p = &this->theArray[i];
|
||||
} else {
|
||||
ErrorReporter::handleAssert("UnsafeArrayPool<T>::getPtr",
|
||||
__FILE__, __LINE__);
|
||||
|
@ -820,8 +820,8 @@ template <class T>
|
|||
inline
|
||||
T *
|
||||
UnsafeArrayPool<T>::getPtrForce(Uint32 i){
|
||||
if(i < size){
|
||||
return &theArray[i];
|
||||
if(i < this->size){
|
||||
return &this->theArray[i];
|
||||
} else {
|
||||
ErrorReporter::handleAssert("UnsafeArrayPool<T>::getPtr",
|
||||
__FILE__, __LINE__);
|
||||
|
@ -833,8 +833,8 @@ template <class T>
|
|||
inline
|
||||
const T *
|
||||
UnsafeArrayPool<T>::getConstPtrForce(Uint32 i) const {
|
||||
if(i < size){
|
||||
return &theArray[i];
|
||||
if(i < this->size){
|
||||
return &this->theArray[i];
|
||||
} else {
|
||||
ErrorReporter::handleAssert("UnsafeArrayPool<T>::getPtr",
|
||||
__FILE__, __LINE__);
|
||||
|
@ -847,8 +847,8 @@ inline
|
|||
void
|
||||
UnsafeArrayPool<T>::getPtrForce(Ptr<T> & ptr, Uint32 i){
|
||||
ptr.i = i;
|
||||
if(i < size){
|
||||
ptr.p = &theArray[i];
|
||||
if(i < this->size){
|
||||
ptr.p = &this->theArray[i];
|
||||
return ;
|
||||
} else {
|
||||
ErrorReporter::handleAssert("UnsafeArrayPool<T>::getPtr",
|
||||
|
@ -861,8 +861,8 @@ inline
|
|||
void
|
||||
UnsafeArrayPool<T>::getPtrForce(ConstPtr<T> & ptr, Uint32 i) const{
|
||||
ptr.i = i;
|
||||
if(i < size){
|
||||
ptr.p = &theArray[i];
|
||||
if(i < this->size){
|
||||
ptr.p = &this->theArray[i];
|
||||
return ;
|
||||
} else {
|
||||
ErrorReporter::handleAssert("UnsafeArrayPool<T>::getPtr",
|
||||
|
|
|
@ -153,11 +153,11 @@ public:
|
|||
LocalDLFifoList(ArrayPool<T> & thePool, typename DLFifoList<T>::Head & _src)
|
||||
: DLFifoList<T>(thePool), src(_src)
|
||||
{
|
||||
head = src;
|
||||
this->head = src;
|
||||
}
|
||||
|
||||
~LocalDLFifoList(){
|
||||
src = head;
|
||||
src = this->head;
|
||||
}
|
||||
private:
|
||||
typename DLFifoList<T>::Head & src;
|
||||
|
|
|
@ -169,11 +169,11 @@ public:
|
|||
LocalDLList(ArrayPool<T> & thePool, typename DLList<T>::Head & _src)
|
||||
: DLList<T>(thePool), src(_src)
|
||||
{
|
||||
head = src;
|
||||
this->head = src;
|
||||
}
|
||||
|
||||
~LocalDLList(){
|
||||
src = head;
|
||||
src = this->head;
|
||||
}
|
||||
private:
|
||||
typename DLList<T>::Head & src;
|
||||
|
|
|
@ -174,11 +174,11 @@ public:
|
|||
typename DataBuffer<sz>::Head & _src)
|
||||
: DataBuffer<sz>(thePool), src(_src)
|
||||
{
|
||||
head = src;
|
||||
this->head = src;
|
||||
}
|
||||
|
||||
~LocalDataBuffer(){
|
||||
src = head;
|
||||
src = this->head;
|
||||
}
|
||||
private:
|
||||
typename DataBuffer<sz>::Head & src;
|
||||
|
|
|
@ -137,11 +137,11 @@ public:
|
|||
LocalSLList(ArrayPool<T> & thePool, typename SLList<T>::Head & _src)
|
||||
: SLList<T>(thePool), src(_src)
|
||||
{
|
||||
head = src;
|
||||
this->head = src;
|
||||
}
|
||||
|
||||
~LocalSLList(){
|
||||
src = head;
|
||||
src = this->head;
|
||||
}
|
||||
private:
|
||||
typename SLList<T>::Head & src;
|
||||
|
|
|
@ -1417,7 +1417,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
|
|||
s = SimpleProperties::pack(w,
|
||||
&tmpAttr,
|
||||
DictTabInfo::AttributeMapping,
|
||||
DictTabInfo::TableMappingSize, true);
|
||||
DictTabInfo::AttributeMappingSize, true);
|
||||
w.add(DictTabInfo::AttributeEnd, 1);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,8 +17,24 @@ bindir=""
|
|||
|
||||
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
|
||||
|
||||
case "$1" in
|
||||
--no-defaults|--defaults-file=*|--defaults-extra-file=*)
|
||||
defaults="$1"; shift
|
||||
;;
|
||||
esac
|
||||
|
||||
parse_arguments() {
|
||||
# We only need to pass arguments through to the server if we don't
|
||||
# handle them here. So, we collect unrecognized options (passed on
|
||||
|
@ -36,7 +52,7 @@ parse_arguments() {
|
|||
--user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
|
||||
--password=*) password=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
|
||||
--host=*) host=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
|
||||
--sql|--sql-only) sql_only=1;;
|
||||
--sql|--sql-only) sql_only=1 ;;
|
||||
--verbose) verbose=1 ;;
|
||||
--port=*) port=`echo "$arg" | sed -e "s;--port=;;"` ;;
|
||||
--socket=*) socket=`echo "$arg" | sed -e "s;--socket=;;"` ;;
|
||||
|
@ -47,7 +63,7 @@ parse_arguments() {
|
|||
then
|
||||
# This sed command makes sure that any special chars are quoted,
|
||||
# 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
|
||||
;;
|
||||
esac
|
||||
|
@ -94,11 +110,9 @@ else
|
|||
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"
|
||||
then
|
||||
password=`echo $args | sed -e 's/ *//g'`
|
||||
password=$old_style_password
|
||||
fi
|
||||
|
||||
cmd="$bindir/mysql -f --user=$user --host=$host"
|
||||
|
@ -145,11 +159,11 @@ s_echo()
|
|||
fi
|
||||
}
|
||||
|
||||
s_echo "This scripts updates all the mysql privilege tables to be usable by"
|
||||
s_echo "This script updates all the mysql privilege tables to be usable by"
|
||||
s_echo "MySQL 4.0 and above."
|
||||
s_echo ""
|
||||
s_echo "This is needed if you want to use the new GRANT functions,"
|
||||
s_echo "CREATE AGGREGATE FUNCTION or want to use the more secure passwords in 4.1"
|
||||
s_echo "CREATE AGGREGATE FUNCTION, or the more secure passwords in 4.1"
|
||||
s_echo ""
|
||||
|
||||
if test $verbose = 1
|
||||
|
|
|
@ -8,6 +8,7 @@ use File::Path;
|
|||
use DBI;
|
||||
use Sys::Hostname;
|
||||
use File::Copy;
|
||||
use File::Temp;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
|
@ -626,7 +627,6 @@ sub copy_files {
|
|||
sub copy_index
|
||||
{
|
||||
my ($method, $files, $source, $target) = @_;
|
||||
my $tmpfile="$opt_tmpdir/mysqlhotcopy$$";
|
||||
|
||||
print "Copying indices for ".@$files." files...\n" unless $opt{quiet};
|
||||
foreach my $file (@$files)
|
||||
|
@ -652,23 +652,23 @@ sub copy_index
|
|||
}
|
||||
close OUTPUT || die "Error on close of $to: $!\n";
|
||||
}
|
||||
elsif ($opt{method} eq 'scp')
|
||||
elsif ($opt{method} =~ /^scp\b/)
|
||||
{
|
||||
my $tmp=$tmpfile;
|
||||
open(OUTPUT,">$tmp") || die "Can\'t create file $tmp: $!\n";
|
||||
if (syswrite(OUTPUT,$buff) != length($buff))
|
||||
my ($fh, $tmp)=tempfile('mysqlhotcopy-XXXXXX', DIR => $opt_tmpdir);
|
||||
die "Can\'t create/open file in $opt_tmpdir\n";
|
||||
if (syswrite($fh,$buff) != length($buff))
|
||||
{
|
||||
die "Error when writing data to $tmp: $!\n";
|
||||
}
|
||||
close OUTPUT || die "Error on close of $tmp: $!\n";
|
||||
safe_system("scp $tmp $to");
|
||||
close $fh || die "Error on close of $tmp: $!\n";
|
||||
safe_system("$opt{method} $tmp $to");
|
||||
unlink $tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
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);
|
||||
thr_lock_delete(&share->lock);
|
||||
pthread_mutex_destroy(&share->mutex);
|
||||
my_free((gptr) share, MYF(0));
|
||||
if (gzclose(share->archive_write) == Z_ERRNO)
|
||||
rc= -1;
|
||||
my_free((gptr) share, MYF(0));
|
||||
}
|
||||
pthread_mutex_unlock(&archive_mutex);
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ public:
|
|||
return (HA_REC_NOT_IN_SEQ | HA_NOT_EXACT_COUNT | HA_NO_AUTO_INCREMENT |
|
||||
HA_FILE_BASED);
|
||||
}
|
||||
ulong index_flags(uint idx, uint part) const
|
||||
ulong index_flags(uint idx, uint part, bool all_parts) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -69,12 +69,16 @@ public:
|
|||
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
|
||||
handler.h. If you do not implement indexes, just return zero
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -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; }
|
||||
virtual void make_field(Send_field *)=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 void free() {}
|
||||
Field *new_field(MEM_ROOT *root, struct st_table *new_table)
|
||||
|
@ -1134,7 +1134,7 @@ public:
|
|||
uint size_of() const { return sizeof(*this); }
|
||||
enum_field_types real_type() const { return FIELD_TYPE_ENUM; }
|
||||
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 has_charset(void) const { return TRUE; }
|
||||
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; }
|
||||
|
||||
|
||||
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
|
||||
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) {}
|
||||
~ha_berkeley() {}
|
||||
const char *table_type() const { return "BerkeleyDB"; }
|
||||
ulong index_flags(uint idx, uint part) 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;
|
||||
}
|
||||
ulong index_flags(uint idx, uint part, bool all_parts) const;
|
||||
const char *index_type(uint key_number) { return "BTREE"; }
|
||||
const char **bas_ext() const;
|
||||
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_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) ?
|
||||
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** bas_ext() const;
|
||||
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 |
|
||||
HA_KEYREAD_ONLY);
|
||||
|
|
|
@ -36,7 +36,7 @@ class ha_isam: public handler
|
|||
HA_DUPP_POS | HA_NOT_DELETE_WITH_CACHE | HA_FILE_BASED)
|
||||
{}
|
||||
~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!!!
|
||||
const char *table_type() const { return "ISAM"; }
|
||||
const char *index_type(uint key_number) { return "BTREE"; }
|
||||
|
|
|
@ -34,7 +34,8 @@ class ha_isammrg: public handler
|
|||
const char **bas_ext() const;
|
||||
ulong table_flags() const { return (HA_READ_RND_SAME |
|
||||
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; }
|
||||
bool low_byte_first() const { return 0; }
|
||||
|
|
|
@ -336,7 +336,7 @@ int ha_myisam::check(THD* thd, HA_CHECK_OPT* check_opt)
|
|||
HA_STATUS_CONST);
|
||||
}
|
||||
}
|
||||
else if (!mi_is_crashed(file))
|
||||
else if (!mi_is_crashed(file) && !thd->killed)
|
||||
{
|
||||
mi_mark_crashed(file);
|
||||
file->update |= HA_STATE_CHANGED | HA_STATE_ROW_CHANGED;
|
||||
|
@ -378,7 +378,7 @@ int ha_myisam::analyze(THD *thd, HA_CHECK_OPT* check_opt)
|
|||
error=update_state_info(¶m,file,UPDATE_STAT);
|
||||
pthread_mutex_unlock(&share->intern_lock);
|
||||
}
|
||||
else if (!mi_is_crashed(file))
|
||||
else if (!mi_is_crashed(file) && !thd->killed)
|
||||
mi_mark_crashed(file);
|
||||
return error ? HA_ADMIN_CORRUPT : HA_ADMIN_OK;
|
||||
}
|
||||
|
|
|
@ -55,11 +55,11 @@ class ha_myisam: public handler
|
|||
const char *index_type(uint key_number);
|
||||
const char **bas_ext() const;
|
||||
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) ?
|
||||
0 : HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE |
|
||||
HA_READ_ORDER | HA_KEYREAD_ONLY);
|
||||
0 : HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE |
|
||||
HA_READ_ORDER | HA_KEYREAD_ONLY);
|
||||
}
|
||||
uint max_supported_keys() const { return MI_MAX_KEY; }
|
||||
uint max_supported_key_length() const { return MI_MAX_KEY_LENGTH; }
|
||||
|
|
|
@ -38,11 +38,11 @@ class ha_myisammrg: public handler
|
|||
HA_NULL_IN_KEY | HA_CAN_INDEX_BLOBS | HA_FILE_BASED |
|
||||
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) ?
|
||||
0 : HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE |
|
||||
HA_READ_ORDER | HA_KEYREAD_ONLY);
|
||||
0 : HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE |
|
||||
HA_READ_ORDER | HA_KEYREAD_ONLY);
|
||||
}
|
||||
uint max_supported_keys() const { return MI_MAX_KEY; }
|
||||
uint max_supported_key_length() const { return MI_MAX_KEY_LENGTH; }
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
||||
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_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 ** bas_ext() const;
|
||||
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_keys() const { return MAX_KEY; }
|
||||
uint max_supported_key_parts() const
|
||||
|
|
|
@ -449,7 +449,7 @@ public:
|
|||
virtual const char *table_type() const =0;
|
||||
virtual const char **bas_ext() 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
|
||||
{ return (HA_DDL_SUPPORT); }
|
||||
virtual int add_index(TABLE *table_arg, KEY *key_info, uint num_of_keys)
|
||||
|
|
|
@ -483,7 +483,14 @@ bool Item_in_optimizer::fix_left(THD *thd,
|
|||
return 1;
|
||||
|
||||
cache->setup(args[0]);
|
||||
cache->store(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]);
|
||||
if (cache->cols() == 1)
|
||||
{
|
||||
if ((used_tables_cache= args[0]->used_tables()))
|
||||
|
|
|
@ -2294,40 +2294,49 @@ inline int hexchar_to_int(char c)
|
|||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/* Convert given hex string to a binary string */
|
||||
|
||||
String *Item_func_unhex::val_str(String *str)
|
||||
{
|
||||
DBUG_ASSERT(fixed == 1);
|
||||
/* Convert given hex string to a binary string */
|
||||
String *res= args[0]->val_str(str);
|
||||
const char *from=res->ptr(), *end;
|
||||
const char *from, *end;
|
||||
char *to;
|
||||
int r;
|
||||
if (!res || tmp_value.alloc((1+res->length())/2))
|
||||
String *res;
|
||||
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;
|
||||
return 0;
|
||||
}
|
||||
null_value=0;
|
||||
tmp_value.length((1+res->length())/2);
|
||||
|
||||
from= res->ptr();
|
||||
null_value= 0;
|
||||
tmp_value.length(length);
|
||||
to= (char*) tmp_value.ptr();
|
||||
if (res->length() % 2)
|
||||
{
|
||||
*to++= r= hexchar_to_int(*from++);
|
||||
if ((null_value= (r == -1)))
|
||||
int hex_char;
|
||||
*to++= hex_char= hexchar_to_int(*from++);
|
||||
if ((null_value= (hex_char == -1)))
|
||||
return 0;
|
||||
}
|
||||
for (end=res->ptr()+res->length(); from < end ; from+=2, to++)
|
||||
{
|
||||
*to= (r= hexchar_to_int(from[0])) << 4;
|
||||
if ((null_value= (r == -1)))
|
||||
int hex_char;
|
||||
*to= (hex_char= hexchar_to_int(from[0])) << 4;
|
||||
if ((null_value= (hex_char == -1)))
|
||||
return 0;
|
||||
*to|= r= hexchar_to_int(from[1]);
|
||||
if ((null_value= (r == -1)))
|
||||
*to|= hex_char= hexchar_to_int(from[1]);
|
||||
if ((null_value= (hex_char == -1)))
|
||||
return 0;
|
||||
}
|
||||
return &tmp_value;
|
||||
}
|
||||
|
||||
|
||||
void Item_func_binary::print(String *str)
|
||||
{
|
||||
str->append("cast(", 5);
|
||||
|
|
|
@ -2046,10 +2046,8 @@ bool flush_error_log()
|
|||
bool MYSQL_LOG::cut_spurious_tail()
|
||||
{
|
||||
int error= 0;
|
||||
char llbuf1[22], llbuf2[22];
|
||||
ulonglong actual_size;
|
||||
|
||||
DBUG_ENTER("cut_spurious_tail");
|
||||
|
||||
#ifdef HAVE_INNOBASE_DB
|
||||
if (have_innodb != SHOW_OPTION_YES)
|
||||
DBUG_RETURN(0);
|
||||
|
@ -2059,6 +2057,9 @@ bool MYSQL_LOG::cut_spurious_tail()
|
|||
*/
|
||||
char *name= ha_innobase::get_mysql_bin_log_name();
|
||||
ulonglong pos= ha_innobase::get_mysql_bin_log_pos();
|
||||
ulonglong actual_size;
|
||||
char llbuf1[22], llbuf2[22];
|
||||
|
||||
if (name[0] == 0 || pos == ULONGLONG_MAX)
|
||||
{
|
||||
DBUG_PRINT("info", ("InnoDB has not set binlog info"));
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue