Commit 04da114c authored by unknown's avatar unknown

Merge bk-internal.mysql.com:/data0/bk/mysql-5.1

into  bk-internal.mysql.com:/data0/bk/mysql-5.1-arch


mysql-test/r/archive.result:
  Auto merged
mysql-test/t/archive.test:
  Auto merged
parents af23ddf6 10f4f15e
......@@ -183,7 +183,7 @@ fi
# (http://samba.org/ccache) is installed, use it.
# We use 'grep' and hope 'grep' will work as expected
# (returns 0 if finds lines)
if ccache -V > /dev/null 2>&1 && test "$CCACHE_GCOV_VERSION_ENABLED" == "1"
if ccache -V > /dev/null 2>&1 && test "$CCACHE_GCOV_VERSION_ENABLED" = "1"
then
echo "$CC" | grep "ccache" > /dev/null || CC="ccache $CC"
echo "$CXX" | grep "ccache" > /dev/null || CXX="ccache $CXX"
......
......@@ -28,7 +28,7 @@ check_cpu () {
fi
# parse CPU flags
for flag in `$cpuinfo | grep '^flags' | sed -e 's/^flags.*: //'`; do
for flag in `$cpuinfo | grep '^flags' | sed -e 's/^flags.*: //' -e 's/[^a-zA-Z0-9_ ]/_/g'`; do
eval cpu_flag_$flag=yes
done
else
......
......@@ -15,6 +15,8 @@
45214442pBGT9KuZEGixBH71jTzbOA
45214a07hVsIGwvwa-WrO-jpeaSwVw
452a92d0-31-8wSzSfZi165fcGcXPA
452c6c6dAjuNghfc1ObZ_UQ5SCl85g
4538a7b0EbDHHkWPbIwxO6ZIDdg6Dg
454a7ef8gdvE_ddMlJyghvOAkKPNOQ
454bb488ijVLOUK_GFjcoISE0GxPUA
454bb9a8AwlGRC_wWLS2sNMoRBMRGw
......@@ -30,3 +32,5 @@
4561b2ecZbhuAc0TTDdCdultxUYaMw
4561bde4qWhz1I8tkItXKex5uniipA
4562ba016dYH0JzszOqZ8p6psbKfnQ
45771031yRCoM_ZfONdYchPvVEgLRg
45ae6628gqKTsUFfnoNExadETVIkbA
......@@ -102,8 +102,10 @@ dist-hook:
tags:
support-files/build-tags
.PHONY: init-db bin-dist test test-full test-ps test-nr \
test-ns test-pr test-unit
.PHONY: init-db bin-dist \
test test-force test-full test-force-full test-force-mem \
test-pl test-force-pl test-full-pl test-force-full-pl test-force-pl-mem \
test-unit test-ps test-nr test-pr test-ns test-binlog-statement
# Target 'test' will run the regression test suite using the built server.
#
......@@ -118,23 +120,23 @@ test-unit:
test-ps:
cd mysql-test ; \
./mysql-test-run.pl $(force) --ps-protocol --mysqld=--binlog-format=mixed
@PERL@ ./mysql-test-run.pl $(force) --ps-protocol --mysqld=--binlog-format=mixed
test-nr:
cd mysql-test ; \
./mysql-test-run.pl $(force) --mysqld=--binlog-format=row
@PERL@ ./mysql-test-run.pl $(force) --mysqld=--binlog-format=row
test-pr:
cd mysql-test ; \
./mysql-test-run.pl $(force) --ps-protocol --mysqld=--binlog-format=row
@PERL@ ./mysql-test-run.pl $(force) --ps-protocol --mysqld=--binlog-format=row
test-ns:
cd mysql-test ; \
./mysql-test-run.pl $(force) --mysqld=--binlog-format=mixed
@PERL@ ./mysql-test-run.pl $(force) --mysqld=--binlog-format=mixed
test-binlog-statement:
cd mysql-test ; \
./mysql-test-run.pl $(force) --mysqld=--binlog-format=statement
@PERL@ ./mysql-test-run.pl $(force) --mysqld=--binlog-format=statement
test: test-unit test-ns test-pr
......
......@@ -470,7 +470,12 @@ int main(int argc, char **argv)
load_defaults("my", load_default_groups, &argc, &argv);
if (handle_options(&argc, &argv, my_long_options, get_one_option))
/*
Must init_dynamic_string before handle_options because string is freed
at error label.
*/
if (init_dynamic_string(&cmdline, NULL, 2 * FN_REFLEN + 128, FN_REFLEN) ||
handle_options(&argc, &argv, my_long_options, get_one_option))
{
ret= 1;
goto error;
......@@ -478,11 +483,6 @@ int main(int argc, char **argv)
if (tty_password)
opt_password= get_tty_password(NullS);
if (init_dynamic_string(&cmdline, NULL, 2 * FN_REFLEN + 128, FN_REFLEN))
{
ret= 1;
goto error;
}
if (!basedir)
{
my_getwd(path, sizeof(path), MYF(0));
......@@ -565,17 +565,34 @@ int main(int argc, char **argv)
goto error;
}
else
dynstr_set(&cmdline, path);
{
#ifdef __WIN__
/* Windows requires an extra pair of quotes around the entire string. */
dynstr_set(&cmdline, "\"");
#else
dynstr_set(&cmdline, "");
#endif /* __WIN__ */
dynstr_append_os_quoted(&cmdline, path, NullS);
}
if (defaults_to_use)
{
dynstr_append(&cmdline, " --defaults-extra-file=");
dynstr_append(&cmdline, defaults_to_use);
dynstr_append(&cmdline, " ");
dynstr_append_os_quoted(&cmdline, "--defaults-extra-file=",
defaults_to_use, NullS);
}
dynstr_append(&cmdline, " --check-upgrade --all-databases"
" --auto-repair --user=");
dynstr_append(&cmdline, user);
dynstr_append(&cmdline, " ");
dynstr_append_os_quoted(&cmdline, "--check-upgrade", NullS);
dynstr_append(&cmdline, " ");
dynstr_append_os_quoted(&cmdline, "--all-databases", NullS);
dynstr_append(&cmdline, " ");
dynstr_append_os_quoted(&cmdline, "--auto-repair", NullS);
dynstr_append(&cmdline, " ");
dynstr_append_os_quoted(&cmdline, "--user=", user, NullS);
#ifdef __WIN__
dynstr_append(&cmdline, "\"");
#endif /* __WIN__ */
if (opt_verbose)
printf("Running %s\n", cmdline.str);
......@@ -604,7 +621,15 @@ int main(int argc, char **argv)
goto error;
}
else
dynstr_set(&cmdline, path);
{
#ifdef __WIN__
/* Windows requires an extra pair of quotes around the entire string. */
dynstr_set(&cmdline, "\"");
#else
dynstr_set(&cmdline, "");
#endif /* __WIN__ */
dynstr_append_os_quoted(&cmdline, path, NullS);
}
if (find_file(MYSQL_FIX_PRIV_TABLES_NAME, basedir, MYF(0),
path, sizeof(path),
......@@ -626,13 +651,25 @@ int main(int argc, char **argv)
if (defaults_to_use)
{
dynstr_append(&cmdline, " --defaults-extra-file=");
dynstr_append(&cmdline, defaults_to_use);
dynstr_append(&cmdline, " ");
dynstr_append_os_quoted(&cmdline, "--defaults-extra-file=",
defaults_to_use, NullS);
}
dynstr_append(&cmdline, " --force --no-auto-rehash --batch --user=");
dynstr_append(&cmdline, user);
dynstr_append(&cmdline, " mysql < ");
dynstr_append(&cmdline, script_line);
dynstr_append(&cmdline, " ");
dynstr_append_os_quoted(&cmdline, "--force", NullS);
dynstr_append(&cmdline, " ");
dynstr_append_os_quoted(&cmdline, "--no-auto-rehash", NullS);
dynstr_append(&cmdline, " ");
dynstr_append_os_quoted(&cmdline, "--batch", NullS);
dynstr_append(&cmdline, " ");
dynstr_append_os_quoted(&cmdline, "--user=", user, NullS);
dynstr_append(&cmdline, " ");
dynstr_append_os_quoted(&cmdline, "--database=mysql", NullS);
dynstr_append(&cmdline, " < ");
dynstr_append_os_quoted(&cmdline, script_line, NullS);
#ifdef __WIN__
dynstr_append(&cmdline, "\"");
#endif /* __WIN__ */
if (opt_verbose)
printf("Running %s\n", cmdline.str);
......
......@@ -66,6 +66,7 @@ static bool opt_hexdump= 0;
static bool opt_base64_output= 0;
static const char* database= 0;
static my_bool force_opt= 0, short_form= 0, remote_opt= 0, info_flag;
static my_bool force_if_open_opt= 1;
static ulonglong offset = 0;
static const char* host = 0;
static int port= 0;
......@@ -85,6 +86,7 @@ static short binlog_flags = 0;
static MYSQL* mysql = NULL;
static const char* dirname_for_local_load= 0;
static bool stop_passed= 0;
static my_bool file_not_closed_error= 0;
/*
check_header() will set the pointer below.
......@@ -94,8 +96,10 @@ static bool stop_passed= 0;
*/
Format_description_log_event* description_event;
static int dump_local_log_entries(const char* logname);
static int dump_remote_log_entries(const char* logname);
static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
const char* logname);
static int dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info,
const char* logname);
static int dump_log_entries(const char* logname);
static int dump_remote_file(NET* net, const char* fname);
static void die(const char* fmt, ...);
......@@ -645,6 +649,12 @@ Create_file event for file_id: %u\n",exv->file_id);
later.
*/
ev= 0;
if (!force_if_open_opt &&
(description_event->flags & LOG_EVENT_BINLOG_IN_USE_F))
{
file_not_closed_error= 1;
DBUG_RETURN(1);
}
break;
case BEGIN_LOAD_QUERY_EVENT:
ev->print(result_file, print_event_info);
......@@ -724,6 +734,9 @@ static struct my_option my_long_options[] =
"already have. NOTE: you will need a SUPER privilege to use this option.",
(gptr*) &disable_log_bin, (gptr*) &disable_log_bin, 0, GET_BOOL,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"force-if-open", 'F', "Force if binlog was not closed properly.",
(gptr*) &force_if_open_opt, (gptr*) &force_if_open_opt, 0, GET_BOOL, NO_ARG,
1, 0, 0, 0, 0, 0},
{"force-read", 'f', "Force reading unknown binlog events.",
(gptr*) &force_opt, (gptr*) &force_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
......@@ -1001,8 +1014,22 @@ static MYSQL* safe_connect()
static int dump_log_entries(const char* logname)
{
return (remote_opt ? dump_remote_log_entries(logname) :
dump_local_log_entries(logname));
int rc;
PRINT_EVENT_INFO print_event_info;
/*
Set safe delimiter, to dump things
like CREATE PROCEDURE safely
*/
fprintf(result_file, "DELIMITER /*!*/;\n");
strcpy(print_event_info.delimiter, "/*!*/;");
rc= (remote_opt ? dump_remote_log_entries(&print_event_info, logname) :
dump_local_log_entries(&print_event_info, logname));
/* Set delimiter back to semicolon */
fprintf(result_file, "DELIMITER ;\n");
strcpy(print_event_info.delimiter, ";");
return rc;
}
......@@ -1067,11 +1094,11 @@ static int check_master_version(MYSQL* mysql,
}
static int dump_remote_log_entries(const char* logname)
static int dump_remote_log_entries(PRINT_EVENT_INFO *print_event_info,
const char* logname)
{
char buf[128];
PRINT_EVENT_INFO print_event_info;
ulong len;
uint logname_len;
NET* net;
......@@ -1194,7 +1221,7 @@ could be out of memory");
len= 1; // fake Rotate, so don't increment old_off
}
}
if ((error= process_event(&print_event_info, ev, old_off)))
if ((error= process_event(print_event_info, ev, old_off)))
{
error= ((error < 0) ? 0 : 1);
goto err;
......@@ -1213,7 +1240,7 @@ could be out of memory");
goto err;
}
if ((error= process_event(&print_event_info, ev, old_off)))
if ((error= process_event(print_event_info, ev, old_off)))
{
my_close(file,MYF(MY_WME));
error= ((error < 0) ? 0 : 1);
......@@ -1339,11 +1366,11 @@ at offset %lu ; this could be a log format error or read error",
}
static int dump_local_log_entries(const char* logname)
static int dump_local_log_entries(PRINT_EVENT_INFO *print_event_info,
const char* logname)
{
File fd = -1;
IO_CACHE cache,*file= &cache;
PRINT_EVENT_INFO print_event_info;
byte tmp_buff[BIN_LOG_HEADER_SIZE];
int error= 0;
......@@ -1430,7 +1457,7 @@ static int dump_local_log_entries(const char* logname)
// file->error == 0 means EOF, that's OK, we break in this case
break;
}
if ((error= process_event(&print_event_info, ev, old_off)))
if ((error= process_event(print_event_info, ev, old_off)))
{
if (error < 0)
error= 0;
......@@ -1547,6 +1574,16 @@ int main(int argc, char** argv)
my_free_open_file_info();
/* We cannot free DBUG, it is used in global destructors after exit(). */
my_end((info_flag ? MY_CHECK_ERROR : 0) | MY_DONT_FREE_DBUG);
if (file_not_closed_error)
{
fprintf(stderr,
"\nError: attempting to dump binlog '%s' which was not closed properly.\n"
"Most probably mysqld is still writting it, or crashed.\n"
"Your current options specify --disable-force-if-open\n"
"which means to abort on this problem.\n"
"You can rerun using --force-if-open to ignore this problem.\n\n", argv[-1]);
}
exit(exit_value);
DBUG_RETURN(exit_value); // Keep compilers happy
}
......
......@@ -49,8 +49,8 @@ static char *add_load_option(char *ptr,const char *object,
static my_bool verbose=0,lock_tables=0,ignore_errors=0,opt_delete=0,
replace=0,silent=0,ignore=0,opt_compress=0,
opt_low_priority= 0, tty_password= 0;
static my_bool opt_use_threads= 0, info_flag= 0;
static uint opt_local_file=0;
static my_bool info_flag= 0;
static uint opt_use_threads=0, opt_local_file=0;
static char *opt_password=0, *current_user=0,
*current_host=0, *current_db=0, *fields_terminated=0,
*lines_terminated=0, *enclosed=0, *opt_enclosed=0,
......
......@@ -725,6 +725,20 @@ void close_connections()
}
void close_statements()
{
struct st_connection *con;
DBUG_ENTER("close_statements");
for (con= connections; con < next_con; con++)
{
if (con->stmt)
mysql_stmt_close(con->stmt);
con->stmt= 0;
}
DBUG_VOID_RETURN;
}
void close_files()
{
DBUG_ENTER("close_files");
......@@ -1246,7 +1260,9 @@ void var_set(const char *var_name, const char *var_name_end,
v->int_dirty= 0;
v->str_val_len= strlen(v->str_val);
}
strxmov(buf, v->name, "=", v->str_val, NullS);
my_snprintf(buf, sizeof(buf), "%.*s=%.*s",
v->name_len, v->name,
v->str_val_len, v->str_val);
if (!(v->env_s= my_strdup(buf, MYF(MY_WME))))
die("Out of memory");
putenv(v->env_s);
......@@ -2906,6 +2922,10 @@ void do_close_connection(struct st_command *command)
}
}
#endif
if (next_con->stmt)
mysql_stmt_close(next_con->stmt);
next_con->stmt= 0;
mysql_close(&con->mysql);
if (con->util_mysql)
mysql_close(con->util_mysql);
......@@ -2974,7 +2994,12 @@ void safe_connect(MYSQL* mysql, const char *name, const char *host,
if ((mysql_errno(mysql) == CR_CONN_HOST_ERROR ||
mysql_errno(mysql) == CR_CONNECTION_ERROR) &&
failed_attempts < opt_max_connect_retries)
{
verbose_msg("Connect attempt %d/%d failed: %d: %s", failed_attempts,
opt_max_connect_retries, mysql_errno(mysql),
mysql_error(mysql));
my_sleep(connection_retry_sleep);
}
else
{
if (failed_attempts > 0)
......@@ -4691,10 +4716,9 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
}
/*
Store the result. If res is NULL, use mysql_field_count to
determine if that was expected
Store the result of the query if it will return any fields
*/
if (!(res= mysql_store_result(mysql)) && mysql_field_count(mysql))
if (mysql_field_count(mysql) && ((res= mysql_store_result(mysql)) == 0))
{
handle_error(command, mysql_errno(mysql), mysql_error(mysql),
mysql_sqlstate(mysql), ds);
......@@ -4746,7 +4770,10 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
}
if (res)
{
mysql_free_result(res);
res= 0;
}
counter++;
} while (!(err= mysql_next_result(mysql)));
if (err > 0)
......@@ -4813,7 +4840,7 @@ void handle_error(struct st_command *command,
err_errno, err_error);
/* Abort the run of this test, pass the failed query as reason */
abort_not_supported_test("Query '%s' failed, required functionality" \
abort_not_supported_test("Query '%s' failed, required functionality " \
"not supported", command->query);
}
......@@ -5103,6 +5130,14 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
dynstr_free(&ds_execute_warnings);
}
/* Close the statement if - no reconnect, need new prepare */
if (mysql->reconnect)
{
mysql_stmt_close(stmt);
cur_con->stmt= NULL;
}
/*
We save the return code (mysql_stmt_errno(stmt)) from the last call sent
to the server into the mysqltest builtin variable $mysql_errno. This
......@@ -5110,10 +5145,7 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
*/
var_set_errno(mysql_stmt_errno(stmt));
#ifndef BUG15518_FIXED
mysql_stmt_close(stmt);
cur_con->stmt= NULL;
#endif
DBUG_VOID_RETURN;
}
......@@ -5900,6 +5932,8 @@ int main(int argc, char **argv)
break;
case Q_DISABLE_PS_PROTOCOL:
ps_protocol_enabled= 0;
/* Close any open statements */
close_statements();
break;
case Q_ENABLE_PS_PROTOCOL:
ps_protocol_enabled= ps_protocol;
......@@ -5909,6 +5943,8 @@ int main(int argc, char **argv)
break;
case Q_ENABLE_RECONNECT:
set_reconnect(&cur_con->mysql, 1);
/* Close any open statements - no reconnect, need new prepare */
close_statements();
break;
case Q_DISABLE_PARSING:
if (parsing_disabled == 0)
......
......@@ -229,10 +229,7 @@ AC_DEFUN([MYSQL_SETUP_NDBCLUSTER], [
if test X"$ndb_binlog" = Xdefault ||
test X"$ndb_binlog" = Xyes
then
if test X"$have_row_based" = Xyes
then
have_ndb_binlog="yes"
fi
have_ndb_binlog="yes"
fi
if test X"$have_ndb_binlog" = Xyes
......
dnl This file contains configuration parameters for replication.
dnl ---------------------------------------------------------------------------
dnl Macro: MYSQL_CHECK_REPLICATION
dnl Sets HAVE_ROW_BASED_REPLICATION if --with-row-based-replication is used
dnl ---------------------------------------------------------------------------
AC_DEFUN([MYSQL_CHECK_REPLICATION], [
AC_ARG_WITH([row-based-replication],
AC_HELP_STRING([--without-row-based-replication],
[Don't include row-based replication]),
[row_based="$withval"],
[row_based=yes])
AC_MSG_CHECKING([for row-based replication])
case "$row_based" in
yes )
AC_DEFINE([WITH_ROW_BASED_REPLICATION], [1], [Define to have row-based replication])
AC_MSG_RESULT([-- including row-based replication])
[have_row_based=yes]
;;
* )
AC_MSG_RESULT([-- not including row-based replication])
[have_row_based=no]
;;
esac
])
dnl ---------------------------------------------------------------------------
dnl END OF MYSQL_CHECK_REPLICATION
dnl ---------------------------------------------------------------------------
......@@ -35,7 +35,6 @@ sinclude(config/ac-macros/ha_ndbcluster.m4)
sinclude(config/ac-macros/large_file.m4)
sinclude(config/ac-macros/misc.m4)
sinclude(config/ac-macros/readline.m4)
sinclude(config/ac-macros/replication.m4)
sinclude(config/ac-macros/ssl.m4)
sinclude(config/ac-macros/zlib.m4)
......@@ -2172,7 +2171,6 @@ AC_MSG_RESULT("$netinet_inc")
MYSQL_CHECK_BIG_TABLES
MYSQL_CHECK_MAX_INDEXES
MYSQL_CHECK_REPLICATION
MYSQL_CHECK_VIO
MYSQL_CHECK_SSL
......@@ -2438,9 +2436,9 @@ AM_CONDITIONAL(THREAD_SAFE_CLIENT, test "$THREAD_SAFE_CLIENT" != "no")
if test "$THREAD_SAFE_CLIENT" = "no"
then
sql_client_dirs="strings regex mysys extra libmysql client"
sql_client_dirs="strings regex mysys dbug extra libmysql client"
else
sql_client_dirs="strings regex mysys extra libmysql libmysql_r client"
sql_client_dirs="strings regex mysys dbug extra libmysql libmysql_r client"
linked_client_targets="$linked_client_targets linked_libmysql_r_sources"
AC_CONFIG_FILES(libmysql_r/Makefile)
AC_DEFINE([THREAD_SAFE_CLIENT], [1], [Should the client be thread safe])
......
......@@ -122,7 +122,7 @@ int read_file(SSL_CTX* ctx, const char* file, int format, CertType type)
EVP_BytesToKey(info.name, "MD5", info.iv, (byte*)password,
passwordSz, 1, key, iv);
STL::auto_ptr<BulkCipher> cipher;
mySTL::auto_ptr<BulkCipher> cipher;
if (strncmp(info.name, "DES-CBC", 7) == 0)
cipher.reset(NEW_YS DES);
else if (strncmp(info.name, "DES-EDE3-CBC", 13) == 0)
......@@ -138,7 +138,7 @@ int read_file(SSL_CTX* ctx, const char* file, int format, CertType type)
return SSL_BAD_FILE;
}
cipher->set_decryptKey(key, info.iv);
STL::auto_ptr<x509> newx(NEW_YS x509(x->get_length()));
mySTL::auto_ptr<x509> newx(NEW_YS x509(x->get_length()));
cipher->decrypt(newx->use_buffer(), x->get_buffer(),
x->get_length());
ysDelete(x);
......
......@@ -248,7 +248,6 @@ inline double ulonglong2double(ulonglong value)
#define tell(A) _telli64(A)
#endif
#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=time((time_t*)0) + (time_t) (SEC); (ABSTIME).tv_nsec=0; }
#define STACK_DIRECTION -1
......@@ -435,7 +434,6 @@ inline double ulonglong2double(ulonglong value)
#define HAVE_SPATIAL 1
#define HAVE_RTREE_KEYS 1
#define HAVE_ROW_BASED_REPLICATION 1
#define HAVE_OPENSSL 1
#define HAVE_YASSL 1
......
......@@ -78,9 +78,6 @@
#endif /* _WIN32... */
#ifndef EMBEDDED_LIBRARY
#ifdef WITH_ROW_BASED_REPLICATION
#define HAVE_ROW_BASED_REPLICATION 1
#endif
#ifdef WITH_NDB_BINLOG
#define HAVE_NDB_BINLOG 1
#endif
......@@ -1141,41 +1138,7 @@ typedef char bool; /* Ordinary boolean values 0 1 */
#define MY_HOW_OFTEN_TO_ALARM 2 /* How often we want info on screen */
#define MY_HOW_OFTEN_TO_WRITE 1000 /* How often we want info on screen */
#ifdef HAVE_TIMESPEC_TS_SEC
#ifndef set_timespec
#define set_timespec(ABSTIME,SEC) \
{ \
(ABSTIME).ts_sec=time(0) + (time_t) (SEC); \
(ABSTIME).ts_nsec=0; \
}
#endif /* !set_timespec */
#ifndef set_timespec_nsec
#define set_timespec_nsec(ABSTIME,NSEC) \
{ \
ulonglong now= my_getsystime() + (NSEC/100); \
(ABSTIME).ts_sec= (now / ULL(10000000)); \
(ABSTIME).ts_nsec= (now % ULL(10000000) * 100 + ((NSEC) % 100)); \
}
#endif /* !set_timespec_nsec */
#else
#ifndef set_timespec
#define set_timespec(ABSTIME,SEC) \
{\
struct timeval tv;\
gettimeofday(&tv,0);\
(ABSTIME).tv_sec=tv.tv_sec+(time_t) (SEC);\
(ABSTIME).tv_nsec=tv.tv_usec*1000;\
}
#endif /* !set_timespec */
#ifndef set_timespec_nsec
#define set_timespec_nsec(ABSTIME,NSEC) \
{\
ulonglong now= my_getsystime() + (NSEC/100); \
(ABSTIME).tv_sec= (time_t) (now / ULL(10000000)); \
(ABSTIME).tv_nsec= (long) (now % ULL(10000000) * 100 + ((NSEC) % 100)); \
}
#endif /* !set_timespec_nsec */
#endif /* HAVE_TIMESPEC_TS_SEC */
/*
Define-funktions for reading and storing in machine independent format
......
......@@ -30,8 +30,26 @@ extern "C" {
#define EXTERNC
#endif /* __cplusplus */
#if defined(__WIN__)
/*
BUG#24507: Race conditions inside current NPTL pthread_exit() implementation.
If macro NPTL_PTHREAD_EXIT_HACK is defined then a hack described in the bug
report will be implemented inside my_thread_global_init() in my_thr_init.c.
This amounts to spawning a dummy thread which does nothing but executes
pthread_exit(0).
This bug is fixed in version 2.5 of glibc library.
TODO: Remove this code when fixed versions of glibc6 are in common use.
*/
#if defined(TARGET_OS_LINUX) && defined(HAVE_NPTL) && \
defined(__GLIBC__) && ( __GLIBC__ < 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ < 5 )
#define NPTL_PTHREAD_EXIT_BUG 1
#endif
#if defined(__WIN__)
typedef CRITICAL_SECTION pthread_mutex_t;
typedef HANDLE pthread_t;
typedef struct thread_attr {
......@@ -55,16 +73,41 @@ typedef struct {
} pthread_cond_t;
struct timespec { /* For pthread_cond_timedwait() */
time_t tv_sec;
long tv_nsec;
};
typedef int pthread_mutexattr_t;
#define win_pthread_self my_thread_var->pthread_self
#define pthread_handler_t EXTERNC void * __cdecl
typedef void * (__cdecl *pthread_handler)(void *);
/*
Struct and macros to be used in combination with the
windows implementation of pthread_cond_timedwait
*/
/*
Declare a union to make sure FILETIME is properly aligned
so it can be used directly as a 64 bit value. The value
stored is in 100ns units.
*/
union ft64 {
FILETIME ft;
__int64 i64;
};
struct timespec {
union ft64 tv;
/* The max timeout value in millisecond for pthread_cond_timedwait */
long max_timeout_msec;
};
#define set_timespec(ABSTIME,SEC) { \
GetSystemTimeAsFileTime(&((ABSTIME).tv.ft)); \
(ABSTIME).tv.i64+= (__int64)(SEC)*10000000; \
(ABSTIME).max_timeout_msec= (long)((SEC)*1000); \
}
#define set_timespec_nsec(ABSTIME,NSEC) { \
GetSystemTimeAsFileTime(&((ABSTIME).tv.ft)); \
(ABSTIME).tv.i64+= (__int64)(NSEC)/100; \
(ABSTIME).max_timeout_msec= (long)((NSEC)/1000000); \
}
void win_pthread_init(void);
int win_pthread_setspecific(void *A,void *B,uint length);
int pthread_create(pthread_t *,pthread_attr_t *,pthread_handler,void *);
......@@ -140,8 +183,6 @@ void pthread_exit(void *a); /* was #define pthread_exit(A) ExitThread(A)*/
#define pthread_condattr_init(A)
#define pthread_condattr_destroy(A)
/*Irena: compiler does not like this: */
/*#define my_pthread_getprio(pthread_t thread_id) pthread_dummy(0) */
#define my_pthread_getprio(thread_id) pthread_dummy(0)
#else /* Normal threads */
......@@ -366,6 +407,47 @@ void my_pthread_attr_getstacksize(pthread_attr_t *attrib, size_t *size);
int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
#endif
/*
The defines set_timespec and set_timespec_nsec should be used
for calculating an absolute time at which
pthread_cond_timedwait should timeout
*/
#ifdef HAVE_TIMESPEC_TS_SEC
#ifndef set_timespec
#define set_timespec(ABSTIME,SEC) \
{ \
(ABSTIME).ts_sec=time(0) + (time_t) (SEC); \
(ABSTIME).ts_nsec=0; \
}
#endif /* !set_timespec */
#ifndef set_timespec_nsec
#define set_timespec_nsec(ABSTIME,NSEC) \
{ \
ulonglong now= my_getsystime() + (NSEC/100); \
(ABSTIME).ts_sec= (now / ULL(10000000)); \
(ABSTIME).ts_nsec= (now % ULL(10000000) * 100 + ((NSEC) % 100)); \
}
#endif /* !set_timespec_nsec */
#else
#ifndef set_timespec
#define set_timespec(ABSTIME,SEC) \
{\
struct timeval tv;\
gettimeofday(&tv,0);\
(ABSTIME).tv_sec=tv.tv_sec+(time_t) (SEC);\
(ABSTIME).tv_nsec=tv.tv_usec*1000;\
}
#endif /* !set_timespec */
#ifndef set_timespec_nsec
#define set_timespec_nsec(ABSTIME,NSEC) \
{\
ulonglong now= my_getsystime() + (NSEC/100); \
(ABSTIME).tv_sec= (time_t) (now / ULL(10000000)); \
(ABSTIME).tv_nsec= (long) (now % ULL(10000000) * 100 + ((NSEC) % 100)); \
}
#endif /* !set_timespec_nsec */
#endif /* HAVE_TIMESPEC_TS_SEC */
/* safe_mutex adds checking to mutex for easier debugging */
#if defined(__NETWARE__) && !defined(SAFE_MUTEX_DETECT_DESTROY)
......
......@@ -782,6 +782,8 @@ extern my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str,
extern my_bool dynstr_append(DYNAMIC_STRING *str, const char *append);
my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append,
uint length);
extern my_bool dynstr_append_os_quoted(DYNAMIC_STRING *str, const char *append,
...);
extern my_bool dynstr_set(DYNAMIC_STRING *str, const char *init_str);
extern my_bool dynstr_realloc(DYNAMIC_STRING *str, ulong additional_size);
extern my_bool dynstr_trunc(DYNAMIC_STRING *str, int n);
......
......@@ -64,9 +64,9 @@ typedef int my_socket;
#endif /* my_socket_defined */
#endif /* _global_h */
#include "mysql_version.h"
#include "mysql_com.h"
#include "mysql_time.h"
#include "mysql_version.h"
#include "typelib.h"
#include "my_list.h" /* for LISTs used in 'MYSQL' and 'MYSQL_STMT' */
......
......@@ -36,6 +36,8 @@ enum mysql_status;
typedef struct st_mysql_rows MYSQL_ROWS;
# 24 "my_list.h"
typedef struct st_list LIST;
# 35 "my_alloc.h"
typedef struct st_mem_root MEM_ROOT;
# 251 "mysql.h"
typedef struct st_mysql MYSQL;
# 653 "mysql.h"
......@@ -60,7 +62,7 @@ typedef struct st_mysql_stmt MYSQL_STMT;
typedef struct character_set MY_CHARSET_INFO;
# 184 "mysql_com.h"
typedef struct st_net NET;
# 21 "typelib.h"
# 23 "typelib.h"
typedef struct st_typelib TYPELIB;
# 174 "mysql_com.h"
typedef struct st_vio Vio;
......@@ -76,8 +78,6 @@ typedef int my_socket;
typedef unsigned long long int my_ulonglong;
# 144 "mysql.h"
typedef struct embedded_query_result EMBEDDED_QUERY_RESULT;
# 35 "my_alloc.h"
typedef struct st_mem_root MEM_ROOT;
# 145 "mysql.h"
typedef struct st_mysql_data MYSQL_DATA;
# 750 "mysql.h"
......@@ -172,6 +172,7 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned
struct st_mysql_methods const * methods;
void * thd;
my_bool * unbuffered_fetch_owner;
char * info_buffer;
};
# 653 "mysql.h"
struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned long int)))) st_mysql_bind
......@@ -419,7 +420,7 @@ struct __attribute__((aligned(__alignof__(void *)), aligned(__alignof__(unsigned
my_bool report_error;
my_bool return_errno;
};
# 21 "typelib.h"
# 23 "typelib.h"
struct __attribute__((aligned(__alignof__(unsigned int)), aligned(__alignof__(void *)))) st_typelib
{
unsigned int count;
......@@ -576,6 +577,7 @@ enum mysql_enum_shutdown_level
SHUTDOWN_WAIT_UPDATES = (unsigned char)((1 << 3)),
SHUTDOWN_WAIT_ALL_BUFFERS = ((unsigned char)((1 << 3)) << 1),
SHUTDOWN_WAIT_CRITICAL_BUFFERS = (((unsigned char)((1 << 3)) << 1) + 1),
KILL_QUERY = 254,
KILL_CONNECTION = 255,
};
# 154 "mysql.h"
......@@ -631,9 +633,11 @@ enum mysql_status
extern my_bool check_scramble(char const * reply, char const * message, unsigned char const * hash_stage2);
# 420 "mysql_com.h"
extern my_bool check_scramble_323(char const *, char const * message, unsigned long int * salt);
# 33 "typelib.h"
extern TYPELIB * copy_typelib(MEM_ROOT * root, TYPELIB * from);
# 415 "mysql_com.h"
extern void create_random_string(char * to, unsigned int, struct rand_struct * rand_st);
# 28 "typelib.h"
# 30 "typelib.h"
extern int find_type(char * x, TYPELIB * typelib, unsigned int);
# 429 "mysql_com.h"
extern void get_salt_from_password(unsigned char * res, char const * password);
......@@ -641,7 +645,7 @@ extern void get_salt_from_password(unsigned char * res, char const * password);
extern void get_salt_from_password_323(unsigned long int * res, char const * password);
# 435 "mysql_com.h"
extern char * get_tty_password(char const * opt_message);
# 30 "typelib.h"
# 32 "typelib.h"
extern char const * get_type(TYPELIB * typelib, unsigned int);
# 417 "mysql_com.h"
extern void hash_password(unsigned long int * to, char const * password, unsigned int);
......@@ -667,7 +671,7 @@ extern void make_password_from_salt_323(char * to, unsigned long int const * sal
extern void make_scrambled_password(char * to, char const * password);
# 418 "mysql_com.h"
extern void make_scrambled_password_323(char * to, char const * password);
# 29 "typelib.h"
# 31 "typelib.h"
extern void make_type(char * to, unsigned int, TYPELIB * typelib);
# 358 "mysql_com.h"
extern int my_connect(my_socket, struct sockaddr const * name, unsigned int, unsigned int);
......@@ -957,5 +961,5 @@ extern void randominit(struct rand_struct *, unsigned long int, unsigned long in
extern void scramble(char * to, char const * message, char const * password);
# 419 "mysql_com.h"
extern void scramble_323(char * to, char const * message, char const * password);
# 32 "typelib.h"
# 35 "typelib.h"
extern TYPELIB sql_protocol_typelib;
......@@ -17,6 +17,8 @@
#ifndef _typelib_h
#define _typelib_h
#include "my_alloc.h"
typedef struct st_typelib { /* Different types saved here */
unsigned int count; /* How many types */
const char *name; /* Name of typelib */
......@@ -27,6 +29,7 @@ typedef struct st_typelib { /* Different types saved here */
extern int find_type(char *x,TYPELIB *typelib,unsigned int full_name);
extern void make_type(char *to,unsigned int nr,TYPELIB *typelib);
extern const char *get_type(TYPELIB *typelib,unsigned int nr);
extern TYPELIB *copy_typelib(MEM_ROOT *root, TYPELIB *from);
extern TYPELIB sql_protocol_typelib;
......
......@@ -2036,6 +2036,13 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length)
DBUG_RETURN(1);
}
/*
Reset the last error in any case: that would clear the statement
if the previous prepare failed.
*/
stmt->last_errno= 0;
stmt->last_error[0]= '\0';
if ((int) stmt->state > (int) MYSQL_STMT_INIT_DONE)
{
/* This is second prepare with another statement */
......@@ -2049,23 +2056,24 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length)
*/
stmt->bind_param_done= stmt->bind_result_done= FALSE;
stmt->param_count= stmt->field_count= 0;
stmt->last_errno= 0;
stmt->last_error[0]= '\0';
free_root(&stmt->mem_root, MYF(MY_KEEP_PREALLOC));
int4store(buff, stmt->stmt_id);
/*
Close statement in server
If there was a 'use' result from another statement, or from
mysql_use_result it won't be freed in mysql_stmt_free_result and
we should get 'Commands out of sync' here.
*/
stmt->state= MYSQL_STMT_INIT_DONE;
if (stmt_command(mysql, COM_STMT_CLOSE, buff, 4, stmt))
{
set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno,
mysql->net.sqlstate);
DBUG_RETURN(1);
}
stmt->state= MYSQL_STMT_INIT_DONE;
}
if (stmt_command(mysql, COM_STMT_PREPARE, query, length, stmt))
......
......@@ -18,8 +18,7 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
# Need to set USE_TLS, since __declspec(thread) approach to thread local
# storage does not work properly in DLLs.
ADD_DEFINITIONS(-DUSE_TLS -DHAVE_ROW_BASED_REPLICATION -DMYSQL_SERVER
-DEMBEDDED_LIBRARY)
ADD_DEFINITIONS(-DUSE_TLS -DMYSQL_SERVER -DEMBEDDED_LIBRARY)
# The old Windows build method used renamed (.cc -> .cpp) source files, fails
# in #include in lib_sql.cc. So disable that using the USING_CMAKE define.
......
......@@ -14,6 +14,7 @@ show binlog events from 102;
# more important than SHOW BINLOG EVENTS, mysqlbinlog (where we
# absolutely need variables names to be quoted and strings to be
# escaped).
flush logs;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001
drop table t2;
......
--source include/have_row_based.inc
--source include/have_binlog_format_row.inc
--source include/master-slave.inc
......
......@@ -7,7 +7,9 @@
connection master;
let $VERSION=`select version()`;
eval create table t1(a int not null primary key) engine=$engine_type;
insert delayed into t1 values (1),(2),(3);
insert delayed into t1 values (1);
insert delayed into t1 values (2);
insert delayed into t1 values (3);
flush tables;
SELECT * FROM t1 ORDER BY a;
sync_slave_with_master;
......
......@@ -80,28 +80,28 @@ INSERT INTO t1_bit VALUES (1,2);
INSERT INTO t1_bit VALUES (2,5);
INSERT INTO t1_char VALUES (1,2);
INSERT INTO t1_char VALUES (2,5);
SELECT * FROM t1_int;
SELECT * FROM t1_bit;
SELECT * FROM t1_char;
SELECT * FROM t1_int ORDER BY a;
SELECT * FROM t1_bit ORDER BY a;
SELECT * FROM t1_char ORDER BY a;
--echo **** On Slave ****
sync_slave_with_master;
SELECT a,b,x FROM t1_int;
SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit;
SELECT a,b,x FROM t1_char;
SELECT a,b,x FROM t1_int ORDER BY a;
SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a;
SELECT a,b,x FROM t1_char ORDER BY a;
--echo **** On Master ****
connection master;
UPDATE t1_int SET b=2*b WHERE a=2;
UPDATE t1_char SET b=2*b WHERE a=2;
UPDATE t1_bit SET b=2*b WHERE a=2;
SELECT * FROM t1_int;
SELECT * FROM t1_bit;
SELECT * FROM t1_char;
SELECT * FROM t1_int ORDER BY a;
SELECT * FROM t1_bit ORDER BY a;
SELECT * FROM t1_char ORDER BY a;
--echo **** On Slave ****
sync_slave_with_master;
SELECT a,b,x FROM t1_int;
SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit;
SELECT a,b,x FROM t1_char;
SELECT a,b,x FROM t1_int ORDER BY a;
SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a;
SELECT a,b,x FROM t1_char ORDER BY a;
# Each of these inserts should generate an error and stop the slave
......@@ -188,11 +188,11 @@ sync_slave_with_master;
connection master;
INSERT INTO t7 VALUES (1),(2),(3);
INSERT INTO t8 VALUES (1),(2),(3);
SELECT * FROM t7;
SELECT * FROM t8;
SELECT * FROM t7 ORDER BY a;
SELECT * FROM t8 ORDER BY a;
sync_slave_with_master;
SELECT * FROM t7;
SELECT * FROM t8;
SELECT * FROM t7 ORDER BY a;
SELECT * FROM t8 ORDER BY a;
# We will now try to update and then delete a row on the master where
# the extra field on the slave does not have a default value. This
......@@ -216,20 +216,20 @@ INSERT INTO t1_nodef VALUES (2,4,6);
--echo **** On Master ****
connection master;
UPDATE t1_nodef SET b=2*b WHERE a=1;
SELECT * FROM t1_nodef;
SELECT * FROM t1_nodef ORDER BY a;
--echo **** On Slave ****
sync_slave_with_master;
SELECT * FROM t1_nodef;
SELECT * FROM t1_nodef ORDER BY a;
--echo **** On Master ****
connection master;
DELETE FROM t1_nodef WHERE a=2;
SELECT * FROM t1_nodef;
SELECT * FROM t1_nodef ORDER BY a;
--echo **** On Slave ****
sync_slave_with_master;
SELECT * FROM t1_nodef;
SELECT * FROM t1_nodef ORDER BY a;
--echo **** Cleanup ****
connection master;
......
......@@ -156,6 +156,7 @@ select hex(c1), hex(c2) from t1;
connection master;
# Let's have a look at generated SETs.
flush logs;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--exec $MYSQL_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001
drop table t1;
......
......@@ -7,7 +7,6 @@
#
# Author(s): Mats Kindahl
--source include/have_row_based.inc
--source include/master-slave.inc
let $format = STATEMENT;
......
#
# Check if server has support for loading udf's
# i.e it will support dlopen
#
--require r/have_dynamic_loading.require
disable_query_log;
show variables like "have_dynamic_loading";
enable_query_log;
#
# Check if the variable EXAMPLE_PLUGIN is set
#
--require r/have_example_plugin.require
disable_query_log;
eval select LENGTH("$EXAMPLE_PLUGIN") > 0 as "have_example_plugin";
enable_query_log;
......@@ -24,5 +24,9 @@ flush tables;
select support = 'Enabled' as `TRUE` from information_schema.engines where engine = 'ndbcluster';
enable_query_log;
# Check should be here as well...
# # Check that second master mysqld has come out of redonly mode
# --source include/ndb_not_readonly.inc
# Set the default connection to 'server1'
connection server1;
......@@ -5,3 +5,5 @@ select support = 'Enabled' as `TRUE` from information_schema.engines where engin
enable_query_log;
-- require r/have_row_based.require
disable_query_log;
show variables like "have_row_based_replication";
enable_query_log;
......@@ -2,7 +2,7 @@
# Check if server has support for loading udf's
# i.e it will support dlopen
#
--require r/have_udf.require
--require r/have_dynamic_loading.require
disable_query_log;
show variables like "have_dynamic_loading";
enable_query_log;
......
# Check that server has come out ot readonly mode
--disable_query_log
let $counter= 100;
let $mysql_errno= 1;
while ($mysql_errno)
{
--error 0, 1005
create table check_read_only(a int) engine=NDB;
sleep 0.1;
if (!$counter)
{
die("Failed while waiting for mysqld to come out of readonly mode");
}
dec $counter;
}
let $counter= 100;
let $mysql_errno= 1;
while ($mysql_errno)
{
--error 0, 1036
insert into check_read_only values(1);
sleep 0.1;
if (!$counter)
{
die("Failed while waiting for mysqld to come out of readonly mode");
}
dec $counter;
}
drop table check_read_only;
--enable_query_log
-- require r/not_row_based.require
disable_query_log;
show variables like "have_row_based_replication";
enable_query_log;
......@@ -302,6 +302,7 @@ sub collect_one_test_case($$$$$$$) {
$tinfo->{'timezone'}= "GMT-3"; # for UNIX_TIMESTAMP tests to work
$tinfo->{'slave_num'}= 0; # Default, no slave
$tinfo->{'master_num'}= 1; # Default, 1 master
if ( defined mtr_match_prefix($tname,"rpl") )
{
if ( $::opt_skip_rpl )
......@@ -311,13 +312,8 @@ sub collect_one_test_case($$$$$$$) {
return;
}
$tinfo->{'slave_num'}= 1; # Default for rpl* tests, use one slave
if ( $tname eq 'rpl_failsafe' or $tname eq 'rpl_chain_temp_table' )
{
# $tinfo->{'slave_num'}= 3; # Not 3 ? Check old code, strange
}
}
if ( defined mtr_match_prefix($tname,"federated") )
......@@ -555,6 +551,8 @@ sub collect_one_test_case($$$$$$$) {
$tinfo->{'comment'}= "No ndbcluster tests(--skip-ndbcluster)";
return;
}
# Ndb tests run with two mysqld masters
$tinfo->{'master_num'}= 2;
}
else
{
......@@ -570,7 +568,7 @@ sub collect_one_test_case($$$$$$$) {
if ( $tinfo->{'innodb_test'} )
{
# This is a test that need inndob
# This is a test that need innodb
if ( $::mysqld_variables{'innodb'} eq "FALSE" )
{
# innodb is not supported, skip it
......
......@@ -234,7 +234,8 @@ sub spawn_parent_impl {
my $ret_pid= waitpid($pid,0);
if ( $ret_pid != $pid )
{
mtr_error("$path ($pid) got lost somehow");
mtr_error("waitpid($pid, 0) returned $ret_pid " .
"when waiting for '$path'");
}
return mtr_process_exit_status($?);
......
......@@ -2160,7 +2160,7 @@ then
$MYSQLADMIN --no-defaults --socket=$MASTER_MYSOCK1 -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1
$MYSQLADMIN --no-defaults --socket=$SLAVE_MYSOCK -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1
$MYSQLADMIN --no-defaults --host=$hostname --port=$MASTER_MYPORT --protocol=tcp -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1
$MYSQLADMIN --no-defaults --host=$hostname --protocol=tcp --port=`expr $MASTER_MYPORT+1` -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1
$MYSQLADMIN --no-defaults --host=$hostname --protocol=tcp --port=`expr $MASTER_MYPORT + 1` -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1
$MYSQLADMIN --no-defaults --host=$hostname --protocol=tcp --port=$SLAVE_MYPORT -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1
$MYSQLADMIN --no-defaults --host=$hostname --protocol=tcp --port=`expr $SLAVE_MYPORT + 1` -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1
sleep_until_file_deleted 0 $MASTER_MYPID
......
......@@ -160,6 +160,7 @@ our $exe_im;
our $exe_my_print_defaults;
our $exe_perror;
our $lib_udf_example;
our $lib_example_plugin;
our $exe_libtool;
our $opt_bench= 0;
......@@ -231,10 +232,12 @@ our $opt_ndbconnectstring_slave;
our $opt_record;
my $opt_report_features;
our $opt_check_testcases;
our $opt_mark_progress;
our $opt_skip;
our $opt_skip_rpl;
our $max_slave_num= 0;
our $max_master_num= 1;
our $use_innodb;
our $opt_skip_test;
our $opt_skip_im;
......@@ -413,6 +416,15 @@ sub main () {
$max_slave_num= $test->{slave_num};
mtr_error("Too many slaves") if $max_slave_num > 3;
}
# Count max number of masters used by a test case
if ( $test->{master_num} > $max_master_num)
{
$max_master_num= $test->{master_num};
mtr_error("Too many masters") if $max_master_num > 2;
mtr_error("Too few masters") if $max_master_num < 1;
}
$use_innodb||= $test->{'innodb_test'};
}
......@@ -536,6 +548,7 @@ sub command_line_setup () {
# Test case authoring
'record' => \$opt_record,
'check-testcases' => \$opt_check_testcases,
'mark-progress' => \$opt_mark_progress,
# Extra options used when starting mysqld
'mysqld=s' => \@opt_extra_mysqld_opt,
......@@ -1211,6 +1224,19 @@ sub command_line_setup () {
$path_ndb_testrun_log= "$opt_vardir/log/ndb_testrun.log";
$path_snapshot= "$opt_tmpdir/snapshot_$opt_master_myport/";
if ( $opt_valgrind and $opt_debug )
{
# When both --valgrind and --debug is selected, send
# all output to the trace file, making it possible to
# see the exact location where valgrind complains
foreach my $mysqld (@{$master}, @{$slave})
{
my $sidx= $mysqld->{idx} ? "$mysqld->{idx}" : "";
$mysqld->{path_myerr}=
"$opt_vardir/log/" . $mysqld->{type} . "$sidx.trace";
}
}
}
#
......@@ -1259,9 +1285,10 @@ sub set_mtr_build_thread_ports($) {
sub datadir_list_setup () {
# Make a list of all data_dirs
@data_dir_lst = (
$master->[0]->{'path_myddir'},
$master->[1]->{'path_myddir'});
for (my $idx= 0; $idx < $max_master_num; $idx++)
{
push(@data_dir_lst, $master->[$idx]->{'path_myddir'});
}
for (my $idx= 0; $idx < $max_slave_num; $idx++)
{
......@@ -1499,6 +1526,11 @@ sub executable_setup () {
mtr_file_exists(vs_config_dirs('sql', 'udf_example.dll'),
"$glob_basedir/sql/.libs/udf_example.so",);
# Look for the ha_example library
$lib_example_plugin=
mtr_file_exists(vs_config_dirs('storage/example', 'ha_example.dll'),
"$glob_basedir/storage/example/.libs/ha_example.so",);
# Look for mysqltest executable
if ( $glob_use_embedded_server )
{
......@@ -1654,6 +1686,14 @@ sub environment_setup () {
push(@ld_library_paths, dirname($lib_udf_example));
}
# --------------------------------------------------------------------------
# Add the path where mysqld will find ha_example.so
# --------------------------------------------------------------------------
if ( $lib_example_plugin )
{
push(@ld_library_paths, dirname($lib_example_plugin));
}
# --------------------------------------------------------------------------
# Valgrind need to be run with debug libraries otherwise it's almost
# impossible to add correct supressions, that means if "/usr/lib/debug"
......@@ -1855,7 +1895,7 @@ sub environment_setup () {
# ----------------------------------------------------
my $cmdline_mysqlbinlog=
"$exe_mysqlbinlog" .
" --no-defaults --debug-info --local-load=$opt_tmpdir";
" --no-defaults --disable-force-if-open --debug-info --local-load=$opt_tmpdir";
if ( $mysql_version_id >= 50000 )
{
$cmdline_mysqlbinlog .=" --character-sets-dir=$path_charsetsdir";
......@@ -1928,10 +1968,11 @@ sub environment_setup () {
$ENV{'UDF_EXAMPLE_LIB'}=
($lib_udf_example ? basename($lib_udf_example) : "");
$ENV{'LD_LIBRARY_PATH'}=
($lib_udf_example ? dirname($lib_udf_example) : "") .
($ENV{'LD_LIBRARY_PATH'} ? ":$ENV{'LD_LIBRARY_PATH'}" : "");
# ----------------------------------------------------
# Add the path where mysqld will find ha_example.so
# ----------------------------------------------------
$ENV{'EXAMPLE_PLUGIN'}=
($lib_example_plugin ? basename($lib_example_plugin) : "");
# ----------------------------------------------------
# We are nice and report a bit about our settings
......@@ -2730,8 +2771,10 @@ sub mysql_install_db () {
install_db('master', $master->[0]->{'path_myddir'});
# FIXME check if testcase really is using second master
copy_install_db('master', $master->[1]->{'path_myddir'});
if ($max_master_num)
{
copy_install_db('master', $master->[1]->{'path_myddir'});
}
# Install the number of slave databses needed
for (my $idx= 0; $idx < $max_slave_num; $idx++)
......@@ -3540,11 +3583,10 @@ sub mysqld_arguments ($$$$$) {
if ( $glob_use_embedded_server )
{
$prefix= "--server-arg=";
} else {
# We can't pass embedded server --no-defaults
mtr_add_arg($args, "--no-defaults");
}
mtr_add_arg($args, "%s--no-defaults", $prefix);
mtr_add_arg($args, "%s--console", $prefix);
mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir);
mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);
......@@ -3623,6 +3665,9 @@ sub mysqld_arguments ($$$$$) {
# Turn on logging, will be sent to tables
mtr_add_arg($args, "%s--log=", $prefix);
}
mtr_add_arg($args, "%s--plugin_dir=%s", $prefix,
dirname($lib_example_plugin));
}
if ( $type eq 'slave' )
......@@ -4273,7 +4318,8 @@ sub run_testcase_start_servers($) {
}
if ( $clusters->[0]->{'pid'} and ! $master->[1]->{'pid'} )
if ( $clusters->[0]->{'pid'} and ! $master->[1]->{'pid'} and
$tinfo->{'master_num'} > 1 )
{
# Test needs cluster, start an extra mysqld connected to cluster
......@@ -4485,6 +4531,10 @@ sub run_mysqltest ($) {
mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
mtr_add_arg($args, "--logdir=%s/log", $opt_vardir);
# Log line number and time for each line in .test file
mtr_add_arg($args, "--mark-progress")
if $opt_mark_progress;
if ($tinfo->{'component_id'} eq 'im')
{
mtr_add_arg($args, "--socket=%s", $instance_manager->{'path_sock'});
......@@ -4940,6 +4990,7 @@ Options for test case authoring
record TESTNAME (Re)genereate the result file for TESTNAME
check-testcases Check testcases for sideeffects
mark-progress Log line number and elapsed time to <testname>.progress
Options that pass on options
......
This diff is collapsed.
......@@ -7,9 +7,12 @@ show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 102 Table_map 1 141 table_id: # (test.t2)
master-bin.000001 141 Write_rows 1 231 table_id: # flags: STMT_END_F
flush logs;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
ROLLBACK;
DELIMITER /*!*/;
ROLLBACK/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
......
......@@ -400,6 +400,7 @@ insert into t2 select * from t1;
select get_lock("a",10);
get_lock("a",10)
1
flush logs;
select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output"))
is not null;
......@@ -407,8 +408,8 @@ is not null;
is not null
1
select
@a like "%#%error_code=0%ROLLBACK;%ROLLBACK /* added by mysqlbinlog */;%",
@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%",
@a not like "%#%error_code=%error_code=%";
@a like "%#%error_code=0%ROLLBACK;%ROLLBACK /* added by mysqlbinlog */;%" @a not like "%#%error_code=%error_code=%"
@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" @a not like "%#%error_code=%error_code=%"
1 1
drop table t1, t2;
......@@ -7,17 +7,20 @@ show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 102 User var 1 142 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci
master-bin.000001 142 Query 1 231 use `test`; insert into t2 values (@v)
flush logs;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
ROLLBACK;
SET @`v`:=_ucs2 0x006100620063 COLLATE `ucs2_general_ci`;
use test;
SET TIMESTAMP=10000;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1;
SET @@session.sql_mode=0;
/*!\C latin1 */;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8;
insert into t2 values (@v);
DELIMITER /*!*/;
ROLLBACK/*!*/;
SET @`v`:=_ucs2 0x006100620063 COLLATE `ucs2_general_ci`/*!*/;
use test/*!*/;
SET TIMESTAMP=10000/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/;
SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
insert into t2 values (@v)/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
......
......@@ -367,6 +367,7 @@ insert into t2 select * from t1;
select get_lock("a",10);
get_lock("a",10)
1
flush logs;
select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output"))
is not null;
......@@ -374,8 +375,8 @@ is not null;
is not null
1
select
@a like "%#%error_code=0%ROLLBACK;%ROLLBACK /* added by mysqlbinlog */;%",
@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%",
@a not like "%#%error_code=%error_code=%";
@a like "%#%error_code=0%ROLLBACK;%ROLLBACK /* added by mysqlbinlog */;%" @a not like "%#%error_code=%error_code=%"
@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" @a not like "%#%error_code=%error_code=%"
1 1
drop table t1, t2;
......@@ -41,6 +41,6 @@ IN ind DECIMAL(10,2))
BEGIN
INSERT INTO t4 VALUES (ins1, ins2, ind);
END
master-bin.000001 805 Query 1 1010 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1'Foo\'s a Bar'), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93))
master-bin.000001 1010 Query 1 1096 use `test`; DROP PROCEDURE bug18293
master-bin.000001 1096 Query 1 1172 use `test`; DROP TABLE t4
master-bin.000001 805 Query 1 1021 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93))
master-bin.000001 1021 Query 1 1107 use `test`; DROP PROCEDURE bug18293
master-bin.000001 1107 Query 1 1183 use `test`; DROP TABLE t4
DROP TABLE IF EXISTS t1;
SET NAMES hebrew;
CREATE TABLE t1 (a char(1)) DEFAULT CHARSET=hebrew;
INSERT INTO t1 VALUES (0xFD),(0xFE);
ALTER TABLE t1 CONVERT TO CHARACTER SET utf8;
SELECT HEX(a) FROM t1;
HEX(a)
E2808E
E2808F
DROP TABLE t1;
End of 4.1 tests
......@@ -124,12 +124,34 @@ create table t1 select date_format("2004-01-19 10:10:10", "%Y-%m-%d");
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`date_format("2004-01-19 10:10:10", "%Y-%m-%d")` varbinary(10) DEFAULT NULL
`date_format("2004-01-19 10:10:10", "%Y-%m-%d")` varchar(10) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t1;
date_format("2004-01-19 10:10:10", "%Y-%m-%d")
2004-01-19
drop table t1;
set names utf8;
set LC_TIME_NAMES='fr_FR';
create table t1 (s1 char(20) character set latin1);
insert into t1 values (date_format('2004-02-02','%M'));
select hex(s1) from t1;
hex(s1)
66E97672696572
drop table t1;
create table t1 (s1 char(20) character set koi8r);
set LC_TIME_NAMES='ru_RU';
insert into t1 values (date_format('2004-02-02','%M'));
insert into t1 values (date_format('2004-02-02','%b'));
insert into t1 values (date_format('2004-02-02','%W'));
insert into t1 values (date_format('2004-02-02','%a'));
select hex(s1), s1 from t1;
hex(s1) s1
E6C5D7D2C1CCD1 Февраля
E6C5D7 Фев
F0CFCEC5C4C5CCD8CEC9CB Понедельник
F0CEC4 Пнд
drop table t1;
set LC_TIME_NAMES='en_US';
set names koi8r;
create table t1 (s1 char(1) character set utf8);
insert into t1 values (_koi8r'');
......
......@@ -59,6 +59,7 @@ SELECT * FROM slow_event_test;
slo_val val
SET SESSION long_query_time=1;
SET GLOBAL event_scheduler=on;
SET GLOBAL long_query_time=20;
CREATE EVENT long_event ON SCHEDULE EVERY 1 MINUTE DO INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(1.5);
"Sleep some more time than the actual event run will take"
SHOW VARIABLES LIKE 'event_scheduler';
......@@ -67,20 +68,22 @@ event_scheduler ON
"Check our table. Should see 1 row"
SELECT * FROM slow_event_test;
slo_val val
4 0
"Check slow log. Should not see anything because 1.5 is under the threshold of 300 for GLOBAL, though over SESSION which is 2"
20 0
"Check slow log. Should not see anything because 1.5 is under the threshold of 20 for GLOBAL, though over SESSION which is 1"
"This should show that the GLOBAL value is regarded and not the SESSION one of the current connection"
SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
user_host query_time db sql_text
"Another test to show that GLOBAL is regarded and not SESSION."
"This should go to the slow log"
DROP EVENT long_event;
SET SESSION long_query_time=10;
DROP EVENT long_event;
SET GLOBAL long_query_time=1;
CREATE EVENT long_event2 ON SCHEDULE EVERY 1 MINUTE DO INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(2);
"Sleep some more time than the actual event run will take"
"Check our table. Should see 2 rows"
SELECT * FROM slow_event_test;
slo_val val
4 0
20 0
1 0
"Check slow log. Should see 1 row because 4 is over the threshold of 3 for GLOBAL, though under SESSION which is 10"
SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
......
......@@ -1020,6 +1020,273 @@ t1 CREATE TABLE `t1` (
`stddev(0)` double(8,4) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table bug22555 (i smallint primary key auto_increment, s1 smallint, s2 smallint, e decimal(30,10), o double);
insert into bug22555 (s1, s2, e, o) values (53, 78, 11.4276528, 6.828112), (17, 78, 5.916793, 1.8502951), (18, 76, 2.679231, 9.17975591), (31, 62, 6.07831, 0.1), (19, 41, 5.37463, 15.1), (83, 73, 14.567426, 7.959222), (92, 53, 6.10151, 13.1856852), (7, 12, 13.92272, 3.442007), (92, 35, 11.95358909, 6.01376678), (38, 84, 2.572, 7.904571);
select std(s1/s2) from bug22555 group by i;
std(s1/s2)
0.00000000
0.00000000
0.00000000
0.00000000
0.00000000
0.00000000
0.00000000
0.00000000
0.00000000
0.00000000
select std(e) from bug22555 group by i;
std(e)
0.00000000000000
0.00000000000000
0.00000000000000
0.00000000000000
0.00000000000000
0.00000000000000
0.00000000000000
0.00000000000000
0.00000000000000
0.00000000000000
select std(o) from bug22555 group by i;
std(o)
0
0
0
0
0
0
0
0
0
0
drop table bug22555;
create table bug22555 (i smallint, s1 smallint, s2 smallint, o1 double, o2 double, e1 decimal, e2 decimal);
insert into bug22555 values (1,53,78,53,78,53,78),(2,17,78,17,78,17,78),(3,18,76,18,76,18,76);
select i, count(*) from bug22555 group by i;
i count(*)
1 1
2 1
3 1
select std(s1/s2) from bug22555 where i=1;
std(s1/s2)
0.00000000
select std(s1/s2) from bug22555 where i=2;
std(s1/s2)
0.00000000
select std(s1/s2) from bug22555 where i=3;
std(s1/s2)
0.00000000
select std(s1/s2) from bug22555 where i=1 group by i;
std(s1/s2)
0.00000000
select std(s1/s2) from bug22555 where i=2 group by i;
std(s1/s2)
0.00000000
select std(s1/s2) from bug22555 where i=3 group by i;
std(s1/s2)
0.00000000
select std(s1/s2) from bug22555 group by i order by i;
std(s1/s2)
0.00000000
0.00000000
0.00000000
select i, count(*), std(o1/o2) from bug22555 group by i order by i;
i count(*) std(o1/o2)
1 1 0
2 1 0
3 1 0
select i, count(*), std(e1/e2) from bug22555 group by i order by i;
i count(*) std(e1/e2)
1 1 0.00000000
2 1 0.00000000
3 1 0.00000000
set @saved_div_precision_increment=@@div_precision_increment;
set div_precision_increment=19;
select i, count(*), variance(s1/s2) from bug22555 group by i order by i;
i count(*) variance(s1/s2)
1 1 0.000000000000000000000000000000
2 1 0.000000000000000000000000000000
3 1 0.000000000000000000000000000000
select i, count(*), variance(o1/o2) from bug22555 group by i order by i;
i count(*) variance(o1/o2)
1 1 0
2 1 0
3 1 0
select i, count(*), variance(e1/e2) from bug22555 group by i order by i;
i count(*) variance(e1/e2)
1 1 0.000000000000000000000000000000
2 1 0.000000000000000000000000000000
3 1 0.000000000000000000000000000000
select i, count(*), std(s1/s2) from bug22555 group by i order by i;
i count(*) std(s1/s2)
1 1 0.000000000000000000000000000000
2 1 0.000000000000000000000000000000
3 1 0.000000000000000000000000000000
select i, count(*), std(o1/o2) from bug22555 group by i order by i;
i count(*) std(o1/o2)
1 1 0
2 1 0
3 1 0
select i, count(*), std(e1/e2) from bug22555 group by i order by i;
i count(*) std(e1/e2)
1 1 0.000000000000000000000000000000
2 1 0.000000000000000000000000000000
3 1 0.000000000000000000000000000000
set div_precision_increment=20;
select i, count(*), variance(s1/s2) from bug22555 group by i order by i;
i count(*) variance(s1/s2)
1 1 0.000000000000000000000000000000
2 1 0.000000000000000000000000000000
3 1 0.000000000000000000000000000000
select i, count(*), variance(o1/o2) from bug22555 group by i order by i;
i count(*) variance(o1/o2)
1 1 0
2 1 0
3 1 0
select i, count(*), variance(e1/e2) from bug22555 group by i order by i;
i count(*) variance(e1/e2)
1 1 0.000000000000000000000000000000
2 1 0.000000000000000000000000000000
3 1 0.000000000000000000000000000000
select i, count(*), std(s1/s2) from bug22555 group by i order by i;
i count(*) std(s1/s2)
1 1 0.000000000000000000000000000000
2 1 0.000000000000000000000000000000
3 1 0.000000000000000000000000000000
select i, count(*), std(o1/o2) from bug22555 group by i order by i;
i count(*) std(o1/o2)
1 1 0
2 1 0
3 1 0
select i, count(*), std(e1/e2) from bug22555 group by i order by i;
i count(*) std(e1/e2)
1 1 0.000000000000000000000000000000
2 1 0.000000000000000000000000000000
3 1 0.000000000000000000000000000000
set @@div_precision_increment=@saved_div_precision_increment;
insert into bug22555 values (1,53,78,53,78,53,78),(2,17,78,17,78,17,78),(3,18,76,18,76,18,76);
insert into bug22555 values (1,53,78,53,78,53,78),(2,17,78,17,78,17,78),(3,18,76,18,76,18,76);
insert into bug22555 values (1,53,78,53,78,53,78),(2,17,78,17,78,17,78),(3,18,76,18,76,18,76);
select i, count(*), std(s1/s2) from bug22555 group by i order by i;
i count(*) std(s1/s2)
1 4 0.00000000
2 4 0.00000000
3 4 0.00000000
select i, count(*), std(o1/o2) from bug22555 group by i order by i;
i count(*) std(o1/o2)
1 4 0
2 4 0
3 4 0
select i, count(*), std(e1/e2) from bug22555 group by i order by i;
i count(*) std(e1/e2)
1 4 0.00000000
2 4 0.00000000
3 4 0.00000000
select std(s1/s2) from bug22555;
std(s1/s2)
0.21325764
select std(o1/o2) from bug22555;
std(o1/o2)
0.21325763586649
select std(e1/e2) from bug22555;
std(e1/e2)
0.21325764
set @saved_div_precision_increment=@@div_precision_increment;
set div_precision_increment=19;
select i, count(*), std(s1/s2) from bug22555 group by i order by i;
i count(*) std(s1/s2)
1 4 0.000000000000000000000000000000
2 4 0.000000000000000000000000000000
3 4 0.000000000000000000000000000000
select i, count(*), std(o1/o2) from bug22555 group by i order by i;
i count(*) std(o1/o2)
1 4 0
2 4 0
3 4 0
select i, count(*), std(e1/e2) from bug22555 group by i order by i;
i count(*) std(e1/e2)
1 4 0.000000000000000000000000000000
2 4 0.000000000000000000000000000000
3 4 0.000000000000000000000000000000
select round(std(s1/s2), 17) from bug22555;
round(std(s1/s2), 17)
0.21325763586649341
select std(o1/o2) from bug22555;
std(o1/o2)
0.21325763586649
select round(std(e1/e2), 17) from bug22555;
round(std(e1/e2), 17)
0.21325763586649341
set div_precision_increment=20;
select i, count(*), std(s1/s2) from bug22555 group by i order by i;
i count(*) std(s1/s2)
1 4 0.000000000000000000000000000000
2 4 0.000000000000000000000000000000
3 4 0.000000000000000000000000000000
select i, count(*), std(o1/o2) from bug22555 group by i order by i;
i count(*) std(o1/o2)
1 4 0
2 4 0
3 4 0
select i, count(*), std(e1/e2) from bug22555 group by i order by i;
i count(*) std(e1/e2)
1 4 0.000000000000000000000000000000
2 4 0.000000000000000000000000000000
3 4 0.000000000000000000000000000000
select round(std(s1/s2), 17) from bug22555;
round(std(s1/s2), 17)
0.21325763586649341
select std(o1/o2) from bug22555;
std(o1/o2)
0.21325763586649
select round(std(e1/e2), 17) from bug22555;
round(std(e1/e2), 17)
0.21325763586649341
set @@div_precision_increment=@saved_div_precision_increment;
drop table bug22555;
create table bug22555 (s smallint, o double, e decimal);
insert into bug22555 values (1,1,1),(2,2,2),(3,3,3),(6,6,6),(7,7,7);
select var_samp(s), var_pop(s) from bug22555;
var_samp(s) var_pop(s)
6.7000 5.3600
select var_samp(o), var_pop(o) from bug22555;
var_samp(o) var_pop(o)
6.7 5.36
select var_samp(e), var_pop(e) from bug22555;
var_samp(e) var_pop(e)
6.7000 5.3600
drop table bug22555;
create table bug22555 (s smallint, o double, e decimal);
insert into bug22555 values (null,null,null),(null,null,null);
select var_samp(s) as 'null', var_pop(s) as 'null' from bug22555;
null null
NULL NULL
select var_samp(o) as 'null', var_pop(o) as 'null' from bug22555;
null null
NULL NULL
select var_samp(e) as 'null', var_pop(e) as 'null' from bug22555;
null null
NULL NULL
insert into bug22555 values (1,1,1);
select var_samp(s) as 'null', var_pop(s) as '0' from bug22555;
null 0
NULL 0.0000
select var_samp(o) as 'null', var_pop(o) as '0' from bug22555;
null 0
NULL 0
select var_samp(e) as 'null', var_pop(e) as '0' from bug22555;
null 0
NULL 0.0000
insert into bug22555 values (2,2,2);
select var_samp(s) as '0.5', var_pop(s) as '0.25' from bug22555;
0.5 0.25
0.5000 0.2500
select var_samp(o) as '0.5', var_pop(o) as '0.25' from bug22555;
0.5 0.25
0.5 0.25
select var_samp(e) as '0.5', var_pop(e) as '0.25' from bug22555;
0.5 0.25
0.5000 0.2500
drop table bug22555;
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8);
INSERT INTO t1 SELECT a, b+8 FROM t1;
......
......@@ -350,6 +350,10 @@ select some_id from t1 where some_id not in(-4,-1,3423534,2342342);
some_id
1
2
select some_id from t1 where some_id not in('-1', '0');
some_id
1
2
drop table t1;
End of 5.0 tests
create table t1(f1 char(1));
......
Variable_name Value
have_row_based_replication YES
......@@ -922,6 +922,7 @@ SET @@myisam_repair_threads=1;
SHOW VARIABLES LIKE 'myisam_repair%';
Variable_name Value
myisam_repair_threads 1
End of 4.1 tests
set storage_engine=MyISAM;
drop table if exists t1,t2,t3;
--- Testing varchar ---
......@@ -1590,20 +1591,6 @@ show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 1 a 1 a A 8 NULL NULL YES BTREE
drop table t1;
show create table t1;
show create table t1;
create table t1 (a int) engine=myisam select 42 a;
select * from t1;
a
9
select * from t1;
a
99
select * from t1;
a
42
drop table t1;
End of 4.1 tests
create table t1 (c1 int) engine=myisam pack_keys=0;
create table t2 (c1 int) engine=myisam pack_keys=1;
create table t3 (c1 int) engine=myisam pack_keys=default;
......
This diff is collapsed.
This diff is collapsed.
......@@ -6,6 +6,7 @@ update t1 set a=a+2 where a=2;
update t1 set a=a+2 where a=3;
create table t2 (word varchar(20));
load data infile '../std_data_ln/words.dat' into table t2;
flush logs;
drop table t1;
drop table t2;
select * from t1;
......
......@@ -1787,6 +1787,78 @@ CREATE TABLE `t1` (
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
drop table t1;
#
# BUG#13926: --order-by-primary fails if PKEY contains quote character
#
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a b` INT,
`c"d` INT,
`e``f` INT,
PRIMARY KEY (`a b`, `c"d`, `e``f`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
insert into t1 values (0815, 4711, 2006);
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS "t1";
CREATE TABLE "t1" (
"a b" int(11) NOT NULL DEFAULT '0',
"c""d" int(11) NOT NULL DEFAULT '0',
"e`f" int(11) NOT NULL DEFAULT '0',
PRIMARY KEY ("a b","c""d","e`f")
);
LOCK TABLES "t1" WRITE;
/*!40000 ALTER TABLE "t1" DISABLE KEYS */;
INSERT INTO "t1" VALUES (815,4711,2006);
/*!40000 ALTER TABLE "t1" ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a b` int(11) NOT NULL DEFAULT '0',
`c"d` int(11) NOT NULL DEFAULT '0',
`e``f` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`a b`,`c"d`,`e``f`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
INSERT INTO `t1` VALUES (815,4711,2006);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!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 TABLE `t1`;
End of 4.1 tests
#
# Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X)
......@@ -3123,78 +3195,6 @@ drop user myDB_User@localhost;
drop database mysqldump_myDB;
use test;
#
# BUG#13926: --order-by-primary fails if PKEY contains quote character
#
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a b` INT,
`c"d` INT,
`e``f` INT,
PRIMARY KEY (`a b`, `c"d`, `e``f`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
insert into t1 values (0815, 4711, 2006);
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS "t1";
CREATE TABLE "t1" (
"a b" int(11) NOT NULL DEFAULT '0',
"c""d" int(11) NOT NULL DEFAULT '0',
"e`f" int(11) NOT NULL DEFAULT '0',
PRIMARY KEY ("a b","c""d","e`f")
);
LOCK TABLES "t1" WRITE;
/*!40000 ALTER TABLE "t1" DISABLE KEYS */;
INSERT INTO "t1" VALUES (815,4711,2006);
/*!40000 ALTER TABLE "t1" ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a b` int(11) NOT NULL DEFAULT '0',
`c"d` int(11) NOT NULL DEFAULT '0',
`e``f` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`a b`,`c"d`,`e``f`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
INSERT INTO `t1` VALUES (815,4711,2006);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!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 TABLE `t1`;
#
# Bug #19745: mysqldump --xml produces invalid xml
#
DROP TABLE IF EXISTS t1;
......
reset master;
drop table if exists t1;
drop database if exists mysqltest;
create database mysqltest;
......
......@@ -87,11 +87,27 @@ x y z
rollback;
commit;
begin;
select * from t1 where y = 'one' or y = 'three' for update;
x y z
# # #
# # #
begin;
select * from t1 where x = 2 for update;
x y z
2 two 2
select * from t1 where x = 1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
rollback;
commit;
begin;
select * from t1 where y = 'one' or y = 'three' order by x for update;
x y z
1 one 1
3 three 3
begin;
select * from t1 where x = 2 for update;
x y z
2 two 2
select * from t1 where x = 1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
rollback;
......@@ -124,6 +140,22 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
rollback;
commit;
begin;
select * from t1 where y = 'one' or y = 'three' lock in share mode;
x y z
# # #
# # #
begin;
select * from t1 where y = 'one' lock in share mode;
x y z
1 one 1
select * from t1 where x = 2 for update;
x y z
2 two 2
select * from t1 where x = 1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
rollback;
commit;
begin;
select * from t1 where y = 'one' or y = 'three' order by x lock in share mode;
x y z
1 one 1
......@@ -132,6 +164,9 @@ begin;
select * from t1 where y = 'one' lock in share mode;
x y z
1 one 1
select * from t1 where x = 2 for update;
x y z
2 two 2
select * from t1 where x = 1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
rollback;
......
......@@ -73,3 +73,4 @@ select time_stamp>@now from t1;
time_stamp>@now
1
drop table t1;
End of 4.1 tests
Variable_name Value
have_row_based_replication NO
CREATE TABLE t1(a int) ENGINE=EXAMPLE;
Warnings:
Error 1286 Unknown table engine 'EXAMPLE'
DROP TABLE t1;
INSTALL PLUGIN example SONAME 'ha_example.so';
INSTALL PLUGIN EXAMPLE SONAME 'ha_example.so';
ERROR HY000: Function 'EXAMPLE' already exists
UNINSTALL PLUGIN example;
INSTALL PLUGIN example SONAME 'ha_example.so';
CREATE TABLE t1(a int) ENGINE=EXAMPLE;
SELECT * FROM t1;
a
DROP TABLE t1;
UNINSTALL PLUGIN non_exist;
ERROR 42000: PLUGIN non_exist does not exist
......@@ -521,8 +521,8 @@ select count(*) from t1 where x = 18446744073709551601;
count(*)
1
create table t2 (x bigint not null);
insert into t2(x) values (cast(0xfffffffffffffff0+0 as signed));
insert into t2(x) values (cast(0xfffffffffffffff1+0 as signed));
insert into t2(x) values (-16);
insert into t2(x) values (-15);
select * from t2;
x
-16
......
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop table if exists t1;
drop procedure if exists p1;
create table t1 (a varchar(255) character set sjis);
create procedure p1 (in a varchar(255) character set sjis) insert into t1 values (a);
SET NAMES binary;
CALL p1 ('–\\');
select "--- on master ---";
--- on master ---
--- on master ---
select hex(a) from t1 ;
hex(a)
965C
select "--- on slave ---";
--- on slave ---
--- on slave ---
select hex(a) from t1;
hex(a)
965C
drop table t1;
drop procedure p1;
......@@ -20,6 +20,17 @@ set password for rpl_do_grant@localhost=password("does it work?");
select password<>_binary'' from mysql.user where user=_binary'rpl_do_grant';
password<>_binary''
1
update mysql.user set password='' where user='rpl_do_grant';
flush privileges;
select password<>'' from mysql.user where user='rpl_do_grant';
password<>''
0
set sql_mode='ANSI_QUOTES';
set password for rpl_do_grant@localhost=password('does it work?');
set sql_mode='';
select password<>'' from mysql.user where user='rpl_do_grant';
password<>''
1
delete from mysql.user where user=_binary'rpl_do_grant';
delete from mysql.db where user=_binary'rpl_do_grant';
flush privileges;
......
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1 (s1 char(10));
set lc_time_names= 'de_DE';
insert into t1 values (date_format('2001-01-01','%W'));
set lc_time_names= 'en_US';
insert into t1 values (date_format('2001-01-01','%W'));
select * from t1;
s1
Montag
Monday
select * from t1;
s1
Montag
Monday
drop table t1;
This diff is collapsed.
......@@ -5,7 +5,9 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
create table t1(a int not null primary key) engine=myisam;
insert delayed into t1 values (1),(2),(3);
insert delayed into t1 values (1);
insert delayed into t1 values (2);
insert delayed into t1 values (3);
flush tables;
SELECT * FROM t1 ORDER BY a;
a
......@@ -19,8 +21,10 @@ master-bin.000001 102 Query 1 222 use `test`; create table t1(a int not null pri
master-bin.000001 222 Table_map 1 261 table_id: # (test.t1)
master-bin.000001 261 Write_rows 1 295 table_id: # flags: STMT_END_F
master-bin.000001 295 Table_map 1 334 table_id: # (test.t1)
master-bin.000001 334 Write_rows 1 373 table_id: # flags: STMT_END_F
master-bin.000001 373 Query 1 448 use `test`; flush tables
master-bin.000001 334 Write_rows 1 368 table_id: # flags: STMT_END_F
master-bin.000001 368 Table_map 1 407 table_id: # (test.t1)
master-bin.000001 407 Write_rows 1 441 table_id: # flags: STMT_END_F
master-bin.000001 441 Query 1 516 use `test`; flush tables
SELECT * FROM t1 ORDER BY a;
a
1
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -559,7 +559,7 @@ begin
insert into t2 select x;
return 100;
end
master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `foo6`(_latin1'foo6_1_')
master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`foo6`(_latin1'foo6_1_')
master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2)
......@@ -620,7 +620,7 @@ master-bin.000001 # Query 1 # use `mysqltest1`; create table t12 select * from t
master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1
master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int, b varchar(100), key(a))
master-bin.000001 # Intvar 1 # INSERT_ID=4
master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `f`(_latin1'try_45_')
master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`f`(_latin1'try_45_')
master-bin.000001 # Query 1 # use `mysqltest1`; create table t13 select * from t1
master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1
master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100))
......@@ -660,9 +660,9 @@ set y = (select count(*) from t2);
return y;
end
master-bin.000001 # Intvar 1 # INSERT_ID=4
master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `f1`(_latin1'try_53_')
master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`f1`(_latin1'try_53_')
master-bin.000001 # Intvar 1 # INSERT_ID=5
master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `f2`(_latin1'try_54_')
master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`f2`(_latin1'try_54_')
master-bin.000001 # Query 1 # use `mysqltest1`; drop function f2
master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t1_bi before insert on t1 for each row
begin
......@@ -869,7 +869,7 @@ begin
insert into t2 select x;
return 100;
end
master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `foo6`(_latin1'foo6_1_')
master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`foo6`(_latin1'foo6_1_')
master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map 1 # table_id: # (mysqltest1.t2)
......@@ -930,7 +930,7 @@ master-bin.000001 # Query 1 # use `mysqltest1`; create table t12 select * from t
master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1
master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int, b varchar(100), key(a))
master-bin.000001 # Intvar 1 # INSERT_ID=4
master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `f`(_latin1'try_45_')
master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`f`(_latin1'try_45_')
master-bin.000001 # Query 1 # use `mysqltest1`; create table t13 select * from t1
master-bin.000001 # Query 1 # use `mysqltest1`; drop table t1
master-bin.000001 # Query 1 # use `mysqltest1`; create table t1 (a int primary key auto_increment, b varchar(100))
......@@ -970,9 +970,9 @@ set y = (select count(*) from t2);
return y;
end
master-bin.000001 # Intvar 1 # INSERT_ID=4
master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `f1`(_latin1'try_53_')
master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`f1`(_latin1'try_53_')
master-bin.000001 # Intvar 1 # INSERT_ID=5
master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `f2`(_latin1'try_54_')
master-bin.000001 # Query 1 # use `mysqltest1`; SELECT `mysqltest1`.`f2`(_latin1'try_54_')
master-bin.000001 # Query 1 # use `mysqltest1`; drop function f2
master-bin.000001 # Query 1 # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger t1_bi before insert on t1 for each row
begin
......
This diff is collapsed.
This diff is collapsed.
......@@ -7,11 +7,11 @@ return 1;
create function x() returns int
return 2;
Warnings:
Note 1581 This function 'x' has the same name as a native function.
Note 1581 This function 'x' has the same name as a native function
create function y() returns int
return 3;
Warnings:
Note 1581 This function 'y' has the same name as a native function.
Note 1581 This function 'y' has the same name as a native function
select a();
a()
1
......
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.
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.
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