Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-target-5.1.22

into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb-merge
This commit is contained in:
tomas@whalegate.ndb.mysql.com 2007-08-23 15:15:35 +02:00
commit 0c38530b82
193 changed files with 6897 additions and 5218 deletions

View file

@ -3,7 +3,13 @@
# Assume Forte is installed in /opt/SUNWSpro and ld is installed in
# /usr/ccs/bin
PATH=/opt/SUNWspro/bin/:/usr/ccs/bin:$PATH
PATH=/opt/SUNWspro/bin:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin:$PATH
prefix="/usr/local/mysql"
if test -n "$MYSQL_BUILD_PREFIX"
then
prefix="$MYSQL_BUILD_PREFIX"
fi
make -k maintainer-clean || true
/bin/rm -f */.deps/*.P config.cache
@ -12,9 +18,9 @@ path=`dirname $0`
. "$path/autorun.sh"
# For "optimal" code for this computer add -fast to EXTRA
# To compile 64 bit, add -xarch=v9 to EXTRA_64_BIT
# To compile 32/64 bit, uncomment/comment EXTRA_64_BIT
EXTRA_64_BIT="-xarch=v9" # Remove comment to get 64 bit binaries
EXTRA_64_BIT="-m64"
EXTRA="-fast" # Remove comment to target current machine
#
@ -22,10 +28,9 @@ EXTRA="-fast" # Remove comment to target current machine
#
STD="-mt -D_FORTEC_ $EXTRA $EXTRA_64_BIT"
ASFLAGS="$EXTRA_64_BIT" \
CC=cc-5.0 CFLAGS="-Xa -xstrconst $STD" \
CXX=CC CXXFLAGS="-noex $STD" \
./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client
./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --prefix=$PREFIX
make -j 4
if [ $? = 0 ]

View file

@ -21,22 +21,6 @@ INCLUDE(win/configure.data)
# Hardcode support for CSV storage engine
SET(WITH_CSV_STORAGE_ENGINE TRUE)
# CMAKE will not allow custom VS7+ configurations. mysqld and libmysqld
# cannot be built at the same time as they require different configurations
IF(EMBEDDED_ONLY)
ADD_DEFINITIONS(-DEMBEDDED_LIBRARY)
# By default, CMake will create Release, Debug, RelWithDebInfo and MinSizeRel
# configurations. The EMBEDDED_ONLY build parameter is necessary because CMake
# doesn't support custom build configurations for VS2005. Since the Debug
# configuration does not work properly with USE_TLS defined
# (see mysys/CMakeLists.txt) the easiest way to debug the Embedded Server is to
# use the RelWithDebInfo configuration without optimizations.
#
# Debug default CXX_FLAGS "/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1"
# RelWithDebInfo default CXX_FLAGS "/MD /Zi /O2 /Ob1 /D NDEBUG"
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /Zi /Od /Ob0 /D NDEBUG" CACHE STRING "No Optimization" FORCE)
ENDIF(EMBEDDED_ONLY)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in
${CMAKE_SOURCE_DIR}/include/mysql_version.h @ONLY)
@ -154,7 +138,9 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR
CMAKE_GENERATOR MATCHES "Visual Studio 8")
ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE")
IF(WIN32)
ADD_DEFINITIONS("-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE")
ENDIF(WIN32)
IF(EMBED_MANIFESTS)
# Search for the tools (mt, makecat, signtool) necessary for embedding
@ -229,7 +215,7 @@ ADD_SUBDIRECTORY(extra)
ADD_SUBDIRECTORY(storage/heap)
ADD_SUBDIRECTORY(storage/myisam)
ADD_SUBDIRECTORY(storage/myisammrg)
ADD_SUBDIRECTORY(client)
IF(WITH_ARCHIVE_STORAGE_ENGINE)
ADD_SUBDIRECTORY(storage/archive)
ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
@ -248,13 +234,11 @@ ENDIF(WITH_FEDERATED_STORAGE_ENGINE)
IF(WITH_INNOBASE_STORAGE_ENGINE)
ADD_SUBDIRECTORY(storage/innobase)
ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
ADD_SUBDIRECTORY(sql)
ADD_SUBDIRECTORY(server-tools/instance-manager)
ADD_SUBDIRECTORY(libmysql)
IF(EMBEDDED_ONLY)
ADD_SUBDIRECTORY(tests)
IF(WITH_EMBEDDED_SERVER)
ADD_SUBDIRECTORY(libmysqld)
ADD_SUBDIRECTORY(libmysqld/examples)
ELSE(EMBEDDED_ONLY)
ADD_SUBDIRECTORY(client)
ADD_SUBDIRECTORY(sql)
ADD_SUBDIRECTORY(server-tools/instance-manager)
ADD_SUBDIRECTORY(tests)
ENDIF(EMBEDDED_ONLY)
ENDIF(WITH_EMBEDDED_SERVER)

View file

@ -196,6 +196,8 @@ void tee_putc(int c, FILE *file);
static void tee_print_sized_data(const char *, unsigned int, unsigned int, bool);
/* The names of functions that actually do the manipulation. */
static int get_options(int argc,char **argv);
extern "C" my_bool get_one_option(int optid, const struct my_option *opt,
char *argument);
static int com_quit(String *str,char*),
com_go(String *str,char*), com_ego(String *str,char*),
com_print(String *str,char*),
@ -349,8 +351,8 @@ static ulong start_timer(void);
static void end_timer(ulong start_time,char *buff);
static void mysql_end_timer(ulong start_time,char *buff);
static void nice_time(double sec,char *buff,bool part_second);
static sig_handler mysql_end(int sig);
static sig_handler handle_sigint(int sig);
extern "C" sig_handler mysql_end(int sig);
extern "C" sig_handler handle_sigint(int sig);
int main(int argc,char *argv[])
{
@ -814,7 +816,7 @@ and you are welcome to modify and redistribute it under the GPL license\n");
}
static my_bool
my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
{
@ -1427,7 +1429,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
#ifdef HAVE_READLINE
static char *new_command_generator(const char *text, int);
static char **new_mysql_completion (const char *text, int start, int end);
extern "C" char **new_mysql_completion (const char *text, int start, int end);
/*
Tell the GNU Readline library how to complete. We want to try to complete
@ -1436,9 +1438,9 @@ static char **new_mysql_completion (const char *text, int start, int end);
*/
#if defined(USE_NEW_READLINE_INTERFACE) || defined(USE_LIBEDIT_INTERFACE)
char *no_completion(const char*,int)
extern "C" char *no_completion(const char*,int)
#else
char *no_completion()
extern "C" char *no_completion()
#endif
{
return 0; /* No filename completion */
@ -1540,9 +1542,9 @@ static void initialize_readline (char *name)
array of matches, or NULL if there aren't any.
*/
static char **new_mysql_completion (const char *text,
int start __attribute__((unused)),
int end __attribute__((unused)))
char **new_mysql_completion (const char *text,
int start __attribute__((unused)),
int end __attribute__((unused)))
{
if (!status.batch && !quick)
#if defined(USE_NEW_READLINE_INTERFACE)

View file

@ -451,7 +451,7 @@ static int run_query(const char *query, DYNAMIC_STRING *ds_res,
MYF(MY_WME))) < 0)
die("Failed to create temporary file for defaults");
if (my_write(fd, query, strlen(query),
if (my_write(fd, (uchar*) query, strlen(query),
MYF(MY_FNABP | MY_WME)))
die("Failed to write to '%s'", query_file_path);

View file

@ -71,10 +71,12 @@ static uint ex_var_count, max_var_length, max_val_length;
static void print_version(void);
static void usage(void);
extern "C" my_bool get_one_option(int optid, const struct my_option *opt,
char *argument);
static my_bool sql_connect(MYSQL *mysql, uint wait);
static int execute_commands(MYSQL *mysql,int argc, char **argv);
static int drop_db(MYSQL *mysql,const char *db);
static sig_handler endprog(int signal_number);
extern "C" sig_handler endprog(int signal_number);
static void nice_time(ulong sec,char *buff);
static void print_header(MYSQL_RES *result);
static void print_top(MYSQL_RES *result);
@ -230,7 +232,7 @@ static struct my_option my_long_options[] =
static const char *load_default_groups[]= { "mysqladmin","client",0 };
static my_bool
my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
{
@ -430,7 +432,7 @@ int main(int argc,char *argv[])
}
static sig_handler endprog(int signal_number __attribute__((unused)))
sig_handler endprog(int signal_number __attribute__((unused)))
{
interrupted=1;
}

View file

@ -1030,14 +1030,14 @@ static int dump_log_entries(const char* logname)
like CREATE PROCEDURE safely
*/
fprintf(result_file, "DELIMITER /*!*/;\n");
strcpy(print_event_info.delimiter, "/*!*/;");
strmov(print_event_info.delimiter, "/*!*/;");
rc= (remote_opt ? dump_remote_log_entries(&print_event_info, logname) :
dump_local_log_entries(&print_event_info, logname));
/* Set delimiter back to semicolon */
fprintf(result_file, "DELIMITER ;\n");
strcpy(print_event_info.delimiter, ";");
strmov(print_event_info.delimiter, ";");
return rc;
}

View file

@ -677,7 +677,7 @@ static void print_result()
*/
if (found_error && opt_auto_repair && what_to_do != DO_REPAIR &&
strcmp(row[3],"OK"))
insert_dynamic(&tables4repair, prev);
insert_dynamic(&tables4repair, (uchar*) prev);
found_error=0;
if (opt_silent)
continue;
@ -697,7 +697,7 @@ static void print_result()
}
/* add the last table to be repaired to the list */
if (found_error && opt_auto_repair && what_to_do != DO_REPAIR)
insert_dynamic(&tables4repair, prev);
insert_dynamic(&tables4repair, (uchar*) prev);
mysql_free_result(res);
}

View file

@ -3913,9 +3913,9 @@ static int init_dumping(char *database, int init_func(char*))
/* Return 1 if we should copy the table */
my_bool include_table(const char* hash_key, uint len)
my_bool include_table(const uchar *hash_key, size_t len)
{
return !hash_search(&ignore_table, (uchar*) hash_key, len);
return !hash_search(&ignore_table, hash_key, len);
}
@ -3943,7 +3943,7 @@ static int dump_all_tables_in_db(char *database)
for (numrows= 0 ; (table= getTableName(1)) ; )
{
char *end= strmov(afterdot, table);
if (include_table(hash_key,end - hash_key))
if (include_table((uchar*) hash_key,end - hash_key))
{
numrows++;
dynstr_append_checked(&query, quote_name(table, table_buff, 1));
@ -3964,7 +3964,7 @@ static int dump_all_tables_in_db(char *database)
while ((table= getTableName(0)))
{
char *end= strmov(afterdot, table);
if (include_table(hash_key, end - hash_key))
if (include_table((uchar*) hash_key, end - hash_key))
{
dump_table(table,database);
my_free(order_by, MYF(MY_ALLOW_ZERO_PTR));
@ -4043,7 +4043,7 @@ static my_bool dump_all_views_in_db(char *database)
for (numrows= 0 ; (table= getTableName(1)); )
{
char *end= strmov(afterdot, table);
if (include_table(hash_key,end - hash_key))
if (include_table((uchar*) hash_key,end - hash_key))
{
numrows++;
dynstr_append_checked(&query, quote_name(table, table_buff, 1));
@ -4064,7 +4064,7 @@ static my_bool dump_all_views_in_db(char *database)
while ((table= getTableName(0)))
{
char *end= strmov(afterdot, table);
if (include_table(hash_key, end - hash_key))
if (include_table((uchar*) hash_key, end - hash_key))
get_view_structure(table, database);
}
if (opt_xml)

View file

@ -1354,7 +1354,7 @@ get_options(int *argc,char ***argv)
}
tmp_string= (char *)my_malloc(sbuf.st_size + 1,
MYF(MY_ZEROFILL|MY_FAE|MY_WME));
my_read(data_file, tmp_string, sbuf.st_size, MYF(0));
my_read(data_file, (uchar*) tmp_string, sbuf.st_size, MYF(0));
tmp_string[sbuf.st_size]= '\0';
my_close(data_file,MYF(0));
parse_delimiter(tmp_string, &create_statements, delimiter[0]);
@ -1381,7 +1381,7 @@ get_options(int *argc,char ***argv)
}
tmp_string= (char *)my_malloc(sbuf.st_size + 1,
MYF(MY_ZEROFILL|MY_FAE|MY_WME));
my_read(data_file, tmp_string, sbuf.st_size, MYF(0));
my_read(data_file, (uchar*) tmp_string, sbuf.st_size, MYF(0));
tmp_string[sbuf.st_size]= '\0';
my_close(data_file,MYF(0));
if (user_supplied_query)
@ -1412,7 +1412,7 @@ get_options(int *argc,char ***argv)
}
tmp_string= (char *)my_malloc(sbuf.st_size + 1,
MYF(MY_ZEROFILL|MY_FAE|MY_WME));
my_read(data_file, tmp_string, sbuf.st_size, MYF(0));
my_read(data_file, (uchar*) tmp_string, sbuf.st_size, MYF(0));
tmp_string[sbuf.st_size]= '\0';
my_close(data_file,MYF(0));
if (user_supplied_pre_statements)
@ -1443,7 +1443,7 @@ get_options(int *argc,char ***argv)
}
tmp_string= (char *)my_malloc(sbuf.st_size + 1,
MYF(MY_ZEROFILL|MY_FAE|MY_WME));
my_read(data_file, tmp_string, sbuf.st_size, MYF(0));
my_read(data_file, (uchar*) tmp_string, sbuf.st_size, MYF(0));
tmp_string[sbuf.st_size]= '\0';
my_close(data_file,MYF(0));
if (user_supplied_post_statements)
@ -2076,7 +2076,7 @@ print_conclusions_csv(conclusions *con)
con->users, /* Children used */
con->avg_rows /* Queries run */
);
my_write(csv_file, buffer, (uint)strlen(buffer), MYF(0));
my_write(csv_file, (uchar*) buffer, (uint)strlen(buffer), MYF(0));
}
void

View file

@ -1514,7 +1514,7 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
void var_set_query_get_value(struct st_command *command, VAR *var)
{
ulong row_no;
long row_no;
int col_no= -1;
MYSQL_RES* res;
MYSQL* mysql= &cur_con->mysql;
@ -1591,7 +1591,7 @@ void var_set_query_get_value(struct st_command *command, VAR *var)
while ((row= mysql_fetch_row(res)))
{
if (++rows == row_no)
if (++rows == (ulong) row_no)
{
DBUG_PRINT("info", ("At row %ld, column %d is '%s'",
@ -2584,7 +2584,7 @@ void do_send_quit(struct st_command *command)
DBUG_PRINT("info", ("con->name: %s", con->name));
if (!strcmp(con->name, name))
{
simple_command(&con->mysql,COM_QUIT,NullS,0,1);
simple_command(&con->mysql,COM_QUIT,0,0,1);
DBUG_VOID_RETURN;
}
}

View file

@ -805,10 +805,8 @@ copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
const uchar *from_end= (const uchar*) from+from_length;
char *to_start= to;
uchar *to_end= (uchar*) to+to_length;
int (*mb_wc)(struct charset_info_st *, my_wc_t *, const uchar *,
const uchar *) = from_cs->cset->mb_wc;
int (*wc_mb)(struct charset_info_st *, my_wc_t, uchar *s, uchar *e)=
to_cs->cset->wc_mb;
my_charset_conv_mb_wc mb_wc= from_cs->cset->mb_wc;
my_charset_conv_wc_mb wc_mb= to_cs->cset->wc_mb;
uint error_count= 0;
while (1)

View file

@ -743,7 +743,7 @@ AC_CHECK_HEADERS(fcntl.h float.h floatingpoint.h ieeefp.h limits.h \
unistd.h utime.h sys/utime.h termio.h termios.h sched.h crypt.h alloca.h \
sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h linux/config.h \
sys/prctl.h \
sys/resource.h sys/param.h port.h)
sys/resource.h sys/param.h port.h ieeefp.h)
AC_CHECK_HEADERS([xfs/xfs.h])
@ -757,6 +757,7 @@ AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
AC_CHECK_LIB(nsl_r, gethostbyname_r, [],
AC_CHECK_LIB(nsl, gethostbyname_r))
AC_CHECK_FUNC(gethostbyname_r)
AC_CHECK_LIB(mtmalloc, malloc)
AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
AC_CHECK_FUNC(yp_get_default_domain, ,

View file

@ -309,9 +309,9 @@ static int insert_pointer_name(reg1 POINTER_ARRAY *pa,char * name)
old_count*sizeof(*pa->flag));
}
pa->flag[pa->typelib.count]=0; /* Reset flag */
pa->typelib.type_names[pa->typelib.count++]= pa->str+pa->length;
pa->typelib.type_names[pa->typelib.count++]= (char*) (pa->str+pa->length);
pa->typelib.type_names[pa->typelib.count]= NullS; /* Put end-mark */
VOID(strmov(pa->str+pa->length,name));
VOID(strmov((char*) pa->str + pa->length, name));
pa->length+=length;
DBUG_RETURN(0);
} /* insert_pointer_name */
@ -988,7 +988,8 @@ int n;
return 0;
/* Read in new stuff. */
if ((i=(int) my_read(fd, buffer + bufbytes, (uint) bufread,MYF(MY_WME))) < 0)
if ((i=(int) my_read(fd, (uchar*) buffer + bufbytes,
(size_t) bufread, MYF(MY_WME))) < 0)
return -1;
/* Kludge to pretend every nonempty file ends with a newline. */
@ -1039,7 +1040,7 @@ FILE *in,*out;
return 1;
if (!my_eof)
out_buff[length++]=save_char; /* Don't write added newline */
if (my_fwrite(out,out_buff,length,MYF(MY_WME | MY_NABP)))
if (my_fwrite(out, (uchar*) out_buff, length, MYF(MY_WME | MY_NABP)))
DBUG_RETURN(1);
}
}

View file

@ -170,6 +170,14 @@ extern MY_COLLATION_HANDLER my_collation_8bit_bin_handler;
extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler;
extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler;
/* Some typedef to make it easy for C++ to make function pointers */
typedef int (*my_charset_conv_mb_wc)(struct charset_info_st *, my_wc_t *,
const uchar *, const uchar *);
typedef int (*my_charset_conv_wc_mb)(struct charset_info_st *, my_wc_t,
uchar *, uchar *);
typedef size_t (*my_charset_conv_case)(struct charset_info_st *,
char *, size_t, char *, size_t);
/* See strings/CHARSET_INFO.txt about information on this structure */
typedef struct my_charset_handler_st
@ -188,11 +196,9 @@ typedef struct my_charset_handler_st
size_t (*numcells)(struct charset_info_st *, const char *b, const char *e);
/* Unicode conversion */
int (*mb_wc)(struct charset_info_st *cs,my_wc_t *wc,
const uchar *s,const uchar *e);
int (*wc_mb)(struct charset_info_st *cs,my_wc_t wc,
uchar *s,uchar *e);
my_charset_conv_mb_wc mb_wc;
my_charset_conv_wc_mb wc_mb;
/* CTYPE scanner */
int (*ctype)(struct charset_info_st *cs, int *ctype,
const uchar *s, const uchar *e);
@ -200,11 +206,10 @@ typedef struct my_charset_handler_st
/* Functions for case and sort conversion */
size_t (*caseup_str)(struct charset_info_st *, char *);
size_t (*casedn_str)(struct charset_info_st *, char *);
size_t (*caseup)(struct charset_info_st *, char *src, size_t srclen,
char *dst, size_t dstlen);
size_t (*casedn)(struct charset_info_st *, char *src, size_t srclen,
char *dst, size_t dstlen);
my_charset_conv_case caseup;
my_charset_conv_case casedn;
/* Charset dependant snprintf() */
size_t (*snprintf)(struct charset_info_st *, char *to, size_t n,
const char *fmt,

View file

@ -225,6 +225,7 @@ extern CHARSET_INFO compiled_charsets[];
/* statistics */
extern ulong my_file_opened,my_stream_opened, my_tmp_file_created;
extern ulong my_file_total_opened;
extern uint mysys_usage_id;
extern my_bool my_init_done;

View file

@ -455,7 +455,7 @@ typedef struct st_sort_info
enum data_file_type new_data_file_type;
MI_INFO *info;
MI_CHECK *param;
char *buff;
uchar *buff;
SORT_KEY_BLOCKS *key_block,*key_block_end;
SORT_FT_BUF *ft_buf;
/* sync things */

View file

@ -38,6 +38,7 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
# Include and add the directory path
SET(SOURCE_SUBLIBS TRUE)
SET(LIB_SOURCES "")
INCLUDE(${CMAKE_SOURCE_DIR}/zlib/CMakeLists.txt)
FOREACH(rpath ${ZLIB_SOURCES})
@ -118,16 +119,16 @@ ADD_LIBRARY(mysqlclient_notls STATIC ${CLIENT_SOURCES})
ADD_DEPENDENCIES(mysqlclient_notls GenError)
TARGET_LINK_LIBRARIES(mysqlclient_notls)
IF(NOT EMBEDDED_ONLY)
ADD_LIBRARY(libmysql SHARED ${CLIENT_SOURCES} dll.c libmysql.def)
ADD_LIBRARY(libmysql SHARED ${CLIENT_SOURCES} dll.c libmysql.def)
IF(WIN32)
SET_TARGET_PROPERTIES(libmysql mysqlclient PROPERTIES COMPILE_FLAGS "-DUSE_TLS")
ADD_DEPENDENCIES(libmysql GenError)
TARGET_LINK_LIBRARIES(libmysql wsock32)
ADD_EXECUTABLE(myTest mytest.c)
TARGET_LINK_LIBRARIES(myTest libmysql)
IF(EMBED_MANIFESTS)
MYSQL_EMBED_MANIFEST("myTest" "asInvoker")
ENDIF(EMBED_MANIFESTS)
ENDIF(NOT EMBEDDED_ONLY)
ENDIF(WIN32)
ADD_DEPENDENCIES(libmysql GenError)
TARGET_LINK_LIBRARIES(libmysql wsock32)
ADD_EXECUTABLE(myTest mytest.c)
TARGET_LINK_LIBRARIES(myTest libmysql)
IF(EMBED_MANIFESTS)
MYSQL_EMBED_MANIFEST("myTest" "asInvoker")
ENDIF(EMBED_MANIFESTS)

View file

@ -341,7 +341,7 @@ my_bool STDCALL mysql_master_send_query(MYSQL *mysql, const char *q,
DBUG_RETURN(1);
master->reconnect= 1;
mysql->last_used_con = master;
DBUG_RETURN(simple_command(master, COM_QUERY, q, length, 1));
DBUG_RETURN(simple_command(master, COM_QUERY, (const uchar*) q, length, 1));
}
@ -375,7 +375,8 @@ my_bool STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q,
0,0,0,0))
DBUG_RETURN(1);
slave_to_use->reconnect= 1;
DBUG_RETURN(simple_command(slave_to_use, COM_QUERY, q, length, 1));
DBUG_RETURN(simple_command(slave_to_use, COM_QUERY, (const uchar*) q,
length, 1));
}
@ -669,7 +670,8 @@ int cli_read_change_user_result(MYSQL *mysql, char *buff, const char *passwd)
password in old format. The reply contains scramble_323.
*/
scramble_323(buff, mysql->scramble, passwd);
if (my_net_write(net, buff, SCRAMBLE_LENGTH_323 + 1) || net_flush(net))
if (my_net_write(net, (uchar*) buff, SCRAMBLE_LENGTH_323 + 1) ||
net_flush(net))
{
net->last_errno= CR_SERVER_LOST;
strmov(net->sqlstate, unknown_sqlstate);
@ -720,7 +722,7 @@ my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user,
end= strmov(end, db ? db : "") + 1;
/* Write authentication package */
simple_command(mysql,COM_CHANGE_USER, buff,(ulong) (end-buff),1);
simple_command(mysql,COM_CHANGE_USER, (uchar*) buff, (ulong) (end-buff), 1);
rc= (*mysql->methods->read_change_user_result)(mysql, buff, passwd);
@ -830,7 +832,7 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename)
if ((*options->local_infile_init)(&li_ptr, net_filename,
options->local_infile_userdata))
{
VOID(my_net_write(net,"",0)); /* Server needs one packet */
VOID(my_net_write(net,(const uchar*) "",0)); /* Server needs one packet */
net_flush(net);
strmov(net->sqlstate, unknown_sqlstate);
net->last_errno= (*options->local_infile_error)(li_ptr,
@ -844,7 +846,7 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename)
(*options->local_infile_read)(li_ptr, buf,
packet_length)) > 0)
{
if (my_net_write(net,buf,readcount))
if (my_net_write(net, (uchar*) buf, readcount))
{
DBUG_PRINT("error",
("Lost connection to MySQL server during LOAD DATA of local file"));
@ -856,7 +858,7 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename)
}
/* Send empty packet to mark end of file */
if (my_net_write(net,"",0) || net_flush(net))
if (my_net_write(net, (const uchar*) "", 0) || net_flush(net))
{
strmov(net->sqlstate, unknown_sqlstate);
net->last_errno=CR_SERVER_LOST;
@ -1242,7 +1244,8 @@ mysql_list_fields(MYSQL *mysql, const char *table, const char *wild)
end=strmake(strmake(buff, table,128)+1,wild ? wild : "",128);
free_old_query(mysql);
if (simple_command(mysql,COM_FIELD_LIST,buff,(ulong) (end-buff),1) ||
if (simple_command(mysql, COM_FIELD_LIST, (uchar*) buff,
(ulong) (end-buff), 1) ||
!(fields= (*mysql->methods->list_fields)(mysql)))
DBUG_RETURN(NULL);
@ -1313,7 +1316,7 @@ mysql_shutdown(MYSQL *mysql, enum mysql_enum_shutdown_level shutdown_level)
uchar level[1];
DBUG_ENTER("mysql_shutdown");
level[0]= (uchar) shutdown_level;
DBUG_RETURN(simple_command(mysql, COM_SHUTDOWN, (char *)level, 1, 0));
DBUG_RETURN(simple_command(mysql, COM_SHUTDOWN, level, 1, 0));
}
@ -1323,14 +1326,14 @@ mysql_refresh(MYSQL *mysql,uint options)
uchar bits[1];
DBUG_ENTER("mysql_refresh");
bits[0]= (uchar) options;
DBUG_RETURN(simple_command(mysql,COM_REFRESH,(char*) bits,1,0));
DBUG_RETURN(simple_command(mysql, COM_REFRESH, bits, 1, 0));
}
int STDCALL
mysql_kill(MYSQL *mysql,ulong pid)
{
char buff[4];
uchar buff[4];
DBUG_ENTER("mysql_kill");
int4store(buff,pid);
DBUG_RETURN(simple_command(mysql,COM_PROCESS_KILL,buff,sizeof(buff),0));
@ -1340,7 +1343,7 @@ mysql_kill(MYSQL *mysql,ulong pid)
int STDCALL
mysql_set_server_option(MYSQL *mysql, enum enum_mysql_set_option option)
{
char buff[2];
uchar buff[2];
DBUG_ENTER("mysql_set_server_option");
int2store(buff, (uint) option);
DBUG_RETURN(simple_command(mysql, COM_SET_OPTION, buff, sizeof(buff), 0));
@ -2059,7 +2062,7 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length)
if ((int) stmt->state > (int) MYSQL_STMT_INIT_DONE)
{
/* This is second prepare with another statement */
char buff[MYSQL_STMT_HEADER]; /* 4 bytes - stmt id */
uchar buff[MYSQL_STMT_HEADER]; /* 4 bytes - stmt id */
if (reset_stmt_handle(stmt, RESET_LONG_DATA | RESET_STORE_RESULT))
DBUG_RETURN(1);
@ -2089,7 +2092,7 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length)
}
}
if (stmt_command(mysql, COM_STMT_PREPARE, query, length, stmt))
if (stmt_command(mysql, COM_STMT_PREPARE, (const uchar*) query, length, stmt))
{
set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno,
mysql->net.sqlstate);
@ -2425,9 +2428,9 @@ static void store_param_str(NET *net, MYSQL_BIND *param)
{
/* param->length is always set in mysql_stmt_bind_param */
ulong length= *param->length;
char *to= (char *) net_store_length((char *) net->write_pos, length);
uchar *to= net_store_length(net->write_pos, length);
memcpy(to, param->buffer, length);
net->write_pos= (uchar*) to+length;
net->write_pos= to+length;
}
@ -2495,10 +2498,9 @@ static my_bool execute(MYSQL_STMT *stmt, char *packet, ulong length)
{
MYSQL *mysql= stmt->mysql;
NET *net= &mysql->net;
char buff[4 /* size of stmt id */ +
5 /* execution flags */];
uchar buff[4 /* size of stmt id */ +
5 /* execution flags */];
my_bool res;
DBUG_ENTER("execute");
DBUG_DUMP("packet", packet, length);
@ -2508,7 +2510,7 @@ static my_bool execute(MYSQL_STMT *stmt, char *packet, ulong length)
int4store(buff+5, 1); /* iteration count */
res= test(cli_advanced_command(mysql, COM_STMT_EXECUTE, buff, sizeof(buff),
packet, length, 1, NULL) ||
(uchar*) packet, length, 1, NULL) ||
(*mysql->methods->read_query_result)(mysql));
stmt->affected_rows= mysql->affected_rows;
stmt->server_status= mysql->server_status;
@ -2587,7 +2589,7 @@ int cli_stmt_execute(MYSQL_STMT *stmt)
}
length= (ulong) (net->write_pos - net->buff);
/* TODO: Look into avoding the following memdup */
if (!(param_data= my_memdup((const char*) net->buff, length, MYF(0))))
if (!(param_data= my_memdup(net->buff, length, MYF(0))))
{
set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate);
DBUG_RETURN(1);
@ -2714,8 +2716,8 @@ stmt_read_row_from_cursor(MYSQL_STMT *stmt, unsigned char **row)
MYSQL *mysql= stmt->mysql;
NET *net= &mysql->net;
MYSQL_DATA *result= &stmt->result;
char buff[4 /* statement id */ +
4 /* number of rows to fetch */];
uchar buff[4 /* statement id */ +
4 /* number of rows to fetch */];
free_root(&result->alloc, MYF(MY_KEEP_PREALLOC));
result->data= NULL;
@ -2724,7 +2726,7 @@ stmt_read_row_from_cursor(MYSQL_STMT *stmt, unsigned char **row)
int4store(buff, stmt->stmt_id);
int4store(buff + 4, stmt->prefetch_rows); /* number of rows to fetch */
if ((*mysql->methods->advanced_command)(mysql, COM_STMT_FETCH,
buff, sizeof(buff), NullS, 0,
buff, sizeof(buff), (uchar*) 0, 0,
1, NULL))
{
set_stmt_errmsg(stmt, net->last_error, net->last_errno, net->sqlstate);
@ -3380,7 +3382,7 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number,
{
MYSQL *mysql= stmt->mysql;
/* Packet header: stmt id (4 bytes), param no (2 bytes) */
char buff[MYSQL_LONG_DATA_HEADER];
uchar buff[MYSQL_LONG_DATA_HEADER];
int4store(buff, stmt->stmt_id);
int2store(buff + 4, param_number);
@ -3391,7 +3393,7 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number,
This is intentional to save bandwidth.
*/
if ((*mysql->methods->advanced_command)(mysql, COM_STMT_SEND_LONG_DATA,
buff, sizeof(buff), data,
buff, sizeof(buff), (uchar*) data,
length, 1, NULL))
{
set_stmt_errmsg(stmt, mysql->net.last_error,
@ -3719,19 +3721,20 @@ static void fetch_long_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
}
default:
{
char buff[22]; /* Enough for longlong */
char *end= longlong10_to_str(value, buff, is_unsigned ? 10: -10);
uchar buff[22]; /* Enough for longlong */
uchar *end= (uchar*) longlong10_to_str(value, (char*) buff,
is_unsigned ? 10: -10);
/* Resort to string conversion which supports all typecodes */
uint length= (uint) (end-buff);
if (field->flags & ZEROFILL_FLAG && length < field->length &&
field->length < 21)
{
bmove_upp((char*) buff+field->length,buff+length, length);
bfill((char*) buff, field->length - length,'0');
bmove_upp(buff+field->length,buff+length, length);
bfill(buff, field->length - length,'0');
length= field->length;
}
fetch_string_with_conversion(param, buff, length);
fetch_string_with_conversion(param, (char*) buff, length);
break;
}
}
@ -4785,14 +4788,14 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt)
Server side cursor exist, tell server to start sending the rows
*/
NET *net= &mysql->net;
char buff[4 /* statement id */ +
4 /* number of rows to fetch */];
uchar buff[4 /* statement id */ +
4 /* number of rows to fetch */];
/* Send row request to the server */
int4store(buff, stmt->stmt_id);
int4store(buff + 4, (int)~0); /* number of rows to fetch */
if (cli_advanced_command(mysql, COM_STMT_FETCH, buff, sizeof(buff),
NullS, 0, 1, NULL))
(uchar*) 0, 0, 1, NULL))
{
set_stmt_errmsg(stmt, net->last_error, net->last_errno, net->sqlstate);
DBUG_RETURN(1);
@ -4976,7 +4979,7 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags)
Reset the server side statement and close the server side
cursor if it exists.
*/
char buff[MYSQL_STMT_HEADER]; /* packet header: 4 bytes for stmt id */
uchar buff[MYSQL_STMT_HEADER]; /* packet header: 4 bytes for stmt id */
int4store(buff, stmt->stmt_id);
if ((*mysql->methods->advanced_command)(mysql, COM_STMT_RESET, buff,
sizeof(buff), 0, 0, 0, NULL))
@ -5037,7 +5040,7 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt)
net_clear_error(&mysql->net);
if ((int) stmt->state > (int) MYSQL_STMT_INIT_DONE)
{
char buff[MYSQL_STMT_HEADER]; /* 4 bytes - stmt id */
uchar buff[MYSQL_STMT_HEADER]; /* 4 bytes - stmt id */
if (mysql->unbuffered_fetch_owner == &stmt->unbuffered_fetch_cancelled)
mysql->unbuffered_fetch_owner= 0;

View file

@ -158,7 +158,7 @@ MYSQL_MANAGER* STDCALL mysql_manager_connect(MYSQL_MANAGER* con,
}
sprintf(msg_buf,"%-.16s %-.16s\n",user,passwd);
msg_len=strlen(msg_buf);
if (my_net_write(&con->net,msg_buf,msg_len) || net_flush(&con->net))
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");
@ -218,7 +218,7 @@ int STDCALL mysql_manager_command(MYSQL_MANAGER* con,const char* cmd,
{
if (!cmd_len)
cmd_len=strlen(cmd);
if (my_net_write(&con->net,(char*)cmd,cmd_len) || net_flush(&con->net))
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");

View file

@ -18,7 +18,11 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
# Need to set USE_TLS, since __declspec(thread) approach to thread local
# storage does not work properly in DLLs.
ADD_DEFINITIONS(-DUSE_TLS -DMYSQL_SERVER)
IF(WIN32)
ADD_DEFINITIONS(-DUSE_TLS)
ENDIF(WIN32)
ADD_DEFINITIONS(-DMYSQL_SERVER -DEMBEDDED_LIBRARY)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/libmysqld
@ -26,18 +30,124 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/sql
${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/extra/yassl/include
${CMAKE_SOURCE_DIR}/zlib
)
${CMAKE_SOURCE_DIR}/zlib)
SET_SOURCE_FILES_PROPERTIES(sql_yacc.cc
sql_yacc.h
message.h
message.rc
${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc
lex_hash.h
PROPERTIES GENERATED 1)
SET(GEN_SOURCES ${CMAKE_SOURCE_DIR}/sql/sql_yacc.cc
${CMAKE_SOURCE_DIR}/sql/sql_yacc.h
${CMAKE_SOURCE_DIR}/sql/message.h
${CMAKE_SOURCE_DIR}/sql/message.rc
${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc
${CMAKE_SOURCE_DIR}/sql/lex_hash.h)
SET_SOURCE_FILES_PROPERTIES(${GEN_SOURCES} PROPERTIES GENERATED 1)
# Include and add the directory path
SET(SOURCE_SUBLIBS TRUE)
SET(LIB_SOURCES "")
INCLUDE(${CMAKE_SOURCE_DIR}/zlib/CMakeLists.txt)
FOREACH(rpath ${ZLIB_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../zlib/${rpath})
ENDFOREACH(rpath)
# FIXME only needed if build type is "Debug", but CMAKE_BUILD_TYPE is
# not set during configure time.
INCLUDE(${CMAKE_SOURCE_DIR}/dbug/CMakeLists.txt)
FOREACH(rpath ${DBUG_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../dbug/${rpath})
ENDFOREACH(rpath)
INCLUDE(${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/CMakeLists.txt)
FOREACH(rpath ${TAOCRYPT_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../extra/yassl/taocrypt/${rpath})
ENDFOREACH(rpath)
INCLUDE(${CMAKE_SOURCE_DIR}/extra/yassl/CMakeLists.txt)
FOREACH(rpath ${YASSL_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../extra/yassl/${rpath})
ENDFOREACH(rpath)
INCLUDE(${CMAKE_SOURCE_DIR}/strings/CMakeLists.txt)
FOREACH(rpath ${STRINGS_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../strings/${rpath})
ENDFOREACH(rpath)
INCLUDE(${CMAKE_SOURCE_DIR}/regex/CMakeLists.txt)
FOREACH(rpath ${REGEX_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../regex/${rpath})
ENDFOREACH(rpath)
INCLUDE(${CMAKE_SOURCE_DIR}/mysys/CMakeLists.txt)
FOREACH(rpath ${MYSYS_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../mysys/${rpath})
ENDFOREACH(rpath)
INCLUDE(${CMAKE_SOURCE_DIR}/vio/CMakeLists.txt)
FOREACH(rpath ${VIO_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../vio/${rpath})
ENDFOREACH(rpath)
# Engines
INCLUDE(${CMAKE_SOURCE_DIR}/storage/heap/CMakeLists.txt)
FOREACH(rpath ${HEAP_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/heap/${rpath})
ENDFOREACH(rpath)
INCLUDE(${CMAKE_SOURCE_DIR}/storage/myisam/CMakeLists.txt)
FOREACH(rpath ${MYISAM_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/myisam/${rpath})
ENDFOREACH(rpath)
INCLUDE(${CMAKE_SOURCE_DIR}/storage/myisammrg/CMakeLists.txt)
FOREACH(rpath ${MYISAMMRG_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/myisammrg/${rpath})
ENDFOREACH(rpath)
IF(WITH_ARCHIVE_STORAGE_ENGINE)
INCLUDE(${CMAKE_SOURCE_DIR}/storage/archive/CMakeLists.txt)
FOREACH(rpath ${ARCHIVE_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/archive/${rpath})
ENDFOREACH(rpath)
ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
IF(WITH_BLACKHOLE_STORAGE_ENGINE)
INCLUDE(${CMAKE_SOURCE_DIR}/storage/blackhole/CMakeLists.txt)
FOREACH(rpath ${BLACKHOLE_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/blackhole/${rpath})
ENDFOREACH(rpath)
ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE)
IF(WITH_EXAMPLE_STORAGE_ENGINE)
INCLUDE(${CMAKE_SOURCE_DIR}/storage/example/CMakeLists.txt)
FOREACH(rpath ${EXAMPLE_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/example/${rpath})
ENDFOREACH(rpath)
ENDIF(WITH_EXAMPLE_STORAGE_ENGINE)
IF(WITH_FEDERATED_STORAGE_ENGINE)
INCLUDE(${CMAKE_SOURCE_DIR}/storage/federated/CMakeLists.txt)
FOREACH(rpath ${FEDERATED_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/federated/${rpath})
ENDFOREACH(rpath)
ENDIF(WITH_FEDERATED_STORAGE_ENGINE)
IF(WITH_INNOBASE_STORAGE_ENGINE)
INCLUDE(${CMAKE_SOURCE_DIR}/storage/innobase/CMakeLists.txt)
FOREACH(rpath ${INNOBASE_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/innobase/${rpath})
ENDFOREACH(rpath)
ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
IF(WITH_CSV_STORAGE_ENGINE)
INCLUDE(${CMAKE_SOURCE_DIR}/storage/csv/CMakeLists.txt)
FOREACH(rpath ${CSV_SOURCES})
SET(LIB_SOURCES ${LIB_SOURCES} ../storage/csv/${rpath})
ENDFOREACH(rpath)
ENDIF(WITH_CSV_STORAGE_ENGINE)
SET(SOURCE_SUBLIBS FALSE)
ADD_LIBRARY(mysqldemb emb_qcache.cc libmysqld.c lib_sql.cc
SET(LIBMYSQLD_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
../libmysql/libmysql.c ../libmysql/errmsg.c ../client/get_password.c
../sql-common/client.c ../sql-common/my_time.c
../sql-common/my_user.c ../sql-common/pack.c
@ -69,101 +179,30 @@ ADD_LIBRARY(mysqldemb emb_qcache.cc libmysqld.c lib_sql.cc
../sql/sql_binlog.cc ../sql/sql_manager.cc ../sql/sql_map.cc
../sql/sql_parse.cc ../sql/sql_partition.cc ../sql/sql_plugin.cc
../sql/sql_prepare.cc ../sql/sql_rename.cc ../sql/sql_repl.cc
../sql/sql_select.cc ../sql/sql_servers.cc ../sql/sql_builtin.cc
../sql/sql_select.cc ../sql/sql_servers.cc
../sql/sql_show.cc ../sql/sql_state.c ../sql/sql_string.cc
../sql/sql_tablespace.cc ../sql/sql_table.cc ../sql/sql_test.cc
../sql/sql_trigger.cc ../sql/sql_udf.cc ../sql/sql_union.cc
../sql/sql_update.cc ../sql/sql_view.cc
../sql/strfunc.cc ../sql/table.cc ../sql/thr_malloc.cc
../sql/time.cc ../sql/tztime.cc ../sql/uniques.cc ../sql/unireg.cc
../sql/partition_info.cc ../sql/sql_locale.cc ../sql/sql_connect.cc
../sql/partition_info.cc ../sql/sql_connect.cc
../sql/scheduler.cc
../vio/vio.c ../vio/viosocket.c ../vio/viossl.c
../vio/viosslfactories.c
sql_yacc.cc
sql_yacc.h
message.h
message.rc
lex_hash.h)
ADD_DEPENDENCIES(mysqldemb GenError)
# Sql Parser custom command
ADD_CUSTOM_COMMAND(
SOURCE ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy
OUTPUT sql_yacc.cc
COMMAND bison.exe
ARGS -y -p MYSQL --defines=sql_yacc.h
--output=sql_yacc.cc ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy
DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy
)
ADD_CUSTOM_COMMAND(
OUTPUT sql_yacc.h
COMMAND echo
DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
)
# Windows message file
ADD_CUSTOM_COMMAND(
SOURCE ${CMAKE_SOURCE_DIR}/sql/message.mc
OUTPUT message.rc message.h
COMMAND mc
ARGS ${CMAKE_SOURCE_DIR}/sql/message.mc
DEPENDS ${CMAKE_SOURCE_DIR}/sql/message.mc
)
# Gen_lex_hash
ADD_EXECUTABLE(gen_lex_hash ../sql/gen_lex_hash.cc)
TARGET_LINK_LIBRARIES(gen_lex_hash dbug mysqlclient wsock32)
GET_TARGET_PROPERTY(GEN_LEX_HASH_EXE gen_lex_hash LOCATION)
ADD_CUSTOM_COMMAND(
OUTPUT lex_hash.h
COMMAND ${GEN_LEX_HASH_EXE} ARGS > lex_hash.h
DEPENDS ${GEN_LEX_HASH_EXE}
)
# Remove the auto-generated files as part of 'Clean Solution'
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
"lex_hash.h;message.rc;message.h;sql_yacc.h;sql_yacc.cc")
ADD_DEPENDENCIES(mysqldemb gen_lex_hash)
${GEN_SOURCES}
${LIB_SOURCES})
# Seems we cannot make a library without at least one source file. So use a
# dummy empty file
FILE(WRITE cmake_dummy.c " ")
ADD_LIBRARY(mysqlserver cmake_dummy.c)
TARGET_LINK_LIBRARIES(mysqlserver wsock32)
ADD_DEPENDENCIES(mysqlserver mysqldemb heap myisam myisammrg dbug mysys zlib strings mysqldemb regex
yassl taocrypt vio)
IF(WITH_ARCHIVE_STORAGE_ENGINE)
ADD_DEPENDENCIES(mysqlserver archive)
ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
IF(WITH_EXAMPLE_STORAGE_ENGINE)
ADD_DEPENDENCIES(mysqlserver example)
ENDIF(WITH_EXAMPLE_STORAGE_ENGINE)
IF(WITH_BLACKHOLE_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(mysqlserver blackhole)
ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE)
IF(WITH_CSV_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(mysqlserver csv)
ENDIF(WITH_CSV_STORAGE_ENGINE)
IF(WITH_FEDERATED_STORAGE_ENGINE)
ADD_DEPENDENCIES(mysqlserver federated)
ENDIF(WITH_FEDERATED_STORAGE_ENGINE)
IF(WITH_INNOBASE_STORAGE_ENGINE)
ADD_DEPENDENCIES(mysqlserver innobase)
ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
# Tried use the correct ${GEN_SOURCES} as dependency, worked on Unix
# but not on Windows and Visual Studio generators. Likely because they
# are no real targets from the Visual Studio project files view. Added
# custom targets to "sql/CMakeLists.txt" and reference them here.
ADD_LIBRARY(mysqlserver STATIC ${LIBMYSQLD_SOURCES})
ADD_DEPENDENCIES(mysqlserver GenServerSource GenError)
TARGET_LINK_LIBRARIES(mysqlserver)
ADD_LIBRARY(libmysqld MODULE cmake_dummy.c libmysqld.def)
TARGET_LINK_LIBRARIES(libmysqld wsock32)
ADD_DEPENDENCIES(libmysqld mysqlserver)
IF(WITH_ARCHIVE_STORAGE_ENGINE)
ADD_DEPENDENCIES(libmysqld archive)
ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
IF(WITH_BLACKHOLE_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(libmysqld blackhole)
ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE)
IF(WITH_CSV_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(libmysqld csv)
ENDIF(WITH_CSV_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(libmysqld mysqlserver wsock32)

View file

@ -15,24 +15,24 @@
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/libmysqld/include
${CMAKE_SOURCE_DIR}/libmysqld/release
${CMAKE_SOURCE_DIR}/regex
${CMAKE_SOURCE_DIR}/zlib
${CMAKE_SOURCE_DIR}/extra/yassl/include)
# Currently does not work with DBUG, there are missing symbols reported.
ADD_DEFINITIONS(-DDBUG_OFF)
ADD_DEFINITIONS(-DUSE_TLS)
IF(WIN32)
ADD_DEFINITIONS(-DUSE_TLS)
ENDIF(WIN32)
ADD_EXECUTABLE(mysql_embedded ../../client/completion_hash.cc
../../client/mysql.cc ../../client/readline.cc
../../client/sql_string.cc)
TARGET_LINK_LIBRARIES(mysql_embedded mysys yassl taocrypt zlib dbug regex strings wsock32)
TARGET_LINK_LIBRARIES(mysql_embedded mysys yassl taocrypt zlib debug dbug regex strings wsock32)
ADD_DEPENDENCIES(mysql_embedded libmysqld)
ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.c)
TARGET_LINK_LIBRARIES(mysqltest_embedded mysys yassl taocrypt zlib dbug regex strings wsock32)
TARGET_LINK_LIBRARIES(mysqltest_embedded mysys yassl taocrypt zlib debug dbug regex strings wsock32)
ADD_DEPENDENCIES(mysqltest_embedded libmysqld)
ADD_EXECUTABLE(mysql_client_test_embedded ../../tests/mysql_client_test.c)
TARGET_LINK_LIBRARIES(mysql_client_test_embedded dbug mysys yassl taocrypt zlib strings wsock32)
TARGET_LINK_LIBRARIES(mysql_client_test_embedded debug dbug mysys yassl taocrypt zlib strings wsock32)
ADD_DEPENDENCIES(mysql_client_test_embedded libmysqld)

View file

@ -567,7 +567,7 @@ void init_embedded_mysql(MYSQL *mysql, int client_flag)
void *create_embedded_thd(int client_flag)
{
THD * thd= new THD;
thd->thread_id= thread_id++;
thd->thread_id= thd->variables.pseudo_thread_id= thread_id++;
thd->thread_stack= (char*) &thd;
if (thd->store_globals())

View file

@ -3,5 +3,5 @@
#
--require r/have_bug25714.require
disable_query_log;
eval select LENGTH("MYSQL_BUG25714") > 0 as "have_bug25714_exe";
eval select LENGTH("$MYSQL_BUG25714") > 0 as "have_bug25714_exe";
enable_query_log;

View file

@ -4162,7 +4162,7 @@ sub stop_all_servers () {
my $pid;
# Start shutdown of all started masters
foreach my $mysqld (@{$master}, @{$slave})
foreach my $mysqld (@{$slave}, @{$master})
{
if ( $mysqld->{'pid'} )
{

View file

@ -41,8 +41,8 @@ BEGIN
INSERT INTO t4 VALUES (ins1, ins2, ind);
END
master-bin.000001 783 Query 1 999 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93))
master-bin.000001 999 Query 1 1085 use `test`; DROP PROCEDURE bug18293
master-bin.000001 1085 Query 1 1161 use `test`; DROP TABLE t4
master-bin.000001 999 Query 1 1088 use `test`; DROP PROCEDURE bug18293
master-bin.000001 1088 Query 1 1167 use `test`; DROP TABLE t4
End of 5.0 tests
SHOW BINLOG EVENTS FROM 364;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error

View file

@ -1,3 +1,4 @@
DROP TABLE IF EXISTS t1;
select format(1.5555,0),format(123.5555,1),format(1234.5555,2),format(12345.55555,3),format(123456.5555,4),format(1234567.5555,5),format("12345.2399",2);
format(1.5555,0) format(123.5555,1) format(1234.5555,2) format(12345.55555,3) format(123456.5555,4) format(1234567.5555,5) format("12345.2399",2)
2 123.6 1,234.56 12,345.556 123,456.5555 1,234,567.55550 12,345.24
@ -56,7 +57,6 @@ select a from t1 where mid(a+0,6,3) = ( mid(20040106123400,6,3) );
a
2004-01-06 12:34:00
drop table t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (conn CHAR(7), connection_id INT);
INSERT INTO t1 VALUES ('default', CONNECTION_ID());
SELECT GET_LOCK('bug16501',600);

View file

@ -1463,4 +1463,26 @@ where a.table_name='t1' and a.table_schema='test' and b.table_name=a.table_name;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE a ALL NULL TABLE_SCHEMA,TABLE_NAME NULL NULL NULL Using where; Skip_open_table; Scanned 0 databases
1 SIMPLE b ALL NULL NULL NULL NULL NULL Using where; Open_frm_only; Scanned all databases; Using join buffer
SELECT * FROM INFORMATION_SCHEMA.SCHEMATA
WHERE SCHEMA_NAME = 'mysqltest';
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
SELECT * FROM INFORMATION_SCHEMA.SCHEMATA
WHERE SCHEMA_NAME = '';
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
SELECT * FROM INFORMATION_SCHEMA.SCHEMATA
WHERE SCHEMA_NAME = 'test';
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
NULL test latin1 latin1_swedish_ci NULL
select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysql' AND TABLE_NAME='nonexisting';
count(*)
0
select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysql' AND TABLE_NAME='';
count(*)
0
select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='' AND TABLE_NAME='';
count(*)
0
select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='' AND TABLE_NAME='nonexisting';
count(*)
0
End of 5.1 tests.

View file

@ -16,13 +16,11 @@ unlock tables;
lock tables t1 read;
update t1 set n = 3;
unlock tables;
show status like 'Table_lock%';
show status like 'Table_locks_waited%';
Variable_name Value
Table_locks_immediate 17
Table_locks_waited 1
select * from information_schema.session_status where variable_name like 'Table_lock%';
select * from information_schema.session_status where variable_name like 'Table_locks_waited%';
VARIABLE_NAME VARIABLE_VALUE
TABLE_LOCKS_IMMEDIATE 18
TABLE_LOCKS_WAITED 1
drop table t1;
select 1;

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -90,7 +90,7 @@ INSERT INTO result VALUES (@cur_val_sql_mode, 'value not restored');
END if;
END//
SHOW CREATE PROCEDURE sp1;
Procedure sql_mode Create Procedure
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`()
BEGIN
declare a tinyint;
@ -104,7 +104,7 @@ INSERT INTO result VALUES (@cur_val_sql_mode, 'value restored');
ELSE
INSERT INTO result VALUES (@cur_val_sql_mode, 'value not restored');
END if;
END
END latin1 latin1_swedish_ci latin1_swedish_ci
set @@sql_mode='';
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
@ -143,12 +143,12 @@ SET @@sql_mode='MAXDB';
SHOW VARIABLES LIKE 'sql_mode';
END//
SHOW CREATE PROCEDURE sp2;
Procedure sql_mode Create Procedure
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`()
BEGIN
SET @@sql_mode='MAXDB';
SHOW VARIABLES LIKE 'sql_mode';
END
END latin1 latin1_swedish_ci latin1_swedish_ci
... show value prior calling procedure
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value

View file

@ -122,6 +122,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -146,6 +149,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT created with INVOKER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -168,6 +174,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -190,6 +199,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT created with INVOKER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
@ -199,6 +211,9 @@ set @x=i1;
set @y=@x;
return i4;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE FUNCTION fn_2;
Function fn_2
sql_mode
@ -210,6 +225,9 @@ set @x=i1;
set @y=@x;
return i4;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_1;
Procedure sp_1
sql_mode
@ -217,6 +235,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
BEGIN
set @x=i1;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_2;
Procedure sp_2
sql_mode
@ -226,6 +247,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
BEGIN
set @x=i1;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW FUNCTION STATUS LIKE 'fn_%';
Db db_storedproc
Name fn_1
@ -235,6 +259,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
Db db_storedproc
Name fn_2
Type FUNCTION
@ -243,6 +270,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment created with INVOKER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW PROCEDURE STATUS LIKE 'sp_%';
Db db_storedproc
Name sp_1
@ -252,6 +282,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
Db db_storedproc
Name sp_2
Type PROCEDURE
@ -260,6 +293,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment created with INVOKER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
... now change some stuff:
--------------------------
@ -304,6 +340,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, FN changed to INVOKER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -328,6 +367,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT FN changed to DEFINER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -350,6 +392,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, SP changed to INVOKER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -372,6 +417,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT SP changed to DEFINER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
@ -384,6 +432,9 @@ set @x=i1;
set @y=@x;
return i4;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE FUNCTION fn_2;
Function fn_2
sql_mode
@ -395,6 +446,9 @@ set @x=i1;
set @y=@x;
return i4;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_1;
Procedure sp_1
sql_mode
@ -404,6 +458,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
BEGIN
set @x=i1;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_2;
Procedure sp_2
sql_mode
@ -413,6 +470,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
BEGIN
set @x=i1;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW FUNCTION STATUS LIKE 'fn_%';
Db db_storedproc
Name fn_1
@ -422,6 +482,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, FN changed to INVOKER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
Db db_storedproc
Name fn_2
Type FUNCTION
@ -430,6 +493,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment FN changed to DEFINER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW PROCEDURE STATUS LIKE 'sp_%';
Db db_storedproc
Name sp_1
@ -439,6 +505,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, SP changed to INVOKER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
Db db_storedproc
Name sp_2
Type PROCEDURE
@ -447,6 +516,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment SP changed to DEFINER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
... change back to default and check result:
--------------------------------------------
@ -479,6 +551,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, FN changed to INVOKER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -503,6 +578,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT FN changed to DEFINER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -525,6 +603,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, SP changed to INVOKER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -547,6 +628,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT SP changed to DEFINER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
@ -559,6 +643,9 @@ set @x=i1;
set @y=@x;
return i4;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE FUNCTION fn_2;
Function fn_2
sql_mode
@ -569,6 +656,9 @@ set @x=i1;
set @y=@x;
return i4;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_1;
Procedure sp_1
sql_mode
@ -578,6 +668,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
BEGIN
set @x=i1;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_2;
Procedure sp_2
sql_mode
@ -587,6 +680,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
BEGIN
set @x=i1;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW FUNCTION STATUS LIKE 'fn_%';
Db db_storedproc
Name fn_1
@ -596,6 +692,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, FN changed to INVOKER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
Db db_storedproc
Name fn_2
Type FUNCTION
@ -604,6 +703,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment FN changed to DEFINER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW PROCEDURE STATUS LIKE 'sp_%';
Db db_storedproc
Name sp_1
@ -613,6 +715,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, SP changed to INVOKER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
Db db_storedproc
Name sp_2
Type PROCEDURE
@ -621,6 +726,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment SP changed to DEFINER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
... cleanup
-----------

View file

@ -263,7 +263,7 @@ select current_user;
current_user
root@localhost
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
grant select, insert, update on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
@ -296,7 +296,7 @@ select current_user;
current_user
root@localhost
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
show tables;
Tables_in_priv_db
t1
@ -317,7 +317,7 @@ select current_user;
current_user
test_yesprivs@localhost
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 1_2-yes';
select current_user;
@ -453,9 +453,9 @@ ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for tabl
create trigger trg1_4 before UPDATE on t1 for each row
set new.f1 = 'trig 1_4-yes';
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL test_yesprivs@localhost
trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL test_yesprivs@localhost
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
select current_user;
current_user
test_noprivs@localhost
@ -570,11 +570,11 @@ current_user
test_yesprivs@localhost
use priv_db;
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
trg1_1 INSERT t1 set new.f1 = 'trig 1_1-yes' BEFORE NULL test_yesprivs@localhost
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1_1 INSERT t1 set new.f1 = 'trig 1_1-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
select * from information_schema.triggers;
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER
NULL priv_db trg1_1 INSERT NULL priv_db t1 0 NULL set new.f1 = 'trig 1_1-yes' ROW BEFORE NULL NULL OLD NEW NULL test_yesprivs@localhost
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
NULL priv_db trg1_1 INSERT NULL priv_db t1 0 NULL set new.f1 = 'trig 1_1-yes' ROW BEFORE NULL NULL OLD NEW NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
drop trigger trg1_1;
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
select current_user;
@ -863,7 +863,7 @@ select current_user;
current_user
root@localhost
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
grant TRIGGER on priv1_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
@ -878,7 +878,7 @@ select current_user;
current_user
test_yesprivs@localhost
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 1_2-yes';
create trigger trg2_1 before INSERT on t2 for each row
@ -990,7 +990,7 @@ select current_user;
current_user
root@localhost
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
grant select, insert, update ,trigger
on priv_db.t1 to test_yesprivs@localhost
with grant option;

View file

@ -863,31 +863,31 @@ CREATE TABLE t1 (f1 BIGINT);
INSERT INTO t1 VALUES(1);
CREATE VIEW test.v1 AS SELECT * FROM t1 limit 2;
SHOW CREATE VIEW test.v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2 latin1 latin1_swedish_ci
SELECT * FROM test.v1;
f1
1
CREATE OR REPLACE ALGORITHM = TEMPTABLE VIEW test.v1
AS SELECT * FROM t1 limit 2;
SHOW CREATE VIEW test.v1;
View Create View
v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2 latin1 latin1_swedish_ci
SELECT * FROM test.v1;
f1
1
CREATE OR REPLACE VIEW test.v1 AS SELECT * FROM tb2 limit 2;
SHOW CREATE VIEW test.v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `f59`,`tb2`.`f60` AS `f60`,`tb2`.`f61` AS `f61`,`tb2`.`f62` AS `f62`,`tb2`.`f63` AS `f63`,`tb2`.`f64` AS `f64`,`tb2`.`f65` AS `f65`,`tb2`.`f66` AS `f66`,`tb2`.`f67` AS `f67`,`tb2`.`f68` AS `f68`,`tb2`.`f69` AS `f69`,`tb2`.`f70` AS `f70`,`tb2`.`f71` AS `f71`,`tb2`.`f72` AS `f72`,`tb2`.`f73` AS `f73`,`tb2`.`f74` AS `f74`,`tb2`.`f75` AS `f75`,`tb2`.`f76` AS `f76`,`tb2`.`f77` AS `f77`,`tb2`.`f78` AS `f78`,`tb2`.`f79` AS `f79`,`tb2`.`f80` AS `f80`,`tb2`.`f81` AS `f81`,`tb2`.`f82` AS `f82`,`tb2`.`f83` AS `f83`,`tb2`.`f84` AS `f84`,`tb2`.`f85` AS `f85`,`tb2`.`f86` AS `f86`,`tb2`.`f87` AS `f87`,`tb2`.`f88` AS `f88`,`tb2`.`f89` AS `f89`,`tb2`.`f90` AS `f90`,`tb2`.`f91` AS `f91`,`tb2`.`f92` AS `f92`,`tb2`.`f93` AS `f93`,`tb2`.`f94` AS `f94`,`tb2`.`f95` AS `f95`,`tb2`.`f96` AS `f96`,`tb2`.`f97` AS `f97`,`tb2`.`f98` AS `f98`,`tb2`.`f99` AS `f99`,`tb2`.`f100` AS `f100`,`tb2`.`f101` AS `f101`,`tb2`.`f102` AS `f102`,`tb2`.`f103` AS `f103`,`tb2`.`f104` AS `f104`,`tb2`.`f105` AS `f105`,`tb2`.`f106` AS `f106`,`tb2`.`f107` AS `f107`,`tb2`.`f108` AS `f108`,`tb2`.`f109` AS `f109` from `tb2` limit 2
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `f59`,`tb2`.`f60` AS `f60`,`tb2`.`f61` AS `f61`,`tb2`.`f62` AS `f62`,`tb2`.`f63` AS `f63`,`tb2`.`f64` AS `f64`,`tb2`.`f65` AS `f65`,`tb2`.`f66` AS `f66`,`tb2`.`f67` AS `f67`,`tb2`.`f68` AS `f68`,`tb2`.`f69` AS `f69`,`tb2`.`f70` AS `f70`,`tb2`.`f71` AS `f71`,`tb2`.`f72` AS `f72`,`tb2`.`f73` AS `f73`,`tb2`.`f74` AS `f74`,`tb2`.`f75` AS `f75`,`tb2`.`f76` AS `f76`,`tb2`.`f77` AS `f77`,`tb2`.`f78` AS `f78`,`tb2`.`f79` AS `f79`,`tb2`.`f80` AS `f80`,`tb2`.`f81` AS `f81`,`tb2`.`f82` AS `f82`,`tb2`.`f83` AS `f83`,`tb2`.`f84` AS `f84`,`tb2`.`f85` AS `f85`,`tb2`.`f86` AS `f86`,`tb2`.`f87` AS `f87`,`tb2`.`f88` AS `f88`,`tb2`.`f89` AS `f89`,`tb2`.`f90` AS `f90`,`tb2`.`f91` AS `f91`,`tb2`.`f92` AS `f92`,`tb2`.`f93` AS `f93`,`tb2`.`f94` AS `f94`,`tb2`.`f95` AS `f95`,`tb2`.`f96` AS `f96`,`tb2`.`f97` AS `f97`,`tb2`.`f98` AS `f98`,`tb2`.`f99` AS `f99`,`tb2`.`f100` AS `f100`,`tb2`.`f101` AS `f101`,`tb2`.`f102` AS `f102`,`tb2`.`f103` AS `f103`,`tb2`.`f104` AS `f104`,`tb2`.`f105` AS `f105`,`tb2`.`f106` AS `f106`,`tb2`.`f107` AS `f107`,`tb2`.`f108` AS `f108`,`tb2`.`f109` AS `f109` from `tb2` limit 2 latin1 latin1_swedish_ci
SELECT * FROM test.v1 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
CREATE OR REPLACE VIEW test.v1 AS SELECT F59 FROM tb2 limit 10,100;
SHOW CREATE VIEW test.v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `F59` from `tb2` limit 10,100
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `F59` from `tb2` limit 10,100 latin1 latin1_swedish_ci
SELECT * FROM test.v1;
F59
76710
@ -965,38 +965,38 @@ CREATE TABLE t1 (f1 NUMERIC(15,3));
INSERT INTO t1 VALUES(8.8);
CREATE VIEW v1 AS SELECT * FROM t1;
SHOW CREATE VIEW v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
f1
8.800
CREATE OR REPLACE VIEW v1 AS SELECT f1 FROM t1;
SHOW CREATE VIEW v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
f1
8.800
CREATE OR REPLACE VIEW v1 AS SELECT f1 As my_column FROM t1;
SHOW CREATE VIEW v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `my_column` from `t1`
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `my_column` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
my_column
8.800
CREATE OR REPLACE VIEW v1(column1,column2)
AS SELECT f1 As my_column, f1 FROM t1;
SHOW CREATE VIEW v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1`
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
column1 column2
8.800 8.800
CREATE OR REPLACE VIEW test.v1(column1,column2)
AS SELECT f1 As my_column, f1 FROM test.t1;
SHOW CREATE VIEW v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1`
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
column1 column2
8.800 8.800
@ -10250,8 +10250,8 @@ CREATE VIEW test3.v30 AS SELECT * FROM test3.v29;
CREATE VIEW test3.v31 AS SELECT * FROM test3.v30;
CREATE VIEW test3.v32 AS SELECT * FROM test3.v31;
SHOW CREATE VIEW test3.v32;
View Create View
v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31`
View Create View character_set_client collation_connection
v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31` latin1 latin1_swedish_ci
SELECT * FROM test3.v32;
f1
1.000
@ -10260,8 +10260,8 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 1
DROP VIEW test3.v0;
SHOW CREATE VIEW test3.v32;
View Create View
v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31`
View Create View character_set_client collation_connection
v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'test3.v32' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SELECT * FROM test3.v32;
@ -10389,8 +10389,8 @@ FROM test2.t1 tab1 NATURAL JOIN test1.v27 tab2;
CREATE OR REPLACE VIEW test1.v29 AS SELECT f1, f2
FROM test3.t1 tab1 NATURAL JOIN test1.v28 tab2;
SHOW CREATE VIEW test1.v29;
View Create View
v29 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v29` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v28` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`))))
View Create View character_set_client collation_connection
v29 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v29` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v28` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`)))) latin1 latin1_swedish_ci
SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
CAST(f2 AS CHAR) AS f2 FROM test1.v29;
f1 f2
@ -10405,8 +10405,8 @@ CAST(f2 AS CHAR) AS f2 FROM test1.v29;
CREATE VIEW test1.v30 AS SELECT f1, f2
FROM test3.t1 tab1 NATURAL JOIN test1.v29 tab2;
SHOW CREATE VIEW test1.v30;
View Create View
v30 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v30` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v29` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`))))
View Create View character_set_client collation_connection
v30 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v30` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v29` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`)))) latin1 latin1_swedish_ci
SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
CAST(f2 AS CHAR) AS f2 FROM test1.v30;
f1 f2

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -90,7 +90,7 @@ INSERT INTO result VALUES (@cur_val_sql_mode, 'value not restored');
END if;
END//
SHOW CREATE PROCEDURE sp1;
Procedure sql_mode Create Procedure
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`()
BEGIN
declare a tinyint;
@ -104,7 +104,7 @@ INSERT INTO result VALUES (@cur_val_sql_mode, 'value restored');
ELSE
INSERT INTO result VALUES (@cur_val_sql_mode, 'value not restored');
END if;
END
END latin1 latin1_swedish_ci latin1_swedish_ci
set @@sql_mode='';
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
@ -143,12 +143,12 @@ SET @@sql_mode='MAXDB';
SHOW VARIABLES LIKE 'sql_mode';
END//
SHOW CREATE PROCEDURE sp2;
Procedure sql_mode Create Procedure
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`()
BEGIN
SET @@sql_mode='MAXDB';
SHOW VARIABLES LIKE 'sql_mode';
END
END latin1 latin1_swedish_ci latin1_swedish_ci
... show value prior calling procedure
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value

View file

@ -122,6 +122,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -146,6 +149,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT created with INVOKER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -168,6 +174,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -190,6 +199,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT created with INVOKER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
@ -199,6 +211,9 @@ set @x=i1;
set @y=@x;
return i4;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE FUNCTION fn_2;
Function fn_2
sql_mode
@ -210,6 +225,9 @@ set @x=i1;
set @y=@x;
return i4;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_1;
Procedure sp_1
sql_mode
@ -217,6 +235,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
BEGIN
set @x=i1;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_2;
Procedure sp_2
sql_mode
@ -226,6 +247,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
BEGIN
set @x=i1;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW FUNCTION STATUS LIKE 'fn_%';
Db db_storedproc
Name fn_1
@ -235,6 +259,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
Db db_storedproc
Name fn_2
Type FUNCTION
@ -243,6 +270,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment created with INVOKER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW PROCEDURE STATUS LIKE 'sp_%';
Db db_storedproc
Name sp_1
@ -252,6 +282,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
Db db_storedproc
Name sp_2
Type PROCEDURE
@ -260,6 +293,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment created with INVOKER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
... now change some stuff:
--------------------------
@ -304,6 +340,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, FN changed to INVOKER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -328,6 +367,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT FN changed to DEFINER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -350,6 +392,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, SP changed to INVOKER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -372,6 +417,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT SP changed to DEFINER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
@ -384,6 +432,9 @@ set @x=i1;
set @y=@x;
return i4;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE FUNCTION fn_2;
Function fn_2
sql_mode
@ -395,6 +446,9 @@ set @x=i1;
set @y=@x;
return i4;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_1;
Procedure sp_1
sql_mode
@ -404,6 +458,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
BEGIN
set @x=i1;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_2;
Procedure sp_2
sql_mode
@ -413,6 +470,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
BEGIN
set @x=i1;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW FUNCTION STATUS LIKE 'fn_%';
Db db_storedproc
Name fn_1
@ -422,6 +482,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, FN changed to INVOKER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
Db db_storedproc
Name fn_2
Type FUNCTION
@ -430,6 +493,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment FN changed to DEFINER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW PROCEDURE STATUS LIKE 'sp_%';
Db db_storedproc
Name sp_1
@ -439,6 +505,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, SP changed to INVOKER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
Db db_storedproc
Name sp_2
Type PROCEDURE
@ -447,6 +516,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment SP changed to DEFINER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
... change back to default and check result:
--------------------------------------------
@ -479,6 +551,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, FN changed to INVOKER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -503,6 +578,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT FN changed to DEFINER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -525,6 +603,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, SP changed to INVOKER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -547,6 +628,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT SP changed to DEFINER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
@ -559,6 +643,9 @@ set @x=i1;
set @y=@x;
return i4;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE FUNCTION fn_2;
Function fn_2
sql_mode
@ -569,6 +656,9 @@ set @x=i1;
set @y=@x;
return i4;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_1;
Procedure sp_1
sql_mode
@ -578,6 +668,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
BEGIN
set @x=i1;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_2;
Procedure sp_2
sql_mode
@ -587,6 +680,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
BEGIN
set @x=i1;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW FUNCTION STATUS LIKE 'fn_%';
Db db_storedproc
Name fn_1
@ -596,6 +692,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, FN changed to INVOKER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
Db db_storedproc
Name fn_2
Type FUNCTION
@ -604,6 +703,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment FN changed to DEFINER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW PROCEDURE STATUS LIKE 'sp_%';
Db db_storedproc
Name sp_1
@ -613,6 +715,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, SP changed to INVOKER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
Db db_storedproc
Name sp_2
Type PROCEDURE
@ -621,6 +726,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment SP changed to DEFINER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
... cleanup
-----------

View file

@ -263,7 +263,7 @@ select current_user;
current_user
root@localhost
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
grant select, insert, update on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
@ -296,7 +296,7 @@ select current_user;
current_user
root@localhost
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
show tables;
Tables_in_priv_db
t1
@ -317,7 +317,7 @@ select current_user;
current_user
test_yesprivs@localhost
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 1_2-yes';
select current_user;
@ -453,9 +453,9 @@ ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for tabl
create trigger trg1_4 before UPDATE on t1 for each row
set new.f1 = 'trig 1_4-yes';
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL test_yesprivs@localhost
trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL test_yesprivs@localhost
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
select current_user;
current_user
test_noprivs@localhost
@ -570,11 +570,11 @@ current_user
test_yesprivs@localhost
use priv_db;
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
trg1_1 INSERT t1 set new.f1 = 'trig 1_1-yes' BEFORE NULL test_yesprivs@localhost
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1_1 INSERT t1 set new.f1 = 'trig 1_1-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
select * from information_schema.triggers;
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER
NULL priv_db trg1_1 INSERT NULL priv_db t1 0 NULL set new.f1 = 'trig 1_1-yes' ROW BEFORE NULL NULL OLD NEW NULL test_yesprivs@localhost
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
NULL priv_db trg1_1 INSERT NULL priv_db t1 0 NULL set new.f1 = 'trig 1_1-yes' ROW BEFORE NULL NULL OLD NEW NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
drop trigger trg1_1;
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
select current_user;
@ -863,7 +863,7 @@ select current_user;
current_user
root@localhost
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
grant TRIGGER on priv1_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
@ -878,7 +878,7 @@ select current_user;
current_user
test_yesprivs@localhost
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 1_2-yes';
create trigger trg2_1 before INSERT on t2 for each row
@ -990,7 +990,7 @@ select current_user;
current_user
root@localhost
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
grant select, insert, update ,trigger
on priv_db.t1 to test_yesprivs@localhost
with grant option;

View file

@ -867,31 +867,31 @@ CREATE TABLE t1 (f1 BIGINT);
INSERT INTO t1 VALUES(1);
CREATE VIEW test.v1 AS SELECT * FROM t1 limit 2;
SHOW CREATE VIEW test.v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2 latin1 latin1_swedish_ci
SELECT * FROM test.v1;
f1
1
CREATE OR REPLACE ALGORITHM = TEMPTABLE VIEW test.v1
AS SELECT * FROM t1 limit 2;
SHOW CREATE VIEW test.v1;
View Create View
v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2 latin1 latin1_swedish_ci
SELECT * FROM test.v1;
f1
1
CREATE OR REPLACE VIEW test.v1 AS SELECT * FROM tb2 limit 2;
SHOW CREATE VIEW test.v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `f59`,`tb2`.`f60` AS `f60`,`tb2`.`f61` AS `f61`,`tb2`.`f62` AS `f62`,`tb2`.`f63` AS `f63`,`tb2`.`f64` AS `f64`,`tb2`.`f65` AS `f65`,`tb2`.`f66` AS `f66`,`tb2`.`f67` AS `f67`,`tb2`.`f68` AS `f68`,`tb2`.`f69` AS `f69`,`tb2`.`f70` AS `f70`,`tb2`.`f71` AS `f71`,`tb2`.`f72` AS `f72`,`tb2`.`f73` AS `f73`,`tb2`.`f74` AS `f74`,`tb2`.`f75` AS `f75`,`tb2`.`f76` AS `f76`,`tb2`.`f77` AS `f77`,`tb2`.`f78` AS `f78`,`tb2`.`f79` AS `f79`,`tb2`.`f80` AS `f80`,`tb2`.`f81` AS `f81`,`tb2`.`f82` AS `f82`,`tb2`.`f83` AS `f83`,`tb2`.`f84` AS `f84`,`tb2`.`f85` AS `f85`,`tb2`.`f86` AS `f86`,`tb2`.`f87` AS `f87`,`tb2`.`f88` AS `f88`,`tb2`.`f89` AS `f89`,`tb2`.`f90` AS `f90`,`tb2`.`f91` AS `f91`,`tb2`.`f92` AS `f92`,`tb2`.`f93` AS `f93`,`tb2`.`f94` AS `f94`,`tb2`.`f95` AS `f95`,`tb2`.`f96` AS `f96`,`tb2`.`f97` AS `f97`,`tb2`.`f98` AS `f98`,`tb2`.`f99` AS `f99`,`tb2`.`f100` AS `f100`,`tb2`.`f101` AS `f101`,`tb2`.`f102` AS `f102`,`tb2`.`f103` AS `f103`,`tb2`.`f104` AS `f104`,`tb2`.`f105` AS `f105`,`tb2`.`f106` AS `f106`,`tb2`.`f107` AS `f107`,`tb2`.`f108` AS `f108`,`tb2`.`f109` AS `f109` from `tb2` limit 2
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `f59`,`tb2`.`f60` AS `f60`,`tb2`.`f61` AS `f61`,`tb2`.`f62` AS `f62`,`tb2`.`f63` AS `f63`,`tb2`.`f64` AS `f64`,`tb2`.`f65` AS `f65`,`tb2`.`f66` AS `f66`,`tb2`.`f67` AS `f67`,`tb2`.`f68` AS `f68`,`tb2`.`f69` AS `f69`,`tb2`.`f70` AS `f70`,`tb2`.`f71` AS `f71`,`tb2`.`f72` AS `f72`,`tb2`.`f73` AS `f73`,`tb2`.`f74` AS `f74`,`tb2`.`f75` AS `f75`,`tb2`.`f76` AS `f76`,`tb2`.`f77` AS `f77`,`tb2`.`f78` AS `f78`,`tb2`.`f79` AS `f79`,`tb2`.`f80` AS `f80`,`tb2`.`f81` AS `f81`,`tb2`.`f82` AS `f82`,`tb2`.`f83` AS `f83`,`tb2`.`f84` AS `f84`,`tb2`.`f85` AS `f85`,`tb2`.`f86` AS `f86`,`tb2`.`f87` AS `f87`,`tb2`.`f88` AS `f88`,`tb2`.`f89` AS `f89`,`tb2`.`f90` AS `f90`,`tb2`.`f91` AS `f91`,`tb2`.`f92` AS `f92`,`tb2`.`f93` AS `f93`,`tb2`.`f94` AS `f94`,`tb2`.`f95` AS `f95`,`tb2`.`f96` AS `f96`,`tb2`.`f97` AS `f97`,`tb2`.`f98` AS `f98`,`tb2`.`f99` AS `f99`,`tb2`.`f100` AS `f100`,`tb2`.`f101` AS `f101`,`tb2`.`f102` AS `f102`,`tb2`.`f103` AS `f103`,`tb2`.`f104` AS `f104`,`tb2`.`f105` AS `f105`,`tb2`.`f106` AS `f106`,`tb2`.`f107` AS `f107`,`tb2`.`f108` AS `f108`,`tb2`.`f109` AS `f109` from `tb2` limit 2 latin1 latin1_swedish_ci
SELECT * FROM test.v1 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set
2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set
CREATE OR REPLACE VIEW test.v1 AS SELECT F59 FROM tb2 limit 10,100;
SHOW CREATE VIEW test.v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `F59` from `tb2` limit 10,100
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `F59` from `tb2` limit 10,100 latin1 latin1_swedish_ci
SELECT * FROM test.v1;
F59
76710
@ -969,38 +969,38 @@ CREATE TABLE t1 (f1 NUMERIC(15,3));
INSERT INTO t1 VALUES(8.8);
CREATE VIEW v1 AS SELECT * FROM t1;
SHOW CREATE VIEW v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
f1
8.800
CREATE OR REPLACE VIEW v1 AS SELECT f1 FROM t1;
SHOW CREATE VIEW v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
f1
8.800
CREATE OR REPLACE VIEW v1 AS SELECT f1 As my_column FROM t1;
SHOW CREATE VIEW v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `my_column` from `t1`
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `my_column` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
my_column
8.800
CREATE OR REPLACE VIEW v1(column1,column2)
AS SELECT f1 As my_column, f1 FROM t1;
SHOW CREATE VIEW v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1`
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
column1 column2
8.800 8.800
CREATE OR REPLACE VIEW test.v1(column1,column2)
AS SELECT f1 As my_column, f1 FROM test.t1;
SHOW CREATE VIEW v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1`
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
column1 column2
8.800 8.800
@ -10255,8 +10255,8 @@ CREATE VIEW test3.v30 AS SELECT * FROM test3.v29;
CREATE VIEW test3.v31 AS SELECT * FROM test3.v30;
CREATE VIEW test3.v32 AS SELECT * FROM test3.v31;
SHOW CREATE VIEW test3.v32;
View Create View
v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31`
View Create View character_set_client collation_connection
v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31` latin1 latin1_swedish_ci
SELECT * FROM test3.v32;
f1
1.000
@ -10265,8 +10265,8 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1
DROP VIEW test3.v0;
SHOW CREATE VIEW test3.v32;
View Create View
v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31`
View Create View character_set_client collation_connection
v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'test3.v32' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SELECT * FROM test3.v32;
@ -10394,8 +10394,8 @@ FROM test2.t1 tab1 NATURAL JOIN test1.v27 tab2;
CREATE OR REPLACE VIEW test1.v29 AS SELECT f1, f2
FROM test3.t1 tab1 NATURAL JOIN test1.v28 tab2;
SHOW CREATE VIEW test1.v29;
View Create View
v29 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v29` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v28` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`))))
View Create View character_set_client collation_connection
v29 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v29` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v28` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`)))) latin1 latin1_swedish_ci
SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
CAST(f2 AS CHAR) AS f2 FROM test1.v29;
f1 f2
@ -10410,8 +10410,8 @@ CAST(f2 AS CHAR) AS f2 FROM test1.v29;
CREATE VIEW test1.v30 AS SELECT f1, f2
FROM test3.t1 tab1 NATURAL JOIN test1.v29 tab2;
SHOW CREATE VIEW test1.v30;
View Create View
v30 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v30` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v29` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`))))
View Create View character_set_client collation_connection
v30 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v30` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v29` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`)))) latin1 latin1_swedish_ci
SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
CAST(f2 AS CHAR) AS f2 FROM test1.v30;
f1 f2

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -90,7 +90,7 @@ INSERT INTO result VALUES (@cur_val_sql_mode, 'value not restored');
END if;
END//
SHOW CREATE PROCEDURE sp1;
Procedure sql_mode Create Procedure
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`()
BEGIN
declare a tinyint;
@ -104,7 +104,7 @@ INSERT INTO result VALUES (@cur_val_sql_mode, 'value restored');
ELSE
INSERT INTO result VALUES (@cur_val_sql_mode, 'value not restored');
END if;
END
END latin1 latin1_swedish_ci latin1_swedish_ci
set @@sql_mode='';
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value
@ -143,12 +143,12 @@ SET @@sql_mode='MAXDB';
SHOW VARIABLES LIKE 'sql_mode';
END//
SHOW CREATE PROCEDURE sp2;
Procedure sql_mode Create Procedure
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`()
BEGIN
SET @@sql_mode='MAXDB';
SHOW VARIABLES LIKE 'sql_mode';
END
END latin1 latin1_swedish_ci latin1_swedish_ci
... show value prior calling procedure
SHOW VARIABLES LIKE 'sql_mode';
Variable_name Value

View file

@ -122,6 +122,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -146,6 +149,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT created with INVOKER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -168,6 +174,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -190,6 +199,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT created with INVOKER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
@ -199,6 +211,9 @@ set @x=i1;
set @y=@x;
return i4;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE FUNCTION fn_2;
Function fn_2
sql_mode
@ -210,6 +225,9 @@ set @x=i1;
set @y=@x;
return i4;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_1;
Procedure sp_1
sql_mode
@ -217,6 +235,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
BEGIN
set @x=i1;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_2;
Procedure sp_2
sql_mode
@ -226,6 +247,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
BEGIN
set @x=i1;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW FUNCTION STATUS LIKE 'fn_%';
Db db_storedproc
Name fn_1
@ -235,6 +259,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
Db db_storedproc
Name fn_2
Type FUNCTION
@ -243,6 +270,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment created with INVOKER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW PROCEDURE STATUS LIKE 'sp_%';
Db db_storedproc
Name sp_1
@ -252,6 +282,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
Db db_storedproc
Name sp_2
Type PROCEDURE
@ -260,6 +293,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment created with INVOKER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
... now change some stuff:
--------------------------
@ -304,6 +340,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, FN changed to INVOKER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -328,6 +367,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT FN changed to DEFINER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -350,6 +392,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, SP changed to INVOKER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -372,6 +417,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT SP changed to DEFINER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
@ -384,6 +432,9 @@ set @x=i1;
set @y=@x;
return i4;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE FUNCTION fn_2;
Function fn_2
sql_mode
@ -395,6 +446,9 @@ set @x=i1;
set @y=@x;
return i4;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_1;
Procedure sp_1
sql_mode
@ -404,6 +458,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
BEGIN
set @x=i1;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_2;
Procedure sp_2
sql_mode
@ -413,6 +470,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
BEGIN
set @x=i1;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW FUNCTION STATUS LIKE 'fn_%';
Db db_storedproc
Name fn_1
@ -422,6 +482,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, FN changed to INVOKER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
Db db_storedproc
Name fn_2
Type FUNCTION
@ -430,6 +493,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment FN changed to DEFINER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW PROCEDURE STATUS LIKE 'sp_%';
Db db_storedproc
Name sp_1
@ -439,6 +505,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, SP changed to INVOKER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
Db db_storedproc
Name sp_2
Type PROCEDURE
@ -447,6 +516,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment SP changed to DEFINER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
... change back to default and check result:
--------------------------------------------
@ -479,6 +551,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, FN changed to INVOKER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME fn_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -503,6 +578,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT FN changed to DEFINER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_1
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -525,6 +603,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT new comment, SP changed to INVOKER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SPECIFIC_NAME sp_2
ROUTINE_CATALOG NULL
ROUTINE_SCHEMA db_storedproc
@ -547,6 +628,9 @@ LAST_ALTERED <created>
SQL_MODE
ROUTINE_COMMENT SP changed to DEFINER
DEFINER root@localhost
CHARACTER_SET_CLIENT latin1
COLLATION_CONNECTION latin1_swedish_ci
DATABASE_COLLATION latin1_swedish_ci
SHOW CREATE FUNCTION fn_1;
Function fn_1
sql_mode
@ -559,6 +643,9 @@ set @x=i1;
set @y=@x;
return i4;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE FUNCTION fn_2;
Function fn_2
sql_mode
@ -569,6 +656,9 @@ set @x=i1;
set @y=@x;
return i4;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_1;
Procedure sp_1
sql_mode
@ -578,6 +668,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_1`(i1 int)
BEGIN
set @x=i1;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW CREATE PROCEDURE sp_2;
Procedure sp_2
sql_mode
@ -587,6 +680,9 @@ Create Procedure CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_2`(i1 int)
BEGIN
set @x=i1;
END
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW FUNCTION STATUS LIKE 'fn_%';
Db db_storedproc
Name fn_1
@ -596,6 +692,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, FN changed to INVOKER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
Db db_storedproc
Name fn_2
Type FUNCTION
@ -604,6 +703,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment FN changed to DEFINER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
SHOW PROCEDURE STATUS LIKE 'sp_%';
Db db_storedproc
Name sp_1
@ -613,6 +715,9 @@ Modified <modified>
Created <created>
Security_type INVOKER
Comment new comment, SP changed to INVOKER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
Db db_storedproc
Name sp_2
Type PROCEDURE
@ -621,6 +726,9 @@ Modified <modified>
Created <created>
Security_type DEFINER
Comment SP changed to DEFINER
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
... cleanup
-----------

View file

@ -263,7 +263,7 @@ select current_user;
current_user
root@localhost
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
grant select, insert, update on priv_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
@ -296,7 +296,7 @@ select current_user;
current_user
root@localhost
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
show tables;
Tables_in_priv_db
t1
@ -317,7 +317,7 @@ select current_user;
current_user
test_yesprivs@localhost
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 1_2-yes';
select current_user;
@ -453,9 +453,9 @@ ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for tabl
create trigger trg1_4 before UPDATE on t1 for each row
set new.f1 = 'trig 1_4-yes';
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL test_yesprivs@localhost
trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL test_yesprivs@localhost
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
select current_user;
current_user
test_noprivs@localhost
@ -570,11 +570,11 @@ current_user
test_yesprivs@localhost
use priv_db;
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
trg1_1 INSERT t1 set new.f1 = 'trig 1_1-yes' BEFORE NULL test_yesprivs@localhost
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1_1 INSERT t1 set new.f1 = 'trig 1_1-yes' BEFORE NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
select * from information_schema.triggers;
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER
NULL priv_db trg1_1 INSERT NULL priv_db t1 0 NULL set new.f1 = 'trig 1_1-yes' ROW BEFORE NULL NULL OLD NEW NULL test_yesprivs@localhost
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
NULL priv_db trg1_1 INSERT NULL priv_db t1 0 NULL set new.f1 = 'trig 1_1-yes' ROW BEFORE NULL NULL OLD NEW NULL test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
drop trigger trg1_1;
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
select current_user;
@ -863,7 +863,7 @@ select current_user;
current_user
root@localhost
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
grant TRIGGER on priv1_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
@ -878,7 +878,7 @@ select current_user;
current_user
test_yesprivs@localhost
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 1_2-yes';
create trigger trg2_1 before INSERT on t2 for each row
@ -990,7 +990,7 @@ select current_user;
current_user
root@localhost
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
grant select, insert, update ,trigger
on priv_db.t1 to test_yesprivs@localhost
with grant option;

View file

@ -885,31 +885,31 @@ CREATE TABLE t1 (f1 BIGINT);
INSERT INTO t1 VALUES(1);
CREATE VIEW test.v1 AS SELECT * FROM t1 limit 2;
SHOW CREATE VIEW test.v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2 latin1 latin1_swedish_ci
SELECT * FROM test.v1;
f1
1
CREATE OR REPLACE ALGORITHM = TEMPTABLE VIEW test.v1
AS SELECT * FROM t1 limit 2;
SHOW CREATE VIEW test.v1;
View Create View
v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` limit 2 latin1 latin1_swedish_ci
SELECT * FROM test.v1;
f1
1
CREATE OR REPLACE VIEW test.v1 AS SELECT * FROM tb2 limit 2;
SHOW CREATE VIEW test.v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `f59`,`tb2`.`f60` AS `f60`,`tb2`.`f61` AS `f61`,`tb2`.`f62` AS `f62`,`tb2`.`f63` AS `f63`,`tb2`.`f64` AS `f64`,`tb2`.`f65` AS `f65`,`tb2`.`f66` AS `f66`,`tb2`.`f67` AS `f67`,`tb2`.`f68` AS `f68`,`tb2`.`f69` AS `f69`,`tb2`.`f70` AS `f70`,`tb2`.`f71` AS `f71`,`tb2`.`f72` AS `f72`,`tb2`.`f73` AS `f73`,`tb2`.`f74` AS `f74`,`tb2`.`f75` AS `f75`,`tb2`.`f76` AS `f76`,`tb2`.`f77` AS `f77`,`tb2`.`f78` AS `f78`,`tb2`.`f79` AS `f79`,`tb2`.`f80` AS `f80`,`tb2`.`f81` AS `f81`,`tb2`.`f82` AS `f82`,`tb2`.`f83` AS `f83`,`tb2`.`f84` AS `f84`,`tb2`.`f85` AS `f85`,`tb2`.`f86` AS `f86`,`tb2`.`f87` AS `f87`,`tb2`.`f88` AS `f88`,`tb2`.`f89` AS `f89`,`tb2`.`f90` AS `f90`,`tb2`.`f91` AS `f91`,`tb2`.`f92` AS `f92`,`tb2`.`f93` AS `f93`,`tb2`.`f94` AS `f94`,`tb2`.`f95` AS `f95`,`tb2`.`f96` AS `f96`,`tb2`.`f97` AS `f97`,`tb2`.`f98` AS `f98`,`tb2`.`f99` AS `f99`,`tb2`.`f100` AS `f100`,`tb2`.`f101` AS `f101`,`tb2`.`f102` AS `f102`,`tb2`.`f103` AS `f103`,`tb2`.`f104` AS `f104`,`tb2`.`f105` AS `f105`,`tb2`.`f106` AS `f106`,`tb2`.`f107` AS `f107`,`tb2`.`f108` AS `f108`,`tb2`.`f109` AS `f109`,`tb2`.`f110` AS `f110`,`tb2`.`f111` AS `f111`,`tb2`.`f112` AS `f112`,`tb2`.`f113` AS `f113`,`tb2`.`f114` AS `f114`,`tb2`.`f115` AS `f115`,`tb2`.`f116` AS `f116`,`tb2`.`f117` AS `f117` from `tb2` limit 2
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `f59`,`tb2`.`f60` AS `f60`,`tb2`.`f61` AS `f61`,`tb2`.`f62` AS `f62`,`tb2`.`f63` AS `f63`,`tb2`.`f64` AS `f64`,`tb2`.`f65` AS `f65`,`tb2`.`f66` AS `f66`,`tb2`.`f67` AS `f67`,`tb2`.`f68` AS `f68`,`tb2`.`f69` AS `f69`,`tb2`.`f70` AS `f70`,`tb2`.`f71` AS `f71`,`tb2`.`f72` AS `f72`,`tb2`.`f73` AS `f73`,`tb2`.`f74` AS `f74`,`tb2`.`f75` AS `f75`,`tb2`.`f76` AS `f76`,`tb2`.`f77` AS `f77`,`tb2`.`f78` AS `f78`,`tb2`.`f79` AS `f79`,`tb2`.`f80` AS `f80`,`tb2`.`f81` AS `f81`,`tb2`.`f82` AS `f82`,`tb2`.`f83` AS `f83`,`tb2`.`f84` AS `f84`,`tb2`.`f85` AS `f85`,`tb2`.`f86` AS `f86`,`tb2`.`f87` AS `f87`,`tb2`.`f88` AS `f88`,`tb2`.`f89` AS `f89`,`tb2`.`f90` AS `f90`,`tb2`.`f91` AS `f91`,`tb2`.`f92` AS `f92`,`tb2`.`f93` AS `f93`,`tb2`.`f94` AS `f94`,`tb2`.`f95` AS `f95`,`tb2`.`f96` AS `f96`,`tb2`.`f97` AS `f97`,`tb2`.`f98` AS `f98`,`tb2`.`f99` AS `f99`,`tb2`.`f100` AS `f100`,`tb2`.`f101` AS `f101`,`tb2`.`f102` AS `f102`,`tb2`.`f103` AS `f103`,`tb2`.`f104` AS `f104`,`tb2`.`f105` AS `f105`,`tb2`.`f106` AS `f106`,`tb2`.`f107` AS `f107`,`tb2`.`f108` AS `f108`,`tb2`.`f109` AS `f109`,`tb2`.`f110` AS `f110`,`tb2`.`f111` AS `f111`,`tb2`.`f112` AS `f112`,`tb2`.`f113` AS `f113`,`tb2`.`f114` AS `f114`,`tb2`.`f115` AS `f115`,`tb2`.`f116` AS `f116`,`tb2`.`f117` AS `f117` from `tb2` limit 2 latin1 latin1_swedish_ci
SELECT * FROM test.v1 ;
f59 f60 f61 f62 f63 f64 f65 f66 f67 f68 f69 f70 f71 f72 f73 f74 f75 f76 f77 f78 f79 f80 f81 f82 f83 f84 f85 f86 f87 f88 f89 f90 f91 f92 f93 f94 f95 f96 f97 f98 f99 f100 f101 f102 f103 f104 f105 f106 f107 f108 f109 f110 f111 f112 f113 f114 f115 f116 f117
1 1 0000000001 0000000000000000000000000000000000000000000000000000000000000001 0000000001 0000000000000000000000000000000000000000000000000000000000000001 -5 0.000000000000000000000000000000 1 0.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 0000000001 000000000000000000000000000000000.000000000000000000000000000000 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549435e-38 1.175494352e-38 00000001.175494352e-38 00000001.175494352e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549435e-38 1.17549e-38 1.175494352e-38 01.17549e-38 00000001.175494352e-38 01.17549e-38 00000001.175494352e-38 1000-01-01 838:59:58 1970-01-02 00:00:01 1970-01-02 00:00:01 1902 1902 1902 2enum 2set <00><00>@@ $@$@ <00><00>@@ $@$@$@$@@@@@@@@@@@ $@$@$@$@@@@@@@@@@@  <00><00>@@ $@$@$@$@@@@@@@@@@@
2 2 0000000002 0000000000000000000000000000000000000000000000000000000000000002 0000000002 0000000000000000000000000000000000000000000000000000000000000002 -4 1.100000000000000000000000000000 2 1.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 0000000002 000000000000000000000000000000001.100000000000000000000000000000 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.175494349e-38 1.175494353e-38 00000001.175494353e-38 00000001.175494353e-38 -1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.17549e-38 1.17549e-38 1.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 01.17549e-38 -1.17549e-38 -1.175494349e-38 1.17549e-38 1.175494353e-38 01.17549e-38 00000001.175494353e-38 01.17549e-38 00000001.175494353e-38 1000-01-02 838:59:57 1970-01-03 00:00:02 1970-01-03 00:00:02 1903 1903 1903 1enum 1set,2set <00><00>@@@@ 4@4@ <00><00>@@@@ <00><00>4@<00>4@4@<00>4@<00><00>@@ @@ @ @@ @@@ <00><00>4@<00>4@4@<00>4@<00><00>@@ @@ @ @@ @@@ <00><00> <00><00>@@@@ <00><00>4@<00>4@4@<00>4@<00><00>@@ @@ @ @@ @@@
CREATE OR REPLACE VIEW test.v1 AS SELECT F59 FROM tb2 limit 10,100;
SHOW CREATE VIEW test.v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `F59` from `tb2` limit 10,100
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `tb2`.`f59` AS `F59` from `tb2` limit 10,100 latin1 latin1_swedish_ci
SELECT * FROM test.v1;
F59
76710
@ -987,38 +987,38 @@ CREATE TABLE t1 (f1 NUMERIC(15,3));
INSERT INTO t1 VALUES(8.8);
CREATE VIEW v1 AS SELECT * FROM t1;
SHOW CREATE VIEW v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
f1
8.800
CREATE OR REPLACE VIEW v1 AS SELECT f1 FROM t1;
SHOW CREATE VIEW v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1`
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
f1
8.800
CREATE OR REPLACE VIEW v1 AS SELECT f1 As my_column FROM t1;
SHOW CREATE VIEW v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `my_column` from `t1`
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `my_column` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
my_column
8.800
CREATE OR REPLACE VIEW v1(column1,column2)
AS SELECT f1 As my_column, f1 FROM t1;
SHOW CREATE VIEW v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1`
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
column1 column2
8.800 8.800
CREATE OR REPLACE VIEW test.v1(column1,column2)
AS SELECT f1 As my_column, f1 FROM test.t1;
SHOW CREATE VIEW v1;
View Create View
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1`
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `column1`,`t1`.`f1` AS `column2` from `t1` latin1 latin1_swedish_ci
SELECT * FROM v1;
column1 column2
8.800 8.800
@ -1948,7 +1948,7 @@ f1 f2
2 two
4 four
INSERT INTO v1 VALUES(2,'two');
ERROR 23000: Duplicate entry '2' for key 1
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
INSERT INTO v1 VALUES(3,'three');
affected rows: 1
INSERT INTO v1 VALUES(6,'six');
@ -1967,7 +1967,7 @@ f1 f2
3 three
4 four
UPDATE v1 SET f1 = 2 WHERE f1 = 3;
ERROR 23000: Duplicate entry '2' for key 1
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
UPDATE v1 SET f2 = 'number' WHERE f1 = 3;
affected rows: 1
info: Rows matched: 1 Changed: 1 Warnings: 0
@ -2014,12 +2014,12 @@ DROP VIEW IF EXISTS test.v1;
CREATE TABLE t1 (f1 ENUM('A', 'B', 'C') NOT NULL, f2 INTEGER)
ENGINE = myisam;
INSERT INTO t1 VALUES ('A', 1);
SELECT * FROM t1;
SELECT * FROM t1 order by f1, f2;
f1 f2
A 1
CREATE VIEW v1 AS SELECT * FROM t1 WHERE f2 BETWEEN 1 AND 2
WITH CASCADED CHECK OPTION ;
SELECT * FROM v1;
SELECT * FROM v1 order by f1, f2;
f1 f2
A 1
UPDATE v1 SET f2 = 2 WHERE f2 = 1;
@ -2027,7 +2027,7 @@ affected rows: 1
info: Rows matched: 1 Changed: 1 Warnings: 0
INSERT INTO v1 VALUES('B',2);
affected rows: 1
SELECT * FROM v1;
SELECT * FROM v1 order by f1, f2;
f1 f2
A 2
B 2
@ -2035,7 +2035,7 @@ UPDATE v1 SET f2 = 4;
ERROR HY000: CHECK OPTION failed 'test.v1'
INSERT INTO v1 VALUES('B',3);
ERROR HY000: CHECK OPTION failed 'test.v1'
SELECT * FROM v1;
SELECT * FROM v1 order by f1, f2;
f1 f2
A 2
B 2
@ -10272,8 +10272,8 @@ CREATE VIEW test3.v30 AS SELECT * FROM test3.v29;
CREATE VIEW test3.v31 AS SELECT * FROM test3.v30;
CREATE VIEW test3.v32 AS SELECT * FROM test3.v31;
SHOW CREATE VIEW test3.v32;
View Create View
v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31`
View Create View character_set_client collation_connection
v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31` latin1 latin1_swedish_ci
SELECT * FROM test3.v32;
f1
1.000
@ -10282,8 +10282,8 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1
DROP VIEW test3.v0;
SHOW CREATE VIEW test3.v32;
View Create View
v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31`
View Create View character_set_client collation_connection
v32 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test3`.`v32` AS select `v31`.`f1` AS `f1` from `test3`.`v31` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'test3.v32' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SELECT * FROM test3.v32;
@ -10393,8 +10393,8 @@ FROM test2.t1 tab1 NATURAL JOIN test1.v18 tab2;
CREATE OR REPLACE VIEW test1.v20 AS SELECT f1, f2
FROM test3.t1 tab1 NATURAL JOIN test1.v19 tab2;
SHOW CREATE VIEW test1.v20;
View Create View
v20 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v20` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v19` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`))))
View Create View character_set_client collation_connection
v20 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v20` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v19` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`)))) latin1 latin1_swedish_ci
SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
CAST(f2 AS CHAR) AS f2 FROM test1.v20;
f1 f2
@ -10409,8 +10409,8 @@ CAST(f2 AS CHAR) AS f2 FROM test1.v20;
CREATE VIEW test1.v21 AS SELECT f1, f2
FROM test3.t1 tab1 NATURAL JOIN test1.v20 tab2;
SHOW CREATE VIEW test1.v21;
View Create View
v21 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v21` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v20` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`))))
View Create View character_set_client collation_connection
v21 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test1`.`v21` AS select `tab1`.`f1` AS `f1`,`tab1`.`f2` AS `f2` from (`test3`.`t1` `tab1` join `test1`.`v20` `tab2` on(((`tab1`.`f1` = `tab2`.`f1`) and (`tab1`.`f2` = `tab2`.`f2`)))) latin1 latin1_swedish_ci
SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
CAST(f2 AS CHAR) AS f2 FROM test1.v21;
f1 f2
@ -10576,7 +10576,7 @@ f1 f2 f3 f4
DELETE FROM t1;
INSERT INTO v1 SET f2 = 'ABC';
INSERT INTO v1 SET f2 = 'ABC';
ERROR 23000: Duplicate entry '0' for key 1
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
SELECT * from t1;
f1 f2 f3 f4
0 ABC NULL NULL
@ -10645,7 +10645,7 @@ DROP VIEW v1;
CREATE VIEW v1 AS SELECT f2, f3 FROM t1;
INSERT INTO v1 SET f2 = 'ABC';
INSERT INTO v1 SET f2 = 'ABC';
ERROR 23000: Duplicate entry '0' for key 1
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
SELECT * from t1;
f1 f2 f3 f4
0 ABC NULL NULL
@ -10980,11 +10980,11 @@ f1 bigint(20) YES NULL
f2 date YES NULL
f4 char(5) YES NULL
report char(10) YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
@ -11004,12 +11004,12 @@ f4x char(5) YES NULL
report char(10) YES NULL
DESCRIBE v1;
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f2 f4x report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
0 NULL ABC t1 1
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
ALTER TABLE t1 CHANGE COLUMN f4x f4 CHAR(5);
ALTER TABLE t1 CHANGE COLUMN f4 f4 CHAR(10);
@ -11027,14 +11027,14 @@ f1 bigint(20) YES NULL
f2 date YES NULL
f4 char(10) YES NULL
report char(10) YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
0 NULL ABC t1 1
2 NULL <-- 10 --> t1 2
2 NULL <-- 10 --> v1 2
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
@ -11063,7 +11063,7 @@ f1 bigint(20) YES NULL
f2 date YES NULL
f4 char(8) YES NULL
report char(10) YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
@ -11072,7 +11072,7 @@ f1 f2 f4 report
2 NULL <-- 10 - v1 2
3 NULL <-- 10 - t1 3
3 NULL <-- 10 - v1 3
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
@ -11096,7 +11096,7 @@ f1 bigint(20) YES NULL
f2 date YES NULL
f4 varchar(20) YES NULL
report char(10) YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
@ -11107,7 +11107,7 @@ f1 f2 f4 report
3 NULL <-- 10 - v1 3
4 NULL <------ 20 --------> t1 4
4 NULL <------ 20 --------> v1 4
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
@ -11135,7 +11135,7 @@ f1 varchar(30) YES NULL
f2 date YES NULL
f4 varchar(20) YES NULL
report char(10) YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
@ -11148,7 +11148,7 @@ f1 f2 f4 report
4 NULL <------ 20 --------> v1 4
<------------- 30 -----------> NULL <------ 20 --------> t1 5
<------------- 30 -----------> NULL <------ 20 --------> v1 5
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
@ -11172,7 +11172,7 @@ f4 varchar(20) YES NULL
report char(10) YES NULL
DESCRIBE v1;
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f4 report
-1 ABC t1 0
-1 ABC v1 0
@ -11186,7 +11186,7 @@ f1 f4 report
<------------- 30 -----------> <------ 20 --------> t1 5
<------------- 30 -----------> <------ 20 --------> v1 5
ABC <------ 20 --------> t1 6
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
ALTER TABLE t1 ADD COLUMN f2 DATE DEFAULT NULL;
INSERT INTO t1 SET f1 = 'ABC', f2 = '1500-12-04',
@ -11205,7 +11205,7 @@ f1 varchar(30) YES NULL
f2 date YES NULL
f4 varchar(20) YES NULL
report char(10) YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f4 report f2
-1 ABC t1 0 NULL
-1 ABC v1 0 NULL
@ -11221,7 +11221,7 @@ f1 f4 report f2
ABC <------ 20 --------> t1 6 NULL
ABC <------ 20 --------> t1 7 1500-12-04
ABC <------ 20 --------> v1 7 1500-12-04
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
@ -11255,7 +11255,7 @@ f1 varchar(30) YES NULL
f2 float YES NULL
f4 varchar(20) YES NULL
report char(10) YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f4 report f2
-1 ABC t1 0 NULL
-1 ABC v1 0 NULL
@ -11270,10 +11270,10 @@ f1 f4 report f2
<------------- 30 -----------> <------ 20 --------> v1 5 NULL
ABC <------ 20 --------> t1 6 NULL
ABC <------ 20 --------> t1 7 NULL
ABC <------ 20 --------> v1 7 NULL
ABC <------ 20 --------> t1 8 -0.00033
ABC <------ 20 --------> v1 7 NULL
ABC <------ 20 --------> v1 8 -0.00033
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
@ -11288,8 +11288,8 @@ f1 f2 f4 report
<------------- 30 -----------> NULL <------ 20 --------> v1 5
ABC NULL <------ 20 --------> t1 6
ABC NULL <------ 20 --------> t1 7
ABC NULL <------ 20 --------> v1 7
ABC -0.00033 <------ 20 --------> t1 8
ABC NULL <------ 20 --------> v1 7
ABC -0.00033 <------ 20 --------> v1 8
ALTER TABLE t1 ADD COLUMN f3 NUMERIC(7,2);
INSERT INTO t1 SET f1 = 'ABC', f2 = -3.3E-4,
@ -11312,7 +11312,7 @@ f1 varchar(30) YES NULL
f2 float YES NULL
f4 varchar(20) YES NULL
report char(10) YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, report;
f1 f4 report f2 f3
-1 ABC t1 0 NULL NULL
-1 ABC v1 0 NULL NULL
@ -11327,12 +11327,12 @@ f1 f4 report f2 f3
<------------- 30 -----------> <------ 20 --------> v1 5 NULL NULL
ABC <------ 20 --------> t1 6 NULL NULL
ABC <------ 20 --------> t1 7 NULL NULL
ABC <------ 20 --------> v1 7 NULL NULL
ABC <------ 20 --------> t1 8 -0.00033 NULL
ABC <------ 20 --------> v1 8 -0.00033 NULL
ABC <------ 20 --------> t1 9 -0.00033 -2.20
ABC <------ 20 --------> v1 7 NULL NULL
ABC <------ 20 --------> v1 8 -0.00033 NULL
ABC <------ 20 --------> v1 9a -0.00033 NULL
SELECT * FROM v1;
SELECT * FROM v1 order by f1, report;
f1 f2 f4 report
-1 NULL ABC t1 0
-1 NULL ABC v1 0
@ -11347,10 +11347,10 @@ f1 f2 f4 report
<------------- 30 -----------> NULL <------ 20 --------> v1 5
ABC NULL <------ 20 --------> t1 6
ABC NULL <------ 20 --------> t1 7
ABC NULL <------ 20 --------> v1 7
ABC -0.00033 <------ 20 --------> t1 8
ABC -0.00033 <------ 20 --------> v1 8
ABC -0.00033 <------ 20 --------> t1 9
ABC NULL <------ 20 --------> v1 7
ABC -0.00033 <------ 20 --------> v1 8
ABC -0.00033 <------ 20 --------> v1 9a
DROP TABLE t1;
DROP VIEW v1;
@ -11365,10 +11365,10 @@ DESCRIBE v1;
Field Type Null Key Default Extra
f1 char(10) YES NULL
my_sqrt double YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, f2;
f1 f2
ABC 3
SELECT * FROM v1;
SELECT * FROM v1 order by 2;
f1 my_sqrt
ABC 1.7320508075689
ALTER TABLE t1 CHANGE COLUMN f2 f2 VARCHAR(30);
@ -11381,21 +11381,21 @@ DESCRIBE v1;
Field Type Null Key Default Extra
f1 char(10) YES NULL
my_sqrt double YES NULL
SELECT * FROM t1;
SELECT * FROM t1 order by f1, f2;
f1 f2
ABC 3
ABC DEF
SELECT * FROM v1;
SELECT * FROM v1 order by 2;
f1 my_sqrt
ABC 1.7320508075689
ABC 0
ABC 1.7320508075689
SELECT SQRT('DEF');
SQRT('DEF')
0
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'DEF'
CREATE VIEW v2 AS SELECT SQRT('DEF');
SELECT * FROM v2;
SELECT * FROM v2 order by 1;
SQRT('DEF')
0
Warnings:
@ -11405,27 +11405,27 @@ DESCRIBE v2;
Field Type Null Key Default Extra
f1 char(10) YES NULL
my_sqrt double YES NULL
SELECT * FROM v2;
SELECT * FROM v2 order by 2;
f1 my_sqrt
ABC 0
ABC 1.7320508075689
ABC 0
CREATE TABLE t2 AS SELECT f1, SQRT(f2) my_sqrt FROM t1;
SELECT * FROM t2;
SELECT * FROM t2 order by 2;
f1 my_sqrt
ABC 1.73205080756888
ABC 0
ABC 1.73205080756888
DROP TABLE t2;
CREATE TABLE t2 AS SELECT * FROM v1;
SELECT * FROM t2;
SELECT * FROM t2 order by 2;
f1 my_sqrt
ABC 1.73205080756888
ABC 0
ABC 1.73205080756888
DROP TABLE t2;
CREATE TABLE t2 AS SELECT * FROM v2;
SELECT * FROM t2;
SELECT * FROM t2 order by 2;
f1 my_sqrt
ABC 1.73205080756888
ABC 0
ABC 1.73205080756888
DROP TABLE t1;
DROP TABLE t2;
DROP VIEW v1;

View file

@ -1772,7 +1772,8 @@ SELECT * FROM v1 ORDER BY f1;
--enable_info
# 1. The record to be inserted will be within the scope of the view.
# But there is already a record with the PRIMARY KEY f1 = 2 .
--error ER_DUP_ENTRY_WITH_KEY_NAME
# OBN change for 5.1.21 --error ER_DUP_ENTRY_WITH_KEY_NAME
--error ER_DUP_ENTRY
INSERT INTO v1 VALUES(2,'two');
# 2. The record to be inserted will be within the scope of the view.
# There is no already existing record with the PRIMARY KEY f1 = 3 .
@ -1789,7 +1790,8 @@ SELECT * FROM v1 ORDER BY f1;
# 1. The record to be updated is within the scope of the view
# and will stay inside the scope.
# But there is already a record with the PRIMARY KEY f1 = 2 .
--error ER_DUP_ENTRY_WITH_KEY_NAME
# OBN change for 5.1.21 --error ER_DUP_ENTRY_WITH_KEY_NAME
--error ER_DUP_ENTRY
UPDATE v1 SET f1 = 2 WHERE f1 = 3;
# 2. The record to be updated is within the scope of the view
# and will stay inside the scope.
@ -3287,7 +3289,8 @@ DELETE FROM t1;
# f1 gets the default 0, because we are in the native sql_mode
INSERT INTO v1 SET f2 = 'ABC';
# f1 gets the default 0, but this value is already exists
--error ER_DUP_ENTRY_WITH_KEY_NAME
# OBN change for 5.1.21 --error ER_DUP_ENTRY_WITH_KEY_NAME
--error ER_DUP_ENTRY
INSERT INTO v1 SET f2 = 'ABC';
SELECT * from t1;
DELETE FROM t1;
@ -3375,7 +3378,8 @@ CREATE VIEW v1 AS SELECT f2, f3 FROM t1;
# f1 gets the default 0, because we are in the native sql_mode
INSERT INTO v1 SET f2 = 'ABC';
# f1 gets the default 0 and this value is already exists
--error ER_DUP_ENTRY_WITH_KEY_NAME
# OBN change for 5.1.21 --error ER_DUP_ENTRY_WITH_KEY_NAME
--error ER_DUP_ENTRY
INSERT INTO v1 SET f2 = 'ABC';
SELECT * from t1;
DELETE FROM t1;

View file

@ -31,9 +31,6 @@ inserts updates deletes
2 1 1
flush logs;
purge master logs before now();
select count(*) from mysql.ndb_binlog_index;
count(*)
0
create table t1 (a int primary key, b int) engine=ndb;
create database mysqltest;
use mysqltest;

View file

@ -1,3 +1,6 @@
select count(*) from information_schema.columns;
count(*)
#
DROP TABLE IF EXISTS t1;
CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'

View file

@ -200,6 +200,240 @@ COUNT(*)
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
CREATE TABLE test.t (
a smallint NOT NULL,
b int NOT NULL,
c bigint NOT NULL,
d char(10),
e TEXT,
f VARCHAR(255),
PRIMARY KEY(a)
) TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
ALTER TABLE test.t ADD INDEX (d), ADD INDEX (f);
SHOW CREATE TABLE test.t;
Table Create Table
t CREATE TABLE `t` (
`a` smallint(6) NOT NULL,
`b` int(11) NOT NULL,
`c` bigint(20) NOT NULL,
`d` char(10) DEFAULT NULL,
`e` text,
`f` varchar(255) DEFAULT NULL,
PRIMARY KEY (`a`),
KEY `d` (`d`),
KEY `f` (`f`)
) /*!50100 TABLESPACE ts1 STORAGE DISK */ ENGINE=ndbcluster DEFAULT CHARSET=latin1
SELECT * FROM test.t order by a;
a b c d e f
1 2 3 aaa1 bbb1 ccccc1
2 3 4 aaa2 bbb2 ccccc2
3 4 5 aaa3 bbb3 ccccc3
4 5 6 aaa4 bbb4 ccccc4
5 6 7 aaa5 bbb5 ccccc5
6 7 8 aaa6 bbb6 ccccc6
7 8 9 aaa7 bbb7 ccccc7
8 9 10 aaa8 bbb8 ccccc8
9 10 11 aaa9 bbb9 ccccc9
10 11 12 aaa10 bbb10 ccccc10
11 12 13 aaa11 bbb11 ccccc11
12 13 14 aaa12 bbb12 ccccc12
13 14 15 aaa13 bbb13 ccccc13
14 15 16 aaa14 bbb14 ccccc14
15 16 17 aaa15 bbb15 ccccc15
16 17 18 aaa16 bbb16 ccccc16
17 18 19 aaa17 bbb17 ccccc17
18 19 20 aaa18 bbb18 ccccc18
19 20 21 aaa19 bbb19 ccccc19
20 21 22 aaa20 bbb20 ccccc20
21 22 23 aaa21 bbb21 ccccc21
22 23 24 aaa22 bbb22 ccccc22
23 24 25 aaa23 bbb23 ccccc23
24 25 26 aaa24 bbb24 ccccc24
25 26 27 aaa25 bbb25 ccccc25
26 27 28 aaa26 bbb26 ccccc26
27 28 29 aaa27 bbb27 ccccc27
28 29 30 aaa28 bbb28 ccccc28
29 30 31 aaa29 bbb29 ccccc29
30 31 32 aaa30 bbb30 ccccc30
31 32 33 aaa31 bbb31 ccccc31
32 33 34 aaa32 bbb32 ccccc32
33 34 35 aaa33 bbb33 ccccc33
34 35 36 aaa34 bbb34 ccccc34
35 36 37 aaa35 bbb35 ccccc35
36 37 38 aaa36 bbb36 ccccc36
37 38 39 aaa37 bbb37 ccccc37
38 39 40 aaa38 bbb38 ccccc38
39 40 41 aaa39 bbb39 ccccc39
40 41 42 aaa40 bbb40 ccccc40
41 42 43 aaa41 bbb41 ccccc41
42 43 44 aaa42 bbb42 ccccc42
43 44 45 aaa43 bbb43 ccccc43
44 45 46 aaa44 bbb44 ccccc44
45 46 47 aaa45 bbb45 ccccc45
46 47 48 aaa46 bbb46 ccccc46
47 48 49 aaa47 bbb47 ccccc47
48 49 50 aaa48 bbb48 ccccc48
49 50 51 aaa49 bbb49 ccccc49
50 51 52 aaa50 bbb50 ccccc50
51 52 53 aaa51 bbb51 ccccc51
52 53 54 aaa52 bbb52 ccccc52
53 54 55 aaa53 bbb53 ccccc53
54 55 56 aaa54 bbb54 ccccc54
55 56 57 aaa55 bbb55 ccccc55
56 57 58 aaa56 bbb56 ccccc56
57 58 59 aaa57 bbb57 ccccc57
58 59 60 aaa58 bbb58 ccccc58
59 60 61 aaa59 bbb59 ccccc59
60 61 62 aaa60 bbb60 ccccc60
61 62 63 aaa61 bbb61 ccccc61
62 63 64 aaa62 bbb62 ccccc62
63 64 65 aaa63 bbb63 ccccc63
64 65 66 aaa64 bbb64 ccccc64
65 66 67 aaa65 bbb65 ccccc65
66 67 68 aaa66 bbb66 ccccc66
67 68 69 aaa67 bbb67 ccccc67
68 69 70 aaa68 bbb68 ccccc68
69 70 71 aaa69 bbb69 ccccc69
70 71 72 aaa70 bbb70 ccccc70
71 72 73 aaa71 bbb71 ccccc71
72 73 74 aaa72 bbb72 ccccc72
73 74 75 aaa73 bbb73 ccccc73
74 75 76 aaa74 bbb74 ccccc74
75 76 77 aaa75 bbb75 ccccc75
76 77 78 aaa76 bbb76 ccccc76
77 78 79 aaa77 bbb77 ccccc77
78 79 80 aaa78 bbb78 ccccc78
79 80 81 aaa79 bbb79 ccccc79
80 81 82 aaa80 bbb80 ccccc80
81 82 83 aaa81 bbb81 ccccc81
82 83 84 aaa82 bbb82 ccccc82
83 84 85 aaa83 bbb83 ccccc83
84 85 86 aaa84 bbb84 ccccc84
85 86 87 aaa85 bbb85 ccccc85
86 87 88 aaa86 bbb86 ccccc86
87 88 89 aaa87 bbb87 ccccc87
88 89 90 aaa88 bbb88 ccccc88
89 90 91 aaa89 bbb89 ccccc89
90 91 92 aaa90 bbb90 ccccc90
91 92 93 aaa91 bbb91 ccccc91
92 93 94 aaa92 bbb92 ccccc92
93 94 95 aaa93 bbb93 ccccc93
94 95 96 aaa94 bbb94 ccccc94
95 96 97 aaa95 bbb95 ccccc95
96 97 98 aaa96 bbb96 ccccc96
97 98 99 aaa97 bbb97 ccccc97
98 99 100 aaa98 bbb98 ccccc98
99 100 101 aaa99 bbb99 ccccc99
100 101 102 aaa100 bbb100 ccccc100
SELECT * INTO OUTFILE 't_backup' FROM test.t;
TRUNCATE test.t;
SELECT count(*) FROM test.t;
count(*)
0
LOAD DATA INFILE 't_backup' INTO TABLE test.t;
SELECT * FROM test.t order by a;
a b c d e f
1 2 3 aaa1 bbb1 ccccc1
2 3 4 aaa2 bbb2 ccccc2
3 4 5 aaa3 bbb3 ccccc3
4 5 6 aaa4 bbb4 ccccc4
5 6 7 aaa5 bbb5 ccccc5
6 7 8 aaa6 bbb6 ccccc6
7 8 9 aaa7 bbb7 ccccc7
8 9 10 aaa8 bbb8 ccccc8
9 10 11 aaa9 bbb9 ccccc9
10 11 12 aaa10 bbb10 ccccc10
11 12 13 aaa11 bbb11 ccccc11
12 13 14 aaa12 bbb12 ccccc12
13 14 15 aaa13 bbb13 ccccc13
14 15 16 aaa14 bbb14 ccccc14
15 16 17 aaa15 bbb15 ccccc15
16 17 18 aaa16 bbb16 ccccc16
17 18 19 aaa17 bbb17 ccccc17
18 19 20 aaa18 bbb18 ccccc18
19 20 21 aaa19 bbb19 ccccc19
20 21 22 aaa20 bbb20 ccccc20
21 22 23 aaa21 bbb21 ccccc21
22 23 24 aaa22 bbb22 ccccc22
23 24 25 aaa23 bbb23 ccccc23
24 25 26 aaa24 bbb24 ccccc24
25 26 27 aaa25 bbb25 ccccc25
26 27 28 aaa26 bbb26 ccccc26
27 28 29 aaa27 bbb27 ccccc27
28 29 30 aaa28 bbb28 ccccc28
29 30 31 aaa29 bbb29 ccccc29
30 31 32 aaa30 bbb30 ccccc30
31 32 33 aaa31 bbb31 ccccc31
32 33 34 aaa32 bbb32 ccccc32
33 34 35 aaa33 bbb33 ccccc33
34 35 36 aaa34 bbb34 ccccc34
35 36 37 aaa35 bbb35 ccccc35
36 37 38 aaa36 bbb36 ccccc36
37 38 39 aaa37 bbb37 ccccc37
38 39 40 aaa38 bbb38 ccccc38
39 40 41 aaa39 bbb39 ccccc39
40 41 42 aaa40 bbb40 ccccc40
41 42 43 aaa41 bbb41 ccccc41
42 43 44 aaa42 bbb42 ccccc42
43 44 45 aaa43 bbb43 ccccc43
44 45 46 aaa44 bbb44 ccccc44
45 46 47 aaa45 bbb45 ccccc45
46 47 48 aaa46 bbb46 ccccc46
47 48 49 aaa47 bbb47 ccccc47
48 49 50 aaa48 bbb48 ccccc48
49 50 51 aaa49 bbb49 ccccc49
50 51 52 aaa50 bbb50 ccccc50
51 52 53 aaa51 bbb51 ccccc51
52 53 54 aaa52 bbb52 ccccc52
53 54 55 aaa53 bbb53 ccccc53
54 55 56 aaa54 bbb54 ccccc54
55 56 57 aaa55 bbb55 ccccc55
56 57 58 aaa56 bbb56 ccccc56
57 58 59 aaa57 bbb57 ccccc57
58 59 60 aaa58 bbb58 ccccc58
59 60 61 aaa59 bbb59 ccccc59
60 61 62 aaa60 bbb60 ccccc60
61 62 63 aaa61 bbb61 ccccc61
62 63 64 aaa62 bbb62 ccccc62
63 64 65 aaa63 bbb63 ccccc63
64 65 66 aaa64 bbb64 ccccc64
65 66 67 aaa65 bbb65 ccccc65
66 67 68 aaa66 bbb66 ccccc66
67 68 69 aaa67 bbb67 ccccc67
68 69 70 aaa68 bbb68 ccccc68
69 70 71 aaa69 bbb69 ccccc69
70 71 72 aaa70 bbb70 ccccc70
71 72 73 aaa71 bbb71 ccccc71
72 73 74 aaa72 bbb72 ccccc72
73 74 75 aaa73 bbb73 ccccc73
74 75 76 aaa74 bbb74 ccccc74
75 76 77 aaa75 bbb75 ccccc75
76 77 78 aaa76 bbb76 ccccc76
77 78 79 aaa77 bbb77 ccccc77
78 79 80 aaa78 bbb78 ccccc78
79 80 81 aaa79 bbb79 ccccc79
80 81 82 aaa80 bbb80 ccccc80
81 82 83 aaa81 bbb81 ccccc81
82 83 84 aaa82 bbb82 ccccc82
83 84 85 aaa83 bbb83 ccccc83
84 85 86 aaa84 bbb84 ccccc84
85 86 87 aaa85 bbb85 ccccc85
86 87 88 aaa86 bbb86 ccccc86
87 88 89 aaa87 bbb87 ccccc87
88 89 90 aaa88 bbb88 ccccc88
89 90 91 aaa89 bbb89 ccccc89
90 91 92 aaa90 bbb90 ccccc90
91 92 93 aaa91 bbb91 ccccc91
92 93 94 aaa92 bbb92 ccccc92
93 94 95 aaa93 bbb93 ccccc93
94 95 96 aaa94 bbb94 ccccc94
95 96 97 aaa95 bbb95 ccccc95
96 97 98 aaa96 bbb96 ccccc96
97 98 99 aaa97 bbb97 ccccc97
98 99 100 aaa98 bbb98 ccccc98
99 100 101 aaa99 bbb99 ccccc99
100 101 102 aaa100 bbb100 ccccc100
DROP TABLE test.t;
ALTER TABLESPACE ts1
DROP DATAFILE 'datafile_ts1_01.dat'
ENGINE = NDB;

View file

@ -46,10 +46,18 @@ select inserts,updates,deletes from
#
# check that purge clears the ndb_binlog_index
#
# TODO: make this deterministic
# This test is disabled until we can make this determistic under load.
# The problem is that in some cases, the binlog writing thread gets
# scheduled after the purge, writes pending things, then the select
# gets scheduled
#
flush logs;
--sleep 1
purge master logs before now();
--disable_parsing
select count(*) from mysql.ndb_binlog_index;
--enable_parsing
#
# several tables in different databases

View file

@ -14,6 +14,12 @@
-- source include/have_ndb.inc
#
# Bug#30322 Server crashes on selecting from i_s.columns when cluster is running -regression
#
--replace_column 1 #
select count(*) from information_schema.columns;
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings

View file

@ -224,43 +224,44 @@ DROP TABLE t3;
#### BUG 18856 test case comented out
##### Use "SELECT * INTO OUTFILE" to dump data and "LOAD DATA INFILE" to load ##### data back to the data file.
#CREATE TABLE test.t (
# a smallint NOT NULL,
# b int NOT NULL,
# c bigint NOT NULL,
# d char(10),
# e TEXT,
# f VARCHAR(255),
# PRIMARY KEY(a)
#) TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
CREATE TABLE test.t (
a smallint NOT NULL,
b int NOT NULL,
c bigint NOT NULL,
d char(10),
e TEXT,
f VARCHAR(255),
PRIMARY KEY(a)
) TABLESPACE ts1 STORAGE DISK ENGINE=NDB;
# ALTER TABLE test.t ADD INDEX (d), ADD INDEX (f);
# SHOW CREATE TABLE test.t;
ALTER TABLE test.t ADD INDEX (d), ADD INDEX (f);
SHOW CREATE TABLE test.t;
# insert records into tables
# let $1=100;
# disable_query_log;
# while ($1)
# {
# eval insert into test.t values($1, $1+1, $1+2, "aaa$1", "bbb$1", "ccccc$1");
# dec $1;
# }
# enable_query_log;
let $1=100;
disable_query_log;
while ($1)
{
eval insert into test.t values($1, $1+1, $1+2, "aaa$1", "bbb$1", "ccccc$1");
dec $1;
}
enable_query_log;
# SELECT * FROM test.t order by a;
SELECT * FROM test.t order by a;
# SELECT * INTO OUTFILE 't_backup' FROM test.t;
# TRUNCATE test.t;
SELECT * INTO OUTFILE 't_backup' FROM test.t;
TRUNCATE test.t;
#'TRUNCATE test.t' failed: 1205: Lock wait timeout exceeded; try restarting #transaction. TABLESPACE ts STORAGE DISK ENGINE=NDB;
#'TRUNCATE test.t' failed: 1205: Lock wait timeout exceeded; try restarting
#transaction. TABLESPACE ts STORAGE DISK ENGINE=NDB;
# SELECT count(*) FROM test.t;
# LOAD DATA INFILE 't_backup' INTO TABLE test.t;
SELECT count(*) FROM test.t;
LOAD DATA INFILE 't_backup' INTO TABLE test.t;
# SELECT * FROM test.t order by a;
SELECT * FROM test.t order by a;
# DROP TABLE test.t;
DROP TABLE test.t;
ALTER TABLESPACE ts1

View file

@ -2,6 +2,10 @@
# Testing of misc functions
#
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
select format(1.5555,0),format(123.5555,1),format(1234.5555,2),format(12345.55555,3),format(123456.5555,4),format(1234567.5555,5),format("12345.2399",2);
select inet_ntoa(inet_aton("255.255.255.255.255.255.255.255"));
@ -48,9 +52,6 @@ drop table t1;
#
# Bug#16501: IS_USED_LOCK does not appear to work
#
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
CREATE TABLE t1 (conn CHAR(7), connection_id INT);
INSERT INTO t1 VALUES ('default', CONNECTION_ID());

View file

@ -1120,4 +1120,20 @@ explain select b.table_name
from information_schema.tables a, information_schema.columns b
where a.table_name='t1' and a.table_schema='test' and b.table_name=a.table_name;
#
# Bug#30310 wrong result on SELECT * FROM INFORMATION_SCHEMA.SCHEMATA WHERE ..
#
SELECT * FROM INFORMATION_SCHEMA.SCHEMATA
WHERE SCHEMA_NAME = 'mysqltest';
SELECT * FROM INFORMATION_SCHEMA.SCHEMATA
WHERE SCHEMA_NAME = '';
SELECT * FROM INFORMATION_SCHEMA.SCHEMATA
WHERE SCHEMA_NAME = 'test';
select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysql' AND TABLE_NAME='nonexisting';
select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysql' AND TABLE_NAME='';
select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='' AND TABLE_NAME='';
select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='' AND TABLE_NAME='nonexisting';
--echo End of 5.1 tests.

View file

@ -33,8 +33,8 @@ let $wait_condition= select 1 from INFORMATION_SCHEMA.PROCESSLIST where ID = $ID
unlock tables;
connection con1;
reap;
show status like 'Table_lock%';
select * from information_schema.session_status where variable_name like 'Table_lock%';
show status like 'Table_locks_waited%';
select * from information_schema.session_status where variable_name like 'Table_locks_waited%';
drop table t1;
disconnect con2;

View file

@ -23,14 +23,9 @@ SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
# Exception is the embedded server that needs this library compiled with
# dynamic TLS, i.e. define USE_TLS
IF(EMBEDDED_ONLY)
ADD_DEFINITIONS(-DUSE_TLS)
ADD_DEFINITIONS(-DEMBEDDED_LIBRARY)
ENDIF(EMBEDDED_ONLY)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/zlib ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/mysys)
ADD_LIBRARY(mysys array.c charset-def.c charset.c checksum.c default.c default_modify.c
SET(MYSYS_SOURCES array.c charset-def.c charset.c checksum.c default.c default_modify.c
errors.c hash.c list.c md5.c mf_brkhant.c mf_cache.c mf_dirname.c mf_fn_ext.c
mf_format.c mf_getdate.c mf_iocache.c mf_iocache2.c mf_keycache.c
mf_keycaches.c mf_loadpath.c mf_pack.c mf_path.c mf_qsort.c mf_qsort2.c
@ -47,3 +42,7 @@ ADD_LIBRARY(mysys array.c charset-def.c charset.c checksum.c default.c default_m
my_windac.c my_winthread.c my_write.c ptr_cmp.c queues.c
rijndael.c safemalloc.c sha1.c string.c thr_alarm.c thr_lock.c thr_mutex.c
thr_rwlock.c tree.c typelib.c my_vle.c base64.c my_memmem.c my_getpagesize.c)
IF(NOT SOURCE_SUBLIBS)
ADD_LIBRARY(mysys ${MYSYS_SOURCES})
ENDIF(NOT SOURCE_SUBLIBS)

View file

@ -76,6 +76,7 @@ FILE *my_fopen(const char *filename, int flags, myf MyFlags)
my_strdup(filename,MyFlags)))
{
my_stream_opened++;
my_file_total_opened++;
my_file_info[fileno(fd)].type = STREAM_BY_FOPEN;
pthread_mutex_unlock(&THR_LOCK_open);
DBUG_PRINT("exit",("stream: 0x%lx", (long) fd));

View file

@ -19,7 +19,9 @@
#include "mysys_priv.h"
#include <m_string.h>
#if !defined(__FreeBSD__) || defined(__linux__)
#ifndef MAIN
#if defined(__FreeBSD__) || defined(__linux__)
static my_bool memcpy_and_test(uchar *to, uchar *from, uint len)
{
uint i, res=1;
@ -29,6 +31,7 @@ static my_bool memcpy_and_test(uchar *to, uchar *from, uint len)
res=0;
return res;
}
#endif /* FreeBSD || linux */
#ifdef __FreeBSD__
@ -98,7 +101,7 @@ err:
return res;
}
#else
#else /* FreeBSD elif linux */
/* just fail */
my_bool my_gethwaddr(uchar *to __attribute__((unused)))
{

View file

@ -151,6 +151,7 @@ File my_register_filename(File fd, const char *FileName, enum file_type
if ((my_file_info[fd].name = (char*) my_strdup(FileName,MyFlags)))
{
my_file_opened++;
my_file_total_opened++;
my_file_info[fd].type = type_of_file;
#if defined(THREAD) && !defined(HAVE_PREAD)
pthread_mutex_init(&my_file_info[fd].mutex,MY_MUTEX_INIT_FAST);

View file

@ -30,6 +30,7 @@ const char *my_progname=0;
char NEAR curr_dir[FN_REFLEN]= {0},
NEAR home_dir_buff[FN_REFLEN]= {0};
ulong my_stream_opened=0,my_file_opened=0, my_tmp_file_created=0;
ulong my_file_total_opened= 0;
int NEAR my_umask=0664, NEAR my_umask_dir=0777;
#ifndef THREAD
int NEAR my_errno=0;

View file

@ -38,7 +38,7 @@ uint thr_client_alarm;
static int alarm_aborted=1; /* No alarm thread */
my_bool thr_alarm_inited= 0;
volatile my_bool alarm_thread_running= 0;
time_t next_alarm_expire_time= ~ (time_t) 0;
static sig_handler process_alarm_part2(int sig);
#if !defined(__WIN__)
@ -71,6 +71,7 @@ void init_thr_alarm(uint max_alarms)
sigset_t s;
DBUG_ENTER("init_thr_alarm");
alarm_aborted=0;
next_alarm_expire_time= ~ (time_t) 0;
init_queue(&alarm_queue,max_alarms+1,offsetof(ALARM,expire_time),0,
compare_ulong,NullS);
sigfillset(&full_signal_set); /* Neaded to block signals */
@ -150,22 +151,28 @@ void resize_thr_alarm(uint max_alarms)
my_bool thr_alarm(thr_alarm_t *alrm, uint sec, ALARM *alarm_data)
{
ulong now;
time_t now;
#ifndef USE_ONE_SIGNAL_HAND
sigset_t old_mask;
#endif
my_bool reschedule;
struct st_my_thread_var *current_my_thread_var= my_thread_var;
DBUG_ENTER("thr_alarm");
DBUG_PRINT("enter",("thread: %s sec: %d",my_thread_name(),sec));
now=(ulong) my_time(0);
now= my_time(0);
#ifndef USE_ONE_SIGNAL_HAND
pthread_sigmask(SIG_BLOCK,&full_signal_set,&old_mask);
#endif
pthread_mutex_lock(&LOCK_alarm); /* Lock from threads & alarms */
if (alarm_aborted > 0)
{ /* No signal thread */
DBUG_PRINT("info", ("alarm aborted"));
*alrm= 0; /* No alarm */
pthread_mutex_unlock(&LOCK_alarm);
#ifndef USE_ONE_SIGNAL_HAND
pthread_sigmask(SIG_SETMASK,&old_mask,NULL);
#endif
DBUG_RETURN(1);
}
if (alarm_aborted < 0)
@ -179,14 +186,14 @@ my_bool thr_alarm(thr_alarm_t *alrm, uint sec, ALARM *alarm_data)
fprintf(stderr,"Warning: thr_alarm queue is full\n");
*alrm= 0; /* No alarm */
pthread_mutex_unlock(&LOCK_alarm);
#ifndef USE_ONE_SIGNAL_HAND
pthread_sigmask(SIG_SETMASK,&old_mask,NULL);
#endif
DBUG_RETURN(1);
}
max_used_alarms=alarm_queue.elements+1;
}
reschedule= (!alarm_queue.elements ||
(int) (((ALARM*) queue_top(&alarm_queue))->expire_time - now) >
(int) sec);
reschedule= (ulong) next_alarm_expire_time > (ulong) now + sec;
if (!alarm_data)
{
if (!(alarm_data=(ALARM*) my_malloc(sizeof(ALARM),MYF(MY_WME))))
@ -194,7 +201,9 @@ my_bool thr_alarm(thr_alarm_t *alrm, uint sec, ALARM *alarm_data)
DBUG_PRINT("info", ("failed my_malloc()"));
*alrm= 0; /* No alarm */
pthread_mutex_unlock(&LOCK_alarm);
#ifndef USE_ONE_SIGNAL_HAND
pthread_sigmask(SIG_SETMASK,&old_mask,NULL);
#endif
DBUG_RETURN(1);
}
alarm_data->malloced=1;
@ -212,12 +221,17 @@ my_bool thr_alarm(thr_alarm_t *alrm, uint sec, ALARM *alarm_data)
{
DBUG_PRINT("info", ("reschedule"));
if (pthread_equal(pthread_self(),alarm_thread))
{
alarm(sec); /* purecov: inspected */
next_alarm_expire_time= now + sec;
}
else
reschedule_alarms(); /* Reschedule alarms */
}
pthread_mutex_unlock(&LOCK_alarm);
#ifndef USE_ONE_SIGNAL_HAND
pthread_sigmask(SIG_SETMASK,&old_mask,NULL);
#endif
(*alrm)= &alarm_data->alarmed;
DBUG_RETURN(0);
}
@ -230,11 +244,15 @@ my_bool thr_alarm(thr_alarm_t *alrm, uint sec, ALARM *alarm_data)
void thr_end_alarm(thr_alarm_t *alarmed)
{
ALARM *alarm_data;
#ifndef USE_ONE_SIGNAL_HAND
sigset_t old_mask;
#endif
uint i, found=0;
DBUG_ENTER("thr_end_alarm");
#ifndef USE_ONE_SIGNAL_HAND
pthread_sigmask(SIG_BLOCK,&full_signal_set,&old_mask);
#endif
pthread_mutex_lock(&LOCK_alarm);
alarm_data= (ALARM*) ((uchar*) *alarmed - offsetof(ALARM,alarmed));
@ -261,7 +279,9 @@ void thr_end_alarm(thr_alarm_t *alarmed)
(long) *alarmed));
}
pthread_mutex_unlock(&LOCK_alarm);
#ifndef USE_ONE_SIGNAL_HAND
pthread_sigmask(SIG_SETMASK,&old_mask,NULL);
#endif
DBUG_VOID_RETURN;
}
@ -380,10 +400,18 @@ static sig_handler process_alarm_part2(int sig __attribute__((unused)))
alarm(0); /* Remove old alarm */
#endif
alarm((uint) (alarm_data->expire_time-now));
next_alarm_expire_time= alarm_data->expire_time;
}
#endif
}
}
else
{
/*
Ensure that next time we call thr_alarm(), we will schedule a new alarm
*/
next_alarm_expire_time= ~(time_t) 0;
}
DBUG_VOID_RETURN;
}
@ -537,6 +565,7 @@ static void *alarm_handler(void *arg __attribute__((unused)))
{
abstime.tv_sec=sleep_time;
abstime.tv_nsec=0;
next_alarm_expire_time= sleep_time;
if ((error=pthread_cond_timedwait(&COND_alarm,&LOCK_alarm,&abstime)) &&
error != ETIME && error != ETIMEDOUT)
{
@ -549,12 +578,16 @@ static void *alarm_handler(void *arg __attribute__((unused)))
}
else if (alarm_aborted == -1)
break;
else if ((error=pthread_cond_wait(&COND_alarm,&LOCK_alarm)))
else
{
next_alarm_expire_time= ~ (time_t) 0;
if ((error=pthread_cond_wait(&COND_alarm,&LOCK_alarm)))
{
#ifdef MAIN
printf("Got error: %d from ptread_cond_wait (errno: %d)\n",
error,errno);
printf("Got error: %d from ptread_cond_wait (errno: %d)\n",
error,errno);
#endif
}
}
process_alarm(0);
}

View file

@ -29,8 +29,15 @@ fi
# configure
./configure $base_configs $extra_configs
# make
make clean bin-dist
# Ensure a clean tree
make clean
# Link NetWare specific .def files into their proper locations
# in the source tree
( cd netware && make link_sources )
# Now, do the real build
make bin-dist
# mark the build
for file in *.tar.gz *.zip

View file

@ -83,7 +83,7 @@ EXTRA_DIST= $(BUILT_SOURCES) comp_err.def install_test_db.ncf \
perror.def \
mysql_client_test.def \
replace.def resolve_stack_dump.def resolveip.def \
static_init_db.sql \
static_init_db.sql init_db.sql test_db.sql \
BUILD/apply-patch BUILD/compile-AUTOTOOLS \
BUILD/compile-linux-tools BUILD/compile-netware-END \
BUILD/compile-netware-START BUILD/compile-netware-all\

View file

@ -17,4 +17,9 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG -DSAFEMALLOC -DSAFE_MUTEX")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
ADD_LIBRARY(regex debug.c regcomp.c regerror.c regexec.c regfree.c reginit.c split.c)
SET(REGEX_SOURCES debug.c regcomp.c regerror.c regexec.c regfree.c reginit.c split.c)
IF(NOT SOURCE_SUBLIBS)
ADD_LIBRARY(regex ${REGEX_SOURCES})
ENDIF(NOT SOURCE_SUBLIBS)

View file

@ -1479,8 +1479,8 @@ sopno pos;
}
{
int length=(HERE()-pos-1)*sizeof(sop);
bmove_upp((char *) &p->strip[pos+1]+length,
(char *) &p->strip[pos]+length,
bmove_upp((uchar *) &p->strip[pos+1]+length,
(uchar *) &p->strip[pos]+length,
length);
}
#ifdef OLD_CODE

View file

@ -31,6 +31,7 @@ force=0
in_rpm=0
ip_only=0
windows=0
source_install=0
usage()
{
@ -41,7 +42,7 @@ Usage: $0 [OPTIONS]
--force Causes mysql_install_db to run even if DNS does not
work. In that case, grant table entries that normally
use hostnames will use IP addresses.
--ldata=path The path to the MySQL data directory.
--ldata=path The path to the MySQL data directory. Same as --datadir.
--rpm For internal use. This option is used by RPM files
during the MySQL installation process.
--skip-name-resolve Use IP addresses rather than hostnames when creating
@ -120,6 +121,13 @@ parse_arguments()
# package.
windows=1 ;;
--source-install)
# This is used when you want to run mysqld directly from the
# source tree (for example when you are developing MySQL and
# only want to create the default tables but don't want to
# install mysqld yet.
source_install=1 ;;
*)
if test -n "$pick_args"
then
@ -147,15 +155,22 @@ find_in_basedir()
file=$1; shift
base="$basedir"
if test -z "$base"
then
# Assume source installation if basedir is not given
base="."
fi
for dir in "$@"
do
if test -f "$basedir/$dir/$file"
if test -f "$base/$dir/$file"
then
if test -n "$return_dir"
then
echo "$basedir/$dir"
echo "$base/$dir"
else
echo "$basedir/$dir/$file"
echo "$base/$dir/$file"
fi
break
fi
@ -164,11 +179,17 @@ find_in_basedir()
missing_in_basedir()
{
echo "FATAL ERROR: Could not find $* inside --basedir"
echo
echo "When using --basedir you must point either into a MySQL binary"
echo "distribution directory or a compiled tree previously populated"
echo "by 'make install'"
if test -z "$basedir"
then
echo "FATAL ERROR: Could not find $* inside --basedir"
echo
echo "When using --basedir you must point either into a MySQL binary"
echo "distribution directory or a compiled tree previously populated"
echo "by 'make install'"
else
echo "FATAL ERROR: Can't find $*. Please specify your installation"
echo "directory with the '--basedir=' option."
fi
}
# Ok, let's go. We first need to parse arguments which are required by
@ -178,15 +199,10 @@ parse_arguments PICK-ARGS-FROM-ARGV "$@"
# We can now find my_print_defaults, either in the supplied --basedir
# location or in the installed area.
if test -n "$basedir"
print_defaults=`find_in_basedir my_print_defaults bin extra`
if test -z "$print_defaults"
then
print_defaults=`find_in_basedir my_print_defaults bin extra`
if ! test -x "$print_defaults"
then
missing_in_basedir my_print_defaults
exit 1
fi
else
print_defaults="@bindir@/my_print_defaults"
if ! test -x "$print_defaults"
then
@ -194,7 +210,8 @@ else
echo
echo "If you are using a binary release, you must run this script from"
echo "within the directory the archive extracted into. If you compiled"
echo "MySQL yourself you must run 'make install' first."
echo "MySQL yourself you must run 'make install' first or use"
echo "use --source-install --install-dir=xxx from the top source directory"
exit 1
fi
fi
@ -205,10 +222,11 @@ parse_arguments `$print_defaults $defaults mysqld mysql_install_db`
parse_arguments PICK-ARGS-FROM-ARGV "$@"
# Path to MySQL installation directory
if test -z "$basedir"
if test -z "$basedir" -a "$source_install" = 0
then
basedir="@prefix@"
bindir="@bindir@"
extra_bindir="$bindir"
mysqld="@libexecdir@/mysqld"
pkgdatadir="@pkgdatadir@"
else
@ -216,17 +234,33 @@ else
# We set up bootstrap-specific paths later, so skip this for --windows
if test "$windows" -eq 0
then
pkgdatadir=`find_in_basedir --dir fill_help_tables.sql share share/mysql`
if test -z "$pkgdatadir"
then
missing_in_basedir fill_help_tables.sql
exit 1
fi
mysqld=`find_in_basedir mysqld libexec sbin bin`
if ! test -x "$mysqld"
if test -z "$basedir"
then
missing_in_basedir mysqld
exit 1
# We come here when source-install is given
bindir="$basedir/bin"
extra_bindir="$bindir"
fi
if test -x "$mysqld"
then
pkgdatadir=`find_in_basedir --dir fill_help_tables.sql share share/mysql scripts`
if test -z "$pkgdatadir"
then
missing_in_basedir fill_help_tables.sql
exit 1
fi
else
if test -x "./sql/mysqld"
then
# Source installation
mysqld="./sql/mysqld"
bindir="./client"
extra_bindir="./extra"
pkgdatadir="./scripts"
mysqld_opt="--language=./sql/share/english"
else
missing_in_basedir mysqld
fi
fi
fi
fi
@ -272,7 +306,7 @@ fi
# already tested above).
if test ! -x "$mysqld"
then
echo "FATAL ERROR: $mysqld not found!"
echo "FATAL ERROR: 'mysqld' executable not found!"
exit 1
fi
@ -282,14 +316,14 @@ hostname=`@HOSTNAME@`
# Check if hostname is valid
if test "$windows" -eq 0 -a "$in_rpm" -eq 0 -a "$force" -eq 0
then
resolved=`$bindir/resolveip $hostname 2>&1`
resolved=`$extra_bindir/resolveip $hostname 2>&1`
if [ $? -ne 0 ]
then
resolved=`$bindir/resolveip localhost 2>&1`
resolved=`$extra_bindir/resolveip localhost 2>&1`
if [ $? -ne 0 ]
then
echo "Neither host '$hostname' nor 'localhost' could be looked up with"
echo "$bindir/resolveip"
echo "$extra_bindir/resolveip"
echo "Please configure the 'hostname' command to return a correct"
echo "hostname."
echo "If you want to solve this at a later stage, restart this script"
@ -332,7 +366,7 @@ fi
# Peform the install of system tables
mysqld_bootstrap="${MYSQLD_BOOTSTRAP-$mysqld}"
mysqld_install_cmd_line="$mysqld_bootstrap $defaults $mysqld_opt --bootstrap \
--basedir=$basedir --datadir=$ldata --loose-skip-innodb \
--basedir=$basedir --datadir=$ldata --log-warnings=0 --loose-skip-innodb \
--loose-skip-ndbcluster $args --max_allowed_packet=8M \
--net_buffer_length=16K"
@ -374,7 +408,7 @@ then
echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'"
echo "See the manual for more instructions."
if test "$in_rpm" -eq 0
if test "$in_rpm" -eq 0 -a "$source_install" -eq 0
then
echo "You can start the MySQL daemon with:"
echo "cd @prefix@ ; $bindir/mysqld_safe &"

View file

@ -24,7 +24,7 @@ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/sql
ADD_EXECUTABLE(mysqlmanager buffer.cc command.cc commands.cc guardian.cc instance.cc instance_map.cc
instance_options.cc listener.cc log.cc manager.cc messages.cc mysql_connection.cc
mysqlmanager.cc options.cc parse.cc parse_output.cc priv.cc protocol.cc
thread_registry.cc user_map.cc imservice.cpp windowsservice.cpp
thread_registry.cc user_map.cc IMService.cpp WindowsService.cpp
user_management_commands.cc
../../sql/net_serv.cc ../../sql-common/pack.c ../../sql/password.c
../../sql/sql_state.c ../../sql-common/client.c ../../libmysql/get_password.c

View file

@ -176,6 +176,8 @@ static bool create_pid_file()
appropriately.
*************************************************************************/
extern "C" void reap_child(int);
void reap_child(int __attribute__((unused)) signo)
{
/* NOTE: As we have only one child, no need to cycle waitpid(). */
@ -197,6 +199,7 @@ void reap_child(int __attribute__((unused)) signo)
Set termination status and return.
*************************************************************************/
extern "C" void terminate(int signo);
void terminate(int signo)
{
shutdown_request_signo= signo;

View file

@ -27,7 +27,9 @@
enum { THREAD_KICK_OFF_SIGNAL= SIGUSR2 };
static void handle_signal(int __attribute__((unused)) sig_no)
extern "C" void handle_signal(int);
void handle_signal(int __attribute__((unused)) sig_no)
{
}
#endif

View file

@ -2302,7 +2302,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
db= 0;
}
/* Write authentication package */
if (my_net_write(net,buff,(ulong) (end-buff)) || net_flush(net))
if (my_net_write(net, (uchar*) buff, (size_t) (end-buff)) || net_flush(net))
{
set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate,
ER(CR_SERVER_LOST_EXTENDED),
@ -2334,7 +2334,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
password in old format.
*/
scramble_323(buff, mysql->scramble, passwd);
if (my_net_write(net, buff, SCRAMBLE_LENGTH_323 + 1) || net_flush(net))
if (my_net_write(net, (uchar*) buff, SCRAMBLE_LENGTH_323 + 1) ||
net_flush(net))
{
set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate,
ER(CR_SERVER_LOST_EXTENDED),
@ -2531,7 +2532,8 @@ mysql_select_db(MYSQL *mysql, const char *db)
DBUG_ENTER("mysql_select_db");
DBUG_PRINT("enter",("db: '%s'",db));
if ((error=simple_command(mysql,COM_INIT_DB,db,(ulong) strlen(db),0)))
if ((error=simple_command(mysql,COM_INIT_DB, (const uchar*) db,
(ulong) strlen(db),0)))
DBUG_RETURN(error);
my_free(mysql->db,MYF(MY_ALLOW_ZERO_PTR));
mysql->db=my_strdup(db,MYF(MY_WME));
@ -2644,7 +2646,7 @@ void STDCALL mysql_close(MYSQL *mysql)
free_old_query(mysql);
mysql->status=MYSQL_STATUS_READY; /* Force command */
mysql->reconnect=0;
simple_command(mysql,COM_QUIT,NullS,0,1);
simple_command(mysql,COM_QUIT,(uchar*) 0,0,1);
end_server(mysql); /* Sets mysql->net.vio= 0 */
}
mysql_close_free_options(mysql);
@ -2775,7 +2777,7 @@ mysql_send_query(MYSQL* mysql, const char* query, ulong length)
mysql->last_used_con = mysql;
#endif
DBUG_RETURN(simple_command(mysql, COM_QUERY, query, length, 1));
DBUG_RETURN(simple_command(mysql, COM_QUERY, (uchar*) query, length, 1));
}

View file

@ -301,9 +301,6 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time,
field_length= 6; /* 6 digits */
}
continue;
/* No part seconds */
date[++i]= 0;
}
while (str != end &&
(my_ispunct(&my_charset_latin1,*str) ||
@ -569,12 +566,12 @@ my_bool str_to_time(const char *str, uint length, MYSQL_TIME *l_time,
/* Fix the date to assume that seconds was given */
if (!found_hours && !found_days)
{
bmove_upp((char*) (date+4), (char*) (date+state),
bmove_upp((uchar*) (date+4), (uchar*) (date+state),
sizeof(long)*(state-1));
bzero((char*) date, sizeof(long)*(4-state));
bzero((uchar*) date, sizeof(long)*(4-state));
}
else
bzero((char*) (date+state), sizeof(long)*(4-state));
bzero((uchar*) (date+state), sizeof(long)*(4-state));
}
fractional:

View file

@ -99,23 +99,23 @@ uchar *net_store_length(uchar *packet, ulonglong length)
if (length < (ulonglong) LL(251))
{
*packet=(uchar) length;
return (char*) packet+1;
return packet+1;
}
/* 251 is reserved for NULL */
if (length < (ulonglong) LL(65536))
{
*packet++=252;
int2store(packet,(uint) length);
return (char*) packet+2;
return packet+2;
}
if (length < (ulonglong) LL(16777216))
{
*packet++=253;
int3store(packet,(ulong) length);
return (char*) packet+3;
return packet+3;
}
*packet++=254;
int8store(packet,length);
return (char*) packet+8;
return packet+8;
}

View file

@ -28,9 +28,9 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
)
SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/message.rc
${CMAKE_SOURCE_DIR}/sql/message.h
${CMAKE_SOURCE_DIR}/sql/sql_yacc.h
${CMAKE_SOURCE_DIR}/sql/sql_yacc.cc
${CMAKE_SOURCE_DIR}/sql/message.h
${CMAKE_SOURCE_DIR}/sql/sql_yacc.h
${CMAKE_SOURCE_DIR}/sql/sql_yacc.cc
${CMAKE_SOURCE_DIR}/include/mysql_version.h
${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc
${CMAKE_SOURCE_DIR}/sql/lex_hash.h
@ -41,8 +41,8 @@ SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/sql/message.rc
ADD_DEFINITIONS(-DMYSQL_SERVER -D_CONSOLE -DHAVE_DLOPEN)
ADD_EXECUTABLE(mysqld${MYSQLD_EXE_SUFFIX}
../sql-common/client.c derror.cc des_key_file.cc
ADD_EXECUTABLE(mysqld
../sql-common/client.c derror.cc des_key_file.cc
discover.cc ../libmysql/errmsg.c field.cc field_conv.cc
filesort.cc gstream.cc
ha_partition.cc
@ -74,74 +74,91 @@ ADD_EXECUTABLE(mysqld${MYSQLD_EXE_SUFFIX}
sql_tablespace.cc events.cc ../sql-common/my_user.c
partition_info.cc rpl_utility.cc rpl_injector.cc sql_locale.cc
rpl_rli.cc rpl_mi.cc sql_servers.cc
sql_connect.cc scheduler.cc
sql_connect.cc scheduler.cc
${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
${PROJECT_SOURCE_DIR}/include/mysqld_error.h
${PROJECT_SOURCE_DIR}/include/mysqld_ername.h
${PROJECT_SOURCE_DIR}/include/sql_state.h
${PROJECT_SOURCE_DIR}/include/mysql_version.h
${PROJECT_SOURCE_DIR}/sql/sql_builtin.cc
${PROJECT_SOURCE_DIR}/sql/lex_hash.h)
TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX}
heap myisam myisammrg mysys yassl zlib debug dbug yassl
${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
${PROJECT_SOURCE_DIR}/include/mysqld_error.h
${PROJECT_SOURCE_DIR}/include/mysqld_ername.h
${PROJECT_SOURCE_DIR}/include/sql_state.h
${PROJECT_SOURCE_DIR}/include/mysql_version.h
${PROJECT_SOURCE_DIR}/sql/sql_builtin.cc
${PROJECT_SOURCE_DIR}/sql/lex_hash.h)
TARGET_LINK_LIBRARIES(mysqld
heap myisam myisammrg mysys yassl zlib debug dbug yassl
taocrypt strings vio regex wsock32 ws2_32)
SET_TARGET_PROPERTIES(mysqld PROPERTIES OUTPUT_NAME mysqld${MYSQLD_EXE_SUFFIX})
# Work around for 2.4.6 bug, OUTPUT_NAME will not set the right .PDB
# file name. Note that COMPILE_FLAGS set some temporary pdb during build,
# LINK_FLAGS sets the real one.
SET_TARGET_PROPERTIES(mysqld PROPERTIES
COMPILE_FLAGS "/Fd${CMAKE_CFG_INTDIR}/mysqld${MYSQLD_EXE_SUFFIX}.pdb"
LINK_FLAGS "/PDB:${CMAKE_CFG_INTDIR}/mysqld${MYSQLD_EXE_SUFFIX}.pdb")
IF(EMBED_MANIFESTS)
MYSQL_EMBED_MANIFEST("mysqld" "asInvoker")
ENDIF(EMBED_MANIFESTS)
IF(WITH_ARCHIVE_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX} archive)
TARGET_LINK_LIBRARIES(mysqld archive)
ENDIF(WITH_ARCHIVE_STORAGE_ENGINE)
IF(WITH_BLACKHOLE_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX} blackhole)
TARGET_LINK_LIBRARIES(mysqld blackhole)
ENDIF(WITH_BLACKHOLE_STORAGE_ENGINE)
IF(WITH_CSV_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX} csv)
TARGET_LINK_LIBRARIES(mysqld csv)
ENDIF(WITH_CSV_STORAGE_ENGINE)
IF(WITH_EXAMPLE_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX} example)
TARGET_LINK_LIBRARIES(mysqld example)
ENDIF(WITH_EXAMPLE_STORAGE_ENGINE)
IF(WITH_FEDERATED_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX} federated)
TARGET_LINK_LIBRARIES(mysqld federated)
ENDIF(WITH_FEDERATED_STORAGE_ENGINE)
IF(WITH_INNOBASE_STORAGE_ENGINE)
TARGET_LINK_LIBRARIES(mysqld${MYSQLD_EXE_SUFFIX} innobase)
TARGET_LINK_LIBRARIES(mysqld innobase)
ENDIF(WITH_INNOBASE_STORAGE_ENGINE)
ADD_DEPENDENCIES(mysqld${MYSQLD_EXE_SUFFIX} GenError)
ADD_DEPENDENCIES(mysqld GenError)
# NOTE CMake 2.4.6 creates strange dependencies between files in OUTPUT,
# so for now we only list one if more than one
# Sql Parser custom command
ADD_CUSTOM_COMMAND(
SOURCE ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy
OUTPUT ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
COMMAND bison.exe ARGS -y -p MYSQL --defines=sql_yacc.h
--output=sql_yacc.cc sql_yacc.yy
DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy)
OUTPUT ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
# ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
COMMAND bison.exe ARGS -y -p MYSQL --defines=sql_yacc.h
--output=sql_yacc.cc sql_yacc.yy
DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy)
ADD_CUSTOM_COMMAND(
OUTPUT ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
COMMAND echo
DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
)
# Windows message file
ADD_CUSTOM_COMMAND(
SOURCE message.mc
OUTPUT message.rc message.h
COMMAND mc ARGS message.mc
DEPENDS message.mc)
IF(WIN32)
# Windows message file
ADD_CUSTOM_COMMAND(
OUTPUT ${PROJECT_SOURCE_DIR}/sql/message.h
# ${PROJECT_SOURCE_DIR}/sql/message.rc
COMMAND mc ARGS message.mc
DEPENDS ${PROJECT_SOURCE_DIR}/sql/message.mc)
ENDIF(WIN32)
# Gen_lex_hash
ADD_EXECUTABLE(gen_lex_hash gen_lex_hash.cc)
TARGET_LINK_LIBRARIES(gen_lex_hash dbug mysqlclient wsock32)
TARGET_LINK_LIBRARIES(gen_lex_hash debug dbug mysqlclient wsock32)
GET_TARGET_PROPERTY(GEN_LEX_HASH_EXE gen_lex_hash LOCATION)
ADD_CUSTOM_COMMAND(
OUTPUT ${PROJECT_SOURCE_DIR}/sql/lex_hash.h
COMMAND ${GEN_LEX_HASH_EXE} ARGS > lex_hash.h
DEPENDS ${GEN_LEX_HASH_EXE}
)
ADD_DEPENDENCIES(mysqld${MYSQLD_EXE_SUFFIX} gen_lex_hash)
OUTPUT ${PROJECT_SOURCE_DIR}/sql/lex_hash.h
COMMAND ${GEN_LEX_HASH_EXE} ARGS > lex_hash.h
DEPENDS ${GEN_LEX_HASH_EXE})
ADD_CUSTOM_TARGET(
GenServerSource ALL
DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
# ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
${PROJECT_SOURCE_DIR}/sql/message.h
# ${PROJECT_SOURCE_DIR}/sql/message.rc
${PROJECT_SOURCE_DIR}/sql/lex_hash.h)
ADD_DEPENDENCIES(mysqld GenServerSource)
# Remove the auto-generated files as part of 'Clean Solution'
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES

View file

@ -390,8 +390,9 @@ Event_db_repository::index_read_for_db_for_i_s(THD *thd, TABLE *schema_table,
}
key_copy(key_buf, event_table->record[0], key_info, key_len);
if (!(ret= event_table->file->index_read(event_table->record[0], key_buf,
(key_part_map)1, HA_READ_PREFIX)))
if (!(ret= event_table->file->index_read_map(event_table->record[0], key_buf,
(key_part_map)1,
HA_READ_PREFIX)))
{
DBUG_PRINT("info",("Found rows. Let's retrieve them. ret=%d", ret));
do
@ -839,8 +840,8 @@ Event_db_repository::find_named_event(LEX_STRING db, LEX_STRING name,
key_copy(key, table->record[0], table->key_info, table->key_info->key_length);
if (table->file->index_read_idx(table->record[0], 0, key, HA_WHOLE_KEY,
HA_READ_KEY_EXACT))
if (table->file->index_read_idx_map(table->record[0], 0, key, HA_WHOLE_KEY,
HA_READ_KEY_EXACT))
{
DBUG_PRINT("info", ("Row not found"));
DBUG_RETURN(TRUE);

View file

@ -52,8 +52,9 @@
execute_at.second_part is not considered during comparison
*/
static int
event_queue_element_compare_q(void *vptr, uchar* a, uchar *b)
extern "C" int event_queue_element_compare_q(void *, uchar *, uchar *);
int event_queue_element_compare_q(void *vptr, uchar* a, uchar *b)
{
my_time_t lhs = ((Event_queue_element *)a)->execute_at;
my_time_t rhs = ((Event_queue_element *)b)->execute_at;

View file

@ -6172,12 +6172,12 @@ uint Field::is_equal(Create_field *new_field)
/* If one of the fields is binary and the other one isn't return 1 else 0 */
bool Field_str::compare_str_field_flags(Create_field *new_field, uint32 flags)
bool Field_str::compare_str_field_flags(Create_field *new_field, uint32 flag_arg)
{
return (((new_field->flags & (BINCMP_FLAG | BINARY_FLAG)) &&
!(flags & (BINCMP_FLAG | BINARY_FLAG))) ||
!(flag_arg & (BINCMP_FLAG | BINARY_FLAG))) ||
(!(new_field->flags & (BINCMP_FLAG | BINARY_FLAG)) &&
(flags & (BINCMP_FLAG | BINARY_FLAG))));
(flag_arg & (BINCMP_FLAG | BINARY_FLAG))));
}

View file

@ -1125,7 +1125,7 @@ int ha_partition::handle_opt_partitions(THD *thd, HA_CHECK_OPT *check_opt,
0 Success
*/
int ha_partition::prepare_new_partition(TABLE *table,
int ha_partition::prepare_new_partition(TABLE *tbl,
HA_CREATE_INFO *create_info,
handler *file, const char *part_name,
partition_element *p_elem)
@ -1134,13 +1134,13 @@ int ha_partition::prepare_new_partition(TABLE *table,
bool create_flag= FALSE;
DBUG_ENTER("prepare_new_partition");
if ((error= set_up_table_before_create(table, part_name, create_info,
if ((error= set_up_table_before_create(tbl, part_name, create_info,
0, p_elem)))
goto error;
if ((error= file->create(part_name, table, create_info)))
if ((error= file->create(part_name, tbl, create_info)))
goto error;
create_flag= TRUE;
if ((error= file->ha_open(table, part_name, m_mode, m_open_test_lock)))
if ((error= file->ha_open(tbl, part_name, m_mode, m_open_test_lock)))
goto error;
/*
Note: if you plan to add another call that may return failure,
@ -1776,7 +1776,7 @@ partition_element *ha_partition::find_partition_element(uint part_id)
4) Data file name on partition
*/
int ha_partition::set_up_table_before_create(TABLE *table,
int ha_partition::set_up_table_before_create(TABLE *tbl,
const char *partition_name_with_path,
HA_CREATE_INFO *info,
uint part_id,
@ -1793,8 +1793,8 @@ int ha_partition::set_up_table_before_create(TABLE *table,
if (!part_elem)
DBUG_RETURN(1); // Fatal error
}
table->s->max_rows= part_elem->part_max_rows;
table->s->min_rows= part_elem->part_min_rows;
tbl->s->max_rows= part_elem->part_max_rows;
tbl->s->min_rows= part_elem->part_min_rows;
partition_name= strrchr(partition_name_with_path, FN_LIBCHAR);
if ((part_elem->index_file_name &&
(error= append_file_to_dir(thd,
@ -3400,11 +3400,11 @@ int ha_partition::index_end()
used in conjuntion with multi read ranges.
*/
int ha_partition::index_read(uchar * buf, const uchar * key,
key_part_map keypart_map,
enum ha_rkey_function find_flag)
int ha_partition::index_read_map(uchar *buf, const uchar *key,
key_part_map keypart_map,
enum ha_rkey_function find_flag)
{
DBUG_ENTER("ha_partition::index_read");
DBUG_ENTER("ha_partition::index_read_map");
end_range= 0;
m_index_scan_type= partition_index_read;
@ -3566,7 +3566,7 @@ int ha_partition::common_first_last(uchar *buf)
index_read_last()
buf Read row in MySQL Row Format
key Key
keylen Length of key
keypart_map Which part of key is used
RETURN VALUE
>0 Error code
@ -3577,8 +3577,8 @@ int ha_partition::common_first_last(uchar *buf)
Can only be used on indexes supporting HA_READ_ORDER
*/
int ha_partition::index_read_last(uchar *buf, const uchar *key,
key_part_map keypart_map)
int ha_partition::index_read_last_map(uchar *buf, const uchar *key,
key_part_map keypart_map)
{
DBUG_ENTER("ha_partition::index_read_last");
@ -3929,9 +3929,9 @@ int ha_partition::handle_unordered_scan_next_partition(uchar * buf)
switch (m_index_scan_type) {
case partition_index_read:
DBUG_PRINT("info", ("index_read on partition %d", i));
error= file->index_read(buf, m_start_key.key,
m_start_key.keypart_map,
m_start_key.flag);
error= file->index_read_map(buf, m_start_key.key,
m_start_key.keypart_map,
m_start_key.flag);
break;
case partition_index_first:
DBUG_PRINT("info", ("index_first on partition %d", i));
@ -4020,10 +4020,10 @@ int ha_partition::handle_ordered_index_scan(uchar *buf, bool reverse_order)
switch (m_index_scan_type) {
case partition_index_read:
error= file->index_read(rec_buf_ptr,
m_start_key.key,
m_start_key.keypart_map,
m_start_key.flag);
error= file->index_read_map(rec_buf_ptr,
m_start_key.key,
m_start_key.keypart_map,
m_start_key.flag);
break;
case partition_index_first:
error= file->index_first(rec_buf_ptr);
@ -4034,9 +4034,9 @@ int ha_partition::handle_ordered_index_scan(uchar *buf, bool reverse_order)
reverse_order= TRUE;
break;
case partition_index_read_last:
error= file->index_read_last(rec_buf_ptr,
m_start_key.key,
m_start_key.keypart_map);
error= file->index_read_last_map(rec_buf_ptr,
m_start_key.key,
m_start_key.keypart_map);
reverse_order= TRUE;
break;
default:

View file

@ -387,9 +387,9 @@ public:
index_init initializes an index before using it and index_end does
any end processing needed.
*/
virtual int index_read(uchar * buf, const uchar * key,
key_part_map keypart_map,
enum ha_rkey_function find_flag);
virtual int index_read_map(uchar * buf, const uchar * key,
key_part_map keypart_map,
enum ha_rkey_function find_flag);
virtual int index_init(uint idx, bool sorted);
virtual int index_end();
@ -402,8 +402,8 @@ public:
virtual int index_first(uchar * buf);
virtual int index_last(uchar * buf);
virtual int index_next_same(uchar * buf, const uchar * key, uint keylen);
virtual int index_read_last(uchar * buf, const uchar * key,
key_part_map keypart_map);
virtual int index_read_last_map(uchar * buf, const uchar * key,
key_part_map keypart_map);
/*
read_first_row is virtual method but is only implemented by

View file

@ -25,8 +25,6 @@
#include "mysql_priv.h"
#include "rpl_filter.h"
#include <myisampack.h>
#include <errno.h>
@ -64,7 +62,7 @@ static const LEX_STRING sys_table_aliases[]=
};
const char *ha_row_type[] = {
"", "FIXED", "DYNAMIC", "COMPRESSED", "REDUNDANT", "COMPACT", "?","?","?"
"", "FIXED", "DYNAMIC", "COMPRESSED", "REDUNDANT", "COMPACT", "PAGE", "?","?","?"
};
const char *tx_isolation_names[] =
@ -1993,9 +1991,9 @@ void handler::get_auto_increment(ulonglong offset, ulonglong increment,
key_copy(key, table->record[0],
table->key_info + table->s->next_number_index,
table->s->next_number_key_offset);
error= index_read(table->record[1], key,
make_prev_keypart_map(table->s->next_number_keypart),
HA_READ_PREFIX_LAST);
error= index_read_map(table->record[1], key,
make_prev_keypart_map(table->s->next_number_keypart),
HA_READ_PREFIX_LAST);
/*
MySQL needs to call us for next row: assume we are inserting ("a",null)
here, we return 3, and next this statement will want to insert
@ -3218,10 +3216,10 @@ int handler::read_range_first(const key_range *start_key,
if (!start_key) // Read first record
result= index_first(table->record[0]);
else
result= index_read(table->record[0],
start_key->key,
start_key->keypart_map,
start_key->flag);
result= index_read_map(table->record[0],
start_key->key,
start_key->keypart_map,
start_key->flag);
if (result)
DBUG_RETURN((result == HA_ERR_KEY_NOT_FOUND)
? HA_ERR_END_OF_FILE
@ -3293,15 +3291,15 @@ int handler::compare_key(key_range *range)
}
int handler::index_read_idx(uchar * buf, uint index, const uchar * key,
key_part_map keypart_map,
enum ha_rkey_function find_flag)
int handler::index_read_idx_map(uchar * buf, uint index, const uchar * key,
key_part_map keypart_map,
enum ha_rkey_function find_flag)
{
int error, error1;
error= index_init(index, 0);
if (!error)
{
error= index_read(buf, key, keypart_map, find_flag);
error= index_read_map(buf, key, keypart_map, find_flag);
error1= index_end();
}
return error ? error : error1;

View file

@ -278,7 +278,7 @@ enum legacy_db_type
enum row_type { ROW_TYPE_NOT_USED=-1, ROW_TYPE_DEFAULT, ROW_TYPE_FIXED,
ROW_TYPE_DYNAMIC, ROW_TYPE_COMPRESSED,
ROW_TYPE_REDUNDANT, ROW_TYPE_COMPACT, ROW_TYPE_PAGES };
ROW_TYPE_REDUNDANT, ROW_TYPE_COMPACT, ROW_TYPE_PAGE };
enum enum_binlog_func {
BFN_RESET_LOGS= 1,
@ -321,6 +321,7 @@ enum enum_binlog_command {
#define HA_CREATE_USED_PASSWORD (1L << 17)
#define HA_CREATE_USED_CONNECTION (1L << 18)
#define HA_CREATE_USED_KEY_BLOCK_SIZE (1L << 19)
#define HA_CREATE_USED_TRANSACTIONAL (1L << 20)
typedef ulonglong my_xid; // this line is the same as in log_event.h
#define MYSQL_XID_PREFIX "MySQLXid"
@ -788,6 +789,7 @@ class partition_info;
struct st_partition_iter;
#define NOT_A_PARTITION_ID ((uint32)-1)
enum ha_choice { HA_CHOICE_UNDEF, HA_CHOICE_NO, HA_CHOICE_YES };
typedef struct st_ha_create_information
{
@ -810,6 +812,8 @@ typedef struct st_ha_create_information
uint options; /* OR of HA_CREATE_ options */
uint merge_insert_method;
uint extra_size; /* length of extra data segment */
/* 0 not used, 1 if not transactional, 2 if transactional */
enum ha_choice transactional;
bool table_existed; /* 1 in create if table existed */
bool frm_only; /* 1 if no ha_create_table() */
bool varchar; /* 1 if table has a VARCHAR */
@ -1277,27 +1281,28 @@ public:
enum ha_rkey_function find_flag)
{ return HA_ERR_WRONG_COMMAND; }
public:
/**
@brief
Positions an index cursor to the index specified in the handle. Fetches the
row if available. If the key value is null, begin at the first key of the
index.
*/
virtual int index_read(uchar * buf, const uchar * key, key_part_map keypart_map,
enum ha_rkey_function find_flag)
{
uint key_len= calculate_key_len(table, active_index, key, keypart_map);
return index_read(buf, key, key_len, find_flag);
}
/**
@brief
Positions an index cursor to the index specified in the handle. Fetches the
row if available. If the key value is null, begin at the first key of the
index.
*/
virtual int index_read_idx(uchar * buf, uint index, const uchar * key,
/**
@brief
Positions an index cursor to the index specified in the handle. Fetches the
row if available. If the key value is null, begin at the first key of the
index.
*/
virtual int index_read_map(uchar * buf, const uchar * key,
key_part_map keypart_map,
enum ha_rkey_function find_flag);
enum ha_rkey_function find_flag)
{
uint key_len= calculate_key_len(table, active_index, key, keypart_map);
return index_read(buf, key, key_len, find_flag);
}
/**
@brief
Positions an index cursor to the index specified in the handle. Fetches the
row if available. If the key value is null, begin at the first key of the
index.
*/
virtual int index_read_idx_map(uchar * buf, uint index, const uchar * key,
key_part_map keypart_map,
enum ha_rkey_function find_flag);
virtual int index_next(uchar * buf)
{ return HA_ERR_WRONG_COMMAND; }
virtual int index_prev(uchar * buf)
@ -1311,17 +1316,17 @@ public:
virtual int index_read_last(uchar * buf, const uchar * key, uint key_len)
{ return (my_errno=HA_ERR_WRONG_COMMAND); }
public:
/**
@brief
The following functions works like index_read, but it find the last
row with the current key value or prefix.
*/
virtual int index_read_last(uchar * buf, const uchar * key,
key_part_map keypart_map)
{
uint key_len= calculate_key_len(table, active_index, key, keypart_map);
return index_read_last(buf, key, key_len);
}
/**
@brief
The following functions works like index_read, but it find the last
row with the current key value or prefix.
*/
virtual int index_read_last_map(uchar * buf, const uchar * key,
key_part_map keypart_map)
{
uint key_len= calculate_key_len(table, active_index, key, keypart_map);
return index_read_last(buf, key, key_len);
}
virtual int read_multi_range_first(KEY_MULTI_RANGE **found_range_p,
KEY_MULTI_RANGE *ranges, uint range_count,
bool sorted, HANDLER_BUFFER *buffer);
@ -1864,7 +1869,7 @@ int ha_find_files(THD *thd,const char *db,const char *path,
int ha_table_exists_in_engine(THD* thd, const char* db, const char* name);
/* key cache */
int ha_init_key_cache(const char *name, KEY_CACHE *key_cache);
extern "C" int ha_init_key_cache(const char *name, KEY_CACHE *key_cache);
int ha_resize_key_cache(KEY_CACHE *key_cache);
int ha_change_key_cache_param(KEY_CACHE *key_cache);
int ha_change_key_cache(KEY_CACHE *old_key_cache, KEY_CACHE *new_key_cache);

View file

@ -3869,15 +3869,15 @@ bool Item_field::fix_fields(THD *thd, Item **reference)
if ((*res)->type() == Item::FIELD_ITEM)
{
/*
It's an Item_field referencing another Item_field in the select
list.
use the field from the Item_field in the select list and leave
the Item_field instance in place.
It's an Item_field referencing another Item_field in the select
list.
Use the field from the Item_field in the select list and leave
the Item_field instance in place.
*/
Field *field= (*((Item_field**)res))->field;
Field *new_field= (*((Item_field**)res))->field;
if (field == NULL)
if (new_field == NULL)
{
/* The column to which we link isn't valid. */
my_error(ER_BAD_FIELD_ERROR, MYF(0), (*res)->name,
@ -3885,7 +3885,7 @@ bool Item_field::fix_fields(THD *thd, Item **reference)
return(1);
}
set_field(field);
set_field(new_field);
return 0;
}
else

View file

@ -3017,11 +3017,11 @@ uchar *in_longlong::get_value(Item *item)
void in_datetime::set(uint pos,Item *item)
{
Item **tmp= &item;
Item **tmp_item= &item;
bool is_null;
struct packed_longlong *buff= &((packed_longlong*) base)[pos];
buff->val= get_datetime_value(thd, &tmp, 0, warn_item, &is_null);
buff->val= get_datetime_value(thd, &tmp_item, 0, warn_item, &is_null);
buff->unsigned_flag= 1L;
}

View file

@ -1158,7 +1158,6 @@ public:
class Item_func_in :public Item_func_opt_neg
{
public:
Item_result cmp_type;
/*
an array of values when the right hand arguments of IN
are all SQL constant and there are no nulls

View file

@ -4375,11 +4375,11 @@ int Item_func_set_user_var::save_in_field(Field *field, bool no_conversions,
else if (result_type() == DECIMAL_RESULT)
{
my_decimal decimal_value;
my_decimal *value= entry->val_decimal(&null_value, &decimal_value);
my_decimal *val= entry->val_decimal(&null_value, &decimal_value);
if (null_value)
return set_field_to_null(field);
field->set_notnull();
error=field->store_decimal(value);
error=field->store_decimal(val);
}
else
{

View file

@ -1049,6 +1049,23 @@ String *Item_str_conv::val_str(String *str)
}
void Item_func_lcase::fix_length_and_dec()
{
collation.set(args[0]->collation);
multiply= collation.collation->casedn_multiply;
converter= collation.collation->cset->casedn;
max_length= args[0]->max_length * multiply;
}
void Item_func_ucase::fix_length_and_dec()
{
collation.set(args[0]->collation);
multiply= collation.collation->caseup_multiply;
converter= collation.collation->cset->caseup;
max_length= args[0]->max_length * multiply;
}
String *Item_func_left::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);

View file

@ -145,8 +145,7 @@ class Item_str_conv :public Item_str_func
{
protected:
uint multiply;
size_t (*converter)(CHARSET_INFO *cs, char *src, size_t srclen,
char *dst, size_t dstlen);
my_charset_conv_case converter;
String tmp_value;
public:
Item_str_conv(Item *item) :Item_str_func(item) {}
@ -159,13 +158,7 @@ class Item_func_lcase :public Item_str_conv
public:
Item_func_lcase(Item *item) :Item_str_conv(item) {}
const char *func_name() const { return "lcase"; }
void fix_length_and_dec()
{
collation.set(args[0]->collation);
multiply= collation.collation->casedn_multiply;
converter= collation.collation->cset->casedn;
max_length= args[0]->max_length * multiply;
}
void fix_length_and_dec();
};
class Item_func_ucase :public Item_str_conv
@ -173,13 +166,7 @@ class Item_func_ucase :public Item_str_conv
public:
Item_func_ucase(Item *item) :Item_str_conv(item) {}
const char *func_name() const { return "ucase"; }
void fix_length_and_dec()
{
collation.set(args[0]->collation);
multiply= collation.collation->caseup_multiply;
converter= collation.collation->cset->caseup;
max_length= args[0]->max_length * multiply;
}
void fix_length_and_dec();
};

View file

@ -2129,10 +2129,10 @@ int subselect_uniquesubquery_engine::exec()
if (!table->file->inited)
table->file->ha_index_init(tab->ref.key, 0);
error= table->file->index_read(table->record[0],
tab->ref.key_buff,
make_prev_keypart_map(tab->ref.key_parts),
HA_READ_KEY_EXACT);
error= table->file->index_read_map(table->record[0],
tab->ref.key_buff,
make_prev_keypart_map(tab->ref.key_parts),
HA_READ_KEY_EXACT);
if (error &&
error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE)
error= report_error(table, error);
@ -2239,10 +2239,10 @@ int subselect_indexsubquery_engine::exec()
if (!table->file->inited)
table->file->ha_index_init(tab->ref.key, 1);
error= table->file->index_read(table->record[0],
tab->ref.key_buff,
make_prev_keypart_map(tab->ref.key_parts),
HA_READ_KEY_EXACT);
error= table->file->index_read_map(table->record[0],
tab->ref.key_buff,
make_prev_keypart_map(tab->ref.key_parts),
HA_READ_KEY_EXACT);
if (error &&
error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE)
error= report_error(table, error);

View file

@ -570,13 +570,13 @@ String *Item_nodeset_func_rootelement::val_nodeset(String *nodeset)
String * Item_nodeset_func_union::val_nodeset(String *nodeset)
{
uint numnodes= pxml->length() / sizeof(MY_XML_NODE);
uint num_nodes= pxml->length() / sizeof(MY_XML_NODE);
String set0, *s0= args[0]->val_nodeset(&set0);
String set1, *s1= args[1]->val_nodeset(&set1);
String both_str;
both_str.alloc(numnodes);
both_str.alloc(num_nodes);
char *both= (char*) both_str.ptr();
bzero((void*)both, numnodes);
bzero((void*)both, num_nodes);
MY_XPATH_FLT *flt;
fltbeg= (MY_XPATH_FLT*) s0->ptr();
@ -590,7 +590,7 @@ String * Item_nodeset_func_union::val_nodeset(String *nodeset)
both[flt->num]= 1;
nodeset->length(0);
for (uint i= 0, pos= 0; i < numnodes; i++)
for (uint i= 0, pos= 0; i < num_nodes; i++)
{
if (both[i])
((XPathFilter*)nodeset)->append_element(i, pos++);
@ -2656,7 +2656,9 @@ static uint xml_parent_tag(MY_XML_NODE *items, uint nitems, uint level)
RETURN
Currently only MY_XML_OK
*/
static int xml_enter(MY_XML_PARSER *st,const char *attr, size_t len)
extern "C" int xml_enter(MY_XML_PARSER *st,const char *attr, size_t len);
int xml_enter(MY_XML_PARSER *st,const char *attr, size_t len)
{
MY_XML_USER_DATA *data= (MY_XML_USER_DATA*)st->user_data;
MY_XML_NODE *nodes= (MY_XML_NODE*) data->pxml->ptr();
@ -2687,7 +2689,9 @@ static int xml_enter(MY_XML_PARSER *st,const char *attr, size_t len)
RETURN
Currently only MY_XML_OK
*/
static int xml_value(MY_XML_PARSER *st,const char *attr, size_t len)
extern "C" int xml_value(MY_XML_PARSER *st,const char *attr, size_t len);
int xml_value(MY_XML_PARSER *st,const char *attr, size_t len)
{
MY_XML_USER_DATA *data= (MY_XML_USER_DATA*)st->user_data;
MY_XML_NODE *nodes= (MY_XML_NODE*) data->pxml->ptr();
@ -2717,7 +2721,9 @@ static int xml_value(MY_XML_PARSER *st,const char *attr, size_t len)
RETURN
Currently only MY_XML_OK
*/
static int xml_leave(MY_XML_PARSER *st,const char *attr, size_t len)
extern "C" int xml_leave(MY_XML_PARSER *st,const char *attr, size_t len);
int xml_leave(MY_XML_PARSER *st,const char *attr, size_t len)
{
MY_XML_USER_DATA *data= (MY_XML_USER_DATA*)st->user_data;
DBUG_ASSERT(data->level > 0);

View file

@ -480,6 +480,7 @@ int key_cmp(KEY_PART_INFO *key_part, const uchar *key, uint key_length)
rec0 Pointer to table->record[0]
first_rec Pointer to record compare with
second_rec Pointer to record compare against first_rec
DESCRIPTION
This method is set-up such that it can be called directly from the
priority queue and it is attempted to be optimised as much as possible

View file

@ -1934,7 +1934,7 @@ bool MYSQL_QUERY_LOG::write(time_t event_time, const char *user_host,
{
char buff[32];
uint length= 0;
char time_buff[MAX_TIME_SIZE];
char local_time_buff[MAX_TIME_SIZE];
struct tm start;
uint time_buff_len= 0;
@ -1950,13 +1950,13 @@ bool MYSQL_QUERY_LOG::write(time_t event_time, const char *user_host,
localtime_r(&event_time, &start);
time_buff_len= my_snprintf(time_buff, MAX_TIME_SIZE,
time_buff_len= my_snprintf(local_time_buff, MAX_TIME_SIZE,
"%02d%02d%02d %2d:%02d:%02d",
start.tm_year % 100, start.tm_mon + 1,
start.tm_mday, start.tm_hour,
start.tm_min, start.tm_sec);
if (my_b_write(&log_file, (uchar*) &time_buff, time_buff_len))
if (my_b_write(&log_file, (uchar*) local_time_buff, time_buff_len))
goto err;
}
else
@ -2346,8 +2346,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
s.flags|= LOG_EVENT_BINLOG_IN_USE_F;
if (!s.is_valid())
goto err;
if (null_created_arg)
s.created= 0;
s.dont_set_created= null_created_arg;
if (s.write(&log_file))
goto err;
bytes_written+= s.data_written;

View file

@ -456,7 +456,11 @@ Log_event::Log_event()
thd(0)
{
server_id= ::server_id;
when= my_time(0);
/*
We can't call my_time() here as this would cause a call before
my_init() is called
*/
when= 0;
log_pos= 0;
}
#endif /* !MYSQL_CLIENT */
@ -637,6 +641,7 @@ void Log_event::init_show_field_list(List<Item>* field_list)
bool Log_event::write_header(IO_CACHE* file, ulong event_data_length)
{
uchar header[LOG_EVENT_HEADER_LEN];
ulong now;
DBUG_ENTER("Log_event::write_header");
/* Store number of bytes that will be written by this event */
@ -687,6 +692,8 @@ bool Log_event::write_header(IO_CACHE* file, ulong event_data_length)
log_pos= my_b_safe_tell(file)+data_written;
}
now= (ulong) get_time(); // Query start time
/*
Header will be of size LOG_EVENT_HEADER_LEN for all events, except for
FORMAT_DESCRIPTION_EVENT and ROTATE_EVENT, where it will be
@ -694,7 +701,7 @@ bool Log_event::write_header(IO_CACHE* file, ulong event_data_length)
because we read them before knowing the format).
*/
int4store(header, (ulong) when); // timestamp
int4store(header, now); // timestamp
header[EVENT_TYPE_OFFSET]= get_type_code();
int4store(header+ SERVER_ID_OFFSET, server_id);
int4store(header+ EVENT_LEN_OFFSET, data_written);
@ -803,10 +810,12 @@ end:
#ifndef MYSQL_CLIENT
Log_event* Log_event::read_log_event(IO_CACHE* file,
pthread_mutex_t* log_lock,
const Format_description_log_event *description_event)
const Format_description_log_event
*description_event)
#else
Log_event* Log_event::read_log_event(IO_CACHE* file,
const Format_description_log_event *description_event)
const Format_description_log_event
*description_event)
#endif
{
DBUG_ENTER("Log_event::read_log_event");
@ -1461,7 +1470,7 @@ Query_log_event::Query_log_event()
/*
SYNOPSIS
Query_log_event::Query_log_event()
thd - thread handle
thd_arg - thread handle
query_arg - array of char representing the query
query_length - size of the `query_arg' array
using_trans - there is a modified transactional table
@ -1477,10 +1486,12 @@ Query_log_event::Query_log_event()
*/
Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg,
ulong query_length, bool using_trans,
bool suppress_use, THD::killed_state killed_status_arg)
bool suppress_use,
THD::killed_state killed_status_arg)
:Log_event(thd_arg,
(thd_arg->thread_specific_used ? LOG_EVENT_THREAD_SPECIFIC_F : 0) |
(suppress_use ? LOG_EVENT_SUPPRESS_USE_F : 0),
(thd_arg->thread_specific_used ? LOG_EVENT_THREAD_SPECIFIC_F :
0) |
(suppress_use ? LOG_EVENT_SUPPRESS_USE_F : 0),
using_trans),
data_buf(0), query(query_arg), catalog(thd_arg->catalog),
db(thd_arg->db), q_len((uint32) query_length),
@ -1501,10 +1512,10 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg,
error_code=
(killed_status_arg == THD::NOT_KILLED) ? thd_arg->net.last_errno :
((thd_arg->system_thread & SYSTEM_THREAD_DELAYED_INSERT) ? 0 :
thd->killed_errno());
thd_arg->killed_errno());
time(&end_time);
exec_time = (ulong) (end_time - thd->start_time);
exec_time = (ulong) (end_time - thd_arg->start_time);
catalog_len = (catalog) ? (uint32) strlen(catalog) : 0;
/* status_vars_len is set just before writing the event */
db_len = (db) ? (uint32) strlen(db) : 0;
@ -1513,15 +1524,15 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg,
/*
If we don't use flags2 for anything else than options contained in
thd->options, it would be more efficient to flags2=thd_arg->options
thd_arg->options, it would be more efficient to flags2=thd_arg->options
(OPTIONS_WRITTEN_TO_BINLOG would be used only at reading time).
But it's likely that we don't want to use 32 bits for 3 bits; in the future
we will probably want to reclaim the 29 bits. So we need the &.
*/
flags2= (uint32) (thd_arg->options & OPTIONS_WRITTEN_TO_BIN_LOG);
DBUG_ASSERT(thd->variables.character_set_client->number < 256*256);
DBUG_ASSERT(thd->variables.collation_connection->number < 256*256);
DBUG_ASSERT(thd->variables.collation_server->number < 256*256);
DBUG_ASSERT(thd_arg->variables.character_set_client->number < 256*256);
DBUG_ASSERT(thd_arg->variables.collation_connection->number < 256*256);
DBUG_ASSERT(thd_arg->variables.collation_server->number < 256*256);
int2store(charset, thd_arg->variables.character_set_client->number);
int2store(charset+2, thd_arg->variables.collation_connection->number);
int2store(charset+4, thd_arg->variables.collation_server->number);
@ -2247,9 +2258,10 @@ Muted_query_log_event::Muted_query_log_event()
**************************************************************************/
#ifndef MYSQL_CLIENT
Start_log_event_v3::Start_log_event_v3() :Log_event(), binlog_version(BINLOG_VERSION), artificial_event(0)
Start_log_event_v3::Start_log_event_v3()
:Log_event(), created(0), binlog_version(BINLOG_VERSION),
artificial_event(0), dont_set_created(0)
{
created= when;
memcpy(server_version, ::server_version, ST_SERVER_VER_LEN);
}
#endif
@ -2319,7 +2331,8 @@ void Start_log_event_v3::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
*/
Start_log_event_v3::Start_log_event_v3(const char* buf,
const Format_description_log_event* description_event)
const Format_description_log_event
*description_event)
:Log_event(buf, description_event)
{
buf+= description_event->common_header_len;
@ -2331,6 +2344,7 @@ Start_log_event_v3::Start_log_event_v3(const char* buf,
created= uint4korr(buf+ST_CREATED_OFFSET);
/* We use log_pos to mark if this was an artificial event or not */
artificial_event= (log_pos == 0);
dont_set_created= 1;
}
@ -2344,6 +2358,8 @@ bool Start_log_event_v3::write(IO_CACHE* file)
char buff[START_V3_HEADER_LEN];
int2store(buff + ST_BINLOG_VER_OFFSET,binlog_version);
memcpy(buff + ST_SERVER_VER_OFFSET,server_version,ST_SERVER_VER_LEN);
if (!dont_set_created)
created= when= get_time();
int4store(buff + ST_CREATED_OFFSET,created);
return (write_header(file, sizeof(buff)) ||
my_b_safe_write(file, (uchar*) buff, sizeof(buff)));
@ -2374,8 +2390,7 @@ bool Start_log_event_v3::write(IO_CACHE* file)
int Start_log_event_v3::do_apply_event(RELAY_LOG_INFO const *rli)
{
DBUG_ENTER("Start_log_event_v3::do_apply_event");
switch (binlog_version)
{
switch (binlog_version) {
case 3:
case 4:
/*
@ -2446,7 +2461,6 @@ Format_description_log_event::
Format_description_log_event(uint8 binlog_ver, const char* server_ver)
:Start_log_event_v3()
{
created= when;
binlog_version= binlog_ver;
switch (binlog_ver) {
case 4: /* MySQL 5.0 */
@ -2598,6 +2612,8 @@ bool Format_description_log_event::write(IO_CACHE* file)
uchar buff[FORMAT_DESCRIPTION_HEADER_LEN];
int2store(buff + ST_BINLOG_VER_OFFSET,binlog_version);
memcpy((char*) buff + ST_SERVER_VER_OFFSET,server_version,ST_SERVER_VER_LEN);
if (!dont_set_created)
created= when= get_time();
int4store(buff + ST_CREATED_OFFSET,created);
buff[ST_COMMON_HEADER_LEN_OFFSET]= LOG_EVENT_HEADER_LEN;
memcpy((char*) buff+ST_COMMON_HEADER_LEN_OFFSET+1, (uchar*) post_header_len,
@ -4904,8 +4920,9 @@ err:
*/
#ifndef MYSQL_CLIENT
Append_block_log_event::Append_block_log_event(THD* thd_arg, const char* db_arg,
char* block_arg,
Append_block_log_event::Append_block_log_event(THD *thd_arg,
const char *db_arg,
char *block_arg,
uint block_len_arg,
bool using_trans)
:Log_event(thd_arg,0, using_trans), block(block_arg),
@ -5154,7 +5171,8 @@ int Delete_file_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
*/
#ifndef MYSQL_CLIENT
Execute_load_log_event::Execute_load_log_event(THD *thd_arg, const char* db_arg,
Execute_load_log_event::Execute_load_log_event(THD *thd_arg,
const char* db_arg,
bool using_trans)
:Log_event(thd_arg, 0, using_trans), file_id(thd_arg->file_id), db(db_arg)
{
@ -5355,7 +5373,7 @@ int Begin_load_query_log_event::get_create_or_append() const
#ifndef MYSQL_CLIENT
Execute_load_query_log_event::
Execute_load_query_log_event(THD* thd_arg, const char* query_arg,
Execute_load_query_log_event(THD *thd_arg, const char* query_arg,
ulong query_length_arg, uint fn_pos_start_arg,
uint fn_pos_end_arg,
enum_load_dup_handling dup_handling_arg,
@ -7095,7 +7113,9 @@ int Write_rows_log_event::do_after_row_operations(TABLE *table, int error)
return error? error : local_error;
}
int Write_rows_log_event::do_prepare_row(THD *thd, RELAY_LOG_INFO const *rli,
int Write_rows_log_event::do_prepare_row(THD *thd_arg,
RELAY_LOG_INFO const *rli,
TABLE *table,
uchar const *const row_start,
uchar const **const row_end)
@ -7106,7 +7126,7 @@ int Write_rows_log_event::do_prepare_row(THD *thd, RELAY_LOG_INFO const *rli,
if (int error= unpack_row(rli, table, m_width, row_start, &m_cols, row_end,
&m_master_reclength, table->write_set, WRITE_ROWS_EVENT))
{
thd->net.last_errno= error;
thd_arg->net.last_errno= error;
return error;
}
bitmap_copy(table->read_set, table->write_set);
@ -7369,11 +7389,12 @@ replace_record(THD *thd, TABLE *table,
DBUG_RETURN(ENOMEM);
}
key_copy((uchar*)key.get(), table->record[0], table->key_info + keynum, 0);
error= table->file->index_read_idx(table->record[1], keynum,
(const uchar*)key.get(),
HA_WHOLE_KEY,
HA_READ_KEY_EXACT);
key_copy((uchar*)key.get(), table->record[0], table->key_info + keynum,
0);
error= table->file->index_read_idx_map(table->record[1], keynum,
(const uchar*)key.get(),
HA_WHOLE_KEY,
HA_READ_KEY_EXACT);
if (error)
{
table->file->print_error(error, MYF(0));
@ -7624,8 +7645,8 @@ static int find_and_fetch_row(TABLE *table, uchar *key)
my_ptrdiff_t const pos=
table->s->null_bytes > 0 ? table->s->null_bytes - 1 : 0;
table->record[1][pos]= 0xFF;
if ((error= table->file->index_read(table->record[1], key, HA_WHOLE_KEY,
HA_READ_KEY_EXACT)))
if ((error= table->file->index_read_map(table->record[1], key, HA_WHOLE_KEY,
HA_READ_KEY_EXACT)))
{
table->file->print_error(error, MYF(0));
table->file->ha_index_end();
@ -7825,7 +7846,8 @@ int Delete_rows_log_event::do_after_row_operations(TABLE *table, int error)
return error;
}
int Delete_rows_log_event::do_prepare_row(THD *thd, RELAY_LOG_INFO const *rli,
int Delete_rows_log_event::do_prepare_row(THD *thd_arg,
RELAY_LOG_INFO const *rli,
TABLE *table,
uchar const *const row_start,
uchar const **const row_end)
@ -7834,7 +7856,7 @@ int Delete_rows_log_event::do_prepare_row(THD *thd, RELAY_LOG_INFO const *rli,
if (int error= unpack_row(rli, table, m_width, row_start, &m_cols, row_end,
&m_master_reclength, table->read_set, DELETE_ROWS_EVENT))
{
thd->net.last_errno= error;
thd_arg->net.last_errno= error;
return error;
}
@ -7991,7 +8013,10 @@ int Update_rows_log_event::do_before_row_operations(TABLE *table)
int Update_rows_log_event::do_after_row_operations(TABLE *table, int error)
{
/*error= ToDo:find out what this should really be, this triggers close_scan in nbd, returning error?*/
/*
error= ToDo:find out what this should really be, this triggers
close_scan in nbd, returning error?
*/
table->file->ha_index_or_rnd_end();
my_free(m_memory, MYF(MY_ALLOW_ZERO_PTR));
m_memory= NULL;
@ -8001,7 +8026,8 @@ int Update_rows_log_event::do_after_row_operations(TABLE *table, int error)
return error;
}
int Update_rows_log_event::do_prepare_row(THD *thd, RELAY_LOG_INFO const *rli,
int Update_rows_log_event::do_prepare_row(THD *thd_arg,
RELAY_LOG_INFO const *rli,
TABLE *table,
uchar const *const row_start,
uchar const **const row_end)
@ -8016,9 +8042,10 @@ int Update_rows_log_event::do_prepare_row(THD *thd, RELAY_LOG_INFO const *rli,
/* record[0] is the before image for the update */
if ((error= unpack_row(rli, table, m_width, row_start, &m_cols, row_end,
&m_master_reclength, table->read_set, UPDATE_ROWS_EVENT)))
&m_master_reclength, table->read_set,
UPDATE_ROWS_EVENT)))
{
thd->net.last_errno= error;
thd_arg->net.last_errno= error;
return error;
}
@ -8026,9 +8053,10 @@ int Update_rows_log_event::do_prepare_row(THD *thd, RELAY_LOG_INFO const *rli,
uchar const *next_start = *row_end;
/* m_after_image is the after image for the update */
if ((error= unpack_row(rli, table, m_width, next_start, &m_cols_ai, row_end,
&m_master_reclength, table->write_set, UPDATE_ROWS_EVENT)))
&m_master_reclength, table->write_set,
UPDATE_ROWS_EVENT)))
{
thd->net.last_errno= error;
thd_arg->net.last_errno= error;
return error;
}
@ -8212,5 +8240,3 @@ Incident_log_event::write_data_body(IO_CACHE *file)
DBUG_ENTER("Incident_log_event::write_data_body");
DBUG_RETURN(write_str(file, m_message.str, m_message.length));
}

View file

@ -57,8 +57,8 @@
which increments every time we write an event to the binlog) (3 bytes).
Q: how do we handle when the counter is overflowed and restarts from 0 ?
- Query and Load (Create or Execute) events may have a more precise timestamp
(with microseconds), number of matched/affected/warnings rows
- Query and Load (Create or Execute) events may have a more precise
timestamp (with microseconds), number of matched/affected/warnings rows
and fields of session variables: SQL_MODE,
FOREIGN_KEY_CHECKS, UNIQUE_CHECKS, SQL_AUTO_IS_NULL, the collations and
charsets, the PASSWORD() version (old/new/...).
@ -708,7 +708,8 @@ public:
*/
static Log_event* read_log_event(IO_CACHE* file,
pthread_mutex_t* log_lock,
const Format_description_log_event *description_event);
const Format_description_log_event
*description_event);
static int read_log_event(IO_CACHE* file, String* packet,
pthread_mutex_t* log_lock);
/*
@ -736,7 +737,8 @@ public:
Log_event() : temp_buf(0) {}
/* avoid having to link mysqlbinlog against libpthread */
static Log_event* read_log_event(IO_CACHE* file,
const Format_description_log_event *description_event);
const Format_description_log_event
*description_event);
/* print*() functions are used by mysqlbinlog */
virtual void print(FILE* file, PRINT_EVENT_INFO* print_event_info) = 0;
void print_timestamp(IO_CACHE* file, time_t *ts = 0);
@ -772,12 +774,24 @@ public:
{ return 0; }
virtual bool write_data_body(IO_CACHE* file __attribute__((unused)))
{ return 0; }
inline time_t get_time()
{
THD *tmp_thd;
if (when)
return when;
if (thd)
return thd->start_time;
if ((tmp_thd= current_thd))
return tmp_thd->start_time;
return my_time(0);
}
#endif
virtual Log_event_type get_type_code() = 0;
virtual bool is_valid() const = 0;
virtual bool is_artificial_event() { return 0; }
inline bool get_cache_stmt() const { return cache_stmt; }
Log_event(const char* buf, const Format_description_log_event* description_event);
Log_event(const char* buf, const Format_description_log_event
*description_event);
virtual ~Log_event() { free_temp_buf();}
void register_temp_buf(char* buf) { temp_buf = buf; }
void free_temp_buf()
@ -800,6 +814,8 @@ public:
/* returns the human readable name of the event's type */
const char* get_type_str();
/* Return start of query time or current time */
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
public:
@ -811,7 +827,8 @@ public:
@see do_apply_event
*/
int apply_event(RELAY_LOG_INFO const *rli) {
int apply_event(RELAY_LOG_INFO const *rli)
{
return do_apply_event(rli);
}
@ -919,7 +936,6 @@ protected:
non-zero. The caller shall decrease the counter by one.
*/
virtual enum_skip_reason do_shall_skip(RELAY_LOG_INFO *rli);
#endif
};
@ -1151,7 +1167,8 @@ private:
char **fn_start, char **fn_end);
protected:
int copy_log_event(const char *buf, ulong event_len,
int body_offset, const Format_description_log_event* description_event);
int body_offset,
const Format_description_log_event* description_event);
public:
ulong thread_id;
@ -1296,6 +1313,11 @@ public:
setting log_event == 0 (for now).
*/
bool artificial_event;
/*
We set this to 1 if we don't want to have the created time in the log,
which is the case when we rollover to a new log.
*/
bool dont_set_created;
#ifndef MYSQL_CLIENT
Start_log_event_v3();
@ -1362,7 +1384,8 @@ public:
Format_description_log_event(uint8 binlog_ver, const char* server_ver=0);
Format_description_log_event(const char* buf, uint event_len,
const Format_description_log_event* description_event);
const Format_description_log_event
*description_event);
~Format_description_log_event() { my_free((uchar*)post_header_len, MYF(0)); }
Log_event_type get_type_code() { return FORMAT_DESCRIPTION_EVENT;}
#ifndef MYSQL_CLIENT
@ -1420,7 +1443,8 @@ public:
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
Intvar_log_event(const char* buf, const Format_description_log_event* description_event);
Intvar_log_event(const char* buf,
const Format_description_log_event *description_event);
~Intvar_log_event() {}
Log_event_type get_type_code() { return INTVAR_EVENT;}
const char* get_var_type_name();
@ -1467,7 +1491,8 @@ class Rand_log_event: public Log_event
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
Rand_log_event(const char* buf, const Format_description_log_event* description_event);
Rand_log_event(const char* buf,
const Format_description_log_event *description_event);
~Rand_log_event() {}
Log_event_type get_type_code() { return RAND_EVENT;}
int get_data_size() { return 16; /* sizeof(ulonglong) * 2*/ }
@ -1510,7 +1535,8 @@ class Xid_log_event: public Log_event
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
Xid_log_event(const char* buf, const Format_description_log_event* description_event);
Xid_log_event(const char* buf,
const Format_description_log_event *description_event);
~Xid_log_event() {}
Log_event_type get_type_code() { return XID_EVENT;}
int get_data_size() { return sizeof(xid); }
@ -1556,7 +1582,8 @@ public:
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
User_var_log_event(const char* buf, const Format_description_log_event* description_event);
User_var_log_event(const char* buf,
const Format_description_log_event *description_event);
~User_var_log_event() {}
Log_event_type get_type_code() { return USER_VAR_EVENT;}
#ifndef MYSQL_CLIENT
@ -1588,7 +1615,8 @@ public:
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
Stop_log_event(const char* buf, const Format_description_log_event* description_event):
Stop_log_event(const char* buf,
const Format_description_log_event *description_event):
Log_event(buf, description_event)
{}
~Stop_log_event() {}
@ -1697,7 +1725,8 @@ public:
#endif /* HAVE_REPLICATION */
#else
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
void print(FILE* file, PRINT_EVENT_INFO* print_event_info, bool enable_local);
void print(FILE* file, PRINT_EVENT_INFO* print_event_info,
bool enable_local);
#endif
Create_file_log_event(const char* buf, uint event_len,
@ -1772,7 +1801,8 @@ public:
#endif
Append_block_log_event(const char* buf, uint event_len,
const Format_description_log_event* description_event);
const Format_description_log_event
*description_event);
~Append_block_log_event() {}
Log_event_type get_type_code() { return APPEND_BLOCK_EVENT;}
int get_data_size() { return block_len + APPEND_BLOCK_HEADER_LEN ;}
@ -1808,7 +1838,8 @@ public:
#endif /* HAVE_REPLICATION */
#else
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
void print(FILE* file, PRINT_EVENT_INFO* print_event_info, bool enable_local);
void print(FILE* file, PRINT_EVENT_INFO* print_event_info,
bool enable_local);
#endif
Delete_file_log_event(const char* buf, uint event_len,
@ -1851,7 +1882,8 @@ public:
#endif
Execute_load_log_event(const char* buf, uint event_len,
const Format_description_log_event* description_event);
const Format_description_log_event
*description_event);
~Execute_load_log_event() {}
Log_event_type get_type_code() { return EXEC_LOAD_EVENT;}
int get_data_size() { return EXEC_LOAD_HEADER_LEN ;}
@ -1890,7 +1922,8 @@ public:
#endif /* HAVE_REPLICATION */
#endif
Begin_load_query_log_event(const char* buf, uint event_len,
const Format_description_log_event* description_event);
const Format_description_log_event
*description_event);
~Begin_load_query_log_event() {}
Log_event_type get_type_code() { return BEGIN_LOAD_QUERY_EVENT; }
};
@ -1942,7 +1975,8 @@ public:
const char *local_fname);
#endif
Execute_load_query_log_event(const char* buf, uint event_len,
const Format_description_log_event *description_event);
const Format_description_log_event
*description_event);
~Execute_load_query_log_event() {}
Log_event_type get_type_code() { return EXECUTE_LOAD_QUERY_EVENT; }
@ -1969,7 +2003,8 @@ public:
Log_event's ctor, this way we can extract maximum information from the
event's header (the unique ID for example).
*/
Unknown_log_event(const char* buf, const Format_description_log_event* description_event):
Unknown_log_event(const char* buf,
const Format_description_log_event *description_event):
Log_event(buf, description_event)
{}
~Unknown_log_event() {}

View file

@ -5,7 +5,7 @@
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
int
Write_rows_log_event_old::do_prepare_row(THD *thd,
Write_rows_log_event_old::do_prepare_row(THD *thd_arg,
RELAY_LOG_INFO const *rli,
TABLE *table,
uchar const *row_start,
@ -25,7 +25,7 @@ Write_rows_log_event_old::do_prepare_row(THD *thd,
int
Delete_rows_log_event_old::do_prepare_row(THD *thd,
Delete_rows_log_event_old::do_prepare_row(THD *thd_arg,
RELAY_LOG_INFO const *rli,
TABLE *table,
uchar const *row_start,
@ -58,7 +58,7 @@ Delete_rows_log_event_old::do_prepare_row(THD *thd,
}
int Update_rows_log_event_old::do_prepare_row(THD *thd,
int Update_rows_log_event_old::do_prepare_row(THD *thd_arg,
RELAY_LOG_INFO const *rli,
TABLE *table,
uchar const *row_start,

View file

@ -168,7 +168,7 @@ public:
protected:
Object_creation_ctx() {}
virtual Object_creation_ctx *create_backup_ctx(THD *thd) = 0;
virtual Object_creation_ctx *create_backup_ctx(THD *thd) const = 0;
virtual void change_env(THD *thd) const = 0;
@ -204,7 +204,7 @@ protected:
CHARSET_INFO *connection_cl);
protected:
virtual Object_creation_ctx *create_backup_ctx(THD *thd);
virtual Object_creation_ctx *create_backup_ctx(THD *thd) const;
virtual void change_env(THD *thd) const;
@ -1643,7 +1643,7 @@ bool key_cmp_if_same(TABLE *form,const uchar *key,uint index,uint key_length);
void key_unpack(String *to,TABLE *form,uint index);
bool is_key_used(TABLE *table, uint idx, const MY_BITMAP *fields);
int key_cmp(KEY_PART_INFO *key_part, const uchar *key, uint key_length);
int key_rec_cmp(void *key_info, uchar *a, uchar *b);
extern "C" int key_rec_cmp(void *key_info, uchar *a, uchar *b);
bool init_errmessage(void);
#endif /* MYSQL_SERVER */

View file

@ -693,7 +693,7 @@ struct st_VioSSLFd *ssl_acceptor_fd;
pthread_handler_t signal_hand(void *arg);
static void mysql_init_variables(void);
static void get_options(int *argc,char **argv);
static my_bool get_one_option(int, const struct my_option *, char *);
extern "C" my_bool mysqld_get_one_option(int, const struct my_option *, char *);
static void set_server_version(void);
static int init_thread_environment();
static char *get_relative_path(const char *path);
@ -1141,6 +1141,7 @@ void unireg_end(void)
extern "C" void unireg_abort(int exit_code)
{
DBUG_ENTER("unireg_abort");
if (exit_code)
sql_print_error("Aborting\n");
else if (opt_help)
@ -2353,7 +2354,7 @@ static void init_signals(void)
sigaddset(&set,SIGTSTP);
#endif
if (thd_lib_detected != THD_LIB_LT)
sigaddset(&set,THR_SERVER_ALARM);
sigaddset(&set,THR_SERVER_ALARM);
if (test_flags & TEST_SIGINT)
{
// May be SIGINT
@ -2549,7 +2550,9 @@ static void check_data_home(const char *path)
/* ARGSUSED */
static int my_message_sql(uint error, const char *str, myf MyFlags)
extern "C" int my_message_sql(uint error, const char *str, myf MyFlags);
int my_message_sql(uint error, const char *str, myf MyFlags)
{
THD *thd;
DBUG_ENTER("my_message_sql");
@ -2612,13 +2615,16 @@ static int my_message_sql(uint error, const char *str, myf MyFlags)
#ifndef EMBEDDED_LIBRARY
static void *my_str_malloc_mysqld(size_t size)
extern "C" void *my_str_malloc_mysqld(size_t size);
extern "C" void my_str_free_mysqld(void *ptr);
void *my_str_malloc_mysqld(size_t size)
{
return my_malloc(size, MYF(MY_FAE));
}
static void my_str_free_mysqld(void *ptr)
void my_str_free_mysqld(void *ptr)
{
my_free((uchar*)ptr, MYF(MY_FAE));
}
@ -3418,7 +3424,7 @@ server.");
my_getopt_skip_unknown= 0;
if ((ho_error= handle_options(&defaults_argc, &tmp_argv, no_opts,
get_one_option)))
mysqld_get_one_option)))
unireg_abort(ho_error);
if (defaults_argc)
@ -3902,7 +3908,6 @@ we force server id to 2, but this MySQL server will not act as a slave.");
*/
if (init_slave() && !active_mi)
{
end_thr_alarm(1); // Don't allow alarms
unireg_abort(1);
}
@ -3910,16 +3915,12 @@ we force server id to 2, but this MySQL server will not act as a slave.");
{
select_thread_in_use= 0; // Allow 'kill' to work
bootstrap(stdin);
end_thr_alarm(1); // Don't allow alarms
unireg_abort(bootstrap_error ? 1 : 0);
}
if (opt_init_file)
{
if (read_init_file(opt_init_file))
{
end_thr_alarm(1); // Don't allow alarms
unireg_abort(1);
}
}
execute_ddl_log_recovery();
@ -6873,6 +6874,7 @@ SHOW_VAR status_vars[]= {
{"Open_streams", (char*) &my_stream_opened, SHOW_LONG_NOFLUSH},
{"Open_table_definitions", (char*) &show_table_definitions, SHOW_FUNC},
{"Open_tables", (char*) &show_open_tables, SHOW_FUNC},
{"Opened_files", (char*) &my_file_total_opened, SHOW_LONG_NOFLUSH},
{"Opened_tables", (char*) offsetof(STATUS_VAR, opened_tables), SHOW_LONG_STATUS},
{"Prepared_stmt_count", (char*) &show_prepared_stmt_count, SHOW_FUNC},
#ifdef HAVE_QUERY_CACHE
@ -7240,9 +7242,10 @@ static void mysql_init_variables(void)
}
static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument)
my_bool
mysqld_get_one_option(int optid,
const struct my_option *opt __attribute__((unused)),
char *argument)
{
switch(optid) {
case '#':
@ -7738,7 +7741,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
/* Handle arguments for multiple key caches */
static uchar* *
extern "C" uchar **mysql_getopt_value(const char *keyname, uint key_length,
const struct my_option *option);
uchar* *
mysql_getopt_value(const char *keyname, uint key_length,
const struct my_option *option)
{
@ -7767,11 +7773,19 @@ mysql_getopt_value(const char *keyname, uint key_length,
}
static void option_error_reporter(enum loglevel level, const char *format, ...)
extern "C" void option_error_reporter(enum loglevel level, const char *format, ...);
void option_error_reporter(enum loglevel level, const char *format, ...)
{
va_list args;
va_start(args, format);
vprint_msg_to_log(level, format, args);
/* Don't print warnings for --loose options during bootstrap */
if (level == ERROR_LEVEL || !opt_bootstrap ||
global_system_variables.log_warnings)
{
vprint_msg_to_log(level, format, args);
}
va_end(args);
}
@ -7789,7 +7803,7 @@ static void get_options(int *argc,char **argv)
my_getopt_skip_unknown= TRUE;
if ((ho_error= handle_options(argc, &argv, my_long_options,
get_one_option)))
mysqld_get_one_option)))
exit(ho_error);
(*argc)++; /* add back one for the progname handle_options removes */
/* no need to do this for argv as we are discarding it. */
@ -8150,7 +8164,7 @@ void refresh_status(THD *thd)
add_to_status(&global_status_var, &thd->status_var);
/* Reset thread's status variables */
bzero((char*) &thd->status_var, sizeof(thd->status_var));
bzero((uchar*) &thd->status_var, sizeof(thd->status_var));
/* Reset some global variables */
reset_status_vars();

View file

@ -8375,7 +8375,8 @@ int QUICK_RANGE_SELECT::get_next_prefix(uint prefix_length,
{
/* Read the next record in the same range with prefix after cur_prefix. */
DBUG_ASSERT(cur_prefix != 0);
result= file->index_read(record, cur_prefix, keypart_map, HA_READ_AFTER_KEY);
result= file->index_read_map(record, cur_prefix, keypart_map,
HA_READ_AFTER_KEY);
if (result || (file->compare_key(file->end_range) <= 0))
DBUG_RETURN(result);
}
@ -8446,9 +8447,10 @@ int QUICK_RANGE_SELECT_GEOM::get_next()
}
last_range= *(cur_range++);
result= file->index_read(record, last_range->min_key,
last_range->min_keypart_map,
(ha_rkey_function)(last_range->flag ^ GEOM_FLAG));
result= file->index_read_map(record, last_range->min_key,
last_range->min_keypart_map,
(ha_rkey_function)(last_range->flag ^
GEOM_FLAG));
if (result != HA_ERR_KEY_NOT_FOUND && result != HA_ERR_END_OF_FILE)
DBUG_RETURN(result);
last_range= 0; // Not found, to next range
@ -8579,18 +8581,19 @@ int QUICK_SELECT_DESC::get_next()
if (last_range->flag & EQ_RANGE)
{
result = file->index_read(record, last_range->max_key,
last_range->max_keypart_map, HA_READ_KEY_EXACT);
result = file->index_read_map(record, last_range->max_key,
last_range->max_keypart_map,
HA_READ_KEY_EXACT);
}
else
{
DBUG_ASSERT(last_range->flag & NEAR_MAX ||
range_reads_after_key(last_range));
result=file->index_read(record, last_range->max_key,
last_range->max_keypart_map,
((last_range->flag & NEAR_MAX) ?
HA_READ_BEFORE_KEY :
HA_READ_PREFIX_LAST_OR_PREV));
result=file->index_read_map(record, last_range->max_key,
last_range->max_keypart_map,
((last_range->flag & NEAR_MAX) ?
HA_READ_BEFORE_KEY :
HA_READ_PREFIX_LAST_OR_PREV));
}
if (result)
{
@ -10446,9 +10449,9 @@ int QUICK_GROUP_MIN_MAX_SELECT::get_next()
first sub-group with the extended prefix.
*/
if (!have_min && !have_max && key_infix_len > 0)
result= file->index_read(record, group_prefix,
make_prev_keypart_map(real_key_parts),
HA_READ_KEY_EXACT);
result= file->index_read_map(record, group_prefix,
make_prev_keypart_map(real_key_parts),
HA_READ_KEY_EXACT);
result= have_min ? min_res : have_max ? max_res : result;
} while ((result == HA_ERR_KEY_NOT_FOUND || result == HA_ERR_END_OF_FILE) &&
@ -10510,9 +10513,9 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_min()
/* Apply the constant equality conditions to the non-group select fields */
if (key_infix_len > 0)
{
if ((result= file->index_read(record, group_prefix,
make_prev_keypart_map(real_key_parts),
HA_READ_KEY_EXACT)))
if ((result= file->index_read_map(record, group_prefix,
make_prev_keypart_map(real_key_parts),
HA_READ_KEY_EXACT)))
DBUG_RETURN(result);
}
@ -10527,9 +10530,9 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_min()
{
/* Find the first subsequent record without NULL in the MIN/MAX field. */
key_copy(tmp_record, record, index_info, 0);
result= file->index_read(record, tmp_record,
make_keypart_map(real_key_parts),
HA_READ_AFTER_KEY);
result= file->index_read_map(record, tmp_record,
make_keypart_map(real_key_parts),
HA_READ_AFTER_KEY);
/*
Check if the new record belongs to the current group by comparing its
prefix with the group's prefix. If it is from the next group, then the
@ -10584,9 +10587,9 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_max()
if (min_max_ranges.elements > 0)
result= next_max_in_range();
else
result= file->index_read(record, group_prefix,
make_prev_keypart_map(real_key_parts),
HA_READ_PREFIX_LAST);
result= file->index_read_map(record, group_prefix,
make_prev_keypart_map(real_key_parts),
HA_READ_PREFIX_LAST);
DBUG_RETURN(result);
}
@ -10637,9 +10640,9 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_prefix()
else
{
/* Load the first key in this group into record. */
result= file->index_read(record, group_prefix,
make_prev_keypart_map(group_key_parts),
HA_READ_AFTER_KEY);
result= file->index_read_map(record, group_prefix,
make_prev_keypart_map(group_key_parts),
HA_READ_AFTER_KEY);
if (result)
DBUG_RETURN(result);
}
@ -10716,7 +10719,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_min_in_range()
HA_READ_AFTER_KEY : HA_READ_KEY_OR_NEXT;
}
result= file->index_read(record, group_prefix, keypart_map, find_flag);
result= file->index_read_map(record, group_prefix, keypart_map, find_flag);
if (result)
{
if ((result == HA_ERR_KEY_NOT_FOUND || result == HA_ERR_END_OF_FILE) &&
@ -10849,7 +10852,7 @@ int QUICK_GROUP_MIN_MAX_SELECT::next_max_in_range()
HA_READ_BEFORE_KEY : HA_READ_PREFIX_LAST_OR_PREV;
}
result= file->index_read(record, group_prefix, keypart_map, find_flag);
result= file->index_read_map(record, group_prefix, keypart_map, find_flag);
if (result)
{

View file

@ -270,9 +270,10 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
Closed interval: Either The MIN argument is non-nullable, or
we have a >= predicate for the MIN argument.
*/
error= table->file->index_read(table->record[0], ref.key_buff,
make_prev_keypart_map(ref.key_parts),
HA_READ_KEY_OR_NEXT);
error= table->file->index_read_map(table->record[0],
ref.key_buff,
make_prev_keypart_map(ref.key_parts),
HA_READ_KEY_OR_NEXT);
else
{
/*
@ -281,9 +282,10 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
2) there is a > predicate on it, nullability is irrelevant.
We need to scan the next bigger record first.
*/
error= table->file->index_read(table->record[0], ref.key_buff,
make_prev_keypart_map(ref.key_parts),
HA_READ_AFTER_KEY);
error= table->file->index_read_map(table->record[0],
ref.key_buff,
make_prev_keypart_map(ref.key_parts),
HA_READ_AFTER_KEY);
/*
If the found record is outside the group formed by the search
prefix, or there is no such record at all, check if all
@ -305,9 +307,10 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
key_cmp_if_same(table, ref.key_buff, ref.key, prefix_len)))
{
DBUG_ASSERT(item_field->field->real_maybe_null());
error= table->file->index_read(table->record[0], ref.key_buff,
make_prev_keypart_map(ref.key_parts),
HA_READ_KEY_EXACT);
error= table->file->index_read_map(table->record[0],
ref.key_buff,
make_prev_keypart_map(ref.key_parts),
HA_READ_KEY_EXACT);
}
}
}
@ -394,11 +397,11 @@ int opt_sum_query(TABLE_LIST *tables, List<Item> &all_fields,COND *conds)
if (!ref.key_length)
error= table->file->index_last(table->record[0]);
else
error= table->file->index_read(table->record[0], key_buff,
make_prev_keypart_map(ref.key_parts),
range_fl & NEAR_MAX ?
HA_READ_BEFORE_KEY :
HA_READ_PREFIX_LAST_OR_PREV);
error= table->file->index_read_map(table->record[0], key_buff,
make_prev_keypart_map(ref.key_parts),
range_fl & NEAR_MAX ?
HA_READ_BEFORE_KEY :
HA_READ_PREFIX_LAST_OR_PREV);
if (!error && reckey_in_range(1, &ref, item_field->field,
conds, range_fl, prefix_len))
error= HA_ERR_KEY_NOT_FOUND;

View file

@ -91,10 +91,10 @@ partition_info *partition_info::get_clone()
#define MAX_PART_NAME_SIZE 8
char *partition_info::create_default_partition_names(uint part_no,
uint no_parts,
uint no_parts_arg,
uint start_no)
{
char *ptr= (char*) sql_calloc(no_parts*MAX_PART_NAME_SIZE);
char *ptr= (char*) sql_calloc(no_parts_arg*MAX_PART_NAME_SIZE);
char *move_ptr= ptr;
uint i= 0;
DBUG_ENTER("create_default_partition_names");
@ -105,11 +105,11 @@ char *partition_info::create_default_partition_names(uint part_no,
{
my_sprintf(move_ptr, (move_ptr,"p%u", (start_no + i)));
move_ptr+=MAX_PART_NAME_SIZE;
} while (++i < no_parts);
} while (++i < no_parts_arg);
}
else
{
mem_alloc_error(no_parts*MAX_PART_NAME_SIZE);
mem_alloc_error(no_parts_arg*MAX_PART_NAME_SIZE);
}
DBUG_RETURN(ptr);
}

View file

@ -362,9 +362,11 @@ Rpl_filter::add_ignore_db(const char* table_spec)
ignore_db.push_back(db);
}
extern "C" uchar *get_table_key(const uchar *, size_t *, my_bool);
extern "C" void free_table_ent(void* a);
static uchar* get_table_key(const uchar* a, size_t *len,
my_bool __attribute__((unused)))
uchar *get_table_key(const uchar* a, size_t *len,
my_bool __attribute__((unused)))
{
TABLE_RULE_ENT *e= (TABLE_RULE_ENT *) a;
@ -373,7 +375,7 @@ static uchar* get_table_key(const uchar* a, size_t *len,
}
static void free_table_ent(void* a)
void free_table_ent(void* a)
{
TABLE_RULE_ENT *e= (TABLE_RULE_ENT *) a;

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