Commit 7d3c939e authored by unknown's avatar unknown

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
parents 0585fcbe 39ba8376
...@@ -10,7 +10,7 @@ prefix_configs="--prefix=/usr/local/mysql" ...@@ -10,7 +10,7 @@ prefix_configs="--prefix=/usr/local/mysql"
just_print= just_print=
just_configure= just_configure=
full_debug= full_debug=
if test ! -z $MYSQL_BUILD_PREFIX if test -n "$MYSQL_BUILD_PREFIX"
then then
prefix_configs="--prefix=$MYSQL_BUILD_PREFIX" prefix_configs="--prefix=$MYSQL_BUILD_PREFIX"
fi fi
...@@ -53,8 +53,10 @@ global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wch ...@@ -53,8 +53,10 @@ global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wch
c_warnings="$global_warnings -Wunused" c_warnings="$global_warnings -Wunused"
cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor" 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_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_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_configs="$base_max_configs --with-embedded-server"
max_no_ndb_configs="$base_max_no_ndb_configs --with-embedded-server"
path=`dirname $0` path=`dirname $0`
. "$path/check-cpu" . "$path/check-cpu"
......
#! /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"
#! /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"
...@@ -107,15 +107,26 @@ MYSQL_TEST_RUN_ARGS = --manager-port=$(MYSQL_TEST_MANAGER_PORT) \ ...@@ -107,15 +107,26 @@ MYSQL_TEST_RUN_ARGS = --manager-port=$(MYSQL_TEST_MANAGER_PORT) \
--master_port=$(MYSQL_TEST_MASTER_PORT) \ --master_port=$(MYSQL_TEST_MASTER_PORT) \
--slave_port=$(MYSQL_TEST_SLAVE_PORT) \ --slave_port=$(MYSQL_TEST_SLAVE_PORT) \
--ndbcluster_port=$(MYSQL_TEST_NDB_PORT) --ndbcluster_port=$(MYSQL_TEST_NDB_PORT)
test: test:
cd mysql-test ; \ cd mysql-test ; \
./mysql-test-run.pl $(MYSQL_TEST_RUN_ARGS) && \ ./mysql-test-run $(MYSQL_TEST_RUN_ARGS) && \
./mysql-test-run.pl --ps-protocol $(MYSQL_TEST_RUN_ARGS) ./mysql-test-run $(MYSQL_TEST_RUN_ARGS) --ps-protocol
test-force: test-force:
cd mysql-test ; \ cd mysql-test ; \
./mysql-test-run --force $(MYSQL_TEST_RUN_ARGS) ; \ ./mysql-test-run $(MYSQL_TEST_RUN_ARGS) --force ; \
./mysql-test-run --ps-protocol --force $(MYSQL_TEST_RUN_ARGS) ./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 # Don't update the files from bitkeeper
%::SCCS/s.% %::SCCS/s.%
...@@ -1014,13 +1014,13 @@ static int read_and_execute(bool interactive) ...@@ -1014,13 +1014,13 @@ static int read_and_execute(bool interactive)
unsigned long clen; unsigned long clen;
do 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); buffer.append(line, clen);
/* /*
if we got buffer fully filled than there is a chance that if we got buffer fully filled than there is a chance that
something else is still in console input buffer something else is still in console input buffer
*/ */
} while (tmpbuf.alloced_length() <= clen + 1); } while (tmpbuf.alloced_length() <= clen);
line= buffer.c_ptr(); line= buffer.c_ptr();
#else /* OS2 */ #else /* OS2 */
buffer.length(0); buffer.length(0);
......
...@@ -1434,7 +1434,7 @@ int main(int argc, char** argv) ...@@ -1434,7 +1434,7 @@ int main(int argc, char** argv)
of transaction. of transaction.
*/ */
fprintf(result_file, 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"); "/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;\n");
if (disable_log_bin) if (disable_log_bin)
fprintf(result_file, "/*!32316 SET SQL_LOG_BIN=@OLD_SQL_LOG_BIN*/;\n"); fprintf(result_file, "/*!32316 SET SQL_LOG_BIN=@OLD_SQL_LOG_BIN*/;\n");
......
...@@ -59,12 +59,16 @@ ...@@ -59,12 +59,16 @@
#include <stdarg.h> #include <stdarg.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <violite.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 #ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h> #include <sys/wait.h>
#endif #endif
#ifndef WEXITSTATUS #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 #endif
/* MAX_QUERY is 256K -- there is a test in sp-big that is >128K */ /* MAX_QUERY is 256K -- there is a test in sp-big that is >128K */
#define MAX_QUERY (256*1024) #define MAX_QUERY (256*1024)
...@@ -208,7 +212,7 @@ static int got_end_timer= FALSE; ...@@ -208,7 +212,7 @@ static int got_end_timer= FALSE;
static void timer_output(void); static void timer_output(void);
static ulonglong timer_now(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 void ps_init_re(void);
static int ps_match_re(char *); static int ps_match_re(char *);
static char *ps_eprint(int); static char *ps_eprint(int);
...@@ -549,7 +553,7 @@ static void close_cons() ...@@ -549,7 +553,7 @@ static void close_cons()
static void close_files() static void close_files()
{ {
DBUG_ENTER("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)); DBUG_PRINT("info", ("file_name: %s", cur_file->file_name));
if (cur_file->file && cur_file->file != stdin) if (cur_file->file && cur_file->file != stdin)
...@@ -609,7 +613,8 @@ static void die(const char *fmt, ...) ...@@ -609,7 +613,8 @@ static void die(const char *fmt, ...)
if (cur_file && cur_file != file_stack) if (cur_file && cur_file != file_stack)
fprintf(stderr, "In included file \"%s\": ", fprintf(stderr, "In included file \"%s\": ",
cur_file->file_name); 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); vfprintf(stderr, fmt, args);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
fflush(stderr); fflush(stderr);
...@@ -642,7 +647,9 @@ static void verbose_msg(const char *fmt, ...) ...@@ -642,7 +647,9 @@ static void verbose_msg(const char *fmt, ...)
va_start(args, 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); vfprintf(stderr, fmt, args);
fprintf(stderr, "\n"); fprintf(stderr, "\n");
va_end(args); va_end(args);
...@@ -1097,8 +1104,8 @@ static void do_exec(struct st_query *query) ...@@ -1097,8 +1104,8 @@ static void do_exec(struct st_query *query)
(query->expected_errno[i].code.errnum == status)) (query->expected_errno[i].code.errnum == status))
{ {
ok= 1; ok= 1;
verbose_msg("command \"%s\" failed with expected error: %d", DBUG_PRINT("info", ("command \"%s\" failed with expected error: %d",
cmd, status); cmd, status));
} }
} }
if (!ok) if (!ok)
...@@ -1383,9 +1390,7 @@ int do_sync_with_master2(long offset) ...@@ -1383,9 +1390,7 @@ int do_sync_with_master2(long offset)
int rpl_parse; int rpl_parse;
if (!master_pos.file[0]) if (!master_pos.file[0])
{ die("Calling 'sync_with_master' without calling 'save_master_pos'");
die("Line %u: Calling 'sync_with_master' without calling 'save_master_pos'", start_lineno);
}
rpl_parse= mysql_rpl_parse_enabled(mysql); rpl_parse= mysql_rpl_parse_enabled(mysql);
mysql_disable_rpl_parse(mysql); mysql_disable_rpl_parse(mysql);
...@@ -1395,14 +1400,13 @@ int do_sync_with_master2(long offset) ...@@ -1395,14 +1400,13 @@ int do_sync_with_master2(long offset)
wait_for_position: wait_for_position:
if (mysql_query(mysql, query_buf)) if (mysql_query(mysql, query_buf))
die("line %u: failed in %s: %d: %s", start_lineno, query_buf, die("failed in %s: %d: %s", query_buf, mysql_errno(mysql),
mysql_errno(mysql), mysql_error(mysql)); mysql_error(mysql));
if (!(last_result= res= mysql_store_result(mysql))) if (!(last_result= res= mysql_store_result(mysql)))
die("line %u: mysql_store_result() returned NULL for '%s'", start_lineno, die("mysql_store_result() returned NULL for '%s'", query_buf);
query_buf);
if (!(row= mysql_fetch_row(res))) 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]) if (!row[0])
{ {
/* /*
...@@ -1410,10 +1414,7 @@ wait_for_position: ...@@ -1410,10 +1414,7 @@ wait_for_position:
SLAVE has been issued ? SLAVE has been issued ?
*/ */
if (tries++ == 3) if (tries++ == 3)
{ die("could not sync with master ('%s' returned NULL)", query_buf);
die("line %u: could not sync with master ('%s' returned NULL)",
start_lineno, query_buf);
}
sleep(1); /* So at most we will wait 3 seconds and make 4 tries */ sleep(1); /* So at most we will wait 3 seconds and make 4 tries */
mysql_free_result(res); mysql_free_result(res);
goto wait_for_position; goto wait_for_position;
...@@ -1459,10 +1460,9 @@ int do_save_master_pos() ...@@ -1459,10 +1460,9 @@ int do_save_master_pos()
mysql_errno(mysql), mysql_error(mysql)); mysql_errno(mysql), mysql_error(mysql));
if (!(last_result =res = mysql_store_result(mysql))) if (!(last_result =res = mysql_store_result(mysql)))
die("line %u: mysql_store_result() retuned NULL for '%s'", start_lineno, die("mysql_store_result() retuned NULL for '%s'", query);
query);
if (!(row = mysql_fetch_row(res))) 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); strnmov(master_pos.file, row[0], sizeof(master_pos.file)-1);
master_pos.pos = strtoul(row[1], (char**) 0, 10); master_pos.pos = strtoul(row[1], (char**) 0, 10);
mysql_free_result(res); last_result=0; mysql_free_result(res); last_result=0;
...@@ -2768,7 +2768,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -2768,7 +2768,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
fn_format(buff, argument, "", "", 4); fn_format(buff, argument, "", "", 4);
DBUG_ASSERT(cur_file == file_stack && cur_file->file == 0); DBUG_ASSERT(cur_file == file_stack && cur_file->file == 0);
if (!(cur_file->file= 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); die("Could not open %s: errno = %d", buff, errno);
cur_file->file_name= my_strdup(buff, MYF(MY_FAE)); cur_file->file_name= my_strdup(buff, MYF(MY_FAE));
break; break;
...@@ -2874,7 +2874,7 @@ void str_to_file(const char *fname, char *str, int size) ...@@ -2874,7 +2874,7 @@ void str_to_file(const char *fname, char *str, int size)
fname=buff; fname=buff;
} }
fn_format(buff,fname,"","",4); fn_format(buff,fname,"","",4);
if ((fd = my_open(buff, O_WRONLY | O_CREAT | O_TRUNC, if ((fd = my_open(buff, O_WRONLY | O_CREAT | O_TRUNC,
MYF(MY_WME | MY_FFNF))) < 0) MYF(MY_WME | MY_FFNF))) < 0)
die("Could not open %s: errno = %d", buff, errno); die("Could not open %s: errno = %d", buff, errno);
...@@ -3767,12 +3767,13 @@ static void ps_init_re(void) ...@@ -3767,12 +3767,13 @@ static void ps_init_re(void)
"[[:space:]]*UPDATE[[:space:]]+MULTI[[:space:]]|" "[[:space:]]*UPDATE[[:space:]]+MULTI[[:space:]]|"
"[[:space:]]*INSERT[[:space:]]+SELECT[[:space:]])"; "[[:space:]]*INSERT[[:space:]]+SELECT[[:space:]])";
int err= regcomp(&ps_re, ps_re_str, (REG_EXTENDED | REG_ICASE | REG_NOSUB), int err= my_regcomp(&ps_re, ps_re_str,
&my_charset_latin1); (REG_EXTENDED | REG_ICASE | REG_NOSUB),
&my_charset_latin1);
if (err) if (err)
{ {
char erbuf[100]; 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", fprintf(stderr, "error %s, %d/%d `%s'\n",
ps_eprint(err), len, (int)sizeof(erbuf), erbuf); ps_eprint(err), len, (int)sizeof(erbuf), erbuf);
exit(1); exit(1);
...@@ -3782,7 +3783,7 @@ static void ps_init_re(void) ...@@ -3782,7 +3783,7 @@ static void ps_init_re(void)
static int ps_match_re(char *stmt_str) 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) if (err == 0)
return 1; return 1;
...@@ -3791,7 +3792,7 @@ static int ps_match_re(char *stmt_str) ...@@ -3791,7 +3792,7 @@ static int ps_match_re(char *stmt_str)
else else
{ {
char erbuf[100]; 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", fprintf(stderr, "error %s, %d/%d `%s'\n",
ps_eprint(err), len, (int)sizeof(erbuf), erbuf); ps_eprint(err), len, (int)sizeof(erbuf), erbuf);
exit(1); exit(1);
...@@ -3801,7 +3802,7 @@ static int ps_match_re(char *stmt_str) ...@@ -3801,7 +3802,7 @@ static int ps_match_re(char *stmt_str)
static char *ps_eprint(int err) static char *ps_eprint(int err)
{ {
static char epbuf[100]; 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)); assert(len <= sizeof(epbuf));
return(epbuf); return(epbuf);
} }
...@@ -3809,7 +3810,7 @@ static char *ps_eprint(int err) ...@@ -3809,7 +3810,7 @@ static char *ps_eprint(int err)
static void ps_free_reg(void) static void ps_free_reg(void)
{ {
regfree(&ps_re); my_regfree(&ps_re);
} }
/****************************************************************************/ /****************************************************************************/
...@@ -4304,12 +4305,20 @@ int main(int argc, char **argv) ...@@ -4304,12 +4305,20 @@ int main(int argc, char **argv)
if (res_info.st_size) if (res_info.st_size)
error|= (RESULT_CONTENT_MISMATCH | RESULT_LENGTH_MISMATCH); error|= (RESULT_CONTENT_MISMATCH | RESULT_LENGTH_MISMATCH);
} }
if (result_file && ds_res.length && !error) if (ds_res.length && !error)
{ {
if (!record) if (result_file)
error |= check_result(&ds_res, result_file, q->require_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 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); dynstr_free(&ds_res);
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>
#if defined (HAVE_SYS_FILE_H) #if defined (HAVE_SYS_FILE_H)
# include <sys/file.h> # include <sys/file.h>
#endif #endif
...@@ -1149,7 +1150,8 @@ compute_lcd_of_matches (match_list, matches, text) ...@@ -1149,7 +1150,8 @@ compute_lcd_of_matches (match_list, matches, text)
rl_completion_found_quote && rl_completion_found_quote &&
rl_filename_quoting_desired) 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; text = dtext;
} }
......
...@@ -23,13 +23,14 @@ AC_DEFUN([MYSQL_CHECK_YASSL], [ ...@@ -23,13 +23,14 @@ AC_DEFUN([MYSQL_CHECK_YASSL], [
# System specific checks # System specific checks
yassl_integer_extra_cxxflags="" yassl_integer_extra_cxxflags=""
case $SYSTEM_TYPE--$CXX_VERSION in case $host_cpu--$CXX_VERSION in
sparc*solaris*--*Sun*C++*5.6*) sparc*--*Sun*C++*5.6*)
# Disable inlining when compiling taocrypt/src/integer.cpp # Disable inlining when compiling taocrypt/src/integer.cpp
yassl_integer_extra_cxxflags="+d" yassl_integer_extra_cxxflags="+d"
AC_MSG_NOTICE([disabling inlining for yassl/taocrypt/src/integer.cpp])
;; ;;
esac esac
AC_SUBST([yassl_integer_extra_cxxflags]) AC_SUBST([yassl_integer_extra_cxxflags])
else else
yassl_dir="" yassl_dir=""
......
...@@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc) ...@@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc)
AC_CANONICAL_SYSTEM AC_CANONICAL_SYSTEM
# The Docs Makefile.am parses this line! # The Docs Makefile.am parses this line!
# remember to also change ndb version below and update version.c in ndb # 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) AM_CONFIG_HEADER(config.h)
PROTOCOL_VERSION=10 PROTOCOL_VERSION=10
...@@ -18,7 +18,7 @@ SHARED_LIB_VERSION=15:0:0 ...@@ -18,7 +18,7 @@ SHARED_LIB_VERSION=15:0:0
# ndb version # ndb version
NDB_VERSION_MAJOR=5 NDB_VERSION_MAJOR=5
NDB_VERSION_MINOR=0 NDB_VERSION_MINOR=0
NDB_VERSION_BUILD=14 NDB_VERSION_BUILD=15
NDB_VERSION_STATUS="rc" NDB_VERSION_STATUS="rc"
# Set all version vars based on $VERSION. How do we do this more elegant ? # Set all version vars based on $VERSION. How do we do this more elegant ?
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#endif #endif
#include <my_global.h> /* This includes dbug.h */ #include <my_global.h> /* This includes dbug.h */
#include <my_pthread.h>
int main (argc, argv) int main (argc, argv)
int argc; int argc;
......
...@@ -45,7 +45,8 @@ struct vector_base { ...@@ -45,7 +45,8 @@ struct vector_base {
vector_base() : start_(0), finish_(0), end_of_storage_(0) {} vector_base() : start_(0), finish_(0), end_of_storage_(0) {}
vector_base(size_t n) 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(); if (!start_) abort();
finish_ = start_; finish_ = start_;
end_of_storage_ = start_ + n; end_of_storage_ = start_ + n;
......
...@@ -56,12 +56,12 @@ private: ...@@ -56,12 +56,12 @@ private:
T mac_; T mac_;
// MSVC 6 HACK, gives compiler error if calculated in array // MSVC 6 HACK, gives compiler error if calculated in array
enum { BSIZE = T::BLOCK_SIZE / sizeof(word32), enum { HMAC_BSIZE = T::BLOCK_SIZE / sizeof(word32),
DSIZE = T::DIGEST_SIZE / sizeof(word32) }; HMAC_DSIZE = T::DIGEST_SIZE / sizeof(word32) };
word32 ip_[BSIZE]; // align ipad_ on word32 word32 ip_[HMAC_BSIZE]; // align ipad_ on word32
word32 op_[BSIZE]; // align opad_ on word32 word32 op_[HMAC_BSIZE]; // align opad_ on word32
word32 innerH_[DSIZE]; // align innerHash_ on word32 word32 innerH_[HMAC_DSIZE]; // align innerHash_ on word32
void KeyInnerHash(); void KeyInnerHash();
......
...@@ -238,7 +238,7 @@ C_MODE_END ...@@ -238,7 +238,7 @@ C_MODE_END
/* Fix a bug in gcc 2.8.0 on IRIX 6.2 */ /* 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 ??? */ #undef __LONG_MAX__ /* Is a longlong value in gcc 2.8.0 ??? */
#define __LONG_MAX__ 2147483647 #define __LONG_MAX__ 2147483647
#endif #endif
......
...@@ -262,6 +262,7 @@ extern char wild_many,wild_one,wild_prefix; ...@@ -262,6 +262,7 @@ extern char wild_many,wild_one,wild_prefix;
extern const char *charsets_dir; extern const char *charsets_dir;
extern char *defaults_extra_file; extern char *defaults_extra_file;
extern const char *defaults_group_suffix; extern const char *defaults_group_suffix;
extern const char *defaults_file;
extern my_bool timed_mutexes; extern my_bool timed_mutexes;
...@@ -280,7 +281,7 @@ enum loglevel { ...@@ -280,7 +281,7 @@ enum loglevel {
enum cache_type enum cache_type
{ {
READ_CACHE,WRITE_CACHE, TYPE_NOT_SET= 0, READ_CACHE, WRITE_CACHE,
SEQ_READ_APPEND /* sequential read or append */, SEQ_READ_APPEND /* sequential read or append */,
READ_FIFO, READ_NET,WRITE_NET}; READ_FIFO, READ_NET,WRITE_NET};
......
...@@ -321,7 +321,9 @@ buf_page_is_corrupted( ...@@ -321,7 +321,9 @@ buf_page_is_corrupted(
fprintf(stderr, fprintf(stderr,
" InnoDB: Error: page %lu log sequence number %lu %lu\n" " InnoDB: Error: page %lu log sequence number %lu %lu\n"
"InnoDB: is in the future! Current system 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) mach_read_from_4(read_buf + FIL_PAGE_OFFSET),
(ulong) ut_dulint_get_high( (ulong) ut_dulint_get_high(
mach_read_from_8(read_buf + FIL_PAGE_LSN)), mach_read_from_8(read_buf + FIL_PAGE_LSN)),
......
...@@ -99,8 +99,7 @@ heap freeing. */ ...@@ -99,8 +99,7 @@ heap freeing. */
/********************************************************************* /*********************************************************************
NOTE: Use the corresponding macros instead of this function. Creates a NOTE: Use the corresponding macros instead of this function. Creates a
memory heap which allocates memory from dynamic space. For debugging memory heap which allocates memory from dynamic space. For debugging
purposes, takes also the file name and line as argument in the debug purposes, takes also the file name and line as argument. */
version. */
UNIV_INLINE UNIV_INLINE
mem_heap_t* mem_heap_t*
mem_heap_create_func( mem_heap_create_func(
......
...@@ -371,8 +371,7 @@ mem_heap_free_top( ...@@ -371,8 +371,7 @@ mem_heap_free_top(
/********************************************************************* /*********************************************************************
NOTE: Use the corresponding macros instead of this function. Creates a NOTE: Use the corresponding macros instead of this function. Creates a
memory heap which allocates memory from dynamic space. For debugging memory heap which allocates memory from dynamic space. For debugging
purposes, takes also the file name and line as argument in the debug purposes, takes also the file name and line as argument. */
version. */
UNIV_INLINE UNIV_INLINE
mem_heap_t* mem_heap_t*
mem_heap_create_func( mem_heap_create_func(
......
...@@ -122,6 +122,7 @@ ut_strcmp(const void* str1, const void* str2); ...@@ -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 Copies up to size - 1 characters from the NUL-terminated string src to
dst, NUL-terminating the result. Returns strlen(src), so truncation dst, NUL-terminating the result. Returns strlen(src), so truncation
occurred if the return value >= size. */ occurred if the return value >= size. */
ulint ulint
ut_strlcpy( ut_strlcpy(
/*=======*/ /*=======*/
...@@ -130,6 +131,18 @@ ut_strlcpy( ...@@ -130,6 +131,18 @@ ut_strlcpy(
const char* src, /* in: source buffer */ const char* src, /* in: source buffer */
ulint size); /* in: size of destination 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)). */ Compute strlen(ut_strcpyq(str, q)). */
UNIV_INLINE UNIV_INLINE
......
...@@ -187,9 +187,7 @@ mem_heap_create_block( ...@@ -187,9 +187,7 @@ mem_heap_create_block(
} }
block->magic_n = MEM_BLOCK_MAGIC_N; block->magic_n = MEM_BLOCK_MAGIC_N;
ut_memcpy(&(block->file_name), file_name + ut_strlen(file_name) - 7, ut_strlcpy_rev(block->file_name, file_name, sizeof(block->file_name));
7);
block->file_name[7]='\0';
block->line = line; block->line = line;
#ifdef MEM_PERIODIC_CHECK #ifdef MEM_PERIODIC_CHECK
......
...@@ -292,6 +292,9 @@ os_awe_allocate_physical_mem( ...@@ -292,6 +292,9 @@ os_awe_allocate_physical_mem(
return(TRUE); return(TRUE);
#else #else
UT_NOT_USED(n_megabytes);
UT_NOT_USED(page_info);
return(FALSE); return(FALSE);
#endif #endif
} }
...@@ -349,6 +352,8 @@ os_awe_allocate_virtual_mem_window( ...@@ -349,6 +352,8 @@ os_awe_allocate_virtual_mem_window(
return(ptr); return(ptr);
#else #else
UT_NOT_USED(size);
return(NULL); return(NULL);
#endif #endif
} }
...@@ -476,6 +481,10 @@ os_awe_map_physical_mem_to_window( ...@@ -476,6 +481,10 @@ os_awe_map_physical_mem_to_window(
return(TRUE); return(TRUE);
#else #else
UT_NOT_USED(ptr);
UT_NOT_USED(n_mem_pages);
UT_NOT_USED(page_info);
return(FALSE); return(FALSE);
#endif #endif
} }
......
...@@ -364,7 +364,30 @@ ut_strlcpy( ...@@ -364,7 +364,30 @@ ut_strlcpy(
dst[n] = '\0'; 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 ...@@ -37,7 +37,7 @@ SUBDIRS = . examples
libmysqld_sources= libmysqld.c lib_sql.cc emb_qcache.cc libmysqld_sources= libmysqld.c lib_sql.cc emb_qcache.cc
libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c \ libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c \
my_time.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 noinst_HEADERS = embedded_priv.h emb_qcache.h
...@@ -63,7 +63,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \ ...@@ -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 \ 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 \ 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 \ 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_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) $(sqlexamplessources)
libmysqld_a_SOURCES= libmysqld_a_SOURCES=
......
...@@ -423,9 +423,9 @@ int init_embedded_server(int argc, char **argv, char **groups) ...@@ -423,9 +423,9 @@ int init_embedded_server(int argc, char **argv, char **groups)
acl_error= 0; acl_error= 0;
#ifndef NO_EMBEDDED_ACCESS_CHECKS #ifndef NO_EMBEDDED_ACCESS_CHECKS
if (!(acl_error= acl_init((THD *)0, opt_noacl)) && if (!(acl_error= acl_init(opt_noacl)) &&
!opt_noacl) !opt_noacl)
(void) grant_init((THD *)0); (void) grant_init();
#endif #endif
if (acl_error || my_tz_init((THD *)0, default_tz_name, opt_bootstrap)) 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) ...@@ -514,8 +514,8 @@ void *create_embedded_thd(int client_flag, char *db)
thd->db= db; thd->db= db;
thd->db_length= db ? strip_sp(db) : 0; thd->db_length= db ? strip_sp(db) : 0;
#ifndef NO_EMBEDDED_ACCESS_CHECKS #ifndef NO_EMBEDDED_ACCESS_CHECKS
thd->db_access= DB_ACLS; thd->security_ctx->db_access= DB_ACLS;
thd->master_access= ~NO_ACCESS; thd->security_ctx->master_access= ~NO_ACCESS;
#endif #endif
thd->net.query_cache_query= 0; thd->net.query_cache_query= 0;
...@@ -542,26 +542,27 @@ int check_embedded_connection(MYSQL *mysql) ...@@ -542,26 +542,27 @@ int check_embedded_connection(MYSQL *mysql)
int check_embedded_connection(MYSQL *mysql) int check_embedded_connection(MYSQL *mysql)
{ {
THD *thd= (THD*)mysql->thd; THD *thd= (THD*)mysql->thd;
Security_context *sctx= thd->security_ctx;
int result; int result;
char scramble_buff[SCRAMBLE_LENGTH]; char scramble_buff[SCRAMBLE_LENGTH];
int passwd_len; int passwd_len;
if (mysql->options.client_ip) if (mysql->options.client_ip)
{ {
thd->host= my_strdup(mysql->options.client_ip, MYF(0)); sctx->host= my_strdup(mysql->options.client_ip, MYF(0));
thd->ip= my_strdup(thd->host, MYF(0)); sctx->ip= my_strdup(sctx->host, MYF(0));
} }
else else
thd->host= (char*)my_localhost; sctx->host= (char*)my_localhost;
thd->host_or_ip= thd->host; 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; result= ER_HOST_NOT_PRIVILEGED;
goto err; goto err;
} }
thd->user= my_strdup(mysql->user, MYF(0)); sctx->user= my_strdup(mysql->user, MYF(0));
if (mysql->passwd && mysql->passwd[0]) if (mysql->passwd && mysql->passwd[0])
{ {
memset(thd->scramble, 55, SCRAMBLE_LENGTH); // dummy scramble memset(thd->scramble, 55, SCRAMBLE_LENGTH); // dummy scramble
......
...@@ -473,7 +473,8 @@ static int _ftb_check_phrase(const byte *s0, const byte *e0, ...@@ -473,7 +473,8 @@ static int _ftb_check_phrase(const byte *s0, const byte *e0,
for (;;) for (;;)
{ {
n_word= (FT_WORD *)phrase_element->data; 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; break;
if (! (phrase_element= phrase_element->next)) if (! (phrase_element= phrase_element->next))
DBUG_RETURN(1); DBUG_RETURN(1);
......
...@@ -1092,7 +1092,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend) ...@@ -1092,7 +1092,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
"Keypointers and record positions doesn't match"); "Keypointers and record positions doesn't match");
error=1; error=1;
} }
else if (param->glob_crc != info->s->state.checksum && else if (param->glob_crc != info->state->checksum &&
(info->s->options & (info->s->options &
(HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD))) (HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD)))
{ {
...@@ -1388,7 +1388,7 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info, ...@@ -1388,7 +1388,7 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
info->state->data_file_length=sort_param.max_pos; info->state->data_file_length=sort_param.max_pos;
} }
if (param->testflag & T_CALC_CHECKSUM) if (param->testflag & T_CALC_CHECKSUM)
share->state.checksum=param->glob_crc; info->state->checksum=param->glob_crc;
if (!(param->testflag & T_SILENT)) if (!(param->testflag & T_SILENT))
{ {
...@@ -2156,7 +2156,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info, ...@@ -2156,7 +2156,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
my_errno); my_errno);
} }
if (param->testflag & T_CALC_CHECKSUM) 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))) if (my_chsize(share->kfile,info->state->key_file_length,0,MYF(0)))
mi_check_print_warning(param, mi_check_print_warning(param,
...@@ -2577,7 +2577,7 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info, ...@@ -2577,7 +2577,7 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
my_errno); my_errno);
} }
if (param->testflag & T_CALC_CHECKSUM) 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))) if (my_chsize(share->kfile,info->state->key_file_length,0,MYF(0)))
mi_check_print_warning(param, mi_check_print_warning(param,
...@@ -3808,7 +3808,7 @@ int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename) ...@@ -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.create_time=share.state.create_time;
(*org_info)->s->state.unique=(*org_info)->this_unique= (*org_info)->s->state.unique=(*org_info)->this_unique=
share.state.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)->state->del=info.state->del;
(*org_info)->s->state.dellink=share.state.dellink; (*org_info)->s->state.dellink=share.state.dellink;
(*org_info)->state->empty=info.state->empty; (*org_info)->state->empty=info.state->empty;
......
...@@ -93,7 +93,7 @@ int mi_delete(MI_INFO *info,const byte *record) ...@@ -93,7 +93,7 @@ int mi_delete(MI_INFO *info,const byte *record)
if ((*share->delete_record)(info)) if ((*share->delete_record)(info))
goto err; /* Remove record from database */ 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->update= HA_STATE_CHANGED+HA_STATE_DELETED+HA_STATE_ROW_CHANGED;
info->state->records--; info->state->records--;
......
...@@ -41,7 +41,7 @@ int mi_delete_all_rows(MI_INFO *info) ...@@ -41,7 +41,7 @@ int mi_delete_all_rows(MI_INFO *info)
info->state->key_file_length=share->base.keystart; info->state->key_file_length=share->base.keystart;
info->state->data_file_length=0; info->state->data_file_length=0;
info->state->empty=info->state->key_empty=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-- ; ) for (i=share->base.max_key_block_length/MI_MIN_KEY_BLOCK_LENGTH ; i-- ; )
state->key_del[i]= HA_OFFSET_ERROR; state->key_del[i]= HA_OFFSET_ERROR;
......
...@@ -358,7 +358,7 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr, ...@@ -358,7 +358,7 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr,
byte *blob_ptr; byte *blob_ptr;
DBUG_ENTER("_mi_put_key_in_record"); 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=(byte*) info->lastkey; /* KEy that was read */
key_end=key+info->lastkey_length; key_end=key+info->lastkey_length;
for (keyseg=info->s->keyinfo[keynr].seg ; keyseg->type ;keyseg++) 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) ...@@ -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", DBUG_PRINT("warning",("saved_base_info_length: %d base_info_length: %d",
len,MI_BASE_INFO_SIZE)) 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; share->state.state_length=base_pos;
if (!(open_flags & HA_OPEN_FOR_REPAIR) && if (!(open_flags & HA_OPEN_FOR_REPAIR) &&
...@@ -822,7 +823,7 @@ uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite) ...@@ -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.empty); ptr +=8;
mi_sizestore(ptr,state->state.key_empty); ptr +=8; mi_sizestore(ptr,state->state.key_empty); ptr +=8;
mi_int8store(ptr,state->auto_increment); 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->process); ptr +=4;
mi_int4store(ptr,state->unique); ptr +=4; mi_int4store(ptr,state->unique); ptr +=4;
mi_int4store(ptr,state->status); 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) ...@@ -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; uint i,keys,key_parts,key_blocks;
memcpy_fixed(&state->header,ptr, sizeof(state->header)); memcpy_fixed(&state->header,ptr, sizeof(state->header));
...@@ -884,7 +885,7 @@ char *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state) ...@@ -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.empty = mi_sizekorr(ptr); ptr +=8;
state->state.key_empty= mi_sizekorr(ptr); ptr +=8; state->state.key_empty= mi_sizekorr(ptr); ptr +=8;
state->auto_increment=mi_uint8korr(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->process= mi_uint4korr(ptr); ptr +=4;
state->unique = mi_uint4korr(ptr); ptr +=4; state->unique = mi_uint4korr(ptr); ptr +=4;
state->status = 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) ...@@ -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->keystart = mi_sizekorr(ptr); ptr +=8;
base->max_data_file_length = 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) ...@@ -237,7 +237,7 @@ static int run_test(const char *filename)
pos=HA_OFFSET_ERROR; pos=HA_OFFSET_ERROR;
} }
if (found != row_count) 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) if (!silent)
...@@ -303,7 +303,8 @@ static int run_test(const char *filename) ...@@ -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 ((error=mi_rrnd(file,read_record,i == 1 ? 0L : HA_OFFSET_ERROR)) == -1)
{ {
if (found != row_count-deleted) 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; break;
} }
if (!error) if (!error)
......
...@@ -162,7 +162,7 @@ int mi_update(register MI_INFO *info, const byte *oldrec, byte *newrec) ...@@ -162,7 +162,7 @@ int mi_update(register MI_INFO *info, const byte *oldrec, byte *newrec)
if (auto_key_changed) if (auto_key_changed)
update_auto_increment(info,newrec); update_auto_increment(info,newrec);
if (share->calc_checksum) 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 | info->update= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED | HA_STATE_AKTIV |
key_changed); key_changed);
......
...@@ -142,7 +142,7 @@ int mi_write(MI_INFO *info, byte *record) ...@@ -142,7 +142,7 @@ int mi_write(MI_INFO *info, byte *record)
{ {
if ((*share->write_record)(info,record)) if ((*share->write_record)(info,record))
goto err; goto err;
share->state.checksum+=info->checksum; info->state->checksum+=info->checksum;
} }
if (share->base.auto_key) if (share->base.auto_key)
update_auto_increment(info,record); update_auto_increment(info,record);
......
...@@ -705,7 +705,7 @@ get_one_option(int optid, ...@@ -705,7 +705,7 @@ get_one_option(int optid,
fprintf(stderr, "Invalid value of stats_method: %s.\n", argument); fprintf(stderr, "Invalid value of stats_method: %s.\n", argument);
exit(1); exit(1);
} }
check_param.stats_method= method-1; check_param.stats_method= (enum_mi_stats_method) (method-1);
break; break;
} }
#ifdef DEBUG /* Only useful if debugging */ #ifdef DEBUG /* Only useful if debugging */
...@@ -1261,7 +1261,7 @@ static void descript(MI_CHECK *param, register MI_INFO *info, my_string name) ...@@ -1261,7 +1261,7 @@ static void descript(MI_CHECK *param, register MI_INFO *info, my_string name)
share->base.raid_chunksize); share->base.raid_chunksize);
} }
if (share->options & (HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD)) 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) if (share->options & HA_OPTION_DELAY_KEY_WRITE)
printf("Keys are only flushed at close\n"); printf("Keys are only flushed at close\n");
...@@ -1576,7 +1576,7 @@ static int mi_sort_records(MI_CHECK *param, ...@@ -1576,7 +1576,7 @@ static int mi_sort_records(MI_CHECK *param,
old_record_count=info->state->records; old_record_count=info->state->records;
info->state->records=0; info->state->records=0;
if (sort_info.new_data_file_type != COMPRESSED_RECORD) 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], if (sort_record_index(&sort_param,info,keyinfo,share->state.key_root[sort_key],
temp_buff, sort_key,new_file,update_index) || temp_buff, sort_key,new_file,update_index) ||
......
...@@ -38,6 +38,7 @@ typedef struct st_mi_status_info ...@@ -38,6 +38,7 @@ typedef struct st_mi_status_info
my_off_t key_empty; /* lost space in indexfile */ my_off_t key_empty; /* lost space in indexfile */
my_off_t key_file_length; my_off_t key_file_length;
my_off_t data_file_length; my_off_t data_file_length;
ha_checksum checksum;
} MI_STATUS_INFO; } MI_STATUS_INFO;
typedef struct st_mi_state_info typedef struct st_mi_state_info
...@@ -75,7 +76,6 @@ 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_changed; /* Updated when new sec_index */
ulong sec_index_used; /* which extra index are in use */ ulong sec_index_used; /* which extra index are in use */
ulonglong key_map; /* Which keys are in use */ ulonglong key_map; /* Which keys are in use */
ha_checksum checksum;
ulong version; /* timestamp of create */ ulong version; /* timestamp of create */
time_t create_time; /* Time when created database */ time_t create_time; /* Time when created database */
time_t recover_time; /* Time for last recover */ time_t recover_time; /* Time for last recover */
...@@ -680,10 +680,10 @@ extern uint read_pack_length(uint version, const uchar *buf, ulong *length); ...@@ -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); extern uint calc_pack_length(uint version, ulong length);
uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite); 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_state_info_read_dsk(File file, MI_STATE_INFO *state, my_bool pRead);
uint mi_base_info_write(File file, MI_BASE_INFO *base); 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); int mi_keyseg_write(File file, const HA_KEYSEG *keyseg);
char *mi_keyseg_read(char *ptr, HA_KEYSEG *keyseg); char *mi_keyseg_read(char *ptr, HA_KEYSEG *keyseg);
uint mi_keydef_write(File file, MI_KEYDEF *keydef); uint mi_keydef_write(File file, MI_KEYDEF *keydef);
......
...@@ -2008,7 +2008,7 @@ static char *hexdigits(ulonglong value) ...@@ -2008,7 +2008,7 @@ static char *hexdigits(ulonglong value)
static int write_header(PACK_MRG_INFO *mrg,uint head_length,uint trees, static int write_header(PACK_MRG_INFO *mrg,uint head_length,uint trees,
my_off_t tot_elements,my_off_t filelength) my_off_t tot_elements,my_off_t filelength)
{ {
byte *buff=file_buffer.pos; byte *buff= (byte*) file_buffer.pos;
bzero(buff,HEAD_LENGTH); bzero(buff,HEAD_LENGTH);
memcpy_fixed(buff,myisam_pack_file_magic,4); 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, ...@@ -2024,7 +2024,7 @@ static int write_header(PACK_MRG_INFO *mrg,uint head_length,uint trees,
if (test_only) if (test_only)
return 0; return 0;
VOID(my_seek(file_buffer.file,0L,MY_SEEK_SET,MYF(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; 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) ...@@ -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)) if (flush_buffer((ulong) max_calc_length + (ulong) max_pack_length))
break; break;
record_pos=file_buffer.pos; record_pos= (byte*) file_buffer.pos;
file_buffer.pos+=max_pack_length; file_buffer.pos+=max_pack_length;
for (start_pos=record, count= huff_counts; count < end_count ; count++) 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) ...@@ -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) static void init_file_buffer(File file, pbool read_buffer)
{ {
file_buffer.file=file; 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.end=file_buffer.buffer+ALIGN_SIZE(RECORD_CACHE_SIZE)-8;
file_buffer.pos_in_file=0; file_buffer.pos_in_file=0;
error_on_write=0; error_on_write=0;
...@@ -2837,7 +2838,8 @@ static int flush_buffer(ulong neaded_length) ...@@ -2837,7 +2838,8 @@ static int flush_buffer(ulong neaded_length)
file_buffer.pos_in_file+=length; file_buffer.pos_in_file+=length;
if (test_only) if (test_only)
return 0; 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, length,
MYF(MY_WME | MY_NABP | MY_WAIT_IF_FULL))) MYF(MY_WME | MY_NABP | MY_WAIT_IF_FULL)))
{ {
...@@ -2850,13 +2852,13 @@ static int flush_buffer(ulong neaded_length) ...@@ -2850,13 +2852,13 @@ static int flush_buffer(ulong neaded_length)
{ {
char *tmp; char *tmp;
neaded_length+=256; /* some margin */ 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) if (!tmp)
return 1; return 1;
file_buffer.pos= ((uchar*) tmp + file_buffer.pos= ((uchar*) tmp +
(ulong) (file_buffer.pos - file_buffer.buffer)); (ulong) (file_buffer.pos - file_buffer.buffer));
file_buffer.buffer=tmp; file_buffer.buffer= (uchar*) tmp;
file_buffer.end=tmp+neaded_length-8; file_buffer.end= (uchar*) (tmp+neaded_length-8);
} }
return 0; return 0;
} }
...@@ -2965,7 +2967,7 @@ static int save_state(MI_INFO *isam_file,PACK_MRG_INFO *mrg,my_off_t new_length, ...@@ -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; share->state.key_root[key]= HA_OFFSET_ERROR;
for (key=0 ; key < share->state.header.max_block_size ; key++) for (key=0 ; key < share->state.header.max_block_size ; key++)
share->state.key_del[key]= HA_OFFSET_ERROR; 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->changed=1; /* Force write of header */
share->state.open_count=0; share->state.open_count=0;
share->global_changed=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, ...@@ -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.dellink= HA_OFFSET_ERROR;
state.version=(ulong) time((time_t*) 0); state.version=(ulong) time((time_t*) 0);
mi_clear_all_keys_active(state.key_map); mi_clear_all_keys_active(state.key_map);
state.checksum=crc; state.state.checksum=crc;
if (isam_file->s->base.keys) if (isam_file->s->base.keys)
isamchk_neaded=1; isamchk_neaded=1;
state.changed=STATE_CHANGED | STATE_NOT_ANALYZED; /* Force check of table */ 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, ...@@ -142,7 +142,7 @@ static int sp_add_point_to_mbr(uchar *(*wkb), uchar *end, uint n_dims,
{ {
if ((*wkb) > end - 8) if ((*wkb) > end - 8)
return -1; return -1;
get_double(&ord, *wkb); get_double(&ord, (const byte*) *wkb);
(*wkb)+= 8; (*wkb)+= 8;
if (ord < *mbr) if (ord < *mbr)
float8store((char*) mbr, ord); float8store((char*) mbr, ord);
......
...@@ -680,7 +680,8 @@ sub mtr_mysqladmin_shutdown { ...@@ -680,7 +680,8 @@ sub mtr_mysqladmin_shutdown {
mtr_add_arg($args, "shutdown"); mtr_add_arg($args, "shutdown");
# We don't wait for termination of mysqladmin # We don't wait for termination of mysqladmin
my $pid= mtr_spawn($::exe_mysqladmin, $args, 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; $mysql_admin_pids{$pid}= 1;
} }
......
...@@ -257,11 +257,11 @@ sub mtr_print_header () { ...@@ -257,11 +257,11 @@ sub mtr_print_header () {
print "\n"; print "\n";
if ( $::opt_timer ) if ( $::opt_timer )
{ {
print "TEST RESULT TIME (ms)\n"; print "TEST RESULT TIME (ms)\n";
} }
else else
{ {
print "TEST RESULT\n"; print "TEST RESULT\n";
} }
mtr_print_line(); mtr_print_line();
print "\n"; print "\n";
......
This diff is collapsed.
...@@ -1429,10 +1429,10 @@ id select_type table type possible_keys key key_len ref rows Extra ...@@ -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 1 SIMPLE t1 range v v 13 NULL # Using where
explain select count(*) from t1 where v between 'a' and 'a '; explain select count(*) from t1 where v between 'a' and 'a ';
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 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'; 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 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); alter table t1 add unique(v);
ERROR 23000: Duplicate entry '{ ' for key 1 ERROR 23000: Duplicate entry '{ ' for key 1
alter table t1 add key(v); alter table t1 add key(v);
...@@ -1622,10 +1622,10 @@ id select_type table type possible_keys key key_len ref rows Extra ...@@ -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 1 SIMPLE t1 range v v 258 NULL # Using where
explain select count(*) from t1 where v between 'a' and 'a '; explain select count(*) from t1 where v between 'a' and 'a ';
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 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'; 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 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'; explain select * from t1 where v='a';
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref v v 258 const # Using where 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 ...@@ -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 1 SIMPLE t1 range v v 33 NULL # Using where
explain select count(*) from t1 where v between 'a' and 'a '; explain select count(*) from t1 where v between 'a' and 'a ';
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 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'; 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 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'; explain select * from t1 where v='a';
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref v v 33 const # Using where 1 SIMPLE t1 ref v v 33 const # Using where
......
...@@ -103,8 +103,8 @@ t1 CREATE TABLE `t1` ( ...@@ -103,8 +103,8 @@ t1 CREATE TABLE `t1` (
`c2` varchar(1) character set latin1 collate latin1_danish_ci NOT NULL default '', `c2` varchar(1) character set latin1 collate latin1_danish_ci NOT NULL default '',
`c3` varbinary(1) NOT NULL default '', `c3` varbinary(1) NOT NULL default '',
`c4` varbinary(1) NOT NULL default '', `c4` varbinary(1) NOT NULL default '',
`c5` varbinary(4) NOT NULL default '', `c5` varbinary(3) NOT NULL default '',
`c6` varbinary(4) NOT NULL default '', `c6` varbinary(3) NOT NULL default '',
`c7` decimal(2,1) NOT NULL default '0.0', `c7` decimal(2,1) NOT NULL default '0.0',
`c8` decimal(2,1) NOT NULL default '0.0', `c8` decimal(2,1) NOT NULL default '0.0',
`c9` decimal(2,1) default NULL, `c9` decimal(2,1) default NULL,
...@@ -152,11 +152,11 @@ SHOW CREATE TABLE t1; ...@@ -152,11 +152,11 @@ SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`COALESCE(1)` int(1) NOT NULL default '0', `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('a')` varchar(1) NOT NULL default '',
`COALESCE(1,1.0)` decimal(2,1) NOT NULL default '0.0', `COALESCE(1,1.0)` decimal(2,1) NOT NULL default '0.0',
`COALESCE(1,'1')` varbinary(1) NOT NULL default '', `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 '' `COALESCE('a' COLLATE latin1_bin,'b')` varchar(1) character set latin1 collate latin1_bin NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1; DROP TABLE t1;
......
...@@ -74,6 +74,18 @@ CAST(DATE "2004-01-22 21:45:33" AS BINARY(4)) ...@@ -74,6 +74,18 @@ CAST(DATE "2004-01-22 21:45:33" AS BINARY(4))
2004 2004
Warnings: Warnings:
Warning 1292 Truncated incorrect CHAR(4) value: '2004-01-22 21:45:33' 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); select cast('-10a' as signed integer);
cast('-10a' as signed integer) cast('-10a' as signed integer)
-10 -10
......
...@@ -18,6 +18,6 @@ SET @@session.sql_mode=0; ...@@ -18,6 +18,6 @@ SET @@session.sql_mode=0;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
insert into t2 values (@v); insert into t2 values (@v);
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
drop table t2; drop table t2;
...@@ -368,3 +368,15 @@ create table t2 (a int); ...@@ -368,3 +368,15 @@ create table t2 (a int);
select * from (select * from t1,t2) foo; select * from (select * from t1,t2) foo;
ERROR 42S21: Duplicate column name 'a' ERROR 42S21: Duplicate column name 'a'
drop table t1,t2; 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 ...@@ -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 1 SIMPLE t1 ALL v NULL NULL NULL 271 Using where
explain select count(*) from t1 where v between 'a' and 'a '; explain select count(*) from t1 where v between 'a' and 'a ';
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 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'; 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 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); alter table t1 add unique(v);
ERROR 23000: Duplicate entry '{ ' for key 1 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,'*')); 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 ...@@ -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 1 SIMPLE t1 range v v 13 NULL # Using where
explain select count(*) from t1 where v between 'a' and 'a '; explain select count(*) from t1 where v between 'a' and 'a ';
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 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'; 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 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); alter table t1 add unique(v);
ERROR 23000: Duplicate entry '{ ' for key 1 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,'*')); 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 ...@@ -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 1 SIMPLE t1 range v v 13 NULL # Using where; Using index
explain select count(*) from t1 where v between 'a' and 'a '; explain select count(*) from t1 where v between 'a' and 'a ';
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 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'; 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 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); alter table t1 add unique(v);
ERROR 23000: Duplicate entry '{ ' for key 1 ERROR 23000: Duplicate entry '{ ' for key 1
alter table t1 add key(v); alter table t1 add key(v);
...@@ -2188,10 +2188,10 @@ id select_type table type possible_keys key key_len ref rows Extra ...@@ -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 1 SIMPLE t1 range v v 303 NULL # Using where; Using index
explain select count(*) from t1 where v between 'a' and 'a '; explain select count(*) from t1 where v between 'a' and 'a ';
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 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'; 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 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'; explain select * from t1 where v='a';
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref v v 303 const # Using where 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 ...@@ -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 1 SIMPLE t1 range v v 33 NULL # Using where
explain select count(*) from t1 where v between 'a' and 'a '; explain select count(*) from t1 where v between 'a' and 'a ';
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 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'; 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 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'; explain select * from t1 where v='a';
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref v v 33 const # Using where 1 SIMPLE t1 ref v v 33 const # Using where
...@@ -2616,3 +2616,31 @@ SET FOREIGN_KEY_CHECKS=1; ...@@ -2616,3 +2616,31 @@ SET FOREIGN_KEY_CHECKS=1;
INSERT INTO t2 VALUES(3); 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`)) 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; 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 ...@@ -1375,3 +1375,31 @@ groupid price
6 9900 6 9900
DROP VIEW v1,v2; DROP VIEW v1,v2;
DROP TABLE t1,t2,t3,t4; 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); ...@@ -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 ERROR HY000: You can't specify target table 't2' for update in FROM clause
drop table t1, t2; drop table t1, t2;
create table t1 ( create table t1 (
a double(16,6), a double(14,4),
b varchar(10), b varchar(10),
index (a,b) index (a,b)
) engine=merge union=(t2,t3); ) engine=merge union=(t2,t3);
create table t2 ( create table t2 (
a double(16,6), a double(14,4),
b varchar(10), b varchar(10),
index (a,b) index (a,b)
) engine=myisam; ) engine=myisam;
create table t3 ( create table t3 (
a double(16,6), a double(14,4),
b varchar(10), b varchar(10),
index (a,b) index (a,b)
) engine=myisam; ) engine=myisam;
insert into t2 values ( null, ''); insert into t2 values ( null, '');
insert into t2 values ( 9999999999.999999, ''); insert into t2 values ( 9999999999.999, '');
insert into t3 select * from t2; insert into t3 select * from t2;
select min(a), max(a) from t1; select min(a), max(a) from t1;
min(a) max(a) min(a) max(a)
9999999999.999998 9999999999.999998 9999999999.9990 9999999999.9990
flush tables; flush tables;
select min(a), max(a) from t1; select min(a), max(a) from t1;
min(a) max(a) min(a) max(a)
9999999999.999998 9999999999.999998 9999999999.9990 9999999999.9990
drop table t1, t2, t3; drop table t1, t2, t3;
create table t1 (a int,b int,c int, index (a,b,c)); 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)); create table t2 (a int,b int,c int, index (a,b,c));
......
...@@ -2,7 +2,7 @@ drop table if exists t1,t2; ...@@ -2,7 +2,7 @@ drop table if exists t1,t2;
select 1, 1.0, -1, "hello", NULL; select 1, 1.0, -1, "hello", NULL;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr 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 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 -1 8 2 2 N 32897 0 63
def hello 253 5 5 N 1 31 8 def hello 253 5 5 N 1 31 8
def NULL 6 0 0 Y 32896 0 63 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 ...@@ -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 1 SIMPLE t1 range v v 13 NULL # Using where; Using index
explain select count(*) from t1 where v between 'a' and 'a '; explain select count(*) from t1 where v between 'a' and 'a ';
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 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'; 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 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); alter table t1 add unique(v);
ERROR 23000: Duplicate entry '{ ' for key 1 ERROR 23000: Duplicate entry '{ ' for key 1
alter table t1 add key(v); alter table t1 add key(v);
...@@ -993,10 +993,10 @@ id select_type table type possible_keys key key_len ref rows Extra ...@@ -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 1 SIMPLE t1 range v v 303 NULL # Using where; Using index
explain select count(*) from t1 where v between 'a' and 'a '; explain select count(*) from t1 where v between 'a' and 'a ';
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 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'; 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 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'; explain select * from t1 where v='a';
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref v v 303 const # Using where 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 ...@@ -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 1 SIMPLE t1 range v v 33 NULL # Using where
explain select count(*) from t1 where v between 'a' and 'a '; explain select count(*) from t1 where v between 'a' and 'a ';
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 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'; 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 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'; explain select * from t1 where v='a';
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref v v 33 const # Using where 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; ...@@ -40,7 +40,7 @@ load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-3-0' INTO table t1;
SET TIMESTAMP=1000000000; SET TIMESTAMP=1000000000;
load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-4-0' INTO table t1; load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-4-0' INTO table t1;
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- Broken LOAD DATA -- --- Broken LOAD DATA --
...@@ -53,7 +53,7 @@ SET @@session.sql_mode=0; ...@@ -53,7 +53,7 @@ SET @@session.sql_mode=0;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
insert into t1 values ("Alas"); insert into t1 values ("Alas");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- --database -- --- --database --
...@@ -62,7 +62,7 @@ ROLLBACK; ...@@ -62,7 +62,7 @@ ROLLBACK;
ROLLBACK; ROLLBACK;
SET INSERT_ID=1; SET INSERT_ID=1;
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- --position -- --- --position --
...@@ -75,7 +75,7 @@ SET @@session.sql_mode=0; ...@@ -75,7 +75,7 @@ SET @@session.sql_mode=0;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
insert into t1 values ("Alas"); insert into t1 values ("Alas");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- Remote -- --- Remote --
...@@ -106,7 +106,7 @@ load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-3-2' INTO table t1; ...@@ -106,7 +106,7 @@ load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-3-2' INTO table t1;
SET TIMESTAMP=1000000000; SET TIMESTAMP=1000000000;
load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-4-2' INTO table t1; load data LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/SQL_LOAD_MB-4-2' INTO table t1;
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- Broken LOAD DATA -- --- Broken LOAD DATA --
...@@ -119,7 +119,7 @@ SET @@session.sql_mode=0; ...@@ -119,7 +119,7 @@ SET @@session.sql_mode=0;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
insert into t1 values ("Alas"); insert into t1 values ("Alas");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- --database -- --- --database --
...@@ -128,7 +128,7 @@ ROLLBACK; ...@@ -128,7 +128,7 @@ ROLLBACK;
ROLLBACK; ROLLBACK;
SET INSERT_ID=1; SET INSERT_ID=1;
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- --position -- --- --position --
...@@ -141,7 +141,7 @@ SET @@session.sql_mode=0; ...@@ -141,7 +141,7 @@ SET @@session.sql_mode=0;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
insert into t1 values ("Alas"); insert into t1 values ("Alas");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- reading stdin -- --- reading stdin --
...@@ -154,7 +154,7 @@ BEGIN; ...@@ -154,7 +154,7 @@ BEGIN;
SET TIMESTAMP=1108844555; SET TIMESTAMP=1108844555;
insert t1 values (1); insert t1 values (1);
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
...@@ -164,6 +164,6 @@ BEGIN; ...@@ -164,6 +164,6 @@ BEGIN;
SET TIMESTAMP=1108844555; SET TIMESTAMP=1108844555;
insert t1 values (1); insert t1 values (1);
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
drop table t1, t2; drop table t1, t2;
...@@ -40,7 +40,7 @@ SET INSERT_ID=5; ...@@ -40,7 +40,7 @@ SET INSERT_ID=5;
SET TIMESTAMP=1579609946; SET TIMESTAMP=1579609946;
insert into t1 values(null, "e"); insert into t1 values(null, "e");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- offset -- --- offset --
...@@ -67,7 +67,7 @@ SET INSERT_ID=5; ...@@ -67,7 +67,7 @@ SET INSERT_ID=5;
SET TIMESTAMP=1579609946; SET TIMESTAMP=1579609946;
insert into t1 values(null, "e"); insert into t1 values(null, "e");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- start-position -- --- start-position --
...@@ -84,7 +84,7 @@ SET INSERT_ID=5; ...@@ -84,7 +84,7 @@ SET INSERT_ID=5;
SET TIMESTAMP=1579609946; SET TIMESTAMP=1579609946;
insert into t1 values(null, "e"); insert into t1 values(null, "e");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- stop-position -- --- stop-position --
...@@ -107,7 +107,7 @@ SET INSERT_ID=3; ...@@ -107,7 +107,7 @@ SET INSERT_ID=3;
SET TIMESTAMP=1579609944; SET TIMESTAMP=1579609944;
insert into t1 values(null, "c"); insert into t1 values(null, "c");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- start-datetime -- --- start-datetime --
...@@ -128,7 +128,7 @@ SET INSERT_ID=5; ...@@ -128,7 +128,7 @@ SET INSERT_ID=5;
SET TIMESTAMP=1579609946; SET TIMESTAMP=1579609946;
insert into t1 values(null, "e"); insert into t1 values(null, "e");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- stop-datetime -- --- stop-datetime --
...@@ -148,7 +148,7 @@ SET INSERT_ID=2; ...@@ -148,7 +148,7 @@ SET INSERT_ID=2;
SET TIMESTAMP=1579609942; SET TIMESTAMP=1579609942;
insert into t1 values(null, "b"); insert into t1 values(null, "b");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- Local with 2 binlogs on command line -- --- Local with 2 binlogs on command line --
...@@ -184,7 +184,7 @@ SET @@session.sql_mode=0; ...@@ -184,7 +184,7 @@ SET @@session.sql_mode=0;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
insert into t1 values(null, "f"); insert into t1 values(null, "f");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- offset -- --- offset --
...@@ -218,7 +218,7 @@ SET @@session.sql_mode=0; ...@@ -218,7 +218,7 @@ SET @@session.sql_mode=0;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
insert into t1 values(null, "f"); insert into t1 values(null, "f");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- start-position -- --- start-position --
...@@ -242,7 +242,7 @@ SET @@session.sql_mode=0; ...@@ -242,7 +242,7 @@ SET @@session.sql_mode=0;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
insert into t1 values(null, "f"); insert into t1 values(null, "f");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- stop-position -- --- stop-position --
...@@ -272,7 +272,7 @@ SET TIMESTAMP=1579609946; ...@@ -272,7 +272,7 @@ SET TIMESTAMP=1579609946;
insert into t1 values(null, "e"); insert into t1 values(null, "e");
SET INSERT_ID=6; SET INSERT_ID=6;
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- start-datetime -- --- start-datetime --
...@@ -300,7 +300,7 @@ SET @@session.sql_mode=0; ...@@ -300,7 +300,7 @@ SET @@session.sql_mode=0;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
insert into t1 values(null, "f"); insert into t1 values(null, "f");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- stop-datetime -- --- stop-datetime --
...@@ -320,7 +320,7 @@ SET INSERT_ID=2; ...@@ -320,7 +320,7 @@ SET INSERT_ID=2;
SET TIMESTAMP=1579609942; SET TIMESTAMP=1579609942;
insert into t1 values(null, "b"); insert into t1 values(null, "b");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- Remote -- --- Remote --
...@@ -349,7 +349,7 @@ SET INSERT_ID=5; ...@@ -349,7 +349,7 @@ SET INSERT_ID=5;
SET TIMESTAMP=1579609946; SET TIMESTAMP=1579609946;
insert into t1 values(null, "e"); insert into t1 values(null, "e");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- offset -- --- offset --
...@@ -376,7 +376,7 @@ SET INSERT_ID=5; ...@@ -376,7 +376,7 @@ SET INSERT_ID=5;
SET TIMESTAMP=1579609946; SET TIMESTAMP=1579609946;
insert into t1 values(null, "e"); insert into t1 values(null, "e");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- start-position -- --- start-position --
...@@ -393,7 +393,7 @@ SET INSERT_ID=5; ...@@ -393,7 +393,7 @@ SET INSERT_ID=5;
SET TIMESTAMP=1579609946; SET TIMESTAMP=1579609946;
insert into t1 values(null, "e"); insert into t1 values(null, "e");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- stop-position -- --- stop-position --
...@@ -416,7 +416,7 @@ SET INSERT_ID=3; ...@@ -416,7 +416,7 @@ SET INSERT_ID=3;
SET TIMESTAMP=1579609944; SET TIMESTAMP=1579609944;
insert into t1 values(null, "c"); insert into t1 values(null, "c");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- start-datetime -- --- start-datetime --
...@@ -437,7 +437,7 @@ SET INSERT_ID=5; ...@@ -437,7 +437,7 @@ SET INSERT_ID=5;
SET TIMESTAMP=1579609946; SET TIMESTAMP=1579609946;
insert into t1 values(null, "e"); insert into t1 values(null, "e");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- stop-datetime -- --- stop-datetime --
...@@ -457,7 +457,7 @@ SET INSERT_ID=2; ...@@ -457,7 +457,7 @@ SET INSERT_ID=2;
SET TIMESTAMP=1579609942; SET TIMESTAMP=1579609942;
insert into t1 values(null, "b"); insert into t1 values(null, "b");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- Remote with 2 binlogs on command line -- --- Remote with 2 binlogs on command line --
...@@ -493,7 +493,7 @@ SET @@session.sql_mode=0; ...@@ -493,7 +493,7 @@ SET @@session.sql_mode=0;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
insert into t1 values(null, "f"); insert into t1 values(null, "f");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- offset -- --- offset --
...@@ -527,7 +527,7 @@ SET @@session.sql_mode=0; ...@@ -527,7 +527,7 @@ SET @@session.sql_mode=0;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
insert into t1 values(null, "f"); insert into t1 values(null, "f");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- start-position -- --- start-position --
...@@ -551,7 +551,7 @@ SET @@session.sql_mode=0; ...@@ -551,7 +551,7 @@ SET @@session.sql_mode=0;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
insert into t1 values(null, "f"); insert into t1 values(null, "f");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- stop-position -- --- stop-position --
...@@ -581,7 +581,7 @@ SET TIMESTAMP=1579609946; ...@@ -581,7 +581,7 @@ SET TIMESTAMP=1579609946;
insert into t1 values(null, "e"); insert into t1 values(null, "e");
SET INSERT_ID=6; SET INSERT_ID=6;
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- start-datetime -- --- start-datetime --
...@@ -609,7 +609,7 @@ SET @@session.sql_mode=0; ...@@ -609,7 +609,7 @@ SET @@session.sql_mode=0;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8; SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
insert into t1 values(null, "f"); insert into t1 values(null, "f");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- stop-datetime -- --- stop-datetime --
...@@ -629,7 +629,7 @@ SET INSERT_ID=2; ...@@ -629,7 +629,7 @@ SET INSERT_ID=2;
SET TIMESTAMP=1579609942; SET TIMESTAMP=1579609942;
insert into t1 values(null, "b"); insert into t1 values(null, "b");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- to-last-log -- --- to-last-log --
...@@ -661,7 +661,7 @@ SET INSERT_ID=6; ...@@ -661,7 +661,7 @@ SET INSERT_ID=6;
SET TIMESTAMP=1579609943; SET TIMESTAMP=1579609943;
insert into t1 values(null, "f"); insert into t1 values(null, "f");
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
--- end of test -- --- end of test --
......
...@@ -1735,22 +1735,65 @@ create view v1 as ...@@ -1735,22 +1735,65 @@ create view v1 as
select * from v3 where b in (1, 2, 3, 4, 5, 6, 7); select * from v3 where b in (1, 2, 3, 4, 5, 6, 7);
create view v2 as create view v2 as
select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1; 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; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
show full tables; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
Tables_in_test Table_type /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
t1 BASE TABLE /*!40101 SET NAMES utf8 */;
v1 VIEW /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
v2 VIEW /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
v3 VIEW /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
show create view v1; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
View Create View DROP TABLE IF EXISTS `t1`;
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)) CREATE TABLE `t1` (
select * from v1; `a` int(11) default NULL,
a b c `b` int(11) default NULL,
1 2 one `c` varchar(30) default NULL
2 4 two ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
3 6 three
/*!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 view v1, v2, v3;
drop table t1; drop table t1;
CREATE TABLE t1 (a int, b bigint default NULL); CREATE TABLE t1 (a int, b bigint default NULL);
......
...@@ -180,6 +180,7 @@ source database ...@@ -180,6 +180,7 @@ source database
echo message echo message echo message echo message
mysqltest: At line 1: Empty variable mysqltest: At line 1: Empty variable
mysqltest: At line 1: command "false" failed
mysqltest: At line 1: Missing argument in exec mysqltest: At line 1: Missing argument in exec
MySQL MySQL
"MySQL" "MySQL"
...@@ -301,6 +302,7 @@ mysqltest: At line 1: First argument to dec must be a variable (start with $) ...@@ -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: 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: 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 test
test2 test2
test3 test3
...@@ -344,6 +346,10 @@ mysqltest: At line 1: Wrong column number to replace_column in 'replace_column 1 ...@@ -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: Invalid integer argument "10!"
mysqltest: At line 1: End of line junk detected: "!" mysqltest: At line 1: End of line junk detected: "!"
mysqltest: At line 1: Invalid integer argument "a" 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; 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 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; failing_statement;
......
...@@ -3,3 +3,5 @@ ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3,localhost mysqld,4, mysqld,5, mysql ...@@ -3,3 +3,5 @@ ndbd,1,localhost ndbd,2,localhost ndb_mgmd,3,localhost mysqld,4, mysqld,5, mysql
1 localhost 41943040 12582912 1 localhost 41943040 12582912
2 localhost 41943040 12582912 2 localhost 41943040 12582912
1 2 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 ...@@ -1775,7 +1775,7 @@ Table Create Table
t5 CREATE TABLE `t5` ( t5 CREATE TABLE `t5` (
`const01` bigint(1) NOT NULL default '0', `const01` bigint(1) NOT NULL default '0',
`param01` bigint(20) default NULL, `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, `param02` decimal(65,30) default NULL,
`const03` double NOT NULL default '0', `const03` double NOT NULL default '0',
`param03` double default NULL, `param03` double default NULL,
...@@ -1805,7 +1805,7 @@ select * from t5 ; ...@@ -1805,7 +1805,7 @@ select * from t5 ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr 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 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 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 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 const03 const03 5 17 1 N 32769 31 63
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
......
...@@ -1758,7 +1758,7 @@ Table Create Table ...@@ -1758,7 +1758,7 @@ Table Create Table
t5 CREATE TABLE `t5` ( t5 CREATE TABLE `t5` (
`const01` bigint(1) NOT NULL default '0', `const01` bigint(1) NOT NULL default '0',
`param01` bigint(20) default NULL, `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, `param02` decimal(65,30) default NULL,
`const03` double NOT NULL default '0', `const03` double NOT NULL default '0',
`param03` double default NULL, `param03` double default NULL,
...@@ -1788,7 +1788,7 @@ select * from t5 ; ...@@ -1788,7 +1788,7 @@ select * from t5 ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr 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 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 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 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 const03 const03 5 17 1 N 32769 31 63
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
......
...@@ -1759,7 +1759,7 @@ Table Create Table ...@@ -1759,7 +1759,7 @@ Table Create Table
t5 CREATE TABLE `t5` ( t5 CREATE TABLE `t5` (
`const01` bigint(1) NOT NULL default '0', `const01` bigint(1) NOT NULL default '0',
`param01` bigint(20) default NULL, `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, `param02` decimal(65,30) default NULL,
`const03` double NOT NULL default '0', `const03` double NOT NULL default '0',
`param03` double default NULL, `param03` double default NULL,
...@@ -1789,7 +1789,7 @@ select * from t5 ; ...@@ -1789,7 +1789,7 @@ select * from t5 ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr 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 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 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 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 const03 const03 5 17 1 N 32769 31 63
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
......
...@@ -1695,7 +1695,7 @@ Table Create Table ...@@ -1695,7 +1695,7 @@ Table Create Table
t5 CREATE TABLE `t5` ( t5 CREATE TABLE `t5` (
`const01` bigint(1) NOT NULL default '0', `const01` bigint(1) NOT NULL default '0',
`param01` bigint(20) default NULL, `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, `param02` decimal(65,30) default NULL,
`const03` double NOT NULL default '0', `const03` double NOT NULL default '0',
`param03` double default NULL, `param03` double default NULL,
...@@ -1725,7 +1725,7 @@ select * from t5 ; ...@@ -1725,7 +1725,7 @@ select * from t5 ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr 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 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 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 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 const03 const03 5 17 1 N 32769 31 63
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
...@@ -4707,7 +4707,7 @@ Table Create Table ...@@ -4707,7 +4707,7 @@ Table Create Table
t5 CREATE TABLE `t5` ( t5 CREATE TABLE `t5` (
`const01` bigint(1) NOT NULL default '0', `const01` bigint(1) NOT NULL default '0',
`param01` bigint(20) default NULL, `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, `param02` decimal(65,30) default NULL,
`const03` double NOT NULL default '0', `const03` double NOT NULL default '0',
`param03` double default NULL, `param03` double default NULL,
...@@ -4737,7 +4737,7 @@ select * from t5 ; ...@@ -4737,7 +4737,7 @@ select * from t5 ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr 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 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 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 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 const03 const03 5 17 1 N 32769 31 63
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
......
...@@ -1758,7 +1758,7 @@ Table Create Table ...@@ -1758,7 +1758,7 @@ Table Create Table
t5 CREATE TABLE `t5` ( t5 CREATE TABLE `t5` (
`const01` bigint(1) NOT NULL default '0', `const01` bigint(1) NOT NULL default '0',
`param01` bigint(20) default NULL, `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, `param02` decimal(65,30) default NULL,
`const03` double NOT NULL default '0', `const03` double NOT NULL default '0',
`param03` double default NULL, `param03` double default NULL,
...@@ -1788,7 +1788,7 @@ select * from t5 ; ...@@ -1788,7 +1788,7 @@ select * from t5 ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr 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 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 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 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 const03 const03 5 17 1 N 32769 31 63
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
......
...@@ -1758,7 +1758,7 @@ Table Create Table ...@@ -1758,7 +1758,7 @@ Table Create Table
t5 CREATE TABLE `t5` ( t5 CREATE TABLE `t5` (
`const01` bigint(1) NOT NULL default '0', `const01` bigint(1) NOT NULL default '0',
`param01` bigint(20) default NULL, `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, `param02` decimal(65,30) default NULL,
`const03` double NOT NULL default '0', `const03` double NOT NULL default '0',
`param03` double default NULL, `param03` double default NULL,
...@@ -1788,7 +1788,7 @@ select * from t5 ; ...@@ -1788,7 +1788,7 @@ select * from t5 ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr 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 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 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 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 const03 const03 5 17 1 N 32769 31 63
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63 def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
......
drop table if exists t1, t2; drop table if exists t1, t2, t3;
CREATE TABLE t1 ( CREATE TABLE t1 (
event_date date DEFAULT '0000-00-00' NOT NULL, event_date date DEFAULT '0000-00-00' NOT NULL,
type int(11) DEFAULT '0' 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 ...@@ -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 1 PRIMARY t1 range PRIMARY PRIMARY 8 NULL # Using where; Using index
drop view v1; drop view v1;
drop table t1; 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; ...@@ -247,7 +247,7 @@ SET TIMESTAMP=1000000000;
SET @@session.character_set_client=7,@@session.collation_connection=51,@@session.collation_server=30; SET @@session.character_set_client=7,@@session.collation_connection=51,@@session.collation_server=30;
INSERT INTO t1 (c1, c2) VALUES (', ',', '); INSERT INTO t1 (c1, c2) VALUES (', ',', ');
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
drop table t1; drop table t1;
create table `t1` ( create table `t1` (
......
...@@ -64,7 +64,7 @@ SET TIMESTAMP=100000000; ...@@ -64,7 +64,7 @@ SET TIMESTAMP=100000000;
SET @@session.time_zone='Europe/Moscow'; SET @@session.time_zone='Europe/Moscow';
insert into t1 values ('20040101000000'), ('20040611093902'); insert into t1 values ('20040101000000'), ('20040611093902');
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
delete from t1; delete from t1;
set time_zone='UTC'; set time_zone='UTC';
......
...@@ -2620,6 +2620,15 @@ select found_rows(); ...@@ -2620,6 +2620,15 @@ select found_rows();
found_rows() found_rows()
1 1
DROP TABLE t1; 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) ); CREATE TABLE t1 ( city char(30) );
INSERT INTO t1 VALUES ('London'); INSERT INTO t1 VALUES ('London');
INSERT INTO t1 VALUES ('Paris'); INSERT INTO t1 VALUES ('Paris');
...@@ -3029,3 +3038,26 @@ id ...@@ -3029,3 +3038,26 @@ id
102 102
drop table t1, t2; drop table t1, t2;
drop view v1, v2, v3; 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 ...@@ -3390,4 +3390,49 @@ s1
set sql_mode=@sm| set sql_mode=@sm|
drop table t3| drop table t3|
drop procedure bug6127| 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; drop table t1,t2;
...@@ -65,7 +65,7 @@ sql_mode NO_FIELD_OPTIONS,MYSQL323,MYSQL40,HIGH_NOT_PRECEDENCE ...@@ -65,7 +65,7 @@ sql_mode NO_FIELD_OPTIONS,MYSQL323,MYSQL40,HIGH_NOT_PRECEDENCE
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL auto_increment, `a` int(11) NOT NULL,
`pseudo` varchar(35) NOT NULL default '', `pseudo` varchar(35) NOT NULL default '',
`email` varchar(60) NOT NULL default '', `email` varchar(60) NOT NULL default '',
PRIMARY KEY (`a`), PRIMARY KEY (`a`),
...@@ -79,8 +79,8 @@ show create table t1; ...@@ -79,8 +79,8 @@ show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE "t1" ( t1 CREATE TABLE "t1" (
"a" int(11) NOT NULL, "a" int(11) NOT NULL,
"pseudo" varchar(35) NOT NULL default '', "pseudo" varchar(35) character set latin2 NOT NULL default '',
"email" varchar(60) NOT NULL default '', "email" varchar(60) character set latin2 NOT NULL default '',
PRIMARY KEY ("a"), PRIMARY KEY ("a"),
UNIQUE KEY "email" ("email") UNIQUE KEY "email" ("email")
) )
...@@ -140,6 +140,26 @@ t1 CREATE TABLE `t1` ( ...@@ -140,6 +140,26 @@ t1 CREATE TABLE `t1` (
drop table t1 ; drop table t1 ;
set @@SQL_MODE=NULL; set @@SQL_MODE=NULL;
ERROR 42000: Variable 'sql_mode' can't be set to the value of '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=''; SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE='';
show local variables like 'SQL_MODE'; show local variables like 'SQL_MODE';
Variable_name Value Variable_name Value
......
...@@ -73,7 +73,7 @@ Table Create Table ...@@ -73,7 +73,7 @@ Table Create Table
user CREATE TABLE `user` ( user CREATE TABLE `user` (
`Host` char(60) collate utf8_bin NOT NULL default '', `Host` char(60) collate utf8_bin NOT NULL default '',
`User` char(16) 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', `Select_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
`Insert_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', `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 ...@@ -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)); 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 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)); 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)); 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'); 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; select * from t1;
......
...@@ -226,6 +226,6 @@ reckey recdesc ...@@ -226,6 +226,6 @@ reckey recdesc
109 Has 109 as key 109 Has 109 as key
drop table t1; drop table t1;
create table t1 (s1 float(0,2)); 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)); 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 ...@@ -68,10 +68,10 @@ NULL 1.1 NULL NULL NULL 1
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`nullif(1.1, 1.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) default NULL, `nullif(1.1, 1.2)` decimal(2,1) unsigned default NULL,
`nullif(1.1, 0.11e1)` decimal(2,1) default NULL, `nullif(1.1, 0.11e1)` decimal(2,1) unsigned default NULL,
`nullif(1.0, 1)` decimal(2,1) default NULL, `nullif(1.0, 1)` decimal(2,1) unsigned default NULL,
`nullif(1, 1.0)` int(1) default NULL, `nullif(1, 1.0)` int(1) default NULL,
`nullif(1, 1.1)` int(1) default NULL `nullif(1, 1.1)` int(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
...@@ -174,9 +174,9 @@ create table t1 select round(15.4,-1), truncate(-5678.123451,-3), abs(-1.1), -(- ...@@ -174,9 +174,9 @@ create table t1 select round(15.4,-1), truncate(-5678.123451,-3), abs(-1.1), -(-
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( 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', `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' `-(-1.1)` decimal(2,1) NOT NULL default '0.0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1; drop table t1;
...@@ -781,7 +781,7 @@ create table t1 as select 0.5; ...@@ -781,7 +781,7 @@ create table t1 as select 0.5;
show create table t1; show create table t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( 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 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1; drop table t1;
select round(1.5),round(2.5); select round(1.5),round(2.5);
...@@ -936,7 +936,7 @@ ERROR 42000: Too big scale 31 specified for column 'sl'. Maximum is 30. ...@@ -936,7 +936,7 @@ ERROR 42000: Too big scale 31 specified for column 'sl'. Maximum is 30.
create table t1 (sl decimal(0,38)); create table t1 (sl decimal(0,38));
ERROR 42000: Too big scale 38 specified for column 'sl'. Maximum is 30. ERROR 42000: Too big scale 38 specified for column 'sl'. Maximum is 30.
create table t1 (sl decimal(0,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)); create table t1 (sl decimal(5, 5));
show create table t1; show create table t1;
Table Create Table Table Create Table
......
...@@ -28,6 +28,6 @@ SET @`var2`:=_latin1 0x61 COLLATE `latin1_swedish_ci`; ...@@ -28,6 +28,6 @@ SET @`var2`:=_latin1 0x61 COLLATE `latin1_swedish_ci`;
SET TIMESTAMP=10000; SET TIMESTAMP=10000;
insert into t1 values (@var1),(@var2); insert into t1 values (@var1),(@var2);
# End of log file # End of log file
ROLLBACK; ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
drop table t1; drop table t1;
[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); ...@@ -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",CHAR(4));
select CONVERT(DATE "2004-01-22 21:45:33",BINARY(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(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('-10a' as signed integer);
select cast('a10' as unsigned integer); select cast('a10' as unsigned integer);
select 10+'a'; select 10+'a';
......
...@@ -258,4 +258,17 @@ create table t2 (a int); ...@@ -258,4 +258,17 @@ create table t2 (a int);
select * from (select * from t1,t2) foo; select * from (select * from t1,t2) foo;
drop table t1,t2; 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 # End of 4.1 tests
...@@ -1268,6 +1268,7 @@ insert into t1 values ('8', '6'), ('4', '7'); ...@@ -1268,6 +1268,7 @@ insert into t1 values ('8', '6'), ('4', '7');
select min(a) from t1; select min(a) from t1;
select min(b) from t1 where a='8'; select min(b) from t1 where a='8';
drop table t1; drop table t1;
# End of 4.1 tests # End of 4.1 tests
# #
...@@ -1564,3 +1565,42 @@ SET FOREIGN_KEY_CHECKS=1; ...@@ -1564,3 +1565,42 @@ SET FOREIGN_KEY_CHECKS=1;
INSERT INTO t2 VALUES(3); INSERT INTO t2 VALUES(3);
DROP TABLE t2; 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 ...@@ -801,3 +801,34 @@ SELECT * FROM
DROP VIEW v1,v2; DROP VIEW v1,v2;
DROP TABLE t1,t2,t3,t4; 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; ...@@ -296,29 +296,25 @@ drop table t1, t2;
# non-debug build. But there is no guarantee that this will be always so. # non-debug build. But there is no guarantee that this will be always so.
# #
create table t1 ( create table t1 (
a double(16,6), a double(14,4),
b varchar(10), b varchar(10),
index (a,b) index (a,b)
) engine=merge union=(t2,t3); ) engine=merge union=(t2,t3);
create table t2 ( create table t2 (
a double(16,6), a double(14,4),
b varchar(10), b varchar(10),
index (a,b) index (a,b)
) engine=myisam; ) engine=myisam;
create table t3 ( create table t3 (
a double(16,6), a double(14,4),
b varchar(10), b varchar(10),
index (a,b) index (a,b)
) engine=myisam; ) engine=myisam;
insert into t2 values ( null, ''); insert into t2 values ( null, '');
# We may have insufficient accuracy for 16 digits of '9'. insert into t2 values ( 9999999999.999, '');
# Suppress a "truncate" warning due to accuracy problems.
--disable_warnings
insert into t2 values ( 9999999999.999999, '');
--enable_warnings
insert into t3 select * from t2; insert into t3 select * from t2;
select min(a), max(a) from t1; select min(a), max(a) from t1;
flush tables; flush tables;
......
...@@ -142,7 +142,7 @@ drop table t1; ...@@ -142,7 +142,7 @@ drop table t1;
--exec $MYSQL_DUMP --skip-comments --databases test --exec $MYSQL_DUMP --skip-comments --databases test
create database mysqldump_test_db character set latin2 collate latin2_bin; 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; drop database mysqldump_test_db;
# #
...@@ -758,17 +758,7 @@ select * from v3 where b in (1, 2, 3, 4, 5, 6, 7); ...@@ -758,17 +758,7 @@ select * from v3 where b in (1, 2, 3, 4, 5, 6, 7);
create view v2 as create view v2 as
select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1; 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 --exec $MYSQL_DUMP --skip-comments test
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;
drop view v1, v2, v3; drop view v1, v2, v3;
drop table t1; drop table t1;
......
...@@ -428,9 +428,8 @@ echo ; ...@@ -428,9 +428,8 @@ echo ;
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Illegal use of exec # Illegal use of exec
# Disabled, some shells prints the failed command regardless of pipes --error 1
#--error 1 --exec echo "--exec false" | $MYSQL_TEST 2>&1
#--exec echo "--exec ';' 2> /dev/null" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "--exec " | $MYSQL_TEST 2>&1 --exec echo "--exec " | $MYSQL_TEST 2>&1
...@@ -677,9 +676,8 @@ system echo "hej" > /dev/null; ...@@ -677,9 +676,8 @@ system echo "hej" > /dev/null;
--exec echo "system;" | $MYSQL_TEST 2>&1 --exec echo "system;" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "system $NONEXISTSINFVAREABLI;" | $MYSQL_TEST 2>&1 --exec echo "system $NONEXISTSINFVAREABLI;" | $MYSQL_TEST 2>&1
# Disabled, some shells prints the failed command regardless of pipes --error 1
#--error 1 --exec echo "system false;" | $MYSQL_TEST 2>&1
#--exec echo "system NonExistsinfComamdn 2> /dev/null;" | $MYSQL_TEST 2>&1
--disable_abort_on_error --disable_abort_on_error
system NonExistsinfComamdn; system NonExistsinfComamdn;
...@@ -814,11 +812,11 @@ select "a" as col1, "c" as col2; ...@@ -814,11 +812,11 @@ select "a" as col1, "c" as col2;
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# -x <file_name>, use the file specified after -x as the test file # -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 < $MYSQL_TEST_DIR/include/mysqltest-x.inc
#--exec $MYSQL_TEST -x $MYSQL_TEST_DIR/include/mysqltest-x.inc 2>&1 --exec $MYSQL_TEST -x $MYSQL_TEST_DIR/include/mysqltest-x.inc
#--exec $MYSQL_TEST --result_file=$MYSQL_TEST_DIR/include/mysqltest-x.inc 2>&1 --exec $MYSQL_TEST --test_file=$MYSQL_TEST_DIR/include/mysqltest-x.inc
#--error 1 --error 1
#--exec $MYSQL_TEST -x non_existing_file.inc 2>&1 --exec $MYSQL_TEST -x non_existing_file.inc 2>&1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
......
...@@ -6,5 +6,8 @@ ...@@ -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 --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 -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=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 # 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 @@ ...@@ -3,7 +3,7 @@
# #
--disable_warnings --disable_warnings
drop table if exists t1, t2; drop table if exists t1, t2, t3;
--enable_warnings --enable_warnings
CREATE TABLE t1 ( CREATE TABLE t1 (
...@@ -600,3 +600,29 @@ explain select * from v1 where a between 3 and 4 and b between 1 and 2; ...@@ -600,3 +600,29 @@ explain select * from v1 where a between 3 and 4 and b between 1 and 2;
drop view v1; drop view v1;
drop table t1; 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(); ...@@ -2181,6 +2181,16 @@ select found_rows();
DROP TABLE t1; 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 # End of 4.1 tests
# #
...@@ -2565,3 +2575,37 @@ select * from v1 left join v3 using (id); ...@@ -2565,3 +2575,37 @@ select * from v1 left join v3 using (id);
drop table t1, t2; drop table t1, t2;
drop view v1, v2, v3; 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| ...@@ -4264,6 +4264,57 @@ drop table t3|
drop procedure bug6127| 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 # BUG#NNNN: New bug synopsis
# #
......
...@@ -86,6 +86,18 @@ drop table t1 ; ...@@ -86,6 +86,18 @@ drop table t1 ;
--error 1231 --error 1231
set @@SQL_MODE=NULL; 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 # End of 4.1 tests
# #
......
...@@ -152,7 +152,7 @@ drop table t1; ...@@ -152,7 +152,7 @@ drop table t1;
# bug #12694 (float(m,d) specifications) # bug #12694 (float(m,d) specifications)
# #
--error 1453 --error 1427
create table t1 (s1 float(0,2)); create table t1 (s1 float(0,2));
--error 1453 --error 1427
create table t1 (s1 float(1,2)); create table t1 (s1 float(1,2));
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#include <winbase.h> #include <winbase.h>
#endif #endif
const char *defaults_file=0;
const char *defaults_group_suffix=0; const char *defaults_group_suffix=0;
char *defaults_extra_file=0; char *defaults_extra_file=0;
...@@ -140,6 +141,9 @@ int my_search_option_files(const char *conf_file, int *argc, char ***argv, ...@@ -140,6 +141,9 @@ int my_search_option_files(const char *conf_file, int *argc, char ***argv,
if (forced_extra_defaults) if (forced_extra_defaults)
defaults_extra_file= (char *) 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 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' 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, ...@@ -165,7 +165,7 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize,
(ulong) info, (int) type, (ulong) seek_offset)); (ulong) info, (int) type, (ulong) seek_offset));
info->file= file; 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->pos_in_file= seek_offset;
info->pre_close = info->pre_read = info->post_read = 0; info->pre_close = info->pre_read = info->post_read = 0;
info->arg = 0; info->arg = 0;
...@@ -1246,7 +1246,7 @@ int end_io_cache(IO_CACHE *info) ...@@ -1246,7 +1246,7 @@ int end_io_cache(IO_CACHE *info)
if (info->type == SEQ_READ_APPEND) if (info->type == SEQ_READ_APPEND)
{ {
/* Destroy allocated mutex */ /* Destroy allocated mutex */
info->type=0; info->type= TYPE_NOT_SET;
#ifdef THREAD #ifdef THREAD
pthread_mutex_destroy(&info->append_buffer_lock); pthread_mutex_destroy(&info->append_buffer_lock);
#endif #endif
......
This diff is collapsed.
...@@ -127,11 +127,23 @@ my_bool my_init(void) ...@@ -127,11 +127,23 @@ my_bool my_init(void)
void my_end(int infoflag) void my_end(int infoflag)
{ {
FILE *info_file; /*
if (!(info_file=DBUG_FILE)) this code is suboptimal to workaround a bug in
info_file=stderr; Sun CC: Sun C++ 5.6 2004/06/02 for x86, and should not be
DBUG_PRINT("info",("Shutting down")); optimized until this compiler is not in use anymore
if (infoflag & MY_CHECK_ERROR || info_file != stderr) */
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 */ { /* Test if some file is left open */
if (my_file_opened | my_stream_opened) if (my_file_opened | my_stream_opened)
{ {
...@@ -141,7 +153,8 @@ void my_end(int infoflag) ...@@ -141,7 +153,8 @@ void my_end(int infoflag)
} }
} }
my_once_free(); my_once_free();
if (infoflag & MY_GIVE_INFO || info_file != stderr)
if ((infoflag & MY_GIVE_INFO) || print_info)
{ {
#ifdef HAVE_GETRUSAGE #ifdef HAVE_GETRUSAGE
struct rusage rus; struct rusage rus;
......
...@@ -553,7 +553,6 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES; ...@@ -553,7 +553,6 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
#define GSN_STATISTICS_CONF 454 #define GSN_STATISTICS_CONF 454
#define GSN_START_ORD 455 #define GSN_START_ORD 455
/* 456 unused */
/* 457 unused */ /* 457 unused */
#define GSN_EVENT_SUBSCRIBE_REQ 458 #define GSN_EVENT_SUBSCRIBE_REQ 458
...@@ -835,14 +834,6 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES; ...@@ -835,14 +834,6 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
/* Start Global Replication */ /* Start Global Replication */
#define GSN_GREP_REQ 656 #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_REQ 132
#define GSN_UTIL_CREATE_LOCK_REF 133 #define GSN_UTIL_CREATE_LOCK_REF 133
#define GSN_UTIL_CREATE_LOCK_CONF 188 #define GSN_UTIL_CREATE_LOCK_CONF 188
...@@ -900,6 +891,7 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES; ...@@ -900,6 +891,7 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES;
#define GSN_RESUME_REQ 682 #define GSN_RESUME_REQ 682
#define GSN_STOP_REQ 443 #define GSN_STOP_REQ 443
#define GSN_STOP_REF 444 #define GSN_STOP_REF 444
#define GSN_STOP_CONF 456
#define GSN_API_VERSION_REQ 697 #define GSN_API_VERSION_REQ 697
#define GSN_API_VERSION_CONF 698 #define GSN_API_VERSION_CONF 698
......
...@@ -49,12 +49,11 @@ class ApiVersionConf { ...@@ -49,12 +49,11 @@ class ApiVersionConf {
*/ */
friend class MgmtSrv; friend class MgmtSrv;
public: public:
STATIC_CONST( SignalLength = 3 ); STATIC_CONST( SignalLength = 4 );
Uint32 senderRef; Uint32 senderRef;
Uint32 nodeId; //api node id Uint32 nodeId; //api node id
Uint32 version; // Version of API node Uint32 version; // Version of API node
Uint32 inet_addr;
}; };
#endif #endif
...@@ -67,6 +67,13 @@ public: ...@@ -67,6 +67,13 @@ public:
static bool getStopAbort(const Uint32 & requestInfo); static bool getStopAbort(const Uint32 & requestInfo);
}; };
struct StopConf
{
STATIC_CONST( SignalLength = 2 );
Uint32 senderData;
Uint32 nodeState;
};
class StopRef class StopRef
{ {
/** /**
...@@ -86,7 +93,8 @@ public: ...@@ -86,7 +93,8 @@ public:
OK = 0, OK = 0,
NodeShutdownInProgress = 1, NodeShutdownInProgress = 1,
SystemShutdownInProgress = 2, SystemShutdownInProgress = 2,
NodeShutdownWouldCauseSystemCrash = 3 NodeShutdownWouldCauseSystemCrash = 3,
TransactionAbortFailed = 4
}; };
public: public:
......
...@@ -148,9 +148,9 @@ extern "C" { ...@@ -148,9 +148,9 @@ extern "C" {
/** NDB_MGM_EVENT_CATEGORY_INFO */ /** NDB_MGM_EVENT_CATEGORY_INFO */
NDB_LE_InfoEvent = 49, NDB_LE_InfoEvent = 49,
/* GREP */ /* SINGLE USER */
NDB_LE_GrepSubscriptionInfo = 52, NDB_LE_SingleUser = 52,
NDB_LE_GrepSubscriptionAlert = 53, /* NDB_LE_ UNUSED = 53, */
/** NDB_MGM_EVENT_CATEGORY_BACKUP */ /** NDB_MGM_EVENT_CATEGORY_BACKUP */
NDB_LE_BackupStarted = 54, NDB_LE_BackupStarted = 54,
...@@ -593,6 +593,11 @@ extern "C" { ...@@ -593,6 +593,11 @@ extern "C" {
unsigned backup_id; unsigned backup_id;
unsigned error; unsigned error;
} BackupAborted; } BackupAborted;
/** Log event data @ref NDB_LE_SingleUser */
struct {
unsigned type;
unsigned node_id;
} SingleUser;
#ifndef DOXYGEN_FIX #ifndef DOXYGEN_FIX
}; };
#else #else
......
...@@ -633,6 +633,27 @@ void getTextBackupAborted(QQQQ) { ...@@ -633,6 +633,27 @@ void getTextBackupAborted(QQQQ) {
theData[3]); 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 #if 0
BaseString::snprintf(m_text, BaseString::snprintf(m_text,
m_text_len, m_text_len,
...@@ -716,6 +737,9 @@ const EventLoggerBase::EventRepLogLevelMatrix EventLoggerBase::matrix[] = { ...@@ -716,6 +737,9 @@ const EventLoggerBase::EventRepLogLevelMatrix EventLoggerBase::matrix[] = {
ROW(CreateLogBytes, LogLevel::llInfo, 11, Logger::LL_INFO ), ROW(CreateLogBytes, LogLevel::llInfo, 11, Logger::LL_INFO ),
ROW(InfoEvent, LogLevel::llInfo, 2, Logger::LL_INFO ), ROW(InfoEvent, LogLevel::llInfo, 2, Logger::LL_INFO ),
//Single User
ROW(SingleUser, LogLevel::llInfo, 7, Logger::LL_INFO ),
// Backup // Backup
ROW(BackupStarted, LogLevel::llBackup, 7, Logger::LL_INFO ), ROW(BackupStarted, LogLevel::llBackup, 7, Logger::LL_INFO ),
ROW(BackupCompleted, 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){ ...@@ -51,11 +51,12 @@ SimpleProperties::Writer::add(const char * value, int len){
union { union {
Uint32 lastWord; Uint32 lastWord;
char lastBytes[4]; char lastBytes[4];
}; } tmp;
memcpy(lastBytes, tmp.lastWord =0 ;
memcpy(tmp.lastBytes,
value + putLen*4, value + putLen*4,
len - putLen*4); len - putLen*4);
return putWord(lastWord); return putWord(tmp.lastWord);
} }
bool bool
......
#SUBDIRS = printSchemafile
noinst_LIBRARIES = libdbdict.a noinst_LIBRARIES = libdbdict.a
EXTRA_PROGRAMS = printSchemaFile
libdbdict_a_SOURCES = Dbdict.cpp libdbdict_a_SOURCES = Dbdict.cpp
printSchemaFile_SOURCES = printSchemaFile.cpp
include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/common.mk.am
include $(top_srcdir)/ndb/config/type_kernel.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 # Don't update the files from bitkeeper
%::SCCS/s.% %::SCCS/s.%
......
#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 /* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
...@@ -36,14 +25,19 @@ exit $? ...@@ -36,14 +25,19 @@ exit $?
static const char* progname = 0; static const char* progname = 0;
static bool allflag = false; static bool allflag = false;
static bool checkonly = false; static bool checkonly = false;
static int xitcode = 0; static bool equalcontents = false;
static bool okquiet = false;
static void static void
usage() usage()
{ {
ndbout << "Usage " << progname ndbout
<< " [-ac]" << "Usage: " << progname << " [-aceq]" << " file ..." << endl
<< " P0.SchemaLog" << 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 static void
...@@ -57,53 +51,78 @@ fill(const char * buf, int mod) ...@@ -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) print_head(const char * filename, const SchemaFile * sf)
{ {
int retcode = 0;
if (! checkonly) { if (! checkonly) {
ndbout << "----- Schemafile: " << filename << " -----" << endl; 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), sizeof(sf->Magic),
sf->Magic, sf->Magic,
sf->ByteOrder, sf->ByteOrder,
sf->NdbVersion >> 16, version(sf->NdbVersion),
(sf->NdbVersion >> 8) & 0xFF,
sf->NdbVersion & 0xFF,
sf->FileSize); 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 static int
print_old(const char * filename, const SchemaFile * sf) 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++) { for (Uint32 i = 0; i < sf->NoOfTableEntries; i++) {
SchemaFile::TableEntry_old te = sf->TableEntries_old[i]; SchemaFile::TableEntry_old te = sf->TableEntries_old[i];
if (allflag || if (allflag ||
(te.m_tableState != SchemaFile::INIT && (te.m_tableState != SchemaFile::INIT &&
te.m_tableState != SchemaFile::DROP_TABLE_COMMITTED)) { te.m_tableState != SchemaFile::DROP_TABLE_COMMITTED)) {
ndbout << "Table " << i << ":" if (! checkonly)
<< " State = " << te.m_tableState ndbout << "Table " << i << ":"
<< " version = " << table_version_major(te.m_tableVersion) << << " State = " << te.m_tableState
<< "(" << table_version_minor(te.m_tableVersion) << ")" << " version = " << te.m_tableVersion
<< " type = " << te.m_tableType << " type = " << te.m_tableType
<< " noOfPages = " << te.m_noOfPages << " noOfPages = " << te.m_noOfPages
<< " gcp: " << te.m_gcp << endl; << " gcp: " << te.m_gcp << endl;
} }
} }
return retcode;
} }
static void static int
print(const char * filename, const SchemaFile * xsf, Uint32 sz) print(const char * filename, const SchemaFile * xsf, Uint32 sz)
{ {
int retcode = 0; int retcode = 0;
print_head(filename, xsf); if (print_head(filename, xsf) != 0)
retcode = 1;
assert(sizeof(SchemaFile) == NDB_SF_PAGE_SIZE); assert(sizeof(SchemaFile) == NDB_SF_PAGE_SIZE);
if (xsf->FileSize != sz || xsf->FileSize % NDB_SF_PAGE_SIZE != 0) { 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; retcode = 1;
} }
Uint32 noOfPages = xsf->FileSize / NDB_SF_PAGE_SIZE; Uint32 noOfPages = xsf->FileSize / NDB_SF_PAGE_SIZE;
...@@ -112,19 +131,23 @@ print(const char * filename, const SchemaFile * xsf, Uint32 sz) ...@@ -112,19 +131,23 @@ print(const char * filename, const SchemaFile * xsf, Uint32 sz)
ndbout << "----- Page: " << n << " (" << noOfPages << ") -----" << endl; ndbout << "----- Page: " << n << " (" << noOfPages << ") -----" << endl;
} }
const SchemaFile * sf = &xsf[n]; 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) { 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; retcode = 1;
} }
Uint32 cs = 0; Uint32 cs = 0;
for (Uint32 j = 0; j < NDB_SF_PAGE_SIZE_IN_WORDS; j++) for (Uint32 j = 0; j < NDB_SF_PAGE_SIZE_IN_WORDS; j++)
cs ^= ((const Uint32*)sf)[j]; cs ^= ((const Uint32*)sf)[j];
if (cs != 0) { if (cs != 0) {
ndbout << "***** page " << n << " invalid CheckSum" << endl; ndbout << filename << ": page " << n << " invalid CheckSum" << endl;
retcode = 1; retcode = 1;
} }
if (sf->NoOfTableEntries != NDB_SF_PAGE_ENTRIES) { 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; retcode = 1;
} }
for (Uint32 i = 0; i < NDB_SF_PAGE_ENTRIES; i++) { for (Uint32 i = 0; i < NDB_SF_PAGE_ENTRIES; i++) {
...@@ -142,31 +165,41 @@ print(const char * filename, const SchemaFile * xsf, Uint32 sz) ...@@ -142,31 +165,41 @@ print(const char * filename, const SchemaFile * xsf, Uint32 sz)
<< " gcp: " << te.m_gcp << endl; << " gcp: " << te.m_gcp << endl;
} }
if (te.m_unused[0] != 0 || te.m_unused[1] != 0 || te.m_unused[2] != 0) { 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; retcode = 1;
} }
} }
} }
if (retcode != 0) return retcode;
xitcode = 1;
else if (checkonly)
ndbout << "ok: " << filename << endl;
} }
NDB_COMMAND(printSchemafile, NDB_COMMAND(printSchemafile,
"printSchemafile", "printSchemafile", "Prints a schemafile", 16384) "printSchemafile", "printSchemafile", "Prints a schemafile", 16384)
{ {
progname = argv[0]; progname = argv[0];
int exitcode = 0;
while (argv[1][0] == '-') { while (argc > 1 && argv[1][0] == '-') {
if (strchr(argv[1], 'a') != 0) if (strchr(argv[1], 'a') != 0)
allflag = true; allflag = true;
if (strchr(argv[1], 'c') != 0) if (strchr(argv[1], 'c') != 0)
checkonly = true; 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++; argc--, argv++;
} }
const char * prevfilename = 0;
Uint32 * prevbuf = 0;
Uint32 prevbytes = 0;
while (argc > 1) { while (argc > 1) {
const char * filename = argv[1]; const char * filename = argv[1];
argc--, argv++; argc--, argv++;
...@@ -174,8 +207,9 @@ NDB_COMMAND(printSchemafile, ...@@ -174,8 +207,9 @@ NDB_COMMAND(printSchemafile,
struct stat sbuf; struct stat sbuf;
const int res = stat(filename, &sbuf); const int res = stat(filename, &sbuf);
if (res != 0) { if (res != 0) {
ndbout << "Could not find file: \"" << filename << "\"" << endl; ndbout << filename << ": not found errno=" << errno << endl;
return 1; exitcode = 1;
continue;
} }
const Uint32 bytes = sbuf.st_size; const Uint32 bytes = sbuf.st_size;
...@@ -183,25 +217,56 @@ NDB_COMMAND(printSchemafile, ...@@ -183,25 +217,56 @@ NDB_COMMAND(printSchemafile,
FILE * f = fopen(filename, "rb"); FILE * f = fopen(filename, "rb");
if (f == 0) { if (f == 0) {
ndbout << "Failed to open file" << endl; ndbout << filename << ": open failed errno=" << errno << endl;
delete [] buf; delete [] buf;
return 1; exitcode = 1;
continue;
} }
Uint32 sz = fread(buf, 1, bytes, f); Uint32 sz = fread(buf, 1, bytes, f);
fclose(f); fclose(f);
if (sz != bytes) { if (sz != bytes) {
ndbout << "Failure while reading file" << endl; ndbout << filename << ": read failed errno=" << errno << endl;
delete [] buf;
exitcode = 1;
continue;
}
if (sz < 32) {
ndbout << filename << ": too short (no header)" << endl;
delete [] buf; delete [] buf;
return 1; exitcode = 1;
continue;
} }
SchemaFile* sf = (SchemaFile *)&buf[0]; SchemaFile* sf = (SchemaFile *)&buf[0];
int ret;
if (sf->NdbVersion < NDB_SF_VERSION_5_0_6) if (sf->NdbVersion < NDB_SF_VERSION_5_0_6)
print_old(filename, sf); ret = print_old(filename, sf, sz);
else else
print(filename, sf, sz); ret = print(filename, sf, sz);
delete [] buf;
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){ ...@@ -1962,6 +1962,11 @@ Ndbcntr::execRESUME_REQ(Signal* signal){
//ResumeRef * const ref = (ResumeRef *)&signal->theData[0]; //ResumeRef * const ref = (ResumeRef *)&signal->theData[0];
jamEntry(); jamEntry();
signal->theData[0] = NDB_LE_SingleUser;
signal->theData[1] = 2;
sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB);
//Uint32 senderData = req->senderData; //Uint32 senderData = req->senderData;
//BlockReference senderRef = req->senderRef; //BlockReference senderRef = req->senderRef;
NodeState newState(NodeState::SL_STARTED); NodeState newState(NodeState::SL_STARTED);
...@@ -2000,12 +2005,11 @@ Ndbcntr::execSTOP_REQ(Signal* signal){ ...@@ -2000,12 +2005,11 @@ Ndbcntr::execSTOP_REQ(Signal* signal){
return; return;
} }
if(c_stopRec.stopReq.senderRef != 0 && !singleuser){ if(c_stopRec.stopReq.senderRef != 0){
jam();
/** /**
* Requested a system shutdown * Requested a system shutdown
*/ */
if(StopReq::getSystemStop(req->requestInfo)){ if(!singleuser && StopReq::getSystemStop(req->requestInfo)){
jam(); jam();
sendSignalWithDelay(reference(), GSN_STOP_REQ, signal, 100, sendSignalWithDelay(reference(), GSN_STOP_REQ, signal, 100,
StopReq::SignalLength); StopReq::SignalLength);
...@@ -2027,23 +2031,28 @@ Ndbcntr::execSTOP_REQ(Signal* signal){ ...@@ -2027,23 +2031,28 @@ Ndbcntr::execSTOP_REQ(Signal* signal){
c_stopRec.stopReq = * req; c_stopRec.stopReq = * req;
c_stopRec.stopInitiatedTime = NdbTick_CurrentMillisecond(); 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(!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)){ if(!c_stopRec.checkNodeFail(signal)){
jam(); jam();
return; 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);
} }
else
signal->theData[0] = NDB_LE_NDBStopStarted; {
signal->theData[1] = StopReq::getSystemStop(c_stopRec.stopReq.requestInfo) ? 1 : 0; signal->theData[0] = NDB_LE_SingleUser;
sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB); signal->theData[1] = 0;
sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB);
}
NodeState newState(NodeState::SL_STOPPING_1, NodeState newState(NodeState::SL_STOPPING_1,
StopReq::getSystemStop(c_stopRec.stopReq.requestInfo)); StopReq::getSystemStop(c_stopRec.stopReq.requestInfo));
...@@ -2125,9 +2134,11 @@ Ndbcntr::StopRecord::checkNodeFail(Signal* signal){ ...@@ -2125,9 +2134,11 @@ Ndbcntr::StopRecord::checkNodeFail(Signal* signal){
stopReq.senderRef = 0; stopReq.senderRef = 0;
NodeState newState(NodeState::SL_STARTED); if (cntr.getNodeState().startLevel != NodeState::SL_SINGLEUSER)
{
cntr.updateNodeState(signal, newState); NodeState newState(NodeState::SL_STARTED);
cntr.updateNodeState(signal, newState);
}
signal->theData[0] = NDB_LE_NDBStopAborted; signal->theData[0] = NDB_LE_NDBStopAborted;
cntr.sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 1, JBB); cntr.sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 1, JBB);
...@@ -2223,12 +2234,24 @@ void Ndbcntr::execABORT_ALL_CONF(Signal* signal){ ...@@ -2223,12 +2234,24 @@ void Ndbcntr::execABORT_ALL_CONF(Signal* signal){
jamEntry(); jamEntry();
if(c_stopRec.stopReq.singleuser) { if(c_stopRec.stopReq.singleuser) {
jam(); jam();
NodeState newState(NodeState::SL_SINGLEUSER); NodeState newState(NodeState::SL_SINGLEUSER);
newState.setSingleUser(true); newState.setSingleUser(true);
newState.setSingleUserApi(c_stopRec.stopReq.singleUserApi); newState.setSingleUserApi(c_stopRec.stopReq.singleUserApi);
updateNodeState(signal, newState); updateNodeState(signal, newState);
c_stopRec.stopInitiatedTime = NdbTick_CurrentMillisecond(); 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 else
{ {
...@@ -2246,7 +2269,13 @@ void Ndbcntr::execABORT_ALL_CONF(Signal* signal){ ...@@ -2246,7 +2269,13 @@ void Ndbcntr::execABORT_ALL_CONF(Signal* signal){
void Ndbcntr::execABORT_ALL_REF(Signal* signal){ void Ndbcntr::execABORT_ALL_REF(Signal* signal){
jamEntry(); 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 void
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
File moved
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment