mirror of
https://github.com/MariaDB/server.git
synced 2026-05-06 15:15:34 +02:00
Merge hholzgraefe@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/hartmut/projects/mysql/dev/5.0 ndb/tools/ndb_config.cpp: Auto merged
This commit is contained in:
commit
7d3c939e81
196 changed files with 3200 additions and 2423 deletions
|
|
@ -10,7 +10,7 @@ prefix_configs="--prefix=/usr/local/mysql"
|
|||
just_print=
|
||||
just_configure=
|
||||
full_debug=
|
||||
if test ! -z $MYSQL_BUILD_PREFIX
|
||||
if test -n "$MYSQL_BUILD_PREFIX"
|
||||
then
|
||||
prefix_configs="--prefix=$MYSQL_BUILD_PREFIX"
|
||||
fi
|
||||
|
|
@ -53,8 +53,10 @@ global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wch
|
|||
c_warnings="$global_warnings -Wunused"
|
||||
cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor"
|
||||
base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-openssl --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine"
|
||||
base_max_no_ndb_configs="--with-innodb --with-berkeley-db --without-ndbcluster --with-archive-storage-engine --with-openssl --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine"
|
||||
max_leave_isam_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-blackhole-storage-engine --with-csv-storage-engine --with-openssl --with-embedded-server --with-big-tables"
|
||||
max_configs="$base_max_configs --with-embedded-server"
|
||||
max_no_ndb_configs="$base_max_no_ndb_configs --with-embedded-server"
|
||||
|
||||
path=`dirname $0`
|
||||
. "$path/check-cpu"
|
||||
|
|
|
|||
11
BUILD/compile-pentium-debug-max-no-ndb
Executable file
11
BUILD/compile-pentium-debug-max-no-ndb
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
#! /bin/sh
|
||||
|
||||
path=`dirname $0`
|
||||
. "$path/SETUP.sh" $@ --with-debug=full
|
||||
|
||||
extra_flags="$pentium_cflags $debug_cflags $max_cflags"
|
||||
c_warnings="$c_warnings $debug_extra_warnings"
|
||||
cxx_warnings="$cxx_warnings $debug_extra_warnings"
|
||||
extra_configs="$pentium_configs $debug_configs $max_no_ndb_configs"
|
||||
|
||||
. "$path/FINISH.sh"
|
||||
11
BUILD/compile-ppc-debug-max-no-ndb
Executable file
11
BUILD/compile-ppc-debug-max-no-ndb
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
#! /bin/sh
|
||||
|
||||
path=`dirname $0`
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
extra_flags="$ppc_cflags $debug_cflags $max_cflags"
|
||||
c_warnings="$c_warnings $debug_extra_warnings"
|
||||
cxx_warnings="$cxx_warnings $debug_extra_warnings"
|
||||
extra_configs="$debug_configs $max_no_ndb_configs"
|
||||
|
||||
. "$path/FINISH.sh"
|
||||
19
Makefile.am
19
Makefile.am
|
|
@ -107,15 +107,26 @@ MYSQL_TEST_RUN_ARGS = --manager-port=$(MYSQL_TEST_MANAGER_PORT) \
|
|||
--master_port=$(MYSQL_TEST_MASTER_PORT) \
|
||||
--slave_port=$(MYSQL_TEST_SLAVE_PORT) \
|
||||
--ndbcluster_port=$(MYSQL_TEST_NDB_PORT)
|
||||
|
||||
test:
|
||||
cd mysql-test ; \
|
||||
./mysql-test-run.pl $(MYSQL_TEST_RUN_ARGS) && \
|
||||
./mysql-test-run.pl --ps-protocol $(MYSQL_TEST_RUN_ARGS)
|
||||
./mysql-test-run $(MYSQL_TEST_RUN_ARGS) && \
|
||||
./mysql-test-run $(MYSQL_TEST_RUN_ARGS) --ps-protocol
|
||||
|
||||
test-force:
|
||||
cd mysql-test ; \
|
||||
./mysql-test-run --force $(MYSQL_TEST_RUN_ARGS) ; \
|
||||
./mysql-test-run --ps-protocol --force $(MYSQL_TEST_RUN_ARGS)
|
||||
./mysql-test-run $(MYSQL_TEST_RUN_ARGS) --force ; \
|
||||
./mysql-test-run $(MYSQL_TEST_RUN_ARGS) --ps-protocol --force
|
||||
|
||||
test-pl:
|
||||
cd mysql-test ; \
|
||||
./mysql-test-run.pl $(MYSQL_TEST_RUN_ARGS) && \
|
||||
./mysql-test-run.pl $(MYSQL_TEST_RUN_ARGS) --ps-protocol
|
||||
|
||||
test-force-pl:
|
||||
cd mysql-test ; \
|
||||
./mysql-test-run.pl $(MYSQL_TEST_RUN_ARGS) --force ; \
|
||||
./mysql-test-run.pl $(MYSQL_TEST_RUN_ARGS) --ps-protocol --force
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
|
|
|
|||
|
|
@ -1014,13 +1014,13 @@ static int read_and_execute(bool interactive)
|
|||
unsigned long clen;
|
||||
do
|
||||
{
|
||||
line= my_cgets(tmpbuf.c_ptr(), tmpbuf.alloced_length(), &clen);
|
||||
line= my_cgets(tmpbuf.ptr(), tmpbuf.alloced_length()-1, &clen);
|
||||
buffer.append(line, clen);
|
||||
/*
|
||||
if we got buffer fully filled than there is a chance that
|
||||
something else is still in console input buffer
|
||||
*/
|
||||
} while (tmpbuf.alloced_length() <= clen + 1);
|
||||
} while (tmpbuf.alloced_length() <= clen);
|
||||
line= buffer.c_ptr();
|
||||
#else /* OS2 */
|
||||
buffer.length(0);
|
||||
|
|
|
|||
|
|
@ -1434,7 +1434,7 @@ int main(int argc, char** argv)
|
|||
of transaction.
|
||||
*/
|
||||
fprintf(result_file,
|
||||
"# End of log file\nROLLBACK;\n"
|
||||
"# End of log file\nROLLBACK /* added by mysqlbinlog */;\n"
|
||||
"/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;\n");
|
||||
if (disable_log_bin)
|
||||
fprintf(result_file, "/*!32316 SET SQL_LOG_BIN=@OLD_SQL_LOG_BIN*/;\n");
|
||||
|
|
|
|||
|
|
@ -59,12 +59,16 @@
|
|||
#include <stdarg.h>
|
||||
#include <sys/stat.h>
|
||||
#include <violite.h>
|
||||
#include <regex.h> /* Our own version of lib */
|
||||
#include "my_regex.h" /* Our own version of lib */
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
#ifndef WEXITSTATUS
|
||||
# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
|
||||
# ifdef __WIN__
|
||||
# define WEXITSTATUS(stat_val) (stat_val)
|
||||
# else
|
||||
# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
|
||||
# endif
|
||||
#endif
|
||||
/* MAX_QUERY is 256K -- there is a test in sp-big that is >128K */
|
||||
#define MAX_QUERY (256*1024)
|
||||
|
|
@ -208,7 +212,7 @@ static int got_end_timer= FALSE;
|
|||
static void timer_output(void);
|
||||
static ulonglong timer_now(void);
|
||||
|
||||
static regex_t ps_re; /* Holds precompiled re for valid PS statements */
|
||||
static my_regex_t ps_re; /* Holds precompiled re for valid PS statements */
|
||||
static void ps_init_re(void);
|
||||
static int ps_match_re(char *);
|
||||
static char *ps_eprint(int);
|
||||
|
|
@ -549,7 +553,7 @@ static void close_cons()
|
|||
static void close_files()
|
||||
{
|
||||
DBUG_ENTER("close_files");
|
||||
for (; cur_file != (file_stack-1) ; cur_file--)
|
||||
for (; cur_file >= file_stack; cur_file--)
|
||||
{
|
||||
DBUG_PRINT("info", ("file_name: %s", cur_file->file_name));
|
||||
if (cur_file->file && cur_file->file != stdin)
|
||||
|
|
@ -609,7 +613,8 @@ static void die(const char *fmt, ...)
|
|||
if (cur_file && cur_file != file_stack)
|
||||
fprintf(stderr, "In included file \"%s\": ",
|
||||
cur_file->file_name);
|
||||
fprintf(stderr, "At line %u: ", start_lineno);
|
||||
if (start_lineno != 0)
|
||||
fprintf(stderr, "At line %u: ", start_lineno);
|
||||
vfprintf(stderr, fmt, args);
|
||||
fprintf(stderr, "\n");
|
||||
fflush(stderr);
|
||||
|
|
@ -642,7 +647,9 @@ static void verbose_msg(const char *fmt, ...)
|
|||
|
||||
va_start(args, fmt);
|
||||
|
||||
fprintf(stderr, "mysqltest: At line %u: ", start_lineno);
|
||||
fprintf(stderr, "mysqltest: ");
|
||||
if (start_lineno > 0)
|
||||
fprintf(stderr, "At line %u: ", start_lineno);
|
||||
vfprintf(stderr, fmt, args);
|
||||
fprintf(stderr, "\n");
|
||||
va_end(args);
|
||||
|
|
@ -1097,8 +1104,8 @@ static void do_exec(struct st_query *query)
|
|||
(query->expected_errno[i].code.errnum == status))
|
||||
{
|
||||
ok= 1;
|
||||
verbose_msg("command \"%s\" failed with expected error: %d",
|
||||
cmd, status);
|
||||
DBUG_PRINT("info", ("command \"%s\" failed with expected error: %d",
|
||||
cmd, status));
|
||||
}
|
||||
}
|
||||
if (!ok)
|
||||
|
|
@ -1383,9 +1390,7 @@ int do_sync_with_master2(long offset)
|
|||
int rpl_parse;
|
||||
|
||||
if (!master_pos.file[0])
|
||||
{
|
||||
die("Line %u: Calling 'sync_with_master' without calling 'save_master_pos'", start_lineno);
|
||||
}
|
||||
die("Calling 'sync_with_master' without calling 'save_master_pos'");
|
||||
rpl_parse= mysql_rpl_parse_enabled(mysql);
|
||||
mysql_disable_rpl_parse(mysql);
|
||||
|
||||
|
|
@ -1395,14 +1400,13 @@ int do_sync_with_master2(long offset)
|
|||
wait_for_position:
|
||||
|
||||
if (mysql_query(mysql, query_buf))
|
||||
die("line %u: failed in %s: %d: %s", start_lineno, query_buf,
|
||||
mysql_errno(mysql), mysql_error(mysql));
|
||||
die("failed in %s: %d: %s", query_buf, mysql_errno(mysql),
|
||||
mysql_error(mysql));
|
||||
|
||||
if (!(last_result= res= mysql_store_result(mysql)))
|
||||
die("line %u: mysql_store_result() returned NULL for '%s'", start_lineno,
|
||||
query_buf);
|
||||
die("mysql_store_result() returned NULL for '%s'", query_buf);
|
||||
if (!(row= mysql_fetch_row(res)))
|
||||
die("line %u: empty result in %s", start_lineno, query_buf);
|
||||
die("empty result in %s", query_buf);
|
||||
if (!row[0])
|
||||
{
|
||||
/*
|
||||
|
|
@ -1410,10 +1414,7 @@ wait_for_position:
|
|||
SLAVE has been issued ?
|
||||
*/
|
||||
if (tries++ == 3)
|
||||
{
|
||||
die("line %u: could not sync with master ('%s' returned NULL)",
|
||||
start_lineno, query_buf);
|
||||
}
|
||||
die("could not sync with master ('%s' returned NULL)", query_buf);
|
||||
sleep(1); /* So at most we will wait 3 seconds and make 4 tries */
|
||||
mysql_free_result(res);
|
||||
goto wait_for_position;
|
||||
|
|
@ -1459,10 +1460,9 @@ int do_save_master_pos()
|
|||
mysql_errno(mysql), mysql_error(mysql));
|
||||
|
||||
if (!(last_result =res = mysql_store_result(mysql)))
|
||||
die("line %u: mysql_store_result() retuned NULL for '%s'", start_lineno,
|
||||
query);
|
||||
die("mysql_store_result() retuned NULL for '%s'", query);
|
||||
if (!(row = mysql_fetch_row(res)))
|
||||
die("line %u: empty result in show master status", start_lineno);
|
||||
die("empty result in show master status");
|
||||
strnmov(master_pos.file, row[0], sizeof(master_pos.file)-1);
|
||||
master_pos.pos = strtoul(row[1], (char**) 0, 10);
|
||||
mysql_free_result(res); last_result=0;
|
||||
|
|
@ -2768,7 +2768,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||
fn_format(buff, argument, "", "", 4);
|
||||
DBUG_ASSERT(cur_file == file_stack && cur_file->file == 0);
|
||||
if (!(cur_file->file=
|
||||
my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(MY_WME))))
|
||||
my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(0))))
|
||||
die("Could not open %s: errno = %d", buff, errno);
|
||||
cur_file->file_name= my_strdup(buff, MYF(MY_FAE));
|
||||
break;
|
||||
|
|
@ -2874,7 +2874,7 @@ void str_to_file(const char *fname, char *str, int size)
|
|||
fname=buff;
|
||||
}
|
||||
fn_format(buff,fname,"","",4);
|
||||
|
||||
|
||||
if ((fd = my_open(buff, O_WRONLY | O_CREAT | O_TRUNC,
|
||||
MYF(MY_WME | MY_FFNF))) < 0)
|
||||
die("Could not open %s: errno = %d", buff, errno);
|
||||
|
|
@ -3767,12 +3767,13 @@ static void ps_init_re(void)
|
|||
"[[:space:]]*UPDATE[[:space:]]+MULTI[[:space:]]|"
|
||||
"[[:space:]]*INSERT[[:space:]]+SELECT[[:space:]])";
|
||||
|
||||
int err= regcomp(&ps_re, ps_re_str, (REG_EXTENDED | REG_ICASE | REG_NOSUB),
|
||||
&my_charset_latin1);
|
||||
int err= my_regcomp(&ps_re, ps_re_str,
|
||||
(REG_EXTENDED | REG_ICASE | REG_NOSUB),
|
||||
&my_charset_latin1);
|
||||
if (err)
|
||||
{
|
||||
char erbuf[100];
|
||||
int len= regerror(err, &ps_re, erbuf, sizeof(erbuf));
|
||||
int len= my_regerror(err, &ps_re, erbuf, sizeof(erbuf));
|
||||
fprintf(stderr, "error %s, %d/%d `%s'\n",
|
||||
ps_eprint(err), len, (int)sizeof(erbuf), erbuf);
|
||||
exit(1);
|
||||
|
|
@ -3782,7 +3783,7 @@ static void ps_init_re(void)
|
|||
|
||||
static int ps_match_re(char *stmt_str)
|
||||
{
|
||||
int err= regexec(&ps_re, stmt_str, (size_t)0, NULL, 0);
|
||||
int err= my_regexec(&ps_re, stmt_str, (size_t)0, NULL, 0);
|
||||
|
||||
if (err == 0)
|
||||
return 1;
|
||||
|
|
@ -3791,7 +3792,7 @@ static int ps_match_re(char *stmt_str)
|
|||
else
|
||||
{
|
||||
char erbuf[100];
|
||||
int len= regerror(err, &ps_re, erbuf, sizeof(erbuf));
|
||||
int len= my_regerror(err, &ps_re, erbuf, sizeof(erbuf));
|
||||
fprintf(stderr, "error %s, %d/%d `%s'\n",
|
||||
ps_eprint(err), len, (int)sizeof(erbuf), erbuf);
|
||||
exit(1);
|
||||
|
|
@ -3801,7 +3802,7 @@ static int ps_match_re(char *stmt_str)
|
|||
static char *ps_eprint(int err)
|
||||
{
|
||||
static char epbuf[100];
|
||||
size_t len= regerror(REG_ITOA|err, (regex_t *)NULL, epbuf, sizeof(epbuf));
|
||||
size_t len= my_regerror(REG_ITOA|err, (my_regex_t *)NULL, epbuf, sizeof(epbuf));
|
||||
assert(len <= sizeof(epbuf));
|
||||
return(epbuf);
|
||||
}
|
||||
|
|
@ -3809,7 +3810,7 @@ static char *ps_eprint(int err)
|
|||
|
||||
static void ps_free_reg(void)
|
||||
{
|
||||
regfree(&ps_re);
|
||||
my_regfree(&ps_re);
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
|
|
@ -4304,12 +4305,20 @@ int main(int argc, char **argv)
|
|||
if (res_info.st_size)
|
||||
error|= (RESULT_CONTENT_MISMATCH | RESULT_LENGTH_MISMATCH);
|
||||
}
|
||||
if (result_file && ds_res.length && !error)
|
||||
if (ds_res.length && !error)
|
||||
{
|
||||
if (!record)
|
||||
error |= check_result(&ds_res, result_file, q->require_file);
|
||||
if (result_file)
|
||||
{
|
||||
if (!record)
|
||||
error |= check_result(&ds_res, result_file, q->require_file);
|
||||
else
|
||||
str_to_file(result_file, ds_res.str, ds_res.length);
|
||||
}
|
||||
else
|
||||
str_to_file(result_file, ds_res.str, ds_res.length);
|
||||
{
|
||||
/* Print the result to stdout */
|
||||
printf("%s", ds_res.str);
|
||||
}
|
||||
}
|
||||
dynstr_free(&ds_res);
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#if defined (HAVE_SYS_FILE_H)
|
||||
# include <sys/file.h>
|
||||
#endif
|
||||
|
|
@ -1149,7 +1150,8 @@ compute_lcd_of_matches (match_list, matches, text)
|
|||
rl_completion_found_quote &&
|
||||
rl_filename_quoting_desired)
|
||||
{
|
||||
dtext = (*rl_filename_dequoting_function) (text, rl_completion_quote_character);
|
||||
dtext = (*rl_filename_dequoting_function)
|
||||
((char*) text, rl_completion_quote_character);
|
||||
text = dtext;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,13 +23,14 @@ AC_DEFUN([MYSQL_CHECK_YASSL], [
|
|||
|
||||
# System specific checks
|
||||
yassl_integer_extra_cxxflags=""
|
||||
case $SYSTEM_TYPE--$CXX_VERSION in
|
||||
sparc*solaris*--*Sun*C++*5.6*)
|
||||
case $host_cpu--$CXX_VERSION in
|
||||
sparc*--*Sun*C++*5.6*)
|
||||
# Disable inlining when compiling taocrypt/src/integer.cpp
|
||||
yassl_integer_extra_cxxflags="+d"
|
||||
AC_MSG_NOTICE([disabling inlining for yassl/taocrypt/src/integer.cpp])
|
||||
;;
|
||||
esac
|
||||
AC_SUBST([yassl_integer_extra_cxxflags])
|
||||
AC_SUBST([yassl_integer_extra_cxxflags])
|
||||
|
||||
else
|
||||
yassl_dir=""
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc)
|
|||
AC_CANONICAL_SYSTEM
|
||||
# The Docs Makefile.am parses this line!
|
||||
# remember to also change ndb version below and update version.c in ndb
|
||||
AM_INIT_AUTOMAKE(mysql, 5.0.14-rc)
|
||||
AM_INIT_AUTOMAKE(mysql, 5.0.15-rc)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
PROTOCOL_VERSION=10
|
||||
|
|
@ -18,7 +18,7 @@ SHARED_LIB_VERSION=15:0:0
|
|||
# ndb version
|
||||
NDB_VERSION_MAJOR=5
|
||||
NDB_VERSION_MINOR=0
|
||||
NDB_VERSION_BUILD=14
|
||||
NDB_VERSION_BUILD=15
|
||||
NDB_VERSION_STATUS="rc"
|
||||
|
||||
# Set all version vars based on $VERSION. How do we do this more elegant ?
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
#endif
|
||||
|
||||
#include <my_global.h> /* This includes dbug.h */
|
||||
#include <my_pthread.h>
|
||||
|
||||
int main (argc, argv)
|
||||
int argc;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,8 @@ struct vector_base {
|
|||
vector_base() : start_(0), finish_(0), end_of_storage_(0) {}
|
||||
vector_base(size_t n)
|
||||
{
|
||||
start_ = static_cast<T*>(malloc(n * sizeof(T)));
|
||||
// Don't allow malloc(0), if n is 0 use 1
|
||||
start_ = static_cast<T*>(malloc((n ? n : 1) * sizeof(T)));
|
||||
if (!start_) abort();
|
||||
finish_ = start_;
|
||||
end_of_storage_ = start_ + n;
|
||||
|
|
|
|||
|
|
@ -56,12 +56,12 @@ private:
|
|||
T mac_;
|
||||
|
||||
// MSVC 6 HACK, gives compiler error if calculated in array
|
||||
enum { BSIZE = T::BLOCK_SIZE / sizeof(word32),
|
||||
DSIZE = T::DIGEST_SIZE / sizeof(word32) };
|
||||
enum { HMAC_BSIZE = T::BLOCK_SIZE / sizeof(word32),
|
||||
HMAC_DSIZE = T::DIGEST_SIZE / sizeof(word32) };
|
||||
|
||||
word32 ip_[BSIZE]; // align ipad_ on word32
|
||||
word32 op_[BSIZE]; // align opad_ on word32
|
||||
word32 innerH_[DSIZE]; // align innerHash_ on word32
|
||||
word32 ip_[HMAC_BSIZE]; // align ipad_ on word32
|
||||
word32 op_[HMAC_BSIZE]; // align opad_ on word32
|
||||
word32 innerH_[HMAC_DSIZE]; // align innerHash_ on word32
|
||||
|
||||
void KeyInnerHash();
|
||||
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ C_MODE_END
|
|||
|
||||
|
||||
/* Fix a bug in gcc 2.8.0 on IRIX 6.2 */
|
||||
#if SIZEOF_LONG == 4 && defined(__LONG_MAX__)
|
||||
#if SIZEOF_LONG == 4 && defined(__LONG_MAX__) && (__GNUC__ == 2 && __GNUC_MINOR__ == 8)
|
||||
#undef __LONG_MAX__ /* Is a longlong value in gcc 2.8.0 ??? */
|
||||
#define __LONG_MAX__ 2147483647
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -262,6 +262,7 @@ extern char wild_many,wild_one,wild_prefix;
|
|||
extern const char *charsets_dir;
|
||||
extern char *defaults_extra_file;
|
||||
extern const char *defaults_group_suffix;
|
||||
extern const char *defaults_file;
|
||||
|
||||
extern my_bool timed_mutexes;
|
||||
|
||||
|
|
@ -280,7 +281,7 @@ enum loglevel {
|
|||
|
||||
enum cache_type
|
||||
{
|
||||
READ_CACHE,WRITE_CACHE,
|
||||
TYPE_NOT_SET= 0, READ_CACHE, WRITE_CACHE,
|
||||
SEQ_READ_APPEND /* sequential read or append */,
|
||||
READ_FIFO, READ_NET,WRITE_NET};
|
||||
|
||||
|
|
|
|||
|
|
@ -321,7 +321,9 @@ buf_page_is_corrupted(
|
|||
fprintf(stderr,
|
||||
" InnoDB: Error: page %lu log sequence number %lu %lu\n"
|
||||
"InnoDB: is in the future! Current system log sequence number %lu %lu.\n"
|
||||
"InnoDB: Your database may be corrupt.\n",
|
||||
"InnoDB: Your database may be corrupt or you may have copied the InnoDB\n"
|
||||
"InnoDB: tablespace but not the InnoDB log files. See\n"
|
||||
"http://dev.mysql.com/doc/mysql/en/backing-up.html for more information.\n",
|
||||
(ulong) mach_read_from_4(read_buf + FIL_PAGE_OFFSET),
|
||||
(ulong) ut_dulint_get_high(
|
||||
mach_read_from_8(read_buf + FIL_PAGE_LSN)),
|
||||
|
|
|
|||
|
|
@ -99,8 +99,7 @@ heap freeing. */
|
|||
/*********************************************************************
|
||||
NOTE: Use the corresponding macros instead of this function. Creates a
|
||||
memory heap which allocates memory from dynamic space. For debugging
|
||||
purposes, takes also the file name and line as argument in the debug
|
||||
version. */
|
||||
purposes, takes also the file name and line as argument. */
|
||||
UNIV_INLINE
|
||||
mem_heap_t*
|
||||
mem_heap_create_func(
|
||||
|
|
|
|||
|
|
@ -371,8 +371,7 @@ mem_heap_free_top(
|
|||
/*********************************************************************
|
||||
NOTE: Use the corresponding macros instead of this function. Creates a
|
||||
memory heap which allocates memory from dynamic space. For debugging
|
||||
purposes, takes also the file name and line as argument in the debug
|
||||
version. */
|
||||
purposes, takes also the file name and line as argument. */
|
||||
UNIV_INLINE
|
||||
mem_heap_t*
|
||||
mem_heap_create_func(
|
||||
|
|
|
|||
|
|
@ -122,6 +122,7 @@ ut_strcmp(const void* str1, const void* str2);
|
|||
Copies up to size - 1 characters from the NUL-terminated string src to
|
||||
dst, NUL-terminating the result. Returns strlen(src), so truncation
|
||||
occurred if the return value >= size. */
|
||||
|
||||
ulint
|
||||
ut_strlcpy(
|
||||
/*=======*/
|
||||
|
|
@ -130,6 +131,18 @@ ut_strlcpy(
|
|||
const char* src, /* in: source buffer */
|
||||
ulint size); /* in: size of destination buffer */
|
||||
|
||||
/**************************************************************************
|
||||
Like ut_strlcpy, but if src doesn't fit in dst completely, copies the last
|
||||
(size - 1) bytes of src, not the first. */
|
||||
|
||||
ulint
|
||||
ut_strlcpy_rev(
|
||||
/*===========*/
|
||||
/* out: strlen(src) */
|
||||
char* dst, /* in: destination buffer */
|
||||
const char* src, /* in: source buffer */
|
||||
ulint size); /* in: size of destination buffer */
|
||||
|
||||
/**************************************************************************
|
||||
Compute strlen(ut_strcpyq(str, q)). */
|
||||
UNIV_INLINE
|
||||
|
|
|
|||
|
|
@ -187,9 +187,7 @@ mem_heap_create_block(
|
|||
}
|
||||
|
||||
block->magic_n = MEM_BLOCK_MAGIC_N;
|
||||
ut_memcpy(&(block->file_name), file_name + ut_strlen(file_name) - 7,
|
||||
7);
|
||||
block->file_name[7]='\0';
|
||||
ut_strlcpy_rev(block->file_name, file_name, sizeof(block->file_name));
|
||||
block->line = line;
|
||||
|
||||
#ifdef MEM_PERIODIC_CHECK
|
||||
|
|
|
|||
|
|
@ -292,6 +292,9 @@ os_awe_allocate_physical_mem(
|
|||
|
||||
return(TRUE);
|
||||
#else
|
||||
UT_NOT_USED(n_megabytes);
|
||||
UT_NOT_USED(page_info);
|
||||
|
||||
return(FALSE);
|
||||
#endif
|
||||
}
|
||||
|
|
@ -349,6 +352,8 @@ os_awe_allocate_virtual_mem_window(
|
|||
|
||||
return(ptr);
|
||||
#else
|
||||
UT_NOT_USED(size);
|
||||
|
||||
return(NULL);
|
||||
#endif
|
||||
}
|
||||
|
|
@ -476,6 +481,10 @@ os_awe_map_physical_mem_to_window(
|
|||
|
||||
return(TRUE);
|
||||
#else
|
||||
UT_NOT_USED(ptr);
|
||||
UT_NOT_USED(n_mem_pages);
|
||||
UT_NOT_USED(page_info);
|
||||
|
||||
return(FALSE);
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -364,7 +364,30 @@ ut_strlcpy(
|
|||
dst[n] = '\0';
|
||||
}
|
||||
|
||||
return src_size;
|
||||
return(src_size);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Like ut_strlcpy, but if src doesn't fit in dst completely, copies the last
|
||||
(size - 1) bytes of src, not the first. */
|
||||
|
||||
ulint
|
||||
ut_strlcpy_rev(
|
||||
/*===========*/
|
||||
/* out: strlen(src) */
|
||||
char* dst, /* in: destination buffer */
|
||||
const char* src, /* in: source buffer */
|
||||
ulint size) /* in: size of destination buffer */
|
||||
{
|
||||
ulint src_size = strlen(src);
|
||||
|
||||
if (size != 0) {
|
||||
ulint n = ut_min(src_size, size - 1);
|
||||
|
||||
memcpy(dst, src + src_size - n, n + 1);
|
||||
}
|
||||
|
||||
return(src_size);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ SUBDIRS = . examples
|
|||
libmysqld_sources= libmysqld.c lib_sql.cc emb_qcache.cc
|
||||
libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c \
|
||||
my_time.c
|
||||
sqlexamplessources = ha_example.cc ha_archive.cc ha_tina.cc
|
||||
sqlexamplessources = ha_example.cc ha_tina.cc
|
||||
|
||||
noinst_HEADERS = embedded_priv.h emb_qcache.h
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
|
|||
spatial.cc gstream.cc sql_help.cc tztime.cc sql_cursor.cc \
|
||||
sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \
|
||||
parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
|
||||
ha_blackhole.cc
|
||||
ha_blackhole.cc ha_archive.cc
|
||||
|
||||
libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) $(sqlexamplessources)
|
||||
libmysqld_a_SOURCES=
|
||||
|
|
|
|||
|
|
@ -423,9 +423,9 @@ int init_embedded_server(int argc, char **argv, char **groups)
|
|||
|
||||
acl_error= 0;
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
if (!(acl_error= acl_init((THD *)0, opt_noacl)) &&
|
||||
if (!(acl_error= acl_init(opt_noacl)) &&
|
||||
!opt_noacl)
|
||||
(void) grant_init((THD *)0);
|
||||
(void) grant_init();
|
||||
#endif
|
||||
if (acl_error || my_tz_init((THD *)0, default_tz_name, opt_bootstrap))
|
||||
{
|
||||
|
|
@ -514,8 +514,8 @@ void *create_embedded_thd(int client_flag, char *db)
|
|||
thd->db= db;
|
||||
thd->db_length= db ? strip_sp(db) : 0;
|
||||
#ifndef NO_EMBEDDED_ACCESS_CHECKS
|
||||
thd->db_access= DB_ACLS;
|
||||
thd->master_access= ~NO_ACCESS;
|
||||
thd->security_ctx->db_access= DB_ACLS;
|
||||
thd->security_ctx->master_access= ~NO_ACCESS;
|
||||
#endif
|
||||
thd->net.query_cache_query= 0;
|
||||
|
||||
|
|
@ -542,26 +542,27 @@ int check_embedded_connection(MYSQL *mysql)
|
|||
int check_embedded_connection(MYSQL *mysql)
|
||||
{
|
||||
THD *thd= (THD*)mysql->thd;
|
||||
Security_context *sctx= thd->security_ctx;
|
||||
int result;
|
||||
char scramble_buff[SCRAMBLE_LENGTH];
|
||||
int passwd_len;
|
||||
|
||||
if (mysql->options.client_ip)
|
||||
{
|
||||
thd->host= my_strdup(mysql->options.client_ip, MYF(0));
|
||||
thd->ip= my_strdup(thd->host, MYF(0));
|
||||
sctx->host= my_strdup(mysql->options.client_ip, MYF(0));
|
||||
sctx->ip= my_strdup(sctx->host, MYF(0));
|
||||
}
|
||||
else
|
||||
thd->host= (char*)my_localhost;
|
||||
thd->host_or_ip= thd->host;
|
||||
sctx->host= (char*)my_localhost;
|
||||
sctx->host_or_ip= sctx->host;
|
||||
|
||||
if (acl_check_host(thd->host,thd->ip))
|
||||
if (acl_check_host(sctx->host, sctx->ip))
|
||||
{
|
||||
result= ER_HOST_NOT_PRIVILEGED;
|
||||
goto err;
|
||||
}
|
||||
|
||||
thd->user= my_strdup(mysql->user, MYF(0));
|
||||
sctx->user= my_strdup(mysql->user, MYF(0));
|
||||
if (mysql->passwd && mysql->passwd[0])
|
||||
{
|
||||
memset(thd->scramble, 55, SCRAMBLE_LENGTH); // dummy scramble
|
||||
|
|
|
|||
|
|
@ -473,7 +473,8 @@ static int _ftb_check_phrase(const byte *s0, const byte *e0,
|
|||
for (;;)
|
||||
{
|
||||
n_word= (FT_WORD *)phrase_element->data;
|
||||
if (my_strnncoll(cs, h_word.pos, h_word.len, n_word->pos, n_word->len))
|
||||
if (my_strnncoll(cs, (const uchar *) h_word.pos, h_word.len,
|
||||
(const uchar *) n_word->pos, n_word->len))
|
||||
break;
|
||||
if (! (phrase_element= phrase_element->next))
|
||||
DBUG_RETURN(1);
|
||||
|
|
|
|||
|
|
@ -1092,7 +1092,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
|
|||
"Keypointers and record positions doesn't match");
|
||||
error=1;
|
||||
}
|
||||
else if (param->glob_crc != info->s->state.checksum &&
|
||||
else if (param->glob_crc != info->state->checksum &&
|
||||
(info->s->options &
|
||||
(HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD)))
|
||||
{
|
||||
|
|
@ -1388,7 +1388,7 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
|
|||
info->state->data_file_length=sort_param.max_pos;
|
||||
}
|
||||
if (param->testflag & T_CALC_CHECKSUM)
|
||||
share->state.checksum=param->glob_crc;
|
||||
info->state->checksum=param->glob_crc;
|
||||
|
||||
if (!(param->testflag & T_SILENT))
|
||||
{
|
||||
|
|
@ -2156,7 +2156,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
|
|||
my_errno);
|
||||
}
|
||||
if (param->testflag & T_CALC_CHECKSUM)
|
||||
share->state.checksum=param->glob_crc;
|
||||
info->state->checksum=param->glob_crc;
|
||||
|
||||
if (my_chsize(share->kfile,info->state->key_file_length,0,MYF(0)))
|
||||
mi_check_print_warning(param,
|
||||
|
|
@ -2577,7 +2577,7 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
|
|||
my_errno);
|
||||
}
|
||||
if (param->testflag & T_CALC_CHECKSUM)
|
||||
share->state.checksum=param->glob_crc;
|
||||
info->state->checksum=param->glob_crc;
|
||||
|
||||
if (my_chsize(share->kfile,info->state->key_file_length,0,MYF(0)))
|
||||
mi_check_print_warning(param,
|
||||
|
|
@ -3808,7 +3808,7 @@ int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename)
|
|||
(*org_info)->s->state.create_time=share.state.create_time;
|
||||
(*org_info)->s->state.unique=(*org_info)->this_unique=
|
||||
share.state.unique;
|
||||
(*org_info)->s->state.checksum=share.state.checksum;
|
||||
(*org_info)->state->checksum=info.state->checksum;
|
||||
(*org_info)->state->del=info.state->del;
|
||||
(*org_info)->s->state.dellink=share.state.dellink;
|
||||
(*org_info)->state->empty=info.state->empty;
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ int mi_delete(MI_INFO *info,const byte *record)
|
|||
|
||||
if ((*share->delete_record)(info))
|
||||
goto err; /* Remove record from database */
|
||||
info->s->state.checksum-=info->checksum;
|
||||
info->state->checksum-=info->checksum;
|
||||
|
||||
info->update= HA_STATE_CHANGED+HA_STATE_DELETED+HA_STATE_ROW_CHANGED;
|
||||
info->state->records--;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ int mi_delete_all_rows(MI_INFO *info)
|
|||
info->state->key_file_length=share->base.keystart;
|
||||
info->state->data_file_length=0;
|
||||
info->state->empty=info->state->key_empty=0;
|
||||
state->checksum=0;
|
||||
info->state->checksum=0;
|
||||
|
||||
for (i=share->base.max_key_block_length/MI_MIN_KEY_BLOCK_LENGTH ; i-- ; )
|
||||
state->key_del[i]= HA_OFFSET_ERROR;
|
||||
|
|
|
|||
|
|
@ -358,7 +358,7 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr,
|
|||
byte *blob_ptr;
|
||||
DBUG_ENTER("_mi_put_key_in_record");
|
||||
|
||||
blob_ptr= info->lastkey2; /* Place to put blob parts */
|
||||
blob_ptr= (byte*) info->lastkey2; /* Place to put blob parts */
|
||||
key=(byte*) info->lastkey; /* KEy that was read */
|
||||
key_end=key+info->lastkey_length;
|
||||
for (keyseg=info->s->keyinfo[keynr].seg ; keyseg->type ;keyseg++)
|
||||
|
|
|
|||
|
|
@ -199,7 +199,8 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
|
|||
DBUG_PRINT("warning",("saved_base_info_length: %d base_info_length: %d",
|
||||
len,MI_BASE_INFO_SIZE))
|
||||
}
|
||||
disk_pos=my_n_base_info_read((uchar*) disk_cache + base_pos, &share->base);
|
||||
disk_pos= (char*)
|
||||
my_n_base_info_read((uchar*) disk_cache + base_pos, &share->base);
|
||||
share->state.state_length=base_pos;
|
||||
|
||||
if (!(open_flags & HA_OPEN_FOR_REPAIR) &&
|
||||
|
|
@ -822,7 +823,7 @@ uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite)
|
|||
mi_sizestore(ptr,state->state.empty); ptr +=8;
|
||||
mi_sizestore(ptr,state->state.key_empty); ptr +=8;
|
||||
mi_int8store(ptr,state->auto_increment); ptr +=8;
|
||||
mi_int8store(ptr,(ulonglong) state->checksum);ptr +=8;
|
||||
mi_int8store(ptr,(ulonglong) state->state.checksum);ptr +=8;
|
||||
mi_int4store(ptr,state->process); ptr +=4;
|
||||
mi_int4store(ptr,state->unique); ptr +=4;
|
||||
mi_int4store(ptr,state->status); ptr +=4;
|
||||
|
|
@ -863,7 +864,7 @@ uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite)
|
|||
}
|
||||
|
||||
|
||||
char *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state)
|
||||
uchar *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state)
|
||||
{
|
||||
uint i,keys,key_parts,key_blocks;
|
||||
memcpy_fixed(&state->header,ptr, sizeof(state->header));
|
||||
|
|
@ -884,7 +885,7 @@ char *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state)
|
|||
state->state.empty = mi_sizekorr(ptr); ptr +=8;
|
||||
state->state.key_empty= mi_sizekorr(ptr); ptr +=8;
|
||||
state->auto_increment=mi_uint8korr(ptr); ptr +=8;
|
||||
state->checksum=(ha_checksum) mi_uint8korr(ptr); ptr +=8;
|
||||
state->state.checksum=(ha_checksum) mi_uint8korr(ptr); ptr +=8;
|
||||
state->process= mi_uint4korr(ptr); ptr +=4;
|
||||
state->unique = mi_uint4korr(ptr); ptr +=4;
|
||||
state->status = mi_uint4korr(ptr); ptr +=4;
|
||||
|
|
@ -974,7 +975,7 @@ uint mi_base_info_write(File file, MI_BASE_INFO *base)
|
|||
}
|
||||
|
||||
|
||||
char *my_n_base_info_read(uchar *ptr, MI_BASE_INFO *base)
|
||||
uchar *my_n_base_info_read(uchar *ptr, MI_BASE_INFO *base)
|
||||
{
|
||||
base->keystart = mi_sizekorr(ptr); ptr +=8;
|
||||
base->max_data_file_length = mi_sizekorr(ptr); ptr +=8;
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ static int run_test(const char *filename)
|
|||
pos=HA_OFFSET_ERROR;
|
||||
}
|
||||
if (found != row_count)
|
||||
printf("Found %ld of %ld rows\n", found,row_count);
|
||||
printf("Found %ld of %ld rows\n", (ulong) found, (ulong) row_count);
|
||||
}
|
||||
|
||||
if (!silent)
|
||||
|
|
@ -303,7 +303,8 @@ static int run_test(const char *filename)
|
|||
if ((error=mi_rrnd(file,read_record,i == 1 ? 0L : HA_OFFSET_ERROR)) == -1)
|
||||
{
|
||||
if (found != row_count-deleted)
|
||||
printf("Found only %ld of %ld rows\n",found,row_count-deleted);
|
||||
printf("Found only %ld of %ld rows\n", (ulong) found,
|
||||
(ulong) (row_count - deleted));
|
||||
break;
|
||||
}
|
||||
if (!error)
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ int mi_update(register MI_INFO *info, const byte *oldrec, byte *newrec)
|
|||
if (auto_key_changed)
|
||||
update_auto_increment(info,newrec);
|
||||
if (share->calc_checksum)
|
||||
share->state.checksum+=(info->checksum - old_checksum);
|
||||
info->state->checksum+=(info->checksum - old_checksum);
|
||||
|
||||
info->update= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED | HA_STATE_AKTIV |
|
||||
key_changed);
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ int mi_write(MI_INFO *info, byte *record)
|
|||
{
|
||||
if ((*share->write_record)(info,record))
|
||||
goto err;
|
||||
share->state.checksum+=info->checksum;
|
||||
info->state->checksum+=info->checksum;
|
||||
}
|
||||
if (share->base.auto_key)
|
||||
update_auto_increment(info,record);
|
||||
|
|
|
|||
|
|
@ -705,7 +705,7 @@ get_one_option(int optid,
|
|||
fprintf(stderr, "Invalid value of stats_method: %s.\n", argument);
|
||||
exit(1);
|
||||
}
|
||||
check_param.stats_method= method-1;
|
||||
check_param.stats_method= (enum_mi_stats_method) (method-1);
|
||||
break;
|
||||
}
|
||||
#ifdef DEBUG /* Only useful if debugging */
|
||||
|
|
@ -1261,7 +1261,7 @@ static void descript(MI_CHECK *param, register MI_INFO *info, my_string name)
|
|||
share->base.raid_chunksize);
|
||||
}
|
||||
if (share->options & (HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD))
|
||||
printf("Checksum: %23s\n",llstr(info->s->state.checksum,llbuff));
|
||||
printf("Checksum: %23s\n",llstr(info->state->checksum,llbuff));
|
||||
;
|
||||
if (share->options & HA_OPTION_DELAY_KEY_WRITE)
|
||||
printf("Keys are only flushed at close\n");
|
||||
|
|
@ -1576,7 +1576,7 @@ static int mi_sort_records(MI_CHECK *param,
|
|||
old_record_count=info->state->records;
|
||||
info->state->records=0;
|
||||
if (sort_info.new_data_file_type != COMPRESSED_RECORD)
|
||||
share->state.checksum=0;
|
||||
info->state->checksum=0;
|
||||
|
||||
if (sort_record_index(&sort_param,info,keyinfo,share->state.key_root[sort_key],
|
||||
temp_buff, sort_key,new_file,update_index) ||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ typedef struct st_mi_status_info
|
|||
my_off_t key_empty; /* lost space in indexfile */
|
||||
my_off_t key_file_length;
|
||||
my_off_t data_file_length;
|
||||
ha_checksum checksum;
|
||||
} MI_STATUS_INFO;
|
||||
|
||||
typedef struct st_mi_state_info
|
||||
|
|
@ -75,7 +76,6 @@ typedef struct st_mi_state_info
|
|||
ulong sec_index_changed; /* Updated when new sec_index */
|
||||
ulong sec_index_used; /* which extra index are in use */
|
||||
ulonglong key_map; /* Which keys are in use */
|
||||
ha_checksum checksum;
|
||||
ulong version; /* timestamp of create */
|
||||
time_t create_time; /* Time when created database */
|
||||
time_t recover_time; /* Time for last recover */
|
||||
|
|
@ -680,10 +680,10 @@ extern uint read_pack_length(uint version, const uchar *buf, ulong *length);
|
|||
extern uint calc_pack_length(uint version, ulong length);
|
||||
|
||||
uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite);
|
||||
char *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state);
|
||||
uchar *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state);
|
||||
uint mi_state_info_read_dsk(File file, MI_STATE_INFO *state, my_bool pRead);
|
||||
uint mi_base_info_write(File file, MI_BASE_INFO *base);
|
||||
char *my_n_base_info_read(uchar *ptr, MI_BASE_INFO *base);
|
||||
uchar *my_n_base_info_read(uchar *ptr, MI_BASE_INFO *base);
|
||||
int mi_keyseg_write(File file, const HA_KEYSEG *keyseg);
|
||||
char *mi_keyseg_read(char *ptr, HA_KEYSEG *keyseg);
|
||||
uint mi_keydef_write(File file, MI_KEYDEF *keydef);
|
||||
|
|
|
|||
|
|
@ -2008,7 +2008,7 @@ static char *hexdigits(ulonglong value)
|
|||
static int write_header(PACK_MRG_INFO *mrg,uint head_length,uint trees,
|
||||
my_off_t tot_elements,my_off_t filelength)
|
||||
{
|
||||
byte *buff=file_buffer.pos;
|
||||
byte *buff= (byte*) file_buffer.pos;
|
||||
|
||||
bzero(buff,HEAD_LENGTH);
|
||||
memcpy_fixed(buff,myisam_pack_file_magic,4);
|
||||
|
|
@ -2024,7 +2024,7 @@ static int write_header(PACK_MRG_INFO *mrg,uint head_length,uint trees,
|
|||
if (test_only)
|
||||
return 0;
|
||||
VOID(my_seek(file_buffer.file,0L,MY_SEEK_SET,MYF(0)));
|
||||
return my_write(file_buffer.file,file_buffer.pos,HEAD_LENGTH,
|
||||
return my_write(file_buffer.file,(const byte *) file_buffer.pos,HEAD_LENGTH,
|
||||
MYF(MY_WME | MY_NABP | MY_WAIT_IF_FULL)) != 0;
|
||||
}
|
||||
|
||||
|
|
@ -2472,7 +2472,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
|
|||
{
|
||||
if (flush_buffer((ulong) max_calc_length + (ulong) max_pack_length))
|
||||
break;
|
||||
record_pos=file_buffer.pos;
|
||||
record_pos= (byte*) file_buffer.pos;
|
||||
file_buffer.pos+=max_pack_length;
|
||||
for (start_pos=record, count= huff_counts; count < end_count ; count++)
|
||||
{
|
||||
|
|
@ -2795,7 +2795,8 @@ static char *make_old_name(char *new_name, char *old_name)
|
|||
static void init_file_buffer(File file, pbool read_buffer)
|
||||
{
|
||||
file_buffer.file=file;
|
||||
file_buffer.buffer=my_malloc(ALIGN_SIZE(RECORD_CACHE_SIZE),MYF(MY_WME));
|
||||
file_buffer.buffer= (uchar*) my_malloc(ALIGN_SIZE(RECORD_CACHE_SIZE),
|
||||
MYF(MY_WME));
|
||||
file_buffer.end=file_buffer.buffer+ALIGN_SIZE(RECORD_CACHE_SIZE)-8;
|
||||
file_buffer.pos_in_file=0;
|
||||
error_on_write=0;
|
||||
|
|
@ -2837,7 +2838,8 @@ static int flush_buffer(ulong neaded_length)
|
|||
file_buffer.pos_in_file+=length;
|
||||
if (test_only)
|
||||
return 0;
|
||||
if (error_on_write|| my_write(file_buffer.file,file_buffer.buffer,
|
||||
if (error_on_write|| my_write(file_buffer.file,
|
||||
(const byte*) file_buffer.buffer,
|
||||
length,
|
||||
MYF(MY_WME | MY_NABP | MY_WAIT_IF_FULL)))
|
||||
{
|
||||
|
|
@ -2850,13 +2852,13 @@ static int flush_buffer(ulong neaded_length)
|
|||
{
|
||||
char *tmp;
|
||||
neaded_length+=256; /* some margin */
|
||||
tmp=my_realloc(file_buffer.buffer, neaded_length,MYF(MY_WME));
|
||||
tmp= my_realloc((char*) file_buffer.buffer, neaded_length,MYF(MY_WME));
|
||||
if (!tmp)
|
||||
return 1;
|
||||
file_buffer.pos= ((uchar*) tmp +
|
||||
(ulong) (file_buffer.pos - file_buffer.buffer));
|
||||
file_buffer.buffer=tmp;
|
||||
file_buffer.end=tmp+neaded_length-8;
|
||||
file_buffer.buffer= (uchar*) tmp;
|
||||
file_buffer.end= (uchar*) (tmp+neaded_length-8);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -2965,7 +2967,7 @@ static int save_state(MI_INFO *isam_file,PACK_MRG_INFO *mrg,my_off_t new_length,
|
|||
share->state.key_root[key]= HA_OFFSET_ERROR;
|
||||
for (key=0 ; key < share->state.header.max_block_size ; key++)
|
||||
share->state.key_del[key]= HA_OFFSET_ERROR;
|
||||
share->state.checksum=crc; /* Save crc here */
|
||||
isam_file->state->checksum=crc; /* Save crc here */
|
||||
share->changed=1; /* Force write of header */
|
||||
share->state.open_count=0;
|
||||
share->global_changed=0;
|
||||
|
|
@ -3001,7 +3003,7 @@ static int save_state_mrg(File file,PACK_MRG_INFO *mrg,my_off_t new_length,
|
|||
state.dellink= HA_OFFSET_ERROR;
|
||||
state.version=(ulong) time((time_t*) 0);
|
||||
mi_clear_all_keys_active(state.key_map);
|
||||
state.checksum=crc;
|
||||
state.state.checksum=crc;
|
||||
if (isam_file->s->base.keys)
|
||||
isamchk_neaded=1;
|
||||
state.changed=STATE_CHANGED | STATE_NOT_ANALYZED; /* Force check of table */
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ static int sp_add_point_to_mbr(uchar *(*wkb), uchar *end, uint n_dims,
|
|||
{
|
||||
if ((*wkb) > end - 8)
|
||||
return -1;
|
||||
get_double(&ord, *wkb);
|
||||
get_double(&ord, (const byte*) *wkb);
|
||||
(*wkb)+= 8;
|
||||
if (ord < *mbr)
|
||||
float8store((char*) mbr, ord);
|
||||
|
|
|
|||
|
|
@ -680,7 +680,8 @@ sub mtr_mysqladmin_shutdown {
|
|||
mtr_add_arg($args, "shutdown");
|
||||
# We don't wait for termination of mysqladmin
|
||||
my $pid= mtr_spawn($::exe_mysqladmin, $args,
|
||||
"", $::path_manager_log, $::path_manager_log, "");
|
||||
"", $::path_manager_log, $::path_manager_log, "",
|
||||
{ append_log_file => 1 });
|
||||
$mysql_admin_pids{$pid}= 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -257,11 +257,11 @@ sub mtr_print_header () {
|
|||
print "\n";
|
||||
if ( $::opt_timer )
|
||||
{
|
||||
print "TEST RESULT TIME (ms)\n";
|
||||
print "TEST RESULT TIME (ms)\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "TEST RESULT\n";
|
||||
print "TEST RESULT\n";
|
||||
}
|
||||
mtr_print_line();
|
||||
print "\n";
|
||||
|
|
|
|||
|
|
@ -2,37 +2,35 @@
|
|||
# -*- cperl -*-
|
||||
|
||||
# This is a transformation of the "mysql-test-run" Bourne shell script
|
||||
# to Perl. This is just an intermediate step, the goal is to rewrite
|
||||
# the Perl script to C. The complexity of the mysql-test-run script
|
||||
# makes it a bit hard to write and debug it as a C program directly,
|
||||
# so this is considered a prototype.
|
||||
# to Perl. There are reasons this rewrite is not the prettiest Perl
|
||||
# you have seen
|
||||
#
|
||||
# Because of this the Perl coding style may in some cases look a bit
|
||||
# funny. The rules used are
|
||||
# - The original script is huge and for most part uncommented,
|
||||
# not even a usage description of the flags.
|
||||
#
|
||||
# - The coding style is as close as possible to the C/C++ MySQL
|
||||
# coding standard.
|
||||
# - There has been an attempt to write a replacement in C for the
|
||||
# original Bourne shell script. It was kind of working but lacked
|
||||
# lot of functionality to really be a replacement. Not to redo
|
||||
# that mistake and catch all the obscure features of the original
|
||||
# script, the rewrite in Perl is more close to the original script
|
||||
# meaning it also share some of the ugly parts as well.
|
||||
#
|
||||
# - Where NULL is to be returned, the undefined value is used.
|
||||
# - The original intention was that this script was to be a prototype
|
||||
# to be the base for a new C version with full functionality. Since
|
||||
# then it was decided that the Perl version should replace the
|
||||
# Bourne shell version, but the Perl style still reflects the wish
|
||||
# to make the Perl to C step easy.
|
||||
#
|
||||
# - Regexp comparisons are simple and can be translated to strcmp
|
||||
# and other string functions. To ease this transformation matching
|
||||
# is done in the lib "lib/mtr_match.pl", i.e. regular expressions
|
||||
# should be avoided in the main program.
|
||||
# Some coding style from the original intent has been kept
|
||||
#
|
||||
# - The "unless" construct is not to be used. It is the same as "if !".
|
||||
#
|
||||
# - opendir/readdir/closedir is used instead of glob()/<*>.
|
||||
# - To make this Perl script easy to alter even for those that not
|
||||
# code Perl that often, the coding style is as close as possible to
|
||||
# the C/C++ MySQL coding standard.
|
||||
#
|
||||
# - All lists of arguments to send to commands are Perl lists/arrays,
|
||||
# not strings we append args to. Within reason, most string
|
||||
# concatenation for arguments should be avoided.
|
||||
#
|
||||
# - sprintf() is to be used, within reason, for all string creation.
|
||||
# This mtr_add_arg() function is also based on sprintf(), i.e. you
|
||||
# use a format string and put the variable argument in the argument
|
||||
# list.
|
||||
#
|
||||
# - Functions defined in the main program are not to be prefixed,
|
||||
# functions in "library files" are to be prefixed with "mtr_" (for
|
||||
# Mysql-Test-Run). There are some exceptions, code that fits best in
|
||||
|
|
@ -476,6 +474,7 @@ sub command_line_setup () {
|
|||
# Read the command line
|
||||
# Note: Keep list, and the order, in sync with usage at end of this file
|
||||
|
||||
Getopt::Long::Configure("pass_through");
|
||||
GetOptions(
|
||||
# Control what engine/variation to run
|
||||
'embedded-server' => \$opt_embedded_server,
|
||||
|
|
@ -566,7 +565,21 @@ sub command_line_setup () {
|
|||
usage("");
|
||||
}
|
||||
|
||||
@opt_cases= @ARGV;
|
||||
foreach my $arg ( @ARGV )
|
||||
{
|
||||
if ( $arg =~ /^--skip-/ )
|
||||
{
|
||||
push(@opt_extra_mysqld_opt, $arg);
|
||||
}
|
||||
elsif ( $arg =~ /^-/ )
|
||||
{
|
||||
usage("Invalid option \"$arg\"");
|
||||
}
|
||||
else
|
||||
{
|
||||
push(@opt_cases, $arg);
|
||||
}
|
||||
}
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# Set the "var/" directory, as it is the base for everything else
|
||||
|
|
@ -658,11 +671,6 @@ sub command_line_setup () {
|
|||
mtr_error("Coverage test needs the source - please use source dist");
|
||||
}
|
||||
|
||||
if ( $glob_use_embedded_server and ! $opt_source_dist )
|
||||
{
|
||||
mtr_error("Embedded server needs source tree - please use source dist");
|
||||
}
|
||||
|
||||
if ( $opt_gdb )
|
||||
{
|
||||
$opt_wait_timeout= 300;
|
||||
|
|
@ -755,78 +763,96 @@ sub command_line_setup () {
|
|||
|
||||
# Put this into a hash, will be a C struct
|
||||
|
||||
$master->[0]->{'path_myddir'}= "$opt_vardir/master-data";
|
||||
$master->[0]->{'path_myerr'}= "$opt_vardir/log/master.err";
|
||||
$master->[0]->{'path_mylog'}= "$opt_vardir/log/master.log";
|
||||
$master->[0]->{'path_mypid'}= "$opt_vardir/run/master.pid";
|
||||
$master->[0]->{'path_mysock'}= "$opt_tmpdir/master.sock";
|
||||
$master->[0]->{'path_myport'}= $opt_master_myport;
|
||||
$master->[0]->{'start_timeout'}= 400; # enough time create innodb tables
|
||||
$master->[0]=
|
||||
{
|
||||
path_myddir => "$opt_vardir/master-data",
|
||||
path_myerr => "$opt_vardir/log/master.err",
|
||||
path_mylog => "$opt_vardir/log/master.log",
|
||||
path_mypid => "$opt_vardir/run/master.pid",
|
||||
path_mysock => "$opt_tmpdir/master.sock",
|
||||
path_myport => $opt_master_myport,
|
||||
start_timeout => 400, # enough time create innodb tables
|
||||
|
||||
$master->[0]->{'ndbcluster'}= 1; # ndbcluster not started
|
||||
ndbcluster => 1, # ndbcluster not started
|
||||
};
|
||||
|
||||
$master->[1]->{'path_myddir'}= "$opt_vardir/master1-data";
|
||||
$master->[1]->{'path_myerr'}= "$opt_vardir/log/master1.err";
|
||||
$master->[1]->{'path_mylog'}= "$opt_vardir/log/master1.log";
|
||||
$master->[1]->{'path_mypid'}= "$opt_vardir/run/master1.pid";
|
||||
$master->[1]->{'path_mysock'}= "$opt_tmpdir/master1.sock";
|
||||
$master->[1]->{'path_myport'}= $opt_master_myport + 1;
|
||||
$master->[1]->{'start_timeout'}= 400; # enough time create innodb tables
|
||||
$master->[1]=
|
||||
{
|
||||
path_myddir => "$opt_vardir/master1-data",
|
||||
path_myerr => "$opt_vardir/log/master1.err",
|
||||
path_mylog => "$opt_vardir/log/master1.log",
|
||||
path_mypid => "$opt_vardir/run/master1.pid",
|
||||
path_mysock => "$opt_tmpdir/master1.sock",
|
||||
path_myport => $opt_master_myport + 1,
|
||||
start_timeout => 400, # enough time create innodb tables
|
||||
};
|
||||
|
||||
$slave->[0]->{'path_myddir'}= "$opt_vardir/slave-data";
|
||||
$slave->[0]->{'path_myerr'}= "$opt_vardir/log/slave.err";
|
||||
$slave->[0]->{'path_mylog'}= "$opt_vardir/log/slave.log";
|
||||
$slave->[0]->{'path_mypid'}= "$opt_vardir/run/slave.pid";
|
||||
$slave->[0]->{'path_mysock'}= "$opt_tmpdir/slave.sock";
|
||||
$slave->[0]->{'path_myport'}= $opt_slave_myport;
|
||||
$slave->[0]->{'start_timeout'}= 400;
|
||||
$slave->[0]=
|
||||
{
|
||||
path_myddir => "$opt_vardir/slave-data",
|
||||
path_myerr => "$opt_vardir/log/slave.err",
|
||||
path_mylog => "$opt_vardir/log/slave.log",
|
||||
path_mypid => "$opt_vardir/run/slave.pid",
|
||||
path_mysock => "$opt_tmpdir/slave.sock",
|
||||
path_myport => $opt_slave_myport,
|
||||
start_timeout => 400,
|
||||
};
|
||||
|
||||
$slave->[1]->{'path_myddir'}= "$opt_vardir/slave1-data";
|
||||
$slave->[1]->{'path_myerr'}= "$opt_vardir/log/slave1.err";
|
||||
$slave->[1]->{'path_mylog'}= "$opt_vardir/log/slave1.log";
|
||||
$slave->[1]->{'path_mypid'}= "$opt_vardir/run/slave1.pid";
|
||||
$slave->[1]->{'path_mysock'}= "$opt_tmpdir/slave1.sock";
|
||||
$slave->[1]->{'path_myport'}= $opt_slave_myport + 1;
|
||||
$slave->[1]->{'start_timeout'}= 300;
|
||||
$slave->[1]=
|
||||
{
|
||||
path_myddir => "$opt_vardir/slave1-data",
|
||||
path_myerr => "$opt_vardir/log/slave1.err",
|
||||
path_mylog => "$opt_vardir/log/slave1.log",
|
||||
path_mypid => "$opt_vardir/run/slave1.pid",
|
||||
path_mysock => "$opt_tmpdir/slave1.sock",
|
||||
path_myport => $opt_slave_myport + 1,
|
||||
start_timeout => 300,
|
||||
};
|
||||
|
||||
$slave->[2]->{'path_myddir'}= "$opt_vardir/slave2-data";
|
||||
$slave->[2]->{'path_myerr'}= "$opt_vardir/log/slave2.err";
|
||||
$slave->[2]->{'path_mylog'}= "$opt_vardir/log/slave2.log";
|
||||
$slave->[2]->{'path_mypid'}= "$opt_vardir/run/slave2.pid";
|
||||
$slave->[2]->{'path_mysock'}= "$opt_tmpdir/slave2.sock";
|
||||
$slave->[2]->{'path_myport'}= $opt_slave_myport + 2;
|
||||
$slave->[2]->{'start_timeout'}= 300;
|
||||
$slave->[2]=
|
||||
{
|
||||
path_myddir => "$opt_vardir/slave2-data",
|
||||
path_myerr => "$opt_vardir/log/slave2.err",
|
||||
path_mylog => "$opt_vardir/log/slave2.log",
|
||||
path_mypid => "$opt_vardir/run/slave2.pid",
|
||||
path_mysock => "$opt_tmpdir/slave2.sock",
|
||||
path_myport => $opt_slave_myport + 2,
|
||||
start_timeout => 300,
|
||||
};
|
||||
|
||||
$instance_manager->{'path_err'}= "$opt_vardir/log/im.err";
|
||||
$instance_manager->{'path_log'}= "$opt_vardir/log/im.log";
|
||||
$instance_manager->{'path_pid'}= "$opt_vardir/run/im.pid";
|
||||
$instance_manager->{'path_sock'}= "$opt_tmpdir/im.sock";
|
||||
$instance_manager->{'port'}= $im_port;
|
||||
$instance_manager->{'start_timeout'}= $master->[0]->{'start_timeout'};
|
||||
$instance_manager->{'admin_login'}= 'im_admin';
|
||||
$instance_manager->{'admin_password'}= 'im_admin_secret';
|
||||
$instance_manager->{'admin_sha1'}= '*598D51AD2DFF7792045D6DF3DDF9AA1AF737B295';
|
||||
$instance_manager->{'password_file'}= "$opt_vardir/im.passwd";
|
||||
$instance_manager->{'defaults_file'}= "$opt_vardir/im.cnf";
|
||||
|
||||
$instance_manager->{'instances'}->[0]->{'server_id'}= 1;
|
||||
$instance_manager->{'instances'}->[0]->{'port'}= $im_mysqld1_port;
|
||||
$instance_manager->{'instances'}->[0]->{'path_datadir'}=
|
||||
"$opt_vardir/im_mysqld_1.data";
|
||||
$instance_manager->{'instances'}->[0]->{'path_sock'}=
|
||||
"$opt_vardir/mysqld_1.sock";
|
||||
$instance_manager->{'instances'}->[0]->{'path_pid'}=
|
||||
"$opt_vardir/mysqld_1.pid";
|
||||
$instance_manager=
|
||||
{
|
||||
path_err => "$opt_vardir/log/im.err",
|
||||
path_log => "$opt_vardir/log/im.log",
|
||||
path_pid => "$opt_vardir/run/im.pid",
|
||||
path_sock => "$opt_tmpdir/im.sock",
|
||||
port => $im_port,
|
||||
start_timeout => $master->[0]->{'start_timeout'},
|
||||
admin_login => 'im_admin',
|
||||
admin_password => 'im_admin_secret',
|
||||
admin_sha1 => '*598D51AD2DFF7792045D6DF3DDF9AA1AF737B295',
|
||||
password_file => "$opt_vardir/im.passwd",
|
||||
defaults_file => "$opt_vardir/im.cnf",
|
||||
};
|
||||
|
||||
$instance_manager->{'instances'}->[1]->{'server_id'}= 2;
|
||||
$instance_manager->{'instances'}->[1]->{'port'}= $im_mysqld2_port;
|
||||
$instance_manager->{'instances'}->[1]->{'path_datadir'}=
|
||||
"$opt_vardir/im_mysqld_2.data";
|
||||
$instance_manager->{'instances'}->[1]->{'path_sock'}=
|
||||
"$opt_vardir/mysqld_2.sock";
|
||||
$instance_manager->{'instances'}->[1]->{'path_pid'}=
|
||||
"$opt_vardir/mysqld_2.pid";
|
||||
$instance_manager->{'instances'}->[1]->{'nonguarded'}= 1;
|
||||
$instance_manager->{'instances'}->[0]=
|
||||
{
|
||||
server_id => 1,
|
||||
port => $im_mysqld1_port,
|
||||
path_datadir => "$opt_vardir/im_mysqld_1.data",
|
||||
path_sock => "$opt_vardir/mysqld_1.sock",
|
||||
path_pid => "$opt_vardir/mysqld_1.pid",
|
||||
};
|
||||
|
||||
$instance_manager->{'instances'}->[1]=
|
||||
{
|
||||
server_id => 2,
|
||||
port => $im_mysqld2_port,
|
||||
path_datadir => "$opt_vardir/im_mysqld_2.data",
|
||||
path_sock => "$opt_vardir/mysqld_2.sock",
|
||||
path_pid => "$opt_vardir/mysqld_2.pid",
|
||||
nonguarded => 1,
|
||||
};
|
||||
|
||||
if ( $opt_extern )
|
||||
{
|
||||
|
|
@ -871,7 +897,7 @@ sub executable_setup () {
|
|||
if ( $glob_use_embedded_server )
|
||||
{
|
||||
my $path_examples= "$glob_basedir/libmysqld/examples";
|
||||
$exe_mysqltest= mtr_exe_exists("$path_examples/mysqltest");
|
||||
$exe_mysqltest= mtr_exe_exists("$path_examples/mysqltest_embedded");
|
||||
$exe_mysql_client_test=
|
||||
mtr_exe_exists("$path_examples/mysql_client_test_embedded",
|
||||
"/usr/bin/false");
|
||||
|
|
@ -898,7 +924,6 @@ sub executable_setup () {
|
|||
else
|
||||
{
|
||||
$path_client_bindir= mtr_path_exists("$glob_basedir/bin");
|
||||
$exe_mysqltest= mtr_exe_exists("$path_client_bindir/mysqltest");
|
||||
$exe_mysqldump= mtr_exe_exists("$path_client_bindir/mysqldump");
|
||||
$exe_mysqlshow= mtr_exe_exists("$path_client_bindir/mysqlshow");
|
||||
$exe_mysqlbinlog= mtr_exe_exists("$path_client_bindir/mysqlbinlog");
|
||||
|
|
@ -2137,7 +2162,8 @@ sub mysqld_start ($$$$) {
|
|||
{
|
||||
if ( $pid= mtr_spawn($exe, $args, "",
|
||||
$master->[$idx]->{'path_myerr'},
|
||||
$master->[$idx]->{'path_myerr'}, "",
|
||||
$master->[$idx]->{'path_myerr'},
|
||||
"",
|
||||
{ append_log_file => 1 }) )
|
||||
{
|
||||
return sleep_until_file_created($master->[$idx]->{'path_mypid'},
|
||||
|
|
@ -2149,7 +2175,8 @@ sub mysqld_start ($$$$) {
|
|||
{
|
||||
if ( $pid= mtr_spawn($exe, $args, "",
|
||||
$slave->[$idx]->{'path_myerr'},
|
||||
$slave->[$idx]->{'path_myerr'}, "",
|
||||
$slave->[$idx]->{'path_myerr'},
|
||||
"",
|
||||
{ append_log_file => 1 }) )
|
||||
{
|
||||
return sleep_until_file_created($slave->[$idx]->{'path_mypid'},
|
||||
|
|
@ -2492,7 +2519,7 @@ sub run_mysqltest ($) {
|
|||
$ENV{'MYSQL_TEST'}= "$exe_mysqltest " . join(" ", @$args);
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Add args that should not go into the MYSQL_TEST environment var
|
||||
# Add arguments that should not go into the MYSQL_TEST env var
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
mtr_add_arg($args, "-R");
|
||||
|
|
|
|||
|
|
@ -1429,10 +1429,10 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||
1 SIMPLE t1 range v v 13 NULL # Using where
|
||||
explain select count(*) from t1 where v between 'a' and 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 13 NULL # Using where
|
||||
1 SIMPLE t1 ref v v 13 const # Using where
|
||||
explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 13 NULL # Using where
|
||||
1 SIMPLE t1 ref v v 13 const # Using where
|
||||
alter table t1 add unique(v);
|
||||
ERROR 23000: Duplicate entry '{ ' for key 1
|
||||
alter table t1 add key(v);
|
||||
|
|
@ -1622,10 +1622,10 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||
1 SIMPLE t1 range v v 258 NULL # Using where
|
||||
explain select count(*) from t1 where v between 'a' and 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 258 NULL # Using where
|
||||
1 SIMPLE t1 ref v v 258 const # Using where
|
||||
explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 258 NULL # Using where
|
||||
1 SIMPLE t1 ref v v 258 const # Using where
|
||||
explain select * from t1 where v='a';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref v v 258 const # Using where
|
||||
|
|
@ -1702,10 +1702,10 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||
1 SIMPLE t1 range v v 33 NULL # Using where
|
||||
explain select count(*) from t1 where v between 'a' and 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 33 NULL # Using where
|
||||
1 SIMPLE t1 ref v v 33 const # Using where
|
||||
explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 33 NULL # Using where
|
||||
1 SIMPLE t1 ref v v 33 const # Using where
|
||||
explain select * from t1 where v='a';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref v v 33 const # Using where
|
||||
|
|
|
|||
|
|
@ -103,8 +103,8 @@ t1 CREATE TABLE `t1` (
|
|||
`c2` varchar(1) character set latin1 collate latin1_danish_ci NOT NULL default '',
|
||||
`c3` varbinary(1) NOT NULL default '',
|
||||
`c4` varbinary(1) NOT NULL default '',
|
||||
`c5` varbinary(4) NOT NULL default '',
|
||||
`c6` varbinary(4) NOT NULL default '',
|
||||
`c5` varbinary(3) NOT NULL default '',
|
||||
`c6` varbinary(3) NOT NULL default '',
|
||||
`c7` decimal(2,1) NOT NULL default '0.0',
|
||||
`c8` decimal(2,1) NOT NULL default '0.0',
|
||||
`c9` decimal(2,1) default NULL,
|
||||
|
|
@ -152,11 +152,11 @@ SHOW CREATE TABLE t1;
|
|||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`COALESCE(1)` int(1) NOT NULL default '0',
|
||||
`COALESCE(1.0)` decimal(2,1) NOT NULL default '0.0',
|
||||
`COALESCE(1.0)` decimal(2,1) unsigned NOT NULL default '0.0',
|
||||
`COALESCE('a')` varchar(1) NOT NULL default '',
|
||||
`COALESCE(1,1.0)` decimal(2,1) NOT NULL default '0.0',
|
||||
`COALESCE(1,'1')` varbinary(1) NOT NULL default '',
|
||||
`COALESCE(1.1,'1')` varbinary(4) NOT NULL default '',
|
||||
`COALESCE(1.1,'1')` varbinary(3) NOT NULL default '',
|
||||
`COALESCE('a' COLLATE latin1_bin,'b')` varchar(1) character set latin1 collate latin1_bin NOT NULL default ''
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1;
|
||||
|
|
|
|||
|
|
@ -74,6 +74,18 @@ CAST(DATE "2004-01-22 21:45:33" AS BINARY(4))
|
|||
2004
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect CHAR(4) value: '2004-01-22 21:45:33'
|
||||
select CAST(0xb3 as signed);
|
||||
CAST(0xb3 as signed)
|
||||
179
|
||||
select CAST(0x8fffffffffffffff as signed);
|
||||
CAST(0x8fffffffffffffff as signed)
|
||||
-8070450532247928833
|
||||
select CAST(0xffffffffffffffff as unsigned);
|
||||
CAST(0xffffffffffffffff as unsigned)
|
||||
18446744073709551615
|
||||
select CAST(0xfffffffffffffffe as signed);
|
||||
CAST(0xfffffffffffffffe as signed)
|
||||
-2
|
||||
select cast('-10a' as signed integer);
|
||||
cast('-10a' as signed integer)
|
||||
-10
|
||||
|
|
|
|||
|
|
@ -18,6 +18,6 @@ SET @@session.sql_mode=0;
|
|||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
|
||||
insert into t2 values (@v);
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
drop table t2;
|
||||
|
|
|
|||
|
|
@ -368,3 +368,15 @@ create table t2 (a int);
|
|||
select * from (select * from t1,t2) foo;
|
||||
ERROR 42S21: Duplicate column name 'a'
|
||||
drop table t1,t2;
|
||||
create table t1 (ID int unsigned not null auto_increment,
|
||||
DATA varchar(5) not null, primary key (ID));
|
||||
create table t2 (ID int unsigned not null auto_increment,
|
||||
DATA varchar(5) not null, FID int unsigned not null,
|
||||
primary key (ID));
|
||||
select A.* from (t1 inner join (select * from t2) as A on t1.ID = A.FID);
|
||||
ID DATA FID
|
||||
select t2.* from ((select * from t1) as A inner join t2 on A.ID = t2.FID);
|
||||
ID DATA FID
|
||||
select t2.* from (select * from t1) as A inner join t2 on A.ID = t2.FID;
|
||||
ID DATA FID
|
||||
drop table t1, t2;
|
||||
|
|
|
|||
|
|
@ -379,10 +379,10 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||
1 SIMPLE t1 ALL v NULL NULL NULL 271 Using where
|
||||
explain select count(*) from t1 where v between 'a' and 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL v NULL NULL NULL 271 Using where
|
||||
1 SIMPLE t1 ref v v 13 const 10 Using where
|
||||
explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL v NULL NULL NULL 271 Using where
|
||||
1 SIMPLE t1 ref v v 13 const 10 Using where
|
||||
alter table t1 add unique(v);
|
||||
ERROR 23000: Duplicate entry '{ ' for key 1
|
||||
select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a' order by length(concat('*',v,'*',c,'*',t,'*'));
|
||||
|
|
@ -602,10 +602,10 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||
1 SIMPLE t1 range v v 13 NULL # Using where
|
||||
explain select count(*) from t1 where v between 'a' and 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 13 NULL # Using where
|
||||
1 SIMPLE t1 ref v v 13 const # Using where
|
||||
explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 13 NULL # Using where
|
||||
1 SIMPLE t1 ref v v 13 const # Using where
|
||||
alter table t1 add unique(v);
|
||||
ERROR 23000: Duplicate entry '{ ' for key 1
|
||||
select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a' order by length(concat('*',v,'*',c,'*',t,'*'));
|
||||
|
|
|
|||
|
|
@ -1997,10 +1997,10 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||
1 SIMPLE t1 range v v 13 NULL # Using where; Using index
|
||||
explain select count(*) from t1 where v between 'a' and 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 13 NULL # Using where; Using index
|
||||
1 SIMPLE t1 ref v v 13 const # Using where; Using index
|
||||
explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 13 NULL # Using where; Using index
|
||||
1 SIMPLE t1 ref v v 13 const # Using where; Using index
|
||||
alter table t1 add unique(v);
|
||||
ERROR 23000: Duplicate entry '{ ' for key 1
|
||||
alter table t1 add key(v);
|
||||
|
|
@ -2188,10 +2188,10 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||
1 SIMPLE t1 range v v 303 NULL # Using where; Using index
|
||||
explain select count(*) from t1 where v between 'a' and 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 303 NULL # Using where; Using index
|
||||
1 SIMPLE t1 ref v v 303 const # Using where; Using index
|
||||
explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 303 NULL # Using where; Using index
|
||||
1 SIMPLE t1 ref v v 303 const # Using where; Using index
|
||||
explain select * from t1 where v='a';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref v v 303 const # Using where
|
||||
|
|
@ -2268,10 +2268,10 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||
1 SIMPLE t1 range v v 33 NULL # Using where
|
||||
explain select count(*) from t1 where v between 'a' and 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 33 NULL # Using where
|
||||
1 SIMPLE t1 ref v v 33 const # Using where
|
||||
explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 33 NULL # Using where
|
||||
1 SIMPLE t1 ref v v 33 const # Using where
|
||||
explain select * from t1 where v='a';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref v v 33 const # Using where
|
||||
|
|
@ -2616,3 +2616,31 @@ SET FOREIGN_KEY_CHECKS=1;
|
|||
INSERT INTO t2 VALUES(3);
|
||||
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test/t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`))
|
||||
DROP TABLE t2;
|
||||
create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1;
|
||||
insert into test_checksum values (1),(2);
|
||||
set autocommit=0;
|
||||
checksum table test_checksum;
|
||||
Table Checksum
|
||||
test.test_checksum 1531596814
|
||||
insert into test_checksum values(3);
|
||||
checksum table test_checksum;
|
||||
Table Checksum
|
||||
test.test_checksum 2605035534
|
||||
commit;
|
||||
checksum table test_checksum;
|
||||
Table Checksum
|
||||
test.test_checksum 127268899
|
||||
commit;
|
||||
drop table test_checksum;
|
||||
create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1;
|
||||
insert into test_checksum values (1),(2);
|
||||
set autocommit=1;
|
||||
checksum table test_checksum;
|
||||
Table Checksum
|
||||
test.test_checksum 1531596814
|
||||
set autocommit=1;
|
||||
insert into test_checksum values(3);
|
||||
checksum table test_checksum;
|
||||
Table Checksum
|
||||
test.test_checksum 127268899
|
||||
drop table test_checksum;
|
||||
|
|
|
|||
|
|
@ -1375,3 +1375,31 @@ groupid price
|
|||
6 9900
|
||||
DROP VIEW v1,v2;
|
||||
DROP TABLE t1,t2,t3,t4;
|
||||
CREATE TABLE t1(a int);
|
||||
CREATE TABLE t2(b int);
|
||||
CREATE TABLE t3(c int, d int);
|
||||
CREATE TABLE t4(d int);
|
||||
CREATE TABLE t5(e int, f int);
|
||||
CREATE TABLE t6(f int);
|
||||
CREATE VIEW v1 AS
|
||||
SELECT e FROM t5 JOIN t6 ON t5.e=t6.f;
|
||||
CREATE VIEW v2 AS
|
||||
SELECT e FROM t5 NATURAL JOIN t6;
|
||||
SELECT t1.a FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c JOIN t4 USING(d);
|
||||
a
|
||||
SELECT t1.x FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c JOIN t4 USING(d);
|
||||
ERROR 42S22: Unknown column 't1.x' in 'field list'
|
||||
SELECT t1.a FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c NATURAL JOIN t4;
|
||||
a
|
||||
SELECT t1.x FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c NATURAL JOIN t4;
|
||||
ERROR 42S22: Unknown column 't1.x' in 'field list'
|
||||
SELECT v1.e FROM v1 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d);
|
||||
e
|
||||
SELECT v1.x FROM v1 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d);
|
||||
ERROR 42S22: Unknown column 'v1.x' in 'field list'
|
||||
SELECT v2.e FROM v2 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d);
|
||||
e
|
||||
SELECT v2.x FROM v2 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d);
|
||||
ERROR 42S22: Unknown column 'v2.x' in 'field list'
|
||||
DROP VIEW v1, v2;
|
||||
DROP TABLE t1, t2, t3, t4, t5, t6;
|
||||
|
|
|
|||
|
|
@ -654,30 +654,30 @@ create table t3 engine=merge union=(t1, t2) select (select max(a) from t2);
|
|||
ERROR HY000: You can't specify target table 't2' for update in FROM clause
|
||||
drop table t1, t2;
|
||||
create table t1 (
|
||||
a double(16,6),
|
||||
a double(14,4),
|
||||
b varchar(10),
|
||||
index (a,b)
|
||||
) engine=merge union=(t2,t3);
|
||||
create table t2 (
|
||||
a double(16,6),
|
||||
a double(14,4),
|
||||
b varchar(10),
|
||||
index (a,b)
|
||||
) engine=myisam;
|
||||
create table t3 (
|
||||
a double(16,6),
|
||||
a double(14,4),
|
||||
b varchar(10),
|
||||
index (a,b)
|
||||
) engine=myisam;
|
||||
insert into t2 values ( null, '');
|
||||
insert into t2 values ( 9999999999.999999, '');
|
||||
insert into t2 values ( 9999999999.999, '');
|
||||
insert into t3 select * from t2;
|
||||
select min(a), max(a) from t1;
|
||||
min(a) max(a)
|
||||
9999999999.999998 9999999999.999998
|
||||
9999999999.9990 9999999999.9990
|
||||
flush tables;
|
||||
select min(a), max(a) from t1;
|
||||
min(a) max(a)
|
||||
9999999999.999998 9999999999.999998
|
||||
9999999999.9990 9999999999.9990
|
||||
drop table t1, t2, t3;
|
||||
create table t1 (a int,b int,c int, index (a,b,c));
|
||||
create table t2 (a int,b int,c int, index (a,b,c));
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ drop table if exists t1,t2;
|
|||
select 1, 1.0, -1, "hello", NULL;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def 1 8 1 1 N 32897 0 63
|
||||
def 1.0 246 4 3 N 129 1 63
|
||||
def 1.0 246 3 3 N 161 1 63
|
||||
def -1 8 2 2 N 32897 0 63
|
||||
def hello 253 5 5 N 1 31 8
|
||||
def NULL 6 0 0 Y 32896 0 63
|
||||
|
|
|
|||
|
|
@ -802,10 +802,10 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||
1 SIMPLE t1 range v v 13 NULL # Using where; Using index
|
||||
explain select count(*) from t1 where v between 'a' and 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 13 NULL # Using where; Using index
|
||||
1 SIMPLE t1 ref v v 13 const # Using where; Using index
|
||||
explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 13 NULL # Using where; Using index
|
||||
1 SIMPLE t1 ref v v 13 const # Using where; Using index
|
||||
alter table t1 add unique(v);
|
||||
ERROR 23000: Duplicate entry '{ ' for key 1
|
||||
alter table t1 add key(v);
|
||||
|
|
@ -993,10 +993,10 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||
1 SIMPLE t1 range v v 303 NULL # Using where; Using index
|
||||
explain select count(*) from t1 where v between 'a' and 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 303 NULL # Using where; Using index
|
||||
1 SIMPLE t1 ref v v 303 const # Using where; Using index
|
||||
explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 303 NULL # Using where; Using index
|
||||
1 SIMPLE t1 ref v v 303 const # Using where; Using index
|
||||
explain select * from t1 where v='a';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref v v 303 const # Using where
|
||||
|
|
@ -1073,10 +1073,10 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||
1 SIMPLE t1 range v v 33 NULL # Using where
|
||||
explain select count(*) from t1 where v between 'a' and 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 33 NULL # Using where
|
||||
1 SIMPLE t1 ref v v 33 const # Using where
|
||||
explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range v v 33 NULL # Using where
|
||||
1 SIMPLE t1 ref v v 33 const # Using where
|
||||
explain select * from t1 where v='a';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref v v 33 const # Using where
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-3-0' INTO table t1;
|
|||
SET TIMESTAMP=1000000000;
|
||||
load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-4-0' INTO table t1;
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- Broken LOAD DATA --
|
||||
|
|
@ -53,7 +53,7 @@ SET @@session.sql_mode=0;
|
|||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
|
||||
insert into t1 values ("Alas");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- --database --
|
||||
|
|
@ -62,7 +62,7 @@ ROLLBACK;
|
|||
ROLLBACK;
|
||||
SET INSERT_ID=1;
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- --position --
|
||||
|
|
@ -75,7 +75,7 @@ SET @@session.sql_mode=0;
|
|||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
|
||||
insert into t1 values ("Alas");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- Remote --
|
||||
|
|
@ -106,7 +106,7 @@ load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-3-2' INTO table t1;
|
|||
SET TIMESTAMP=1000000000;
|
||||
load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-4-2' INTO table t1;
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- Broken LOAD DATA --
|
||||
|
|
@ -119,7 +119,7 @@ SET @@session.sql_mode=0;
|
|||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
|
||||
insert into t1 values ("Alas");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- --database --
|
||||
|
|
@ -128,7 +128,7 @@ ROLLBACK;
|
|||
ROLLBACK;
|
||||
SET INSERT_ID=1;
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- --position --
|
||||
|
|
@ -141,7 +141,7 @@ SET @@session.sql_mode=0;
|
|||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
|
||||
insert into t1 values ("Alas");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- reading stdin --
|
||||
|
|
@ -154,7 +154,7 @@ BEGIN;
|
|||
SET TIMESTAMP=1108844555;
|
||||
insert t1 values (1);
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
||||
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
|
||||
|
|
@ -164,6 +164,6 @@ BEGIN;
|
|||
SET TIMESTAMP=1108844555;
|
||||
insert t1 values (1);
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
drop table t1, t2;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ SET INSERT_ID=5;
|
|||
SET TIMESTAMP=1579609946;
|
||||
insert into t1 values(null, "e");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- offset --
|
||||
|
|
@ -67,7 +67,7 @@ SET INSERT_ID=5;
|
|||
SET TIMESTAMP=1579609946;
|
||||
insert into t1 values(null, "e");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- start-position --
|
||||
|
|
@ -84,7 +84,7 @@ SET INSERT_ID=5;
|
|||
SET TIMESTAMP=1579609946;
|
||||
insert into t1 values(null, "e");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- stop-position --
|
||||
|
|
@ -107,7 +107,7 @@ SET INSERT_ID=3;
|
|||
SET TIMESTAMP=1579609944;
|
||||
insert into t1 values(null, "c");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- start-datetime --
|
||||
|
|
@ -128,7 +128,7 @@ SET INSERT_ID=5;
|
|||
SET TIMESTAMP=1579609946;
|
||||
insert into t1 values(null, "e");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- stop-datetime --
|
||||
|
|
@ -148,7 +148,7 @@ SET INSERT_ID=2;
|
|||
SET TIMESTAMP=1579609942;
|
||||
insert into t1 values(null, "b");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- Local with 2 binlogs on command line --
|
||||
|
|
@ -184,7 +184,7 @@ SET @@session.sql_mode=0;
|
|||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
|
||||
insert into t1 values(null, "f");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- offset --
|
||||
|
|
@ -218,7 +218,7 @@ SET @@session.sql_mode=0;
|
|||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
|
||||
insert into t1 values(null, "f");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- start-position --
|
||||
|
|
@ -242,7 +242,7 @@ SET @@session.sql_mode=0;
|
|||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
|
||||
insert into t1 values(null, "f");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- stop-position --
|
||||
|
|
@ -272,7 +272,7 @@ SET TIMESTAMP=1579609946;
|
|||
insert into t1 values(null, "e");
|
||||
SET INSERT_ID=6;
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- start-datetime --
|
||||
|
|
@ -300,7 +300,7 @@ SET @@session.sql_mode=0;
|
|||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
|
||||
insert into t1 values(null, "f");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- stop-datetime --
|
||||
|
|
@ -320,7 +320,7 @@ SET INSERT_ID=2;
|
|||
SET TIMESTAMP=1579609942;
|
||||
insert into t1 values(null, "b");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- Remote --
|
||||
|
|
@ -349,7 +349,7 @@ SET INSERT_ID=5;
|
|||
SET TIMESTAMP=1579609946;
|
||||
insert into t1 values(null, "e");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- offset --
|
||||
|
|
@ -376,7 +376,7 @@ SET INSERT_ID=5;
|
|||
SET TIMESTAMP=1579609946;
|
||||
insert into t1 values(null, "e");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- start-position --
|
||||
|
|
@ -393,7 +393,7 @@ SET INSERT_ID=5;
|
|||
SET TIMESTAMP=1579609946;
|
||||
insert into t1 values(null, "e");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- stop-position --
|
||||
|
|
@ -416,7 +416,7 @@ SET INSERT_ID=3;
|
|||
SET TIMESTAMP=1579609944;
|
||||
insert into t1 values(null, "c");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- start-datetime --
|
||||
|
|
@ -437,7 +437,7 @@ SET INSERT_ID=5;
|
|||
SET TIMESTAMP=1579609946;
|
||||
insert into t1 values(null, "e");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- stop-datetime --
|
||||
|
|
@ -457,7 +457,7 @@ SET INSERT_ID=2;
|
|||
SET TIMESTAMP=1579609942;
|
||||
insert into t1 values(null, "b");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- Remote with 2 binlogs on command line --
|
||||
|
|
@ -493,7 +493,7 @@ SET @@session.sql_mode=0;
|
|||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
|
||||
insert into t1 values(null, "f");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- offset --
|
||||
|
|
@ -527,7 +527,7 @@ SET @@session.sql_mode=0;
|
|||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
|
||||
insert into t1 values(null, "f");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- start-position --
|
||||
|
|
@ -551,7 +551,7 @@ SET @@session.sql_mode=0;
|
|||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
|
||||
insert into t1 values(null, "f");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- stop-position --
|
||||
|
|
@ -581,7 +581,7 @@ SET TIMESTAMP=1579609946;
|
|||
insert into t1 values(null, "e");
|
||||
SET INSERT_ID=6;
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- start-datetime --
|
||||
|
|
@ -609,7 +609,7 @@ SET @@session.sql_mode=0;
|
|||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
|
||||
insert into t1 values(null, "f");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- stop-datetime --
|
||||
|
|
@ -629,7 +629,7 @@ SET INSERT_ID=2;
|
|||
SET TIMESTAMP=1579609942;
|
||||
insert into t1 values(null, "b");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- to-last-log --
|
||||
|
|
@ -661,7 +661,7 @@ SET INSERT_ID=6;
|
|||
SET TIMESTAMP=1579609943;
|
||||
insert into t1 values(null, "f");
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
|
||||
--- end of test --
|
||||
|
|
|
|||
|
|
@ -1735,22 +1735,65 @@ create view v1 as
|
|||
select * from v3 where b in (1, 2, 3, 4, 5, 6, 7);
|
||||
create view v2 as
|
||||
select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1;
|
||||
drop view v1, v2, v3;
|
||||
drop table t1;
|
||||
show full tables;
|
||||
Tables_in_test Table_type
|
||||
t1 BASE TABLE
|
||||
v1 VIEW
|
||||
v2 VIEW
|
||||
v3 VIEW
|
||||
show create view v1;
|
||||
View Create View
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `v3`.`a` AS `a`,`v3`.`b` AS `b`,`v3`.`c` AS `c` from `v3` where (`v3`.`b` in (1,2,3,4,5,6,7))
|
||||
select * from v1;
|
||||
a b c
|
||||
1 2 one
|
||||
2 4 two
|
||||
3 6 three
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||
/*!40101 SET NAMES utf8 */;
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
DROP TABLE IF EXISTS `t1`;
|
||||
CREATE TABLE `t1` (
|
||||
`a` int(11) default NULL,
|
||||
`b` int(11) default NULL,
|
||||
`c` varchar(30) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
|
||||
|
||||
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
|
||||
LOCK TABLES `t1` WRITE;
|
||||
INSERT INTO `t1` VALUES (1,2,'one'),(2,4,'two'),(3,6,'three');
|
||||
UNLOCK TABLES;
|
||||
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
|
||||
DROP TABLE IF EXISTS `v1`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v1`*/;
|
||||
/*!50001 CREATE TABLE `v1` (
|
||||
`a` int(11) default NULL,
|
||||
`b` int(11) default NULL,
|
||||
`c` varchar(30) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1*/;
|
||||
DROP TABLE IF EXISTS `v2`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
/*!50001 CREATE TABLE `v2` (
|
||||
`a` int(11) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1*/;
|
||||
DROP TABLE IF EXISTS `v3`;
|
||||
/*!50001 DROP VIEW IF EXISTS `v3`*/;
|
||||
/*!50001 CREATE TABLE `v3` (
|
||||
`a` int(11) default NULL,
|
||||
`b` int(11) default NULL,
|
||||
`c` varchar(30) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1*/;
|
||||
/*!50001 DROP TABLE IF EXISTS `v1`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v1`*/;
|
||||
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `v3`.`a` AS `a`,`v3`.`b` AS `b`,`v3`.`c` AS `c` from `v3` where (`v3`.`b` in (1,2,3,4,5,6,7))*/;
|
||||
/*!50001 DROP TABLE IF EXISTS `v2`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `v3`.`a` AS `a` from (`v3` join `v1`) where ((`v1`.`a` = `v3`.`a`) and (`v3`.`b` = 3)) limit 1*/;
|
||||
/*!50001 DROP TABLE IF EXISTS `v3`*/;
|
||||
/*!50001 DROP VIEW IF EXISTS `v3`*/;
|
||||
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b`,`t1`.`c` AS `c` from `t1`*/;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
drop view v1, v2, v3;
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a int, b bigint default NULL);
|
||||
|
|
|
|||
|
|
@ -180,6 +180,7 @@ source database
|
|||
echo message echo message
|
||||
|
||||
mysqltest: At line 1: Empty variable
|
||||
mysqltest: At line 1: command "false" failed
|
||||
mysqltest: At line 1: Missing argument in exec
|
||||
MySQL
|
||||
"MySQL"
|
||||
|
|
@ -301,6 +302,7 @@ mysqltest: At line 1: First argument to dec must be a variable (start with $)
|
|||
mysqltest: At line 1: End of line junk detected: "1000"
|
||||
mysqltest: At line 1: Missing arguments to system, nothing to do!
|
||||
mysqltest: At line 1: Missing arguments to system, nothing to do!
|
||||
mysqltest: At line 1: system command 'false' failed
|
||||
test
|
||||
test2
|
||||
test3
|
||||
|
|
@ -344,6 +346,10 @@ mysqltest: At line 1: Wrong column number to replace_column in 'replace_column 1
|
|||
mysqltest: At line 1: Invalid integer argument "10!"
|
||||
mysqltest: At line 1: End of line junk detected: "!"
|
||||
mysqltest: At line 1: Invalid integer argument "a"
|
||||
Output from mysqltest-x.inc
|
||||
Output from mysqltest-x.inc
|
||||
Output from mysqltest-x.inc
|
||||
mysqltest: Could not open ./non_existing_file.inc: errno = 2
|
||||
failing_statement;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'failing_statement' at line 1
|
||||
failing_statement;
|
||||
|
|
|
|||
|
|
@ -3,3 +3,5 @@ ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3,localhost mysqld,4, mysqld,5, mysql
|
|||
1 localhost 41943040 12582912
|
||||
2 localhost 41943040 12582912
|
||||
1 2
|
||||
ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3,localhost mysqld,4, mysqld,5, mysqld,6, mysqld,7,
|
||||
ndbd,1,localhost,52428800,26214400 ndbd,2,localhost,52428800,36700160 ndbd,3,localhost,52428800,52428800 ndbd,4,localhost,52428800,52428800 ndb_mgmd,5,localhost,, mysqld,6,localhost,,
|
||||
|
|
|
|||
|
|
@ -1775,7 +1775,7 @@ Table Create Table
|
|||
t5 CREATE TABLE `t5` (
|
||||
`const01` bigint(1) NOT NULL default '0',
|
||||
`param01` bigint(20) default NULL,
|
||||
`const02` decimal(2,1) NOT NULL default '0.0',
|
||||
`const02` decimal(2,1) unsigned NOT NULL default '0.0',
|
||||
`param02` decimal(65,30) default NULL,
|
||||
`const03` double NOT NULL default '0',
|
||||
`param03` double default NULL,
|
||||
|
|
@ -1805,7 +1805,7 @@ select * from t5 ;
|
|||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def test t5 t5 const01 const01 8 1 1 N 32769 0 63
|
||||
def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
|
||||
def test t5 t5 const02 const02 246 4 3 N 1 1 63
|
||||
def test t5 t5 const02 const02 246 3 3 N 33 1 63
|
||||
def test t5 t5 param02 param02 246 67 32 Y 0 30 63
|
||||
def test t5 t5 const03 const03 5 17 1 N 32769 31 63
|
||||
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
|
||||
|
|
|
|||
|
|
@ -1758,7 +1758,7 @@ Table Create Table
|
|||
t5 CREATE TABLE `t5` (
|
||||
`const01` bigint(1) NOT NULL default '0',
|
||||
`param01` bigint(20) default NULL,
|
||||
`const02` decimal(2,1) NOT NULL default '0.0',
|
||||
`const02` decimal(2,1) unsigned NOT NULL default '0.0',
|
||||
`param02` decimal(65,30) default NULL,
|
||||
`const03` double NOT NULL default '0',
|
||||
`param03` double default NULL,
|
||||
|
|
@ -1788,7 +1788,7 @@ select * from t5 ;
|
|||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def test t5 t5 const01 const01 8 1 1 N 32769 0 63
|
||||
def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
|
||||
def test t5 t5 const02 const02 246 4 3 N 1 1 63
|
||||
def test t5 t5 const02 const02 246 3 3 N 33 1 63
|
||||
def test t5 t5 param02 param02 246 67 32 Y 0 30 63
|
||||
def test t5 t5 const03 const03 5 17 1 N 32769 31 63
|
||||
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
|
||||
|
|
|
|||
|
|
@ -1759,7 +1759,7 @@ Table Create Table
|
|||
t5 CREATE TABLE `t5` (
|
||||
`const01` bigint(1) NOT NULL default '0',
|
||||
`param01` bigint(20) default NULL,
|
||||
`const02` decimal(2,1) NOT NULL default '0.0',
|
||||
`const02` decimal(2,1) unsigned NOT NULL default '0.0',
|
||||
`param02` decimal(65,30) default NULL,
|
||||
`const03` double NOT NULL default '0',
|
||||
`param03` double default NULL,
|
||||
|
|
@ -1789,7 +1789,7 @@ select * from t5 ;
|
|||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def test t5 t5 const01 const01 8 1 1 N 32769 0 63
|
||||
def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
|
||||
def test t5 t5 const02 const02 246 4 3 N 1 1 63
|
||||
def test t5 t5 const02 const02 246 3 3 N 33 1 63
|
||||
def test t5 t5 param02 param02 246 67 32 Y 0 30 63
|
||||
def test t5 t5 const03 const03 5 17 1 N 32769 31 63
|
||||
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
|
||||
|
|
|
|||
|
|
@ -1695,7 +1695,7 @@ Table Create Table
|
|||
t5 CREATE TABLE `t5` (
|
||||
`const01` bigint(1) NOT NULL default '0',
|
||||
`param01` bigint(20) default NULL,
|
||||
`const02` decimal(2,1) NOT NULL default '0.0',
|
||||
`const02` decimal(2,1) unsigned NOT NULL default '0.0',
|
||||
`param02` decimal(65,30) default NULL,
|
||||
`const03` double NOT NULL default '0',
|
||||
`param03` double default NULL,
|
||||
|
|
@ -1725,7 +1725,7 @@ select * from t5 ;
|
|||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def test t5 t5 const01 const01 8 1 1 N 32769 0 63
|
||||
def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
|
||||
def test t5 t5 const02 const02 246 4 3 N 1 1 63
|
||||
def test t5 t5 const02 const02 246 3 3 N 33 1 63
|
||||
def test t5 t5 param02 param02 246 67 32 Y 0 30 63
|
||||
def test t5 t5 const03 const03 5 17 1 N 32769 31 63
|
||||
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
|
||||
|
|
@ -4707,7 +4707,7 @@ Table Create Table
|
|||
t5 CREATE TABLE `t5` (
|
||||
`const01` bigint(1) NOT NULL default '0',
|
||||
`param01` bigint(20) default NULL,
|
||||
`const02` decimal(2,1) NOT NULL default '0.0',
|
||||
`const02` decimal(2,1) unsigned NOT NULL default '0.0',
|
||||
`param02` decimal(65,30) default NULL,
|
||||
`const03` double NOT NULL default '0',
|
||||
`param03` double default NULL,
|
||||
|
|
@ -4737,7 +4737,7 @@ select * from t5 ;
|
|||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def test t5 t5 const01 const01 8 1 1 N 32769 0 63
|
||||
def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
|
||||
def test t5 t5 const02 const02 246 4 3 N 1 1 63
|
||||
def test t5 t5 const02 const02 246 3 3 N 33 1 63
|
||||
def test t5 t5 param02 param02 246 67 32 Y 0 30 63
|
||||
def test t5 t5 const03 const03 5 17 1 N 32769 31 63
|
||||
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
|
||||
|
|
|
|||
|
|
@ -1758,7 +1758,7 @@ Table Create Table
|
|||
t5 CREATE TABLE `t5` (
|
||||
`const01` bigint(1) NOT NULL default '0',
|
||||
`param01` bigint(20) default NULL,
|
||||
`const02` decimal(2,1) NOT NULL default '0.0',
|
||||
`const02` decimal(2,1) unsigned NOT NULL default '0.0',
|
||||
`param02` decimal(65,30) default NULL,
|
||||
`const03` double NOT NULL default '0',
|
||||
`param03` double default NULL,
|
||||
|
|
@ -1788,7 +1788,7 @@ select * from t5 ;
|
|||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def test t5 t5 const01 const01 8 1 1 N 32769 0 63
|
||||
def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
|
||||
def test t5 t5 const02 const02 246 4 3 N 1 1 63
|
||||
def test t5 t5 const02 const02 246 3 3 N 33 1 63
|
||||
def test t5 t5 param02 param02 246 67 32 Y 0 30 63
|
||||
def test t5 t5 const03 const03 5 17 1 N 32769 31 63
|
||||
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
|
||||
|
|
|
|||
|
|
@ -1758,7 +1758,7 @@ Table Create Table
|
|||
t5 CREATE TABLE `t5` (
|
||||
`const01` bigint(1) NOT NULL default '0',
|
||||
`param01` bigint(20) default NULL,
|
||||
`const02` decimal(2,1) NOT NULL default '0.0',
|
||||
`const02` decimal(2,1) unsigned NOT NULL default '0.0',
|
||||
`param02` decimal(65,30) default NULL,
|
||||
`const03` double NOT NULL default '0',
|
||||
`param03` double default NULL,
|
||||
|
|
@ -1788,7 +1788,7 @@ select * from t5 ;
|
|||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def test t5 t5 const01 const01 8 1 1 N 32769 0 63
|
||||
def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
|
||||
def test t5 t5 const02 const02 246 4 3 N 1 1 63
|
||||
def test t5 t5 const02 const02 246 3 3 N 33 1 63
|
||||
def test t5 t5 param02 param02 246 67 32 Y 0 30 63
|
||||
def test t5 t5 const03 const03 5 17 1 N 32769 31 63
|
||||
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
drop table if exists t1, t2;
|
||||
drop table if exists t1, t2, t3;
|
||||
CREATE TABLE t1 (
|
||||
event_date date DEFAULT '0000-00-00' NOT NULL,
|
||||
type int(11) DEFAULT '0' NOT NULL,
|
||||
|
|
@ -787,3 +787,26 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||
1 PRIMARY t1 range PRIMARY PRIMARY 8 NULL # Using where; Using index
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
create table t3 (a int);
|
||||
insert into t3 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
create table t1 (a varchar(10), filler char(200), key(a)) charset=binary;
|
||||
insert into t1 values ('a','');
|
||||
insert into t1 values ('a ','');
|
||||
insert into t1 values ('a ', '');
|
||||
insert into t1 select concat('a', 1000 + A.a + 10 * (B.a + 10 * C.a)), ''
|
||||
from t3 A, t3 B, t3 C;
|
||||
create table t2 (a varchar(10), filler char(200), key(a));
|
||||
insert into t2 select * from t1;
|
||||
explain select * from t1 where a between 'a' and 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range a a 13 NULL # Using where
|
||||
explain select * from t1 where a = 'a' or a='a ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range a a 13 NULL # Using where
|
||||
explain select * from t2 where a between 'a' and 'a ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ref a a 13 const # Using where
|
||||
explain select * from t2 where a = 'a' or a='a ';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 ref a a 13 const # Using where
|
||||
drop table t1,t2,t3;
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ SET TIMESTAMP=1000000000;
|
|||
SET @@session.character_set_client=7,@@session.collation_connection=51,@@session.collation_server=30;
|
||||
INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ');
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
drop table t1;
|
||||
create table `t1` (
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ SET TIMESTAMP=100000000;
|
|||
SET @@session.time_zone='Europe/Moscow';
|
||||
insert into t1 values ('20040101000000'), ('20040611093902');
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
delete from t1;
|
||||
set time_zone='UTC';
|
||||
|
|
|
|||
|
|
@ -2620,6 +2620,15 @@ select found_rows();
|
|||
found_rows()
|
||||
1
|
||||
DROP TABLE t1;
|
||||
create table t1(f1 int, f2 int);
|
||||
create table t2(f3 int);
|
||||
select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1));
|
||||
f1
|
||||
select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1));
|
||||
f1
|
||||
select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL));
|
||||
f1
|
||||
drop table t1,t2;
|
||||
CREATE TABLE t1 ( city char(30) );
|
||||
INSERT INTO t1 VALUES ('London');
|
||||
INSERT INTO t1 VALUES ('Paris');
|
||||
|
|
@ -3029,3 +3038,26 @@ id
|
|||
102
|
||||
drop table t1, t2;
|
||||
drop view v1, v2, v3;
|
||||
create table a (
|
||||
id int(11) not null default '0'
|
||||
) engine=myisam default charset=latin1;
|
||||
insert into a values (123),(191),(192);
|
||||
create table b (
|
||||
id char(16) character set utf8 not null default ''
|
||||
) engine=myisam default charset=latin1;
|
||||
insert into b values ('58013'),('58014'),('58015'),('58016');
|
||||
create table c (
|
||||
a_id int(11) not null default '0',
|
||||
b_id char(16) character set utf8 default null
|
||||
) engine=myisam default charset=latin1;
|
||||
insert into c values
|
||||
(123,null),(123,null),(123,null),(123,null),(123,null),(123,'58013');
|
||||
select count(*)
|
||||
from a inner join (c left join b on b.id = c.b_id) on a.id = c.a_id;
|
||||
count(*)
|
||||
6
|
||||
select count(*)
|
||||
from a inner join (b right join c on b.id = c.b_id) on a.id = c.a_id;
|
||||
count(*)
|
||||
6
|
||||
drop table a, b, c;
|
||||
|
|
|
|||
|
|
@ -3390,4 +3390,49 @@ s1
|
|||
set sql_mode=@sm|
|
||||
drop table t3|
|
||||
drop procedure bug6127|
|
||||
drop procedure if exists bug12589_1|
|
||||
drop procedure if exists bug12589_2|
|
||||
drop procedure if exists bug12589_3|
|
||||
create procedure bug12589_1()
|
||||
begin
|
||||
declare spv1 decimal(3,3);
|
||||
set spv1= 123.456;
|
||||
set spv1 = 'test';
|
||||
create temporary table tm1 as select spv1;
|
||||
show create table tm1;
|
||||
drop temporary table tm1;
|
||||
end|
|
||||
create procedure bug12589_2()
|
||||
begin
|
||||
declare spv1 decimal(6,3);
|
||||
set spv1= 123.456;
|
||||
create temporary table tm1 as select spv1;
|
||||
show create table tm1;
|
||||
drop temporary table tm1;
|
||||
end|
|
||||
create procedure bug12589_3()
|
||||
begin
|
||||
declare spv1 decimal(6,3);
|
||||
set spv1= -123.456;
|
||||
create temporary table tm1 as select spv1;
|
||||
show create table tm1;
|
||||
drop temporary table tm1;
|
||||
end|
|
||||
call bug12589_1()|
|
||||
Table Create Table
|
||||
tm1 CREATE TEMPORARY TABLE `tm1` (
|
||||
`spv1` decimal(1,0) unsigned default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DECIMAL value: 'test'
|
||||
call bug12589_2()|
|
||||
Table Create Table
|
||||
tm1 CREATE TEMPORARY TABLE `tm1` (
|
||||
`spv1` decimal(6,3) unsigned default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
call bug12589_3()|
|
||||
Table Create Table
|
||||
tm1 CREATE TEMPORARY TABLE `tm1` (
|
||||
`spv1` decimal(6,3) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1,t2;
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ sql_mode NO_FIELD_OPTIONS,MYSQL323,MYSQL40,HIGH_NOT_PRECEDENCE
|
|||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) NOT NULL auto_increment,
|
||||
`a` int(11) NOT NULL,
|
||||
`pseudo` varchar(35) NOT NULL default '',
|
||||
`email` varchar(60) NOT NULL default '',
|
||||
PRIMARY KEY (`a`),
|
||||
|
|
@ -79,8 +79,8 @@ show create table t1;
|
|||
Table Create Table
|
||||
t1 CREATE TABLE "t1" (
|
||||
"a" int(11) NOT NULL,
|
||||
"pseudo" varchar(35) NOT NULL default '',
|
||||
"email" varchar(60) NOT NULL default '',
|
||||
"pseudo" varchar(35) character set latin2 NOT NULL default '',
|
||||
"email" varchar(60) character set latin2 NOT NULL default '',
|
||||
PRIMARY KEY ("a"),
|
||||
UNIQUE KEY "email" ("email")
|
||||
)
|
||||
|
|
@ -140,6 +140,26 @@ t1 CREATE TABLE `t1` (
|
|||
drop table t1 ;
|
||||
set @@SQL_MODE=NULL;
|
||||
ERROR 42000: Variable 'sql_mode' can't be set to the value of 'NULL'
|
||||
set session sql_mode=ansi;
|
||||
create table t1
|
||||
(f1 integer auto_increment primary key,
|
||||
f2 timestamp default current_timestamp on update current_timestamp);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE "t1" (
|
||||
"f1" int(11) NOT NULL auto_increment,
|
||||
"f2" timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY ("f1")
|
||||
)
|
||||
set session sql_mode=no_field_options;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f1` int(11) NOT NULL,
|
||||
`f2` timestamp NOT NULL default CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`f1`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE='';
|
||||
show local variables like 'SQL_MODE';
|
||||
Variable_name Value
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ Table Create Table
|
|||
user CREATE TABLE `user` (
|
||||
`Host` char(60) collate utf8_bin NOT NULL default '',
|
||||
`User` char(16) collate utf8_bin NOT NULL default '',
|
||||
`Password` char(41) collate utf8_bin NOT NULL default '',
|
||||
`Password` binary(41) NOT NULL default '',
|
||||
`Select_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Insert_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
`Update_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||
|
|
|
|||
|
|
@ -476,7 +476,7 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
|
|||
CREATE TABLE t1 (a_dec DECIMAL(-1,1));
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1,1))' at line 1
|
||||
CREATE TABLE t1 (a_dec DECIMAL(0,11));
|
||||
ERROR 42000: Scale may not be larger than the precision (column 'a_dec').
|
||||
ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 'a_dec').
|
||||
create table t1(a decimal(7,3));
|
||||
insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000000001'),('10'),('+10'),('-10'),('0000000010'),('+0000000010'),('-0000000010'),('100'),('+100'),('-100'),('0000000100'),('+0000000100'),('-0000000100'),('1000'),('+1000'),('-1000'),('0000001000'),('+0000001000'),('-0000001000'),('10000'),('+10000'),('-10000'),('0000010000'),('+0000010000'),('-0000010000'),('100000'),('+100000'),('-100000'),('0000100000'),('+0000100000'),('-0000100000'),('1000000'),('+1000000'),('-1000000'),('0001000000'),('+0001000000'),('-0001000000'),('10000000'),('+10000000'),('-10000000'),('0010000000'),('+0010000000'),('-0010000000'),('100000000'),('+100000000'),('-100000000'),('0100000000'),('+0100000000'),('-0100000000'),('1000000000'),('+1000000000'),('-1000000000'),('1000000000'),('+1000000000'),('-1000000000');
|
||||
select * from t1;
|
||||
|
|
|
|||
|
|
@ -226,6 +226,6 @@ reckey recdesc
|
|||
109 Has 109 as key
|
||||
drop table t1;
|
||||
create table t1 (s1 float(0,2));
|
||||
ERROR 42000: For float(M,D) or double(M,D), M must be >= D (column 's1').
|
||||
ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1').
|
||||
create table t1 (s1 float(1,2));
|
||||
ERROR 42000: For float(M,D) or double(M,D), M must be >= D (column 's1').
|
||||
ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1').
|
||||
|
|
|
|||
|
|
@ -68,10 +68,10 @@ NULL 1.1 NULL NULL NULL 1
|
|||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`nullif(1.1, 1.1)` decimal(2,1) default NULL,
|
||||
`nullif(1.1, 1.2)` decimal(2,1) default NULL,
|
||||
`nullif(1.1, 0.11e1)` decimal(2,1) default NULL,
|
||||
`nullif(1.0, 1)` decimal(2,1) default NULL,
|
||||
`nullif(1.1, 1.1)` decimal(2,1) unsigned default NULL,
|
||||
`nullif(1.1, 1.2)` decimal(2,1) unsigned default NULL,
|
||||
`nullif(1.1, 0.11e1)` decimal(2,1) unsigned default NULL,
|
||||
`nullif(1.0, 1)` decimal(2,1) unsigned default NULL,
|
||||
`nullif(1, 1.0)` int(1) default NULL,
|
||||
`nullif(1, 1.1)` int(1) default NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
|
|
@ -174,9 +174,9 @@ create table t1 select round(15.4,-1), truncate(-5678.123451,-3), abs(-1.1), -(-
|
|||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`round(15.4,-1)` decimal(3,0) NOT NULL default '0',
|
||||
`round(15.4,-1)` decimal(3,0) unsigned NOT NULL default '0',
|
||||
`truncate(-5678.123451,-3)` decimal(4,0) NOT NULL default '0',
|
||||
`abs(-1.1)` decimal(3,1) NOT NULL default '0.0',
|
||||
`abs(-1.1)` decimal(2,1) NOT NULL default '0.0',
|
||||
`-(-1.1)` decimal(2,1) NOT NULL default '0.0'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
|
|
@ -781,7 +781,7 @@ create table t1 as select 0.5;
|
|||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`0.5` decimal(2,1) NOT NULL default '0.0'
|
||||
`0.5` decimal(2,1) unsigned NOT NULL default '0.0'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
select round(1.5),round(2.5);
|
||||
|
|
@ -936,7 +936,7 @@ ERROR 42000: Too big scale 31 specified for column 'sl'. Maximum is 30.
|
|||
create table t1 (sl decimal(0,38));
|
||||
ERROR 42000: Too big scale 38 specified for column 'sl'. Maximum is 30.
|
||||
create table t1 (sl decimal(0,30));
|
||||
ERROR 42000: Scale may not be larger than the precision (column 'sl').
|
||||
ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 'sl').
|
||||
create table t1 (sl decimal(5, 5));
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
|
|
|
|||
|
|
@ -28,6 +28,6 @@ SET @`var2`:=_latin1 0x61 COLLATE `latin1_swedish_ci`;
|
|||
SET TIMESTAMP=10000;
|
||||
insert into t1 values (@var1),(@var2);
|
||||
# End of log file
|
||||
ROLLBACK;
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
drop table t1;
|
||||
|
|
|
|||
15
mysql-test/std_data/ndb_config_mycnf1.cnf
Normal file
15
mysql-test/std_data/ndb_config_mycnf1.cnf
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
[cluster_config]
|
||||
NoOfReplicas=1
|
||||
DataMemory=50M
|
||||
|
||||
[cluster_config.jonas]
|
||||
IndexMemory=50M
|
||||
ndbd = localhost,localhost,localhost,localhost
|
||||
ndb_mgmd = localhost
|
||||
mysqld = localhost
|
||||
|
||||
[cluster_config.ndbd.1]
|
||||
DataMemory=25M
|
||||
|
||||
[cluster_config.ndbd.2.jonas]
|
||||
DataMemory=35M
|
||||
|
|
@ -27,6 +27,10 @@ select CONVERT(DATE "2004-01-22 21:45:33",CHAR);
|
|||
select CONVERT(DATE "2004-01-22 21:45:33",CHAR(4));
|
||||
select CONVERT(DATE "2004-01-22 21:45:33",BINARY(4));
|
||||
select CAST(DATE "2004-01-22 21:45:33" AS BINARY(4));
|
||||
select CAST(0xb3 as signed);
|
||||
select CAST(0x8fffffffffffffff as signed);
|
||||
select CAST(0xffffffffffffffff as unsigned);
|
||||
select CAST(0xfffffffffffffffe as signed);
|
||||
select cast('-10a' as signed integer);
|
||||
select cast('a10' as unsigned integer);
|
||||
select 10+'a';
|
||||
|
|
|
|||
|
|
@ -258,4 +258,17 @@ create table t2 (a int);
|
|||
select * from (select * from t1,t2) foo;
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
# Bug#10586 - query works with 4.1.8, but not with 4.1.11
|
||||
#
|
||||
create table t1 (ID int unsigned not null auto_increment,
|
||||
DATA varchar(5) not null, primary key (ID));
|
||||
create table t2 (ID int unsigned not null auto_increment,
|
||||
DATA varchar(5) not null, FID int unsigned not null,
|
||||
primary key (ID));
|
||||
select A.* from (t1 inner join (select * from t2) as A on t1.ID = A.FID);
|
||||
select t2.* from ((select * from t1) as A inner join t2 on A.ID = t2.FID);
|
||||
select t2.* from (select * from t1) as A inner join t2 on A.ID = t2.FID;
|
||||
drop table t1, t2;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
|
|
|||
|
|
@ -1268,6 +1268,7 @@ insert into t1 values ('8', '6'), ('4', '7');
|
|||
select min(a) from t1;
|
||||
select min(b) from t1 where a='8';
|
||||
drop table t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
#
|
||||
|
|
@ -1564,3 +1565,42 @@ SET FOREIGN_KEY_CHECKS=1;
|
|||
INSERT INTO t2 VALUES(3);
|
||||
|
||||
DROP TABLE t2;
|
||||
#
|
||||
# Test that checksum table uses a consistent read Bug #12669
|
||||
#
|
||||
connect (a,localhost,root,,);
|
||||
connect (b,localhost,root,,);
|
||||
connection a;
|
||||
create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1;
|
||||
insert into test_checksum values (1),(2);
|
||||
set autocommit=0;
|
||||
checksum table test_checksum;
|
||||
connection b;
|
||||
insert into test_checksum values(3);
|
||||
connection a;
|
||||
#
|
||||
# Here checksum should not see insert
|
||||
#
|
||||
checksum table test_checksum;
|
||||
connection a;
|
||||
commit;
|
||||
checksum table test_checksum;
|
||||
commit;
|
||||
drop table test_checksum;
|
||||
#
|
||||
# autocommit = 1
|
||||
#
|
||||
connection a;
|
||||
create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1;
|
||||
insert into test_checksum values (1),(2);
|
||||
set autocommit=1;
|
||||
checksum table test_checksum;
|
||||
connection b;
|
||||
set autocommit=1;
|
||||
insert into test_checksum values(3);
|
||||
connection a;
|
||||
#
|
||||
# Here checksum sees insert
|
||||
#
|
||||
checksum table test_checksum;
|
||||
drop table test_checksum;
|
||||
|
|
|
|||
|
|
@ -801,3 +801,34 @@ SELECT * FROM
|
|||
|
||||
DROP VIEW v1,v2;
|
||||
DROP TABLE t1,t2,t3,t4;
|
||||
|
||||
#
|
||||
# Bug #13545: problem with NATURAL/USING joins.
|
||||
#
|
||||
|
||||
CREATE TABLE t1(a int);
|
||||
CREATE TABLE t2(b int);
|
||||
CREATE TABLE t3(c int, d int);
|
||||
CREATE TABLE t4(d int);
|
||||
CREATE TABLE t5(e int, f int);
|
||||
CREATE TABLE t6(f int);
|
||||
CREATE VIEW v1 AS
|
||||
SELECT e FROM t5 JOIN t6 ON t5.e=t6.f;
|
||||
CREATE VIEW v2 AS
|
||||
SELECT e FROM t5 NATURAL JOIN t6;
|
||||
|
||||
SELECT t1.a FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c JOIN t4 USING(d);
|
||||
--error 1054
|
||||
SELECT t1.x FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c JOIN t4 USING(d);
|
||||
SELECT t1.a FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c NATURAL JOIN t4;
|
||||
--error 1054
|
||||
SELECT t1.x FROM t1 JOIN t2 ON a=b JOIN t3 ON a=c NATURAL JOIN t4;
|
||||
SELECT v1.e FROM v1 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d);
|
||||
--error 1054
|
||||
SELECT v1.x FROM v1 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d);
|
||||
SELECT v2.e FROM v2 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d);
|
||||
--error 1054
|
||||
SELECT v2.x FROM v2 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d);
|
||||
|
||||
DROP VIEW v1, v2;
|
||||
DROP TABLE t1, t2, t3, t4, t5, t6;
|
||||
|
|
|
|||
|
|
@ -296,29 +296,25 @@ drop table t1, t2;
|
|||
# non-debug build. But there is no guarantee that this will be always so.
|
||||
#
|
||||
create table t1 (
|
||||
a double(16,6),
|
||||
a double(14,4),
|
||||
b varchar(10),
|
||||
index (a,b)
|
||||
) engine=merge union=(t2,t3);
|
||||
|
||||
create table t2 (
|
||||
a double(16,6),
|
||||
a double(14,4),
|
||||
b varchar(10),
|
||||
index (a,b)
|
||||
) engine=myisam;
|
||||
|
||||
create table t3 (
|
||||
a double(16,6),
|
||||
a double(14,4),
|
||||
b varchar(10),
|
||||
index (a,b)
|
||||
) engine=myisam;
|
||||
|
||||
insert into t2 values ( null, '');
|
||||
# We may have insufficient accuracy for 16 digits of '9'.
|
||||
# Suppress a "truncate" warning due to accuracy problems.
|
||||
--disable_warnings
|
||||
insert into t2 values ( 9999999999.999999, '');
|
||||
--enable_warnings
|
||||
insert into t2 values ( 9999999999.999, '');
|
||||
insert into t3 select * from t2;
|
||||
select min(a), max(a) from t1;
|
||||
flush tables;
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ drop table t1;
|
|||
--exec $MYSQL_DUMP --skip-comments --databases test
|
||||
|
||||
create database mysqldump_test_db character set latin2 collate latin2_bin;
|
||||
--exec $MYSQL_DUMP --skip-comments --databases mysqldump_test_db;
|
||||
--exec $MYSQL_DUMP --skip-comments --databases mysqldump_test_db
|
||||
drop database mysqldump_test_db;
|
||||
|
||||
#
|
||||
|
|
@ -758,17 +758,7 @@ select * from v3 where b in (1, 2, 3, 4, 5, 6, 7);
|
|||
create view v2 as
|
||||
select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1;
|
||||
|
||||
--exec $MYSQL_DUMP test > var/tmp/bug10927.sql
|
||||
drop view v1, v2, v3;
|
||||
drop table t1;
|
||||
--exec $MYSQL test < var/tmp/bug10927.sql
|
||||
|
||||
# Without dropping the original tables in between
|
||||
--exec $MYSQL_DUMP test > var/tmp/bug10927.sql
|
||||
--exec $MYSQL test < var/tmp/bug10927.sql
|
||||
show full tables;
|
||||
show create view v1;
|
||||
select * from v1;
|
||||
--exec $MYSQL_DUMP --skip-comments test
|
||||
|
||||
drop view v1, v2, v3;
|
||||
drop table t1;
|
||||
|
|
|
|||
|
|
@ -428,9 +428,8 @@ echo ;
|
|||
# ----------------------------------------------------------------------------
|
||||
|
||||
# Illegal use of exec
|
||||
# Disabled, some shells prints the failed command regardless of pipes
|
||||
#--error 1
|
||||
#--exec echo "--exec ';' 2> /dev/null" | $MYSQL_TEST 2>&1
|
||||
--error 1
|
||||
--exec echo "--exec false" | $MYSQL_TEST 2>&1
|
||||
|
||||
--error 1
|
||||
--exec echo "--exec " | $MYSQL_TEST 2>&1
|
||||
|
|
@ -677,9 +676,8 @@ system echo "hej" > /dev/null;
|
|||
--exec echo "system;" | $MYSQL_TEST 2>&1
|
||||
--error 1
|
||||
--exec echo "system $NONEXISTSINFVAREABLI;" | $MYSQL_TEST 2>&1
|
||||
# Disabled, some shells prints the failed command regardless of pipes
|
||||
#--error 1
|
||||
#--exec echo "system NonExistsinfComamdn 2> /dev/null;" | $MYSQL_TEST 2>&1
|
||||
--error 1
|
||||
--exec echo "system false;" | $MYSQL_TEST 2>&1
|
||||
|
||||
--disable_abort_on_error
|
||||
system NonExistsinfComamdn;
|
||||
|
|
@ -814,11 +812,11 @@ select "a" as col1, "c" as col2;
|
|||
# ----------------------------------------------------------------------------
|
||||
|
||||
# -x <file_name>, use the file specified after -x as the test file
|
||||
#--exec $MYSQL_TEST < $MYSQL_TEST_DIR/include/mysqltest-x.inc 2>&1
|
||||
#--exec $MYSQL_TEST -x $MYSQL_TEST_DIR/include/mysqltest-x.inc 2>&1
|
||||
#--exec $MYSQL_TEST --result_file=$MYSQL_TEST_DIR/include/mysqltest-x.inc 2>&1
|
||||
#--error 1
|
||||
#--exec $MYSQL_TEST -x non_existing_file.inc 2>&1
|
||||
--exec $MYSQL_TEST < $MYSQL_TEST_DIR/include/mysqltest-x.inc
|
||||
--exec $MYSQL_TEST -x $MYSQL_TEST_DIR/include/mysqltest-x.inc
|
||||
--exec $MYSQL_TEST --test_file=$MYSQL_TEST_DIR/include/mysqltest-x.inc
|
||||
--error 1
|
||||
--exec $MYSQL_TEST -x non_existing_file.inc 2>&1
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -6,5 +6,8 @@
|
|||
--exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid,host,DataMemory,IndexMemory --type=ndbd 2> /dev/null
|
||||
--exec $NDB_TOOLS_DIR/ndb_config --no-defaults -r \\n -f " " --query=nodeid,host,DataMemory,IndexMemory --type=ndbd 2> /dev/null
|
||||
--exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid --type=ndbd --host=localhost 2> /dev/null
|
||||
--exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=type,nodeid,host --config-file=$NDB_BACKUP_DIR/config.ini 2> /dev/null
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
--exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.jonas --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf1.cnf --query=type,nodeid,host,IndexMemory,DataMemory --mycnf 2> /dev/null
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1, t2;
|
||||
drop table if exists t1, t2, t3;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1 (
|
||||
|
|
@ -600,3 +600,29 @@ explain select * from v1 where a between 3 and 4 and b between 1 and 2;
|
|||
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
|
||||
# BUG#13455:
|
||||
create table t3 (a int);
|
||||
insert into t3 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
|
||||
create table t1 (a varchar(10), filler char(200), key(a)) charset=binary;
|
||||
insert into t1 values ('a','');
|
||||
insert into t1 values ('a ','');
|
||||
insert into t1 values ('a ', '');
|
||||
insert into t1 select concat('a', 1000 + A.a + 10 * (B.a + 10 * C.a)), ''
|
||||
from t3 A, t3 B, t3 C;
|
||||
|
||||
create table t2 (a varchar(10), filler char(200), key(a));
|
||||
insert into t2 select * from t1;
|
||||
|
||||
--replace_column 9 #
|
||||
explain select * from t1 where a between 'a' and 'a ';
|
||||
--replace_column 9 #
|
||||
explain select * from t1 where a = 'a' or a='a ';
|
||||
|
||||
--replace_column 9 #
|
||||
explain select * from t2 where a between 'a' and 'a ';
|
||||
--replace_column 9 #
|
||||
explain select * from t2 where a = 'a' or a='a ';
|
||||
|
||||
drop table t1,t2,t3;
|
||||
|
|
|
|||
|
|
@ -2181,6 +2181,16 @@ select found_rows();
|
|||
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Bug #13356 assertion failed in resolve_const_item()
|
||||
#
|
||||
create table t1(f1 int, f2 int);
|
||||
create table t2(f3 int);
|
||||
select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,1));
|
||||
select f1 from t1,t2 where f1=f2 and (f1,NULL) = ((1,1));
|
||||
select f1 from t1,t2 where f1=f2 and (f1,f2) = ((1,NULL));
|
||||
drop table t1,t2;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
#
|
||||
|
|
@ -2565,3 +2575,37 @@ select * from v1 left join v3 using (id);
|
|||
|
||||
drop table t1, t2;
|
||||
drop view v1, v2, v3;
|
||||
|
||||
#
|
||||
# Bug #13597 Column in ON condition not resolved if references a table in
|
||||
# nested right join.
|
||||
#
|
||||
|
||||
create table a (
|
||||
id int(11) not null default '0'
|
||||
) engine=myisam default charset=latin1;
|
||||
|
||||
insert into a values (123),(191),(192);
|
||||
|
||||
create table b (
|
||||
id char(16) character set utf8 not null default ''
|
||||
) engine=myisam default charset=latin1;
|
||||
|
||||
insert into b values ('58013'),('58014'),('58015'),('58016');
|
||||
|
||||
create table c (
|
||||
a_id int(11) not null default '0',
|
||||
b_id char(16) character set utf8 default null
|
||||
) engine=myisam default charset=latin1;
|
||||
|
||||
insert into c values
|
||||
(123,null),(123,null),(123,null),(123,null),(123,null),(123,'58013');
|
||||
|
||||
-- both queries are equivalent
|
||||
select count(*)
|
||||
from a inner join (c left join b on b.id = c.b_id) on a.id = c.a_id;
|
||||
|
||||
select count(*)
|
||||
from a inner join (b right join c on b.id = c.b_id) on a.id = c.a_id;
|
||||
|
||||
drop table a, b, c;
|
||||
|
|
|
|||
|
|
@ -4264,6 +4264,57 @@ drop table t3|
|
|||
drop procedure bug6127|
|
||||
|
||||
|
||||
#
|
||||
# BUG#12589: Assert when creating temp. table from decimal stored procedure
|
||||
# variable
|
||||
#
|
||||
--disable_warnings
|
||||
drop procedure if exists bug12589_1|
|
||||
drop procedure if exists bug12589_2|
|
||||
drop procedure if exists bug12589_3|
|
||||
--enable_warnings
|
||||
create procedure bug12589_1()
|
||||
begin
|
||||
declare spv1 decimal(3,3);
|
||||
set spv1= 123.456;
|
||||
|
||||
set spv1 = 'test';
|
||||
create temporary table tm1 as select spv1;
|
||||
show create table tm1;
|
||||
drop temporary table tm1;
|
||||
end|
|
||||
|
||||
create procedure bug12589_2()
|
||||
begin
|
||||
declare spv1 decimal(6,3);
|
||||
set spv1= 123.456;
|
||||
|
||||
create temporary table tm1 as select spv1;
|
||||
show create table tm1;
|
||||
drop temporary table tm1;
|
||||
end|
|
||||
|
||||
create procedure bug12589_3()
|
||||
begin
|
||||
declare spv1 decimal(6,3);
|
||||
set spv1= -123.456;
|
||||
|
||||
create temporary table tm1 as select spv1;
|
||||
show create table tm1;
|
||||
drop temporary table tm1;
|
||||
end|
|
||||
|
||||
# Note: The type of the field will match the value, not the declared
|
||||
# type of the variable. (This is a type checking issue which
|
||||
# might be changed later.)
|
||||
|
||||
# Warning expected from "set spv1 = 'test'", the value is set to decimal "0".
|
||||
call bug12589_1()|
|
||||
# No warnings here
|
||||
call bug12589_2()|
|
||||
call bug12589_3()|
|
||||
|
||||
|
||||
#
|
||||
# BUG#NNNN: New bug synopsis
|
||||
#
|
||||
|
|
|
|||
|
|
@ -86,6 +86,18 @@ drop table t1 ;
|
|||
--error 1231
|
||||
set @@SQL_MODE=NULL;
|
||||
|
||||
#
|
||||
# Bug #797: in sql_mode=ANSI, show create table ignores auto_increment
|
||||
#
|
||||
set session sql_mode=ansi;
|
||||
create table t1
|
||||
(f1 integer auto_increment primary key,
|
||||
f2 timestamp default current_timestamp on update current_timestamp);
|
||||
show create table t1;
|
||||
set session sql_mode=no_field_options;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
#
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ drop table t1;
|
|||
# bug #12694 (float(m,d) specifications)
|
||||
#
|
||||
|
||||
--error 1453
|
||||
--error 1427
|
||||
create table t1 (s1 float(0,2));
|
||||
--error 1453
|
||||
--error 1427
|
||||
create table t1 (s1 float(1,2));
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
#include <winbase.h>
|
||||
#endif
|
||||
|
||||
const char *defaults_file=0;
|
||||
const char *defaults_group_suffix=0;
|
||||
char *defaults_extra_file=0;
|
||||
|
||||
|
|
@ -140,6 +141,9 @@ int my_search_option_files(const char *conf_file, int *argc, char ***argv,
|
|||
if (forced_extra_defaults)
|
||||
defaults_extra_file= (char *) forced_extra_defaults;
|
||||
|
||||
if (forced_default_file)
|
||||
defaults_file= forced_default_file;
|
||||
|
||||
/*
|
||||
We can only handle 'defaults-group-suffix' if we are called from
|
||||
load_defaults() as otherwise we can't know the type of 'func_ctx'
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize,
|
|||
(ulong) info, (int) type, (ulong) seek_offset));
|
||||
|
||||
info->file= file;
|
||||
info->type= 0; /* Don't set it until mutex are created */
|
||||
info->type= TYPE_NOT_SET; /* Don't set it until mutex are created */
|
||||
info->pos_in_file= seek_offset;
|
||||
info->pre_close = info->pre_read = info->post_read = 0;
|
||||
info->arg = 0;
|
||||
|
|
@ -1246,7 +1246,7 @@ int end_io_cache(IO_CACHE *info)
|
|||
if (info->type == SEQ_READ_APPEND)
|
||||
{
|
||||
/* Destroy allocated mutex */
|
||||
info->type=0;
|
||||
info->type= TYPE_NOT_SET;
|
||||
#ifdef THREAD
|
||||
pthread_mutex_destroy(&info->append_buffer_lock);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -161,10 +161,12 @@ KEY_CACHE *dflt_key_cache= &dflt_key_cache_var;
|
|||
#define FLUSH_CACHE 2000 /* sort this many blocks at once */
|
||||
|
||||
static int flush_all_key_blocks(KEY_CACHE *keycache);
|
||||
#ifdef THREAD
|
||||
static void link_into_queue(KEYCACHE_WQUEUE *wqueue,
|
||||
struct st_my_thread_var *thread);
|
||||
static void unlink_from_queue(KEYCACHE_WQUEUE *wqueue,
|
||||
struct st_my_thread_var *thread);
|
||||
#endif
|
||||
static void free_block(KEY_CACHE *keycache, BLOCK_LINK *block);
|
||||
static void test_key_cache(KEY_CACHE *keycache,
|
||||
const char *where, my_bool lock);
|
||||
|
|
@ -215,6 +217,7 @@ static void keycache_debug_print _VARARGS((const char *fmt,...));
|
|||
#endif /* defined(KEYCACHE_DEBUG_LOG) && defined(KEYCACHE_DEBUG) */
|
||||
|
||||
#if defined(KEYCACHE_DEBUG) || !defined(DBUG_OFF)
|
||||
#ifdef THREAD
|
||||
static long keycache_thread_id;
|
||||
#define KEYCACHE_THREAD_TRACE(l) \
|
||||
KEYCACHE_DBUG_PRINT(l,("|thread %ld",keycache_thread_id))
|
||||
|
|
@ -226,6 +229,11 @@ static long keycache_thread_id;
|
|||
|
||||
#define KEYCACHE_THREAD_TRACE_END(l) \
|
||||
KEYCACHE_DBUG_PRINT(l,("]thread %ld",keycache_thread_id))
|
||||
#else /* THREAD */
|
||||
#define KEYCACHE_THREAD_TRACE(l) KEYCACHE_DBUG_PRINT(l,(""))
|
||||
#define KEYCACHE_THREAD_TRACE_BEGIN(l) KEYCACHE_DBUG_PRINT(l,(""))
|
||||
#define KEYCACHE_THREAD_TRACE_END(l) KEYCACHE_DBUG_PRINT(l,(""))
|
||||
#endif /* THREAD */
|
||||
#else
|
||||
#define KEYCACHE_THREAD_TRACE_BEGIN(l)
|
||||
#define KEYCACHE_THREAD_TRACE_END(l)
|
||||
|
|
@ -492,6 +500,7 @@ int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
|
|||
|
||||
keycache_pthread_mutex_lock(&keycache->cache_lock);
|
||||
|
||||
#ifdef THREAD
|
||||
wqueue= &keycache->resize_queue;
|
||||
thread= my_thread_var;
|
||||
link_into_queue(wqueue, thread);
|
||||
|
|
@ -500,6 +509,7 @@ int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
|
|||
{
|
||||
keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock);
|
||||
}
|
||||
#endif
|
||||
|
||||
keycache->resize_in_flush= 1;
|
||||
if (flush_all_key_blocks(keycache))
|
||||
|
|
@ -512,12 +522,16 @@ int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
|
|||
}
|
||||
keycache->resize_in_flush= 0;
|
||||
keycache->can_be_used= 0;
|
||||
#ifdef THREAD
|
||||
while (keycache->cnt_for_resize_op)
|
||||
{
|
||||
KEYCACHE_DBUG_PRINT("resize_key_cache: wait",
|
||||
("suspend thread %ld", thread->id));
|
||||
keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock);
|
||||
}
|
||||
#else
|
||||
KEYCACHE_DBUG_ASSERT(keycache->cnt_for_resize_op == 0);
|
||||
#endif
|
||||
|
||||
end_key_cache(keycache, 0); /* Don't free mutex */
|
||||
/* The following will work even if use_mem is 0 */
|
||||
|
|
@ -525,6 +539,7 @@ int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
|
|||
division_limit, age_threshold);
|
||||
|
||||
finish:
|
||||
#ifdef THREAD
|
||||
unlink_from_queue(wqueue, thread);
|
||||
/* Signal for the next resize request to proceeed if any */
|
||||
if (wqueue->last_thread)
|
||||
|
|
@ -533,6 +548,7 @@ finish:
|
|||
("thread %ld", wqueue->last_thread->next->id));
|
||||
keycache_pthread_cond_signal(&wqueue->last_thread->next->suspend);
|
||||
}
|
||||
#endif
|
||||
keycache_pthread_mutex_unlock(&keycache->cache_lock);
|
||||
return blocks;
|
||||
}
|
||||
|
|
@ -553,6 +569,7 @@ static inline void inc_counter_for_resize_op(KEY_CACHE *keycache)
|
|||
*/
|
||||
static inline void dec_counter_for_resize_op(KEY_CACHE *keycache)
|
||||
{
|
||||
#ifdef THREAD
|
||||
struct st_my_thread_var *last_thread;
|
||||
if (!--keycache->cnt_for_resize_op &&
|
||||
(last_thread= keycache->resize_queue.last_thread))
|
||||
|
|
@ -561,6 +578,9 @@ static inline void dec_counter_for_resize_op(KEY_CACHE *keycache)
|
|||
("thread %ld", last_thread->next->id));
|
||||
keycache_pthread_cond_signal(&last_thread->next->suspend);
|
||||
}
|
||||
#else
|
||||
keycache->cnt_for_resize_op--;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -650,6 +670,7 @@ void end_key_cache(KEY_CACHE *keycache, my_bool cleanup)
|
|||
} /* end_key_cache */
|
||||
|
||||
|
||||
#ifdef THREAD
|
||||
/*
|
||||
Link a thread into double-linked queue of waiting threads.
|
||||
|
||||
|
|
@ -786,6 +807,7 @@ static void release_queue(KEYCACHE_WQUEUE *wqueue)
|
|||
while (thread != last);
|
||||
wqueue->last_thread= NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -893,6 +915,7 @@ static void link_block(KEY_CACHE *keycache, BLOCK_LINK *block, my_bool hot,
|
|||
BLOCK_LINK **pins;
|
||||
|
||||
KEYCACHE_DBUG_ASSERT(! (block->hash_link && block->hash_link->requests));
|
||||
#ifdef THREAD
|
||||
if (!hot && keycache->waiting_for_block.last_thread)
|
||||
{
|
||||
/* Signal that in the LRU warm sub-chain an available block has appeared */
|
||||
|
|
@ -929,6 +952,10 @@ static void link_block(KEY_CACHE *keycache, BLOCK_LINK *block, my_bool hot,
|
|||
#endif
|
||||
return;
|
||||
}
|
||||
#else /* THREAD */
|
||||
KEYCACHE_DBUG_ASSERT(! (!hot && keycache->waiting_for_block.last_thread));
|
||||
/* Condition not transformed using DeMorgan, to keep the text identical */
|
||||
#endif /* THREAD */
|
||||
pins= hot ? &keycache->used_ins : &keycache->used_last;
|
||||
ins= *pins;
|
||||
if (ins)
|
||||
|
|
@ -1101,6 +1128,7 @@ static inline void remove_reader(BLOCK_LINK *block)
|
|||
|
||||
static inline void wait_for_readers(KEY_CACHE *keycache, BLOCK_LINK *block)
|
||||
{
|
||||
#ifdef THREAD
|
||||
struct st_my_thread_var *thread= my_thread_var;
|
||||
while (block->hash_link->requests)
|
||||
{
|
||||
|
|
@ -1111,6 +1139,9 @@ static inline void wait_for_readers(KEY_CACHE *keycache, BLOCK_LINK *block)
|
|||
keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock);
|
||||
block->condvar= NULL;
|
||||
}
|
||||
#else
|
||||
KEYCACHE_DBUG_ASSERT(block->hash_link->requests == 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1140,6 +1171,7 @@ static void unlink_hash(KEY_CACHE *keycache, HASH_LINK *hash_link)
|
|||
if ((*hash_link->prev= hash_link->next))
|
||||
hash_link->next->prev= hash_link->prev;
|
||||
hash_link->block= NULL;
|
||||
#ifdef THREAD
|
||||
if (keycache->waiting_for_hash_link.last_thread)
|
||||
{
|
||||
/* Signal that a free hash link has appeared */
|
||||
|
|
@ -1175,6 +1207,9 @@ static void unlink_hash(KEY_CACHE *keycache, HASH_LINK *hash_link)
|
|||
hash_link);
|
||||
return;
|
||||
}
|
||||
#else /* THREAD */
|
||||
KEYCACHE_DBUG_ASSERT(! (keycache->waiting_for_hash_link.last_thread));
|
||||
#endif /* THREAD */
|
||||
hash_link->next= keycache->free_hash_list;
|
||||
keycache->free_hash_list= hash_link;
|
||||
}
|
||||
|
|
@ -1240,6 +1275,7 @@ restart:
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifdef THREAD
|
||||
/* Wait for a free hash link */
|
||||
struct st_my_thread_var *thread= my_thread_var;
|
||||
KEYCACHE_DBUG_PRINT("get_hash_link", ("waiting"));
|
||||
|
|
@ -1252,6 +1288,9 @@ restart:
|
|||
keycache_pthread_cond_wait(&thread->suspend,
|
||||
&keycache->cache_lock);
|
||||
thread->opt_info= NULL;
|
||||
#else
|
||||
KEYCACHE_DBUG_ASSERT(0);
|
||||
#endif
|
||||
goto restart;
|
||||
}
|
||||
hash_link->file= file;
|
||||
|
|
@ -1363,6 +1402,7 @@ restart:
|
|||
/* Wait intil the page is flushed on disk */
|
||||
hash_link->requests--;
|
||||
{
|
||||
#ifdef THREAD
|
||||
struct st_my_thread_var *thread= my_thread_var;
|
||||
add_to_queue(&block->wqueue[COND_FOR_SAVED], thread);
|
||||
do
|
||||
|
|
@ -1373,6 +1413,16 @@ restart:
|
|||
&keycache->cache_lock);
|
||||
}
|
||||
while(thread->next);
|
||||
#else
|
||||
KEYCACHE_DBUG_ASSERT(0);
|
||||
/*
|
||||
Given the use of "resize_in_flush", it seems impossible
|
||||
that this whole branch is ever entered in single-threaded case
|
||||
because "(wrmode && keycache->resize_in_flush)" cannot be true.
|
||||
TODO: Check this, and then put the whole branch into the
|
||||
"#ifdef THREAD" guard.
|
||||
*/
|
||||
#endif
|
||||
}
|
||||
/* Invalidate page in the block if it has not been done yet */
|
||||
if (block->status)
|
||||
|
|
@ -1401,6 +1451,7 @@ restart:
|
|||
KEYCACHE_DBUG_PRINT("find_key_block",
|
||||
("request waiting for old page to be saved"));
|
||||
{
|
||||
#ifdef THREAD
|
||||
struct st_my_thread_var *thread= my_thread_var;
|
||||
/* Put the request into the queue of those waiting for the old page */
|
||||
add_to_queue(&block->wqueue[COND_FOR_SAVED], thread);
|
||||
|
|
@ -1413,6 +1464,10 @@ restart:
|
|||
&keycache->cache_lock);
|
||||
}
|
||||
while(thread->next);
|
||||
#else
|
||||
KEYCACHE_DBUG_ASSERT(0);
|
||||
/* No parallel requests in single-threaded case */
|
||||
#endif
|
||||
}
|
||||
KEYCACHE_DBUG_PRINT("find_key_block",
|
||||
("request for old page resubmitted"));
|
||||
|
|
@ -1471,6 +1526,7 @@ restart:
|
|||
all of them must get the same block
|
||||
*/
|
||||
|
||||
#ifdef THREAD
|
||||
if (! keycache->used_last)
|
||||
{
|
||||
struct st_my_thread_var *thread= my_thread_var;
|
||||
|
|
@ -1486,6 +1542,9 @@ restart:
|
|||
while (thread->next);
|
||||
thread->opt_info= NULL;
|
||||
}
|
||||
#else
|
||||
KEYCACHE_DBUG_ASSERT(keycache->used_last);
|
||||
#endif
|
||||
block= hash_link->block;
|
||||
if (! block)
|
||||
{
|
||||
|
|
@ -1674,6 +1733,7 @@ static void read_block(KEY_CACHE *keycache,
|
|||
KEYCACHE_DBUG_PRINT("read_block",
|
||||
("secondary request waiting for new page to be read"));
|
||||
{
|
||||
#ifdef THREAD
|
||||
struct st_my_thread_var *thread= my_thread_var;
|
||||
/* Put the request into a queue and wait until it can be processed */
|
||||
add_to_queue(&block->wqueue[COND_FOR_REQUESTED], thread);
|
||||
|
|
@ -1685,6 +1745,10 @@ static void read_block(KEY_CACHE *keycache,
|
|||
&keycache->cache_lock);
|
||||
}
|
||||
while (thread->next);
|
||||
#else
|
||||
KEYCACHE_DBUG_ASSERT(0);
|
||||
/* No parallel requests in single-threaded case */
|
||||
#endif
|
||||
}
|
||||
KEYCACHE_DBUG_PRINT("read_block",
|
||||
("secondary request: new page in cache"));
|
||||
|
|
@ -1822,7 +1886,7 @@ byte *key_cache_read(KEY_CACHE *keycache,
|
|||
#ifndef THREAD
|
||||
/* This is only true if we where able to read everything in one block */
|
||||
if (return_buffer)
|
||||
return (block->buffer);
|
||||
DBUG_RETURN(block->buffer);
|
||||
#endif
|
||||
buff+= read_length;
|
||||
filepos+= read_length+offset;
|
||||
|
|
@ -2398,6 +2462,7 @@ restart:
|
|||
#endif
|
||||
block= first_in_switch;
|
||||
{
|
||||
#ifdef THREAD
|
||||
struct st_my_thread_var *thread= my_thread_var;
|
||||
add_to_queue(&block->wqueue[COND_FOR_SAVED], thread);
|
||||
do
|
||||
|
|
@ -2408,6 +2473,10 @@ restart:
|
|||
&keycache->cache_lock);
|
||||
}
|
||||
while (thread->next);
|
||||
#else
|
||||
KEYCACHE_DBUG_ASSERT(0);
|
||||
/* No parallel requests in single-threaded case */
|
||||
#endif
|
||||
}
|
||||
#if defined(KEYCACHE_DEBUG)
|
||||
cnt++;
|
||||
|
|
@ -2574,7 +2643,6 @@ static void test_key_cache(KEY_CACHE *keycache __attribute__((unused)),
|
|||
static void keycache_dump(KEY_CACHE *keycache)
|
||||
{
|
||||
FILE *keycache_dump_file=fopen(KEYCACHE_DUMP_FILE, "w");
|
||||
struct st_my_thread_var *thread_var= my_thread_var;
|
||||
struct st_my_thread_var *last;
|
||||
struct st_my_thread_var *thread;
|
||||
BLOCK_LINK *block;
|
||||
|
|
|
|||
|
|
@ -127,11 +127,23 @@ my_bool my_init(void)
|
|||
|
||||
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)
|
||||
/*
|
||||
this code is suboptimal to workaround a bug in
|
||||
Sun CC: Sun C++ 5.6 2004/06/02 for x86, and should not be
|
||||
optimized until this compiler is not in use anymore
|
||||
*/
|
||||
FILE *info_file= DBUG_FILE;
|
||||
my_bool print_info= (info_file != stderr);
|
||||
DBUG_ENTER("my_end");
|
||||
if (!info_file)
|
||||
{
|
||||
info_file= stderr;
|
||||
print_info= 0;
|
||||
}
|
||||
|
||||
DBUG_PRINT("info",("Shutting down: print_info: %d", print_info));
|
||||
if ((infoflag & MY_CHECK_ERROR) || print_info)
|
||||
|
||||
{ /* Test if some file is left open */
|
||||
if (my_file_opened | my_stream_opened)
|
||||
{
|
||||
|
|
@ -141,7 +153,8 @@ void my_end(int infoflag)
|
|||
}
|
||||
}
|
||||
my_once_free();
|
||||
if (infoflag & MY_GIVE_INFO || info_file != stderr)
|
||||
|
||||
if ((infoflag & MY_GIVE_INFO) || print_info)
|
||||
{
|
||||
#ifdef HAVE_GETRUSAGE
|
||||
struct rusage rus;
|
||||
|
|
|
|||
|
|
@ -553,7 +553,6 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
|
|||
#define GSN_STATISTICS_CONF 454
|
||||
|
||||
#define GSN_START_ORD 455
|
||||
/* 456 unused */
|
||||
/* 457 unused */
|
||||
|
||||
#define GSN_EVENT_SUBSCRIBE_REQ 458
|
||||
|
|
@ -835,14 +834,6 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
|
|||
/* Start Global Replication */
|
||||
#define GSN_GREP_REQ 656
|
||||
|
||||
/**
|
||||
* Management server
|
||||
*/
|
||||
#define GSN_MGM_LOCK_CONFIG_REQ 657
|
||||
#define GSN_MGM_LOCK_CONFIG_REP 658
|
||||
#define GSN_MGM_UNLOCK_CONFIG_REQ 659
|
||||
#define GSN_MGM_UNLOCK_CONFIG_REP 660
|
||||
|
||||
#define GSN_UTIL_CREATE_LOCK_REQ 132
|
||||
#define GSN_UTIL_CREATE_LOCK_REF 133
|
||||
#define GSN_UTIL_CREATE_LOCK_CONF 188
|
||||
|
|
@ -900,6 +891,7 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
|
|||
#define GSN_RESUME_REQ 682
|
||||
#define GSN_STOP_REQ 443
|
||||
#define GSN_STOP_REF 444
|
||||
#define GSN_STOP_CONF 456
|
||||
#define GSN_API_VERSION_REQ 697
|
||||
#define GSN_API_VERSION_CONF 698
|
||||
|
||||
|
|
|
|||
|
|
@ -49,12 +49,11 @@ class ApiVersionConf {
|
|||
*/
|
||||
friend class MgmtSrv;
|
||||
public:
|
||||
STATIC_CONST( SignalLength = 3 );
|
||||
STATIC_CONST( SignalLength = 4 );
|
||||
Uint32 senderRef;
|
||||
Uint32 nodeId; //api node id
|
||||
Uint32 version; // Version of API node
|
||||
|
||||
|
||||
Uint32 inet_addr;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -67,6 +67,13 @@ public:
|
|||
static bool getStopAbort(const Uint32 & requestInfo);
|
||||
};
|
||||
|
||||
struct StopConf
|
||||
{
|
||||
STATIC_CONST( SignalLength = 2 );
|
||||
Uint32 senderData;
|
||||
Uint32 nodeState;
|
||||
};
|
||||
|
||||
class StopRef
|
||||
{
|
||||
/**
|
||||
|
|
@ -86,7 +93,8 @@ public:
|
|||
OK = 0,
|
||||
NodeShutdownInProgress = 1,
|
||||
SystemShutdownInProgress = 2,
|
||||
NodeShutdownWouldCauseSystemCrash = 3
|
||||
NodeShutdownWouldCauseSystemCrash = 3,
|
||||
TransactionAbortFailed = 4
|
||||
};
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -148,9 +148,9 @@ extern "C" {
|
|||
/** NDB_MGM_EVENT_CATEGORY_INFO */
|
||||
NDB_LE_InfoEvent = 49,
|
||||
|
||||
/* GREP */
|
||||
NDB_LE_GrepSubscriptionInfo = 52,
|
||||
NDB_LE_GrepSubscriptionAlert = 53,
|
||||
/* SINGLE USER */
|
||||
NDB_LE_SingleUser = 52,
|
||||
/* NDB_LE_ UNUSED = 53, */
|
||||
|
||||
/** NDB_MGM_EVENT_CATEGORY_BACKUP */
|
||||
NDB_LE_BackupStarted = 54,
|
||||
|
|
@ -593,6 +593,11 @@ extern "C" {
|
|||
unsigned backup_id;
|
||||
unsigned error;
|
||||
} BackupAborted;
|
||||
/** Log event data @ref NDB_LE_SingleUser */
|
||||
struct {
|
||||
unsigned type;
|
||||
unsigned node_id;
|
||||
} SingleUser;
|
||||
#ifndef DOXYGEN_FIX
|
||||
};
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -633,6 +633,27 @@ void getTextBackupAborted(QQQQ) {
|
|||
theData[3]);
|
||||
}
|
||||
|
||||
void getTextSingleUser(QQQQ) {
|
||||
switch (theData[1])
|
||||
{
|
||||
case 0:
|
||||
BaseString::snprintf(m_text, m_text_len, "Entering single user mode");
|
||||
break;
|
||||
case 1:
|
||||
BaseString::snprintf(m_text, m_text_len,
|
||||
"Entered single user mode "
|
||||
"Node %d has exclusive access", theData[2]);
|
||||
break;
|
||||
case 2:
|
||||
BaseString::snprintf(m_text, m_text_len,"Exiting single user mode");
|
||||
break;
|
||||
default:
|
||||
BaseString::snprintf(m_text, m_text_len,
|
||||
"Unknown single user report %d", theData[1]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
BaseString::snprintf(m_text,
|
||||
m_text_len,
|
||||
|
|
@ -716,6 +737,9 @@ const EventLoggerBase::EventRepLogLevelMatrix EventLoggerBase::matrix[] = {
|
|||
ROW(CreateLogBytes, LogLevel::llInfo, 11, Logger::LL_INFO ),
|
||||
ROW(InfoEvent, LogLevel::llInfo, 2, Logger::LL_INFO ),
|
||||
|
||||
//Single User
|
||||
ROW(SingleUser, LogLevel::llInfo, 7, Logger::LL_INFO ),
|
||||
|
||||
// Backup
|
||||
ROW(BackupStarted, LogLevel::llBackup, 7, Logger::LL_INFO ),
|
||||
ROW(BackupCompleted, LogLevel::llBackup, 7, Logger::LL_INFO ),
|
||||
|
|
|
|||
|
|
@ -51,11 +51,12 @@ SimpleProperties::Writer::add(const char * value, int len){
|
|||
union {
|
||||
Uint32 lastWord;
|
||||
char lastBytes[4];
|
||||
};
|
||||
memcpy(lastBytes,
|
||||
} tmp;
|
||||
tmp.lastWord =0 ;
|
||||
memcpy(tmp.lastBytes,
|
||||
value + putLen*4,
|
||||
len - putLen*4);
|
||||
return putWord(lastWord);
|
||||
return putWord(tmp.lastWord);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -1,12 +1,20 @@
|
|||
#SUBDIRS = printSchemafile
|
||||
|
||||
noinst_LIBRARIES = libdbdict.a
|
||||
EXTRA_PROGRAMS = printSchemaFile
|
||||
|
||||
libdbdict_a_SOURCES = Dbdict.cpp
|
||||
|
||||
printSchemaFile_SOURCES = printSchemaFile.cpp
|
||||
|
||||
include $(top_srcdir)/ndb/config/common.mk.am
|
||||
include $(top_srcdir)/ndb/config/type_kernel.mk.am
|
||||
|
||||
LDADD += \
|
||||
$(top_builddir)/ndb/src/common/util/libgeneral.la \
|
||||
$(top_builddir)/ndb/src/common/portlib/libportlib.la \
|
||||
$(top_builddir)/dbug/libdbug.a \
|
||||
$(top_builddir)/mysys/libmysys.a \
|
||||
$(top_builddir)/strings/libmystrings.a
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,3 @@
|
|||
#if 0
|
||||
make -f Makefile -f - printSchemaFile <<'_eof_'
|
||||
printSchemaFile: printSchemaFile.cpp SchemaFile.hpp
|
||||
$(CXXCOMPILE) -o $@ $@.cpp -L../../../common/util/.libs -lgeneral
|
||||
ifneq ($(MYSQL_HOME),)
|
||||
ln -sf `pwd`/$@ $(MYSQL_HOME)/bin/$@
|
||||
endif
|
||||
_eof_
|
||||
exit $?
|
||||
#endif
|
||||
|
||||
/* Copyright (C) 2003 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -36,14 +25,19 @@ exit $?
|
|||
static const char* progname = 0;
|
||||
static bool allflag = false;
|
||||
static bool checkonly = false;
|
||||
static int xitcode = 0;
|
||||
static bool equalcontents = false;
|
||||
static bool okquiet = false;
|
||||
|
||||
static void
|
||||
usage()
|
||||
{
|
||||
ndbout << "Usage " << progname
|
||||
<< " [-ac]"
|
||||
<< " P0.SchemaLog" << endl;
|
||||
ndbout
|
||||
<< "Usage: " << progname << " [-aceq]" << " file ..." << endl
|
||||
<< "-a print also unused slots" << endl
|
||||
<< "-c check only (return status 1 on error)" << endl
|
||||
<< "-e check also that the files have identical contents" << endl
|
||||
<< "-q no output if file is ok" << endl
|
||||
<< "Example: " << progname << " -ceq ndb_*_fs/D[12]/DBDICT/P0.SchemaLog" << endl;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -57,53 +51,78 @@ fill(const char * buf, int mod)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static const char*
|
||||
version(Uint32 v)
|
||||
{
|
||||
static char buf[40];
|
||||
sprintf(buf, "%d.%d.%d", v >> 16, (v >> 8) & 0xFF, v & 0xFF);
|
||||
return buf;
|
||||
}
|
||||
|
||||
static int
|
||||
print_head(const char * filename, const SchemaFile * sf)
|
||||
{
|
||||
int retcode = 0;
|
||||
|
||||
if (! checkonly) {
|
||||
ndbout << "----- Schemafile: " << filename << " -----" << endl;
|
||||
ndbout_c("Magic: %.*s ByteOrder: %.8x NdbVersion: %d.%d.%d FileSize: %d",
|
||||
ndbout_c("Magic: %.*s ByteOrder: %.8x NdbVersion: %s FileSize: %d",
|
||||
sizeof(sf->Magic),
|
||||
sf->Magic,
|
||||
sf->ByteOrder,
|
||||
sf->NdbVersion >> 16,
|
||||
(sf->NdbVersion >> 8) & 0xFF,
|
||||
sf->NdbVersion & 0xFF,
|
||||
version(sf->NdbVersion),
|
||||
sf->FileSize);
|
||||
}
|
||||
|
||||
if (memcmp(sf->Magic, "NDBSCHMA", sizeof(sf->Magic) != 0)) {
|
||||
ndbout << filename << ": invalid header magic" << endl;
|
||||
retcode = 1;
|
||||
}
|
||||
|
||||
if ((sf->NdbVersion >> 16) < 4 || (sf->NdbVersion >> 16) > 9) {
|
||||
ndbout << filename << ": impossible version " << hex << sf->NdbVersion << endl;
|
||||
retcode = 1;
|
||||
}
|
||||
|
||||
return retcode;
|
||||
}
|
||||
|
||||
static void
|
||||
print_old(const char * filename, const SchemaFile * sf)
|
||||
static int
|
||||
print_old(const char * filename, const SchemaFile * sf, Uint32 sz)
|
||||
{
|
||||
print_head(filename, sf);
|
||||
int retcode = 0;
|
||||
|
||||
if (print_head(filename, sf) != 0)
|
||||
retcode = 1;
|
||||
|
||||
for (Uint32 i = 0; i < sf->NoOfTableEntries; i++) {
|
||||
SchemaFile::TableEntry_old te = sf->TableEntries_old[i];
|
||||
if (allflag ||
|
||||
(te.m_tableState != SchemaFile::INIT &&
|
||||
te.m_tableState != SchemaFile::DROP_TABLE_COMMITTED)) {
|
||||
ndbout << "Table " << i << ":"
|
||||
<< " State = " << te.m_tableState
|
||||
<< " version = " << table_version_major(te.m_tableVersion) <<
|
||||
<< "(" << table_version_minor(te.m_tableVersion) << ")"
|
||||
<< " type = " << te.m_tableType
|
||||
<< " noOfPages = " << te.m_noOfPages
|
||||
<< " gcp: " << te.m_gcp << endl;
|
||||
if (! checkonly)
|
||||
ndbout << "Table " << i << ":"
|
||||
<< " State = " << te.m_tableState
|
||||
<< " version = " << te.m_tableVersion
|
||||
<< " type = " << te.m_tableType
|
||||
<< " noOfPages = " << te.m_noOfPages
|
||||
<< " gcp: " << te.m_gcp << endl;
|
||||
}
|
||||
}
|
||||
return retcode;
|
||||
}
|
||||
|
||||
static void
|
||||
static int
|
||||
print(const char * filename, const SchemaFile * xsf, Uint32 sz)
|
||||
{
|
||||
int retcode = 0;
|
||||
|
||||
print_head(filename, xsf);
|
||||
if (print_head(filename, xsf) != 0)
|
||||
retcode = 1;
|
||||
|
||||
assert(sizeof(SchemaFile) == NDB_SF_PAGE_SIZE);
|
||||
if (xsf->FileSize != sz || xsf->FileSize % NDB_SF_PAGE_SIZE != 0) {
|
||||
ndbout << "***** invalid FileSize " << xsf->FileSize << endl;
|
||||
ndbout << filename << ": invalid FileSize " << xsf->FileSize << endl;
|
||||
retcode = 1;
|
||||
}
|
||||
Uint32 noOfPages = xsf->FileSize / NDB_SF_PAGE_SIZE;
|
||||
|
|
@ -112,19 +131,23 @@ print(const char * filename, const SchemaFile * xsf, Uint32 sz)
|
|||
ndbout << "----- Page: " << n << " (" << noOfPages << ") -----" << endl;
|
||||
}
|
||||
const SchemaFile * sf = &xsf[n];
|
||||
if (memcmp(sf->Magic, xsf->Magic, sizeof(sf->Magic)) != 0) {
|
||||
ndbout << filename << ": page " << n << " invalid magic" << endl;
|
||||
retcode = 1;
|
||||
}
|
||||
if (sf->FileSize != xsf->FileSize) {
|
||||
ndbout << "***** page " << n << " FileSize changed to " << sf->FileSize << "!=" << xsf->FileSize << endl;
|
||||
ndbout << filename << ": page " << n << " FileSize changed to " << sf->FileSize << "!=" << xsf->FileSize << endl;
|
||||
retcode = 1;
|
||||
}
|
||||
Uint32 cs = 0;
|
||||
for (Uint32 j = 0; j < NDB_SF_PAGE_SIZE_IN_WORDS; j++)
|
||||
cs ^= ((const Uint32*)sf)[j];
|
||||
if (cs != 0) {
|
||||
ndbout << "***** page " << n << " invalid CheckSum" << endl;
|
||||
ndbout << filename << ": page " << n << " invalid CheckSum" << endl;
|
||||
retcode = 1;
|
||||
}
|
||||
if (sf->NoOfTableEntries != NDB_SF_PAGE_ENTRIES) {
|
||||
ndbout << "***** page " << n << " invalid NoOfTableEntries " << sf->NoOfTableEntries << endl;
|
||||
ndbout << filename << ": page " << n << " invalid NoOfTableEntries " << sf->NoOfTableEntries << endl;
|
||||
retcode = 1;
|
||||
}
|
||||
for (Uint32 i = 0; i < NDB_SF_PAGE_ENTRIES; i++) {
|
||||
|
|
@ -142,31 +165,41 @@ print(const char * filename, const SchemaFile * xsf, Uint32 sz)
|
|||
<< " gcp: " << te.m_gcp << endl;
|
||||
}
|
||||
if (te.m_unused[0] != 0 || te.m_unused[1] != 0 || te.m_unused[2] != 0) {
|
||||
ndbout << "***** entry " << j << " garbage in m_unused[3]" << endl;
|
||||
ndbout << filename << ": entry " << j << " garbage in m_unused[3]" << endl;
|
||||
retcode = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (retcode != 0)
|
||||
xitcode = 1;
|
||||
else if (checkonly)
|
||||
ndbout << "ok: " << filename << endl;
|
||||
return retcode;
|
||||
}
|
||||
|
||||
NDB_COMMAND(printSchemafile,
|
||||
"printSchemafile", "printSchemafile", "Prints a schemafile", 16384)
|
||||
{
|
||||
progname = argv[0];
|
||||
int exitcode = 0;
|
||||
|
||||
while (argv[1][0] == '-') {
|
||||
while (argc > 1 && argv[1][0] == '-') {
|
||||
if (strchr(argv[1], 'a') != 0)
|
||||
allflag = true;
|
||||
if (strchr(argv[1], 'c') != 0)
|
||||
checkonly = true;
|
||||
if (strchr(argv[1], 'e') != 0)
|
||||
equalcontents = true;
|
||||
if (strchr(argv[1], 'q') != 0)
|
||||
okquiet = true;
|
||||
if (strchr(argv[1], 'h') != 0 || strchr(argv[1], '?') != 0) {
|
||||
usage();
|
||||
return 0;
|
||||
}
|
||||
argc--, argv++;
|
||||
}
|
||||
|
||||
const char * prevfilename = 0;
|
||||
Uint32 * prevbuf = 0;
|
||||
Uint32 prevbytes = 0;
|
||||
|
||||
while (argc > 1) {
|
||||
const char * filename = argv[1];
|
||||
argc--, argv++;
|
||||
|
|
@ -174,8 +207,9 @@ NDB_COMMAND(printSchemafile,
|
|||
struct stat sbuf;
|
||||
const int res = stat(filename, &sbuf);
|
||||
if (res != 0) {
|
||||
ndbout << "Could not find file: \"" << filename << "\"" << endl;
|
||||
return 1;
|
||||
ndbout << filename << ": not found errno=" << errno << endl;
|
||||
exitcode = 1;
|
||||
continue;
|
||||
}
|
||||
const Uint32 bytes = sbuf.st_size;
|
||||
|
||||
|
|
@ -183,25 +217,56 @@ NDB_COMMAND(printSchemafile,
|
|||
|
||||
FILE * f = fopen(filename, "rb");
|
||||
if (f == 0) {
|
||||
ndbout << "Failed to open file" << endl;
|
||||
ndbout << filename << ": open failed errno=" << errno << endl;
|
||||
delete [] buf;
|
||||
return 1;
|
||||
exitcode = 1;
|
||||
continue;
|
||||
}
|
||||
Uint32 sz = fread(buf, 1, bytes, f);
|
||||
fclose(f);
|
||||
if (sz != bytes) {
|
||||
ndbout << "Failure while reading file" << endl;
|
||||
ndbout << filename << ": read failed errno=" << errno << endl;
|
||||
delete [] buf;
|
||||
return 1;
|
||||
exitcode = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (sz < 32) {
|
||||
ndbout << filename << ": too short (no header)" << endl;
|
||||
delete [] buf;
|
||||
exitcode = 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
SchemaFile* sf = (SchemaFile *)&buf[0];
|
||||
int ret;
|
||||
if (sf->NdbVersion < NDB_SF_VERSION_5_0_6)
|
||||
print_old(filename, sf);
|
||||
ret = print_old(filename, sf, sz);
|
||||
else
|
||||
print(filename, sf, sz);
|
||||
delete [] buf;
|
||||
ret = print(filename, sf, sz);
|
||||
|
||||
if (ret != 0) {
|
||||
ndbout << filename << ": check failed"
|
||||
<< " version=" << version(sf->NdbVersion) << endl;
|
||||
exitcode = 1;
|
||||
} else if (! okquiet) {
|
||||
ndbout << filename << ": ok"
|
||||
<< " version=" << version(sf->NdbVersion) << endl;
|
||||
}
|
||||
|
||||
if (equalcontents && prevfilename != 0) {
|
||||
if (prevbytes != bytes || memcmp(prevbuf, buf, bytes) != 0) {
|
||||
ndbout << filename << ": differs from " << prevfilename << endl;
|
||||
exitcode = 1;
|
||||
}
|
||||
}
|
||||
|
||||
prevfilename = filename;
|
||||
delete [] prevbuf;
|
||||
prevbuf = buf;
|
||||
prevbytes = bytes;
|
||||
}
|
||||
|
||||
return xitcode;
|
||||
delete [] prevbuf;
|
||||
return exitcode;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1962,6 +1962,11 @@ Ndbcntr::execRESUME_REQ(Signal* signal){
|
|||
//ResumeRef * const ref = (ResumeRef *)&signal->theData[0];
|
||||
|
||||
jamEntry();
|
||||
|
||||
signal->theData[0] = NDB_LE_SingleUser;
|
||||
signal->theData[1] = 2;
|
||||
sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB);
|
||||
|
||||
//Uint32 senderData = req->senderData;
|
||||
//BlockReference senderRef = req->senderRef;
|
||||
NodeState newState(NodeState::SL_STARTED);
|
||||
|
|
@ -2000,12 +2005,11 @@ Ndbcntr::execSTOP_REQ(Signal* signal){
|
|||
return;
|
||||
}
|
||||
|
||||
if(c_stopRec.stopReq.senderRef != 0 && !singleuser){
|
||||
jam();
|
||||
if(c_stopRec.stopReq.senderRef != 0){
|
||||
/**
|
||||
* Requested a system shutdown
|
||||
*/
|
||||
if(StopReq::getSystemStop(req->requestInfo)){
|
||||
if(!singleuser && StopReq::getSystemStop(req->requestInfo)){
|
||||
jam();
|
||||
sendSignalWithDelay(reference(), GSN_STOP_REQ, signal, 100,
|
||||
StopReq::SignalLength);
|
||||
|
|
@ -2027,23 +2031,28 @@ Ndbcntr::execSTOP_REQ(Signal* signal){
|
|||
c_stopRec.stopReq = * req;
|
||||
c_stopRec.stopInitiatedTime = NdbTick_CurrentMillisecond();
|
||||
|
||||
if(StopReq::getSystemStop(c_stopRec.stopReq.requestInfo) && !singleuser) {
|
||||
jam();
|
||||
if(StopReq::getPerformRestart(c_stopRec.stopReq.requestInfo)){
|
||||
((Configuration&)theConfiguration).stopOnError(false);
|
||||
}
|
||||
}
|
||||
if(!singleuser) {
|
||||
if(StopReq::getSystemStop(c_stopRec.stopReq.requestInfo)) {
|
||||
jam();
|
||||
if(StopReq::getPerformRestart(c_stopRec.stopReq.requestInfo)){
|
||||
((Configuration&)theConfiguration).stopOnError(false);
|
||||
}
|
||||
}
|
||||
if(!c_stopRec.checkNodeFail(signal)){
|
||||
jam();
|
||||
return;
|
||||
}
|
||||
signal->theData[0] = NDB_LE_NDBStopStarted;
|
||||
signal->theData[1] = StopReq::getSystemStop(c_stopRec.stopReq.requestInfo) ? 1 : 0;
|
||||
sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB);
|
||||
}
|
||||
|
||||
signal->theData[0] = NDB_LE_NDBStopStarted;
|
||||
signal->theData[1] = StopReq::getSystemStop(c_stopRec.stopReq.requestInfo) ? 1 : 0;
|
||||
sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB);
|
||||
|
||||
else
|
||||
{
|
||||
signal->theData[0] = NDB_LE_SingleUser;
|
||||
signal->theData[1] = 0;
|
||||
sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB);
|
||||
}
|
||||
|
||||
NodeState newState(NodeState::SL_STOPPING_1,
|
||||
StopReq::getSystemStop(c_stopRec.stopReq.requestInfo));
|
||||
|
||||
|
|
@ -2125,9 +2134,11 @@ Ndbcntr::StopRecord::checkNodeFail(Signal* signal){
|
|||
|
||||
stopReq.senderRef = 0;
|
||||
|
||||
NodeState newState(NodeState::SL_STARTED);
|
||||
|
||||
cntr.updateNodeState(signal, newState);
|
||||
if (cntr.getNodeState().startLevel != NodeState::SL_SINGLEUSER)
|
||||
{
|
||||
NodeState newState(NodeState::SL_STARTED);
|
||||
cntr.updateNodeState(signal, newState);
|
||||
}
|
||||
|
||||
signal->theData[0] = NDB_LE_NDBStopAborted;
|
||||
cntr.sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 1, JBB);
|
||||
|
|
@ -2223,12 +2234,24 @@ void Ndbcntr::execABORT_ALL_CONF(Signal* signal){
|
|||
jamEntry();
|
||||
if(c_stopRec.stopReq.singleuser) {
|
||||
jam();
|
||||
|
||||
NodeState newState(NodeState::SL_SINGLEUSER);
|
||||
newState.setSingleUser(true);
|
||||
newState.setSingleUserApi(c_stopRec.stopReq.singleUserApi);
|
||||
updateNodeState(signal, newState);
|
||||
c_stopRec.stopInitiatedTime = NdbTick_CurrentMillisecond();
|
||||
|
||||
StopConf * const stopConf = (StopConf *)&signal->theData[0];
|
||||
stopConf->senderData = c_stopRec.stopReq.senderData;
|
||||
stopConf->nodeState = (Uint32) NodeState::SL_SINGLEUSER;
|
||||
sendSignal(c_stopRec.stopReq.senderRef, GSN_STOP_CONF, signal, StopConf::SignalLength, JBB);
|
||||
|
||||
c_stopRec.stopReq.senderRef = 0; // the command is done
|
||||
|
||||
signal->theData[0] = NDB_LE_SingleUser;
|
||||
signal->theData[1] = 1;
|
||||
signal->theData[2] = c_stopRec.stopReq.singleUserApi;
|
||||
sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 3, JBB);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -2246,7 +2269,13 @@ void Ndbcntr::execABORT_ALL_CONF(Signal* signal){
|
|||
|
||||
void Ndbcntr::execABORT_ALL_REF(Signal* signal){
|
||||
jamEntry();
|
||||
ndbrequire(false);
|
||||
AbortAllRef *abortAllRef = (AbortAllRef *)&signal->theData[0];
|
||||
AbortAllRef::ErrorCode errorCode = (AbortAllRef::ErrorCode) abortAllRef->errorCode;
|
||||
|
||||
StopRef * const stopRef = (StopRef *)&signal->theData[0];
|
||||
stopRef->senderData = c_stopRec.stopReq.senderData;
|
||||
stopRef->errorCode = StopRef::TransactionAbortFailed;
|
||||
sendSignal(c_stopRec.stopReq.senderRef, GSN_STOP_REF, signal, StopRef::SignalLength, JBB);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue