Automatic merge with 5.5

This commit is contained in:
Michael Widenius 2012-09-01 00:54:54 +03:00
commit 1999be8d4e
760 changed files with 47838 additions and 5277 deletions

View File

@ -1097,7 +1097,6 @@ CPackSourceConfig.cmake
Docs/INFO_BIN
Docs/INFO_SRC
tags
sql/.empty
Testing
info_macros.cmake
VERSION.dep

View File

@ -300,14 +300,16 @@ ADD_SUBDIRECTORY(vio)
ADD_SUBDIRECTORY(regex)
ADD_SUBDIRECTORY(mysys)
ADD_SUBDIRECTORY(libmysql)
ADD_SUBDIRECTORY(client)
ADD_SUBDIRECTORY(extra)
ADD_SUBDIRECTORY(libservices)
ADD_SUBDIRECTORY(scripts)
ADD_SUBDIRECTORY(sql/share)
ADD_SUBDIRECTORY(support-files)
IF(NOT WITHOUT_SERVER)
ADD_SUBDIRECTORY(tests)
ADD_SUBDIRECTORY(client)
ADD_SUBDIRECTORY(sql)
ADD_SUBDIRECTORY(sql/share)
ADD_SUBDIRECTORY(libservices)
OPTION (WITH_EMBEDDED_SERVER "Compile MySQL with embedded server" OFF)
IF(WITH_EMBEDDED_SERVER)
ADD_SUBDIRECTORY(libmysqld)
@ -316,12 +318,11 @@ IF(NOT WITHOUT_SERVER)
ADD_SUBDIRECTORY(mysql-test)
ADD_SUBDIRECTORY(mysql-test/lib/My/SafeProcess)
ADD_SUBDIRECTORY(support-files)
ADD_SUBDIRECTORY(scripts)
ADD_SUBDIRECTORY(sql-bench)
IF(UNIX)
ADD_SUBDIRECTORY(man)
ENDIF()
ENDIF()
IF(UNIX)
ADD_SUBDIRECTORY(man)
ENDIF()
INCLUDE(cmake/abi_check.cmake)

View File

@ -23,10 +23,6 @@
#include <m_string.h>
#include <m_ctype.h>
#if defined(HAVE_BROKEN_GETPASS) && !defined(HAVE_GETPASSPHRASE)
#undef HAVE_GETPASS
#endif
#ifdef HAVE_GETPASS
#ifdef HAVE_PWD_H
#include <pwd.h>

View File

@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2012, Monty Program Ab
Copyright (c) 2000, 2012, Oracle and/or its affiliates.
Copyright (c) 2009, 2012, Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -743,7 +743,7 @@ print_use_stmt(PRINT_EVENT_INFO* pinfo, const Query_log_event *ev)
return;
// In case of rewrite rule print USE statement for db_to
fprintf(result_file, "use %s%s\n", db_to, pinfo->delimiter);
my_fprintf(result_file, "use %`s%s\n", db_to, pinfo->delimiter);
// Copy the *original* db to pinfo to suppress emiting
// of USE stmts by log_event print-functions.
@ -844,6 +844,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
DBUG_ENTER("process_event");
print_event_info->short_form= short_form;
Exit_status retval= OK_CONTINUE;
IO_CACHE *const head= &print_event_info->head_cache;
/*
Format events are not concerned by --offset and such, we always need to
@ -923,6 +924,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
print_skip_replication_statement(print_event_info, ev);
ev->print(result_file, print_event_info);
}
if (head->error == -1)
goto err;
break;
}
@ -955,8 +958,9 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
{
print_skip_replication_statement(print_event_info, ev);
ce->print(result_file, print_event_info, TRUE);
if (head->error == -1)
goto err;
}
// If this binlog is not 3.23 ; why this test??
if (glob_description_event->binlog_version >= 3)
{
@ -978,6 +982,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
output of Append_block_log_event::print is only a comment.
*/
ev->print(result_file, print_event_info);
if (head->error == -1)
goto err;
if ((retval= load_processor.process((Append_block_log_event*) ev)) !=
OK_CONTINUE)
goto end;
@ -986,6 +992,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
case EXEC_LOAD_EVENT:
{
ev->print(result_file, print_event_info);
if (head->error == -1)
goto err;
Execute_load_log_event *exv= (Execute_load_log_event*)ev;
Create_file_log_event *ce= load_processor.grab_event(exv->file_id);
/*
@ -1003,6 +1011,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
ce->print(result_file, print_event_info, TRUE);
my_free((void*)ce->fname);
delete ce;
if (head->error == -1)
goto err;
}
else
warning("Ignoring Execute_load_log_event as there is no "
@ -1015,6 +1025,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
print_event_info->common_header_len=
glob_description_event->common_header_len;
ev->print(result_file, print_event_info);
if (head->error == -1)
goto err;
if (!remote_opt)
{
ev->free_temp_buf(); // free memory allocated in dump_local_log_entries
@ -1044,6 +1056,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
break;
case BEGIN_LOAD_QUERY_EVENT:
ev->print(result_file, print_event_info);
if (head->error == -1)
goto err;
if ((retval= load_processor.process((Begin_load_query_log_event*) ev)) !=
OK_CONTINUE)
goto end;
@ -1061,6 +1075,12 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
convert_path_to_forward_slashes(fname);
print_skip_replication_statement(print_event_info, ev);
exlq->print(result_file, print_event_info, fname);
if (head->error == -1)
{
if (fname)
my_free(fname);
goto err;
}
}
else
warning("Ignoring Execute_load_query since there is no "
@ -1191,6 +1211,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
default:
print_skip_replication_statement(print_event_info, ev);
ev->print(result_file, print_event_info);
if (head->error == -1)
goto err;
}
}
@ -1354,7 +1376,7 @@ static struct my_option my_options[] =
"Stop reading the binlog at position N. Applies to the last binlog "
"passed on the command line.",
&stop_position, &stop_position, 0, GET_ULL,
REQUIRED_ARG, (ulonglong)(~(my_off_t)0), BIN_LOG_HEADER_SIZE,
REQUIRED_ARG, (longlong)(~(my_off_t)0), BIN_LOG_HEADER_SIZE,
(ulonglong)(~(my_off_t)0), 0, 0, 0},
{"to-last-log", 't', "Requires -R. Will not stop at the end of the \
requested binlog but rather continue printing until the end of the last \
@ -2324,7 +2346,13 @@ err:
end:
if (fd >= 0)
my_close(fd, MYF(MY_WME));
end_io_cache(file);
/*
Since the end_io_cache() writes to the
file errors may happen.
*/
if (end_io_cache(file))
retval= ERROR_STOP;
return retval;
}

View File

@ -2610,6 +2610,7 @@ static uint get_table_structure(char *table, char *db, char *table_type,
if (strcmp(field->name, "View") == 0)
{
char *scv_buff= NULL;
my_ulonglong n_cols;
verbose_msg("-- It's a view, create dummy table for view\n");
@ -2624,8 +2625,8 @@ static uint get_table_structure(char *table, char *db, char *table_type,
the same name in order to satisfy views that depend on this view.
The table will be removed when the actual view is created.
The properties of each column, aside from the data type, are not
preserved in this temporary table, because they are not necessary.
The properties of each column, are not preserved in this temporary
table, because they are not necessary.
This will not be necessary once we can determine dependencies
between views and can simply dump them in the appropriate order.
@ -2652,8 +2653,23 @@ static uint get_table_structure(char *table, char *db, char *table_type,
else
my_free(scv_buff);
if (mysql_num_rows(result))
n_cols= mysql_num_rows(result);
if (0 != n_cols)
{
/*
The actual formula is based on the column names and how the .FRM
files are stored and is too volatile to be repeated here.
Thus we simply warn the user if the columns exceed a limit we
know works most of the time.
*/
if (n_cols >= 1000)
fprintf(stderr,
"-- Warning: Creating a stand-in table for view %s may"
" fail when replaying the dump file produced because "
"of the number of columns exceeding 1000. Exercise "
"caution when replaying the produced dump file.\n",
table);
if (opt_drop)
{
/*
@ -2680,14 +2696,19 @@ static uint get_table_structure(char *table, char *db, char *table_type,
row= mysql_fetch_row(result);
fprintf(sql_file, " %s %s", quote_name(row[0], name_buff, 0),
row[1]);
/*
The actual column type doesn't matter anyway, since the table will
be dropped at run time.
We do tinyint to avoid hitting the row size limit.
*/
fprintf(sql_file, " %s tinyint NOT NULL",
quote_name(row[0], name_buff, 0));
while((row= mysql_fetch_row(result)))
{
/* col name, col type */
fprintf(sql_file, ",\n %s %s",
quote_name(row[0], name_buff, 0), row[1]);
fprintf(sql_file, ",\n %s tinyint NOT NULL",
quote_name(row[0], name_buff, 0));
}
/*
@ -4159,6 +4180,7 @@ static int dump_all_databases()
if (dump_all_tables_in_db(row[0]))
result=1;
}
mysql_free_result(tableres);
if (seen_views)
{
if (mysql_query(mysql, "SHOW DATABASES") ||
@ -4181,6 +4203,7 @@ static int dump_all_databases()
if (dump_all_views_in_db(row[0]))
result=1;
}
mysql_free_result(tableres);
}
return result;
}
@ -4309,8 +4332,6 @@ static int init_dumping(char *database, int init_func(char*))
check_io(md_result_file);
}
}
if (extended_insert)
init_dynamic_string_checked(&extended_row, "", 1024, 1024);
return 0;
} /* init_dumping */
@ -4784,7 +4805,7 @@ static int add_slave_statements(void)
static int do_show_slave_status(MYSQL *mysql_con)
{
MYSQL_RES *slave;
MYSQL_RES *slave= 0;
const char *comment_prefix=
(opt_slave_data == MYSQL_OPT_SLAVE_DATA_COMMENTED_SQL) ? "-- " : "";
LINT_INIT(slave);
@ -5589,6 +5610,9 @@ int main(int argc, char **argv)
if (opt_alltspcs)
dump_all_tablespaces();
if (extended_insert)
init_dynamic_string_checked(&extended_row, "", 1024, 1024);
if (opt_alldbs)
{
if (!opt_alltspcs && !opt_notspcs)

View File

@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates.
Copyright (c) 2009-2012 Monty Program Ab.
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates.
Copyright (c) 2009, 2012, Monty Program Ab.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -621,6 +621,8 @@ void free_all_replace(){
free_replace_column();
}
void var_set_int(const char* name, int value);
class LogFile {
FILE* m_file;
@ -1275,6 +1277,8 @@ void handle_command_error(struct st_command *command, uint error,
{
DBUG_ENTER("handle_command_error");
DBUG_PRINT("enter", ("error: %d", error));
var_set_int("$sys_errno",sys_errno);
var_set_int("$errno",error);
if (error != 0)
{
int i;
@ -1285,7 +1289,7 @@ void handle_command_error(struct st_command *command, uint error,
"errno: %d",
command->first_word_len, command->query, error, my_errno,
sys_errno);
return;
DBUG_VOID_RETURN;
}
i= match_expected_error(command, error, NULL);
@ -5144,7 +5148,7 @@ typedef struct
static st_error global_error_names[] =
{
{ "<No error>", (uint) -1, "" },
{ "<No error>", -1U, "" },
#include <mysqld_ername.h>
{ 0, 0, 0 }
};
@ -5201,15 +5205,32 @@ const char *get_errname_from_code (uint error_code)
void do_get_errcodes(struct st_command *command)
{
struct st_match_err *to= saved_expected_errors.err;
char *p= command->first_argument;
uint count= 0;
char *next;
DBUG_ENTER("do_get_errcodes");
if (!*p)
if (!*command->first_argument)
die("Missing argument(s) to 'error'");
/* TODO: Potentially, there is a possibility of variables
being expanded twice, e.g.
let $errcodes = 1,\$a;
let $a = 1051;
error $errcodes;
DROP TABLE unknown_table;
...
Got one of the listed errors
But since it requires manual escaping, it does not seem
particularly dangerous or error-prone.
*/
DYNAMIC_STRING ds;
init_dynamic_string(&ds, 0, command->query_len + 64, 256);
do_eval(&ds, command->first_argument, command->end, !is_windows);
char *p= ds.str;
uint count= 0;
char *next;
do
{
char *end;
@ -5319,11 +5340,15 @@ void do_get_errcodes(struct st_command *command)
} while (*p);
command->last_argument= p;
command->last_argument= command->first_argument;
while (*command->last_argument)
command->last_argument++;
to->type= ERR_EMPTY; /* End of data */
DBUG_PRINT("info", ("Expected errors: %d", count));
saved_expected_errors.count= count;
dynstr_free(&ds);
DBUG_VOID_RETURN;
}
@ -7685,6 +7710,8 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
*/
if ((counter==0) && do_read_query_result(cn))
{
/* we've failed to collect the result set */
cn->pending= TRUE;
handle_error(command, mysql_errno(mysql), mysql_error(mysql),
mysql_sqlstate(mysql), ds);
goto end;

View File

@ -65,6 +65,7 @@ SET(CPACK_RPM_SPEC_MORE_DEFINE "${CPACK_RPM_SPEC_MORE_DEFINE}
SET(CPACK_RPM_PACKAGE_REQUIRES "MariaDB-common")
SET(CPACK_RPM_server_USER_FILELIST "%ignore /etc" "%ignore /etc/init.d")
SET(CPACK_RPM_common_USER_FILELIST "%config(noreplace) /etc/my.cnf")
SET(CPACK_RPM_client_PACKAGE_OBSOLETES "mysql-client MySQL-client MySQL-OurDelta-client")
SET(CPACK_RPM_client_PACKAGE_PROVIDES "MariaDB-client MySQL-client mysql-client")

View File

@ -364,4 +364,7 @@ SET(HAVE_SOCKADDR_IN_SIN_LEN CACHE INTERNAL "")
SET(HAVE_SOCKADDR_IN6_SIN6_LEN CACHE INTERNAL "")
SET(HAVE_VALGRIND CACHE INTERNAL "")
SET(HAVE_EVENT_H CACHE INTERNAL "")
SET(HAVE_LINUX_UNISTD_H CACHE INTERNAL "")
SET(HAVE_SYS_UTSNAME_H CACHE INTERNAL "")
SET(HAVE_PTHREAD_ATTR_GETGUARDSIZE CACHE INTERNAL "")
ENDIF()

View File

@ -109,6 +109,8 @@ MACRO (FIND_CURSES)
ENDIF()
ENDIF()
ENDIF()
CHECK_LIBRARY_EXISTS(${CURSES_LIBRARY} setupterm "" HAVE_SETUPTERM)
CHECK_LIBRARY_EXISTS(${CURSES_LIBRARY} vidattr "" HAVE_VIDATTR)
ENDMACRO()
MACRO (MYSQL_USE_BUNDLED_READLINE)

View File

@ -46,6 +46,7 @@
#cmakedefine HAVE_IEEEFP_H 1
#cmakedefine HAVE_INTTYPES_H 1
#cmakedefine HAVE_LIMITS_H 1
#cmakedefine HAVE_LINUX_UNISTD_H 1
#cmakedefine HAVE_LOCALE_H 1
#cmakedefine HAVE_MALLOC_H 1
#cmakedefine HAVE_MEMORY_H 1
@ -83,6 +84,7 @@
#cmakedefine HAVE_SYS_SHM_H 1
#cmakedefine HAVE_SYS_SOCKET_H 1
#cmakedefine HAVE_SYS_SOCKIO_H 1
#cmakedefine HAVE_SYS_UTSNAME_H 1
#cmakedefine HAVE_SYS_STAT_H 1
#cmakedefine HAVE_SYS_STREAM_H 1
#cmakedefine HAVE_SYS_TERMCAP_H 1
@ -130,6 +132,7 @@
#cmakedefine FIONREAD_IN_SYS_FILIO 1
/* Functions we may want to use. */
#cmakedefine HAVE_ACCESS 1
#cmakedefine HAVE_AIOWAIT 1
#cmakedefine HAVE_ALARM 1
#cmakedefine HAVE_ALLOCA 1
@ -151,6 +154,7 @@
#cmakedefine HAVE_FCONVERT 1
#cmakedefine HAVE_FDATASYNC 1
#cmakedefine HAVE_DECL_FDATASYNC 1
#cmakedefine HAVE_FEDISABLEEXCEPT 1
#cmakedefine HAVE_FESETROUND 1
#cmakedefine HAVE_FINITE 1
#cmakedefine HAVE_FP_EXCEPT 1
@ -175,6 +179,7 @@
#cmakedefine HAVE_GETWD 1
#cmakedefine HAVE_GMTIME_R 1
#cmakedefine gmtime_r @gmtime_r@
#cmakedefine HAVE_IN_ADDR_T 1
#cmakedefine HAVE_INITGROUPS 1
#cmakedefine HAVE_ISSETUGID 1
#cmakedefine HAVE_GETUID 1
@ -215,6 +220,7 @@
#cmakedefine HAVE_RDTSCLL 1
#cmakedefine HAVE_READ_REAL_TIME 1
#cmakedefine HAVE_PTHREAD_ATTR_CREATE 1
#cmakedefine HAVE_PTHREAD_ATTR_GETGUARDSIZE 1
#cmakedefine HAVE_PTHREAD_ATTR_GETSTACKSIZE 1
#cmakedefine HAVE_PTHREAD_ATTR_SETPRIO 1
#cmakedefine HAVE_PTHREAD_ATTR_SETSCHEDPARAM 1
@ -247,6 +253,7 @@
#cmakedefine HAVE_SETFD 1
#cmakedefine HAVE_SETENV 1
#cmakedefine HAVE_SETLOCALE 1
#cmakedefine HAVE_SETUPTERM 1
#cmakedefine HAVE_SIGADDSET 1
#cmakedefine HAVE_SIGEMPTYSET 1
#cmakedefine HAVE_SIGHOLD 1
@ -284,6 +291,7 @@
#cmakedefine HAVE_TIME 1
#cmakedefine HAVE_TIMES 1
#cmakedefine HAVE_VALLOC 1
#cmakedefine HAVE_VIDATTR 1
#define HAVE_VIO_READ_BUFF 1
#cmakedefine HAVE_VASPRINTF 1
#cmakedefine HAVE_VPRINTF 1

View File

@ -56,10 +56,10 @@ ENDIF()
# Always enable -Wall for gnu C/C++
IF(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_CXX_FLAGS MATCHES ".*-Wall.*")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unused-parameter")
SET(CMAKE_CXX_FLAGS "-Wall ${CMAKE_CXX_FLAGS} -Wall -Wno-unused-parameter")
ENDIF()
IF(CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_C_FLAGS MATCHES ".*-Wall.*")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
SET(CMAKE_C_FLAGS "-Wall ${CMAKE_C_FLAGS} -Wall")
ENDIF()
@ -202,6 +202,7 @@ CHECK_INCLUDE_FILES (grp.h HAVE_GRP_H)
CHECK_INCLUDE_FILES (ieeefp.h HAVE_IEEEFP_H)
CHECK_INCLUDE_FILES (inttypes.h HAVE_INTTYPES_H)
CHECK_INCLUDE_FILES (langinfo.h HAVE_LANGINFO_H)
CHECK_INCLUDE_FILES (linux/unistd.h HAVE_LINUX_UNISTD_H)
CHECK_INCLUDE_FILES (limits.h HAVE_LIMITS_H)
CHECK_INCLUDE_FILES (locale.h HAVE_LOCALE_H)
CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H)
@ -261,6 +262,7 @@ CHECK_INCLUDE_FILES (vis.h HAVE_VIS_H)
CHECK_INCLUDE_FILES (wchar.h HAVE_WCHAR_H)
CHECK_INCLUDE_FILES (wctype.h HAVE_WCTYPE_H)
CHECK_INCLUDE_FILES (sys/sockio.h HAVE_SYS_SOCKIO_H)
CHECK_INCLUDE_FILES (sys/utsname.h HAVE_SYS_UTSNAME_H)
IF(BFD_H_EXISTS)
IF(NOT_FOR_DISTRIBUTION)
@ -326,6 +328,7 @@ ENDIF()
#
# Tests for functions
#
CHECK_FUNCTION_EXISTS (access HAVE_ACCESS)
#CHECK_FUNCTION_EXISTS (aiowait HAVE_AIOWAIT)
CHECK_FUNCTION_EXISTS (aio_read HAVE_AIO_READ)
CHECK_FUNCTION_EXISTS (alarm HAVE_ALARM)
@ -554,6 +557,10 @@ IF(NOT SIZEOF_MODE_T)
SET(mode_t int)
ENDIF()
IF(HAVE_NETINET_IN_H)
SET(CMAKE_EXTRA_INCLUDE_FILES netinet/in.h)
MY_CHECK_TYPE_SIZE(in_addr_t IN_ADDR_T)
ENDIF(HAVE_NETINET_IN_H)
IF(HAVE_STDINT_H)
SET(CMAKE_EXTRA_INCLUDE_FILES stdint.h)

View File

@ -284,9 +284,6 @@ static int DoTrace(CODE_STATE *cs);
/* Test to see if file is writable */
#if defined(HAVE_ACCESS)
static BOOLEAN Writable(const char *pathname);
/* Change file owner and group */
static void ChangeOwner(CODE_STATE *cs, char *pathname);
/* Allocate memory for runtime support */
#endif
static void DoPrefix(CODE_STATE *cs, uint line);

View File

@ -1,14 +1,3 @@
#ifdef DBUG_OFF /* We are testing dbug */
int factorial(register int value) {
if(value > 1) {
value *= factorial(value-1);
}
return value;
}
#else
#include <my_global.h>
int factorial (
@ -22,6 +11,3 @@ register int value)
DBUG_PRINT ("result", ("result is %d", value));
DBUG_RETURN (value);
}
#endif

View File

@ -65,7 +65,7 @@ max_heap_table_size = 32M
myisam_recover = BACKUP
key_buffer_size = 128M
#open-files-limit = 2000
table_cache = 400
table_open_cache = 400
myisam_sort_buffer_size = 512M
concurrent_insert = 2
read_buffer_size = 2M

View File

@ -37,6 +37,11 @@ case "${CODENAME}" in
*) LIBREADLINE_DEV=libreadline-gplv2-dev ;;
esac
case "${CODENAME}" in
etch|lenny|hardy|intrepid|jaunty|karmic) CMAKE_DEP='' ;;
*) CMAKE_DEP='cmake (>= 2.7), ' ;;
esac
# Clean up build file symlinks that are distro-specific. First remove all, then set
# new links.
DISTRODIRS="$(ls ./debian/dist)"
@ -53,7 +58,9 @@ echo "Copying distribution specific build files for ${DISTRO}"
DISTROFILES="$(ls ./debian/dist/${DISTRO})"
for distrofile in ${DISTROFILES}; do
rm -f "./debian/${distrofile}"
sed -e "s/\\\${LIBREADLINE_DEV}/${LIBREADLINE_DEV}/g" < "./debian/dist/${DISTRO}/${distrofile}" > "./debian/${distrofile}"
sed -e "s/\\\${LIBREADLINE_DEV}/${LIBREADLINE_DEV}/g" \
-e "s/\\\${CMAKE_DEP}/${CMAKE_DEP}/g" \
< "./debian/dist/${DISTRO}/${distrofile}" > "./debian/${distrofile}"
chmod --reference="./debian/dist/${DISTRO}/${distrofile}" "./debian/${distrofile}"
done;

View File

@ -4,7 +4,7 @@ Priority: optional
Maintainer: MariaDB Developers <maria-developers@lists.launchpad.net>
XSBC-Original-Maintainer: Maria Developers <maria-developers@lists.launchpad.net>
Uploaders: MariaDB Developers <maria-developers@lists.launchpad.net>
Build-Depends: libtool (>= 1.4.2-7), procps | hurd, debhelper, file (>= 3.28), libncurses5-dev (>= 5.0-6), perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), zlib1g-dev (>= 1:1.1.3-5), ${LIBREADLINE_DEV}, libevent-dev, libssl-dev, libpam0g-dev, psmisc, po-debconf, chrpath, automake1.9, doxygen, texlive-latex-base, ghostscript | gs-gpl, dpatch, gawk, bison, lsb-release, hardening-wrapper
Build-Depends: libtool (>= 1.4.2-7), procps | hurd, debhelper, file (>= 3.28), libncurses5-dev (>= 5.0-6), perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), zlib1g-dev (>= 1:1.1.3-5), ${LIBREADLINE_DEV}, libevent-dev, libssl-dev, libpam0g-dev, psmisc, po-debconf, chrpath, automake1.9, doxygen, texlive-latex-base, ghostscript | gs-gpl, dpatch, gawk, bison, lsb-release, hardening-wrapper, ${CMAKE_DEP}libaio-dev
Standards-Version: 3.8.3
Homepage: http://mariadb.org/
Vcs-Browser: http://bazaar.launchpad.net/~maria-captains/maria/5.5/files

View File

@ -21,7 +21,7 @@ invoke() {
fi
}
MYSQL_BOOTSTRAP="/usr/sbin/mysqld --bootstrap --user=mysql --skip-grant-tables --loose-innodb=OFF --loose-pbxt=OFF --default-storage-engine=myisam"
MYSQL_BOOTSTRAP="/usr/sbin/mysqld --bootstrap --user=mysql --skip-grant-tables --loose-innodb=OFF --default-storage-engine=myisam"
test_mysql_access() {
mysql --no-defaults -u root -h localhost </dev/null >/dev/null 2>&1

View File

@ -4,7 +4,7 @@ Priority: optional
Maintainer: MariaDB Developers <maria-developers@lists.launchpad.net>
XSBC-Original-Maintainer: Maria Developers <maria-developers@lists.launchpad.net>
Uploaders: MariaDB Developers <maria-developers@lists.launchpad.net>
Build-Depends: libtool (>= 1.4.2-7), procps | hurd, debhelper, file (>= 3.28), libncurses5-dev (>= 5.0-6), perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), zlib1g-dev (>= 1:1.1.3-5), ${LIBREADLINE_DEV}, libevent-dev, libssl-dev, libpam0g-dev, psmisc, po-debconf, chrpath, automake1.9, doxygen, texlive-latex-base, ghostscript | gs-gpl, dpatch, gawk, bison, lsb-release, hardening-wrapper
Build-Depends: libtool (>= 1.4.2-7), procps | hurd, debhelper, file (>= 3.28), libncurses5-dev (>= 5.0-6), perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), zlib1g-dev (>= 1:1.1.3-5), ${LIBREADLINE_DEV}, libevent-dev, libssl-dev, libpam0g-dev, psmisc, po-debconf, chrpath, automake1.9, doxygen, texlive-latex-base, ghostscript | gs-gpl, dpatch, gawk, bison, lsb-release, hardening-wrapper, ${CMAKE_DEP}libaio-dev
Standards-Version: 3.8.2
Homepage: http://mariadb.org/
Vcs-Browser: http://bazaar.launchpad.net/~maria-captains/maria/5.5/files

View File

@ -21,7 +21,7 @@ invoke() {
fi
}
MYSQL_BOOTSTRAP="/usr/sbin/mysqld --bootstrap --user=mysql --skip-grant-tables --loose-innodb=OFF --loose-pbxt=OFF --default-storage-engine=myisam"
MYSQL_BOOTSTRAP="/usr/sbin/mysqld --bootstrap --user=mysql --skip-grant-tables --loose-innodb=OFF --default-storage-engine=myisam"
test_mysql_access() {
mysql --no-defaults -u root -h localhost </dev/null >/dev/null 2>&1

View File

@ -11,6 +11,7 @@ usr/bin/mysqlimport
usr/bin/mysqlreport
usr/bin/mysqlshow
usr/bin/mysqlslap
usr/bin/mytop
usr/bin/mysql_waitpid
usr/share/lintian/overrides/mariadb-client-5.5
usr/share/man/man1/innotop.1

View File

@ -25,9 +25,7 @@
#ifndef WIN32
# include <sys/types.h>
# include <sys/socket.h>
# ifndef HAVE_BROKEN_NETINET_INCLUDES
# include <netinet/in.h>
# endif
# include <netinet/in.h>
# include <arpa/inet.h>
# include <netdb.h>
#endif

View File

@ -758,6 +758,10 @@ void CertDecoder::GetName(NameType nt)
while (source_.get_index() < length) {
GetSet();
if (source_.GetError().What() == SET_E) {
source_.SetError(NO_ERROR_E); // extensions may only have sequence
source_.prev();
}
GetSequence();
byte b = source_.next();

View File

@ -184,7 +184,7 @@ word32 DSA_Signer::Sign(const byte* sha_digest, byte* sig,
s_ = (kInv * (H + x*r_)) % q;
if (!(!!r_ && !!s_))
return -1;
return (word32) -1;
int rSz = r_.ByteCount();

View File

@ -36,7 +36,7 @@
choose the Solaris implementation on Solaris (mainly for SunStudio
compilers).
*/
# if defined(_MSV_VER)
# if defined(_MSC_VER)
# include "generic-msvc.h"
# elif __GNUC__
# if defined(HAVE_SOLARIS_ATOMIC)

View File

@ -62,13 +62,9 @@
# define bmove_align(A,B,C) memcpy((A),(B),(C))
#if !defined(HAVE_BCMP)
# define bcmp(A,B,C) memcmp((A),(B),(C))
#endif
#if !defined(bzero) && (!defined(HAVE_BZERO) || !HAVE_DECL_BZERO || defined(_AIX))
/* See autoconf doku: "HAVE_DECL_symbol" will be defined after configure, to 0 or 1 */
/* AIX has bzero() as a function, but the declaration prototype is strangely hidden */
#if !defined(bzero)
# define bzero(A,B) memset((A),0,(B))
#endif

View File

@ -1,5 +1,5 @@
/*
Copyright (c) 2002, 2011, Oracle and/or its affiliates.
Copyright (c) 2002, 2012, Oracle and/or its affiliates.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -79,7 +79,7 @@ struct my_option
enum get_opt_arg_type arg_type; /**< e.g. REQUIRED_ARG or OPT_ARG */
longlong def_value; /**< Default value */
longlong min_value; /**< Min allowed value (for numbers) */
longlong max_value; /**< Max allowed value (for numbers) */
ulonglong max_value; /**< Max allowed value (for numbers) */
longlong sub_size; /**< Unused */
long block_size; /**< Value should be a mult. of this (for numbers) */
void *app_type; /**< To be used by an application */

View File

@ -229,11 +229,6 @@
#include <sys/types.h>
#endif
#ifdef HAVE_THREADS_WITHOUT_SOCKETS
/* MIT pthreads does not work with unix sockets */
#undef HAVE_SYS_UN_H
#endif
#define __EXTENSIONS__ 1 /* We want some extension */
#ifndef __STDC_EXT__
#define __STDC_EXT__ 1 /* To get large file support on hpux */
@ -306,18 +301,6 @@ inline double my_ulonglong2double(unsigned long long A) { return (double A); }
C_MODE_END
#endif /* _AIX */
#ifdef HAVE_BROKEN_SNPRINTF /* HPUX 10.20 don't have this defined */
#undef HAVE_SNPRINTF
#endif
#ifdef HAVE_BROKEN_PREAD
/*
pread()/pwrite() are not 64 bit safe on HP-UX 11.0 without
installing the kernel patch PHKL_20349 or greater
*/
#undef HAVE_PREAD
#undef HAVE_PWRITE
#endif
#ifdef UNDEF_HAVE_INITGROUPS /* For AIX 4.3 */
#undef HAVE_INITGROUPS
#endif
@ -823,18 +806,7 @@ inline unsigned long long my_double2ulonglong(double d)
#endif
#ifdef HAVE_ISINF
/* Check if C compiler is affected by GCC bug #39228 */
#if !defined(__cplusplus) && defined(HAVE_BROKEN_ISINF)
/* Force store/reload of the argument to/from a 64-bit double */
static inline double my_isinf(double x)
{
volatile double t= x;
return isinf(t);
}
#else
/* System-provided isinf() is available and safe to use */
#define my_isinf(X) isinf(X)
#endif
#else /* !HAVE_ISINF */
#define my_isinf(X) (!finite(X) && !isnan(X))
#endif

View File

@ -43,7 +43,7 @@ C_MODE_START
#include <sys/ioctl.h>
#endif
#if !defined(__WIN__) && !defined(HAVE_BROKEN_NETINET_INCLUDES)
#if !defined(__WIN__)
#include <netinet/in_systm.h>
#include <netinet/in.h>
#include <netinet/ip.h>

View File

@ -200,28 +200,13 @@ extern int my_pthread_create_detached;
int sigwait(sigset_t *set, int *sig);
#endif
#ifndef HAVE_NONPOSIX_SIGWAIT
#define my_sigwait(A,B) sigwait((A),(B))
#else
int my_sigwait(const sigset_t *set,int *sig);
#endif
#ifdef HAVE_NONPOSIX_PTHREAD_MUTEX_INIT
#ifndef SAFE_MUTEX
#define pthread_mutex_init(a,b) my_pthread_mutex_noposix_init((a),(b))
extern int my_pthread_mutex_noposix_init(pthread_mutex_t *mp,
const pthread_mutexattr_t *attr);
#endif /* SAFE_MUTEX */
#define pthread_cond_init(a,b) my_pthread_cond_noposix_init((a),(b))
extern int my_pthread_cond_noposix_init(pthread_cond_t *mp,
const pthread_condattr_t *attr);
#endif /* HAVE_NONPOSIX_PTHREAD_MUTEX_INIT */
#if defined(HAVE_SIGTHREADMASK) && !defined(HAVE_PTHREAD_SIGMASK)
#define pthread_sigmask(A,B,C) sigthreadmask((A),(B),(C))
#endif
#if !defined(HAVE_SIGWAIT) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(HAVE_NONPOSIX_SIGWAIT) && !defined(HAVE_DEC_3_2_THREADS) && !defined(_AIX)
#if !defined(HAVE_SIGWAIT) && !defined(HAVE_rts_threads) && !defined(sigwait) && !defined(alpha_linux_port) && !defined(_AIX)
int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */
#endif
@ -247,24 +232,12 @@ int sigwait(sigset_t *setp, int *sigp); /* Use our implemention */
#define my_sigset(A,B) signal((A),(B))
#endif
#if !defined(HAVE_PTHREAD_ATTR_SETSCOPE) || defined(HAVE_DEC_3_2_THREADS)
#if !defined(HAVE_PTHREAD_ATTR_SETSCOPE)
#define pthread_attr_setscope(A,B)
#undef HAVE_GETHOSTBYADDR_R /* No definition */
#endif
#if defined(HAVE_BROKEN_PTHREAD_COND_TIMEDWAIT) && !defined(SAFE_MUTEX)
extern int my_pthread_cond_timedwait(pthread_cond_t *cond,
pthread_mutex_t *mutex,
struct timespec *abstime);
#define pthread_cond_timedwait(A,B,C) my_pthread_cond_timedwait((A),(B),(C))
#endif
#if !defined( HAVE_NONPOSIX_PTHREAD_GETSPECIFIC)
#define my_pthread_getspecific(A,B) ((A) pthread_getspecific(B))
#else
#define my_pthread_getspecific(A,B) ((A) my_pthread_getspecific_imp(B))
void *my_pthread_getspecific_imp(pthread_key_t key);
#endif
#ifndef HAVE_LOCALTIME_R
struct tm *localtime_r(const time_t *clock, struct tm *res);
@ -285,34 +258,7 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res);
#define pthread_key_delete(A) pthread_dummy(0)
#endif
#ifdef HAVE_CTHREADS_WRAPPER /* For MacOSX */
#define pthread_cond_destroy(A) pthread_dummy(0)
#define pthread_mutex_destroy(A) pthread_dummy(0)
#define pthread_attr_delete(A) pthread_dummy(0)
#define pthread_condattr_delete(A) pthread_dummy(0)
#define pthread_attr_setstacksize(A,B) pthread_dummy(0)
#define pthread_equal(A,B) ((A) == (B))
#define pthread_cond_timedwait(a,b,c) pthread_cond_wait((a),(b))
#define pthread_attr_init(A) pthread_attr_create(A)
#define pthread_attr_destroy(A) pthread_attr_delete(A)
#define pthread_attr_setdetachstate(A,B) pthread_dummy(0)
#define pthread_create(A,B,C,D) pthread_create((A),*(B),(C),(D))
#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH)
#undef pthread_detach_this_thread
#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(&tmp); }
#endif
#ifdef HAVE_DARWIN5_THREADS
#define pthread_sigmask(A,B,C) sigprocmask((A),(B),(C))
#define pthread_kill(A,B) pthread_dummy((A) ? 0 : ESRCH)
#define pthread_condattr_init(A) pthread_dummy(0)
#define pthread_condattr_destroy(A) pthread_dummy(0)
#undef pthread_detach_this_thread
#define pthread_detach_this_thread() { pthread_t tmp=pthread_self() ; pthread_detach(tmp); }
#endif
#if ((defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)) || defined(HAVE_DEC_3_2_THREADS)) && !defined(HAVE_CTHREADS_WRAPPER)
#if defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT)
/* This is set on AIX_3_2 and Siemens unix (and DEC OSF/1 3.2 too) */
#define pthread_key_create(A,B) \
pthread_keycreate(A,(B) ?\
@ -352,7 +298,7 @@ void my_pthread_attr_getstacksize(pthread_attr_t *attrib, size_t *size);
int my_pthread_mutex_trylock(pthread_mutex_t *mutex);
#endif
#if !defined(HAVE_PTHREAD_YIELD_ONE_ARG) && !defined(HAVE_PTHREAD_YIELD_ZERO_ARG)
#if !defined(HAVE_PTHREAD_YIELD_ZERO_ARG)
/* no pthread_yield() available */
#ifdef HAVE_SCHED_YIELD
#define pthread_yield() sched_yield()
@ -541,12 +487,6 @@ int my_pthread_fastmutex_lock(my_pthread_fastmutex_t *mp);
/* READ-WRITE thread locking */
#ifdef HAVE_BROKEN_RWLOCK /* For OpenUnix */
#undef HAVE_PTHREAD_RWLOCK_RDLOCK
#undef HAVE_RWLOCK_INIT
#undef HAVE_RWLOCK_T
#endif
#if defined(USE_MUTEX_INSTEAD_OF_RW_LOCKS)
/* use these defs for simple mutex locking */
#define rw_lock_t pthread_mutex_t

View File

@ -629,6 +629,7 @@ extern FILE *my_freopen(const char *path, const char *mode, FILE *stream);
extern int my_fclose(FILE *fd,myf MyFlags);
extern int my_vfprintf(FILE *stream, const char* format, va_list args);
extern void my_strerror(char *buf, size_t len, int nr);
extern int my_fprintf(FILE *stream, const char* format, ...);
extern File my_fileno(FILE *fd);
extern int my_chsize(File fd,my_off_t newlength, int filler, myf MyFlags);
extern int my_chmod(const char *name, mode_t mode, myf my_flags);
@ -753,6 +754,8 @@ extern size_t my_b_fill(IO_CACHE *info);
extern void my_b_seek(IO_CACHE *info,my_off_t pos);
extern size_t my_b_gets(IO_CACHE *info, char *to, size_t max_length);
extern my_off_t my_b_filelength(IO_CACHE *info);
extern size_t my_b_write_backtick_quote(IO_CACHE *info, const char *str,
size_t len);
extern size_t my_b_printf(IO_CACHE *info, const char* fmt, ...);
extern size_t my_b_vprintf(IO_CACHE *info, const char* fmt, va_list ap);
extern my_bool open_cached_file(IO_CACHE *cache,const char *dir,

View File

@ -1,7 +1,7 @@
#ifndef SQL_COMMON_INCLUDED
#define SQL_COMMON_INCLUDED
/* Copyright (c) 2003, 2010, Oracle and/or its affiliates.
Copyright (c) 2010, 2011, Monty Program Ab
/* Copyright (c) 2003, 2012, Oracle and/or its affiliates.
Copyright (c) 2010, 2012, Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -80,8 +80,9 @@ typedef struct st_mysql_methods
0, arg, length, 1, stmt)
extern CHARSET_INFO *default_client_charset_info;
MYSQL_FIELD *unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
my_bool default_value, uint server_capabilities);
MYSQL_FIELD *unpack_fields(MYSQL *mysql, MYSQL_DATA *data,MEM_ROOT *alloc,
uint fields, my_bool default_value,
uint server_capabilities);
void free_rows(MYSQL_DATA *cur);
void free_old_query(MYSQL *mysql);
void end_server(MYSQL *mysql);

View File

@ -26,10 +26,6 @@
#include <m_string.h>
#include <m_ctype.h>
#if defined(HAVE_BROKEN_GETPASS) && !defined(HAVE_GETPASSPHRASE)
#undef HAVE_GETPASS
#endif
#ifdef HAVE_GETPASS
#ifdef HAVE_PWD_H
#include <pwd.h>

View File

@ -1,4 +1,5 @@
/* Copyright (c) 2000, 2011, Oracle and/or its affiliates
/* Copyright (c) 2000, 2012, Oracle and/or its affiliates
Copyright (c) 2009, 2012, Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -811,7 +812,7 @@ MYSQL_FIELD *cli_list_fields(MYSQL *mysql)
return NULL;
mysql->field_count= (uint) query->rows;
return unpack_fields(query,&mysql->field_alloc,
return unpack_fields(mysql, query,&mysql->field_alloc,
mysql->field_count, 1, mysql->server_capabilities);
}
@ -871,7 +872,7 @@ mysql_list_processes(MYSQL *mysql)
if (!(fields = (*mysql->methods->read_rows)(mysql,(MYSQL_FIELD*) 0,
protocol_41(mysql) ? 7 : 5)))
DBUG_RETURN(NULL);
if (!(mysql->fields=unpack_fields(fields,&mysql->field_alloc,field_count,0,
if (!(mysql->fields=unpack_fields(mysql, fields,&mysql->field_alloc,field_count,0,
mysql->server_capabilities)))
DBUG_RETURN(0);
mysql->status=MYSQL_STATUS_GET_RESULT;
@ -1456,7 +1457,7 @@ my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt)
if (!(fields_data= (*mysql->methods->read_rows)(mysql,(MYSQL_FIELD*)0,7)))
DBUG_RETURN(1);
if (!(stmt->fields= unpack_fields(fields_data,&stmt->mem_root,
if (!(stmt->fields= unpack_fields(mysql, fields_data,&stmt->mem_root,
field_count,0,
mysql->server_capabilities)))
DBUG_RETURN(1);

View File

@ -15,9 +15,9 @@
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/libmysqld/include
${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/sql
${MY_READLINE_INCLUDE_DIR}
${MY_READLINE_INCLUDE_DIR}
)

View File

@ -21,7 +21,7 @@ SET(MAN1_SERVER innochecksum.1 my_print_defaults.1 myisam_ftdump.1 myisamchk.1
mysql_tzinfo_to_sql.1 mysql_upgrade.1 mysql_zap.1
mysqld_multi.1 mysqld_safe.1 mysqldumpslow.1 mysqlhotcopy.1
mysqlman.1 mysqltest.1 perror.1 replace.1 resolve_stack_dump.1
resolveip.1)
resolveip.1 mysqlbug.1)
SET(MAN8_SERVER mysqld.8 mysqlmanager.8)
SET(MAN1_CLIENT msql2mysql.1 mysql.1 mysql_find_rows.1 mysql_waitpid.1
mysqlaccess.1 mysqladmin.1 mysqlbinlog.1 mysqlcheck.1

View File

@ -0,0 +1,34 @@
#############################################
# checks if mysqlbinlog is debug compiled
# this "cannot" be done simply by using
# have_debug.inc
#############################################
--disable_query_log
--let $temp_out_help_file=$MYSQL_TMP_DIR/mysqlbinlog_help.tmp
--exec $MYSQL_BINLOG --help>$temp_out_help_file
let log_tmp=$temp_out_help_file;
--let $temp_inc=$MYSQL_TMP_DIR/temp.inc
let inc_tmp=$temp_inc;
--perl
use strict;
my $tmp_file= $ENV{'log_tmp'} or die "log_tmp not set";
open(FILE, "$tmp_file") or die("Unable to open $tmp_file: $!\n");
my $count = () = grep(/Output debug log/g,<FILE>);
close FILE;
my $temp_inc= $ENV{'inc_tmp'} or die "temp_inc not set";
open(FILE_INC,">", "$temp_inc") or die("can't open file \"$temp_inc\": $!");
print FILE_INC '--let $is_debug= '.$count;
close FILE_INC;
EOF
--source $temp_inc
if (!$is_debug)
{
--skip mysqlbinlog needs to be debug compiled
}
--remove_file $temp_out_help_file
--remove_file $temp_inc
--enable_query_log

View File

@ -0,0 +1,126 @@
# include/query_cache_partitions.inc
#
# The variables
# $engine_type -- storage engine to be tested
# have to be set before sourcing this script.
eval SET SESSION STORAGE_ENGINE = $engine_type;
# Initialise
--disable_warnings
drop table if exists t1;
--enable_warnings
set @save_query_cache_size = @@global.query_cache_size;
--echo # Test that partitions works with query cache
flush query cache;
SET GLOBAL query_cache_size=1024*1024*512;
CREATE TABLE `t1` (
`id` int(11) NOT NULL ,
`created_at` datetime NOT NULL,
`cool` tinyint default 0
);
ALTER TABLE t1 PARTITION BY RANGE (TO_DAYS(created_at)) (
PARTITION month_2010_4 VALUES LESS THAN (734258),
PARTITION month_2010_5 VALUES LESS THAN (734289),
PARTITION month_max VALUES LESS THAN MAXVALUE
);
show create table t1;
INSERT INTO t1 VALUES (1, now(), 0);
flush status;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
drop table t1;
--echo # Test that sub-partitions works with query cache
flush query cache;
SET GLOBAL query_cache_size=1024*1024*512;
CREATE TABLE `t1` (
`id` int(11) NOT NULL ,
`created_at` datetime NOT NULL,
`cool` tinyint default 0
)
PARTITION BY RANGE (TO_DAYS(created_at))
subpartition by hash(cool) subpartitions 3 (
PARTITION month_2010_4 VALUES LESS THAN (734258),
PARTITION month_2010_5 VALUES LESS THAN (734289),
PARTITION month_max VALUES LESS THAN MAXVALUE
);
show create table t1;
INSERT INTO t1 VALUES (1, now(), 0);
flush status;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
drop table t1;
--echo #
--echo # MySQL bug#53775 Query on partitioned table returns cached result
--echo # from previous transaction
--echo #
flush query cache;
flush status;
SET GLOBAL query_cache_size=1024*1024*512;
CREATE TABLE `t1` (
`id` int(11) NOT NULL ,
`created_at` datetime NOT NULL,
`cool` tinyint default 0
);
ALTER TABLE t1 PARTITION BY RANGE (TO_DAYS(created_at)) (
PARTITION month_2010_4 VALUES LESS THAN (734258),
PARTITION month_2010_5 VALUES LESS THAN (734289),
PARTITION month_max VALUES LESS THAN MAXVALUE
);
INSERT INTO t1 VALUES (1, now(), 0);
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
BEGIN;
UPDATE `t1` SET `cool` = 1 WHERE `id` = 1;
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
ROLLBACK;
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
BEGIN;
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
ROLLBACK;
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
drop table t1;
set @@global.query_cache_size = @save_query_cache_size;

View File

@ -472,11 +472,13 @@ sub process_suite {
else
{
my @combs;
@combs = combinations_from_file($parent, "$suitedir/combinations")
unless $suite->{skip};
my $from = "$suitedir/combinations";
@combs = combinations_from_file($parent, $from) unless $suite->{skip};
$suite->{combinations} = [ @combs ];
# in overlays it's a union of parent's and overlay's files.
unshift @{$suite->{combinations}}, @{$parent->{combinations}} if $parent;
unshift @{$suite->{combinations}},
grep { not $skip_combinations{"$from => $_->{name}"} }
@{$parent->{combinations}} if $parent;
}
# suite.opt
@ -1039,8 +1041,11 @@ sub get_tags_from_file($$) {
$suite = load_suite_for_file($comb_file) if $prefix[0] eq '';
my @comb;
unless ($suite->{skip}) {
@comb = combinations_from_file($over, "$prefix[0]$comb_file");
push @comb, combinations_from_file(undef, "$prefix[1]$comb_file") if $over;
my $from = "$prefix[0]$comb_file";
@comb = combinations_from_file($over, $from);
push @comb,
grep { not $skip_combinations{"$from => $_->{name}"} }
combinations_from_file(undef, "$prefix[1]$comb_file") if $over;
}
push @combinations, [ @comb ];

View File

@ -1147,7 +1147,6 @@ sub command_line_setup {
'start-from=s' => \&collect_option,
'big-test+' => \$opt_big_test,
'combination=s' => \@opt_combinations,
'skip-combinations' => \&collect_option,
'experimental=s' => \@opt_experimentals,
# skip-im is deprecated and silently ignored
'skip-im' => \&ignore_option,
@ -6262,7 +6261,6 @@ Options to control what engine/variation to run
all generated configs
combination=<opt> Use at least twice to run tests with specified
options to mysqld
skip-combinations Ignore combination file (or options)
Options to control directories to use
tmpdir=DIR The directory where temporary files are stored

View File

@ -220,6 +220,10 @@ a d
3 11120436154190595086
drop table t1, t2;
End of 5.0 tests
CREATE TABLE t1(a YEAR);
SELECT 1 FROM t1 WHERE a=1 AND CASE 1 WHEN a THEN 1 ELSE 1 END;
1
DROP TABLE t1;
create table t1 (f1 time);
insert t1 values ('00:00:00'),('00:01:00');
select case t1.f1 when '00:00:00' then 1 end from t1;

View File

@ -96,3 +96,7 @@ SELECT * FROM t1 WHERE a > '2008-01-01' AND a = '0000-00-00';
a
DROP TABLE t1;
End of 5.0 tests
CREATE TABLE t1(a INT ZEROFILL);
SELECT 1 FROM t1 WHERE t1.a IN (1, t1.a) AND t1.a=2;
1
DROP TABLE t1;

View File

@ -53,8 +53,8 @@ set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go';
create table t1 select 1 as i;;
set debug_sync='now WAIT_FOR parked';
alter table t3 rename to t1;
ERROR 42S01: Table 't1' already exists
set debug_sync='now SIGNAL go';
ERROR 42S01: Table 't1' already exists
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@ -65,8 +65,8 @@ set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go';
create table t1 select 1 as i;;
set debug_sync='now WAIT_FOR parked';
alter table t3 rename to t1, add k int;
ERROR 42S01: Table 't1' already exists
set debug_sync='now SIGNAL go';
ERROR 42S01: Table 't1' already exists
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (

View File

@ -2039,6 +2039,8 @@ hex(concat(a)) a
30303030303030303030303030303031303030302E31 00000000000000010000.1
drop table t1;
create table t1 (a year(2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1);
select hex(concat(a)) from t1;
hex(concat(a))
@ -2352,6 +2354,8 @@ hex(a)
drop table t1;
drop view v1;
create table t1 (a year(2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1);
create view v1(a) as select concat(a) from t1;
show columns from v1;

View File

@ -2431,6 +2431,8 @@ hex(concat(a)) a
30303030303030303030303030303031303030302E31 00000000000000010000.1
drop table t1;
create table t1 (a year(2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1);
select hex(concat(a)) from t1;
hex(concat(a))
@ -2744,6 +2746,8 @@ hex(a)
drop table t1;
drop view v1;
create table t1 (a year(2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1);
create view v1(a) as select concat(a) from t1;
show columns from v1;

View File

@ -2458,6 +2458,8 @@ hex(concat(a)) a
30303030303030303030303030303031303030302E31 00000000000000010000.1
drop table t1;
create table t1 (a year(2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1);
select hex(concat(a)) from t1;
hex(concat(a))
@ -2771,6 +2773,8 @@ hex(a)
drop table t1;
drop view v1;
create table t1 (a year(2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1);
create view v1(a) as select concat(a) from t1;
show columns from v1;

View File

@ -3341,6 +3341,8 @@ hex(concat(a)) a
00300030003000300030003000300030003000300030003000300030003000310030003000300030002E0031 00000000000000010000.1
drop table t1;
create table t1 (a year(2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1);
select hex(concat(a)) from t1;
hex(concat(a))
@ -3654,6 +3656,8 @@ hex(a)
drop table t1;
drop view v1;
create table t1 (a year(2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1);
create view v1(a) as select concat(a) from t1;
show columns from v1;

View File

@ -1182,5 +1182,11 @@ a 256
Warnings:
Warning 1260 Row 1 was cut by GROUP_CONCAT()
#
# incorrect charset for val_str_ascii
#
SELECT '2010-10-10 10:10:10' + INTERVAL GeometryType(GeomFromText('POINT(1 1)')) hour_second;
'2010-10-10 10:10:10' + INTERVAL GeometryType(GeomFromText('POINT(1 1)')) hour_second
2010-10-10 10:10:10
#
# End of 5.5 tests
#

View File

@ -4197,6 +4197,8 @@ hex(concat(a)) a
30303030303030303030303030303031303030302E31 00000000000000010000.1
drop table t1;
create table t1 (a year(2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1);
select hex(concat(a)) from t1;
hex(concat(a))
@ -4510,6 +4512,8 @@ hex(a)
drop table t1;
drop view v1;
create table t1 (a year(2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1);
create view v1(a) as select concat(a) from t1;
show columns from v1;

View File

@ -287,7 +287,7 @@ WHERE t1.f1 GROUP BY t1.f1));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
2 SUBQUERY a system NULL NULL NULL NULL 1
2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1
2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where
PREPARE stmt FROM
'EXPLAIN SELECT 1 FROM t1
WHERE 1 > ALL((SELECT t1.f1 FROM t1 RIGHT OUTER JOIN t1 a
@ -297,12 +297,12 @@ EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
2 SUBQUERY a system NULL NULL NULL NULL 1
2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1
2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
2 SUBQUERY a system NULL NULL NULL NULL 1
2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1
2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where
DEALLOCATE PREPARE stmt;
PREPARE stmt FROM
'EXPLAIN SELECT 1 FROM t1
@ -313,12 +313,12 @@ EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
2 SUBQUERY a system NULL NULL NULL NULL 1
2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1
2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
2 SUBQUERY a system NULL NULL NULL NULL 1
2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1
2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
End of 5.1 tests.

View File

@ -1527,6 +1527,8 @@ DROP TABLE t1;
# Bug#43668: Wrong comparison and MIN/MAX for YEAR(2)
#
create table t1 (f1 year(2), f2 year(4), f3 date, f4 datetime);
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values
(98,1998,19980101,"1998-01-01 00:00:00"),
(00,2000,20000101,"2000-01-01 00:00:01"),
@ -1838,7 +1840,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 range a a 4 NULL 4 100.00 Using where; Using index
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select max(`test`.`t1`.`a`) AS `MAX(a)` from `test`.`t1` where (<expr_cache><<cache>(1),<cache>(2)>(<in_optimizer>(<cache>((1,2)),<exists>(select 3,4 having (((1 = 3) or isnull(3)) and ((2 = 4) or isnull(4)) and <is_not_null_test>(3) and <is_not_null_test>(4))))) and (`test`.`t1`.`a` < 10))
Note 1003 select max(`test`.`t1`.`a`) AS `MAX(a)` from `test`.`t1` where (<cache>(<in_optimizer>((1,2),<exists>(select 3,4 having (((1 = 3) or isnull(3)) and ((2 = 4) or isnull(4)) and <is_not_null_test>(3) and <is_not_null_test>(4))))) and (`test`.`t1`.`a` < 10))
SELECT MAX(a) FROM t1 WHERE (1,2) IN (SELECT 3,4) AND a<10;
MAX(a)
NULL

View File

@ -146,19 +146,6 @@ count(*) min(7) max(7)
0 NULL NULL
drop table t1m, t1i, t2m, t2i;
#
# Bug#13723054 CRASH WITH MIN/MAX AFTER QUICK_GROUP_MIN_MAX_SELECT::NEXT_MIN
#
CREATE TABLE t1(a BLOB, b VARCHAR(255) CHARSET LATIN1, c INT,
KEY(b, c, a(765))) ENGINE=INNODB;
INSERT INTO t1(a, b, c) VALUES ('', 'a', 0), ('', 'a', null), ('', 'a', 0);
SELECT MIN(c) FROM t1 GROUP BY b;
MIN(c)
0
EXPLAIN SELECT MIN(c) FROM t1 GROUP BY b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range NULL b 263 NULL 4 Using index for group-by
DROP TABLE t1;
#
# Bug #57954: BIT_AND function returns incorrect results when
# semijoin=on
CREATE TABLE c (
@ -230,4 +217,18 @@ SELECT member_id_to, COUNT(*) FROM t1 WHERE r_date =
member_id_to COUNT(*)
518491 2
DROP TABLE t1;
# End of test BUG#12713907
#
# Bug#13723054 CRASH WITH MIN/MAX AFTER QUICK_GROUP_MIN_MAX_SELECT::NEXT_MIN
#
CREATE TABLE t1(a BLOB, b VARCHAR(255) CHARSET LATIN1, c INT,
KEY(b, c, a(765))) ENGINE=INNODB;
INSERT INTO t1(a, b, c) VALUES ('', 'a', 0), ('', 'a', null), ('', 'a', 0);
SELECT MIN(c) FROM t1 GROUP BY b;
MIN(c)
0
EXPLAIN SELECT MIN(c) FROM t1 GROUP BY b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range NULL b 263 NULL 4 Using index for group-by
DROP TABLE t1;
End of 5.5 tests

View File

@ -2403,7 +2403,7 @@ EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE
(SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) > 12;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t1 index NULL a 10 NULL 15 Using index
2 SUBQUERY t1 range NULL a 5 NULL 8 Using index for group-by
EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE
a IN (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2);
id select_type table type possible_keys key key_len ref rows Extra
@ -2421,7 +2421,7 @@ AND t1_outer1.b = t1_outer2.b;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1_outer1 ref a a 5 const 1 Using where; Using index
1 PRIMARY t1_outer2 index NULL a 10 NULL 15 Using where; Using index; Using join buffer (flat, BNL join)
2 SUBQUERY t1 index NULL a 10 NULL 15 Using index
2 SUBQUERY t1 range NULL a 5 NULL 8 Using index for group-by
EXPLAIN SELECT (SELECT (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) x
FROM t1 AS t1_outer) x2 FROM t1 AS t1_outer2;
id select_type table type possible_keys key key_len ref rows Extra
@ -2757,7 +2757,7 @@ EXPLAIN
SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0);
id select_type table type possible_keys key key_len ref rows Extra
x x x x x x x x x Impossible WHERE noticed after reading const tables
x x x x x x x x x Using index
x x x x x x x x x Using where; Using index
SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0);
MIN( a )
NULL
@ -2829,7 +2829,7 @@ EXPLAIN
SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0);
id select_type table type possible_keys key key_len ref rows Extra
x x x x x x x x x Impossible WHERE noticed after reading const tables
x x x x x x x x x Using index
x x x x x x x x x Using where; Using index
SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0);
MIN( a )
NULL
@ -2908,7 +2908,7 @@ EXPLAIN
SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0);
id select_type table type possible_keys key key_len ref rows Extra
x x x x x x x x x Impossible WHERE noticed after reading const tables
x x x x x x x x x Using index
x x x x x x x x x Using where; Using index
SELECT MIN( a ) FROM t1 WHERE a = (SELECT a FROM t1 WHERE a < 0);
MIN( a )
NULL

View File

@ -777,4 +777,19 @@ commit;
select * from t1 where t1.zone_id=830 AND modified=9;
pk zone_id modified
drop table t0, t1;
#
# MDEV-376: Wrong result (missing rows) with index_merge+index_merge_intersection, join
#
CREATE TABLE t1 (
a INT, b CHAR(1), c CHAR(1), KEY(a), KEY(b)
) ENGINE=InnoDB;
INSERT INTO t1 VALUES (8,'v','v'),(8,'m','m'),(9,'d','d');
SELECT ta.* FROM t1 AS ta, t1 AS tb
WHERE ( tb.b != ta.b OR tb.a = ta.a )
AND ( tb.b = ta.c OR tb.b = ta.b );
a b c
8 v v
8 m m
9 d d
DROP TABLE t1;
set optimizer_switch= @optimizer_switch_save;

View File

@ -599,7 +599,7 @@ EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE
(SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) > 12;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t1 index NULL a 10 NULL 15 Using index
2 SUBQUERY t1 range NULL a 5 NULL 8 Using index for group-by
SELECT 1 as RES FROM t1 AS t1_outer WHERE
(SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) > 12;
RES

View File

@ -679,7 +679,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1 Using temporary
1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Distinct
2 SUBQUERY t3 ALL NULL NULL NULL NULL 3
2 SUBQUERY t2 ALL NULL NULL NULL NULL 3
2 SUBQUERY t2 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
SELECT DISTINCT a AS field1 FROM t1, t2
WHERE EXISTS (SELECT c FROM t3 LEFT JOIN t2 ON b = d)
HAVING field1 > 'aaa' LIMIT ROWS EXAMINED 20;

View File

@ -0,0 +1,14 @@
SET GLOBAL log_warnings=4;
SET GLOBAL max_connections=2;
SELECT 1;
1
1
SELECT 2;
2
2
ERROR HY000: Too many connections
SELECT 0;
0
0
SET GLOBAL log_warnings=default;
SET GLOBAL max_connections=default;

View File

@ -34,7 +34,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
INSERT INTO t1 VALUES (1)
/*!*/;
@ -65,7 +65,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
use foo/*!*/;
use `foo`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
INSERT INTO t1 VALUES (1)
/*!*/;

View File

@ -18,7 +18,7 @@ flush logs;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@ -111,7 +111,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
/*!*/;
@ -202,7 +202,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
insert into t1 values ("Alas")
/*!*/;
@ -219,7 +219,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@ -312,7 +312,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
/*!*/;
@ -403,7 +403,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
insert into t1 values ("Alas")
/*!*/;
@ -427,7 +427,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1108844555/*!*/;
insert t1 values (1)
/*!*/;
@ -445,7 +445,7 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1108844555/*!*/;
insert t1 values (1)
/*!*/;
@ -498,7 +498,7 @@ ERROR 42000: PROCEDURE test.p1 does not exist
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@ -548,7 +548,7 @@ flush logs;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@ -725,7 +725,7 @@ FLUSH LOGS;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1253783037/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@ -825,7 +825,7 @@ BEGIN
SET TIMESTAMP=1266652094/*!*/;
SavePoint mixed_cases
/*!*/;
use db1/*!*/;
use `db1`/*!*/;
SET TIMESTAMP=1266652094/*!*/;
INSERT INTO db1.t2 VALUES("in savepoint mixed_cases")
/*!*/;

View File

@ -19,7 +19,7 @@ insert into t1 values(null, "f");
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@ -103,7 +103,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
SET INSERT_ID=1/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")
/*!*/;
@ -172,7 +172,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
SET INSERT_ID=3/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")
/*!*/;
@ -209,7 +209,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@ -263,7 +263,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
SET INSERT_ID=3/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")
/*!*/;
@ -289,7 +289,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
SET INSERT_ID=3/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")
/*!*/;
@ -326,7 +326,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@ -369,7 +369,7 @@ flush logs;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@ -445,7 +445,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
SET INSERT_ID=6/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609943/*!*/;
insert into t1 values(null, "f")
/*!*/;
@ -474,7 +474,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
SET INSERT_ID=1/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")
/*!*/;
@ -535,7 +535,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
SET INSERT_ID=6/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609943/*!*/;
insert into t1 values(null, "f")
/*!*/;
@ -564,7 +564,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
SET INSERT_ID=3/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")
/*!*/;
@ -605,7 +605,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
SET INSERT_ID=6/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609943/*!*/;
insert into t1 values(null, "f")
/*!*/;
@ -622,7 +622,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@ -720,7 +720,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
SET INSERT_ID=3/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")
/*!*/;
@ -761,7 +761,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
SET INSERT_ID=6/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609943/*!*/;
insert into t1 values(null, "f")
/*!*/;
@ -778,7 +778,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@ -820,7 +820,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@ -904,7 +904,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
SET INSERT_ID=1/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")
/*!*/;
@ -972,7 +972,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
SET INSERT_ID=3/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")
/*!*/;
@ -1009,7 +1009,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@ -1062,7 +1062,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
SET INSERT_ID=3/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")
/*!*/;
@ -1088,7 +1088,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
SET INSERT_ID=3/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")
/*!*/;
@ -1125,7 +1125,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@ -1167,7 +1167,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@ -1243,7 +1243,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
SET INSERT_ID=6/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609943/*!*/;
insert into t1 values(null, "f")
/*!*/;
@ -1272,7 +1272,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
SET INSERT_ID=1/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")
/*!*/;
@ -1333,7 +1333,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
SET INSERT_ID=6/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609943/*!*/;
insert into t1 values(null, "f")
/*!*/;
@ -1361,7 +1361,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
SET INSERT_ID=3/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")
/*!*/;
@ -1402,7 +1402,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
SET INSERT_ID=6/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609943/*!*/;
insert into t1 values(null, "f")
/*!*/;
@ -1419,7 +1419,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@ -1516,7 +1516,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
SET INSERT_ID=3/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")
/*!*/;
@ -1557,7 +1557,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
SET INSERT_ID=6/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609943/*!*/;
insert into t1 values(null, "f")
/*!*/;
@ -1574,7 +1574,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@ -1616,7 +1616,7 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;

View File

@ -336,7 +336,7 @@ DELIMITER /*!*/;
ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;

View File

@ -2253,7 +2253,7 @@ DELIMITER /*!*/;
ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@ -3876,7 +3876,7 @@ DELIMITER /*!*/;
ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@ -4243,7 +4243,7 @@ DELIMITER /*!*/;
ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@ -4804,7 +4804,7 @@ DELIMITER /*!*/;
ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;

View File

@ -2253,7 +2253,7 @@ DELIMITER /*!*/;
ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@ -3898,7 +3898,7 @@ DELIMITER /*!*/;
ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@ -4271,7 +4271,7 @@ DELIMITER /*!*/;
ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@ -4842,7 +4842,7 @@ DELIMITER /*!*/;
ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;

View File

@ -132,7 +132,7 @@ DELIMITER /*!*/;
ROLLBACK/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;

View File

@ -697,7 +697,7 @@ The following options may be given as the first argument:
partial matching
--rpl-recovery-rank=#
Unused, will be removed
--safe-mode Skip some optimize stages (for testing).
--safe-mode Skip some optimize stages (for testing). Deprecated.
--safe-user-create Don't allow new user creation by the user who has no
write privileges to the mysql.user table.
--secure-auth Disallow authentication for accounts that have old
@ -737,6 +737,9 @@ The following options may be given as the first argument:
--slave-load-tmpdir=name
The location where the slave should put its temporary
files when replicating a LOAD DATA INFILE command
--slave-max-allowed-packet=#
The maximum packet length to sent successfully from the
master to slave.
--slave-net-timeout=#
Number of seconds to wait for more data from a
master/slave connection before aborting the read
@ -1057,6 +1060,7 @@ skip-show-database FALSE
skip-slave-start FALSE
slave-compressed-protocol FALSE
slave-exec-mode STRICT
slave-max-allowed-packet 1073741824
slave-net-timeout 3600
slave-skip-errors (No default value)
slave-sql-verify-checksum TRUE

View File

@ -2073,7 +2073,7 @@ DROP TABLE IF EXISTS `v2`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v2` (
`a` varchar(30)
`a` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
/*!50001 DROP TABLE IF EXISTS `v2`*/;
@ -2167,7 +2167,7 @@ DROP TABLE IF EXISTS `v1`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v1` (
`a` int(11)
`a` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
/*!50001 DROP TABLE IF EXISTS `v1`*/;
@ -2241,7 +2241,7 @@ DROP TABLE IF EXISTS `v2`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v2` (
`a` varchar(30)
`a` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
/*!50001 DROP TABLE IF EXISTS `v2`*/;
@ -2355,9 +2355,9 @@ DROP TABLE IF EXISTS `v1`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v1` (
`a` int(11),
`b` int(11),
`c` varchar(30)
`a` tinyint NOT NULL,
`b` tinyint NOT NULL,
`c` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `v2`;
@ -2365,7 +2365,7 @@ DROP TABLE IF EXISTS `v2`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v2` (
`a` int(11)
`a` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `v3`;
@ -2373,9 +2373,9 @@ DROP TABLE IF EXISTS `v3`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v3` (
`a` int(11),
`b` int(11),
`c` varchar(30)
`a` tinyint NOT NULL,
`b` tinyint NOT NULL,
`c` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
/*!50001 DROP TABLE IF EXISTS `v1`*/;
@ -3112,9 +3112,9 @@ DROP TABLE IF EXISTS `v0`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v0` (
`a` int(11),
`b` varchar(32),
`c` varchar(32)
`a` tinyint NOT NULL,
`b` tinyint NOT NULL,
`c` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `v1`;
@ -3122,9 +3122,9 @@ DROP TABLE IF EXISTS `v1`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v1` (
`a` int(11),
`b` varchar(32),
`c` varchar(32)
`a` tinyint NOT NULL,
`b` tinyint NOT NULL,
`c` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
DROP TABLE IF EXISTS `v2`;
@ -3132,9 +3132,9 @@ DROP TABLE IF EXISTS `v2`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v2` (
`a` int(11),
`b` varchar(32),
`c` varchar(32)
`a` tinyint NOT NULL,
`b` tinyint NOT NULL,
`c` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
@ -3514,7 +3514,7 @@ DROP TABLE IF EXISTS `v1`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v1` (
`id` int(11)
`id` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
@ -3574,7 +3574,7 @@ USE `mysqldump_views`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `nasishnasifu` (
`id` bigint(20) unsigned
`id` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
@ -3967,7 +3967,7 @@ DROP TABLE IF EXISTS `v2`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v2` (
`c` int(11)
`c` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
/*!50001 DROP TABLE IF EXISTS `v2`*/;
@ -4384,7 +4384,7 @@ DROP TABLE IF EXISTS `v1`;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `v1` (
`id` int(11)
`id` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;

View File

@ -690,6 +690,7 @@ Got one of the listed errors
insert into t1 values ("Abcd");
Got one of the listed errors
garbage;
SELECT * FROM non_existing_table;
drop table t2;
create table t1 ( f1 char(10));
insert into t1 values ("Abcd");

View File

@ -1813,3 +1813,135 @@ Warnings:
Note 1003 select `test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t2`.`a` = `test`.`t1`.`b`) group by `test`.`t2`.`b` order by `test`.`t1`.`b`
drop table t1,t2;
End of 5.2 tests
#
# Bug mdev-449: ORDER BY with small sort_buffer_size
#
CREATE TABLE t1(f0 int auto_increment primary key, f1 int, f2 varchar(200));
INSERT INTO t1(f1, f2) VALUES
(0,"0"),(1,"1"),(2,"2"),(3,"3"),(4,"4"),(5,"5"),
(6,"6"),(7,"7"),(8,"8"),(9,"9"),(10,"10"),
(11,"11"),(12,"12"),(13,"13"),(14,"14"),(15,"15"),
(16,"16"),(17,"17"),(18,"18"),(19,"19"),(20,"20"),
(21,"21"),(22,"22"),(23,"23"),(24,"24"),(25,"25"),
(26,"26"),(27,"27"),(28,"28"),(29,"29"),(30,"30"),
(31,"31"),(32,"32"),(33,"33"),(34,"34"),(35,"35"),
(36,"36"),(37,"37"),(38,"38"),(39,"39"),(40,"40"),
(41,"41"),(42,"42"),(43,"43"),(44,"44"),(45,"45"),
(46,"46"),(47,"47"),(48,"48"),(49,"49"),(50,"50"),
(51,"51"),(52,"52"),(53,"53"),(54,"54"),(55,"55"),
(56,"56"),(57,"57"),(58,"58"),(59,"59"),(60,"60"),
(61,"61"),(62,"62"),(63,"63"),(64,"64"),(65,"65"),
(66,"66"),(67,"67"),(68,"68"),(69,"69"),(70,"70"),
(71,"71"),(72,"72"),(73,"73"),(74,"74"),(75,"75"),
(76,"76"),(77,"77"),(78,"78"),(79,"79"),(80,"80"),
(81,"81"),(82,"82"),(83,"83"),(84,"84"),(85,"85"),
(86,"86"),(87,"87"),(88,"88"),(89,"89"),(90,"90"),
(91,"91"),(92,"92"),(93,"93"),(94,"94"),(95,"95"),
(96,"96"),(97,"97"),(98,"98"),(99,"99");
set @save_sort_buffer_size= @@sort_buffer_size;
set sort_buffer_size= 2000;
SELECT * FROM t1 ORDER BY f1 DESC, f0;
f0 f1 f2
100 99 99
99 98 98
98 97 97
97 96 96
96 95 95
95 94 94
94 93 93
93 92 92
92 91 91
91 90 90
90 89 89
89 88 88
88 87 87
87 86 86
86 85 85
85 84 84
84 83 83
83 82 82
82 81 81
81 80 80
80 79 79
79 78 78
78 77 77
77 76 76
76 75 75
75 74 74
74 73 73
73 72 72
72 71 71
71 70 70
70 69 69
69 68 68
68 67 67
67 66 66
66 65 65
65 64 64
64 63 63
63 62 62
62 61 61
61 60 60
60 59 59
59 58 58
58 57 57
57 56 56
56 55 55
55 54 54
54 53 53
53 52 52
52 51 51
51 50 50
50 49 49
49 48 48
48 47 47
47 46 46
46 45 45
45 44 44
44 43 43
43 42 42
42 41 41
41 40 40
40 39 39
39 38 38
38 37 37
37 36 36
36 35 35
35 34 34
34 33 33
33 32 32
32 31 31
31 30 30
30 29 29
29 28 28
28 27 27
27 26 26
26 25 25
25 24 24
24 23 23
23 22 22
22 21 21
21 20 20
20 19 19
19 18 18
18 17 17
17 16 16
16 15 15
15 14 14
14 13 13
13 12 12
12 11 11
11 10 10
10 9 9
9 8 8
8 7 7
7 6 6
6 5 5
5 4 4
4 3 3
3 2 2
2 1 1
1 0 0
set sort_buffer_size= @save_sort_buffer_size;
DROP TABLE t1;
End of 5.3 tests

View File

@ -2473,3 +2473,17 @@ SELECT * FROM vtmp;
1
DROP VIEW vtmp;
DROP TABLE t1;
#
# MDEV-365 "Got assertion when doing alter table on a partition"
#
CREATE TABLE t1 ( i INT ) ENGINE=Aria PARTITION BY HASH(i) PARTITIONS 2;
INSERT INTO t1 VALUES (1),(2),(2),(3),(4);
ALTER TABLE t1 ADD PARTITION PARTITIONS 2;
SELECT * from t1 order by i;
i
1
2
2
3
4
DROP TABLE t1;

View File

@ -27,7 +27,7 @@ a
3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
Qcache_queries_in_cache 1
drop table t1;
commit;
create table t1 (a int not null) PARTITION BY KEY (a) PARTITIONS 3;
@ -50,7 +50,7 @@ a
2
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
Qcache_queries_in_cache 3
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 0
@ -69,7 +69,7 @@ a
2
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
Qcache_queries_in_cache 6
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 0
@ -93,14 +93,14 @@ a
2
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 0
Qcache_hits 1
commit;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
Qcache_queries_in_cache 2
drop table t3,t2,t1;
CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) PARTITION BY HASH (id) PARTITIONS 3;
select count(*) from t1;
@ -164,7 +164,7 @@ count(*)
2
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
Qcache_queries_in_cache 1
connection connection1
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
@ -197,9 +197,9 @@ count(*)
2
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
Qcache_queries_in_cache 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 0
Qcache_hits 1
set @@global.query_cache_size = @save_query_cache_size;
drop table t2;

View File

@ -0,0 +1,151 @@
SET SESSION STORAGE_ENGINE = innodb;
drop table if exists t1;
set @save_query_cache_size = @@global.query_cache_size;
# Test that partitions works with query cache
flush query cache;
SET GLOBAL query_cache_size=1024*1024*512;
CREATE TABLE `t1` (
`id` int(11) NOT NULL ,
`created_at` datetime NOT NULL,
`cool` tinyint default 0
);
ALTER TABLE t1 PARTITION BY RANGE (TO_DAYS(created_at)) (
PARTITION month_2010_4 VALUES LESS THAN (734258),
PARTITION month_2010_5 VALUES LESS THAN (734289),
PARTITION month_max VALUES LESS THAN MAXVALUE
);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`cool` tinyint(4) DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (TO_DAYS(created_at))
(PARTITION month_2010_4 VALUES LESS THAN (734258) ENGINE = InnoDB,
PARTITION month_2010_5 VALUES LESS THAN (734289) ENGINE = InnoDB,
PARTITION month_max VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
INSERT INTO t1 VALUES (1, now(), 0);
flush status;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 0
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
cool
0
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
cool
0
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
cool
0
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 2
drop table t1;
# Test that sub-partitions works with query cache
flush query cache;
SET GLOBAL query_cache_size=1024*1024*512;
CREATE TABLE `t1` (
`id` int(11) NOT NULL ,
`created_at` datetime NOT NULL,
`cool` tinyint default 0
)
PARTITION BY RANGE (TO_DAYS(created_at))
subpartition by hash(cool) subpartitions 3 (
PARTITION month_2010_4 VALUES LESS THAN (734258),
PARTITION month_2010_5 VALUES LESS THAN (734289),
PARTITION month_max VALUES LESS THAN MAXVALUE
);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`cool` tinyint(4) DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (TO_DAYS(created_at))
SUBPARTITION BY HASH (cool)
SUBPARTITIONS 3
(PARTITION month_2010_4 VALUES LESS THAN (734258) ENGINE = InnoDB,
PARTITION month_2010_5 VALUES LESS THAN (734289) ENGINE = InnoDB,
PARTITION month_max VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
INSERT INTO t1 VALUES (1, now(), 0);
flush status;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 0
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
cool
0
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
cool
0
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
cool
0
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 2
drop table t1;
#
# MySQL bug#53775 Query on partitioned table returns cached result
# from previous transaction
#
flush query cache;
flush status;
SET GLOBAL query_cache_size=1024*1024*512;
CREATE TABLE `t1` (
`id` int(11) NOT NULL ,
`created_at` datetime NOT NULL,
`cool` tinyint default 0
);
ALTER TABLE t1 PARTITION BY RANGE (TO_DAYS(created_at)) (
PARTITION month_2010_4 VALUES LESS THAN (734258),
PARTITION month_2010_5 VALUES LESS THAN (734289),
PARTITION month_max VALUES LESS THAN MAXVALUE
);
INSERT INTO t1 VALUES (1, now(), 0);
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 0
BEGIN;
UPDATE `t1` SET `cool` = 1 WHERE `id` = 1;
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
cool
1
ROLLBACK;
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
cool
0
BEGIN;
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
cool
0
ROLLBACK;
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
cool
0
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 1
drop table t1;
set @@global.query_cache_size = @save_query_cache_size;

View File

@ -0,0 +1,153 @@
SET SESSION STORAGE_ENGINE = myisam;
drop table if exists t1;
set @save_query_cache_size = @@global.query_cache_size;
# Test that partitions works with query cache
flush query cache;
SET GLOBAL query_cache_size=1024*1024*512;
CREATE TABLE `t1` (
`id` int(11) NOT NULL ,
`created_at` datetime NOT NULL,
`cool` tinyint default 0
);
ALTER TABLE t1 PARTITION BY RANGE (TO_DAYS(created_at)) (
PARTITION month_2010_4 VALUES LESS THAN (734258),
PARTITION month_2010_5 VALUES LESS THAN (734289),
PARTITION month_max VALUES LESS THAN MAXVALUE
);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`cool` tinyint(4) DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (TO_DAYS(created_at))
(PARTITION month_2010_4 VALUES LESS THAN (734258) ENGINE = MyISAM,
PARTITION month_2010_5 VALUES LESS THAN (734289) ENGINE = MyISAM,
PARTITION month_max VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
INSERT INTO t1 VALUES (1, now(), 0);
flush status;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 0
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
cool
0
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
cool
0
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
cool
0
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 2
drop table t1;
# Test that sub-partitions works with query cache
flush query cache;
SET GLOBAL query_cache_size=1024*1024*512;
CREATE TABLE `t1` (
`id` int(11) NOT NULL ,
`created_at` datetime NOT NULL,
`cool` tinyint default 0
)
PARTITION BY RANGE (TO_DAYS(created_at))
subpartition by hash(cool) subpartitions 3 (
PARTITION month_2010_4 VALUES LESS THAN (734258),
PARTITION month_2010_5 VALUES LESS THAN (734289),
PARTITION month_max VALUES LESS THAN MAXVALUE
);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` int(11) NOT NULL,
`created_at` datetime NOT NULL,
`cool` tinyint(4) DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (TO_DAYS(created_at))
SUBPARTITION BY HASH (cool)
SUBPARTITIONS 3
(PARTITION month_2010_4 VALUES LESS THAN (734258) ENGINE = MyISAM,
PARTITION month_2010_5 VALUES LESS THAN (734289) ENGINE = MyISAM,
PARTITION month_max VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
INSERT INTO t1 VALUES (1, now(), 0);
flush status;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 0
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
cool
0
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
cool
0
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
cool
0
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 2
drop table t1;
#
# MySQL bug#53775 Query on partitioned table returns cached result
# from previous transaction
#
flush query cache;
flush status;
SET GLOBAL query_cache_size=1024*1024*512;
CREATE TABLE `t1` (
`id` int(11) NOT NULL ,
`created_at` datetime NOT NULL,
`cool` tinyint default 0
);
ALTER TABLE t1 PARTITION BY RANGE (TO_DAYS(created_at)) (
PARTITION month_2010_4 VALUES LESS THAN (734258),
PARTITION month_2010_5 VALUES LESS THAN (734289),
PARTITION month_max VALUES LESS THAN MAXVALUE
);
INSERT INTO t1 VALUES (1, now(), 0);
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 0
BEGIN;
UPDATE `t1` SET `cool` = 1 WHERE `id` = 1;
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
cool
1
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
cool
1
BEGIN;
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
cool
1
ROLLBACK;
SELECT cool FROM `t1` WHERE (`t1`.id = 1) LIMIT 1;
cool
1
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 2
drop table t1;
set @@global.query_cache_size = @save_query_cache_size;

View File

@ -3056,7 +3056,7 @@ DROP TABLE t1;
End of 5.1 tests.
#
# LP bug#1001500 Crash on the second execution of the PS for
# lp:1001500 Crash on the second execution of the PS for
# a query with degenerated conjunctive condition
# (see also mysql bug#12582849)
#
@ -3996,108 +3996,4 @@ Handler_read_rnd_deleted 0
Handler_read_rnd_next 0
deallocate prepare st;
drop table t1;
#
# LP bug#993459 Execution of PS for a query with GROUP BY
# returns wrong result (see also mysql bug#13805127)
#
PREPARE s1 FROM
"
SELECT c1, t2.c2, count(c3)
FROM
(
SELECT 3 as c2 FROM dual WHERE @x = 1
UNION
SELECT 2 FROM dual WHERE @x = 1 OR @x = 2
) AS t1,
(
SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual
UNION
SELECT '2012-03-01 02:00:00', 3, 2 FROM dual
UNION
SELECT '2012-03-01 01:00:00', 2, 1 FROM dual
) AS t2
WHERE t2.c2 = t1.c2
GROUP BY c1, c2
";
SET @x = 1;
SELECT c1, t2.c2, count(c3)
FROM
(
SELECT 3 as c2 FROM dual WHERE @x = 1
UNION
SELECT 2 FROM dual WHERE @x = 1 OR @x = 2
) AS t1,
(
SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual
UNION
SELECT '2012-03-01 02:00:00', 3, 2 FROM dual
UNION
SELECT '2012-03-01 01:99345900:00', 2, 1 FROM dual
) AS t2
WHERE t2.c2 = t1.c2
GROUP BY c1, c2;
c1 c2 count(c3)
2012-03-01 01:00:00 3 1
2012-03-01 01:99345900:00 2 1
2012-03-01 02:00:00 3 1
EXECUTE s1;
c1 c2 count(c3)
2012-03-01 01:00:00 2 1
2012-03-01 01:00:00 3 1
2012-03-01 02:00:00 3 1
SET @x = 2;
SELECT c1, t2.c2, count(c3)
FROM
(
SELECT 3 as c2 FROM dual WHERE @x = 1
UNION
SELECT 2 FROM dual WHERE @x = 1 OR @x = 2
) AS t1,
(
SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual
UNION
SELECT '2012-03-01 02:00:00', 3, 2 FROM dual
UNION
SELECT '2012-03-01 01:00:00', 2, 1 FROM dual
) AS t2
WHERE t2.c2 = t1.c2
GROUP BY c1, c2;
c1 c2 count(c3)
2012-03-01 01:00:00 2 1
EXECUTE s1;
c1 c2 count(c3)
2012-03-01 01:00:00 2 1
SET @x = 1;
SELECT c1, t2.c2, count(c3)
FROM
(
SELECT 3 as c2 FROM dual WHERE @x = 1
UNION
SELECT 2 FROM dual WHERE @x = 1 OR @x = 2
) AS t1,
(
SELECT '2012-03-01 01:00:00' AS c1, 3 as c2, 1 as c3 FROM dual
UNION
SELECT '2012-03-01 02:00:00', 3, 2 FROM dual
UNION
SELECT '2012-03-01 01:00:00', 2, 1 FROM dual
) AS t2
WHERE t2.c2 = t1.c2
GROUP BY c1, c2;
c1 c2 count(c3)
2012-03-01 01:00:00 2 1
2012-03-01 01:00:00 3 1
2012-03-01 02:00:00 3 1
EXECUTE s1;
c1 c2 count(c3)
2012-03-01 01:00:00 2 1
2012-03-01 01:00:00 3 1
2012-03-01 02:00:00 3 1
DEALLOCATE PREPARE s1;
# End of 5.3 tests

View File

@ -7811,9 +7811,12 @@ DROP FUNCTION f1;
# -- End of 5.1 tests
# ------------------------------------------------------------------
#
# LP bug#993459 Execution of PS for a query with GROUP BY
# lp:993459 Execution of PS for a query with GROUP BY
# returns wrong result (see also mysql bug#13805127)
#
# Bug#13805127: Stored program cache produces wrong result in same THD
CREATE PROCEDURE p1(x INT UNSIGNED)
BEGIN
SELECT c1, t2.c2, count(c3)
@ -7850,7 +7853,7 @@ c1 c2 count(c3)
2012-03-01 02:00:00 3 1
DROP PROCEDURE p1;
#
# LP bug#1002157 : testing stored function
# lp:1002157 : testing stored function
# bug#62125 result for null incorrectly yields 1292 warning.
#
DROP FUNCTION IF EXISTS f1;

View File

@ -4196,7 +4196,7 @@ INSERT INTO t1 VALUES (1,1),(2,1);
EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ref a a 5 const 1 Using where; Using index
2 SUBQUERY internal_tmp_table ALL group_key NULL NULL NULL 1 Using temporary; Using filesort
2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
DROP TABLE t1;
CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id));
INSERT INTO t1 VALUES
@ -5966,7 +5966,7 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4
2 SUBQUERY t1 ref a a 5 const 1
2 SUBQUERY t1 ref a a 5 const 1 Using index
DROP TABLE t1;
#
# BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS)
@ -6127,7 +6127,7 @@ set optimizer_switch=@tmp_optimizer_switch;
EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4
2 SUBQUERY t1 ref a a 5 const 1
2 SUBQUERY t1 ref a a 5 const 1 Using index
DROP TABLE t1;
#
@ -6612,7 +6612,33 @@ SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 U
min_a a
drop table t1;
#
# LP BUG#944706 Query with impossible or constant subquery in WHERE or HAVING is not
# MDEV-367: Different results with and without subquery_cache on
# a query with a constant NOT IN condition
#
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2),(3);
set @mdev367_optimizer_switch = @@optimizer_switch;
set optimizer_switch = 'subquery_cache=on';
SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100;
a
SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1;
a ( 3, 3 ) NOT IN ( SELECT NULL, NULL )
1 NULL
2 NULL
3 NULL
set optimizer_switch=@mdev367_optimizer_switch;
set optimizer_switch = 'subquery_cache=off';
SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100;
a
SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1;
a ( 3, 3 ) NOT IN ( SELECT NULL, NULL )
1 NULL
2 NULL
3 NULL
set optimizer_switch=@mdev367_optimizer_switch;
DROP TABLE t1;
#
# lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not
# precomputed and thus not part of optimization
#
CREATE TABLE t1 ( a VARCHAR(16), KEY (a) );
@ -6768,5 +6794,68 @@ id select_type table type possible_keys key key_len ref rows Extra
SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1));
a
drop table t1,t2;
# return optimizer switch changed in the beginning of this test
set optimizer_switch=@subselect_tmp;
#
# MDEV-410: EXPLAIN shows type=range, while SHOW EXPLAIN and userstat show full table scan is used
#
CREATE TABLE t1 (a VARCHAR(3) PRIMARY KEY) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('USA');
CREATE TABLE t2 (b INT, c VARCHAR(52), KEY(b)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (3813,'United States'),(3940,'Russia');
CREATE TABLE t3 (d INT, KEY(d)) ENGINE=MyISAM;
INSERT INTO t3 VALUES (12),(22),(9),(45);
create table t4 like t3;
insert into t4 select * from t3;
# This should not show range access for table t2
explain
SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1
WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where
1 PRIMARY t3 ref d d 5 test.t2.b 2 Using where; Using index
3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
set @tmp_mdev410=@@global.userstat;
set global userstat=on;
flush table_statistics;
flush index_statistics;
SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1
WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 );
MIN(b)
NULL
# The following shows that t2 was indeed scanned with a full scan.
show table_statistics;
Table_schema Table_name Rows_read Rows_changed Rows_changed_x_#indexes
test t1 2 0 0
test t2 3 0 0
show index_statistics;
Table_schema Table_name Index_name Rows_read
test t2 b 1
set global userstat=@tmp_mdev410;
DROP TABLE t1,t2,t3,t4;
#
# MDEV-430: Server crashes in select_describe on EXPLAIN with
# materialization+semijoin, 2 nested subqueries, aggregate functions
#
CREATE TABLE t1 (a INT, KEY(a));
INSERT INTO t1 VALUES (1),(8);
CREATE TABLE t2 (b INT, KEY(b));
INSERT INTO t2 VALUES (45),(17),(20);
EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;
#
# MDEV-405: Server crashes in test_if_skip_sort_order on EXPLAIN with GROUP BY and HAVING in EXISTS subquery
#
CREATE TABLE t1 (a INT, KEY(a));
INSERT INTO t1 VALUES (1),(8);
CREATE TABLE t2 (b INT, KEY(b));
INSERT INTO t2 VALUES (45),(17),(20);
EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;

View File

@ -161,18 +161,18 @@ SET optimizer_switch='materialization=on,in_to_exists=on';
EXPLAIN
SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM t1) OR a = b;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 index a a 5 NULL 2 Using index
1 PRIMARY t3 index b b 5 NULL 4 Using where; Using index; Using join buffer (flat, BNL join)
2 MATERIALIZED t1 index PRIMARY,a a 5 NULL 2 Using index
1 PRIMARY t2 index a a 5 NULL 2 Using where; Using index
1 PRIMARY t3 ref b b 5 test.t2.a 2 Using index
2 SUBQUERY t1 index_subquery PRIMARY,a a 5 const 0 Using index; Using where
SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM t1) OR a = b;
pk a b
0 4 4
EXPLAIN
SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM v1) OR a = b;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 index a a 5 NULL 2 Using index
1 PRIMARY t3 index b b 5 NULL 4 Using where; Using index; Using join buffer (flat, BNL join)
2 MATERIALIZED t1 index PRIMARY,a a 5 NULL 2 Using index
1 PRIMARY t2 index a a 5 NULL 2 Using where; Using index
1 PRIMARY t3 ref b b 5 test.t2.a 2 Using index
2 SUBQUERY t1 index_subquery PRIMARY,a a 5 const 0 Using index; Using where
SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM v1) OR a = b;
pk a b
0 4 4

View File

@ -627,51 +627,51 @@ SET @@optimizer_switch = 'materialization=on,in_to_exists=off,semijoin=off';
EXPLAIN
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4) FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2 MATERIALIZED t2 system NULL NULL NULL NULL 0 const row not found
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4) FROM t2);
f1 f2
EXPLAIN
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3+f4, min(f4) FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2 MATERIALIZED t2 system NULL NULL NULL NULL 0 const row not found
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3+f4, min(f4) FROM t2);
f1 f2
EXPLAIN
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4)+max(f4) FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2 MATERIALIZED t2 system NULL NULL NULL NULL 0 const row not found
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4)+max(f4) FROM t2);
f1 f2
EXPLAIN
SELECT (2, 0) NOT IN (SELECT f3, min(f4) FROM t2) as not_in;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
SELECT (2, 0) NOT IN (SELECT f3, min(f4) FROM t2) as not_in;
not_in
NULL
EXPLAIN
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, count(f4) FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2 MATERIALIZED t2 system NULL NULL NULL NULL 0 const row not found
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, count(f4) FROM t2);
f1 f2
EXPLAIN
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, f3 + count(f4) FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2 MATERIALIZED t2 system NULL NULL NULL NULL 0 const row not found
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, f3 + count(f4) FROM t2);
f1 f2
EXPLAIN
SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2) as not_in;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2) as not_in;
not_in
NULL
@ -679,7 +679,7 @@ EXPLAIN
SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 HAVING max(f4) > 7) as not_in;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 HAVING max(f4) > 7) as not_in;
not_in
1
@ -687,7 +687,7 @@ EXPLAIN
SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 HAVING max(f4) is null) as not_in;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 HAVING max(f4) is null) as not_in;
not_in
NULL
@ -695,7 +695,7 @@ EXPLAIN
SELECT (2, 0) NOT IN (SELECT max(f3+f3), count(f4) FROM t2) as not_in;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
SELECT (2, 0) NOT IN (SELECT max(f3+f3), count(f4) FROM t2) as not_in;
not_in
NULL
@ -703,7 +703,7 @@ EXPLAIN
SELECT (2, 0) NOT IN (SELECT max(f3+f3), count(f4)+f3 FROM t2) as not_in;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
SELECT (2, 0) NOT IN (SELECT max(f3+f3), count(f4)+f3 FROM t2) as not_in;
not_in
NULL
@ -718,51 +718,51 @@ SET @@optimizer_switch = 'materialization=off,in_to_exists=on,semijoin=off';
EXPLAIN
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4) FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4) FROM t2);
f1 f2
EXPLAIN
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3+f4, min(f4) FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3+f4, min(f4) FROM t2);
f1 f2
EXPLAIN
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4)+max(f4) FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4)+max(f4) FROM t2);
f1 f2
EXPLAIN
SELECT (2, 0) NOT IN (SELECT f3, min(f4) FROM t2) as not_in;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
SELECT (2, 0) NOT IN (SELECT f3, min(f4) FROM t2) as not_in;
not_in
NULL
EXPLAIN
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, count(f4) FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, count(f4) FROM t2);
f1 f2
EXPLAIN
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, f3 + count(f4) FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, f3 + count(f4) FROM t2);
f1 f2
EXPLAIN
SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2) as not_in;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2) as not_in;
not_in
NULL
@ -770,7 +770,7 @@ EXPLAIN
SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 HAVING max(f4) > 7) as not_in;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 HAVING max(f4) > 7) as not_in;
not_in
1
@ -778,7 +778,7 @@ EXPLAIN
SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 HAVING max(f4) is null) as not_in;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
SELECT (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 HAVING max(f4) is null) as not_in;
not_in
NULL
@ -786,7 +786,7 @@ EXPLAIN
SELECT (2, 0) NOT IN (SELECT max(f3+f3), count(f4) FROM t2) as not_in;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
SELECT (2, 0) NOT IN (SELECT max(f3+f3), count(f4) FROM t2) as not_in;
not_in
NULL
@ -794,7 +794,7 @@ EXPLAIN
SELECT (2, 0) NOT IN (SELECT max(f3+f3), count(f4)+f3 FROM t2) as not_in;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
SELECT (2, 0) NOT IN (SELECT max(f3+f3), count(f4)+f3 FROM t2) as not_in;
not_in
NULL
@ -813,21 +813,21 @@ SET @@optimizer_switch = 'materialization=on,in_to_exists=off,semijoin=off';
EXPLAIN
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4) FROM t2 WHERE f3 > 10);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 MATERIALIZED t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4) FROM t2 WHERE f3 > 10);
f1 f2
EXPLAIN
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3+f4, min(f4) FROM t2 WHERE f3 > 10);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 MATERIALIZED t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3+f4, min(f4) FROM t2 WHERE f3 > 10);
f1 f2
EXPLAIN
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4)+max(f4) FROM t2 WHERE f3 > 10);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 MATERIALIZED t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4)+max(f4) FROM t2 WHERE f3 > 10);
f1 f2
@ -842,14 +842,14 @@ NULL
EXPLAIN
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 WHERE f3 > 10);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 MATERIALIZED t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 WHERE f3 > 10);
f1 f2
EXPLAIN
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, f3 + count(f4) FROM t2 WHERE f3 > 10);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 MATERIALIZED t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, f3 + count(f4) FROM t2 WHERE f3 > 10);
f1 f2
@ -904,21 +904,21 @@ SET @@optimizer_switch = 'materialization=off,in_to_exists=on,semijoin=off';
EXPLAIN
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4) FROM t2 WHERE f3 > 10);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4) FROM t2 WHERE f3 > 10);
f1 f2
EXPLAIN
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3+f4, min(f4) FROM t2 WHERE f3 > 10);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3+f4, min(f4) FROM t2 WHERE f3 > 10);
f1 f2
EXPLAIN
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4)+max(f4) FROM t2 WHERE f3 > 10);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, min(f4)+max(f4) FROM t2 WHERE f3 > 10);
f1 f2
@ -933,14 +933,14 @@ NULL
EXPLAIN
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 WHERE f3 > 10);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, count(f4) FROM t2 WHERE f3 > 10);
f1 f2
EXPLAIN
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, f3 + count(f4) FROM t2 WHERE f3 > 10);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t2 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan
SELECT * FROM t1 WHERE (2, 0) NOT IN (SELECT f3, f3 + count(f4) FROM t2 WHERE f3 > 10);
f1 f2

View File

@ -333,7 +333,7 @@ WHERE (SELECT DISTINCT b FROM t3) > 0);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 Using where; Using index
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
3 SUBQUERY internal_tmp_table ALL group_key NULL NULL NULL 0 Using temporary
3 SUBQUERY t3 ALL NULL NULL NULL NULL 1 Using temporary
SELECT *
FROM t1
WHERE t1.a = (
@ -386,7 +386,7 @@ select 1 from t1 where 1 like (select 1 from t1 where 1 <=> (select 1 from t1 gr
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 1
2 SUBQUERY t1 ALL NULL NULL NULL NULL 1
3 SUBQUERY internal_tmp_table ALL group_key NULL NULL NULL 1 Using temporary; Using filesort
3 SUBQUERY t1 ALL NULL NULL NULL NULL 1 Using temporary; Using filesort
select 1 from t1 where 1 like (select 1 from t1 where 1 <=> (select 1 from t1 group by a1));
1
1

View File

@ -2183,7 +2183,7 @@ NULL
EXPLAIN
SELECT * FROM t2 WHERE (SELECT f3a, f3b FROM t3) NOT IN (SELECT f1a, f1b FROM t1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
3 MATERIALIZED t1 ALL NULL NULL NULL NULL 2
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
SELECT * FROM t2 WHERE (SELECT f3a, f3b FROM t3) NOT IN (SELECT f1a, f1b FROM t1);

View File

@ -148,7 +148,7 @@ FROM t2 GROUP BY f1
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2 SUBQUERY t1 system NULL NULL NULL NULL 1
3 SUBQUERY internal_tmp_table ALL group_key NULL NULL NULL 1 Using temporary; Using filesort
3 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
drop table t1, t2, t3;
#
# LP BUG#715034 Item_sum_distinct::clear(): Assertion `tree != 0' failed
@ -162,7 +162,7 @@ EXPLAIN
SELECT * FROM (SELECT * FROM t2) AS a2
WHERE (SELECT distinct SUM(distinct f3 ) FROM t1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
1 PRIMARY <derived2> system NULL NULL NULL NULL 0 const row not found
3 SUBQUERY t1 index NULL f3 5 NULL 2 Using index
2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
insert into t2 values (1),(2);

View File

@ -4200,7 +4200,7 @@ INSERT INTO t1 VALUES (1,1),(2,1);
EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ref a a 5 const 1 Using where; Using index
2 SUBQUERY internal_tmp_table ALL group_key NULL NULL NULL 1 Using temporary; Using filesort
2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
DROP TABLE t1;
CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id));
INSERT INTO t1 VALUES
@ -5967,7 +5967,7 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4
2 SUBQUERY t1 ref a a 5 const 1
2 SUBQUERY t1 ref a a 5 const 1 Using index
DROP TABLE t1;
#
# BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS)
@ -6126,7 +6126,7 @@ set optimizer_switch=@tmp_optimizer_switch;
EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4
2 SUBQUERY t1 ref a a 5 const 1
2 SUBQUERY t1 ref a a 5 const 1 Using index
DROP TABLE t1;
#
@ -6611,7 +6611,33 @@ SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 U
min_a a
drop table t1;
#
# LP BUG#944706 Query with impossible or constant subquery in WHERE or HAVING is not
# MDEV-367: Different results with and without subquery_cache on
# a query with a constant NOT IN condition
#
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2),(3);
set @mdev367_optimizer_switch = @@optimizer_switch;
set optimizer_switch = 'subquery_cache=on';
SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100;
a
SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1;
a ( 3, 3 ) NOT IN ( SELECT NULL, NULL )
1 NULL
2 NULL
3 NULL
set optimizer_switch=@mdev367_optimizer_switch;
set optimizer_switch = 'subquery_cache=off';
SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100;
a
SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1;
a ( 3, 3 ) NOT IN ( SELECT NULL, NULL )
1 NULL
2 NULL
3 NULL
set optimizer_switch=@mdev367_optimizer_switch;
DROP TABLE t1;
#
# lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not
# precomputed and thus not part of optimization
#
CREATE TABLE t1 ( a VARCHAR(16), KEY (a) );
@ -6766,8 +6792,71 @@ id select_type table type possible_keys key key_len ref rows Extra
SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1));
a
drop table t1,t2;
# return optimizer switch changed in the beginning of this test
set optimizer_switch=@subselect_tmp;
#
# MDEV-410: EXPLAIN shows type=range, while SHOW EXPLAIN and userstat show full table scan is used
#
CREATE TABLE t1 (a VARCHAR(3) PRIMARY KEY) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('USA');
CREATE TABLE t2 (b INT, c VARCHAR(52), KEY(b)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (3813,'United States'),(3940,'Russia');
CREATE TABLE t3 (d INT, KEY(d)) ENGINE=MyISAM;
INSERT INTO t3 VALUES (12),(22),(9),(45);
create table t4 like t3;
insert into t4 select * from t3;
# This should not show range access for table t2
explain
SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1
WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where
1 PRIMARY t3 ref d d 5 test.t2.b 2 Using where; Using index
3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
set @tmp_mdev410=@@global.userstat;
set global userstat=on;
flush table_statistics;
flush index_statistics;
SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1
WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 );
MIN(b)
NULL
# The following shows that t2 was indeed scanned with a full scan.
show table_statistics;
Table_schema Table_name Rows_read Rows_changed Rows_changed_x_#indexes
test t1 2 0 0
test t2 3 0 0
show index_statistics;
Table_schema Table_name Index_name Rows_read
test t2 b 1
set global userstat=@tmp_mdev410;
DROP TABLE t1,t2,t3,t4;
#
# MDEV-430: Server crashes in select_describe on EXPLAIN with
# materialization+semijoin, 2 nested subqueries, aggregate functions
#
CREATE TABLE t1 (a INT, KEY(a));
INSERT INTO t1 VALUES (1),(8);
CREATE TABLE t2 (b INT, KEY(b));
INSERT INTO t2 VALUES (45),(17),(20);
EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;
#
# MDEV-405: Server crashes in test_if_skip_sort_order on EXPLAIN with GROUP BY and HAVING in EXISTS subquery
#
CREATE TABLE t1 (a INT, KEY(a));
INSERT INTO t1 VALUES (1),(8);
CREATE TABLE t2 (b INT, KEY(b));
INSERT INTO t2 VALUES (45),(17),(20);
EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;
set optimizer_switch=default;
select @@optimizer_switch like '%materialization=on%';
@@optimizer_switch like '%materialization=on%'

View File

@ -4196,7 +4196,7 @@ INSERT INTO t1 VALUES (1,1),(2,1);
EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ref a a 5 const 1 Using where; Using index
2 SUBQUERY internal_tmp_table ALL group_key NULL NULL NULL 1 Using temporary; Using filesort
2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
DROP TABLE t1;
CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id));
INSERT INTO t1 VALUES
@ -5963,7 +5963,7 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4
2 SUBQUERY t1 ref a a 5 const 1
2 SUBQUERY t1 ref a a 5 const 1 Using index
DROP TABLE t1;
#
# BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS)
@ -6122,7 +6122,7 @@ set optimizer_switch=@tmp_optimizer_switch;
EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4
2 SUBQUERY t1 ref a a 5 const 1
2 SUBQUERY t1 ref a a 5 const 1 Using index
DROP TABLE t1;
#
@ -6607,7 +6607,33 @@ SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 U
min_a a
drop table t1;
#
# LP BUG#944706 Query with impossible or constant subquery in WHERE or HAVING is not
# MDEV-367: Different results with and without subquery_cache on
# a query with a constant NOT IN condition
#
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2),(3);
set @mdev367_optimizer_switch = @@optimizer_switch;
set optimizer_switch = 'subquery_cache=on';
SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100;
a
SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1;
a ( 3, 3 ) NOT IN ( SELECT NULL, NULL )
1 NULL
2 NULL
3 NULL
set optimizer_switch=@mdev367_optimizer_switch;
set optimizer_switch = 'subquery_cache=off';
SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100;
a
SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1;
a ( 3, 3 ) NOT IN ( SELECT NULL, NULL )
1 NULL
2 NULL
3 NULL
set optimizer_switch=@mdev367_optimizer_switch;
DROP TABLE t1;
#
# lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not
# precomputed and thus not part of optimization
#
CREATE TABLE t1 ( a VARCHAR(16), KEY (a) );
@ -6763,6 +6789,69 @@ id select_type table type possible_keys key key_len ref rows Extra
SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1));
a
drop table t1,t2;
# return optimizer switch changed in the beginning of this test
set optimizer_switch=@subselect_tmp;
#
# MDEV-410: EXPLAIN shows type=range, while SHOW EXPLAIN and userstat show full table scan is used
#
CREATE TABLE t1 (a VARCHAR(3) PRIMARY KEY) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('USA');
CREATE TABLE t2 (b INT, c VARCHAR(52), KEY(b)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (3813,'United States'),(3940,'Russia');
CREATE TABLE t3 (d INT, KEY(d)) ENGINE=MyISAM;
INSERT INTO t3 VALUES (12),(22),(9),(45);
create table t4 like t3;
insert into t4 select * from t3;
# This should not show range access for table t2
explain
SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1
WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where
1 PRIMARY t3 ref d d 5 test.t2.b 2 Using where; Using index
3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
set @tmp_mdev410=@@global.userstat;
set global userstat=on;
flush table_statistics;
flush index_statistics;
SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1
WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 );
MIN(b)
NULL
# The following shows that t2 was indeed scanned with a full scan.
show table_statistics;
Table_schema Table_name Rows_read Rows_changed Rows_changed_x_#indexes
test t1 2 0 0
test t2 3 0 0
show index_statistics;
Table_schema Table_name Index_name Rows_read
test t2 b 1
set global userstat=@tmp_mdev410;
DROP TABLE t1,t2,t3,t4;
#
# MDEV-430: Server crashes in select_describe on EXPLAIN with
# materialization+semijoin, 2 nested subqueries, aggregate functions
#
CREATE TABLE t1 (a INT, KEY(a));
INSERT INTO t1 VALUES (1),(8);
CREATE TABLE t2 (b INT, KEY(b));
INSERT INTO t2 VALUES (45),(17),(20);
EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;
#
# MDEV-405: Server crashes in test_if_skip_sort_order on EXPLAIN with GROUP BY and HAVING in EXISTS subquery
#
CREATE TABLE t1 (a INT, KEY(a));
INSERT INTO t1 VALUES (1),(8);
CREATE TABLE t2 (b INT, KEY(b));
INSERT INTO t2 VALUES (45),(17),(20);
EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;
set @optimizer_switch_for_subselect_test=null;

View File

@ -4202,7 +4202,7 @@ INSERT INTO t1 VALUES (1,1),(2,1);
EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ref a a 5 const 1 Using where; Using index
2 SUBQUERY internal_tmp_table ALL group_key NULL NULL NULL 1 Using temporary; Using filesort
2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
DROP TABLE t1;
CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id));
INSERT INTO t1 VALUES
@ -5972,7 +5972,7 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4
2 SUBQUERY t1 ref a a 5 const 1
2 SUBQUERY t1 ref a a 5 const 1 Using index
DROP TABLE t1;
#
# BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS)
@ -6133,7 +6133,7 @@ set optimizer_switch=@tmp_optimizer_switch;
EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4
2 SUBQUERY t1 ref a a 5 const 1
2 SUBQUERY t1 ref a a 5 const 1 Using index
DROP TABLE t1;
#
@ -6618,7 +6618,33 @@ SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 U
min_a a
drop table t1;
#
# LP BUG#944706 Query with impossible or constant subquery in WHERE or HAVING is not
# MDEV-367: Different results with and without subquery_cache on
# a query with a constant NOT IN condition
#
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2),(3);
set @mdev367_optimizer_switch = @@optimizer_switch;
set optimizer_switch = 'subquery_cache=on';
SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100;
a
SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1;
a ( 3, 3 ) NOT IN ( SELECT NULL, NULL )
1 NULL
2 NULL
3 NULL
set optimizer_switch=@mdev367_optimizer_switch;
set optimizer_switch = 'subquery_cache=off';
SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100;
a
SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1;
a ( 3, 3 ) NOT IN ( SELECT NULL, NULL )
1 NULL
2 NULL
3 NULL
set optimizer_switch=@mdev367_optimizer_switch;
DROP TABLE t1;
#
# lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not
# precomputed and thus not part of optimization
#
CREATE TABLE t1 ( a VARCHAR(16), KEY (a) );
@ -6774,8 +6800,71 @@ id select_type table type possible_keys key key_len ref rows Extra
SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1));
a
drop table t1,t2;
# return optimizer switch changed in the beginning of this test
set optimizer_switch=@subselect_tmp;
#
# MDEV-410: EXPLAIN shows type=range, while SHOW EXPLAIN and userstat show full table scan is used
#
CREATE TABLE t1 (a VARCHAR(3) PRIMARY KEY) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('USA');
CREATE TABLE t2 (b INT, c VARCHAR(52), KEY(b)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (3813,'United States'),(3940,'Russia');
CREATE TABLE t3 (d INT, KEY(d)) ENGINE=MyISAM;
INSERT INTO t3 VALUES (12),(22),(9),(45);
create table t4 like t3;
insert into t4 select * from t3;
# This should not show range access for table t2
explain
SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1
WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where
1 PRIMARY t3 ref d d 5 test.t2.b 2 Using where; Using index
3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
set @tmp_mdev410=@@global.userstat;
set global userstat=on;
flush table_statistics;
flush index_statistics;
SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1
WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 );
MIN(b)
NULL
# The following shows that t2 was indeed scanned with a full scan.
show table_statistics;
Table_schema Table_name Rows_read Rows_changed Rows_changed_x_#indexes
test t1 2 0 0
test t2 3 0 0
show index_statistics;
Table_schema Table_name Index_name Rows_read
test t2 b 1
set global userstat=@tmp_mdev410;
DROP TABLE t1,t2,t3,t4;
#
# MDEV-430: Server crashes in select_describe on EXPLAIN with
# materialization+semijoin, 2 nested subqueries, aggregate functions
#
CREATE TABLE t1 (a INT, KEY(a));
INSERT INTO t1 VALUES (1),(8);
CREATE TABLE t2 (b INT, KEY(b));
INSERT INTO t2 VALUES (45),(17),(20);
EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;
#
# MDEV-405: Server crashes in test_if_skip_sort_order on EXPLAIN with GROUP BY and HAVING in EXISTS subquery
#
CREATE TABLE t1 (a INT, KEY(a));
INSERT INTO t1 VALUES (1),(8);
CREATE TABLE t2 (b INT, KEY(b));
INSERT INTO t2 VALUES (45),(17),(20);
EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;
set optimizer_switch=default;
select @@optimizer_switch like '%subquery_cache=on%';
@@optimizer_switch like '%subquery_cache=on%'

View File

@ -4196,7 +4196,7 @@ INSERT INTO t1 VALUES (1,1),(2,1);
EXPLAIN SELECT 1 FROM t1 WHERE a = (SELECT COUNT(*) FROM t1 GROUP BY b);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ref a a 5 const 1 Using where; Using index
2 SUBQUERY internal_tmp_table ALL group_key NULL NULL NULL 1 Using temporary; Using filesort
2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
DROP TABLE t1;
CREATE TABLE t1 (id int NOT NULL, st CHAR(2), INDEX idx(id));
INSERT INTO t1 VALUES
@ -5963,7 +5963,7 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4
2 SUBQUERY t1 ref a a 5 const 1
2 SUBQUERY t1 ref a a 5 const 1 Using index
DROP TABLE t1;
#
# BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS)
@ -6122,7 +6122,7 @@ set optimizer_switch=@tmp_optimizer_switch;
EXPLAIN SELECT * FROM t1 WHERE EXISTS (SELECT * FROM t1 WHERE a=7);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4
2 SUBQUERY t1 ref a a 5 const 1
2 SUBQUERY t1 ref a a 5 const 1 Using index
DROP TABLE t1;
#
@ -6607,7 +6607,33 @@ SELECT MIN(a) AS min_a, a FROM t1 WHERE 1=2 HAVING a NOT IN ( SELECT a from t1 U
min_a a
drop table t1;
#
# LP BUG#944706 Query with impossible or constant subquery in WHERE or HAVING is not
# MDEV-367: Different results with and without subquery_cache on
# a query with a constant NOT IN condition
#
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2),(3);
set @mdev367_optimizer_switch = @@optimizer_switch;
set optimizer_switch = 'subquery_cache=on';
SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100;
a
SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1;
a ( 3, 3 ) NOT IN ( SELECT NULL, NULL )
1 NULL
2 NULL
3 NULL
set optimizer_switch=@mdev367_optimizer_switch;
set optimizer_switch = 'subquery_cache=off';
SELECT * FROM t1 WHERE ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) OR a > 100;
a
SELECT *, ( 3, 3 ) NOT IN ( SELECT NULL, NULL ) FROM t1;
a ( 3, 3 ) NOT IN ( SELECT NULL, NULL )
1 NULL
2 NULL
3 NULL
set optimizer_switch=@mdev367_optimizer_switch;
DROP TABLE t1;
#
# lp:944706 Query with impossible or constant subquery in WHERE or HAVING is not
# precomputed and thus not part of optimization
#
CREATE TABLE t1 ( a VARCHAR(16), KEY (a) );
@ -6763,7 +6789,70 @@ id select_type table type possible_keys key key_len ref rows Extra
SELECT * FROM t1 WHERE 4 IN (SELECT MAX(b) FROM t2 WHERE EXISTS (SELECT * FROM t1));
a
drop table t1,t2;
# return optimizer switch changed in the beginning of this test
set optimizer_switch=@subselect_tmp;
#
# MDEV-410: EXPLAIN shows type=range, while SHOW EXPLAIN and userstat show full table scan is used
#
CREATE TABLE t1 (a VARCHAR(3) PRIMARY KEY) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('USA');
CREATE TABLE t2 (b INT, c VARCHAR(52), KEY(b)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (3813,'United States'),(3940,'Russia');
CREATE TABLE t3 (d INT, KEY(d)) ENGINE=MyISAM;
INSERT INTO t3 VALUES (12),(22),(9),(45);
create table t4 like t3;
insert into t4 select * from t3;
# This should not show range access for table t2
explain
SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1
WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where
1 PRIMARY t3 ref d d 5 test.t2.b 2 Using where; Using index
3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
set @tmp_mdev410=@@global.userstat;
set global userstat=on;
flush table_statistics;
flush index_statistics;
SELECT MIN(b) FROM ( SELECT * FROM t1, t2, t3 WHERE d = b ) AS alias1
WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 );
MIN(b)
NULL
# The following shows that t2 was indeed scanned with a full scan.
show table_statistics;
Table_schema Table_name Rows_read Rows_changed Rows_changed_x_#indexes
test t1 2 0 0
test t2 3 0 0
show index_statistics;
Table_schema Table_name Index_name Rows_read
test t2 b 1
set global userstat=@tmp_mdev410;
DROP TABLE t1,t2,t3,t4;
#
# MDEV-430: Server crashes in select_describe on EXPLAIN with
# materialization+semijoin, 2 nested subqueries, aggregate functions
#
CREATE TABLE t1 (a INT, KEY(a));
INSERT INTO t1 VALUES (1),(8);
CREATE TABLE t2 (b INT, KEY(b));
INSERT INTO t2 VALUES (45),(17),(20);
EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;
#
# MDEV-405: Server crashes in test_if_skip_sort_order on EXPLAIN with GROUP BY and HAVING in EXISTS subquery
#
CREATE TABLE t1 (a INT, KEY(a));
INSERT INTO t1 VALUES (1),(8);
CREATE TABLE t2 (b INT, KEY(b));
INSERT INTO t2 VALUES (45),(17),(20);
EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP BY a HAVING a <> 1 ) ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t1 index a a 5 NULL 1 Using where; Using index
2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
DROP TABLE t1,t2;
set @optimizer_switch_for_subselect_test=null;
set @join_cache_level_for_subselect_test=NULL;

View File

@ -878,6 +878,8 @@ ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT
CREATE TABLE b15776 (a char(4294967296));
ERROR 42000: Display width out of range for 'a' (max = 4294967295)
CREATE TABLE b15776 (a year(4294967295));
Warnings:
Note 1287 'YEAR(4294967295)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
INSERT INTO b15776 VALUES (42);
SELECT * FROM b15776;
a
@ -886,6 +888,8 @@ DROP TABLE b15776;
CREATE TABLE b15776 (a year(4294967296));
ERROR 42000: Display width out of range for 'a' (max = 4294967295)
CREATE TABLE b15776 (a year(0));
Warnings:
Note 1287 'YEAR(0)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
DROP TABLE b15776;
CREATE TABLE b15776 (a year(-2));
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-2))' at line 1

View File

@ -1,5 +1,7 @@
drop table if exists t1;
create table t1 (y year,y2 year(2));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (0,0),(1999,1999),(2000,2000),(2001,2001),(70,70),(69,69);
select * from t1;
y y2
@ -50,6 +52,8 @@ End of 5.0 tests
# Bug #49480: WHERE using YEAR columns returns unexpected results
#
CREATE TABLE t2(yy YEAR(2), c2 CHAR(4));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
CREATE TABLE t4(yyyy YEAR(4), c4 CHAR(4));
INSERT INTO t2 (c2) VALUES (NULL),(1970),(1999),(2000),(2001),(2069);
INSERT INTO t4 (c4) SELECT c2 FROM t2;
@ -358,9 +362,22 @@ total_rows min_value MAX(c1+0)
3 0 2155
DROP TABLE t1;
#
# WL#6219: Deprecate and remove YEAR(2) type
#
CREATE TABLE t1 (c1 YEAR(2), c2 YEAR(4));
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
ALTER TABLE t1 MODIFY COLUMN c2 YEAR(2);
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
DROP TABLE t1;
#
End of 5.1 tests
create function y2k() returns int deterministic return 2000;
create table t1 (a year(2), b int);
Warnings:
Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert t1 values (0,2000);
select a from t1 where a=2000;
a

View File

@ -34,7 +34,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
SET @`a b`:=_latin1 0x68656C6C6F COLLATE `latin1_swedish_ci`/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=10000/*!*/;
INSERT INTO t1 VALUES(@`a b`)
/*!*/;

View File

@ -4674,6 +4674,19 @@ INSERT INTO t2 VALUES (1);
DROP TRIGGER tr;
DROP VIEW v1;
DROP TABLE t1,t2,t3;
#
# LP bug#1007622 Server crashes in handler::increment_statistics on
# inserting into a view over a view
#
CREATE TABLE t1 (a INT);
CREATE ALGORITHM=MERGE VIEW v1 AS SELECT a1.* FROM t1 AS a1, t1 AS a2;
CREATE ALGORITHM=MERGE VIEW v2 AS SELECT * FROM v1;
INSERT INTO v2 (a) VALUES (1) ;
select * from t1;
a
1
drop view v2,v1;
drop table t1;
# -----------------------------------------------------------------
# -- End of 5.3 tests.
# -----------------------------------------------------------------

View File

@ -35,7 +35,7 @@ DELIMITER /*!*/;
# at 4
<#>ROLLBACK/*!*/;
# at 102
<#>use test/*!*/;
<#>use `test`/*!*/;
SET TIMESTAMP=1196959712/*!*/;
<#>SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;

View File

@ -96,3 +96,21 @@ master-bin.000001 # Query # # use `test`; DROP VIEW IF EXISTS db_bug_13684.v
master-bin.000001 # Query # # use `test`; DROP EVENT IF EXISTS db_bug_13684.e
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `db_bug_13684`.`t` /* generated by server */
master-bin.000001 # Query # # DROP DATABASE IF EXISTS db_bug_13684
CREATE TABLE t1(id int);
DROP TABLE /* comment */ t1;
CREATE TABLE t1(id int);
DROP TABLE IF EXISTS /* comment */ t1;
CREATE TABLE t1(id int);
DROP TABLE /**/ t1;
CREATE TABLE t1(id int);
DROP TABLE IF EXISTS /* */ t1;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; CREATE TABLE t1(id int)
master-bin.000001 # Query # # use `test`; DROP TABLE /* comment */ `t1` /* generated by server */
master-bin.000001 # Query # # use `test`; CREATE TABLE t1(id int)
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS /* comment */ `t1` /* generated by server */
master-bin.000001 # Query # # use `test`; CREATE TABLE t1(id int)
master-bin.000001 # Query # # use `test`; DROP TABLE /**/ `t1` /* generated by server */
master-bin.000001 # Query # # use `test`; CREATE TABLE t1(id int)
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS /* */ `t1` /* generated by server */

View File

@ -35,7 +35,7 @@ DELIMITER /*!*/;
#010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup
ROLLBACK/*!*/;
# at #
use new_test1/*!*/;
use `new_test1`/*!*/;
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
@ -72,7 +72,7 @@ COMMIT
/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
use test2/*!*/;
use `test2`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
CREATE TABLE t2 (a INT)
/*!*/;
@ -115,7 +115,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
use new_test3/*!*/;
use `new_test3`/*!*/;
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
CREATE TABLE t3 (a INT)
@ -229,7 +229,7 @@ DELIMITER /*!*/;
#010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup
ROLLBACK/*!*/;
# at #
use new_test1/*!*/;
use `new_test1`/*!*/;
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
@ -266,7 +266,7 @@ COMMIT
/*!*/;
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
use test2/*!*/;
use `test2`/*!*/;
SET TIMESTAMP=1000000000/*!*/;
CREATE TABLE t2 (a INT)
/*!*/;
@ -309,7 +309,7 @@ SET TIMESTAMP=1000000000/*!*/;
COMMIT
/*!*/;
# at #
use new_test3/*!*/;
use `new_test3`/*!*/;
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
CREATE TABLE t3 (a INT)

View File

@ -26,7 +26,7 @@ SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
SET @`v`:=_ucs2 0x006100620063 COLLATE `ucs2_general_ci`/*!*/;
use test/*!*/;
use `test`/*!*/;
SET TIMESTAMP=10000/*!*/;
insert into t2 values (@v)
/*!*/;

View File

@ -698,7 +698,7 @@ master-bin.000001 # Query # # BEGIN
master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @b) SET `b`= @b + bug27417(2) ;file_id=#
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @`b`) SET `b`= @b + bug27417(2) ;file_id=#
master-bin.000001 # Query # # ROLLBACK
/* the output must denote there is the query */;
drop trigger trg_del_t2;
@ -950,7 +950,7 @@ master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
master-bin.000001 # Intvar # # INSERT_ID=10
master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @b) SET `b`= @b + bug27417(2) ;file_id=#
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @`b`) SET `b`= @b + bug27417(2) ;file_id=#
master-bin.000001 # Query # # ROLLBACK
drop trigger trg_del_t2;
drop table t1,t2,t3,t4,t5;

View File

@ -113,3 +113,18 @@ if($fixed_bug_25705)
--source include/show_binlog_events.inc
enable_warnings;
# Drop comments in binlog
let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
CREATE TABLE t1(id int);
DROP TABLE /* comment */ t1;
CREATE TABLE t1(id int);
DROP TABLE IF EXISTS /* comment */ t1;
CREATE TABLE t1(id int);
DROP TABLE /**/ t1;
CREATE TABLE t1(id int);
DROP TABLE IF EXISTS /* */ t1;
--source include/show_binlog_events.inc

View File

@ -16,7 +16,13 @@ DROP TABLE t1;
CREATE TABLE t1(c1 TIME NULL, c2 TIME NULL);
SET TIMESTAMP=1171346973;
INSERT INTO t1 VALUES(NOW(),NOW());
Warnings:
Note 1265 Data truncated for column 'c1' at row 1
Note 1265 Data truncated for column 'c2' at row 1
INSERT INTO t1 VALUES(NOW(),NOW());
Warnings:
Note 1265 Data truncated for column 'c1' at row 1
Note 1265 Data truncated for column 'c2' at row 1
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK

View File

@ -25,7 +25,15 @@ INSERT INTO t3 VALUES('2008-02-29 13:13:13');
DROP TABLE t3;
CREATE TABLE t3(c1 TIME NOT NULL);
INSERT INTO t3 VALUES('1000-01-01 00:00:00');
Warnings:
Note 1265 Data truncated for column 'c1' at row 1
INSERT INTO t3 VALUES('1999-12-31 23:59:59');
Warnings:
Note 1265 Data truncated for column 'c1' at row 1
INSERT INTO t3 VALUES('2000-01-01 00:00:00');
Warnings:
Note 1265 Data truncated for column 'c1' at row 1
INSERT INTO t3 VALUES('2008-02-29 13:13:13');
Warnings:
Note 1265 Data truncated for column 'c1' at row 1
DROP TABLE t3;

View File

@ -77,6 +77,7 @@ utf8_persian_ci utf8 208 # #
utf8_esperanto_ci utf8 209 # #
utf8_hungarian_ci utf8 210 # #
utf8_sinhala_ci utf8 211 # #
utf8_croatian_ci utf8 213 # #
utf8_general_mysql500_ci utf8 223 # #
ucs2_general_ci ucs2 35 Yes # #
ucs2_bin ucs2 90 # #
@ -100,6 +101,7 @@ ucs2_persian_ci ucs2 144 # #
ucs2_esperanto_ci ucs2 145 # #
ucs2_hungarian_ci ucs2 146 # #
ucs2_sinhala_ci ucs2 147 # #
ucs2_croatian_ci ucs2 149 # #
ucs2_general_mysql500_ci ucs2 159 # #
cp866_general_ci cp866 36 Yes # #
cp866_bin cp866 68 # #
@ -137,6 +139,7 @@ utf8mb4_persian_ci utf8mb4 240 # #
utf8mb4_esperanto_ci utf8mb4 241 # #
utf8mb4_hungarian_ci utf8mb4 242 # #
utf8mb4_sinhala_ci utf8mb4 243 # #
utf8mb4_croatian_ci utf8mb4 245 # #
cp1251_bulgarian_ci cp1251 14 # #
cp1251_ukrainian_ci cp1251 23 # #
cp1251_bin cp1251 50 # #
@ -164,6 +167,7 @@ utf16_persian_ci utf16 117 # #
utf16_esperanto_ci utf16 118 # #
utf16_hungarian_ci utf16 119 # #
utf16_sinhala_ci utf16 120 # #
utf16_croatian_ci utf16 215 # #
cp1256_general_ci cp1256 57 Yes # #
cp1256_bin cp1256 67 # #
cp1257_lithuanian_ci cp1257 29 # #
@ -191,6 +195,7 @@ utf32_persian_ci utf32 176 # #
utf32_esperanto_ci utf32 177 # #
utf32_hungarian_ci utf32 178 # #
utf32_sinhala_ci utf32 179 # #
utf32_croatian_ci utf32 214 # #
binary binary 63 Yes # #
geostd8_general_ci geostd8 92 Yes # #
geostd8_bin geostd8 93 # #

View File

@ -77,6 +77,7 @@ utf8_persian_ci utf8 208 # #
utf8_esperanto_ci utf8 209 # #
utf8_hungarian_ci utf8 210 # #
utf8_sinhala_ci utf8 211 # #
utf8_croatian_ci utf8 213 # #
utf8_general_mysql500_ci utf8 223 # #
ucs2_general_ci ucs2 35 Yes # #
ucs2_bin ucs2 90 # #
@ -100,6 +101,7 @@ ucs2_persian_ci ucs2 144 # #
ucs2_esperanto_ci ucs2 145 # #
ucs2_hungarian_ci ucs2 146 # #
ucs2_sinhala_ci ucs2 147 # #
ucs2_croatian_ci ucs2 149 # #
ucs2_general_mysql500_ci ucs2 159 # #
cp866_general_ci cp866 36 Yes # #
cp866_bin cp866 68 # #
@ -137,6 +139,7 @@ utf8mb4_persian_ci utf8mb4 240 # #
utf8mb4_esperanto_ci utf8mb4 241 # #
utf8mb4_hungarian_ci utf8mb4 242 # #
utf8mb4_sinhala_ci utf8mb4 243 # #
utf8mb4_croatian_ci utf8mb4 245 # #
cp1251_bulgarian_ci cp1251 14 # #
cp1251_ukrainian_ci cp1251 23 # #
cp1251_bin cp1251 50 # #
@ -164,6 +167,7 @@ utf16_persian_ci utf16 117 # #
utf16_esperanto_ci utf16 118 # #
utf16_hungarian_ci utf16 119 # #
utf16_sinhala_ci utf16 120 # #
utf16_croatian_ci utf16 215 # #
cp1256_general_ci cp1256 57 Yes # #
cp1256_bin cp1256 67 # #
cp1257_lithuanian_ci cp1257 29 # #
@ -191,6 +195,7 @@ utf32_persian_ci utf32 176 # #
utf32_esperanto_ci utf32 177 # #
utf32_hungarian_ci utf32 178 # #
utf32_sinhala_ci utf32 179 # #
utf32_croatian_ci utf32 214 # #
binary binary 63 Yes # #
geostd8_general_ci geostd8 92 Yes # #
geostd8_bin geostd8 93 # #

View File

@ -9,7 +9,7 @@ mysql
performance_schema
test
USE DATABASE nond6;
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 'DATABASE nond6' at line 1
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DATABASE nond6' at line 1
DROP DATABASE d6;
SHOW DATABASES;
Database

View File

@ -33,10 +33,20 @@ DROP TABLE t1;
CREATE TABLE t1(c1 TIME NOT NULL PRIMARY KEY);
SET TIMESTAMP=1171346973;
INSERT INTO t1 (c1) VALUES(NOW());
Warnings:
Note 1265 Data truncated for column 'c1' at row 1
INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'1 01:01:01'));
Warnings:
Note 1265 Data truncated for column 'c1' at row 1
INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'2 02:01:01'));
Warnings:
Note 1265 Data truncated for column 'c1' at row 1
INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'3 03:01:01'));
Warnings:
Note 1265 Data truncated for column 'c1' at row 1
INSERT INTO t1 (c1) VALUES(ADDTIME(NOW(),'4 04:01:01'));
Warnings:
Note 1265 Data truncated for column 'c1' at row 1
SELECT * FROM t1 ORDER BY c1;
c1
09:09:33
@ -47,8 +57,6 @@ c1
DELETE FROM t1 WHERE c1 <= ADDTIME(NOW(),'2 02:01:01');
SELECT * FROM t1 ORDER BY c1;
c1
12:10:34
13:10:34
DROP TABLE t1;
CREATE TABLE t1(c1 DATETIME NOT NULL PRIMARY KEY);
SET TIMESTAMP=1171346973;

View File

@ -66,12 +66,42 @@ DROP TABLE t1;
CREATE TABLE t1(c1 TIME NOT NULL, c2 TIME NULL, c3 TIME NULL, PRIMARY KEY(c1), UNIQUE(c2));
SET TIMESTAMP=1171346973;
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),ADDTIME(NOW(),'4 04:01:01'),NOW());
Warnings:
Note 1265 Data truncated for column 'c1' at row 1
Note 1265 Data truncated for column 'c2' at row 1
Note 1265 Data truncated for column 'c3' at row 1
INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'1 01:01:01'),ADDTIME(NOW(),'3 03:01:01'),NOW());
Warnings:
Note 1265 Data truncated for column 'c1' at row 1
Note 1265 Data truncated for column 'c2' at row 1
Note 1265 Data truncated for column 'c3' at row 1
INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'2 02:01:01'),ADDTIME(NOW(),'2 02:01:01'),NOW());
Warnings:
Note 1265 Data truncated for column 'c1' at row 1
Note 1265 Data truncated for column 'c2' at row 1
Note 1265 Data truncated for column 'c3' at row 1
INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'3 03:01:01'),ADDTIME(NOW(),'1 01:01:01'),NOW());
Warnings:
Note 1265 Data truncated for column 'c1' at row 1
Note 1265 Data truncated for column 'c2' at row 1
Note 1265 Data truncated for column 'c3' at row 1
INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'4 04:01:01'),NOW(),NOW());
Warnings:
Note 1265 Data truncated for column 'c1' at row 1
Note 1265 Data truncated for column 'c2' at row 1
Note 1265 Data truncated for column 'c3' at row 1
INSERT INTO t1 (c1,c2,c3) VALUES(ADDTIME(NOW(),'2 02:01:01'),ADDTIME(NOW(),'2 02:01:01'),NOW()) ON DUPLICATE KEY UPDATE c3=ADDTIME(NOW(),'6 06:01:01');
Warnings:
Note 1265 Data truncated for column 'c1' at row 1
Note 1265 Data truncated for column 'c2' at row 1
Note 1265 Data truncated for column 'c3' at row 1
Note 1265 Data truncated for column 'c3' at row 1
INSERT INTO t1 (c1,c2,c3) VALUES(NOW(),NOW(),NOW()) ON DUPLICATE KEY UPDATE c3=ADDTIME(NOW(),'6 06:01:01');
Warnings:
Note 1265 Data truncated for column 'c1' at row 1
Note 1265 Data truncated for column 'c2' at row 1
Note 1265 Data truncated for column 'c3' at row 1
Note 1265 Data truncated for column 'c3' at row 1
SELECT * FROM t1;
c1 c2 c3
09:09:33 13:10:34 15:10:34

Some files were not shown because too many files have changed in this diff Show More