mirror of
https://github.com/MariaDB/server.git
synced 2025-01-21 06:22:28 +01:00
merge with local changes for bug#37906
This commit is contained in:
commit
a38f6fe4cd
312 changed files with 18443 additions and 8792 deletions
24
BUILD/compile-pentium-valgrind-max-no-ndb
Executable file
24
BUILD/compile-pentium-valgrind-max-no-ndb
Executable file
|
@ -0,0 +1,24 @@
|
|||
#! /bin/sh
|
||||
|
||||
path=`dirname $0`
|
||||
. "$path/SETUP.sh"
|
||||
|
||||
extra_flags="$pentium_cflags $debug_cflags $valgrind_flags"
|
||||
extra_configs="$pentium_configs $debug_configs $max_no_ndb_configs"
|
||||
|
||||
. "$path/FINISH.sh"
|
||||
|
||||
if test -z "$just_print"
|
||||
then
|
||||
set +v +x
|
||||
echo "\
|
||||
******************************************************************************
|
||||
Note that by default BUILD/compile-pentium-valgrind-max calls 'configure' with
|
||||
--enable-assembler. When Valgrind detects an error involving an assembly
|
||||
function (for example an uninitialized value used as an argument of an
|
||||
assembly function), Valgrind will not print the stacktrace and 'valgrind
|
||||
--gdb-attach=yes' will not work either. If you need a stacktrace in those
|
||||
cases, you have to run BUILD/compile-pentium-valgrind-max with the
|
||||
--disable-assembler argument.
|
||||
******************************************************************************"
|
||||
fi
|
|
@ -149,7 +149,7 @@ test-bt:
|
|||
echo "no program found for 'ndbcluster' tests - skipped testing" ; \
|
||||
fi
|
||||
-cd mysql-test ; MTR_BUILD_THREAD=auto \
|
||||
@PERL@ ./mysql-test-run.pl --force --comment=funcs1+ps --ps-protocol --suite=funcs_1
|
||||
@PERL@ ./mysql-test-run.pl --force --comment=funcs1+ps --ps-protocol --reorder --suite=funcs_1
|
||||
-cd mysql-test ; MTR_BUILD_THREAD=auto \
|
||||
@PERL@ ./mysql-test-run.pl --force --comment=funcs2 --suite=funcs_2
|
||||
-cd mysql-test ; MTR_BUILD_THREAD=auto \
|
||||
|
@ -190,7 +190,7 @@ test-force-full-pl: test-force-full
|
|||
|
||||
test-ext-funcs:
|
||||
cd mysql-test ; \
|
||||
@PERL@ ./mysql-test-run.pl --force --suite=funcs_1 ; \
|
||||
@PERL@ ./mysql-test-run.pl --force --reorder --suite=funcs_1 ; \
|
||||
@PERL@ ./mysql-test-run.pl --force --suite=funcs_2
|
||||
|
||||
test-ext-rpl:
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
|
||||
|
||||
# We use the "mysqlclient_notls" library here just as safety, in case
|
||||
# any of the clients here would go beond the client API and access the
|
||||
# any of the clients here would go beyond the client API and access the
|
||||
# Thread Local Storage directly.
|
||||
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
|
||||
|
@ -32,9 +32,9 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
|
|||
ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc sql_string.cc ../mysys/my_conio.c)
|
||||
TARGET_LINK_LIBRARIES(mysql mysqlclient_notls wsock32)
|
||||
|
||||
ADD_EXECUTABLE(mysqltest mysqltest.c ../mysys/my_getsystime.c
|
||||
../mysys/my_copy.c ../mysys/my_mkdir.c)
|
||||
TARGET_LINK_LIBRARIES(mysqltest mysqlclient_notls regex wsock32)
|
||||
ADD_EXECUTABLE(mysqltest mysqltest.c)
|
||||
SET_SOURCE_FILES_PROPERTIES(mysqltest.c PROPERTIES COMPILE_FLAGS "-DTHREADS")
|
||||
TARGET_LINK_LIBRARIES(mysqltest mysqlclient mysys regex wsock32 dbug)
|
||||
|
||||
ADD_EXECUTABLE(mysqlcheck mysqlcheck.c)
|
||||
TARGET_LINK_LIBRARIES(mysqlcheck mysqlclient_notls wsock32)
|
||||
|
|
|
@ -86,11 +86,13 @@ mysqlslap_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
|
|||
$(LIBMYSQLCLIENT_LA) \
|
||||
$(top_builddir)/mysys/libmysys.a
|
||||
|
||||
mysqltest_SOURCES= mysqltest.c \
|
||||
$(top_srcdir)/mysys/my_getsystime.c \
|
||||
$(top_srcdir)/mysys/my_copy.c \
|
||||
$(top_srcdir)/mysys/my_mkdir.c
|
||||
mysqltest_LDADD = $(top_builddir)/regex/libregex.a $(LDADD)
|
||||
mysqltest_SOURCES= mysqltest.c
|
||||
mysqltest_CFLAGS= -DTHREAD -UUNDEF_THREADS_HACK
|
||||
mysqltest_LDADD = $(CXXLDFLAGS) $(CLIENT_THREAD_LIBS) \
|
||||
@CLIENT_EXTRA_LDFLAGS@ \
|
||||
$(LIBMYSQLCLIENT_LA) \
|
||||
$(top_builddir)/mysys/libmysys.a \
|
||||
$(top_builddir)/regex/libregex.a
|
||||
|
||||
mysql_upgrade_SOURCES= mysql_upgrade.c \
|
||||
$(top_srcdir)/mysys/my_getpagesize.c
|
||||
|
|
|
@ -1821,7 +1821,7 @@ static int read_and_execute(bool interactive)
|
|||
the very beginning of a text file when
|
||||
you save the file using "Unicode UTF-8" format.
|
||||
*/
|
||||
if (!line_number &&
|
||||
if (line && !line_number &&
|
||||
(uchar) line[0] == 0xEF &&
|
||||
(uchar) line[1] == 0xBB &&
|
||||
(uchar) line[2] == 0xBF)
|
||||
|
@ -2101,37 +2101,6 @@ static bool add_line(String &buffer,char *line,char *in_string,
|
|||
continue;
|
||||
}
|
||||
}
|
||||
else if (!*ml_comment && !*in_string &&
|
||||
(end_of_line - pos) >= 10 &&
|
||||
!my_strnncoll(charset_info, (uchar*) pos, 10,
|
||||
(const uchar*) "delimiter ", 10))
|
||||
{
|
||||
// Flush previously accepted characters
|
||||
if (out != line)
|
||||
{
|
||||
buffer.append(line, (uint32) (out - line));
|
||||
out= line;
|
||||
}
|
||||
|
||||
// Flush possible comments in the buffer
|
||||
if (!buffer.is_empty())
|
||||
{
|
||||
if (com_go(&buffer, 0) > 0) // < 0 is not fatal
|
||||
DBUG_RETURN(1);
|
||||
buffer.length(0);
|
||||
}
|
||||
|
||||
/*
|
||||
Delimiter wants the get rest of the given line as argument to
|
||||
allow one to change ';' to ';;' and back
|
||||
*/
|
||||
buffer.append(pos);
|
||||
if (com_delimiter(&buffer, pos) > 0)
|
||||
DBUG_RETURN(1);
|
||||
|
||||
buffer.length(0);
|
||||
break;
|
||||
}
|
||||
else if (!*ml_comment && !*in_string && is_prefix(pos, delimiter))
|
||||
{
|
||||
// Found a statement. Continue parsing after the delimiter
|
||||
|
@ -2176,7 +2145,14 @@ static bool add_line(String &buffer,char *line,char *in_string,
|
|||
}
|
||||
else if (!*ml_comment && (!*in_string && (inchar == '#' ||
|
||||
inchar == '-' && pos[1] == '-' &&
|
||||
my_isspace(charset_info,pos[2]))))
|
||||
/*
|
||||
The third byte is either whitespace or is the
|
||||
end of the line -- which would occur only
|
||||
because of the user sending newline -- which is
|
||||
itself whitespace and should also match.
|
||||
*/
|
||||
(my_isspace(charset_info,pos[2]) ||
|
||||
!pos[2]))))
|
||||
{
|
||||
// Flush previously accepted characters
|
||||
if (out != line)
|
||||
|
|
|
@ -48,7 +48,15 @@
|
|||
#ifdef __WIN__
|
||||
#include <direct.h>
|
||||
#endif
|
||||
#include <signal.h>
|
||||
#include <my_stacktrace.h>
|
||||
|
||||
#ifdef __WIN__
|
||||
#include <crtdbg.h>
|
||||
#define SIGNAL_FMT "exception 0x%x"
|
||||
#else
|
||||
#define SIGNAL_FMT "signal %d"
|
||||
#endif
|
||||
|
||||
/* Use cygwin for --exec and --system before 5.0 */
|
||||
#if MYSQL_VERSION_ID < 50000
|
||||
|
@ -214,6 +222,7 @@ struct st_connection
|
|||
/* Used when creating views and sp, to avoid implicit commit */
|
||||
MYSQL* util_mysql;
|
||||
char *name;
|
||||
size_t name_len;
|
||||
MYSQL_STMT* stmt;
|
||||
|
||||
#ifdef EMBEDDED_LIBRARY
|
||||
|
@ -4613,6 +4622,7 @@ void do_connect(struct st_command *command)
|
|||
ds_connection_name.str));
|
||||
if (!(con_slot->name= my_strdup(ds_connection_name.str, MYF(MY_WME))))
|
||||
die("Out of memory");
|
||||
con_slot->name_len= strlen(con_slot->name);
|
||||
cur_con= con_slot;
|
||||
|
||||
if (con_slot == next_con)
|
||||
|
@ -7015,6 +7025,104 @@ void mark_progress(struct st_command* command __attribute__((unused)),
|
|||
|
||||
}
|
||||
|
||||
#ifdef HAVE_STACKTRACE
|
||||
|
||||
static void dump_backtrace(void)
|
||||
{
|
||||
struct st_connection *conn= cur_con;
|
||||
|
||||
my_safe_print_str("read_command_buf", read_command_buf,
|
||||
sizeof(read_command_buf));
|
||||
if (conn)
|
||||
{
|
||||
my_safe_print_str("conn->name", conn->name, conn->name_len);
|
||||
#ifdef EMBEDDED_LIBRARY
|
||||
my_safe_print_str("conn->cur_query", conn->cur_query, conn->cur_query_len);
|
||||
#endif
|
||||
}
|
||||
fputs("Attempting backtrace...\n", stderr);
|
||||
my_print_stacktrace(NULL, my_thread_stack_size);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static void dump_backtrace(void)
|
||||
{
|
||||
fputs("Backtrace not available.\n", stderr);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static sig_handler signal_handler(int sig)
|
||||
{
|
||||
fprintf(stderr, "mysqltest got " SIGNAL_FMT "\n", sig);
|
||||
dump_backtrace();
|
||||
}
|
||||
|
||||
#ifdef __WIN__
|
||||
|
||||
LONG WINAPI exception_filter(EXCEPTION_POINTERS *exp)
|
||||
{
|
||||
__try
|
||||
{
|
||||
my_set_exception_pointers(exp);
|
||||
signal_handler(exp->ExceptionRecord->ExceptionCode);
|
||||
}
|
||||
__except(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
fputs("Got exception in exception handler!\n", stderr);
|
||||
}
|
||||
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
}
|
||||
|
||||
|
||||
static void init_signal_handling(void)
|
||||
{
|
||||
UINT mode;
|
||||
|
||||
/* Set output destination of messages to the standard error stream. */
|
||||
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
|
||||
_CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
|
||||
_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE);
|
||||
_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
|
||||
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE);
|
||||
_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
|
||||
|
||||
/* Do not not display the a error message box. */
|
||||
mode= SetErrorMode(0) | SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX;
|
||||
SetErrorMode(mode);
|
||||
|
||||
SetUnhandledExceptionFilter(exception_filter);
|
||||
}
|
||||
|
||||
#else /* __WIN__ */
|
||||
|
||||
static void init_signal_handling(void)
|
||||
{
|
||||
struct sigaction sa;
|
||||
DBUG_ENTER("init_signal_handling");
|
||||
|
||||
#ifdef HAVE_STACKTRACE
|
||||
my_init_stacktrace();
|
||||
#endif
|
||||
|
||||
sa.sa_flags = SA_RESETHAND | SA_NODEFER;
|
||||
sigemptyset(&sa.sa_mask);
|
||||
sigprocmask(SIG_SETMASK, &sa.sa_mask, NULL);
|
||||
|
||||
sa.sa_handler= signal_handler;
|
||||
|
||||
sigaction(SIGSEGV, &sa, NULL);
|
||||
sigaction(SIGABRT, &sa, NULL);
|
||||
#ifdef SIGBUS
|
||||
sigaction(SIGBUS, &sa, NULL);
|
||||
#endif
|
||||
sigaction(SIGILL, &sa, NULL);
|
||||
sigaction(SIGFPE, &sa, NULL);
|
||||
}
|
||||
|
||||
#endif /* !__WIN__ */
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
|
@ -7028,6 +7136,8 @@ int main(int argc, char **argv)
|
|||
save_file[0]= 0;
|
||||
TMPDIR[0]= 0;
|
||||
|
||||
init_signal_handling();
|
||||
|
||||
/* Init expected errors */
|
||||
memset(&saved_expected_errors, 0, sizeof(saved_expected_errors));
|
||||
|
||||
|
|
25
configure.in
25
configure.in
|
@ -10,7 +10,7 @@ AC_CANONICAL_SYSTEM
|
|||
#
|
||||
# When changing major version number please also check switch statement
|
||||
# in mysqlbinlog::check_master_version().
|
||||
AM_INIT_AUTOMAKE(mysql, 5.1.26-rc)
|
||||
AM_INIT_AUTOMAKE(mysql, 5.1.28)
|
||||
AM_CONFIG_HEADER([include/config.h:config.h.in])
|
||||
|
||||
PROTOCOL_VERSION=10
|
||||
|
@ -2341,10 +2341,31 @@ then
|
|||
fi
|
||||
AC_MSG_RESULT("$netinet_inc")
|
||||
|
||||
AC_CACHE_CHECK([support for weak symbols], mysql_cv_weak_symbol,
|
||||
[AC_TRY_LINK([],[
|
||||
extern void __attribute__((weak)) foo(void);
|
||||
], [mysql_cv_weak_symbol=yes], [mysql_cv_weak_symbol=no])])
|
||||
|
||||
if test "x$mysql_cv_weak_symbol" = xyes; then
|
||||
AC_DEFINE(HAVE_WEAK_SYMBOL, 1,
|
||||
[Define to 1 if compiler supports weak symbol attribute.])
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK([whether __bss_start is defined], mysql_cv_bss_start,
|
||||
[AC_TRY_LINK([],[
|
||||
extern char *__bss_start;
|
||||
return __bss_start ? 1 : 0;
|
||||
], [mysql_cv_bss_start=yes], [mysql_cv_bss_start=no])])
|
||||
|
||||
if test "x$mysql_cv_bss_start" = xyes; then
|
||||
AC_DEFINE(HAVE_BSS_START, 1,
|
||||
[Define to 1 if compiler defines __bss_start.])
|
||||
fi
|
||||
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
AC_CHECK_HEADERS(cxxabi.h)
|
||||
AC_CACHE_CHECK([checking for abi::__cxa_demangle], mysql_cv_cxa_demangle,
|
||||
AC_CACHE_CHECK([for abi::__cxa_demangle], mysql_cv_cxa_demangle,
|
||||
[AC_TRY_LINK([#include <cxxabi.h>], [
|
||||
char *foo= 0; int bar= 0;
|
||||
foo= abi::__cxa_demangle(foo, foo, 0, &bar);
|
||||
|
|
|
@ -36,7 +36,7 @@ noinst_HEADERS = config-win.h config-netware.h my_bit.h \
|
|||
mysql_version.h.in my_handler.h my_time.h \
|
||||
my_vle.h my_user.h my_atomic.h atomic/nolock.h \
|
||||
atomic/rwlock.h atomic/x86-gcc.h atomic/x86-msvc.h \
|
||||
atomic/gcc_builtins.h my_libwrap.h
|
||||
atomic/gcc_builtins.h my_libwrap.h my_stacktrace.h
|
||||
|
||||
# Remove built files and the symlinked directories
|
||||
CLEANFILES = $(BUILT_SOURCES) readline openssl
|
||||
|
|
66
include/my_stacktrace.h
Normal file
66
include/my_stacktrace.h
Normal file
|
@ -0,0 +1,66 @@
|
|||
/* Copyright (C) 2000 MySQL 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
|
||||
the Free Software Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#ifndef _my_stacktrace_h_
|
||||
#define _my_stacktrace_h_
|
||||
|
||||
#include <my_global.h>
|
||||
|
||||
#ifdef TARGET_OS_LINUX
|
||||
#if defined (__x86_64__) || defined (__i386__) || \
|
||||
(defined(__alpha__) && defined(__GNUC__))
|
||||
#define HAVE_STACKTRACE 1
|
||||
#endif
|
||||
#elif defined(__WIN__)
|
||||
#define HAVE_STACKTRACE 1
|
||||
#endif
|
||||
|
||||
#if HAVE_BACKTRACE && (HAVE_BACKTRACE_SYMBOLS || HAVE_BACKTRACE_SYMBOLS_FD)
|
||||
#undef HAVE_STACKTRACE
|
||||
#define HAVE_STACKTRACE 1
|
||||
#endif
|
||||
|
||||
#if !defined(__NETWARE__)
|
||||
#define HAVE_WRITE_CORE
|
||||
#endif
|
||||
|
||||
#if HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS && \
|
||||
HAVE_CXXABI_H && HAVE_ABI_CXA_DEMANGLE && \
|
||||
HAVE_WEAK_SYMBOL
|
||||
#define BACKTRACE_DEMANGLE 1
|
||||
#endif
|
||||
|
||||
C_MODE_START
|
||||
|
||||
#if defined(HAVE_STACKTRACE) || defined(HAVE_BACKTRACE)
|
||||
void my_init_stacktrace();
|
||||
void my_print_stacktrace(uchar* stack_bottom, ulong thread_stack);
|
||||
void my_safe_print_str(const char* name, const char* val, int max_len);
|
||||
void my_write_core(int sig);
|
||||
#if BACKTRACE_DEMANGLE
|
||||
char *my_demangle(const char *mangled_name, int *status);
|
||||
#endif
|
||||
#ifdef __WIN__
|
||||
void my_set_exception_pointers(EXCEPTION_POINTERS *ep);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WRITE_CORE
|
||||
void my_write_core(int sig);
|
||||
#endif
|
||||
|
||||
C_MODE_END
|
||||
|
||||
#endif /* _my_stacktrace_h_ */
|
|
@ -185,8 +185,7 @@ SET(LIBMYSQLD_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
|
|||
../sql/strfunc.cc ../sql/table.cc ../sql/thr_malloc.cc
|
||||
../sql/time.cc ../sql/tztime.cc ../sql/uniques.cc ../sql/unireg.cc
|
||||
../sql/partition_info.cc ../sql/sql_connect.cc
|
||||
../sql/scheduler.cc ../sql/stacktrace.c
|
||||
../sql/event_parse_data.cc
|
||||
../sql/scheduler.cc ../sql/event_parse_data.cc
|
||||
${GEN_SOURCES}
|
||||
${LIB_SOURCES})
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
|
|||
sql_select.cc sql_do.cc sql_show.cc set_var.cc \
|
||||
sql_string.cc sql_table.cc sql_test.cc sql_udf.cc \
|
||||
sql_update.cc sql_yacc.cc table.cc thr_malloc.cc time.cc \
|
||||
unireg.cc uniques.cc stacktrace.c sql_union.cc hash_filo.cc \
|
||||
unireg.cc uniques.cc sql_union.cc hash_filo.cc \
|
||||
spatial.cc gstream.cc sql_help.cc tztime.cc sql_cursor.cc \
|
||||
sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \
|
||||
parse_file.cc sql_view.cc sql_trigger.cc my_decimal.cc \
|
||||
|
|
|
@ -79,6 +79,15 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
|
|||
my_bool result= 1;
|
||||
THD *thd=(THD *) mysql->thd;
|
||||
NET *net= &mysql->net;
|
||||
my_bool stmt_skip= stmt ? stmt->state != MYSQL_STMT_INIT_DONE : FALSE;
|
||||
|
||||
if (!thd)
|
||||
{
|
||||
/* Do "reconnect" if possible */
|
||||
if (mysql_reconnect(mysql) || stmt_skip)
|
||||
return 1;
|
||||
thd= (THD *) mysql->thd;
|
||||
}
|
||||
|
||||
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
|
||||
thd->profiling.start_new_query();
|
||||
|
|
|
@ -265,6 +265,22 @@ eval SELECT "$last_error" AS Last_SQL_Error;
|
|||
enable_query_log;
|
||||
query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
|
||||
|
||||
# BUG#37076: TIMESTAMP/DATETIME values are not replicated correctly
|
||||
# between machines with mixed endiannes
|
||||
# (regression test)
|
||||
|
||||
--echo **** Test for BUG#37076 ****
|
||||
--echo **** On Master ****
|
||||
connection master;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (a TIMESTAMP, b DATETIME, c DATE);
|
||||
INSERT INTO t1 VALUES(
|
||||
'2005-11-14 01:01:01', '2005-11-14 01:01:02', '2005-11-14');
|
||||
|
||||
--echo **** On Slave ****
|
||||
sync_slave_with_master slave;
|
||||
SELECT * FROM t1;
|
||||
|
||||
#
|
||||
# cleanup
|
||||
#
|
||||
|
|
|
@ -1429,29 +1429,31 @@ DROP TABLE t1;
|
|||
# Bug#21704: Renaming column does not update FK definition.
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t2;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1(id INT PRIMARY KEY)
|
||||
ENGINE=innodb;
|
||||
|
||||
CREATE TABLE t2(
|
||||
t1_id INT PRIMARY KEY,
|
||||
CONSTRAINT fk1 FOREIGN KEY (t1_id) REFERENCES t1(id))
|
||||
ENGINE=innodb;
|
||||
|
||||
--echo
|
||||
|
||||
--disable_result_log
|
||||
--error ER_ERROR_ON_RENAME
|
||||
ALTER TABLE t1 CHANGE id id2 INT;
|
||||
--enable_result_log
|
||||
|
||||
--echo
|
||||
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# --disable_warnings
|
||||
# DROP TABLE IF EXISTS t1;
|
||||
# DROP TABLE IF EXISTS t2;
|
||||
# --enable_warnings
|
||||
#
|
||||
# CREATE TABLE t1(id INT PRIMARY KEY)
|
||||
# ENGINE=innodb;
|
||||
#
|
||||
# CREATE TABLE t2(
|
||||
# t1_id INT PRIMARY KEY,
|
||||
# CONSTRAINT fk1 FOREIGN KEY (t1_id) REFERENCES t1(id))
|
||||
# ENGINE=innodb;
|
||||
#
|
||||
# --echo
|
||||
#
|
||||
# --disable_result_log
|
||||
# --error ER_ERROR_ON_RENAME
|
||||
# ALTER TABLE t1 CHANGE id id2 INT;
|
||||
# --enable_result_log
|
||||
#
|
||||
# --echo
|
||||
#
|
||||
# DROP TABLE t2;
|
||||
# DROP TABLE t1;
|
||||
#
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
|
59
mysql-test/include/wait_condition.inc.moved
Normal file
59
mysql-test/include/wait_condition.inc.moved
Normal file
|
@ -0,0 +1,59 @@
|
|||
# include/wait_condition.inc
|
||||
#
|
||||
# SUMMARY
|
||||
#
|
||||
# Waits until the passed statement returns true, or the operation
|
||||
# times out.
|
||||
#
|
||||
# USAGE
|
||||
#
|
||||
# let $wait_condition=
|
||||
# SELECT c = 3 FROM t;
|
||||
# --source include/wait_condition.inc
|
||||
#
|
||||
# OR
|
||||
#
|
||||
# let $wait_timeout= 60; # Override default 30 seconds with 60.
|
||||
# let $wait_condition=
|
||||
# SELECT c = 3 FROM t;
|
||||
# --source include/wait_condition.inc
|
||||
# --echo Executed the test condition $wait_condition_reps times
|
||||
#
|
||||
# EXAMPLE
|
||||
# events_bugs.test, events_time_zone.test
|
||||
#
|
||||
|
||||
--disable_query_log
|
||||
|
||||
let $wait_counter= 300;
|
||||
if ($wait_timeout)
|
||||
{
|
||||
let $wait_counter= `SELECT $wait_timeout * 10`;
|
||||
}
|
||||
# Reset $wait_timeout so that its value won't be used on subsequent
|
||||
# calls, and default will be used instead.
|
||||
let $wait_timeout= 0;
|
||||
|
||||
# Keep track of how many times the wait condition is tested
|
||||
# This is used by some tests (e.g., main.status)
|
||||
let $wait_condition_reps= 0;
|
||||
while ($wait_counter)
|
||||
{
|
||||
let $success= `$wait_condition`;
|
||||
inc $wait_condition_reps;
|
||||
if ($success)
|
||||
{
|
||||
let $wait_counter= 0;
|
||||
}
|
||||
if (!$success)
|
||||
{
|
||||
real_sleep 0.1;
|
||||
dec $wait_counter;
|
||||
}
|
||||
}
|
||||
if (!$success)
|
||||
{
|
||||
echo Timeout in wait_condition.inc for $wait_condition;
|
||||
}
|
||||
|
||||
--enable_query_log
|
|
@ -1184,3 +1184,42 @@ check table t1;
|
|||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
drop table t1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (id int, c int) character set latin1;
|
||||
INSERT INTO t1 VALUES (1,1);
|
||||
ALTER TABLE t1 CHANGE c d int;
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 0
|
||||
ALTER TABLE t1 CHANGE d c int;
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 0
|
||||
ALTER TABLE t1 MODIFY c VARCHAR(10);
|
||||
affected rows: 1
|
||||
info: Records: 1 Duplicates: 0 Warnings: 0
|
||||
ALTER TABLE t1 CHANGE c d varchar(10);
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 0
|
||||
ALTER TABLE t1 CHANGE d c varchar(10);
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 0
|
||||
DROP TABLE t1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (id int, c int) character set utf8;
|
||||
INSERT INTO t1 VALUES (1,1);
|
||||
ALTER TABLE t1 CHANGE c d int;
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 0
|
||||
ALTER TABLE t1 CHANGE d c int;
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 0
|
||||
ALTER TABLE t1 MODIFY c VARCHAR(10);
|
||||
affected rows: 1
|
||||
info: Records: 1 Duplicates: 0 Warnings: 0
|
||||
ALTER TABLE t1 CHANGE c d varchar(10);
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 0
|
||||
ALTER TABLE t1 CHANGE d c varchar(10);
|
||||
affected rows: 0
|
||||
info: Records: 0 Duplicates: 0 Warnings: 0
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
|
|
|
@ -104,41 +104,99 @@ t1 CREATE TABLE `t1` (
|
|||
`length(uuid())` int(10) NOT NULL DEFAULT '0'
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 (a timestamp default '2005-05-05 01:01:01',
|
||||
b timestamp default '2005-05-05 01:01:01');
|
||||
insert into t1 set a = now();
|
||||
select sleep(3);
|
||||
sleep(3)
|
||||
0
|
||||
update t1 set b = now();
|
||||
select timediff(b, a) >= '00:00:03' from t1;
|
||||
timediff(b, a) >= '00:00:03'
|
||||
#------------------------------------------------------------------------
|
||||
# Tests for Bug#6760 and Bug#12689
|
||||
SET @row_count = 4;
|
||||
SET @sleep_time_per_result_row = 1;
|
||||
SET @max_acceptable_delay = 2;
|
||||
SET @@global.query_cache_size = 1024 * 64;
|
||||
DROP TEMPORARY TABLE IF EXISTS t_history;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TEMPORARY TABLE t_history (attempt SMALLINT,
|
||||
start_ts DATETIME, end_ts DATETIME,
|
||||
start_cached INTEGER, end_cached INTEGER);
|
||||
CREATE TABLE t1 (f1 BIGINT);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t_history
|
||||
SET attempt = 4 - 4 + 1, start_ts = NOW(),
|
||||
start_cached = 0;
|
||||
SELECT *, SLEEP(@sleep_time_per_result_row) FROM t1;
|
||||
f1 SLEEP(@sleep_time_per_result_row)
|
||||
1 0
|
||||
1 0
|
||||
1 0
|
||||
1 0
|
||||
UPDATE t_history SET end_ts = NOW()
|
||||
WHERE attempt = 4 - 4 + 1;
|
||||
UPDATE t_history SET end_cached = 0
|
||||
WHERE attempt = 4 - 4 + 1;
|
||||
INSERT INTO t_history
|
||||
SET attempt = 4 - 3 + 1, start_ts = NOW(),
|
||||
start_cached = 0;
|
||||
SELECT *, SLEEP(@sleep_time_per_result_row) FROM t1;
|
||||
f1 SLEEP(@sleep_time_per_result_row)
|
||||
1 0
|
||||
1 0
|
||||
1 0
|
||||
1 0
|
||||
UPDATE t_history SET end_ts = NOW()
|
||||
WHERE attempt = 4 - 3 + 1;
|
||||
UPDATE t_history SET end_cached = 0
|
||||
WHERE attempt = 4 - 3 + 1;
|
||||
INSERT INTO t_history
|
||||
SET attempt = 4 - 2 + 1, start_ts = NOW(),
|
||||
start_cached = 0;
|
||||
SELECT *, SLEEP(@sleep_time_per_result_row) FROM t1;
|
||||
f1 SLEEP(@sleep_time_per_result_row)
|
||||
1 0
|
||||
1 0
|
||||
1 0
|
||||
1 0
|
||||
UPDATE t_history SET end_ts = NOW()
|
||||
WHERE attempt = 4 - 2 + 1;
|
||||
UPDATE t_history SET end_cached = 0
|
||||
WHERE attempt = 4 - 2 + 1;
|
||||
INSERT INTO t_history
|
||||
SET attempt = 4 - 1 + 1, start_ts = NOW(),
|
||||
start_cached = 0;
|
||||
SELECT *, SLEEP(@sleep_time_per_result_row) FROM t1;
|
||||
f1 SLEEP(@sleep_time_per_result_row)
|
||||
1 0
|
||||
1 0
|
||||
1 0
|
||||
1 0
|
||||
UPDATE t_history SET end_ts = NOW()
|
||||
WHERE attempt = 4 - 1 + 1;
|
||||
UPDATE t_history SET end_cached = 0
|
||||
WHERE attempt = 4 - 1 + 1;
|
||||
# Test 1: Does the query with SLEEP need a reasonable time?
|
||||
SELECT COUNT(*) >= 4 - 1 INTO @aux1 FROM t_history
|
||||
WHERE TIMEDIFF(end_ts,start_ts) - @sleep_time_per_result_row * @row_count
|
||||
BETWEEN 0 AND @max_acceptable_delay;
|
||||
SELECT @aux1 AS "Expect 1";
|
||||
Expect 1
|
||||
1
|
||||
drop table t1;
|
||||
set global query_cache_size=1355776;
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1),(1),(1);
|
||||
create table t2 (a datetime default null, b datetime default null);
|
||||
insert into t2 set a = now();
|
||||
select a from t1 where sleep(1);
|
||||
a
|
||||
update t2 set b = now() where b is null;
|
||||
insert into t2 set a = now();
|
||||
select a from t1 where sleep(a);
|
||||
a
|
||||
update t2 set b = now() where b is null;
|
||||
insert into t2 set a = now();
|
||||
select a from t1 where sleep(1);
|
||||
a
|
||||
update t2 set b = now() where b is null;
|
||||
select timediff(b, a) >= '00:00:03' from t2;
|
||||
timediff(b, a) >= '00:00:03'
|
||||
# Test 2: Does the query with SLEEP need a reasonable time even in case
|
||||
# of the non first execution?
|
||||
SELECT COUNT(*) >= 4 - 1 - 1 INTO @aux2 FROM t_history
|
||||
WHERE TIMEDIFF(end_ts,start_ts) - @sleep_time_per_result_row * @row_count
|
||||
BETWEEN 0 AND @max_acceptable_delay
|
||||
AND attempt > 1;
|
||||
SELECT @aux2 AS "Expect 1";
|
||||
Expect 1
|
||||
1
|
||||
# Test 3: The query with SLEEP must be not cached.
|
||||
SELECT COUNT(*) = 4 INTO @aux3 FROM t_history
|
||||
WHERE end_cached = start_cached;
|
||||
SELECT @aux3 AS "Expect 1";
|
||||
Expect 1
|
||||
1
|
||||
1
|
||||
drop table t2;
|
||||
drop table t1;
|
||||
set global query_cache_size=default;
|
||||
DROP TABLE t1;
|
||||
DROP TEMPORARY TABLE t_history;
|
||||
SET @@global.query_cache_size = default;
|
||||
create table t1 select INET_ATON('255.255.0.1') as `a`;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
|
|
|
@ -3,11 +3,11 @@ create table t1 (c1 char(5) unique not null, c2 int, stamp timestamp) engine=inn
|
|||
select * from t1;
|
||||
c1 c2 stamp
|
||||
replace delayed into t1 (c1, c2) values ( "text1","11");
|
||||
ERROR HY000: Table storage engine for 't1' doesn't have this option
|
||||
ERROR HY000: DELAYED option not supported for table 't1'
|
||||
select * from t1;
|
||||
c1 c2 stamp
|
||||
replace delayed into t1 (c1, c2) values ( "text1","12");
|
||||
ERROR HY000: Table storage engine for 't1' doesn't have this option
|
||||
ERROR HY000: DELAYED option not supported for table 't1'
|
||||
select * from t1;
|
||||
c1 c2 stamp
|
||||
drop table t1;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
'#--------------------FN_DYNVARS_044_02-------------------------#'
|
||||
SET @old_innodb_max_dirty_pages_pct= @@global.innodb_max_dirty_pages_pct;
|
||||
SET @@global.innodb_max_dirty_pages_pct = 80;
|
||||
'connect (con1,localhost,root,,,,)'
|
||||
'connection con1'
|
||||
|
@ -28,3 +29,5 @@ DROP PROCEDURE add_records;
|
|||
DROP PROCEDURE add_until;
|
||||
DROP PROCEDURE check_pct;
|
||||
DROP FUNCTION dirty_pct;
|
||||
DROP TABLE t1;
|
||||
SET @@global.innodb_max_dirty_pages_pct = @old_innodb_max_dirty_pages_pct;
|
||||
|
|
|
@ -1640,19 +1640,6 @@ vid tid idx name type
|
|||
3 1 2 c1 NULL
|
||||
3 1 1 pk NULL
|
||||
DROP TABLE t1;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t2;
|
||||
CREATE TABLE t1(id INT PRIMARY KEY)
|
||||
ENGINE=innodb;
|
||||
CREATE TABLE t2(
|
||||
t1_id INT PRIMARY KEY,
|
||||
CONSTRAINT fk1 FOREIGN KEY (t1_id) REFERENCES t1(id))
|
||||
ENGINE=innodb;
|
||||
|
||||
ALTER TABLE t1 CHANGE id id2 INT;
|
||||
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
drop table if exists t1, t2, t3;
|
||||
create table t1(a int);
|
||||
|
|
|
@ -38,6 +38,8 @@ t2
|
|||
t3
|
||||
Tables_in_test
|
||||
t1
|
||||
delimiter
|
||||
1
|
||||
_
|
||||
Test delimiter : from command line
|
||||
a
|
||||
|
|
|
@ -1,4 +1,206 @@
|
|||
drop table if exists t1;
|
||||
drop table if exists t1, t2;
|
||||
CREATE TABLE t1 (
|
||||
a INT NOT NULL,
|
||||
b MEDIUMINT NOT NULL,
|
||||
c INT NOT NULL,
|
||||
KEY b (b)
|
||||
) ENGINE=MyISAM
|
||||
PARTITION BY LIST (a) (
|
||||
PARTITION p0 VALUES IN (1)
|
||||
);
|
||||
INSERT INTO t1 VALUES (1,1,0), (1,1,1), (1,1,2), (1,1,53), (1,1,4), (1,1,5),
|
||||
(1,1,6), (1,1,7), (1,1,8), (1,1,9), (1,1,10), (1,1,11), (1,1,12), (1,1,13),
|
||||
(1,1,14), (1,1,15), (1,1,16), (1,1,67), (1,1,18), (1,1,19), (1,1,20), (1,1,21),
|
||||
(1,1,22), (1,1,23), (1,1,24), (1,1,75), (1,1,26), (1,1,27), (1,1,128),
|
||||
(1,1,79), (1,1,30), (1,1,31), (1,1,32), (1,1,33), (1,1,34), (1,1,85), (1,1,36),
|
||||
(1,1,37), (1,1,38), (1,1,39), (1,1,40), (1,1,241), (1,1,42), (1,1,43),
|
||||
(1,1,44), (1,1,45), (1,1,46), (1,1,147), (1,1,48), (1,1,49), (1,2,0), (1,2,1),
|
||||
(1,2,2), (1,2,3), (1,2,4), (1,2,5), (1,2,6), (1,2,7), (1,2,8), (1,2,9),
|
||||
(1,2,10), (1,2,11), (1,2,12), (1,2,13), (1,2,14), (1,2,15), (1,2,16), (1,2,17),
|
||||
(1,2,18), (1,2,19), (1,2,20), (1,2,21), (1,2,22), (1,2,23), (1,2,24), (1,2,25),
|
||||
(1,2,26), (1,2,27), (1,2,28), (1,2,29), (1,2,30), (1,2,31), (1,2,32), (1,2,33),
|
||||
(1,2,34), (1,2,35), (1,2,36), (1,2,37), (1,2,38), (1,2,39), (1,2,40), (1,2,41),
|
||||
(1,2,42), (1,2,43), (1,2,44), (1,2,45), (1,2,46), (1,2,47), (1,2,48), (1,2,49),
|
||||
(1,6,0), (1,6,1), (1,6,2), (1,6,3), (1,6,4), (1,6,5), (1,6,6), (1,6,7),
|
||||
(1,6,8), (1,6,9), (1,6,10), (1,6,11), (1,6,12), (1,6,13), (1,6,14), (1,6,15),
|
||||
(1,6,16), (1,6,17), (1,6,18), (1,6,19), (1,6,20), (1,6,21), (1,6,22), (1,6,23),
|
||||
(1,6,24), (1,6,25), (1,6,26), (1,6,27), (1,6,28), (1,6,29), (1,6,30), (1,6,31),
|
||||
(1,6,32), (1,6,33), (1,6,34), (1,6,35), (1,6,36), (1,6,37), (1,6,38), (1,6,39),
|
||||
(1,6,40), (1,6,41), (1,6,42), (1,6,43), (1,6,44), (1,6,45), (1,6,46), (1,6,47),
|
||||
(1,6,48), (1,6,49), (1,7,0), (1,7,1), (1,7,2), (1,7,3), (1,7,4), (1,7,5),
|
||||
(1,7,6), (1,7,7), (1,7,8), (1,7,9), (1,7,10), (1,7,11), (1,7,12), (1,7,13),
|
||||
(1,7,14), (1,7,15), (1,7,16), (1,7,17), (1,7,18), (1,7,19), (1,7,20), (1,7,21),
|
||||
(1,7,22), (1,7,23), (1,7,24), (1,7,25), (1,7,26), (1,7,27), (1,7,28), (1,7,29),
|
||||
(1,7,30), (1,7,31), (1,7,32), (1,7,33), (1,7,34), (1,7,35), (1,7,38), (1,7,39),
|
||||
(1,7,90), (1,7,41), (1,7,43), (1,7,48), (1,7,49), (1,9,0), (1,9,1), (1,9,2),
|
||||
(1,9,3), (1,9,4), (1,9,5), (1,9,6), (1,9,7), (1,9,8), (1,9,9), (1,9,10),
|
||||
(1,9,11), (1,9,12), (1,9,13), (1,9,14), (1,9,15), (1,9,16), (1,9,17), (1,9,18),
|
||||
(1,9,19), (1,9,20), (1,9,21), (1,9,22), (1,9,23), (1,9,24), (1,9,25), (1,9,26),
|
||||
(1,9,29), (1,9,32), (1,9,35), (1,9,38), (1,10,0), (1,10,1), (1,10,2), (1,10,3),
|
||||
(1,10,4), (1,10,5), (1,10,6), (1,10,7), (1,10,8), (1,10,9), (1,10,10),
|
||||
(1,10,11), (1,10,13), (1,10,14), (1,10,15), (1,10,16), (1,10,17), (1,10,18),
|
||||
(1,10,22), (1,10,24), (1,10,25), (1,10,26), (1,10,28), (1,10,131), (1,10,33),
|
||||
(1,10,84), (1,10,35), (1,10,40), (1,10,42), (1,10,49), (1,11,0), (1,11,1),
|
||||
(1,11,2), (1,11,3), (1,11,4), (1,11,5), (1,11,6), (1,11,7), (1,11,8), (1,11,9),
|
||||
(1,11,10), (1,11,11), (1,11,12), (1,11,13), (1,11,14), (1,11,15), (1,11,16),
|
||||
(1,11,17), (1,11,18), (1,11,19), (1,11,20), (1,11,21), (1,11,22), (1,11,23),
|
||||
(1,11,24), (1,11,25), (1,11,26), (1,11,27), (1,11,28), (1,11,30), (1,11,31),
|
||||
(1,11,32), (1,11,33), (1,11,34), (1,11,35), (1,11,37), (1,11,39), (1,11,40),
|
||||
(1,11,42), (1,11,44), (1,11,45), (1,11,47), (1,11,48), (1,14,104), (1,14,58),
|
||||
(1,14,12), (1,14,13), (1,14,15), (1,14,16), (1,14,17), (1,14,34), (1,15,0),
|
||||
(1,15,1), (1,15,2), (1,15,3), (1,15,4), (1,15,5), (1,15,7), (1,15,9),
|
||||
(1,15,15), (1,15,27), (1,15,49), (1,16,0), (1,16,1), (1,16,3), (1,17,4),
|
||||
(1,19,1);
|
||||
SELECT COUNT(*) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 );
|
||||
COUNT(*)
|
||||
24
|
||||
SELECT SUM(c) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 );
|
||||
SUM(c)
|
||||
400
|
||||
ALTER TABLE t1 DROP INDEX b;
|
||||
SELECT COUNT(*) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 );
|
||||
COUNT(*)
|
||||
24
|
||||
SELECT SUM(c) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 );
|
||||
SUM(c)
|
||||
400
|
||||
ALTER TABLE t1 ENGINE = Memory;
|
||||
SELECT COUNT(*) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 );
|
||||
COUNT(*)
|
||||
24
|
||||
SELECT SUM(c) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 );
|
||||
SUM(c)
|
||||
400
|
||||
ALTER TABLE t1 ADD INDEX b USING HASH (b);
|
||||
SELECT COUNT(*) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 );
|
||||
COUNT(*)
|
||||
24
|
||||
SELECT SUM(c) FROM t1 WHERE b NOT IN ( 1,2,6,7,9,10,11 );
|
||||
SUM(c)
|
||||
400
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE `t1` (
|
||||
`c1` int(11) DEFAULT NULL,
|
||||
KEY `c1` (`c1`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
CREATE TABLE `t2` (
|
||||
`c1` int(11) DEFAULT NULL,
|
||||
KEY `c1` (`c1`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c1) (PARTITION a VALUES LESS THAN (100) ENGINE = MyISAM, PARTITION b VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */;
|
||||
INSERT INTO `t1` VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20);
|
||||
INSERT INTO `t2` VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20);
|
||||
EXPLAIN PARTITIONS SELECT c1 FROM t1 WHERE (c1 > 10 AND c1 < 13) OR (c1 > 17 AND c1 < 20);
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 NULL range c1 c1 5 NULL 4 Using where; Using index
|
||||
FLUSH STATUS;
|
||||
SELECT c1 FROM t1 WHERE (c1 > 10 AND c1 < 13) OR (c1 > 17 AND c1 < 20);
|
||||
c1
|
||||
11
|
||||
12
|
||||
18
|
||||
19
|
||||
SHOW STATUS LIKE 'Handler_read_%';
|
||||
Variable_name Value
|
||||
Handler_read_first 0
|
||||
Handler_read_key 2
|
||||
Handler_read_next 4
|
||||
Handler_read_prev 0
|
||||
Handler_read_rnd 0
|
||||
Handler_read_rnd_next 0
|
||||
EXPLAIN PARTITIONS SELECT c1 FROM t2 WHERE (c1 > 10 AND c1 < 13) OR (c1 > 17 AND c1 < 20);
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 a range c1 c1 5 NULL 4 Using where; Using index
|
||||
FLUSH STATUS;
|
||||
SELECT c1 FROM t2 WHERE (c1 > 10 AND c1 < 13) OR (c1 > 17 AND c1 < 20);
|
||||
c1
|
||||
11
|
||||
12
|
||||
18
|
||||
19
|
||||
SHOW STATUS LIKE 'Handler_read_%';
|
||||
Variable_name Value
|
||||
Handler_read_first 0
|
||||
Handler_read_key 2
|
||||
Handler_read_next 4
|
||||
Handler_read_prev 0
|
||||
Handler_read_rnd 0
|
||||
Handler_read_rnd_next 0
|
||||
DROP TABLE t1,t2;
|
||||
CREATE TABLE `t1` (
|
||||
`c1` int(11) DEFAULT NULL,
|
||||
KEY `c1` (`c1`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||
CREATE TABLE `t2` (
|
||||
`c1` int(11) DEFAULT NULL,
|
||||
KEY `c1` (`c1`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (c1) (PARTITION a VALUES LESS THAN (100) ENGINE = MyISAM, PARTITION b VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */;
|
||||
INSERT INTO `t1` VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20);
|
||||
INSERT INTO `t2` VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20);
|
||||
EXPLAIN PARTITIONS SELECT c1 FROM t1 WHERE (c1 > 2 AND c1 < 5);
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 NULL range c1 c1 5 NULL 2 Using where; Using index
|
||||
FLUSH STATUS;
|
||||
SELECT c1 FROM t1 WHERE (c1 > 2 AND c1 < 5);
|
||||
c1
|
||||
3
|
||||
4
|
||||
SHOW STATUS LIKE 'Handler_read_%';
|
||||
Variable_name Value
|
||||
Handler_read_first 0
|
||||
Handler_read_key 1
|
||||
Handler_read_next 2
|
||||
Handler_read_prev 0
|
||||
Handler_read_rnd 0
|
||||
Handler_read_rnd_next 0
|
||||
EXPLAIN PARTITIONS SELECT c1 FROM t2 WHERE (c1 > 2 AND c1 < 5);
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 a range c1 c1 5 NULL 2 Using where; Using index
|
||||
FLUSH STATUS;
|
||||
SELECT c1 FROM t2 WHERE (c1 > 2 AND c1 < 5);
|
||||
c1
|
||||
3
|
||||
4
|
||||
SHOW STATUS LIKE 'Handler_read_%';
|
||||
Variable_name Value
|
||||
Handler_read_first 0
|
||||
Handler_read_key 1
|
||||
Handler_read_next 2
|
||||
Handler_read_prev 0
|
||||
Handler_read_rnd 0
|
||||
Handler_read_rnd_next 0
|
||||
EXPLAIN PARTITIONS SELECT c1 FROM t1 WHERE (c1 > 12 AND c1 < 15);
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 NULL range c1 c1 5 NULL 2 Using where; Using index
|
||||
FLUSH STATUS;
|
||||
SELECT c1 FROM t1 WHERE (c1 > 12 AND c1 < 15);
|
||||
c1
|
||||
13
|
||||
14
|
||||
SHOW STATUS LIKE 'Handler_read_%';
|
||||
Variable_name Value
|
||||
Handler_read_first 0
|
||||
Handler_read_key 1
|
||||
Handler_read_next 2
|
||||
Handler_read_prev 0
|
||||
Handler_read_rnd 0
|
||||
Handler_read_rnd_next 0
|
||||
EXPLAIN PARTITIONS SELECT c1 FROM t2 WHERE (c1 > 12 AND c1 < 15);
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 a range c1 c1 5 NULL 2 Using where; Using index
|
||||
FLUSH STATUS;
|
||||
SELECT c1 FROM t2 WHERE (c1 > 12 AND c1 < 15);
|
||||
c1
|
||||
13
|
||||
14
|
||||
SHOW STATUS LIKE 'Handler_read_%';
|
||||
Variable_name Value
|
||||
Handler_read_first 0
|
||||
Handler_read_key 1
|
||||
Handler_read_next 2
|
||||
Handler_read_prev 0
|
||||
Handler_read_rnd 0
|
||||
Handler_read_rnd_next 0
|
||||
DROP TABLE t1,t2;
|
||||
create table t1 (a int) partition by list ((a/3)*10 div 1)
|
||||
(partition p0 values in (0), partition p1 values in (1));
|
||||
ERROR HY000: This partition function is not allowed
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -163,13 +163,11 @@ Com_show_status 8
|
|||
rnd_diff tmp_table_diff
|
||||
20 8
|
||||
flush status;
|
||||
show status like 'Com%function%';
|
||||
show status like 'Com%function';
|
||||
Variable_name Value
|
||||
Com_alter_function 0
|
||||
Com_create_function 0
|
||||
Com_drop_function 0
|
||||
Com_show_function_code 0
|
||||
Com_show_function_status 0
|
||||
create function f1 (x INTEGER) returns integer
|
||||
begin
|
||||
declare ret integer;
|
||||
|
@ -177,10 +175,8 @@ set ret = x * 10;
|
|||
return ret;
|
||||
end //
|
||||
drop function f1;
|
||||
show status like 'Com%function%';
|
||||
show status like 'Com%function';
|
||||
Variable_name Value
|
||||
Com_alter_function 0
|
||||
Com_create_function 1
|
||||
Com_drop_function 1
|
||||
Com_show_function_code 0
|
||||
Com_show_function_status 0
|
||||
|
|
|
@ -4391,3 +4391,10 @@ SELECT * FROM t1 WHERE _utf8'a' = ANY (SELECT s1 FROM t1);
|
|||
s1
|
||||
a
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(c int, KEY(c));
|
||||
CREATE TABLE t2(a int, b int);
|
||||
INSERT INTO t2 VALUES (1, 10), (2, NULL);
|
||||
INSERT INTO t1 VALUES (1), (3);
|
||||
SELECT * FROM t2 WHERE b NOT IN (SELECT max(t.c) FROM t1, t1 t WHERE t.c>10);
|
||||
a b
|
||||
DROP TABLE t1,t2;
|
||||
|
|
|
@ -6,6 +6,7 @@ id INT NOT NULL auto_increment,
|
|||
PRIMARY KEY (id),
|
||||
name VARCHAR(30)
|
||||
);
|
||||
SET @old_wait_timeout = @@global.wait_timeout;
|
||||
'#--------------------FN_DYNVARS_186_01-------------------------#'
|
||||
## Creating new connection test_con1 ##
|
||||
## Setting value of variable to 5 ##
|
||||
|
@ -25,6 +26,8 @@ SET @@global.wait_timeout = 1;
|
|||
## Creating new connection ##
|
||||
INSERT into t1(name) values('Record_3');
|
||||
## Using sleep to check timeout ##
|
||||
## We cannot test it further because the server stops due to wait_timeout ##
|
||||
## We cannot test it further because the server closes the connection due to wait_timeout ##
|
||||
SELECT * from t1;
|
||||
ERROR HY000: MySQL server has gone away
|
||||
DROP TABLE t1;
|
||||
SET @@global.wait_timeout = @old_wait_timeout;
|
||||
|
|
15
mysql-test/suite/bugs/r/rpl_bug33029.result
Normal file
15
mysql-test/suite/bugs/r/rpl_bug33029.result
Normal file
|
@ -0,0 +1,15 @@
|
|||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
create table `t1` (`id` int not null auto_increment primary key);
|
||||
create trigger `trg` before insert on `t1` for each row begin end;
|
||||
set @@global.debug="+d,simulate_bug33029";
|
||||
stop slave;
|
||||
start slave;
|
||||
insert into `t1` values ();
|
||||
select * from t1;
|
||||
id
|
||||
1
|
25
mysql-test/suite/bugs/t/rpl_bug33029.test
Normal file
25
mysql-test/suite/bugs/t/rpl_bug33029.test
Normal file
|
@ -0,0 +1,25 @@
|
|||
#
|
||||
# Bug #36443 Server crashes when executing insert when insert trigger on table
|
||||
#
|
||||
# Emulating the former bug#33029 situation to see that there is no crash anymore.
|
||||
#
|
||||
|
||||
|
||||
source include/master-slave.inc;
|
||||
|
||||
create table `t1` (`id` int not null auto_increment primary key);
|
||||
create trigger `trg` before insert on `t1` for each row begin end;
|
||||
|
||||
sync_slave_with_master;
|
||||
set @@global.debug="+d,simulate_bug33029";
|
||||
|
||||
stop slave;
|
||||
start slave;
|
||||
|
||||
connection master;
|
||||
|
||||
insert into `t1` values ();
|
||||
|
||||
sync_slave_with_master;
|
||||
select * from t1;
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
#
|
||||
# The amount and properties of character_sets/collations depend on the
|
||||
# build type
|
||||
# 2007-12 MySQL 5.0
|
||||
# 2007-12 MySQL 5.0, 2008-06 MySQL 5.1
|
||||
# ---------------------------------------------------------------------
|
||||
#
|
||||
# Variant 1 fits to
|
||||
|
@ -33,10 +33,22 @@
|
|||
# Variant 3 fits to
|
||||
# version_comment MySQL Community Server (GPL)
|
||||
# version_comment MySQL Cluster Server (Commercial)
|
||||
# version_comment MySQL Advanced Server (GPL) 5.1
|
||||
# version_comment MySQL Advanced Server (Commercial) 5.1
|
||||
#
|
||||
# Difference between variant 3 and 2 is within the collation properties
|
||||
# IS_COMPILED and SORTLEN.
|
||||
#
|
||||
# 2008-06 All time excluded variant is "vanilla".
|
||||
# How to build "vanilla":
|
||||
# ./BUILD/autorun.sh
|
||||
# ./configure
|
||||
# ./make
|
||||
# Some properties of "vanilla"
|
||||
# version_comment Source distribution
|
||||
# Compared to the variants 1 to 3 a lot of character sets are missing.
|
||||
# Example: "ucs2_bin" is in variant 1 to 3 but not in "vanilla".
|
||||
#
|
||||
# Created:
|
||||
# 2007-12-18 mleich - remove the unstable character_set/collation subtests
|
||||
# from include/datadict-master.inc
|
||||
|
|
|
@ -84,4 +84,3 @@ SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
|||
FROM information_schema.columns
|
||||
$my_where
|
||||
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
|
||||
|
||||
|
|
362
mysql-test/suite/funcs_1/datadict/is_key_column_usage.inc
Normal file
362
mysql-test/suite/funcs_1/datadict/is_key_column_usage.inc
Normal file
|
@ -0,0 +1,362 @@
|
|||
# suite/funcs_1/datadict/is_key_column_usage.inc
|
||||
#
|
||||
# Check the layout of information_schema.key_column_usage and the impact of
|
||||
# CREATE/ALTER/DROP TABLE/VIEW/SCHEMA/COLUMN ... on it.
|
||||
#
|
||||
# Note:
|
||||
# This test is not intended
|
||||
# - to show information about the all time existing tables
|
||||
# within the databases information_schema and mysql
|
||||
# - for checking storage engine properties
|
||||
# Therefore please do not alter $engine_type.
|
||||
#
|
||||
# Author:
|
||||
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
|
||||
# testsuite funcs_1
|
||||
# Create this script based on older scripts and new code.
|
||||
# Last Change:
|
||||
# 2008-06-11 mleich Move t/is_key_column_usage.test to this file and
|
||||
# create variants for embedded/non embedded server.
|
||||
#
|
||||
|
||||
let $engine_type = MEMORY;
|
||||
|
||||
let $is_table = KEY_COLUMN_USAGE;
|
||||
|
||||
# The table INFORMATION_SCHEMA.KEY_COLUMN_USAGE must exist
|
||||
eval SHOW TABLES FROM information_schema LIKE '$is_table';
|
||||
|
||||
--echo #######################################################################
|
||||
--echo # Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
--echo #######################################################################
|
||||
# Ensure that every INFORMATION_SCHEMA table can be queried with a SELECT
|
||||
# statement, just as if it were an ordinary user-defined table.
|
||||
#
|
||||
--source suite/funcs_1/datadict/is_table_query.inc
|
||||
|
||||
|
||||
--echo #########################################################################
|
||||
--echo # Testcase 3.2.7.1: INFORMATION_SCHEMA.KEY_COLUMN_USAGE layout
|
||||
--echo #########################################################################
|
||||
# Ensure that the INFORMATION_SCHEMA.KEY_COLUMN_USAGE table has the following
|
||||
# columns, in the following order:
|
||||
#
|
||||
# CONSTRAINT_CATALOG (always shows NULL),
|
||||
# CONSTRAINT_SCHEMA (shows the database, or schema, in which an accessible
|
||||
# constraint, or index, resides),
|
||||
# CONSTRAINT_NAME (shows the name of the accessible constraint),
|
||||
# TABLE_CATALOG (always shows NULL),
|
||||
# TABLE_SCHEMA (shows the database, or schema, in which the table constrained
|
||||
# by that constraint resides),
|
||||
# TABLE_NAME (shows the name of the table constrained by the constraint),
|
||||
# COLUMN_NAME (shows the name of a column that is the index key, or part of
|
||||
# the index key),
|
||||
# ORDINAL_POSITION (shows the ordinal position of the column within the
|
||||
# constraint index),
|
||||
# POSITION_IN_UNIQUE_CONSTRAINT (shows, for a foreign key column, the ordinal
|
||||
# position of the referenced column within the referenced unique index;
|
||||
# otherwise NULL).
|
||||
# added with 5.0.6:
|
||||
# REFERENCED_TABLE_SCHEMA,
|
||||
# REFERENCED_TABLE_NAME,
|
||||
# REFERENCED_COLUMN_NAME
|
||||
#
|
||||
--source suite/funcs_1/datadict/datadict_bug_12777.inc
|
||||
eval DESCRIBE information_schema.$is_table;
|
||||
--source suite/funcs_1/datadict/datadict_bug_12777.inc
|
||||
eval SHOW CREATE TABLE information_schema.$is_table;
|
||||
--source suite/funcs_1/datadict/datadict_bug_12777.inc
|
||||
eval SHOW COLUMNS FROM information_schema.$is_table;
|
||||
|
||||
# Note: Retrieval of information within information_schema.columns about
|
||||
# information_schema.key_column_usage is in is_columns_is.test.
|
||||
|
||||
# Show that CONSTRAINT_CATALOG and TABLE_CATALOG are always NULL.
|
||||
SELECT constraint_catalog, constraint_schema, constraint_name, table_catalog,
|
||||
table_schema, table_name, column_name
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE constraint_catalog IS NOT NULL OR table_catalog IS NOT NULL;
|
||||
|
||||
|
||||
--echo ########################################################################################
|
||||
--echo # Testcase 3.2.7.2 + 3.2.7.3: INFORMATION_SCHEMA.KEY_COLUMN_USAGE accessible information
|
||||
--echo ########################################################################################
|
||||
# 3.2.7.2: Ensure that the table shows the relevant information on every column, defined to
|
||||
# be part of an index key, which is accessible to the current user or to PUBLIC.
|
||||
# 3.2.7.3: Ensure that the table does not show any information on any indexed column that is
|
||||
# not accessible to the current user or PUBLIC.
|
||||
#
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
--enable_warnings
|
||||
CREATE DATABASE db_datadict;
|
||||
|
||||
--error 0,ER_CANNOT_USER
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
--error 0,ER_CANNOT_USER
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
CREATE USER 'testuser2'@'localhost';
|
||||
|
||||
USE db_datadict;
|
||||
|
||||
--replace_result $engine_type <engine_type>
|
||||
eval
|
||||
CREATE TABLE t1_1
|
||||
(f1 INT NOT NULL, PRIMARY KEY(f1),
|
||||
f2 INT, INDEX f2_ind(f2))
|
||||
ENGINE = $engine_type;
|
||||
GRANT SELECT ON t1_1 to 'testuser1'@'localhost';
|
||||
|
||||
--replace_result $engine_type <engine_type>
|
||||
eval
|
||||
CREATE TABLE t1_2
|
||||
(f1 INT NOT NULL, PRIMARY KEY(f1),
|
||||
f2 INT, INDEX f2_ind(f2))
|
||||
ENGINE = $engine_type;
|
||||
GRANT SELECT ON t1_2 to 'testuser2'@'localhost';
|
||||
#FIXME: add foreign keys
|
||||
|
||||
let $select= SELECT * FROM information_schema.key_column_usage
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY constraint_catalog, constraint_schema, constraint_name,
|
||||
table_catalog, table_schema, table_name, ordinal_position;
|
||||
|
||||
# show view of user root
|
||||
eval $select;
|
||||
|
||||
--echo # Establish connection testuser1 (user=testuser1)
|
||||
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
|
||||
connect (testuser1, localhost, testuser1, , db_datadict);
|
||||
eval $select;
|
||||
|
||||
--echo # Establish connection testuser2 (user=testuser2)
|
||||
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
|
||||
connect (testuser2, localhost, testuser2, , db_datadict);
|
||||
eval $select;
|
||||
|
||||
# Cleanup
|
||||
--echo # Switch to connection default and close connections testuser1, testuser2
|
||||
connection default;
|
||||
disconnect testuser1;
|
||||
disconnect testuser2;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
DROP TABLE t1_1;
|
||||
DROP TABLE t1_2;
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
|
||||
|
||||
--echo ########################################################################################
|
||||
--echo # Testcase 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.KEY_COLUMN_USAGE modifications
|
||||
--echo ########################################################################################
|
||||
# 3.2.1.13: Ensure that the creation of any new database object (e.g. table or
|
||||
# column) automatically inserts all relevant information on that
|
||||
# object into every appropriate INFORMATION_SCHEMA table.
|
||||
# 3.2.1.14: Ensure that the alteration of any existing database object
|
||||
# automatically updates all relevant information on that object in
|
||||
# every appropriate INFORMATION_SCHEMA table.
|
||||
# 3.2.1.15: Ensure that the dropping of any existing database object
|
||||
# automatically deletes all relevant information on that object from
|
||||
# every appropriate INFORMATION_SCHEMA table.
|
||||
#
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
DROP TABLE IF EXISTS test.t1_my_table;
|
||||
--enable_warnings
|
||||
CREATE DATABASE db_datadict;
|
||||
|
||||
SELECT table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
--replace_result $engine_type <engine_type>
|
||||
eval
|
||||
CREATE TABLE test.t1_my_table
|
||||
(f1 CHAR(12), f2 TIMESTAMP, f4 BIGINT, PRIMARY KEY(f1,f2))
|
||||
DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci
|
||||
ENGINE = $engine_type;
|
||||
# Settings used in CREATE TABLE must be visible
|
||||
# in information_schema.key_column_usage.
|
||||
--vertical_results
|
||||
SELECT * FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_table';
|
||||
--horizontal_results
|
||||
#
|
||||
# Check modification of TABLE_NAME
|
||||
SELECT DISTINCT table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
RENAME TABLE test.t1_my_table TO test.t1_my_tablex;
|
||||
SELECT DISTINCT table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
#
|
||||
# Check modification of TABLE_SCHEMA
|
||||
SELECT DISTINCT table_schema,table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
RENAME TABLE test.t1_my_tablex TO db_datadict.t1_my_tablex;
|
||||
SELECT DISTINCT table_schema,table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
#
|
||||
# Check modification of COLUMN_NAME
|
||||
SELECT DISTINCT table_name, column_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY table_name, column_name;
|
||||
ALTER TABLE db_datadict.t1_my_tablex CHANGE COLUMN f1 first_col CHAR(12);
|
||||
SELECT DISTINCT table_name, column_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY table_name, column_name;
|
||||
#
|
||||
# Note: The size of the column list and the not very selective qualification
|
||||
# is intended. I want to see that the schema names are equal and
|
||||
# all records about 't1_my_tablex'.
|
||||
let $my_select = SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, column_name, ordinal_position
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY constraint_schema, constraint_name, table_schema,
|
||||
table_name, ordinal_position;
|
||||
#
|
||||
# Check ADD INDEX being not UNIQUE (does not show up in key_column_usage)
|
||||
eval $my_select;
|
||||
CREATE INDEX f2 ON db_datadict.t1_my_tablex(f2);
|
||||
eval $my_select;
|
||||
DROP INDEX f2 ON db_datadict.t1_my_tablex;
|
||||
#
|
||||
# Check ADD UNIQUE INDEX without name explicit assigned
|
||||
eval $my_select;
|
||||
ALTER TABLE db_datadict.t1_my_tablex ADD UNIQUE (f2);
|
||||
eval $my_select;
|
||||
DROP INDEX f2 ON db_datadict.t1_my_tablex;
|
||||
#
|
||||
# Check ADD UNIQUE INDEX with name explicit assigned
|
||||
eval $my_select;
|
||||
ALTER TABLE db_datadict.t1_my_tablex ADD UNIQUE my_idx (f2);
|
||||
eval $my_select;
|
||||
DROP INDEX my_idx ON db_datadict.t1_my_tablex;
|
||||
eval $my_select;
|
||||
ALTER TABLE db_datadict.t1_my_tablex ADD UNIQUE my_idx (f4,first_col);
|
||||
eval $my_select;
|
||||
#
|
||||
# Check DROP COLUMN
|
||||
eval $my_select;
|
||||
ALTER TABLE db_datadict.t1_my_tablex
|
||||
DROP COLUMN first_col;
|
||||
eval $my_select;
|
||||
#
|
||||
# Check impact of DROP TABLE
|
||||
SELECT table_name, column_name
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY table_name, column_name;
|
||||
DROP TABLE db_datadict.t1_my_tablex;
|
||||
SELECT table_name, column_name
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
#
|
||||
# No UNIQUE CONSTRAINT -> no entry in key_column_usage
|
||||
SELECT table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
--replace_result $engine_type <engine_type>
|
||||
eval
|
||||
CREATE TABLE db_datadict.t1_my_tablex
|
||||
ENGINE = $engine_type AS
|
||||
SELECT 1 AS f1;
|
||||
SELECT table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
# UNIQUE CONSTRAINT -> entry in key_column_usage
|
||||
ALTER TABLE db_datadict.t1_my_tablex ADD PRIMARY KEY(f1);
|
||||
SELECT table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
#
|
||||
# Check impact of DROP SCHEMA
|
||||
SELECT table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
DROP DATABASE db_datadict;
|
||||
SELECT table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
#
|
||||
|
||||
|
||||
--echo ########################################################################
|
||||
--echo # Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
--echo # DDL on INFORMATION_SCHEMA table are not supported
|
||||
--echo ########################################################################
|
||||
# 3.2.1.3: Ensure that no user may execute an INSERT statement on any
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.4: Ensure that no user may execute an UPDATE statement on any
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.5: Ensure that no user may execute a DELETE statement on any
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.8: Ensure that no user may create an index on an
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.9: Ensure that no user may alter the definition of an
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.10: Ensure that no user may drop an INFORMATION_SCHEMA table.
|
||||
# 3.2.1.11: Ensure that no user may move an INFORMATION_SCHEMA table to any
|
||||
# other database.
|
||||
# 3.2.1.12: Ensure that no user may directly add to, alter, or delete any data
|
||||
# in an INFORMATION_SCHEMA table.
|
||||
#
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
DROP TABLE IF EXISTS db_datadict.t1;
|
||||
--enable_warnings
|
||||
CREATE DATABASE db_datadict;
|
||||
--replace_result $engine_type <engine_type>
|
||||
eval
|
||||
CREATE TABLE db_datadict.t1 (f1 BIGINT)
|
||||
ENGINE = $engine_type;
|
||||
|
||||
# Note(mleich):
|
||||
# 1. We can get here different error messages.
|
||||
# 2. We do not want to unify the individual messages to the far to unspecific
|
||||
# 'Got one of the listed errors'.
|
||||
let $my_error_message =
|
||||
##### The previous statement must fail ######
|
||||
# Server type | expected error name | expected error message
|
||||
# --------------------------------------------------------------------------------------------------------------------
|
||||
# not embedded | ER_DBACCESS_DENIED_ERROR | ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
# embedded | ER_NON_INSERTABLE_TABLE | ERROR HY000: The target table schemata of the INSERT is not insertable-into
|
||||
# | or similar | or similar
|
||||
;
|
||||
|
||||
--disable_abort_on_error
|
||||
INSERT INTO information_schema.key_column_usage
|
||||
(constraint_schema, constraint_name, table_name)
|
||||
VALUES ( 'mysql', 'primary', 'db');
|
||||
if (!$mysql_errno)
|
||||
{
|
||||
--echo $my_error_message
|
||||
exit;
|
||||
}
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
INSERT INTO information_schema.key_column_usage
|
||||
SELECT * FROM information_schema.key_column_usage;
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
UPDATE information_schema.key_column_usage
|
||||
SET table_name = 'db1' WHERE constraint_name = 'primary';
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
DELETE FROM information_schema.key_column_usage WHERE table_name = 't1';
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
TRUNCATE information_schema.key_column_usage;
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
CREATE INDEX i3 ON information_schema.key_column_usage(table_name);
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
ALTER TABLE information_schema.key_column_usage ADD f1 INT;
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
DROP TABLE information_schema.key_column_usage;
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
ALTER TABLE information_schema.key_column_usage
|
||||
RENAME db_datadict.key_column_usage;
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
ALTER TABLE information_schema.key_column_usage
|
||||
RENAME information_schema.xkey_column_usage;
|
||||
--enable_abort_on_error
|
||||
|
||||
# Cleanup
|
||||
DROP TABLE db_datadict.t1;
|
||||
DROP DATABASE db_datadict;
|
522
mysql-test/suite/funcs_1/datadict/is_routines.inc
Normal file
522
mysql-test/suite/funcs_1/datadict/is_routines.inc
Normal file
|
@ -0,0 +1,522 @@
|
|||
# suite/funcs_1/datadict/is_routines.inc
|
||||
#
|
||||
# Check the layout of information_schema.routines and the impact of
|
||||
# CREATE/ALTER/DROP PROCEDURE/FUNCTION ... on it.
|
||||
#
|
||||
# Note:
|
||||
# This test is not intended
|
||||
# - to show information about the all time existing routines (there are no
|
||||
# in the moment) within the databases information_schema and mysql
|
||||
# - for checking storage engine properties
|
||||
# Therefore please do not alter $engine_type and $other_engine_type.
|
||||
#
|
||||
# Author:
|
||||
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
|
||||
# testsuite funcs_1
|
||||
# Create this script based on older scripts and new code.
|
||||
# Last Change:
|
||||
# 2008-06-11 mleich Move t/is_routines.test to this file and
|
||||
# create variants for embedded/non embedded server.
|
||||
#
|
||||
|
||||
let $engine_type = MEMORY;
|
||||
let $other_engine_type = MyISAM;
|
||||
|
||||
let $is_table = ROUTINES;
|
||||
|
||||
# The table INFORMATION_SCHEMA.TABLES must exist
|
||||
eval SHOW TABLES FROM information_schema LIKE '$is_table';
|
||||
|
||||
--echo #######################################################################
|
||||
--echo # Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
--echo #######################################################################
|
||||
# Ensure that every INFORMATION_SCHEMA table can be queried with a SELECT
|
||||
# statement, just as if it were an ordinary user-defined table.
|
||||
#
|
||||
--source suite/funcs_1/datadict/is_table_query.inc
|
||||
|
||||
|
||||
--echo #########################################################################
|
||||
--echo # Testcase 3.2.8.1: INFORMATION_SCHEMA.ROUTINES layout
|
||||
--echo #########################################################################
|
||||
# Ensure that the INFORMATION_SCHEMA.ROUTINES table has the following columns,
|
||||
# in the following order:
|
||||
#
|
||||
# SPECIFIC_NAME (shows the name of an accessible stored procedure, or routine),
|
||||
# ROUTINE_CATALOG (always shows NULL),
|
||||
# ROUTINE_SCHEMA (shows the database, or schema, in which the routine resides),
|
||||
# ROUTINE_NAME (shows the same stored procedure name),
|
||||
# ROUTINE_TYPE (shows whether the stored procedure is a procedure or a function),
|
||||
# DTD_IDENTIFIER (shows, for a function, the complete data type definition of
|
||||
# the value the function will return; otherwise NULL),
|
||||
# ROUTINE_BODY (shows the language in which the stored procedure is written;
|
||||
# currently always SQL),
|
||||
# ROUTINE_DEFINITION (shows as much of the routine body as is possible in the
|
||||
# allotted space),
|
||||
# EXTERNAL_NAME (always shows NULL),
|
||||
# EXTERNAL_LANGUAGE (always shows NULL),
|
||||
# PARAMETER_STYLE (shows the routine's parameter style; always SQL),
|
||||
# IS_DETERMINISTIC (shows whether the routine is deterministic),
|
||||
# SQL_DATA_ACCESS (shows the routine's defined sql-data-access clause value),
|
||||
# SQL_PATH (always shows NULL),
|
||||
# SECURITY_TYPE (shows whether the routine's defined security_type is 'definer'
|
||||
# or 'invoker'),
|
||||
# CREATED (shows the timestamp of the time the routine was created),
|
||||
# LAST_ALTERED (shows the timestamp of the time the routine was last altered),
|
||||
# SQL_MODE (shows the sql_mode setting at the time the routine was created),
|
||||
# ROUTINE_COMMENT (shows the comment, if any, defined for the routine;
|
||||
# otherwise NULL),
|
||||
# DEFINER (shows the user who created the routine).
|
||||
# Starting with MySQL 5.1
|
||||
# CHARACTER_SET_CLIENT
|
||||
# COLLATION_CONNECTION
|
||||
# DATABASE_COLLATION
|
||||
#
|
||||
--source suite/funcs_1/datadict/datadict_bug_12777.inc
|
||||
eval DESCRIBE information_schema.$is_table;
|
||||
--source suite/funcs_1/datadict/datadict_bug_12777.inc
|
||||
eval SHOW CREATE TABLE information_schema.$is_table;
|
||||
--source suite/funcs_1/datadict/datadict_bug_12777.inc
|
||||
eval SHOW COLUMNS FROM information_schema.$is_table;
|
||||
|
||||
USE test;
|
||||
--disable_warnings
|
||||
DROP PROCEDURE IF EXISTS sp_for_routines;
|
||||
DROP FUNCTION IF EXISTS function_for_routines;
|
||||
--enable_warnings
|
||||
CREATE PROCEDURE sp_for_routines() SELECT 'db_datadict';
|
||||
CREATE FUNCTION function_for_routines() RETURNS INT RETURN 0;
|
||||
|
||||
# Show that the column values of
|
||||
# ROUTINE_CATALOG, EXTERNAL_NAME, EXTERNAL_LANGUAGE, SQL_PATH are always NULL
|
||||
# and
|
||||
# ROUTINE_BODY, PARAMETER_STYLE are 'SQL'
|
||||
# and
|
||||
# SPECIFIC_NAME = ROUTINE_NAME.
|
||||
SELECT specific_name,routine_catalog,routine_schema,routine_name,routine_type,
|
||||
routine_body,external_name,external_language,parameter_style,sql_path
|
||||
FROM information_schema.routines
|
||||
WHERE routine_catalog IS NOT NULL OR external_name IS NOT NULL
|
||||
OR external_language IS NOT NULL OR sql_path IS NOT NULL
|
||||
OR routine_body <> 'SQL' OR parameter_style <> 'SQL'
|
||||
OR specific_name <> routine_name;
|
||||
|
||||
DROP PROCEDURE sp_for_routines;
|
||||
DROP FUNCTION function_for_routines;
|
||||
|
||||
|
||||
--echo ################################################################################
|
||||
--echo # Testcase 3.2.8.2 + 3.2.8.3: INFORMATION_SCHEMA.ROUTINES accessible information
|
||||
--echo ################################################################################
|
||||
# 3.2.8.2: Ensure that the table shows the relevant information on every SQL-invoked
|
||||
# routine (i.e. stored procedure) which is accessible to the current user
|
||||
# or to PUBLIC.
|
||||
# 3.2.8.3: Ensure that the table does not show any information on any stored procedure
|
||||
# that is not accessible to the current user or PUBLIC.
|
||||
#
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
DROP DATABASE IF EXISTS db_datadict_2;
|
||||
--enable_warnings
|
||||
|
||||
CREATE DATABASE db_datadict;
|
||||
USE db_datadict;
|
||||
--replace_result $other_engine_type <other_engine_type>
|
||||
eval
|
||||
CREATE TABLE res_6_408002_1(f1 CHAR(3), f2 TEXT(25), f3 DATE, f4 INT)
|
||||
ENGINE = $other_engine_type;
|
||||
INSERT INTO res_6_408002_1(f1, f2, f3, f4)
|
||||
VALUES('abc', 'xyz', '1989-11-09', 0815);
|
||||
--disable_warnings
|
||||
DROP PROCEDURE IF EXISTS sp_6_408002_1;
|
||||
--enable_warnings
|
||||
delimiter //;
|
||||
CREATE PROCEDURE sp_6_408002_1()
|
||||
BEGIN
|
||||
SELECT * FROM db_datadict.res_6_408002_1;
|
||||
END//
|
||||
delimiter ;//
|
||||
|
||||
CREATE DATABASE db_datadict_2;
|
||||
USE db_datadict_2;
|
||||
--replace_result $other_engine_type <other_engine_type>
|
||||
eval
|
||||
CREATE TABLE res_6_408002_2(f1 CHAR(3), f2 TEXT(25), f3 DATE, f4 INT)
|
||||
ENGINE = $other_engine_type;
|
||||
INSERT INTO res_6_408002_2(f1, f2, f3, f4)
|
||||
VALUES('abc', 'xyz', '1990-10-03', 4711);
|
||||
--disable_warnings
|
||||
DROP PROCEDURE IF EXISTS sp_6_408002_2;
|
||||
--enable_warnings
|
||||
delimiter //;
|
||||
CREATE PROCEDURE sp_6_408002_2()
|
||||
BEGIN
|
||||
SELECT * FROM db_datadict_2.res_6_408002_2;
|
||||
END//
|
||||
delimiter ;//
|
||||
|
||||
--error 0,ER_CANNOT_USER
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
--error 0,ER_CANNOT_USER
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
CREATE USER 'testuser2'@'localhost';
|
||||
--error 0,ER_CANNOT_USER
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
CREATE USER 'testuser3'@'localhost';
|
||||
|
||||
|
||||
GRANT SELECT ON db_datadict_2.* TO 'testuser1'@'localhost';
|
||||
GRANT EXECUTE ON db_datadict_2.* TO 'testuser1'@'localhost';
|
||||
|
||||
GRANT EXECUTE ON db_datadict.* TO 'testuser1'@'localhost';
|
||||
GRANT SELECT ON db_datadict.* TO 'testuser2'@'localhost';
|
||||
|
||||
GRANT EXECUTE ON PROCEDURE db_datadict_2.sp_6_408002_2
|
||||
TO 'testuser2'@'localhost';
|
||||
GRANT EXECUTE ON db_datadict_2.* TO 'testuser2'@'localhost';
|
||||
FLUSH PRIVILEGES;
|
||||
|
||||
--echo # Establish connection testuser1 (user=testuser1)
|
||||
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
|
||||
connect (testuser1, localhost, testuser1, , db_datadict);
|
||||
--replace_column 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
|
||||
SELECT * FROM information_schema.routines;
|
||||
|
||||
--echo # Establish connection testuser2 (user=testuser2)
|
||||
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
|
||||
connect (testuser2, localhost, testuser2, , db_datadict);
|
||||
--replace_column 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
|
||||
SELECT * FROM information_schema.routines;
|
||||
|
||||
--echo # Establish connection testuser3 (user=testuser3)
|
||||
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
|
||||
connect (testuser3, localhost, testuser3, , test);
|
||||
--replace_column 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
|
||||
SELECT * FROM information_schema.routines;
|
||||
|
||||
# Cleanup
|
||||
--echo # Switch to connection default and close connections testuser1,testuser2,testuser3
|
||||
connection default;
|
||||
disconnect testuser1;
|
||||
disconnect testuser2;
|
||||
disconnect testuser3;
|
||||
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
|
||||
USE test;
|
||||
DROP DATABASE db_datadict;
|
||||
DROP DATABASE db_datadict_2;
|
||||
|
||||
|
||||
--echo #########################################################################
|
||||
--echo # 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.ROUTINES modifications
|
||||
--echo #########################################################################
|
||||
# 3.2.1.13: Ensure that the creation of any new database object (e.g. table or
|
||||
# column) automatically inserts all relevant information on that
|
||||
# object into every appropriate INFORMATION_SCHEMA table.
|
||||
# 3.2.1.14: Ensure that the alteration of any existing database object
|
||||
# automatically updates all relevant information on that object in
|
||||
# every appropriate INFORMATION_SCHEMA table.
|
||||
# 3.2.1.15: Ensure that the dropping of any existing database object
|
||||
# automatically deletes all relevant information on that object from
|
||||
# every appropriate INFORMATION_SCHEMA table.
|
||||
#
|
||||
# Some more tests are in t/information_schema_routines.test which exists
|
||||
# in MySQL 5.1 and up only.
|
||||
#
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
--enable_warnings
|
||||
CREATE DATABASE db_datadict;
|
||||
|
||||
SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict';
|
||||
USE db_datadict;
|
||||
CREATE PROCEDURE sp_for_routines() SELECT 'db_datadict';
|
||||
CREATE FUNCTION function_for_routines() RETURNS INT RETURN 0;
|
||||
--vertical_results
|
||||
--replace_column 16 <created> 17 <modified>
|
||||
SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict'
|
||||
ORDER BY routine_name;
|
||||
--horizontal_results
|
||||
|
||||
ALTER PROCEDURE sp_for_routines SQL SECURITY INVOKER;
|
||||
ALTER FUNCTION function_for_routines COMMENT 'updated comments';
|
||||
--vertical_results
|
||||
--replace_column 16 <created> 17 <modified>
|
||||
SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict'
|
||||
ORDER BY routine_name;
|
||||
--horizontal_results
|
||||
|
||||
DROP PROCEDURE sp_for_routines;
|
||||
DROP FUNCTION function_for_routines;
|
||||
SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict';
|
||||
|
||||
CREATE PROCEDURE sp_for_routines() SELECT 'db_datadict';
|
||||
CREATE FUNCTION function_for_routines() RETURNS INT RETURN 0;
|
||||
--vertical_results
|
||||
--replace_column 16 <created> 17 <modified>
|
||||
SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict'
|
||||
ORDER BY routine_name;
|
||||
--horizontal_results
|
||||
use test;
|
||||
DROP DATABASE db_datadict;
|
||||
SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict';
|
||||
|
||||
|
||||
--echo #########################################################################
|
||||
--echo # 3.2.8.4: INFORMATION_SCHEMA.ROUTINES routine body too big for
|
||||
--echo # ROUTINE_DEFINITION column
|
||||
--echo #########################################################################
|
||||
# Ensure that a stored procedure with a routine body that is too large to fit
|
||||
# into the INFORMATION_SCHEMA.ROUTINES.ROUTINE_DEFINITION column correctly shows
|
||||
# as much of the information as is possible within the allotted size.
|
||||
#
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
--enable_warnings
|
||||
CREATE DATABASE db_datadict;
|
||||
USE db_datadict;
|
||||
#
|
||||
--replace_result $other_engine_type <other_engine_type>
|
||||
eval
|
||||
CREATE TABLE db_datadict.res_6_408004_1
|
||||
(f1 LONGTEXT , f2 MEDIUMINT , f3 LONGBLOB , f4 REAL , f5 YEAR)
|
||||
ENGINE = $other_engine_type;
|
||||
INSERT INTO db_datadict.res_6_408004_1
|
||||
VALUES ('abc', 98765 , 99999999 , 98765, 10);
|
||||
#
|
||||
--replace_result $other_engine_type <other_engine_type>
|
||||
eval
|
||||
CREATE TABLE db_datadict.res_6_408004_2
|
||||
(f1 LONGTEXT , f2 MEDIUMINT , f3 LONGBLOB , f4 REAL , f5 YEAR)
|
||||
ENGINE = $other_engine_type;
|
||||
INSERT INTO db_datadict.res_6_408004_2
|
||||
VALUES ('abc', 98765 , 99999999 , 98765, 10);
|
||||
|
||||
--echo # Checking the max. possible length of (currently) 4 GByte is not
|
||||
--echo # in this environment here.
|
||||
|
||||
delimiter //;
|
||||
CREATE PROCEDURE sp_6_408004 ()
|
||||
BEGIN
|
||||
DECLARE done INTEGER DEFAULt 0;
|
||||
DECLARE variable_number_1 LONGTEXT;
|
||||
DECLARE variable_number_2 MEDIUMINT;
|
||||
DECLARE variable_number_3 LONGBLOB;
|
||||
DECLARE variable_number_4 REAL;
|
||||
DECLARE variable_number_5 YEAR;
|
||||
DECLARE cursor_number_1 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10;
|
||||
DECLARE cursor_number_2 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10;
|
||||
DECLARE cursor_number_3 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10;
|
||||
DECLARE cursor_number_4 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10;
|
||||
DECLARE cursor_number_5 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10;
|
||||
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
|
||||
BEGIN
|
||||
OPEN cursor_number_1;
|
||||
WHILE done <> 1 DO
|
||||
FETCH cursor_number_1
|
||||
INTO variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5;
|
||||
IF done <> 0 THEN
|
||||
INSERT INTO res_6_408004_2
|
||||
VALUES (variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5);
|
||||
END IF;
|
||||
END WHILE;
|
||||
BEGIN
|
||||
BEGIN
|
||||
SET done = 0;
|
||||
OPEN cursor_number_2;
|
||||
WHILE done <> 1 DO
|
||||
FETCH cursor_number_2
|
||||
INTO variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5;
|
||||
IF done <> 0 THEN
|
||||
INSERT INTO res_6_408004_2
|
||||
VALUES(variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5);
|
||||
END IF;
|
||||
END WHILE;
|
||||
END;
|
||||
SET done = 0;
|
||||
OPEN cursor_number_3;
|
||||
WHILE done <> 1 DO
|
||||
FETCH cursor_number_3
|
||||
INTO variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5;
|
||||
IF done <> 0 THEN
|
||||
INSERT INTO res_6_408004_2
|
||||
VALUES(variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5);
|
||||
END IF;
|
||||
END WHILE;
|
||||
END;
|
||||
END;
|
||||
BEGIN
|
||||
SET done = 0;
|
||||
OPEN cursor_number_4;
|
||||
WHILE done <> 1 DO
|
||||
FETCH cursor_number_4
|
||||
INTO variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5;
|
||||
IF done <> 0 THEN
|
||||
INSERT INTO res_6_408004_2
|
||||
VALUES (variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5);
|
||||
END IF;
|
||||
END WHILE;
|
||||
END;
|
||||
BEGIN
|
||||
SET @a='test row';
|
||||
SELECT @a;
|
||||
SELECT @a;
|
||||
SELECT @a;
|
||||
END;
|
||||
BEGIN
|
||||
SET done = 0;
|
||||
OPEN cursor_number_5;
|
||||
WHILE done <> 1 DO
|
||||
FETCH cursor_number_5
|
||||
INTO variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5;
|
||||
IF done <> 0 THEN
|
||||
INSERT INTO res_6_408004_2
|
||||
VALUES (variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5);
|
||||
END IF;
|
||||
END WHILE;
|
||||
END;
|
||||
BEGIN
|
||||
SET @a='test row';
|
||||
SELECT @a;
|
||||
SELECT @a;
|
||||
SELECT @a;
|
||||
END;
|
||||
END//
|
||||
delimiter ;//
|
||||
|
||||
CALL db_datadict.sp_6_408004 ();
|
||||
SELECT * FROM db_datadict.res_6_408004_2;
|
||||
|
||||
--vertical_results
|
||||
--replace_column 16 "YYYY-MM-DD hh:mm:ss" 17 "YYYY-MM-DD hh:mm:ss"
|
||||
SELECT *, LENGTH(routine_definition) FROM information_schema.routines
|
||||
WHERE routine_schema = 'db_datadict';
|
||||
--horizontal_results
|
||||
|
||||
# Cleanup
|
||||
DROP DATABASE db_datadict;
|
||||
# ----------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
--echo ########################################################################
|
||||
--echo # Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
--echo # DDL on INFORMATION_SCHEMA table are not supported
|
||||
--echo ########################################################################
|
||||
# 3.2.1.3: Ensure that no user may execute an INSERT statement on any
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.4: Ensure that no user may execute an UPDATE statement on any
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.5: Ensure that no user may execute a DELETE statement on any
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.8: Ensure that no user may create an index on an INFORMATION_SCHEMA table.
|
||||
# 3.2.1.9: Ensure that no user may alter the definition of an
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.10: Ensure that no user may drop an INFORMATION_SCHEMA table.
|
||||
# 3.2.1.11: Ensure that no user may move an INFORMATION_SCHEMA table to any
|
||||
# other database.
|
||||
# 3.2.1.12: Ensure that no user may directly add to, alter, or delete any data
|
||||
# in an INFORMATION_SCHEMA table.
|
||||
#
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
--enable_warnings
|
||||
CREATE DATABASE db_datadict;
|
||||
USE db_datadict;
|
||||
CREATE PROCEDURE sp_for_routines() SELECT 'db_datadict';
|
||||
USE test;
|
||||
|
||||
# Note(mleich):
|
||||
# 1. We can get here different error messages.
|
||||
# 2. We do not want to unify the individual messages to the far to unspecific
|
||||
# 'Got one of the listed errors'.
|
||||
let $my_error_message =
|
||||
##### The previous statement must fail ######
|
||||
# Server type | expected error name | expected error message
|
||||
# --------------------------------------------------------------------------------------------------------------------
|
||||
# not embedded | ER_DBACCESS_DENIED_ERROR | ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
# embedded | ER_NON_INSERTABLE_TABLE | ERROR HY000: The target table schemata of the INSERT is not insertable-into
|
||||
# | or similar | or similar
|
||||
;
|
||||
|
||||
--disable_abort_on_error
|
||||
INSERT INTO information_schema.routines (routine_name, routine_type )
|
||||
VALUES ('p2', 'procedure');
|
||||
if (!$mysql_errno)
|
||||
{
|
||||
--echo $my_error_message
|
||||
exit;
|
||||
}
|
||||
UPDATE information_schema.routines SET routine_name = 'p2'
|
||||
WHERE routine_body = 'sql';
|
||||
if (!$mysql_errno)
|
||||
{
|
||||
--echo $my_error_message
|
||||
exit;
|
||||
}
|
||||
DELETE FROM information_schema.routines ;
|
||||
if (!$mysql_errno)
|
||||
{
|
||||
--echo $my_error_message
|
||||
exit;
|
||||
}
|
||||
TRUNCATE information_schema.routines ;
|
||||
if (!$mysql_errno)
|
||||
{
|
||||
--echo $my_error_message
|
||||
exit;
|
||||
}
|
||||
CREATE INDEX i7 ON information_schema.routines (routine_name);
|
||||
if (!$mysql_errno)
|
||||
{
|
||||
--echo $my_error_message
|
||||
exit;
|
||||
}
|
||||
ALTER TABLE information_schema.routines ADD f1 INT;
|
||||
if (!$mysql_errno)
|
||||
{
|
||||
--echo $my_error_message
|
||||
exit;
|
||||
}
|
||||
ALTER TABLE information_schema.routines DISCARD TABLESPACE;
|
||||
if (!$mysql_errno)
|
||||
{
|
||||
--echo $my_error_message
|
||||
exit;
|
||||
}
|
||||
DROP TABLE information_schema.routines ;
|
||||
if (!$mysql_errno)
|
||||
{
|
||||
--echo $my_error_message
|
||||
exit;
|
||||
}
|
||||
ALTER TABLE information_schema.routines RENAME db_datadict.routines;
|
||||
if (!$mysql_errno)
|
||||
{
|
||||
--echo $my_error_message
|
||||
exit;
|
||||
}
|
||||
ALTER TABLE information_schema.routines RENAME information_schema.xroutines;
|
||||
if (!$mysql_errno)
|
||||
{
|
||||
--echo $my_error_message
|
||||
exit;
|
||||
}
|
||||
--enable_abort_on_error
|
||||
|
||||
# Cleanup
|
||||
DROP DATABASE db_datadict;
|
||||
|
300
mysql-test/suite/funcs_1/datadict/is_schemata.inc
Normal file
300
mysql-test/suite/funcs_1/datadict/is_schemata.inc
Normal file
|
@ -0,0 +1,300 @@
|
|||
# suite/funcs_1/datadict/is_schemata.inc
|
||||
#
|
||||
# Check the layout of information_schema.schemata, permissions and the impact of
|
||||
# CREATE/ALTER/DROP SCHEMA on it.
|
||||
#
|
||||
# Note:
|
||||
# This test is not intended
|
||||
# - to show information about the all time existing databases
|
||||
# information_schema and mysql
|
||||
# - for checking storage engine properties
|
||||
#
|
||||
# Author:
|
||||
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
|
||||
# testsuite funcs_1
|
||||
# Create this script based on older scripts and new code.
|
||||
# Last Change:
|
||||
# 2008-06-11 mleich Move t/is_schemata.test to this file and
|
||||
# create variants for embedded/non embedded server.
|
||||
#
|
||||
|
||||
let $is_table = SCHEMATA;
|
||||
|
||||
# The table INFORMATION_SCHEMA.SCHEMATA must exist
|
||||
eval SHOW TABLES FROM information_schema LIKE '$is_table';
|
||||
|
||||
--echo #######################################################################
|
||||
--echo # Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
--echo #######################################################################
|
||||
# Ensure that every INFORMATION_SCHEMA table can be queried with a SELECT
|
||||
# statement, just as if it were an ordinary user-defined table.
|
||||
#
|
||||
--source suite/funcs_1/datadict/is_table_query.inc
|
||||
|
||||
|
||||
--echo #########################################################################
|
||||
--echo # Testcase 3.2.9.1: INFORMATION_SCHEMA.SCHEMATA layout;
|
||||
--echo #########################################################################
|
||||
# Ensure that the INFORMATION_SCHEMA.SCHEMATA table has the following columns,
|
||||
# in the following order:
|
||||
#
|
||||
# CATALOG_NAME (always shows NULL),
|
||||
# SCHEMA_NAME (shows the name of a database, or schema, on which the current
|
||||
# user or PUBLIC has privileges),
|
||||
# DEFAULT_CHARACTER_SET_NAME (shows the name of that database's default
|
||||
# character set),
|
||||
# DEFAULT_COLLATION_NAME (shows the database defaul collation)
|
||||
# SQL_PATH (always shows NULL).
|
||||
#
|
||||
--source suite/funcs_1/datadict/datadict_bug_12777.inc
|
||||
eval DESCRIBE information_schema.$is_table;
|
||||
--source suite/funcs_1/datadict/datadict_bug_12777.inc
|
||||
eval SHOW CREATE TABLE information_schema.$is_table;
|
||||
--source suite/funcs_1/datadict/datadict_bug_12777.inc
|
||||
eval SHOW COLUMNS FROM information_schema.$is_table;
|
||||
|
||||
# Note: Retrieval of information within information_schema.columns about
|
||||
# information_schema.schemata is in is_columns_is.test.
|
||||
|
||||
# Show that CATALOG_NAME and SQL_PATH are always NULL.
|
||||
SELECT catalog_name, schema_name, sql_path
|
||||
FROM information_schema.schemata
|
||||
WHERE catalog_name IS NOT NULL or sql_path IS NOT NULL;
|
||||
|
||||
|
||||
--echo ###############################################################################
|
||||
--echo # Testcases 3.2.9.2+3.2.9.3: INFORMATION_SCHEMA.SCHEMATA accessible information
|
||||
--echo ###############################################################################
|
||||
# 3.2.9.2 Ensure that the table shows the relevant information for every
|
||||
# database on which the current user or PUBLIC have privileges.
|
||||
# 3.2.9.3 Ensure that the table does not show any information on any databases
|
||||
# on which the current user and PUBLIC have no privileges.
|
||||
#
|
||||
# Note: Check of content within information_schema.schemata about the databases
|
||||
# information_schema and mysql is in
|
||||
# suite/funcs_1/t/is_schemata_is_mysql.test.
|
||||
#
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS db_datadict_1;
|
||||
DROP DATABASE IF EXISTS db_datadict_2;
|
||||
--enable_warnings
|
||||
CREATE DATABASE db_datadict_1;
|
||||
CREATE DATABASE db_datadict_2;
|
||||
|
||||
--error 0,ER_CANNOT_USER
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
--error 0,ER_CANNOT_USER
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
CREATE USER 'testuser2'@'localhost';
|
||||
--error 0,ER_CANNOT_USER
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
CREATE USER 'testuser3'@'localhost';
|
||||
|
||||
GRANT SELECT ON db_datadict_1.* to 'testuser1'@'localhost';
|
||||
GRANT SELECT ON db_datadict_1.* to 'testuser2'@'localhost';
|
||||
GRANT SELECT ON db_datadict_2.* to 'testuser2'@'localhost';
|
||||
|
||||
let $my_select = SELECT * FROM information_schema.schemata
|
||||
WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name;
|
||||
let $my_show = SHOW DATABASES LIKE 'db_datadict_%';
|
||||
|
||||
eval $my_select;
|
||||
--sorted_result
|
||||
eval $my_show;
|
||||
|
||||
--echo # Establish connection testuser1 (user=testuser1)
|
||||
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
|
||||
connect (testuser1, localhost, testuser1, , db_datadict_1);
|
||||
# Shows db_datadict_1
|
||||
eval $my_select;
|
||||
--sorted_result
|
||||
eval $my_show;
|
||||
|
||||
--echo # Establish connection testuser2 (user=testuser2)
|
||||
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
|
||||
connect (testuser2, localhost, testuser2, , db_datadict_2);
|
||||
# Shows db_datadict_1 and db_datadict_2
|
||||
eval $my_select;
|
||||
--sorted_result
|
||||
eval $my_show;
|
||||
|
||||
--echo # Establish connection testuser3 (user=testuser3)
|
||||
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
|
||||
connect (testuser3, localhost, testuser3, , test);
|
||||
# Shows neither db_datadict_1 nor db_datadict_2
|
||||
eval $my_select;
|
||||
--sorted_result
|
||||
eval $my_show;
|
||||
|
||||
# Cleanup
|
||||
--echo # Switch to connection default and close connections testuser1,testuser2,testuser3
|
||||
connection default;
|
||||
disconnect testuser1;
|
||||
disconnect testuser2;
|
||||
disconnect testuser3;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
DROP DATABASE db_datadict_1;
|
||||
DROP DATABASE db_datadict_2;
|
||||
|
||||
|
||||
--echo #################################################################################
|
||||
--echo # Testcases 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.SCHEMATA modifications
|
||||
--echo #################################################################################
|
||||
# 3.2.1.13: Ensure that the creation of any new database object (e.g. table or
|
||||
# column) automatically inserts all relevant information on that
|
||||
# object into every appropriate INFORMATION_SCHEMA table.
|
||||
# 3.2.1.14: Ensure that the alteration of any existing database object
|
||||
# automatically updates all relevant information on that object in
|
||||
# every appropriate INFORMATION_SCHEMA table.
|
||||
# 3.2.1.15: Ensure that the dropping of any existing database object
|
||||
# automatically deletes all relevant information on that object from
|
||||
# every appropriate INFORMATION_SCHEMA table.
|
||||
#
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
--enable_warnings
|
||||
|
||||
SELECT * FROM information_schema.schemata WHERE schema_name = 'db_datadict';
|
||||
CREATE DATABASE db_datadict CHARACTER SET 'latin1' COLLATE 'latin1_swedish_ci';
|
||||
SELECT * FROM information_schema.schemata WHERE schema_name = 'db_datadict';
|
||||
|
||||
# Check modify default CHARACTER SET
|
||||
SELECT schema_name, default_character_set_name
|
||||
FROM information_schema.schemata WHERE schema_name = 'db_datadict';
|
||||
ALTER SCHEMA db_datadict CHARACTER SET 'utf8';
|
||||
SELECT schema_name, default_character_set_name
|
||||
FROM information_schema.schemata WHERE schema_name = 'db_datadict';
|
||||
ALTER SCHEMA db_datadict CHARACTER SET 'latin1';
|
||||
|
||||
# Check modify default COLLATION
|
||||
SELECT schema_name, default_collation_name FROM information_schema.schemata
|
||||
WHERE schema_name = 'db_datadict';
|
||||
ALTER SCHEMA db_datadict COLLATE 'latin1_general_cs';
|
||||
SELECT schema_name, default_collation_name FROM information_schema.schemata
|
||||
WHERE schema_name = 'db_datadict';
|
||||
|
||||
# Check DROP DATABASE
|
||||
SELECT schema_name
|
||||
FROM information_schema.schemata WHERE schema_name = 'db_datadict';
|
||||
DROP DATABASE db_datadict;
|
||||
SELECT schema_name
|
||||
FROM information_schema.schemata WHERE schema_name = 'db_datadict';
|
||||
|
||||
|
||||
--echo ########################################################################
|
||||
--echo # Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
--echo # DDL on INFORMATION_SCHEMA tables are not supported
|
||||
--echo ########################################################################
|
||||
# 3.2.1.3: Ensure that no user may execute an INSERT statement on any
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.4: Ensure that no user may execute an UPDATE statement on any
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.5: Ensure that no user may execute a DELETE statement on any
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.8: Ensure that no user may create an index on an INFORMATION_SCHEMA table.
|
||||
# 3.2.1.9: Ensure that no user may alter the definition of an
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.10: Ensure that no user may drop an INFORMATION_SCHEMA table.
|
||||
# 3.2.1.11: Ensure that no user may move an INFORMATION_SCHEMA table to any
|
||||
# other database.
|
||||
# 3.2.1.12: Ensure that no user may directly add to, alter, or delete any data
|
||||
# in an INFORMATION_SCHEMA table.
|
||||
#
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
--enable_warnings
|
||||
CREATE DATABASE db_datadict CHARACTER SET 'latin1' COLLATE 'latin1_swedish_ci';
|
||||
|
||||
# Note(mleich):
|
||||
# 1. We can get here different error messages.
|
||||
# 2. We do not want to unify the individual messages to the far to unspecific
|
||||
# 'Got one of the listed errors'.
|
||||
let $my_error_message =
|
||||
##### The previous statement must fail ######
|
||||
# Server type | expected error name | expected error message
|
||||
# --------------------------------------------------------------------------------------------------------------------
|
||||
# not embedded | ER_DBACCESS_DENIED_ERROR | ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
# embedded | ER_NON_INSERTABLE_TABLE | ERROR HY000: The target table schemata of the INSERT is not insertable-into
|
||||
# | or similar | or similar
|
||||
;
|
||||
|
||||
--disable_abort_on_error
|
||||
INSERT INTO information_schema.schemata
|
||||
(catalog_name, schema_name, default_character_set_name, sql_path)
|
||||
VALUES (NULL, 'db1', 'latin1', NULL);
|
||||
if (!$mysql_errno)
|
||||
{
|
||||
--echo $my_error_message
|
||||
exit;
|
||||
}
|
||||
INSERT INTO information_schema.schemata
|
||||
SELECT * FROM information_schema.schemata;
|
||||
if (!$mysql_errno)
|
||||
{
|
||||
--echo $my_error_message
|
||||
exit;
|
||||
}
|
||||
UPDATE information_schema.schemata
|
||||
SET default_character_set_name = 'utf8'
|
||||
WHERE schema_name = 'db_datadict';
|
||||
if (!$mysql_errno)
|
||||
{
|
||||
--echo $my_error_message
|
||||
exit;
|
||||
}
|
||||
UPDATE information_schema.schemata SET catalog_name = 't_4711';
|
||||
if (!$mysql_errno)
|
||||
{
|
||||
--echo $my_error_message
|
||||
exit;
|
||||
}
|
||||
DELETE FROM information_schema.schemata WHERE schema_name = 'db_datadict';
|
||||
if (!$mysql_errno)
|
||||
{
|
||||
--echo $my_error_message
|
||||
exit;
|
||||
}
|
||||
TRUNCATE information_schema.schemata;
|
||||
if (!$mysql_errno)
|
||||
{
|
||||
--echo $my_error_message
|
||||
exit;
|
||||
}
|
||||
CREATE INDEX i1 ON information_schema.schemata(schema_name);
|
||||
if (!$mysql_errno)
|
||||
{
|
||||
--echo $my_error_message
|
||||
exit;
|
||||
}
|
||||
ALTER TABLE information_schema.schemata ADD f1 INT;
|
||||
if (!$mysql_errno)
|
||||
{
|
||||
--echo $my_error_message
|
||||
exit;
|
||||
}
|
||||
DROP TABLE information_schema.schemata;
|
||||
if (!$mysql_errno)
|
||||
{
|
||||
--echo $my_error_message
|
||||
exit;
|
||||
}
|
||||
ALTER TABLE information_schema.schemata RENAME db_datadict.schemata;
|
||||
if (!$mysql_errno)
|
||||
{
|
||||
--echo $my_error_message
|
||||
exit;
|
||||
}
|
||||
ALTER TABLE information_schema.schemata RENAME information_schema.xschemata;
|
||||
if (!$mysql_errno)
|
||||
{
|
||||
--echo $my_error_message
|
||||
exit;
|
||||
}
|
||||
--enable_abort_on_error
|
||||
|
||||
# Cleanup
|
||||
DROP DATABASE db_datadict;
|
||||
|
475
mysql-test/suite/funcs_1/datadict/is_tables.inc
Normal file
475
mysql-test/suite/funcs_1/datadict/is_tables.inc
Normal file
|
@ -0,0 +1,475 @@
|
|||
# suite/funcs_1/datadict/is_tables.inc
|
||||
#
|
||||
# Check the layout of information_schema.tables and the impact of
|
||||
# CREATE/ALTER/DROP TABLE/VIEW/SCHEMA ... on it.
|
||||
#
|
||||
# Note:
|
||||
# This test is not intended
|
||||
# - to show information about the all time existing tables
|
||||
# within the databases information_schema and mysql
|
||||
# - for checking storage engine properties
|
||||
# Therefore please do not alter $engine_type and $other_engine_type.
|
||||
# Some results of the subtests depend on the storage engines assigned.
|
||||
#
|
||||
# Author:
|
||||
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
|
||||
# testsuite funcs_1
|
||||
# Create this script based on older scripts and new code.
|
||||
# Last Change:
|
||||
# 2008-06-11 mleich Move t/is_tables.test to this file and
|
||||
# create variants for embedded/non embedded server.
|
||||
#
|
||||
|
||||
let $engine_type = MEMORY;
|
||||
let $other_engine_type = MyISAM;
|
||||
|
||||
let $is_table = TABLES;
|
||||
|
||||
# The table INFORMATION_SCHEMA.TABLES must exist
|
||||
eval SHOW TABLES FROM information_schema LIKE '$is_table';
|
||||
|
||||
--echo #######################################################################
|
||||
--echo # Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
--echo #######################################################################
|
||||
# Ensure that every INFORMATION_SCHEMA table can be queried with a SELECT
|
||||
# statement, just as if it were an ordinary user-defined table.
|
||||
#
|
||||
--source suite/funcs_1/datadict/is_table_query.inc
|
||||
|
||||
|
||||
--echo #########################################################################
|
||||
--echo # Testcase 3.2.12.1: INFORMATION_SCHEMA.TABLES layout
|
||||
--echo #########################################################################
|
||||
# Ensure that the INFORMATION_SCHEMA.TABLES table has the following columns,
|
||||
# in the following order:
|
||||
#
|
||||
# TABLE_CATALOG (always shows NULL),
|
||||
# TABLE_SCHEMA (shows the name of the database, or schema, in which an
|
||||
# accessible table resides),
|
||||
# TABLE_NAME (shows the name of a table which the current user may access),
|
||||
# TABLE_TYPE (shows whether the table is a BASE TABLE, a TEMPORARY table,
|
||||
# or a VIEW),
|
||||
# ENGINE (shows the storage engine used for the table),
|
||||
# VERSION (shows the version number of the table's .frm file),
|
||||
# ROW_FORMAT (shows the table's row storage format; either FIXED, DYNAMIC
|
||||
# or COMPRESSED),
|
||||
# TABLE_ROWS (shows the number of rows in the table),
|
||||
# AVG_ROW_LENGTH (shows the average length of the table's rows),
|
||||
# DATA_LENGTH (shows the length of the table's data file),
|
||||
# MAX_DATA_LENGTH (shows the maximum length of the table's data file),
|
||||
# INDEX_LENGTH (shows the length of the index file associated with the table),
|
||||
# DATA_FREE (shows the number of allocated, unused bytes),
|
||||
# AUTO_INCREMENT (shows the next AUTO_INCREMENT value, where applicable),
|
||||
# CREATE_TIME (shows the timestamp of the time the table was created),
|
||||
# UPDATE_TIME (shows the timestamp of the time the table's data file was
|
||||
# last updated),
|
||||
# CHECK_TIME (shows the timestamp of the time the table was last checked),
|
||||
# TABLE_COLLATION (shows the table's default collation),
|
||||
# CHECKSUM (shows the live checksum value for the table, if any; otherwise NULL),
|
||||
# CREATE_OPTIONS (shows any additional options used in the table's definition;
|
||||
# otherwise NULL),
|
||||
# TABLE_COMMENT (shows the comment added to the table's definition;
|
||||
# otherwise NULL).
|
||||
#
|
||||
--source suite/funcs_1/datadict/datadict_bug_12777.inc
|
||||
eval DESCRIBE information_schema.$is_table;
|
||||
--source suite/funcs_1/datadict/datadict_bug_12777.inc
|
||||
eval SHOW CREATE TABLE information_schema.$is_table;
|
||||
--source suite/funcs_1/datadict/datadict_bug_12777.inc
|
||||
eval SHOW COLUMNS FROM information_schema.$is_table;
|
||||
|
||||
# Note: Retrieval of information within information_schema.columns about
|
||||
# information_schema.tables is in is_columns_is.test.
|
||||
|
||||
# Show that TABLE_CATALOG is always NULL.
|
||||
SELECT table_catalog, table_schema, table_name
|
||||
FROM information_schema.tables WHERE table_catalog IS NOT NULL;
|
||||
|
||||
|
||||
--echo ################################################################################
|
||||
--echo # Testcase 3.2.12.2 + 3.2.12.3: INFORMATION_SCHEMA.TABLES accessible information
|
||||
--echo ################################################################################
|
||||
# 3.2.12.2: Ensure that the table shows the relevant information on every base table
|
||||
# and view on which the current user or PUBLIC has privileges.
|
||||
# 3.2.12.3: Ensure that the table does not show any information on any tables
|
||||
# on which the current user and public have no privileges.
|
||||
#
|
||||
# Note: Check of content within information_schema.tables about tables within
|
||||
# database is in
|
||||
# mysql is_tables_mysql.test
|
||||
# information_schema is_tables_is.test
|
||||
# test% is_tables_<engine>.test
|
||||
#
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
--enable_warnings
|
||||
CREATE DATABASE db_datadict;
|
||||
|
||||
--error 0,ER_CANNOT_USER
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
GRANT CREATE, CREATE VIEW, INSERT, SELECT ON db_datadict.*
|
||||
TO 'testuser1'@'localhost' WITH GRANT OPTION;
|
||||
--error 0,ER_CANNOT_USER
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
CREATE USER 'testuser2'@'localhost';
|
||||
--error 0,ER_CANNOT_USER
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
CREATE USER 'testuser3'@'localhost';
|
||||
|
||||
--replace_result $engine_type <engine_type>
|
||||
eval
|
||||
CREATE TABLE db_datadict.tb1 (f1 INT, f2 INT, f3 INT)
|
||||
ENGINE = $engine_type;
|
||||
|
||||
GRANT SELECT ON db_datadict.tb1 TO 'testuser1'@'localhost';
|
||||
GRANT ALL ON db_datadict.tb1 TO 'testuser2'@'localhost' WITH GRANT OPTION;
|
||||
|
||||
let $my_select = SELECT * FROM information_schema.tables
|
||||
WHERE table_schema = 'db_datadict' ORDER BY table_name;
|
||||
let $my_show = SHOW TABLES FROM db_datadict;
|
||||
|
||||
--echo # Establish connection testuser1 (user=testuser1)
|
||||
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
|
||||
connect (testuser1, localhost, testuser1, , db_datadict);
|
||||
# tb2 is not granted to anyone
|
||||
--replace_result $engine_type <engine_type>
|
||||
eval
|
||||
CREATE TABLE tb2 (f1 DECIMAL)
|
||||
ENGINE = $engine_type;
|
||||
--replace_result $engine_type <engine_type>
|
||||
eval
|
||||
CREATE TABLE tb3 (f1 VARCHAR(200))
|
||||
ENGINE = $engine_type;
|
||||
GRANT SELECT ON db_datadict.tb3 to 'testuser3'@'localhost';
|
||||
GRANT INSERT ON db_datadict.tb3 to 'testuser2'@'localhost';
|
||||
CREATE VIEW v3 AS SELECT * FROM tb3;
|
||||
GRANT SELECT ON db_datadict.v3 to 'testuser3'@'localhost';
|
||||
|
||||
if ($have_bug_32285)
|
||||
{
|
||||
--disable_ps_protocol
|
||||
}
|
||||
# We do not want to check here values affected by
|
||||
# - the storage engine used
|
||||
# - Operating system / Filesystem
|
||||
# - start time of test
|
||||
# 1 TABLE_CATALOG
|
||||
# 2 TABLE_SCHEMA
|
||||
# 3 TABLE_NAME
|
||||
# 4 TABLE_TYPE
|
||||
# 5 ENGINE affected by storage engine used
|
||||
# 6 VERSION
|
||||
# 7 ROW_FORMAT affected by storage engine used
|
||||
# 8 TABLE_ROWS
|
||||
# 9 AVG_ROW_LENGTH affected by storage engine used
|
||||
# 10 DATA_LENGTH affected by storage engine used and maybe OS
|
||||
# 11 MAX_DATA_LENGTH affected by storage engine used and maybe OS
|
||||
# 12 INDEX_LENGTH affected by storage engine used and maybe OS
|
||||
# 13 DATA_FREE affected by storage engine used and maybe OS
|
||||
# 14 AUTO_INCREMENT
|
||||
# 15 CREATE_TIME depends roughly on start time of test (*)
|
||||
# 16 UPDATE_TIME depends roughly on start time of test (*)
|
||||
# 17 CHECK_TIME depends roughly on start time of test and storage engine (*)
|
||||
# 18 TABLE_COLLATION
|
||||
# 19 CHECKSUM affected by storage engine used
|
||||
# 20 CREATE_OPTIONS
|
||||
# 21 TABLE_COMMENT affected by some storage engines
|
||||
# (*) In case of view or temporary table NULL.
|
||||
--replace_column 5 "#ENG#" 7 "#RF#" 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "#CRT" 16 "#UT#" 17 "#CT#" 19 "#CS#"
|
||||
eval $my_select;
|
||||
--enable_ps_protocol
|
||||
--sorted_result
|
||||
eval $my_show;
|
||||
|
||||
--echo # Establish connection testuser2 (user=testuser2)
|
||||
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
|
||||
connect (testuser2, localhost, testuser2, , db_datadict);
|
||||
if ($have_bug_32285)
|
||||
{
|
||||
--disable_ps_protocol
|
||||
}
|
||||
--replace_column 5 "#ENG#" 7 "#RF#" 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "#CRT" 16 "#UT#" 17 "#CT#" 19 "#CS#"
|
||||
eval $my_select;
|
||||
--enable_ps_protocol
|
||||
--sorted_result
|
||||
eval $my_show;
|
||||
|
||||
--echo # Establish connection testuser3 (user=testuser3)
|
||||
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
|
||||
connect (testuser3, localhost, testuser3, , db_datadict);
|
||||
if ($have_bug_32285)
|
||||
{
|
||||
--disable_ps_protocol
|
||||
}
|
||||
--replace_column 5 "#ENG#" 7 "#RF#" 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "#CRT" 16 "#UT#" 17 "#CT#" 19 "#CS#"
|
||||
eval $my_select;
|
||||
--enable_ps_protocol
|
||||
--sorted_result
|
||||
eval $my_show;
|
||||
|
||||
--echo # Switch to connection default (user=root)
|
||||
connection default;
|
||||
# we see only 'public' tables
|
||||
if ($have_bug_32285)
|
||||
{
|
||||
--disable_ps_protocol
|
||||
}
|
||||
--replace_column 5 "#ENG#" 7 "#RF#" 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "#CRT" 16 "#UT#" 17 "#CT#" 19 "#CS#"
|
||||
eval $my_select;
|
||||
--enable_ps_protocol
|
||||
--sorted_result
|
||||
eval $my_show;
|
||||
|
||||
# Cleanup
|
||||
--echo # Close connection testuser1, testuser2, testuser3
|
||||
disconnect testuser1;
|
||||
disconnect testuser2;
|
||||
disconnect testuser3;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
DROP DATABASE db_datadict;
|
||||
|
||||
|
||||
--echo #########################################################################
|
||||
--echo # 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.TABLES modifications
|
||||
--echo #########################################################################
|
||||
# 3.2.1.13: Ensure that the creation of any new database object (e.g. table or
|
||||
# column) automatically inserts all relevant information on that
|
||||
# object into every appropriate INFORMATION_SCHEMA table.
|
||||
# 3.2.1.14: Ensure that the alteration of any existing database object
|
||||
# automatically updates all relevant information on that object in
|
||||
# every appropriate INFORMATION_SCHEMA table.
|
||||
# 3.2.1.15: Ensure that the dropping of any existing database object
|
||||
# automatically deletes all relevant information on that object from
|
||||
# every appropriate INFORMATION_SCHEMA table.
|
||||
#
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS test.t1_my_table;
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
--enable_warnings
|
||||
CREATE DATABASE db_datadict;
|
||||
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
--replace_result $engine_type <engine_type>
|
||||
eval
|
||||
CREATE TABLE test.t1_my_table (f1 BIGINT)
|
||||
DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci
|
||||
COMMENT = 'Initial Comment' ENGINE = $engine_type;
|
||||
# Settings used in CREATE TABLE must be visible in information_schema.tables.
|
||||
--vertical_results
|
||||
--replace_column 5 "#ENG#" 7 "#RF#" 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "#CRT" 16 "#UT#" 17 "#CT#" 19 "#CS#"
|
||||
SELECT * FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_table';
|
||||
--horizontal_results
|
||||
#
|
||||
# Check modification of TABLE_NAME
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
RENAME TABLE test.t1_my_table TO test.t1_my_tablex;
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
#
|
||||
# Check modification of TABLE_SCHEMA
|
||||
SELECT table_schema,table_name FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
RENAME TABLE test.t1_my_tablex TO db_datadict.t1_my_tablex;
|
||||
SELECT table_schema,table_name FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
#
|
||||
# Check modification of ENGINE
|
||||
--replace_result $engine_type <engine_type>
|
||||
SELECT table_name, engine FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
--replace_result $other_engine_type <other_engine_type>
|
||||
eval
|
||||
ALTER TABLE db_datadict.t1_my_tablex
|
||||
ENGINE = $other_engine_type;
|
||||
--replace_result $other_engine_type <other_engine_type>
|
||||
SELECT table_name, engine FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
#
|
||||
# Check modification of TABLE_ROWS
|
||||
SELECT table_name, table_rows FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
INSERT INTO db_datadict.t1_my_tablex VALUES(1),(2);
|
||||
SELECT table_name, table_rows FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
#
|
||||
# Check indirect modification of TABLE_COLLATION
|
||||
SELECT table_name, table_collation FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
ALTER TABLE db_datadict.t1_my_tablex DEFAULT CHARACTER SET utf8;
|
||||
SELECT table_name, table_collation FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
# Check direct modification of TABLE_COLLATION
|
||||
SELECT table_name, table_collation FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
ALTER TABLE db_datadict.t1_my_tablex
|
||||
DEFAULT CHARACTER SET latin1 COLLATE latin1_german1_ci;
|
||||
SELECT table_name, table_collation FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
#
|
||||
# Check modification of TABLE_COMMENT
|
||||
SELECT table_name, TABLE_COMMENT FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
ALTER TABLE db_datadict.t1_my_tablex COMMENT 'Changed Comment';
|
||||
SELECT table_name, TABLE_COMMENT FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
#
|
||||
# Check modification of AUTO_INCREMENT
|
||||
SELECT table_name, AUTO_INCREMENT FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
ALTER TABLE db_datadict.t1_my_tablex
|
||||
ADD f2 BIGINT AUTO_INCREMENT, ADD PRIMARY KEY (f2);
|
||||
SELECT table_name, AUTO_INCREMENT FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
#
|
||||
# Check modification of ROW_FORMAT
|
||||
SELECT table_name, ROW_FORMAT FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
ALTER TABLE db_datadict.t1_my_tablex ROW_FORMAT = dynamic;
|
||||
SELECT table_name, ROW_FORMAT FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
#
|
||||
# Check "growth" of UPDATE_TIME and modification of CHECKSUM
|
||||
SELECT table_name, checksum FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
ALTER TABLE db_datadict.t1_my_tablex CHECKSUM = 1;
|
||||
SELECT table_name, checksum IS NOT NULL FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
SELECT UPDATE_TIME, checksum INTO @UPDATE_TIME, @checksum
|
||||
FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
# Enforce a time difference bigger than the smallest unit (1 second).
|
||||
--real_sleep 1.1
|
||||
INSERT INTO db_datadict.t1_my_tablex SET f1 = 3;
|
||||
SELECT UPDATE_TIME > @UPDATE_TIME
|
||||
AS "Is current UPDATE_TIME bigger than before last INSERT?"
|
||||
FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
SELECT checksum <> @checksum
|
||||
AS "Is current CHECKSUM different than before last INSERT?"
|
||||
FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
#
|
||||
# Information is used later
|
||||
SELECT CREATE_TIME INTO @CREATE_TIME FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
#
|
||||
# Check impact of DROP TABLE
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
DROP TABLE db_datadict.t1_my_tablex;
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
#
|
||||
# Check "growth" of CREATE_TIME
|
||||
--replace_result $other_engine_type <other_engine_type>
|
||||
eval
|
||||
CREATE TABLE test.t1_my_tablex (f1 BIGINT)
|
||||
ENGINE = $other_engine_type;
|
||||
SELECT CREATE_TIME > @CREATE_TIME
|
||||
AS "Is current CREATE_TIME bigger than for the old dropped table?"
|
||||
FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
DROP TABLE test.t1_my_tablex;
|
||||
#
|
||||
# Check a VIEW
|
||||
CREATE VIEW test.t1_my_tablex AS SELECT 1;
|
||||
--vertical_results
|
||||
SELECT * FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
--horizontal_results
|
||||
DROP VIEW test.t1_my_tablex;
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
#
|
||||
# Check a temporary table
|
||||
--replace_result $other_engine_type <other_engine_type>
|
||||
eval
|
||||
CREATE TEMPORARY TABLE test.t1_my_tablex
|
||||
ENGINE = $other_engine_type
|
||||
AS SELECT 1;
|
||||
--vertical_results
|
||||
SELECT table_name, table_type FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
--horizontal_results
|
||||
DROP TEMPORARY TABLE test.t1_my_tablex;
|
||||
#
|
||||
# Check impact of DROP SCHEMA
|
||||
--replace_result $engine_type <engine_type>
|
||||
eval
|
||||
CREATE TABLE db_datadict.t1_my_tablex
|
||||
ENGINE = $engine_type AS
|
||||
SELECT 1;
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
DROP DATABASE db_datadict;
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
|
||||
|
||||
--echo ########################################################################
|
||||
--echo # Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
--echo # DDL on INFORMATION_SCHEMA tables are not supported
|
||||
--echo ########################################################################
|
||||
# 3.2.1.3: Ensure that no user may execute an INSERT statement on any
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.4: Ensure that no user may execute an UPDATE statement on any
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.5: Ensure that no user may execute a DELETE statement on any
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.8: Ensure that no user may create an index on an
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.9: Ensure that no user may alter the definition of an
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.10: Ensure that no user may drop an INFORMATION_SCHEMA table.
|
||||
# 3.2.1.11: Ensure that no user may move an INFORMATION_SCHEMA table to any
|
||||
# other database.
|
||||
# 3.2.1.12: Ensure that no user may directly add to, alter, or delete any data
|
||||
# in an INFORMATION_SCHEMA table.
|
||||
#
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
--enable_warnings
|
||||
CREATE DATABASE db_datadict;
|
||||
--replace_result $engine_type <engine_type>
|
||||
eval
|
||||
CREATE TABLE db_datadict.t1 (f1 BIGINT)
|
||||
ENGINE = $engine_type;
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
INSERT INTO information_schema.tables
|
||||
SELECT * FROM information_schema.tables;
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
UPDATE information_schema.tables SET table_schema = 'test'
|
||||
WHERE table_name = 't1';
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
DELETE FROM information_schema.tables WHERE table_name = 't1';
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
TRUNCATE information_schema.tables;
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
CREATE INDEX my_idx_on_tables ON information_schema.tables(table_schema);
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
ALTER TABLE information_schema.tables DROP PRIMARY KEY;
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
ALTER TABLE information_schema.tables ADD f1 INT;
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
DROP TABLE information_schema.tables;
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
ALTER TABLE information_schema.tables RENAME db_datadict.tables;
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
ALTER TABLE information_schema.tables RENAME information_schema.xtables;
|
||||
|
||||
# Cleanup
|
||||
DROP DATABASE db_datadict;
|
||||
|
258
mysql-test/suite/funcs_1/datadict/is_triggers.inc
Normal file
258
mysql-test/suite/funcs_1/datadict/is_triggers.inc
Normal file
|
@ -0,0 +1,258 @@
|
|||
# suite/funcs_1/datadict/is_triggers.inc
|
||||
#
|
||||
# Check the layout of information_schema.triggers and the impact of
|
||||
# CREATE/ALTER/DROP TABLE/VIEW/SCHEMA ... on it.
|
||||
#
|
||||
# Note:
|
||||
# This test is not intended
|
||||
# - to show information about the all time existing triggers
|
||||
# (there are no in the moment) within the databases information_schema
|
||||
# and mysql
|
||||
# - for checking storage engine properties
|
||||
# Therefore please do not alter $engine_type and $other_engine_type.
|
||||
#
|
||||
# Author:
|
||||
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
|
||||
# testsuite funcs_1
|
||||
# Create this script based on older scripts and new code.
|
||||
# Last Change:
|
||||
# 2008-06-11 mleich Move t/is_triggers.test to this file and
|
||||
# create variants for embedded/non embedded server.
|
||||
#
|
||||
|
||||
let $engine_type = MEMORY;
|
||||
let $other_engine_type = MyISAM;
|
||||
|
||||
let $is_table = TRIGGERS;
|
||||
|
||||
# The table INFORMATION_SCHEMA.TRIGGERS must exist
|
||||
eval SHOW TABLES FROM information_schema LIKE '$is_table';
|
||||
|
||||
--echo #######################################################################
|
||||
--echo # Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
--echo #######################################################################
|
||||
# Ensure that every INFORMATION_SCHEMA table can be queried with a SELECT
|
||||
# statement, just as if it were an ordinary user-defined table.
|
||||
#
|
||||
--source suite/funcs_1/datadict/is_table_query.inc
|
||||
|
||||
|
||||
--echo #########################################################################
|
||||
--echo # Testcase 3.2.12.1: INFORMATION_SCHEMA.TRIGGERS layout
|
||||
--echo #########################################################################
|
||||
# Ensure that the INFORMATION_SCHEMA.TRIGGERS table has the following columns,
|
||||
# in the following order:
|
||||
#
|
||||
# TRIGGER_CATALOG NULL
|
||||
# TRIGGER_SCHEMA name of the database in which the trigger occurs
|
||||
# TRIGGER_NAME
|
||||
# EVENT_MANIPULATION event associated with the trigger
|
||||
# ('INSERT', 'DELETE', or 'UPDATE')
|
||||
# EVENT_OBJECT_CATALOG NULL
|
||||
# EVENT_OBJECT_SCHEMA database in which the table associated with the
|
||||
# trigger occurs
|
||||
# EVENT_OBJECT_TABLE name of the table associated with the trigger
|
||||
# ACTION_ORDER 0
|
||||
# ACTION_CONDITION NULL
|
||||
# ACTION_STATEMENT
|
||||
# ACTION_ORIENTATION ROW
|
||||
# ACTION_TIMING 'BEFORE' or 'AFTER'
|
||||
# ACTION_REFERENCE_OLD_TABLE NULL
|
||||
# ACTION_REFERENCE_NEW_TABLE NULL
|
||||
# ACTION_REFERENCE_OLD_ROW OLD
|
||||
# ACTION_REFERENCE_NEW_ROW NEW
|
||||
# CREATED NULL (0)
|
||||
# SQL_MODE server SQL mode that was in effect at the time
|
||||
# when the trigger was created
|
||||
# (also used during trigger execution)
|
||||
# DEFINER who defined the trigger
|
||||
#
|
||||
--source suite/funcs_1/datadict/datadict_bug_12777.inc
|
||||
eval DESCRIBE information_schema.$is_table;
|
||||
--source suite/funcs_1/datadict/datadict_bug_12777.inc
|
||||
eval SHOW CREATE TABLE information_schema.$is_table;
|
||||
--source suite/funcs_1/datadict/datadict_bug_12777.inc
|
||||
eval SHOW COLUMNS FROM information_schema.$is_table;
|
||||
|
||||
|
||||
# Note: Retrieval of information within information_schema.columns about
|
||||
# information_schema.tables is in is_columns_is.test.
|
||||
|
||||
# Show that several columns are always NULL.
|
||||
SELECT * FROM information_schema.triggers
|
||||
WHERE trigger_catalog IS NOT NULL OR event_object_catalog IS NOT NULL
|
||||
OR action_condition IS NOT NULL OR action_reference_old_table IS NOT NULL
|
||||
OR action_reference_new_table IS NOT NULL;
|
||||
|
||||
|
||||
--echo ##################################################################################
|
||||
--echo # Testcase 3.2.18.2 + 3.2.18.3: INFORMATION_SCHEMA.TRIGGERS accessible information
|
||||
--echo ##################################################################################
|
||||
# 3.2.18.2: Ensure that the table shows the relevant information on every
|
||||
# trigger on which the current user or PUBLIC has privileges.
|
||||
# 3.2.18.3: Ensure that the table does not show any information on any trigger
|
||||
# on which the current user and public have no privileges.
|
||||
# The SUPER (before 5.1.22) or TRIGGER (since 5.1.22) privilege is required for
|
||||
# - creation of triggers
|
||||
# - retrieval in INFORMATION_SCHEMA.TRIGGERS (affects size of result set)
|
||||
#
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
--enable_warnings
|
||||
CREATE DATABASE db_datadict;
|
||||
--error 0,ER_CANNOT_USER
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
--error 0,ER_CANNOT_USER
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
CREATE USER 'testuser2'@'localhost';
|
||||
--error 0,ER_CANNOT_USER
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
CREATE USER 'testuser3'@'localhost';
|
||||
--error 0,ER_CANNOT_USER
|
||||
DROP USER 'testuser4'@'localhost';
|
||||
CREATE USER 'testuser4'@'localhost';
|
||||
|
||||
GRANT TRIGGER ON *.* TO 'testuser1'@'localhost';
|
||||
GRANT TRIGGER ON *.* TO 'testuser3'@'localhost';
|
||||
GRANT TRIGGER ON *.* TO 'testuser4'@'localhost';
|
||||
GRANT ALL ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
|
||||
|
||||
let $my_select = SELECT * FROM information_schema.triggers
|
||||
WHERE trigger_name = 'trg1';
|
||||
let $my_show = SHOW TRIGGERS FROM db_datadict;
|
||||
--echo # Establish connection testuser1 (user=testuser1)
|
||||
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
|
||||
connect (testuser1, localhost, testuser1, , db_datadict);
|
||||
--replace_result $engine_type <engine_type>
|
||||
eval
|
||||
CREATE TABLE db_datadict.t1 (f1 INT, f2 INT, f3 INT)
|
||||
ENGINE = $engine_type;
|
||||
CREATE TRIGGER trg1 BEFORE INSERT
|
||||
ON db_datadict.t1 FOR EACH ROW SET @test_before = 2, new.f1 = @test_before;
|
||||
GRANT ALL ON db_datadict.t1 TO 'testuser2'@'localhost';
|
||||
REVOKE TRIGGER ON db_datadict.t1 FROM 'testuser2'@'localhost';
|
||||
GRANT SELECT ON db_datadict.t1 TO 'testuser3'@'localhost';
|
||||
eval $my_select;
|
||||
eval $my_show;
|
||||
|
||||
--echo # Establish connection testuser2 (user=testuser2)
|
||||
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
|
||||
connect (testuser2, localhost, testuser2, , db_datadict);
|
||||
SHOW GRANTS FOR 'testuser2'@'localhost';
|
||||
--echo # No TRIGGER Privilege --> no result for query
|
||||
eval $my_select;
|
||||
eval $my_show;
|
||||
|
||||
--echo # Establish connection testuser3 (user=testuser3)
|
||||
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
|
||||
connect (testuser3, localhost, testuser3, , test);
|
||||
SHOW GRANTS FOR 'testuser3'@'localhost';
|
||||
--echo # TRIGGER Privilege + SELECT Privilege on t1 --> result for query
|
||||
eval $my_select;
|
||||
eval $my_show;
|
||||
|
||||
--echo # Establish connection testuser4 (user=testuser4)
|
||||
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
|
||||
connect (testuser4, localhost, testuser4, , test);
|
||||
SHOW GRANTS FOR 'testuser4'@'localhost';
|
||||
--echo # TRIGGER Privilege + no SELECT Privilege on t1 --> result for query
|
||||
--disable_abort_on_error
|
||||
SELECT * FROM db_datadict.t1;
|
||||
DESC db_datadict.t1;
|
||||
eval $my_select;
|
||||
eval $my_show;
|
||||
|
||||
--echo # Switch to connection default and close connections testuser1 - testuser4
|
||||
connection default;
|
||||
disconnect testuser1;
|
||||
disconnect testuser2;
|
||||
disconnect testuser3;
|
||||
disconnect testuser4;
|
||||
eval $my_select;
|
||||
eval $my_show;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
DROP USER 'testuser4'@'localhost';
|
||||
DROP DATABASE db_datadict;
|
||||
|
||||
|
||||
--echo #########################################################################
|
||||
--echo # 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.TRIGGERS modifications
|
||||
--echo #########################################################################
|
||||
# 3.2.1.13: Ensure that the creation of any new database object (e.g. table or
|
||||
# column) automatically inserts all relevant information on that
|
||||
# object into every appropriate INFORMATION_SCHEMA table.
|
||||
# 3.2.1.14: Ensure that the alteration of any existing database object
|
||||
# automatically updates all relevant information on that object in
|
||||
# every appropriate INFORMATION_SCHEMA table.
|
||||
# 3.2.1.15: Ensure that the dropping of any existing database object
|
||||
# automatically deletes all relevant information on that object from
|
||||
# every appropriate INFORMATION_SCHEMA table.
|
||||
# FIXME: To be implemented
|
||||
|
||||
|
||||
--echo ########################################################################
|
||||
--echo # Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
--echo # DDL on INFORMATION_SCHEMA tables are not supported
|
||||
--echo ########################################################################
|
||||
# 3.2.1.3: Ensure that no user may execute an INSERT statement on any
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.4: Ensure that no user may execute an UPDATE statement on any
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.5: Ensure that no user may execute a DELETE statement on any
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.8: Ensure that no user may create an index on an
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.9: Ensure that no user may alter the definition of an
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.10: Ensure that no user may drop an INFORMATION_SCHEMA table.
|
||||
# 3.2.1.11: Ensure that no user may move an INFORMATION_SCHEMA table to any
|
||||
# other database.
|
||||
# 3.2.1.12: Ensure that no user may directly add to, alter, or delete any data
|
||||
# in an INFORMATION_SCHEMA table.
|
||||
#
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
--enable_warnings
|
||||
CREATE DATABASE db_datadict;
|
||||
--replace_result $engine_type <engine_type>
|
||||
eval
|
||||
CREATE TABLE db_datadict.t1 (f1 BIGINT)
|
||||
ENGINE = $engine_type;
|
||||
CREATE TRIGGER db_datadict.trg1 BEFORE INSERT
|
||||
ON db_datadict.t1 FOR EACH ROW SET @test_before = 2, new.f1 = @test_before;
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
INSERT INTO information_schema.triggers
|
||||
SELECT * FROM information_schema.triggers;
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
UPDATE information_schema.triggers SET trigger_schema = 'test'
|
||||
WHERE table_name = 't1';
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
DELETE FROM information_schema.triggers WHERE trigger_name = 't1';
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
TRUNCATE information_schema.triggers;
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
CREATE INDEX my_idx_on_triggers ON information_schema.triggers(trigger_schema);
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
ALTER TABLE information_schema.triggers DROP PRIMARY KEY;
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
ALTER TABLE information_schema.triggers ADD f1 INT;
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
DROP TABLE information_schema.triggers;
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
ALTER TABLE information_schema.triggers RENAME db_datadict.triggers;
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
ALTER TABLE information_schema.triggers RENAME information_schema.xtriggers;
|
||||
|
||||
# Cleanup
|
||||
DROP DATABASE db_datadict;
|
||||
|
306
mysql-test/suite/funcs_1/datadict/is_views.inc
Normal file
306
mysql-test/suite/funcs_1/datadict/is_views.inc
Normal file
|
@ -0,0 +1,306 @@
|
|||
# suite/funcs_1/datadict/is_views.inc
|
||||
#
|
||||
# Check the layout of information_schema.views and the impact of
|
||||
# CREATE/ALTER/DROP TABLE/VIEW/SCHEMA ... on it.
|
||||
#
|
||||
# Note:
|
||||
# - This test should not check storage engine properties.
|
||||
# - Please do not change the storage engines used within this test
|
||||
# except you know that the impact is acceptable.
|
||||
# Some storage engines might not support the modification of
|
||||
# properties like in the following tests.
|
||||
#
|
||||
# Author:
|
||||
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
|
||||
# testsuite funcs_1
|
||||
# Create this script based on older scripts and new code.
|
||||
# Last Change:
|
||||
# 2008-06-11 mleich Move t/is_views.test to this file and
|
||||
# create variants for embedded/non embedded server.
|
||||
#
|
||||
|
||||
let $engine_type = MEMORY;
|
||||
let $other_engine_type = MyISAM;
|
||||
|
||||
let $is_table = VIEWS;
|
||||
|
||||
# The table INFORMATION_SCHEMA.VIEWS must exist
|
||||
eval SHOW TABLES FROM information_schema LIKE '$is_table';
|
||||
|
||||
--echo #######################################################################
|
||||
--echo # Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
--echo #######################################################################
|
||||
# Ensure that every INFORMATION_SCHEMA table can be queried with a SELECT
|
||||
# statement, just as if it were an ordinary user-defined table.
|
||||
#
|
||||
--source suite/funcs_1/datadict/is_table_query.inc
|
||||
|
||||
|
||||
--echo #########################################################################
|
||||
--echo # Testcase 3.2.13.1: INFORMATION_SCHEMA.VIEWS layout
|
||||
--echo #########################################################################
|
||||
# Ensure that the INFORMATION_SCHEMA.VIEWS table has the following columns,
|
||||
# in the following order:
|
||||
#
|
||||
# TABLE_CATALOG (always shows NULL),
|
||||
# TABLE_SCHEMA (shows the database, or schema, in which an accessible
|
||||
# view resides),
|
||||
# TABLE_NAME (shows the name of a view accessible to the current user),
|
||||
# VIEW_DEFINITION (shows the SELECT statement that makes up the
|
||||
# view's definition),
|
||||
# CHECK_OPTION (shows the value of the WITH CHECK OPTION clause used to define
|
||||
# the view, either NONE, LOCAL or CASCADED),
|
||||
# IS_UPDATABLE (shows whether the view is an updatable view),
|
||||
# DEFINER (added with 5.0.14),
|
||||
# SECURITY_TYPE (added with 5.0.14).
|
||||
#
|
||||
--source suite/funcs_1/datadict/datadict_bug_12777.inc
|
||||
eval DESCRIBE information_schema.$is_table;
|
||||
--source suite/funcs_1/datadict/datadict_bug_12777.inc
|
||||
eval SHOW CREATE TABLE information_schema.$is_table;
|
||||
--source suite/funcs_1/datadict/datadict_bug_12777.inc
|
||||
eval SHOW COLUMNS FROM information_schema.$is_table;
|
||||
|
||||
# Note: Retrieval of information within information_schema.columns about
|
||||
# information_schema.views is in is_columns_is.test.
|
||||
|
||||
# Show that TABLE_CATALOG is always NULL.
|
||||
SELECT table_catalog, table_schema, table_name
|
||||
FROM information_schema.views WHERE table_catalog IS NOT NULL;
|
||||
|
||||
|
||||
--echo ################################################################################
|
||||
--echo # Testcase 3.2.13.2 + 3.2.13.3: INFORMATION_SCHEMA.VIEWS accessible information
|
||||
--echo ################################################################################
|
||||
# 3.2.13.2: Ensure that the table shows the relevant information on every view for
|
||||
# which the current user or PUBLIC has the SHOW CREATE VIEW privilege.
|
||||
# 3.2.13.3: Ensure that the table does not show any information on any views for which
|
||||
# the current user and PUBLIC have no SHOW CREATE VIEW privilege.
|
||||
#
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
--enable_warnings
|
||||
CREATE DATABASE db_datadict;
|
||||
|
||||
--error 0,ER_CANNOT_USER
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
--error 0,ER_CANNOT_USER
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
CREATE USER 'testuser2'@'localhost';
|
||||
--error 0,ER_CANNOT_USER
|
||||
DROP USER 'test_no_views'@'localhost';
|
||||
CREATE USER 'test_no_views'@'localhost';
|
||||
|
||||
--replace_result $engine_type <engine_type>
|
||||
eval
|
||||
CREATE TABLE db_datadict.t1(f1 INT, f2 INT, f3 INT)
|
||||
ENGINE = $engine_type;
|
||||
CREATE VIEW db_datadict.v_granted_to_1 AS SELECT * FROM db_datadict.t1;
|
||||
CREATE VIEW db_datadict.v_granted_glob AS SELECT f2, f3 FROM db_datadict.t1;
|
||||
|
||||
GRANT SELECT ON db_datadict.t1 TO 'testuser1'@'localhost';
|
||||
GRANT SELECT ON db_datadict.v_granted_to_1 TO 'testuser1'@'localhost';
|
||||
GRANT SHOW VIEW, CREATE VIEW ON db_datadict.* TO 'testuser2'@'localhost';
|
||||
|
||||
let $select = SELECT * FROM information_schema.views
|
||||
WHERE table_schema = 'db_datadict' ORDER BY table_name;
|
||||
eval $select;
|
||||
|
||||
--echo # Establish connection testuser1 (user=testuser1)
|
||||
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
|
||||
connect (testuser1, localhost, testuser1, , test);
|
||||
eval $select;
|
||||
|
||||
--echo # Establish connection testuser2 (user=testuser2)
|
||||
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
|
||||
connect (testuser2, localhost, testuser2, , test);
|
||||
eval $select;
|
||||
|
||||
--echo # Establish connection test_no_views (user=test_no_views)
|
||||
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
|
||||
connect (test_no_views, localhost, test_no_views, , test);
|
||||
eval $select;
|
||||
|
||||
# Cleanup
|
||||
--echo # Switch to connection default and close all other connections
|
||||
connection default;
|
||||
disconnect testuser1;
|
||||
disconnect testuser2;
|
||||
disconnect test_no_views;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
DROP USER 'test_no_views'@'localhost';
|
||||
DROP DATABASE db_datadict;
|
||||
|
||||
--echo #########################################################################
|
||||
--echo # 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.VIEWS modifications
|
||||
--echo #########################################################################
|
||||
# 3.2.1.13: Ensure that the creation of any new database object (e.g. table or
|
||||
# column) automatically inserts all relevant information on that
|
||||
# object into every appropriate INFORMATION_SCHEMA table.
|
||||
# 3.2.1.14: Ensure that the alteration of any existing database object
|
||||
# automatically updates all relevant information on that object in
|
||||
# every appropriate INFORMATION_SCHEMA table.
|
||||
# 3.2.1.15: Ensure that the dropping of any existing database object
|
||||
# automatically deletes all relevant information on that object from
|
||||
# every appropriate INFORMATION_SCHEMA table.
|
||||
#
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS test.t1_my_table;
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
--enable_warnings
|
||||
CREATE DATABASE db_datadict;
|
||||
--replace_result $engine_type <engine_type>
|
||||
eval
|
||||
CREATE TABLE test.t1_table (f1 BIGINT, f2 CHAR(10))
|
||||
DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci
|
||||
ENGINE = $engine_type;
|
||||
--error 0,ER_CANNOT_USER
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
|
||||
# Check just created VIEW
|
||||
SELECT * FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%';
|
||||
CREATE VIEW test.t1_view AS SELECT DISTINCT f1 FROM test.t1_table;
|
||||
SELECT * FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%';
|
||||
#
|
||||
# Check modification of DEFINER, SECURITY_TYPE, IS_UPDATABLE, VIEW_DEFINITION,
|
||||
# CHECK_OPTION
|
||||
SELECT table_name,definer FROM information_schema.views
|
||||
WHERE table_name = 't1_view';
|
||||
ALTER DEFINER = 'testuser1'@'localhost' VIEW test.t1_view AS
|
||||
SELECT DISTINCT f1 FROM test.t1_table;
|
||||
# The next result set could suffer from
|
||||
# Bug#22763 Disrepancy between SHOW CREATE VIEW and I_S.VIEWS
|
||||
# because the VIEW definition is missing.
|
||||
# Therefore we exclude the problematic columns from the result set.
|
||||
SELECT table_name,definer,security_type FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%';
|
||||
ALTER DEFINER = 'root'@'localhost' SQL SECURITY INVOKER VIEW test.t1_view AS
|
||||
SELECT f1 FROM test.t1_table WITH LOCAL CHECK OPTION;
|
||||
SELECT table_name,definer,security_type FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%';
|
||||
#
|
||||
# Check modification of TABLE_SCHEMA
|
||||
SELECT table_schema,table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_schema,table_name;
|
||||
--error ER_FORBID_SCHEMA_CHANGE
|
||||
RENAME TABLE test.t1_view TO db_datadict.t1_view;
|
||||
# Workaround for missing move to another database
|
||||
DROP VIEW test.t1_view;
|
||||
CREATE VIEW db_datadict.t1_view AS SELECT * FROM test.t1_table;
|
||||
SELECT table_schema,table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_schema,table_name;
|
||||
#
|
||||
# Check modification of TABLE_NAME
|
||||
SELECT table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
RENAME TABLE db_datadict.t1_view TO db_datadict.t1_viewx;
|
||||
SELECT table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
#
|
||||
# Check impact of DROP VIEW
|
||||
SELECT table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
DROP VIEW db_datadict.t1_viewx;
|
||||
SELECT table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
CREATE VIEW db_datadict.t1_view AS SELECT * FROM test.t1_table;
|
||||
#
|
||||
# Check impact of DROP base TABLE of VIEW
|
||||
SELECT table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
DROP TABLE test.t1_table;
|
||||
SELECT table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
--replace_result $engine_type <engine_type>
|
||||
eval
|
||||
CREATE TABLE test.t1_table (f1 BIGINT, f2 CHAR(10))
|
||||
DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci COMMENT = 'Initial Comment'
|
||||
ENGINE = $engine_type;
|
||||
#
|
||||
# Check impact of DROP SCHEMA
|
||||
SELECT table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
DROP DATABASE db_datadict;
|
||||
SELECT table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
|
||||
# Cleanup
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP TABLE test.t1_table;
|
||||
|
||||
--echo ########################################################################
|
||||
--echo # Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
--echo # DDL on INFORMATION_SCHEMA table are not supported
|
||||
--echo ########################################################################
|
||||
# 3.2.1.3: Ensure that no user may execute an INSERT statement on any
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.4: Ensure that no user may execute an UPDATE statement on any
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.5: Ensure that no user may execute a DELETE statement on any
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.8: Ensure that no user may create an index on an
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.9: Ensure that no user may alter the definition of an
|
||||
# INFORMATION_SCHEMA table.
|
||||
# 3.2.1.10: Ensure that no user may drop an INFORMATION_SCHEMA table.
|
||||
# 3.2.1.11: Ensure that no user may move an INFORMATION_SCHEMA table to any
|
||||
# other database.
|
||||
# 3.2.1.12: Ensure that no user may directly add to, alter, or delete any data
|
||||
# in an INFORMATION_SCHEMA table.
|
||||
#
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
--enable_warnings
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE VIEW db_datadict.v1 AS SELECT 1;
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
INSERT INTO information_schema.views
|
||||
SELECT * FROM information_schema.views;
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
INSERT INTO information_schema.views(table_schema, table_name)
|
||||
VALUES ('db2', 'v2');
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
UPDATE information_schema.views SET table_schema = 'test'
|
||||
WHERE table_name = 't1';
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
DELETE FROM information_schema.views WHERE table_name = 't1';
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
TRUNCATE information_schema.views;
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
CREATE INDEX my_idx_on_views ON information_schema.views(table_schema);
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
ALTER TABLE information_schema.views DROP PRIMARY KEY;
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
ALTER TABLE information_schema.views ADD f1 INT;
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
DROP TABLE information_schema.views;
|
||||
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
ALTER TABLE information_schema.views RENAME db_datadict.views;
|
||||
--error ER_DBACCESS_DENIED_ERROR
|
||||
ALTER TABLE information_schema.views RENAME information_schema.xviews;
|
||||
|
||||
# Cleanup
|
||||
DROP DATABASE db_datadict;
|
||||
|
55
mysql-test/suite/funcs_1/datadict/tables.inc
Normal file
55
mysql-test/suite/funcs_1/datadict/tables.inc
Normal file
|
@ -0,0 +1,55 @@
|
|||
# suite/funcs_1/datadict/tables.inc
|
||||
#
|
||||
# Auxiliary script to be sourced by
|
||||
# is_tables_<engine>.test
|
||||
#
|
||||
# The variable $engine_type has to be assigned before sourcing ths script.
|
||||
#
|
||||
# Author:
|
||||
# 2008-06-04 mleich Create this script based on older scripts and new code.
|
||||
#
|
||||
|
||||
# Just have some tables within different databases.
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS test1;
|
||||
DROP DATABASE IF EXISTS test2;
|
||||
--enable_warnings
|
||||
CREATE DATABASE test1;
|
||||
CREATE DATABASE test2;
|
||||
|
||||
--replace_result $engine_type <engine_to_be_used>
|
||||
eval CREATE TABLE test1.t1 (f1 VARCHAR(20)) ENGINE = $engine_type;
|
||||
--replace_result $engine_type <engine_to_be_used>
|
||||
eval CREATE TABLE test1.t2 (f1 VARCHAR(20)) ENGINE = $engine_type;
|
||||
--replace_result $engine_type <engine_to_be_used>
|
||||
eval CREATE TABLE test2.t1 (f1 VARCHAR(20)) ENGINE = $engine_type;
|
||||
|
||||
--source suite/funcs_1/datadict/tables2.inc
|
||||
SHOW TABLES FROM test1;
|
||||
SHOW TABLES FROM test2;
|
||||
|
||||
# Create a low privileged user.
|
||||
# Note: The database db_datadict is just a "home" for the low privileged user
|
||||
# and not in the focus of testing.
|
||||
--error 0,ER_CANNOT_USER
|
||||
DROP USER testuser1@localhost;
|
||||
CREATE USER testuser1@localhost;
|
||||
GRANT SELECT ON test1.* TO testuser1@localhost;
|
||||
|
||||
--echo # Establish connection testuser1 (user=testuser1)
|
||||
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
|
||||
connect (testuser1,localhost,testuser1,,test1);
|
||||
--source suite/funcs_1/datadict/tables2.inc
|
||||
SHOW TABLES FROM test1;
|
||||
# The lowprivileged user testuser1 will get here an error.
|
||||
--disable_abort_on_error
|
||||
SHOW TABLES FROM test2;
|
||||
--enable_abort_on_error
|
||||
|
||||
--echo # Switch to connection default and close connection testuser1
|
||||
connection default;
|
||||
disconnect testuser1;
|
||||
DROP USER testuser1@localhost;
|
||||
|
||||
DROP DATABASE test1;
|
||||
DROP DATABASE test2;
|
|
@ -2,8 +2,8 @@
|
|||
#
|
||||
# Auxiliary script to be sourced by
|
||||
# is_tables_mysql.test
|
||||
# is_tables_mysql_embedded.test
|
||||
# is_tables_is.test
|
||||
# is_tables_<engine>.test
|
||||
#
|
||||
# Author:
|
||||
# 2008-01-23 mleich WL#4203 Reorganize and fix the data dictionary tests of
|
||||
|
@ -12,28 +12,27 @@
|
|||
#
|
||||
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
DROP DATABASE IF EXISTS test1;
|
||||
--enable_warnings
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE DATABASE test1;
|
||||
|
||||
--source suite/funcs_1/datadict/tables2.inc
|
||||
|
||||
# Create a low privileged user.
|
||||
# Note: The database db_datadict is just a "home" for the low privileged user
|
||||
# Note: The database test1 is just a "home" for the low privileged user
|
||||
# and not in the focus of testing.
|
||||
--error 0,ER_CANNOT_USER
|
||||
DROP USER testuser1@localhost;
|
||||
CREATE USER testuser1@localhost;
|
||||
GRANT SELECT ON db_datadict.* TO testuser1@localhost;
|
||||
GRANT SELECT ON test1.* TO testuser1@localhost;
|
||||
|
||||
--echo # Establish connection testuser1 (user=testuser1)
|
||||
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
|
||||
connect (testuser1,localhost,testuser1,,db_datadict);
|
||||
connect (testuser1,localhost,testuser1,,test1);
|
||||
--source suite/funcs_1/datadict/tables2.inc
|
||||
|
||||
--echo # Switch to connection default and close connection testuser1
|
||||
connection default;
|
||||
disconnect testuser1;
|
||||
DROP USER testuser1@localhost;
|
||||
DROP DATABASE db_datadict;
|
||||
|
||||
DROP DATABASE test1;
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
let $innodb_pattern = 'InnoDB free';
|
||||
let $ndb_pattern = 'number_of_replicas';
|
||||
--vertical_results
|
||||
# We do not unify the engine name here, because the rowformat is
|
||||
# specific to the engine.
|
||||
--replace_column 8 "#TBLR#" 9 "#ARL#" 10 "#DL#" 11 "#MDL#" 12 "#IL#" 13 "#DF#" 15 "#CRT#" 16 "#UT#" 17 "#CT#" 20 "#CO#" 21 "#TC#"
|
||||
eval
|
||||
SELECT *,
|
||||
|
@ -44,4 +46,3 @@ FROM information_schema.tables
|
|||
$my_where
|
||||
ORDER BY table_schema,table_name;
|
||||
--horizontal_results
|
||||
|
||||
|
|
13
mysql-test/suite/funcs_1/include/bug28309_skip.inc
Normal file
13
mysql-test/suite/funcs_1/include/bug28309_skip.inc
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Skip tests which suffer from
|
||||
# Bug#28309 First insert violates unique constraint
|
||||
# - was "memory" table empty?
|
||||
# if the folowing conditions are fulfilled:
|
||||
# - MySQL Version is 5.0 (Bug is fixed in 5.1 and up)
|
||||
# - use of embedded server
|
||||
# - run on a case insensitive filesystem
|
||||
#
|
||||
let $value= query_get_value(SHOW VARIABLES LIKE 'lower_case_file_system', Value, 1);
|
||||
if (`SELECT '$value' = 'ON' AND VERSION() LIKE '5.0%embedded%'`)
|
||||
{
|
||||
skip # Test requires backport of fix for Bug#28309 First insert violates unique constraint - was "memory" table empty ?;
|
||||
}
|
|
@ -7,7 +7,7 @@ create table tb1 (
|
|||
f1 char(0),
|
||||
f2 char(0) binary,
|
||||
f3 char(0) ascii,
|
||||
f4 tinytext unicode,
|
||||
f4 tinytext,
|
||||
f5 text,
|
||||
f6 mediumtext,
|
||||
f7 longtext,
|
||||
|
|
|
@ -10,7 +10,7 @@ f120 char ascii not null DEFAULT b'101',
|
|||
f121 tinytext,
|
||||
f122 text,
|
||||
f123 mediumtext,
|
||||
f124 longtext unicode,
|
||||
f124 longtext,
|
||||
f125 tinyblob,
|
||||
f126 blob,
|
||||
f127 mediumblob,
|
||||
|
|
|
@ -55,13 +55,13 @@ f223 year(3),
|
|||
f224 year(4),
|
||||
f225 enum("1enum","2enum"),
|
||||
f226 set("1set","2set"),
|
||||
f235 char(0) unicode,
|
||||
f235 char(0),
|
||||
f236 char(90),
|
||||
f237 char(255) ascii,
|
||||
f238 varchar(0),
|
||||
f239 varchar(20000) binary,
|
||||
f240 varchar(2000) unicode,
|
||||
f241 char(100) unicode
|
||||
f240 varchar(2000),
|
||||
f241 char(100)
|
||||
) engine = innodb;
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
|
||||
|
|
|
@ -55,12 +55,12 @@ f223 year(3),
|
|||
f224 year(4),
|
||||
f225 enum("1enum","2enum"),
|
||||
f226 set("1set","2set"),
|
||||
f236 char(95) unicode,
|
||||
f241 char(255) unicode,
|
||||
f236 char(95),
|
||||
f241 char(255),
|
||||
f237 char(130) binary,
|
||||
f238 varchar(25000) binary,
|
||||
f239 varbinary(0),
|
||||
f240 varchar(1200) unicode
|
||||
f240 varchar(1200)
|
||||
) engine = memory;
|
||||
|
||||
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
|
||||
|
|
|
@ -7,7 +7,7 @@ create table tb1 (
|
|||
f1 char,
|
||||
f2 char binary,
|
||||
f3 char ascii,
|
||||
f4 tinytext unicode,
|
||||
f4 tinytext,
|
||||
f5 text,
|
||||
f6 mediumtext,
|
||||
f7 longtext,
|
||||
|
|
|
@ -10,7 +10,7 @@ f120 char ascii not null DEFAULT b'101',
|
|||
f121 tinytext,
|
||||
f122 text,
|
||||
f123 mediumtext,
|
||||
f124 longtext unicode,
|
||||
f124 longtext,
|
||||
f125 tinyblob,
|
||||
f126 blob,
|
||||
f127 mediumblob,
|
||||
|
|
|
@ -63,13 +63,13 @@ f231 VARBINARY(192),
|
|||
f232 VARBINARY(27),
|
||||
f233 VARBINARY(64),
|
||||
f234 VARBINARY(192),
|
||||
f235 char(255) unicode,
|
||||
f235 char(255),
|
||||
f236 char(60) ascii,
|
||||
f237 char(255) binary,
|
||||
f238 varchar(0) binary,
|
||||
f239 varbinary(1000),
|
||||
f240 varchar(120) unicode,
|
||||
f241 char(100) unicode,
|
||||
f240 varchar(120),
|
||||
f241 char(100),
|
||||
f242 bit(30)
|
||||
) engine = myisam;
|
||||
|
||||
|
|
66
mysql-test/suite/funcs_1/include/tb3.inc
Normal file
66
mysql-test/suite/funcs_1/include/tb3.inc
Normal file
|
@ -0,0 +1,66 @@
|
|||
##### suite/funcs_1/include/tb3.inc
|
||||
#
|
||||
# This auxiliary script is used in several Trigger tests.
|
||||
#
|
||||
# If the table need data than the file std_data_ln/funcs_1/memory_tb3.txt
|
||||
# could be used.
|
||||
#
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists tb3;
|
||||
--enable_warnings
|
||||
--replace_result $engine_type <engine_to_be_used>
|
||||
eval create table tb3 (
|
||||
f118 char not null DEFAULT 'a',
|
||||
f119 char binary not null DEFAULT b'101',
|
||||
f120 char ascii not null DEFAULT b'101',
|
||||
f121 char(50),
|
||||
f122 char(50),
|
||||
f129 binary not null DEFAULT b'101',
|
||||
f130 tinyint not null DEFAULT 99,
|
||||
f131 tinyint unsigned not null DEFAULT 99,
|
||||
f132 tinyint zerofill not null DEFAULT 99,
|
||||
f133 tinyint unsigned zerofill not null DEFAULT 99,
|
||||
f134 smallint not null DEFAULT 999,
|
||||
f135 smallint unsigned not null DEFAULT 999,
|
||||
f136 smallint zerofill not null DEFAULT 999,
|
||||
f137 smallint unsigned zerofill not null DEFAULT 999,
|
||||
f138 mediumint not null DEFAULT 9999,
|
||||
f139 mediumint unsigned not null DEFAULT 9999,
|
||||
f140 mediumint zerofill not null DEFAULT 9999,
|
||||
f141 mediumint unsigned zerofill not null DEFAULT 9999,
|
||||
f142 int not null DEFAULT 99999,
|
||||
f143 int unsigned not null DEFAULT 99999,
|
||||
f144 int zerofill not null DEFAULT 99999,
|
||||
f145 int unsigned zerofill not null DEFAULT 99999,
|
||||
f146 bigint not null DEFAULT 999999,
|
||||
f147 bigint unsigned not null DEFAULT 999999,
|
||||
f148 bigint zerofill not null DEFAULT 999999,
|
||||
f149 bigint unsigned zerofill not null DEFAULT 999999,
|
||||
f150 decimal not null DEFAULT 999.999,
|
||||
f151 decimal unsigned not null DEFAULT 999.17,
|
||||
f152 decimal zerofill not null DEFAULT 999.999,
|
||||
f153 decimal unsigned zerofill,
|
||||
f154 decimal (0),
|
||||
f155 decimal (64),
|
||||
f156 decimal (0) unsigned,
|
||||
f157 decimal (64) unsigned,
|
||||
f158 decimal (0) zerofill,
|
||||
f159 decimal (64) zerofill,
|
||||
f160 decimal (0) unsigned zerofill,
|
||||
f161 decimal (64) unsigned zerofill,
|
||||
f162 decimal (0,0),
|
||||
f163 decimal (63,30),
|
||||
f164 decimal (0,0) unsigned,
|
||||
f165 decimal (63,30) unsigned,
|
||||
f166 decimal (0,0) zerofill,
|
||||
f167 decimal (63,30) zerofill,
|
||||
f168 decimal (0,0) unsigned zerofill,
|
||||
f169 decimal (63,30) unsigned zerofill,
|
||||
f170 numeric,
|
||||
f171 numeric unsigned,
|
||||
f172 numeric zerofill,
|
||||
f173 numeric unsigned zerofill,
|
||||
f174 numeric (0),
|
||||
f175 numeric (64)
|
||||
) engine = $engine_type;
|
File diff suppressed because it is too large
Load diff
|
@ -14310,6 +14310,8 @@ ERROR 42000: Bad SQLSTATE: '2005-03-03'
|
|||
Testcase 4.2.43:
|
||||
--------------------------------------------------------------------------------
|
||||
DROP PROCEDURE IF EXISTS sp1;
|
||||
expect failure, SQLSTATE 00000 is not an acceptable value
|
||||
for an SP's handler
|
||||
CREATE PROCEDURE sp1()
|
||||
BEGIN
|
||||
declare cond1 condition for sqlstate '00000';
|
||||
|
@ -14317,10 +14319,11 @@ declare continue handler for cond1 set @var2 = 1;
|
|||
set @x=1;
|
||||
SELECT @var2;
|
||||
END//
|
||||
ERROR 42000: Bad SQLSTATE: '00000'
|
||||
ensure SP doesn't exist
|
||||
CALL sp1();
|
||||
@var2
|
||||
NULL
|
||||
DROP PROCEDURE sp1;
|
||||
ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist
|
||||
DROP PROCEDURE IF EXISTS sp1;
|
||||
|
||||
Testcase 4.2.45:
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -14389,16 +14392,19 @@ ERROR 42000: Bad SQLSTATE: '42s0200test'
|
|||
Testcase 4.2.48:
|
||||
--------------------------------------------------------------------------------
|
||||
DROP PROCEDURE IF EXISTS sp1;
|
||||
This creation should fail, SQLSTATE 00000 is unacceptable
|
||||
CREATE PROCEDURE sp1()
|
||||
BEGIN
|
||||
declare continue handler for sqlstate '00000' set @var2 = 1;
|
||||
set @x=1;
|
||||
SELECT @var2;
|
||||
END//
|
||||
ERROR 42000: Bad SQLSTATE: '00000'
|
||||
Verify SP wasn't created
|
||||
CALL sp1();
|
||||
@var2
|
||||
NULL
|
||||
DROP PROCEDURE sp1;
|
||||
ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist
|
||||
DROP PROCEDURE IF EXISTSsp1;
|
||||
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 'EXISTSsp1' at line 1
|
||||
|
||||
Testcase 4.2.52:
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -23502,6 +23508,7 @@ set x1 = 2;
|
|||
END;
|
||||
SELECT @x, x1;
|
||||
END//
|
||||
ERROR 42000: Bad SQLSTATE: '00000'
|
||||
DROP PROCEDURE IF EXISTS h1;
|
||||
|
||||
Testcase 4.11.40:
|
||||
|
@ -23539,9 +23546,9 @@ set x1 = 2;
|
|||
END;
|
||||
SELECT @x, x1;
|
||||
END//
|
||||
ERROR 42000: Bad SQLSTATE: '00000'
|
||||
CALL h1();
|
||||
@x x1
|
||||
0 2
|
||||
ERROR 42000: PROCEDURE db_storedproc.h1 does not exist
|
||||
DROP PROCEDURE IF EXISTS h1;
|
||||
|
||||
* Testcase 3.1.2.53 (4.11.42):
|
||||
|
|
|
@ -583,6 +583,7 @@ END//
|
|||
CALL h1();
|
||||
x1 x2 x3 x4 x5 x6
|
||||
1 1 1 1 1 1
|
||||
This will fail, SQLSTATE 00000 is not allowed
|
||||
CREATE PROCEDURE sp1()
|
||||
begin1_label:BEGIN
|
||||
declare exit handler for sqlstate '00000' set @var1 = 5;
|
||||
|
@ -594,14 +595,13 @@ SELECT @var3, @var4;
|
|||
END begin2_label;
|
||||
SELECT @var1, @var2;
|
||||
END begin1_label//
|
||||
ERROR 42000: Bad SQLSTATE: '00000'
|
||||
Verify SP wasn't created
|
||||
CALL sp1();
|
||||
@var3 @var4
|
||||
NULL 8
|
||||
@var1 @var2
|
||||
NULL 6
|
||||
ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist
|
||||
DROP PROCEDURE p1;
|
||||
DROP PROCEDURE h1;
|
||||
DROP PROCEDURE sp1;
|
||||
DROP PROCEDURE IF EXISTS sp1;
|
||||
DROP TABLE res_t1;
|
||||
|
||||
Testcase 3.1.2.50:
|
||||
|
|
|
@ -1,17 +1,11 @@
|
|||
USE test;
|
||||
drop table if exists tb3 ;
|
||||
drop table if exists tb3;
|
||||
create table tb3 (
|
||||
f118 char not null DEFAULT 'a',
|
||||
f119 char binary not null DEFAULT b'101',
|
||||
f120 char ascii not null DEFAULT b'101',
|
||||
f121 tinytext,
|
||||
f122 text,
|
||||
f123 mediumtext,
|
||||
f124 longtext unicode,
|
||||
f125 tinyblob,
|
||||
f126 blob,
|
||||
f127 mediumblob,
|
||||
f128 longblob,
|
||||
f121 char(50),
|
||||
f122 char(50),
|
||||
f129 binary not null DEFAULT b'101',
|
||||
f130 tinyint not null DEFAULT 99,
|
||||
f131 tinyint unsigned not null DEFAULT 99,
|
||||
|
@ -59,13 +53,11 @@ f172 numeric zerofill,
|
|||
f173 numeric unsigned zerofill,
|
||||
f174 numeric (0),
|
||||
f175 numeric (64)
|
||||
) engine = innodb;
|
||||
) engine = <engine_to_be_used>;
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'f150' at row 1
|
||||
Note 1265 Data truncated for column 'f151' at row 1
|
||||
Note 1265 Data truncated for column 'f152' at row 1
|
||||
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb3.txt'
|
||||
into table tb3;
|
||||
|
||||
Testcase: 3.5.1.1:
|
||||
------------------
|
||||
|
@ -194,7 +186,7 @@ Testcase 3.5.1.7: - need to fix
|
|||
drop table if exists t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
create table t1 (f1 int, f2 char(25),f3 int) engine=innodb;
|
||||
create table t1 (f1 int, f2 char(25),f3 int) engine = <engine_to_be_used>;
|
||||
CREATE TRIGGER trg5_1 BEFORE INSERT on test.t1
|
||||
for each row set new.f3 = '14';
|
||||
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
|
@ -238,7 +230,7 @@ ERROR HY000: Trigger in wrong schema
|
|||
drop database if exists trig_db;
|
||||
create database trig_db;
|
||||
use trig_db;
|
||||
create table t1 (f1 integer) engine = innodb;
|
||||
create table t1 (f1 integer) engine = <engine_to_be_used>;
|
||||
use test;
|
||||
CREATE TRIGGER trig_db.trg6_2 AFTER INSERT on tb3
|
||||
for each row set @ret_trg6_2 = 5;
|
||||
|
@ -266,8 +258,8 @@ Testcase 3.5.1.?:
|
|||
-----------------
|
||||
drop table if exists t1;
|
||||
drop table if exists t2;
|
||||
create table t1 (f1 char(50), f2 integer) engine = innodb;
|
||||
create table t2 (f1 char(50), f2 integer) engine = innodb;
|
||||
create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
|
||||
create table t2 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
|
||||
create trigger trig before insert on t1
|
||||
for each row set new.f1 ='trig t1';
|
||||
create trigger trig before update on t2
|
||||
|
@ -299,15 +291,15 @@ create database trig_db1;
|
|||
create database trig_db2;
|
||||
create database trig_db3;
|
||||
use trig_db1;
|
||||
create table t1 (f1 char(50), f2 integer) engine = innodb;
|
||||
create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
|
||||
create trigger trig before insert on t1
|
||||
for each row set new.f1 ='trig1', @test_var1='trig1';
|
||||
use trig_db2;
|
||||
create table t2 (f1 char(50), f2 integer) engine = innodb;
|
||||
create table t2 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
|
||||
create trigger trig before insert on t2
|
||||
for each row set new.f1 ='trig2', @test_var2='trig2';
|
||||
use trig_db3;
|
||||
create table t1 (f1 char(50), f2 integer) engine = innodb;
|
||||
create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
|
||||
create trigger trig before insert on t1
|
||||
for each row set new.f1 ='trig3', @test_var3='trig3';
|
||||
set @test_var1= '', @test_var2= '', @test_var3= '';
|
||||
|
@ -345,8 +337,8 @@ drop database if exists trig_db2;
|
|||
create database trig_db1;
|
||||
create database trig_db2;
|
||||
use trig_db1;
|
||||
create table t1 (f1 char(50), f2 integer) engine = innodb;
|
||||
create table trig_db2.t1 (f1 char(50), f2 integer) engine = innodb;
|
||||
create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
|
||||
create table trig_db2.t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
|
||||
create trigger trig1_b before insert on t1
|
||||
for each row set @test_var1='trig1_b';
|
||||
create trigger trig_db1.trig1_a after insert on t1
|
||||
|
|
|
@ -1,17 +1,11 @@
|
|||
USE test;
|
||||
drop table if exists tb3 ;
|
||||
drop table if exists tb3;
|
||||
create table tb3 (
|
||||
f118 char not null DEFAULT 'a',
|
||||
f119 char binary not null DEFAULT b'101',
|
||||
f120 char ascii not null DEFAULT b'101',
|
||||
f121 tinytext,
|
||||
f122 text,
|
||||
f123 mediumtext,
|
||||
f124 longtext unicode,
|
||||
f125 tinyblob,
|
||||
f126 blob,
|
||||
f127 mediumblob,
|
||||
f128 longblob,
|
||||
f121 char(50),
|
||||
f122 char(50),
|
||||
f129 binary not null DEFAULT b'101',
|
||||
f130 tinyint not null DEFAULT 99,
|
||||
f131 tinyint unsigned not null DEFAULT 99,
|
||||
|
@ -59,20 +53,18 @@ f172 numeric zerofill,
|
|||
f173 numeric unsigned zerofill,
|
||||
f174 numeric (0),
|
||||
f175 numeric (64)
|
||||
) engine = innodb;
|
||||
) engine = <engine_to_be_used>;
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'f150' at row 1
|
||||
Note 1265 Data truncated for column 'f151' at row 1
|
||||
Note 1265 Data truncated for column 'f152' at row 1
|
||||
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb3.txt'
|
||||
into table tb3;
|
||||
|
||||
Testcase 3.5.3:
|
||||
---------------
|
||||
drop database if exists priv_db;
|
||||
create database priv_db;
|
||||
use priv_db;
|
||||
create table t1 (f1 char(20)) engine= innodb;
|
||||
create table t1 (f1 char(20)) engine= <engine_to_be_used>;
|
||||
create User test_noprivs@localhost;
|
||||
set password for test_noprivs@localhost = password('PWD');
|
||||
create User test_yesprivs@localhost;
|
||||
|
@ -608,8 +600,8 @@ Testcase: 3.5.3.x:
|
|||
use priv_db;
|
||||
drop table if exists t1;
|
||||
drop table if exists t2;
|
||||
create table t1 (f1 int) engine= innodb;
|
||||
create table t2 (f2 int) engine= innodb;
|
||||
create table t1 (f1 int) engine= <engine_to_be_used>;
|
||||
create table t2 (f2 int) engine= <engine_to_be_used>;
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT, UPDATE on priv_db.t1 to test_yesprivs@localhost;
|
||||
|
@ -698,4 +690,5 @@ drop database if exists priv_db;
|
|||
drop user test_yesprivs@localhost;
|
||||
drop user test_noprivs@localhost;
|
||||
drop user test_noprivs;
|
||||
DROP TABLE test.tb3;
|
||||
use test;
|
||||
drop table tb3;
|
||||
|
|
|
@ -1,17 +1,11 @@
|
|||
USE test;
|
||||
drop table if exists tb3 ;
|
||||
drop table if exists tb3;
|
||||
create table tb3 (
|
||||
f118 char not null DEFAULT 'a',
|
||||
f119 char binary not null DEFAULT b'101',
|
||||
f120 char ascii not null DEFAULT b'101',
|
||||
f121 tinytext,
|
||||
f122 text,
|
||||
f123 mediumtext,
|
||||
f124 longtext unicode,
|
||||
f125 tinyblob,
|
||||
f126 blob,
|
||||
f127 mediumblob,
|
||||
f128 longblob,
|
||||
f121 char(50),
|
||||
f122 char(50),
|
||||
f129 binary not null DEFAULT b'101',
|
||||
f130 tinyint not null DEFAULT 99,
|
||||
f131 tinyint unsigned not null DEFAULT 99,
|
||||
|
@ -59,13 +53,11 @@ f172 numeric zerofill,
|
|||
f173 numeric unsigned zerofill,
|
||||
f174 numeric (0),
|
||||
f175 numeric (64)
|
||||
) engine = innodb;
|
||||
) engine = <engine_to_be_used>;
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'f150' at row 1
|
||||
Note 1265 Data truncated for column 'f151' at row 1
|
||||
Note 1265 Data truncated for column 'f152' at row 1
|
||||
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb3.txt'
|
||||
into table tb3;
|
||||
|
||||
Testcase: 3.5:
|
||||
--------------
|
||||
|
@ -86,7 +78,7 @@ Testcase 3.5.4.1:
|
|||
-----------------
|
||||
create database db_drop;
|
||||
Use db_drop;
|
||||
create table t1 (f1 char(30)) engine=innodb;
|
||||
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
|
||||
grant INSERT, SELECT on db_drop.t1 to test_general;
|
||||
Use db_drop;
|
||||
Create trigger trg1 BEFORE INSERT on t1
|
||||
|
@ -114,7 +106,7 @@ Testcase 3.5.4.2:
|
|||
create database db_drop2;
|
||||
Use db_drop2;
|
||||
drop table if exists t1_432 ;
|
||||
create table t1_432 (f1 char (30)) engine=innodb;
|
||||
create table t1_432 (f1 char (30)) engine = <engine_to_be_used>;
|
||||
Drop trigger tr_does_not_exit;
|
||||
ERROR HY000: Trigger does not exist
|
||||
drop table if exists t1_432 ;
|
||||
|
@ -126,8 +118,8 @@ create database db_drop3;
|
|||
Use db_drop3;
|
||||
drop table if exists t1_433 ;
|
||||
drop table if exists t1_433a ;
|
||||
create table t1_433 (f1 char (30)) engine=innodb;
|
||||
create table t1_433a (f1a char (5)) engine=innodb;
|
||||
create table t1_433 (f1 char (30)) engine = <engine_to_be_used>;
|
||||
create table t1_433a (f1a char (5)) engine = <engine_to_be_used>;
|
||||
CREATE TRIGGER trg3 BEFORE INSERT on t1_433 for each row
|
||||
set new.f1 = 'Trigger 3.5.4.3';
|
||||
Drop trigger t1.433.trg3;
|
||||
|
@ -147,7 +139,7 @@ Testcase 3.5.4.4:
|
|||
-----------------
|
||||
create database db_drop4;
|
||||
Use db_drop4;
|
||||
create table t1 (f1 char(30)) engine=innodb;
|
||||
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
|
||||
grant INSERT, SELECT on db_drop4.t1 to test_general;
|
||||
Create trigger trg4 BEFORE INSERT on t1
|
||||
for each row set new.f1='Trigger 3.5.4.4';
|
||||
|
@ -168,7 +160,7 @@ where information_schema.triggers.trigger_name='trg4';
|
|||
trigger_schema trigger_name event_object_table
|
||||
create database db_drop4;
|
||||
Use db_drop4;
|
||||
create table t1 (f1 char(30)) engine=innodb;
|
||||
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
|
||||
grant INSERT, SELECT on db_drop4.t1 to test_general;
|
||||
Insert into t1 values ('2nd Insert 3.5.4.4');
|
||||
Select * from t1;
|
||||
|
@ -183,7 +175,7 @@ Testcase 3.5.4.5:
|
|||
-----------------
|
||||
create database db_drop5;
|
||||
Use db_drop5;
|
||||
create table t1 (f1 char(50)) engine=innodb;
|
||||
create table t1 (f1 char(50)) engine = <engine_to_be_used>;
|
||||
grant INSERT, SELECT on t1 to test_general;
|
||||
Create trigger trg5 BEFORE INSERT on t1
|
||||
for each row set new.f1='Trigger 3.5.4.5';
|
||||
|
@ -199,7 +191,7 @@ select trigger_schema, trigger_name, event_object_table
|
|||
from information_schema.triggers
|
||||
where information_schema.triggers.trigger_name='trg5';
|
||||
trigger_schema trigger_name event_object_table
|
||||
create table t1 (f1 char(50)) engine=innodb;
|
||||
create table t1 (f1 char(50)) engine = <engine_to_be_used>;
|
||||
grant INSERT, SELECT on t1 to test_general;
|
||||
Insert into t1 values ('2nd Insert 3.5.4.5');
|
||||
Select * from t1;
|
||||
|
@ -240,7 +232,7 @@ Testcase 3.5.5.4:
|
|||
create database dbtest_one;
|
||||
create database dbtest_two;
|
||||
use dbtest_two;
|
||||
create table t2 (f1 char(15)) engine=innodb;
|
||||
create table t2 (f1 char(15)) engine = <engine_to_be_used>;
|
||||
use dbtest_one;
|
||||
create trigger trg4 before INSERT
|
||||
on dbtest_two.t2 for each row set new.f1='trig 3.5.5.4';
|
||||
|
|
|
@ -1,17 +1,11 @@
|
|||
USE test;
|
||||
drop table if exists tb3 ;
|
||||
drop table if exists tb3;
|
||||
create table tb3 (
|
||||
f118 char not null DEFAULT 'a',
|
||||
f119 char binary not null DEFAULT b'101',
|
||||
f120 char ascii not null DEFAULT b'101',
|
||||
f121 tinytext,
|
||||
f122 text,
|
||||
f123 mediumtext,
|
||||
f124 longtext unicode,
|
||||
f125 tinyblob,
|
||||
f126 blob,
|
||||
f127 mediumblob,
|
||||
f128 longblob,
|
||||
f121 char(50),
|
||||
f122 char(50),
|
||||
f129 binary not null DEFAULT b'101',
|
||||
f130 tinyint not null DEFAULT 99,
|
||||
f131 tinyint unsigned not null DEFAULT 99,
|
||||
|
@ -59,13 +53,11 @@ f172 numeric zerofill,
|
|||
f173 numeric unsigned zerofill,
|
||||
f174 numeric (0),
|
||||
f175 numeric (64)
|
||||
) engine = innodb;
|
||||
) engine = <engine_to_be_used>;
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'f150' at row 1
|
||||
Note 1265 Data truncated for column 'f151' at row 1
|
||||
Note 1265 Data truncated for column 'f152' at row 1
|
||||
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb3.txt'
|
||||
into table tb3;
|
||||
|
||||
Testcase: 3.5:
|
||||
--------------
|
||||
|
@ -94,17 +86,17 @@ create table t1_i (
|
|||
i120 char ascii not null DEFAULT b'101',
|
||||
i136 smallint zerofill not null DEFAULT 999,
|
||||
i144 int zerofill not null DEFAULT 99999,
|
||||
i163 decimal (63,30)) engine=innodb;
|
||||
i163 decimal (63,30)) engine=<engine_to_be_used>;
|
||||
create table t1_u (
|
||||
u120 char ascii not null DEFAULT b'101',
|
||||
u136 smallint zerofill not null DEFAULT 999,
|
||||
u144 int zerofill not null DEFAULT 99999,
|
||||
u163 decimal (63,30)) engine=innodb;
|
||||
u163 decimal (63,30)) engine=<engine_to_be_used>;
|
||||
create table t1_d (
|
||||
d120 char ascii not null DEFAULT b'101',
|
||||
d136 smallint zerofill not null DEFAULT 999,
|
||||
d144 int zerofill not null DEFAULT 99999,
|
||||
d163 decimal (63,30)) engine=innodb;
|
||||
d163 decimal (63,30)) engine=<engine_to_be_used>;
|
||||
Insert into t1_u values ('a',111,99999,999.99);
|
||||
Insert into t1_u values ('b',222,99999,999.99);
|
||||
Insert into t1_u values ('c',333,99999,999.99);
|
||||
|
|
|
@ -1,17 +1,11 @@
|
|||
USE test;
|
||||
drop table if exists tb3 ;
|
||||
drop table if exists tb3;
|
||||
create table tb3 (
|
||||
f118 char not null DEFAULT 'a',
|
||||
f119 char binary not null DEFAULT b'101',
|
||||
f120 char ascii not null DEFAULT b'101',
|
||||
f121 tinytext,
|
||||
f122 text,
|
||||
f123 mediumtext,
|
||||
f124 longtext unicode,
|
||||
f125 tinyblob,
|
||||
f126 blob,
|
||||
f127 mediumblob,
|
||||
f128 longblob,
|
||||
f121 char(50),
|
||||
f122 char(50),
|
||||
f129 binary not null DEFAULT b'101',
|
||||
f130 tinyint not null DEFAULT 99,
|
||||
f131 tinyint unsigned not null DEFAULT 99,
|
||||
|
@ -59,12 +53,12 @@ f172 numeric zerofill,
|
|||
f173 numeric unsigned zerofill,
|
||||
f174 numeric (0),
|
||||
f175 numeric (64)
|
||||
) engine = innodb;
|
||||
) engine = <engine_to_be_used>;
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'f150' at row 1
|
||||
Note 1265 Data truncated for column 'f151' at row 1
|
||||
Note 1265 Data truncated for column 'f152' at row 1
|
||||
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb3.txt'
|
||||
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
|
||||
into table tb3;
|
||||
|
||||
Testcase 3.5.9.1/2:
|
||||
|
@ -74,9 +68,9 @@ set new.f142 = 94087, @counter=@counter+1;
|
|||
TotalRows
|
||||
10
|
||||
Affected
|
||||
8
|
||||
9
|
||||
NotAffected
|
||||
2
|
||||
1
|
||||
NewValuew
|
||||
0
|
||||
set @counter=0;
|
||||
|
@ -84,7 +78,7 @@ Update tb3 Set f142='1' where f130<100;
|
|||
select count(*) as ExpectedChanged, @counter as TrigCounter
|
||||
from tb3 where f142=94087;
|
||||
ExpectedChanged TrigCounter
|
||||
8 8
|
||||
9 9
|
||||
select count(*) as ExpectedNotChange from tb3
|
||||
where f130<100 and f142<>94087;
|
||||
ExpectedNotChange
|
||||
|
|
|
@ -1,17 +1,11 @@
|
|||
USE test;
|
||||
drop table if exists tb3 ;
|
||||
drop table if exists tb3;
|
||||
create table tb3 (
|
||||
f118 char not null DEFAULT 'a',
|
||||
f119 char binary not null DEFAULT b'101',
|
||||
f120 char ascii not null DEFAULT b'101',
|
||||
f121 tinytext,
|
||||
f122 text,
|
||||
f123 mediumtext,
|
||||
f124 longtext unicode,
|
||||
f125 tinyblob,
|
||||
f126 blob,
|
||||
f127 mediumblob,
|
||||
f128 longblob,
|
||||
f121 char(50),
|
||||
f122 char(50),
|
||||
f129 binary not null DEFAULT b'101',
|
||||
f130 tinyint not null DEFAULT 99,
|
||||
f131 tinyint unsigned not null DEFAULT 99,
|
||||
|
@ -59,12 +53,12 @@ f172 numeric zerofill,
|
|||
f173 numeric unsigned zerofill,
|
||||
f174 numeric (0),
|
||||
f175 numeric (64)
|
||||
) engine = innodb;
|
||||
) engine = <engine_to_be_used>;
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'f150' at row 1
|
||||
Note 1265 Data truncated for column 'f151' at row 1
|
||||
Note 1265 Data truncated for column 'f152' at row 1
|
||||
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb3.txt'
|
||||
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
|
||||
into table tb3;
|
||||
|
||||
Testcase 3.5.10.1/2/3:
|
||||
|
@ -135,7 +129,7 @@ delete from tb3 where f122 like 'Test 3.5.10.1/2/3%';
|
|||
|
||||
Testcase 3.5.10.4:
|
||||
------------------
|
||||
create table tb_load (f1 int, f2 char(25),f3 int) engine=innodb;
|
||||
create table tb_load (f1 int, f2 char(25),f3 int) engine = <engine_to_be_used>;
|
||||
Create trigger trg4 before insert on tb_load
|
||||
for each row set new.f3=-(new.f1 div 5), @counter= @counter+1;
|
||||
set @counter= 0;
|
||||
|
@ -169,7 +163,7 @@ Testcase 3.5.10.6: (implemented in trig_frkey.test)
|
|||
|
||||
Testcase 3.5.10.extra:
|
||||
----------------------
|
||||
create table t1_sp (var136 tinyint, var151 decimal) engine=innodb;
|
||||
create table t1_sp (var136 tinyint, var151 decimal) engine = <engine_to_be_used>;
|
||||
create trigger trg before insert on t1_sp
|
||||
for each row set @counter=@counter+1;
|
||||
create procedure trig_sp()
|
||||
|
@ -218,12 +212,12 @@ drop table if exists t2_2;
|
|||
drop table if exists t2_3;
|
||||
drop table if exists t2_4;
|
||||
drop table if exists t3;
|
||||
create table t1 (f1 integer) engine=innodb;
|
||||
create table t2_1 (f1 integer) engine=innodb;
|
||||
create table t2_2 (f1 integer) engine=innodb;
|
||||
create table t2_3 (f1 integer) engine=innodb;
|
||||
create table t2_4 (f1 integer) engine=innodb;
|
||||
create table t3 (f1 integer) engine=innodb;
|
||||
create table t1 (f1 integer) engine = <engine_to_be_used>;
|
||||
create table t2_1 (f1 integer) engine = <engine_to_be_used>;
|
||||
create table t2_2 (f1 integer) engine = <engine_to_be_used>;
|
||||
create table t2_3 (f1 integer) engine = <engine_to_be_used>;
|
||||
create table t2_4 (f1 integer) engine = <engine_to_be_used>;
|
||||
create table t3 (f1 integer) engine = <engine_to_be_used>;
|
||||
insert into t1 values (1);
|
||||
create trigger tr1 after insert on t1 for each row
|
||||
BEGIN
|
||||
|
@ -261,10 +255,10 @@ drop table if exists t1;
|
|||
drop table if exists t2;
|
||||
drop table if exists t3;
|
||||
drop table if exists t4;
|
||||
create table t1 (f1 integer) engine = innodb;
|
||||
create table t2 (f2 integer) engine = innodb;
|
||||
create table t3 (f3 integer) engine = innodb;
|
||||
create table t4 (f4 integer) engine = innodb;
|
||||
create table t1 (f1 integer) engine = <engine_to_be_used>;
|
||||
create table t2 (f2 integer) engine = <engine_to_be_used>;
|
||||
create table t3 (f3 integer) engine = <engine_to_be_used>;
|
||||
create table t4 (f4 integer) engine = <engine_to_be_used>;
|
||||
insert into t1 values (0);
|
||||
create trigger tr1 after insert on t1
|
||||
for each row insert into t2 (f2) values (new.f1+1);
|
||||
|
@ -300,7 +294,7 @@ set @sql_mode='traditional';
|
|||
create table t1_sp (
|
||||
count integer,
|
||||
var136 tinyint,
|
||||
var151 decimal) engine=innodb;
|
||||
var151 decimal) engine = <engine_to_be_used>;
|
||||
create procedure trig_sp()
|
||||
begin
|
||||
declare done int default 0;
|
||||
|
@ -354,7 +348,7 @@ drop procedure trig_sp;
|
|||
drop trigger trg;
|
||||
drop table t1_sp;
|
||||
|
||||
Testcase y.y.y.5: Roleback of nested trigger references
|
||||
Testcase y.y.y.5: Rollback of nested trigger references
|
||||
-------------------------------------------------------
|
||||
set @@sql_mode='traditional';
|
||||
use test;
|
||||
|
@ -362,10 +356,10 @@ drop table if exists t1;
|
|||
drop table if exists t2;
|
||||
drop table if exists t3;
|
||||
drop table if exists t4;
|
||||
create table t1 (f1 integer) engine = innodb;
|
||||
create table t2 (f2 integer) engine = innodb;
|
||||
create table t3 (f3 integer) engine = innodb;
|
||||
create table t4 (f4 tinyint) engine = innodb;
|
||||
create table t1 (f1 integer) engine = <engine_to_be_used>;
|
||||
create table t2 (f2 integer) engine = <engine_to_be_used>;
|
||||
create table t3 (f3 integer) engine = <engine_to_be_used>;
|
||||
create table t4 (f4 tinyint) engine = <engine_to_be_used>;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
|
|
|
@ -1,141 +1,73 @@
|
|||
USE test;
|
||||
drop table if exists tb3 ;
|
||||
create table tb3 (
|
||||
f118 char not null DEFAULT 'a',
|
||||
f119 char binary not null DEFAULT b'101',
|
||||
f120 char ascii not null DEFAULT b'101',
|
||||
f121 tinytext,
|
||||
f122 text,
|
||||
f123 mediumtext,
|
||||
f124 longtext unicode,
|
||||
f125 tinyblob,
|
||||
f126 blob,
|
||||
f127 mediumblob,
|
||||
f128 longblob,
|
||||
f129 binary not null DEFAULT b'101',
|
||||
f130 tinyint not null DEFAULT 99,
|
||||
f131 tinyint unsigned not null DEFAULT 99,
|
||||
f132 tinyint zerofill not null DEFAULT 99,
|
||||
f133 tinyint unsigned zerofill not null DEFAULT 99,
|
||||
f134 smallint not null DEFAULT 999,
|
||||
f135 smallint unsigned not null DEFAULT 999,
|
||||
f136 smallint zerofill not null DEFAULT 999,
|
||||
f137 smallint unsigned zerofill not null DEFAULT 999,
|
||||
f138 mediumint not null DEFAULT 9999,
|
||||
f139 mediumint unsigned not null DEFAULT 9999,
|
||||
f140 mediumint zerofill not null DEFAULT 9999,
|
||||
f141 mediumint unsigned zerofill not null DEFAULT 9999,
|
||||
f142 int not null DEFAULT 99999,
|
||||
f143 int unsigned not null DEFAULT 99999,
|
||||
f144 int zerofill not null DEFAULT 99999,
|
||||
f145 int unsigned zerofill not null DEFAULT 99999,
|
||||
f146 bigint not null DEFAULT 999999,
|
||||
f147 bigint unsigned not null DEFAULT 999999,
|
||||
f148 bigint zerofill not null DEFAULT 999999,
|
||||
f149 bigint unsigned zerofill not null DEFAULT 999999,
|
||||
f150 decimal not null DEFAULT 999.999,
|
||||
f151 decimal unsigned not null DEFAULT 999.17,
|
||||
f152 decimal zerofill not null DEFAULT 999.999,
|
||||
f153 decimal unsigned zerofill,
|
||||
f154 decimal (0),
|
||||
f155 decimal (64),
|
||||
f156 decimal (0) unsigned,
|
||||
f157 decimal (64) unsigned,
|
||||
f158 decimal (0) zerofill,
|
||||
f159 decimal (64) zerofill,
|
||||
f160 decimal (0) unsigned zerofill,
|
||||
f161 decimal (64) unsigned zerofill,
|
||||
f162 decimal (0,0),
|
||||
f163 decimal (63,30),
|
||||
f164 decimal (0,0) unsigned,
|
||||
f165 decimal (63,30) unsigned,
|
||||
f166 decimal (0,0) zerofill,
|
||||
f167 decimal (63,30) zerofill,
|
||||
f168 decimal (0,0) unsigned zerofill,
|
||||
f169 decimal (63,30) unsigned zerofill,
|
||||
f170 numeric,
|
||||
f171 numeric unsigned,
|
||||
f172 numeric zerofill,
|
||||
f173 numeric unsigned zerofill,
|
||||
f174 numeric (0),
|
||||
f175 numeric (64)
|
||||
) engine = innodb;
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'f150' at row 1
|
||||
Note 1265 Data truncated for column 'f151' at row 1
|
||||
Note 1265 Data truncated for column 'f152' at row 1
|
||||
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb3.txt'
|
||||
into table tb3;
|
||||
|
||||
Testcase x.x.x.1:
|
||||
-----------------
|
||||
DROP TABLE IF EXISTS t0, t1, t2;
|
||||
CREATE TABLE t0 (col1 char(50)) ENGINE=innodb;
|
||||
CREATE TABLE t1 (id INT NOT NULL, col1 char(50),
|
||||
PRIMARY KEY (id)) ENGINE=innodb;
|
||||
CREATE TABLE t0 (col1 CHAR(50))
|
||||
ENGINE = <engine_to_be_tested>;
|
||||
CREATE TABLE t1 (id INT NOT NULL, col1 CHAR(50), PRIMARY KEY (id))
|
||||
ENGINE = <engine_to_be_tested>;
|
||||
CREATE TABLE t2 (id INT PRIMARY KEY, f_id INT,
|
||||
INDEX par_ind (f_id), col1 char(50),
|
||||
FOREIGN KEY (f_id) REFERENCES t1(id)
|
||||
ON DELETE SET NULL) ENGINE=innodb;
|
||||
insert into t1 values (1,'Department A');
|
||||
insert into t1 values (2,'Department B');
|
||||
insert into t1 values (3,'Department C');
|
||||
insert into t2 values (1,2,'Emp 1');
|
||||
insert into t2 values (2,2,'Emp 2');
|
||||
insert into t2 values (3,2,'Emp 3');
|
||||
create trigger trig after insert on t0 for each row
|
||||
delete from t1 where col1=new.col1;
|
||||
select * from t2;
|
||||
INDEX par_ind (f_id), col1 CHAR(50),
|
||||
FOREIGN KEY (f_id) REFERENCES t1(id) ON DELETE SET NULL)
|
||||
ENGINE = <engine_to_be_tested>;
|
||||
INSERT INTO t1 VALUES (1,'Department A');
|
||||
INSERT INTO t1 VALUES (2,'Department B');
|
||||
INSERT INTO t1 VALUES (3,'Department C');
|
||||
INSERT INTO t2 VALUES (1,2,'Emp 1');
|
||||
INSERT INTO t2 VALUES (2,2,'Emp 2');
|
||||
INSERT INTO t2 VALUES (3,2,'Emp 3');
|
||||
CREATE TRIGGER trig AFTER INSERT ON t0 FOR EACH ROW
|
||||
DELETE FROM t1 WHERE col1 = new.col1;
|
||||
SELECT * FROM t2;
|
||||
id f_id col1
|
||||
1 2 Emp 1
|
||||
2 2 Emp 2
|
||||
3 2 Emp 3
|
||||
lock tables t0 write, t1 write;
|
||||
insert into t0 values ('Department B');
|
||||
unlock tables;
|
||||
select * from t2;
|
||||
LOCK TABLES t0 WRITE, t1 WRITE;
|
||||
INSERT INTO t0 VALUES ('Department B');
|
||||
UNLOCK TABLES;
|
||||
SELECT * FROM t2;
|
||||
id f_id col1
|
||||
1 NULL Emp 1
|
||||
2 NULL Emp 2
|
||||
3 NULL Emp 3
|
||||
drop trigger trig;
|
||||
drop table t2, t1;
|
||||
DROP TRIGGER trig;
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
Testcase x.x.x.2:
|
||||
-----------------
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
CREATE TABLE t1 (id INT NOT NULL, col1 char(50),
|
||||
PRIMARY KEY (id)) ENGINE=innodb;
|
||||
CREATE TABLE t1 (id INT NOT NULL, col1 CHAR(50), PRIMARY KEY (id))
|
||||
ENGINE = <engine_to_be_tested>;
|
||||
CREATE TABLE t2 (id INT PRIMARY KEY, f_id INT,
|
||||
INDEX par_ind (f_id), col1 char(50),
|
||||
FOREIGN KEY (f_id) REFERENCES t1(id)
|
||||
ON UPDATE CASCADE) ENGINE=innodb;
|
||||
insert into t1 values (1,'Department A');
|
||||
insert into t1 values (2,'Department B');
|
||||
insert into t1 values (3,'Department C');
|
||||
insert into t2 values (1,2,'Emp 1');
|
||||
insert into t2 values (2,3,'Emp 2');
|
||||
insert into t2 values (3,4,'Emp 3');
|
||||
INDEX par_ind (f_id), col1 CHAR(50),
|
||||
FOREIGN KEY (f_id) REFERENCES t1(id) ON UPDATE CASCADE)
|
||||
ENGINE = <engine_to_be_tested>;
|
||||
INSERT INTO t1 VALUES (1,'Department A');
|
||||
INSERT INTO t1 VALUES (2,'Department B');
|
||||
INSERT INTO t1 VALUES (3,'Department C');
|
||||
INSERT INTO t2 VALUES (1,2,'Emp 1');
|
||||
INSERT INTO t2 VALUES (2,3,'Emp 2');
|
||||
insert into t2 VALUES (3,4,'Emp 3');
|
||||
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`f_id`) REFERENCES `t1` (`id`) ON UPDATE CASCADE)
|
||||
create trigger tr_t2 before insert on t2 for each row
|
||||
insert into t1 values(new.f_id, concat('New Department ', new.f_id));
|
||||
lock tables t1 write, t2 write;
|
||||
insert into t2 values (3,4,'Emp 3');
|
||||
unlock tables;
|
||||
select * from t1;
|
||||
CREATE TRIGGER tr_t2 BEFORE INSERT ON t2 FOR EACH ROW
|
||||
INSERT INTO t1 VALUES(new.f_id, CONCAT('New Department ', new.f_id));
|
||||
LOCK TABLES t1 WRITE, t2 WRITE;
|
||||
INSERT INTO t2 VALUES (3,4,'Emp 3');
|
||||
UNLOCK TABLES;
|
||||
SELECT * FROM t1;
|
||||
id col1
|
||||
1 Department A
|
||||
2 Department B
|
||||
3 Department C
|
||||
4 New Department 4
|
||||
select * from t2;
|
||||
SELECT * FROM t2;
|
||||
id f_id col1
|
||||
1 2 Emp 1
|
||||
2 3 Emp 2
|
||||
3 4 Emp 3
|
||||
drop trigger tr_t2;
|
||||
drop table t2, t1, t0;
|
||||
DROP TRIGGER tr_t2;
|
||||
DROP TABLE t2, t1, t0;
|
||||
|
||||
Foreign Key tests disabled (bug 11472 - stored in trig_frkey2.test)
|
||||
-------------------------------------------------------------------
|
||||
DROP TABLE test.tb3;
|
||||
|
|
97
mysql-test/suite/funcs_1/r/is_cml_innodb.result
Normal file
97
mysql-test/suite/funcs_1/r/is_cml_innodb.result
Normal file
|
@ -0,0 +1,97 @@
|
|||
USE test;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1
|
||||
(
|
||||
f1 CHAR UNICODE,
|
||||
f2 CHAR(0) UNICODE,
|
||||
f3 CHAR(10) UNICODE,
|
||||
f5 VARCHAR(0) UNICODE,
|
||||
f6 VARCHAR(255) UNICODE,
|
||||
f7 VARCHAR(260) UNICODE,
|
||||
f8 TEXT UNICODE,
|
||||
f9 TINYTEXT UNICODE,
|
||||
f10 MEDIUMTEXT UNICODE,
|
||||
f11 LONGTEXT UNICODE
|
||||
) ENGINE = InnoDB;
|
||||
SELECT * FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'test%'
|
||||
ORDER BY table_schema, table_name, column_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
|
||||
NULL test t1 f1 1 NULL YES char 1 2 NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references
|
||||
NULL test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references
|
||||
NULL test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references
|
||||
NULL test t1 f2 2 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
|
||||
NULL test t1 f3 3 NULL YES char 10 20 NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references
|
||||
NULL test t1 f5 4 NULL YES varchar 0 0 NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references
|
||||
NULL test t1 f6 5 NULL YES varchar 255 510 NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references
|
||||
NULL test t1 f7 6 NULL YES varchar 260 520 NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references
|
||||
NULL test t1 f8 7 NULL YES text 32767 65535 NULL NULL ucs2 ucs2_general_ci text select,insert,update,references
|
||||
NULL test t1 f9 8 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references
|
||||
##########################################################################
|
||||
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
|
||||
##########################################################################
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'test%'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'test%'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
2.0000 char ucs2 ucs2_general_ci
|
||||
2.0000 longtext ucs2 ucs2_general_ci
|
||||
2.0000 mediumtext ucs2 ucs2_general_ci
|
||||
2.0000 text ucs2 ucs2_general_ci
|
||||
2.0000 varchar ucs2 ucs2_general_ci
|
||||
2.0079 tinytext ucs2 ucs2_general_ci
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'test%'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
NULL char ucs2 ucs2_general_ci
|
||||
NULL varchar ucs2 ucs2_general_ci
|
||||
--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
|
||||
--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
|
||||
SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
TABLE_SCHEMA,
|
||||
TABLE_NAME,
|
||||
COLUMN_NAME,
|
||||
DATA_TYPE,
|
||||
CHARACTER_MAXIMUM_LENGTH,
|
||||
CHARACTER_OCTET_LENGTH,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME,
|
||||
COLUMN_TYPE
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'test%'
|
||||
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
|
||||
COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE
|
||||
2.0000 test t1 f1 char 1 2 ucs2 ucs2_general_ci char(1)
|
||||
NULL test t1 f2 char 0 0 ucs2 ucs2_general_ci char(0)
|
||||
2.0000 test t1 f3 char 10 20 ucs2 ucs2_general_ci char(10)
|
||||
NULL test t1 f5 varchar 0 0 ucs2 ucs2_general_ci varchar(0)
|
||||
2.0000 test t1 f6 varchar 255 510 ucs2 ucs2_general_ci varchar(255)
|
||||
2.0000 test t1 f7 varchar 260 520 ucs2 ucs2_general_ci varchar(260)
|
||||
2.0000 test t1 f8 text 32767 65535 ucs2 ucs2_general_ci text
|
||||
2.0079 test t1 f9 tinytext 127 255 ucs2 ucs2_general_ci tinytext
|
||||
2.0000 test t1 f10 mediumtext 8388607 16777215 ucs2 ucs2_general_ci mediumtext
|
||||
2.0000 test t1 f11 longtext 2147483647 4294967295 ucs2 ucs2_general_ci longtext
|
||||
DROP TABLE t1;
|
82
mysql-test/suite/funcs_1/r/is_cml_memory.result
Normal file
82
mysql-test/suite/funcs_1/r/is_cml_memory.result
Normal file
|
@ -0,0 +1,82 @@
|
|||
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
||||
USE test;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1
|
||||
(
|
||||
f1 CHAR UNICODE,
|
||||
f2 CHAR(0) UNICODE,
|
||||
f3 CHAR(10) UNICODE,
|
||||
f5 VARCHAR(0) UNICODE,
|
||||
f6 VARCHAR(255) UNICODE,
|
||||
f7 VARCHAR(260) UNICODE
|
||||
) ENGINE = MEMORY;
|
||||
SELECT * FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'test%'
|
||||
ORDER BY table_schema, table_name, column_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
|
||||
NULL test t1 f1 1 NULL YES char 1 2 NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references
|
||||
NULL test t1 f2 2 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
|
||||
NULL test t1 f3 3 NULL YES char 10 20 NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references
|
||||
NULL test t1 f5 4 NULL YES varchar 0 0 NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references
|
||||
NULL test t1 f6 5 NULL YES varchar 255 510 NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references
|
||||
NULL test t1 f7 6 NULL YES varchar 260 520 NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references
|
||||
##########################################################################
|
||||
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
|
||||
##########################################################################
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'test%'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'test%'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
2.0000 char ucs2 ucs2_general_ci
|
||||
2.0000 varchar ucs2 ucs2_general_ci
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'test%'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
NULL char ucs2 ucs2_general_ci
|
||||
NULL varchar ucs2 ucs2_general_ci
|
||||
--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
|
||||
--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
|
||||
SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
TABLE_SCHEMA,
|
||||
TABLE_NAME,
|
||||
COLUMN_NAME,
|
||||
DATA_TYPE,
|
||||
CHARACTER_MAXIMUM_LENGTH,
|
||||
CHARACTER_OCTET_LENGTH,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME,
|
||||
COLUMN_TYPE
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'test%'
|
||||
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
|
||||
COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE
|
||||
2.0000 test t1 f1 char 1 2 ucs2 ucs2_general_ci char(1)
|
||||
NULL test t1 f2 char 0 0 ucs2 ucs2_general_ci char(0)
|
||||
2.0000 test t1 f3 char 10 20 ucs2 ucs2_general_ci char(10)
|
||||
NULL test t1 f5 varchar 0 0 ucs2 ucs2_general_ci varchar(0)
|
||||
2.0000 test t1 f6 varchar 255 510 ucs2 ucs2_general_ci varchar(255)
|
||||
2.0000 test t1 f7 varchar 260 520 ucs2 ucs2_general_ci varchar(260)
|
||||
DROP TABLE t1;
|
98
mysql-test/suite/funcs_1/r/is_cml_myisam.result
Normal file
98
mysql-test/suite/funcs_1/r/is_cml_myisam.result
Normal file
|
@ -0,0 +1,98 @@
|
|||
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
||||
USE test;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1
|
||||
(
|
||||
f1 CHAR UNICODE,
|
||||
f2 CHAR(0) UNICODE,
|
||||
f3 CHAR(10) UNICODE,
|
||||
f5 VARCHAR(0) UNICODE,
|
||||
f6 VARCHAR(255) UNICODE,
|
||||
f7 VARCHAR(260) UNICODE,
|
||||
f8 TEXT UNICODE,
|
||||
f9 TINYTEXT UNICODE,
|
||||
f10 MEDIUMTEXT UNICODE,
|
||||
f11 LONGTEXT UNICODE
|
||||
) ENGINE = MyISAM;
|
||||
SELECT * FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'test%'
|
||||
ORDER BY table_schema, table_name, column_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
|
||||
NULL test t1 f1 1 NULL YES char 1 2 NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references
|
||||
NULL test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references
|
||||
NULL test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references
|
||||
NULL test t1 f2 2 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
|
||||
NULL test t1 f3 3 NULL YES char 10 20 NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references
|
||||
NULL test t1 f5 4 NULL YES varchar 0 0 NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references
|
||||
NULL test t1 f6 5 NULL YES varchar 255 510 NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references
|
||||
NULL test t1 f7 6 NULL YES varchar 260 520 NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references
|
||||
NULL test t1 f8 7 NULL YES text 32767 65535 NULL NULL ucs2 ucs2_general_ci text select,insert,update,references
|
||||
NULL test t1 f9 8 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references
|
||||
##########################################################################
|
||||
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
|
||||
##########################################################################
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'test%'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'test%'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
2.0000 char ucs2 ucs2_general_ci
|
||||
2.0000 longtext ucs2 ucs2_general_ci
|
||||
2.0000 mediumtext ucs2 ucs2_general_ci
|
||||
2.0000 text ucs2 ucs2_general_ci
|
||||
2.0000 varchar ucs2 ucs2_general_ci
|
||||
2.0079 tinytext ucs2 ucs2_general_ci
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'test%'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
NULL char ucs2 ucs2_general_ci
|
||||
NULL varchar ucs2 ucs2_general_ci
|
||||
--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
|
||||
--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
|
||||
SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
TABLE_SCHEMA,
|
||||
TABLE_NAME,
|
||||
COLUMN_NAME,
|
||||
DATA_TYPE,
|
||||
CHARACTER_MAXIMUM_LENGTH,
|
||||
CHARACTER_OCTET_LENGTH,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME,
|
||||
COLUMN_TYPE
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'test%'
|
||||
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
|
||||
COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE
|
||||
2.0000 test t1 f1 char 1 2 ucs2 ucs2_general_ci char(1)
|
||||
NULL test t1 f2 char 0 0 ucs2 ucs2_general_ci char(0)
|
||||
2.0000 test t1 f3 char 10 20 ucs2 ucs2_general_ci char(10)
|
||||
NULL test t1 f5 varchar 0 0 ucs2 ucs2_general_ci varchar(0)
|
||||
2.0000 test t1 f6 varchar 255 510 ucs2 ucs2_general_ci varchar(255)
|
||||
2.0000 test t1 f7 varchar 260 520 ucs2 ucs2_general_ci varchar(260)
|
||||
2.0000 test t1 f8 text 32767 65535 ucs2 ucs2_general_ci text
|
||||
2.0079 test t1 f9 tinytext 127 255 ucs2 ucs2_general_ci tinytext
|
||||
2.0000 test t1 f10 mediumtext 8388607 16777215 ucs2 ucs2_general_ci mediumtext
|
||||
2.0000 test t1 f11 longtext 2147483647 4294967295 ucs2 ucs2_general_ci longtext
|
||||
DROP TABLE t1;
|
98
mysql-test/suite/funcs_1/r/is_cml_ndb.result
Normal file
98
mysql-test/suite/funcs_1/r/is_cml_ndb.result
Normal file
|
@ -0,0 +1,98 @@
|
|||
USE test;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1
|
||||
(
|
||||
f1 CHAR UNICODE,
|
||||
f2 CHAR(0) UNICODE,
|
||||
f3 CHAR(10) UNICODE,
|
||||
f5 VARCHAR(0) UNICODE,
|
||||
f6 VARCHAR(255) UNICODE,
|
||||
f7 VARCHAR(260) UNICODE,
|
||||
f8 TEXT UNICODE,
|
||||
f9 TINYTEXT UNICODE,
|
||||
f10 MEDIUMTEXT UNICODE,
|
||||
f11 LONGTEXT UNICODE,
|
||||
PRIMARY KEY(f1)
|
||||
) ENGINE = NDB;
|
||||
SELECT * FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'test%'
|
||||
ORDER BY table_schema, table_name, column_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
|
||||
NULL test t1 f1 1 NO char 1 2 NULL NULL ucs2 ucs2_general_ci char(1) PRI select,insert,update,references
|
||||
NULL test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references
|
||||
NULL test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references
|
||||
NULL test t1 f2 2 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
|
||||
NULL test t1 f3 3 NULL YES char 10 20 NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references
|
||||
NULL test t1 f5 4 NULL YES varchar 0 0 NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references
|
||||
NULL test t1 f6 5 NULL YES varchar 255 510 NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references
|
||||
NULL test t1 f7 6 NULL YES varchar 260 520 NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references
|
||||
NULL test t1 f8 7 NULL YES text 32767 65535 NULL NULL ucs2 ucs2_general_ci text select,insert,update,references
|
||||
NULL test t1 f9 8 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references
|
||||
##########################################################################
|
||||
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
|
||||
##########################################################################
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'test%'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'test%'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
2.0000 char ucs2 ucs2_general_ci
|
||||
2.0000 longtext ucs2 ucs2_general_ci
|
||||
2.0000 mediumtext ucs2 ucs2_general_ci
|
||||
2.0000 text ucs2 ucs2_general_ci
|
||||
2.0000 varchar ucs2 ucs2_general_ci
|
||||
2.0079 tinytext ucs2 ucs2_general_ci
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'test%'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
NULL char ucs2 ucs2_general_ci
|
||||
NULL varchar ucs2 ucs2_general_ci
|
||||
--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
|
||||
--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
|
||||
SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
TABLE_SCHEMA,
|
||||
TABLE_NAME,
|
||||
COLUMN_NAME,
|
||||
DATA_TYPE,
|
||||
CHARACTER_MAXIMUM_LENGTH,
|
||||
CHARACTER_OCTET_LENGTH,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME,
|
||||
COLUMN_TYPE
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema LIKE 'test%'
|
||||
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
|
||||
COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE
|
||||
2.0000 test t1 f1 char 1 2 ucs2 ucs2_general_ci char(1)
|
||||
NULL test t1 f2 char 0 0 ucs2 ucs2_general_ci char(0)
|
||||
2.0000 test t1 f3 char 10 20 ucs2 ucs2_general_ci char(10)
|
||||
NULL test t1 f5 varchar 0 0 ucs2 ucs2_general_ci varchar(0)
|
||||
2.0000 test t1 f6 varchar 255 510 ucs2 ucs2_general_ci varchar(255)
|
||||
2.0000 test t1 f7 varchar 260 520 ucs2 ucs2_general_ci varchar(260)
|
||||
2.0000 test t1 f8 text 32767 65535 ucs2 ucs2_general_ci text
|
||||
2.0079 test t1 f9 tinytext 127 255 ucs2 ucs2_general_ci tinytext
|
||||
2.0000 test t1 f10 mediumtext 8388607 16777215 ucs2 ucs2_general_ci mediumtext
|
||||
2.0000 test t1 f11 longtext 2147483647 4294967295 ucs2 ucs2_general_ci longtext
|
||||
DROP TABLE t1;
|
|
@ -6,7 +6,7 @@ create table tb1 (
|
|||
f1 char(0),
|
||||
f2 char(0) binary,
|
||||
f3 char(0) ascii,
|
||||
f4 tinytext unicode,
|
||||
f4 tinytext,
|
||||
f5 text,
|
||||
f6 mediumtext,
|
||||
f7 longtext,
|
||||
|
@ -142,7 +142,7 @@ f120 char ascii not null DEFAULT b'101',
|
|||
f121 tinytext,
|
||||
f122 text,
|
||||
f123 mediumtext,
|
||||
f124 longtext unicode,
|
||||
f124 longtext,
|
||||
f125 tinyblob,
|
||||
f126 blob,
|
||||
f127 mediumblob,
|
||||
|
@ -254,13 +254,13 @@ f223 year(3),
|
|||
f224 year(4),
|
||||
f225 enum("1enum","2enum"),
|
||||
f226 set("1set","2set"),
|
||||
f235 char(0) unicode,
|
||||
f235 char(0),
|
||||
f236 char(90),
|
||||
f237 char(255) ascii,
|
||||
f238 varchar(0),
|
||||
f239 varchar(20000) binary,
|
||||
f240 varchar(2000) unicode,
|
||||
f241 char(100) unicode
|
||||
f240 varchar(2000),
|
||||
f241 char(100)
|
||||
) engine = innodb;
|
||||
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb4.txt'
|
||||
into table tb4;
|
||||
|
@ -460,7 +460,7 @@ NULL test tb1 f36 36 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0
|
|||
NULL test tb1 f37 37 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
|
||||
NULL test tb1 f38 38 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
|
||||
NULL test tb1 f39 39 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
|
||||
NULL test tb1 f4 4 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references
|
||||
NULL test tb1 f4 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references
|
||||
NULL test tb1 f40 40 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
|
||||
NULL test tb1 f41 41 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
|
||||
NULL test tb1 f42 42 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
|
||||
|
@ -542,7 +542,7 @@ NULL test tb3 f120 3 NO char 1 1 NULL NULL latin1 latin1_swedish_ci char(1)
|
|||
NULL test tb3 f121 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references
|
||||
NULL test tb3 f122 5 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text select,insert,update,references
|
||||
NULL test tb3 f123 6 NULL YES mediumtext 16777215 16777215 NULL NULL latin1 latin1_swedish_ci mediumtext select,insert,update,references
|
||||
NULL test tb3 f124 7 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references
|
||||
NULL test tb3 f124 7 NULL YES longtext 4294967295 4294967295 NULL NULL latin1 latin1_swedish_ci longtext select,insert,update,references
|
||||
NULL test tb3 f125 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL tinyblob select,insert,update,references
|
||||
NULL test tb3 f126 9 NULL YES blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
|
||||
NULL test tb3 f127 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL mediumblob select,insert,update,references
|
||||
|
@ -645,13 +645,13 @@ NULL test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL year(4) sele
|
|||
NULL test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
|
||||
NULL test tb4 f225 50 NULL YES enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references
|
||||
NULL test tb4 f226 51 NULL YES set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references
|
||||
NULL test tb4 f235 52 NULL YES char 0 0 NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references
|
||||
NULL test tb4 f235 52 NULL YES char 0 0 NULL NULL latin1 latin1_swedish_ci char(0) select,insert,update,references
|
||||
NULL test tb4 f236 53 NULL YES char 90 90 NULL NULL latin1 latin1_swedish_ci char(90) select,insert,update,references
|
||||
NULL test tb4 f237 54 NULL YES char 255 255 NULL NULL latin1 latin1_swedish_ci char(255) select,insert,update,references
|
||||
NULL test tb4 f238 55 NULL YES varchar 0 0 NULL NULL latin1 latin1_swedish_ci varchar(0) select,insert,update,references
|
||||
NULL test tb4 f239 56 NULL YES varchar 20000 20000 NULL NULL latin1 latin1_bin varchar(20000) select,insert,update,references
|
||||
NULL test tb4 f240 57 NULL YES varchar 2000 4000 NULL NULL ucs2 ucs2_general_ci varchar(2000) select,insert,update,references
|
||||
NULL test tb4 f241 58 NULL YES char 100 200 NULL NULL ucs2 ucs2_general_ci char(100) select,insert,update,references
|
||||
NULL test tb4 f240 57 NULL YES varchar 2000 2000 NULL NULL latin1 latin1_swedish_ci varchar(2000) select,insert,update,references
|
||||
NULL test tb4 f241 58 NULL YES char 100 100 NULL NULL latin1 latin1_swedish_ci char(100) select,insert,update,references
|
||||
NULL test1 tb2 f100 42 00000000000000000008.8 NO double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
|
||||
NULL test1 tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date select,insert,update,references
|
||||
NULL test1 tb2 f102 44 00:00:20 NO time NULL NULL NULL NULL NULL NULL time select,insert,update,references
|
||||
|
@ -736,6 +736,7 @@ COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
|||
1.0000 set latin1 latin1_swedish_ci
|
||||
1.0000 text latin1 latin1_swedish_ci
|
||||
1.0000 tinytext latin1 latin1_swedish_ci
|
||||
1.0000 varchar latin1 latin1_swedish_ci
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
|
@ -746,10 +747,6 @@ WHERE table_schema LIKE 'test%'
|
|||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
2.0000 char ucs2 ucs2_general_ci
|
||||
2.0000 longtext ucs2 ucs2_general_ci
|
||||
2.0000 varchar ucs2 ucs2_general_ci
|
||||
2.0079 tinytext ucs2 ucs2_general_ci
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
|
@ -780,7 +777,6 @@ NULL year NULL NULL
|
|||
NULL char latin1 latin1_bin
|
||||
NULL char latin1 latin1_swedish_ci
|
||||
NULL varchar latin1 latin1_swedish_ci
|
||||
NULL char ucs2 ucs2_general_ci
|
||||
--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
|
||||
--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
|
||||
SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
|
@ -844,7 +840,7 @@ NULL test t9 f3 int NULL NULL NULL NULL int(11)
|
|||
NULL test tb1 f1 char 0 0 latin1 latin1_swedish_ci char(0)
|
||||
NULL test tb1 f2 char 0 0 latin1 latin1_bin char(0)
|
||||
NULL test tb1 f3 char 0 0 latin1 latin1_swedish_ci char(0)
|
||||
2.0079 test tb1 f4 tinytext 127 255 ucs2 ucs2_general_ci tinytext
|
||||
1.0000 test tb1 f4 tinytext 255 255 latin1 latin1_swedish_ci tinytext
|
||||
1.0000 test tb1 f5 text 65535 65535 latin1 latin1_swedish_ci text
|
||||
1.0000 test tb1 f6 mediumtext 16777215 16777215 latin1 latin1_swedish_ci mediumtext
|
||||
1.0000 test tb1 f7 longtext 4294967295 4294967295 latin1 latin1_swedish_ci longtext
|
||||
|
@ -956,7 +952,7 @@ NULL test tb2 f107 year NULL NULL NULL NULL year(4)
|
|||
1.0000 test tb3 f121 tinytext 255 255 latin1 latin1_swedish_ci tinytext
|
||||
1.0000 test tb3 f122 text 65535 65535 latin1 latin1_swedish_ci text
|
||||
1.0000 test tb3 f123 mediumtext 16777215 16777215 latin1 latin1_swedish_ci mediumtext
|
||||
2.0000 test tb3 f124 longtext 2147483647 4294967295 ucs2 ucs2_general_ci longtext
|
||||
1.0000 test tb3 f124 longtext 4294967295 4294967295 latin1 latin1_swedish_ci longtext
|
||||
1.0000 test tb3 f125 tinyblob 255 255 NULL NULL tinyblob
|
||||
1.0000 test tb3 f126 blob 65535 65535 NULL NULL blob
|
||||
1.0000 test tb3 f127 mediumblob 16777215 16777215 NULL NULL mediumblob
|
||||
|
@ -1059,13 +1055,13 @@ NULL test tb4 f223 year NULL NULL NULL NULL year(4)
|
|||
NULL test tb4 f224 year NULL NULL NULL NULL year(4)
|
||||
1.0000 test tb4 f225 enum 5 5 latin1 latin1_swedish_ci enum('1enum','2enum')
|
||||
1.0000 test tb4 f226 set 9 9 latin1 latin1_swedish_ci set('1set','2set')
|
||||
NULL test tb4 f235 char 0 0 ucs2 ucs2_general_ci char(0)
|
||||
NULL test tb4 f235 char 0 0 latin1 latin1_swedish_ci char(0)
|
||||
1.0000 test tb4 f236 char 90 90 latin1 latin1_swedish_ci char(90)
|
||||
1.0000 test tb4 f237 char 255 255 latin1 latin1_swedish_ci char(255)
|
||||
NULL test tb4 f238 varchar 0 0 latin1 latin1_swedish_ci varchar(0)
|
||||
1.0000 test tb4 f239 varchar 20000 20000 latin1 latin1_bin varchar(20000)
|
||||
2.0000 test tb4 f240 varchar 2000 4000 ucs2 ucs2_general_ci varchar(2000)
|
||||
2.0000 test tb4 f241 char 100 200 ucs2 ucs2_general_ci char(100)
|
||||
1.0000 test tb4 f240 varchar 2000 2000 latin1 latin1_swedish_ci varchar(2000)
|
||||
1.0000 test tb4 f241 char 100 100 latin1 latin1_swedish_ci char(100)
|
||||
NULL test1 tb2 f59 decimal NULL NULL NULL NULL decimal(10,0) unsigned
|
||||
NULL test1 tb2 f60 decimal NULL NULL NULL NULL decimal(64,0) unsigned
|
||||
NULL test1 tb2 f61 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill
|
||||
|
|
656
mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
Normal file
656
mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
Normal file
|
@ -0,0 +1,656 @@
|
|||
SELECT * FROM information_schema.columns
|
||||
WHERE table_schema = 'information_schema'
|
||||
AND table_name <> 'profiling'
|
||||
ORDER BY table_schema, table_name, column_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
|
||||
NULL information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema CHARACTER_SETS DESCRIPTION 3 NO varchar 60 180 NULL NULL utf8 utf8_general_ci varchar(60)
|
||||
NULL information_schema CHARACTER_SETS MAXLEN 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(3)
|
||||
NULL information_schema COLLATIONS CHARACTER_SET_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema COLLATIONS COLLATION_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema COLLATIONS ID 3 0 NO bigint NULL NULL 19 0 NULL NULL bigint(11)
|
||||
NULL information_schema COLLATIONS IS_COMPILED 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
|
||||
NULL information_schema COLLATIONS IS_DEFAULT 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
|
||||
NULL information_schema COLLATIONS SORTLEN 6 0 NO bigint NULL NULL 19 0 NULL NULL bigint(3)
|
||||
NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema COLUMNS CHARACTER_OCTET_LENGTH 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema COLUMNS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema COLUMNS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema COLUMNS COLUMN_COMMENT 19 NO varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255)
|
||||
NULL information_schema COLUMNS COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
|
||||
NULL information_schema COLUMNS COLUMN_KEY 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
|
||||
NULL information_schema COLUMNS COLUMN_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema COLUMNS COLUMN_TYPE 15 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
|
||||
NULL information_schema COLUMNS DATA_TYPE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema COLUMNS EXTRA 17 NO varchar 27 81 NULL NULL utf8 utf8_general_ci varchar(27)
|
||||
NULL information_schema COLUMNS IS_NULLABLE 7 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
|
||||
NULL information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema COLUMNS ORDINAL_POSITION 5 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema COLUMNS PRIVILEGES 18 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80)
|
||||
NULL information_schema COLUMNS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
|
||||
NULL information_schema COLUMNS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema COLUMNS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema COLUMN_PRIVILEGES COLUMN_NAME 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema COLUMN_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81)
|
||||
NULL information_schema COLUMN_PRIVILEGES IS_GRANTABLE 7 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
|
||||
NULL information_schema COLUMN_PRIVILEGES PRIVILEGE_TYPE 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema COLUMN_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
|
||||
NULL information_schema COLUMN_PRIVILEGES TABLE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema COLUMN_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema ENGINES COMMENT 3 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80)
|
||||
NULL information_schema ENGINES ENGINE 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema ENGINES SAVEPOINTS 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
|
||||
NULL information_schema ENGINES SUPPORT 2 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8)
|
||||
NULL information_schema ENGINES TRANSACTIONS 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
|
||||
NULL information_schema ENGINES XA 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
|
||||
NULL information_schema EVENTS CHARACTER_SET_CLIENT 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
|
||||
NULL information_schema EVENTS COLLATION_CONNECTION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
|
||||
NULL information_schema EVENTS CREATED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime
|
||||
NULL information_schema EVENTS DATABASE_COLLATION 24 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
|
||||
NULL information_schema EVENTS DEFINER 4 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77)
|
||||
NULL information_schema EVENTS ENDS 14 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
|
||||
NULL information_schema EVENTS EVENT_BODY 6 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8)
|
||||
NULL information_schema EVENTS EVENT_CATALOG 1 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema EVENTS EVENT_COMMENT 20 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema EVENTS EVENT_DEFINITION 7 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
|
||||
NULL information_schema EVENTS EVENT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema EVENTS EVENT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema EVENTS EVENT_TYPE 8 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9)
|
||||
NULL information_schema EVENTS EXECUTE_AT 9 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
|
||||
NULL information_schema EVENTS INTERVAL_FIELD 11 NULL YES varchar 18 54 NULL NULL utf8 utf8_general_ci varchar(18)
|
||||
NULL information_schema EVENTS INTERVAL_VALUE 10 NULL YES varchar 256 768 NULL NULL utf8 utf8_general_ci varchar(256)
|
||||
NULL information_schema EVENTS LAST_ALTERED 18 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime
|
||||
NULL information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
|
||||
NULL information_schema EVENTS ON_COMPLETION 16 NO varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12)
|
||||
NULL information_schema EVENTS ORIGINATOR 21 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10)
|
||||
NULL information_schema EVENTS SQL_MODE 12 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
|
||||
NULL information_schema EVENTS STARTS 13 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
|
||||
NULL information_schema EVENTS STATUS 15 NO varchar 18 54 NULL NULL utf8 utf8_general_ci varchar(18)
|
||||
NULL information_schema EVENTS TIME_ZONE 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema FILES AUTOEXTEND_SIZE 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema FILES AVG_ROW_LENGTH 28 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema FILES CHECK_TIME 35 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
|
||||
NULL information_schema FILES CREATE_TIME 33 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
|
||||
NULL information_schema FILES CREATION_TIME 20 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
|
||||
NULL information_schema FILES DATA_FREE 32 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema FILES DATA_LENGTH 29 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema FILES DELETED_ROWS 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
|
||||
NULL information_schema FILES ENGINE 10 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema FILES EXTENT_SIZE 16 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4)
|
||||
NULL information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255)
|
||||
NULL information_schema FILES FILE_ID 1 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4)
|
||||
NULL information_schema FILES FILE_NAME 2 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema FILES FILE_TYPE 3 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20)
|
||||
NULL information_schema FILES FREE_EXTENTS 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
|
||||
NULL information_schema FILES FULLTEXT_KEYS 11 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema FILES INDEX_LENGTH 31 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema FILES INITIAL_SIZE 17 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema FILES LAST_ACCESS_TIME 22 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
|
||||
NULL information_schema FILES LAST_UPDATE_TIME 21 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
|
||||
NULL information_schema FILES LOGFILE_GROUP_NAME 8 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema FILES LOGFILE_GROUP_NUMBER 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
|
||||
NULL information_schema FILES MAXIMUM_SIZE 18 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema FILES MAX_DATA_LENGTH 30 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema FILES RECOVER_TIME 23 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
|
||||
NULL information_schema FILES ROW_FORMAT 26 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10)
|
||||
NULL information_schema FILES STATUS 37 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20)
|
||||
NULL information_schema FILES TABLESPACE_NAME 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema FILES TABLE_CATALOG 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema FILES TABLE_NAME 7 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema FILES TABLE_ROWS 27 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema FILES TABLE_SCHEMA 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema FILES TOTAL_EXTENTS 15 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
|
||||
NULL information_schema FILES TRANSACTION_COUNTER 24 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
|
||||
NULL information_schema FILES UPDATE_COUNT 13 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(4)
|
||||
NULL information_schema FILES UPDATE_TIME 34 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
|
||||
NULL information_schema FILES VERSION 25 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema GLOBAL_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480)
|
||||
NULL information_schema GLOBAL_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480)
|
||||
NULL information_schema KEY_COLUMN_USAGE COLUMN_NAME 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
|
||||
NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema KEY_COLUMN_USAGE ORDINAL_POSITION 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(10)
|
||||
NULL information_schema KEY_COLUMN_USAGE POSITION_IN_UNIQUE_CONSTRAINT 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(10)
|
||||
NULL information_schema KEY_COLUMN_USAGE REFERENCED_COLUMN_NAME 12 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_NAME 11 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_SCHEMA 10 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema KEY_COLUMN_USAGE TABLE_CATALOG 4 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
|
||||
NULL information_schema KEY_COLUMN_USAGE TABLE_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema KEY_COLUMN_USAGE TABLE_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema PARTITIONS AVG_ROW_LENGTH 14 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema PARTITIONS CHECKSUM 22 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema PARTITIONS CHECK_TIME 21 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
|
||||
NULL information_schema PARTITIONS CREATE_TIME 19 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
|
||||
NULL information_schema PARTITIONS DATA_FREE 18 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema PARTITIONS DATA_LENGTH 15 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema PARTITIONS INDEX_LENGTH 17 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema PARTITIONS MAX_DATA_LENGTH 16 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema PARTITIONS NODEGROUP 24 NO varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12)
|
||||
NULL information_schema PARTITIONS PARTITION_COMMENT 23 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80)
|
||||
NULL information_schema PARTITIONS PARTITION_DESCRIPTION 12 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
|
||||
NULL information_schema PARTITIONS PARTITION_EXPRESSION 10 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
|
||||
NULL information_schema PARTITIONS PARTITION_METHOD 8 NULL YES varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12)
|
||||
NULL information_schema PARTITIONS PARTITION_NAME 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema PARTITIONS PARTITION_ORDINAL_POSITION 6 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema PARTITIONS SUBPARTITION_EXPRESSION 11 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
|
||||
NULL information_schema PARTITIONS SUBPARTITION_METHOD 9 NULL YES varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12)
|
||||
NULL information_schema PARTITIONS SUBPARTITION_NAME 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema PARTITIONS SUBPARTITION_ORDINAL_POSITION 7 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema PARTITIONS TABLESPACE_NAME 25 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema PARTITIONS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
|
||||
NULL information_schema PARTITIONS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema PARTITIONS TABLE_ROWS 13 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema PARTITIONS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema PARTITIONS UPDATE_TIME 20 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
|
||||
NULL information_schema PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
|
||||
NULL information_schema PLUGINS PLUGIN_LIBRARY 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20)
|
||||
NULL information_schema PLUGINS PLUGIN_LICENSE 10 NULL YES varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80)
|
||||
NULL information_schema PLUGINS PLUGIN_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema PLUGINS PLUGIN_STATUS 3 NO varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10)
|
||||
NULL information_schema PLUGINS PLUGIN_TYPE 4 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80)
|
||||
NULL information_schema PLUGINS PLUGIN_TYPE_VERSION 5 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20)
|
||||
NULL information_schema PLUGINS PLUGIN_VERSION 2 NO varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20)
|
||||
NULL information_schema PROCESSLIST COMMAND 5 NO varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16)
|
||||
NULL information_schema PROCESSLIST DB 4 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema PROCESSLIST HOST 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema PROCESSLIST ID 1 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4)
|
||||
NULL information_schema PROCESSLIST INFO 8 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
|
||||
NULL information_schema PROCESSLIST STATE 7 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema PROCESSLIST TIME 6 0 NO bigint NULL NULL 19 0 NULL NULL bigint(7)
|
||||
NULL information_schema PROCESSLIST USER 2 NO varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16)
|
||||
NULL information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
|
||||
NULL information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema REFERENTIAL_CONSTRAINTS DELETE_RULE 9 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema REFERENTIAL_CONSTRAINTS MATCH_OPTION 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema REFERENTIAL_CONSTRAINTS REFERENCED_TABLE_NAME 11 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema REFERENTIAL_CONSTRAINTS TABLE_NAME 10 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_CATALOG 4 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
|
||||
NULL information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_NAME 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema REFERENTIAL_CONSTRAINTS UPDATE_RULE 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema ROUTINES CHARACTER_SET_CLIENT 21 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
|
||||
NULL information_schema ROUTINES COLLATION_CONNECTION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
|
||||
NULL information_schema ROUTINES CREATED 16 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime
|
||||
NULL information_schema ROUTINES DATABASE_COLLATION 23 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
|
||||
NULL information_schema ROUTINES DEFINER 20 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77)
|
||||
NULL information_schema ROUTINES DTD_IDENTIFIER 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema ROUTINES EXTERNAL_LANGUAGE 10 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema ROUTINES EXTERNAL_NAME 9 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema ROUTINES IS_DETERMINISTIC 12 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
|
||||
NULL information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime NULL NULL NULL NULL NULL NULL datetime
|
||||
NULL information_schema ROUTINES PARAMETER_STYLE 11 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8)
|
||||
NULL information_schema ROUTINES ROUTINE_BODY 7 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8)
|
||||
NULL information_schema ROUTINES ROUTINE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
|
||||
NULL information_schema ROUTINES ROUTINE_COMMENT 19 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema ROUTINES ROUTINE_DEFINITION 8 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
|
||||
NULL information_schema ROUTINES ROUTINE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema ROUTINES ROUTINE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema ROUTINES ROUTINE_TYPE 5 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9)
|
||||
NULL information_schema ROUTINES SECURITY_TYPE 15 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7)
|
||||
NULL information_schema ROUTINES SPECIFIC_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema ROUTINES SQL_DATA_ACCESS 13 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema ROUTINES SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
|
||||
NULL information_schema ROUTINES SQL_PATH 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema SCHEMATA CATALOG_NAME 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
|
||||
NULL information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema SCHEMATA DEFAULT_COLLATION_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema SCHEMATA SCHEMA_NAME 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema SCHEMATA SQL_PATH 5 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
|
||||
NULL information_schema SCHEMA_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81)
|
||||
NULL information_schema SCHEMA_PRIVILEGES IS_GRANTABLE 5 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
|
||||
NULL information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
|
||||
NULL information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema SESSION_STATUS VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480)
|
||||
NULL information_schema SESSION_VARIABLES VARIABLE_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL YES varchar 20480 61440 NULL NULL utf8 utf8_general_ci varchar(20480)
|
||||
NULL information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21)
|
||||
NULL information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL utf8 utf8_general_ci varchar(1)
|
||||
NULL information_schema STATISTICS COLUMN_NAME 8 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema STATISTICS COMMENT 15 NULL YES varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16)
|
||||
NULL information_schema STATISTICS INDEX_NAME 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema STATISTICS INDEX_SCHEMA 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema STATISTICS INDEX_TYPE 14 NO varchar 16 48 NULL NULL utf8 utf8_general_ci varchar(16)
|
||||
NULL information_schema STATISTICS NON_UNIQUE 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(1)
|
||||
NULL information_schema STATISTICS NULLABLE 13 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
|
||||
NULL information_schema STATISTICS PACKED 12 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10)
|
||||
NULL information_schema STATISTICS SEQ_IN_INDEX 7 0 NO bigint NULL NULL 19 0 NULL NULL bigint(2)
|
||||
NULL information_schema STATISTICS SUB_PART 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(3)
|
||||
NULL information_schema STATISTICS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
|
||||
NULL information_schema STATISTICS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema STATISTICS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
|
||||
NULL information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 255 765 NULL NULL utf8 utf8_general_ci varchar(255)
|
||||
NULL information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
|
||||
NULL information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema TABLES ENGINE 5 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema TABLES INDEX_LENGTH 12 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema TABLES MAX_DATA_LENGTH 11 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema TABLES ROW_FORMAT 7 NULL YES varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10)
|
||||
NULL information_schema TABLES TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
|
||||
NULL information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema TABLES TABLE_COMMENT 21 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80)
|
||||
NULL information_schema TABLES TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema TABLES TABLE_ROWS 8 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema TABLES TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema TABLES TABLE_TYPE 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema TABLES UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
|
||||
NULL information_schema TABLES VERSION 6 NULL YES bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned
|
||||
NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
|
||||
NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema TABLE_CONSTRAINTS CONSTRAINT_TYPE 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema TABLE_CONSTRAINTS TABLE_NAME 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema TABLE_CONSTRAINTS TABLE_SCHEMA 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema TABLE_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81)
|
||||
NULL information_schema TABLE_PRIVILEGES IS_GRANTABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
|
||||
NULL information_schema TABLE_PRIVILEGES PRIVILEGE_TYPE 5 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema TABLE_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
|
||||
NULL information_schema TABLE_PRIVILEGES TABLE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema TABLE_PRIVILEGES TABLE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
|
||||
NULL information_schema TRIGGERS ACTION_ORDER 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(4)
|
||||
NULL information_schema TRIGGERS ACTION_ORIENTATION 11 NO varchar 9 27 NULL NULL utf8 utf8_general_ci varchar(9)
|
||||
NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
|
||||
NULL information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
|
||||
NULL information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
|
||||
NULL information_schema TRIGGERS ACTION_TIMING 12 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6)
|
||||
NULL information_schema TRIGGERS CHARACTER_SET_CLIENT 20 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
|
||||
NULL information_schema TRIGGERS COLLATION_CONNECTION 21 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
|
||||
NULL information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
|
||||
NULL information_schema TRIGGERS DATABASE_COLLATION 22 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
|
||||
NULL information_schema TRIGGERS DEFINER 19 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
|
||||
NULL information_schema TRIGGERS EVENT_MANIPULATION 4 NO varchar 6 18 NULL NULL utf8 utf8_general_ci varchar(6)
|
||||
NULL information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
|
||||
NULL information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema TRIGGERS SQL_MODE 18 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
|
||||
NULL information_schema TRIGGERS TRIGGER_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
|
||||
NULL information_schema TRIGGERS TRIGGER_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema TRIGGERS TRIGGER_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema USER_PRIVILEGES GRANTEE 1 NO varchar 81 243 NULL NULL utf8 utf8_general_ci varchar(81)
|
||||
NULL information_schema USER_PRIVILEGES IS_GRANTABLE 4 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
|
||||
NULL information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
|
||||
NULL information_schema VIEWS CHARACTER_SET_CLIENT 9 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
|
||||
NULL information_schema VIEWS CHECK_OPTION 5 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8)
|
||||
NULL information_schema VIEWS COLLATION_CONNECTION 10 NO varchar 32 96 NULL NULL utf8 utf8_general_ci varchar(32)
|
||||
NULL information_schema VIEWS DEFINER 7 NO varchar 77 231 NULL NULL utf8 utf8_general_ci varchar(77)
|
||||
NULL information_schema VIEWS IS_UPDATABLE 6 NO varchar 3 9 NULL NULL utf8 utf8_general_ci varchar(3)
|
||||
NULL information_schema VIEWS SECURITY_TYPE 8 NO varchar 7 21 NULL NULL utf8 utf8_general_ci varchar(7)
|
||||
NULL information_schema VIEWS TABLE_CATALOG 1 NULL YES varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
|
||||
NULL information_schema VIEWS TABLE_NAME 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema VIEWS TABLE_SCHEMA 2 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext
|
||||
##########################################################################
|
||||
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
|
||||
##########################################################################
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'information_schema'
|
||||
AND table_name <> 'profiling'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
1.0000 longtext utf8 utf8_general_ci
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'information_schema'
|
||||
AND table_name <> 'profiling'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
3.0000 varchar utf8 utf8_general_ci
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'information_schema'
|
||||
AND table_name <> 'profiling'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
NULL bigint NULL NULL
|
||||
NULL datetime NULL NULL
|
||||
--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
|
||||
--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
|
||||
SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
TABLE_SCHEMA,
|
||||
TABLE_NAME,
|
||||
COLUMN_NAME,
|
||||
DATA_TYPE,
|
||||
CHARACTER_MAXIMUM_LENGTH,
|
||||
CHARACTER_OCTET_LENGTH,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME,
|
||||
COLUMN_TYPE
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'information_schema'
|
||||
AND table_name <> 'profiling'
|
||||
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
|
||||
COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE
|
||||
3.0000 information_schema CHARACTER_SETS CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema CHARACTER_SETS DESCRIPTION varchar 60 180 utf8 utf8_general_ci varchar(60)
|
||||
NULL information_schema CHARACTER_SETS MAXLEN bigint NULL NULL NULL NULL bigint(3)
|
||||
3.0000 information_schema COLLATIONS COLLATION_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema COLLATIONS CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema COLLATIONS ID bigint NULL NULL NULL NULL bigint(11)
|
||||
3.0000 information_schema COLLATIONS IS_DEFAULT varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
3.0000 information_schema COLLATIONS IS_COMPILED varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
NULL information_schema COLLATIONS SORTLEN bigint NULL NULL NULL NULL bigint(3)
|
||||
3.0000 information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema COLUMNS TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema COLUMNS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema COLUMNS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema COLUMNS COLUMN_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema COLUMNS ORDINAL_POSITION bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
1.0000 information_schema COLUMNS COLUMN_DEFAULT longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
3.0000 information_schema COLUMNS IS_NULLABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
3.0000 information_schema COLUMNS DATA_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL information_schema COLUMNS CHARACTER_OCTET_LENGTH bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL information_schema COLUMNS NUMERIC_PRECISION bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL information_schema COLUMNS NUMERIC_SCALE bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
3.0000 information_schema COLUMNS CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema COLUMNS COLLATION_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
1.0000 information_schema COLUMNS COLUMN_TYPE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
3.0000 information_schema COLUMNS COLUMN_KEY varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
3.0000 information_schema COLUMNS EXTRA varchar 27 81 utf8 utf8_general_ci varchar(27)
|
||||
3.0000 information_schema COLUMNS PRIVILEGES varchar 80 240 utf8 utf8_general_ci varchar(80)
|
||||
3.0000 information_schema COLUMNS COLUMN_COMMENT varchar 255 765 utf8 utf8_general_ci varchar(255)
|
||||
3.0000 information_schema COLUMN_PRIVILEGES GRANTEE varchar 81 243 utf8 utf8_general_ci varchar(81)
|
||||
3.0000 information_schema COLUMN_PRIVILEGES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema COLUMN_PRIVILEGES TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema COLUMN_PRIVILEGES TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema COLUMN_PRIVILEGES COLUMN_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema COLUMN_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema COLUMN_PRIVILEGES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
3.0000 information_schema ENGINES ENGINE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema ENGINES SUPPORT varchar 8 24 utf8 utf8_general_ci varchar(8)
|
||||
3.0000 information_schema ENGINES COMMENT varchar 80 240 utf8 utf8_general_ci varchar(80)
|
||||
3.0000 information_schema ENGINES TRANSACTIONS varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
3.0000 information_schema ENGINES XA varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
3.0000 information_schema ENGINES SAVEPOINTS varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
3.0000 information_schema EVENTS EVENT_CATALOG varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema EVENTS EVENT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema EVENTS EVENT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema EVENTS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77)
|
||||
3.0000 information_schema EVENTS TIME_ZONE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema EVENTS EVENT_BODY varchar 8 24 utf8 utf8_general_ci varchar(8)
|
||||
1.0000 information_schema EVENTS EVENT_DEFINITION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
3.0000 information_schema EVENTS EVENT_TYPE varchar 9 27 utf8 utf8_general_ci varchar(9)
|
||||
NULL information_schema EVENTS EXECUTE_AT datetime NULL NULL NULL NULL datetime
|
||||
3.0000 information_schema EVENTS INTERVAL_VALUE varchar 256 768 utf8 utf8_general_ci varchar(256)
|
||||
3.0000 information_schema EVENTS INTERVAL_FIELD varchar 18 54 utf8 utf8_general_ci varchar(18)
|
||||
1.0000 information_schema EVENTS SQL_MODE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
NULL information_schema EVENTS STARTS datetime NULL NULL NULL NULL datetime
|
||||
NULL information_schema EVENTS ENDS datetime NULL NULL NULL NULL datetime
|
||||
3.0000 information_schema EVENTS STATUS varchar 18 54 utf8 utf8_general_ci varchar(18)
|
||||
3.0000 information_schema EVENTS ON_COMPLETION varchar 12 36 utf8 utf8_general_ci varchar(12)
|
||||
NULL information_schema EVENTS CREATED datetime NULL NULL NULL NULL datetime
|
||||
NULL information_schema EVENTS LAST_ALTERED datetime NULL NULL NULL NULL datetime
|
||||
NULL information_schema EVENTS LAST_EXECUTED datetime NULL NULL NULL NULL datetime
|
||||
3.0000 information_schema EVENTS EVENT_COMMENT varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema EVENTS ORIGINATOR bigint NULL NULL NULL NULL bigint(10)
|
||||
3.0000 information_schema EVENTS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
|
||||
3.0000 information_schema EVENTS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
|
||||
3.0000 information_schema EVENTS DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
|
||||
NULL information_schema FILES FILE_ID bigint NULL NULL NULL NULL bigint(4)
|
||||
3.0000 information_schema FILES FILE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema FILES FILE_TYPE varchar 20 60 utf8 utf8_general_ci varchar(20)
|
||||
3.0000 information_schema FILES TABLESPACE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema FILES TABLE_CATALOG varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema FILES TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema FILES TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema FILES LOGFILE_GROUP_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema FILES LOGFILE_GROUP_NUMBER bigint NULL NULL NULL NULL bigint(4)
|
||||
3.0000 information_schema FILES ENGINE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema FILES FULLTEXT_KEYS varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema FILES DELETED_ROWS bigint NULL NULL NULL NULL bigint(4)
|
||||
NULL information_schema FILES UPDATE_COUNT bigint NULL NULL NULL NULL bigint(4)
|
||||
NULL information_schema FILES FREE_EXTENTS bigint NULL NULL NULL NULL bigint(4)
|
||||
NULL information_schema FILES TOTAL_EXTENTS bigint NULL NULL NULL NULL bigint(4)
|
||||
NULL information_schema FILES EXTENT_SIZE bigint NULL NULL NULL NULL bigint(4)
|
||||
NULL information_schema FILES INITIAL_SIZE bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL information_schema FILES MAXIMUM_SIZE bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL information_schema FILES AUTOEXTEND_SIZE bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL information_schema FILES CREATION_TIME datetime NULL NULL NULL NULL datetime
|
||||
NULL information_schema FILES LAST_UPDATE_TIME datetime NULL NULL NULL NULL datetime
|
||||
NULL information_schema FILES LAST_ACCESS_TIME datetime NULL NULL NULL NULL datetime
|
||||
NULL information_schema FILES RECOVER_TIME bigint NULL NULL NULL NULL bigint(4)
|
||||
NULL information_schema FILES TRANSACTION_COUNTER bigint NULL NULL NULL NULL bigint(4)
|
||||
NULL information_schema FILES VERSION bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
3.0000 information_schema FILES ROW_FORMAT varchar 10 30 utf8 utf8_general_ci varchar(10)
|
||||
NULL information_schema FILES TABLE_ROWS bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL information_schema FILES AVG_ROW_LENGTH bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL information_schema FILES DATA_LENGTH bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL information_schema FILES MAX_DATA_LENGTH bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL information_schema FILES INDEX_LENGTH bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL information_schema FILES DATA_FREE bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL information_schema FILES CREATE_TIME datetime NULL NULL NULL NULL datetime
|
||||
NULL information_schema FILES UPDATE_TIME datetime NULL NULL NULL NULL datetime
|
||||
NULL information_schema FILES CHECK_TIME datetime NULL NULL NULL NULL datetime
|
||||
NULL information_schema FILES CHECKSUM bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
3.0000 information_schema FILES STATUS varchar 20 60 utf8 utf8_general_ci varchar(20)
|
||||
3.0000 information_schema FILES EXTRA varchar 255 765 utf8 utf8_general_ci varchar(255)
|
||||
3.0000 information_schema GLOBAL_STATUS VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema GLOBAL_STATUS VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
|
||||
3.0000 information_schema GLOBAL_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema GLOBAL_VARIABLES VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
|
||||
3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema KEY_COLUMN_USAGE TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema KEY_COLUMN_USAGE TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema KEY_COLUMN_USAGE TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema KEY_COLUMN_USAGE COLUMN_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema KEY_COLUMN_USAGE ORDINAL_POSITION bigint NULL NULL NULL NULL bigint(10)
|
||||
NULL information_schema KEY_COLUMN_USAGE POSITION_IN_UNIQUE_CONSTRAINT bigint NULL NULL NULL NULL bigint(10)
|
||||
3.0000 information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema KEY_COLUMN_USAGE REFERENCED_COLUMN_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema PARTITIONS TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema PARTITIONS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema PARTITIONS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema PARTITIONS PARTITION_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema PARTITIONS SUBPARTITION_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema PARTITIONS PARTITION_ORDINAL_POSITION bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL information_schema PARTITIONS SUBPARTITION_ORDINAL_POSITION bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
3.0000 information_schema PARTITIONS PARTITION_METHOD varchar 12 36 utf8 utf8_general_ci varchar(12)
|
||||
3.0000 information_schema PARTITIONS SUBPARTITION_METHOD varchar 12 36 utf8 utf8_general_ci varchar(12)
|
||||
1.0000 information_schema PARTITIONS PARTITION_EXPRESSION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
1.0000 information_schema PARTITIONS SUBPARTITION_EXPRESSION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
1.0000 information_schema PARTITIONS PARTITION_DESCRIPTION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
NULL information_schema PARTITIONS TABLE_ROWS bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL information_schema PARTITIONS AVG_ROW_LENGTH bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL information_schema PARTITIONS DATA_LENGTH bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL information_schema PARTITIONS MAX_DATA_LENGTH bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL information_schema PARTITIONS INDEX_LENGTH bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL information_schema PARTITIONS DATA_FREE bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL information_schema PARTITIONS CREATE_TIME datetime NULL NULL NULL NULL datetime
|
||||
NULL information_schema PARTITIONS UPDATE_TIME datetime NULL NULL NULL NULL datetime
|
||||
NULL information_schema PARTITIONS CHECK_TIME datetime NULL NULL NULL NULL datetime
|
||||
NULL information_schema PARTITIONS CHECKSUM bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
3.0000 information_schema PARTITIONS PARTITION_COMMENT varchar 80 240 utf8 utf8_general_ci varchar(80)
|
||||
3.0000 information_schema PARTITIONS NODEGROUP varchar 12 36 utf8 utf8_general_ci varchar(12)
|
||||
3.0000 information_schema PARTITIONS TABLESPACE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema PLUGINS PLUGIN_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema PLUGINS PLUGIN_VERSION varchar 20 60 utf8 utf8_general_ci varchar(20)
|
||||
3.0000 information_schema PLUGINS PLUGIN_STATUS varchar 10 30 utf8 utf8_general_ci varchar(10)
|
||||
3.0000 information_schema PLUGINS PLUGIN_TYPE varchar 80 240 utf8 utf8_general_ci varchar(80)
|
||||
3.0000 information_schema PLUGINS PLUGIN_TYPE_VERSION varchar 20 60 utf8 utf8_general_ci varchar(20)
|
||||
3.0000 information_schema PLUGINS PLUGIN_LIBRARY varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema PLUGINS PLUGIN_LIBRARY_VERSION varchar 20 60 utf8 utf8_general_ci varchar(20)
|
||||
3.0000 information_schema PLUGINS PLUGIN_AUTHOR varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
1.0000 information_schema PLUGINS PLUGIN_DESCRIPTION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
3.0000 information_schema PLUGINS PLUGIN_LICENSE varchar 80 240 utf8 utf8_general_ci varchar(80)
|
||||
NULL information_schema PROCESSLIST ID bigint NULL NULL NULL NULL bigint(4)
|
||||
3.0000 information_schema PROCESSLIST USER varchar 16 48 utf8 utf8_general_ci varchar(16)
|
||||
3.0000 information_schema PROCESSLIST HOST varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema PROCESSLIST DB varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema PROCESSLIST COMMAND varchar 16 48 utf8 utf8_general_ci varchar(16)
|
||||
NULL information_schema PROCESSLIST TIME bigint NULL NULL NULL NULL bigint(7)
|
||||
3.0000 information_schema PROCESSLIST STATE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
1.0000 information_schema PROCESSLIST INFO longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema REFERENTIAL_CONSTRAINTS MATCH_OPTION varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema REFERENTIAL_CONSTRAINTS UPDATE_RULE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema REFERENTIAL_CONSTRAINTS DELETE_RULE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema REFERENTIAL_CONSTRAINTS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema REFERENTIAL_CONSTRAINTS REFERENCED_TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema ROUTINES SPECIFIC_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema ROUTINES ROUTINE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema ROUTINES ROUTINE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema ROUTINES ROUTINE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema ROUTINES ROUTINE_TYPE varchar 9 27 utf8 utf8_general_ci varchar(9)
|
||||
3.0000 information_schema ROUTINES DTD_IDENTIFIER varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema ROUTINES ROUTINE_BODY varchar 8 24 utf8 utf8_general_ci varchar(8)
|
||||
1.0000 information_schema ROUTINES ROUTINE_DEFINITION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
3.0000 information_schema ROUTINES EXTERNAL_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema ROUTINES EXTERNAL_LANGUAGE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema ROUTINES PARAMETER_STYLE varchar 8 24 utf8 utf8_general_ci varchar(8)
|
||||
3.0000 information_schema ROUTINES IS_DETERMINISTIC varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
3.0000 information_schema ROUTINES SQL_DATA_ACCESS varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema ROUTINES SQL_PATH varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema ROUTINES SECURITY_TYPE varchar 7 21 utf8 utf8_general_ci varchar(7)
|
||||
NULL information_schema ROUTINES CREATED datetime NULL NULL NULL NULL datetime
|
||||
NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datetime
|
||||
1.0000 information_schema ROUTINES SQL_MODE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
3.0000 information_schema ROUTINES ROUTINE_COMMENT varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema ROUTINES DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77)
|
||||
3.0000 information_schema ROUTINES CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
|
||||
3.0000 information_schema ROUTINES COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
|
||||
3.0000 information_schema ROUTINES DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
|
||||
3.0000 information_schema SCHEMATA CATALOG_NAME varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema SCHEMATA SCHEMA_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema SCHEMATA DEFAULT_COLLATION_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema SCHEMATA SQL_PATH varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema SCHEMA_PRIVILEGES GRANTEE varchar 81 243 utf8 utf8_general_ci varchar(81)
|
||||
3.0000 information_schema SCHEMA_PRIVILEGES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema SCHEMA_PRIVILEGES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
3.0000 information_schema SESSION_STATUS VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema SESSION_STATUS VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
|
||||
3.0000 information_schema SESSION_VARIABLES VARIABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema SESSION_VARIABLES VARIABLE_VALUE varchar 20480 61440 utf8 utf8_general_ci varchar(20480)
|
||||
3.0000 information_schema STATISTICS TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema STATISTICS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema STATISTICS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema STATISTICS NON_UNIQUE bigint NULL NULL NULL NULL bigint(1)
|
||||
3.0000 information_schema STATISTICS INDEX_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema STATISTICS INDEX_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema STATISTICS SEQ_IN_INDEX bigint NULL NULL NULL NULL bigint(2)
|
||||
3.0000 information_schema STATISTICS COLUMN_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema STATISTICS COLLATION varchar 1 3 utf8 utf8_general_ci varchar(1)
|
||||
NULL information_schema STATISTICS CARDINALITY bigint NULL NULL NULL NULL bigint(21)
|
||||
NULL information_schema STATISTICS SUB_PART bigint NULL NULL NULL NULL bigint(3)
|
||||
3.0000 information_schema STATISTICS PACKED varchar 10 30 utf8 utf8_general_ci varchar(10)
|
||||
3.0000 information_schema STATISTICS NULLABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
3.0000 information_schema STATISTICS INDEX_TYPE varchar 16 48 utf8 utf8_general_ci varchar(16)
|
||||
3.0000 information_schema STATISTICS COMMENT varchar 16 48 utf8 utf8_general_ci varchar(16)
|
||||
3.0000 information_schema TABLES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema TABLES TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TABLES TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TABLES TABLE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TABLES ENGINE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema TABLES VERSION bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
3.0000 information_schema TABLES ROW_FORMAT varchar 10 30 utf8 utf8_general_ci varchar(10)
|
||||
NULL information_schema TABLES TABLE_ROWS bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL information_schema TABLES AVG_ROW_LENGTH bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL information_schema TABLES DATA_LENGTH bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL information_schema TABLES MAX_DATA_LENGTH bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL information_schema TABLES INDEX_LENGTH bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL information_schema TABLES DATA_FREE bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL information_schema TABLES AUTO_INCREMENT bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
NULL information_schema TABLES CREATE_TIME datetime NULL NULL NULL NULL datetime
|
||||
NULL information_schema TABLES UPDATE_TIME datetime NULL NULL NULL NULL datetime
|
||||
NULL information_schema TABLES CHECK_TIME datetime NULL NULL NULL NULL datetime
|
||||
3.0000 information_schema TABLES TABLE_COLLATION varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema TABLES CHECKSUM bigint NULL NULL NULL NULL bigint(21) unsigned
|
||||
3.0000 information_schema TABLES CREATE_OPTIONS varchar 255 765 utf8 utf8_general_ci varchar(255)
|
||||
3.0000 information_schema TABLES TABLE_COMMENT varchar 80 240 utf8 utf8_general_ci varchar(80)
|
||||
3.0000 information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema TABLE_CONSTRAINTS CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TABLE_CONSTRAINTS CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TABLE_CONSTRAINTS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TABLE_CONSTRAINTS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TABLE_CONSTRAINTS CONSTRAINT_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TABLE_PRIVILEGES GRANTEE varchar 81 243 utf8 utf8_general_ci varchar(81)
|
||||
3.0000 information_schema TABLE_PRIVILEGES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema TABLE_PRIVILEGES TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TABLE_PRIVILEGES TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TABLE_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TABLE_PRIVILEGES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
3.0000 information_schema TRIGGERS TRIGGER_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema TRIGGERS TRIGGER_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TRIGGERS TRIGGER_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TRIGGERS EVENT_MANIPULATION varchar 6 18 utf8 utf8_general_ci varchar(6)
|
||||
3.0000 information_schema TRIGGERS EVENT_OBJECT_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema TRIGGERS EVENT_OBJECT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TRIGGERS EVENT_OBJECT_TABLE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
NULL information_schema TRIGGERS ACTION_ORDER bigint NULL NULL NULL NULL bigint(4)
|
||||
1.0000 information_schema TRIGGERS ACTION_CONDITION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
1.0000 information_schema TRIGGERS ACTION_STATEMENT longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
3.0000 information_schema TRIGGERS ACTION_ORIENTATION varchar 9 27 utf8 utf8_general_ci varchar(9)
|
||||
3.0000 information_schema TRIGGERS ACTION_TIMING varchar 6 18 utf8 utf8_general_ci varchar(6)
|
||||
3.0000 information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
3.0000 information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
NULL information_schema TRIGGERS CREATED datetime NULL NULL NULL NULL datetime
|
||||
1.0000 information_schema TRIGGERS SQL_MODE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
1.0000 information_schema TRIGGERS DEFINER longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
3.0000 information_schema TRIGGERS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
|
||||
3.0000 information_schema TRIGGERS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
|
||||
3.0000 information_schema TRIGGERS DATABASE_COLLATION varchar 32 96 utf8 utf8_general_ci varchar(32)
|
||||
3.0000 information_schema USER_PRIVILEGES GRANTEE varchar 81 243 utf8 utf8_general_ci varchar(81)
|
||||
3.0000 information_schema USER_PRIVILEGES TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema USER_PRIVILEGES PRIVILEGE_TYPE varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema USER_PRIVILEGES IS_GRANTABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
3.0000 information_schema VIEWS TABLE_CATALOG varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
3.0000 information_schema VIEWS TABLE_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
3.0000 information_schema VIEWS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
1.0000 information_schema VIEWS VIEW_DEFINITION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
3.0000 information_schema VIEWS CHECK_OPTION varchar 8 24 utf8 utf8_general_ci varchar(8)
|
||||
3.0000 information_schema VIEWS IS_UPDATABLE varchar 3 9 utf8 utf8_general_ci varchar(3)
|
||||
3.0000 information_schema VIEWS DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77)
|
||||
3.0000 information_schema VIEWS SECURITY_TYPE varchar 7 21 utf8 utf8_general_ci varchar(7)
|
||||
3.0000 information_schema VIEWS CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
|
||||
3.0000 information_schema VIEWS COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
|
|
@ -244,12 +244,12 @@ f223 year(3),
|
|||
f224 year(4),
|
||||
f225 enum("1enum","2enum"),
|
||||
f226 set("1set","2set"),
|
||||
f236 char(95) unicode,
|
||||
f241 char(255) unicode,
|
||||
f236 char(95),
|
||||
f241 char(255),
|
||||
f237 char(130) binary,
|
||||
f238 varchar(25000) binary,
|
||||
f239 varbinary(0),
|
||||
f240 varchar(1200) unicode
|
||||
f240 varchar(1200)
|
||||
) engine = memory;
|
||||
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb4.txt'
|
||||
into table tb4;
|
||||
|
@ -620,12 +620,12 @@ NULL test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL year(4) sele
|
|||
NULL test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references
|
||||
NULL test tb4 f225 50 NULL YES enum 5 5 NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references
|
||||
NULL test tb4 f226 51 NULL YES set 9 9 NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references
|
||||
NULL test tb4 f236 52 NULL YES char 95 190 NULL NULL ucs2 ucs2_general_ci char(95) select,insert,update,references
|
||||
NULL test tb4 f236 52 NULL YES char 95 95 NULL NULL latin1 latin1_swedish_ci char(95) select,insert,update,references
|
||||
NULL test tb4 f237 54 NULL YES char 130 130 NULL NULL latin1 latin1_bin char(130) select,insert,update,references
|
||||
NULL test tb4 f238 55 NULL YES varchar 25000 25000 NULL NULL latin1 latin1_bin varchar(25000) select,insert,update,references
|
||||
NULL test tb4 f239 56 NULL YES varbinary 0 0 NULL NULL NULL NULL varbinary(0) select,insert,update,references
|
||||
NULL test tb4 f240 57 NULL YES varchar 1200 2400 NULL NULL ucs2 ucs2_general_ci varchar(1200) select,insert,update,references
|
||||
NULL test tb4 f241 53 NULL YES char 255 510 NULL NULL ucs2 ucs2_general_ci char(255) select,insert,update,references
|
||||
NULL test tb4 f240 57 NULL YES varchar 1200 1200 NULL NULL latin1 latin1_swedish_ci varchar(1200) select,insert,update,references
|
||||
NULL test tb4 f241 53 NULL YES char 255 255 NULL NULL latin1 latin1_swedish_ci char(255) select,insert,update,references
|
||||
NULL test1 tb2 f100 42 00000000000000000008.8 NO double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
|
||||
NULL test1 tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date select,insert,update,references
|
||||
NULL test1 tb2 f102 44 00:00:20 NO time NULL NULL NULL NULL NULL NULL time select,insert,update,references
|
||||
|
@ -702,6 +702,7 @@ COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
|||
1.0000 char latin1 latin1_swedish_ci
|
||||
1.0000 enum latin1 latin1_swedish_ci
|
||||
1.0000 set latin1 latin1_swedish_ci
|
||||
1.0000 varchar latin1 latin1_swedish_ci
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
|
@ -712,8 +713,6 @@ WHERE table_schema LIKE 'test%'
|
|||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
2.0000 char ucs2 ucs2_general_ci
|
||||
2.0000 varchar ucs2 ucs2_general_ci
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
|
@ -1006,12 +1005,12 @@ NULL test tb4 f223 year NULL NULL NULL NULL year(4)
|
|||
NULL test tb4 f224 year NULL NULL NULL NULL year(4)
|
||||
1.0000 test tb4 f225 enum 5 5 latin1 latin1_swedish_ci enum('1enum','2enum')
|
||||
1.0000 test tb4 f226 set 9 9 latin1 latin1_swedish_ci set('1set','2set')
|
||||
2.0000 test tb4 f236 char 95 190 ucs2 ucs2_general_ci char(95)
|
||||
2.0000 test tb4 f241 char 255 510 ucs2 ucs2_general_ci char(255)
|
||||
1.0000 test tb4 f236 char 95 95 latin1 latin1_swedish_ci char(95)
|
||||
1.0000 test tb4 f241 char 255 255 latin1 latin1_swedish_ci char(255)
|
||||
1.0000 test tb4 f237 char 130 130 latin1 latin1_bin char(130)
|
||||
1.0000 test tb4 f238 varchar 25000 25000 latin1 latin1_bin varchar(25000)
|
||||
NULL test tb4 f239 varbinary 0 0 NULL NULL varbinary(0)
|
||||
2.0000 test tb4 f240 varchar 1200 2400 ucs2 ucs2_general_ci varchar(1200)
|
||||
1.0000 test tb4 f240 varchar 1200 1200 latin1 latin1_swedish_ci varchar(1200)
|
||||
NULL test1 tb2 f59 decimal NULL NULL NULL NULL decimal(10,0) unsigned
|
||||
NULL test1 tb2 f60 decimal NULL NULL NULL NULL decimal(64,0) unsigned
|
||||
NULL test1 tb2 f61 decimal NULL NULL NULL NULL decimal(10,0) unsigned zerofill
|
||||
|
|
|
@ -7,7 +7,7 @@ create table tb1 (
|
|||
f1 char,
|
||||
f2 char binary,
|
||||
f3 char ascii,
|
||||
f4 tinytext unicode,
|
||||
f4 tinytext,
|
||||
f5 text,
|
||||
f6 mediumtext,
|
||||
f7 longtext,
|
||||
|
@ -154,7 +154,7 @@ f120 char ascii not null DEFAULT b'101',
|
|||
f121 tinytext,
|
||||
f122 text,
|
||||
f123 mediumtext,
|
||||
f124 longtext unicode,
|
||||
f124 longtext,
|
||||
f125 tinyblob,
|
||||
f126 blob,
|
||||
f127 mediumblob,
|
||||
|
@ -274,13 +274,13 @@ f231 VARBINARY(192),
|
|||
f232 VARBINARY(27),
|
||||
f233 VARBINARY(64),
|
||||
f234 VARBINARY(192),
|
||||
f235 char(255) unicode,
|
||||
f235 char(255),
|
||||
f236 char(60) ascii,
|
||||
f237 char(255) binary,
|
||||
f238 varchar(0) binary,
|
||||
f239 varbinary(1000),
|
||||
f240 varchar(120) unicode,
|
||||
f241 char(100) unicode,
|
||||
f240 varchar(120),
|
||||
f241 char(100),
|
||||
f242 bit(30)
|
||||
) engine = myisam;
|
||||
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb4.txt'
|
||||
|
@ -489,7 +489,7 @@ NULL test tb1 f36 36 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0
|
|||
NULL test tb1 f37 37 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) select,insert,update,references
|
||||
NULL test tb1 f38 38 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) select,insert,update,references
|
||||
NULL test tb1 f39 39 10 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned select,insert,update,references
|
||||
NULL test tb1 f4 4 NULL YES tinytext 127 255 NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references
|
||||
NULL test tb1 f4 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references
|
||||
NULL test tb1 f40 40 10 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned select,insert,update,references
|
||||
NULL test tb1 f41 41 0000000010 NO decimal NULL NULL 10 0 NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references
|
||||
NULL test tb1 f42 42 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references
|
||||
|
@ -579,7 +579,7 @@ NULL test tb3 f120 3 NO char 1 1 NULL NULL latin1 latin1_swedish_ci char(1)
|
|||
NULL test tb3 f121 4 NULL YES tinytext 255 255 NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references
|
||||
NULL test tb3 f122 5 NULL YES text 65535 65535 NULL NULL latin1 latin1_swedish_ci text select,insert,update,references
|
||||
NULL test tb3 f123 6 NULL YES mediumtext 16777215 16777215 NULL NULL latin1 latin1_swedish_ci mediumtext select,insert,update,references
|
||||
NULL test tb3 f124 7 NULL YES longtext 2147483647 4294967295 NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references
|
||||
NULL test tb3 f124 7 NULL YES longtext 4294967295 4294967295 NULL NULL latin1 latin1_swedish_ci longtext select,insert,update,references
|
||||
NULL test tb3 f125 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL tinyblob select,insert,update,references
|
||||
NULL test tb3 f126 9 NULL YES blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
|
||||
NULL test tb3 f127 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL mediumblob select,insert,update,references
|
||||
|
@ -690,13 +690,13 @@ NULL test tb4 f231 56 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(1
|
|||
NULL test tb4 f232 57 NULL YES varbinary 27 27 NULL NULL NULL NULL varbinary(27) select,insert,update,references
|
||||
NULL test tb4 f233 58 NULL YES varbinary 64 64 NULL NULL NULL NULL varbinary(64) select,insert,update,references
|
||||
NULL test tb4 f234 59 NULL YES varbinary 192 192 NULL NULL NULL NULL varbinary(192) select,insert,update,references
|
||||
NULL test tb4 f235 60 NULL YES char 255 510 NULL NULL ucs2 ucs2_general_ci char(255) select,insert,update,references
|
||||
NULL test tb4 f235 60 NULL YES char 255 255 NULL NULL latin1 latin1_swedish_ci char(255) select,insert,update,references
|
||||
NULL test tb4 f236 61 NULL YES char 60 60 NULL NULL latin1 latin1_swedish_ci char(60) select,insert,update,references
|
||||
NULL test tb4 f237 62 NULL YES char 255 255 NULL NULL latin1 latin1_bin char(255) select,insert,update,references
|
||||
NULL test tb4 f238 63 NULL YES varchar 0 0 NULL NULL latin1 latin1_bin varchar(0) select,insert,update,references
|
||||
NULL test tb4 f239 64 NULL YES varbinary 1000 1000 NULL NULL NULL NULL varbinary(1000) select,insert,update,references
|
||||
NULL test tb4 f240 65 NULL YES varchar 120 240 NULL NULL ucs2 ucs2_general_ci varchar(120) select,insert,update,references
|
||||
NULL test tb4 f241 66 NULL YES char 100 200 NULL NULL ucs2 ucs2_general_ci char(100) select,insert,update,references
|
||||
NULL test tb4 f240 65 NULL YES varchar 120 120 NULL NULL latin1 latin1_swedish_ci varchar(120) select,insert,update,references
|
||||
NULL test tb4 f241 66 NULL YES char 100 100 NULL NULL latin1 latin1_swedish_ci char(100) select,insert,update,references
|
||||
NULL test tb4 f242 67 NULL YES bit NULL NULL 30 NULL NULL NULL bit(30) select,insert,update,references
|
||||
NULL test1 tb2 f100 42 00000000000000000008.8 NO double unsigned zerofill NULL NULL 22 NULL NULL NULL double unsigned zerofill select,insert,update,references
|
||||
NULL test1 tb2 f101 43 2000-01-01 NO date NULL NULL NULL NULL NULL NULL date select,insert,update,references
|
||||
|
@ -790,6 +790,7 @@ COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
|||
1.0000 set latin1 latin1_swedish_ci
|
||||
1.0000 text latin1 latin1_swedish_ci
|
||||
1.0000 tinytext latin1 latin1_swedish_ci
|
||||
1.0000 varchar latin1 latin1_swedish_ci
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
|
@ -800,10 +801,6 @@ WHERE table_schema LIKE 'test%'
|
|||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
2.0000 char ucs2 ucs2_general_ci
|
||||
2.0000 longtext ucs2 ucs2_general_ci
|
||||
2.0000 varchar ucs2 ucs2_general_ci
|
||||
2.0079 tinytext ucs2 ucs2_general_ci
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
|
@ -896,7 +893,7 @@ NULL test t9 f3 int NULL NULL NULL NULL int(11)
|
|||
1.0000 test tb1 f1 char 1 1 latin1 latin1_swedish_ci char(1)
|
||||
1.0000 test tb1 f2 char 1 1 latin1 latin1_bin char(1)
|
||||
1.0000 test tb1 f3 char 1 1 latin1 latin1_swedish_ci char(1)
|
||||
2.0079 test tb1 f4 tinytext 127 255 ucs2 ucs2_general_ci tinytext
|
||||
1.0000 test tb1 f4 tinytext 255 255 latin1 latin1_swedish_ci tinytext
|
||||
1.0000 test tb1 f5 text 65535 65535 latin1 latin1_swedish_ci text
|
||||
1.0000 test tb1 f6 mediumtext 16777215 16777215 latin1 latin1_swedish_ci mediumtext
|
||||
1.0000 test tb1 f7 longtext 4294967295 4294967295 latin1 latin1_swedish_ci longtext
|
||||
|
@ -1016,7 +1013,7 @@ NULL test tb2 f107 year NULL NULL NULL NULL year(4)
|
|||
1.0000 test tb3 f121 tinytext 255 255 latin1 latin1_swedish_ci tinytext
|
||||
1.0000 test tb3 f122 text 65535 65535 latin1 latin1_swedish_ci text
|
||||
1.0000 test tb3 f123 mediumtext 16777215 16777215 latin1 latin1_swedish_ci mediumtext
|
||||
2.0000 test tb3 f124 longtext 2147483647 4294967295 ucs2 ucs2_general_ci longtext
|
||||
1.0000 test tb3 f124 longtext 4294967295 4294967295 latin1 latin1_swedish_ci longtext
|
||||
1.0000 test tb3 f125 tinyblob 255 255 NULL NULL tinyblob
|
||||
1.0000 test tb3 f126 blob 65535 65535 NULL NULL blob
|
||||
1.0000 test tb3 f127 mediumblob 16777215 16777215 NULL NULL mediumblob
|
||||
|
@ -1127,13 +1124,13 @@ NULL test tb4 f224 year NULL NULL NULL NULL year(4)
|
|||
1.0000 test tb4 f232 varbinary 27 27 NULL NULL varbinary(27)
|
||||
1.0000 test tb4 f233 varbinary 64 64 NULL NULL varbinary(64)
|
||||
1.0000 test tb4 f234 varbinary 192 192 NULL NULL varbinary(192)
|
||||
2.0000 test tb4 f235 char 255 510 ucs2 ucs2_general_ci char(255)
|
||||
1.0000 test tb4 f235 char 255 255 latin1 latin1_swedish_ci char(255)
|
||||
1.0000 test tb4 f236 char 60 60 latin1 latin1_swedish_ci char(60)
|
||||
1.0000 test tb4 f237 char 255 255 latin1 latin1_bin char(255)
|
||||
NULL test tb4 f238 varchar 0 0 latin1 latin1_bin varchar(0)
|
||||
1.0000 test tb4 f239 varbinary 1000 1000 NULL NULL varbinary(1000)
|
||||
2.0000 test tb4 f240 varchar 120 240 ucs2 ucs2_general_ci varchar(120)
|
||||
2.0000 test tb4 f241 char 100 200 ucs2 ucs2_general_ci char(100)
|
||||
1.0000 test tb4 f240 varchar 120 120 latin1 latin1_swedish_ci varchar(120)
|
||||
1.0000 test tb4 f241 char 100 100 latin1 latin1_swedish_ci char(100)
|
||||
NULL test tb4 f242 bit NULL NULL NULL NULL bit(30)
|
||||
NULL test1 tb2 f59 decimal NULL NULL NULL NULL decimal(10,0) unsigned
|
||||
NULL test1 tb2 f60 decimal NULL NULL NULL NULL decimal(64,0) unsigned
|
||||
|
|
1214
mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result
Normal file
1214
mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result
Normal file
File diff suppressed because it is too large
Load diff
499
mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result
Normal file
499
mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result
Normal file
|
@ -0,0 +1,499 @@
|
|||
SELECT * FROM information_schema.columns
|
||||
WHERE table_schema = 'mysql'
|
||||
ORDER BY table_schema, table_name, column_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
|
||||
NULL mysql columns_priv Column_name 5 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
|
||||
NULL mysql columns_priv Column_priv 7 NO set 31 93 NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','References')
|
||||
NULL mysql columns_priv Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
|
||||
NULL mysql columns_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
|
||||
NULL mysql columns_priv Table_name 4 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
|
||||
NULL mysql columns_priv Timestamp 6 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP
|
||||
NULL mysql columns_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI
|
||||
NULL mysql db Alter_priv 13 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql db Alter_routine_priv 19 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql db Create_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql db Create_routine_priv 18 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql db Create_tmp_table_priv 14 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql db Create_view_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql db Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
|
||||
NULL mysql db Delete_priv 7 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql db Drop_priv 9 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql db Event_priv 21 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql db Execute_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql db Grant_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql db Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
|
||||
NULL mysql db Index_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql db Insert_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql db Lock_tables_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql db References_priv 11 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql db Select_priv 4 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql db Show_view_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql db Trigger_priv 22 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql db Update_priv 6 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql db User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI
|
||||
NULL mysql event body 3 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob
|
||||
NULL mysql event body_utf8 22 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL longblob
|
||||
NULL mysql event character_set_client 19 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32)
|
||||
NULL mysql event collation_connection 20 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32)
|
||||
NULL mysql event comment 16 NO char 64 192 NULL NULL utf8 utf8_bin char(64)
|
||||
NULL mysql event created 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP
|
||||
NULL mysql event db 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
|
||||
NULL mysql event db_collation 21 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32)
|
||||
NULL mysql event definer 4 NO char 77 231 NULL NULL utf8 utf8_bin char(77)
|
||||
NULL mysql event ends 12 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
|
||||
NULL mysql event execute_at 5 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
|
||||
NULL mysql event interval_field 7 NULL YES enum 18 54 NULL NULL utf8 utf8_general_ci enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND')
|
||||
NULL mysql event interval_value 6 NULL YES int NULL NULL 10 0 NULL NULL int(11)
|
||||
NULL mysql event last_executed 10 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
|
||||
NULL mysql event modified 9 0000-00-00 00:00:00 NO timestamp NULL NULL NULL NULL NULL NULL timestamp
|
||||
NULL mysql event name 2 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI
|
||||
NULL mysql event on_completion 14 DROP NO enum 8 24 NULL NULL utf8 utf8_general_ci enum('DROP','PRESERVE')
|
||||
NULL mysql event originator 17 NULL NO int NULL NULL 10 0 NULL NULL int(10)
|
||||
NULL mysql event sql_mode 15 NO set 478 1434 NULL NULL utf8 utf8_general_ci set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH')
|
||||
NULL mysql event starts 11 NULL YES datetime NULL NULL NULL NULL NULL NULL datetime
|
||||
NULL mysql event status 13 ENABLED NO enum 18 54 NULL NULL utf8 utf8_general_ci enum('ENABLED','DISABLED','SLAVESIDE_DISABLED')
|
||||
NULL mysql event time_zone 18 SYSTEM NO char 64 64 NULL NULL latin1 latin1_swedish_ci char(64)
|
||||
NULL mysql func dl 3 NO char 128 384 NULL NULL utf8 utf8_bin char(128)
|
||||
NULL mysql func name 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
|
||||
NULL mysql func ret 2 0 NO tinyint NULL NULL 3 0 NULL NULL tinyint(1)
|
||||
NULL mysql func type 4 NULL NO enum 9 27 NULL NULL utf8 utf8_general_ci enum('function','aggregate')
|
||||
NULL mysql general_log argument 6 NULL NO mediumtext 16777215 16777215 NULL NULL utf8 utf8_general_ci mediumtext
|
||||
NULL mysql general_log command_type 5 NULL NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64)
|
||||
NULL mysql general_log event_time 1 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP
|
||||
NULL mysql general_log server_id 4 NULL NO int NULL NULL 10 0 NULL NULL int(11)
|
||||
NULL mysql general_log thread_id 3 NULL NO int NULL NULL 10 0 NULL NULL int(11)
|
||||
NULL mysql general_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL utf8 utf8_general_ci mediumtext
|
||||
NULL mysql help_category help_category_id 1 NULL NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned PRI
|
||||
NULL mysql help_category name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI
|
||||
NULL mysql help_category parent_category_id 3 NULL YES smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned
|
||||
NULL mysql help_category url 4 NULL NO char 128 384 NULL NULL utf8 utf8_general_ci char(128)
|
||||
NULL mysql help_keyword help_keyword_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI
|
||||
NULL mysql help_keyword name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI
|
||||
NULL mysql help_relation help_keyword_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI
|
||||
NULL mysql help_relation help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI
|
||||
NULL mysql help_topic description 4 NULL NO text 65535 65535 NULL NULL utf8 utf8_general_ci text
|
||||
NULL mysql help_topic example 5 NULL NO text 65535 65535 NULL NULL utf8 utf8_general_ci text
|
||||
NULL mysql help_topic help_category_id 3 NULL NO smallint NULL NULL 5 0 NULL NULL smallint(5) unsigned
|
||||
NULL mysql help_topic help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI
|
||||
NULL mysql help_topic name 2 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) UNI
|
||||
NULL mysql help_topic url 6 NULL NO char 128 384 NULL NULL utf8 utf8_general_ci char(128)
|
||||
NULL mysql host Alter_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql host Alter_routine_priv 18 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql host Create_priv 7 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql host Create_routine_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql host Create_tmp_table_priv 13 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql host Create_view_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql host Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
|
||||
NULL mysql host Delete_priv 6 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql host Drop_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql host Execute_priv 19 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql host Grant_priv 9 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql host Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
|
||||
NULL mysql host Index_priv 11 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql host Insert_priv 4 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql host Lock_tables_priv 14 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql host References_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql host Select_priv 3 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql host Show_view_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql host Trigger_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql host Update_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql ndb_binlog_index deletes 6 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned
|
||||
NULL mysql ndb_binlog_index epoch 3 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned PRI
|
||||
NULL mysql ndb_binlog_index File 2 NULL NO varchar 255 255 NULL NULL latin1 latin1_swedish_ci varchar(255)
|
||||
NULL mysql ndb_binlog_index inserts 4 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned
|
||||
NULL mysql ndb_binlog_index Position 1 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned
|
||||
NULL mysql ndb_binlog_index schemaops 7 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned
|
||||
NULL mysql ndb_binlog_index updates 5 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) unsigned
|
||||
NULL mysql plugin dl 2 NO char 128 384 NULL NULL utf8 utf8_bin char(128)
|
||||
NULL mysql plugin name 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
|
||||
NULL mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob
|
||||
NULL mysql proc body_utf8 20 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL longblob
|
||||
NULL mysql proc character_set_client 17 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32)
|
||||
NULL mysql proc collation_connection 18 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32)
|
||||
NULL mysql proc comment 16 NO char 64 192 NULL NULL utf8 utf8_bin char(64)
|
||||
NULL mysql proc created 13 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP
|
||||
NULL mysql proc db 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
|
||||
NULL mysql proc db_collation 19 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32)
|
||||
NULL mysql proc definer 12 NO char 77 231 NULL NULL utf8 utf8_bin char(77)
|
||||
NULL mysql proc is_deterministic 7 NO NO enum 3 9 NULL NULL utf8 utf8_general_ci enum('YES','NO')
|
||||
NULL mysql proc language 5 SQL NO enum 3 9 NULL NULL utf8 utf8_general_ci enum('SQL')
|
||||
NULL mysql proc modified 14 0000-00-00 00:00:00 NO timestamp NULL NULL NULL NULL NULL NULL timestamp
|
||||
NULL mysql proc name 2 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI
|
||||
NULL mysql proc param_list 9 NULL NO blob 65535 65535 NULL NULL NULL NULL blob
|
||||
NULL mysql proc returns 10 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL longblob
|
||||
NULL mysql proc security_type 8 DEFINER NO enum 7 21 NULL NULL utf8 utf8_general_ci enum('INVOKER','DEFINER')
|
||||
NULL mysql proc specific_name 4 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
|
||||
NULL mysql proc sql_data_access 6 CONTAINS_SQL NO enum 17 51 NULL NULL utf8 utf8_general_ci enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA')
|
||||
NULL mysql proc sql_mode 15 NO set 478 1434 NULL NULL utf8 utf8_general_ci set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH')
|
||||
NULL mysql proc type 3 NULL NO enum 9 27 NULL NULL utf8 utf8_general_ci enum('FUNCTION','PROCEDURE') PRI
|
||||
NULL mysql procs_priv Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
|
||||
NULL mysql procs_priv Grantor 6 NO char 77 231 NULL NULL utf8 utf8_bin char(77) MUL
|
||||
NULL mysql procs_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
|
||||
NULL mysql procs_priv Proc_priv 7 NO set 27 81 NULL NULL utf8 utf8_general_ci set('Execute','Alter Routine','Grant')
|
||||
NULL mysql procs_priv Routine_name 4 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
|
||||
NULL mysql procs_priv Routine_type 5 NULL NO enum 9 27 NULL NULL utf8 utf8_bin enum('FUNCTION','PROCEDURE') PRI
|
||||
NULL mysql procs_priv Timestamp 8 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP
|
||||
NULL mysql procs_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI
|
||||
NULL mysql servers Db 3 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
|
||||
NULL mysql servers Host 2 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
|
||||
NULL mysql servers Owner 9 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
|
||||
NULL mysql servers Password 5 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
|
||||
NULL mysql servers Port 6 0 NO int NULL NULL 10 0 NULL NULL int(4)
|
||||
NULL mysql servers Server_name 1 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI
|
||||
NULL mysql servers Socket 7 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
|
||||
NULL mysql servers Username 4 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
|
||||
NULL mysql servers Wrapper 8 NO char 64 192 NULL NULL utf8 utf8_general_ci char(64)
|
||||
NULL mysql slow_log db 7 NULL NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512)
|
||||
NULL mysql slow_log insert_id 9 NULL NO int NULL NULL 10 0 NULL NULL int(11)
|
||||
NULL mysql slow_log last_insert_id 8 NULL NO int NULL NULL 10 0 NULL NULL int(11)
|
||||
NULL mysql slow_log lock_time 4 NULL NO time NULL NULL NULL NULL NULL NULL time
|
||||
NULL mysql slow_log query_time 3 NULL NO time NULL NULL NULL NULL NULL NULL time
|
||||
NULL mysql slow_log rows_examined 6 NULL NO int NULL NULL 10 0 NULL NULL int(11)
|
||||
NULL mysql slow_log rows_sent 5 NULL NO int NULL NULL 10 0 NULL NULL int(11)
|
||||
NULL mysql slow_log server_id 10 NULL NO int NULL NULL 10 0 NULL NULL int(11)
|
||||
NULL mysql slow_log sql_text 11 NULL NO mediumtext 16777215 16777215 NULL NULL utf8 utf8_general_ci mediumtext
|
||||
NULL mysql slow_log start_time 1 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP
|
||||
NULL mysql slow_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL utf8 utf8_general_ci mediumtext
|
||||
NULL mysql tables_priv Column_priv 8 NO set 31 93 NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','References')
|
||||
NULL mysql tables_priv Db 2 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
|
||||
NULL mysql tables_priv Grantor 5 NO char 77 231 NULL NULL utf8 utf8_bin char(77) MUL
|
||||
NULL mysql tables_priv Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
|
||||
NULL mysql tables_priv Table_name 4 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI
|
||||
NULL mysql tables_priv Table_priv 7 NO set 98 294 NULL NULL utf8 utf8_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger')
|
||||
NULL mysql tables_priv Timestamp 6 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP
|
||||
NULL mysql tables_priv User 3 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI
|
||||
NULL mysql time_zone Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI auto_increment
|
||||
NULL mysql time_zone Use_leap_seconds 2 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('Y','N')
|
||||
NULL mysql time_zone_leap_second Correction 2 NULL NO int NULL NULL 10 0 NULL NULL int(11)
|
||||
NULL mysql time_zone_leap_second Transition_time 1 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) PRI
|
||||
NULL mysql time_zone_name Name 1 NULL NO char 64 192 NULL NULL utf8 utf8_general_ci char(64) PRI
|
||||
NULL mysql time_zone_name Time_zone_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned
|
||||
NULL mysql time_zone_transition Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI
|
||||
NULL mysql time_zone_transition Transition_time 2 NULL NO bigint NULL NULL 19 0 NULL NULL bigint(20) PRI
|
||||
NULL mysql time_zone_transition Transition_type_id 3 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned
|
||||
NULL mysql time_zone_transition_type Abbreviation 5 NO char 8 24 NULL NULL utf8 utf8_general_ci char(8)
|
||||
NULL mysql time_zone_transition_type Is_DST 4 0 NO tinyint NULL NULL 3 0 NULL NULL tinyint(3) unsigned
|
||||
NULL mysql time_zone_transition_type Offset 3 0 NO int NULL NULL 10 0 NULL NULL int(11)
|
||||
NULL mysql time_zone_transition_type Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI
|
||||
NULL mysql time_zone_transition_type Transition_type_id 2 NULL NO int NULL NULL 10 0 NULL NULL int(10) unsigned PRI
|
||||
NULL mysql user Alter_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user Alter_routine_priv 28 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user Create_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user Create_routine_priv 27 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user Create_tmp_table_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user Create_user_priv 29 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user Create_view_priv 25 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user Delete_priv 7 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user Drop_priv 9 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user Event_priv 30 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user Execute_priv 22 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user File_priv 13 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user Grant_priv 14 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
|
||||
NULL mysql user Index_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user Insert_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user Lock_tables_priv 21 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user max_connections 38 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned
|
||||
NULL mysql user max_questions 36 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned
|
||||
NULL mysql user max_updates 37 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned
|
||||
NULL mysql user max_user_connections 39 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned
|
||||
NULL mysql user Password 3 NO char 41 41 NULL NULL latin1 latin1_bin char(41)
|
||||
NULL mysql user Process_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user References_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user Reload_priv 10 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user Repl_client_priv 24 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user Repl_slave_priv 23 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user Select_priv 4 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user Show_db_priv 18 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user Show_view_priv 26 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user Shutdown_priv 11 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user ssl_cipher 33 NULL NO blob 65535 65535 NULL NULL NULL NULL blob
|
||||
NULL mysql user ssl_type 32 NO enum 9 27 NULL NULL utf8 utf8_general_ci enum('','ANY','X509','SPECIFIED')
|
||||
NULL mysql user Super_priv 19 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user Trigger_priv 31 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user Update_priv 6 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql user User 2 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI
|
||||
NULL mysql user x509_issuer 34 NULL NO blob 65535 65535 NULL NULL NULL NULL blob
|
||||
NULL mysql user x509_subject 35 NULL NO blob 65535 65535 NULL NULL NULL NULL blob
|
||||
##########################################################################
|
||||
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
|
||||
##########################################################################
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'mysql'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH = 1
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
1.0000 blob NULL NULL
|
||||
1.0000 longblob NULL NULL
|
||||
1.0000 char latin1 latin1_bin
|
||||
1.0000 char latin1 latin1_swedish_ci
|
||||
1.0000 varchar latin1 latin1_swedish_ci
|
||||
1.0000 mediumtext utf8 utf8_general_ci
|
||||
1.0000 text utf8 utf8_general_ci
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'mysql'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH <> 1
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
3.0000 char utf8 utf8_bin
|
||||
3.0000 enum utf8 utf8_bin
|
||||
3.0000 char utf8 utf8_general_ci
|
||||
3.0000 enum utf8 utf8_general_ci
|
||||
3.0000 set utf8 utf8_general_ci
|
||||
3.0000 varchar utf8 utf8_general_ci
|
||||
SELECT DISTINCT
|
||||
CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
DATA_TYPE,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'mysql'
|
||||
AND CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH IS NULL
|
||||
ORDER BY CHARACTER_SET_NAME, COLLATION_NAME, COL_CML;
|
||||
COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
NULL bigint NULL NULL
|
||||
NULL datetime NULL NULL
|
||||
NULL int NULL NULL
|
||||
NULL smallint NULL NULL
|
||||
NULL time NULL NULL
|
||||
NULL timestamp NULL NULL
|
||||
NULL tinyint NULL NULL
|
||||
--> CHAR(0) is allowed (see manual), and here both CHARACHTER_* values
|
||||
--> are 0, which is intended behavior, and the result of 0 / 0 IS NULL
|
||||
SELECT CHARACTER_OCTET_LENGTH / CHARACTER_MAXIMUM_LENGTH AS COL_CML,
|
||||
TABLE_SCHEMA,
|
||||
TABLE_NAME,
|
||||
COLUMN_NAME,
|
||||
DATA_TYPE,
|
||||
CHARACTER_MAXIMUM_LENGTH,
|
||||
CHARACTER_OCTET_LENGTH,
|
||||
CHARACTER_SET_NAME,
|
||||
COLLATION_NAME,
|
||||
COLUMN_TYPE
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'mysql'
|
||||
ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION;
|
||||
COL_CML TABLE_SCHEMA TABLE_NAME COLUMN_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE
|
||||
3.0000 mysql columns_priv Host char 60 180 utf8 utf8_bin char(60)
|
||||
3.0000 mysql columns_priv Db char 64 192 utf8 utf8_bin char(64)
|
||||
3.0000 mysql columns_priv User char 16 48 utf8 utf8_bin char(16)
|
||||
3.0000 mysql columns_priv Table_name char 64 192 utf8 utf8_bin char(64)
|
||||
3.0000 mysql columns_priv Column_name char 64 192 utf8 utf8_bin char(64)
|
||||
NULL mysql columns_priv Timestamp timestamp NULL NULL NULL NULL timestamp
|
||||
3.0000 mysql columns_priv Column_priv set 31 93 utf8 utf8_general_ci set('Select','Insert','Update','References')
|
||||
3.0000 mysql db Host char 60 180 utf8 utf8_bin char(60)
|
||||
3.0000 mysql db Db char 64 192 utf8 utf8_bin char(64)
|
||||
3.0000 mysql db User char 16 48 utf8 utf8_bin char(16)
|
||||
3.0000 mysql db Select_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Insert_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Update_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Delete_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Create_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Drop_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Grant_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db References_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Index_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Alter_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Create_tmp_table_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Lock_tables_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Create_view_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Show_view_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Create_routine_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Alter_routine_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Execute_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Event_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql db Trigger_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql event db char 64 192 utf8 utf8_bin char(64)
|
||||
3.0000 mysql event name char 64 192 utf8 utf8_general_ci char(64)
|
||||
1.0000 mysql event body longblob 4294967295 4294967295 NULL NULL longblob
|
||||
3.0000 mysql event definer char 77 231 utf8 utf8_bin char(77)
|
||||
NULL mysql event execute_at datetime NULL NULL NULL NULL datetime
|
||||
NULL mysql event interval_value int NULL NULL NULL NULL int(11)
|
||||
3.0000 mysql event interval_field enum 18 54 utf8 utf8_general_ci enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND')
|
||||
NULL mysql event created timestamp NULL NULL NULL NULL timestamp
|
||||
NULL mysql event modified timestamp NULL NULL NULL NULL timestamp
|
||||
NULL mysql event last_executed datetime NULL NULL NULL NULL datetime
|
||||
NULL mysql event starts datetime NULL NULL NULL NULL datetime
|
||||
NULL mysql event ends datetime NULL NULL NULL NULL datetime
|
||||
3.0000 mysql event status enum 18 54 utf8 utf8_general_ci enum('ENABLED','DISABLED','SLAVESIDE_DISABLED')
|
||||
3.0000 mysql event on_completion enum 8 24 utf8 utf8_general_ci enum('DROP','PRESERVE')
|
||||
3.0000 mysql event sql_mode set 478 1434 utf8 utf8_general_ci set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH')
|
||||
3.0000 mysql event comment char 64 192 utf8 utf8_bin char(64)
|
||||
NULL mysql event originator int NULL NULL NULL NULL int(10)
|
||||
1.0000 mysql event time_zone char 64 64 latin1 latin1_swedish_ci char(64)
|
||||
3.0000 mysql event character_set_client char 32 96 utf8 utf8_bin char(32)
|
||||
3.0000 mysql event collation_connection char 32 96 utf8 utf8_bin char(32)
|
||||
3.0000 mysql event db_collation char 32 96 utf8 utf8_bin char(32)
|
||||
1.0000 mysql event body_utf8 longblob 4294967295 4294967295 NULL NULL longblob
|
||||
3.0000 mysql func name char 64 192 utf8 utf8_bin char(64)
|
||||
NULL mysql func ret tinyint NULL NULL NULL NULL tinyint(1)
|
||||
3.0000 mysql func dl char 128 384 utf8 utf8_bin char(128)
|
||||
3.0000 mysql func type enum 9 27 utf8 utf8_general_ci enum('function','aggregate')
|
||||
NULL mysql general_log event_time timestamp NULL NULL NULL NULL timestamp
|
||||
1.0000 mysql general_log user_host mediumtext 16777215 16777215 utf8 utf8_general_ci mediumtext
|
||||
NULL mysql general_log thread_id int NULL NULL NULL NULL int(11)
|
||||
NULL mysql general_log server_id int NULL NULL NULL NULL int(11)
|
||||
3.0000 mysql general_log command_type varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
1.0000 mysql general_log argument mediumtext 16777215 16777215 utf8 utf8_general_ci mediumtext
|
||||
NULL mysql help_category help_category_id smallint NULL NULL NULL NULL smallint(5) unsigned
|
||||
3.0000 mysql help_category name char 64 192 utf8 utf8_general_ci char(64)
|
||||
NULL mysql help_category parent_category_id smallint NULL NULL NULL NULL smallint(5) unsigned
|
||||
3.0000 mysql help_category url char 128 384 utf8 utf8_general_ci char(128)
|
||||
NULL mysql help_keyword help_keyword_id int NULL NULL NULL NULL int(10) unsigned
|
||||
3.0000 mysql help_keyword name char 64 192 utf8 utf8_general_ci char(64)
|
||||
NULL mysql help_relation help_topic_id int NULL NULL NULL NULL int(10) unsigned
|
||||
NULL mysql help_relation help_keyword_id int NULL NULL NULL NULL int(10) unsigned
|
||||
NULL mysql help_topic help_topic_id int NULL NULL NULL NULL int(10) unsigned
|
||||
3.0000 mysql help_topic name char 64 192 utf8 utf8_general_ci char(64)
|
||||
NULL mysql help_topic help_category_id smallint NULL NULL NULL NULL smallint(5) unsigned
|
||||
1.0000 mysql help_topic description text 65535 65535 utf8 utf8_general_ci text
|
||||
1.0000 mysql help_topic example text 65535 65535 utf8 utf8_general_ci text
|
||||
3.0000 mysql help_topic url char 128 384 utf8 utf8_general_ci char(128)
|
||||
3.0000 mysql host Host char 60 180 utf8 utf8_bin char(60)
|
||||
3.0000 mysql host Db char 64 192 utf8 utf8_bin char(64)
|
||||
3.0000 mysql host Select_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Insert_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Update_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Delete_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Create_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Drop_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Grant_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host References_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Index_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Alter_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Create_tmp_table_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Lock_tables_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Create_view_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Show_view_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Create_routine_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Alter_routine_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Execute_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql host Trigger_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
NULL mysql ndb_binlog_index Position bigint NULL NULL NULL NULL bigint(20) unsigned
|
||||
1.0000 mysql ndb_binlog_index File varchar 255 255 latin1 latin1_swedish_ci varchar(255)
|
||||
NULL mysql ndb_binlog_index epoch bigint NULL NULL NULL NULL bigint(20) unsigned
|
||||
NULL mysql ndb_binlog_index inserts bigint NULL NULL NULL NULL bigint(20) unsigned
|
||||
NULL mysql ndb_binlog_index updates bigint NULL NULL NULL NULL bigint(20) unsigned
|
||||
NULL mysql ndb_binlog_index deletes bigint NULL NULL NULL NULL bigint(20) unsigned
|
||||
NULL mysql ndb_binlog_index schemaops bigint NULL NULL NULL NULL bigint(20) unsigned
|
||||
3.0000 mysql plugin name char 64 192 utf8 utf8_bin char(64)
|
||||
3.0000 mysql plugin dl char 128 384 utf8 utf8_bin char(128)
|
||||
3.0000 mysql proc db char 64 192 utf8 utf8_bin char(64)
|
||||
3.0000 mysql proc name char 64 192 utf8 utf8_general_ci char(64)
|
||||
3.0000 mysql proc type enum 9 27 utf8 utf8_general_ci enum('FUNCTION','PROCEDURE')
|
||||
3.0000 mysql proc specific_name char 64 192 utf8 utf8_general_ci char(64)
|
||||
3.0000 mysql proc language enum 3 9 utf8 utf8_general_ci enum('SQL')
|
||||
3.0000 mysql proc sql_data_access enum 17 51 utf8 utf8_general_ci enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA')
|
||||
3.0000 mysql proc is_deterministic enum 3 9 utf8 utf8_general_ci enum('YES','NO')
|
||||
3.0000 mysql proc security_type enum 7 21 utf8 utf8_general_ci enum('INVOKER','DEFINER')
|
||||
1.0000 mysql proc param_list blob 65535 65535 NULL NULL blob
|
||||
1.0000 mysql proc returns longblob 4294967295 4294967295 NULL NULL longblob
|
||||
1.0000 mysql proc body longblob 4294967295 4294967295 NULL NULL longblob
|
||||
3.0000 mysql proc definer char 77 231 utf8 utf8_bin char(77)
|
||||
NULL mysql proc created timestamp NULL NULL NULL NULL timestamp
|
||||
NULL mysql proc modified timestamp NULL NULL NULL NULL timestamp
|
||||
3.0000 mysql proc sql_mode set 478 1434 utf8 utf8_general_ci set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH')
|
||||
3.0000 mysql proc comment char 64 192 utf8 utf8_bin char(64)
|
||||
3.0000 mysql proc character_set_client char 32 96 utf8 utf8_bin char(32)
|
||||
3.0000 mysql proc collation_connection char 32 96 utf8 utf8_bin char(32)
|
||||
3.0000 mysql proc db_collation char 32 96 utf8 utf8_bin char(32)
|
||||
1.0000 mysql proc body_utf8 longblob 4294967295 4294967295 NULL NULL longblob
|
||||
3.0000 mysql procs_priv Host char 60 180 utf8 utf8_bin char(60)
|
||||
3.0000 mysql procs_priv Db char 64 192 utf8 utf8_bin char(64)
|
||||
3.0000 mysql procs_priv User char 16 48 utf8 utf8_bin char(16)
|
||||
3.0000 mysql procs_priv Routine_name char 64 192 utf8 utf8_bin char(64)
|
||||
3.0000 mysql procs_priv Routine_type enum 9 27 utf8 utf8_bin enum('FUNCTION','PROCEDURE')
|
||||
3.0000 mysql procs_priv Grantor char 77 231 utf8 utf8_bin char(77)
|
||||
3.0000 mysql procs_priv Proc_priv set 27 81 utf8 utf8_general_ci set('Execute','Alter Routine','Grant')
|
||||
NULL mysql procs_priv Timestamp timestamp NULL NULL NULL NULL timestamp
|
||||
3.0000 mysql servers Server_name char 64 192 utf8 utf8_general_ci char(64)
|
||||
3.0000 mysql servers Host char 64 192 utf8 utf8_general_ci char(64)
|
||||
3.0000 mysql servers Db char 64 192 utf8 utf8_general_ci char(64)
|
||||
3.0000 mysql servers Username char 64 192 utf8 utf8_general_ci char(64)
|
||||
3.0000 mysql servers Password char 64 192 utf8 utf8_general_ci char(64)
|
||||
NULL mysql servers Port int NULL NULL NULL NULL int(4)
|
||||
3.0000 mysql servers Socket char 64 192 utf8 utf8_general_ci char(64)
|
||||
3.0000 mysql servers Wrapper char 64 192 utf8 utf8_general_ci char(64)
|
||||
3.0000 mysql servers Owner char 64 192 utf8 utf8_general_ci char(64)
|
||||
NULL mysql slow_log start_time timestamp NULL NULL NULL NULL timestamp
|
||||
1.0000 mysql slow_log user_host mediumtext 16777215 16777215 utf8 utf8_general_ci mediumtext
|
||||
NULL mysql slow_log query_time time NULL NULL NULL NULL time
|
||||
NULL mysql slow_log lock_time time NULL NULL NULL NULL time
|
||||
NULL mysql slow_log rows_sent int NULL NULL NULL NULL int(11)
|
||||
NULL mysql slow_log rows_examined int NULL NULL NULL NULL int(11)
|
||||
3.0000 mysql slow_log db varchar 512 1536 utf8 utf8_general_ci varchar(512)
|
||||
NULL mysql slow_log last_insert_id int NULL NULL NULL NULL int(11)
|
||||
NULL mysql slow_log insert_id int NULL NULL NULL NULL int(11)
|
||||
NULL mysql slow_log server_id int NULL NULL NULL NULL int(11)
|
||||
1.0000 mysql slow_log sql_text mediumtext 16777215 16777215 utf8 utf8_general_ci mediumtext
|
||||
3.0000 mysql tables_priv Host char 60 180 utf8 utf8_bin char(60)
|
||||
3.0000 mysql tables_priv Db char 64 192 utf8 utf8_bin char(64)
|
||||
3.0000 mysql tables_priv User char 16 48 utf8 utf8_bin char(16)
|
||||
3.0000 mysql tables_priv Table_name char 64 192 utf8 utf8_bin char(64)
|
||||
3.0000 mysql tables_priv Grantor char 77 231 utf8 utf8_bin char(77)
|
||||
NULL mysql tables_priv Timestamp timestamp NULL NULL NULL NULL timestamp
|
||||
3.0000 mysql tables_priv Table_priv set 98 294 utf8 utf8_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger')
|
||||
3.0000 mysql tables_priv Column_priv set 31 93 utf8 utf8_general_ci set('Select','Insert','Update','References')
|
||||
NULL mysql time_zone Time_zone_id int NULL NULL NULL NULL int(10) unsigned
|
||||
3.0000 mysql time_zone Use_leap_seconds enum 1 3 utf8 utf8_general_ci enum('Y','N')
|
||||
NULL mysql time_zone_leap_second Transition_time bigint NULL NULL NULL NULL bigint(20)
|
||||
NULL mysql time_zone_leap_second Correction int NULL NULL NULL NULL int(11)
|
||||
3.0000 mysql time_zone_name Name char 64 192 utf8 utf8_general_ci char(64)
|
||||
NULL mysql time_zone_name Time_zone_id int NULL NULL NULL NULL int(10) unsigned
|
||||
NULL mysql time_zone_transition Time_zone_id int NULL NULL NULL NULL int(10) unsigned
|
||||
NULL mysql time_zone_transition Transition_time bigint NULL NULL NULL NULL bigint(20)
|
||||
NULL mysql time_zone_transition Transition_type_id int NULL NULL NULL NULL int(10) unsigned
|
||||
NULL mysql time_zone_transition_type Time_zone_id int NULL NULL NULL NULL int(10) unsigned
|
||||
NULL mysql time_zone_transition_type Transition_type_id int NULL NULL NULL NULL int(10) unsigned
|
||||
NULL mysql time_zone_transition_type Offset int NULL NULL NULL NULL int(11)
|
||||
NULL mysql time_zone_transition_type Is_DST tinyint NULL NULL NULL NULL tinyint(3) unsigned
|
||||
3.0000 mysql time_zone_transition_type Abbreviation char 8 24 utf8 utf8_general_ci char(8)
|
||||
3.0000 mysql user Host char 60 180 utf8 utf8_bin char(60)
|
||||
3.0000 mysql user User char 16 48 utf8 utf8_bin char(16)
|
||||
1.0000 mysql user Password char 41 41 latin1 latin1_bin char(41)
|
||||
3.0000 mysql user Select_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Insert_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Update_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Delete_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Create_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Drop_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Reload_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Shutdown_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Process_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user File_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Grant_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user References_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Index_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Alter_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Show_db_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Super_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Create_tmp_table_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Lock_tables_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Execute_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Repl_slave_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Repl_client_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Create_view_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Show_view_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Create_routine_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Alter_routine_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Create_user_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Event_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Trigger_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user ssl_type enum 9 27 utf8 utf8_general_ci enum('','ANY','X509','SPECIFIED')
|
||||
1.0000 mysql user ssl_cipher blob 65535 65535 NULL NULL blob
|
||||
1.0000 mysql user x509_issuer blob 65535 65535 NULL NULL blob
|
||||
1.0000 mysql user x509_subject blob 65535 65535 NULL NULL blob
|
||||
NULL mysql user max_questions int NULL NULL NULL NULL int(11) unsigned
|
||||
NULL mysql user max_updates int NULL NULL NULL NULL int(11) unsigned
|
||||
NULL mysql user max_connections int NULL NULL NULL NULL int(11) unsigned
|
||||
NULL mysql user max_user_connections int NULL NULL NULL NULL int(11) unsigned
|
372
mysql-test/suite/funcs_1/r/is_key_column_usage_embedded.result
Normal file
372
mysql-test/suite/funcs_1/r/is_key_column_usage_embedded.result
Normal file
|
@ -0,0 +1,372 @@
|
|||
SHOW TABLES FROM information_schema LIKE 'KEY_COLUMN_USAGE';
|
||||
Tables_in_information_schema (KEY_COLUMN_USAGE)
|
||||
KEY_COLUMN_USAGE
|
||||
#######################################################################
|
||||
# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
#######################################################################
|
||||
DROP VIEW IF EXISTS test.v1;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP FUNCTION IF EXISTS test.f1;
|
||||
CREATE VIEW test.v1 AS SELECT * FROM information_schema.KEY_COLUMN_USAGE;
|
||||
CREATE PROCEDURE test.p1() SELECT * FROM information_schema.KEY_COLUMN_USAGE;
|
||||
CREATE FUNCTION test.f1() returns BIGINT
|
||||
BEGIN
|
||||
DECLARE counter BIGINT DEFAULT NULL;
|
||||
SELECT COUNT(*) INTO counter FROM information_schema.KEY_COLUMN_USAGE;
|
||||
RETURN counter;
|
||||
END//
|
||||
# Attention: The printing of the next result sets is disabled.
|
||||
SELECT * FROM information_schema.KEY_COLUMN_USAGE;
|
||||
SELECT * FROM test.v1;
|
||||
CALL test.p1;
|
||||
SELECT test.f1();
|
||||
DROP VIEW test.v1;
|
||||
DROP PROCEDURE test.p1;
|
||||
DROP FUNCTION test.f1;
|
||||
#########################################################################
|
||||
# Testcase 3.2.7.1: INFORMATION_SCHEMA.KEY_COLUMN_USAGE layout
|
||||
#########################################################################
|
||||
DESCRIBE information_schema.KEY_COLUMN_USAGE;
|
||||
Field Type Null Key Default Extra
|
||||
CONSTRAINT_CATALOG varchar(512) YES NULL
|
||||
CONSTRAINT_SCHEMA varchar(64) NO
|
||||
CONSTRAINT_NAME varchar(64) NO
|
||||
TABLE_CATALOG varchar(512) YES NULL
|
||||
TABLE_SCHEMA varchar(64) NO
|
||||
TABLE_NAME varchar(64) NO
|
||||
COLUMN_NAME varchar(64) NO
|
||||
ORDINAL_POSITION bigint(10) NO 0
|
||||
POSITION_IN_UNIQUE_CONSTRAINT bigint(10) YES NULL
|
||||
REFERENCED_TABLE_SCHEMA varchar(64) YES NULL
|
||||
REFERENCED_TABLE_NAME varchar(64) YES NULL
|
||||
REFERENCED_COLUMN_NAME varchar(64) YES NULL
|
||||
SHOW CREATE TABLE information_schema.KEY_COLUMN_USAGE;
|
||||
Table Create Table
|
||||
KEY_COLUMN_USAGE CREATE TEMPORARY TABLE `KEY_COLUMN_USAGE` (
|
||||
`CONSTRAINT_CATALOG` varchar(512) DEFAULT NULL,
|
||||
`CONSTRAINT_SCHEMA` varchar(64) NOT NULL DEFAULT '',
|
||||
`CONSTRAINT_NAME` varchar(64) NOT NULL DEFAULT '',
|
||||
`TABLE_CATALOG` varchar(512) DEFAULT NULL,
|
||||
`TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '',
|
||||
`TABLE_NAME` varchar(64) NOT NULL DEFAULT '',
|
||||
`COLUMN_NAME` varchar(64) NOT NULL DEFAULT '',
|
||||
`ORDINAL_POSITION` bigint(10) NOT NULL DEFAULT '0',
|
||||
`POSITION_IN_UNIQUE_CONSTRAINT` bigint(10) DEFAULT NULL,
|
||||
`REFERENCED_TABLE_SCHEMA` varchar(64) DEFAULT NULL,
|
||||
`REFERENCED_TABLE_NAME` varchar(64) DEFAULT NULL,
|
||||
`REFERENCED_COLUMN_NAME` varchar(64) DEFAULT NULL
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=utf8
|
||||
SHOW COLUMNS FROM information_schema.KEY_COLUMN_USAGE;
|
||||
Field Type Null Key Default Extra
|
||||
CONSTRAINT_CATALOG varchar(512) YES NULL
|
||||
CONSTRAINT_SCHEMA varchar(64) NO
|
||||
CONSTRAINT_NAME varchar(64) NO
|
||||
TABLE_CATALOG varchar(512) YES NULL
|
||||
TABLE_SCHEMA varchar(64) NO
|
||||
TABLE_NAME varchar(64) NO
|
||||
COLUMN_NAME varchar(64) NO
|
||||
ORDINAL_POSITION bigint(10) NO 0
|
||||
POSITION_IN_UNIQUE_CONSTRAINT bigint(10) YES NULL
|
||||
REFERENCED_TABLE_SCHEMA varchar(64) YES NULL
|
||||
REFERENCED_TABLE_NAME varchar(64) YES NULL
|
||||
REFERENCED_COLUMN_NAME varchar(64) YES NULL
|
||||
SELECT constraint_catalog, constraint_schema, constraint_name, table_catalog,
|
||||
table_schema, table_name, column_name
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE constraint_catalog IS NOT NULL OR table_catalog IS NOT NULL;
|
||||
constraint_catalog constraint_schema constraint_name table_catalog table_schema table_name column_name
|
||||
########################################################################################
|
||||
# Testcase 3.2.7.2 + 3.2.7.3: INFORMATION_SCHEMA.KEY_COLUMN_USAGE accessible information
|
||||
########################################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
CREATE USER 'testuser2'@'localhost';
|
||||
USE db_datadict;
|
||||
CREATE TABLE t1_1
|
||||
(f1 INT NOT NULL, PRIMARY KEY(f1),
|
||||
f2 INT, INDEX f2_ind(f2))
|
||||
ENGINE = <engine_type>;
|
||||
GRANT SELECT ON t1_1 to 'testuser1'@'localhost';
|
||||
CREATE TABLE t1_2
|
||||
(f1 INT NOT NULL, PRIMARY KEY(f1),
|
||||
f2 INT, INDEX f2_ind(f2))
|
||||
ENGINE = <engine_type>;
|
||||
GRANT SELECT ON t1_2 to 'testuser2'@'localhost';
|
||||
SELECT * FROM information_schema.key_column_usage
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY constraint_catalog, constraint_schema, constraint_name,
|
||||
table_catalog, table_schema, table_name, ordinal_position;
|
||||
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
|
||||
NULL db_datadict PRIMARY NULL db_datadict t1_1 f1 1 NULL NULL NULL NULL
|
||||
NULL db_datadict PRIMARY NULL db_datadict t1_2 f1 1 NULL NULL NULL NULL
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT * FROM information_schema.key_column_usage
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY constraint_catalog, constraint_schema, constraint_name,
|
||||
table_catalog, table_schema, table_name, ordinal_position;
|
||||
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
|
||||
NULL db_datadict PRIMARY NULL db_datadict t1_1 f1 1 NULL NULL NULL NULL
|
||||
NULL db_datadict PRIMARY NULL db_datadict t1_2 f1 1 NULL NULL NULL NULL
|
||||
# Establish connection testuser2 (user=testuser2)
|
||||
SELECT * FROM information_schema.key_column_usage
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY constraint_catalog, constraint_schema, constraint_name,
|
||||
table_catalog, table_schema, table_name, ordinal_position;
|
||||
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
|
||||
NULL db_datadict PRIMARY NULL db_datadict t1_1 f1 1 NULL NULL NULL NULL
|
||||
NULL db_datadict PRIMARY NULL db_datadict t1_2 f1 1 NULL NULL NULL NULL
|
||||
# Switch to connection default and close connections testuser1, testuser2
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
DROP TABLE t1_1;
|
||||
DROP TABLE t1_2;
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
########################################################################################
|
||||
# Testcase 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.KEY_COLUMN_USAGE modifications
|
||||
########################################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
DROP TABLE IF EXISTS test.t1_my_table;
|
||||
CREATE DATABASE db_datadict;
|
||||
SELECT table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
table_name
|
||||
CREATE TABLE test.t1_my_table
|
||||
(f1 CHAR(12), f2 TIMESTAMP, f4 BIGINT, PRIMARY KEY(f1,f2))
|
||||
DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci
|
||||
ENGINE = <engine_type>;
|
||||
SELECT * FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_table';
|
||||
CONSTRAINT_CATALOG NULL
|
||||
CONSTRAINT_SCHEMA test
|
||||
CONSTRAINT_NAME PRIMARY
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t1_my_table
|
||||
COLUMN_NAME f1
|
||||
ORDINAL_POSITION 1
|
||||
POSITION_IN_UNIQUE_CONSTRAINT NULL
|
||||
REFERENCED_TABLE_SCHEMA NULL
|
||||
REFERENCED_TABLE_NAME NULL
|
||||
REFERENCED_COLUMN_NAME NULL
|
||||
CONSTRAINT_CATALOG NULL
|
||||
CONSTRAINT_SCHEMA test
|
||||
CONSTRAINT_NAME PRIMARY
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t1_my_table
|
||||
COLUMN_NAME f2
|
||||
ORDINAL_POSITION 2
|
||||
POSITION_IN_UNIQUE_CONSTRAINT NULL
|
||||
REFERENCED_TABLE_SCHEMA NULL
|
||||
REFERENCED_TABLE_NAME NULL
|
||||
REFERENCED_COLUMN_NAME NULL
|
||||
SELECT DISTINCT table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
table_name
|
||||
t1_my_table
|
||||
RENAME TABLE test.t1_my_table TO test.t1_my_tablex;
|
||||
SELECT DISTINCT table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
table_name
|
||||
t1_my_tablex
|
||||
SELECT DISTINCT table_schema,table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_schema table_name
|
||||
test t1_my_tablex
|
||||
RENAME TABLE test.t1_my_tablex TO db_datadict.t1_my_tablex;
|
||||
SELECT DISTINCT table_schema,table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_schema table_name
|
||||
db_datadict t1_my_tablex
|
||||
SELECT DISTINCT table_name, column_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY table_name, column_name;
|
||||
table_name column_name
|
||||
t1_my_tablex f1
|
||||
t1_my_tablex f2
|
||||
ALTER TABLE db_datadict.t1_my_tablex CHANGE COLUMN f1 first_col CHAR(12);
|
||||
SELECT DISTINCT table_name, column_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY table_name, column_name;
|
||||
table_name column_name
|
||||
t1_my_tablex f2
|
||||
t1_my_tablex first_col
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, column_name, ordinal_position
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY constraint_schema, constraint_name, table_schema,
|
||||
table_name, ordinal_position;
|
||||
constraint_schema constraint_name table_schema table_name column_name ordinal_position
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex first_col 1
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex f2 2
|
||||
CREATE INDEX f2 ON db_datadict.t1_my_tablex(f2);
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, column_name, ordinal_position
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY constraint_schema, constraint_name, table_schema,
|
||||
table_name, ordinal_position;
|
||||
constraint_schema constraint_name table_schema table_name column_name ordinal_position
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex first_col 1
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex f2 2
|
||||
DROP INDEX f2 ON db_datadict.t1_my_tablex;
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, column_name, ordinal_position
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY constraint_schema, constraint_name, table_schema,
|
||||
table_name, ordinal_position;
|
||||
constraint_schema constraint_name table_schema table_name column_name ordinal_position
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex first_col 1
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex f2 2
|
||||
ALTER TABLE db_datadict.t1_my_tablex ADD UNIQUE (f2);
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, column_name, ordinal_position
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY constraint_schema, constraint_name, table_schema,
|
||||
table_name, ordinal_position;
|
||||
constraint_schema constraint_name table_schema table_name column_name ordinal_position
|
||||
db_datadict f2 db_datadict t1_my_tablex f2 1
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex first_col 1
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex f2 2
|
||||
DROP INDEX f2 ON db_datadict.t1_my_tablex;
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, column_name, ordinal_position
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY constraint_schema, constraint_name, table_schema,
|
||||
table_name, ordinal_position;
|
||||
constraint_schema constraint_name table_schema table_name column_name ordinal_position
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex first_col 1
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex f2 2
|
||||
ALTER TABLE db_datadict.t1_my_tablex ADD UNIQUE my_idx (f2);
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, column_name, ordinal_position
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY constraint_schema, constraint_name, table_schema,
|
||||
table_name, ordinal_position;
|
||||
constraint_schema constraint_name table_schema table_name column_name ordinal_position
|
||||
db_datadict my_idx db_datadict t1_my_tablex f2 1
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex first_col 1
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex f2 2
|
||||
DROP INDEX my_idx ON db_datadict.t1_my_tablex;
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, column_name, ordinal_position
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY constraint_schema, constraint_name, table_schema,
|
||||
table_name, ordinal_position;
|
||||
constraint_schema constraint_name table_schema table_name column_name ordinal_position
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex first_col 1
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex f2 2
|
||||
ALTER TABLE db_datadict.t1_my_tablex ADD UNIQUE my_idx (f4,first_col);
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, column_name, ordinal_position
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY constraint_schema, constraint_name, table_schema,
|
||||
table_name, ordinal_position;
|
||||
constraint_schema constraint_name table_schema table_name column_name ordinal_position
|
||||
db_datadict my_idx db_datadict t1_my_tablex f4 1
|
||||
db_datadict my_idx db_datadict t1_my_tablex first_col 2
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex first_col 1
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex f2 2
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, column_name, ordinal_position
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY constraint_schema, constraint_name, table_schema,
|
||||
table_name, ordinal_position;
|
||||
constraint_schema constraint_name table_schema table_name column_name ordinal_position
|
||||
db_datadict my_idx db_datadict t1_my_tablex f4 1
|
||||
db_datadict my_idx db_datadict t1_my_tablex first_col 2
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex first_col 1
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex f2 2
|
||||
ALTER TABLE db_datadict.t1_my_tablex
|
||||
DROP COLUMN first_col;
|
||||
SELECT constraint_schema, constraint_name, table_schema,
|
||||
table_name, column_name, ordinal_position
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY constraint_schema, constraint_name, table_schema,
|
||||
table_name, ordinal_position;
|
||||
constraint_schema constraint_name table_schema table_name column_name ordinal_position
|
||||
db_datadict my_idx db_datadict t1_my_tablex f4 1
|
||||
db_datadict PRIMARY db_datadict t1_my_tablex f2 1
|
||||
SELECT table_name, column_name
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex'
|
||||
ORDER BY table_name, column_name;
|
||||
table_name column_name
|
||||
t1_my_tablex f2
|
||||
t1_my_tablex f4
|
||||
DROP TABLE db_datadict.t1_my_tablex;
|
||||
SELECT table_name, column_name
|
||||
FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name column_name
|
||||
SELECT table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name
|
||||
CREATE TABLE db_datadict.t1_my_tablex
|
||||
ENGINE = <engine_type> AS
|
||||
SELECT 1 AS f1;
|
||||
SELECT table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name
|
||||
ALTER TABLE db_datadict.t1_my_tablex ADD PRIMARY KEY(f1);
|
||||
SELECT table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name
|
||||
t1_my_tablex
|
||||
SELECT table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name
|
||||
t1_my_tablex
|
||||
DROP DATABASE db_datadict;
|
||||
SELECT table_name FROM information_schema.key_column_usage
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name
|
||||
########################################################################
|
||||
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
# DDL on INFORMATION_SCHEMA table are not supported
|
||||
########################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
DROP TABLE IF EXISTS db_datadict.t1;
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE TABLE db_datadict.t1 (f1 BIGINT)
|
||||
ENGINE = <engine_type>;
|
||||
INSERT INTO information_schema.key_column_usage
|
||||
(constraint_schema, constraint_name, table_name)
|
||||
VALUES ( 'mysql', 'primary', 'db');
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
INSERT INTO information_schema.key_column_usage
|
||||
SELECT * FROM information_schema.key_column_usage;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
UPDATE information_schema.key_column_usage
|
||||
SET table_name = 'db1' WHERE constraint_name = 'primary';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DELETE FROM information_schema.key_column_usage WHERE table_name = 't1';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
TRUNCATE information_schema.key_column_usage;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE INDEX i3 ON information_schema.key_column_usage(table_name);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.key_column_usage ADD f1 INT;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE information_schema.key_column_usage;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.key_column_usage
|
||||
RENAME db_datadict.key_column_usage;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.key_column_usage
|
||||
RENAME information_schema.xkey_column_usage;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE db_datadict.t1;
|
||||
DROP DATABASE db_datadict;
|
650
mysql-test/suite/funcs_1/r/is_routines_embedded.result
Normal file
650
mysql-test/suite/funcs_1/r/is_routines_embedded.result
Normal file
|
@ -0,0 +1,650 @@
|
|||
SHOW TABLES FROM information_schema LIKE 'ROUTINES';
|
||||
Tables_in_information_schema (ROUTINES)
|
||||
ROUTINES
|
||||
#######################################################################
|
||||
# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
#######################################################################
|
||||
DROP VIEW IF EXISTS test.v1;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP FUNCTION IF EXISTS test.f1;
|
||||
CREATE VIEW test.v1 AS SELECT * FROM information_schema.ROUTINES;
|
||||
CREATE PROCEDURE test.p1() SELECT * FROM information_schema.ROUTINES;
|
||||
CREATE FUNCTION test.f1() returns BIGINT
|
||||
BEGIN
|
||||
DECLARE counter BIGINT DEFAULT NULL;
|
||||
SELECT COUNT(*) INTO counter FROM information_schema.ROUTINES;
|
||||
RETURN counter;
|
||||
END//
|
||||
# Attention: The printing of the next result sets is disabled.
|
||||
SELECT * FROM information_schema.ROUTINES;
|
||||
SELECT * FROM test.v1;
|
||||
CALL test.p1;
|
||||
SELECT test.f1();
|
||||
DROP VIEW test.v1;
|
||||
DROP PROCEDURE test.p1;
|
||||
DROP FUNCTION test.f1;
|
||||
#########################################################################
|
||||
# Testcase 3.2.8.1: INFORMATION_SCHEMA.ROUTINES layout
|
||||
#########################################################################
|
||||
DESCRIBE information_schema.ROUTINES;
|
||||
Field Type Null Key Default Extra
|
||||
SPECIFIC_NAME varchar(64) NO
|
||||
ROUTINE_CATALOG varchar(512) YES NULL
|
||||
ROUTINE_SCHEMA varchar(64) NO
|
||||
ROUTINE_NAME varchar(64) NO
|
||||
ROUTINE_TYPE varchar(9) NO
|
||||
DTD_IDENTIFIER varchar(64) YES NULL
|
||||
ROUTINE_BODY varchar(8) NO
|
||||
ROUTINE_DEFINITION longtext YES NULL
|
||||
EXTERNAL_NAME varchar(64) YES NULL
|
||||
EXTERNAL_LANGUAGE varchar(64) YES NULL
|
||||
PARAMETER_STYLE varchar(8) NO
|
||||
IS_DETERMINISTIC varchar(3) NO
|
||||
SQL_DATA_ACCESS varchar(64) NO
|
||||
SQL_PATH varchar(64) YES NULL
|
||||
SECURITY_TYPE varchar(7) NO
|
||||
CREATED datetime NO 0000-00-00 00:00:00
|
||||
LAST_ALTERED datetime NO 0000-00-00 00:00:00
|
||||
SQL_MODE longtext NO NULL
|
||||
ROUTINE_COMMENT varchar(64) NO
|
||||
DEFINER varchar(77) NO
|
||||
CHARACTER_SET_CLIENT varchar(32) NO
|
||||
COLLATION_CONNECTION varchar(32) NO
|
||||
DATABASE_COLLATION varchar(32) NO
|
||||
SHOW CREATE TABLE information_schema.ROUTINES;
|
||||
Table Create Table
|
||||
ROUTINES CREATE TEMPORARY TABLE `ROUTINES` (
|
||||
`SPECIFIC_NAME` varchar(64) NOT NULL DEFAULT '',
|
||||
`ROUTINE_CATALOG` varchar(512) DEFAULT NULL,
|
||||
`ROUTINE_SCHEMA` varchar(64) NOT NULL DEFAULT '',
|
||||
`ROUTINE_NAME` varchar(64) NOT NULL DEFAULT '',
|
||||
`ROUTINE_TYPE` varchar(9) NOT NULL DEFAULT '',
|
||||
`DTD_IDENTIFIER` varchar(64) DEFAULT NULL,
|
||||
`ROUTINE_BODY` varchar(8) NOT NULL DEFAULT '',
|
||||
`ROUTINE_DEFINITION` longtext,
|
||||
`EXTERNAL_NAME` varchar(64) DEFAULT NULL,
|
||||
`EXTERNAL_LANGUAGE` varchar(64) DEFAULT NULL,
|
||||
`PARAMETER_STYLE` varchar(8) NOT NULL DEFAULT '',
|
||||
`IS_DETERMINISTIC` varchar(3) NOT NULL DEFAULT '',
|
||||
`SQL_DATA_ACCESS` varchar(64) NOT NULL DEFAULT '',
|
||||
`SQL_PATH` varchar(64) DEFAULT NULL,
|
||||
`SECURITY_TYPE` varchar(7) NOT NULL DEFAULT '',
|
||||
`CREATED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`LAST_ALTERED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`SQL_MODE` longtext NOT NULL,
|
||||
`ROUTINE_COMMENT` varchar(64) NOT NULL DEFAULT '',
|
||||
`DEFINER` varchar(77) NOT NULL DEFAULT '',
|
||||
`CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '',
|
||||
`COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '',
|
||||
`DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT ''
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8
|
||||
SHOW COLUMNS FROM information_schema.ROUTINES;
|
||||
Field Type Null Key Default Extra
|
||||
SPECIFIC_NAME varchar(64) NO
|
||||
ROUTINE_CATALOG varchar(512) YES NULL
|
||||
ROUTINE_SCHEMA varchar(64) NO
|
||||
ROUTINE_NAME varchar(64) NO
|
||||
ROUTINE_TYPE varchar(9) NO
|
||||
DTD_IDENTIFIER varchar(64) YES NULL
|
||||
ROUTINE_BODY varchar(8) NO
|
||||
ROUTINE_DEFINITION longtext YES NULL
|
||||
EXTERNAL_NAME varchar(64) YES NULL
|
||||
EXTERNAL_LANGUAGE varchar(64) YES NULL
|
||||
PARAMETER_STYLE varchar(8) NO
|
||||
IS_DETERMINISTIC varchar(3) NO
|
||||
SQL_DATA_ACCESS varchar(64) NO
|
||||
SQL_PATH varchar(64) YES NULL
|
||||
SECURITY_TYPE varchar(7) NO
|
||||
CREATED datetime NO 0000-00-00 00:00:00
|
||||
LAST_ALTERED datetime NO 0000-00-00 00:00:00
|
||||
SQL_MODE longtext NO NULL
|
||||
ROUTINE_COMMENT varchar(64) NO
|
||||
DEFINER varchar(77) NO
|
||||
CHARACTER_SET_CLIENT varchar(32) NO
|
||||
COLLATION_CONNECTION varchar(32) NO
|
||||
DATABASE_COLLATION varchar(32) NO
|
||||
USE test;
|
||||
DROP PROCEDURE IF EXISTS sp_for_routines;
|
||||
DROP FUNCTION IF EXISTS function_for_routines;
|
||||
CREATE PROCEDURE sp_for_routines() SELECT 'db_datadict';
|
||||
CREATE FUNCTION function_for_routines() RETURNS INT RETURN 0;
|
||||
SELECT specific_name,routine_catalog,routine_schema,routine_name,routine_type,
|
||||
routine_body,external_name,external_language,parameter_style,sql_path
|
||||
FROM information_schema.routines
|
||||
WHERE routine_catalog IS NOT NULL OR external_name IS NOT NULL
|
||||
OR external_language IS NOT NULL OR sql_path IS NOT NULL
|
||||
OR routine_body <> 'SQL' OR parameter_style <> 'SQL'
|
||||
OR specific_name <> routine_name;
|
||||
specific_name routine_catalog routine_schema routine_name routine_type routine_body external_name external_language parameter_style sql_path
|
||||
DROP PROCEDURE sp_for_routines;
|
||||
DROP FUNCTION function_for_routines;
|
||||
################################################################################
|
||||
# Testcase 3.2.8.2 + 3.2.8.3: INFORMATION_SCHEMA.ROUTINES accessible information
|
||||
################################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
DROP DATABASE IF EXISTS db_datadict_2;
|
||||
CREATE DATABASE db_datadict;
|
||||
USE db_datadict;
|
||||
CREATE TABLE res_6_408002_1(f1 CHAR(3), f2 TEXT(25), f3 DATE, f4 INT)
|
||||
ENGINE = <other_engine_type>;
|
||||
INSERT INTO res_6_408002_1(f1, f2, f3, f4)
|
||||
VALUES('abc', 'xyz', '1989-11-09', 0815);
|
||||
DROP PROCEDURE IF EXISTS sp_6_408002_1;
|
||||
CREATE PROCEDURE sp_6_408002_1()
|
||||
BEGIN
|
||||
SELECT * FROM db_datadict.res_6_408002_1;
|
||||
END//
|
||||
CREATE DATABASE db_datadict_2;
|
||||
USE db_datadict_2;
|
||||
CREATE TABLE res_6_408002_2(f1 CHAR(3), f2 TEXT(25), f3 DATE, f4 INT)
|
||||
ENGINE = <other_engine_type>;
|
||||
INSERT INTO res_6_408002_2(f1, f2, f3, f4)
|
||||
VALUES('abc', 'xyz', '1990-10-03', 4711);
|
||||
DROP PROCEDURE IF EXISTS sp_6_408002_2;
|
||||
CREATE PROCEDURE sp_6_408002_2()
|
||||
BEGIN
|
||||
SELECT * FROM db_datadict_2.res_6_408002_2;
|
||||
END//
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
CREATE USER 'testuser2'@'localhost';
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
CREATE USER 'testuser3'@'localhost';
|
||||
GRANT SELECT ON db_datadict_2.* TO 'testuser1'@'localhost';
|
||||
GRANT EXECUTE ON db_datadict_2.* TO 'testuser1'@'localhost';
|
||||
GRANT EXECUTE ON db_datadict.* TO 'testuser1'@'localhost';
|
||||
GRANT SELECT ON db_datadict.* TO 'testuser2'@'localhost';
|
||||
GRANT EXECUTE ON PROCEDURE db_datadict_2.sp_6_408002_2
|
||||
TO 'testuser2'@'localhost';
|
||||
GRANT EXECUTE ON db_datadict_2.* TO 'testuser2'@'localhost';
|
||||
FLUSH PRIVILEGES;
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT * FROM information_schema.routines;
|
||||
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
sp_6_408002_1 NULL db_datadict sp_6_408002_1 PROCEDURE NULL SQL BEGIN
|
||||
SELECT * FROM db_datadict.res_6_408002_1;
|
||||
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
sp_6_408002_2 NULL db_datadict_2 sp_6_408002_2 PROCEDURE NULL SQL BEGIN
|
||||
SELECT * FROM db_datadict_2.res_6_408002_2;
|
||||
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
# Establish connection testuser2 (user=testuser2)
|
||||
SELECT * FROM information_schema.routines;
|
||||
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
sp_6_408002_1 NULL db_datadict sp_6_408002_1 PROCEDURE NULL SQL BEGIN
|
||||
SELECT * FROM db_datadict.res_6_408002_1;
|
||||
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
sp_6_408002_2 NULL db_datadict_2 sp_6_408002_2 PROCEDURE NULL SQL BEGIN
|
||||
SELECT * FROM db_datadict_2.res_6_408002_2;
|
||||
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
# Establish connection testuser3 (user=testuser3)
|
||||
SELECT * FROM information_schema.routines;
|
||||
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
sp_6_408002_1 NULL db_datadict sp_6_408002_1 PROCEDURE NULL SQL BEGIN
|
||||
SELECT * FROM db_datadict.res_6_408002_1;
|
||||
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
sp_6_408002_2 NULL db_datadict_2 sp_6_408002_2 PROCEDURE NULL SQL BEGIN
|
||||
SELECT * FROM db_datadict_2.res_6_408002_2;
|
||||
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
# Switch to connection default and close connections testuser1,testuser2,testuser3
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
USE test;
|
||||
DROP DATABASE db_datadict;
|
||||
DROP DATABASE db_datadict_2;
|
||||
#########################################################################
|
||||
# 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.ROUTINES modifications
|
||||
#########################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict';
|
||||
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
USE db_datadict;
|
||||
CREATE PROCEDURE sp_for_routines() SELECT 'db_datadict';
|
||||
CREATE FUNCTION function_for_routines() RETURNS INT RETURN 0;
|
||||
SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict'
|
||||
ORDER BY routine_name;
|
||||
SPECIFIC_NAME function_for_routines
|
||||
ROUTINE_CATALOG NULL
|
||||
ROUTINE_SCHEMA db_datadict
|
||||
ROUTINE_NAME function_for_routines
|
||||
ROUTINE_TYPE FUNCTION
|
||||
DTD_IDENTIFIER int(11)
|
||||
ROUTINE_BODY SQL
|
||||
ROUTINE_DEFINITION RETURN 0
|
||||
EXTERNAL_NAME NULL
|
||||
EXTERNAL_LANGUAGE NULL
|
||||
PARAMETER_STYLE SQL
|
||||
IS_DETERMINISTIC NO
|
||||
SQL_DATA_ACCESS CONTAINS SQL
|
||||
SQL_PATH NULL
|
||||
SECURITY_TYPE DEFINER
|
||||
CREATED <created>
|
||||
LAST_ALTERED <modified>
|
||||
SQL_MODE
|
||||
ROUTINE_COMMENT
|
||||
DEFINER root@localhost
|
||||
CHARACTER_SET_CLIENT latin1
|
||||
COLLATION_CONNECTION latin1_swedish_ci
|
||||
DATABASE_COLLATION latin1_swedish_ci
|
||||
SPECIFIC_NAME sp_for_routines
|
||||
ROUTINE_CATALOG NULL
|
||||
ROUTINE_SCHEMA db_datadict
|
||||
ROUTINE_NAME sp_for_routines
|
||||
ROUTINE_TYPE PROCEDURE
|
||||
DTD_IDENTIFIER NULL
|
||||
ROUTINE_BODY SQL
|
||||
ROUTINE_DEFINITION SELECT 'db_datadict'
|
||||
EXTERNAL_NAME NULL
|
||||
EXTERNAL_LANGUAGE NULL
|
||||
PARAMETER_STYLE SQL
|
||||
IS_DETERMINISTIC NO
|
||||
SQL_DATA_ACCESS CONTAINS SQL
|
||||
SQL_PATH NULL
|
||||
SECURITY_TYPE DEFINER
|
||||
CREATED <created>
|
||||
LAST_ALTERED <modified>
|
||||
SQL_MODE
|
||||
ROUTINE_COMMENT
|
||||
DEFINER root@localhost
|
||||
CHARACTER_SET_CLIENT latin1
|
||||
COLLATION_CONNECTION latin1_swedish_ci
|
||||
DATABASE_COLLATION latin1_swedish_ci
|
||||
ALTER PROCEDURE sp_for_routines SQL SECURITY INVOKER;
|
||||
ALTER FUNCTION function_for_routines COMMENT 'updated comments';
|
||||
SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict'
|
||||
ORDER BY routine_name;
|
||||
SPECIFIC_NAME function_for_routines
|
||||
ROUTINE_CATALOG NULL
|
||||
ROUTINE_SCHEMA db_datadict
|
||||
ROUTINE_NAME function_for_routines
|
||||
ROUTINE_TYPE FUNCTION
|
||||
DTD_IDENTIFIER int(11)
|
||||
ROUTINE_BODY SQL
|
||||
ROUTINE_DEFINITION RETURN 0
|
||||
EXTERNAL_NAME NULL
|
||||
EXTERNAL_LANGUAGE NULL
|
||||
PARAMETER_STYLE SQL
|
||||
IS_DETERMINISTIC NO
|
||||
SQL_DATA_ACCESS CONTAINS SQL
|
||||
SQL_PATH NULL
|
||||
SECURITY_TYPE DEFINER
|
||||
CREATED <created>
|
||||
LAST_ALTERED <modified>
|
||||
SQL_MODE
|
||||
ROUTINE_COMMENT updated comments
|
||||
DEFINER root@localhost
|
||||
CHARACTER_SET_CLIENT latin1
|
||||
COLLATION_CONNECTION latin1_swedish_ci
|
||||
DATABASE_COLLATION latin1_swedish_ci
|
||||
SPECIFIC_NAME sp_for_routines
|
||||
ROUTINE_CATALOG NULL
|
||||
ROUTINE_SCHEMA db_datadict
|
||||
ROUTINE_NAME sp_for_routines
|
||||
ROUTINE_TYPE PROCEDURE
|
||||
DTD_IDENTIFIER NULL
|
||||
ROUTINE_BODY SQL
|
||||
ROUTINE_DEFINITION SELECT 'db_datadict'
|
||||
EXTERNAL_NAME NULL
|
||||
EXTERNAL_LANGUAGE NULL
|
||||
PARAMETER_STYLE SQL
|
||||
IS_DETERMINISTIC NO
|
||||
SQL_DATA_ACCESS CONTAINS SQL
|
||||
SQL_PATH NULL
|
||||
SECURITY_TYPE INVOKER
|
||||
CREATED <created>
|
||||
LAST_ALTERED <modified>
|
||||
SQL_MODE
|
||||
ROUTINE_COMMENT
|
||||
DEFINER root@localhost
|
||||
CHARACTER_SET_CLIENT latin1
|
||||
COLLATION_CONNECTION latin1_swedish_ci
|
||||
DATABASE_COLLATION latin1_swedish_ci
|
||||
DROP PROCEDURE sp_for_routines;
|
||||
DROP FUNCTION function_for_routines;
|
||||
SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict';
|
||||
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
CREATE PROCEDURE sp_for_routines() SELECT 'db_datadict';
|
||||
CREATE FUNCTION function_for_routines() RETURNS INT RETURN 0;
|
||||
SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict'
|
||||
ORDER BY routine_name;
|
||||
SPECIFIC_NAME function_for_routines
|
||||
ROUTINE_CATALOG NULL
|
||||
ROUTINE_SCHEMA db_datadict
|
||||
ROUTINE_NAME function_for_routines
|
||||
ROUTINE_TYPE FUNCTION
|
||||
DTD_IDENTIFIER int(11)
|
||||
ROUTINE_BODY SQL
|
||||
ROUTINE_DEFINITION RETURN 0
|
||||
EXTERNAL_NAME NULL
|
||||
EXTERNAL_LANGUAGE NULL
|
||||
PARAMETER_STYLE SQL
|
||||
IS_DETERMINISTIC NO
|
||||
SQL_DATA_ACCESS CONTAINS SQL
|
||||
SQL_PATH NULL
|
||||
SECURITY_TYPE DEFINER
|
||||
CREATED <created>
|
||||
LAST_ALTERED <modified>
|
||||
SQL_MODE
|
||||
ROUTINE_COMMENT
|
||||
DEFINER root@localhost
|
||||
CHARACTER_SET_CLIENT latin1
|
||||
COLLATION_CONNECTION latin1_swedish_ci
|
||||
DATABASE_COLLATION latin1_swedish_ci
|
||||
SPECIFIC_NAME sp_for_routines
|
||||
ROUTINE_CATALOG NULL
|
||||
ROUTINE_SCHEMA db_datadict
|
||||
ROUTINE_NAME sp_for_routines
|
||||
ROUTINE_TYPE PROCEDURE
|
||||
DTD_IDENTIFIER NULL
|
||||
ROUTINE_BODY SQL
|
||||
ROUTINE_DEFINITION SELECT 'db_datadict'
|
||||
EXTERNAL_NAME NULL
|
||||
EXTERNAL_LANGUAGE NULL
|
||||
PARAMETER_STYLE SQL
|
||||
IS_DETERMINISTIC NO
|
||||
SQL_DATA_ACCESS CONTAINS SQL
|
||||
SQL_PATH NULL
|
||||
SECURITY_TYPE DEFINER
|
||||
CREATED <created>
|
||||
LAST_ALTERED <modified>
|
||||
SQL_MODE
|
||||
ROUTINE_COMMENT
|
||||
DEFINER root@localhost
|
||||
CHARACTER_SET_CLIENT latin1
|
||||
COLLATION_CONNECTION latin1_swedish_ci
|
||||
DATABASE_COLLATION latin1_swedish_ci
|
||||
use test;
|
||||
DROP DATABASE db_datadict;
|
||||
SELECT * FROM information_schema.routines WHERE routine_schema = 'db_datadict';
|
||||
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
#########################################################################
|
||||
# 3.2.8.4: INFORMATION_SCHEMA.ROUTINES routine body too big for
|
||||
# ROUTINE_DEFINITION column
|
||||
#########################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
USE db_datadict;
|
||||
CREATE TABLE db_datadict.res_6_408004_1
|
||||
(f1 LONGTEXT , f2 MEDIUMINT , f3 LONGBLOB , f4 REAL , f5 YEAR)
|
||||
ENGINE = <other_engine_type>;
|
||||
INSERT INTO db_datadict.res_6_408004_1
|
||||
VALUES ('abc', 98765 , 99999999 , 98765, 10);
|
||||
CREATE TABLE db_datadict.res_6_408004_2
|
||||
(f1 LONGTEXT , f2 MEDIUMINT , f3 LONGBLOB , f4 REAL , f5 YEAR)
|
||||
ENGINE = <other_engine_type>;
|
||||
INSERT INTO db_datadict.res_6_408004_2
|
||||
VALUES ('abc', 98765 , 99999999 , 98765, 10);
|
||||
# Checking the max. possible length of (currently) 4 GByte is not
|
||||
# in this environment here.
|
||||
CREATE PROCEDURE sp_6_408004 ()
|
||||
BEGIN
|
||||
DECLARE done INTEGER DEFAULt 0;
|
||||
DECLARE variable_number_1 LONGTEXT;
|
||||
DECLARE variable_number_2 MEDIUMINT;
|
||||
DECLARE variable_number_3 LONGBLOB;
|
||||
DECLARE variable_number_4 REAL;
|
||||
DECLARE variable_number_5 YEAR;
|
||||
DECLARE cursor_number_1 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10;
|
||||
DECLARE cursor_number_2 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10;
|
||||
DECLARE cursor_number_3 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10;
|
||||
DECLARE cursor_number_4 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10;
|
||||
DECLARE cursor_number_5 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10;
|
||||
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
|
||||
BEGIN
|
||||
OPEN cursor_number_1;
|
||||
WHILE done <> 1 DO
|
||||
FETCH cursor_number_1
|
||||
INTO variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5;
|
||||
IF done <> 0 THEN
|
||||
INSERT INTO res_6_408004_2
|
||||
VALUES (variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5);
|
||||
END IF;
|
||||
END WHILE;
|
||||
BEGIN
|
||||
BEGIN
|
||||
SET done = 0;
|
||||
OPEN cursor_number_2;
|
||||
WHILE done <> 1 DO
|
||||
FETCH cursor_number_2
|
||||
INTO variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5;
|
||||
IF done <> 0 THEN
|
||||
INSERT INTO res_6_408004_2
|
||||
VALUES(variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5);
|
||||
END IF;
|
||||
END WHILE;
|
||||
END;
|
||||
SET done = 0;
|
||||
OPEN cursor_number_3;
|
||||
WHILE done <> 1 DO
|
||||
FETCH cursor_number_3
|
||||
INTO variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5;
|
||||
IF done <> 0 THEN
|
||||
INSERT INTO res_6_408004_2
|
||||
VALUES(variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5);
|
||||
END IF;
|
||||
END WHILE;
|
||||
END;
|
||||
END;
|
||||
BEGIN
|
||||
SET done = 0;
|
||||
OPEN cursor_number_4;
|
||||
WHILE done <> 1 DO
|
||||
FETCH cursor_number_4
|
||||
INTO variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5;
|
||||
IF done <> 0 THEN
|
||||
INSERT INTO res_6_408004_2
|
||||
VALUES (variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5);
|
||||
END IF;
|
||||
END WHILE;
|
||||
END;
|
||||
BEGIN
|
||||
SET @a='test row';
|
||||
SELECT @a;
|
||||
SELECT @a;
|
||||
SELECT @a;
|
||||
END;
|
||||
BEGIN
|
||||
SET done = 0;
|
||||
OPEN cursor_number_5;
|
||||
WHILE done <> 1 DO
|
||||
FETCH cursor_number_5
|
||||
INTO variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5;
|
||||
IF done <> 0 THEN
|
||||
INSERT INTO res_6_408004_2
|
||||
VALUES (variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5);
|
||||
END IF;
|
||||
END WHILE;
|
||||
END;
|
||||
BEGIN
|
||||
SET @a='test row';
|
||||
SELECT @a;
|
||||
SELECT @a;
|
||||
SELECT @a;
|
||||
END;
|
||||
END//
|
||||
CALL db_datadict.sp_6_408004 ();
|
||||
@a
|
||||
test row
|
||||
@a
|
||||
test row
|
||||
@a
|
||||
test row
|
||||
@a
|
||||
test row
|
||||
@a
|
||||
test row
|
||||
@a
|
||||
test row
|
||||
SELECT * FROM db_datadict.res_6_408004_2;
|
||||
f1 f2 f3 f4 f5
|
||||
abc 98765 99999999 98765 2010
|
||||
abc 98765 99999999 98765 2010
|
||||
abc 98765 99999999 98765 2010
|
||||
abc 98765 99999999 98765 2010
|
||||
abc 98765 99999999 98765 2010
|
||||
abc 98765 99999999 98765 2010
|
||||
SELECT *, LENGTH(routine_definition) FROM information_schema.routines
|
||||
WHERE routine_schema = 'db_datadict';
|
||||
SPECIFIC_NAME sp_6_408004
|
||||
ROUTINE_CATALOG NULL
|
||||
ROUTINE_SCHEMA db_datadict
|
||||
ROUTINE_NAME sp_6_408004
|
||||
ROUTINE_TYPE PROCEDURE
|
||||
DTD_IDENTIFIER NULL
|
||||
ROUTINE_BODY SQL
|
||||
ROUTINE_DEFINITION BEGIN
|
||||
DECLARE done INTEGER DEFAULt 0;
|
||||
DECLARE variable_number_1 LONGTEXT;
|
||||
DECLARE variable_number_2 MEDIUMINT;
|
||||
DECLARE variable_number_3 LONGBLOB;
|
||||
DECLARE variable_number_4 REAL;
|
||||
DECLARE variable_number_5 YEAR;
|
||||
DECLARE cursor_number_1 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10;
|
||||
DECLARE cursor_number_2 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10;
|
||||
DECLARE cursor_number_3 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10;
|
||||
DECLARE cursor_number_4 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10;
|
||||
DECLARE cursor_number_5 CURSOR FOR SELECT * FROM res_6_408004_1 LIMIT 0, 10;
|
||||
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;
|
||||
BEGIN
|
||||
OPEN cursor_number_1;
|
||||
WHILE done <> 1 DO
|
||||
FETCH cursor_number_1
|
||||
INTO variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5;
|
||||
IF done <> 0 THEN
|
||||
INSERT INTO res_6_408004_2
|
||||
VALUES (variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5);
|
||||
END IF;
|
||||
END WHILE;
|
||||
BEGIN
|
||||
BEGIN
|
||||
SET done = 0;
|
||||
OPEN cursor_number_2;
|
||||
WHILE done <> 1 DO
|
||||
FETCH cursor_number_2
|
||||
INTO variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5;
|
||||
IF done <> 0 THEN
|
||||
INSERT INTO res_6_408004_2
|
||||
VALUES(variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5);
|
||||
END IF;
|
||||
END WHILE;
|
||||
END;
|
||||
SET done = 0;
|
||||
OPEN cursor_number_3;
|
||||
WHILE done <> 1 DO
|
||||
FETCH cursor_number_3
|
||||
INTO variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5;
|
||||
IF done <> 0 THEN
|
||||
INSERT INTO res_6_408004_2
|
||||
VALUES(variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5);
|
||||
END IF;
|
||||
END WHILE;
|
||||
END;
|
||||
END;
|
||||
BEGIN
|
||||
SET done = 0;
|
||||
OPEN cursor_number_4;
|
||||
WHILE done <> 1 DO
|
||||
FETCH cursor_number_4
|
||||
INTO variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5;
|
||||
IF done <> 0 THEN
|
||||
INSERT INTO res_6_408004_2
|
||||
VALUES (variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5);
|
||||
END IF;
|
||||
END WHILE;
|
||||
END;
|
||||
BEGIN
|
||||
SET @a='test row';
|
||||
SELECT @a;
|
||||
SELECT @a;
|
||||
SELECT @a;
|
||||
END;
|
||||
BEGIN
|
||||
SET done = 0;
|
||||
OPEN cursor_number_5;
|
||||
WHILE done <> 1 DO
|
||||
FETCH cursor_number_5
|
||||
INTO variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5;
|
||||
IF done <> 0 THEN
|
||||
INSERT INTO res_6_408004_2
|
||||
VALUES (variable_number_1, variable_number_2, variable_number_3,
|
||||
variable_number_4, variable_number_5);
|
||||
END IF;
|
||||
END WHILE;
|
||||
END;
|
||||
BEGIN
|
||||
SET @a='test row';
|
||||
SELECT @a;
|
||||
SELECT @a;
|
||||
SELECT @a;
|
||||
END;
|
||||
END
|
||||
EXTERNAL_NAME NULL
|
||||
EXTERNAL_LANGUAGE NULL
|
||||
PARAMETER_STYLE SQL
|
||||
IS_DETERMINISTIC NO
|
||||
SQL_DATA_ACCESS CONTAINS SQL
|
||||
SQL_PATH NULL
|
||||
SECURITY_TYPE DEFINER
|
||||
CREATED YYYY-MM-DD hh:mm:ss
|
||||
LAST_ALTERED YYYY-MM-DD hh:mm:ss
|
||||
SQL_MODE
|
||||
ROUTINE_COMMENT
|
||||
DEFINER root@localhost
|
||||
CHARACTER_SET_CLIENT latin1
|
||||
COLLATION_CONNECTION latin1_swedish_ci
|
||||
DATABASE_COLLATION latin1_swedish_ci
|
||||
LENGTH(routine_definition) 2549
|
||||
DROP DATABASE db_datadict;
|
||||
########################################################################
|
||||
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
# DDL on INFORMATION_SCHEMA table are not supported
|
||||
########################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
USE db_datadict;
|
||||
CREATE PROCEDURE sp_for_routines() SELECT 'db_datadict';
|
||||
USE test;
|
||||
INSERT INTO information_schema.routines (routine_name, routine_type )
|
||||
VALUES ('p2', 'procedure');
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
UPDATE information_schema.routines SET routine_name = 'p2'
|
||||
WHERE routine_body = 'sql';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DELETE FROM information_schema.routines ;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
TRUNCATE information_schema.routines ;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE INDEX i7 ON information_schema.routines (routine_name);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.routines ADD f1 INT;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.routines DISCARD TABLESPACE;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE information_schema.routines ;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.routines RENAME db_datadict.routines;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.routines RENAME information_schema.xroutines;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP DATABASE db_datadict;
|
187
mysql-test/suite/funcs_1/r/is_schemata_embedded.result
Normal file
187
mysql-test/suite/funcs_1/r/is_schemata_embedded.result
Normal file
|
@ -0,0 +1,187 @@
|
|||
SHOW TABLES FROM information_schema LIKE 'SCHEMATA';
|
||||
Tables_in_information_schema (SCHEMATA)
|
||||
SCHEMATA
|
||||
#######################################################################
|
||||
# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
#######################################################################
|
||||
DROP VIEW IF EXISTS test.v1;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP FUNCTION IF EXISTS test.f1;
|
||||
CREATE VIEW test.v1 AS SELECT * FROM information_schema.SCHEMATA;
|
||||
CREATE PROCEDURE test.p1() SELECT * FROM information_schema.SCHEMATA;
|
||||
CREATE FUNCTION test.f1() returns BIGINT
|
||||
BEGIN
|
||||
DECLARE counter BIGINT DEFAULT NULL;
|
||||
SELECT COUNT(*) INTO counter FROM information_schema.SCHEMATA;
|
||||
RETURN counter;
|
||||
END//
|
||||
# Attention: The printing of the next result sets is disabled.
|
||||
SELECT * FROM information_schema.SCHEMATA;
|
||||
SELECT * FROM test.v1;
|
||||
CALL test.p1;
|
||||
SELECT test.f1();
|
||||
DROP VIEW test.v1;
|
||||
DROP PROCEDURE test.p1;
|
||||
DROP FUNCTION test.f1;
|
||||
#########################################################################
|
||||
# Testcase 3.2.9.1: INFORMATION_SCHEMA.SCHEMATA layout;
|
||||
#########################################################################
|
||||
DESCRIBE information_schema.SCHEMATA;
|
||||
Field Type Null Key Default Extra
|
||||
CATALOG_NAME varchar(512) YES NULL
|
||||
SCHEMA_NAME varchar(64) NO
|
||||
DEFAULT_CHARACTER_SET_NAME varchar(64) NO
|
||||
DEFAULT_COLLATION_NAME varchar(64) NO
|
||||
SQL_PATH varchar(512) YES NULL
|
||||
SHOW CREATE TABLE information_schema.SCHEMATA;
|
||||
Table Create Table
|
||||
SCHEMATA CREATE TEMPORARY TABLE `SCHEMATA` (
|
||||
`CATALOG_NAME` varchar(512) DEFAULT NULL,
|
||||
`SCHEMA_NAME` varchar(64) NOT NULL DEFAULT '',
|
||||
`DEFAULT_CHARACTER_SET_NAME` varchar(64) NOT NULL DEFAULT '',
|
||||
`DEFAULT_COLLATION_NAME` varchar(64) NOT NULL DEFAULT '',
|
||||
`SQL_PATH` varchar(512) DEFAULT NULL
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=utf8
|
||||
SHOW COLUMNS FROM information_schema.SCHEMATA;
|
||||
Field Type Null Key Default Extra
|
||||
CATALOG_NAME varchar(512) YES NULL
|
||||
SCHEMA_NAME varchar(64) NO
|
||||
DEFAULT_CHARACTER_SET_NAME varchar(64) NO
|
||||
DEFAULT_COLLATION_NAME varchar(64) NO
|
||||
SQL_PATH varchar(512) YES NULL
|
||||
SELECT catalog_name, schema_name, sql_path
|
||||
FROM information_schema.schemata
|
||||
WHERE catalog_name IS NOT NULL or sql_path IS NOT NULL;
|
||||
catalog_name schema_name sql_path
|
||||
###############################################################################
|
||||
# Testcases 3.2.9.2+3.2.9.3: INFORMATION_SCHEMA.SCHEMATA accessible information
|
||||
###############################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict_1;
|
||||
DROP DATABASE IF EXISTS db_datadict_2;
|
||||
CREATE DATABASE db_datadict_1;
|
||||
CREATE DATABASE db_datadict_2;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
CREATE USER 'testuser2'@'localhost';
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
CREATE USER 'testuser3'@'localhost';
|
||||
GRANT SELECT ON db_datadict_1.* to 'testuser1'@'localhost';
|
||||
GRANT SELECT ON db_datadict_1.* to 'testuser2'@'localhost';
|
||||
GRANT SELECT ON db_datadict_2.* to 'testuser2'@'localhost';
|
||||
SELECT * FROM information_schema.schemata
|
||||
WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name;
|
||||
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
|
||||
NULL db_datadict_1 latin1 latin1_swedish_ci NULL
|
||||
NULL db_datadict_2 latin1 latin1_swedish_ci NULL
|
||||
SHOW DATABASES LIKE 'db_datadict_%';
|
||||
Database (db_datadict_%)
|
||||
db_datadict_1
|
||||
db_datadict_2
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT * FROM information_schema.schemata
|
||||
WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name;
|
||||
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
|
||||
NULL db_datadict_1 latin1 latin1_swedish_ci NULL
|
||||
NULL db_datadict_2 latin1 latin1_swedish_ci NULL
|
||||
SHOW DATABASES LIKE 'db_datadict_%';
|
||||
Database (db_datadict_%)
|
||||
db_datadict_1
|
||||
db_datadict_2
|
||||
# Establish connection testuser2 (user=testuser2)
|
||||
SELECT * FROM information_schema.schemata
|
||||
WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name;
|
||||
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
|
||||
NULL db_datadict_1 latin1 latin1_swedish_ci NULL
|
||||
NULL db_datadict_2 latin1 latin1_swedish_ci NULL
|
||||
SHOW DATABASES LIKE 'db_datadict_%';
|
||||
Database (db_datadict_%)
|
||||
db_datadict_1
|
||||
db_datadict_2
|
||||
# Establish connection testuser3 (user=testuser3)
|
||||
SELECT * FROM information_schema.schemata
|
||||
WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name;
|
||||
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
|
||||
NULL db_datadict_1 latin1 latin1_swedish_ci NULL
|
||||
NULL db_datadict_2 latin1 latin1_swedish_ci NULL
|
||||
SHOW DATABASES LIKE 'db_datadict_%';
|
||||
Database (db_datadict_%)
|
||||
db_datadict_1
|
||||
db_datadict_2
|
||||
# Switch to connection default and close connections testuser1,testuser2,testuser3
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
DROP DATABASE db_datadict_1;
|
||||
DROP DATABASE db_datadict_2;
|
||||
#################################################################################
|
||||
# Testcases 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.SCHEMATA modifications
|
||||
#################################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
SELECT * FROM information_schema.schemata WHERE schema_name = 'db_datadict';
|
||||
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
|
||||
CREATE DATABASE db_datadict CHARACTER SET 'latin1' COLLATE 'latin1_swedish_ci';
|
||||
SELECT * FROM information_schema.schemata WHERE schema_name = 'db_datadict';
|
||||
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
|
||||
NULL db_datadict latin1 latin1_swedish_ci NULL
|
||||
SELECT schema_name, default_character_set_name
|
||||
FROM information_schema.schemata WHERE schema_name = 'db_datadict';
|
||||
schema_name default_character_set_name
|
||||
db_datadict latin1
|
||||
ALTER SCHEMA db_datadict CHARACTER SET 'utf8';
|
||||
SELECT schema_name, default_character_set_name
|
||||
FROM information_schema.schemata WHERE schema_name = 'db_datadict';
|
||||
schema_name default_character_set_name
|
||||
db_datadict utf8
|
||||
ALTER SCHEMA db_datadict CHARACTER SET 'latin1';
|
||||
SELECT schema_name, default_collation_name FROM information_schema.schemata
|
||||
WHERE schema_name = 'db_datadict';
|
||||
schema_name default_collation_name
|
||||
db_datadict latin1_swedish_ci
|
||||
ALTER SCHEMA db_datadict COLLATE 'latin1_general_cs';
|
||||
SELECT schema_name, default_collation_name FROM information_schema.schemata
|
||||
WHERE schema_name = 'db_datadict';
|
||||
schema_name default_collation_name
|
||||
db_datadict latin1_general_cs
|
||||
SELECT schema_name
|
||||
FROM information_schema.schemata WHERE schema_name = 'db_datadict';
|
||||
schema_name
|
||||
db_datadict
|
||||
DROP DATABASE db_datadict;
|
||||
SELECT schema_name
|
||||
FROM information_schema.schemata WHERE schema_name = 'db_datadict';
|
||||
schema_name
|
||||
########################################################################
|
||||
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
# DDL on INFORMATION_SCHEMA tables are not supported
|
||||
########################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict CHARACTER SET 'latin1' COLLATE 'latin1_swedish_ci';
|
||||
INSERT INTO information_schema.schemata
|
||||
(catalog_name, schema_name, default_character_set_name, sql_path)
|
||||
VALUES (NULL, 'db1', 'latin1', NULL);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
INSERT INTO information_schema.schemata
|
||||
SELECT * FROM information_schema.schemata;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
UPDATE information_schema.schemata
|
||||
SET default_character_set_name = 'utf8'
|
||||
WHERE schema_name = 'db_datadict';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
UPDATE information_schema.schemata SET catalog_name = 't_4711';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DELETE FROM information_schema.schemata WHERE schema_name = 'db_datadict';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
TRUNCATE information_schema.schemata;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE INDEX i1 ON information_schema.schemata(schema_name);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.schemata ADD f1 INT;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE information_schema.schemata;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.schemata RENAME db_datadict.schemata;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.schemata RENAME information_schema.xschemata;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP DATABASE db_datadict;
|
113
mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result
Normal file
113
mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result
Normal file
|
@ -0,0 +1,113 @@
|
|||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
DROP USER testuser1@localhost;
|
||||
CREATE USER testuser1@localhost;
|
||||
GRANT SELECT ON db_datadict.* TO testuser1@localhost;
|
||||
SELECT * FROM information_schema.statistics
|
||||
WHERE table_schema = 'mysql'
|
||||
ORDER BY table_schema, table_name, index_name, seq_in_index, column_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
|
||||
NULL mysql columns_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
||||
NULL mysql columns_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
||||
NULL mysql columns_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
|
||||
NULL mysql columns_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
|
||||
NULL mysql columns_priv 0 mysql PRIMARY 5 Column_name A #CARD# NULL NULL BTREE
|
||||
NULL mysql db 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
||||
NULL mysql db 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
||||
NULL mysql db 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
|
||||
NULL mysql db 1 mysql User 1 User A #CARD# NULL NULL BTREE
|
||||
NULL mysql event 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
|
||||
NULL mysql event 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
|
||||
NULL mysql func 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
|
||||
NULL mysql help_category 0 mysql name 1 name A #CARD# NULL NULL BTREE
|
||||
NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql help_keyword 0 mysql name 1 name A #CARD# NULL NULL BTREE
|
||||
NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql help_topic 0 mysql name 1 name A #CARD# NULL NULL BTREE
|
||||
NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql host 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
||||
NULL mysql host 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
||||
NULL mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A #CARD# NULL NULL BTREE
|
||||
NULL mysql plugin 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
|
||||
NULL mysql proc 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
|
||||
NULL mysql proc 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
|
||||
NULL mysql proc 0 mysql PRIMARY 3 type A #CARD# NULL NULL BTREE
|
||||
NULL mysql procs_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
|
||||
NULL mysql procs_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
||||
NULL mysql procs_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
||||
NULL mysql procs_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
|
||||
NULL mysql procs_priv 0 mysql PRIMARY 4 Routine_name A #CARD# NULL NULL BTREE
|
||||
NULL mysql procs_priv 0 mysql PRIMARY 5 Routine_type A #CARD# NULL NULL BTREE
|
||||
NULL mysql servers 0 mysql PRIMARY 1 Server_name A #CARD# NULL NULL BTREE
|
||||
NULL mysql tables_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
|
||||
NULL mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
||||
NULL mysql tables_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
||||
NULL mysql tables_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
|
||||
NULL mysql tables_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
|
||||
NULL mysql time_zone 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql time_zone_leap_second 0 mysql PRIMARY 1 Transition_time A #CARD# NULL NULL BTREE
|
||||
NULL mysql time_zone_name 0 mysql PRIMARY 1 Name A #CARD# NULL NULL BTREE
|
||||
NULL mysql time_zone_transition 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A #CARD# NULL NULL BTREE
|
||||
NULL mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
||||
NULL mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT * FROM information_schema.statistics
|
||||
WHERE table_schema = 'mysql'
|
||||
ORDER BY table_schema, table_name, index_name, seq_in_index, column_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
|
||||
NULL mysql columns_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
||||
NULL mysql columns_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
||||
NULL mysql columns_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
|
||||
NULL mysql columns_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
|
||||
NULL mysql columns_priv 0 mysql PRIMARY 5 Column_name A #CARD# NULL NULL BTREE
|
||||
NULL mysql db 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
||||
NULL mysql db 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
||||
NULL mysql db 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
|
||||
NULL mysql db 1 mysql User 1 User A #CARD# NULL NULL BTREE
|
||||
NULL mysql event 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
|
||||
NULL mysql event 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
|
||||
NULL mysql func 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
|
||||
NULL mysql help_category 0 mysql name 1 name A #CARD# NULL NULL BTREE
|
||||
NULL mysql help_category 0 mysql PRIMARY 1 help_category_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql help_keyword 0 mysql name 1 name A #CARD# NULL NULL BTREE
|
||||
NULL mysql help_keyword 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql help_relation 0 mysql PRIMARY 1 help_keyword_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql help_relation 0 mysql PRIMARY 2 help_topic_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql help_topic 0 mysql name 1 name A #CARD# NULL NULL BTREE
|
||||
NULL mysql help_topic 0 mysql PRIMARY 1 help_topic_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql host 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
||||
NULL mysql host 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
||||
NULL mysql ndb_binlog_index 0 mysql PRIMARY 1 epoch A #CARD# NULL NULL BTREE
|
||||
NULL mysql plugin 0 mysql PRIMARY 1 name A #CARD# NULL NULL BTREE
|
||||
NULL mysql proc 0 mysql PRIMARY 1 db A #CARD# NULL NULL BTREE
|
||||
NULL mysql proc 0 mysql PRIMARY 2 name A #CARD# NULL NULL BTREE
|
||||
NULL mysql proc 0 mysql PRIMARY 3 type A #CARD# NULL NULL BTREE
|
||||
NULL mysql procs_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
|
||||
NULL mysql procs_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
||||
NULL mysql procs_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
||||
NULL mysql procs_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
|
||||
NULL mysql procs_priv 0 mysql PRIMARY 4 Routine_name A #CARD# NULL NULL BTREE
|
||||
NULL mysql procs_priv 0 mysql PRIMARY 5 Routine_type A #CARD# NULL NULL BTREE
|
||||
NULL mysql servers 0 mysql PRIMARY 1 Server_name A #CARD# NULL NULL BTREE
|
||||
NULL mysql tables_priv 1 mysql Grantor 1 Grantor A #CARD# NULL NULL BTREE
|
||||
NULL mysql tables_priv 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
||||
NULL mysql tables_priv 0 mysql PRIMARY 2 Db A #CARD# NULL NULL BTREE
|
||||
NULL mysql tables_priv 0 mysql PRIMARY 3 User A #CARD# NULL NULL BTREE
|
||||
NULL mysql tables_priv 0 mysql PRIMARY 4 Table_name A #CARD# NULL NULL BTREE
|
||||
NULL mysql time_zone 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql time_zone_leap_second 0 mysql PRIMARY 1 Transition_time A #CARD# NULL NULL BTREE
|
||||
NULL mysql time_zone_name 0 mysql PRIMARY 1 Name A #CARD# NULL NULL BTREE
|
||||
NULL mysql time_zone_transition 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql time_zone_transition 0 mysql PRIMARY 2 Transition_time A #CARD# NULL NULL BTREE
|
||||
NULL mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE
|
||||
NULL mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
|
||||
NULL mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
|
||||
# Switch to connection default and close connection testuser1
|
||||
DROP USER testuser1@localhost;
|
||||
DROP DATABASE db_datadict;
|
|
@ -0,0 +1,65 @@
|
|||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
DROP USER testuser1@localhost;
|
||||
CREATE USER testuser1@localhost;
|
||||
GRANT SELECT ON db_datadict.* TO testuser1@localhost;
|
||||
SELECT * FROM information_schema.table_constraints
|
||||
WHERE table_schema = 'mysql'
|
||||
ORDER BY table_schema,table_name,constraint_name;
|
||||
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
|
||||
NULL mysql PRIMARY mysql columns_priv PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql db PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql event PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql func PRIMARY KEY
|
||||
NULL mysql name mysql help_category UNIQUE
|
||||
NULL mysql PRIMARY mysql help_category PRIMARY KEY
|
||||
NULL mysql name mysql help_keyword UNIQUE
|
||||
NULL mysql PRIMARY mysql help_keyword PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql help_relation PRIMARY KEY
|
||||
NULL mysql name mysql help_topic UNIQUE
|
||||
NULL mysql PRIMARY mysql help_topic PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql host PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql ndb_binlog_index PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql plugin PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql proc PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql procs_priv PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql servers PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql tables_priv PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql time_zone PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql time_zone_leap_second PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql time_zone_name PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql time_zone_transition PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql time_zone_transition_type PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql user PRIMARY KEY
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT * FROM information_schema.table_constraints
|
||||
WHERE table_schema = 'mysql'
|
||||
ORDER BY table_schema,table_name,constraint_name;
|
||||
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
|
||||
NULL mysql PRIMARY mysql columns_priv PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql db PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql event PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql func PRIMARY KEY
|
||||
NULL mysql name mysql help_category UNIQUE
|
||||
NULL mysql PRIMARY mysql help_category PRIMARY KEY
|
||||
NULL mysql name mysql help_keyword UNIQUE
|
||||
NULL mysql PRIMARY mysql help_keyword PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql help_relation PRIMARY KEY
|
||||
NULL mysql name mysql help_topic UNIQUE
|
||||
NULL mysql PRIMARY mysql help_topic PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql host PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql ndb_binlog_index PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql plugin PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql proc PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql procs_priv PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql servers PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql tables_priv PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql time_zone PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql time_zone_leap_second PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql time_zone_name PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql time_zone_transition PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql time_zone_transition_type PRIMARY KEY
|
||||
NULL mysql PRIMARY mysql user PRIMARY KEY
|
||||
# Switch to connection default and close connection testuser1
|
||||
DROP USER testuser1@localhost;
|
||||
DROP DATABASE db_datadict;
|
427
mysql-test/suite/funcs_1/r/is_tables_embedded.result
Normal file
427
mysql-test/suite/funcs_1/r/is_tables_embedded.result
Normal file
|
@ -0,0 +1,427 @@
|
|||
SHOW TABLES FROM information_schema LIKE 'TABLES';
|
||||
Tables_in_information_schema (TABLES)
|
||||
TABLES
|
||||
#######################################################################
|
||||
# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
#######################################################################
|
||||
DROP VIEW IF EXISTS test.v1;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP FUNCTION IF EXISTS test.f1;
|
||||
CREATE VIEW test.v1 AS SELECT * FROM information_schema.TABLES;
|
||||
CREATE PROCEDURE test.p1() SELECT * FROM information_schema.TABLES;
|
||||
CREATE FUNCTION test.f1() returns BIGINT
|
||||
BEGIN
|
||||
DECLARE counter BIGINT DEFAULT NULL;
|
||||
SELECT COUNT(*) INTO counter FROM information_schema.TABLES;
|
||||
RETURN counter;
|
||||
END//
|
||||
# Attention: The printing of the next result sets is disabled.
|
||||
SELECT * FROM information_schema.TABLES;
|
||||
SELECT * FROM test.v1;
|
||||
CALL test.p1;
|
||||
SELECT test.f1();
|
||||
DROP VIEW test.v1;
|
||||
DROP PROCEDURE test.p1;
|
||||
DROP FUNCTION test.f1;
|
||||
#########################################################################
|
||||
# Testcase 3.2.12.1: INFORMATION_SCHEMA.TABLES layout
|
||||
#########################################################################
|
||||
DESCRIBE information_schema.TABLES;
|
||||
Field Type Null Key Default Extra
|
||||
TABLE_CATALOG varchar(512) YES NULL
|
||||
TABLE_SCHEMA varchar(64) NO
|
||||
TABLE_NAME varchar(64) NO
|
||||
TABLE_TYPE varchar(64) NO
|
||||
ENGINE varchar(64) YES NULL
|
||||
VERSION bigint(21) YES NULL
|
||||
ROW_FORMAT varchar(10) YES NULL
|
||||
TABLE_ROWS bigint(21) YES NULL
|
||||
AVG_ROW_LENGTH bigint(21) YES NULL
|
||||
DATA_LENGTH bigint(21) YES NULL
|
||||
MAX_DATA_LENGTH bigint(21) YES NULL
|
||||
INDEX_LENGTH bigint(21) YES NULL
|
||||
DATA_FREE bigint(21) YES NULL
|
||||
AUTO_INCREMENT bigint(21) YES NULL
|
||||
CREATE_TIME datetime YES NULL
|
||||
UPDATE_TIME datetime YES NULL
|
||||
CHECK_TIME datetime YES NULL
|
||||
TABLE_COLLATION varchar(64) YES NULL
|
||||
CHECKSUM bigint(21) YES NULL
|
||||
CREATE_OPTIONS varchar(255) YES NULL
|
||||
TABLE_COMMENT varchar(80) NO
|
||||
SHOW CREATE TABLE information_schema.TABLES;
|
||||
Table Create Table
|
||||
TABLES CREATE TEMPORARY TABLE `TABLES` (
|
||||
`TABLE_CATALOG` varchar(512) default NULL,
|
||||
`TABLE_SCHEMA` varchar(64) NOT NULL default '',
|
||||
`TABLE_NAME` varchar(64) NOT NULL default '',
|
||||
`TABLE_TYPE` varchar(64) NOT NULL default '',
|
||||
`ENGINE` varchar(64) default NULL,
|
||||
`VERSION` bigint(21) default NULL,
|
||||
`ROW_FORMAT` varchar(10) default NULL,
|
||||
`TABLE_ROWS` bigint(21) default NULL,
|
||||
`AVG_ROW_LENGTH` bigint(21) default NULL,
|
||||
`DATA_LENGTH` bigint(21) default NULL,
|
||||
`MAX_DATA_LENGTH` bigint(21) default NULL,
|
||||
`INDEX_LENGTH` bigint(21) default NULL,
|
||||
`DATA_FREE` bigint(21) default NULL,
|
||||
`AUTO_INCREMENT` bigint(21) default NULL,
|
||||
`CREATE_TIME` datetime default NULL,
|
||||
`UPDATE_TIME` datetime default NULL,
|
||||
`CHECK_TIME` datetime default NULL,
|
||||
`TABLE_COLLATION` varchar(64) default NULL,
|
||||
`CHECKSUM` bigint(21) default NULL,
|
||||
`CREATE_OPTIONS` varchar(255) default NULL,
|
||||
`TABLE_COMMENT` varchar(80) NOT NULL default ''
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=utf8
|
||||
SHOW COLUMNS FROM information_schema.TABLES;
|
||||
Field Type Null Key Default Extra
|
||||
TABLE_CATALOG varchar(512) YES NULL
|
||||
TABLE_SCHEMA varchar(64) NO
|
||||
TABLE_NAME varchar(64) NO
|
||||
TABLE_TYPE varchar(64) NO
|
||||
ENGINE varchar(64) YES NULL
|
||||
VERSION bigint(21) YES NULL
|
||||
ROW_FORMAT varchar(10) YES NULL
|
||||
TABLE_ROWS bigint(21) YES NULL
|
||||
AVG_ROW_LENGTH bigint(21) YES NULL
|
||||
DATA_LENGTH bigint(21) YES NULL
|
||||
MAX_DATA_LENGTH bigint(21) YES NULL
|
||||
INDEX_LENGTH bigint(21) YES NULL
|
||||
DATA_FREE bigint(21) YES NULL
|
||||
AUTO_INCREMENT bigint(21) YES NULL
|
||||
CREATE_TIME datetime YES NULL
|
||||
UPDATE_TIME datetime YES NULL
|
||||
CHECK_TIME datetime YES NULL
|
||||
TABLE_COLLATION varchar(64) YES NULL
|
||||
CHECKSUM bigint(21) YES NULL
|
||||
CREATE_OPTIONS varchar(255) YES NULL
|
||||
TABLE_COMMENT varchar(80) NO
|
||||
SELECT table_catalog, table_schema, table_name
|
||||
FROM information_schema.tables WHERE table_catalog IS NOT NULL;
|
||||
table_catalog table_schema table_name
|
||||
################################################################################
|
||||
# Testcase 3.2.12.2 + 3.2.12.3: INFORMATION_SCHEMA.TABLES accessible information
|
||||
################################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
GRANT CREATE, CREATE VIEW, INSERT, SELECT ON db_datadict.*
|
||||
TO 'testuser1'@'localhost' WITH GRANT OPTION;
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
CREATE USER 'testuser2'@'localhost';
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
CREATE USER 'testuser3'@'localhost';
|
||||
CREATE TABLE db_datadict.tb1 (f1 INT, f2 INT, f3 INT)
|
||||
ENGINE = <engine_type>;
|
||||
GRANT SELECT ON db_datadict.tb1 TO 'testuser1'@'localhost';
|
||||
GRANT ALL ON db_datadict.tb1 TO 'testuser2'@'localhost' WITH GRANT OPTION;
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
CREATE TABLE tb2 (f1 DECIMAL)
|
||||
ENGINE = <engine_type>;
|
||||
CREATE TABLE tb3 (f1 VARCHAR(200))
|
||||
ENGINE = <engine_type>;
|
||||
GRANT SELECT ON db_datadict.tb3 to 'testuser3'@'localhost';
|
||||
GRANT INSERT ON db_datadict.tb3 to 'testuser2'@'localhost';
|
||||
CREATE VIEW v3 AS SELECT * FROM tb3;
|
||||
GRANT SELECT ON db_datadict.v3 to 'testuser3'@'localhost';
|
||||
SELECT * FROM information_schema.tables
|
||||
WHERE table_schema = 'db_datadict' ORDER BY table_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
|
||||
NULL db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
|
||||
NULL db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
|
||||
NULL db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
|
||||
NULL db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW
|
||||
SHOW TABLES FROM db_datadict;
|
||||
Tables_in_db_datadict
|
||||
tb1
|
||||
tb2
|
||||
tb3
|
||||
v3
|
||||
# Establish connection testuser2 (user=testuser2)
|
||||
SELECT * FROM information_schema.tables
|
||||
WHERE table_schema = 'db_datadict' ORDER BY table_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
|
||||
NULL db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
|
||||
NULL db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
|
||||
NULL db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
|
||||
NULL db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW
|
||||
SHOW TABLES FROM db_datadict;
|
||||
Tables_in_db_datadict
|
||||
tb1
|
||||
tb2
|
||||
tb3
|
||||
v3
|
||||
# Establish connection testuser3 (user=testuser3)
|
||||
SELECT * FROM information_schema.tables
|
||||
WHERE table_schema = 'db_datadict' ORDER BY table_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
|
||||
NULL db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
|
||||
NULL db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
|
||||
NULL db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
|
||||
NULL db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW
|
||||
SHOW TABLES FROM db_datadict;
|
||||
Tables_in_db_datadict
|
||||
tb1
|
||||
tb2
|
||||
tb3
|
||||
v3
|
||||
# Switch to connection default (user=root)
|
||||
SELECT * FROM information_schema.tables
|
||||
WHERE table_schema = 'db_datadict' ORDER BY table_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
|
||||
NULL db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
|
||||
NULL db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
|
||||
NULL db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
|
||||
NULL db_datadict v3 VIEW #ENG# NULL #RF# NULL #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# NULL #CS# NULL VIEW
|
||||
SHOW TABLES FROM db_datadict;
|
||||
Tables_in_db_datadict
|
||||
tb1
|
||||
tb2
|
||||
tb3
|
||||
v3
|
||||
# Close connection testuser1, testuser2, testuser3
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
DROP DATABASE db_datadict;
|
||||
#########################################################################
|
||||
# 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.TABLES modifications
|
||||
#########################################################################
|
||||
DROP TABLE IF EXISTS test.t1_my_table;
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
table_name
|
||||
CREATE TABLE test.t1_my_table (f1 BIGINT)
|
||||
DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci
|
||||
COMMENT = 'Initial Comment' ENGINE = <engine_type>;
|
||||
SELECT * FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_table';
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t1_my_table
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE #ENG#
|
||||
VERSION 10
|
||||
ROW_FORMAT #RF#
|
||||
TABLE_ROWS 0
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM #CS#
|
||||
CREATE_OPTIONS
|
||||
TABLE_COMMENT Initial Comment
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
table_name
|
||||
t1_my_table
|
||||
RENAME TABLE test.t1_my_table TO test.t1_my_tablex;
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
table_name
|
||||
t1_my_tablex
|
||||
SELECT table_schema,table_name FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_schema table_name
|
||||
test t1_my_tablex
|
||||
RENAME TABLE test.t1_my_tablex TO db_datadict.t1_my_tablex;
|
||||
SELECT table_schema,table_name FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_schema table_name
|
||||
db_datadict t1_my_tablex
|
||||
SELECT table_name, engine FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name engine
|
||||
t1_my_tablex <engine_type>
|
||||
ALTER TABLE db_datadict.t1_my_tablex
|
||||
ENGINE = <other_engine_type>;
|
||||
SELECT table_name, engine FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name engine
|
||||
t1_my_tablex <other_engine_type>
|
||||
SELECT table_name, table_rows FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name table_rows
|
||||
t1_my_tablex 0
|
||||
INSERT INTO db_datadict.t1_my_tablex VALUES(1),(2);
|
||||
SELECT table_name, table_rows FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name table_rows
|
||||
t1_my_tablex 2
|
||||
SELECT table_name, table_collation FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name table_collation
|
||||
t1_my_tablex latin1_swedish_ci
|
||||
ALTER TABLE db_datadict.t1_my_tablex DEFAULT CHARACTER SET utf8;
|
||||
SELECT table_name, table_collation FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name table_collation
|
||||
t1_my_tablex utf8_general_ci
|
||||
SELECT table_name, table_collation FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name table_collation
|
||||
t1_my_tablex utf8_general_ci
|
||||
ALTER TABLE db_datadict.t1_my_tablex
|
||||
DEFAULT CHARACTER SET latin1 COLLATE latin1_german1_ci;
|
||||
SELECT table_name, table_collation FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name table_collation
|
||||
t1_my_tablex latin1_german1_ci
|
||||
SELECT table_name, TABLE_COMMENT FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name TABLE_COMMENT
|
||||
t1_my_tablex Initial Comment
|
||||
ALTER TABLE db_datadict.t1_my_tablex COMMENT 'Changed Comment';
|
||||
SELECT table_name, TABLE_COMMENT FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name TABLE_COMMENT
|
||||
t1_my_tablex Changed Comment
|
||||
SELECT table_name, AUTO_INCREMENT FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name AUTO_INCREMENT
|
||||
t1_my_tablex NULL
|
||||
ALTER TABLE db_datadict.t1_my_tablex
|
||||
ADD f2 BIGINT AUTO_INCREMENT, ADD PRIMARY KEY (f2);
|
||||
SELECT table_name, AUTO_INCREMENT FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name AUTO_INCREMENT
|
||||
t1_my_tablex 3
|
||||
SELECT table_name, ROW_FORMAT FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name ROW_FORMAT
|
||||
t1_my_tablex Fixed
|
||||
ALTER TABLE db_datadict.t1_my_tablex ROW_FORMAT = dynamic;
|
||||
SELECT table_name, ROW_FORMAT FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name ROW_FORMAT
|
||||
t1_my_tablex Dynamic
|
||||
SELECT table_name, checksum FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name checksum
|
||||
t1_my_tablex NULL
|
||||
ALTER TABLE db_datadict.t1_my_tablex CHECKSUM = 1;
|
||||
SELECT table_name, checksum IS NOT NULL FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name checksum IS NOT NULL
|
||||
t1_my_tablex 1
|
||||
SELECT UPDATE_TIME, checksum INTO @UPDATE_TIME, @checksum
|
||||
FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
INSERT INTO db_datadict.t1_my_tablex SET f1 = 3;
|
||||
SELECT UPDATE_TIME > @UPDATE_TIME
|
||||
AS "Is current UPDATE_TIME bigger than before last INSERT?"
|
||||
FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
Is current UPDATE_TIME bigger than before last INSERT?
|
||||
1
|
||||
SELECT checksum <> @checksum
|
||||
AS "Is current CHECKSUM different than before last INSERT?"
|
||||
FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
Is current CHECKSUM different than before last INSERT?
|
||||
1
|
||||
SELECT CREATE_TIME INTO @CREATE_TIME FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
table_name
|
||||
t1_my_tablex
|
||||
DROP TABLE db_datadict.t1_my_tablex;
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name LIKE 't1_my_table%';
|
||||
table_name
|
||||
CREATE TABLE test.t1_my_tablex (f1 BIGINT)
|
||||
ENGINE = <other_engine_type>;
|
||||
SELECT CREATE_TIME > @CREATE_TIME
|
||||
AS "Is current CREATE_TIME bigger than for the old dropped table?"
|
||||
FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
Is current CREATE_TIME bigger than for the old dropped table?
|
||||
1
|
||||
DROP TABLE test.t1_my_tablex;
|
||||
CREATE VIEW test.t1_my_tablex AS SELECT 1;
|
||||
SELECT * FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t1_my_tablex
|
||||
TABLE_TYPE VIEW
|
||||
ENGINE NULL
|
||||
VERSION NULL
|
||||
ROW_FORMAT NULL
|
||||
TABLE_ROWS NULL
|
||||
AVG_ROW_LENGTH NULL
|
||||
DATA_LENGTH NULL
|
||||
MAX_DATA_LENGTH NULL
|
||||
INDEX_LENGTH NULL
|
||||
DATA_FREE NULL
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME NULL
|
||||
UPDATE_TIME NULL
|
||||
CHECK_TIME NULL
|
||||
TABLE_COLLATION NULL
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS NULL
|
||||
TABLE_COMMENT VIEW
|
||||
DROP VIEW test.t1_my_tablex;
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name
|
||||
CREATE TEMPORARY TABLE test.t1_my_tablex
|
||||
ENGINE = <other_engine_type>
|
||||
AS SELECT 1;
|
||||
SELECT table_name, table_type FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
DROP TEMPORARY TABLE test.t1_my_tablex;
|
||||
CREATE TABLE db_datadict.t1_my_tablex
|
||||
ENGINE = <engine_type> AS
|
||||
SELECT 1;
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name
|
||||
t1_my_tablex
|
||||
DROP DATABASE db_datadict;
|
||||
SELECT table_name FROM information_schema.tables
|
||||
WHERE table_name = 't1_my_tablex';
|
||||
table_name
|
||||
########################################################################
|
||||
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
# DDL on INFORMATION_SCHEMA tables are not supported
|
||||
########################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE TABLE db_datadict.t1 (f1 BIGINT)
|
||||
ENGINE = <engine_type>;
|
||||
INSERT INTO information_schema.tables
|
||||
SELECT * FROM information_schema.tables;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
UPDATE information_schema.tables SET table_schema = 'test'
|
||||
WHERE table_name = 't1';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DELETE FROM information_schema.tables WHERE table_name = 't1';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
TRUNCATE information_schema.tables;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE INDEX my_idx_on_tables ON information_schema.tables(table_schema);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.tables DROP PRIMARY KEY;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.tables ADD f1 INT;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE information_schema.tables;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.tables RENAME db_datadict.tables;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.tables RENAME information_schema.xtables;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP DATABASE db_datadict;
|
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,5 @@
|
|||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
DROP DATABASE IF EXISTS test1;
|
||||
CREATE DATABASE test1;
|
||||
SELECT *,
|
||||
LEFT( table_comment,
|
||||
IF(INSTR(table_comment,'InnoDB free') = 0
|
||||
|
@ -636,7 +636,7 @@ user_comment
|
|||
Separator -----------------------------------------------------
|
||||
DROP USER testuser1@localhost;
|
||||
CREATE USER testuser1@localhost;
|
||||
GRANT SELECT ON db_datadict.* TO testuser1@localhost;
|
||||
GRANT SELECT ON test1.* TO testuser1@localhost;
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT *,
|
||||
LEFT( table_comment,
|
||||
|
@ -1274,4 +1274,4 @@ user_comment
|
|||
Separator -----------------------------------------------------
|
||||
# Switch to connection default and close connection testuser1
|
||||
DROP USER testuser1@localhost;
|
||||
DROP DATABASE db_datadict;
|
||||
DROP DATABASE test1;
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
192
mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result
Normal file
192
mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result
Normal file
|
@ -0,0 +1,192 @@
|
|||
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
||||
DROP DATABASE IF EXISTS test1;
|
||||
DROP DATABASE IF EXISTS test2;
|
||||
CREATE DATABASE test1;
|
||||
CREATE DATABASE test2;
|
||||
CREATE TABLE test1.t1 (f1 VARCHAR(20)) ENGINE = <engine_to_be_used>;
|
||||
CREATE TABLE test1.t2 (f1 VARCHAR(20)) ENGINE = <engine_to_be_used>;
|
||||
CREATE TABLE test2.t1 (f1 VARCHAR(20)) ENGINE = <engine_to_be_used>;
|
||||
SELECT *,
|
||||
LEFT( table_comment,
|
||||
IF(INSTR(table_comment,'InnoDB free') = 0
|
||||
AND INSTR(table_comment,'number_of_replicas') = 0,
|
||||
LENGTH(table_comment),
|
||||
INSTR(table_comment,'InnoDB free')
|
||||
+ INSTR(table_comment,'number_of_replicas') - 1))
|
||||
AS "user_comment",
|
||||
'-----------------------------------------------------' AS "Separator"
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE'
|
||||
ORDER BY table_schema,table_name;
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test1
|
||||
TABLE_NAME t1
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MyISAM
|
||||
VERSION 10
|
||||
ROW_FORMAT Dynamic
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test1
|
||||
TABLE_NAME t2
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MyISAM
|
||||
VERSION 10
|
||||
ROW_FORMAT Dynamic
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test2
|
||||
TABLE_NAME t1
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MyISAM
|
||||
VERSION 10
|
||||
ROW_FORMAT Dynamic
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
SHOW TABLES FROM test1;
|
||||
Tables_in_test1
|
||||
t1
|
||||
t2
|
||||
SHOW TABLES FROM test2;
|
||||
Tables_in_test2
|
||||
t1
|
||||
DROP USER testuser1@localhost;
|
||||
CREATE USER testuser1@localhost;
|
||||
GRANT SELECT ON test1.* TO testuser1@localhost;
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT *,
|
||||
LEFT( table_comment,
|
||||
IF(INSTR(table_comment,'InnoDB free') = 0
|
||||
AND INSTR(table_comment,'number_of_replicas') = 0,
|
||||
LENGTH(table_comment),
|
||||
INSTR(table_comment,'InnoDB free')
|
||||
+ INSTR(table_comment,'number_of_replicas') - 1))
|
||||
AS "user_comment",
|
||||
'-----------------------------------------------------' AS "Separator"
|
||||
FROM information_schema.tables
|
||||
WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE'
|
||||
ORDER BY table_schema,table_name;
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test1
|
||||
TABLE_NAME t1
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MyISAM
|
||||
VERSION 10
|
||||
ROW_FORMAT Dynamic
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test1
|
||||
TABLE_NAME t2
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MyISAM
|
||||
VERSION 10
|
||||
ROW_FORMAT Dynamic
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test2
|
||||
TABLE_NAME t1
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE MyISAM
|
||||
VERSION 10
|
||||
ROW_FORMAT Dynamic
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
SHOW TABLES FROM test1;
|
||||
Tables_in_test1
|
||||
t1
|
||||
t2
|
||||
SHOW TABLES FROM test2;
|
||||
Tables_in_test2
|
||||
t1
|
||||
# Switch to connection default and close connection testuser1
|
||||
DROP USER testuser1@localhost;
|
||||
DROP DATABASE test1;
|
||||
DROP DATABASE test2;
|
|
@ -1,5 +1,5 @@
|
|||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
DROP DATABASE IF EXISTS test1;
|
||||
CREATE DATABASE test1;
|
||||
SELECT *,
|
||||
LEFT( table_comment,
|
||||
IF(INSTR(table_comment,'InnoDB free') = 0
|
||||
|
@ -543,7 +543,7 @@ user_comment Users and global privileges
|
|||
Separator -----------------------------------------------------
|
||||
DROP USER testuser1@localhost;
|
||||
CREATE USER testuser1@localhost;
|
||||
GRANT SELECT ON db_datadict.* TO testuser1@localhost;
|
||||
GRANT SELECT ON test1.* TO testuser1@localhost;
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT *,
|
||||
LEFT( table_comment,
|
||||
|
@ -559,4 +559,4 @@ WHERE table_schema = 'mysql'
|
|||
ORDER BY table_schema,table_name;
|
||||
# Switch to connection default and close connection testuser1
|
||||
DROP USER testuser1@localhost;
|
||||
DROP DATABASE db_datadict;
|
||||
DROP DATABASE test1;
|
||||
|
|
1091
mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result
Normal file
1091
mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result
Normal file
File diff suppressed because it is too large
Load diff
|
@ -1,66 +1,10 @@
|
|||
DROP DATABASE IF EXISTS test1;
|
||||
DROP DATABASE IF EXISTS test2;
|
||||
CREATE DATABASE test1;
|
||||
USE test;
|
||||
USE test;
|
||||
USE test;
|
||||
DROP TABLE IF EXISTS t1, t2, t4, t10, t11;
|
||||
CREATE TABLE t1 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
|
||||
ENGINE = NDB;
|
||||
CREATE TABLE t2 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
|
||||
ENGINE = NDB;
|
||||
CREATE TABLE t4 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
|
||||
ENGINE = NDB;
|
||||
CREATE TABLE t10 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
|
||||
ENGINE = NDB;
|
||||
CREATE TABLE t11 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
|
||||
ENGINE = NDB;
|
||||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t1;
|
||||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t2;
|
||||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t4;
|
||||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t10;
|
||||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t11;
|
||||
drop TABLE if exists t3;
|
||||
CREATE TABLE t3 (f1 char(20), f2 char(20), f3 integer) ENGINE = NDB;
|
||||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' INTO TABLE t3;
|
||||
drop database if exists test4;
|
||||
CREATE database test4;
|
||||
use test4;
|
||||
CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int)
|
||||
ENGINE = NDB;
|
||||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t6;
|
||||
use test;
|
||||
drop TABLE if exists t7, t8;
|
||||
CREATE TABLE t7 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = NDB;
|
||||
CREATE TABLE t8 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = NDB;
|
||||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t7;
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f3' at row 1
|
||||
Warning 1265 Data truncated for column 'f3' at row 2
|
||||
Warning 1265 Data truncated for column 'f3' at row 3
|
||||
Warning 1265 Data truncated for column 'f3' at row 4
|
||||
Warning 1265 Data truncated for column 'f3' at row 5
|
||||
Warning 1265 Data truncated for column 'f3' at row 6
|
||||
Warning 1265 Data truncated for column 'f3' at row 7
|
||||
Warning 1265 Data truncated for column 'f3' at row 8
|
||||
Warning 1265 Data truncated for column 'f3' at row 9
|
||||
Warning 1265 Data truncated for column 'f3' at row 10
|
||||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t8;
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'f3' at row 1
|
||||
Warning 1265 Data truncated for column 'f3' at row 2
|
||||
Warning 1265 Data truncated for column 'f3' at row 3
|
||||
Warning 1265 Data truncated for column 'f3' at row 4
|
||||
Warning 1265 Data truncated for column 'f3' at row 5
|
||||
Warning 1265 Data truncated for column 'f3' at row 6
|
||||
Warning 1265 Data truncated for column 'f3' at row 7
|
||||
Warning 1265 Data truncated for column 'f3' at row 8
|
||||
Warning 1265 Data truncated for column 'f3' at row 9
|
||||
Warning 1265 Data truncated for column 'f3' at row 10
|
||||
drop TABLE if exists t9;
|
||||
CREATE TABLE t9 (f1 int, f2 char(25), f3 int) ENGINE = NDB;
|
||||
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' INTO TABLE t9;
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE DATABASE test2;
|
||||
CREATE TABLE test1.t1 (f1 VARCHAR(20)) ENGINE = <engine_to_be_used>;
|
||||
CREATE TABLE test1.t2 (f1 VARCHAR(20)) ENGINE = <engine_to_be_used>;
|
||||
CREATE TABLE test2.t1 (f1 VARCHAR(20)) ENGINE = <engine_to_be_used>;
|
||||
SELECT *,
|
||||
LEFT( table_comment,
|
||||
IF(INSTR(table_comment,'InnoDB free') = 0
|
||||
|
@ -74,12 +18,12 @@ FROM information_schema.tables
|
|||
WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE'
|
||||
ORDER BY table_schema,table_name;
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_SCHEMA test1
|
||||
TABLE_NAME t1
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
ROW_FORMAT Dynamic
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
|
@ -97,58 +41,12 @@ TABLE_COMMENT #TC#
|
|||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t10
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t11
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_SCHEMA test1
|
||||
TABLE_NAME t2
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
ROW_FORMAT Dynamic
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
|
@ -166,127 +64,12 @@ TABLE_COMMENT #TC#
|
|||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t3
|
||||
TABLE_SCHEMA test2
|
||||
TABLE_NAME t1
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t4
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t7
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t8
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t9
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test4
|
||||
TABLE_NAME t6
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
ROW_FORMAT Dynamic
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
|
@ -303,9 +86,16 @@ CREATE_OPTIONS #CO#
|
|||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
SHOW TABLES FROM test1;
|
||||
Tables_in_test1
|
||||
t1
|
||||
t2
|
||||
SHOW TABLES FROM test2;
|
||||
Tables_in_test2
|
||||
t1
|
||||
DROP USER testuser1@localhost;
|
||||
CREATE USER testuser1@localhost;
|
||||
GRANT SELECT ON db_datadict.* TO testuser1@localhost;
|
||||
GRANT SELECT ON test1.* TO testuser1@localhost;
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT *,
|
||||
LEFT( table_comment,
|
||||
|
@ -320,12 +110,12 @@ FROM information_schema.tables
|
|||
WHERE table_schema LIKE 'test%' AND table_type = 'BASE TABLE'
|
||||
ORDER BY table_schema,table_name;
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_SCHEMA test1
|
||||
TABLE_NAME t1
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
ROW_FORMAT Dynamic
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
|
@ -343,173 +133,12 @@ TABLE_COMMENT #TC#
|
|||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t10
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t11
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_SCHEMA test1
|
||||
TABLE_NAME t2
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t3
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t4
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t7
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t8
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
MAX_DATA_LENGTH #MDL#
|
||||
INDEX_LENGTH #IL#
|
||||
DATA_FREE #DF#
|
||||
AUTO_INCREMENT NULL
|
||||
CREATE_TIME #CRT#
|
||||
UPDATE_TIME #UT#
|
||||
CHECK_TIME #CT#
|
||||
TABLE_COLLATION latin1_swedish_ci
|
||||
CHECKSUM NULL
|
||||
CREATE_OPTIONS #CO#
|
||||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
TABLE_CATALOG NULL
|
||||
TABLE_SCHEMA test
|
||||
TABLE_NAME t9
|
||||
TABLE_TYPE BASE TABLE
|
||||
ENGINE ndbcluster
|
||||
VERSION 10
|
||||
ROW_FORMAT Fixed
|
||||
ROW_FORMAT Dynamic
|
||||
TABLE_ROWS #TBLR#
|
||||
AVG_ROW_LENGTH #ARL#
|
||||
DATA_LENGTH #DL#
|
||||
|
@ -526,17 +155,13 @@ CREATE_OPTIONS #CO#
|
|||
TABLE_COMMENT #TC#
|
||||
user_comment
|
||||
Separator -----------------------------------------------------
|
||||
SHOW TABLES FROM test1;
|
||||
Tables_in_test1
|
||||
t1
|
||||
t2
|
||||
SHOW TABLES FROM test2;
|
||||
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'test2'
|
||||
# Switch to connection default and close connection testuser1
|
||||
DROP USER testuser1@localhost;
|
||||
DROP DATABASE db_datadict;
|
||||
DROP DATABASE test1;
|
||||
DROP DATABASE test4;
|
||||
DROP TABLE test.t1;
|
||||
DROP TABLE test.t2;
|
||||
DROP TABLE test.t3;
|
||||
DROP TABLE test.t4;
|
||||
DROP TABLE test.t7;
|
||||
DROP TABLE test.t8;
|
||||
DROP TABLE test.t9;
|
||||
DROP TABLE test.t10;
|
||||
DROP TABLE test.t11;
|
||||
DROP DATABASE test2;
|
||||
|
|
208
mysql-test/suite/funcs_1/r/is_triggers_embedded.result
Normal file
208
mysql-test/suite/funcs_1/r/is_triggers_embedded.result
Normal file
|
@ -0,0 +1,208 @@
|
|||
SHOW TABLES FROM information_schema LIKE 'TRIGGERS';
|
||||
Tables_in_information_schema (TRIGGERS)
|
||||
TRIGGERS
|
||||
#######################################################################
|
||||
# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
#######################################################################
|
||||
DROP VIEW IF EXISTS test.v1;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP FUNCTION IF EXISTS test.f1;
|
||||
CREATE VIEW test.v1 AS SELECT * FROM information_schema.TRIGGERS;
|
||||
CREATE PROCEDURE test.p1() SELECT * FROM information_schema.TRIGGERS;
|
||||
CREATE FUNCTION test.f1() returns BIGINT
|
||||
BEGIN
|
||||
DECLARE counter BIGINT DEFAULT NULL;
|
||||
SELECT COUNT(*) INTO counter FROM information_schema.TRIGGERS;
|
||||
RETURN counter;
|
||||
END//
|
||||
# Attention: The printing of the next result sets is disabled.
|
||||
SELECT * FROM information_schema.TRIGGERS;
|
||||
SELECT * FROM test.v1;
|
||||
CALL test.p1;
|
||||
SELECT test.f1();
|
||||
DROP VIEW test.v1;
|
||||
DROP PROCEDURE test.p1;
|
||||
DROP FUNCTION test.f1;
|
||||
#########################################################################
|
||||
# Testcase 3.2.12.1: INFORMATION_SCHEMA.TRIGGERS layout
|
||||
#########################################################################
|
||||
DESCRIBE information_schema.TRIGGERS;
|
||||
Field Type Null Key Default Extra
|
||||
TRIGGER_CATALOG varchar(512) YES NULL
|
||||
TRIGGER_SCHEMA varchar(64) NO
|
||||
TRIGGER_NAME varchar(64) NO
|
||||
EVENT_MANIPULATION varchar(6) NO
|
||||
EVENT_OBJECT_CATALOG varchar(512) YES NULL
|
||||
EVENT_OBJECT_SCHEMA varchar(64) NO
|
||||
EVENT_OBJECT_TABLE varchar(64) NO
|
||||
ACTION_ORDER bigint(4) NO 0
|
||||
ACTION_CONDITION longtext YES NULL
|
||||
ACTION_STATEMENT longtext NO NULL
|
||||
ACTION_ORIENTATION varchar(9) NO
|
||||
ACTION_TIMING varchar(6) NO
|
||||
ACTION_REFERENCE_OLD_TABLE varchar(64) YES NULL
|
||||
ACTION_REFERENCE_NEW_TABLE varchar(64) YES NULL
|
||||
ACTION_REFERENCE_OLD_ROW varchar(3) NO
|
||||
ACTION_REFERENCE_NEW_ROW varchar(3) NO
|
||||
CREATED datetime YES NULL
|
||||
SQL_MODE longtext NO NULL
|
||||
DEFINER longtext NO NULL
|
||||
SHOW CREATE TABLE information_schema.TRIGGERS;
|
||||
Table Create Table
|
||||
TRIGGERS CREATE TEMPORARY TABLE `TRIGGERS` (
|
||||
`TRIGGER_CATALOG` varchar(512) default NULL,
|
||||
`TRIGGER_SCHEMA` varchar(64) NOT NULL default '',
|
||||
`TRIGGER_NAME` varchar(64) NOT NULL default '',
|
||||
`EVENT_MANIPULATION` varchar(6) NOT NULL default '',
|
||||
`EVENT_OBJECT_CATALOG` varchar(512) default NULL,
|
||||
`EVENT_OBJECT_SCHEMA` varchar(64) NOT NULL default '',
|
||||
`EVENT_OBJECT_TABLE` varchar(64) NOT NULL default '',
|
||||
`ACTION_ORDER` bigint(4) NOT NULL default '0',
|
||||
`ACTION_CONDITION` longtext,
|
||||
`ACTION_STATEMENT` longtext NOT NULL,
|
||||
`ACTION_ORIENTATION` varchar(9) NOT NULL default '',
|
||||
`ACTION_TIMING` varchar(6) NOT NULL default '',
|
||||
`ACTION_REFERENCE_OLD_TABLE` varchar(64) default NULL,
|
||||
`ACTION_REFERENCE_NEW_TABLE` varchar(64) default NULL,
|
||||
`ACTION_REFERENCE_OLD_ROW` varchar(3) NOT NULL default '',
|
||||
`ACTION_REFERENCE_NEW_ROW` varchar(3) NOT NULL default '',
|
||||
`CREATED` datetime default NULL,
|
||||
`SQL_MODE` longtext NOT NULL,
|
||||
`DEFINER` longtext NOT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8
|
||||
SHOW COLUMNS FROM information_schema.TRIGGERS;
|
||||
Field Type Null Key Default Extra
|
||||
TRIGGER_CATALOG varchar(512) YES NULL
|
||||
TRIGGER_SCHEMA varchar(64) NO
|
||||
TRIGGER_NAME varchar(64) NO
|
||||
EVENT_MANIPULATION varchar(6) NO
|
||||
EVENT_OBJECT_CATALOG varchar(512) YES NULL
|
||||
EVENT_OBJECT_SCHEMA varchar(64) NO
|
||||
EVENT_OBJECT_TABLE varchar(64) NO
|
||||
ACTION_ORDER bigint(4) NO 0
|
||||
ACTION_CONDITION longtext YES NULL
|
||||
ACTION_STATEMENT longtext NO NULL
|
||||
ACTION_ORIENTATION varchar(9) NO
|
||||
ACTION_TIMING varchar(6) NO
|
||||
ACTION_REFERENCE_OLD_TABLE varchar(64) YES NULL
|
||||
ACTION_REFERENCE_NEW_TABLE varchar(64) YES NULL
|
||||
ACTION_REFERENCE_OLD_ROW varchar(3) NO
|
||||
ACTION_REFERENCE_NEW_ROW varchar(3) NO
|
||||
CREATED datetime YES NULL
|
||||
SQL_MODE longtext NO NULL
|
||||
DEFINER longtext NO NULL
|
||||
SELECT * FROM information_schema.triggers
|
||||
WHERE trigger_catalog IS NOT NULL OR event_object_catalog IS NOT NULL
|
||||
OR action_condition IS NOT NULL OR action_reference_old_table IS NOT NULL
|
||||
OR action_reference_new_table IS NOT NULL;
|
||||
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER
|
||||
##################################################################################
|
||||
# Testcase 3.2.18.2 + 3.2.18.3: INFORMATION_SCHEMA.TRIGGERS accessible information
|
||||
##################################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
CREATE USER 'testuser2'@'localhost';
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
CREATE USER 'testuser3'@'localhost';
|
||||
DROP USER 'testuser4'@'localhost';
|
||||
CREATE USER 'testuser4'@'localhost';
|
||||
GRANT SUPER ON *.* TO 'testuser1'@'localhost';
|
||||
GRANT SUPER ON *.* TO 'testuser3'@'localhost';
|
||||
GRANT SUPER ON *.* TO 'testuser4'@'localhost';
|
||||
GRANT ALL ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
CREATE TABLE db_datadict.t1 (f1 INT, f2 INT, f3 INT)
|
||||
ENGINE = <engine_type>;
|
||||
CREATE TRIGGER trg1 BEFORE INSERT
|
||||
ON db_datadict.t1 FOR EACH ROW SET @test_before = 2, new.f1 = @test_before;
|
||||
GRANT ALL ON db_datadict.t1 TO 'testuser2'@'localhost';
|
||||
GRANT SELECT ON db_datadict.t1 TO 'testuser3'@'localhost';
|
||||
SELECT * FROM information_schema.triggers
|
||||
WHERE trigger_name = 'trg1';
|
||||
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER
|
||||
NULL db_datadict trg1 INSERT NULL db_datadict t1 0 NULL SET @test_before = 2, new.f1 = @test_before ROW BEFORE NULL NULL OLD NEW NULL testuser1@localhost
|
||||
SHOW TRIGGERS FROM db_datadict;
|
||||
Trigger Event Table Statement Timing Created sql_mode Definer
|
||||
trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE NULL testuser1@localhost
|
||||
# Establish connection testuser2 (user=testuser2)
|
||||
SHOW GRANTS FOR 'testuser2'@'localhost';
|
||||
# No SUPER Privilege --> no result for query
|
||||
SELECT * FROM information_schema.triggers
|
||||
WHERE trigger_name = 'trg1';
|
||||
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER
|
||||
NULL db_datadict trg1 INSERT NULL db_datadict t1 0 NULL SET @test_before = 2, new.f1 = @test_before ROW BEFORE NULL NULL OLD NEW NULL testuser1@localhost
|
||||
SHOW TRIGGERS FROM db_datadict;
|
||||
Trigger Event Table Statement Timing Created sql_mode Definer
|
||||
trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE NULL testuser1@localhost
|
||||
# Establish connection testuser3 (user=testuser3)
|
||||
SHOW GRANTS FOR 'testuser3'@'localhost';
|
||||
# SUPER Privilege + SELECT Privilege on t1 --> result for query
|
||||
SELECT * FROM information_schema.triggers
|
||||
WHERE trigger_name = 'trg1';
|
||||
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER
|
||||
NULL db_datadict trg1 INSERT NULL db_datadict t1 0 NULL SET @test_before = 2, new.f1 = @test_before ROW BEFORE NULL NULL OLD NEW NULL testuser1@localhost
|
||||
SHOW TRIGGERS FROM db_datadict;
|
||||
Trigger Event Table Statement Timing Created sql_mode Definer
|
||||
trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE NULL testuser1@localhost
|
||||
# Establish connection testuser4 (user=testuser4)
|
||||
SHOW GRANTS FOR 'testuser4'@'localhost';
|
||||
# SUPER Privilege + no SELECT Privilege on t1 --> no result for query
|
||||
SELECT * FROM information_schema.triggers
|
||||
WHERE trigger_name = 'trg1';
|
||||
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER
|
||||
NULL db_datadict trg1 INSERT NULL db_datadict t1 0 NULL SET @test_before = 2, new.f1 = @test_before ROW BEFORE NULL NULL OLD NEW NULL testuser1@localhost
|
||||
SHOW TRIGGERS FROM db_datadict;
|
||||
Trigger Event Table Statement Timing Created sql_mode Definer
|
||||
trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE NULL testuser1@localhost
|
||||
# Switch to connection default and close connections testuser1 - testuser4
|
||||
SELECT * FROM information_schema.triggers
|
||||
WHERE trigger_name = 'trg1';
|
||||
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER
|
||||
NULL db_datadict trg1 INSERT NULL db_datadict t1 0 NULL SET @test_before = 2, new.f1 = @test_before ROW BEFORE NULL NULL OLD NEW NULL testuser1@localhost
|
||||
SHOW TRIGGERS FROM db_datadict;
|
||||
Trigger Event Table Statement Timing Created sql_mode Definer
|
||||
trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE NULL testuser1@localhost
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
DROP USER 'testuser3'@'localhost';
|
||||
DROP USER 'testuser4'@'localhost';
|
||||
DROP DATABASE db_datadict;
|
||||
#########################################################################
|
||||
# 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.TRIGGERS modifications
|
||||
#########################################################################
|
||||
########################################################################
|
||||
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
# DDL on INFORMATION_SCHEMA tables are not supported
|
||||
########################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE TABLE db_datadict.t1 (f1 BIGINT)
|
||||
ENGINE = <engine_type>;
|
||||
CREATE TRIGGER db_datadict.trg1 BEFORE INSERT
|
||||
ON db_datadict.t1 FOR EACH ROW SET @test_before = 2, new.f1 = @test_before;
|
||||
INSERT INTO information_schema.triggers
|
||||
SELECT * FROM information_schema.triggers;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
UPDATE information_schema.triggers SET trigger_schema = 'test'
|
||||
WHERE table_name = 't1';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DELETE FROM information_schema.triggers WHERE trigger_name = 't1';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
TRUNCATE information_schema.triggers;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE INDEX my_idx_on_triggers ON information_schema.triggers(trigger_schema);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.triggers DROP PRIMARY KEY;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.triggers ADD f1 INT;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE information_schema.triggers;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.triggers RENAME db_datadict.triggers;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.triggers RENAME information_schema.xtriggers;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP DATABASE db_datadict;
|
241
mysql-test/suite/funcs_1/r/is_views_embedded.result
Normal file
241
mysql-test/suite/funcs_1/r/is_views_embedded.result
Normal file
|
@ -0,0 +1,241 @@
|
|||
SHOW TABLES FROM information_schema LIKE 'VIEWS';
|
||||
Tables_in_information_schema (VIEWS)
|
||||
VIEWS
|
||||
#######################################################################
|
||||
# Testcase 3.2.1.1: INFORMATION_SCHEMA tables can be queried via SELECT
|
||||
#######################################################################
|
||||
DROP VIEW IF EXISTS test.v1;
|
||||
DROP PROCEDURE IF EXISTS test.p1;
|
||||
DROP FUNCTION IF EXISTS test.f1;
|
||||
CREATE VIEW test.v1 AS SELECT * FROM information_schema.VIEWS;
|
||||
CREATE PROCEDURE test.p1() SELECT * FROM information_schema.VIEWS;
|
||||
CREATE FUNCTION test.f1() returns BIGINT
|
||||
BEGIN
|
||||
DECLARE counter BIGINT DEFAULT NULL;
|
||||
SELECT COUNT(*) INTO counter FROM information_schema.VIEWS;
|
||||
RETURN counter;
|
||||
END//
|
||||
# Attention: The printing of the next result sets is disabled.
|
||||
SELECT * FROM information_schema.VIEWS;
|
||||
SELECT * FROM test.v1;
|
||||
CALL test.p1;
|
||||
SELECT test.f1();
|
||||
DROP VIEW test.v1;
|
||||
DROP PROCEDURE test.p1;
|
||||
DROP FUNCTION test.f1;
|
||||
#########################################################################
|
||||
# Testcase 3.2.13.1: INFORMATION_SCHEMA.VIEWS layout
|
||||
#########################################################################
|
||||
DESCRIBE information_schema.VIEWS;
|
||||
Field Type Null Key Default Extra
|
||||
TABLE_CATALOG varchar(512) YES NULL
|
||||
TABLE_SCHEMA varchar(64) NO
|
||||
TABLE_NAME varchar(64) NO
|
||||
VIEW_DEFINITION longtext NO NULL
|
||||
CHECK_OPTION varchar(8) NO
|
||||
IS_UPDATABLE varchar(3) NO
|
||||
DEFINER varchar(77) NO
|
||||
SECURITY_TYPE varchar(7) NO
|
||||
SHOW CREATE TABLE information_schema.VIEWS;
|
||||
Table Create Table
|
||||
VIEWS CREATE TEMPORARY TABLE `VIEWS` (
|
||||
`TABLE_CATALOG` varchar(512) default NULL,
|
||||
`TABLE_SCHEMA` varchar(64) NOT NULL default '',
|
||||
`TABLE_NAME` varchar(64) NOT NULL default '',
|
||||
`VIEW_DEFINITION` longtext NOT NULL,
|
||||
`CHECK_OPTION` varchar(8) NOT NULL default '',
|
||||
`IS_UPDATABLE` varchar(3) NOT NULL default '',
|
||||
`DEFINER` varchar(77) NOT NULL default '',
|
||||
`SECURITY_TYPE` varchar(7) NOT NULL default ''
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8
|
||||
SHOW COLUMNS FROM information_schema.VIEWS;
|
||||
Field Type Null Key Default Extra
|
||||
TABLE_CATALOG varchar(512) YES NULL
|
||||
TABLE_SCHEMA varchar(64) NO
|
||||
TABLE_NAME varchar(64) NO
|
||||
VIEW_DEFINITION longtext NO NULL
|
||||
CHECK_OPTION varchar(8) NO
|
||||
IS_UPDATABLE varchar(3) NO
|
||||
DEFINER varchar(77) NO
|
||||
SECURITY_TYPE varchar(7) NO
|
||||
SELECT table_catalog, table_schema, table_name
|
||||
FROM information_schema.views WHERE table_catalog IS NOT NULL;
|
||||
table_catalog table_schema table_name
|
||||
################################################################################
|
||||
# Testcase 3.2.13.2 + 3.2.13.3: INFORMATION_SCHEMA.VIEWS accessible information
|
||||
################################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
CREATE USER 'testuser2'@'localhost';
|
||||
DROP USER 'test_no_views'@'localhost';
|
||||
CREATE USER 'test_no_views'@'localhost';
|
||||
CREATE TABLE db_datadict.t1(f1 INT, f2 INT, f3 INT)
|
||||
ENGINE = <engine_type>;
|
||||
CREATE VIEW db_datadict.v_granted_to_1 AS SELECT * FROM db_datadict.t1;
|
||||
CREATE VIEW db_datadict.v_granted_glob AS SELECT f2, f3 FROM db_datadict.t1;
|
||||
GRANT SELECT ON db_datadict.t1 TO 'testuser1'@'localhost';
|
||||
GRANT SELECT ON db_datadict.v_granted_to_1 TO 'testuser1'@'localhost';
|
||||
GRANT SHOW VIEW, CREATE VIEW ON db_datadict.* TO 'testuser2'@'localhost';
|
||||
SELECT * FROM information_schema.views
|
||||
WHERE table_schema = 'db_datadict' ORDER BY table_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
|
||||
NULL db_datadict v_granted_glob /* ALGORITHM=UNDEFINED */ select `db_datadict`.`t1`.`f2` AS `f2`,`db_datadict`.`t1`.`f3` AS `f3` from `db_datadict`.`t1` NONE YES root@localhost DEFINER
|
||||
NULL db_datadict v_granted_to_1 /* ALGORITHM=UNDEFINED */ select `db_datadict`.`t1`.`f1` AS `f1`,`db_datadict`.`t1`.`f2` AS `f2`,`db_datadict`.`t1`.`f3` AS `f3` from `db_datadict`.`t1` NONE YES root@localhost DEFINER
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT * FROM information_schema.views
|
||||
WHERE table_schema = 'db_datadict' ORDER BY table_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
|
||||
NULL db_datadict v_granted_glob NONE YES root@localhost DEFINER
|
||||
NULL db_datadict v_granted_to_1 NONE YES root@localhost DEFINER
|
||||
# Establish connection testuser2 (user=testuser2)
|
||||
SELECT * FROM information_schema.views
|
||||
WHERE table_schema = 'db_datadict' ORDER BY table_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
|
||||
NULL db_datadict v_granted_glob NONE YES root@localhost DEFINER
|
||||
NULL db_datadict v_granted_to_1 NONE YES root@localhost DEFINER
|
||||
# Establish connection test_no_views (user=test_no_views)
|
||||
SELECT * FROM information_schema.views
|
||||
WHERE table_schema = 'db_datadict' ORDER BY table_name;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
|
||||
NULL db_datadict v_granted_glob NONE YES root@localhost DEFINER
|
||||
NULL db_datadict v_granted_to_1 NONE YES root@localhost DEFINER
|
||||
# Switch to connection default and close all other connections
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP USER 'testuser2'@'localhost';
|
||||
DROP USER 'test_no_views'@'localhost';
|
||||
DROP DATABASE db_datadict;
|
||||
#########################################################################
|
||||
# 3.2.1.13+3.2.1.14+3.2.1.15: INFORMATION_SCHEMA.VIEWS modifications
|
||||
#########################################################################
|
||||
DROP TABLE IF EXISTS test.t1_my_table;
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE TABLE test.t1_table (f1 BIGINT, f2 CHAR(10))
|
||||
DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci
|
||||
ENGINE = <engine_type>;
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
CREATE USER 'testuser1'@'localhost';
|
||||
SELECT * FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%';
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
|
||||
CREATE VIEW test.t1_view AS SELECT DISTINCT f1 FROM test.t1_table;
|
||||
SELECT * FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%';
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE
|
||||
NULL test t1_view /* ALGORITHM=UNDEFINED */ select distinct `test`.`t1_table`.`f1` AS `f1` from `test`.`t1_table` NONE NO root@localhost DEFINER
|
||||
SELECT table_name,definer FROM information_schema.views
|
||||
WHERE table_name = 't1_view';
|
||||
table_name definer
|
||||
t1_view root@localhost
|
||||
ALTER DEFINER = 'testuser1'@'localhost' VIEW test.t1_view AS
|
||||
SELECT DISTINCT f1 FROM test.t1_table;
|
||||
SELECT table_name,definer,security_type FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%';
|
||||
table_name definer security_type
|
||||
t1_view testuser1@localhost DEFINER
|
||||
ALTER DEFINER = 'root'@'localhost' SQL SECURITY INVOKER VIEW test.t1_view AS
|
||||
SELECT f1 FROM test.t1_table WITH LOCAL CHECK OPTION;
|
||||
SELECT table_name,definer,security_type FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%';
|
||||
table_name definer security_type
|
||||
t1_view root@localhost INVOKER
|
||||
SELECT table_schema,table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_schema,table_name;
|
||||
table_schema table_name
|
||||
test t1_view
|
||||
RENAME TABLE test.t1_view TO db_datadict.t1_view;
|
||||
ERROR HY000: Changing schema from 'test' to 'db_datadict' is not allowed.
|
||||
DROP VIEW test.t1_view;
|
||||
CREATE VIEW db_datadict.t1_view AS SELECT * FROM test.t1_table;
|
||||
SELECT table_schema,table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_schema,table_name;
|
||||
table_schema table_name
|
||||
db_datadict t1_view
|
||||
SELECT table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
table_name
|
||||
t1_view
|
||||
RENAME TABLE db_datadict.t1_view TO db_datadict.t1_viewx;
|
||||
SELECT table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
table_name
|
||||
t1_viewx
|
||||
SELECT table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
table_name
|
||||
t1_viewx
|
||||
DROP VIEW db_datadict.t1_viewx;
|
||||
SELECT table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
table_name
|
||||
CREATE VIEW db_datadict.t1_view AS SELECT * FROM test.t1_table;
|
||||
SELECT table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
table_name
|
||||
t1_view
|
||||
DROP TABLE test.t1_table;
|
||||
SELECT table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
table_name
|
||||
t1_view
|
||||
Warnings:
|
||||
Warning 1356 View 'db_datadict.t1_view' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
||||
CREATE TABLE test.t1_table (f1 BIGINT, f2 CHAR(10))
|
||||
DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci COMMENT = 'Initial Comment'
|
||||
ENGINE = <engine_type>;
|
||||
SELECT table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
table_name
|
||||
t1_view
|
||||
DROP DATABASE db_datadict;
|
||||
SELECT table_name FROM information_schema.views
|
||||
WHERE table_name LIKE 't1_%'
|
||||
ORDER BY table_name;
|
||||
table_name
|
||||
DROP USER 'testuser1'@'localhost';
|
||||
DROP TABLE test.t1_table;
|
||||
########################################################################
|
||||
# Testcases 3.2.1.3-3.2.1.5 + 3.2.1.8-3.2.1.12: INSERT/UPDATE/DELETE and
|
||||
# DDL on INFORMATION_SCHEMA table are not supported
|
||||
########################################################################
|
||||
DROP DATABASE IF EXISTS db_datadict;
|
||||
CREATE DATABASE db_datadict;
|
||||
CREATE VIEW db_datadict.v1 AS SELECT 1;
|
||||
INSERT INTO information_schema.views
|
||||
SELECT * FROM information_schema.views;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
INSERT INTO information_schema.views(table_schema, table_name)
|
||||
VALUES ('db2', 'v2');
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
UPDATE information_schema.views SET table_schema = 'test'
|
||||
WHERE table_name = 't1';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DELETE FROM information_schema.views WHERE table_name = 't1';
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
TRUNCATE information_schema.views;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CREATE INDEX my_idx_on_views ON information_schema.views(table_schema);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.views DROP PRIMARY KEY;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.views ADD f1 INT;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE information_schema.views;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.views RENAME db_datadict.views;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
ALTER TABLE information_schema.views RENAME information_schema.xviews;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP DATABASE db_datadict;
|
|
@ -1,3 +1,4 @@
|
|||
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
||||
|
||||
NOT YET IMPLEMENTED: bitdata tests
|
||||
--------------------------------------------------------------------------------
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
||||
|
||||
NOT YET IMPLEMENTED: cursor tests
|
||||
--------------------------------------------------------------------------------
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,3 +1,4 @@
|
|||
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
||||
|
||||
--source suite/funcs_1/storedproc/load_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -1445,7 +1446,7 @@ CREATE PROCEDURE sp1 (f1 char(20) )
|
|||
SELECT * from t1 where f2 = f1;
|
||||
show CREATE PROCEDURE sp1;
|
||||
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
|
||||
sp1 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`(f1 char(20) )
|
||||
sp1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`(f1 char(20) )
|
||||
SELECT * from t1 where f2 = f1 latin1 modified created
|
||||
DROP PROCEDURE sp1;
|
||||
|
||||
|
@ -1458,7 +1459,7 @@ CREATE FUNCTION fn1 (s char(20)) returns char(50)
|
|||
return concat('hello, ', s, '!');
|
||||
show CREATE FUNCTION fn1;
|
||||
Function sql_mode Create Function character_set_client collation_connection Database Collation
|
||||
fn1 CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`(s char(20)) RETURNS char(50) CHARSET latin1
|
||||
fn1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`(s char(20)) RETURNS char(50) CHARSET latin1
|
||||
return concat('hello, ', s, '!') latin1 modified created
|
||||
DROP FUNCTION fn1;
|
||||
|
||||
|
@ -1547,14 +1548,14 @@ db name type specific_name language sql_data_access is_deterministic security_ty
|
|||
CREATE PROCEDURE sp9()SELECT * from t1;
|
||||
SELECT * from mysql.proc where specific_name='sp9';
|
||||
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
|
||||
db_storedproc sp9 PROCEDURE sp9 SQL CONTAINS_SQL NO DEFINER SELECT * from t1 root@localhost created modified latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from t1
|
||||
db_storedproc sp9 PROCEDURE sp9 SQL CONTAINS_SQL NO DEFINER SELECT * from t1 root@localhost created modified NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from t1
|
||||
DROP PROCEDURE sp9;
|
||||
SELECT * from mysql.proc where specific_name='sp9';
|
||||
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
|
||||
CREATE PROCEDURE sp9()SELECT * from t1;
|
||||
SELECT * from mysql.proc where specific_name='sp9';
|
||||
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
|
||||
db_storedproc sp9 PROCEDURE sp9 SQL CONTAINS_SQL NO DEFINER SELECT * from t1 root@localhost created modified latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from t1
|
||||
db_storedproc sp9 PROCEDURE sp9 SQL CONTAINS_SQL NO DEFINER SELECT * from t1 root@localhost created modified NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from t1
|
||||
DROP PROCEDURE IF EXISTS sp9;
|
||||
SELECT * from mysql.proc where specific_name='sp9';
|
||||
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
|
||||
|
@ -1571,14 +1572,14 @@ db name type specific_name language sql_data_access is_deterministic security_ty
|
|||
CREATE FUNCTION fn10() returns int return 100;
|
||||
SELECT * from mysql.proc where specific_name='fn10' and type='function';
|
||||
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
|
||||
db_storedproc fn10 FUNCTION fn10 SQL CONTAINS_SQL NO DEFINER int(11) return 100 root@localhost created modified latin1 latin1_swedish_ci latin1_swedish_ci return 100
|
||||
db_storedproc fn10 FUNCTION fn10 SQL CONTAINS_SQL NO DEFINER int(11) return 100 root@localhost created modified NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci return 100
|
||||
DROP FUNCTION fn10;
|
||||
SELECT * from mysql.proc where specific_name='fn10' and type='function';
|
||||
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
|
||||
CREATE FUNCTION fn10() returns int return 100;
|
||||
SELECT * from mysql.proc where specific_name='fn10' and type='function';
|
||||
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
|
||||
db_storedproc fn10 FUNCTION fn10 SQL CONTAINS_SQL NO DEFINER int(11) return 100 root@localhost created modified latin1 latin1_swedish_ci latin1_swedish_ci return 100
|
||||
db_storedproc fn10 FUNCTION fn10 SQL CONTAINS_SQL NO DEFINER int(11) return 100 root@localhost created modified NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci return 100
|
||||
DROP FUNCTION IF EXISTS fn10;
|
||||
SELECT * from mysql.proc where specific_name='fn10' and type='function';
|
||||
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
|
||||
|
@ -3411,12 +3412,12 @@ alter procedure sp1 sql security definer;
|
|||
alter function sp1 sql security definer;
|
||||
show CREATE PROCEDURE sp1;
|
||||
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
|
||||
sp1 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`()
|
||||
sp1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`()
|
||||
COMMENT 'this is a procedure'
|
||||
set @x= 3 latin1 modified created
|
||||
show CREATE FUNCTION sp1;
|
||||
Function sql_mode Create Function character_set_client collation_connection Database Collation
|
||||
sp1 CREATE DEFINER=`root`@`localhost` FUNCTION `sp1`() RETURNS int(11)
|
||||
sp1 NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `sp1`() RETURNS int(11)
|
||||
COMMENT 'this is a function'
|
||||
return 4 latin1 modified created
|
||||
USE db_storedproc;
|
||||
|
@ -14310,6 +14311,8 @@ ERROR 42000: Bad SQLSTATE: '2005-03-03'
|
|||
Testcase 4.2.43:
|
||||
--------------------------------------------------------------------------------
|
||||
DROP PROCEDURE IF EXISTS sp1;
|
||||
expect failure, SQLSTATE 00000 is not an acceptable value
|
||||
for an SP's handler
|
||||
CREATE PROCEDURE sp1()
|
||||
BEGIN
|
||||
declare cond1 condition for sqlstate '00000';
|
||||
|
@ -14317,10 +14320,11 @@ declare continue handler for cond1 set @var2 = 1;
|
|||
set @x=1;
|
||||
SELECT @var2;
|
||||
END//
|
||||
ERROR 42000: Bad SQLSTATE: '00000'
|
||||
ensure SP doesn't exist
|
||||
CALL sp1();
|
||||
@var2
|
||||
NULL
|
||||
DROP PROCEDURE sp1;
|
||||
ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist
|
||||
DROP PROCEDURE IF EXISTS sp1;
|
||||
|
||||
Testcase 4.2.45:
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -14389,16 +14393,19 @@ ERROR 42000: Bad SQLSTATE: '42s0200test'
|
|||
Testcase 4.2.48:
|
||||
--------------------------------------------------------------------------------
|
||||
DROP PROCEDURE IF EXISTS sp1;
|
||||
This creation should fail, SQLSTATE 00000 is unacceptable
|
||||
CREATE PROCEDURE sp1()
|
||||
BEGIN
|
||||
declare continue handler for sqlstate '00000' set @var2 = 1;
|
||||
set @x=1;
|
||||
SELECT @var2;
|
||||
END//
|
||||
ERROR 42000: Bad SQLSTATE: '00000'
|
||||
Verify SP wasn't created
|
||||
CALL sp1();
|
||||
@var2
|
||||
NULL
|
||||
DROP PROCEDURE sp1;
|
||||
ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist
|
||||
DROP PROCEDURE IF EXISTSsp1;
|
||||
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 'EXISTSsp1' at line 1
|
||||
|
||||
Testcase 4.2.52:
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -15973,7 +15980,7 @@ CREATE PROCEDURE d1.sp4()
|
|||
SELECT * from d1.t43;
|
||||
SELECT * from mysql.proc where specific_name = 'sp4';
|
||||
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
|
||||
d1 sp4 PROCEDURE sp4 SQL CONTAINS_SQL NO DEFINER SELECT * from d1.t43 root@localhost modified created latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from d1.t43
|
||||
d1 sp4 PROCEDURE sp4 SQL CONTAINS_SQL NO DEFINER SELECT * from d1.t43 root@localhost modified created NO_ENGINE_SUBSTITUTION latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from d1.t43
|
||||
USE db_storedproc;
|
||||
DROP DATABASE d1;
|
||||
CREATE DATABASE d1;
|
||||
|
@ -16023,7 +16030,7 @@ USE d2;
|
|||
alter procedure d1.sp8 sql security definer comment 'updated';
|
||||
SELECT * from mysql.proc where specific_name='sp8' and db='d1';
|
||||
db name type specific_name language sql_data_access is_deterministic security_type param_list returns body definer created modified sql_mode comment character_set_client collation_connection db_collation body_utf8
|
||||
d1 sp8 PROCEDURE sp8 SQL CONTAINS_SQL NO DEFINER n char(20) SELECT * from t1 where t1.f1 = n root@localhost modified created updated latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from t1 where t1.f1 = n
|
||||
d1 sp8 PROCEDURE sp8 SQL CONTAINS_SQL NO DEFINER n char(20) SELECT * from t1 where t1.f1 = n root@localhost modified created NO_ENGINE_SUBSTITUTION updated latin1 latin1_swedish_ci latin1_swedish_ci SELECT * from t1 where t1.f1 = n
|
||||
|
||||
Testcase 4.4.9:
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -16044,7 +16051,7 @@ d1 fn2 FUNCTION fn2 SQL CONTAINS_SQL NO DEFINER n int int(11) BEGIN
|
|||
declare a int;
|
||||
set a = 0.9 * n;
|
||||
return a;
|
||||
END root@localhost modified created updated latin1 latin1_swedish_ci latin1_swedish_ci BEGIN
|
||||
END root@localhost modified created NO_ENGINE_SUBSTITUTION updated latin1 latin1_swedish_ci latin1_swedish_ci BEGIN
|
||||
declare a int;
|
||||
set a = 0.9 * n;
|
||||
return a;
|
||||
|
@ -23502,6 +23509,7 @@ set x1 = 2;
|
|||
END;
|
||||
SELECT @x, x1;
|
||||
END//
|
||||
ERROR 42000: Bad SQLSTATE: '00000'
|
||||
DROP PROCEDURE IF EXISTS h1;
|
||||
|
||||
Testcase 4.11.40:
|
||||
|
@ -23539,9 +23547,9 @@ set x1 = 2;
|
|||
END;
|
||||
SELECT @x, x1;
|
||||
END//
|
||||
ERROR 42000: Bad SQLSTATE: '00000'
|
||||
CALL h1();
|
||||
@x x1
|
||||
0 2
|
||||
ERROR 42000: PROCEDURE db_storedproc.h1 does not exist
|
||||
DROP PROCEDURE IF EXISTS h1;
|
||||
|
||||
* Testcase 3.1.2.53 (4.11.42):
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
||||
|
||||
--source suite/funcs_1/storedproc/load_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -583,6 +584,7 @@ END//
|
|||
CALL h1();
|
||||
x1 x2 x3 x4 x5 x6
|
||||
1 1 1 1 1 1
|
||||
This will fail, SQLSTATE 00000 is not allowed
|
||||
CREATE PROCEDURE sp1()
|
||||
begin1_label:BEGIN
|
||||
declare exit handler for sqlstate '00000' set @var1 = 5;
|
||||
|
@ -594,14 +596,13 @@ SELECT @var3, @var4;
|
|||
END begin2_label;
|
||||
SELECT @var1, @var2;
|
||||
END begin1_label//
|
||||
ERROR 42000: Bad SQLSTATE: '00000'
|
||||
Verify SP wasn't created
|
||||
CALL sp1();
|
||||
@var3 @var4
|
||||
NULL 8
|
||||
@var1 @var2
|
||||
NULL 6
|
||||
ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist
|
||||
DROP PROCEDURE p1;
|
||||
DROP PROCEDURE h1;
|
||||
DROP PROCEDURE sp1;
|
||||
DROP PROCEDURE IF EXISTS sp1;
|
||||
DROP TABLE res_t1;
|
||||
|
||||
Testcase 3.1.2.50:
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
||||
|
||||
--source suite/funcs_1/storedproc/load_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
||||
|
||||
--source suite/funcs_1/storedproc/load_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -169,7 +170,7 @@ ROUTINE_DEFINITION NULL
|
|||
IS_DETERMINISTIC NO
|
||||
SQL_DATA_ACCESS CONTAINS SQL
|
||||
SECURITY_TYPE DEFINER
|
||||
SQL_MODE
|
||||
SQL_MODE NO_ENGINE_SUBSTITUTION
|
||||
ROUTINE_COMMENT
|
||||
|
||||
root@localhost db_storedproc_1
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
||||
|
||||
--source suite/funcs_1/storedproc/load_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
||||
|
||||
--source suite/funcs_1/storedproc/load_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -125,7 +126,7 @@ SQL_PATH NULL
|
|||
SECURITY_TYPE DEFINER
|
||||
CREATED <modified>
|
||||
LAST_ALTERED <created>
|
||||
SQL_MODE
|
||||
SQL_MODE NO_ENGINE_SUBSTITUTION
|
||||
ROUTINE_COMMENT
|
||||
DEFINER root@localhost
|
||||
CHARACTER_SET_CLIENT latin1
|
||||
|
@ -152,7 +153,7 @@ SQL_PATH NULL
|
|||
SECURITY_TYPE INVOKER
|
||||
CREATED <modified>
|
||||
LAST_ALTERED <created>
|
||||
SQL_MODE
|
||||
SQL_MODE NO_ENGINE_SUBSTITUTION
|
||||
ROUTINE_COMMENT created with INVOKER
|
||||
DEFINER root@localhost
|
||||
CHARACTER_SET_CLIENT latin1
|
||||
|
@ -177,7 +178,7 @@ SQL_PATH NULL
|
|||
SECURITY_TYPE DEFINER
|
||||
CREATED <modified>
|
||||
LAST_ALTERED <created>
|
||||
SQL_MODE
|
||||
SQL_MODE NO_ENGINE_SUBSTITUTION
|
||||
ROUTINE_COMMENT
|
||||
DEFINER root@localhost
|
||||
CHARACTER_SET_CLIENT latin1
|
||||
|
@ -202,7 +203,7 @@ SQL_PATH NULL
|
|||
SECURITY_TYPE INVOKER
|
||||
CREATED <modified>
|
||||
LAST_ALTERED <created>
|
||||
SQL_MODE
|
||||
SQL_MODE NO_ENGINE_SUBSTITUTION
|
||||
ROUTINE_COMMENT created with INVOKER
|
||||
DEFINER root@localhost
|
||||
CHARACTER_SET_CLIENT latin1
|
||||
|
@ -210,7 +211,7 @@ COLLATION_CONNECTION latin1_swedish_ci
|
|||
DATABASE_COLLATION latin1_swedish_ci
|
||||
SHOW CREATE FUNCTION fn_1;
|
||||
Function fn_1
|
||||
sql_mode
|
||||
sql_mode NO_ENGINE_SUBSTITUTION
|
||||
Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4)
|
||||
BEGIN
|
||||
set @x=i1;
|
||||
|
@ -222,7 +223,7 @@ collation_connection latin1_swedish_ci
|
|||
Database Collation latin1_swedish_ci
|
||||
SHOW CREATE FUNCTION fn_2;
|
||||
Function fn_2
|
||||
sql_mode
|
||||
sql_mode NO_ENGINE_SUBSTITUTION
|
||||
Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4)
|
||||
SQL SECURITY INVOKER
|
||||
COMMENT 'created with INVOKER'
|
||||
|
@ -236,7 +237,7 @@ collation_connection latin1_swedish_ci
|
|||
Database Collation latin1_swedish_ci
|
||||
SHOW CREATE PROCEDURE sp_1;
|
||||
Procedure sp_1
|
||||
sql_mode
|
||||
sql_mode NO_ENGINE_SUBSTITUTION
|
||||
Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
|
||||
BEGIN
|
||||
set @x=i1;
|
||||
|
@ -246,7 +247,7 @@ collation_connection latin1_swedish_ci
|
|||
Database Collation latin1_swedish_ci
|
||||
SHOW CREATE PROCEDURE sp_2;
|
||||
Procedure sp_2
|
||||
sql_mode
|
||||
sql_mode NO_ENGINE_SUBSTITUTION
|
||||
Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
|
||||
SQL SECURITY INVOKER
|
||||
COMMENT 'created with INVOKER'
|
||||
|
@ -343,7 +344,7 @@ SQL_PATH NULL
|
|||
SECURITY_TYPE INVOKER
|
||||
CREATED <modified>
|
||||
LAST_ALTERED <created>
|
||||
SQL_MODE
|
||||
SQL_MODE NO_ENGINE_SUBSTITUTION
|
||||
ROUTINE_COMMENT new comment, FN changed to INVOKER
|
||||
DEFINER root@localhost
|
||||
CHARACTER_SET_CLIENT latin1
|
||||
|
@ -370,7 +371,7 @@ SQL_PATH NULL
|
|||
SECURITY_TYPE DEFINER
|
||||
CREATED <modified>
|
||||
LAST_ALTERED <created>
|
||||
SQL_MODE
|
||||
SQL_MODE NO_ENGINE_SUBSTITUTION
|
||||
ROUTINE_COMMENT FN changed to DEFINER
|
||||
DEFINER root@localhost
|
||||
CHARACTER_SET_CLIENT latin1
|
||||
|
@ -395,7 +396,7 @@ SQL_PATH NULL
|
|||
SECURITY_TYPE INVOKER
|
||||
CREATED <modified>
|
||||
LAST_ALTERED <created>
|
||||
SQL_MODE
|
||||
SQL_MODE NO_ENGINE_SUBSTITUTION
|
||||
ROUTINE_COMMENT new comment, SP changed to INVOKER
|
||||
DEFINER root@localhost
|
||||
CHARACTER_SET_CLIENT latin1
|
||||
|
@ -420,7 +421,7 @@ SQL_PATH NULL
|
|||
SECURITY_TYPE DEFINER
|
||||
CREATED <modified>
|
||||
LAST_ALTERED <created>
|
||||
SQL_MODE
|
||||
SQL_MODE NO_ENGINE_SUBSTITUTION
|
||||
ROUTINE_COMMENT SP changed to DEFINER
|
||||
DEFINER root@localhost
|
||||
CHARACTER_SET_CLIENT latin1
|
||||
|
@ -428,7 +429,7 @@ COLLATION_CONNECTION latin1_swedish_ci
|
|||
DATABASE_COLLATION latin1_swedish_ci
|
||||
SHOW CREATE FUNCTION fn_1;
|
||||
Function fn_1
|
||||
sql_mode
|
||||
sql_mode NO_ENGINE_SUBSTITUTION
|
||||
Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4)
|
||||
NO SQL
|
||||
SQL SECURITY INVOKER
|
||||
|
@ -443,7 +444,7 @@ collation_connection latin1_swedish_ci
|
|||
Database Collation latin1_swedish_ci
|
||||
SHOW CREATE FUNCTION fn_2;
|
||||
Function fn_2
|
||||
sql_mode
|
||||
sql_mode NO_ENGINE_SUBSTITUTION
|
||||
Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4)
|
||||
MODIFIES SQL DATA
|
||||
COMMENT 'FN changed to DEFINER'
|
||||
|
@ -457,7 +458,7 @@ collation_connection latin1_swedish_ci
|
|||
Database Collation latin1_swedish_ci
|
||||
SHOW CREATE PROCEDURE sp_1;
|
||||
Procedure sp_1
|
||||
sql_mode
|
||||
sql_mode NO_ENGINE_SUBSTITUTION
|
||||
Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
|
||||
SQL SECURITY INVOKER
|
||||
COMMENT 'new comment, SP changed to INVOKER'
|
||||
|
@ -469,7 +470,7 @@ collation_connection latin1_swedish_ci
|
|||
Database Collation latin1_swedish_ci
|
||||
SHOW CREATE PROCEDURE sp_2;
|
||||
Procedure sp_2
|
||||
sql_mode
|
||||
sql_mode NO_ENGINE_SUBSTITUTION
|
||||
Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
|
||||
READS SQL DATA
|
||||
COMMENT 'SP changed to DEFINER'
|
||||
|
@ -554,7 +555,7 @@ SQL_PATH NULL
|
|||
SECURITY_TYPE INVOKER
|
||||
CREATED <modified>
|
||||
LAST_ALTERED <created>
|
||||
SQL_MODE
|
||||
SQL_MODE NO_ENGINE_SUBSTITUTION
|
||||
ROUTINE_COMMENT new comment, FN changed to INVOKER
|
||||
DEFINER root@localhost
|
||||
CHARACTER_SET_CLIENT latin1
|
||||
|
@ -581,7 +582,7 @@ SQL_PATH NULL
|
|||
SECURITY_TYPE DEFINER
|
||||
CREATED <modified>
|
||||
LAST_ALTERED <created>
|
||||
SQL_MODE
|
||||
SQL_MODE NO_ENGINE_SUBSTITUTION
|
||||
ROUTINE_COMMENT FN changed to DEFINER
|
||||
DEFINER root@localhost
|
||||
CHARACTER_SET_CLIENT latin1
|
||||
|
@ -606,7 +607,7 @@ SQL_PATH NULL
|
|||
SECURITY_TYPE INVOKER
|
||||
CREATED <modified>
|
||||
LAST_ALTERED <created>
|
||||
SQL_MODE
|
||||
SQL_MODE NO_ENGINE_SUBSTITUTION
|
||||
ROUTINE_COMMENT new comment, SP changed to INVOKER
|
||||
DEFINER root@localhost
|
||||
CHARACTER_SET_CLIENT latin1
|
||||
|
@ -631,7 +632,7 @@ SQL_PATH NULL
|
|||
SECURITY_TYPE DEFINER
|
||||
CREATED <modified>
|
||||
LAST_ALTERED <created>
|
||||
SQL_MODE
|
||||
SQL_MODE NO_ENGINE_SUBSTITUTION
|
||||
ROUTINE_COMMENT SP changed to DEFINER
|
||||
DEFINER root@localhost
|
||||
CHARACTER_SET_CLIENT latin1
|
||||
|
@ -639,7 +640,7 @@ COLLATION_CONNECTION latin1_swedish_ci
|
|||
DATABASE_COLLATION latin1_swedish_ci
|
||||
SHOW CREATE FUNCTION fn_1;
|
||||
Function fn_1
|
||||
sql_mode
|
||||
sql_mode NO_ENGINE_SUBSTITUTION
|
||||
Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_1`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4)
|
||||
NO SQL
|
||||
SQL SECURITY INVOKER
|
||||
|
@ -654,7 +655,7 @@ collation_connection latin1_swedish_ci
|
|||
Database Collation latin1_swedish_ci
|
||||
SHOW CREATE FUNCTION fn_2;
|
||||
Function fn_2
|
||||
sql_mode
|
||||
sql_mode NO_ENGINE_SUBSTITUTION
|
||||
Create Function CREATE DEFINER=`root`@`localhost` FUNCTION `fn_2`(i1 longtext, i2 mediumint , i3 longblob, i4 year, i5 real) RETURNS year(4)
|
||||
COMMENT 'FN changed to DEFINER'
|
||||
BEGIN
|
||||
|
@ -667,7 +668,7 @@ collation_connection latin1_swedish_ci
|
|||
Database Collation latin1_swedish_ci
|
||||
SHOW CREATE PROCEDURE sp_1;
|
||||
Procedure sp_1
|
||||
sql_mode
|
||||
sql_mode NO_ENGINE_SUBSTITUTION
|
||||
Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
|
||||
SQL SECURITY INVOKER
|
||||
COMMENT 'new comment, SP changed to INVOKER'
|
||||
|
@ -679,7 +680,7 @@ collation_connection latin1_swedish_ci
|
|||
Database Collation latin1_swedish_ci
|
||||
SHOW CREATE PROCEDURE sp_2;
|
||||
Procedure sp_2
|
||||
sql_mode
|
||||
sql_mode NO_ENGINE_SUBSTITUTION
|
||||
Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
|
||||
READS SQL DATA
|
||||
COMMENT 'SP changed to DEFINER'
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
||||
|
||||
--source suite/funcs_1/storedproc/load_sp_tb.inc
|
||||
--------------------------------------------------------------------------------
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
||||
USE test;
|
||||
drop table if exists tb3;
|
||||
create table tb3 (
|
||||
|
@ -53,13 +54,11 @@ f172 numeric zerofill,
|
|||
f173 numeric unsigned zerofill,
|
||||
f174 numeric (0),
|
||||
f175 numeric (64)
|
||||
) engine = memory;
|
||||
) engine = <engine_to_be_used>;
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'f150' at row 1
|
||||
Note 1265 Data truncated for column 'f151' at row 1
|
||||
Note 1265 Data truncated for column 'f152' at row 1
|
||||
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
|
||||
into table tb3;
|
||||
|
||||
Testcase: 3.5.1.1:
|
||||
------------------
|
||||
|
@ -188,7 +187,7 @@ Testcase 3.5.1.7: - need to fix
|
|||
drop table if exists t1;
|
||||
Warnings:
|
||||
Note 1051 Unknown table 't1'
|
||||
create table t1 (f1 int, f2 char(25),f3 int) engine=memory;
|
||||
create table t1 (f1 int, f2 char(25),f3 int) engine = <engine_to_be_used>;
|
||||
CREATE TRIGGER trg5_1 BEFORE INSERT on test.t1
|
||||
for each row set new.f3 = '14';
|
||||
CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
|
@ -232,7 +231,7 @@ ERROR HY000: Trigger in wrong schema
|
|||
drop database if exists trig_db;
|
||||
create database trig_db;
|
||||
use trig_db;
|
||||
create table t1 (f1 integer) engine = memory;
|
||||
create table t1 (f1 integer) engine = <engine_to_be_used>;
|
||||
use test;
|
||||
CREATE TRIGGER trig_db.trg6_2 AFTER INSERT on tb3
|
||||
for each row set @ret_trg6_2 = 5;
|
||||
|
@ -260,8 +259,8 @@ Testcase 3.5.1.?:
|
|||
-----------------
|
||||
drop table if exists t1;
|
||||
drop table if exists t2;
|
||||
create table t1 (f1 char(50), f2 integer) engine = memory;
|
||||
create table t2 (f1 char(50), f2 integer) engine = memory;
|
||||
create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
|
||||
create table t2 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
|
||||
create trigger trig before insert on t1
|
||||
for each row set new.f1 ='trig t1';
|
||||
create trigger trig before update on t2
|
||||
|
@ -293,15 +292,15 @@ create database trig_db1;
|
|||
create database trig_db2;
|
||||
create database trig_db3;
|
||||
use trig_db1;
|
||||
create table t1 (f1 char(50), f2 integer) engine = memory;
|
||||
create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
|
||||
create trigger trig before insert on t1
|
||||
for each row set new.f1 ='trig1', @test_var1='trig1';
|
||||
use trig_db2;
|
||||
create table t2 (f1 char(50), f2 integer) engine = memory;
|
||||
create table t2 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
|
||||
create trigger trig before insert on t2
|
||||
for each row set new.f1 ='trig2', @test_var2='trig2';
|
||||
use trig_db3;
|
||||
create table t1 (f1 char(50), f2 integer) engine = memory;
|
||||
create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
|
||||
create trigger trig before insert on t1
|
||||
for each row set new.f1 ='trig3', @test_var3='trig3';
|
||||
set @test_var1= '', @test_var2= '', @test_var3= '';
|
||||
|
@ -339,8 +338,8 @@ drop database if exists trig_db2;
|
|||
create database trig_db1;
|
||||
create database trig_db2;
|
||||
use trig_db1;
|
||||
create table t1 (f1 char(50), f2 integer) engine = memory;
|
||||
create table trig_db2.t1 (f1 char(50), f2 integer) engine = memory;
|
||||
create table t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
|
||||
create table trig_db2.t1 (f1 char(50), f2 integer) engine = <engine_to_be_used>;
|
||||
create trigger trig1_b before insert on t1
|
||||
for each row set @test_var1='trig1_b';
|
||||
create trigger trig_db1.trig1_a after insert on t1
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
||||
USE test;
|
||||
drop table if exists tb3;
|
||||
create table tb3 (
|
||||
|
@ -53,20 +54,18 @@ f172 numeric zerofill,
|
|||
f173 numeric unsigned zerofill,
|
||||
f174 numeric (0),
|
||||
f175 numeric (64)
|
||||
) engine = memory;
|
||||
) engine = <engine_to_be_used>;
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'f150' at row 1
|
||||
Note 1265 Data truncated for column 'f151' at row 1
|
||||
Note 1265 Data truncated for column 'f152' at row 1
|
||||
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
|
||||
into table tb3;
|
||||
|
||||
Testcase 3.5.3:
|
||||
---------------
|
||||
drop database if exists priv_db;
|
||||
create database priv_db;
|
||||
use priv_db;
|
||||
create table t1 (f1 char(20)) engine= memory;
|
||||
create table t1 (f1 char(20)) engine= <engine_to_be_used>;
|
||||
create User test_noprivs@localhost;
|
||||
set password for test_noprivs@localhost = password('PWD');
|
||||
create User test_yesprivs@localhost;
|
||||
|
@ -602,8 +601,8 @@ Testcase: 3.5.3.x:
|
|||
use priv_db;
|
||||
drop table if exists t1;
|
||||
drop table if exists t2;
|
||||
create table t1 (f1 int) engine= memory;
|
||||
create table t2 (f2 int) engine= memory;
|
||||
create table t1 (f1 int) engine= <engine_to_be_used>;
|
||||
create table t2 (f2 int) engine= <engine_to_be_used>;
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT, UPDATE on priv_db.t1 to test_yesprivs@localhost;
|
||||
|
@ -692,4 +691,5 @@ drop database if exists priv_db;
|
|||
drop user test_yesprivs@localhost;
|
||||
drop user test_noprivs@localhost;
|
||||
drop user test_noprivs;
|
||||
DROP TABLE test.tb3;
|
||||
use test;
|
||||
drop table tb3;
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
||||
USE test;
|
||||
|
||||
Testcase for db level:
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
||||
USE test;
|
||||
drop table if exists tb3;
|
||||
create table tb3 (
|
||||
|
@ -53,13 +54,11 @@ f172 numeric zerofill,
|
|||
f173 numeric unsigned zerofill,
|
||||
f174 numeric (0),
|
||||
f175 numeric (64)
|
||||
) engine = memory;
|
||||
) engine = <engine_to_be_used>;
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'f150' at row 1
|
||||
Note 1265 Data truncated for column 'f151' at row 1
|
||||
Note 1265 Data truncated for column 'f152' at row 1
|
||||
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
|
||||
into table tb3;
|
||||
|
||||
Testcase: 3.5:
|
||||
--------------
|
||||
|
@ -80,7 +79,7 @@ Testcase 3.5.4.1:
|
|||
-----------------
|
||||
create database db_drop;
|
||||
Use db_drop;
|
||||
create table t1 (f1 char(30)) engine=memory;
|
||||
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
|
||||
grant INSERT, SELECT on db_drop.t1 to test_general;
|
||||
Use db_drop;
|
||||
Create trigger trg1 BEFORE INSERT on t1
|
||||
|
@ -108,7 +107,7 @@ Testcase 3.5.4.2:
|
|||
create database db_drop2;
|
||||
Use db_drop2;
|
||||
drop table if exists t1_432 ;
|
||||
create table t1_432 (f1 char (30)) engine=memory;
|
||||
create table t1_432 (f1 char (30)) engine = <engine_to_be_used>;
|
||||
Drop trigger tr_does_not_exit;
|
||||
ERROR HY000: Trigger does not exist
|
||||
drop table if exists t1_432 ;
|
||||
|
@ -120,8 +119,8 @@ create database db_drop3;
|
|||
Use db_drop3;
|
||||
drop table if exists t1_433 ;
|
||||
drop table if exists t1_433a ;
|
||||
create table t1_433 (f1 char (30)) engine=memory;
|
||||
create table t1_433a (f1a char (5)) engine=memory;
|
||||
create table t1_433 (f1 char (30)) engine = <engine_to_be_used>;
|
||||
create table t1_433a (f1a char (5)) engine = <engine_to_be_used>;
|
||||
CREATE TRIGGER trg3 BEFORE INSERT on t1_433 for each row
|
||||
set new.f1 = 'Trigger 3.5.4.3';
|
||||
Drop trigger t1.433.trg3;
|
||||
|
@ -141,7 +140,7 @@ Testcase 3.5.4.4:
|
|||
-----------------
|
||||
create database db_drop4;
|
||||
Use db_drop4;
|
||||
create table t1 (f1 char(30)) engine=memory;
|
||||
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
|
||||
grant INSERT, SELECT on db_drop4.t1 to test_general;
|
||||
Create trigger trg4 BEFORE INSERT on t1
|
||||
for each row set new.f1='Trigger 3.5.4.4';
|
||||
|
@ -162,7 +161,7 @@ where information_schema.triggers.trigger_name='trg4';
|
|||
trigger_schema trigger_name event_object_table
|
||||
create database db_drop4;
|
||||
Use db_drop4;
|
||||
create table t1 (f1 char(30)) engine=memory;
|
||||
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
|
||||
grant INSERT, SELECT on db_drop4.t1 to test_general;
|
||||
Insert into t1 values ('2nd Insert 3.5.4.4');
|
||||
Select * from t1;
|
||||
|
@ -177,7 +176,7 @@ Testcase 3.5.4.5:
|
|||
-----------------
|
||||
create database db_drop5;
|
||||
Use db_drop5;
|
||||
create table t1 (f1 char(50)) engine=memory;
|
||||
create table t1 (f1 char(50)) engine = <engine_to_be_used>;
|
||||
grant INSERT, SELECT on t1 to test_general;
|
||||
Create trigger trg5 BEFORE INSERT on t1
|
||||
for each row set new.f1='Trigger 3.5.4.5';
|
||||
|
@ -193,7 +192,7 @@ select trigger_schema, trigger_name, event_object_table
|
|||
from information_schema.triggers
|
||||
where information_schema.triggers.trigger_name='trg5';
|
||||
trigger_schema trigger_name event_object_table
|
||||
create table t1 (f1 char(50)) engine=memory;
|
||||
create table t1 (f1 char(50)) engine = <engine_to_be_used>;
|
||||
grant INSERT, SELECT on t1 to test_general;
|
||||
Insert into t1 values ('2nd Insert 3.5.4.5');
|
||||
Select * from t1;
|
||||
|
@ -234,7 +233,7 @@ Testcase 3.5.5.4:
|
|||
create database dbtest_one;
|
||||
create database dbtest_two;
|
||||
use dbtest_two;
|
||||
create table t2 (f1 char(15)) engine=memory;
|
||||
create table t2 (f1 char(15)) engine = <engine_to_be_used>;
|
||||
use dbtest_one;
|
||||
create trigger trg4 before INSERT
|
||||
on dbtest_two.t2 for each row set new.f1='trig 3.5.5.4';
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
||||
USE test;
|
||||
drop table if exists tb3;
|
||||
create table tb3 (
|
||||
|
@ -53,13 +54,11 @@ f172 numeric zerofill,
|
|||
f173 numeric unsigned zerofill,
|
||||
f174 numeric (0),
|
||||
f175 numeric (64)
|
||||
) engine = memory;
|
||||
) engine = <engine_to_be_used>;
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'f150' at row 1
|
||||
Note 1265 Data truncated for column 'f151' at row 1
|
||||
Note 1265 Data truncated for column 'f152' at row 1
|
||||
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
|
||||
into table tb3;
|
||||
|
||||
Testcase: 3.5:
|
||||
--------------
|
||||
|
@ -88,17 +87,17 @@ create table t1_i (
|
|||
i120 char ascii not null DEFAULT b'101',
|
||||
i136 smallint zerofill not null DEFAULT 999,
|
||||
i144 int zerofill not null DEFAULT 99999,
|
||||
i163 decimal (63,30)) engine=memory;
|
||||
i163 decimal (63,30)) engine=<engine_to_be_used>;
|
||||
create table t1_u (
|
||||
u120 char ascii not null DEFAULT b'101',
|
||||
u136 smallint zerofill not null DEFAULT 999,
|
||||
u144 int zerofill not null DEFAULT 99999,
|
||||
u163 decimal (63,30)) engine=memory;
|
||||
u163 decimal (63,30)) engine=<engine_to_be_used>;
|
||||
create table t1_d (
|
||||
d120 char ascii not null DEFAULT b'101',
|
||||
d136 smallint zerofill not null DEFAULT 999,
|
||||
d144 int zerofill not null DEFAULT 99999,
|
||||
d163 decimal (63,30)) engine=memory;
|
||||
d163 decimal (63,30)) engine=<engine_to_be_used>;
|
||||
Insert into t1_u values ('a',111,99999,999.99);
|
||||
Insert into t1_u values ('b',222,99999,999.99);
|
||||
Insert into t1_u values ('c',333,99999,999.99);
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
||||
USE test;
|
||||
drop table if exists tb3;
|
||||
create table tb3 (
|
||||
|
@ -53,7 +54,7 @@ f172 numeric zerofill,
|
|||
f173 numeric unsigned zerofill,
|
||||
f174 numeric (0),
|
||||
f175 numeric (64)
|
||||
) engine = memory;
|
||||
) engine = <engine_to_be_used>;
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'f150' at row 1
|
||||
Note 1265 Data truncated for column 'f151' at row 1
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue