mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
Auto-merge from mysql-next-mr.
This commit is contained in:
commit
411a6bfeb9
457 changed files with 19019 additions and 8786 deletions
|
@ -1139,6 +1139,7 @@ libmysqld/protocol_cursor.cc
|
|||
libmysqld/records.cc
|
||||
libmysqld/repl_failsafe.cc
|
||||
libmysqld/rpl_filter.cc
|
||||
libmysqld/rpl_handler.cc
|
||||
libmysqld/rpl_injector.cc
|
||||
libmysqld/rpl_record.cc
|
||||
libmysqld/rpl_record_old.cc
|
||||
|
@ -3065,6 +3066,7 @@ sql/share/swedish
|
|||
sql/share/ukrainian
|
||||
libmysqld/examples/mysqltest.cc
|
||||
libmysqld/sql_signal.cc
|
||||
libmysqld/rpl_handler.cc
|
||||
libmysqld/debug_sync.cc
|
||||
libmysqld/rpl_handler.cc
|
||||
dbug/tests
|
||||
|
|
|
@ -1274,7 +1274,7 @@ set_bsd_configs()
|
|||
if test "x$fast_flag" != "xno" ; then
|
||||
compiler_flags="$compiler_flags -O3"
|
||||
else
|
||||
compiler_flags="$compiler_flags -O"
|
||||
compiler_flags="$compiler_flags -O0"
|
||||
fi
|
||||
set_cc_and_cxx_for_gcc
|
||||
}
|
||||
|
@ -1305,7 +1305,7 @@ set_linux_configs()
|
|||
if test "x$fast_flag" != "xno" ; then
|
||||
compiler_flags="$compiler_flags -O2"
|
||||
else
|
||||
compiler_flags="$compiler_flags -O"
|
||||
compiler_flags="$compiler_flags -O0"
|
||||
fi
|
||||
# configure will set proper compiler flags for gcc on Linux
|
||||
elif test "x$compiler" = "xicc" ; then
|
||||
|
@ -1375,8 +1375,8 @@ set_solaris_configs()
|
|||
LDFLAGS="$LDFLAGS -O2"
|
||||
compiler_flags="$compiler_flags -O2"
|
||||
else
|
||||
LDFLAGS="$LDFLAGS -O"
|
||||
compiler_flags="$compiler_flags -O"
|
||||
LDFLAGS="$LDFLAGS -O0"
|
||||
compiler_flags="$compiler_flags -O0"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
|
@ -1407,7 +1407,7 @@ set_solaris_configs()
|
|||
elif test "x$fast_flag" = "xgeneric" ; then
|
||||
compiler_flags="$compiler_flags -xO2"
|
||||
else
|
||||
compiler_flags="$compiler_flags -xO"
|
||||
compiler_flags="$compiler_flags -xO0"
|
||||
fi
|
||||
else
|
||||
#Using SPARC cpu with SunStudio (Forte) compiler
|
||||
|
@ -1421,7 +1421,7 @@ set_solaris_configs()
|
|||
elif test "x$fast_flag" = "xgeneric" ; then
|
||||
compiler_flags="$compiler_flags -xO2"
|
||||
else
|
||||
compiler_flags="$compiler_flags -xO"
|
||||
compiler_flags="$compiler_flags -xO0"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
@ -1452,7 +1452,7 @@ set_macosx_configs()
|
|||
if test "x$fast_flag" != "xno" ; then
|
||||
compiler_flags="$compiler_flags -Os"
|
||||
else
|
||||
compiler_flags="$compiler_flags -O"
|
||||
compiler_flags="$compiler_flags -O0"
|
||||
fi
|
||||
set_cc_and_cxx_for_gcc
|
||||
}
|
||||
|
|
|
@ -98,7 +98,8 @@ test-pr:
|
|||
|
||||
test-ns:
|
||||
cd mysql-test ; \
|
||||
@PERL@ ./mysql-test-run.pl $(force) $(mem) --mysqld=--binlog-format=mixed
|
||||
@PERL@ ./mysql-test-run.pl $(force) $(mem) --mysqld=--binlog-format=mixed ; \
|
||||
@PERL@ ./mysql-test-run.pl $(force) $(mem) --suite=funcs_1
|
||||
|
||||
test-binlog-statement:
|
||||
cd mysql-test ; \
|
||||
|
|
|
@ -861,9 +861,9 @@ static int get_options(int *argc, char ***argv)
|
|||
load_defaults("my",load_default_groups,argc,argv);
|
||||
defaults_argv= *argv;
|
||||
|
||||
if (hash_init(&ignore_table, charset_info, 16, 0, 0,
|
||||
(hash_get_key) get_table_key,
|
||||
(hash_free_key) free_table_ent, 0))
|
||||
if (my_hash_init(&ignore_table, charset_info, 16, 0, 0,
|
||||
(my_hash_get_key) get_table_key,
|
||||
(my_hash_free_key) free_table_ent, 0))
|
||||
return(EX_EOM);
|
||||
/* Don't copy internal log tables */
|
||||
if (my_hash_insert(&ignore_table,
|
||||
|
@ -1273,120 +1273,68 @@ static int switch_character_set_results(MYSQL *mysql, const char *cs_name)
|
|||
}
|
||||
|
||||
/**
|
||||
Rewrite CREATE TRIGGER statement, enclosing DEFINER clause in
|
||||
version-specific comment.
|
||||
Rewrite statement, enclosing DEFINER clause in version-specific comment.
|
||||
|
||||
This function parses the CREATE TRIGGER statement and encloses
|
||||
DEFINER-clause in version-specific comment:
|
||||
input query: CREATE DEFINER=a@b TRIGGER ...
|
||||
rewritten query: CREATE * / / *!50017 DEFINER=a@b * / / *!50003 TRIGGER ...
|
||||
|
||||
@note This function will go away when WL#3995 is implemented.
|
||||
|
||||
@param[in] trigger_def_str CREATE TRIGGER statement string.
|
||||
@param[in] trigger_def_length length of the trigger_def_str.
|
||||
|
||||
@return pointer to the new allocated query string.
|
||||
*/
|
||||
|
||||
static char *cover_definer_clause_in_trigger(const char *trigger_def_str,
|
||||
uint trigger_def_length)
|
||||
{
|
||||
char *query_str= NULL;
|
||||
char *definer_begin= my_case_str(trigger_def_str, trigger_def_length,
|
||||
C_STRING_WITH_LEN(" DEFINER"));
|
||||
char *definer_end;
|
||||
|
||||
if (!definer_begin)
|
||||
return NULL;
|
||||
|
||||
definer_end= my_case_str(definer_begin, strlen(definer_begin),
|
||||
C_STRING_WITH_LEN(" TRIGGER"));
|
||||
|
||||
if (definer_end)
|
||||
{
|
||||
char *query_str_tail;
|
||||
|
||||
/*
|
||||
Allocate memory for new query string: original string
|
||||
from SHOW statement and version-specific comments.
|
||||
*/
|
||||
query_str= alloc_query_str(trigger_def_length + 23);
|
||||
|
||||
query_str_tail= strnmov(query_str,
|
||||
trigger_def_str,
|
||||
definer_begin - trigger_def_str);
|
||||
|
||||
query_str_tail= strmov(query_str_tail,
|
||||
"*/ /*!50017");
|
||||
|
||||
query_str_tail= strnmov(query_str_tail,
|
||||
definer_begin,
|
||||
definer_end - definer_begin);
|
||||
|
||||
query_str_tail= strxmov(query_str_tail,
|
||||
"*/ /*!50003",
|
||||
definer_end,
|
||||
NullS);
|
||||
}
|
||||
|
||||
return query_str;
|
||||
}
|
||||
|
||||
/**
|
||||
Rewrite CREATE FUNCTION or CREATE PROCEDURE statement, enclosing DEFINER
|
||||
clause in version-specific comment.
|
||||
|
||||
This function parses the CREATE FUNCTION | PROCEDURE statement and
|
||||
encloses DEFINER-clause in version-specific comment:
|
||||
This function parses any CREATE statement and encloses DEFINER-clause in
|
||||
version-specific comment:
|
||||
input query: CREATE DEFINER=a@b FUNCTION ...
|
||||
rewritten query: CREATE * / / *!50020 DEFINER=a@b * / / *!50003 FUNCTION ...
|
||||
|
||||
@note This function will go away when WL#3995 is implemented.
|
||||
|
||||
@param[in] def_str CREATE FUNCTION|PROCEDURE statement string.
|
||||
@param[in] def_str_length length of the def_str.
|
||||
@param[in] stmt_str CREATE statement string.
|
||||
@param[in] stmt_length Length of the stmt_str.
|
||||
@param[in] definer_version_str Minimal MySQL version number when
|
||||
DEFINER clause is supported in the
|
||||
given statement.
|
||||
@param[in] definer_version_length Length of definer_version_str.
|
||||
@param[in] stmt_version_str Minimal MySQL version number when the
|
||||
given statement is supported.
|
||||
@param[in] stmt_version_length Length of stmt_version_str.
|
||||
@param[in] keyword_str Keyword to look for after CREATE.
|
||||
@param[in] keyword_length Length of keyword_str.
|
||||
|
||||
@return pointer to the new allocated query string.
|
||||
*/
|
||||
|
||||
static char *cover_definer_clause_in_sp(const char *def_str,
|
||||
uint def_str_length)
|
||||
static char *cover_definer_clause(const char *stmt_str,
|
||||
uint stmt_length,
|
||||
const char *definer_version_str,
|
||||
uint definer_version_length,
|
||||
const char *stmt_version_str,
|
||||
uint stmt_version_length,
|
||||
const char *keyword_str,
|
||||
uint keyword_length)
|
||||
{
|
||||
char *query_str= NULL;
|
||||
char *definer_begin= my_case_str(def_str, def_str_length,
|
||||
char *definer_begin= my_case_str(stmt_str, stmt_length,
|
||||
C_STRING_WITH_LEN(" DEFINER"));
|
||||
char *definer_end;
|
||||
char *definer_end= NULL;
|
||||
|
||||
char *query_str= NULL;
|
||||
char *query_ptr;
|
||||
|
||||
if (!definer_begin)
|
||||
return NULL;
|
||||
|
||||
definer_end= my_case_str(definer_begin, strlen(definer_begin),
|
||||
C_STRING_WITH_LEN(" PROCEDURE"));
|
||||
keyword_str, keyword_length);
|
||||
|
||||
if (!definer_end)
|
||||
{
|
||||
definer_end= my_case_str(definer_begin, strlen(definer_begin),
|
||||
C_STRING_WITH_LEN(" FUNCTION"));
|
||||
}
|
||||
return NULL;
|
||||
|
||||
if (definer_end)
|
||||
{
|
||||
char *query_str_tail;
|
||||
/*
|
||||
Allocate memory for new query string: original string
|
||||
from SHOW statement and version-specific comments.
|
||||
*/
|
||||
query_str= alloc_query_str(stmt_length + 23);
|
||||
|
||||
/*
|
||||
Allocate memory for new query string: original string
|
||||
from SHOW statement and version-specific comments.
|
||||
*/
|
||||
query_str= alloc_query_str(def_str_length + 23);
|
||||
|
||||
query_str_tail= strnmov(query_str, def_str, definer_begin - def_str);
|
||||
query_str_tail= strmov(query_str_tail, "*/ /*!50020");
|
||||
query_str_tail= strnmov(query_str_tail, definer_begin,
|
||||
definer_end - definer_begin);
|
||||
query_str_tail= strxmov(query_str_tail, "*/ /*!50003",
|
||||
definer_end, NullS);
|
||||
}
|
||||
query_ptr= strnmov(query_str, stmt_str, definer_begin - stmt_str);
|
||||
query_ptr= strnmov(query_ptr, C_STRING_WITH_LEN("*/ /*!"));
|
||||
query_ptr= strnmov(query_ptr, definer_version_str, definer_version_length);
|
||||
query_ptr= strnmov(query_ptr, definer_begin, definer_end - definer_begin);
|
||||
query_ptr= strnmov(query_ptr, C_STRING_WITH_LEN("*/ /*!"));
|
||||
query_ptr= strnmov(query_ptr, stmt_version_str, stmt_version_length);
|
||||
query_ptr= strxmov(query_ptr, definer_end, NullS);
|
||||
|
||||
return query_str;
|
||||
}
|
||||
|
@ -1419,8 +1367,8 @@ static void free_resources()
|
|||
if (md_result_file && md_result_file != stdout)
|
||||
my_fclose(md_result_file, MYF(0));
|
||||
my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR));
|
||||
if (hash_inited(&ignore_table))
|
||||
hash_free(&ignore_table);
|
||||
if (my_hash_inited(&ignore_table))
|
||||
my_hash_free(&ignore_table);
|
||||
if (extended_insert)
|
||||
dynstr_free(&extended_row);
|
||||
if (insert_pat_inited)
|
||||
|
@ -1922,6 +1870,8 @@ static uint dump_events_for_db(char *db)
|
|||
*/
|
||||
if (strlen(row[3]) != 0)
|
||||
{
|
||||
char *query_str;
|
||||
|
||||
if (opt_drop)
|
||||
fprintf(sql_file, "/*!50106 DROP EVENT IF EXISTS %s */%s\n",
|
||||
event_name, delimiter);
|
||||
|
@ -1948,31 +1898,36 @@ static uint dump_events_for_db(char *db)
|
|||
row[4], /* character_set_results */
|
||||
row[5]); /* collation_connection */
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
mysqldump is being run against the server, that does not
|
||||
provide character set information in SHOW CREATE
|
||||
statements.
|
||||
else
|
||||
{
|
||||
/*
|
||||
mysqldump is being run against the server, that does not
|
||||
provide character set information in SHOW CREATE
|
||||
statements.
|
||||
|
||||
NOTE: the dump may be incorrect, since character set
|
||||
information is required in order to restore event properly.
|
||||
*/
|
||||
NOTE: the dump may be incorrect, since character set
|
||||
information is required in order to restore event properly.
|
||||
*/
|
||||
|
||||
fprintf(sql_file,
|
||||
"--\n"
|
||||
"-- WARNING: old server version. "
|
||||
"The following dump may be incomplete.\n"
|
||||
"--\n");
|
||||
}
|
||||
fprintf(sql_file,
|
||||
"--\n"
|
||||
"-- WARNING: old server version. "
|
||||
"The following dump may be incomplete.\n"
|
||||
"--\n");
|
||||
}
|
||||
|
||||
switch_sql_mode(sql_file, delimiter, row[1]);
|
||||
|
||||
switch_time_zone(sql_file, delimiter, row[2]);
|
||||
|
||||
query_str= cover_definer_clause(row[3], strlen(row[3]),
|
||||
C_STRING_WITH_LEN("50117"),
|
||||
C_STRING_WITH_LEN("50106"),
|
||||
C_STRING_WITH_LEN(" EVENT"));
|
||||
|
||||
fprintf(sql_file,
|
||||
"/*!50106 %s */ %s\n",
|
||||
(const char *) row[3],
|
||||
(const char *) (query_str != NULL ? query_str : row[3]),
|
||||
(const char *) delimiter);
|
||||
|
||||
restore_time_zone(sql_file, delimiter);
|
||||
|
@ -2127,7 +2082,16 @@ static uint dump_routines_for_db(char *db)
|
|||
fprintf(sql_file, "/*!50003 DROP %s IF EXISTS %s */;\n",
|
||||
routine_type[i], routine_name);
|
||||
|
||||
query_str= cover_definer_clause_in_sp(row[2], strlen(row[2]));
|
||||
query_str= cover_definer_clause(row[2], strlen(row[2]),
|
||||
C_STRING_WITH_LEN("50020"),
|
||||
C_STRING_WITH_LEN("50003"),
|
||||
C_STRING_WITH_LEN(" FUNCTION"));
|
||||
|
||||
if (!query_str)
|
||||
query_str= cover_definer_clause(row[2], strlen(row[2]),
|
||||
C_STRING_WITH_LEN("50020"),
|
||||
C_STRING_WITH_LEN("50003"),
|
||||
C_STRING_WITH_LEN(" PROCEDURE"));
|
||||
|
||||
if (mysql_num_fields(routine_res) >= 6)
|
||||
{
|
||||
|
@ -2806,8 +2770,10 @@ static int dump_trigger(FILE *sql_file, MYSQL_RES *show_create_trigger_rs,
|
|||
|
||||
while ((row= mysql_fetch_row(show_create_trigger_rs)))
|
||||
{
|
||||
char *query_str= cover_definer_clause_in_trigger(row[2], strlen(row[2]));
|
||||
|
||||
char *query_str= cover_definer_clause(row[2], strlen(row[2]),
|
||||
C_STRING_WITH_LEN("50017"),
|
||||
C_STRING_WITH_LEN("50003"),
|
||||
C_STRING_WITH_LEN(" TRIGGER"));
|
||||
|
||||
if (switch_db_collation(sql_file, db_name, ";",
|
||||
db_cl_name, row[5], &db_cl_altered))
|
||||
|
@ -3992,7 +3958,7 @@ static int init_dumping(char *database, int init_func(char*))
|
|||
|
||||
my_bool include_table(const uchar *hash_key, size_t len)
|
||||
{
|
||||
return !hash_search(&ignore_table, hash_key, len);
|
||||
return ! my_hash_search(&ignore_table, hash_key, len);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -112,6 +112,8 @@ static uint my_end_arg= 0;
|
|||
/* Number of lines of the result to include in failure report */
|
||||
static uint opt_tail_lines= 0;
|
||||
|
||||
static uint opt_connect_timeout= 0;
|
||||
|
||||
static char delimiter[MAX_DELIMITER_LENGTH]= ";";
|
||||
static uint delimiter_length= 1;
|
||||
|
||||
|
@ -257,8 +259,7 @@ enum enum_commands {
|
|||
Q_SEND, Q_REAP,
|
||||
Q_DIRTY_CLOSE, Q_REPLACE, Q_REPLACE_COLUMN,
|
||||
Q_PING, Q_EVAL,
|
||||
Q_RPL_PROBE, Q_ENABLE_RPL_PARSE,
|
||||
Q_DISABLE_RPL_PARSE, Q_EVAL_RESULT,
|
||||
Q_EVAL_RESULT,
|
||||
Q_ENABLE_QUERY_LOG, Q_DISABLE_QUERY_LOG,
|
||||
Q_ENABLE_RESULT_LOG, Q_DISABLE_RESULT_LOG,
|
||||
Q_WAIT_FOR_SLAVE_TO_STOP,
|
||||
|
@ -317,9 +318,6 @@ const char *command_names[]=
|
|||
"replace_column",
|
||||
"ping",
|
||||
"eval",
|
||||
"rpl_probe",
|
||||
"enable_rpl_parse",
|
||||
"disable_rpl_parse",
|
||||
"eval_result",
|
||||
/* Enable/disable that the _query_ is logged to result file */
|
||||
"enable_query_log",
|
||||
|
@ -659,14 +657,6 @@ public:
|
|||
LogFile log_file;
|
||||
LogFile progress_file;
|
||||
|
||||
|
||||
/* Disable functions that only exist in MySQL 4.0 */
|
||||
#if MYSQL_VERSION_ID < 40000
|
||||
void mysql_enable_rpl_parse(MYSQL* mysql __attribute__((unused))) {}
|
||||
void mysql_disable_rpl_parse(MYSQL* mysql __attribute__((unused))) {}
|
||||
int mysql_rpl_parse_enabled(MYSQL* mysql __attribute__((unused))) { return 1; }
|
||||
my_bool mysql_rpl_probe(MYSQL *mysql __attribute__((unused))) { return 1; }
|
||||
#endif
|
||||
void replace_dynstr_append_mem(DYNAMIC_STRING *ds, const char *val,
|
||||
int len);
|
||||
void replace_dynstr_append(DYNAMIC_STRING *ds, const char *val);
|
||||
|
@ -1135,7 +1125,7 @@ void free_used_memory()
|
|||
|
||||
close_connections();
|
||||
close_files();
|
||||
hash_free(&var_hash);
|
||||
my_hash_free(&var_hash);
|
||||
|
||||
for (i= 0 ; i < q_lines.elements ; i++)
|
||||
{
|
||||
|
@ -1997,8 +1987,8 @@ VAR* var_get(const char *var_name, const char **var_name_end, my_bool raw,
|
|||
if (length >= MAX_VAR_NAME_LENGTH)
|
||||
die("Too long variable name: %s", save_var_name);
|
||||
|
||||
if (!(v = (VAR*) hash_search(&var_hash, (const uchar*) save_var_name,
|
||||
length)))
|
||||
if (!(v = (VAR*) my_hash_search(&var_hash, (const uchar*) save_var_name,
|
||||
length)))
|
||||
{
|
||||
char buff[MAX_VAR_NAME_LENGTH+1];
|
||||
strmake(buff, save_var_name, length);
|
||||
|
@ -2029,7 +2019,7 @@ err:
|
|||
VAR *var_obtain(const char *name, int len)
|
||||
{
|
||||
VAR* v;
|
||||
if ((v = (VAR*)hash_search(&var_hash, (const uchar *) name, len)))
|
||||
if ((v = (VAR*)my_hash_search(&var_hash, (const uchar *) name, len)))
|
||||
return v;
|
||||
v = var_init(0, name, len, "", 0);
|
||||
my_hash_insert(&var_hash, (uchar*)v);
|
||||
|
@ -2963,6 +2953,7 @@ void do_move_file(struct st_command *command)
|
|||
void do_chmod_file(struct st_command *command)
|
||||
{
|
||||
long mode= 0;
|
||||
int err_code;
|
||||
static DYNAMIC_STRING ds_mode;
|
||||
static DYNAMIC_STRING ds_file;
|
||||
const struct command_arg chmod_file_args[] = {
|
||||
|
@ -2982,7 +2973,10 @@ void do_chmod_file(struct st_command *command)
|
|||
die("You must write a 4 digit octal number for mode");
|
||||
|
||||
DBUG_PRINT("info", ("chmod %o %s", (uint)mode, ds_file.str));
|
||||
handle_command_error(command, chmod(ds_file.str, mode));
|
||||
err_code= chmod(ds_file.str, mode);
|
||||
if (err_code < 0)
|
||||
err_code= 1;
|
||||
handle_command_error(command, err_code);
|
||||
dynstr_free(&ds_mode);
|
||||
dynstr_free(&ds_file);
|
||||
DBUG_VOID_RETURN;
|
||||
|
@ -3843,12 +3837,8 @@ int do_save_master_pos()
|
|||
MYSQL_ROW row;
|
||||
MYSQL *mysql = &cur_con->mysql;
|
||||
const char *query;
|
||||
int rpl_parse;
|
||||
DBUG_ENTER("do_save_master_pos");
|
||||
|
||||
rpl_parse = mysql_rpl_parse_enabled(mysql);
|
||||
mysql_disable_rpl_parse(mysql);
|
||||
|
||||
#ifdef HAVE_NDB_BINLOG
|
||||
/*
|
||||
Wait for ndb binlog to be up-to-date with all changes
|
||||
|
@ -3998,10 +3988,6 @@ int do_save_master_pos()
|
|||
strnmov(master_pos.file, row[0], sizeof(master_pos.file)-1);
|
||||
master_pos.pos = strtoul(row[1], (char**) 0, 10);
|
||||
mysql_free_result(res);
|
||||
|
||||
if (rpl_parse)
|
||||
mysql_enable_rpl_parse(mysql);
|
||||
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
@ -4064,29 +4050,6 @@ void do_let(struct st_command *command)
|
|||
}
|
||||
|
||||
|
||||
int do_rpl_probe(struct st_command *command __attribute__((unused)))
|
||||
{
|
||||
DBUG_ENTER("do_rpl_probe");
|
||||
if (mysql_rpl_probe(&cur_con->mysql))
|
||||
die("Failed in mysql_rpl_probe(): '%s'", mysql_error(&cur_con->mysql));
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
||||
int do_enable_rpl_parse(struct st_command *command __attribute__((unused)))
|
||||
{
|
||||
mysql_enable_rpl_parse(&cur_con->mysql);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int do_disable_rpl_parse(struct st_command *command __attribute__((unused)))
|
||||
{
|
||||
mysql_disable_rpl_parse(&cur_con->mysql);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Sleep the number of specified seconds
|
||||
|
||||
|
@ -5002,6 +4965,11 @@ void do_connect(struct st_command *command)
|
|||
#endif
|
||||
if (!mysql_init(&con_slot->mysql))
|
||||
die("Failed on mysql_init()");
|
||||
|
||||
if (opt_connect_timeout)
|
||||
mysql_options(&con_slot->mysql, MYSQL_OPT_CONNECT_TIMEOUT,
|
||||
(void *) &opt_connect_timeout);
|
||||
|
||||
if (opt_compress || con_compress)
|
||||
mysql_options(&con_slot->mysql, MYSQL_OPT_COMPRESS, NullS);
|
||||
mysql_options(&con_slot->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
|
||||
|
@ -5757,6 +5725,11 @@ static struct my_option my_long_options[] =
|
|||
{"view-protocol", OPT_VIEW_PROTOCOL, "Use views for select",
|
||||
(uchar**) &view_protocol, (uchar**) &view_protocol, 0,
|
||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||
{"connect_timeout", OPT_CONNECT_TIMEOUT,
|
||||
"Number of seconds before connection timeout.",
|
||||
(uchar**) &opt_connect_timeout,
|
||||
(uchar**) &opt_connect_timeout, 0, GET_UINT, REQUIRED_ARG,
|
||||
120, 0, 3600 * 12, 0, 0, 0},
|
||||
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
|
@ -6495,8 +6468,6 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
|
|||
|
||||
if (!disable_result_log)
|
||||
{
|
||||
ulonglong UNINIT_VAR(affected_rows); /* Ok to be undef if 'disable_info' is set */
|
||||
|
||||
if (res)
|
||||
{
|
||||
MYSQL_FIELD *fields= mysql_fetch_fields(res);
|
||||
|
@ -6513,10 +6484,10 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
|
|||
|
||||
/*
|
||||
Need to call mysql_affected_rows() before the "new"
|
||||
query to find the warnings
|
||||
query to find the warnings.
|
||||
*/
|
||||
if (!disable_info)
|
||||
affected_rows= mysql_affected_rows(mysql);
|
||||
append_info(ds, mysql_affected_rows(mysql), mysql_info(mysql));
|
||||
|
||||
/*
|
||||
Add all warnings to the result. We can't do this if we are in
|
||||
|
@ -6531,9 +6502,6 @@ void run_query_normal(struct st_connection *cn, struct st_command *command,
|
|||
dynstr_append_mem(ds, ds_warnings->str, ds_warnings->length);
|
||||
}
|
||||
}
|
||||
|
||||
if (!disable_info)
|
||||
append_info(ds, affected_rows, mysql_info(mysql));
|
||||
}
|
||||
|
||||
if (res)
|
||||
|
@ -6909,11 +6877,11 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
|
|||
}
|
||||
|
||||
/*
|
||||
Need to grab affected rows information before getting
|
||||
warnings here
|
||||
Fetch info before fetching warnings, since it will be reset
|
||||
otherwise.
|
||||
*/
|
||||
if (!disable_info)
|
||||
affected_rows= mysql_affected_rows(mysql);
|
||||
append_info(ds, mysql_stmt_affected_rows(stmt), mysql_info(mysql));
|
||||
|
||||
if (!disable_warnings)
|
||||
{
|
||||
|
@ -6938,9 +6906,6 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
|
|||
}
|
||||
}
|
||||
|
||||
if (!disable_info)
|
||||
append_info(ds, affected_rows, mysql_info(mysql));
|
||||
|
||||
}
|
||||
|
||||
end:
|
||||
|
@ -6989,6 +6954,10 @@ int util_query(MYSQL* org_mysql, const char* query){
|
|||
if (!(mysql= mysql_init(mysql)))
|
||||
die("Failed in mysql_init()");
|
||||
|
||||
if (opt_connect_timeout)
|
||||
mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT,
|
||||
(void *) &opt_connect_timeout);
|
||||
|
||||
/* enable local infile, in non-binary builds often disabled by default */
|
||||
mysql_options(mysql, MYSQL_OPT_LOCAL_INFILE, 0);
|
||||
safe_connect(mysql, "util", org_mysql->host, org_mysql->user,
|
||||
|
@ -7584,8 +7553,8 @@ int main(int argc, char **argv)
|
|||
|
||||
my_init_dynamic_array(&q_lines, sizeof(struct st_command*), 1024, 1024);
|
||||
|
||||
if (hash_init(&var_hash, charset_info,
|
||||
1024, 0, 0, get_var_key, var_free, MYF(0)))
|
||||
if (my_hash_init(&var_hash, charset_info,
|
||||
1024, 0, 0, get_var_key, var_free, MYF(0)))
|
||||
die("Variable hash initialization failed");
|
||||
|
||||
var_set_string("$MYSQL_SERVER_VERSION", MYSQL_SERVER_VERSION);
|
||||
|
@ -7648,6 +7617,9 @@ int main(int argc, char **argv)
|
|||
st_connection *con= connections;
|
||||
if (!( mysql_init(&con->mysql)))
|
||||
die("Failed in mysql_init()");
|
||||
if (opt_connect_timeout)
|
||||
mysql_options(&con->mysql, MYSQL_OPT_CONNECT_TIMEOUT,
|
||||
(void *) &opt_connect_timeout);
|
||||
if (opt_compress)
|
||||
mysql_options(&con->mysql,MYSQL_OPT_COMPRESS,NullS);
|
||||
mysql_options(&con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
|
||||
|
@ -7747,9 +7719,6 @@ int main(int argc, char **argv)
|
|||
case Q_DISCONNECT:
|
||||
case Q_DIRTY_CLOSE:
|
||||
do_close_connection(command); break;
|
||||
case Q_RPL_PROBE: do_rpl_probe(command); break;
|
||||
case Q_ENABLE_RPL_PARSE: do_enable_rpl_parse(command); break;
|
||||
case Q_DISABLE_RPL_PARSE: do_disable_rpl_parse(command); break;
|
||||
case Q_ENABLE_QUERY_LOG: disable_query_log=0; break;
|
||||
case Q_DISABLE_QUERY_LOG: disable_query_log=1; break;
|
||||
case Q_ENABLE_ABORT_ON_ERROR: abort_on_error=1; break;
|
||||
|
|
|
@ -14,7 +14,7 @@ DTRACEFLAGS=""
|
|||
HAVE_DTRACE=""
|
||||
HAVE_DTRACE_DASH_G=""
|
||||
if test "$ENABLE_DTRACE" = "yes"; then
|
||||
AC_CHECK_PROGS(DTRACE, dtrace, [not found], [$PATH:/usr/sbin])
|
||||
AC_PATH_PROGS(DTRACE, dtrace, [not found], [$PATH:/usr/sbin])
|
||||
if test "$DTRACE" = "not found"; then
|
||||
ENABLE_DTRACE="no"
|
||||
else
|
||||
|
|
33
configure.in
33
configure.in
|
@ -617,24 +617,6 @@ then
|
|||
fi
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(whether features provided by the user community should be included.)
|
||||
AC_ARG_ENABLE(community-features,
|
||||
AC_HELP_STRING(
|
||||
[--disable-community-features],
|
||||
[Disable additional features provided by the user community.]),
|
||||
[ ENABLE_COMMUNITY_FEATURES=$enableval ],
|
||||
[ ENABLE_COMMUNITY_FEATURES=yes ]
|
||||
)
|
||||
|
||||
if test "$ENABLE_COMMUNITY_FEATURES" = "yes"
|
||||
then
|
||||
AC_DEFINE([COMMUNITY_SERVER], [1],
|
||||
[Whether features provided by the user community should be included])
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(server-suffix,
|
||||
[ --with-server-suffix Append value to the version string.],
|
||||
[ MYSQL_SERVER_SUFFIX=`echo "$withval" | sed -e 's/^\(...................................\)..*$/\1/'` ],
|
||||
|
@ -700,21 +682,14 @@ fi
|
|||
# Add query profiler
|
||||
AC_MSG_CHECKING(if SHOW PROFILE should be enabled.)
|
||||
AC_ARG_ENABLE(profiling,
|
||||
AS_HELP_STRING([--enable-profiling], [Build a version with query profiling code (req. community-features)]),
|
||||
AS_HELP_STRING([--enable-profiling], [Enable profiling of query lifetime.]),
|
||||
[ ENABLED_PROFILING=$enableval ],
|
||||
[ ENABLED_PROFILING=$ENABLE_COMMUNITY_FEATURES ])
|
||||
[ ENABLED_PROFILING=no ])
|
||||
|
||||
AC_DEFINE([ENABLED_PROFILING], [1], [If SHOW PROFILE should be enabled])
|
||||
if test "$ENABLED_PROFILING" = "yes"
|
||||
then
|
||||
if test "$ENABLE_COMMUNITY_FEATURES" = "yes";
|
||||
then
|
||||
AC_DEFINE([ENABLED_PROFILING], [1],
|
||||
[If SHOW PROFILE should be enabled])
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
ENABLED_PROFILING="no"
|
||||
AC_MSG_RESULT([no, overridden by community-features disabled])
|
||||
fi
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
|
|
@ -356,7 +356,6 @@ inline ulonglong double2ulonglong(double d)
|
|||
#define HAVE_OPENSSL 1
|
||||
#define HAVE_YASSL 1
|
||||
|
||||
#define COMMUNITY_SERVER 1
|
||||
#define ENABLED_PROFILING 1
|
||||
|
||||
/*
|
||||
|
|
|
@ -100,7 +100,8 @@ extern const char *client_errors[]; /* Error messages */
|
|||
#define CR_SERVER_LOST_EXTENDED 2055
|
||||
#define CR_STMT_CLOSED 2056
|
||||
#define CR_NEW_STMT_METADATA 2057
|
||||
#define CR_ERROR_LAST /*Copy last error nr:*/ 2057
|
||||
#define CR_ALREADY_CONNECTED 2058
|
||||
#define CR_ERROR_LAST /*Copy last error nr:*/ 2058
|
||||
/* Add error numbers before CR_ERROR_LAST and change it accordingly. */
|
||||
|
||||
#endif /* ERRMSG_INCLUDED */
|
||||
|
|
|
@ -21,40 +21,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
There was a problem on MacOSX with a shared object ha_example.so.
|
||||
It used hash_search(). During build of ha_example.so no libmysys
|
||||
was specified. Since MacOSX had a hash_search() in the system
|
||||
library, it built the shared object so that the dynamic linker
|
||||
linked hash_search() to the system library, which caused a crash
|
||||
when called. To come around this, we renamed hash_search() to
|
||||
my_hash_search(), as we did long ago with hash_insert() and
|
||||
hash_reset(). However, this time we made the move complete with
|
||||
all names. To keep compatibility, we redefine the old names.
|
||||
Since every C and C++ file, that uses HASH, needs to include
|
||||
this file, the change is complete. Both names could be used
|
||||
in the code, but the my_* versions are recommended now.
|
||||
*/
|
||||
#define hash_get_key my_hash_get_key
|
||||
#define hash_free_key my_hash_free_key
|
||||
#define hash_init my_hash_init
|
||||
#define hash_init2 my_hash_init2
|
||||
#define _hash_init _my_hash_init
|
||||
#define hash_free my_hash_free
|
||||
#define hash_reset my_hash_reset
|
||||
#define hash_element my_hash_element
|
||||
#define hash_search my_hash_search
|
||||
#define hash_first my_hash_first
|
||||
#define hash_next my_hash_next
|
||||
#define hash_insert my_hash_insert
|
||||
#define hash_delete my_hash_delete
|
||||
#define hash_update my_hash_update
|
||||
#define hash_replace my_hash_replace
|
||||
#define hash_check my_hash_check
|
||||
#define hash_clear my_hash_clear
|
||||
#define hash_inited my_hash_inited
|
||||
#define hash_init_opt my_hash_init_opt
|
||||
|
||||
/*
|
||||
Overhead to store an element in hash
|
||||
Can be used to approximate memory consumption for a hash
|
||||
|
|
|
@ -255,7 +255,17 @@ enum ha_base_keytype {
|
|||
HA_BINARY_PACK_KEY | HA_FULLTEXT | HA_UNIQUE_CHECK | \
|
||||
HA_SPATIAL | HA_NULL_ARE_EQUAL | HA_GENERATED_KEY)
|
||||
|
||||
#define HA_KEY_HAS_PART_KEY_SEG 65536 /* Key contains partial segments */
|
||||
/*
|
||||
Key contains partial segments.
|
||||
|
||||
This flag is internal to the MySQL server by design. It is not supposed
|
||||
neither to be saved in FRM-files, nor to be passed to storage engines.
|
||||
It is intended to pass information into internal static sort_keys(KEY *,
|
||||
KEY *) function.
|
||||
|
||||
This flag can be calculated -- it's based on key lengths comparison.
|
||||
*/
|
||||
#define HA_KEY_HAS_PART_KEY_SEG 65536
|
||||
|
||||
/* Automatic bits in key-flag */
|
||||
|
||||
|
|
128
include/mysql.h
128
include/mysql.h
|
@ -188,24 +188,10 @@ struct st_mysql_options {
|
|||
unsigned long max_allowed_packet;
|
||||
my_bool use_ssl; /* if to use SSL or not */
|
||||
my_bool compress,named_pipe;
|
||||
/*
|
||||
On connect, find out the replication role of the server, and
|
||||
establish connections to all the peers
|
||||
*/
|
||||
my_bool rpl_probe;
|
||||
/*
|
||||
Each call to mysql_real_query() will parse it to tell if it is a read
|
||||
or a write, and direct it to the slave or the master
|
||||
*/
|
||||
my_bool rpl_parse;
|
||||
/*
|
||||
If set, never read from a master, only from slave, when doing
|
||||
a read that is replication-aware
|
||||
*/
|
||||
my_bool no_master_reads;
|
||||
#if !defined(CHECK_EMBEDDED_DIFFERENCES) || defined(EMBEDDED_LIBRARY)
|
||||
my_bool separate_thread;
|
||||
#endif
|
||||
my_bool unused1;
|
||||
my_bool unused2;
|
||||
my_bool unused3;
|
||||
my_bool unused4;
|
||||
enum mysql_option methods_to_use;
|
||||
char *client_ip;
|
||||
/* Refuse client connecting to server if it uses old (pre-4.1.1) protocol */
|
||||
|
@ -232,15 +218,6 @@ enum mysql_protocol_type
|
|||
MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET,
|
||||
MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY
|
||||
};
|
||||
/*
|
||||
There are three types of queries - the ones that have to go to
|
||||
the master, the ones that go to a slave, and the adminstrative
|
||||
type which must happen on the pivot connectioin
|
||||
*/
|
||||
enum mysql_rpl_type
|
||||
{
|
||||
MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN
|
||||
};
|
||||
|
||||
typedef struct character_set
|
||||
{
|
||||
|
@ -285,21 +262,8 @@ typedef struct st_mysql
|
|||
|
||||
/* session-wide random string */
|
||||
char scramble[SCRAMBLE_LENGTH+1];
|
||||
|
||||
/*
|
||||
Set if this is the original connection, not a master or a slave we have
|
||||
added though mysql_rpl_probe() or mysql_set_master()/ mysql_add_slave()
|
||||
*/
|
||||
my_bool rpl_pivot;
|
||||
/*
|
||||
Pointers to the master, and the next slave connections, points to
|
||||
itself if lone connection.
|
||||
*/
|
||||
struct st_mysql* master, *next_slave;
|
||||
|
||||
struct st_mysql* last_used_slave; /* needed for round-robin slave pick */
|
||||
/* needed for send/read/store/use result to work correctly with replication */
|
||||
struct st_mysql* last_used_con;
|
||||
my_bool unused1;
|
||||
void *unused2, *unused3, *unused4, *unused5;
|
||||
|
||||
LIST *stmts; /* list of all statements */
|
||||
const struct st_mysql_methods *methods;
|
||||
|
@ -333,35 +297,12 @@ typedef struct st_mysql_res {
|
|||
void *extension;
|
||||
} MYSQL_RES;
|
||||
|
||||
#define MAX_MYSQL_MANAGER_ERR 256
|
||||
#define MAX_MYSQL_MANAGER_MSG 256
|
||||
|
||||
#define MANAGER_OK 200
|
||||
#define MANAGER_INFO 250
|
||||
#define MANAGER_ACCESS 401
|
||||
#define MANAGER_CLIENT_ERR 450
|
||||
#define MANAGER_INTERNAL_ERR 500
|
||||
|
||||
#if !defined(MYSQL_SERVER) && !defined(MYSQL_CLIENT)
|
||||
#define MYSQL_CLIENT
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct st_mysql_manager
|
||||
{
|
||||
NET net;
|
||||
char *host, *user, *passwd;
|
||||
char *net_buf, *net_buf_pos, *net_data_end;
|
||||
unsigned int port;
|
||||
int cmd_status;
|
||||
int last_errno;
|
||||
int net_buf_size;
|
||||
my_bool free_me;
|
||||
my_bool eof;
|
||||
char last_error[MAX_MYSQL_MANAGER_ERR];
|
||||
void *extension;
|
||||
} MYSQL_MANAGER;
|
||||
|
||||
typedef struct st_mysql_parameters
|
||||
{
|
||||
unsigned long *p_max_allowed_packet;
|
||||
|
@ -454,16 +395,6 @@ int STDCALL mysql_real_query(MYSQL *mysql, const char *q,
|
|||
MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql);
|
||||
MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql);
|
||||
|
||||
/* perform query on master */
|
||||
my_bool STDCALL mysql_master_query(MYSQL *mysql, const char *q,
|
||||
unsigned long length);
|
||||
my_bool STDCALL mysql_master_send_query(MYSQL *mysql, const char *q,
|
||||
unsigned long length);
|
||||
/* perform query on slave */
|
||||
my_bool STDCALL mysql_slave_query(MYSQL *mysql, const char *q,
|
||||
unsigned long length);
|
||||
my_bool STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q,
|
||||
unsigned long length);
|
||||
void STDCALL mysql_get_character_set_info(MYSQL *mysql,
|
||||
MY_CHARSET_INFO *charset);
|
||||
|
||||
|
@ -485,37 +416,6 @@ mysql_set_local_infile_handler(MYSQL *mysql,
|
|||
void
|
||||
mysql_set_local_infile_default(MYSQL *mysql);
|
||||
|
||||
|
||||
/*
|
||||
enable/disable parsing of all queries to decide if they go on master or
|
||||
slave
|
||||
*/
|
||||
void STDCALL mysql_enable_rpl_parse(MYSQL* mysql);
|
||||
void STDCALL mysql_disable_rpl_parse(MYSQL* mysql);
|
||||
/* get the value of the parse flag */
|
||||
int STDCALL mysql_rpl_parse_enabled(MYSQL* mysql);
|
||||
|
||||
/* enable/disable reads from master */
|
||||
void STDCALL mysql_enable_reads_from_master(MYSQL* mysql);
|
||||
void STDCALL mysql_disable_reads_from_master(MYSQL* mysql);
|
||||
/* get the value of the master read flag */
|
||||
my_bool STDCALL mysql_reads_from_master_enabled(MYSQL* mysql);
|
||||
|
||||
enum mysql_rpl_type STDCALL mysql_rpl_query_type(const char* q, int len);
|
||||
|
||||
/* discover the master and its slaves */
|
||||
my_bool STDCALL mysql_rpl_probe(MYSQL* mysql);
|
||||
|
||||
/* set the master, close/free the old one, if it is not a pivot */
|
||||
int STDCALL mysql_set_master(MYSQL* mysql, const char* host,
|
||||
unsigned int port,
|
||||
const char* user,
|
||||
const char* passwd);
|
||||
int STDCALL mysql_add_slave(MYSQL* mysql, const char* host,
|
||||
unsigned int port,
|
||||
const char* user,
|
||||
const char* passwd);
|
||||
|
||||
int STDCALL mysql_shutdown(MYSQL *mysql,
|
||||
enum mysql_enum_shutdown_level
|
||||
shutdown_level);
|
||||
|
@ -562,18 +462,6 @@ void STDCALL mysql_debug(const char *debug);
|
|||
void STDCALL myodbc_remove_escape(MYSQL *mysql,char *name);
|
||||
unsigned int STDCALL mysql_thread_safe(void);
|
||||
my_bool STDCALL mysql_embedded(void);
|
||||
MYSQL_MANAGER* STDCALL mysql_manager_init(MYSQL_MANAGER* con);
|
||||
MYSQL_MANAGER* STDCALL mysql_manager_connect(MYSQL_MANAGER* con,
|
||||
const char* host,
|
||||
const char* user,
|
||||
const char* passwd,
|
||||
unsigned int port);
|
||||
void STDCALL mysql_manager_close(MYSQL_MANAGER* con);
|
||||
int STDCALL mysql_manager_command(MYSQL_MANAGER* con,
|
||||
const char* cmd, int cmd_len);
|
||||
int STDCALL mysql_manager_fetch_line(MYSQL_MANAGER* con,
|
||||
char* res_buf,
|
||||
int res_buf_size);
|
||||
my_bool STDCALL mysql_read_query_result(MYSQL *mysql);
|
||||
|
||||
|
||||
|
@ -768,7 +656,7 @@ typedef struct st_mysql_methods
|
|||
MYSQL_RES * (*use_result)(MYSQL *mysql);
|
||||
void (*fetch_lengths)(unsigned long *to,
|
||||
MYSQL_ROW column, unsigned int field_count);
|
||||
void (*flush_use_result)(MYSQL *mysql);
|
||||
void (*flush_use_result)(MYSQL *mysql, my_bool flush_all_results);
|
||||
#if !defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY)
|
||||
MYSQL_FIELD * (*list_fields)(MYSQL *mysql);
|
||||
my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt);
|
||||
|
@ -828,6 +716,7 @@ my_bool STDCALL mysql_rollback(MYSQL * mysql);
|
|||
my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode);
|
||||
my_bool STDCALL mysql_more_results(MYSQL *mysql);
|
||||
int STDCALL mysql_next_result(MYSQL *mysql);
|
||||
int STDCALL mysql_stmt_next_result(MYSQL_STMT *stmt);
|
||||
void STDCALL mysql_close(MYSQL *sock);
|
||||
|
||||
|
||||
|
@ -842,7 +731,6 @@ MYSQL * STDCALL mysql_connect(MYSQL *mysql, const char *host,
|
|||
const char *user, const char *passwd);
|
||||
int STDCALL mysql_create_db(MYSQL *mysql, const char *DB);
|
||||
int STDCALL mysql_drop_db(MYSQL *mysql, const char *DB);
|
||||
#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT)
|
||||
#endif
|
||||
#define HAVE_MYSQL_REAL_CONNECT
|
||||
|
||||
|
|
|
@ -28,15 +28,15 @@ typedef struct st_net {
|
|||
unsigned int *return_status;
|
||||
unsigned char reading_or_writing;
|
||||
char save_char;
|
||||
my_bool unused0;
|
||||
my_bool unused;
|
||||
my_bool compress;
|
||||
my_bool unused1;
|
||||
unsigned char *query_cache_query;
|
||||
my_bool unused2;
|
||||
my_bool compress;
|
||||
my_bool unused3;
|
||||
unsigned char *unused;
|
||||
unsigned int last_errno;
|
||||
unsigned char error;
|
||||
my_bool unused2;
|
||||
my_bool return_errno;
|
||||
my_bool unused4;
|
||||
my_bool unused5;
|
||||
char last_error[512];
|
||||
char sqlstate[5 +1];
|
||||
void *extension;
|
||||
|
@ -277,10 +277,10 @@ struct st_mysql_options {
|
|||
unsigned long max_allowed_packet;
|
||||
my_bool use_ssl;
|
||||
my_bool compress,named_pipe;
|
||||
my_bool rpl_probe;
|
||||
my_bool rpl_parse;
|
||||
my_bool no_master_reads;
|
||||
my_bool separate_thread;
|
||||
my_bool unused1;
|
||||
my_bool unused2;
|
||||
my_bool unused3;
|
||||
my_bool unused4;
|
||||
enum mysql_option methods_to_use;
|
||||
char *client_ip;
|
||||
my_bool secure_auth;
|
||||
|
@ -301,10 +301,6 @@ enum mysql_protocol_type
|
|||
MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET,
|
||||
MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY
|
||||
};
|
||||
enum mysql_rpl_type
|
||||
{
|
||||
MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN
|
||||
};
|
||||
typedef struct character_set
|
||||
{
|
||||
unsigned int number;
|
||||
|
@ -344,10 +340,8 @@ typedef struct st_mysql
|
|||
my_bool free_me;
|
||||
my_bool reconnect;
|
||||
char scramble[20 +1];
|
||||
my_bool rpl_pivot;
|
||||
struct st_mysql* master, *next_slave;
|
||||
struct st_mysql* last_used_slave;
|
||||
struct st_mysql* last_used_con;
|
||||
my_bool unused1;
|
||||
void *unused2, *unused3, *unused4, *unused5;
|
||||
LIST *stmts;
|
||||
const struct st_mysql_methods *methods;
|
||||
void *thd;
|
||||
|
@ -371,20 +365,6 @@ typedef struct st_mysql_res {
|
|||
my_bool unbuffered_fetch_cancelled;
|
||||
void *extension;
|
||||
} MYSQL_RES;
|
||||
typedef struct st_mysql_manager
|
||||
{
|
||||
NET net;
|
||||
char *host, *user, *passwd;
|
||||
char *net_buf, *net_buf_pos, *net_data_end;
|
||||
unsigned int port;
|
||||
int cmd_status;
|
||||
int last_errno;
|
||||
int net_buf_size;
|
||||
my_bool free_me;
|
||||
my_bool eof;
|
||||
char last_error[256];
|
||||
void *extension;
|
||||
} MYSQL_MANAGER;
|
||||
typedef struct st_mysql_parameters
|
||||
{
|
||||
unsigned long *p_max_allowed_packet;
|
||||
|
@ -437,14 +417,6 @@ int mysql_real_query(MYSQL *mysql, const char *q,
|
|||
unsigned long length);
|
||||
MYSQL_RES * mysql_store_result(MYSQL *mysql);
|
||||
MYSQL_RES * mysql_use_result(MYSQL *mysql);
|
||||
my_bool mysql_master_query(MYSQL *mysql, const char *q,
|
||||
unsigned long length);
|
||||
my_bool mysql_master_send_query(MYSQL *mysql, const char *q,
|
||||
unsigned long length);
|
||||
my_bool mysql_slave_query(MYSQL *mysql, const char *q,
|
||||
unsigned long length);
|
||||
my_bool mysql_slave_send_query(MYSQL *mysql, const char *q,
|
||||
unsigned long length);
|
||||
void mysql_get_character_set_info(MYSQL *mysql,
|
||||
MY_CHARSET_INFO *charset);
|
||||
void
|
||||
|
@ -459,22 +431,6 @@ mysql_set_local_infile_handler(MYSQL *mysql,
|
|||
void *);
|
||||
void
|
||||
mysql_set_local_infile_default(MYSQL *mysql);
|
||||
void mysql_enable_rpl_parse(MYSQL* mysql);
|
||||
void mysql_disable_rpl_parse(MYSQL* mysql);
|
||||
int mysql_rpl_parse_enabled(MYSQL* mysql);
|
||||
void mysql_enable_reads_from_master(MYSQL* mysql);
|
||||
void mysql_disable_reads_from_master(MYSQL* mysql);
|
||||
my_bool mysql_reads_from_master_enabled(MYSQL* mysql);
|
||||
enum mysql_rpl_type mysql_rpl_query_type(const char* q, int len);
|
||||
my_bool mysql_rpl_probe(MYSQL* mysql);
|
||||
int mysql_set_master(MYSQL* mysql, const char* host,
|
||||
unsigned int port,
|
||||
const char* user,
|
||||
const char* passwd);
|
||||
int mysql_add_slave(MYSQL* mysql, const char* host,
|
||||
unsigned int port,
|
||||
const char* user,
|
||||
const char* passwd);
|
||||
int mysql_shutdown(MYSQL *mysql,
|
||||
enum mysql_enum_shutdown_level
|
||||
shutdown_level);
|
||||
|
@ -521,18 +477,6 @@ void mysql_debug(const char *debug);
|
|||
void myodbc_remove_escape(MYSQL *mysql,char *name);
|
||||
unsigned int mysql_thread_safe(void);
|
||||
my_bool mysql_embedded(void);
|
||||
MYSQL_MANAGER* mysql_manager_init(MYSQL_MANAGER* con);
|
||||
MYSQL_MANAGER* mysql_manager_connect(MYSQL_MANAGER* con,
|
||||
const char* host,
|
||||
const char* user,
|
||||
const char* passwd,
|
||||
unsigned int port);
|
||||
void mysql_manager_close(MYSQL_MANAGER* con);
|
||||
int mysql_manager_command(MYSQL_MANAGER* con,
|
||||
const char* cmd, int cmd_len);
|
||||
int mysql_manager_fetch_line(MYSQL_MANAGER* con,
|
||||
char* res_buf,
|
||||
int res_buf_size);
|
||||
my_bool mysql_read_query_result(MYSQL *mysql);
|
||||
enum enum_mysql_stmt_state
|
||||
{
|
||||
|
@ -616,7 +560,7 @@ typedef struct st_mysql_methods
|
|||
MYSQL_RES * (*use_result)(MYSQL *mysql);
|
||||
void (*fetch_lengths)(unsigned long *to,
|
||||
MYSQL_ROW column, unsigned int field_count);
|
||||
void (*flush_use_result)(MYSQL *mysql);
|
||||
void (*flush_use_result)(MYSQL *mysql, my_bool flush_all_results);
|
||||
MYSQL_FIELD * (*list_fields)(MYSQL *mysql);
|
||||
my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt);
|
||||
int (*stmt_execute)(MYSQL_STMT *stmt);
|
||||
|
@ -671,4 +615,5 @@ my_bool mysql_rollback(MYSQL * mysql);
|
|||
my_bool mysql_autocommit(MYSQL * mysql, my_bool auto_mode);
|
||||
my_bool mysql_more_results(MYSQL *mysql);
|
||||
int mysql_next_result(MYSQL *mysql);
|
||||
int mysql_stmt_next_result(MYSQL_STMT *stmt);
|
||||
void mysql_close(MYSQL *sock);
|
||||
|
|
|
@ -146,6 +146,7 @@ enum enum_server_command
|
|||
#define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */
|
||||
#define CLIENT_MULTI_STATEMENTS (1UL << 16) /* Enable/disable multi-stmt support */
|
||||
#define CLIENT_MULTI_RESULTS (1UL << 17) /* Enable/disable multi-results */
|
||||
#define CLIENT_PS_MULTI_RESULTS (1UL << 18) /* Multi-results in PS-protocol */
|
||||
|
||||
#define CLIENT_SSL_VERIFY_SERVER_CERT (1UL << 30)
|
||||
#define CLIENT_REMEMBER_OPTIONS (1UL << 31)
|
||||
|
@ -169,6 +170,7 @@ enum enum_server_command
|
|||
CLIENT_SECURE_CONNECTION | \
|
||||
CLIENT_MULTI_STATEMENTS | \
|
||||
CLIENT_MULTI_RESULTS | \
|
||||
CLIENT_PS_MULTI_RESULTS | \
|
||||
CLIENT_SSL_VERIFY_SERVER_CERT | \
|
||||
CLIENT_REMEMBER_OPTIONS)
|
||||
|
||||
|
@ -205,6 +207,12 @@ enum enum_server_command
|
|||
number of result set columns.
|
||||
*/
|
||||
#define SERVER_STATUS_METADATA_CHANGED 1024
|
||||
#define SERVER_QUERY_WAS_SLOW 2048
|
||||
|
||||
/**
|
||||
To mark ResultSet containing output parameter values.
|
||||
*/
|
||||
#define SERVER_PS_OUT_PARAMS 4096
|
||||
|
||||
/**
|
||||
Server status flags that must be cleared when starting
|
||||
|
@ -256,24 +264,23 @@ typedef struct st_net {
|
|||
unsigned int *return_status;
|
||||
unsigned char reading_or_writing;
|
||||
char save_char;
|
||||
my_bool unused0; /* Please remove with the next incompatible ABI change. */
|
||||
my_bool unused; /* Please remove with the next incompatible ABI change */
|
||||
my_bool compress;
|
||||
my_bool unused1; /* Please remove with the next incompatible ABI change. */
|
||||
my_bool unused2; /* Please remove with the next incompatible ABI change */
|
||||
my_bool compress;
|
||||
my_bool unused3; /* Please remove with the next incompatible ABI change. */
|
||||
/*
|
||||
Pointer to query object in query cache, do not equal NULL (0) for
|
||||
queries in cache that have not stored its results yet
|
||||
*/
|
||||
#endif
|
||||
/*
|
||||
'query_cache_query' should be accessed only via query cache
|
||||
functions and methods to maintain proper locking.
|
||||
Unused, please remove with the next incompatible ABI change.
|
||||
*/
|
||||
unsigned char *query_cache_query;
|
||||
unsigned char *unused;
|
||||
unsigned int last_errno;
|
||||
unsigned char error;
|
||||
my_bool unused2; /* Please remove with the next incompatible ABI change. */
|
||||
my_bool return_errno;
|
||||
my_bool unused4; /* Please remove with the next incompatible ABI change. */
|
||||
my_bool unused5; /* Please remove with the next incompatible ABI change. */
|
||||
/** Client library error message buffer. Actually belongs to struct MYSQL. */
|
||||
char last_error[MYSQL_ERRMSG_SIZE];
|
||||
/** Client library sqlstate buffer. Set along with the error message. */
|
||||
|
@ -411,10 +418,6 @@ void my_net_set_write_timeout(NET *net, uint timeout);
|
|||
void my_net_set_read_timeout(NET *net, uint timeout);
|
||||
#endif
|
||||
|
||||
/*
|
||||
The following function is not meant for normal usage
|
||||
Currently it's used internally by manager.c
|
||||
*/
|
||||
struct sockaddr;
|
||||
int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen,
|
||||
unsigned int timeout);
|
||||
|
|
|
@ -73,7 +73,7 @@ SET(CLIENT_SOURCES ../mysys/array.c ../strings/bchange.c ../strings/bmove.c
|
|||
../mysys/hash.c ../mysys/my_sleep.c ../mysys/default_modify.c
|
||||
get_password.c ../strings/int2str.c ../strings/is_prefix.c
|
||||
libmysql.c ../mysys/list.c ../strings/llstr.c
|
||||
../strings/longlong2str.c manager.c ../mysys/mf_arr_appstr.c ../mysys/mf_cache.c
|
||||
../strings/longlong2str.c ../mysys/mf_arr_appstr.c ../mysys/mf_cache.c
|
||||
../mysys/mf_dirname.c ../mysys/mf_fn_ext.c ../mysys/mf_format.c
|
||||
../mysys/mf_iocache.c ../mysys/mf_iocache2.c ../mysys/mf_loadpath.c
|
||||
../mysys/mf_pack.c ../mysys/mf_path.c ../mysys/mf_tempfile.c ../mysys/mf_unixpath.c
|
||||
|
|
|
@ -31,7 +31,7 @@ pkglib_LTLIBRARIES = $(target)
|
|||
noinst_PROGRAMS = conf_to_src
|
||||
|
||||
|
||||
target_sources = libmysql.c password.c manager.c \
|
||||
target_sources = libmysql.c password.c \
|
||||
get_password.c errmsg.c
|
||||
|
||||
mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \
|
||||
|
|
|
@ -22,9 +22,13 @@
|
|||
extern uint mysql_port;
|
||||
extern char * mysql_unix_port;
|
||||
|
||||
#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | \
|
||||
CLIENT_TRANSACTIONS | \
|
||||
CLIENT_PROTOCOL_41 | CLIENT_SECURE_CONNECTION)
|
||||
#define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | \
|
||||
CLIENT_LONG_FLAG | \
|
||||
CLIENT_TRANSACTIONS | \
|
||||
CLIENT_PROTOCOL_41 | \
|
||||
CLIENT_SECURE_CONNECTION | \
|
||||
CLIENT_MULTI_RESULTS | \
|
||||
CLIENT_PS_MULTI_RESULTS)
|
||||
|
||||
sig_handler my_pipe_sig_handler(int sig);
|
||||
void read_user_name(char *name);
|
||||
|
|
|
@ -85,6 +85,7 @@ const char *client_errors[]=
|
|||
"Lost connection to MySQL server at '%s', system error: %d",
|
||||
"Statement closed indirectly because of a preceeding %s() call",
|
||||
"The number of columns in the result set differs from the number of bound buffers. You must reset the statement, rebind the result set columns, and execute the statement again",
|
||||
"This handle is already connected. Use a separate handle for each connection."
|
||||
""
|
||||
};
|
||||
|
||||
|
@ -151,6 +152,7 @@ const char *client_errors[]=
|
|||
"Lost connection to MySQL server at '%s', system error: %d",
|
||||
"Statement closed indirectly because of a preceeding %s() call",
|
||||
"The number of columns in the result set differs from the number of bound buffers. You must reset the statement, rebind the result set columns, and execute the statement again",
|
||||
"This handle is already connected. Use a separate handle for each connection."
|
||||
""
|
||||
};
|
||||
|
||||
|
@ -215,6 +217,7 @@ const char *client_errors[]=
|
|||
"Lost connection to MySQL server at '%s', system error: %d",
|
||||
"Statement closed indirectly because of a preceeding %s() call",
|
||||
"The number of columns in the result set differs from the number of bound buffers. You must reset the statement, rebind the result set columns, and execute the statement again",
|
||||
"This handle is already connected. Use a separate handle for each connection."
|
||||
""
|
||||
};
|
||||
#endif
|
||||
|
|
|
@ -249,16 +249,6 @@ void STDCALL mysql_thread_end()
|
|||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
Let the user specify that we don't want SIGPIPE; This doesn't however work
|
||||
with threaded applications as we can have multiple read in progress.
|
||||
*/
|
||||
static MYSQL* spawn_init(MYSQL* parent, const char* host,
|
||||
unsigned int port,
|
||||
const char* user,
|
||||
const char* passwd);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Expand wildcard to a sql string
|
||||
|
@ -320,7 +310,7 @@ mysql_debug(const char *debug __attribute__((unused)))
|
|||
|
||||
|
||||
/**************************************************************************
|
||||
Close the server connection if we get a SIGPIPE
|
||||
Ignore SIGPIPE handler
|
||||
ARGSUSED
|
||||
**************************************************************************/
|
||||
|
||||
|
@ -333,305 +323,6 @@ my_pipe_sig_handler(int sig __attribute__((unused)))
|
|||
#endif
|
||||
}
|
||||
|
||||
/* perform query on master */
|
||||
my_bool STDCALL mysql_master_query(MYSQL *mysql, const char *q,
|
||||
unsigned long length)
|
||||
{
|
||||
DBUG_ENTER("mysql_master_query");
|
||||
if (mysql_master_send_query(mysql, q, length))
|
||||
DBUG_RETURN(1);
|
||||
DBUG_RETURN((*mysql->methods->read_query_result)(mysql));
|
||||
}
|
||||
|
||||
my_bool STDCALL mysql_master_send_query(MYSQL *mysql, const char *q,
|
||||
unsigned long length)
|
||||
{
|
||||
MYSQL *master = mysql->master;
|
||||
DBUG_ENTER("mysql_master_send_query");
|
||||
if (!master->net.vio && !mysql_real_connect(master,0,0,0,0,0,0,0))
|
||||
DBUG_RETURN(1);
|
||||
master->reconnect= 1;
|
||||
mysql->last_used_con = master;
|
||||
DBUG_RETURN(simple_command(master, COM_QUERY, (const uchar*) q, length, 1));
|
||||
}
|
||||
|
||||
|
||||
/* perform query on slave */
|
||||
my_bool STDCALL mysql_slave_query(MYSQL *mysql, const char *q,
|
||||
unsigned long length)
|
||||
{
|
||||
DBUG_ENTER("mysql_slave_query");
|
||||
if (mysql_slave_send_query(mysql, q, length))
|
||||
DBUG_RETURN(1);
|
||||
DBUG_RETURN((*mysql->methods->read_query_result)(mysql));
|
||||
}
|
||||
|
||||
|
||||
my_bool STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q,
|
||||
unsigned long length)
|
||||
{
|
||||
MYSQL* last_used_slave, *slave_to_use = 0;
|
||||
DBUG_ENTER("mysql_slave_send_query");
|
||||
|
||||
if ((last_used_slave = mysql->last_used_slave))
|
||||
slave_to_use = last_used_slave->next_slave;
|
||||
else
|
||||
slave_to_use = mysql->next_slave;
|
||||
/*
|
||||
Next_slave is always safe to use - we have a circular list of slaves
|
||||
if there are no slaves, mysql->next_slave == mysql
|
||||
*/
|
||||
mysql->last_used_con = mysql->last_used_slave = slave_to_use;
|
||||
if (!slave_to_use->net.vio && !mysql_real_connect(slave_to_use, 0,0,0,
|
||||
0,0,0,0))
|
||||
DBUG_RETURN(1);
|
||||
slave_to_use->reconnect= 1;
|
||||
DBUG_RETURN(simple_command(slave_to_use, COM_QUERY, (const uchar*) q,
|
||||
length, 1));
|
||||
}
|
||||
|
||||
|
||||
/* enable/disable parsing of all queries to decide
|
||||
if they go on master or slave */
|
||||
void STDCALL mysql_enable_rpl_parse(MYSQL* mysql)
|
||||
{
|
||||
mysql->options.rpl_parse = 1;
|
||||
}
|
||||
|
||||
void STDCALL mysql_disable_rpl_parse(MYSQL* mysql)
|
||||
{
|
||||
mysql->options.rpl_parse = 0;
|
||||
}
|
||||
|
||||
/* get the value of the parse flag */
|
||||
int STDCALL mysql_rpl_parse_enabled(MYSQL* mysql)
|
||||
{
|
||||
return mysql->options.rpl_parse;
|
||||
}
|
||||
|
||||
/* enable/disable reads from master */
|
||||
void STDCALL mysql_enable_reads_from_master(MYSQL* mysql)
|
||||
{
|
||||
mysql->options.no_master_reads = 0;
|
||||
}
|
||||
|
||||
void STDCALL mysql_disable_reads_from_master(MYSQL* mysql)
|
||||
{
|
||||
mysql->options.no_master_reads = 1;
|
||||
}
|
||||
|
||||
/* get the value of the master read flag */
|
||||
my_bool STDCALL mysql_reads_from_master_enabled(MYSQL* mysql)
|
||||
{
|
||||
return !(mysql->options.no_master_reads);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
We may get an error while doing replication internals.
|
||||
In this case, we add a special explanation to the original
|
||||
error
|
||||
*/
|
||||
|
||||
static void expand_error(MYSQL* mysql, int error)
|
||||
{
|
||||
char tmp[MYSQL_ERRMSG_SIZE];
|
||||
char *p;
|
||||
uint err_length;
|
||||
strmake(tmp, mysql->net.last_error, MYSQL_ERRMSG_SIZE-1);
|
||||
p = strmake(mysql->net.last_error, ER(error), MYSQL_ERRMSG_SIZE-1);
|
||||
err_length= (uint) (p - mysql->net.last_error);
|
||||
strmake(p, tmp, MYSQL_ERRMSG_SIZE-1 - err_length);
|
||||
mysql->net.last_errno = error;
|
||||
}
|
||||
|
||||
/*
|
||||
This function assumes we have just called SHOW SLAVE STATUS and have
|
||||
read the given result and row
|
||||
*/
|
||||
|
||||
static my_bool get_master(MYSQL* mysql, MYSQL_RES* res, MYSQL_ROW row)
|
||||
{
|
||||
MYSQL* master;
|
||||
DBUG_ENTER("get_master");
|
||||
if (mysql_num_fields(res) < 3)
|
||||
DBUG_RETURN(1); /* safety */
|
||||
|
||||
/* use the same username and password as the original connection */
|
||||
if (!(master = spawn_init(mysql, row[0], atoi(row[2]), 0, 0)))
|
||||
DBUG_RETURN(1);
|
||||
mysql->master = master;
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Assuming we already know that mysql points to a master connection,
|
||||
retrieve all the slaves
|
||||
*/
|
||||
|
||||
static my_bool get_slaves_from_master(MYSQL* mysql)
|
||||
{
|
||||
MYSQL_RES* res = 0;
|
||||
MYSQL_ROW row;
|
||||
my_bool error = 1;
|
||||
int has_auth_info;
|
||||
int port_ind;
|
||||
DBUG_ENTER("get_slaves_from_master");
|
||||
|
||||
if (!mysql->net.vio && !mysql_real_connect(mysql,0,0,0,0,0,0,0))
|
||||
{
|
||||
expand_error(mysql, CR_PROBE_MASTER_CONNECT);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
mysql->reconnect= 1;
|
||||
|
||||
if (mysql_query(mysql, "SHOW SLAVE HOSTS") ||
|
||||
!(res = mysql_store_result(mysql)))
|
||||
{
|
||||
expand_error(mysql, CR_PROBE_SLAVE_HOSTS);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
switch (mysql_num_fields(res)) {
|
||||
case 5:
|
||||
has_auth_info = 0;
|
||||
port_ind=2;
|
||||
break;
|
||||
case 7:
|
||||
has_auth_info = 1;
|
||||
port_ind=4;
|
||||
break;
|
||||
default:
|
||||
goto err;
|
||||
}
|
||||
|
||||
while ((row = mysql_fetch_row(res)))
|
||||
{
|
||||
MYSQL* slave;
|
||||
const char* tmp_user, *tmp_pass;
|
||||
|
||||
if (has_auth_info)
|
||||
{
|
||||
tmp_user = row[2];
|
||||
tmp_pass = row[3];
|
||||
}
|
||||
else
|
||||
{
|
||||
tmp_user = mysql->user;
|
||||
tmp_pass = mysql->passwd;
|
||||
}
|
||||
|
||||
if (!(slave = spawn_init(mysql, row[1], atoi(row[port_ind]),
|
||||
tmp_user, tmp_pass)))
|
||||
goto err;
|
||||
|
||||
/* Now add slave into the circular linked list */
|
||||
slave->next_slave = mysql->next_slave;
|
||||
mysql->next_slave = slave;
|
||||
}
|
||||
error = 0;
|
||||
err:
|
||||
if (res)
|
||||
mysql_free_result(res);
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
|
||||
my_bool STDCALL mysql_rpl_probe(MYSQL* mysql)
|
||||
{
|
||||
MYSQL_RES *res= 0;
|
||||
MYSQL_ROW row;
|
||||
my_bool error= 1;
|
||||
DBUG_ENTER("mysql_rpl_probe");
|
||||
|
||||
/*
|
||||
First determine the replication role of the server we connected to
|
||||
the most reliable way to do this is to run SHOW SLAVE STATUS and see
|
||||
if we have a non-empty master host. This is still not fool-proof -
|
||||
it is not a sin to have a master that has a dormant slave thread with
|
||||
a non-empty master host. However, it is more reliable to check
|
||||
for empty master than whether the slave thread is actually running
|
||||
*/
|
||||
if (mysql_query(mysql, "SHOW SLAVE STATUS") ||
|
||||
!(res = mysql_store_result(mysql)))
|
||||
{
|
||||
expand_error(mysql, CR_PROBE_SLAVE_STATUS);
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
row= mysql_fetch_row(res);
|
||||
/*
|
||||
Check master host for emptiness/NULL
|
||||
For MySQL 4.0 it's enough to check for row[0]
|
||||
*/
|
||||
if (row && row[0] && *(row[0]))
|
||||
{
|
||||
/* this is a slave, ask it for the master */
|
||||
if (get_master(mysql, res, row) || get_slaves_from_master(mysql))
|
||||
goto err;
|
||||
}
|
||||
else
|
||||
{
|
||||
mysql->master = mysql;
|
||||
if (get_slaves_from_master(mysql))
|
||||
goto err;
|
||||
}
|
||||
|
||||
error = 0;
|
||||
err:
|
||||
if (res)
|
||||
mysql_free_result(res);
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Make a not so fool-proof decision on where the query should go, to
|
||||
the master or the slave. Ideally the user should always make this
|
||||
decision himself with mysql_master_query() or mysql_slave_query().
|
||||
However, to be able to more easily port the old code, we support the
|
||||
option of an educated guess - this should work for most applications,
|
||||
however, it may make the wrong decision in some particular cases. If
|
||||
that happens, the user would have to change the code to call
|
||||
mysql_master_query() or mysql_slave_query() explicitly in the place
|
||||
where we have made the wrong decision
|
||||
*/
|
||||
|
||||
enum mysql_rpl_type
|
||||
STDCALL mysql_rpl_query_type(const char* q, int len)
|
||||
{
|
||||
const char *q_end= q + len;
|
||||
for (; q < q_end; ++q)
|
||||
{
|
||||
char c;
|
||||
if (my_isalpha(&my_charset_latin1, (c= *q)))
|
||||
{
|
||||
switch (my_tolower(&my_charset_latin1,c)) {
|
||||
case 'i': /* insert */
|
||||
case 'u': /* update or unlock tables */
|
||||
case 'l': /* lock tables or load data infile */
|
||||
case 'd': /* drop or delete */
|
||||
case 'a': /* alter */
|
||||
return MYSQL_RPL_MASTER;
|
||||
case 'c': /* create or check */
|
||||
return my_tolower(&my_charset_latin1,q[1]) == 'h' ? MYSQL_RPL_ADMIN :
|
||||
MYSQL_RPL_MASTER;
|
||||
case 's': /* select or show */
|
||||
return my_tolower(&my_charset_latin1,q[1]) == 'h' ? MYSQL_RPL_ADMIN :
|
||||
MYSQL_RPL_SLAVE;
|
||||
case 'f': /* flush */
|
||||
case 'r': /* repair */
|
||||
case 'g': /* grant */
|
||||
return MYSQL_RPL_ADMIN;
|
||||
default:
|
||||
return MYSQL_RPL_SLAVE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return MYSQL_RPL_MASTER; /* By default, send to master */
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
Connect to sql server
|
||||
|
@ -1093,68 +784,6 @@ mysql_query(MYSQL *mysql, const char *query)
|
|||
}
|
||||
|
||||
|
||||
static MYSQL* spawn_init(MYSQL* parent, const char* host,
|
||||
unsigned int port, const char* user,
|
||||
const char* passwd)
|
||||
{
|
||||
MYSQL* child;
|
||||
DBUG_ENTER("spawn_init");
|
||||
if (!(child= mysql_init(0)))
|
||||
DBUG_RETURN(0);
|
||||
|
||||
child->options.user= my_strdup((user) ? user :
|
||||
(parent->user ? parent->user :
|
||||
parent->options.user), MYF(0));
|
||||
child->options.password= my_strdup((passwd) ? passwd :
|
||||
(parent->passwd ?
|
||||
parent->passwd :
|
||||
parent->options.password), MYF(0));
|
||||
child->options.port= port;
|
||||
child->options.host= my_strdup((host) ? host :
|
||||
(parent->host ?
|
||||
parent->host :
|
||||
parent->options.host), MYF(0));
|
||||
if (parent->db)
|
||||
child->options.db= my_strdup(parent->db, MYF(0));
|
||||
else if (parent->options.db)
|
||||
child->options.db= my_strdup(parent->options.db, MYF(0));
|
||||
|
||||
/*
|
||||
rpl_pivot is set to 1 in mysql_init(); Reset it as we are not doing
|
||||
replication here
|
||||
*/
|
||||
child->rpl_pivot= 0;
|
||||
DBUG_RETURN(child);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
STDCALL mysql_set_master(MYSQL* mysql, const char* host,
|
||||
unsigned int port, const char* user,
|
||||
const char* passwd)
|
||||
{
|
||||
if (mysql->master != mysql && !mysql->master->rpl_pivot)
|
||||
mysql_close(mysql->master);
|
||||
if (!(mysql->master = spawn_init(mysql, host, port, user, passwd)))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
STDCALL mysql_add_slave(MYSQL* mysql, const char* host,
|
||||
unsigned int port,
|
||||
const char* user,
|
||||
const char* passwd)
|
||||
{
|
||||
MYSQL* slave;
|
||||
if (!(slave = spawn_init(mysql, host, port, user, passwd)))
|
||||
return 1;
|
||||
slave->next_slave = mysql->next_slave;
|
||||
mysql->next_slave = slave;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
Return next field of the query results
|
||||
**************************************************************************/
|
||||
|
@ -1483,17 +1112,17 @@ MYSQL_FIELD_OFFSET STDCALL mysql_field_tell(MYSQL_RES *res)
|
|||
|
||||
unsigned int STDCALL mysql_field_count(MYSQL *mysql)
|
||||
{
|
||||
return mysql->last_used_con->field_count;
|
||||
return mysql->field_count;
|
||||
}
|
||||
|
||||
my_ulonglong STDCALL mysql_affected_rows(MYSQL *mysql)
|
||||
{
|
||||
return mysql->last_used_con->affected_rows;
|
||||
return mysql->affected_rows;
|
||||
}
|
||||
|
||||
my_ulonglong STDCALL mysql_insert_id(MYSQL *mysql)
|
||||
{
|
||||
return mysql->last_used_con->insert_id;
|
||||
return mysql->insert_id;
|
||||
}
|
||||
|
||||
const char *STDCALL mysql_sqlstate(MYSQL *mysql)
|
||||
|
@ -1858,7 +1487,6 @@ my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt)
|
|||
MYSQL_DATA *fields_data;
|
||||
DBUG_ENTER("cli_read_prepare_result");
|
||||
|
||||
mysql= mysql->last_used_con;
|
||||
if ((packet_length= cli_safe_read(mysql)) == packet_error)
|
||||
DBUG_RETURN(1);
|
||||
mysql->warning_count= 0;
|
||||
|
@ -2092,7 +1720,9 @@ static void alloc_stmt_fields(MYSQL_STMT *stmt)
|
|||
{
|
||||
MYSQL_FIELD *fields, *field, *end;
|
||||
MEM_ROOT *alloc= &stmt->mem_root;
|
||||
MYSQL *mysql= stmt->mysql->last_used_con;
|
||||
MYSQL *mysql= stmt->mysql;
|
||||
|
||||
DBUG_ASSERT(mysql->field_count);
|
||||
|
||||
stmt->field_count= mysql->field_count;
|
||||
|
||||
|
@ -2115,18 +1745,21 @@ static void alloc_stmt_fields(MYSQL_STMT *stmt)
|
|||
field= stmt->fields;
|
||||
field && fields < end; fields++, field++)
|
||||
{
|
||||
field->db = strdup_root(alloc,fields->db);
|
||||
field->table = strdup_root(alloc,fields->table);
|
||||
field->org_table= strdup_root(alloc,fields->org_table);
|
||||
field->name = strdup_root(alloc,fields->name);
|
||||
field->org_name = strdup_root(alloc,fields->org_name);
|
||||
field->charsetnr= fields->charsetnr;
|
||||
field->length = fields->length;
|
||||
field->type = fields->type;
|
||||
field->flags = fields->flags;
|
||||
field->decimals = fields->decimals;
|
||||
field->def = fields->def ? strdup_root(alloc,fields->def): 0;
|
||||
field->max_length= 0;
|
||||
*field= *fields; /* To copy all numeric parts. */
|
||||
field->catalog= strmake_root(alloc, fields->catalog,
|
||||
fields->catalog_length);
|
||||
field->db= strmake_root(alloc, fields->db, fields->db_length);
|
||||
field->table= strmake_root(alloc, fields->table, fields->table_length);
|
||||
field->org_table= strmake_root(alloc, fields->org_table,
|
||||
fields->org_table_length);
|
||||
field->name= strmake_root(alloc, fields->name, fields->name_length);
|
||||
field->org_name= strmake_root(alloc, fields->org_name,
|
||||
fields->org_name_length);
|
||||
field->def= fields->def ? strmake_root(alloc, fields->def,
|
||||
fields->def_length) : 0;
|
||||
field->def_length= field->def ? fields->def_length : 0;
|
||||
field->extension= 0; /* Avoid dangling links. */
|
||||
field->max_length= 0; /* max_length is set in mysql_stmt_store_result() */
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2479,7 +2112,6 @@ static my_bool execute(MYSQL_STMT *stmt, char *packet, ulong length)
|
|||
DBUG_ENTER("execute");
|
||||
DBUG_DUMP("packet", (uchar *) packet, length);
|
||||
|
||||
mysql->last_used_con= mysql;
|
||||
int4store(buff, stmt->stmt_id); /* Send stmt id to server */
|
||||
buff[4]= (char) stmt->flags;
|
||||
int4store(buff+5, 1); /* iteration count */
|
||||
|
@ -2854,6 +2486,33 @@ static void reinit_result_set_metadata(MYSQL_STMT *stmt)
|
|||
}
|
||||
|
||||
|
||||
static void prepare_to_fetch_result(MYSQL_STMT *stmt)
|
||||
{
|
||||
if (stmt->server_status & SERVER_STATUS_CURSOR_EXISTS)
|
||||
{
|
||||
stmt->mysql->status= MYSQL_STATUS_READY;
|
||||
stmt->read_row_func= stmt_read_row_from_cursor;
|
||||
}
|
||||
else if (stmt->flags & CURSOR_TYPE_READ_ONLY)
|
||||
{
|
||||
/*
|
||||
This is a single-row result set, a result set with no rows, EXPLAIN,
|
||||
SHOW VARIABLES, or some other command which either a) bypasses the
|
||||
cursors framework in the server and writes rows directly to the
|
||||
network or b) is more efficient if all (few) result set rows are
|
||||
precached on client and server's resources are freed.
|
||||
*/
|
||||
mysql_stmt_store_result(stmt);
|
||||
}
|
||||
else
|
||||
{
|
||||
stmt->mysql->unbuffered_fetch_owner= &stmt->unbuffered_fetch_cancelled;
|
||||
stmt->unbuffered_fetch_cancelled= FALSE;
|
||||
stmt->read_row_func= stmt_read_row_unbuffered;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Send placeholders data to server (if there are placeholders)
|
||||
and execute prepared statement.
|
||||
|
@ -2921,28 +2580,7 @@ int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt)
|
|||
if (mysql->field_count)
|
||||
{
|
||||
reinit_result_set_metadata(stmt);
|
||||
if (stmt->server_status & SERVER_STATUS_CURSOR_EXISTS)
|
||||
{
|
||||
mysql->status= MYSQL_STATUS_READY;
|
||||
stmt->read_row_func= stmt_read_row_from_cursor;
|
||||
}
|
||||
else if (stmt->flags & CURSOR_TYPE_READ_ONLY)
|
||||
{
|
||||
/*
|
||||
This is a single-row result set, a result set with no rows, EXPLAIN,
|
||||
SHOW VARIABLES, or some other command which either a) bypasses the
|
||||
cursors framework in the server and writes rows directly to the
|
||||
network or b) is more efficient if all (few) result set rows are
|
||||
precached on client and server's resources are freed.
|
||||
*/
|
||||
mysql_stmt_store_result(stmt);
|
||||
}
|
||||
else
|
||||
{
|
||||
stmt->mysql->unbuffered_fetch_owner= &stmt->unbuffered_fetch_cancelled;
|
||||
stmt->unbuffered_fetch_cancelled= FALSE;
|
||||
stmt->read_row_func= stmt_read_row_unbuffered;
|
||||
}
|
||||
prepare_to_fetch_result(stmt);
|
||||
}
|
||||
DBUG_RETURN(test(stmt->last_errno));
|
||||
}
|
||||
|
@ -4407,7 +4045,6 @@ static my_bool setup_one_fetch_function(MYSQL_BIND *param, MYSQL_FIELD *field)
|
|||
field->max_length= 10; /* 2003-11-11 */
|
||||
param->skip_result= skip_result_with_length;
|
||||
break;
|
||||
break;
|
||||
case MYSQL_TYPE_DATETIME:
|
||||
case MYSQL_TYPE_TIMESTAMP:
|
||||
param->skip_result= skip_result_with_length;
|
||||
|
@ -4689,7 +4326,6 @@ int cli_read_binary_rows(MYSQL_STMT *stmt)
|
|||
}
|
||||
|
||||
net = &mysql->net;
|
||||
mysql= mysql->last_used_con;
|
||||
|
||||
while ((pkt_len= cli_safe_read(mysql)) != packet_error)
|
||||
{
|
||||
|
@ -4787,8 +4423,6 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt)
|
|||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
mysql= mysql->last_used_con;
|
||||
|
||||
if (!stmt->field_count)
|
||||
DBUG_RETURN(0);
|
||||
|
||||
|
@ -4990,7 +4624,7 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags)
|
|||
if (stmt->field_count && mysql->status != MYSQL_STATUS_READY)
|
||||
{
|
||||
/* There is a result set and it belongs to this statement */
|
||||
(*mysql->methods->flush_use_result)(mysql);
|
||||
(*mysql->methods->flush_use_result)(mysql, FALSE);
|
||||
if (mysql->unbuffered_fetch_owner)
|
||||
*mysql->unbuffered_fetch_owner= TRUE;
|
||||
mysql->status= MYSQL_STATUS_READY;
|
||||
|
@ -5074,7 +4708,7 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt)
|
|||
Flush result set of the connection. If it does not belong
|
||||
to this statement, set a warning.
|
||||
*/
|
||||
(*mysql->methods->flush_use_result)(mysql);
|
||||
(*mysql->methods->flush_use_result)(mysql, TRUE);
|
||||
if (mysql->unbuffered_fetch_owner)
|
||||
*mysql->unbuffered_fetch_owner= TRUE;
|
||||
mysql->status= MYSQL_STATUS_READY;
|
||||
|
@ -5193,8 +4827,7 @@ my_bool STDCALL mysql_more_results(MYSQL *mysql)
|
|||
my_bool res;
|
||||
DBUG_ENTER("mysql_more_results");
|
||||
|
||||
res= ((mysql->last_used_con->server_status & SERVER_MORE_RESULTS_EXISTS) ?
|
||||
1: 0);
|
||||
res= ((mysql->server_status & SERVER_MORE_RESULTS_EXISTS) ? 1: 0);
|
||||
DBUG_PRINT("exit",("More results exists ? %d", res));
|
||||
DBUG_RETURN(res);
|
||||
}
|
||||
|
@ -5216,13 +4849,56 @@ int STDCALL mysql_next_result(MYSQL *mysql)
|
|||
net_clear_error(&mysql->net);
|
||||
mysql->affected_rows= ~(my_ulonglong) 0;
|
||||
|
||||
if (mysql->last_used_con->server_status & SERVER_MORE_RESULTS_EXISTS)
|
||||
if (mysql->server_status & SERVER_MORE_RESULTS_EXISTS)
|
||||
DBUG_RETURN((*mysql->methods->next_result)(mysql));
|
||||
|
||||
DBUG_RETURN(-1); /* No more results */
|
||||
}
|
||||
|
||||
|
||||
int STDCALL mysql_stmt_next_result(MYSQL_STMT *stmt)
|
||||
{
|
||||
MYSQL *mysql= stmt->mysql;
|
||||
int rc;
|
||||
DBUG_ENTER("mysql_stmt_next_result");
|
||||
|
||||
if (!mysql)
|
||||
DBUG_RETURN(1);
|
||||
|
||||
if (stmt->last_errno)
|
||||
DBUG_RETURN(stmt->last_errno);
|
||||
|
||||
if (mysql->server_status & SERVER_MORE_RESULTS_EXISTS)
|
||||
{
|
||||
if (reset_stmt_handle(stmt, RESET_STORE_RESULT))
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
rc= mysql_next_result(mysql);
|
||||
|
||||
if (rc)
|
||||
{
|
||||
set_stmt_errmsg(stmt, &mysql->net);
|
||||
DBUG_RETURN(rc);
|
||||
}
|
||||
|
||||
stmt->state= MYSQL_STMT_EXECUTE_DONE;
|
||||
stmt->bind_result_done= FALSE;
|
||||
|
||||
if (mysql->field_count)
|
||||
{
|
||||
alloc_stmt_fields(stmt);
|
||||
prepare_to_fetch_result(stmt);
|
||||
}
|
||||
else
|
||||
{
|
||||
stmt->field_count= mysql->field_count;
|
||||
}
|
||||
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
||||
MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql)
|
||||
{
|
||||
return (*mysql->methods->use_result)(mysql);
|
||||
|
|
|
@ -135,15 +135,6 @@ EXPORTS
|
|||
client_errors
|
||||
mysql_set_local_infile_default
|
||||
mysql_set_local_infile_handler
|
||||
mysql_disable_reads_from_master
|
||||
mysql_disable_rpl_parse
|
||||
mysql_enable_reads_from_master
|
||||
mysql_enable_rpl_parse
|
||||
mysql_master_query
|
||||
mysql_rpl_parse_enabled
|
||||
mysql_rpl_probe
|
||||
mysql_rpl_query_type
|
||||
mysql_slave_query
|
||||
mysql_embedded
|
||||
mysql_server_init
|
||||
mysql_server_end
|
||||
|
|
|
@ -1,269 +0,0 @@
|
|||
/* Copyright (C) 2000-2004 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation.
|
||||
|
||||
There are special exceptions to the terms and conditions of the GPL as it
|
||||
is applied to this software. View the full text of the exception in file
|
||||
EXCEPTIONS-CLIENT in the directory of this software distribution.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#include <my_global.h>
|
||||
#if defined(THREAD)
|
||||
#include <my_pthread.h> /* because of signal() */
|
||||
#endif
|
||||
#include "mysql.h"
|
||||
#include "mysql_version.h"
|
||||
#include "mysqld_error.h"
|
||||
#include <my_sys.h>
|
||||
#include <mysys_err.h>
|
||||
#include <m_string.h>
|
||||
#include <m_ctype.h>
|
||||
#include <my_net.h>
|
||||
#include <errmsg.h>
|
||||
#include <violite.h>
|
||||
#include <sys/stat.h>
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if defined(__NETWARE__)
|
||||
#include <netdb.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/utsname.h>
|
||||
#elif !defined( __WIN__)
|
||||
#include <sys/resource.h>
|
||||
#ifdef HAVE_SYS_UN_H
|
||||
# include <sys/un.h>
|
||||
#endif
|
||||
#include <netdb.h>
|
||||
#ifdef HAVE_SELECT_H
|
||||
# include <select.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
#include <sys/utsname.h>
|
||||
#endif /* __WIN__ */
|
||||
|
||||
#ifndef INADDR_NONE
|
||||
#define INADDR_NONE -1
|
||||
#endif
|
||||
|
||||
#define RES_BUF_SHIFT 5
|
||||
#define NET_BUF_SIZE 2048
|
||||
|
||||
MYSQL_MANAGER* STDCALL mysql_manager_init(MYSQL_MANAGER* con)
|
||||
{
|
||||
int net_buf_size=NET_BUF_SIZE;
|
||||
if (!con)
|
||||
{
|
||||
if (!(con=(MYSQL_MANAGER*)my_malloc(sizeof(*con)+net_buf_size,
|
||||
MYF(MY_WME|MY_ZEROFILL))))
|
||||
return 0;
|
||||
con->free_me=1;
|
||||
con->net_buf=(char*)con+sizeof(*con);
|
||||
}
|
||||
else
|
||||
{
|
||||
bzero((char*)con,sizeof(*con));
|
||||
if (!(con->net_buf=my_malloc(net_buf_size,MYF(0))))
|
||||
return 0;
|
||||
}
|
||||
con->net_buf_pos=con->net_data_end=con->net_buf;
|
||||
con->net_buf_size=net_buf_size;
|
||||
return con;
|
||||
}
|
||||
|
||||
MYSQL_MANAGER* STDCALL mysql_manager_connect(MYSQL_MANAGER* con,
|
||||
const char* host,
|
||||
const char* user,
|
||||
const char* passwd,
|
||||
unsigned int port)
|
||||
{
|
||||
my_socket sock;
|
||||
struct sockaddr_in sock_addr;
|
||||
in_addr_t ip_addr;
|
||||
char msg_buf[MAX_MYSQL_MANAGER_MSG];
|
||||
int msg_len;
|
||||
Vio* vio;
|
||||
my_bool not_used;
|
||||
|
||||
if (!host)
|
||||
host="localhost";
|
||||
if (!user)
|
||||
user="root";
|
||||
if (!passwd)
|
||||
passwd="";
|
||||
|
||||
if ((sock=(my_socket)socket(AF_INET,SOCK_STREAM,0)) == INVALID_SOCKET)
|
||||
{
|
||||
con->last_errno=errno;
|
||||
strmov(con->last_error,"Cannot create socket");
|
||||
goto err;
|
||||
}
|
||||
if (!(vio=vio_new(sock,VIO_TYPE_TCPIP,FALSE)))
|
||||
{
|
||||
con->last_errno=ENOMEM;
|
||||
strmov(con->last_error,"Cannot create network I/O object");
|
||||
goto err;
|
||||
}
|
||||
vio_blocking(vio, TRUE, ¬_used);
|
||||
my_net_init(&con->net,vio);
|
||||
bzero((char*) &sock_addr,sizeof(sock_addr));
|
||||
sock_addr.sin_family = AF_INET;
|
||||
if ((int) (ip_addr = inet_addr(host)) != (int) INADDR_NONE)
|
||||
{
|
||||
memcpy_fixed(&sock_addr.sin_addr,&ip_addr,sizeof(ip_addr));
|
||||
}
|
||||
else
|
||||
{
|
||||
int tmp_errno;
|
||||
struct hostent tmp_hostent,*hp;
|
||||
char buff2[GETHOSTBYNAME_BUFF_SIZE];
|
||||
hp = my_gethostbyname_r(host,&tmp_hostent,buff2,sizeof(buff2),
|
||||
&tmp_errno);
|
||||
if (!hp)
|
||||
{
|
||||
con->last_errno=tmp_errno;
|
||||
sprintf(con->last_error,"Could not resolve host '%-.64s'",host);
|
||||
my_gethostbyname_r_free();
|
||||
goto err;
|
||||
}
|
||||
memcpy(&sock_addr.sin_addr,hp->h_addr, (size_t) hp->h_length);
|
||||
my_gethostbyname_r_free();
|
||||
}
|
||||
sock_addr.sin_port = (ushort) htons((ushort) port);
|
||||
if (my_connect(sock,(struct sockaddr *) &sock_addr, sizeof(sock_addr),
|
||||
0))
|
||||
{
|
||||
con->last_errno=errno;
|
||||
sprintf(con->last_error ,"Could not connect to %-.64s", host);
|
||||
goto err;
|
||||
}
|
||||
/* read the greating */
|
||||
if (my_net_read(&con->net) == packet_error)
|
||||
{
|
||||
con->last_errno=errno;
|
||||
strmov(con->last_error,"Read error on socket");
|
||||
goto err;
|
||||
}
|
||||
sprintf(msg_buf,"%-.16s %-.16s\n",user,passwd);
|
||||
msg_len=strlen(msg_buf);
|
||||
if (my_net_write(&con->net,(uchar*) msg_buf,msg_len) || net_flush(&con->net))
|
||||
{
|
||||
con->last_errno=con->net.last_errno;
|
||||
strmov(con->last_error,"Write error on socket");
|
||||
goto err;
|
||||
}
|
||||
if (my_net_read(&con->net) == packet_error)
|
||||
{
|
||||
con->last_errno=errno;
|
||||
strmov(con->last_error,"Read error on socket");
|
||||
goto err;
|
||||
}
|
||||
if ((con->cmd_status=atoi((char*) con->net.read_pos)) != MANAGER_OK)
|
||||
{
|
||||
strmov(con->last_error,"Access denied");
|
||||
goto err;
|
||||
}
|
||||
if (!my_multi_malloc(MYF(0), &con->host, (uint)strlen(host)+1,
|
||||
&con->user, (uint)strlen(user)+1,
|
||||
&con->passwd, (uint)strlen(passwd)+1,
|
||||
NullS))
|
||||
{
|
||||
con->last_errno=ENOMEM;
|
||||
strmov(con->last_error,"Out of memory");
|
||||
goto err;
|
||||
}
|
||||
strmov(con->host,host);
|
||||
strmov(con->user,user);
|
||||
strmov(con->passwd,passwd);
|
||||
return con;
|
||||
|
||||
err:
|
||||
{
|
||||
my_bool free_me=con->free_me;
|
||||
con->free_me=0;
|
||||
mysql_manager_close(con);
|
||||
con->free_me=free_me;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void STDCALL mysql_manager_close(MYSQL_MANAGER* con)
|
||||
{
|
||||
/*
|
||||
No need to free con->user and con->passwd, because they were
|
||||
allocated in my_multimalloc() along with con->host, freeing
|
||||
con->hosts frees the whole block
|
||||
*/
|
||||
my_free((uchar*)con->host,MYF(MY_ALLOW_ZERO_PTR));
|
||||
net_end(&con->net);
|
||||
if (con->free_me)
|
||||
my_free((uchar*)con,MYF(0));
|
||||
}
|
||||
|
||||
|
||||
int STDCALL mysql_manager_command(MYSQL_MANAGER* con,const char* cmd,
|
||||
int cmd_len)
|
||||
{
|
||||
if (!cmd_len)
|
||||
cmd_len=strlen(cmd);
|
||||
if (my_net_write(&con->net,(const uchar*)cmd,cmd_len) || net_flush(&con->net))
|
||||
{
|
||||
con->last_errno=errno;
|
||||
strmov(con->last_error,"Write error on socket");
|
||||
return 1;
|
||||
}
|
||||
con->eof=0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int STDCALL mysql_manager_fetch_line(MYSQL_MANAGER* con, char* res_buf,
|
||||
int res_buf_size)
|
||||
{
|
||||
char* res_buf_end=res_buf+res_buf_size;
|
||||
char* net_buf=(char*) con->net.read_pos, *net_buf_end;
|
||||
int res_buf_shift=RES_BUF_SHIFT;
|
||||
ulong num_bytes;
|
||||
|
||||
if (res_buf_size<RES_BUF_SHIFT)
|
||||
{
|
||||
con->last_errno=ENOMEM;
|
||||
strmov(con->last_error,"Result buffer too small");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((num_bytes=my_net_read(&con->net)) == packet_error)
|
||||
{
|
||||
con->last_errno=errno;
|
||||
strmov(con->last_error,"socket read failed");
|
||||
return 1;
|
||||
}
|
||||
|
||||
net_buf_end=net_buf+num_bytes;
|
||||
|
||||
if ((con->eof=(net_buf[3]==' ')))
|
||||
res_buf_shift--;
|
||||
net_buf+=res_buf_shift;
|
||||
res_buf_end[-1]=0;
|
||||
for (;net_buf<net_buf_end && res_buf < res_buf_end;res_buf++,net_buf++)
|
||||
{
|
||||
if ((*res_buf=*net_buf) == '\r')
|
||||
{
|
||||
*res_buf=0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
|
@ -98,7 +98,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
|
|||
thd= (THD *) mysql->thd;
|
||||
}
|
||||
|
||||
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
|
||||
#if defined(ENABLED_PROFILING)
|
||||
thd->profiling.start_new_query();
|
||||
#endif
|
||||
|
||||
|
@ -144,13 +144,13 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
|
|||
|
||||
thd->mysys_var= 0;
|
||||
|
||||
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
|
||||
#if defined(ENABLED_PROFILING)
|
||||
thd->profiling.finish_current_query();
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
static void emb_flush_use_result(MYSQL *mysql)
|
||||
static void emb_flush_use_result(MYSQL *mysql, my_bool)
|
||||
{
|
||||
THD *thd= (THD*) mysql->thd;
|
||||
if (thd->cur_data)
|
||||
|
@ -656,7 +656,7 @@ int check_embedded_connection(MYSQL *mysql, const char *db)
|
|||
strmake(sctx->priv_host, (char*) my_localhost, MAX_HOSTNAME-1);
|
||||
sctx->priv_user= sctx->user= my_strdup(mysql->user, MYF(0));
|
||||
result= check_user(thd, COM_CONNECT, NULL, 0, db, true);
|
||||
net_end_statement(thd);
|
||||
thd->protocol->end_statement();
|
||||
emb_read_query_result(mysql);
|
||||
return result;
|
||||
}
|
||||
|
@ -882,7 +882,7 @@ void Protocol_text::remove_last_row()
|
|||
}
|
||||
|
||||
|
||||
bool Protocol::send_fields(List<Item> *list, uint flags)
|
||||
bool Protocol::send_result_set_metadata(List<Item> *list, uint flags)
|
||||
{
|
||||
List_iterator_fast<Item> it(*list);
|
||||
Item *item;
|
||||
|
@ -891,7 +891,7 @@ bool Protocol::send_fields(List<Item> *list, uint flags)
|
|||
CHARSET_INFO *thd_cs= thd->variables.character_set_results;
|
||||
CHARSET_INFO *cs= system_charset_info;
|
||||
MYSQL_DATA *data;
|
||||
DBUG_ENTER("send_fields");
|
||||
DBUG_ENTER("send_result_set_metadata");
|
||||
|
||||
if (!thd->mysql) // bootstrap file handling
|
||||
DBUG_RETURN(0);
|
||||
|
@ -985,7 +985,7 @@ bool Protocol::send_fields(List<Item> *list, uint flags)
|
|||
write_eof_packet(thd, thd->server_status,
|
||||
thd->warning_info->statement_warn_count());
|
||||
|
||||
DBUG_RETURN(prepare_for_send(list));
|
||||
DBUG_RETURN(prepare_for_send(list->elements));
|
||||
err:
|
||||
my_error(ER_OUT_OF_RESOURCES, MYF(0)); /* purecov: inspected */
|
||||
DBUG_RETURN(1); /* purecov: inspected */
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <sys/stat.h>
|
||||
#include <signal.h>
|
||||
#include <time.h>
|
||||
#include <sql_common.h>
|
||||
#include "client_settings.h"
|
||||
#ifdef HAVE_PWD_H
|
||||
#include <pwd.h>
|
||||
|
@ -77,17 +78,6 @@ static my_bool is_NT(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
/**************************************************************************
|
||||
** Shut down connection
|
||||
**************************************************************************/
|
||||
|
||||
static void end_server(MYSQL *mysql)
|
||||
{
|
||||
DBUG_ENTER("end_server");
|
||||
free_old_query(mysql);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
||||
int mysql_init_character_set(MYSQL *mysql);
|
||||
|
||||
|
@ -104,6 +94,13 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
|
|||
db ? db : "(Null)",
|
||||
user ? user : "(Null)"));
|
||||
|
||||
/* Test whether we're already connected */
|
||||
if (mysql->server_version)
|
||||
{
|
||||
set_mysql_error(mysql, CR_ALREADY_CONNECTED, unknown_sqlstate);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
if (!host || !host[0])
|
||||
host= mysql->options.host;
|
||||
|
||||
|
@ -216,7 +213,7 @@ error:
|
|||
{
|
||||
/* Free alloced memory */
|
||||
my_bool free_me=mysql->free_me;
|
||||
end_server(mysql);
|
||||
free_old_query(mysql);
|
||||
mysql->free_me=0;
|
||||
mysql_close(mysql);
|
||||
mysql->free_me=free_me;
|
||||
|
|
|
@ -13,9 +13,7 @@ EXPORTS
|
|||
mysql_commit
|
||||
mysql_data_seek
|
||||
mysql_debug
|
||||
mysql_disable_rpl_parse
|
||||
mysql_dump_debug_info
|
||||
mysql_enable_rpl_parse
|
||||
mysql_eof
|
||||
mysql_errno
|
||||
mysql_error
|
||||
|
@ -61,8 +59,6 @@ EXPORTS
|
|||
mysql_rollback
|
||||
mysql_row_seek
|
||||
mysql_row_tell
|
||||
mysql_rpl_parse_enabled
|
||||
mysql_rpl_probe
|
||||
mysql_select_db
|
||||
mysql_send_query
|
||||
mysql_shutdown
|
||||
|
|
|
@ -22,6 +22,7 @@ rpl.rpl_innodb_bug30888* @solaris # Bug#47646 2009-09-25 alik rpl.rpl_inn
|
|||
rpl.rpl_plugin_load* @solaris # Bug#47146
|
||||
rpl.rpl_row_create_table* # Bug#45576: rpl_row_create_table fails on PB2
|
||||
rpl.rpl_log_pos* # Bug#47743 2009-10-02 alik rpl.rpl_log_pos fails sporadically
|
||||
rpl.rpl_timezone* # Bug#47017 2009-10-27 alik rpl_timezone fails on PB-2 with mismatch error
|
||||
rpl.rpl_trigger* # Bug#46656 2009-09-25 alik InnoDB plugin: memory leaks (Valgrind)
|
||||
rpl.rpl_heartbeat_basic # BUG#43828 2009-10-22 luis fails sporadically
|
||||
rpl.rpl_heartbeat_2slaves # BUG#43828 2009-10-22 luis fails sporadically
|
||||
|
|
21
mysql-test/include/bug38347.inc
Normal file
21
mysql-test/include/bug38347.inc
Normal file
|
@ -0,0 +1,21 @@
|
|||
|
||||
--echo
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
|
||||
--echo
|
||||
--echo # connection: con1 (mysqltest_u1@mysqltest_db1)
|
||||
--connect (con1,localhost,mysqltest_u1,,mysqltest_db1)
|
||||
--connection con1
|
||||
|
||||
--echo
|
||||
SHOW CREATE TABLE t1;
|
||||
|
||||
--echo
|
||||
--echo # connection: default
|
||||
--connection default
|
||||
|
||||
--disconnect con1
|
||||
|
||||
--echo
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
|
@ -1,4 +0,0 @@
|
|||
--require r/have_community_features.require
|
||||
--disable_query_log
|
||||
show variables like 'have_community_features';
|
||||
--enable_query_log
|
4
mysql-test/include/have_nodebug.inc
Normal file
4
mysql-test/include/have_nodebug.inc
Normal file
|
@ -0,0 +1,4 @@
|
|||
-- require r/have_nodebug.require
|
||||
disable_query_log;
|
||||
select (version() like '%debug%') as debug;
|
||||
enable_query_log;
|
4
mysql-test/include/have_profiling.inc
Normal file
4
mysql-test/include/have_profiling.inc
Normal file
|
@ -0,0 +1,4 @@
|
|||
--require r/have_profiling.require
|
||||
--disable_query_log
|
||||
show variables like 'have_profiling';
|
||||
--enable_query_log
|
|
@ -1,11 +1,13 @@
|
|||
############### include/query_cache_sql_prepare.inc ################
|
||||
#
|
||||
# This is to see how statements prepared via the PREPARE SQL command
|
||||
# go into the query cache: if using parameters they cannot; if not
|
||||
# using parameters they can.
|
||||
# go into the query cache.
|
||||
# Query cache is abbreviated as "QC"
|
||||
#
|
||||
# Last update:
|
||||
# 2008-05-26 Kostja
|
||||
# - Add test coverage for automatic statement reprepare
|
||||
#
|
||||
# 2007-05-03 ML - Move t/query_cache_sql_prepare.test
|
||||
# to include/query_cache_sql_prepare.inc
|
||||
# - Create two toplevel tests sourcing this routine
|
||||
|
@ -490,6 +492,37 @@ use test;
|
|||
|
||||
--echo
|
||||
--echo ########################################################################
|
||||
--echo #
|
||||
--echo # Bug#27430 Crash in subquery code when in PS and table DDL changed
|
||||
--echo # after PREPARE
|
||||
--echo # Check the effect of automatic reprepare on query cache
|
||||
--echo #
|
||||
--echo ########################################################################
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
create table t1 (a varchar(255));
|
||||
insert into t1 (a) values ("Pack my box with five dozen liquor jugs.");
|
||||
flush status;
|
||||
prepare stmt from "select a from t1";
|
||||
execute stmt;
|
||||
set @@global.query_cache_size=0;
|
||||
alter table t1 add column b int;
|
||||
execute stmt;
|
||||
set @@global.query_cache_size=100000;
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
--echo #
|
||||
--echo # Sic: ALTER TABLE caused an automatic reprepare
|
||||
--echo # of the prepared statement. Since the query cache was disabled
|
||||
--echo # at the time of reprepare, the new prepared statement doesn't
|
||||
--echo # work with it.
|
||||
--echo #
|
||||
show status like 'Qcache_hits';
|
||||
show status like 'Qcache_queries_in_cache';
|
||||
--echo # Cleanup
|
||||
deallocate prepare stmt;
|
||||
drop table t1;
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
|
|
@ -259,7 +259,8 @@ sub collect_one_suite($)
|
|||
else
|
||||
{
|
||||
$suitedir= my_find_dir($::basedir,
|
||||
["mysql-test/suite",
|
||||
["share/mysql-test/suite",
|
||||
"mysql-test/suite",
|
||||
"mysql-test",
|
||||
# Look in storage engine specific suite dirs
|
||||
"storage/*/mysql-test-suites"
|
||||
|
|
|
@ -1331,3 +1331,11 @@ affected rows: 2
|
|||
info: Records: 2 Duplicates: 0 Warnings: 0
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
CREATE TABLE t1(c CHAR(10),
|
||||
i INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY);
|
||||
INSERT INTO t1 VALUES('a',2),('b',4),('c',6);
|
||||
ALTER TABLE t1
|
||||
DROP i,
|
||||
ADD i INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
AUTO_INCREMENT = 1;
|
||||
DROP TABLE t1;
|
||||
|
|
|
@ -1922,3 +1922,37 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
|
|||
# -- End of Bug#45829
|
||||
|
||||
End of 5.1 tests
|
||||
|
||||
# --
|
||||
# -- Bug #43054 Assertion `!table->auto_increment_field_not_null'
|
||||
# -- failed when redefining trigger
|
||||
|
||||
CREATE TABLE B (
|
||||
pk INTEGER AUTO_INCREMENT,
|
||||
int_key INTEGER NOT NULL,
|
||||
PRIMARY KEY (pk),
|
||||
KEY (int_key)
|
||||
);
|
||||
INSERT IGNORE INTO B VALUES ('9', '9');
|
||||
CREATE TABLE IF NOT EXISTS t1 (
|
||||
`pk` INTEGER NOT NULL AUTO_INCREMENT ,
|
||||
`int` INTEGER ,
|
||||
PRIMARY KEY ( `pk` )
|
||||
) SELECT `pk` , `int_key` FROM B ;
|
||||
CREATE TRIGGER f BEFORE INSERT ON t1 FOR EACH ROW
|
||||
BEGIN
|
||||
INSERT INTO t1 ( `int` ) VALUES (4 ),( 8 ),( 2 ) ;
|
||||
END ; |
|
||||
CREATE TABLE IF NOT EXISTS t1 (
|
||||
`pk` INTEGER NOT NULL AUTO_INCREMENT ,
|
||||
`int` INTEGER ,
|
||||
PRIMARY KEY ( `pk` )
|
||||
) SELECT `pk` , `int_key` FROM B ;
|
||||
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
|
||||
CREATE TRIGGER f BEFORE INSERT ON t1 FOR EACH ROW
|
||||
BEGIN
|
||||
UPDATE A SET `pk`=1 WHERE `pk`=0 ;
|
||||
END ;|
|
||||
ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
|
||||
DROP TABLE t1;
|
||||
DROP TABLE B;
|
||||
|
|
|
@ -35,15 +35,15 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'|
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
|
||||
NULL mysqltest1 v1 select 'ÔÅÓÔ' AS `c1`,`mysqltest1`.`t1`.`ËÏÌ` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci
|
||||
def mysqltest1 v1 select 'ÔÅÓÔ' AS `c1`,`mysqltest1`.`t1`.`ËÏÌ` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci
|
||||
|
||||
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'|
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
|
||||
NULL mysqltest1 v2 select 'ÔÅÓÔ' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
|
||||
def mysqltest1 v2 select 'ÔÅÓÔ' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
|
||||
|
||||
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'|
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
|
||||
NULL mysqltest1 v3 select 'ÔÅÓÔ' AS `ÔÅÓÔ` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
|
||||
def mysqltest1 v3 select 'ÔÅÓÔ' AS `ÔÅÓÔ` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
|
||||
|
||||
|
||||
SELECT COLLATION(c1), COLLATION(c2) FROM v1|
|
||||
|
@ -87,15 +87,15 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'|
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
|
||||
NULL mysqltest1 v1 select 'ÔÅÓÔ' AS `c1`,`mysqltest1`.`t1`.`ËÏÌ` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci
|
||||
def mysqltest1 v1 select 'ÔÅÓÔ' AS `c1`,`mysqltest1`.`t1`.`ËÏÌ` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci
|
||||
|
||||
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'|
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
|
||||
NULL mysqltest1 v2 select 'ÔÅÓÔ' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
|
||||
def mysqltest1 v2 select 'ÔÅÓÔ' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
|
||||
|
||||
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'|
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
|
||||
NULL mysqltest1 v3 select 'ÔÅÓÔ' AS `ÔÅÓÔ` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
|
||||
def mysqltest1 v3 select 'ÔÅÓÔ' AS `ÔÅÓÔ` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
|
||||
|
||||
|
||||
SELECT COLLATION(c1), COLLATION(c2) FROM v1|
|
||||
|
@ -144,15 +144,15 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'|
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
|
||||
NULL mysqltest1 v1 select 'ÔÅÓÔ' AS `c1`,`mysqltest1`.`t1`.`ËÏÌ` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci
|
||||
def mysqltest1 v1 select 'ÔÅÓÔ' AS `c1`,`mysqltest1`.`t1`.`ËÏÌ` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci
|
||||
|
||||
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'|
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
|
||||
NULL mysqltest1 v2 select 'ÔÅÓÔ' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
|
||||
def mysqltest1 v2 select 'ÔÅÓÔ' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
|
||||
|
||||
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'|
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
|
||||
NULL mysqltest1 v3 select 'ÔÅÓÔ' AS `ÔÅÓÔ` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
|
||||
def mysqltest1 v3 select 'ÔÅÓÔ' AS `ÔÅÓÔ` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
|
||||
|
||||
|
||||
SELECT COLLATION(c1), COLLATION(c2) FROM v1|
|
||||
|
@ -362,7 +362,7 @@ mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_gen
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'|
|
||||
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
|
||||
p1 NULL mysqltest1 p1 PROCEDURE NULL SQL BEGIN
|
||||
p1 def mysqltest1 p1 PROCEDURE NULL SQL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10);
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -380,7 +380,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'|
|
||||
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
|
||||
p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN
|
||||
p2 def mysqltest1 p2 PROCEDURE NULL SQL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -398,7 +398,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'|
|
||||
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
|
||||
p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN
|
||||
p3 def mysqltest2 p3 PROCEDURE NULL SQL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10);
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -416,7 +416,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'|
|
||||
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
|
||||
p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN
|
||||
p4 def mysqltest2 p4 PROCEDURE NULL SQL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -608,7 +608,7 @@ mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_gen
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'|
|
||||
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
|
||||
p1 NULL mysqltest1 p1 PROCEDURE NULL SQL BEGIN
|
||||
p1 def mysqltest1 p1 PROCEDURE NULL SQL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10);
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -626,7 +626,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'|
|
||||
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
|
||||
p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN
|
||||
p2 def mysqltest1 p2 PROCEDURE NULL SQL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -644,7 +644,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'|
|
||||
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
|
||||
p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN
|
||||
p3 def mysqltest2 p3 PROCEDURE NULL SQL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10);
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -662,7 +662,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'|
|
||||
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
|
||||
p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN
|
||||
p4 def mysqltest2 p4 PROCEDURE NULL SQL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -1010,7 +1010,7 @@ mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_gen
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'|
|
||||
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
|
||||
p1 NULL mysqltest1 p1 PROCEDURE NULL SQL BEGIN
|
||||
p1 def mysqltest1 p1 PROCEDURE NULL SQL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10);
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -1028,7 +1028,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'|
|
||||
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
|
||||
p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN
|
||||
p2 def mysqltest1 p2 PROCEDURE NULL SQL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -1046,7 +1046,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'|
|
||||
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
|
||||
p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN
|
||||
p3 def mysqltest2 p3 PROCEDURE NULL SQL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10);
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -1064,7 +1064,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'|
|
||||
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
|
||||
p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN
|
||||
p4 def mysqltest2 p4 PROCEDURE NULL SQL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -1323,7 +1323,7 @@ use mysqltest1|
|
|||
|
||||
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 CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest1 trg1 INSERT NULL mysqltest1 t1 0 NULL BEGIN
|
||||
def mysqltest1 trg1 INSERT def mysqltest1 t1 0 NULL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10);
|
||||
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
|
||||
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
|
||||
|
@ -1338,7 +1338,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'|
|
||||
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
|
||||
NULL mysqltest1 trg2 INSERT NULL mysqltest1 t1 0 NULL BEGIN
|
||||
def mysqltest1 trg2 INSERT def mysqltest1 t1 0 NULL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
|
||||
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
|
||||
|
@ -1353,7 +1353,7 @@ END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci u
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'|
|
||||
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
|
||||
NULL mysqltest2 trg3 INSERT NULL mysqltest2 t1 0 NULL BEGIN
|
||||
def mysqltest2 trg3 INSERT def mysqltest2 t1 0 NULL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10);
|
||||
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
|
||||
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
|
||||
|
@ -1368,7 +1368,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'|
|
||||
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
|
||||
NULL mysqltest2 trg4 INSERT NULL mysqltest2 t1 0 NULL BEGIN
|
||||
def mysqltest2 trg4 INSERT def mysqltest2 t1 0 NULL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
|
||||
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
|
||||
|
@ -1596,7 +1596,7 @@ use mysqltest1|
|
|||
|
||||
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 CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest1 trg1 INSERT NULL mysqltest1 t1 0 NULL BEGIN
|
||||
def mysqltest1 trg1 INSERT def mysqltest1 t1 0 NULL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10);
|
||||
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
|
||||
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
|
||||
|
@ -1611,7 +1611,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'|
|
||||
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
|
||||
NULL mysqltest1 trg2 INSERT NULL mysqltest1 t1 0 NULL BEGIN
|
||||
def mysqltest1 trg2 INSERT def mysqltest1 t1 0 NULL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
|
||||
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
|
||||
|
@ -1626,7 +1626,7 @@ END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci u
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'|
|
||||
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
|
||||
NULL mysqltest2 trg3 INSERT NULL mysqltest2 t1 0 NULL BEGIN
|
||||
def mysqltest2 trg3 INSERT def mysqltest2 t1 0 NULL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10);
|
||||
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
|
||||
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
|
||||
|
@ -1641,7 +1641,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'|
|
||||
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
|
||||
NULL mysqltest2 trg4 INSERT NULL mysqltest2 t1 0 NULL BEGIN
|
||||
def mysqltest2 trg4 INSERT def mysqltest2 t1 0 NULL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
|
||||
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
|
||||
|
@ -2031,7 +2031,7 @@ use mysqltest1|
|
|||
|
||||
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 CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest1 trg1 INSERT NULL mysqltest1 t1 0 NULL BEGIN
|
||||
def mysqltest1 trg1 INSERT def mysqltest1 t1 0 NULL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10);
|
||||
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
|
||||
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
|
||||
|
@ -2046,7 +2046,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'|
|
||||
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
|
||||
NULL mysqltest1 trg2 INSERT NULL mysqltest1 t1 0 NULL BEGIN
|
||||
def mysqltest1 trg2 INSERT def mysqltest1 t1 0 NULL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
|
||||
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
|
||||
|
@ -2061,7 +2061,7 @@ END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci u
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'|
|
||||
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
|
||||
NULL mysqltest2 trg3 INSERT NULL mysqltest2 t1 0 NULL BEGIN
|
||||
def mysqltest2 trg3 INSERT def mysqltest2 t1 0 NULL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10);
|
||||
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
|
||||
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
|
||||
|
@ -2076,7 +2076,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'|
|
||||
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
|
||||
NULL mysqltest2 trg4 INSERT NULL mysqltest2 t1 0 NULL BEGIN
|
||||
def mysqltest2 trg4 INSERT def mysqltest2 t1 0 NULL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
|
||||
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
|
||||
|
@ -2226,7 +2226,7 @@ END|
|
|||
|
||||
SHOW CREATE EVENT ev1|
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10);
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2239,7 +2239,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
|
|||
|
||||
SHOW CREATE EVENT ev2|
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ev2 SYSTEM CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2252,7 +2252,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
|
|||
|
||||
SHOW CREATE EVENT mysqltest2.ev3|
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2265,7 +2265,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
|
|||
|
||||
SHOW CREATE EVENT mysqltest2.ev3|
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2294,7 +2294,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev1'|
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
|
||||
def mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10);
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2307,7 +2307,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'|
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
|
||||
def mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2320,7 +2320,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'|
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
|
||||
def mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2333,7 +2333,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'|
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
|
||||
def mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2361,7 +2361,7 @@ set names koi8r|
|
|||
|
||||
SHOW CREATE EVENT ev1|
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10);
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2374,7 +2374,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
|
|||
|
||||
SHOW CREATE EVENT ev2|
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ev2 SYSTEM CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2387,7 +2387,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
|
|||
|
||||
SHOW CREATE EVENT mysqltest2.ev3|
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2400,7 +2400,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
|
|||
|
||||
SHOW CREATE EVENT mysqltest2.ev3|
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2429,7 +2429,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev1'|
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
|
||||
def mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10);
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2442,7 +2442,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'|
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
|
||||
def mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2455,7 +2455,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'|
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
|
||||
def mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2468,7 +2468,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'|
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
|
||||
def mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2497,7 +2497,7 @@ ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
|
|||
/*!50003 SET sql_mode = '' */ ;;
|
||||
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
|
||||
/*!50003 SET time_zone = 'SYSTEM' */ ;;
|
||||
/*!50106 CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10);
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2525,7 +2525,7 @@ ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
|
|||
/*!50003 SET sql_mode = '' */ ;;
|
||||
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
|
||||
/*!50003 SET time_zone = 'SYSTEM' */ ;;
|
||||
/*!50106 CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2564,7 +2564,7 @@ ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
|
|||
/*!50003 SET sql_mode = '' */ ;;
|
||||
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
|
||||
/*!50003 SET time_zone = 'SYSTEM' */ ;;
|
||||
/*!50106 CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2592,7 +2592,7 @@ ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
|
|||
/*!50003 SET sql_mode = '' */ ;;
|
||||
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
|
||||
/*!50003 SET time_zone = 'SYSTEM' */ ;;
|
||||
/*!50106 CREATE EVENT `ev4` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev4` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2634,7 +2634,7 @@ set names koi8r|
|
|||
|
||||
SHOW CREATE EVENT ev1|
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10);
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2647,7 +2647,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
|
|||
|
||||
SHOW CREATE EVENT ev2|
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ev2 SYSTEM CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2660,7 +2660,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
|
|||
|
||||
SHOW CREATE EVENT mysqltest2.ev3|
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2673,7 +2673,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
|
|||
|
||||
SHOW CREATE EVENT mysqltest2.ev3|
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2702,7 +2702,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev1'|
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
|
||||
def mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10);
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2715,7 +2715,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'|
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
|
||||
def mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2728,7 +2728,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'|
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
|
||||
def mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
@ -2741,7 +2741,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'|
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
|
||||
def mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
|
||||
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(ÐÅÒÅÍ1) AS c1,
|
||||
|
|
|
@ -35,15 +35,15 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'|
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
|
||||
NULL mysqltest1 v1 select 'тест' AS `c1`,`mysqltest1`.`t1`.`кол` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER utf8 utf8_general_ci
|
||||
def mysqltest1 v1 select 'тест' AS `c1`,`mysqltest1`.`t1`.`кол` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER utf8 utf8_general_ci
|
||||
|
||||
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'|
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
|
||||
NULL mysqltest1 v2 select 'тест' AS `c1` NONE NO root@localhost DEFINER utf8 utf8_general_ci
|
||||
def mysqltest1 v2 select 'тест' AS `c1` NONE NO root@localhost DEFINER utf8 utf8_general_ci
|
||||
|
||||
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'|
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
|
||||
NULL mysqltest1 v3 select 'тест' AS `тест` NONE NO root@localhost DEFINER utf8 utf8_general_ci
|
||||
def mysqltest1 v3 select 'тест' AS `тест` NONE NO root@localhost DEFINER utf8 utf8_general_ci
|
||||
|
||||
|
||||
SELECT COLLATION(c1), COLLATION(c2) FROM v1|
|
||||
|
@ -87,15 +87,15 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'|
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
|
||||
NULL mysqltest1 v1 select 'тест' AS `c1`,`mysqltest1`.`t1`.`кол` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER utf8 utf8_general_ci
|
||||
def mysqltest1 v1 select 'тест' AS `c1`,`mysqltest1`.`t1`.`кол` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER utf8 utf8_general_ci
|
||||
|
||||
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'|
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
|
||||
NULL mysqltest1 v2 select 'тест' AS `c1` NONE NO root@localhost DEFINER utf8 utf8_general_ci
|
||||
def mysqltest1 v2 select 'тест' AS `c1` NONE NO root@localhost DEFINER utf8 utf8_general_ci
|
||||
|
||||
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'|
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
|
||||
NULL mysqltest1 v3 select 'тест' AS `тест` NONE NO root@localhost DEFINER utf8 utf8_general_ci
|
||||
def mysqltest1 v3 select 'тест' AS `тест` NONE NO root@localhost DEFINER utf8 utf8_general_ci
|
||||
|
||||
|
||||
SELECT COLLATION(c1), COLLATION(c2) FROM v1|
|
||||
|
@ -144,15 +144,15 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'|
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
|
||||
NULL mysqltest1 v1 select 'тест' AS `c1`,`mysqltest1`.`t1`.`кол` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER utf8 utf8_general_ci
|
||||
def mysqltest1 v1 select 'тест' AS `c1`,`mysqltest1`.`t1`.`кол` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER utf8 utf8_general_ci
|
||||
|
||||
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'|
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
|
||||
NULL mysqltest1 v2 select 'тест' AS `c1` NONE NO root@localhost DEFINER utf8 utf8_general_ci
|
||||
def mysqltest1 v2 select 'тест' AS `c1` NONE NO root@localhost DEFINER utf8 utf8_general_ci
|
||||
|
||||
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'|
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
|
||||
NULL mysqltest1 v3 select 'тест' AS `тест` NONE NO root@localhost DEFINER utf8 utf8_general_ci
|
||||
def mysqltest1 v3 select 'тест' AS `тест` NONE NO root@localhost DEFINER utf8 utf8_general_ci
|
||||
|
||||
|
||||
SELECT COLLATION(c1), COLLATION(c2) FROM v1|
|
||||
|
@ -362,7 +362,7 @@ mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_gener
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'|
|
||||
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
|
||||
p1 NULL mysqltest1 p1 PROCEDURE NULL SQL BEGIN
|
||||
p1 def mysqltest1 p1 PROCEDURE NULL SQL BEGIN
|
||||
DECLARE перем1 CHAR(10);
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -380,7 +380,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'|
|
||||
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
|
||||
p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN
|
||||
p2 def mysqltest1 p2 PROCEDURE NULL SQL BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -398,7 +398,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'|
|
||||
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
|
||||
p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN
|
||||
p3 def mysqltest2 p3 PROCEDURE NULL SQL BEGIN
|
||||
DECLARE перем1 CHAR(10);
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -416,7 +416,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'|
|
||||
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
|
||||
p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN
|
||||
p4 def mysqltest2 p4 PROCEDURE NULL SQL BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -608,7 +608,7 @@ mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_gener
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'|
|
||||
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
|
||||
p1 NULL mysqltest1 p1 PROCEDURE NULL SQL BEGIN
|
||||
p1 def mysqltest1 p1 PROCEDURE NULL SQL BEGIN
|
||||
DECLARE перем1 CHAR(10);
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -626,7 +626,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'|
|
||||
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
|
||||
p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN
|
||||
p2 def mysqltest1 p2 PROCEDURE NULL SQL BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -644,7 +644,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'|
|
||||
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
|
||||
p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN
|
||||
p3 def mysqltest2 p3 PROCEDURE NULL SQL BEGIN
|
||||
DECLARE перем1 CHAR(10);
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -662,7 +662,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'|
|
||||
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
|
||||
p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN
|
||||
p4 def mysqltest2 p4 PROCEDURE NULL SQL BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -1010,7 +1010,7 @@ mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_gener
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'|
|
||||
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
|
||||
p1 NULL mysqltest1 p1 PROCEDURE NULL SQL BEGIN
|
||||
p1 def mysqltest1 p1 PROCEDURE NULL SQL BEGIN
|
||||
DECLARE перем1 CHAR(10);
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -1028,7 +1028,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'|
|
||||
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
|
||||
p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN
|
||||
p2 def mysqltest1 p2 PROCEDURE NULL SQL BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -1046,7 +1046,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'|
|
||||
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
|
||||
p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN
|
||||
p3 def mysqltest2 p3 PROCEDURE NULL SQL BEGIN
|
||||
DECLARE перем1 CHAR(10);
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -1064,7 +1064,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'|
|
||||
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
|
||||
p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN
|
||||
p4 def mysqltest2 p4 PROCEDURE NULL SQL BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -1323,7 +1323,7 @@ use mysqltest1|
|
|||
|
||||
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 CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest1 trg1 INSERT NULL mysqltest1 t1 0 NULL BEGIN
|
||||
def mysqltest1 trg1 INSERT def mysqltest1 t1 0 NULL BEGIN
|
||||
DECLARE перем1 CHAR(10);
|
||||
INSERT INTO log VALUES(COLLATION(перем1));
|
||||
INSERT INTO log VALUES(COLLATION('текст'));
|
||||
|
@ -1338,7 +1338,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci ut
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'|
|
||||
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
|
||||
NULL mysqltest1 trg2 INSERT NULL mysqltest1 t1 0 NULL BEGIN
|
||||
def mysqltest1 trg2 INSERT def mysqltest1 t1 0 NULL BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
INSERT INTO log VALUES(COLLATION(перем1));
|
||||
INSERT INTO log VALUES(COLLATION('текст'));
|
||||
|
@ -1353,7 +1353,7 @@ END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'|
|
||||
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
|
||||
NULL mysqltest2 trg3 INSERT NULL mysqltest2 t1 0 NULL BEGIN
|
||||
def mysqltest2 trg3 INSERT def mysqltest2 t1 0 NULL BEGIN
|
||||
DECLARE перем1 CHAR(10);
|
||||
INSERT INTO log VALUES(COLLATION(перем1));
|
||||
INSERT INTO log VALUES(COLLATION('текст'));
|
||||
|
@ -1368,7 +1368,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci ut
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'|
|
||||
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
|
||||
NULL mysqltest2 trg4 INSERT NULL mysqltest2 t1 0 NULL BEGIN
|
||||
def mysqltest2 trg4 INSERT def mysqltest2 t1 0 NULL BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
INSERT INTO log VALUES(COLLATION(перем1));
|
||||
INSERT INTO log VALUES(COLLATION('текст'));
|
||||
|
@ -1596,7 +1596,7 @@ use mysqltest1|
|
|||
|
||||
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 CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest1 trg1 INSERT NULL mysqltest1 t1 0 NULL BEGIN
|
||||
def mysqltest1 trg1 INSERT def mysqltest1 t1 0 NULL BEGIN
|
||||
DECLARE перем1 CHAR(10);
|
||||
INSERT INTO log VALUES(COLLATION(перем1));
|
||||
INSERT INTO log VALUES(COLLATION('текст'));
|
||||
|
@ -1611,7 +1611,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci ut
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'|
|
||||
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
|
||||
NULL mysqltest1 trg2 INSERT NULL mysqltest1 t1 0 NULL BEGIN
|
||||
def mysqltest1 trg2 INSERT def mysqltest1 t1 0 NULL BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
INSERT INTO log VALUES(COLLATION(перем1));
|
||||
INSERT INTO log VALUES(COLLATION('текст'));
|
||||
|
@ -1626,7 +1626,7 @@ END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'|
|
||||
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
|
||||
NULL mysqltest2 trg3 INSERT NULL mysqltest2 t1 0 NULL BEGIN
|
||||
def mysqltest2 trg3 INSERT def mysqltest2 t1 0 NULL BEGIN
|
||||
DECLARE перем1 CHAR(10);
|
||||
INSERT INTO log VALUES(COLLATION(перем1));
|
||||
INSERT INTO log VALUES(COLLATION('текст'));
|
||||
|
@ -1641,7 +1641,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci ut
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'|
|
||||
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
|
||||
NULL mysqltest2 trg4 INSERT NULL mysqltest2 t1 0 NULL BEGIN
|
||||
def mysqltest2 trg4 INSERT def mysqltest2 t1 0 NULL BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
INSERT INTO log VALUES(COLLATION(перем1));
|
||||
INSERT INTO log VALUES(COLLATION('текст'));
|
||||
|
@ -2031,7 +2031,7 @@ use mysqltest1|
|
|||
|
||||
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 CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest1 trg1 INSERT NULL mysqltest1 t1 0 NULL BEGIN
|
||||
def mysqltest1 trg1 INSERT def mysqltest1 t1 0 NULL BEGIN
|
||||
DECLARE перем1 CHAR(10);
|
||||
INSERT INTO log VALUES(COLLATION(перем1));
|
||||
INSERT INTO log VALUES(COLLATION('текст'));
|
||||
|
@ -2046,7 +2046,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci ut
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'|
|
||||
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
|
||||
NULL mysqltest1 trg2 INSERT NULL mysqltest1 t1 0 NULL BEGIN
|
||||
def mysqltest1 trg2 INSERT def mysqltest1 t1 0 NULL BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
INSERT INTO log VALUES(COLLATION(перем1));
|
||||
INSERT INTO log VALUES(COLLATION('текст'));
|
||||
|
@ -2061,7 +2061,7 @@ END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'|
|
||||
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
|
||||
NULL mysqltest2 trg3 INSERT NULL mysqltest2 t1 0 NULL BEGIN
|
||||
def mysqltest2 trg3 INSERT def mysqltest2 t1 0 NULL BEGIN
|
||||
DECLARE перем1 CHAR(10);
|
||||
INSERT INTO log VALUES(COLLATION(перем1));
|
||||
INSERT INTO log VALUES(COLLATION('текст'));
|
||||
|
@ -2076,7 +2076,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci ut
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'|
|
||||
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
|
||||
NULL mysqltest2 trg4 INSERT NULL mysqltest2 t1 0 NULL BEGIN
|
||||
def mysqltest2 trg4 INSERT def mysqltest2 t1 0 NULL BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
INSERT INTO log VALUES(COLLATION(перем1));
|
||||
INSERT INTO log VALUES(COLLATION('текст'));
|
||||
|
@ -2226,7 +2226,7 @@ END|
|
|||
|
||||
SHOW CREATE EVENT ev1|
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE перем1 CHAR(10);
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2239,7 +2239,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
|
|||
|
||||
SHOW CREATE EVENT ev2|
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ev2 SYSTEM CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2252,7 +2252,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
|
|||
|
||||
SHOW CREATE EVENT mysqltest2.ev3|
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2265,7 +2265,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
|
|||
|
||||
SHOW CREATE EVENT mysqltest2.ev3|
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2294,7 +2294,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev1'|
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
|
||||
def mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
|
||||
DECLARE перем1 CHAR(10);
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2307,7 +2307,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'|
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
|
||||
def mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2320,7 +2320,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'|
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
|
||||
def mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2333,7 +2333,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'|
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
|
||||
def mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2361,7 +2361,7 @@ set names utf8|
|
|||
|
||||
SHOW CREATE EVENT ev1|
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE перем1 CHAR(10);
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2374,7 +2374,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
|
|||
|
||||
SHOW CREATE EVENT ev2|
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ev2 SYSTEM CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2387,7 +2387,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
|
|||
|
||||
SHOW CREATE EVENT mysqltest2.ev3|
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2400,7 +2400,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
|
|||
|
||||
SHOW CREATE EVENT mysqltest2.ev3|
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2429,7 +2429,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev1'|
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
|
||||
def mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
|
||||
DECLARE перем1 CHAR(10);
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2442,7 +2442,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'|
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
|
||||
def mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2455,7 +2455,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'|
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
|
||||
def mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2468,7 +2468,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'|
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
|
||||
def mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2497,7 +2497,7 @@ ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
|
|||
/*!50003 SET sql_mode = '' */ ;;
|
||||
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
|
||||
/*!50003 SET time_zone = 'SYSTEM' */ ;;
|
||||
/*!50106 CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE перем1 CHAR(10);
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2525,7 +2525,7 @@ ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
|
|||
/*!50003 SET sql_mode = '' */ ;;
|
||||
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
|
||||
/*!50003 SET time_zone = 'SYSTEM' */ ;;
|
||||
/*!50106 CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2564,7 +2564,7 @@ ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
|
|||
/*!50003 SET sql_mode = '' */ ;;
|
||||
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
|
||||
/*!50003 SET time_zone = 'SYSTEM' */ ;;
|
||||
/*!50106 CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2592,7 +2592,7 @@ ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
|
|||
/*!50003 SET sql_mode = '' */ ;;
|
||||
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
|
||||
/*!50003 SET time_zone = 'SYSTEM' */ ;;
|
||||
/*!50106 CREATE EVENT `ev4` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev4` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2634,7 +2634,7 @@ set names utf8|
|
|||
|
||||
SHOW CREATE EVENT ev1|
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE перем1 CHAR(10);
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2647,7 +2647,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
|
|||
|
||||
SHOW CREATE EVENT ev2|
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ev2 SYSTEM CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2660,7 +2660,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
|
|||
|
||||
SHOW CREATE EVENT mysqltest2.ev3|
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2673,7 +2673,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
|
|||
|
||||
SHOW CREATE EVENT mysqltest2.ev3|
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2702,7 +2702,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev1'|
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
|
||||
def mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
|
||||
DECLARE перем1 CHAR(10);
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2715,7 +2715,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'|
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
|
||||
def mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2728,7 +2728,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'|
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
|
||||
def mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
@ -2741,7 +2741,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
|
|||
|
||||
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'|
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
|
||||
def mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
|
||||
DECLARE перем1 CHAR(10) CHARACTER SET utf8;
|
||||
SELECT
|
||||
COLLATION(перем1) AS c1,
|
||||
|
|
|
@ -252,7 +252,7 @@ HEX(a)
|
|||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a INT);
|
||||
INSERT DELAYED INTO t1 SET b= b();
|
||||
ERROR 42S22: Unknown column 'b' in 'field list'
|
||||
ERROR 42000: FUNCTION test.b does not exist
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
DROP TABLE IF EXISTS t1,t2;
|
||||
|
@ -311,3 +311,25 @@ a b
|
|||
drop table t1;
|
||||
set global low_priority_updates = @old_delayed_updates;
|
||||
End of 5.1 tests
|
||||
#
|
||||
# Bug #47274 assert in open_table on CREATE TABLE <already existing>
|
||||
#
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t2;
|
||||
CREATE TABLE t1 ( f1 INTEGER AUTO_INCREMENT, PRIMARY KEY (f1));
|
||||
# The following CREATE TABLEs before gave an assert.
|
||||
INSERT DELAYED t1 VALUES (4);
|
||||
CREATE TABLE t1 AS SELECT 1 AS f1;
|
||||
ERROR 42S01: Table 't1' already exists
|
||||
REPLACE DELAYED t1 VALUES (5);
|
||||
CREATE TABLE t1 AS SELECT 1 AS f1;
|
||||
ERROR 42S01: Table 't1' already exists
|
||||
INSERT DELAYED t1 VALUES (6);
|
||||
CREATE TABLE t1 (f1 INTEGER);
|
||||
ERROR 42S01: Table 't1' already exists
|
||||
CREATE TABLE t2 (f1 INTEGER);
|
||||
INSERT DELAYED t1 VALUES (7);
|
||||
CREATE TABLE t1 LIKE t2;
|
||||
ERROR 42S01: Table 't1' already exists
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
|
|
28
mysql-test/r/drop-no_root.result
Normal file
28
mysql-test/r/drop-no_root.result
Normal file
|
@ -0,0 +1,28 @@
|
|||
|
||||
# --
|
||||
# -- Bug#26704: Failing DROP DATABASE brings mysql-client out of sync.
|
||||
# --
|
||||
|
||||
DROP DATABASE IF EXISTS mysql_test;
|
||||
|
||||
CREATE DATABASE mysql_test;
|
||||
CREATE TABLE mysql_test.t1(c INT);
|
||||
use mysql_test;
|
||||
|
||||
chmod 000 mysql_test/t1.frm
|
||||
|
||||
DROP DATABASE mysql_test;
|
||||
|
||||
SELECT DATABASE();
|
||||
DATABASE()
|
||||
mysql_test
|
||||
|
||||
rm -f mysql_test/t1.MYD mysql_test/t1.MYI
|
||||
chmod 666 mysql_test/t1.frm
|
||||
rm -f mysql_test/t1.frm
|
||||
|
||||
DROP DATABASE mysql_test;
|
||||
|
||||
use test;
|
||||
|
||||
# -- End of Bug#26704.
|
|
@ -121,3 +121,17 @@ ERROR 42000: Incorrect table name '#mysql50#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|||
use test;
|
||||
drop database mysqltestbug26703;
|
||||
End of 5.1 tests
|
||||
|
||||
# --
|
||||
# -- Bug#37431 (DROP TABLE does not report errors correctly).
|
||||
# --
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE t1;
|
||||
ERROR 42S02: Unknown table 't1'
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Error 1051 Unknown table 't1'
|
||||
|
||||
# --
|
||||
# -- End of Bug#37431.
|
||||
# --
|
||||
|
|
21
mysql-test/r/drop_debug.result
Normal file
21
mysql-test/r/drop_debug.result
Normal file
|
@ -0,0 +1,21 @@
|
|||
|
||||
# --
|
||||
# -- Bug#43138: DROP DATABASE failure does not clean up message list.
|
||||
# --
|
||||
|
||||
DROP DATABASE IF EXISTS mysql_test;
|
||||
|
||||
CREATE DATABASE mysql_test;
|
||||
CREATE TABLE mysql_test.t1(a INT);
|
||||
|
||||
SET SESSION DEBUG = "+d,bug43138";
|
||||
|
||||
DROP DATABASE mysql_test;
|
||||
Warnings:
|
||||
Error 1051 Unknown table 't1'
|
||||
|
||||
SET SESSION DEBUG = "-d,bug43138";
|
||||
|
||||
# --
|
||||
# -- End of Bug#43138.
|
||||
# --
|
|
@ -123,80 +123,80 @@ set names utf8;
|
|||
CREATE EVENT root6 ON SCHEDULE EVERY '10:20' MINUTE_SECOND ON COMPLETION PRESERVE ENABLE COMMENT 'some comment' DO select 1;
|
||||
SHOW CREATE EVENT root6;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
root6 SYSTEM CREATE EVENT `root6` ON SCHEDULE EVERY '10:20' MINUTE_SECOND STARTS '#' ON COMPLETION PRESERVE ENABLE COMMENT 'some comment' DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
root6 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root6` ON SCHEDULE EVERY '10:20' MINUTE_SECOND STARTS '#' ON COMPLETION PRESERVE ENABLE COMMENT 'some comment' DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
create event root7 on schedule every 2 year do select 1;
|
||||
SHOW CREATE EVENT root7;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
root7 SYSTEM CREATE EVENT `root7` ON SCHEDULE EVERY 2 YEAR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
root7 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root7` ON SCHEDULE EVERY 2 YEAR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
create event root8 on schedule every '2:5' year_month do select 1;
|
||||
SHOW CREATE EVENT root8;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
root8 SYSTEM CREATE EVENT `root8` ON SCHEDULE EVERY '2-5' YEAR_MONTH STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
root8 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root8` ON SCHEDULE EVERY '2-5' YEAR_MONTH STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
create event root8_1 on schedule every '2:15' year_month do select 1;
|
||||
SHOW CREATE EVENT root8_1;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
root8_1 SYSTEM CREATE EVENT `root8_1` ON SCHEDULE EVERY '3-3' YEAR_MONTH STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
root8_1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root8_1` ON SCHEDULE EVERY '3-3' YEAR_MONTH STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
create event root9 on schedule every 2 week ON COMPLETION PRESERVE DISABLE COMMENT 'коментар на кирилица' do select 1;
|
||||
SHOW CREATE EVENT root9;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
root9 SYSTEM CREATE EVENT `root9` ON SCHEDULE EVERY 2 WEEK STARTS '#' ON COMPLETION PRESERVE DISABLE COMMENT 'коментар на кирилица' DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
root9 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root9` ON SCHEDULE EVERY 2 WEEK STARTS '#' ON COMPLETION PRESERVE DISABLE COMMENT 'коментар на кирилица' DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
create event root10 on schedule every '20:5' day_hour do select 1;
|
||||
SHOW CREATE EVENT root10;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
root10 SYSTEM CREATE EVENT `root10` ON SCHEDULE EVERY '20 5' DAY_HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
root10 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root10` ON SCHEDULE EVERY '20 5' DAY_HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
create event root11 on schedule every '20:25' day_hour do select 1;
|
||||
SHOW CREATE EVENT root11;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
root11 SYSTEM CREATE EVENT `root11` ON SCHEDULE EVERY '21 1' DAY_HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
root11 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root11` ON SCHEDULE EVERY '21 1' DAY_HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
create event root12 on schedule every '20:25' hour_minute do select 1;
|
||||
SHOW CREATE EVENT root12;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
root12 SYSTEM CREATE EVENT `root12` ON SCHEDULE EVERY '20:25' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
root12 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root12` ON SCHEDULE EVERY '20:25' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
create event root13 on schedule every '25:25' hour_minute do select 1;
|
||||
SHOW CREATE EVENT root13;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
root13 SYSTEM CREATE EVENT `root13` ON SCHEDULE EVERY '25:25' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
root13 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root13` ON SCHEDULE EVERY '25:25' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
create event root13_1 on schedule every '11:65' hour_minute do select 1;
|
||||
SHOW CREATE EVENT root13_1;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
root13_1 SYSTEM CREATE EVENT `root13_1` ON SCHEDULE EVERY '12:5' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
root13_1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root13_1` ON SCHEDULE EVERY '12:5' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
create event root14 on schedule every '35:35' minute_second do select 1;
|
||||
SHOW CREATE EVENT root14;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
root14 SYSTEM CREATE EVENT `root14` ON SCHEDULE EVERY '35:35' MINUTE_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
root14 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root14` ON SCHEDULE EVERY '35:35' MINUTE_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
create event root15 on schedule every '35:66' minute_second do select 1;
|
||||
SHOW CREATE EVENT root15;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
root15 SYSTEM CREATE EVENT `root15` ON SCHEDULE EVERY '36:6' MINUTE_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
root15 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root15` ON SCHEDULE EVERY '36:6' MINUTE_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
create event root16 on schedule every '35:56' day_minute do select 1;
|
||||
SHOW CREATE EVENT root16;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
root16 SYSTEM CREATE EVENT `root16` ON SCHEDULE EVERY '1 11:56' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
root16 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root16` ON SCHEDULE EVERY '1 11:56' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
create event root17 on schedule every '35:12:45' day_minute do select 1;
|
||||
SHOW CREATE EVENT root17;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
root17 SYSTEM CREATE EVENT `root17` ON SCHEDULE EVERY '35 12:45' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
root17 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root17` ON SCHEDULE EVERY '35 12:45' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
create event root17_1 on schedule every '35:25:65' day_minute do select 1;
|
||||
SHOW CREATE EVENT root17_1;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
root17_1 SYSTEM CREATE EVENT `root17_1` ON SCHEDULE EVERY '36 2:5' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
root17_1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root17_1` ON SCHEDULE EVERY '36 2:5' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
create event root18 on schedule every '35:12:45' hour_second do select 1;
|
||||
SHOW CREATE EVENT root18;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
root18 SYSTEM CREATE EVENT `root18` ON SCHEDULE EVERY '35:12:45' HOUR_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
root18 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root18` ON SCHEDULE EVERY '35:12:45' HOUR_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
create event root19 on schedule every '15:59:85' hour_second do select 1;
|
||||
SHOW CREATE EVENT root19;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
root19 SYSTEM CREATE EVENT `root19` ON SCHEDULE EVERY '16:0:25' HOUR_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
root19 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root19` ON SCHEDULE EVERY '16:0:25' HOUR_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
create event root20 on schedule every '50:20:12:45' day_second do select 1;
|
||||
SHOW CREATE EVENT root20;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
root20 SYSTEM CREATE EVENT `root20` ON SCHEDULE EVERY '50 20:12:45' DAY_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
root20 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root20` ON SCHEDULE EVERY '50 20:12:45' DAY_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
set names cp1251;
|
||||
create event ðóóò21 on schedule every '50:23:59:95' day_second COMMENT 'òîâà å 1251 êîìåíòàð' do select 1;
|
||||
SHOW CREATE EVENT ðóóò21;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ðóóò21 SYSTEM CREATE EVENT `руут21` ON SCHEDULE EVERY '51 0:0:35' DAY_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE COMMENT 'това е 1251 коментар' DO select 1 cp1251 cp1251_general_ci latin1_swedish_ci
|
||||
ðóóò21 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `руут21` ON SCHEDULE EVERY '51 0:0:35' DAY_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE COMMENT 'това е 1251 коментар' DO select 1 cp1251 cp1251_general_ci latin1_swedish_ci
|
||||
insert into mysql.event (
|
||||
db,
|
||||
name,
|
||||
|
@ -271,7 +271,7 @@ event_name
|
|||
intact_check
|
||||
SHOW CREATE EVENT intact_check;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
intact_check SYSTEM CREATE EVENT `intact_check` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO SELECT "nothing" latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
intact_check SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `intact_check` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO SELECT "nothing" latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
DROP EVENT no_such_event;
|
||||
ERROR HY000: Unknown event 'no_such_event'
|
||||
CREATE EVENT intact_check_1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5;
|
||||
|
|
|
@ -134,7 +134,7 @@ create event e1 on schedule every 10 hour do select 1;
|
|||
lock table t1 read;
|
||||
show create event e1;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
e1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
select event_name from information_schema.events;
|
||||
event_name
|
||||
e1
|
||||
|
@ -152,7 +152,7 @@ unlock tables;
|
|||
lock table t1 write;
|
||||
show create event e1;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
e1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
select event_name from information_schema.events;
|
||||
event_name
|
||||
e1
|
||||
|
@ -170,7 +170,7 @@ unlock tables;
|
|||
lock table t1 read, mysql.event read;
|
||||
show create event e1;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
e1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
select event_name from information_schema.events;
|
||||
event_name
|
||||
e1
|
||||
|
@ -188,7 +188,7 @@ unlock tables;
|
|||
lock table t1 write, mysql.event read;
|
||||
show create event e1;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
e1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
select event_name from information_schema.events;
|
||||
event_name
|
||||
e1
|
||||
|
@ -210,7 +210,7 @@ ERROR HY000: You can't combine write-locking of system tables with other tables
|
|||
lock table mysql.event write;
|
||||
show create event e1;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
e1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
|
||||
select event_name from information_schema.events;
|
||||
event_name
|
||||
e1
|
||||
|
|
|
@ -77,7 +77,7 @@ set sql_mode='traditional';
|
|||
alter event e_16407 do select 1;
|
||||
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
|
||||
event_schema event_name sql_mode
|
||||
events_test e_16407 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
|
||||
events_test e_16407 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
|
||||
drop event e_16407;
|
||||
set sql_mode="ansi";
|
||||
select get_lock('ee_16407_2', 60);
|
||||
|
@ -114,8 +114,8 @@ insert into events_test.events_smode_test values ('ee_16407_4','10-11-1956');
|
|||
end|
|
||||
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
|
||||
event_schema event_name sql_mode
|
||||
events_test ee_16407_2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
|
||||
events_test ee_16407_3 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
|
||||
events_test ee_16407_2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
|
||||
events_test ee_16407_3 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
|
||||
events_test ee_16407_4
|
||||
select /*2*/ user, host, db, info from information_schema.processlist
|
||||
where state = 'User lock' and info = 'select get_lock(\'ee_16407_2\', 60)';
|
||||
|
@ -138,8 +138,8 @@ ee_16407_4 0000-00-00
|
|||
"OK, last check before we drop them"
|
||||
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
|
||||
event_schema event_name sql_mode
|
||||
events_test ee_16407_2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
|
||||
events_test ee_16407_3 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
|
||||
events_test ee_16407_2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
|
||||
events_test ee_16407_3 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
|
||||
events_test ee_16407_4
|
||||
drop event ee_16407_2;
|
||||
drop event ee_16407_3;
|
||||
|
@ -185,8 +185,8 @@ ee_16407_6 2004-02-29
|
|||
"And here we check one more time before we drop the events"
|
||||
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
|
||||
event_schema event_name sql_mode
|
||||
events_test ee_16407_5 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
|
||||
events_test ee_16407_6 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
|
||||
events_test ee_16407_5 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
|
||||
events_test ee_16407_6 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
|
||||
drop event ee_16407_5;
|
||||
drop event ee_16407_6;
|
||||
drop procedure ee_16407_5_pendant;
|
||||
|
@ -434,9 +434,9 @@ CREATE EVENT e3 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO
|
|||
SELECT 1;
|
||||
SELECT * FROM INFORMATION_SCHEMA.EVENTS ORDER BY event_name;
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
|
||||
NULL events_test e1 root@localhost +05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:58:59 2005-12-31 23:58:59 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
NULL events_test e2 root@localhost -05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:00 2005-12-31 23:59:00 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
NULL events_test e3 root@localhost +00:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:01 2005-12-31 23:59:01 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
def events_test e1 root@localhost +05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:58:59 2005-12-31 23:58:59 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
def events_test e2 root@localhost -05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:00 2005-12-31 23:59:00 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
def events_test e3 root@localhost +00:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:01 2005-12-31 23:59:01 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
SHOW EVENTS;
|
||||
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
|
||||
events_test e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
|
@ -444,13 +444,13 @@ events_test e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NU
|
|||
events_test e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
SHOW CREATE EVENT e1;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
e1 +05:00 CREATE EVENT `e1` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
e1 +05:00 CREATE DEFINER=`root`@`localhost` EVENT `e1` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
SHOW CREATE EVENT e2;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
e2 -05:00 CREATE EVENT `e2` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
e2 -05:00 CREATE DEFINER=`root`@`localhost` EVENT `e2` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
SHOW CREATE EVENT e3;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
e3 +00:00 CREATE EVENT `e3` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
e3 +00:00 CREATE DEFINER=`root`@`localhost` EVENT `e3` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
The following should fail, and nothing should be altered.
|
||||
ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'
|
||||
ENDS '1999-01-02 00:00:00';
|
||||
|
|
|
@ -6,7 +6,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
|
|||
events_test one_event root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
|
||||
NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
|
||||
def events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
|
||||
CREATE DATABASE events_test2;
|
||||
CREATE USER ev_test@localhost;
|
||||
GRANT ALL ON events_test.* to ev_test@localhost;
|
||||
|
@ -59,53 +59,53 @@ USE events_test;
|
|||
"We should see 4 events : one_event, two_event, three_event & four_event"
|
||||
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
|
||||
NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
|
||||
NULL events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
|
||||
NULL events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
|
||||
NULL events_test2 four_event ev_test@localhost SQL SELECT 42 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE
|
||||
def events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
|
||||
def events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
|
||||
def events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
|
||||
def events_test2 four_event ev_test@localhost SQL SELECT 42 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE
|
||||
DROP DATABASE events_test2;
|
||||
"We should see 3 events : one_event, two_event, three_event"
|
||||
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
|
||||
NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
|
||||
NULL events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
|
||||
NULL events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
|
||||
def events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
|
||||
def events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
|
||||
def events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
|
||||
CREATE DATABASE events_test2;
|
||||
USE events_test2;
|
||||
CREATE EVENT five_event ON SCHEDULE EVERY 20 SECOND DO SELECT 42;
|
||||
"Should see 4 events - one, two, three & five"
|
||||
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
|
||||
NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
|
||||
NULL events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
|
||||
NULL events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
|
||||
NULL events_test2 five_event root@localhost SQL SELECT 42 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE
|
||||
def events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
|
||||
def events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
|
||||
def events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
|
||||
def events_test2 five_event root@localhost SQL SELECT 42 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE
|
||||
REVOKE EVENT ON events_test2.* FROM ev_test@localhost;
|
||||
USE test;
|
||||
"Should see 3 events - one, two & three"
|
||||
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
|
||||
NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
|
||||
NULL events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
|
||||
NULL events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
|
||||
def events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
|
||||
def events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
|
||||
def events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
|
||||
"Let's test ALTER EVENT which changes the definer"
|
||||
USE events_test;
|
||||
ALTER EVENT one_event ON SCHEDULE EVERY 10 SECOND;
|
||||
"The definer should be ev_test@localhost"
|
||||
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
|
||||
NULL events_test one_event ev_test@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
|
||||
def events_test one_event ev_test@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
|
||||
USE events_test;
|
||||
ALTER EVENT one_event COMMENT "comment";
|
||||
"The definer should be root@localhost"
|
||||
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
|
||||
NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE comment
|
||||
def events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE comment
|
||||
ALTER EVENT one_event DO SELECT 12;
|
||||
"The definer should be ev_test@localhost"
|
||||
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
|
||||
NULL events_test one_event ev_test@localhost SQL SELECT 12 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE comment
|
||||
def events_test one_event ev_test@localhost SQL SELECT 12 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE comment
|
||||
"make the definer again root@localhost"
|
||||
ALTER EVENT one_event COMMENT "new comment";
|
||||
"test DROP by another user"
|
||||
|
@ -113,9 +113,9 @@ DROP EVENT one_event;
|
|||
"One event should not be there"
|
||||
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
|
||||
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
|
||||
NULL events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
|
||||
NULL events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
|
||||
NULL events_test2 five_event root@localhost SQL SELECT 42 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE
|
||||
def events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
|
||||
def events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
|
||||
def events_test2 five_event root@localhost SQL SELECT 42 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE
|
||||
DROP USER ev_test@localhost;
|
||||
DROP DATABASE events_test2;
|
||||
DROP DATABASE events_test;
|
||||
|
|
|
@ -64,7 +64,7 @@ explain extended select * from v1 where f2=1;
|
|||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
|
||||
Warnings:
|
||||
Note 1003 select '1' AS `f1`,'1' AS `f2` from `test`.`t1` where 1
|
||||
Note 1003 select '1' AS `f1`,'1' AS `f2` from dual where 1
|
||||
explain extended select * from t1 where 0;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
|
||||
|
@ -74,7 +74,7 @@ explain extended select * from t1 where 1;
|
|||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
|
||||
Warnings:
|
||||
Note 1003 select '1' AS `f1`,'1' AS `f2` from `test`.`t1` where 1
|
||||
Note 1003 select '1' AS `f1`,'1' AS `f2` from dual where 1
|
||||
explain extended select * from t1 having 0;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible HAVING
|
||||
|
@ -84,7 +84,7 @@ explain extended select * from t1 having 1;
|
|||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
|
||||
Warnings:
|
||||
Note 1003 select '1' AS `f1`,'1' AS `f2` from `test`.`t1` having 1
|
||||
Note 1003 select '1' AS `f1`,'1' AS `f2` from dual having 1
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
CREATE TABLE t1(c INT);
|
||||
|
@ -194,4 +194,24 @@ dt
|
|||
2001-01-01 01:01:01
|
||||
2001-01-01 01:01:01
|
||||
drop tables t1, t2;
|
||||
#
|
||||
# Bug#30302: Tables that were optimized away are printed in the
|
||||
# EXPLAIN EXTENDED warning.
|
||||
#
|
||||
create table t1(f1 int);
|
||||
create table t2(f2 int);
|
||||
insert into t1 values(1);
|
||||
insert into t2 values(1),(2);
|
||||
explain extended select * from t1 where f1=1;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
|
||||
Warnings:
|
||||
Note 1003 select '1' AS `f1` from dual where 1
|
||||
explain extended select * from t1 join t2 on f1=f2 where f1=1;
|
||||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
|
||||
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 select '1' AS `f1`,`test`.`t2`.`f2` AS `f2` from `test`.`t2` where (`test`.`t2`.`f2` = 1)
|
||||
drop table t1,t2;
|
||||
End of 5.1 tests.
|
||||
|
|
|
@ -494,6 +494,14 @@ SELECT a FROM t1 WHERE MATCH a AGAINST ('+city* of*' IN BOOLEAN MODE);
|
|||
a
|
||||
City Of God
|
||||
DROP TABLE t1;
|
||||
create table t1(a text,b date,fulltext index(a))engine=myisam;
|
||||
insert into t1 set a='water',b='2008-08-04';
|
||||
select 1 from t1 where match(a) against ('water' in boolean mode) and b>='2008-08-01';
|
||||
1
|
||||
1
|
||||
drop table t1;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
CREATE TABLE t1 (a VARCHAR(255), b INT, FULLTEXT(a), KEY(b));
|
||||
INSERT INTO t1 VALUES('test', 1),('test', 1),('test', 1),('test', 1),
|
||||
('test', 1),('test', 2),('test', 3),('test', 4);
|
||||
|
|
|
@ -8,7 +8,7 @@ explain extended select default(str), default(strnull), default(intg), default(r
|
|||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
|
||||
Warnings:
|
||||
Note 1003 select default('') AS `default(str)`,default('') AS `default(strnull)`,default('0') AS `default(intg)`,default('0') AS `default(rel)` from `test`.`t1`
|
||||
Note 1003 select default('') AS `default(str)`,default('') AS `default(strnull)`,default('0') AS `default(intg)`,default('0') AS `default(rel)` from dual
|
||||
select * from t1 where str <> default(str);
|
||||
str strnull intg rel
|
||||
0 0
|
||||
|
|
|
@ -382,6 +382,9 @@ y
|
|||
SELECT b DIV 900 y FROM t1 GROUP BY y;
|
||||
y
|
||||
0
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect INTEGER value: 'str1'
|
||||
Warning 1292 Truncated incorrect INTEGER value: 'str2'
|
||||
SELECT c DIV 900 y FROM t1 GROUP BY y;
|
||||
y
|
||||
0
|
||||
|
|
|
@ -52,7 +52,7 @@ explain extended select * from t1 where xxx regexp('is a test of some long text
|
|||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
|
||||
Warnings:
|
||||
Note 1003 select 'this is a test of some long text to see what happens' AS `xxx` from `test`.`t1` where ('this is a test of some long text to see what happens' regexp 'is a test of some long text to')
|
||||
Note 1003 select 'this is a test of some long text to see what happens' AS `xxx` from dual where ('this is a test of some long text to see what happens' regexp 'is a test of some long text to')
|
||||
select * from t1 where xxx regexp('is a test of some long text to ');
|
||||
xxx
|
||||
this is a test of some long text to see what happens
|
||||
|
|
|
@ -194,7 +194,7 @@ date("1997-12-31 23:59:59.000001") as f8,
|
|||
time("1997-12-31 23:59:59.000001") as f9;
|
||||
describe t1;
|
||||
Field Type Null Key Default Extra
|
||||
f1 date NO 0000-00-00
|
||||
f1 date YES NULL
|
||||
f2 datetime YES NULL
|
||||
f3 time YES NULL
|
||||
f4 time YES NULL
|
||||
|
|
|
@ -1151,6 +1151,9 @@ INSERT INTO t2 VALUES (0), (1);
|
|||
SELECT * FROM t1, t2 WHERE num=str;
|
||||
str num
|
||||
notnumber 0
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'notnumber'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'notnumber'
|
||||
SELECT * FROM t1, t2 WHERE num=substring(str from 1 for 6);
|
||||
str num
|
||||
notnumber 0
|
||||
|
|
|
@ -87,7 +87,7 @@ explain extended select - a from t1;
|
|||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
|
||||
Warnings:
|
||||
Note 1003 select -('1') AS `- a` from `test`.`t1`
|
||||
Note 1003 select -('1') AS `- a` from dual
|
||||
drop table t1;
|
||||
select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1;
|
||||
5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1
|
||||
|
|
|
@ -814,7 +814,7 @@ create table t1 select last_day('2000-02-05') as a,
|
|||
from_days(to_days("960101")) as b;
|
||||
describe t1;
|
||||
Field Type Null Key Default Extra
|
||||
a date NO 0000-00-00
|
||||
a date YES NULL
|
||||
b date YES NULL
|
||||
select * from t1;
|
||||
a b
|
||||
|
|
|
@ -13,8 +13,8 @@ GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3
|
|||
GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
|
||||
grant delete on mysqltest.* to mysqltest_1@localhost;
|
||||
select * from mysql.user where user="mysqltest_1";
|
||||
Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
|
||||
localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N SPECIFIED EDH-RSA-DES-CBC3-SHA 0 0 0 0
|
||||
Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
|
||||
localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N SPECIFIED EDH-RSA-DES-CBC3-SHA 0 0 0 0
|
||||
show grants for mysqltest_1@localhost;
|
||||
Grants for mysqltest_1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA'
|
||||
|
@ -44,15 +44,15 @@ delete from mysql.user where user='mysqltest_1';
|
|||
flush privileges;
|
||||
grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 10;
|
||||
select * from mysql.user where user="mysqltest_1";
|
||||
Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
|
||||
localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N 10 0 0 0
|
||||
Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
|
||||
localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 10 0 0 0
|
||||
show grants for mysqltest_1@localhost;
|
||||
Grants for mysqltest_1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10
|
||||
grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 20 max_connections_per_hour 30;
|
||||
select * from mysql.user where user="mysqltest_1";
|
||||
Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
|
||||
localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N 10 20 30 0
|
||||
Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
|
||||
localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 10 20 30 0
|
||||
show grants for mysqltest_1@localhost;
|
||||
Grants for mysqltest_1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30
|
||||
|
@ -387,10 +387,10 @@ SELECT * FROM INFORMATION_SCHEMA.COLUMN_PRIVILEGES
|
|||
WHERE GRANTEE = '''mysqltest_3''@''localhost'''
|
||||
ORDER BY TABLE_NAME,COLUMN_NAME,PRIVILEGE_TYPE;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'mysqltest_3'@'localhost' NULL mysqltest_1 t1 a UPDATE NO
|
||||
'mysqltest_3'@'localhost' NULL mysqltest_2 t1 c SELECT NO
|
||||
'mysqltest_3'@'localhost' NULL mysqltest_1 t2 b SELECT NO
|
||||
'mysqltest_3'@'localhost' NULL mysqltest_2 t2 d UPDATE NO
|
||||
'mysqltest_3'@'localhost' def mysqltest_1 t1 a UPDATE NO
|
||||
'mysqltest_3'@'localhost' def mysqltest_2 t1 c SELECT NO
|
||||
'mysqltest_3'@'localhost' def mysqltest_1 t2 b SELECT NO
|
||||
'mysqltest_3'@'localhost' def mysqltest_2 t2 d UPDATE NO
|
||||
SELECT * FROM INFORMATION_SCHEMA.TABLE_PRIVILEGES
|
||||
WHERE GRANTEE = '''mysqltest_3''@''localhost'''
|
||||
ORDER BY TABLE_NAME,PRIVILEGE_TYPE;
|
||||
|
@ -403,7 +403,7 @@ SELECT * from INFORMATION_SCHEMA.USER_PRIVILEGES
|
|||
WHERE GRANTEE = '''mysqltest_3''@''localhost'''
|
||||
ORDER BY TABLE_CATALOG,PRIVILEGE_TYPE;
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'mysqltest_3'@'localhost' NULL USAGE NO
|
||||
'mysqltest_3'@'localhost' def USAGE NO
|
||||
update mysqltest_1.t1, mysqltest_1.t2 set q=10 where b=1;
|
||||
ERROR 42000: UPDATE command denied to user 'mysqltest_3'@'localhost' for column 'q' in table 't1'
|
||||
update mysqltest_1.t2, mysqltest_2.t2 set d=20 where d=1;
|
||||
|
@ -483,6 +483,7 @@ Show view Tables To see views with SHOW CREATE VIEW
|
|||
Shutdown Server Admin To shut down the server
|
||||
Super Server Admin To use KILL thread, SET GLOBAL, CHANGE MASTER, etc.
|
||||
Trigger Tables To use triggers
|
||||
Create tablespace Server Admin To create/alter/drop tablespaces
|
||||
Update Tables To update existing rows
|
||||
Usage Server Admin No privileges - allow connect only
|
||||
create database mysqltest;
|
||||
|
@ -710,8 +711,8 @@ GRANT SELECT ON `mysqltest`.* TO 'mysqltest_8'@'%'
|
|||
select * from information_schema.schema_privileges
|
||||
where grantee like "'mysqltest_8'%";
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'mysqltest_8'@'%' NULL mysqltest SELECT NO
|
||||
'mysqltest_8'@'' NULL mysqltest SELECT NO
|
||||
'mysqltest_8'@'%' def mysqltest SELECT NO
|
||||
'mysqltest_8'@'' def mysqltest SELECT NO
|
||||
select * from t1;
|
||||
a
|
||||
revoke select on mysqltest.* from mysqltest_8@'';
|
||||
|
@ -762,8 +763,8 @@ GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
|
|||
GRANT UPDATE (a) ON `test`.`t1` TO 'mysqltest_8'@'%'
|
||||
select * from information_schema.column_privileges;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'mysqltest_8'@'%' NULL test t1 a UPDATE NO
|
||||
'mysqltest_8'@'' NULL test t1 a UPDATE NO
|
||||
'mysqltest_8'@'%' def test t1 a UPDATE NO
|
||||
'mysqltest_8'@'' def test t1 a UPDATE NO
|
||||
select * from t1;
|
||||
a
|
||||
revoke update (a) on t1 from mysqltest_8@'';
|
||||
|
@ -805,8 +806,8 @@ GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
|
|||
GRANT UPDATE ON `test`.`t1` TO 'mysqltest_8'@'%'
|
||||
select * from information_schema.table_privileges;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'mysqltest_8'@'%' NULL test t1 UPDATE NO
|
||||
'mysqltest_8'@'' NULL test t1 UPDATE NO
|
||||
'mysqltest_8'@'%' def test t1 UPDATE NO
|
||||
'mysqltest_8'@'' def test t1 UPDATE NO
|
||||
select * from t1;
|
||||
a
|
||||
revoke update on t1 from mysqltest_8@'';
|
||||
|
@ -844,9 +845,9 @@ GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_8'@'%'
|
|||
select * from information_schema.user_privileges
|
||||
where grantee like "'mysqltest_8'%";
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'mysqltest_8'@'host8' NULL USAGE NO
|
||||
'mysqltest_8'@'%' NULL USAGE NO
|
||||
'mysqltest_8'@'' NULL USAGE NO
|
||||
'mysqltest_8'@'host8' def USAGE NO
|
||||
'mysqltest_8'@'%' def USAGE NO
|
||||
'mysqltest_8'@'' def USAGE NO
|
||||
select * from t1;
|
||||
a
|
||||
flush privileges;
|
||||
|
@ -869,8 +870,8 @@ GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_8'@'%'
|
|||
select * from information_schema.user_privileges
|
||||
where grantee like "'mysqltest_8'%";
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'mysqltest_8'@'host8' NULL USAGE NO
|
||||
'mysqltest_8'@'%' NULL USAGE NO
|
||||
'mysqltest_8'@'host8' def USAGE NO
|
||||
'mysqltest_8'@'%' def USAGE NO
|
||||
drop user mysqltest_8;
|
||||
connect(localhost,mysqltest_8,,test,MASTER_PORT,MASTER_SOCKET);
|
||||
ERROR 28000: Access denied for user 'mysqltest_8'@'localhost' (using password: NO)
|
||||
|
@ -914,13 +915,13 @@ SHOW CREATE VIEW mysqltest2.v_ny;
|
|||
View Create View character_set_client collation_connection
|
||||
v_ny CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest2`.`v_ny` AS select `mysqltest2`.`t_nn`.`c1` AS `c1` from `mysqltest2`.`t_nn` latin1 latin1_swedish_ci
|
||||
SHOW CREATE TABLE mysqltest3.t_nn;
|
||||
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 't_nn'
|
||||
ERROR 42000: SHOW command denied to user 'mysqltest_1'@'localhost' for table 't_nn'
|
||||
SHOW CREATE VIEW mysqltest3.t_nn;
|
||||
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 't_nn'
|
||||
SHOW CREATE VIEW mysqltest3.v_nn;
|
||||
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'v_nn'
|
||||
SHOW CREATE TABLE mysqltest3.v_nn;
|
||||
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'v_nn'
|
||||
ERROR 42000: SHOW command denied to user 'mysqltest_1'@'localhost' for table 'v_nn'
|
||||
SHOW CREATE TABLE mysqltest2.t_nn;
|
||||
Table Create Table
|
||||
t_nn CREATE TABLE `t_nn` (
|
||||
|
@ -1413,3 +1414,713 @@ DROP USER 'user1';
|
|||
DROP USER 'user1'@'localhost';
|
||||
DROP USER 'user2';
|
||||
DROP DATABASE db1;
|
||||
#
|
||||
# Bug #25863 No database selected error, but documentation
|
||||
# says * for global allowed
|
||||
#
|
||||
GRANT ALL ON * TO mysqltest_1;
|
||||
ERROR 3D000: No database selected
|
||||
GRANT ALL ON *.* TO mysqltest_1;
|
||||
SHOW GRANTS FOR mysqltest_1;
|
||||
Grants for mysqltest_1@%
|
||||
GRANT ALL PRIVILEGES ON *.* TO 'mysqltest_1'@'%'
|
||||
DROP USER mysqltest_1;
|
||||
USE test;
|
||||
GRANT ALL ON * TO mysqltest_1;
|
||||
SHOW GRANTS FOR mysqltest_1;
|
||||
Grants for mysqltest_1@%
|
||||
GRANT USAGE ON *.* TO 'mysqltest_1'@'%'
|
||||
GRANT ALL PRIVILEGES ON `test`.* TO 'mysqltest_1'@'%'
|
||||
DROP USER mysqltest_1;
|
||||
GRANT ALL ON *.* TO mysqltest_1;
|
||||
SHOW GRANTS FOR mysqltest_1;
|
||||
Grants for mysqltest_1@%
|
||||
GRANT ALL PRIVILEGES ON *.* TO 'mysqltest_1'@'%'
|
||||
DROP USER mysqltest_1;
|
||||
#########################################################################
|
||||
#
|
||||
# Bug#38347: ALTER ROUTINE privilege allows SHOW CREATE TABLE.
|
||||
#
|
||||
#########################################################################
|
||||
|
||||
# --
|
||||
# -- Prepare the environment.
|
||||
# --
|
||||
DELETE FROM mysql.user WHERE User LIKE 'mysqltest_%';
|
||||
DELETE FROM mysql.db WHERE User LIKE 'mysqltest_%';
|
||||
DELETE FROM mysql.tables_priv WHERE User LIKE 'mysqltest_%';
|
||||
DELETE FROM mysql.columns_priv WHERE User LIKE 'mysqltest_%';
|
||||
FLUSH PRIVILEGES;
|
||||
DROP DATABASE IF EXISTS mysqltest_db1;
|
||||
CREATE DATABASE mysqltest_db1;
|
||||
CREATE TABLE mysqltest_db1.t1(a INT);
|
||||
|
||||
# --
|
||||
# -- Check that global privileges don't allow SHOW CREATE TABLE.
|
||||
# --
|
||||
GRANT EVENT ON mysqltest_db1.* TO mysqltest_u1@localhost;
|
||||
GRANT CREATE TEMPORARY TABLES ON mysqltest_db1.* TO mysqltest_u1@localhost;
|
||||
GRANT LOCK TABLES ON mysqltest_db1.* TO mysqltest_u1@localhost;
|
||||
GRANT ALTER ROUTINE ON mysqltest_db1.* TO mysqltest_u1@localhost;
|
||||
GRANT CREATE ROUTINE ON mysqltest_db1.* TO mysqltest_u1@localhost;
|
||||
GRANT EXECUTE ON mysqltest_db1.* TO mysqltest_u1@localhost;
|
||||
GRANT FILE ON *.* TO mysqltest_u1@localhost;
|
||||
GRANT CREATE USER ON *.* TO mysqltest_u1@localhost;
|
||||
GRANT PROCESS ON *.* TO mysqltest_u1@localhost;
|
||||
GRANT RELOAD ON *.* TO mysqltest_u1@localhost;
|
||||
GRANT REPLICATION CLIENT ON *.* TO mysqltest_u1@localhost;
|
||||
GRANT REPLICATION SLAVE ON *.* TO mysqltest_u1@localhost;
|
||||
GRANT SHOW DATABASES ON *.* TO mysqltest_u1@localhost;
|
||||
GRANT SHUTDOWN ON *.* TO mysqltest_u1@localhost;
|
||||
GRANT USAGE ON *.* TO mysqltest_u1@localhost;
|
||||
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT RELOAD, SHUTDOWN, PROCESS, FILE, SHOW DATABASES, REPLICATION SLAVE, REPLICATION CLIENT, CREATE USER ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
GRANT CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE ROUTINE, ALTER ROUTINE, EVENT ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# connection: con1 (mysqltest_u1@mysqltest_db1)
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
ERROR 42000: SHOW command denied to user 'mysqltest_u1'@'localhost' for table 't1'
|
||||
|
||||
# connection: default
|
||||
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# --
|
||||
# -- Check that global SELECT allows SHOW CREATE TABLE.
|
||||
# --
|
||||
|
||||
GRANT SELECT ON mysqltest_db1.* TO mysqltest_u1@localhost;
|
||||
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
GRANT SELECT ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# connection: con1 (mysqltest_u1@mysqltest_db1)
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
|
||||
# connection: default
|
||||
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# --
|
||||
# -- Check that global INSERT allows SHOW CREATE TABLE.
|
||||
# --
|
||||
|
||||
GRANT INSERT ON mysqltest_db1.* TO mysqltest_u1@localhost;
|
||||
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
GRANT INSERT ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# connection: con1 (mysqltest_u1@mysqltest_db1)
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
|
||||
# connection: default
|
||||
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# --
|
||||
# -- Check that global UPDATE allows SHOW CREATE TABLE.
|
||||
# --
|
||||
|
||||
GRANT UPDATE ON mysqltest_db1.* TO mysqltest_u1@localhost;
|
||||
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
GRANT UPDATE ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# connection: con1 (mysqltest_u1@mysqltest_db1)
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
|
||||
# connection: default
|
||||
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# --
|
||||
# -- Check that global DELETE allows SHOW CREATE TABLE.
|
||||
# --
|
||||
|
||||
GRANT DELETE ON mysqltest_db1.* TO mysqltest_u1@localhost;
|
||||
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
GRANT DELETE ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# connection: con1 (mysqltest_u1@mysqltest_db1)
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
|
||||
# connection: default
|
||||
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# --
|
||||
# -- Check that global CREATE allows SHOW CREATE TABLE.
|
||||
# --
|
||||
|
||||
GRANT CREATE ON mysqltest_db1.* TO mysqltest_u1@localhost;
|
||||
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
GRANT CREATE ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# connection: con1 (mysqltest_u1@mysqltest_db1)
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
|
||||
# connection: default
|
||||
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# --
|
||||
# -- Check that global DROP allows SHOW CREATE TABLE.
|
||||
# --
|
||||
|
||||
GRANT DROP ON mysqltest_db1.* TO mysqltest_u1@localhost;
|
||||
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
GRANT DROP ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# connection: con1 (mysqltest_u1@mysqltest_db1)
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
|
||||
# connection: default
|
||||
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# --
|
||||
# -- Check that global ALTER allows SHOW CREATE TABLE.
|
||||
# --
|
||||
|
||||
GRANT ALTER ON mysqltest_db1.* TO mysqltest_u1@localhost;
|
||||
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
GRANT ALTER ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# connection: con1 (mysqltest_u1@mysqltest_db1)
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
|
||||
# connection: default
|
||||
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# --
|
||||
# -- Check that global INDEX allows SHOW CREATE TABLE.
|
||||
# --
|
||||
|
||||
GRANT INDEX ON mysqltest_db1.* TO mysqltest_u1@localhost;
|
||||
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
GRANT INDEX ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# connection: con1 (mysqltest_u1@mysqltest_db1)
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
|
||||
# connection: default
|
||||
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# --
|
||||
# -- Check that global REFERENCES allows SHOW CREATE TABLE.
|
||||
# --
|
||||
|
||||
GRANT REFERENCES ON mysqltest_db1.* TO mysqltest_u1@localhost;
|
||||
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
GRANT REFERENCES ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# connection: con1 (mysqltest_u1@mysqltest_db1)
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
|
||||
# connection: default
|
||||
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# --
|
||||
# -- Check that global GRANT OPTION allows SHOW CREATE TABLE.
|
||||
# --
|
||||
|
||||
GRANT GRANT OPTION ON mysqltest_db1.* TO mysqltest_u1@localhost;
|
||||
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
GRANT USAGE ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost' WITH GRANT OPTION
|
||||
|
||||
# connection: con1 (mysqltest_u1@mysqltest_db1)
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
|
||||
# connection: default
|
||||
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# --
|
||||
# -- Check that global CREATE VIEW allows SHOW CREATE TABLE.
|
||||
# --
|
||||
|
||||
GRANT CREATE VIEW ON mysqltest_db1.* TO mysqltest_u1@localhost;
|
||||
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
GRANT CREATE VIEW ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# connection: con1 (mysqltest_u1@mysqltest_db1)
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
|
||||
# connection: default
|
||||
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# --
|
||||
# -- Check that global SHOW VIEW allows SHOW CREATE TABLE.
|
||||
# --
|
||||
|
||||
GRANT SHOW VIEW ON mysqltest_db1.* TO mysqltest_u1@localhost;
|
||||
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
GRANT SHOW VIEW ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# connection: con1 (mysqltest_u1@mysqltest_db1)
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
|
||||
# connection: default
|
||||
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# --
|
||||
# -- Check that table-level SELECT allows SHOW CREATE TABLE.
|
||||
# --
|
||||
|
||||
GRANT SELECT ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
|
||||
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
GRANT SELECT ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# connection: con1 (mysqltest_u1@mysqltest_db1)
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
|
||||
# connection: default
|
||||
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# --
|
||||
# -- Check that table-level INSERT allows SHOW CREATE TABLE.
|
||||
# --
|
||||
|
||||
GRANT INSERT ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
|
||||
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
GRANT INSERT ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# connection: con1 (mysqltest_u1@mysqltest_db1)
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
|
||||
# connection: default
|
||||
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# --
|
||||
# -- Check that table-level UPDATE allows SHOW CREATE TABLE.
|
||||
# --
|
||||
|
||||
GRANT UPDATE ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
|
||||
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
GRANT UPDATE ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# connection: con1 (mysqltest_u1@mysqltest_db1)
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
|
||||
# connection: default
|
||||
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# --
|
||||
# -- Check that table-level DELETE allows SHOW CREATE TABLE.
|
||||
# --
|
||||
|
||||
GRANT DELETE ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
|
||||
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
GRANT DELETE ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# connection: con1 (mysqltest_u1@mysqltest_db1)
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
|
||||
# connection: default
|
||||
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# --
|
||||
# -- Check that table-level CREATE allows SHOW CREATE TABLE.
|
||||
# --
|
||||
|
||||
GRANT CREATE ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
|
||||
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
GRANT CREATE ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# connection: con1 (mysqltest_u1@mysqltest_db1)
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
|
||||
# connection: default
|
||||
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# --
|
||||
# -- Check that table-level DROP allows SHOW CREATE TABLE.
|
||||
# --
|
||||
|
||||
GRANT DROP ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
|
||||
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
GRANT DROP ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# connection: con1 (mysqltest_u1@mysqltest_db1)
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
|
||||
# connection: default
|
||||
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# --
|
||||
# -- Check that table-level ALTER allows SHOW CREATE TABLE.
|
||||
# --
|
||||
|
||||
GRANT ALTER ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
|
||||
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
GRANT ALTER ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# connection: con1 (mysqltest_u1@mysqltest_db1)
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
|
||||
# connection: default
|
||||
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# --
|
||||
# -- Check that table-level INDEX allows SHOW CREATE TABLE.
|
||||
# --
|
||||
|
||||
GRANT INDEX ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
|
||||
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
GRANT INDEX ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# connection: con1 (mysqltest_u1@mysqltest_db1)
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
|
||||
# connection: default
|
||||
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# --
|
||||
# -- Check that table-level REFERENCES allows SHOW CREATE TABLE.
|
||||
# --
|
||||
|
||||
GRANT REFERENCES ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
|
||||
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
GRANT REFERENCES ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# connection: con1 (mysqltest_u1@mysqltest_db1)
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
|
||||
# connection: default
|
||||
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# --
|
||||
# -- Check that table-level GRANT OPTION allows SHOW CREATE TABLE.
|
||||
# --
|
||||
|
||||
GRANT GRANT OPTION ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
|
||||
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
GRANT USAGE ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost' WITH GRANT OPTION
|
||||
|
||||
# connection: con1 (mysqltest_u1@mysqltest_db1)
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
|
||||
# connection: default
|
||||
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# --
|
||||
# -- Check that table-level CREATE VIEW allows SHOW CREATE TABLE.
|
||||
# --
|
||||
|
||||
GRANT CREATE VIEW ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
|
||||
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
GRANT CREATE VIEW ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# connection: con1 (mysqltest_u1@mysqltest_db1)
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
|
||||
# connection: default
|
||||
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# --
|
||||
# -- Check that table-level SHOW VIEW allows SHOW CREATE TABLE.
|
||||
# --
|
||||
|
||||
GRANT SHOW VIEW ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
|
||||
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
GRANT SHOW VIEW ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# connection: con1 (mysqltest_u1@mysqltest_db1)
|
||||
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
|
||||
# connection: default
|
||||
|
||||
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
|
||||
SHOW GRANTS FOR mysqltest_u1@localhost;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# --
|
||||
# -- Cleanup.
|
||||
# --
|
||||
|
||||
DROP DATABASE mysqltest_db1;
|
||||
DROP USER mysqltest_u1@localhost;
|
||||
|
||||
# End of Bug#38347.
|
||||
|
||||
|
|
|
@ -391,7 +391,7 @@ grant all on mysqltest_1.* to mysqltest_u1@localhost;
|
|||
use mysqltest_2;
|
||||
create table t1 (i int);
|
||||
show create table mysqltest_2.t1;
|
||||
ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't1'
|
||||
ERROR 42000: SHOW command denied to user 'mysqltest_u1'@'localhost' for table 't1'
|
||||
create table t1 like mysqltest_2.t1;
|
||||
ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't1'
|
||||
grant select on mysqltest_2.t1 to mysqltest_u1@localhost;
|
||||
|
|
123
mysql-test/r/grant4.result
Normal file
123
mysql-test/r/grant4.result
Normal file
|
@ -0,0 +1,123 @@
|
|||
drop database if exists mysqltest_db1;
|
||||
create database mysqltest_db1;
|
||||
use mysqltest_db1;
|
||||
create table t_column_priv_only (a int, b int);
|
||||
create table t_select_priv like t_column_priv_only;
|
||||
create table t_no_priv like t_column_priv_only;
|
||||
grant all privileges on test.* to mysqltest_u1@localhost;
|
||||
grant insert (a) on mysqltest_db1.t_column_priv_only to mysqltest_u1@localhost;
|
||||
grant select on mysqltest_db1.t_select_priv to mysqltest_u1@localhost;
|
||||
** Connect as restricted user mysqltest_u1.
|
||||
|
||||
** Test column level privileges only. No SELECT privileges on the table.
|
||||
** INSERT INTO ... VALUES ...
|
||||
** Attempting to insert values to a table with only column privileges
|
||||
** should work.
|
||||
insert into mysqltest_db1.t_column_priv_only (a) VALUES (1);
|
||||
|
||||
** SHOW COLUMNS
|
||||
** Should succeed because we have privileges (any) on at least one of the columns.
|
||||
select column_name as 'Field',column_type as 'Type',is_nullable as 'Null',column_key as 'Key',column_default as 'Default',extra as 'Extra' from information_schema.columns where table_schema='mysqltest_db1' and table_name='t_column_priv_only';
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) YES NULL
|
||||
show columns from mysqltest_db1.t_column_priv_only;
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) YES NULL
|
||||
** SHOW COLUMNS
|
||||
** Should fail because there are no privileges on any column combination.
|
||||
show columns from mysqltest_db1.t_no_priv;
|
||||
ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't_no_priv'
|
||||
** However, select from I_S.COLUMNS will succeed but not show anything:
|
||||
select column_name as 'Field',column_type as 'Type',is_nullable as 'Null',column_key as 'Key',column_default as 'Default',extra as 'Extra' from information_schema.columns where table_schema='mysqltest_db1' and table_name='t_no_priv';
|
||||
Field Type Null Key Default Extra
|
||||
|
||||
** CREATE TABLE ... LIKE ... require SELECT privleges and will fail.
|
||||
create table test.t_no_priv like mysqltest_db1.column_priv_only;
|
||||
ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 'column_priv_only'
|
||||
|
||||
** Just to be sure... SELECT also fails.
|
||||
select * from mysqltest_db1.t_column_priv_only;
|
||||
ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't_column_priv_only'
|
||||
|
||||
** SHOW CREATE TABLE ... require any privileges on all columns (the entire table).
|
||||
** First we try and fail on a table with only one column privilege.
|
||||
show create table mysqltest_db1.t_column_priv_only;
|
||||
ERROR 42000: SHOW command denied to user 'mysqltest_u1'@'localhost' for table 't_column_priv_only'
|
||||
|
||||
** Now we do the same on a table with SELECT privileges.
|
||||
|
||||
** SHOW COLUMNS
|
||||
** Success because we got some privileges on the table (SELECT_ACL)
|
||||
show columns from mysqltest_db1.t_select_priv;
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) YES NULL
|
||||
b int(11) YES NULL
|
||||
|
||||
** CREATE TABLE ... LIKE ... require SELECT privleges and will SUCCEED.
|
||||
drop table if exists test.t_duplicated;
|
||||
create table test.t_duplicated like mysqltest_db1.t_select_priv;
|
||||
drop table test.t_duplicated;
|
||||
|
||||
** SHOW CREATE TABLE will succeed because we have a privilege on all columns in the table (table-level privilege).
|
||||
show create table mysqltest_db1.t_select_priv;
|
||||
Table Create Table
|
||||
t_select_priv CREATE TABLE `t_select_priv` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
|
||||
** SHOW CREATE TABLE will fail if there is no grants at all:
|
||||
show create table mysqltest_db1.t_no_priv;
|
||||
ERROR 42000: SHOW command denied to user 'mysqltest_u1'@'localhost' for table 't_no_priv'
|
||||
|
||||
use mysqltest_db1;
|
||||
CREATE TABLE t5 (s1 INT);
|
||||
CREATE INDEX i ON t5 (s1);
|
||||
CREATE TABLE t6 (s1 INT, s2 INT);
|
||||
CREATE VIEW v5 AS SELECT * FROM t5;
|
||||
CREATE VIEW v6 AS SELECT * FROM t6;
|
||||
CREATE VIEW v2 AS SELECT * FROM t_select_priv;
|
||||
CREATE VIEW v3 AS SELECT * FROM t_select_priv;
|
||||
CREATE INDEX i ON t6 (s1);
|
||||
GRANT UPDATE (s2) ON t6 to mysqltest_u1@localhost;
|
||||
GRANT UPDATE (s2) ON v6 to mysqltest_u1@localhost;
|
||||
GRANT SHOW VIEW ON v2 to mysqltest_u1@localhost;
|
||||
GRANT SHOW VIEW, SELECT ON v3 to mysqltest_u1@localhost;
|
||||
use mysqltest_db1;
|
||||
** Connect as restricted user mysqltest_u1.
|
||||
** SELECT FROM INFORMATION_SCHEMA.STATISTICS will succeed because any privileges will do (authentication is enough).
|
||||
SELECT * FROM INFORMATION_SCHEMA.STATISTICS WHERE table_name='t5';
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
|
||||
def mysqltest_db1 t5 1 mysqltest_db1 i 1 s1 A NULL NULL NULL YES BTREE
|
||||
** SHOW INDEX FROM t5 will fail because we don't have any privileges on any column combination.
|
||||
SHOW INDEX FROM t5;
|
||||
ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't5'
|
||||
** SHOW INDEX FROM t6 will succeed because there exist a privilege on a column combination on t6.
|
||||
SHOW INDEX FROM t6;
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
t6 1 i 1 s1 A NULL NULL NULL YES BTREE
|
||||
** CHECK TABLE requires any privilege on any column combination and should succeed for t6:
|
||||
CHECK TABLE t6;
|
||||
Table Op Msg_type Msg_text
|
||||
mysqltest_db1.t6 check status OK
|
||||
** With no privileges access is naturally denied:
|
||||
CHECK TABLE t5;
|
||||
ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't5'
|
||||
** CHECKSUM TABLE requires SELECT privileges on the table. The following should fail:
|
||||
CHECKSUM TABLE t6;
|
||||
ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't6'
|
||||
** And this should work:
|
||||
CHECKSUM TABLE t_select_priv;
|
||||
Table Checksum
|
||||
mysqltest_db1.t_select_priv 0
|
||||
SHOW CREATE VIEW v5;
|
||||
ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 'v5'
|
||||
SHOW CREATE VIEW v6;
|
||||
ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 'v6'
|
||||
SHOW CREATE VIEW v2;
|
||||
ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 'v2'
|
||||
SHOW CREATE VIEW v3;
|
||||
View Create View character_set_client collation_connection
|
||||
v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t_select_priv`.`a` AS `a`,`t_select_priv`.`b` AS `b` from `t_select_priv` latin1 latin1_swedish_ci
|
||||
drop database mysqltest_db1;
|
||||
drop user mysqltest_u1@localhost;
|
|
@ -1,2 +0,0 @@
|
|||
Variable_name Value
|
||||
have_community_features YES
|
2
mysql-test/r/have_nodebug.require
Normal file
2
mysql-test/r/have_nodebug.require
Normal file
|
@ -0,0 +1,2 @@
|
|||
debug
|
||||
0
|
2
mysql-test/r/have_profiling.require
Normal file
2
mysql-test/r/have_profiling.require
Normal file
|
@ -0,0 +1,2 @@
|
|||
Variable_name Value
|
||||
have_profiling YES
|
|
@ -12,7 +12,7 @@ explain extended select count(a) as b from t1 where a=0 having b >=0;
|
|||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
|
||||
Warnings:
|
||||
Note 1003 select count('0') AS `b` from `test`.`t1` where 0 having (`b` >= 0)
|
||||
Note 1003 select count('0') AS `b` from dual where 0 having (`b` >= 0)
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (
|
||||
raw_id int(10) NOT NULL default '0',
|
||||
|
|
|
@ -9,9 +9,9 @@ create user mysqltest_3@localhost;
|
|||
create user mysqltest_3;
|
||||
select * from information_schema.SCHEMATA where schema_name > 'm';
|
||||
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
|
||||
NULL mtr latin1 latin1_swedish_ci NULL
|
||||
NULL mysql latin1 latin1_swedish_ci NULL
|
||||
NULL test latin1 latin1_swedish_ci NULL
|
||||
def mtr latin1 latin1_swedish_ci NULL
|
||||
def mysql latin1 latin1_swedish_ci NULL
|
||||
def test latin1 latin1_swedish_ci NULL
|
||||
select schema_name from information_schema.schemata;
|
||||
schema_name
|
||||
information_schema
|
||||
|
@ -162,7 +162,7 @@ t1
|
|||
t4
|
||||
select * from information_schema.STATISTICS where TABLE_SCHEMA = "mysqltest";
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
|
||||
NULL mysqltest t1 1 mysqltest string_data 1 b A NULL NULL NULL YES BTREE
|
||||
def mysqltest t1 1 mysqltest string_data 1 b A NULL NULL NULL YES BTREE
|
||||
show keys from t3 where Key_name = "a_data";
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
t3 1 a_data 1 a A NULL NULL NULL YES BTREE
|
||||
|
@ -189,7 +189,7 @@ c varchar(64) utf8_general_ci NO select,insert,update,references
|
|||
select * from information_schema.COLUMNS where table_name="t1"
|
||||
and column_name= "a";
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
|
||||
NULL mysqltest t1 a 1 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
|
||||
def mysqltest t1 a 1 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
|
||||
show columns from mysqltest.t1 where field like "%a%";
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) YES NULL
|
||||
|
@ -394,11 +394,11 @@ show keys from v4;
|
|||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
select * from information_schema.views where TABLE_NAME like "v%";
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
|
||||
NULL test v0 select `schemata`.`SCHEMA_NAME` AS `c` from `information_schema`.`schemata` NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
|
||||
NULL test v1 select `tables`.`TABLE_NAME` AS `c` from `information_schema`.`tables` where (`tables`.`TABLE_NAME` = 'v1') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
|
||||
NULL test v2 select `columns`.`COLUMN_NAME` AS `c` from `information_schema`.`columns` where (`columns`.`TABLE_NAME` = 'v2') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
|
||||
NULL test v3 select `character_sets`.`CHARACTER_SET_NAME` AS `c` from `information_schema`.`character_sets` where (`character_sets`.`CHARACTER_SET_NAME` like 'latin1%') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
|
||||
NULL test v4 select `collations`.`COLLATION_NAME` AS `c` from `information_schema`.`collations` where (`collations`.`COLLATION_NAME` like 'latin1%') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
|
||||
def test v0 select `information_schema`.`schemata`.`SCHEMA_NAME` AS `c` from `information_schema`.`schemata` NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
|
||||
def test v1 select `information_schema`.`tables`.`TABLE_NAME` AS `c` from `information_schema`.`tables` where (`information_schema`.`tables`.`TABLE_NAME` = 'v1') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
|
||||
def test v2 select `information_schema`.`columns`.`COLUMN_NAME` AS `c` from `information_schema`.`columns` where (`information_schema`.`columns`.`TABLE_NAME` = 'v2') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
|
||||
def test v3 select `information_schema`.`character_sets`.`CHARACTER_SET_NAME` AS `c` from `information_schema`.`character_sets` where (`information_schema`.`character_sets`.`CHARACTER_SET_NAME` like 'latin1%') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
|
||||
def test v4 select `information_schema`.`collations`.`COLLATION_NAME` AS `c` from `information_schema`.`collations` where (`information_schema`.`collations`.`COLLATION_NAME` like 'latin1%') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
|
||||
drop view v0, v1, v2, v3, v4;
|
||||
create table t1 (a int);
|
||||
grant select,update,insert on t1 to mysqltest_1@localhost;
|
||||
|
@ -406,38 +406,38 @@ grant select (a), update (a),insert(a), references(a) on t1 to mysqltest_1@local
|
|||
grant all on test.* to mysqltest_1@localhost with grant option;
|
||||
select * from information_schema.USER_PRIVILEGES where grantee like '%mysqltest_1%';
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'mysqltest_1'@'localhost' NULL USAGE NO
|
||||
'mysqltest_1'@'localhost' def USAGE NO
|
||||
select * from information_schema.SCHEMA_PRIVILEGES where grantee like '%mysqltest_1%';
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'mysqltest_1'@'localhost' NULL test SELECT YES
|
||||
'mysqltest_1'@'localhost' NULL test INSERT YES
|
||||
'mysqltest_1'@'localhost' NULL test UPDATE YES
|
||||
'mysqltest_1'@'localhost' NULL test DELETE YES
|
||||
'mysqltest_1'@'localhost' NULL test CREATE YES
|
||||
'mysqltest_1'@'localhost' NULL test DROP YES
|
||||
'mysqltest_1'@'localhost' NULL test REFERENCES YES
|
||||
'mysqltest_1'@'localhost' NULL test INDEX YES
|
||||
'mysqltest_1'@'localhost' NULL test ALTER YES
|
||||
'mysqltest_1'@'localhost' NULL test CREATE TEMPORARY TABLES YES
|
||||
'mysqltest_1'@'localhost' NULL test LOCK TABLES YES
|
||||
'mysqltest_1'@'localhost' NULL test EXECUTE YES
|
||||
'mysqltest_1'@'localhost' NULL test CREATE VIEW YES
|
||||
'mysqltest_1'@'localhost' NULL test SHOW VIEW YES
|
||||
'mysqltest_1'@'localhost' NULL test CREATE ROUTINE YES
|
||||
'mysqltest_1'@'localhost' NULL test ALTER ROUTINE YES
|
||||
'mysqltest_1'@'localhost' NULL test EVENT YES
|
||||
'mysqltest_1'@'localhost' NULL test TRIGGER YES
|
||||
'mysqltest_1'@'localhost' def test SELECT YES
|
||||
'mysqltest_1'@'localhost' def test INSERT YES
|
||||
'mysqltest_1'@'localhost' def test UPDATE YES
|
||||
'mysqltest_1'@'localhost' def test DELETE YES
|
||||
'mysqltest_1'@'localhost' def test CREATE YES
|
||||
'mysqltest_1'@'localhost' def test DROP YES
|
||||
'mysqltest_1'@'localhost' def test REFERENCES YES
|
||||
'mysqltest_1'@'localhost' def test INDEX YES
|
||||
'mysqltest_1'@'localhost' def test ALTER YES
|
||||
'mysqltest_1'@'localhost' def test CREATE TEMPORARY TABLES YES
|
||||
'mysqltest_1'@'localhost' def test LOCK TABLES YES
|
||||
'mysqltest_1'@'localhost' def test EXECUTE YES
|
||||
'mysqltest_1'@'localhost' def test CREATE VIEW YES
|
||||
'mysqltest_1'@'localhost' def test SHOW VIEW YES
|
||||
'mysqltest_1'@'localhost' def test CREATE ROUTINE YES
|
||||
'mysqltest_1'@'localhost' def test ALTER ROUTINE YES
|
||||
'mysqltest_1'@'localhost' def test EVENT YES
|
||||
'mysqltest_1'@'localhost' def test TRIGGER YES
|
||||
select * from information_schema.TABLE_PRIVILEGES where grantee like '%mysqltest_1%';
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'mysqltest_1'@'localhost' NULL test t1 SELECT NO
|
||||
'mysqltest_1'@'localhost' NULL test t1 INSERT NO
|
||||
'mysqltest_1'@'localhost' NULL test t1 UPDATE NO
|
||||
'mysqltest_1'@'localhost' def test t1 SELECT NO
|
||||
'mysqltest_1'@'localhost' def test t1 INSERT NO
|
||||
'mysqltest_1'@'localhost' def test t1 UPDATE NO
|
||||
select * from information_schema.COLUMN_PRIVILEGES where grantee like '%mysqltest_1%';
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'mysqltest_1'@'localhost' NULL test t1 a SELECT NO
|
||||
'mysqltest_1'@'localhost' NULL test t1 a INSERT NO
|
||||
'mysqltest_1'@'localhost' NULL test t1 a UPDATE NO
|
||||
'mysqltest_1'@'localhost' NULL test t1 a REFERENCES NO
|
||||
'mysqltest_1'@'localhost' def test t1 a SELECT NO
|
||||
'mysqltest_1'@'localhost' def test t1 a INSERT NO
|
||||
'mysqltest_1'@'localhost' def test t1 a UPDATE NO
|
||||
'mysqltest_1'@'localhost' def test t1 a REFERENCES NO
|
||||
delete from mysql.user where user like 'mysqltest%';
|
||||
delete from mysql.db where user like 'mysqltest%';
|
||||
delete from mysql.tables_priv where user like 'mysqltest%';
|
||||
|
@ -460,17 +460,17 @@ t1 CREATE TABLE `t1` (
|
|||
select * from information_schema.TABLE_CONSTRAINTS where
|
||||
TABLE_SCHEMA= "test";
|
||||
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
|
||||
NULL test PRIMARY test t1 PRIMARY KEY
|
||||
NULL test constraint_1 test t1 UNIQUE
|
||||
NULL test key_1 test t1 UNIQUE
|
||||
NULL test key_2 test t1 UNIQUE
|
||||
def test PRIMARY test t1 PRIMARY KEY
|
||||
def test constraint_1 test t1 UNIQUE
|
||||
def test key_1 test t1 UNIQUE
|
||||
def test key_2 test t1 UNIQUE
|
||||
select * from information_schema.KEY_COLUMN_USAGE where
|
||||
TABLE_SCHEMA= "test";
|
||||
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 test PRIMARY NULL test t1 a 1 NULL NULL NULL NULL
|
||||
NULL test constraint_1 NULL test t1 a 1 NULL NULL NULL NULL
|
||||
NULL test key_1 NULL test t1 a 1 NULL NULL NULL NULL
|
||||
NULL test key_2 NULL test t1 a 1 NULL NULL NULL NULL
|
||||
def test PRIMARY def test t1 a 1 NULL NULL NULL NULL
|
||||
def test constraint_1 def test t1 a 1 NULL NULL NULL NULL
|
||||
def test key_1 def test t1 a 1 NULL NULL NULL NULL
|
||||
def test key_2 def test t1 a 1 NULL NULL NULL NULL
|
||||
select table_name from information_schema.TABLES where table_schema like "test%";
|
||||
table_name
|
||||
t1
|
||||
|
@ -491,13 +491,13 @@ create view v2 (c) as select a from t1 WITH LOCAL CHECK OPTION;
|
|||
create view v3 (c) as select a from t1 WITH CASCADED CHECK OPTION;
|
||||
select * from information_schema.views;
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
|
||||
NULL test v1 select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhost DEFINER latin1 latin1_swedish_ci
|
||||
NULL test v2 select `test`.`t1`.`a` AS `c` from `test`.`t1` LOCAL YES root@localhost DEFINER latin1 latin1_swedish_ci
|
||||
NULL test v3 select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhost DEFINER latin1 latin1_swedish_ci
|
||||
def test v1 select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhost DEFINER latin1 latin1_swedish_ci
|
||||
def test v2 select `test`.`t1`.`a` AS `c` from `test`.`t1` LOCAL YES root@localhost DEFINER latin1 latin1_swedish_ci
|
||||
def test v3 select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhost DEFINER latin1 latin1_swedish_ci
|
||||
grant select (a) on test.t1 to joe@localhost with grant option;
|
||||
select * from INFORMATION_SCHEMA.COLUMN_PRIVILEGES;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'joe'@'localhost' NULL test t1 a SELECT YES
|
||||
'joe'@'localhost' def test t1 a SELECT YES
|
||||
select * from INFORMATION_SCHEMA.TABLE_PRIVILEGES;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
drop view v1, v2, v3;
|
||||
|
@ -592,7 +592,7 @@ proc definer char(77)
|
|||
proc created timestamp
|
||||
proc modified timestamp
|
||||
proc sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH')
|
||||
proc comment char(64)
|
||||
proc comment text
|
||||
proc character_set_client char(32)
|
||||
proc collation_connection char(32)
|
||||
proc db_collation char(32)
|
||||
|
@ -641,7 +641,7 @@ TABLE_CONSTRAINTS SYSTEM VIEW
|
|||
TABLE_PRIVILEGES SYSTEM VIEW
|
||||
TRIGGERS SYSTEM VIEW
|
||||
create table t1(a int);
|
||||
ERROR 42S02: Unknown table 't1' in information_schema
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
use test;
|
||||
show tables;
|
||||
Tables_in_test
|
||||
|
@ -771,6 +771,7 @@ information_schema PARTITIONS PARTITION_DESCRIPTION
|
|||
information_schema PLUGINS PLUGIN_DESCRIPTION
|
||||
information_schema PROCESSLIST INFO
|
||||
information_schema ROUTINES ROUTINE_DEFINITION
|
||||
information_schema ROUTINES ROUTINE_COMMENT
|
||||
information_schema TRIGGERS ACTION_CONDITION
|
||||
information_schema TRIGGERS ACTION_STATEMENT
|
||||
information_schema VIEWS VIEW_DEFINITION
|
||||
|
@ -894,17 +895,17 @@ end if;
|
|||
end AFTER NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
select * from information_schema.triggers where trigger_schema in ('mysql', 'information_schema', 'test', 'mysqltest');
|
||||
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
|
||||
NULL test trg1 INSERT NULL test t1 0 NULL begin
|
||||
def test trg1 INSERT def test t1 0 NULL begin
|
||||
if new.j > 10 then
|
||||
set new.j := 10;
|
||||
end if;
|
||||
end ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
NULL test trg2 UPDATE NULL test t1 0 NULL begin
|
||||
def test trg2 UPDATE def test t1 0 NULL begin
|
||||
if old.i % 2 = 0 then
|
||||
set new.j := -1;
|
||||
end if;
|
||||
end ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
NULL test trg3 UPDATE NULL test t1 0 NULL begin
|
||||
def test trg3 UPDATE def test t1 0 NULL begin
|
||||
if new.j = -1 then
|
||||
set @fired:= "Yes";
|
||||
end if;
|
||||
|
@ -922,14 +923,14 @@ grant select on mysqltest.* to user3@localhost;
|
|||
grant select on *.* to user4@localhost;
|
||||
select * from information_schema.column_privileges order by grantee;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'user1'@'localhost' NULL mysqltest t1 f1 SELECT NO
|
||||
'user1'@'localhost' def mysqltest t1 f1 SELECT NO
|
||||
select * from information_schema.table_privileges order by grantee;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
select * from information_schema.schema_privileges order by grantee;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
select * from information_schema.user_privileges order by grantee;
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'user1'@'localhost' NULL USAGE NO
|
||||
'user1'@'localhost' def USAGE NO
|
||||
show grants;
|
||||
Grants for user1@localhost
|
||||
GRANT USAGE ON *.* TO 'user1'@'localhost'
|
||||
|
@ -938,12 +939,12 @@ select * from information_schema.column_privileges order by grantee;
|
|||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
select * from information_schema.table_privileges order by grantee;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'user2'@'localhost' NULL mysqltest t2 SELECT NO
|
||||
'user2'@'localhost' def mysqltest t2 SELECT NO
|
||||
select * from information_schema.schema_privileges order by grantee;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
select * from information_schema.user_privileges order by grantee;
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'user2'@'localhost' NULL USAGE NO
|
||||
'user2'@'localhost' def USAGE NO
|
||||
show grants;
|
||||
Grants for user2@localhost
|
||||
GRANT USAGE ON *.* TO 'user2'@'localhost'
|
||||
|
@ -954,10 +955,10 @@ select * from information_schema.table_privileges order by grantee;
|
|||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
select * from information_schema.schema_privileges order by grantee;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'user3'@'localhost' NULL mysqltest SELECT NO
|
||||
'user3'@'localhost' def mysqltest SELECT NO
|
||||
select * from information_schema.user_privileges order by grantee;
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'user3'@'localhost' NULL USAGE NO
|
||||
'user3'@'localhost' def USAGE NO
|
||||
show grants;
|
||||
Grants for user3@localhost
|
||||
GRANT USAGE ON *.* TO 'user3'@'localhost'
|
||||
|
@ -965,22 +966,22 @@ GRANT SELECT ON `mysqltest`.* TO 'user3'@'localhost'
|
|||
select * from information_schema.column_privileges where grantee like '%user%'
|
||||
order by grantee;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'user1'@'localhost' NULL mysqltest t1 f1 SELECT NO
|
||||
'user1'@'localhost' def mysqltest t1 f1 SELECT NO
|
||||
select * from information_schema.table_privileges where grantee like '%user%'
|
||||
order by grantee;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'user2'@'localhost' NULL mysqltest t2 SELECT NO
|
||||
'user2'@'localhost' def mysqltest t2 SELECT NO
|
||||
select * from information_schema.schema_privileges where grantee like '%user%'
|
||||
order by grantee;
|
||||
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'user3'@'localhost' NULL mysqltest SELECT NO
|
||||
'user3'@'localhost' def mysqltest SELECT NO
|
||||
select * from information_schema.user_privileges where grantee like '%user%'
|
||||
order by grantee;
|
||||
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'user1'@'localhost' NULL USAGE NO
|
||||
'user2'@'localhost' NULL USAGE NO
|
||||
'user3'@'localhost' NULL USAGE NO
|
||||
'user4'@'localhost' NULL SELECT NO
|
||||
'user1'@'localhost' def USAGE NO
|
||||
'user2'@'localhost' def USAGE NO
|
||||
'user3'@'localhost' def USAGE NO
|
||||
'user4'@'localhost' def SELECT NO
|
||||
show grants;
|
||||
Grants for user4@localhost
|
||||
GRANT SELECT ON *.* TO 'user4'@'localhost'
|
||||
|
@ -1176,8 +1177,8 @@ sql security definer view v2 as select 1;
|
|||
select * from information_schema.views
|
||||
where table_name='v1' or table_name='v2';
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
|
||||
NULL test v1 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
|
||||
NULL test v2 select 1 AS `1` NONE NO mysqltest_1@localhost DEFINER latin1 latin1_swedish_ci
|
||||
def test v1 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
|
||||
def test v2 select 1 AS `1` NONE NO mysqltest_1@localhost DEFINER latin1 latin1_swedish_ci
|
||||
drop view v1, v2;
|
||||
drop table t1;
|
||||
drop user mysqltest_1@localhost;
|
||||
|
@ -1469,7 +1470,7 @@ CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_P
|
|||
SELECT * FROM INFORMATION_SCHEMA.SCHEMATA
|
||||
WHERE SCHEMA_NAME = 'test';
|
||||
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
|
||||
NULL test latin1 latin1_swedish_ci NULL
|
||||
def test latin1 latin1_swedish_ci NULL
|
||||
select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysql' AND TABLE_NAME='nonexisting';
|
||||
count(*)
|
||||
0
|
||||
|
@ -1487,7 +1488,7 @@ AS SELECT *
|
|||
FROM information_schema.tables;
|
||||
SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS where TABLE_NAME = 'v1';
|
||||
VIEW_DEFINITION
|
||||
select `tables`.`TABLE_CATALOG` AS `TABLE_CATALOG`,`tables`.`TABLE_SCHEMA` AS `TABLE_SCHEMA`,`tables`.`TABLE_NAME` AS `TABLE_NAME`,`tables`.`TABLE_TYPE` AS `TABLE_TYPE`,`tables`.`ENGINE` AS `ENGINE`,`tables`.`VERSION` AS `VERSION`,`tables`.`ROW_FORMAT` AS `ROW_FORMAT`,`tables`.`TABLE_ROWS` AS `TABLE_ROWS`,`tables`.`AVG_ROW_LENGTH` AS `AVG_ROW_LENGTH`,`tables`.`DATA_LENGTH` AS `DATA_LENGTH`,`tables`.`MAX_DATA_LENGTH` AS `MAX_DATA_LENGTH`,`tables`.`INDEX_LENGTH` AS `INDEX_LENGTH`,`tables`.`DATA_FREE` AS `DATA_FREE`,`tables`.`AUTO_INCREMENT` AS `AUTO_INCREMENT`,`tables`.`CREATE_TIME` AS `CREATE_TIME`,`tables`.`UPDATE_TIME` AS `UPDATE_TIME`,`tables`.`CHECK_TIME` AS `CHECK_TIME`,`tables`.`TABLE_COLLATION` AS `TABLE_COLLATION`,`tables`.`CHECKSUM` AS `CHECKSUM`,`tables`.`CREATE_OPTIONS` AS `CREATE_OPTIONS`,`tables`.`TABLE_COMMENT` AS `TABLE_COMMENT` from `information_schema`.`tables`
|
||||
select `information_schema`.`tables`.`TABLE_CATALOG` AS `TABLE_CATALOG`,`information_schema`.`tables`.`TABLE_SCHEMA` AS `TABLE_SCHEMA`,`information_schema`.`tables`.`TABLE_NAME` AS `TABLE_NAME`,`information_schema`.`tables`.`TABLE_TYPE` AS `TABLE_TYPE`,`information_schema`.`tables`.`ENGINE` AS `ENGINE`,`information_schema`.`tables`.`VERSION` AS `VERSION`,`information_schema`.`tables`.`ROW_FORMAT` AS `ROW_FORMAT`,`information_schema`.`tables`.`TABLE_ROWS` AS `TABLE_ROWS`,`information_schema`.`tables`.`AVG_ROW_LENGTH` AS `AVG_ROW_LENGTH`,`information_schema`.`tables`.`DATA_LENGTH` AS `DATA_LENGTH`,`information_schema`.`tables`.`MAX_DATA_LENGTH` AS `MAX_DATA_LENGTH`,`information_schema`.`tables`.`INDEX_LENGTH` AS `INDEX_LENGTH`,`information_schema`.`tables`.`DATA_FREE` AS `DATA_FREE`,`information_schema`.`tables`.`AUTO_INCREMENT` AS `AUTO_INCREMENT`,`information_schema`.`tables`.`CREATE_TIME` AS `CREATE_TIME`,`information_schema`.`tables`.`UPDATE_TIME` AS `UPDATE_TIME`,`information_schema`.`tables`.`CHECK_TIME` AS `CHECK_TIME`,`information_schema`.`tables`.`TABLE_COLLATION` AS `TABLE_COLLATION`,`information_schema`.`tables`.`CHECKSUM` AS `CHECKSUM`,`information_schema`.`tables`.`CREATE_OPTIONS` AS `CREATE_OPTIONS`,`information_schema`.`tables`.`TABLE_COMMENT` AS `TABLE_COMMENT` from `information_schema`.`tables`
|
||||
DROP VIEW v1;
|
||||
SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA
|
||||
WHERE SCHEMA_NAME ='information_schema';
|
||||
|
@ -1643,3 +1644,66 @@ TEST_RESULT
|
|||
OK
|
||||
SET TIMESTAMP=DEFAULT;
|
||||
End of 5.1 tests.
|
||||
create table information_schema.t1 (f1 INT);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
drop table information_schema.t1;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
drop temporary table if exists information_schema.t1;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
create temporary table information_schema.t1 (f1 INT);
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
drop view information_schema.v1;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
create view information_schema.v1;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
create trigger mysql.trg1 after insert on information_schema.t1 for each row set @a=1;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
create table t1 select * from information_schema.t1;
|
||||
ERROR 42S02: Unknown table 't1' in information_schema
|
||||
CREATE TABLE t1(f1 char(100));
|
||||
REPAIR TABLE t1, information_schema.tables;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CHECKSUM TABLE t1, information_schema.tables;
|
||||
Table Checksum
|
||||
test.t1 0
|
||||
information_schema.tables 0
|
||||
ANALYZE TABLE t1, information_schema.tables;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
CHECK TABLE t1, information_schema.tables;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
information_schema.tables check note The storage engine for the table doesn't support check
|
||||
OPTIMIZE TABLE t1, information_schema.tables;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
RENAME TABLE v1 to v2, information_schema.tables to t2;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE t1, information_schema.tables;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
LOCK TABLES t1 READ, information_schema.tables READ;
|
||||
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
|
||||
DROP TABLE t1;
|
||||
EXPLAIN SELECT * FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE KEY_COLUMN_USAGE ALL NULL NULL NULL NULL NULL Open_full_table; Scanned all databases
|
||||
EXPLAIN SELECT * FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME='t1';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE PARTITIONS ALL NULL TABLE_NAME NULL NULL NULL Using where; Open_full_table; Scanned 1 database
|
||||
EXPLAIN SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS
|
||||
WHERE CONSTRAINT_SCHEMA='test';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE REFERENTIAL_CONSTRAINTS ALL NULL CONSTRAINT_SCHEMA NULL NULL NULL Using where; Open_full_table; Scanned 1 database
|
||||
EXPLAIN SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS
|
||||
WHERE TABLE_NAME='t1' and TABLE_SCHEMA='test';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE TABLE_CONSTRAINTS ALL NULL TABLE_SCHEMA,TABLE_NAME NULL NULL NULL Using where; Open_full_table; Scanned 0 databases
|
||||
EXPLAIN SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
|
||||
WHERE EVENT_OBJECT_SCHEMA='test';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE TRIGGERS ALL NULL EVENT_OBJECT_SCHEMA NULL NULL NULL Using where; Open_full_table; Scanned 1 database
|
||||
SELECT *
|
||||
FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
|
||||
LEFT JOIN INFORMATION_SCHEMA.COLUMNS
|
||||
USING (TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME)
|
||||
WHERE COLUMNS.TABLE_SCHEMA = 'test'
|
||||
AND COLUMNS.TABLE_NAME = 't1';
|
||||
TABLE_SCHEMA TABLE_NAME COLUMN_NAME CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME TABLE_CATALOG ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
|
||||
|
|
|
@ -3,7 +3,7 @@ drop view if exists v1,v2;
|
|||
drop function if exists f1;
|
||||
drop function if exists f2;
|
||||
use INFORMATION_SCHEMA;
|
||||
show tables where Tables_in_information_schema not like "Innodb%";
|
||||
show tables where Tables_in_information_schema NOT LIKE 'Innodb%';
|
||||
Tables_in_information_schema
|
||||
CHARACTER_SETS
|
||||
COLLATIONS
|
||||
|
@ -119,12 +119,12 @@ create table t1 (f1 char(4));
|
|||
create view v1 as select f1 from t1;
|
||||
grant insert on v1 to testdb_2@localhost;
|
||||
create view v5 as select f1 from t1;
|
||||
grant show view on v5 to testdb_2@localhost;
|
||||
grant select, show view on v5 to testdb_2@localhost;
|
||||
create definer=`no_such_user`@`no_such_host` view v6 as select f1 from t1;
|
||||
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
|
||||
use testdb_1;
|
||||
create view v6 as select f1 from t1;
|
||||
grant show view on v6 to testdb_2@localhost;
|
||||
grant select, show view on v6 to testdb_2@localhost;
|
||||
create table t2 (f1 char(4));
|
||||
create definer=`no_such_user`@`no_such_host` view v7 as select * from t2;
|
||||
Warnings:
|
||||
|
@ -152,11 +152,13 @@ create view v2 as select f1 from testdb_1.v1;
|
|||
create view v4 as select f1,f2 from testdb_1.v3;
|
||||
show fields from testdb_1.v5;
|
||||
Field Type Null Key Default Extra
|
||||
f1 char(4) YES NULL
|
||||
show create view testdb_1.v5;
|
||||
View Create View character_set_client collation_connection
|
||||
v5 CREATE ALGORITHM=UNDEFINED DEFINER=`testdb_1`@`localhost` SQL SECURITY DEFINER VIEW `testdb_1`.`v5` AS select `testdb_1`.`t1`.`f1` AS `f1` from `testdb_1`.`t1` latin1 latin1_swedish_ci
|
||||
show fields from testdb_1.v6;
|
||||
Field Type Null Key Default Extra
|
||||
f1 char(4) YES NULL
|
||||
show create view testdb_1.v6;
|
||||
View Create View character_set_client collation_connection
|
||||
v6 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `testdb_1`.`v6` AS select `testdb_1`.`t1`.`f1` AS `f1` from `testdb_1`.`t1` latin1 latin1_swedish_ci
|
||||
|
@ -171,9 +173,9 @@ v7 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such_user`@`no_such_host` SQL SECURITY
|
|||
Warnings:
|
||||
Note 1449 The user specified as a definer ('no_such_user'@'no_such_host') does not exist
|
||||
revoke insert(f1) on v3 from testdb_2@localhost;
|
||||
revoke show view on v5 from testdb_2@localhost;
|
||||
revoke select,show view on v5 from testdb_2@localhost;
|
||||
use testdb_1;
|
||||
revoke show view on v6 from testdb_2@localhost;
|
||||
revoke select,show view on v6 from testdb_2@localhost;
|
||||
show fields from testdb_1.v5;
|
||||
ERROR 42000: SELECT command denied to user 'testdb_2'@'localhost' for table 'v5'
|
||||
show create view testdb_1.v5;
|
||||
|
@ -203,7 +205,7 @@ show create view v2;
|
|||
View Create View character_set_client collation_connection
|
||||
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`testdb_2`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `v1`.`f1` AS `f1` from `testdb_1`.`v1` latin1 latin1_swedish_ci
|
||||
show create view testdb_1.v1;
|
||||
ERROR 42000: SHOW VIEW command denied to user 'testdb_2'@'localhost' for table 'v1'
|
||||
ERROR 42000: SELECT command denied to user 'testdb_2'@'localhost' for table 'v1'
|
||||
select table_name from information_schema.columns a
|
||||
where a.table_name = 'v2';
|
||||
table_name
|
||||
|
|
|
@ -8,22 +8,22 @@ FOREIGN KEY (id, t2_id) REFERENCES t2(t1_id, id) ON DELETE CASCADE) ENGINE=INNO
|
|||
select * from information_schema.TABLE_CONSTRAINTS where
|
||||
TABLE_SCHEMA= "test";
|
||||
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
|
||||
NULL test PRIMARY test t1 PRIMARY KEY
|
||||
NULL test PRIMARY test t2 PRIMARY KEY
|
||||
NULL test t2_ibfk_1 test t2 FOREIGN KEY
|
||||
NULL test t2_ibfk_2 test t2 FOREIGN KEY
|
||||
NULL test PRIMARY test t3 PRIMARY KEY
|
||||
NULL test t3_ibfk_1 test t3 FOREIGN KEY
|
||||
def test PRIMARY test t1 PRIMARY KEY
|
||||
def test PRIMARY test t2 PRIMARY KEY
|
||||
def test t2_ibfk_1 test t2 FOREIGN KEY
|
||||
def test t2_ibfk_2 test t2 FOREIGN KEY
|
||||
def test PRIMARY test t3 PRIMARY KEY
|
||||
def test t3_ibfk_1 test t3 FOREIGN KEY
|
||||
select * from information_schema.KEY_COLUMN_USAGE where
|
||||
TABLE_SCHEMA= "test";
|
||||
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 test PRIMARY NULL test t1 id 1 NULL NULL NULL NULL
|
||||
NULL test PRIMARY NULL test t2 id 1 NULL NULL NULL NULL
|
||||
NULL test t2_ibfk_1 NULL test t2 t1_id 1 1 test t1 id
|
||||
NULL test t2_ibfk_2 NULL test t2 t1_id 1 1 test t1 id
|
||||
NULL test PRIMARY NULL test t3 id 1 NULL NULL NULL NULL
|
||||
NULL test t3_ibfk_1 NULL test t3 id 1 1 test t2 t1_id
|
||||
NULL test t3_ibfk_1 NULL test t3 t2_id 2 2 test t2 id
|
||||
def test PRIMARY def test t1 id 1 NULL NULL NULL NULL
|
||||
def test PRIMARY def test t2 id 1 NULL NULL NULL NULL
|
||||
def test t2_ibfk_1 def test t2 t1_id 1 1 test t1 id
|
||||
def test t2_ibfk_2 def test t2 t1_id 1 1 test t1 id
|
||||
def test PRIMARY def test t3 id 1 NULL NULL NULL NULL
|
||||
def test t3_ibfk_1 def test t3 id 1 1 test t2 t1_id
|
||||
def test t3_ibfk_1 def test t3 t2_id 2 2 test t2 id
|
||||
drop table t3, t2, t1;
|
||||
CREATE TABLE t1(a1 INT NOT NULL, a2 INT NOT NULL,
|
||||
PRIMARY KEY(a1, a2)) ENGINE=INNODB;
|
||||
|
|
|
@ -7,9 +7,9 @@ partition x3 values in (16, 8, 5+19, 70-43) tablespace ts3);
|
|||
select * from information_schema.partitions where table_schema="test"
|
||||
and table_name="t1";
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
|
||||
NULL test t1 x1 NULL 1 NULL LIST NULL b*a NULL 1 0 0 0 # 1024 0 # # NULL NULL default ts1
|
||||
NULL test t1 x2 NULL 2 NULL LIST NULL b*a NULL 3,11,5,7 0 0 0 # 1024 0 # # NULL NULL default ts2
|
||||
NULL test t1 x3 NULL 3 NULL LIST NULL b*a NULL 16,8,24,27 0 0 0 # 1024 0 # # NULL NULL default ts3
|
||||
def test t1 x1 NULL 1 NULL LIST NULL b*a NULL 1 0 0 0 # 1024 0 # # NULL NULL default ts1
|
||||
def test t1 x2 NULL 2 NULL LIST NULL b*a NULL 3,11,5,7 0 0 0 # 1024 0 # # NULL NULL default ts2
|
||||
def test t1 x3 NULL 3 NULL LIST NULL b*a NULL 16,8,24,27 0 0 0 # 1024 0 # # NULL NULL default ts3
|
||||
create table t2 (a int not null,b int not null,c int not null, primary key(a,b))
|
||||
partition by range (a)
|
||||
partitions 3
|
||||
|
@ -19,27 +19,27 @@ partition x3 values less than maxvalue tablespace ts3);
|
|||
select * from information_schema.partitions where table_schema="test"
|
||||
and table_name="t2";
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
|
||||
NULL test t2 x1 NULL 1 NULL RANGE NULL a NULL 5 0 0 0 # 1024 0 # # NULL NULL default ts1
|
||||
NULL test t2 x2 NULL 2 NULL RANGE NULL a NULL 10 0 0 0 # 1024 0 # # NULL NULL default ts2
|
||||
NULL test t2 x3 NULL 3 NULL RANGE NULL a NULL MAXVALUE 0 0 0 # 1024 0 # # NULL NULL default ts3
|
||||
def test t2 x1 NULL 1 NULL RANGE NULL a NULL 5 0 0 0 # 1024 0 # # NULL NULL default ts1
|
||||
def test t2 x2 NULL 2 NULL RANGE NULL a NULL 10 0 0 0 # 1024 0 # # NULL NULL default ts2
|
||||
def test t2 x3 NULL 3 NULL RANGE NULL a NULL MAXVALUE 0 0 0 # 1024 0 # # NULL NULL default ts3
|
||||
create table t3 (f1 date)
|
||||
partition by hash(month(f1))
|
||||
partitions 3;
|
||||
select * from information_schema.partitions where table_schema="test"
|
||||
and table_name="t3";
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
|
||||
NULL test t3 p0 NULL 1 NULL HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
|
||||
NULL test t3 p1 NULL 2 NULL HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
|
||||
NULL test t3 p2 NULL 3 NULL HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
|
||||
def test t3 p0 NULL 1 NULL HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
|
||||
def test t3 p1 NULL 2 NULL HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
|
||||
def test t3 p2 NULL 3 NULL HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
|
||||
create table t4 (f1 date, f2 int)
|
||||
partition by key(f1,f2)
|
||||
partitions 3;
|
||||
select * from information_schema.partitions where table_schema="test"
|
||||
and table_name="t4";
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
|
||||
NULL test t4 p0 NULL 1 NULL KEY NULL f1,f2 NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
|
||||
NULL test t4 p1 NULL 2 NULL KEY NULL f1,f2 NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
|
||||
NULL test t4 p2 NULL 3 NULL KEY NULL f1,f2 NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
|
||||
def test t4 p0 NULL 1 NULL KEY NULL f1,f2 NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
|
||||
def test t4 p1 NULL 2 NULL KEY NULL f1,f2 NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
|
||||
def test t4 p2 NULL 3 NULL KEY NULL f1,f2 NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
|
||||
drop table t1,t2,t3,t4;
|
||||
create table t1 (a int not null,b int not null,c int not null,primary key (a,b))
|
||||
partition by range (a)
|
||||
|
@ -63,14 +63,14 @@ subpartition x22 tablespace t2)
|
|||
);
|
||||
select * from information_schema.partitions where table_schema="test";
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
|
||||
NULL test t1 x1 x11 1 1 RANGE HASH a a+b 1 0 0 0 # 1024 0 # # NULL NULL default t1
|
||||
NULL test t1 x1 x12 1 2 RANGE HASH a a+b 1 0 0 0 # 1024 0 # # NULL NULL default t2
|
||||
NULL test t1 x2 x21 2 1 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL default t1
|
||||
NULL test t1 x2 x22 2 2 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL default t2
|
||||
NULL test t2 x1 x11 1 1 RANGE KEY a a 1 0 0 0 # 1024 0 # # NULL NULL default t1
|
||||
NULL test t2 x1 x12 1 2 RANGE KEY a a 1 0 0 0 # 1024 0 # # NULL NULL default t2
|
||||
NULL test t2 x2 x21 2 1 RANGE KEY a a 5 0 0 0 # 1024 0 # # NULL NULL default t1
|
||||
NULL test t2 x2 x22 2 2 RANGE KEY a a 5 0 0 0 # 1024 0 # # NULL NULL default t2
|
||||
def test t1 x1 x11 1 1 RANGE HASH a a+b 1 0 0 0 # 1024 0 # # NULL NULL default t1
|
||||
def test t1 x1 x12 1 2 RANGE HASH a a+b 1 0 0 0 # 1024 0 # # NULL NULL default t2
|
||||
def test t1 x2 x21 2 1 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL default t1
|
||||
def test t1 x2 x22 2 2 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL default t2
|
||||
def test t2 x1 x11 1 1 RANGE KEY a a 1 0 0 0 # 1024 0 # # NULL NULL default t1
|
||||
def test t2 x1 x12 1 2 RANGE KEY a a 1 0 0 0 # 1024 0 # # NULL NULL default t2
|
||||
def test t2 x2 x21 2 1 RANGE KEY a a 5 0 0 0 # 1024 0 # # NULL NULL default t1
|
||||
def test t2 x2 x22 2 2 RANGE KEY a a 5 0 0 0 # 1024 0 # # NULL NULL default t2
|
||||
drop table t1,t2;
|
||||
create table t1 (
|
||||
a int not null,
|
||||
|
@ -88,10 +88,10 @@ subpartition x22 tablespace t2 nodegroup 1)
|
|||
);
|
||||
select * from information_schema.partitions where table_schema="test";
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
|
||||
NULL test t1 x1 x11 1 1 RANGE HASH a a+b 1 0 0 0 # 1024 0 # # NULL NULL 0 t1
|
||||
NULL test t1 x1 x12 1 2 RANGE HASH a a+b 1 0 0 0 # 1024 0 # # NULL NULL 1 t2
|
||||
NULL test t1 x2 x21 2 1 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL 0 t1
|
||||
NULL test t1 x2 x22 2 2 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL 1 t2
|
||||
def test t1 x1 x11 1 1 RANGE HASH a a+b 1 0 0 0 # 1024 0 # # NULL NULL 0 t1
|
||||
def test t1 x1 x12 1 2 RANGE HASH a a+b 1 0 0 0 # 1024 0 # # NULL NULL 1 t2
|
||||
def test t1 x2 x21 2 1 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL 0 t1
|
||||
def test t1 x2 x22 2 2 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL 1 t2
|
||||
show tables;
|
||||
Tables_in_test
|
||||
t1
|
||||
|
@ -99,7 +99,7 @@ drop table t1;
|
|||
create table t1(f1 int, f2 int);
|
||||
select * from information_schema.partitions where table_schema="test";
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
|
||||
NULL test t1 NULL NULL NULL NULL NULL NULL NULL NULL NULL 0 0 0 # 1024 0 # # NULL NULL NULL
|
||||
def test t1 NULL NULL NULL NULL NULL NULL NULL NULL NULL 0 0 0 # 1024 0 # # NULL NULL NULL
|
||||
drop table t1;
|
||||
create table t1 (f1 date)
|
||||
partition by linear hash(month(f1))
|
||||
|
@ -107,9 +107,9 @@ partitions 3;
|
|||
select * from information_schema.partitions where table_schema="test"
|
||||
and table_name="t1";
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
|
||||
NULL test t1 p0 NULL 1 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
|
||||
NULL test t1 p1 NULL 2 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
|
||||
NULL test t1 p2 NULL 3 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
|
||||
def test t1 p0 NULL 1 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
|
||||
def test t1 p1 NULL 2 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
|
||||
def test t1 p2 NULL 3 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
|
||||
drop table t1;
|
||||
create table t1 (a int)
|
||||
PARTITION BY RANGE (a)
|
||||
|
|
|
@ -2210,3 +2210,23 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||
1 SIMPLE t1 index NULL PRIMARY 4 NULL 128 Using where
|
||||
DROP TABLE t1;
|
||||
End of 5.1 tests
|
||||
#
|
||||
# Test for bug #39932 "create table fails if column for FK is in different
|
||||
# case than in corr index".
|
||||
#
|
||||
drop tables if exists t1, t2;
|
||||
create table t1 (pk int primary key) engine=InnoDB;
|
||||
# Even although the below statement uses uppercased field names in
|
||||
# foreign key definition it still should be able to find explicitly
|
||||
# created supporting index. So it should succeed and should not
|
||||
# create any additional supporting indexes.
|
||||
create table t2 (fk int, key x (fk),
|
||||
constraint x foreign key (FK) references t1 (PK)) engine=InnoDB;
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`fk` int(11) DEFAULT NULL,
|
||||
KEY `x` (`fk`),
|
||||
CONSTRAINT `x` FOREIGN KEY (`fk`) REFERENCES `t1` (`pk`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
drop table t2, t1;
|
||||
|
|
|
@ -355,17 +355,17 @@ insert into t2 values (1,12), (2,24);
|
|||
insert into v1 (f1) values (3) on duplicate key update f3= f3 + 10;
|
||||
ERROR HY000: Can not modify more than one base table through a join view 'test.v1'
|
||||
insert into v1 (f1) values (3) on duplicate key update f1= f3 + 10;
|
||||
ERROR HY000: Can not modify more than one base table through a join view 'test.v1'
|
||||
select * from t1;
|
||||
f1 f2
|
||||
1 11
|
||||
2 22
|
||||
3 NULL
|
||||
insert into v1 (f1) values (3) on duplicate key update f1= f3 + 10;
|
||||
ERROR HY000: Can not modify more than one base table through a join view 'test.v1'
|
||||
select * from t1;
|
||||
f1 f2
|
||||
1 11
|
||||
2 22
|
||||
12 NULL
|
||||
drop view v1;
|
||||
drop table t1,t2;
|
||||
create table t1 (id int primary key auto_increment, data int, unique(data));
|
||||
|
@ -639,3 +639,43 @@ CREATE TABLE t2(f1 CHAR(1));
|
|||
INSERT INTO t2 SELECT f1 FROM t1;
|
||||
DROP TABLE t1, t2;
|
||||
End of 5.0 tests.
|
||||
#
|
||||
# Bug#34898 "mysql_info() reports 0 warnings while
|
||||
# mysql_warning_count() reports 1"
|
||||
# Check that the number of warnings reported by
|
||||
# mysql_info() is correct.
|
||||
#
|
||||
drop table if exists t1;
|
||||
create table t1 (data varchar(4) not null);
|
||||
set sql_mode='error_for_division_by_zero';
|
||||
#
|
||||
# Demonstrate that the number of warnings matches
|
||||
# the information in mysql_info().
|
||||
#
|
||||
insert t1 (data) values ('letter'), (1/0);
|
||||
affected rows: 2
|
||||
info: Records: 2 Duplicates: 0 Warnings: 3
|
||||
Warnings:
|
||||
Warning 1265 Data truncated for column 'data' at row 1
|
||||
Warning 1365 Division by 0
|
||||
Warning 1048 Column 'data' cannot be null
|
||||
update t1 set data='envelope' where 1/0 or 1;
|
||||
affected rows: 2
|
||||
info: Rows matched: 2 Changed: 2 Warnings: 3
|
||||
Warnings:
|
||||
Warning 1365 Division by 0
|
||||
Warning 1265 Data truncated for column 'data' at row 1
|
||||
Warning 1265 Data truncated for column 'data' at row 2
|
||||
insert t1 (data) values (default), (1/0), ('dead beef');
|
||||
affected rows: 3
|
||||
info: Records: 3 Duplicates: 0 Warnings: 4
|
||||
Warnings:
|
||||
Warning 1364 Field 'data' doesn't have a default value
|
||||
Warning 1365 Division by 0
|
||||
Warning 1048 Column 'data' cannot be null
|
||||
Warning 1265 Data truncated for column 'data' at row 3
|
||||
set sql_mode=default;
|
||||
drop table t1;
|
||||
#
|
||||
# End of 5.4 tests
|
||||
#
|
||||
|
|
|
@ -752,8 +752,8 @@ statistics.TABLE_NAME, statistics.COLUMN_NAME, statistics.TABLE_CATALOG, statist
|
|||
columns.TABLE_CATALOG, columns.TABLE_SCHEMA, columns.COLUMN_DEFAULT, columns.IS_NULLABLE, columns.DATA_TYPE, columns.CHARACTER_MAXIMUM_LENGTH, columns.CHARACTER_OCTET_LENGTH, columns.NUMERIC_PRECISION, columns.NUMERIC_SCALE, columns.CHARACTER_SET_NAME, columns.COLLATION_NAME, columns.COLUMN_TYPE, columns.COLUMN_KEY, columns.EXTRA, columns.COLUMN_COMMENT
|
||||
from information_schema.statistics join information_schema.columns using(table_name,column_name) where table_name='user';
|
||||
TABLE_NAME COLUMN_NAME TABLE_CATALOG TABLE_SCHEMA NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLLATION SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT TABLE_CATALOG TABLE_SCHEMA 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
|
||||
user Host NULL mysql 0 mysql PRIMARY 1 A NULL NULL BTREE NULL mysql NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
|
||||
user User NULL mysql 0 mysql PRIMARY 2 A NULL NULL BTREE NULL mysql NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI
|
||||
user Host def mysql 0 mysql PRIMARY 1 A NULL NULL BTREE def mysql NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
|
||||
user User def mysql 0 mysql PRIMARY 2 A NULL NULL BTREE def mysql NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
drop table t3;
|
||||
|
|
37
mysql-test/r/join_optimizer.result
Normal file
37
mysql-test/r/join_optimizer.result
Normal file
|
@ -0,0 +1,37 @@
|
|||
drop table if exists t0,t1,t2,t3;
|
||||
#
|
||||
# BUG#38049 incorrect rows estimations with references from preceding table
|
||||
#
|
||||
create table t0 (a int);
|
||||
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
create table t1 (a varchar(32));
|
||||
insert into t1 values ('owner'),('requester'),('admincc'),('cc');
|
||||
CREATE TABLE t2 (
|
||||
id int(11) NOT NULL,
|
||||
type varchar(32) default NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
insert into t2 values (1,'owner'), (2,'admincc');
|
||||
CREATE TABLE t3 (
|
||||
id int(11) NOT NULL,
|
||||
domain varchar(32) default NULL,
|
||||
type varchar(32) default NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
set @domain='system';
|
||||
set @pk=0;
|
||||
INSERT INTO t3 select @pk:=@pk+1, 'system', t1.a from t1;
|
||||
INSERT INTO t3 select @pk:=@pk+1, 'queue', t1.a from t1, t0 where t0.a<3;
|
||||
INSERT INTO t3 select @pk:=@pk+1, 'ticket', t1.a from t1, t0 A, t0 B, t0 C;
|
||||
CREATE INDEX groups_d ON t3(domain);
|
||||
CREATE INDEX groups_t ON t3(type);
|
||||
CREATE INDEX groups_td ON t3(type, domain);
|
||||
CREATE INDEX groups_dt ON t3(domain, type);
|
||||
For table g this must use ref(groups_dt) and #rows should be around 15 and not 335:
|
||||
explain
|
||||
SELECT STRAIGHT_JOIN g.id FROM t2 a, t3 g USE INDEX(groups_dt)
|
||||
WHERE g.domain = 'queue' AND g.type = a.type;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE a ALL NULL NULL NULL NULL 2
|
||||
1 SIMPLE g ref groups_dt groups_dt 70 const,test.a.type 13 Using where
|
||||
drop table t0,t1,t2,t3;
|
|
@ -49,11 +49,18 @@ DROP TABLE t1;
|
|||
#
|
||||
# Bug#46633 Obsolete Serbian locale name
|
||||
#
|
||||
set lc_messages=sr_YU;
|
||||
ERROR HY000: Unknown locale: 'sr_YU'
|
||||
set lc_messages=sr_RS;
|
||||
set lc_time_names=sr_RS;
|
||||
select format(123456.789, 3, 'sr_RS');
|
||||
SET lc_messages=sr_YU;
|
||||
Warnings:
|
||||
Warning 1287 'sr_YU' is deprecated; use 'sr_RS' instead
|
||||
SHOW VARIABLES LIKE 'lc_messages';
|
||||
Variable_name Value
|
||||
lc_messages sr_RS
|
||||
SET lc_messages=sr_RS;
|
||||
SHOW VARIABLES LIKE 'lc_messages';
|
||||
Variable_name Value
|
||||
lc_messages sr_RS
|
||||
SET lc_time_names=sr_RS;
|
||||
SELECT format(123456.789, 3, 'sr_RS');
|
||||
format(123456.789, 3, 'sr_RS')
|
||||
123456.789
|
||||
End of 5.4 tests
|
||||
|
|
66
mysql-test/r/lock_sync.result
Normal file
66
mysql-test/r/lock_sync.result
Normal file
|
@ -0,0 +1,66 @@
|
|||
#
|
||||
# Test for bug #45143 "All connections hang on concurrent ALTER TABLE".
|
||||
#
|
||||
# Concurrent execution of statements which required weak write lock
|
||||
# (TL_WRITE_ALLOW_WRITE) on several instances of the same table and
|
||||
# statements which tried to acquire stronger write lock (TL_WRITE,
|
||||
# TL_WRITE_ALLOW_READ) on this table might have led to deadlock.
|
||||
drop table if exists t1;
|
||||
# Create auxiliary connections used through the test.
|
||||
# Reset DEBUG_SYNC facility before using it.
|
||||
set debug_sync= 'RESET';
|
||||
# Turn off logging so calls to locking subsystem performed
|
||||
# for general_log table won't interfere with our test.
|
||||
set @old_general_log = @@global.general_log;
|
||||
set @@global.general_log= OFF;
|
||||
create table t1 (i int) engine=InnoDB;
|
||||
insert into t1 values (1);
|
||||
# Prepare user lock which will be used for resuming execution of
|
||||
# the first statement after it acquires TL_WRITE_ALLOW_WRITE lock.
|
||||
select get_lock("lock_bug45143_wait", 0);
|
||||
get_lock("lock_bug45143_wait", 0)
|
||||
1
|
||||
# Switch to connection 'con_bug45143_1'.
|
||||
# Sending:
|
||||
insert into t1 values (get_lock("lock_bug45143_wait", 100));;
|
||||
# Switch to connection 'con_bug45143_2'.
|
||||
# Wait until the above INSERT takes TL_WRITE_ALLOW_WRITE lock on 't1'
|
||||
# and then gets blocked on user lock 'lock_bug45143_wait'.
|
||||
# Ensure that upcoming SELECT waits after acquiring TL_WRITE_ALLOW_WRITE
|
||||
# lock for the first instance of 't1'.
|
||||
set debug_sync='thr_multi_lock_after_thr_lock SIGNAL parked WAIT_FOR go';
|
||||
# Sending:
|
||||
select count(*) > 0 from t1 as a, t1 as b for update;;
|
||||
# Switch to connection 'con_bug45143_3'.
|
||||
# Wait until the above SELECT ... FOR UPDATE is blocked after
|
||||
# acquiring lock for the the first instance of 't1'.
|
||||
set debug_sync= 'now WAIT_FOR parked';
|
||||
# Send LOCK TABLE statement which will try to get TL_WRITE lock on 't1':
|
||||
lock table t1 write;;
|
||||
# Switch to connection 'default'.
|
||||
# Wait until this LOCK TABLES statement starts waiting for table lock.
|
||||
# Allow SELECT ... FOR UPDATE to resume.
|
||||
# Since it already has TL_WRITE_ALLOW_WRITE lock on the first instance
|
||||
# of 't1' it should be able to get lock on the second instance without
|
||||
# waiting, even although there is another thread which has such lock
|
||||
# on this table and also there is a thread waiting for a TL_WRITE on it.
|
||||
set debug_sync= 'now SIGNAL go';
|
||||
# Switch to connection 'con_bug45143_2'.
|
||||
# Reap SELECT ... FOR UPDATE
|
||||
count(*) > 0
|
||||
1
|
||||
# Switch to connection 'default'.
|
||||
# Resume execution of the INSERT statement.
|
||||
select release_lock("lock_bug45143_wait");
|
||||
release_lock("lock_bug45143_wait")
|
||||
1
|
||||
# Switch to connection 'con_bug45143_1'.
|
||||
# Reap INSERT statement.
|
||||
# Switch to connection 'con_bug45143_3'.
|
||||
# Reap LOCK TABLES statement.
|
||||
unlock tables;
|
||||
# Switch to connection 'default'.
|
||||
# Do clean-up.
|
||||
set debug_sync= 'RESET';
|
||||
set @@global.general_log= @old_general_log;
|
||||
drop table t1;
|
|
@ -309,6 +309,30 @@ SET @@global.general_log_file = @old_general_log_file;
|
|||
SET @@global.slow_query_log = @old_slow_query_log;
|
||||
SET @@global.slow_query_log_file = @old_slow_query_log_file;
|
||||
End of 5.1 tests
|
||||
|
||||
# --
|
||||
# -- Bug#38124: "general_log_file" variable silently unset when
|
||||
# -- using expression
|
||||
# --
|
||||
SET GLOBAL general_log_file = DEFAULT;
|
||||
SELECT @@general_log_file INTO @my_glf;
|
||||
SET GLOBAL general_log_file = 'BUG38124.LOG';
|
||||
SELECT @@general_log_file;
|
||||
@@general_log_file
|
||||
BUG38124.LOG
|
||||
SET GLOBAL general_log_file = concat('BUG38124-2.LOG');
|
||||
SELECT @@general_log_file;
|
||||
@@general_log_file
|
||||
BUG38124-2.LOG
|
||||
SET GLOBAL general_log_file = substr('BUG38124-2.LOG',3,6);
|
||||
SELECT @@general_log_file;
|
||||
@@general_log_file
|
||||
G38124
|
||||
SET GLOBAL general_log_file = DEFAULT;
|
||||
SELECT @@general_log_file = @my_glf;
|
||||
@@general_log_file = @my_glf
|
||||
1
|
||||
SET GLOBAL general_log_file = @old_general_log_file;
|
||||
# Close connection con1
|
||||
SET global general_log = @old_general_log;
|
||||
SET global general_log_file = @old_general_log_file;
|
||||
|
|
3
mysql-test/r/log_state_bug33693.result
Normal file
3
mysql-test/r/log_state_bug33693.result
Normal file
|
@ -0,0 +1,3 @@
|
|||
SELECT INSTR(@@general_log_file, 'MYSQLTEST_VARDIR/run');;
|
||||
INSTR(@@general_log_file, 'MYSQLTEST_VARDIR/run')
|
||||
0
|
|
@ -174,3 +174,74 @@ TABLE_SCHEMA TABLE_NAME
|
|||
mysqltest_LC2 myUC
|
||||
use test;
|
||||
drop database mysqltest_LC2;
|
||||
# End of 5.1 tests
|
||||
#
|
||||
# Test for bug #44738 "fill_schema_table_from_frm() opens tables without
|
||||
# lowercasing table name". Due to not properly normalizing table names
|
||||
# in lower_case_table_names modes in this function queries to I_S which
|
||||
# were executed through it left entries with incorrect key in table
|
||||
# definition cache. As result further queries to I_S that used this
|
||||
# function produced stale results in cases when table definition was
|
||||
# changed by a DDL statement. Also combination of this issue and a
|
||||
# similar problem in CREATE TABLE (it also has peeked into table
|
||||
# definition cache using non-normalized key) led to spurious
|
||||
# ER_TABLE_EXISTS_ERROR errors when one tried to create table with the
|
||||
# same name as a previously existing but dropped table.
|
||||
#
|
||||
drop database if exists mysqltest_UPPERCASE;
|
||||
drop table if exists t_bug44738_UPPERCASE;
|
||||
create database mysqltest_UPPERCASE;
|
||||
use mysqltest_UPPERCASE;
|
||||
create table t_bug44738_UPPERCASE (i int) comment='Old comment';
|
||||
create table t_bug44738_lowercase (i int) comment='Old comment';
|
||||
select table_schema, table_name, table_comment from information_schema.tables
|
||||
where table_schema like 'mysqltest_%' and table_name like 't_bug44738_%'
|
||||
order by table_name;
|
||||
table_schema table_name table_comment
|
||||
mysqltest_UPPERCASE t_bug44738_lowercase Old comment
|
||||
mysqltest_UPPERCASE t_bug44738_UPPERCASE Old comment
|
||||
alter table t_bug44738_UPPERCASE comment='New comment';
|
||||
alter table t_bug44738_lowercase comment='New comment';
|
||||
# There should be no stale entries in TDC for our tables after the
|
||||
# above ALTER TABLE statements so new version of comments should be
|
||||
# returned by the below query to I_S.
|
||||
select table_schema, table_name, table_comment from information_schema.tables
|
||||
where table_schema like 'mysqltest_%' and table_name like 't_bug44738_%'
|
||||
order by table_name;
|
||||
table_schema table_name table_comment
|
||||
mysqltest_UPPERCASE t_bug44738_lowercase New comment
|
||||
mysqltest_UPPERCASE t_bug44738_UPPERCASE New comment
|
||||
drop database mysqltest_UPPERCASE;
|
||||
use test;
|
||||
# Let us check that the original test case which led to discovery
|
||||
# of this problem also works.
|
||||
create table t_bug44738_UPPERCASE (i int);
|
||||
select table_schema, table_name, table_comment from information_schema.tables
|
||||
where table_schema = 'test' and table_name like 't_bug44738_%';
|
||||
table_schema table_name table_comment
|
||||
test t_bug44738_UPPERCASE
|
||||
drop table t_bug44738_UPPERCASE;
|
||||
# After the above DROP TABLE there are no entries in TDC which correspond
|
||||
# to our table and therefore the below statement should succeed.
|
||||
create table t_bug44738_UPPERCASE (i int);
|
||||
drop table t_bug44738_UPPERCASE;
|
||||
# Finally, let us check that another issue which was exposed by
|
||||
# the original test case is solved. I.e. that fuse in CREATE TABLE
|
||||
# which ensures that table is not created if there is an entry for
|
||||
# it in TDC even though it was removed from disk uses normalized
|
||||
# version of the table name.
|
||||
create table t_bug44738_UPPERCASE (i int) engine = myisam;
|
||||
# Load table definition in TDC.
|
||||
select table_schema, table_name, table_comment from information_schema.tables
|
||||
where table_schema = 'test' and table_name like 't_bug44738_%';
|
||||
table_schema table_name table_comment
|
||||
test t_bug44738_UPPERCASE
|
||||
# Simulate manual removal of the table.
|
||||
# After manual removal of table still there should be an entry for table
|
||||
# in TDC so attempt to create table with the same name should fail.
|
||||
create table t_bug44738_UPPERCASE (i int);
|
||||
ERROR 42S01: Table 't_bug44738_uppercase' already exists
|
||||
# And should succeed after FLUSH TABLES.
|
||||
flush tables;
|
||||
create table t_bug44738_UPPERCASE (i int);
|
||||
drop table t_bug44738_UPPERCASE;
|
||||
|
|
|
@ -2023,7 +2023,7 @@ CREATE TABLE tm1 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1) INSERT_METHOD=FIRST;
|
|||
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE
|
||||
TABLE_SCHEMA = 'test' and TABLE_NAME='tm1';
|
||||
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 test tm1 BASE TABLE NULL NULL NULL # # # # # # # # # # NULL # # Unable to open underlying table which is differently defined or of non-MyISAM ty
|
||||
def test tm1 BASE TABLE NULL NULL NULL # # # # # # # # # # NULL # # Unable to open underlying table which is differently defined or of non-MyISAM ty
|
||||
DROP TABLE tm1;
|
||||
CREATE TABLE t1(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM;
|
||||
CREATE TABLE t2(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM;
|
||||
|
@ -2220,3 +2220,39 @@ tr1 CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER INSERT ON t3 FOR EACH R
|
|||
DROP TRIGGER tr1;
|
||||
DROP TABLE t1, t2, t3;
|
||||
End of 5.1 tests
|
||||
#
|
||||
# An additional test case for Bug#27430 Crash in subquery code
|
||||
# when in PS and table DDL changed after PREPARE
|
||||
#
|
||||
# Test merge table with too many merge children.
|
||||
#
|
||||
drop table if exists t_parent;
|
||||
set @save_table_definition_cache=@@global.table_definition_cache;
|
||||
#
|
||||
# Set @@global.table_definition_cache to minimum
|
||||
#
|
||||
set @@global.table_definition_cache=400;
|
||||
set @a=null;
|
||||
#
|
||||
# Create 400 merge children
|
||||
#
|
||||
set @a=concat("create table t_parent (a int) union(", @a,
|
||||
") insert_method=first engine=mrg_myisam");
|
||||
prepare stmt from @a;
|
||||
execute stmt;
|
||||
prepare stmt from "select * from t_parent";
|
||||
execute stmt;
|
||||
ERROR HY000: Prepared statement needs to be re-prepared
|
||||
execute stmt;
|
||||
ERROR HY000: Prepared statement needs to be re-prepared
|
||||
execute stmt;
|
||||
ERROR HY000: Prepared statement needs to be re-prepared
|
||||
deallocate prepare stmt;
|
||||
#
|
||||
# Create merge parent
|
||||
#
|
||||
#
|
||||
# Cleanup
|
||||
#
|
||||
drop table t_parent;
|
||||
set @@global.table_definition_cache=@save_table_definition_cache;
|
||||
|
|
|
@ -162,8 +162,8 @@ CREATE TABLE t1 (a INT);
|
|||
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
|
||||
WHERE TRIGGER_SCHEMA="#mysql50#a@b" ORDER BY trigger_name;
|
||||
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
|
||||
NULL #mysql50#a@b tr1 INSERT NULL #mysql50#a@b #mysql50#c@d 0 NULL SET NEW.a = 10 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
NULL #mysql50#a@b tr2 INSERT NULL #mysql50#a@b t1 0 NULL SET NEW.a = 100 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
def #mysql50#a@b tr1 INSERT def #mysql50#a@b #mysql50#c@d 0 NULL SET NEW.a = 10 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
def #mysql50#a@b tr2 INSERT def #mysql50#a@b t1 0 NULL SET NEW.a = 100 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
Warnings:
|
||||
Warning 1603 Triggers for table `#mysql50#a@b`.`#mysql50#c@d` have no creation context
|
||||
Warning 1603 Triggers for table `#mysql50#a@b`.`t1` have no creation context
|
||||
|
@ -172,8 +172,8 @@ USE `a@b`;
|
|||
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
|
||||
WHERE TRIGGER_SCHEMA="a@b" ORDER BY trigger_name;
|
||||
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
|
||||
NULL a@b tr1 INSERT NULL a@b c@d 0 NULL SET NEW.a = 10 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost utf8 utf8_general_ci latin1_swedish_ci
|
||||
NULL a@b tr2 INSERT NULL a@b t1 0 NULL SET NEW.a = 100 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost utf8 utf8_general_ci latin1_swedish_ci
|
||||
def a@b tr1 INSERT def a@b c@d 0 NULL SET NEW.a = 10 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost utf8 utf8_general_ci latin1_swedish_ci
|
||||
def a@b tr2 INSERT def a@b t1 0 NULL SET NEW.a = 100 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost utf8 utf8_general_ci latin1_swedish_ci
|
||||
INSERT INTO `c@d` VALUES (2), (1);
|
||||
SELECT * FROM `c@d`;
|
||||
a
|
||||
|
|
|
@ -2391,7 +2391,7 @@ trg3 UPDATE t1 begin
|
|||
if new.a = -1 then
|
||||
set @fired:= "Yes";
|
||||
end if;
|
||||
end AFTER 0000-00-00 00:00:00 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
end AFTER 0000-00-00 00:00:00 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
INSERT INTO t1 (a) VALUES (1),(2),(3),(22);
|
||||
update t1 set a = 4 where a=3;
|
||||
|
||||
|
@ -2468,7 +2468,7 @@ DELIMITER ;
|
|||
/*!50003 SET character_set_results = latin1 */ ;
|
||||
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
|
||||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||
/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER' */ ;
|
||||
/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
|
||||
DELIMITER ;;
|
||||
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 trigger trg3 after update on t1 for each row
|
||||
begin
|
||||
|
@ -2500,7 +2500,7 @@ UNLOCK TABLES;
|
|||
/*!50003 SET character_set_results = latin1 */ ;
|
||||
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
|
||||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||
/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER' */ ;
|
||||
/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
|
||||
DELIMITER ;;
|
||||
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 trigger trg4 before insert on t2 for each row
|
||||
begin
|
||||
|
@ -2594,12 +2594,12 @@ trg3 UPDATE t1 begin
|
|||
if new.a = -1 then
|
||||
set @fired:= "Yes";
|
||||
end if;
|
||||
end AFTER # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
end AFTER # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
trg4 INSERT t2 begin
|
||||
if new.a > 10 then
|
||||
set @fired:= "No";
|
||||
end if;
|
||||
end BEFORE # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
end BEFORE # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
# Bug#9136 my_print_defaults changed behaviour between 4.1.7 and 4.1.10a
|
||||
|
@ -3611,7 +3611,7 @@ DROP TABLE IF EXISTS `TABLES`;
|
|||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TEMPORARY TABLE `TABLES` (
|
||||
`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 '',
|
||||
`TABLE_TYPE` varchar(64) NOT NULL DEFAULT '',
|
||||
|
@ -4223,7 +4223,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
|
|||
first ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
show create event ee1;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ee1 UTC CREATE EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
ee1 UTC CREATE DEFINER=`root`@`localhost` EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
drop database first;
|
||||
create database second;
|
||||
use second;
|
||||
|
@ -4232,7 +4232,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
|
|||
second ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
show create event ee1;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ee1 UTC CREATE EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
ee1 UTC CREATE DEFINER=`root`@`localhost` EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5 latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
create event ee2 on schedule at '2018-12-31 21:01:23' do set @a=5;
|
||||
create event ee3 on schedule at '2030-12-31 22:01:23' do set @a=5;
|
||||
show events;
|
||||
|
|
Binary file not shown.
|
@ -420,14 +420,12 @@ create table t1 (a bigint)
|
|||
partition by range (a)
|
||||
(partition p0 values less than (0xFFFFFFFFFFFFFFFF),
|
||||
partition p1 values less than (10));
|
||||
ERROR 42000: VALUES value must be of same type as partition function near '),
|
||||
partition p1 values less than (10))' at line 3
|
||||
ERROR HY000: VALUES value must be of same type as partition function
|
||||
create table t1 (a bigint)
|
||||
partition by list (a)
|
||||
(partition p0 values in (0xFFFFFFFFFFFFFFFF),
|
||||
partition p1 values in (10));
|
||||
ERROR 42000: VALUES value must be of same type as partition function near '),
|
||||
partition p1 values in (10))' at line 3
|
||||
ERROR HY000: VALUES value must be of same type as partition function
|
||||
create table t1 (a bigint unsigned)
|
||||
partition by range (a)
|
||||
(partition p0 values less than (100),
|
||||
|
@ -1421,7 +1419,7 @@ DROP TABLE t1;
|
|||
CREATE TABLE t1 (a int)
|
||||
PARTITION BY RANGE(a)
|
||||
(PARTITION p0 VALUES LESS THAN (NULL));
|
||||
ERROR 42000: Not allowed to use NULL value in VALUES LESS THAN near '))' at line 3
|
||||
ERROR HY000: Not allowed to use NULL value in VALUES LESS THAN
|
||||
create table t1 (s1 int auto_increment primary key)
|
||||
partition by list (s1)
|
||||
(partition p1 values in (1),
|
||||
|
|
518
mysql-test/r/partition_column.result
Normal file
518
mysql-test/r/partition_column.result
Normal file
|
@ -0,0 +1,518 @@
|
|||
drop table if exists t1;
|
||||
create table t1 (a varchar(5))
|
||||
partition by list columns(a)
|
||||
( partition p0 values in ('\''),
|
||||
partition p1 values in ('\\'),
|
||||
partition p2 values in ('\0'));
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(5) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY LIST COLUMNS(a)
|
||||
(PARTITION p0 VALUES IN ('''') ENGINE = MyISAM,
|
||||
PARTITION p1 VALUES IN ('\\') ENGINE = MyISAM,
|
||||
PARTITION p2 VALUES IN ('\0') ENGINE = MyISAM) */
|
||||
drop table t1;
|
||||
set @@sql_mode=allow_invalid_dates;
|
||||
create table t1 (a char, b char, c date)
|
||||
partition by range columns (a,b,c)
|
||||
( partition p0 values less than (0,0,to_days('3000-11-31')));
|
||||
ERROR HY000: Partition column values of incorrect type
|
||||
create table t1 (a char, b char, c date)
|
||||
partition by range columns (a,b,c)
|
||||
( partition p0 values less than (0,0,'3000-11-31'));
|
||||
ERROR HY000: Partition column values of incorrect type
|
||||
set @@sql_mode='';
|
||||
create table t1 (a int, b char(10), c varchar(25), d datetime)
|
||||
partition by range columns(a,b,c,d)
|
||||
subpartition by hash (to_seconds(d))
|
||||
subpartitions 4
|
||||
( partition p0 values less than (1, 0, MAXVALUE, '1900-01-01'),
|
||||
partition p1 values less than (1, 'a', MAXVALUE, '1999-01-01'),
|
||||
partition p2 values less than (1, 'a', MAXVALUE, MAXVALUE),
|
||||
partition p3 values less than (1, MAXVALUE, MAXVALUE, MAXVALUE));
|
||||
ERROR HY000: Partition column values of incorrect type
|
||||
create table t1 (a int, b char(10), c varchar(25), d datetime)
|
||||
partition by range columns(a,b,c,d)
|
||||
subpartition by hash (to_seconds(d))
|
||||
subpartitions 4
|
||||
( partition p0 values less than (1, '0', MAXVALUE, '1900-01-01'),
|
||||
partition p1 values less than (1, 'a', MAXVALUE, '1999-01-01'),
|
||||
partition p2 values less than (1, 'a', MAXVALUE, MAXVALUE),
|
||||
partition p3 values less than (1, MAXVALUE, MAXVALUE, MAXVALUE));
|
||||
select partition_method, partition_expression, partition_description
|
||||
from information_schema.partitions where table_name = "t1";
|
||||
partition_method partition_expression partition_description
|
||||
RANGE COLUMNS a,b,c,d 1,'0',MAXVALUE,'1900-01-01'
|
||||
RANGE COLUMNS a,b,c,d 1,'0',MAXVALUE,'1900-01-01'
|
||||
RANGE COLUMNS a,b,c,d 1,'0',MAXVALUE,'1900-01-01'
|
||||
RANGE COLUMNS a,b,c,d 1,'0',MAXVALUE,'1900-01-01'
|
||||
RANGE COLUMNS a,b,c,d 1,'a',MAXVALUE,'1999-01-01'
|
||||
RANGE COLUMNS a,b,c,d 1,'a',MAXVALUE,'1999-01-01'
|
||||
RANGE COLUMNS a,b,c,d 1,'a',MAXVALUE,'1999-01-01'
|
||||
RANGE COLUMNS a,b,c,d 1,'a',MAXVALUE,'1999-01-01'
|
||||
RANGE COLUMNS a,b,c,d 1,'a',MAXVALUE,MAXVALUE
|
||||
RANGE COLUMNS a,b,c,d 1,'a',MAXVALUE,MAXVALUE
|
||||
RANGE COLUMNS a,b,c,d 1,'a',MAXVALUE,MAXVALUE
|
||||
RANGE COLUMNS a,b,c,d 1,'a',MAXVALUE,MAXVALUE
|
||||
RANGE COLUMNS a,b,c,d 1,MAXVALUE,MAXVALUE,MAXVALUE
|
||||
RANGE COLUMNS a,b,c,d 1,MAXVALUE,MAXVALUE,MAXVALUE
|
||||
RANGE COLUMNS a,b,c,d 1,MAXVALUE,MAXVALUE,MAXVALUE
|
||||
RANGE COLUMNS a,b,c,d 1,MAXVALUE,MAXVALUE,MAXVALUE
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` char(10) DEFAULT NULL,
|
||||
`c` varchar(25) DEFAULT NULL,
|
||||
`d` datetime DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY RANGE COLUMNS(a,b,c,d)
|
||||
SUBPARTITION BY HASH (to_seconds(d))
|
||||
SUBPARTITIONS 4
|
||||
(PARTITION p0 VALUES LESS THAN (1,'0',MAXVALUE,'1900-01-01') ENGINE = MyISAM,
|
||||
PARTITION p1 VALUES LESS THAN (1,'a',MAXVALUE,'1999-01-01') ENGINE = MyISAM,
|
||||
PARTITION p2 VALUES LESS THAN (1,'a',MAXVALUE,MAXVALUE) ENGINE = MyISAM,
|
||||
PARTITION p3 VALUES LESS THAN (1,MAXVALUE,MAXVALUE,MAXVALUE) ENGINE = MyISAM) */
|
||||
drop table t1;
|
||||
create table t1 (a int, b int)
|
||||
partition by range columns (a,b)
|
||||
(partition p0 values less than (NULL, maxvalue));
|
||||
ERROR HY000: Not allowed to use NULL value in VALUES LESS THAN
|
||||
create table t1 (a int, b int)
|
||||
partition by list columns(a,b)
|
||||
( partition p0 values in ((maxvalue, 0)));
|
||||
Got one of the listed errors
|
||||
create table t1 (a int, b int)
|
||||
partition by list columns (a,b)
|
||||
( partition p0 values in ((0,0)));
|
||||
alter table t1 add partition
|
||||
(partition p1 values in (maxvalue, maxvalue));
|
||||
Got one of the listed errors
|
||||
drop table t1;
|
||||
create table t1 (a int, b int)
|
||||
partition by key (a,a);
|
||||
ERROR HY000: Duplicate partition field name 'a'
|
||||
create table t1 (a int, b int)
|
||||
partition by list columns(a,a)
|
||||
( partition p values in ((1,1)));
|
||||
ERROR HY000: Duplicate partition field name 'a'
|
||||
create table t1 (a int signed)
|
||||
partition by list (a)
|
||||
( partition p0 values in (1, 3, 5, 7, 9, NULL),
|
||||
partition p1 values in (2, 4, 6, 8, 0));
|
||||
insert into t1 values (NULL),(0),(1),(2),(2),(4),(4),(4),(8),(8);
|
||||
select * from t1 where NULL <= a;
|
||||
a
|
||||
select * from t1 where a is null;
|
||||
a
|
||||
NULL
|
||||
explain partitions select * from t1 where a is null;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 10 Using where
|
||||
select * from t1 where a <= 1;
|
||||
a
|
||||
1
|
||||
0
|
||||
drop table t1;
|
||||
create table t1 (a int signed)
|
||||
partition by list columns(a)
|
||||
( partition p0 values in (1, 3, 5, 7, 9, NULL),
|
||||
partition p1 values in (2, 4, 6, 8, 0));
|
||||
insert into t1 values (NULL),(0),(1),(2),(2),(4),(4),(4),(8),(8);
|
||||
select * from t1 where a <= NULL;
|
||||
a
|
||||
select * from t1 where a is null;
|
||||
a
|
||||
NULL
|
||||
explain partitions select * from t1 where a is null;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 2 Using where
|
||||
select * from t1 where a <= 1;
|
||||
a
|
||||
1
|
||||
0
|
||||
drop table t1;
|
||||
create table t1 (a int, b int)
|
||||
partition by list columns(a,b)
|
||||
( partition p0 values in ((1, NULL), (2, NULL), (NULL, NULL)),
|
||||
partition p1 values in ((1,1), (2,2)),
|
||||
partition p2 values in ((3, NULL), (NULL, 1)));
|
||||
select partition_method, partition_expression, partition_description
|
||||
from information_schema.partitions where table_name = "t1";
|
||||
partition_method partition_expression partition_description
|
||||
LIST COLUMNS a,b (1,NULL),(2,NULL),(NULL,NULL)
|
||||
LIST COLUMNS a,b (1,1),(2,2)
|
||||
LIST COLUMNS a,b (3,NULL),(NULL,1)
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY LIST COLUMNS(a,b)
|
||||
(PARTITION p0 VALUES IN ((1,NULL),(2,NULL),(NULL,NULL)) ENGINE = MyISAM,
|
||||
PARTITION p1 VALUES IN ((1,1),(2,2)) ENGINE = MyISAM,
|
||||
PARTITION p2 VALUES IN ((3,NULL),(NULL,1)) ENGINE = MyISAM) */
|
||||
insert into t1 values (3, NULL);
|
||||
insert into t1 values (NULL, 1);
|
||||
insert into t1 values (NULL, NULL);
|
||||
insert into t1 values (1, NULL);
|
||||
insert into t1 values (2, NULL);
|
||||
insert into t1 values (1,1);
|
||||
insert into t1 values (2,2);
|
||||
select * from t1 where a = 1;
|
||||
a b
|
||||
1 NULL
|
||||
1 1
|
||||
select * from t1 where a = 2;
|
||||
a b
|
||||
2 NULL
|
||||
2 2
|
||||
select * from t1 where a > 8;
|
||||
a b
|
||||
select * from t1 where a not between 8 and 8;
|
||||
a b
|
||||
2 NULL
|
||||
2 2
|
||||
3 NULL
|
||||
1 NULL
|
||||
1 1
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY LIST COLUMNS(a,b)
|
||||
(PARTITION p0 VALUES IN ((1,NULL),(2,NULL),(NULL,NULL)) ENGINE = MyISAM,
|
||||
PARTITION p1 VALUES IN ((1,1),(2,2)) ENGINE = MyISAM,
|
||||
PARTITION p2 VALUES IN ((3,NULL),(NULL,1)) ENGINE = MyISAM) */
|
||||
drop table t1;
|
||||
create table t1 (a int)
|
||||
partition by list (a)
|
||||
( partition p0 values in (1),
|
||||
partition p1 values in (1));
|
||||
ERROR HY000: Multiple definition of same constant in list partitioning
|
||||
create table t1 (a int)
|
||||
partition by list (a)
|
||||
( partition p0 values in (2, 1),
|
||||
partition p1 values in (4, NULL, 3));
|
||||
select partition_method, partition_expression, partition_description
|
||||
from information_schema.partitions where table_name = "t1";
|
||||
partition_method partition_expression partition_description
|
||||
LIST a 2,1
|
||||
LIST a NULL,4,3
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY LIST (a)
|
||||
(PARTITION p0 VALUES IN (2,1) ENGINE = MyISAM,
|
||||
PARTITION p1 VALUES IN (NULL,4,3) ENGINE = MyISAM) */
|
||||
insert into t1 values (1);
|
||||
insert into t1 values (2);
|
||||
insert into t1 values (3);
|
||||
insert into t1 values (4);
|
||||
insert into t1 values (NULL);
|
||||
insert into t1 values (5);
|
||||
ERROR HY000: Table has no partition for value 5
|
||||
drop table t1;
|
||||
create table t1 (a int)
|
||||
partition by list columns(a)
|
||||
( partition p0 values in (2, 1),
|
||||
partition p1 values in ((4), (NULL), (3)));
|
||||
ERROR 42000: Row expressions in VALUES IN only allowed for multi-field column partitioning near '))' at line 4
|
||||
create table t1 (a int)
|
||||
partition by list columns(a)
|
||||
( partition p0 values in (2, 1),
|
||||
partition p1 values in (4, NULL, 3));
|
||||
select partition_method, partition_expression, partition_description
|
||||
from information_schema.partitions where table_name = "t1";
|
||||
partition_method partition_expression partition_description
|
||||
LIST COLUMNS a 2,1
|
||||
LIST COLUMNS a 4,NULL,3
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY LIST COLUMNS(a)
|
||||
(PARTITION p0 VALUES IN (2,1) ENGINE = MyISAM,
|
||||
PARTITION p1 VALUES IN (4,NULL,3) ENGINE = MyISAM) */
|
||||
insert into t1 values (1);
|
||||
insert into t1 values (2);
|
||||
insert into t1 values (3);
|
||||
insert into t1 values (4);
|
||||
insert into t1 values (NULL);
|
||||
insert into t1 values (5);
|
||||
ERROR HY000: Table has no partition for value from column_list
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY LIST COLUMNS(a)
|
||||
(PARTITION p0 VALUES IN (2,1) ENGINE = MyISAM,
|
||||
PARTITION p1 VALUES IN (4,NULL,3) ENGINE = MyISAM) */
|
||||
drop table t1;
|
||||
create table t1 (a int, b char(10), c varchar(5), d int)
|
||||
partition by range columns(a,b,c)
|
||||
subpartition by key (c,d)
|
||||
subpartitions 3
|
||||
( partition p0 values less than (1,'abc','abc'),
|
||||
partition p1 values less than (2,'abc','abc'),
|
||||
partition p2 values less than (3,'abc','abc'),
|
||||
partition p3 values less than (4,'abc','abc'));
|
||||
select partition_method, partition_expression, partition_description
|
||||
from information_schema.partitions where table_name = "t1";
|
||||
partition_method partition_expression partition_description
|
||||
RANGE COLUMNS a,b,c 1,'abc','abc'
|
||||
RANGE COLUMNS a,b,c 1,'abc','abc'
|
||||
RANGE COLUMNS a,b,c 1,'abc','abc'
|
||||
RANGE COLUMNS a,b,c 2,'abc','abc'
|
||||
RANGE COLUMNS a,b,c 2,'abc','abc'
|
||||
RANGE COLUMNS a,b,c 2,'abc','abc'
|
||||
RANGE COLUMNS a,b,c 3,'abc','abc'
|
||||
RANGE COLUMNS a,b,c 3,'abc','abc'
|
||||
RANGE COLUMNS a,b,c 3,'abc','abc'
|
||||
RANGE COLUMNS a,b,c 4,'abc','abc'
|
||||
RANGE COLUMNS a,b,c 4,'abc','abc'
|
||||
RANGE COLUMNS a,b,c 4,'abc','abc'
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` char(10) DEFAULT NULL,
|
||||
`c` varchar(5) DEFAULT NULL,
|
||||
`d` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY RANGE COLUMNS(a,b,c)
|
||||
SUBPARTITION BY KEY (c,d)
|
||||
SUBPARTITIONS 3
|
||||
(PARTITION p0 VALUES LESS THAN (1,'abc','abc') ENGINE = MyISAM,
|
||||
PARTITION p1 VALUES LESS THAN (2,'abc','abc') ENGINE = MyISAM,
|
||||
PARTITION p2 VALUES LESS THAN (3,'abc','abc') ENGINE = MyISAM,
|
||||
PARTITION p3 VALUES LESS THAN (4,'abc','abc') ENGINE = MyISAM) */
|
||||
insert into t1 values (1,'a','b',1),(2,'a','b',2),(3,'a','b',3);
|
||||
insert into t1 values (1,'b','c',1),(2,'b','c',2),(3,'b','c',3);
|
||||
insert into t1 values (1,'c','d',1),(2,'c','d',2),(3,'c','d',3);
|
||||
insert into t1 values (1,'d','e',1),(2,'d','e',2),(3,'d','e',3);
|
||||
select * from t1 where (a = 1 AND b < 'd' AND (c = 'b' OR (c = 'c' AND d = 1)) OR
|
||||
(a = 1 AND b >= 'a' AND (c = 'c' OR (c = 'd' AND d = 2))));
|
||||
a b c d
|
||||
1 a b 1
|
||||
1 b c 1
|
||||
drop table t1;
|
||||
create table t1 (a int, b varchar(2), c int)
|
||||
partition by range columns (a, b, c)
|
||||
(partition p0 values less than (1, 'A', 1),
|
||||
partition p1 values less than (1, 'B', 1));
|
||||
select partition_method, partition_expression, partition_description
|
||||
from information_schema.partitions where table_name = "t1";
|
||||
partition_method partition_expression partition_description
|
||||
RANGE COLUMNS a,b,c 1,'A',1
|
||||
RANGE COLUMNS a,b,c 1,'B',1
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` varchar(2) DEFAULT NULL,
|
||||
`c` int(11) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY RANGE COLUMNS(a,b,c)
|
||||
(PARTITION p0 VALUES LESS THAN (1,'A',1) ENGINE = MyISAM,
|
||||
PARTITION p1 VALUES LESS THAN (1,'B',1) ENGINE = MyISAM) */
|
||||
insert into t1 values (1, 'A', 1);
|
||||
explain partitions select * from t1 where a = 1 AND b <= 'A' and c = 1;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0,p1 system NULL NULL NULL NULL 1
|
||||
select * from t1 where a = 1 AND b <= 'A' and c = 1;
|
||||
a b c
|
||||
1 A 1
|
||||
drop table t1;
|
||||
create table t1 (a char, b char, c char)
|
||||
partition by list columns(a)
|
||||
( partition p0 values in ('a'));
|
||||
insert into t1 (a) values ('a');
|
||||
select * from t1 where a = 'a';
|
||||
a b c
|
||||
a NULL NULL
|
||||
drop table t1;
|
||||
create table t1 (d time)
|
||||
partition by range columns(d)
|
||||
( partition p0 values less than ('2000-01-01'),
|
||||
partition p1 values less than ('2040-01-01'));
|
||||
ERROR HY000: Partition column values of incorrect type
|
||||
create table t1 (d timestamp)
|
||||
partition by range columns(d)
|
||||
( partition p0 values less than ('2000-01-01'),
|
||||
partition p1 values less than ('2040-01-01'));
|
||||
ERROR HY000: Field 'd' is of a not allowed type for this type of partitioning
|
||||
create table t1 (d bit(1))
|
||||
partition by range columns(d)
|
||||
( partition p0 values less than (0),
|
||||
partition p1 values less than (1));
|
||||
ERROR HY000: Field 'd' is of a not allowed type for this type of partitioning
|
||||
create table t1 (a int, b int)
|
||||
partition by range columns(a,b)
|
||||
(partition p0 values less than (maxvalue, 10));
|
||||
drop table t1;
|
||||
create table t1 (d date)
|
||||
partition by range columns(d)
|
||||
( partition p0 values less than ('2000-01-01'),
|
||||
partition p1 values less than ('2009-01-01'));
|
||||
drop table t1;
|
||||
create table t1 (d date)
|
||||
partition by range columns(d)
|
||||
( partition p0 values less than ('1999-01-01'),
|
||||
partition p1 values less than ('2000-01-01'));
|
||||
drop table t1;
|
||||
create table t1 (d date)
|
||||
partition by range columns(d)
|
||||
( partition p0 values less than ('2000-01-01'),
|
||||
partition p1 values less than ('3000-01-01'));
|
||||
drop table t1;
|
||||
create table t1 (a int, b int)
|
||||
partition by range columns(a,b)
|
||||
(partition p2 values less than (99,99),
|
||||
partition p1 values less than (99,999));
|
||||
insert into t1 values (99,998);
|
||||
select * from t1 where b = 998;
|
||||
a b
|
||||
99 998
|
||||
drop table t1;
|
||||
create table t1 as select to_seconds(null) as to_seconds;
|
||||
select data_type from information_schema.columns
|
||||
where column_name='to_seconds';
|
||||
data_type
|
||||
int
|
||||
drop table t1;
|
||||
create table t1 (a int, b int)
|
||||
partition by list columns(a,b)
|
||||
(partition p0 values in ((maxvalue,maxvalue)));
|
||||
ERROR 42000: Cannot use MAXVALUE as value in VALUES IN near 'maxvalue,maxvalue)))' at line 3
|
||||
create table t1 (a int, b int)
|
||||
partition by range columns(a,b)
|
||||
(partition p0 values less than (maxvalue,maxvalue));
|
||||
drop table t1;
|
||||
create table t1 (a int)
|
||||
partition by list columns(a)
|
||||
(partition p0 values in (0));
|
||||
select partition_method from information_schema.partitions where table_name='t1';
|
||||
partition_method
|
||||
LIST COLUMNS
|
||||
drop table t1;
|
||||
create table t1 (a char(6))
|
||||
partition by range columns(a)
|
||||
(partition p0 values less than ('H23456'),
|
||||
partition p1 values less than ('M23456'));
|
||||
insert into t1 values ('F23456');
|
||||
select * from t1;
|
||||
a
|
||||
F23456
|
||||
drop table t1;
|
||||
create table t1 (a char(6))
|
||||
partition by range columns(a)
|
||||
(partition p0 values less than (H23456),
|
||||
partition p1 values less than (M23456));
|
||||
ERROR 42S22: Unknown column 'H23456' in 'field list'
|
||||
create table t1 (a char(6))
|
||||
partition by range columns(a)
|
||||
(partition p0 values less than (23456),
|
||||
partition p1 values less than (23456));
|
||||
ERROR HY000: Partition column values of incorrect type
|
||||
create table t1 (a int, b int)
|
||||
partition by range columns(a,b)
|
||||
(partition p0 values less than (10));
|
||||
ERROR 42000: Inconsistency in usage of column lists for partitioning near '))' at line 3
|
||||
create table t1 (a int, b int)
|
||||
partition by range columns(a,b)
|
||||
(partition p0 values less than (1,1,1);
|
||||
ERROR HY000: Inconsistency in usage of column lists for partitioning
|
||||
create table t1 (a int, b int)
|
||||
partition by range columns(a,b)
|
||||
(partition p0 values less than (1, 0),
|
||||
partition p1 values less than (2, maxvalue),
|
||||
partition p2 values less than (3, 3),
|
||||
partition p3 values less than (10, maxvalue));
|
||||
insert into t1 values (11,0);
|
||||
ERROR HY000: Table has no partition for value from column_list
|
||||
insert into t1 values (0,1),(1,1),(2,1),(3,1),(3,4),(4,9),(9,1);
|
||||
select * from t1;
|
||||
a b
|
||||
0 1
|
||||
1 1
|
||||
2 1
|
||||
3 1
|
||||
3 4
|
||||
4 9
|
||||
9 1
|
||||
alter table t1
|
||||
partition by range columns(b,a)
|
||||
(partition p0 values less than (1,2),
|
||||
partition p1 values less than (3,3),
|
||||
partition p2 values less than (9,5));
|
||||
explain partitions select * from t1 where b < 2;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 7 Using where
|
||||
select * from t1 where b < 2;
|
||||
a b
|
||||
0 1
|
||||
1 1
|
||||
2 1
|
||||
3 1
|
||||
9 1
|
||||
explain partitions select * from t1 where b < 4;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0,p1,p2 ALL NULL NULL NULL NULL 7 Using where
|
||||
select * from t1 where b < 4;
|
||||
a b
|
||||
0 1
|
||||
1 1
|
||||
2 1
|
||||
3 1
|
||||
9 1
|
||||
alter table t1 reorganize partition p1 into
|
||||
(partition p11 values less than (2,2),
|
||||
partition p12 values less than (3,3));
|
||||
alter table t1 reorganize partition p0 into
|
||||
(partition p01 values less than (0,3),
|
||||
partition p02 values less than (1,1));
|
||||
ERROR HY000: Reorganize of range partitions cannot change total ranges except for last partition where it can extend the range
|
||||
alter table t1 reorganize partition p2 into
|
||||
(partition p2 values less than(9,6,1));
|
||||
ERROR HY000: Inconsistency in usage of column lists for partitioning
|
||||
alter table t1 reorganize partition p2 into
|
||||
(partition p2 values less than (10));
|
||||
ERROR HY000: Inconsistency in usage of column lists for partitioning
|
||||
alter table t1 reorganize partition p2 into
|
||||
(partition p21 values less than (4,7),
|
||||
partition p22 values less than (9,5));
|
||||
explain partitions select * from t1 where b < 4;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0,p11,p12,p21 ALL NULL NULL NULL NULL 7 Using where
|
||||
select * from t1 where b < 4;
|
||||
a b
|
||||
0 1
|
||||
1 1
|
||||
2 1
|
||||
3 1
|
||||
9 1
|
||||
drop table t1;
|
||||
create table t1 (a int, b int)
|
||||
partition by list columns(a,b)
|
||||
subpartition by hash (b)
|
||||
subpartitions 2
|
||||
(partition p0 values in ((0,0), (1,1)),
|
||||
partition p1 values in ((1000,1000)));
|
||||
insert into t1 values (1000,1000);
|
||||
drop table t1;
|
||||
create table t1 (a char, b char, c char)
|
||||
partition by range columns(a,b,c)
|
||||
( partition p0 values less than ('a','b','c'));
|
||||
alter table t1 add partition
|
||||
(partition p1 values less than ('b','c','d'));
|
||||
drop table t1;
|
66
mysql-test/r/partition_column_prune.result
Normal file
66
mysql-test/r/partition_column_prune.result
Normal file
|
@ -0,0 +1,66 @@
|
|||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
create table t1 (a char, b char, c char)
|
||||
partition by range columns(a,b,c)
|
||||
( partition p0 values less than ('a','b','c'));
|
||||
insert into t1 values ('a', NULL, 'd');
|
||||
explain partitions select * from t1 where a = 'a' AND c = 'd';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0 system NULL NULL NULL NULL 1
|
||||
select * from t1 where a = 'a' AND c = 'd';
|
||||
a b c
|
||||
a NULL d
|
||||
drop table t1;
|
||||
create table t1 (a int not null) partition by range columns(a) (
|
||||
partition p0 values less than (10),
|
||||
partition p1 values less than (20),
|
||||
partition p2 values less than (30),
|
||||
partition p3 values less than (40),
|
||||
partition p4 values less than (50),
|
||||
partition p5 values less than (60),
|
||||
partition p6 values less than (70)
|
||||
);
|
||||
insert into t1 values (5),(15),(25),(35),(45),(55),(65);
|
||||
insert into t1 values (5),(15),(25),(35),(45),(55),(65);
|
||||
create table t2 (a int not null) partition by range(a) (
|
||||
partition p0 values less than (10),
|
||||
partition p1 values less than (20),
|
||||
partition p2 values less than (30),
|
||||
partition p3 values less than (40),
|
||||
partition p4 values less than (50),
|
||||
partition p5 values less than (60),
|
||||
partition p6 values less than (70)
|
||||
);
|
||||
insert into t2 values (5),(15),(25),(35),(45),(55),(65);
|
||||
insert into t2 values (5),(15),(25),(35),(45),(55),(65);
|
||||
explain partitions select * from t1 where a > 35 and a < 45;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p3,p4 ALL NULL NULL NULL NULL 4 Using where
|
||||
explain partitions select * from t2 where a > 35 and a < 45;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 4 Using where
|
||||
drop table t1, t2;
|
||||
create table t1 (a int not null, b int not null )
|
||||
partition by range columns(a,b) (
|
||||
partition p01 values less than (2,10),
|
||||
partition p02 values less than (2,20),
|
||||
partition p03 values less than (2,30),
|
||||
partition p11 values less than (4,10),
|
||||
partition p12 values less than (4,20),
|
||||
partition p13 values less than (4,30),
|
||||
partition p21 values less than (6,10),
|
||||
partition p22 values less than (6,20),
|
||||
partition p23 values less than (6,30)
|
||||
);
|
||||
insert into t1 values (2,5), (2,15), (2,25),
|
||||
(4,5), (4,15), (4,25), (6,5), (6,15), (6,25);
|
||||
insert into t1 select * from t1;
|
||||
explain partitions select * from t1 where a=2;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p01,p02,p03,p11 ALL NULL NULL NULL NULL 13 Using where
|
||||
explain partitions select * from t1 where a=4;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p11,p12,p13,p21 ALL NULL NULL NULL NULL 16 Using where
|
||||
explain partitions select * from t1 where a=2 and b < 22;
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p01,p02,p03 ALL NULL NULL NULL NULL 16 Using where
|
||||
drop table t1;
|
|
@ -273,7 +273,7 @@ select * from t1 where a = 'y';
|
|||
a
|
||||
y
|
||||
drop table t1;
|
||||
create table t1 (a varchar(65531)) partition by key (a);
|
||||
create table t1 (a varchar(3068)) partition by key (a);
|
||||
insert into t1 values ('bbbb');
|
||||
insert into t1 values ('aaaa');
|
||||
select * from t1 where a = 'aaaa';
|
||||
|
@ -286,7 +286,7 @@ select * from t1 where a = 'bbbb';
|
|||
a
|
||||
bbbb
|
||||
drop table t1;
|
||||
create table t1 (a varchar(65532)) partition by key (a);
|
||||
create table t1 (a varchar(3069)) partition by key (a);
|
||||
insert into t1 values ('bbbb');
|
||||
insert into t1 values ('aaaa');
|
||||
select * from t1 where a = 'aaaa';
|
||||
|
@ -299,7 +299,7 @@ select * from t1 where a = 'bbbb';
|
|||
a
|
||||
bbbb
|
||||
drop table t1;
|
||||
create table t1 (a varchar(65533) not null) partition by key (a);
|
||||
create table t1 (a varchar(3070) not null) partition by key (a);
|
||||
insert into t1 values ('bbbb');
|
||||
insert into t1 values ('aaaa');
|
||||
select * from t1 where a = 'aaaa';
|
||||
|
@ -312,6 +312,8 @@ select * from t1 where a = 'bbbb';
|
|||
a
|
||||
bbbb
|
||||
drop table t1;
|
||||
create table t1 (a varchar(3070)) partition by key (a);
|
||||
ERROR HY000: The total length of the partitioning fields is too large
|
||||
create table t1 (a varchar(65533)) partition by key (a);
|
||||
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
|
||||
create table t1 (a varchar(65534) not null) partition by key (a);
|
||||
|
|
|
@ -361,8 +361,7 @@ partition by range (a)
|
|||
partitions 2
|
||||
(partition x1 values less than (4.0) tablespace ts1,
|
||||
partition x2 values less than (8) tablespace ts2);
|
||||
ERROR 42000: VALUES value must be of same type as partition function near ') tablespace ts1,
|
||||
partition x2 values less than (8) tablespace ts2)' at line 8
|
||||
ERROR HY000: VALUES value must be of same type as partition function
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
|
@ -412,8 +411,7 @@ partition by list (a)
|
|||
partitions 2
|
||||
(partition x1 values less than 4,
|
||||
partition x2 values less than (5));
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '4,
|
||||
partition x2 values less than (5))' at line 8
|
||||
ERROR HY000: Only RANGE PARTITIONING can use VALUES LESS THAN in partition definition
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
|
@ -423,7 +421,7 @@ partition by range (a)
|
|||
partitions 2
|
||||
(partition x1 values less than maxvalue,
|
||||
partition x2 values less than (5));
|
||||
ERROR 42000: MAXVALUE can only be used in last partition definition near '))' at line 9
|
||||
ERROR HY000: MAXVALUE can only be used in last partition definition
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
|
@ -433,7 +431,7 @@ partition by range (a)
|
|||
partitions 2
|
||||
(partition x1 values less than maxvalue,
|
||||
partition x2 values less than maxvalue);
|
||||
ERROR 42000: MAXVALUE can only be used in last partition definition near 'maxvalue)' at line 9
|
||||
ERROR HY000: MAXVALUE can only be used in last partition definition
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
|
@ -602,8 +600,7 @@ partition by list (a)
|
|||
partitions 2
|
||||
(partition x1 values in (4.0, 12+8),
|
||||
partition x2 values in (3, 21));
|
||||
ERROR 42000: VALUES value must be of same type as partition function near ' 12+8),
|
||||
partition x2 values in (3, 21))' at line 8
|
||||
ERROR HY000: VALUES value must be of same type as partition function
|
||||
CREATE TABLE t1 (
|
||||
a int not null,
|
||||
b int not null,
|
||||
|
|
|
@ -1,4 +1,28 @@
|
|||
drop table if exists t1;
|
||||
create table t1 (a varchar(5))
|
||||
engine=memory
|
||||
partition by range columns(a)
|
||||
( partition p0 values less than ('m'),
|
||||
partition p1 values less than ('za'));
|
||||
insert into t1 values ('j');
|
||||
update t1 set a = 'z' where (a >= 'j');
|
||||
drop table t1;
|
||||
create table t1 (a varchar(5))
|
||||
engine=myisam
|
||||
partition by range columns(a)
|
||||
( partition p0 values less than ('m'),
|
||||
partition p1 values less than ('za'));
|
||||
insert into t1 values ('j');
|
||||
update t1 set a = 'z' where (a >= 'j');
|
||||
drop table t1;
|
||||
create table t1 (a varchar(5))
|
||||
engine=innodb
|
||||
partition by range columns(a)
|
||||
( partition p0 values less than ('m'),
|
||||
partition p1 values less than ('za'));
|
||||
insert into t1 values ('j');
|
||||
update t1 set a = 'z' where (a >= 'j');
|
||||
drop table t1;
|
||||
create table t1 (a int not null,
|
||||
b datetime not null,
|
||||
primary key (a,b))
|
||||
|
|
|
@ -54,6 +54,17 @@ subpartitions 2
|
|||
partition p1 values in (1),
|
||||
partition pnull values in (null, 2),
|
||||
partition p3 values in (3));
|
||||
select partition_method, partition_expression, partition_description
|
||||
from information_schema.partitions where table_name = "t1";
|
||||
partition_method partition_expression partition_description
|
||||
LIST a 0
|
||||
LIST a 0
|
||||
LIST a 1
|
||||
LIST a 1
|
||||
LIST a NULL,2
|
||||
LIST a NULL,2
|
||||
LIST a 3
|
||||
LIST a 3
|
||||
insert into t1 values (0,0),(0,1),(1,0),(1,1),(null,0),(null,1);
|
||||
insert into t1 values (2,0),(2,1),(3,0),(3,1);
|
||||
explain partitions select * from t1 where a is null;
|
||||
|
|
|
@ -41,7 +41,7 @@ ERROR HY000: Reorganize of range partitions cannot change total ranges except fo
|
|||
ALTER TABLE t1 REORGANIZE PARTITION x0,x1 INTO
|
||||
(PARTITION x01 VALUES LESS THAN (4),
|
||||
PARTITION x11 VALUES LESS THAN (2));
|
||||
ERROR HY000: Reorganize of range partitions cannot change total ranges except for last partition where it can extend the range
|
||||
ERROR HY000: VALUES LESS THAN value must be strictly increasing for each partition
|
||||
ALTER TABLE t1 REORGANIZE PARTITION x0,x1 INTO
|
||||
(PARTITION x01 VALUES LESS THAN (6),
|
||||
PARTITION x11 VALUES LESS THAN (4));
|
||||
|
|
|
@ -656,6 +656,335 @@ EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01
|
|||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
|
||||
DROP TABLE t1;
|
||||
# TO_SECONDS, test of LIST and index
|
||||
CREATE TABLE t1 (a DATE, KEY(a))
|
||||
PARTITION BY LIST (TO_SECONDS(a))
|
||||
(PARTITION `p0001-01-01` VALUES IN (TO_SECONDS('0001-01-01')),
|
||||
PARTITION `p2001-01-01` VALUES IN (TO_SECONDS('2001-01-01')),
|
||||
PARTITION `pNULL` VALUES IN (NULL),
|
||||
PARTITION `p0000-01-02` VALUES IN (TO_SECONDS('0000-01-02')),
|
||||
PARTITION `p1001-01-01` VALUES IN (TO_SECONDS('1001-01-01')));
|
||||
INSERT INTO t1 VALUES ('0000-00-00'), ('0000-01-02'), ('0001-01-01'),
|
||||
('1001-00-00'), ('1001-01-01'), ('1002-00-00'), ('2001-01-01');
|
||||
SELECT * FROM t1 WHERE a < '1001-01-01';
|
||||
a
|
||||
0000-00-00
|
||||
0000-01-02
|
||||
0001-01-01
|
||||
1001-00-00
|
||||
SELECT * FROM t1 WHERE a <= '1001-01-01';
|
||||
a
|
||||
0000-00-00
|
||||
0000-01-02
|
||||
0001-01-01
|
||||
1001-00-00
|
||||
1001-01-01
|
||||
SELECT * FROM t1 WHERE a >= '1001-01-01';
|
||||
a
|
||||
1001-01-01
|
||||
1002-00-00
|
||||
2001-01-01
|
||||
SELECT * FROM t1 WHERE a > '1001-01-01';
|
||||
a
|
||||
1002-00-00
|
||||
2001-01-01
|
||||
SELECT * FROM t1 WHERE a = '1001-01-01';
|
||||
a
|
||||
1001-01-01
|
||||
SELECT * FROM t1 WHERE a < '1001-00-00';
|
||||
a
|
||||
0000-00-00
|
||||
0000-01-02
|
||||
0001-01-01
|
||||
SELECT * FROM t1 WHERE a <= '1001-00-00';
|
||||
a
|
||||
0000-00-00
|
||||
0000-01-02
|
||||
0001-01-01
|
||||
1001-00-00
|
||||
SELECT * FROM t1 WHERE a >= '1001-00-00';
|
||||
a
|
||||
1001-00-00
|
||||
1001-01-01
|
||||
1002-00-00
|
||||
2001-01-01
|
||||
SELECT * FROM t1 WHERE a > '1001-00-00';
|
||||
a
|
||||
1001-01-01
|
||||
1002-00-00
|
||||
2001-01-01
|
||||
SELECT * FROM t1 WHERE a = '1001-00-00';
|
||||
a
|
||||
1001-00-00
|
||||
# Disabling warnings for the invalid date
|
||||
SELECT * FROM t1 WHERE a < '1999-02-31';
|
||||
a
|
||||
0000-00-00
|
||||
0000-01-02
|
||||
0001-01-01
|
||||
1001-00-00
|
||||
1001-01-01
|
||||
1002-00-00
|
||||
SELECT * FROM t1 WHERE a <= '1999-02-31';
|
||||
a
|
||||
0000-00-00
|
||||
0000-01-02
|
||||
0001-01-01
|
||||
1001-00-00
|
||||
1001-01-01
|
||||
1002-00-00
|
||||
SELECT * FROM t1 WHERE a >= '1999-02-31';
|
||||
a
|
||||
2001-01-01
|
||||
SELECT * FROM t1 WHERE a > '1999-02-31';
|
||||
a
|
||||
2001-01-01
|
||||
SELECT * FROM t1 WHERE a = '1999-02-31';
|
||||
a
|
||||
SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00';
|
||||
a
|
||||
0000-00-00
|
||||
0000-01-02
|
||||
0001-01-01
|
||||
1001-00-00
|
||||
1001-01-01
|
||||
1002-00-00
|
||||
SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1001-01-01';
|
||||
a
|
||||
0000-00-00
|
||||
0000-01-02
|
||||
0001-01-01
|
||||
1001-00-00
|
||||
1001-01-01
|
||||
SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
|
||||
a
|
||||
1001-00-00
|
||||
1001-01-01
|
||||
1002-00-00
|
||||
SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
|
||||
a
|
||||
0001-01-01
|
||||
1001-00-00
|
||||
1001-01-01
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-01-01';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 range a a 4 NULL 3 Using where; Using index
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-01-01';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 range a a 4 NULL 4 Using where; Using index
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-01-01';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 range a a 4 NULL 4 Using where; Using index
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-01-01';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p2001-01-01,pNULL range a a 4 NULL 3 Using where; Using index
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-01-01';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p1001-01-01 system a NULL NULL NULL 1
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-00-00';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 range a a 4 NULL 3 Using where; Using index
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-00-00';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 range a a 4 NULL 3 Using where; Using index
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-00-00';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 range a a 4 NULL 4 Using where; Using index
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-00-00';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 range a a 4 NULL 4 Using where; Using index
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-00-00';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 pNULL ref a a 4 const 1 Using where; Using index
|
||||
# Disabling warnings for the invalid date
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1999-02-31';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 range a a 4 NULL 5 Using where; Using index
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1999-02-31';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 range a a 4 NULL 5 Using where; Using index
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1999-02-31';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p2001-01-01,pNULL range a a 4 NULL 2 Using where; Using index
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1999-02-31';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p2001-01-01,pNULL range a a 4 NULL 2 Using where; Using index
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1999-02-31';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 pNULL ref a a 4 const 1 Using where; Using index
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 range a a 4 NULL 5 Using where; Using index
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1001-01-01';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 range a a 4 NULL 4 Using where; Using index
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 pNULL,p1001-01-01 range a a 4 NULL 2 Using where; Using index
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0001-01-01,pNULL,p1001-01-01 range a a 4 NULL 3 Using where; Using index
|
||||
# test without index
|
||||
ALTER TABLE t1 DROP KEY a;
|
||||
SELECT * FROM t1 WHERE a < '1001-01-01';
|
||||
a
|
||||
0000-00-00
|
||||
0000-01-02
|
||||
0001-01-01
|
||||
1001-00-00
|
||||
SELECT * FROM t1 WHERE a <= '1001-01-01';
|
||||
a
|
||||
0000-00-00
|
||||
0000-01-02
|
||||
0001-01-01
|
||||
1001-00-00
|
||||
1001-01-01
|
||||
SELECT * FROM t1 WHERE a >= '1001-01-01';
|
||||
a
|
||||
1001-01-01
|
||||
1002-00-00
|
||||
2001-01-01
|
||||
SELECT * FROM t1 WHERE a > '1001-01-01';
|
||||
a
|
||||
1002-00-00
|
||||
2001-01-01
|
||||
SELECT * FROM t1 WHERE a = '1001-01-01';
|
||||
a
|
||||
1001-01-01
|
||||
SELECT * FROM t1 WHERE a < '1001-00-00';
|
||||
a
|
||||
0000-00-00
|
||||
0000-01-02
|
||||
0001-01-01
|
||||
SELECT * FROM t1 WHERE a <= '1001-00-00';
|
||||
a
|
||||
0000-00-00
|
||||
0000-01-02
|
||||
0001-01-01
|
||||
1001-00-00
|
||||
SELECT * FROM t1 WHERE a >= '1001-00-00';
|
||||
a
|
||||
1001-00-00
|
||||
1001-01-01
|
||||
1002-00-00
|
||||
2001-01-01
|
||||
SELECT * FROM t1 WHERE a > '1001-00-00';
|
||||
a
|
||||
1001-01-01
|
||||
1002-00-00
|
||||
2001-01-01
|
||||
SELECT * FROM t1 WHERE a = '1001-00-00';
|
||||
a
|
||||
1001-00-00
|
||||
# Disabling warnings for the invalid date
|
||||
SELECT * FROM t1 WHERE a < '1999-02-31';
|
||||
a
|
||||
0000-00-00
|
||||
0000-01-02
|
||||
0001-01-01
|
||||
1001-00-00
|
||||
1001-01-01
|
||||
1002-00-00
|
||||
SELECT * FROM t1 WHERE a <= '1999-02-31';
|
||||
a
|
||||
0000-00-00
|
||||
0000-01-02
|
||||
0001-01-01
|
||||
1001-00-00
|
||||
1001-01-01
|
||||
1002-00-00
|
||||
SELECT * FROM t1 WHERE a >= '1999-02-31';
|
||||
a
|
||||
2001-01-01
|
||||
SELECT * FROM t1 WHERE a > '1999-02-31';
|
||||
a
|
||||
2001-01-01
|
||||
SELECT * FROM t1 WHERE a = '1999-02-31';
|
||||
a
|
||||
SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00';
|
||||
a
|
||||
0000-00-00
|
||||
0000-01-02
|
||||
0001-01-01
|
||||
1001-00-00
|
||||
1001-01-01
|
||||
1002-00-00
|
||||
SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1001-01-01';
|
||||
a
|
||||
0000-00-00
|
||||
0000-01-02
|
||||
0001-01-01
|
||||
1001-00-00
|
||||
1001-01-01
|
||||
SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
|
||||
a
|
||||
1001-00-00
|
||||
1001-01-01
|
||||
1002-00-00
|
||||
SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
|
||||
a
|
||||
0001-01-01
|
||||
1001-00-00
|
||||
1001-01-01
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-01-01';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 ALL NULL NULL NULL NULL 7 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-01-01';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-01-01';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-01-01';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p2001-01-01,pNULL ALL NULL NULL NULL NULL 7 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-01-01';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p1001-01-01 system NULL NULL NULL NULL 1
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-00-00';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 ALL NULL NULL NULL NULL 7 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-00-00';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 ALL NULL NULL NULL NULL 7 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-00-00';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-00-00';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-00-00';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 pNULL ALL NULL NULL NULL NULL 7 Using where
|
||||
# Disabling warnings for the invalid date
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1999-02-31';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1999-02-31';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1999-02-31';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p2001-01-01,pNULL ALL NULL NULL NULL NULL 7 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1999-02-31';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p2001-01-01,pNULL ALL NULL NULL NULL NULL 7 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1999-02-31';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 pNULL ALL NULL NULL NULL NULL 7 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1001-01-01';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
|
||||
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
|
||||
DROP TABLE t1;
|
||||
# Test with DATETIME column NOT NULL
|
||||
CREATE TABLE t1 (
|
||||
a int(10) unsigned NOT NULL,
|
||||
|
|
|
@ -1,6 +1,99 @@
|
|||
drop table if exists t1, t2;
|
||||
create table t1 (a int)
|
||||
partition by range (a)
|
||||
( partition p0 values less than (NULL),
|
||||
partition p1 values less than (MAXVALUE));
|
||||
ERROR HY000: Not allowed to use NULL value in VALUES LESS THAN
|
||||
create table t1 (a datetime not null)
|
||||
partition by range (TO_SECONDS(a))
|
||||
( partition p0 VALUES LESS THAN (TO_SECONDS('2007-03-08 00:00:00')),
|
||||
partition p1 VALUES LESS THAN (TO_SECONDS('2007-04-01 00:00:00')));
|
||||
select partition_method, partition_expression, partition_description
|
||||
from information_schema.partitions where table_name = "t1";
|
||||
partition_method partition_expression partition_description
|
||||
RANGE TO_SECONDS(a) 63340531200
|
||||
RANGE TO_SECONDS(a) 63342604800
|
||||
INSERT INTO t1 VALUES ('2007-03-01 12:00:00'), ('2007-03-07 12:00:00');
|
||||
INSERT INTO t1 VALUES ('2007-03-08 12:00:00'), ('2007-03-15 12:00:00');
|
||||
explain partitions select * from t1 where a < '2007-03-08 00:00:00';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 2 Using where
|
||||
explain partitions select * from t1 where a < '2007-03-08 00:00:01';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 4 Using where
|
||||
explain partitions select * from t1 where a <= '2007-03-08 00:00:00';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 4 Using where
|
||||
explain partitions select * from t1 where a <= '2007-03-07 23:59:59';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where
|
||||
explain partitions select * from t1 where a < '2007-03-07 23:59:59';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where
|
||||
drop table t1;
|
||||
create table t1 (a date)
|
||||
partition by range(to_seconds(a))
|
||||
(partition p0 values less than (to_seconds('2004-01-01')),
|
||||
partition p1 values less than (to_seconds('2005-01-01')));
|
||||
insert into t1 values ('2003-12-30'),('2004-12-31');
|
||||
select * from t1;
|
||||
a
|
||||
2003-12-30
|
||||
2004-12-31
|
||||
explain partitions select * from t1 where a <= '2003-12-31';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0 system NULL NULL NULL NULL 1
|
||||
select * from t1 where a <= '2003-12-31';
|
||||
a
|
||||
2003-12-30
|
||||
explain partitions select * from t1 where a <= '2005-01-01';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 2 Using where
|
||||
select * from t1 where a <= '2005-01-01';
|
||||
a
|
||||
2003-12-30
|
||||
2004-12-31
|
||||
drop table t1;
|
||||
create table t1 (a datetime)
|
||||
partition by range(to_seconds(a))
|
||||
(partition p0 values less than (to_seconds('2004-01-01 12:00:00')),
|
||||
partition p1 values less than (to_seconds('2005-01-01 12:00:00')));
|
||||
insert into t1 values ('2004-01-01 11:59:29'),('2005-01-01 11:59:59');
|
||||
select * from t1;
|
||||
a
|
||||
2004-01-01 11:59:29
|
||||
2005-01-01 11:59:59
|
||||
explain partitions select * from t1 where a <= '2004-01-01 11:59.59';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0 system NULL NULL NULL NULL 1
|
||||
select * from t1 where a <= '2004-01-01 11:59:59';
|
||||
a
|
||||
2004-01-01 11:59:29
|
||||
explain partitions select * from t1 where a <= '2005-01-01';
|
||||
id select_type table partitions type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 2 Using where
|
||||
select * from t1 where a <= '2005-01-01';
|
||||
a
|
||||
2004-01-01 11:59:29
|
||||
drop table t1;
|
||||
create table t1 (a int, b char(20))
|
||||
partition by range columns(a,b)
|
||||
(partition p0 values less than (1));
|
||||
ERROR 42000: Inconsistency in usage of column lists for partitioning near '))' at line 3
|
||||
create table t1 (a int, b char(20))
|
||||
partition by range(a)
|
||||
(partition p0 values less than (1,"b"));
|
||||
ERROR HY000: Cannot have more than one value for this type of RANGE partitioning
|
||||
create table t1 (a int, b char(20))
|
||||
partition by range(a)
|
||||
(partition p0 values less than (1,"b"));
|
||||
ERROR HY000: Cannot have more than one value for this type of RANGE partitioning
|
||||
create table t1 (a int, b char(20))
|
||||
partition by range columns(b)
|
||||
(partition p0 values less than ("b"));
|
||||
drop table t1;
|
||||
create table t1 (a int)
|
||||
partition by range (a)
|
||||
( partition p0 values less than (maxvalue));
|
||||
alter table t1 add partition (partition p1 values less than (100000));
|
||||
ERROR HY000: MAXVALUE can only be used in last partition definition
|
||||
|
|
53
mysql-test/r/partition_utf8.result
Normal file
53
mysql-test/r/partition_utf8.result
Normal file
|
@ -0,0 +1,53 @@
|
|||
set names utf8;
|
||||
create table t1 (a varchar(2) character set cp1250)
|
||||
partition by list columns (a)
|
||||
( partition p0 values in (0x81));
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(2) CHARACTER SET cp1250 DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY LIST COLUMNS(a)
|
||||
(PARTITION p0 VALUES IN (_cp1250 0x81) ENGINE = MyISAM) */
|
||||
drop table t1;
|
||||
create table t1 (a varchar(2) character set cp1250)
|
||||
partition by list columns (a)
|
||||
( partition p0 values in (0x80));
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(2) CHARACTER SET cp1250 DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY LIST COLUMNS(a)
|
||||
(PARTITION p0 VALUES IN ('€') ENGINE = MyISAM) */
|
||||
drop table t1;
|
||||
create table t1 (a varchar(1500), b varchar(1570))
|
||||
partition by list columns(a,b)
|
||||
( partition p0 values in (('a','b')));
|
||||
ERROR HY000: The total length of the partitioning fields is too large
|
||||
create table t1 (a varchar(1023) character set utf8 collate utf8_spanish2_ci)
|
||||
partition by range columns(a)
|
||||
( partition p0 values less than ('CZ'),
|
||||
partition p1 values less than ('CH'),
|
||||
partition p2 values less than ('D'));
|
||||
insert into t1 values ('czz'),('chi'),('ci'),('cg');
|
||||
select * from t1 where a between 'cg' AND 'ci';
|
||||
a
|
||||
ci
|
||||
cg
|
||||
drop table t1;
|
||||
create table t1 (a varchar(2) character set ucs2)
|
||||
partition by list columns (a)
|
||||
(partition p0 values in (0x2020),
|
||||
partition p1 values in (''));
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(2) CHARACTER SET ucs2 DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
/*!50100 PARTITION BY LIST COLUMNS(a)
|
||||
(PARTITION p0 VALUES IN ('†') ENGINE = MyISAM,
|
||||
PARTITION p1 VALUES IN ('') ENGINE = MyISAM) */
|
||||
insert into t1 values ('');
|
||||
insert into t1 values (_ucs2 0x2020);
|
||||
drop table t1;
|
|
@ -298,6 +298,13 @@ id
|
|||
1
|
||||
2
|
||||
3
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'hello'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'hello'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'hello'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'hello'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'hello'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'hello'
|
||||
select @@profiling;
|
||||
@@profiling
|
||||
1
|
||||
|
|
|
@ -1194,13 +1194,13 @@ SET @aux= "SELECT COUNT(*)
|
|||
prepare my_stmt from @aux;
|
||||
execute my_stmt;
|
||||
COUNT(*)
|
||||
39
|
||||
40
|
||||
execute my_stmt;
|
||||
COUNT(*)
|
||||
39
|
||||
40
|
||||
execute my_stmt;
|
||||
COUNT(*)
|
||||
39
|
||||
40
|
||||
deallocate prepare my_stmt;
|
||||
drop procedure if exists p1|
|
||||
drop table if exists t1|
|
||||
|
@ -2926,4 +2926,165 @@ execute stmt;
|
|||
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
|
||||
drop table t1;
|
||||
deallocate prepare stmt;
|
||||
|
||||
End of 5.1 tests.
|
||||
|
||||
#
|
||||
# WL#4435: Support OUT-parameters in prepared statements.
|
||||
#
|
||||
|
||||
DROP PROCEDURE IF EXISTS p_string;
|
||||
DROP PROCEDURE IF EXISTS p_double;
|
||||
DROP PROCEDURE IF EXISTS p_int;
|
||||
DROP PROCEDURE IF EXISTS p_decimal;
|
||||
|
||||
CREATE PROCEDURE p_string(
|
||||
IN v0 INT,
|
||||
OUT v1 CHAR(32),
|
||||
IN v2 CHAR(32),
|
||||
INOUT v3 CHAR(32))
|
||||
BEGIN
|
||||
SET v0 = -1;
|
||||
SET v1 = 'test_v1';
|
||||
SET v2 = 'n/a';
|
||||
SET v3 = 'test_v3';
|
||||
END|
|
||||
|
||||
CREATE PROCEDURE p_double(
|
||||
IN v0 INT,
|
||||
OUT v1 DOUBLE(4, 2),
|
||||
IN v2 DOUBLE(4, 2),
|
||||
INOUT v3 DOUBLE(4, 2))
|
||||
BEGIN
|
||||
SET v0 = -1;
|
||||
SET v1 = 12.34;
|
||||
SET v2 = 98.67;
|
||||
SET v3 = 56.78;
|
||||
END|
|
||||
|
||||
CREATE PROCEDURE p_int(
|
||||
IN v0 CHAR(10),
|
||||
OUT v1 INT,
|
||||
IN v2 INT,
|
||||
INOUT v3 INT)
|
||||
BEGIN
|
||||
SET v0 = 'n/a';
|
||||
SET v1 = 1234;
|
||||
SET v2 = 9876;
|
||||
SET v3 = 5678;
|
||||
END|
|
||||
|
||||
CREATE PROCEDURE p_decimal(
|
||||
IN v0 INT,
|
||||
OUT v1 DECIMAL(4, 2),
|
||||
IN v2 DECIMAL(4, 2),
|
||||
INOUT v3 DECIMAL(4, 2))
|
||||
BEGIN
|
||||
SET v0 = -1;
|
||||
SET v1 = 12.34;
|
||||
SET v2 = 98.67;
|
||||
SET v3 = 56.78;
|
||||
END|
|
||||
|
||||
PREPARE stmt_str FROM 'CALL p_string(?, ?, ?, ?)';
|
||||
PREPARE stmt_dbl FROM 'CALL p_double(?, ?, ?, ?)';
|
||||
PREPARE stmt_int FROM 'CALL p_int(?, ?, ?, ?)';
|
||||
PREPARE stmt_dec FROM 'CALL p_decimal(?, ?, ?, ?)';
|
||||
|
||||
SET @x_str_1 = NULL;
|
||||
SET @x_str_2 = NULL;
|
||||
SET @x_str_3 = NULL;
|
||||
SET @x_dbl_1 = NULL;
|
||||
SET @x_dbl_2 = NULL;
|
||||
SET @x_dbl_3 = NULL;
|
||||
SET @x_int_1 = NULL;
|
||||
SET @x_int_2 = NULL;
|
||||
SET @x_int_3 = NULL;
|
||||
SET @x_dec_1 = NULL;
|
||||
SET @x_dec_2 = NULL;
|
||||
SET @x_dec_3 = NULL;
|
||||
|
||||
-- Testing strings...
|
||||
|
||||
EXECUTE stmt_str USING @x_int_1, @x_str_1, @x_str_2, @x_str_3;
|
||||
SELECT @x_int_1, @x_str_1, @x_str_2, @x_str_3;
|
||||
@x_int_1 @x_str_1 @x_str_2 @x_str_3
|
||||
NULL test_v1 NULL test_v3
|
||||
|
||||
EXECUTE stmt_str USING @x_int_1, @x_str_1, @x_str_2, @x_str_3;
|
||||
SELECT @x_int_1, @x_str_1, @x_str_2, @x_str_3;
|
||||
@x_int_1 @x_str_1 @x_str_2 @x_str_3
|
||||
NULL test_v1 NULL test_v3
|
||||
|
||||
-- Testing doubles...
|
||||
|
||||
EXECUTE stmt_dbl USING @x_int_1, @x_dbl_1, @x_dbl_2, @x_dbl_3;
|
||||
SELECT @x_int_1, @x_dbl_1, @x_dbl_2, @x_dbl_3;
|
||||
@x_int_1 @x_dbl_1 @x_dbl_2 @x_dbl_3
|
||||
NULL 12.34 NULL 56.78
|
||||
|
||||
EXECUTE stmt_dbl USING @x_int_1, @x_dbl_1, @x_dbl_2, @x_dbl_3;
|
||||
SELECT @x_int_1, @x_dbl_1, @x_dbl_2, @x_dbl_3;
|
||||
@x_int_1 @x_dbl_1 @x_dbl_2 @x_dbl_3
|
||||
NULL 12.34 NULL 56.78
|
||||
|
||||
-- Testing ints...
|
||||
|
||||
EXECUTE stmt_int USING @x_str_1, @x_int_1, @x_int_2, @x_int_3;
|
||||
SELECT @x_str_1, @x_int_1, @x_int_2, @x_int_3;
|
||||
@x_str_1 @x_int_1 @x_int_2 @x_int_3
|
||||
test_v1 1234 NULL 5678
|
||||
|
||||
EXECUTE stmt_int USING @x_str_1, @x_int_1, @x_int_2, @x_int_3;
|
||||
SELECT @x_str_1, @x_int_1, @x_int_2, @x_int_3;
|
||||
@x_str_1 @x_int_1 @x_int_2 @x_int_3
|
||||
test_v1 1234 NULL 5678
|
||||
|
||||
-- Testing decs...
|
||||
|
||||
EXECUTE stmt_dec USING @x_int_1, @x_dec_1, @x_dec_2, @x_dec_3;
|
||||
SELECT @x_int_1, @x_dec_1, @x_dec_2, @x_dec_3;
|
||||
@x_int_1 @x_dec_1 @x_dec_2 @x_dec_3
|
||||
1234 12.34 NULL 56.78
|
||||
|
||||
EXECUTE stmt_dec USING @x_int_1, @x_dec_1, @x_dec_2, @x_dec_3;
|
||||
SELECT @x_int_1, @x_dec_1, @x_dec_2, @x_dec_3;
|
||||
@x_int_1 @x_dec_1 @x_dec_2 @x_dec_3
|
||||
1234 12.34 NULL 56.78
|
||||
|
||||
DEALLOCATE PREPARE stmt_str;
|
||||
DEALLOCATE PREPARE stmt_dbl;
|
||||
DEALLOCATE PREPARE stmt_int;
|
||||
DEALLOCATE PREPARE stmt_dec;
|
||||
|
||||
DROP PROCEDURE p_string;
|
||||
DROP PROCEDURE p_double;
|
||||
DROP PROCEDURE p_int;
|
||||
DROP PROCEDURE p_decimal;
|
||||
|
||||
DROP PROCEDURE IF EXISTS p1;
|
||||
DROP PROCEDURE IF EXISTS p2;
|
||||
|
||||
CREATE PROCEDURE p1(OUT v1 CHAR(10))
|
||||
SET v1 = 'test1';
|
||||
|
||||
CREATE PROCEDURE p2(OUT v2 CHAR(10))
|
||||
BEGIN
|
||||
SET @query = 'CALL p1(?)';
|
||||
PREPARE stmt1 FROM @query;
|
||||
EXECUTE stmt1 USING @u1;
|
||||
DEALLOCATE PREPARE stmt1;
|
||||
SET v2 = @u1;
|
||||
END|
|
||||
|
||||
CALL p2(@a);
|
||||
SELECT @a;
|
||||
@a
|
||||
test1
|
||||
|
||||
DROP PROCEDURE p1;
|
||||
DROP PROCEDURE p2;
|
||||
|
||||
# End of WL#4435.
|
||||
|
||||
End of 6.0 tests.
|
||||
|
|
|
@ -279,6 +279,9 @@ b char(10) YES NULL
|
|||
SET @arg00=1;
|
||||
execute stmt4 using @arg00;
|
||||
Field Type Null Key Default Extra
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'a'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'b'
|
||||
prepare stmt4 from ' show columns from t2 from test like ''a%'' ';
|
||||
execute stmt4;
|
||||
Field Type Null Key Default Extra
|
||||
|
|
14
mysql-test/r/query_cache_disabled.result
Normal file
14
mysql-test/r/query_cache_disabled.result
Normal file
|
@ -0,0 +1,14 @@
|
|||
SHOW GLOBAL VARIABLES LIKE 'query_cache_type';
|
||||
Variable_name Value
|
||||
query_cache_type OFF
|
||||
SET GLOBAL query_cache_type=ON;
|
||||
ERROR HY000: Query cache is disabled; restart the server with query_cache_type=1 to enable it
|
||||
SET GLOBAL query_cache_type=DEMAND;
|
||||
ERROR HY000: Query cache is disabled; restart the server with query_cache_type=1 to enable it
|
||||
SET GLOBAL query_cache_type=OFF;
|
||||
ERROR HY000: Query cache is disabled; restart the server with query_cache_type=1 to enable it
|
||||
SET GLOBAL query_cache_size=1024*1024;
|
||||
SHOW GLOBAL VARIABLES LIKE 'query_cache_size';
|
||||
Variable_name Value
|
||||
query_cache_size 1048576
|
||||
SET GLOBAL query_cache_size=0;
|
|
@ -529,5 +529,46 @@ DROP DATABASE mysqltest1;
|
|||
use test;
|
||||
|
||||
########################################################################
|
||||
#
|
||||
# Bug#27430 Crash in subquery code when in PS and table DDL changed
|
||||
# after PREPARE
|
||||
# Check the effect of automatic reprepare on query cache
|
||||
#
|
||||
########################################################################
|
||||
drop table if exists t1;
|
||||
create table t1 (a varchar(255));
|
||||
insert into t1 (a) values ("Pack my box with five dozen liquor jugs.");
|
||||
flush status;
|
||||
prepare stmt from "select a from t1";
|
||||
execute stmt;
|
||||
a
|
||||
Pack my box with five dozen liquor jugs.
|
||||
set @@global.query_cache_size=0;
|
||||
alter table t1 add column b int;
|
||||
execute stmt;
|
||||
a
|
||||
Pack my box with five dozen liquor jugs.
|
||||
set @@global.query_cache_size=100000;
|
||||
execute stmt;
|
||||
a
|
||||
Pack my box with five dozen liquor jugs.
|
||||
execute stmt;
|
||||
a
|
||||
Pack my box with five dozen liquor jugs.
|
||||
#
|
||||
# Sic: ALTER TABLE caused an automatic reprepare
|
||||
# of the prepared statement. Since the query cache was disabled
|
||||
# at the time of reprepare, the new prepared statement doesn't
|
||||
# work with it.
|
||||
#
|
||||
show status like 'Qcache_hits';
|
||||
Variable_name Value
|
||||
Qcache_hits 0
|
||||
show status like 'Qcache_queries_in_cache';
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
# Cleanup
|
||||
deallocate prepare stmt;
|
||||
drop table t1;
|
||||
set @@global.query_cache_size=@initial_query_cache_size;
|
||||
flush status;
|
||||
|
|
|
@ -529,5 +529,46 @@ DROP DATABASE mysqltest1;
|
|||
use test;
|
||||
|
||||
########################################################################
|
||||
#
|
||||
# Bug#27430 Crash in subquery code when in PS and table DDL changed
|
||||
# after PREPARE
|
||||
# Check the effect of automatic reprepare on query cache
|
||||
#
|
||||
########################################################################
|
||||
drop table if exists t1;
|
||||
create table t1 (a varchar(255));
|
||||
insert into t1 (a) values ("Pack my box with five dozen liquor jugs.");
|
||||
flush status;
|
||||
prepare stmt from "select a from t1";
|
||||
execute stmt;
|
||||
a
|
||||
Pack my box with five dozen liquor jugs.
|
||||
set @@global.query_cache_size=0;
|
||||
alter table t1 add column b int;
|
||||
execute stmt;
|
||||
a
|
||||
Pack my box with five dozen liquor jugs.
|
||||
set @@global.query_cache_size=100000;
|
||||
execute stmt;
|
||||
a
|
||||
Pack my box with five dozen liquor jugs.
|
||||
execute stmt;
|
||||
a
|
||||
Pack my box with five dozen liquor jugs.
|
||||
#
|
||||
# Sic: ALTER TABLE caused an automatic reprepare
|
||||
# of the prepared statement. Since the query cache was disabled
|
||||
# at the time of reprepare, the new prepared statement doesn't
|
||||
# work with it.
|
||||
#
|
||||
show status like 'Qcache_hits';
|
||||
Variable_name Value
|
||||
Qcache_hits 0
|
||||
show status like 'Qcache_queries_in_cache';
|
||||
Variable_name Value
|
||||
Qcache_queries_in_cache 0
|
||||
# Cleanup
|
||||
deallocate prepare stmt;
|
||||
drop table t1;
|
||||
set @@global.query_cache_size=@initial_query_cache_size;
|
||||
flush status;
|
||||
|
|
|
@ -4435,7 +4435,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2;
|
|||
id select_type table type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
|
||||
Warnings:
|
||||
Note 1003 select '1' AS `a`,'1' AS `b` from `test`.`t1` where 1
|
||||
Note 1003 select '1' AS `a`,'1' AS `b` from dual where 1
|
||||
SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2;
|
||||
a b
|
||||
1 1
|
||||
|
|
|
@ -61,18 +61,18 @@ Table Op Msg_type Msg_text
|
|||
test.t1 check status OK
|
||||
show index from t1;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def STATISTICS TABLE_NAME Table 253 64 2 N 1 0 8
|
||||
def STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63
|
||||
def STATISTICS INDEX_NAME Key_name 253 64 7 N 1 0 8
|
||||
def STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63
|
||||
def STATISTICS COLUMN_NAME Column_name 253 64 1 N 1 0 8
|
||||
def STATISTICS COLLATION Collation 253 1 1 Y 0 0 8
|
||||
def STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63
|
||||
def STATISTICS SUB_PART Sub_part 8 3 0 Y 32768 0 63
|
||||
def STATISTICS PACKED Packed 253 10 0 Y 0 0 8
|
||||
def STATISTICS NULLABLE Null 253 3 0 N 1 0 8
|
||||
def STATISTICS INDEX_TYPE Index_type 253 16 5 N 1 0 8
|
||||
def STATISTICS COMMENT Comment 253 16 0 Y 0 0 8
|
||||
def information_schema STATISTICS STATISTICS TABLE_NAME Table 253 64 2 N 1 0 8
|
||||
def information_schema STATISTICS STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63
|
||||
def information_schema STATISTICS STATISTICS INDEX_NAME Key_name 253 64 7 N 1 0 8
|
||||
def information_schema STATISTICS STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63
|
||||
def information_schema STATISTICS STATISTICS COLUMN_NAME Column_name 253 64 1 N 1 0 8
|
||||
def information_schema STATISTICS STATISTICS COLLATION Collation 253 1 1 Y 0 0 8
|
||||
def information_schema STATISTICS STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63
|
||||
def information_schema STATISTICS STATISTICS SUB_PART Sub_part 8 3 0 Y 32768 0 63
|
||||
def information_schema STATISTICS STATISTICS PACKED Packed 253 10 0 Y 0 0 8
|
||||
def information_schema STATISTICS STATISTICS NULLABLE Null 253 3 0 N 1 0 8
|
||||
def information_schema STATISTICS STATISTICS INDEX_TYPE Index_type 253 16 5 N 1 0 8
|
||||
def information_schema STATISTICS STATISTICS COMMENT Comment 253 16 0 Y 0 0 8
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
t1 0 PRIMARY 1 a A 5 NULL NULL BTREE
|
||||
t1 1 b 1 b A 1 NULL NULL BTREE
|
||||
|
@ -99,45 +99,45 @@ drop table t1;
|
|||
-- after Bug#29394 is implemented.
|
||||
show variables like "wait_timeout%";
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8
|
||||
def VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8
|
||||
def information_schema VARIABLES VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8
|
||||
def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8
|
||||
Variable_name Value
|
||||
wait_timeout 28800
|
||||
show variables like "WAIT_timeout%";
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8
|
||||
def VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8
|
||||
def information_schema VARIABLES VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8
|
||||
def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8
|
||||
Variable_name Value
|
||||
wait_timeout 28800
|
||||
show variables like "this_doesn't_exists%";
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def VARIABLES VARIABLE_NAME Variable_name 253 64 0 N 1 0 8
|
||||
def VARIABLES VARIABLE_VALUE Value 253 1024 0 Y 0 0 8
|
||||
def information_schema VARIABLES VARIABLES VARIABLE_NAME Variable_name 253 64 0 N 1 0 8
|
||||
def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 1024 0 Y 0 0 8
|
||||
Variable_name Value
|
||||
show table status from test like "this_doesn't_exists%";
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def TABLES TABLE_NAME Name 253 64 0 N 1 0 8
|
||||
def TABLES ENGINE Engine 253 64 0 Y 0 0 8
|
||||
def TABLES VERSION Version 8 21 0 Y 32800 0 63
|
||||
def TABLES ROW_FORMAT Row_format 253 10 0 Y 0 0 8
|
||||
def TABLES TABLE_ROWS Rows 8 21 0 Y 32800 0 63
|
||||
def TABLES AVG_ROW_LENGTH Avg_row_length 8 21 0 Y 32800 0 63
|
||||
def TABLES DATA_LENGTH Data_length 8 21 0 Y 32800 0 63
|
||||
def TABLES MAX_DATA_LENGTH Max_data_length 8 21 0 Y 32800 0 63
|
||||
def TABLES INDEX_LENGTH Index_length 8 21 0 Y 32800 0 63
|
||||
def TABLES DATA_FREE Data_free 8 21 0 Y 32800 0 63
|
||||
def TABLES AUTO_INCREMENT Auto_increment 8 21 0 Y 32800 0 63
|
||||
def TABLES CREATE_TIME Create_time 12 19 0 Y 128 0 63
|
||||
def TABLES UPDATE_TIME Update_time 12 19 0 Y 128 0 63
|
||||
def TABLES CHECK_TIME Check_time 12 19 0 Y 128 0 63
|
||||
def TABLES TABLE_COLLATION Collation 253 32 0 Y 0 0 8
|
||||
def TABLES CHECKSUM Checksum 8 21 0 Y 32800 0 63
|
||||
def TABLES CREATE_OPTIONS Create_options 253 255 0 Y 0 0 8
|
||||
def TABLES TABLE_COMMENT Comment 253 80 0 N 1 0 8
|
||||
def information_schema TABLES TABLES TABLE_NAME Name 253 64 0 N 1 0 8
|
||||
def information_schema TABLES TABLES ENGINE Engine 253 64 0 Y 0 0 8
|
||||
def information_schema TABLES TABLES VERSION Version 8 21 0 Y 32800 0 63
|
||||
def information_schema TABLES TABLES ROW_FORMAT Row_format 253 10 0 Y 0 0 8
|
||||
def information_schema TABLES TABLES TABLE_ROWS Rows 8 21 0 Y 32800 0 63
|
||||
def information_schema TABLES TABLES AVG_ROW_LENGTH Avg_row_length 8 21 0 Y 32800 0 63
|
||||
def information_schema TABLES TABLES DATA_LENGTH Data_length 8 21 0 Y 32800 0 63
|
||||
def information_schema TABLES TABLES MAX_DATA_LENGTH Max_data_length 8 21 0 Y 32800 0 63
|
||||
def information_schema TABLES TABLES INDEX_LENGTH Index_length 8 21 0 Y 32800 0 63
|
||||
def information_schema TABLES TABLES DATA_FREE Data_free 8 21 0 Y 32800 0 63
|
||||
def information_schema TABLES TABLES AUTO_INCREMENT Auto_increment 8 21 0 Y 32800 0 63
|
||||
def information_schema TABLES TABLES CREATE_TIME Create_time 12 19 0 Y 128 0 63
|
||||
def information_schema TABLES TABLES UPDATE_TIME Update_time 12 19 0 Y 128 0 63
|
||||
def information_schema TABLES TABLES CHECK_TIME Check_time 12 19 0 Y 128 0 63
|
||||
def information_schema TABLES TABLES TABLE_COLLATION Collation 253 32 0 Y 0 0 8
|
||||
def information_schema TABLES TABLES CHECKSUM Checksum 8 21 0 Y 32800 0 63
|
||||
def information_schema TABLES TABLES CREATE_OPTIONS Create_options 253 255 0 Y 0 0 8
|
||||
def information_schema TABLES TABLES TABLE_COMMENT Comment 253 80 0 N 1 0 8
|
||||
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
|
||||
show databases;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def SCHEMATA SCHEMA_NAME Database 253 64 18 N 1 0 8
|
||||
def information_schema SCHEMATA SCHEMATA SCHEMA_NAME Database 253 64 18 N 1 0 8
|
||||
Database
|
||||
information_schema
|
||||
mtr
|
||||
|
@ -145,7 +145,7 @@ mysql
|
|||
test
|
||||
show databases like "test%";
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def SCHEMATA SCHEMA_NAME Database (test%) 253 64 4 N 1 0 8
|
||||
def information_schema SCHEMATA SCHEMATA SCHEMA_NAME Database (test%) 253 64 4 N 1 0 8
|
||||
Database (test%)
|
||||
test
|
||||
create table t1 (f1 int not null, f2 int not null, f3 int not null, f4 int not null, primary key(f1,f2,f3,f4));
|
||||
|
@ -626,18 +626,18 @@ PRIMARY KEY(field1(1000))
|
|||
);
|
||||
show index from t1;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def STATISTICS TABLE_NAME Table 253 64 2 N 1 0 63
|
||||
def STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63
|
||||
def STATISTICS INDEX_NAME Key_name 253 64 7 N 1 0 63
|
||||
def STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63
|
||||
def STATISTICS COLUMN_NAME Column_name 253 64 6 N 1 0 63
|
||||
def STATISTICS COLLATION Collation 253 1 1 Y 0 0 63
|
||||
def STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63
|
||||
def STATISTICS SUB_PART Sub_part 8 3 4 Y 32768 0 63
|
||||
def STATISTICS PACKED Packed 253 10 0 Y 0 0 63
|
||||
def STATISTICS NULLABLE Null 253 3 0 N 1 0 63
|
||||
def STATISTICS INDEX_TYPE Index_type 253 16 5 N 1 0 63
|
||||
def STATISTICS COMMENT Comment 253 16 0 Y 0 0 63
|
||||
def information_schema STATISTICS STATISTICS TABLE_NAME Table 253 64 2 N 1 0 63
|
||||
def information_schema STATISTICS STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63
|
||||
def information_schema STATISTICS STATISTICS INDEX_NAME Key_name 253 64 7 N 1 0 63
|
||||
def information_schema STATISTICS STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63
|
||||
def information_schema STATISTICS STATISTICS COLUMN_NAME Column_name 253 64 6 N 1 0 63
|
||||
def information_schema STATISTICS STATISTICS COLLATION Collation 253 1 1 Y 0 0 63
|
||||
def information_schema STATISTICS STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63
|
||||
def information_schema STATISTICS STATISTICS SUB_PART Sub_part 8 3 4 Y 32768 0 63
|
||||
def information_schema STATISTICS STATISTICS PACKED Packed 253 10 0 Y 0 0 63
|
||||
def information_schema STATISTICS STATISTICS NULLABLE Null 253 3 0 N 1 0 63
|
||||
def information_schema STATISTICS STATISTICS INDEX_TYPE Index_type 253 16 5 N 1 0 63
|
||||
def information_schema STATISTICS STATISTICS COMMENT Comment 253 16 0 Y 0 0 63
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
t1 0 PRIMARY 1 field1 A 0 1000 NULL BTREE
|
||||
drop table t1;
|
||||
|
@ -808,7 +808,6 @@ show plugins;
|
|||
show columns in t1;
|
||||
show slave hosts;
|
||||
show keys in t1;
|
||||
show column types;
|
||||
show table types;
|
||||
show storage engines;
|
||||
show authors;
|
||||
|
@ -859,21 +858,21 @@ set names utf8;
|
|||
----------------------------------------------------------------
|
||||
SHOW CHARACTER SET LIKE 'utf8';
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def CHARACTER_SETS CHARACTER_SET_NAME Charset 253 96 4 N 1 0 33
|
||||
def CHARACTER_SETS DESCRIPTION Description 253 180 13 N 1 0 33
|
||||
def CHARACTER_SETS DEFAULT_COLLATE_NAME Default collation 253 96 15 N 1 0 33
|
||||
def CHARACTER_SETS MAXLEN Maxlen 8 3 1 N 32769 0 63
|
||||
def information_schema CHARACTER_SETS CHARACTER_SETS CHARACTER_SET_NAME Charset 253 96 4 N 1 0 33
|
||||
def information_schema CHARACTER_SETS CHARACTER_SETS DESCRIPTION Description 253 180 13 N 1 0 33
|
||||
def information_schema CHARACTER_SETS CHARACTER_SETS DEFAULT_COLLATE_NAME Default collation 253 96 15 N 1 0 33
|
||||
def information_schema CHARACTER_SETS CHARACTER_SETS MAXLEN Maxlen 8 3 1 N 32769 0 63
|
||||
Charset Description Default collation Maxlen
|
||||
utf8 UTF-8 Unicode utf8_general_ci 3
|
||||
----------------------------------------------------------------
|
||||
SHOW COLLATION LIKE 'latin1_bin';
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def COLLATIONS COLLATION_NAME Collation 253 96 10 N 1 0 33
|
||||
def COLLATIONS CHARACTER_SET_NAME Charset 253 96 6 N 1 0 33
|
||||
def COLLATIONS ID Id 8 11 2 N 32769 0 63
|
||||
def COLLATIONS IS_DEFAULT Default 253 9 0 N 1 0 33
|
||||
def COLLATIONS IS_COMPILED Compiled 253 9 3 N 1 0 33
|
||||
def COLLATIONS SORTLEN Sortlen 8 3 1 N 32769 0 63
|
||||
def information_schema COLLATIONS COLLATIONS COLLATION_NAME Collation 253 96 10 N 1 0 33
|
||||
def information_schema COLLATIONS COLLATIONS CHARACTER_SET_NAME Charset 253 96 6 N 1 0 33
|
||||
def information_schema COLLATIONS COLLATIONS ID Id 8 11 2 N 32769 0 63
|
||||
def information_schema COLLATIONS COLLATIONS IS_DEFAULT Default 253 9 0 N 1 0 33
|
||||
def information_schema COLLATIONS COLLATIONS IS_COMPILED Compiled 253 9 3 N 1 0 33
|
||||
def information_schema COLLATIONS COLLATIONS SORTLEN Sortlen 8 3 1 N 32769 0 63
|
||||
Collation Charset Id Default Compiled Sortlen
|
||||
latin1_bin latin1 47 Yes 1
|
||||
----------------------------------------------------------------
|
||||
|
@ -886,7 +885,7 @@ mysqltest1 CREATE DATABASE `mysqltest1` /*!40100 DEFAULT CHARACTER SET latin1 */
|
|||
----------------------------------------------------------------
|
||||
SHOW DATABASES LIKE 'mysqltest1';
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def SCHEMATA SCHEMA_NAME Database (mysqltest1) 253 192 10 N 1 0 33
|
||||
def information_schema SCHEMATA SCHEMATA SCHEMA_NAME Database (mysqltest1) 253 192 10 N 1 0 33
|
||||
Database (mysqltest1)
|
||||
mysqltest1
|
||||
----------------------------------------------------------------
|
||||
|
@ -902,18 +901,18 @@ t1 CREATE TABLE `t1` (
|
|||
----------------------------------------------------------------
|
||||
SHOW INDEX FROM t1;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def STATISTICS TABLE_NAME Table 253 192 2 N 1 0 33
|
||||
def STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63
|
||||
def STATISTICS INDEX_NAME Key_name 253 192 7 N 1 0 33
|
||||
def STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63
|
||||
def STATISTICS COLUMN_NAME Column_name 253 192 1 N 1 0 33
|
||||
def STATISTICS COLLATION Collation 253 3 1 Y 0 0 33
|
||||
def STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63
|
||||
def STATISTICS SUB_PART Sub_part 8 3 0 Y 32768 0 63
|
||||
def STATISTICS PACKED Packed 253 30 0 Y 0 0 33
|
||||
def STATISTICS NULLABLE Null 253 9 0 N 1 0 33
|
||||
def STATISTICS INDEX_TYPE Index_type 253 48 5 N 1 0 33
|
||||
def STATISTICS COMMENT Comment 253 48 0 Y 0 0 33
|
||||
def information_schema STATISTICS STATISTICS TABLE_NAME Table 253 192 2 N 1 0 33
|
||||
def information_schema STATISTICS STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63
|
||||
def information_schema STATISTICS STATISTICS INDEX_NAME Key_name 253 192 7 N 1 0 33
|
||||
def information_schema STATISTICS STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63
|
||||
def information_schema STATISTICS STATISTICS COLUMN_NAME Column_name 253 192 1 N 1 0 33
|
||||
def information_schema STATISTICS STATISTICS COLLATION Collation 253 3 1 Y 0 0 33
|
||||
def information_schema STATISTICS STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63
|
||||
def information_schema STATISTICS STATISTICS SUB_PART Sub_part 8 3 0 Y 32768 0 63
|
||||
def information_schema STATISTICS STATISTICS PACKED Packed 253 30 0 Y 0 0 33
|
||||
def information_schema STATISTICS STATISTICS NULLABLE Null 253 9 0 N 1 0 33
|
||||
def information_schema STATISTICS STATISTICS INDEX_TYPE Index_type 253 48 5 N 1 0 33
|
||||
def information_schema STATISTICS STATISTICS COMMENT Comment 253 48 0 Y 0 0 33
|
||||
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
|
||||
t1 0 PRIMARY 1 c A 0 NULL NULL BTREE
|
||||
----------------------------------------------------------------
|
||||
|
@ -930,17 +929,17 @@ TABLE_COMMENT
|
|||
FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE table_name = 't1';
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def TABLES TABLE_CATALOG TABLE_CATALOG 253 1536 0 Y 0 0 33
|
||||
def TABLES TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33
|
||||
def TABLES TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33
|
||||
def TABLES TABLE_TYPE TABLE_TYPE 253 192 10 N 1 0 33
|
||||
def TABLES ENGINE ENGINE 253 192 6 Y 0 0 33
|
||||
def TABLES ROW_FORMAT ROW_FORMAT 253 30 5 Y 0 0 33
|
||||
def TABLES TABLE_COLLATION TABLE_COLLATION 253 96 17 Y 0 0 33
|
||||
def TABLES CREATE_OPTIONS CREATE_OPTIONS 253 765 0 Y 0 0 33
|
||||
def TABLES TABLE_COMMENT TABLE_COMMENT 253 240 0 N 1 0 33
|
||||
def information_schema TABLES TABLES TABLE_CATALOG TABLE_CATALOG 253 1536 3 N 1 0 33
|
||||
def information_schema TABLES TABLES TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33
|
||||
def information_schema TABLES TABLES TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33
|
||||
def information_schema TABLES TABLES TABLE_TYPE TABLE_TYPE 253 192 10 N 1 0 33
|
||||
def information_schema TABLES TABLES ENGINE ENGINE 253 192 6 Y 0 0 33
|
||||
def information_schema TABLES TABLES ROW_FORMAT ROW_FORMAT 253 30 5 Y 0 0 33
|
||||
def information_schema TABLES TABLES TABLE_COLLATION TABLE_COLLATION 253 96 17 Y 0 0 33
|
||||
def information_schema TABLES TABLES CREATE_OPTIONS CREATE_OPTIONS 253 765 0 Y 0 0 33
|
||||
def information_schema TABLES TABLES TABLE_COMMENT TABLE_COMMENT 253 240 0 N 1 0 33
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_COLLATION CREATE_OPTIONS TABLE_COMMENT
|
||||
NULL test t1 BASE TABLE MyISAM Fixed latin1_swedish_ci
|
||||
def test t1 BASE TABLE MyISAM Fixed latin1_swedish_ci
|
||||
----------------------------------------------------------------
|
||||
SELECT
|
||||
TABLE_CATALOG,
|
||||
|
@ -960,53 +959,53 @@ COLUMN_COMMENT
|
|||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE table_name = 't1';
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def COLUMNS TABLE_CATALOG TABLE_CATALOG 253 1536 0 Y 0 0 33
|
||||
def COLUMNS TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33
|
||||
def COLUMNS TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33
|
||||
def COLUMNS COLUMN_NAME COLUMN_NAME 253 192 1 N 1 0 33
|
||||
def COLUMNS COLUMN_DEFAULT COLUMN_DEFAULT 252 589815 0 Y 16 0 33
|
||||
def COLUMNS IS_NULLABLE IS_NULLABLE 253 9 2 N 1 0 33
|
||||
def COLUMNS DATA_TYPE DATA_TYPE 253 192 3 N 1 0 33
|
||||
def COLUMNS CHARACTER_SET_NAME CHARACTER_SET_NAME 253 96 0 Y 0 0 33
|
||||
def COLUMNS COLLATION_NAME COLLATION_NAME 253 96 0 Y 0 0 33
|
||||
def COLUMNS COLUMN_TYPE COLUMN_TYPE 252 589815 7 N 17 0 33
|
||||
def COLUMNS COLUMN_KEY COLUMN_KEY 253 9 3 N 1 0 33
|
||||
def COLUMNS EXTRA EXTRA 253 81 0 N 1 0 33
|
||||
def COLUMNS PRIVILEGES PRIVILEGES 253 240 31 N 1 0 33
|
||||
def COLUMNS COLUMN_COMMENT COLUMN_COMMENT 253 765 0 N 1 0 33
|
||||
def information_schema COLUMNS COLUMNS TABLE_CATALOG TABLE_CATALOG 253 1536 3 N 1 0 33
|
||||
def information_schema COLUMNS COLUMNS TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33
|
||||
def information_schema COLUMNS COLUMNS TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33
|
||||
def information_schema COLUMNS COLUMNS COLUMN_NAME COLUMN_NAME 253 192 1 N 1 0 33
|
||||
def information_schema COLUMNS COLUMNS COLUMN_DEFAULT COLUMN_DEFAULT 252 589815 0 Y 16 0 33
|
||||
def information_schema COLUMNS COLUMNS IS_NULLABLE IS_NULLABLE 253 9 2 N 1 0 33
|
||||
def information_schema COLUMNS COLUMNS DATA_TYPE DATA_TYPE 253 192 3 N 1 0 33
|
||||
def information_schema COLUMNS COLUMNS CHARACTER_SET_NAME CHARACTER_SET_NAME 253 96 0 Y 0 0 33
|
||||
def information_schema COLUMNS COLUMNS COLLATION_NAME COLLATION_NAME 253 96 0 Y 0 0 33
|
||||
def information_schema COLUMNS COLUMNS COLUMN_TYPE COLUMN_TYPE 252 589815 7 N 17 0 33
|
||||
def information_schema COLUMNS COLUMNS COLUMN_KEY COLUMN_KEY 253 9 3 N 1 0 33
|
||||
def information_schema COLUMNS COLUMNS EXTRA EXTRA 253 81 0 N 1 0 33
|
||||
def information_schema COLUMNS COLUMNS PRIVILEGES PRIVILEGES 253 240 31 N 1 0 33
|
||||
def information_schema COLUMNS COLUMNS COLUMN_COMMENT COLUMN_COMMENT 253 765 0 N 1 0 33
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
|
||||
NULL test t1 c NULL NO int NULL NULL int(11) PRI select,insert,update,references
|
||||
def test t1 c NULL NO int NULL NULL int(11) PRI select,insert,update,references
|
||||
----------------------------------------------------------------
|
||||
SHOW TABLES LIKE 't1';
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def TABLE_NAMES TABLE_NAME Tables_in_test (t1) 253 192 2 N 1 0 33
|
||||
def information_schema TABLE_NAMES TABLE_NAMES TABLE_NAME Tables_in_test (t1) 253 192 2 N 1 0 33
|
||||
Tables_in_test (t1)
|
||||
t1
|
||||
----------------------------------------------------------------
|
||||
SHOW COLUMNS FROM t1;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def COLUMNS COLUMN_NAME Field 253 192 1 N 1 0 33
|
||||
def COLUMNS COLUMN_TYPE Type 252 589815 7 N 17 0 33
|
||||
def COLUMNS IS_NULLABLE Null 253 9 2 N 1 0 33
|
||||
def COLUMNS COLUMN_KEY Key 253 9 3 N 1 0 33
|
||||
def COLUMNS COLUMN_DEFAULT Default 252 589815 0 Y 16 0 33
|
||||
def COLUMNS EXTRA Extra 253 81 0 N 1 0 33
|
||||
def information_schema COLUMNS COLUMNS COLUMN_NAME Field 253 192 1 N 1 0 33
|
||||
def information_schema COLUMNS COLUMNS COLUMN_TYPE Type 252 589815 7 N 17 0 33
|
||||
def information_schema COLUMNS COLUMNS IS_NULLABLE Null 253 9 2 N 1 0 33
|
||||
def information_schema COLUMNS COLUMNS COLUMN_KEY Key 253 9 3 N 1 0 33
|
||||
def information_schema COLUMNS COLUMNS COLUMN_DEFAULT Default 252 589815 0 Y 16 0 33
|
||||
def information_schema COLUMNS COLUMNS EXTRA Extra 253 81 0 N 1 0 33
|
||||
Field Type Null Key Default Extra
|
||||
c int(11) NO PRI NULL
|
||||
----------------------------------------------------------------
|
||||
SHOW TRIGGERS LIKE 't1';
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def TRIGGERS TRIGGER_NAME Trigger 253 192 5 N 1 0 33
|
||||
def TRIGGERS EVENT_MANIPULATION Event 253 18 6 N 1 0 33
|
||||
def TRIGGERS EVENT_OBJECT_TABLE Table 253 192 2 N 1 0 33
|
||||
def TRIGGERS ACTION_STATEMENT Statement 252 589815 10 N 17 0 33
|
||||
def TRIGGERS ACTION_TIMING Timing 253 18 6 N 1 0 33
|
||||
def TRIGGERS CREATED Created 12 19 0 Y 128 0 63
|
||||
def TRIGGERS SQL_MODE sql_mode 253 24576 0 N 1 0 33
|
||||
def TRIGGERS DEFINER Definer 253 231 14 N 1 0 33
|
||||
def TRIGGERS CHARACTER_SET_CLIENT character_set_client 253 96 6 N 1 0 33
|
||||
def TRIGGERS COLLATION_CONNECTION collation_connection 253 96 6 N 1 0 33
|
||||
def TRIGGERS DATABASE_COLLATION Database Collation 253 96 17 N 1 0 33
|
||||
def information_schema TRIGGERS TRIGGERS TRIGGER_NAME Trigger 253 192 5 N 1 0 33
|
||||
def information_schema TRIGGERS TRIGGERS EVENT_MANIPULATION Event 253 18 6 N 1 0 33
|
||||
def information_schema TRIGGERS TRIGGERS EVENT_OBJECT_TABLE Table 253 192 2 N 1 0 33
|
||||
def information_schema TRIGGERS TRIGGERS ACTION_STATEMENT Statement 252 589815 10 N 17 0 33
|
||||
def information_schema TRIGGERS TRIGGERS ACTION_TIMING Timing 253 18 6 N 1 0 33
|
||||
def information_schema TRIGGERS TRIGGERS CREATED Created 12 19 0 Y 128 0 63
|
||||
def information_schema TRIGGERS TRIGGERS SQL_MODE sql_mode 253 24576 0 N 1 0 33
|
||||
def information_schema TRIGGERS TRIGGERS DEFINER Definer 253 231 14 N 1 0 33
|
||||
def information_schema TRIGGERS TRIGGERS CHARACTER_SET_CLIENT character_set_client 253 96 6 N 1 0 33
|
||||
def information_schema TRIGGERS TRIGGERS COLLATION_CONNECTION collation_connection 253 96 6 N 1 0 33
|
||||
def information_schema TRIGGERS TRIGGERS DATABASE_COLLATION Database Collation 253 96 17 N 1 0 33
|
||||
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
|
||||
t1_bi INSERT t1 SET @a = 1 BEFORE NULL root@localhost binary binary latin1_swedish_ci
|
||||
----------------------------------------------------------------
|
||||
|
@ -1031,25 +1030,25 @@ DEFINER
|
|||
FROM INFORMATION_SCHEMA.TRIGGERS
|
||||
WHERE trigger_name = 't1_bi';
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def TRIGGERS TRIGGER_CATALOG TRIGGER_CATALOG 253 1536 0 Y 0 0 33
|
||||
def TRIGGERS TRIGGER_SCHEMA TRIGGER_SCHEMA 253 192 4 N 1 0 33
|
||||
def TRIGGERS TRIGGER_NAME TRIGGER_NAME 253 192 5 N 1 0 33
|
||||
def TRIGGERS EVENT_MANIPULATION EVENT_MANIPULATION 253 18 6 N 1 0 33
|
||||
def TRIGGERS EVENT_OBJECT_CATALOG EVENT_OBJECT_CATALOG 253 1536 0 Y 0 0 33
|
||||
def TRIGGERS EVENT_OBJECT_SCHEMA EVENT_OBJECT_SCHEMA 253 192 4 N 1 0 33
|
||||
def TRIGGERS EVENT_OBJECT_TABLE EVENT_OBJECT_TABLE 253 192 2 N 1 0 33
|
||||
def TRIGGERS ACTION_CONDITION ACTION_CONDITION 252 589815 0 Y 16 0 33
|
||||
def TRIGGERS ACTION_STATEMENT ACTION_STATEMENT 252 589815 10 N 17 0 33
|
||||
def TRIGGERS ACTION_ORIENTATION ACTION_ORIENTATION 253 27 3 N 1 0 33
|
||||
def TRIGGERS ACTION_TIMING ACTION_TIMING 253 18 6 N 1 0 33
|
||||
def TRIGGERS ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_OLD_TABLE 253 192 0 Y 0 0 33
|
||||
def TRIGGERS ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_NEW_TABLE 253 192 0 Y 0 0 33
|
||||
def TRIGGERS ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_OLD_ROW 253 9 3 N 1 0 33
|
||||
def TRIGGERS ACTION_REFERENCE_NEW_ROW ACTION_REFERENCE_NEW_ROW 253 9 3 N 1 0 33
|
||||
def TRIGGERS SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
|
||||
def TRIGGERS DEFINER DEFINER 253 231 14 N 1 0 33
|
||||
def information_schema TRIGGERS TRIGGERS TRIGGER_CATALOG TRIGGER_CATALOG 253 1536 3 N 1 0 33
|
||||
def information_schema TRIGGERS TRIGGERS TRIGGER_SCHEMA TRIGGER_SCHEMA 253 192 4 N 1 0 33
|
||||
def information_schema TRIGGERS TRIGGERS TRIGGER_NAME TRIGGER_NAME 253 192 5 N 1 0 33
|
||||
def information_schema TRIGGERS TRIGGERS EVENT_MANIPULATION EVENT_MANIPULATION 253 18 6 N 1 0 33
|
||||
def information_schema TRIGGERS TRIGGERS EVENT_OBJECT_CATALOG EVENT_OBJECT_CATALOG 253 1536 3 N 1 0 33
|
||||
def information_schema TRIGGERS TRIGGERS EVENT_OBJECT_SCHEMA EVENT_OBJECT_SCHEMA 253 192 4 N 1 0 33
|
||||
def information_schema TRIGGERS TRIGGERS EVENT_OBJECT_TABLE EVENT_OBJECT_TABLE 253 192 2 N 1 0 33
|
||||
def information_schema TRIGGERS TRIGGERS ACTION_CONDITION ACTION_CONDITION 252 589815 0 Y 16 0 33
|
||||
def information_schema TRIGGERS TRIGGERS ACTION_STATEMENT ACTION_STATEMENT 252 589815 10 N 17 0 33
|
||||
def information_schema TRIGGERS TRIGGERS ACTION_ORIENTATION ACTION_ORIENTATION 253 27 3 N 1 0 33
|
||||
def information_schema TRIGGERS TRIGGERS ACTION_TIMING ACTION_TIMING 253 18 6 N 1 0 33
|
||||
def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_OLD_TABLE 253 192 0 Y 0 0 33
|
||||
def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_NEW_TABLE 253 192 0 Y 0 0 33
|
||||
def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_OLD_ROW 253 9 3 N 1 0 33
|
||||
def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_NEW_ROW ACTION_REFERENCE_NEW_ROW 253 9 3 N 1 0 33
|
||||
def information_schema TRIGGERS TRIGGERS SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
|
||||
def information_schema TRIGGERS TRIGGERS DEFINER DEFINER 253 231 14 N 1 0 33
|
||||
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW SQL_MODE DEFINER
|
||||
NULL test t1_bi INSERT NULL test t1 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW root@localhost
|
||||
def test t1_bi INSERT def test t1 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW root@localhost
|
||||
----------------------------------------------------------------
|
||||
SHOW CREATE VIEW v1;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
|
@ -1064,18 +1063,18 @@ SELECT *
|
|||
FROM INFORMATION_SCHEMA.VIEWS
|
||||
WHERE table_name = 'v1';
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def VIEWS TABLE_CATALOG TABLE_CATALOG 253 1536 0 Y 0 0 33
|
||||
def VIEWS TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33
|
||||
def VIEWS TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33
|
||||
def VIEWS VIEW_DEFINITION VIEW_DEFINITION 252 589815 15 N 17 0 33
|
||||
def VIEWS CHECK_OPTION CHECK_OPTION 253 24 4 N 1 0 33
|
||||
def VIEWS IS_UPDATABLE IS_UPDATABLE 253 9 2 N 1 0 33
|
||||
def VIEWS DEFINER DEFINER 253 231 14 N 1 0 33
|
||||
def VIEWS SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
|
||||
def VIEWS CHARACTER_SET_CLIENT CHARACTER_SET_CLIENT 253 96 6 N 1 0 33
|
||||
def VIEWS COLLATION_CONNECTION COLLATION_CONNECTION 253 96 6 N 1 0 33
|
||||
def information_schema VIEWS VIEWS TABLE_CATALOG TABLE_CATALOG 253 1536 3 N 1 0 33
|
||||
def information_schema VIEWS VIEWS TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33
|
||||
def information_schema VIEWS VIEWS TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33
|
||||
def information_schema VIEWS VIEWS VIEW_DEFINITION VIEW_DEFINITION 252 589815 15 N 17 0 33
|
||||
def information_schema VIEWS VIEWS CHECK_OPTION CHECK_OPTION 253 24 4 N 1 0 33
|
||||
def information_schema VIEWS VIEWS IS_UPDATABLE IS_UPDATABLE 253 9 2 N 1 0 33
|
||||
def information_schema VIEWS VIEWS DEFINER DEFINER 253 231 14 N 1 0 33
|
||||
def information_schema VIEWS VIEWS SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
|
||||
def information_schema VIEWS VIEWS CHARACTER_SET_CLIENT CHARACTER_SET_CLIENT 253 96 6 N 1 0 33
|
||||
def information_schema VIEWS VIEWS COLLATION_CONNECTION COLLATION_CONNECTION 253 96 6 N 1 0 33
|
||||
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
|
||||
NULL test v1 select 1 AS `1` NONE NO root@localhost DEFINER binary binary
|
||||
def test v1 select 1 AS `1` NONE NO root@localhost DEFINER binary binary
|
||||
----------------------------------------------------------------
|
||||
SHOW CREATE PROCEDURE p1;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
|
@ -1111,26 +1110,26 @@ DEFINER
|
|||
FROM INFORMATION_SCHEMA.ROUTINES
|
||||
WHERE routine_name = 'p1';
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def ROUTINES SPECIFIC_NAME SPECIFIC_NAME 253 192 2 N 1 0 33
|
||||
def ROUTINES ROUTINE_CATALOG ROUTINE_CATALOG 253 1536 0 Y 0 0 33
|
||||
def ROUTINES ROUTINE_SCHEMA ROUTINE_SCHEMA 253 192 4 N 1 0 33
|
||||
def ROUTINES ROUTINE_NAME ROUTINE_NAME 253 192 2 N 1 0 33
|
||||
def ROUTINES ROUTINE_TYPE ROUTINE_TYPE 253 27 9 N 1 0 33
|
||||
def ROUTINES DTD_IDENTIFIER DTD_IDENTIFIER 253 192 0 Y 0 0 33
|
||||
def ROUTINES ROUTINE_BODY ROUTINE_BODY 253 24 3 N 1 0 33
|
||||
def ROUTINES ROUTINE_DEFINITION ROUTINE_DEFINITION 252 589815 8 Y 16 0 33
|
||||
def ROUTINES EXTERNAL_NAME EXTERNAL_NAME 253 192 0 Y 0 0 33
|
||||
def ROUTINES EXTERNAL_LANGUAGE EXTERNAL_LANGUAGE 253 192 0 Y 0 0 33
|
||||
def ROUTINES PARAMETER_STYLE PARAMETER_STYLE 253 24 3 N 1 0 33
|
||||
def ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 2 N 1 0 33
|
||||
def ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33
|
||||
def ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33
|
||||
def ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
|
||||
def ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
|
||||
def ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 253 192 0 N 1 0 33
|
||||
def ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33
|
||||
def information_schema ROUTINES ROUTINES SPECIFIC_NAME SPECIFIC_NAME 253 192 2 N 1 0 33
|
||||
def information_schema ROUTINES ROUTINES ROUTINE_CATALOG ROUTINE_CATALOG 253 1536 3 N 1 0 33
|
||||
def information_schema ROUTINES ROUTINES ROUTINE_SCHEMA ROUTINE_SCHEMA 253 192 4 N 1 0 33
|
||||
def information_schema ROUTINES ROUTINES ROUTINE_NAME ROUTINE_NAME 253 192 2 N 1 0 33
|
||||
def information_schema ROUTINES ROUTINES ROUTINE_TYPE ROUTINE_TYPE 253 27 9 N 1 0 33
|
||||
def information_schema ROUTINES ROUTINES DTD_IDENTIFIER DTD_IDENTIFIER 253 192 0 Y 0 0 33
|
||||
def information_schema ROUTINES ROUTINES ROUTINE_BODY ROUTINE_BODY 253 24 3 N 1 0 33
|
||||
def information_schema ROUTINES ROUTINES ROUTINE_DEFINITION ROUTINE_DEFINITION 252 589815 8 Y 16 0 33
|
||||
def information_schema ROUTINES ROUTINES EXTERNAL_NAME EXTERNAL_NAME 253 192 0 Y 0 0 33
|
||||
def information_schema ROUTINES ROUTINES EXTERNAL_LANGUAGE EXTERNAL_LANGUAGE 253 192 0 Y 0 0 33
|
||||
def information_schema ROUTINES ROUTINES PARAMETER_STYLE PARAMETER_STYLE 253 24 3 N 1 0 33
|
||||
def information_schema ROUTINES ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 2 N 1 0 33
|
||||
def information_schema ROUTINES ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33
|
||||
def information_schema ROUTINES ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33
|
||||
def information_schema ROUTINES ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
|
||||
def information_schema ROUTINES ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
|
||||
def information_schema ROUTINES ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 252 589815 0 N 17 0 33
|
||||
def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33
|
||||
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 SQL_MODE ROUTINE_COMMENT DEFINER
|
||||
p1 NULL test p1 PROCEDURE NULL SQL SELECT 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost
|
||||
p1 def test p1 PROCEDURE NULL SQL SELECT 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost
|
||||
----------------------------------------------------------------
|
||||
SHOW CREATE FUNCTION f1;
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
|
@ -1166,26 +1165,26 @@ DEFINER
|
|||
FROM INFORMATION_SCHEMA.ROUTINES
|
||||
WHERE routine_name = 'f1';
|
||||
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
|
||||
def ROUTINES SPECIFIC_NAME SPECIFIC_NAME 253 192 2 N 1 0 33
|
||||
def ROUTINES ROUTINE_CATALOG ROUTINE_CATALOG 253 1536 0 Y 0 0 33
|
||||
def ROUTINES ROUTINE_SCHEMA ROUTINE_SCHEMA 253 192 4 N 1 0 33
|
||||
def ROUTINES ROUTINE_NAME ROUTINE_NAME 253 192 2 N 1 0 33
|
||||
def ROUTINES ROUTINE_TYPE ROUTINE_TYPE 253 27 8 N 1 0 33
|
||||
def ROUTINES DTD_IDENTIFIER DTD_IDENTIFIER 253 192 7 Y 0 0 33
|
||||
def ROUTINES ROUTINE_BODY ROUTINE_BODY 253 24 3 N 1 0 33
|
||||
def ROUTINES ROUTINE_DEFINITION ROUTINE_DEFINITION 252 589815 8 Y 16 0 33
|
||||
def ROUTINES EXTERNAL_NAME EXTERNAL_NAME 253 192 0 Y 0 0 33
|
||||
def ROUTINES EXTERNAL_LANGUAGE EXTERNAL_LANGUAGE 253 192 0 Y 0 0 33
|
||||
def ROUTINES PARAMETER_STYLE PARAMETER_STYLE 253 24 3 N 1 0 33
|
||||
def ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 2 N 1 0 33
|
||||
def ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33
|
||||
def ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33
|
||||
def ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
|
||||
def ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
|
||||
def ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 253 192 0 N 1 0 33
|
||||
def ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33
|
||||
def information_schema ROUTINES ROUTINES SPECIFIC_NAME SPECIFIC_NAME 253 192 2 N 1 0 33
|
||||
def information_schema ROUTINES ROUTINES ROUTINE_CATALOG ROUTINE_CATALOG 253 1536 3 N 1 0 33
|
||||
def information_schema ROUTINES ROUTINES ROUTINE_SCHEMA ROUTINE_SCHEMA 253 192 4 N 1 0 33
|
||||
def information_schema ROUTINES ROUTINES ROUTINE_NAME ROUTINE_NAME 253 192 2 N 1 0 33
|
||||
def information_schema ROUTINES ROUTINES ROUTINE_TYPE ROUTINE_TYPE 253 27 8 N 1 0 33
|
||||
def information_schema ROUTINES ROUTINES DTD_IDENTIFIER DTD_IDENTIFIER 253 192 7 Y 0 0 33
|
||||
def information_schema ROUTINES ROUTINES ROUTINE_BODY ROUTINE_BODY 253 24 3 N 1 0 33
|
||||
def information_schema ROUTINES ROUTINES ROUTINE_DEFINITION ROUTINE_DEFINITION 252 589815 8 Y 16 0 33
|
||||
def information_schema ROUTINES ROUTINES EXTERNAL_NAME EXTERNAL_NAME 253 192 0 Y 0 0 33
|
||||
def information_schema ROUTINES ROUTINES EXTERNAL_LANGUAGE EXTERNAL_LANGUAGE 253 192 0 Y 0 0 33
|
||||
def information_schema ROUTINES ROUTINES PARAMETER_STYLE PARAMETER_STYLE 253 24 3 N 1 0 33
|
||||
def information_schema ROUTINES ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 2 N 1 0 33
|
||||
def information_schema ROUTINES ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33
|
||||
def information_schema ROUTINES ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33
|
||||
def information_schema ROUTINES ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
|
||||
def information_schema ROUTINES ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
|
||||
def information_schema ROUTINES ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 252 589815 0 N 17 0 33
|
||||
def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33
|
||||
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 SQL_MODE ROUTINE_COMMENT DEFINER
|
||||
f1 NULL test f1 FUNCTION int(11) SQL RETURN 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost
|
||||
f1 def test f1 FUNCTION int(11) SQL RETURN 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost
|
||||
----------------------------------------------------------------
|
||||
DROP DATABASE mysqltest1;
|
||||
DROP TABLE t1;
|
||||
|
@ -1442,7 +1441,7 @@ FOR EACH ROW
|
|||
SET NEW.c1 = 'тест' koi8r koi8r_general_ci latin1_swedish_ci
|
||||
SHOW CREATE EVENT ev1;
|
||||
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
|
||||
ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 'тест' AS test koi8r koi8r_general_ci latin1_swedish_ci
|
||||
ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 'тест' AS test koi8r koi8r_general_ci latin1_swedish_ci
|
||||
DROP VIEW v1;
|
||||
DROP PROCEDURE p1;
|
||||
DROP FUNCTION f1;
|
||||
|
|
|
@ -20,16 +20,16 @@ return 0;
|
|||
end $$
|
||||
show procedure code signal_proc;
|
||||
Pos Instruction
|
||||
0 stmt 136 "SIGNAL foo"
|
||||
1 stmt 136 "SIGNAL foo SET MESSAGE_TEXT = "This i..."
|
||||
2 stmt 137 "RESIGNAL foo"
|
||||
3 stmt 137 "RESIGNAL foo SET MESSAGE_TEXT = "This..."
|
||||
0 stmt 135 "SIGNAL foo"
|
||||
1 stmt 135 "SIGNAL foo SET MESSAGE_TEXT = "This i..."
|
||||
2 stmt 136 "RESIGNAL foo"
|
||||
3 stmt 136 "RESIGNAL foo SET MESSAGE_TEXT = "This..."
|
||||
drop procedure signal_proc;
|
||||
show function code signal_func;
|
||||
Pos Instruction
|
||||
0 stmt 136 "SIGNAL foo"
|
||||
1 stmt 136 "SIGNAL foo SET MESSAGE_TEXT = "This i..."
|
||||
2 stmt 137 "RESIGNAL foo"
|
||||
3 stmt 137 "RESIGNAL foo SET MESSAGE_TEXT = "This..."
|
||||
0 stmt 135 "SIGNAL foo"
|
||||
1 stmt 135 "SIGNAL foo SET MESSAGE_TEXT = "This i..."
|
||||
2 stmt 136 "RESIGNAL foo"
|
||||
3 stmt 136 "RESIGNAL foo SET MESSAGE_TEXT = "This..."
|
||||
4 freturn 3 0
|
||||
drop function signal_func;
|
||||
|
|
|
@ -155,11 +155,11 @@ Pos Instruction
|
|||
0 stmt 9 "drop temporary table if exists sudoku..."
|
||||
1 stmt 1 "create temporary table sudoku_work ( ..."
|
||||
2 stmt 1 "create temporary table sudoku_schedul..."
|
||||
3 stmt 94 "call sudoku_init()"
|
||||
3 stmt 93 "call sudoku_init()"
|
||||
4 jump_if_not 7(8) p_naive@0
|
||||
5 stmt 4 "update sudoku_work set cnt = 0 where ..."
|
||||
6 jump 8
|
||||
7 stmt 94 "call sudoku_count()"
|
||||
7 stmt 93 "call sudoku_count()"
|
||||
8 stmt 6 "insert into sudoku_schedule (row,col)..."
|
||||
9 set v_scounter@2 0
|
||||
10 set v_i@3 1
|
||||
|
|
4
mysql-test/r/sp-no-code.result
Normal file
4
mysql-test/r/sp-no-code.result
Normal file
|
@ -0,0 +1,4 @@
|
|||
show procedure code foo;
|
||||
ERROR HY000: The 'SHOW PROCEDURE|FUNCTION CODE' feature is disabled; you need MySQL built with '--with-debug' to have it working
|
||||
show function code foo;
|
||||
ERROR HY000: The 'SHOW PROCEDURE|FUNCTION CODE' feature is disabled; you need MySQL built with '--with-debug' to have it working
|
|
@ -1158,3 +1158,30 @@ f1() @b
|
|||
0 abc
|
||||
drop function f1;
|
||||
drop table t1;
|
||||
|
||||
---------------------------------------------------------------
|
||||
BUG#28299
|
||||
---------------------------------------------------------------
|
||||
|
||||
CREATE PROCEDURE ctest()
|
||||
BEGIN
|
||||
DECLARE i CHAR(16);
|
||||
DECLARE j INT;
|
||||
SET i= 'string';
|
||||
SET j= 1 + i;
|
||||
END|
|
||||
CALL ctest();
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'string '
|
||||
DROP PROCEDURE ctest;
|
||||
CREATE PROCEDURE vctest()
|
||||
BEGIN
|
||||
DECLARE i VARCHAR(16);
|
||||
DECLARE j INT;
|
||||
SET i= 'string';
|
||||
SET j= 1 + i;
|
||||
END|
|
||||
CALL vctest();
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'string'
|
||||
DROP PROCEDURE vctest;
|
||||
|
|
|
@ -2377,7 +2377,6 @@ create procedure bug4902()
|
|||
begin
|
||||
show charset like 'foo';
|
||||
show collation like 'foo';
|
||||
show column types;
|
||||
show create table t1;
|
||||
show create database test;
|
||||
show databases like 'foo';
|
||||
|
@ -2395,9 +2394,6 @@ end|
|
|||
call bug4902()|
|
||||
Charset Description Default collation Maxlen
|
||||
Collation Charset Id Default Compiled Sortlen
|
||||
Type Size Min_Value Max_Value Prec Scale Nullable Auto_Increment Unsigned Zerofill Searchable Case_Sensitive Default Comment
|
||||
tinyint 1 -128 127 0 0 YES YES NO YES YES NO NULL,0 A very small integer
|
||||
tinyint unsigned 1 0 255 0 0 YES YES YES YES YES NO NULL,0 A very small integer
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`id` char(16) NOT NULL DEFAULT '',
|
||||
|
@ -2419,9 +2415,6 @@ Level Code Message
|
|||
call bug4902()|
|
||||
Charset Description Default collation Maxlen
|
||||
Collation Charset Id Default Compiled Sortlen
|
||||
Type Size Min_Value Max_Value Prec Scale Nullable Auto_Increment Unsigned Zerofill Searchable Case_Sensitive Default Comment
|
||||
tinyint 1 -128 127 0 0 YES YES NO YES YES NO NULL,0 A very small integer
|
||||
tinyint unsigned 1 0 255 0 0 YES YES YES YES YES NO NULL,0 A very small integer
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`id` char(16) NOT NULL DEFAULT '',
|
||||
|
@ -6933,3 +6926,35 @@ DROP TABLE t1, t2;
|
|||
# ------------------------------------------------------------------
|
||||
# -- End of 5.1 tests
|
||||
# ------------------------------------------------------------------
|
||||
DROP FUNCTION IF EXISTS f1;
|
||||
DROP TABLE IF EXISTS t_non_existing;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE FUNCTION f1() RETURNS INT
|
||||
BEGIN
|
||||
DECLARE v INT;
|
||||
SELECT a INTO v FROM t_non_existing;
|
||||
RETURN 1;
|
||||
END|
|
||||
CREATE TABLE t1 (a INT) ENGINE = myisam;
|
||||
INSERT INTO t1 VALUES (1);
|
||||
SELECT * FROM t1 WHERE a = f1();
|
||||
ERROR 42S02: Table 'test.t_non_existing' doesn't exist
|
||||
DROP FUNCTION f1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Bug#34197: CREATE PROCEDURE fails when COMMENT truncated in non
|
||||
# strict SQL mode
|
||||
#
|
||||
DROP PROCEDURE IF EXISTS p1;
|
||||
CREATE PROCEDURE p1 ()
|
||||
COMMENT
|
||||
'12345678901234567890123456789012345678901234567890123456789012345678901234567890'
|
||||
BEGIN
|
||||
END;
|
||||
SELECT comment FROM mysql.proc WHERE name = "p1";
|
||||
comment
|
||||
12345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
SELECT routine_comment FROM information_schema.routines WHERE routine_name = "p1";
|
||||
routine_comment
|
||||
12345678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
DROP PROCEDURE p1;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue