diff options
author | unknown <pem@mysql.comhem.se> | 2004-04-28 12:08:54 +0200 |
---|---|---|
committer | unknown <pem@mysql.comhem.se> | 2004-04-28 12:08:54 +0200 |
commit | 2eecc377a6aee5bc87979f3ca98e1f1de7dd8e4d (patch) | |
tree | 9c1da43e53cf77e72c29d1ff57b3c37c13c32da8 /sql | |
parent | c635d37479fbf8aa0da03d47f264ab9907cfe72b (diff) | |
download | mariadb-git-2eecc377a6aee5bc87979f3ca98e1f1de7dd8e4d.tar.gz |
Post-merge fixes, some quite complex. client/mysqlbinlog.cc and sql/log_event.cc
merged manually by guilhem.
client/mysqlbinlog.cc:
Post-merge fixes; manually merged by guilhem.
include/mysqld_error.h:
Post-merge fixes.
mysql-test/r/drop_temp_table.result:
Post-merge fixes.
mysql-test/r/insert.result:
Post-merge fixes.
mysql-test/r/mysqlbinlog.result:
Post-merge fixes.
mysql-test/r/query_cache.result:
Post-merge fixes.
mysql-test/r/rpl_error_ignored_table.result:
Post-merge fixes.
mysql-test/r/rpl_relayrotate.result:
Post-merge fixes.
mysql-test/r/rpl_trunc_binlog.result:
Post-merge fixes.
mysql-test/r/sp-error.result:
Post-merge fixes.
mysql-test/r/sp.result:
Post-merge fixes.
mysql-test/r/system_mysql_db.result:
Post-merge fixes.
mysql-test/r/variables.result:
Post-merge fixes.
mysql-test/t/rpl_error_ignored_table.test:
Post-merge fixes.
mysql-test/t/sp-error.test:
Post-merge fixes.
sql/ha_innodb.cc:
Post-merge fixes.
sql/log_event.cc:
Post-merge fixes; manually merged by guilhem.
sql/set_var.cc:
Post-merge fixes.
sql/share/danish/errmsg.txt:
Post-merge fixes.
sql/share/dutch/errmsg.txt:
Post-merge fixes.
sql/share/english/errmsg.txt:
Post-merge fixes.
sql/share/estonian/errmsg.txt:
Post-merge fixes.
sql/sp.cc:
Post-merge fixes.
sql/sql_insert.cc:
Post-merge fixes.
sql/sql_table.cc:
Post-merge fixes.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/ha_innodb.cc | 8 | ||||
-rw-r--r-- | sql/log_event.cc | 374 | ||||
-rw-r--r-- | sql/set_var.cc | 366 | ||||
-rw-r--r-- | sql/share/danish/errmsg.txt | 29 | ||||
-rw-r--r-- | sql/share/dutch/errmsg.txt | 29 | ||||
-rw-r--r-- | sql/share/english/errmsg.txt | 34 | ||||
-rw-r--r-- | sql/share/estonian/errmsg.txt | 29 | ||||
-rw-r--r-- | sql/sp.cc | 2 | ||||
-rw-r--r-- | sql/sql_insert.cc | 2 | ||||
-rw-r--r-- | sql/sql_table.cc | 1 |
10 files changed, 447 insertions, 427 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 31b7fb807f3..664968aaef4 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -2019,10 +2019,10 @@ build_template( if (templ_type == ROW_MYSQL_REC_FIELDS && ((prebuilt->read_just_key && !index_contains_field) || - (!(fetch_all_in_key && index_contains_field) - !(fetch_primary_key_cols && - dict_table_col_in_clustered_key(index->table, i) && - thd->query_id != field->query_id))) { + (!(fetch_all_in_key && index_contains_field) && + !(fetch_primary_key_cols && + dict_table_col_in_clustered_key(index->table, i)) && + thd->query_id != field->query_id))) { /* This field is not needed in the query, skip it */ diff --git a/sql/log_event.cc b/sql/log_event.cc index 6a8d9d48d29..5a56cc139b0 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (C) 2000-2004 MySQL AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -56,11 +56,21 @@ static void pretty_print_str(FILE* file, char* str, int len) #endif /* MYSQL_CLIENT */ +#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) + +static void clear_all_errors(THD *thd, struct st_relay_log_info *rli) +{ + thd->query_error = 0; + thd->clear_error(); + *rli->last_slave_error = 0; + rli->last_slave_errno = 0; +} + + /* - ignored_error_code() + Ignore error code specified on command line */ -#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) inline int ignored_error_code(int err_code) { return ((err_code == ER_SLAVE_IGNORED_TABLE) || @@ -73,7 +83,7 @@ inline int ignored_error_code(int err_code) pretty_print_str() */ -#ifndef MYSQL_CLIENT +#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) static char *pretty_print_str(char *packet, char *str, int len) { char *end= str + len; @@ -349,6 +359,8 @@ Log_event::Log_event(const char* buf, int Log_event::exec_event(struct st_relay_log_info* rli) { + DBUG_ENTER("Log_event::exec_event"); + /* rli is null when (as far as I (Guilhem) know) the caller is @@ -401,7 +413,7 @@ int Log_event::exec_event(struct st_relay_log_info* rli) rli->last_master_timestamp= when; } } - return 0; + DBUG_RETURN(0); } @@ -1047,7 +1059,9 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, 0 : LOG_EVENT_THREAD_SPECIFIC_F, using_trans), data_buf(0), query(query_arg), catalog(thd_arg->catalog), db(thd_arg->db), q_len((uint32) query_length), - error_code(thd_arg->killed != THD::NOT_KILLED ? thd->killed_errno() : thd_arg->net.last_errno), + error_code((thd_arg->killed != THD::NOT_KILLED) ? + ((thd_arg->system_thread & SYSTEM_THREAD_DELAYED_INSERT) ? + 0 : thd->killed_errno()) : thd_arg->net.last_errno), thread_id(thd_arg->thread_id), /* save the original thread id; we already know the server id */ slave_proxy_id(thd_arg->variables.pseudo_thread_id), @@ -1340,7 +1354,12 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli) END of the current log event (COMMIT). We save it in rli so that InnoDB can access it. */ +#if MYSQL_VERSION_ID < 50000 + rli->future_group_master_log_pos= log_pos + get_event_len(); +#else rli->future_group_master_log_pos= log_pos; +#endif + clear_all_errors(thd, rli); if (db_ok(thd->db, replicate_do_db, replicate_ignore_db)) { @@ -1350,9 +1369,9 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli) VOID(pthread_mutex_lock(&LOCK_thread_count)); thd->query_id = query_id++; VOID(pthread_mutex_unlock(&LOCK_thread_count)); - thd->query_error= 0; // clear error - thd->clear_error(); thd->variables.pseudo_thread_id= thread_id; // for temp tables + mysql_log.write(thd,COM_QUERY,"%s",thd->query); + DBUG_PRINT("query",("%s",thd->query)); if (flags2_inited) /* @@ -1378,97 +1397,105 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli) (ulong) ((thd->variables.sql_mode & MODE_NO_DIR_IN_CREATE) | (sql_mode & ~(ulong) MODE_NO_DIR_IN_CREATE)); - /* - Sanity check to make sure the master did not get a really bad - error on the query (for example, if the query on the master was killed, we - don't want to play it on the slave, because we don't know how much of it - we have to play). - */ - if (ignored_error_code((expected_error = error_code)) || + if (ignored_error_code((expected_error= error_code)) || !check_expected_error(thd,rli,expected_error)) - { - mysql_log.write(thd,COM_QUERY,"%s",thd->query); - DBUG_PRINT("query",("%s",thd->query)); mysql_parse(thd, thd->query, q_len); - + else + { /* - If we expected a non-zero error code, and we don't get the same error - code, and none of them should be ignored. + The query got a really bad error on the master (thread killed etc), + which could be inconsistent. Parse it to test the table names: if the + replicate-*-do|ignore-table rules say "this query must be ignored" then + we exit gracefully; otherwise we warn about the bad error and tell DBA + to check/fix it. */ - DBUG_PRINT("info",("expected_error: %d last_errno: %d", - expected_error, thd->net.last_errno)); - if ((expected_error != (actual_error= thd->net.last_errno)) && - expected_error && - !ignored_error_code(actual_error) && - !ignored_error_code(expected_error)) + if (mysql_test_parse_for_slave(thd, thd->query, q_len)) + clear_all_errors(thd, rli); /* Can ignore query */ + else { - slave_print_error(rli, 0, + slave_print_error(rli,expected_error, "\ +Query '%s' partially completed on the master (error on master: %d) \ +and was aborted. There is a chance that your master is inconsistent at this \ +point. If you are sure that your master is ok, run this query manually on the \ +slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; \ +START SLAVE; .", thd->query, expected_error); + thd->query_error= 1; + } + goto end; + } + + /* + If we expected a non-zero error code, and we don't get the same error + code, and none of them should be ignored. + */ + DBUG_PRINT("info",("expected_error: %d last_errno: %d", + expected_error, thd->net.last_errno)); + if ((expected_error != (actual_error= thd->net.last_errno)) && + expected_error && + !ignored_error_code(actual_error) && + !ignored_error_code(expected_error)) + { + slave_print_error(rli, 0, + "\ Query '%s' caused different errors on master and slave. \ Error on master: '%s' (%d), Error on slave: '%s' (%d). \ Default database: '%s'", - query, - ER_SAFE(expected_error), - expected_error, - actual_error ? thd->net.last_error: "no error", - actual_error, - print_slave_db_safe(db)); - thd->query_error= 1; - } - /* - If we get the same error code as expected, or they should be ignored. - */ - else if (expected_error == actual_error || - ignored_error_code(actual_error)) - { - DBUG_PRINT("info",("error ignored")); - thd->query_error = 0; - *rli->last_slave_error = 0; - rli->last_slave_errno = 0; - } - /* - Other cases: mostly we expected no error and get one. - */ - else if (thd->query_error || thd->is_fatal_error) + query, + ER_SAFE(expected_error), + expected_error, + actual_error ? thd->net.last_error: "no error", + actual_error, + print_slave_db_safe(db)); + thd->query_error= 1; + } + /* + If we get the same error code as expected, or they should be ignored. + */ + else if (expected_error == actual_error || + ignored_error_code(actual_error)) + { + DBUG_PRINT("info",("error ignored")); + clear_all_errors(thd, rli); + } + /* + Other cases: mostly we expected no error and get one. + */ + else if (thd->query_error || thd->is_fatal_error) + { + slave_print_error(rli,actual_error, + "Error '%s' on query '%s'. Default database: '%s'", + (actual_error ? thd->net.last_error : + "unexpected success or fatal error"), + query, + print_slave_db_safe(db)); + thd->query_error= 1; + } + + /* + TODO: compare the values of "affected rows" around here. Something + like: + if ((uint32) affected_in_event != (uint32) affected_on_slave) { - slave_print_error(rli,actual_error, - "Error '%s' on query '%s'. Default database: '%s'", - (actual_error ? thd->net.last_error : - "unexpected success or fatal error"), - query, - print_slave_db_safe(db)); - thd->query_error= 1; + sql_print_error("Slave: did not get the expected number of affected \ + rows running query from master - expected %d, got %d (this numbers \ + should have matched modulo 4294967296).", 0, ...); + thd->query_error = 1; } - /* - TODO: compare the values of "affected rows" around here. Something - like: - if ((uint32) affected_in_event != (uint32) affected_on_slave) - { - sql_print_error("Slave: did not get the expected number of affected \ - rows running query from master - expected %d, got %d (this numbers \ - should have matched modulo 4294967296).", 0, ...); - thd->query_error = 1; - } - We may also want an option to tell the slave to ignore "affected" - mismatch. This mismatch could be implemented with a new ER_ code, and - to ignore it you would use --slave-skip-errors... + We may also want an option to tell the slave to ignore "affected" + mismatch. This mismatch could be implemented with a new ER_ code, and + to ignore it you would use --slave-skip-errors... - To do the comparison we need to know the value of "affected" which the - above mysql_parse() computed. And we need to know the value of - "affected" in the master's binlog. Both will be implemented later. The - important thing is that we now have the format ready to log the values - of "affected" in the binlog. So we can release 5.0.0 before effectively - logging "affected" and effectively comparing it. - */ - } - /* - End of sanity check. If the test was false, the query got a really bad - error on the master, which could be inconsistent. check_expected_error() - already printed the message to stderr and rli, to tell the DBA to fix - things, and it has set thd->query_error to 1. + To do the comparison we need to know the value of "affected" which the + above mysql_parse() computed. And we need to know the value of + "affected" in the master's binlog. Both will be implemented later. The + important thing is that we now have the format ready to log the values + of "affected" in the binlog. So we can release 5.0.0 before effectively + logging "affected" and effectively comparing it. */ } /* End of if (db_ok(... */ +end: VOID(pthread_mutex_lock(&LOCK_thread_count)); /* Probably we have set thd->query, thd->db, thd->catalog to point to places @@ -1634,7 +1661,7 @@ int Start_log_event_v3::exec_event(struct st_relay_log_info* rli) { slave_print_error(rli, 0, "\ Rolling back unfinished transaction (no COMMIT or ROLLBACK) from relay log. \ -Probably cause is that the master died while writing the transaction to it's \ +A probable cause is that the master died while writing the transaction to its \ binary log."); return(1); } @@ -1924,7 +1951,7 @@ void Load_log_event::pack_info(Protocol *protocol) 18 + fname_len + 2 + // "LOAD DATA INFILE 'file''" 7 + // LOCAL 9 + // " REPLACE or IGNORE " - 11 + table_name_len + // "INTO TABLE table" + 13 + table_name_len*2 + // "INTO TABLE `table`" 21 + sql_ex.field_term_len*4 + 2 + // " FIELDS TERMINATED BY 'str'" 23 + sql_ex.enclosed_len*4 + 2 + // " OPTIONALLY ENCLOSED BY 'str'" 12 + sql_ex.escaped_len*4 + 2 + // " ESCAPED BY 'str'" @@ -1955,42 +1982,25 @@ void Load_log_event::pack_info(Protocol *protocol) else if (sql_ex.opt_flags & IGNORE_FLAG) pos= strmov(pos, " IGNORE "); - pos= strmov(pos ,"INTO TABLE "); + pos= strmov(pos ,"INTO TABLE `"); memcpy(pos, table_name, table_name_len); pos+= table_name_len; - if (sql_ex.field_term_len) - { - pos= strmov(pos, " FIELDS TERMINATED BY "); - pos= pretty_print_str(pos, sql_ex.field_term, sql_ex.field_term_len); - } - - if (sql_ex.enclosed_len) - { - if (sql_ex.opt_flags & OPT_ENCLOSED_FLAG) - pos= strmov(pos, " OPTIONALLY "); - pos= strmov(pos, " ENCLOSED BY "); - pos= pretty_print_str(pos, sql_ex.enclosed, sql_ex.enclosed_len); - } + /* We have to create all optinal fields as the default is not empty */ + pos= strmov(pos, "` FIELDS TERMINATED BY "); + pos= pretty_print_str(pos, sql_ex.field_term, sql_ex.field_term_len); + if (sql_ex.opt_flags & OPT_ENCLOSED_FLAG) + pos= strmov(pos, " OPTIONALLY "); + pos= strmov(pos, " ENCLOSED BY "); + pos= pretty_print_str(pos, sql_ex.enclosed, sql_ex.enclosed_len); - if (sql_ex.escaped_len) - { - pos= strmov(pos, " ESCAPED BY "); - pos= pretty_print_str(pos, sql_ex.escaped, sql_ex.escaped_len); - } - - bool line_lexem_added= false; - if (sql_ex.line_term_len) - { - pos= strmov(pos, " LINES TERMINATED BY "); - pos= pretty_print_str(pos, sql_ex.line_term, sql_ex.line_term_len); - line_lexem_added= true; - } + pos= strmov(pos, " ESCAPED BY "); + pos= pretty_print_str(pos, sql_ex.escaped, sql_ex.escaped_len); + pos= strmov(pos, " LINES TERMINATED BY "); + pos= pretty_print_str(pos, sql_ex.line_term, sql_ex.line_term_len); if (sql_ex.line_start_len) { - if (!line_lexem_added) - pos= strmov(pos," LINES"); pos= strmov(pos, " STARTING BY "); pos= pretty_print_str(pos, sql_ex.line_start, sql_ex.line_start_len); } @@ -2079,7 +2089,7 @@ Load_log_event::Load_log_event(THD *thd_arg, sql_exchange *ex, num_fields(0),fields(0), field_lens(0),field_block_len(0), table_name(table_name_arg ? table_name_arg : ""), - db(db_arg), fname(ex->file_name) + db(db_arg), fname(ex->file_name), local_fname(FALSE) { time_t end_time; time(&end_time); @@ -2161,22 +2171,24 @@ Load_log_event::Load_log_event(THD *thd_arg, sql_exchange *ex, Load_log_event::Load_log_event(const char *buf, uint event_len, const Format_description_log_event *description_event) - :Log_event(buf, description_event),num_fields(0),fields(0), + :Log_event(buf, description_event), num_fields(0), fields(0), field_lens(0),field_block_len(0), - table_name(0),db(0),fname(0) + table_name(0), db(0), fname(0), local_fname(FALSE) { - if (!event_len) // derived class, will call copy_log_event() itself - return; + DBUG_ENTER("Load_log_event"); /* I (Guilhem) manually tested replication of LOAD DATA INFILE for 3.23->5.0, 4.0->5.0 and 5.0->5.0 and it works. */ - copy_log_event(buf, event_len, - ((buf[EVENT_TYPE_OFFSET] == LOAD_EVENT) ? - LOAD_HEADER_LEN + - description_event->common_header_len : - LOAD_HEADER_LEN + LOG_EVENT_HEADER_LEN), - description_event); + if (event_len) + copy_log_event(buf, event_len, + ((buf[EVENT_TYPE_OFFSET] == LOAD_EVENT) ? + LOAD_HEADER_LEN + + description_event->common_header_len : + LOAD_HEADER_LEN + LOG_EVENT_HEADER_LEN), + description_event); + /* otherwise it's a derived class, will call copy_log_event() itself */ + DBUG_VOID_RETURN; } @@ -2188,6 +2200,7 @@ int Load_log_event::copy_log_event(const char *buf, ulong event_len, int body_offset, const Format_description_log_event *description_event) { + DBUG_ENTER("Load_log_event::copy_log_event"); uint data_len; char* buf_end = (char*)buf + event_len; /* this is the beginning of the post-header */ @@ -2200,19 +2213,19 @@ int Load_log_event::copy_log_event(const char *buf, ulong event_len, num_fields = uint4korr(data_head + L_NUM_FIELDS_OFFSET); if ((int) event_len < body_offset) - return 1; + DBUG_RETURN(1); /* Sql_ex.init() on success returns the pointer to the first byte after the sql_ex structure, which is the start of field lengths array. */ - if (!(field_lens=(uchar*)sql_ex.init((char*)buf + body_offset, - buf_end, - buf[EVENT_TYPE_OFFSET] != LOAD_EVENT))) - return 1; + if (!(field_lens= (uchar*)sql_ex.init((char*)buf + body_offset, + buf_end, + buf[EVENT_TYPE_OFFSET] != LOAD_EVENT))) + DBUG_RETURN(1); data_len = event_len - body_offset; if (num_fields > data_len) // simple sanity check against corruption - return 1; + DBUG_RETURN(1); for (uint i = 0; i < num_fields; i++) field_block_len += (uint)field_lens[i] + 1; @@ -2228,7 +2241,7 @@ int Load_log_event::copy_log_event(const char *buf, ulong event_len, DATA INFILE in a completely different way (as a plain-text query) since 4.1 or 5.0 (Dmitri's WL#874) */ - return 0; + DBUG_RETURN(0); } @@ -2246,6 +2259,7 @@ void Load_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_ev void Load_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_event_info, bool commented) { + DBUG_ENTER("Load_log_event::print"); if (!short_form) { print_header(file); @@ -2276,43 +2290,27 @@ void Load_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_ev else if (sql_ex.opt_flags & IGNORE_FLAG) fprintf(file," IGNORE "); - fprintf(file, "INTO TABLE %s ", table_name); - if (sql_ex.field_term) - { - fprintf(file, " FIELDS TERMINATED BY "); - pretty_print_str(file, sql_ex.field_term, sql_ex.field_term_len); - } - - if (sql_ex.enclosed) - { - if (sql_ex.opt_flags & OPT_ENCLOSED_FLAG) - fprintf(file," OPTIONALLY "); - fprintf(file, " ENCLOSED BY "); - pretty_print_str(file, sql_ex.enclosed, sql_ex.enclosed_len); - } + fprintf(file, "INTO TABLE `%s`", table_name); + fprintf(file, " FIELDS TERMINATED BY "); + pretty_print_str(file, sql_ex.field_term, sql_ex.field_term_len); + + if (sql_ex.opt_flags & OPT_ENCLOSED_FLAG) + fprintf(file," OPTIONALLY "); + fprintf(file, " ENCLOSED BY "); + pretty_print_str(file, sql_ex.enclosed, sql_ex.enclosed_len); - if (sql_ex.escaped) - { - fprintf(file, " ESCAPED BY "); - pretty_print_str(file, sql_ex.escaped, sql_ex.escaped_len); - } + fprintf(file, " ESCAPED BY "); + pretty_print_str(file, sql_ex.escaped, sql_ex.escaped_len); - bool line_lexem_added= false; - if (sql_ex.line_term) - { - fprintf(file," LINES TERMINATED BY "); - pretty_print_str(file, sql_ex.line_term, sql_ex.line_term_len); - line_lexem_added= true; - } + fprintf(file," LINES TERMINATED BY "); + pretty_print_str(file, sql_ex.line_term, sql_ex.line_term_len); + if (sql_ex.line_start) { - if (!line_lexem_added) - fprintf(file," LINES"); fprintf(file," STARTING BY "); pretty_print_str(file, sql_ex.line_start, sql_ex.line_start_len); } - if ((long) skip_lines > 0) fprintf(file, " IGNORE %ld LINES", (long) skip_lines); @@ -2333,6 +2331,7 @@ void Load_log_event::print(FILE* file, bool short_form, LAST_EVENT_INFO* last_ev } fprintf(file, ";\n"); + DBUG_VOID_RETURN; } #endif /* MYSQL_CLIENT */ @@ -2389,10 +2388,18 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, DBUG_ASSERT(thd->query == 0); thd->query = 0; // Should not be needed thd->query_error = 0; - - /* Saved for InnoDB, see comment in Query_log_event::exec_event() */ - rli->future_group_master_log_pos= log_pos; - /* + clear_all_errors(thd, rli); + if (!use_rli_only_for_errors) + { + /* Saved for InnoDB, see comment in Query_log_event::exec_event() */ +#if MYSQL_VERSION_ID < 50000 + rli->future_group_master_log_pos= log_pos + get_event_len(); +#else + rli->future_group_master_log_pos= log_pos; +#endif + } + + /* We test replicate_*_db rules. Note that we have already prepared the file to load, even if we are going to ignore and delete it now. So it is possible that we did a lot of disk writes for nothing. In other words, a @@ -2417,6 +2424,7 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, tables.alias = tables.real_name = (char*)table_name; tables.lock_type = TL_WRITE; tables.updating= 1; + // the table will be opened in mysql_load if (table_rules_on && !tables_ok(thd, &tables)) { @@ -2598,12 +2606,13 @@ Rotate_log_event::Rotate_log_event(const char* buf, uint event_len, const Format_description_log_event* description_event) :Log_event(buf, description_event) ,new_log_ident(NULL),alloced(0) { + DBUG_ENTER("Rotate_log_event::Rotate_log_event(char*,...)"); // The caller will ensure that event_len is what we have at EVENT_LEN_OFFSET uint8 header_size= description_event->common_header_len; uint8 post_header_len= description_event->post_header_len[ROTATE_EVENT-1]; uint ident_offset; if (event_len < header_size) - return; + DBUG_VOID_RETURN; buf += header_size; pos = post_header_len ? uint8korr(buf + R_POS_OFFSET) : 4; ident_len = (uint)(event_len - @@ -2614,8 +2623,9 @@ Rotate_log_event::Rotate_log_event(const char* buf, uint event_len, ident_offset, (uint) ident_len, MYF(MY_WME)))) - return; + DBUG_VOID_RETURN; alloced = 1; + DBUG_VOID_RETURN; } @@ -3098,6 +3108,10 @@ int User_var_log_event::exec_event(struct st_relay_log_info* rli) } } Item_func_set_user_var e(user_var_name, it); + /* + Item_func_set_user_var can't substitute something else on its place => + 0 can be passed as last argument (reference on item) + */ e.fix_fields(thd, 0, 0); e.update_hash(val, val_len, type, charset, DERIVATION_NONE); free_root(&thd->mem_root,0); @@ -3330,10 +3344,12 @@ Create_file_log_event(THD* thd_arg, sql_exchange* ex, char* block_arg, uint block_len_arg, bool using_trans) :Load_log_event(thd_arg,ex,db_arg,table_name_arg,fields_arg,handle_dup, using_trans), - fake_base(0),block(block_arg),block_len(block_len_arg), + fake_base(0), block(block_arg), event_buf(0), block_len(block_len_arg), file_id(thd_arg->file_id = mysql_bin_log.next_file_id()) { + DBUG_ENTER("Create_file_log_event"); sql_ex.force_new_format(); + DBUG_VOID_RETURN; } #endif /* !MYSQL_CLIENT */ @@ -3389,18 +3405,20 @@ Create_file_log_event::Create_file_log_event(const char* buf, uint len, const Format_description_log_event* description_event) :Load_log_event(buf,0,description_event),fake_base(0),block(0),inited_from_old(0) { + DBUG_ENTER("Create_file_log_event::Create_file_log_event(char*,...)"); uint block_offset; uint header_len= description_event->common_header_len; uint8 load_header_len= description_event->post_header_len[LOAD_EVENT-1]; uint8 create_file_header_len= description_event->post_header_len[CREATE_FILE_EVENT-1]; - if (copy_log_event(buf,len, + if (!(event_buf= my_memdup((byte*) buf, len, MYF(MY_WME))) || + copy_log_event(event_buf,len, ((buf[EVENT_TYPE_OFFSET] == LOAD_EVENT) ? load_header_len + header_len : (fake_base ? (header_len+load_header_len) : (header_len+load_header_len) + create_file_header_len)), description_event)) - return; + DBUG_VOID_RETURN; if (description_event->binlog_version!=1) { file_id= uint4korr(buf + @@ -3429,6 +3447,7 @@ Create_file_log_event::Create_file_log_event(const char* buf, uint len, sql_ex.force_new_format(); inited_from_old = 1; } + DBUG_VOID_RETURN; } @@ -3582,15 +3601,17 @@ Append_block_log_event::Append_block_log_event(const char* buf, uint len, const Format_description_log_event* description_event) :Log_event(buf, description_event),block(0) { + DBUG_ENTER("Append_block_log_event::Append_block_log_event(char*,...)"); uint8 common_header_len= description_event->common_header_len; uint8 append_block_header_len= description_event->post_header_len[APPEND_BLOCK_EVENT-1]; uint total_header_len= common_header_len+append_block_header_len; if (len < total_header_len) - return; + DBUG_VOID_RETURN; file_id= uint4korr(buf + common_header_len + AB_FILE_ID_OFFSET); block= (char*)buf + total_header_len; block_len= len - total_header_len; + DBUG_VOID_RETURN; } @@ -3653,6 +3674,7 @@ int Append_block_log_event::exec_event(struct st_relay_log_info* rli) char *p= slave_load_file_stem(fname, file_id, server_id); int fd; int error = 1; + DBUG_ENTER("Append_block_log_event::exec_event"); memcpy(p, ".data", 6); if ((fd = my_open(fname, O_WRONLY|O_APPEND|O_BINARY, MYF(MY_WME))) < 0) @@ -3670,7 +3692,7 @@ int Append_block_log_event::exec_event(struct st_relay_log_info* rli) err: if (fd >= 0) my_close(fd, MYF(0)); - return error ? error : Log_event::exec_event(rli); + DBUG_RETURN(error ? error : Log_event::exec_event(rli)); } #endif @@ -3880,6 +3902,12 @@ int Execute_load_log_event::exec_event(struct st_relay_log_info* rli) lev->exec_event is the place where the table is loaded (it calls mysql_load()). */ + +#if MYSQL_VERSION_ID < 50000 + rli->future_group_master_log_pos= log_pos + get_event_len(); +#else + rli->future_group_master_log_pos= log_pos; +#endif if (lev->exec_event(0,rli,1)) { /* diff --git a/sql/set_var.cc b/sql/set_var.cc index b74bf3e5f7b..2af0a011b58 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -19,18 +19,18 @@ To add a new variable, one has to do the following: - - If the variable is thread specific, add it to 'system_variables' struct. - If not, add it to mysqld.cc and an declaration in 'mysql_priv.h' - - Don't forget to initialize new fields in global_system_variables and - max_system_variables! - Use one of the 'sys_var... classes from set_var.h or write a specific one for the variable type. - Define it in the 'variable definition list' in this file. - If the variable should be changeable or one should be able to access it with @@variable_name, it should be added to the 'list of all variables' - list in this file. + list (sys_variables) in this file. + - If the variable is thread specific, add it to 'system_variables' struct. + If not, add it to mysqld.cc and an declaration in 'mysql_priv.h' - If the variable should be changed from the command line, add a definition of it in the my_option structure list in mysqld.dcc + - Don't forget to initialize new fields in global_system_variables and + max_system_variables! - If the variable should show up in 'show variables' add it to the init_vars[] struct in this file @@ -73,16 +73,21 @@ TYPELIB delay_key_write_typelib= array_elements(delay_key_write_type_names)-1, "", delay_key_write_type_names }; -static bool sys_check_charset(THD *thd, set_var *var); +static int sys_check_charset(THD *thd, set_var *var); static bool sys_update_charset(THD *thd, set_var *var); static void sys_set_default_charset(THD *thd, enum_var_type type); +static int sys_check_ftb_syntax(THD *thd, set_var *var); +static bool sys_update_ftb_syntax(THD *thd, set_var * var); +static void sys_default_ftb_syntax(THD *thd, enum_var_type type); static bool sys_update_init_connect(THD*, set_var*); static void sys_default_init_connect(THD*, enum_var_type type); static bool sys_update_init_slave(THD*, set_var*); static void sys_default_init_slave(THD*, enum_var_type type); static bool set_option_bit(THD *thd, set_var *var); static bool set_option_autocommit(THD *thd, set_var *var); +static int check_log_update(THD *thd, set_var *var); static bool set_log_update(THD *thd, set_var *var); +static int check_pseudo_thread_id(THD *thd, set_var *var); static bool set_log_bin(THD *thd, set_var *var); static void fix_low_priority_updates(THD *thd, enum_var_type type); static void fix_tx_isolation(THD *thd, enum_var_type type); @@ -97,6 +102,8 @@ static void fix_myisam_max_sort_file_size(THD *thd, enum_var_type type); static void fix_max_binlog_size(THD *thd, enum_var_type type); static void fix_max_relay_log_size(THD *thd, enum_var_type type); static void fix_max_connections(THD *thd, enum_var_type type); +static void fix_thd_mem_root(THD *thd, enum_var_type type); +static void fix_trans_mem_root(THD *thd, enum_var_type type); static KEY_CACHE *create_key_cache(const char *name, uint length); void fix_sql_mode_var(THD *thd, enum_var_type type); static byte *get_error_count(THD *thd); @@ -117,13 +124,8 @@ sys_var_character_set_server sys_character_set_server("character_set_server"); sys_var_str sys_charset_system("character_set_system", sys_check_charset, sys_update_charset, - sys_set_default_charset); -sys_var_str sys_init_connect("init_connect", 0, - sys_update_init_connect, - sys_default_init_connect); -sys_var_str sys_init_slave("init_slave", 0, - sys_update_init_slave, - sys_default_init_slave); + sys_set_default_charset, + (char *)my_charset_utf8_general_ci.name); sys_var_character_set_database sys_character_set_database("character_set_database"); sys_var_character_set_client sys_character_set_client("character_set_client"); sys_var_character_set_connection sys_character_set_connection("character_set_connection"); @@ -149,6 +151,17 @@ sys_var_long_ptr sys_expire_logs_days("expire_logs_days", &expire_logs_days); sys_var_bool_ptr sys_flush("flush", &myisam_flush); sys_var_long_ptr sys_flush_time("flush_time", &flush_time); +sys_var_str sys_ft_boolean_syntax("ft_boolean_syntax", + sys_check_ftb_syntax, + sys_update_ftb_syntax, + sys_default_ftb_syntax, + ft_boolean_syntax); +sys_var_str sys_init_connect("init_connect", 0, + sys_update_init_connect, + sys_default_init_connect,0); +sys_var_str sys_init_slave("init_slave", 0, + sys_update_init_slave, + sys_default_init_slave,0); sys_var_thd_ulong sys_interactive_timeout("interactive_timeout", &SV::net_interactive_timeout); sys_var_thd_ulong sys_join_buffer_size("join_buffer_size", @@ -188,26 +201,25 @@ sys_var_long_ptr sys_max_connections("max_connections", fix_max_connections); sys_var_long_ptr sys_max_connect_errors("max_connect_errors", &max_connect_errors); -sys_var_long_ptr sys_max_delayed_threads("max_delayed_threads", - &max_insert_delayed_threads, - fix_max_connections); +sys_var_thd_ulong sys_max_insert_delayed_threads("max_insert_delayed_threads", + &SV::max_insert_delayed_threads); +sys_var_thd_ulong sys_max_delayed_threads("max_delayed_threads", + &SV::max_insert_delayed_threads, + 0, fix_max_connections); sys_var_thd_ulong sys_max_error_count("max_error_count", &SV::max_error_count); sys_var_thd_ulong sys_max_heap_table_size("max_heap_table_size", &SV::max_heap_table_size); -/* - sys_pseudo_thread_id has its own class (instead of sys_var_thd_ulong) because - we want a check() function. -*/ -sys_var_pseudo_thread_id sys_pseudo_thread_id("pseudo_thread_id", - &SV::pseudo_thread_id); +sys_var_thd_ulong sys_pseudo_thread_id("pseudo_thread_id", + &SV::pseudo_thread_id, + check_pseudo_thread_id, 0); sys_var_thd_ha_rows sys_max_join_size("max_join_size", &SV::max_join_size, fix_max_join_size); sys_var_thd_ulong sys_max_seeks_for_key("max_seeks_for_key", &SV::max_seeks_for_key); sys_var_thd_ulong sys_max_length_for_sort_data("max_length_for_sort_data", - &SV::max_length_for_sort_data); + &SV::max_length_for_sort_data); #ifndef TO_BE_DELETED /* Alias for max_join_size */ sys_var_thd_ha_rows sys_sql_max_join_size("sql_max_join_size", &SV::max_join_size, @@ -232,13 +244,13 @@ sys_var_thd_ulong sys_net_buffer_length("net_buffer_length", &SV::net_buffer_length); sys_var_thd_ulong sys_net_read_timeout("net_read_timeout", &SV::net_read_timeout, - fix_net_read_timeout); + 0, fix_net_read_timeout); sys_var_thd_ulong sys_net_write_timeout("net_write_timeout", &SV::net_write_timeout, - fix_net_write_timeout); + 0, fix_net_write_timeout); sys_var_thd_ulong sys_net_retry_count("net_retry_count", &SV::net_retry_count, - fix_net_retry_count); + 0, fix_net_retry_count); sys_var_thd_bool sys_new_mode("new", &SV::new_mode); sys_var_thd_bool sys_old_passwords("old_passwords", &SV::old_passwords); sys_var_thd_ulong sys_preload_buff_size("preload_buffer_size", @@ -261,13 +273,17 @@ sys_var_long_ptr sys_query_cache_size("query_cache_size", sys_var_thd_ulong sys_range_alloc_block_size("range_alloc_block_size", &SV::range_alloc_block_size); sys_var_thd_ulong sys_query_alloc_block_size("query_alloc_block_size", - &SV::query_alloc_block_size); + &SV::query_alloc_block_size, + 0, fix_thd_mem_root); sys_var_thd_ulong sys_query_prealloc_size("query_prealloc_size", - &SV::query_prealloc_size); + &SV::query_prealloc_size, + 0, fix_thd_mem_root); sys_var_thd_ulong sys_trans_alloc_block_size("transaction_alloc_block_size", - &SV::trans_alloc_block_size); + &SV::trans_alloc_block_size, + 0, fix_trans_mem_root); sys_var_thd_ulong sys_trans_prealloc_size("transaction_prealloc_size", - &SV::trans_prealloc_size); + &SV::trans_prealloc_size, + 0, fix_trans_mem_root); #ifdef HAVE_QUERY_CACHE sys_var_long_ptr sys_query_cache_limit("query_cache_limit", @@ -278,6 +294,9 @@ sys_var_long_ptr sys_query_cache_min_res_unit("query_cache_min_res_unit", sys_var_thd_enum sys_query_cache_type("query_cache_type", &SV::query_cache_type, &query_cache_type_typelib); +sys_var_thd_bool +sys_query_cache_wlock_invalidate("query_cache_wlock_invalidate", + &SV::query_cache_wlock_invalidate); #endif /* HAVE_QUERY_CACHE */ sys_var_bool_ptr sys_secure_auth("secure_auth", &opt_secure_auth); sys_var_long_ptr sys_server_id("server_id",&server_id); @@ -313,7 +332,7 @@ sys_var_thd_ulong sys_net_wait_timeout("wait_timeout", #ifdef HAVE_INNOBASE_DB sys_var_long_ptr sys_innodb_max_dirty_pages_pct("innodb_max_dirty_pages_pct", &srv_max_buf_pool_modified_pct); -#endif +#endif /* Time/date/datetime formats */ @@ -329,50 +348,52 @@ sys_var_thd_date_time_format sys_datetime_format("datetime_format", /* Variables that are bits in THD */ -static sys_var_thd_bit sys_autocommit("autocommit", +static sys_var_thd_bit sys_autocommit("autocommit", 0, set_option_autocommit, OPTION_NOT_AUTOCOMMIT, 1); -static sys_var_thd_bit sys_big_tables("big_tables", +static sys_var_thd_bit sys_big_tables("big_tables", 0, set_option_bit, OPTION_BIG_TABLES); #ifndef TO_BE_DELETED /* Alias for big_tables */ -static sys_var_thd_bit sys_sql_big_tables("sql_big_tables", +static sys_var_thd_bit sys_sql_big_tables("sql_big_tables", 0, set_option_bit, OPTION_BIG_TABLES); #endif -static sys_var_thd_bit sys_big_selects("sql_big_selects", +static sys_var_thd_bit sys_big_selects("sql_big_selects", 0, set_option_bit, OPTION_BIG_SELECTS); -static sys_var_thd_bit sys_log_off("sql_log_off", +static sys_var_thd_bit sys_log_off("sql_log_off", 0, set_option_bit, OPTION_LOG_OFF); static sys_var_thd_bit sys_log_update("sql_log_update", + check_log_update, set_log_update, OPTION_UPDATE_LOG); static sys_var_thd_bit sys_log_binlog("sql_log_bin", - set_log_bin, - OPTION_BIN_LOG); -static sys_var_thd_bit sys_sql_warnings("sql_warnings", + check_log_update, + set_log_bin, + OPTION_BIN_LOG); +static sys_var_thd_bit sys_sql_warnings("sql_warnings", 0, set_option_bit, OPTION_WARNINGS); -static sys_var_thd_bit sys_auto_is_null("sql_auto_is_null", +static sys_var_thd_bit sys_auto_is_null("sql_auto_is_null", 0, set_option_bit, OPTION_AUTO_IS_NULL); -static sys_var_thd_bit sys_safe_updates("sql_safe_updates", +static sys_var_thd_bit sys_safe_updates("sql_safe_updates", 0, set_option_bit, OPTION_SAFE_UPDATES); -static sys_var_thd_bit sys_buffer_results("sql_buffer_result", +static sys_var_thd_bit sys_buffer_results("sql_buffer_result", 0, set_option_bit, OPTION_BUFFER_RESULT); -static sys_var_thd_bit sys_quote_show_create("sql_quote_show_create", +static sys_var_thd_bit sys_quote_show_create("sql_quote_show_create", 0, set_option_bit, OPTION_QUOTE_SHOW_CREATE); -static sys_var_thd_bit sys_foreign_key_checks("foreign_key_checks", +static sys_var_thd_bit sys_foreign_key_checks("foreign_key_checks", 0, set_option_bit, OPTION_NO_FOREIGN_KEY_CHECKS, 1); -static sys_var_thd_bit sys_unique_checks("unique_checks", +static sys_var_thd_bit sys_unique_checks("unique_checks", 0, set_option_bit, OPTION_RELAXED_UNIQUE_CHECKS, 1); @@ -407,6 +428,16 @@ static sys_var_thd_ulong sys_default_week_format("default_week_format", sys_var_thd_ulong sys_group_concat_max_len("group_concat_max_len", &SV::group_concat_max_len); + +/* Read only variables */ + +sys_var_const_str sys_os("version_compile_os", SYSTEM_TYPE); +/* Global read-only variable describing server license */ +sys_var_const_str sys_license("license", LICENSE); + + + + /* List of all variables for initialisation and storage in hash This is sorted in alphabetical order to make it easy to add new variables @@ -445,6 +476,7 @@ sys_var *sys_variables[]= &sys_expire_logs_days, &sys_flush, &sys_flush_time, + &sys_ft_boolean_syntax, &sys_foreign_key_checks, &sys_group_concat_max_len, &sys_identity, @@ -458,6 +490,7 @@ sys_var *sys_variables[]= &sys_key_cache_division_limit, &sys_key_cache_age_threshold, &sys_last_insert_id, + &sys_license, &sys_local_infile, &sys_log_binlog, &sys_log_off, @@ -472,6 +505,7 @@ sys_var *sys_variables[]= &sys_max_connections, &sys_max_delayed_threads, &sys_max_error_count, + &sys_max_insert_delayed_threads, &sys_max_heap_table_size, &sys_max_join_size, &sys_max_length_for_sort_data, @@ -501,6 +535,7 @@ sys_var *sys_variables[]= &sys_query_cache_limit, &sys_query_cache_min_res_unit, &sys_query_cache_type, + &sys_query_cache_wlock_invalidate, #endif /* HAVE_QUERY_CACHE */ &sys_quote_show_create, &sys_rand_seed1, @@ -539,6 +574,7 @@ sys_var *sys_variables[]= &sys_trans_alloc_block_size, &sys_trans_prealloc_size, &sys_tx_isolation, + &sys_os, #ifdef HAVE_INNOBASE_DB &sys_innodb_max_dirty_pages_pct, #endif @@ -556,22 +592,22 @@ struct show_var_st init_vars[]= { {"basedir", mysql_home, SHOW_CHAR}, #ifdef HAVE_BERKELEY_DB {"bdb_cache_size", (char*) &berkeley_cache_size, SHOW_LONG}, - {"bdb_log_buffer_size", (char*) &berkeley_log_buffer_size, SHOW_LONG}, {"bdb_home", (char*) &berkeley_home, SHOW_CHAR_PTR}, - {"bdb_max_lock", (char*) &berkeley_max_lock, SHOW_LONG}, {"bdb_logdir", (char*) &berkeley_logdir, SHOW_CHAR_PTR}, + {"bdb_log_buffer_size", (char*) &berkeley_log_buffer_size, SHOW_LONG}, + {"bdb_max_lock", (char*) &berkeley_max_lock, SHOW_LONG}, {"bdb_shared_data", (char*) &berkeley_shared_data, SHOW_BOOL}, {"bdb_tmpdir", (char*) &berkeley_tmpdir, SHOW_CHAR_PTR}, #endif {sys_binlog_cache_size.name,(char*) &sys_binlog_cache_size, SHOW_SYS}, {sys_bulk_insert_buff_size.name,(char*) &sys_bulk_insert_buff_size,SHOW_SYS}, - {sys_character_set_server.name, (char*) &sys_character_set_server,SHOW_SYS}, - {sys_charset_system.name, (char*) &sys_charset_system, SHOW_SYS}, - {sys_character_set_database.name, (char*) &sys_character_set_database,SHOW_SYS}, {sys_character_set_client.name,(char*) &sys_character_set_client, SHOW_SYS}, {sys_character_set_connection.name,(char*) &sys_character_set_connection,SHOW_SYS}, - {"character-sets-dir", mysql_charsets_dir, SHOW_CHAR}, + {sys_character_set_database.name, (char*) &sys_character_set_database,SHOW_SYS}, {sys_character_set_results.name,(char*) &sys_character_set_results, SHOW_SYS}, + {sys_character_set_server.name, (char*) &sys_character_set_server,SHOW_SYS}, + {sys_charset_system.name, (char*) &sys_charset_system, SHOW_SYS}, + {"character_sets_dir", mysql_charsets_dir, SHOW_CHAR}, {sys_collation_connection.name,(char*) &sys_collation_connection, SHOW_SYS}, {sys_collation_database.name,(char*) &sys_collation_database, SHOW_SYS}, {sys_collation_server.name,(char*) &sys_collation_server, SHOW_SYS}, @@ -588,37 +624,36 @@ struct show_var_st init_vars[]= { {sys_expire_logs_days.name, (char*) &sys_expire_logs_days, SHOW_SYS}, {sys_flush.name, (char*) &sys_flush, SHOW_SYS}, {sys_flush_time.name, (char*) &sys_flush_time, SHOW_SYS}, - {"ft_boolean_syntax", (char*) ft_boolean_syntax, SHOW_CHAR}, - {"ft_min_word_len", (char*) &ft_min_word_len, SHOW_LONG}, + {sys_ft_boolean_syntax.name,(char*) &ft_boolean_syntax, SHOW_CHAR}, {"ft_max_word_len", (char*) &ft_max_word_len, SHOW_LONG}, + {"ft_min_word_len", (char*) &ft_min_word_len, SHOW_LONG}, {"ft_query_expansion_limit",(char*) &ft_query_expansion_limit, SHOW_LONG}, {"ft_stopword_file", (char*) &ft_stopword_file, SHOW_CHAR_PTR}, + {sys_group_concat_max_len.name, (char*) &sys_group_concat_max_len, SHOW_SYS}, {"have_bdb", (char*) &have_berkeley_db, SHOW_HAVE}, - {"have_crypt", (char*) &have_crypt, SHOW_HAVE}, {"have_compress", (char*) &have_compress, SHOW_HAVE}, + {"have_crypt", (char*) &have_crypt, SHOW_HAVE}, {"have_innodb", (char*) &have_innodb, SHOW_HAVE}, {"have_isam", (char*) &have_isam, SHOW_HAVE}, - {"have_raid", (char*) &have_raid, SHOW_HAVE}, - {"have_symlink", (char*) &have_symlink, SHOW_HAVE}, {"have_openssl", (char*) &have_openssl, SHOW_HAVE}, {"have_query_cache", (char*) &have_query_cache, SHOW_HAVE}, - {"init_file", (char*) &opt_init_file, SHOW_CHAR_PTR}, + {"have_raid", (char*) &have_raid, SHOW_HAVE}, + {"have_symlink", (char*) &have_symlink, SHOW_HAVE}, {"init_connect", (char*) &sys_init_connect, SHOW_SYS}, + {"init_file", (char*) &opt_init_file, SHOW_CHAR_PTR}, {"init_slave", (char*) &sys_init_slave, SHOW_SYS}, #ifdef HAVE_INNOBASE_DB {"innodb_additional_mem_pool_size", (char*) &innobase_additional_mem_pool_size, SHOW_LONG }, - {"innodb_buffer_pool_size", (char*) &innobase_buffer_pool_size, SHOW_LONG }, {"innodb_buffer_pool_awe_mem_mb", (char*) &innobase_buffer_pool_awe_mem_mb, SHOW_LONG }, + {"innodb_buffer_pool_size", (char*) &innobase_buffer_pool_size, SHOW_LONG }, {"innodb_data_file_path", (char*) &innobase_data_file_path, SHOW_CHAR_PTR}, {"innodb_data_home_dir", (char*) &innobase_data_home_dir, SHOW_CHAR_PTR}, - {"innodb_file_io_threads", (char*) &innobase_file_io_threads, SHOW_LONG }, - {"innodb_open_files", (char*) &innobase_open_files, SHOW_LONG }, - {"innodb_force_recovery", (char*) &innobase_force_recovery, SHOW_LONG }, - {"innodb_thread_concurrency", (char*) &innobase_thread_concurrency, SHOW_LONG }, - {"innodb_flush_log_at_trx_commit", (char*) &innobase_flush_log_at_trx_commit, SHOW_INT}, {"innodb_fast_shutdown", (char*) &innobase_fast_shutdown, SHOW_MY_BOOL}, + {"innodb_file_io_threads", (char*) &innobase_file_io_threads, SHOW_LONG }, {"innodb_file_per_table", (char*) &innobase_file_per_table, SHOW_MY_BOOL}, + {"innodb_flush_log_at_trx_commit", (char*) &innobase_flush_log_at_trx_commit, SHOW_INT}, {"innodb_flush_method", (char*) &innobase_unix_file_flush_method, SHOW_CHAR_PTR}, + {"innodb_force_recovery", (char*) &innobase_force_recovery, SHOW_LONG }, {"innodb_lock_wait_timeout", (char*) &innobase_lock_wait_timeout, SHOW_LONG }, {"innodb_log_arch_dir", (char*) &innobase_log_arch_dir, SHOW_CHAR_PTR}, {"innodb_log_archive", (char*) &innobase_log_archive, SHOW_MY_BOOL}, @@ -626,60 +661,67 @@ struct show_var_st init_vars[]= { {"innodb_log_file_size", (char*) &innobase_log_file_size, SHOW_LONG}, {"innodb_log_files_in_group", (char*) &innobase_log_files_in_group, SHOW_LONG}, {"innodb_log_group_home_dir", (char*) &innobase_log_group_home_dir, SHOW_CHAR_PTR}, - {"innodb_mirrored_log_groups", (char*) &innobase_mirrored_log_groups, SHOW_LONG}, {sys_innodb_max_dirty_pages_pct.name, (char*) &sys_innodb_max_dirty_pages_pct, SHOW_SYS}, + {"innodb_mirrored_log_groups", (char*) &innobase_mirrored_log_groups, SHOW_LONG}, + {"innodb_open_files", (char*) &innobase_open_files, SHOW_LONG }, + {"innodb_thread_concurrency", (char*) &innobase_thread_concurrency, SHOW_LONG }, #endif {sys_interactive_timeout.name,(char*) &sys_interactive_timeout, SHOW_SYS}, {sys_join_buffer_size.name, (char*) &sys_join_buffer_size, SHOW_SYS}, {sys_key_buffer_size.name, (char*) &sys_key_buffer_size, SHOW_SYS}, + {sys_key_cache_age_threshold.name, (char*) &sys_key_cache_age_threshold, + SHOW_SYS}, {sys_key_cache_block_size.name, (char*) &sys_key_cache_block_size, - SHOW_SYS}, + SHOW_SYS}, {sys_key_cache_division_limit.name, (char*) &sys_key_cache_division_limit, - SHOW_SYS}, - {sys_key_cache_age_threshold.name, (char*) &sys_key_cache_age_threshold, - SHOW_SYS}, + SHOW_SYS}, {"language", language, SHOW_CHAR}, - {"large_files_support", (char*) &opt_large_files, SHOW_BOOL}, + {"large_files_support", (char*) &opt_large_files, SHOW_BOOL}, + {sys_license.name, (char*) &sys_license, SHOW_SYS}, {sys_local_infile.name, (char*) &sys_local_infile, SHOW_SYS}, #ifdef HAVE_MLOCKALL {"locked_in_memory", (char*) &locked_in_memory, SHOW_BOOL}, #endif {"log", (char*) &opt_log, SHOW_BOOL}, - {"log_update", (char*) &opt_update_log, SHOW_BOOL}, {"log_bin", (char*) &opt_bin_log, SHOW_BOOL}, + {"log_error", (char*) log_error_file, SHOW_CHAR}, #ifdef HAVE_REPLICATION {"log_slave_updates", (char*) &opt_log_slave_updates, SHOW_MY_BOOL}, #endif {"log_slow_queries", (char*) &opt_slow_log, SHOW_BOOL}, + {"log_update", (char*) &opt_update_log, SHOW_BOOL}, {sys_log_warnings.name, (char*) &sys_log_warnings, SHOW_SYS}, {sys_long_query_time.name, (char*) &sys_long_query_time, SHOW_SYS}, {sys_low_priority_updates.name, (char*) &sys_low_priority_updates, SHOW_SYS}, - {"lower_case_table_names", (char*) &lower_case_table_names, SHOW_MY_BOOL}, + {"lower_case_file_system", (char*) &lower_case_file_system, SHOW_BOOL}, + {"lower_case_table_names", (char*) &lower_case_table_names, SHOW_INT}, {sys_max_allowed_packet.name,(char*) &sys_max_allowed_packet, SHOW_SYS}, {sys_max_binlog_cache_size.name,(char*) &sys_max_binlog_cache_size, SHOW_SYS}, {sys_max_binlog_size.name, (char*) &sys_max_binlog_size, SHOW_SYS}, - {sys_max_connections.name, (char*) &sys_max_connections, SHOW_SYS}, {sys_max_connect_errors.name, (char*) &sys_max_connect_errors, SHOW_SYS}, - {sys_max_error_count.name, (char*) &sys_max_error_count, SHOW_SYS}, + {sys_max_connections.name, (char*) &sys_max_connections, SHOW_SYS}, {sys_max_delayed_threads.name,(char*) &sys_max_delayed_threads, SHOW_SYS}, + {sys_max_error_count.name, (char*) &sys_max_error_count, SHOW_SYS}, {sys_max_heap_table_size.name,(char*) &sys_max_heap_table_size, SHOW_SYS}, + {sys_max_insert_delayed_threads.name, + (char*) &sys_max_insert_delayed_threads, SHOW_SYS}, {sys_max_join_size.name, (char*) &sys_max_join_size, SHOW_SYS}, - {sys_max_relay_log_size.name, (char*) &sys_max_relay_log_size, SHOW_SYS}, - {sys_max_seeks_for_key.name, (char*) &sys_max_seeks_for_key, SHOW_SYS}, {sys_max_length_for_sort_data.name, (char*) &sys_max_length_for_sort_data, SHOW_SYS}, + {sys_max_relay_log_size.name, (char*) &sys_max_relay_log_size, SHOW_SYS}, + {sys_max_seeks_for_key.name, (char*) &sys_max_seeks_for_key, SHOW_SYS}, {sys_max_sort_length.name, (char*) &sys_max_sort_length, SHOW_SYS}, - {sys_max_user_connections.name,(char*) &sys_max_user_connections, SHOW_SYS}, {sys_max_tmp_tables.name, (char*) &sys_max_tmp_tables, SHOW_SYS}, + {sys_max_user_connections.name,(char*) &sys_max_user_connections, SHOW_SYS}, {sys_max_write_lock_count.name, (char*) &sys_max_write_lock_count,SHOW_SYS}, {sys_myisam_max_extra_sort_file_size.name, (char*) &sys_myisam_max_extra_sort_file_size, SHOW_SYS}, {sys_myisam_max_sort_file_size.name, (char*) &sys_myisam_max_sort_file_size, SHOW_SYS}, + {"myisam_recover_options", (char*) &myisam_recover_options_str, SHOW_CHAR_PTR}, {sys_myisam_repair_threads.name, (char*) &sys_myisam_repair_threads, SHOW_SYS}, - {"myisam_recover_options", (char*) &myisam_recover_options_str, SHOW_CHAR_PTR}, {sys_myisam_sort_buffer_size.name, (char*) &sys_myisam_sort_buffer_size, SHOW_SYS}, #ifdef __NT__ {"named_pipe", (char*) &opt_enable_named_pipe, SHOW_MY_BOOL}, @@ -692,10 +734,9 @@ struct show_var_st init_vars[]= { {sys_old_passwords.name, (char*) &sys_old_passwords, SHOW_SYS}, {"open_files_limit", (char*) &open_files_limit, SHOW_LONG}, {"pid_file", (char*) pidfile_name, SHOW_CHAR}, - {"log_error", (char*) log_error_file, SHOW_CHAR}, {"port", (char*) &mysqld_port, SHOW_INT}, - {"protocol_version", (char*) &protocol_version, SHOW_INT}, {sys_preload_buff_size.name, (char*) &sys_preload_buff_size, SHOW_SYS}, + {"protocol_version", (char*) &protocol_version, SHOW_INT}, {sys_query_alloc_block_size.name, (char*) &sys_query_alloc_block_size, SHOW_SYS}, #ifdef HAVE_QUERY_CACHE @@ -704,7 +745,6 @@ struct show_var_st init_vars[]= { SHOW_SYS}, {sys_query_cache_size.name, (char*) &sys_query_cache_size, SHOW_SYS}, {sys_query_cache_type.name, (char*) &sys_query_cache_type, SHOW_SYS}, - {"secure_auth", (char*) &sys_secure_auth, SHOW_SYS}, #endif /* HAVE_QUERY_CACHE */ {sys_query_prealloc_size.name, (char*) &sys_query_prealloc_size, SHOW_SYS}, {sys_range_alloc_block_size.name, (char*) &sys_range_alloc_block_size, @@ -716,18 +756,18 @@ struct show_var_st init_vars[]= { {sys_relay_log_purge.name, (char*) &sys_relay_log_purge, SHOW_SYS}, #endif {sys_rpl_recovery_rank.name,(char*) &sys_rpl_recovery_rank, SHOW_SYS}, + {"secure_auth", (char*) &sys_secure_auth, SHOW_SYS}, #ifdef HAVE_SMEM {"shared_memory", (char*) &opt_enable_shared_memory, SHOW_MY_BOOL}, {"shared_memory_base_name", (char*) &shared_memory_base_name, SHOW_CHAR_PTR}, #endif {sys_server_id.name, (char*) &sys_server_id, SHOW_SYS}, -#ifdef HAVE_REPLICATION - {sys_slave_net_timeout.name,(char*) &sys_slave_net_timeout, SHOW_SYS}, -#endif - {sys_readonly.name, (char*) &sys_readonly, SHOW_SYS}, {"skip_external_locking", (char*) &my_disable_locking, SHOW_MY_BOOL}, {"skip_networking", (char*) &opt_disable_networking, SHOW_BOOL}, {"skip_show_database", (char*) &opt_skip_show_db, SHOW_BOOL}, +#ifdef HAVE_REPLICATION + {sys_slave_net_timeout.name,(char*) &sys_slave_net_timeout, SHOW_SYS}, +#endif {sys_slow_launch_time.name, (char*) &sys_slow_launch_time, SHOW_SYS}, #ifdef HAVE_SYS_UN_H {"socket", (char*) &mysqld_unix_port, SHOW_CHAR_PTR}, @@ -742,7 +782,6 @@ struct show_var_st init_vars[]= { {"thread_concurrency", (char*) &concurrency, SHOW_LONG}, #endif {"thread_stack", (char*) &thread_stack, SHOW_LONG}, - {sys_tx_isolation.name, (char*) &sys_tx_isolation, SHOW_SYS}, {sys_time_format.name, (char*) &sys_time_format, SHOW_SYS}, #ifdef HAVE_TZNAME {"timezone", time_zone, SHOW_CHAR}, @@ -752,13 +791,14 @@ struct show_var_st init_vars[]= { {sys_trans_alloc_block_size.name, (char*) &sys_trans_alloc_block_size, SHOW_SYS}, {sys_trans_prealloc_size.name, (char*) &sys_trans_prealloc_size, SHOW_SYS}, + {sys_tx_isolation.name, (char*) &sys_tx_isolation, SHOW_SYS}, {"version", server_version, SHOW_CHAR}, #ifdef HAVE_BERKELEY_DB {"version_bdb", (char*) DB_VERSION_STRING, SHOW_CHAR}, #endif {"version_comment", (char*) MYSQL_COMPILATION_COMMENT, SHOW_CHAR}, {"version_compile_machine", (char*) MACHINE_TYPE, SHOW_CHAR}, - {"version_compile_os", (char*) SYSTEM_TYPE, SHOW_CHAR}, + {sys_os.name, (char*) &sys_os, SHOW_SYS}, {sys_net_wait_timeout.name, (char*) &sys_net_wait_timeout, SHOW_SYS}, {NullS, NullS, SHOW_LONG} }; @@ -770,6 +810,18 @@ bool sys_var::check(THD *thd, set_var *var) return 0; } +bool sys_var_str::check(THD *thd, set_var *var) +{ + int res; + if (!check_func) + return 0; + + if ((res=(*check_func)(thd, var)) < 0) + my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, + var->value->str_value.ptr()); + return res; +} + /* Functions to check and update variables */ @@ -786,15 +838,12 @@ bool sys_var::check(THD *thd, set_var *var) bool update_sys_var_str(sys_var_str *var_str, rw_lock_t *var_mutex, set_var *var) { - char *res= 0, *old_value; - uint new_length= 0; - /* If the string is "", delete old init command */ - if (var && (new_length= var->value->str_value.length())) - { - if (!(res= my_strdup_with_length((byte*) var->value->str_value.ptr(), - new_length, MYF(0)))) - return 1; - } + char *res= 0, *old_value=(char *)(var ? var->value->str_value.ptr() : 0); + uint new_length= (var ? var->value->str_value.length() : 0); + if (!old_value) + old_value= (char*) ""; + if (!(res= my_strdup_with_length(old_value, new_length, MYF(0)))) + return 1; /* Replace the old value in such a way that the any thread using the value will work. @@ -832,13 +881,37 @@ static void sys_default_init_slave(THD* thd, enum_var_type type) update_sys_var_str(&sys_init_slave, &LOCK_sys_init_slave, 0); } +static int sys_check_ftb_syntax(THD *thd, set_var *var) +{ + if (thd->master_access & SUPER_ACL) + return ft_boolean_check_syntax_string((byte*) var->value->str_value.c_ptr()) ? + -1 : 0; + else + { + my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER"); + return 1; + } +} + +static bool sys_update_ftb_syntax(THD *thd, set_var * var) +{ + strmake(ft_boolean_syntax, var->value->str_value.c_ptr(), + sizeof(ft_boolean_syntax)-1); + return 0; +} + +static void sys_default_ftb_syntax(THD *thd, enum_var_type type) +{ + strmake(ft_boolean_syntax, opt_ft_boolean_syntax, + sizeof(ft_boolean_syntax)-1); +} /* The following 3 functions need to be changed in 4.1 when we allow one to change character sets */ -static bool sys_check_charset(THD *thd, set_var *var) +static int sys_check_charset(THD *thd, set_var *var) { return 0; } @@ -1014,7 +1087,26 @@ static void fix_max_relay_log_size(THD *thd, enum_var_type type) static void fix_max_connections(THD *thd, enum_var_type type) { - resize_thr_alarm(max_connections + max_insert_delayed_threads + 10); + resize_thr_alarm(max_connections + + global_system_variables.max_insert_delayed_threads + 10); +} + + +static void fix_thd_mem_root(THD *thd, enum_var_type type) +{ + if (type != OPT_GLOBAL) + reset_root_defaults(&thd->mem_root, + thd->variables.query_alloc_block_size, + thd->variables.query_prealloc_size); +} + + +static void fix_trans_mem_root(THD *thd, enum_var_type type) +{ + if (type != OPT_GLOBAL) + reset_root_defaults(&thd->transaction.mem_root, + thd->variables.trans_alloc_block_size, + thd->variables.trans_prealloc_size); } bool sys_var_long_ptr::update(THD *thd, set_var *var) @@ -1082,6 +1174,11 @@ byte *sys_var_enum::value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) return (byte*) enum_names->type_names[*value]; } +bool sys_var_thd_ulong::check(THD *thd, set_var *var) +{ + return (sys_var_thd::check(thd, var) || + (check_func && (*check_func)(thd, var))); +} bool sys_var_thd_ulong::update(THD *thd, set_var *var) { @@ -1333,9 +1430,8 @@ Item *sys_var::item(THD *thd, enum_var_type var_type, LEX_STRING *base) { if (var_type != OPT_DEFAULT) { - net_printf(thd, - var_type == OPT_GLOBAL ? ER_LOCAL_VARIABLE : - ER_GLOBAL_VARIABLE, name); + net_printf(thd, ER_INCORRECT_GLOBAL_LOCAL_VAR, + name, var_type == OPT_GLOBAL ? "SESSION" : "GLOBAL"); return 0; } /* As there was no local variable, return the global value */ @@ -1412,6 +1508,11 @@ byte *sys_var_thd_enum::value_ptr(THD *thd, enum_var_type type, return (byte*) enum_names->type_names[tmp]; } +bool sys_var_thd_bit::check(THD *thd, set_var *var) +{ + return (check_enum(thd, var, &bool_typelib) || + (check_func && (*check_func)(thd, var))); +} bool sys_var_thd_bit::update(THD *thd, set_var *var) { @@ -1580,7 +1681,10 @@ bool sys_var_collation::check(THD *thd, set_var *var) String str(buff,sizeof(buff), system_charset_info), *res; if (!(res=var->value->val_str(&str))) - res= &my_empty_string; + { + my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, "NULL"); + return 1; + } if (!(tmp=get_charset_by_name(res->c_ptr(),MYF(0)))) { @@ -1602,7 +1706,7 @@ bool sys_var_character_set::check(THD *thd, set_var *var) { if (!nullable) { - my_error(ER_UNKNOWN_CHARACTER_SET, MYF(0), "NULL"); + my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, "NULL"); return 1; } tmp= NULL; @@ -1876,7 +1980,7 @@ byte *sys_var_key_cache_param::value_ptr(THD *thd, enum_var_type type, key_cache= &zero_key_cache; return (byte*) key_cache + offset ; } - + bool sys_var_key_buffer_size::update(THD *thd, set_var *var) { @@ -1971,14 +2075,14 @@ bool sys_var_key_cache_long::update(THD *thd, set_var *var) pthread_mutex_lock(&LOCK_global_system_variables); KEY_CACHE *key_cache= get_key_cache(base_name); - + if (!key_cache && !(key_cache= create_key_cache(base_name->str, base_name->length))) { error= 1; goto end; } - + /* Abort if some other thread is changing the key cache TODO: This should be changed so that we wait until the previous @@ -2080,28 +2184,12 @@ byte *sys_var_insert_id::value_ptr(THD *thd, enum_var_type type, return (byte*) &thd->current_insert_id; } -bool sys_var_pseudo_thread_id::check(THD *thd, set_var *var) -{ - var->save_result.ulonglong_value= var->value->val_int(); -#ifndef NO_EMBEDDED_ACCESS_CHECKS - if (thd->master_access & SUPER_ACL) - return 0; - else - { - my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER"); - return 1; - } -#else - return 0; -#endif -} - #ifdef HAVE_REPLICATION bool sys_var_slave_skip_counter::check(THD *thd, set_var *var) { int result= 0; - LOCK_ACTIVE_MI; + pthread_mutex_lock(&LOCK_active_mi); pthread_mutex_lock(&active_mi->rli.run_lock); if (active_mi->rli.slave_running) { @@ -2109,7 +2197,7 @@ bool sys_var_slave_skip_counter::check(THD *thd, set_var *var) result=1; } pthread_mutex_unlock(&active_mi->rli.run_lock); - UNLOCK_ACTIVE_MI; + pthread_mutex_unlock(&LOCK_active_mi); var->save_result.ulong_value= (ulong) var->value->val_int(); return result; } @@ -2117,7 +2205,7 @@ bool sys_var_slave_skip_counter::check(THD *thd, set_var *var) bool sys_var_slave_skip_counter::update(THD *thd, set_var *var) { - LOCK_ACTIVE_MI; + pthread_mutex_lock(&LOCK_active_mi); pthread_mutex_lock(&active_mi->rli.run_lock); /* The following test should normally never be true as we test this @@ -2131,7 +2219,7 @@ bool sys_var_slave_skip_counter::update(THD *thd, set_var *var) pthread_mutex_unlock(&active_mi->rli.data_lock); } pthread_mutex_unlock(&active_mi->rli.run_lock); - UNLOCK_ACTIVE_MI; + pthread_mutex_unlock(&LOCK_active_mi); return 0; } #endif /* HAVE_REPLICATION */ @@ -2194,6 +2282,17 @@ static bool set_option_autocommit(THD *thd, set_var *var) return 0; } +static int check_log_update(THD *thd, set_var *var) +{ +#ifndef NO_EMBEDDED_ACCESS_CHECKS + if (!(thd->master_access & SUPER_ACL)) + { + my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER"); + return 1; + } +#endif + return 0; +} static bool set_log_update(THD *thd, set_var *var) { @@ -2228,6 +2327,21 @@ static bool set_log_bin(THD *thd, set_var *var) return 0; } +static int check_pseudo_thread_id(THD *thd, set_var *var) +{ + var->save_result.ulonglong_value= var->value->val_int(); +#ifndef NO_EMBEDDED_ACCESS_CHECKS + if (thd->master_access & SUPER_ACL) + return 0; + else + { + my_error(ER_SPECIFIC_ACCESS_DENIED_ERROR, MYF(0), "SUPER"); + return 1; + } +#else + return 0; +#endif +} static byte *get_warning_count(THD *thd) { @@ -2460,7 +2574,7 @@ int set_var_user::check(THD *thd) { /* Item_func_set_user_var can't substitute something else on its place => - 0 can be passed as last argument + 0 can be passed as last argument (reference on item) */ return (user_var_item->fix_fields(thd, 0, (Item**) 0) || user_var_item->check()) ? -1 : 0; diff --git a/sql/share/danish/errmsg.txt b/sql/share/danish/errmsg.txt index 05c34236d03..ce444c8fad1 100644 --- a/sql/share/danish/errmsg.txt +++ b/sql/share/danish/errmsg.txt @@ -301,35 +301,6 @@ character-set=latin1 "Truncated wrong %-.32s value: '%-.128s'" "Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" "Invalid ON UPDATE clause for '%-.64s' field", -"Row %ld was truncated; It contained more data than there where input columns", -"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", -"Data truncated, out of range for column '%s' at row %ld", -"Data truncated for column '%s' at row %ld", -"Using storage engine %s for table '%s'", -"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", -"Can't drop one or more of the requested users", -"Can't revoke all privileges, grant for one or more of the requested users", -"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", -"Illegal mix of collations for operation '%s'", -"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)", -"Unknown collation: '%-.64s'", -"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support. They can be used later when MySQL slave with SSL will be started.", -"Server is running in --secure-auth mode, but '%s@%s' has a password in the old format; please change the password to the new format", -"Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT #%d was resolved in SELECT #%d", -"Wrong parameter or combination of parameters for START SLAVE UNTIL", -"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart", -"SQL thread is not to be started so UNTIL options are ignored", -"Incorrect index name '%-.100s'", -"Incorrect catalog name '%-.100s'", -"Query cache failed to set size %lu, new query cache size is %lu", -"Column '%-.64s' cannot be part of FULLTEXT index", -"Unknown key cache '%-.100s'", -"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", -"Unknown table engine '%s'", -"'%s' is deprecated. Use '%s' instead.", -"The target table %-.100s of the %s is not updatable.", -"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working" -"MySQL is started in --skip-grant-tables mode. You can't use this command" "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/share/dutch/errmsg.txt b/sql/share/dutch/errmsg.txt index 03174c83657..5ae00ef6421 100644 --- a/sql/share/dutch/errmsg.txt +++ b/sql/share/dutch/errmsg.txt @@ -309,35 +309,6 @@ character-set=latin1 "Truncated wrong %-.32s value: '%-.128s'" "Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" "Invalid ON UPDATE clause for '%-.64s' field", -"Row %ld was truncated; It contained more data than there where input columns", -"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", -"Data truncated, out of range for column '%s' at row %ld", -"Data truncated for column '%s' at row %ld", -"Using storage engine %s for table '%s'", -"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", -"Can't drop one or more of the requested users", -"Can't revoke all privileges, grant for one or more of the requested users", -"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", -"Illegal mix of collations for operation '%s'", -"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)", -"Unknown collation: '%-.64s'", -"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support. They can be used later when MySQL slave with SSL will be started.", -"Server is running in --secure-auth mode, but '%s@%s' has a password in the old format; please change the password to the new format", -"Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT #%d was resolved in SELECT #%d", -"Wrong parameter or combination of parameters for START SLAVE UNTIL", -"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart", -"SQL thread is not to be started so UNTIL options are ignored", -"Incorrect index name '%-.100s'", -"Incorrect catalog name '%-.100s'", -"Query cache failed to set size %lu, new query cache size is %lu", -"Column '%-.64s' cannot be part of FULLTEXT index", -"Unknown key cache '%-.100s'", -"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", -"Unknown table engine '%s'", -"'%s' is deprecated. Use '%s' instead.", -"The target table %-.100s of the %s is not updatable.", -"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working" -"MySQL is started in --skip-grant-tables mode. You can't use this command" "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt index f475d270a54..234d9cf3916 100644 --- a/sql/share/english/errmsg.txt +++ b/sql/share/english/errmsg.txt @@ -298,40 +298,6 @@ character-set=latin1 "Truncated wrong %-.32s value: '%-.128s'" "Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" "Invalid ON UPDATE clause for '%-.64s' field", -"ZLIB: Not enough memory available for zlib", -"ZLIB: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)", -"ZLIB: Input data was corrupted for zlib", -"%d line(s) was(were) cut by group_concat()", -"Row %ld doesn't contain data for all columns", -"Row %ld was truncated; It contained more data than there where input columns", -"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", -"Data truncated, out of range for column '%s' at row %ld", -"Data truncated for column '%s' at row %ld", -"Using storage engine %s for table '%s'", -"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", -"Can't drop one or more of the requested users", -"Can't revoke all privileges, grant for one or more of the requested users", -"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", -"Illegal mix of collations for operation '%s'", -"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)", -"Unknown collation: '%-.64s'", -"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support. They can be used later when MySQL slave with SSL will be started.", -"Server is running in --secure-auth mode, but '%s@%s' has a password in the old format; please change the password to the new format", -"Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT #%d was resolved in SELECT #%d", -"Wrong parameter or combination of parameters for START SLAVE UNTIL", -"It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL. Otherwise you will get problems if you get an unexpected slave's mysqld restart", -"SQL thread is not to be started so UNTIL options are ignored", -"Incorrect index name '%-.100s'", -"Incorrect catalog name '%-.100s'", -"Query cache failed to set size %lu, new query cache size is %lu", -"Column '%-.64s' cannot be part of FULLTEXT index", -"Unknown key cache '%-.100s'", -"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", -"Unknown table engine '%s'", -"'%s' is deprecated. Use '%s' instead.", -"The target table %-.100s of the %s is not updatable.", -"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working", -"MySQL is started in --skip-grant-tables mode. You can't use this command" "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/share/estonian/errmsg.txt b/sql/share/estonian/errmsg.txt index 161e2c6863d..275abf8690e 100644 --- a/sql/share/estonian/errmsg.txt +++ b/sql/share/estonian/errmsg.txt @@ -303,35 +303,6 @@ character-set=latin7 "Truncated wrong %-.32s value: '%-.128s'" "Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" "Invalid ON UPDATE clause for '%-.64s' field", -"Row %ld was truncated; It contained more data than there where input columns", -"Data truncated, NULL supplied to NOT NULL column '%s' at row %ld", -"Data truncated, out of range for column '%s' at row %ld", -"Data truncated for column '%s' at row %ld", -"Using storage engine %s for table '%s'", -"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", -"Can't drop one or more of the requested users", -"Can't revoke all privileges, grant for one or more of the requested users", -"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", -"Illegal mix of collations for operation '%s'", -"Variable '%-.64s' is not a variable component (Can't be used as XXXX.variable_name)", -"Unknown collation: '%-.64s'", -"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support. They can be used later when MySQL slave with SSL will be started.", -"Server is running in --secure-auth mode, but '%s@%s' has a password in the old format; please change the password to the new format", -"Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT #%d was resolved in SELECT #%d", -"Wrong parameter or combination of parameters for START SLAVE UNTIL", -"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL, otherwise you are not safe in case of unexpected slave's mysqld restart", -"SQL thread is not to be started so UNTIL options are ignored", -"Incorrect index name '%-.100s'", -"Incorrect catalog name '%-.100s'", -"Query cache failed to set size %lu, new query cache size is %lu", -"Column '%-.64s' cannot be part of FULLTEXT index", -"Unknown key cache '%-.100s'", -"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", -"Unknown table engine '%s'", -"'%s' is deprecated. Use '%s' instead.", -"The target table %-.100s of the %s is not updatable.", -"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working" -"MySQL is started in --skip-grant-tables mode. You can't use this command" "Can't create a %s from within another stored routine" "%s %s already exists" "%s %s does not exist" diff --git a/sql/sp.cc b/sql/sp.cc index 2be9ceeaad3..0d0152658b7 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -548,7 +548,7 @@ db_show_routine_status(THD *thd, int type, const char *wild) } /* Init fields */ - setup_tables(&tables, 0); + setup_tables(&tables); for (used_field= &used_fields[0]; used_field->field_name; used_field++) diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 3e1a41ed049..01e31b3e7a4 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1351,7 +1351,7 @@ bool delayed_insert::handle_inserts(void) on this table until all entries has been processed */ if (group_count++ >= max_rows && (row= rows.head()) && - (!(row->log_query & DELAYED_LOG_BIN && using_bin_log) || + (!(row->log_query & using_bin_log) || row->query)) { group_count=0; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 4b0ca67a549..54cf052643f 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1982,7 +1982,6 @@ int mysql_create_like_table(THD* thd, TABLE_LIST* table, } // Must be written before unlock - mysql_update_log.write(thd,thd->query, thd->query_length); if (mysql_bin_log.is_open()) { thd->clear_error(); |