Merge branch '10.2' into bb-10.2-ext

This commit is contained in:
Sergei Golubchik 2017-08-25 10:25:48 +02:00
commit 27412877db
585 changed files with 79328 additions and 12271 deletions
CMakeLists.txtREADME.mdVERSION
client
cmake
debian
extra/mariabackup
include
libmariadb
libmysqld
mysql-test
CMakeLists.txt
include
lib/My/SafeProcess
mysql-test-run.pl
r
std_data
suite

View file

@ -363,7 +363,7 @@ ENDIF()
SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "")
# mariadb_connector_c fetches submodules which is useful for plugins
INCLUDE(submodules)
INCLUDE(mariadb_connector_c) # this does ADD_SUBDIRECTORY(libmariadb)
# Add storage engines and plugins.
@ -460,7 +460,6 @@ INSTALL_DOCUMENTATION(README.md CREDITS COPYING COPYING.thirdparty
# ${CMAKE_BINARY_DIR}/Docs/INFO_BIN)
IF(UNIX)
INSTALL_DOCUMENTATION(Docs/INSTALL-BINARY COMPONENT Readme)
INSTALL_DOCUMENTATION(Docs/INSTALL-BINARY Docs/README-wsrep COMPONENT Readme)
ENDIF()

View file

@ -8,7 +8,7 @@ Please read the CREDITS file for details about the MariaDB Foundation,
and who is developing MariaDB.
MariaDB is developed by many of the original developers of MySQL who
now work for the MariadB Foundation and the MariaDB Corporation, and by many people in
now work for the MariaDB Foundation and the MariaDB Corporation, and by many people in
the community.
MySQL, which is the base of MariaDB, is a product and trademark of Oracle

View file

@ -1,3 +1,3 @@
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=2
MYSQL_VERSION_PATCH=8
MYSQL_VERSION_PATCH=9

View file

@ -149,7 +149,7 @@ static my_bool ignore_errors=0,wait_flag=0,quick=0,
default_pager_set= 0, opt_sigint_ignore= 0,
auto_vertical_output= 0,
show_warnings= 0, executing_query= 0,
ignore_spaces= 0, opt_progress_reports;
ignore_spaces= 0, opt_binhex= 0, opt_progress_reports;
static my_bool debug_info_flag, debug_check_flag, batch_abort_on_error;
static my_bool column_types_flag;
static my_bool preserve_comments= 0;
@ -1496,6 +1496,8 @@ static struct my_option my_long_options[] =
{"batch", 'B',
"Don't use history file. Disable interactive behavior. (Enables --silent.)",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"binary-as-hex", 'b', "Print binary data as hex", &opt_binhex, &opt_binhex,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
"Directory for character set files.", &charsets_dir,
&charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@ -3318,7 +3320,8 @@ com_go(String *buffer,char *line __attribute__((unused)))
print_table_data_html(result);
else if (opt_xml)
print_table_data_xml(result);
else if (vertical || (auto_vertical_output && (terminal_width < get_result_width(result))))
else if (vertical || (auto_vertical_output &&
(terminal_width < get_result_width(result))))
print_table_data_vertically(result);
else if (opt_silent && verbose <= 2 && !output_tables)
print_tab_data(result);
@ -3536,6 +3539,41 @@ print_field_types(MYSQL_RES *result)
}
/* Used to determine if we should invoke print_as_hex for this field */
static bool
is_binary_field(MYSQL_FIELD *field)
{
if ((field->charsetnr == 63) &&
(field->type == MYSQL_TYPE_BIT ||
field->type == MYSQL_TYPE_BLOB ||
field->type == MYSQL_TYPE_LONG_BLOB ||
field->type == MYSQL_TYPE_MEDIUM_BLOB ||
field->type == MYSQL_TYPE_TINY_BLOB ||
field->type == MYSQL_TYPE_VAR_STRING ||
field->type == MYSQL_TYPE_STRING ||
field->type == MYSQL_TYPE_VARCHAR ||
field->type == MYSQL_TYPE_GEOMETRY))
return 1;
return 0;
}
/* Print binary value as hex literal (0x ...) */
static void
print_as_hex(FILE *output_file, const char *str, ulong len, ulong total_bytes_to_send)
{
const char *ptr= str, *end= ptr+len;
ulong i;
fprintf(output_file, "0x");
for(; ptr < end; ptr++)
fprintf(output_file, "%02X", *((uchar*)ptr));
for (i= 2*len+2; i < total_bytes_to_send; i++)
tee_putc((int)' ', output_file);
}
static void
print_table_data(MYSQL_RES *result)
{
@ -3562,6 +3600,8 @@ print_table_data(MYSQL_RES *result)
length= MY_MAX(length,field->max_length);
if (length < 4 && !IS_NOT_NULL(field->flags))
length=4; // Room for "NULL"
if (opt_binhex && is_binary_field(field))
length= 2 + length * 2;
field->max_length=length;
num_flag[mysql_field_tell(result) - 1]= IS_NUM(field->type);
separator.fill(separator.length()+length+2,'-');
@ -3629,9 +3669,11 @@ print_table_data(MYSQL_RES *result)
many extra padding-characters we should send with the printing function.
*/
visible_length= charset_info->cset->numcells(charset_info, buffer, buffer + data_length);
extra_padding= data_length - visible_length;
extra_padding= (uint) (data_length - visible_length);
if (field_max_length > MAX_COLUMN_LENGTH)
if (opt_binhex && is_binary_field(field))
print_as_hex(PAGER, cur[off], lengths[off], field_max_length);
else if (field_max_length > MAX_COLUMN_LENGTH)
tee_print_sized_data(buffer, data_length, MAX_COLUMN_LENGTH+extra_padding, FALSE);
else
{
@ -3765,11 +3807,15 @@ print_table_data_html(MYSQL_RES *result)
if (interrupted_query)
break;
ulong *lengths=mysql_fetch_lengths(result);
field= mysql_fetch_fields(result);
(void) tee_fputs("<TR>", PAGER);
for (uint i=0; i < mysql_num_fields(result); i++)
{
(void) tee_fputs("<TD>", PAGER);
xmlencode_print(cur[i], lengths[i]);
if (opt_binhex && is_binary_field(&field[i]))
print_as_hex(PAGER, cur[i], lengths[i], lengths[i]);
else
xmlencode_print(cur[i], lengths[i]);
(void) tee_fputs("</TD>", PAGER);
}
(void) tee_fputs("</TR>", PAGER);
@ -3805,7 +3851,10 @@ print_table_data_xml(MYSQL_RES *result)
if (cur[i])
{
tee_fprintf(PAGER, "\">");
xmlencode_print(cur[i], lengths[i]);
if (opt_binhex && is_binary_field(&fields[i]))
print_as_hex(PAGER, cur[i], lengths[i], lengths[i]);
else
xmlencode_print(cur[i], lengths[i]);
tee_fprintf(PAGER, "</field>\n");
}
else
@ -3852,13 +3901,19 @@ print_table_data_vertically(MYSQL_RES *result)
{
unsigned int i;
const char *p;
if (opt_binhex && is_binary_field(field))
fprintf(PAGER, "0x");
for (i= 0, p= cur[off]; i < lengths[off]; i+= 1, p+= 1)
{
if (*p == '\0')
tee_putc((int)' ', PAGER);
if (opt_binhex && is_binary_field(field))
fprintf(PAGER, "%02X", *((uchar*)p));
else
tee_putc((int)*p, PAGER);
{
if (*p == '\0')
tee_putc((int)' ', PAGER);
else
tee_putc((int)*p, PAGER);
}
}
tee_putc('\n', PAGER);
}
@ -3868,7 +3923,6 @@ print_table_data_vertically(MYSQL_RES *result)
}
}
/* print_warnings should be called right after executing a statement */
static void print_warnings()
@ -4005,11 +4059,19 @@ print_tab_data(MYSQL_RES *result)
while ((cur = mysql_fetch_row(result)))
{
lengths=mysql_fetch_lengths(result);
safe_put_field(cur[0],lengths[0]);
field= mysql_fetch_fields(result);
if (opt_binhex && is_binary_field(&field[0]))
print_as_hex(PAGER, cur[0], lengths[0], lengths[0]);
else
safe_put_field(cur[0],lengths[0]);
for (uint off=1 ; off < mysql_num_fields(result); off++)
{
(void) tee_fputs("\t", PAGER);
safe_put_field(cur[off], lengths[off]);
if (opt_binhex && field && is_binary_field(&field[off]))
print_as_hex(PAGER, cur[off], lengths[off], lengths[off]);
else
safe_put_field(cur[off], lengths[off]);
}
(void) tee_fputs("\n", PAGER);
}

View file

@ -1,17 +1,3 @@
IF(NOT EXISTS ${CMAKE_SOURCE_DIR}/libmariadb/CMakeLists.txt AND GIT_EXECUTABLE)
EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule init
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
ENDIF()
IF(NOT EXISTS ${CMAKE_SOURCE_DIR}/libmariadb/CMakeLists.txt)
MESSAGE(FATAL_ERROR "No MariaDB Connector/C! Run
git submodule init
git submodule update
Then restart the build.
")
ENDIF()
SET(OPT CONC_)
IF (CMAKE_BUILD_TYPE STREQUAL "Debug")

View file

@ -1,4 +1,5 @@
# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2009, 2012, Oracle and/or its affiliates.
# Copyright (c) 2011, 2017, MariaDB Corporation
#
# 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
@ -11,7 +12,7 @@
#
# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# We support different versions of SSL:
# - "bundled" uses source code in <source dir>/extra/yassl
@ -124,7 +125,7 @@ MACRO (MYSQL_CHECK_SSL)
SET(OPENSSL_ROOT_DIR ${WITH_SSL_PATH})
ENDIF()
ENDIF()
FIND_PACKAGE(OpenSSL 1.0.0)
FIND_PACKAGE(OpenSSL)
IF(OPENSSL_FOUND)
SET(OPENSSL_LIBRARY ${OPENSSL_SSL_LIBRARY})
INCLUDE(CheckSymbolExists)
@ -159,7 +160,7 @@ MACRO (MYSQL_CHECK_SSL)
HAVE_EncryptAes128Gcm)
ELSE()
IF(WITH_SSL STREQUAL "system")
MESSAGE(SEND_ERROR "Cannot find appropriate system libraries for SSL. Use WITH_SSL=bundled to enable SSL support")
MESSAGE(SEND_ERROR "Cannot find appropriate system libraries for SSL. Use WITH_SSL=bundled to enable SSL support")
ENDIF()
MYSQL_USE_BUNDLED_SSL()
ENDIF()

30
cmake/submodules.cmake Normal file
View file

@ -0,0 +1,30 @@
# update submodules automatically
IF(GIT_EXECUTABLE AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" config --get cmake.update-submodules
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE cmake_update_submodules)
IF(cmake_update_submodules MATCHES no)
SET(update_result 0)
ELSEIF (cmake_update_submodules MATCHES force)
MESSAGE("-- Updating submodules (forced)")
EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update --init --force
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE update_result)
ELSEIF (cmake_update_submodules MATCHES yes)
EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update --init
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE update_result)
ELSE()
MESSAGE("-- Updating submodules")
EXECUTE_PROCESS(COMMAND "${GIT_EXECUTABLE}" submodule update --init
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE update_result)
ENDIF()
ENDIF()
IF(update_result OR NOT EXISTS ${CMAKE_SOURCE_DIR}/libmariadb/CMakeLists.txt)
MESSAGE(FATAL_ERROR "No MariaDB Connector/C! Run
git submodule update --init
Then restart the build.
")
ENDIF()

View file

@ -70,9 +70,11 @@ MACRO(CHECK_SYSTEMD)
UNSET(HAVE_SYSTEMD_SD_NOTIFYF)
MESSAGE_ONCE(systemd "Systemd features not enabled")
IF(WITH_SYSTEMD STREQUAL "yes")
MESSAGE(FATAL_ERROR "Requested WITH_SYSTEMD=YES however no dependencies installed/found")
MESSAGE(FATAL_ERROR "Requested WITH_SYSTEMD=yes however no dependencies installed/found")
ENDIF()
ENDIF()
ELSEIF(NOT WITH_SYSTEMD STREQUAL "no")
MESSAGE(FATAL_ERROR "Invalid value for WITH_SYSTEMD. Must be 'yes', 'no', or 'auto'.")
ENDIF()
ENDIF()
ENDMACRO()

View file

@ -1,6 +1,5 @@
usr/bin/mysql_config
usr/include/mysql/*.h
usr/include/mysql/psi/*.h
usr/include/mysql
usr/lib/*/libmariadb.so
usr/lib/*/libmariadbclient.a
usr/lib/*/libmysqlservices.a

View file

@ -1342,8 +1342,8 @@ out:
return(ret);
}
bool
backup_start()
/** Start --backup */
bool backup_start()
{
if (!opt_no_lock) {
if (opt_safe_slave_backup) {
@ -1418,9 +1418,8 @@ backup_start()
return(true);
}
bool
backup_finish()
/** Release resources after backup_start() */
void backup_release()
{
/* release all locks */
if (!opt_no_lock) {
@ -1435,7 +1434,11 @@ backup_finish()
xb_mysql_query(mysql_connection,
"START SLAVE SQL_THREAD", false);
}
}
/** Finish after backup_start() and backup_release() */
bool backup_finish()
{
/* Copy buffer pool dump or LRU dump */
if (!opt_rsync) {
if (buffer_pool_filename && file_exists(buffer_pool_filename)) {

View file

@ -31,10 +31,12 @@ copy_file(ds_ctxt_t *datasink,
const char *dst_file_path,
uint thread_n);
bool
backup_start();
bool
backup_finish();
/** Start --backup */
bool backup_start();
/** Release resources after backup_start() */
void backup_release();
/** Finish after backup_start() and backup_release() */
bool backup_finish();
bool
apply_log_finish();
bool

View file

@ -575,7 +575,6 @@ bool
select_incremental_lsn_from_history(lsn_t *incremental_lsn)
{
MYSQL_RES *mysql_result;
MYSQL_ROW row;
char query[1000];
char buf[100];
@ -608,27 +607,27 @@ select_incremental_lsn_from_history(lsn_t *incremental_lsn)
mysql_result = xb_mysql_query(mysql_connection, query, true);
ut_ad(mysql_num_fields(mysql_result) == 1);
if (!(row = mysql_fetch_row(mysql_result))) {
const MYSQL_ROW row = mysql_fetch_row(mysql_result);
if (row) {
*incremental_lsn = strtoull(row[0], NULL, 10);
msg("Found and using lsn: " LSN_PF " for %s %s\n",
*incremental_lsn,
opt_incremental_history_uuid ? "uuid" : "name",
opt_incremental_history_uuid ?
opt_incremental_history_uuid :
opt_incremental_history_name);
} else {
msg("Error while attempting to find history record "
"for %s %s\n",
opt_incremental_history_uuid ? "uuid" : "name",
opt_incremental_history_uuid ?
opt_incremental_history_uuid :
opt_incremental_history_name);
return(false);
}
*incremental_lsn = strtoull(row[0], NULL, 10);
mysql_free_result(mysql_result);
msg("Found and using lsn: " LSN_PF " for %s %s\n", *incremental_lsn,
opt_incremental_history_uuid ? "uuid" : "name",
opt_incremental_history_uuid ?
opt_incremental_history_uuid :
opt_incremental_history_name);
return(true);
return(row != NULL);
}
static
@ -715,14 +714,12 @@ static
bool
have_queries_to_wait_for(MYSQL *connection, uint threshold)
{
MYSQL_RES *result;
MYSQL_ROW row;
bool all_queries;
MYSQL_RES *result = xb_mysql_query(connection, "SHOW FULL PROCESSLIST",
true);
const bool all_queries = (opt_lock_wait_query_type == QUERY_TYPE_ALL);
bool have_to_wait = false;
result = xb_mysql_query(connection, "SHOW FULL PROCESSLIST", true);
all_queries = (opt_lock_wait_query_type == QUERY_TYPE_ALL);
while ((row = mysql_fetch_row(result)) != NULL) {
while (MYSQL_ROW row = mysql_fetch_row(result)) {
const char *info = row[7];
int duration = row[5] ? atoi(row[5]) : 0;
char *id = row[0];
@ -733,26 +730,25 @@ have_queries_to_wait_for(MYSQL *connection, uint threshold)
|| is_update_query(info))) {
msg_ts("Waiting for query %s (duration %d sec): %s",
id, duration, info);
return(true);
have_to_wait = true;
break;
}
}
return(false);
mysql_free_result(result);
return(have_to_wait);
}
static
void
kill_long_queries(MYSQL *connection, time_t timeout)
{
MYSQL_RES *result;
MYSQL_ROW row;
bool all_queries;
char kill_stmt[100];
result = xb_mysql_query(connection, "SHOW FULL PROCESSLIST", true);
all_queries = (opt_kill_long_query_type == QUERY_TYPE_ALL);
while ((row = mysql_fetch_row(result)) != NULL) {
MYSQL_RES *result = xb_mysql_query(connection, "SHOW FULL PROCESSLIST",
true);
const bool all_queries = (opt_kill_long_query_type == QUERY_TYPE_ALL);
while (MYSQL_ROW row = mysql_fetch_row(result)) {
const char *info = row[7];
long long duration = row[5]? atoll(row[5]) : 0;
char *id = row[0];
@ -768,6 +764,8 @@ kill_long_queries(MYSQL *connection, time_t timeout)
xb_mysql_query(connection, kill_stmt, false, false);
}
}
mysql_free_result(result);
}
static

View file

@ -159,7 +159,7 @@ xb_fil_cur_open(
/* In the backup mode we should already have a tablespace handle created
by fil_ibd_load() unless it is a system
tablespace. Otherwise we open the file here. */
if (cursor->is_system() || srv_operation == SRV_OPERATION_RESTORE
if (cursor->is_system() || srv_operation == SRV_OPERATION_RESTORE_DELTA
|| xb_close_files) {
node->handle = os_file_create_simple_no_error_handling(
0, node->name,

View file

@ -2238,7 +2238,7 @@ xtrabackup_copy_log(copy_logfile copy, lsn_t start_lsn, lsn_t end_lsn)
end_lsn = copy == COPY_LAST
? ut_uint64_align_up(scanned_lsn, OS_FILE_LOG_BLOCK_SIZE)
: scanned_lsn & ~(OS_FILE_LOG_BLOCK_SIZE - 1);
: scanned_lsn & ~lsn_t(OS_FILE_LOG_BLOCK_SIZE - 1);
if (ulint write_size = ulint(end_lsn - start_lsn)) {
if (srv_encrypt_log) {
@ -2517,9 +2517,11 @@ xb_load_single_table_tablespace(
const char *filname,
bool is_remote)
{
ut_ad(srv_operation == SRV_OPERATION_BACKUP
|| srv_operation == SRV_OPERATION_RESTORE_DELTA);
/* Ignore .isl files on XtraBackup recovery. All tablespaces must be
local. */
if (is_remote && srv_operation == SRV_OPERATION_RESTORE) {
if (is_remote && srv_operation == SRV_OPERATION_RESTORE_DELTA) {
return;
}
if (check_if_skip_table(filname)) {
@ -2578,7 +2580,8 @@ xb_load_single_table_tablespace(
in the cache to be populated with fields from space header */
fil_space_open(space->name);
if (srv_operation == SRV_OPERATION_RESTORE || xb_close_files) {
if (srv_operation == SRV_OPERATION_RESTORE_DELTA
|| xb_close_files) {
fil_space_close(space->name);
}
}
@ -2753,7 +2756,7 @@ xb_load_tablespaces()
lsn_t flush_lsn;
ut_ad(srv_operation == SRV_OPERATION_BACKUP
|| srv_operation == SRV_OPERATION_RESTORE);
|| srv_operation == SRV_OPERATION_RESTORE_DELTA);
err = srv_sys_space.check_file_spec(&create_new_db, 0);
@ -3323,6 +3326,74 @@ static void stop_backup_threads()
}
}
/** Implement the core of --backup
@return whether the operation succeeded */
static
bool
xtrabackup_backup_low()
{
/* read the latest checkpoint lsn */
{
ulint max_cp_field;
log_mutex_enter();
if (recv_find_max_checkpoint(&max_cp_field) == DB_SUCCESS
&& log_sys->log.format != 0) {
metadata_to_lsn = mach_read_from_8(
log_sys->checkpoint_buf + LOG_CHECKPOINT_LSN);
msg("xtrabackup: The latest check point"
" (for incremental): '" LSN_PF "'\n",
metadata_to_lsn);
} else {
metadata_to_lsn = 0;
msg("xtrabackup: Error: recv_find_max_checkpoint() failed.\n");
}
log_mutex_exit();
}
stop_backup_threads();
if (!dst_log_file || xtrabackup_copy_logfile(COPY_LAST)) {
return false;
}
if (ds_close(dst_log_file)) {
dst_log_file = NULL;
return false;
}
dst_log_file = NULL;
if(!xtrabackup_incremental) {
strcpy(metadata_type, "full-backuped");
metadata_from_lsn = 0;
} else {
strcpy(metadata_type, "incremental");
metadata_from_lsn = incremental_lsn;
}
metadata_last_lsn = log_copy_scanned_lsn;
if (!xtrabackup_stream_metadata(ds_meta)) {
msg("xtrabackup: Error: failed to stream metadata.\n");
return false;
}
if (xtrabackup_extra_lsndir) {
char filename[FN_REFLEN];
sprintf(filename, "%s/%s", xtrabackup_extra_lsndir,
XTRABACKUP_METADATA_FILENAME);
if (!xtrabackup_write_metadata(filename)) {
msg("xtrabackup: Error: failed to write metadata "
"to '%s'.\n", filename);
return false;
}
}
return true;
}
/** Implement --backup
@return whether the operation succeeded */
static
@ -3330,7 +3401,6 @@ bool
xtrabackup_backup_func()
{
MY_STAT stat_info;
lsn_t latest_cp;
uint i;
uint count;
pthread_mutex_t count_mutex;
@ -3730,70 +3800,19 @@ reread_log_header:
}
}
if (!backup_start()) {
goto fail;
}
bool ok = backup_start();
/* read the latest checkpoint lsn */
{
ulint max_cp_field;
if (ok) {
ok = xtrabackup_backup_low();
log_mutex_enter();
backup_release();
if (recv_find_max_checkpoint(&max_cp_field) == DB_SUCCESS
&& log_sys->log.format != 0) {
latest_cp = mach_read_from_8(log_sys->checkpoint_buf +
LOG_CHECKPOINT_LSN);
msg("xtrabackup: The latest check point"
" (for incremental): '" LSN_PF "'\n", latest_cp);
} else {
latest_cp = 0;
msg("xtrabackup: Error: recv_find_max_checkpoint() failed.\n");
if (ok) {
backup_finish();
}
log_mutex_exit();
}
stop_backup_threads();
if (!dst_log_file || xtrabackup_copy_logfile(COPY_LAST)) {
goto fail;
}
if (ds_close(dst_log_file)) {
dst_log_file = NULL;
goto fail;
}
dst_log_file = NULL;
if(!xtrabackup_incremental) {
strcpy(metadata_type, "full-backuped");
metadata_from_lsn = 0;
} else {
strcpy(metadata_type, "incremental");
metadata_from_lsn = incremental_lsn;
}
metadata_to_lsn = latest_cp;
metadata_last_lsn = log_copy_scanned_lsn;
if (!xtrabackup_stream_metadata(ds_meta)) {
msg("xtrabackup: Error: failed to stream metadata.\n");
goto fail;
}
if (xtrabackup_extra_lsndir) {
char filename[FN_REFLEN];
sprintf(filename, "%s/%s", xtrabackup_extra_lsndir,
XTRABACKUP_METADATA_FILENAME);
if (!xtrabackup_write_metadata(filename)) {
msg("xtrabackup: Error: failed to write metadata "
"to '%s'.\n", filename);
goto fail;
}
}
if (!backup_finish()) {
if (!ok) {
goto fail;
}
@ -3806,10 +3825,10 @@ reread_log_header:
xb_data_files_close();
/* Make sure that the latest checkpoint was included */
if (latest_cp > log_copy_scanned_lsn) {
if (metadata_to_lsn > log_copy_scanned_lsn) {
msg("xtrabackup: error: failed to copy enough redo log ("
"LSN=" LSN_PF "; checkpoint LSN=" LSN_PF ").\n",
log_copy_scanned_lsn, latest_cp);
log_copy_scanned_lsn, metadata_to_lsn);
goto fail;
}
@ -4925,6 +4944,8 @@ xtrabackup_prepare_func(char** argv)
srv_thread_concurrency = 1;
if (xtrabackup_incremental) {
srv_operation = SRV_OPERATION_RESTORE_DELTA;
if (innodb_init_param()) {
error_cleanup:
xb_filters_free();
@ -4943,7 +4964,6 @@ error_cleanup:
srv_allow_writes_event = os_event_create(0);
os_event_set(srv_allow_writes_event);
#endif
dberr_t err = xb_data_files_init();
if (err != DB_SUCCESS) {
msg("xtrabackup: error: xb_data_files_init() failed "
@ -4976,6 +4996,8 @@ error_cleanup:
if (!ok) goto error_cleanup;
}
srv_operation = SRV_OPERATION_RESTORE;
if (innodb_init_param()) {
goto error_cleanup;
}
@ -5526,8 +5548,7 @@ handle_options(int argc, char **argv, char ***argv_client, char ***argv_server)
for (n = 0; (*argv_client)[n]; n++) {};
argc_client = n;
if (strcmp(base_name(my_progname), INNOBACKUPEX_BIN_NAME) == 0 &&
argc_client > 0) {
if (innobackupex_mode && argc_client > 0) {
/* emulate innobackupex script */
innobackupex_mode = true;
if (!ibx_handle_options(&argc_client, argv_client)) {
@ -5572,12 +5593,10 @@ static int main_low(char** argv);
int main(int argc, char **argv)
{
char **client_defaults, **server_defaults;
static char INNOBACKUPEX_EXE[]= "innobackupex";
if (argc > 1 && (strcmp(argv[1], "--innobackupex") == 0))
{
argv++;
argc--;
argv[0] = INNOBACKUPEX_EXE;
innobackupex_mode = true;
}

View file

@ -64,23 +64,32 @@ SET(HEADERS
json_lib.h
)
INSTALL(FILES ${HEADERS} DESTINATION ${INSTALL_INCLUDEDIR} COMPONENT Development)
# don't use C/C's (possibly outdated) copy of mysqld_error.h
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mysqld_error.h
DESTINATION ${INSTALL_INCLUDEDIR} COMPONENT Development)
INSTALL(FILES ${HEADERS}
DESTINATION ${INSTALL_INCLUDEDIR}/server COMPONENT Development)
FOREACH(f ${HEADERS_GEN_CONFIGURE})
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${f} DESTINATION ${INSTALL_INCLUDEDIR} COMPONENT Development PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${f}
DESTINATION ${INSTALL_INCLUDEDIR}/server COMPONENT Development)
ENDFOREACH(f)
INSTALL(DIRECTORY mysql/ DESTINATION ${INSTALL_INCLUDEDIR} COMPONENT Development FILES_MATCHING PATTERN "*.h")
INSTALL(DIRECTORY mysql/ DESTINATION ${INSTALL_INCLUDEDIR}/server/mysql COMPONENT Development FILES_MATCHING PATTERN "*.h")
STRING(REPLACE "." "\\." EXCL_RE "${HEADERS};${HEADERS_GEN_CONFIGURE}")
STRING(REPLACE ";" "|" EXCL_RE "${EXCL_RE}")
INSTALL(DIRECTORY . DESTINATION ${INSTALL_INCLUDEDIR}/private COMPONENT Development
FILES_MATCHING PATTERN "*.h"
PATTERN CMakeFiles EXCLUDE
PATTERN mysql EXCLUDE
REGEX "\\./(${EXCL_RE}$)" EXCLUDE)
MACRO(INSTALL_PRIVATE DIR)
INSTALL(DIRECTORY ${DIR}/.
DESTINATION ${INSTALL_INCLUDEDIR}/server/private COMPONENT Development
FILES_MATCHING PATTERN "*.h"
PATTERN CMakeFiles EXCLUDE
PATTERN mysql EXCLUDE
REGEX "\\./(${EXCL_RE}$)" EXCLUDE)
ENDMACRO()
INSTALL_PRIVATE(${CMAKE_CURRENT_BINARY_DIR})
IF(NOT ${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
INSTALL_PRIVATE(${CMAKE_CURRENT_SOURCE_DIR})
ENDIF()
INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/. DESTINATION ${INSTALL_INCLUDEDIR}/private COMPONENT Development
FILES_MATCHING PATTERN "*.h"
PATTERN CMakeFiles EXCLUDE
PATTERN mysql EXCLUDE
REGEX "\\./(${EXCL_RE}$)" EXCLUDE)

View file

@ -1,6 +1,6 @@
/*
Copyright (c) 2001, 2013, Oracle and/or its affiliates.
Copyright (c) 2010, 2017, MariaDB Corporation.
Copyright (c) 2009, 2017, MariaDB Corporation
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
@ -437,9 +437,8 @@ extern "C" int madvise(void *addr, size_t len, int behav);
#define SIGNAL_HANDLER_RESET_ON_DELIVERY
#endif
#ifndef STDERR_FILENO
#define STDERR_FILENO fileno(stderr)
#endif
/* don't assume that STDERR_FILENO is 2, mysqld can freopen */
#undef STDERR_FILENO
#ifndef SO_EXT
#ifdef _WIN32

View file

@ -36,7 +36,7 @@
#define VERSION_progress_report 0x0100
#define VERSION_thd_alloc 0x0100
#define VERSION_thd_autoinc 0x0100
#define VERSION_thd_error_context 0x0100
#define VERSION_thd_error_context 0x0200
#define VERSION_thd_rnd 0x0100
#define VERSION_thd_specifics 0x0100
#define VERSION_thd_timezone 0x0100

@ -1 +1 @@
Subproject commit eb058204233863f1b949209e5c4649489174d299
Subproject commit 11321f16bfcd92e210d5736af7b7d5073a89c2ef

View file

@ -162,7 +162,7 @@ ENDFOREACH()
MERGE_LIBRARIES(mysqlserver STATIC ${EMBEDDED_LIBS}
OUTPUT_NAME ${MYSQLSERVER_OUTPUT_NAME} COMPONENT ${COMPONENT_MYSQLSERVER})
INSTALL(FILES embedded_priv.h DESTINATION ${INSTALL_INCLUDEDIR}/private COMPONENT ${COMPONENT_MYSQLSERVER})
INSTALL(FILES embedded_priv.h DESTINATION ${INSTALL_INCLUDEDIR}/server/private COMPONENT ${COMPONENT_MYSQLSERVER})
# Visual Studio users need debug static library
IF(MSVC)

View file

@ -140,8 +140,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
}
/* Clear result variables */
thd->clear_error();
thd->get_stmt_da()->reset_diagnostics_area();
thd->clear_error(1);
mysql->affected_rows= ~(my_ulonglong) 0;
mysql->field_count= 0;
net_clear_error(net);

View file

@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2014, Oracle and/or its affiliates.
Copyright (c) 2009, 2014, SkySQL Ab.
/* Copyright (c) 2000, 2014, Oracle and/or its affiliates
Copyright (c) 2009, 2017, MariaDB Corporation
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
@ -4919,4 +4919,3 @@ ulong STDCALL mysql_net_field_length(uchar **packet)
{
return net_field_length(packet);
}

View file

@ -22,6 +22,7 @@ IF(NOT ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
${CMAKE_CURRENT_BINARY_DIR}/mysql-test-run.pl
@ONLY
)
SET(out_of_source_build TRUE)
ENDIF()
IF(UNIX)
EXECUTE_PROCESS(
@ -32,9 +33,9 @@ IF(UNIX)
./mysql-test-run.pl mysql-test-run
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
IF(INSTALL_MYSQLTESTDIR)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mtr
${CMAKE_CURRENT_BINARY_DIR}/mysql-test-run
IF(INSTALL_MYSQLTESTDIR AND out_of_source_build)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mtr
${CMAKE_CURRENT_BINARY_DIR}/mysql-test-run
DESTINATION ${INSTALL_MYSQLTESTDIR}
COMPONENT Test)
ENDIF()

View file

@ -64,6 +64,8 @@ explain
select * from t0 where key1 < 3 or key2 > 1020;
select * from t0 where key1 < 3 or key2 > 1020;
select * from t0 where key1=1022; # MDEV-13535 no-key-read select after keyread
explain select * from t0 where key1 < 3 or key2 <4;
explain

View file

@ -6,50 +6,5 @@
--source include/not_embedded.inc
if ($rpl_inited)
{
if (!$allow_rpl_inited)
{
--die ERROR IN TEST: When using the replication test framework (master-slave.inc, rpl_init.inc etc), use rpl_restart_server.inc instead of restart_mysqld.inc. If you know what you are doing and you really have to use restart_mysqld.inc, set allow_rpl_inited=1 before you source restart_mysqld.inc
}
}
--let $server_shutdown_timeout= 60
if ($shutdown_timeout)
{
--let $server_shutdown_timeout= $shutdown_timeout
}
if ($shutdown_timeout == 0)
{
--let $server_shutdown_timeout= 0
}
# Write file to make mysql-test-run.pl expect the "crash", but don't start
# it until it's told to
--let $_server_id= `SELECT @@server_id`
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
--exec echo "wait" > $_expect_file_name
# Send shutdown to the connected server and give
# it 10 seconds to die before zapping it
shutdown_server $server_shutdown_timeout;
# Write file to make mysql-test-run.pl start up the server again
if ($restart_parameters)
{
--exec echo "restart: $restart_parameters" > $_expect_file_name
}
if (!$restart_parameters)
{
--exec echo "restart" > $_expect_file_name
}
# Turn on reconnect
--enable_reconnect
# Call script that will poll the server waiting for it to be back online again
--source include/wait_until_connected_again.inc
# Turn off reconnect again
--disable_reconnect
--source include/shutdown_mysqld.inc
--source include/start_mysqld.inc

View file

@ -12,7 +12,17 @@ if ($rpl_inited)
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
--exec echo "wait" > $_expect_file_name
--let $server_shutdown_timeout= 60
if ($shutdown_timeout)
{
--let $server_shutdown_timeout= $shutdown_timeout
}
if ($shutdown_timeout == 0)
{
--let $server_shutdown_timeout= 0
}
# Send shutdown to the connected server
--shutdown_server
--shutdown_server $server_shutdown_timeout
--source include/wait_until_disconnected.inc

View file

@ -66,6 +66,13 @@ if (!$slave_skip_counter) {
}
source include/start_slave.inc;
# start_slave.inc returns when Slave_SQL_Running=Yes. But the slave
# thread sets it before clearing Last_SQL_Errno. So we have to wait
# for Last_SQL_Errno=0 separately.
let $slave_param= Last_SQL_Errno;
let $slave_param_value= 0;
source include/wait_for_slave_param.inc;
--let $include_filename= wait_for_slave_sql_error_and_skip.inc [errno=$slave_sql_errno]
--source include/end_include_file.inc

View file

@ -29,16 +29,6 @@ ELSE()
MYSQL_ADD_EXECUTABLE(my_safe_process safe_process.cc ${INSTALL_ARGS})
ENDIF()
INSTALL(TARGETS my_safe_process
DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test
)
IF(WIN32)
INSTALL(TARGETS my_safe_kill
DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test
)
ENDIF()
INSTALL(FILES Base.pm
DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess" COMPONENT Test
)

View file

@ -2,7 +2,7 @@
# -*- cperl -*-
# Copyright (c) 2004, 2014, Oracle and/or its affiliates.
# Copyright (c) 2009, 2014, Monty Program Ab
# Copyright (c) 2009, 2017, MariaDB Corporation
#
# 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
@ -1264,10 +1264,6 @@ sub command_line_setup {
fix_vs_config_dir();
# Respect MTR_BINDIR variable, which is typically set in to the
# build directory in out-of-source builds.
$bindir=$ENV{MTR_BINDIR}||$basedir;
# Look for the client binaries directory
if ($path_client_bindir)
{

View file

@ -2171,3 +2171,54 @@ DROP TABLE t1;
CREATE TABLE t1(a INT, b INT, CONSTRAINT min check (a>5),
CONSTRAINT min check (b>5));
ERROR HY000: Duplicate CHECK constraint name 'min'
create table t1 (a int, b int, check(a>b));
alter table t1 drop column a;
ERROR 42S22: Unknown column 'a' in 'CHECK'
alter table t1 drop column b, add column b bigint first;
ERROR 42S22: Unknown column 'b' in 'CHECK'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
CONSTRAINT `CONSTRAINT_1` CHECK (`a` > `b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int, b int, check(a>0));
alter table t1 drop column a;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int, b int, check(a>0));
alter table t1 drop column a, add column a bigint first;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` bigint(20) DEFAULT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int, b int, c int, unique(a));
alter table t1 drop column a;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`b` int(11) DEFAULT NULL,
`c` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 (a int, b int, c int, unique(a,b));
alter table t1 drop column a;
ERROR 42000: Key column 'a' doesn't exist in table
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
`c` int(11) DEFAULT NULL,
UNIQUE KEY `a` (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;

View file

@ -0,0 +1,117 @@
USE test;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (c1 TINYBLOB,
c2 BLOB,
c3 MEDIUMBLOB,
c4 LONGBLOB,
c5 TEXT,
c6 BIT(1),
c7 CHAR,
c8 VARCHAR(10),
c9 GEOMETRY) CHARACTER SET = binary;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` tinyblob DEFAULT NULL,
`c2` blob DEFAULT NULL,
`c3` mediumblob DEFAULT NULL,
`c4` longblob DEFAULT NULL,
`c5` blob DEFAULT NULL,
`c6` bit(1) DEFAULT NULL,
`c7` binary(1) DEFAULT NULL,
`c8` varbinary(10) DEFAULT NULL,
`c9` geometry DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=binary
INSERT INTO t1 VALUES ('tinyblob-text readable', 'blob-text readable',
'mediumblob-text readable', 'longblob-text readable',
'text readable', b'1', 'c', 'variable',
POINT(1, 1));
CREATE TABLE t2(id int, `col1` binary(10),`col2` blob);
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`id` int(11) DEFAULT NULL,
`col1` binary(10) DEFAULT NULL,
`col2` blob DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t2 VALUES (1, X'AB1234', X'123ABC'), (2, X'DE1234', X'123DEF');
#Print the table contents when binary-as-hex option is off.
SELECT * FROM t1;
c1 c2 c3 c4 c5 c6 c7 c8 c9
tinyblob-text readable blob-text readable mediumblob-text readable longblob-text readable text readable # c variable #
SELECT * FROM t2;
id col1 col2
1 # #
2 # #
#Print the table contents after turning on the binary-as-hex option
#Print the table contents in tab format
c1 c2 c3 c4 c5 c6 c7 c8 c9
0x74696E79626C6F622D74657874207265616461626C65 0x626C6F622D74657874207265616461626C65 0x6D656469756D626C6F622D74657874207265616461626C65 0x6C6F6E67626C6F622D74657874207265616461626C65 0x74657874207265616461626C65 0x01 0x63 0x7661726961626C65 0x000000000101000000000000000000F03F000000000000F03F
id col1 col2
1 0xAB123400000000000000 0x123ABC
2 0xDE123400000000000000 0x123DEF
#Print the table contents in table format
+------------------------------------------------+----------------------------------------+----------------------------------------------------+------------------------------------------------+------------------------------+------------+------------+--------------------+------------------------------------------------------+
| c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8 | c9 |
+------------------------------------------------+----------------------------------------+----------------------------------------------------+------------------------------------------------+------------------------------+------------+------------+--------------------+------------------------------------------------------+
| 0x74696E79626C6F622D74657874207265616461626C65 | 0x626C6F622D74657874207265616461626C65 | 0x6D656469756D626C6F622D74657874207265616461626C65 | 0x6C6F6E67626C6F622D74657874207265616461626C65 | 0x74657874207265616461626C65 | 0x01 | 0x63 | 0x7661726961626C65 | 0x000000000101000000000000000000F03F000000000000F03F |
+------------------------------------------------+----------------------------------------+----------------------------------------------------+------------------------------------------------+------------------------------+------------+------------+--------------------+------------------------------------------------------+
+------+------------------------+------------+
| id | col1 | col2 |
+------+------------------------+------------+
| 1 | 0xAB123400000000000000 | 0x123ABC |
+------+------------------------+------------+
#Print the table contents vertically
*************************** 1. row ***************************
c1: 0x74696E79626C6F622D74657874207265616461626C65
c2: 0x626C6F622D74657874207265616461626C65
c3: 0x6D656469756D626C6F622D74657874207265616461626C65
c4: 0x6C6F6E67626C6F622D74657874207265616461626C65
c5: 0x74657874207265616461626C65
c6: 0x01
c7: 0x63
c8: 0x7661726961626C65
c9: 0x000000000101000000000000000000F03F000000000000F03F
#Print the table contents in xml format
<?xml version="1.0"?>
<resultset statement="SELECT * FROM t1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<row>
<field name="c1">0x74696E79626C6F622D74657874207265616461626C65</field>
<field name="c2">0x626C6F622D74657874207265616461626C65</field>
<field name="c3">0x6D656469756D626C6F622D74657874207265616461626C65</field>
<field name="c4">0x6C6F6E67626C6F622D74657874207265616461626C65</field>
<field name="c5">0x74657874207265616461626C65</field>
<field name="c6">0x01</field>
<field name="c7">0x63</field>
<field name="c8">0x7661726961626C65</field>
<field name="c9">0x000000000101000000000000000000F03F000000000000F03F</field>
</row>
</resultset>
<?xml version="1.0"?>
<resultset statement="SELECT * FROM t2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<row>
<field name="id">1</field>
<field name="col1">0xAB123400000000000000</field>
<field name="col2">0x123ABC</field>
</row>
<row>
<field name="id">2</field>
<field name="col1">0xDE123400000000000000</field>
<field name="col2">0x123DEF</field>
</row>
</resultset>
#Print the table contents in html format
<TABLE BORDER=1><TR><TH>c1</TH><TH>c2</TH><TH>c3</TH><TH>c4</TH><TH>c5</TH><TH>c6</TH><TH>c7</TH><TH>c8</TH><TH>c9</TH></TR><TR><TD>0x74696E79626C6F622D74657874207265616461626C65</TD><TD>0x626C6F622D74657874207265616461626C65</TD><TD>0x6D656469756D626C6F622D74657874207265616461626C65</TD><TD>0x6C6F6E67626C6F622D74657874207265616461626C65</TD><TD>0x74657874207265616461626C65</TD><TD>0x01</TD><TD>0x63</TD><TD>0x7661726961626C65</TD><TD>0x000000000101000000000000000000F03F000000000000F03F</TD></TR></TABLE><TABLE BORDER=1><TR><TH>id</TH><TH>col1</TH><TH>col2</TH></TR><TR><TD>1</TD><TD>0xAB123400000000000000</TD><TD>0x123ABC</TD></TR><TR><TD>2</TD><TD>0xDE123400000000000000</TD><TD>0x123DEF</TD></TR></TABLE>DROP TABLE t1, t2;

View file

@ -136,10 +136,6 @@ insert into t1(c1) values(1);
ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`t1`
insert into t1(c1) values(2);
drop table t1;
create table t1 (a int, b int, check(a>0));
alter table t1 drop column a;
ERROR 42S22: Unknown column 'a' in 'CHECK'
drop table t1;
create or replace table t1( c1 int auto_increment primary key, check( c1 > 0 or c1 is null ) );
ERROR HY000: Function or expression 'AUTO_INCREMENT' cannot be used in the CHECK clause of `c1`
create table t1 (a int check (@b in (select user from mysql.user)));

View file

@ -94,3 +94,15 @@ count(distinct i)
2
drop table t1;
drop view v1;
create table t1 (user_id char(64) character set utf8);
insert t1 values(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17);
set @@tmp_table_size = 1024;
select count(distinct user_id) from t1;
count(distinct user_id)
17
alter table t1 modify user_id char(128) character set utf8;
select count(distinct user_id) from t1;
count(distinct user_id)
17
drop table t1;
set @@tmp_table_size = default;

View file

@ -170,7 +170,7 @@ UPDATE t1 SET a = 'new'
WHERE COLUMN_CREATE( 1, 'v', 1, 'w' ) IS NULL;
ERROR 22007: Illegal value used as argument of dynamic column function
drop table t1;
set max_session_mem_used = 50000;
select * from seq_1_to_1000;
set max_session_mem_used = 8192;
select * from seq_1_to_1000;
Got one of the listed errors
set global max_session_mem_used = default;

View file

@ -885,6 +885,38 @@ SELECT 1 FROM dual WHERE ('Alpha,Bravo,Charlie,Delta,Echo,Foxtrot,StrataCentral,
1
Warnings:
Warning 1139 Got error 'pcre_exec: recursion limit of NUM exceeded' from regexp
SELECT CONCAT(REPEAT('100,',133),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$';
CONCAT(REPEAT('100,',133),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$'
1
SELECT CONCAT(REPEAT('100,',200),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$';
CONCAT(REPEAT('100,',200),'101') RLIKE '^(([1-9][0-9]*),)*[1-9][0-9]*$'
0
Warnings:
Warning 1139 Got error 'pcre_exec: recursion limit of NUM exceeded' from regexp
SELECT REGEXP_INSTR(CONCAT(REPEAT('100,',133),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$');
REGEXP_INSTR(CONCAT(REPEAT('100,',133),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$')
1
SELECT REGEXP_INSTR(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$');
REGEXP_INSTR(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$')
0
Warnings:
Warning 1139 Got error 'pcre_exec: recursion limit of NUM exceeded' from regexp
SELECT LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',133),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'));
LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',133),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'))
535
SELECT LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'));
LENGTH(REGEXP_SUBSTR(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$'))
0
Warnings:
Warning 1139 Got error 'pcre_exec: recursion limit of NUM exceeded' from regexp
SELECT LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',133),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', ''));
LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',133),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', ''))
0
SELECT LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', ''));
LENGTH(REGEXP_REPLACE(CONCAT(REPEAT('100,',200),'101'), '^(([1-9][0-9]*),)*[1-9][0-9]*$', ''))
803
Warnings:
Warning 1139 Got error 'pcre_exec: recursion limit of NUM exceeded' from regexp
SELECT REGEXP_INSTR('a_kollision', 'oll');
REGEXP_INSTR('a_kollision', 'oll')
4

View file

@ -331,8 +331,8 @@ fid IsClosed(g)
116 0
SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon;
fid AsText(Centroid(g))
117 POINT(55.58852775304245 17.426536064113982)
118 POINT(55.58852775304245 17.426536064113982)
117 POINT(57.98031067576927 17.854754130800433)
118 POINT(57.98031067576927 17.854754130800433)
119 POINT(2 2)
SELECT fid, Area(g) FROM gis_multi_polygon;
fid Area(g)
@ -680,11 +680,11 @@ insert into t1 values ('85984',GeomFromText('MULTIPOLYGON(((-115.006363
select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
t1 where object_id=85998;
object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo))
85998 MULTIPOLYGON 1 POINT(115.31877315203187 -36.23747282102153)
85998 MULTIPOLYGON 1 POINT(115.2970604672862 -36.23335610879993)
select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
t1 where object_id=85984;
object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo))
85984 MULTIPOLYGON 1 POINT(-114.87787186923313 36.33101763469059)
85984 MULTIPOLYGON 1 POINT(-114.86854472054372 36.34725218253213)
drop table t1;
create table t1 (fl geometry not null);
insert into t1 values (1);

View file

@ -2640,6 +2640,33 @@ select a from t1 group by a having a > 1;
a
drop table t1;
set sql_mode= @save_sql_mode;
create table t1 (f1 int);
insert into t1 values (5),(9);
create table t2 (f2 int);
insert into t2 values (0),(6);
create table t3 (f3 int);
insert into t3 values (6),(3);
create table t4 (f4 int);
insert into t4 values (1),(0);
select
(select min(f1) from t1 where f1 in (select min(f4) from t2)) as field7,
(select count(*) from t3 where f3 in (select max(f4) from t2 group by field7))
from t4;
ERROR 42S22: Reference 'field7' not supported (reference to group function)
drop table t1, t2, t3, t4;
create table t1 (i1 int);
insert into t1 values (1);
create table t2 (i int);
insert into t2 values (2);
select 1 from t1 left join t2 b on b.i = (select max(b.i) from t2);
1
1
drop table t1, t2;
create table t1 (c1 int, c2 int);
create table t2 (c1 int, c2 int);
select t1.c1 as c1, t2.c2 as c1 from t1, t2 where t1.c1 < 20 and t2.c2 > 5 group by t1.c1, t2.c2 having t1.c1 < 3;
c1 c1
drop table t1, t2;
#
# Bug #58782
# Missing rows with SELECT .. WHERE .. IN subquery

View file

@ -34,6 +34,9 @@ key1 key2 key3 key4 key5 key6 key7 key8
1022 1022 1022 1022 1022 1022 1022 2
1023 1023 1023 1023 1023 1023 1023 1
1024 1024 1024 1024 1024 1024 1024 0
select * from t0 where key1=1022;
key1 key2 key3 key4 key5 key6 key7 key8
1022 1022 1022 1022 1022 1022 1022 2
explain select * from t0 where key1 < 3 or key2 <4;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 index_merge i1,i2 i1,i2 4,4 NULL 7 Using sort_union(i1,i2); Using where

View file

@ -5,10 +5,10 @@ load xml infile '../../std_data/loadxml.dat' into table t1
rows identified by '<row>';
select * from t1 order by a;
a b
1 b1
2 b2
3 b3
11 b11
1 b1
2 b2
3 b3
11 b11
111 b111
112 b112 & < > " ' &unknown; -- check entities
212 b212
@ -84,17 +84,17 @@ LOAD XML INFILE '../../std_data/loadxml.dat' INTO TABLE t1
ROWS IDENTIFIED BY '<row>' (a,@b) SET b=concat('!',@b);
SELECT * FROM t1 ORDER BY a;
a b
1 !b1
11 !b11
1 ! b1
11 ! b11
111 !b111
112 !b112 & < > " ' &unknown; -- check entities
2 !b2
2 ! b2
212 !b212
213 !b213
214 !b214
215 !b215
216 !&bb b;
3 !b3
3 ! b3
DROP TABLE t1;
#
# Bug#16171518 LOAD XML DOES NOT HANDLE EMPTY ELEMENTS

View file

@ -475,6 +475,29 @@ even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@loca
even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@localhost
DROP USER very_long_user_name_number_1, very_long_user_name_number_2, even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@localhost;
DROP PROCEDURE test.pr;
use test;
call mtr.add_suppression('Column last_update in table `mysql`.`innodb_table_stats` is INT NOT NULL but should be');
alter table mysql.innodb_table_stats modify last_update int not null;
create table extralongname_extralongname_extralongname_extralongname_ext (
id int(10) unsigned not null,
created_date date not null,
created timestamp not null,
primary key (created,id,created_date)
) engine=innodb stats_persistent=1 default charset=latin1
partition by range (year(created_date))
subpartition by hash (month(created_date))
subpartitions 2 (
partition p2007 values less than (2008),
partition p2008 values less than (2009)
);
select length(table_name) from mysql.innodb_table_stats;
length(table_name)
79
79
79
79
drop table extralongname_extralongname_extralongname_extralongname_ext;
End of 10.0 tests
set sql_mode=default;
# Droping the previously created mysql_upgrade_info file..
create table test.t1(a int) engine=MyISAM;
@ -537,4 +560,4 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE test.t1;
SET GLOBAL enforce_storage_engine=NULL;
End of tests
End of 10.1 tests

View file

@ -1,6 +1,6 @@
--- mysqld--help.result 2016-11-04 13:35:06.665881700 +0000
+++ mysqld--help,win.reject 2016-11-04 13:58:39.030512500 +0000
@@ -318,7 +318,6 @@
--- a/mysql-test/r/mysqld--help.result
+++ b/mysql-test/r/mysqld--help.result
@@ -334,7 +334,6 @@
The number of segments in a key cache
-L, --language=name Client error messages in given language. May be given as
a full path. Deprecated. Use --lc-messages-dir instead.
@ -8,7 +8,7 @@
--lc-messages=name Set the language used for the error messages.
-L, --lc-messages-dir=name
Directory where error messages are
@@ -521,6 +520,7 @@
@@ -543,6 +542,7 @@
Use MySQL-5.6 (instead of MariaDB-5.3) format for TIME,
DATETIME, TIMESTAMP columns.
(Defaults to on; use --skip-mysql56-temporal-format to disable.)
@ -16,7 +16,7 @@
--net-buffer-length=#
Buffer length for TCP/IP and socket communication
--net-read-timeout=#
@@ -931,6 +931,9 @@
@@ -956,6 +956,9 @@
characteristics (isolation level, read only/read
write,snapshot - but not any work done / data modified
within the transaction).
@ -26,7 +26,7 @@
--show-slave-auth-info
Show user and password in SHOW SLAVE HOSTS on this
master.
@@ -1043,6 +1046,10 @@
@@ -1068,6 +1071,10 @@
Log slow queries to given log file. Defaults logging to
'hostname'-slow.log. Must be enabled to activate other
slow log options
@ -37,29 +37,32 @@
--socket=name Socket file to use for connection
--sort-buffer-size=#
Each thread that needs to do a sort allocates a buffer of
@@ -1061,6 +1068,7 @@
@@ -1086,6 +1093,7 @@
NO_ENGINE_SUBSTITUTION, PAD_CHAR_TO_FULL_LENGTH
--stack-trace Print a symbolic stack trace on failure
(Defaults to on; use --skip-stack-trace to disable.)
+ --standalone Dummy option to start as a standalone program (NT).
--standard-compliant-cte
Allow only standards compiant CTE
(Defaults to on; use --skip-standards-compliant-cte to disable.)
@@ -1109,6 +1117,11 @@
Allow only CTEs compliant to SQL standard
(Defaults to on; use --skip-standard-compliant-cte to disable.)
@@ -1134,8 +1142,12 @@
--thread-pool-max-threads=#
Maximum allowed number of worker threads in the thread
pool
- --thread-pool-oversubscribe=#
- How many additional active worker threads in a group are
+ --thread-pool-min-threads=#
+ Minimum number of threads in the thread pool.
+ --thread-pool-mode=name
+ Chose implementation of the threadpool. One of: windows,
+ generic
--thread-pool-oversubscribe=#
How many additional active worker threads in a group are
+ --thread-pool-oversubscribe=# How many additional active worker threads in a group are
allowed.
@@ -1139,8 +1152,8 @@
size, MySQL will automatically convert it to an on-disk
MyISAM or Aria table
--thread-pool-prio-kickup-timer=#
The number of milliseconds before a dequeued low-priority
@@ -1172,8 +1184,8 @@
automatically convert it to an on-disk MyISAM or Aria
table.
-t, --tmpdir=name Path for temporary files. Several paths may be specified,
- separated by a colon (:), in this case they are used in a
- round-robin fashion
@ -68,7 +71,7 @@
--transaction-alloc-block-size=#
Allocation block size for transactions to be stored in
binary log
@@ -1264,7 +1277,6 @@
@@ -1298,7 +1310,6 @@
key-cache-division-limit 100
key-cache-file-hash-size 512
key-cache-segments 0
@ -76,7 +79,7 @@
lc-messages en_US
lc-messages-dir MYSQL_SHAREDIR/
lc-time-names en_US
@@ -1333,6 +1345,7 @@
@@ -1368,6 +1379,7 @@
myisam-stats-method NULLS_UNEQUAL
myisam-use-mmap FALSE
mysql56-temporal-format TRUE
@ -84,7 +87,7 @@
net-buffer-length 16384
net-read-timeout 30
net-retry-count 10
@@ -1434,6 +1447,8 @@
@@ -1469,6 +1481,8 @@
session-track-state-change FALSE
session-track-system-variables
session-track-transaction-info OFF
@ -93,15 +96,15 @@
show-slave-auth-info FALSE
silent-startup FALSE
skip-grant-tables TRUE
@@ -1458,6 +1473,7 @@
@@ -1493,6 +1507,7 @@
slave-type-conversions
slow-launch-time 2
slow-query-log FALSE
+slow-start-timeout 15000
sort-buffer-size 2097152
sql-mode NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
sql-mode STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
stack-trace TRUE
@@ -1471,14 +1487,16 @@
@@ -1506,14 +1521,16 @@
sync-relay-log 10000
sync-relay-log-info 10000
sysdate-is-now FALSE

View file

@ -1,4 +1,4 @@
Windows bug: happens when a new line is exactly at the right offset
Windows bug: happens when a new line is exactly at the right offset.
The following options may be given as the first argument:
--print-defaults Print the program argument list and exit.
--no-defaults Don't read default options from any option file.
@ -23,13 +23,15 @@ The following options may be given as the first argument:
Creating and dropping stored procedures alters ACLs
(Defaults to on; use --skip-automatic-sp-privileges to disable.)
--back-log=# The number of outstanding connection requests MariaDB can
have. This comes into play when the main MySQL thread
have. This comes into play when the main MariaDB thread
gets very many connection requests in a very short time
(Automatically configured unless set explicitly)
-b, --basedir=name Path to installation directory. All paths are usually
resolved relative to this
--big-tables Allow big result sets by saving all temporary sets on
file (Solves most 'table full' errors)
--big-tables Old variable, which if set to 1, allows large result sets
by saving all temporary sets to disk, avoiding 'table
full' errors. No longer needed, as the server now handles
this automatically. sql_big_tables is a synonym.
--bind-address=name IP address to bind to.
--binlog-annotate-row-events
Tells the master to annotate RBR events with the
@ -105,7 +107,7 @@ The following options may be given as the first argument:
The size of the statement cache for updates to
non-transactional engines for the binary log. If you
often use statements updating a great number of rows, you
can increase this to get more performance
can increase this to get more performance.
--bootstrap Used by mysql installation scripts.
--bulk-insert-buffer-size=#
Size of tree cache used in bulk insert optimisation. Note
@ -159,12 +161,21 @@ The following options may be given as the first argument:
--default-week-format=#
The default week format used by WEEK() functions
--delay-key-write[=name]
Type of DELAY_KEY_WRITE. One of: OFF, ON, ALL
Specifies how MyISAM tables handles CREATE TABLE
DELAY_KEY_WRITE. If set to ON, the default, any DELAY KEY
WRITEs are honored. The key buffer is then flushed only
when the table closes, speeding up writes. MyISAM tables
should be automatically checked upon startup in this
case, and --external locking should not be used, as it
can lead to index corruption. If set to OFF, DELAY KEY
WRITEs are ignored, while if set to ALL, all new opened
tables are treated as if created with DELAY KEY WRITEs
enabled.
--delayed-insert-limit=#
After inserting delayed_insert_limit rows, the INSERT
DELAYED handler will check if there are any SELECT
statements pending. If so, it allows these to execute
before continuing
before continuing.
--delayed-insert-timeout=#
How long a INSERT DELAYED thread should wait for INSERT
statements before terminating
@ -232,7 +243,7 @@ The following options may be given as the first argument:
--gdb Set up signals usable for debugging. Deprecated, use
--general-log Log connections and queries to a table or log file.
Defaults logging to a file 'hostname'.log or a table
mysql.general_logif --log-output=TABLE is used
mysql.general_logif --log-output=TABLE is used.
--general-log-file=name
Log connections and queries to given file
--getopt-prefix-matching
@ -377,7 +388,7 @@ The following options may be given as the first argument:
logs.
--log-slave-updates Tells the slave to log the updates from the slave thread
to the binary log. You will need to turn it on if you
plan to daisy-chain the slaves
plan to daisy-chain the slaves.
--log-slow-admin-statements
Log slow OPTIMIZE, ANALYZE, ALTER and other
administrative statements to the slow log if it is open.
@ -574,7 +585,7 @@ The following options may be given as the first argument:
a query. Values smaller than the number of tables in a
relation result in faster optimization, but may produce
very bad query plans. If set to 0, the system will
automatically pick a reasonable value
automatically pick a reasonable value.
--optimizer-selectivity-sampling-limit=#
Controls number of record samples to check condition
selectivity
@ -762,7 +773,9 @@ The following options may be given as the first argument:
The size of the buffer that is allocated when preloading
indexes
--profiling-history-size=#
Limit of query profiling memory
Number of statements about which profiling information is
maintained. If set to 0, no profiles are stored. See SHOW
PROFILES.
--progress-report-time=#
Seconds between sending progress reports to the client
for time-consuming statements. Set to 0 to disable
@ -803,21 +816,21 @@ The following options may be given as the first argument:
--read-rnd-buffer-size=#
When reading rows in sorted order after a sort, the rows
are read through this buffer to avoid a disk seeks
--relay-log=name The location and name to use for relay logs
--relay-log=name The location and name to use for relay logs.
--relay-log-index=name
The location and name to use for the file that keeps a
list of the last relay logs
--relay-log-info-file=name
The location and name of the file that remembers where
the SQL replication thread is in the relay logs
the SQL replication thread is in the relay logs.
--relay-log-purge if disabled - do not purge relay logs. if enabled - purge
them as soon as they are no more needed
them as soon as they are no more needed.
(Defaults to on; use --skip-relay-log-purge to disable.)
--relay-log-recovery
Enables automatic relay log recovery right after the
database startup, which means that the IO Thread starts
re-fetching from the master right after the last
transaction processed
transaction processed.
--relay-log-space-limit=#
Maximum space to use for all relay logs
--replicate-annotate-row-events
@ -982,7 +995,7 @@ The following options may be given as the first argument:
idempotent. For example, in row based replication
attempts to delete rows that doesn't exist will be
ignored. In STRICT mode, replication will stop on any
unexpected difference between the master and the slave
unexpected difference between the master and the slave.
--slave-load-tmpdir=name
The location where the slave should put its temporary
files when replicating a LOAD DATA INFILE command
@ -1050,7 +1063,7 @@ The following options may be given as the first argument:
--slow-query-log Log slow queries to a table or log file. Defaults logging
to a file 'hostname'-slow.log or a table mysql.slow_log
if --log-output=TABLE is used. Must be enabled to
activate other slow log options
activate other slow log options.
--slow-query-log-file=name
Log slow queries to given log file. Defaults logging to
'hostname'-slow.log. Must be enabled to activate other
@ -1152,10 +1165,10 @@ The following options may be given as the first argument:
MyISAM or Aria table.
--tmp-memory-table-size=#
If an internal in-memory temporary table exceeds this
size, MySQL will automatically convert it to an on-disk
size, MariaDB will automatically convert it to an on-disk
MyISAM or Aria table. Same as tmp_table_size.
--tmp-table-size=# Alias for tmp_memory_table_size. If an internal in-memory
temporary table exceeds this size, MySQL will
temporary table exceeds this size, MariaDB will
automatically convert it to an on-disk MyISAM or Aria
table.
-t, --tmpdir=name Path for temporary files. Several paths may be specified,

View file

@ -34,6 +34,8 @@ create temporary table t3 (a int);
create temporary table t4 (a int) select * from t3;
insert into t3 values(1);
insert into t4 select * from t3;
create table t3 (a int);
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
update t1,t3 set t1.a=t3.a+1 where t1.a=t3.a;
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
update t1,t3 set t3.a=t1.a+1 where t1.a=t3.a;

View file

@ -12,7 +12,7 @@ create function bug14233_f() returns int
return 42;
create table t1 (id int);
create trigger t1_ai after insert on t1 for each row call bug14233();
alter table mysql.proc drop type;
alter table mysql.proc drop security_type;
call bug14233();
ERROR HY000: Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted
create view v1 as select bug14233_f();
@ -142,7 +142,7 @@ drop database if exists mysqltest;
flush table mysql.proc;
create database mysqltest;
# Corrupt mysql.proc to make it unusable by current version of server.
alter table mysql.proc drop column type;
alter table mysql.proc drop column security_type;
# The below statement should not cause assertion failure.
drop database mysqltest;
Warnings:

View file

@ -8129,6 +8129,23 @@ c 1
DROP PROCEDURE p1;
DROP TABLE t1;
#
# MDEV-13346: CURSOR a query with GROUP BY using derived table
#
CREATE PROCEDURE p1()
BEGIN
DECLARE c CURSOR FOR
SELECT
IFNULL(NULL,1) AS col
FROM
( select 1 as id ) AS t
GROUP BY t.id
;
OPEN c;
END
|
CALL p1();
DROP PROCEDURE p1;
#
# Start of 10.3 tests
#
#

View file

@ -1162,7 +1162,7 @@ test t2 idx4 1 6.2000
test t2 idx4 2 1.7222
test t2 idx4 3 1.1154
test t2 idx4 4 1.0000
ALTER TABLE t2 DROP COLUMN b;
ALTER TABLE t2 DROP COLUMN b, DROP PRIMARY KEY, ADD PRIMARY KEY(a);
SELECT * FROM mysql.index_stats ORDER BY index_name, prefix_arity, table_name;
db_name table_name index_name prefix_arity avg_frequency
test t2 idx2 1 7.0000

View file

@ -7201,6 +7201,21 @@ SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1;
ERROR 21000: Subquery returns more than 1 row
drop view v1;
drop table t1,t2;
CREATE TABLE t1 (f1 INT, KEY(f1)) ENGINE=MyISAM;
INSERT t1 VALUES (4),(8);
CREATE TABLE t2 (f2 INT, KEY(f2)) ENGINE=MyISAM;
INSERT t2 VALUES (6);
SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
(SELECT MAX(sq.f2) FROM t1)
NULL
#
# Disable this query till MDEV-13399 is resolved
#
# INSERT t2 VALUES (9);
# --error ER_SUBQUERY_NO_1_ROW
# SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
#
drop table t1, t2;
# End of 10.0 tests
#
# MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops

View file

@ -7201,6 +7201,21 @@ SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1;
ERROR 21000: Subquery returns more than 1 row
drop view v1;
drop table t1,t2;
CREATE TABLE t1 (f1 INT, KEY(f1)) ENGINE=MyISAM;
INSERT t1 VALUES (4),(8);
CREATE TABLE t2 (f2 INT, KEY(f2)) ENGINE=MyISAM;
INSERT t2 VALUES (6);
SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
(SELECT MAX(sq.f2) FROM t1)
NULL
#
# Disable this query till MDEV-13399 is resolved
#
# INSERT t2 VALUES (9);
# --error ER_SUBQUERY_NO_1_ROW
# SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
#
drop table t1, t2;
# End of 10.0 tests
#
# MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops

View file

@ -7194,6 +7194,21 @@ SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1;
ERROR 21000: Subquery returns more than 1 row
drop view v1;
drop table t1,t2;
CREATE TABLE t1 (f1 INT, KEY(f1)) ENGINE=MyISAM;
INSERT t1 VALUES (4),(8);
CREATE TABLE t2 (f2 INT, KEY(f2)) ENGINE=MyISAM;
INSERT t2 VALUES (6);
SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
(SELECT MAX(sq.f2) FROM t1)
NULL
#
# Disable this query till MDEV-13399 is resolved
#
# INSERT t2 VALUES (9);
# --error ER_SUBQUERY_NO_1_ROW
# SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
#
drop table t1, t2;
# End of 10.0 tests
#
# MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops

View file

@ -7192,6 +7192,21 @@ SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1;
ERROR 21000: Subquery returns more than 1 row
drop view v1;
drop table t1,t2;
CREATE TABLE t1 (f1 INT, KEY(f1)) ENGINE=MyISAM;
INSERT t1 VALUES (4),(8);
CREATE TABLE t2 (f2 INT, KEY(f2)) ENGINE=MyISAM;
INSERT t2 VALUES (6);
SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
(SELECT MAX(sq.f2) FROM t1)
NULL
#
# Disable this query till MDEV-13399 is resolved
#
# INSERT t2 VALUES (9);
# --error ER_SUBQUERY_NO_1_ROW
# SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
#
drop table t1, t2;
# End of 10.0 tests
#
# MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops

View file

@ -7207,6 +7207,21 @@ SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1;
ERROR 21000: Subquery returns more than 1 row
drop view v1;
drop table t1,t2;
CREATE TABLE t1 (f1 INT, KEY(f1)) ENGINE=MyISAM;
INSERT t1 VALUES (4),(8);
CREATE TABLE t2 (f2 INT, KEY(f2)) ENGINE=MyISAM;
INSERT t2 VALUES (6);
SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
(SELECT MAX(sq.f2) FROM t1)
NULL
#
# Disable this query till MDEV-13399 is resolved
#
# INSERT t2 VALUES (9);
# --error ER_SUBQUERY_NO_1_ROW
# SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
#
drop table t1, t2;
# End of 10.0 tests
#
# MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops

View file

@ -7192,6 +7192,21 @@ SELECT ( SELECT MAX(f1) FROM t2 ) FROM t1;
ERROR 21000: Subquery returns more than 1 row
drop view v1;
drop table t1,t2;
CREATE TABLE t1 (f1 INT, KEY(f1)) ENGINE=MyISAM;
INSERT t1 VALUES (4),(8);
CREATE TABLE t2 (f2 INT, KEY(f2)) ENGINE=MyISAM;
INSERT t2 VALUES (6);
SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
(SELECT MAX(sq.f2) FROM t1)
NULL
#
# Disable this query till MDEV-13399 is resolved
#
# INSERT t2 VALUES (9);
# --error ER_SUBQUERY_NO_1_ROW
# SELECT (SELECT MAX(sq.f2) FROM t1) FROM (SELECT * FROM t2) AS sq WHERE f2 = 2;
#
drop table t1, t2;
# End of 10.0 tests
#
# MDEV-9487: Server crashes in Time_and_counter_tracker::incr_loops

View file

@ -115,3 +115,9 @@ k d1 d2
set optimizer_switch= @tmp_subselect_nulls;
drop table x1;
drop table x2;
select (select 1, 2) in (select 3, 4);
(select 1, 2) in (select 3, 4)
0
select (select NULL, NULL) in (select 3, 4);
(select NULL, NULL) in (select 3, 4)
NULL

View file

@ -2,19 +2,21 @@ create or replace table t1(a json);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` text DEFAULT NULL
`a` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
create or replace table t1(a json character set utf8 default '{a:1}');
create or replace table t1(a json character set utf8);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'character set utf8)' at line 1
create or replace table t1(a json default '{a:1}');
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` text CHARACTER SET utf8 DEFAULT '{a:1}'
`a` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT '{a:1}'
) ENGINE=MyISAM DEFAULT CHARSET=latin1
create or replace table t1(a json binary not null check (json_valid(a)));
create or replace table t1(a json not null check (json_valid(a)));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` text CHARACTER SET latin1 COLLATE latin1_bin NOT NULL CHECK (json_valid(`a`))
`a` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`a`))
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert t1 values ('[]');
insert t1 values ('a');
@ -24,7 +26,7 @@ create or replace table t1(a json default(json_object('now', now())));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` text DEFAULT json_object('now',current_timestamp())
`a` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT json_object('now',current_timestamp())
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert t1 values ();
select * from t1;

View file

@ -1219,9 +1219,6 @@ Warning 1292 Truncated incorrect INTEGER value: '1E+'
Warning 1292 Truncated incorrect DECIMAL value: '1E+'
Warning 1292 Truncated incorrect DOUBLE value: '1E+'
#
# End of 10.0 tests
#
#
# Start of 10.1 tests
#
#
@ -1247,5 +1244,17 @@ Warning 1292 Truncated incorrect DOUBLE value: ''
Warning 1292 Truncated incorrect DOUBLE value: ''
Warning 1292 Truncated incorrect DOUBLE value: ''
#
# Start of 10.1 tests
# Start of 10.2 tests
#
CREATE TABLE t1 (a INT SIGNED ZEROFILL);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ZEROFILL)' at line 1
CREATE TABLE t1 (a INT SIGNED UNSIGNED);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNSIGNED)' at line 1
CREATE TABLE t1 (a INT ZEROFILL UNSIGNED ZEROFILL);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ZEROFILL)' at line 1
CREATE OR REPLACE TABLE t1 (a INT SIGNED);
CREATE OR REPLACE TABLE t1 (a INT UNSIGNED);
CREATE OR REPLACE TABLE t1 (a INT ZEROFILL);
CREATE OR REPLACE TABLE t1 (a INT UNSIGNED ZEROFILL);
CREATE OR REPLACE TABLE t1 (a INT ZEROFILL UNSIGNED);
DROP TABLE t1;

View file

@ -2077,6 +2077,24 @@ d
2016-06-04 00:00:00
drop table t1;
End of 5.0 tests
create table t1 (a int, b int);
insert into t1 values (1,1),(2,2),(3,3);
create table t2 (c varchar(30), d varchar(30));
insert into t1 values ('1','1'),('2','2'),('4','4');
create table t3 (e int, f int);
insert into t3 values (1,1),(2,2),(31,31),(32,32);
select e,f, (e , f) in (select e,b from t1 union select c,d from t2) as sub from t3;
e f sub
1 1 1
2 2 1
31 31 0
32 32 0
select avg(f), (e , f) in (select e,b from t1 union select c,d from t2) as sub from t3 group by sub;
avg(f) sub
31.5000 0
1.5000 1
drop table t1,t2,t3;
End of 5.5 tests
#
# WL#1763 Avoid creating temporary table in UNION ALL
#

View file

@ -5680,6 +5680,17 @@ Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`e` AS `e`,`test`.`t3`.`f` AS `f` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`c` = `test`.`t1`.`b` and `test`.`t3`.`f` = `test`.`t1`.`a` and `test`.`t2`.`d` = `test`.`t3`.`e` and `test`.`t1`.`a` is not null and `test`.`t1`.`a` is not null and `test`.`t1`.`b` is not null) where `test`.`t1`.`a` < 5
drop view v1;
drop table t1,t2,t3;
#
# MDEV-11240: Server crashes in check_view_single_update or
# Assertion `derived->table' failed in mysql_derived_merge_for_insert
#
CREATE TABLE t3 (a INT);
CREATE ALGORITHM = MERGE VIEW v1 AS SELECT t2.a FROM t3 AS t1, t3 AS t2;
CREATE ALGORITHM = MERGE VIEW v2 AS SELECT * FROM v1;
PREPARE stmt FROM 'REPLACE INTO v2 SELECT a FROM t3';
ERROR HY000: Can not insert into join view 'test.v2' without fields list
drop view v1,v2;
drop table t3;
# -----------------------------------------------------------------
# -- End of 5.5 tests.
# -----------------------------------------------------------------

View file

@ -9,19 +9,19 @@
<table_data name="t1">
<row>
<field name="a">1</field>
<field name="b">b1</field>
<field name="b"> b1</field>
</row>
<row>
<field name="a">2</field>
<field name="b">b2</field>
<field name="b"> b2</field>
</row>
<row>
<field name="a">3</field>
<field name="b">b3</field>
<field name="b"> b3</field>
</row>
<row>
<field name="a">11</field>
<field name="b">b11</field>
<field name="b"> b11</field>
</row>
<!-- Check field values as tags -->

View file

@ -326,8 +326,8 @@ fid IsClosed(g)
116 0
SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
fid AsText(Centroid(g))
117 POINT(55.58852775304245 17.426536064113982)
118 POINT(55.58852775304245 17.426536064113982)
117 POINT(57.98031067576927 17.854754130800433)
118 POINT(57.98031067576927 17.854754130800433)
119 POINT(2 2)
SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
fid Area(g)

View file

@ -1,14 +1,14 @@
#### Setup tables ####
CREATE TABLE t0 (a CHAR(100));
CREATE TABLE t1 (a CHAR(100));
CREATE TABLE t2 (a CHAR(100));
CREATE TABLE t3 (a CHAR(100));
CREATE TABLE ta0 (a CHAR(100));
CREATE TABLE ta1 (a CHAR(100));
CREATE TABLE ta2 (a CHAR(100));
CREATE TABLE ta3 (a CHAR(100));
CREATE TABLE t0 (a CHAR(200));
CREATE TABLE t1 (a CHAR(200));
CREATE TABLE t2 (a CHAR(200));
CREATE TABLE t3 (a CHAR(200));
CREATE TABLE ta0 (a CHAR(200));
CREATE TABLE ta1 (a CHAR(200));
CREATE TABLE ta2 (a CHAR(200));
CREATE TABLE ta3 (a CHAR(200));
CREATE TABLE autoinc_table (a INT PRIMARY KEY AUTO_INCREMENT);
CREATE TABLE data_table (a CHAR(100));
CREATE TABLE data_table (a CHAR(200));
INSERT INTO data_table VALUES ('foo');
CREATE TABLE trigger_table_1 (a INT);
CREATE TABLE trigger_table_2 (a INT);
@ -2357,7 +2357,7 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc
DROP PROCEDURE p1;
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a VARCHAR(100), b VARCHAR(100));
CREATE TABLE t1 (a VARCHAR(200), b VARCHAR(200));
INSERT INTO t1 VALUES ('a','b');
UPDATE t1 SET b = '%s%s%s%s%s%s%s%s%s%s%s%s%s%s' WHERE a = 'a' LIMIT 1;
Warnings:
@ -2388,7 +2388,7 @@ CREATE FUNCTION fun_check_log_bin() RETURNS INT
BEGIN
SET @@SQL_LOG_BIN = 0;
INSERT INTO t1 VALUES(@@global.sync_binlog);
RETURN 100;
RETURN 200;
END|
"One unsafe warning should be issued in the following statement"
SELECT fun_check_log_bin();

View file

@ -106,16 +106,16 @@ call mtr.add_suppression("Unsafe statement written to the binary log using state
--echo #### Setup tables ####
CREATE TABLE t0 (a CHAR(100));
CREATE TABLE t1 (a CHAR(100));
CREATE TABLE t2 (a CHAR(100));
CREATE TABLE t3 (a CHAR(100));
CREATE TABLE ta0 (a CHAR(100));
CREATE TABLE ta1 (a CHAR(100));
CREATE TABLE ta2 (a CHAR(100));
CREATE TABLE ta3 (a CHAR(100));
CREATE TABLE t0 (a CHAR(200));
CREATE TABLE t1 (a CHAR(200));
CREATE TABLE t2 (a CHAR(200));
CREATE TABLE t3 (a CHAR(200));
CREATE TABLE ta0 (a CHAR(200));
CREATE TABLE ta1 (a CHAR(200));
CREATE TABLE ta2 (a CHAR(200));
CREATE TABLE ta3 (a CHAR(200));
CREATE TABLE autoinc_table (a INT PRIMARY KEY AUTO_INCREMENT);
CREATE TABLE data_table (a CHAR(100));
CREATE TABLE data_table (a CHAR(200));
INSERT INTO data_table VALUES ('foo');
CREATE TABLE trigger_table_1 (a INT);
CREATE TABLE trigger_table_2 (a INT);
@ -429,7 +429,7 @@ DROP TABLE t1;
DROP TABLE IF EXISTS t1;
--enable_warnings
CREATE TABLE t1 (a VARCHAR(100), b VARCHAR(100));
CREATE TABLE t1 (a VARCHAR(200), b VARCHAR(200));
INSERT INTO t1 VALUES ('a','b');
UPDATE t1 SET b = '%s%s%s%s%s%s%s%s%s%s%s%s%s%s' WHERE a = 'a' LIMIT 1;
DROP TABLE t1;
@ -467,7 +467,7 @@ CREATE FUNCTION fun_check_log_bin() RETURNS INT
BEGIN
SET @@SQL_LOG_BIN = 0;
INSERT INTO t1 VALUES(@@global.sync_binlog);
RETURN 100;
RETURN 200;
END|
DELIMITER ;|
--echo "One unsafe warning should be issued in the following statement"

View file

@ -1,6 +1,8 @@
call mtr.add_suppression("Plugin 'file_key_management'");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error.");
call mtr.add_suppression("InnoDB: The page \[page id: space=[1-9][0-9]*, page number=[0-9]+\] in file test/t[1-4] cannot be decrypted");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[0-9]+\\] in file test/t[1-4] cannot be decrypted");
call mtr.add_suppression("InnoDB: Unable to decompress .*.test.t1\\.ibd\\[page id: space=[1-9][0-9]*, page number=[0-9]+\\]");
call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t1 page \\[page id: space=[1-9][0-9]*, page number=[0-9]*\\]");
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
# Restart mysqld --file-key-management-filename=keys2.txt

View file

@ -37,8 +37,6 @@ NOT FOUND /private|secret|sacr(ed|ament)|success|story|secur(e|ity)/ in ibdata1
NOT FOUND /private|secret|sacr(ed|ament)|success|story|secur(e|ity)/ in t0.ibd
# ib_logfile0 expecting NOT FOUND
NOT FOUND /private|secret|sacr(ed|ament)|success|story|secur(e|ity)/ in ib_logfile0
# ib_logfile1 expecting NOT FOUND
NOT FOUND /private|secret|sacr(ed|ament)|success|story|secur(e|ity)/ in ib_logfile1
# Restart without redo log encryption
SELECT COUNT(*) FROM t0;
COUNT(*)

View file

@ -0,0 +1,7 @@
call mtr.add_suppression('debug.key.management');
install soname 'debug_key_management';
ERROR HY000: Can't initialize function 'debug_key_management'; Plugin initialization function failed.
create table t1 (a varchar(255)) engine=innodb encrypted=yes;
create table t2 (a varchar(255)) engine=innodb;
create table t3 (a varchar(255)) engine=innodb encrypted=no;
drop table t1, t2, t3;

View file

@ -2,7 +2,6 @@
# MDEV-8773: InnoDB innochecksum does not work with encrypted or page compressed tables
#
--source include/innodb_page_size_small.inc
# Don't test under embedded as we restart server
-- source include/not_embedded.inc
# Require InnoDB

View file

@ -5,7 +5,9 @@
call mtr.add_suppression("Plugin 'file_key_management'");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error.");
call mtr.add_suppression("InnoDB: The page \[page id: space=[1-9][0-9]*, page number=[0-9]+\] in file test/t[1-4] cannot be decrypted");
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[0-9]+\\] in file test/t[1-4] cannot be decrypted");
call mtr.add_suppression("InnoDB: Unable to decompress .*.test.t1\\.ibd\\[page id: space=[1-9][0-9]*, page number=[0-9]+\\]");
call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed file read of tablespace test/t1 page \\[page id: space=[1-9][0-9]*, page number=[0-9]*\\]");
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");

View file

@ -3,4 +3,5 @@
--plugin-load-add=$FILE_KEY_MANAGEMENT_SO
--loose-file-key-management
--loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/logkey.txt
--innodb-log-files-in-group=1
--file-key-management-encryption-algorithm=aes_cbc

View file

@ -57,9 +57,6 @@ INSERT INTO t0
--echo # ib_logfile0 expecting NOT FOUND
-- let SEARCH_FILE=$MYSQLD_DATADIR/ib_logfile0
-- source include/search_pattern_in_file.inc
--echo # ib_logfile1 expecting NOT FOUND
-- let SEARCH_FILE=$MYSQLD_DATADIR/ib_logfile1
-- source include/search_pattern_in_file.inc
--echo # Restart without redo log encryption
-- let $restart_parameters=--skip-innodb-encrypt-log --innodb-log-files-in-group=1

View file

@ -0,0 +1,16 @@
#
# MDEV-12863 No table can be created after second encryption plugin attempted to load
#
--source include/have_innodb.inc
--source include/have_file_key_management_plugin.inc
call mtr.add_suppression('debug.key.management');
--error 1123
install soname 'debug_key_management';
create table t1 (a varchar(255)) engine=innodb encrypted=yes;
create table t2 (a varchar(255)) engine=innodb;
create table t3 (a varchar(255)) engine=innodb encrypted=no;
drop table t1, t2, t3;

View file

@ -0,0 +1,10 @@
SET GLOBAL query_cache_size= 16*1024*1024;
SET GLOBAL query_cache_type= 1;
CREATE TABLE t1 (i INT);
CREATE TABLE t2 (i INT) ENGINE=FEDERATED CONNECTION="mysql://root@localhost:MASTER_MYPORT/test/t1";
ALTER TABLE t2 DISABLE KEYS;
ERROR HY000: Storage engine FEDERATED of the table `test`.`t2` doesn't have this option
CREATE TABLE t3 (i INT) ENGINE=FEDERATED CONNECTION="mysql://root@localhost:MASTER_MYPORT/test/t1";
SET GLOBAL query_cache_size= default;
SET GLOBAL query_cache_type= default;
drop table t1, t2, t3;

View file

@ -0,0 +1,17 @@
#
# MDEV-12725 select on federated table crashes server
#
#
SET GLOBAL query_cache_size= 16*1024*1024;
SET GLOBAL query_cache_type= 1;
CREATE TABLE t1 (i INT);
--replace_result $MASTER_MYPORT MASTER_MYPORT
eval CREATE TABLE t2 (i INT) ENGINE=FEDERATED CONNECTION="mysql://root@localhost:$MASTER_MYPORT/test/t1";
--error ER_ILLEGAL_HA
ALTER TABLE t2 DISABLE KEYS;
--replace_result $MASTER_MYPORT MASTER_MYPORT
eval CREATE TABLE t3 (i INT) ENGINE=FEDERATED CONNECTION="mysql://root@localhost:$MASTER_MYPORT/test/t1";
source include/restart_mysqld.inc;
SET GLOBAL query_cache_size= default;
SET GLOBAL query_cache_type= default;
drop table t1, t2, t3;

View file

@ -232,12 +232,6 @@ 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
@ -328,7 +322,7 @@ if (!$mysql_errno)
INSERT INTO information_schema.key_column_usage
SELECT * FROM information_schema.key_column_usage;
--error ER_DBACCESS_DENIED_ERROR
--error ER_DBACCESS_DENIED_ERROR,ER_NON_UPDATABLE_TABLE
UPDATE information_schema.key_column_usage
SET table_name = 'db1' WHERE constraint_name = 'primary';

View file

@ -441,7 +441,7 @@ ENGINE = $engine_type;
INSERT INTO information_schema.tables
SELECT * FROM information_schema.tables;
--error ER_DBACCESS_DENIED_ERROR
--error ER_DBACCESS_DENIED_ERROR,ER_NON_UPDATABLE_TABLE
UPDATE information_schema.tables SET table_schema = 'test'
WHERE table_name = 't1';

View file

@ -236,7 +236,7 @@ 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 ER_DBACCESS_DENIED_ERROR
--error ER_DBACCESS_DENIED_ERROR,ER_NON_UPDATABLE_TABLE
UPDATE information_schema.triggers SET trigger_schema = 'test'
WHERE table_name = 't1';

View file

@ -278,7 +278,7 @@ SELECT * FROM information_schema.views;
INSERT INTO information_schema.views(table_schema, table_name)
VALUES ('db2', 'v2');
--error ER_DBACCESS_DENIED_ERROR
--error ER_DBACCESS_DENIED_ERROR,ER_NON_UPDATABLE_TABLE
UPDATE information_schema.views SET table_schema = 'test'
WHERE table_name = 't1';

View file

@ -57,7 +57,7 @@ INSERT INTO information_schema.character_sets
SELECT * FROM information_schema.character_sets;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
UPDATE information_schema.character_sets SET description = 'just updated';
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
Got one of the listed errors
DELETE FROM information_schema.character_sets WHERE table_name = 't1';
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
TRUNCATE information_schema.character_sets;

View file

@ -52,10 +52,10 @@ SELECT * FROM information_schema.collation_character_set_applicability;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
UPDATE information_schema.collation_character_set_applicability
SET collation_name = 'big6_chinese_ci' WHERE character_set_name = 'big6';
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
Got one of the listed errors
UPDATE information_schema.collation_character_set_applicability
SET character_set_name = 't_4711';
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
Got one of the listed errors
DELETE FROM information_schema.collation_character_set_applicability;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
TRUNCATE information_schema.collation_character_set_applicability;

View file

@ -67,7 +67,7 @@ INSERT INTO information_schema.collations
VALUES ( 'cp1251_bin', 'cp1251',50, '', '',0);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
UPDATE information_schema.collations SET description = 'just updated';
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
Got one of the listed errors
DELETE FROM information_schema.collations WHERE table_name = 't1';
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
TRUNCATE information_schema.collations;

View file

@ -64,7 +64,7 @@ INSERT INTO information_schema.engines
SELECT * FROM information_schema.engines;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
UPDATE information_schema.engines SET engine = '1234567';
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
Got one of the listed errors
DELETE FROM information_schema.engines WHERE support IN ('DEFAULT','YES');
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
TRUNCATE information_schema.engines;

View file

@ -128,7 +128,7 @@ SELECT * FROM information_schema.events;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
UPDATE information_schema.events SET event_name = '1234567'
WHERE table_name = 't1';
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
Got one of the listed errors
DELETE FROM information_schema.events WHERE event_catalog IS NULL;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
TRUNCATE information_schema.events;

View file

@ -345,28 +345,6 @@ 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'
@ -374,6 +352,8 @@ ORDER BY table_name, column_name;
table_name column_name
t1_my_tablex f2
t1_my_tablex f4
t1_my_tablex first_col
t1_my_tablex first_col
DROP TABLE db_datadict.t1_my_tablex;
SELECT table_name, column_name
FROM information_schema.key_column_usage
@ -419,7 +399,7 @@ 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'
Got one of the listed errors
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;

View file

@ -28,10 +28,10 @@ DROP FUNCTION test.f1;
#########################################################################
DESCRIBE information_schema.KEY_COLUMN_USAGE;
Field Type Null Key Default Extra
CONSTRAINT_CATALOG varchar(512) YES NULL
CONSTRAINT_CATALOG varchar(512) NO
CONSTRAINT_SCHEMA varchar(64) NO
CONSTRAINT_NAME varchar(64) NO
TABLE_CATALOG varchar(512) YES NULL
TABLE_CATALOG varchar(512) NO
TABLE_SCHEMA varchar(64) NO
TABLE_NAME varchar(64) NO
COLUMN_NAME varchar(64) NO
@ -43,14 +43,14 @@ 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_CATALOG` varchar(512) NOT NULL DEFAULT '',
`CONSTRAINT_SCHEMA` varchar(64) NOT NULL DEFAULT '',
`CONSTRAINT_NAME` varchar(64) NOT NULL DEFAULT '',
`TABLE_CATALOG` varchar(512) DEFAULT NULL,
`TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '',
`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',
`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,
@ -58,10 +58,10 @@ KEY_COLUMN_USAGE CREATE TEMPORARY TABLE `KEY_COLUMN_USAGE` (
) 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_CATALOG varchar(512) NO
CONSTRAINT_SCHEMA varchar(64) NO
CONSTRAINT_NAME varchar(64) NO
TABLE_CATALOG varchar(512) YES NULL
TABLE_CATALOG varchar(512) NO
TABLE_SCHEMA varchar(64) NO
TABLE_NAME varchar(64) NO
COLUMN_NAME varchar(64) NO
@ -75,6 +75,74 @@ 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
def mysql PRIMARY def mysql column_stats db_name
def mysql PRIMARY def mysql column_stats table_name
def mysql PRIMARY def mysql column_stats column_name
def mysql PRIMARY def mysql columns_priv Host
def mysql PRIMARY def mysql columns_priv Db
def mysql PRIMARY def mysql columns_priv User
def mysql PRIMARY def mysql columns_priv Table_name
def mysql PRIMARY def mysql columns_priv Column_name
def mysql PRIMARY def mysql db Host
def mysql PRIMARY def mysql db Db
def mysql PRIMARY def mysql db User
def mysql PRIMARY def mysql event db
def mysql PRIMARY def mysql event name
def mysql PRIMARY def mysql func name
def mysql PRIMARY def mysql gtid_slave_pos domain_id
def mysql PRIMARY def mysql gtid_slave_pos sub_id
def mysql PRIMARY def mysql help_category help_category_id
def mysql name def mysql help_category name
def mysql PRIMARY def mysql help_keyword help_keyword_id
def mysql name def mysql help_keyword name
def mysql PRIMARY def mysql help_relation help_keyword_id
def mysql PRIMARY def mysql help_relation help_topic_id
def mysql PRIMARY def mysql help_topic help_topic_id
def mysql name def mysql help_topic name
def mysql PRIMARY def mysql host Host
def mysql PRIMARY def mysql host Db
def mysql PRIMARY def mysql index_stats db_name
def mysql PRIMARY def mysql index_stats table_name
def mysql PRIMARY def mysql index_stats index_name
def mysql PRIMARY def mysql index_stats prefix_arity
def mysql PRIMARY def mysql innodb_index_stats database_name
def mysql PRIMARY def mysql innodb_index_stats table_name
def mysql PRIMARY def mysql innodb_index_stats index_name
def mysql PRIMARY def mysql innodb_index_stats stat_name
def mysql PRIMARY def mysql innodb_table_stats database_name
def mysql PRIMARY def mysql innodb_table_stats table_name
def mysql PRIMARY def mysql plugin name
def mysql PRIMARY def mysql proc db
def mysql PRIMARY def mysql proc name
def mysql PRIMARY def mysql proc type
def mysql PRIMARY def mysql procs_priv Host
def mysql PRIMARY def mysql procs_priv Db
def mysql PRIMARY def mysql procs_priv User
def mysql PRIMARY def mysql procs_priv Routine_name
def mysql PRIMARY def mysql procs_priv Routine_type
def mysql PRIMARY def mysql proxies_priv Host
def mysql PRIMARY def mysql proxies_priv User
def mysql PRIMARY def mysql proxies_priv Proxied_host
def mysql PRIMARY def mysql proxies_priv Proxied_user
def mysql Host def mysql roles_mapping Host
def mysql Host def mysql roles_mapping User
def mysql Host def mysql roles_mapping Role
def mysql PRIMARY def mysql servers Server_name
def mysql PRIMARY def mysql table_stats db_name
def mysql PRIMARY def mysql table_stats table_name
def mysql PRIMARY def mysql tables_priv Host
def mysql PRIMARY def mysql tables_priv Db
def mysql PRIMARY def mysql tables_priv User
def mysql PRIMARY def mysql tables_priv Table_name
def mysql PRIMARY def mysql time_zone Time_zone_id
def mysql PRIMARY def mysql time_zone_leap_second Transition_time
def mysql PRIMARY def mysql time_zone_name Name
def mysql PRIMARY def mysql time_zone_transition Time_zone_id
def mysql PRIMARY def mysql time_zone_transition Transition_time
def mysql PRIMARY def mysql time_zone_transition_type Time_zone_id
def mysql PRIMARY def mysql time_zone_transition_type Transition_type_id
def mysql PRIMARY def mysql user Host
def mysql PRIMARY def mysql user User
########################################################################################
# Testcase 3.2.7.2 + 3.2.7.3: INFORMATION_SCHEMA.KEY_COLUMN_USAGE accessible information
########################################################################################
@ -100,25 +168,27 @@ 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)
def db_datadict PRIMARY def db_datadict t1_1 f1 1 NULL NULL NULL NULL
def db_datadict PRIMARY def db_datadict t1_2 f1 1 NULL NULL NULL NULL
connect testuser1, localhost, testuser1, , db_datadict;
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)
def db_datadict PRIMARY def db_datadict t1_1 f1 1 NULL NULL NULL NULL
def db_datadict PRIMARY def db_datadict t1_2 f1 1 NULL NULL NULL NULL
connect testuser2, localhost, testuser2, , db_datadict;
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
def db_datadict PRIMARY def db_datadict t1_1 f1 1 NULL NULL NULL NULL
def db_datadict PRIMARY def db_datadict t1_2 f1 1 NULL NULL NULL NULL
connection default;
disconnect testuser1;
disconnect testuser2;
DROP USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
DROP TABLE t1_1;
@ -139,10 +209,10 @@ 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_CATALOG def
CONSTRAINT_SCHEMA test
CONSTRAINT_NAME PRIMARY
TABLE_CATALOG NULL
TABLE_CATALOG def
TABLE_SCHEMA test
TABLE_NAME t1_my_table
COLUMN_NAME f1
@ -151,10 +221,10 @@ POSITION_IN_UNIQUE_CONSTRAINT NULL
REFERENCED_TABLE_SCHEMA NULL
REFERENCED_TABLE_NAME NULL
REFERENCED_COLUMN_NAME NULL
CONSTRAINT_CATALOG NULL
CONSTRAINT_CATALOG def
CONSTRAINT_SCHEMA test
CONSTRAINT_NAME PRIMARY
TABLE_CATALOG NULL
TABLE_CATALOG def
TABLE_SCHEMA test
TABLE_NAME t1_my_table
COLUMN_NAME f2
@ -277,28 +347,6 @@ 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'
@ -306,6 +354,8 @@ ORDER BY table_name, column_name;
table_name column_name
t1_my_tablex f2
t1_my_tablex f4
t1_my_tablex first_col
t1_my_tablex first_col
DROP TABLE db_datadict.t1_my_tablex;
SELECT table_name, column_name
FROM information_schema.key_column_usage
@ -351,7 +401,7 @@ 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'
Got one of the listed errors
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;

View file

@ -1,3 +1,4 @@
set sql_mode="";
SHOW TABLES FROM information_schema LIKE 'ROUTINES';
Tables_in_information_schema (ROUTINES)
ROUTINES
@ -29,11 +30,19 @@ DROP FUNCTION test.f1;
DESCRIBE information_schema.ROUTINES;
Field Type Null Key Default Extra
SPECIFIC_NAME varchar(64) NO
ROUTINE_CATALOG varchar(512) YES NULL
ROUTINE_CATALOG varchar(512) NO
ROUTINE_SCHEMA varchar(64) NO
ROUTINE_NAME varchar(64) NO
ROUTINE_TYPE varchar(9) NO
DTD_IDENTIFIER varchar(64) YES NULL
DATA_TYPE varchar(64) NO
CHARACTER_MAXIMUM_LENGTH int(21) YES NULL
CHARACTER_OCTET_LENGTH int(21) YES NULL
NUMERIC_PRECISION int(21) YES NULL
NUMERIC_SCALE int(21) YES NULL
DATETIME_PRECISION bigint(21) unsigned YES NULL
CHARACTER_SET_NAME varchar(64) YES NULL
COLLATION_NAME varchar(64) YES NULL
DTD_IDENTIFIER longtext YES NULL
ROUTINE_BODY varchar(8) NO
ROUTINE_DEFINITION longtext YES NULL
EXTERNAL_NAME varchar(64) YES NULL
@ -45,23 +54,31 @@ 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
SQL_MODE varchar(8192) NO
ROUTINE_COMMENT longtext NO
DEFINER varchar(189) NO
CHARACTER_SET_CLIENT varchar(32) NO
COLLATION_CONNECTION varchar(32) NO
DATABASE_COLLATION 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_CATALOG` varchar(512) NOT NULL DEFAULT '',
`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,
`DATA_TYPE` varchar(64) NOT NULL DEFAULT '',
`CHARACTER_MAXIMUM_LENGTH` int(21) DEFAULT NULL,
`CHARACTER_OCTET_LENGTH` int(21) DEFAULT NULL,
`NUMERIC_PRECISION` int(21) DEFAULT NULL,
`NUMERIC_SCALE` int(21) DEFAULT NULL,
`DATETIME_PRECISION` bigint(21) unsigned DEFAULT NULL,
`CHARACTER_SET_NAME` varchar(64) DEFAULT NULL,
`COLLATION_NAME` varchar(64) DEFAULT NULL,
`DTD_IDENTIFIER` longtext DEFAULT NULL,
`ROUTINE_BODY` varchar(8) NOT NULL DEFAULT '',
`ROUTINE_DEFINITION` longtext,
`ROUTINE_DEFINITION` longtext DEFAULT NULL,
`EXTERNAL_NAME` varchar(64) DEFAULT NULL,
`EXTERNAL_LANGUAGE` varchar(64) DEFAULT NULL,
`PARAMETER_STYLE` varchar(8) NOT NULL DEFAULT '',
@ -71,21 +88,29 @@ ROUTINES CREATE TEMPORARY TABLE `ROUTINES` (
`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 '',
`SQL_MODE` varchar(8192) NOT NULL DEFAULT '',
`ROUTINE_COMMENT` longtext NOT NULL DEFAULT '',
`DEFINER` varchar(189) 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
) 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_CATALOG varchar(512) NO
ROUTINE_SCHEMA varchar(64) NO
ROUTINE_NAME varchar(64) NO
ROUTINE_TYPE varchar(9) NO
DTD_IDENTIFIER varchar(64) YES NULL
DATA_TYPE varchar(64) NO
CHARACTER_MAXIMUM_LENGTH int(21) YES NULL
CHARACTER_OCTET_LENGTH int(21) YES NULL
NUMERIC_PRECISION int(21) YES NULL
NUMERIC_SCALE int(21) YES NULL
DATETIME_PRECISION bigint(21) unsigned YES NULL
CHARACTER_SET_NAME varchar(64) YES NULL
COLLATION_NAME varchar(64) YES NULL
DTD_IDENTIFIER longtext YES NULL
ROUTINE_BODY varchar(8) NO
ROUTINE_DEFINITION longtext YES NULL
EXTERNAL_NAME varchar(64) YES NULL
@ -97,12 +122,12 @@ 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
SQL_MODE varchar(8192) NO
ROUTINE_COMMENT longtext NO
DEFINER varchar(189) NO
CHARACTER_SET_CLIENT varchar(32) NO
COLLATION_CONNECTION varchar(32) NO
DATABASE_COLLATION varchar(32) NO
DATABASE_COLLATION varchar(32) NO
USE test;
DROP PROCEDURE IF EXISTS sp_for_routines;
DROP FUNCTION IF EXISTS function_for_routines;
@ -111,11 +136,14 @@ 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
WHERE routine_schema = 'test' AND
(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;
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
function_for_routines def test function_for_routines FUNCTION SQL NULL NULL SQL NULL
sp_for_routines def test sp_for_routines PROCEDURE SQL NULL NULL SQL NULL
DROP PROCEDURE sp_for_routines;
DROP FUNCTION function_for_routines;
################################################################################
@ -159,34 +187,46 @@ 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)
connect testuser1, localhost, testuser1, , db_datadict;
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
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME 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 def db_datadict sp_6_408002_1 PROCEDURE NULL NULL NULL NULL NULL NULL NULL 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
sp_6_408002_2 def db_datadict_2 sp_6_408002_2 PROCEDURE NULL NULL NULL NULL NULL NULL NULL 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)
add_suppression def mtr add_suppression PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); FLUSH NO_WRITE_TO_BINLOG TABLE test_suppressions; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp', 'innodb_file_format_max') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema'); SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, 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, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert'); SELECT * FROM INFORMATION_SCHEMA.ROUTINES; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.host, mysql.plugin, mysql.proc, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.user; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
check_warnings def mtr check_warnings PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
connect testuser2, localhost, testuser2, , db_datadict;
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
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME 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 def db_datadict sp_6_408002_1 PROCEDURE NULL NULL NULL NULL NULL NULL NULL 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
sp_6_408002_2 def db_datadict_2 sp_6_408002_2 PROCEDURE NULL NULL NULL NULL NULL NULL NULL 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)
add_suppression def mtr add_suppression PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); FLUSH NO_WRITE_TO_BINLOG TABLE test_suppressions; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp', 'innodb_file_format_max') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema'); SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, 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, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert'); SELECT * FROM INFORMATION_SCHEMA.ROUTINES; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.host, mysql.plugin, mysql.proc, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.user; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
check_warnings def mtr check_warnings PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
connect testuser3, localhost, testuser3, , test;
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
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME 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 def db_datadict sp_6_408002_1 PROCEDURE NULL NULL NULL NULL NULL NULL NULL 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
sp_6_408002_2 def db_datadict_2 sp_6_408002_2 PROCEDURE NULL NULL NULL NULL NULL NULL NULL 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
add_suppression def mtr add_suppression PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN INSERT INTO test_suppressions (pattern) VALUES (pattern); FLUSH NO_WRITE_TO_BINLOG TABLE test_suppressions; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
check_testcase def mtr check_testcase PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE variable_name NOT IN ('timestamp', 'innodb_file_format_max') AND variable_name not like "Last_IO_Err*" AND variable_name != 'INNODB_IBUF_MAX_SIZE' AND variable_name != 'INNODB_USE_NATIVE_AIO' AND variable_name != 'INNODB_BUFFER_POOL_LOAD_AT_STARTUP' AND variable_name not like 'GTID%POS' AND variable_name != 'GTID_BINLOG_STATE' ORDER BY variable_name; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA; SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME NOT IN ('mtr_wsrep_notify', 'wsrep_schema'); SELECT table_name AS tables_in_test FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='test'; SELECT CONCAT(table_schema, '.', table_name) AS tables_in_mysql FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='mysql' ORDER BY tables_in_mysql; SELECT CONCAT(table_schema, '.', table_name) AS columns_in_mysql, 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, column_comment FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema='mysql' ORDER BY columns_in_mysql; SELECT * FROM INFORMATION_SCHEMA.EVENTS; SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME NOT IN ('gs_insert', 'ts_insert'); SELECT * FROM INFORMATION_SCHEMA.ROUTINES; SHOW STATUS LIKE 'slave_open_temp_tables'; checksum table mysql.columns_priv, mysql.db, mysql.func, mysql.help_category, mysql.help_keyword, mysql.help_relation, mysql.host, mysql.plugin, mysql.proc, mysql.procs_priv, mysql.roles_mapping, mysql.tables_priv, mysql.time_zone, mysql.time_zone_leap_second, mysql.time_zone_name, mysql.time_zone_transition, mysql.time_zone_transition_type, mysql.user; SELECT * FROM INFORMATION_SCHEMA.PLUGINS; select * from information_schema.session_variables where variable_name = 'debug_sync'; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
check_warnings def mtr check_warnings PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL BEGIN DECLARE `pos` bigint unsigned; SET SQL_LOG_BIN=0; UPDATE error_log el, global_suppressions gs SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP gs.pattern; UPDATE error_log el, test_suppressions ts SET suspicious=0 WHERE el.suspicious=1 AND el.line REGEXP ts.pattern; SELECT COUNT(*) INTO @num_warnings FROM error_log WHERE suspicious=1; IF @num_warnings > 0 THEN SELECT line FROM error_log WHERE suspicious=1; SELECT 2 INTO result; ELSE SELECT 0 INTO RESULT; END IF; TRUNCATE test_suppressions; DROP TABLE error_log; END NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost utf8 utf8_general_ci latin1_swedish_ci
connection default;
disconnect testuser1;
disconnect testuser2;
disconnect testuser3;
DROP USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
DROP USER 'testuser3'@'localhost';
@ -199,17 +239,25 @@ DROP DATABASE db_datadict_2;
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
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME 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_CATALOG def
ROUTINE_SCHEMA db_datadict
ROUTINE_NAME function_for_routines
ROUTINE_TYPE FUNCTION
DATA_TYPE int
CHARACTER_MAXIMUM_LENGTH NULL
CHARACTER_OCTET_LENGTH NULL
NUMERIC_PRECISION 10
NUMERIC_SCALE 0
DATETIME_PRECISION NULL
CHARACTER_SET_NAME NULL
COLLATION_NAME NULL
DTD_IDENTIFIER int(11)
ROUTINE_BODY SQL
ROUTINE_DEFINITION RETURN 0
@ -229,10 +277,18 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_for_routines
ROUTINE_CATALOG NULL
ROUTINE_CATALOG def
ROUTINE_SCHEMA db_datadict
ROUTINE_NAME sp_for_routines
ROUTINE_TYPE PROCEDURE
DATA_TYPE
CHARACTER_MAXIMUM_LENGTH NULL
CHARACTER_OCTET_LENGTH NULL
NUMERIC_PRECISION NULL
NUMERIC_SCALE NULL
DATETIME_PRECISION NULL
CHARACTER_SET_NAME NULL
COLLATION_NAME NULL
DTD_IDENTIFIER NULL
ROUTINE_BODY SQL
ROUTINE_DEFINITION SELECT 'db_datadict'
@ -256,10 +312,18 @@ 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_CATALOG def
ROUTINE_SCHEMA db_datadict
ROUTINE_NAME function_for_routines
ROUTINE_TYPE FUNCTION
DATA_TYPE int
CHARACTER_MAXIMUM_LENGTH NULL
CHARACTER_OCTET_LENGTH NULL
NUMERIC_PRECISION 10
NUMERIC_SCALE 0
DATETIME_PRECISION NULL
CHARACTER_SET_NAME NULL
COLLATION_NAME NULL
DTD_IDENTIFIER int(11)
ROUTINE_BODY SQL
ROUTINE_DEFINITION RETURN 0
@ -279,10 +343,18 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_for_routines
ROUTINE_CATALOG NULL
ROUTINE_CATALOG def
ROUTINE_SCHEMA db_datadict
ROUTINE_NAME sp_for_routines
ROUTINE_TYPE PROCEDURE
DATA_TYPE
CHARACTER_MAXIMUM_LENGTH NULL
CHARACTER_OCTET_LENGTH NULL
NUMERIC_PRECISION NULL
NUMERIC_SCALE NULL
DATETIME_PRECISION NULL
CHARACTER_SET_NAME NULL
COLLATION_NAME NULL
DTD_IDENTIFIER NULL
ROUTINE_BODY SQL
ROUTINE_DEFINITION SELECT 'db_datadict'
@ -304,16 +376,24 @@ 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
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME 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_CATALOG def
ROUTINE_SCHEMA db_datadict
ROUTINE_NAME function_for_routines
ROUTINE_TYPE FUNCTION
DATA_TYPE int
CHARACTER_MAXIMUM_LENGTH NULL
CHARACTER_OCTET_LENGTH NULL
NUMERIC_PRECISION 10
NUMERIC_SCALE 0
DATETIME_PRECISION NULL
CHARACTER_SET_NAME NULL
COLLATION_NAME NULL
DTD_IDENTIFIER int(11)
ROUTINE_BODY SQL
ROUTINE_DEFINITION RETURN 0
@ -333,10 +413,18 @@ CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_for_routines
ROUTINE_CATALOG NULL
ROUTINE_CATALOG def
ROUTINE_SCHEMA db_datadict
ROUTINE_NAME sp_for_routines
ROUTINE_TYPE PROCEDURE
DATA_TYPE
CHARACTER_MAXIMUM_LENGTH NULL
CHARACTER_OCTET_LENGTH NULL
NUMERIC_PRECISION NULL
NUMERIC_SCALE NULL
DATETIME_PRECISION NULL
CHARACTER_SET_NAME NULL
COLLATION_NAME NULL
DTD_IDENTIFIER NULL
ROUTINE_BODY SQL
ROUTINE_DEFINITION SELECT 'db_datadict'
@ -358,7 +446,7 @@ 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
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME 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
@ -498,10 +586,18 @@ 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_CATALOG def
ROUTINE_SCHEMA db_datadict
ROUTINE_NAME sp_6_408004
ROUTINE_TYPE PROCEDURE
DATA_TYPE
CHARACTER_MAXIMUM_LENGTH NULL
CHARACTER_OCTET_LENGTH NULL
NUMERIC_PRECISION NULL
NUMERIC_SCALE NULL
DATETIME_PRECISION NULL
CHARACTER_SET_NAME NULL
COLLATION_NAME NULL
DTD_IDENTIFIER NULL
ROUTINE_BODY SQL
ROUTINE_DEFINITION BEGIN
@ -630,7 +726,7 @@ 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'
ERROR HY000: The target table routines of the UPDATE is not updatable
DELETE FROM information_schema.routines ;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
TRUNCATE information_schema.routines ;

View file

@ -28,31 +28,36 @@ DROP FUNCTION test.f1;
#########################################################################
DESCRIBE information_schema.SCHEMATA;
Field Type Null Key Default Extra
CATALOG_NAME varchar(512) YES NULL
CATALOG_NAME varchar(512) NO
SCHEMA_NAME varchar(64) NO
DEFAULT_CHARACTER_SET_NAME varchar(64) NO
DEFAULT_COLLATION_NAME varchar(64) NO
DEFAULT_CHARACTER_SET_NAME varchar(32) NO
DEFAULT_COLLATION_NAME varchar(32) 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,
`CATALOG_NAME` varchar(512) NOT NULL DEFAULT '',
`SCHEMA_NAME` varchar(64) NOT NULL DEFAULT '',
`DEFAULT_CHARACTER_SET_NAME` varchar(64) NOT NULL DEFAULT '',
`DEFAULT_COLLATION_NAME` varchar(64) NOT NULL DEFAULT '',
`DEFAULT_CHARACTER_SET_NAME` varchar(32) NOT NULL DEFAULT '',
`DEFAULT_COLLATION_NAME` varchar(32) 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
CATALOG_NAME varchar(512) NO
SCHEMA_NAME varchar(64) NO
DEFAULT_CHARACTER_SET_NAME varchar(64) NO
DEFAULT_COLLATION_NAME varchar(64) NO
DEFAULT_CHARACTER_SET_NAME varchar(32) NO
DEFAULT_COLLATION_NAME varchar(32) 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
def information_schema NULL
def mtr NULL
def mysql NULL
def performance_schema NULL
def test NULL
###############################################################################
# Testcases 3.2.9.2+3.2.9.3: INFORMATION_SCHEMA.SCHEMATA accessible information
###############################################################################
@ -72,43 +77,46 @@ 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
def db_datadict_1 latin1 latin1_swedish_ci NULL
def 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)
connect testuser1, localhost, testuser1, , db_datadict_1;
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
def db_datadict_1 latin1 latin1_swedish_ci NULL
def 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)
connect testuser2, localhost, testuser2, , db_datadict_2;
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
def db_datadict_1 latin1 latin1_swedish_ci NULL
def 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)
connect testuser3, localhost, testuser3, , test;
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
def db_datadict_1 latin1 latin1_swedish_ci NULL
def 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
connection default;
disconnect testuser1;
disconnect testuser2;
disconnect testuser3;
DROP USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
DROP USER 'testuser3'@'localhost';
@ -123,7 +131,7 @@ CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_P
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
def 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
@ -167,9 +175,9 @@ ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_
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'
ERROR HY000: The target table schemata of the UPDATE is not updatable
UPDATE information_schema.schemata SET catalog_name = 't_4711';
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
ERROR HY000: The target table schemata of the UPDATE is not updatable
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;

View file

@ -162,7 +162,7 @@ SELECT table_name FROM information_schema.table_constraints
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))
(f1 CHAR(12), f2 TIMESTAMP, f4 BIGINT, PRIMARY KEY(f1))
DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci
ENGINE = <engine_type>;
SELECT constraint_name, table_schema, table_name, constraint_type

View file

@ -402,7 +402,7 @@ 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'
Got one of the listed errors
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;

View file

@ -28,77 +28,77 @@ DROP FUNCTION test.f1;
#########################################################################
DESCRIBE information_schema.TABLES;
Field Type Null Key Default Extra
TABLE_CATALOG varchar(512) YES NULL
TABLE_CATALOG varchar(512) NO
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
VERSION bigint(21) unsigned 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
TABLE_ROWS bigint(21) unsigned YES NULL
AVG_ROW_LENGTH bigint(21) unsigned YES NULL
DATA_LENGTH bigint(21) unsigned YES NULL
MAX_DATA_LENGTH bigint(21) unsigned YES NULL
INDEX_LENGTH bigint(21) unsigned YES NULL
DATA_FREE bigint(21) unsigned YES NULL
AUTO_INCREMENT bigint(21) unsigned 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
TABLE_COLLATION varchar(32) YES NULL
CHECKSUM bigint(21) unsigned YES NULL
CREATE_OPTIONS varchar(2048) YES NULL
TABLE_COMMENT varchar(2048) 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 ''
`TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '',
`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) unsigned DEFAULT NULL,
`ROW_FORMAT` varchar(10) DEFAULT NULL,
`TABLE_ROWS` bigint(21) unsigned DEFAULT NULL,
`AVG_ROW_LENGTH` bigint(21) unsigned DEFAULT NULL,
`DATA_LENGTH` bigint(21) unsigned DEFAULT NULL,
`MAX_DATA_LENGTH` bigint(21) unsigned DEFAULT NULL,
`INDEX_LENGTH` bigint(21) unsigned DEFAULT NULL,
`DATA_FREE` bigint(21) unsigned DEFAULT NULL,
`AUTO_INCREMENT` bigint(21) unsigned DEFAULT NULL,
`CREATE_TIME` datetime DEFAULT NULL,
`UPDATE_TIME` datetime DEFAULT NULL,
`CHECK_TIME` datetime DEFAULT NULL,
`TABLE_COLLATION` varchar(32) DEFAULT NULL,
`CHECKSUM` bigint(21) unsigned DEFAULT NULL,
`CREATE_OPTIONS` varchar(2048) DEFAULT NULL,
`TABLE_COMMENT` varchar(2048) 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_CATALOG varchar(512) NO
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
VERSION bigint(21) unsigned 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
TABLE_ROWS bigint(21) unsigned YES NULL
AVG_ROW_LENGTH bigint(21) unsigned YES NULL
DATA_LENGTH bigint(21) unsigned YES NULL
MAX_DATA_LENGTH bigint(21) unsigned YES NULL
INDEX_LENGTH bigint(21) unsigned YES NULL
DATA_FREE bigint(21) unsigned YES NULL
AUTO_INCREMENT bigint(21) unsigned 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
TABLE_COLLATION varchar(32) YES NULL
CHECKSUM bigint(21) unsigned YES NULL
CREATE_OPTIONS varchar(2048) YES NULL
TABLE_COMMENT varchar(2048) NO
SELECT table_catalog, table_schema, table_name
FROM information_schema.tables WHERE table_catalog IS NOT NULL;
FROM information_schema.tables WHERE table_catalog IS NULL OR table_catalog <> 'def';
table_catalog table_schema table_name
################################################################################
# Testcase 3.2.12.2 + 3.2.12.3: INFORMATION_SCHEMA.TABLES accessible information
@ -117,7 +117,7 @@ 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)
connect testuser1, localhost, testuser1, , db_datadict;
CREATE TABLE tb2 (f1 DECIMAL)
ENGINE = <engine_type>;
CREATE TABLE tb3 (f1 VARCHAR(200))
@ -129,59 +129,61 @@ 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
def db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
def db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
def db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
def 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)
connect testuser2, localhost, testuser2, , db_datadict;
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
def db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
def db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
def db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
def 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)
connect testuser3, localhost, testuser3, , db_datadict;
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
def db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
def db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
def db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
def 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)
connection default;
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
def db_datadict tb1 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
def db_datadict tb2 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
def db_datadict tb3 BASE TABLE #ENG# 10 #RF# 0 #ARL# #DL# #MDL# #IL# #DF# NULL #CRT #UT# #CT# latin1_swedish_ci #CS#
def 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
disconnect testuser1;
disconnect testuser2;
disconnect testuser3;
DROP USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
DROP USER 'testuser3'@'localhost';
@ -200,7 +202,7 @@ 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_CATALOG def
TABLE_SCHEMA test
TABLE_NAME t1_my_table
TABLE_TYPE BASE TABLE
@ -318,6 +320,7 @@ 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;
FLUSH TABLES;
SELECT UPDATE_TIME > @UPDATE_TIME
AS "Is current UPDATE_TIME bigger than before last INSERT?"
FROM information_schema.tables
@ -352,7 +355,7 @@ 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_CATALOG def
TABLE_SCHEMA test
TABLE_NAME t1_my_tablex
TABLE_TYPE VIEW
@ -407,7 +410,7 @@ 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'
Got one of the listed errors
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;

View file

@ -215,7 +215,7 @@ 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'
Got one of the listed errors
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;

View file

@ -1,3 +1,4 @@
set global sql_mode="";
SHOW TABLES FROM information_schema LIKE 'TRIGGERS';
Tables_in_information_schema (TRIGGERS)
TRIGGERS
@ -28,74 +29,85 @@ DROP FUNCTION test.f1;
#########################################################################
DESCRIBE information_schema.TRIGGERS;
Field Type Null Key Default Extra
TRIGGER_CATALOG varchar(512) YES NULL
TRIGGER_CATALOG varchar(512) NO
TRIGGER_SCHEMA varchar(64) NO
TRIGGER_NAME varchar(64) NO
EVENT_MANIPULATION varchar(6) NO
EVENT_OBJECT_CATALOG varchar(512) YES NULL
EVENT_OBJECT_CATALOG varchar(512) NO
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_STATEMENT longtext NO
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
CREATED datetime(2) YES NULL
SQL_MODE varchar(8192) NO
DEFINER varchar(189) NO
CHARACTER_SET_CLIENT varchar(32) NO
COLLATION_CONNECTION varchar(32) NO
DATABASE_COLLATION varchar(32) NO
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
`TRIGGER_CATALOG` varchar(512) NOT NULL DEFAULT '',
`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) NOT NULL DEFAULT '',
`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 DEFAULT NULL,
`ACTION_STATEMENT` longtext NOT NULL DEFAULT '',
`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(2) DEFAULT NULL,
`SQL_MODE` varchar(8192) NOT NULL DEFAULT '',
`DEFINER` varchar(189) 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 ''
) DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.TRIGGERS;
Field Type Null Key Default Extra
TRIGGER_CATALOG varchar(512) YES NULL
TRIGGER_CATALOG varchar(512) NO
TRIGGER_SCHEMA varchar(64) NO
TRIGGER_NAME varchar(64) NO
EVENT_MANIPULATION varchar(6) NO
EVENT_OBJECT_CATALOG varchar(512) YES NULL
EVENT_OBJECT_CATALOG varchar(512) NO
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_STATEMENT longtext NO
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
CREATED datetime(2) YES NULL
SQL_MODE varchar(8192) NO
DEFINER varchar(189) NO
CHARACTER_SET_CLIENT varchar(32) NO
COLLATION_CONNECTION varchar(32) NO
DATABASE_COLLATION varchar(32) NO
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
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 CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
def mtr gs_insert INSERT def mtr global_suppressions 1 NULL BEGIN DECLARE dummy INT; SELECT "" REGEXP NEW.pattern INTO dummy; END ROW BEFORE NULL NULL OLD NEW # root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
def mtr ts_insert INSERT def mtr test_suppressions 1 NULL BEGIN DECLARE dummy INT; SELECT "" REGEXP NEW.pattern INTO dummy; END ROW BEFORE NULL NULL OLD NEW # root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
##################################################################################
# Testcase 3.2.18.2 + 3.2.18.3: INFORMATION_SCHEMA.TRIGGERS accessible information
##################################################################################
@ -109,62 +121,74 @@ 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 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;
# Establish connection testuser1 (user=testuser1)
connect testuser1, localhost, testuser1, , db_datadict;
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';
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
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 CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
def db_datadict trg1 INSERT def db_datadict t1 1 NULL SET @test_before = 2, new.f1 = @test_before ROW BEFORE NULL NULL OLD NEW # testuser1@localhost latin1 latin1_swedish_ci latin1_swedish_ci
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)
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE # testuser1@localhost latin1 latin1_swedish_ci latin1_swedish_ci
connect testuser2, localhost, testuser2, , db_datadict;
SHOW GRANTS FOR 'testuser2'@'localhost';
# No SUPER Privilege --> no result for query
# No TRIGGER 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
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 CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
def db_datadict trg1 INSERT def db_datadict t1 1 NULL SET @test_before = 2, new.f1 = @test_before ROW BEFORE NULL NULL OLD NEW # testuser1@localhost latin1 latin1_swedish_ci latin1_swedish_ci
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)
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE # testuser1@localhost latin1 latin1_swedish_ci latin1_swedish_ci
connect testuser3, localhost, testuser3, , test;
SHOW GRANTS FOR 'testuser3'@'localhost';
# SUPER Privilege + SELECT Privilege on t1 --> result for query
# TRIGGER 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
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 CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
def db_datadict trg1 INSERT def db_datadict t1 1 NULL SET @test_before = 2, new.f1 = @test_before ROW BEFORE NULL NULL OLD NEW # testuser1@localhost latin1 latin1_swedish_ci latin1_swedish_ci
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)
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE # testuser1@localhost latin1 latin1_swedish_ci latin1_swedish_ci
connect testuser4, localhost, testuser4, , test;
SHOW GRANTS FOR 'testuser4'@'localhost';
# SUPER Privilege + no SELECT Privilege on t1 --> no result for query
# TRIGGER Privilege + no SELECT Privilege on t1 --> result for query
SELECT * FROM db_datadict.t1;
f1 f2 f3
DESC db_datadict.t1;
Field Type Null Key Default Extra
f1 int(11) YES NULL
f2 int(11) YES NULL
f3 int(11) YES NULL
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
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 CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
def db_datadict trg1 INSERT def db_datadict t1 1 NULL SET @test_before = 2, new.f1 = @test_before ROW BEFORE NULL NULL OLD NEW # testuser1@localhost latin1 latin1_swedish_ci latin1_swedish_ci
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
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE # testuser1@localhost latin1 latin1_swedish_ci latin1_swedish_ci
connection default;
disconnect testuser1;
disconnect testuser2;
disconnect testuser3;
disconnect 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
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 CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
def db_datadict trg1 INSERT def db_datadict t1 1 NULL SET @test_before = 2, new.f1 = @test_before ROW BEFORE NULL NULL OLD NEW # testuser1@localhost latin1 latin1_swedish_ci latin1_swedish_ci
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
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE # testuser1@localhost latin1 latin1_swedish_ci latin1_swedish_ci
DROP USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
DROP USER 'testuser3'@'localhost';
@ -188,7 +212,7 @@ 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'
Got one of the listed errors
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;
@ -206,3 +230,4 @@ ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_
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;
set global sql_mode=default;

View file

@ -234,7 +234,7 @@ 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'
Got one of the listed errors
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;

View file

@ -28,36 +28,45 @@ DROP FUNCTION test.f1;
#########################################################################
DESCRIBE information_schema.VIEWS;
Field Type Null Key Default Extra
TABLE_CATALOG varchar(512) YES NULL
TABLE_CATALOG varchar(512) NO
TABLE_SCHEMA varchar(64) NO
TABLE_NAME varchar(64) NO
VIEW_DEFINITION longtext NO NULL
VIEW_DEFINITION longtext NO
CHECK_OPTION varchar(8) NO
IS_UPDATABLE varchar(3) NO
DEFINER varchar(77) NO
DEFINER varchar(189) NO
SECURITY_TYPE varchar(7) NO
CHARACTER_SET_CLIENT varchar(32) NO
COLLATION_CONNECTION varchar(32) NO
ALGORITHM varchar(10) 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
`TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '',
`TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '',
`TABLE_NAME` varchar(64) NOT NULL DEFAULT '',
`VIEW_DEFINITION` longtext NOT NULL DEFAULT '',
`CHECK_OPTION` varchar(8) NOT NULL DEFAULT '',
`IS_UPDATABLE` varchar(3) NOT NULL DEFAULT '',
`DEFINER` varchar(189) NOT NULL DEFAULT '',
`SECURITY_TYPE` varchar(7) NOT NULL DEFAULT '',
`CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '',
`COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '',
`ALGORITHM` varchar(10) NOT NULL DEFAULT ''
) DEFAULT CHARSET=utf8
SHOW COLUMNS FROM information_schema.VIEWS;
Field Type Null Key Default Extra
TABLE_CATALOG varchar(512) YES NULL
TABLE_CATALOG varchar(512) NO
TABLE_SCHEMA varchar(64) NO
TABLE_NAME varchar(64) NO
VIEW_DEFINITION longtext NO NULL
VIEW_DEFINITION longtext NO
CHECK_OPTION varchar(8) NO
IS_UPDATABLE varchar(3) NO
DEFINER varchar(77) NO
DEFINER varchar(189) NO
SECURITY_TYPE varchar(7) NO
CHARACTER_SET_CLIENT varchar(32) NO
COLLATION_CONNECTION varchar(32) NO
ALGORITHM varchar(10) NO
SELECT table_catalog, table_schema, table_name
FROM information_schema.views WHERE table_catalog IS NOT NULL;
table_catalog table_schema table_name
@ -81,28 +90,31 @@ 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)
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
def db_datadict v_granted_glob select `db_datadict`.`t1`.`f2` AS `f2`,`db_datadict`.`t1`.`f3` AS `f3` from `db_datadict`.`t1` NONE YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
def db_datadict v_granted_to_1 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 latin1 latin1_swedish_ci UNDEFINED
connect testuser1, localhost, testuser1, , test;
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)
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
def db_datadict v_granted_glob NONE YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
def db_datadict v_granted_to_1 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
connect testuser2, localhost, testuser2, , test;
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)
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
def db_datadict v_granted_glob NONE YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
def db_datadict v_granted_to_1 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
connect test_no_views, localhost, test_no_views, , test;
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
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
def db_datadict v_granted_glob NONE YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
def db_datadict v_granted_to_1 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
connection default;
disconnect testuser1;
disconnect testuser2;
disconnect test_no_views;
DROP USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
DROP USER 'test_no_views'@'localhost';
@ -120,12 +132,18 @@ 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
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
CREATE VIEW test.t1_view AS SELECT DISTINCT f1 FROM test.t1_table;
CREATE ALGORITHM=MERGE VIEW test.t1_view1 AS SELECT f1 FROM test.t1_table;
CREATE ALGORITHM=TEMPTABLE VIEW test.t1_view2 AS SELECT 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
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
def test t1_view select distinct `test`.`t1_table`.`f1` AS `f1` from `test`.`t1_table` NONE NO root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
def test t1_view1 select `test`.`t1_table`.`f1` AS `f1` from `test`.`t1_table` NONE YES root@localhost DEFINER latin1 latin1_swedish_ci MERGE
def test t1_view2 select `test`.`t1_table`.`f1` AS `f1` from `test`.`t1_table` NONE NO root@localhost DEFINER latin1 latin1_swedish_ci TEMPTABLE
DROP VIEW test.t1_view1;
DROP VIEW test.t1_view2;
SELECT table_name,definer FROM information_schema.views
WHERE table_name = 't1_view';
table_name definer
@ -148,7 +166,7 @@ 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.
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
@ -189,8 +207,6 @@ 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>;
@ -221,7 +237,7 @@ 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'
Got one of the listed errors
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;

View file

@ -9,11 +9,6 @@
# Create this script based on older scripts and new code.
#
if (`SELECT VERSION() LIKE '%embedded%'`)
{
--skip Bug#37456 funcs_1: Several tests crash when used with embedded server
}
let $is_table = CHARACTER_SETS;
# The table INFORMATION_SCHEMA.CHARACTER_SETS must exist
@ -82,7 +77,7 @@ CREATE DATABASE db_datadict;
INSERT INTO information_schema.character_sets
SELECT * FROM information_schema.character_sets;
--error ER_DBACCESS_DENIED_ERROR
--error ER_DBACCESS_DENIED_ERROR,ER_NON_UPDATABLE_TABLE
UPDATE information_schema.character_sets SET description = 'just updated';
--error ER_DBACCESS_DENIED_ERROR

View file

@ -9,11 +9,6 @@
# Create this script based on older scripts and new code.
#
if (`SELECT VERSION() LIKE '%embedded%'`)
{
--skip Bug#37456 funcs_1: Several tests crash when used with embedded server
}
let $is_table = COLLATION_CHARACTER_SET_APPLICABILITY;
# The table INFORMATION_SCHEMA.CHARACTER_SET_APPLICABILITY must exist
@ -79,10 +74,10 @@ CREATE DATABASE db_datadict;
INSERT INTO information_schema.collation_character_set_applicability
SELECT * FROM information_schema.collation_character_set_applicability;
--error ER_DBACCESS_DENIED_ERROR
--error ER_DBACCESS_DENIED_ERROR,ER_NON_UPDATABLE_TABLE
UPDATE information_schema.collation_character_set_applicability
SET collation_name = 'big6_chinese_ci' WHERE character_set_name = 'big6';
--error ER_DBACCESS_DENIED_ERROR
--error ER_DBACCESS_DENIED_ERROR,ER_NON_UPDATABLE_TABLE
UPDATE information_schema.collation_character_set_applicability
SET character_set_name = 't_4711';

View file

@ -9,10 +9,6 @@
# Create this script based on older scripts and new code.
#
if (`SELECT VERSION() LIKE '%embedded%'`)
{
--skip Bug#37456 funcs_1: Several tests crash when used with embedded server
}
let $is_table = COLLATIONS;
# The table INFORMATION_SCHEMA.COLLATIONS must exist
@ -86,7 +82,7 @@ INSERT INTO information_schema.collations
(collation_name,character_set_name,id,is_default,is_compiled,sortlen)
VALUES ( 'cp1251_bin', 'cp1251',50, '', '',0);
--error ER_DBACCESS_DENIED_ERROR
--error ER_DBACCESS_DENIED_ERROR,ER_NON_UPDATABLE_TABLE
UPDATE information_schema.collations SET description = 'just updated';
--error ER_DBACCESS_DENIED_ERROR

View file

@ -15,11 +15,6 @@
# testsuite funcs_1
#
if (`SELECT VERSION() LIKE '%embedded%'`)
{
--skip Bug#37456 funcs_1: Several tests crash when used with embedded server
}
let $engine_type = MEMORY;
let $other_engine_type = MyISAM;
@ -100,7 +95,7 @@ ENGINE = $engine_type;
INSERT INTO information_schema.engines
SELECT * FROM information_schema.engines;
--error ER_DBACCESS_DENIED_ERROR
--error ER_DBACCESS_DENIED_ERROR,ER_NON_UPDATABLE_TABLE
UPDATE information_schema.engines SET engine = '1234567';
--error ER_DBACCESS_DENIED_ERROR

View file

@ -10,11 +10,6 @@
# testsuite funcs_1
#
if (`SELECT VERSION() LIKE '%embedded%'`)
{
--skip Bug#37456 funcs_1: Several tests crash when used with embedded server
}
let $engine_type = MEMORY;
let $other_engine_type = MyISAM;
@ -143,7 +138,7 @@ ENGINE = $engine_type;
INSERT INTO information_schema.events
SELECT * FROM information_schema.events;
--error ER_DBACCESS_DENIED_ERROR
--error ER_DBACCESS_DENIED_ERROR,ER_NON_UPDATABLE_TABLE
UPDATE information_schema.events SET event_name = '1234567'
WHERE table_name = 't1';

View file

@ -18,8 +18,4 @@ if (`SELECT VERSION() NOT LIKE '%embedded%'`)
{
--skip Test requires: embedded server
}
if (`SELECT VERSION() LIKE '%embedded%'`)
{
--skip Bug#37456 funcs_1: Several tests crash when used with embedded server
}
--source suite/funcs_1/datadict/is_key_column_usage.inc

View file

@ -17,8 +17,4 @@ if (`SELECT VERSION() NOT LIKE '%embedded%'`)
{
--skip Test requires: embedded server
}
if (`SELECT VERSION() LIKE '%embedded%'`)
{
--skip Bug#37456 funcs_1: Several tests crash when used with embedded server
}
--source suite/funcs_1/datadict/is_routines.inc

View file

@ -17,8 +17,4 @@ if (`SELECT VERSION() NOT LIKE '%embedded%'`)
{
--skip Test requires: embedded server
}
if (`SELECT VERSION() LIKE '%embedded%'`)
{
--skip Bug#37456 funcs_1: Several tests crash when used with embedded server
}
--source suite/funcs_1/datadict/is_schemata.inc

View file

@ -172,7 +172,7 @@ 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))
(f1 CHAR(12), f2 TIMESTAMP, f4 BIGINT, PRIMARY KEY(f1))
DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci
ENGINE = $engine_type;
# Settings used in CREATE TABLE must be visible

View file

@ -17,8 +17,4 @@ if (`SELECT VERSION() NOT LIKE '%embedded%'`)
{
--skip Test requires: embedded server
}
if (`SELECT VERSION() LIKE '%embedded%'`)
{
--skip Bug#37456 funcs_1: Several tests crash when used with embedded server
}
--source suite/funcs_1/datadict/is_tables.inc

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