diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-07-02 22:12:12 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-07-02 22:12:12 +0200 |
commit | b4a0b2c2f862ab0de853dc34e1e56f6159043e45 (patch) | |
tree | 18a0c25fdc9ac0076da19247666414a46434b85e | |
parent | 9809f05199aeb0b67991fac41bd86f38730768dc (diff) | |
download | mariadb-git-b4a0b2c2f862ab0de853dc34e1e56f6159043e45.tar.gz |
post-merge fixes.
most tests pass.
5.3 merge is next
221 files changed, 2067 insertions, 1877 deletions
@@ -1,4 +1,4 @@ MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MINOR=5 MYSQL_VERSION_PATCH=15 -MYSQL_VERSION_EXTRA= +MYSQL_VERSION_EXTRA=-MariaDB diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 0cfb70ed028..14a9cc6556b 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -37,13 +37,12 @@ #include "sql_common.h" #include <welcome_copyright_notice.h> // ORACLE_WELCOME_COPYRIGHT_NOTICE -/* Needed for Rpl_filter */ -CHARSET_INFO* system_charset_info= &my_charset_utf8_general_ci; - #include "sql_string.h" // needed for Rpl_filter #include "sql_list.h" // needed for Rpl_filter #include "rpl_filter.h" +#include "mysqld.h" + Rpl_filter *binlog_filter; #define BIN_LOG_HEADER_SIZE 4 @@ -52,6 +51,9 @@ Rpl_filter *binlog_filter; #define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_LOCAL_FILES) +/* Needed for Rpl_filter */ +CHARSET_INFO* system_charset_info= &my_charset_utf8_general_ci; + char server_version[SERVER_VERSION_LENGTH]; ulong server_id = 0; @@ -66,7 +68,7 @@ static FILE *result_file; #ifndef DBUG_OFF static const char* default_dbug_option = "d:t:o,/tmp/mysqlbinlog.trace"; #endif -static const char *load_default_groups[]= { "mysqlbinlog","client",0 }; +static const char *load_groups[]= { "mysqlbinlog","client",0 }; static void error(const char *format, ...) ATTRIBUTE_FORMAT(printf, 1, 2); static void warning(const char *format, ...) ATTRIBUTE_FORMAT(printf, 1, 2); @@ -89,7 +91,7 @@ static char* host = 0; static int port= 0; static uint my_end_arg; static const char* sock= 0; -static char *opt_plugin_dir= 0, *opt_default_auth= 0; +static char *opt_plugindir= 0, *opt_default_auth= 0; #ifdef HAVE_SMEM static char *shared_memory_base_name= 0; @@ -449,7 +451,7 @@ Exit_status Load_log_processor::process_first_event(const char *bname, ptr= fname + target_dir_name_len; memcpy(ptr,bname,blen); ptr+= blen; - ptr+= my_sprintf(ptr, (ptr, "-%x", file_id)); + ptr+= sprintf(ptr, "-%x", file_id); if ((file= create_unique_file(fname,ptr)) < 0) { @@ -1069,7 +1071,7 @@ end: } -static struct my_option my_long_options[] = +static struct my_option my_options[] = { {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -1139,7 +1141,7 @@ static struct my_option my_long_options[] = {"password", 'p', "Password to connect to remote server.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.", - &opt_plugin_dir, &opt_plugin_dir, 0, + &opt_plugindir, &opt_plugindir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"port", 'P', "Port number to use for connection or 0 for default to, in " "order of preference, my.cnf, $MYSQL_TCP_PORT, " @@ -1327,8 +1329,8 @@ static void usage() Dumps a MySQL binary log in a format usable for viewing or for piping to\n\ the mysql command line client.\n\n"); printf("Usage: %s [options] log-files\n", my_progname); - my_print_help(my_long_options); - my_print_variables(my_long_options); + my_print_help(my_options); + my_print_variables(my_options); } @@ -1482,7 +1484,7 @@ static int parse_args(int *argc, char*** argv) int ho_error; result_file = stdout; - if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option))) + if ((ho_error=handle_options(argc, argv, my_options, get_one_option))) exit(ho_error); if (debug_info_flag) my_end_arg= MY_CHECK_ERROR | MY_GIVE_INFO; @@ -1513,8 +1515,8 @@ static Exit_status safe_connect() return ERROR_STOP; } - if (opt_plugin_dir && *opt_plugin_dir) - mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir); + if (opt_plugindir && *opt_plugindir) + mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugindir); if (opt_default_auth && *opt_default_auth) mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth); @@ -2157,7 +2159,7 @@ int main(int argc, char** argv) exit(1); } - if (load_defaults("my", load_default_groups, &argc, &argv)) + if (load_defaults("my", load_groups, &argc, &argv)) exit(1); defaults_argv= argv; diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index c4242e1331e..884326e3d7b 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -750,8 +750,7 @@ static int handle_request_for_tables(char *tables, uint length) if (opt_all_in_1) { /* No backticks here as we added them before */ - query_length= my_sprintf(query, - (query, "%s TABLE %s %s", op, tables, options)); + query_length= sprintf(query, "%s TABLE %s %s", op, tables, options); } else { diff --git a/configure.cmake b/configure.cmake index 0014c1d7b49..c0043664486 100644 --- a/configure.cmake +++ b/configure.cmake @@ -484,7 +484,7 @@ CHECK_FUNCTION_EXISTS(rdtscll HAVE_RDTSCLL) # Tests for symbols # -CHECK_SYMBOL_EXISTS(sys_errlist "stdio.h" HAVE_SYS_ERRLIST) +#CHECK_SYMBOL_EXISTS(sys_errlist "stdio.h" HAVE_SYS_ERRLIST) CHECK_SYMBOL_EXISTS(madvise "sys/mman.h" HAVE_DECL_MADVISE) CHECK_SYMBOL_EXISTS(tzname "time.h" HAVE_TZNAME) CHECK_SYMBOL_EXISTS(lrand48 "stdlib.h" HAVE_LRAND48) diff --git a/dbug/user.r b/dbug/user.r index 5628f5a4fa1..da308ef2a68 100644 --- a/dbug/user.r +++ b/dbug/user.r @@ -971,15 +971,6 @@ containing the macro causing the output. .LI i Mark each debugger output line with the PID (or thread ID) of the current process. -.LI g,[functions] -Enable profiling for the specified list of functions. -Every function can be a -.I glob(7) -pattern. -An empty list of functions enables profiling for all functions. -See -.B PROFILING\ WITH\ DBUG -below. .LI L Mark each debugger output line with the source file line number of the macro causing the output. @@ -1078,76 +1069,7 @@ all writes to a file are always followed by a flush. .SK .B -PROFILING WITH DBUG -.R -.P -With -.I dbug -one can do profiling in a machine independent fashion, -without a need for profiled version of system libraries. -For this, -.I dbug -can write out a file -called -.B dbugmon.out -(by default). This is an ascii file containing lines of the form: -.DS CB N -\fC<function-name> E <time-entered> -<function-name> X <time-exited> -.DE - -.P -A second program (\fBanalyze\fR) reads this file, and produces a report on -standard output. - -.P -Profiling is enabled through the -.B g -flag. It can take a list of -function names for which profiling is enabled. By default, it -profiles all functions. - -.P -The profile file is opened for appending. This -is in order that one can run a program several times, and get the -sum total of all the times, etc. - -.P -An example of the report generated follows: -.DS CB N -\fC - Profile of Execution - Execution times are in milliseconds - - Calls Time - ----- ---- - Times Percentage Time Spent Percentage -Function Called of total in Function of total Importance -======== ====== ========== =========== ========== ========== -factorial 5 83.33 30 100.00 8333 -main 1 16.67 0 0.00 0 -======== ====== ========== =========== ========== -Totals 6 100.00 30 100.00 -.DE -.P -As you can see, it's quite self-evident. The -.B Importance -column is a -metric obtained by multiplying the percentage of the calls and the percentage -of the time. Functions with higher 'importance' benefit the most from -being sped up. - -.P -As a limitation - setjmp/longjmp, or child processes, are ignored -for the time being. Also, profiling does not work -in a multi-threaded environment. - -.P -Profiling code is (c) Binayak Banerjee. - -.SK -.B HINTS AND MISCELLANEOUS .R diff --git a/include/m_ctype.h b/include/m_ctype.h index 009db46bcd2..e02f5d84d4e 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -71,6 +71,24 @@ struct unicase_info_st extern MY_UNICASE_INFO *const my_unicase_default[256]; extern MY_UNICASE_INFO *const my_unicase_turkish[256]; +#define MY_UCA_MAX_CONTRACTION 4 +#define MY_UCA_MAX_WEIGHT_SIZE 8 + +typedef struct my_contraction_t +{ + my_wc_t ch[MY_UCA_MAX_CONTRACTION]; /* Character sequence */ + uint16 weight[MY_UCA_MAX_WEIGHT_SIZE];/* Its weight string, 0-terminated */ +} MY_CONTRACTION; + + +typedef struct my_contraction_list_t +{ + size_t nitems; /* Number of items in the list */ + MY_CONTRACTION *item; /* List of contractions */ + char *flags; /* Character flags, e.g. "is contraction head") */ +} MY_CONTRACTIONS; + + struct uni_ctype_st { uchar pctype; @@ -103,7 +121,7 @@ extern MY_UNI_CTYPE my_uni_ctype[256]; #define MY_CS_BINSORT 16 /* if binary sort order */ #define MY_CS_PRIMARY 32 /* if primary collation */ #define MY_CS_STRNXFRM 64 /* if strnxfrm is used for sort */ -#define MY_CS_UNICODE 128 /* is a charset is BMP Unicode */ +#define MY_CS_UNICODE 128 /* is a charset is full unicode */ #define MY_CS_READY 256 /* if a charset is initialized */ #define MY_CS_AVAILABLE 512 /* If either compiled-in or loaded*/ #define MY_CS_CSSORT 1024 /* if case sensitive sort order */ @@ -283,7 +301,7 @@ struct charset_info_st const uchar *to_lower; const uchar *to_upper; const uchar *sort_order; - uint16 *contractions; + const MY_CONTRACTIONS *contractions; const uint16 *const *sort_order_big; const uint16 *tab_to_uni; MY_UNI_IDX *tab_from_uni; @@ -309,7 +327,7 @@ struct charset_info_st extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_bin; extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_latin1; extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_filename; -extern MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_utf8_general_ci; +extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_utf8_general_ci; extern struct charset_info_st my_charset_big5_bin; extern struct charset_info_st my_charset_big5_chinese_ci; @@ -351,31 +369,11 @@ extern struct charset_info_st my_charset_utf8mb4_unicode_ci; #define MY_UTF8MB3 "utf8" #define MY_UTF8MB4 "utf8mb4" -/* Helper functions to handle contraction */ -static inline my_bool -my_cs_have_contractions(CHARSET_INFO *cs) -{ - return cs->contractions != NULL; -} - -static inline my_bool -my_cs_can_be_contraction_head(CHARSET_INFO *cs, my_wc_t wc) -{ - return ((const char *)cs->contractions)[0x40*0x40 + (wc & 0xFF)]; -} - -static inline my_bool -my_cs_can_be_contraction_tail(CHARSET_INFO *cs, my_wc_t wc) -{ - return ((const char *)cs->contractions)[0x40*0x40 + (wc & 0xFF)]; -} - -static inline uint16* -my_cs_contraction2_weight(CHARSET_INFO *cs, my_wc_t wc1, my_wc_t wc2) -{ - return &cs->contractions[(wc1 - 0x40) * 0x40 + wc2 - 0x40]; -} - +my_bool my_cs_have_contractions(CHARSET_INFO *cs); +my_bool my_cs_can_be_contraction_head(CHARSET_INFO *cs, my_wc_t wc); +my_bool my_cs_can_be_contraction_tail(CHARSET_INFO *cs, my_wc_t wc); +const uint16 *my_cs_contraction2_weight(CHARSET_INFO *cs, my_wc_t wc1, + my_wc_t wc2); /* declarations for simple charsets */ extern size_t my_strnxfrm_simple(CHARSET_INFO *, uchar *, size_t, diff --git a/include/maria.h b/include/maria.h index 8e5c485767a..7eae8ae0430 100644 --- a/include/maria.h +++ b/include/maria.h @@ -25,7 +25,7 @@ extern "C" { #include <my_sys.h> #include <m_ctype.h> #include "../storage/maria/ma_pagecache.h" -#include "my_handler.h" +#include "my_compare.h" #include "ft_global.h" #include <myisamchk.h> #include <mysql/plugin.h> @@ -174,9 +174,7 @@ typedef struct st_maria_key /* Internal info about a key */ typedef struct st_maria_keydef /* Key definition with open & info */ { struct st_maria_share *share; /* Pointer to base (set in open) */ -#ifdef THREAD rw_lock_t root_lock; /* locking of tree */ -#endif uint16 keysegs; /* Number of key-segment */ uint16 flag; /* NOSAME, PACK_USED */ @@ -356,11 +354,9 @@ typedef struct st_maria_bit_buff typedef struct st_maria_sort_info { -#ifdef THREAD /* sync things */ pthread_mutex_t mutex; pthread_cond_t cond; -#endif MARIA_HA *info, *new_info; HA_CHECK *param; char *buff; diff --git a/include/my_compare.h b/include/my_compare.h index 363d46b8162..53e5aa94c3c 100644 --- a/include/my_compare.h +++ b/include/my_compare.h @@ -40,7 +40,7 @@ extern "C" { */ #define HA_MAX_KEY_LENGTH 1000 /* Max length in bytes */ -#define HA_MAX_KEY_SEG 16 /* Max segments for key */ +#define HA_MAX_KEY_SEG 32 /* Max segments for key */ #define HA_MAX_POSSIBLE_KEY_BUFF (HA_MAX_KEY_LENGTH + 24+ 6+6) #define HA_MAX_KEY_BUFF (HA_MAX_KEY_LENGTH+HA_MAX_KEY_SEG*6+8+8) @@ -106,10 +106,10 @@ typedef struct st_HA_KEYSEG /* Key-portion */ #define clr_rec_bits(bit_ptr, bit_ofs, bit_len) \ set_rec_bits(0, bit_ptr, bit_ofs, bit_len) -extern int ha_compare_text(CHARSET_INFO *, uchar *, uint, uchar *, uint , - my_bool, my_bool); -extern int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a, - register uchar *b, uint key_length, uint nextflag, +extern int ha_compare_text(CHARSET_INFO *, const uchar *, uint, + const uchar *, uint , my_bool, my_bool); +extern int ha_key_cmp(HA_KEYSEG *keyseg, const uchar *a, + const uchar *b, uint key_length, uint nextflag, uint *diff_pos); extern HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, const uchar *a); @@ -123,4 +123,28 @@ extern HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, const uchar *a); } #endif +/** + Return values of index_cond_func_xxx functions. + + 0=ICP_NO_MATCH - index tuple doesn't satisfy the pushed index condition (the + engine should discard the tuple and go to the next one) + 1=ICP_MATCH - index tuple satisfies the pushed index condition (the + engine should fetch and return the record) + 2=ICP_OUT_OF_RANGE - index tuple is out range that we're scanning, e.g. this + if we're scanning "t.key BETWEEN 10 AND 20" and got a + "t.key=21" tuple (the engine should stop scanning and + return HA_ERR_END_OF_FILE right away). + -1= ICP_ERROR - Reserved for internal errors in engines. Should not be + returned by index_cond_func_xxx +*/ + +typedef enum icp_result { + ICP_ERROR=-1, + ICP_NO_MATCH=0, + ICP_MATCH=1, + ICP_OUT_OF_RANGE=2 +} ICP_RESULT; + +typedef ICP_RESULT (*index_cond_func_t)(void *param); + #endif /* _my_compare_h */ diff --git a/include/my_sys.h b/include/my_sys.h index 4dfe425dc30..cbc5f277a52 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -17,7 +17,6 @@ #define _my_sys_h #include "my_global.h" /* C_MODE_START, C_MODE_END */ -#include "my_valgrind.h" C_MODE_START @@ -35,14 +34,14 @@ typedef struct my_aio_result { #define IF_VALGRIND(A,B) B #endif -#if defined(HAVE_valgrind)&& defined(HAVE_VALGRIND_MEMCHECK_H) +#if defined(HAVE_valgrind) && defined(HAVE_VALGRIND_MEMCHECK_H) # include <valgrind/memcheck.h> # define MEM_UNDEFINED(a,len) VALGRIND_MAKE_MEM_UNDEFINED(a,len) # define MEM_NOACCESS(a,len) VALGRIND_MAKE_MEM_NOACCESS(a,len) # define MEM_CHECK_ADDRESSABLE(a,len) VALGRIND_CHECK_MEM_IS_ADDRESSABLE(a,len) # define MEM_CHECK_DEFINED(a,len) VALGRIND_CHECK_MEM_IS_DEFINED(a,len) #else /* HAVE_VALGRIND */ -# define MEM_UNDEFINED(a,len) bfill(a, len, 0x8F) +# define MEM_UNDEFINED(a,len) ((void) 0) # define MEM_NOACCESS(a,len) ((void) 0) # define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0) # define MEM_CHECK_DEFINED(a,len) ((void) 0) @@ -169,7 +168,12 @@ extern void *my_memdup(const void *from,size_t length,myf MyFlags); extern char *my_strdup(const char *from,myf MyFlags); extern char *my_strndup(const char *from, size_t length, myf MyFlags); +#ifdef SAFEMALLOC +#define TRASH(A,B) do { bfill(A, B, 0x8F); MEM_UNDEFINED(A, B); } while (0) +#else #define TRASH(A,B) do{MEM_CHECK_ADDRESSABLE(A,B);MEM_UNDEFINED(A,B);} while (0) +#endif + #if defined(ENABLED_DEBUG_SYNC) extern void (*debug_sync_C_callback_ptr)(const char *, size_t); #define DEBUG_SYNC_C(_sync_point_name_) do { \ diff --git a/include/mysql/client_plugin.h.pp b/include/mysql/client_plugin.h.pp index 93eaff7501e..06ed6f2e6d8 100644 --- a/include/mysql/client_plugin.h.pp +++ b/include/mysql/client_plugin.h.pp @@ -24,6 +24,8 @@ struct st_mysql_client_plugin_AUTHENTICATION int type; unsigned int interface_version; const char *name; const char *author; const char *desc; unsigned int version[3]; const char *license; void *mysql_api; int (*init)(char *, size_t, int, va_list); int (*deinit)(); int (*options)(const char *option, const void *); int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, struct st_mysql *mysql); }; +typedef char *(*mysql_authentication_dialog_ask_t)(struct st_mysql *mysql, + int type, const char *prompt, char *buf, int buf_len); struct st_mysql_client_plugin * mysql_load_plugin(struct st_mysql *mysql, const char *name, int type, int argc, ...); diff --git a/include/mysql/plugin_auth.h.pp b/include/mysql/plugin_auth.h.pp index e65278c518e..9bf16181273 100644 --- a/include/mysql/plugin_auth.h.pp +++ b/include/mysql/plugin_auth.h.pp @@ -102,6 +102,22 @@ struct st_mysql_plugin struct st_mysql_sys_var **system_vars; void * __reserved1; }; +struct st_maria_plugin +{ + int type; + void *info; + const char *name; + const char *author; + const char *descr; + int license; + int (*init)(void *); + int (*deinit)(void *); + unsigned int version; + struct st_mysql_show_var *status_vars; + struct st_mysql_sys_var **system_vars; + const char *version_info; + unsigned int maturity; +}; #include "plugin_ftparser.h" #include "plugin.h" enum enum_ftparser_mode @@ -131,16 +147,16 @@ typedef struct st_mysql_ftparser_boolean_info typedef struct st_mysql_ftparser_param { int (*mysql_parse)(struct st_mysql_ftparser_param *, - char *doc, int doc_len); + const char *doc, int doc_len); int (*mysql_add_word)(struct st_mysql_ftparser_param *, - char *word, int word_len, + const char *word, int word_len, MYSQL_FTPARSER_BOOLEAN_INFO *boolean_info); void *ftparser_state; void *mysql_ftparam; - struct charset_info_st *cs; - char *doc; + const struct charset_info_st *cs; + const char *doc; int length; - int flags; + unsigned int flags; enum enum_ftparser_mode mode; } MYSQL_FTPARSER_PARAM; struct st_mysql_ftparser @@ -178,13 +194,14 @@ int thd_in_lock_tables(const void* thd); int thd_tablespace_op(const void* thd); long long thd_test_options(const void* thd, long long test_options); int thd_sql_command(const void* thd); -const char *thd_proc_info(void* thd, const char *info); void **thd_ha_data(const void* thd, const struct handlerton *hton); void thd_storage_lock_wait(void* thd, long long value); int thd_tx_isolation(const void* thd); char *thd_security_context(void* thd, char *buffer, unsigned int length, unsigned int max_query_len); void thd_inc_row_count(void* thd); +const char *set_thd_proc_info(void *, const char * info, const char *func, + const char *file, const unsigned int line); int mysql_tmpfile(const char *prefix); int thd_killed(const void* thd); unsigned long thd_get_thread_id(const void* thd); diff --git a/include/mysql/thread_pool_priv.h b/include/mysql/thread_pool_priv.h index fc9a2bc6424..97d0cbfab6a 100644 --- a/include/mysql/thread_pool_priv.h +++ b/include/mysql/thread_pool_priv.h @@ -1,3 +1,4 @@ +#error don't use /* Copyright (C) 2010, 2011 Oracle and/or its affiliates. All rights reserved. diff --git a/include/wqueue.h b/include/wqueue.h index 96115c4db3c..b3fe3dc8602 100644 --- a/include/wqueue.h +++ b/include/wqueue.h @@ -12,7 +12,6 @@ typedef struct st_pagecache_wqueue threads */ } WQUEUE; -#ifdef THREAD void wqueue_link_into_queue(WQUEUE *wqueue, struct st_my_thread_var *thread); void wqueue_unlink_from_queue(WQUEUE *wqueue, struct st_my_thread_var *thread); void wqueue_add_to_queue(WQUEUE *wqueue, struct st_my_thread_var *thread); @@ -23,5 +22,3 @@ void wqueue_release_queue(WQUEUE *wqueue); void wqueue_release_one_locktype_from_queue(WQUEUE *wqueue); #endif - -#endif diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 2f34ea8c224..795f0c3a73a 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -167,7 +167,7 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command, #endif end: - thd->restore_globals(); + thd->reset_globals(); return result; } diff --git a/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test b/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test index 54b5c95080e..e1faec8440b 100644 --- a/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test +++ b/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test @@ -98,6 +98,7 @@ connection master; TRUNCATE TABLE t1; TRUNCATE TABLE t2; TRUNCATE TABLE t3; +set default_storage_engine=innodb; BEGIN; --disable_query_log @@ -110,14 +111,12 @@ BEGIN; --eval INSERT INTO t1 (a, data) VALUES (5, $data); --error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (6, $data); +--enable_query_log --eval INSERT INTO t1 (a, data) VALUES (7, 's'); --eval INSERT INTO t2 (a, data) VALUES (8, 's'); --eval INSERT INTO t1 (a, data) VALUES (9, 's'); ---enable_query_log ---disable_query_log ALTER TABLE t3 ADD COLUMN d int; ---enable_query_log --disable_query_log --eval INSERT INTO t2 (a, data) VALUES (10, $data); @@ -135,23 +134,19 @@ BEGIN; --eval INSERT INTO t1 (a, data) VALUES (17, $data); --error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (18, $data); +--enable_query_log --eval INSERT INTO t1 (a, data) VALUES (19, 's'); --eval INSERT INTO t2 (a, data) VALUES (20, 's'); --eval INSERT INTO t1 (a, data) VALUES (21, 's'); ---enable_query_log if (`SELECT @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`) { - --disable_query_log CREATE TABLE t4 SELECT * FROM t1; - --enable_query_log } if (`SELECT @@binlog_format = 'ROW'`) { - --disable_query_log --error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE CREATE TABLE t4 SELECT * FROM t1; - --enable_query_log } --disable_query_log @@ -167,14 +162,12 @@ BEGIN; --eval INSERT INTO t1 (a, data) VALUES (25, $data); --error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (26, $data); +--enable_query_log --eval INSERT INTO t1 (a, data) VALUES (27, 's'); --eval INSERT INTO t2 (a, data) VALUES (28, 's'); --eval INSERT INTO t1 (a, data) VALUES (29, 's'); ---enable_query_log ---disable_query_log CREATE TABLE t5 (a int); ---enable_query_log --sync_slave_with_master --let $diff_tables= master:t1,slave:t1 @@ -311,10 +304,10 @@ SAVEPOINT sv; --eval INSERT INTO t1 (a, data) VALUES (5, $data); --error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (6, $data); +--enable_query_log --eval INSERT INTO t1 (a, data) VALUES (7, 's'); --eval INSERT INTO t2 (a, data) VALUES (8, 's'); --eval INSERT INTO t1 (a, data) VALUES (9, 's'); ---enable_query_log ROLLBACK TO sv; COMMIT; @@ -344,11 +337,11 @@ BEGIN; --error ER_TRANS_CACHE_FULL, ER_STMT_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (7, $data); --eval UPDATE t2 SET data= CONCAT($data, $data); +--enable_query_log --eval INSERT INTO t1 (a, data) VALUES (8, 's'); --eval INSERT INTO t1 (a, data) VALUES (9, 's'); --eval INSERT INTO t2 (a, data) VALUES (10, 's'); --eval INSERT INTO t1 (a, data) VALUES (11, 's'); ---enable_query_log COMMIT; BEGIN; diff --git a/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test b/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test index 06253c5defb..ce062f424e1 100644 --- a/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test +++ b/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test @@ -8,7 +8,7 @@ source include/master-slave.inc; let $SERVER_VERSION=`select version()`; -create table t1 (a int) ENGINE=MyISAM; +create table t1 (a int); insert into t1 values (10); create table t2 (a int) ENGINE=MyISAM; create table t3 (a int) engine=merge union(t1); diff --git a/mysql-test/include/default_client.cnf b/mysql-test/include/default_client.cnf index 38f0d39127a..c9acd2d6b58 100644 --- a/mysql-test/include/default_client.cnf +++ b/mysql-test/include/default_client.cnf @@ -3,6 +3,9 @@ # when running tests - not to depend on the current machine localization. # +[client] +plugin-dir=@OPT.plugindir + [mysql] default-character-set=latin1 diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf index 614e50ca87b..8bbb1c15fa8 100644 --- a/mysql-test/include/default_mysqld.cnf +++ b/mysql-test/include/default_mysqld.cnf @@ -23,6 +23,8 @@ character-set-server= latin1 # disconnects when test servers are put under load see BUG#28359 connect-timeout= 60 +plugin-dir=@OPT.plugindir + log-bin-trust-function-creators=1 key_buffer_size= 1M sort_buffer= 256K diff --git a/mysql-test/include/index_merge_ror.inc b/mysql-test/include/index_merge_ror.inc index 2764cbea468..fdb966e6885 100644 --- a/mysql-test/include/index_merge_ror.inc +++ b/mysql-test/include/index_merge_ror.inc @@ -63,7 +63,6 @@ create table t1 key(key3), key(key4) ) ; - # Fill table create table t0 as select * from t1; --disable_query_log diff --git a/mysql-test/lib/My/ConfigFactory.pm b/mysql-test/lib/My/ConfigFactory.pm index e672b094405..90d2eaa0d76 100644 --- a/mysql-test/lib/My/ConfigFactory.pm +++ b/mysql-test/lib/My/ConfigFactory.pm @@ -645,6 +645,7 @@ sub new_config { # add auto-options $config->insert('OPT', 'port' => sub { fix_port($self, $config) }); $config->insert('OPT', 'vardir' => sub { $self->{ARGS}->{vardir} }); + $config->insert('OPT', 'plugindir' => sub { $::plugindir }); { # Run pre rules diff --git a/mysql-test/lib/My/Test.pm b/mysql-test/lib/My/Test.pm index f9eed945e41..5b202ea17a1 100644 --- a/mysql-test/lib/My/Test.pm +++ b/mysql-test/lib/My/Test.pm @@ -97,7 +97,7 @@ sub read_test { chomp($serialized); $serialized =~ s/\\([0-9a-fA-F]{2})/chr(hex($1))/eg; my $test= Storable::thaw($serialized); - die "wrong class (hack attempt?)" + die "wrong class (hack attempt?): ".ref($test) unless ref($test) eq 'My::Test'; resfile_from_test($test) if $::opt_resfile; return $test; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 459c070385b..ddf4e4bc5ee 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -281,8 +281,6 @@ my $opt_valgrind_mysqld= 0; my $opt_valgrind_mysqltest= 0; my @default_valgrind_args= ("--show-reachable=yes"); my @valgrind_args; -our $opt_valgrind_mysqld= 0; -my $opt_valgrind_mysqltest= 0; my $opt_strace= 0; my $opt_strace_client; my @strace_args; @@ -431,6 +429,7 @@ sub main { template_path => "include/default_my.cnf", master_opt => [], slave_opt => [], + suite => 'main', ); unshift(@$tests, $tinfo); } @@ -476,19 +475,6 @@ sub main { print_global_resfile(); } - # -------------------------------------------------------------------------- - # Read definitions from include/plugin.defs - # - read_plugin_defs("include/plugin.defs"); - - # Also read from any plugin local plugin.defs - for (glob "$basedir/plugin/*/tests/mtr/plugin.defs") { - read_plugin_defs($_); - } - - # Simplify reference to semisync plugins - $ENV{'SEMISYNC_PLUGIN_OPT'}= $ENV{'SEMISYNC_MASTER_PLUGIN_OPT'}; - # Create child processes my %children; for my $child_num (1..$opt_parallel){ @@ -586,8 +572,6 @@ sub main { $opt_gcov_msg, $opt_gcov_err); } - mtr_report_stats($prefix, $fail, $completed, $extra_warnings); - if ($ctest_report) { print "$ctest_report\n"; mtr_print_line(); @@ -595,7 +579,7 @@ sub main { print_total_times($opt_parallel) if $opt_report_times; - mtr_report_stats("Completed", $completed); + mtr_report_stats($prefix, $fail, $completed, $extra_warnings); if ( @$completed != $num_tests) { @@ -811,6 +795,7 @@ sub run_test_server ($$$) { # Test failure due to warnings, force is off return ("Warnings in log", 1, $completed, $extra_warnings); } + } elsif ($line =~ /^SPENT/) { add_total_times($line); } @@ -1652,17 +1637,14 @@ sub command_line_setup { $opt_dbx || $opt_client_dbx || $opt_manual_dbx || $opt_debugger || $opt_client_debugger ) { - # Indicate that we are using debugger - $glob_debugger= 1; - $opt_testcase_timeout= 60*60*24; # Don't abort debugging with timeout - $opt_suite_timeout= $opt_testcase_timeout; - $opt_retry= 1; - $opt_retry_failure= 1; - if ( using_extern() ) { mtr_error("Can't use --extern when using debugger"); } + # Indicate that we are using debugger + $glob_debugger= 1; + $opt_retry= 1; + $opt_retry_failure= 1; # Set one week timeout (check-testcase timeout will be 1/10th) $opt_testcase_timeout= 7 * 24 * 60; $opt_suite_timeout= 7 * 24 * 60; @@ -1681,8 +1663,8 @@ sub command_line_setup { } if ($opt_debug) { - $opt_testcase_timeout= 60*60*24; # Don't abort debugging with timeout - $opt_suite_timeout= $opt_testcase_timeout; + $opt_testcase_timeout= 7 * 24 * 60; + $opt_suite_timeout= 7 * 24 * 60; $opt_retry= 1; $opt_retry_failure= 1; } @@ -2275,62 +2257,6 @@ sub find_plugin($$) return $lib_plugin; } -# -# Read plugin defintions file -# - -sub read_plugin_defs($) -{ - my ($defs_file)= @_; - my $running_debug= 0; - - open(PLUGDEF, '<', $defs_file) - or mtr_error("Can't read plugin defintions file $defs_file"); - - # Need to check if we will be running mysqld-debug - if ($opt_debug_server) { - $running_debug= 1 if find_mysqld($basedir) =~ /mysqld-debug/; - } - - while (<PLUGDEF>) { - next if /^#/; - my ($plug_file, $plug_loc, $plug_var, $plug_names)= split; - # Allow empty lines - next unless $plug_file; - mtr_error("Lines in $defs_file must have 3 or 4 items") unless $plug_var; - - # If running debug server, plugins will be in 'debug' subdirectory - $plug_file= "debug/$plug_file" if $running_debug; - - my ($plugin)= find_plugin($plug_file, $plug_loc); - - # Set env. variables that tests may use, set to empty if plugin - # listed in def. file but not found. - - if ($plugin) { - $ENV{$plug_var}= basename($plugin); - $ENV{$plug_var.'_DIR'}= dirname($plugin); - $ENV{$plug_var.'_OPT'}= "--plugin-dir=".dirname($plugin); - if ($plug_names) { - my $lib_name= basename($plugin); - my $load_var= "--plugin_load="; - my $semi= ''; - foreach my $plug_name (split (',', $plug_names)) { - $load_var .= $semi . "$plug_name=$lib_name"; - $semi= ';'; - } - $ENV{$plug_var.'_LOAD'}= $load_var; - } - } else { - $ENV{$plug_var}= ""; - $ENV{$plug_var.'_DIR'}= ""; - $ENV{$plug_var.'_OPT'}= ""; - $ENV{$plug_var.'_LOAD'}= "" if $plug_names; - } - } - close PLUGDEF; -} - sub environment_setup { umask(022); @@ -2499,7 +2425,7 @@ sub environment_setup { $ENV{'MYSQL'}= client_arguments("mysql"); $ENV{'MYSQL_SLAVE'}= client_arguments("mysql", ".2"); $ENV{'MYSQL_UPGRADE'}= client_arguments("mysql_upgrade"); - $ENV{'MYSQLADMIN'}= native_path($exe_mysqladmin); + $ENV{'MYSQLADMIN'}= client_arguments("mysqladmin"); $ENV{'MYSQL_CLIENT_TEST'}= mysql_client_test_arguments(); $ENV{'EXE_MYSQL'}= $exe_mysql; @@ -2739,7 +2665,6 @@ sub setup_vardir() { if ($source_dist) { $plugindir="$opt_vardir/plugins"; - unshift (@opt_extra_mysqld_opt, "--plugin-dir=$plugindir"); mkpath($plugindir); if (IS_WINDOWS) { @@ -2765,6 +2690,7 @@ sub setup_vardir() { } else { + $plugindir= $mysqld_variables{'plugin-dir'} || '.'; # hm, what paths work for debs and for rpms ? for (<$basedir/lib/mysql/plugin/*.so>, <$basedir/lib/plugin/*.dll>) @@ -3097,7 +3023,7 @@ sub ndbd_stop { # by sending "shutdown" to ndb_mgmd } -my $exe_ndbmtd_counter= 0; +our $exe_ndbmtd_counter= 0; sub ndbd_start { my ($cluster, $ndbd)= @_; @@ -4136,7 +4062,7 @@ sub all_servers { } # Storage for changed environment variables -my %old_env; +our %old_env; sub resfile_report_test ($) { my $tinfo= shift; @@ -4598,7 +4524,7 @@ sub restore_error_log { # Keep track of last position in mysqld error log where we scanned for # warnings, so we can attribute any warnings found to the correct test # suite or server restart. -my $last_warning_position= { }; +our $last_warning_position= { }; # Called just before a mysqld server is started or a testcase is run, # to keep track of which tests have been run since last restart, and @@ -4796,7 +4722,7 @@ sub extract_warning_lines ($) { qr|Table \./test/bug53592 has a primary key in InnoDB data dictionary, but not in MySQL|, qr|mysqld: Table '\./mtr/test_suppressions' is marked as crashed and should be repaired|, qr|InnoDB: Error: table 'test/bug39438'|, - qr|'user' entry '.*' ignored in --skip-name-resolve mode|, + qr| entry '.*' ignored in --skip-name-resolve mode|, qr|mysqld got signal 6|, qr|Error while setting value 'pool-of-threads' to 'thread_handling'|, ); @@ -5429,7 +5355,7 @@ sub mysqld_start ($$) { { ddd_arguments(\$args, \$exe, $mysqld->name()); } - if ( $opt_dbx || $opt_manual_dbx ) { + elsif ( $opt_dbx || $opt_manual_dbx ) { dbx_arguments(\$args, \$exe, $mysqld->name()); } elsif ( $opt_debugger ) @@ -6604,7 +6530,7 @@ sub time_format($) { sprintf '%d:%02d:%02d', $_[0]/3600, ($_[0]/60)%60, $_[0]%60; } -my $num_tests; +our $num_tests; sub xterm_stat { if (-t STDOUT and defined $ENV{TERM} and $ENV{TERM} =~ /xterm/) { diff --git a/mysql-test/r/bootstrap.result b/mysql-test/r/bootstrap.result index 484724373d2..8bef6f90ab4 100644 --- a/mysql-test/r/bootstrap.result +++ b/mysql-test/r/bootstrap.result @@ -14,7 +14,7 @@ End of 5.1 tests SHOW VARIABLES LIKE 'have_innodb'; Variable_name Value have_innodb DISABLED -SELECT SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb'; -SUPPORT -NO +SELECT 'bug' as '' FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb' + and SUPPORT='YES'; + End of 5.5 tests diff --git a/mysql-test/r/ctype_binary.result b/mysql-test/r/ctype_binary.result index a9977311640..ed56be67c1a 100644 --- a/mysql-test/r/ctype_binary.result +++ b/mysql-test/r/ctype_binary.result @@ -2761,11 +2761,11 @@ KEY(date_column)); INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01'); EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range date_column date_column 4 NULL 1 Using where +1 SIMPLE t1 range date_column date_column 4 NULL 1 Using index condition; Using MRR ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL; EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range date_column date_column 9 NULL 1 Using where +1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition; Using MRR DROP TABLE t1; # # Bug #31384 DATE_ADD() and DATE_SUB() return binary data diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index 53b45d60c0b..0ca13ecf846 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -3153,11 +3153,11 @@ KEY(date_column)); INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01'); EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range date_column date_column 4 NULL 1 Using where +1 SIMPLE t1 range date_column date_column 4 NULL 1 Using index condition; Using MRR ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL; EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range date_column date_column 9 NULL 1 Using where +1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition; Using MRR DROP TABLE t1; # # Bug #31384 DATE_ADD() and DATE_SUB() return binary data diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index 61560bd25e6..3f8478dc5f0 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -3180,11 +3180,11 @@ KEY(date_column)); INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01'); EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range date_column date_column 4 NULL 1 Using where +1 SIMPLE t1 range date_column date_column 4 NULL 1 Using index condition; Using MRR ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL; EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range date_column date_column 9 NULL 1 Using where +1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition; Using MRR DROP TABLE t1; # # Bug #31384 DATE_ADD() and DATE_SUB() return binary data diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 2dad45e5639..5837bef4181 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -1285,7 +1285,7 @@ ch ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET ucs2 COLLATE ucs2_croatian_ci; EXPLAIN SELECT * FROM t1 WHERE a LIKE 'd%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 23 NULL 1 Using where; Using index +1 SIMPLE t1 range a a 23 NULL 30 Using where; Using index SELECT hex(concat('d',_ucs2 0x017E,'%')); hex(concat('d',_ucs2 0x017E,'%')) 0064017E0025 diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 930917b3268..3c1d291e8d1 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -4895,11 +4895,11 @@ KEY(date_column)); INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01'); EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range date_column date_column 4 NULL 1 Using where +1 SIMPLE t1 range date_column date_column 4 NULL 1 Using index condition; Using MRR ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL; EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range date_column date_column 9 NULL 1 Using where +1 SIMPLE t1 range date_column date_column 9 NULL 1 Using index condition; Using MRR DROP TABLE t1; # # Bug #31384 DATE_ADD() and DATE_SUB() return binary data diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index cce6a4cbb3e..40eb6c5f543 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -684,7 +684,7 @@ SELECT ((@a:=@b:=1.0) div (@b:=@a:=get_format(datetime, 'usa'))); ((@a:=@b:=1.0) div (@b:=@a:=get_format(datetime, 'usa'))) NULL Warnings: -Warning 1366 Incorrect decimal value: '' for column '' at row -1 +Warning 1366 Incorrect decimal value: '' for column '' at row 0 # # Bug #59498 div function broken in mysql-trunk # diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index a02c15c03fb..10caf4cd10f 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -54,7 +54,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string NULL +authentication_string show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA' @@ -125,7 +125,7 @@ max_updates 0 max_connections 0 max_user_connections 0 plugin -authentication_string NULL +authentication_string show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 @@ -172,7 +172,7 @@ max_updates 20 max_connections 30 max_user_connections 0 plugin -authentication_string NULL +authentication_string show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30 @@ -284,7 +284,7 @@ Warnings: Warning 1364 Field 'ssl_cipher' doesn't have a default value Warning 1364 Field 'x509_issuer' doesn't have a default value Warning 1364 Field 'x509_subject' doesn't have a default value -Warning 1364 Field 'auth_string' doesn't have a default value +Warning 1364 Field 'authentication_string' doesn't have a default value insert into mysql.db (host, db, user, select_priv) values ('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y'); alter table mysql.db order by db asc; diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result index a3323d51efb..b5e82794658 100644 --- a/mysql-test/r/grant2.result +++ b/mysql-test/r/grant2.result @@ -287,7 +287,7 @@ Warnings: Warning 1364 Field 'ssl_cipher' doesn't have a default value Warning 1364 Field 'x509_issuer' doesn't have a default value Warning 1364 Field 'x509_subject' doesn't have a default value -Warning 1364 Field 'auth_string' doesn't have a default value +Warning 1364 Field 'authentication_string' doesn't have a default value create user mysqltest_A@'%'; rename user mysqltest_B@'%' to mysqltest_C@'%'; drop user mysqltest_C@'%'; @@ -355,7 +355,7 @@ Warnings: Warning 1364 Field 'ssl_cipher' doesn't have a default value Warning 1364 Field 'x509_issuer' doesn't have a default value Warning 1364 Field 'x509_subject' doesn't have a default value -Warning 1364 Field 'auth_string' doesn't have a default value +Warning 1364 Field 'authentication_string' doesn't have a default value INSERT INTO mysql.db (host, db, user, select_priv) VALUES ('%','TESTDB','mysqltest_1','Y'); FLUSH PRIVILEGES; diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 12080ddf5a8..bb1b3bab2c3 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -1899,8 +1899,8 @@ SELECT a, AVG(t1.b), FROM t1 GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL a 10 NULL 9 Using index -3 DEPENDENT SUBQUERY t12 ref a a 10 func,func 2 Using where -2 DEPENDENT SUBQUERY t11 ref a a 10 func,func 2 Using where +3 DEPENDENT SUBQUERY t12 ref a a 10 func,func 2 Using index condition +2 DEPENDENT SUBQUERY t11 ref a a 10 func,func 2 Using index condition SELECT a, AVG(t1.b), (SELECT t11.c FROM t1 t11 WHERE t11.a = t1.a AND t11.b = AVG(t1.b)) AS t11c, (SELECT t12.c FROM t1 t12 WHERE t12.a = t1.a AND t12.b = AVG(t1.b)) AS t12c diff --git a/mysql-test/r/index_merge_myisam.result b/mysql-test/r/index_merge_myisam.result index 1caf9be8ac2..5e8c3ef5b48 100644 --- a/mysql-test/r/index_merge_myisam.result +++ b/mysql-test/r/index_merge_myisam.result @@ -943,7 +943,7 @@ count(*) explain select count(*) from t1 where key1a = 2 and key1b is null and key2a = 2 and key2b is null; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index_merge i1,i2 i1,i2 10,10 NULL REF Using intersect(i1,i2); Using where; Using index +1 SIMPLE t1 index_merge i1,i2 i1,i2 10,10 NULL 2 Using intersect(i1,i2); Using where; Using index select count(*) from t1 where key1a = 2 and key1b is null and key2a = 2 and key2b is null; count(*) @@ -951,7 +951,7 @@ count(*) explain select count(*) from t1 where key1a = 2 and key1b is null and key3a = 2 and key3b is null; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index_merge i1,i3 i1,i3 10,10 NULL REF Using intersect(i1,i3); Using where; Using index +1 SIMPLE t1 index_merge i1,i3 i1,i3 10,10 NULL 2 Using intersect(i1,i3); Using where; Using index select count(*) from t1 where key1a = 2 and key1b is null and key3a = 2 and key3b is null; count(*) diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result index 98735e9b05a..10d960deef5 100644 --- a/mysql-test/r/join_outer.result +++ b/mysql-test/r/join_outer.result @@ -262,11 +262,11 @@ SELECT DISTINCT fill,desc_larga_cat,cred_total,Grup,Places,PlacesOcupades FROM t fill desc_larga_cat cred_total Grup Places PlacesOcupades 10360 asdfggfg 6.0 0 55 0 10360 asdfggfg 6.0 12 333 0 +10360 asdfggfg 6.0 32767 7 0 10360 asdfggfg 6.0 33 8 0 10360 asdfggfg 6.0 45 10 0 10360 asdfggfg 6.0 55 2 0 10360 asdfggfg 6.0 7887 85 0 -10360 asdfggfg 6.0 32767 7 0 10361 Components i Circuits Electronics I 6.0 30 2 0 10361 Components i Circuits Electronics I 6.0 40 3 0 10362 Laboratori d`Ordinadors 4.5 10 12 0 @@ -1621,9 +1621,9 @@ RIGHT JOIN h TABLE2 ON TABLE1.col_int_key=TABLE2.col_int_key RIGHT JOIN m TABLE4 ON TABLE2.col_int_key=TABLE4.col_int_key; pk 2 -4 2 4 +4 NULL NULL NULL @@ -1644,6 +1644,7 @@ NULL NULL NULL DROP TABLE h,m,k; +# # Bug#49600: outer join of two single-row tables with joining attributes # evaluated to nulls create table t1 (a int, b int); diff --git a/mysql-test/r/join_outer_jcl6.result b/mysql-test/r/join_outer_jcl6.result index b4a9bc7c4c2..1aff97ed4af 100644 --- a/mysql-test/r/join_outer_jcl6.result +++ b/mysql-test/r/join_outer_jcl6.result @@ -43,11 +43,11 @@ NULL NULL NULL 4 7 D 7 select t1.*,t2.* from t1 left join t2 using (a); grp a c id a c d 1 1 a 1 1 a 1 +2 2 b NULL NULL NULL NULL +2 3 c NULL NULL NULL NULL 3 4 E 3 4 A 4 3 5 C 3 5 B 5 3 6 D 3 6 C 6 -2 2 b NULL NULL NULL NULL -2 3 c NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL select t1.*,t2.* from t1 left join t2 using (a) where t1.a=t2.a; grp a c id a c d @@ -70,9 +70,9 @@ grp a c id a c d 1 1 a 3 4 A 4 2 2 b 3 5 B 5 2 3 c 3 6 C 6 +3 4 E NULL NULL NULL NULL 3 5 C 3 6 C 6 3 6 D 4 7 D 7 -3 4 E NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL select t1.*,t2.* from t1 natural left outer join t2; grp a c id a c d @@ -103,11 +103,11 @@ id select_type table type possible_keys key key_len ref rows Extra select t1.*,t2.*,t3.a from t1 left join t2 on (t1.a=t2.a) left join t1 as t3 on (t2.a=t3.a); grp a c id a c d a 1 1 a 1 1 a 1 1 +2 2 b NULL NULL NULL NULL NULL +2 3 c NULL NULL NULL NULL NULL 3 4 E 3 4 A 4 4 3 5 C 3 5 B 5 5 3 6 D 3 6 C 6 6 -2 2 b NULL NULL NULL NULL NULL -2 3 c NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL explain select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a); ERROR 42S22: Unknown column 't3.a' in 'on clause' @@ -264,16 +264,16 @@ INSERT INTO t4 VALUES (2,-1,10361,1); INSERT INTO t4 VALUES (3,-1,10362,1); SELECT DISTINCT fill,desc_larga_cat,cred_total,Grup,Places,PlacesOcupades FROM t4 LEFT JOIN t3 ON t3.cod_asig=fill AND estat='S' AND dni_pasaporte='11111111' AND t3.idPla=1 , t2,t1 WHERE fill=t1.cod_asig AND Places>PlacesOcupades AND fill=idAssignatura AND t4.idPla=1 AND papa=-1; fill desc_larga_cat cred_total Grup Places PlacesOcupades +10360 asdfggfg 6.0 0 55 0 10360 asdfggfg 6.0 12 333 0 -10361 Components i Circuits Electronics I 6.0 30 2 0 -10361 Components i Circuits Electronics I 6.0 40 3 0 -10360 asdfggfg 6.0 45 10 0 -10362 Laboratori d`Ordinadors 4.5 10 12 0 -10360 asdfggfg 6.0 55 2 0 10360 asdfggfg 6.0 32767 7 0 10360 asdfggfg 6.0 33 8 0 +10360 asdfggfg 6.0 45 10 0 +10360 asdfggfg 6.0 55 2 0 10360 asdfggfg 6.0 7887 85 0 -10360 asdfggfg 6.0 0 55 0 +10361 Components i Circuits Electronics I 6.0 30 2 0 +10361 Components i Circuits Electronics I 6.0 40 3 0 +10362 Laboratori d`Ordinadors 4.5 10 12 0 10362 Laboratori d`Ordinadors 4.5 11 111 0 SELECT DISTINCT fill,t3.idPla FROM t4 LEFT JOIN t3 ON t3.cod_asig=t4.fill AND t3.estat='S' AND t3.dni_pasaporte='1234' AND t3.idPla=1 ; fill idPla @@ -308,8 +308,8 @@ select t1.name, t2.name, t2.id from t1 left join t2 on (t1.id = t2.owner); name name id Antonio Paz El Gato 1 Antonio Paz Perrito 2 -Thimble Smith Happy 3 Lilliana Angelovska NULL NULL +Thimble Smith Happy 3 select t1.name, t2.name, t2.id from t1 left join t2 on (t1.id = t2.owner) where t2.id is null; name name id Lilliana Angelovska NULL NULL @@ -328,8 +328,8 @@ select t1.name, t2.name, t2.id from t2 right join t1 on (t1.id = t2.owner); name name id Antonio Paz El Gato 1 Antonio Paz Perrito 2 -Thimble Smith Happy 3 Lilliana Angelovska NULL NULL +Thimble Smith Happy 3 select t1.name, t2.name, t2.id from t2 right join t1 on (t1.id = t2.owner) where t2.id is null; name name id Lilliana Angelovska NULL NULL @@ -348,20 +348,20 @@ select t1.name, t2.name, t2.id,t3.id from t2 right join t1 on (t1.id = t2.owner) name name id id Antonio Paz El Gato 1 1 Antonio Paz Perrito 2 1 -Thimble Smith Happy 3 3 Lilliana Angelovska NULL NULL NULL +Thimble Smith Happy 3 3 select t1.name, t2.name, t2.id,t3.id from t1 right join t2 on (t1.id = t2.owner) right join t1 as t3 on t3.id=t2.owner; name name id id Antonio Paz El Gato 1 1 Antonio Paz Perrito 2 1 -Thimble Smith Happy 3 3 NULL NULL NULL 2 +Thimble Smith Happy 3 3 select t1.name, t2.name, t2.id, t2.owner, t3.id from t1 left join t2 on (t1.id = t2.owner) right join t1 as t3 on t3.id=t2.owner; name name id owner id Antonio Paz El Gato 1 1 1 Antonio Paz Perrito 2 1 1 -Thimble Smith Happy 3 3 3 NULL NULL NULL NULL 2 +Thimble Smith Happy 3 3 3 drop table t1,t2; create table t1 (id int not null, str char(10), index(str)); insert into t1 values (1, null), (2, null), (3, "foo"), (4, "bar"); @@ -642,9 +642,9 @@ fooID barID fooID 30 3 30 select * from t2 left join t1 ignore index(primary) on t1.fooID = t2.fooID and t1.fooID = 30; fooID barID fooID -30 3 30 10 1 NULL 20 2 NULL +30 3 30 drop table t1,t2; create table t1 (i int); create table t2 (i int); @@ -654,21 +654,21 @@ insert into t2 values(2),(3); insert into t3 values(2),(4); select * from t1 natural left join t2 natural left join t3; i -2 1 +2 select * from t1 natural left join t2 where (t2.i is not null)=0; i 1 select * from t1 natural left join t2 where (t2.i is not null) is not null; i -2 1 +2 select * from t1 natural left join t2 where (i is not null)=0; i select * from t1 natural left join t2 where (i is not null) is not null; i -2 1 +2 drop table t1,t2,t3; create table t1 (f1 integer,f2 integer,f3 integer); create table t2 (f2 integer,f4 integer); @@ -1027,40 +1027,40 @@ a b a b 7 8 7 5 SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t2.b > t1.a OR t1.a > t1.b; a b a b +2 1 NULL NULL 3 2 3 0 4 3 4 1 6 5 6 4 -2 1 NULL NULL 8 7 NULL NULL SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a NOT BETWEEN t2.b AND t1.b; a b a b +2 1 NULL NULL 3 2 3 0 4 3 4 1 6 5 6 4 -2 1 NULL NULL 8 7 NULL NULL SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT(t1.a BETWEEN t2.b AND t1.b); a b a b +2 1 NULL NULL 3 2 3 0 4 3 4 1 6 5 6 4 -2 1 NULL NULL 8 7 NULL NULL SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a = t2.a OR t2.b > t1.a OR t1.a > t1.b; a b a b +2 1 NULL NULL 3 2 3 0 4 3 4 1 6 5 6 4 7 8 7 5 -2 1 NULL NULL 8 7 NULL NULL SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT(t1.a != t2.a AND t1.a BETWEEN t2.b AND t1.b); a b a b +2 1 NULL NULL 3 2 3 0 4 3 4 1 6 5 6 4 7 8 7 5 -2 1 NULL NULL 8 7 NULL NULL SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a = t2.a AND (t2.b > t1.a OR t1.a > t1.b); a b a b @@ -1173,33 +1173,33 @@ INSERT INTO t1 VALUES (1), (2), (3), (4); INSERT INTO t2 VALUES (2), (3); SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.b WHERE (1=1); a b +1 NULL 2 2 3 3 -1 NULL 4 NULL SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.b WHERE (1 OR 1); a b +1 NULL 2 2 3 3 -1 NULL 4 NULL SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.b WHERE (0 OR 1); a b +1 NULL 2 2 3 3 -1 NULL 4 NULL SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.b WHERE (1=1 OR 2=2); a b +1 NULL 2 2 3 3 -1 NULL 4 NULL SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.b WHERE (1=1 OR 1=0); a b +1 NULL 2 2 3 3 -1 NULL 4 NULL DROP TABLE t1,t2; CREATE TABLE t1 ( @@ -1407,6 +1407,248 @@ Warnings: Note 1003 select straight_join `test`.`jt1`.`f1` AS `f1` from `test`.`t1` `jt6` left join (`test`.`t1` `jt3` join `test`.`t1` `jt4` left join `test`.`t1` `jt5` on(1) left join `test`.`t1` `jt2` on(1)) on((`test`.`jt6`.`f1` and 1)) left join `test`.`t1` `jt1` on(1) where 1 DROP TABLE t1; # +# Bug#57688 Assertion `!table || (!table->write_set || bitmap_is_set(table->write_set, field +# +CREATE TABLE t1 (f1 INT NOT NULL, PRIMARY KEY (f1)); +CREATE TABLE t2 (f1 INT NOT NULL, f2 INT NOT NULL, PRIMARY KEY (f1, f2)); +INSERT INTO t1 VALUES (4); +INSERT INTO t2 VALUES (3, 3); +INSERT INTO t2 VALUES (7, 7); +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1 +WHERE t1.f1 = 4 +GROUP BY t2.f1, t2.f2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system PRIMARY NULL NULL NULL 1 Using temporary; Using filesort +1 SIMPLE t2 ref PRIMARY PRIMARY 4 const 1 Using index +SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1 +WHERE t1.f1 = 4 +GROUP BY t2.f1, t2.f2; +f1 f1 f2 +4 NULL NULL +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1 +WHERE t1.f1 = 4 AND t2.f1 IS NOT NULL AND t2.f2 IS NOT NULL +GROUP BY t2.f1, t2.f2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system PRIMARY NULL NULL NULL 1 Using filesort +1 SIMPLE t2 ref PRIMARY PRIMARY 4 const 1 Using where; Using index +SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1 +WHERE t1.f1 = 4 AND t2.f1 IS NOT NULL AND t2.f2 IS NOT NULL +GROUP BY t2.f1, t2.f2; +f1 f1 f2 +DROP TABLE t1,t2; +# +# Bug#57034 incorrect OUTER JOIN result when joined on unique key +# +CREATE TABLE t1 (pk INT PRIMARY KEY, +col_int INT, +col_int_unique INT UNIQUE KEY); +INSERT INTO t1 VALUES (1,NULL,2), (2,0,0); +CREATE TABLE t2 (pk INT PRIMARY KEY, +col_int INT, +col_int_unique INT UNIQUE KEY); +INSERT INTO t2 VALUES (1,0,1), (2,0,2); +EXPLAIN +SELECT * FROM t1 LEFT JOIN t2 +ON t1.col_int_unique = t2.col_int_unique AND t1.col_int = t2.col_int +WHERE t1.pk=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 +1 SIMPLE t2 const col_int_unique col_int_unique 5 const 1 +SELECT * FROM t1 LEFT JOIN t2 +ON t1.col_int_unique = t2.col_int_unique AND t1.col_int = t2.col_int +WHERE t1.pk=1; +pk col_int col_int_unique pk col_int col_int_unique +1 NULL 2 NULL NULL NULL +DROP TABLE t1,t2; +# +# Bug#48046 Server incorrectly processing JOINs on NULL values +# +CREATE TABLE `BB` ( +`pk` int(11) NOT NULL AUTO_INCREMENT, +`time_key` time DEFAULT NULL, +`varchar_key` varchar(1) DEFAULT NULL, +`varchar_nokey` varchar(1) DEFAULT NULL, +PRIMARY KEY (`pk`), +KEY `time_key` (`time_key`), +KEY `varchar_key` (`varchar_key`) +) ENGINE=MyISAM AUTO_INCREMENT=11 DEFAULT CHARSET=latin1; +INSERT INTO `BB` VALUES (10,'18:27:58',NULL,NULL); +SELECT table1.time_key AS field1, table2.pk +FROM BB table1 LEFT JOIN BB table2 +ON table2.varchar_nokey = table1.varchar_key +HAVING field1; +field1 pk +18:27:58 NULL +DROP TABLE BB; +# +# Bug#49600 Server incorrectly processing RIGHT JOIN with +# constant WHERE clause and no index +# +CREATE TABLE `BB` ( +`col_datetime_key` datetime DEFAULT NULL, +`col_varchar_key` varchar(1) DEFAULT NULL, +`col_varchar_nokey` varchar(1) DEFAULT NULL, +KEY `col_datetime_key` (`col_datetime_key`), +KEY `col_varchar_key` (`col_varchar_key`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO `BB` VALUES ('1900-01-01 00:00:00',NULL,NULL); +SELECT table1.col_datetime_key +FROM BB table1 RIGHT JOIN BB table2 +ON table2 .col_varchar_nokey = table1.col_varchar_key +WHERE 7; +col_datetime_key +NULL +ALTER TABLE BB DISABLE KEYS; +SELECT table1.col_datetime_key +FROM BB table1 RIGHT JOIN BB table2 +ON table2 .col_varchar_nokey = table1.col_varchar_key +WHERE 7; +col_datetime_key +NULL +DROP TABLE BB; +# +# Bug#58490: Incorrect result in multi level OUTER JOIN +# in combination with IS NULL +# +CREATE TABLE t1 (i INT NOT NULL); +INSERT INTO t1 VALUES (0), (2),(3),(4); +CREATE TABLE t2 (i INT NOT NULL); +INSERT INTO t2 VALUES (0),(1), (3),(4); +CREATE TABLE t3 (i INT NOT NULL); +INSERT INTO t3 VALUES (0),(1),(2), (4); +CREATE TABLE t4 (i INT NOT NULL); +INSERT INTO t4 VALUES (0),(1),(2),(3) ; +SELECT * FROM +t1 LEFT JOIN +( t2 LEFT JOIN +( t3 LEFT JOIN +t4 +ON t4.i = t3.i +) +ON t3.i = t2.i +) +ON t2.i = t1.i +; +i i i i +0 0 0 0 +2 NULL NULL NULL +3 3 NULL NULL +4 4 4 NULL +SELECT * FROM +t1 LEFT JOIN +( t2 LEFT JOIN +( t3 LEFT JOIN +t4 +ON t4.i = t3.i +) +ON t3.i = t2.i +) +ON t2.i = t1.i +WHERE t4.i IS NULL; +i i i i +2 NULL NULL NULL +3 3 NULL NULL +4 4 4 NULL +SELECT * FROM +t1 LEFT JOIN +( ( t2 LEFT JOIN +t3 +ON t3.i = t2.i +) +) +ON t2.i = t1.i +WHERE t3.i IS NULL; +i i i +2 NULL NULL +3 3 NULL +SELECT * FROM +t1 LEFT JOIN +( ( t2 LEFT JOIN +t3 +ON t3.i = t2.i +) +JOIN t4 +ON t4.i=t2.i +) +ON t2.i = t1.i +WHERE t3.i IS NULL; +i i i i +2 NULL NULL NULL +3 3 NULL 3 +4 NULL NULL NULL +SELECT * FROM +t1 LEFT JOIN +( ( t2 LEFT JOIN +t3 +ON t3.i = t2.i +) +JOIN (t4 AS t4a JOIN t4 AS t4b ON t4a.i=t4b.i) +ON t4a.i=t2.i +) +ON t2.i = t1.i +WHERE t3.i IS NULL; +i i i i i +2 NULL NULL NULL NULL +3 3 NULL 3 3 +4 NULL NULL NULL NULL +SELECT * FROM +t1 LEFT JOIN +( ( t2 LEFT JOIN +t3 +ON t3.i = t2.i +) +JOIN (t4 AS t4a, t4 AS t4b) +ON t4a.i=t2.i +) +ON t2.i = t1.i +WHERE t3.i IS NULL; +i i i i i +2 NULL NULL NULL NULL +3 3 NULL 3 0 +3 3 NULL 3 1 +3 3 NULL 3 2 +3 3 NULL 3 3 +4 NULL NULL NULL NULL +DROP TABLE t1,t2,t3,t4; +# +# Bug#49322(Duplicate): Server is adding extra NULL row +# on processing a WHERE clause +# +CREATE TABLE h (pk INT NOT NULL, col_int_key INT); +INSERT INTO h VALUES (1,NULL),(4,2),(5,2),(3,4),(2,8); +CREATE TABLE m (pk INT NOT NULL, col_int_key INT); +INSERT INTO m VALUES (1,2),(2,7),(3,5),(4,7),(5,5),(6,NULL),(7,NULL),(8,9); +CREATE TABLE k (pk INT NOT NULL, col_int_key INT); +INSERT INTO k VALUES (1,9),(2,2),(3,5),(4,2),(5,7),(6,0),(7,5); +SELECT TABLE1.pk FROM k TABLE1 +RIGHT JOIN h TABLE2 ON TABLE1.col_int_key=TABLE2.col_int_key +RIGHT JOIN m TABLE4 ON TABLE2.col_int_key=TABLE4.col_int_key; +pk +2 +2 +4 +4 +NULL +NULL +NULL +NULL +NULL +NULL +NULL +SELECT TABLE1.pk FROM k TABLE1 +RIGHT JOIN h TABLE2 ON TABLE1.col_int_key=TABLE2.col_int_key +RIGHT JOIN m TABLE4 ON TABLE2.col_int_key=TABLE4.col_int_key +WHERE TABLE1.pk IS NULL; +pk +NULL +NULL +NULL +NULL +NULL +NULL +NULL +DROP TABLE h,m,k; +# # Bug#49600: outer join of two single-row tables with joining attributes # evaluated to nulls create table t1 (a int, b int); diff --git a/mysql-test/r/kill.result b/mysql-test/r/kill.result index 964f2947f6a..699c1fc4463 100644 --- a/mysql-test/r/kill.result +++ b/mysql-test/r/kill.result @@ -145,6 +145,7 @@ f2 0 SET DEBUG_SYNC = 'RESET'; DROP TABLE t1, t2; +SET SESSION optimizer_search_depth=0; SET DEBUG_SYNC= 'before_join_optimize SIGNAL in_sync'; PREPARE stmt FROM 'EXPLAIN SELECT * FROM t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40 WHERE a1=a2 AND a2=a3 AND a3=a4 AND a4=a5 AND a5=a6 AND a6=a7 AND a7=a8 AND a8=a9 AND a9=a10 AND a10=a11 AND a11=a12 AND a12=a13 AND a13=a14 AND a14=a15 AND a15=a16 AND a16=a17 AND a17=a18 AND a18=a19 AND a19=a20 AND a20=a21 AND a21=a22 AND a22=a23 AND a23=a24 AND a24=a25 AND a25=a26 AND a26=a27 AND a27=a28 AND a28=a29 AND a29=a30 AND a30=a31 AND a31=a32 AND a32=a33 AND a33=a34 AND a34=a35 AND a35=a36 AND a36=a37 AND a37=a38 AND a38=a39 AND a39=a40 '; EXECUTE stmt; diff --git a/mysql-test/r/myisam_mrr.result b/mysql-test/r/myisam_mrr.result index 5db03db85ac..99e1a6b7292 100644 --- a/mysql-test/r/myisam_mrr.result +++ b/mysql-test/r/myisam_mrr.result @@ -347,7 +347,7 @@ GROUP BY t2.pk ); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY t2 ALL int_key int_key 5 3 33.33 Using index condition; Using filesort +2 SUBQUERY t2 ref int_key int_key 5 1 100.00 Using index condition; Using where; Using filesort Warnings: Note 1003 select min(`test`.`t1`.`pk`) AS `MIN(t1.pk)` from `test`.`t1` where 0 DROP TABLE t1, t2; diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result index f59942d609c..a24eccdc17b 100644 --- a/mysql-test/r/mysqlcheck.result +++ b/mysql-test/r/mysqlcheck.result @@ -298,8 +298,7 @@ CHECK TABLE bug47205 FOR UPGRADE; Table Op Msg_type Msg_text test.bug47205 check error Table upgrade required. Please do "REPAIR TABLE `bug47205`" or dump/reload to fix it! # Running mysqlcheck to check and upgrade -test.bug47205 -error : Table upgrade required. Please do "REPAIR TABLE `bug47205`" or dump/reload to fix it! +test.bug47205 Needs upgrade Repairing tables test.bug47205 OK diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result index 631829c30de..665d9ba1257 100644 --- a/mysql-test/r/mysqld--help-notwin.result +++ b/mysql-test/r/mysqld--help-notwin.result @@ -374,6 +374,8 @@ The following options may be given as the first argument: Don't write queries to slow log that examine fewer rows than that --mrr-buffer-size=# Size of buffer to use when using MRR with range access + --multi-range-count=# + Ignored. Use mrr_buffer_size instead --myisam-block-size=# Block size to be used for MyISAM index pages --myisam-data-pointer-size=# @@ -907,6 +909,7 @@ max-write-lock-count 18446744073709551615 memlock FALSE min-examined-row-limit 0 mrr-buffer-size 262144 +multi-range-count 256 myisam-block-size 1024 myisam-data-pointer-size 6 myisam-max-sort-file-size 9223372036853727232 diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result index 72bbaa71da5..439930b8fe4 100644 --- a/mysql-test/r/openssl_1.result +++ b/mysql-test/r/openssl_1.result @@ -189,7 +189,7 @@ UNLOCK TABLES; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; SSL error: Unable to get private key from 'MYSQL_TEST_DIR/std_data/client-cert.pem' -mysqldump: Got error: 2026: SSL connection error: Unable to get private key when trying to connect +mysqldump: Got error: 2026: "SSL connection error: Unable to get private key" when trying to connect DROP TABLE t1; Variable_name Value Ssl_cipher DHE-RSA-AES256-SHA diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result index 1529a0dfe95..73f1779badc 100644 --- a/mysql-test/r/plugin.result +++ b/mysql-test/r/plugin.result @@ -75,9 +75,9 @@ SET SQL_MODE='IGNORE_BAD_TABLE_OPTIONS'; #illegal value fixed CREATE TABLE t1 (a int) ENGINE=example ULL=10000000000000000000 one_or_two='ttt' YESNO=SSS; Warnings: -Warning 1708 Incorrect value '10000000000000000000' for option 'ULL' -Warning 1708 Incorrect value 'ttt' for option 'one_or_two' -Warning 1708 Incorrect value 'SSS' for option 'YESNO' +Warning 1723 Incorrect value '10000000000000000000' for option 'ULL' +Warning 1723 Incorrect value 'ttt' for option 'one_or_two' +Warning 1723 Incorrect value 'SSS' for option 'YESNO' show create table t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/r/plugin_auth.result b/mysql-test/r/plugin_auth.result index 91a5d2d8478..5a22e47107f 100644 --- a/mysql-test/r/plugin_auth.result +++ b/mysql-test/r/plugin_auth.result @@ -44,7 +44,7 @@ ERROR 28000: Access denied for user 'plug'@'localhost' (using password: YES) ## test correct default plugin select USER(),CURRENT_USER(); USER() CURRENT_USER() -plug@localhost plug@% +plug@localhost plug_dest@% ## test no_auto_create_user sql mode with plugin users SET @@sql_mode=no_auto_create_user; GRANT INSERT ON TEST.* TO grant_user IDENTIFIED WITH 'test_plugin_server'; @@ -72,13 +72,12 @@ DROP TABLE t1; REVOKE ALL PRIVILEGES ON test_grant_db.* FROM new_grant_user; # try re-create existing user via GRANT IDENTIFIED BY GRANT ALL PRIVILEGES ON test_grant_db.* TO new_grant_user -IDENTIFIED BY 'unused_password'; -# make sure password doesn't take precendence +IDENTIFIED BY 'new_password'; +connect(localhost,new_grant_user,plug_dest,test,MYSQL_PORT,MYSQL_SOCK); ERROR 28000: Access denied for user 'new_grant_user'@'localhost' (using password: YES) -#make sure plugin auth still available select USER(),CURRENT_USER(); USER() CURRENT_USER() -new_grant_user@localhost plug_dest@% +new_grant_user@localhost new_grant_user@% USE test_grant_db; CREATE TABLE t1 (a INT); DROP TABLE t1; @@ -86,10 +85,8 @@ DROP USER new_grant_user; # try re-create existing user via GRANT IDENTIFIED WITH GRANT ALL PRIVILEGES ON test_grant_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; -ERROR HY000: GRANT with IDENTIFIED WITH is illegal because the user plug already exists GRANT ALL PRIVILEGES ON test_grant_db.* TO plug_dest IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; -ERROR HY000: GRANT with IDENTIFIED WITH is illegal because the user plug_dest already exists REVOKE SELECT on test_grant_db.* FROM joro INDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'' at line 2 @@ -152,12 +149,12 @@ GRANT PROXY ON future_user TO grant_plug; in default connection SHOW GRANTS FOR grant_plug; Grants for grant_plug@% -GRANT ALL PRIVILEGES ON *.* TO 'grant_plug'@'%' WITH GRANT OPTION +GRANT ALL PRIVILEGES ON *.* TO 'grant_plug'@'%' IDENTIFIED VIA test_plugin_server USING 'grant_plug_dest' WITH GRANT OPTION GRANT PROXY ON 'future_user'@'%' TO 'grant_plug'@'%' REVOKE PROXY ON future_user FROM grant_plug; SHOW GRANTS FOR grant_plug; Grants for grant_plug@% -GRANT ALL PRIVILEGES ON *.* TO 'grant_plug'@'%' WITH GRANT OPTION +GRANT ALL PRIVILEGES ON *.* TO 'grant_plug'@'%' IDENTIFIED VIA test_plugin_server USING 'grant_plug_dest' WITH GRANT OPTION ## testing drop user CREATE USER test_drop@localhost; GRANT PROXY ON future_user TO test_drop@localhost; @@ -286,31 +283,6 @@ REVOKE ALL PRIVILEGES ON *.* FROM u1@localhost, u2@localhost; DROP USER u1@localhost,u2@localhost; # test if FLUSH PRIVILEGES works without the proxies_priv table FLUSH PRIVILEGES; -mtr.global_suppressions OK -mtr.test_suppressions OK -mysql.columns_priv OK -mysql.db OK -mysql.event OK -mysql.func OK -mysql.general_log OK -mysql.help_category OK -mysql.help_keyword OK -mysql.help_relation OK -mysql.help_topic OK -mysql.host OK -mysql.ndb_binlog_index OK -mysql.plugin OK -mysql.proc OK -mysql.procs_priv OK -mysql.servers OK -mysql.slow_log OK -mysql.tables_priv OK -mysql.time_zone OK -mysql.time_zone_leap_second OK -mysql.time_zone_name OK -mysql.time_zone_transition OK -mysql.time_zone_transition_type OK -mysql.user OK SELECT Host,User,Proxied_host,Proxied_user,With_grant FROM mysql.proxies_priv; Host localhost User root @@ -390,6 +362,8 @@ VALUES ( 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', /*!50001 'Y', 'Y', 'Y', 'Y', 'Y', */'', '', '', '', '0', '0', '0'); +Warnings: +Warning 1364 Field 'authentication_string' doesn't have a default value FLUSH PRIVILEGES; DROP USER inserttest@localhost; SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE @@ -398,8 +372,8 @@ TABLE_NAME='user' AND TABLE_SCHEMA='mysql' ORDER BY COLUMN_NAME; IS_NULLABLE COLUMN_NAME -YES authentication_string -YES plugin +NO authentication_string +NO plugin # # Bug #11936829: diff. between mysql.user (authentication_string) # in fresh and upgraded 5.5.11 @@ -409,42 +383,16 @@ WHERE TABLE_SCHEMA= 'mysql' AND TABLE_NAME= 'user' AND COLUMN_NAME IN ('plugin', 'authentication_string') ORDER BY COLUMN_NAME; IS_NULLABLE COLUMN_NAME -YES authentication_string -YES plugin +NO authentication_string +NO plugin ALTER TABLE mysql.user MODIFY plugin char(64) DEFAULT '' NOT NULL; ALTER TABLE mysql.user MODIFY authentication_string TEXT NOT NULL; Run mysql_upgrade on a 5.5.10 external authentication column layout -mtr.global_suppressions OK -mtr.test_suppressions OK -mysql.columns_priv OK -mysql.db OK -mysql.event OK -mysql.func OK -mysql.general_log OK -mysql.help_category OK -mysql.help_keyword OK -mysql.help_relation OK -mysql.help_topic OK -mysql.host OK -mysql.ndb_binlog_index OK -mysql.plugin OK -mysql.proc OK -mysql.procs_priv OK -mysql.proxies_priv OK -mysql.servers OK -mysql.slow_log OK -mysql.tables_priv OK -mysql.time_zone OK -mysql.time_zone_leap_second OK -mysql.time_zone_name OK -mysql.time_zone_transition OK -mysql.time_zone_transition_type OK -mysql.user OK SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA= 'mysql' AND TABLE_NAME= 'user' AND COLUMN_NAME IN ('plugin', 'authentication_string') ORDER BY COLUMN_NAME; IS_NULLABLE COLUMN_NAME -YES authentication_string -YES plugin +NO authentication_string +NO plugin End of 5.5 tests diff --git a/mysql-test/r/plugin_auth_qa.result b/mysql-test/r/plugin_auth_qa.result index d1128cf04ee..2bca2e74726 100644 --- a/mysql-test/r/plugin_auth_qa.result +++ b/mysql-test/r/plugin_auth_qa.result @@ -105,7 +105,7 @@ CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string plug test_plugin_server plug_dest -plug_dest NULL +plug_dest DROP USER plug, plug_dest; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; @@ -115,7 +115,7 @@ DROP USER plug; CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plug_dest NULL +plug_dest DROP USER plug_dest; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; @@ -125,7 +125,7 @@ CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string plug test_plugin_server plug_dest -plug_dest NULL +plug_dest DROP USER plug, plug_dest; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; @@ -135,7 +135,7 @@ DROP USER plug; CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plug_dest NULL +plug_dest DROP USER plug_dest; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; @@ -145,7 +145,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_pas SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string plug test_plugin_server plug_dest -plug_dest NULL +plug_dest DROP USER plug, plug_dest; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; @@ -155,13 +155,11 @@ DROP USER plug; GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plug_dest NULL +plug_dest DROP USER plug_dest; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; -ERROR HY000: GRANT with IDENTIFIED WITH is illegal because the user plug already exists GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server'; -ERROR HY000: GRANT with IDENTIFIED WITH is illegal because the user plug already exists DROP USER plug; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest'; CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; @@ -176,7 +174,7 @@ plug test_plugin_server plug_dest GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; user plugin authentication_string password -plug test_plugin_server plug_dest *939AEE68989794C0F408277411C26055CDF41119 +plug *939AEE68989794C0F408277411C26055CDF41119 DROP USER plug; GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH test_plugin_server AS 'plug_dest'; CREATE USER plug IDENTIFIED BY 'plug_dest_passwd'; @@ -210,7 +208,7 @@ DROP USER plüg; CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plüg_dest NULL +plüg_dest DROP USER plüg_dest; SET NAMES ascii; CREATE USER 'plüg' IDENTIFIED WITH 'test_plugin_server' AS 'plüg_dest'; @@ -221,7 +219,7 @@ DROP USER 'plüg'; CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -pl??g_dest NULL +pl??g_dest DROP USER 'plüg_dest'; SET NAMES latin1; ========== test 1.1.1.5 ==================================== @@ -235,7 +233,7 @@ DROP USER 'plug'; CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plüg_dest NULL +plüg_dest DROP USER 'plüg_dest'; SET NAMES utf8; CREATE USER plüg IDENTIFIED WITH 'test_plügin_server' AS 'plüg_dest'; @@ -248,7 +246,7 @@ DROP USER 'plüg'; CREATE USER 'plüg_dest' IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plüg_dest NULL +plüg_dest DROP USER 'plüg_dest'; CREATE USER plüg IDENTIFIED WITH test_plugin_server AS 'plüg_dest'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; @@ -258,7 +256,7 @@ DROP USER plüg; CREATE USER plüg_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plüg_dest NULL +plüg_dest DROP USER plüg_dest; ========== test 1.1.1.2/1.1.2.2============================= SET @auth_name= 'test_plugin_server'; @@ -278,7 +276,7 @@ DROP USER plug; CREATE USER 'hh''s_plug_dest' IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -hh's_plug_dest NULL +hh's_plug_dest DROP USER 'hh''s_plug_dest'; ========== test 1.1.1.4 ==================================== CREATE USER plug IDENTIFIED WITH hh''s_test_plugin_server AS 'plug_dest'; @@ -294,7 +292,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string grant_user test_plugin_server plug_dest -plug_dest NULL +plug_dest DROP USER grant_user,plug_dest; set @save_sql_mode= @@sql_mode; SET @@sql_mode=no_auto_create_user; @@ -315,13 +313,13 @@ CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; user plugin authentication_string password grant_user test_plugin_server plug_dest -plug_dest NULL *939AEE68989794C0F408277411C26055CDF41119 +plug_dest *939AEE68989794C0F408277411C26055CDF41119 DROP USER plug_dest; GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_user_passwd'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; user plugin authentication_string password grant_user test_plugin_server plug_dest -plug_dest NULL *560881EB651416CEF77314D07D55EDCD5FC1BD6D +plug_dest *560881EB651416CEF77314D07D55EDCD5FC1BD6D DROP USER grant_user,plug_dest; set @@sql_mode= @save_sql_mode; DROP DATABASE test_user_db; diff --git a/mysql-test/r/plugin_auth_qa_1.result b/mysql-test/r/plugin_auth_qa_1.result index 51c7260d9ae..00ee47b56b3 100644 --- a/mysql-test/r/plugin_auth_qa_1.result +++ b/mysql-test/r/plugin_auth_qa_1.result @@ -20,7 +20,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO plug_dest IDENTIFIED BY 'plug_dest_pas GRANT PROXY ON plug_dest TO plug_user; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plug_dest NULL +plug_dest plug_user test_plugin_server plug_dest 1) current_user() @@ -73,7 +73,7 @@ GRANT PROXY ON new_dest TO plug_user; ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES) SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -new_dest NULL +new_dest plug_user test_plugin_server plug_dest DROP USER plug_user,new_dest; CREATE USER plug_user @@ -91,7 +91,7 @@ GRANT PROXY ON new_dest TO plug_user; ERROR 1045 (28000): Access denied for user 'plug_user'@'localhost' (using password: YES) SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -new_dest NULL +new_dest plug_user test_plugin_server plug_dest DROP USER plug_user,new_dest; CREATE USER plug_user @@ -113,13 +113,13 @@ connection default; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string new_user test_plugin_server plug_dest -plug_dest NULL +plug_dest disconnect plug_user; UPDATE mysql.user SET user='plug_user' WHERE user='new_user'; FLUSH PRIVILEGES; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plug_dest NULL +plug_dest plug_user test_plugin_server plug_dest DROP USER plug_dest,plug_user; ========== test 1.3 ======================================== @@ -135,26 +135,26 @@ connection default; disconnect plug_user; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -plug_dest NULL +plug_dest plug_user test_plugin_server plug_dest UPDATE mysql.user SET user='new_user' WHERE user='plug_user'; FLUSH PRIVILEGES; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string new_user test_plugin_server plug_dest -plug_dest NULL +plug_dest UPDATE mysql.user SET authentication_string='new_dest' WHERE user='new_user'; FLUSH PRIVILEGES; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string new_user test_plugin_server new_dest -plug_dest NULL +plug_dest UPDATE mysql.user SET plugin='new_plugin_server' WHERE user='new_user'; FLUSH PRIVILEGES; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string new_user new_plugin_server new_dest -plug_dest NULL +plug_dest connect(plug_user,localhost,new_user,new_dest); ERROR HY000: Plugin 'new_plugin_server' is not loaded UPDATE mysql.user SET plugin='test_plugin_server' WHERE user='new_user'; @@ -163,7 +163,7 @@ FLUSH PRIVILEGES; GRANT PROXY ON new_dest TO new_user; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -new_dest NULL +new_dest new_user test_plugin_server new_dest connect(plug_user,localhost,new_user,new_dest); select USER(),CURRENT_USER(); @@ -176,9 +176,9 @@ FLUSH PRIVILEGES; CREATE USER new_dest IDENTIFIED BY 'new_dest_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -new_dest NULL +new_dest new_user test_plugin_server new_dest -plug_dest NULL +plug_dest GRANT ALL PRIVILEGES ON test.* TO new_user; connect(plug_user,localhost,new_dest,new_dest_passwd); select USER(),CURRENT_USER(); @@ -193,7 +193,7 @@ CREATE USER proxied_user IDENTIFIED BY 'proxied_user_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string test_plugin_server proxied_user -proxied_user NULL +proxied_user connect(proxy_con,localhost,proxied_user,proxied_user_passwd); SELECT USER(),CURRENT_USER(); USER() CURRENT_USER() @@ -230,7 +230,7 @@ CREATE USER proxied_user IDENTIFIED BY 'proxied_user_passwd'; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string test_plugin_server proxied_user -proxied_user NULL +proxied_user connect(proxy_con,localhost,proxied_user,proxied_user_passwd); SELECT USER(),CURRENT_USER(); USER() CURRENT_USER() @@ -273,11 +273,11 @@ GRANT PROXY ON proxied_user_5 TO ''@''; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string test_plugin_server proxied_user -proxied_user_1 NULL -proxied_user_2 NULL -proxied_user_3 NULL -proxied_user_4 NULL -proxied_user_5 NULL +proxied_user_1 +proxied_user_2 +proxied_user_3 +proxied_user_4 +proxied_user_5 connect(proxy_con_1,localhost,proxied_user_1,'proxied_user_1_pwd'); connect(proxy_con_2,localhost,proxied_user_2,proxied_user_2_pwd); connect(proxy_con_3,localhost,proxied_user_3,proxied_user_3_pwd); diff --git a/mysql-test/r/plugin_auth_qa_2.result b/mysql-test/r/plugin_auth_qa_2.result index f4706e5aa0b..f300ea332cb 100644 --- a/mysql-test/r/plugin_auth_qa_2.result +++ b/mysql-test/r/plugin_auth_qa_2.result @@ -7,7 +7,7 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_1_dest identified by 'dest_pas GRANT PROXY ON qa_test_1_dest TO qa_test_1_user; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -qa_test_1_dest NULL +qa_test_1_dest qa_test_1_user qa_auth_interface qa_test_1_dest SELECT @@proxy_user; @@proxy_user @@ -15,12 +15,12 @@ NULL SELECT @@external_user; @@external_user NULL -exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT -u qa_test_1_user --password=qa_test_1_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +exec MYSQL -h localhost -P MASTER_MYPORT -u qa_test_1_user --password=qa_test_1_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 current_user() user() @@local.proxy_user @@local.external_user qa_test_1_user@% qa_test_1_user@localhost NULL NULL SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -qa_test_1_dest NULL +qa_test_1_dest qa_test_1_user qa_auth_interface qa_test_1_dest DROP USER qa_test_1_user; DROP USER qa_test_1_dest; @@ -33,8 +33,8 @@ GRANT PROXY ON qa_test_2_dest TO qa_test_2_user; GRANT PROXY ON authenticated_as TO qa_test_2_user; SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -authenticated_as NULL -qa_test_2_dest NULL +authenticated_as +qa_test_2_dest qa_test_2_user qa_auth_interface qa_test_2_dest SELECT @@proxy_user; @@proxy_user @@ -42,13 +42,13 @@ NULL SELECT @@external_user; @@external_user NULL -exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT -u qa_test_2_user --password=qa_test_2_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +exec MYSQL -h localhost -P MASTER_MYPORT -u qa_test_2_user --password=qa_test_2_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 current_user() user() @@local.proxy_user @@local.external_user authenticated_as@% user_name@localhost 'qa_test_2_user'@'%' 'qa_test_2_user'@'%' SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; user plugin authentication_string -authenticated_as NULL -qa_test_2_dest NULL +authenticated_as +qa_test_2_dest qa_test_2_user qa_auth_interface qa_test_2_dest DROP USER qa_test_2_user; DROP USER qa_test_2_dest; @@ -58,7 +58,7 @@ CREATE USER qa_test_3_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_3_dest' CREATE USER qa_test_3_dest IDENTIFIED BY 'dest_passwd'; GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_3_dest identified by 'dest_passwd'; GRANT PROXY ON qa_test_3_dest TO qa_test_3_user; -exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT -u qa_test_3_user --password=qa_test_3_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +exec MYSQL -h localhost -P MASTER_MYPORT -u qa_test_3_user --password=qa_test_3_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 current_user() user() @@local.proxy_user @@local.external_user qa_test_3_dest@% qa_test_3_user@localhost 'qa_test_3_user'@'%' 'qa_test_3_user'@'%' DROP USER qa_test_3_user; @@ -68,7 +68,7 @@ CREATE USER qa_test_4_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_4_dest' CREATE USER qa_test_4_dest IDENTIFIED BY 'dest_passwd'; GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_4_dest identified by 'dest_passwd'; GRANT PROXY ON qa_test_4_dest TO qa_test_4_user; -exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT -u qa_test_4_user --password=qa_test_4_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +exec MYSQL -h localhost -P MASTER_MYPORT -u qa_test_4_user --password=qa_test_4_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 current_user() user() @@local.proxy_user @@local.external_user qa_test_4_dest@% qa_test_4_user@localhost 'qa_test_4_user'@'%' 'qa_test_4_user'@'%' DROP USER qa_test_4_user; @@ -83,10 +83,10 @@ GRANT PROXY ON qa_test_5_dest TO qa_test_5_user; GRANT PROXY ON qa_test_5_dest TO ''@'localhost'; SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; user plugin authentication_string password - NULL *DFCACE76914AD7BD801FC1A1ECF6562272621A22 -qa_test_5_dest NULL *DFCACE76914AD7BD801FC1A1ECF6562272621A22 + *DFCACE76914AD7BD801FC1A1ECF6562272621A22 +qa_test_5_dest *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_5_user qa_auth_interface qa_test_5_dest -exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=qa_test_5_user --password=qa_test_5_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +exec MYSQL -h localhost -P MASTER_MYPORT --user=qa_test_5_user --password=qa_test_5_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 ERROR 1045 (28000): Access denied for user 'qa_test_5_user'@'localhost' (using password: YES) DROP USER qa_test_5_user; DROP USER qa_test_5_dest; @@ -98,37 +98,37 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_6_dest identified by 'dest_pas GRANT PROXY ON qa_test_6_dest TO qa_test_6_user; SELECT user,plugin,authentication_string,password FROM mysql.user; user plugin authentication_string password -qa_test_6_dest NULL *DFCACE76914AD7BD801FC1A1ECF6562272621A22 +qa_test_6_dest *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_6_user qa_auth_interface qa_test_6_dest root root root root -exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=qa_test_6_user --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +exec MYSQL -h localhost -P MASTER_MYPORT --user=qa_test_6_user --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 ERROR 1045 (28000): Access denied for user 'qa_test_6_user'@'localhost' (using password: YES) GRANT PROXY ON qa_test_6_dest TO root IDENTIFIED WITH qa_auth_interface AS 'qa_test_6_dest'; SELECT user,plugin,authentication_string,password FROM mysql.user; user plugin authentication_string password -qa_test_6_dest NULL *DFCACE76914AD7BD801FC1A1ECF6562272621A22 +qa_test_6_dest *DFCACE76914AD7BD801FC1A1ECF6562272621A22 qa_test_6_user qa_auth_interface qa_test_6_dest root root root root root qa_auth_interface qa_test_6_dest -exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +exec MYSQL -h localhost -P MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) REVOKE PROXY ON qa_test_6_dest FROM root; SELECT user,plugin,authentication_string FROM mysql.user; user plugin authentication_string -qa_test_6_dest NULL +qa_test_6_dest qa_test_6_user qa_auth_interface qa_test_6_dest root root root root root qa_auth_interface qa_test_6_dest -exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +exec MYSQL -h localhost -P MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) DROP USER qa_test_6_user; DROP USER qa_test_6_dest; @@ -144,7 +144,7 @@ CREATE USER qa_test_11_user IDENTIFIED WITH qa_auth_interface AS 'qa_test_11_des CREATE USER qa_test_11_dest IDENTIFIED BY 'dest_passwd'; GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_11_dest identified by 'dest_passwd'; GRANT PROXY ON qa_test_11_dest TO qa_test_11_user; -exec MYSQL PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +exec MYSQL --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 ERROR 1045 (28000): Access denied for user 'qa_test_11_user'@'localhost' (using password: YES) DROP USER qa_test_11_user, qa_test_11_dest; DROP DATABASE test_user_db; diff --git a/mysql-test/r/plugin_auth_qa_3.result b/mysql-test/r/plugin_auth_qa_3.result index d94d8879e7d..656975aca30 100644 --- a/mysql-test/r/plugin_auth_qa_3.result +++ b/mysql-test/r/plugin_auth_qa_3.result @@ -2,10 +2,10 @@ CREATE DATABASE test_user_db; CREATE USER qa_test_11_user IDENTIFIED WITH qa_auth_server AS 'qa_test_11_dest'; GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_11_dest identified by 'dest_passwd'; GRANT PROXY ON qa_test_11_dest TO qa_test_11_user; -exec MYSQL PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +exec MYSQL --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 current_user() user() @@local.proxy_user @@local.external_user qa_test_11_dest@% qa_test_11_user@localhost 'qa_test_11_user'@'%' 'qa_test_11_user'@'%' -exec MYSQL PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_2_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +exec MYSQL --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_2_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 ERROR 1045 (28000): Access denied for user 'qa_test_2_user'@'localhost' (using password: NO) DROP USER qa_test_11_user, qa_test_11_dest; DROP DATABASE test_user_db; diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index eff45844064..e63d2e5e89f 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -1689,7 +1689,7 @@ pk i4 EXPLAIN SELECT * FROM t1 WHERE 10 BETWEEN 10 AND i4; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range i4_uq i4_uq 5 NULL 3 Using where +1 SIMPLE t1 range i4_uq i4_uq 5 NULL 3 Using index condition; Using MRR SELECT * FROM t1 WHERE 10 BETWEEN 10 AND i4; pk i4 1 10 @@ -1698,7 +1698,7 @@ pk i4 EXPLAIN SELECT * FROM t1 WHERE 10 BETWEEN i4 AND 10; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range i4_uq i4_uq 5 NULL 1 Using where +1 SIMPLE t1 range i4_uq i4_uq 5 NULL 1 Using index condition; Using MRR SELECT * FROM t1 WHERE 10 BETWEEN i4 AND 10; pk i4 1 10 @@ -1732,7 +1732,7 @@ pk i4 EXPLAIN SELECT * FROM t1 WHERE i4 BETWEEN 10 AND 99999999999999999; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range i4_uq i4_uq 5 NULL 2 Using where +1 SIMPLE t1 range i4_uq i4_uq 5 NULL 2 Using index condition; Using MRR SELECT * FROM t1 WHERE i4 BETWEEN 10 AND 99999999999999999; pk i4 1 10 @@ -1747,7 +1747,7 @@ pk i4 EXPLAIN SELECT * FROM t1 WHERE i4 BETWEEN 10 AND '20'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range i4_uq i4_uq 5 NULL 1 Using where +1 SIMPLE t1 range i4_uq i4_uq 5 NULL 1 Using index condition; Using MRR SELECT * FROM t1 WHERE i4 BETWEEN 10 AND '20'; pk i4 1 10 @@ -1756,14 +1756,14 @@ EXPLAIN SELECT * FROM t1, t1 as t2 WHERE t2.pk BETWEEN t1.i4 AND t1.i4; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL i4_uq NULL NULL NULL 3 -1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.i4 1 Using where +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.i4 1 Using index condition SELECT * FROM t1, t1 as t2 WHERE t2.pk BETWEEN t1.i4 AND t1.i4; pk i4 pk i4 EXPLAIN SELECT * FROM t1, t1 as t2 WHERE t1.i4 BETWEEN t2.pk AND t2.pk; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL i4_uq NULL NULL NULL 3 -1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.i4 1 Using where +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.i4 1 Using index condition SELECT * FROM t1, t1 as t2 WHERE t1.i4 BETWEEN t2.pk AND t2.pk; pk i4 pk i4 DROP TABLE t1; diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 49fea815b62..511714637ff 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2258,20 +2258,20 @@ a 3 select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1; a a -NULL 1 1 2 -2 2 -3 2 1 3 +2 2 2 3 +3 2 3 3 +NULL 1 select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; a a 2 1 -3 1 2 2 -3 2 2 3 +3 1 +3 2 3 3 select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a ); a diff --git a/mysql-test/r/select_jcl6.result b/mysql-test/r/select_jcl6.result index 1ae56bc33fe..ebe49f5ad97 100644 --- a/mysql-test/r/select_jcl6.result +++ b/mysql-test/r/select_jcl6.result @@ -2226,20 +2226,20 @@ a select * from (t1 as t2 left join t1 as t3 using (a)) left outer join t1 on t1.a>1; a a 1 2 -2 2 -3 2 1 3 +2 2 2 3 +3 2 3 3 select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; a a +1 NULL 2 1 -3 1 2 2 -3 2 2 3 +3 1 +3 2 3 3 -1 NULL select * from (t1 as t2 left join t1 as t3 using (a)) left join t1 using ( a ); a 1 @@ -2967,26 +2967,26 @@ create view v2 (c) as select a1 from t1; select * from t1 natural left join t2; a1 a2 1 1 -2 1 1 2 +2 1 2 2 select * from t1 natural right join t2; a2 a1 1 1 -2 1 1 2 +2 1 2 2 select * from v2 natural left join t2; c a2 1 1 -2 1 1 2 +2 1 2 2 select * from v2 natural right join t2; a2 c 1 1 -2 1 1 2 +2 1 2 2 drop table t1, t2; drop view v2; @@ -3166,9 +3166,9 @@ id 102 select t1.id from t1 left join v3 using (id); id -102 100 101 +102 select * from t1 left join v2 using (id); id 100 @@ -3181,9 +3181,9 @@ id 102 select * from t1 left join v3 using (id); id -102 100 101 +102 select v1.id from v1 left join v2 using (id); id 100 @@ -3196,9 +3196,9 @@ id 102 select v1.id from v1 left join v3 using (id); id -102 100 101 +102 select * from v1 left join v2 using (id); id 100 @@ -3211,9 +3211,9 @@ id 102 select * from v1 left join v3 using (id); id -102 100 101 +102 drop table t1, t2; drop view v1, v2, v3; create table t1 (id int(11) not null default '0'); @@ -4870,6 +4870,70 @@ SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci; 1 1 DROP TABLE t1; +# +# Bug #58422: Incorrect result when OUTER JOIN'ing +# with an empty table +# +CREATE TABLE t_empty(pk INT PRIMARY KEY, i INT) ENGINE = MYISAM; +CREATE TABLE t1(pk INT PRIMARY KEY, i INT) ENGINE = MYISAM; +INSERT INTO t1 VALUES (1,1), (2,2), (3,3); +CREATE TABLE t2(pk INT PRIMARY KEY, i INT) ENGINE = MYISAM; +INSERT INTO t2 VALUES (1,1), (2,2), (3,3); +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON TRUE) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON TRUE) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 CROSS JOIN t_empty) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 CROSS JOIN t_empty) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON t_empty.i=t2.i) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON t_empty.i=t2.i) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +DROP TABLE t1,t2,t_empty; End of 5.1 tests # # Bug#54515: Crash in opt_range.cc::get_best_group_min_max on @@ -4890,6 +4954,25 @@ col_int_key DROP VIEW view_t1; DROP TABLE t1; # End of test BUG#54515 +# +# Bug #57203 Assertion `field_length <= 255' failed. +# +SELECT coalesce((avg(distinct (geomfromtext("point(25379 -22010)"))))) +UNION ALL +SELECT coalesce((avg(distinct (geomfromtext("point(25379 -22010)"))))) +AS foo +; +coalesce((avg(distinct (geomfromtext("point(25379 -22010)"))))) +0.0000 +0.0000 +CREATE table t1(a text); +INSERT INTO t1 VALUES (''), (''); +SELECT avg(distinct(t1.a)) FROM t1, t1 t2 +GROUP BY t2.a ORDER BY t1.a; +avg(distinct(t1.a)) +0 +DROP TABLE t1; +# End of test BUG#57203 set join_cache_level=default; show variables like 'join_cache_level'; Variable_name Value diff --git a/mysql-test/r/select_pkeycache.result b/mysql-test/r/select_pkeycache.result index b5716264f56..511714637ff 100644 --- a/mysql-test/r/select_pkeycache.result +++ b/mysql-test/r/select_pkeycache.result @@ -2258,20 +2258,20 @@ a 3 select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1; a a -NULL 1 1 2 -2 2 -3 2 1 3 +2 2 2 3 +3 2 3 3 +NULL 1 select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; a a 2 1 -3 1 2 2 -3 2 2 3 +3 1 +3 2 3 3 select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a ); a @@ -4866,6 +4866,70 @@ SELECT 1 FROM t1 ORDER BY a COLLATE latin1_german2_ci; 1 1 DROP TABLE t1; +# +# Bug #58422: Incorrect result when OUTER JOIN'ing +# with an empty table +# +CREATE TABLE t_empty(pk INT PRIMARY KEY, i INT) ENGINE = MYISAM; +CREATE TABLE t1(pk INT PRIMARY KEY, i INT) ENGINE = MYISAM; +INSERT INTO t1 VALUES (1,1), (2,2), (3,3); +CREATE TABLE t2(pk INT PRIMARY KEY, i INT) ENGINE = MYISAM; +INSERT INTO t2 VALUES (1,1), (2,2), (3,3); +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON TRUE) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON TRUE) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 CROSS JOIN t_empty) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 CROSS JOIN t_empty) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +EXPLAIN +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON t_empty.i=t2.i) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +SELECT * +FROM +t1 +LEFT OUTER JOIN +(t2 INNER JOIN t_empty ON t_empty.i=t2.i) +ON t1.pk=t2.pk +WHERE t2.pk <> 2; +pk i pk i pk i +DROP TABLE t1,t2,t_empty; End of 5.1 tests # # Bug#54515: Crash in opt_range.cc::get_best_group_min_max on @@ -4886,3 +4950,22 @@ col_int_key DROP VIEW view_t1; DROP TABLE t1; # End of test BUG#54515 +# +# Bug #57203 Assertion `field_length <= 255' failed. +# +SELECT coalesce((avg(distinct (geomfromtext("point(25379 -22010)"))))) +UNION ALL +SELECT coalesce((avg(distinct (geomfromtext("point(25379 -22010)"))))) +AS foo +; +coalesce((avg(distinct (geomfromtext("point(25379 -22010)"))))) +0.0000 +0.0000 +CREATE table t1(a text); +INSERT INTO t1 VALUES (''), (''); +SELECT avg(distinct(t1.a)) FROM t1, t1 t2 +GROUP BY t2.a ORDER BY t1.a; +avg(distinct(t1.a)) +0 +DROP TABLE t1; +# End of test BUG#57203 diff --git a/mysql-test/r/sp_notembedded.result b/mysql-test/r/sp_notembedded.result index 58744a3be2d..c4f276774d5 100644 --- a/mysql-test/r/sp_notembedded.result +++ b/mysql-test/r/sp_notembedded.result @@ -198,7 +198,7 @@ VALUES('%', 'mysqltest_1', password(''), 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'N', 'N', 'N', 'N', 'N', 'Y', 'Y', 'N', 'N', 'Y', 'Y', 'N', 'N', 'N', 'N', 'N', 'Y', 'Y', 'N', '', '', '', '', '0', '0', '0', '0'); Warnings: -Warning 1364 Field 'auth_string' doesn't have a default value +Warning 1364 Field 'authentication_string' doesn't have a default value FLUSH PRIVILEGES; CREATE PROCEDURE p1(i INT) BEGIN END; DROP PROCEDURE p1; diff --git a/mysql-test/r/subselect3.result b/mysql-test/r/subselect3.result index 15546f6c75c..4c344a446ea 100644 --- a/mysql-test/r/subselect3.result +++ b/mysql-test/r/subselect3.result @@ -882,9 +882,6 @@ Level Code Message Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #2 Note 1276 Field or reference 'test.t1.c' of SELECT #3 was resolved in SELECT #2 Error 1054 Unknown column 'c' in 'field list' -Note 1003 select `c` AS `c` from (select <expr_cache><count(`test`.`t1`.`a`),`test`.`t1`.`c`>((select count(`test`.`t1`.`a`) from dual group by `t1`.`c`)) AS `(SELECT COUNT(a) FROM -(SELECT COUNT(b) FROM t1) AS x GROUP BY c -)` from `test`.`t1` group by `test`.`t1`.`b`) `y` DROP TABLE t1; End of 5.0 tests # diff --git a/mysql-test/r/subselect3_jcl6.result b/mysql-test/r/subselect3_jcl6.result index 0019a82f2dd..97e33ae49ea 100644 --- a/mysql-test/r/subselect3_jcl6.result +++ b/mysql-test/r/subselect3_jcl6.result @@ -886,9 +886,6 @@ Level Code Message Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #2 Note 1276 Field or reference 'test.t1.c' of SELECT #3 was resolved in SELECT #2 Error 1054 Unknown column 'c' in 'field list' -Note 1003 select `c` AS `c` from (select <expr_cache><count(`test`.`t1`.`a`),`test`.`t1`.`c`>((select count(`test`.`t1`.`a`) from dual group by `t1`.`c`)) AS `(SELECT COUNT(a) FROM -(SELECT COUNT(b) FROM t1) AS x GROUP BY c -)` from `test`.`t1` group by `test`.`t1`.`b`) `y` DROP TABLE t1; End of 5.0 tests # diff --git a/mysql-test/r/subselect_no_mat.result b/mysql-test/r/subselect_no_mat.result index bcde5a24fb9..9365223b1a6 100644 --- a/mysql-test/r/subselect_no_mat.result +++ b/mysql-test/r/subselect_no_mat.result @@ -5256,8 +5256,90 @@ ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE)); SELECT * FROM t2 UNION SELECT * FROM t2 ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE)); DROP TABLE t1,t2; +# +# Bug #58818: Incorrect result for IN/ANY subquery +# with HAVING condition +# +CREATE TABLE t1(i INT); +INSERT INTO t1 VALUES (1), (2), (3); +CREATE TABLE t1s(i INT); +INSERT INTO t1s VALUES (10), (20), (30); +CREATE TABLE t2s(i INT); +INSERT INTO t2s VALUES (100), (200), (300); +SELECT * FROM t1 +WHERE t1.i NOT IN +( +SELECT STRAIGHT_JOIN t2s.i +FROM +t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i +HAVING t2s.i = 999 +); +i +1 +2 +3 +SELECT * FROM t1 +WHERE t1.I IN +( +SELECT STRAIGHT_JOIN t2s.i +FROM +t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i +HAVING t2s.i = 999 +) IS UNKNOWN; +i +SELECT * FROM t1 +WHERE NOT t1.I = ANY +( +SELECT STRAIGHT_JOIN t2s.i +FROM +t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i +HAVING t2s.i = 999 +); +i +1 +2 +3 +SELECT * FROM t1 +WHERE t1.i = ANY ( +SELECT STRAIGHT_JOIN t2s.i +FROM +t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i +HAVING t2s.i = 999 +) IS UNKNOWN; +i +DROP TABLE t1,t1s,t2s; End of 5.1 tests # +# Bug #11765713 58705: +# OPTIMIZER LET ENGINE DEPEND ON UNINITIALIZED VALUES +# CREATED BY OPT_SUM_QUERY +# +CREATE TABLE t1(a INT NOT NULL, KEY (a)); +INSERT INTO t1 VALUES (0), (1); +SELECT 1 as foo FROM t1 WHERE a < SOME +(SELECT a FROM t1 WHERE a <=> +(SELECT a FROM t1) +); +ERROR 21000: Subquery returns more than 1 row +SELECT 1 as foo FROM t1 WHERE a < SOME +(SELECT a FROM t1 WHERE a <=> +(SELECT a FROM t1 where a is null) +); +foo +DROP TABLE t1; +# +# Bug #57704: Cleanup code dies with void TABLE::set_keyread(bool): +# Assertion `file' failed. +# +CREATE TABLE t1 (a INT); +SELECT 1 FROM +(SELECT ROW( +(SELECT 1 FROM t1 RIGHT JOIN +(SELECT 1 FROM t1, t1 t2) AS d ON 1), +1) FROM t1) AS e; +ERROR 21000: Operand should contain 1 column(s) +DROP TABLE t1; +# # No BUG#, a case brought from 5.2's innodb_mysql_lock.test # create table t1 (i int not null primary key); diff --git a/mysql-test/r/subselect_no_opts.result b/mysql-test/r/subselect_no_opts.result index a8b4065d257..785e33a94b8 100644 --- a/mysql-test/r/subselect_no_opts.result +++ b/mysql-test/r/subselect_no_opts.result @@ -5253,8 +5253,90 @@ ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE)); SELECT * FROM t2 UNION SELECT * FROM t2 ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE)); DROP TABLE t1,t2; +# +# Bug #58818: Incorrect result for IN/ANY subquery +# with HAVING condition +# +CREATE TABLE t1(i INT); +INSERT INTO t1 VALUES (1), (2), (3); +CREATE TABLE t1s(i INT); +INSERT INTO t1s VALUES (10), (20), (30); +CREATE TABLE t2s(i INT); +INSERT INTO t2s VALUES (100), (200), (300); +SELECT * FROM t1 +WHERE t1.i NOT IN +( +SELECT STRAIGHT_JOIN t2s.i +FROM +t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i +HAVING t2s.i = 999 +); +i +1 +2 +3 +SELECT * FROM t1 +WHERE t1.I IN +( +SELECT STRAIGHT_JOIN t2s.i +FROM +t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i +HAVING t2s.i = 999 +) IS UNKNOWN; +i +SELECT * FROM t1 +WHERE NOT t1.I = ANY +( +SELECT STRAIGHT_JOIN t2s.i +FROM +t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i +HAVING t2s.i = 999 +); +i +1 +2 +3 +SELECT * FROM t1 +WHERE t1.i = ANY ( +SELECT STRAIGHT_JOIN t2s.i +FROM +t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i +HAVING t2s.i = 999 +) IS UNKNOWN; +i +DROP TABLE t1,t1s,t2s; End of 5.1 tests # +# Bug #11765713 58705: +# OPTIMIZER LET ENGINE DEPEND ON UNINITIALIZED VALUES +# CREATED BY OPT_SUM_QUERY +# +CREATE TABLE t1(a INT NOT NULL, KEY (a)); +INSERT INTO t1 VALUES (0), (1); +SELECT 1 as foo FROM t1 WHERE a < SOME +(SELECT a FROM t1 WHERE a <=> +(SELECT a FROM t1) +); +ERROR 21000: Subquery returns more than 1 row +SELECT 1 as foo FROM t1 WHERE a < SOME +(SELECT a FROM t1 WHERE a <=> +(SELECT a FROM t1 where a is null) +); +foo +DROP TABLE t1; +# +# Bug #57704: Cleanup code dies with void TABLE::set_keyread(bool): +# Assertion `file' failed. +# +CREATE TABLE t1 (a INT); +SELECT 1 FROM +(SELECT ROW( +(SELECT 1 FROM t1 RIGHT JOIN +(SELECT 1 FROM t1, t1 t2) AS d ON 1), +1) FROM t1) AS e; +ERROR 21000: Operand should contain 1 column(s) +DROP TABLE t1; +# # No BUG#, a case brought from 5.2's innodb_mysql_lock.test # create table t1 (i int not null primary key); diff --git a/mysql-test/r/subselect_no_semijoin.result b/mysql-test/r/subselect_no_semijoin.result index 511fa140ca8..b53bb7918c8 100644 --- a/mysql-test/r/subselect_no_semijoin.result +++ b/mysql-test/r/subselect_no_semijoin.result @@ -5253,8 +5253,90 @@ ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE)); SELECT * FROM t2 UNION SELECT * FROM t2 ORDER BY (SELECT * FROM t1 WHERE MATCH(a) AGAINST ('+abc' IN BOOLEAN MODE)); DROP TABLE t1,t2; +# +# Bug #58818: Incorrect result for IN/ANY subquery +# with HAVING condition +# +CREATE TABLE t1(i INT); +INSERT INTO t1 VALUES (1), (2), (3); +CREATE TABLE t1s(i INT); +INSERT INTO t1s VALUES (10), (20), (30); +CREATE TABLE t2s(i INT); +INSERT INTO t2s VALUES (100), (200), (300); +SELECT * FROM t1 +WHERE t1.i NOT IN +( +SELECT STRAIGHT_JOIN t2s.i +FROM +t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i +HAVING t2s.i = 999 +); +i +1 +2 +3 +SELECT * FROM t1 +WHERE t1.I IN +( +SELECT STRAIGHT_JOIN t2s.i +FROM +t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i +HAVING t2s.i = 999 +) IS UNKNOWN; +i +SELECT * FROM t1 +WHERE NOT t1.I = ANY +( +SELECT STRAIGHT_JOIN t2s.i +FROM +t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i +HAVING t2s.i = 999 +); +i +1 +2 +3 +SELECT * FROM t1 +WHERE t1.i = ANY ( +SELECT STRAIGHT_JOIN t2s.i +FROM +t1s LEFT OUTER JOIN t2s ON t2s.i = t1s.i +HAVING t2s.i = 999 +) IS UNKNOWN; +i +DROP TABLE t1,t1s,t2s; End of 5.1 tests # +# Bug #11765713 58705: +# OPTIMIZER LET ENGINE DEPEND ON UNINITIALIZED VALUES +# CREATED BY OPT_SUM_QUERY +# +CREATE TABLE t1(a INT NOT NULL, KEY (a)); +INSERT INTO t1 VALUES (0), (1); +SELECT 1 as foo FROM t1 WHERE a < SOME +(SELECT a FROM t1 WHERE a <=> +(SELECT a FROM t1) +); +ERROR 21000: Subquery returns more than 1 row +SELECT 1 as foo FROM t1 WHERE a < SOME +(SELECT a FROM t1 WHERE a <=> +(SELECT a FROM t1 where a is null) +); +foo +DROP TABLE t1; +# +# Bug #57704: Cleanup code dies with void TABLE::set_keyread(bool): +# Assertion `file' failed. +# +CREATE TABLE t1 (a INT); +SELECT 1 FROM +(SELECT ROW( +(SELECT 1 FROM t1 RIGHT JOIN +(SELECT 1 FROM t1, t1 t2) AS d ON 1), +1) FROM t1) AS e; +ERROR 21000: Operand should contain 1 column(s) +DROP TABLE t1; +# # No BUG#, a case brought from 5.2's innodb_mysql_lock.test # create table t1 (i int not null primary key); diff --git a/mysql-test/r/table_options.result b/mysql-test/r/table_options.result index d0ebbeb0197..2d192193e84 100644 --- a/mysql-test/r/table_options.result +++ b/mysql-test/r/table_options.result @@ -3,9 +3,9 @@ SET @OLD_SQL_MODE=@@SQL_MODE; SET SQL_MODE='IGNORE_BAD_TABLE_OPTIONS'; create table t1 (a int fkey=vvv, key akey (a) dff=vvv) tkey1='1v1'; Warnings: -Warning 1707 Unknown option 'fkey' -Warning 1707 Unknown option 'dff' -Warning 1707 Unknown option 'tkey1' +Warning 1722 Unknown option 'fkey' +Warning 1722 Unknown option 'dff' +Warning 1722 Unknown option 'tkey1' show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -16,10 +16,10 @@ drop table t1; #reassiginig options in the same line create table t1 (a int fkey=vvv, key akey (a) dff=vvv) tkey1=1v1 TKEY1=DEFAULT tkey1=1v2 tkey2=2v1; Warnings: -Warning 1707 Unknown option 'fkey' -Warning 1707 Unknown option 'dff' -Warning 1707 Unknown option 'tkey1' -Warning 1707 Unknown option 'tkey2' +Warning 1722 Unknown option 'fkey' +Warning 1722 Unknown option 'dff' +Warning 1722 Unknown option 'tkey1' +Warning 1722 Unknown option 'tkey2' show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -29,7 +29,7 @@ t1 CREATE TABLE `t1` ( #add option alter table t1 tkey4=4v1; Warnings: -Warning 1707 Unknown option 'tkey4' +Warning 1722 Unknown option 'tkey4' show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -39,8 +39,8 @@ t1 CREATE TABLE `t1` ( #remove options alter table t1 tkey3=DEFAULT tkey4=DEFAULT; Warnings: -Warning 1707 Unknown option 'tkey3' -Warning 1707 Unknown option 'tkey4' +Warning 1722 Unknown option 'tkey3' +Warning 1722 Unknown option 'tkey4' show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -50,11 +50,11 @@ t1 CREATE TABLE `t1` ( drop table t1; create table t1 (a int fkey1=v1, key akey (a) kkey1=v1) tkey1=1v1 tkey1=1v2 TKEY1=DEFAULT tkey2=2v1 tkey3=3v1; Warnings: -Warning 1707 Unknown option 'fkey1' -Warning 1707 Unknown option 'kkey1' -Warning 1707 Unknown option 'TKEY1' -Warning 1707 Unknown option 'tkey2' -Warning 1707 Unknown option 'tkey3' +Warning 1722 Unknown option 'fkey1' +Warning 1722 Unknown option 'kkey1' +Warning 1722 Unknown option 'TKEY1' +Warning 1722 Unknown option 'tkey2' +Warning 1722 Unknown option 'tkey3' show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -64,7 +64,7 @@ t1 CREATE TABLE `t1` ( #change field with option with the same value alter table t1 change a a int `FKEY1`='v1'; Warnings: -Warning 1707 Unknown option 'FKEY1' +Warning 1722 Unknown option 'FKEY1' show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -74,7 +74,7 @@ t1 CREATE TABLE `t1` ( #change field with option with a different value alter table t1 change a a int fkey1=v2; Warnings: -Warning 1707 Unknown option 'fkey1' +Warning 1722 Unknown option 'fkey1' show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -93,7 +93,7 @@ t1 CREATE TABLE `t1` ( #new key with options alter table t1 add key bkey (b) kkey2=v1; Warnings: -Warning 1707 Unknown option 'kkey2' +Warning 1722 Unknown option 'kkey2' show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -105,8 +105,8 @@ t1 CREATE TABLE `t1` ( #new column with options alter table t1 add column c int fkey1=v1 fkey2=v2; Warnings: -Warning 1707 Unknown option 'fkey1' -Warning 1707 Unknown option 'fkey2' +Warning 1722 Unknown option 'fkey1' +Warning 1722 Unknown option 'fkey2' show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -141,7 +141,7 @@ t1 CREATE TABLE `t1` ( #add column with options after delete alter table t1 add column b int fkey2=v1; Warnings: -Warning 1707 Unknown option 'fkey2' +Warning 1722 Unknown option 'fkey2' show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -154,7 +154,7 @@ t1 CREATE TABLE `t1` ( #add key alter table t1 add key bkey (b) kkey2=v2; Warnings: -Warning 1707 Unknown option 'kkey2' +Warning 1722 Unknown option 'kkey2' show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -168,7 +168,7 @@ t1 CREATE TABLE `t1` ( drop table t1; create table t1 (a int) tkey1=100; Warnings: -Warning 1707 Unknown option 'tkey1' +Warning 1722 Unknown option 'tkey1' show create table t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 29f477fcfd2..becd74093da 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -1542,6 +1542,7 @@ INSERT INTO t1 VALUES (0.2),(0.1); SELECT 1 FROM t1 GROUP BY @a:= (SELECT ROUND(f1) FROM t1 WHERE @a=f1); 1 1 +1 DROP TABLE t1; CREATE TABLE t1 AS SELECT @a:= CAST(1 AS UNSIGNED) AS a; SHOW CREATE TABLE t1; diff --git a/mysql-test/r/xa.result b/mysql-test/r/xa.result index 7b580abb19f..3ec169016eb 100644 --- a/mysql-test/r/xa.result +++ b/mysql-test/r/xa.result @@ -206,8 +206,8 @@ DROP TABLE t1; # FAILED # DROP TABLE IF EXISTS t1, t2; -CREATE TABLE t1 (a INT); -CREATE TABLE t2 (a INT); +CREATE TABLE t1 (a INT) engine=innodb; +CREATE TABLE t2 (a INT) engine=innodb; START TRANSACTION; INSERT INTO t1 VALUES (1); # Connection con2 diff --git a/mysql-test/suite/binlog/t/binlog_database.test b/mysql-test/suite/binlog/t/binlog_database.test index ee236b4e5ea..9c2a43575fc 100644 --- a/mysql-test/suite/binlog/t/binlog_database.test +++ b/mysql-test/suite/binlog/t/binlog_database.test @@ -2,6 +2,9 @@ # correctly. We test all three modes in the same file to avoid # unecessary server restarts. +--source include/have_innodb.inc +--source include/have_binlog_format_statement.inc + set binlog_format=statement; source extra/binlog_tests/database.test; set binlog_format=mixed; diff --git a/mysql-test/suite/binlog/t/binlog_spurious_ddl_errors-master.opt b/mysql-test/suite/binlog/t/binlog_spurious_ddl_errors-master.opt index ffa981152ea..627becdbfb5 100644 --- a/mysql-test/suite/binlog/t/binlog_spurious_ddl_errors-master.opt +++ b/mysql-test/suite/binlog/t/binlog_spurious_ddl_errors-master.opt @@ -1 +1 @@ ---innodb $EXAMPLE_PLUGIN_OPT +--innodb diff --git a/mysql-test/suite/binlog/t/binlog_unsafe-master.opt b/mysql-test/suite/binlog/t/binlog_unsafe-master.opt index 78bcdd89270..50fc48d277b 100644 --- a/mysql-test/suite/binlog/t/binlog_unsafe-master.opt +++ b/mysql-test/suite/binlog/t/binlog_unsafe-master.opt @@ -1 +1 @@ -$UDF_EXAMPLE_LIB_OPT --log-output=file,table +--log-output=file,table diff --git a/mysql-test/suite/federated/federated_bug_35333.result b/mysql-test/suite/federated/federated_bug_35333.result index ca7aa960b73..e1319cfeeae 100644 --- a/mysql-test/suite/federated/federated_bug_35333.result +++ b/mysql-test/suite/federated/federated_bug_35333.result @@ -10,35 +10,10 @@ # error that occurs during a query against I_S.TABLES.de CREATE DATABASE federated; CREATE DATABASE federated; -CREATE DATABASE IF NOT EXISTS realdb; -DROP TABLE IF EXISTS realdb.t0; DROP TABLE IF EXISTS federated.t0; # -# Create the base table to be referenced -# -CREATE TABLE realdb.t0 (a text, b text) ENGINE=MYISAM; -# -# Create a federated table with a bogus port number -# -CREATE TABLE federated.t0 (a text, b text) ENGINE=FEDERATED -CONNECTION='mysql://root@127.0.0.1:63333/realdb/t0'; -# -# Trigger a federated system error during a INFORMATION_SCHEMA.TABLES query -# -SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT, TABLE_ROWS, DATA_LENGTH, TABLE_COMMENT -FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'realdb' or TABLE_SCHEMA = 'federated'; -TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_ROWS DATA_LENGTH TABLE_COMMENT -federated t0 BASE TABLE FEDERATED NULL 0 Unable to connect to foreign data source: Can't connect to MySQL server on '127.0.0.1' (socket errno) -realdb t0 BASE TABLE MyISAM Dynamic 0 0 -Warnings: -Warning 1429 Unable to connect to foreign data source: Can't connect to MySQL server on '127.0.0.1' (socket errno) -SHOW WARNINGS; -Level Code Message -Warning 1429 Unable to connect to foreign data source: Can't connect to MySQL server on '127.0.0.1' (socket errno) -# # Create a MyISAM table then corrupt the file # -USE realdb; CREATE TABLE t1 (c1 int) ENGINE=MYISAM; # # Corrupt the MyISAM table by deleting the base file @@ -49,19 +24,18 @@ CREATE TABLE t1 (c1 int) ENGINE=MYISAM; SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT, TABLE_ROWS, DATA_LENGTH, TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_ROWS DATA_LENGTH TABLE_COMMENT -realdb t1 BASE TABLE NULL NULL NULL NULL Can't find file: 't1' (errno: 2) +test t1 BASE TABLE NULL NULL NULL NULL Can't find file: 't1' (errno: 2) Warnings: Warning 1017 Can't find file: 't1' (errno: 2) SHOW WARNINGS; Level Code Message Warning 1017 Can't find file: 't1' (errno: 2) +DROP TABLE t1; +ERROR 42S02: Unknown table 't1' # # Cleanup # -DROP TABLE IF EXISTS realdb.t0; -DROP TABLE IF EXISTS federated.t0; -DROP DATABASE realdb; DROP TABLE IF EXISTS federated.t1; -DROP DATABASE federated; +DROP DATABASE IF EXISTS federated; DROP TABLE IF EXISTS federated.t1; -DROP DATABASE federated; +DROP DATABASE IF EXISTS federated; diff --git a/mysql-test/suite/federated/federated_bug_35333.test b/mysql-test/suite/federated/federated_bug_35333.test index 58c217d24f2..8bce63c34e5 100644 --- a/mysql-test/suite/federated/federated_bug_35333.test +++ b/mysql-test/suite/federated/federated_bug_35333.test @@ -12,12 +12,13 @@ --source federated.inc --disable_warnings -CREATE DATABASE IF NOT EXISTS realdb; # Federated database exists -DROP TABLE IF EXISTS realdb.t0; DROP TABLE IF EXISTS federated.t0; --enable_warnings +--disable_parsing +# This test doesn't work with federatedx, as it doesn't allow wrong connections + --echo # --echo # Create the base table to be referenced --echo # @@ -42,18 +43,20 @@ SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT, TABLE_ROWS, DAT # Remove O/S-specific socket error --replace_regex /\(.*\)/(socket errno)/ SHOW WARNINGS; +DROP TABLE federated.t0; + +--enable_parsing --echo # --echo # Create a MyISAM table then corrupt the file --echo # -USE realdb; CREATE TABLE t1 (c1 int) ENGINE=MYISAM; --echo # --echo # Corrupt the MyISAM table by deleting the base file --echo # let $MYSQLD_DATADIR= `SELECT @@datadir`; ---remove_file $MYSQLD_DATADIR/realdb/t1.MYD ---remove_file $MYSQLD_DATADIR/realdb/t1.MYI +--remove_file $MYSQLD_DATADIR/test/t1.MYD +--remove_file $MYSQLD_DATADIR/test/t1.MYI --echo # --echo # Trigger a MyISAM system error during an INFORMATION_SCHEMA.TABLES query @@ -62,13 +65,13 @@ SELECT TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, ENGINE, ROW_FORMAT, TABLE_ROWS, DAT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; SHOW WARNINGS; +--disable_warnings +--error 1051 +DROP TABLE t1; +--enable_warnings + --echo # --echo # Cleanup --echo # ---disable_warnings -DROP TABLE IF EXISTS realdb.t0; -DROP TABLE IF EXISTS federated.t0; -DROP DATABASE realdb; ---enable_warnings --source federated_cleanup.inc diff --git a/mysql-test/suite/federated/federated_debug.test b/mysql-test/suite/federated/federated_debug.test index 2183def4610..381c00a5154 100644 --- a/mysql-test/suite/federated/federated_debug.test +++ b/mysql-test/suite/federated/federated_debug.test @@ -19,7 +19,7 @@ eval CREATE TABLE t1(a INT) ENGINE=FEDERATED SELECT * FROM t1; --echo # Start a asynchronous reload ---exec $MYSQLADMIN --no-defaults --default-character-set=latin1 -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= refresh 2>&1 +--exec $MYSQLADMIN --default-character-set=latin1 -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= refresh 2>&1 --echo # Wait for tables to be closed let $show_statement= SHOW STATUS LIKE 'Open_tables'; diff --git a/mysql-test/suite/innodb/r/innodb-create-options.result b/mysql-test/suite/innodb/r/innodb-create-options.result index aec9d731ce6..94c84fcf60f 100644 --- a/mysql-test/suite/innodb/r/innodb-create-options.result +++ b/mysql-test/suite/innodb/r/innodb-create-options.result @@ -80,26 +80,26 @@ SHOW WARNINGS; Level Code Message SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=8 +t1 Compressed row_format=COMPRESSED key_block_size=8 ALTER TABLE t1 ADD COLUMN f1 INT; SHOW WARNINGS; Level Code Message SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=8 +t1 Compressed row_format=COMPRESSED key_block_size=8 DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=16; SHOW WARNINGS; Level Code Message SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compressed KEY_BLOCK_SIZE=16 +t1 Compressed key_block_size=16 ALTER TABLE t1 ADD COLUMN f1 INT; SHOW WARNINGS; Level Code Message SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compressed KEY_BLOCK_SIZE=16 +t1 Compressed key_block_size=16 # Test 3) StrictMode=ON, ALTER with each ROW_FORMAT & a valid non-zero KEY_BLOCK_SIZE DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ); @@ -132,13 +132,13 @@ SHOW WARNINGS; Level Code Message SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compressed KEY_BLOCK_SIZE=16 +t1 Compressed key_block_size=16 ALTER TABLE t1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; SHOW WARNINGS; Level Code Message SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=1 +t1 Compressed row_format=COMPRESSED key_block_size=1 # Test 4) StrictMode=ON, CREATE with ROW_FORMAT=COMPACT, ALTER with a valid non-zero KEY_BLOCK_SIZE DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT; @@ -186,7 +186,7 @@ SHOW WARNINGS; Level Code Message SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=16 +t1 Compressed row_format=COMPRESSED key_block_size=16 DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT; ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1; @@ -194,7 +194,7 @@ SHOW WARNINGS; Level Code Message SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compressed KEY_BLOCK_SIZE=1 +t1 Compressed key_block_size=1 # Test 5) StrictMode=ON, CREATE with a valid KEY_BLOCK_SIZE # ALTER with each ROW_FORMAT DROP TABLE IF EXISTS t1; @@ -234,7 +234,7 @@ SHOW WARNINGS; Level Code Message SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=2 +t1 Compressed row_format=COMPRESSED key_block_size=2 ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0; SHOW WARNINGS; Level Code Message @@ -495,7 +495,7 @@ Level Code Message Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compact row_format=COMPACT KEY_BLOCK_SIZE=1 +t1 Compact row_format=COMPACT key_block_size=1 DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2; Warnings: @@ -505,7 +505,7 @@ Level Code Message Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Redundant row_format=REDUNDANT KEY_BLOCK_SIZE=2 +t1 Redundant row_format=REDUNDANT key_block_size=2 DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4; Warnings: @@ -515,33 +515,33 @@ Level Code Message Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4 unless ROW_FORMAT=COMPRESSED. SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Dynamic row_format=DYNAMIC KEY_BLOCK_SIZE=4 +t1 Dynamic row_format=DYNAMIC key_block_size=4 DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; SHOW WARNINGS; Level Code Message SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=8 +t1 Compressed row_format=COMPRESSED key_block_size=8 ALTER TABLE t1 ADD COLUMN f1 INT; SHOW WARNINGS; Level Code Message SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=8 +t1 Compressed row_format=COMPRESSED key_block_size=8 DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=16; SHOW WARNINGS; Level Code Message SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compressed KEY_BLOCK_SIZE=16 +t1 Compressed key_block_size=16 ALTER TABLE t1 ADD COLUMN f1 INT; SHOW WARNINGS; Level Code Message SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compressed KEY_BLOCK_SIZE=16 +t1 Compressed key_block_size=16 # Test 11) StrictMode=OFF, ALTER with each ROW_FORMAT & a valid KEY_BLOCK_SIZE DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ); @@ -555,7 +555,7 @@ Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT. SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compact row_format=FIXED KEY_BLOCK_SIZE=1 +t1 Compact row_format=FIXED key_block_size=1 DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ); ALTER TABLE t1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=2; @@ -566,7 +566,7 @@ Level Code Message Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compact row_format=COMPACT KEY_BLOCK_SIZE=2 +t1 Compact row_format=COMPACT key_block_size=2 DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ); ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4; @@ -577,7 +577,7 @@ Level Code Message Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4 unless ROW_FORMAT=COMPRESSED. SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Dynamic row_format=DYNAMIC KEY_BLOCK_SIZE=4 +t1 Dynamic row_format=DYNAMIC key_block_size=4 DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ); ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=8; @@ -588,7 +588,7 @@ Level Code Message Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=8 unless ROW_FORMAT=COMPRESSED. SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Redundant row_format=REDUNDANT KEY_BLOCK_SIZE=8 +t1 Redundant row_format=REDUNDANT key_block_size=8 DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ); ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=16; @@ -596,13 +596,13 @@ SHOW WARNINGS; Level Code Message SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compressed KEY_BLOCK_SIZE=16 +t1 Compressed key_block_size=16 ALTER TABLE t1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; SHOW WARNINGS; Level Code Message SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=1 +t1 Compressed row_format=COMPRESSED key_block_size=1 # Test 12) StrictMode=OFF, CREATE with ROW_FORMAT=COMPACT, ALTER with a valid KEY_BLOCK_SIZE DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT; @@ -617,7 +617,7 @@ Level Code Message Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compact row_format=COMPACT KEY_BLOCK_SIZE=2 +t1 Compact row_format=COMPACT key_block_size=2 ALTER TABLE t1 ROW_FORMAT=REDUNDANT; Warnings: Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. @@ -626,7 +626,7 @@ Level Code Message Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Redundant row_format=REDUNDANT KEY_BLOCK_SIZE=2 +t1 Redundant row_format=REDUNDANT key_block_size=2 ALTER TABLE t1 ROW_FORMAT=DYNAMIC; Warnings: Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. @@ -635,19 +635,19 @@ Level Code Message Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Dynamic row_format=DYNAMIC KEY_BLOCK_SIZE=2 +t1 Dynamic row_format=DYNAMIC key_block_size=2 ALTER TABLE t1 ROW_FORMAT=COMPRESSED; SHOW WARNINGS; Level Code Message SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=2 +t1 Compressed row_format=COMPRESSED key_block_size=2 ALTER TABLE t1 KEY_BLOCK_SIZE=4; SHOW WARNINGS; Level Code Message SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=4 +t1 Compressed row_format=COMPRESSED key_block_size=4 DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT; ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=8; @@ -655,7 +655,7 @@ SHOW WARNINGS; Level Code Message SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compressed KEY_BLOCK_SIZE=8 +t1 Compressed key_block_size=8 # Test 13) StrictMode=OFF, CREATE with a valid KEY_BLOCK_SIZE # ALTER with each ROW_FORMAT DROP TABLE IF EXISTS t1; @@ -684,7 +684,7 @@ Level Code Message Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED. SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compact row_format=COMPACT KEY_BLOCK_SIZE=16 +t1 Compact row_format=COMPACT key_block_size=16 ALTER TABLE t1 ROW_FORMAT=REDUNDANT; Warnings: Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED. @@ -693,7 +693,7 @@ Level Code Message Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED. SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Redundant row_format=REDUNDANT KEY_BLOCK_SIZE=16 +t1 Redundant row_format=REDUNDANT key_block_size=16 ALTER TABLE t1 ROW_FORMAT=DYNAMIC; Warnings: Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED. @@ -702,13 +702,13 @@ Level Code Message Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED. SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Dynamic row_format=DYNAMIC KEY_BLOCK_SIZE=16 +t1 Dynamic row_format=DYNAMIC key_block_size=16 ALTER TABLE t1 ROW_FORMAT=COMPRESSED; SHOW WARNINGS; Level Code Message SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=16 +t1 Compressed row_format=COMPRESSED key_block_size=16 ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0; SHOW WARNINGS; Level Code Message @@ -731,7 +731,7 @@ Level Code Message Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=15. SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compact KEY_BLOCK_SIZE=15 +t1 Compact key_block_size=15 # Test 15) StrictMode=OFF, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and a valid KEY_BLOCK_SIZE are remembered but not used when ROW_FORMAT is reverted to Antelope and then used again when ROW_FORMAT=Barracuda. @@ -741,7 +741,7 @@ SHOW WARNINGS; Level Code Message SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=1 +t1 Compressed row_format=COMPRESSED key_block_size=1 SET GLOBAL innodb_file_format=Antelope; ALTER TABLE t1 ADD COLUMN f1 INT; Warnings: @@ -757,14 +757,14 @@ Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelop Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT. SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compact row_format=COMPRESSED KEY_BLOCK_SIZE=1 +t1 Compact row_format=COMPRESSED key_block_size=1 SET GLOBAL innodb_file_format=Barracuda; ALTER TABLE t1 ADD COLUMN f2 INT; SHOW WARNINGS; Level Code Message SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=1 +t1 Compressed row_format=COMPRESSED key_block_size=1 DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC; SHOW WARNINGS; @@ -800,7 +800,7 @@ SHOW WARNINGS; Level Code Message SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=2 +t1 Compressed row_format=COMPRESSED key_block_size=2 SET GLOBAL innodb_file_per_table=OFF; ALTER TABLE t1 ADD COLUMN f1 INT; Warnings: @@ -816,14 +816,14 @@ Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table. Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT. SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compact row_format=COMPRESSED KEY_BLOCK_SIZE=2 +t1 Compact row_format=COMPRESSED key_block_size=2 SET GLOBAL innodb_file_per_table=ON; ALTER TABLE t1 ADD COLUMN f2 INT; SHOW WARNINGS; Level Code Message SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; TABLE_NAME ROW_FORMAT CREATE_OPTIONS -t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=2 +t1 Compressed row_format=COMPRESSED key_block_size=2 DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC; SHOW WARNINGS; diff --git a/mysql-test/suite/innodb/r/innodb-use-sys-malloc.result b/mysql-test/suite/innodb/r/innodb-use-sys-malloc.result deleted file mode 100644 index 2ec4c7c8130..00000000000 --- a/mysql-test/suite/innodb/r/innodb-use-sys-malloc.result +++ /dev/null @@ -1,48 +0,0 @@ -SELECT @@GLOBAL.innodb_use_sys_malloc; -@@GLOBAL.innodb_use_sys_malloc -1 -1 Expected -SET @@GLOBAL.innodb_use_sys_malloc=0; -ERROR HY000: Variable 'innodb_use_sys_malloc' is a read only variable -Expected error 'Read only variable' -SELECT @@GLOBAL.innodb_use_sys_malloc; -@@GLOBAL.innodb_use_sys_malloc -1 -1 Expected -drop table if exists t1; -create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; -insert into t1 values (1),(2),(3),(4),(5),(6),(7); -select * from t1; -a -1 -2 -3 -4 -5 -6 -7 -drop table t1; -SELECT @@GLOBAL.innodb_use_sys_malloc; -@@GLOBAL.innodb_use_sys_malloc -1 -1 Expected -SET @@GLOBAL.innodb_use_sys_malloc=0; -ERROR HY000: Variable 'innodb_use_sys_malloc' is a read only variable -Expected error 'Read only variable' -SELECT @@GLOBAL.innodb_use_sys_malloc; -@@GLOBAL.innodb_use_sys_malloc -1 -1 Expected -drop table if exists t1; -create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; -insert into t1 values (1),(2),(3),(4),(5),(6),(7); -select * from t1; -a -1 -2 -3 -4 -5 -6 -7 -drop table t1; diff --git a/mysql-test/suite/innodb/r/innodb_index_large_prefix.result b/mysql-test/suite/innodb/r/innodb_index_large_prefix.result index 6e2d3527ee9..b8f8fcfc749 100644 --- a/mysql-test/suite/innodb/r/innodb_index_large_prefix.result +++ b/mysql-test/suite/innodb/r/innodb_index_large_prefix.result @@ -37,7 +37,7 @@ select @@session.tx_isolation; REPEATABLE-READ explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE worklog5743 ref idx idx 5 const 1 Using where +1 SIMPLE worklog5743 ref idx idx 5 const 1 select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; a1 a2 = repeat("a", 10000) 9 1 @@ -60,7 +60,7 @@ select @@session.tx_isolation; REPEATABLE-READ explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE worklog5743 ref idx idx 5 const 1 Using where +1 SIMPLE worklog5743 ref idx idx 5 const 1 select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; a1 a2 = repeat("a", 10000) 9 1 @@ -92,7 +92,7 @@ select @@session.tx_isolation; REPEATABLE-READ explain select a1, a2 = repeat("a", 10000) from worklog5743_2 where a1 = 9; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE worklog5743_2 ref idx1 idx1 5 const 1 Using where +1 SIMPLE worklog5743_2 ref idx1 idx1 5 const 1 select a1, a2 = repeat("a", 10000) from worklog5743_2 where a1 = 9; a1 a2 = repeat("a", 10000) 9 1 @@ -121,7 +121,7 @@ select @@session.tx_isolation; REPEATABLE-READ explain select a1 from worklog5743 where a1 = 9; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE worklog5743 ref idx idx 5 const 1 Using where; Using index +1 SIMPLE worklog5743 ref idx idx 5 const 1 Using index select a1 from worklog5743 where a1 = 9; a1 9 diff --git a/mysql-test/suite/innodb/t/innodb-use-sys-malloc-master.opt b/mysql-test/suite/innodb/t/innodb-use-sys-malloc-master.opt deleted file mode 100644 index 41ac793df88..00000000000 --- a/mysql-test/suite/innodb/t/innodb-use-sys-malloc-master.opt +++ /dev/null @@ -1,2 +0,0 @@ ---default-storage-engine=MyISAM ---loose-innodb-use-sys-malloc=true diff --git a/mysql-test/suite/innodb/t/innodb-use-sys-malloc.test b/mysql-test/suite/innodb/t/innodb-use-sys-malloc.test deleted file mode 100644 index c485755378c..00000000000 --- a/mysql-test/suite/innodb/t/innodb-use-sys-malloc.test +++ /dev/null @@ -1,27 +0,0 @@ -# XtraDB has lots of "still reachable" memory leak warnings at shutdown when -# --innodb-use-sys-malloc ---source include/not_valgrind.inc - -#display current value of innodb_use_sys_malloc -SELECT @@GLOBAL.innodb_use_sys_malloc; ---echo 1 Expected - -#try changing it. Should fail. ---error ER_INCORRECT_GLOBAL_LOCAL_VAR -SET @@GLOBAL.innodb_use_sys_malloc=0; ---echo Expected error 'Read only variable' - -SELECT @@GLOBAL.innodb_use_sys_malloc; ---echo 1 Expected - - -#do some stuff to see if it works. ---disable_warnings -drop table if exists t1; ---enable_warnings - -create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1; -insert into t1 values (1),(2),(3),(4),(5),(6),(7); -select * from t1; -drop table t1; - diff --git a/mysql-test/suite/parts/r/partition_auto_increment_maria.result b/mysql-test/suite/parts/r/partition_auto_increment_maria.result index 757eaca3a60..b9310a2a314 100644 --- a/mysql-test/suite/parts/r/partition_auto_increment_maria.result +++ b/mysql-test/suite/parts/r/partition_auto_increment_maria.result @@ -136,6 +136,42 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`c1`) ) ENGINE=Aria AUTO_INCREMENT=102 DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 DROP TABLE t1; +CREATE TABLE t1 +(a INT NULL AUTO_INCREMENT, +UNIQUE KEY (a)) +ENGINE='Aria'; +SET LAST_INSERT_ID = 999; +SET INSERT_ID = 0; +INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL; +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +999 +SELECT * FROM t1; +a +1 +INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL; +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +999 +SELECT * FROM t1; +a +0 +UPDATE t1 SET a = 1 WHERE a IS NULL; +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +999 +SELECT * FROM t1; +a +0 +UPDATE t1 SET a = NULL WHERE a = 1; +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +999 +SELECT * FROM t1; +a +0 +DROP TABLE t1; +SET INSERT_ID = 1; # Simple test with NULL CREATE TABLE t1 ( c1 INT NOT NULL AUTO_INCREMENT, @@ -1070,4 +1106,40 @@ c1 c2 2 20 127 40 DROP TABLE t; +CREATE TABLE t1 +(a INT NULL AUTO_INCREMENT, +UNIQUE KEY (a)) +ENGINE='Aria' +PARTITION BY KEY(a) PARTITIONS 2; +SET LAST_INSERT_ID = 999; +SET INSERT_ID = 0; +INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL; +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +999 +SELECT * FROM t1; +a +1 +INSERT INTO t1 SET a = 1 ON DUPLICATE KEY UPDATE a = NULL; +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +999 +SELECT * FROM t1; +a +0 +UPDATE t1 SET a = 1 WHERE a IS NULL; +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +999 +SELECT * FROM t1; +a +0 +UPDATE t1 SET a = NULL WHERE a = 1; +SELECT LAST_INSERT_ID(); +LAST_INSERT_ID() +999 +SELECT * FROM t1; +a +0 +DROP TABLE t1; ############################################################################## diff --git a/mysql-test/suite/parts/r/partition_decimal_innodb.result b/mysql-test/suite/parts/r/partition_decimal_innodb.result index c69c880cc6f..8eb408d05d9 100644 --- a/mysql-test/suite/parts/r/partition_decimal_innodb.result +++ b/mysql-test/suite/parts/r/partition_decimal_innodb.result @@ -109,33 +109,6 @@ SUBPARTITIONS 2 PARTITION pa8 VALUES LESS THAN (8) ENGINE = InnoDB, PARTITION pa10 VALUES LESS THAN (10) ENGINE = InnoDB) */ 9*3 inserts; -insert into t3 values (9); -insert into t3 values (9+0.333333333); -insert into t3 values (9+0.755555555); -insert into t3 values (8); -insert into t3 values (8+0.333333333); -insert into t3 values (8+0.755555555); -insert into t3 values (7); -insert into t3 values (7+0.333333333); -insert into t3 values (7+0.755555555); -insert into t3 values (6); -insert into t3 values (6+0.333333333); -insert into t3 values (6+0.755555555); -insert into t3 values (5); -insert into t3 values (5+0.333333333); -insert into t3 values (5+0.755555555); -insert into t3 values (4); -insert into t3 values (4+0.333333333); -insert into t3 values (4+0.755555555); -insert into t3 values (3); -insert into t3 values (3+0.333333333); -insert into t3 values (3+0.755555555); -insert into t3 values (2); -insert into t3 values (2+0.333333333); -insert into t3 values (2+0.755555555); -insert into t3 values (1); -insert into t3 values (1+0.333333333); -insert into t3 values (1+0.755555555); select count(*) from t3; count(*) 27 @@ -163,33 +136,6 @@ SUBPARTITIONS 2 PARTITION pa8 VALUES IN (7,8) ENGINE = InnoDB, PARTITION pa10 VALUES IN (9,10) ENGINE = InnoDB) */ 9*3 inserts; -insert into t4 values (9); -insert into t4 values (9+0.333333333); -insert into t4 values (9+0.755555555); -insert into t4 values (8); -insert into t4 values (8+0.333333333); -insert into t4 values (8+0.755555555); -insert into t4 values (7); -insert into t4 values (7+0.333333333); -insert into t4 values (7+0.755555555); -insert into t4 values (6); -insert into t4 values (6+0.333333333); -insert into t4 values (6+0.755555555); -insert into t4 values (5); -insert into t4 values (5+0.333333333); -insert into t4 values (5+0.755555555); -insert into t4 values (4); -insert into t4 values (4+0.333333333); -insert into t4 values (4+0.755555555); -insert into t4 values (3); -insert into t4 values (3+0.333333333); -insert into t4 values (3+0.755555555); -insert into t4 values (2); -insert into t4 values (2+0.333333333); -insert into t4 values (2+0.755555555); -insert into t4 values (1); -insert into t4 values (1+0.333333333); -insert into t4 values (1+0.755555555); select count(*) from t4; count(*) 27 diff --git a/mysql-test/suite/parts/r/partition_decimal_myisam.result b/mysql-test/suite/parts/r/partition_decimal_myisam.result index cdafb721ea4..2b214bd94cf 100644 --- a/mysql-test/suite/parts/r/partition_decimal_myisam.result +++ b/mysql-test/suite/parts/r/partition_decimal_myisam.result @@ -109,33 +109,6 @@ SUBPARTITIONS 2 PARTITION pa8 VALUES LESS THAN (8) ENGINE = MyISAM, PARTITION pa10 VALUES LESS THAN (10) ENGINE = MyISAM) */ 9*3 inserts; -insert into t3 values (9); -insert into t3 values (9+0.333333333); -insert into t3 values (9+0.755555555); -insert into t3 values (8); -insert into t3 values (8+0.333333333); -insert into t3 values (8+0.755555555); -insert into t3 values (7); -insert into t3 values (7+0.333333333); -insert into t3 values (7+0.755555555); -insert into t3 values (6); -insert into t3 values (6+0.333333333); -insert into t3 values (6+0.755555555); -insert into t3 values (5); -insert into t3 values (5+0.333333333); -insert into t3 values (5+0.755555555); -insert into t3 values (4); -insert into t3 values (4+0.333333333); -insert into t3 values (4+0.755555555); -insert into t3 values (3); -insert into t3 values (3+0.333333333); -insert into t3 values (3+0.755555555); -insert into t3 values (2); -insert into t3 values (2+0.333333333); -insert into t3 values (2+0.755555555); -insert into t3 values (1); -insert into t3 values (1+0.333333333); -insert into t3 values (1+0.755555555); select count(*) from t3; count(*) 27 @@ -163,33 +136,6 @@ SUBPARTITIONS 2 PARTITION pa8 VALUES IN (7,8) ENGINE = MyISAM, PARTITION pa10 VALUES IN (9,10) ENGINE = MyISAM) */ 9*3 inserts; -insert into t4 values (9); -insert into t4 values (9+0.333333333); -insert into t4 values (9+0.755555555); -insert into t4 values (8); -insert into t4 values (8+0.333333333); -insert into t4 values (8+0.755555555); -insert into t4 values (7); -insert into t4 values (7+0.333333333); -insert into t4 values (7+0.755555555); -insert into t4 values (6); -insert into t4 values (6+0.333333333); -insert into t4 values (6+0.755555555); -insert into t4 values (5); -insert into t4 values (5+0.333333333); -insert into t4 values (5+0.755555555); -insert into t4 values (4); -insert into t4 values (4+0.333333333); -insert into t4 values (4+0.755555555); -insert into t4 values (3); -insert into t4 values (3+0.333333333); -insert into t4 values (3+0.755555555); -insert into t4 values (2); -insert into t4 values (2+0.333333333); -insert into t4 values (2+0.755555555); -insert into t4 values (1); -insert into t4 values (1+0.333333333); -insert into t4 values (1+0.755555555); select count(*) from t4; count(*) 27 diff --git a/mysql-test/suite/parts/r/partition_recover_myisam.result b/mysql-test/suite/parts/r/partition_recover_myisam.result index 7de0cd31825..94ce4264d77 100644 --- a/mysql-test/suite/parts/r/partition_recover_myisam.result +++ b/mysql-test/suite/parts/r/partition_recover_myisam.result @@ -1,5 +1,5 @@ call mtr.add_suppression("..test.t1_will_crash"); -call mtr.add_suppression("Got an error from unknown thread, ha_myisam.cc"); +call mtr.add_suppression("Got an error from unknown thread"); CREATE TABLE t1_will_crash (a INT, KEY (a)) ENGINE=MyISAM; INSERT INTO t1_will_crash VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11); FLUSH TABLES; diff --git a/mysql-test/suite/parts/t/partition_recover_myisam.test b/mysql-test/suite/parts/t/partition_recover_myisam.test index fc121b7408f..ef5c9654efa 100644 --- a/mysql-test/suite/parts/t/partition_recover_myisam.test +++ b/mysql-test/suite/parts/t/partition_recover_myisam.test @@ -1,7 +1,7 @@ # test the auto-recover (--myisam-recover) of partitioned myisam tables call mtr.add_suppression("..test.t1_will_crash"); -call mtr.add_suppression("Got an error from unknown thread, ha_myisam.cc"); +call mtr.add_suppression("Got an error from unknown thread"); --source include/have_partition.inc --disable_warnings diff --git a/mysql-test/suite/perfschema/r/pfs_upgrade.result b/mysql-test/suite/perfschema/r/pfs_upgrade.result index 2ec6a3bd1dd..c9347809157 100644 --- a/mysql-test/suite/perfschema/r/pfs_upgrade.result +++ b/mysql-test/suite/perfschema/r/pfs_upgrade.result @@ -8,24 +8,24 @@ use performance_schema; show tables like "user_table"; Tables_in_performance_schema (user_table) user_table -ERROR 1050 (42S01) at line 183: Table 'cond_instances' already exists -ERROR 1050 (42S01) at line 213: Table 'events_waits_current' already exists -ERROR 1050 (42S01) at line 227: Table 'events_waits_history' already exists -ERROR 1050 (42S01) at line 241: Table 'events_waits_history_long' already exists -ERROR 1050 (42S01) at line 262: Table 'events_waits_summary_by_instance' already exists -ERROR 1050 (42S01) at line 283: Table 'events_waits_summary_by_thread_by_event_name' already exists -ERROR 1050 (42S01) at line 303: Table 'events_waits_summary_global_by_event_name' already exists -ERROR 1050 (42S01) at line 320: Table 'file_instances' already exists -ERROR 1050 (42S01) at line 339: Table 'file_summary_by_event_name' already exists -ERROR 1050 (42S01) at line 359: Table 'file_summary_by_instance' already exists -ERROR 1050 (42S01) at line 376: Table 'mutex_instances' already exists -ERROR 1050 (42S01) at line 394: Table 'performance_timers' already exists -ERROR 1050 (42S01) at line 412: Table 'rwlock_instances' already exists -ERROR 1050 (42S01) at line 428: Table 'setup_consumers' already exists -ERROR 1050 (42S01) at line 445: Table 'setup_instruments' already exists -ERROR 1050 (42S01) at line 461: Table 'setup_timers' already exists -ERROR 1050 (42S01) at line 478: Table 'threads' already exists -ERROR 1644 (HY000) at line 1122: Unexpected content found in the performance_schema database. +ERROR 1050 (42S01) at line 181: Table 'cond_instances' already exists +ERROR 1050 (42S01) at line 211: Table 'events_waits_current' already exists +ERROR 1050 (42S01) at line 225: Table 'events_waits_history' already exists +ERROR 1050 (42S01) at line 239: Table 'events_waits_history_long' already exists +ERROR 1050 (42S01) at line 260: Table 'events_waits_summary_by_instance' already exists +ERROR 1050 (42S01) at line 281: Table 'events_waits_summary_by_thread_by_event_name' already exists +ERROR 1050 (42S01) at line 301: Table 'events_waits_summary_global_by_event_name' already exists +ERROR 1050 (42S01) at line 318: Table 'file_instances' already exists +ERROR 1050 (42S01) at line 337: Table 'file_summary_by_event_name' already exists +ERROR 1050 (42S01) at line 357: Table 'file_summary_by_instance' already exists +ERROR 1050 (42S01) at line 374: Table 'mutex_instances' already exists +ERROR 1050 (42S01) at line 392: Table 'performance_timers' already exists +ERROR 1050 (42S01) at line 410: Table 'rwlock_instances' already exists +ERROR 1050 (42S01) at line 426: Table 'setup_consumers' already exists +ERROR 1050 (42S01) at line 443: Table 'setup_instruments' already exists +ERROR 1050 (42S01) at line 459: Table 'setup_timers' already exists +ERROR 1050 (42S01) at line 476: Table 'threads' already exists +ERROR 1644 (HY000) at line 1120: Unexpected content found in the performance_schema database. FATAL ERROR: Upgrade failed show tables like "user_table"; Tables_in_performance_schema (user_table) @@ -38,24 +38,24 @@ use performance_schema; show tables like "user_view"; Tables_in_performance_schema (user_view) user_view -ERROR 1050 (42S01) at line 183: Table 'cond_instances' already exists -ERROR 1050 (42S01) at line 213: Table 'events_waits_current' already exists -ERROR 1050 (42S01) at line 227: Table 'events_waits_history' already exists -ERROR 1050 (42S01) at line 241: Table 'events_waits_history_long' already exists -ERROR 1050 (42S01) at line 262: Table 'events_waits_summary_by_instance' already exists -ERROR 1050 (42S01) at line 283: Table 'events_waits_summary_by_thread_by_event_name' already exists -ERROR 1050 (42S01) at line 303: Table 'events_waits_summary_global_by_event_name' already exists -ERROR 1050 (42S01) at line 320: Table 'file_instances' already exists -ERROR 1050 (42S01) at line 339: Table 'file_summary_by_event_name' already exists -ERROR 1050 (42S01) at line 359: Table 'file_summary_by_instance' already exists -ERROR 1050 (42S01) at line 376: Table 'mutex_instances' already exists -ERROR 1050 (42S01) at line 394: Table 'performance_timers' already exists -ERROR 1050 (42S01) at line 412: Table 'rwlock_instances' already exists -ERROR 1050 (42S01) at line 428: Table 'setup_consumers' already exists -ERROR 1050 (42S01) at line 445: Table 'setup_instruments' already exists -ERROR 1050 (42S01) at line 461: Table 'setup_timers' already exists -ERROR 1050 (42S01) at line 478: Table 'threads' already exists -ERROR 1644 (HY000) at line 1122: Unexpected content found in the performance_schema database. +ERROR 1050 (42S01) at line 181: Table 'cond_instances' already exists +ERROR 1050 (42S01) at line 211: Table 'events_waits_current' already exists +ERROR 1050 (42S01) at line 225: Table 'events_waits_history' already exists +ERROR 1050 (42S01) at line 239: Table 'events_waits_history_long' already exists +ERROR 1050 (42S01) at line 260: Table 'events_waits_summary_by_instance' already exists +ERROR 1050 (42S01) at line 281: Table 'events_waits_summary_by_thread_by_event_name' already exists +ERROR 1050 (42S01) at line 301: Table 'events_waits_summary_global_by_event_name' already exists +ERROR 1050 (42S01) at line 318: Table 'file_instances' already exists +ERROR 1050 (42S01) at line 337: Table 'file_summary_by_event_name' already exists +ERROR 1050 (42S01) at line 357: Table 'file_summary_by_instance' already exists +ERROR 1050 (42S01) at line 374: Table 'mutex_instances' already exists +ERROR 1050 (42S01) at line 392: Table 'performance_timers' already exists +ERROR 1050 (42S01) at line 410: Table 'rwlock_instances' already exists +ERROR 1050 (42S01) at line 426: Table 'setup_consumers' already exists +ERROR 1050 (42S01) at line 443: Table 'setup_instruments' already exists +ERROR 1050 (42S01) at line 459: Table 'setup_timers' already exists +ERROR 1050 (42S01) at line 476: Table 'threads' already exists +ERROR 1644 (HY000) at line 1120: Unexpected content found in the performance_schema database. FATAL ERROR: Upgrade failed show tables like "user_view"; Tables_in_performance_schema (user_view) @@ -66,24 +66,24 @@ drop view test.user_view; create procedure test.user_proc() select "Not supposed to be here"; update mysql.proc set db='performance_schema' where name='user_proc'; -ERROR 1050 (42S01) at line 183: Table 'cond_instances' already exists -ERROR 1050 (42S01) at line 213: Table 'events_waits_current' already exists -ERROR 1050 (42S01) at line 227: Table 'events_waits_history' already exists -ERROR 1050 (42S01) at line 241: Table 'events_waits_history_long' already exists -ERROR 1050 (42S01) at line 262: Table 'events_waits_summary_by_instance' already exists -ERROR 1050 (42S01) at line 283: Table 'events_waits_summary_by_thread_by_event_name' already exists -ERROR 1050 (42S01) at line 303: Table 'events_waits_summary_global_by_event_name' already exists -ERROR 1050 (42S01) at line 320: Table 'file_instances' already exists -ERROR 1050 (42S01) at line 339: Table 'file_summary_by_event_name' already exists -ERROR 1050 (42S01) at line 359: Table 'file_summary_by_instance' already exists -ERROR 1050 (42S01) at line 376: Table 'mutex_instances' already exists -ERROR 1050 (42S01) at line 394: Table 'performance_timers' already exists -ERROR 1050 (42S01) at line 412: Table 'rwlock_instances' already exists -ERROR 1050 (42S01) at line 428: Table 'setup_consumers' already exists -ERROR 1050 (42S01) at line 445: Table 'setup_instruments' already exists -ERROR 1050 (42S01) at line 461: Table 'setup_timers' already exists -ERROR 1050 (42S01) at line 478: Table 'threads' already exists -ERROR 1644 (HY000) at line 1122: Unexpected content found in the performance_schema database. +ERROR 1050 (42S01) at line 181: Table 'cond_instances' already exists +ERROR 1050 (42S01) at line 211: Table 'events_waits_current' already exists +ERROR 1050 (42S01) at line 225: Table 'events_waits_history' already exists +ERROR 1050 (42S01) at line 239: Table 'events_waits_history_long' already exists +ERROR 1050 (42S01) at line 260: Table 'events_waits_summary_by_instance' already exists +ERROR 1050 (42S01) at line 281: Table 'events_waits_summary_by_thread_by_event_name' already exists +ERROR 1050 (42S01) at line 301: Table 'events_waits_summary_global_by_event_name' already exists +ERROR 1050 (42S01) at line 318: Table 'file_instances' already exists +ERROR 1050 (42S01) at line 337: Table 'file_summary_by_event_name' already exists +ERROR 1050 (42S01) at line 357: Table 'file_summary_by_instance' already exists +ERROR 1050 (42S01) at line 374: Table 'mutex_instances' already exists +ERROR 1050 (42S01) at line 392: Table 'performance_timers' already exists +ERROR 1050 (42S01) at line 410: Table 'rwlock_instances' already exists +ERROR 1050 (42S01) at line 426: Table 'setup_consumers' already exists +ERROR 1050 (42S01) at line 443: Table 'setup_instruments' already exists +ERROR 1050 (42S01) at line 459: Table 'setup_timers' already exists +ERROR 1050 (42S01) at line 476: Table 'threads' already exists +ERROR 1644 (HY000) at line 1120: Unexpected content found in the performance_schema database. FATAL ERROR: Upgrade failed select name from mysql.proc where db='performance_schema'; name @@ -94,24 +94,24 @@ drop procedure test.user_proc; create function test.user_func() returns integer return 0; update mysql.proc set db='performance_schema' where name='user_func'; -ERROR 1050 (42S01) at line 183: Table 'cond_instances' already exists -ERROR 1050 (42S01) at line 213: Table 'events_waits_current' already exists -ERROR 1050 (42S01) at line 227: Table 'events_waits_history' already exists -ERROR 1050 (42S01) at line 241: Table 'events_waits_history_long' already exists -ERROR 1050 (42S01) at line 262: Table 'events_waits_summary_by_instance' already exists -ERROR 1050 (42S01) at line 283: Table 'events_waits_summary_by_thread_by_event_name' already exists -ERROR 1050 (42S01) at line 303: Table 'events_waits_summary_global_by_event_name' already exists -ERROR 1050 (42S01) at line 320: Table 'file_instances' already exists -ERROR 1050 (42S01) at line 339: Table 'file_summary_by_event_name' already exists -ERROR 1050 (42S01) at line 359: Table 'file_summary_by_instance' already exists -ERROR 1050 (42S01) at line 376: Table 'mutex_instances' already exists -ERROR 1050 (42S01) at line 394: Table 'performance_timers' already exists -ERROR 1050 (42S01) at line 412: Table 'rwlock_instances' already exists -ERROR 1050 (42S01) at line 428: Table 'setup_consumers' already exists -ERROR 1050 (42S01) at line 445: Table 'setup_instruments' already exists -ERROR 1050 (42S01) at line 461: Table 'setup_timers' already exists -ERROR 1050 (42S01) at line 478: Table 'threads' already exists -ERROR 1644 (HY000) at line 1122: Unexpected content found in the performance_schema database. +ERROR 1050 (42S01) at line 181: Table 'cond_instances' already exists +ERROR 1050 (42S01) at line 211: Table 'events_waits_current' already exists +ERROR 1050 (42S01) at line 225: Table 'events_waits_history' already exists +ERROR 1050 (42S01) at line 239: Table 'events_waits_history_long' already exists +ERROR 1050 (42S01) at line 260: Table 'events_waits_summary_by_instance' already exists +ERROR 1050 (42S01) at line 281: Table 'events_waits_summary_by_thread_by_event_name' already exists +ERROR 1050 (42S01) at line 301: Table 'events_waits_summary_global_by_event_name' already exists +ERROR 1050 (42S01) at line 318: Table 'file_instances' already exists +ERROR 1050 (42S01) at line 337: Table 'file_summary_by_event_name' already exists +ERROR 1050 (42S01) at line 357: Table 'file_summary_by_instance' already exists +ERROR 1050 (42S01) at line 374: Table 'mutex_instances' already exists +ERROR 1050 (42S01) at line 392: Table 'performance_timers' already exists +ERROR 1050 (42S01) at line 410: Table 'rwlock_instances' already exists +ERROR 1050 (42S01) at line 426: Table 'setup_consumers' already exists +ERROR 1050 (42S01) at line 443: Table 'setup_instruments' already exists +ERROR 1050 (42S01) at line 459: Table 'setup_timers' already exists +ERROR 1050 (42S01) at line 476: Table 'threads' already exists +ERROR 1644 (HY000) at line 1120: Unexpected content found in the performance_schema database. FATAL ERROR: Upgrade failed select name from mysql.proc where db='performance_schema'; name @@ -122,24 +122,24 @@ drop function test.user_func; create event test.user_event on schedule every 1 day do select "not supposed to be here"; update mysql.event set db='performance_schema' where name='user_event'; -ERROR 1050 (42S01) at line 183: Table 'cond_instances' already exists -ERROR 1050 (42S01) at line 213: Table 'events_waits_current' already exists -ERROR 1050 (42S01) at line 227: Table 'events_waits_history' already exists -ERROR 1050 (42S01) at line 241: Table 'events_waits_history_long' already exists -ERROR 1050 (42S01) at line 262: Table 'events_waits_summary_by_instance' already exists -ERROR 1050 (42S01) at line 283: Table 'events_waits_summary_by_thread_by_event_name' already exists -ERROR 1050 (42S01) at line 303: Table 'events_waits_summary_global_by_event_name' already exists -ERROR 1050 (42S01) at line 320: Table 'file_instances' already exists -ERROR 1050 (42S01) at line 339: Table 'file_summary_by_event_name' already exists -ERROR 1050 (42S01) at line 359: Table 'file_summary_by_instance' already exists -ERROR 1050 (42S01) at line 376: Table 'mutex_instances' already exists -ERROR 1050 (42S01) at line 394: Table 'performance_timers' already exists -ERROR 1050 (42S01) at line 412: Table 'rwlock_instances' already exists -ERROR 1050 (42S01) at line 428: Table 'setup_consumers' already exists -ERROR 1050 (42S01) at line 445: Table 'setup_instruments' already exists -ERROR 1050 (42S01) at line 461: Table 'setup_timers' already exists -ERROR 1050 (42S01) at line 478: Table 'threads' already exists -ERROR 1644 (HY000) at line 1122: Unexpected content found in the performance_schema database. +ERROR 1050 (42S01) at line 181: Table 'cond_instances' already exists +ERROR 1050 (42S01) at line 211: Table 'events_waits_current' already exists +ERROR 1050 (42S01) at line 225: Table 'events_waits_history' already exists +ERROR 1050 (42S01) at line 239: Table 'events_waits_history_long' already exists +ERROR 1050 (42S01) at line 260: Table 'events_waits_summary_by_instance' already exists +ERROR 1050 (42S01) at line 281: Table 'events_waits_summary_by_thread_by_event_name' already exists +ERROR 1050 (42S01) at line 301: Table 'events_waits_summary_global_by_event_name' already exists +ERROR 1050 (42S01) at line 318: Table 'file_instances' already exists +ERROR 1050 (42S01) at line 337: Table 'file_summary_by_event_name' already exists +ERROR 1050 (42S01) at line 357: Table 'file_summary_by_instance' already exists +ERROR 1050 (42S01) at line 374: Table 'mutex_instances' already exists +ERROR 1050 (42S01) at line 392: Table 'performance_timers' already exists +ERROR 1050 (42S01) at line 410: Table 'rwlock_instances' already exists +ERROR 1050 (42S01) at line 426: Table 'setup_consumers' already exists +ERROR 1050 (42S01) at line 443: Table 'setup_instruments' already exists +ERROR 1050 (42S01) at line 459: Table 'setup_timers' already exists +ERROR 1050 (42S01) at line 476: Table 'threads' already exists +ERROR 1644 (HY000) at line 1120: Unexpected content found in the performance_schema database. FATAL ERROR: Upgrade failed select name from mysql.event where db='performance_schema'; name diff --git a/mysql-test/suite/rpl/r/rpl_ddl.result b/mysql-test/suite/rpl/r/rpl_ddl.result index a451b2e581a..246ae3790a6 100644 --- a/mysql-test/suite/rpl/r/rpl_ddl.result +++ b/mysql-test/suite/rpl/r/rpl_ddl.result @@ -1,15 +1,8 @@ -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; +include/master-slave.inc +[connection master] -------- switch to master ------- SET AUTOCOMMIT = 1; -DROP DATABASE IF EXISTS mysqltest1; -DROP DATABASE IF EXISTS mysqltest2; -DROP DATABASE IF EXISTS mysqltest3; CREATE DATABASE mysqltest1; CREATE DATABASE mysqltest2; CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE=InnoDB; @@ -1626,3 +1619,4 @@ use test; -------- switch to master ------- DROP DATABASE mysqltest1; DROP DATABASE mysqltest3; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_do_grant.result b/mysql-test/suite/rpl/r/rpl_do_grant.result index 772ffd1db20..671af1dce58 100644 --- a/mysql-test/suite/rpl/r/rpl_do_grant.result +++ b/mysql-test/suite/rpl/r/rpl_do_grant.result @@ -158,9 +158,9 @@ SELECT * FROM mysql.procs_priv; Host Db User Routine_name Routine_type Grantor Proc_priv Timestamp SELECT upgrade_alter_func(); ERROR HY000: The user specified as a definer ('create_rout_db'@'localhost') does not exist -USE test; -DROP FUNCTION bug42217_db.upgrade_del_func; -DROP FUNCTION bug42217_db.upgrade_alter_func; +USE bug42217_db; +DROP FUNCTION upgrade_del_func; +DROP FUNCTION upgrade_alter_func; DROP DATABASE bug42217_db; SET SQL_LOG_BIN= 0; DROP USER 'create_rout_db'@'localhost'; diff --git a/mysql-test/suite/rpl/r/rpl_ignore_table.result b/mysql-test/suite/rpl/r/rpl_ignore_table.result index e5f39655c8d..c06e4361098 100644 --- a/mysql-test/suite/rpl/r/rpl_ignore_table.result +++ b/mysql-test/suite/rpl/r/rpl_ignore_table.result @@ -30,7 +30,7 @@ Warnings: Warning 1364 Field 'ssl_cipher' doesn't have a default value Warning 1364 Field 'x509_issuer' doesn't have a default value Warning 1364 Field 'x509_subject' doesn't have a default value -Warning 1364 Field 'auth_string' doesn't have a default value +Warning 1364 Field 'authentication_string' doesn't have a default value GRANT SELECT ON *.* TO mysqltest6@localhost; GRANT INSERT ON *.* TO mysqltest6@localhost; GRANT INSERT ON test.* TO mysqltest6@localhost; diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result index b8bf8b447d2..58d0e202110 100644 --- a/mysql-test/suite/rpl/r/rpl_log_pos.result +++ b/mysql-test/suite/rpl/r/rpl_log_pos.result @@ -1,5 +1,7 @@ include/master-slave.inc [connection master] +create table if not exists t1 (n int); +drop table t1; call mtr.add_suppression ("Slave I/O: Got fatal error 1236 from master when reading data from binary"); call mtr.add_suppression ("Error in Log_event::read_log_event"); show master status; @@ -7,7 +9,6 @@ File Position Binlog_Do_DB Binlog_Ignore_DB master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB> include/stop_slave.inc change master to master_log_pos=MASTER_LOG_POS; -Read_Master_Log_Pos = '75' start slave; include/wait_for_slave_io_error.inc [errno=1236] Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master'' diff --git a/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result index 14ed79680f1..143475d7bae 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result @@ -26,16 +26,29 @@ include/diff_tables.inc [master:t1,slave:t1] TRUNCATE TABLE t1; TRUNCATE TABLE t2; TRUNCATE TABLE t3; +set default_storage_engine=innodb; BEGIN; Got one of the listed errors Got one of the listed errors Got one of the listed errors +INSERT INTO t1 (a, data) VALUES (7, 's');; +INSERT INTO t2 (a, data) VALUES (8, 's');; +INSERT INTO t1 (a, data) VALUES (9, 's');; +ALTER TABLE t3 ADD COLUMN d int; BEGIN; Got one of the listed errors Got one of the listed errors +INSERT INTO t1 (a, data) VALUES (19, 's');; +INSERT INTO t2 (a, data) VALUES (20, 's');; +INSERT INTO t1 (a, data) VALUES (21, 's');; +CREATE TABLE t4 SELECT * FROM t1; BEGIN; Got one of the listed errors Got one of the listed errors +INSERT INTO t1 (a, data) VALUES (27, 's');; +INSERT INTO t2 (a, data) VALUES (28, 's');; +INSERT INTO t1 (a, data) VALUES (29, 's');; +CREATE TABLE t5 (a int); include/diff_tables.inc [master:t1,slave:t1] ######################################################################################## # 3 - BEGIN - COMMIT @@ -97,6 +110,9 @@ BEGIN; Got one of the listed errors Got one of the listed errors Got one of the listed errors +INSERT INTO t1 (a, data) VALUES (7, 's');; +INSERT INTO t2 (a, data) VALUES (8, 's');; +INSERT INTO t1 (a, data) VALUES (9, 's');; ROLLBACK TO sv; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back @@ -112,6 +128,10 @@ BEGIN; Got one of the listed errors Got one of the listed errors Got one of the listed errors +INSERT INTO t1 (a, data) VALUES (8, 's');; +INSERT INTO t1 (a, data) VALUES (9, 's');; +INSERT INTO t2 (a, data) VALUES (10, 's');; +INSERT INTO t1 (a, data) VALUES (11, 's');; COMMIT; BEGIN; Got one of the listed errors diff --git a/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result index baeefe7c6ea..fff3776a0e8 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result @@ -1,5 +1,6 @@ include/master-slave.inc [connection master] +set session storage_engine=innodb; ######################################################################### # CONFIGURATION ######################################################################### diff --git a/mysql-test/suite/rpl/r/rpl_optimize.result b/mysql-test/suite/rpl/r/rpl_optimize.result index b606e47a55f..260ee30ac06 100644 --- a/mysql-test/suite/rpl/r/rpl_optimize.result +++ b/mysql-test/suite/rpl/r/rpl_optimize.result @@ -1,5 +1,6 @@ include/master-slave.inc [connection master] +drop tables if exists t1; create table t1 (a int not null auto_increment primary key, b int, key(b)); INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); INSERT INTO t1 (a) SELECT null FROM t1; diff --git a/mysql-test/suite/rpl/r/rpl_rotate_logs.result b/mysql-test/suite/rpl/r/rpl_rotate_logs.result index 279ab88bde3..9144d3c0e72 100644 --- a/mysql-test/suite/rpl/r/rpl_rotate_logs.result +++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result @@ -88,8 +88,8 @@ master-bin.000009 # <Binlog_Do_DB> <Binlog_Ignore_DB> select * from t4; a testing temporary tables part 2 -Master_Log_File master-bin.000009 -Relay_Master_Log_File master-bin.000009 +Master_Log_File = 'master-bin.000009' +Relay_Master_Log_File = 'master-bin.000009' include/check_slave_is_running.inc lock tables t3 read; select count(*) from t3 where n >= 4; diff --git a/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result index 077199a0c93..95cb30f71f6 100644 --- a/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result +++ b/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result @@ -26,17 +26,30 @@ include/diff_tables.inc [master:t1,slave:t1] TRUNCATE TABLE t1; TRUNCATE TABLE t2; TRUNCATE TABLE t3; +set default_storage_engine=innodb; BEGIN; Got one of the listed errors Got one of the listed errors Got one of the listed errors +INSERT INTO t1 (a, data) VALUES (7, 's');; +INSERT INTO t2 (a, data) VALUES (8, 's');; +INSERT INTO t1 (a, data) VALUES (9, 's');; +ALTER TABLE t3 ADD COLUMN d int; BEGIN; Got one of the listed errors Got one of the listed errors +INSERT INTO t1 (a, data) VALUES (19, 's');; +INSERT INTO t2 (a, data) VALUES (20, 's');; +INSERT INTO t1 (a, data) VALUES (21, 's');; +CREATE TABLE t4 SELECT * FROM t1; Got one of the listed errors BEGIN; Got one of the listed errors Got one of the listed errors +INSERT INTO t1 (a, data) VALUES (27, 's');; +INSERT INTO t2 (a, data) VALUES (28, 's');; +INSERT INTO t1 (a, data) VALUES (29, 's');; +CREATE TABLE t5 (a int); include/diff_tables.inc [master:t1,slave:t1] ######################################################################################## # 3 - BEGIN - COMMIT @@ -98,6 +111,9 @@ BEGIN; Got one of the listed errors Got one of the listed errors Got one of the listed errors +INSERT INTO t1 (a, data) VALUES (7, 's');; +INSERT INTO t2 (a, data) VALUES (8, 's');; +INSERT INTO t1 (a, data) VALUES (9, 's');; ROLLBACK TO sv; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back @@ -113,6 +129,10 @@ BEGIN; Got one of the listed errors Got one of the listed errors Got one of the listed errors +INSERT INTO t1 (a, data) VALUES (8, 's');; +INSERT INTO t1 (a, data) VALUES (9, 's');; +INSERT INTO t2 (a, data) VALUES (10, 's');; +INSERT INTO t1 (a, data) VALUES (11, 's');; COMMIT; BEGIN; Got one of the listed errors diff --git a/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result index f81e5db986e..691ebe1de69 100644 --- a/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result +++ b/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result @@ -1,5 +1,6 @@ include/master-slave.inc [connection master] +set session storage_engine=innodb; ######################################################################### # CONFIGURATION ######################################################################### diff --git a/mysql-test/suite/rpl/r/rpl_stm_000001.result b/mysql-test/suite/rpl/r/rpl_stm_000001.result index 65715b471aa..eb421d1adc4 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_000001.result +++ b/mysql-test/suite/rpl/r/rpl_stm_000001.result @@ -62,7 +62,7 @@ Warnings: Warning 1364 Field 'ssl_cipher' doesn't have a default value Warning 1364 Field 'x509_issuer' doesn't have a default value Warning 1364 Field 'x509_subject' doesn't have a default value -Warning 1364 Field 'auth_string' doesn't have a default value +Warning 1364 Field 'authentication_string' doesn't have a default value select select_priv,user from mysql.user where user = _binary'blafasel2'; select_priv user N blafasel2 diff --git a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result index 14ed79680f1..143475d7bae 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result +++ b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result @@ -26,16 +26,29 @@ include/diff_tables.inc [master:t1,slave:t1] TRUNCATE TABLE t1; TRUNCATE TABLE t2; TRUNCATE TABLE t3; +set default_storage_engine=innodb; BEGIN; Got one of the listed errors Got one of the listed errors Got one of the listed errors +INSERT INTO t1 (a, data) VALUES (7, 's');; +INSERT INTO t2 (a, data) VALUES (8, 's');; +INSERT INTO t1 (a, data) VALUES (9, 's');; +ALTER TABLE t3 ADD COLUMN d int; BEGIN; Got one of the listed errors Got one of the listed errors +INSERT INTO t1 (a, data) VALUES (19, 's');; +INSERT INTO t2 (a, data) VALUES (20, 's');; +INSERT INTO t1 (a, data) VALUES (21, 's');; +CREATE TABLE t4 SELECT * FROM t1; BEGIN; Got one of the listed errors Got one of the listed errors +INSERT INTO t1 (a, data) VALUES (27, 's');; +INSERT INTO t2 (a, data) VALUES (28, 's');; +INSERT INTO t1 (a, data) VALUES (29, 's');; +CREATE TABLE t5 (a int); include/diff_tables.inc [master:t1,slave:t1] ######################################################################################## # 3 - BEGIN - COMMIT @@ -97,6 +110,9 @@ BEGIN; Got one of the listed errors Got one of the listed errors Got one of the listed errors +INSERT INTO t1 (a, data) VALUES (7, 's');; +INSERT INTO t2 (a, data) VALUES (8, 's');; +INSERT INTO t1 (a, data) VALUES (9, 's');; ROLLBACK TO sv; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back @@ -112,6 +128,10 @@ BEGIN; Got one of the listed errors Got one of the listed errors Got one of the listed errors +INSERT INTO t1 (a, data) VALUES (8, 's');; +INSERT INTO t1 (a, data) VALUES (9, 's');; +INSERT INTO t2 (a, data) VALUES (10, 's');; +INSERT INTO t1 (a, data) VALUES (11, 's');; COMMIT; BEGIN; Got one of the listed errors diff --git a/mysql-test/suite/rpl/r/rpl_stm_maria.result b/mysql-test/suite/rpl/r/rpl_stm_maria.result index 3a3ba256325..08d202b61c0 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_maria.result +++ b/mysql-test/suite/rpl/r/rpl_stm_maria.result @@ -1,9 +1,5 @@ -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; +include/master-slave.inc +[connection master] CALL mtr.add_suppression('Unsafe statement written to the binary log using statement format'); DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t2; @@ -50,3 +46,4 @@ a name old_a old_b truncate(rand_value,4) 106 t2 5 0 0.6699 107 t2 500 0 0.3593 drop table t1,t2,t3; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_table_options.result b/mysql-test/suite/rpl/r/rpl_table_options.result index 9b0511f6494..423a2b65583 100644 --- a/mysql-test/suite/rpl/r/rpl_table_options.result +++ b/mysql-test/suite/rpl/r/rpl_table_options.result @@ -1,9 +1,5 @@ -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; +include/master-slave.inc +[connection master] install plugin example soname 'ha_example.so'; set storage_engine=example; create table t1 (a int not null) ull=12340; @@ -23,3 +19,4 @@ select 1; 1 1 uninstall plugin example; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result b/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result index 8fb910666dc..ec7a10f8142 100644 --- a/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result +++ b/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result @@ -23,7 +23,7 @@ include/rpl_connect.inc [creating master] DROP TABLE t1; [on slave] include/rpl_reset.inc -CREATE TABLE t1 (a int); +CREATE TABLE t1 (a int) engine=innodb; CREATE TABLE t2 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) ); CREATE TABLE t3 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) ); CREATE TRIGGER tr1 AFTER DELETE ON t2 FOR EACH ROW INSERT INTO t3 () VALUES (); @@ -47,7 +47,7 @@ Slave_open_temp_tables 0 DROP TABLE t3, t1; show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info -slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int) +slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a int) engine=innodb slave-bin.000001 # Query # # use `test`; CREATE TABLE t2 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) ) slave-bin.000001 # Query # # use `test`; CREATE TABLE t3 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) ) slave-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER DELETE ON t2 FOR EACH ROW INSERT INTO t3 () VALUES () @@ -93,7 +93,7 @@ BEGIN; DROP TEMPORARY TABLE t1; # The rows event will binlogged before 'DROP TEMPORARY TABLE t1', # as t1 is non-transactional table -INSERT INTO t1 VALUES(Rand()); +INSERT INTO t1 SELECT Rand(); COMMIT; show binlog events in 'master-bin.000001' from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info diff --git a/mysql-test/suite/rpl/r/rpl_temporary.result b/mysql-test/suite/rpl/r/rpl_temporary.result index dfab66d074f..73821172d92 100644 --- a/mysql-test/suite/rpl/r/rpl_temporary.result +++ b/mysql-test/suite/rpl/r/rpl_temporary.result @@ -1,6 +1,7 @@ include/master-slave.inc [connection master] -call mtr.add_suppression("Slave: Can\'t find record in \'user\' Error_code: 1032"); +SET sql_log_bin = 0; +SET sql_log_bin = 1; reset master; DROP TABLE IF EXISTS t1; CREATE TEMPORARY TABLE t1 (a char(1)); diff --git a/mysql-test/suite/rpl/t/rpl_do_grant.test b/mysql-test/suite/rpl/t/rpl_do_grant.test index 94dd1c5d3f4..a39c3fb6375 100644 --- a/mysql-test/suite/rpl/t/rpl_do_grant.test +++ b/mysql-test/suite/rpl/t/rpl_do_grant.test @@ -200,17 +200,12 @@ SELECT upgrade_alter_func(); disconnect create_rout_db_master; disconnect create_rout_db_slave; connection master; -USE test; -DROP FUNCTION bug42217_db.upgrade_del_func; -DROP FUNCTION bug42217_db.upgrade_alter_func; +USE bug42217_db; +DROP FUNCTION upgrade_del_func; +DROP FUNCTION upgrade_alter_func; DROP DATABASE bug42217_db; - -- sync_slave_with_master -# Drop the user that was already dropped on the slave -connection slave; ---disable_warnings -stop slave; -connection master; +-- connection master # user was already dropped in the slave before # so we should not replicate this statement. @@ -218,8 +213,6 @@ SET SQL_LOG_BIN= 0; DROP USER 'create_rout_db'@'localhost'; SET SQL_LOG_BIN= 1; ---enable_warnings - # finish entire clean up (remove binlogs) # so that we leave a pristine environment for the # following tests diff --git a/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test b/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test index 1d33962ad48..2e58f426f14 100644 --- a/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test +++ b/mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test @@ -1,7 +1,7 @@ # depends on the binlog output -- source include/have_binlog_format_row.inc -let $rename_event_pos= 926; +let $rename_event_pos= 912; # Bug#18326: Do not lock table for writing during prepare of statement # The use of the ps protocol causes extra table maps in the binlog, so diff --git a/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test b/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test index d8a3ad23b66..de021f3e3e1 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test +++ b/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test @@ -1,5 +1,5 @@ # depends on the binlog output --source include/have_binlog_format_mixed_or_statement.inc -let $rename_event_pos= 959; +let $rename_event_pos= 945; -- source extra/rpl_tests/rpl_flsh_tbls.test diff --git a/mysql-test/suite/rpl/t/rpl_stm_maria.test b/mysql-test/suite/rpl/t/rpl_stm_maria.test index 6a37e390716..5c531a32d80 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_maria.test +++ b/mysql-test/suite/rpl/t/rpl_stm_maria.test @@ -54,3 +54,5 @@ sync_slave_with_master; connection master; drop table t1,t2,t3; sync_slave_with_master; + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_table_options.test b/mysql-test/suite/rpl/t/rpl_table_options.test index b3d75bb0f95..27eb0e393d2 100644 --- a/mysql-test/suite/rpl/t/rpl_table_options.test +++ b/mysql-test/suite/rpl/t/rpl_table_options.test @@ -29,3 +29,5 @@ drop table t1; set storage_engine=default; select 1; uninstall plugin example; + +source include/rpl_end.inc; diff --git a/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test b/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test index 63f0b6c2234..4b94dae3de9 100644 --- a/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test +++ b/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test @@ -97,7 +97,7 @@ sync_slave_with_master; -- connection master # action: setup environment -CREATE TABLE t1 (a int); +CREATE TABLE t1 (a int) engine=innodb; CREATE TABLE t2 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) ); CREATE TABLE t3 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) ); CREATE TRIGGER tr1 AFTER DELETE ON t2 FOR EACH ROW INSERT INTO t3 () VALUES (); @@ -193,7 +193,7 @@ DROP TEMPORARY TABLE t1; --echo # The rows event will binlogged before 'DROP TEMPORARY TABLE t1', --echo # as t1 is non-transactional table -INSERT INTO t1 VALUES(Rand()); +INSERT INTO t1 SELECT Rand(); COMMIT; source include/show_binlog_events.inc; diff --git a/mysql-test/suite/sys_vars/r/multi_range_count_basic_64.result b/mysql-test/suite/sys_vars/r/multi_range_count_basic_64.result index 29019ca5971..d110188b3f6 100644 --- a/mysql-test/suite/sys_vars/r/multi_range_count_basic_64.result +++ b/mysql-test/suite/sys_vars/r/multi_range_count_basic_64.result @@ -8,84 +8,122 @@ SELECT @start_session_value; 256 '#--------------------FN_DYNVARS_090_01-------------------------#' SET @@global.multi_range_count = 100; +Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead SET @@global.multi_range_count = DEFAULT; +Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead SELECT @@global.multi_range_count; @@global.multi_range_count 256 SET @@session.multi_range_count = 200; +Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead SET @@session.multi_range_count = DEFAULT; +Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead SELECT @@session.multi_range_count; @@session.multi_range_count 256 '#--------------------FN_DYNVARS_090_02-------------------------#' SET @@global.multi_range_count = DEFAULT; +Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead SELECT @@global.multi_range_count = 256; @@global.multi_range_count = 256 1 SET @@session.multi_range_count = DEFAULT; +Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead SELECT @@session.multi_range_count = 256; @@session.multi_range_count = 256 1 '#--------------------FN_DYNVARS_090_03-------------------------#' SET @@global.multi_range_count = 1; +Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead SELECT @@global.multi_range_count; @@global.multi_range_count 1 SET @@global.multi_range_count = 60020; +Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead SELECT @@global.multi_range_count; @@global.multi_range_count 60020 SET @@global.multi_range_count = 65535; +Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead SELECT @@global.multi_range_count; @@global.multi_range_count 65535 SET @@global.multi_range_count = 4294967295; +Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead SELECT @@global.multi_range_count; @@global.multi_range_count 4294967295 SET @@global.multi_range_count = 4294967294; +Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead SELECT @@global.multi_range_count; @@global.multi_range_count 4294967294 '#--------------------FN_DYNVARS_090_04-------------------------#' SET @@session.multi_range_count = 1; +Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead SELECT @@session.multi_range_count; @@session.multi_range_count 1 SET @@session.multi_range_count = 50050; +Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead SELECT @@session.multi_range_count; @@session.multi_range_count 50050 SET @@session.multi_range_count = 65535; +Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead SELECT @@session.multi_range_count; @@session.multi_range_count 65535 SET @@session.multi_range_count = 4294967295; +Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead SELECT @@session.multi_range_count; @@session.multi_range_count 4294967295 SET @@session.multi_range_count = 4294967294; +Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead SELECT @@session.multi_range_count; @@session.multi_range_count 4294967294 '#------------------FN_DYNVARS_090_05-----------------------#' SET @@global.multi_range_count = 0; Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead Warning 1292 Truncated incorrect multi_range_count value: '0' SELECT @@global.multi_range_count; @@global.multi_range_count 1 SET @@global.multi_range_count = 4294967296; +Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead SELECT @@global.multi_range_count; @@global.multi_range_count 4294967296 SET @@global.multi_range_count = -1024; Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead Warning 1292 Truncated incorrect multi_range_count value: '-1024' SELECT @@global.multi_range_count; @@global.multi_range_count 1 SET @@global.multi_range_count = 429496729500; +Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead SELECT @@global.multi_range_count; @@global.multi_range_count 429496729500 @@ -101,16 +139,20 @@ SELECT @@global.multi_range_count; 429496729500 SET @@session.multi_range_count = 0; Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead Warning 1292 Truncated incorrect multi_range_count value: '0' SELECT @@session.multi_range_count; @@session.multi_range_count 1 SET @@session.multi_range_count = 4294967296; +Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead SELECT @@session.multi_range_count; @@session.multi_range_count 4294967296 SET @@session.multi_range_count = -1; Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead Warning 1292 Truncated incorrect multi_range_count value: '-1' SELECT @@session.multi_range_count; @@session.multi_range_count @@ -118,6 +160,8 @@ SELECT @@session.multi_range_count; SET @@session.multi_range_count = 65530.34.; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.' at line 1 SET @@session.multi_range_count = 4294967295021; +Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead SELECT @@session.multi_range_count; @@session.multi_range_count 4294967295021 @@ -141,22 +185,29 @@ WHERE VARIABLE_NAME='multi_range_count'; 1 '#------------------FN_DYNVARS_090_08-----------------------#' SET @@global.multi_range_count = TRUE; +Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead SELECT @@global.multi_range_count; @@global.multi_range_count 1 SET @@global.multi_range_count = FALSE; Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead Warning 1292 Truncated incorrect multi_range_count value: '0' SELECT @@global.multi_range_count; @@global.multi_range_count 1 '#---------------------FN_DYNVARS_090_09----------------------#' SET @@global.multi_range_count = 10; +Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead SELECT @@multi_range_count = @@global.multi_range_count; @@multi_range_count = @@global.multi_range_count 0 '#---------------------FN_DYNVARS_090_10----------------------#' SET @@multi_range_count = 100; +Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead SELECT @@multi_range_count = @@local.multi_range_count; @@multi_range_count = @@local.multi_range_count 1 @@ -165,6 +216,8 @@ SELECT @@local.multi_range_count = @@session.multi_range_count; 1 '#---------------------FN_DYNVARS_090_11----------------------#' SET multi_range_count = 1; +Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead SELECT @@multi_range_count; @@multi_range_count 1 @@ -175,10 +228,14 @@ ERROR 42S02: Unknown table 'session' in field list SELECT multi_range_count = @@session.multi_range_count; ERROR 42S22: Unknown column 'multi_range_count' in 'field list' SET @@global.multi_range_count = @start_global_value; +Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead SELECT @@global.multi_range_count; @@global.multi_range_count 256 SET @@session.multi_range_count = @start_session_value; +Warnings: +Warning 1287 The syntax '@@multi_range_count' is deprecated and will be removed in MySQL 5.7. Please use '@@mrr_buffer_size' instead SELECT @@session.multi_range_count; @@session.multi_range_count 256 diff --git a/mysql-test/suite/sys_vars/r/sql_big_selects_func.result b/mysql-test/suite/sys_vars/r/sql_big_selects_func.result index 77a38e1b928..72631dbb1d5 100644 --- a/mysql-test/suite/sys_vars/r/sql_big_selects_func.result +++ b/mysql-test/suite/sys_vars/r/sql_big_selects_func.result @@ -5,7 +5,7 @@ SET @session_max_join_size = @@SESSION.max_join_size; SET @global_max_join_size = @@GLOBAL.max_join_size; SET SQL_MAX_JOIN_SIZE=9; Warnings: -Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. +Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. Please use '@@max_join_size' instead CREATE TEMPORARY TABLE t1(a varchar(20) not null, b varchar(20)); CREATE TEMPORARY TABLE t2(a varchar(20) null, b varchar(20)); INSERT INTO t1 VALUES('aa','bb'); diff --git a/mysql-test/suite/sys_vars/r/sql_max_join_size_basic.result b/mysql-test/suite/sys_vars/r/sql_max_join_size_basic.result index 8ec2a60887f..7248b7a802f 100644 --- a/mysql-test/suite/sys_vars/r/sql_max_join_size_basic.result +++ b/mysql-test/suite/sys_vars/r/sql_max_join_size_basic.result @@ -22,10 +22,10 @@ VARIABLE_NAME VARIABLE_VALUE SQL_MAX_JOIN_SIZE 18446744073709551615 set global sql_max_join_size=10; Warnings: -Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. +Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. Please use '@@max_join_size' instead set session sql_max_join_size=20; Warnings: -Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. +Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. Please use '@@max_join_size' instead select @@global.sql_max_join_size; @@global.sql_max_join_size 10 @@ -55,19 +55,19 @@ select @@sql_big_selects; 0 set sql_max_join_size=cast(-1 as unsigned int); Warnings: -Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. +Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. Please use '@@max_join_size' instead select @@sql_big_selects; @@sql_big_selects 1 set sql_max_join_size=100; Warnings: -Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. +Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. Please use '@@max_join_size' instead select @@sql_big_selects; @@sql_big_selects 0 SET @@global.sql_max_join_size = @start_global_value; Warnings: -Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. +Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. Please use '@@max_join_size' instead SELECT @@global.sql_max_join_size; @@global.sql_max_join_size 18446744073709551615 diff --git a/mysql-test/suite/sys_vars/r/sql_max_join_size_func.result b/mysql-test/suite/sys_vars/r/sql_max_join_size_func.result index 0720f5dc965..0dc85925c6b 100644 --- a/mysql-test/suite/sys_vars/r/sql_max_join_size_func.result +++ b/mysql-test/suite/sys_vars/r/sql_max_join_size_func.result @@ -17,7 +17,7 @@ INSERT INTO t2 VALUES('aa4','bb'); '#--------------------FN_DYNVARS_161_01-------------------------#' SET SESSION sql_max_join_size=9; Warnings: -Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. +Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. Please use '@@max_join_size' instead SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a; ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay Expected error The SELECT would examine more than MAX_JOIN_SIZE rows. @@ -33,7 +33,7 @@ aa4 bb aa4 bb This should work SET SESSION sql_max_join_size=DEFAULT; Warnings: -Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. +Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. Please use '@@max_join_size' instead DELETE FROM t2 WHERE a = 'aa4'; SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a; a b a b @@ -45,7 +45,7 @@ This should work '#----------------------------FN_DYNVARS_136_05-------------------------#' SET GLOBAL sql_max_join_size = 4; Warnings: -Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. +Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. Please use '@@max_join_size' instead ** Connecting con_int1 using root ** ** Connection con_int1 ** SELECT @@SESSION.sql_max_join_size; @@ -54,7 +54,7 @@ SELECT @@SESSION.sql_max_join_size; 4 Expected SET SESSION sql_max_join_size = 2; Warnings: -Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. +Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. Please use '@@max_join_size' instead ** Connecting con_int2 using root ** ** Connection con_int2 ** SELECT @@SESSION.sql_max_join_size; @@ -63,7 +63,7 @@ SELECT @@SESSION.sql_max_join_size; 4 Expected SET SESSION sql_max_join_size = 10; Warnings: -Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. +Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. Please use '@@max_join_size' instead ** Connection con_int2 ** SELECT @@SESSION.sql_max_join_size; @@SESSION.sql_max_join_size @@ -82,10 +82,10 @@ SELECT @@GLOBAL.sql_max_join_size; Disconnecting Connections con_int1, con_int2 SET @@SESSION.sql_max_join_size = @session_max_join_size; Warnings: -Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. +Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. Please use '@@max_join_size' instead SET @@GLOBAL.sql_max_join_size = @global_max_join_size ; Warnings: -Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. +Warning 1287 The syntax '@@sql_max_join_size' is deprecated and will be removed in MySQL 7.0. Please use '@@max_join_size' instead SET @@SESSION.sql_big_selects = @session_sql_big_selects; DROP TABLE t1; DROP TABLE t2; diff --git a/mysql-test/suite/sys_vars/t/maria_used_for_temp_tables_basic.test b/mysql-test/suite/sys_vars/t/maria_used_for_temp_tables_basic.test index 504e2dfbcb5..a2bec4660af 100644 --- a/mysql-test/suite/sys_vars/t/maria_used_for_temp_tables_basic.test +++ b/mysql-test/suite/sys_vars/t/maria_used_for_temp_tables_basic.test @@ -9,7 +9,9 @@ select @@global.maria_used_for_temp_tables, @@global.aria_used_for_temp_tables; select @@session.maria_used_for_temp_tables, @@session.aria_used_for_temp_tables; show global variables like '%aria_used_for_temp_tables'; show session variables like '%aria_used_for_temp_tables'; +--sorted_result select * from information_schema.global_variables where variable_name like '%aria_used_for_temp_tables'; +--sorted_result select * from information_schema.session_variables where variable_name like '%aria_used_for_temp_tables'; # diff --git a/mysql-test/suite/sys_vars/t/plugin_dir_basic.test b/mysql-test/suite/sys_vars/t/plugin_dir_basic.test index 24dc15b646e..8bb231c2c5e 100644 --- a/mysql-test/suite/sys_vars/t/plugin_dir_basic.test +++ b/mysql-test/suite/sys_vars/t/plugin_dir_basic.test @@ -7,7 +7,7 @@ # on unix it's <basedir>/lib/mysql/plugin # unless mtr sets it to $MYSQL_TEST_DIR/var/plugins # -let plugindir=$MYSQL_TEST_DIR/var; +let plugindir=$MYSQLTEST_VARDIR; --replace_result $plugindir MYSQL_LIBDIR $MYSQL_LIBDIR MYSQL_LIBDIR /mysql/ / select @@global.plugin_dir; --error ER_INCORRECT_GLOBAL_LOCAL_VAR diff --git a/mysql-test/suite/vcol/r/rpl_vcol.result b/mysql-test/suite/vcol/r/rpl_vcol.result index f552d16d1c0..120ce38031f 100644 --- a/mysql-test/suite/vcol/r/rpl_vcol.result +++ b/mysql-test/suite/vcol/r/rpl_vcol.result @@ -1,10 +1,6 @@ SET @@session.storage_engine = 'InnoDB'; -stop slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -reset master; -reset slave; -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -start slave; +include/master-slave.inc +[connection master] create table t1 (a int, b int as (a+1)); show create table t1; Table Create Table @@ -23,3 +19,4 @@ a b 1 2 2 3 drop table t1; +include/rpl_end.inc diff --git a/mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result b/mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result index 3628139bd03..2a66c6a930c 100644 --- a/mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result @@ -25,8 +25,8 @@ a b c # INSERT INTO tbl_name VALUES... a non-NULL value is specified against vcols insert into t1 values (1,2,3); Warnings: -Warning 1703 The value specified for computed column 'b' in table 't1' ignored -Warning 1703 The value specified for computed column 'c' in table 't1' ignored +Warning 1718 The value specified for computed column 'b' in table 't1' ignored +Warning 1718 The value specified for computed column 'c' in table 't1' ignored select * from t1; a b c 1 -1 -1 @@ -65,8 +65,8 @@ a b c # against vcols insert into t1 (a,b) values (1,3), (2,4); Warnings: -Warning 1703 The value specified for computed column 'b' in table 't1' ignored -Warning 1703 The value specified for computed column 'b' in table 't1' ignored +Warning 1718 The value specified for computed column 'b' in table 't1' ignored +Warning 1718 The value specified for computed column 'b' in table 't1' ignored select * from t1; a b c 1 -1 -1 @@ -107,8 +107,8 @@ a b c create table t2 like t1; insert into t2 select * from t1; Warnings: -Warning 1703 The value specified for computed column 'b' in table 't2' ignored -Warning 1703 The value specified for computed column 'c' in table 't2' ignored +Warning 1718 The value specified for computed column 'b' in table 't2' ignored +Warning 1718 The value specified for computed column 'c' in table 't2' ignored select * from t1; a b c 2 -2 -2 @@ -123,8 +123,8 @@ a b c create table t2 like t1; insert into t2 (a,b) select a,b from t1; Warnings: -Warning 1703 The value specified for computed column 'b' in table 't2' ignored -Warning 1703 The value specified for computed column 'b' in table 't2' ignored +Warning 1718 The value specified for computed column 'b' in table 't2' ignored +Warning 1718 The value specified for computed column 'b' in table 't2' ignored select * from t2; a b c 2 -2 -2 @@ -159,7 +159,7 @@ a b c 2 -2 -2 update t1 set c=3 where a=2; Warnings: -Warning 1703 The value specified for computed column 'c' in table 't1' ignored +Warning 1718 The value specified for computed column 'c' in table 't1' ignored select * from t1; a b c 1 -1 -1 @@ -189,7 +189,7 @@ a b c 2 -2 -2 update t1 set c=3 where b=-2; Warnings: -Warning 1703 The value specified for computed column 'c' in table 't1' ignored +Warning 1718 The value specified for computed column 'c' in table 't1' ignored select * from t1; a b c 1 -1 -1 diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result index 0cdd0029b85..f1d1045db13 100644 --- a/mysql-test/suite/vcol/r/vcol_misc.result +++ b/mysql-test/suite/vcol/r/vcol_misc.result @@ -108,10 +108,10 @@ DROP TABLE t1,t2; CREATE TABLE t1 (p int, a double NOT NULL, v double AS (ROUND(a,p)) VIRTUAL); INSERT INTO t1 VALUES (0,1,0); Warnings: -Warning 1703 The value specified for computed column 'v' in table 't1' ignored +Warning 1718 The value specified for computed column 'v' in table 't1' ignored INSERT INTO t1 VALUES (NULL,0,0); Warnings: -Warning 1703 The value specified for computed column 'v' in table 't1' ignored +Warning 1718 The value specified for computed column 'v' in table 't1' ignored SELECT a, p, v, ROUND(a,p), ROUND(a,p+NULL) FROM t1; a p v ROUND(a,p) ROUND(a,p+NULL) 1 0 1 1 NULL diff --git a/mysql-test/suite/vcol/t/rpl_vcol.test b/mysql-test/suite/vcol/t/rpl_vcol.test index 2ac31f5ba35..adffecb4ae3 100644 --- a/mysql-test/suite/vcol/t/rpl_vcol.test +++ b/mysql-test/suite/vcol/t/rpl_vcol.test @@ -67,3 +67,5 @@ sync_with_master; #------------------------------------------------------------------------------# # Cleanup --source suite/vcol/inc/vcol_cleanup.inc +--source include/rpl_end.inc + diff --git a/mysql-test/t/bootstrap.test b/mysql-test/t/bootstrap.test index 2a293ed844b..405c24a6d74 100644 --- a/mysql-test/t/bootstrap.test +++ b/mysql-test/t/bootstrap.test @@ -57,6 +57,7 @@ drop table t1; # need the --skip-innodb option present for the test to succeed SHOW VARIABLES LIKE 'have_innodb'; -SELECT SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb'; +SELECT 'bug' as '' FROM INFORMATION_SCHEMA.ENGINES WHERE engine='innodb' + and SUPPORT='YES'; --echo End of 5.5 tests diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index a2a91fab680..52b23e62dcb 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -19,3 +19,4 @@ create-big : Bug#11748731 2010-11-15 mattiasj was not tested archive-big : Bug#11817185 2011-03-10 Anitha Disabled since this leads to timeout on Solaris Sparc log_tables-big : Bug#11756699 2010-11-15 mattiasj report already exists mysql_embedded : Bug#12561297 2011-06-15 New test failing on all platforms +tablespace : disabled in MariaDB diff --git a/mysql-test/t/file_contents.test b/mysql-test/t/file_contents.test index 33cd65fb2b4..f32b4f6f08b 100644 --- a/mysql-test/t/file_contents.test +++ b/mysql-test/t/file_contents.test @@ -11,7 +11,7 @@ --perl print "\nChecking 'INFO_SRC' and 'INFO_BIN'\n"; $dir_bin = $ENV{'MYSQL_BINDIR'}; -if ($dir_bin =~ m|/usr/|) { +if ($dir_bin eq '/usr/') { # RPM package $dir_docs = $dir_bin; $dir_docs =~ s|/lib|/share/doc|; @@ -22,7 +22,7 @@ if ($dir_bin =~ m|/usr/|) { # RedHat: version number in directory name $dir_docs = glob "$dir_docs/MySQL-server*"; } -} elsif ($dir_bin =~ m|/usr$|) { +} elsif ($dir_bin eq '/usr') { # RPM build during development $dir_docs = "$dir_bin/share/doc"; if(-d "$dir_docs/packages/MySQL-server") { diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test index b2f3c14aa13..9aed425e0cb 100644 --- a/mysql-test/t/insert_select.test +++ b/mysql-test/t/insert_select.test @@ -413,7 +413,7 @@ SET GLOBAL myisam_data_pointer_size = 2; INSERT INTO t1 VALUES (1), (2), (3), (4), (5); call mtr.add_suppression("mysqld.*: The table '.*#sql.*' is full"); ---error ER_RECORD_FILE_FULL,ER_RECORD_FILE_FULL +--error 0,ER_RECORD_FILE_FULL,ER_RECORD_FILE_FULL INSERT IGNORE INTO t1 SELECT t1.a FROM t1,t1 t2,t1 t3,t1 t4,t1 t5,t1 t6,t1 t7; # Cleanup diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test index 3a6c09f9ba7..54d3b8d997d 100644 --- a/mysql-test/t/join_outer.test +++ b/mysql-test/t/join_outer.test @@ -19,9 +19,11 @@ select t1.*,t2.* from t1 JOIN t2 where t1.a=t2.a; select t1.*,t2.* from t1 left join t2 on (t1.a=t2.a) order by t1.grp,t1.a,t2.c; select t1.*,t2.* from { oj t2 left outer join t1 on (t1.a=t2.a) }; select t1.*,t2.* from t1 as t0,{ oj t2 left outer join t1 on (t1.a=t2.a) } WHERE t0.a=2; +--sorted_result select t1.*,t2.* from t1 left join t2 using (a); select t1.*,t2.* from t1 left join t2 using (a) where t1.a=t2.a; select t1.*,t2.* from t1 left join t2 using (a,c); +--sorted_result select t1.*,t2.* from t1 left join t2 using (c); select t1.*,t2.* from t1 natural left outer join t2; @@ -31,6 +33,7 @@ select t1.*,t2.* from t1 left join t2 on (t1.a=t2.a) where t2.id is null; explain select t1.*,t2.* from t1,t2 where t1.a=t2.a and isnull(t2.a)=1; explain select t1.*,t2.* from t1 left join t2 on t1.a=t2.a where isnull(t2.a)=1; +--sorted_result select t1.*,t2.*,t3.a from t1 left join t2 on (t1.a=t2.a) left join t1 as t3 on (t2.a=t3.a); # The next query should rearange the left joins to get this to work @@ -201,6 +204,7 @@ INSERT INTO t4 VALUES (1,-1,10360,1); INSERT INTO t4 VALUES (2,-1,10361,1); INSERT INTO t4 VALUES (3,-1,10362,1); +--sorted_result SELECT DISTINCT fill,desc_larga_cat,cred_total,Grup,Places,PlacesOcupades FROM t4 LEFT JOIN t3 ON t3.cod_asig=fill AND estat='S' AND dni_pasaporte='11111111' AND t3.idPla=1 , t2,t1 WHERE fill=t1.cod_asig AND Places>PlacesOcupades AND fill=idAssignatura AND t4.idPla=1 AND papa=-1; SELECT DISTINCT fill,t3.idPla FROM t4 LEFT JOIN t3 ON t3.cod_asig=t4.fill AND t3.estat='S' AND t3.dni_pasaporte='1234' AND t3.idPla=1 ; @@ -233,20 +237,25 @@ INSERT INTO t2 VALUES (1,1,'El Gato'); INSERT INTO t2 VALUES (2,1,'Perrito'); INSERT INTO t2 VALUES (3,3,'Happy'); +--sorted_result select t1.name, t2.name, t2.id from t1 left join t2 on (t1.id = t2.owner); select t1.name, t2.name, t2.id from t1 left join t2 on (t1.id = t2.owner) where t2.id is null; explain select t1.name, t2.name, t2.id from t1 left join t2 on (t1.id = t2.owner) where t2.id is null; explain select t1.name, t2.name, t2.id from t1 left join t2 on (t1.id = t2.owner) where t2.name is null; select count(*) from t1 left join t2 on (t1.id = t2.owner); +--sorted_result select t1.name, t2.name, t2.id from t2 right join t1 on (t1.id = t2.owner); select t1.name, t2.name, t2.id from t2 right join t1 on (t1.id = t2.owner) where t2.id is null; explain select t1.name, t2.name, t2.id from t2 right join t1 on (t1.id = t2.owner) where t2.id is null; explain select t1.name, t2.name, t2.id from t2 right join t1 on (t1.id = t2.owner) where t2.name is null; select count(*) from t2 right join t1 on (t1.id = t2.owner); +--sorted_result select t1.name, t2.name, t2.id,t3.id from t2 right join t1 on (t1.id = t2.owner) left join t1 as t3 on t3.id=t2.owner; +--sorted_result select t1.name, t2.name, t2.id,t3.id from t1 right join t2 on (t1.id = t2.owner) right join t1 as t3 on t3.id=t2.owner; +--sorted_result select t1.name, t2.name, t2.id, t2.owner, t3.id from t1 left join t2 on (t1.id = t2.owner) right join t1 as t3 on t3.id=t2.owner; drop table t1,t2; @@ -421,6 +430,7 @@ insert into t1 (fooID) values (10),(20),(30); insert into t2 values (10,1),(20,2),(30,3); explain select * from t2 left join t1 on t1.fooID = t2.fooID and t1.fooID = 30; select * from t2 left join t1 on t1.fooID = t2.fooID and t1.fooID = 30; +--sorted_result select * from t2 left join t1 ignore index(primary) on t1.fooID = t2.fooID and t1.fooID = 30; drop table t1,t2; @@ -430,10 +440,13 @@ create table t3 (i int); insert into t1 values(1),(2); insert into t2 values(2),(3); insert into t3 values(2),(4); +--sorted_result select * from t1 natural left join t2 natural left join t3; select * from t1 natural left join t2 where (t2.i is not null)=0; +--sorted_result select * from t1 natural left join t2 where (t2.i is not null) is not null; select * from t1 natural left join t2 where (i is not null)=0; +--sorted_result select * from t1 natural left join t2 where (i is not null) is not null; drop table t1,t2,t3; @@ -730,11 +743,16 @@ SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t2.b <= t1.a AND t1.a <= t1.b SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a BETWEEN t2.b AND t1.b; SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT(t1.a NOT BETWEEN t2.b AND t1.b); +--sorted_result SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t2.b > t1.a OR t1.a > t1.b; +--sorted_result SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a NOT BETWEEN t2.b AND t1.b; +--sorted_result SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT(t1.a BETWEEN t2.b AND t1.b); +--sorted_result SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a = t2.a OR t2.b > t1.a OR t1.a > t1.b; +--sorted_result SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE NOT(t1.a != t2.a AND t1.a BETWEEN t2.b AND t1.b); SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.a WHERE t1.a = t2.a AND (t2.b > t1.a OR t1.a > t1.b); @@ -801,11 +819,16 @@ CREATE TABLE t2 (b int); INSERT INTO t1 VALUES (1), (2), (3), (4); INSERT INTO t2 VALUES (2), (3); +--sorted_result SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.b WHERE (1=1); +--sorted_result SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.b WHERE (1 OR 1); +--sorted_result SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.b WHERE (0 OR 1); +--sorted_result SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.b WHERE (1=1 OR 2=2); +--sorted_result SELECT * FROM t1 LEFT JOIN t2 ON t1.a = t2.b WHERE (1=1 OR 1=0); DROP TABLE t1,t2; @@ -1108,6 +1131,7 @@ INSERT INTO t3 VALUES (0),(1),(2), (4); CREATE TABLE t4 (i INT NOT NULL); INSERT INTO t4 VALUES (0),(1),(2),(3) ; +--sorted_result SELECT * FROM t1 LEFT JOIN ( t2 LEFT JOIN @@ -1120,6 +1144,7 @@ SELECT * FROM ON t2.i = t1.i ; +--sorted_result SELECT * FROM t1 LEFT JOIN ( t2 LEFT JOIN @@ -1135,6 +1160,7 @@ SELECT * FROM # Most simplified testcase to reproduce the bug. # (Has to be at least a two level nested outer join) +--sorted_result SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN @@ -1150,6 +1176,7 @@ SELECT * FROM # We then add some equi-join inside the query above: # (There Used to be some problems here with first # proposed patch for this bug) +--sorted_result SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN @@ -1162,6 +1189,7 @@ SELECT * FROM ON t2.i = t1.i WHERE t3.i IS NULL; +--sorted_result SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN @@ -1174,6 +1202,7 @@ SELECT * FROM ON t2.i = t1.i WHERE t3.i IS NULL; +--sorted_result SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN @@ -1205,6 +1234,7 @@ CREATE TABLE k (pk INT NOT NULL, col_int_key INT); INSERT INTO k VALUES (1,9),(2,2),(3,5),(4,2),(5,7),(6,0),(7,5); # Baseline query wo/ 'WHERE ... IS NULL' - was correct +--sorted_result SELECT TABLE1.pk FROM k TABLE1 RIGHT JOIN h TABLE2 ON TABLE1.col_int_key=TABLE2.col_int_key RIGHT JOIN m TABLE4 ON TABLE2.col_int_key=TABLE4.col_int_key; diff --git a/mysql-test/t/mysql_client_test-master.opt b/mysql-test/t/mysql_client_test-master.opt index 3dfaf15666f..d2db22b8634 100644 --- a/mysql-test/t/mysql_client_test-master.opt +++ b/mysql-test/t/mysql_client_test-master.opt @@ -1,4 +1,3 @@ --log=$MYSQLTEST_VARDIR/log/master.log --log-output=FILE,TABLE -$PLUGIN_AUTH_OPT -$PLUGIN_AUTH_LOAD +--plugin-load=$AUTH_TEST_PLUGIN_SO diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test index 529d60517c0..7b689a751df 100644 --- a/mysql-test/t/mysql_client_test.test +++ b/mysql-test/t/mysql_client_test.test @@ -14,7 +14,7 @@ SET @old_slow_query_log= @@global.slow_query_log; # var/log/mysql_client_test.trace --exec echo "$MYSQL_CLIENT_TEST" > $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 ---exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M $PLUGIN_AUTH_CLIENT_OPT >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 +--exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M --plugin-dir=$MYSQLTEST_VARDIR/plugins >> $MYSQLTEST_VARDIR/log/mysql_client_test.out.log 2>&1 # End of 4.1 tests echo ok; diff --git a/mysql-test/t/mysqladmin.test b/mysql-test/t/mysqladmin.test index 4811c5fdbc6..c04c8d50f3c 100644 --- a/mysql-test/t/mysqladmin.test +++ b/mysql-test/t/mysqladmin.test @@ -4,35 +4,21 @@ # Test "mysqladmin ping" # ---exec $MYSQLADMIN --no-defaults --default-character-set=latin1 -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1 +--exec $MYSQLADMIN --default-character-set=latin1 -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1 # # Bug#10608 mysqladmin breaks on "database" variable in my.cnf # -# When mysqladmin finds database in .cnf file it shall fail ---write_file $MYSQLTEST_VARDIR/tmp/bug10608.cnf -[client] -database=db1 -EOF - --replace_regex /.*mysqladmin.*: unknown/mysqladmin: unknown/ --error 7 ---exec $MYSQLADMIN --defaults-file=$MYSQLTEST_VARDIR/tmp/bug10608.cnf --default-character-set=latin1 -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1 -remove_file $MYSQLTEST_VARDIR/tmp/bug10608.cnf; +--exec $MYSQLADMIN --database=db1 --default-character-set=latin1 -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1 -# When mysqladmin finds "loose-database" in .cnf file it shall print +# When mysqladmin finds "loose-database" it shall print # a warning and continue ---write_file $MYSQLTEST_VARDIR/tmp/bug10608.cnf -[client] -loose-database=db2 -EOF - --replace_regex /Warning: .*mysqladmin.*: unknown/Warning: mysqladmin: unknown/ ---exec $MYSQLADMIN --defaults-file=$MYSQLTEST_VARDIR/tmp/bug10608.cnf --default-character-set=latin1 -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1 - -remove_file $MYSQLTEST_VARDIR/tmp/bug10608.cnf; +--exec $MYSQLADMIN --loose-database=db2 --default-character-set=latin1 -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= ping 2>&1 --echo # --echo # Bug#58221 : mysqladmin --sleep=x --count=x keeps looping diff --git a/mysql-test/t/plugin_auth-master.opt b/mysql-test/t/plugin_auth-master.opt index 3536d102387..ff91abb1bef 100644 --- a/mysql-test/t/plugin_auth-master.opt +++ b/mysql-test/t/plugin_auth-master.opt @@ -1,2 +1 @@ -$PLUGIN_AUTH_OPT -$PLUGIN_AUTH_LOAD +--plugin-load=$AUTH_TEST_PLUGIN_SO diff --git a/mysql-test/t/plugin_auth.test b/mysql-test/t/plugin_auth.test index a81cf4e4783..16c96fa0c21 100644 --- a/mysql-test/t/plugin_auth.test +++ b/mysql-test/t/plugin_auth.test @@ -97,16 +97,13 @@ REVOKE ALL PRIVILEGES ON test_grant_db.* FROM new_grant_user; --echo # try re-create existing user via GRANT IDENTIFIED BY GRANT ALL PRIVILEGES ON test_grant_db.* TO new_grant_user - IDENTIFIED BY 'unused_password'; + IDENTIFIED BY 'new_password'; ---echo # make sure password doesn't take precendence ---disable_query_log +--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK --error ER_ACCESS_DENIED_ERROR -connect(plug_con_grant_deny,localhost,new_grant_user,unused_password); ---enable_query_log +connect(plug_con_grant_deny,localhost,new_grant_user,plug_dest); ---echo #make sure plugin auth still available -connect(plug_con_grant,localhost,new_grant_user,plug_dest); +connect(plug_con_grant,localhost,new_grant_user,new_password); connection plug_con_grant; select USER(),CURRENT_USER(); USE test_grant_db; @@ -119,11 +116,9 @@ DROP USER new_grant_user; --echo # try re-create existing user via GRANT IDENTIFIED WITH ---error ER_GRANT_PLUGIN_USER_EXISTS GRANT ALL PRIVILEGES ON test_grant_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; ---error ER_GRANT_PLUGIN_USER_EXISTS GRANT ALL PRIVILEGES ON test_grant_db.* TO plug_dest IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; @@ -400,16 +395,16 @@ FLUSH PRIVILEGES; --echo # --echo # Executing 'mysql' ---exec $MYSQL -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-auth=auth_test_plugin $PLUGIN_AUTH_OPT -e "SELECT 1" +--exec $MYSQL -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-auth=auth_test_plugin -e "SELECT 1" --echo # Executing 'mysqladmin' ---exec $MYSQLADMIN -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-auth=auth_test_plugin $PLUGIN_AUTH_OPT ping +--exec $MYSQLADMIN -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-auth=auth_test_plugin ping --echo # Executing 'mysqldump' ---exec $MYSQL_DUMP -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT --compact --default-auth=auth_test_plugin $PLUGIN_AUTH_OPT test +--exec $MYSQL_DUMP -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT --compact --default-auth=auth_test_plugin test --echo # Executing 'mysql_upgrade' ---exec $MYSQL_UPGRADE -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-auth=auth_test_plugin $PLUGIN_AUTH_OPT --skip-verbose --force --upgrade-system-tables +--exec $MYSQL_UPGRADE -u root -S $MASTER_MYSOCK -P $MASTER_MYPORT --default-auth=auth_test_plugin --skip-verbose --force --upgrade-system-tables --echo # --echo # Bug #59657: Move the client authentication_pam plugin into the diff --git a/mysql-test/t/plugin_auth_qa-master.opt b/mysql-test/t/plugin_auth_qa-master.opt index 3536d102387..ff91abb1bef 100644 --- a/mysql-test/t/plugin_auth_qa-master.opt +++ b/mysql-test/t/plugin_auth_qa-master.opt @@ -1,2 +1 @@ -$PLUGIN_AUTH_OPT -$PLUGIN_AUTH_LOAD +--plugin-load=$AUTH_TEST_PLUGIN_SO diff --git a/mysql-test/t/plugin_auth_qa.test b/mysql-test/t/plugin_auth_qa.test index 0961c1dfef5..3a3921510e0 100644 --- a/mysql-test/t/plugin_auth_qa.test +++ b/mysql-test/t/plugin_auth_qa.test @@ -166,9 +166,7 @@ SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; DROP USER plug_dest; # CREATE USER plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; ---error 1700 GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest'; ---error 1700 GRANT ALL PRIVILEGES ON test_user_db.* TO plug IDENTIFIED WITH 'test_plugin_server'; DROP USER plug; # diff --git a/mysql-test/t/plugin_auth_qa_1-master.opt b/mysql-test/t/plugin_auth_qa_1-master.opt index 3536d102387..ff91abb1bef 100644 --- a/mysql-test/t/plugin_auth_qa_1-master.opt +++ b/mysql-test/t/plugin_auth_qa_1-master.opt @@ -1,2 +1 @@ -$PLUGIN_AUTH_OPT -$PLUGIN_AUTH_LOAD +--plugin-load=$AUTH_TEST_PLUGIN_SO diff --git a/mysql-test/t/plugin_auth_qa_1.test b/mysql-test/t/plugin_auth_qa_1.test index 06908935b01..e5d7e5cad02 100644 --- a/mysql-test/t/plugin_auth_qa_1.test +++ b/mysql-test/t/plugin_auth_qa_1.test @@ -14,11 +14,11 @@ SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; CREATE USER plug_user IDENTIFIED WITH test_plugin_server AS 'plug_dest'; CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; GRANT PROXY ON plug_dest TO plug_user; ---replace_result $MASTER_MYSOCK MASTER_MYSOCK $PLUGIN_AUTH_OPT PLUGIN_AUTH_OPT ---exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1 +--replace_result $MASTER_MYSOCK MASTER_MYSOCK +--exec $MYSQL -S $MASTER_MYSOCK -u plug_user --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1 REVOKE PROXY ON plug_dest FROM plug_user; --error 1 ---exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1 +--exec $MYSQL -S $MASTER_MYSOCK -u plug_user --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1 DROP USER plug_user,plug_dest; # # GRANT...WITH @@ -30,17 +30,17 @@ GRANT PROXY ON plug_dest TO plug_user; --sorted_result SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; --echo 1) ---replace_result $MASTER_MYSOCK MASTER_MYSOCK $PLUGIN_AUTH_OPT PLUGIN_AUTH_OPT ---exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1 +--replace_result $MASTER_MYSOCK MASTER_MYSOCK +--exec $MYSQL -S $MASTER_MYSOCK -u plug_user --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1 REVOKE ALL PRIVILEGES ON test_user_db.* FROM 'plug_user' IDENTIFIED WITH test_plugin_server AS 'plug_dest'; --echo 2) ---replace_result $MASTER_MYSOCK MASTER_MYSOCK $PLUGIN_AUTH_OPT PLUGIN_AUTH_OPT ---exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1 +--replace_result $MASTER_MYSOCK MASTER_MYSOCK +--exec $MYSQL -S $MASTER_MYSOCK -u plug_user --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1 REVOKE PROXY ON plug_dest FROM plug_user; --echo 3) --error 1 ---exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1 +--exec $MYSQL -S $MASTER_MYSOCK -u plug_user --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1 DROP USER plug_user,plug_dest; # # GRANT...WITH/CREATE...BY @@ -49,11 +49,11 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO plug_user CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; --echo 1) --error 1 ---exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1 +--exec $MYSQL -S $MASTER_MYSOCK -u plug_user --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1 GRANT PROXY ON plug_dest TO plug_user; --echo 2) ---replace_result $MASTER_MYSOCK MASTER_MYSOCK $PLUGIN_AUTH_OPT PLUGIN_AUTH_OPT ---exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1 +--replace_result $MASTER_MYSOCK MASTER_MYSOCK +--exec $MYSQL -S $MASTER_MYSOCK -u plug_user --password=plug_dest -e "SELECT current_user();SELECT user();USE test_user_db;CREATE TABLE t1(a int);SHOW TABLES;DROP TABLE t1;" 2>&1 REVOKE ALL PRIVILEGES ON test_user_db.* FROM 'plug_user' IDENTIFIED WITH test_plugin_server AS 'plug_dest'; #REVOKE ALL PRIVILEGES ON test_user_db.* FROM 'plug_dest' @@ -67,14 +67,14 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO plug_user IDENTIFIED WITH test_plugin_server AS 'plug_dest'; CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; GRANT PROXY ON plug_dest TO plug_user; ---replace_result $MASTER_MYSOCK MASTER_MYSOCK $PLUGIN_AUTH_OPT PLUGIN_AUTH_OPT ---exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();" 2>&1 +--replace_result $MASTER_MYSOCK MASTER_MYSOCK +--exec $MYSQL -S $MASTER_MYSOCK -u plug_user --password=plug_dest -e "SELECT current_user();SELECT user();" 2>&1 RENAME USER plug_dest TO new_dest; --error 1 ---exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();" 2>&1 +--exec $MYSQL -S $MASTER_MYSOCK -u plug_user --password=plug_dest -e "SELECT current_user();SELECT user();" 2>&1 GRANT PROXY ON new_dest TO plug_user; --error 1 ---exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=new_dest -e "SELECT current_user();SELECT user();" 2>&1 +--exec $MYSQL -S $MASTER_MYSOCK -u plug_user --password=new_dest -e "SELECT current_user();SELECT user();" 2>&1 --sorted_result SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; DROP USER plug_user,new_dest; @@ -84,16 +84,16 @@ CREATE USER plug_user IDENTIFIED WITH test_plugin_server AS 'plug_dest'; CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd'; --error 1 ---exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();" 2>&1 +--exec $MYSQL -S $MASTER_MYSOCK -u plug_user --password=plug_dest -e "SELECT current_user();SELECT user();" 2>&1 GRANT PROXY ON plug_dest TO plug_user; ---replace_result $MASTER_MYSOCK MASTER_MYSOCK $PLUGIN_AUTH_OPT PLUGIN_AUTH_OPT ---exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();" 2>&1 +--replace_result $MASTER_MYSOCK MASTER_MYSOCK +--exec $MYSQL -S $MASTER_MYSOCK -u plug_user --password=plug_dest -e "SELECT current_user();SELECT user();" 2>&1 RENAME USER plug_dest TO new_dest; --error 1 ---exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=plug_dest -e "SELECT current_user();SELECT user();" 2>&1 +--exec $MYSQL -S $MASTER_MYSOCK -u plug_user --password=plug_dest -e "SELECT current_user();SELECT user();" 2>&1 GRANT PROXY ON new_dest TO plug_user; --error 1 ---exec $MYSQL -S $MASTER_MYSOCK -u plug_user $PLUGIN_AUTH_OPT --password=new_dest -e "SELECT current_user();SELECT user();" 2>&1 +--exec $MYSQL -S $MASTER_MYSOCK -u plug_user --password=new_dest -e "SELECT current_user();SELECT user();" 2>&1 --sorted_result SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; DROP USER plug_user,new_dest; @@ -328,13 +328,13 @@ FLUSH PRIVILEGES; # Not working with the patch. #--replace_result $MYSQLADMIN MYSQLADMIN $MASTER_MYPORT MYPORT $MASTER_MYSOCK MYSOCK -#--exec $MYSQLADMIN $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT -S $MASTER_MYSOCK -u plug_user --password=plug_dest ping 2>&1 +#--exec $MYSQLADMIN -h localhost -P $MASTER_MYPORT -S $MASTER_MYSOCK -u plug_user --password=plug_dest ping 2>&1 #--replace_result $MYSQL_CHECK MYSQL_CHECK $MASTER_MYPORT MYPORT -#--exec $MYSQL_CHECK $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT -u plug_user --password=plug_dest test +#--exec $MYSQL_CHECK -h localhost -P $MASTER_MYPORT -u plug_user --password=plug_dest test #--replace_result $MYSQL_DUMP MYSQL_DUMP $MASTER_MYPORT MYPORT -#--exec $MYSQL_DUMP -h localhost -P $MASTER_MYPORT $PLUGIN_AUTH_OPT -u plug_user --password=plug_dest test +#--exec $MYSQL_DUMP -h localhost -P $MASTER_MYPORT -u plug_user --password=plug_dest test #--replace_result $MYSQL_SHOW MYSQL_SHOW $MASTER_MYPORT MYPORT -#--exec $MYSQL_SHOW $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT --plugin_dir=../plugin/auth -u plug_user --password=plug_dest 2>&1 +#--exec $MYSQL_SHOW -h localhost -P $MASTER_MYPORT --plugin_dir=../plugin/auth -u plug_user --password=plug_dest 2>&1 DROP USER plug_user, plug_dest; DROP DATABASE test_user_db; --exit diff --git a/mysql-test/t/plugin_auth_qa_2-master.opt b/mysql-test/t/plugin_auth_qa_2-master.opt index 354907b9366..1a023ad271c 100644 --- a/mysql-test/t/plugin_auth_qa_2-master.opt +++ b/mysql-test/t/plugin_auth_qa_2-master.opt @@ -1,2 +1 @@ -$PLUGIN_AUTH_INTERFACE_OPT -$PLUGIN_AUTH_INTERFACE_LOAD +--plugin-load=$QA_AUTH_INTERFACE_SO diff --git a/mysql-test/t/plugin_auth_qa_2.test b/mysql-test/t/plugin_auth_qa_2.test index e265690dc7d..0f89e54f357 100644 --- a/mysql-test/t/plugin_auth_qa_2.test +++ b/mysql-test/t/plugin_auth_qa_2.test @@ -20,8 +20,8 @@ SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT @@proxy_user; SELECT @@external_user; ---echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT -u qa_test_1_user --password=qa_test_1_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 ---exec $MYSQL $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT -u qa_test_1_user --password=qa_test_1_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +--echo exec MYSQL -h localhost -P MASTER_MYPORT -u qa_test_1_user --password=qa_test_1_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +--exec $MYSQL -h localhost -P $MASTER_MYPORT -u qa_test_1_user --password=qa_test_1_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 --sorted_result SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; @@ -42,8 +42,8 @@ SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; SELECT @@proxy_user; SELECT @@external_user; ---echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT -u qa_test_2_user --password=qa_test_2_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 ---exec $MYSQL $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT -u qa_test_2_user --password=qa_test_2_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +--echo exec MYSQL -h localhost -P MASTER_MYPORT -u qa_test_2_user --password=qa_test_2_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +--exec $MYSQL -h localhost -P $MASTER_MYPORT -u qa_test_2_user --password=qa_test_2_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 --sorted_result SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root'; @@ -59,8 +59,8 @@ CREATE USER qa_test_3_dest IDENTIFIED BY 'dest_passwd'; GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_3_dest identified by 'dest_passwd'; GRANT PROXY ON qa_test_3_dest TO qa_test_3_user; ---echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT -u qa_test_3_user --password=qa_test_3_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 ---exec $MYSQL $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT -u qa_test_3_user --password=qa_test_3_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +--echo exec MYSQL -h localhost -P MASTER_MYPORT -u qa_test_3_user --password=qa_test_3_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +--exec $MYSQL -h localhost -P $MASTER_MYPORT -u qa_test_3_user --password=qa_test_3_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 DROP USER qa_test_3_user; DROP USER qa_test_3_dest; @@ -72,8 +72,8 @@ CREATE USER qa_test_4_dest IDENTIFIED BY 'dest_passwd'; GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_4_dest identified by 'dest_passwd'; GRANT PROXY ON qa_test_4_dest TO qa_test_4_user; ---echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT -u qa_test_4_user --password=qa_test_4_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 ---exec $MYSQL $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT -u qa_test_4_user --password=qa_test_4_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +--echo exec MYSQL -h localhost -P MASTER_MYPORT -u qa_test_4_user --password=qa_test_4_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +--exec $MYSQL -h localhost -P $MASTER_MYPORT -u qa_test_4_user --password=qa_test_4_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 DROP USER qa_test_4_user; DROP USER qa_test_4_dest; @@ -91,9 +91,9 @@ GRANT PROXY ON qa_test_5_dest TO ''@'localhost'; --sorted_result SELECT user,plugin,authentication_string,password FROM mysql.user WHERE user != 'root'; ---echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=qa_test_5_user --password=qa_test_5_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +--echo exec MYSQL -h localhost -P MASTER_MYPORT --user=qa_test_5_user --password=qa_test_5_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 --error 1 ---exec $MYSQL $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT --user=qa_test_5_user --password=qa_test_5_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +--exec $MYSQL -h localhost -P $MASTER_MYPORT --user=qa_test_5_user --password=qa_test_5_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 DROP USER qa_test_5_user; DROP USER qa_test_5_dest; @@ -109,25 +109,25 @@ GRANT PROXY ON qa_test_6_dest TO qa_test_6_user; --sorted_result SELECT user,plugin,authentication_string,password FROM mysql.user; ---echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=qa_test_6_user --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +--echo exec MYSQL -h localhost -P MASTER_MYPORT --user=qa_test_6_user --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 --error 1 ---exec $MYSQL $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT --user=qa_test_6_user --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +--exec $MYSQL -h localhost -P $MASTER_MYPORT --user=qa_test_6_user --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 GRANT PROXY ON qa_test_6_dest TO root IDENTIFIED WITH qa_auth_interface AS 'qa_test_6_dest'; --sorted_result SELECT user,plugin,authentication_string,password FROM mysql.user; ---echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +--echo exec MYSQL -h localhost -P MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 --error 1 ---exec $MYSQL $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +--exec $MYSQL -h localhost -P $MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 REVOKE PROXY ON qa_test_6_dest FROM root; --sorted_result SELECT user,plugin,authentication_string FROM mysql.user; ---echo exec MYSQL PLUGIN_AUTH_OPT -h localhost -P MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +--echo exec MYSQL -h localhost -P MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 --error 1 ---exec $MYSQL $PLUGIN_AUTH_OPT -h localhost -P $MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +--exec $MYSQL -h localhost -P $MASTER_MYPORT --user=root --password=qa_test_6_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 DROP USER qa_test_6_user; DROP USER qa_test_6_dest; @@ -143,9 +143,9 @@ CREATE USER qa_test_11_dest IDENTIFIED BY 'dest_passwd'; GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_11_dest identified by 'dest_passwd'; GRANT PROXY ON qa_test_11_dest TO qa_test_11_user; ---echo exec MYSQL PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +--echo exec MYSQL --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 --error 1 ---exec $MYSQL $PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P $MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +--exec $MYSQL --default_auth=qa_auth_client -h localhost -P $MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 DROP USER qa_test_11_user, qa_test_11_dest; DROP DATABASE test_user_db; diff --git a/mysql-test/t/plugin_auth_qa_3-master.opt b/mysql-test/t/plugin_auth_qa_3-master.opt index e1754862a4d..5d53a9dbe04 100644 --- a/mysql-test/t/plugin_auth_qa_3-master.opt +++ b/mysql-test/t/plugin_auth_qa_3-master.opt @@ -1,2 +1 @@ -$PLUGIN_AUTH_SERVER_OPT -$PLUGIN_AUTH_SERVER_LOAD +--plugin-load=$QA_AUTH_SERVER_SO diff --git a/mysql-test/t/plugin_auth_qa_3.test b/mysql-test/t/plugin_auth_qa_3.test index f7d90226332..349d574227a 100644 --- a/mysql-test/t/plugin_auth_qa_3.test +++ b/mysql-test/t/plugin_auth_qa_3.test @@ -12,12 +12,12 @@ CREATE USER qa_test_11_user IDENTIFIED WITH qa_auth_server AS 'qa_test_11_dest'; GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_11_dest identified by 'dest_passwd'; GRANT PROXY ON qa_test_11_dest TO qa_test_11_user; ---echo exec MYSQL PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 ---exec $MYSQL $PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P $MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +--echo exec MYSQL --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +--exec $MYSQL --default_auth=qa_auth_client -h localhost -P $MASTER_MYPORT -u qa_test_11_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 ---echo exec MYSQL PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_2_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +--echo exec MYSQL --default_auth=qa_auth_client -h localhost -P MASTER_MYPORT -u qa_test_2_user --password=qa_test_11_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 --error 1 ---exec $MYSQL $PLUGIN_AUTH_OPT --default_auth=qa_auth_client -h localhost -P $MASTER_MYPORT -u qa_test_2_user --password=qa_test_2_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 +--exec $MYSQL --default_auth=qa_auth_client -h localhost -P $MASTER_MYPORT -u qa_test_2_user --password=qa_test_2_dest test_user_db -e "SELECT current_user(),user(),@@local.proxy_user,@@local.external_user;" 2>&1 DROP USER qa_test_11_user, qa_test_11_dest; DROP DATABASE test_user_db; diff --git a/mysql-test/t/plugin_load_option-master.opt b/mysql-test/t/plugin_load_option-master.opt index e22ecb4ff3a..a5a12e7b0d6 100644 --- a/mysql-test/t/plugin_load_option-master.opt +++ b/mysql-test/t/plugin_load_option-master.opt @@ -1,3 +1,2 @@ -$EXAMPLE_PLUGIN_OPT -$EXAMPLE_PLUGIN_LOAD +--plugin-load=EXAMPLE=$HA_EXAMPLE_SO --loose-plugin-example=FORCE_PLUS_PERMANENT diff --git a/mysql-test/t/plugin_not_embedded.test b/mysql-test/t/plugin_not_embedded.test index f183d1f0ffe..3e3bd6e86ca 100644 --- a/mysql-test/t/plugin_not_embedded.test +++ b/mysql-test/t/plugin_not_embedded.test @@ -25,7 +25,7 @@ DROP USER bug51770@localhost; # The bug consisted of not recognizing / on Windows, so checking / on # all platforms should cover this case. -let $path = `select CONCAT_WS('/', '..', '$EXAMPLE_PLUGIN')`; +let $path = `select CONCAT_WS('/', '..', '$HA_EXAMPLE_SO')`; --replace_regex /\.dll/.so/ --error ER_UDF_NO_PATHS eval INSTALL PLUGIN example SONAME '$path'; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index ab0487e6acf..534f39d631b 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -1855,7 +1855,9 @@ select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; select * from (t1 as t2 left join t1 as t3 using (a)) inner join t1 using ( a ); select * from t1 inner join (t1 as t2 left join t1 as t3 using (a)) using ( a ); # left [outer] join on +--sorted_result select * from (t1 as t2 left join t1 as t3 using (a)) left outer join t1 on t1.a>1; +--sorted_result select * from t1 left outer join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; # left join using select * from (t1 as t2 left join t1 as t3 using (a)) left join t1 using ( a ); @@ -1864,7 +1866,9 @@ select * from t1 left join (t1 as t2 left join t1 as t3 using (a)) using ( a ); select * from (t1 as t2 left join t1 as t3 using (a)) natural left join t1; select * from t1 natural left join (t1 as t2 left join t1 as t3 using (a)); # right join on +--sorted_result select * from (t1 as t2 left join t1 as t3 using (a)) right join t1 on t1.a>1; +--sorted_result select * from t1 right join (t1 as t2 left join t1 as t3 using (a)) on t1.a>1; # right [outer] joing using select * from (t1 as t2 left join t1 as t3 using (a)) right outer join t1 using ( a ); @@ -2535,10 +2539,14 @@ insert into t1 values(1),(2); insert into t2 values(1),(2); create view v2 (c) as select a1 from t1; +--sorted_result select * from t1 natural left join t2; +--sorted_result select * from t1 natural right join t2; +--sorted_result select * from v2 natural left join t2; +--sorted_result select * from v2 natural right join t2; drop table t1, t2; @@ -2707,16 +2715,20 @@ create view v3 as select (t1.id+2) as id from t1 natural left join t2; # all queries must return the same result select t1.id from t1 left join v2 using (id); select t1.id from v2 right join t1 using (id); +--sorted_result select t1.id from t1 left join v3 using (id); select * from t1 left join v2 using (id); select * from v2 right join t1 using (id); +--sorted_result select * from t1 left join v3 using (id); select v1.id from v1 left join v2 using (id); select v1.id from v2 right join v1 using (id); +--sorted_result select v1.id from v1 left join v3 using (id); select * from v1 left join v2 using (id); select * from v2 right join v1 using (id); +--sorted_result select * from v1 left join v3 using (id); drop table t1, t2; diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test index 02c3b219a06..20585dd9ab7 100644 --- a/mysql-test/t/symlink.test +++ b/mysql-test/t/symlink.test @@ -82,7 +82,7 @@ engine=myisam index directory="not-hard-path"; # Should fail becasue the file t9.MYI already exist in 'run' --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR ---error 1,ER_UNKNOWN_ERROR +--error 1,156 eval create table mysqltest.t9 (a int not null auto_increment, b char(16) not null, primary key (a)) engine=myisam index directory="$MYSQLTEST_VARDIR/run"; diff --git a/mysql-test/t/xa.test b/mysql-test/t/xa.test index 8ce9ce52960..26c2f0ce210 100644 --- a/mysql-test/t/xa.test +++ b/mysql-test/t/xa.test @@ -338,8 +338,8 @@ DROP TABLE t1; DROP TABLE IF EXISTS t1, t2; --enable_warnings -CREATE TABLE t1 (a INT); -CREATE TABLE t2 (a INT); +CREATE TABLE t1 (a INT) engine=innodb; +CREATE TABLE t2 (a INT) engine=innodb; START TRANSACTION; INSERT INTO t1 VALUES (1); diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index 4a548fe330f..82098a7c9cc 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -1853,9 +1853,7 @@ int end_io_cache(IO_CACHE *info) info->type= TYPE_NOT_SET; mysql_mutex_destroy(&info->append_buffer_lock); } -#ifdef THREAD info->share= 0; -#endif DBUG_RETURN(error); } /* end_io_cache */ diff --git a/mysys/my_bitmap.c b/mysys/my_bitmap.c index be39ac50731..762a89cd921 100644 --- a/mysys/my_bitmap.c +++ b/mysys/my_bitmap.c @@ -472,17 +472,19 @@ void bitmap_invert(MY_BITMAP *map) uint bitmap_bits_set(const MY_BITMAP *map) -{ - uchar *m= (uchar*)map->bitmap; - uchar *end= m + no_bytes_in_map(map) - 1; +{ + my_bitmap_map *data_ptr= map->bitmap; + my_bitmap_map *end= map->last_word_ptr; uint res= 0; - DBUG_ASSERT(map->bitmap); - while (m < end) - res+= my_count_bits_ushort(*m++); - return res + my_count_bits_ushort(*m & last_byte_mask(map->n_bits)); -} + for (; data_ptr < end; data_ptr++) + res+= my_count_bits_uint32(*data_ptr); + + /*Reset last bits to zero*/ + res+= my_count_bits_uint32(*map->last_word_ptr & ~map->last_word_mask); + return res; +} void bitmap_copy(MY_BITMAP *map, const MY_BITMAP *map2) { diff --git a/mysys/my_handler_errors.h b/mysys/my_handler_errors.h index 97282503967..aed08b0151c 100644 --- a/mysys/my_handler_errors.h +++ b/mysys/my_handler_errors.h @@ -66,7 +66,7 @@ static const char *handler_error_messages[]= "File too short; Expected more data in file", "Read page with wrong checksum", "Too many active concurrent transactions", - "Index column length exceeds limit" + "Index column length exceeds limit", "Row is not visible by the current transaction" }; diff --git a/mysys/my_safehash.h b/mysys/my_safehash.h index 8a5856b6763..b5c0ca6634b 100644 --- a/mysys/my_safehash.h +++ b/mysys/my_safehash.h @@ -39,9 +39,7 @@ typedef struct st_safe_hash_entry typedef struct st_safe_hash_with_default { -#ifdef THREAD rw_lock_t mutex; -#endif HASH hash; uchar *default_value; SAFE_HASH_ENTRY *root; diff --git a/mysys/my_uuid.c b/mysys/my_uuid.c index f115806b4e9..b82ce860c63 100644 --- a/mysys/my_uuid.c +++ b/mysys/my_uuid.c @@ -49,9 +49,7 @@ static uint nanoseq; static ulonglong uuid_time= 0; static uchar uuid_suffix[2+6]; /* clock_seq and node */ -#ifdef THREAD pthread_mutex_t LOCK_uuid_generator; -#endif /* Number of 100-nanosecond intervals between diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c index 8034e6d30a8..bc992a3e35b 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -1578,7 +1578,7 @@ static ulong sum=0; /* The following functions is for WRITE_CONCURRENT_INSERT */ static void test_get_status(void* param __attribute__((unused)), - int concurrent_insert __attribute__((unused))) + my_bool concurrent_insert __attribute__((unused))) { } diff --git a/mysys/typelib.c b/mysys/typelib.c index 463d3ba53a5..f724e5b27a2 100644 --- a/mysys/typelib.c +++ b/mysys/typelib.c @@ -43,12 +43,12 @@ int find_type_with_warning(const char *x, TYPELIB *typelib, const char *option) } -uint find_type_or_exit(const char *x, TYPELIB *typelib, const char *option) +int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option) { int res; if ((res= find_type_with_warning(x, typelib, option)) <= 0) exit(1); - return (uint) res; + return res; } diff --git a/plugin/auth/dialog.c b/plugin/auth/dialog.c index f496d454256..f2901811428 100644 --- a/plugin/auth/dialog.c +++ b/plugin/auth/dialog.c @@ -39,16 +39,16 @@ # define RTLD_DEFAULT GetModuleHandle(NULL) #endif +#if !defined (_GNU_SOURCE) +# define _GNU_SOURCE /* for RTLD_DEFAULT */ +#endif + #include <mysql/plugin_auth.h> #include <mysql/client_plugin.h> #include <string.h> #include <stdio.h> #include <stdlib.h> -#if !defined (_GNU_SOURCE) -# define _GNU_SOURCE /* for RTLD_DEFAULT */ -#endif - /** first byte of the question string is the question "type". It can be an "ordinary" or a "password" question. diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index d133a081e52..dea54f3b65d 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -617,9 +617,6 @@ ALTER TABLE user MODIFY Create_tablespace_priv enum('N','Y') COLLATE utf8_genera UPDATE user SET Create_tablespace_priv = Super_priv WHERE @hadCreateTablespacePriv = 0; -ALTER TABLE user ADD plugin char(60) CHARACTER SET latin1 DEFAULT '' NOT NULL, ADD auth_string TEXT NOT NULL; -ALTER TABLE user MODIFY plugin char(60) CHARACTER SET latin1 DEFAULT '' NOT NULL; - -- -- Unlike 'performance_schema', the 'mysql' database is reserved already, -- so no user procedure is supposed to be there. @@ -644,8 +641,8 @@ DROP PREPARE stmt; drop procedure mysql.die; ALTER TABLE user ADD plugin char(64) DEFAULT '', ADD authentication_string TEXT; -ALTER TABLE user MODIFY plugin char(64) DEFAULT ''; -ALTER TABLE user MODIFY authentication_string TEXT; +ALTER TABLE user MODIFY plugin char(64) CHARACTER SET latin1 DEFAULT '' NOT NULL; +ALTER TABLE user MODIFY authentication_string TEXT NOT NULL; -- Need to pre-fill mysql.proxies_priv with access for root even when upgrading from -- older versions diff --git a/sql-common/client.c b/sql-common/client.c index 21f41e4da0b..e6f1eb15c7b 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -4323,7 +4323,7 @@ static int old_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql) DBUG_RETURN(CR_SERVER_HANDSHAKE_ERR); /* save it in MYSQL */ - memcpy(mysql->scramble, pkt, pkt_len); + memmove(mysql->scramble, pkt, pkt_len); mysql->scramble[pkt_len] = 0; } @@ -4356,100 +4356,3 @@ static int clear_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql) return res ? CR_ERROR : CR_OK; } - -/** - client authentication plugin that does native MySQL authentication - using a 20-byte (4.1+) scramble -*/ - -static int native_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql) -{ - int pkt_len; - uchar *pkt; - - if (((MCPVIO_EXT *)vio)->mysql_change_user) - { - /* - in mysql_change_user() the client sends the first packet. - we use the old scramble. - */ - pkt= (uchar*)mysql->scramble; - pkt_len= SCRAMBLE_LENGTH + 1; - } - else - { - /* read the scramble */ - if ((pkt_len= vio->read_packet(vio, &pkt)) < 0) - return CR_ERROR; - - if (pkt_len != SCRAMBLE_LENGTH + 1) - return CR_SERVER_HANDSHAKE_ERR; - - /* save it in MYSQL */ - memcpy(mysql->scramble, pkt, SCRAMBLE_LENGTH); - mysql->scramble[SCRAMBLE_LENGTH] = 0; - } - - if (mysql->passwd[0]) - { - char scrambled[SCRAMBLE_LENGTH + 1]; - scramble(scrambled, (char*)pkt, mysql->passwd); - if (vio->write_packet(vio, (uchar*)scrambled, SCRAMBLE_LENGTH)) - return CR_ERROR; - } - else - if (vio->write_packet(vio, 0, 0)) /* no password */ - return CR_ERROR; - - return CR_OK; -} - - -/** - client authentication plugin that does old MySQL authentication - using an 8-byte (4.0-) scramble -*/ - -static int old_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql) -{ - uchar *pkt; - int pkt_len; - - if (((MCPVIO_EXT *)vio)->mysql_change_user) - { - /* - in mysql_change_user() the client sends the first packet. - we use the old scramble. - */ - pkt= (uchar*)mysql->scramble; - pkt_len= SCRAMBLE_LENGTH_323 + 1; - } - else - { - /* read the scramble */ - if ((pkt_len= vio->read_packet(vio, &pkt)) < 0) - return CR_ERROR; - - if (pkt_len != SCRAMBLE_LENGTH_323 + 1 && - pkt_len != SCRAMBLE_LENGTH + 1) - return CR_SERVER_HANDSHAKE_ERR; - - /* save it in MYSQL */ - memcpy(mysql->scramble, pkt, pkt_len); - mysql->scramble[pkt_len] = 0; - } - - if (mysql->passwd[0]) - { - char scrambled[SCRAMBLE_LENGTH_323 + 1]; - scramble_323(scrambled, (char*)pkt, mysql->passwd); - if (vio->write_packet(vio, (uchar*)scrambled, SCRAMBLE_LENGTH_323 + 1)) - return CR_ERROR; - } - else - if (vio->write_packet(vio, 0, 0)) /* no password */ - return CR_ERROR; - - return CR_OK; -} - diff --git a/sql-common/my_time.c b/sql-common/my_time.c index f5ac64b2d80..d76ec58d623 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -1025,30 +1025,30 @@ void set_zero_time(MYSQL_TIME *tm, enum enum_mysql_timestamp_type time_type) int my_time_to_str(const MYSQL_TIME *l_time, char *to) { uint extra_hours= 0; - return my_sprintf(to, (to, "%s%02u:%02u:%02u", - (l_time->neg ? "-" : ""), - extra_hours+ l_time->hour, - l_time->minute, - l_time->second)); + return sprintf(to, "%s%02u:%02u:%02u", + (l_time->neg ? "-" : ""), + extra_hours+ l_time->hour, + l_time->minute, + l_time->second); } int my_date_to_str(const MYSQL_TIME *l_time, char *to) { - return my_sprintf(to, (to, "%04u-%02u-%02u", - l_time->year, - l_time->month, - l_time->day)); + return sprintf(to, "%04u-%02u-%02u", + l_time->year, + l_time->month, + l_time->day); } int my_datetime_to_str(const MYSQL_TIME *l_time, char *to) { - return my_sprintf(to, (to, "%04u-%02u-%02u %02u:%02u:%02u", - l_time->year, - l_time->month, - l_time->day, - l_time->hour, - l_time->minute, - l_time->second)); + return sprintf(to, "%04u-%02u-%02u %02u:%02u:%02u", + l_time->year, + l_time->month, + l_time->day, + l_time->hour, + l_time->minute, + l_time->second); } diff --git a/sql/field.cc b/sql/field.cc index e6caaf947b1..61786557531 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -10199,7 +10199,7 @@ Field::set_datetime_warning(MYSQL_ERROR::enum_warning_level level, uint code, { /* DBL_DIG is enough to print '-[digits].E+###' */ char str_nr[DBL_DIG + 8]; - uint str_len= my_sprintf(str_nr, (str_nr, "%g", nr)); + uint str_len= sprintf(str_nr, "%g", nr); make_truncated_value_warning(thd, level, str_nr, str_len, ts_type, field_name); } diff --git a/sql/filesort.cc b/sql/filesort.cc index a70f6cbd2ed..19eba8cc84d 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -30,6 +30,7 @@ #include <m_ctype.h> #include "sql_sort.h" #include "probes_mysql.h" +#include "sql_base.h" // update_virtual_fields #include "sql_test.h" // TEST_filesort #include "opt_range.h" // SQL_SELECT #include "log_slow.h" diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index b35a6cb7bf3..512152f1f57 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -1078,7 +1078,7 @@ static bool print_admin_msg(THD* thd, const char* msg_type, va_list args; Protocol *protocol= thd->protocol; uint length, msg_length; - char msgbuf[HA_MAX_MSG_BUF]; + char msgbuf[MYSQL_ERRMSG_SIZE]; char name[SAFE_NAME_LEN*2+2]; va_start(args, fmt); diff --git a/sql/handler.cc b/sql/handler.cc index 41bac077e3b..5b87420134c 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -28,6 +28,7 @@ #include "unireg.h" #include "rpl_handler.h" #include "sql_cache.h" // query_cache, query_cache_* +#include "sql_connect.h" // global_table_stats #include "key.h" // key_copy, key_unpack, key_cmp_if_same, key_cmp #include "sql_table.h" // build_table_filename #include "sql_parse.h" // check_stack_overrun diff --git a/sql/handler.h b/sql/handler.h index 8524ecfd695..979d66cdb1f 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -1118,7 +1118,7 @@ typedef struct st_ha_create_information { CHARSET_INFO *table_charset, *default_table_charset; LEX_STRING connect_string; - const char *password; + const char *password, *tablespace; LEX_STRING comment; const char *data_file_name, *index_file_name; const char *alias; @@ -1147,6 +1147,7 @@ typedef struct st_ha_create_information enum ha_choice transactional; bool frm_only; ///< 1 if no ha_create_table() bool varchar; ///< 1 if table has a VARCHAR + enum ha_storage_media storage_media; ///< DEFAULT, DISK or MEMORY enum ha_choice page_checksum; ///< If we have page_checksums engine_option_value *option_list; ///< list of table create options /* the following three are only for ALTER TABLE, check_if_incompatible_data() */ @@ -2555,14 +2556,16 @@ private: @remark The table is locked in exclusive mode. */ virtual int truncate() - { return HA_ERR_WRONG_COMMAND; } + { + int error= delete_all_rows(); + return error ? error : reset_auto_increment(0); + } /** Reset the auto-increment counter to the given value, i.e. the next row - inserted will get the given value. HA_ERR_WRONG_COMMAND is returned by - storage engines that don't support this operation. + inserted will get the given value. */ virtual int reset_auto_increment(ulonglong value) - { return HA_ERR_WRONG_COMMAND; } + { return 0; } virtual int optimize(THD* thd, HA_CHECK_OPT* check_opt) { return HA_ADMIN_NOT_IMPLEMENTED; } virtual int analyze(THD* thd, HA_CHECK_OPT* check_opt) diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index b0c2dac7b74..b421dddf815 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2042,7 +2042,7 @@ Item *Item_in_optimizer::transform(Item_transformer transformer, uchar *argument { Item *new_item; - DBUG_ASSERT(!current_thd->is_stmt_prepare()); + DBUG_ASSERT(!current_thd->stmt_arena->is_stmt_prepare()); DBUG_ASSERT(arg_count == 2); /* Transform the left IN operand. */ diff --git a/sql/item_create.cc b/sql/item_create.cc index d0f1ab54eca..bc3c904e5fd 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -1334,7 +1334,7 @@ protected: class Create_func_like_range_min : public Create_func_arg2 { public: - virtual Item *create(THD *thd, Item *arg1, Item *arg2); + virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); static Create_func_like_range_min s_singleton; @@ -1347,7 +1347,7 @@ protected: class Create_func_like_range_max : public Create_func_arg2 { public: - virtual Item *create(THD *thd, Item *arg1, Item *arg2); + virtual Item *create_2_arg(THD *thd, Item *arg1, Item *arg2); static Create_func_like_range_max s_singleton; @@ -3868,7 +3868,7 @@ Create_func_length::create_1_arg(THD *thd, Item *arg1) Create_func_like_range_min Create_func_like_range_min::s_singleton; Item* -Create_func_like_range_min::create(THD *thd, Item *arg1, Item *arg2) +Create_func_like_range_min::create_2_arg(THD *thd, Item *arg1, Item *arg2) { return new (thd->mem_root) Item_func_like_range_min(arg1, arg2); } @@ -3877,7 +3877,7 @@ Create_func_like_range_min::create(THD *thd, Item *arg1, Item *arg2) Create_func_like_range_max Create_func_like_range_max::s_singleton; Item* -Create_func_like_range_max::create(THD *thd, Item *arg1, Item *arg2) +Create_func_like_range_max::create_2_arg(THD *thd, Item *arg1, Item *arg2) { return new (thd->mem_root) Item_func_like_range_max(arg1, arg2); } diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index d7cd2d459f4..5aa4db219e8 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -776,13 +776,12 @@ bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time, str->append(hours_i < 12 ? "AM" : "PM",2); break; case 'r': - length= my_sprintf(intbuff, - (intbuff, + length= sprintf(intbuff, ((l_time->hour % 24) < 12) ? "%02d:%02d:%02d AM" : "%02d:%02d:%02d PM", (l_time->hour+11)%12+1, l_time->minute, - l_time->second)); + l_time->second); str->append(intbuff, length); break; case 'S': @@ -791,12 +790,11 @@ bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time, str->append_with_prefill(intbuff, length, 2, '0'); break; case 'T': - length= my_sprintf(intbuff, - (intbuff, + length= sprintf(intbuff, "%02d:%02d:%02d", l_time->hour, l_time->minute, - l_time->second)); + l_time->second); str->append(intbuff, length); break; case 'U': @@ -3135,8 +3133,7 @@ String *Item_func_maketime::val_str(String *str) ltime.second= TIME_MAX_SECOND; char buf[28]; char *ptr= longlong10_to_str(hour, buf, args[0]->unsigned_flag ? 10 : -10); - int len = (int)(ptr - buf) + - my_sprintf(ptr, (ptr, ":%02u:%02u", (uint)minute, (uint)second)); + int len = (int)(ptr - buf) + sprintf(ptr, ":%02u:%02u", (uint)minute, (uint)second); make_truncated_value_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, buf, len, MYSQL_TIMESTAMP_TIME, NullS); diff --git a/sql/log_event.cc b/sql/log_event.cc index c5935b86df9..70087ed4da3 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1661,11 +1661,11 @@ log_event_print_value(IO_CACHE *file, const uchar *ptr, int i, end; char buff[512], *pos; pos= buff; - pos+= my_sprintf(buff, (buff, "%s", dec.sign() ? "-" : "")); + pos+= sprintf(buff, "%s", dec.sign() ? "-" : ""); end= ROUND_UP(dec.frac) + ROUND_UP(dec.intg)-1; for (i=0; i < end; i++) - pos+= my_sprintf(pos, (pos, "%09d.", dec.buf[i])); - pos+= my_sprintf(pos, (pos, "%09d", dec.buf[i])); + pos+= sprintf(pos, "%09d.", dec.buf[i]); + pos+= sprintf(pos, "%09d", dec.buf[i]); my_b_printf(file, "%s", buff); my_snprintf(typestr, typestr_length, "DECIMAL(%d,%d)", precision, decimals); @@ -6588,9 +6588,7 @@ void Append_block_log_event::pack_info(Protocol *protocol) { char buf[256]; uint length; - length= (uint) my_sprintf(buf, - (buf, ";file_id=%u;block_len=%u", file_id, - block_len)); + length= (uint) sprintf(buf, ";file_id=%u;block_len=%u", file_id, block_len); protocol->store(buf, length, &my_charset_bin); } @@ -6746,7 +6744,7 @@ void Delete_file_log_event::pack_info(Protocol *protocol) { char buf[64]; uint length; - length= (uint) my_sprintf(buf, (buf, ";file_id=%u", (uint) file_id)); + length= (uint) sprintf(buf, ";file_id=%u", (uint) file_id); protocol->store(buf, (int32) length, &my_charset_bin); } #endif @@ -6844,7 +6842,7 @@ void Execute_load_log_event::pack_info(Protocol *protocol) { char buf[64]; uint length; - length= (uint) my_sprintf(buf, (buf, ";file_id=%u", (uint) file_id)); + length= (uint) sprintf(buf, ";file_id=%u", (uint) file_id); protocol->store(buf, (int32) length, &my_charset_bin); } diff --git a/sql/log_event.h b/sql/log_event.h index e57115432ec..3a54702c2d1 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -2194,8 +2194,6 @@ public: /* !!! Public in this patch to allow old usage */ #endif }; -extern char server_version[SERVER_VERSION_LENGTH]; - /** @class Start_log_event_v3 diff --git a/sql/multi_range_read.cc b/sql/multi_range_read.cc index e539f30d978..b338bc147bc 100644 --- a/sql/multi_range_read.cc +++ b/sql/multi_range_read.cc @@ -356,7 +356,7 @@ int DsMrr_impl::dsmrr_init(handler *h_arg, RANGE_SEQ_IF *seq_funcs, uint mrr_keyno= h->active_index; /* Create a separate handler object to do rndpos() calls. */ - if (!(new_h2= h->clone(thd->mem_root)) || + if (!(new_h2= h->clone(h->table->s->normalized_path.str, thd->mem_root)) || new_h2->ha_external_lock(thd, F_RDLCK)) { delete new_h2; diff --git a/sql/my_decimal.cc b/sql/my_decimal.cc index 318cdfd10c4..16449da701f 100644 --- a/sql/my_decimal.cc +++ b/sql/my_decimal.cc @@ -307,12 +307,12 @@ print_decimal(const my_decimal *dec) int i, end; char buff[512], *pos; pos= buff; - pos+= my_sprintf(buff, (buff, "Decimal: sign: %d intg: %d frac: %d { ", - dec->sign(), dec->intg, dec->frac)); + pos+= sprintf(buff, "Decimal: sign: %d intg: %d frac: %d { ", + dec->sign(), dec->intg, dec->frac); end= ROUND_UP(dec->frac)+ROUND_UP(dec->intg)-1; for (i=0; i < end; i++) - pos+= my_sprintf(pos, (pos, "%09d, ", dec->buf[i])); - pos+= my_sprintf(pos, (pos, "%09d }\n", dec->buf[i])); + pos+= sprintf(pos, "%09d, ", dec->buf[i]); + pos+= sprintf(pos, "%09d }\n", dec->buf[i]); fputs(buff, DBUG_FILE); } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 61f6c55bbdf..49912b6fa9e 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -927,7 +927,9 @@ my_bool opt_use_ssl = 0; char *opt_ssl_ca= NULL, *opt_ssl_capath= NULL, *opt_ssl_cert= NULL, *opt_ssl_cipher= NULL, *opt_ssl_key= NULL; -scheduler_functions thread_scheduler, extra_thread_scheduler; +static scheduler_functions thread_scheduler_struct, extra_thread_scheduler_struct; +scheduler_functions *thread_scheduler= &thread_scheduler_struct, + *extra_thread_scheduler= &extra_thread_scheduler_struct; #ifdef HAVE_OPENSSL #include <openssl/crypto.h> @@ -1119,7 +1121,7 @@ static void close_connections(void) continue; tmp->killed= THD::KILL_CONNECTION; - MYSQL_CALLBACK(&thread_scheduler, post_kill_notification, (tmp)); + MYSQL_CALLBACK(thread_scheduler, post_kill_notification, (tmp)); mysql_mutex_lock(&tmp->LOCK_thd_data); if (tmp->mysys_var) { @@ -1544,7 +1546,7 @@ void clean_up(bool print_message) if (print_message && my_default_lc_messages && server_start_time) sql_print_information(ER_DEFAULT(ER_SHUTDOWN_COMPLETE),my_progname); cleanup_errmsgs(); - MYSQL_CALLBACK(&thread_scheduler, end, ()); + MYSQL_CALLBACK(thread_scheduler, end, ()); mysql_library_end(); finish_client_errs(); (void) my_error_unregister(ER_ERROR_FIRST, ER_ERROR_LAST); // finish server errs @@ -1585,7 +1587,10 @@ static void wait_for_signal_thread_to_end() for (i= 0 ; i < 100 && signal_thread_in_use; i++) { if (pthread_kill(signal_thread, MYSQL_KILL_SIGNAL) != ESRCH) + { + fprintf(stderr, "signal thread appears to be dead\n"); break; + } my_sleep(100); // Give it time to die } } @@ -1950,7 +1955,7 @@ static void network_init(void) int arg; DBUG_ENTER("network_init"); - if (MYSQL_CALLBACK_ELSE(&thread_scheduler, init, (), 0)) + if (MYSQL_CALLBACK_ELSE(thread_scheduler, init, (), 0)) unireg_abort(1); /* purecov: inspected */ set_ports(); @@ -2125,7 +2130,7 @@ void thd_cleanup(THD *thd) dec_connection_count() */ -void dec_connection_count() +void dec_connection_count(THD *thd) { mysql_mutex_lock(&LOCK_connection_count); (*thd->scheduler->connection_count)--; @@ -2165,7 +2170,7 @@ void unlink_thd(THD *thd) DBUG_PRINT("enter", ("thd: 0x%lx", (long) thd)); thd_cleanup(thd); - dec_connection_count(); + dec_connection_count(thd); mysql_mutex_lock(&LOCK_thread_count); /* Used by binlog_reset_master. It would be cleaner to use @@ -2545,7 +2550,7 @@ and this may fail.\n\n"); (ulong) dflt_key_cache->key_cache_mem_size); fprintf(stderr, "read_buffer_size=%ld\n", (long) global_system_variables.read_buff_size); fprintf(stderr, "max_used_connections=%lu\n", max_used_connections); - fprintf(stderr, "max_threads=%u\n", thread_scheduler.max_threads + + fprintf(stderr, "max_threads=%u\n", thread_scheduler->max_threads + (uint) extra_max_connections); fprintf(stderr, "thread_count=%u\n", thread_count); fprintf(stderr, "It is possible that mysqld could use up to \n\ @@ -2553,7 +2558,7 @@ key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = %lu K\n\ bytes of memory\n", ((ulong) dflt_key_cache->key_cache_mem_size + (global_system_variables.read_buff_size + global_system_variables.sortbuff_size) * - (thread_scheduler.max_threads + extra_max_connections) + + (thread_scheduler->max_threads + extra_max_connections) + (max_connections + extra_max_connections)* sizeof(THD)) / 1024); fprintf(stderr, "Hope that's ok; if not, decrease some variables in the equation.\n\n"); @@ -2805,7 +2810,7 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused))) This should actually be '+ max_number_of_slaves' instead of +10, but the +10 should be quite safe. */ - init_thr_alarm(thread_scheduler.max_threads + extra_max_connections + + init_thr_alarm(thread_scheduler->max_threads + extra_max_connections + global_system_variables.max_insert_delayed_threads + 10); if (test_flags & TEST_SIGINT) { @@ -2855,8 +2860,8 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused))) { DBUG_PRINT("quit",("signal_handler: calling my_thread_end()")); my_thread_end(); - signal_thread_in_use= 0; DBUG_LEAVE; // Must match DBUG_ENTER() + signal_thread_in_use= 0; pthread_exit(0); // Safety return 0; // Avoid compiler warnings } @@ -5499,7 +5504,7 @@ void handle_connections_sockets() if (sock == extra_ip_sock) { thd->extra_port= 1; - thd->scheduler= &extra_thread_scheduler; + thd->scheduler= extra_thread_scheduler; } create_new_thread(thd); } @@ -7637,17 +7642,17 @@ static int get_options(int *argc_ptr, char ***argv_ptr) return 1; #ifdef EMBEDDED_LIBRARY - one_thread_scheduler(&thread_scheduler); - one_thread_scheduler(&extra_thread_scheduler); + one_thread_scheduler(thread_scheduler); + one_thread_scheduler(extra_thread_scheduler); #else if (thread_handling <= SCHEDULER_ONE_THREAD_PER_CONNECTION) - one_thread_per_connection_scheduler(&thread_scheduler, &max_connections, + one_thread_per_connection_scheduler(thread_scheduler, &max_connections, &connection_count); else if (thread_handling == SCHEDULER_NO_THREADS) - one_thread_scheduler(&thread_scheduler); + one_thread_scheduler(thread_scheduler); else - pool_of_threads_scheduler(&thread_scheduler); /* purecov: tested */ - one_thread_per_connection_scheduler(&extra_thread_scheduler, + pool_of_threads_scheduler(thread_scheduler); /* purecov: tested */ + one_thread_per_connection_scheduler(extra_thread_scheduler, &extra_max_connections, &extra_connection_count); #endif diff --git a/sql/mysqld.h b/sql/mysqld.h index 4ede06f09a6..c23745d9d38 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -349,6 +349,7 @@ extern char *opt_ssl_ca, *opt_ssl_capath, *opt_ssl_cert, *opt_ssl_cipher, extern MYSQL_PLUGIN_IMPORT pthread_key(THD*, THR_THD); #ifdef MYSQL_SERVER + /** only options that need special treatment in get_one_option() deserve to be listed below @@ -527,5 +528,5 @@ extern uint mysqld_extra_port; extern ulong extra_max_connections; extern ulonglong denied_connections; extern ulong thread_created; -extern scheduler_functions thread_scheduler, extra_thread_scheduler; +extern scheduler_functions *thread_scheduler, *extra_thread_scheduler; #endif /* MYSQLD_INCLUDED */ diff --git a/sql/net_serv.cc b/sql/net_serv.cc index 974bc122d14..c8a839571ee 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -51,6 +51,22 @@ #define MYSQL_CLIENT #endif /*EMBEDDED_LIBRARY */ +/* + to reduce the number of ifdef's in the code +*/ +#ifdef EXTRA_DEBUG +#define EXTRA_DEBUG_fprintf fprintf +#define EXTRA_DEBUG_fflush fflush +#else +static void inline EXTRA_DEBUG_fprintf(...) {} +static int EXTRA_DEBUG_fflush(...) {} +#endif +#ifdef MYSQL_SERVER +#define MYSQL_SERVER_my_error my_error +#else +static void inline MYSQL_SERVER_my_error(...) {} +#endif + /* The following handles the differences when this is linked between the @@ -164,9 +180,7 @@ my_bool net_realloc(NET *net, size_t length) /* @todo: 1 and 2 codes are identical. */ net->error= 1; net->last_errno= ER_NET_PACKET_TOO_LARGE; -#ifdef MYSQL_SERVER - my_error(ER_NET_PACKET_TOO_LARGE, MYF(0)); -#endif + MYSQL_SERVER_my_error(ER_NET_PACKET_TOO_LARGE, MYF(0)); DBUG_RETURN(1); } pkt_length = (length+IO_SIZE-1) & ~(IO_SIZE-1); @@ -288,10 +302,8 @@ void net_clear(NET *net, my_bool clear_buffer __attribute__((unused))) { DBUG_PRINT("info",("skipped %ld bytes from file: %s", (long) count, vio_description(net->vio))); -#if defined(EXTRA_DEBUG) - fprintf(stderr,"Note: net_clear() skipped %ld bytes from file: %s\n", + EXTRA_DEBUG_fprintf(stderr,"Note: net_clear() skipped %ld bytes from file: %s\n", (long) count, vio_description(net->vio)); -#endif } else { @@ -640,16 +652,12 @@ net_real_write(NET *net,const uchar *packet, size_t len) { if (vio_should_retry(net->vio) && retry_count++ < net->retry_count) continue; -#ifdef EXTRA_DEBUG - fprintf(stderr, + EXTRA_DEBUG_fprintf(stderr, "%s: my_net_write: fcntl returned error %d, aborting thread\n", my_progname,vio_errno(net->vio)); -#endif /* EXTRA_DEBUG */ net->error= 2; /* Close socket */ net->last_errno= ER_NET_PACKET_TOO_LARGE; -#ifdef MYSQL_SERVER - my_error(ER_NET_PACKET_TOO_LARGE, MYF(0)); -#endif + MYSQL_SERVER_my_error(ER_NET_PACKET_TOO_LARGE, MYF(0)); goto end; } retry_count=0; @@ -663,24 +671,20 @@ net_real_write(NET *net,const uchar *packet, size_t len) { if (retry_count++ < net->retry_count) continue; -#ifdef EXTRA_DEBUG - fprintf(stderr, "%s: write looped, aborting thread\n", + EXTRA_DEBUG_fprintf(stderr, "%s: write looped, aborting thread\n", my_progname); -#endif /* EXTRA_DEBUG */ } -#if defined(THREAD_SAFE_CLIENT) && !defined(MYSQL_SERVER) +#ifndef MYSQL_SERVER if (vio_errno(net->vio) == SOCKET_EINTR) { DBUG_PRINT("warning",("Interrupted write. Retrying...")); continue; } -#endif /* defined(THREAD_SAFE_CLIENT) && !defined(MYSQL_SERVER) */ +#endif /* !defined(MYSQL_SERVER) */ net->error= 2; /* Close socket */ net->last_errno= (interrupted ? ER_NET_WRITE_INTERRUPTED : ER_NET_ERROR_ON_WRITE); -#ifdef MYSQL_SERVER - my_error(net->last_errno, MYF(0)); -#endif /* MYSQL_SERVER */ + MYSQL_SERVER_my_error(net->last_errno, MYF(0)); break; } pos+=length; @@ -840,7 +844,7 @@ my_real_read(NET *net, size_t *complen) #if !defined(__WIN__) || defined(MYSQL_SERVER) /* We got an error that there was no data on the socket. We now set up - an alarm to not 'read forever', change the socket to non blocking + an alarm to not 'read forever', change the socket to the blocking mode and try again */ if ((interrupted || length == 0) && !thr_alarm_in_use(&alarmed)) @@ -856,17 +860,13 @@ my_real_read(NET *net, size_t *complen) DBUG_PRINT("error", ("fcntl returned error %d, aborting thread", vio_errno(net->vio))); -#ifdef EXTRA_DEBUG - fprintf(stderr, + EXTRA_DEBUG_fprintf(stderr, "%s: read: fcntl returned error %d, aborting thread\n", my_progname,vio_errno(net->vio)); -#endif /* EXTRA_DEBUG */ len= packet_error; net->error= 2; /* Close socket */ net->last_errno= ER_NET_FCNTL_ERROR; -#ifdef MYSQL_SERVER - my_error(ER_NET_FCNTL_ERROR, MYF(0)); -#endif + MYSQL_SERVER_my_error(ER_NET_FCNTL_ERROR, MYF(0)); goto end; } retry_count=0; @@ -879,12 +879,10 @@ my_real_read(NET *net, size_t *complen) { /* Probably in MIT threads */ if (retry_count++ < net->retry_count) continue; -#ifdef EXTRA_DEBUG - fprintf(stderr, "%s: read looped with error %d, aborting thread\n", + EXTRA_DEBUG_fprintf(stderr, "%s: read looped with error %d, aborting thread\n", my_progname,vio_errno(net->vio)); -#endif /* EXTRA_DEBUG */ } -#if defined(THREAD_SAFE_CLIENT) && !defined(MYSQL_SERVER) +#ifndef MYSQL_SERVER if (vio_errno(net->vio) == SOCKET_EINTR) { DBUG_PRINT("warning",("Interrupted read. Retrying...")); @@ -898,9 +896,7 @@ my_real_read(NET *net, size_t *complen) net->last_errno= (vio_was_interrupted(net->vio) ? ER_NET_READ_INTERRUPTED : ER_NET_READ_ERROR); -#ifdef MYSQL_SERVER - my_error(net->last_errno, MYF(0)); -#endif + MYSQL_SERVER_my_error(net->last_errno, MYF(0)); goto end; } remain -= (uint32) length; @@ -926,19 +922,17 @@ my_real_read(NET *net, size_t *complen) the server expects the client to send a file, but the client may reply with a new command instead. */ -#if defined (EXTRA_DEBUG) && !defined (MYSQL_SERVER) - fflush(stdout); - fprintf(stderr,"Error: Packets out of order (Found: %d, expected %d)\n", +#ifndef MYSQL_SERVER + EXTRA_DEBUG_fflush(stdout); + EXTRA_DEBUG_fprintf(stderr,"Error: Packets out of order (Found: %d, expected %d)\n", (int) net->buff[net->where_b + 3], (uint) (uchar) net->pkt_nr); - fflush(stderr); + EXTRA_DEBUG_fflush(stderr); #endif } len= packet_error; /* Not a NET error on the client. XXX: why? */ -#ifdef MYSQL_SERVER - my_error(ER_NET_PACKETS_OUT_OF_ORDER, MYF(0)); -#endif + MYSQL_SERVER_my_error(ER_NET_PACKETS_OUT_OF_ORDER, MYF(0)); goto end; } net->compress_pkt_nr= ++net->pkt_nr; @@ -1138,9 +1132,7 @@ my_net_read(NET *net) { net->error= 2; /* caller will close socket */ net->last_errno= ER_NET_UNCOMPRESS_ERROR; -#ifdef MYSQL_SERVER - my_error(ER_NET_UNCOMPRESS_ERROR, MYF(0)); -#endif + MYSQL_SERVER_my_error(ER_NET_UNCOMPRESS_ERROR, MYF(0)); MYSQL_NET_READ_DONE(1, 0); return packet_error; } diff --git a/sql/protocol.cc b/sql/protocol.cc index 0c68df91121..c5937cee807 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -1137,16 +1137,16 @@ bool Protocol_text::store(MYSQL_TIME *tm) #endif char buff[40]; uint length; - length= my_sprintf(buff,(buff, "%04d-%02d-%02d %02d:%02d:%02d", - (int) tm->year, - (int) tm->month, - (int) tm->day, - (int) tm->hour, - (int) tm->minute, - (int) tm->second)); + length= sprintf(buff, "%04d-%02d-%02d %02d:%02d:%02d", + (int) tm->year, + (int) tm->month, + (int) tm->day, + (int) tm->hour, + (int) tm->minute, + (int) tm->second); if (tm->second_part) - length+= my_sprintf(buff+length,(buff+length, ".%06d", - (int)tm->second_part)); + length+= sprintf(buff+length, ".%06d", + (int)tm->second_part); return net_store_data((uchar*) buff, length); } @@ -1180,13 +1180,13 @@ bool Protocol_text::store_time(MYSQL_TIME *tm) char buff[40]; uint length; uint day= (tm->year || tm->month) ? 0 : tm->day; - length= my_sprintf(buff,(buff, "%s%02ld:%02d:%02d", - tm->neg ? "-" : "", - (long) day*24L+(long) tm->hour, - (int) tm->minute, - (int) tm->second)); + length= sprintf(buff, "%s%02ld:%02d:%02d", + tm->neg ? "-" : "", + (long) day*24L+(long) tm->hour, + (int) tm->minute, + (int) tm->second); if (tm->second_part) - length+= my_sprintf(buff+length,(buff+length, ".%06d", (int)tm->second_part)); + length+= sprintf(buff+length, ".%06d", (int)tm->second_part); return net_store_data((uchar*) buff, length); } diff --git a/sql/rpl_filter.cc b/sql/rpl_filter.cc index 1f0b752c8c8..a8ed9cfffe0 100644 --- a/sql/rpl_filter.cc +++ b/sql/rpl_filter.cc @@ -14,7 +14,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "sql_priv.h" -//#include "unireg.h" // REQUIRED by other includes +#include "mysqld.h" // system_charset_info #include "rpl_filter.h" #include "hash.h" // my_hash_free #include "table.h" // TABLE_LIST diff --git a/sql/scheduler.cc b/sql/scheduler.cc index b1083083c38..df1fc68dddc 100644 --- a/sql/scheduler.cc +++ b/sql/scheduler.cc @@ -21,13 +21,11 @@ #pragma implementation #endif -#include <sql_priv.h> -#include "unireg.h" // REQUIRED: for other includes -#include "scheduler.h" #include "sql_connect.h" // init_new_connection_handler_thread #include "scheduler.h" +#include "mysqld.h" +#include "sql_class.h" #include "sql_callback.h" -#include "sql_audit.h" /* End connection, in case when we are using 'no-threads' @@ -51,7 +49,7 @@ extern "C" static void scheduler_wait_lock_begin(void) { THD *thd=current_thd; scheduler_functions *func= thd->scheduler; - MYSQL_CALLBACK(func, thd_wait_begin, (thd, THD_WAIT_ROW_TABLE_LOCK)); + MYSQL_CALLBACK(func, thd_wait_begin, (thd, THD_WAIT_TABLE_LOCK)); } static void scheduler_wait_lock_end(void) { diff --git a/sql/scheduler.h b/sql/scheduler.h index 247c98515ac..7c9cafd8a71 100644 --- a/sql/scheduler.h +++ b/sql/scheduler.h @@ -24,6 +24,8 @@ #pragma interface #endif +#include <my_global.h> + class THD; /* Functions used when manipulating threads */ @@ -119,11 +121,4 @@ class thd_scheduler #endif -void *thd_get_scheduler_data(THD *thd); -void thd_set_scheduler_data(THD *thd, void *data); -PSI_thread* thd_get_psi(THD *thd); -void thd_set_psi(THD *thd, PSI_thread *psi); - -extern scheduler_functions *thread_scheduler; - #endif diff --git a/sql/sp.cc b/sql/sp.cc index 283db3539c9..982dc3dc91b 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -1400,6 +1400,7 @@ bool lock_db_routines(THD *thd, char *db) Open_tables_backup open_tables_state_backup; MDL_request_list mdl_requests; Lock_db_routines_error_handler err_handler; + uchar keybuf[MAX_KEY_LENGTH]; DBUG_ENTER("lock_db_routines"); /* @@ -1422,11 +1423,11 @@ bool lock_db_routines(THD *thd, char *db) table->field[MYSQL_PROC_FIELD_DB]->store(db, strlen(db), system_charset_info); key_len= table->key_info->key_part[0].store_length; + table->field[MYSQL_PROC_FIELD_DB]->get_key_image(keybuf, key_len, Field::itRAW); table->file->ha_index_init(0, 1); - if (! table->file->index_read_map(table->record[0], - table->field[MYSQL_PROC_FIELD_DB]->ptr, - (key_part_map)1, HA_READ_KEY_EXACT)) + if (! table->file->ha_index_read_map(table->record[0], keybuf, (key_part_map)1, + HA_READ_KEY_EXACT)) { do { @@ -1438,9 +1439,7 @@ bool lock_db_routines(THD *thd, char *db) MDL_key::FUNCTION : MDL_key::PROCEDURE, db, sp_name, MDL_EXCLUSIVE, MDL_TRANSACTION); mdl_requests.push_front(mdl_request); - } while (! (nxtres= table->file->index_next_same(table->record[0], - table->field[MYSQL_PROC_FIELD_DB]->ptr, - key_len))); + } while (! (nxtres= table->file->ha_index_next_same(table->record[0], keybuf, key_len))); } table->file->ha_index_end(); if (nxtres != 0 && nxtres != HA_ERR_END_OF_FILE) @@ -1487,8 +1486,6 @@ sp_drop_db_routines(THD *thd, char *db) key_len= table->key_info->key_part[0].store_length; table->field[MYSQL_PROC_FIELD_DB]->get_key_image(keybuf, key_len, Field::itRAW); - - ret= SP_OK; table->file->ha_index_init(0, 1); if (!table->file->ha_index_read_map(table->record[0], keybuf, (key_part_map)1, diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 77c467b7dcf..c800f4c6bac 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -611,6 +611,7 @@ static char *fix_plugin_ptr(char *name) */ static bool fix_user_plugin_ptr(ACL_USER *user) { + user->salt_len= 0; if (my_strcasecmp(system_charset_info, user->plugin.str, native_password_plugin_name.str) == 0) user->plugin= native_password_plugin_name; @@ -706,13 +707,6 @@ set_user_plugin (ACL_USER *user, int password_len) case SCRAMBLED_PASSWORD_CHAR_LENGTH_323: user->plugin= old_password_plugin_name; return FALSE; - case 45: /* 4.1: to be removed */ - sql_print_warning("Found 4.1.0 style password for user '%s@%s'. " - "Ignoring user. " - "You should change password for this user.", - user->user ? user->user : "", - user->host.hostname ? user->host.hostname : ""); - return TRUE; default: sql_print_warning("Found invalid password for user: '%s@%s'; " "Ignoring user", user->user ? user->user : "", @@ -1468,15 +1462,14 @@ static void acl_update_user(const char *user, const char *host, if (fix_user_plugin_ptr(acl_user)) acl_user->plugin.str= strmake_root(&mem, plugin->str, plugin->length); } -#if 0 else - if (password) + if (password[0]) { acl_user->auth_string.str= strmake_root(&mem, password, password_len); acl_user->auth_string.length= password_len; set_user_salt(acl_user, password, password_len); + set_user_plugin(acl_user, password_len); } -#endif acl_user->access=privileges; if (mqh->specified_limits & USER_RESOURCES::QUERIES_PER_HOUR) acl_user->user_resource.questions=mqh->questions; @@ -1496,8 +1489,6 @@ static void acl_update_user(const char *user, const char *host, acl_user->x509_subject= (x509_subject ? strdup_root(&mem,x509_subject) : 0); } - if (password) - set_user_salt(acl_user, password, password_len); /* search complete: */ break; } @@ -1534,10 +1525,10 @@ static void acl_insert_user(const char *user, const char *host, } else { - acl_user.plugin= password_len == SCRAMBLED_PASSWORD_CHAR_LENGTH_323 ? - old_password_plugin_name : native_password_plugin_name; acl_user.auth_string.str= strmake_root(&mem, password, password_len); acl_user.auth_string.length= password_len; + set_user_salt(&acl_user, password, password_len); + set_user_plugin(&acl_user, password_len); } acl_user.access=privileges; @@ -1550,8 +1541,6 @@ static void acl_insert_user(const char *user, const char *host, acl_user.x509_issuer= x509_issuer ? strdup_root(&mem,x509_issuer) : 0; acl_user.x509_subject=x509_subject ? strdup_root(&mem,x509_subject) : 0; - set_user_salt(&acl_user, password, password_len); - (void) push_dynamic(&acl_users,(uchar*) &acl_user); if (!acl_user.host.hostname || (acl_user.host.hostname[0] == wild_many && !acl_user.host.hostname[1])) @@ -1965,11 +1954,10 @@ bool change_password(THD *thd, const char *host, const char *user, if (mysql_bin_log.is_open()) { query_length= - my_sprintf(buff, - (buff,"SET PASSWORD FOR '%-.120s'@'%-.120s'='%-.120s'", - acl_user->user ? acl_user->user : "", - acl_user->host.hostname ? acl_user->host.hostname : "", - new_password)); + sprintf(buff,"SET PASSWORD FOR '%-.120s'@'%-.120s'='%-.120s'", + acl_user->user ? acl_user->user : "", + acl_user->host.hostname ? acl_user->host.hostname : "", + new_password); thd->clear_error(); result= thd->binlog_query(THD::STMT_QUERY_TYPE, buff, query_length, FALSE, FALSE, FALSE, 0); @@ -2272,14 +2260,12 @@ static bool test_if_create_new_users(THD *thd) Handle GRANT commands ****************************************************************************/ -static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, +static int replace_user_table(THD *thd, TABLE *table, LEX_USER &combo, ulong rights, bool revoke_grant, bool can_create_user, bool no_auto_create) { int error = -1; bool old_row_exists=0; - const char *password= ""; - uint password_len= 0; char what= (revoke_grant) ? 'N' : 'Y'; uchar user_key[MAX_KEY_LENGTH]; LEX *lex= thd->lex; @@ -2295,9 +2281,9 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, my_error(ER_PASSWD_LENGTH, MYF(0), SCRAMBLED_PASSWORD_CHAR_LENGTH); DBUG_RETURN(-1); } - password_len= combo.password.length; - password=combo.password.str; } + else + combo.password= empty_lex_str; table->use_all_columns(); table->field[0]->store(combo.host.str,combo.host.length, @@ -2330,7 +2316,7 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, see also test_if_create_new_users() */ - else if (!password_len && !combo.plugin.length && no_auto_create) + else if (!combo.password.length && !combo.plugin.length && no_auto_create) { my_error(ER_PASSWORD_NO_MATCH, MYF(0)); goto end; @@ -2355,30 +2341,11 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, system_charset_info); table->field[1]->store(combo.user.str,combo.user.length, system_charset_info); - table->field[2]->store(password, password_len, - system_charset_info); } else { old_row_exists = 1; store_record(table,record[1]); // Save copy for update -#if 0 - /* what == 'N' means revoke */ - if (combo.plugin.length && what != 'N') - { - my_error(ER_GRANT_PLUGIN_USER_EXISTS, MYF(0), - static_cast<int>(combo.user.length), combo.user.str); - goto end; - } -#endif - if (combo.password.str) // If password given - table->field[2]->store(password, password_len, system_charset_info); - else if (!rights && !revoke_grant && - lex->ssl_type == SSL_TYPE_NOT_SPECIFIED && - !lex->mqh.specified_limits) - { - DBUG_RETURN(0); - } } /* Update table columns with new privileges */ @@ -2396,6 +2363,8 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, } rights= get_access(table, 3, &next_field); DBUG_PRINT("info",("table fields: %d",table->s->fields)); + if (combo.password.str[0]) + table->field[2]->store(combo.password.str, combo.password.length, system_charset_info); if (table->s->fields >= 31) /* From 4.0.0 we have more fields */ { /* We write down SSL related ACL stuff */ @@ -2454,14 +2423,25 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, mqh_used= mqh_used || mqh.questions || mqh.updates || mqh.conn_per_hour; next_field+= 4; - if (table->s->fields >= 41 && combo.plugin.str[0]) + if (table->s->fields >= 41) { - table->field[next_field]->store(combo.plugin.str, combo.plugin.length, - system_charset_info); table->field[next_field]->set_notnull(); - table->field[next_field + 1]->store(combo.auth.str, combo.auth.length, - system_charset_info); table->field[next_field + 1]->set_notnull(); + if (combo.plugin.str[0]) + { + DBUG_ASSERT(combo.password.str[0] == 0); + table->field[2]->reset(); + table->field[next_field]->store(combo.plugin.str, combo.plugin.length, + system_charset_info); + table->field[next_field + 1]->store(combo.auth.str, combo.auth.length, + system_charset_info); + } + if (combo.password.str[0]) + { + DBUG_ASSERT(combo.plugin.str[0] == 0); + table->field[next_field]->reset(); + table->field[next_field + 1]->reset(); + } } } @@ -2502,7 +2482,7 @@ end: acl_cache->clear(1); // Clear privilege cache if (old_row_exists) acl_update_user(combo.user.str, combo.host.str, - combo.password.str, password_len, + combo.password.str, combo.password.length, lex->ssl_type, lex->ssl_cipher, lex->x509_issuer, @@ -2512,7 +2492,8 @@ end: &combo.plugin, &combo.auth); else - acl_insert_user(combo.user.str, combo.host.str, password, password_len, + acl_insert_user(combo.user.str, combo.host.str, + combo.password.str, combo.password.length, lex->ssl_type, lex->ssl_cipher, lex->x509_issuer, @@ -2714,9 +2695,9 @@ replace_proxies_priv_table(THD *thd, TABLE *table, const LEX_USER *user, get_grantor(thd, grantor); table->file->ha_index_init(0, 1); - if (table->file->index_read_map(table->record[0], user_key, - HA_WHOLE_KEY, - HA_READ_KEY_EXACT)) + if (table->file->ha_index_read_map(table->record[0], user_key, + HA_WHOLE_KEY, + HA_READ_KEY_EXACT)) { DBUG_PRINT ("info", ("Row not found")); if (revoke_grant) @@ -7909,7 +7890,7 @@ struct MPVIO_EXT :public MYSQL_PLUGIN_VIO { MYSQL_SERVER_AUTH_INFO auth_info; THD *thd; - const ACL_USER *acl_user; ///< a copy, independent from acl_users array + ACL_USER *acl_user; ///< a copy, independent from acl_users array plugin_ref plugin; ///< what plugin we're under LEX_STRING db; ///< db name from the handshake packet /** when restarting a plugin this caches the last client reply */ @@ -8140,8 +8121,6 @@ static bool send_plugin_request_packet(MPVIO_EXT *mpvio, ((st_mysql_auth *) (plugin_decl(mpvio->plugin)->info))->client_auth_plugin; DBUG_ASSERT(client_auth_plugin); - DBUG_ASSERT(my_strcasecmp(system_charset_info, client_auth_plugin, - mpvio->cached_client_reply.plugin)); /* we send an old "short 4.0 scramble request", if we need to request a @@ -8238,7 +8217,7 @@ static bool find_mpvio_user(MPVIO_EXT *mpvio) } mpvio->auth_info.user_name= sctx->user; - mpvio->auth_info.user_name_length= user_len; + mpvio->auth_info.user_name_length= strlen(sctx->user); mpvio->auth_info.auth_string= mpvio->acl_user->auth_string.str; mpvio->auth_info.auth_string_length= (unsigned long) mpvio->acl_user->auth_string.length; @@ -8424,7 +8403,7 @@ static ulong parse_client_handshake_packet(MPVIO_EXT *mpvio, } else { - mpvio->max_client_packet_length= uint3korr(net->read_pos + 2); + thd->max_client_packet_length= uint3korr(net->read_pos + 2); end= (char*) net->read_pos + 5; } @@ -8757,7 +8736,7 @@ static int server_mpvio_read_packet(MYSQL_PLUGIN_VIO *param, uchar **buf) err: if (mpvio->status == MPVIO_EXT::FAILURE) { - inc_host_errors(mpvio->thd->security_ctx.ip); + inc_host_errors(mpvio->thd->security_ctx->ip); if (!mpvio->thd->is_error()) my_error(ER_HANDSHAKE_ERROR, MYF(0)); } @@ -8964,6 +8943,9 @@ bool acl_authenticate(THD *thd, uint connect_errors, mpvio.thd= thd; mpvio.connect_errors= connect_errors; mpvio.status= MPVIO_EXT::FAILURE; + mpvio.auth_info.host_or_ip= thd->security_ctx->host_or_ip; + mpvio.auth_info.host_or_ip_length= + (unsigned int) strlen(thd->security_ctx->host_or_ip); DBUG_PRINT("info", ("com_change_user_pkt_len=%u", com_change_user_pkt_len)); @@ -9062,7 +9044,7 @@ bool acl_authenticate(THD *thd, uint connect_errors, if (!proxy_user) { if (!thd->is_error()) - login_failed_error(&mpvio, mpvio.auth_info.password_used); + login_failed_error(thd, mpvio.auth_info.password_used); DBUG_RETURN(1); } @@ -9078,7 +9060,7 @@ bool acl_authenticate(THD *thd, uint connect_errors, if (!acl_proxy_user) { if (!thd->is_error()) - login_failed_error(&mpvio, mpvio.auth_info.password_used); + login_failed_error(thd, mpvio.auth_info.password_used); mysql_mutex_unlock(&acl_cache->lock); DBUG_RETURN(1); } @@ -9266,7 +9248,12 @@ static int native_password_authenticate(MYSQL_PLUGIN_VIO *vio, #endif if (pkt_len == 0) /* no password */ - DBUG_RETURN(info->auth_string[0] ? CR_ERROR : CR_OK); + { + if (info->auth_string[0]) + DBUG_RETURN(CR_ERROR); + else + DBUG_RETURN(CR_OK); + } info->password_used= PASSWORD_USED_YES; if (pkt_len == SCRAMBLE_LENGTH) @@ -9274,11 +9261,13 @@ static int native_password_authenticate(MYSQL_PLUGIN_VIO *vio, if (!mpvio->acl_user->salt_len) DBUG_RETURN(CR_ERROR); - DBUG_RETURN(check_scramble(pkt, thd->scramble, mpvio->acl_user->salt) ? - CR_ERROR : CR_OK); + if (check_scramble(pkt, thd->scramble, mpvio->acl_user->salt)) + DBUG_RETURN(CR_ERROR); + else + DBUG_RETURN(CR_OK); } - inc_host_errors(mpvio->thd->main_security_ctx.ip); + inc_host_errors(mpvio->thd->security_ctx->ip); my_error(ER_HANDSHAKE_ERROR, MYF(0)); DBUG_RETURN(CR_ERROR); } @@ -9334,7 +9323,7 @@ static int old_password_authenticate(MYSQL_PLUGIN_VIO *vio, CR_ERROR : CR_OK; } - inc_host_errors(mpvio->thd->main_security_ctx.ip); + inc_host_errors(mpvio->thd->security_ctx->ip); my_error(ER_HANDSHAKE_ERROR, MYF(0)); return CR_ERROR; } diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index 3e83aceb03b..a2aeeb86072 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -409,7 +409,7 @@ void field_real::add() if ((decs = decimals()) == NOT_FIXED_DEC) { - length= my_sprintf(buff, (buff, "%g", num)); + length= sprintf(buff, "%g", num); if (rint(num) != num) max_notzero_dec_len = 1; } @@ -420,7 +420,7 @@ void field_real::add() snprintf(buff, sizeof(buff)-1, "%-.*f", (int) decs, num); length = (uint) strlen(buff); #else - length= my_sprintf(buff, (buff, "%-.*f", (int) decs, num)); + length= sprintf(buff, "%-.*f", (int) decs, num); #endif // We never need to check further than this @@ -1002,9 +1002,9 @@ void field_decimal::get_opt_type(String *answer, my_decimal_set_zero(&zero); my_bool is_unsigned= (my_decimal_cmp(&zero, &min_arg) >= 0); - length= my_sprintf(buff, (buff, "DECIMAL(%d, %d)", - (int) (max_length - (item->decimals ? 1 : 0)), - item->decimals)); + length= sprintf(buff, "DECIMAL(%d, %d)", + (int) (max_length - (item->decimals ? 1 : 0)), + item->decimals); if (is_unsigned) length= (uint) (strmov(buff+length, " UNSIGNED")- buff); answer->append(buff, length); diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 84adfddc4ac..395ab889a14 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -274,52 +274,6 @@ bool Foreign_key::validate(List<Create_field> &table_fields) ****************************************************************************/ /** - Get reference to scheduler data object - - @param thd THD object - - @retval Scheduler data object on THD -*/ -void *thd_get_scheduler_data(THD *thd) -{ - return thd->scheduler.data; -} - -/** - Set reference to Scheduler data object for THD object - - @param thd THD object - @param psi Scheduler data object to set on THD -*/ -void thd_set_scheduler_data(THD *thd, void *data) -{ - thd->scheduler.data= data; -} - -/** - Get reference to Performance Schema object for THD object - - @param thd THD object - - @retval Performance schema object for thread on THD -*/ -PSI_thread *thd_get_psi(THD *thd) -{ - return thd->scheduler.m_psi; -} - -/** - Set reference to Performance Schema object for THD object - - @param thd THD object - @param psi Performance schema object for thread -*/ -void thd_set_psi(THD *thd, PSI_thread *psi) -{ - thd->scheduler.m_psi= psi; -} - -/** Set the state on connection to killed @param thd THD object @@ -405,13 +359,6 @@ THD *thd_get_current_thd() */ void thd_new_connection_setup(THD *thd, char *stack_start) { -#ifdef HAVE_PSI_INTERFACE - if (PSI_server) - thd_set_psi(thd, - PSI_server->new_thread(key_thread_one_connection, - thd, - thd_get_thread_id((MYSQL_THD)thd))); -#endif thd->set_time(); thd->prior_thr_create_utime= thd->thr_create_utime= thd->start_utime= my_micro_time(); @@ -837,7 +784,7 @@ THD::THD() init_sql_alloc(&main_mem_root, ALLOC_ROOT_MIN_BLOCK_SIZE, 0); stmt_arena= this; thread_stack= 0; - scheduler= &thread_scheduler; // Will be fixed later + scheduler= thread_scheduler; // Will be fixed later extra_port= 0; catalog= (char*)"std"; // the only catalog we have for now main_security_ctx.init(); diff --git a/sql/sql_class.h b/sql/sql_class.h index 9280fbd0640..8556472394d 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -446,6 +446,7 @@ typedef struct system_variables ulong max_tmp_tables; ulong max_insert_delayed_threads; ulong min_examined_row_limit; + ulong multi_range_count; ulong net_buffer_length; ulong net_interactive_timeout; ulong net_read_timeout; @@ -2103,7 +2104,6 @@ public: char scramble[SCRAMBLE_LENGTH+1]; bool slave_thread, one_shot_set; - bool no_errors, password; bool extra_port; /* If extra connection */ bool no_errors; diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc index c0646e6cec7..3e7c7344a10 100644 --- a/sql/sql_connect.cc +++ b/sql/sql_connect.cc @@ -1177,7 +1177,7 @@ void do_handle_one_connection(THD *thd_arg) thd->thr_create_utime= my_micro_time(); - if (MYSQL_CALLBACK_ELSE(&thread_scheduler, init_new_connection_thread, (), 0)) + if (MYSQL_CALLBACK_ELSE(thread_scheduler, init_new_connection_thread, (), 0)) { close_connection(thd, ER_OUT_OF_RESOURCES); statistic_increment(aborted_connects,&LOCK_status); diff --git a/sql/sql_connect.h b/sql/sql_connect.h index 2f3096b496a..6faf595bd17 100644 --- a/sql/sql_connect.h +++ b/sql/sql_connect.h @@ -18,6 +18,8 @@ #include "my_sys.h" /* pthread_handler_t */ #include "mysql_com.h" /* enum_server_command */ +#include "structs.h" +#include <hash.h> class THD; typedef struct st_lex_user LEX_USER; diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 8dd611e4ccf..3a7cc38b097 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -230,8 +230,14 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, order= simple_remove_const(order, conds); bool need_sort; - usable_index= get_index_for_order(order, table, select, limit, - &need_sort, &reverse); + if (select && select->quick && select->quick->unique_key_range()) + { // Single row select (always "ordered") + need_sort= FALSE; + usable_index= MAX_KEY; + } + else + usable_index= get_index_for_order(order, table, select, limit, + &need_sort, &reverse); if (need_sort) { DBUG_ASSERT(usable_index == MAX_KEY); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index d12b314001a..400cc2683cd 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -977,7 +977,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd, MYSQL_AUDIT_NOTIFY_CONNECTION_CHANGE_USER(thd); if (rc) { - my_free(thd->security_ctx->user); + /* authentication can fail before or after allocating new username */ + if (thd->security_ctx->user != save_security_ctx.user) + my_free(thd->security_ctx->user); *thd->security_ctx= save_security_ctx; thd->user_connect= save_user_connect; thd->reset_db(save_db, save_db_length); diff --git a/sql/sql_partition.h b/sql/sql_partition.h index 9a9a0bd56fa..c19eb5802b3 100644 --- a/sql/sql_partition.h +++ b/sql/sql_partition.h @@ -96,7 +96,6 @@ bool check_partition_info(partition_info *part_info,handlerton **eng_type, TABLE *table, handler *file, HA_CREATE_INFO *info); void set_linear_hash_mask(partition_info *part_info, uint num_parts); bool fix_partition_func(THD *thd, TABLE *table, bool create_table_ind); -bool partition_key_modified(TABLE *table, const MY_BITMAP *fields); void get_partition_set(const TABLE *table, uchar *buf, const uint index, const key_range *key_spec, part_id_range *part_spec); @@ -269,6 +268,9 @@ char *generate_partition_syntax(partition_info *part_info, bool show_partition_options, HA_CREATE_INFO *create_info, Alter_info *alter_info); +bool partition_key_modified(TABLE *table, const MY_BITMAP *fields); +#else +#define partition_key_modified(X,Y) 0 #endif void create_partition_name(char *out, const char *in1, diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index d36654c4c18..60137d51a5e 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -513,7 +513,7 @@ static my_bool read_mysql_plugin_info(struct st_plugin_dl *plugin_dl, { free_plugin_mem(plugin_dl); report_error(report, ER_OUTOFMEMORY, - static_cast<int>(plugin_dl.dl.length)); + static_cast<int>(plugin_dl->dl.length)); DBUG_RETURN(TRUE); } /* @@ -639,7 +639,7 @@ static my_bool read_maria_plugin_info(struct st_plugin_dl *plugin_dl, { free_plugin_mem(plugin_dl); report_error(report, ER_OUTOFMEMORY, - static_cast<int>(plugin_dl.dl.length)); + static_cast<int>(plugin_dl->dl.length)); DBUG_RETURN(TRUE); } /* diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 34c61dc2c2b..f4ca5826c65 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1319,11 +1319,11 @@ JOIN::optimize() */ no_jbuf_after= 1 ? tables : make_join_orderinfo(this); + // Don't use join buffering when we use MATCH select_opts_for_readinfo= (select_options & (SELECT_DESCRIBE | SELECT_NO_JOIN_CACHE)) | (select_lex->ftfunc_list->elements ? SELECT_NO_JOIN_CACHE : 0); - // No cache for MATCH == 'Don't use join buffering when we use MATCH'. if (make_join_readinfo(this, select_opts_for_readinfo, no_jbuf_after)) DBUG_RETURN(1); @@ -15639,18 +15639,16 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, bool no_changes, const key_map *map) { int ref_key; - uint ref_key_parts; + uint UNINIT_VAR(ref_key_parts); int order_direction= 0; uint used_key_parts; TABLE *table=tab->table; SQL_SELECT *select=tab->select; key_map usable_keys; - QUICK_SELECT_I *save_quick= 0; + QUICK_SELECT_I *save_quick= select ? select->quick : 0; COND *orig_select_cond= 0; int best_key= -1; - DBUG_ENTER("test_if_skip_sort_order"); - LINT_INIT(ref_key_parts); /* Keys disabled by ALTER TABLE ... DISABLE KEYS should have already @@ -15683,7 +15681,6 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, else if (select && select->quick) // Range found by opt_range { int quick_type= select->quick->get_type(); - save_quick= select->quick; /* assume results are not ordered when index merge is used TODO: sergeyp: Results of all index merge selects actually are ordered @@ -15814,7 +15811,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, join->select_options & OPTION_FOUND_ROWS ? HA_POS_ERROR : join->unit->select_limit_cnt, - TRUE, FALSE) > 0; + TRUE, FALSE); } order_direction= best_key_direction; /* @@ -19877,16 +19874,6 @@ test_if_cheaper_ordering(const JOIN_TAB *tab, ORDER *order, TABLE *table, uint get_index_for_order(ORDER *order, TABLE *table, SQL_SELECT *select, ha_rows limit, bool *need_sort, bool *reverse) { - if (select && select->quick && select->quick->unique_key_range()) - { // Single row select (always "ordered"): Ok to use with key field UPDATE - *need_sort= FALSE; - /* - Returning of MAX_KEY here prevents updating of used_key_is_modified - in mysql_update(). Use quick select "as is". - */ - return MAX_KEY; - } - if (!order) { *need_sort= FALSE; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 2d06f383612..39e3652a1af 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -5975,7 +5975,7 @@ static void store_schema_partitions_record(THD *thd, TABLE *schema_table, strlen(part_elem->tablespace_name), cs); else { - char *ts= showing_table->s->tablespace; + char *ts= showing_table->file->get_tablespace_name(thd,0,0); if(ts) table->field[24]->store(ts, strlen(ts), cs); else diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 7d59598d606..73e9734280f 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -6548,7 +6548,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, if (alter_info->keys_onoff != LEAVE_AS_IS || table->file->indexes_are_disabled()) need_lock_for_indexes= true; - if (!table->s->tmp_table && + if (!table->s->tmp_table && need_lock_for_indexes && wait_while_table_is_used(thd, table, extra_func)) goto err_new_table_cleanup; thd_proc_info(thd, "manage keys"); diff --git a/sql/sql_update.cc b/sql/sql_update.cc index bb4540b48f3..0f470062981 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -1,4 +1,5 @@ /* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2011 Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -437,23 +438,37 @@ int mysql_update(THD *thd, table->update_const_key_parts(conds); order= simple_remove_const(order, conds); - used_index= get_index_for_order(order, table, select, limit, - &need_sort, &reverse); - if (need_sort) - { // Assign table scan index to check below for modified key fields: - used_index= table->file->key_used_on_scan; + if (select && select->quick && select->quick->unique_key_range()) + { // Single row select (always "ordered"): Ok to use with key field UPDATE + need_sort= FALSE; + used_index= MAX_KEY; + used_key_is_modified= FALSE; } - if (used_index != MAX_KEY) - { // Check if we are modifying a key that we are used to search with: - used_key_is_modified= is_key_used(table, used_index, table->write_set); + else + { + used_index= get_index_for_order(order, table, select, limit, + &need_sort, &reverse); + if (select && select->quick) + { + DBUG_ASSERT(need_sort || used_index == select->quick->index); + used_key_is_modified= (!select->quick->unique_key_range() && + select->quick->is_keys_used(table->write_set)); + } + else + { + if (need_sort) + { // Assign table scan index to check below for modified key fields: + used_index= table->file->key_used_on_scan; + } + if (used_index != MAX_KEY) + { // Check if we are modifying a key that we are used to search with: + used_key_is_modified= is_key_used(table, used_index, table->write_set); + } + } } -#ifdef WITH_PARTITION_STORAGE_ENGINE if (used_key_is_modified || order || partition_key_modified(table, table->write_set)) -#else - if (used_key_is_modified || order) -#endif { /* We can't update table directly; We must first search after all @@ -2098,7 +2113,7 @@ int multi_update::do_updates() { if ((local_error= tbl->file->ha_rnd_pos(tbl->record[0], - (uchar*) tmp_table->field[field_num]->ptr))) + (uchar *) tmp_table->field[field_num]->ptr))) { err_table= tbl; goto err; diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index fceaad4eca9..ba86a06847a 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -1197,7 +1197,7 @@ static Sys_var_harows Sys_sql_max_join_size( SESSION_VAR(max_join_size), NO_CMD_LINE, VALID_RANGE(1, HA_POS_ERROR), DEFAULT(HA_POS_ERROR), BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), - ON_UPDATE(fix_max_join_size), DEPRECATED(70000, 0)); + ON_UPDATE(fix_max_join_size), DEPRECATED(70000, "'@@max_join_size'")); static Sys_var_ulong Sys_max_long_data_size( "max_long_data_size", @@ -1636,6 +1636,13 @@ static Sys_var_ulong Sys_range_alloc_block_size( VALID_RANGE(RANGE_ALLOC_BLOCK_SIZE, ULONG_MAX), DEFAULT(RANGE_ALLOC_BLOCK_SIZE), BLOCK_SIZE(1024)); +static Sys_var_ulong Sys_multi_range_count( + "multi_range_count", "Ignored. Use mrr_buffer_size instead", + SESSION_VAR(multi_range_count), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(1, ULONG_MAX), DEFAULT(256), BLOCK_SIZE(1), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(0), + DEPRECATED(50700, "'@@mrr_buffer_size'")); + static bool fix_thd_mem_root(sys_var *self, THD *thd, enum_var_type type) { if (type != OPT_GLOBAL) diff --git a/sql/table.cc b/sql/table.cc index f71df6b9665..8d27d1699f5 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1141,11 +1141,11 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, share->rec_buff_length= rec_buff_length; if (!(record= (uchar *) alloc_root(&share->mem_root, rec_buff_length))) - goto free_and_err; /* purecov: inspected */ + goto err; /* purecov: inspected */ share->default_values= record; if (mysql_file_pread(file, record, (size_t) share->reclength, record_offset, MYF(MY_NABP))) - goto free_and_err; /* purecov: inspected */ + goto err; /* purecov: inspected */ mysql_file_seek(file, pos+288, MY_SEEK_SET, MYF(0)); #ifdef HAVE_CRYPTED_FRM @@ -1153,7 +1153,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, { crypted->decode((char*) forminfo+256,288-256); if (sint2korr(forminfo+284) != 0) // Should be 0 - goto free_and_err; // Wrong password + goto err; // Wrong password } #endif @@ -1186,14 +1186,14 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, keys+3)*sizeof(char *)+ (n_length+int_length+com_length+ vcol_screen_length))))) - goto free_and_err; /* purecov: inspected */ + goto err; /* purecov: inspected */ share->field= field_ptr; read_length=(uint) (share->fields * field_pack_length + pos+ (uint) (n_length+int_length+com_length+ vcol_screen_length)); if (read_string(file,(uchar**) &disk_buff,read_length)) - goto free_and_err; /* purecov: inspected */ + goto err; /* purecov: inspected */ #ifdef HAVE_CRYPTED_FRM if (crypted) { @@ -1220,7 +1220,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, fix_type_pointers(&interval_array, &share->fieldnames, 1, &names); if (share->fieldnames.count != share->fields) - goto free_and_err; + goto err; fix_type_pointers(&interval_array, share->intervals, interval_count, &names); @@ -1234,7 +1234,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, uint count= (uint) (interval->count + 1) * sizeof(uint); if (!(interval->type_lengths= (uint *) alloc_root(&share->mem_root, count))) - goto free_and_err; + goto err; for (count= 0; count < interval->count; count++) { char *val= (char*) interval->type_names[count]; @@ -1250,7 +1250,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, /* Allocate handler */ if (!(handler_file= get_new_handler(share, thd->mem_root, share->db_type()))) - goto free_and_err; + goto err; record= share->default_values-1; /* Fieldstart = 1 */ null_bits_are_used= share->null_fields != 0; @@ -1313,7 +1313,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, charset= &my_charset_bin; #else error= 4; // unsupported field type - goto free_and_err; + goto err; #endif } else @@ -1325,7 +1325,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, { error= 5; // Unknown or unavailable charset errarg= (int) csid; - goto free_and_err; + goto err; } } @@ -1365,7 +1365,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, if ((uint)vcol_screen_pos[0] != 1) { error= 4; - goto free_and_err; + goto err; } field_type= (enum_field_types) (uchar) vcol_screen_pos[1]; fld_stored_in_db= (bool) (uint) vcol_screen_pos[2]; @@ -1374,7 +1374,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, (char *)memdup_root(&share->mem_root, vcol_screen_pos+(uint)FRM_VCOL_HEADER_SIZE, vcol_expr_length))) - goto free_and_err; + goto err; vcol_info->expr_str.length= vcol_expr_length; vcol_screen_pos+= vcol_info_length; share->vfields++; @@ -1464,7 +1464,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, if (!reg_field) // Not supported field type { error= 4; - goto free_and_err; /* purecov: inspected */ + goto err; /* purecov: inspected */ } reg_field->field_index= i; @@ -1504,7 +1504,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, sent (OOM). */ error= 8; - goto free_and_err; + goto err; } } if (!reg_field->stored_in_db) @@ -1581,7 +1581,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, if (!key_part->fieldnr) { error= 4; // Wrong file - goto free_and_err; + goto err; } field= key_part->field= share->field[key_part->fieldnr-1]; key_part->type= field->key_type(); @@ -1743,11 +1743,10 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, { DBUG_ASSERT(options_len); if (engine_table_options_frm_read(options, options_len, share)) - goto free_and_err; + goto err; } if (parse_engine_table_options(thd, handler_file->partition_ht(), share)) - goto free_and_err; - my_free(buff); + goto err; if (share->found_next_number_field) { @@ -2059,7 +2058,7 @@ bool unpack_vcol_info_from_frm(THD *thd, vcol_arena= table->expr_arena; if (!vcol_arena) { - Query_arena expr_arena(&table->mem_root, Query_arena::INITIALIZED); + Query_arena expr_arena(&table->mem_root, Query_arena::STMT_INITIALIZED); if (!(vcol_arena= (Query_arena *) alloc_root(&table->mem_root, sizeof(Query_arena)))) goto err; @@ -2145,12 +2144,12 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias, bool error_reported= FALSE; uchar *record, *bitmaps; Field **field_ptr, **vfield_ptr; - bool save_view_prepare_mode= thd->lex->view_prepare_mode; + uint8 save_view_prepare_mode= thd->lex->context_analysis_only; DBUG_ENTER("open_table_from_share"); DBUG_PRINT("enter",("name: '%s.%s' form: 0x%lx", share->db.str, share->table_name.str, (long) outparam)); - thd->lex->view_prepare_mode= FALSE; // not a view + thd->lex->context_analysis_only&= ~CONTEXT_ANALYSIS_ONLY_VIEW; // not a view error= 1; bzero((char*) outparam, sizeof(*outparam)); @@ -2480,7 +2479,7 @@ partititon_err: HA_HAS_OWN_BINLOGGING); thd->status_var.opened_tables++; - thd->lex->view_prepare_mode= save_view_prepare_mode; + thd->lex->context_analysis_only= save_view_prepare_mode; DBUG_RETURN (0); err: @@ -2493,7 +2492,7 @@ partititon_err: #endif outparam->file= 0; // For easier error checking outparam->db_stat=0; - thd->lex->view_prepare_mode= save_view_prepare_mode; + thd->lex->context_analysis_only= save_view_prepare_mode; free_root(&outparam->mem_root, MYF(0)); // Safe to call on bzero'd root my_free((void *) outparam->alias); DBUG_RETURN (error); diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc index eeb9b12007b..3701957ec4f 100644 --- a/storage/example/ha_example.cc +++ b/storage/example/ha_example.cc @@ -822,29 +822,6 @@ int ha_example::delete_all_rows() /** @brief - Used for handler specific truncate table. The table is locked in - exclusive mode and handler is responsible for reseting the auto- - increment counter. - - @details - Called from Truncate_statement::handler_truncate. - Not used if the handlerton supports HTON_CAN_RECREATE, unless this - engine can be used as a partition. In this case, it is invoked when - a particular partition is to be truncated. - - @see - Truncate_statement in sql_truncate.cc - Remarks in handler::truncate. -*/ -int ha_example::truncate() -{ - DBUG_ENTER("ha_example::truncate"); - DBUG_RETURN(HA_ERR_WRONG_COMMAND); -} - - -/** - @brief This create a lock on the table. If you are implementing a storage engine that can handle transacations look at ha_berkely.cc to see how you will want to go about doing this. Otherwise you should consider calling flock() diff --git a/storage/example/ha_example.h b/storage/example/ha_example.h index 98ef563b877..27b97395544 100644 --- a/storage/example/ha_example.h +++ b/storage/example/ha_example.h @@ -245,7 +245,6 @@ public: int extra(enum ha_extra_function operation); int external_lock(THD *thd, int lock_type); ///< required int delete_all_rows(void); - int truncate(); ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key); int delete_table(const char *from); diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc index 17412808d44..ab338d9281f 100644 --- a/storage/federated/ha_federated.cc +++ b/storage/federated/ha_federated.cc @@ -390,6 +390,12 @@ #include <mysql/plugin.h> +#ifdef I_AM_PARANOID +#define MIN_PORT 1023 +#else +#define MIN_PORT 0 +#endif + /* Variables for federated share methods */ static HASH federated_open_tables; // To track open tables mysql_mutex_t federated_mutex; // To init the hash @@ -624,11 +630,7 @@ int get_connection(MEM_ROOT *mem_root, FEDERATED_SHARE *share) share->username= server->username; share->password= server->password; share->database= server->db; -#ifndef I_AM_PARANOID - share->port= server->port > 0 && server->port < 65536 ? -#else - share->port= server->port > 1023 && server->port < 65536 ? -#endif + share->port= server->port > MIN_PORT && server->port < 65536 ? (ushort) server->port : MYSQL_PORT; share->hostname= server->host; if (!(share->socket= server->socket) && @@ -3044,16 +3046,6 @@ int ha_federated::delete_all_rows() /* - Used to manually truncate the table via a delete of all rows in a table. -*/ - -int ha_federated::truncate() -{ - return delete_all_rows(); -} - - -/* The idea with handler::store_lock() is the following: The statement decided which locks we should need for the table diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc index 0d79ffe38a6..ab14ddb5544 100644 --- a/storage/federatedx/ha_federatedx.cc +++ b/storage/federatedx/ha_federatedx.cc @@ -318,6 +318,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "sql_analyse.h" // append_escaped() #include "sql_show.h" // append_identifier() +#ifdef I_AM_PARANOID +#define MIN_PORT 1023 +#else +#define MIN_PORT 0 +#endif + /* Variables for federatedx share methods */ static HASH federatedx_open_tables; // To track open tables static HASH federatedx_open_servers; // To track open servers @@ -536,11 +542,7 @@ int get_connection(MEM_ROOT *mem_root, FEDERATEDX_SHARE *share) share->username= server->username; share->password= server->password; share->database= server->db; -#ifndef I_AM_PARANOID - share->port= server->port > 0 && server->port < 65536 ? -#else - share->port= server->port > 1023 && server->port < 65536 ? -#endif + share->port= server->port > MIN_PORT && server->port < 65536 ? (ushort) server->port : MYSQL_PORT; share->hostname= server->host; if (!(share->socket= server->socket) && @@ -557,9 +559,8 @@ int get_connection(MEM_ROOT *mem_root, FEDERATEDX_SHARE *share) DBUG_RETURN(0); error: - my_sprintf(error_buffer, - (error_buffer, "server name: '%s' doesn't exist!", - share->connection_string)); + sprintf(error_buffer, "server name: '%s' doesn't exist!", + share->connection_string); my_error(error_num, MYF(0), error_buffer); DBUG_RETURN(error_num); } @@ -2584,8 +2585,8 @@ int ha_federatedx::index_read_idx_with_result_set(uchar *buf, uint index, if (io->query(sql_query.ptr(), sql_query.length())) { - my_sprintf(error_buffer, (error_buffer, "error: %d '%s'", - io->error_code(), io->error_str())); + sprintf(error_buffer, "error: %d '%s'", + io->error_code(), io->error_str()); retval= ER_QUERY_ON_FOREIGN_DATA_SOURCE; goto error; } @@ -3308,9 +3309,8 @@ static int test_connection(MYSQL_THD thd, federatedx_io *io, if ((retval= io->query(str.ptr(), str.length()))) { - my_sprintf(buffer, (buffer, - "database: '%s' username: '%s' hostname: '%s'", - share->database, share->username, share->hostname)); + sprintf(buffer, "database: '%s' username: '%s' hostname: '%s'", + share->database, share->username, share->hostname); DBUG_PRINT("info", ("error-code: %d", io->error_code())); my_error(ER_CANT_CREATE_FEDERATED_TABLE, MYF(0), buffer); } diff --git a/storage/federatedx/ha_federatedx.h b/storage/federatedx/ha_federatedx.h index 96763f7ce31..93034ac0ad3 100644 --- a/storage/federatedx/ha_federatedx.h +++ b/storage/federatedx/ha_federatedx.h @@ -330,7 +330,7 @@ public: /* fix server to be able to get remote server table flags */ return (HA_PRIMARY_KEY_IN_READ_INDEX | HA_FILE_BASED | HA_REC_NOT_IN_SEQ | HA_AUTO_PART_KEY | HA_CAN_INDEX_BLOBS | - HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | + HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_CAN_REPAIR | HA_NO_PREFIX_CHAR_KEYS | HA_PRIMARY_KEY_REQUIRED_FOR_DELETE | HA_PARTIAL_COLUMN_READ | HA_NULL_IN_KEY); } diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc index fc6e89e54e0..e16a5e38a0f 100644 --- a/storage/heap/ha_heap.cc +++ b/storage/heap/ha_heap.cc @@ -455,13 +455,6 @@ int ha_heap::delete_all_rows() } -int ha_heap::truncate() -{ - int error= delete_all_rows(); - return error ? error : reset_auto_increment(0); -} - - int ha_heap::reset_auto_increment(ulonglong value) { file->s->auto_increment= value; diff --git a/storage/heap/ha_heap.h b/storage/heap/ha_heap.h index cc335870f06..c8652d6db69 100644 --- a/storage/heap/ha_heap.h +++ b/storage/heap/ha_heap.h @@ -99,7 +99,6 @@ public: int reset(); int external_lock(THD *thd, int lock_type); int delete_all_rows(void); - int truncate(); int reset_auto_increment(ulonglong value); int disable_indexes(uint mode); int enable_indexes(uint mode); diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index 8227449679e..331257dbe3d 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -300,7 +300,7 @@ static void _ma_check_print_msg(HA_CHECK *param, const char *msg_type, THD *thd= (THD *) param->thd; Protocol *protocol= thd->protocol; uint length, msg_length; - char msgbuf[HA_MAX_MSG_BUF]; + char msgbuf[MYSQL_ERRMSG_SIZE]; char name[NAME_LEN * 2 + 2]; msg_length= my_vsnprintf(msgbuf, sizeof(msgbuf), fmt, args); @@ -827,15 +827,16 @@ int_table_flags(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER | HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_DUPLICATE_POS | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY | HA_FILE_BASED | HA_CAN_GEOMETRY | CANNOT_ROLLBACK_FLAG | - HA_CAN_BIT_FIELD | HA_CAN_RTREEKEYS | + HA_CAN_BIT_FIELD | HA_CAN_RTREEKEYS | HA_CAN_REPAIR | HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT), can_enable_indexes(1), bulk_insert_single_undo(BULK_INSERT_NONE) {} -handler *ha_maria::clone(MEM_ROOT *mem_root) +handler *ha_maria::clone(const char *name, MEM_ROOT *mem_root) { - ha_maria *new_handler= static_cast <ha_maria *>(handler::clone(mem_root)); + ha_maria *new_handler= static_cast <ha_maria *>(handler::clone(name, + mem_root)); if (new_handler) { new_handler->file->state= file->state; @@ -1937,8 +1938,8 @@ end: bool ha_maria::check_and_repair(THD *thd) { int error, crashed; - LEX_STRING old_query; HA_CHECK_OPT check_opt; + const CSET_STRING query_backup= thd->query_string; DBUG_ENTER("ha_maria::check_and_repair"); check_opt.init(); @@ -1967,10 +1968,8 @@ bool ha_maria::check_and_repair(THD *thd) if (!file->state->del && (maria_recover_options & HA_RECOVER_QUICK)) check_opt.flags |= T_QUICK; - old_query= thd->query_string; - mysql_mutex_lock(&LOCK_thread_count); - thd->query_string= table->s->table_name; - mysql_mutex_unlock(&LOCK_thread_count); + thd->set_query(table->s->table_name.str, + (uint) table->s->table_name.length, system_charset_info); if (!(crashed= maria_is_crashed(file))) { @@ -1988,9 +1987,7 @@ bool ha_maria::check_and_repair(THD *thd) if (repair(thd, &check_opt)) error= 1; } - mysql_mutex_lock(&LOCK_thread_count); - thd->query_string= old_query; - mysql_mutex_unlock(&LOCK_thread_count); + thd->set_query(query_backup); DBUG_RETURN(error); } @@ -2418,7 +2415,6 @@ int ha_maria::external_lock(THD *thd, int lock_type) if (file->trn) { /* This can only happen with tables created with clone() */ - DBUG_ASSERT(cloned); trnman_increment_locked_tables(file->trn); } diff --git a/storage/maria/ha_maria.h b/storage/maria/ha_maria.h index 1e540fd5e7b..53df1d2cfa6 100644 --- a/storage/maria/ha_maria.h +++ b/storage/maria/ha_maria.h @@ -58,7 +58,7 @@ class ha_maria :public handler public: ha_maria(handlerton *hton, TABLE_SHARE * table_arg); ~ha_maria() {} - handler *clone(MEM_ROOT *mem_root); + handler *clone(const char *name, MEM_ROOT *mem_root); const char *table_type() const { return "Aria"; } const char *index_type(uint key_number); diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c index 41944753c98..84db7cc395a 100644 --- a/storage/maria/ma_check.c +++ b/storage/maria/ma_check.c @@ -4067,9 +4067,6 @@ err: int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info, const char * name, my_bool rep_quick) { -#ifndef THREAD - return maria_repair_by_sort(param, info, name, rep_quick); -#else int got_error; uint i,key, total_key_length, istep; ha_rows start_records; @@ -4546,7 +4543,6 @@ err: if (!got_error && (param->testflag & T_UNPACK)) restore_data_file_type(share); DBUG_RETURN(got_error); -#endif /* THREAD */ } /* Read next record and return next key */ diff --git a/storage/maria/ma_close.c b/storage/maria/ma_close.c index 2da40dcb8f6..0a36e52e4ae 100644 --- a/storage/maria/ma_close.c +++ b/storage/maria/ma_close.c @@ -113,7 +113,6 @@ int maria_close(register MARIA_HA *info) if (my_close(share->kfile.file, MYF(0))) error= my_errno; } -#ifdef THREAD thr_lock_delete(&share->lock); (void) pthread_mutex_destroy(&share->key_del_lock); { @@ -124,7 +123,6 @@ int maria_close(register MARIA_HA *info) rwlock_destroy(&share->keyinfo[i].root_lock); } } -#endif DBUG_ASSERT(share->now_transactional == share->base.born_transactional); /* We assign -1 because checkpoint does not need to flush (in case we diff --git a/storage/maria/ma_delete.c b/storage/maria/ma_delete.c index 2c13ddfe5bb..22ffb05af38 100644 --- a/storage/maria/ma_delete.c +++ b/storage/maria/ma_delete.c @@ -118,7 +118,6 @@ int maria_delete(MARIA_HA *info,const uchar *record) mi_sizestore(lastpos, info->cur_row.lastpos); _ma_writeinfo(info, WRITEINFO_UPDATE_KEYFILE); - allow_break(); /* Allow SIGHUP & SIGINT */ if (info->invalidator != 0) { DBUG_PRINT("info", ("invalidator... '%s' (delete)", @@ -142,7 +141,6 @@ err: } _ma_writeinfo(info, WRITEINFO_UPDATE_KEYFILE); info->update|=HA_STATE_WRITTEN; /* Buffer changed */ - allow_break(); /* Allow SIGHUP & SIGINT */ if (save_errno == HA_ERR_KEY_NOT_FOUND) { maria_print_error(share, HA_ERR_CRASHED); diff --git a/storage/maria/ma_delete_all.c b/storage/maria/ma_delete_all.c index 2eb966bd7a7..940d4d00987 100644 --- a/storage/maria/ma_delete_all.c +++ b/storage/maria/ma_delete_all.c @@ -138,7 +138,6 @@ int maria_delete_all_rows(MARIA_HA *info) if (share->file_map) _ma_dynmap_file(info, (my_off_t) 0); #endif - allow_break(); /* Allow SIGHUP & SIGINT */ DBUG_RETURN(0); err: @@ -146,7 +145,6 @@ err: int save_errno=my_errno; _ma_writeinfo(info, WRITEINFO_UPDATE_KEYFILE); info->update|=HA_STATE_WRITTEN; /* Buffer changed */ - allow_break(); /* Allow SIGHUP & SIGINT */ DBUG_RETURN(my_errno=save_errno); } } /* maria_delete_all_rows */ diff --git a/storage/maria/ma_dynrec.c b/storage/maria/ma_dynrec.c index 6668d0e5f3d..7fe0a97fa46 100644 --- a/storage/maria/ma_dynrec.c +++ b/storage/maria/ma_dynrec.c @@ -36,13 +36,11 @@ static my_bool delete_dynamic_record(MARIA_HA *info,MARIA_RECORD_POS filepos, static my_bool _ma_cmp_buffer(File file, const uchar *buff, my_off_t filepos, uint length); -#ifdef THREAD /* Play it safe; We have a small stack when using threads */ #undef my_alloca #undef my_afree #define my_alloca(A) my_malloc((A),MYF(0)) #define my_afree(A) my_free((A)) -#endif /* Interface function from MARIA_HA */ @@ -1597,9 +1595,6 @@ my_bool _ma_cmp_dynamic_record(register MARIA_HA *info, my_bool error= 1; DBUG_ENTER("_ma_cmp_dynamic_record"); - /* We are going to do changes; dont let anybody disturb */ - dont_break(); /* Dont allow SIGHUP or SIGINT */ - if (info->opt_flag & WRITE_CACHE_USED) { info->update&= ~(HA_STATE_WRITE_AT_END | HA_STATE_EXTEND_BLOCK); diff --git a/storage/maria/ma_init.c b/storage/maria/ma_init.c index 34f55bd0bf8..af35bf37865 100644 --- a/storage/maria/ma_init.c +++ b/storage/maria/ma_init.c @@ -70,7 +70,6 @@ int maria_init(void) _ma_init_block_record_data(); trnman_end_trans_hook= _ma_trnman_end_trans_hook; maria_create_trn_hook= dummy_maria_create_trn_hook; - my_handler_error_register(); } my_hash_init(&maria_stored_state, &my_charset_bin, 32, 0, sizeof(LSN), 0, (my_hash_free_key) history_state_free, 0); diff --git a/storage/maria/ma_key_recover.c b/storage/maria/ma_key_recover.c index 6de5253a2dd..abd7253e77a 100644 --- a/storage/maria/ma_key_recover.c +++ b/storage/maria/ma_key_recover.c @@ -1395,10 +1395,8 @@ my_bool _ma_lock_key_del(MARIA_HA *info, my_bool insert_at_end) info->key_del_used= 2; /* insert-with-append */ return 1; } -#ifdef THREAD while (share->key_del_used) pthread_cond_wait(&share->key_del_cond, &share->key_del_lock); -#endif info->key_del_used= 1; share->key_del_used= 1; share->key_del_current= share->state.key_del; diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c index 606959c56a0..1a341110125 100644 --- a/storage/maria/ma_open.c +++ b/storage/maria/ma_open.c @@ -200,9 +200,7 @@ static MARIA_HA *maria_clone_internal(MARIA_SHARE *share, const char *name, bzero(info.rec_buff, share->base.default_rec_buff_size); *m_info=info; -#ifdef THREAD thr_lock_data_init(&share->lock,&m_info->lock,(void*) m_info); -#endif m_info->open_list.data=(void*) m_info; maria_open_list=list_add(maria_open_list,&m_info->open_list); @@ -838,7 +836,6 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags) share->state_history->next= 0; } } -#ifdef THREAD thr_lock_init(&share->lock); pthread_mutex_init(&share->intern_lock, MY_MUTEX_INIT_FAST); pthread_mutex_init(&share->key_del_lock, MY_MUTEX_INIT_FAST); @@ -906,7 +903,6 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags) share->lock.start_trans= _ma_block_start_trans_no_versioning; } } -#endif /* Memory mapping can only be requested after initializing intern_lock. */ diff --git a/storage/maria/ma_pagecache.c b/storage/maria/ma_pagecache.c index 566131ec77b..5d192f9cfc2 100644 --- a/storage/maria/ma_pagecache.c +++ b/storage/maria/ma_pagecache.c @@ -528,7 +528,6 @@ static void pagecache_debug_print _VARARGS((const char *fmt, ...)); #endif /* defined(PAGECACHE_DEBUG_LOG) && defined(PAGECACHE_DEBUG) */ #if defined(PAGECACHE_DEBUG) || !defined(DBUG_OFF) -#ifdef THREAD static long pagecache_thread_id; #define KEYCACHE_THREAD_TRACE(l) \ KEYCACHE_DBUG_PRINT(l,("|thread %ld",pagecache_thread_id)) @@ -540,11 +539,6 @@ static long pagecache_thread_id; #define KEYCACHE_THREAD_TRACE_END(l) \ KEYCACHE_DBUG_PRINT(l,("]thread %ld",pagecache_thread_id)) -#else /* THREAD */ -#define KEYCACHE_THREAD_TRACE(l) KEYCACHE_DBUG_PRINT(l,("")) -#define KEYCACHE_THREAD_TRACE_BEGIN(l) KEYCACHE_DBUG_PRINT(l,("")) -#define KEYCACHE_THREAD_TRACE_END(l) KEYCACHE_DBUG_PRINT(l,("")) -#endif /* THREAD */ #else #define KEYCACHE_THREAD_TRACE_BEGIN(l) #define KEYCACHE_THREAD_TRACE_END(l) @@ -945,11 +939,9 @@ ulong resize_pagecache(PAGECACHE *pagecache, uint age_threshold) { ulong blocks; -#ifdef THREAD struct st_my_thread_var *thread; WQUEUE *wqueue; -#endif DBUG_ENTER("resize_pagecache"); if (!pagecache->inited) @@ -963,7 +955,6 @@ ulong resize_pagecache(PAGECACHE *pagecache, mysql_mutex_lock(&pagecache->cache_lock); -#ifdef THREAD wqueue= &pagecache->resize_queue; thread= my_thread_var; wqueue_link_into_queue(wqueue, thread); @@ -972,7 +963,6 @@ ulong resize_pagecache(PAGECACHE *pagecache, { mysql_cond_wait(&thread->suspend, &pagecache->cache_lock); } -#endif pagecache->resize_in_flush= 1; if (flush_all_key_blocks(pagecache)) @@ -985,16 +975,12 @@ ulong resize_pagecache(PAGECACHE *pagecache, } pagecache->resize_in_flush= 0; pagecache->can_be_used= 0; -#ifdef THREAD while (pagecache->cnt_for_resize_op) { KEYCACHE_DBUG_PRINT("resize_pagecache: wait", ("suspend thread %ld", thread->id)); mysql_cond_wait(&thread->suspend, &pagecache->cache_lock); } -#else - KEYCACHE_DBUG_ASSERT(pagecache->cnt_for_resize_op == 0); -#endif end_pagecache(pagecache, 0); /* Don't free mutex */ /* The following will work even if use_mem is 0 */ @@ -1003,7 +989,6 @@ ulong resize_pagecache(PAGECACHE *pagecache, pagecache->readwrite_flags); finish: -#ifdef THREAD wqueue_unlink_from_queue(wqueue, thread); /* Signal for the next resize request to proceeed if any */ if (wqueue->last_thread) @@ -1012,7 +997,6 @@ finish: ("thread %ld", wqueue->last_thread->next->id)); mysql_cond_signal(&wqueue->last_thread->next->suspend); } -#endif mysql_mutex_unlock(&pagecache->cache_lock); DBUG_RETURN(blocks); } @@ -1034,7 +1018,6 @@ static inline void inc_counter_for_resize_op(PAGECACHE *pagecache) */ static inline void dec_counter_for_resize_op(PAGECACHE *pagecache) { -#ifdef THREAD struct st_my_thread_var *last_thread; if (!--pagecache->cnt_for_resize_op && (last_thread= pagecache->resize_queue.last_thread)) @@ -1043,9 +1026,6 @@ static inline void dec_counter_for_resize_op(PAGECACHE *pagecache) ("thread %ld", last_thread->next->id)); mysql_cond_signal(&last_thread->next->suspend); } -#else - pagecache->cnt_for_resize_op--; -#endif } /* @@ -1246,7 +1226,6 @@ static void link_block(PAGECACHE *pagecache, PAGECACHE_BLOCK_LINK *block, PCBLOCK_INFO(block); KEYCACHE_DBUG_ASSERT(! (block->hash_link && block->hash_link->requests)); -#ifdef THREAD if (!hot && pagecache->waiting_for_block.last_thread) { /* Signal that in the LRU warm sub-chain an available block has appeared */ @@ -1284,10 +1263,6 @@ static void link_block(PAGECACHE *pagecache, PAGECACHE_BLOCK_LINK *block, #endif return; } -#else /* THREAD */ - KEYCACHE_DBUG_ASSERT(! (!hot && pagecache->waiting_for_block.last_thread)); - /* Condition not transformed using DeMorgan, to keep the text identical */ -#endif /* THREAD */ ptr_ins= hot ? &pagecache->used_ins : &pagecache->used_last; ins= *ptr_ins; if (ins) @@ -1485,12 +1460,8 @@ static inline void remove_reader(PAGECACHE_BLOCK_LINK *block) DBUG_ENTER("remove_reader"); PCBLOCK_INFO(block); DBUG_ASSERT(block->hash_link->requests > 0); -#ifdef THREAD if (! --block->hash_link->requests && block->condvar) mysql_cond_signal(block->condvar); -#else - --block->hash_link->requests; -#endif DBUG_VOID_RETURN; } @@ -1504,7 +1475,6 @@ static inline void wait_for_readers(PAGECACHE *pagecache __attribute__((unused)), PAGECACHE_BLOCK_LINK *block) { -#ifdef THREAD struct st_my_thread_var *thread= my_thread_var; while (block->hash_link->requests) { @@ -1515,9 +1485,6 @@ static inline void wait_for_readers(PAGECACHE *pagecache mysql_cond_wait(&thread->suspend, &pagecache->cache_lock); block->condvar= NULL; } -#else - KEYCACHE_DBUG_ASSERT(block->hash_link->requests == 0); -#endif } @@ -1549,7 +1516,6 @@ static void unlink_hash(PAGECACHE *pagecache, PAGECACHE_HASH_LINK *hash_link) if ((*hash_link->prev= hash_link->next)) hash_link->next->prev= hash_link->prev; hash_link->block= NULL; -#ifdef THREAD if (pagecache->waiting_for_hash_link.last_thread) { /* Signal that a free hash link has appeared */ @@ -1588,9 +1554,6 @@ static void unlink_hash(PAGECACHE *pagecache, PAGECACHE_HASH_LINK *hash_link) hash_link); return; } -#else /* THREAD */ - KEYCACHE_DBUG_ASSERT(! (pagecache->waiting_for_hash_link.last_thread)); -#endif /* THREAD */ hash_link->next= pagecache->free_hash_list; pagecache->free_hash_list= hash_link; } @@ -1702,7 +1665,6 @@ restart: } else { -#ifdef THREAD /* Wait for a free hash link */ struct st_my_thread_var *thread= my_thread_var; PAGECACHE_PAGE page; @@ -1715,9 +1677,6 @@ restart: ("suspend thread %ld", thread->id)); mysql_cond_wait(&thread->suspend, &pagecache->cache_lock); thread->opt_info= NULL; -#else - KEYCACHE_DBUG_ASSERT(0); -#endif DBUG_PRINT("info", ("restarting...")); goto restart; } @@ -1838,7 +1797,6 @@ restart: DBUG_ASSERT(hash_link->requests > 0); hash_link->requests--; { -#ifdef THREAD struct st_my_thread_var *thread= my_thread_var; wqueue_add_to_queue(&block->wqueue[COND_FOR_SAVED], thread); do @@ -1848,16 +1806,6 @@ restart: mysql_cond_wait(&thread->suspend, &pagecache->cache_lock); } while(thread->next); -#else - KEYCACHE_DBUG_ASSERT(0); - /* - Given the use of "resize_in_flush", it seems impossible - that this whole branch is ever entered in single-threaded case - because "(wrmode && pagecache->resize_in_flush)" cannot be true. - TODO: Check this, and then put the whole branch into the - "#ifdef THREAD" guard. - */ -#endif } /* Invalidate page in the block if it has not been done yet */ if (block->status) @@ -1891,7 +1839,6 @@ restart: KEYCACHE_DBUG_PRINT("find_block", ("request waiting for old page to be saved")); { -#ifdef THREAD struct st_my_thread_var *thread= my_thread_var; /* Put the request into the queue of those waiting for the old page */ wqueue_add_to_queue(&block->wqueue[COND_FOR_SAVED], thread); @@ -1903,10 +1850,6 @@ restart: mysql_cond_wait(&thread->suspend, &pagecache->cache_lock); } while(thread->next); -#else - KEYCACHE_DBUG_ASSERT(0); - /* No parallel requests in single-threaded case */ -#endif } KEYCACHE_DBUG_PRINT("find_block", ("request for old page resubmitted")); @@ -1974,7 +1917,6 @@ restart: all of them must get the same block */ -#ifdef THREAD if (! pagecache->used_last) { struct st_my_thread_var *thread= my_thread_var; @@ -1989,9 +1931,6 @@ restart: while (thread->next); thread->opt_info= NULL; } -#else - KEYCACHE_DBUG_ASSERT(pagecache->used_last); -#endif block= hash_link->block; if (! block) { @@ -2062,10 +2001,8 @@ restart: /* Remove the hash link for this page from the hash table */ unlink_hash(pagecache, block->hash_link); /* All pending requests for this page must be resubmitted */ -#ifdef THREAD if (block->wqueue[COND_FOR_SAVED].last_thread) wqueue_release_queue(&block->wqueue[COND_FOR_SAVED]); -#endif } link_to_file_list(pagecache, block, file, (my_bool)(block->hash_link ? 1 : 0)); @@ -2230,7 +2167,6 @@ static my_bool pagecache_wait_lock(PAGECACHE *pagecache, uint lock_type) { /* Lock failed we will wait */ -#ifdef THREAD struct st_my_thread_var *thread= my_thread_var; DBUG_ENTER("pagecache_wait_lock"); DBUG_PRINT("info", ("fail to lock, waiting... 0x%lx", (ulong)block)); @@ -2244,9 +2180,6 @@ static my_bool pagecache_wait_lock(PAGECACHE *pagecache, mysql_cond_wait(&thread->suspend, &pagecache->cache_lock); } while(thread->next); -#else - DBUG_ASSERT(0); -#endif PCBLOCK_INFO(block); if ((block->status & (PCBLOCK_REASSIGNED | PCBLOCK_IN_SWITCH)) || file.file != block->hash_link->file.file || @@ -2398,11 +2331,9 @@ static void release_wrlock(PAGECACHE_BLOCK_LINK *block, my_bool read_lock) if (block->wlocks > 0) DBUG_VOID_RETURN; /* Multiple write locked */ DBUG_PRINT("info", ("WR lock reset, block 0x%lx", (ulong)block)); -#ifdef THREAD /* release all threads waiting for read lock or one waiting for write */ if (block->wqueue[COND_FOR_WRLOCK].last_thread) wqueue_release_one_locktype_from_queue(&block->wqueue[COND_FOR_WRLOCK]); -#endif PCBLOCK_INFO(block); DBUG_VOID_RETURN; } @@ -2436,11 +2367,9 @@ static void release_rdlock(PAGECACHE_BLOCK_LINK *block) if (block->rlocks > 0) DBUG_VOID_RETURN; /* Multiple write locked */ DBUG_PRINT("info", ("RD lock reset, block 0x%lx", (ulong)block)); -#ifdef THREAD /* release all threads waiting for read lock or one waiting for write */ if (block->wqueue[COND_FOR_WRLOCK].last_thread) wqueue_release_one_locktype_from_queue(&block->wqueue[COND_FOR_WRLOCK]); -#endif PCBLOCK_INFO(block); DBUG_VOID_RETURN; } @@ -2639,10 +2568,8 @@ static void read_block(PAGECACHE *pagecache, DBUG_PRINT("read_block", ("primary request: new page in cache")); /* Signal that all pending requests for this page now can be processed */ -#ifdef THREAD if (block->wqueue[COND_FOR_REQUESTED].last_thread) wqueue_release_queue(&block->wqueue[COND_FOR_REQUESTED]); -#endif } else { @@ -2651,7 +2578,6 @@ static void read_block(PAGECACHE *pagecache, that submitted secondary requests */ -#ifdef THREAD struct st_my_thread_var *thread= my_thread_var; /* Put the request into a queue and wait until it can be processed */ wqueue_add_to_queue(&block->wqueue[COND_FOR_REQUESTED], thread); @@ -2662,10 +2588,6 @@ static void read_block(PAGECACHE *pagecache, mysql_cond_wait(&thread->suspend, &pagecache->cache_lock); } while (thread->next); -#else - KEYCACHE_DBUG_ASSERT(0); - /* No parallel requests in single-threaded case */ -#endif DBUG_PRINT("read_block", ("secondary request: new page in cache")); } @@ -3941,11 +3863,9 @@ restart: } KEYCACHE_DBUG_PRINT("key_cache_insert", ("Page injection")); -#ifdef THREAD /* Signal that all pending requests for this now can be processed. */ if (block->wqueue[COND_FOR_REQUESTED].last_thread) wqueue_release_queue(&block->wqueue[COND_FOR_REQUESTED]); -#endif } } else @@ -3960,11 +3880,9 @@ restart: block->status&= ~PCBLOCK_ERROR; } -#ifdef THREAD if (need_page_ready_signal && block->wqueue[COND_FOR_REQUESTED].last_thread) wqueue_release_queue(&block->wqueue[COND_FOR_REQUESTED]); -#endif if (first_REDO_LSN_for_page) { @@ -4114,11 +4032,9 @@ static void free_block(PAGECACHE *pagecache, PAGECACHE_BLOCK_LINK *block) /* Keep track of the number of currently unused blocks. */ pagecache->blocks_unused++; -#ifdef THREAD /* All pending requests for this page must be resubmitted. */ if (block->wqueue[COND_FOR_SAVED].last_thread) wqueue_release_queue(&block->wqueue[COND_FOR_SAVED]); -#endif } @@ -4246,14 +4162,12 @@ static int flush_cached_blocks(PAGECACHE *pagecache, *first_errno= my_errno ? my_errno : -1; rc|= PCFLUSH_ERROR; } -#ifdef THREAD /* Let to proceed for possible waiting requests to write to the block page. It might happen only during an operation to resize the key cache. */ if (block->wqueue[COND_FOR_SAVED].last_thread) wqueue_release_queue(&block->wqueue[COND_FOR_SAVED]); -#endif /* type will never be FLUSH_IGNORE_CHANGED here */ if (! (type == FLUSH_KEEP || type == FLUSH_KEEP_LAZY || type == FLUSH_FORCE_WRITE)) @@ -4348,7 +4262,6 @@ static int flush_pagecache_blocks_int(PAGECACHE *pagecache, uint cnt= 0; #endif -#ifdef THREAD struct st_file_in_flush us_flusher, *other_flusher; us_flusher.file= file->file; us_flusher.flush_queue.last_thread= NULL; @@ -4400,7 +4313,6 @@ static int flush_pagecache_blocks_int(PAGECACHE *pagecache, sleep(10); mysql_mutex_lock(&pagecache->cache_lock); } -#endif if (type != FLUSH_IGNORE_CHANGED) { @@ -4527,7 +4439,6 @@ restart: #endif block= first_in_switch; { -#ifdef THREAD struct st_my_thread_var *thread= my_thread_var; wqueue_add_to_queue(&block->wqueue[COND_FOR_SAVED], thread); do @@ -4538,10 +4449,6 @@ restart: &pagecache->cache_lock); } while (thread->next); -#else - KEYCACHE_DBUG_ASSERT(0); - /* No parallel requests in single-threaded case */ -#endif } #if defined(PAGECACHE_DEBUG) cnt++; @@ -4579,12 +4486,10 @@ restart: } } } -#ifdef THREAD /* wake up others waiting to flush this file */ my_hash_delete(&pagecache->files_in_flush, (uchar *)&us_flusher); if (us_flusher.flush_queue.last_thread) wqueue_release_queue(&us_flusher.flush_queue); -#endif } #ifndef DBUG_OFF @@ -4716,7 +4621,6 @@ my_bool pagecache_collect_changed_blocks_with_lsn(PAGECACHE *pagecache, of memory at most. */ mysql_mutex_lock(&pagecache->cache_lock); -#ifdef THREAD for (;;) { struct st_file_in_flush *other_flusher; @@ -4751,7 +4655,6 @@ my_bool pagecache_collect_changed_blocks_with_lsn(PAGECACHE *pagecache, while (thread->next); } } -#endif /* Count how many dirty pages are interesting */ for (file_hash= 0; file_hash < PAGECACHE_CHANGED_BLOCKS_HASH; file_hash++) diff --git a/storage/maria/ma_sort.c b/storage/maria/ma_sort.c index c994f19d309..c40e4ed6fed 100644 --- a/storage/maria/ma_sort.c +++ b/storage/maria/ma_sort.c @@ -313,7 +313,6 @@ static ha_rows find_all_keys(MARIA_SORT_PARAM *info, uint keys, } /* find_all_keys */ -#ifdef THREAD /* Search after all keys and place them in a temp. file */ pthread_handler_t _ma_thr_find_all_keys(void *arg) @@ -657,7 +656,6 @@ int _ma_thr_write_keys(MARIA_SORT_PARAM *sort_param) my_free(mergebuf); DBUG_RETURN(got_error); } -#endif /* THREAD */ /* Write all keys in memory to file for later merge */ diff --git a/storage/maria/ma_static.c b/storage/maria/ma_static.c index 8c572b45547..ea911ac4a8a 100644 --- a/storage/maria/ma_static.c +++ b/storage/maria/ma_static.c @@ -39,10 +39,10 @@ my_bool maria_inited= FALSE; my_bool maria_in_ha_maria= FALSE; /* If used from ha_maria or not */ my_bool maria_recovery_changed_data= 0, maria_recovery_verbose= 0; pthread_mutex_t THR_LOCK_maria; -#if defined(THREAD) && !defined(DONT_USE_RW_LOCKS) -ulong maria_concurrent_insert= 2; -#else +#ifdef DONT_USE_RW_LOCKS ulong maria_concurrent_insert= 0; +#else +ulong maria_concurrent_insert= 2; #endif my_off_t maria_max_temp_length= MAX_FILE_SIZE; ulong maria_bulk_insert_tree_size=8192*1024; diff --git a/storage/maria/ma_statrec.c b/storage/maria/ma_statrec.c index 9e01e5d062a..e085821b9d0 100644 --- a/storage/maria/ma_statrec.c +++ b/storage/maria/ma_statrec.c @@ -116,9 +116,6 @@ my_bool _ma_cmp_static_record(register MARIA_HA *info, { DBUG_ENTER("_ma_cmp_static_record"); - /* We are going to do changes; dont let anybody disturb */ - dont_break(); /* Dont allow SIGHUP or SIGINT */ - if (info->opt_flag & WRITE_CACHE_USED) { if (flush_io_cache(&info->rec_cache)) diff --git a/storage/maria/ma_test1.c b/storage/maria/ma_test1.c index 90c9b4a9c7f..cb83116a7cd 100644 --- a/storage/maria/ma_test1.c +++ b/storage/maria/ma_test1.c @@ -70,7 +70,7 @@ extern int _ma_flush_table_files(MARIA_HA *info, uint flush_data_or_index, int main(int argc,char *argv[]) { -#if defined(SAFE_MUTEX) && defined(THREAD) +#ifdef SAFE_MUTEX safe_mutex_deadlock_detector= 1; #endif MY_INIT(argv[0]); diff --git a/storage/maria/ma_test2.c b/storage/maria/ma_test2.c index 25684bdb61c..5fa27d331ba 100644 --- a/storage/maria/ma_test2.c +++ b/storage/maria/ma_test2.c @@ -73,7 +73,7 @@ int main(int argc, char *argv[]) char *blob_buffer; MARIA_CREATE_INFO create_info; -#if defined(SAFE_MUTEX) && defined(THREAD) +#ifdef SAFE_MUTEX safe_mutex_deadlock_detector= 1; #endif MY_INIT(argv[0]); diff --git a/storage/maria/ma_update.c b/storage/maria/ma_update.c index 31459d8587a..4051da022c0 100644 --- a/storage/maria/ma_update.c +++ b/storage/maria/ma_update.c @@ -186,7 +186,6 @@ int maria_update(register MARIA_HA *info, const uchar *oldrec, uchar *newrec) there is no index change there could be data change. */ _ma_writeinfo(info, WRITEINFO_UPDATE_KEYFILE); - allow_break(); /* Allow SIGHUP & SIGINT */ if (info->invalidator != 0) { DBUG_PRINT("info", ("invalidator... '%s' (update)", @@ -243,7 +242,6 @@ err: err_end: _ma_writeinfo(info, WRITEINFO_UPDATE_KEYFILE); - allow_break(); /* Allow SIGHUP & SIGINT */ if (save_errno == HA_ERR_KEY_NOT_FOUND) { maria_print_error(share, HA_ERR_CRASHED); diff --git a/storage/maria/ma_write.c b/storage/maria/ma_write.c index 9af17e14978..b52c00ec91a 100644 --- a/storage/maria/ma_write.c +++ b/storage/maria/ma_write.c @@ -108,7 +108,6 @@ int maria_write(MARIA_HA *info, uchar *record) } if (_ma_readinfo(info,F_WRLCK,1)) DBUG_RETURN(my_errno); - dont_break(); /* Dont allow SIGHUP or SIGINT */ if (share->base.reloc == (ha_rows) 1 && share->base.records == (ha_rows) 1 && @@ -314,7 +313,6 @@ int maria_write(MARIA_HA *info, uchar *record) if (share->is_log_table) _ma_update_status((void*) info); - allow_break(); /* Allow SIGHUP & SIGINT */ DBUG_RETURN(0); err: @@ -400,7 +398,6 @@ err2: save_errno= HA_ERR_INTERNAL_ERROR; /* Should never happen */ DBUG_PRINT("error", ("got error: %d", save_errno)); _ma_writeinfo(info,WRITEINFO_UPDATE_KEYFILE); - allow_break(); /* Allow SIGHUP & SIGINT */ DBUG_RETURN(my_errno=save_errno); } /* maria_write */ diff --git a/storage/maria/maria_def.h b/storage/maria/maria_def.h index e1ebde515dd..aa8af02ca17 100644 --- a/storage/maria/maria_def.h +++ b/storage/maria/maria_def.h @@ -19,12 +19,8 @@ #include <myisampack.h> /* packing of keys */ #include <my_tree.h> #include <my_bitmap.h> -#ifdef THREAD #include <my_pthread.h> #include <thr_lock.h> -#else -#include <my_no_pthread.h> -#endif #include <hash.h> #include "ma_loghandler.h" #include "ma_control_file.h" @@ -250,10 +246,8 @@ typedef struct st_maria_file_bitmap uint non_flushable; /**< 0 if bitmap and log are in sync */ PAGECACHE_FILE file; /* datafile where bitmap is stored */ -#ifdef THREAD pthread_mutex_t bitmap_lock; pthread_cond_t bitmap_cond; /**< When bitmap becomes flushable */ -#endif /* Constants, allocated when initiating bitmaps */ uint sizes[8]; /* Size per bit combination */ uint total_size; /* Total usable size of bitmap page */ @@ -394,7 +388,6 @@ typedef struct st_maria_share my_bool have_versioning; my_bool key_del_used; /* != 0 if key_del is locked */ my_bool deleting; /* we are going to delete this table */ -#ifdef THREAD THR_LOCK lock; void (*lock_restore_status)(void *); /** @@ -411,7 +404,6 @@ typedef struct st_maria_share intern_lock, lock them in this order. */ pthread_mutex_t close_lock; -#endif my_off_t mmaped_length; uint nonmmaped_inserts; /* counter of writing in non-mmaped area */ @@ -482,8 +474,6 @@ typedef struct st_maria_block_scan MARIA_RECORD_POS row_base_page; } MARIA_BLOCK_SCAN; -typedef ICP_RESULT (*index_cond_func_t)(void *param); - struct st_maria_handler { MARIA_SHARE *s; /* Shared between open:s */ @@ -577,12 +567,10 @@ struct st_maria_handler my_bool once_flags; /* For MARIA_MRG */ /* For bulk insert enable/disable transactions control */ my_bool switched_transactional; -#ifdef __WIN__ +#ifdef _WIN32 my_bool owned_by_merge; /* This Maria table is part of a merge union */ #endif -#ifdef THREAD THR_LOCK_DATA lock; -#endif uchar *maria_rtree_recursion_state; /* For RTREE */ uchar length_buff[5]; /* temp buff to store blob lengths */ int maria_rtree_recursion_depth; @@ -776,10 +764,8 @@ struct st_maria_handler #define MARIA_UNIQUE_HASH_TYPE HA_KEYTYPE_ULONG_INT #define maria_unique_store(A,B) mi_int4store((A),(B)) -#ifdef THREAD extern pthread_mutex_t THR_LOCK_maria; -#endif -#if !defined(THREAD) || defined(DONT_USE_RW_LOCKS) +#ifdef DONT_USE_RW_LOCKS #define rw_wrlock(A) {} #define rw_rdlock(A) {} #define rw_unlock(A) {} @@ -1200,9 +1186,7 @@ C_MODE_END int _ma_flush_pending_blocks(MARIA_SORT_PARAM *param); int _ma_sort_ft_buf_flush(MARIA_SORT_PARAM *sort_param); int _ma_thr_write_keys(MARIA_SORT_PARAM *sort_param); -#ifdef THREAD pthread_handler_t _ma_thr_find_all_keys(void *arg); -#endif int _ma_sort_write_record(MARIA_SORT_PARAM *sort_param); int _ma_create_index_by_sort(MARIA_SORT_PARAM *info, my_bool no_messages, diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index 3121deb66e4..bc43d9631ab 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -138,7 +138,7 @@ static void mi_check_print_msg(HA_CHECK *param, const char* msg_type, THD* thd = (THD*)param->thd; Protocol *protocol= thd->protocol; size_t length, msg_length; - char msgbuf[HA_MAX_MSG_BUF]; + char msgbuf[MYSQL_ERRMSG_SIZE]; char name[NAME_LEN*2+2]; msg_length= my_vsnprintf(msgbuf, sizeof(msgbuf), fmt, args); @@ -1846,17 +1846,6 @@ int ha_myisam::delete_all_rows() } -/* - Intended to support partitioning. - Allows a particular partition to be truncated. -*/ - -int ha_myisam::truncate() -{ - int error= delete_all_rows(); - return error ? error : reset_auto_increment(0); -} - int ha_myisam::reset_auto_increment(ulonglong value) { file->s->state.auto_increment= value; diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h index b5415bb0dc7..b1916881dab 100644 --- a/storage/myisam/ha_myisam.h +++ b/storage/myisam/ha_myisam.h @@ -71,6 +71,7 @@ class ha_myisam: public handler HA_READ_ORDER | HA_KEYREAD_ONLY | HA_DO_INDEX_COND_PUSHDOWN); } uint max_supported_keys() const { return MI_MAX_KEY; } + uint max_supported_key_parts() const { return HA_MAX_KEY_SEG; } uint max_supported_key_length() const { return HA_MAX_KEY_LENGTH; } uint max_supported_key_part_length() const { return HA_MAX_KEY_LENGTH; } uint checksum() const; @@ -116,7 +117,6 @@ class ha_myisam: public handler int reset(void); int external_lock(THD *thd, int lock_type); int delete_all_rows(void); - int truncate(); int reset_auto_increment(ulonglong value); int disable_indexes(uint mode); int enable_indexes(uint mode); diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index daae02e6846..e86c5a7c0fb 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -79,8 +79,7 @@ static int sort_delete_record(MI_SORT_PARAM *sort_param); static SORT_KEY_BLOCKS *alloc_key_blocks(HA_CHECK *param, uint blocks, uint buffer_length); static ha_checksum mi_byte_checksum(const uchar *buf, uint length); -static void set_data_file_type(SORT_INFO *sort_info, MYISAM_SHARE *share); -static HA_KEYSEG *ha_find_null(HA_KEYSEG *keyseg, uchar *a); +static void set_data_file_type(MI_SORT_INFO *sort_info, MYISAM_SHARE *share); void myisamchk_init(HA_CHECK *param) { diff --git a/storage/myisam/myisamchk.c b/storage/myisam/myisamchk.c index e932234a998..79c4ef03a56 100644 --- a/storage/myisam/myisamchk.c +++ b/storage/myisam/myisamchk.c @@ -670,7 +670,7 @@ get_one_option(int optid, case OPT_STATS_METHOD: { int method; - enum_mi_stats_method UNINIT_VAR(method_conv); + enum_handler_stats_method UNINIT_VAR(method_conv); myisam_stats_method_str= argument; if ((method= find_type(argument, &myisam_stats_method_typelib, FIND_TYPE_BASIC)) <= 0) diff --git a/storage/myisam/myisamdef.h b/storage/myisam/myisamdef.h index 3f82d96b88b..e400089b881 100644 --- a/storage/myisam/myisamdef.h +++ b/storage/myisam/myisamdef.h @@ -225,8 +225,6 @@ typedef struct st_mi_isam_share mysql_rwlock_t mmap_lock; } MYISAM_SHARE; -typedef ICP_RESULT (*index_cond_func_t)(void *param); - struct st_myisam_info { MYISAM_SHARE *s; /* Shared between open:s */ diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc index 22b4794dbde..1f89aa5fd23 100644 --- a/storage/myisammrg/ha_myisammrg.cc +++ b/storage/myisammrg/ha_myisammrg.cc @@ -1227,11 +1227,11 @@ ha_rows ha_myisammrg::records_in_range(uint inx, key_range *min_key, } -int ha_myisammrg::truncate() +int ha_myisammrg::delete_all_rows() { int err= 0; MYRG_TABLE *table; - DBUG_ENTER("ha_myisammrg::truncate"); + DBUG_ENTER("ha_myisammrg::delete_all_rows"); for (table= file->open_tables; table != file->end_table; table++) { diff --git a/storage/myisammrg/ha_myisammrg.h b/storage/myisammrg/ha_myisammrg.h index 14734eed064..735c7ff53be 100644 --- a/storage/myisammrg/ha_myisammrg.h +++ b/storage/myisammrg/ha_myisammrg.h @@ -131,7 +131,7 @@ public: int rnd_pos(uchar * buf, uchar *pos); void position(const uchar *record); ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key); - int truncate(); + int delete_all_rows(); int info(uint); int reset(void); int extra(enum ha_extra_function operation); diff --git a/storage/oqgraph/CMakeLists.txt b/storage/oqgraph/CMakeLists.txt index 31016ba47b8..34aaafb6fcc 100644 --- a/storage/oqgraph/CMakeLists.txt +++ b/storage/oqgraph/CMakeLists.txt @@ -14,6 +14,7 @@ IF(BOOST_OK) IF(CMAKE_CXX_FLAGS)
STRING(REPLACE "-fno-exceptions" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
ENDIF()
MYSQL_ADD_PLUGIN(oqgraph ha_oqgraph.cc graphcore.cc STORAGE_ENGINE)
diff --git a/storage/pbxt/src/discover_xt.cc b/storage/pbxt/src/discover_xt.cc index ee52c182a73..05891bdf19d 100644 --- a/storage/pbxt/src/discover_xt.cc +++ b/storage/pbxt/src/discover_xt.cc @@ -1493,7 +1493,8 @@ static bool mysql_create_table_no_lock(THD *thd, if (create_info->options & HA_LEX_CREATE_TMP_TABLE) { /* Open table and put in temporary table list */ - if (!(open_temporary_table(thd, path, db, table_name, 1))) + TABLE *table= open_table_uncached(thd, path, db, table_name, TRUE); + if (!table) { (void) rm_temporary_table(create_info->db_type, path); goto unlock_and_end; diff --git a/storage/pbxt/src/ha_pbxt.cc b/storage/pbxt/src/ha_pbxt.cc index 0746958bf4c..5b9e30a9213 100644 --- a/storage/pbxt/src/ha_pbxt.cc +++ b/storage/pbxt/src/ha_pbxt.cc @@ -5819,7 +5819,7 @@ int ha_pbxt::get_foreign_key_list(THD *thd, List<FOREIGN_KEY_INFO> *f_key_list) ref_tbl_name++; ref_db_name++; - fk_info->forein_id = thd_make_lex_string(thd, 0, + fk_info->foreign_id = thd_make_lex_string(thd, 0, fk->co_name, (uint) strlen(fk->co_name), 1); fk_info->referenced_db = thd_make_lex_string(thd, 0, diff --git a/storage/pbxt/src/myxt_xt.cc b/storage/pbxt/src/myxt_xt.cc index d36f7334cfd..7fd94aeaef7 100644 --- a/storage/pbxt/src/myxt_xt.cc +++ b/storage/pbxt/src/myxt_xt.cc @@ -2062,11 +2062,7 @@ static TABLE *my_open_table(XTThreadPtr self, XTDatabaseHPtr XT_UNUSED(db), XTPa return NULL; } -#if MYSQL_VERSION_ID >= 50404 - if ((error = open_table_from_share(thd, share, "", 0, (uint) READ_ALL, 0, table, OTM_OPEN))) -#else if ((error = open_table_from_share(thd, share, "", 0, (uint) READ_ALL, 0, table, FALSE))) -#endif { xt_free(self, table); lex_end(&new_lex); diff --git a/storage/perfschema/ha_perfschema.cc b/storage/perfschema/ha_perfschema.cc index ec063b782c1..2113a28d4f8 100644 --- a/storage/perfschema/ha_perfschema.cc +++ b/storage/perfschema/ha_perfschema.cc @@ -361,11 +361,6 @@ int ha_perfschema::delete_all_rows(void) DBUG_RETURN(result); } -int ha_perfschema::truncate() -{ - return delete_all_rows(); -} - THR_LOCK_DATA **ha_perfschema::store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type) diff --git a/storage/perfschema/ha_perfschema.h b/storage/perfschema/ha_perfschema.h index c0ee0827dbc..9557bc25b6e 100644 --- a/storage/perfschema/ha_perfschema.h +++ b/storage/perfschema/ha_perfschema.h @@ -124,8 +124,6 @@ public: int delete_all_rows(void); - int truncate(); - int delete_table(const char *from); int rename_table(const char * from, const char * to); diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c index 8d864dfaad5..14dcacdbd60 100644 --- a/strings/ctype-mb.c +++ b/strings/ctype-mb.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -683,6 +684,7 @@ my_bool my_like_range_mb(CHARSET_INFO *cs, char *min_end= min_str + res_length; char *max_end= max_str + res_length; size_t maxcharlen= res_length / cs->mbmaxlen; + my_bool have_contractions= my_cs_have_contractions(cs); for (; ptr != end && min_str != min_end && maxcharlen ; maxcharlen--) { @@ -750,8 +752,8 @@ fill_max_and_min: 'ab\min\min\min\min' and 'ab\max\max\max\max'. */ - if (contraction_flags && ptr + 1 < end && - contraction_flags[(uchar) *ptr]) + if (have_contractions && ptr + 1 < end && + my_cs_can_be_contraction_head(cs, (uchar) *ptr)) { /* Ptr[0] is a contraction head. */ @@ -773,8 +775,8 @@ fill_max_and_min: is not a contraction, then we put only ptr[0], and continue with ptr[1] on the next loop. */ - if (contraction_flags[(uchar) ptr[1]] && - cs->contractions[(*ptr-0x40)*0x40 + ptr[1] - 0x40]) + if (my_cs_can_be_contraction_tail(cs, (uchar) ptr[1]) && + my_cs_contraction2_weight(cs, (uchar) ptr[0], (uchar) ptr[1])) { /* Contraction found */ if (maxcharlen == 1 || min_str + 1 >= min_end) @@ -911,7 +913,7 @@ my_like_range_generic(CHARSET_INFO *cs, my_cs_can_be_contraction_head(cs, wc) && (res= cs->cset->mb_wc(cs, &wc2, (uchar*) ptr, (uchar*) end)) > 0) { - uint16 *weight; + const uint16 *weight; if ((wc2 == (my_wc_t) w_one || wc2 == (my_wc_t) w_many)) { /* Contraction head followed by a wildcard */ diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index a8b12e13e39..4a77728b227 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -31,10 +32,15 @@ - No combining marks processing is done */ + #include <my_global.h> #include "m_string.h" #include "m_ctype.h" +#define MY_UCA_CNT_FLAG_SIZE 4096 +#define MY_UCA_CNT_FLAG_MASK 4095 +#define MY_UCA_CNT_HEAD 1 +#define MY_UCA_CNT_TAIL 2 #ifdef HAVE_UCA_COLLATIONS @@ -6454,7 +6460,6 @@ static const uchar uca_length[256]={ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,3,3,4,3,9,3,3 }; - static const uint16 *const uca_weight[256]={ page000data,page001data,page002data,page003data, page004data,page005data,page006data,page007data, @@ -6765,7 +6770,7 @@ typedef struct my_uca_scanner_st const uchar *send; /* End of the input string */ const uchar *uca_length; const uint16 * const *uca_weight; - uint16 *contractions; + const MY_CONTRACTIONS *contractions; uint16 implicit[2]; int page; int code; @@ -6785,6 +6790,80 @@ typedef struct my_uca_scanner_handler_st static const uint16 nochar[]= {0,0}; +/********** Helper functions to handle contraction ************/ + + +/** + Mark a character as a contraction part + + @cs Pointer to CHARSET_INFO data + @wc Unicode code point + @flag flag: "is contraction head", "is contraction tail" +*/ + +static void +my_uca_add_contraction_flag(CHARSET_INFO *cs, my_wc_t wc, int flag) +{ + cs->contractions->flags[wc & MY_UCA_CNT_FLAG_MASK]|= flag; +} + + +/** + Add a new contraction into contraction list + + @cs Pointer to CHARSET_INFO data + @wc Unicode code points of the characters + @len Number of characters + + @return New contraction + @retval Pointer to a newly added contraction +*/ + +static MY_CONTRACTION * +my_uca_add_contraction(struct charset_info_st *cs, + my_wc_t *wc, int len __attribute__((unused))) +{ + MY_CONTRACTIONS *list= (MY_CONTRACTIONS*) cs->contractions; + MY_CONTRACTION *next= &list->item[list->nitems]; + DBUG_ASSERT(len == 2); /* We currently support only contraction2 */ + next->ch[0]= wc[0]; + next->ch[1]= wc[1]; + list->nitems++; + return next; +} + + +/** + Allocate and initialize memory for contraction list and flags + + @cs Pointer to CHARSET_INFO data + @alloc Memory allocation function (typically points to my_alloc_once) + @n Number of contractions + + @return Error code + @retval 0 - memory allocated successfully + @retval 1 - not enough memory +*/ + +static my_bool +my_uca_alloc_contractions(struct charset_info_st *cs, + void *(*alloc)(size_t), size_t n) +{ + uint size= n * sizeof(MY_CONTRACTION); + MY_CONTRACTIONS *contractions; + + if (!(cs->contractions= contractions= (*alloc)(sizeof(MY_CONTRACTIONS)))) + return 1; + bzero(contractions, sizeof(MY_CONTRACTIONS)); + if (!(contractions->item= (*alloc)(size)) || + !(contractions->flags= (char*) (*alloc)(MY_UCA_CNT_FLAG_SIZE))) + return 1; + bzero(contractions->item, size); + bzero(contractions->flags, MY_UCA_CNT_FLAG_SIZE); + return 0; +} + + #ifdef HAVE_CHARSET_ucs2 /* Initialize collation weight scanner @@ -6804,7 +6883,7 @@ static const uint16 nochar[]= {0,0}; */ static void my_uca_scanner_init_ucs2(my_uca_scanner *scanner, - CHARSET_INFO *cs __attribute__((unused)), + CHARSET_INFO *cs, const uchar *str, size_t length) { scanner->wbeg= nochar; @@ -6815,6 +6894,7 @@ static void my_uca_scanner_init_ucs2(my_uca_scanner *scanner, scanner->uca_length= cs->sort_order; scanner->uca_weight= cs->sort_order_big; scanner->contractions= cs->contractions; + scanner->cs= cs; return; } @@ -6903,18 +6983,23 @@ static int my_uca_scanner_next_ucs2(my_uca_scanner *scanner) if (scanner->contractions && (scanner->sbeg <= scanner->send)) { - int cweight; + my_wc_t wc1= ((scanner->page << 8) | scanner->code); - if (!scanner->page && !scanner->sbeg[0] && - (scanner->sbeg[1] > 0x40) && (scanner->sbeg[1] < 0x80) && - (scanner->code > 0x40) && (scanner->code < 0x80) && - (cweight= scanner->contractions[(scanner->code-0x40)*0x40+scanner->sbeg[1]-0x40])) + if (my_cs_can_be_contraction_head(scanner->cs, wc1)) + { + const uint16 *cweight; + my_wc_t wc2= (((my_wc_t) scanner->sbeg[0]) << 8) | scanner->sbeg[1]; + if (my_cs_can_be_contraction_tail(scanner->cs, wc2) && + (cweight= my_cs_contraction2_weight(scanner->cs, + scanner->code, + scanner->sbeg[1]))) { scanner->implicit[0]= 0; scanner->wbeg= scanner->implicit; scanner->sbeg+=2; - return cweight; + return *cweight; } + } } if (!ucaw[scanner->page]) @@ -7006,23 +7091,22 @@ static int my_uca_scanner_next_any(my_uca_scanner *scanner) scanner->code= wc & 0xFF; } - if (scanner->contractions && !scanner->page && - (scanner->code > 0x40) && (scanner->code < 0x80)) + if (my_cs_have_contractions(scanner->cs) && + my_cs_can_be_contraction_head(scanner->cs, wc)) { - uint page1, code1, cweight; + my_wc_t wc2; + const uint16 *cweight; - if (((mb_len= scanner->cs->cset->mb_wc(scanner->cs, &wc, + if (((mb_len= scanner->cs->cset->mb_wc(scanner->cs, &wc2, scanner->sbeg, scanner->send)) >=0) && - (!(page1= (wc >> 8))) && - ((code1= (wc & 0xFF)) > 0x40) && - (code1 < 0x80) && - (cweight= scanner->contractions[(scanner->code-0x40)*0x40 + code1-0x40])) + my_cs_can_be_contraction_tail(scanner->cs, wc2) && + (cweight= my_cs_contraction2_weight(scanner->cs, wc, wc2))) { scanner->implicit[0]= 0; scanner->wbeg= scanner->implicit; scanner->sbeg+= mb_len; - return cweight; + return *cweight; } } @@ -7060,6 +7144,29 @@ static my_uca_scanner_handler my_any_uca_scanner_handler= }; +/** + Helper function: + Find address of weights of the given character. + + @weights UCA weight array + @lengths UCA length array + @ch character Unicode code point + + @return Weight array + @retval pointer to weight array for the given character, + or NULL if this page does not have implicit weights. +*/ + +static inline const uint16 * +my_char_weight_addr(CHARSET_INFO *cs, uint wc) +{ + uint page= (wc >> 8); + uint ofst= wc & 0xFF; + return (cs->sort_order_big[page] ? + cs->sort_order_big[page] + ofst * cs->sort_order[page] : + 0); +} + /* Compares two strings according to the collation @@ -7737,8 +7844,8 @@ ex: typedef struct my_coll_rule_item_st { - uint base; /* Base character */ - uint curr[2]; /* Current character */ + my_wc_t base; /* Base character */ + my_wc_t curr[2]; /* Current character */ int diff[3]; /* Primary, Secondary and Tertiary difference */ } MY_COLL_RULE; @@ -7893,6 +8000,7 @@ static my_bool create_tailoring(struct charset_info_st *cs, void *(*alloc)(size_t)) { MY_COLL_RULE rule[MY_MAX_COLL_RULE]; + MY_COLL_RULE *r, *rfirst, *rlast; char errstr[128]; uchar *newlengths; uint16 **newweights; @@ -7917,6 +8025,9 @@ static my_bool create_tailoring(struct charset_info_st *cs, return 1; } + rfirst= rule; + rlast= rule + rc; + if (!cs->caseinfo) cs->caseinfo= my_unicase_default; @@ -8000,44 +8111,21 @@ static my_bool create_tailoring(struct charset_info_st *cs, /* Now process contractions */ if (ncontractions) { - /* - 8K for weights for basic latin letter pairs, - plus 256 bytes for "is contraction part" flags. - */ - uint size= 0x40*0x40*sizeof(uint16) + 256; - char *contraction_flags; - if (!(cs->contractions= (uint16*) (*alloc)(size))) - return 1; - bzero((void*)cs->contractions, size); - contraction_flags= ((char*) cs->contractions) + 0x40*0x40; - for (i=0; i < rc; i++) + if (my_uca_alloc_contractions(cs, alloc, ncontractions)) + return 1; + for (r= rfirst; r < rlast; r++) { - if (rule[i].curr[1]) + uint16 *to; + if (r->curr[1]) /* Contraction */ { - uint pageb= (rule[i].base >> 8) & 0xFF; - uint chb= rule[i].base & 0xFF; - uint16 *offsb= defweights[pageb] + chb*deflengths[pageb]; - uint offsc; - - if (offsb[1] || - rule[i].curr[0] < 0x40 || rule[i].curr[0] > 0x7f || - rule[i].curr[1] < 0x40 || rule[i].curr[1] > 0x7f) - { - /* - TODO: add error reporting; - We support only basic latin letters contractions at this point. - Also, We don't support contractions with weight longer than one. - Otherwise, we'd need much more memory. - */ - return 1; - } - offsc= (rule[i].curr[0]-0x40)*0x40+(rule[i].curr[1]-0x40); - - /* Copy base weight applying primary difference */ - cs->contractions[offsc]= offsb[0] + rule[i].diff[0]; - /* Mark both letters as "is contraction part */ - contraction_flags[rule[i].curr[0]]= 1; - contraction_flags[rule[i].curr[1]]= 1; + /* Mark both letters as "is contraction part" */ + my_uca_add_contraction_flag(cs, r->curr[0], MY_UCA_CNT_HEAD); + my_uca_add_contraction_flag(cs, r->curr[1], MY_UCA_CNT_TAIL); + to= my_uca_add_contraction(cs, r->curr, 2)->weight; + /* Copy weight from the reset character */ + to[0]= my_char_weight_addr(cs, r->base)[0]; + /* Apply primary difference */ + to[0]+= r->diff[0]; } } } @@ -8763,7 +8851,7 @@ struct charset_info_st my_charset_ucs2_hungarian_uca_ci= struct charset_info_st my_charset_ucs2_sinhala_uca_ci= { 147,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "ucs2", /* csname */ "ucs2_sinhala_ci", /* name */ "", /* comment */ @@ -8795,7 +8883,7 @@ struct charset_info_st my_charset_ucs2_sinhala_uca_ci= struct charset_info_st my_charset_ucs2_croatian_uca_ci= { 149,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, "ucs2", /* cs name */ "ucs2_croatian_ci", /* name */ "", /* comment */ @@ -8874,7 +8962,7 @@ extern MY_CHARSET_HANDLER my_charset_utf8_handler; struct charset_info_st my_charset_utf8_unicode_ci= { 192,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, "utf8", /* cs name */ "utf8_unicode_ci", /* name */ "", /* comment */ @@ -8907,7 +8995,7 @@ struct charset_info_st my_charset_utf8_unicode_ci= struct charset_info_st my_charset_utf8_icelandic_uca_ci= { 193,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, "utf8", /* cs name */ "utf8_icelandic_ci",/* name */ "", /* comment */ @@ -8939,7 +9027,7 @@ struct charset_info_st my_charset_utf8_icelandic_uca_ci= struct charset_info_st my_charset_utf8_latvian_uca_ci= { 194,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, "utf8", /* cs name */ "utf8_latvian_ci", /* name */ "", /* comment */ @@ -8971,7 +9059,7 @@ struct charset_info_st my_charset_utf8_latvian_uca_ci= struct charset_info_st my_charset_utf8_romanian_uca_ci= { 195,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, "utf8", /* cs name */ "utf8_romanian_ci", /* name */ "", /* comment */ @@ -9003,7 +9091,7 @@ struct charset_info_st my_charset_utf8_romanian_uca_ci= struct charset_info_st my_charset_utf8_slovenian_uca_ci= { 196,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, "utf8", /* cs name */ "utf8_slovenian_ci",/* name */ "", /* comment */ @@ -9035,7 +9123,7 @@ struct charset_info_st my_charset_utf8_slovenian_uca_ci= struct charset_info_st my_charset_utf8_polish_uca_ci= { 197,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, "utf8", /* cs name */ "utf8_polish_ci", /* name */ "", /* comment */ @@ -9067,7 +9155,7 @@ struct charset_info_st my_charset_utf8_polish_uca_ci= struct charset_info_st my_charset_utf8_estonian_uca_ci= { 198,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, "utf8", /* cs name */ "utf8_estonian_ci", /* name */ "", /* comment */ @@ -9099,7 +9187,7 @@ struct charset_info_st my_charset_utf8_estonian_uca_ci= struct charset_info_st my_charset_utf8_spanish_uca_ci= { 199,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, "utf8", /* cs name */ "utf8_spanish_ci", /* name */ "", /* comment */ @@ -9131,7 +9219,7 @@ struct charset_info_st my_charset_utf8_spanish_uca_ci= struct charset_info_st my_charset_utf8_swedish_uca_ci= { 200,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, "utf8", /* cs name */ "utf8_swedish_ci", /* name */ "", /* comment */ @@ -9163,7 +9251,7 @@ struct charset_info_st my_charset_utf8_swedish_uca_ci= struct charset_info_st my_charset_utf8_turkish_uca_ci= { 201,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, "utf8", /* cs name */ "utf8_turkish_ci", /* name */ "", /* comment */ @@ -9195,7 +9283,7 @@ struct charset_info_st my_charset_utf8_turkish_uca_ci= struct charset_info_st my_charset_utf8_czech_uca_ci= { 202,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, "utf8", /* cs name */ "utf8_czech_ci", /* name */ "", /* comment */ @@ -9228,7 +9316,7 @@ struct charset_info_st my_charset_utf8_czech_uca_ci= struct charset_info_st my_charset_utf8_danish_uca_ci= { 203,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, "utf8", /* cs name */ "utf8_danish_ci", /* name */ "", /* comment */ @@ -9260,7 +9348,7 @@ struct charset_info_st my_charset_utf8_danish_uca_ci= struct charset_info_st my_charset_utf8_lithuanian_uca_ci= { 204,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, "utf8", /* cs name */ "utf8_lithuanian_ci",/* name */ "", /* comment */ @@ -9292,7 +9380,7 @@ struct charset_info_st my_charset_utf8_lithuanian_uca_ci= struct charset_info_st my_charset_utf8_slovak_uca_ci= { 205,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, "utf8", /* cs name */ "utf8_slovak_ci", /* name */ "", /* comment */ @@ -9324,7 +9412,7 @@ struct charset_info_st my_charset_utf8_slovak_uca_ci= struct charset_info_st my_charset_utf8_spanish2_uca_ci= { 206,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, "utf8", /* cs name */ "utf8_spanish2_ci", /* name */ "", /* comment */ @@ -9356,7 +9444,7 @@ struct charset_info_st my_charset_utf8_spanish2_uca_ci= struct charset_info_st my_charset_utf8_roman_uca_ci= { 207,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, "utf8", /* cs name */ "utf8_roman_ci", /* name */ "", /* comment */ @@ -9388,7 +9476,7 @@ struct charset_info_st my_charset_utf8_roman_uca_ci= struct charset_info_st my_charset_utf8_persian_uca_ci= { 208,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, "utf8", /* cs name */ "utf8_persian_ci", /* name */ "", /* comment */ @@ -9420,7 +9508,7 @@ struct charset_info_st my_charset_utf8_persian_uca_ci= struct charset_info_st my_charset_utf8_esperanto_uca_ci= { 209,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, "utf8", /* cs name */ "utf8_esperanto_ci",/* name */ "", /* comment */ @@ -9452,7 +9540,7 @@ struct charset_info_st my_charset_utf8_esperanto_uca_ci= struct charset_info_st my_charset_utf8_hungarian_uca_ci= { 210,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONASCII, + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE, "utf8", /* cs name */ "utf8_hungarian_ci",/* name */ "", /* comment */ @@ -11637,7 +11725,7 @@ struct charset_info_st my_charset_utf16_croatian_uca_ci= */ my_bool -my_uca_have_contractions(CHARSET_INFO *cs) +my_cs_have_contractions(CHARSET_INFO *cs) { return cs->contractions != NULL; } @@ -11653,7 +11741,7 @@ my_uca_have_contractions(CHARSET_INFO *cs) */ my_bool -my_uca_can_be_contraction_head(CHARSET_INFO *cs, my_wc_t wc) +my_cs_can_be_contraction_head(CHARSET_INFO *cs, my_wc_t wc) { return cs->contractions->flags[wc & MY_UCA_CNT_FLAG_MASK] & MY_UCA_CNT_HEAD; } @@ -11670,7 +11758,7 @@ my_uca_can_be_contraction_head(CHARSET_INFO *cs, my_wc_t wc) */ my_bool -my_uca_can_be_contraction_tail(CHARSET_INFO *cs, my_wc_t wc) +my_cs_can_be_contraction_tail(CHARSET_INFO *cs, my_wc_t wc) { return cs->contractions->flags[wc & MY_UCA_CNT_FLAG_MASK] & MY_UCA_CNT_TAIL; } @@ -11689,7 +11777,7 @@ my_uca_can_be_contraction_tail(CHARSET_INFO *cs, my_wc_t wc) */ const uint16 * -my_uca_contraction2_weight(CHARSET_INFO *cs, my_wc_t wc1, my_wc_t wc2) +my_cs_contraction2_weight(CHARSET_INFO *cs, my_wc_t wc1, my_wc_t wc2) { const MY_CONTRACTIONS *list= cs->contractions; const MY_CONTRACTION *c, *last; diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index f3943814cb2..0d7cdd01ccc 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -33,7 +33,7 @@ #include <my_getopt.h> #include <m_string.h> #include <mysqld_error.h> -#include <my_handler.h> +#include <my_compare.h> #include <sql_common.h> #include <mysql/client_plugin.h> @@ -2537,7 +2537,7 @@ static void test_prepare() /* now, execute the prepared statement to insert 10 records.. */ for (tiny_data= 0; tiny_data < 100; tiny_data++) { - length[1]= my_sprintf(str_data, (str_data, "MySQL%d", int_data)); + length[1]= sprintf(str_data, "MySQL%d", int_data); rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); int_data += 25; @@ -2576,7 +2576,7 @@ static void test_prepare() /* now, execute the prepared statement to insert 10 records.. */ for (o_tiny_data= 0; o_tiny_data < 100; o_tiny_data++) { - len= my_sprintf(data, (data, "MySQL%d", o_int_data)); + len= sprintf(data, "MySQL%d", o_int_data); rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); @@ -3976,7 +3976,7 @@ static void test_simple_update() my_bind[0].buffer= szData; /* string data */ my_bind[0].buffer_length= sizeof(szData); my_bind[0].length= &length[0]; - length[0]= my_sprintf(szData, (szData, "updated-data")); + length[0]= sprintf(szData, "updated-data"); my_bind[1].buffer= (void *) &nData; my_bind[1].buffer_type= MYSQL_TYPE_LONG; @@ -4230,7 +4230,7 @@ static void test_long_data_str1() rc= mysql_stmt_bind_param(stmt, my_bind); check_execute(stmt, rc); - length= my_sprintf(data, (data, "MySQL AB")); + length= sprintf(data, "MySQL AB"); /* supply data in pieces */ for (i= 0; i < 3; i++) @@ -4545,7 +4545,7 @@ static void test_update() my_bind[0].buffer= szData; my_bind[0].buffer_length= sizeof(szData); my_bind[0].length= &length[0]; - length[0]= my_sprintf(szData, (szData, "inserted-data")); + length[0]= sprintf(szData, "inserted-data"); my_bind[1].buffer= (void *)&nData; my_bind[1].buffer_type= MYSQL_TYPE_LONG; @@ -4574,7 +4574,7 @@ static void test_update() my_bind[0].buffer= szData; my_bind[0].buffer_length= sizeof(szData); my_bind[0].length= &length[0]; - length[0]= my_sprintf(szData, (szData, "updated-data")); + length[0]= sprintf(szData, "updated-data"); my_bind[1].buffer= (void *)&nData; my_bind[1].buffer_type= MYSQL_TYPE_LONG; @@ -5143,7 +5143,7 @@ static void bind_fetch(int row_count) /* CHAR */ { char buff[20]; - long len= my_sprintf(buff, (buff, "%d", rc)); + long len= sprintf(buff, "%d", rc); DIE_UNLESS(strcmp(s_data, buff) == 0); DIE_UNLESS(length[6] == (ulong) len); } @@ -5736,7 +5736,7 @@ static void test_insert() /* now, execute the prepared statement to insert 10 records.. */ for (tiny_data= 0; tiny_data < 3; tiny_data++) { - length= my_sprintf(str_data, (str_data, "MySQL%d", tiny_data)); + length= sprintf(str_data, "MySQL%d", tiny_data); rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); } @@ -18209,7 +18209,7 @@ static void test_wl4166_1() /* now, execute the prepared statement to insert 10 records.. */ for (tiny_data= 0; tiny_data < 10; tiny_data++) { - length[1]= my_sprintf(str_data, (str_data, "MySQL%d", int_data)); + length[1]= sprintf(str_data, "MySQL%d", int_data); rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); int_data += 25; @@ -18232,7 +18232,7 @@ static void test_wl4166_1() for (tiny_data= 50; tiny_data < 60; tiny_data++) { - length[1]= my_sprintf(str_data, (str_data, "MySQL%d", int_data)); + length[1]= sprintf(str_data, "MySQL%d", int_data); rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); int_data += 25; @@ -19352,7 +19352,7 @@ static void test_bug47485() static void test_bug58036() { MYSQL *conn; - DBUG_ENTER("test_bug47485"); + DBUG_ENTER("test_bug58036"); myheader("test_bug58036"); /* Part1: try to connect with ucs2 client character set */ diff --git a/vio/viossl.c b/vio/viossl.c index ab1f217748d..356fca40d13 100644 --- a/vio/viossl.c +++ b/vio/viossl.c @@ -161,8 +161,6 @@ static int ssl_do(struct st_VioSSLFd *ptr, Vio *vio, long timeout, DBUG_PRINT("enter", ("ptr: 0x%lx, sd: %d ctx: 0x%lx", (long) ptr, vio->sd, (long) ptr->ssl_context)); - error_string[0]= 0; - /* Set socket to blocking if not already set */ vio_blocking(vio, 1, &was_blocking); |