diff options
251 files changed, 2255 insertions, 939 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index 3cbe8859842..f4c10c59155 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -3208,7 +3208,7 @@ static int com_go(String *buffer,char *line __attribute__((unused))) { char buff[200]; /* about 110 chars used so far */ - char time_buff[53+3+1]; /* time max + space&parens + NUL */ + char time_buff[53+3+1]; /* time max + space & parens + NUL */ MYSQL_RES *result; ulonglong timer; ulong warnings= 0; @@ -3228,7 +3228,7 @@ com_go(String *buffer,char *line __attribute__((unused))) if (buffer->is_empty()) { - if (status.batch) // Ignore empty quries + if (status.batch) // Ignore empty queries. return 0; return put_info("No query specified\n",INFO_ERROR); @@ -3293,7 +3293,7 @@ com_go(String *buffer,char *line __attribute__((unused))) else time_buff[0]= '\0'; - /* Every branch must truncate buff . */ + /* Every branch must truncate buff. */ if (result) { if (!mysql_num_rows(result) && ! quick && !column_types_flag) diff --git a/client/mysqldump.c b/client/mysqldump.c index 3c95e282246..c9e95dc74ee 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -4538,7 +4538,7 @@ static int dump_databases(char **db_names) /* -View Specific database initalization. +View Specific database initialization. SYNOPSIS init_dumping_views @@ -4555,7 +4555,7 @@ int init_dumping_views(char *qdatabase __attribute__((unused))) /* -Table Specific database initalization. +Table Specific database initialization. SYNOPSIS init_dumping_tables diff --git a/dbug/dbug.c b/dbug/dbug.c index b99a8c79d0c..46510fff224 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -324,8 +324,36 @@ static void DbugVfprintf(FILE *stream, const char* format, va_list args); */ #include <my_pthread.h> +/* +** Protects writing to all file descriptors, init_settings.keywords +** pointer and it's pointee - a linked list with keywords. +*/ static pthread_mutex_t THR_LOCK_dbug; +static void LockMutex(CODE_STATE *cs) +{ + if (!cs->locked) + pthread_mutex_lock(&THR_LOCK_dbug); + cs->locked++; +} +static void UnlockMutex(CODE_STATE *cs) +{ + --cs->locked; + assert(cs->locked >= 0); + if (cs->locked == 0) + pthread_mutex_unlock(&THR_LOCK_dbug); +} +static void LockIfInitSettings(CODE_STATE *cs) +{ + if (cs->stack == &init_settings) + LockMutex(cs); +} +static void UnlockIfInitSettings(CODE_STATE *cs) +{ + if (cs->stack == &init_settings) + UnlockMutex(cs); +} + static CODE_STATE *code_state(void) { CODE_STATE *cs, **cs_ptr; @@ -453,16 +481,9 @@ static int DbugParse(CODE_STATE *cs, const char *control) const char *end; int rel, f_used=0; struct settings *stack; - int org_cs_locked; stack= cs->stack; - if (!(org_cs_locked= cs->locked)) - { - pthread_mutex_lock(&THR_LOCK_dbug); - cs->locked= 1; - } - if (control[0] == '-' && control[1] == '#') control+=2; @@ -476,7 +497,9 @@ static int DbugParse(CODE_STATE *cs, const char *control) stack->sub_level= 0; stack->out_file= sstderr; stack->functions= NULL; + LockIfInitSettings(cs); stack->keywords= NULL; + UnlockIfInitSettings(cs); stack->processes= NULL; } else if (!stack->out_file) @@ -492,7 +515,9 @@ static int DbugParse(CODE_STATE *cs, const char *control) { /* never share with the global parent - it can change under your feet */ stack->functions= ListCopy(init_settings.functions); + LockIfInitSettings(cs); stack->keywords= ListCopy(init_settings.keywords); + UnlockIfInitSettings(cs); stack->processes= ListCopy(init_settings.processes); } else @@ -516,21 +541,31 @@ static int DbugParse(CODE_STATE *cs, const char *control) case 'd': if (sign < 0 && control == end) { + LockIfInitSettings(cs); if (!is_shared(stack, keywords)) FreeList(stack->keywords); stack->keywords=NULL; + UnlockIfInitSettings(cs); stack->flags &= ~DEBUG_ON; break; } + LockIfInitSettings(cs); if (rel && is_shared(stack, keywords)) stack->keywords= ListCopy(stack->keywords); + UnlockIfInitSettings(cs); if (sign < 0) { if (DEBUGGING) + { + LockIfInitSettings(cs); stack->keywords= ListDel(stack->keywords, control, end); + UnlockIfInitSettings(cs); + } break; } + LockIfInitSettings(cs); stack->keywords= ListAdd(stack->keywords, control, end); + UnlockIfInitSettings(cs); stack->flags |= DEBUG_ON; break; case 'D': @@ -665,11 +700,6 @@ static int DbugParse(CODE_STATE *cs, const char *control) control=end+1; end= DbugStrTok(control); } - if (!org_cs_locked) - { - cs->locked= 0; - pthread_mutex_unlock(&THR_LOCK_dbug); - } return !rel || f_used; } @@ -1002,7 +1032,9 @@ int _db_explain_ (CODE_STATE *cs, char *buf, size_t len) get_code_state_if_not_set_or_return *buf=0; + LockIfInitSettings(cs); op_list_to_buf('d', cs->stack->keywords, DEBUGGING); + UnlockIfInitSettings(cs); op_int_to_buf ('D', cs->stack->delay, 0); op_list_to_buf('f', cs->stack->functions, cs->stack->functions); op_bool_to_buf('F', cs->stack->flags & FILE_ON); @@ -1097,7 +1129,6 @@ int _db_explain_init_(char *buf, size_t len) void _db_enter_(const char *_func_, const char *_file_, uint _line_, struct _db_stack_frame_ *_stack_frame_) { - int save_errno, org_cs_locked; CODE_STATE *cs; if (!((cs=code_state()))) { @@ -1105,7 +1136,6 @@ void _db_enter_(const char *_func_, const char *_file_, _stack_frame_->prev= 0; return; } - save_errno= errno; _stack_frame_->line= -1; _stack_frame_->func= cs->func; @@ -1126,20 +1156,14 @@ void _db_enter_(const char *_func_, const char *_file_, cs->stack->flags &= ~SANITY_CHECK_ON; if (TRACING) { - if (!(org_cs_locked= cs->locked)) - { - pthread_mutex_lock(&THR_LOCK_dbug); - cs->locked= 1; - } + int save_errno= errno; + LockMutex(cs); DoPrefix(cs, _line_); Indent(cs, cs->level); (void) fprintf(cs->stack->out_file->file, ">%s\n", cs->func); - DbugFlush(cs); /* This does a unlock */ - if (!org_cs_locked) - { - cs->locked= 0; - pthread_mutex_unlock(&THR_LOCK_dbug); - } + UnlockMutex(cs); + DbugFlush(cs); + errno=save_errno; } break; case DISABLE_TRACE: @@ -1148,7 +1172,6 @@ void _db_enter_(const char *_func_, const char *_file_, case DONT_TRACE: break; } - errno=save_errno; } /* @@ -1173,7 +1196,6 @@ void _db_enter_(const char *_func_, const char *_file_, void _db_return_(struct _db_stack_frame_ *_stack_frame_) { - int save_errno=errno; uint _slevel_= _stack_frame_->level & ~TRACE_ON; CODE_STATE *cs; get_code_state_or_return; @@ -1190,25 +1212,18 @@ void _db_return_(struct _db_stack_frame_ *_stack_frame_) if (DoTrace(cs) & DO_TRACE) { - int org_cs_locked; if ((cs->stack->flags & SANITY_CHECK_ON) && (*dbug_sanity)()) cs->stack->flags &= ~SANITY_CHECK_ON; if (TRACING) { - if (!(org_cs_locked= cs->locked)) - { - pthread_mutex_lock(&THR_LOCK_dbug); - cs->locked= 1; - } + int save_errno=errno; + LockMutex(cs); DoPrefix(cs, _stack_frame_->line); Indent(cs, cs->level); (void) fprintf(cs->stack->out_file->file, "<%s\n", cs->func); + UnlockMutex(cs); DbugFlush(cs); - if (!org_cs_locked) - { - cs->locked= 0; - pthread_mutex_unlock(&THR_LOCK_dbug); - } + errno=save_errno; } } /* @@ -1220,7 +1235,6 @@ void _db_return_(struct _db_stack_frame_ *_stack_frame_) cs->file= _stack_frame_->file; if (cs->framep != NULL) cs->framep= cs->framep->prev; - errno=save_errno; } @@ -1285,18 +1299,14 @@ void _db_doprnt_(const char *format,...) { va_list args; CODE_STATE *cs; - int save_errno, org_cs_locked; + int save_errno; get_code_state_or_return; va_start(args,format); - if (!(org_cs_locked= cs->locked)) - { - pthread_mutex_lock(&THR_LOCK_dbug); - cs->locked= 1; - } save_errno=errno; + LockMutex(cs); DoPrefix(cs, cs->u_line); if (TRACING) Indent(cs, cs->level + 1); @@ -1304,12 +1314,8 @@ void _db_doprnt_(const char *format,...) (void) fprintf(cs->stack->out_file->file, "%s: ", cs->func); (void) fprintf(cs->stack->out_file->file, "%s: ", cs->u_keyword); DbugVfprintf(cs->stack->out_file->file, format, args); + UnlockMutex(cs); DbugFlush(cs); - if (!org_cs_locked) - { - cs->locked= 0; - pthread_mutex_unlock(&THR_LOCK_dbug); - } errno=save_errno; va_end(args); @@ -1349,17 +1355,13 @@ static void DbugVfprintf(FILE *stream, const char* format, va_list args) void _db_dump_(uint _line_, const char *keyword, const unsigned char *memory, size_t length) { - int pos, org_cs_locked; + int pos; CODE_STATE *cs; get_code_state_or_return; - if (!(org_cs_locked= cs->locked)) - { - pthread_mutex_lock(&THR_LOCK_dbug); - cs->locked= 1; - } if (_db_keyword_(cs, keyword, 0)) { + LockMutex(cs); DoPrefix(cs, _line_); if (TRACING) { @@ -1387,13 +1389,9 @@ void _db_dump_(uint _line_, const char *keyword, fputc(' ',cs->stack->out_file->file); } (void) fputc('\n',cs->stack->out_file->file); + UnlockMutex(cs); DbugFlush(cs); } - if (!org_cs_locked) - { - cs->locked= 0; - pthread_mutex_unlock(&THR_LOCK_dbug); - } } @@ -1621,8 +1619,10 @@ static void PushState(CODE_STATE *cs) static void FreeState(CODE_STATE *cs, int free_state) { struct settings *state= cs->stack; + LockIfInitSettings(cs); if (!is_shared(state, keywords)) FreeList(state->keywords); + UnlockIfInitSettings(cs); if (!is_shared(state, functions)) FreeList(state->functions); if (!is_shared(state, processes)) @@ -1701,8 +1701,6 @@ void _db_end_() static int DoTrace(CODE_STATE *cs) { int res= DONT_TRACE; - if (!cs->locked) - pthread_mutex_lock(&THR_LOCK_dbug); if ((cs->stack->maxdepth == 0 || cs->level <= cs->stack->maxdepth) && InList(cs->stack->processes, cs->process, 0) & (MATCHED|INCLUDE)) { @@ -1727,8 +1725,6 @@ static int DoTrace(CODE_STATE *cs) break; } } - if (!cs->locked) - pthread_mutex_unlock(&THR_LOCK_dbug); return res; } @@ -1768,11 +1764,9 @@ BOOLEAN _db_keyword_(CODE_STATE *cs, const char *keyword, int strict) if (!(DEBUGGING && (DoTrace(cs) & DO_TRACE))) return 0; - if (!cs->locked) - pthread_mutex_lock(&THR_LOCK_dbug); + LockIfInitSettings(cs); res= (InList(cs->stack->keywords, keyword, strict) & match); - if (!cs->locked) - pthread_mutex_unlock(&THR_LOCK_dbug); + UnlockIfInitSettings(cs); return res != 0; } @@ -1999,16 +1993,16 @@ static void DBUGCloseFile(CODE_STATE *cs, sFILE *new_value) sFILE *fp; if (!cs || !cs->stack || !cs->stack->out_file) return; - if (!cs->locked) - pthread_mutex_lock(&THR_LOCK_dbug); fp= cs->stack->out_file; if (--fp->used == 0) { if (fclose(fp->file) == EOF) { + LockMutex(cs); (void) fprintf(stderr, ERR_CLOSE, cs->process); perror(""); + UnlockMutex(cs); } else { @@ -2016,8 +2010,6 @@ static void DBUGCloseFile(CODE_STATE *cs, sFILE *new_value) } } cs->stack->out_file= new_value; - if (!cs->locked) - pthread_mutex_unlock(&THR_LOCK_dbug); } @@ -2200,9 +2192,7 @@ void _db_flush_() get_code_state_or_return; if (DEBUGGING) { - pthread_mutex_lock(&THR_LOCK_dbug); (void) fflush(cs->stack->out_file->file); - pthread_mutex_unlock(&THR_LOCK_dbug); } } @@ -2230,16 +2220,14 @@ void _db_lock_file_() { CODE_STATE *cs; get_code_state_or_return; - pthread_mutex_lock(&THR_LOCK_dbug); - cs->locked=1; + LockMutex(cs); } void _db_unlock_file_() { CODE_STATE *cs; get_code_state_or_return; - cs->locked=0; - pthread_mutex_unlock(&THR_LOCK_dbug); + UnlockMutex(cs); } const char* _db_get_func_(void) diff --git a/debian/additions/innotop/innotop b/debian/additions/innotop/innotop index eb4b3590cf6..399a393e67b 100644 --- a/debian/additions/innotop/innotop +++ b/debian/additions/innotop/innotop @@ -1607,7 +1607,7 @@ my %exprs = ( my %columns = ( active_secs => { hdr => 'SecsActive', num => 1, label => 'Seconds transaction has been active', }, - add_pool_alloc => { hdr => 'Add\'l Pool', num => 1, label => 'Additonal pool allocated' }, + add_pool_alloc => { hdr => 'Add\'l Pool', num => 1, label => 'Additional pool allocated' }, attempted_op => { hdr => 'Action', num => 0, label => 'The action that caused the error' }, awe_mem_alloc => { hdr => 'AWE Memory', num => 1, label => '[Windows] AWE memory allocated' }, binlog_cache_overflow => { hdr => 'Binlog Cache', num => 1, label => 'Transactions too big for binlog cache that went to disk' }, diff --git a/extra/innochecksum.cc b/extra/innochecksum.cc index aa591de944e..5e9fe81af8e 100644 --- a/extra/innochecksum.cc +++ b/extra/innochecksum.cc @@ -323,7 +323,7 @@ error_message( /***********************************************//* @param>>_______[in] name>_____name of file. - @retval file pointer; file pointer is NULL when error occured. + @retval file pointer; file pointer is NULL when error occurred. */ FILE* @@ -1119,7 +1119,7 @@ parse_page( /** @param [in/out] file_name name of the filename -@retval FILE pointer if successfully created else NULL when error occured. +@retval FILE pointer if successfully created else NULL when error occurred. */ FILE* create_file( diff --git a/extra/mariabackup/backup_copy.cc b/extra/mariabackup/backup_copy.cc index 176d607fe1c..6a0674bf7f5 100644 --- a/extra/mariabackup/backup_copy.cc +++ b/extra/mariabackup/backup_copy.cc @@ -1665,6 +1665,9 @@ ibx_copy_incremental_over_full() } } + if (!(ret = backup_files_from_datadir(xtrabackup_incremental_dir))) + goto cleanup; + /* copy buffer pool dump */ if (innobase_buffer_pool_filename) { const char *src_name; @@ -2176,20 +2179,26 @@ static bool backup_files_from_datadir(const char *dir_path) if (info.type != OS_FILE_TYPE_FILE) continue; - const char *pname = strrchr(info.name, IF_WIN('\\', '/')); + const char *pname = strrchr(info.name, OS_PATH_SEPARATOR); if (!pname) pname = info.name; - /* Copy aria log files, and aws keys for encryption plugins.*/ - const char *prefixes[] = { "aria_log", "aws-kms-key" }; - for (size_t i = 0; i < array_elements(prefixes); i++) { - if (starts_with(pname, prefixes[i])) { - ret = copy_file(ds_data, info.name, info.name, 1); - if (!ret) { - break; - } - } - } + if (!starts_with(pname, "aws-kms-key") && + !starts_with(pname, "aria_log")) + /* For ES exchange the above line with the following code: + (!xtrabackup_prepare || !xtrabackup_incremental_dir || + !starts_with(pname, "aria_log"))) + */ + continue; + + if (xtrabackup_prepare && xtrabackup_incremental_dir && + file_exists(info.name)) + unlink(info.name); + + std::string full_path(dir_path); + full_path.append(1, OS_PATH_SEPARATOR).append(info.name); + if (!(ret = copy_file(ds_data, full_path.c_str() , info.name, 1))) + break; } os_file_closedir(dir); return ret; diff --git a/extra/mariabackup/innobackupex.cc b/extra/mariabackup/innobackupex.cc index 952d1f4ec63..38b1bcb6f58 100644 --- a/extra/mariabackup/innobackupex.cc +++ b/extra/mariabackup/innobackupex.cc @@ -716,7 +716,7 @@ The --decompress command will decompress a backup made\n\ with the --compress option. The\n\ --parallel option will allow multiple files to be decompressed\n\ simultaneously. In order to decompress, the qpress utility MUST be installed\n\ -and accessable within the path. This process will remove the original\n\ +and accessible within the path. This process will remove the original\n\ compressed files and leave the results in the same location.\n\ \n\ On success the exit code innobackupex is 0. A non-zero exit code \n\ diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index 3ddd8786ee9..f2628f2b96b 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -1973,7 +1973,7 @@ static bool innodb_init_param() return false; error: - msg("mariabackup: innodb_init_param(): Error occured.\n"); + msg("mariabackup: innodb_init_param(): Error occurred.\n"); return true; } diff --git a/libmariadb b/libmariadb -Subproject 980f2dbea6586091333057bb2994b1874746694 +Subproject c8833751cf48d0085d9d7a4285aafdc967a63a4 diff --git a/man/mysql-test-run.pl.1 b/man/mysql-test-run.pl.1 index 5f4c17858bd..ba92cf87d1c 100644 --- a/man/mysql-test-run.pl.1 +++ b/man/mysql-test-run.pl.1 @@ -1937,8 +1937,10 @@ Run stress test, providing options to mysql\-stress\-test\&.pl\&. Options are se .\" suite option: mysql-test-run.pl \fB\-\-suite[s]=\fR\fB\fIsuite_name...\fR\fR .sp -Comma separated list of suite names to run. The default is: "main-,archive-,binlog-,csv-,federated-,funcs_1-,funcs_2-,handler-,heap-,innodb-,innodb_fts-, -innodb_zip-,maria-,multi_source-,optimizer_unfixed_bugs-,parts-,perfschema-, +Comma separated list of suite names to run. The default is: +"main-,archive-,binlog-,csv-,federated-,funcs_1-,funcs_2-, +handler-,heap-,innodb-,innodb_fts-,innodb_zip-,maria-, +multi_source-,optimizer_unfixed_bugs-,parts-,perfschema-, plugins-,roles-,rpl-,sys_vars-,unit-,vcol-"\&. .RE .sp diff --git a/mysql-test/main/create.result b/mysql-test/main/create.result index d8e9272e930..c1733c270a7 100644 --- a/mysql-test/main/create.result +++ b/mysql-test/main/create.result @@ -949,7 +949,7 @@ drop table t1; Bug #26104 Bug on foreign key class constructor -Check that ref_columns is initalized correctly in the constructor +Check that ref_columns is initialized correctly in the constructor and semantic checks in mysql_prepare_table work. We do not need a storage engine that supports foreign keys diff --git a/mysql-test/main/create.test b/mysql-test/main/create.test index 4cff86b0672..64aea4ddcf1 100644 --- a/mysql-test/main/create.test +++ b/mysql-test/main/create.test @@ -850,7 +850,7 @@ drop table t1; --echo --echo Bug #26104 Bug on foreign key class constructor --echo ---echo Check that ref_columns is initalized correctly in the constructor +--echo Check that ref_columns is initialized correctly in the constructor --echo and semantic checks in mysql_prepare_table work. --echo --echo We do not need a storage engine that supports foreign keys diff --git a/mysql-test/main/mysqld--help.result b/mysql-test/main/mysqld--help.result index 5e20172f5ef..bd9656a106d 100644 --- a/mysql-test/main/mysqld--help.result +++ b/mysql-test/main/mysqld--help.result @@ -1107,7 +1107,7 @@ The following specify which files/extra groups are read (specified before remain disable; STATE to track just transaction state (Is there an active transaction? Does it have any data? etc.); CHARACTERISTICS to track transaction state and report all - statements needed to start a transaction withthe same + statements needed to start a transaction with the same characteristics (isolation level, read only/read write,snapshot - but not any work done / data modified within the transaction). @@ -1773,5 +1773,5 @@ userstat FALSE verbose TRUE wait-timeout 28800 -To see what values a running MySQL server is using, type +To see what variables a running MySQL server is using, type 'mysqladmin variables' instead of 'mysqld --verbose --help'. diff --git a/mysql-test/main/order_by.result b/mysql-test/main/order_by.result index b059cc686cd..268cac4daac 100644 --- a/mysql-test/main/order_by.result +++ b/mysql-test/main/order_by.result @@ -3282,6 +3282,36 @@ pk 3 DROP TABLE t1; # +# MDEV-21044: Wrong result when using a smaller size for sort buffer +# +create table t1(a varchar(765),b int); +insert into t1 values ("a",1),("b",2),("c",3),("e",4); +insert into t1 values ("d",5),("f",6),("g",7),("h",8); +insert into t1 values ("k",11),("l",12),("i",9),("j",10); +insert into t1 values ("m",13),("n",14),("o",15),("p",16); +set @save_sort_buffer_size= @@sort_buffer_size; +set sort_buffer_size=1024; +select * from t1 order by b; +a b +a 1 +b 2 +c 3 +e 4 +d 5 +f 6 +g 7 +h 8 +i 9 +j 10 +k 11 +l 12 +m 13 +n 14 +o 15 +p 16 +set @@sort_buffer_size= @save_sort_buffer_size; +drop table t1; +# # MDEV-13994: Bad join results with orderby_uses_equalities=on # CREATE TABLE books ( diff --git a/mysql-test/main/order_by.test b/mysql-test/main/order_by.test index 934c503302f..19129c418b3 100644 --- a/mysql-test/main/order_by.test +++ b/mysql-test/main/order_by.test @@ -2147,6 +2147,22 @@ SELECT DISTINCT pk FROM t1; DROP TABLE t1; --echo # +--echo # MDEV-21044: Wrong result when using a smaller size for sort buffer +--echo # + +create table t1(a varchar(765),b int); +insert into t1 values ("a",1),("b",2),("c",3),("e",4); +insert into t1 values ("d",5),("f",6),("g",7),("h",8); +insert into t1 values ("k",11),("l",12),("i",9),("j",10); +insert into t1 values ("m",13),("n",14),("o",15),("p",16); +set @save_sort_buffer_size= @@sort_buffer_size; +set sort_buffer_size=1024; +select * from t1 order by b; +set @@sort_buffer_size= @save_sort_buffer_size; +drop table t1; + + +--echo # --echo # MDEV-13994: Bad join results with orderby_uses_equalities=on --echo # diff --git a/mysql-test/main/sp-bugs.result b/mysql-test/main/sp-bugs.result index 3ab3d19ccfb..0aa9033f477 100644 --- a/mysql-test/main/sp-bugs.result +++ b/mysql-test/main/sp-bugs.result @@ -1,5 +1,5 @@ # -# Bug #47412: Valgrind warnings / user can read uninitalized memory +# Bug #47412: Valgrind warnings / user can read uninitialized memory # using SP variables # CREATE SCHEMA testdb; diff --git a/mysql-test/main/sp-bugs.test b/mysql-test/main/sp-bugs.test index 6695b05b72d..f06e9eca690 100644 --- a/mysql-test/main/sp-bugs.test +++ b/mysql-test/main/sp-bugs.test @@ -1,7 +1,7 @@ # Test file for stored procedure bugfixes --echo # ---echo # Bug #47412: Valgrind warnings / user can read uninitalized memory +--echo # Bug #47412: Valgrind warnings / user can read uninitialized memory --echo # using SP variables --echo # diff --git a/mysql-test/main/sp-security.test b/mysql-test/main/sp-security.test index 3219f6ef21d..acc05cafa21 100644 --- a/mysql-test/main/sp-security.test +++ b/mysql-test/main/sp-security.test @@ -342,7 +342,7 @@ flush privileges; drop table t1; # -# Bug#9503 reseting correct parameters of thread after error in SP function +# Bug#9503 resetting correct parameters of thread after error in SP function # connect (root,localhost,root,,test); connection root; diff --git a/mysql-test/main/type_bit.test b/mysql-test/main/type_bit.test index d0644b764ae..f7b2ec86040 100644 --- a/mysql-test/main/type_bit.test +++ b/mysql-test/main/type_bit.test @@ -262,7 +262,7 @@ select hex(a), b from t1; drop table t1; # -# type was not properly initalized, which caused key_copy to fail +# type was not properly initialized, which caused key_copy to fail # create table t1(bit_field bit(2), int_field int, key a(bit_field)); diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 6d4549d7d7a..58871f7aee1 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -327,7 +327,8 @@ my $opt_valgrind_mysqld= 0; my $opt_valgrind_mysqltest= 0; my @valgrind_args; my $opt_strace= 0; -my $opt_strace_client; +my $opt_stracer; +my $opt_client_strace = 0; my @strace_args; my $opt_valgrind_path; my $valgrind_reports= 0; @@ -1332,9 +1333,10 @@ sub command_line_setup { 'debugger=s' => \$opt_debugger, 'boot-dbx' => \$opt_boot_dbx, 'client-debugger=s' => \$opt_client_debugger, - 'strace' => \$opt_strace, - 'strace-client' => \$opt_strace_client, - 'strace-option=s' => \@strace_args, + 'strace' => \$opt_strace, + 'strace-option=s' => \@strace_args, + 'client-strace' => \$opt_client_strace, + 'stracer=s' => \$opt_stracer, 'max-save-core=i' => \$opt_max_save_core, 'max-save-datadir=i' => \$opt_max_save_datadir, 'max-test-fail=i' => \$opt_max_test_fail, @@ -1930,7 +1932,7 @@ sub command_line_setup { join(" ", @valgrind_args), "\""); } - if (@strace_args) + if (@strace_args || $opt_stracer) { $opt_strace=1; } @@ -5879,14 +5881,6 @@ sub start_mysqltest ($) { mtr_add_arg($args, "--non-blocking-api"); } - if ( $opt_strace_client ) - { - $exe= $opt_strace_client || "strace"; - mtr_add_arg($args, "-o"); - mtr_add_arg($args, "%s/log/mysqltest.strace", $opt_vardir); - mtr_add_arg($args, "$exe_mysqltest"); - } - mtr_add_arg($args, "--timer-file=%s/log/timer", $opt_vardir); if ( $opt_compress ) @@ -5952,6 +5946,17 @@ sub start_mysqltest ($) { mtr_add_arg($args, "%s", $_) for @args_saved; } + # ---------------------------------------------------------------------- + # Prefix the strace options to the argument list. + # ---------------------------------------------------------------------- + if ( $opt_client_strace ) + { + my @args_saved = @$args; + mtr_init_args(\$args); + strace_arguments($args, \$exe, "mysqltest"); + mtr_add_arg($args, "%s", $_) for @args_saved; + } + if ($opt_force > 1) { mtr_add_arg($args, "--continue-on-error"); @@ -6276,16 +6281,17 @@ sub strace_arguments { my $args= shift; my $exe= shift; my $mysqld_name= shift; + my $output= sprintf("%s/log/%s.strace", $path_vardir_trace, $mysqld_name); mtr_add_arg($args, "-f"); - mtr_add_arg($args, "-o%s/var/log/%s.strace", $glob_mysql_test_dir, $mysqld_name); + mtr_add_arg($args, "-o%s", $output); - # Add strace options, can be overridden by user + # Add strace options mtr_add_arg($args, '%s', $_) for (@strace_args); mtr_add_arg($args, $$exe); - $$exe= "strace"; + $$exe= $opt_stracer || "strace"; if ($exe_libtool) { @@ -6561,11 +6567,11 @@ Options for valgrind Options for strace strace Run the "mysqld" executables using strace. Default - options are -f -o var/log/'mysqld-name'.strace - strace-option=ARGS Option to give strace, replaces default option(s), - strace-client=[path] Create strace output for mysqltest client, optionally - specifying name and path to the trace program to use. - Example: $0 --strace-client=ktrace + options are -f -o 'vardir'/log/'mysqld-name'.strace. + client-strace Trace the "mysqltest". + strace-option=ARGS Option to give strace, appends to existing options. + stracer=<EXE> Specify name and path to the trace program to use. + Default is "strace". Example: $0 --stracer=ktrace. Misc options user=USER User for connecting to mysqld(default: $opt_user) diff --git a/mysql-test/suite/compat/oracle/r/func_misc.result b/mysql-test/suite/compat/oracle/r/func_misc.result index f285423b446..ffb9e10110d 100644 --- a/mysql-test/suite/compat/oracle/r/func_misc.result +++ b/mysql-test/suite/compat/oracle/r/func_misc.result @@ -32,7 +32,7 @@ CALL p1('SELECT 1'); 1 1 'Error1: ' || SQLCODE || ' ' || SQLERRM -Error1: 0 normal, successful completition +Error1: 0 normal, successful completion CALL p1('xxx'); 'Error2: ' || SQLCODE || ' ' || SQLERRM Error2: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 @@ -40,7 +40,7 @@ CALL p1('SELECT 1'); 1 1 'Error1: ' || SQLCODE || ' ' || SQLERRM -Error1: 0 normal, successful completition +Error1: 0 normal, successful completion DROP PROCEDURE p1; # # SQLCODE and SQLERRM hidden by local variables @@ -219,7 +219,7 @@ f1() Exception|1329 No data - zero rows fetched, selected, or processed SELECT f2() FROM DUAL; f2() -Exception|1329 No data - zero rows fetched, selected, or processed|0 normal, successful completition +Exception|1329 No data - zero rows fetched, selected, or processed|0 normal, successful completion DROP TABLE t1; DROP FUNCTION f2; DROP FUNCTION f1; @@ -246,7 +246,7 @@ f1() Exception|1329 No data - zero rows fetched, selected, or processed SELECT f2() FROM DUAL; f2() -Exception|1329 No data - zero rows fetched, selected, or processed|0 normal, successful completition +Exception|1329 No data - zero rows fetched, selected, or processed|0 normal, successful completion DROP TABLE t1; DROP FUNCTION f2; DROP FUNCTION f1; @@ -274,7 +274,7 @@ END; $$ SELECT f2() FROM DUAL; f2() -Exception|1329 No data - zero rows fetched, selected, or processed|0 normal, successful completition +Exception|1329 No data - zero rows fetched, selected, or processed|0 normal, successful completion DROP FUNCTION f2; DROP PROCEDURE p1; DROP TABLE t1; @@ -299,7 +299,7 @@ END; $$ SELECT f2() FROM DUAL; f2() -Exception|1329 No data - zero rows fetched, selected, or processed|0 normal, successful completition +Exception|1329 No data - zero rows fetched, selected, or processed|0 normal, successful completion DROP FUNCTION f2; DROP PROCEDURE p1; DROP TABLE t1; diff --git a/mysql-test/suite/funcs_1/views/views_master.inc b/mysql-test/suite/funcs_1/views/views_master.inc index 17f5c1e5529..573d72022fb 100644 --- a/mysql-test/suite/funcs_1/views/views_master.inc +++ b/mysql-test/suite/funcs_1/views/views_master.inc @@ -764,7 +764,7 @@ CREATE VIEW test.v2 AS SELECT * FROM test.t0; CREATE VIEW test2.v2 AS SELECT * FROM test2.t0; # Some additional tests on the just created objects to show that they are -# accessable and do have the expected content. +# accessible and do have the expected content. # INSERTs with full qualified table INSERT INTO test.t1 VALUES('test.t1 - 1'); INSERT INTO test2.t1 VALUES('test2.t1 - 1'); diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index 0052c8e7557..061697a7fd8 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -11,6 +11,7 @@ ############################################################################## GCF-1081 : MDEV-18283 Galera test failure on galera.GCF-1081 +MW-286 : MDEV-18464 Killing thread can cause mutex deadlock if done concurrently with Galera/replication victim kill MW-329 : MDEV-19962 Galera test failure on MW-329 MW-360 : needs rewrite to be MariaDB gtid compatible MW-388: MDEV-19803 Long semaphore wait error on galera.MW-388 @@ -21,6 +22,7 @@ galera_as_slave_gtid_replicate_do_db_cc : Requires MySQL GTID galera_as_slave_preordered : wsrep-preordered feature not merged to MariaDB galera_as_slave_replication_bundle : MDEV-15785 OPTION_GTID_BEGIN is set in Gtid_log_event::do_apply_event() galera_bf_abort_group_commit : MDEV-18282 Galera test failure on galera.galera_bf_abort_group_commit +galera_autoinc_sst_mariabackup : Known issue, may require porting MDEV-17458 from later versions galera_binlog_rows_query_log_events: MariaDB does not support binlog_rows_query_log_events galera_binlog_stmt_autoinc: MDEV-19959 Galera test failure on galera_binlog_stmt_autoinc galera_concurrent_ctas : MDEV-18180 Galera test failure on galera.galera_concurrent_ctas diff --git a/mysql-test/suite/galera/galera_2nodes_as_slave.cnf b/mysql-test/suite/galera/galera_2nodes_as_slave.cnf index d1fa7bfbfca..4c7763896d0 100644 --- a/mysql-test/suite/galera/galera_2nodes_as_slave.cnf +++ b/mysql-test/suite/galera/galera_2nodes_as_slave.cnf @@ -9,13 +9,18 @@ binlog-format=row [mysqld.1] +log-bin +server-id=1 +wsrep-on=0 + +[mysqld.2] #galera_port=@OPT.port #ist_port=@OPT.port #sst_port=@OPT.port + wsrep-on=1 -log-bin=master-bin -log-bin-index=master-bin +log-bin log-slave-updates innodb-autoinc-lock-mode=2 @@ -23,53 +28,38 @@ default-storage-engine=innodb wsrep-provider=@ENV.WSREP_PROVIDER wsrep_node_address=127.0.0.1 wsrep-cluster-address=gcomm:// -wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M' -wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port -wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port' +wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=10M' +wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port +wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port' # enforce read-committed characteristics across the cluster wsrep-causal-reads=ON wsrep-sync-wait=15 -server-id=1 -# lock schedule alg appears to be VATS by default, and it is not -# yet compatible with galera -innodb_lock_schedule_algorithm=FCFS +server-id=2 -[mysqld.2] +[mysqld.3] #galera_port=@OPT.port #ist_port=@OPT.port #sst_port=@OPT.port + wsrep-on=1 -log-bin=master-bin -log-bin-index=master-bin +log-bin log-slave-updates innodb-autoinc-lock-mode=2 default-storage-engine=innodb wsrep-provider=@ENV.WSREP_PROVIDER wsrep_node_address=127.0.0.1 -wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port' -wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=10M' -wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port -wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port' +wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.2.#galera_port' +wsrep_provider_options='base_port=@mysqld.3.#galera_port;gcache.size=10M' +wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port +wsrep_sst_receive_address='127.0.0.1:@mysqld.3.#sst_port' # enforce read-committed characteristics across the cluster wsrep-causal-reads=ON wsrep-sync-wait=15 -server-id=2 -# lock schedule alg appears to be VATS by default, and it is not -# yet compatible with galera -innodb_lock_schedule_algorithm=FCFS - -[mysqld.3] -log-bin=master-bin -log-bin-index=master-bin server-id=3 -# lock schedule alg appears to be VATS by default, and it is not -# yet compatible with galera -innodb_lock_schedule_algorithm=FCFS - [ENV] NODE_MYPORT_1= @mysqld.1.port @@ -80,3 +70,9 @@ NODE_MYSOCK_2= @mysqld.2.socket NODE_MYPORT_3= @mysqld.3.port NODE_MYSOCK_3= @mysqld.3.socket + +NODE_GALERAPORT_2= @mysqld.2.#galera_port +NODE_GALERAPORT_3= @mysqld.3.#galera_port + +NODE_SSTPORT_2= @mysqld.2.#sst_port +NODE_SSTPORT_3= @mysqld.3.#sst_port diff --git a/mysql-test/suite/galera/r/MW-284.result b/mysql-test/suite/galera/r/MW-284.result index 11a0a7df387..3df126de728 100644 --- a/mysql-test/suite/galera/r/MW-284.result +++ b/mysql-test/suite/galera/r/MW-284.result @@ -1,6 +1,8 @@ connection node_2; connection node_1; connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3; +call mtr.add_suppression("\\[ERROR\\] Error reading packet from server: WSREP has not yet prepared node for application use .*"); +call mtr.add_suppression("WSREP has not yet prepared node for application use"); connection node_1; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; @@ -8,6 +10,9 @@ SET SESSION wsrep_on = OFF; SET SESSION wsrep_on = ON; SET global wsrep_sync_wait=0; connection node_3; +SELECT @@wsrep_on; +@@wsrep_on +0 START SLAVE; include/wait_for_slave_param.inc [Slave_IO_Running] connection node_1; @@ -24,11 +29,3 @@ connection node_3; STOP SLAVE; RESET SLAVE ALL; CALL mtr.add_suppression('failed registering on master'); -CALL mtr.add_suppression('You need to use --log-bin to make --binlog-format work'); -connection node_1; -set global wsrep_on=OFF; -RESET MASTER; -set global wsrep_on=ON; -CALL mtr.add_suppression('WSREP: Last Applied Action message in non-primary configuration from member'); -connection node_2; -CALL mtr.add_suppression('WSREP: Last Applied Action message in non-primary configuration from member'); diff --git a/mysql-test/suite/galera/r/MW-44.result b/mysql-test/suite/galera/r/MW-44.result index 6973e4c78c9..604bd139024 100644 --- a/mysql-test/suite/galera/r/MW-44.result +++ b/mysql-test/suite/galera/r/MW-44.result @@ -3,24 +3,11 @@ connection node_1; connection node_1; TRUNCATE TABLE mysql.general_log; connection node_2; -TRUNCATE TABLE mysql.general_log; connection node_1; -SELECT Argument FROM mysql.general_log; -Argument -SET GLOBAL general_log='ON'; SET SESSION wsrep_osu_method=TOI; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; SET SESSION wsrep_osu_method=RSU; ALTER TABLE t1 ADD COLUMN f2 INTEGER; SET SESSION wsrep_osu_method=TOI; -SELECT argument FROM mysql.general_log WHERE argument LIKE 'CREATE%' OR argument LIKE 'ALTER%'; -argument -CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB -ALTER TABLE t1 ADD COLUMN f2 INTEGER connection node_2; -SELECT Argument FROM mysql.general_log; -Argument DROP TABLE t1; -SET GLOBAL general_log='OFF'; -connection node_1; -SET GLOBAL general_log='OFF'; diff --git a/mysql-test/suite/galera/r/galera_as_slave_ctas.result b/mysql-test/suite/galera/r/galera_as_slave_ctas.result new file mode 100644 index 00000000000..16df71b744f --- /dev/null +++ b/mysql-test/suite/galera/r/galera_as_slave_ctas.result @@ -0,0 +1,29 @@ +connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; +connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3; +connection node_2a; +START SLAVE; +connection default; +SHOW VARIABLES LIKE 'binlog_format'; +Variable_name Value +binlog_format ROW +connection default; +CREATE TABLE source (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; +CREATE TABLE target AS SELECT * FROM source; +connection node_2a; +connection node_3; +connection default; +DROP TABLE target; +INSERT INTO source VALUES(1); +CREATE TABLE target AS SELECT * FROM source; +connection node_2a; +connection node_3; +connection default; +DROP TABLE source; +DROP TABLE target; +connection node_3; +connection node_2a; +STOP SLAVE; +RESET SLAVE ALL; +connection default; +RESET MASTER; +disconnect node_2a; diff --git a/mysql-test/suite/galera/r/galera_as_slave_gtid_myisam.result b/mysql-test/suite/galera/r/galera_as_slave_gtid_myisam.result new file mode 100644 index 00000000000..4516b171b60 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_as_slave_gtid_myisam.result @@ -0,0 +1,33 @@ +connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2; +connection node_2a; +ALTER TABLE mysql.gtid_slave_pos engine = InnoDB; +START SLAVE; +connection default; +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=MyISAM; +INSERT INTO t1 VALUES(1); +SELECT LENGTH(@@global.gtid_binlog_state) > 1; +LENGTH(@@global.gtid_binlog_state) > 1 +1 +connection node_2a; +gtid_binlog_state_equal +0 +connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3; +SELECT COUNT(*) = 0 FROM t1; +COUNT(*) = 0 +1 +gtid_binlog_state_equal +0 +#cleanup +connection default; +DROP TABLE t1; +reset master; +connection node_2a; +STOP SLAVE; +RESET SLAVE ALL; +set global wsrep_on=OFF; +reset master; +set global wsrep_on=ON; +connection node_3; +set global wsrep_on=OFF; +reset master; +set global wsrep_on=ON; diff --git a/mysql-test/suite/galera/r/galera_forced_binlog_format.result b/mysql-test/suite/galera/r/galera_forced_binlog_format.result index a94ac0c112d..8f79c3a19a1 100644 --- a/mysql-test/suite/galera/r/galera_forced_binlog_format.result +++ b/mysql-test/suite/galera/r/galera_forced_binlog_format.result @@ -1,18 +1,14 @@ connection node_2; connection node_1; connection node_1; -SEt GLOBAL wsrep_on=OFF; +SET GLOBAL wsrep_on=OFF; RESET MASTER; -SEt GLOBAL wsrep_on=ON; +SET GLOBAL wsrep_on=ON; FLUSH BINARY LOGS; SET SESSION binlog_format = 'STATEMENT'; -Warnings: -Warning 1105 MariaDB Galera and flashback do not support binlog format: STATEMENT CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); SET SESSION binlog_format = 'MIXED'; -Warnings: -Warning 1105 MariaDB Galera and flashback do not support binlog format: MIXED INSERT INTO t1 VALUES (2); SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 256; Log_name Pos Event_type Server_id End_log_pos Info diff --git a/mysql-test/suite/galera/r/galera_gtid.result b/mysql-test/suite/galera/r/galera_gtid.result index f27e2590898..3f5c5960846 100644 --- a/mysql-test/suite/galera/r/galera_gtid.result +++ b/mysql-test/suite/galera/r/galera_gtid.result @@ -3,14 +3,12 @@ connection node_1; CREATE TABLE t1 (f1 INT PRIMARY KEY); INSERT INTO t1 VALUES (1); connection node_2; -SELECT COUNT(*) = 1 FROM t1; -COUNT(*) = 1 -1 UPDATE t1 SET f1 = 2; connection node_1; -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; -COUNT(*) = 1 -1 +SET SESSION wsrep_sync_wait = 15; +SELECT * from t1; +f1 +2 gtid_binlog_state_equal 1 DROP TABLE t1; diff --git a/mysql-test/suite/galera/r/galera_log_bin.result b/mysql-test/suite/galera/r/galera_log_bin.result index 57bc2c9e2ae..160575df412 100644 --- a/mysql-test/suite/galera/r/galera_log_bin.result +++ b/mysql-test/suite/galera/r/galera_log_bin.result @@ -78,8 +78,3 @@ DROP TABLE t2; connection node_1; SET GLOBAL wsrep_on=OFF; RESET MASTER; -SET GLOBAL wsrep_on=ON; -connection node_2; -SET GLOBAL wsrep_on=OFF; -reset master; -SET GLOBAL wsrep_on=ON; diff --git a/mysql-test/suite/galera/r/galera_var_dirty_reads.result b/mysql-test/suite/galera/r/galera_var_dirty_reads.result index 33536d95186..240f1802385 100644 --- a/mysql-test/suite/galera/r/galera_var_dirty_reads.result +++ b/mysql-test/suite/galera/r/galera_var_dirty_reads.result @@ -1,5 +1,6 @@ connection node_2; connection node_1; +call mtr.add_suppression("WSREP has not yet prepared node for application use"); connection node_1; connection node_2; connection node_2; @@ -18,9 +19,9 @@ SHOW STATUS LIKE 'wsrep_cluster_status'; Variable_name Value wsrep_cluster_status Disconnected SELECT * FROM t1; -ERROR 08S01: WSREP has not yet prepared node for application use +Got one of the listed errors SELECT 1 FROM t1; -ERROR 08S01: WSREP has not yet prepared node for application use +Got one of the listed errors SET @@session.wsrep_dirty_reads=ON; SELECT * FROM t1; i @@ -33,7 +34,7 @@ i variable_name variable_value 1 WSREP_DIRTY_READS ON SET @@session.wsrep_dirty_reads=OFF; SELECT i, variable_name, variable_value FROM t1, information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads" AND i = 1; -ERROR 08S01: WSREP has not yet prepared node for application use +Got one of the listed errors SELECT 1; 1 1 diff --git a/mysql-test/suite/galera/r/galera_var_notify_cmd.result b/mysql-test/suite/galera/r/galera_var_notify_cmd.result index 3f0dd57aa3b..2b390d0db8d 100644 --- a/mysql-test/suite/galera/r/galera_var_notify_cmd.result +++ b/mysql-test/suite/galera/r/galera_var_notify_cmd.result @@ -1,10 +1,11 @@ connection node_1; -SELECT COUNT(DISTINCT uuid) = 2 FROM mtr_wsrep_notify.membership; -COUNT(DISTINCT uuid) = 2 -1 -SELECT MAX(size) = 2 FROM mtr_wsrep_notify.status; -MAX(size) = 2 -1 -SELECT COUNT(DISTINCT idx) = 2 FROM mtr_wsrep_notify.status; -COUNT(DISTINCT idx) = 2 +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(DISTINCT uuid) FROM mtr_wsrep_notify.membership; +COUNT(DISTINCT uuid) +2 +SELECT MAX(size) FROM mtr_wsrep_notify.status; +MAX(size) +2 +SELECT COUNT(DISTINCT idx) FROM mtr_wsrep_notify.status; +COUNT(DISTINCT idx) 1 diff --git a/mysql-test/suite/galera/r/galera_var_reject_queries.result b/mysql-test/suite/galera/r/galera_var_reject_queries.result index b95e5773830..1b2bc1c5e16 100644 --- a/mysql-test/suite/galera/r/galera_var_reject_queries.result +++ b/mysql-test/suite/galera/r/galera_var_reject_queries.result @@ -1,5 +1,10 @@ +<<<<<<< HEAD connection node_2; connection node_1; +||||||| merged common ancestors +======= +call mtr.add_suppression("WSREP has not yet prepared node for application use"); +>>>>>>> 10.3 CREATE TABLE t1 (f1 INTEGER); connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1; connection node_1; @@ -7,14 +12,14 @@ SET SESSION wsrep_reject_queries = ALL; ERROR HY000: Variable 'wsrep_reject_queries' is a GLOBAL variable and should be set with SET GLOBAL SET GLOBAL wsrep_reject_queries = ALL; SELECT * FROM t1; -ERROR 08S01: WSREP has not yet prepared node for application use +Got one of the listed errors SET GLOBAL wsrep_reject_queries = ALL_KILL; connection node_1a; SELECT * FROM t1; Got one of the listed errors connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1; SELECT * FROM t1; -ERROR 08S01: WSREP has not yet prepared node for application use +Got one of the listed errors connection node_2; SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 2 diff --git a/mysql-test/suite/galera/r/galera_wsrep_new_cluster.result b/mysql-test/suite/galera/r/galera_wsrep_new_cluster.result index 8edf1a02e9d..2aac6d8851c 100644 --- a/mysql-test/suite/galera/r/galera_wsrep_new_cluster.result +++ b/mysql-test/suite/galera/r/galera_wsrep_new_cluster.result @@ -27,7 +27,7 @@ VARIABLE_VALUE = 'ON' 1 SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index'; VARIABLE_VALUE = 0 -1 +0 SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; VARIABLE_VALUE = 'ON' 1 diff --git a/mysql-test/suite/galera/t/MW-284.test b/mysql-test/suite/galera/t/MW-284.test index b52db4c68b0..99fe305d859 100644 --- a/mysql-test/suite/galera/t/MW-284.test +++ b/mysql-test/suite/galera/t/MW-284.test @@ -2,10 +2,13 @@ # MW-284 Slave I/O retry on ER_COM_UNKNOWN_ERROR # +--source include/have_log_bin.inc --source include/galera_cluster.inc ---source include/have_innodb.inc --connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 +call mtr.add_suppression("\\[ERROR\\] Error reading packet from server: WSREP has not yet prepared node for application use .*"); +call mtr.add_suppression("WSREP has not yet prepared node for application use"); + --disable_query_log --eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1, MASTER_USER='root', MASTER_CONNECT_RETRY=1; --enable_query_log @@ -18,11 +21,14 @@ SET SESSION wsrep_on = OFF; --let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status' --source include/wait_condition.inc SET SESSION wsrep_on = ON; + #wsrep_sync_wait is set to zero because when slave tries to connect it it ask for queries like SELECT UNIX_TIMESTAMP() on node 1 which will fail, causing #a warning in slave error log. SET global wsrep_sync_wait=0; --connection node_3 +SELECT @@wsrep_on; +--sleep 1 START SLAVE; --let $slave_param= Slave_IO_Running --let $slave_param_value= Connecting @@ -50,8 +56,8 @@ INSERT INTO t1 VALUES (1); --connection node_1 DROP TABLE t1; - --eval SET global wsrep_sync_wait=$wsrep_sync_wait_state + --connection node_3 --let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1' --source include/wait_condition.inc @@ -60,13 +66,3 @@ STOP SLAVE; RESET SLAVE ALL; CALL mtr.add_suppression('failed registering on master'); -CALL mtr.add_suppression('You need to use --log-bin to make --binlog-format work'); - ---connection node_1 -set global wsrep_on=OFF; -RESET MASTER; -set global wsrep_on=ON; -CALL mtr.add_suppression('WSREP: Last Applied Action message in non-primary configuration from member'); - ---connection node_2 -CALL mtr.add_suppression('WSREP: Last Applied Action message in non-primary configuration from member');
\ No newline at end of file diff --git a/mysql-test/suite/galera/t/MW-313-master.opt b/mysql-test/suite/galera/t/MW-313-master.opt deleted file mode 100644 index 8a755e98b00..00000000000 --- a/mysql-test/suite/galera/t/MW-313-master.opt +++ /dev/null @@ -1 +0,0 @@ ---log-bin --log-slave-updates diff --git a/mysql-test/suite/galera/t/MW-313.cnf b/mysql-test/suite/galera/t/MW-313.cnf new file mode 100644 index 00000000000..184900c58fd --- /dev/null +++ b/mysql-test/suite/galera/t/MW-313.cnf @@ -0,0 +1,12 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +log-bin +log-slave-updates + +[mysqld.2] +log-bin +log-slave-updates + + + diff --git a/mysql-test/suite/galera/t/MW-328C.test b/mysql-test/suite/galera/t/MW-328C.test deleted file mode 100644 index 1594547d0de..00000000000 --- a/mysql-test/suite/galera/t/MW-328C.test +++ /dev/null @@ -1,36 +0,0 @@ -# -# MW-328 Fix unnecessary/silent BF aborts -# - -# -# Make sure that a high value of wsrep_retry_autocommit -# masks all deadlock errors -# - ---source include/galera_cluster.inc ---source include/big_test.inc ---source suite/galera/t/MW-328-header.inc - ---connection node_2 ---let $count = 100 - -SET SESSION wsrep_retry_autocommit = 10000; - ---disable_query_log - -while ($count) -{ - --error 0 - INSERT IGNORE INTO t2 SELECT f2 FROM t1; - - --disable_result_log - --error 0 - SELECT 1 FROM DUAL; - --enable_result_log - - --dec $count -} - ---enable_query_log - ---source suite/galera/t/MW-328-footer.inc diff --git a/mysql-test/suite/galera/t/MW-329-master.opt b/mysql-test/suite/galera/t/MW-329-master.opt deleted file mode 100644 index 6565a6af3c4..00000000000 --- a/mysql-test/suite/galera/t/MW-329-master.opt +++ /dev/null @@ -1 +0,0 @@ ---wsrep-retry-autocommit=0 diff --git a/mysql-test/suite/galera/t/MW-329.cnf b/mysql-test/suite/galera/t/MW-329.cnf new file mode 100644 index 00000000000..10870a81547 --- /dev/null +++ b/mysql-test/suite/galera/t/MW-329.cnf @@ -0,0 +1,9 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +wsrep-retry-autocommit=0 + +[mysqld.2] + + + diff --git a/mysql-test/suite/galera/t/MW-44-master.opt b/mysql-test/suite/galera/t/MW-44-master.opt index 9b086195e8a..a15aa0a99d9 100644 --- a/mysql-test/suite/galera/t/MW-44-master.opt +++ b/mysql-test/suite/galera/t/MW-44-master.opt @@ -1,2 +1 @@ --log-output=TABLE ---general-log=OFF diff --git a/mysql-test/suite/galera/t/MW-44.test b/mysql-test/suite/galera/t/MW-44.test index 8730631edc6..a2acfc57f6c 100644 --- a/mysql-test/suite/galera/t/MW-44.test +++ b/mysql-test/suite/galera/t/MW-44.test @@ -3,40 +3,30 @@ # --source include/galera_cluster.inc ---source include/have_innodb.inc --connection node_1 TRUNCATE TABLE mysql.general_log; ---sleep 1 --connection node_2 ---let $wait_condition = SELECT COUNT(*) = 0 FROM mysql.general_log; ---source include/wait_condition.inc -TRUNCATE TABLE mysql.general_log; +--let $wait_condition = SELECT COUNT(*) = 0 FROM mysql.general_log WHERE argument NOT LIKE '%mysql.general_log%' +--let $wait_condition_on_error_output = SELECT * FROM mysql.general_log +--source include/wait_condition_with_debug.inc ---sleep 1 --connection node_1 ---let $wait_condition = SELECT COUNT(*) = 0 FROM mysql.general_log; ---source include/wait_condition.inc -SELECT Argument FROM mysql.general_log; - -SET GLOBAL general_log='ON'; SET SESSION wsrep_osu_method=TOI; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; SET SESSION wsrep_osu_method=RSU; ALTER TABLE t1 ADD COLUMN f2 INTEGER; SET SESSION wsrep_osu_method=TOI; ---let $wait_condition = SELECT COUNT(argument) = 2 FROM mysql.general_log WHERE argument LIKE 'CREATE%' OR argument LIKE 'ALTER%'; ---source include/wait_condition.inc - -SELECT argument FROM mysql.general_log WHERE argument LIKE 'CREATE%' OR argument LIKE 'ALTER%'; +--let $wait_condition = SELECT COUNT(*) = 2 FROM mysql.general_log WHERE argument LIKE "CREATE%" OR argument LIKE "ALTER%" +--let $wait_condition_on_error_output = SELECT * FROM mysql.general_log +--source include/wait_condition_with_debug.inc --connection node_2 -SELECT Argument FROM mysql.general_log; -DROP TABLE t1; -SET GLOBAL general_log='OFF'; ---connection node_1 -SET GLOBAL general_log='OFF'; +--let $wait_condition = SELECT COUNT(*) = 0 FROM mysql.general_log WHERE argument LIKE "CREATE%" OR argument LIKE "ALTER%" +--let $wait_condition_on_error_output = SELECT * FROM mysql.general_log +--source include/wait_condition_with_debug.inc +DROP TABLE t1; diff --git a/mysql-test/suite/galera/t/MW-86-wait1-master.opt b/mysql-test/suite/galera/t/MW-86-wait1-master.opt deleted file mode 100644 index 8a755e98b00..00000000000 --- a/mysql-test/suite/galera/t/MW-86-wait1-master.opt +++ /dev/null @@ -1 +0,0 @@ ---log-bin --log-slave-updates diff --git a/mysql-test/suite/galera/t/MW-86-wait8-master.opt b/mysql-test/suite/galera/t/MW-86-wait8-master.opt deleted file mode 100644 index 8a755e98b00..00000000000 --- a/mysql-test/suite/galera/t/MW-86-wait8-master.opt +++ /dev/null @@ -1 +0,0 @@ ---log-bin --log-slave-updates diff --git a/mysql-test/suite/galera/t/MW-86-wait8.cnf b/mysql-test/suite/galera/t/MW-86-wait8.cnf new file mode 100644 index 00000000000..8f6a760def0 --- /dev/null +++ b/mysql-test/suite/galera/t/MW-86-wait8.cnf @@ -0,0 +1,10 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +log-bin +log-slave-updates + +[mysqld.2] +log-bin +log-slave-updates + diff --git a/mysql-test/suite/galera/t/enforce_storage_engine2.cnf b/mysql-test/suite/galera/t/enforce_storage_engine2.cnf new file mode 100644 index 00000000000..b14fce85b36 --- /dev/null +++ b/mysql-test/suite/galera/t/enforce_storage_engine2.cnf @@ -0,0 +1,13 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +enforce_storage_engine=innodb +sql_mode='' + +[mysqld.2] +enforce_storage_engine=innodb +sql_mode='' + + + + diff --git a/mysql-test/suite/galera/t/enforce_storage_engine2.opt b/mysql-test/suite/galera/t/enforce_storage_engine2.opt deleted file mode 100644 index 03f7dc5e527..00000000000 --- a/mysql-test/suite/galera/t/enforce_storage_engine2.opt +++ /dev/null @@ -1,2 +0,0 @@ ---enforce_storage_engine=innodb --sql_mode='' - diff --git a/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter.cnf b/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter.cnf new file mode 100644 index 00000000000..4d93a1b2509 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_applier_ftwrl_table_alter.cnf @@ -0,0 +1,14 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +lock_wait_timeout=5 +innodb_lock_wait_timeout=5 +wait_timeout=5 + +[mysqld.2] +lock_wait_timeout=5 +innodb_lock_wait_timeout=5 +wait_timeout=5 + + + diff --git a/mysql-test/suite/galera/t/galera_as_slave_ctas.cnf b/mysql-test/suite/galera/t/galera_as_slave_ctas.cnf new file mode 100644 index 00000000000..eab2a6de90d --- /dev/null +++ b/mysql-test/suite/galera/t/galera_as_slave_ctas.cnf @@ -0,0 +1,5 @@ +!include ../galera_2nodes_as_slave.cnf + +# make sure master server uses ROW format for replication +[mysqld] +binlog-format=row diff --git a/mysql-test/suite/galera/t/galera_as_slave_ctas.test b/mysql-test/suite/galera/t/galera_as_slave_ctas.test new file mode 100644 index 00000000000..b146b1ce3dc --- /dev/null +++ b/mysql-test/suite/galera/t/galera_as_slave_ctas.test @@ -0,0 +1,74 @@ +# +# Test Galera as a slave to a MySQL master +# +# The galera/galera_2node_slave.cnf describes the setup of the nodes +# also, for this test, master server must have binlog_format=ROW +# + +--source include/have_innodb.inc + +# As node #1 is not a Galera node, we connect to node #2 in order to run include/galera_cluster.inc +--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2 +--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 + +--connection node_2a +--disable_query_log +--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_1; +--enable_query_log +START SLAVE; + + +# make sure master server has binlog_format=ROW +--connection default +SHOW VARIABLES LIKE 'binlog_format'; + +# +# test phase one, issue CTAS with empty source table +# +--connection default +CREATE TABLE source (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; + +CREATE TABLE target AS SELECT * FROM source; + +--connection node_2a +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'target'; +--source include/wait_condition.inc + +--connection node_3 +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'target'; +--source include/wait_condition.inc + +# +# test phase two, issue CTAS with populated source table +# +--connection default +DROP TABLE target; +INSERT INTO source VALUES(1); + +CREATE TABLE target AS SELECT * FROM source; + +--connection node_2a +--let $wait_condition = SELECT COUNT(*) = 1 FROM target; +--source include/wait_condition.inc + +--connection node_3 +--let $wait_condition = SELECT COUNT(*) = 1 FROM target; +--source include/wait_condition.inc + +--connection default +DROP TABLE source; +DROP TABLE target; + +--connection node_3 +--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'target'; +--source include/wait_condition.inc + + +--connection node_2a +STOP SLAVE; +RESET SLAVE ALL; + +--connection default +RESET MASTER; + +--disconnect node_2a diff --git a/mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.cnf b/mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.cnf new file mode 100644 index 00000000000..01d2eb12630 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.cnf @@ -0,0 +1,6 @@ +!include ../galera_2nodes_as_slave.cnf + +[mysqld] +log-bin=mysqld-bin +log-slave-updates +binlog-format=ROW diff --git a/mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.test b/mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.test new file mode 100644 index 00000000000..2bbf6dfce12 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.test @@ -0,0 +1,74 @@ +# +# Test Galera as a slave to a MariaDB master using GTIDs +# +# suite/galera/galera_2nodes_as_slave.cnf describes the setup of the nodes +# suite/galera/t/galera_as_slave_gtid.cnf has the GTID options +# +# This test will replicate writes to MyISAM table and check that slave node is able +# to apply them. +# mysql.gtid_slave_pos table should be defined as innodb engine, original problem +# by writes to mysql.gtid_slave_pos, whereas the replicated transaction contained +# no innodb writes +# + +--source include/have_innodb.inc + +# As node #1 is not a Galera node, we connect to node #2 in order to run include/galera_cluster.inc +--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2 + +--connection node_2a +# make sure gtid_slave_pos is of innodb engine, mtr does not currently provide that +ALTER TABLE mysql.gtid_slave_pos engine = InnoDB; + +--disable_query_log +--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_1; +--enable_query_log +START SLAVE; + +--connection default +CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=MyISAM; +INSERT INTO t1 VALUES(1); + +SELECT LENGTH(@@global.gtid_binlog_state) > 1; +--let $gtid_binlog_state_node1 = `SELECT @@global.gtid_binlog_state;` + +--connection node_2a +--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; +--source include/wait_condition.inc + +--let $wait_condition = SELECT COUNT(*) = 1 FROM t1; +--source include/wait_condition.inc + +--disable_query_log +--eval SELECT '$gtid_binlog_state_node1' = @@global.gtid_binlog_state AS gtid_binlog_state_equal; +--enable_query_log + +--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 +SELECT COUNT(*) = 0 FROM t1; + +--disable_query_log +--eval SELECT '$gtid_binlog_state_node1' = @@global.gtid_binlog_state AS gtid_binlog_state_equal; +--enable_query_log + +--echo #cleanup +--connection default +DROP TABLE t1; +reset master; + +--connection node_2a +--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; +--source include/wait_condition.inc +STOP SLAVE; +RESET SLAVE ALL; +set global wsrep_on=OFF; +reset master; +set global wsrep_on=ON; + +--connection node_3 +--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; +--source include/wait_condition.inc + +set global wsrep_on=OFF; +reset master; +set global wsrep_on=ON; + diff --git a/mysql-test/suite/galera/t/galera_bf_background_statistics.cnf b/mysql-test/suite/galera/t/galera_bf_background_statistics.cnf new file mode 100644 index 00000000000..4101b4073ec --- /dev/null +++ b/mysql-test/suite/galera/t/galera_bf_background_statistics.cnf @@ -0,0 +1,9 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +innodb_stats_persistent=ON + +[mysqld.2] +innodb_stats_persistent=ON + + diff --git a/mysql-test/suite/galera/t/galera_bf_background_statistics.opt b/mysql-test/suite/galera/t/galera_bf_background_statistics.opt deleted file mode 100644 index f9b1414a974..00000000000 --- a/mysql-test/suite/galera/t/galera_bf_background_statistics.opt +++ /dev/null @@ -1 +0,0 @@ ---innodb_stats_persistent=ON diff --git a/mysql-test/suite/galera/t/galera_binlog_checksum-master.opt b/mysql-test/suite/galera/t/galera_binlog_checksum-master.opt deleted file mode 100644 index c8e53f07fc2..00000000000 --- a/mysql-test/suite/galera/t/galera_binlog_checksum-master.opt +++ /dev/null @@ -1 +0,0 @@ ---binlog-checksum=CRC32 --master-verify-checksum=1 --slave-sql-verify-checksum=1 diff --git a/mysql-test/suite/galera/t/galera_binlog_checksum.cnf b/mysql-test/suite/galera/t/galera_binlog_checksum.cnf new file mode 100644 index 00000000000..bd61ee67406 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_binlog_checksum.cnf @@ -0,0 +1,13 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +binlog-checksum=CRC32 +master-verify-checksum=1 +slave-sql-verify-checksum=1 + +[mysqld.2] +binlog-checksum=CRC32 +master-verify-checksum=1 +slave-sql-verify-checksum=1 + + diff --git a/mysql-test/suite/galera/t/galera_binlog_event_max_size_max-master.opt b/mysql-test/suite/galera/t/galera_binlog_event_max_size_max-master.opt deleted file mode 100644 index 576829cfef8..00000000000 --- a/mysql-test/suite/galera/t/galera_binlog_event_max_size_max-master.opt +++ /dev/null @@ -1 +0,0 @@ ---binlog-row-event-max-size=4294967040 diff --git a/mysql-test/suite/galera/t/galera_binlog_event_max_size_max.cnf b/mysql-test/suite/galera/t/galera_binlog_event_max_size_max.cnf new file mode 100644 index 00000000000..9315086a3cc --- /dev/null +++ b/mysql-test/suite/galera/t/galera_binlog_event_max_size_max.cnf @@ -0,0 +1,9 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +binlog-row-event-max-size=4294967040 + +[mysqld.2] + + + diff --git a/mysql-test/suite/galera/t/galera_binlog_event_max_size_min-master.opt b/mysql-test/suite/galera/t/galera_binlog_event_max_size_min-master.opt deleted file mode 100644 index 22174756652..00000000000 --- a/mysql-test/suite/galera/t/galera_binlog_event_max_size_min-master.opt +++ /dev/null @@ -1 +0,0 @@ ---binlog-row-event-max-size=256 diff --git a/mysql-test/suite/galera/t/galera_binlog_event_max_size_min.cnf b/mysql-test/suite/galera/t/galera_binlog_event_max_size_min.cnf new file mode 100644 index 00000000000..798435d8e54 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_binlog_event_max_size_min.cnf @@ -0,0 +1,9 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +binlog-row-event-max-size=256 + +[mysqld.2] + + + diff --git a/mysql-test/suite/galera/t/galera_flush-master.opt b/mysql-test/suite/galera/t/galera_flush-master.opt deleted file mode 100644 index 5a1fb6748d9..00000000000 --- a/mysql-test/suite/galera/t/galera_flush-master.opt +++ /dev/null @@ -1 +0,0 @@ ---query_cache_type=1 --query_cache_size=1000000 diff --git a/mysql-test/suite/galera/t/galera_flush.cnf b/mysql-test/suite/galera/t/galera_flush.cnf new file mode 100644 index 00000000000..e2d869ab364 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_flush.cnf @@ -0,0 +1,10 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +query_cache_type=1 +query_cache_size=1000000 + +[mysqld.2] +query_cache_type=1 +query_cache_size=1000000 + diff --git a/mysql-test/suite/galera/t/galera_flush_local.cnf b/mysql-test/suite/galera/t/galera_flush_local.cnf new file mode 100644 index 00000000000..c92cb58f484 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_flush_local.cnf @@ -0,0 +1,12 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +query_cache_type=1 +query_cache_size=1000000 +wsrep_replicate_myisam=ON + +[mysqld.2] +query_cache_type=1 +query_cache_size=1000000 +wsrep_replicate_myisam=ON + diff --git a/mysql-test/suite/galera/t/galera_flush_local.opt b/mysql-test/suite/galera/t/galera_flush_local.opt deleted file mode 100644 index a084db15c5d..00000000000 --- a/mysql-test/suite/galera/t/galera_flush_local.opt +++ /dev/null @@ -1,3 +0,0 @@ ---query_cache_type=1 ---query_cache_size=1000000 ---wsrep_replicate_myisam=ON diff --git a/mysql-test/suite/galera/t/galera_forced_binlog_format.test b/mysql-test/suite/galera/t/galera_forced_binlog_format.test index e9d7fa1c3a3..786837239ed 100644 --- a/mysql-test/suite/galera/t/galera_forced_binlog_format.test +++ b/mysql-test/suite/galera/t/galera_forced_binlog_format.test @@ -7,17 +7,21 @@ --source include/galera_cluster.inc --connection node_1 -SEt GLOBAL wsrep_on=OFF; +SET GLOBAL wsrep_on=OFF; RESET MASTER; -SEt GLOBAL wsrep_on=ON; +SET GLOBAL wsrep_on=ON; FLUSH BINARY LOGS; +--disable_warnings SET SESSION binlog_format = 'STATEMENT'; +--enable_warnings CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); +--disable_warnings SET SESSION binlog_format = 'MIXED'; +--enable_warnings INSERT INTO t1 VALUES (2); diff --git a/mysql-test/suite/galera/t/galera_gtid.cnf b/mysql-test/suite/galera/t/galera_gtid.cnf new file mode 100644 index 00000000000..8f6a760def0 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_gtid.cnf @@ -0,0 +1,10 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +log-bin +log-slave-updates + +[mysqld.2] +log-bin +log-slave-updates + diff --git a/mysql-test/suite/galera/t/galera_gtid.test b/mysql-test/suite/galera/t/galera_gtid.test index e8369be62e6..560a320255f 100644 --- a/mysql-test/suite/galera/t/galera_gtid.test +++ b/mysql-test/suite/galera/t/galera_gtid.test @@ -11,14 +11,18 @@ CREATE TABLE t1 (f1 INT PRIMARY KEY); INSERT INTO t1 VALUES (1); --connection node_2 -SELECT COUNT(*) = 1 FROM t1; +--let $wait_condition = SELECT COUNT(*) = 1 FROM t1 +--source include/wait_condition.inc UPDATE t1 SET f1 = 2; --let $gtid_binlog_state_node2 = `SELECT @@global.gtid_binlog_state;` --connection node_1 -SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2; +SET SESSION wsrep_sync_wait = 15; +--let $wait_condition = SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2 +--source include/wait_condition.inc +SELECT * from t1; --disable_query_log --eval SELECT '$gtid_binlog_state_node2' = @@global.gtid_binlog_state AS gtid_binlog_state_equal; diff --git a/mysql-test/suite/galera/t/galera_load_data.cnf b/mysql-test/suite/galera/t/galera_load_data.cnf index fd0327e0ecb..14d894fc7d0 100644 --- a/mysql-test/suite/galera/t/galera_load_data.cnf +++ b/mysql-test/suite/galera/t/galera_load_data.cnf @@ -1,6 +1,15 @@ !include ../galera_2nodes.cnf -[mysqld] +[mysqld.1] +secure-file-priv = "" +innodb_file_format ='Barracuda' +innodb_file_per_table = ON +innodb_stats_persistent=ON +innodb_stats_auto_recalc=ON +innodb_stats_persistent_sample_pages=20 +innodb_stats_sample_pages=8 + +[mysqld.2] secure-file-priv = "" innodb_file_format ='Barracuda' innodb_file_per_table = ON diff --git a/mysql-test/suite/galera/t/galera_log_bin-master.opt b/mysql-test/suite/galera/t/galera_log_bin-master.opt deleted file mode 100644 index 8a755e98b00..00000000000 --- a/mysql-test/suite/galera/t/galera_log_bin-master.opt +++ /dev/null @@ -1 +0,0 @@ ---log-bin --log-slave-updates diff --git a/mysql-test/suite/galera/t/galera_log_bin.cnf b/mysql-test/suite/galera/t/galera_log_bin.cnf new file mode 100644 index 00000000000..8f6a760def0 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_log_bin.cnf @@ -0,0 +1,10 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +log-bin +log-slave-updates + +[mysqld.2] +log-bin +log-slave-updates + diff --git a/mysql-test/suite/galera/t/galera_log_bin.test b/mysql-test/suite/galera/t/galera_log_bin.test index 828869a7e0f..cc78367b510 100644 --- a/mysql-test/suite/galera/t/galera_log_bin.test +++ b/mysql-test/suite/galera/t/galera_log_bin.test @@ -1,5 +1,5 @@ --source include/galera_cluster.inc ---source include/have_innodb.inc +--source include/force_restart.inc --connection node_1 set global wsrep_on=OFF; @@ -44,8 +44,3 @@ DROP TABLE t2; --connection node_1 SET GLOBAL wsrep_on=OFF; RESET MASTER; -SET GLOBAL wsrep_on=ON; ---connection node_2 -SET GLOBAL wsrep_on=OFF; -reset master; -SET GLOBAL wsrep_on=ON; diff --git a/mysql-test/suite/galera/t/galera_mdev_13787.cnf b/mysql-test/suite/galera/t/galera_mdev_13787.cnf new file mode 100644 index 00000000000..ada78e1db2a --- /dev/null +++ b/mysql-test/suite/galera/t/galera_mdev_13787.cnf @@ -0,0 +1,9 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +innodb-stats-persistent=1 + +[mysqld.2] +innodb-stats-persistent=1 + + diff --git a/mysql-test/suite/galera/t/galera_mdev_13787.opt b/mysql-test/suite/galera/t/galera_mdev_13787.opt deleted file mode 100644 index 27ec1e3f00e..00000000000 --- a/mysql-test/suite/galera/t/galera_mdev_13787.opt +++ /dev/null @@ -1 +0,0 @@ ---innodb-stats-persistent=1 diff --git a/mysql-test/suite/galera/t/galera_query_cache-master.opt b/mysql-test/suite/galera/t/galera_query_cache-master.opt deleted file mode 100644 index 915a36c0937..00000000000 --- a/mysql-test/suite/galera/t/galera_query_cache-master.opt +++ /dev/null @@ -1 +0,0 @@ ---query_cache_type=1 --query_cache_size=1355776 diff --git a/mysql-test/suite/galera/t/galera_query_cache.cnf b/mysql-test/suite/galera/t/galera_query_cache.cnf new file mode 100644 index 00000000000..80f40b0997e --- /dev/null +++ b/mysql-test/suite/galera/t/galera_query_cache.cnf @@ -0,0 +1,10 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +query_cache_type=1 +query_cache_size=1355776 + +[mysqld.2] +query_cache_type=1 +query_cache_size=1355776 + diff --git a/mysql-test/suite/galera/t/galera_query_cache_sync_wait-master.opt b/mysql-test/suite/galera/t/galera_query_cache_sync_wait-master.opt deleted file mode 100644 index 915a36c0937..00000000000 --- a/mysql-test/suite/galera/t/galera_query_cache_sync_wait-master.opt +++ /dev/null @@ -1 +0,0 @@ ---query_cache_type=1 --query_cache_size=1355776 diff --git a/mysql-test/suite/galera/t/galera_query_cache_sync_wait.cnf b/mysql-test/suite/galera/t/galera_query_cache_sync_wait.cnf new file mode 100644 index 00000000000..80f40b0997e --- /dev/null +++ b/mysql-test/suite/galera/t/galera_query_cache_sync_wait.cnf @@ -0,0 +1,10 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +query_cache_type=1 +query_cache_size=1355776 + +[mysqld.2] +query_cache_type=1 +query_cache_size=1355776 + diff --git a/mysql-test/suite/galera/t/galera_sbr_binlog-master.opt b/mysql-test/suite/galera/t/galera_sbr_binlog-master.opt deleted file mode 100644 index beae84b3862..00000000000 --- a/mysql-test/suite/galera/t/galera_sbr_binlog-master.opt +++ /dev/null @@ -1 +0,0 @@ ---log-bin diff --git a/mysql-test/suite/galera/t/galera_sbr_binlog.cnf b/mysql-test/suite/galera/t/galera_sbr_binlog.cnf new file mode 100644 index 00000000000..9dbd81f758d --- /dev/null +++ b/mysql-test/suite/galera/t/galera_sbr_binlog.cnf @@ -0,0 +1,7 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +log-bin + +[mysqld.2] +log-bin diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf b/mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf index be2ca0d1f09..a5c269b74e2 100644 --- a/mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf +++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf @@ -4,6 +4,8 @@ wsrep_sst_method=mariabackup wsrep_sst_auth="root:" wsrep_debug=1 +innodb-file-format='Barracuda' +innodb-file-per-table=ON [mysqld.1] wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true' diff --git a/mysql-test/suite/galera/t/galera_udf-master.opt b/mysql-test/suite/galera/t/galera_udf-master.opt deleted file mode 100644 index 14dfe3e20bc..00000000000 --- a/mysql-test/suite/galera/t/galera_udf-master.opt +++ /dev/null @@ -1,2 +0,0 @@ -$UDF_EXAMPLE_LIB_OPT ---query_cache_type=1 diff --git a/mysql-test/suite/galera/t/galera_udf.cnf b/mysql-test/suite/galera/t/galera_udf.cnf new file mode 100644 index 00000000000..69d5acd65f3 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_udf.cnf @@ -0,0 +1,15 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +$UDF_EXAMPLE_LIB_OPT +query_cache_type=1 + +[mysqld.2] +query_cache_type=1 + + + + + + + diff --git a/mysql-test/suite/galera/t/galera_v1_row_events-master.opt b/mysql-test/suite/galera/t/galera_v1_row_events-master.opt deleted file mode 100644 index dc82542128e..00000000000 --- a/mysql-test/suite/galera/t/galera_v1_row_events-master.opt +++ /dev/null @@ -1 +0,0 @@ ---log-bin-use-v1-row-events=1 diff --git a/mysql-test/suite/galera/t/galera_v1_row_events.cnf b/mysql-test/suite/galera/t/galera_v1_row_events.cnf new file mode 100644 index 00000000000..b95e321ad4f --- /dev/null +++ b/mysql-test/suite/galera/t/galera_v1_row_events.cnf @@ -0,0 +1,13 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +log-bin-use-v1-row-events=1 + +[mysqld.2] + + + + + + + diff --git a/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.cnf b/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.cnf new file mode 100644 index 00000000000..523bae68763 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.cnf @@ -0,0 +1,13 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +wsrep-auto-increment-control=ON + +[mysqld.2] +wsrep-auto-increment-control=ON + + + + + + diff --git a/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.opt b/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.opt deleted file mode 100644 index 0a03610888c..00000000000 --- a/mysql-test/suite/galera/t/galera_var_auto_inc_control_on.opt +++ /dev/null @@ -1 +0,0 @@ ---wsrep-auto-increment-control=ON diff --git a/mysql-test/suite/galera/t/galera_var_dirty_reads.test b/mysql-test/suite/galera/t/galera_var_dirty_reads.test index 859642a6fdf..85f72e633dc 100644 --- a/mysql-test/suite/galera/t/galera_var_dirty_reads.test +++ b/mysql-test/suite/galera/t/galera_var_dirty_reads.test @@ -3,9 +3,10 @@ # --source include/galera_cluster.inc ---source include/have_innodb.inc --source include/have_perfschema.inc +call mtr.add_suppression("WSREP has not yet prepared node for application use"); + # Save original auto_increment_offset values. --let $node_1=node_1 --let $node_2=node_2 @@ -30,10 +31,10 @@ SHOW STATUS LIKE 'wsrep_ready'; # Must return 'Disconnected' SHOW STATUS LIKE 'wsrep_cluster_status'; ---error ER_UNKNOWN_COM_ERROR +--error ER_UNKNOWN_COM_ERROR,1047 SELECT * FROM t1; ---error ER_UNKNOWN_COM_ERROR +--error ER_UNKNOWN_COM_ERROR,1047 SELECT 1 FROM t1; SET @@session.wsrep_dirty_reads=ON; @@ -45,7 +46,7 @@ SELECT i, variable_name, variable_value FROM t1, information_schema.session_vari SET @@session.wsrep_dirty_reads=OFF; ---error ER_UNKNOWN_COM_ERROR +--error ER_UNKNOWN_COM_ERROR,1047 SELECT i, variable_name, variable_value FROM t1, information_schema.session_variables WHERE variable_name LIKE "wsrep_dirty_reads" AND i = 1; diff --git a/mysql-test/suite/galera/t/galera_var_notify_cmd-master.opt b/mysql-test/suite/galera/t/galera_var_notify_cmd-master.opt deleted file mode 100644 index 70dfc98736b..00000000000 --- a/mysql-test/suite/galera/t/galera_var_notify_cmd-master.opt +++ /dev/null @@ -1 +0,0 @@ ---wsrep_notify_cmd=$MYSQL_TEST_DIR/std_data/wsrep_notify.sh --wsrep-sync-wait=0 diff --git a/mysql-test/suite/galera/t/galera_var_notify_cmd.cnf b/mysql-test/suite/galera/t/galera_var_notify_cmd.cnf new file mode 100644 index 00000000000..69df4f0e7e0 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_var_notify_cmd.cnf @@ -0,0 +1,13 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +wsrep_notify_cmd=$MYSQL_TEST_DIR/std_data/wsrep_notify.sh +wsrep-sync-wait=0 + +[mysqld.2] + + + + + + diff --git a/mysql-test/suite/galera/t/galera_var_notify_cmd.test b/mysql-test/suite/galera/t/galera_var_notify_cmd.test index b261f878ced..2b0852b4870 100644 --- a/mysql-test/suite/galera/t/galera_var_notify_cmd.test +++ b/mysql-test/suite/galera/t/galera_var_notify_cmd.test @@ -3,10 +3,10 @@ # notifications into a table. # ---source include/have_innodb.inc --source include/galera_cluster.inc --connection node_1 -SELECT COUNT(DISTINCT uuid) = 2 FROM mtr_wsrep_notify.membership; -SELECT MAX(size) = 2 FROM mtr_wsrep_notify.status; -SELECT COUNT(DISTINCT idx) = 2 FROM mtr_wsrep_notify.status; +SET SESSION wsrep_sync_wait=15; +SELECT COUNT(DISTINCT uuid) FROM mtr_wsrep_notify.membership; +SELECT MAX(size) FROM mtr_wsrep_notify.status; +SELECT COUNT(DISTINCT idx) FROM mtr_wsrep_notify.status; diff --git a/mysql-test/suite/galera/t/galera_var_reject_queries.test b/mysql-test/suite/galera/t/galera_var_reject_queries.test index 8b80c04e3be..aa31b94d6e0 100644 --- a/mysql-test/suite/galera/t/galera_var_reject_queries.test +++ b/mysql-test/suite/galera/t/galera_var_reject_queries.test @@ -5,6 +5,8 @@ --source include/galera_cluster.inc --source include/have_innodb.inc +call mtr.add_suppression("WSREP has not yet prepared node for application use"); + CREATE TABLE t1 (f1 INTEGER); --connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 @@ -15,7 +17,7 @@ SET SESSION wsrep_reject_queries = ALL; SET GLOBAL wsrep_reject_queries = ALL; ---error ER_UNKNOWN_COM_ERROR +--error ER_UNKNOWN_COM_ERROR,1047 SELECT * FROM t1; # @@ -30,7 +32,7 @@ SET GLOBAL wsrep_reject_queries = ALL_KILL; SELECT * FROM t1; --connect node_1b, 127.0.0.1, root, , test, $NODE_MYPORT_1 ---error ER_UNKNOWN_COM_ERROR +--error ER_UNKNOWN_COM_ERROR,1047 SELECT * FROM t1; # Confirm that replication continues diff --git a/mysql-test/suite/galera/t/galera_var_sst_auth.cnf b/mysql-test/suite/galera/t/galera_var_sst_auth.cnf new file mode 100644 index 00000000000..ff29db2306b --- /dev/null +++ b/mysql-test/suite/galera/t/galera_var_sst_auth.cnf @@ -0,0 +1,12 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +wsrep_sst_auth=root: + +[mysqld.2] +wsrep_sst_auth=root: + + + + + diff --git a/mysql-test/suite/galera/t/galera_var_sst_auth.opt b/mysql-test/suite/galera/t/galera_var_sst_auth.opt deleted file mode 100644 index 67babbb1ae7..00000000000 --- a/mysql-test/suite/galera/t/galera_var_sst_auth.opt +++ /dev/null @@ -1 +0,0 @@ ---wsrep_sst_auth=root: diff --git a/mysql-test/suite/galera/t/galera_wsrep_log_conficts-master.opt b/mysql-test/suite/galera/t/galera_wsrep_log_conficts-master.opt deleted file mode 100644 index 930c483bd64..00000000000 --- a/mysql-test/suite/galera/t/galera_wsrep_log_conficts-master.opt +++ /dev/null @@ -1 +0,0 @@ ---wsrep_log_conflicts=ON diff --git a/mysql-test/suite/galera/t/galera_wsrep_log_conficts.cnf b/mysql-test/suite/galera/t/galera_wsrep_log_conficts.cnf new file mode 100644 index 00000000000..440c37bea81 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_wsrep_log_conficts.cnf @@ -0,0 +1,12 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +wsrep_log_conflicts=ON + +[mysqld.2] +wsrep_log_conflicts=ON + + + + + diff --git a/mysql-test/suite/galera/t/galera_wsrep_new_cluster-master.opt b/mysql-test/suite/galera/t/galera_wsrep_new_cluster-master.opt deleted file mode 100644 index c31150c46af..00000000000 --- a/mysql-test/suite/galera/t/galera_wsrep_new_cluster-master.opt +++ /dev/null @@ -1 +0,0 @@ ---wsrep-new-cluster diff --git a/mysql-test/suite/galera/t/galera_wsrep_new_cluster.cnf b/mysql-test/suite/galera/t/galera_wsrep_new_cluster.cnf new file mode 100644 index 00000000000..0acbcfb7843 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_wsrep_new_cluster.cnf @@ -0,0 +1,10 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +wsrep-new-cluster + +[mysqld.2] + + + + diff --git a/mysql-test/suite/galera/t/mysql-wsrep#201-master.opt b/mysql-test/suite/galera/t/mysql-wsrep#201-master.opt deleted file mode 100644 index a00258bc48c..00000000000 --- a/mysql-test/suite/galera/t/mysql-wsrep#201-master.opt +++ /dev/null @@ -1 +0,0 @@ ---query_cache_type=1 diff --git a/mysql-test/suite/galera/t/mysql-wsrep#201.cnf b/mysql-test/suite/galera/t/mysql-wsrep#201.cnf new file mode 100644 index 00000000000..4a82e9fa037 --- /dev/null +++ b/mysql-test/suite/galera/t/mysql-wsrep#201.cnf @@ -0,0 +1,9 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +query_cache_type=1 + +[mysqld.2] +query_cache_type=1 + + diff --git a/mysql-test/suite/galera/t/query_cache.cnf b/mysql-test/suite/galera/t/query_cache.cnf new file mode 100644 index 00000000000..4a82e9fa037 --- /dev/null +++ b/mysql-test/suite/galera/t/query_cache.cnf @@ -0,0 +1,9 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +query_cache_type=1 + +[mysqld.2] +query_cache_type=1 + + diff --git a/mysql-test/suite/galera/t/query_cache.opt b/mysql-test/suite/galera/t/query_cache.opt deleted file mode 100644 index a00258bc48c..00000000000 --- a/mysql-test/suite/galera/t/query_cache.opt +++ /dev/null @@ -1 +0,0 @@ ---query_cache_type=1 diff --git a/mysql-test/suite/innodb/r/innodb-32k-crash.result b/mysql-test/suite/innodb/r/innodb-32k-crash.result index 4c79015f2bc..438d5350263 100644 --- a/mysql-test/suite/innodb/r/innodb-32k-crash.result +++ b/mysql-test/suite/innodb/r/innodb-32k-crash.result @@ -1,4 +1,3 @@ -call mtr.add_suppression("Cannot add field `u` in table `test`.`t2` because after adding it, the row size is"); CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob, h blob,i blob,j blob,k blob,l blob,m blob,n blob, o blob,p blob,q blob,r blob,s blob,t blob,u blob, diff --git a/mysql-test/suite/innodb/r/innodb-64k-crash.result b/mysql-test/suite/innodb/r/innodb-64k-crash.result index da481e0ec29..1f3b41f75a6 100644 --- a/mysql-test/suite/innodb/r/innodb-64k-crash.result +++ b/mysql-test/suite/innodb/r/innodb-64k-crash.result @@ -1,4 +1,3 @@ -call mtr.add_suppression("Cannot add field `pa` in table `test`.`t2` because after adding it, the row size is"); CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob, h blob,i blob,j blob,k blob,l blob,m blob,n blob, o blob,p blob,q blob,r blob,s blob,t blob,u blob, diff --git a/mysql-test/suite/innodb/r/innodb-mdev-7513.result b/mysql-test/suite/innodb/r/innodb-mdev-7513.result index 2370b7313c8..24afa594003 100644 --- a/mysql-test/suite/innodb/r/innodb-mdev-7513.result +++ b/mysql-test/suite/innodb/r/innodb-mdev-7513.result @@ -1,4 +1,3 @@ -call mtr.add_suppression("InnoDB: Cannot add field .* in table"); CREATE TABLE t1 ( text1 TEXT, text2 TEXT, text3 TEXT, diff --git a/mysql-test/suite/innodb/r/innodb_max_recordsize_32k.result b/mysql-test/suite/innodb/r/innodb_max_recordsize_32k.result index f62aa132108..fc41d0b1471 100644 --- a/mysql-test/suite/innodb/r/innodb_max_recordsize_32k.result +++ b/mysql-test/suite/innodb/r/innodb_max_recordsize_32k.result @@ -1,4 +1,3 @@ -call mtr.add_suppression('InnoDB: Cannot add field.*because after adding it, the row size is'); SELECT @@innodb_page_size; @@innodb_page_size 32768 diff --git a/mysql-test/suite/innodb/r/innodb_max_recordsize_64k.result b/mysql-test/suite/innodb/r/innodb_max_recordsize_64k.result index f65d2995429..a9683016925 100644 --- a/mysql-test/suite/innodb/r/innodb_max_recordsize_64k.result +++ b/mysql-test/suite/innodb/r/innodb_max_recordsize_64k.result @@ -1,4 +1,3 @@ -call mtr.add_suppression('InnoDB: Cannot add field.*because after adding it, the row size is'); SELECT @@innodb_page_size; @@innodb_page_size 65536 diff --git a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result index 0c2c456c77c..4737467aeca 100644 --- a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result +++ b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result @@ -96,7 +96,7 @@ buffer_LRU_batch_flush_avg_time_thread buffer 0 NULL NULL NULL 0 NULL NULL NULL buffer_flush_adaptive_avg_time_est buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Estimated time (ms) spent for adaptive flushing recently. buffer_LRU_batch_flush_avg_time_est buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Estimated time (ms) spent for LRU batch flushing recently. buffer_flush_avg_time buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Avg time (ms) spent for flushing recently. -buffer_flush_adaptive_avg_pass buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Numner of adaptive flushes passed during the recent Avg period. +buffer_flush_adaptive_avg_pass buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of adaptive flushes passed during the recent Avg period. buffer_LRU_batch_flush_avg_pass buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of LRU batch flushes passed during the recent Avg period. buffer_flush_avg_pass buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of flushes passed during the recent Avg period. buffer_LRU_get_free_loops buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Total loops in LRU get free. diff --git a/mysql-test/suite/innodb/r/instant_alter,4k.rdiff b/mysql-test/suite/innodb/r/instant_alter,4k.rdiff index f03afb97f60..113504d97e4 100644 --- a/mysql-test/suite/innodb/r/instant_alter,4k.rdiff +++ b/mysql-test/suite/innodb/r/instant_alter,4k.rdiff @@ -1,5 +1,5 @@ ---- instant_alter.result -+++ instant_alter,4k.result +--- suite/innodb/r/instant_alter.result 2019-12-05 10:54:59.611505580 +0100 ++++ suite/innodb/r/instant_alter,4k.reject 2019-12-05 11:47:54.013615820 +0100 @@ -242,7 +242,7 @@ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE name = 'test/t2'; @@ -53,10 +53,10 @@ ALTER TABLE t3 ADD COLUMN b BLOB NOT NULL; +ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 1979. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +SET innodb_strict_mode = OFF; -+affected rows: 0 -+ALTER TABLE t3 ADD COLUMN b BLOB NOT NULL; affected rows: 0 -info: Records: 0 Duplicates: 0 Warnings: 0 ++ALTER TABLE t3 ADD COLUMN b BLOB NOT NULL; ++affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 1 +Warnings: +Warning 139 Row size too large (> 1979). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. @@ -130,7 +130,7 @@ connection default; InnoDB 0 transactions not purged DROP TABLE t1,t2,t3,t4,big; -@@ -1091,7 +1111,7 @@ +@@ -1119,7 +1139,7 @@ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE name = 'test/t2'; clust_index_size @@ -139,7 +139,7 @@ connection default; ROLLBACK; connection analyze; -@@ -1102,7 +1122,7 @@ +@@ -1130,7 +1150,7 @@ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE name = 'test/t2'; clust_index_size @@ -148,7 +148,7 @@ connection default; BEGIN; UPDATE t2 SET d1 = repeat(id, 200); -@@ -1114,7 +1134,7 @@ +@@ -1142,7 +1162,7 @@ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE name = 'test/t2'; clust_index_size @@ -157,7 +157,7 @@ connection default; ROLLBACK; connection analyze; -@@ -1125,11 +1145,13 @@ +@@ -1153,11 +1173,13 @@ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE name = 'test/t2'; clust_index_size @@ -173,7 +173,7 @@ SELECT * FROM t2; id c1 d1 1 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf -@@ -1174,7 +1196,9 @@ +@@ -1202,7 +1224,9 @@ info: Records: 0 Duplicates: 0 Warnings: 0 ALTER TABLE t3 ADD COLUMN b BLOB NOT NULL; affected rows: 0 @@ -184,7 +184,7 @@ INSERT INTO t3 SET id=4; ERROR HY000: Field 'c2' doesn't have a default value INSERT INTO t3 SET id=4, c2=0, b=0xf09f98b1; -@@ -1187,7 +1211,9 @@ +@@ -1215,7 +1239,9 @@ ALTER TABLE t3 CHANGE t phrase TEXT DEFAULT 0xc3a4c3a448, CHANGE b b BLOB NOT NULL DEFAULT 'binary line of business'; affected rows: 4 @@ -195,7 +195,7 @@ INSERT INTO t3 SET id=5, c2=9; Warnings: Note 1265 Data truncated for column 'c7' at row 1 -@@ -1201,7 +1227,9 @@ +@@ -1229,7 +1255,9 @@ 5 9 POLYGON((1 1,2 2,3 3,1 1)) 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 03:00:42 1970-01-01 ääH binary line of business ALTER TABLE t3 DROP c3, DROP c7; affected rows: 0 @@ -206,7 +206,7 @@ SELECT * FROM t3; id c2 c4 c5 c6 c8 phrase b 1 1 1970-01-01 03:00:42 1970-01-01 03:00:42 NULL 1970-01-01 The quick brown fox jumps over the lazy dog -@@ -1229,6 +1257,8 @@ +@@ -1257,6 +1285,8 @@ (id INT PRIMARY KEY, c1 VARCHAR(4000), c2 VARCHAR(4000), c3 VARCHAR(1000), p POINT NOT NULL DEFAULT ST_GeomFromText('POINT(0 0)'), SPATIAL INDEX(p)) ENGINE=InnoDB ROW_FORMAT=COMPACT; @@ -215,7 +215,7 @@ BEGIN; INSERT INTO big SET id=1, c1=REPEAT('a', 200), c2=REPEAT('b', 200), c3=REPEAT('c', 159); -@@ -1247,13 +1277,15 @@ +@@ -1275,13 +1305,15 @@ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE name = 'test/big'; clust_index_size @@ -233,7 +233,7 @@ CHECKSUM TABLE big; Table Checksum test.big 1705165209 -@@ -1271,7 +1303,7 @@ +@@ -1299,7 +1331,7 @@ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE name = 'test/big'; clust_index_size @@ -242,7 +242,7 @@ connection default; ROLLBACK; CHECKSUM TABLE big; -@@ -1285,7 +1317,7 @@ +@@ -1313,7 +1345,7 @@ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE name = 'test/big'; clust_index_size @@ -251,7 +251,7 @@ connection default; InnoDB 0 transactions not purged DROP TABLE t1,t2,t3,t4,big; -@@ -1940,7 +1972,7 @@ +@@ -1996,7 +2028,7 @@ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE name = 'test/t2'; clust_index_size @@ -260,7 +260,7 @@ connection default; ROLLBACK; connection analyze; -@@ -1951,7 +1983,7 @@ +@@ -2007,7 +2039,7 @@ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE name = 'test/t2'; clust_index_size @@ -269,7 +269,7 @@ connection default; BEGIN; UPDATE t2 SET d1 = repeat(id, 200); -@@ -1963,7 +1995,7 @@ +@@ -2019,7 +2051,7 @@ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE name = 'test/t2'; clust_index_size @@ -278,7 +278,7 @@ connection default; ROLLBACK; connection analyze; -@@ -1974,7 +2006,7 @@ +@@ -2030,7 +2062,7 @@ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE name = 'test/t2'; clust_index_size @@ -287,7 +287,7 @@ connection default; ALTER TABLE t2 DROP p; affected rows: 0 -@@ -2096,7 +2128,7 @@ +@@ -2152,7 +2184,7 @@ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE name = 'test/big'; clust_index_size @@ -296,7 +296,7 @@ connection default; ALTER TABLE big ADD COLUMN (d1 INT DEFAULT 0, d2 VARCHAR(20) DEFAULT 'abcde', -@@ -2120,7 +2152,7 @@ +@@ -2176,7 +2208,7 @@ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE name = 'test/big'; clust_index_size @@ -305,7 +305,7 @@ connection default; ROLLBACK; CHECKSUM TABLE big; -@@ -2134,7 +2166,7 @@ +@@ -2190,7 +2222,7 @@ SELECT clust_index_size FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS WHERE name = 'test/big'; clust_index_size @@ -314,12 +314,12 @@ connection default; InnoDB 0 transactions not purged DROP TABLE t1,t2,t3,t4,big; -@@ -2607,7 +2639,7 @@ +@@ -2691,7 +2723,7 @@ FROM information_schema.global_status WHERE variable_name = 'innodb_instant_alter_column'; instants --193 -+195 +-196 ++198 SET GLOBAL innodb_purge_rseg_truncate_frequency= @saved_frequency; # # MDEV-18266: Changing an index comment unnecessarily rebuilds index diff --git a/mysql-test/suite/innodb/r/instant_alter.result b/mysql-test/suite/innodb/r/instant_alter.result index e335840bc66..d1ae07f545b 100644 --- a/mysql-test/suite/innodb/r/instant_alter.result +++ b/mysql-test/suite/innodb/r/instant_alter.result @@ -519,6 +519,13 @@ CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check status OK DROP TABLE t1; +SET innodb_strict_mode = ON; +CREATE TABLE t1 (a INT, b VARCHAR(500), c TEXT, UNIQUE(a,b)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT; +ALTER TABLE t1 ADD d TEXT; +ALTER TABLE t1 ADD PRIMARY KEY (b,a); +ALTER TABLE t1 ADD va INT AS (a) VIRTUAL; +DROP TABLE t1; +SET innodb_strict_mode = OFF; CREATE TABLE t1 (a INT, b INT UNIQUE) ENGINE=InnoDB ROW_FORMAT=REDUNDANT; INSERT INTO t1 (a) VALUES (NULL), (NULL); ALTER TABLE t1 DROP a, ADD COLUMN a INT; @@ -1389,6 +1396,13 @@ CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check status OK DROP TABLE t1; +SET innodb_strict_mode = ON; +CREATE TABLE t1 (a INT, b VARCHAR(500), c TEXT, UNIQUE(a,b)) ENGINE=InnoDB ROW_FORMAT=COMPACT; +ALTER TABLE t1 ADD d TEXT; +ALTER TABLE t1 ADD PRIMARY KEY (b,a); +ALTER TABLE t1 ADD va INT AS (a) VIRTUAL; +DROP TABLE t1; +SET innodb_strict_mode = OFF; CREATE TABLE t1 (a INT, b INT UNIQUE) ENGINE=InnoDB ROW_FORMAT=COMPACT; INSERT INTO t1 (a) VALUES (NULL), (NULL); ALTER TABLE t1 DROP a, ADD COLUMN a INT; @@ -2259,6 +2273,13 @@ CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check status OK DROP TABLE t1; +SET innodb_strict_mode = ON; +CREATE TABLE t1 (a INT, b VARCHAR(500), c TEXT, UNIQUE(a,b)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC; +ALTER TABLE t1 ADD d TEXT; +ALTER TABLE t1 ADD PRIMARY KEY (b,a); +ALTER TABLE t1 ADD va INT AS (a) VIRTUAL; +DROP TABLE t1; +SET innodb_strict_mode = OFF; CREATE TABLE t1 (a INT, b INT UNIQUE) ENGINE=InnoDB ROW_FORMAT=DYNAMIC; INSERT INTO t1 (a) VALUES (NULL), (NULL); ALTER TABLE t1 DROP a, ADD COLUMN a INT; @@ -2670,7 +2691,7 @@ SELECT variable_value-@old_instant instants FROM information_schema.global_status WHERE variable_name = 'innodb_instant_alter_column'; instants -193 +196 SET GLOBAL innodb_purge_rseg_truncate_frequency= @saved_frequency; # # MDEV-18266: Changing an index comment unnecessarily rebuilds index diff --git a/mysql-test/suite/innodb/r/instant_alter_bugs.result b/mysql-test/suite/innodb/r/instant_alter_bugs.result index 95efacf294b..4512542f612 100644 --- a/mysql-test/suite/innodb/r/instant_alter_bugs.result +++ b/mysql-test/suite/innodb/r/instant_alter_bugs.result @@ -171,6 +171,7 @@ DROP FOREIGN KEY fk1, CHANGE b d INT UNSIGNED, ADD c INT; DROP TABLE t2, t1; +# End of 10.3 tests create table t ( a varchar(9), b int, diff --git a/mysql-test/suite/innodb/r/row_size_error_log_warnings_3.result b/mysql-test/suite/innodb/r/row_size_error_log_warnings_3.result new file mode 100644 index 00000000000..c175f8ee915 --- /dev/null +++ b/mysql-test/suite/innodb/r/row_size_error_log_warnings_3.result @@ -0,0 +1,21 @@ +call mtr.add_suppression("InnoDB: Cannot add field .* in table .* because after adding it, the row size is .* which is greater than maximum allowed size (.*) for a record on index leaf page."); +SET innodb_strict_mode = 0; +SET @@global.log_warnings = 3; +CREATE TABLE t1 ( +col_1 TEXT +,col_2 TEXT +,col_3 TEXT +,col_4 TEXT +,col_5 TEXT +,col_6 TEXT +,col_7 TEXT +,col_8 TEXT +,col_9 TEXT +,col_10 TEXT +,col_11 TEXT +) ENGINE=INNODB ROW_FORMAT=COMPACT; +Warnings: +Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. +DROP TABLE t1; +SET @@global.log_warnings = 2; +SET innodb_strict_mode = 1; diff --git a/mysql-test/suite/innodb/r/undo_log.result b/mysql-test/suite/innodb/r/undo_log.result index 7892e26d896..cda3b190ede 100644 --- a/mysql-test/suite/innodb/r/undo_log.result +++ b/mysql-test/suite/innodb/r/undo_log.result @@ -1,4 +1,3 @@ -call mtr.add_suppression("Cannot add field `b_str_20` in table `test`.`test_tab` because after adding it, the row size is"); SET innodb_strict_mode=OFF; CREATE TABLE test_tab ( a_str_18 mediumtext, diff --git a/mysql-test/suite/innodb/t/innodb-32k-crash.test b/mysql-test/suite/innodb/t/innodb-32k-crash.test index da6d91f351e..178b32d54c9 100644 --- a/mysql-test/suite/innodb/t/innodb-32k-crash.test +++ b/mysql-test/suite/innodb/t/innodb-32k-crash.test @@ -5,8 +5,6 @@ let $MYSQLD_DATADIR= `select @@datadir`; -call mtr.add_suppression("Cannot add field `u` in table `test`.`t2` because after adding it, the row size is"); - CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob, h blob,i blob,j blob,k blob,l blob,m blob,n blob, o blob,p blob,q blob,r blob,s blob,t blob,u blob, diff --git a/mysql-test/suite/innodb/t/innodb-64k-crash.test b/mysql-test/suite/innodb/t/innodb-64k-crash.test index cbec1a452c7..93f6f79edf3 100644 --- a/mysql-test/suite/innodb/t/innodb-64k-crash.test +++ b/mysql-test/suite/innodb/t/innodb-64k-crash.test @@ -5,8 +5,6 @@ let $MYSQLD_DATADIR= `select @@datadir`; -call mtr.add_suppression("Cannot add field `pa` in table `test`.`t2` because after adding it, the row size is"); - CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob, h blob,i blob,j blob,k blob,l blob,m blob,n blob, o blob,p blob,q blob,r blob,s blob,t blob,u blob, diff --git a/mysql-test/suite/innodb/t/innodb-mdev-7513.test b/mysql-test/suite/innodb/t/innodb-mdev-7513.test index c0e16b9e9d2..b824cbcfa60 100644 --- a/mysql-test/suite/innodb/t/innodb-mdev-7513.test +++ b/mysql-test/suite/innodb/t/innodb-mdev-7513.test @@ -3,7 +3,6 @@ # MDEV-7513: ib_warn_row_too_big dereferences null thd -call mtr.add_suppression("InnoDB: Cannot add field .* in table"); --disable_warnings CREATE TABLE t1 ( text1 TEXT, diff --git a/mysql-test/suite/innodb/t/innodb_max_recordsize_32k.test b/mysql-test/suite/innodb/t/innodb_max_recordsize_32k.test index 5041612bec1..89bace5d9b1 100644 --- a/mysql-test/suite/innodb/t/innodb_max_recordsize_32k.test +++ b/mysql-test/suite/innodb/t/innodb_max_recordsize_32k.test @@ -1,8 +1,6 @@ --source include/have_innodb.inc --source include/have_innodb_32k.inc -call mtr.add_suppression('InnoDB: Cannot add field.*because after adding it, the row size is'); - # Check page size 32k SELECT @@innodb_page_size; diff --git a/mysql-test/suite/innodb/t/innodb_max_recordsize_64k.test b/mysql-test/suite/innodb/t/innodb_max_recordsize_64k.test index 5b06b57d4b4..4b4faf16f58 100644 --- a/mysql-test/suite/innodb/t/innodb_max_recordsize_64k.test +++ b/mysql-test/suite/innodb/t/innodb_max_recordsize_64k.test @@ -1,8 +1,6 @@ --source include/have_innodb.inc --source include/have_innodb_64k.inc -call mtr.add_suppression('InnoDB: Cannot add field.*because after adding it, the row size is'); - # Check page size 64k SELECT @@innodb_page_size; diff --git a/mysql-test/suite/innodb/t/instant_alter.test b/mysql-test/suite/innodb/t/instant_alter.test index 099c9487cb2..2a2bd6660c3 100644 --- a/mysql-test/suite/innodb/t/instant_alter.test +++ b/mysql-test/suite/innodb/t/instant_alter.test @@ -406,6 +406,18 @@ DELETE FROM t1; CHECK TABLE t1; DROP TABLE t1; +# MDEV-21172 Memory leak during ADD PRIMARY KEY + +SET innodb_strict_mode = ON; +eval CREATE TABLE t1 (a INT, b VARCHAR(500), c TEXT, UNIQUE(a,b)) $engine; +ALTER TABLE t1 ADD d TEXT; +--error 0,ER_TOO_BIG_ROWSIZE +ALTER TABLE t1 ADD PRIMARY KEY (b,a); +# Exploit MDEV-17468 to force the table definition to be reloaded +ALTER TABLE t1 ADD va INT AS (a) VIRTUAL; +DROP TABLE t1; +SET innodb_strict_mode = OFF; + # MDEV-15562 Instant DROP/ADD/reorder columns eval CREATE TABLE t1 (a INT, b INT UNIQUE) $engine; diff --git a/mysql-test/suite/innodb/t/instant_alter_bugs.test b/mysql-test/suite/innodb/t/instant_alter_bugs.test index ac93089e60e..0a1de256b6a 100644 --- a/mysql-test/suite/innodb/t/instant_alter_bugs.test +++ b/mysql-test/suite/innodb/t/instant_alter_bugs.test @@ -172,6 +172,7 @@ ALTER TABLE t2 CHANGE b d INT UNSIGNED, ADD c INT; DROP TABLE t2, t1; +--echo # End of 10.3 tests create table t ( diff --git a/mysql-test/suite/innodb/t/row_size_error_log_warnings_3.test b/mysql-test/suite/innodb/t/row_size_error_log_warnings_3.test new file mode 100644 index 00000000000..35b86cc4c46 --- /dev/null +++ b/mysql-test/suite/innodb/t/row_size_error_log_warnings_3.test @@ -0,0 +1,24 @@ +--source include/have_innodb.inc + +call mtr.add_suppression("InnoDB: Cannot add field .* in table .* because after adding it, the row size is .* which is greater than maximum allowed size (.*) for a record on index leaf page."); + +SET innodb_strict_mode = 0; +SET @@global.log_warnings = 3; + +CREATE TABLE t1 ( + col_1 TEXT + ,col_2 TEXT + ,col_3 TEXT + ,col_4 TEXT + ,col_5 TEXT + ,col_6 TEXT + ,col_7 TEXT + ,col_8 TEXT + ,col_9 TEXT + ,col_10 TEXT + ,col_11 TEXT +) ENGINE=INNODB ROW_FORMAT=COMPACT; +DROP TABLE t1; + +SET @@global.log_warnings = 2; +SET innodb_strict_mode = 1; diff --git a/mysql-test/suite/innodb/t/undo_log.test b/mysql-test/suite/innodb/t/undo_log.test index 94322868b06..150d50c2e75 100644 --- a/mysql-test/suite/innodb/t/undo_log.test +++ b/mysql-test/suite/innodb/t/undo_log.test @@ -1,7 +1,5 @@ --source include/have_innodb.inc -call mtr.add_suppression("Cannot add field `b_str_20` in table `test`.`test_tab` because after adding it, the row size is"); - SET innodb_strict_mode=OFF; CREATE TABLE test_tab ( a_str_18 mediumtext, diff --git a/mysql-test/suite/mariabackup/incremental_backup.result b/mysql-test/suite/mariabackup/incremental_backup.result index 42a7029bb31..d6a78655a0c 100644 --- a/mysql-test/suite/mariabackup/incremental_backup.result +++ b/mysql-test/suite/mariabackup/incremental_backup.result @@ -1,4 +1,5 @@ call mtr.add_suppression("InnoDB: New log files created"); +CREATE TABLE t_aria(i INT) ENGINE ARIA; CREATE TABLE t(i INT PRIMARY KEY) ENGINE INNODB; BEGIN; INSERT INTO t VALUES(2); @@ -11,11 +12,13 @@ INSERT INTO t VALUES(0); DELETE FROM t WHERE i=0; connection default; COMMIT; +# Generate enough aria log records to increase area log file size SELECT * FROM t; i 1 2 # Prepare full backup, apply incremental one +# Aria log file was updated during applying incremental backup disconnect con1; # Restore and check results # shutdown server @@ -27,3 +30,4 @@ i 1 2 DROP TABLE t; +DROP TABLE t_aria; diff --git a/mysql-test/suite/mariabackup/incremental_backup.test b/mysql-test/suite/mariabackup/incremental_backup.test index 8fbfa701999..3e877af1398 100644 --- a/mysql-test/suite/mariabackup/incremental_backup.test +++ b/mysql-test/suite/mariabackup/incremental_backup.test @@ -1,10 +1,12 @@ +--source include/have_aria.inc --source include/innodb_page_size.inc call mtr.add_suppression("InnoDB: New log files created"); -let $basedir=$MYSQLTEST_VARDIR/tmp/backup; -let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1; +let basedir=$MYSQLTEST_VARDIR/tmp/backup; +let incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1; +CREATE TABLE t_aria(i INT) ENGINE ARIA; CREATE TABLE t(i INT PRIMARY KEY) ENGINE INNODB; BEGIN; INSERT INTO t VALUES(2); @@ -14,21 +16,73 @@ INSERT INTO t VALUES(1); echo # Create full backup , modify table, then create incremental/differential backup; --disable_result_log -exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir; +exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$basedir; --enable_result_log BEGIN; INSERT INTO t VALUES(0); DELETE FROM t WHERE i=0; connection default; COMMIT; + +--echo # Generate enough aria log records to increase area log file size +--disable_query_log +--disable_result_log +INSERT INTO t_aria VALUES + (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), + (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), + (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), + (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), + (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), + (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), + (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), + (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), + (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), + (0), (1), (2), (3), (4), (5), (6), (7), (8), (9); +--let $i = 4 +while ($i) { +INSERT INTO t_aria SELECT * FROM seq_1_to_2000; +--dec $i +} +--enable_query_log +--enable_result_log + SELECT * FROM t; -exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --ftwrl-wait-timeout=5 --ftwrl-wait-threshold=300 --ftwrl-wait-query-type=all --target-dir=$incremental_dir --incremental-basedir=$basedir; +# wf_incremental_init() allocates (page_size/4)*page_size bytes with mmap() +# in each data file copy thread, what can fail on 32-bit platforms if threads +# are too much, that's why don't set too big --parallel option value. +exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=2 --ftwrl-wait-timeout=5 --ftwrl-wait-threshold=300 --ftwrl-wait-query-type=all --target-dir=$incremental_dir --incremental-basedir=$basedir; --disable_result_log echo # Prepare full backup, apply incremental one; exec $XTRABACKUP --prepare --target-dir=$basedir; exec $XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir ; +let perl_result_file=$MYSQLTEST_VARDIR/tmp/check_file_size_result.inc; + +--perl END_OF_FILE + use strict; + use warnings; + + my $dst_file = "$ENV{'basedir'}/aria_log.00000001"; + my $src_file = "$ENV{'incremental_dir'}/aria_log.00000001"; + my $out_file = $ENV{'perl_result_file'}; + + my $dst_size = -s $dst_file; + my $src_size = -s $src_file; + + open (my $output, '>', $out_file) or die $!; + if ($dst_size >= $src_size) { + print $output '--echo # Aria log file was updated during applying incremental backup'."\n"; + } + else { + print $output '--echo # Aria log file was NOT updated during applying incremental backup'."\n"; + } + close $output; +END_OF_FILE + +--source $perl_result_file +--remove_file $perl_result_file + disconnect con1; echo # Restore and check results; let $targetdir=$basedir; @@ -37,6 +91,7 @@ let $targetdir=$basedir; SELECT * FROM t; DROP TABLE t; +DROP TABLE t_aria; # Cleanup rmdir $basedir; diff --git a/mysql-test/suite/plugins/r/server_audit.result b/mysql-test/suite/plugins/r/server_audit.result index 215625c4500..afbc29c57aa 100644 --- a/mysql-test/suite/plugins/r/server_audit.result +++ b/mysql-test/suite/plugins/r/server_audit.result @@ -212,8 +212,22 @@ select 2; 2 2 drop table t1; +set global server_audit_events='table'; +set global server_audit_incl_users='user1'; +create user user1@localhost; +grant all on sa_db.* to user1@localhost; +connect cn1,localhost,user1,,sa_db; +connection cn1; +create table t1(id int) engine=myisam; +insert delayed into t1 values (1), (2); +connection default; +# Waiting until INSERT DELAYED thread does the insert. +drop table t1; set global server_audit_logging= off; +set global server_audit_incl_users='root'; set global server_audit_logging= on; +disconnect cn1; +drop user user1@localhost; set global server_audit_events=''; set global server_audit_query_log_limit= 15; select (1), (2), (3), (4); @@ -250,7 +264,7 @@ server_audit_file_path server_audit_file_rotate_now OFF server_audit_file_rotate_size 1000000 server_audit_file_rotations 9 -server_audit_incl_users odin, root, dva, tri +server_audit_incl_users root server_audit_logging ON server_audit_mode 1 server_audit_output_type file @@ -393,8 +407,16 @@ TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'SET PASSWORD FOR u1=<secret>',ID TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'CREATE USER u3 IDENTIFIED BY *****',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'drop user u1, u2, u3',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'insert into t1 values (1), (2)',0 +TIME,HOSTNAME,user1,localhost,ID,ID,CREATE,sa_db,t1, +TIME,HOSTNAME,user1,localhost,ID,ID,WRITE,sa_db,t1, TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_logging= off',0 -TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_logging= on',0 +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,db, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,tables_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,columns_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,procs_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,proxies_priv, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,roles_mapping, +TIME,HOSTNAME,root,localhost,ID,ID,WRITE,mysql,global_priv, TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global server_audit_events=\'\'',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'set global serv',0 TIME,HOSTNAME,root,localhost,ID,ID,QUERY,sa_db,'select (1), (2)',0 diff --git a/mysql-test/suite/plugins/t/server_audit.test b/mysql-test/suite/plugins/t/server_audit.test index f19c8f53b61..67b855871a3 100644 --- a/mysql-test/suite/plugins/t/server_audit.test +++ b/mysql-test/suite/plugins/t/server_audit.test @@ -136,8 +136,28 @@ select * from t1; select 2; drop table t1; +set global server_audit_events='table'; +set global server_audit_incl_users='user1'; + +create user user1@localhost; +grant all on sa_db.* to user1@localhost; + +connect (cn1,localhost,user1,,sa_db); +connection cn1; + +create table t1(id int) engine=myisam; +insert delayed into t1 values (1), (2); +connection default; +--echo # Waiting until INSERT DELAYED thread does the insert. +let $wait_condition= SELECT COUNT(*) = 2 FROM t1; +--source include/wait_condition.inc +drop table t1; + set global server_audit_logging= off; +set global server_audit_incl_users='root'; set global server_audit_logging= on; +disconnect cn1; +drop user user1@localhost; set global server_audit_events=''; diff --git a/mysql-test/suite/rpl/r/rpl_mdev-11092.result b/mysql-test/suite/rpl/r/rpl_mdev-11092.result index 90b809477b2..8bc8fe4a20b 100644 --- a/mysql-test/suite/rpl/r/rpl_mdev-11092.result +++ b/mysql-test/suite/rpl/r/rpl_mdev-11092.result @@ -1,7 +1,7 @@ include/master-slave.inc [connection master] call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); -call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occured on the master. .*"); +call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occurred on the master. .*"); SET GLOBAL max_binlog_cache_size = 4096; SET GLOBAL binlog_cache_size = 4096; SET GLOBAL max_binlog_stmt_cache_size = 4096; diff --git a/mysql-test/suite/rpl/t/rpl_mdev-11092.test b/mysql-test/suite/rpl/t/rpl_mdev-11092.test index 31a385b40e6..782d24803c7 100644 --- a/mysql-test/suite/rpl/t/rpl_mdev-11092.test +++ b/mysql-test/suite/rpl/t/rpl_mdev-11092.test @@ -6,7 +6,7 @@ ######################################################################################## call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); -call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occured on the master. .*"); +call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occurred on the master. .*"); let $old_max_binlog_cache_size= query_get_value(SHOW VARIABLES LIKE "max_binlog_cache_size", Value, 1); let $old_binlog_cache_size= query_get_value(SHOW VARIABLES LIKE "binlog_cache_size", Value, 1); diff --git a/mysql-test/suite/sql_sequence/rebuild.result b/mysql-test/suite/sql_sequence/rebuild.result new file mode 100644 index 00000000000..e5407ef69f3 --- /dev/null +++ b/mysql-test/suite/sql_sequence/rebuild.result @@ -0,0 +1,161 @@ +# +# MDEV-15977 Assertion `! thd->in_sub_stmt' failed in trans_commit_stmt +# +CREATE SEQUENCE s1 ENGINE=InnoDB; +ALTER TABLE s1 FORCE; +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +CREATE TABLE t2 (b VARCHAR(64)) ENGINE=MyISAM; +CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 SELECT TABLE_NAME FROM INFORMATION_SCHEMA.PARTITIONS; +INSERT INTO t1 VALUES (1); +select * from t1; +a +1 +select * from t2; +b +ALL_PLUGINS +APPLICABLE_ROLES +CHARACTER_SETS +CHECK_CONSTRAINTS +CLIENT_STATISTICS +COLLATIONS +COLLATION_CHARACTER_SET_APPLICABILITY +COLUMNS +COLUMN_PRIVILEGES +ENABLED_ROLES +ENGINES +EVENTS +FILES +GEOMETRY_COLUMNS +GLOBAL_STATUS +GLOBAL_VARIABLES +INDEX_STATISTICS +INNODB_BUFFER_PAGE +INNODB_BUFFER_PAGE_LRU +INNODB_BUFFER_POOL_STATS +INNODB_CMPMEM +INNODB_CMP_PER_INDEX +INNODB_LOCKS +INNODB_LOCK_WAITS +INNODB_METRICS +INNODB_SYS_COLUMNS +INNODB_SYS_FIELDS +INNODB_SYS_FOREIGN +INNODB_SYS_FOREIGN_COLS +INNODB_SYS_INDEXES +INNODB_SYS_TABLES +INNODB_SYS_VIRTUAL +INNODB_TRX +KEY_CACHES +KEY_COLUMN_USAGE +OPTIMIZER_TRACE +PARAMETERS +PARTITIONS +PLUGINS +PROCESSLIST +PROFILING +REFERENTIAL_CONSTRAINTS +ROUTINES +SCHEMATA +SCHEMA_PRIVILEGES +SESSION_STATUS +SESSION_VARIABLES +SPATIAL_REF_SYS +STATISTICS +SYSTEM_VARIABLES +TABLES +TABLESPACES +TABLE_CONSTRAINTS +TABLE_PRIVILEGES +TABLE_STATISTICS +TRIGGERS +USER_PRIVILEGES +USER_STATISTICS +VIEWS +accounts +column_stats +columns_priv +cond_instances +db +event +events_stages_current +events_stages_history +events_stages_history_long +events_stages_summary_by_account_by_event_name +events_stages_summary_by_host_by_event_name +events_stages_summary_by_thread_by_event_name +events_stages_summary_by_user_by_event_name +events_stages_summary_global_by_event_name +events_statements_current +events_statements_history +events_statements_history_long +events_statements_summary_by_account_by_event_name +events_statements_summary_by_digest +events_statements_summary_by_host_by_event_name +events_statements_summary_by_thread_by_event_name +events_statements_summary_by_user_by_event_name +events_statements_summary_global_by_event_name +events_waits_current +events_waits_history +events_waits_history_long +events_waits_summary_by_account_by_event_name +events_waits_summary_by_host_by_event_name +events_waits_summary_by_instance +events_waits_summary_by_thread_by_event_name +events_waits_summary_by_user_by_event_name +events_waits_summary_global_by_event_name +file_instances +file_summary_by_event_name +file_summary_by_instance +func +general_log +global_priv +global_suppressions +gtid_slave_pos +help_category +help_keyword +help_relation +help_topic +host_cache +hosts +index_stats +innodb_index_stats +innodb_table_stats +mutex_instances +objects_summary_global_by_type +performance_timers +plugin +proc +procs_priv +proxies_priv +roles_mapping +rwlock_instances +s1 +servers +session_account_connect_attrs +session_connect_attrs +setup_actors +setup_consumers +setup_instruments +setup_objects +setup_timers +slow_log +socket_instances +socket_summary_by_event_name +socket_summary_by_instance +t1 +t2 +table_io_waits_summary_by_index_usage +table_io_waits_summary_by_table +table_lock_waits_summary_by_table +table_stats +tables_priv +test_suppressions +threads +time_zone +time_zone_leap_second +time_zone_name +time_zone_transition +time_zone_transition_type +transaction_registry +users +DROP TABLE t1, t2, s1; diff --git a/mysql-test/suite/sql_sequence/rebuild.test b/mysql-test/suite/sql_sequence/rebuild.test new file mode 100644 index 00000000000..7c00e0be7cc --- /dev/null +++ b/mysql-test/suite/sql_sequence/rebuild.test @@ -0,0 +1,20 @@ +--source include/have_innodb.inc + +--echo # +--echo # MDEV-15977 Assertion `! thd->in_sub_stmt' failed in trans_commit_stmt +--echo # + +CREATE SEQUENCE s1 ENGINE=InnoDB; +ALTER TABLE s1 FORCE; +CREATE TABLE t1 (a INT) ENGINE=MyISAM; +CREATE TABLE t2 (b VARCHAR(64)) ENGINE=MyISAM; +CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 SELECT TABLE_NAME FROM INFORMATION_SCHEMA.PARTITIONS; +INSERT INTO t1 VALUES (1); +--sorted_result +select * from t1; +--sorted_result +select * from t2; + +# Cleanup +DROP TABLE t1, t2, s1; + diff --git a/mysql-test/suite/sql_sequence/view.result b/mysql-test/suite/sql_sequence/view.result index bd773dcc042..0f39a637deb 100644 --- a/mysql-test/suite/sql_sequence/view.result +++ b/mysql-test/suite/sql_sequence/view.result @@ -24,3 +24,13 @@ ERROR 42S02: 'test.v1' is not a SEQUENCE SELECT PREVIOUS VALUE FOR v1; ERROR 42S02: 'test.v1' is not a SEQUENCE drop view v1; +# +# MDEV 17978 Server crashes in mysqld_show_create_get_fields +# upon SHOW CREATE SEQUENCE on a broken view +# +CREATE TABLE t1 (a INT); +CREATE VIEW v1 AS SELECT * FROM t1; +DROP TABLE t1; +SHOW CREATE SEQUENCE v1; +ERROR 42S02: 'test.v1' is not a SEQUENCE +DROP VIEW v1; diff --git a/mysql-test/suite/sql_sequence/view.test b/mysql-test/suite/sql_sequence/view.test index fe968604b5b..5b970432a34 100644 --- a/mysql-test/suite/sql_sequence/view.test +++ b/mysql-test/suite/sql_sequence/view.test @@ -27,3 +27,14 @@ SELECT NEXT VALUE FOR v1; --error ER_NOT_SEQUENCE SELECT PREVIOUS VALUE FOR v1; drop view v1; + +--echo # +--echo # MDEV 17978 Server crashes in mysqld_show_create_get_fields +--echo # upon SHOW CREATE SEQUENCE on a broken view +--echo # +CREATE TABLE t1 (a INT); +CREATE VIEW v1 AS SELECT * FROM t1; +DROP TABLE t1; +--error ER_NOT_SEQUENCE +SHOW CREATE SEQUENCE v1; +DROP VIEW v1; diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result index c9443b64674..7d971bcdbad 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result @@ -3435,7 +3435,7 @@ COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME SESSION_TRACK_TRANSACTION_INFO VARIABLE_SCOPE SESSION VARIABLE_TYPE ENUM -VARIABLE_COMMENT Track changes to the transaction attributes. OFF to disable; STATE to track just transaction state (Is there an active transaction? Does it have any data? etc.); CHARACTERISTICS to track transaction state and report all statements needed to start a transaction withthe same characteristics (isolation level, read only/read write,snapshot - but not any work done / data modified within the transaction). +VARIABLE_COMMENT Track changes to the transaction attributes. OFF to disable; STATE to track just transaction state (Is there an active transaction? Does it have any data? etc.); CHARACTERISTICS to track transaction state and report all statements needed to start a transaction with the same characteristics (isolation level, read only/read write,snapshot - but not any work done / data modified within the transaction). NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL diff --git a/mysql-test/suite/sys_vars/t/ft_boolean_syntax_basic.test b/mysql-test/suite/sys_vars/t/ft_boolean_syntax_basic.test index 454b5d7477e..1d925a5e8c1 100644 --- a/mysql-test/suite/sys_vars/t/ft_boolean_syntax_basic.test +++ b/mysql-test/suite/sys_vars/t/ft_boolean_syntax_basic.test @@ -64,7 +64,7 @@ SELECT @@global.ft_boolean_syntax; --echo '#--------------------FN_DYNVARS_033_03-------------------------#' ###################################################################### -# see if it is accessable using session scope # +# see if it is accessible using session scope # ###################################################################### --Error ER_GLOBAL_VARIABLE SET @@session.ft_boolean_syntax = '# -><()!*:""&|'; diff --git a/mysql-test/suite/sys_vars/t/init_connect_basic.test b/mysql-test/suite/sys_vars/t/init_connect_basic.test index b2f2cb92e40..6aba83d3675 100644 --- a/mysql-test/suite/sys_vars/t/init_connect_basic.test +++ b/mysql-test/suite/sys_vars/t/init_connect_basic.test @@ -66,7 +66,7 @@ SELECT @@global.init_connect; --echo '#--------------------FN_DYNVARS_036_03-------------------------#' ###################################################################### -# see if it is accessable using session scope # +# see if it is accessible using session scope # ###################################################################### --Error ER_GLOBAL_VARIABLE SET @@session.init_connect = ''; diff --git a/mysql-test/suite/sys_vars/t/init_slave_basic.test b/mysql-test/suite/sys_vars/t/init_slave_basic.test index b137a525090..4dd7fd80d82 100644 --- a/mysql-test/suite/sys_vars/t/init_slave_basic.test +++ b/mysql-test/suite/sys_vars/t/init_slave_basic.test @@ -66,7 +66,7 @@ SELECT @@global.init_slave; --echo '#--------------------FN_DYNVARS_037_03-------------------------#' ###################################################################### -# see if it is accessable using session scope # +# see if it is accessible using session scope # ###################################################################### --Error ER_GLOBAL_VARIABLE SET @@session.init_slave = ''; diff --git a/mysql-test/suite/sys_vars/t/timestamp_basic.test b/mysql-test/suite/sys_vars/t/timestamp_basic.test index 8b26622443d..5f780e7ab40 100644 --- a/mysql-test/suite/sys_vars/t/timestamp_basic.test +++ b/mysql-test/suite/sys_vars/t/timestamp_basic.test @@ -47,7 +47,7 @@ SELECT floor(@@timestamp) = UNIX_TIMESTAMP(), @@timestamp = UNIX_TIMESTAMP(NOW(6 --echo '#---------------------FN_DYNVARS_001_02-------------------------#' ############################################################## -# see if accessable using global scope # +# see if accessible using global scope # ############################################################## --Error ER_LOCAL_VARIABLE diff --git a/mysql-test/suite/versioning/r/alter.result b/mysql-test/suite/versioning/r/alter.result index ed8a86c0053..6563638c195 100644 --- a/mysql-test/suite/versioning/r/alter.result +++ b/mysql-test/suite/versioning/r/alter.result @@ -530,9 +530,9 @@ ERROR HY000: Table `t` is already system-versioned # use mysql; create or replace table t (x int) with system versioning; -ERROR HY000: System-versioned tables in the `mysql` database are not suported +ERROR HY000: System-versioned tables in the `mysql` database are not supported alter table db add system versioning; -ERROR HY000: System-versioned tables in the `mysql` database are not suported +ERROR HY000: System-versioned tables in the `mysql` database are not supported use test; # MDEV-15956 Strange ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN upon ALTER on versioning column create or replace table t1 (i int, j int as (i), s timestamp(6) as row start, e timestamp(6) as row end, period for system_time(s,e)) with system versioning; diff --git a/mysql-test/suite/versioning/r/delete.result b/mysql-test/suite/versioning/r/delete.result index 26ade83acd7..5aa239b9cb8 100644 --- a/mysql-test/suite/versioning/r/delete.result +++ b/mysql-test/suite/versioning/r/delete.result @@ -116,3 +116,17 @@ x 2 1 drop table t1; +# +# MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED +# +create or replace table t1 (a int) with system versioning; +replace into t1 values (1), (2); +create or replace trigger tr before delete on t1 for each row delete from xx; +create or replace procedure pr() delete from t1; +call pr; +ERROR 42S02: Table 'test.xx' doesn't exist +call pr; +ERROR 42S02: Table 'test.xx' doesn't exist +drop procedure pr; +drop trigger tr; +drop table t1; diff --git a/mysql-test/suite/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result index f0d7ffc54d0..5c83731b88b 100644 --- a/mysql-test/suite/versioning/r/partition.result +++ b/mysql-test/suite/versioning/r/partition.result @@ -613,3 +613,12 @@ Table Op Msg_type Msg_text test.t1 check note Not supported for non-INTERVAL history partitions test.t1 check note The storage engine for the table doesn't support check drop table t1; +# +# MDEV-21233 Assertion `m_extra_cache' failed in ha_partition::late_extra_cache +# +create table t1 (id int, a varchar(8)) with system versioning partition by key (id) partitions 2; +insert into t1 values (1,'foo'),(2,'bar'); +create table t2 (b int); +insert into t2 values (1),(2); +update t1, t2 set a = 1; +drop table t1, t2; diff --git a/mysql-test/suite/versioning/r/select.result b/mysql-test/suite/versioning/r/select.result index b63e6222581..36d738f57b7 100644 --- a/mysql-test/suite/versioning/r/select.result +++ b/mysql-test/suite/versioning/r/select.result @@ -628,6 +628,30 @@ call p; i drop procedure p; drop table t1; +# +# MDEV-21234 Server crashes in in setup_on_expr upon 3rd execution of SP +# +create table t1 (a varchar(8)); +insert into t1 values ('foo'),('bar'); +create table t2 (b date); +create procedure pr() insert into t2 select * from t1; +call pr; +ERROR 22007: Incorrect date value: 'foo' for column `test`.`t2`.`b` at row 1 +prepare stmt from 'insert into t2 select * from t1'; +execute stmt; +ERROR 22007: Incorrect date value: 'foo' for column `test`.`t2`.`b` at row 1 +alter table t1 add system versioning; +call pr; +ERROR 22007: Incorrect date value: 'foo' for column `test`.`t2`.`b` at row 1 +call pr; +ERROR 22007: Incorrect date value: 'foo' for column `test`.`t2`.`b` at row 1 +execute stmt; +ERROR 22007: Incorrect date value: 'foo' for column `test`.`t2`.`b` at row 1 +execute stmt; +ERROR 22007: Incorrect date value: 'foo' for column `test`.`t2`.`b` at row 1 +drop prepare stmt; +drop procedure pr; +drop table t1, t2; call verify_trt_dummy(34); No A B C D 1 1 1 1 1 diff --git a/mysql-test/suite/versioning/r/update.result b/mysql-test/suite/versioning/r/update.result index 64aa7c7068c..e7c617f9196 100644 --- a/mysql-test/suite/versioning/r/update.result +++ b/mysql-test/suite/versioning/r/update.result @@ -295,5 +295,17 @@ primary key (pk) create or replace view v1 as select * from t1; insert into t1 values (1, null, 'd') , (2, null, 'i') ; update v1 set a= null where b = ''; +create or replace table t1 (id int, k int, primary key (id)) engine=innodb with system versioning; +insert into t1 values (1,1),(2,2); +create or replace view v1 as select * from t1; +update v1 set id= 2 where k = 0; +create or replace table t1 (a int) with system versioning; +create or replace view v1 as select * from t1; +create or replace procedure sp() update v1 set xx = 1; +call sp; +ERROR 42S22: Unknown column 'xx' in 'field list' +call sp; +ERROR 42S22: Unknown column 'xx' in 'field list' +drop procedure sp; drop view v1; drop table t1; diff --git a/mysql-test/suite/versioning/t/delete.test b/mysql-test/suite/versioning/t/delete.test index 4f1ba4b1d8e..492463f9395 100644 --- a/mysql-test/suite/versioning/t/delete.test +++ b/mysql-test/suite/versioning/t/delete.test @@ -79,4 +79,19 @@ delete from t1; select x from t1 for system_time all; drop table t1; +--echo # +--echo # MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED +--echo # +create or replace table t1 (a int) with system versioning; +replace into t1 values (1), (2); +create or replace trigger tr before delete on t1 for each row delete from xx; +create or replace procedure pr() delete from t1; +--error ER_NO_SUCH_TABLE +call pr; +--error ER_NO_SUCH_TABLE +call pr; +drop procedure pr; +drop trigger tr; +drop table t1; + --source suite/versioning/common_finish.inc diff --git a/mysql-test/suite/versioning/t/partition.test b/mysql-test/suite/versioning/t/partition.test index bc7a96ccc2a..98af71277c8 100644 --- a/mysql-test/suite/versioning/t/partition.test +++ b/mysql-test/suite/versioning/t/partition.test @@ -544,5 +544,18 @@ check table t1; # cleanup drop table t1; +--echo # +--echo # MDEV-21233 Assertion `m_extra_cache' failed in ha_partition::late_extra_cache +--echo # +create table t1 (id int, a varchar(8)) with system versioning partition by key (id) partitions 2; +insert into t1 values (1,'foo'),(2,'bar'); + +create table t2 (b int); +insert into t2 values (1),(2); + +update t1, t2 set a = 1; + +# cleanup +drop table t1, t2; --source suite/versioning/common_finish.inc diff --git a/mysql-test/suite/versioning/t/select.test b/mysql-test/suite/versioning/t/select.test index 5771b9652f5..00e67ed85a6 100644 --- a/mysql-test/suite/versioning/t/select.test +++ b/mysql-test/suite/versioning/t/select.test @@ -418,6 +418,35 @@ call p; drop procedure p; drop table t1; +--echo # +--echo # MDEV-21234 Server crashes in in setup_on_expr upon 3rd execution of SP +--echo # +create table t1 (a varchar(8)); +insert into t1 values ('foo'),('bar'); +create table t2 (b date); + +create procedure pr() insert into t2 select * from t1; +--error ER_TRUNCATED_WRONG_VALUE +call pr; +prepare stmt from 'insert into t2 select * from t1'; +--error ER_TRUNCATED_WRONG_VALUE +execute stmt; +alter table t1 add system versioning; +--error ER_TRUNCATED_WRONG_VALUE +call pr; +--error ER_TRUNCATED_WRONG_VALUE +call pr; +--error ER_TRUNCATED_WRONG_VALUE +execute stmt; +--error ER_TRUNCATED_WRONG_VALUE +execute stmt; +drop prepare stmt; + +# cleanup +drop procedure pr; +drop table t1, t2; + + call verify_trt_dummy(34); -- source suite/versioning/common_finish.inc diff --git a/mysql-test/suite/versioning/t/update.test b/mysql-test/suite/versioning/t/update.test index baf3c1ec876..548505bd39a 100644 --- a/mysql-test/suite/versioning/t/update.test +++ b/mysql-test/suite/versioning/t/update.test @@ -214,7 +214,21 @@ create or replace view v1 as select * from t1; insert into t1 values (1, null, 'd') , (2, null, 'i') ; update v1 set a= null where b = ''; +create or replace table t1 (id int, k int, primary key (id)) engine=innodb with system versioning; +insert into t1 values (1,1),(2,2); +create or replace view v1 as select * from t1; +update v1 set id= 2 where k = 0; + +create or replace table t1 (a int) with system versioning; +create or replace view v1 as select * from t1; +create or replace procedure sp() update v1 set xx = 1; +--error ER_BAD_FIELD_ERROR +call sp; +--error ER_BAD_FIELD_ERROR +call sp; + # cleanup +drop procedure sp; drop view v1; drop table t1; diff --git a/mysql-test/suite/wsrep/disabled.def b/mysql-test/suite/wsrep/disabled.def index c8c908df999..466a6d1a081 100644 --- a/mysql-test/suite/wsrep/disabled.def +++ b/mysql-test/suite/wsrep/disabled.def @@ -10,6 +10,7 @@ # ############################################################################## -foreign_key : Sporadic failure "WSREP has not yet prepared node for application use" +foreign_key : MENT-535 Galera test failures on wsrep suite wsrep.pool_of_threads : Sporadic failure "WSREP has not yet prepared node for application use" variables : MDEV-20581 Crash on wsrep.variables test case +pool_of_threads : MENT-535 Galera test failures on wsrep suite diff --git a/mysql-test/suite/wsrep/t/pool_of_threads.opt b/mysql-test/suite/wsrep/t/pool_of_threads.opt new file mode 100644 index 00000000000..6948011b21b --- /dev/null +++ b/mysql-test/suite/wsrep/t/pool_of_threads.opt @@ -0,0 +1 @@ +--innodb_autoinc_lock_mode=2 --wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --thread_handling=pool-of-threads wsrep-on=1 diff --git a/pcre/ChangeLog b/pcre/ChangeLog index e4d2d9fa24c..3973337fe35 100644 --- a/pcre/ChangeLog +++ b/pcre/ChangeLog @@ -1605,7 +1605,7 @@ Version 8.21 12-Dec-2011 are added as well. 3. Fix cache-flush issue on PowerPC (It is still an experimental JIT port). - PCRE_EXTRA_TABLES is not suported by JIT, and should be checked before + PCRE_EXTRA_TABLES is not supported by JIT, and should be checked before calling _pcre_jit_exec. Some extra comments are added. 4. (*MARK) settings inside atomic groups that do not contain any capturing diff --git a/pcre/doc/html/pcredemo.html b/pcre/doc/html/pcredemo.html index 894a9308261..d84c5c8c99c 100644 --- a/pcre/doc/html/pcredemo.html +++ b/pcre/doc/html/pcredemo.html @@ -161,7 +161,7 @@ if (rc < 0) return 1; } -/* Match succeded */ +/* Match succeeded */ printf("\nMatch succeeded at offset %d\n", ovector[0]); @@ -379,7 +379,7 @@ for (;;) return 1; } - /* Match succeded */ + /* Match succeeded */ printf("\nMatch succeeded again at offset %d\n", ovector[0]); diff --git a/pcre/doc/html/pcrejit.html b/pcre/doc/html/pcrejit.html index abb342522f9..c1e0310defc 100644 --- a/pcre/doc/html/pcrejit.html +++ b/pcre/doc/html/pcrejit.html @@ -299,7 +299,7 @@ recommended. This is a suggestion for how a multithreaded program that needs to set up non-default JIT stacks might operate: <pre> - During thread initalization + During thread initialization thread_local_var = pcre_jit_stack_alloc(...) During thread exit diff --git a/pcre/doc/pcre.txt b/pcre/doc/pcre.txt index c027538f500..f4302bd7ee8 100644 --- a/pcre/doc/pcre.txt +++ b/pcre/doc/pcre.txt @@ -8578,7 +8578,7 @@ CONTROLLING THE JIT STACK This is a suggestion for how a multithreaded program that needs to set up non-default JIT stacks might operate: - During thread initalization + During thread initialization thread_local_var = pcre_jit_stack_alloc(...) During thread exit diff --git a/pcre/doc/pcredemo.3 b/pcre/doc/pcredemo.3 index 194629b1fac..4115ef1e36e 100644 --- a/pcre/doc/pcredemo.3 +++ b/pcre/doc/pcredemo.3 @@ -161,7 +161,7 @@ if (rc < 0) return 1; } -/* Match succeded */ +/* Match succeeded */ printf("\enMatch succeeded at offset %d\en", ovector[0]); @@ -379,7 +379,7 @@ for (;;) return 1; } - /* Match succeded */ + /* Match succeeded */ printf("\enMatch succeeded again at offset %d\en", ovector[0]); diff --git a/pcre/doc/pcrejit.3 b/pcre/doc/pcrejit.3 index 3b785f0f631..fe42db56170 100644 --- a/pcre/doc/pcrejit.3 +++ b/pcre/doc/pcrejit.3 @@ -285,7 +285,7 @@ recommended. This is a suggestion for how a multithreaded program that needs to set up non-default JIT stacks might operate: .sp - During thread initalization + During thread initialization thread_local_var = pcre_jit_stack_alloc(...) .sp During thread exit diff --git a/pcre/pcre_compile.c b/pcre/pcre_compile.c index 734875de2fb..c32b0226162 100644 --- a/pcre/pcre_compile.c +++ b/pcre/pcre_compile.c @@ -8352,7 +8352,7 @@ save_hwm_offset = cd->hwm - cd->start_workspace; /* Accumulate the length for use in the pre-compile phase. Start with the length of the BRA and KET and any extra bytes that are required at the beginning. We accumulate in a local variable to save frequent testing of -lenthptr for NULL. We cannot do this by looking at the value of code at the +lengthptr for NULL. We cannot do this by looking at the value of code at the start and end of each alternative, because compiled items are discarded during the pre-compile phase so that the work space is not exceeded. */ diff --git a/pcre/pcre_internal.h b/pcre/pcre_internal.h index 97ff55d03b3..b1e096ceb3d 100644 --- a/pcre/pcre_internal.h +++ b/pcre/pcre_internal.h @@ -2188,7 +2188,7 @@ regex. The lengths are used when searching for specific things, and also in the debugging printing of a compiled regex. We use a macro so that it can be defined close to the definitions of the opcodes themselves. -As things have been extended, some of these are no longer fixed lenths, but are +As things have been extended, some of these are no longer fixed lengths, but are minima instead. For example, the length of a single-character repeat may vary in UTF-8 mode. The code that uses this table must know about such things. */ diff --git a/pcre/pcredemo.c b/pcre/pcredemo.c index 946aba45cdc..1ca77f1537a 100644 --- a/pcre/pcredemo.c +++ b/pcre/pcredemo.c @@ -144,7 +144,7 @@ if (rc < 0) return 1; } -/* Match succeded */ +/* Match succeeded */ printf("\nMatch succeeded at offset %d\n", ovector[0]); @@ -362,7 +362,7 @@ for (;;) return 1; } - /* Match succeded */ + /* Match succeeded */ printf("\nMatch succeeded again at offset %d\n", ovector[0]); diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql index 1f801226c2d..ab3dd704d2e 100644 --- a/scripts/mysql_system_tables_data.sql +++ b/scripts/mysql_system_tables_data.sql @@ -14,7 +14,7 @@ -- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA -- --- The inital data for system tables of MySQL Server +-- The initial data for system tables of MySQL Server -- -- When setting up a "cross bootstrap" database (e.g., creating data on a Unix diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh index 16607470f2c..16607470f2c 100755..100644 --- a/scripts/wsrep_sst_common.sh +++ b/scripts/wsrep_sst_common.sh diff --git a/sql-bench/bench-init.pl.sh b/sql-bench/bench-init.pl.sh index 1b6509cebcc..a6a12603e6d 100644 --- a/sql-bench/bench-init.pl.sh +++ b/sql-bench/bench-init.pl.sh @@ -566,7 +566,7 @@ All benchmarks takes the following options: When using --fast the suffix is automaticly set to '_fast'. --random - Inform test suite that we are generate random inital values for sequence of + Inform test suite that we are generate random initial values for sequence of test executions. It should be used for imitation of real conditions. --threads=# **DEPRECATED** diff --git a/sql-common/client.c b/sql-common/client.c index 13c3c909e77..86b05a206a8 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -3235,7 +3235,7 @@ my_bool mysql_reconnect(MYSQL *mysql) if (ctxt) my_context_install_suspend_resume_hook(ctxt, NULL, NULL); - DBUG_PRINT("info", ("reconnect succeded")); + DBUG_PRINT("info", ("reconnect succeeded")); tmp_mysql.reconnect= 1; tmp_mysql.free_me= mysql->free_me; diff --git a/sql/filesort.cc b/sql/filesort.cc index 3f4291cfb1f..2e06905a48e 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -309,6 +309,7 @@ SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort, param.max_keys_per_buffer=((param.max_keys_per_buffer * (param.rec_length + sizeof(char*))) / param.rec_length - 1); + set_if_bigger(param.max_keys_per_buffer, 1); maxbuffer--; // Offset from 0 if (merge_many_buff(¶m, (uchar*) sort->get_sort_keys(), diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index c9e12f861af..f6a6dfda6e3 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -564,7 +564,7 @@ bool ha_partition::initialize_partition(MEM_ROOT *mem_root) point. If you do not implement this, the default delete_table() is called from - handler.cc and it will delete all files with the file extentions returned + handler.cc and it will delete all files with the file extensions returned by bas_ext(). Called from handler.cc by delete_table and ha_create_table(). Only used @@ -596,7 +596,7 @@ int ha_partition::delete_table(const char *name) Renames a table from one name to another from alter table call. If you do not implement this, the default rename_table() is called from - handler.cc and it will rename all files with the file extentions returned + handler.cc and it will rename all files with the file extensions returned by bas_ext(). Called from sql_table.cc by mysql_rename_table(). @@ -9265,7 +9265,6 @@ void ha_partition::late_extra_cache(uint partition_id) } if (m_extra_prepare_for_update) { - DBUG_ASSERT(m_extra_cache); (void) file->extra(HA_EXTRA_PREPARE_FOR_UPDATE); } m_extra_cache_part_id= partition_id; diff --git a/sql/ha_sequence.cc b/sql/ha_sequence.cc index beaed6ef7df..22a92c70425 100644 --- a/sql/ha_sequence.cc +++ b/sql/ha_sequence.cc @@ -108,7 +108,7 @@ int ha_sequence::open(const char *name, int mode, uint flags) MY_TEST(flags & HA_OPEN_INTERNAL_TABLE); reset_statistics(); - /* Don't try to read the inital row the call is part of create code */ + /* Don't try to read the initial row the call is part of create code */ if (!(flags & (HA_OPEN_FOR_CREATE | HA_OPEN_FOR_REPAIR))) { if (unlikely((error= table->s->sequence->read_initial_values(table)))) diff --git a/sql/handler.h b/sql/handler.h index bbceb58cb0c..6d675683ada 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -1522,9 +1522,9 @@ struct handlerton Used by open_table_error(), by the default rename_table and delete_table handler methods, and by the default discovery implementation. - For engines that have more than one file name extentions (separate + For engines that have more than one file name extensions (separate metadata, index, and/or data files), the order of elements is relevant. - First element of engine file name extentions array should be metadata + First element of engine file name extensions array should be metadata file extention. This is implied by the open_table_error() and the default discovery implementation. diff --git a/sql/item.cc b/sql/item.cc index 900a973071b..925d44a481f 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -2570,7 +2570,7 @@ bool Type_std_attributes::agg_item_set_converter(const DTCollation &coll, @retval clone of the item - 0 if an error occured + 0 if an error occurred */ Item* Item_func_or_sum::build_clone(THD *thd) @@ -2870,7 +2870,7 @@ Item_sp::init_result_field(THD *thd, uint max_length, uint maybe_null, @retval clone of the item - 0 if an error occured + 0 if an error occurred */ Item* Item_ref::build_clone(THD *thd) diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 9110f348a43..7a1d721ca48 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -5201,7 +5201,7 @@ void Item_cond::neg_arguments(THD *thd) @retval clone of the item - 0 if an error occured + 0 if an error occurred */ Item *Item_cond::build_clone(THD *thd) diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 32f05a815db..d31f47e68fd 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -2402,7 +2402,7 @@ String *Item_func_sqlerrm::val_str(String *str) system_charset_info); return str; } - str->copy(STRING_WITH_LEN("normal, successful completition"), + str->copy(STRING_WITH_LEN("normal, successful completion"), system_charset_info); return str; } diff --git a/sql/lex.h b/sql/lex.h index ec657ff48df..92ce01a1094 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -23,7 +23,7 @@ #include "lex_symbol.h" SYM_GROUP sym_group_common= {"", ""}; -SYM_GROUP sym_group_geom= {"Spatial extentions", "HAVE_SPATIAL"}; +SYM_GROUP sym_group_geom= {"Spatial extensions", "HAVE_SPATIAL"}; SYM_GROUP sym_group_rtree= {"RTree keys", "HAVE_RTREE_KEYS"}; /* We don't want to include sql_yacc.h into gen_lex_hash */ diff --git a/sql/log_event.h b/sql/log_event.h index 274182af841..df058469225 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -3621,7 +3621,7 @@ public: bool write_data_header(); bool write_data_body(); /* - Cut out Create_file extentions and + Cut out Create_file extensions and write it as Load event - used on the slave */ bool write_base(); @@ -5242,6 +5242,9 @@ bool event_that_should_be_ignored(const char *buf); bool event_checksum_test(uchar *buf, ulong event_len, enum_binlog_checksum_alg alg); enum enum_binlog_checksum_alg get_checksum_alg(const char* buf, ulong len); extern TYPELIB binlog_checksum_typelib; +#ifdef WITH_WSREP +enum Log_event_type wsrep_peak_event(rpl_group_info *rgi, ulonglong* event_size); +#endif /* WITH_WSREP */ /** @} (end of group Replication) diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc index 829a278f215..e01488abbb3 100644 --- a/sql/log_event_old.cc +++ b/sql/log_event_old.cc @@ -835,7 +835,7 @@ int Write_rows_log_event_old::do_after_row_operations(TABLE *table, int error) table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY); table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE); /* - reseting the extra with + resetting the extra with table->file->extra(HA_EXTRA_NO_IGNORE_NO_KEY); fires bug#27077 todo: explain or fix @@ -2459,7 +2459,7 @@ Write_rows_log_event_old::do_after_row_operations(const Slave_reporting_capabili m_table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY); m_table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE); /* - reseting the extra with + resetting the extra with table->file->extra(HA_EXTRA_NO_IGNORE_NO_KEY); fires bug#27077 todo: explain or fix diff --git a/sql/mysql_upgrade_service.cc b/sql/mysql_upgrade_service.cc index 05e2e970e6c..a10b5bb5162 100644 --- a/sql/mysql_upgrade_service.cc +++ b/sql/mysql_upgrade_service.cc @@ -134,7 +134,7 @@ static void die(const char *fmt, ...) } /* - Stop service that we started, if it was not initally running at + Stop service that we started, if it was not initially running at program start. */ if (initial_service_state != UINT_MAX && initial_service_state != SERVICE_RUNNING) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index e1a7a39df89..96f4dd1095b 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -7988,8 +7988,8 @@ static void usage(void) "\nbecause execution stopped before plugins were initialized."); } - puts("\nTo see what values a running MySQL server is using, type" - "\n'mysqladmin variables' instead of 'mysqld --verbose --help'."); + puts("\nTo see what variables a running MySQL server is using, type" + "\n'mysqladmin variables' instead of 'mysqld --verbose --help'."); } DBUG_VOID_RETURN; } diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index ededfc88988..961bbdaabc8 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -4577,7 +4577,7 @@ SJ_TMP_TABLE::create_sj_weedout_tmp_table(THD *thd) field->reset(); /* Test if there is a default field value. The test for ->ptr is to skip - 'offset' fields generated by initalize_tables + 'offset' fields generated by initialize_tables */ // Initialize the table field: bzero(field->ptr, field->pack_length()); diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc index 732edcd5bc6..43a02147496 100644 --- a/sql/rpl_mi.cc +++ b/sql/rpl_mi.cc @@ -1173,7 +1173,7 @@ bool Master_info_index::init_all_master_info() } else { - /* Initialization of Master_info succeded. Add it to HASH */ + /* Initialization of Master_info succeeded. Add it to HASH */ if (global_system_variables.log_warnings > 1) sql_print_information("Initialized Master_info from '%s'", buf_master_info_file); diff --git a/sql/session_tracker.cc b/sql/session_tracker.cc index 5ba0c73e042..e6c380fcb5c 100644 --- a/sql/session_tracker.cc +++ b/sql/session_tracker.cc @@ -814,7 +814,7 @@ bool Transaction_state_tracker::store(THD *thd, String *buf) statement even for a transaction that isn't the first in an ongoing chain. Consider - SET TRANSACTION ISOLATION LEVEL READ UNCOMMITED; + SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; START TRANSACTION READ ONLY, WITH CONSISTENT SNAPSHOT; # work COMMIT AND CHAIN; @@ -822,7 +822,7 @@ bool Transaction_state_tracker::store(THD *thd, String *buf) If we switch away at this point, the replay in the new session needs to be - SET TRANSACTION ISOLATION LEVEL READ UNCOMMITED; + SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; START TRANSACTION READ ONLY; When a transaction ends (COMMIT/ROLLBACK sans CHAIN), all diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 03bd72c41b0..cc635e44f7b 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -7457,7 +7457,7 @@ ER_GIS_UNSUPPORTED_ARGUMENT eng "Calling geometry function %s with unsupported types of arguments." ER_GIS_UNKNOWN_ERROR - eng "Unknown GIS error occured in function %s." + eng "Unknown GIS error occurred in function %s." ER_GIS_UNKNOWN_EXCEPTION eng "Unknown exception caught in GIS function %s." @@ -7871,7 +7871,7 @@ ER_DROP_VERSIONING_SYSTEM_TIME_PARTITION eng "Can not DROP SYSTEM VERSIONING for table %`s partitioned BY SYSTEM_TIME" ER_VERS_DB_NOT_SUPPORTED - eng "System-versioned tables in the %`s database are not suported" + eng "System-versioned tables in the %`s database are not supported" ER_VERS_TRT_IS_DISABLED eng "Transaction registry is disabled" diff --git a/sql/slave.cc b/sql/slave.cc index 1ed701c75a2..d39e17baadc 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -485,6 +485,9 @@ handle_slave_background(void *arg __attribute__((unused))) thd->store_globals(); thd->security_ctx->skip_grants(); thd->set_command(COM_DAEMON); +#ifdef WITH_WSREP + thd->variables.wsrep_on= 0; +#endif thd_proc_info(thd, "Loading slave GTID position from table"); if (rpl_load_gtid_slave_state(thd)) @@ -4727,6 +4730,9 @@ pthread_handler_t handle_slave_io(void *arg) } +#ifdef WITH_WSREP + thd->variables.wsrep_on= 0; +#endif if (DBUG_EVALUATE_IF("failed_slave_start", 1, 0) || repl_semisync_slave.slave_start(mi)) { @@ -7922,7 +7928,39 @@ err: sql_print_error("Error reading relay log event: %s", errmsg); DBUG_RETURN(0); } +#ifdef WITH_WSREP +enum Log_event_type wsrep_peak_event(rpl_group_info *rgi, ulonglong* event_size) +{ + enum Log_event_type ev_type; + + mysql_mutex_lock(&rgi->rli->data_lock); + + unsigned long long event_pos= rgi->event_relay_log_pos; + unsigned long long orig_future_pos= rgi->future_event_relay_log_pos; + unsigned long long future_pos= rgi->future_event_relay_log_pos; + + /* scan the log to read next event and we skip + annotate events. */ + do { + my_b_seek(rgi->rli->cur_log, future_pos); + rgi->rli->event_relay_log_pos= future_pos; + rgi->event_relay_log_pos= future_pos; + Log_event* ev= next_event(rgi, event_size); + ev_type= (ev) ? ev->get_type_code() : UNKNOWN_EVENT; + delete ev; + future_pos+= *event_size; + } while (ev_type == ANNOTATE_ROWS_EVENT || ev_type == XID_EVENT); + + /* scan the log back and re-set the positions to original values */ + rgi->rli->event_relay_log_pos= event_pos; + rgi->event_relay_log_pos= event_pos; + my_b_seek(rgi->rli->cur_log, orig_future_pos); + + mysql_mutex_unlock(&rgi->rli->data_lock); + return ev_type; +} +#endif /* WITH_WSREP */ /* Rotate a relay log (this is used only by FLUSH LOGS; the automatic rotation because of size is simpler because when we do it we already have all relevant diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 9581ded8a12..8631d800001 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -3453,11 +3453,7 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp, Update the state of the active arena if no errors on open_tables stage. */ - if (likely(!res) || likely(!thd->is_error()) || - (thd->get_stmt_da()->sql_errno() != ER_CANT_REOPEN_TABLE && - thd->get_stmt_da()->sql_errno() != ER_NO_SUCH_TABLE && - thd->get_stmt_da()->sql_errno() != ER_NO_SUCH_TABLE_IN_ENGINE && - thd->get_stmt_da()->sql_errno() != ER_UPDATE_TABLE_USED)) + if (likely(!res) || likely(!thd->is_error())) thd->stmt_arena->state= Query_arena::STMT_EXECUTED; /* diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index 3b15c5a505e..6fdbc14a372 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -175,7 +175,7 @@ static int prepare_for_repair(THD *thd, TABLE_LIST *table_list, /* Check if this is a table type that stores index and data separately, like ISAM or MyISAM. We assume fixed order of engine file name - extentions array. First element of engine file name extentions array + extensions array. First element of engine file name extensions array is meta/index file extention. Second element - data file extention. */ ext= table->file->bas_ext(); diff --git a/sql/sql_db.cc b/sql/sql_db.cc index ddc5234fa01..b2b591464f7 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -50,7 +50,7 @@ #define MAX_DROP_TABLE_Q_LEN 1024 const char *del_exts[]= {".BAK", ".opt", NullS}; -static TYPELIB deletable_extentions= +static TYPELIB deletable_extensions= {array_elements(del_exts)-1,"del_exts", del_exts, NULL}; static bool find_db_tables_and_rm_known_files(THD *, MY_DIR *, const char *, @@ -1140,7 +1140,7 @@ static bool find_db_tables_and_rm_known_files(THD *thd, MY_DIR *dirp, } if (!(extension= strrchr(file->name, '.'))) extension= strend(file->name); - if (find_type(extension, &deletable_extentions, FIND_TYPE_NO_PREFIX) > 0) + if (find_type(extension, &deletable_extensions, FIND_TYPE_NO_PREFIX) > 0) { strxmov(filePath, path, "/", file->name, NullS); /* diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 622b24292f3..f4cad88124f 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -1027,7 +1027,7 @@ int mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, DBUG_ASSERT(table_list->table); // conds could be cached from previous SP call - DBUG_ASSERT(!table_list->vers_conditions.is_set() || + DBUG_ASSERT(!table_list->vers_conditions.need_setup() || !*conds || thd->stmt_arena->is_stmt_execute()); if (select_lex->vers_setup_conds(thd, table_list)) DBUG_RETURN(TRUE); diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 3f955c16eb3..8396fd89433 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -741,8 +741,15 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived) case SQLCOM_DELETE_MULTI: case SQLCOM_UPDATE: case SQLCOM_UPDATE_MULTI: - if ((res= unit->prepare(derived, derived->derived_result, 0))) + if ((res= first_select->vers_setup_conds(thd, + derived->merge_underlying_list))) goto exit; + if (derived->merge_underlying_list->where) + { + Query_arena_stmt on_stmt_arena(thd); + derived->where= and_items(thd, derived->where, + derived->merge_underlying_list->where); + } default: break; } diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index ad552928e7c..c8f4ac05efc 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -2137,11 +2137,15 @@ public: ulong auto_increment_offset; LEX_STRING query; Time_zone *time_zone; + char *user, *host, *ip; + query_id_t query_id; + my_thread_id thread_id; delayed_row(LEX_STRING const query_arg, enum_duplicates dup_arg, bool ignore_arg, bool log_query_arg) : record(0), dup(dup_arg), ignore(ignore_arg), log_query(log_query_arg), - forced_insert_id(0), query(query_arg), time_zone(0) + forced_insert_id(0), query(query_arg), time_zone(0), + user(0), host(0), ip(0) {} ~delayed_row() { @@ -2189,6 +2193,27 @@ public: passed from connection thread to the handler thread. */ MDL_request grl_protection; + my_thread_id orig_thread_id; + void set_default_user() + { + thd.security_ctx->user=(char*) delayed_user; + thd.security_ctx->host=(char*) my_localhost; + thd.security_ctx->ip= NULL; + thd.query_id= 0; + thd.thread_id= orig_thread_id; + } + + void set_user_from_row(const delayed_row *r) + { + if (r) + { + thd.security_ctx->user= r->user; + thd.security_ctx->host= r->host; + thd.security_ctx->ip= r->ip; + thd.query_id= r->query_id; + thd.thread_id= r->thread_id; + } + } Delayed_insert(SELECT_LEX *current_select) :locks_in_memory(0), thd(next_thread_id()), @@ -2196,8 +2221,8 @@ public: status(0), retry(0), handler_thread_initialized(FALSE), group_count(0) { DBUG_ENTER("Delayed_insert constructor"); - thd.security_ctx->user=(char*) delayed_user; - thd.security_ctx->host=(char*) my_localhost; + orig_thread_id= thd.thread_id; + set_default_user(); strmake_buf(thd.security_ctx->priv_user, thd.security_ctx->user); thd.current_tablenr=0; thd.set_command(COM_DELAYED_INSERT); @@ -2693,6 +2718,7 @@ int write_delayed(THD *thd, TABLE *table, enum_duplicates duplic, delayed_row *row= 0; Delayed_insert *di=thd->di; const Discrete_interval *forced_auto_inc; + size_t user_len, host_len, ip_len; DBUG_ENTER("write_delayed"); DBUG_PRINT("enter", ("query = '%s' length %lu", query.str, (ulong) query.length)); @@ -2726,11 +2752,45 @@ int write_delayed(THD *thd, TABLE *table, enum_duplicates duplic, goto err; } + user_len= host_len= ip_len= 0; + row->user= row->host= row->ip= NULL; + if (thd->security_ctx) + { + if (thd->security_ctx->user) + user_len= strlen(thd->security_ctx->user) + 1; + if (thd->security_ctx->host) + host_len= strlen(thd->security_ctx->host) + 1; + if (thd->security_ctx->ip) + ip_len= strlen(thd->security_ctx->ip) + 1; + } /* This can't be THREAD_SPECIFIC as it's freed in delayed thread */ - if (!(row->record= (char*) my_malloc(table->s->reclength, + if (!(row->record= (char*) my_malloc(table->s->reclength + + user_len + host_len + ip_len, MYF(MY_WME)))) goto err; memcpy(row->record, table->record[0], table->s->reclength); + + if (thd->security_ctx) + { + if (thd->security_ctx->user) + { + row->user= row->record + table->s->reclength; + memcpy(row->user, thd->security_ctx->user, user_len); + } + if (thd->security_ctx->host) + { + row->host= row->record + table->s->reclength + user_len; + memcpy(row->host, thd->security_ctx->host, host_len); + } + if (thd->security_ctx->ip) + { + row->ip= row->record + table->s->reclength + user_len + host_len; + memcpy(row->ip, thd->security_ctx->ip, ip_len); + } + } + row->query_id= thd->query_id; + row->thread_id= thd->thread_id; + row->start_time= thd->start_time; row->start_time_sec_part= thd->start_time_sec_part; row->query_start_sec_part_used= thd->query_start_sec_part_used; @@ -3148,6 +3208,7 @@ pthread_handler_t handle_delayed_insert(void *arg) if (di->tables_in_use && ! thd->lock && (!thd->killed || di->stacked_inserts)) { + di->set_user_from_row(di->rows.head()); /* Request for new delayed insert. Lock the table, but avoid to be blocked by a global read lock. @@ -3167,6 +3228,18 @@ pthread_handler_t handle_delayed_insert(void *arg) } if (di->stacked_inserts) { + delayed_row *row; + I_List_iterator<delayed_row> it(di->rows); + while ((row= it++)) + { + if (di->thd.thread_id != row->thread_id) + { + di->set_user_from_row(row); + mysql_audit_external_lock(&di->thd, di->table->s, F_WRLCK); + } + } + di->set_default_user(); + if (di->handle_inserts()) { /* Some fatal error */ diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc index 3b051259ad6..3a509b3d750 100644 --- a/sql/sql_join_cache.cc +++ b/sql/sql_join_cache.cc @@ -2141,7 +2141,7 @@ enum_nested_loop_state JOIN_CACHE::join_records(bool skip_last) DBUG_ASSERT(!is_key_access()); /* Restore the last record from the join buffer to generate - all extentions for it. + all extensions for it. */ get_record(); } diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 9f7413241b6..202cfaa9ea7 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -3344,7 +3344,7 @@ int reset_slave(THD *thd, Master_info* mi) char fname[FN_REFLEN]; int thread_mask= 0, error= 0; uint sql_errno=ER_UNKNOWN_ERROR; - const char* errmsg= "Unknown error occurred while reseting slave"; + const char* errmsg= "Unknown error occurred while resetting slave"; char master_info_file_tmp[FN_REFLEN]; char relay_log_info_file_tmp[FN_REFLEN]; DBUG_ENTER("reset_slave"); @@ -3951,7 +3951,7 @@ int reset_master(THD* thd, rpl_gtid *init_state, uint32 init_state_len, } #endif /* WITH_WSREP */ bool ret= 0; - /* Temporarily disable master semisync before reseting master. */ + /* Temporarily disable master semisync before resetting master. */ repl_semisync_master.before_reset_master(); ret= mysql_bin_log.reset_logs(thd, 1, init_state, init_state_len, next_log_number); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 337b1d5e02a..a685c948a3d 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1980,7 +1980,20 @@ JOIN::optimize_inner() } } - conds= optimize_cond(this, conds, join_list, FALSE, + bool ignore_on_expr= false; + /* + PS/SP note: on_expr of versioned table can not be reallocated + (see build_equal_items() below) because it can be not rebuilt + at second invocation. + */ + if (!thd->stmt_arena->is_conventional() && thd->mem_root != thd->stmt_arena->mem_root) + for (TABLE_LIST *tbl= tables_list; tbl; tbl= tbl->next_local) + if (tbl->table && tbl->on_expr && tbl->table->versioned()) + { + ignore_on_expr= true; + break; + } + conds= optimize_cond(this, conds, join_list, ignore_on_expr, &cond_value, &cond_equal, OPT_LINK_EQUAL_FIELDS); if (thd->is_error()) @@ -18488,7 +18501,7 @@ create_tmp_table(THD *thd, TMP_TABLE_PARAM *param, List<Item> &fields, /* Test if there is a default field value. The test for ->ptr is to skip - 'offset' fields generated by initalize_tables + 'offset' fields generated by initialize_tables */ if (default_field[i] && default_field[i]->ptr) { @@ -21265,7 +21278,7 @@ join_read_last(JOIN_TAB *tab) { TABLE *table=tab->table; int error= 0; - DBUG_ENTER("join_read_first"); + DBUG_ENTER("join_read_last"); DBUG_ASSERT(table->no_keyread || !table->covering_keys.is_set(tab->index) || diff --git a/sql/sql_sequence.cc b/sql/sql_sequence.cc index 4e8624d6360..035fb1211e6 100644 --- a/sql/sql_sequence.cc +++ b/sql/sql_sequence.cc @@ -487,9 +487,12 @@ int SEQUENCE::read_initial_values(TABLE *table) Doing mysql_lock_tables() may have started a read only transaction. If that happend, it's better that we commit it now, as a lot of code assumes that there is no active stmt transaction directly after - open_tables() + open_tables(). + But we also don't want to commit the stmt transaction while in a + substatement, see MDEV-15977. */ - if (!has_active_transaction && !thd->transaction.stmt.is_empty()) + if (!has_active_transaction && !thd->transaction.stmt.is_empty() && + !thd->in_sub_stmt) trans_commit_stmt(thd); } write_unlock(table); diff --git a/sql/sql_servers.cc b/sql/sql_servers.cc index 8f0f08da075..7913a7d2b9f 100644 --- a/sql/sql_servers.cc +++ b/sql/sql_servers.cc @@ -431,7 +431,7 @@ insert_server_record_into_cache(FOREIGN_SERVER *server) int error=0; DBUG_ENTER("insert_server_record_into_cache"); /* - We succeded in insertion of the server to the table, now insert + We succeeded in insertion of the server to the table, now insert the server to the cache */ DBUG_PRINT("info", ("inserting server %s at %p, length %zd", @@ -686,7 +686,7 @@ delete_server_record_in_cache(LEX_SERVER_OPTIONS *server_options) goto end; } /* - We succeded in deletion of the server to the table, now delete + We succeeded in deletion of the server to the table, now delete the server from the cache */ DBUG_PRINT("info",("deleting server %s length %zd", diff --git a/sql/sql_show.cc b/sql/sql_show.cc index dcfcba0a01e..1cd43cc24ab 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1317,7 +1317,8 @@ mysqld_show_create_get_fields(THD *thd, TABLE_LIST *table_list, goto exit; } else if (lex->table_type == TABLE_TYPE_SEQUENCE && - table_list->table->s->table_type != TABLE_TYPE_SEQUENCE) + (!table_list->table || + table_list->table->s->table_type != TABLE_TYPE_SEQUENCE)) { my_error(ER_NOT_SEQUENCE, MYF(0), table_list->db.str, table_list->table_name.str); diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 8ecac25e162..af09675d917 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -1387,7 +1387,7 @@ bool mysql_prepare_update(THD *thd, TABLE_LIST *table_list, DBUG_ASSERT(table_list->table); // conds could be cached from previous SP call - DBUG_ASSERT(!table_list->vers_conditions.is_set() || + DBUG_ASSERT(!table_list->vers_conditions.need_setup() || !*conds || thd->stmt_arena->is_stmt_execute()); if (select_lex->vers_setup_conds(thd, table_list)) DBUG_RETURN(TRUE); diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index f01757f6163..1c47f652f4c 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -6314,7 +6314,7 @@ static Sys_var_enum Sys_session_track_transaction_info( "Track changes to the transaction attributes. OFF to disable; " "STATE to track just transaction state (Is there an active transaction? " "Does it have any data? etc.); CHARACTERISTICS to track transaction " - "state and report all statements needed to start a transaction with" + "state and report all statements needed to start a transaction with " "the same characteristics (isolation level, read only/read write," "snapshot - but not any work done / data modified within the " "transaction).", diff --git a/sql/table.h b/sql/table.h index 458482315c3..cd9eaaf1e76 100644 --- a/sql/table.h +++ b/sql/table.h @@ -1993,6 +1993,10 @@ struct vers_select_conds_t { return orig_type != SYSTEM_TIME_UNSPECIFIED; } + bool need_setup() const + { + return type != SYSTEM_TIME_UNSPECIFIED && type != SYSTEM_TIME_ALL; + } bool resolve_units(THD *thd); bool eq(const vers_select_conds_t &conds) const; }; @@ -3209,7 +3213,7 @@ public: @param[in] timestamp @param[in] true if we search for a lesser timestamp, false if greater - @retval true if exists, false it not exists or an error occured + @retval true if exists, false it not exists or an error occurred */ bool query(MYSQL_TIME &commit_time, bool backwards); /** diff --git a/sql/threadpool_common.cc b/sql/threadpool_common.cc index 6577472e20b..efcc56d67be 100644 --- a/sql/threadpool_common.cc +++ b/sql/threadpool_common.cc @@ -192,7 +192,7 @@ void tp_callback(TP_connection *c) } else if (threadpool_process_request(thd)) { - /* QUIT or an error occured. */ + /* QUIT or an error occurred. */ goto error; } diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index bef574e07b2..597055c48b1 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -46,7 +46,6 @@ #include <cstdlib> #include <string> #include "log_event.h" -#include <slave.h> #include <sstream> @@ -1646,6 +1645,39 @@ static bool wsrep_can_run_in_toi(THD *thd, const char *db, const char *table, { return false; } + /* + If mariadb master has replicated a CTAS, we should not replicate the create table + part separately as TOI, but to replicate both create table and following inserts + as one write set. + Howver, if CTAS creates empty table, we should replicate the create table alone + as TOI. We have to do relay log event lookup to see if row events follow the + create table event. + */ + if (thd->slave_thread && !(thd->rgi_slave->gtid_ev_flags2 & Gtid_log_event::FL_STANDALONE)) + { + /* this is CTAS, either empty or populated table */ + ulonglong event_size = 0; + enum Log_event_type ev_type= wsrep_peak_event(thd->rgi_slave, &event_size); + switch (ev_type) + { + case QUERY_EVENT: + /* CTAS with empty table, we replicate create table as TOI */ + break; + + case TABLE_MAP_EVENT: + WSREP_DEBUG("replicating CTAS of empty table as TOI"); + // fall through + case WRITE_ROWS_EVENT: + /* CTAS with populated table, we replicate later at commit time */ + WSREP_DEBUG("skipping create table of CTAS replication"); + return false; + + default: + WSREP_WARN("unexpected async replication event: %d", ev_type); + } + return true; + } + /* no next async replication event */ return true; case SQLCOM_CREATE_VIEW: diff --git a/storage/connect/CMakeLists.txt b/storage/connect/CMakeLists.txt index e66247edc68..199a8a3fa8b 100644 --- a/storage/connect/CMakeLists.txt +++ b/storage/connect/CMakeLists.txt @@ -318,6 +318,9 @@ ENDIF(CONNECT_WITH_MONGO) OPTION(CONNECT_WITH_REST "Compile CONNECT storage engine with REST support" ON) IF(CONNECT_WITH_REST) + MESSAGE(STATUS "=====> REST support is ON") + SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabrest.cpp tabrest.h) + add_definitions(-DREST_SUPPORT) FIND_PACKAGE(cpprestsdk QUIET) IF (cpprestsdk_FOUND) IF(UNIX) @@ -331,10 +334,10 @@ IF(CONNECT_WITH_REST) # Comment it out if not needed depending on your cpprestsdk installation. SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd") ENDIF(UNIX) - IF(REST_LIBRARY) - SET(CONNECT_SOURCES ${CONNECT_SOURCES} tabrest.cpp restget.cpp tabrest.h) - add_definitions(-DREST_SUPPORT) - ENDIF() +# IF(REST_LIBRARY) why this? how about Windows + SET(CONNECT_SOURCES ${CONNECT_SOURCES} restget.cpp) + add_definitions(-DREST_SOURCE) +# ENDIF() ELSE(NOT cpprestsdk_FOUND) # MESSAGE(STATUS "=====> cpprestsdk package not found") ENDIF (cpprestsdk_FOUND) diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc index 461391d2896..dfc619cf4af 100644 --- a/storage/connect/connect.cc +++ b/storage/connect/connect.cc @@ -566,7 +566,7 @@ int CntCloseTable(PGLOBAL g, PTDB tdbp, bool nox, bool abort) rc = tdbp->DeleteDB(g, RC_EF); // Specific A.M. delete routine } else if (tdbp->GetMode() == MODE_UPDATE && tdbp->IsIndexed()) - rc = ((PTDBDOX)tdbp)->Txfp->UpdateSortedRows(g); + rc = ((PTDBDOS)tdbp)->GetTxfp()->UpdateSortedRows(g); switch (rc) { case RC_FX: @@ -593,7 +593,7 @@ int CntCloseTable(PGLOBAL g, PTDB tdbp, bool nox, bool abort) if (!tdbp->IsRemote()) { // Make all the eventual indexes - PTDBDOX tbxp = (PTDBDOX)tdbp; + PTDBDOS tbxp = (PTDBDOS)tdbp; tbxp->ResetKindex(g, NULL); tbxp->SetKey_Col(NULL); rc = tbxp->ResetTableOpt(g, true, tbxp->GetDef()->Indexable() == 1); @@ -622,8 +622,8 @@ int CntCloseTable(PGLOBAL g, PTDB tdbp, bool nox, bool abort) int CntIndexInit(PGLOBAL g, PTDB ptdb, int id, bool sorted) { PIXDEF xdp; - PTDBDOX tdbp; - DOXDEF *dfp; + PTDBDOS tdbp; + DOSDEF *dfp; if (!ptdb) return -1; @@ -633,9 +633,9 @@ int CntIndexInit(PGLOBAL g, PTDB ptdb, int id, bool sorted) } else if (ptdb->GetDef()->Indexable() == 3) { return 1; } else - tdbp= (PTDBDOX)ptdb; + tdbp= (PTDBDOS)ptdb; - dfp= (DOXDEF*)tdbp->To_Def; + dfp= (DOSDEF*)tdbp->GetDef(); //if (!(k= colp->GetKey())) // if (colp->GetOpt() >= 2) { @@ -645,16 +645,16 @@ int CntIndexInit(PGLOBAL g, PTDB ptdb, int id, bool sorted) // This is a pseudo indexed sorted block optimized column // return 0; - if (tdbp->To_Kindex) - if (((XXBASE*)tdbp->To_Kindex)->GetID() == id) { - tdbp->To_Kindex->Reset(); // Same index - return (tdbp->To_Kindex->IsMul()) ? 2 : 1; + if (tdbp->GetKindex()) + if (((XXBASE*)tdbp->GetKindex())->GetID() == id) { + tdbp->GetKindex()->Reset(); // Same index + return (tdbp->GetKindex()->IsMul()) ? 2 : 1; } else { - tdbp->To_Kindex->Close(); - tdbp->To_Kindex= NULL; + tdbp->GetKindex()->Close(); + tdbp->SetKindex(NULL); } // endif colp - for (xdp= dfp->To_Indx; xdp; xdp= xdp->GetNext()) + for (xdp= dfp->GetIndx(); xdp; xdp= xdp->GetNext()) if (xdp->GetID() == id) break; @@ -676,7 +676,7 @@ int CntIndexInit(PGLOBAL g, PTDB ptdb, int id, bool sorted) if (tdbp->InitialyzeIndex(g, xdp, sorted)) return 0; - return (tdbp->To_Kindex->IsMul()) ? 2 : 1; + return (tdbp->GetKindex()->IsMul()) ? 2 : 1; } // end of CntIndexInit #if defined(WORDS_BIGENDIAN) @@ -710,7 +710,7 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op, int n, x; RCODE rc; XXBASE *xbp; - PTDBDOX tdbp; + PTDBDOS tdbp; if (!ptdb) return RC_FX; @@ -736,12 +736,12 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op, goto rnd; } else - tdbp= (PTDBDOX)ptdb; + tdbp= (PTDBDOS)ptdb; // Set reference values and index operator - if (!tdbp->To_Link || !tdbp->To_Kindex) { + if (!tdbp->GetLink() || !tdbp->GetKindex()) { // if (!tdbp->To_Xdp) { - sprintf(g->Message, "Index not initialized for table %s", tdbp->Name); + sprintf(g->Message, "Index not initialized for table %s", tdbp->GetName()); return RC_FX; #if 0 } // endif !To_Xdp @@ -754,7 +754,7 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op, #endif // 0 } // endif !To_Kindex - xbp= (XXBASE*)tdbp->To_Kindex; + xbp= (XXBASE*)tdbp->GetKindex(); if (kr) { char *kp= (char*)kr->key; @@ -764,13 +764,13 @@ RCODE CntIndexRead(PGLOBAL g, PTDB ptdb, OPVAL op, PVAL valp; PCOL colp; - for (n= 0; n < tdbp->Knum; n++) { - colp= (PCOL)tdbp->To_Key_Col[n]; + for (n= 0; n < tdbp->GetKnum(); n++) { + colp= (PCOL)tdbp->Key(n); if (colp->GetColUse(U_NULLS)) kp++; // Skip null byte - valp= tdbp->To_Link[n]->GetValue(); + valp= tdbp->Link(n)->GetValue(); if (!valp->IsTypeNum()) { if (colp->GetColUse(U_VAR)) { @@ -840,7 +840,7 @@ int CntIndexRange(PGLOBAL g, PTDB ptdb, const uchar* *key, uint *len, bool b, rcb; PVAL valp; PCOL colp; - PTDBDOX tdbp; + PTDBDOS tdbp; XXBASE *xbp; if (!ptdb) @@ -865,35 +865,35 @@ int CntIndexRange(PGLOBAL g, PTDB ptdb, const uchar* *key, uint *len, return k[1] - k[0] + 1; } else - tdbp= (PTDBDOX)ptdb; + tdbp= (PTDBDOS)ptdb; - if (!tdbp->To_Kindex || !tdbp->To_Link) { - if (!tdbp->To_Xdp) { - sprintf(g->Message, "Index not initialized for table %s", tdbp->Name); + if (!tdbp->GetKindex() || !tdbp->GetLink()) { + if (!tdbp->GetXdp()) { + sprintf(g->Message, "Index not initialized for table %s", tdbp->GetName()); DBUG_PRINT("Range", ("%s", g->Message)); return -1; } else // Dynamic index - return tdbp->To_Xdp->GetMaxSame(); // TODO a better estimate + return tdbp->GetXdp()->GetMaxSame(); // TODO a better estimate } else - xbp= (XXBASE*)tdbp->To_Kindex; + xbp= (XXBASE*)tdbp->GetKindex(); for (b= false, i= 0; i < 2; i++) { p= kp= key[i]; if (kp) { - for (n= 0; n < tdbp->Knum; n++) { + for (n= 0; n < tdbp->GetKnum(); n++) { if (kmap[i] & (key_part_map)(1 << n)) { if (b == true) // Cannot do indexing with missing intermediate key return -1; - colp= (PCOL)tdbp->To_Key_Col[n]; + colp= (PCOL)tdbp->Key(n); if (colp->GetColUse(U_NULLS)) p++; // Skip null byte ??? - valp= tdbp->To_Link[n]->GetValue(); + valp= tdbp->Link(n)->GetValue(); if (!valp->IsTypeNum()) { if (colp->GetColUse(U_VAR)) { diff --git a/storage/connect/connect.h b/storage/connect/connect.h index 3a60cd40160..d1fc2ea592f 100644 --- a/storage/connect/connect.h +++ b/storage/connect/connect.h @@ -46,6 +46,7 @@ int CntIndexRange(PGLOBAL g, PTDB ptdb, const uchar* *key, uint *len, bool *incl, key_part_map *kmap); PGLOBAL CntExit(PGLOBAL g); +#if 0 /***********************************************************************/ /* Definition of classes XKPDEF, DOXDEF, TDBDOX */ /* These classes purpose is chiefly to access protected items! */ @@ -76,3 +77,4 @@ class XKPDEF: public KPARTDEF { public: XKPDEF(const char *name, int n) : KPARTDEF((PSZ)name, n) {} }; // end of class XKPDEF +#endif // 0 diff --git a/storage/connect/filamzip.cpp b/storage/connect/filamzip.cpp index e76dc496246..f7866b9dae1 100644 --- a/storage/connect/filamzip.cpp +++ b/storage/connect/filamzip.cpp @@ -700,7 +700,7 @@ bool UNZIPUTL::openEntry(PGLOBAL g) } // endif rc if (trace(1)) - htrc("Openning entry%s %s\n", fn, (entryopen) ? "oked" : "failed"); + htrc("Opening entry%s %s\n", fn, (entryopen) ? "oked" : "failed"); return !entryopen; } // end of openEntry diff --git a/storage/connect/filter.h b/storage/connect/filter.h index b0fea3d69e0..c6ab8fddd35 100644 --- a/storage/connect/filter.h +++ b/storage/connect/filter.h @@ -48,7 +48,6 @@ class DllExport FILTER : public XOBJECT { /* Filter description block */ PVAL &Val(int i) {return Test[i].Value;} bool &Conv(int i) {return Test[i].Conv;} void SetNext(PFIL filp) {Next = filp;} - bool MakeSelector(PGLOBAL g, PSTRG s); // Methods virtual void Reset(void); diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc index 2f2e42765b8..964a1f478f9 100644 --- a/storage/connect/ha_connect.cc +++ b/storage/connect/ha_connect.cc @@ -170,9 +170,9 @@ #define JSONMAX 10 // JSON Default max grp size extern "C" { - char version[]= "Version 1.06.0010 June 01, 2019"; + char version[]= "Version 1.07.0001 November 12, 2019"; #if defined(__WIN__) - char compver[]= "Version 1.06.0010 " __DATE__ " " __TIME__; + char compver[]= "Version 1.07.0001 " __DATE__ " " __TIME__; char slash= '\\'; #else // !__WIN__ char slash= '/'; @@ -704,9 +704,9 @@ DllExport LPCSTR PlugSetPath(LPSTR to, LPCSTR name, LPCSTR dir) used by the default rename_table and delete_table method in handler.cc. - For engines that have two file name extentions (separate meta/index file + For engines that have two file name extensions (separate meta/index file and data file), the order of elements is relevant. First element of engine - file name extentions array should be meta/index file extention. Second + file name extensions array should be meta/index file extention. Second element - data file extention. This order is assumed by prepare_for_repair() when REPAIR TABLE ... USE_FRM is issued. @@ -1043,6 +1043,8 @@ TABTYPE ha_connect::GetRealType(PTOS pos) case TAB_REST: type = TAB_NIY; break; + default: + break; } // endswitch type #endif // REST_SUPPORT @@ -2964,9 +2966,9 @@ PCFIL ha_connect::CheckCond(PGLOBAL g, PCFIL filp, const Item *cond) case Item_func::GE_FUNC: vop= OP_GE; break; case Item_func::GT_FUNC: vop= OP_GT; break; case Item_func::LIKE_FUNC: - vop= OP_LIKE; - neg= ((Item_func_opt_neg *)condf)->negated; - break; + vop = OP_LIKE; + neg= ((Item_func_like*)condf)->negated; + break; case Item_func::ISNOTNULL_FUNC: neg= true; // fall through @@ -3781,9 +3783,9 @@ int ha_connect::index_init(uint idx, bool sorted) active_index= MAX_KEY; rc= HA_ERR_INTERNAL_ERROR; } else if (tdbp->GetKindex()) { - if (((PTDBDOX)tdbp)->To_Kindex->GetNum_K()) { + if (((PTDBDOS)tdbp)->GetKindex()->GetNum_K()) { if (tdbp->GetFtype() != RECFM_NAF) - ((PTDBDOX)tdbp)->GetTxfp()->ResetBuffer(g); + ((PTDBDOS)tdbp)->GetTxfp()->ResetBuffer(g); active_index= idx; // } else { // Void table @@ -5627,6 +5629,8 @@ static int connect_assisted_discovery(handlerton *, THD* thd, case TAB_CSV: ttp = TAB_REST; break; + default: + break; } // endswitch type #endif // REST_SUPPORT } // endif ttp @@ -6037,7 +6041,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, } // endif !nblin for (i= 0; !rc && i < qrp->Nblin; i++) { - typ= len= prec= dec= 0; + typ= len= prec= dec= flg= 0; tm= NOT_NULL_FLAG; cnm= (char*)"noname"; dft= xtra= key= fmt= tn= NULL; @@ -6078,6 +6082,9 @@ static int connect_assisted_discovery(handlerton *, THD* thd, tm= 0; // Nullable break; + case FLD_FLAG: + flg = crp->Kdata->GetIntValue(i); + break; case FLD_FORMAT: fmt= (crp->Kdata) ? crp->Kdata->GetCharValue(i) : NULL; break; @@ -6208,7 +6215,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd, // Now add the field if (add_field(&sql, cnm, typ, prec, dec, key, tm, rem, dft, xtra, - fmt, 0, dbf, v)) + fmt, flg, dbf, v)) rc= HA_ERR_OUT_OF_MEM; } // endfor i @@ -7356,14 +7363,14 @@ maria_declare_plugin(connect) &connect_storage_engine, "CONNECT", "Olivier Bertrand", - "Management of External Data (SQL/NOSQL/MED), including many file formats", + "Management of External Data (SQL/NOSQL/MED), including Rest query results", PLUGIN_LICENSE_GPL, connect_init_func, /* Plugin Init */ connect_done_func, /* Plugin Deinit */ - 0x0106, /* version number (1.06) */ + 0x0107, /* version number (1.07) */ NULL, /* status variables */ connect_system_variables, /* system variables */ - "1.06.0010", /* string version */ + "1.07.0001", /* string version */ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */ } maria_declare_plugin_end; diff --git a/storage/connect/inihandl.cpp b/storage/connect/inihandl.cpp index 8e79aeac7ef..dacab3c485c 100644 --- a/storage/connect/inihandl.cpp +++ b/storage/connect/inihandl.cpp @@ -194,7 +194,7 @@ static void PROFILE_Save( FILE *file, PROFILESECTION *section ) } for (key = section->key; key; key = key->next) - if (key->name && key->name[0]) { + if (key->name[0]) { fprintf(file, "%s", SVP(key->name)); if (key->value) diff --git a/storage/connect/javaconn.cpp b/storage/connect/javaconn.cpp index f919344f20b..e3f64d17064 100644 --- a/storage/connect/javaconn.cpp +++ b/storage/connect/javaconn.cpp @@ -142,7 +142,7 @@ bool JAVAConn::Check(jint rc) s = (jstring)env->CallObjectMethod(exc, tid); Msg = GetUTFString(s); } else - Msg = "Exception occured"; + Msg = "Exception occurred"; env->ExceptionClear(); } else if (rc < 0) { diff --git a/storage/connect/mycat.cc b/storage/connect/mycat.cc index 411e96e3dc8..f8b3dc03aa5 100644 --- a/storage/connect/mycat.cc +++ b/storage/connect/mycat.cc @@ -95,7 +95,7 @@ #endif // ZIP_SUPPORT #if defined(REST_SUPPORT) #include "tabrest.h" -#endif // Rest_SUPPORT +#endif // REST_SUPPORT #include "mycat.h" /***********************************************************************/ @@ -104,8 +104,9 @@ #if defined(__WIN__) extern "C" HINSTANCE s_hModule; // Saved module handle #endif // !__WIN__ - -PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info); +#if defined(JAVA_SUPPORT) || defined(CMGO_SUPPORT) +bool MongoEnabled(void); +#endif // JAVA_SUPPORT || CMGO_SUPPORT /***********************************************************************/ /* Get the plugin directory. */ @@ -347,100 +348,6 @@ uint GetFuncID(const char *func) return fnc; } // end of GetFuncID -/***********************************************************************/ -/* OEMColumn: Get table column info for an OEM table. */ -/***********************************************************************/ -PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char *tab, char *db, bool info) - { - typedef PQRYRES (__stdcall *XCOLDEF) (PGLOBAL, void*, char*, char*, bool); - const char *module, *subtype; - char c, soname[_MAX_PATH], getname[40] = "Col"; -#if defined(__WIN__) - HANDLE hdll; /* Handle to the external DLL */ -#else // !__WIN__ - void *hdll; /* Handle for the loaded shared library */ -#endif // !__WIN__ - XCOLDEF coldef = NULL; - PQRYRES qrp = NULL; - - module = topt->module; - subtype = topt->subtype; - - if (!module || !subtype) - return NULL; - - /*********************************************************************/ - /* Ensure that the .dll doesn't have a path. */ - /* This is done to ensure that only approved dll from the system */ - /* directories are used (to make this even remotely secure). */ - /*********************************************************************/ - if (check_valid_path(module, strlen(module))) { - strcpy(g->Message, "Module cannot contain a path"); - return NULL; - } else - PlugSetPath(soname, module, GetPluginDir()); - - // The exported name is always in uppercase - for (int i = 0; ; i++) { - c = subtype[i]; - getname[i + 3] = toupper(c); - if (!c) break; - } // endfor i - -#if defined(__WIN__) - // Load the Dll implementing the table - if (!(hdll = LoadLibrary(soname))) { - char buf[256]; - DWORD rc = GetLastError(); - - sprintf(g->Message, MSG(DLL_LOAD_ERROR), rc, soname); - FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, NULL, rc, 0, - (LPTSTR)buf, sizeof(buf), NULL); - strcat(strcat(g->Message, ": "), buf); - return NULL; - } // endif hDll - - // Get the function returning an instance of the external DEF class - if (!(coldef = (XCOLDEF)GetProcAddress((HINSTANCE)hdll, getname))) { - sprintf(g->Message, MSG(PROCADD_ERROR), GetLastError(), getname); - FreeLibrary((HMODULE)hdll); - return NULL; - } // endif coldef -#else // !__WIN__ - const char *error = NULL; - - // Load the desired shared library - if (!(hdll = dlopen(soname, RTLD_LAZY))) { - error = dlerror(); - sprintf(g->Message, MSG(SHARED_LIB_ERR), soname, SVP(error)); - return NULL; - } // endif Hdll - - // Get the function returning an instance of the external DEF class - if (!(coldef = (XCOLDEF)dlsym(hdll, getname))) { - error = dlerror(); - sprintf(g->Message, MSG(GET_FUNC_ERR), getname, SVP(error)); - dlclose(hdll); - return NULL; - } // endif coldef -#endif // !__WIN__ - - // Just in case the external Get function does not set error messages - sprintf(g->Message, "Error getting column info from %s", subtype); - - // Get the table column definition - qrp = coldef(g, topt, tab, db, info); - -#if defined(__WIN__) - FreeLibrary((HMODULE)hdll); -#else // !__WIN__ - dlclose(hdll); -#endif // !__WIN__ - - return qrp; - } // end of OEMColumns - /* ------------------------- Class CATALOG --------------------------- */ /***********************************************************************/ @@ -481,10 +388,10 @@ void MYCAT::Reset(void) /* GetTableDesc: retrieve a table descriptor. */ /* Look for a table descriptor matching the name and type. */ /***********************************************************************/ -PRELDEF MYCAT::GetTableDesc(PGLOBAL g, PTABLE tablep, +PTABDEF MYCAT::GetTableDesc(PGLOBAL g, PTABLE tablep, LPCSTR type, PRELDEF *) { - PRELDEF tdp= NULL; + PTABDEF tdp= NULL; if (trace(1)) htrc("GetTableDesc: name=%s am=%s\n", tablep->GetName(), SVP(type)); @@ -505,12 +412,12 @@ PRELDEF MYCAT::GetTableDesc(PGLOBAL g, PTABLE tablep, /* MakeTableDesc: make a table/view description. */ /* Note: caller must check if name already exists before calling it. */ /***********************************************************************/ -PRELDEF MYCAT::MakeTableDesc(PGLOBAL g, PTABLE tablep, LPCSTR am) +PTABDEF MYCAT::MakeTableDesc(PGLOBAL g, PTABLE tablep, LPCSTR am) { TABTYPE tc; LPCSTR name= (PSZ)PlugDup(g, tablep->GetName()); LPCSTR schema= (PSZ)PlugDup(g, tablep->GetSchema()); - PRELDEF tdp= NULL; + PTABDEF tdp= NULL; if (trace(1)) htrc("MakeTableDesc: name=%s schema=%s am=%s\n", @@ -578,8 +485,8 @@ PRELDEF MYCAT::MakeTableDesc(PGLOBAL g, PTABLE tablep, LPCSTR am) } // endswitch // Do make the table/view definition - if (tdp && tdp->Define(g, this, name, schema, am)) - tdp= NULL; + if (tdp && tdp->Define(g, this, name, schema, am)) + tdp = NULL; if (trace(1)) htrc("Table %s made\n", am); @@ -592,7 +499,7 @@ PRELDEF MYCAT::MakeTableDesc(PGLOBAL g, PTABLE tablep, LPCSTR am) /***********************************************************************/ PTDB MYCAT::GetTable(PGLOBAL g, PTABLE tablep, MODE mode, LPCSTR type) { - PRELDEF tdp; + PTABDEF tdp; PTDB tdbp= NULL; // LPCSTR name= tablep->GetName(); diff --git a/storage/connect/mycat.h b/storage/connect/mycat.h index 818e535b32d..6473f7a5c11 100644 --- a/storage/connect/mycat.h +++ b/storage/connect/mycat.h @@ -102,14 +102,14 @@ class MYCAT : public CATALOG { // Methods void Reset(void); bool StoreIndex(PGLOBAL, PTABDEF) {return false;} // Temporary - PRELDEF GetTableDesc(PGLOBAL g, PTABLE tablep, + PTABDEF GetTableDesc(PGLOBAL g, PTABLE tablep, LPCSTR type, PRELDEF *prp = NULL); PTDB GetTable(PGLOBAL g, PTABLE tablep, MODE mode = MODE_READ, LPCSTR type = NULL); void ClearDB(PGLOBAL g); protected: - PRELDEF MakeTableDesc(PGLOBAL g, PTABLE tablep, LPCSTR am); + PTABDEF MakeTableDesc(PGLOBAL g, PTABLE tablep, LPCSTR am); // Members ha_connect *Hc; // The Connect handler diff --git a/storage/connect/myconn.cpp b/storage/connect/myconn.cpp index 6de5a73875c..4303a9e191b 100644 --- a/storage/connect/myconn.cpp +++ b/storage/connect/myconn.cpp @@ -472,7 +472,7 @@ int MYSQLC::Open(PGLOBAL g, const char *host, const char *db, int pt, const char *csname) { const char *pipe = NULL; - uint cto = 10, nrt = 20; + //uint cto = 10, nrt = 20; my_bool my_true= 1; m_DB = mysql_init(NULL); @@ -485,11 +485,11 @@ int MYSQLC::Open(PGLOBAL g, const char *host, const char *db, if (trace(1)) htrc("MYSQLC Open: m_DB=%.4X size=%d\n", m_DB, (int)sizeof(*m_DB)); - // Removed to do like FEDERATED do + // Removed to do like FEDERATED does //mysql_options(m_DB, MYSQL_READ_DEFAULT_GROUP, "client-mariadb"); - mysql_options(m_DB, MYSQL_OPT_USE_REMOTE_CONNECTION, NULL); - mysql_options(m_DB, MYSQL_OPT_CONNECT_TIMEOUT, &cto); - mysql_options(m_DB, MYSQL_OPT_READ_TIMEOUT, &nrt); +//mysql_options(m_DB, MYSQL_OPT_USE_REMOTE_CONNECTION, NULL); +//mysql_options(m_DB, MYSQL_OPT_CONNECT_TIMEOUT, &cto); +//mysql_options(m_DB, MYSQL_OPT_READ_TIMEOUT, &nrt); //mysql_options(m_DB, MYSQL_OPT_WRITE_TIMEOUT, ...); #if defined(__WIN__) diff --git a/storage/connect/plgdbsem.h b/storage/connect/plgdbsem.h index f10ae209e9d..a40e32bcfb2 100644 --- a/storage/connect/plgdbsem.h +++ b/storage/connect/plgdbsem.h @@ -149,16 +149,22 @@ enum AMT {TYPE_AM_ERROR = 0, /* Type not defined */ TYPE_AM_MGO = 194, /* MGO access method type no */ TYPE_AM_OUT = 200}; /* Output relations (storage) */ -enum RECFM {RECFM_NAF = -2, /* Not a file */ - RECFM_OEM = -1, /* OEM file access method */ - RECFM_VAR = 0, /* Varying length DOS files */ - RECFM_FIX = 1, /* Fixed length DOS files */ - RECFM_BIN = 2, /* Binary DOS files (also fixed) */ - RECFM_VCT = 3, /* VCT formatted files */ - RECFM_ODBC = 4, /* Table accessed via ODBC */ - RECFM_JDBC = 5, /* Table accessed via JDBC */ - RECFM_PLG = 6, /* Table accessed via PLGconn */ - RECFM_DBF = 7}; /* DBase formatted file */ +enum RECFM {RECFM_DFLT = 0, /* Default table type */ + RECFM_NAF = 1, /* Not a file table */ + RECFM_OEM = 2, /* OEM table */ + RECFM_VAR = 3, /* Varying length DOS files */ + RECFM_FIX = 4, /* Fixed length DOS files */ + RECFM_BIN = 5, /* Binary DOS files (also fixed) */ + RECFM_DBF = 6, /* DBase formatted file */ + RECFM_CSV = 7, /* CSV file */ + RECFM_FMT = 8, /* FMT formatted file */ + RECFM_VCT = 9, /* VCT formatted files */ + RECFM_XML = 10, /* XML formatted files */ + RECFM_JASON = 11, /* JASON formatted files */ + RECFM_DIR = 12, /* DIR table */ + RECFM_ODBC = 13, /* Table accessed via ODBC */ + RECFM_JDBC = 14, /* Table accessed via JDBC */ + RECFM_PLG = 15}; /* Table accessed via PLGconn */ enum MISC {DB_TABNO = 1, /* DB routines in Utility Table */ MAX_MULT_KEY = 10, /* Max multiple key number */ @@ -537,7 +543,8 @@ enum XFLD {FLD_NO = 0, /* Not a field definition item */ FLD_FORMAT = 16, /* Field format */ FLD_CAT = 17, /* Table catalog */ FLD_SCHEM = 18, /* Table schema */ - FLD_TABNAME = 19}; /* Column Table name */ + FLD_TABNAME = 19, /* Column Table name */ + FLD_FLAG = 20}; /* Field flag (CONNECT specific) */ /***********************************************************************/ /* Result of last SQL noconv query. */ diff --git a/storage/connect/reldef.cpp b/storage/connect/reldef.cpp index 8ba8aac3621..ffe5f77661d 100644 --- a/storage/connect/reldef.cpp +++ b/storage/connect/reldef.cpp @@ -1,11 +1,11 @@ /************* RelDef CPP Program Source Code File (.CPP) **************/ /* PROGRAM NAME: RELDEF */ /* ------------- */ -/* Version 1.6 */ +/* Version 1.7 */ /* */ /* COPYRIGHT: */ /* ---------- */ -/* (C) Copyright to the author Olivier BERTRAND 2004-2016 */ +/* (C) Copyright to the author Olivier BERTRAND 2004-2019 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -61,6 +61,102 @@ extern handlerton *connect_hton; /***********************************************************************/ USETEMP UseTemp(void); char *GetPluginDir(void); +PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char* tab, char* db, bool info); + +/***********************************************************************/ +/* OEMColumns: Get table column info for an OEM table. */ +/***********************************************************************/ +PQRYRES OEMColumns(PGLOBAL g, PTOS topt, char* tab, char* db, bool info) +{ + typedef PQRYRES(__stdcall* XCOLDEF) (PGLOBAL, void*, char*, char*, bool); + const char* module, * subtype; + char c, soname[_MAX_PATH], getname[40] = "Col"; +#if defined(__WIN__) + HANDLE hdll; /* Handle to the external DLL */ +#else // !__WIN__ + void* hdll; /* Handle for the loaded shared library */ +#endif // !__WIN__ + XCOLDEF coldef = NULL; + PQRYRES qrp = NULL; + + module = topt->module; + subtype = topt->subtype; + + if (!module || !subtype) + return NULL; + + /*********************************************************************/ + /* Ensure that the .dll doesn't have a path. */ + /* This is done to ensure that only approved dll from the system */ + /* directories are used (to make this even remotely secure). */ + /*********************************************************************/ + if (check_valid_path(module, strlen(module))) { + strcpy(g->Message, "Module cannot contain a path"); + return NULL; + } + else + PlugSetPath(soname, module, GetPluginDir()); + + // The exported name is always in uppercase + for (int i = 0; ; i++) { + c = subtype[i]; + getname[i + 3] = toupper(c); + if (!c) break; + } // endfor i + +#if defined(__WIN__) + // Load the Dll implementing the table + if (!(hdll = LoadLibrary(soname))) { + char buf[256]; + DWORD rc = GetLastError(); + + sprintf(g->Message, MSG(DLL_LOAD_ERROR), rc, soname); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, NULL, rc, 0, + (LPTSTR)buf, sizeof(buf), NULL); + strcat(strcat(g->Message, ": "), buf); + return NULL; + } // endif hDll + +// Get the function returning an instance of the external DEF class + if (!(coldef = (XCOLDEF)GetProcAddress((HINSTANCE)hdll, getname))) { + sprintf(g->Message, MSG(PROCADD_ERROR), GetLastError(), getname); + FreeLibrary((HMODULE)hdll); + return NULL; + } // endif coldef +#else // !__WIN__ + const char* error = NULL; + + // Load the desired shared library + if (!(hdll = dlopen(soname, RTLD_LAZY))) { + error = dlerror(); + sprintf(g->Message, MSG(SHARED_LIB_ERR), soname, SVP(error)); + return NULL; + } // endif Hdll + +// Get the function returning an instance of the external DEF class + if (!(coldef = (XCOLDEF)dlsym(hdll, getname))) { + error = dlerror(); + sprintf(g->Message, MSG(GET_FUNC_ERR), getname, SVP(error)); + dlclose(hdll); + return NULL; + } // endif coldef +#endif // !__WIN__ + + // Just in case the external Get function does not set error messages + sprintf(g->Message, "Error getting column info from %s", subtype); + + // Get the table column definition + qrp = coldef(g, topt, tab, db, info); + +#if defined(__WIN__) + FreeLibrary((HMODULE)hdll); +#else // !__WIN__ + dlclose(hdll); +#endif // !__WIN__ + + return qrp; +} // end of OEMColumns /* --------------------------- Class RELDEF -------------------------- */ @@ -208,6 +304,7 @@ TABDEF::TABDEF(void) { Schema = NULL; Desc = NULL; + Recfm = RECFM_DFLT; Catfunc = FNC_NO; Card = 0; Elemt = 0; @@ -221,11 +318,40 @@ TABDEF::TABDEF(void) } // end of TABDEF constructor /***********************************************************************/ +/* Return the table format. */ +/***********************************************************************/ +RECFM TABDEF::GetTableFormat(const char* type) +{ + RECFM recfm = Recfm; + + if (recfm == RECFM_DFLT) { + // Default format depends on the table type + TABTYPE tc = (Catfunc == FNC_NO) ? GetTypeID(type) : TAB_PRX; + + switch (tc) { + case TAB_DOS: recfm = RECFM_VAR; break; + case TAB_CSV: recfm = RECFM_CSV; break; + case TAB_FMT: recfm = RECFM_FMT; break; + case TAB_FIX: recfm = RECFM_FIX; break; + case TAB_BIN: recfm = RECFM_BIN; break; + case TAB_VEC: recfm = RECFM_VCT; break; + case TAB_DBF: recfm = RECFM_DBF; break; + case TAB_XML: recfm = RECFM_XML; break; + case TAB_DIR: recfm = RECFM_DIR; break; + default: recfm = RECFM_NAF; break; + } // endswitch type + + } // endif recfm + + return recfm; +} // end of GetTableFormat + +/***********************************************************************/ /* Define: initialize the table definition block from XDB file. */ /***********************************************************************/ bool TABDEF::Define(PGLOBAL g, PCATLG cat, LPCSTR name, LPCSTR schema, LPCSTR am) - { +{ int poff = 0; Hc = ((MYCAT*)cat)->GetHandler(); @@ -243,13 +369,17 @@ bool TABDEF::Define(PGLOBAL g, PCATLG cat, NULL; csname = GetStringCatInfo(g, "Table_charset", NULL); - // Get The column definitions - if ((poff = GetColCatInfo(g)) < 0) - return true; + // Do the definition of AM specific fields + if (DefineAM(g, am, 0)) + return true; - // Do the definition of AM specific fields - return DefineAM(g, am, poff); - } // end of Define + // Get The column definitions + if (stricmp(am, "OEM") && GetColCatInfo(g) < 0) + return true; + + Hc->tshp = NULL; // TO BE CHECKED + return false; +} // end of Define /***********************************************************************/ /* This function returns the database data path. */ @@ -264,71 +394,71 @@ PCSZ TABDEF::GetPath(void) /***********************************************************************/ int TABDEF::GetColCatInfo(PGLOBAL g) { - char *type= GetStringCatInfo(g, "Type", "*"); + char *type = GetStringCatInfo(g, "Type", "*"); char c, fty, eds; int i, n, loff, poff, nof, nlg; - void *field= NULL; - TABTYPE tc; - PCOLDEF cdp, lcdp= NULL, tocols= NULL; + void *field = NULL; + RECFM trf; + PCOLDEF cdp, lcdp = NULL, tocols= NULL; PCOLINFO pcf= (PCOLINFO)PlugSubAlloc(g, NULL, sizeof(COLINFO)); memset(pcf, 0, sizeof(COLINFO)); - // Get a unique char identifier for type - tc= (Catfunc == FNC_NO) ? GetTypeID(type) : TAB_PRX; + // Get the table format + trf = GetTableFormat(type); // Take care of the column definitions i= poff= nof= nlg= 0; #if defined(__WIN__) // Offsets of HTML and DIR tables start from 0, DBF at 1 - loff= (tc == TAB_DBF) ? 1 : (tc == TAB_XML || tc == TAB_DIR) ? -1 : 0; + loff= (trf == RECFM_DBF) ? 1 : (trf == RECFM_XML || trf == RECFM_DIR) ? -1 : 0; #else // !__WIN__ // Offsets of HTML tables start from 0, DIR and DBF at 1 - loff = (tc == TAB_DBF || tc == TAB_DIR) ? 1 : (tc == TAB_XML) ? -1 : 0; + loff = (trf == RECFM_DBF || trf == RECFM_DIR) ? 1 : (trf == RECFM_XML) ? -1 : 0; #endif // !__WIN__ while (true) { - // Default Offset depends on table type - switch (tc) { - case TAB_DOS: - case TAB_FIX: - case TAB_BIN: - case TAB_VEC: - case TAB_DBF: + // Default Offset depends on table format + switch (trf ) { + case RECFM_VAR: + case RECFM_FIX: + case RECFM_BIN: + case RECFM_VCT: + case RECFM_DBF: poff= loff + nof; // Default next offset nlg= MY_MAX(nlg, poff); // Default lrecl break; - case TAB_CSV: - case TAB_FMT: + case RECFM_CSV: + case RECFM_FMT: nlg+= nof; - case TAB_DIR: - case TAB_XML: + case RECFM_DIR: + case RECFM_XML: poff= loff + (pcf->Flags & U_VIRTUAL ? 0 : 1); break; - case TAB_INI: - case TAB_MAC: - case TAB_TBL: - case TAB_XCL: - case TAB_OCCUR: - case TAB_PRX: - case TAB_OEM: + //case RECFM_INI: + //case RECFM_MAC: + //case RECFM_TBL: + //case RECFM_XCL: + //case RECFM_OCCUR: + //case RECFM_PRX: + case RECFM_OEM: poff = 0; // Offset represents an independant flag break; - default: // VCT PLG ODBC JDBC MYSQL WMI... + default: // PLG ODBC JDBC MYSQL WMI... poff = 0; // NA break; - } // endswitch tc + } // endswitch trf // do { field= Hc->GetColumnOption(g, field, pcf); // } while (field && (*pcf->Name =='*' /*|| pcf->Flags & U_VIRTUAL*/)); - if (tc == TAB_DBF && pcf->Type == TYPE_DATE && !pcf->Datefmt) { + if (trf == RECFM_DBF && pcf->Type == TYPE_DATE && !pcf->Datefmt) { // DBF date format defaults to 'YYYMMDD' pcf->Datefmt= "YYYYMMDD"; pcf->Length= 8; - } // endif tc + } // endif trf if (!field) break; @@ -341,10 +471,10 @@ int TABDEF::GetColCatInfo(PGLOBAL g) else loff= cdp->GetOffset(); - switch (tc) { - case TAB_VEC: + switch (trf ) { + case RECFM_VCT: cdp->SetOffset(0); // Not to have shift - case TAB_BIN: + case RECFM_BIN: // BIN/VEC are packed by default if (nof) { // Field width is the internal representation width @@ -395,7 +525,7 @@ int TABDEF::GetColCatInfo(PGLOBAL g) default: break; - } // endswitch tc + } // endswitch trf if (lcdp) lcdp->SetNext(cdp); @@ -413,21 +543,15 @@ int TABDEF::GetColCatInfo(PGLOBAL g) if (GetDefType() == TYPE_AM_DOS) { int ending, recln= 0; - // Was commented because sometimes ending is 0 even when - // not specified (for instance if quoted is specified) -// if ((ending= Hc->GetIntegerOption("Ending")) < 0) { - if ((ending= Hc->GetIntegerOption("Ending")) <= 0) { - ending= (tc == TAB_BIN || tc == TAB_VEC) ? 0 : CRLF; - Hc->SetIntegerOption("Ending", ending); - } // endif ending + ending = Hc->GetIntegerOption("Ending"); // Calculate the default record size - switch (tc) { - case TAB_FIX: - case TAB_BIN: + switch (trf ) { + case RECFM_FIX: + case RECFM_BIN: recln= nlg + ending; // + length of line ending break; - case TAB_VEC: + case RECFM_VCT: recln= nlg; // if ((k= (pak < 0) ? 8 : pak) > 1) @@ -436,18 +560,18 @@ int TABDEF::GetColCatInfo(PGLOBAL g) // recln= ((recln + k - 1) / k) * k; break; - case TAB_DOS: - case TAB_DBF: + case RECFM_VAR: + case RECFM_DBF: recln= nlg; break; - case TAB_CSV: - case TAB_FMT: + case RECFM_CSV: + case RECFM_FMT: // The number of separators (assuming an extra one can exist) // recln= poff * ((qotd) ? 3 : 1); to be investigated recln= nlg + poff * 3; // To be safe default: break; - } // endswitch tc + } // endswitch trf // lrecl must be at least recln to avoid buffer overflow if (trace(1)) @@ -461,7 +585,7 @@ int TABDEF::GetColCatInfo(PGLOBAL g) if (trace(1)) htrc("Lrecl set to %d\n", recln); - } // endif Lrecl + } // endif TYPE // Attach the column definition to the tabdef SetCols(tocols); @@ -500,7 +624,8 @@ PTABDEF OEMDEF::GetXdef(PGLOBAL g) return NULL; } else // PlugSetPath(soname, Module, GetPluginDir()); // Crashes on Fedora - strncat(strcpy(soname, GetPluginDir()), Module, _MAX_PATH); + strncat(strcpy(soname, GetPluginDir()), Module, + sizeof(soname) - strlen(soname) - 1); #if defined(__WIN__) // Is the DLL already loaded? @@ -596,10 +721,6 @@ PTABDEF OEMDEF::GetXdef(PGLOBAL g) cat->Cbuf = (char*)PlugSubAlloc(g, NULL, cat->Cblen); } // endif Cbuf - // Here "OEM" should be replace by a more useful value - if (xdefp->Define(g, cat, Name, Schema, "OEM")) - return NULL; - // Ok, return external block return xdefp; } // end of GetXdef @@ -622,7 +743,7 @@ bool OEMDEF::DeleteTableFile(PGLOBAL g) /***********************************************************************/ bool OEMDEF::DefineAM(PGLOBAL g, LPCSTR, int) { - Module = GetStringCatInfo(g, "Module", ""); + Module = GetStringCatInfo(g, "Module", ""); Subtype = GetStringCatInfo(g, "Subtype", Module); if (!*Module) @@ -632,7 +753,13 @@ bool OEMDEF::DefineAM(PGLOBAL g, LPCSTR, int) + strlen(Subtype) + 3); sprintf(desc, "%s(%s)", Module, Subtype); Desc = desc; - return false; + + // If define block not here yet, get it now + if (!Pxdef && !(Pxdef = GetXdef(g))) + return true; // Error + + // Here "OEM" should be replace by a more useful value + return Pxdef->Define(g, Cat, Name, Schema, Subtype); } // end of DefineAM /***********************************************************************/ @@ -640,7 +767,6 @@ bool OEMDEF::DefineAM(PGLOBAL g, LPCSTR, int) /***********************************************************************/ PTDB OEMDEF::GetTable(PGLOBAL g, MODE mode) { - RECFM rfm; PTDB tdbp = NULL; // If define block not here yet, get it now @@ -653,18 +779,10 @@ PTDB OEMDEF::GetTable(PGLOBAL g, MODE mode) /*********************************************************************/ if (!(tdbp = Pxdef->GetTable(g, mode))) return NULL; - else - rfm = tdbp->GetFtype(); - - if (rfm == RECFM_NAF) - return tdbp; - else if (rfm == RECFM_OEM) { - if (Multiple) - tdbp = new(g) TDBMUL(tdbp); // No block optimization yet - - return tdbp; - } // endif OEM + else if (Multiple && tdbp->GetFtype() == RECFM_OEM) + tdbp = new(g) TDBMUL(tdbp); // No block optimization yet +#if 0 /*********************************************************************/ /* The OEM table is based on a file type (currently DOS+ only) */ /*********************************************************************/ @@ -723,7 +841,7 @@ PTDB OEMDEF::GetTable(PGLOBAL g, MODE mode) if (Multiple) tdbp = new(g) TDBMUL(tdbp); - +#endif // 0 return tdbp; } // end of GetTable diff --git a/storage/connect/reldef.h b/storage/connect/reldef.h index f8256a59b3d..73e178ed51c 100644 --- a/storage/connect/reldef.h +++ b/storage/connect/reldef.h @@ -84,10 +84,12 @@ public: void SetNext(PTABDEF tdfp) {Next = tdfp;} int GetMultiple(void) {return Multiple;} int GetPseudo(void) {return Pseudo;} - PCSZ GetPath(void); + RECFM GetRecfm(void) {return Recfm;} + PCSZ GetPath(void); //PSZ GetPath(void) // {return (Database) ? (PSZ)Database : Cat->GetDataPath();} - bool SepIndex(void) {return GetBoolCatInfo("SepIndex", false);} + RECFM GetTableFormat(const char* type); + bool SepIndex(void) {return GetBoolCatInfo("SepIndex", false);} bool IsReadOnly(void) {return Read_Only;} virtual AMT GetDefType(void) {return TYPE_AM_TAB;} virtual PIXDEF GetIndx(void) {return NULL;} @@ -108,7 +110,8 @@ public: // Members PCSZ Schema; /* Table schema (for ODBC) */ PCSZ Desc; /* Table description */ - uint Catfunc; /* Catalog function ID */ + RECFM Recfm; /* File or table format */ + uint Catfunc; /* Catalog function ID */ int Card; /* (max) number of rows in table */ int Elemt; /* Number of rows in blocks or rowset */ int Sort; /* Table already sorted ??? */ diff --git a/storage/connect/restget.cpp b/storage/connect/restget.cpp index 6b184ae6926..d85ec6ae693 100644 --- a/storage/connect/restget.cpp +++ b/storage/connect/restget.cpp @@ -4,12 +4,6 @@ /***********************************************************************/ #include <cpprest/filestream.h> #include <cpprest/http_client.h> -#if defined(MARIADB) -#include <my_global.h> -#else -#include "mini-global.h" -#define _OS_H_INCLUDED // Prevent os.h to be called -#endif using namespace utility::conversions; // String conversions utilities using namespace web; // Common features like URIs. @@ -17,24 +11,24 @@ using namespace web::http; // Common HTTP functionality using namespace web::http::client; // HTTP client features using namespace concurrency::streams; // Asynchronous streams -#include "global.h" +typedef const char* PCSZ; /***********************************************************************/ /* Make a local copy of the requested file. */ /***********************************************************************/ -int restGetFile(PGLOBAL g, PCSZ http, PCSZ uri, PCSZ fn) +int restGetFile(char *m, bool xt, PCSZ http, PCSZ uri, PCSZ fn) { int rc = 0; - bool xt = trace(515); auto fileStream = std::make_shared<ostream>(); if (!http || !fn) { - strcpy(g->Message, "Missing http or filename"); - return 2; + //strcpy(g->Message, "Missing http or filename"); + strcpy(m, "Missing http or filename"); + return 2; } // endif if (xt) - htrc("restGetFile: fn=%s\n", fn); + fprintf(stderr, "restGetFile: fn=%s\n", fn); // Open stream to output file. pplx::task<void> requestTask = fstream::open_ostream(to_string_t(fn)) @@ -42,7 +36,7 @@ int restGetFile(PGLOBAL g, PCSZ http, PCSZ uri, PCSZ fn) *fileStream= outFile; if (xt) - htrc("Outfile isopen=%d\n", outFile.is_open()); + fprintf(stderr, "Outfile isopen=%d\n", outFile.is_open()); // Create http_client to send the request. http_client client(to_string_t(http)); @@ -58,8 +52,8 @@ int restGetFile(PGLOBAL g, PCSZ http, PCSZ uri, PCSZ fn) // Handle response headers arriving. .then([=](http_response response) { if (xt) - htrc("Received response status code:%u\n", - response.status_code()); + fprintf(stderr, "Received response status code:%u\n", + response.status_code()); // Write response body into the file. return response.body().read_to_end(fileStream->streambuf()); @@ -68,27 +62,27 @@ int restGetFile(PGLOBAL g, PCSZ http, PCSZ uri, PCSZ fn) // Close the file stream. .then([=](size_t n) { if (xt) - htrc("Return size=%u\n", n); + fprintf(stderr, "Return size=%zu\n", n); return fileStream->close(); }); // Wait for all the outstanding I/O to complete and handle any exceptions try { - requestTask.wait(); - if (xt) - htrc("In Wait\n"); + fprintf(stderr, "Waiting\n"); + requestTask.wait(); } catch (const std::exception &e) { if (xt) - htrc("Error exception: %s\n", e.what()); - sprintf(g->Message, "Error exception: %s", e.what()); - rc= 1; + fprintf(stderr, "Error exception: %s\n", e.what()); + + sprintf(m, "Error exception: %s", e.what()); + rc= 1; } // end try/catch if (xt) - htrc("restget done: rc=%d\n", rc); + fprintf(stderr, "restget done: rc=%d\n", rc); return rc; } // end of restGetFile diff --git a/storage/connect/tabcmg.cpp b/storage/connect/tabcmg.cpp index da1cfd34ac7..b9b7f6e4b60 100644 --- a/storage/connect/tabcmg.cpp +++ b/storage/connect/tabcmg.cpp @@ -53,25 +53,30 @@ bool CMGDISC::FindInDoc(PGLOBAL g, bson_iter_t *iter, const bson_t *doc, { if (!doc || bson_iter_init(iter, doc)) { const char *key; - char colname[65]; - char fmt[129]; - bool newcol; + char colname[65]; + char fmt[129]; + bool newcol; + size_t n; while (bson_iter_next(iter)) { key = bson_iter_key(iter); newcol = true; if (pcn) { - strncpy(colname, pcn, 64); - colname[64] = 0; - strncat(strncat(colname, "_", 65), key, 65); + n = sizeof(colname) - 1; + strncpy(colname, pcn, n); + colname[n] = 0; + n -= strlen(colname); + strncat(strncat(colname, "_", n), key, n - 1); } else strcpy(colname, key); if (pfmt) { - strncpy(fmt, pfmt, 128); - fmt[128] = 0; - strncat(strncat(fmt, ".", 129), key, 129); + n = sizeof(fmt) - 1; + strncpy(fmt, pfmt, n); + fmt[n] = 0; + n -= strlen(fmt); + strncat(strncat(fmt, ".", n), key, n - 1); } else strcpy(fmt, key); diff --git a/storage/connect/tabdos.cpp b/storage/connect/tabdos.cpp index 4f6e2c81744..8efe2aad702 100644 --- a/storage/connect/tabdos.cpp +++ b/storage/connect/tabdos.cpp @@ -45,7 +45,7 @@ #include "global.h" #include "osutil.h" #include "plgdbsem.h" -#include "catalog.h" +//#include "catalog.h" #include "mycat.h" #include "xindex.h" #include "filamap.h" @@ -161,7 +161,12 @@ bool DOSDEF::DefineAM(PGLOBAL g, LPCSTR am, int) //Last = GetIntCatInfo("Last", 0); Ending = GetIntCatInfo("Ending", CRLF); - if (Recfm == RECFM_FIX || Recfm == RECFM_BIN) { + if (Ending <= 0) { + Ending = (Recfm == RECFM_BIN || Recfm == RECFM_VCT) ? 0 : CRLF; + SetIntCatInfo("Ending", Ending); + } // endif ending + + if (Recfm == RECFM_FIX || Recfm == RECFM_BIN) { Huge = GetBoolCatInfo("Huge", Cat->GetDefHuge()); Padded = GetBoolCatInfo("Padded", false); Blksize = GetIntCatInfo("Blksize", 0); @@ -191,7 +196,8 @@ bool DOSDEF::GetOptFileName(PGLOBAL g, char *filename) case RECFM_FIX: ftype = ".fop"; break; case RECFM_BIN: ftype = ".bop"; break; case RECFM_VCT: ftype = ".vop"; break; - case RECFM_DBF: ftype = ".dbp"; break; + case RECFM_CSV: ftype = ".cop"; break; + case RECFM_DBF: ftype = ".dbp"; break; default: sprintf(g->Message, MSG(INVALID_FTYPE), Recfm); return true; @@ -261,7 +267,8 @@ bool DOSDEF::DeleteIndexFile(PGLOBAL g, PIXDEF pxdf) case RECFM_FIX: ftype = ".fnx"; break; case RECFM_BIN: ftype = ".bnx"; break; case RECFM_VCT: ftype = ".vnx"; break; - case RECFM_DBF: ftype = ".dbx"; break; + case RECFM_CSV: ftype = ".cnx"; break; + case RECFM_DBF: ftype = ".dbx"; break; default: sprintf(g->Message, MSG(BAD_RECFM_VAL), Recfm); return true; @@ -2257,7 +2264,7 @@ int TDBDOS::ReadDB(PGLOBAL g) /***********************************************************************/ bool TDBDOS::PrepareWriting(PGLOBAL) { - if (!Ftype && (Mode == MODE_INSERT || Txfp->GetUseTemp())) { + if (Ftype == RECFM_VAR && (Mode == MODE_INSERT || Txfp->GetUseTemp())) { char *p; /*******************************************************************/ @@ -2542,7 +2549,8 @@ void DOSCOL::ReadColumn(PGLOBAL g) /*********************************************************************/ /* For a variable length file, check if the field exists. */ /*********************************************************************/ - if (tdbp->Ftype == RECFM_VAR && strlen(tdbp->To_Line) < (unsigned)Deplac) + if ((tdbp->Ftype == RECFM_VAR || tdbp->Ftype == RECFM_CSV) + && strlen(tdbp->To_Line) < (unsigned)Deplac) field = 0; else if (Dsp) for(i = 0; i < field; i++) @@ -2552,7 +2560,8 @@ void DOSCOL::ReadColumn(PGLOBAL g) switch (tdbp->Ftype) { case RECFM_VAR: case RECFM_FIX: // Fixed length text file - case RECFM_DBF: // Fixed length DBase file + case RECFM_CSV: // Variable length CSV or FMT file + case RECFM_DBF: // Fixed length DBase file if (Nod) switch (Buf_Type) { case TYPE_INT: case TYPE_SHORT: diff --git a/storage/connect/tabdos.h b/storage/connect/tabdos.h index bdde37adaad..207a1277fce 100644 --- a/storage/connect/tabdos.h +++ b/storage/connect/tabdos.h @@ -80,7 +80,6 @@ class DllExport DOSDEF : public TABDEF { /* Logical table description */ PCSZ Entry; /* Zip entry name or pattern */ PCSZ Pwd; /* Zip password */ PIXDEF To_Indx; /* To index definitions blocks */ - RECFM Recfm; /* 0:VAR, 1:FIX, 2:BIN, 3:VCT, 6:DBF */ bool Mapped; /* 0: disk file, 1: memory mapped file */ bool Zipped; /* true for zipped table file */ bool Mulentries; /* true for multiple entries */ diff --git a/storage/connect/tabfix.cpp b/storage/connect/tabfix.cpp index 1969fd4465f..4a0a75460cd 100644 --- a/storage/connect/tabfix.cpp +++ b/storage/connect/tabfix.cpp @@ -84,7 +84,7 @@ PTDB TDBFIX::Clone(PTABS t) tp = new(g) TDBFIX(g, this); - if (Ftype < 2) { + if (Ftype == RECFM_VAR || Ftype == RECFM_FIX) { // File is text PDOSCOL cp1, cp2; diff --git a/storage/connect/tabfmt.cpp b/storage/connect/tabfmt.cpp index 746382178fb..b395c49c95d 100644 --- a/storage/connect/tabfmt.cpp +++ b/storage/connect/tabfmt.cpp @@ -1,11 +1,11 @@ /************* TabFmt C++ Program Source Code File (.CPP) **************/ /* PROGRAM NAME: TABFMT */ /* ------------- */ -/* Version 3.9.2 */ +/* Version 3.9.3 */ /* */ /* COPYRIGHT: */ /* ---------- */ -/* (C) Copyright to the author Olivier BERTRAND 2001 - 2017 */ +/* (C) Copyright to the author Olivier BERTRAND 2001 - 2019 */ /* */ /* WHAT THIS PROGRAM DOES: */ /* ----------------------- */ @@ -477,6 +477,7 @@ bool CSVDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) if (DOSDEF::DefineAM(g, "CSV", poff)) return true; + Recfm = RECFM_CSV; GetCharCatInfo("Separator", ",", buf, sizeof(buf)); Sep = (strlen(buf) == 2 && buf[0] == '\\' && buf[1] == 't') ? '\t' : *buf; Quoted = GetIntCatInfo("Quoted", -1); diff --git a/storage/connect/tabjson.cpp b/storage/connect/tabjson.cpp index 0b282345c8a..7e8d6c8d9f0 100644 --- a/storage/connect/tabjson.cpp +++ b/storage/connect/tabjson.cpp @@ -394,10 +394,11 @@ err: bool JSONDISC::Find(PGLOBAL g, PJVAL jvp, PCSZ key, int j) { - char *p, *pc = colname + strlen(colname); - int ars; - PJOB job; - PJAR jar; + char *p, *pc = colname + strlen(colname); + int ars; + size_t n; + PJOB job; + PJAR jar; if ((valp = jvp ? jvp->GetValue() : NULL)) { jcol.Type = valp->GetType(); @@ -423,8 +424,10 @@ bool JSONDISC::Find(PGLOBAL g, PJVAL jvp, PCSZ key, int j) PCSZ k = jrp->GetKey(); if (*k != '$') { - strncat(strncat(fmt, sep, 128), k, 128); - strncat(strncat(colname, "_", 64), k, 64); + n = sizeof(fmt) - strlen(fmt) -1; + strncat(strncat(fmt, sep, n), k, n - strlen(sep)); + n = sizeof(colname) - strlen(colname) - 1; + strncat(strncat(colname, "_", n), k, n - 1); } // endif Key if (Find(g, jrp->GetVal(), k, j + 1)) @@ -443,19 +446,26 @@ bool JSONDISC::Find(PGLOBAL g, PJVAL jvp, PCSZ key, int j) ars = MY_MIN(jar->GetSize(false), 1); for (int k = 0; k < ars; k++) { - if (!tdp->Xcol || stricmp(tdp->Xcol, key)) { - sprintf(buf, "%d", k); - - if (tdp->Uri) - strncat(strncat(fmt, sep, 128), buf, 128); - else - strncat(strncat(strncat(fmt, "[", 128), buf, 128), "]", 128); + n = sizeof(fmt) - (strlen(fmt) + 1); - if (all) - strncat(strncat(colname, "_", 64), buf, 64); + if (!tdp->Xcol || stricmp(tdp->Xcol, key)) { + sprintf(buf, "%d", k); - } else - strncat(fmt, (tdp->Uri ? sep : "[*]"), 128); + if (tdp->Uri) { + strncat(strncat(fmt, sep, n), buf, n - strlen(sep)); + } else { + strncat(strncat(fmt, "[", n), buf, n - 1); + strncat(fmt, "]", n - (strlen(buf) + 1)); + } // endif uri + + if (all) { + n = sizeof(colname) - (strlen(colname) + 1); + strncat(strncat(colname, "_", n), buf, n - 1); + } // endif all + + } else { + strncat(fmt, (tdp->Uri ? sep : "[*]"), n); + } if (Find(g, jar->GetValue(k), "", j)) return true; diff --git a/storage/connect/tabmysql.cpp b/storage/connect/tabmysql.cpp index 83c20b26701..440fdb583f1 100644 --- a/storage/connect/tabmysql.cpp +++ b/storage/connect/tabmysql.cpp @@ -342,11 +342,13 @@ bool MYSQLDEF::DefineAM(PGLOBAL g, LPCSTR am, int) Delayed = !!GetIntCatInfo("Delayed", 0); } else { // MYSQL access from a PROXY table - Tabschema = GetStringCatInfo(g, "Database", Tabschema ? Tabschema : PlugDup(g, "*")); + TABLE_SHARE* s; + + Tabschema = GetStringCatInfo(g, "Database", Tabschema ? Tabschema : PlugDup(g, "*")); Isview = GetBoolCatInfo("View", false); // We must get other connection parms from the calling table - Remove_tshp(Cat); + s = Remove_tshp(Cat); url = GetStringCatInfo(g, "Connect", NULL); if (!url || !*url) { @@ -365,6 +367,9 @@ bool MYSQLDEF::DefineAM(PGLOBAL g, LPCSTR am, int) } // endif url Tabname = Name; + + // Needed for column description + Restore_tshp(Cat, s); } // endif am if ((Srcdef = GetStringCatInfo(g, "Srcdef", NULL))) { diff --git a/storage/connect/tabrest.cpp b/storage/connect/tabrest.cpp index 9e1a643c89f..f9acbc28ddc 100644 --- a/storage/connect/tabrest.cpp +++ b/storage/connect/tabrest.cpp @@ -1,5 +1,5 @@ /*************** Rest C++ Program Source Code File (.CPP) **************/ -/* PROGRAM NAME: Rest Version 1.5 */ +/* PROGRAM NAME: Rest Version 1.6 */ /* (C) Copyright to the author Olivier BERTRAND 2018 - 2019 */ /* This program is the REST Web API support for MariaDB. */ /* When compiled without MARIADB defined, it is the EOM module code. */ @@ -36,17 +36,7 @@ #include "tabfmt.h" #include "tabrest.h" -/***********************************************************************/ -/* Get the file from the Web. */ -/***********************************************************************/ -int restGetFile(PGLOBAL g, PCSZ http, PCSZ uri, PCSZ fn); - -#if defined(__WIN__) -static PCSZ slash = "\\"; -#else // !__WIN__ -static PCSZ slash = "/"; -#define stricmp strcasecmp -#endif // !__WIN__ +static XGETREST getRestFnc = NULL; #if !defined(MARIADB) /***********************************************************************/ @@ -76,6 +66,74 @@ PTABDEF __stdcall GetREST(PGLOBAL g, void *memp) #endif // !MARIADB /***********************************************************************/ +/* GetREST: get the external TABDEF from OEM module. */ +/***********************************************************************/ +XGETREST GetRestFunction(PGLOBAL g) +{ + if (getRestFnc) + return getRestFnc; + +#if !defined(REST_SOURCE) + if (trace(515)) + htrc("Looking for GetRest library\n"); + +#if defined(__WIN__) + HANDLE Hdll; + const char* soname = "GetRest.dll"; // Module name + + if (!(Hdll = LoadLibrary(soname))) { + char buf[256]; + DWORD rc = GetLastError(); + + sprintf(g->Message, MSG(DLL_LOAD_ERROR), rc, soname); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, NULL, rc, 0, + (LPTSTR)buf, sizeof(buf), NULL); + strcat(strcat(g->Message, ": "), buf); + return NULL; + } // endif Hdll + +// Get the function returning an instance of the external DEF class + if (!(getRestFnc = (XGETREST)GetProcAddress((HINSTANCE)Hdll, "restGetFile"))) { + char buf[256]; + DWORD rc = GetLastError(); + + sprintf(g->Message, MSG(PROCADD_ERROR), rc, "restGetFile"); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, NULL, rc, 0, + (LPTSTR)buf, sizeof(buf), NULL); + strcat(strcat(g->Message, ": "), buf); + FreeLibrary((HMODULE)Hdll); + return NULL; + } // endif getRestFnc +#else // !__WIN__ + void* Hso; + const char* error = NULL; + const char* soname = "GetRest.so"; // Module name + + // Load the desired shared library + if (!(Hso = dlopen(soname, RTLD_LAZY))) { + error = dlerror(); + sprintf(g->Message, MSG(SHARED_LIB_ERR), soname, SVP(error)); + return NULL; + } // endif Hdll + +// Get the function returning an instance of the external DEF class + if (!(getRestFnc = (XGETREST)dlsym(Hso, "restGetFile"))) { + error = dlerror(); + sprintf(g->Message, MSG(GET_FUNC_ERR), "restGetFile", SVP(error)); + dlclose(Hso); + return NULL; + } // endif getdef +#endif // !__WIN__ +#else + getRestFnc = restGetFile; +#endif + + return getRestFnc; +} // end of GetRestFunction + +/***********************************************************************/ /* Return the columns definition to MariaDB. */ /***********************************************************************/ #if defined(MARIADB) @@ -87,6 +145,10 @@ PQRYRES __stdcall ColREST(PGLOBAL g, PTOS tp, char *tab, char *db, bool info) PQRYRES qrp= NULL; char filename[_MAX_PATH + 1]; // MAX PATH ??? PCSZ http, uri, fn, ftype; + XGETREST grf = GetRestFunction(g); + + if (!grf) + return NULL; http = GetStringTableOption(g, tp, "Http", NULL); uri = GetStringTableOption(g, tp, "Uri", NULL); @@ -100,11 +162,11 @@ PQRYRES __stdcall ColREST(PGLOBAL g, PTOS tp, char *tab, char *db, bool info) // We used the file name relative to recorded datapath strcat(strcat(strcat(strcpy(filename, "."), slash), db), slash); - strncat(filename, fn, _MAX_PATH); + strncat(filename, fn, _MAX_PATH - strlen(filename)); // Retrieve the file from the web and copy it locally - if (http && restGetFile(g, http, uri, filename)) { - // sprintf(g->Message, "Failed to get file at %s", http); + if (http && grf(g->Message, trace(515), http, uri, filename)) { + // sprintf(g->Message, "Failed to get file at %s", http); } else if (!stricmp(ftype, "XML")) qrp = XMLColumns(g, db, tab, tp, info); else if (!stricmp(ftype, "JSON")) @@ -124,9 +186,14 @@ PQRYRES __stdcall ColREST(PGLOBAL g, PTOS tp, char *tab, char *db, bool info) /***********************************************************************/ bool RESTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) { - char filename[_MAX_PATH + 1]; + char filename[_MAX_PATH + 1]; int rc = 0, n; - LPCSTR ftype; + bool xt = trace(515); + LPCSTR ftype; + XGETREST grf = GetRestFunction(g); + + if (!grf) + return true; #if defined(MARIADB) ftype = GetStringCatInfo(g, "Type", "JSON"); @@ -135,7 +202,7 @@ bool RESTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) ftype = GetStringCatInfo(g, "Ftype", "JSON"); #endif // !MARIADB - if (trace(515)) + if (xt) htrc("ftype = %s am = %s\n", ftype, SVP(am)); n = (!stricmp(ftype, "JSON")) ? 1 @@ -154,12 +221,13 @@ bool RESTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) // We used the file name relative to recorded datapath //PlugSetPath(filename, Fn, GetPath()); - strncat(strcpy(filename, GetPath()), Fn, _MAX_PATH); + strcpy(filename, GetPath()); + strncat(filename, Fn, _MAX_PATH - strlen(filename)); // Retrieve the file from the web and copy it locally - rc = restGetFile(g, Http, Uri, filename); + rc = grf(g->Message, xt, Http, Uri, filename); - if (trace(515)) + if (xt) htrc("Return from restGetFile: rc=%d\n", rc); if (rc) @@ -175,7 +243,7 @@ bool RESTDEF::DefineAM(PGLOBAL g, LPCSTR am, int poff) if (Tdp && Tdp->Define(g, Cat, Name, Schema, "REST")) Tdp = NULL; // Error occured - if (trace(515)) + if (xt) htrc("Tdp defined\n", rc); // Return true in case of error diff --git a/storage/connect/tabrest.h b/storage/connect/tabrest.h index 1725f256079..d945c97e5f1 100644 --- a/storage/connect/tabrest.h +++ b/storage/connect/tabrest.h @@ -5,6 +5,25 @@ /***********************************************************************/ #pragma once +#if defined(__WIN__) +static PCSZ slash = "\\"; +#else // !__WIN__ +static PCSZ slash = "/"; +#define stricmp strcasecmp +#endif // !__WIN__ + +typedef int(__stdcall* XGETREST) (char*, bool, PCSZ, PCSZ, PCSZ); + +/***********************************************************************/ +/* Functions used by REST. */ +/***********************************************************************/ +XGETREST GetRestFunction(PGLOBAL g); +int restGetFile(char* m, bool x, PCSZ http, PCSZ uri, PCSZ fn); +#if defined(MARIADB) +PQRYRES RESTColumns(PGLOBAL g, PTOS tp, char* tab, char* db, bool info); +#endif // !MARIADB + + /***********************************************************************/ /* Restest table. */ /***********************************************************************/ diff --git a/storage/connect/tabutil.cpp b/storage/connect/tabutil.cpp index 325f36b1e19..f5a105a530d 100644 --- a/storage/connect/tabutil.cpp +++ b/storage/connect/tabutil.cpp @@ -59,12 +59,24 @@ int GetConvSize(void); /* Used by MYSQL tables to get MySQL parameters from the calling proxy */ /* table (PROXY, TBL, XCL, or OCCUR) when used by one of these. */ /************************************************************************/ -void Remove_tshp(PCATLG cat) +TABLE_SHARE *Remove_tshp(PCATLG cat) { - ((MYCAT*)cat)->GetHandler()->tshp = NULL; + TABLE_SHARE *s = ((MYCAT*)cat)->GetHandler()->tshp; + + ((MYCAT*)cat)->GetHandler()->tshp = NULL; + return s; } // end of Remove_thsp /************************************************************************/ +/* Used by MYSQL tables to get MySQL parameters from the calling proxy */ +/* table (PROXY, TBL, XCL, or OCCUR) when used by one of these. */ +/************************************************************************/ +void Restore_tshp(PCATLG cat, TABLE_SHARE *s) +{ + ((MYCAT*)cat)->GetHandler()->tshp = s; +} // end of Restore_thsp + +/************************************************************************/ /* GetTableShare: allocates and open a table share. */ /************************************************************************/ TABLE_SHARE *GetTableShare(PGLOBAL g, THD *thd, const char *db, diff --git a/storage/connect/tabutil.h b/storage/connect/tabutil.h index 62678508ca1..c8e7e75106f 100644 --- a/storage/connect/tabutil.h +++ b/storage/connect/tabutil.h @@ -18,7 +18,8 @@ TABLE_SHARE *GetTableShare(PGLOBAL g, THD *thd, const char *db, PQRYRES TabColumns(PGLOBAL g, THD *thd, const char *db, const char *name, bool& info); -void Remove_tshp(PCATLG cat); +TABLE_SHARE *Remove_tshp(PCATLG cat); +void Restore_tshp(PCATLG cat, TABLE_SHARE *s); /* -------------------------- PROXY classes -------------------------- */ diff --git a/storage/connect/tabvct.cpp b/storage/connect/tabvct.cpp index 40d020202ea..0ed466f6ffb 100644 --- a/storage/connect/tabvct.cpp +++ b/storage/connect/tabvct.cpp @@ -115,11 +115,14 @@ bool VCTDEF::DefineAM(PGLOBAL g, LPCSTR, int poff) Recfm = RECFM_VCT; + // poff is no more in use; This will have to be revisited +#if 0 // For packed files the logical record length is calculated in poff if (poff != Lrecl) { Lrecl = poff; SetIntCatInfo("Lrecl", poff); } // endif poff +#endif // 0 Padded = false; Blksize = 0; diff --git a/storage/connect/tabxml.cpp b/storage/connect/tabxml.cpp index 19490d350e8..717090e9c5a 100644 --- a/storage/connect/tabxml.cpp +++ b/storage/connect/tabxml.cpp @@ -240,7 +240,9 @@ PQRYRES XMLColumns(PGLOBAL g, char *db, char *tab, PTOS topt, bool info) more: if (vp->atp) { - strncpy(colname, vp->atp->GetName(g), sizeof(colname)); + size_t z = sizeof(colname) - 1; + strncpy(colname, vp->atp->GetName(g), z); + colname[z] = 0; strncat(xcol->Name, colname, XLEN(xcol->Name)); switch (vp->atp->GetText(g, buf, sizeof(buf))) { diff --git a/storage/connect/xindex.cpp b/storage/connect/xindex.cpp index db4d6cbb00d..95f038d494c 100644 --- a/storage/connect/xindex.cpp +++ b/storage/connect/xindex.cpp @@ -659,7 +659,7 @@ bool XINDEX::Make(PGLOBAL g, PIXDEF sxp) /* Not true for DBF tables because of eventual soft deleted lines. */ /* Note: for Num_K = 1 any non null value is Ok. */ /*********************************************************************/ - if (Srtd && !filp && Tdbp->Ftype != RECFM_VAR + if (Srtd && !filp && Tdbp->Ftype != RECFM_VAR && Tdbp->Ftype != RECFM_CSV && Tdbp->Txfp->GetAmType() != TYPE_AM_DBF) { Incr = (Num_K > 1) ? To_Rec[1] : Num_K; PlgDBfree(Record); @@ -837,7 +837,8 @@ bool XINDEX::SaveIndex(PGLOBAL g, PIXDEF sxp) case RECFM_FIX: ftype = ".fnx"; break; case RECFM_BIN: ftype = ".bnx"; break; case RECFM_VCT: ftype = ".vnx"; break; - case RECFM_DBF: ftype = ".dbx"; break; + case RECFM_CSV: ftype = ".cnx"; break; + case RECFM_DBF: ftype = ".dbx"; break; default: sprintf(g->Message, MSG(INVALID_FTYPE), Tdbp->Ftype); return true; @@ -990,7 +991,8 @@ bool XINDEX::Init(PGLOBAL g) case RECFM_FIX: ftype = ".fnx"; break; case RECFM_BIN: ftype = ".bnx"; break; case RECFM_VCT: ftype = ".vnx"; break; - case RECFM_DBF: ftype = ".dbx"; break; + case RECFM_CSV: ftype = ".cnx"; break; + case RECFM_DBF: ftype = ".dbx"; break; default: sprintf(g->Message, MSG(INVALID_FTYPE), Tdbp->Ftype); return true; @@ -1243,7 +1245,8 @@ bool XINDEX::MapInit(PGLOBAL g) case RECFM_FIX: ftype = ".fnx"; break; case RECFM_BIN: ftype = ".bnx"; break; case RECFM_VCT: ftype = ".vnx"; break; - case RECFM_DBF: ftype = ".dbx"; break; + case RECFM_CSV: ftype = ".cnx"; break; + case RECFM_DBF: ftype = ".dbx"; break; default: sprintf(g->Message, MSG(INVALID_FTYPE), Tdbp->Ftype); return true; @@ -1457,7 +1460,8 @@ bool XINDEX::GetAllSizes(PGLOBAL g,/* int &ndif,*/ int &numk) case RECFM_FIX: ftype = ".fnx"; break; case RECFM_BIN: ftype = ".bnx"; break; case RECFM_VCT: ftype = ".vnx"; break; - case RECFM_DBF: ftype = ".dbx"; break; + case RECFM_CSV: ftype = ".cnx"; break; + case RECFM_DBF: ftype = ".dbx"; break; default: sprintf(g->Message, MSG(INVALID_FTYPE), Tdbp->Ftype); return true; diff --git a/storage/connect/xtable.h b/storage/connect/xtable.h index bc9265e0223..1b499e09047 100644 --- a/storage/connect/xtable.h +++ b/storage/connect/xtable.h @@ -173,9 +173,12 @@ class DllExport TDBASE : public TDB { inline void SetKindex(PKXBASE kxp) {To_Kindex = kxp;} // Properties - virtual PKXBASE GetKindex(void) {return To_Kindex;} + PKXBASE GetKindex(void) {return To_Kindex;} + PXOB *GetLink(void) {return To_Link;} + PIXDEF GetXdp(void) {return To_Xdp;} void ResetKindex(PGLOBAL g, PKXBASE kxp); PCOL Key(int i) {return (To_Key_Col) ? To_Key_Col[i] : NULL;} + PXOB Link(int i) { return (To_Link) ? To_Link[i] : NULL; } // Methods virtual bool IsUsingTemp(PGLOBAL) {return false;} diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc index d5d7594791e..e873837694b 100644 --- a/storage/example/ha_example.cc +++ b/storage/example/ha_example.cc @@ -225,9 +225,9 @@ static void init_example_psi_keys() used by the default rename_table and delete_table method in handler.cc and by the default discover_many method. - For engines that have two file name extentions (separate meta/index file + For engines that have two file name extensions (separate meta/index file and data file), the order of elements is relevant. First element of engine - file name extentions array should be meta/index file extention. Second + file name extensions array should be meta/index file extention. Second element - data file extention. This order is assumed by prepare_for_repair() when REPAIR TABLE ... USE_FRM is issued. diff --git a/storage/federatedx/AUTHORS b/storage/federatedx/AUTHORS index 6314d2e4a3d..cdd6600fb5a 100644 --- a/storage/federatedx/AUTHORS +++ b/storage/federatedx/AUTHORS @@ -7,5 +7,5 @@ Pluggable Storage Engine Skeleton setup Brian Aker <brian@mysql.com> | <brian@tangent.org> - Original Design Calvin Sun - Windows Support Brian Miezejewski - Bug fixes -Antony T Curtis - Help in inital development, transactions and various help +Antony T Curtis - Help in initial development, transactions and various help Michael Widenius - Bug fixes and some simple early optimizations diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index b13e1397522..7d6edeb8752 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -159,7 +159,7 @@ current working directory ".", but in the MySQL Embedded Server Library it is an absolute path. */ const char* fil_path_to_mysql_datadir; -/** Common InnoDB file extentions */ +/** Common InnoDB file extensions */ const char* dot_ext[] = { "", ".ibd", ".isl", ".cfg" }; /** The number of fsyncs done to the log */ diff --git a/storage/innobase/gis/gis0geo.cc b/storage/innobase/gis/gis0geo.cc index d60a304f2f3..a65616db127 100644 --- a/storage/innobase/gis/gis0geo.cc +++ b/storage/innobase/gis/gis0geo.cc @@ -791,35 +791,3 @@ rtree_area_overlapping( return(area); } - -/** Get the wkb of default POINT value, which represents POINT(0 0) -if it's of dimension 2, etc. -@param[in] n_dims dimensions -@param[out] wkb wkb buffer for default POINT -@param[in] len length of wkb buffer -@return non-0 indicate the length of wkb of the default POINT, -0 if the buffer is too small */ -uint -get_wkb_of_default_point( - uint n_dims, - uchar* wkb, - uint len) -{ - // JAN: TODO: MYSQL 5.7 GIS - #define GEOM_HEADER_SIZE 16 - if (len < GEOM_HEADER_SIZE + sizeof(double) * n_dims) { - return(0); - } - - /** POINT wkb comprises SRID, wkb header(byte order and type) - and coordinates of the POINT */ - len = GEOM_HEADER_SIZE + sizeof(double) * n_dims; - /** We always use 0 as default coordinate */ - memset(wkb, 0, len); - /** We don't need to write SRID, write 0x01 for Byte Order */ - mach_write_to_n_little_endian(wkb + SRID_SIZE, 1, 0x01); - /** Write wkbType::wkbPoint for the POINT type */ - mach_write_to_n_little_endian(wkb + SRID_SIZE + 1, 4, wkbPoint); - - return(len); -} diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index e6cef3a57c6..36f295749aa 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -12725,15 +12725,18 @@ bool create_table_info_t::row_size_is_acceptable( const dict_field_t *field= dict_index_get_nth_field(&index, idx); ut_ad((!field->name) == field->col->is_dropped()); - ib::error_or_warn eow(strict); - if (field->name) - eow << "Cannot add field " << field->name << " in table "; - else - eow << "Cannot add an instantly dropped column in table "; - eow << index.table->name << " because after adding it, the row size is " - << info.get_overrun_size() - << " which is greater than maximum allowed size (" - << info.max_leaf_size << " bytes) for a record on index leaf page."; + if (strict || global_system_variables.log_warnings > 2) + { + ib::error_or_warn eow(strict); + if (field->name) + eow << "Cannot add field " << field->name << " in table "; + else + eow << "Cannot add an instantly dropped column in table "; + eow << index.table->name << " because after adding it, the row size is " + << info.get_overrun_size() + << " which is greater than maximum allowed size (" + << info.max_leaf_size << " bytes) for a record on index leaf page."; + } if (strict) { diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 047f81fef6d..c5447417969 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -6749,6 +6749,7 @@ new_table_failed: if (index) { dict_mem_index_free(index); } +error_handling_drop_uncached_1: while (++a < ctx->num_to_add_index) { dict_mem_index_free(ctx->add_index[a]); } @@ -6760,7 +6761,7 @@ new_table_failed: ctx->add_index[a] = index; if (!info.row_size_is_acceptable(*index)) { error = DB_TOO_BIG_RECORD; - goto error_handling; + goto error_handling_drop_uncached_1; } index->parser = index_defs[a].parser; index->has_new_v_col = has_new_v_col; diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc index e7ba7872082..6e50f02469c 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.cc +++ b/storage/innobase/ibuf/ibuf0ibuf.cc @@ -4509,7 +4509,7 @@ loop: } if (!btr_pcur_is_on_user_rec(&pcur)) { - ut_ad(btr_pcur_is_after_last_in_tree(&pcur)); + ut_ad(btr_pcur_is_after_last_on_page(&pcur)); goto reset_bit; } @@ -4737,7 +4737,7 @@ loop: &pcur, &mtr); if (!btr_pcur_is_on_user_rec(&pcur)) { - ut_ad(btr_pcur_is_after_last_in_tree(&pcur)); + ut_ad(btr_pcur_is_after_last_on_page(&pcur)); goto leave_loop; } diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h index a1efd28f7ed..afb8debd853 100644 --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h @@ -629,7 +629,7 @@ inline bool fil_space_t::is_rotational() const return false; } -/** Common InnoDB file extentions */ +/** Common InnoDB file extensions */ enum ib_extention { NO_EXT = 0, IBD = 1, diff --git a/storage/innobase/include/fil0fil.ic b/storage/innobase/include/fil0fil.ic index 34d360ee531..24e4157d1f3 100644 --- a/storage/innobase/include/fil0fil.ic +++ b/storage/innobase/include/fil0fil.ic @@ -69,7 +69,7 @@ fil_get_page_type_name( case FIL_PAGE_TYPE_ZBLOB2: return "ZBLOB2"; case FIL_PAGE_TYPE_UNKNOWN: - return "OLD UNKOWN PAGE TYPE"; + return "OLD UNKNOWN PAGE TYPE"; default: return "PAGE TYPE CORRUPTED"; } diff --git a/storage/innobase/include/gis0geo.h b/storage/innobase/include/gis0geo.h index 3b71815d0fe..dea6d63f4e0 100644 --- a/storage/innobase/include/gis0geo.h +++ b/storage/innobase/include/gis0geo.h @@ -54,19 +54,6 @@ enum wkbByteOrder wkbNDR = 1 /* Little Endian */ }; -/** Get the wkb of default POINT value, which represents POINT(0 0) -if it's of dimension 2, etc. -@param[in] n_dims dimensions -@param[out] wkb wkb buffer for default POINT -@param[in] len length of wkb buffer -@return non-0 indicate the length of wkb of the default POINT, -0 if the buffer is too small */ -uint -get_wkb_of_default_point( - uint n_dims, - uchar* wkb, - uint len); - /*************************************************************//** Calculate minimal bounding rectangle (mbr) of the spatial object stored in "well-known binary representation" (wkb) format. diff --git a/storage/innobase/include/mtr0log.ic b/storage/innobase/include/mtr0log.ic index b7ba92ff1a5..23a840d95a6 100644 --- a/storage/innobase/include/mtr0log.ic +++ b/storage/innobase/include/mtr0log.ic @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, MariaDB Corporation. +Copyright (c) 2017, 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -187,7 +187,6 @@ mlog_write_initial_log_record_low( || type == MLOG_FILE_CREATE2 || type == MLOG_FILE_RENAME2 || type == MLOG_INDEX_LOAD - || type == MLOG_TRUNCATE || type == MLOG_FILE_WRITE_CRYPT_DATA || mtr->is_named_space(space_id)); diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index a2243dec9cf..1eb3c4f202d 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -409,7 +409,7 @@ public: /** Accessor for the AIO context @param[in] segment Segment for which to get the context @return the AIO context for the segment */ - io_context* io_ctx(ulint segment) + io_context_t io_ctx(ulint segment) MY_ATTRIBUTE((warn_unused_result)) { ut_ad(segment < get_n_segments()); @@ -417,11 +417,11 @@ public: return(m_aio_ctx[segment]); } - /** Creates an io_context for native linux AIO. + /** Creates an io_context_t for native linux AIO. @param[in] max_events number of events @param[out] io_ctx io_ctx to initialize. @return true on success. */ - static bool linux_create_io_ctx(unsigned max_events, io_context_t* io_ctx) + static bool linux_create_io_ctx(unsigned max_events, io_context_t& io_ctx) MY_ATTRIBUTE((warn_unused_result)); /** Checks if the system supports native linux aio. On some kernel @@ -618,7 +618,7 @@ private: /** completion queue for IO. There is one such queue per segment. Each thread will work on one ctx exclusively. */ - io_context_t* m_aio_ctx; + std::vector<io_context_t> m_aio_ctx; /** The array to collect completed IOs. There is one such event for each possible pending IO. The size of the array @@ -1675,10 +1675,14 @@ LinuxAIOHandler::resubmit(Slot* slot) iocb->data = slot; + ut_a(reinterpret_cast<size_t>(iocb->u.c.buf) % OS_FILE_LOG_BLOCK_SIZE + == 0); + /* Resubmit an I/O request */ int ret = io_submit(m_array->io_ctx(m_segment), 1, &iocb); + ut_a(ret != -EINVAL); - if (ret < -1) { + if (ret < 0) { errno = -ret; } @@ -1779,8 +1783,8 @@ LinuxAIOHandler::collect() ut_ad(m_array != NULL); ut_ad(m_segment < m_array->get_n_segments()); - /* Which io_context we are going to use. */ - io_context* io_ctx = m_array->io_ctx(m_segment); + /* Which io_context_t we are going to use. */ + io_context_t io_ctx = m_array->io_ctx(m_segment); /* Starting point of the m_segment we will be working on. */ ulint start_pos = m_segment * m_n_slots; @@ -1807,6 +1811,8 @@ LinuxAIOHandler::collect() int ret; ret = io_getevents(io_ctx, 1, m_n_slots, events, &timeout); + ut_a(ret != -EINVAL); + ut_ad(ret != -EFAULT); for (int i = 0; i < ret; ++i) { @@ -2033,14 +2039,18 @@ AIO::linux_dispatch(Slot* slot) /* Find out what we are going to work with. The iocb struct is directly in the slot. - The io_context is one per segment. */ + The io_context_t is one per segment. */ ulint io_ctx_index; struct iocb* iocb = &slot->control; io_ctx_index = (slot->pos * m_n_segments) / m_slots.size(); - int ret = io_submit(m_aio_ctx[io_ctx_index], 1, &iocb); + ut_a(reinterpret_cast<size_t>(iocb->u.c.buf) % OS_FILE_LOG_BLOCK_SIZE + == 0); + + int ret = io_submit(io_ctx(io_ctx_index), 1, &iocb); + ut_a(ret != -EINVAL); /* io_submit() returns number of successfully queued requests or -errno. */ @@ -2052,25 +2062,26 @@ AIO::linux_dispatch(Slot* slot) return(ret == 1); } -/** Creates an io_context for native linux AIO. +/** Creates an io_context_t for native linux AIO. @param[in] max_events number of events @param[out] io_ctx io_ctx to initialize. @return true on success. */ bool AIO::linux_create_io_ctx( unsigned max_events, - io_context_t* io_ctx) + io_context_t& io_ctx) { ssize_t n_retries = 0; for (;;) { - memset(io_ctx, 0x0, sizeof(*io_ctx)); + memset(&io_ctx, 0x0, sizeof(io_ctx)); /* Initialize the io_ctx. Tell it how many pending IO requests this context will handle. */ - int ret = io_setup(max_events, io_ctx); + int ret = io_setup(max_events, &io_ctx); + ut_a(ret != -EINVAL); if (ret == 0) { /* Success. Return now. */ @@ -2149,7 +2160,7 @@ AIO::is_linux_native_aio_supported() io_context_t io_ctx; char name[1000]; - if (!linux_create_io_ctx(1, &io_ctx)) { + if (!linux_create_io_ctx(1, io_ctx)) { /* The platform does not support native aio. */ @@ -2165,6 +2176,10 @@ AIO::is_linux_native_aio_supported() << "Unable to create temp file to check" " native AIO support."; + int ret = io_destroy(io_ctx); + ut_a(ret != -EINVAL); + ut_ad(ret != -EFAULT); + return(false); } } else { @@ -2194,6 +2209,10 @@ AIO::is_linux_native_aio_supported() << " \"" << name << "\" to check native" << " AIO read support."; + int ret = io_destroy(io_ctx); + ut_a(ret != EINVAL); + ut_ad(ret != EFAULT); + return(false); } } @@ -2222,11 +2241,15 @@ AIO::is_linux_native_aio_supported() io_prep_pread(p_iocb, fd, ptr, 512, 0); } + ut_a(reinterpret_cast<size_t>(p_iocb->u.c.buf) % OS_FILE_LOG_BLOCK_SIZE + == 0); int err = io_submit(io_ctx, 1, &p_iocb); + ut_a(err != -EINVAL); if (err >= 1) { /* Now collect the submitted IO request. */ err = io_getevents(io_ctx, 1, 1, &io_event, NULL); + ut_a(err != -EINVAL); } ut_free(buf); @@ -2234,7 +2257,13 @@ AIO::is_linux_native_aio_supported() switch (err) { case 1: - return(true); + { + int ret = io_destroy(io_ctx); + ut_a(ret != -EINVAL); + ut_ad(ret != -EFAULT); + + return(true); + } case -EINVAL: case -ENOSYS: @@ -2254,6 +2283,10 @@ AIO::is_linux_native_aio_supported() << "returned error[" << -err << "]"; } + int ret = io_destroy(io_ctx); + ut_a(ret != -EINVAL); + ut_ad(ret != -EFAULT); + return(false); } @@ -5602,8 +5635,7 @@ AIO::AIO( m_n_segments(segments), m_n_reserved() # ifdef LINUX_NATIVE_AIO - ,m_aio_ctx(), - m_events(m_slots.size()) + ,m_events(m_slots.size()) # endif /* LINUX_NATIVE_AIO */ #ifdef WIN_ASYNC_IO ,m_completion_port(new_completion_port()) @@ -5659,29 +5691,20 @@ AIO::init_slots() dberr_t AIO::init_linux_native_aio() { - /* Initialize the io_context array. One io_context - per segment in the array. */ - ut_a(m_aio_ctx == NULL); - - m_aio_ctx = static_cast<io_context**>( - ut_zalloc_nokey(m_n_segments * sizeof(*m_aio_ctx))); - - if (m_aio_ctx == NULL) { - return(DB_OUT_OF_MEMORY); - } + /* Initialize the io_context_t array. One io_context_t + per segment in the array. */ + m_aio_ctx.resize(get_n_segments()); - io_context** ctx = m_aio_ctx; ulint max_events = slots_per_segment(); - for (ulint i = 0; i < m_n_segments; ++i, ++ctx) { + for (std::vector<io_context_t>::iterator it = m_aio_ctx.begin(), + end = m_aio_ctx.end(); + it != end; ++it) { - if (!linux_create_io_ctx(max_events, ctx)) { + if (!linux_create_io_ctx(max_events, *it)) { /* If something bad happened during aio setup we disable linux native aio. - The disadvantage will be a small memory leak - at shutdown but that's ok compared to a crash - or a not working server. This frequently happens when running the test suite with many threads on a system with low fs.aio-max-nr! */ @@ -5693,8 +5716,15 @@ AIO::init_linux_native_aio() << "try increasing system " << "fs.aio-max-nr to 1048576 or larger or " << "setting innodb_use_native_aio = 0 in my.cnf"; - ut_free(m_aio_ctx); - m_aio_ctx = 0; + + for (std::vector<io_context_t>::iterator it2 + = m_aio_ctx.begin(); + it2 != it; ++it2) { + int ret = io_destroy(*it2); + ut_a(ret != -EINVAL); + } + + m_aio_ctx.clear(); srv_use_native_aio = FALSE; return(DB_SUCCESS); } @@ -5770,15 +5800,15 @@ AIO::~AIO() #if defined(LINUX_NATIVE_AIO) if (srv_use_native_aio) { - m_events.clear(); - ut_free(m_aio_ctx); + for (ulint i = 0; i < m_aio_ctx.size(); i++) { + int ret = io_destroy(m_aio_ctx[i]); + ut_a(ret != -EINVAL); + } } #endif /* LINUX_NATIVE_AIO */ #if defined(WIN_ASYNC_IO) CloseHandle(m_completion_port); #endif - - m_slots.clear(); } /** Initializes the asynchronous io system. Creates one array each for ibuf @@ -6072,6 +6102,10 @@ AIO::reserve_slot( os_offset_t offset, ulint len) { + ut_ad(reinterpret_cast<size_t>(buf) % OS_FILE_LOG_BLOCK_SIZE == 0); + ut_ad(offset % OS_FILE_LOG_BLOCK_SIZE == 0); + ut_ad(len % OS_FILE_LOG_BLOCK_SIZE == 0); + #ifdef WIN_ASYNC_IO ut_a((len & 0xFFFFFFFFUL) == len); #endif /* WIN_ASYNC_IO */ diff --git a/storage/innobase/os/os0thread.cc b/storage/innobase/os/os0thread.cc index 6e077d88067..bb5da7df7c4 100644 --- a/storage/innobase/os/os0thread.cc +++ b/storage/innobase/os/os0thread.cc @@ -125,11 +125,17 @@ os_thread_create_func( pthread_attr_t attr; - pthread_attr_init(&attr); + int ret = pthread_attr_init(&attr); + if (UNIV_UNLIKELY(ret)) { + fprintf(stderr, + "InnoDB: Error: pthread_attr_init() returned %d\n", + ret); + abort(); + } os_thread_count++; - int ret = pthread_create(&new_thread_id, &attr, func, arg); + ret = pthread_create(&new_thread_id, &attr, func, arg); ut_a(ret == 0); diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc index 6c7a54ece7d..f8b3a5ff8ed 100644 --- a/storage/innobase/row/row0sel.cc +++ b/storage/innobase/row/row0sel.cc @@ -4254,7 +4254,7 @@ row_search_mvcc( || prebuilt->m_read_virtual_key); /* Reset the new record lock info if srv_locks_unsafe_for_binlog - is set or session is using a READ COMMITED isolation level. Then + is set or session is using a READ COMMITTED isolation level. Then we are able to remove the record locks set here on an individual row. */ prebuilt->new_rec_locks = 0; @@ -4968,7 +4968,7 @@ wrong_offs: existence with LOCK_REC_NOT_GAP. */ /* If innodb_locks_unsafe_for_binlog option is used - or this session is using a READ COMMITED isolation + or this session is using a READ COMMITTED isolation level we lock only the record, i.e., next-key locking is not used. */ diff --git a/storage/innobase/srv/srv0mon.cc b/storage/innobase/srv/srv0mon.cc index 80beddd7f5e..c759a5b75fe 100644 --- a/storage/innobase/srv/srv0mon.cc +++ b/storage/innobase/srv/srv0mon.cc @@ -417,7 +417,7 @@ static monitor_info_t innodb_counter_info[] = MONITOR_DEFAULT_START, MONITOR_FLUSH_AVG_TIME}, {"buffer_flush_adaptive_avg_pass", "buffer", - "Numner of adaptive flushes passed during the recent Avg period.", + "Number of adaptive flushes passed during the recent Avg period.", MONITOR_NONE, MONITOR_DEFAULT_START, MONITOR_FLUSH_ADAPTIVE_AVG_PASS}, diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index efbb63a53ed..0e0aa09825b 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -1191,7 +1191,7 @@ int ha_maria::open(const char *name, int mode, uint test_if_locked) /* For static size rows, tell MariaDB that we will access all bytes - in the record when writing it. This signals MariaDB to initalize + in the record when writing it. This signals MariaDB to initialize the full row to ensure we don't get any errors from valgrind and that all bytes in the row is properly reset. */ diff --git a/storage/maria/ma_close.c b/storage/maria/ma_close.c index 44f65230c5d..2716f3b5c42 100644 --- a/storage/maria/ma_close.c +++ b/storage/maria/ma_close.c @@ -37,7 +37,7 @@ int maria_close(register MARIA_HA *info) /* Check that we have unlocked key delete-links properly */ DBUG_ASSERT(info->key_del_used == 0); - /* Check that file is not part of any uncommited transactions */ + /* Check that file is not part of any uncommitted transactions */ DBUG_ASSERT(info->trn == 0 || info->trn == &dummy_transaction_object); if (share->reopen == 1) diff --git a/storage/maria/trnman.c b/storage/maria/trnman.c index 718b15bcb54..6bc83a9ba88 100644 --- a/storage/maria/trnman.c +++ b/storage/maria/trnman.c @@ -307,7 +307,7 @@ TRN *trnman_new_trn(WT_THD *wt) if (!(trn= tmp.trn)) { /* - trn should be completely initalized at create time to allow + trn should be completely initialized at create time to allow one to keep a known state on it. (Like redo_lns, which is assumed to be 0 at start of row handling and reset to zero before end of row handling) diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index e5fbbb85fc0..c046572f0c8 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -883,7 +883,7 @@ int ha_myisam::open(const char *name, int mode, uint test_if_locked) /* For static size rows, tell MariaDB that we will access all bytes - in the record when writing it. This signals MariaDB to initalize + in the record when writing it. This signals MariaDB to initialize the full row to ensure we don't get any errors from valgrind and that all bytes in the row is properly reset. */ diff --git a/storage/perfschema/pfs_timer.h b/storage/perfschema/pfs_timer.h index a4f55c20994..4a73e2b66ee 100644 --- a/storage/perfschema/pfs_timer.h +++ b/storage/perfschema/pfs_timer.h @@ -100,7 +100,7 @@ extern enum_timer_name stage_timer; extern enum_timer_name statement_timer; /** Timer information data. - Characteristics about each suported timer. + Characteristics about each supported timer. */ extern MYSQL_PLUGIN_IMPORT MY_TIMER_INFO sys_timer_info; diff --git a/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result b/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result index cb31847cdd8..578a26b3e4f 100644 --- a/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result +++ b/storage/rocksdb/mysql-test/rocksdb/r/innodb_i_s_tables_disabled.result @@ -78,7 +78,7 @@ buffer_LRU_batch_flush_avg_time_thread buffer 0 NULL NULL NULL 0 NULL NULL NULL buffer_flush_adaptive_avg_time_est buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Estimated time (ms) spent for adaptive flushing recently. buffer_LRU_batch_flush_avg_time_est buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Estimated time (ms) spent for LRU batch flushing recently. buffer_flush_avg_time buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Avg time (ms) spent for flushing recently. -buffer_flush_adaptive_avg_pass buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Numner of adaptive flushes passed during the recent Avg period. +buffer_flush_adaptive_avg_pass buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of adaptive flushes passed during the recent Avg period. buffer_LRU_batch_flush_avg_pass buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of LRU batch flushes passed during the recent Avg period. buffer_flush_avg_pass buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Number of flushes passed during the recent Avg period. buffer_LRU_get_free_loops buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL disabled counter Total loops in LRU get free. diff --git a/storage/rocksdb/mysql-test/rocksdb/t/lock_rows_not_exist.test b/storage/rocksdb/mysql-test/rocksdb/t/lock_rows_not_exist.test index d8a6bde45c8..a51a516aaaa 100644 --- a/storage/rocksdb/mysql-test/rocksdb/t/lock_rows_not_exist.test +++ b/storage/rocksdb/mysql-test/rocksdb/t/lock_rows_not_exist.test @@ -57,7 +57,7 @@ DELETE FROM t WHERE id1=1 AND id2=1 AND id3=0; --disable_parsing # # The following is commented out because RocksDB's Transaction API doesn't -# "support" READ COMMITED, in particular, it doesn't release row locks +# "support" READ COMMITTED, in particular, it doesn't release row locks # after each statement. (MyRocks is able to request a new snapshot for # every statement, but this won't free the locks. TODO: Is the behavior # that is tested below really needed?) diff --git a/storage/sphinx/ha_sphinx.cc b/storage/sphinx/ha_sphinx.cc index 5cb9230b707..75558d333e0 100644 --- a/storage/sphinx/ha_sphinx.cc +++ b/storage/sphinx/ha_sphinx.cc @@ -3355,7 +3355,7 @@ int ha_sphinx::delete_table ( const char * ) // Renames a table from one name to another from alter table call. // // If you do not implement this, the default rename_table() is called from -// handler.cc and it will delete all files with the file extentions returned +// handler.cc and it will delete all files with the file extensions returned // by bas_ext(). // // Called from sql_table.cc by mysql_rename_table(). diff --git a/storage/tokudb/PerconaFT/ft/loader/loader.cc b/storage/tokudb/PerconaFT/ft/loader/loader.cc index 5f57b473bc5..3ff237f05c7 100644 --- a/storage/tokudb/PerconaFT/ft/loader/loader.cc +++ b/storage/tokudb/PerconaFT/ft/loader/loader.cc @@ -1350,7 +1350,7 @@ int merge_row_arrays_base (struct row dest[/*an+bn*/], struct row a[/*an*/], int * Arguments: * dest write the rows here * a,b the rows being merged - * an,bn the lenth of a and b respectively. + * an,bn the length of a and b respectively. * dest_db We need the dest_db to run the comparison function. * compare We need the compare function for the dest_db. */ @@ -1449,7 +1449,7 @@ static int merge_row_arrays (struct row dest[/*an+bn*/], struct row a[/*an*/], i * Arguments: * dest write the rows here * a,b the rows being merged - * an,bn the lenth of a and b respectively. + * an,bn the length of a and b respectively. * dest_db We need the dest_db to run the comparison function. * compare We need the compare function for the dest_db. */ diff --git a/storage/tokudb/mysql-test/tokudb/t/type_bit.test b/storage/tokudb/mysql-test/tokudb/t/type_bit.test index 445f69e8972..034585169f5 100644 --- a/storage/tokudb/mysql-test/tokudb/t/type_bit.test +++ b/storage/tokudb/mysql-test/tokudb/t/type_bit.test @@ -268,7 +268,7 @@ select hex(a), b from t1; drop table t1; # -# type was not properly initalized, which caused key_copy to fail +# type was not properly initialized, which caused key_copy to fail # create table t1(bit_field bit(2), int_field int, key a(bit_field)); diff --git a/zlib/zlib.h b/zlib/zlib.h index 08f491999c4..d3b929b9cca 100644 --- a/zlib/zlib.h +++ b/zlib/zlib.h @@ -1440,7 +1440,7 @@ ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems, provided, but could be inferred from the result of gztell(). This behavior is the same as the behavior of fread() implementations in common libraries, but it prevents the direct use of gzfread() to read a concurrently written - file, reseting and retrying on end-of-file, when size is not 1. + file, resetting and retrying on end-of-file, when size is not 1. */ ZEXTERN int ZEXPORT gzwrite OF((gzFile file, |