Merge
This commit is contained in:
commit
fc863ba96f
@ -3066,4 +3066,5 @@ sql/share/swedish
|
||||
sql/share/ukrainian
|
||||
libmysqld/examples/mysqltest.cc
|
||||
libmysqld/sql_signal.cc
|
||||
libmysqld/rpl_handler.cc
|
||||
libmysqld/debug_sync.cc
|
||||
|
@ -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,
|
||||
@ -1367,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)
|
||||
@ -3958,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++)
|
||||
{
|
||||
@ -1998,8 +1988,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);
|
||||
@ -2030,7 +2020,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);
|
||||
@ -3848,12 +3838,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
|
||||
@ -4003,10 +3989,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);
|
||||
}
|
||||
|
||||
@ -4069,29 +4051,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
|
||||
|
||||
@ -5007,6 +4966,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);
|
||||
@ -5762,6 +5726,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}
|
||||
};
|
||||
|
||||
@ -6500,8 +6469,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);
|
||||
@ -6518,10 +6485,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
|
||||
@ -6536,9 +6503,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)
|
||||
@ -6914,11 +6878,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)
|
||||
{
|
||||
@ -6943,9 +6907,6 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
|
||||
}
|
||||
}
|
||||
|
||||
if (!disable_info)
|
||||
append_info(ds, affected_rows, mysql_info(mysql));
|
||||
|
||||
}
|
||||
|
||||
end:
|
||||
@ -6994,6 +6955,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,
|
||||
@ -7589,8 +7554,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);
|
||||
@ -7653,6 +7618,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);
|
||||
@ -7752,9 +7720,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;
|
||||
|
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)
|
||||
|
||||
@ -207,6 +209,11 @@ enum enum_server_command
|
||||
#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
|
||||
execution of a new SQL statement.
|
||||
@ -257,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. */
|
||||
@ -412,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
|
||||
|
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_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;
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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.
|
||||
# --
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
@ -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;
|
||||
@ -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_profiling.require
Normal file
2
mysql-test/r/have_profiling.require
Normal file
@ -0,0 +1,2 @@
|
||||
Variable_name Value
|
||||
have_profiling YES
|
@ -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)
|
||||
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
#
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
Binary file not shown.
@ -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;
|
||||
|
@ -1126,7 +1126,7 @@ def information_schema ROUTINES ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192
|
||||
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 253 192 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 def test p1 PROCEDURE NULL SQL SELECT 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost
|
||||
@ -1181,7 +1181,7 @@ def information_schema ROUTINES ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192
|
||||
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 253 192 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 def test f1 FUNCTION int(11) SQL RETURN 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost
|
||||
|
@ -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;
|
||||
|
@ -6926,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;
|
||||
|
@ -556,3 +556,30 @@ f1 bug13575(f1)
|
||||
3 ccc
|
||||
drop function bug13575|
|
||||
drop table t3|
|
||||
#
|
||||
# End of 5.1 tests
|
||||
#
|
||||
#
|
||||
# Bug #35877 Update .. WHERE with function, constraint violation, crash
|
||||
#
|
||||
DROP TABLE IF EXISTS t1_aux|
|
||||
DROP TABLE IF EXISTS t1_not_null|
|
||||
DROP FUNCTION IF EXISTS f1_two_inserts|
|
||||
# MyISAM test
|
||||
CREATE TABLE t1_not_null (f1 BIGINT, f2 BIGINT NOT NULL)|
|
||||
CREATE TABLE t1_aux (f1 BIGINT, f2 BIGINT)|
|
||||
INSERT INTO t1_aux VALUES (1,1)|
|
||||
CREATE FUNCTION f1_two_inserts() returns INTEGER
|
||||
BEGIN
|
||||
INSERT INTO t1_not_null SET f1 = 10, f2 = NULL;
|
||||
RETURN 1;
|
||||
END|
|
||||
UPDATE t1_aux SET f2 = 2 WHERE f1 = f1_two_inserts()|
|
||||
ERROR 23000: Column 'f2' cannot be null
|
||||
# InnoDB test
|
||||
ALTER TABLE t1_not_null ENGINE = InnoDB|
|
||||
ALTER TABLE t1_aux ENGINE = InnoDB|
|
||||
UPDATE t1_aux SET f2 = 2 WHERE f1 = f1_two_inserts()|
|
||||
ERROR 23000: Column 'f2' cannot be null
|
||||
DROP TABLE t1_aux, t1_not_null|
|
||||
DROP FUNCTION f1_two_inserts|
|
||||
|
@ -506,6 +506,12 @@ mysqltest_32753@localhost
|
||||
set session sql_mode=@OLD_SQL_MODE;
|
||||
flush privileges;
|
||||
drop user mysqltest_32753@localhost;
|
||||
SET @org_mode=@@sql_mode;
|
||||
SET @@sql_mode='traditional';
|
||||
SELECT @@sql_mode LIKE '%NO_ENGINE_SUBSTITUTION%';
|
||||
@@sql_mode LIKE '%NO_ENGINE_SUBSTITUTION%'
|
||||
1
|
||||
SET sql_mode=@org_mode;
|
||||
DROP TABLE IF EXISTS t1,t2;
|
||||
CREATE USER 'user_PCTFL'@'localhost' identified by 'PWD';
|
||||
CREATE USER 'user_no_PCTFL'@'localhost' identified by 'PWD';
|
||||
|
@ -2,7 +2,7 @@ set @org_mode=@@sql_mode;
|
||||
set @@sql_mode='ansi,traditional';
|
||||
select @@sql_mode;
|
||||
@@sql_mode
|
||||
REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
|
||||
REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI,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 TABLE IF EXISTS t1, t2;
|
||||
CREATE TABLE t1 (col1 date);
|
||||
INSERT INTO t1 VALUES('2004-01-01'),('2004-02-29');
|
||||
|
@ -110,6 +110,7 @@ user CREATE TABLE `user` (
|
||||
`Create_user_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`Create_tablespace_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
|
||||
`ssl_type` enum('','ANY','X509','SPECIFIED') CHARACTER SET utf8 NOT NULL DEFAULT '',
|
||||
`ssl_cipher` blob NOT NULL,
|
||||
`x509_issuer` blob NOT NULL,
|
||||
@ -201,7 +202,7 @@ proc CREATE TABLE `proc` (
|
||||
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`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') NOT NULL DEFAULT '',
|
||||
`comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
|
||||
`comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
|
||||
`character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
|
||||
`collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
|
||||
`db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
|
||||
|
@ -2088,3 +2088,30 @@ SELECT * FROM t2;
|
||||
a b
|
||||
DROP TABLE t1, t2;
|
||||
End of 5.1 tests.
|
||||
#
|
||||
# Bug#34453 Can't change size of file (Errcode: 1224)
|
||||
#
|
||||
DROP TRIGGER IF EXISTS t1_bi;
|
||||
DROP TRIGGER IF EXISTS t1_bd;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TEMPORARY TABLE IF EXISTS t2;
|
||||
CREATE TABLE t1 (s1 INT);
|
||||
CREATE TEMPORARY TABLE t2 (s1 INT);
|
||||
CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES (0);
|
||||
CREATE TRIGGER t1_bd BEFORE DELETE ON t1 FOR EACH ROW DELETE FROM t2;
|
||||
INSERT INTO t1 VALUES (0);
|
||||
INSERT INTO t1 VALUES (0);
|
||||
SELECT * FROM t1;
|
||||
s1
|
||||
0
|
||||
0
|
||||
SELECT * FROM t2;
|
||||
s1
|
||||
0
|
||||
0
|
||||
# Reported to give ERROR 14 (HY000):
|
||||
# Can't change size of file (Errcode: 1224)
|
||||
# on Windows
|
||||
DELETE FROM t1;
|
||||
DROP TABLE t1;
|
||||
DROP TEMPORARY TABLE t2;
|
||||
|
@ -489,3 +489,23 @@ Warnings:
|
||||
Warning 1292 Truncated incorrect INTEGER value: '1a'
|
||||
Warning 1292 Truncated incorrect INTEGER value: 't'
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a VARCHAR(16));
|
||||
INSERT INTO t1 VALUES ('5'), ('s'), ('');
|
||||
SELECT 5 = a FROM t1;
|
||||
5 = a
|
||||
1
|
||||
0
|
||||
0
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 's'
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (a CHAR(16));
|
||||
INSERT INTO t1 VALUES ('5'), ('s'), ('');
|
||||
SELECT 5 = a FROM t1;
|
||||
5 = a
|
||||
1
|
||||
0
|
||||
0
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 's '
|
||||
DROP TABLE t1;
|
||||
|
@ -799,12 +799,12 @@ CREATE USER u29908_1@localhost;
|
||||
CREATE DEFINER = u29908_1@localhost VIEW v1 AS SELECT f1 FROM t1;
|
||||
CREATE DEFINER = u29908_1@localhost SQL SECURITY INVOKER VIEW v2 AS
|
||||
SELECT f1 FROM t1;
|
||||
GRANT DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v1 TO u29908_1@localhost;
|
||||
GRANT DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v2 TO u29908_1@localhost;
|
||||
GRANT SELECT, DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v1 TO u29908_1@localhost;
|
||||
GRANT SELECT, DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v2 TO u29908_1@localhost;
|
||||
GRANT SELECT ON mysqltest_29908.t1 TO u29908_1@localhost;
|
||||
CREATE USER u29908_2@localhost;
|
||||
GRANT DROP, CREATE VIEW ON mysqltest_29908.v1 TO u29908_2@localhost;
|
||||
GRANT DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v2 TO u29908_2@localhost;
|
||||
GRANT SELECT, DROP, CREATE VIEW ON mysqltest_29908.v1 TO u29908_2@localhost;
|
||||
GRANT SELECT, DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v2 TO u29908_2@localhost;
|
||||
GRANT SELECT ON mysqltest_29908.t1 TO u29908_2@localhost;
|
||||
ALTER VIEW v1 AS SELECT f2 FROM t1;
|
||||
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
|
||||
|
@ -2096,6 +2096,9 @@ IS NOT TRUE 2
|
||||
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
|
||||
IS NOT TRUE ---äÖüß@µ*$-- 4
|
||||
IS TRUE -1 5
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_varbinary_1000`,'IS TRUE','IS NOT TRUE') AS `IF(my_varbinary_1000, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
||||
@ -2108,6 +2111,9 @@ IS NOT TRUE 2
|
||||
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
|
||||
IS NOT TRUE ---äÖüß@µ*$-- 4
|
||||
IS TRUE -1 5
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
@ -2158,6 +2164,9 @@ IS NOT TRUE 2
|
||||
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
|
||||
IS NOT TRUE ---äÖüß@µ*$-- 4
|
||||
IS TRUE -1 5
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_varchar_1000`,'IS TRUE','IS NOT TRUE') AS `IF(my_varchar_1000, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
||||
@ -2170,6 +2179,9 @@ IS NOT TRUE 2
|
||||
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
|
||||
IS NOT TRUE ---äÖüß@µ*$-- 4
|
||||
IS TRUE -1 5
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
@ -3373,8 +3385,11 @@ NULL NULL 1
|
||||
-3333.33 -3333.3333 29
|
||||
Warnings:
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as decimal(37,2)) AS `CAST(my_varbinary_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
||||
@ -3390,8 +3405,11 @@ NULL NULL 1
|
||||
-3333.33 -3333.3333 29
|
||||
Warnings:
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
@ -3455,8 +3473,11 @@ NULL NULL 1
|
||||
-3333.33 -3333.3333 27
|
||||
Warnings:
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as decimal(37,2)) AS `CAST(my_varchar_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
||||
@ -3472,8 +3493,11 @@ NULL NULL 1
|
||||
-3333.33 -3333.3333 27
|
||||
Warnings:
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
|
@ -80,7 +80,7 @@ CREATE TABLE result (f1 text(200), f2 char(20));
|
||||
set @@sql_mode='traditional';
|
||||
SHOW VARIABLES LIKE 'sql_mode';
|
||||
Variable_name Value
|
||||
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
|
||||
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
|
||||
CREATE PROCEDURE sp1()
|
||||
BEGIN
|
||||
declare a tinyint;
|
||||
@ -97,7 +97,7 @@ END if;
|
||||
END//
|
||||
SHOW CREATE PROCEDURE sp1;
|
||||
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
|
||||
sp1 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`()
|
||||
sp1 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 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`()
|
||||
BEGIN
|
||||
declare a tinyint;
|
||||
declare count_ int default 1;
|
||||
@ -117,10 +117,10 @@ Variable_name Value
|
||||
sql_mode
|
||||
CALL sp1();
|
||||
Variable_name Value
|
||||
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
|
||||
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
|
||||
SELECT * from result;
|
||||
f1 f2
|
||||
STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER value restored
|
||||
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 value restored
|
||||
SHOW VARIABLES LIKE 'sql_mode';
|
||||
Variable_name Value
|
||||
sql_mode
|
||||
@ -142,7 +142,7 @@ DROP PROCEDURE IF EXISTS sp2;
|
||||
... show initial value
|
||||
SHOW VARIABLES LIKE 'sql_mode';
|
||||
Variable_name Value
|
||||
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
|
||||
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
|
||||
CREATE PROCEDURE sp2()
|
||||
BEGIN
|
||||
SET @@sql_mode='MAXDB';
|
||||
@ -150,7 +150,7 @@ SHOW VARIABLES LIKE 'sql_mode';
|
||||
END//
|
||||
SHOW CREATE PROCEDURE sp2;
|
||||
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
|
||||
sp2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER CREATE DEFINER=`root`@`localhost` PROCEDURE `sp2`()
|
||||
sp2 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 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp2`()
|
||||
BEGIN
|
||||
SET @@sql_mode='MAXDB';
|
||||
SHOW VARIABLES LIKE 'sql_mode';
|
||||
@ -158,7 +158,7 @@ END latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
... show value prior calling procedure
|
||||
SHOW VARIABLES LIKE 'sql_mode';
|
||||
Variable_name Value
|
||||
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
|
||||
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
|
||||
... call procedure that changes sql_mode
|
||||
CALL sp2();
|
||||
Variable_name Value
|
||||
@ -166,7 +166,7 @@ sql_mode PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,MAXDB,NO_KEY_OPTIONS,NO_TABLE_
|
||||
... check whether old value is re-set
|
||||
SHOW VARIABLES LIKE 'sql_mode';
|
||||
Variable_name Value
|
||||
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
|
||||
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
|
||||
DROP PROCEDURE sp2;
|
||||
|
||||
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
|
||||
|
@ -77,7 +77,7 @@ grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke TRIGGER on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
|
||||
@ -155,7 +155,7 @@ grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke UPDATE on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
@ -169,7 +169,7 @@ test_noprivs@localhost
|
||||
use priv_db;
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
@ -401,7 +401,7 @@ grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke SELECT on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
@ -415,7 +415,7 @@ test_noprivs@localhost
|
||||
use priv_db;
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
create trigger trg5a_1 before INSERT on t1 for each row
|
||||
set @test_var = new.f1;
|
||||
set @test_var = 'before trig 3.5.3.8-1a';
|
||||
|
@ -562,7 +562,7 @@ trig 1_1-yes
|
||||
revoke TRIGGER on *.* from test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
select current_user;
|
||||
current_user
|
||||
@ -609,7 +609,7 @@ root@localhost
|
||||
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
|
||||
|
||||
trigger privilege on db level for create:
|
||||
|
@ -22843,6 +22843,9 @@ SELECT * FROM v1 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
SELECT SQRT('DEF');
|
||||
SQRT('DEF')
|
||||
0
|
||||
@ -22863,7 +22866,12 @@ SELECT * FROM v2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 ABC
|
||||
my_sqrt 0
|
||||
@ -22871,6 +22879,8 @@ f1 ABC
|
||||
my_sqrt 1.73205080756888
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT * FROM v1;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 ABC
|
||||
my_sqrt 0
|
||||
@ -22878,6 +22888,8 @@ f1 ABC
|
||||
my_sqrt 1.73205080756888
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT * FROM v2;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 ABC
|
||||
my_sqrt 0
|
||||
|
@ -192,7 +192,7 @@ def information_schema ROUTINES LAST_ALTERED 17 0000-00-00 00:00:00 NO datetime
|
||||
def information_schema ROUTINES PARAMETER_STYLE 11 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
|
||||
def information_schema ROUTINES ROUTINE_BODY 7 NO varchar 8 24 NULL NULL utf8 utf8_general_ci varchar(8) select
|
||||
def information_schema ROUTINES ROUTINE_CATALOG 2 NO varchar 512 1536 NULL NULL utf8 utf8_general_ci varchar(512) select
|
||||
def information_schema ROUTINES ROUTINE_COMMENT 19 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
def information_schema ROUTINES ROUTINE_COMMENT 19 NULL NO longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
|
||||
def information_schema ROUTINES ROUTINE_DEFINITION 8 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
|
||||
def information_schema ROUTINES ROUTINE_NAME 4 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
def information_schema ROUTINES ROUTINE_SCHEMA 3 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
|
||||
@ -552,7 +552,7 @@ NULL information_schema PROCESSLIST TIME int NULL NULL NULL NULL int(7)
|
||||
NULL information_schema ROUTINES CREATED datetime NULL NULL NULL NULL datetime
|
||||
NULL information_schema ROUTINES LAST_ALTERED datetime NULL NULL NULL NULL datetime
|
||||
3.0000 information_schema ROUTINES SQL_MODE varchar 8192 24576 utf8 utf8_general_ci varchar(8192)
|
||||
3.0000 information_schema ROUTINES ROUTINE_COMMENT varchar 64 192 utf8 utf8_general_ci varchar(64)
|
||||
1.0000 information_schema ROUTINES ROUTINE_COMMENT longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
|
||||
3.0000 information_schema ROUTINES DEFINER varchar 77 231 utf8 utf8_general_ci varchar(77)
|
||||
3.0000 information_schema ROUTINES CHARACTER_SET_CLIENT varchar 32 96 utf8 utf8_general_ci varchar(32)
|
||||
3.0000 information_schema ROUTINES COLLATION_CONNECTION varchar 32 96 utf8 utf8_general_ci varchar(32)
|
||||
|
@ -110,7 +110,7 @@ def mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NUL
|
||||
def mysql proc body_utf8 20 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL longblob select,insert,update,references
|
||||
def mysql proc character_set_client 17 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) select,insert,update,references
|
||||
def mysql proc collation_connection 18 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) select,insert,update,references
|
||||
def mysql proc comment 16 NO char 64 192 NULL NULL utf8 utf8_bin char(64) select,insert,update,references
|
||||
def mysql proc comment 16 NULL NO text 65535 65535 NULL NULL utf8 utf8_bin text select,insert,update,references
|
||||
def mysql proc created 13 CURRENT_TIMESTAMP NO timestamp NULL NULL NULL NULL NULL NULL timestamp on update CURRENT_TIMESTAMP select,insert,update,references
|
||||
def mysql proc db 1 NO char 64 192 NULL NULL utf8 utf8_bin char(64) PRI select,insert,update,references
|
||||
def mysql proc db_collation 19 NULL YES char 32 96 NULL NULL utf8 utf8_bin char(32) select,insert,update,references
|
||||
@ -180,6 +180,7 @@ def mysql user Alter_priv 17 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('
|
||||
def mysql user Alter_routine_priv 28 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
def mysql user Create_priv 8 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
def mysql user Create_routine_priv 27 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
def mysql user Create_tablespace_priv 32 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
def mysql user Create_tmp_table_priv 20 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
def mysql user Create_user_priv 29 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
def mysql user Create_view_priv 25 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
@ -193,10 +194,10 @@ def mysql user Host 1 NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI sele
|
||||
def mysql user Index_priv 16 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
def mysql user Insert_priv 5 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
def mysql user Lock_tables_priv 21 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
def mysql user max_connections 38 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references
|
||||
def mysql user max_questions 36 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references
|
||||
def mysql user max_updates 37 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references
|
||||
def mysql user max_user_connections 39 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references
|
||||
def mysql user max_connections 39 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references
|
||||
def mysql user max_questions 37 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references
|
||||
def mysql user max_updates 38 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references
|
||||
def mysql user max_user_connections 40 0 NO int NULL NULL 10 0 NULL NULL int(11) unsigned select,insert,update,references
|
||||
def mysql user Password 3 NO char 41 41 NULL NULL latin1 latin1_bin char(41) select,insert,update,references
|
||||
def mysql user Process_priv 12 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
def mysql user References_priv 15 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
@ -207,14 +208,14 @@ def mysql user Select_priv 4 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('
|
||||
def mysql user Show_db_priv 18 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
def mysql user Show_view_priv 26 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
def mysql user Shutdown_priv 11 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
def mysql user ssl_cipher 33 NULL NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
|
||||
def mysql user ssl_type 32 NO enum 9 27 NULL NULL utf8 utf8_general_ci enum('','ANY','X509','SPECIFIED') select,insert,update,references
|
||||
def mysql user ssl_cipher 34 NULL NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
|
||||
def mysql user ssl_type 33 NO enum 9 27 NULL NULL utf8 utf8_general_ci enum('','ANY','X509','SPECIFIED') select,insert,update,references
|
||||
def mysql user Super_priv 19 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
def mysql user Trigger_priv 31 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
def mysql user Update_priv 6 N NO enum 1 3 NULL NULL utf8 utf8_general_ci enum('N','Y') select,insert,update,references
|
||||
def mysql user User 2 NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI select,insert,update,references
|
||||
def mysql user x509_issuer 34 NULL NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
|
||||
def mysql user x509_subject 35 NULL NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
|
||||
def mysql user x509_issuer 35 NULL NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
|
||||
def mysql user x509_subject 36 NULL NO blob 65535 65535 NULL NULL NULL NULL blob select,insert,update,references
|
||||
##########################################################################
|
||||
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
|
||||
##########################################################################
|
||||
@ -233,6 +234,7 @@ COL_CML DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME
|
||||
1.0000 char latin1 latin1_bin
|
||||
1.0000 char latin1 latin1_swedish_ci
|
||||
1.0000 varchar latin1 latin1_swedish_ci
|
||||
1.0000 text utf8 utf8_bin
|
||||
1.0000 mediumtext utf8 utf8_general_ci
|
||||
1.0000 text utf8 utf8_general_ci
|
||||
SELECT DISTINCT
|
||||
@ -403,7 +405,7 @@ NULL mysql ndb_binlog_index schemaops bigint NULL NULL NULL NULL bigint(20) unsi
|
||||
NULL mysql proc created timestamp NULL NULL NULL NULL timestamp
|
||||
NULL mysql proc modified timestamp NULL NULL NULL NULL timestamp
|
||||
3.0000 mysql proc sql_mode set 478 1434 utf8 utf8_general_ci set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH')
|
||||
3.0000 mysql proc comment char 64 192 utf8 utf8_bin char(64)
|
||||
1.0000 mysql proc comment text 65535 65535 utf8 utf8_bin text
|
||||
3.0000 mysql proc character_set_client char 32 96 utf8 utf8_bin char(32)
|
||||
3.0000 mysql proc collation_connection char 32 96 utf8 utf8_bin char(32)
|
||||
3.0000 mysql proc db_collation char 32 96 utf8 utf8_bin char(32)
|
||||
@ -489,6 +491,7 @@ NULL mysql time_zone_transition_type Is_DST tinyint NULL NULL NULL NULL tinyint(
|
||||
3.0000 mysql user Create_user_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Event_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Trigger_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user Create_tablespace_priv enum 1 3 utf8 utf8_general_ci enum('N','Y')
|
||||
3.0000 mysql user ssl_type enum 9 27 utf8 utf8_general_ci enum('','ANY','X509','SPECIFIED')
|
||||
1.0000 mysql user ssl_cipher blob 65535 65535 NULL NULL blob
|
||||
1.0000 mysql user x509_issuer blob 65535 65535 NULL NULL blob
|
||||
|
@ -46,7 +46,7 @@ SECURITY_TYPE varchar(7) NO
|
||||
CREATED datetime NO 0000-00-00 00:00:00
|
||||
LAST_ALTERED datetime NO 0000-00-00 00:00:00
|
||||
SQL_MODE varchar(8192) NO
|
||||
ROUTINE_COMMENT varchar(64) NO
|
||||
ROUTINE_COMMENT longtext NO NULL
|
||||
DEFINER varchar(77) NO
|
||||
CHARACTER_SET_CLIENT varchar(32) NO
|
||||
COLLATION_CONNECTION varchar(32) NO
|
||||
@ -72,7 +72,7 @@ ROUTINES CREATE TEMPORARY TABLE `ROUTINES` (
|
||||
`CREATED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`LAST_ALTERED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`SQL_MODE` varchar(8192) NOT NULL DEFAULT '',
|
||||
`ROUTINE_COMMENT` varchar(64) NOT NULL DEFAULT '',
|
||||
`ROUTINE_COMMENT` longtext NOT NULL,
|
||||
`DEFINER` varchar(77) NOT NULL DEFAULT '',
|
||||
`CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '',
|
||||
`COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '',
|
||||
@ -98,7 +98,7 @@ SECURITY_TYPE varchar(7) NO
|
||||
CREATED datetime NO 0000-00-00 00:00:00
|
||||
LAST_ALTERED datetime NO 0000-00-00 00:00:00
|
||||
SQL_MODE varchar(8192) NO
|
||||
ROUTINE_COMMENT varchar(64) NO
|
||||
ROUTINE_COMMENT longtext NO NULL
|
||||
DEFINER varchar(77) NO
|
||||
CHARACTER_SET_CLIENT varchar(32) NO
|
||||
COLLATION_CONNECTION varchar(32) NO
|
||||
|
@ -76,10 +76,10 @@ GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser3'@'localhost' def USAGE NO
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
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 testuser1 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 0 0 0 0
|
||||
localhost testuser2 N Y Y 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 0 0 0 0
|
||||
localhost testuser3 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 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 testuser1 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 0 0 0 0
|
||||
localhost testuser2 N Y Y 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 0 0 0 0
|
||||
localhost testuser3 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 0 0 0 0
|
||||
#
|
||||
# Add GRANT OPTION db_datadict.* to testuser1;
|
||||
GRANT UPDATE ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
|
||||
@ -93,10 +93,10 @@ GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser3'@'localhost' def USAGE NO
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
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 testuser1 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 0 0 0 0
|
||||
localhost testuser2 N Y Y 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 0 0 0 0
|
||||
localhost testuser3 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 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 testuser1 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 0 0 0 0
|
||||
localhost testuser2 N Y Y 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 0 0 0 0
|
||||
localhost testuser3 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 0 0 0 0
|
||||
# Establish connection testuser1 (user=testuser1)
|
||||
SELECT * FROM information_schema.user_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
@ -105,10 +105,10 @@ GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' def USAGE NO
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
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 testuser1 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 0 0 0 0
|
||||
localhost testuser2 N Y Y 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 0 0 0 0
|
||||
localhost testuser3 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 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 testuser1 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 0 0 0 0
|
||||
localhost testuser2 N Y Y 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 0 0 0 0
|
||||
localhost testuser3 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 0 0 0 0
|
||||
SHOW GRANTS;
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
@ -130,10 +130,10 @@ GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser3'@'localhost' def USAGE NO
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
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 testuser1 Y 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 0 0 0 0
|
||||
localhost testuser2 N Y Y 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 0 0 0 0
|
||||
localhost testuser3 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 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 testuser1 Y 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 0 0 0 0
|
||||
localhost testuser2 N Y Y 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 0 0 0 0
|
||||
localhost testuser3 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 0 0 0 0
|
||||
GRANT SELECT ON *.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
|
||||
#
|
||||
# Here <SELECT YES> is shown correctly for testuser1;
|
||||
@ -147,10 +147,10 @@ GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser3'@'localhost' def USAGE NO
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
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 testuser1 Y N N N N N N N N N Y N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
localhost testuser2 N Y Y 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 0 0 0 0
|
||||
localhost testuser3 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 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 testuser1 Y N N N N N N N N N Y N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
localhost testuser2 N Y Y 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 0 0 0 0
|
||||
localhost testuser3 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 0 0 0 0
|
||||
# Switch to connection testuser1
|
||||
SELECT * FROM information_schema.user_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
@ -159,10 +159,10 @@ GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' def SELECT YES
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
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 testuser1 Y N N N N N N N N N Y N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
localhost testuser2 N Y Y 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 0 0 0 0
|
||||
localhost testuser3 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 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 testuser1 Y N N N N N N N N N Y N N N N N N N N N N N N N N N N N N 0 0 0 0
|
||||
localhost testuser2 N Y Y 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 0 0 0 0
|
||||
localhost testuser3 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 0 0 0 0
|
||||
SHOW GRANTS;
|
||||
Grants for testuser1@localhost
|
||||
GRANT SELECT ON *.* TO 'testuser1'@'localhost' WITH GRANT OPTION
|
||||
@ -207,10 +207,10 @@ GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser3'@'localhost' def USAGE NO
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
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 testuser1 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 0 0 0 0
|
||||
localhost testuser2 N Y Y 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 0 0 0 0
|
||||
localhost testuser3 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 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 testuser1 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 0 0 0 0
|
||||
localhost testuser2 N Y Y 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 0 0 0 0
|
||||
localhost testuser3 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 0 0 0 0
|
||||
# Switch to connection testuser1
|
||||
SELECT * FROM information_schema.user_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
@ -253,10 +253,10 @@ GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser3'@'localhost' def USAGE NO
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
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 testuser1 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 0 0 0 0
|
||||
localhost testuser2 N Y Y 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 0 0 0 0
|
||||
localhost testuser3 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 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 testuser1 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 0 0 0 0
|
||||
localhost testuser2 N Y Y 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 0 0 0 0
|
||||
localhost testuser3 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 0 0 0 0
|
||||
# Switch to connection testuser1
|
||||
SELECT * FROM information_schema.user_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
@ -265,10 +265,10 @@ GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' def USAGE NO
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
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 testuser1 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 0 0 0 0
|
||||
localhost testuser2 N Y Y 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 0 0 0 0
|
||||
localhost testuser3 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 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 testuser1 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 0 0 0 0
|
||||
localhost testuser2 N Y Y 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 0 0 0 0
|
||||
localhost testuser3 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 0 0 0 0
|
||||
SHOW GRANTS;
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
@ -284,10 +284,10 @@ GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser1'@'localhost' def USAGE NO
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
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 testuser1 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 0 0 0 0
|
||||
localhost testuser2 N Y Y 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 0 0 0 0
|
||||
localhost testuser3 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 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 testuser1 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 0 0 0 0
|
||||
localhost testuser2 N Y Y 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 0 0 0 0
|
||||
localhost testuser3 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 0 0 0 0
|
||||
SHOW GRANTS;
|
||||
Grants for testuser1@localhost
|
||||
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
|
||||
@ -309,10 +309,10 @@ GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
|
||||
'testuser3'@'localhost' def USAGE NO
|
||||
SELECT * FROM mysql.user
|
||||
WHERE user LIKE 'testuser%' ORDER BY host, user;
|
||||
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 testuser1 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 0 0 0 0
|
||||
localhost testuser2 N Y Y 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 0 0 0 0
|
||||
localhost testuser3 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 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 testuser1 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 0 0 0 0
|
||||
localhost testuser2 N Y Y 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 0 0 0 0
|
||||
localhost testuser3 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 0 0 0 0
|
||||
# Switch to connection testuser1
|
||||
SELECT * FROM information_schema.user_privileges
|
||||
WHERE grantee LIKE '''testuser%'''
|
||||
|
@ -2097,6 +2097,9 @@ IS NOT TRUE 2
|
||||
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
|
||||
IS NOT TRUE ---äÖüß@µ*$-- 4
|
||||
IS TRUE -1 5
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_varbinary_1000`,'IS TRUE','IS NOT TRUE') AS `IF(my_varbinary_1000, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
||||
@ -2109,6 +2112,9 @@ IS NOT TRUE 2
|
||||
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
|
||||
IS NOT TRUE ---äÖüß@µ*$-- 4
|
||||
IS TRUE -1 5
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
@ -2159,6 +2165,9 @@ IS NOT TRUE 2
|
||||
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
|
||||
IS NOT TRUE ---äÖüß@µ*$-- 4
|
||||
IS TRUE -1 5
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_varchar_1000`,'IS TRUE','IS NOT TRUE') AS `IF(my_varchar_1000, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
||||
@ -2171,6 +2180,9 @@ IS NOT TRUE 2
|
||||
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
|
||||
IS NOT TRUE ---äÖüß@µ*$-- 4
|
||||
IS TRUE -1 5
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
@ -3374,8 +3386,11 @@ NULL NULL 1
|
||||
-3333.33 -3333.3333 29
|
||||
Warnings:
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as decimal(37,2)) AS `CAST(my_varbinary_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
||||
@ -3391,8 +3406,11 @@ NULL NULL 1
|
||||
-3333.33 -3333.3333 29
|
||||
Warnings:
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
@ -3456,8 +3474,11 @@ NULL NULL 1
|
||||
-3333.33 -3333.3333 27
|
||||
Warnings:
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as decimal(37,2)) AS `CAST(my_varchar_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
||||
@ -3473,8 +3494,11 @@ NULL NULL 1
|
||||
-3333.33 -3333.3333 27
|
||||
Warnings:
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
|
@ -81,7 +81,7 @@ CREATE TABLE result (f1 text(200), f2 char(20));
|
||||
set @@sql_mode='traditional';
|
||||
SHOW VARIABLES LIKE 'sql_mode';
|
||||
Variable_name Value
|
||||
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
|
||||
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
|
||||
CREATE PROCEDURE sp1()
|
||||
BEGIN
|
||||
declare a tinyint;
|
||||
@ -98,7 +98,7 @@ END if;
|
||||
END//
|
||||
SHOW CREATE PROCEDURE sp1;
|
||||
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
|
||||
sp1 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`()
|
||||
sp1 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 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`()
|
||||
BEGIN
|
||||
declare a tinyint;
|
||||
declare count_ int default 1;
|
||||
@ -118,10 +118,10 @@ Variable_name Value
|
||||
sql_mode
|
||||
CALL sp1();
|
||||
Variable_name Value
|
||||
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
|
||||
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
|
||||
SELECT * from result;
|
||||
f1 f2
|
||||
STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER value restored
|
||||
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 value restored
|
||||
SHOW VARIABLES LIKE 'sql_mode';
|
||||
Variable_name Value
|
||||
sql_mode
|
||||
@ -143,7 +143,7 @@ DROP PROCEDURE IF EXISTS sp2;
|
||||
... show initial value
|
||||
SHOW VARIABLES LIKE 'sql_mode';
|
||||
Variable_name Value
|
||||
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
|
||||
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
|
||||
CREATE PROCEDURE sp2()
|
||||
BEGIN
|
||||
SET @@sql_mode='MAXDB';
|
||||
@ -151,7 +151,7 @@ SHOW VARIABLES LIKE 'sql_mode';
|
||||
END//
|
||||
SHOW CREATE PROCEDURE sp2;
|
||||
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
|
||||
sp2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER CREATE DEFINER=`root`@`localhost` PROCEDURE `sp2`()
|
||||
sp2 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 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp2`()
|
||||
BEGIN
|
||||
SET @@sql_mode='MAXDB';
|
||||
SHOW VARIABLES LIKE 'sql_mode';
|
||||
@ -159,7 +159,7 @@ END latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
... show value prior calling procedure
|
||||
SHOW VARIABLES LIKE 'sql_mode';
|
||||
Variable_name Value
|
||||
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
|
||||
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
|
||||
... call procedure that changes sql_mode
|
||||
CALL sp2();
|
||||
Variable_name Value
|
||||
@ -167,7 +167,7 @@ sql_mode PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,MAXDB,NO_KEY_OPTIONS,NO_TABLE_
|
||||
... check whether old value is re-set
|
||||
SHOW VARIABLES LIKE 'sql_mode';
|
||||
Variable_name Value
|
||||
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
|
||||
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
|
||||
DROP PROCEDURE sp2;
|
||||
|
||||
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
|
||||
|
@ -78,7 +78,7 @@ grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke TRIGGER on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
|
||||
@ -156,7 +156,7 @@ grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke UPDATE on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
@ -170,7 +170,7 @@ test_noprivs@localhost
|
||||
use priv_db;
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
@ -402,7 +402,7 @@ grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke SELECT on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
@ -416,7 +416,7 @@ test_noprivs@localhost
|
||||
use priv_db;
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
create trigger trg5a_1 before INSERT on t1 for each row
|
||||
set @test_var = new.f1;
|
||||
set @test_var = 'before trig 3.5.3.8-1a';
|
||||
|
@ -563,7 +563,7 @@ trig 1_1-yes
|
||||
revoke TRIGGER on *.* from test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
select current_user;
|
||||
current_user
|
||||
@ -610,7 +610,7 @@ root@localhost
|
||||
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
|
||||
|
||||
trigger privilege on db level for create:
|
||||
|
@ -22845,6 +22845,9 @@ SELECT * FROM v1 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
SELECT SQRT('DEF');
|
||||
SQRT('DEF')
|
||||
0
|
||||
@ -22865,7 +22868,12 @@ SELECT * FROM v2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 ABC
|
||||
my_sqrt 0
|
||||
@ -22873,6 +22881,8 @@ f1 ABC
|
||||
my_sqrt 1.73205080756888
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT * FROM v1;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 ABC
|
||||
my_sqrt 0
|
||||
@ -22880,6 +22890,8 @@ f1 ABC
|
||||
my_sqrt 1.73205080756888
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT * FROM v2;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 ABC
|
||||
my_sqrt 0
|
||||
|
@ -2097,6 +2097,9 @@ IS NOT TRUE 2
|
||||
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
|
||||
IS NOT TRUE ---äÖüß@µ*$-- 4
|
||||
IS TRUE -1 5
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_varbinary_1000`,'IS TRUE','IS NOT TRUE') AS `IF(my_varbinary_1000, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
||||
@ -2109,6 +2112,9 @@ IS NOT TRUE 2
|
||||
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
|
||||
IS NOT TRUE ---äÖüß@µ*$-- 4
|
||||
IS TRUE -1 5
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
@ -2159,6 +2165,9 @@ IS NOT TRUE 2
|
||||
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
|
||||
IS NOT TRUE ---äÖüß@µ*$-- 4
|
||||
IS TRUE -1 5
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_varchar_1000`,'IS TRUE','IS NOT TRUE') AS `IF(my_varchar_1000, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
||||
@ -2171,6 +2180,9 @@ IS NOT TRUE 2
|
||||
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
|
||||
IS NOT TRUE ---äÖüß@µ*$-- 4
|
||||
IS TRUE -1 5
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
@ -3374,8 +3386,11 @@ NULL NULL 1
|
||||
-3333.33 -3333.3333 29
|
||||
Warnings:
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as decimal(37,2)) AS `CAST(my_varbinary_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
||||
@ -3391,8 +3406,11 @@ NULL NULL 1
|
||||
-3333.33 -3333.3333 29
|
||||
Warnings:
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
@ -3456,8 +3474,11 @@ NULL NULL 1
|
||||
-3333.33 -3333.3333 27
|
||||
Warnings:
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as decimal(37,2)) AS `CAST(my_varchar_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
||||
@ -3473,8 +3494,11 @@ NULL NULL 1
|
||||
-3333.33 -3333.3333 27
|
||||
Warnings:
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
|
@ -81,7 +81,7 @@ CREATE TABLE result (f1 text(200), f2 char(20));
|
||||
set @@sql_mode='traditional';
|
||||
SHOW VARIABLES LIKE 'sql_mode';
|
||||
Variable_name Value
|
||||
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
|
||||
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
|
||||
CREATE PROCEDURE sp1()
|
||||
BEGIN
|
||||
declare a tinyint;
|
||||
@ -98,7 +98,7 @@ END if;
|
||||
END//
|
||||
SHOW CREATE PROCEDURE sp1;
|
||||
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
|
||||
sp1 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`()
|
||||
sp1 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 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`()
|
||||
BEGIN
|
||||
declare a tinyint;
|
||||
declare count_ int default 1;
|
||||
@ -118,10 +118,10 @@ Variable_name Value
|
||||
sql_mode
|
||||
CALL sp1();
|
||||
Variable_name Value
|
||||
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
|
||||
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
|
||||
SELECT * from result;
|
||||
f1 f2
|
||||
STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER value restored
|
||||
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 value restored
|
||||
SHOW VARIABLES LIKE 'sql_mode';
|
||||
Variable_name Value
|
||||
sql_mode
|
||||
@ -143,7 +143,7 @@ DROP PROCEDURE IF EXISTS sp2;
|
||||
... show initial value
|
||||
SHOW VARIABLES LIKE 'sql_mode';
|
||||
Variable_name Value
|
||||
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
|
||||
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
|
||||
CREATE PROCEDURE sp2()
|
||||
BEGIN
|
||||
SET @@sql_mode='MAXDB';
|
||||
@ -151,7 +151,7 @@ SHOW VARIABLES LIKE 'sql_mode';
|
||||
END//
|
||||
SHOW CREATE PROCEDURE sp2;
|
||||
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
|
||||
sp2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER CREATE DEFINER=`root`@`localhost` PROCEDURE `sp2`()
|
||||
sp2 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 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp2`()
|
||||
BEGIN
|
||||
SET @@sql_mode='MAXDB';
|
||||
SHOW VARIABLES LIKE 'sql_mode';
|
||||
@ -159,7 +159,7 @@ END latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
... show value prior calling procedure
|
||||
SHOW VARIABLES LIKE 'sql_mode';
|
||||
Variable_name Value
|
||||
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
|
||||
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
|
||||
... call procedure that changes sql_mode
|
||||
CALL sp2();
|
||||
Variable_name Value
|
||||
@ -167,7 +167,7 @@ sql_mode PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,MAXDB,NO_KEY_OPTIONS,NO_TABLE_
|
||||
... check whether old value is re-set
|
||||
SHOW VARIABLES LIKE 'sql_mode';
|
||||
Variable_name Value
|
||||
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
|
||||
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
|
||||
DROP PROCEDURE sp2;
|
||||
|
||||
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
|
||||
|
@ -78,7 +78,7 @@ grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke TRIGGER on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
|
||||
@ -156,7 +156,7 @@ grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke UPDATE on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
@ -170,7 +170,7 @@ test_noprivs@localhost
|
||||
use priv_db;
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
@ -402,7 +402,7 @@ grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke SELECT on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
@ -416,7 +416,7 @@ test_noprivs@localhost
|
||||
use priv_db;
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
create trigger trg5a_1 before INSERT on t1 for each row
|
||||
set @test_var = new.f1;
|
||||
set @test_var = 'before trig 3.5.3.8-1a';
|
||||
|
@ -563,7 +563,7 @@ trig 1_1-yes
|
||||
revoke TRIGGER on *.* from test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
select current_user;
|
||||
current_user
|
||||
@ -610,7 +610,7 @@ root@localhost
|
||||
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
|
||||
|
||||
trigger privilege on db level for create:
|
||||
|
@ -24547,6 +24547,9 @@ SELECT * FROM v1 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
SELECT SQRT('DEF');
|
||||
SQRT('DEF')
|
||||
0
|
||||
@ -24567,7 +24570,12 @@ SELECT * FROM v2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 ABC
|
||||
my_sqrt 0
|
||||
@ -24575,6 +24583,8 @@ f1 ABC
|
||||
my_sqrt 1.73205080756888
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT * FROM v1;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 ABC
|
||||
my_sqrt 0
|
||||
@ -24582,6 +24592,8 @@ f1 ABC
|
||||
my_sqrt 1.73205080756888
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT * FROM v2;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 ABC
|
||||
my_sqrt 0
|
||||
|
@ -2096,6 +2096,9 @@ IS NOT TRUE 2
|
||||
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
|
||||
IS NOT TRUE ---äÖüß@µ*$-- 4
|
||||
IS TRUE -1 5
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_varbinary_1000`,'IS TRUE','IS NOT TRUE') AS `IF(my_varbinary_1000, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
||||
@ -2108,6 +2111,9 @@ IS NOT TRUE 2
|
||||
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
|
||||
IS NOT TRUE ---äÖüß@µ*$-- 4
|
||||
IS TRUE -1 5
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
@ -2158,6 +2164,9 @@ IS NOT TRUE 2
|
||||
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
|
||||
IS NOT TRUE ---äÖüß@µ*$-- 4
|
||||
IS TRUE -1 5
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select if(`t1_values`.`my_varchar_1000`,'IS TRUE','IS NOT TRUE') AS `IF(my_varchar_1000, 'IS TRUE', 'IS NOT TRUE')`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
||||
@ -2170,6 +2179,9 @@ IS NOT TRUE 2
|
||||
IS NOT TRUE <---------1000 characters--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------> 3
|
||||
IS NOT TRUE ---äÖüß@µ*$-- 4
|
||||
IS TRUE -1 5
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: ' ---äÖüß@µ*$-- '
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
@ -3373,8 +3385,11 @@ NULL NULL 1
|
||||
-3333.33 -3333.3333 29
|
||||
Warnings:
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varbinary_1000` as decimal(37,2)) AS `CAST(my_varbinary_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varbinary_1000` AS `my_varbinary_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
||||
@ -3390,8 +3405,11 @@ NULL NULL 1
|
||||
-3333.33 -3333.3333 29
|
||||
Warnings:
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
@ -3455,8 +3473,11 @@ NULL NULL 1
|
||||
-3333.33 -3333.3333 27
|
||||
Warnings:
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
|
||||
SHOW CREATE VIEW v1;
|
||||
View Create View character_set_client collation_connection
|
||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select cast(`t1_values`.`my_varchar_1000` as decimal(37,2)) AS `CAST(my_varchar_1000 AS DECIMAL(37,2))`,`t1_values`.`my_varchar_1000` AS `my_varchar_1000`,`t1_values`.`id` AS `id` from `t1_values` latin1 latin1_swedish_ci
|
||||
@ -3472,8 +3493,11 @@ NULL NULL 1
|
||||
-3333.33 -3333.3333 27
|
||||
Warnings:
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ''
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: '<---------1000 characters-------------------------------------------------------------------------------------------------------'
|
||||
Warning 1366 Incorrect decimal value: '' for column '' at row -1
|
||||
Warning 1292 Truncated incorrect DECIMAL value: ' ---äÖüß@µ*$-- '
|
||||
DROP VIEW v1;
|
||||
|
||||
|
||||
|
@ -80,7 +80,7 @@ CREATE TABLE result (f1 text(200), f2 char(20));
|
||||
set @@sql_mode='traditional';
|
||||
SHOW VARIABLES LIKE 'sql_mode';
|
||||
Variable_name Value
|
||||
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
|
||||
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
|
||||
CREATE PROCEDURE sp1()
|
||||
BEGIN
|
||||
declare a tinyint;
|
||||
@ -97,7 +97,7 @@ END if;
|
||||
END//
|
||||
SHOW CREATE PROCEDURE sp1;
|
||||
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
|
||||
sp1 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`()
|
||||
sp1 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 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`()
|
||||
BEGIN
|
||||
declare a tinyint;
|
||||
declare count_ int default 1;
|
||||
@ -117,10 +117,10 @@ Variable_name Value
|
||||
sql_mode
|
||||
CALL sp1();
|
||||
Variable_name Value
|
||||
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
|
||||
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
|
||||
SELECT * from result;
|
||||
f1 f2
|
||||
STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER value restored
|
||||
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 value restored
|
||||
SHOW VARIABLES LIKE 'sql_mode';
|
||||
Variable_name Value
|
||||
sql_mode
|
||||
@ -142,7 +142,7 @@ DROP PROCEDURE IF EXISTS sp2;
|
||||
... show initial value
|
||||
SHOW VARIABLES LIKE 'sql_mode';
|
||||
Variable_name Value
|
||||
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
|
||||
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
|
||||
CREATE PROCEDURE sp2()
|
||||
BEGIN
|
||||
SET @@sql_mode='MAXDB';
|
||||
@ -150,7 +150,7 @@ SHOW VARIABLES LIKE 'sql_mode';
|
||||
END//
|
||||
SHOW CREATE PROCEDURE sp2;
|
||||
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
|
||||
sp2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER CREATE DEFINER=`root`@`localhost` PROCEDURE `sp2`()
|
||||
sp2 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 CREATE DEFINER=`root`@`localhost` PROCEDURE `sp2`()
|
||||
BEGIN
|
||||
SET @@sql_mode='MAXDB';
|
||||
SHOW VARIABLES LIKE 'sql_mode';
|
||||
@ -158,7 +158,7 @@ END latin1 latin1_swedish_ci latin1_swedish_ci
|
||||
... show value prior calling procedure
|
||||
SHOW VARIABLES LIKE 'sql_mode';
|
||||
Variable_name Value
|
||||
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
|
||||
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
|
||||
... call procedure that changes sql_mode
|
||||
CALL sp2();
|
||||
Variable_name Value
|
||||
@ -166,7 +166,7 @@ sql_mode PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,MAXDB,NO_KEY_OPTIONS,NO_TABLE_
|
||||
... check whether old value is re-set
|
||||
SHOW VARIABLES LIKE 'sql_mode';
|
||||
Variable_name Value
|
||||
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
|
||||
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
|
||||
DROP PROCEDURE sp2;
|
||||
|
||||
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
|
||||
|
@ -77,7 +77,7 @@ grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke TRIGGER on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant TRIGGER on *.* to test_yesprivs@localhost;
|
||||
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
|
||||
@ -155,7 +155,7 @@ grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke UPDATE on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
@ -169,7 +169,7 @@ test_noprivs@localhost
|
||||
use priv_db;
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
select f1 from t1 order by f1;
|
||||
f1
|
||||
insert 3.5.3.2-no
|
||||
@ -401,7 +401,7 @@ grant ALL on *.* to test_noprivs@localhost;
|
||||
revoke SELECT on *.* from test_noprivs@localhost;
|
||||
show grants for test_noprivs@localhost;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
|
||||
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
@ -415,7 +415,7 @@ test_noprivs@localhost
|
||||
use priv_db;
|
||||
show grants;
|
||||
Grants for test_noprivs@localhost
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
create trigger trg5a_1 before INSERT on t1 for each row
|
||||
set @test_var = new.f1;
|
||||
set @test_var = 'before trig 3.5.3.8-1a';
|
||||
|
@ -562,7 +562,7 @@ trig 1_1-yes
|
||||
revoke TRIGGER on *.* from test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
connect(localhost,test_yesprivs,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
||||
select current_user;
|
||||
current_user
|
||||
@ -609,7 +609,7 @@ root@localhost
|
||||
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
|
||||
show grants for test_yesprivs@localhost;
|
||||
Grants for test_yesprivs@localhost
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
|
||||
GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
|
||||
|
||||
trigger privilege on db level for create:
|
||||
|
@ -22843,6 +22843,9 @@ SELECT * FROM v1 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
SELECT SQRT('DEF');
|
||||
SQRT('DEF')
|
||||
0
|
||||
@ -22863,7 +22866,12 @@ SELECT * FROM v2 order by 2;
|
||||
f1 my_sqrt
|
||||
ABC 0
|
||||
ABC 1.73205080756888
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 ABC
|
||||
my_sqrt 0
|
||||
@ -22871,6 +22879,8 @@ f1 ABC
|
||||
my_sqrt 1.73205080756888
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT * FROM v1;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 ABC
|
||||
my_sqrt 0
|
||||
@ -22878,6 +22888,8 @@ f1 ABC
|
||||
my_sqrt 1.73205080756888
|
||||
DROP TABLE t2;
|
||||
CREATE TABLE t2 AS SELECT * FROM v2;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
|
||||
SELECT * FROM t2 order by 2;
|
||||
f1 ABC
|
||||
my_sqrt 0
|
||||
|
@ -22115,7 +22115,7 @@ f1
|
||||
2005-03-14 01:01:02
|
||||
SELECT @@sql_mode;
|
||||
@@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
|
||||
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 PROCEDURE sp2;
|
||||
drop table temp_table;
|
||||
|
||||
|
@ -236,3 +236,79 @@ engine ndb;
|
||||
ERROR HY000: Failed to drop TABLESPACE
|
||||
drop logfile group lg1
|
||||
engine ndb;
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# End 5.1 test
|
||||
# -----------------------------------------------------------------
|
||||
|
||||
# --
|
||||
# -- WL#4300: Define privileges for tablespaces.
|
||||
# --
|
||||
GRANT CREATE TABLESPACE ON *.* TO mysqltest_u1@localhost;
|
||||
|
||||
DROP DATABASE IF EXISTS mysqltest2;
|
||||
CREATE DATABASE mysqltest2;
|
||||
GRANT ALL PRIVILEGES ON mysqltest2.* TO mysqltest_u2@localhost;
|
||||
|
||||
# -- Connection: mysqltest_u1@localhost
|
||||
|
||||
# -- Grants for mysqltest_u1@localhost:
|
||||
SHOW GRANTS;
|
||||
Grants for mysqltest_u1@localhost
|
||||
GRANT CREATE TABLESPACE ON *.* TO 'mysqltest_u1'@'localhost'
|
||||
|
||||
# -- Check CREATE LOGFILE GROUP...
|
||||
CREATE LOGFILE GROUP lg1
|
||||
ADD UNDOFILE 'undofile.dat'
|
||||
INITIAL_SIZE 1M
|
||||
UNDO_BUFFER_SIZE = 1M
|
||||
ENGINE = NDB;
|
||||
|
||||
# -- Check ALTER LOGFILE GROUP...
|
||||
ALTER LOGFILE GROUP lg1
|
||||
ADD UNDOFILE 'undofile02.dat'
|
||||
INITIAL_SIZE 1M
|
||||
ENGINE = NDB;
|
||||
|
||||
# -- Check CREATE TABLESPACE...
|
||||
CREATE TABLESPACE ts1
|
||||
ADD DATAFILE 'datafile.dat'
|
||||
USE LOGFILE GROUP lg1
|
||||
INITIAL_SIZE 1M
|
||||
ENGINE = NDB;
|
||||
|
||||
# -- Check ALTER TABLESPACE...
|
||||
ALTER TABLESPACE ts1
|
||||
DROP DATAFILE 'datafile.dat'
|
||||
INITIAL_SIZE 1M
|
||||
ENGINE = NDB;
|
||||
|
||||
# -- Connection: mysqltest_u2@localhost
|
||||
|
||||
# -- Grants for mysqltest_u2@localhost:
|
||||
SHOW GRANTS;
|
||||
Grants for mysqltest_u2@localhost
|
||||
GRANT USAGE ON *.* TO 'mysqltest_u2'@'localhost'
|
||||
GRANT ALL PRIVILEGES ON `mysqltest2`.* TO 'mysqltest_u2'@'localhost'
|
||||
CREATE TABLE t1(c INT) TABLESPACE ts1;
|
||||
DROP TABLE t1;
|
||||
|
||||
# -- Connection: mysqltest_u1@localhost
|
||||
|
||||
|
||||
# -- Check DROP TABLESPACE...
|
||||
DROP TABLESPACE ts1
|
||||
ENGINE = NDB;
|
||||
|
||||
# -- Check DROP LOGFILE GROUP...
|
||||
DROP LOGFILE GROUP lg1
|
||||
ENGINE = NDB;
|
||||
|
||||
# -- Connection: root@localhost
|
||||
|
||||
DROP USER mysqltest_u1@localhost;
|
||||
DROP USER mysqltest_u2@localhost;
|
||||
|
||||
# -----------------------------------------------------------------
|
||||
# End 6.0 test
|
||||
# -----------------------------------------------------------------
|
||||
|
@ -367,4 +367,103 @@ engine ndb;
|
||||
--exec rm $MYSQLTEST_VARDIR/tmp/t1.frm
|
||||
|
||||
|
||||
# End 5.1 test
|
||||
--echo
|
||||
--echo # -----------------------------------------------------------------
|
||||
--echo # End 5.1 test
|
||||
--echo # -----------------------------------------------------------------
|
||||
|
||||
--echo
|
||||
--echo # --
|
||||
--echo # -- WL#4300: Define privileges for tablespaces.
|
||||
--echo # --
|
||||
|
||||
GRANT CREATE TABLESPACE ON *.* TO mysqltest_u1@localhost;
|
||||
|
||||
--echo
|
||||
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS mysqltest2;
|
||||
--enable_warnings
|
||||
|
||||
CREATE DATABASE mysqltest2;
|
||||
|
||||
GRANT ALL PRIVILEGES ON mysqltest2.* TO mysqltest_u2@localhost;
|
||||
|
||||
--echo
|
||||
--echo # -- Connection: mysqltest_u1@localhost
|
||||
--echo
|
||||
--connect(con1, localhost, mysqltest_u1,,)
|
||||
|
||||
--echo # -- Grants for mysqltest_u1@localhost:
|
||||
SHOW GRANTS;
|
||||
|
||||
--echo
|
||||
--echo # -- Check CREATE LOGFILE GROUP...
|
||||
CREATE LOGFILE GROUP lg1
|
||||
ADD UNDOFILE 'undofile.dat'
|
||||
INITIAL_SIZE 1M
|
||||
UNDO_BUFFER_SIZE = 1M
|
||||
ENGINE = NDB;
|
||||
|
||||
--echo
|
||||
--echo # -- Check ALTER LOGFILE GROUP...
|
||||
ALTER LOGFILE GROUP lg1
|
||||
ADD UNDOFILE 'undofile02.dat'
|
||||
INITIAL_SIZE 1M
|
||||
ENGINE = NDB;
|
||||
|
||||
--echo
|
||||
--echo # -- Check CREATE TABLESPACE...
|
||||
CREATE TABLESPACE ts1
|
||||
ADD DATAFILE 'datafile.dat'
|
||||
USE LOGFILE GROUP lg1
|
||||
INITIAL_SIZE 1M
|
||||
ENGINE = NDB;
|
||||
|
||||
--echo
|
||||
--echo # -- Check ALTER TABLESPACE...
|
||||
ALTER TABLESPACE ts1
|
||||
DROP DATAFILE 'datafile.dat'
|
||||
INITIAL_SIZE 1M
|
||||
ENGINE = NDB;
|
||||
|
||||
--echo
|
||||
--echo # -- Connection: mysqltest_u2@localhost
|
||||
--echo
|
||||
--connect(con2, localhost, mysqltest_u2,,mysqltest2)
|
||||
|
||||
--echo # -- Grants for mysqltest_u2@localhost:
|
||||
SHOW GRANTS;
|
||||
|
||||
CREATE TABLE t1(c INT) TABLESPACE ts1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo
|
||||
--echo # -- Connection: mysqltest_u1@localhost
|
||||
--echo
|
||||
--connection con1
|
||||
|
||||
--echo
|
||||
--echo # -- Check DROP TABLESPACE...
|
||||
DROP TABLESPACE ts1
|
||||
ENGINE = NDB;
|
||||
|
||||
--echo
|
||||
--echo # -- Check DROP LOGFILE GROUP...
|
||||
DROP LOGFILE GROUP lg1
|
||||
ENGINE = NDB;
|
||||
|
||||
--echo
|
||||
--echo # -- Connection: root@localhost
|
||||
--echo
|
||||
--connection default
|
||||
--disconnect con1
|
||||
|
||||
DROP USER mysqltest_u1@localhost;
|
||||
DROP USER mysqltest_u2@localhost;
|
||||
|
||||
--echo
|
||||
--echo # -----------------------------------------------------------------
|
||||
--echo # End 6.0 test
|
||||
--echo # -----------------------------------------------------------------
|
||||
|
@ -181,21 +181,21 @@ affected rows: 2
|
||||
CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=MyISAM;
|
||||
affected rows: 0
|
||||
INSERT INTO t1 VALUES(myfunc_int(100), myfunc_double(50.00));
|
||||
affected rows: 1
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
affected rows: 1
|
||||
INSERT INTO t1 VALUES(myfunc_int(10), myfunc_double(5.00));
|
||||
affected rows: 1
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
affected rows: 1
|
||||
INSERT INTO t1 VALUES(myfunc_int(200), myfunc_double(25.00));
|
||||
affected rows: 1
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
affected rows: 1
|
||||
INSERT INTO t1 VALUES(myfunc_int(1), myfunc_double(500.00));
|
||||
affected rows: 1
|
||||
Warnings:
|
||||
Note 1592 Statement may not be safe to log in statement format.
|
||||
affected rows: 1
|
||||
SELECT * FROM t1 ORDER BY sum;
|
||||
sum price
|
||||
1 48.5
|
||||
|
@ -145,7 +145,9 @@ create table t3 select 1 union select UUID();
|
||||
create table t4 select * from t1 where 3 in (select 1 union select 2 union select UUID() union select 3);
|
||||
create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3);
|
||||
# what if UUID() is first:
|
||||
--disable_warnings
|
||||
insert into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
|
||||
--enable_warnings
|
||||
|
||||
# inside a stored procedure
|
||||
|
||||
|
@ -54,19 +54,19 @@ ERROR HY000: Variable 'autocommit' is a SESSION variable and can't be used with
|
||||
SELECT @@global.autocommit;
|
||||
ERROR HY000: Variable 'autocommit' is a SESSION variable
|
||||
'#----------------------FN_DYNVARS_003_06------------------------#'
|
||||
SELECT @@session.autocommit = VARIABLE_VALUE
|
||||
SELECT IF(@@session.autocommit, "ON", "OFF") = VARIABLE_VALUE
|
||||
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
|
||||
WHERE VARIABLE_NAME='autocommit';
|
||||
@@session.autocommit = VARIABLE_VALUE
|
||||
0
|
||||
IF(@@session.autocommit, "ON", "OFF") = VARIABLE_VALUE
|
||||
1
|
||||
Bug # 34839: Values in variable and information_schema do not match for autocommit
|
||||
'#----------------------FN_DYNVARS_003_07------------------------#'
|
||||
SET @@autocommit = 1;
|
||||
SELECT @@autocommit = VARIABLE_VALUE
|
||||
SELECT IF(@@autocommit, "ON", "OFF") = VARIABLE_VALUE
|
||||
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
|
||||
WHERE VARIABLE_NAME='autocommit';
|
||||
@@autocommit = VARIABLE_VALUE
|
||||
0
|
||||
IF(@@autocommit, "ON", "OFF") = VARIABLE_VALUE
|
||||
1
|
||||
'#---------------------FN_DYNVARS_003_08-------------------------#'
|
||||
SET @@autocommit = OFF;
|
||||
SELECT @@autocommit;
|
||||
|
@ -53,11 +53,11 @@ ERROR HY000: Variable 'automatic_sp_privileges' is a GLOBAL variable and should
|
||||
SELECT @@session.automatic_sp_privileges;
|
||||
ERROR HY000: Variable 'automatic_sp_privileges' is a GLOBAL variable
|
||||
'#----------------------FN_DYNVARS_004_06------------------------#'
|
||||
SELECT @@global.automatic_sp_privileges = VARIABLE_VALUE
|
||||
SELECT IF(@@global.automatic_sp_privileges, "ON", "OFF") = VARIABLE_VALUE
|
||||
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
|
||||
WHERE VARIABLE_NAME='automatic_sp_privileges';
|
||||
@@global.automatic_sp_privileges = VARIABLE_VALUE
|
||||
0
|
||||
IF(@@global.automatic_sp_privileges, "ON", "OFF") = VARIABLE_VALUE
|
||||
1
|
||||
'Bug# 34839: Values in variable and information_schema donot match'
|
||||
'#---------------------FN_DYNVARS_004_07----------------------#'
|
||||
SET @@global.automatic_sp_privileges = OFF;
|
||||
|
@ -49,11 +49,11 @@ ERROR HY000: Variable 'big_tables' is a SESSION variable and can't be used with
|
||||
SELECT @@global.big_tables;
|
||||
ERROR HY000: Variable 'big_tables' is a SESSION variable
|
||||
'#----------------------FN_DYNVARS_005_05------------------------#'
|
||||
SELECT @@big_tables = VARIABLE_VALUE
|
||||
SELECT IF(@@big_tables, "ON", "OFF") = VARIABLE_VALUE
|
||||
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
|
||||
WHERE VARIABLE_NAME='big_tables';
|
||||
@@big_tables = VARIABLE_VALUE
|
||||
0
|
||||
IF(@@big_tables, "ON", "OFF") = VARIABLE_VALUE
|
||||
1
|
||||
Bug # 34839: Values in variable and information_schema do not match for autocommit
|
||||
'#---------------------FN_DYNVARS_005_06----------------------#'
|
||||
SET @@big_tables = OFF;
|
||||
|
@ -103,10 +103,10 @@ SELECT @@session.engine_condition_pushdown AS res_is_1;
|
||||
res_is_1
|
||||
1
|
||||
'#----------------------FN_DYNVARS_028_06------------------------#'
|
||||
SELECT @@global.engine_condition_pushdown = VARIABLE_VALUE
|
||||
SELECT IF(@@global.engine_condition_pushdown, "ON", "OFF") = VARIABLE_VALUE
|
||||
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
|
||||
WHERE VARIABLE_NAME='engine_condition_pushdown';
|
||||
@@global.engine_condition_pushdown = VARIABLE_VALUE
|
||||
IF(@@global.engine_condition_pushdown, "ON", "OFF") = VARIABLE_VALUE
|
||||
1
|
||||
SELECT @@global.engine_condition_pushdown;
|
||||
@@global.engine_condition_pushdown
|
||||
@ -117,11 +117,11 @@ WHERE VARIABLE_NAME='engine_condition_pushdown';
|
||||
VARIABLE_VALUE
|
||||
OFF
|
||||
'#----------------------FN_DYNVARS_028_07------------------------#'
|
||||
SELECT @@session.engine_condition_pushdown = VARIABLE_VALUE
|
||||
SELECT IF(@@session.engine_condition_pushdown, "ON", "OFF") = VARIABLE_VALUE
|
||||
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
|
||||
WHERE VARIABLE_NAME='engine_condition_pushdown';
|
||||
@@session.engine_condition_pushdown = VARIABLE_VALUE
|
||||
0
|
||||
IF(@@session.engine_condition_pushdown, "ON", "OFF") = VARIABLE_VALUE
|
||||
1
|
||||
SELECT @@session.engine_condition_pushdown;
|
||||
@@session.engine_condition_pushdown
|
||||
1
|
||||
|
@ -63,11 +63,11 @@ ERROR HY000: Variable 'flush' is a GLOBAL variable and should be set with SET GL
|
||||
SELECT @@session.flush;
|
||||
ERROR HY000: Variable 'flush' is a GLOBAL variable
|
||||
'#----------------------FN_DYNVARS_030_06------------------------#'
|
||||
SELECT @@global.flush = VARIABLE_VALUE
|
||||
SELECT IF(@@global.flush, "ON", "OFF") = VARIABLE_VALUE
|
||||
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
|
||||
WHERE VARIABLE_NAME='flush';
|
||||
@@global.flush = VARIABLE_VALUE
|
||||
0
|
||||
IF(@@global.flush, "ON", "OFF") = VARIABLE_VALUE
|
||||
1
|
||||
'#---------------------FN_DYNVARS_030_07----------------------#'
|
||||
SET @@global.flush = TRUE;
|
||||
SELECT @@global.flush;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user